Skip to content

Commit 8aa2cef

Browse files
Merge branch 'main' into main
2 parents 1f3f796 + 2a96b39 commit 8aa2cef

File tree

56 files changed

+320
-80
lines changed

Some content is hidden

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

56 files changed

+320
-80
lines changed

examples/react/CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,14 @@
33
All notable changes to this project will be documented in this file.
44
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
55

6+
## [0.2.214](https://github.com/hyperweb-io/interchain-kit/compare/@interchain-kit/[email protected]...@interchain-kit/[email protected]) (2025-04-08)
7+
8+
**Note:** Version bump only for package @interchain-kit/react-examples
9+
10+
## [0.2.213](https://github.com/hyperweb-io/interchain-kit/compare/@interchain-kit/[email protected]...@interchain-kit/[email protected]) (2025-04-08)
11+
12+
**Note:** Version bump only for package @interchain-kit/react-examples
13+
614
## [0.2.212](https://github.com/hyperweb-io/interchain-kit/compare/@interchain-kit/[email protected]...@interchain-kit/[email protected]) (2025-04-08)
715

816
**Note:** Version bump only for package @interchain-kit/react-examples

examples/react/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "@interchain-kit/react-examples",
33
"author": "Hyperweb <[email protected]>",
44
"description": "interchain-kit wallet connector core package",
5-
"version": "0.2.212",
5+
"version": "0.2.214",
66
"type": "module",
77
"private": true,
88
"scripts": {
@@ -25,7 +25,7 @@
2525
"@cosmjs/proto-signing": "^0.32.4",
2626
"@esbuild-plugins/node-globals-polyfill": "^0.2.3",
2727
"@interchain-kit/coin98-extension": "^0.1.0",
28-
"@interchain-kit/compass-extension": "0.2.212",
28+
"@interchain-kit/compass-extension": "0.2.214",
2929
"@interchain-kit/core": "^0.1.0",
3030
"@interchain-kit/cosmos-extension-metamask": "^0.1.0",
3131
"@interchain-kit/keplr-extension": "^0.1.0",

examples/vanilla/CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,14 @@
33
All notable changes to this project will be documented in this file.
44
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
55

6+
## [0.2.214](https://github.com/hyperweb-io/interchain-kit/compare/@interchain-kit/[email protected]...@interchain-kit/[email protected]) (2025-04-08)
7+
8+
**Note:** Version bump only for package @interchain-kit/vanilla-examples
9+
10+
## [0.2.213](https://github.com/hyperweb-io/interchain-kit/compare/@interchain-kit/[email protected]...@interchain-kit/[email protected]) (2025-04-08)
11+
12+
**Note:** Version bump only for package @interchain-kit/vanilla-examples
13+
614
## [0.2.212](https://github.com/hyperweb-io/interchain-kit/compare/@interchain-kit/[email protected]...@interchain-kit/[email protected]) (2025-04-08)
715

816
**Note:** Version bump only for package @interchain-kit/vanilla-examples

examples/vanilla/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "@interchain-kit/vanilla-examples",
33
"author": "Hyperweb <[email protected]>",
44
"description": "interchain-kit wallet connector core package",
5-
"version": "0.2.212",
5+
"version": "0.2.214",
66
"type": "module",
77
"private": true,
88
"scripts": {

examples/vue/CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,14 @@
33
All notable changes to this project will be documented in this file.
44
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
55

6+
## [0.2.214](https://github.com/hyperweb-io/interchain-kit/compare/@interchain-kit/[email protected]...@interchain-kit/[email protected]) (2025-04-08)
7+
8+
**Note:** Version bump only for package @interchain-kit/vue-examples
9+
10+
## [0.2.213](https://github.com/hyperweb-io/interchain-kit/compare/@interchain-kit/[email protected]...@interchain-kit/[email protected]) (2025-04-08)
11+
12+
**Note:** Version bump only for package @interchain-kit/vue-examples
13+
614
## [0.2.212](https://github.com/hyperweb-io/interchain-kit/compare/@interchain-kit/[email protected]...@interchain-kit/[email protected]) (2025-04-08)
715

816
**Note:** Version bump only for package @interchain-kit/vue-examples

examples/vue/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@interchain-kit/vue-examples",
3-
"version": "0.2.212",
3+
"version": "0.2.214",
44
"type": "module",
55
"private": true,
66
"scripts": {

packages/core/CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,14 @@
33
All notable changes to this project will be documented in this file.
44
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
55

6+
## [0.2.214](https://github.com/@interchain-kit/core/compare/@interchain-kit/[email protected]...@interchain-kit/[email protected]) (2025-04-08)
7+
8+
**Note:** Version bump only for package @interchain-kit/core
9+
10+
## [0.2.213](https://github.com/@interchain-kit/core/compare/@interchain-kit/[email protected]...@interchain-kit/[email protected]) (2025-04-08)
11+
12+
**Note:** Version bump only for package @interchain-kit/core
13+
614
## [0.2.212](https://github.com/@interchain-kit/core/compare/@interchain-kit/[email protected]...@interchain-kit/[email protected]) (2025-04-08)
715

816
**Note:** Version bump only for package @interchain-kit/core

packages/core/__tests__/wallet-manager.test.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,16 @@ describe('WalletManager', () => {
9393

9494
});
9595

96+
it('should set assetLists for wallets, after walletManager constructor', () => {
97+
expect(wallet1.assetLists).toStrictEqual([assetList1, assetList2]);
98+
expect(wallet2.assetLists).toStrictEqual([assetList1, assetList2]);
99+
})
100+
101+
it('should set chainMap for wallets, after walletManager constructor', () => {
102+
expect(wallet1.chainMap.get(chain1.chainId)).toEqual(chain1);
103+
expect(wallet2.chainMap.get(chain1.chainId)).toEqual(chain1);
104+
});
105+
96106
it('should initialize wallets', async () => {
97107
wallet1.init = jest.fn();
98108
wallet2.init = jest.fn();

packages/core/__tests__/wallets/cosmos-wallet.test.ts

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ describe('CosmosWallet', () => {
5858
expect(mockClient.enable).toHaveBeenCalledWith('cosmoshub-4');
5959
});
6060

61-
it('should suggest a chain if connection fails with a specific error', async () => {
61+
it('should suggest a chain if connection fails with not "Request rejected"', async () => {
6262
const mockClient = {
6363
enable: jest.fn().mockRejectedValue(new Error('some error')),
6464
experimentalSuggestChain: jest.fn(),
@@ -67,10 +67,23 @@ describe('CosmosWallet', () => {
6767

6868
(chainRegistryChainToKeplr as jest.Mock).mockReturnValue({ chainId: 'cosmoshub-4' });
6969

70-
await expect(wallet.connect('cosmoshub-4')).rejects.toThrow('some error');
70+
await wallet.connect('cosmoshub-4');
71+
7172
expect(mockClient.experimentalSuggestChain).toHaveBeenCalledWith({ chainId: 'cosmoshub-4' });
7273
});
7374

75+
it('should not suggest a chain if connection fails with "Request rejected"', async () => {
76+
const mockClient = {
77+
enable: jest.fn().mockRejectedValue(new Error('Request rejected')),
78+
experimentalSuggestChain: jest.fn(),
79+
};
80+
wallet.client = mockClient;
81+
82+
await expect(wallet.connect('cosmoshub-4')).rejects.toThrow('Request rejected');
83+
84+
expect(mockClient.experimentalSuggestChain).not.toHaveBeenCalled();
85+
})
86+
7487
it('should disconnect from a chain', async () => {
7588
const mockClient = { disable: jest.fn() };
7689
wallet.client = mockClient;
@@ -116,4 +129,14 @@ describe('CosmosWallet', () => {
116129
expect(chainRegistryChainToKeplr).toHaveBeenCalledWith(cosmosChain, [cosmosAssetList]);
117130
expect(mockClient.experimentalSuggestChain).toHaveBeenCalledWith({ chainId: 'cosmoshub-4' });
118131
});
132+
133+
it('should throw an error if adding a suggested chain fails', async () => {
134+
const mockClient = { experimentalSuggestChain: jest.fn().mockRejectedValue(new Error('suggestion error')) };
135+
wallet.client = mockClient;
136+
wallet.chainMap.set('cosmoshub-4', cosmosChain);
137+
138+
(chainRegistryChainToKeplr as jest.Mock).mockReturnValue({ chainId: 'cosmoshub-4' });
139+
140+
await expect(wallet.addSuggestChain('cosmoshub-4')).rejects.toThrow('suggestion error');
141+
});
119142
});

packages/core/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@interchain-kit/core",
3-
"version": "0.2.212",
3+
"version": "0.2.214",
44
"author": "Hyperweb <[email protected]>",
55
"description": "interchain-kit wallet connector core package",
66
"main": "index.js",
@@ -53,5 +53,5 @@
5353
"@keplr-wallet/types": "^0.12.168",
5454
"jest-environment-jsdom": "^29.7.0"
5555
},
56-
"gitHead": "74ba6aca78de888649b4a23726e96dd0ad2b6827"
56+
"gitHead": "69acee3506ab58fb0fc9c2c9456b3522c8f103d3"
5757
}

0 commit comments

Comments
 (0)