@dynamic-labs/solana 0.19.0-alpha.14 → 0.19.0-alpha.16
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 +25 -0
- package/package.json +6 -6
- package/src/Slope.cjs +1 -1
- package/src/Slope.js +1 -1
- package/src/injected/PhantomLedger.cjs +1 -1
- package/src/injected/PhantomLedger.js +1 -1
- package/src/solWalletConnector.cjs +4 -4
- package/src/solWalletConnector.d.ts +2 -2
- package/src/solWalletConnector.js +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,29 @@
|
|
|
1
1
|
|
|
2
|
+
## [0.19.0-alpha.16](https://github.com/dynamic-labs/DynamicAuth/compare/v0.19.0-alpha.15...v0.19.0-alpha.16) (2023-10-17)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### ⚠ BREAKING CHANGES
|
|
6
|
+
|
|
7
|
+
* ethers extension integration and rename provider methods (#3573)
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* add onDisconnect ([#3572](https://github.com/dynamic-labs/DynamicAuth/issues/3572)) ([3e612f7](https://github.com/dynamic-labs/DynamicAuth/commit/3e612f72540781b9246a47ac12a7c979fb6c0d88))
|
|
12
|
+
* user callback on passkey creation complete ([#3591](https://github.com/dynamic-labs/DynamicAuth/issues/3591)) ([92d5f7d](https://github.com/dynamic-labs/DynamicAuth/commit/92d5f7df2ac1cc06338f7e9e75125f7bb71455ab))
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Bug Fixes
|
|
16
|
+
|
|
17
|
+
* argentX in-browser wallet ([#3588](https://github.com/dynamic-labs/DynamicAuth/issues/3588)) ([7f3b22d](https://github.com/dynamic-labs/DynamicAuth/commit/7f3b22d003182aa0d84406086a313fc4de25e4a8))
|
|
18
|
+
* display a better message when transaction amount decimals are invalid ([#3577](https://github.com/dynamic-labs/DynamicAuth/issues/3577)) ([0238d9b](https://github.com/dynamic-labs/DynamicAuth/commit/0238d9b7712d6a52aec89193c751224dd8fd8b17))
|
|
19
|
+
* remove passkey success view ([#3536](https://github.com/dynamic-labs/DynamicAuth/issues/3536)) ([b559de9](https://github.com/dynamic-labs/DynamicAuth/commit/b559de9c83096ed98e9f073b998ac08f876af24e))
|
|
20
|
+
* **wagmi-connector:** use wallets list to sync wagmi client ([#3563](https://github.com/dynamic-labs/DynamicAuth/issues/3563)) ([1d551b9](https://github.com/dynamic-labs/DynamicAuth/commit/1d551b933aefe0c535285d68c2e6f819cd321e62))
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
* ethers extension integration and rename provider methods ([#3573](https://github.com/dynamic-labs/DynamicAuth/issues/3573)) ([efd73c3](https://github.com/dynamic-labs/DynamicAuth/commit/efd73c3b8121df9a7d4ec8c1fb6c4fd76ecce6df))
|
|
24
|
+
|
|
25
|
+
## [0.19.0-alpha.15](https://github.com/dynamic-labs/DynamicAuth/compare/v0.19.0-alpha.14...v0.19.0-alpha.15) (2023-10-11)
|
|
26
|
+
|
|
2
27
|
## [0.19.0-alpha.14](https://github.com/dynamic-labs/DynamicAuth/compare/v0.19.0-alpha.13...v0.19.0-alpha.14) (2023-10-10)
|
|
3
28
|
|
|
4
29
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs/solana",
|
|
3
|
-
"version": "0.19.0-alpha.
|
|
3
|
+
"version": "0.19.0-alpha.16",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/dynamic-labs/DynamicAuth.git",
|
|
@@ -27,11 +27,11 @@
|
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"@solana/web3.js": "1.70.1",
|
|
30
|
-
"@dynamic-labs/rpc-providers": "0.19.0-alpha.
|
|
31
|
-
"@dynamic-labs/types": "0.19.0-alpha.
|
|
32
|
-
"@dynamic-labs/utils": "0.19.0-alpha.
|
|
33
|
-
"@dynamic-labs/wallet-book": "0.19.0-alpha.
|
|
34
|
-
"@dynamic-labs/wallet-connector-core": "0.19.0-alpha.
|
|
30
|
+
"@dynamic-labs/rpc-providers": "0.19.0-alpha.16",
|
|
31
|
+
"@dynamic-labs/types": "0.19.0-alpha.16",
|
|
32
|
+
"@dynamic-labs/utils": "0.19.0-alpha.16",
|
|
33
|
+
"@dynamic-labs/wallet-book": "0.19.0-alpha.16",
|
|
34
|
+
"@dynamic-labs/wallet-connector-core": "0.19.0-alpha.16",
|
|
35
35
|
"eventemitter3": "5.0.1"
|
|
36
36
|
},
|
|
37
37
|
"peerDependencies": {}
|
package/src/Slope.cjs
CHANGED
|
@@ -42,7 +42,7 @@ class Slope extends solWalletConnector.SolWalletConnector {
|
|
|
42
42
|
return undefined;
|
|
43
43
|
const response = yield this.wallet.connect();
|
|
44
44
|
const publicKey = new web3_js.PublicKey(this.isConnectData(response) && response.data.publicKey);
|
|
45
|
-
const balance = this.lamportsToSol(yield this.
|
|
45
|
+
const balance = this.lamportsToSol(yield this.getWalletClient().getBalance(publicKey));
|
|
46
46
|
return balance.toString();
|
|
47
47
|
}
|
|
48
48
|
catch (e) {
|
package/src/Slope.js
CHANGED
|
@@ -38,7 +38,7 @@ class Slope extends SolWalletConnector {
|
|
|
38
38
|
return undefined;
|
|
39
39
|
const response = yield this.wallet.connect();
|
|
40
40
|
const publicKey = new PublicKey(this.isConnectData(response) && response.data.publicKey);
|
|
41
|
-
const balance = this.lamportsToSol(yield this.
|
|
41
|
+
const balance = this.lamportsToSol(yield this.getWalletClient().getBalance(publicKey));
|
|
42
42
|
return balance.toString();
|
|
43
43
|
}
|
|
44
44
|
catch (e) {
|
|
@@ -53,7 +53,7 @@ class PhantomLedger extends InjectedWalletBase.InjectedWalletBase {
|
|
|
53
53
|
}
|
|
54
54
|
const transaction = this.buildAuthTx(messageToSign);
|
|
55
55
|
transaction.feePayer = new web3_js.PublicKey(address);
|
|
56
|
-
transaction.recentBlockhash = (yield this.
|
|
56
|
+
transaction.recentBlockhash = (yield this.getWalletClient().getLatestBlockhash()).blockhash;
|
|
57
57
|
const signer = yield this.getSigner();
|
|
58
58
|
if (!signer) {
|
|
59
59
|
throw new utils.DynamicError('Signer not found');
|
|
@@ -49,7 +49,7 @@ class PhantomLedger extends InjectedWalletBase {
|
|
|
49
49
|
}
|
|
50
50
|
const transaction = this.buildAuthTx(messageToSign);
|
|
51
51
|
transaction.feePayer = new PublicKey(address);
|
|
52
|
-
transaction.recentBlockhash = (yield this.
|
|
52
|
+
transaction.recentBlockhash = (yield this.getWalletClient().getLatestBlockhash()).blockhash;
|
|
53
53
|
const signer = yield this.getSigner();
|
|
54
54
|
if (!signer) {
|
|
55
55
|
throw new DynamicError('Signer not found');
|
|
@@ -35,7 +35,7 @@ class SolWalletConnector extends walletConnectorCore.WalletConnectorBase {
|
|
|
35
35
|
}
|
|
36
36
|
getNetwork() {
|
|
37
37
|
return _tslib.__awaiter(this, void 0, void 0, function* () {
|
|
38
|
-
const provider = this.
|
|
38
|
+
const provider = this.getWalletClient();
|
|
39
39
|
let genesisHash = yield provider.getGenesisHash();
|
|
40
40
|
genesisHash = genesisHash.substring(0, 32);
|
|
41
41
|
// see: https://github.com/ChainAgnostic/namespaces/blob/main/solana/caip2.md
|
|
@@ -50,7 +50,7 @@ class SolWalletConnector extends walletConnectorCore.WalletConnectorBase {
|
|
|
50
50
|
}
|
|
51
51
|
});
|
|
52
52
|
}
|
|
53
|
-
|
|
53
|
+
getWalletClient() {
|
|
54
54
|
var _a;
|
|
55
55
|
const [network] = this.solNetworks;
|
|
56
56
|
if (!network) {
|
|
@@ -59,7 +59,7 @@ class SolWalletConnector extends walletConnectorCore.WalletConnectorBase {
|
|
|
59
59
|
const rpcUrl = ((_a = network.privateCustomerRpcUrls) === null || _a === void 0 ? void 0 : _a[0]) || network.rpcUrls[0];
|
|
60
60
|
return new web3_js.Connection(rpcUrl, 'confirmed');
|
|
61
61
|
}
|
|
62
|
-
|
|
62
|
+
getPublicClient() {
|
|
63
63
|
var _a, _b;
|
|
64
64
|
return _tslib.__awaiter(this, void 0, void 0, function* () {
|
|
65
65
|
if (this.solNetworks.length === 0)
|
|
@@ -79,7 +79,7 @@ class SolWalletConnector extends walletConnectorCore.WalletConnectorBase {
|
|
|
79
79
|
if (!signer)
|
|
80
80
|
return;
|
|
81
81
|
const publicKey = new web3_js.PublicKey(signer.publicKey.toString());
|
|
82
|
-
const balance = this.lamportsToSol(yield this.
|
|
82
|
+
const balance = this.lamportsToSol(yield this.getWalletClient().getBalance(publicKey));
|
|
83
83
|
return balance.toString();
|
|
84
84
|
});
|
|
85
85
|
}
|
|
@@ -15,8 +15,8 @@ export declare abstract class SolWalletConnector extends WalletConnectorBase {
|
|
|
15
15
|
connectedChain: Chain;
|
|
16
16
|
constructor(opts: SolWalletConnectorOpts);
|
|
17
17
|
getNetwork(): Promise<string>;
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
getWalletClient(): Connection;
|
|
19
|
+
getPublicClient(): Promise<Connection | undefined>;
|
|
20
20
|
abstract getSigner(): Promise<ISolana | undefined>;
|
|
21
21
|
abstract connect(): Promise<void>;
|
|
22
22
|
getBalance(): Promise<string | undefined>;
|
|
@@ -31,7 +31,7 @@ class SolWalletConnector extends WalletConnectorBase {
|
|
|
31
31
|
}
|
|
32
32
|
getNetwork() {
|
|
33
33
|
return __awaiter(this, void 0, void 0, function* () {
|
|
34
|
-
const provider = this.
|
|
34
|
+
const provider = this.getWalletClient();
|
|
35
35
|
let genesisHash = yield provider.getGenesisHash();
|
|
36
36
|
genesisHash = genesisHash.substring(0, 32);
|
|
37
37
|
// see: https://github.com/ChainAgnostic/namespaces/blob/main/solana/caip2.md
|
|
@@ -46,7 +46,7 @@ class SolWalletConnector extends WalletConnectorBase {
|
|
|
46
46
|
}
|
|
47
47
|
});
|
|
48
48
|
}
|
|
49
|
-
|
|
49
|
+
getWalletClient() {
|
|
50
50
|
var _a;
|
|
51
51
|
const [network] = this.solNetworks;
|
|
52
52
|
if (!network) {
|
|
@@ -55,7 +55,7 @@ class SolWalletConnector extends WalletConnectorBase {
|
|
|
55
55
|
const rpcUrl = ((_a = network.privateCustomerRpcUrls) === null || _a === void 0 ? void 0 : _a[0]) || network.rpcUrls[0];
|
|
56
56
|
return new Connection(rpcUrl, 'confirmed');
|
|
57
57
|
}
|
|
58
|
-
|
|
58
|
+
getPublicClient() {
|
|
59
59
|
var _a, _b;
|
|
60
60
|
return __awaiter(this, void 0, void 0, function* () {
|
|
61
61
|
if (this.solNetworks.length === 0)
|
|
@@ -75,7 +75,7 @@ class SolWalletConnector extends WalletConnectorBase {
|
|
|
75
75
|
if (!signer)
|
|
76
76
|
return;
|
|
77
77
|
const publicKey = new PublicKey(signer.publicKey.toString());
|
|
78
|
-
const balance = this.lamportsToSol(yield this.
|
|
78
|
+
const balance = this.lamportsToSol(yield this.getWalletClient().getBalance(publicKey));
|
|
79
79
|
return balance.toString();
|
|
80
80
|
});
|
|
81
81
|
}
|