@zebec-network/exchange-card-sdk 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.
- package/LICENSE +21 -0
- package/README.md +339 -0
- package/dist/artifacts/abi/ERC20.json +350 -0
- package/dist/artifacts/abi/ZebecCard.json +1060 -0
- package/dist/artifacts/abi/index.d.ts +122 -0
- package/dist/artifacts/abi/index.js +10 -0
- package/dist/artifacts/index.d.ts +2 -0
- package/dist/artifacts/index.js +18 -0
- package/dist/artifacts/typechain-types/ERC20.d.ts +149 -0
- package/dist/artifacts/typechain-types/ERC20.js +2 -0
- package/dist/artifacts/typechain-types/ZebecCard.d.ts +639 -0
- package/dist/artifacts/typechain-types/ZebecCard.js +2 -0
- package/dist/artifacts/typechain-types/common.d.ts +50 -0
- package/dist/artifacts/typechain-types/common.js +2 -0
- package/dist/artifacts/typechain-types/factories/ERC20__factory.d.ts +280 -0
- package/dist/artifacts/typechain-types/factories/ERC20__factory.js +378 -0
- package/dist/artifacts/typechain-types/factories/ZebecCard__factory.d.ts +835 -0
- package/dist/artifacts/typechain-types/factories/ZebecCard__factory.js +1088 -0
- package/dist/artifacts/typechain-types/factories/index.d.ts +2 -0
- package/dist/artifacts/typechain-types/factories/index.js +10 -0
- package/dist/artifacts/typechain-types/index.d.ts +5 -0
- package/dist/artifacts/typechain-types/index.js +31 -0
- package/dist/chains.d.ts +18 -0
- package/dist/chains.js +39 -0
- package/dist/constants.d.ts +3649 -0
- package/dist/constants.js +2502 -0
- package/dist/errors.d.ts +24 -0
- package/dist/errors.js +51 -0
- package/dist/helpers/apiHelpers.d.ts +30 -0
- package/dist/helpers/apiHelpers.js +92 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.js +26 -0
- package/dist/services/EvmService.d.ts +37 -0
- package/dist/services/EvmService.js +134 -0
- package/dist/services/TaoService.d.ts +49 -0
- package/dist/services/TaoService.js +106 -0
- package/dist/services/TonService.d.ts +57 -0
- package/dist/services/TonService.js +137 -0
- package/dist/services/XdbService.d.ts +58 -0
- package/dist/services/XdbService.js +140 -0
- package/dist/services/stellarService.d.ts +52 -0
- package/dist/services/stellarService.js +119 -0
- package/dist/types.d.ts +59 -0
- package/dist/types.js +263 -0
- package/dist/utils.d.ts +8 -0
- package/dist/utils.js +48 -0
- package/package.json +58 -0
|
@@ -0,0 +1,378 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ERC20__factory = void 0;
|
|
4
|
+
/* Autogenerated file. Do not edit manually. */
|
|
5
|
+
/* tslint:disable */
|
|
6
|
+
/* eslint-disable */
|
|
7
|
+
const ethers_1 = require("ethers");
|
|
8
|
+
const _abi = [
|
|
9
|
+
{
|
|
10
|
+
inputs: [],
|
|
11
|
+
stateMutability: "nonpayable",
|
|
12
|
+
type: "constructor",
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
inputs: [
|
|
16
|
+
{
|
|
17
|
+
internalType: "address",
|
|
18
|
+
name: "spender",
|
|
19
|
+
type: "address",
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
internalType: "uint256",
|
|
23
|
+
name: "allowance",
|
|
24
|
+
type: "uint256",
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
internalType: "uint256",
|
|
28
|
+
name: "needed",
|
|
29
|
+
type: "uint256",
|
|
30
|
+
},
|
|
31
|
+
],
|
|
32
|
+
name: "ERC20InsufficientAllowance",
|
|
33
|
+
type: "error",
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
inputs: [
|
|
37
|
+
{
|
|
38
|
+
internalType: "address",
|
|
39
|
+
name: "sender",
|
|
40
|
+
type: "address",
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
internalType: "uint256",
|
|
44
|
+
name: "balance",
|
|
45
|
+
type: "uint256",
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
internalType: "uint256",
|
|
49
|
+
name: "needed",
|
|
50
|
+
type: "uint256",
|
|
51
|
+
},
|
|
52
|
+
],
|
|
53
|
+
name: "ERC20InsufficientBalance",
|
|
54
|
+
type: "error",
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
inputs: [
|
|
58
|
+
{
|
|
59
|
+
internalType: "address",
|
|
60
|
+
name: "approver",
|
|
61
|
+
type: "address",
|
|
62
|
+
},
|
|
63
|
+
],
|
|
64
|
+
name: "ERC20InvalidApprover",
|
|
65
|
+
type: "error",
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
inputs: [
|
|
69
|
+
{
|
|
70
|
+
internalType: "address",
|
|
71
|
+
name: "receiver",
|
|
72
|
+
type: "address",
|
|
73
|
+
},
|
|
74
|
+
],
|
|
75
|
+
name: "ERC20InvalidReceiver",
|
|
76
|
+
type: "error",
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
inputs: [
|
|
80
|
+
{
|
|
81
|
+
internalType: "address",
|
|
82
|
+
name: "sender",
|
|
83
|
+
type: "address",
|
|
84
|
+
},
|
|
85
|
+
],
|
|
86
|
+
name: "ERC20InvalidSender",
|
|
87
|
+
type: "error",
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
inputs: [
|
|
91
|
+
{
|
|
92
|
+
internalType: "address",
|
|
93
|
+
name: "spender",
|
|
94
|
+
type: "address",
|
|
95
|
+
},
|
|
96
|
+
],
|
|
97
|
+
name: "ERC20InvalidSpender",
|
|
98
|
+
type: "error",
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
anonymous: false,
|
|
102
|
+
inputs: [
|
|
103
|
+
{
|
|
104
|
+
indexed: true,
|
|
105
|
+
internalType: "address",
|
|
106
|
+
name: "owner",
|
|
107
|
+
type: "address",
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
indexed: true,
|
|
111
|
+
internalType: "address",
|
|
112
|
+
name: "spender",
|
|
113
|
+
type: "address",
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
indexed: false,
|
|
117
|
+
internalType: "uint256",
|
|
118
|
+
name: "value",
|
|
119
|
+
type: "uint256",
|
|
120
|
+
},
|
|
121
|
+
],
|
|
122
|
+
name: "Approval",
|
|
123
|
+
type: "event",
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
anonymous: false,
|
|
127
|
+
inputs: [
|
|
128
|
+
{
|
|
129
|
+
indexed: true,
|
|
130
|
+
internalType: "address",
|
|
131
|
+
name: "from",
|
|
132
|
+
type: "address",
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
indexed: true,
|
|
136
|
+
internalType: "address",
|
|
137
|
+
name: "to",
|
|
138
|
+
type: "address",
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
indexed: false,
|
|
142
|
+
internalType: "uint256",
|
|
143
|
+
name: "value",
|
|
144
|
+
type: "uint256",
|
|
145
|
+
},
|
|
146
|
+
],
|
|
147
|
+
name: "Transfer",
|
|
148
|
+
type: "event",
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
inputs: [
|
|
152
|
+
{
|
|
153
|
+
internalType: "address",
|
|
154
|
+
name: "owner",
|
|
155
|
+
type: "address",
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
internalType: "address",
|
|
159
|
+
name: "spender",
|
|
160
|
+
type: "address",
|
|
161
|
+
},
|
|
162
|
+
],
|
|
163
|
+
name: "allowance",
|
|
164
|
+
outputs: [
|
|
165
|
+
{
|
|
166
|
+
internalType: "uint256",
|
|
167
|
+
name: "",
|
|
168
|
+
type: "uint256",
|
|
169
|
+
},
|
|
170
|
+
],
|
|
171
|
+
stateMutability: "view",
|
|
172
|
+
type: "function",
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
inputs: [
|
|
176
|
+
{
|
|
177
|
+
internalType: "address",
|
|
178
|
+
name: "spender",
|
|
179
|
+
type: "address",
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
internalType: "uint256",
|
|
183
|
+
name: "value",
|
|
184
|
+
type: "uint256",
|
|
185
|
+
},
|
|
186
|
+
],
|
|
187
|
+
name: "approve",
|
|
188
|
+
outputs: [
|
|
189
|
+
{
|
|
190
|
+
internalType: "bool",
|
|
191
|
+
name: "",
|
|
192
|
+
type: "bool",
|
|
193
|
+
},
|
|
194
|
+
],
|
|
195
|
+
stateMutability: "nonpayable",
|
|
196
|
+
type: "function",
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
inputs: [
|
|
200
|
+
{
|
|
201
|
+
internalType: "address",
|
|
202
|
+
name: "account",
|
|
203
|
+
type: "address",
|
|
204
|
+
},
|
|
205
|
+
],
|
|
206
|
+
name: "balanceOf",
|
|
207
|
+
outputs: [
|
|
208
|
+
{
|
|
209
|
+
internalType: "uint256",
|
|
210
|
+
name: "",
|
|
211
|
+
type: "uint256",
|
|
212
|
+
},
|
|
213
|
+
],
|
|
214
|
+
stateMutability: "view",
|
|
215
|
+
type: "function",
|
|
216
|
+
},
|
|
217
|
+
{
|
|
218
|
+
inputs: [],
|
|
219
|
+
name: "decimals",
|
|
220
|
+
outputs: [
|
|
221
|
+
{
|
|
222
|
+
internalType: "uint8",
|
|
223
|
+
name: "",
|
|
224
|
+
type: "uint8",
|
|
225
|
+
},
|
|
226
|
+
],
|
|
227
|
+
stateMutability: "view",
|
|
228
|
+
type: "function",
|
|
229
|
+
},
|
|
230
|
+
{
|
|
231
|
+
inputs: [],
|
|
232
|
+
name: "minter",
|
|
233
|
+
outputs: [
|
|
234
|
+
{
|
|
235
|
+
internalType: "address",
|
|
236
|
+
name: "",
|
|
237
|
+
type: "address",
|
|
238
|
+
},
|
|
239
|
+
],
|
|
240
|
+
stateMutability: "view",
|
|
241
|
+
type: "function",
|
|
242
|
+
},
|
|
243
|
+
{
|
|
244
|
+
inputs: [],
|
|
245
|
+
name: "name",
|
|
246
|
+
outputs: [
|
|
247
|
+
{
|
|
248
|
+
internalType: "string",
|
|
249
|
+
name: "",
|
|
250
|
+
type: "string",
|
|
251
|
+
},
|
|
252
|
+
],
|
|
253
|
+
stateMutability: "view",
|
|
254
|
+
type: "function",
|
|
255
|
+
},
|
|
256
|
+
{
|
|
257
|
+
inputs: [],
|
|
258
|
+
name: "started",
|
|
259
|
+
outputs: [
|
|
260
|
+
{
|
|
261
|
+
internalType: "bool",
|
|
262
|
+
name: "",
|
|
263
|
+
type: "bool",
|
|
264
|
+
},
|
|
265
|
+
],
|
|
266
|
+
stateMutability: "view",
|
|
267
|
+
type: "function",
|
|
268
|
+
},
|
|
269
|
+
{
|
|
270
|
+
inputs: [],
|
|
271
|
+
name: "symbol",
|
|
272
|
+
outputs: [
|
|
273
|
+
{
|
|
274
|
+
internalType: "string",
|
|
275
|
+
name: "",
|
|
276
|
+
type: "string",
|
|
277
|
+
},
|
|
278
|
+
],
|
|
279
|
+
stateMutability: "view",
|
|
280
|
+
type: "function",
|
|
281
|
+
},
|
|
282
|
+
{
|
|
283
|
+
inputs: [],
|
|
284
|
+
name: "totalSupply",
|
|
285
|
+
outputs: [
|
|
286
|
+
{
|
|
287
|
+
internalType: "uint256",
|
|
288
|
+
name: "",
|
|
289
|
+
type: "uint256",
|
|
290
|
+
},
|
|
291
|
+
],
|
|
292
|
+
stateMutability: "view",
|
|
293
|
+
type: "function",
|
|
294
|
+
},
|
|
295
|
+
{
|
|
296
|
+
inputs: [
|
|
297
|
+
{
|
|
298
|
+
internalType: "address",
|
|
299
|
+
name: "to",
|
|
300
|
+
type: "address",
|
|
301
|
+
},
|
|
302
|
+
{
|
|
303
|
+
internalType: "uint256",
|
|
304
|
+
name: "value",
|
|
305
|
+
type: "uint256",
|
|
306
|
+
},
|
|
307
|
+
],
|
|
308
|
+
name: "transfer",
|
|
309
|
+
outputs: [
|
|
310
|
+
{
|
|
311
|
+
internalType: "bool",
|
|
312
|
+
name: "",
|
|
313
|
+
type: "bool",
|
|
314
|
+
},
|
|
315
|
+
],
|
|
316
|
+
stateMutability: "nonpayable",
|
|
317
|
+
type: "function",
|
|
318
|
+
},
|
|
319
|
+
{
|
|
320
|
+
inputs: [
|
|
321
|
+
{
|
|
322
|
+
internalType: "address",
|
|
323
|
+
name: "from",
|
|
324
|
+
type: "address",
|
|
325
|
+
},
|
|
326
|
+
{
|
|
327
|
+
internalType: "address",
|
|
328
|
+
name: "to",
|
|
329
|
+
type: "address",
|
|
330
|
+
},
|
|
331
|
+
{
|
|
332
|
+
internalType: "uint256",
|
|
333
|
+
name: "value",
|
|
334
|
+
type: "uint256",
|
|
335
|
+
},
|
|
336
|
+
],
|
|
337
|
+
name: "transferFrom",
|
|
338
|
+
outputs: [
|
|
339
|
+
{
|
|
340
|
+
internalType: "bool",
|
|
341
|
+
name: "",
|
|
342
|
+
type: "bool",
|
|
343
|
+
},
|
|
344
|
+
],
|
|
345
|
+
stateMutability: "nonpayable",
|
|
346
|
+
type: "function",
|
|
347
|
+
},
|
|
348
|
+
];
|
|
349
|
+
const _bytecode = "0x608034620003fb5760406001600160401b0382820181811184821017620003e5578252600f835260206e21b0b932102a32b9ba102a37b5b2b760891b8185015282519383850185811084821117620003e55784526004928386526321aa25a760e11b83870152815195818711620003d057600390815497600194858a811c9a168015620003c5575b878b1014620003b0578190601f9a8b81116200035a575b5087908b8311600114620002f357600092620002e7575b505060001982851b1c191690851b1782555b8051928311620002d25785548481811c91168015620002c7575b86821014620002b25788811162000267575b5084978311600114620001fe5796829394959697600093620001f2575b505082841b92600019911b1c19161783555b600580546001600160a81b03191633600890811b610100600160a81b0316919091179290921790819055901c6001600160a01b0316918215620001db576002546a0422ca8b0a00a42500000091828201809211620001c6575060025560008381528083528481208054830190558451918252917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a3516107669081620004018239f35b601190634e487b7160e01b6000525260246000fd5b602490600085519163ec442f0560e01b8352820152fd5b01519150388062000110565b90601f1983169786600052856000209260005b8a811062000251575084869798999a1062000236575b50505050811b01835562000122565b01519060f884600019921b161c191690553880808062000227565b8183015185559386019391870191870162000211565b86600052856000208980860160051c820192888710620002a8575b0160051c019085905b8281106200029b575050620000f3565b600081550185906200028b565b9250819262000282565b602287634e487b7160e01b6000525260246000fd5b90607f1690620000e1565b604186634e487b7160e01b6000525260246000fd5b015190503880620000b5565b90879350601f1983169186600052896000209260005b8b8282106200034357505084116200032a575b505050811b018255620000c7565b015160001983871b60f8161c191690553880806200031c565b8385015186558b9790950194938401930162000309565b90915084600052876000208b80850160051c8201928a8610620003a6575b918991869594930160051c01915b828110620003965750506200009e565b6000815585945089910162000386565b9250819262000378565b602288634e487b7160e01b6000525260246000fd5b99607f169962000087565b604185634e487b7160e01b6000525260246000fd5b634e487b7160e01b600052604160045260246000fd5b600080fdfe608060408181526004918236101561001657600080fd5b600092833560e01c91826306fdde03146104b557508163075461721461048a578163095ea7b3146103de57816318160ddd146103bf5781631f2698ab1461039b57816323b872dd1461028c578163313ce5671461027057816370a082311461023a57816395d89b411461011957508063a9059cbb146100e95763dd62ed3e1461009e57600080fd5b346100e557806003193601126100e557806020926100ba6105d8565b6100c26105f3565b6001600160a01b0391821683526001865283832091168252845220549051908152f35b5080fd5b50346100e557806003193601126100e5576020906101126101086105d8565b6024359033610609565b5160018152f35b8383346100e557816003193601126100e55780519082845460018160011c9060018316928315610230575b602093848410811461021d5783885290811561020157506001146101ac575b505050829003601f01601f191682019267ffffffffffffffff841183851017610199575082918261019592528261058f565b0390f35b80604186634e487b7160e01b6024945252fd5b8787529192508591837f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b5b8385106101ed5750505050830101858080610163565b8054888601830152930192849082016101d7565b60ff1916878501525050151560051b8401019050858080610163565b60248960228c634e487b7160e01b835252fd5b91607f1691610144565b5050346100e55760203660031901126100e557806020926001600160a01b036102616105d8565b16815280845220549051908152f35b5050346100e557816003193601126100e5576020905160128152f35b90508234610398576060366003190112610398576102a86105d8565b6102b06105f3565b91604435936001600160a01b0383168083526001602052868320338452602052868320549160001983036102ed575b602088610112898989610609565b86831061035357811561033d57331561032757508252600160209081528683203384528152918690209085900390558290610112876102df565b60249084895191634a1406b160e11b8352820152fd5b6024908489519163e602df0560e01b8352820152fd5b87517ffb8f41b2000000000000000000000000000000000000000000000000000000008152339181019182526020820193909352604081018790528291506060010390fd5b80fd5b5050346100e557816003193601126100e55760209060ff6005541690519015158152f35b5050346100e557816003193601126100e5576020906002549051908152f35b9050346104865781600319360112610486576103f86105d8565b602435903315610470576001600160a01b031691821561045a57508083602095338152600187528181208582528752205582519081527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925843392a35160018152f35b60249085855191634a1406b160e11b8352820152fd5b6024838686519163e602df0560e01b8352820152fd5b8280fd5b5050346100e557816003193601126100e5576020906001600160a01b0360055460081c169051908152f35b849084346104865782600319360112610486578260035460018160011c9060018316928315610585575b602093848410811461021d57838852908115610201575060011461052f57505050829003601f01601f191682019267ffffffffffffffff841183851017610199575082918261019592528261058f565b600387529192508591837fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b5b8385106105715750505050830101858080610163565b80548886018301529301928490820161055b565b91607f16916104df565b6020808252825181830181905290939260005b8281106105c457505060409293506000838284010152601f8019910116010190565b8181018601518482016040015285016105a2565b600435906001600160a01b03821682036105ee57565b600080fd5b602435906001600160a01b03821682036105ee57565b916001600160a01b038084169283156106ff57169283156106ce5760009083825281602052604082205490838210610683575091604082827fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef958760209652828652038282205586815220818154019055604051908152a3565b6040517fe450d38c0000000000000000000000000000000000000000000000000000000081526001600160a01b03919091166004820152602481019190915260448101839052606490fd5b60246040517fec442f0500000000000000000000000000000000000000000000000000000000815260006004820152fd5b60246040517f96c6fd1e00000000000000000000000000000000000000000000000000000000815260006004820152fdfea2646970667358221220a895ef5f3cf026b48a9ffb4320764182cae42330f3d36a62637bec75ffa74e3c64736f6c63430008180033";
|
|
350
|
+
const isSuperArgs = (xs) => xs.length > 1;
|
|
351
|
+
class ERC20__factory extends ethers_1.ContractFactory {
|
|
352
|
+
constructor(...args) {
|
|
353
|
+
if (isSuperArgs(args)) {
|
|
354
|
+
super(...args);
|
|
355
|
+
}
|
|
356
|
+
else {
|
|
357
|
+
super(_abi, _bytecode, args[0]);
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
getDeployTransaction(overrides) {
|
|
361
|
+
return super.getDeployTransaction(overrides || {});
|
|
362
|
+
}
|
|
363
|
+
deploy(overrides) {
|
|
364
|
+
return super.deploy(overrides || {});
|
|
365
|
+
}
|
|
366
|
+
connect(runner) {
|
|
367
|
+
return super.connect(runner);
|
|
368
|
+
}
|
|
369
|
+
static bytecode = _bytecode;
|
|
370
|
+
static abi = _abi;
|
|
371
|
+
static createInterface() {
|
|
372
|
+
return new ethers_1.Interface(_abi);
|
|
373
|
+
}
|
|
374
|
+
static connect(address, runner) {
|
|
375
|
+
return new ethers_1.Contract(address, _abi, runner);
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
exports.ERC20__factory = ERC20__factory;
|