@circle-fin/usdckit 0.22.0 → 0.23.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/dist/cjs/abis/EIP2612.d.ts +197 -0
- package/dist/cjs/abis/EIP2612.js +78 -0
- package/dist/cjs/actions/index.d.ts +66 -0
- package/dist/cjs/actions/index.js +7 -0
- package/dist/cjs/actions/index.test.js +4 -0
- package/dist/cjs/actions/permit.d.ts +19 -0
- package/dist/cjs/actions/permit.js +50 -0
- package/dist/cjs/actions/permit.test.d.ts +1 -0
- package/dist/cjs/actions/permit.test.js +652 -0
- package/dist/cjs/actions/signEIP2612Permit.d.ts +130 -0
- package/dist/cjs/actions/signEIP2612Permit.js +128 -0
- package/dist/cjs/actions/signEIP2612Permit.test.d.ts +1 -0
- package/dist/cjs/actions/signEIP2612Permit.test.js +434 -0
- package/dist/cjs/chains/ARC_TESTNET.d.ts +180 -0
- package/dist/cjs/chains/ARC_TESTNET.js +57 -0
- package/dist/cjs/chains/index.d.ts +1 -0
- package/dist/cjs/chains/index.js +3 -1
- package/dist/cjs/chains/index.test.js +1 -0
- package/dist/cjs/extractChain.d.ts +179 -0
- package/dist/cjs/extractChain.test.js +1 -0
- package/dist/cjs/metadata.js +1 -1
- package/dist/cjs/providers/circle-wallets/actions/createAccount.d.ts +179 -0
- package/dist/cjs/providers/circle-wallets/actions/createAccount.js +3 -0
- package/dist/cjs/providers/circle-wallets/actions/estimateContractExecutionFee.d.ts +6 -0
- package/dist/cjs/providers/circle-wallets/actions/estimateTransferFee.d.ts +6 -0
- package/dist/cjs/providers/circle-wallets/actions/getAccounts.d.ts +179 -0
- package/dist/cjs/providers/circle-wallets/index.d.ts +358 -0
- package/dist/cjs/providers/circle-wallets/index.js +2 -0
- package/dist/cjs/providers/circle-wallets/transports/index.d.ts +12 -0
- package/dist/esm/abis/EIP2612.d.ts +197 -0
- package/dist/esm/abis/EIP2612.js +76 -0
- package/dist/esm/actions/index.d.ts +66 -0
- package/dist/esm/actions/index.js +7 -0
- package/dist/esm/actions/index.test.js +4 -0
- package/dist/esm/actions/permit.d.ts +19 -0
- package/dist/esm/actions/permit.js +44 -0
- package/dist/esm/actions/permit.test.d.ts +1 -0
- package/dist/esm/actions/permit.test.js +650 -0
- package/dist/esm/actions/signEIP2612Permit.d.ts +130 -0
- package/dist/esm/actions/signEIP2612Permit.js +122 -0
- package/dist/esm/actions/signEIP2612Permit.test.d.ts +1 -0
- package/dist/esm/actions/signEIP2612Permit.test.js +432 -0
- package/dist/esm/chains/ARC_TESTNET.d.ts +180 -0
- package/dist/esm/chains/ARC_TESTNET.js +54 -0
- package/dist/esm/chains/index.d.ts +1 -0
- package/dist/esm/chains/index.js +1 -0
- package/dist/esm/chains/index.test.js +1 -0
- package/dist/esm/extractChain.d.ts +179 -0
- package/dist/esm/extractChain.test.js +2 -1
- package/dist/esm/metadata.js +1 -1
- package/dist/esm/providers/circle-wallets/actions/createAccount.d.ts +179 -0
- package/dist/esm/providers/circle-wallets/actions/createAccount.js +3 -0
- package/dist/esm/providers/circle-wallets/actions/estimateContractExecutionFee.d.ts +6 -0
- package/dist/esm/providers/circle-wallets/actions/estimateTransferFee.d.ts +6 -0
- package/dist/esm/providers/circle-wallets/actions/getAccounts.d.ts +179 -0
- package/dist/esm/providers/circle-wallets/index.d.ts +358 -0
- package/dist/esm/providers/circle-wallets/index.js +3 -1
- package/dist/esm/providers/circle-wallets/transports/index.d.ts +12 -0
- package/package.json +5 -4
|
@@ -0,0 +1,434 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
const viem_1 = require("viem");
|
|
14
|
+
const vitest_1 = require("vitest");
|
|
15
|
+
// Create mock functions using vi.hoisted() to handle hoisting properly
|
|
16
|
+
const mockGetContract = vitest_1.vi.hoisted(() => vitest_1.vi.fn());
|
|
17
|
+
const mockSignTypedData = vitest_1.vi.hoisted(() => vitest_1.vi.fn());
|
|
18
|
+
const mockGetAction = vitest_1.vi.hoisted(() => vitest_1.vi.fn());
|
|
19
|
+
const index_js_1 = require("../chains/index.js");
|
|
20
|
+
const signEIP2612Permit_js_1 = require("./signEIP2612Permit.js");
|
|
21
|
+
// Mock viem with factory function
|
|
22
|
+
vitest_1.vi.mock('viem', async (importOriginal) => {
|
|
23
|
+
return {
|
|
24
|
+
...(await importOriginal()),
|
|
25
|
+
getContract: mockGetContract,
|
|
26
|
+
};
|
|
27
|
+
});
|
|
28
|
+
// Mock viem/actions
|
|
29
|
+
vitest_1.vi.mock('viem/actions', async (importOriginal) => {
|
|
30
|
+
return {
|
|
31
|
+
...(await importOriginal()),
|
|
32
|
+
signTypedData: mockSignTypedData,
|
|
33
|
+
};
|
|
34
|
+
});
|
|
35
|
+
// Mock viem/utils
|
|
36
|
+
vitest_1.vi.mock('viem/utils', async (importOriginal) => {
|
|
37
|
+
return {
|
|
38
|
+
...(await importOriginal()),
|
|
39
|
+
getAction: mockGetAction,
|
|
40
|
+
};
|
|
41
|
+
});
|
|
42
|
+
vitest_1.describe.concurrent('signEIP2612Permit', () => {
|
|
43
|
+
const mockClient = {
|
|
44
|
+
chain: index_js_1.ETH_SEPOLIA,
|
|
45
|
+
};
|
|
46
|
+
const mockContract = {
|
|
47
|
+
address: '0xA0b86a33E6411E4C3c04E5b72c5F3E6b2A6E1C3D',
|
|
48
|
+
read: {
|
|
49
|
+
name: vitest_1.vi.fn(),
|
|
50
|
+
version: vitest_1.vi.fn(),
|
|
51
|
+
nonces: vitest_1.vi.fn(),
|
|
52
|
+
decimals: vitest_1.vi.fn(),
|
|
53
|
+
},
|
|
54
|
+
};
|
|
55
|
+
(0, vitest_1.beforeEach)(() => {
|
|
56
|
+
vitest_1.vi.clearAllMocks();
|
|
57
|
+
// Setup default mocks
|
|
58
|
+
mockGetContract.mockReturnValue(mockContract);
|
|
59
|
+
mockGetAction.mockReturnValue(mockSignTypedData);
|
|
60
|
+
// Mock contract calls
|
|
61
|
+
mockContract.read.name.mockResolvedValue('USD Coin');
|
|
62
|
+
mockContract.read.version.mockResolvedValue('2');
|
|
63
|
+
mockContract.read.nonces.mockResolvedValue(0n);
|
|
64
|
+
mockContract.read.decimals.mockResolvedValue(6);
|
|
65
|
+
mockSignTypedData.mockResolvedValue('0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1b');
|
|
66
|
+
});
|
|
67
|
+
(0, vitest_1.test)('should be defined and be a function', () => {
|
|
68
|
+
(0, vitest_1.expect)(typeof signEIP2612Permit_js_1.signEIP2612Permit).toBe('function');
|
|
69
|
+
});
|
|
70
|
+
(0, vitest_1.test)('should create permit with basic parameters', async () => {
|
|
71
|
+
const params = {
|
|
72
|
+
token: '0xA0b86a33E6411E4C3c04E5b72c5F3E6b2A6E1C3D',
|
|
73
|
+
owner: '0x742d35Cc6634C0532925a3b8D40745c5F5d78F6e',
|
|
74
|
+
spender: '0x8ba1f109551bD432803012645Hac136c22C57B9',
|
|
75
|
+
value: '1.0',
|
|
76
|
+
};
|
|
77
|
+
const result = await (0, signEIP2612Permit_js_1.signEIP2612Permit)(mockClient, params);
|
|
78
|
+
(0, vitest_1.expect)(result.typedData).toEqual({
|
|
79
|
+
types: {
|
|
80
|
+
EIP712Domain: [
|
|
81
|
+
{ name: 'name', type: 'string' },
|
|
82
|
+
{ name: 'version', type: 'string' },
|
|
83
|
+
{ name: 'chainId', type: 'uint256' },
|
|
84
|
+
{ name: 'verifyingContract', type: 'address' },
|
|
85
|
+
],
|
|
86
|
+
Permit: [
|
|
87
|
+
{ name: 'owner', type: 'address' },
|
|
88
|
+
{ name: 'spender', type: 'address' },
|
|
89
|
+
{ name: 'value', type: 'uint256' },
|
|
90
|
+
{ name: 'nonce', type: 'uint256' },
|
|
91
|
+
{ name: 'deadline', type: 'uint256' },
|
|
92
|
+
],
|
|
93
|
+
},
|
|
94
|
+
primaryType: 'Permit',
|
|
95
|
+
domain: {
|
|
96
|
+
name: 'USD Coin',
|
|
97
|
+
version: '2',
|
|
98
|
+
chainId: BigInt(index_js_1.ETH_SEPOLIA.id),
|
|
99
|
+
verifyingContract: mockContract.address,
|
|
100
|
+
},
|
|
101
|
+
message: {
|
|
102
|
+
owner: '0x742d35Cc6634C0532925a3b8D40745c5F5d78F6e',
|
|
103
|
+
spender: '0x8ba1f109551bD432803012645Hac136c22C57B9',
|
|
104
|
+
value: 1000000n,
|
|
105
|
+
nonce: 0n,
|
|
106
|
+
deadline: viem_1.maxUint256,
|
|
107
|
+
},
|
|
108
|
+
});
|
|
109
|
+
(0, vitest_1.expect)(result.signature).toBe('0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1b');
|
|
110
|
+
(0, vitest_1.expect)(result.v).toBe(27);
|
|
111
|
+
(0, vitest_1.expect)(result.yParity).toBe(0);
|
|
112
|
+
(0, vitest_1.expect)(result.r).toBe('0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef');
|
|
113
|
+
(0, vitest_1.expect)(result.s).toBe('0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef');
|
|
114
|
+
});
|
|
115
|
+
(0, vitest_1.test)('should handle token as contract object', async () => {
|
|
116
|
+
const params = {
|
|
117
|
+
token: { address: '0xA0b86a33E6411E4C3c04E5b72c5F3E6b2A6E1C3D' },
|
|
118
|
+
owner: '0x742d35Cc6634C0532925a3b8D40745c5F5d78F6e',
|
|
119
|
+
spender: '0x8ba1f109551bD432803012645Hac136c22C57B9',
|
|
120
|
+
value: '1.0',
|
|
121
|
+
};
|
|
122
|
+
const result = await (0, signEIP2612Permit_js_1.signEIP2612Permit)(mockClient, params);
|
|
123
|
+
(0, vitest_1.expect)(result.typedData.domain.verifyingContract).toBe('0xA0b86a33E6411E4C3c04E5b72c5F3E6b2A6E1C3D');
|
|
124
|
+
});
|
|
125
|
+
(0, vitest_1.test)('should handle BaseUnits (bigint) value', async () => {
|
|
126
|
+
const params = {
|
|
127
|
+
token: '0xA0b86a33E6411E4C3c04E5b72c5F3E6b2A6E1C3D',
|
|
128
|
+
owner: '0x742d35Cc6634C0532925a3b8D40745c5F5d78F6e',
|
|
129
|
+
spender: '0x8ba1f109551bD432803012645Hac136c22C57B9',
|
|
130
|
+
value: 1000000n,
|
|
131
|
+
};
|
|
132
|
+
const result = await (0, signEIP2612Permit_js_1.signEIP2612Permit)(mockClient, params);
|
|
133
|
+
(0, vitest_1.expect)(result.typedData.message.value).toBe(1000000n); // Should pass through unchanged for bigint
|
|
134
|
+
});
|
|
135
|
+
(0, vitest_1.test)('should handle address strings for owner and spender', async () => {
|
|
136
|
+
const ownerAccount = '0x742d35Cc6634C0532925a3b8D40745c5F5d78F6e';
|
|
137
|
+
const spenderAccount = '0x8ba1f109551bD432803012645Hac136c22C57B9';
|
|
138
|
+
const params = {
|
|
139
|
+
token: '0xA0b86a33E6411E4C3c04E5b72c5F3E6b2A6E1C3D',
|
|
140
|
+
owner: ownerAccount,
|
|
141
|
+
spender: spenderAccount,
|
|
142
|
+
value: '1.0',
|
|
143
|
+
};
|
|
144
|
+
const result = await (0, signEIP2612Permit_js_1.signEIP2612Permit)(mockClient, params);
|
|
145
|
+
(0, vitest_1.expect)(result.typedData.message.owner).toBe(ownerAccount);
|
|
146
|
+
(0, vitest_1.expect)(result.typedData.message.spender).toBe(spenderAccount);
|
|
147
|
+
});
|
|
148
|
+
(0, vitest_1.test)('should use custom deadline when provided', async () => {
|
|
149
|
+
const customDeadline = BigInt(Math.floor(Date.now() / 1000) + 3600);
|
|
150
|
+
const params = {
|
|
151
|
+
token: '0xA0b86a33E6411E4C3c04E5b72c5F3E6b2A6E1C3D',
|
|
152
|
+
owner: '0x742d35Cc6634C0532925a3b8D40745c5F5d78F6e',
|
|
153
|
+
spender: '0x8ba1f109551bD432803012645Hac136c22C57B9',
|
|
154
|
+
value: '1.0',
|
|
155
|
+
deadline: customDeadline,
|
|
156
|
+
};
|
|
157
|
+
const result = await (0, signEIP2612Permit_js_1.signEIP2612Permit)(mockClient, params);
|
|
158
|
+
(0, vitest_1.expect)(result.typedData.message.deadline).toBe(customDeadline);
|
|
159
|
+
});
|
|
160
|
+
(0, vitest_1.test)('should use maxUint256 as default deadline', async () => {
|
|
161
|
+
const params = {
|
|
162
|
+
token: '0xA0b86a33E6411E4C3c04E5b72c5F3E6b2A6E1C3D',
|
|
163
|
+
owner: '0x742d35Cc6634C0532925a3b8D40745c5F5d78F6e',
|
|
164
|
+
spender: '0x8ba1f109551bD432803012645Hac136c22C57B9',
|
|
165
|
+
value: '1.0',
|
|
166
|
+
};
|
|
167
|
+
const result = await (0, signEIP2612Permit_js_1.signEIP2612Permit)(mockClient, params);
|
|
168
|
+
(0, vitest_1.expect)(result.typedData.message.deadline).toBe(viem_1.maxUint256);
|
|
169
|
+
});
|
|
170
|
+
(0, vitest_1.test)('should use custom chain when provided', async () => {
|
|
171
|
+
const customChain = index_js_1.ETH_SEPOLIA;
|
|
172
|
+
const params = {
|
|
173
|
+
token: '0xA0b86a33E6411E4C3c04E5b72c5F3E6b2A6E1C3D',
|
|
174
|
+
owner: '0x742d35Cc6634C0532925a3b8D40745c5F5d78F6e',
|
|
175
|
+
spender: '0x8ba1f109551bD432803012645Hac136c22C57B9',
|
|
176
|
+
value: '1.0',
|
|
177
|
+
chain: customChain,
|
|
178
|
+
};
|
|
179
|
+
const result = await (0, signEIP2612Permit_js_1.signEIP2612Permit)(mockClient, params);
|
|
180
|
+
(0, vitest_1.expect)(result.typedData.domain.chainId).toBe(BigInt(customChain.id));
|
|
181
|
+
});
|
|
182
|
+
(0, vitest_1.test)('should construct correct EIP-712 typed data', async () => {
|
|
183
|
+
const params = {
|
|
184
|
+
token: '0xA0b86a33E6411E4C3c04E5b72c5F3E6b2A6E1C3D',
|
|
185
|
+
owner: '0x742d35Cc6634C0532925a3b8D40745c5F5d78F6e',
|
|
186
|
+
spender: '0x8ba1f109551bD432803012645Hac136c22C57B9',
|
|
187
|
+
value: '1.0',
|
|
188
|
+
};
|
|
189
|
+
const result = await (0, signEIP2612Permit_js_1.signEIP2612Permit)(mockClient, params);
|
|
190
|
+
(0, vitest_1.expect)(result.typedData.primaryType).toBe('Permit');
|
|
191
|
+
(0, vitest_1.expect)(result.typedData.domain).toEqual({
|
|
192
|
+
name: 'USD Coin',
|
|
193
|
+
version: '2',
|
|
194
|
+
chainId: BigInt(index_js_1.ETH_SEPOLIA.id),
|
|
195
|
+
verifyingContract: mockContract.address,
|
|
196
|
+
});
|
|
197
|
+
(0, vitest_1.expect)(result.typedData.message).toEqual({
|
|
198
|
+
owner: params.owner,
|
|
199
|
+
spender: params.spender,
|
|
200
|
+
value: 1000000n,
|
|
201
|
+
nonce: 0n,
|
|
202
|
+
deadline: viem_1.maxUint256,
|
|
203
|
+
});
|
|
204
|
+
});
|
|
205
|
+
(0, vitest_1.test)('should fetch contract metadata', async () => {
|
|
206
|
+
const params = {
|
|
207
|
+
token: '0xA0b86a33E6411E4C3c04E5b72c5F3E6b2A6E1C3D',
|
|
208
|
+
owner: '0x742d35Cc6634C0532925a3b8D40745c5F5d78F6e',
|
|
209
|
+
spender: '0x8ba1f109551bD432803012645Hac136c22C57B9',
|
|
210
|
+
value: '1.0',
|
|
211
|
+
};
|
|
212
|
+
await (0, signEIP2612Permit_js_1.signEIP2612Permit)(mockClient, params);
|
|
213
|
+
(0, vitest_1.expect)(mockContract.read.name).toHaveBeenCalled();
|
|
214
|
+
(0, vitest_1.expect)(mockContract.read.version).toHaveBeenCalled();
|
|
215
|
+
(0, vitest_1.expect)(mockContract.read.nonces).toHaveBeenCalledWith([params.owner]);
|
|
216
|
+
(0, vitest_1.expect)(mockContract.read.decimals).toHaveBeenCalled();
|
|
217
|
+
});
|
|
218
|
+
(0, vitest_1.test)('should call signTypedData with correct params', async () => {
|
|
219
|
+
const params = {
|
|
220
|
+
token: '0xA0b86a33E6411E4C3c04E5b72c5F3E6b2A6E1C3D',
|
|
221
|
+
owner: '0x742d35Cc6634C0532925a3b8D40745c5F5d78F6e',
|
|
222
|
+
spender: '0x8ba1f109551bD432803012645Hac136c22C57B9',
|
|
223
|
+
value: '1.0',
|
|
224
|
+
};
|
|
225
|
+
await (0, signEIP2612Permit_js_1.signEIP2612Permit)(mockClient, params);
|
|
226
|
+
(0, vitest_1.expect)(mockSignTypedData).toHaveBeenCalledTimes(1);
|
|
227
|
+
const callArgs = mockSignTypedData.mock.calls[0];
|
|
228
|
+
const signedData = callArgs[0];
|
|
229
|
+
(0, vitest_1.expect)(signedData.account.address).toBe(params.owner);
|
|
230
|
+
(0, vitest_1.expect)(signedData.primaryType).toBe('Permit');
|
|
231
|
+
(0, vitest_1.expect)(signedData.message).toEqual({
|
|
232
|
+
owner: params.owner,
|
|
233
|
+
spender: params.spender,
|
|
234
|
+
value: 1000000n, // 1.0 with 6 decimals
|
|
235
|
+
nonce: 0n,
|
|
236
|
+
deadline: viem_1.maxUint256,
|
|
237
|
+
});
|
|
238
|
+
});
|
|
239
|
+
(0, vitest_1.test)('should handle different token decimals', async () => {
|
|
240
|
+
const params = {
|
|
241
|
+
token: '0xA0b86a33E6411E4C3c04E5b72c5F3E6b2A6E1C3D',
|
|
242
|
+
owner: '0x742d35Cc6634C0532925a3b8D40745c5F5d78F6e',
|
|
243
|
+
spender: '0x8ba1f109551bD432803012645Hac136c22C57B9',
|
|
244
|
+
value: '1.0',
|
|
245
|
+
};
|
|
246
|
+
// Override contract decimals for this test
|
|
247
|
+
mockContract.read.decimals.mockResolvedValue(18);
|
|
248
|
+
const result = await (0, signEIP2612Permit_js_1.signEIP2612Permit)(mockClient, params);
|
|
249
|
+
// With 18 decimals, '1.0' should be converted to 1000000000000000000n
|
|
250
|
+
(0, vitest_1.expect)(result.typedData.message.value).toBe(1000000000000000000n);
|
|
251
|
+
});
|
|
252
|
+
(0, vitest_1.test)('should fetch and use nonce from contract', async () => {
|
|
253
|
+
const params = {
|
|
254
|
+
token: '0xA0b86a33E6411E4C3c04E5b72c5F3E6b2A6E1C3D',
|
|
255
|
+
owner: '0x742d35Cc6634C0532925a3b8D40745c5F5d78F6e',
|
|
256
|
+
spender: '0x8ba1f109551bD432803012645Hac136c22C57B9',
|
|
257
|
+
value: '1.0',
|
|
258
|
+
};
|
|
259
|
+
const result = await (0, signEIP2612Permit_js_1.signEIP2612Permit)(mockClient, params);
|
|
260
|
+
(0, vitest_1.expect)(mockContract.read.nonces).toHaveBeenCalledWith([params.owner]);
|
|
261
|
+
(0, vitest_1.expect)(result.typedData.message.nonce).toBe(0n); // Default mock value
|
|
262
|
+
});
|
|
263
|
+
(0, vitest_1.test)('should handle different contract metadata', async () => {
|
|
264
|
+
const params = {
|
|
265
|
+
token: '0xA0b86a33E6411E4C3c04E5b72c5F3E6b2A6E1C3D',
|
|
266
|
+
owner: '0x742d35Cc6634C0532925a3b8D40745c5F5d78F6e',
|
|
267
|
+
spender: '0x8ba1f109551bD432803012645Hac136c22C57B9',
|
|
268
|
+
value: '1.0',
|
|
269
|
+
};
|
|
270
|
+
const result = await (0, signEIP2612Permit_js_1.signEIP2612Permit)(mockClient, params);
|
|
271
|
+
// Verify the result contains the expected domain values from our mocks
|
|
272
|
+
(0, vitest_1.expect)(result.typedData.domain.name).toBe('USD Coin'); // Default mock value
|
|
273
|
+
(0, vitest_1.expect)(result.typedData.domain.version).toBe('2'); // Default mock value
|
|
274
|
+
});
|
|
275
|
+
(0, vitest_1.test)('should handle zero value permits', async () => {
|
|
276
|
+
const zeroParams = {
|
|
277
|
+
token: '0xA0b86a33E6411E4C3c04E5b72c5F3E6b2A6E1C3D',
|
|
278
|
+
owner: '0x742d35Cc6634C0532925a3b8D40745c5F5d78F6e',
|
|
279
|
+
spender: '0x8ba1f109551bD432803012645Hac136c22C57B9',
|
|
280
|
+
value: '0',
|
|
281
|
+
};
|
|
282
|
+
const result = await (0, signEIP2612Permit_js_1.signEIP2612Permit)(mockClient, zeroParams);
|
|
283
|
+
// With 6 decimals, '0' should be converted to 0n
|
|
284
|
+
(0, vitest_1.expect)(result.typedData.message.value).toBe(0n);
|
|
285
|
+
});
|
|
286
|
+
(0, vitest_1.describe)('yParity and v conversion logic', () => {
|
|
287
|
+
(0, vitest_1.test)('should parse signature and return v/yParity values', async () => {
|
|
288
|
+
mockSignTypedData.mockResolvedValue('0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1c');
|
|
289
|
+
const params = {
|
|
290
|
+
token: '0xA0b86a33E6411E4C3c04E5b72c5F3E6b2A6E1C3D',
|
|
291
|
+
owner: '0x742d35Cc6634C0532925a3b8D40745c5F5d78F6e',
|
|
292
|
+
spender: '0x8ba1f109551bD432803012645Hac136c22C57B9',
|
|
293
|
+
value: '1.0',
|
|
294
|
+
};
|
|
295
|
+
const result = await (0, signEIP2612Permit_js_1.signEIP2612Permit)(mockClient, params);
|
|
296
|
+
(0, vitest_1.expect)(result.v).toBe(27);
|
|
297
|
+
(0, vitest_1.expect)(result.yParity).toBe(0);
|
|
298
|
+
(0, vitest_1.expect)(result.r).toBe('0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef');
|
|
299
|
+
(0, vitest_1.expect)(result.s).toBe('0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef');
|
|
300
|
+
});
|
|
301
|
+
});
|
|
302
|
+
(0, vitest_1.describe)('edge cases and error scenarios', () => {
|
|
303
|
+
(0, vitest_1.test)('should handle custom name parameter', async () => {
|
|
304
|
+
vitest_1.vi.clearAllMocks();
|
|
305
|
+
mockGetContract.mockReturnValue(mockContract);
|
|
306
|
+
mockGetAction.mockReturnValue(mockSignTypedData);
|
|
307
|
+
mockContract.read.version.mockResolvedValue('2');
|
|
308
|
+
mockContract.read.nonces.mockResolvedValue(0n);
|
|
309
|
+
mockContract.read.decimals.mockResolvedValue(6);
|
|
310
|
+
mockSignTypedData.mockResolvedValue('0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1b');
|
|
311
|
+
const params = {
|
|
312
|
+
token: '0xA0b86a33E6411E4C3c04E5b72c5F3E6b2A6E1C3D',
|
|
313
|
+
owner: '0x742d35Cc6634C0532925a3b8D40745c5F5d78F6e',
|
|
314
|
+
spender: '0x8ba1f109551bD432803012645Hac136c22C57B9',
|
|
315
|
+
value: '1.0',
|
|
316
|
+
name: 'Custom Token Name',
|
|
317
|
+
};
|
|
318
|
+
const result = await (0, signEIP2612Permit_js_1.signEIP2612Permit)(mockClient, params);
|
|
319
|
+
// Should use custom name provided in params
|
|
320
|
+
(0, vitest_1.expect)(result.typedData.domain.name).toBe('Custom Token Name');
|
|
321
|
+
});
|
|
322
|
+
(0, vitest_1.test)('should handle custom version parameter', async () => {
|
|
323
|
+
vitest_1.vi.clearAllMocks();
|
|
324
|
+
mockGetContract.mockReturnValue(mockContract);
|
|
325
|
+
mockGetAction.mockReturnValue(mockSignTypedData);
|
|
326
|
+
mockContract.read.name.mockResolvedValue('USD Coin');
|
|
327
|
+
mockContract.read.nonces.mockResolvedValue(0n);
|
|
328
|
+
mockContract.read.decimals.mockResolvedValue(6);
|
|
329
|
+
mockSignTypedData.mockResolvedValue('0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1b');
|
|
330
|
+
const params = {
|
|
331
|
+
token: '0xA0b86a33E6411E4C3c04E5b72c5F3E6b2A6E1C3D',
|
|
332
|
+
owner: '0x742d35Cc6634C0532925a3b8D40745c5F5d78F6e',
|
|
333
|
+
spender: '0x8ba1f109551bD432803012645Hac136c22C57B9',
|
|
334
|
+
value: '1.0',
|
|
335
|
+
version: '3',
|
|
336
|
+
};
|
|
337
|
+
const result = await (0, signEIP2612Permit_js_1.signEIP2612Permit)(mockClient, params);
|
|
338
|
+
// Should use custom version provided in params
|
|
339
|
+
(0, vitest_1.expect)(result.typedData.domain.version).toBe('3');
|
|
340
|
+
});
|
|
341
|
+
(0, vitest_1.test)('should handle both custom name and version', async () => {
|
|
342
|
+
vitest_1.vi.restoreAllMocks();
|
|
343
|
+
mockGetContract.mockReturnValue(mockContract);
|
|
344
|
+
mockGetAction.mockReturnValue(mockSignTypedData);
|
|
345
|
+
mockContract.read.nonces.mockResolvedValue(0n);
|
|
346
|
+
mockContract.read.decimals.mockResolvedValue(6);
|
|
347
|
+
mockSignTypedData.mockResolvedValue('0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1b');
|
|
348
|
+
const params = {
|
|
349
|
+
token: '0xA0b86a33E6411E4C3c04E5b72c5F3E6b2A6E1C3D',
|
|
350
|
+
owner: '0x742d35Cc6634C0532925a3b8D40745c5F5d78F6e',
|
|
351
|
+
spender: '0x8ba1f109551bD432803012645Hac136c22C57B9',
|
|
352
|
+
value: '1.0',
|
|
353
|
+
name: 'Custom Token',
|
|
354
|
+
version: '4',
|
|
355
|
+
};
|
|
356
|
+
const result = await (0, signEIP2612Permit_js_1.signEIP2612Permit)(mockClient, params);
|
|
357
|
+
// Should use both custom values provided in params
|
|
358
|
+
(0, vitest_1.expect)(result.typedData.domain.name).toBe('Custom Token');
|
|
359
|
+
(0, vitest_1.expect)(result.typedData.domain.version).toBe('4');
|
|
360
|
+
});
|
|
361
|
+
(0, vitest_1.test)('should fallback to version "1" when contract.version() throws', async () => {
|
|
362
|
+
// Mock version call to throw an error
|
|
363
|
+
mockContract.read.version.mockRejectedValue(new Error('Version not supported'));
|
|
364
|
+
const params = {
|
|
365
|
+
token: '0xA0b86a33E6411E4C3c04E5b72c5F3E6b2A6E1C3D',
|
|
366
|
+
owner: '0x742d35Cc6634C0532925a3b8D40745c5F5d78F6e',
|
|
367
|
+
spender: '0x8ba1f109551bD432803012645Hac136c22C57B9',
|
|
368
|
+
value: '1.0',
|
|
369
|
+
};
|
|
370
|
+
const result = await (0, signEIP2612Permit_js_1.signEIP2612Permit)(mockClient, params);
|
|
371
|
+
(0, vitest_1.expect)(result.typedData.domain.version).toBe('1');
|
|
372
|
+
});
|
|
373
|
+
(0, vitest_1.test)('should handle maximum safe integer values', async () => {
|
|
374
|
+
const params = {
|
|
375
|
+
token: '0xA0b86a33E6411E4C3c04E5b72c5F3E6b2A6E1C3D',
|
|
376
|
+
owner: '0x742d35Cc6634C0532925a3b8D40745c5F5d78F6e',
|
|
377
|
+
spender: '0x8ba1f109551bD432803012645Hac136c22C57B9',
|
|
378
|
+
value: Number.MAX_SAFE_INTEGER.toString(),
|
|
379
|
+
};
|
|
380
|
+
const result = await (0, signEIP2612Permit_js_1.signEIP2612Permit)(mockClient, params);
|
|
381
|
+
// Should handle large numbers correctly
|
|
382
|
+
(0, vitest_1.expect)(result.typedData.message.value).toBe(BigInt(Number.MAX_SAFE_INTEGER) * BigInt(1000000));
|
|
383
|
+
});
|
|
384
|
+
(0, vitest_1.test)('should handle custom deadline values', async () => {
|
|
385
|
+
const customDeadline = 1n;
|
|
386
|
+
const params = {
|
|
387
|
+
token: '0xA0b86a33E6411E4C3c04E5b72c5F3E6b2A6E1C3D',
|
|
388
|
+
owner: '0x742d35Cc6634C0532925a3b8D40745c5F5d78F6e',
|
|
389
|
+
spender: '0x8ba1f109551bD432803012645Hac136c22C57B9',
|
|
390
|
+
value: '1.0',
|
|
391
|
+
deadline: customDeadline,
|
|
392
|
+
};
|
|
393
|
+
const result = await (0, signEIP2612Permit_js_1.signEIP2612Permit)(mockClient, params);
|
|
394
|
+
(0, vitest_1.expect)(result.typedData.message.deadline).toBe(customDeadline);
|
|
395
|
+
});
|
|
396
|
+
(0, vitest_1.test)('should handle tokens with very high decimals', async () => {
|
|
397
|
+
const highDecimals = 30;
|
|
398
|
+
mockContract.read.decimals.mockResolvedValue(highDecimals);
|
|
399
|
+
const params = {
|
|
400
|
+
token: '0xA0b86a33E6411E4C3c04E5b72c5F3E6b2A6E1C3D',
|
|
401
|
+
owner: '0x742d35Cc6634C0532925a3b8D40745c5F5d78F6e',
|
|
402
|
+
spender: '0x8ba1f109551bD432803012645Hac136c22C57B9',
|
|
403
|
+
value: '1.0',
|
|
404
|
+
};
|
|
405
|
+
const result = await (0, signEIP2612Permit_js_1.signEIP2612Permit)(mockClient, params);
|
|
406
|
+
// 1.0 with 30 decimals should be 10^30
|
|
407
|
+
const expectedValue = BigInt('1000000000000000000000000000000');
|
|
408
|
+
(0, vitest_1.expect)(result.typedData.message.value).toBe(expectedValue);
|
|
409
|
+
});
|
|
410
|
+
(0, vitest_1.test)('should handle tokens with zero decimals', async () => {
|
|
411
|
+
mockContract.read.decimals.mockResolvedValue(0);
|
|
412
|
+
const params = {
|
|
413
|
+
token: '0xA0b86a33E6411E4C3c04E5b72c5F3E6b2A6E1C3D',
|
|
414
|
+
owner: '0x742d35Cc6634C0532925a3b8D40745c5F5d78F6e',
|
|
415
|
+
spender: '0x8ba1f109551bD432803012645Hac136c22C57B9',
|
|
416
|
+
value: '123',
|
|
417
|
+
};
|
|
418
|
+
const result = await (0, signEIP2612Permit_js_1.signEIP2612Permit)(mockClient, params);
|
|
419
|
+
// With 0 decimals, '123' should remain 123n
|
|
420
|
+
(0, vitest_1.expect)(result.typedData.message.value).toBe(123n);
|
|
421
|
+
});
|
|
422
|
+
(0, vitest_1.test)('should handle fractional values with high precision', async () => {
|
|
423
|
+
mockContract.read.decimals.mockResolvedValue(18);
|
|
424
|
+
const params = {
|
|
425
|
+
token: '0xA0b86a33E6411E4C3c04E5b72c5F3E6b2A6E1C3D',
|
|
426
|
+
owner: '0x742d35Cc6634C0532925a3b8D40745c5F5d78F6e',
|
|
427
|
+
spender: '0x8ba1f109551bD432803012645Hac136c22C57B9',
|
|
428
|
+
value: '0.000000000000000001', // 1 wei
|
|
429
|
+
};
|
|
430
|
+
const result = await (0, signEIP2612Permit_js_1.signEIP2612Permit)(mockClient, params);
|
|
431
|
+
(0, vitest_1.expect)(result.typedData.message.value).toBe(1n);
|
|
432
|
+
});
|
|
433
|
+
});
|
|
434
|
+
});
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
export declare const chain: {
|
|
2
|
+
blockExplorers: {
|
|
3
|
+
readonly default: {
|
|
4
|
+
readonly name: "ArcScan";
|
|
5
|
+
readonly url: "https://testnet.arcscan.app";
|
|
6
|
+
readonly apiUrl: "https://testnet.arcscan.app/api";
|
|
7
|
+
};
|
|
8
|
+
};
|
|
9
|
+
blockTime?: number | undefined | undefined;
|
|
10
|
+
contracts: {
|
|
11
|
+
readonly USDC: {
|
|
12
|
+
readonly address: "0x3600000000000000000000000000000000000000";
|
|
13
|
+
readonly abi: readonly [{
|
|
14
|
+
readonly type: "event";
|
|
15
|
+
readonly name: "Approval";
|
|
16
|
+
readonly inputs: readonly [{
|
|
17
|
+
readonly indexed: true;
|
|
18
|
+
readonly name: "owner";
|
|
19
|
+
readonly type: "address";
|
|
20
|
+
}, {
|
|
21
|
+
readonly indexed: true;
|
|
22
|
+
readonly name: "spender";
|
|
23
|
+
readonly type: "address";
|
|
24
|
+
}, {
|
|
25
|
+
readonly indexed: false;
|
|
26
|
+
readonly name: "value";
|
|
27
|
+
readonly type: "uint256";
|
|
28
|
+
}];
|
|
29
|
+
}, {
|
|
30
|
+
readonly type: "event";
|
|
31
|
+
readonly name: "Transfer";
|
|
32
|
+
readonly inputs: readonly [{
|
|
33
|
+
readonly indexed: true;
|
|
34
|
+
readonly name: "from";
|
|
35
|
+
readonly type: "address";
|
|
36
|
+
}, {
|
|
37
|
+
readonly indexed: true;
|
|
38
|
+
readonly name: "to";
|
|
39
|
+
readonly type: "address";
|
|
40
|
+
}, {
|
|
41
|
+
readonly indexed: false;
|
|
42
|
+
readonly name: "value";
|
|
43
|
+
readonly type: "uint256";
|
|
44
|
+
}];
|
|
45
|
+
}, {
|
|
46
|
+
readonly type: "function";
|
|
47
|
+
readonly name: "allowance";
|
|
48
|
+
readonly stateMutability: "view";
|
|
49
|
+
readonly inputs: readonly [{
|
|
50
|
+
readonly name: "owner";
|
|
51
|
+
readonly type: "address";
|
|
52
|
+
}, {
|
|
53
|
+
readonly name: "spender";
|
|
54
|
+
readonly type: "address";
|
|
55
|
+
}];
|
|
56
|
+
readonly outputs: readonly [{
|
|
57
|
+
readonly type: "uint256";
|
|
58
|
+
}];
|
|
59
|
+
}, {
|
|
60
|
+
readonly type: "function";
|
|
61
|
+
readonly name: "approve";
|
|
62
|
+
readonly stateMutability: "nonpayable";
|
|
63
|
+
readonly inputs: readonly [{
|
|
64
|
+
readonly name: "spender";
|
|
65
|
+
readonly type: "address";
|
|
66
|
+
}, {
|
|
67
|
+
readonly name: "amount";
|
|
68
|
+
readonly type: "uint256";
|
|
69
|
+
}];
|
|
70
|
+
readonly outputs: readonly [{
|
|
71
|
+
readonly type: "bool";
|
|
72
|
+
}];
|
|
73
|
+
}, {
|
|
74
|
+
readonly type: "function";
|
|
75
|
+
readonly name: "balanceOf";
|
|
76
|
+
readonly stateMutability: "view";
|
|
77
|
+
readonly inputs: readonly [{
|
|
78
|
+
readonly name: "account";
|
|
79
|
+
readonly type: "address";
|
|
80
|
+
}];
|
|
81
|
+
readonly outputs: readonly [{
|
|
82
|
+
readonly type: "uint256";
|
|
83
|
+
}];
|
|
84
|
+
}, {
|
|
85
|
+
readonly type: "function";
|
|
86
|
+
readonly name: "decimals";
|
|
87
|
+
readonly stateMutability: "view";
|
|
88
|
+
readonly inputs: readonly [];
|
|
89
|
+
readonly outputs: readonly [{
|
|
90
|
+
readonly type: "uint8";
|
|
91
|
+
}];
|
|
92
|
+
}, {
|
|
93
|
+
readonly type: "function";
|
|
94
|
+
readonly name: "name";
|
|
95
|
+
readonly stateMutability: "view";
|
|
96
|
+
readonly inputs: readonly [];
|
|
97
|
+
readonly outputs: readonly [{
|
|
98
|
+
readonly type: "string";
|
|
99
|
+
}];
|
|
100
|
+
}, {
|
|
101
|
+
readonly type: "function";
|
|
102
|
+
readonly name: "symbol";
|
|
103
|
+
readonly stateMutability: "view";
|
|
104
|
+
readonly inputs: readonly [];
|
|
105
|
+
readonly outputs: readonly [{
|
|
106
|
+
readonly type: "string";
|
|
107
|
+
}];
|
|
108
|
+
}, {
|
|
109
|
+
readonly type: "function";
|
|
110
|
+
readonly name: "totalSupply";
|
|
111
|
+
readonly stateMutability: "view";
|
|
112
|
+
readonly inputs: readonly [];
|
|
113
|
+
readonly outputs: readonly [{
|
|
114
|
+
readonly type: "uint256";
|
|
115
|
+
}];
|
|
116
|
+
}, {
|
|
117
|
+
readonly type: "function";
|
|
118
|
+
readonly name: "transfer";
|
|
119
|
+
readonly stateMutability: "nonpayable";
|
|
120
|
+
readonly inputs: readonly [{
|
|
121
|
+
readonly name: "recipient";
|
|
122
|
+
readonly type: "address";
|
|
123
|
+
}, {
|
|
124
|
+
readonly name: "amount";
|
|
125
|
+
readonly type: "uint256";
|
|
126
|
+
}];
|
|
127
|
+
readonly outputs: readonly [{
|
|
128
|
+
readonly type: "bool";
|
|
129
|
+
}];
|
|
130
|
+
}, {
|
|
131
|
+
readonly type: "function";
|
|
132
|
+
readonly name: "transferFrom";
|
|
133
|
+
readonly stateMutability: "nonpayable";
|
|
134
|
+
readonly inputs: readonly [{
|
|
135
|
+
readonly name: "sender";
|
|
136
|
+
readonly type: "address";
|
|
137
|
+
}, {
|
|
138
|
+
readonly name: "recipient";
|
|
139
|
+
readonly type: "address";
|
|
140
|
+
}, {
|
|
141
|
+
readonly name: "amount";
|
|
142
|
+
readonly type: "uint256";
|
|
143
|
+
}];
|
|
144
|
+
readonly outputs: readonly [{
|
|
145
|
+
readonly type: "bool";
|
|
146
|
+
}];
|
|
147
|
+
}];
|
|
148
|
+
readonly read: {
|
|
149
|
+
readonly decimals: () => 6;
|
|
150
|
+
};
|
|
151
|
+
};
|
|
152
|
+
readonly multicall3: {
|
|
153
|
+
readonly address: "0xcA11bde05977b3631167028862bE2a173976CA11";
|
|
154
|
+
readonly blockCreated: 0;
|
|
155
|
+
};
|
|
156
|
+
};
|
|
157
|
+
ensTlds?: readonly string[] | undefined;
|
|
158
|
+
id: 5042002;
|
|
159
|
+
name: "Arc Testnet";
|
|
160
|
+
nativeCurrency: {
|
|
161
|
+
readonly name: "USDC";
|
|
162
|
+
readonly symbol: "USDC";
|
|
163
|
+
readonly decimals: 18;
|
|
164
|
+
};
|
|
165
|
+
experimental_preconfirmationTime?: number | undefined | undefined;
|
|
166
|
+
rpcUrls: {
|
|
167
|
+
readonly default: {
|
|
168
|
+
readonly http: readonly ["https://rpc.testnet.arc.network", "https://rpc.quicknode.testnet.arc.network", "https://rpc.blockdaemon.testnet.arc.network"];
|
|
169
|
+
readonly webSocket: readonly ["wss://rpc.testnet.arc.network", "wss://rpc.quicknode.testnet.arc.network"];
|
|
170
|
+
};
|
|
171
|
+
};
|
|
172
|
+
sourceId?: number | undefined | undefined;
|
|
173
|
+
testnet: true;
|
|
174
|
+
custom?: Record<string, unknown> | undefined;
|
|
175
|
+
fees?: import("viem").ChainFees<undefined> | undefined;
|
|
176
|
+
serializers?: import("viem").ChainSerializers<undefined, import("viem").TransactionSerializable> | undefined;
|
|
177
|
+
readonly blockchainId: "ARC-TESTNET";
|
|
178
|
+
readonly blockchainVm: "EVM";
|
|
179
|
+
readonly formatters?: undefined;
|
|
180
|
+
};
|
|
@@ -0,0 +1,57 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.chain = void 0;
|
|
14
|
+
const viem_1 = require("viem");
|
|
15
|
+
// REF: https://github.com/wevm/viem/blob/00dd2e80646f6253c6d09be6acb7f57b7373737f/src/chains/definitions/arcTestnet.ts#L5
|
|
16
|
+
const arcTestnet = /*#__PURE__*/ (0, viem_1.defineChain)({
|
|
17
|
+
id: 5042002,
|
|
18
|
+
name: 'Arc Testnet',
|
|
19
|
+
nativeCurrency: {
|
|
20
|
+
name: 'USDC',
|
|
21
|
+
symbol: 'USDC',
|
|
22
|
+
decimals: 18,
|
|
23
|
+
},
|
|
24
|
+
rpcUrls: {
|
|
25
|
+
default: {
|
|
26
|
+
http: [
|
|
27
|
+
'https://rpc.testnet.arc.network',
|
|
28
|
+
'https://rpc.quicknode.testnet.arc.network',
|
|
29
|
+
'https://rpc.blockdaemon.testnet.arc.network',
|
|
30
|
+
],
|
|
31
|
+
webSocket: ['wss://rpc.testnet.arc.network', 'wss://rpc.quicknode.testnet.arc.network'],
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
blockExplorers: {
|
|
35
|
+
default: {
|
|
36
|
+
name: 'ArcScan',
|
|
37
|
+
url: 'https://testnet.arcscan.app',
|
|
38
|
+
apiUrl: 'https://testnet.arcscan.app/api',
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
contracts: {
|
|
42
|
+
multicall3: {
|
|
43
|
+
address: '0xcA11bde05977b3631167028862bE2a173976CA11',
|
|
44
|
+
blockCreated: 0,
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
testnet: true,
|
|
48
|
+
});
|
|
49
|
+
exports.chain = (0, viem_1.defineChain)({
|
|
50
|
+
...arcTestnet,
|
|
51
|
+
blockchainId: 'ARC-TESTNET',
|
|
52
|
+
blockchainVm: 'EVM',
|
|
53
|
+
contracts: {
|
|
54
|
+
...arcTestnet.contracts,
|
|
55
|
+
USDC: { address: '0x3600000000000000000000000000000000000000', abi: viem_1.erc20Abi, read: { decimals: () => 6 } },
|
|
56
|
+
},
|
|
57
|
+
});
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { chain as ARB } from './ARB.js';
|
|
2
2
|
export { chain as ARB_SEPOLIA } from './ARB_SEPOLIA.js';
|
|
3
|
+
export { chain as ARC_TESTNET } from './ARC_TESTNET.js';
|
|
3
4
|
export { chain as AVAX } from './AVAX.js';
|
|
4
5
|
export { chain as AVAX_FUJI } from './AVAX_FUJI.js';
|
|
5
6
|
export { chain as ETH } from './ETH.js';
|