vector
vector copied to clipboard
[types] INodeService type improvement, IBrowserNode type
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
IBrowserNodeinterface which should extend theINodeServiceinterface:
export interface IBrowserNode extends INodeService {
channelProvider: IRpcChannelProvider | undefined;
connect(config: BrowserNodeSignerConfig): Promise<IBrowserNode>;
init(params: { signature?: string; signer?: string }): Promise<void>;
}
- [ ] making sure the
INodeServiceinterface 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
IRpcChannelProviderandBrowserNodeSignerConfigto the types module
After doing this, make sure to update the sdk package