Skip to content

Commit

Permalink
Merge pull request #318 from blocto/release/0.7.1
Browse files Browse the repository at this point in the history
Release: Merge to publish new version to npm
  • Loading branch information
sanyu1225 authored Oct 26, 2023
2 parents d1d765f + 4f1f91a commit b0c011c
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 5 deletions.
1 change: 1 addition & 0 deletions adapters/wagmi-connector/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
### Patch Changes

- 4835522: Fix export unreconize type for old typescript
- Updated dependencies [58ef7a0]
- Updated dependencies [4835522]
- Updated dependencies [e742f66]
- @blocto/sdk@0.7.1
Expand Down
2 changes: 1 addition & 1 deletion adapters/wagmi-connector/src/connector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ class BloctoConnector extends Connector<BloctoProvider, BloctoOptions> {
account,
chain,
transport: custom(provider),
});
}) as WalletClient;
}

protected onAccountsChanged(): void {
Expand Down
2 changes: 2 additions & 0 deletions adapters/web3-react-connector/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
### Patch Changes

- 4835522: Fix export unreconize type for old typescript
- 1d05082: refactor: adjust web3-react-connector's activate method to comply with @blocto/sdk's changes
- Updated dependencies [58ef7a0]
- Updated dependencies [4835522]
- Updated dependencies [e742f66]
- @blocto/sdk@0.7.1
Expand Down
2 changes: 1 addition & 1 deletion adapters/web3-react-connector/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export class BloctoConnector extends Connector {
!desiredChainId ||
parseChainId(desiredChainId) === parseChainId(this.provider.chainId)
) {
const accounts = await this.provider.request({ method: 'eth_accounts' });
const accounts = await this.provider.request({ method: 'eth_requestAccounts' });
return this.actions.update({
chainId: parseChainId(this.provider.chainId),
accounts,
Expand Down
1 change: 1 addition & 0 deletions packages/blocto-sdk/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

### Patch Changes

- 58ef7a0: adjust eth_accounts to not require prior enable
- 4835522: Fix export unreconize type for old typescript
- e742f66: AccountChange use addSelfRemovableHandler

Expand Down
6 changes: 3 additions & 3 deletions packages/blocto-sdk/src/providers/ethereum.ts
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,8 @@ export default class EthereumProvider
case 'wallet_disconnect': {
return this.handleDisconnect();
}
case 'eth_accounts':
return getEvmAddress(sessionKey, blockchainName) || [];
}

// Method that requires user to be connected
Expand All @@ -369,13 +371,11 @@ export default class EthereumProvider
try {
let response = null;
let result = null;

switch (payload.method) {
case 'eth_requestAccounts':
await this.fetchAccounts();
// eslint-disable-next-line
case 'eth_accounts':
result = getEvmAddress(sessionKey, blockchainName);
break;
case 'eth_coinbase': {
result = getEvmAddress(sessionKey, blockchainName)?.[0];
break;
Expand Down

0 comments on commit b0c011c

Please sign in to comment.