@dynamic-labs-sdk/evm 1.0.0 → 1.1.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.
Files changed (109) hide show
  1. package/dist/{addEIP6963Extension-6WKcoc6j.cjs → addEIP6963Extension-BetJMzoN.cjs} +3 -3
  2. package/dist/{addEIP6963Extension-6WKcoc6j.cjs.map → addEIP6963Extension-BetJMzoN.cjs.map} +1 -1
  3. package/dist/{addEIP6963Extension-1jrwxkRl.esm.js → addEIP6963Extension-BkFn7lhu.esm.js} +3 -3
  4. package/dist/{addEIP6963Extension-1jrwxkRl.esm.js.map → addEIP6963Extension-BkFn7lhu.esm.js.map} +1 -1
  5. package/dist/{addEIP6963Extension-J6SledVr.native.esm.js → addEIP6963Extension-C_IKf5DD.native.esm.js} +1 -1
  6. package/dist/{addEIP6963Extension-J6SledVr.native.esm.js.map → addEIP6963Extension-C_IKf5DD.native.esm.js.map} +1 -1
  7. package/dist/{addWaasEvmExtension-BPKFUV3U.cjs → addWaasEvmExtension-BjEG62TS.cjs} +5 -5
  8. package/dist/{addWaasEvmExtension-BPKFUV3U.cjs.map → addWaasEvmExtension-BjEG62TS.cjs.map} +1 -1
  9. package/dist/{addWaasEvmExtension-CctMlyNt.esm.js → addWaasEvmExtension-Bs_lbp0N.esm.js} +7 -7
  10. package/dist/addWaasEvmExtension-Bs_lbp0N.esm.js.map +1 -0
  11. package/dist/{addWaasEvmExtension-U4DO_WKC.native.esm.js → addWaasEvmExtension-L8dUNmj8.native.esm.js} +8 -8
  12. package/dist/addWaasEvmExtension-L8dUNmj8.native.esm.js.map +1 -0
  13. package/dist/baseAccount.cjs +4 -4
  14. package/dist/baseAccount.esm.js +6 -6
  15. package/dist/baseAccount.esm.js.map +1 -1
  16. package/dist/baseAccount.native.esm.js +7 -7
  17. package/dist/baseAccount.native.esm.js.map +1 -1
  18. package/dist/{createWalletClientForWalletAccount-V4CfRjd4.native.esm.js → createWalletClientForWalletAccount-BotF25Kn.native.esm.js} +3 -3
  19. package/dist/createWalletClientForWalletAccount-BotF25Kn.native.esm.js.map +1 -0
  20. package/dist/{createWalletClientForWalletAccount-2HJ_yeO9.esm.js → createWalletClientForWalletAccount-CHmtNxiy.esm.js} +4 -4
  21. package/dist/createWalletClientForWalletAccount-CHmtNxiy.esm.js.map +1 -0
  22. package/dist/{createWalletClientForWalletAccount-BKMV0WzZ.cjs → createWalletClientForWalletAccount-DPqYzhGF.cjs} +3 -3
  23. package/dist/{createWalletClientForWalletAccount-BKMV0WzZ.cjs.map → createWalletClientForWalletAccount-DPqYzhGF.cjs.map} +1 -1
  24. package/dist/{createWalletProviderFromEIP1193Provider-CBbP9cb2.cjs → createWalletProviderFromEIP1193Provider-CR9bMUqi.cjs} +4 -4
  25. package/dist/{createWalletProviderFromEIP1193Provider-CBbP9cb2.cjs.map → createWalletProviderFromEIP1193Provider-CR9bMUqi.cjs.map} +1 -1
  26. package/dist/{createWalletProviderFromEIP1193Provider-DnPhiRmj.native.esm.js → createWalletProviderFromEIP1193Provider-CWWLWjod.native.esm.js} +4 -4
  27. package/dist/{createWalletProviderFromEIP1193Provider-DnPhiRmj.native.esm.js.map → createWalletProviderFromEIP1193Provider-CWWLWjod.native.esm.js.map} +1 -1
  28. package/dist/{createWalletProviderFromEIP1193Provider-BdZcBFWx.esm.js → createWalletProviderFromEIP1193Provider-d7kBxjN-.esm.js} +4 -4
  29. package/dist/{createWalletProviderFromEIP1193Provider-BdZcBFWx.esm.js.map → createWalletProviderFromEIP1193Provider-d7kBxjN-.esm.js.map} +1 -1
  30. package/dist/eip6963.cjs +4 -4
  31. package/dist/eip6963.esm.js +4 -4
  32. package/dist/eip6963.native.esm.js +2 -2
  33. package/dist/{evmTransferAmount-B__79nVn.native.esm.js → evmTransferAmount-BY0rW4dg.native.esm.js} +3 -3
  34. package/dist/{evmTransferAmount-B__79nVn.native.esm.js.map → evmTransferAmount-BY0rW4dg.native.esm.js.map} +1 -1
  35. package/dist/{evmTransferAmount-D1PZCZks.esm.js → evmTransferAmount-BqIGE_0U.esm.js} +3 -3
  36. package/dist/{evmTransferAmount-D1PZCZks.esm.js.map → evmTransferAmount-BqIGE_0U.esm.js.map} +1 -1
  37. package/dist/{evmTransferAmount-BA5VR2bh.cjs → evmTransferAmount-CysmazOr.cjs} +3 -3
  38. package/dist/{evmTransferAmount-BA5VR2bh.cjs.map → evmTransferAmount-CysmazOr.cjs.map} +1 -1
  39. package/dist/exports/index.d.ts +3 -0
  40. package/dist/exports/index.d.ts.map +1 -1
  41. package/dist/gasless/activate7702Delegation/activate7702Delegation.d.ts +29 -0
  42. package/dist/gasless/activate7702Delegation/activate7702Delegation.d.ts.map +1 -0
  43. package/dist/gasless/activate7702Delegation/index.d.ts +2 -0
  44. package/dist/gasless/activate7702Delegation/index.d.ts.map +1 -0
  45. package/dist/gasless/constants.d.ts +0 -2
  46. package/dist/gasless/constants.d.ts.map +1 -1
  47. package/dist/gasless/create7702DelegationRegistry/create7702DelegationRegistry.d.ts +22 -0
  48. package/dist/gasless/create7702DelegationRegistry/create7702DelegationRegistry.d.ts.map +1 -0
  49. package/dist/gasless/create7702DelegationRegistry/index.d.ts +3 -0
  50. package/dist/gasless/create7702DelegationRegistry/index.d.ts.map +1 -0
  51. package/dist/gasless/gasless.types.d.ts +6 -4
  52. package/dist/gasless/gasless.types.d.ts.map +1 -1
  53. package/dist/gasless/get7702DelegationRegistry/get7702DelegationRegistry.d.ts +7 -0
  54. package/dist/gasless/get7702DelegationRegistry/get7702DelegationRegistry.d.ts.map +1 -0
  55. package/dist/gasless/get7702DelegationRegistry/index.d.ts +2 -0
  56. package/dist/gasless/get7702DelegationRegistry/index.d.ts.map +1 -0
  57. package/dist/gasless/getAvailableEvmGaslessRelayer/getAvailableEvmGaslessRelayer.d.ts +28 -0
  58. package/dist/gasless/getAvailableEvmGaslessRelayer/getAvailableEvmGaslessRelayer.d.ts.map +1 -0
  59. package/dist/gasless/getAvailableEvmGaslessRelayer/index.d.ts +2 -0
  60. package/dist/gasless/getAvailableEvmGaslessRelayer/index.d.ts.map +1 -0
  61. package/dist/gasless/is7702DelegationActive/index.d.ts +2 -0
  62. package/dist/gasless/is7702DelegationActive/index.d.ts.map +1 -0
  63. package/dist/gasless/is7702DelegationActive/is7702DelegationActive.d.ts +18 -0
  64. package/dist/gasless/is7702DelegationActive/is7702DelegationActive.d.ts.map +1 -0
  65. package/dist/gasless/relaySponsoredTransaction/relaySponsoredTransaction.d.ts +3 -1
  66. package/dist/gasless/relaySponsoredTransaction/relaySponsoredTransaction.d.ts.map +1 -1
  67. package/dist/gasless/resolveAuthorization/index.d.ts +2 -0
  68. package/dist/gasless/resolveAuthorization/index.d.ts.map +1 -0
  69. package/dist/gasless/resolveAuthorization/resolveAuthorization.d.ts +20 -0
  70. package/dist/gasless/resolveAuthorization/resolveAuthorization.d.ts.map +1 -0
  71. package/dist/gasless/sendSponsoredTransaction/sendSponsoredTransaction.d.ts +6 -4
  72. package/dist/gasless/sendSponsoredTransaction/sendSponsoredTransaction.d.ts.map +1 -1
  73. package/dist/gasless/sign7702Authorization/index.d.ts +2 -0
  74. package/dist/gasless/sign7702Authorization/index.d.ts.map +1 -0
  75. package/dist/gasless/sign7702Authorization/sign7702Authorization.d.ts +23 -0
  76. package/dist/gasless/sign7702Authorization/sign7702Authorization.d.ts.map +1 -0
  77. package/dist/gasless/signSponsoredTransaction/signSponsoredTransaction.d.ts +12 -6
  78. package/dist/gasless/signSponsoredTransaction/signSponsoredTransaction.d.ts.map +1 -1
  79. package/dist/gasless/waitForSponsoredTransaction/waitForSponsoredTransaction.d.ts +2 -6
  80. package/dist/gasless/waitForSponsoredTransaction/waitForSponsoredTransaction.d.ts.map +1 -1
  81. package/dist/index.cjs +459 -277
  82. package/dist/index.cjs.map +1 -1
  83. package/dist/index.esm.js +435 -256
  84. package/dist/index.esm.js.map +1 -1
  85. package/dist/index.native.esm.js +435 -256
  86. package/dist/index.native.esm.js.map +1 -1
  87. package/dist/{package-BxZgKgaF.native.esm.js → package-CQsUJaO4.native.esm.js} +2 -2
  88. package/dist/package-CQsUJaO4.native.esm.js.map +1 -0
  89. package/dist/tsconfig.lib.tsbuildinfo +1 -1
  90. package/dist/viem.cjs +1 -1
  91. package/dist/viem.esm.js +1 -1
  92. package/dist/viem.native.esm.js +2 -2
  93. package/dist/waas.cjs +3 -3
  94. package/dist/waas.esm.js +3 -3
  95. package/dist/waas.native.esm.js +4 -4
  96. package/dist/walletConnect.cjs +4 -4
  97. package/dist/walletConnect.esm.js +9 -9
  98. package/dist/walletConnect.esm.js.map +1 -1
  99. package/dist/walletConnect.native.esm.js +10 -10
  100. package/dist/walletConnect.native.esm.js.map +1 -1
  101. package/dist/windowInjected.cjs +3 -3
  102. package/dist/windowInjected.esm.js +3 -3
  103. package/dist/windowInjected.native.esm.js +4 -4
  104. package/package.json +5 -5
  105. package/dist/addWaasEvmExtension-CctMlyNt.esm.js.map +0 -1
  106. package/dist/addWaasEvmExtension-U4DO_WKC.native.esm.js.map +0 -1
  107. package/dist/createWalletClientForWalletAccount-2HJ_yeO9.esm.js.map +0 -1
  108. package/dist/createWalletClientForWalletAccount-V4CfRjd4.native.esm.js.map +0 -1
  109. package/dist/package-BxZgKgaF.native.esm.js.map +0 -1
@@ -0,0 +1,28 @@
1
+ import type { DynamicClient } from '@dynamic-labs-sdk/client';
2
+ import type { Hex } from 'viem';
3
+ type GetAvailableEvmGaslessRelayerParams = {
4
+ /** The EVM chain ID the sponsored transaction will target. */
5
+ chainId: number;
6
+ };
7
+ type GetAvailableEvmGaslessRelayerResult = {
8
+ /** Relayer EOA that will broadcast the sponsored transaction on-chain. */
9
+ relayerAddress: Hex;
10
+ };
11
+ /**
12
+ * Fetches the relayer address to embed in the EIP-712 sponsored-transaction
13
+ * intent for the given chain.
14
+ *
15
+ * The returned address is owned by the project's relay backend and is the
16
+ * eventual `from` of the on-chain broadcast. It must be set as the `relayer`
17
+ * field of the EIP-712 intent before signing — the on-chain delegate validates
18
+ * the signature against this address.
19
+ *
20
+ * @param params.chainId - The EVM chain ID the sponsored transaction targets.
21
+ * @param client - The Dynamic client instance.
22
+ * @returns The relayer address to embed in the EIP-712 intent.
23
+ * @throws {SponsorTransactionError} If the API call fails or returns no relayer address.
24
+ * @not-instrumented
25
+ */
26
+ export declare const getAvailableEvmGaslessRelayer: ({ chainId }: GetAvailableEvmGaslessRelayerParams, client: DynamicClient) => Promise<GetAvailableEvmGaslessRelayerResult>;
27
+ export {};
28
+ //# sourceMappingURL=getAvailableEvmGaslessRelayer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getAvailableEvmGaslessRelayer.d.ts","sourceRoot":"","sources":["../../../src/gasless/getAvailableEvmGaslessRelayer/getAvailableEvmGaslessRelayer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAE9D,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,MAAM,CAAC;AAIhC,KAAK,mCAAmC,GAAG;IACzC,8DAA8D;IAC9D,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,KAAK,mCAAmC,GAAG;IACzC,0EAA0E;IAC1E,cAAc,EAAE,GAAG,CAAC;CACrB,CAAC;AAEF;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,6BAA6B,gBAC3B,mCAAmC,UACxC,aAAa,KACpB,OAAO,CAAC,mCAAmC,CAqB7C,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { getAvailableEvmGaslessRelayer } from './getAvailableEvmGaslessRelayer';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/gasless/getAvailableEvmGaslessRelayer/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,6BAA6B,EAAE,MAAM,iCAAiC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { is7702DelegationActive } from './is7702DelegationActive';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/gasless/is7702DelegationActive/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC"}
@@ -0,0 +1,18 @@
1
+ import type { EvmWalletAccount } from '../../EvmWalletAccount.types';
2
+ type Is7702DelegationActiveParams = {
3
+ walletAccount: EvmWalletAccount;
4
+ };
5
+ /**
6
+ * Checks whether EIP-7702 delegation to the Dynamic gasless contract is active
7
+ * for the given wallet account on its current network.
8
+ *
9
+ * Results are cached per wallet+chain in an in-memory registry
10
+ *
11
+ * @param params.walletAccount - The EVM wallet account to check delegation status for.
12
+ * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
13
+ * @returns True if the wallet has an active delegation to the gasless contract.
14
+ * @not-instrumented
15
+ */
16
+ export declare const is7702DelegationActive: ({ walletAccount }: Is7702DelegationActiveParams, client?: import("@dynamic-labs-sdk/client").DynamicClient) => Promise<boolean>;
17
+ export {};
18
+ //# sourceMappingURL=is7702DelegationActive.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"is7702DelegationActive.d.ts","sourceRoot":"","sources":["../../../src/gasless/is7702DelegationActive/is7702DelegationActive.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AASrE,KAAK,4BAA4B,GAAG;IAClC,aAAa,EAAE,gBAAgB,CAAC;CACjC,CAAC;AAEF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,sBAAsB,sBACd,4BAA4B,gEAE9C,OAAO,CAAC,OAAO,CAmCjB,CAAC"}
@@ -2,8 +2,10 @@ import type { SignAuthorizationReturnType } from 'viem/accounts';
2
2
  import type { EvmWalletAccount } from '../../EvmWalletAccount.types';
3
3
  import type { SignedSponsoredTransaction, SponsoredTransactionCall } from '../gasless.types';
4
4
  type RelaySponsoredTransactionWithCallsParams = {
5
- /** Pre-signed EIP-7702 authorization to include in the payload. */
5
+ /** Pre-signed EIP-7702 authorization. Takes priority over autoDelegate. */
6
6
  authorization?: SignAuthorizationReturnType;
7
+ /** Whether to automatically sign 7702 authorization if not delegated. Defaults to true. */
8
+ autoDelegate?: boolean;
7
9
  /** The batch of calls to execute. */
8
10
  calls: SponsoredTransactionCall[];
9
11
  /** How long the signed intent remains valid, in seconds. Defaults to 600 (10 minutes). */
@@ -1 +1 @@
1
- {"version":3,"file":"relaySponsoredTransaction.d.ts","sourceRoot":"","sources":["../../../src/gasless/relaySponsoredTransaction/relaySponsoredTransaction.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,eAAe,CAAC;AAEjE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAGrE,OAAO,KAAK,EACV,0BAA0B,EAC1B,wBAAwB,EACzB,MAAM,kBAAkB,CAAC;AAG1B,KAAK,wCAAwC,GAAG;IAC9C,mEAAmE;IACnE,aAAa,CAAC,EAAE,2BAA2B,CAAC;IAC5C,qCAAqC;IACrC,KAAK,EAAE,wBAAwB,EAAE,CAAC;IAClC,0FAA0F;IAC1F,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,oEAAoE;IACpE,aAAa,EAAE,gBAAgB,CAAC;CACjC,CAAC;AAEF,KAAK,2CAA2C,GAAG;IACjD,gFAAgF;IAChF,iBAAiB,EAAE,0BAA0B,CAAC;CAC/C,CAAC;AAEF,KAAK,+BAA+B,GAChC,wCAAwC,GACxC,2CAA2C,CAAC;AAOhD;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,yBAAyB,WAC5B,+BAA+B,gEAEtC,OAAO,CAAC;IAAE,SAAS,EAAE,MAAM,CAAA;CAAE,CA8C/B,CAAC"}
1
+ {"version":3,"file":"relaySponsoredTransaction.d.ts","sourceRoot":"","sources":["../../../src/gasless/relaySponsoredTransaction/relaySponsoredTransaction.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,eAAe,CAAC;AAEjE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAGrE,OAAO,KAAK,EACV,0BAA0B,EAC1B,wBAAwB,EACzB,MAAM,kBAAkB,CAAC;AAG1B,KAAK,wCAAwC,GAAG;IAC9C,2EAA2E;IAC3E,aAAa,CAAC,EAAE,2BAA2B,CAAC;IAC5C,2FAA2F;IAC3F,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,qCAAqC;IACrC,KAAK,EAAE,wBAAwB,EAAE,CAAC;IAClC,0FAA0F;IAC1F,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,oEAAoE;IACpE,aAAa,EAAE,gBAAgB,CAAC;CACjC,CAAC;AAEF,KAAK,2CAA2C,GAAG;IACjD,gFAAgF;IAChF,iBAAiB,EAAE,0BAA0B,CAAC;CAC/C,CAAC;AAEF,KAAK,+BAA+B,GAChC,wCAAwC,GACxC,2CAA2C,CAAC;AAOhD;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,yBAAyB,WAC5B,+BAA+B,gEAEtC,OAAO,CAAC;IAAE,SAAS,EAAE,MAAM,CAAA;CAAE,CA+C/B,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { resolveAuthorization } from './resolveAuthorization';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/gasless/resolveAuthorization/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC"}
@@ -0,0 +1,20 @@
1
+ import type { getDefaultClient } from '@dynamic-labs-sdk/client/core';
2
+ import type { SignAuthorizationReturnType } from 'viem/accounts';
3
+ import type { EvmWalletAccount } from '../../EvmWalletAccount.types';
4
+ type ResolveAuthorizationParams = {
5
+ authorization?: SignAuthorizationReturnType;
6
+ autoDelegate: boolean;
7
+ walletAccount: EvmWalletAccount;
8
+ };
9
+ /**
10
+ * Resolves the EIP-7702 authorization for a sponsored transaction.
11
+ *
12
+ * Returns the provided authorization if given, auto-signs one if needed
13
+ * and autoDelegate is true, or returns undefined if the wallet is already
14
+ * delegated or autoDelegate is false.
15
+ *
16
+ * @not-instrumented
17
+ */
18
+ export declare const resolveAuthorization: ({ authorization, autoDelegate, walletAccount, }: ResolveAuthorizationParams, client: ReturnType<typeof getDefaultClient>) => Promise<SignAuthorizationReturnType | undefined>;
19
+ export {};
20
+ //# sourceMappingURL=resolveAuthorization.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolveAuthorization.d.ts","sourceRoot":"","sources":["../../../src/gasless/resolveAuthorization/resolveAuthorization.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACtE,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,eAAe,CAAC;AAEjE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAIrE,KAAK,0BAA0B,GAAG;IAChC,aAAa,CAAC,EAAE,2BAA2B,CAAC;IAC5C,YAAY,EAAE,OAAO,CAAC;IACtB,aAAa,EAAE,gBAAgB,CAAC;CACjC,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,oBAAoB,oDAK5B,0BAA0B,UACrB,UAAU,CAAC,OAAO,gBAAgB,CAAC,KAC1C,OAAO,CAAC,2BAA2B,GAAG,SAAS,CAmBjD,CAAC"}
@@ -3,8 +3,10 @@ import type { SignAuthorizationReturnType } from 'viem/accounts';
3
3
  import type { EvmWalletAccount } from '../../EvmWalletAccount.types';
4
4
  import type { SignedSponsoredTransaction, SponsoredTransactionCall } from '../gasless.types';
5
5
  type SendSponsoredTransactionWithCallsParams = {
6
- /** Pre-signed EIP-7702 authorization to include in the payload. */
6
+ /** Pre-signed EIP-7702 authorization. Takes priority over autoDelegate. */
7
7
  authorization?: SignAuthorizationReturnType;
8
+ /** Whether to automatically sign 7702 authorization if not delegated. Defaults to true. */
9
+ autoDelegate?: boolean;
8
10
  /** The batch of calls to execute. */
9
11
  calls: SponsoredTransactionCall[];
10
12
  /** How long the signed intent remains valid, in seconds. Defaults to 600 (10 minutes). */
@@ -18,12 +20,12 @@ type SendSponsoredTransactionWithSignedTxParams = {
18
20
  };
19
21
  type SendSponsoredTransactionParams = SendSponsoredTransactionWithCallsParams | SendSponsoredTransactionWithSignedTxParams;
20
22
  /**
21
- * Sends a sponsored EVM transaction and waits for the on-chain transaction hash.
23
+ * Sends a sponsored EVM transaction and waits for on-chain inclusion.
22
24
  *
23
25
  * Accepts either a pre-signed transaction or unsigned calls. When given
24
26
  * unsigned calls, signs the transaction first via signSponsoredTransaction.
25
- * Relays the transaction and polls until the relay reports a CONFIRMED
26
- * status, then returns the resulting transaction hash.
27
+ * Relays the transaction and resolves as soon as the relay reports the
28
+ * transaction has been included on-chain.
27
29
  *
28
30
  * @param params - Either { signedTransaction } or { walletAccount, calls, ... }.
29
31
  * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
@@ -1 +1 @@
1
- {"version":3,"file":"sendSponsoredTransaction.d.ts","sourceRoot":"","sources":["../../../src/gasless/sendSponsoredTransaction/sendSponsoredTransaction.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,MAAM,CAAC;AAChC,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,eAAe,CAAC;AAEjE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AACrE,OAAO,KAAK,EACV,0BAA0B,EAC1B,wBAAwB,EACzB,MAAM,kBAAkB,CAAC;AAI1B,KAAK,uCAAuC,GAAG;IAC7C,mEAAmE;IACnE,aAAa,CAAC,EAAE,2BAA2B,CAAC;IAC5C,qCAAqC;IACrC,KAAK,EAAE,wBAAwB,EAAE,CAAC;IAClC,0FAA0F;IAC1F,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,mEAAmE;IACnE,aAAa,EAAE,gBAAgB,CAAC;CACjC,CAAC;AAEF,KAAK,0CAA0C,GAAG;IAChD,gFAAgF;IAChF,iBAAiB,EAAE,0BAA0B,CAAC;CAC/C,CAAC;AAEF,KAAK,8BAA8B,GAC/B,uCAAuC,GACvC,0CAA0C,CAAC;AAE/C;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,wBAAwB,WAC3B,8BAA8B,gEAErC,OAAO,CAAC;IAAE,eAAe,EAAE,GAAG,CAAA;CAAE,CAGlC,CAAC"}
1
+ {"version":3,"file":"sendSponsoredTransaction.d.ts","sourceRoot":"","sources":["../../../src/gasless/sendSponsoredTransaction/sendSponsoredTransaction.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,MAAM,CAAC;AAChC,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,eAAe,CAAC;AAEjE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AACrE,OAAO,KAAK,EACV,0BAA0B,EAC1B,wBAAwB,EACzB,MAAM,kBAAkB,CAAC;AAI1B,KAAK,uCAAuC,GAAG;IAC7C,2EAA2E;IAC3E,aAAa,CAAC,EAAE,2BAA2B,CAAC;IAC5C,2FAA2F;IAC3F,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,qCAAqC;IACrC,KAAK,EAAE,wBAAwB,EAAE,CAAC;IAClC,0FAA0F;IAC1F,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,mEAAmE;IACnE,aAAa,EAAE,gBAAgB,CAAC;CACjC,CAAC;AAEF,KAAK,0CAA0C,GAAG;IAChD,gFAAgF;IAChF,iBAAiB,EAAE,0BAA0B,CAAC;CAC/C,CAAC;AAEF,KAAK,8BAA8B,GAC/B,uCAAuC,GACvC,0CAA0C,CAAC;AAE/C;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,wBAAwB,WAC3B,8BAA8B,gEAErC,OAAO,CAAC;IAAE,eAAe,EAAE,GAAG,CAAA;CAAE,CAGlC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { sign7702Authorization } from './sign7702Authorization';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/gasless/sign7702Authorization/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC"}
@@ -0,0 +1,23 @@
1
+ import type { SignAuthorizationReturnType } from 'viem/accounts';
2
+ import type { EvmWalletAccount } from '../../EvmWalletAccount.types';
3
+ type Sign7702AuthorizationParams = {
4
+ chainId?: number;
5
+ walletAccount: EvmWalletAccount;
6
+ };
7
+ /**
8
+ * Signs an EIP-7702 authorization to delegate the wallet to the Dynamic
9
+ * gasless delegation contract.
10
+ *
11
+ * The signed authorization can be included in a sponsored transaction to
12
+ * activate the delegation on-chain. If no chainId is provided, the wallet's
13
+ * active network chain ID is used.
14
+ *
15
+ * @param params.walletAccount - The EVM wallet account to sign the authorization for.
16
+ * @param [params.chainId] - Override chain ID. Defaults to the wallet's active network.
17
+ * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
18
+ * @returns The signed EIP-7702 authorization.
19
+ * @not-instrumented
20
+ */
21
+ export declare const sign7702Authorization: ({ walletAccount, chainId }: Sign7702AuthorizationParams, client?: import("@dynamic-labs-sdk/client").DynamicClient) => Promise<SignAuthorizationReturnType>;
22
+ export {};
23
+ //# sourceMappingURL=sign7702Authorization.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sign7702Authorization.d.ts","sourceRoot":"","sources":["../../../src/gasless/sign7702Authorization/sign7702Authorization.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,eAAe,CAAC;AAGjE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAKrE,KAAK,2BAA2B,GAAG;IACjC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,aAAa,EAAE,gBAAgB,CAAC;CACjC,CAAC;AAEF;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,qBAAqB,+BACJ,2BAA2B,gEAEtD,OAAO,CAAC,2BAA2B,CAerC,CAAC"}
@@ -2,8 +2,10 @@ import type { SignAuthorizationReturnType } from 'viem/accounts';
2
2
  import type { EvmWalletAccount } from '../../EvmWalletAccount.types';
3
3
  import type { SignedSponsoredTransaction, SponsoredTransactionCall } from '../gasless.types';
4
4
  type SignSponsoredTransactionParams = {
5
- /** Pre-signed EIP-7702 authorization to include in the payload. */
5
+ /** Pre-signed EIP-7702 authorization. Takes priority over autoDelegate. */
6
6
  authorization?: SignAuthorizationReturnType;
7
+ /** Whether to automatically sign 7702 authorization if not delegated. Defaults to true. */
8
+ autoDelegate?: boolean;
7
9
  /** The batch of calls to execute. */
8
10
  calls: SponsoredTransactionCall[];
9
11
  /** How long the signed intent remains valid, in seconds. Defaults to 600 (10 minutes). */
@@ -14,18 +16,22 @@ type SignSponsoredTransactionParams = {
14
16
  /**
15
17
  * Signs a sponsored transaction by creating an EIP-712 intent signature.
16
18
  *
17
- * If an authorization is provided, it is serialized and included in the
18
- * payload. Otherwise the intent is signed without any authorization
19
- * (caller manages delegation separately).
19
+ * This function handles the complete signing flow:
20
+ * - If an authorization is provided, it is included in the payload.
21
+ * - If autoDelegate is true (default) and no authorization is provided,
22
+ * checks whether delegation is active and signs a 7702 authorization if needed.
23
+ * - If autoDelegate is false and no authorization is provided, the intent
24
+ * is signed without any authorization (user manages delegation separately).
20
25
  *
21
26
  * @param params.walletAccount - The EVM wallet account to sign with.
22
27
  * @param params.calls - The batch of calls to execute.
23
- * @param [params.authorization] - Pre-signed EIP-7702 authorization to include.
28
+ * @param [params.authorization] - Pre-signed EIP-7702 authorization. Takes priority over autoDelegate.
29
+ * @param [params.autoDelegate] - Whether to auto-sign 7702 if not delegated. Defaults to true.
24
30
  * @param [params.validForSeconds] - How long the signed intent remains valid, in seconds. Defaults to 600 (10 minutes).
25
31
  * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
26
32
  * @returns The signed sponsored transaction payload ready to be sent to the API.
27
33
  * @not-instrumented
28
34
  */
29
- export declare const signSponsoredTransaction: ({ walletAccount, calls, authorization, validForSeconds, }: SignSponsoredTransactionParams, client?: import("@dynamic-labs-sdk/client").DynamicClient) => Promise<SignedSponsoredTransaction>;
35
+ export declare const signSponsoredTransaction: ({ walletAccount, calls, authorization, autoDelegate, validForSeconds, }: SignSponsoredTransactionParams, client?: import("@dynamic-labs-sdk/client").DynamicClient) => Promise<SignedSponsoredTransaction>;
30
36
  export {};
31
37
  //# sourceMappingURL=signSponsoredTransaction.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"signSponsoredTransaction.d.ts","sourceRoot":"","sources":["../../../src/gasless/signSponsoredTransaction/signSponsoredTransaction.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,eAAe,CAAC;AAEjE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAUrE,OAAO,KAAK,EACV,0BAA0B,EAC1B,wBAAwB,EACzB,MAAM,kBAAkB,CAAC;AAI1B,KAAK,8BAA8B,GAAG;IACpC,mEAAmE;IACnE,aAAa,CAAC,EAAE,2BAA2B,CAAC;IAC5C,qCAAqC;IACrC,KAAK,EAAE,wBAAwB,EAAE,CAAC;IAClC,0FAA0F;IAC1F,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,0DAA0D;IAC1D,aAAa,EAAE,gBAAgB,CAAC;CACjC,CAAC;AAEF;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,wBAAwB,8DAMhC,8BAA8B,gEAEhC,OAAO,CAAC,0BAA0B,CAwDpC,CAAC"}
1
+ {"version":3,"file":"signSponsoredTransaction.d.ts","sourceRoot":"","sources":["../../../src/gasless/signSponsoredTransaction/signSponsoredTransaction.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,eAAe,CAAC;AAEjE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAWrE,OAAO,KAAK,EACV,0BAA0B,EAC1B,wBAAwB,EACzB,MAAM,kBAAkB,CAAC;AAI1B,KAAK,8BAA8B,GAAG;IACpC,2EAA2E;IAC3E,aAAa,CAAC,EAAE,2BAA2B,CAAC;IAC5C,2FAA2F;IAC3F,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,qCAAqC;IACrC,KAAK,EAAE,wBAAwB,EAAE,CAAC;IAClC,0FAA0F;IAC1F,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,0DAA0D;IAC1D,aAAa,EAAE,gBAAgB,CAAC;CACjC,CAAC;AAEF;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,wBAAwB,4EAOhC,8BAA8B,gEAEhC,OAAO,CAAC,0BAA0B,CAkEpC,CAAC"}
@@ -4,12 +4,8 @@ type WaitForSponsoredTransactionParams = {
4
4
  requestId: string;
5
5
  };
6
6
  /**
7
- * Polls `getEVMSponsoredTransactionStatus` until the relay reaches a terminal
8
- * state and returns the on-chain transaction hash.
9
- *
10
- * Resolves on `CONFIRMED`. Throws `SponsorTransactionError` on terminal
11
- * failure statuses (`FAILED`, `CANCELED`, `EXPIRED`, `REJECTED`) or after a
12
- * 60s timeout.
7
+ * Polls `getEVMSponsoredTransactionStatus` until the relay reports the
8
+ * transaction has been included on-chain, then returns the transaction hash.
13
9
  *
14
10
  * @param params.requestId - The request ID returned when the transaction was relayed.
15
11
  * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
@@ -1 +1 @@
1
- {"version":3,"file":"waitForSponsoredTransaction.d.ts","sourceRoot":"","sources":["../../../src/gasless/waitForSponsoredTransaction/waitForSponsoredTransaction.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,MAAM,CAAC;AAShC,KAAK,iCAAiC,GAAG;IACvC,2FAA2F;IAC3F,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,2BAA2B,kBACvB,iCAAiC,gEAE/C,OAAO,CAAC;IAAE,eAAe,EAAE,GAAG,CAAA;CAAE,CAqClC,CAAC"}
1
+ {"version":3,"file":"waitForSponsoredTransaction.d.ts","sourceRoot":"","sources":["../../../src/gasless/waitForSponsoredTransaction/waitForSponsoredTransaction.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,MAAM,CAAC;AAchC,KAAK,iCAAiC,GAAG;IACvC,2FAA2F;IAC3F,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF;;;;;;;;;GASG;AACH,eAAO,MAAM,2BAA2B,kBACvB,iCAAiC,gEAE/C,OAAO,CAAC;IAAE,eAAe,EAAE,GAAG,CAAA;CAAE,CA0BlC,CAAC"}