Skip to content
This repository has been archived by the owner on Dec 27, 2022. It is now read-only.

[types] INodeService type improvement, IBrowserNode type #653

Open
3 tasks
LayneHaber opened this issue Jun 8, 2021 · 0 comments
Open
3 tasks

[types] INodeService type improvement, IBrowserNode type #653

LayneHaber opened this issue Jun 8, 2021 · 0 comments

Comments

@LayneHaber
Copy link
Contributor

LayneHaber commented Jun 8, 2021

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant