rain-sdk-v2 2.1.5 → 2.1.6
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/README.md +5 -0
- package/dist/Rain.d.ts +3 -0
- package/dist/abi/USDRAbi.d.ts +602 -0
- package/dist/abi/USDRAbi.js +1 -0
- package/dist/config/environments.d.ts +3 -0
- package/dist/config/environments.js +18 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -32,12 +32,17 @@ const config = rain.getEnvironmentConfig();
|
|
|
32
32
|
console.log(config.market_factory_address); // Factory contract
|
|
33
33
|
console.log(config.tokens.usdt.address); // USDT token address
|
|
34
34
|
console.log(config.tokens.rain.address); // RAIN token address
|
|
35
|
+
console.log(config.tokens.usdr.address); // USDR token address
|
|
35
36
|
console.log(config.tokens.usdt.decimals); // 6
|
|
36
37
|
console.log(config.tokens.rain.decimals); // 18
|
|
38
|
+
console.log(config.tokens.usdr.decimals); // 18
|
|
37
39
|
|
|
38
40
|
// Get token config by address
|
|
39
41
|
const tokenInfo = rain.getTokenConfig('0x...');
|
|
40
42
|
console.log(tokenInfo?.decimals, tokenInfo?.symbol);
|
|
43
|
+
|
|
44
|
+
// USDR token ABI (ERC20 + AccessControl + EIP-2612 permit, role-gated mint/burn)
|
|
45
|
+
import { USDRAbi } from 'rain-sdk-v2';
|
|
41
46
|
```
|
|
42
47
|
|
|
43
48
|
---
|
package/dist/Rain.d.ts
CHANGED
|
@@ -183,6 +183,7 @@ export declare class Rain {
|
|
|
183
183
|
readonly tokens: {
|
|
184
184
|
readonly usdt: import("./config/environments.js").TokenConfig;
|
|
185
185
|
readonly rain: import("./config/environments.js").TokenConfig;
|
|
186
|
+
readonly usdr: import("./config/environments.js").TokenConfig;
|
|
186
187
|
};
|
|
187
188
|
} | {
|
|
188
189
|
readonly apiUrl: "https://stg2-api.rain.one";
|
|
@@ -191,6 +192,7 @@ export declare class Rain {
|
|
|
191
192
|
readonly tokens: {
|
|
192
193
|
readonly usdt: import("./config/environments.js").TokenConfig;
|
|
193
194
|
readonly rain: import("./config/environments.js").TokenConfig;
|
|
195
|
+
readonly usdr: import("./config/environments.js").TokenConfig;
|
|
194
196
|
};
|
|
195
197
|
} | {
|
|
196
198
|
readonly apiUrl: "https://prod2-api.rain.one";
|
|
@@ -199,6 +201,7 @@ export declare class Rain {
|
|
|
199
201
|
readonly tokens: {
|
|
200
202
|
readonly usdt: import("./config/environments.js").TokenConfig;
|
|
201
203
|
readonly rain: import("./config/environments.js").TokenConfig;
|
|
204
|
+
readonly usdr: import("./config/environments.js").TokenConfig;
|
|
202
205
|
};
|
|
203
206
|
};
|
|
204
207
|
private cfg;
|
|
@@ -0,0 +1,602 @@
|
|
|
1
|
+
export declare const USDRAbi: readonly [{
|
|
2
|
+
readonly inputs: readonly [];
|
|
3
|
+
readonly stateMutability: "nonpayable";
|
|
4
|
+
readonly type: "constructor";
|
|
5
|
+
}, {
|
|
6
|
+
readonly inputs: readonly [];
|
|
7
|
+
readonly name: "AccessControlBadConfirmation";
|
|
8
|
+
readonly type: "error";
|
|
9
|
+
}, {
|
|
10
|
+
readonly inputs: readonly [{
|
|
11
|
+
readonly internalType: "address";
|
|
12
|
+
readonly name: "account";
|
|
13
|
+
readonly type: "address";
|
|
14
|
+
}, {
|
|
15
|
+
readonly internalType: "bytes32";
|
|
16
|
+
readonly name: "neededRole";
|
|
17
|
+
readonly type: "bytes32";
|
|
18
|
+
}];
|
|
19
|
+
readonly name: "AccessControlUnauthorizedAccount";
|
|
20
|
+
readonly type: "error";
|
|
21
|
+
}, {
|
|
22
|
+
readonly inputs: readonly [];
|
|
23
|
+
readonly name: "ECDSAInvalidSignature";
|
|
24
|
+
readonly type: "error";
|
|
25
|
+
}, {
|
|
26
|
+
readonly inputs: readonly [{
|
|
27
|
+
readonly internalType: "uint256";
|
|
28
|
+
readonly name: "length";
|
|
29
|
+
readonly type: "uint256";
|
|
30
|
+
}];
|
|
31
|
+
readonly name: "ECDSAInvalidSignatureLength";
|
|
32
|
+
readonly type: "error";
|
|
33
|
+
}, {
|
|
34
|
+
readonly inputs: readonly [{
|
|
35
|
+
readonly internalType: "bytes32";
|
|
36
|
+
readonly name: "s";
|
|
37
|
+
readonly type: "bytes32";
|
|
38
|
+
}];
|
|
39
|
+
readonly name: "ECDSAInvalidSignatureS";
|
|
40
|
+
readonly type: "error";
|
|
41
|
+
}, {
|
|
42
|
+
readonly inputs: readonly [{
|
|
43
|
+
readonly internalType: "address";
|
|
44
|
+
readonly name: "spender";
|
|
45
|
+
readonly type: "address";
|
|
46
|
+
}, {
|
|
47
|
+
readonly internalType: "uint256";
|
|
48
|
+
readonly name: "allowance";
|
|
49
|
+
readonly type: "uint256";
|
|
50
|
+
}, {
|
|
51
|
+
readonly internalType: "uint256";
|
|
52
|
+
readonly name: "needed";
|
|
53
|
+
readonly type: "uint256";
|
|
54
|
+
}];
|
|
55
|
+
readonly name: "ERC20InsufficientAllowance";
|
|
56
|
+
readonly type: "error";
|
|
57
|
+
}, {
|
|
58
|
+
readonly inputs: readonly [{
|
|
59
|
+
readonly internalType: "address";
|
|
60
|
+
readonly name: "sender";
|
|
61
|
+
readonly type: "address";
|
|
62
|
+
}, {
|
|
63
|
+
readonly internalType: "uint256";
|
|
64
|
+
readonly name: "balance";
|
|
65
|
+
readonly type: "uint256";
|
|
66
|
+
}, {
|
|
67
|
+
readonly internalType: "uint256";
|
|
68
|
+
readonly name: "needed";
|
|
69
|
+
readonly type: "uint256";
|
|
70
|
+
}];
|
|
71
|
+
readonly name: "ERC20InsufficientBalance";
|
|
72
|
+
readonly type: "error";
|
|
73
|
+
}, {
|
|
74
|
+
readonly inputs: readonly [{
|
|
75
|
+
readonly internalType: "address";
|
|
76
|
+
readonly name: "approver";
|
|
77
|
+
readonly type: "address";
|
|
78
|
+
}];
|
|
79
|
+
readonly name: "ERC20InvalidApprover";
|
|
80
|
+
readonly type: "error";
|
|
81
|
+
}, {
|
|
82
|
+
readonly inputs: readonly [{
|
|
83
|
+
readonly internalType: "address";
|
|
84
|
+
readonly name: "receiver";
|
|
85
|
+
readonly type: "address";
|
|
86
|
+
}];
|
|
87
|
+
readonly name: "ERC20InvalidReceiver";
|
|
88
|
+
readonly type: "error";
|
|
89
|
+
}, {
|
|
90
|
+
readonly inputs: readonly [{
|
|
91
|
+
readonly internalType: "address";
|
|
92
|
+
readonly name: "sender";
|
|
93
|
+
readonly type: "address";
|
|
94
|
+
}];
|
|
95
|
+
readonly name: "ERC20InvalidSender";
|
|
96
|
+
readonly type: "error";
|
|
97
|
+
}, {
|
|
98
|
+
readonly inputs: readonly [{
|
|
99
|
+
readonly internalType: "address";
|
|
100
|
+
readonly name: "spender";
|
|
101
|
+
readonly type: "address";
|
|
102
|
+
}];
|
|
103
|
+
readonly name: "ERC20InvalidSpender";
|
|
104
|
+
readonly type: "error";
|
|
105
|
+
}, {
|
|
106
|
+
readonly inputs: readonly [{
|
|
107
|
+
readonly internalType: "uint256";
|
|
108
|
+
readonly name: "deadline";
|
|
109
|
+
readonly type: "uint256";
|
|
110
|
+
}];
|
|
111
|
+
readonly name: "ERC2612ExpiredSignature";
|
|
112
|
+
readonly type: "error";
|
|
113
|
+
}, {
|
|
114
|
+
readonly inputs: readonly [{
|
|
115
|
+
readonly internalType: "address";
|
|
116
|
+
readonly name: "signer";
|
|
117
|
+
readonly type: "address";
|
|
118
|
+
}, {
|
|
119
|
+
readonly internalType: "address";
|
|
120
|
+
readonly name: "owner";
|
|
121
|
+
readonly type: "address";
|
|
122
|
+
}];
|
|
123
|
+
readonly name: "ERC2612InvalidSigner";
|
|
124
|
+
readonly type: "error";
|
|
125
|
+
}, {
|
|
126
|
+
readonly inputs: readonly [{
|
|
127
|
+
readonly internalType: "address";
|
|
128
|
+
readonly name: "account";
|
|
129
|
+
readonly type: "address";
|
|
130
|
+
}, {
|
|
131
|
+
readonly internalType: "uint256";
|
|
132
|
+
readonly name: "currentNonce";
|
|
133
|
+
readonly type: "uint256";
|
|
134
|
+
}];
|
|
135
|
+
readonly name: "InvalidAccountNonce";
|
|
136
|
+
readonly type: "error";
|
|
137
|
+
}, {
|
|
138
|
+
readonly inputs: readonly [];
|
|
139
|
+
readonly name: "InvalidShortString";
|
|
140
|
+
readonly type: "error";
|
|
141
|
+
}, {
|
|
142
|
+
readonly inputs: readonly [{
|
|
143
|
+
readonly internalType: "string";
|
|
144
|
+
readonly name: "str";
|
|
145
|
+
readonly type: "string";
|
|
146
|
+
}];
|
|
147
|
+
readonly name: "StringTooLong";
|
|
148
|
+
readonly type: "error";
|
|
149
|
+
}, {
|
|
150
|
+
readonly anonymous: false;
|
|
151
|
+
readonly inputs: readonly [{
|
|
152
|
+
readonly indexed: true;
|
|
153
|
+
readonly internalType: "address";
|
|
154
|
+
readonly name: "owner";
|
|
155
|
+
readonly type: "address";
|
|
156
|
+
}, {
|
|
157
|
+
readonly indexed: true;
|
|
158
|
+
readonly internalType: "address";
|
|
159
|
+
readonly name: "spender";
|
|
160
|
+
readonly type: "address";
|
|
161
|
+
}, {
|
|
162
|
+
readonly indexed: false;
|
|
163
|
+
readonly internalType: "uint256";
|
|
164
|
+
readonly name: "value";
|
|
165
|
+
readonly type: "uint256";
|
|
166
|
+
}];
|
|
167
|
+
readonly name: "Approval";
|
|
168
|
+
readonly type: "event";
|
|
169
|
+
}, {
|
|
170
|
+
readonly anonymous: false;
|
|
171
|
+
readonly inputs: readonly [];
|
|
172
|
+
readonly name: "EIP712DomainChanged";
|
|
173
|
+
readonly type: "event";
|
|
174
|
+
}, {
|
|
175
|
+
readonly anonymous: false;
|
|
176
|
+
readonly inputs: readonly [{
|
|
177
|
+
readonly indexed: true;
|
|
178
|
+
readonly internalType: "bytes32";
|
|
179
|
+
readonly name: "role";
|
|
180
|
+
readonly type: "bytes32";
|
|
181
|
+
}, {
|
|
182
|
+
readonly indexed: true;
|
|
183
|
+
readonly internalType: "bytes32";
|
|
184
|
+
readonly name: "previousAdminRole";
|
|
185
|
+
readonly type: "bytes32";
|
|
186
|
+
}, {
|
|
187
|
+
readonly indexed: true;
|
|
188
|
+
readonly internalType: "bytes32";
|
|
189
|
+
readonly name: "newAdminRole";
|
|
190
|
+
readonly type: "bytes32";
|
|
191
|
+
}];
|
|
192
|
+
readonly name: "RoleAdminChanged";
|
|
193
|
+
readonly type: "event";
|
|
194
|
+
}, {
|
|
195
|
+
readonly anonymous: false;
|
|
196
|
+
readonly inputs: readonly [{
|
|
197
|
+
readonly indexed: true;
|
|
198
|
+
readonly internalType: "bytes32";
|
|
199
|
+
readonly name: "role";
|
|
200
|
+
readonly type: "bytes32";
|
|
201
|
+
}, {
|
|
202
|
+
readonly indexed: true;
|
|
203
|
+
readonly internalType: "address";
|
|
204
|
+
readonly name: "account";
|
|
205
|
+
readonly type: "address";
|
|
206
|
+
}, {
|
|
207
|
+
readonly indexed: true;
|
|
208
|
+
readonly internalType: "address";
|
|
209
|
+
readonly name: "sender";
|
|
210
|
+
readonly type: "address";
|
|
211
|
+
}];
|
|
212
|
+
readonly name: "RoleGranted";
|
|
213
|
+
readonly type: "event";
|
|
214
|
+
}, {
|
|
215
|
+
readonly anonymous: false;
|
|
216
|
+
readonly inputs: readonly [{
|
|
217
|
+
readonly indexed: true;
|
|
218
|
+
readonly internalType: "bytes32";
|
|
219
|
+
readonly name: "role";
|
|
220
|
+
readonly type: "bytes32";
|
|
221
|
+
}, {
|
|
222
|
+
readonly indexed: true;
|
|
223
|
+
readonly internalType: "address";
|
|
224
|
+
readonly name: "account";
|
|
225
|
+
readonly type: "address";
|
|
226
|
+
}, {
|
|
227
|
+
readonly indexed: true;
|
|
228
|
+
readonly internalType: "address";
|
|
229
|
+
readonly name: "sender";
|
|
230
|
+
readonly type: "address";
|
|
231
|
+
}];
|
|
232
|
+
readonly name: "RoleRevoked";
|
|
233
|
+
readonly type: "event";
|
|
234
|
+
}, {
|
|
235
|
+
readonly anonymous: false;
|
|
236
|
+
readonly inputs: readonly [{
|
|
237
|
+
readonly indexed: true;
|
|
238
|
+
readonly internalType: "address";
|
|
239
|
+
readonly name: "from";
|
|
240
|
+
readonly type: "address";
|
|
241
|
+
}, {
|
|
242
|
+
readonly indexed: true;
|
|
243
|
+
readonly internalType: "address";
|
|
244
|
+
readonly name: "to";
|
|
245
|
+
readonly type: "address";
|
|
246
|
+
}, {
|
|
247
|
+
readonly indexed: false;
|
|
248
|
+
readonly internalType: "uint256";
|
|
249
|
+
readonly name: "value";
|
|
250
|
+
readonly type: "uint256";
|
|
251
|
+
}];
|
|
252
|
+
readonly name: "Transfer";
|
|
253
|
+
readonly type: "event";
|
|
254
|
+
}, {
|
|
255
|
+
readonly inputs: readonly [];
|
|
256
|
+
readonly name: "DEFAULT_ADMIN_ROLE";
|
|
257
|
+
readonly outputs: readonly [{
|
|
258
|
+
readonly internalType: "bytes32";
|
|
259
|
+
readonly name: "";
|
|
260
|
+
readonly type: "bytes32";
|
|
261
|
+
}];
|
|
262
|
+
readonly stateMutability: "view";
|
|
263
|
+
readonly type: "function";
|
|
264
|
+
}, {
|
|
265
|
+
readonly inputs: readonly [];
|
|
266
|
+
readonly name: "DOMAIN_SEPARATOR";
|
|
267
|
+
readonly outputs: readonly [{
|
|
268
|
+
readonly internalType: "bytes32";
|
|
269
|
+
readonly name: "";
|
|
270
|
+
readonly type: "bytes32";
|
|
271
|
+
}];
|
|
272
|
+
readonly stateMutability: "view";
|
|
273
|
+
readonly type: "function";
|
|
274
|
+
}, {
|
|
275
|
+
readonly inputs: readonly [{
|
|
276
|
+
readonly internalType: "address";
|
|
277
|
+
readonly name: "owner";
|
|
278
|
+
readonly type: "address";
|
|
279
|
+
}, {
|
|
280
|
+
readonly internalType: "address";
|
|
281
|
+
readonly name: "spender";
|
|
282
|
+
readonly type: "address";
|
|
283
|
+
}];
|
|
284
|
+
readonly name: "allowance";
|
|
285
|
+
readonly outputs: readonly [{
|
|
286
|
+
readonly internalType: "uint256";
|
|
287
|
+
readonly name: "";
|
|
288
|
+
readonly type: "uint256";
|
|
289
|
+
}];
|
|
290
|
+
readonly stateMutability: "view";
|
|
291
|
+
readonly type: "function";
|
|
292
|
+
}, {
|
|
293
|
+
readonly inputs: readonly [{
|
|
294
|
+
readonly internalType: "address";
|
|
295
|
+
readonly name: "spender";
|
|
296
|
+
readonly type: "address";
|
|
297
|
+
}, {
|
|
298
|
+
readonly internalType: "uint256";
|
|
299
|
+
readonly name: "value";
|
|
300
|
+
readonly type: "uint256";
|
|
301
|
+
}];
|
|
302
|
+
readonly name: "approve";
|
|
303
|
+
readonly outputs: readonly [{
|
|
304
|
+
readonly internalType: "bool";
|
|
305
|
+
readonly name: "";
|
|
306
|
+
readonly type: "bool";
|
|
307
|
+
}];
|
|
308
|
+
readonly stateMutability: "nonpayable";
|
|
309
|
+
readonly type: "function";
|
|
310
|
+
}, {
|
|
311
|
+
readonly inputs: readonly [{
|
|
312
|
+
readonly internalType: "address";
|
|
313
|
+
readonly name: "account";
|
|
314
|
+
readonly type: "address";
|
|
315
|
+
}];
|
|
316
|
+
readonly name: "balanceOf";
|
|
317
|
+
readonly outputs: readonly [{
|
|
318
|
+
readonly internalType: "uint256";
|
|
319
|
+
readonly name: "";
|
|
320
|
+
readonly type: "uint256";
|
|
321
|
+
}];
|
|
322
|
+
readonly stateMutability: "view";
|
|
323
|
+
readonly type: "function";
|
|
324
|
+
}, {
|
|
325
|
+
readonly inputs: readonly [{
|
|
326
|
+
readonly internalType: "address";
|
|
327
|
+
readonly name: "from";
|
|
328
|
+
readonly type: "address";
|
|
329
|
+
}, {
|
|
330
|
+
readonly internalType: "uint256";
|
|
331
|
+
readonly name: "amount";
|
|
332
|
+
readonly type: "uint256";
|
|
333
|
+
}];
|
|
334
|
+
readonly name: "burn";
|
|
335
|
+
readonly outputs: readonly [];
|
|
336
|
+
readonly stateMutability: "nonpayable";
|
|
337
|
+
readonly type: "function";
|
|
338
|
+
}, {
|
|
339
|
+
readonly inputs: readonly [];
|
|
340
|
+
readonly name: "decimals";
|
|
341
|
+
readonly outputs: readonly [{
|
|
342
|
+
readonly internalType: "uint8";
|
|
343
|
+
readonly name: "";
|
|
344
|
+
readonly type: "uint8";
|
|
345
|
+
}];
|
|
346
|
+
readonly stateMutability: "view";
|
|
347
|
+
readonly type: "function";
|
|
348
|
+
}, {
|
|
349
|
+
readonly inputs: readonly [];
|
|
350
|
+
readonly name: "eip712Domain";
|
|
351
|
+
readonly outputs: readonly [{
|
|
352
|
+
readonly internalType: "bytes1";
|
|
353
|
+
readonly name: "fields";
|
|
354
|
+
readonly type: "bytes1";
|
|
355
|
+
}, {
|
|
356
|
+
readonly internalType: "string";
|
|
357
|
+
readonly name: "name";
|
|
358
|
+
readonly type: "string";
|
|
359
|
+
}, {
|
|
360
|
+
readonly internalType: "string";
|
|
361
|
+
readonly name: "version";
|
|
362
|
+
readonly type: "string";
|
|
363
|
+
}, {
|
|
364
|
+
readonly internalType: "uint256";
|
|
365
|
+
readonly name: "chainId";
|
|
366
|
+
readonly type: "uint256";
|
|
367
|
+
}, {
|
|
368
|
+
readonly internalType: "address";
|
|
369
|
+
readonly name: "verifyingContract";
|
|
370
|
+
readonly type: "address";
|
|
371
|
+
}, {
|
|
372
|
+
readonly internalType: "bytes32";
|
|
373
|
+
readonly name: "salt";
|
|
374
|
+
readonly type: "bytes32";
|
|
375
|
+
}, {
|
|
376
|
+
readonly internalType: "uint256[]";
|
|
377
|
+
readonly name: "extensions";
|
|
378
|
+
readonly type: "uint256[]";
|
|
379
|
+
}];
|
|
380
|
+
readonly stateMutability: "view";
|
|
381
|
+
readonly type: "function";
|
|
382
|
+
}, {
|
|
383
|
+
readonly inputs: readonly [{
|
|
384
|
+
readonly internalType: "bytes32";
|
|
385
|
+
readonly name: "role";
|
|
386
|
+
readonly type: "bytes32";
|
|
387
|
+
}];
|
|
388
|
+
readonly name: "getRoleAdmin";
|
|
389
|
+
readonly outputs: readonly [{
|
|
390
|
+
readonly internalType: "bytes32";
|
|
391
|
+
readonly name: "";
|
|
392
|
+
readonly type: "bytes32";
|
|
393
|
+
}];
|
|
394
|
+
readonly stateMutability: "view";
|
|
395
|
+
readonly type: "function";
|
|
396
|
+
}, {
|
|
397
|
+
readonly inputs: readonly [{
|
|
398
|
+
readonly internalType: "bytes32";
|
|
399
|
+
readonly name: "role";
|
|
400
|
+
readonly type: "bytes32";
|
|
401
|
+
}, {
|
|
402
|
+
readonly internalType: "address";
|
|
403
|
+
readonly name: "account";
|
|
404
|
+
readonly type: "address";
|
|
405
|
+
}];
|
|
406
|
+
readonly name: "grantRole";
|
|
407
|
+
readonly outputs: readonly [];
|
|
408
|
+
readonly stateMutability: "nonpayable";
|
|
409
|
+
readonly type: "function";
|
|
410
|
+
}, {
|
|
411
|
+
readonly inputs: readonly [{
|
|
412
|
+
readonly internalType: "bytes32";
|
|
413
|
+
readonly name: "role";
|
|
414
|
+
readonly type: "bytes32";
|
|
415
|
+
}, {
|
|
416
|
+
readonly internalType: "address";
|
|
417
|
+
readonly name: "account";
|
|
418
|
+
readonly type: "address";
|
|
419
|
+
}];
|
|
420
|
+
readonly name: "hasRole";
|
|
421
|
+
readonly outputs: readonly [{
|
|
422
|
+
readonly internalType: "bool";
|
|
423
|
+
readonly name: "";
|
|
424
|
+
readonly type: "bool";
|
|
425
|
+
}];
|
|
426
|
+
readonly stateMutability: "view";
|
|
427
|
+
readonly type: "function";
|
|
428
|
+
}, {
|
|
429
|
+
readonly inputs: readonly [{
|
|
430
|
+
readonly internalType: "address";
|
|
431
|
+
readonly name: "to";
|
|
432
|
+
readonly type: "address";
|
|
433
|
+
}, {
|
|
434
|
+
readonly internalType: "uint256";
|
|
435
|
+
readonly name: "amount";
|
|
436
|
+
readonly type: "uint256";
|
|
437
|
+
}];
|
|
438
|
+
readonly name: "mint";
|
|
439
|
+
readonly outputs: readonly [];
|
|
440
|
+
readonly stateMutability: "nonpayable";
|
|
441
|
+
readonly type: "function";
|
|
442
|
+
}, {
|
|
443
|
+
readonly inputs: readonly [];
|
|
444
|
+
readonly name: "name";
|
|
445
|
+
readonly outputs: readonly [{
|
|
446
|
+
readonly internalType: "string";
|
|
447
|
+
readonly name: "";
|
|
448
|
+
readonly type: "string";
|
|
449
|
+
}];
|
|
450
|
+
readonly stateMutability: "view";
|
|
451
|
+
readonly type: "function";
|
|
452
|
+
}, {
|
|
453
|
+
readonly inputs: readonly [{
|
|
454
|
+
readonly internalType: "address";
|
|
455
|
+
readonly name: "owner";
|
|
456
|
+
readonly type: "address";
|
|
457
|
+
}];
|
|
458
|
+
readonly name: "nonces";
|
|
459
|
+
readonly outputs: readonly [{
|
|
460
|
+
readonly internalType: "uint256";
|
|
461
|
+
readonly name: "";
|
|
462
|
+
readonly type: "uint256";
|
|
463
|
+
}];
|
|
464
|
+
readonly stateMutability: "view";
|
|
465
|
+
readonly type: "function";
|
|
466
|
+
}, {
|
|
467
|
+
readonly inputs: readonly [{
|
|
468
|
+
readonly internalType: "address";
|
|
469
|
+
readonly name: "owner";
|
|
470
|
+
readonly type: "address";
|
|
471
|
+
}, {
|
|
472
|
+
readonly internalType: "address";
|
|
473
|
+
readonly name: "spender";
|
|
474
|
+
readonly type: "address";
|
|
475
|
+
}, {
|
|
476
|
+
readonly internalType: "uint256";
|
|
477
|
+
readonly name: "value";
|
|
478
|
+
readonly type: "uint256";
|
|
479
|
+
}, {
|
|
480
|
+
readonly internalType: "uint256";
|
|
481
|
+
readonly name: "deadline";
|
|
482
|
+
readonly type: "uint256";
|
|
483
|
+
}, {
|
|
484
|
+
readonly internalType: "uint8";
|
|
485
|
+
readonly name: "v";
|
|
486
|
+
readonly type: "uint8";
|
|
487
|
+
}, {
|
|
488
|
+
readonly internalType: "bytes32";
|
|
489
|
+
readonly name: "r";
|
|
490
|
+
readonly type: "bytes32";
|
|
491
|
+
}, {
|
|
492
|
+
readonly internalType: "bytes32";
|
|
493
|
+
readonly name: "s";
|
|
494
|
+
readonly type: "bytes32";
|
|
495
|
+
}];
|
|
496
|
+
readonly name: "permit";
|
|
497
|
+
readonly outputs: readonly [];
|
|
498
|
+
readonly stateMutability: "nonpayable";
|
|
499
|
+
readonly type: "function";
|
|
500
|
+
}, {
|
|
501
|
+
readonly inputs: readonly [{
|
|
502
|
+
readonly internalType: "bytes32";
|
|
503
|
+
readonly name: "role";
|
|
504
|
+
readonly type: "bytes32";
|
|
505
|
+
}, {
|
|
506
|
+
readonly internalType: "address";
|
|
507
|
+
readonly name: "callerConfirmation";
|
|
508
|
+
readonly type: "address";
|
|
509
|
+
}];
|
|
510
|
+
readonly name: "renounceRole";
|
|
511
|
+
readonly outputs: readonly [];
|
|
512
|
+
readonly stateMutability: "nonpayable";
|
|
513
|
+
readonly type: "function";
|
|
514
|
+
}, {
|
|
515
|
+
readonly inputs: readonly [{
|
|
516
|
+
readonly internalType: "bytes32";
|
|
517
|
+
readonly name: "role";
|
|
518
|
+
readonly type: "bytes32";
|
|
519
|
+
}, {
|
|
520
|
+
readonly internalType: "address";
|
|
521
|
+
readonly name: "account";
|
|
522
|
+
readonly type: "address";
|
|
523
|
+
}];
|
|
524
|
+
readonly name: "revokeRole";
|
|
525
|
+
readonly outputs: readonly [];
|
|
526
|
+
readonly stateMutability: "nonpayable";
|
|
527
|
+
readonly type: "function";
|
|
528
|
+
}, {
|
|
529
|
+
readonly inputs: readonly [{
|
|
530
|
+
readonly internalType: "bytes4";
|
|
531
|
+
readonly name: "interfaceId";
|
|
532
|
+
readonly type: "bytes4";
|
|
533
|
+
}];
|
|
534
|
+
readonly name: "supportsInterface";
|
|
535
|
+
readonly outputs: readonly [{
|
|
536
|
+
readonly internalType: "bool";
|
|
537
|
+
readonly name: "";
|
|
538
|
+
readonly type: "bool";
|
|
539
|
+
}];
|
|
540
|
+
readonly stateMutability: "view";
|
|
541
|
+
readonly type: "function";
|
|
542
|
+
}, {
|
|
543
|
+
readonly inputs: readonly [];
|
|
544
|
+
readonly name: "symbol";
|
|
545
|
+
readonly outputs: readonly [{
|
|
546
|
+
readonly internalType: "string";
|
|
547
|
+
readonly name: "";
|
|
548
|
+
readonly type: "string";
|
|
549
|
+
}];
|
|
550
|
+
readonly stateMutability: "view";
|
|
551
|
+
readonly type: "function";
|
|
552
|
+
}, {
|
|
553
|
+
readonly inputs: readonly [];
|
|
554
|
+
readonly name: "totalSupply";
|
|
555
|
+
readonly outputs: readonly [{
|
|
556
|
+
readonly internalType: "uint256";
|
|
557
|
+
readonly name: "";
|
|
558
|
+
readonly type: "uint256";
|
|
559
|
+
}];
|
|
560
|
+
readonly stateMutability: "view";
|
|
561
|
+
readonly type: "function";
|
|
562
|
+
}, {
|
|
563
|
+
readonly inputs: readonly [{
|
|
564
|
+
readonly internalType: "address";
|
|
565
|
+
readonly name: "to";
|
|
566
|
+
readonly type: "address";
|
|
567
|
+
}, {
|
|
568
|
+
readonly internalType: "uint256";
|
|
569
|
+
readonly name: "value";
|
|
570
|
+
readonly type: "uint256";
|
|
571
|
+
}];
|
|
572
|
+
readonly name: "transfer";
|
|
573
|
+
readonly outputs: readonly [{
|
|
574
|
+
readonly internalType: "bool";
|
|
575
|
+
readonly name: "";
|
|
576
|
+
readonly type: "bool";
|
|
577
|
+
}];
|
|
578
|
+
readonly stateMutability: "nonpayable";
|
|
579
|
+
readonly type: "function";
|
|
580
|
+
}, {
|
|
581
|
+
readonly inputs: readonly [{
|
|
582
|
+
readonly internalType: "address";
|
|
583
|
+
readonly name: "from";
|
|
584
|
+
readonly type: "address";
|
|
585
|
+
}, {
|
|
586
|
+
readonly internalType: "address";
|
|
587
|
+
readonly name: "to";
|
|
588
|
+
readonly type: "address";
|
|
589
|
+
}, {
|
|
590
|
+
readonly internalType: "uint256";
|
|
591
|
+
readonly name: "value";
|
|
592
|
+
readonly type: "uint256";
|
|
593
|
+
}];
|
|
594
|
+
readonly name: "transferFrom";
|
|
595
|
+
readonly outputs: readonly [{
|
|
596
|
+
readonly internalType: "bool";
|
|
597
|
+
readonly name: "";
|
|
598
|
+
readonly type: "bool";
|
|
599
|
+
}];
|
|
600
|
+
readonly stateMutability: "nonpayable";
|
|
601
|
+
readonly type: "function";
|
|
602
|
+
}];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const USDRAbi = [{ "inputs": [], "stateMutability": "nonpayable", "type": "constructor" }, { "inputs": [], "name": "AccessControlBadConfirmation", "type": "error" }, { "inputs": [{ "internalType": "address", "name": "account", "type": "address" }, { "internalType": "bytes32", "name": "neededRole", "type": "bytes32" }], "name": "AccessControlUnauthorizedAccount", "type": "error" }, { "inputs": [], "name": "ECDSAInvalidSignature", "type": "error" }, { "inputs": [{ "internalType": "uint256", "name": "length", "type": "uint256" }], "name": "ECDSAInvalidSignatureLength", "type": "error" }, { "inputs": [{ "internalType": "bytes32", "name": "s", "type": "bytes32" }], "name": "ECDSAInvalidSignatureS", "type": "error" }, { "inputs": [{ "internalType": "address", "name": "spender", "type": "address" }, { "internalType": "uint256", "name": "allowance", "type": "uint256" }, { "internalType": "uint256", "name": "needed", "type": "uint256" }], "name": "ERC20InsufficientAllowance", "type": "error" }, { "inputs": [{ "internalType": "address", "name": "sender", "type": "address" }, { "internalType": "uint256", "name": "balance", "type": "uint256" }, { "internalType": "uint256", "name": "needed", "type": "uint256" }], "name": "ERC20InsufficientBalance", "type": "error" }, { "inputs": [{ "internalType": "address", "name": "approver", "type": "address" }], "name": "ERC20InvalidApprover", "type": "error" }, { "inputs": [{ "internalType": "address", "name": "receiver", "type": "address" }], "name": "ERC20InvalidReceiver", "type": "error" }, { "inputs": [{ "internalType": "address", "name": "sender", "type": "address" }], "name": "ERC20InvalidSender", "type": "error" }, { "inputs": [{ "internalType": "address", "name": "spender", "type": "address" }], "name": "ERC20InvalidSpender", "type": "error" }, { "inputs": [{ "internalType": "uint256", "name": "deadline", "type": "uint256" }], "name": "ERC2612ExpiredSignature", "type": "error" }, { "inputs": [{ "internalType": "address", "name": "signer", "type": "address" }, { "internalType": "address", "name": "owner", "type": "address" }], "name": "ERC2612InvalidSigner", "type": "error" }, { "inputs": [{ "internalType": "address", "name": "account", "type": "address" }, { "internalType": "uint256", "name": "currentNonce", "type": "uint256" }], "name": "InvalidAccountNonce", "type": "error" }, { "inputs": [], "name": "InvalidShortString", "type": "error" }, { "inputs": [{ "internalType": "string", "name": "str", "type": "string" }], "name": "StringTooLong", "type": "error" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "owner", "type": "address" }, { "indexed": true, "internalType": "address", "name": "spender", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "value", "type": "uint256" }], "name": "Approval", "type": "event" }, { "anonymous": false, "inputs": [], "name": "EIP712DomainChanged", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "bytes32", "name": "role", "type": "bytes32" }, { "indexed": true, "internalType": "bytes32", "name": "previousAdminRole", "type": "bytes32" }, { "indexed": true, "internalType": "bytes32", "name": "newAdminRole", "type": "bytes32" }], "name": "RoleAdminChanged", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "bytes32", "name": "role", "type": "bytes32" }, { "indexed": true, "internalType": "address", "name": "account", "type": "address" }, { "indexed": true, "internalType": "address", "name": "sender", "type": "address" }], "name": "RoleGranted", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "bytes32", "name": "role", "type": "bytes32" }, { "indexed": true, "internalType": "address", "name": "account", "type": "address" }, { "indexed": true, "internalType": "address", "name": "sender", "type": "address" }], "name": "RoleRevoked", "type": "event" }, { "anonymous": false, "inputs": [{ "indexed": true, "internalType": "address", "name": "from", "type": "address" }, { "indexed": true, "internalType": "address", "name": "to", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "value", "type": "uint256" }], "name": "Transfer", "type": "event" }, { "inputs": [], "name": "DEFAULT_ADMIN_ROLE", "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "DOMAIN_SEPARATOR", "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "owner", "type": "address" }, { "internalType": "address", "name": "spender", "type": "address" }], "name": "allowance", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "spender", "type": "address" }, { "internalType": "uint256", "name": "value", "type": "uint256" }], "name": "approve", "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "account", "type": "address" }], "name": "balanceOf", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "from", "type": "address" }, { "internalType": "uint256", "name": "amount", "type": "uint256" }], "name": "burn", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "decimals", "outputs": [{ "internalType": "uint8", "name": "", "type": "uint8" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "eip712Domain", "outputs": [{ "internalType": "bytes1", "name": "fields", "type": "bytes1" }, { "internalType": "string", "name": "name", "type": "string" }, { "internalType": "string", "name": "version", "type": "string" }, { "internalType": "uint256", "name": "chainId", "type": "uint256" }, { "internalType": "address", "name": "verifyingContract", "type": "address" }, { "internalType": "bytes32", "name": "salt", "type": "bytes32" }, { "internalType": "uint256[]", "name": "extensions", "type": "uint256[]" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "bytes32", "name": "role", "type": "bytes32" }], "name": "getRoleAdmin", "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "bytes32", "name": "role", "type": "bytes32" }, { "internalType": "address", "name": "account", "type": "address" }], "name": "grantRole", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "bytes32", "name": "role", "type": "bytes32" }, { "internalType": "address", "name": "account", "type": "address" }], "name": "hasRole", "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "to", "type": "address" }, { "internalType": "uint256", "name": "amount", "type": "uint256" }], "name": "mint", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "name", "outputs": [{ "internalType": "string", "name": "", "type": "string" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "owner", "type": "address" }], "name": "nonces", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "owner", "type": "address" }, { "internalType": "address", "name": "spender", "type": "address" }, { "internalType": "uint256", "name": "value", "type": "uint256" }, { "internalType": "uint256", "name": "deadline", "type": "uint256" }, { "internalType": "uint8", "name": "v", "type": "uint8" }, { "internalType": "bytes32", "name": "r", "type": "bytes32" }, { "internalType": "bytes32", "name": "s", "type": "bytes32" }], "name": "permit", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "bytes32", "name": "role", "type": "bytes32" }, { "internalType": "address", "name": "callerConfirmation", "type": "address" }], "name": "renounceRole", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "bytes32", "name": "role", "type": "bytes32" }, { "internalType": "address", "name": "account", "type": "address" }], "name": "revokeRole", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "bytes4", "name": "interfaceId", "type": "bytes4" }], "name": "supportsInterface", "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "symbol", "outputs": [{ "internalType": "string", "name": "", "type": "string" }], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "totalSupply", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "to", "type": "address" }, { "internalType": "uint256", "name": "value", "type": "uint256" }], "name": "transfer", "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [{ "internalType": "address", "name": "from", "type": "address" }, { "internalType": "address", "name": "to", "type": "address" }, { "internalType": "uint256", "name": "value", "type": "uint256" }], "name": "transferFrom", "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], "stateMutability": "nonpayable", "type": "function" }];
|
|
@@ -16,6 +16,7 @@ export declare const ENV_CONFIG: {
|
|
|
16
16
|
readonly tokens: {
|
|
17
17
|
readonly usdt: TokenConfig;
|
|
18
18
|
readonly rain: TokenConfig;
|
|
19
|
+
readonly usdr: TokenConfig;
|
|
19
20
|
};
|
|
20
21
|
};
|
|
21
22
|
readonly stage: {
|
|
@@ -25,6 +26,7 @@ export declare const ENV_CONFIG: {
|
|
|
25
26
|
readonly tokens: {
|
|
26
27
|
readonly usdt: TokenConfig;
|
|
27
28
|
readonly rain: TokenConfig;
|
|
29
|
+
readonly usdr: TokenConfig;
|
|
28
30
|
};
|
|
29
31
|
};
|
|
30
32
|
readonly production: {
|
|
@@ -34,6 +36,7 @@ export declare const ENV_CONFIG: {
|
|
|
34
36
|
readonly tokens: {
|
|
35
37
|
readonly usdt: TokenConfig;
|
|
36
38
|
readonly rain: TokenConfig;
|
|
39
|
+
readonly usdr: TokenConfig;
|
|
37
40
|
};
|
|
38
41
|
};
|
|
39
42
|
};
|
|
@@ -27,6 +27,12 @@ export const ENV_CONFIG = {
|
|
|
27
27
|
decimals: 18,
|
|
28
28
|
oracle_fixed_fee_per_option: 1000000000000000000n, // $1 in 18 decimals
|
|
29
29
|
},
|
|
30
|
+
usdr: {
|
|
31
|
+
address: "0xC1aeb1D39008337E127698c10f6338E93E5f3369",
|
|
32
|
+
symbol: "USDR",
|
|
33
|
+
decimals: 18,
|
|
34
|
+
oracle_fixed_fee_per_option: 1000000000000000000n, // $1 in 18 decimals
|
|
35
|
+
},
|
|
30
36
|
},
|
|
31
37
|
},
|
|
32
38
|
stage: {
|
|
@@ -46,6 +52,12 @@ export const ENV_CONFIG = {
|
|
|
46
52
|
decimals: 18,
|
|
47
53
|
oracle_fixed_fee_per_option: 1000000000000000000n,
|
|
48
54
|
},
|
|
55
|
+
usdr: {
|
|
56
|
+
address: "0xC1aeb1D39008337E127698c10f6338E93E5f3369",
|
|
57
|
+
symbol: "USDR",
|
|
58
|
+
decimals: 18,
|
|
59
|
+
oracle_fixed_fee_per_option: 1000000000000000000n,
|
|
60
|
+
},
|
|
49
61
|
},
|
|
50
62
|
},
|
|
51
63
|
production: {
|
|
@@ -65,6 +77,12 @@ export const ENV_CONFIG = {
|
|
|
65
77
|
decimals: 18,
|
|
66
78
|
oracle_fixed_fee_per_option: 1000000000000000000n,
|
|
67
79
|
},
|
|
80
|
+
usdr: {
|
|
81
|
+
address: "0xC1aeb1D39008337E127698c10f6338E93E5f3369",
|
|
82
|
+
symbol: "USDR",
|
|
83
|
+
decimals: 18,
|
|
84
|
+
oracle_fixed_fee_per_option: 1000000000000000000n,
|
|
85
|
+
},
|
|
68
86
|
},
|
|
69
87
|
},
|
|
70
88
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ export type { ExtendTimeTxParams } from './tx/buildExtendTimeRawTx.js';
|
|
|
9
9
|
export type { CalculateWinnerTxParams } from './tx/buildCalculateWinnerRawTx.js';
|
|
10
10
|
export type { TokenConfig } from './config/environments.js';
|
|
11
11
|
export type { OptionDisputeInfo, OptionAppealInfo } from './markets/getDisputeState.js';
|
|
12
|
+
export { USDRAbi } from './abi/USDRAbi.js';
|
|
12
13
|
export * from './api/index.js';
|
|
13
14
|
export { RainSocket } from './socket/RainSocket.js';
|
|
14
15
|
export type { RainSocketEvent, EnterOptionEventData, ExitOptionEventData, LiquidityEventData, SplitEventData, MergeEventData, RemoveLiquidityEventData, SyncPriceEventData, OrderCreatedEventData, OrderCancelledEventData, OrderFilledEventData, PoolClosedEventData, PoolEventData, WinnerEventData, DisputeOpenedEventData, OracleCreatedEventData, AppealOpenedEventData, DisputeWinnerEventData, AppealWinnerEventData, ClaimRewardEventData, DisputeRefundEventData } from './socket/RainSocket.js';
|
package/dist/index.js
CHANGED
|
@@ -3,5 +3,6 @@ export { RainAA } from './RainAA.js';
|
|
|
3
3
|
export * from './types.js';
|
|
4
4
|
export { TradingModel, OptionSide } from './tx/types.js';
|
|
5
5
|
export { signLoginMessage } from './auth/signMessage.js';
|
|
6
|
+
export { USDRAbi } from './abi/USDRAbi.js';
|
|
6
7
|
export * from './api/index.js';
|
|
7
8
|
export { RainSocket } from './socket/RainSocket.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rain-sdk-v2",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.6",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Rain SDK V2 — TypeScript SDK for Rain prediction markets on Arbitrum. Market creation, trading, liquidity, order book, split/merge, dispute, and smart account support.",
|
|
6
6
|
"main": "dist/index.js",
|