From 5353b8be99562f0f60cee07ee0e46f730b41eff3 Mon Sep 17 00:00:00 2001 From: guanbinrui Date: Wed, 15 Jun 2022 14:30:32 +0800 Subject: [PATCH] fix: failed to connect wallet in a single request --- packages/plugin-infra/src/web3-state/Provider.ts | 2 +- packages/plugins/Solana/src/apis/shared.ts | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/plugin-infra/src/web3-state/Provider.ts b/packages/plugin-infra/src/web3-state/Provider.ts index f712d5a94370..080adc4b39ef 100644 --- a/packages/plugin-infra/src/web3-state/Provider.ts +++ b/packages/plugin-infra/src/web3-state/Provider.ts @@ -179,8 +179,8 @@ export class ProviderState< } // update local storage - await this.setAccount(providerType, account) await this.setProvider(providerType) + await this.setAccount(providerType, account) provider.emitter.emit('connect', account) return account diff --git a/packages/plugins/Solana/src/apis/shared.ts b/packages/plugins/Solana/src/apis/shared.ts index 73be8f30a80e..a1876f942e5a 100644 --- a/packages/plugins/Solana/src/apis/shared.ts +++ b/packages/plugins/Solana/src/apis/shared.ts @@ -72,6 +72,7 @@ export interface ProgramAccount { export type GetProgramAccountsResponse = RpcResponse let id = 0 + export async function requestRPC(chainId: ChainId, options: RpcOptions): Promise { const endpoint = NETWORK_ENDPOINTS[chainId] id += 1