@dynamic-labs/embedded-wallet-solana 4.0.0-alpha.11 → 4.0.0-alpha.12
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 +18 -0
- package/package.cjs +5 -5
- package/package.js +5 -5
- package/package.json +12 -12
- package/src/lib/TurnkeySolanaWalletConnector/TurnkeySolanaSigner.cjs +2 -4
- package/src/lib/TurnkeySolanaWalletConnector/TurnkeySolanaSigner.d.ts +1 -1
- package/src/lib/TurnkeySolanaWalletConnector/TurnkeySolanaSigner.js +2 -4
- package/src/lib/TurnkeySolanaWalletConnector/TurnkeySolanaWalletConnector.cjs +29 -0
- package/src/lib/TurnkeySolanaWalletConnector/TurnkeySolanaWalletConnector.d.ts +1 -0
- package/src/lib/TurnkeySolanaWalletConnector/TurnkeySolanaWalletConnector.js +29 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,22 @@
|
|
|
1
1
|
|
|
2
|
+
## [4.0.0-alpha.12](https://github.com/dynamic-labs/dynamic-auth/compare/v4.0.0-alpha.11...v4.0.0-alpha.12) (2024-10-18)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
|
|
7
|
+
* add support for xverse account change event ([#7114](https://github.com/dynamic-labs/dynamic-auth/issues/7114)) ([79df047](https://github.com/dynamic-labs/dynamic-auth/commit/79df04775edb297a339e2d74adcc873584a6d8af))
|
|
8
|
+
* solana embedded signall headless ([#7132](https://github.com/dynamic-labs/dynamic-auth/issues/7132)) ([fe16b71](https://github.com/dynamic-labs/dynamic-auth/commit/fe16b71a4c0ad775f8de87ca899cfdd1071f11d6))
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* bug where embeddedWalletCreated event was fired before listener … ([#7151](https://github.com/dynamic-labs/dynamic-auth/issues/7151)) ([ae9da56](https://github.com/dynamic-labs/dynamic-auth/commit/ae9da56850130491384a2d5f47c1617815dcce5b))
|
|
14
|
+
* edge case where wallet book fails to load ([#7148](https://github.com/dynamic-labs/dynamic-auth/issues/7148)) ([805dc6d](https://github.com/dynamic-labs/dynamic-auth/commit/805dc6d7cc4cdf0b23748d82b3bd8216d88d55b5))
|
|
15
|
+
* issues where native currency icons were incorrect ([#7126](https://github.com/dynamic-labs/dynamic-auth/issues/7126)) ([8b8891a](https://github.com/dynamic-labs/dynamic-auth/commit/8b8891a52397e17cc127ea3a09ade14c4b70a8ee))
|
|
16
|
+
* remove now-unused sessionTimeout from useSocial ([#7123](https://github.com/dynamic-labs/dynamic-auth/issues/7123)) ([7959a8a](https://github.com/dynamic-labs/dynamic-auth/commit/7959a8a4c8ceb76c5c4f1ae91af204bf9c5cae7b))
|
|
17
|
+
* Revert: Update Exodus extension version " ([#7130](https://github.com/dynamic-labs/dynamic-auth/issues/7130)) ([f2274ae](https://github.com/dynamic-labs/dynamic-auth/commit/f2274aefd29bb9f3fb6de8493e4a5f73946a5600)), closes [#7129](https://github.com/dynamic-labs/dynamic-auth/issues/7129)
|
|
18
|
+
* use embedded primaryChain when passing undefined chains list to createTurnkeyWallet ([#7149](https://github.com/dynamic-labs/dynamic-auth/issues/7149)) ([c73a3ae](https://github.com/dynamic-labs/dynamic-auth/commit/c73a3aeeda8045b936d218f7078ad79967c321ef))
|
|
19
|
+
|
|
2
20
|
## [4.0.0-alpha.11](https://github.com/dynamic-labs/dynamic-auth/compare/v4.0.0-alpha.10...v4.0.0-alpha.11) (2024-10-15)
|
|
3
21
|
|
|
4
22
|
|
package/package.cjs
CHANGED
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
|
|
4
4
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
5
|
|
|
6
|
-
var version = "4.0.0-alpha.
|
|
6
|
+
var version = "4.0.0-alpha.12";
|
|
7
7
|
var dependencies = {
|
|
8
|
-
"@dynamic-labs/sdk-api-core": "0.0.
|
|
9
|
-
"@dynamic-labs/utils": "4.0.0-alpha.
|
|
10
|
-
"@dynamic-labs/logger": "4.0.0-alpha.
|
|
11
|
-
"@dynamic-labs/types": "4.0.0-alpha.
|
|
8
|
+
"@dynamic-labs/sdk-api-core": "0.0.547",
|
|
9
|
+
"@dynamic-labs/utils": "4.0.0-alpha.12",
|
|
10
|
+
"@dynamic-labs/logger": "4.0.0-alpha.12",
|
|
11
|
+
"@dynamic-labs/types": "4.0.0-alpha.12",
|
|
12
12
|
eventemitter3: "5.0.1",
|
|
13
13
|
"@solana/spl-token": "0.4.6",
|
|
14
14
|
"@solana/web3.js": "1.92.1",
|
package/package.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
'use client'
|
|
2
|
-
var version = "4.0.0-alpha.
|
|
2
|
+
var version = "4.0.0-alpha.12";
|
|
3
3
|
var dependencies = {
|
|
4
|
-
"@dynamic-labs/sdk-api-core": "0.0.
|
|
5
|
-
"@dynamic-labs/utils": "4.0.0-alpha.
|
|
6
|
-
"@dynamic-labs/logger": "4.0.0-alpha.
|
|
7
|
-
"@dynamic-labs/types": "4.0.0-alpha.
|
|
4
|
+
"@dynamic-labs/sdk-api-core": "0.0.547",
|
|
5
|
+
"@dynamic-labs/utils": "4.0.0-alpha.12",
|
|
6
|
+
"@dynamic-labs/logger": "4.0.0-alpha.12",
|
|
7
|
+
"@dynamic-labs/types": "4.0.0-alpha.12",
|
|
8
8
|
eventemitter3: "5.0.1",
|
|
9
9
|
"@solana/spl-token": "0.4.6",
|
|
10
10
|
"@solana/web3.js": "1.92.1",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs/embedded-wallet-solana",
|
|
3
|
-
"version": "4.0.0-alpha.
|
|
3
|
+
"version": "4.0.0-alpha.12",
|
|
4
4
|
"description": "A React SDK for implementing wallet web3 authentication and authorization to your website.",
|
|
5
5
|
"author": "Dynamic Labs, Inc.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -18,10 +18,10 @@
|
|
|
18
18
|
},
|
|
19
19
|
"homepage": "https://www.dynamic.xyz/",
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@dynamic-labs/sdk-api-core": "0.0.
|
|
22
|
-
"@dynamic-labs/utils": "4.0.0-alpha.
|
|
23
|
-
"@dynamic-labs/logger": "4.0.0-alpha.
|
|
24
|
-
"@dynamic-labs/types": "4.0.0-alpha.
|
|
21
|
+
"@dynamic-labs/sdk-api-core": "0.0.547",
|
|
22
|
+
"@dynamic-labs/utils": "4.0.0-alpha.12",
|
|
23
|
+
"@dynamic-labs/logger": "4.0.0-alpha.12",
|
|
24
|
+
"@dynamic-labs/types": "4.0.0-alpha.12",
|
|
25
25
|
"eventemitter3": "5.0.1",
|
|
26
26
|
"@solana/spl-token": "0.4.6",
|
|
27
27
|
"@solana/web3.js": "1.92.1",
|
|
@@ -29,13 +29,13 @@
|
|
|
29
29
|
"@turnkey/iframe-stamper": "2.0.0",
|
|
30
30
|
"@turnkey/solana": "0.3.9",
|
|
31
31
|
"@turnkey/webauthn-stamper": "0.5.0",
|
|
32
|
-
"@dynamic-labs/assert-package-version": "4.0.0-alpha.
|
|
33
|
-
"@dynamic-labs/embedded-wallet": "4.0.0-alpha.
|
|
34
|
-
"@dynamic-labs/rpc-providers": "4.0.0-alpha.
|
|
35
|
-
"@dynamic-labs/solana-core": "4.0.0-alpha.
|
|
36
|
-
"@dynamic-labs/wallet-book": "4.0.0-alpha.
|
|
37
|
-
"@dynamic-labs/wallet-connector-core": "4.0.0-alpha.
|
|
38
|
-
"@dynamic-labs/webauthn": "4.0.0-alpha.
|
|
32
|
+
"@dynamic-labs/assert-package-version": "4.0.0-alpha.12",
|
|
33
|
+
"@dynamic-labs/embedded-wallet": "4.0.0-alpha.12",
|
|
34
|
+
"@dynamic-labs/rpc-providers": "4.0.0-alpha.12",
|
|
35
|
+
"@dynamic-labs/solana-core": "4.0.0-alpha.12",
|
|
36
|
+
"@dynamic-labs/wallet-book": "4.0.0-alpha.12",
|
|
37
|
+
"@dynamic-labs/wallet-connector-core": "4.0.0-alpha.12",
|
|
38
|
+
"@dynamic-labs/webauthn": "4.0.0-alpha.12",
|
|
39
39
|
"react-dom": "18.2.0",
|
|
40
40
|
"viem": "2.9.25"
|
|
41
41
|
},
|
|
@@ -27,11 +27,9 @@ class TurnkeySolanaSigner {
|
|
|
27
27
|
return this.walletConnector.signTransaction(transaction);
|
|
28
28
|
});
|
|
29
29
|
}
|
|
30
|
-
signAllTransactions(
|
|
31
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
32
|
-
_transactions) {
|
|
30
|
+
signAllTransactions(transactions) {
|
|
33
31
|
return _tslib.__awaiter(this, void 0, void 0, function* () {
|
|
34
|
-
|
|
32
|
+
return this.walletConnector.signAllTransactions(transactions);
|
|
35
33
|
});
|
|
36
34
|
}
|
|
37
35
|
signAndSendTransaction(transaction, options) {
|
|
@@ -32,7 +32,7 @@ export declare class TurnkeySolanaSigner implements IEmbeddedWalletSolanaSigner
|
|
|
32
32
|
});
|
|
33
33
|
signMessage(encodedMessage: Uint8Array): Promise<SignedMessage>;
|
|
34
34
|
signTransaction<T extends Transaction | VersionedTransaction>(transaction: T): Promise<T>;
|
|
35
|
-
signAllTransactions<T extends Transaction | VersionedTransaction>(
|
|
35
|
+
signAllTransactions<T extends Transaction | VersionedTransaction>(transactions: T[]): Promise<T[]>;
|
|
36
36
|
signAndSendTransaction<T extends Transaction | VersionedTransaction>(transaction: T, options?: SendOptions): Promise<{
|
|
37
37
|
signature: TransactionSignature;
|
|
38
38
|
}>;
|
|
@@ -23,11 +23,9 @@ class TurnkeySolanaSigner {
|
|
|
23
23
|
return this.walletConnector.signTransaction(transaction);
|
|
24
24
|
});
|
|
25
25
|
}
|
|
26
|
-
signAllTransactions(
|
|
27
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
28
|
-
_transactions) {
|
|
26
|
+
signAllTransactions(transactions) {
|
|
29
27
|
return __awaiter(this, void 0, void 0, function* () {
|
|
30
|
-
|
|
28
|
+
return this.walletConnector.signAllTransactions(transactions);
|
|
31
29
|
});
|
|
32
30
|
}
|
|
33
31
|
signAndSendTransaction(transaction, options) {
|
|
@@ -288,6 +288,35 @@ class TurnkeySolanaWalletConnector extends embeddedWallet.TurnkeyWalletConnector
|
|
|
288
288
|
return transaction;
|
|
289
289
|
});
|
|
290
290
|
}
|
|
291
|
+
signAllTransactions(transactions) {
|
|
292
|
+
return _tslib.__awaiter(this, void 0, void 0, function* () {
|
|
293
|
+
yield this.createOrRestoreSession();
|
|
294
|
+
let account = yield this.getTurnkeyAccount();
|
|
295
|
+
const address = this.turnkeyAddress;
|
|
296
|
+
if (!account || !address) {
|
|
297
|
+
throw new Error('No turnkey account');
|
|
298
|
+
}
|
|
299
|
+
try {
|
|
300
|
+
const signedTransactions = yield account.signAllTransactions(transactions, address);
|
|
301
|
+
return signedTransactions;
|
|
302
|
+
}
|
|
303
|
+
catch (err) {
|
|
304
|
+
if (embeddedWallet.TURNKEY_SDK_SESSION_KEY_RETRYABLE_ERRORS.some((errorMsg) => err.message.includes(errorMsg))) {
|
|
305
|
+
yield this.removeSessionKeys();
|
|
306
|
+
yield this.createOrRestoreSession({
|
|
307
|
+
ignoreRestore: true,
|
|
308
|
+
});
|
|
309
|
+
account = (yield this.getTurnkeyAccount());
|
|
310
|
+
const signedTransactions = yield account.signAllTransactions(transactions, address);
|
|
311
|
+
return signedTransactions;
|
|
312
|
+
}
|
|
313
|
+
else {
|
|
314
|
+
embeddedWallet.logger.error('[TK] failed to perform SignAllTransactions activity', err);
|
|
315
|
+
throw err;
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
});
|
|
319
|
+
}
|
|
291
320
|
internalSignAndSendTransaction(transaction, options) {
|
|
292
321
|
return _tslib.__awaiter(this, void 0, void 0, function* () {
|
|
293
322
|
if (!this.turnkeyAddress)
|
|
@@ -48,6 +48,7 @@ export declare class TurnkeySolanaWalletConnector extends TurnkeyWalletConnector
|
|
|
48
48
|
getEnvId: () => any;
|
|
49
49
|
signMessage(messageToSign: string): Promise<string | undefined>;
|
|
50
50
|
signTransaction<T extends Transaction | VersionedTransaction>(transaction: T): Promise<T>;
|
|
51
|
+
signAllTransactions<T extends Transaction | VersionedTransaction>(transactions: T[]): Promise<T[]>;
|
|
51
52
|
internalSignAndSendTransaction<T extends Transaction | VersionedTransaction>(transaction: T, options?: SendOptions): Promise<string>;
|
|
52
53
|
signAndSendTransaction<T extends Transaction | VersionedTransaction>(transaction: T, options?: SendOptions): Promise<string>;
|
|
53
54
|
sendTransaction<T extends Transaction | VersionedTransaction>(transaction: T, connection: Connection, options?: SendTransactionOptions): Promise<string>;
|
|
@@ -284,6 +284,35 @@ class TurnkeySolanaWalletConnector extends TurnkeyWalletConnectorBase {
|
|
|
284
284
|
return transaction;
|
|
285
285
|
});
|
|
286
286
|
}
|
|
287
|
+
signAllTransactions(transactions) {
|
|
288
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
289
|
+
yield this.createOrRestoreSession();
|
|
290
|
+
let account = yield this.getTurnkeyAccount();
|
|
291
|
+
const address = this.turnkeyAddress;
|
|
292
|
+
if (!account || !address) {
|
|
293
|
+
throw new Error('No turnkey account');
|
|
294
|
+
}
|
|
295
|
+
try {
|
|
296
|
+
const signedTransactions = yield account.signAllTransactions(transactions, address);
|
|
297
|
+
return signedTransactions;
|
|
298
|
+
}
|
|
299
|
+
catch (err) {
|
|
300
|
+
if (TURNKEY_SDK_SESSION_KEY_RETRYABLE_ERRORS.some((errorMsg) => err.message.includes(errorMsg))) {
|
|
301
|
+
yield this.removeSessionKeys();
|
|
302
|
+
yield this.createOrRestoreSession({
|
|
303
|
+
ignoreRestore: true,
|
|
304
|
+
});
|
|
305
|
+
account = (yield this.getTurnkeyAccount());
|
|
306
|
+
const signedTransactions = yield account.signAllTransactions(transactions, address);
|
|
307
|
+
return signedTransactions;
|
|
308
|
+
}
|
|
309
|
+
else {
|
|
310
|
+
logger.error('[TK] failed to perform SignAllTransactions activity', err);
|
|
311
|
+
throw err;
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
});
|
|
315
|
+
}
|
|
287
316
|
internalSignAndSendTransaction(transaction, options) {
|
|
288
317
|
return __awaiter(this, void 0, void 0, function* () {
|
|
289
318
|
if (!this.turnkeyAddress)
|