Skip to content
This repository was archived by the owner on Apr 18, 2025. It is now read-only.

Commit 3a69d07

Browse files
authored
Merge pull request #368 from blocto/release/0.8.0
Release: Merge to publish new version to npm
2 parents fcd3f87 + 2f70bc9 commit 3a69d07

File tree

487 files changed

+3204
-552426
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

487 files changed

+3204
-552426
lines changed

.github/workflows/test.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,7 @@ jobs:
3434
id: testWithCache
3535
run: yarn turbo lint test build --cache-dir=.turbo
3636
continue-on-error: true
37-
37+
3838
- name: Try to do again without cache
39-
if: failure() && steps.testWithCache.outcome == 'failure'
39+
if: steps.testWithCache.outcome == 'failure'
4040
run: yarn turbo lint test build --force --cache-dir=.turbo
41-

adapters/aptos-wallet-adapter-plugin/CHANGELOG.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,56 @@
11
# @blocto/aptos-wallet-adapter-plugin
22

3+
## 0.2.7
4+
5+
### Patch Changes
6+
7+
- b9dac7d: support web3js v4
8+
- 8d0b5bf: enhance in-app-sdk event support
9+
- 00a3832: sendAsync can send another requests
10+
- Updated dependencies [b9dac7d]
11+
- Updated dependencies [8d0b5bf]
12+
- Updated dependencies [55afe21]
13+
- Updated dependencies [3017eb1]
14+
- Updated dependencies [00a3832]
15+
- Updated dependencies [aa28bf6]
16+
- Updated dependencies [d34fca2]
17+
- @blocto/sdk@0.9.0
18+
19+
## 0.2.7-beta.1
20+
21+
### Patch Changes
22+
23+
- b9dac7d: support web3js v4
24+
- 00a3832: sendAsync can send another requests
25+
- Updated dependencies [b9dac7d]
26+
- Updated dependencies [55afe21]
27+
- Updated dependencies [3017eb1]
28+
- Updated dependencies [00a3832]
29+
- @blocto/sdk@0.9.0-beta.2
30+
31+
## 0.2.7-beta.0
32+
33+
### Patch Changes
34+
35+
- 8d0b5bf: enhance in-app-sdk event support
36+
- Updated dependencies [8d0b5bf]
37+
- @blocto/sdk@0.8.1-beta.0
38+
39+
## 0.2.6
40+
41+
### Patch Changes
42+
43+
- Updated dependencies [a4d3fbd]
44+
- @blocto/sdk@0.8.0
45+
46+
## 0.2.6-beta.0
47+
48+
### Patch Changes
49+
50+
- Updated dependencies [4835522]
51+
- Updated dependencies [e742f66]
52+
- @blocto/sdk@0.7.1-beta.0
53+
354
## 0.2.5
455

556
### Patch Changes

adapters/aptos-wallet-adapter-plugin/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@blocto/aptos-wallet-adapter-plugin",
3-
"version": "0.2.5",
3+
"version": "0.2.7",
44
"description": "Blocto Wallet plugin to use with Aptos Wallet Adapter",
55
"author": "Blocto Wallet",
66
"main": "./dist/index.js",
@@ -19,7 +19,7 @@
1919
},
2020
"dependencies": {
2121
"@aptos-labs/wallet-adapter-core": "^2.2.0",
22-
"@blocto/sdk": "^0.7.0",
22+
"@blocto/sdk": "^0.9.0",
2323
"aptos": "^1.9.1"
2424
},
2525
"devDependencies": {

adapters/connectkit-connector/CHANGELOG.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,43 @@
11
# @blocto/connectkit-connector
22

3+
## 0.2.2
4+
5+
### Patch Changes
6+
7+
- b9dac7d: support web3js v4
8+
- 8d0b5bf: enhance in-app-sdk event support
9+
- 00a3832: sendAsync can send another requests
10+
- Updated dependencies [b9dac7d]
11+
- Updated dependencies [8d0b5bf]
12+
- Updated dependencies [e075c22]
13+
- Updated dependencies [00a3832]
14+
- @blocto/wagmi-connector@1.3.0
15+
16+
## 0.2.2-beta.2
17+
18+
### Patch Changes
19+
20+
- Updated dependencies [fce0e50]
21+
- @blocto/wagmi-connector@1.3.0-beta.2
22+
23+
## 0.2.2-beta.1
24+
25+
### Patch Changes
26+
27+
- b9dac7d: support web3js v4
28+
- 00a3832: sendAsync can send another requests
29+
- Updated dependencies [b9dac7d]
30+
- Updated dependencies [00a3832]
31+
- @blocto/wagmi-connector@1.2.4-beta.1
32+
33+
## 0.2.2-beta.0
34+
35+
### Patch Changes
36+
37+
- 8d0b5bf: enhance in-app-sdk event support
38+
- Updated dependencies [8d0b5bf]
39+
- @blocto/wagmi-connector@1.2.4-beta.0
40+
341
## 0.2.1
442

543
### Patch Changes
@@ -8,6 +46,14 @@
846
- Updated dependencies [4835522]
947
- @blocto/wagmi-connector@1.2.2
1048

49+
## 0.2.1-beta.0
50+
51+
### Patch Changes
52+
53+
- 4835522: Fix export unreconize type for old typescript
54+
- Updated dependencies [4835522]
55+
- @blocto/wagmi-connector@1.2.2-beta.0
56+
1157
## 0.2.0
1258

1359
### Minor Changes

adapters/connectkit-connector/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "@blocto/connectkit-connector",
33
"description": "blocto wallet connector to use with connectkit",
44
"author": "Blocto Wallet",
5-
"version": "0.2.1",
5+
"version": "0.2.2",
66
"type": "module",
77
"main": "./dist/index.umd.cjs",
88
"module": "./dist/index.js",
@@ -30,7 +30,7 @@
3030
"/dist"
3131
],
3232
"dependencies": {
33-
"@blocto/wagmi-connector": "^1.2.2"
33+
"@blocto/wagmi-connector": "^1.3.0"
3434
},
3535
"peerDependencies": {
3636
"connectkit": "^1.5.3",

adapters/rainbowkit-connector/CHANGELOG.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,43 @@
11
# @blocto/rainbowkit-connector
22

3+
## 0.2.8
4+
5+
### Patch Changes
6+
7+
- b9dac7d: support web3js v4
8+
- 8d0b5bf: enhance in-app-sdk event support
9+
- 00a3832: sendAsync can send another requests
10+
- Updated dependencies [b9dac7d]
11+
- Updated dependencies [8d0b5bf]
12+
- Updated dependencies [e075c22]
13+
- Updated dependencies [00a3832]
14+
- @blocto/wagmi-connector@1.3.0
15+
16+
## 0.2.8-beta.2
17+
18+
### Patch Changes
19+
20+
- Updated dependencies [fce0e50]
21+
- @blocto/wagmi-connector@1.3.0-beta.2
22+
23+
## 0.2.8-beta.1
24+
25+
### Patch Changes
26+
27+
- b9dac7d: support web3js v4
28+
- 00a3832: sendAsync can send another requests
29+
- Updated dependencies [b9dac7d]
30+
- Updated dependencies [00a3832]
31+
- @blocto/wagmi-connector@1.2.4-beta.1
32+
33+
## 0.2.8-beta.0
34+
35+
### Patch Changes
36+
37+
- 8d0b5bf: enhance in-app-sdk event support
38+
- Updated dependencies [8d0b5bf]
39+
- @blocto/wagmi-connector@1.2.4-beta.0
40+
341
## 0.2.7
442

543
### Patch Changes
@@ -8,6 +46,14 @@
846
- Updated dependencies [4835522]
947
- @blocto/wagmi-connector@1.2.2
1048

49+
## 0.2.7-beta.0
50+
51+
### Patch Changes
52+
53+
- 4835522: Fix export unreconize type for old typescript
54+
- Updated dependencies [4835522]
55+
- @blocto/wagmi-connector@1.2.2-beta.0
56+
1157
## 0.2.6
1258

1359
### Patch Changes

adapters/rainbowkit-connector/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@blocto/rainbowkit-connector",
3-
"version": "0.2.7",
3+
"version": "0.2.8",
44
"description": "blocto wallet connector to use rainbowkit",
55
"author": "Blocto Wallet",
66
"main": "./dist/index.js",
@@ -34,7 +34,7 @@
3434
},
3535
"dependencies": {
3636
"@rainbow-me/rainbowkit": "^1.0.8",
37-
"@blocto/wagmi-connector": "^1.2.2"
37+
"@blocto/wagmi-connector": "^1.3.0"
3838
},
3939
"devDependencies": {
4040
"@types/jest": "^29.5.2",

adapters/wagmi-connector/CHANGELOG.md

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,63 @@
11
# @blocto/wagmi-connector
22

3+
## 1.3.0
4+
5+
### Minor Changes
6+
7+
- e075c22: Get blocto support list through api
8+
9+
### Patch Changes
10+
11+
- b9dac7d: support web3js v4
12+
- 8d0b5bf: enhance in-app-sdk event support
13+
- 00a3832: sendAsync can send another requests
14+
- Updated dependencies [b9dac7d]
15+
- Updated dependencies [8d0b5bf]
16+
- Updated dependencies [55afe21]
17+
- Updated dependencies [3017eb1]
18+
- Updated dependencies [00a3832]
19+
- Updated dependencies [aa28bf6]
20+
- Updated dependencies [d34fca2]
21+
- @blocto/sdk@0.9.0
22+
23+
## 1.3.0-beta.2
24+
25+
### Minor Changes
26+
27+
- fce0e50: Get blocto support list through api
28+
29+
### Patch Changes
30+
31+
- Updated dependencies [d34fca2]
32+
- @blocto/sdk@0.9.0-beta.3
33+
34+
## 1.2.4-beta.1
35+
36+
### Patch Changes
37+
38+
- b9dac7d: support web3js v4
39+
- 00a3832: sendAsync can send another requests
40+
- Updated dependencies [b9dac7d]
41+
- Updated dependencies [55afe21]
42+
- Updated dependencies [3017eb1]
43+
- Updated dependencies [00a3832]
44+
- @blocto/sdk@0.9.0-beta.2
45+
46+
## 1.2.4-beta.0
47+
48+
### Patch Changes
49+
50+
- 8d0b5bf: enhance in-app-sdk event support
51+
- Updated dependencies [8d0b5bf]
52+
- @blocto/sdk@0.8.1-beta.0
53+
54+
## 1.2.3
55+
56+
### Patch Changes
57+
58+
- Updated dependencies [a4d3fbd]
59+
- @blocto/sdk@0.8.0
60+
361
## 1.2.2
462

563
### Patch Changes
@@ -10,6 +68,15 @@
1068
- Updated dependencies [e742f66]
1169
- @blocto/sdk@0.7.1
1270

71+
## 1.2.2-beta.0
72+
73+
### Patch Changes
74+
75+
- 4835522: Fix export unreconize type for old typescript
76+
- Updated dependencies [4835522]
77+
- Updated dependencies [e742f66]
78+
- @blocto/sdk@0.7.1-beta.0
79+
1380
## 1.2.1
1481

1582
### Patch Changes

adapters/wagmi-connector/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "@blocto/wagmi-connector",
33
"description": "Blocto wallet connector extend from wagmi Connector",
44
"author": "Calvin Chang",
5-
"version": "1.2.2",
5+
"version": "1.3.0",
66
"type": "module",
77
"main": "./dist/index.umd.cjs",
88
"module": "./dist/index.js",
@@ -28,7 +28,7 @@
2828
"/dist"
2929
],
3030
"dependencies": {
31-
"@blocto/sdk": "^0.7.1"
31+
"@blocto/sdk": "^0.9.0"
3232
},
3333
"peerDependencies": {
3434
"@wagmi/core": ">=1",

adapters/wagmi-connector/src/connector.ts

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ class BloctoConnector extends Connector<BloctoProvider, BloctoOptions> {
5757
const _chainId = chainId ?? this.chains[0]?.id;
5858
const config: EthereumProviderConfig = {
5959
chainId: _chainId,
60-
rpc:
61-
this.chains.find((x) => x.id === _chainId)?.rpcUrls.default.http?.[0],
60+
rpc: this.chains.find((x) => x.id === _chainId)?.rpcUrls.default
61+
.http?.[0],
6262
};
6363
this.#provider = new BloctoSDK({ ethereum: config, appId })?.ethereum;
6464
}
@@ -133,22 +133,26 @@ class BloctoConnector extends Connector<BloctoProvider, BloctoOptions> {
133133
}
134134

135135
async switchChain(chainId: number): Promise<Chain> {
136-
const provider = await this.getProvider();
137-
const id = numberToHex(chainId);
138-
const chain = this.chains.find((x) => x.id === chainId);
139-
const isBloctoSupportChain =
140-
provider._blocto.supportNetworkList[`${chainId}`];
141-
142-
if (!chain || !isBloctoSupportChain) {
143-
throw new SwitchChainError(new Error(`Blocto unsupported chain: ${id}`));
144-
}
145-
146136
try {
137+
const provider = await this.getProvider();
138+
const id = numberToHex(chainId);
139+
const chain = this.chains.find((x) => x.id === chainId);
140+
const networks = await provider.supportChainList();
141+
const evmSupportMap = networks.reduce(
142+
(a: any, v: any) => ({ ...a, [v.chain_id]: v }),
143+
{}
144+
);
145+
const isBloctoSupportChain = evmSupportMap[`${chainId}`];
146+
147+
if (!chain || !isBloctoSupportChain) {
148+
throw new SwitchChainError(
149+
new Error(`Blocto unsupported chain: ${id}`)
150+
);
151+
}
152+
147153
await provider.request({
148154
method: 'wallet_addEthereumChain',
149-
params: [
150-
{ chainId: id, rpcUrls: chain?.rpcUrls.default.http },
151-
],
155+
params: [{ chainId: id, rpcUrls: chain?.rpcUrls.default.http }],
152156
});
153157
await provider.request({
154158
method: 'wallet_switchEthereumChain',

0 commit comments

Comments
 (0)