Skip to content

Commit

Permalink
Merge pull request #368 from blocto/release/0.8.0
Browse files Browse the repository at this point in the history
Release: Merge to publish new version to npm
  • Loading branch information
mordochi authored Jan 8, 2024
2 parents fcd3f87 + 2f70bc9 commit 3a69d07
Show file tree
Hide file tree
Showing 487 changed files with 3,204 additions and 552,426 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@ jobs:
id: testWithCache
run: yarn turbo lint test build --cache-dir=.turbo
continue-on-error: true

- name: Try to do again without cache
if: failure() && steps.testWithCache.outcome == 'failure'
if: steps.testWithCache.outcome == 'failure'
run: yarn turbo lint test build --force --cache-dir=.turbo

51 changes: 51 additions & 0 deletions adapters/aptos-wallet-adapter-plugin/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,56 @@
# @blocto/aptos-wallet-adapter-plugin

## 0.2.7

### Patch Changes

- b9dac7d: support web3js v4
- 8d0b5bf: enhance in-app-sdk event support
- 00a3832: sendAsync can send another requests
- Updated dependencies [b9dac7d]
- Updated dependencies [8d0b5bf]
- Updated dependencies [55afe21]
- Updated dependencies [3017eb1]
- Updated dependencies [00a3832]
- Updated dependencies [aa28bf6]
- Updated dependencies [d34fca2]
- @blocto/sdk@0.9.0

## 0.2.7-beta.1

### Patch Changes

- b9dac7d: support web3js v4
- 00a3832: sendAsync can send another requests
- Updated dependencies [b9dac7d]
- Updated dependencies [55afe21]
- Updated dependencies [3017eb1]
- Updated dependencies [00a3832]
- @blocto/sdk@0.9.0-beta.2

## 0.2.7-beta.0

### Patch Changes

- 8d0b5bf: enhance in-app-sdk event support
- Updated dependencies [8d0b5bf]
- @blocto/sdk@0.8.1-beta.0

## 0.2.6

### Patch Changes

- Updated dependencies [a4d3fbd]
- @blocto/sdk@0.8.0

## 0.2.6-beta.0

### Patch Changes

- Updated dependencies [4835522]
- Updated dependencies [e742f66]
- @blocto/sdk@0.7.1-beta.0

## 0.2.5

### Patch Changes
Expand Down
4 changes: 2 additions & 2 deletions adapters/aptos-wallet-adapter-plugin/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@blocto/aptos-wallet-adapter-plugin",
"version": "0.2.5",
"version": "0.2.7",
"description": "Blocto Wallet plugin to use with Aptos Wallet Adapter",
"author": "Blocto Wallet",
"main": "./dist/index.js",
Expand All @@ -19,7 +19,7 @@
},
"dependencies": {
"@aptos-labs/wallet-adapter-core": "^2.2.0",
"@blocto/sdk": "^0.7.0",
"@blocto/sdk": "^0.9.0",
"aptos": "^1.9.1"
},
"devDependencies": {
Expand Down
46 changes: 46 additions & 0 deletions adapters/connectkit-connector/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,43 @@
# @blocto/connectkit-connector

## 0.2.2

### Patch Changes

- b9dac7d: support web3js v4
- 8d0b5bf: enhance in-app-sdk event support
- 00a3832: sendAsync can send another requests
- Updated dependencies [b9dac7d]
- Updated dependencies [8d0b5bf]
- Updated dependencies [e075c22]
- Updated dependencies [00a3832]
- @blocto/wagmi-connector@1.3.0

## 0.2.2-beta.2

### Patch Changes

- Updated dependencies [fce0e50]
- @blocto/wagmi-connector@1.3.0-beta.2

## 0.2.2-beta.1

### Patch Changes

- b9dac7d: support web3js v4
- 00a3832: sendAsync can send another requests
- Updated dependencies [b9dac7d]
- Updated dependencies [00a3832]
- @blocto/wagmi-connector@1.2.4-beta.1

## 0.2.2-beta.0

### Patch Changes

- 8d0b5bf: enhance in-app-sdk event support
- Updated dependencies [8d0b5bf]
- @blocto/wagmi-connector@1.2.4-beta.0

## 0.2.1

### Patch Changes
Expand All @@ -8,6 +46,14 @@
- Updated dependencies [4835522]
- @blocto/wagmi-connector@1.2.2

## 0.2.1-beta.0

### Patch Changes

- 4835522: Fix export unreconize type for old typescript
- Updated dependencies [4835522]
- @blocto/wagmi-connector@1.2.2-beta.0

## 0.2.0

### Minor Changes
Expand Down
4 changes: 2 additions & 2 deletions adapters/connectkit-connector/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@blocto/connectkit-connector",
"description": "blocto wallet connector to use with connectkit",
"author": "Blocto Wallet",
"version": "0.2.1",
"version": "0.2.2",
"type": "module",
"main": "./dist/index.umd.cjs",
"module": "./dist/index.js",
Expand Down Expand Up @@ -30,7 +30,7 @@
"/dist"
],
"dependencies": {
"@blocto/wagmi-connector": "^1.2.2"
"@blocto/wagmi-connector": "^1.3.0"
},
"peerDependencies": {
"connectkit": "^1.5.3",
Expand Down
46 changes: 46 additions & 0 deletions adapters/rainbowkit-connector/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,43 @@
# @blocto/rainbowkit-connector

## 0.2.8

### Patch Changes

- b9dac7d: support web3js v4
- 8d0b5bf: enhance in-app-sdk event support
- 00a3832: sendAsync can send another requests
- Updated dependencies [b9dac7d]
- Updated dependencies [8d0b5bf]
- Updated dependencies [e075c22]
- Updated dependencies [00a3832]
- @blocto/wagmi-connector@1.3.0

## 0.2.8-beta.2

### Patch Changes

- Updated dependencies [fce0e50]
- @blocto/wagmi-connector@1.3.0-beta.2

## 0.2.8-beta.1

### Patch Changes

- b9dac7d: support web3js v4
- 00a3832: sendAsync can send another requests
- Updated dependencies [b9dac7d]
- Updated dependencies [00a3832]
- @blocto/wagmi-connector@1.2.4-beta.1

## 0.2.8-beta.0

### Patch Changes

- 8d0b5bf: enhance in-app-sdk event support
- Updated dependencies [8d0b5bf]
- @blocto/wagmi-connector@1.2.4-beta.0

## 0.2.7

### Patch Changes
Expand All @@ -8,6 +46,14 @@
- Updated dependencies [4835522]
- @blocto/wagmi-connector@1.2.2

## 0.2.7-beta.0

### Patch Changes

- 4835522: Fix export unreconize type for old typescript
- Updated dependencies [4835522]
- @blocto/wagmi-connector@1.2.2-beta.0

## 0.2.6

### Patch Changes
Expand Down
4 changes: 2 additions & 2 deletions adapters/rainbowkit-connector/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@blocto/rainbowkit-connector",
"version": "0.2.7",
"version": "0.2.8",
"description": "blocto wallet connector to use rainbowkit",
"author": "Blocto Wallet",
"main": "./dist/index.js",
Expand Down Expand Up @@ -34,7 +34,7 @@
},
"dependencies": {
"@rainbow-me/rainbowkit": "^1.0.8",
"@blocto/wagmi-connector": "^1.2.2"
"@blocto/wagmi-connector": "^1.3.0"
},
"devDependencies": {
"@types/jest": "^29.5.2",
Expand Down
67 changes: 67 additions & 0 deletions adapters/wagmi-connector/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,63 @@
# @blocto/wagmi-connector

## 1.3.0

### Minor Changes

- e075c22: Get blocto support list through api

### Patch Changes

- b9dac7d: support web3js v4
- 8d0b5bf: enhance in-app-sdk event support
- 00a3832: sendAsync can send another requests
- Updated dependencies [b9dac7d]
- Updated dependencies [8d0b5bf]
- Updated dependencies [55afe21]
- Updated dependencies [3017eb1]
- Updated dependencies [00a3832]
- Updated dependencies [aa28bf6]
- Updated dependencies [d34fca2]
- @blocto/sdk@0.9.0

## 1.3.0-beta.2

### Minor Changes

- fce0e50: Get blocto support list through api

### Patch Changes

- Updated dependencies [d34fca2]
- @blocto/sdk@0.9.0-beta.3

## 1.2.4-beta.1

### Patch Changes

- b9dac7d: support web3js v4
- 00a3832: sendAsync can send another requests
- Updated dependencies [b9dac7d]
- Updated dependencies [55afe21]
- Updated dependencies [3017eb1]
- Updated dependencies [00a3832]
- @blocto/sdk@0.9.0-beta.2

## 1.2.4-beta.0

### Patch Changes

- 8d0b5bf: enhance in-app-sdk event support
- Updated dependencies [8d0b5bf]
- @blocto/sdk@0.8.1-beta.0

## 1.2.3

### Patch Changes

- Updated dependencies [a4d3fbd]
- @blocto/sdk@0.8.0

## 1.2.2

### Patch Changes
Expand All @@ -10,6 +68,15 @@
- Updated dependencies [e742f66]
- @blocto/sdk@0.7.1

## 1.2.2-beta.0

### Patch Changes

- 4835522: Fix export unreconize type for old typescript
- Updated dependencies [4835522]
- Updated dependencies [e742f66]
- @blocto/sdk@0.7.1-beta.0

## 1.2.1

### Patch Changes
Expand Down
4 changes: 2 additions & 2 deletions adapters/wagmi-connector/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@blocto/wagmi-connector",
"description": "Blocto wallet connector extend from wagmi Connector",
"author": "Calvin Chang",
"version": "1.2.2",
"version": "1.3.0",
"type": "module",
"main": "./dist/index.umd.cjs",
"module": "./dist/index.js",
Expand All @@ -28,7 +28,7 @@
"/dist"
],
"dependencies": {
"@blocto/sdk": "^0.7.1"
"@blocto/sdk": "^0.9.0"
},
"peerDependencies": {
"@wagmi/core": ">=1",
Expand Down
34 changes: 19 additions & 15 deletions adapters/wagmi-connector/src/connector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ class BloctoConnector extends Connector<BloctoProvider, BloctoOptions> {
const _chainId = chainId ?? this.chains[0]?.id;
const config: EthereumProviderConfig = {
chainId: _chainId,
rpc:
this.chains.find((x) => x.id === _chainId)?.rpcUrls.default.http?.[0],
rpc: this.chains.find((x) => x.id === _chainId)?.rpcUrls.default
.http?.[0],
};
this.#provider = new BloctoSDK({ ethereum: config, appId })?.ethereum;
}
Expand Down Expand Up @@ -133,22 +133,26 @@ class BloctoConnector extends Connector<BloctoProvider, BloctoOptions> {
}

async switchChain(chainId: number): Promise<Chain> {
const provider = await this.getProvider();
const id = numberToHex(chainId);
const chain = this.chains.find((x) => x.id === chainId);
const isBloctoSupportChain =
provider._blocto.supportNetworkList[`${chainId}`];

if (!chain || !isBloctoSupportChain) {
throw new SwitchChainError(new Error(`Blocto unsupported chain: ${id}`));
}

try {
const provider = await this.getProvider();
const id = numberToHex(chainId);
const chain = this.chains.find((x) => x.id === chainId);
const networks = await provider.supportChainList();
const evmSupportMap = networks.reduce(
(a: any, v: any) => ({ ...a, [v.chain_id]: v }),
{}
);
const isBloctoSupportChain = evmSupportMap[`${chainId}`];

if (!chain || !isBloctoSupportChain) {
throw new SwitchChainError(
new Error(`Blocto unsupported chain: ${id}`)
);
}

await provider.request({
method: 'wallet_addEthereumChain',
params: [
{ chainId: id, rpcUrls: chain?.rpcUrls.default.http },
],
params: [{ chainId: id, rpcUrls: chain?.rpcUrls.default.http }],
});
await provider.request({
method: 'wallet_switchEthereumChain',
Expand Down
Loading

0 comments on commit 3a69d07

Please sign in to comment.