vector icon indicating copy to clipboard operation
vector copied to clipboard

[types] INodeService type improvement, IBrowserNode type

Open LayneHaber opened this issue 4 years ago • 0 comments

Describe the bug When using the new packages, you have to use async imports for everything at a higher level than the utils module, i.e. everything except for the types package.

In order to keep the sdk as strongly typed as possible this means:

  • [ ] making an IBrowserNode interface which should extend the INodeService interface:
export interface IBrowserNode extends INodeService {
  channelProvider: IRpcChannelProvider | undefined;
  connect(config: BrowserNodeSignerConfig): Promise<IBrowserNode>;
  init(params: { signature?: string; signer?: string }): Promise<void>;
}
  • [ ] making sure the INodeService interface is up to date. should add:
getConfig(): Promise<NodeResponses.GetConfig>;
withdrawRetry(
    params: OptionalPublicIdentifier<NodeParams.WithdrawRetry>,
): Promise<Result<NodeResponses.WithdrawRetry, VectorError>>;
addTransactionToCommitment(
    params: OptionalPublicIdentifier<NodeParams.AddTransactionToCommitment>,
): Promise<Result<void, VectorError>>;
  • [ ] Adding IRpcChannelProvider and BrowserNodeSignerConfig to the types module

After doing this, make sure to update the sdk package

LayneHaber avatar Jun 08 '21 22:06 LayneHaber