@dynamic-labs/aptos 4.41.0 → 4.42.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 +20 -0
- package/package.cjs +1 -1
- package/package.js +1 -1
- package/package.json +6 -6
- package/src/injected/AptosProviderHelper.cjs +17 -3
- package/src/injected/AptosProviderHelper.js +17 -3
- package/src/walletStandard/createAptosSignerFromWalletStandard.cjs +8 -6
- package/src/walletStandard/createAptosSignerFromWalletStandard.js +8 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,24 @@
|
|
|
1
1
|
|
|
2
|
+
## [4.42.0](https://github.com/dynamic-labs/dynamic-auth/compare/v4.41.1...v4.42.0) (2025-11-04)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
|
|
7
|
+
* add support for send balance in React Native ([#9807](https://github.com/dynamic-labs/dynamic-auth/issues/9807)) ([40cab11](https://github.com/dynamic-labs/dynamic-auth/commit/40cab119f23d0b2efa5d6b161294bc682f1c0031))
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
### Bug Fixes
|
|
11
|
+
|
|
12
|
+
* don't override mfa token on non-mfa related state updates ([#9817](https://github.com/dynamic-labs/dynamic-auth/issues/9817)) ([76dfbb9](https://github.com/dynamic-labs/dynamic-auth/commit/76dfbb9f5012709c6c400c1d51b8a20b2b99c3db))
|
|
13
|
+
|
|
14
|
+
### [4.41.1](https://github.com/dynamic-labs/dynamic-auth/compare/v4.41.0...v4.41.1) (2025-10-30)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Bug Fixes
|
|
18
|
+
|
|
19
|
+
* aptos login with petra keyless accounts ([#9795](https://github.com/dynamic-labs/dynamic-auth/issues/9795)) ([99dc34b](https://github.com/dynamic-labs/dynamic-auth/commit/99dc34b95d1ec23d168c9e092e2d735b1d50a71d))
|
|
20
|
+
* backpack aptos login due to invalid public key ([#9806](https://github.com/dynamic-labs/dynamic-auth/issues/9806)) ([ec8b761](https://github.com/dynamic-labs/dynamic-auth/commit/ec8b76181acff7906fd92c77c2fca42ce52010ae))
|
|
21
|
+
|
|
2
22
|
## [4.41.0](https://github.com/dynamic-labs/dynamic-auth/compare/v4.40.2...v4.41.0) (2025-10-29)
|
|
3
23
|
|
|
4
24
|
|
package/package.cjs
CHANGED
package/package.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs/aptos",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.42.0",
|
|
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",
|
|
@@ -20,13 +20,13 @@
|
|
|
20
20
|
"dependencies": {
|
|
21
21
|
"@aptos-labs/ts-sdk": "5.1.1",
|
|
22
22
|
"@aptos-labs/wallet-standard": "0.5.2",
|
|
23
|
-
"@dynamic-labs/assert-package-version": "4.
|
|
23
|
+
"@dynamic-labs/assert-package-version": "4.42.0",
|
|
24
24
|
"@wallet-standard/core": "1.1.1",
|
|
25
25
|
"@wallet-standard/features": "1.0.3",
|
|
26
|
-
"@dynamic-labs/logger": "4.
|
|
27
|
-
"@dynamic-labs/utils": "4.
|
|
28
|
-
"@dynamic-labs/wallet-book": "4.
|
|
29
|
-
"@dynamic-labs/wallet-connector-core": "4.
|
|
26
|
+
"@dynamic-labs/logger": "4.42.0",
|
|
27
|
+
"@dynamic-labs/utils": "4.42.0",
|
|
28
|
+
"@dynamic-labs/wallet-book": "4.42.0",
|
|
29
|
+
"@dynamic-labs/wallet-connector-core": "4.42.0"
|
|
30
30
|
},
|
|
31
31
|
"peerDependencies": {}
|
|
32
32
|
}
|
|
@@ -189,17 +189,31 @@ class AptosProviderHelper {
|
|
|
189
189
|
*/
|
|
190
190
|
handleUserResponseSignature(result) {
|
|
191
191
|
return _tslib.__awaiter(this, void 0, void 0, function* () {
|
|
192
|
-
var _a;
|
|
192
|
+
var _a, _b, _c, _d, _e;
|
|
193
193
|
const resultWithArgs = result;
|
|
194
194
|
const signature = (_a = resultWithArgs.args.signature) === null || _a === void 0 ? void 0 : _a.toString();
|
|
195
|
+
// Extract ephemeral values if they exist
|
|
196
|
+
const signatureObj = resultWithArgs.args.signature;
|
|
197
|
+
// for keyless wallets, we need to extract the ephemeral signature and public key from the signature object
|
|
198
|
+
// this is because the public key is not provided in the result
|
|
199
|
+
const ephemeralSignature = (_c = (_b = signatureObj === null || signatureObj === void 0 ? void 0 : signatureObj.signature) === null || _b === void 0 ? void 0 : _b.ephemeralSignature) === null || _c === void 0 ? void 0 : _c.toString();
|
|
200
|
+
const ephemeralPublicKey = (_e = (_d = signatureObj === null || signatureObj === void 0 ? void 0 : signatureObj.signature) === null || _d === void 0 ? void 0 : _d.ephemeralPublicKey) === null || _e === void 0 ? void 0 : _e.toString();
|
|
195
201
|
const { fullMessage, publicKey: walletPublicKey } = resultWithArgs.args;
|
|
196
202
|
// Get public key from account if not provided in result
|
|
197
203
|
const publicKey = walletPublicKey || (yield this.getPublicKeyFromAccount());
|
|
198
|
-
return
|
|
204
|
+
// Build return object with ephemeral values if they exist
|
|
205
|
+
const returnObj = {
|
|
199
206
|
fullMessage,
|
|
200
207
|
publicKey,
|
|
201
208
|
signature,
|
|
202
|
-
}
|
|
209
|
+
};
|
|
210
|
+
if (ephemeralSignature) {
|
|
211
|
+
returnObj.signature = ephemeralSignature;
|
|
212
|
+
}
|
|
213
|
+
if (ephemeralPublicKey) {
|
|
214
|
+
returnObj.publicKey = ephemeralPublicKey;
|
|
215
|
+
}
|
|
216
|
+
return JSON.stringify(returnObj);
|
|
203
217
|
});
|
|
204
218
|
}
|
|
205
219
|
/**
|
|
@@ -185,17 +185,31 @@ class AptosProviderHelper {
|
|
|
185
185
|
*/
|
|
186
186
|
handleUserResponseSignature(result) {
|
|
187
187
|
return __awaiter(this, void 0, void 0, function* () {
|
|
188
|
-
var _a;
|
|
188
|
+
var _a, _b, _c, _d, _e;
|
|
189
189
|
const resultWithArgs = result;
|
|
190
190
|
const signature = (_a = resultWithArgs.args.signature) === null || _a === void 0 ? void 0 : _a.toString();
|
|
191
|
+
// Extract ephemeral values if they exist
|
|
192
|
+
const signatureObj = resultWithArgs.args.signature;
|
|
193
|
+
// for keyless wallets, we need to extract the ephemeral signature and public key from the signature object
|
|
194
|
+
// this is because the public key is not provided in the result
|
|
195
|
+
const ephemeralSignature = (_c = (_b = signatureObj === null || signatureObj === void 0 ? void 0 : signatureObj.signature) === null || _b === void 0 ? void 0 : _b.ephemeralSignature) === null || _c === void 0 ? void 0 : _c.toString();
|
|
196
|
+
const ephemeralPublicKey = (_e = (_d = signatureObj === null || signatureObj === void 0 ? void 0 : signatureObj.signature) === null || _d === void 0 ? void 0 : _d.ephemeralPublicKey) === null || _e === void 0 ? void 0 : _e.toString();
|
|
191
197
|
const { fullMessage, publicKey: walletPublicKey } = resultWithArgs.args;
|
|
192
198
|
// Get public key from account if not provided in result
|
|
193
199
|
const publicKey = walletPublicKey || (yield this.getPublicKeyFromAccount());
|
|
194
|
-
return
|
|
200
|
+
// Build return object with ephemeral values if they exist
|
|
201
|
+
const returnObj = {
|
|
195
202
|
fullMessage,
|
|
196
203
|
publicKey,
|
|
197
204
|
signature,
|
|
198
|
-
}
|
|
205
|
+
};
|
|
206
|
+
if (ephemeralSignature) {
|
|
207
|
+
returnObj.signature = ephemeralSignature;
|
|
208
|
+
}
|
|
209
|
+
if (ephemeralPublicKey) {
|
|
210
|
+
returnObj.publicKey = ephemeralPublicKey;
|
|
211
|
+
}
|
|
212
|
+
return JSON.stringify(returnObj);
|
|
199
213
|
});
|
|
200
214
|
}
|
|
201
215
|
/**
|
|
@@ -18,11 +18,7 @@ const createAptosSignerFromWalletStandard = ({ wallet, }) => {
|
|
|
18
18
|
};
|
|
19
19
|
const getCurrentAccount = () => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
20
20
|
var _a, _b;
|
|
21
|
-
|
|
22
|
-
if (accountMethod) {
|
|
23
|
-
return accountMethod();
|
|
24
|
-
}
|
|
25
|
-
if (((_b = wallet.accounts) === null || _b === void 0 ? void 0 : _b.length) > 0) {
|
|
21
|
+
if (((_a = wallet.accounts) === null || _a === void 0 ? void 0 : _a.length) > 0) {
|
|
26
22
|
const [account] = wallet.accounts;
|
|
27
23
|
// Validate that the account has valid address and publicKey
|
|
28
24
|
if (account.address && account.publicKey) {
|
|
@@ -31,11 +27,17 @@ const createAptosSignerFromWalletStandard = ({ wallet, }) => {
|
|
|
31
27
|
return new walletStandard.AccountInfo({
|
|
32
28
|
address: account.address,
|
|
33
29
|
// using this typing since account.publicKey is a ReadonlyUint8Array
|
|
34
|
-
publicKey: account.publicKey
|
|
30
|
+
publicKey: account.publicKey instanceof Uint8Array
|
|
31
|
+
? Buffer.from(account.publicKey).toString('hex')
|
|
32
|
+
: account.publicKey,
|
|
35
33
|
});
|
|
36
34
|
}
|
|
37
35
|
}
|
|
38
36
|
}
|
|
37
|
+
const accountMethod = (_b = features['aptos:account']) === null || _b === void 0 ? void 0 : _b.account;
|
|
38
|
+
if (accountMethod) {
|
|
39
|
+
return accountMethod();
|
|
40
|
+
}
|
|
39
41
|
throw new Error('Account not found');
|
|
40
42
|
});
|
|
41
43
|
const connect = () => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
@@ -14,11 +14,7 @@ const createAptosSignerFromWalletStandard = ({ wallet, }) => {
|
|
|
14
14
|
};
|
|
15
15
|
const getCurrentAccount = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
16
16
|
var _a, _b;
|
|
17
|
-
|
|
18
|
-
if (accountMethod) {
|
|
19
|
-
return accountMethod();
|
|
20
|
-
}
|
|
21
|
-
if (((_b = wallet.accounts) === null || _b === void 0 ? void 0 : _b.length) > 0) {
|
|
17
|
+
if (((_a = wallet.accounts) === null || _a === void 0 ? void 0 : _a.length) > 0) {
|
|
22
18
|
const [account] = wallet.accounts;
|
|
23
19
|
// Validate that the account has valid address and publicKey
|
|
24
20
|
if (account.address && account.publicKey) {
|
|
@@ -27,11 +23,17 @@ const createAptosSignerFromWalletStandard = ({ wallet, }) => {
|
|
|
27
23
|
return new AccountInfo({
|
|
28
24
|
address: account.address,
|
|
29
25
|
// using this typing since account.publicKey is a ReadonlyUint8Array
|
|
30
|
-
publicKey: account.publicKey
|
|
26
|
+
publicKey: account.publicKey instanceof Uint8Array
|
|
27
|
+
? Buffer.from(account.publicKey).toString('hex')
|
|
28
|
+
: account.publicKey,
|
|
31
29
|
});
|
|
32
30
|
}
|
|
33
31
|
}
|
|
34
32
|
}
|
|
33
|
+
const accountMethod = (_b = features['aptos:account']) === null || _b === void 0 ? void 0 : _b.account;
|
|
34
|
+
if (accountMethod) {
|
|
35
|
+
return accountMethod();
|
|
36
|
+
}
|
|
35
37
|
throw new Error('Account not found');
|
|
36
38
|
});
|
|
37
39
|
const connect = () => __awaiter(void 0, void 0, void 0, function* () {
|