@circle-fin/usdckit 0.22.0 → 0.23.1

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 (77) hide show
  1. package/dist/cjs/abis/EIP2612.d.ts +197 -0
  2. package/dist/cjs/abis/EIP2612.js +78 -0
  3. package/dist/cjs/actions/index.d.ts +67 -1
  4. package/dist/cjs/actions/index.js +7 -0
  5. package/dist/cjs/actions/index.test.js +4 -0
  6. package/dist/cjs/actions/permit.d.ts +19 -0
  7. package/dist/cjs/actions/permit.js +50 -0
  8. package/dist/cjs/actions/permit.test.d.ts +1 -0
  9. package/dist/cjs/actions/permit.test.js +652 -0
  10. package/dist/cjs/actions/signEIP2612Permit.d.ts +130 -0
  11. package/dist/cjs/actions/signEIP2612Permit.js +128 -0
  12. package/dist/cjs/actions/signEIP2612Permit.test.d.ts +1 -0
  13. package/dist/cjs/actions/signEIP2612Permit.test.js +434 -0
  14. package/dist/cjs/chains/ARC_TESTNET.d.ts +180 -0
  15. package/dist/cjs/chains/ARC_TESTNET.js +57 -0
  16. package/dist/cjs/chains/index.d.ts +21 -18
  17. package/dist/cjs/chains/index.js +27 -25
  18. package/dist/cjs/chains/index.test.js +1 -0
  19. package/dist/cjs/client.d.ts +1 -1
  20. package/dist/cjs/extractChain.d.ts +1492 -1313
  21. package/dist/cjs/extractChain.test.js +1 -0
  22. package/dist/cjs/index.d.ts +2 -2
  23. package/dist/cjs/index.js +1 -1
  24. package/dist/cjs/metadata.js +1 -1
  25. package/dist/cjs/providers/circle-wallets/actions/createAccount.d.ts +1109 -930
  26. package/dist/cjs/providers/circle-wallets/actions/createAccount.js +3 -0
  27. package/dist/cjs/providers/circle-wallets/actions/estimateContractExecutionFee.d.ts +6 -0
  28. package/dist/cjs/providers/circle-wallets/actions/estimateTransferFee.d.ts +6 -0
  29. package/dist/cjs/providers/circle-wallets/actions/getAccounts.d.ts +1109 -930
  30. package/dist/cjs/providers/circle-wallets/index.d.ts +358 -0
  31. package/dist/cjs/providers/circle-wallets/index.js +2 -0
  32. package/dist/cjs/providers/circle-wallets/transports/index.d.ts +12 -0
  33. package/dist/cjs/utils/createConfig.d.ts +1 -1
  34. package/dist/cjs/utils/createCustomWalletClient.d.ts +1 -1
  35. package/dist/cjs/utils/getChainContractByAddress.d.ts +1 -1
  36. package/dist/cjs/utils/getContract.d.ts +8 -8
  37. package/dist/esm/abis/EIP2612.d.ts +197 -0
  38. package/dist/esm/abis/EIP2612.js +76 -0
  39. package/dist/esm/actions/index.d.ts +67 -1
  40. package/dist/esm/actions/index.js +7 -0
  41. package/dist/esm/actions/index.test.js +4 -0
  42. package/dist/esm/actions/permit.d.ts +19 -0
  43. package/dist/esm/actions/permit.js +44 -0
  44. package/dist/esm/actions/permit.test.d.ts +1 -0
  45. package/dist/esm/actions/permit.test.js +650 -0
  46. package/dist/esm/actions/signEIP2612Permit.d.ts +130 -0
  47. package/dist/esm/actions/signEIP2612Permit.js +122 -0
  48. package/dist/esm/actions/signEIP2612Permit.test.d.ts +1 -0
  49. package/dist/esm/actions/signEIP2612Permit.test.js +432 -0
  50. package/dist/esm/chains/ARC_TESTNET.d.ts +180 -0
  51. package/dist/esm/chains/ARC_TESTNET.js +54 -0
  52. package/dist/esm/chains/index.d.ts +21 -18
  53. package/dist/esm/chains/index.js +20 -18
  54. package/dist/esm/chains/index.test.js +1 -0
  55. package/dist/esm/client.d.ts +1 -1
  56. package/dist/esm/extractChain.d.ts +1492 -1313
  57. package/dist/esm/extractChain.test.js +2 -1
  58. package/dist/esm/index.d.ts +2 -2
  59. package/dist/esm/index.js +1 -1
  60. package/dist/esm/metadata.js +1 -1
  61. package/dist/esm/providers/circle-wallets/actions/createAccount.d.ts +1109 -930
  62. package/dist/esm/providers/circle-wallets/actions/createAccount.js +3 -0
  63. package/dist/esm/providers/circle-wallets/actions/estimateContractExecutionFee.d.ts +6 -0
  64. package/dist/esm/providers/circle-wallets/actions/estimateTransferFee.d.ts +6 -0
  65. package/dist/esm/providers/circle-wallets/actions/getAccounts.d.ts +1109 -930
  66. package/dist/esm/providers/circle-wallets/index.d.ts +358 -0
  67. package/dist/esm/providers/circle-wallets/index.js +3 -1
  68. package/dist/esm/providers/circle-wallets/transports/index.d.ts +12 -0
  69. package/dist/esm/utils/createConfig.d.ts +1 -1
  70. package/dist/esm/utils/createCustomWalletClient.d.ts +1 -1
  71. package/dist/esm/utils/getChainContractByAddress.d.ts +1 -1
  72. package/dist/esm/utils/getContract.d.ts +8 -8
  73. package/package.json +5 -4
  74. package/dist/cjs/chains.d.ts +0 -2
  75. package/dist/cjs/chains.js +0 -12
  76. package/dist/esm/chains.d.ts +0 -2
  77. package/dist/esm/chains.js +0 -11
@@ -0,0 +1,197 @@
1
+ /**
2
+ * EIP-2612 ABI extension
3
+ */
4
+ declare const _default: readonly [{
5
+ readonly type: "event";
6
+ readonly name: "Approval";
7
+ readonly inputs: readonly [{
8
+ readonly indexed: true;
9
+ readonly name: "owner";
10
+ readonly type: "address";
11
+ }, {
12
+ readonly indexed: true;
13
+ readonly name: "spender";
14
+ readonly type: "address";
15
+ }, {
16
+ readonly indexed: false;
17
+ readonly name: "value";
18
+ readonly type: "uint256";
19
+ }];
20
+ }, {
21
+ readonly type: "event";
22
+ readonly name: "Transfer";
23
+ readonly inputs: readonly [{
24
+ readonly indexed: true;
25
+ readonly name: "from";
26
+ readonly type: "address";
27
+ }, {
28
+ readonly indexed: true;
29
+ readonly name: "to";
30
+ readonly type: "address";
31
+ }, {
32
+ readonly indexed: false;
33
+ readonly name: "value";
34
+ readonly type: "uint256";
35
+ }];
36
+ }, {
37
+ readonly type: "function";
38
+ readonly name: "allowance";
39
+ readonly stateMutability: "view";
40
+ readonly inputs: readonly [{
41
+ readonly name: "owner";
42
+ readonly type: "address";
43
+ }, {
44
+ readonly name: "spender";
45
+ readonly type: "address";
46
+ }];
47
+ readonly outputs: readonly [{
48
+ readonly type: "uint256";
49
+ }];
50
+ }, {
51
+ readonly type: "function";
52
+ readonly name: "approve";
53
+ readonly stateMutability: "nonpayable";
54
+ readonly inputs: readonly [{
55
+ readonly name: "spender";
56
+ readonly type: "address";
57
+ }, {
58
+ readonly name: "amount";
59
+ readonly type: "uint256";
60
+ }];
61
+ readonly outputs: readonly [{
62
+ readonly type: "bool";
63
+ }];
64
+ }, {
65
+ readonly type: "function";
66
+ readonly name: "balanceOf";
67
+ readonly stateMutability: "view";
68
+ readonly inputs: readonly [{
69
+ readonly name: "account";
70
+ readonly type: "address";
71
+ }];
72
+ readonly outputs: readonly [{
73
+ readonly type: "uint256";
74
+ }];
75
+ }, {
76
+ readonly type: "function";
77
+ readonly name: "decimals";
78
+ readonly stateMutability: "view";
79
+ readonly inputs: readonly [];
80
+ readonly outputs: readonly [{
81
+ readonly type: "uint8";
82
+ }];
83
+ }, {
84
+ readonly type: "function";
85
+ readonly name: "name";
86
+ readonly stateMutability: "view";
87
+ readonly inputs: readonly [];
88
+ readonly outputs: readonly [{
89
+ readonly type: "string";
90
+ }];
91
+ }, {
92
+ readonly type: "function";
93
+ readonly name: "symbol";
94
+ readonly stateMutability: "view";
95
+ readonly inputs: readonly [];
96
+ readonly outputs: readonly [{
97
+ readonly type: "string";
98
+ }];
99
+ }, {
100
+ readonly type: "function";
101
+ readonly name: "totalSupply";
102
+ readonly stateMutability: "view";
103
+ readonly inputs: readonly [];
104
+ readonly outputs: readonly [{
105
+ readonly type: "uint256";
106
+ }];
107
+ }, {
108
+ readonly type: "function";
109
+ readonly name: "transfer";
110
+ readonly stateMutability: "nonpayable";
111
+ readonly inputs: readonly [{
112
+ readonly name: "recipient";
113
+ readonly type: "address";
114
+ }, {
115
+ readonly name: "amount";
116
+ readonly type: "uint256";
117
+ }];
118
+ readonly outputs: readonly [{
119
+ readonly type: "bool";
120
+ }];
121
+ }, {
122
+ readonly type: "function";
123
+ readonly name: "transferFrom";
124
+ readonly stateMutability: "nonpayable";
125
+ readonly inputs: readonly [{
126
+ readonly name: "sender";
127
+ readonly type: "address";
128
+ }, {
129
+ readonly name: "recipient";
130
+ readonly type: "address";
131
+ }, {
132
+ readonly name: "amount";
133
+ readonly type: "uint256";
134
+ }];
135
+ readonly outputs: readonly [{
136
+ readonly type: "bool";
137
+ }];
138
+ }, {
139
+ readonly inputs: readonly [{
140
+ readonly internalType: "address";
141
+ readonly name: "owner";
142
+ readonly type: "address";
143
+ }];
144
+ readonly stateMutability: "view";
145
+ readonly type: "function";
146
+ readonly name: "nonces";
147
+ readonly outputs: readonly [{
148
+ readonly internalType: "uint256";
149
+ readonly name: "";
150
+ readonly type: "uint256";
151
+ }];
152
+ }, {
153
+ readonly inputs: readonly [];
154
+ readonly name: "version";
155
+ readonly outputs: readonly [{
156
+ readonly internalType: "string";
157
+ readonly name: "";
158
+ readonly type: "string";
159
+ }];
160
+ readonly stateMutability: "view";
161
+ readonly type: "function";
162
+ }, {
163
+ readonly inputs: readonly [{
164
+ readonly internalType: "address";
165
+ readonly name: "owner";
166
+ readonly type: "address";
167
+ }, {
168
+ readonly internalType: "address";
169
+ readonly name: "spender";
170
+ readonly type: "address";
171
+ }, {
172
+ readonly internalType: "uint256";
173
+ readonly name: "value";
174
+ readonly type: "uint256";
175
+ }, {
176
+ readonly internalType: "uint256";
177
+ readonly name: "deadline";
178
+ readonly type: "uint256";
179
+ }, {
180
+ readonly internalType: "uint8";
181
+ readonly name: "v";
182
+ readonly type: "uint8";
183
+ }, {
184
+ readonly internalType: "bytes32";
185
+ readonly name: "r";
186
+ readonly type: "bytes32";
187
+ }, {
188
+ readonly internalType: "bytes32";
189
+ readonly name: "s";
190
+ readonly type: "bytes32";
191
+ }];
192
+ readonly name: "permit";
193
+ readonly outputs: readonly [];
194
+ readonly stateMutability: "nonpayable";
195
+ readonly type: "function";
196
+ }];
197
+ export default _default;
@@ -0,0 +1,78 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const viem_1 = require("viem");
4
+ /**
5
+ * EIP-2612 ABI extension
6
+ */
7
+ exports.default = [
8
+ ...viem_1.erc20Abi,
9
+ {
10
+ inputs: [
11
+ {
12
+ internalType: 'address',
13
+ name: 'owner',
14
+ type: 'address',
15
+ },
16
+ ],
17
+ stateMutability: 'view',
18
+ type: 'function',
19
+ name: 'nonces',
20
+ outputs: [
21
+ {
22
+ internalType: 'uint256',
23
+ name: '',
24
+ type: 'uint256',
25
+ },
26
+ ],
27
+ },
28
+ {
29
+ inputs: [],
30
+ name: 'version',
31
+ outputs: [{ internalType: 'string', name: '', type: 'string' }],
32
+ stateMutability: 'view',
33
+ type: 'function',
34
+ },
35
+ {
36
+ inputs: [
37
+ {
38
+ internalType: 'address',
39
+ name: 'owner',
40
+ type: 'address',
41
+ },
42
+ {
43
+ internalType: 'address',
44
+ name: 'spender',
45
+ type: 'address',
46
+ },
47
+ {
48
+ internalType: 'uint256',
49
+ name: 'value',
50
+ type: 'uint256',
51
+ },
52
+ {
53
+ internalType: 'uint256',
54
+ name: 'deadline',
55
+ type: 'uint256',
56
+ },
57
+ {
58
+ internalType: 'uint8',
59
+ name: 'v',
60
+ type: 'uint8',
61
+ },
62
+ {
63
+ internalType: 'bytes32',
64
+ name: 'r',
65
+ type: 'bytes32',
66
+ },
67
+ {
68
+ internalType: 'bytes32',
69
+ name: 's',
70
+ type: 'bytes32',
71
+ },
72
+ ],
73
+ name: 'permit',
74
+ outputs: [],
75
+ stateMutability: 'nonpayable',
76
+ type: 'function',
77
+ },
78
+ ];
@@ -1,14 +1,18 @@
1
1
  import { generateTransferLink } from './generateTransferLink.js';
2
2
  import { getSwapExactInQuote } from './getSwapExactInQuote.js';
3
3
  import { getTokenBalance } from './getTokenBalance.js';
4
+ import { permit } from './permit.js';
5
+ import { signEIP2612Permit } from './signEIP2612Permit.js';
4
6
  import { swapExactIn } from './swapExactIn.js';
5
7
  import { sweep } from './sweep.js';
6
8
  import { transfer } from './transfer.js';
7
- import type { Chain } from '../chains.js';
9
+ import type { Chain } from '../chains/index.js';
8
10
  import type { Account } from '../types.js';
9
11
  import type { GenerateTransferLinkParams } from './generateTransferLink.js';
10
12
  import type { GetSwapExactInQuoteParams } from './getSwapExactInQuote.js';
11
13
  import type { GetTokenBalanceInput } from './getTokenBalance.js';
14
+ import type { PermitParams } from './permit.js';
15
+ import type { SignEIP2612PermitParams } from './signEIP2612Permit.js';
12
16
  import type { SwapExactInParams } from './swapExactIn.js';
13
17
  import type { SweepParams } from './sweep.js';
14
18
  import type { TransferParams } from './transfer.js';
@@ -18,6 +22,7 @@ export * from './sweep.js';
18
22
  export * from './generateTransferLink.js';
19
23
  export * from './getSwapExactInQuote.js';
20
24
  export * from './getTokenBalance.js';
25
+ export * from './permit.js';
21
26
  export * from './swapExactIn.js';
22
27
  export { FEE_LEVEL_WITH_PREPARE } from '../providers/circle-wallets/actions/index.js';
23
28
  export type Actions<transport extends Transport = Transport, chain extends ViemChain | undefined = Chain | undefined, account extends Account | undefined = Account | undefined> = {
@@ -35,6 +40,10 @@ export type Actions<transport extends Transport = Transport, chain extends ViemC
35
40
  getSwapExactInQuote: (params: Parameters<typeof getSwapExactInQuote>[1]) => ReturnType<typeof getSwapExactInQuote>;
36
41
  /** See {@link getTokenBalance} action */
37
42
  getTokenBalance: (params: Parameters<typeof getTokenBalance>[1]) => ReturnType<typeof getTokenBalance>;
43
+ /** See {@link signEIP2612Permit} action */
44
+ signEIP2612Permit: (params: Parameters<typeof signEIP2612Permit>[1]) => ReturnType<typeof signEIP2612Permit>;
45
+ /** See {@link permit} action */
46
+ permit: (params: Parameters<typeof permit>[1]) => ReturnType<typeof permit>;
38
47
  /** See {@link swapExactIn} action */
39
48
  swap: (params: Parameters<typeof swapExactIn>[1]) => ReturnType<typeof swapExactIn>;
40
49
  /** See {@link swapExactIn} action */
@@ -61,6 +70,63 @@ export declare function actions(client: Client): {
61
70
  getSwapExactInQuote: (params: GetSwapExactInQuoteParams) => Promise<import("./getSwapExactInQuote.js").GetSwapExactInQuoteReturnType>;
62
71
  /** See {@link getTokenBalance} action */
63
72
  getTokenBalance: (params: GetTokenBalanceInput) => Promise<import("./getTokenBalance.js").GetTokenBalanceReturnType>;
73
+ /** See {@link signEIP2612Permit} action */
74
+ signEIP2612Permit: (params: SignEIP2612PermitParams) => Promise<{
75
+ typedData: {
76
+ readonly types: {
77
+ readonly EIP712Domain: readonly [{
78
+ readonly name: "name";
79
+ readonly type: "string";
80
+ }, {
81
+ readonly name: "version";
82
+ readonly type: "string";
83
+ }, {
84
+ readonly name: "chainId";
85
+ readonly type: "uint256";
86
+ }, {
87
+ readonly name: "verifyingContract";
88
+ readonly type: "address";
89
+ }];
90
+ readonly Permit: readonly [{
91
+ readonly name: "owner";
92
+ readonly type: "address";
93
+ }, {
94
+ readonly name: "spender";
95
+ readonly type: "address";
96
+ }, {
97
+ readonly name: "value";
98
+ readonly type: "uint256";
99
+ }, {
100
+ readonly name: "nonce";
101
+ readonly type: "uint256";
102
+ }, {
103
+ readonly name: "deadline";
104
+ readonly type: "uint256";
105
+ }];
106
+ };
107
+ readonly primaryType: "Permit";
108
+ readonly domain: {
109
+ readonly name: string;
110
+ readonly version: string;
111
+ readonly chainId: bigint;
112
+ readonly verifyingContract: `0x${string}`;
113
+ };
114
+ readonly message: {
115
+ readonly owner: `0x${string}`;
116
+ readonly spender: `0x${string}`;
117
+ readonly value: bigint;
118
+ readonly nonce: bigint;
119
+ readonly deadline: bigint;
120
+ };
121
+ };
122
+ signature: `0x${string}`;
123
+ r: `0x${string}`;
124
+ s: `0x${string}`;
125
+ yParity: number;
126
+ v: number;
127
+ }>;
128
+ /** See {@link permit} action */
129
+ permit: (params: PermitParams) => Promise<`0x${string}`>;
64
130
  /** See {@link swapExactIn} action */
65
131
  swap: (params: SwapExactInParams) => Promise<`0x${string}`>;
66
132
  /** See {@link swapExactIn} action */
@@ -29,6 +29,8 @@ exports.actions = actions;
29
29
  const generateTransferLink_js_1 = require("./generateTransferLink.js");
30
30
  const getSwapExactInQuote_js_1 = require("./getSwapExactInQuote.js");
31
31
  const getTokenBalance_js_1 = require("./getTokenBalance.js");
32
+ const permit_js_1 = require("./permit.js");
33
+ const signEIP2612Permit_js_1 = require("./signEIP2612Permit.js");
32
34
  const swapExactIn_js_1 = require("./swapExactIn.js");
33
35
  const sweep_js_1 = require("./sweep.js");
34
36
  const transfer_js_1 = require("./transfer.js");
@@ -37,6 +39,7 @@ __exportStar(require("./sweep.js"), exports);
37
39
  __exportStar(require("./generateTransferLink.js"), exports);
38
40
  __exportStar(require("./getSwapExactInQuote.js"), exports);
39
41
  __exportStar(require("./getTokenBalance.js"), exports);
42
+ __exportStar(require("./permit.js"), exports);
40
43
  __exportStar(require("./swapExactIn.js"), exports);
41
44
  var index_js_1 = require("../providers/circle-wallets/actions/index.js");
42
45
  Object.defineProperty(exports, "FEE_LEVEL_WITH_PREPARE", { enumerable: true, get: function () { return index_js_1.FEE_LEVEL_WITH_PREPARE; } });
@@ -62,6 +65,10 @@ function actions(client) {
62
65
  getSwapExactInQuote: (params) => (0, getSwapExactInQuote_js_1.getSwapExactInQuote)(client, params),
63
66
  /** See {@link getTokenBalance} action */
64
67
  getTokenBalance: (params) => (0, getTokenBalance_js_1.getTokenBalance)(client, params),
68
+ /** See {@link signEIP2612Permit} action */
69
+ signEIP2612Permit: (params) => (0, signEIP2612Permit_js_1.signEIP2612Permit)(client, params),
70
+ /** See {@link permit} action */
71
+ permit: (params) => (0, permit_js_1.permit)(client, params),
65
72
  /** See {@link swapExactIn} action */
66
73
  swap: (params) => (0, swapExactIn_js_1.swapExactIn)(client, params),
67
74
  /** See {@link swapExactIn} action */
@@ -38,6 +38,10 @@ vitest_1.describe.concurrent('actions', () => {
38
38
  swapExactIn: vitest_1.expect.any(Function),
39
39
  // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
40
40
  getTokenBalance: vitest_1.expect.any(Function),
41
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
42
+ signEIP2612Permit: vitest_1.expect.any(Function),
43
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
44
+ permit: vitest_1.expect.any(Function),
41
45
  });
42
46
  });
43
47
  });
@@ -0,0 +1,19 @@
1
+ import type { ControlFlowOptions } from '../types.js';
2
+ import type { SignEIP2612PermitParams } from './signEIP2612Permit.js';
3
+ import type { Client, FeeValuesEIP1559, Hash } from 'viem';
4
+ /**
5
+ * Parameters for the {@link permit} function.
6
+ */
7
+ export type PermitParams = SignEIP2612PermitParams & {
8
+ gas?: bigint;
9
+ fees?: FeeValuesEIP1559;
10
+ };
11
+ export type PermitReturnType = Hash;
12
+ /**
13
+ * Signs and executes an EIP-2612 permit
14
+ *
15
+ * @param client - The client instance.
16
+ * @param params - The permit parameters.
17
+ * @returns A transaction hash (`Hash`).
18
+ */
19
+ export declare function permit(client: Client, params: PermitParams & ControlFlowOptions): Promise<`0x${string}`>;
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+ // Copyright (c) 2025, Circle Internet Group, Inc.
3
+ // All rights reserved.
4
+ //
5
+ // Circle Internet Group, Inc. CONFIDENTIAL
6
+ //
7
+ // This file includes unpublished proprietary source code of Circle Internet
8
+ // Group, Inc. The copyright notice above does not
9
+ // evidence any actual or intended publication of such source code. Disclosure
10
+ // of this source code or any related proprietary information is strictly
11
+ // prohibited without the express written permission of Circle Internet Group, Inc.
12
+ var __importDefault = (this && this.__importDefault) || function (mod) {
13
+ return (mod && mod.__esModule) ? mod : { "default": mod };
14
+ };
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.permit = permit;
17
+ const actions_1 = require("viem/actions");
18
+ const utils_1 = require("viem/utils");
19
+ const EIP2612_js_1 = __importDefault(require("../abis/EIP2612.js"));
20
+ const getClient_js_1 = require("../utils/getClient.js");
21
+ const parseAccount_js_1 = require("../utils/parseAccount.js");
22
+ const parseAddress_js_1 = require("../utils/parseAddress.js");
23
+ const signEIP2612Permit_js_1 = require("./signEIP2612Permit.js");
24
+ /**
25
+ * Signs and executes an EIP-2612 permit
26
+ *
27
+ * @param client - The client instance.
28
+ * @param params - The permit parameters.
29
+ * @returns A transaction hash (`Hash`).
30
+ */
31
+ async function permit(client, params) {
32
+ const { token: _token, owner: _owner, chain = client.chain, gas, fees } = params;
33
+ const { address: verifyingContractAddress } = (0, parseAddress_js_1.parseAddress)(_token);
34
+ const ownerAccount = (0, parseAccount_js_1.parseAccount)(_owner, { chain });
35
+ const _client = (0, getClient_js_1.getClient)(client, chain);
36
+ const simulateContract = (0, utils_1.getAction)(_client, actions_1.simulateContract, 'simulateContract');
37
+ const writeContract = (0, utils_1.getAction)(_client, actions_1.writeContract, 'writeContract');
38
+ const result = await (0, signEIP2612Permit_js_1.signEIP2612Permit)(_client, params);
39
+ const { typedData: { message }, v, r, s, } = result;
40
+ const { request } = await simulateContract({
41
+ address: verifyingContractAddress,
42
+ abi: EIP2612_js_1.default,
43
+ functionName: 'permit',
44
+ args: [message.owner, message.spender, message.value, message.deadline, v, r, s],
45
+ account: ownerAccount,
46
+ gas,
47
+ ...fees,
48
+ });
49
+ return await writeContract({ ...request, chain });
50
+ }
@@ -0,0 +1 @@
1
+ export {};