@dynamic-labs/ethereum-gasless-core 4.85.0 → 4.87.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 +25 -0
- package/package.cjs +1 -1
- package/package.js +1 -1
- package/package.json +2 -2
- package/src/lib/relaySponsoredTransaction/relaySponsoredTransaction.cjs +1 -0
- package/src/lib/relaySponsoredTransaction/relaySponsoredTransaction.d.ts +6 -0
- package/src/lib/relaySponsoredTransaction/relaySponsoredTransaction.js +1 -0
- package/src/lib/sendSponsoredTransaction/sendSponsoredTransaction.d.ts +6 -0
- package/src/lib/signSponsoredTransaction/signSponsoredTransaction.cjs +2 -2
- package/src/lib/signSponsoredTransaction/signSponsoredTransaction.d.ts +10 -1
- package/src/lib/signSponsoredTransaction/signSponsoredTransaction.js +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,29 @@
|
|
|
1
1
|
|
|
2
|
+
## [4.87.0](https://github.com/dynamic-labs/dynamic-auth/compare/v4.86.0...v4.87.0) (2026-06-02)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
|
|
7
|
+
* **sdk-react-core:** instrument logout reason for Datadog observability DYNT-870 ([#11429](https://github.com/dynamic-labs/dynamic-auth/issues/11429)) ([8f9b3f3](https://github.com/dynamic-labs/dynamic-auth/commit/8f9b3f364dc711414ae59642c36f5f0a4cc4576a))
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
### Bug Fixes
|
|
11
|
+
|
|
12
|
+
* **sdk-react-core:** only flag auto-wallet abandoned on a sustained exit, not transient webview hide DYNT-870 ([#11428](https://github.com/dynamic-labs/dynamic-auth/issues/11428)) ([5984cdd](https://github.com/dynamic-labs/dynamic-auth/commit/5984cddb4ac04b226f6dd6ebe44340186902b012))
|
|
13
|
+
|
|
14
|
+
## [4.86.0](https://github.com/dynamic-labs/dynamic-auth/compare/v4.85.0...v4.86.0) (2026-06-01)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Features
|
|
18
|
+
|
|
19
|
+
* add support to new MetaMask SDK ([#11056](https://github.com/dynamic-labs/dynamic-auth/issues/11056)) ([8a6c973](https://github.com/dynamic-labs/dynamic-auth/commit/8a6c973876207256c06b04f6a16454f07446393d))
|
|
20
|
+
* **ethereum-gasless:** expose optional nonce on sign/send/relay ([#11422](https://github.com/dynamic-labs/dynamic-auth/issues/11422)) ([d2d074e](https://github.com/dynamic-labs/dynamic-auth/commit/d2d074ebe82452990281eba14a73f52a0af1e98b))
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
### Bug Fixes
|
|
24
|
+
|
|
25
|
+
* **sdk-react-core:** retry auto wallet creation on transient failures before erroring ([#11408](https://github.com/dynamic-labs/dynamic-auth/issues/11408)) ([8175460](https://github.com/dynamic-labs/dynamic-auth/commit/8175460bdee6f041ead0ea3f020cfd2168683239)), closes [#11399](https://github.com/dynamic-labs/dynamic-auth/issues/11399) [forward-mpc-client#286](https://github.com/dynamic-labs/forward-mpc-client/issues/286) [#11396](https://github.com/dynamic-labs/dynamic-auth/issues/11396)
|
|
26
|
+
|
|
2
27
|
## [4.85.0](https://github.com/dynamic-labs/dynamic-auth/compare/v4.84.1...v4.85.0) (2026-05-29)
|
|
3
28
|
|
|
4
29
|
|
package/package.cjs
CHANGED
package/package.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs/ethereum-gasless-core",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.87.0",
|
|
4
4
|
"main": "./src/index.cjs",
|
|
5
5
|
"module": "./src/index.js",
|
|
6
6
|
"types": "./src/index.d.ts",
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"@dynamic-labs/sdk-api-core": "0.0.985",
|
|
18
|
-
"@dynamic-labs/assert-package-version": "4.
|
|
18
|
+
"@dynamic-labs/assert-package-version": "4.87.0"
|
|
19
19
|
},
|
|
20
20
|
"peerDependencies": {
|
|
21
21
|
"viem": "^2.45.3"
|
|
@@ -23,6 +23,7 @@ const relaySponsoredTransaction = async (params, deps) => {
|
|
|
23
23
|
authorization: params.authorization,
|
|
24
24
|
autoDelegate: params.autoDelegate,
|
|
25
25
|
calls: params.calls,
|
|
26
|
+
nonce: params.nonce,
|
|
26
27
|
validForSeconds: params.validForSeconds ?? constants.DEFAULT_VALID_FOR_SECONDS,
|
|
27
28
|
}, deps);
|
|
28
29
|
let data;
|
|
@@ -7,6 +7,12 @@ type RelayWithCallsParams = {
|
|
|
7
7
|
autoDelegate?: boolean;
|
|
8
8
|
/** The batch of calls to execute. */
|
|
9
9
|
calls: SponsoredTransactionCall[];
|
|
10
|
+
/**
|
|
11
|
+
* Optional bitmap nonce to sign the intent with. When provided, nonce
|
|
12
|
+
* generation (and its on-chain check) is skipped and the supplied value is
|
|
13
|
+
* used as-is. Useful for mutually-exclusive / cancel-replace intents.
|
|
14
|
+
*/
|
|
15
|
+
nonce?: bigint;
|
|
10
16
|
/** How long the signed intent remains valid, in seconds. Defaults to 600. */
|
|
11
17
|
validForSeconds?: number;
|
|
12
18
|
};
|
|
@@ -19,6 +19,7 @@ const relaySponsoredTransaction = async (params, deps) => {
|
|
|
19
19
|
authorization: params.authorization,
|
|
20
20
|
autoDelegate: params.autoDelegate,
|
|
21
21
|
calls: params.calls,
|
|
22
|
+
nonce: params.nonce,
|
|
22
23
|
validForSeconds: params.validForSeconds ?? DEFAULT_VALID_FOR_SECONDS,
|
|
23
24
|
}, deps);
|
|
24
25
|
let data;
|
|
@@ -8,6 +8,12 @@ type SendWithCallsParams = {
|
|
|
8
8
|
autoDelegate?: boolean;
|
|
9
9
|
/** The batch of calls to execute. */
|
|
10
10
|
calls: SponsoredTransactionCall[];
|
|
11
|
+
/**
|
|
12
|
+
* Optional bitmap nonce to sign the intent with. When provided, nonce
|
|
13
|
+
* generation (and its on-chain check) is skipped and the supplied value is
|
|
14
|
+
* used as-is. Useful for mutually-exclusive / cancel-replace intents.
|
|
15
|
+
*/
|
|
16
|
+
nonce?: bigint;
|
|
11
17
|
/** How long the signed intent remains valid, in seconds. Defaults to 600. */
|
|
12
18
|
validForSeconds?: number;
|
|
13
19
|
};
|
|
@@ -17,11 +17,11 @@ var toSerializedAuthorization = require('../toSerializedAuthorization/toSerializ
|
|
|
17
17
|
* the target chain, and signs the typed-data payload with the wallet client
|
|
18
18
|
* provided in `deps`.
|
|
19
19
|
*/
|
|
20
|
-
const signSponsoredTransaction = async ({ authorization, autoDelegate = true, calls, validForSeconds = constants.DEFAULT_VALID_FOR_SECONDS, }, deps) => {
|
|
20
|
+
const signSponsoredTransaction = async ({ authorization, autoDelegate = true, calls, nonce: providedNonce, validForSeconds = constants.DEFAULT_VALID_FOR_SECONDS, }, deps) => {
|
|
21
21
|
const { chainId, walletClient } = deps;
|
|
22
22
|
const walletAddress = walletClient.account.address;
|
|
23
23
|
const resolvedAuthorization = await resolveAuthorization.resolveAuthorization({ authorization, autoDelegate, walletAddress }, deps);
|
|
24
|
-
const nonce = await generateIntentNonce.generateIntentNonce({ walletAddress }, deps);
|
|
24
|
+
const nonce = providedNonce ?? (await generateIntentNonce.generateIntentNonce({ walletAddress }, deps));
|
|
25
25
|
const deadline = BigInt(Math.floor(Date.now() / 1000) + validForSeconds);
|
|
26
26
|
const { relayerAddress } = await getAvailableEvmGaslessRelayer.getAvailableEvmGaslessRelayer({ chainId }, deps);
|
|
27
27
|
const signature = await walletClient.signTypedData({
|
|
@@ -7,6 +7,15 @@ type SignSponsoredTransactionParams = {
|
|
|
7
7
|
autoDelegate?: boolean;
|
|
8
8
|
/** The batch of calls to execute. */
|
|
9
9
|
calls: SponsoredTransactionCall[];
|
|
10
|
+
/**
|
|
11
|
+
* Optional bitmap nonce to sign the intent with. When provided, intent nonce
|
|
12
|
+
* generation is skipped entirely (no on-chain `isNonceUsed` check) and the
|
|
13
|
+
* supplied value is used as-is. Matches the `nonce` field returned on the
|
|
14
|
+
* signed-transaction result so callers can reuse it. Useful for
|
|
15
|
+
* mutually-exclusive / cancel-replace intents: signing multiple intents with
|
|
16
|
+
* the same nonce so at most one can ever land on-chain.
|
|
17
|
+
*/
|
|
18
|
+
nonce?: bigint;
|
|
10
19
|
/** How long the signed intent remains valid, in seconds. Defaults to 600 (10 minutes). */
|
|
11
20
|
validForSeconds?: number;
|
|
12
21
|
};
|
|
@@ -18,5 +27,5 @@ type SignSponsoredTransactionParams = {
|
|
|
18
27
|
* the target chain, and signs the typed-data payload with the wallet client
|
|
19
28
|
* provided in `deps`.
|
|
20
29
|
*/
|
|
21
|
-
export declare const signSponsoredTransaction: ({ authorization, autoDelegate, calls, validForSeconds, }: SignSponsoredTransactionParams, deps: EvmGaslessChainDeps) => Promise<SignedSponsoredTransaction>;
|
|
30
|
+
export declare const signSponsoredTransaction: ({ authorization, autoDelegate, calls, nonce: providedNonce, validForSeconds, }: SignSponsoredTransactionParams, deps: EvmGaslessChainDeps) => Promise<SignedSponsoredTransaction>;
|
|
22
31
|
export {};
|
|
@@ -13,11 +13,11 @@ import { toSerializedAuthorization } from '../toSerializedAuthorization/toSerial
|
|
|
13
13
|
* the target chain, and signs the typed-data payload with the wallet client
|
|
14
14
|
* provided in `deps`.
|
|
15
15
|
*/
|
|
16
|
-
const signSponsoredTransaction = async ({ authorization, autoDelegate = true, calls, validForSeconds = DEFAULT_VALID_FOR_SECONDS, }, deps) => {
|
|
16
|
+
const signSponsoredTransaction = async ({ authorization, autoDelegate = true, calls, nonce: providedNonce, validForSeconds = DEFAULT_VALID_FOR_SECONDS, }, deps) => {
|
|
17
17
|
const { chainId, walletClient } = deps;
|
|
18
18
|
const walletAddress = walletClient.account.address;
|
|
19
19
|
const resolvedAuthorization = await resolveAuthorization({ authorization, autoDelegate, walletAddress }, deps);
|
|
20
|
-
const nonce = await generateIntentNonce({ walletAddress }, deps);
|
|
20
|
+
const nonce = providedNonce ?? (await generateIntentNonce({ walletAddress }, deps));
|
|
21
21
|
const deadline = BigInt(Math.floor(Date.now() / 1000) + validForSeconds);
|
|
22
22
|
const { relayerAddress } = await getAvailableEvmGaslessRelayer({ chainId }, deps);
|
|
23
23
|
const signature = await walletClient.signTypedData({
|