@dynamic-labs/cosmos 3.0.2 → 4.0.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +3 -10
- package/package.json +5 -5
- package/src/wallet/CosmosWallet.cjs +44 -56
- package/src/wallet/CosmosWallet.js +45 -57
package/CHANGELOG.md
CHANGED
|
@@ -1,18 +1,11 @@
|
|
|
1
1
|
|
|
2
|
-
|
|
2
|
+
## [4.0.0-alpha.0](https://github.com/dynamic-labs/DynamicAuth/compare/v3.0.0...v4.0.0-alpha.0) (2024-09-13)
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
### Bug Fixes
|
|
6
6
|
|
|
7
|
-
*
|
|
8
|
-
|
|
9
|
-
### [3.0.1](https://github.com/dynamic-labs/DynamicAuth/compare/v3.0.0...v3.0.1) (2024-09-13)
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
### Bug Fixes
|
|
13
|
-
|
|
14
|
-
* create v2 embedded wallet experience in manual mode ([#6887](https://github.com/dynamic-labs/DynamicAuth/issues/6887)) ([#6891](https://github.com/dynamic-labs/DynamicAuth/issues/6891)) ([64d027b](https://github.com/dynamic-labs/DynamicAuth/commit/64d027b4b5d877845551eae23c666d7863f7109d))
|
|
15
|
-
* solana pk export format ([#6888](https://github.com/dynamic-labs/DynamicAuth/issues/6888)) ([#6890](https://github.com/dynamic-labs/DynamicAuth/issues/6890)) ([cb68997](https://github.com/dynamic-labs/DynamicAuth/commit/cb68997970ccf53734b7d296153185b4866c7f94))
|
|
7
|
+
* create v2 embedded wallet experience in manual mode ([#6887](https://github.com/dynamic-labs/DynamicAuth/issues/6887)) ([8b0953a](https://github.com/dynamic-labs/DynamicAuth/commit/8b0953ac6d511ca254e01da689beb46faa68cf02))
|
|
8
|
+
* solana pk export format ([#6888](https://github.com/dynamic-labs/DynamicAuth/issues/6888)) ([31a5fe2](https://github.com/dynamic-labs/DynamicAuth/commit/31a5fe272cbfabf8e5d90bc8f18dcf0fff504fd1))
|
|
16
9
|
|
|
17
10
|
## [3.0.0](https://github.com/dynamic-labs/DynamicAuth/compare/v3.0.0-alpha.68...v3.0.0) (2024-09-13)
|
|
18
11
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs/cosmos",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.0-alpha.0",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/dynamic-labs/dynamic-auth.git",
|
|
@@ -27,10 +27,10 @@
|
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"@keplr-wallet/types": "0.12.121",
|
|
30
|
-
"@dynamic-labs/types": "
|
|
31
|
-
"@dynamic-labs/utils": "
|
|
32
|
-
"@dynamic-labs/wallet-book": "
|
|
33
|
-
"@dynamic-labs/wallet-connector-core": "
|
|
30
|
+
"@dynamic-labs/types": "4.0.0-alpha.0",
|
|
31
|
+
"@dynamic-labs/utils": "4.0.0-alpha.0",
|
|
32
|
+
"@dynamic-labs/wallet-book": "4.0.0-alpha.0",
|
|
33
|
+
"@dynamic-labs/wallet-connector-core": "4.0.0-alpha.0"
|
|
34
34
|
},
|
|
35
35
|
"peerDependencies": {}
|
|
36
36
|
}
|
|
@@ -14,46 +14,40 @@ class CosmosWallet extends walletConnectorCore.Wallet {
|
|
|
14
14
|
if (!provider) {
|
|
15
15
|
throw new Error('unable to retrieve Cosmos provider');
|
|
16
16
|
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
});
|
|
52
|
-
}
|
|
53
|
-
catch (error) {
|
|
54
|
-
walletConnectorCore.logger.warn(`Failed to add logic to auto-sync the wallet. Provider might be out of sync for wallet: ${this._connector.name} (${this.address})`, error);
|
|
55
|
-
return provider;
|
|
56
|
-
}
|
|
17
|
+
return utils.cloneObjectWithOverrides(provider, {
|
|
18
|
+
sendEthereumTx: (chainId, tx) => _tslib.__awaiter(this, void 0, void 0, function* () {
|
|
19
|
+
yield this.sync();
|
|
20
|
+
return provider.sendEthereumTx(chainId, tx);
|
|
21
|
+
}),
|
|
22
|
+
sendTx: (chainId, tx, mode) => _tslib.__awaiter(this, void 0, void 0, function* () {
|
|
23
|
+
yield this.sync();
|
|
24
|
+
return provider.sendTx(chainId, tx, mode);
|
|
25
|
+
}),
|
|
26
|
+
signAmino: (chainId, signer, signerDoc, signerOperations) => _tslib.__awaiter(this, void 0, void 0, function* () {
|
|
27
|
+
yield this.sync();
|
|
28
|
+
return provider.signAmino(chainId, signer, signerDoc, signerOperations);
|
|
29
|
+
}),
|
|
30
|
+
signArbitrary: (chainId, signer, data) => _tslib.__awaiter(this, void 0, void 0, function* () {
|
|
31
|
+
yield this.sync();
|
|
32
|
+
return provider.signArbitrary(chainId, signer, data);
|
|
33
|
+
}),
|
|
34
|
+
signDirect: (chainId, signer, signDoc, signOptions) => _tslib.__awaiter(this, void 0, void 0, function* () {
|
|
35
|
+
yield this.sync();
|
|
36
|
+
return provider.signDirect(chainId, signer, signDoc, signOptions);
|
|
37
|
+
}),
|
|
38
|
+
signDirectAux: (chainId, signer, signDoc, signOptions) => _tslib.__awaiter(this, void 0, void 0, function* () {
|
|
39
|
+
yield this.sync();
|
|
40
|
+
return provider.signDirectAux(chainId, signer, signDoc, signOptions);
|
|
41
|
+
}),
|
|
42
|
+
signEthereum: (chainId, signer, data, type) => _tslib.__awaiter(this, void 0, void 0, function* () {
|
|
43
|
+
yield this.sync();
|
|
44
|
+
return provider.signEthereum(chainId, signer, data, type);
|
|
45
|
+
}),
|
|
46
|
+
signICNSAdr36: (chainId, contractAddress, owner, username, addressChainIds) => _tslib.__awaiter(this, void 0, void 0, function* () {
|
|
47
|
+
yield this.sync();
|
|
48
|
+
return provider.signICNSAdr36(chainId, contractAddress, owner, username, addressChainIds);
|
|
49
|
+
}),
|
|
50
|
+
});
|
|
57
51
|
});
|
|
58
52
|
}
|
|
59
53
|
getOfflineSigner() {
|
|
@@ -62,22 +56,16 @@ class CosmosWallet extends walletConnectorCore.Wallet {
|
|
|
62
56
|
if (!offlineSigner) {
|
|
63
57
|
throw new Error('unable to retrieve Cosmos offline signer');
|
|
64
58
|
}
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
});
|
|
76
|
-
}
|
|
77
|
-
catch (error) {
|
|
78
|
-
walletConnectorCore.logger.warn(`Failed to add logic to auto-sync the wallet. Signer might be out of sync for wallet: ${this._connector.name} (${this.address})`, error);
|
|
79
|
-
return offlineSigner;
|
|
80
|
-
}
|
|
59
|
+
return utils.cloneObjectWithOverrides(offlineSigner, {
|
|
60
|
+
signAmino: (signerAddress, signerDoc) => _tslib.__awaiter(this, void 0, void 0, function* () {
|
|
61
|
+
yield this.sync();
|
|
62
|
+
return offlineSigner.signAmino(signerAddress, signerDoc);
|
|
63
|
+
}),
|
|
64
|
+
signDirect: (signerAddress, signDoc) => _tslib.__awaiter(this, void 0, void 0, function* () {
|
|
65
|
+
yield this.sync();
|
|
66
|
+
return offlineSigner.signDirect(signerAddress, signDoc);
|
|
67
|
+
}),
|
|
68
|
+
});
|
|
81
69
|
});
|
|
82
70
|
}
|
|
83
71
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
import { __awaiter } from '../../_virtual/_tslib.js';
|
|
3
|
-
import { Wallet
|
|
3
|
+
import { Wallet } from '@dynamic-labs/wallet-connector-core';
|
|
4
4
|
import { cloneObjectWithOverrides } from '@dynamic-labs/utils';
|
|
5
5
|
|
|
6
6
|
class CosmosWallet extends Wallet {
|
|
@@ -10,46 +10,40 @@ class CosmosWallet extends Wallet {
|
|
|
10
10
|
if (!provider) {
|
|
11
11
|
throw new Error('unable to retrieve Cosmos provider');
|
|
12
12
|
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
catch (error) {
|
|
50
|
-
logger.warn(`Failed to add logic to auto-sync the wallet. Provider might be out of sync for wallet: ${this._connector.name} (${this.address})`, error);
|
|
51
|
-
return provider;
|
|
52
|
-
}
|
|
13
|
+
return cloneObjectWithOverrides(provider, {
|
|
14
|
+
sendEthereumTx: (chainId, tx) => __awaiter(this, void 0, void 0, function* () {
|
|
15
|
+
yield this.sync();
|
|
16
|
+
return provider.sendEthereumTx(chainId, tx);
|
|
17
|
+
}),
|
|
18
|
+
sendTx: (chainId, tx, mode) => __awaiter(this, void 0, void 0, function* () {
|
|
19
|
+
yield this.sync();
|
|
20
|
+
return provider.sendTx(chainId, tx, mode);
|
|
21
|
+
}),
|
|
22
|
+
signAmino: (chainId, signer, signerDoc, signerOperations) => __awaiter(this, void 0, void 0, function* () {
|
|
23
|
+
yield this.sync();
|
|
24
|
+
return provider.signAmino(chainId, signer, signerDoc, signerOperations);
|
|
25
|
+
}),
|
|
26
|
+
signArbitrary: (chainId, signer, data) => __awaiter(this, void 0, void 0, function* () {
|
|
27
|
+
yield this.sync();
|
|
28
|
+
return provider.signArbitrary(chainId, signer, data);
|
|
29
|
+
}),
|
|
30
|
+
signDirect: (chainId, signer, signDoc, signOptions) => __awaiter(this, void 0, void 0, function* () {
|
|
31
|
+
yield this.sync();
|
|
32
|
+
return provider.signDirect(chainId, signer, signDoc, signOptions);
|
|
33
|
+
}),
|
|
34
|
+
signDirectAux: (chainId, signer, signDoc, signOptions) => __awaiter(this, void 0, void 0, function* () {
|
|
35
|
+
yield this.sync();
|
|
36
|
+
return provider.signDirectAux(chainId, signer, signDoc, signOptions);
|
|
37
|
+
}),
|
|
38
|
+
signEthereum: (chainId, signer, data, type) => __awaiter(this, void 0, void 0, function* () {
|
|
39
|
+
yield this.sync();
|
|
40
|
+
return provider.signEthereum(chainId, signer, data, type);
|
|
41
|
+
}),
|
|
42
|
+
signICNSAdr36: (chainId, contractAddress, owner, username, addressChainIds) => __awaiter(this, void 0, void 0, function* () {
|
|
43
|
+
yield this.sync();
|
|
44
|
+
return provider.signICNSAdr36(chainId, contractAddress, owner, username, addressChainIds);
|
|
45
|
+
}),
|
|
46
|
+
});
|
|
53
47
|
});
|
|
54
48
|
}
|
|
55
49
|
getOfflineSigner() {
|
|
@@ -58,22 +52,16 @@ class CosmosWallet extends Wallet {
|
|
|
58
52
|
if (!offlineSigner) {
|
|
59
53
|
throw new Error('unable to retrieve Cosmos offline signer');
|
|
60
54
|
}
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
});
|
|
72
|
-
}
|
|
73
|
-
catch (error) {
|
|
74
|
-
logger.warn(`Failed to add logic to auto-sync the wallet. Signer might be out of sync for wallet: ${this._connector.name} (${this.address})`, error);
|
|
75
|
-
return offlineSigner;
|
|
76
|
-
}
|
|
55
|
+
return cloneObjectWithOverrides(offlineSigner, {
|
|
56
|
+
signAmino: (signerAddress, signerDoc) => __awaiter(this, void 0, void 0, function* () {
|
|
57
|
+
yield this.sync();
|
|
58
|
+
return offlineSigner.signAmino(signerAddress, signerDoc);
|
|
59
|
+
}),
|
|
60
|
+
signDirect: (signerAddress, signDoc) => __awaiter(this, void 0, void 0, function* () {
|
|
61
|
+
yield this.sync();
|
|
62
|
+
return offlineSigner.signDirect(signerAddress, signDoc);
|
|
63
|
+
}),
|
|
64
|
+
});
|
|
77
65
|
});
|
|
78
66
|
}
|
|
79
67
|
}
|