anchor-sdk 0.1.42-beta.1 → 0.1.42-beta.3

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 (36) hide show
  1. package/dist/AnchorApiClientV2.d.ts +9 -4
  2. package/dist/AnchorApiClientV2.js +316 -0
  3. package/dist/AnchorERC1155Client.d.ts +0 -1
  4. package/dist/AnchorERC1155Client.js +301 -0
  5. package/dist/AnchorPayClient.d.ts +0 -1
  6. package/dist/AnchorPayClient.js +908 -0
  7. package/dist/abi/AnchorERC1155.d.ts +0 -1
  8. package/dist/abi/AnchorERC1155.js +1122 -0
  9. package/dist/abi/AnchorPay.json +578 -0
  10. package/dist/constants.d.ts +1 -2
  11. package/dist/constants.js +367 -0
  12. package/dist/generated/Api.d.ts +692 -606
  13. package/dist/generated/Api.js +794 -0
  14. package/dist/index.d.ts +7 -7
  15. package/dist/index.js +1379 -3
  16. package/dist/react/AnchorReactSDK.d.ts +59 -0
  17. package/dist/react/AnchorReactSDK.js +192 -0
  18. package/dist/react/index.d.ts +1 -0
  19. package/dist/react/index.js +8 -0
  20. package/dist/typechain/AnchorERC1155.d.ts +2 -3
  21. package/dist/typechain/AnchorERC1155.js +2 -0
  22. package/dist/typechain/AnchorPay.d.ts +2 -3
  23. package/dist/typechain/AnchorPay.js +2 -0
  24. package/dist/typechain/common.d.ts +1 -2
  25. package/dist/typechain/common.js +2 -0
  26. package/dist/typechain/factories/AnchorERC1155__factory.d.ts +0 -1
  27. package/dist/typechain/factories/AnchorERC1155__factory.js +1766 -0
  28. package/dist/typechain/factories/AnchorPay__factory.d.ts +0 -1
  29. package/dist/typechain/factories/AnchorPay__factory.js +469 -0
  30. package/dist/typechain/factories/index.d.ts +0 -1
  31. package/dist/typechain/factories/index.js +10 -0
  32. package/dist/typechain/index.d.ts +0 -1
  33. package/dist/typechain/index.js +41 -0
  34. package/dist/types.d.ts +0 -1
  35. package/dist/types.js +2 -0
  36. package/package.json +1 -1
@@ -0,0 +1,367 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MULTICALL3_ABI = exports.MULTICALL3_ADDRESS = exports.NATIVE_TOKEN_ADDRESS = exports.INTERFACE_HASHES = exports.ENVIRONMENTS = exports.ERC20_ABI = exports.Environment = void 0;
4
+ const chains_1 = require("viem/chains");
5
+ /**
6
+ * 环境枚举
7
+ */
8
+ var Environment;
9
+ (function (Environment) {
10
+ Environment["DEV"] = "dev";
11
+ Environment["BETA"] = "beta";
12
+ Environment["PROD"] = "prod";
13
+ })(Environment || (exports.Environment = Environment = {}));
14
+ /**
15
+ * ERC20 代币 ABI
16
+ */
17
+ exports.ERC20_ABI = [
18
+ {
19
+ constant: true,
20
+ inputs: [],
21
+ name: "decimals",
22
+ outputs: [{ name: "", type: "uint8" }],
23
+ payable: false,
24
+ stateMutability: "view",
25
+ type: "function",
26
+ },
27
+ {
28
+ inputs: [
29
+ {
30
+ name: "owner",
31
+ type: "address",
32
+ },
33
+ {
34
+ name: "spender",
35
+ type: "address",
36
+ },
37
+ ],
38
+ name: "allowance",
39
+ outputs: [
40
+ {
41
+ name: "",
42
+ type: "uint256",
43
+ },
44
+ ],
45
+ stateMutability: "view",
46
+ type: "function",
47
+ },
48
+ {
49
+ inputs: [
50
+ {
51
+ name: "spender",
52
+ type: "address",
53
+ },
54
+ {
55
+ name: "amount",
56
+ type: "uint256",
57
+ },
58
+ ],
59
+ name: "approve",
60
+ outputs: [
61
+ {
62
+ name: "",
63
+ type: "bool",
64
+ },
65
+ ],
66
+ stateMutability: "nonpayable",
67
+ type: "function",
68
+ },
69
+ {
70
+ inputs: [
71
+ {
72
+ name: "account",
73
+ type: "address",
74
+ },
75
+ ],
76
+ name: "balanceOf",
77
+ outputs: [
78
+ {
79
+ name: "",
80
+ type: "uint256",
81
+ },
82
+ ],
83
+ stateMutability: "view",
84
+ type: "function",
85
+ },
86
+ {
87
+ inputs: [
88
+ {
89
+ name: "recipient",
90
+ type: "address",
91
+ },
92
+ {
93
+ name: "amount",
94
+ type: "uint256",
95
+ },
96
+ ],
97
+ name: "transfer",
98
+ outputs: [
99
+ {
100
+ name: "",
101
+ type: "bool",
102
+ },
103
+ ],
104
+ stateMutability: "nonpayable",
105
+ type: "function",
106
+ },
107
+ {
108
+ inputs: [
109
+ {
110
+ name: "sender",
111
+ type: "address",
112
+ },
113
+ {
114
+ name: "recipient",
115
+ type: "address",
116
+ },
117
+ {
118
+ name: "amount",
119
+ type: "uint256",
120
+ },
121
+ ],
122
+ name: "transferFrom",
123
+ outputs: [
124
+ {
125
+ name: "",
126
+ type: "bool",
127
+ },
128
+ ],
129
+ stateMutability: "nonpayable",
130
+ type: "function",
131
+ },
132
+ ];
133
+ /**
134
+ * 环境配置
135
+ */
136
+ exports.ENVIRONMENTS = {
137
+ // 开发环境
138
+ dev: {
139
+ apiBaseUrl: "https://anchordev.dipbit.xyz",
140
+ contracts: {
141
+ // 开发环境只支持测试网
142
+ [chains_1.saigon.id]: {
143
+ anchorPay: "0x8551891728967D2D7b6B502eF5339EEb2281143a",
144
+ anchorERC1155: "0x23Da7778F6152D7B91C20808bEF7163c5EC2C470",
145
+ },
146
+ [chains_1.baseSepolia.id]: {
147
+ anchorPay: "0x2C69537d9b82d2C863BCfF3442D1c4E7633ead7c",
148
+ anchorERC1155: "0x1CE9506cdDdD304AA753c0E8f1F898ab97Ec2870",
149
+ },
150
+ [chains_1.berachainBepolia.id]: {
151
+ anchorPay: "0x80635645c4B4dA367F2eE6D8F38BED1c2CF8C484",
152
+ anchorERC1155: "0x20a6e4aa138cF4635c0abFC79272FBeB8a116F36",
153
+ },
154
+ [chains_1.abstractTestnet.id]: {
155
+ anchorPay: "0xc5c1606fDe120018E74751253F572796EDbaBC09",
156
+ anchorERC1155: "0x0E03d8fA4A37287eabfb2e5BBdc7AcD7C1D3e869",
157
+ },
158
+ ["1962"]: {
159
+ anchorERC1155: "0xa670ca0270c46876e5a78c9a7c596bfef91185a8",
160
+ },
161
+ },
162
+ },
163
+ // 测试环境
164
+ beta: {
165
+ apiBaseUrl: "https://anchorbeta.dipbit.xyz",
166
+ contracts: {
167
+ [chains_1.saigon.id]: {
168
+ anchorPay: "0xcbA8A3FE5fa94A807143bC2467A012010b02Cd94",
169
+ anchorERC1155: "0x4a4D5888A284fED88fbE998c2C59957CE87923D2",
170
+ },
171
+ [chains_1.baseSepolia.id]: {
172
+ anchorPay: "0x2EB31dAbb95F3697eC6bBfE0c41b55D9C321571e",
173
+ anchorERC1155: "0xE78F00BBD1be39Db6C404142Cf4a3A2471A915e7",
174
+ },
175
+ [chains_1.berachainBepolia.id]: {
176
+ anchorPay: "0x382F7946378e8A7A848d04166083711c90D76061",
177
+ anchorERC1155: "0x99eed4522a3Da62CaEE3e87BfFd3779d7d5EF853",
178
+ },
179
+ [chains_1.abstractTestnet.id]: {
180
+ anchorPay: "0x7dc99a343555711aB92fc844d0Df657161df7D67",
181
+ anchorERC1155: "0xa34F267d3Ab2Ce21CBD1F04F593300f6CB609a29",
182
+ },
183
+ ["1962"]: {
184
+ anchorERC1155: "0xa51B53Dc3aA7f4ef5fE9bb429521a73f411ad867",
185
+ },
186
+ },
187
+ },
188
+ // 生产环境
189
+ prod: {
190
+ apiBaseUrl: "https://api-anchor.deek.network",
191
+ contracts: {
192
+ // Dojo
193
+ [chains_1.abstract.id]: {
194
+ anchorPay: "0xf87C02027f36067a87E4eaeeD61b7Ce2ffE0813A",
195
+ anchorERC1155: "0xd6895dc1740e057D564C795923542122f1513142",
196
+ },
197
+ // dt
198
+ [chains_1.base.id]: {
199
+ anchorPay: "0x56f0fAF3a0336F57289e61Be6F32380B38C171E1",
200
+ },
201
+ // mugen
202
+ [chains_1.ronin.id]: {
203
+ anchorPay: "0x56f0fAF3a0336F57289e61Be6F32380B38C171E1",
204
+ anchorERC1155: "0xA412f7D0B39c7451E9A8a34a66f0D69CB5A378dA",
205
+ },
206
+ // deek
207
+ [chains_1.berachain.id]: {
208
+ anchorPay: "0x4567890123456789012345678901234567890123",
209
+ anchorERC1155: "0xdefabcdefabcdefabcdefabcdefabcdefabcdefab",
210
+ },
211
+ },
212
+ },
213
+ };
214
+ /**
215
+ * 接口哈希常量
216
+ */
217
+ exports.INTERFACE_HASHES = {
218
+ // tokenReceived 接口哈希
219
+ TOKEN_RECEIVED: "0x8b2cb2c7b7e2282e2e4b29a6a8c2b2db4218c6a5f8e8fcb3d5598f3e1e6c59d9",
220
+ };
221
+ exports.NATIVE_TOKEN_ADDRESS = "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE";
222
+ /**
223
+ * Multicall3 合约地址(跨链通用)
224
+ */
225
+ exports.MULTICALL3_ADDRESS = "0xcA11bde05977b3631167028862bE2a173976CA11";
226
+ /**
227
+ * Multicall3 合约 ABI
228
+ */
229
+ exports.MULTICALL3_ABI = [
230
+ {
231
+ inputs: [
232
+ {
233
+ components: [
234
+ {
235
+ internalType: "address",
236
+ name: "target",
237
+ type: "address",
238
+ },
239
+ {
240
+ internalType: "bytes",
241
+ name: "callData",
242
+ type: "bytes",
243
+ },
244
+ ],
245
+ internalType: "struct Multicall3.Call[]",
246
+ name: "calls",
247
+ type: "tuple[]",
248
+ },
249
+ ],
250
+ name: "aggregate",
251
+ outputs: [
252
+ {
253
+ internalType: "uint256",
254
+ name: "blockNumber",
255
+ type: "uint256",
256
+ },
257
+ {
258
+ internalType: "bytes[]",
259
+ name: "returnData",
260
+ type: "bytes[]",
261
+ },
262
+ ],
263
+ stateMutability: "payable",
264
+ type: "function",
265
+ },
266
+ {
267
+ inputs: [
268
+ {
269
+ components: [
270
+ {
271
+ internalType: "address",
272
+ name: "target",
273
+ type: "address",
274
+ },
275
+ {
276
+ internalType: "bool",
277
+ name: "allowFailure",
278
+ type: "bool",
279
+ },
280
+ {
281
+ internalType: "bytes",
282
+ name: "callData",
283
+ type: "bytes",
284
+ },
285
+ ],
286
+ internalType: "struct Multicall3.Call3[]",
287
+ name: "calls",
288
+ type: "tuple[]",
289
+ },
290
+ ],
291
+ name: "aggregate3",
292
+ outputs: [
293
+ {
294
+ components: [
295
+ {
296
+ internalType: "bool",
297
+ name: "success",
298
+ type: "bool",
299
+ },
300
+ {
301
+ internalType: "bytes",
302
+ name: "returnData",
303
+ type: "bytes",
304
+ },
305
+ ],
306
+ internalType: "struct Multicall3.Result[]",
307
+ name: "returnData",
308
+ type: "tuple[]",
309
+ },
310
+ ],
311
+ stateMutability: "payable",
312
+ type: "function",
313
+ },
314
+ {
315
+ inputs: [
316
+ {
317
+ components: [
318
+ {
319
+ internalType: "address",
320
+ name: "target",
321
+ type: "address",
322
+ },
323
+ {
324
+ internalType: "bool",
325
+ name: "allowFailure",
326
+ type: "bool",
327
+ },
328
+ {
329
+ internalType: "uint256",
330
+ name: "value",
331
+ type: "uint256",
332
+ },
333
+ {
334
+ internalType: "bytes",
335
+ name: "callData",
336
+ type: "bytes",
337
+ },
338
+ ],
339
+ internalType: "struct Multicall3.Call3Value[]",
340
+ name: "calls",
341
+ type: "tuple[]",
342
+ },
343
+ ],
344
+ name: "aggregate3Value",
345
+ outputs: [
346
+ {
347
+ components: [
348
+ {
349
+ internalType: "bool",
350
+ name: "success",
351
+ type: "bool",
352
+ },
353
+ {
354
+ internalType: "bytes",
355
+ name: "returnData",
356
+ type: "bytes",
357
+ },
358
+ ],
359
+ internalType: "struct Multicall3.Result[]",
360
+ name: "returnData",
361
+ type: "tuple[]",
362
+ },
363
+ ],
364
+ stateMutability: "payable",
365
+ type: "function",
366
+ },
367
+ ];