@win-trader/bindings 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/config-manager/dist/index.d.ts +766 -0
- package/config-manager/dist/index.js +313 -0
- package/mock-token/dist/index.d.ts +1448 -0
- package/mock-token/dist/index.js +635 -0
- package/oracle/dist/index.d.ts +421 -0
- package/oracle/dist/index.js +140 -0
- package/oracle-router/dist/index.d.ts +487 -0
- package/oracle-router/dist/index.js +186 -0
- package/package.json +36 -0
- package/position-manager/dist/index.d.ts +709 -0
- package/position-manager/dist/index.js +256 -0
- package/vault/dist/index.d.ts +1914 -0
- package/vault/dist/index.js +776 -0
|
@@ -0,0 +1,1448 @@
|
|
|
1
|
+
import { Buffer } from "buffer";
|
|
2
|
+
import { AssembledTransaction, Client as ContractClient, ClientOptions as ContractClientOptions, MethodOptions } from "@stellar/stellar-sdk/contract";
|
|
3
|
+
import type { u32, u64, i128, Option } from "@stellar/stellar-sdk/contract";
|
|
4
|
+
export * from "@stellar/stellar-sdk";
|
|
5
|
+
export * as contract from "@stellar/stellar-sdk/contract";
|
|
6
|
+
export * as rpc from "@stellar/stellar-sdk/rpc";
|
|
7
|
+
export interface OwnerTokensKey {
|
|
8
|
+
index: u32;
|
|
9
|
+
owner: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Storage keys for the data associated with the enumerable extension of
|
|
13
|
+
* `NonFungibleToken`
|
|
14
|
+
*/
|
|
15
|
+
export type NFTEnumerableStorageKey = {
|
|
16
|
+
tag: "TotalSupply";
|
|
17
|
+
values: void;
|
|
18
|
+
} | {
|
|
19
|
+
tag: "OwnerTokens";
|
|
20
|
+
values: readonly [OwnerTokensKey];
|
|
21
|
+
} | {
|
|
22
|
+
tag: "OwnerTokensIndex";
|
|
23
|
+
values: readonly [u32];
|
|
24
|
+
} | {
|
|
25
|
+
tag: "GlobalTokens";
|
|
26
|
+
values: readonly [u32];
|
|
27
|
+
} | {
|
|
28
|
+
tag: "GlobalTokensIndex";
|
|
29
|
+
values: readonly [u32];
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* Storage keys for the data associated with the consecutive extension of
|
|
33
|
+
* `NonFungibleToken`
|
|
34
|
+
*/
|
|
35
|
+
export type NFTConsecutiveStorageKey = {
|
|
36
|
+
tag: "Approval";
|
|
37
|
+
values: readonly [u32];
|
|
38
|
+
} | {
|
|
39
|
+
tag: "Owner";
|
|
40
|
+
values: readonly [u32];
|
|
41
|
+
} | {
|
|
42
|
+
tag: "OwnershipBucket";
|
|
43
|
+
values: readonly [u32];
|
|
44
|
+
} | {
|
|
45
|
+
tag: "BurnedToken";
|
|
46
|
+
values: readonly [u32];
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* Storage container for royalty information
|
|
50
|
+
*/
|
|
51
|
+
export interface RoyaltyInfo {
|
|
52
|
+
basis_points: u32;
|
|
53
|
+
receiver: string;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Storage keys for royalty data
|
|
57
|
+
*/
|
|
58
|
+
export type NFTRoyaltiesStorageKey = {
|
|
59
|
+
tag: "DefaultRoyalty";
|
|
60
|
+
values: void;
|
|
61
|
+
} | {
|
|
62
|
+
tag: "TokenRoyalty";
|
|
63
|
+
values: readonly [u32];
|
|
64
|
+
};
|
|
65
|
+
export declare const NonFungibleTokenError: {
|
|
66
|
+
/**
|
|
67
|
+
* Indicates a non-existent `token_id`.
|
|
68
|
+
*/
|
|
69
|
+
200: {
|
|
70
|
+
message: string;
|
|
71
|
+
};
|
|
72
|
+
/**
|
|
73
|
+
* Indicates an error related to the ownership over a particular token.
|
|
74
|
+
* Used in transfers.
|
|
75
|
+
*/
|
|
76
|
+
201: {
|
|
77
|
+
message: string;
|
|
78
|
+
};
|
|
79
|
+
/**
|
|
80
|
+
* Indicates a failure with the `operator`s approval. Used in transfers.
|
|
81
|
+
*/
|
|
82
|
+
202: {
|
|
83
|
+
message: string;
|
|
84
|
+
};
|
|
85
|
+
/**
|
|
86
|
+
* Indicates a failure with the `approver` of a token to be approved. Used
|
|
87
|
+
* in approvals.
|
|
88
|
+
*/
|
|
89
|
+
203: {
|
|
90
|
+
message: string;
|
|
91
|
+
};
|
|
92
|
+
/**
|
|
93
|
+
* Indicates an invalid value for `live_until_ledger` when setting
|
|
94
|
+
* approvals.
|
|
95
|
+
*/
|
|
96
|
+
204: {
|
|
97
|
+
message: string;
|
|
98
|
+
};
|
|
99
|
+
/**
|
|
100
|
+
* Indicates overflow when adding two values
|
|
101
|
+
*/
|
|
102
|
+
205: {
|
|
103
|
+
message: string;
|
|
104
|
+
};
|
|
105
|
+
/**
|
|
106
|
+
* Indicates all possible `token_id`s are already in use.
|
|
107
|
+
*/
|
|
108
|
+
206: {
|
|
109
|
+
message: string;
|
|
110
|
+
};
|
|
111
|
+
/**
|
|
112
|
+
* Indicates an invalid amount to batch mint in `consecutive` extension.
|
|
113
|
+
*/
|
|
114
|
+
207: {
|
|
115
|
+
message: string;
|
|
116
|
+
};
|
|
117
|
+
/**
|
|
118
|
+
* Indicates the token does not exist in owner's list.
|
|
119
|
+
*/
|
|
120
|
+
208: {
|
|
121
|
+
message: string;
|
|
122
|
+
};
|
|
123
|
+
/**
|
|
124
|
+
* Indicates the token does not exist in global list.
|
|
125
|
+
*/
|
|
126
|
+
209: {
|
|
127
|
+
message: string;
|
|
128
|
+
};
|
|
129
|
+
/**
|
|
130
|
+
* Indicates access to unset metadata.
|
|
131
|
+
*/
|
|
132
|
+
210: {
|
|
133
|
+
message: string;
|
|
134
|
+
};
|
|
135
|
+
/**
|
|
136
|
+
* Indicates the length of the base URI exceeds the maximum allowed.
|
|
137
|
+
*/
|
|
138
|
+
211: {
|
|
139
|
+
message: string;
|
|
140
|
+
};
|
|
141
|
+
/**
|
|
142
|
+
* Indicates the royalty amount is higher than 10_000 (100%) basis points.
|
|
143
|
+
*/
|
|
144
|
+
212: {
|
|
145
|
+
message: string;
|
|
146
|
+
};
|
|
147
|
+
/**
|
|
148
|
+
* Indicates the length of the name exceeds the maximum allowed.
|
|
149
|
+
*/
|
|
150
|
+
213: {
|
|
151
|
+
message: string;
|
|
152
|
+
};
|
|
153
|
+
/**
|
|
154
|
+
* Indicates the length of the symbol exceeds the maximum allowed.
|
|
155
|
+
*/
|
|
156
|
+
214: {
|
|
157
|
+
message: string;
|
|
158
|
+
};
|
|
159
|
+
};
|
|
160
|
+
export type NFTSequentialStorageKey = {
|
|
161
|
+
tag: "TokenIdCounter";
|
|
162
|
+
values: void;
|
|
163
|
+
};
|
|
164
|
+
/**
|
|
165
|
+
* Storage container for token metadata
|
|
166
|
+
*/
|
|
167
|
+
export interface Metadata {
|
|
168
|
+
base_uri: string;
|
|
169
|
+
name: string;
|
|
170
|
+
symbol: string;
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* Storage container for the token for which an approval is granted
|
|
174
|
+
* and the ledger number at which this approval expires.
|
|
175
|
+
*/
|
|
176
|
+
export interface ApprovalData {
|
|
177
|
+
approved: string;
|
|
178
|
+
live_until_ledger: u32;
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* Storage keys for the data associated with `NonFungibleToken`
|
|
182
|
+
*/
|
|
183
|
+
export type NFTStorageKey = {
|
|
184
|
+
tag: "Owner";
|
|
185
|
+
values: readonly [u32];
|
|
186
|
+
} | {
|
|
187
|
+
tag: "Balance";
|
|
188
|
+
values: readonly [string];
|
|
189
|
+
} | {
|
|
190
|
+
tag: "Approval";
|
|
191
|
+
values: readonly [u32];
|
|
192
|
+
} | {
|
|
193
|
+
tag: "ApprovalForAll";
|
|
194
|
+
values: readonly [string, string];
|
|
195
|
+
} | {
|
|
196
|
+
tag: "Metadata";
|
|
197
|
+
values: void;
|
|
198
|
+
};
|
|
199
|
+
/**
|
|
200
|
+
* Hook types for modular compliance system.
|
|
201
|
+
*
|
|
202
|
+
* Each hook type represents a specific event or validation point
|
|
203
|
+
* where compliance modules can be executed.
|
|
204
|
+
*/
|
|
205
|
+
export type ComplianceHook = {
|
|
206
|
+
tag: "Transferred";
|
|
207
|
+
values: void;
|
|
208
|
+
} | {
|
|
209
|
+
tag: "Created";
|
|
210
|
+
values: void;
|
|
211
|
+
} | {
|
|
212
|
+
tag: "Destroyed";
|
|
213
|
+
values: void;
|
|
214
|
+
} | {
|
|
215
|
+
tag: "CanTransfer";
|
|
216
|
+
values: void;
|
|
217
|
+
} | {
|
|
218
|
+
tag: "CanCreate";
|
|
219
|
+
values: void;
|
|
220
|
+
};
|
|
221
|
+
export declare const ComplianceError: {
|
|
222
|
+
/**
|
|
223
|
+
* Indicates a module is already registered for this hook.
|
|
224
|
+
*/
|
|
225
|
+
360: {
|
|
226
|
+
message: string;
|
|
227
|
+
};
|
|
228
|
+
/**
|
|
229
|
+
* Indicates a module is not registered for this hook.
|
|
230
|
+
*/
|
|
231
|
+
361: {
|
|
232
|
+
message: string;
|
|
233
|
+
};
|
|
234
|
+
/**
|
|
235
|
+
* Indicates a module bound is exceeded.
|
|
236
|
+
*/
|
|
237
|
+
362: {
|
|
238
|
+
message: string;
|
|
239
|
+
};
|
|
240
|
+
/**
|
|
241
|
+
* Indicates a token is not bound to this compliance contract.
|
|
242
|
+
*/
|
|
243
|
+
363: {
|
|
244
|
+
message: string;
|
|
245
|
+
};
|
|
246
|
+
};
|
|
247
|
+
/**
|
|
248
|
+
* Storage keys for the modular compliance contract.
|
|
249
|
+
*/
|
|
250
|
+
export type ComplianceDataKey = {
|
|
251
|
+
tag: "HookModules";
|
|
252
|
+
values: readonly [ComplianceHook];
|
|
253
|
+
};
|
|
254
|
+
/**
|
|
255
|
+
* Error codes for document management operations.
|
|
256
|
+
*/
|
|
257
|
+
export declare const DocumentError: {
|
|
258
|
+
/**
|
|
259
|
+
* The specified document was not found.
|
|
260
|
+
*/
|
|
261
|
+
380: {
|
|
262
|
+
message: string;
|
|
263
|
+
};
|
|
264
|
+
/**
|
|
265
|
+
* Maximum number of documents has been reached.
|
|
266
|
+
*/
|
|
267
|
+
381: {
|
|
268
|
+
message: string;
|
|
269
|
+
};
|
|
270
|
+
/**
|
|
271
|
+
* The URI exceeds the maximum allowed length.
|
|
272
|
+
*/
|
|
273
|
+
382: {
|
|
274
|
+
message: string;
|
|
275
|
+
};
|
|
276
|
+
};
|
|
277
|
+
/**
|
|
278
|
+
* Represents a document with its metadata.
|
|
279
|
+
*/
|
|
280
|
+
export interface Document {
|
|
281
|
+
/**
|
|
282
|
+
* The hash of the document contents.
|
|
283
|
+
*/
|
|
284
|
+
document_hash: Buffer;
|
|
285
|
+
/**
|
|
286
|
+
* Timestamp when the document was last modified.
|
|
287
|
+
*/
|
|
288
|
+
timestamp: u64;
|
|
289
|
+
/**
|
|
290
|
+
* The URI where the document can be accessed.
|
|
291
|
+
*/
|
|
292
|
+
uri: string;
|
|
293
|
+
}
|
|
294
|
+
/**
|
|
295
|
+
* Storage keys for document management.
|
|
296
|
+
*/
|
|
297
|
+
export type DocumentStorageKey = {
|
|
298
|
+
tag: "Index";
|
|
299
|
+
values: readonly [Buffer];
|
|
300
|
+
} | {
|
|
301
|
+
tag: "Bucket";
|
|
302
|
+
values: readonly [u32];
|
|
303
|
+
} | {
|
|
304
|
+
tag: "Count";
|
|
305
|
+
values: void;
|
|
306
|
+
};
|
|
307
|
+
export declare const ClaimIssuerError: {
|
|
308
|
+
/**
|
|
309
|
+
* Signature data length does not match the expected scheme.
|
|
310
|
+
*/
|
|
311
|
+
350: {
|
|
312
|
+
message: string;
|
|
313
|
+
};
|
|
314
|
+
/**
|
|
315
|
+
* The provided key is empty.
|
|
316
|
+
*/
|
|
317
|
+
351: {
|
|
318
|
+
message: string;
|
|
319
|
+
};
|
|
320
|
+
/**
|
|
321
|
+
* The key is already allowed for the specified topic.
|
|
322
|
+
*/
|
|
323
|
+
352: {
|
|
324
|
+
message: string;
|
|
325
|
+
};
|
|
326
|
+
/**
|
|
327
|
+
* The specified key was not found in the allowed keys.
|
|
328
|
+
*/
|
|
329
|
+
353: {
|
|
330
|
+
message: string;
|
|
331
|
+
};
|
|
332
|
+
/**
|
|
333
|
+
* The claim issuer is not allowed to sign claims about the specified
|
|
334
|
+
* claim topic.
|
|
335
|
+
*/
|
|
336
|
+
354: {
|
|
337
|
+
message: string;
|
|
338
|
+
};
|
|
339
|
+
/**
|
|
340
|
+
* Maximum limit exceeded (keys per topic or registries per key).
|
|
341
|
+
*/
|
|
342
|
+
355: {
|
|
343
|
+
message: string;
|
|
344
|
+
};
|
|
345
|
+
/**
|
|
346
|
+
* No signing keys found for the specified claim topic.
|
|
347
|
+
*/
|
|
348
|
+
356: {
|
|
349
|
+
message: string;
|
|
350
|
+
};
|
|
351
|
+
/**
|
|
352
|
+
* Invalid claim data encoding.
|
|
353
|
+
*/
|
|
354
|
+
357: {
|
|
355
|
+
message: string;
|
|
356
|
+
};
|
|
357
|
+
/**
|
|
358
|
+
* Recovery of the Secp256k1 public key failed.
|
|
359
|
+
*/
|
|
360
|
+
358: {
|
|
361
|
+
message: string;
|
|
362
|
+
};
|
|
363
|
+
/**
|
|
364
|
+
* Indicates overflow when adding two values.
|
|
365
|
+
*/
|
|
366
|
+
359: {
|
|
367
|
+
message: string;
|
|
368
|
+
};
|
|
369
|
+
};
|
|
370
|
+
export interface SigningKey {
|
|
371
|
+
public_key: Buffer;
|
|
372
|
+
scheme: u32;
|
|
373
|
+
}
|
|
374
|
+
/**
|
|
375
|
+
* Signature data for Ed25519 scheme.
|
|
376
|
+
*/
|
|
377
|
+
export interface Ed25519SignatureData {
|
|
378
|
+
public_key: Buffer;
|
|
379
|
+
signature: Buffer;
|
|
380
|
+
}
|
|
381
|
+
/**
|
|
382
|
+
* Storage keys for claim issuer key management.
|
|
383
|
+
*/
|
|
384
|
+
export type ClaimIssuerStorageKey = {
|
|
385
|
+
tag: "Topics";
|
|
386
|
+
values: readonly [u32];
|
|
387
|
+
} | {
|
|
388
|
+
tag: "Pairs";
|
|
389
|
+
values: readonly [SigningKey];
|
|
390
|
+
} | {
|
|
391
|
+
tag: "RevokedClaim";
|
|
392
|
+
values: readonly [Buffer];
|
|
393
|
+
} | {
|
|
394
|
+
tag: "ClaimNonce";
|
|
395
|
+
values: readonly [string, u32];
|
|
396
|
+
};
|
|
397
|
+
/**
|
|
398
|
+
* Signature data for Secp256k1 scheme.
|
|
399
|
+
*/
|
|
400
|
+
export interface Secp256k1SignatureData {
|
|
401
|
+
public_key: Buffer;
|
|
402
|
+
recovery_id: u32;
|
|
403
|
+
signature: Buffer;
|
|
404
|
+
}
|
|
405
|
+
/**
|
|
406
|
+
* Signature data for Secp256r1 scheme.
|
|
407
|
+
*/
|
|
408
|
+
export interface Secp256r1SignatureData {
|
|
409
|
+
public_key: Buffer;
|
|
410
|
+
signature: Buffer;
|
|
411
|
+
}
|
|
412
|
+
export declare const ClaimsError: {
|
|
413
|
+
/**
|
|
414
|
+
* Claim ID does not exist.
|
|
415
|
+
*/
|
|
416
|
+
340: {
|
|
417
|
+
message: string;
|
|
418
|
+
};
|
|
419
|
+
/**
|
|
420
|
+
* Claim Issuer cannot validate the claim (revocation, signature mismatch,
|
|
421
|
+
* unauthorized signing key, etc.)
|
|
422
|
+
*/
|
|
423
|
+
341: {
|
|
424
|
+
message: string;
|
|
425
|
+
};
|
|
426
|
+
};
|
|
427
|
+
/**
|
|
428
|
+
* Represents a claim stored on-chain.
|
|
429
|
+
*/
|
|
430
|
+
export interface Claim {
|
|
431
|
+
/**
|
|
432
|
+
* The claim data
|
|
433
|
+
*/
|
|
434
|
+
data: Buffer;
|
|
435
|
+
/**
|
|
436
|
+
* The address of the claim issuer
|
|
437
|
+
*/
|
|
438
|
+
issuer: string;
|
|
439
|
+
/**
|
|
440
|
+
* The signature scheme used
|
|
441
|
+
*/
|
|
442
|
+
scheme: u32;
|
|
443
|
+
/**
|
|
444
|
+
* The cryptographic signature
|
|
445
|
+
*/
|
|
446
|
+
signature: Buffer;
|
|
447
|
+
/**
|
|
448
|
+
* The claim topic (numeric identifier)
|
|
449
|
+
*/
|
|
450
|
+
topic: u32;
|
|
451
|
+
/**
|
|
452
|
+
* Optional URI for additional information
|
|
453
|
+
*/
|
|
454
|
+
uri: string;
|
|
455
|
+
}
|
|
456
|
+
/**
|
|
457
|
+
* Storage keys for the data associated with Identity Claims.
|
|
458
|
+
*/
|
|
459
|
+
export type ClaimsStorageKey = {
|
|
460
|
+
tag: "Claim";
|
|
461
|
+
values: readonly [Buffer];
|
|
462
|
+
} | {
|
|
463
|
+
tag: "ClaimsByTopic";
|
|
464
|
+
values: readonly [u32];
|
|
465
|
+
};
|
|
466
|
+
/**
|
|
467
|
+
* Storage keys for the data associated with `RWA` token
|
|
468
|
+
*/
|
|
469
|
+
export type IdentityVerifierStorageKey = {
|
|
470
|
+
tag: "ClaimTopicsAndIssuers";
|
|
471
|
+
values: void;
|
|
472
|
+
} | {
|
|
473
|
+
tag: "IdentityRegistryStorage";
|
|
474
|
+
values: void;
|
|
475
|
+
};
|
|
476
|
+
export declare const RWAError: {
|
|
477
|
+
/**
|
|
478
|
+
* Indicates an error related to insufficient balance for the operation.
|
|
479
|
+
*/
|
|
480
|
+
300: {
|
|
481
|
+
message: string;
|
|
482
|
+
};
|
|
483
|
+
/**
|
|
484
|
+
* Indicates an error when an input must be >= 0.
|
|
485
|
+
*/
|
|
486
|
+
301: {
|
|
487
|
+
message: string;
|
|
488
|
+
};
|
|
489
|
+
/**
|
|
490
|
+
* Indicates the address is frozen and cannot perform operations.
|
|
491
|
+
*/
|
|
492
|
+
302: {
|
|
493
|
+
message: string;
|
|
494
|
+
};
|
|
495
|
+
/**
|
|
496
|
+
* Indicates insufficient free tokens (due to partial freezing).
|
|
497
|
+
*/
|
|
498
|
+
303: {
|
|
499
|
+
message: string;
|
|
500
|
+
};
|
|
501
|
+
/**
|
|
502
|
+
* Indicates an identity cannot be verified.
|
|
503
|
+
*/
|
|
504
|
+
304: {
|
|
505
|
+
message: string;
|
|
506
|
+
};
|
|
507
|
+
/**
|
|
508
|
+
* Indicates the transfer does not comply with the compliance rules.
|
|
509
|
+
*/
|
|
510
|
+
305: {
|
|
511
|
+
message: string;
|
|
512
|
+
};
|
|
513
|
+
/**
|
|
514
|
+
* Indicates the mint operation does not comply with the compliance rules.
|
|
515
|
+
*/
|
|
516
|
+
306: {
|
|
517
|
+
message: string;
|
|
518
|
+
};
|
|
519
|
+
/**
|
|
520
|
+
* Indicates the compliance contract is not set.
|
|
521
|
+
*/
|
|
522
|
+
307: {
|
|
523
|
+
message: string;
|
|
524
|
+
};
|
|
525
|
+
/**
|
|
526
|
+
* Indicates the onchain ID is not set.
|
|
527
|
+
*/
|
|
528
|
+
308: {
|
|
529
|
+
message: string;
|
|
530
|
+
};
|
|
531
|
+
/**
|
|
532
|
+
* Indicates the version is not set.
|
|
533
|
+
*/
|
|
534
|
+
309: {
|
|
535
|
+
message: string;
|
|
536
|
+
};
|
|
537
|
+
/**
|
|
538
|
+
* Indicates the claim topics and issuers contract is not set.
|
|
539
|
+
*/
|
|
540
|
+
310: {
|
|
541
|
+
message: string;
|
|
542
|
+
};
|
|
543
|
+
/**
|
|
544
|
+
* Indicates the identity registry storage contract is not set.
|
|
545
|
+
*/
|
|
546
|
+
311: {
|
|
547
|
+
message: string;
|
|
548
|
+
};
|
|
549
|
+
/**
|
|
550
|
+
* Indicates the identity verifier contract is not set.
|
|
551
|
+
*/
|
|
552
|
+
312: {
|
|
553
|
+
message: string;
|
|
554
|
+
};
|
|
555
|
+
/**
|
|
556
|
+
* Indicates the old account and new account have different identities.
|
|
557
|
+
*/
|
|
558
|
+
313: {
|
|
559
|
+
message: string;
|
|
560
|
+
};
|
|
561
|
+
};
|
|
562
|
+
export declare const ClaimTopicsAndIssuersError: {
|
|
563
|
+
/**
|
|
564
|
+
* Indicates a non-existent claim topic.
|
|
565
|
+
*/
|
|
566
|
+
370: {
|
|
567
|
+
message: string;
|
|
568
|
+
};
|
|
569
|
+
/**
|
|
570
|
+
* Indicates a non-existent trusted issuer.
|
|
571
|
+
*/
|
|
572
|
+
371: {
|
|
573
|
+
message: string;
|
|
574
|
+
};
|
|
575
|
+
/**
|
|
576
|
+
* Indicates a claim topic already exists.
|
|
577
|
+
*/
|
|
578
|
+
372: {
|
|
579
|
+
message: string;
|
|
580
|
+
};
|
|
581
|
+
/**
|
|
582
|
+
* Indicates a trusted issuer already exists.
|
|
583
|
+
*/
|
|
584
|
+
373: {
|
|
585
|
+
message: string;
|
|
586
|
+
};
|
|
587
|
+
/**
|
|
588
|
+
* Indicates max claim topics limit is reached.
|
|
589
|
+
*/
|
|
590
|
+
374: {
|
|
591
|
+
message: string;
|
|
592
|
+
};
|
|
593
|
+
/**
|
|
594
|
+
* Indicates max trusted issuers limit is reached.
|
|
595
|
+
*/
|
|
596
|
+
375: {
|
|
597
|
+
message: string;
|
|
598
|
+
};
|
|
599
|
+
/**
|
|
600
|
+
* Indicates claim topics set provided for the issuer cannot be empty.
|
|
601
|
+
*/
|
|
602
|
+
376: {
|
|
603
|
+
message: string;
|
|
604
|
+
};
|
|
605
|
+
};
|
|
606
|
+
/**
|
|
607
|
+
* Storage keys for the data associated with the claim topics and issuers
|
|
608
|
+
* extension
|
|
609
|
+
*/
|
|
610
|
+
export type ClaimTopicsAndIssuersStorageKey = {
|
|
611
|
+
tag: "ClaimTopics";
|
|
612
|
+
values: void;
|
|
613
|
+
} | {
|
|
614
|
+
tag: "TrustedIssuers";
|
|
615
|
+
values: void;
|
|
616
|
+
} | {
|
|
617
|
+
tag: "IssuerClaimTopics";
|
|
618
|
+
values: readonly [string];
|
|
619
|
+
} | {
|
|
620
|
+
tag: "ClaimTopicIssuers";
|
|
621
|
+
values: readonly [u32];
|
|
622
|
+
};
|
|
623
|
+
/**
|
|
624
|
+
* Error codes for the Identity Registry Storage system.
|
|
625
|
+
*/
|
|
626
|
+
export declare const IRSError: {
|
|
627
|
+
/**
|
|
628
|
+
* An identity already exists for the given account.
|
|
629
|
+
*/
|
|
630
|
+
320: {
|
|
631
|
+
message: string;
|
|
632
|
+
};
|
|
633
|
+
/**
|
|
634
|
+
* No identity found for the given account.
|
|
635
|
+
*/
|
|
636
|
+
321: {
|
|
637
|
+
message: string;
|
|
638
|
+
};
|
|
639
|
+
/**
|
|
640
|
+
* Country data not found at the specified index.
|
|
641
|
+
*/
|
|
642
|
+
322: {
|
|
643
|
+
message: string;
|
|
644
|
+
};
|
|
645
|
+
/**
|
|
646
|
+
* Identity can't be with empty country data list.
|
|
647
|
+
*/
|
|
648
|
+
323: {
|
|
649
|
+
message: string;
|
|
650
|
+
};
|
|
651
|
+
/**
|
|
652
|
+
* The maximum number of country entries has been reached.
|
|
653
|
+
*/
|
|
654
|
+
324: {
|
|
655
|
+
message: string;
|
|
656
|
+
};
|
|
657
|
+
/**
|
|
658
|
+
* Account has been recovered and cannot be used.
|
|
659
|
+
*/
|
|
660
|
+
325: {
|
|
661
|
+
message: string;
|
|
662
|
+
};
|
|
663
|
+
/**
|
|
664
|
+
* Metadata has too many entries (exceeds MAX_METADATA_ENTRIES).
|
|
665
|
+
*/
|
|
666
|
+
326: {
|
|
667
|
+
message: string;
|
|
668
|
+
};
|
|
669
|
+
/**
|
|
670
|
+
* Metadata string value is too long (exceeds MAX_METADATA_STRING_LEN).
|
|
671
|
+
*/
|
|
672
|
+
327: {
|
|
673
|
+
message: string;
|
|
674
|
+
};
|
|
675
|
+
};
|
|
676
|
+
/**
|
|
677
|
+
* A country data containing the country relationship and optional metadata
|
|
678
|
+
*/
|
|
679
|
+
export interface CountryData {
|
|
680
|
+
/**
|
|
681
|
+
* Type of country relationship
|
|
682
|
+
*/
|
|
683
|
+
country: CountryRelation;
|
|
684
|
+
/**
|
|
685
|
+
* Optional metadata (e.g., visa type, validity period)
|
|
686
|
+
*/
|
|
687
|
+
metadata: Option<Map<string, string>>;
|
|
688
|
+
}
|
|
689
|
+
/**
|
|
690
|
+
* Represents the type of identity holder
|
|
691
|
+
*/
|
|
692
|
+
export type IdentityType = {
|
|
693
|
+
tag: "Individual";
|
|
694
|
+
values: void;
|
|
695
|
+
} | {
|
|
696
|
+
tag: "Organization";
|
|
697
|
+
values: void;
|
|
698
|
+
};
|
|
699
|
+
/**
|
|
700
|
+
* Storage keys for the data associated with Identity Storage Registry.
|
|
701
|
+
*/
|
|
702
|
+
export type IRSStorageKey = {
|
|
703
|
+
tag: "Identity";
|
|
704
|
+
values: readonly [string];
|
|
705
|
+
} | {
|
|
706
|
+
tag: "IdentityProfile";
|
|
707
|
+
values: readonly [string];
|
|
708
|
+
} | {
|
|
709
|
+
tag: "RecoveredTo";
|
|
710
|
+
values: readonly [string];
|
|
711
|
+
};
|
|
712
|
+
/**
|
|
713
|
+
* Unified country relationship that can be either individual or organizational
|
|
714
|
+
*/
|
|
715
|
+
export type CountryRelation = {
|
|
716
|
+
tag: "Individual";
|
|
717
|
+
values: readonly [IndividualCountryRelation];
|
|
718
|
+
} | {
|
|
719
|
+
tag: "Organization";
|
|
720
|
+
values: readonly [OrganizationCountryRelation];
|
|
721
|
+
};
|
|
722
|
+
/**
|
|
723
|
+
* Complete identity profile containing identity type and country data
|
|
724
|
+
*/
|
|
725
|
+
export interface IdentityProfile {
|
|
726
|
+
countries: Array<CountryData>;
|
|
727
|
+
identity_type: IdentityType;
|
|
728
|
+
}
|
|
729
|
+
/**
|
|
730
|
+
* Represents different types of country relationships for individuals
|
|
731
|
+
* ISO 3166-1 numeric country code
|
|
732
|
+
*/
|
|
733
|
+
export type IndividualCountryRelation = {
|
|
734
|
+
tag: "Residence";
|
|
735
|
+
values: readonly [u32];
|
|
736
|
+
} | {
|
|
737
|
+
tag: "Citizenship";
|
|
738
|
+
values: readonly [u32];
|
|
739
|
+
} | {
|
|
740
|
+
tag: "SourceOfFunds";
|
|
741
|
+
values: readonly [u32];
|
|
742
|
+
} | {
|
|
743
|
+
tag: "TaxResidency";
|
|
744
|
+
values: readonly [u32];
|
|
745
|
+
} | {
|
|
746
|
+
tag: "Custom";
|
|
747
|
+
values: readonly [string, u32];
|
|
748
|
+
};
|
|
749
|
+
/**
|
|
750
|
+
* Represents different types of country relationships for organizations
|
|
751
|
+
*/
|
|
752
|
+
export type OrganizationCountryRelation = {
|
|
753
|
+
tag: "Incorporation";
|
|
754
|
+
values: readonly [u32];
|
|
755
|
+
} | {
|
|
756
|
+
tag: "OperatingJurisdiction";
|
|
757
|
+
values: readonly [u32];
|
|
758
|
+
} | {
|
|
759
|
+
tag: "TaxJurisdiction";
|
|
760
|
+
values: readonly [u32];
|
|
761
|
+
} | {
|
|
762
|
+
tag: "SourceOfFunds";
|
|
763
|
+
values: readonly [u32];
|
|
764
|
+
} | {
|
|
765
|
+
tag: "Custom";
|
|
766
|
+
values: readonly [string, u32];
|
|
767
|
+
};
|
|
768
|
+
/**
|
|
769
|
+
* Error codes for the Token Binder system.
|
|
770
|
+
*/
|
|
771
|
+
export declare const TokenBinderError: {
|
|
772
|
+
/**
|
|
773
|
+
* The specified token was not found in the bound tokens list.
|
|
774
|
+
*/
|
|
775
|
+
330: {
|
|
776
|
+
message: string;
|
|
777
|
+
};
|
|
778
|
+
/**
|
|
779
|
+
* Attempted to bind a token that is already bound.
|
|
780
|
+
*/
|
|
781
|
+
331: {
|
|
782
|
+
message: string;
|
|
783
|
+
};
|
|
784
|
+
/**
|
|
785
|
+
* Total token capacity (MAX_TOKENS) has been reached.
|
|
786
|
+
*/
|
|
787
|
+
332: {
|
|
788
|
+
message: string;
|
|
789
|
+
};
|
|
790
|
+
/**
|
|
791
|
+
* Batch bind size exceeded.
|
|
792
|
+
*/
|
|
793
|
+
333: {
|
|
794
|
+
message: string;
|
|
795
|
+
};
|
|
796
|
+
/**
|
|
797
|
+
* The batch contains duplicates.
|
|
798
|
+
*/
|
|
799
|
+
334: {
|
|
800
|
+
message: string;
|
|
801
|
+
};
|
|
802
|
+
};
|
|
803
|
+
/**
|
|
804
|
+
* Storage keys for the token binder system.
|
|
805
|
+
*
|
|
806
|
+
* - Tokens are stored in buckets of 100 addresses each
|
|
807
|
+
* - Each bucket is a `Vec<Address>` stored under its bucket index
|
|
808
|
+
* - Total count is tracked separately
|
|
809
|
+
* - When a token is unbound, the last token is moved to fill the gap
|
|
810
|
+
* (swap-remove pattern)
|
|
811
|
+
*/
|
|
812
|
+
export type TokenBinderStorageKey = {
|
|
813
|
+
tag: "TokenBucket";
|
|
814
|
+
values: readonly [u32];
|
|
815
|
+
} | {
|
|
816
|
+
tag: "TotalCount";
|
|
817
|
+
values: void;
|
|
818
|
+
};
|
|
819
|
+
/**
|
|
820
|
+
* Storage keys for the data associated with `RWA` token
|
|
821
|
+
*/
|
|
822
|
+
export type RWAStorageKey = {
|
|
823
|
+
tag: "AddressFrozen";
|
|
824
|
+
values: readonly [string];
|
|
825
|
+
} | {
|
|
826
|
+
tag: "FrozenTokens";
|
|
827
|
+
values: readonly [string];
|
|
828
|
+
} | {
|
|
829
|
+
tag: "Compliance";
|
|
830
|
+
values: void;
|
|
831
|
+
} | {
|
|
832
|
+
tag: "OnchainId";
|
|
833
|
+
values: void;
|
|
834
|
+
} | {
|
|
835
|
+
tag: "Version";
|
|
836
|
+
values: void;
|
|
837
|
+
} | {
|
|
838
|
+
tag: "IdentityVerifier";
|
|
839
|
+
values: void;
|
|
840
|
+
};
|
|
841
|
+
export declare const VaultTokenError: {
|
|
842
|
+
/**
|
|
843
|
+
* Indicates access to uninitialized vault asset address.
|
|
844
|
+
*/
|
|
845
|
+
400: {
|
|
846
|
+
message: string;
|
|
847
|
+
};
|
|
848
|
+
/**
|
|
849
|
+
* Indicates that vault asset address is already set.
|
|
850
|
+
*/
|
|
851
|
+
401: {
|
|
852
|
+
message: string;
|
|
853
|
+
};
|
|
854
|
+
/**
|
|
855
|
+
* Indicates that vault virtual decimals offset is already set.
|
|
856
|
+
*/
|
|
857
|
+
402: {
|
|
858
|
+
message: string;
|
|
859
|
+
};
|
|
860
|
+
/**
|
|
861
|
+
* Indicates the amount is not a valid vault assets value.
|
|
862
|
+
*/
|
|
863
|
+
403: {
|
|
864
|
+
message: string;
|
|
865
|
+
};
|
|
866
|
+
/**
|
|
867
|
+
* Indicates the amount is not a valid vault shares value.
|
|
868
|
+
*/
|
|
869
|
+
404: {
|
|
870
|
+
message: string;
|
|
871
|
+
};
|
|
872
|
+
/**
|
|
873
|
+
* Attempted to deposit more assets than the max amount for address.
|
|
874
|
+
*/
|
|
875
|
+
405: {
|
|
876
|
+
message: string;
|
|
877
|
+
};
|
|
878
|
+
/**
|
|
879
|
+
* Attempted to mint more shares than the max amount for address.
|
|
880
|
+
*/
|
|
881
|
+
406: {
|
|
882
|
+
message: string;
|
|
883
|
+
};
|
|
884
|
+
/**
|
|
885
|
+
* Attempted to withdraw more assets than the max amount for address.
|
|
886
|
+
*/
|
|
887
|
+
407: {
|
|
888
|
+
message: string;
|
|
889
|
+
};
|
|
890
|
+
/**
|
|
891
|
+
* Attempted to redeem more shares than the max amount for address.
|
|
892
|
+
*/
|
|
893
|
+
408: {
|
|
894
|
+
message: string;
|
|
895
|
+
};
|
|
896
|
+
/**
|
|
897
|
+
* Maximum number of decimals offset exceeded
|
|
898
|
+
*/
|
|
899
|
+
409: {
|
|
900
|
+
message: string;
|
|
901
|
+
};
|
|
902
|
+
/**
|
|
903
|
+
* Indicates overflow due to mathematical operations
|
|
904
|
+
*/
|
|
905
|
+
410: {
|
|
906
|
+
message: string;
|
|
907
|
+
};
|
|
908
|
+
};
|
|
909
|
+
/**
|
|
910
|
+
* Storage keys for the data associated with the vault extension
|
|
911
|
+
*/
|
|
912
|
+
export type VaultStorageKey = {
|
|
913
|
+
tag: "AssetAddress";
|
|
914
|
+
values: void;
|
|
915
|
+
} | {
|
|
916
|
+
tag: "VirtualDecimalsOffset";
|
|
917
|
+
values: void;
|
|
918
|
+
};
|
|
919
|
+
/**
|
|
920
|
+
* Storage keys for the data associated with the allowlist extension
|
|
921
|
+
*/
|
|
922
|
+
export type AllowListStorageKey = {
|
|
923
|
+
tag: "Allowed";
|
|
924
|
+
values: readonly [string];
|
|
925
|
+
};
|
|
926
|
+
/**
|
|
927
|
+
* Storage keys for the data associated with the blocklist extension
|
|
928
|
+
*/
|
|
929
|
+
export type BlockListStorageKey = {
|
|
930
|
+
tag: "Blocked";
|
|
931
|
+
values: readonly [string];
|
|
932
|
+
};
|
|
933
|
+
export declare const FungibleTokenError: {
|
|
934
|
+
/**
|
|
935
|
+
* Indicates an error related to the current balance of account from which
|
|
936
|
+
* tokens are expected to be transferred.
|
|
937
|
+
*/
|
|
938
|
+
100: {
|
|
939
|
+
message: string;
|
|
940
|
+
};
|
|
941
|
+
/**
|
|
942
|
+
* Indicates a failure with the allowance mechanism when a given spender
|
|
943
|
+
* doesn't have enough allowance.
|
|
944
|
+
*/
|
|
945
|
+
101: {
|
|
946
|
+
message: string;
|
|
947
|
+
};
|
|
948
|
+
/**
|
|
949
|
+
* Indicates an invalid value for `live_until_ledger` when setting an
|
|
950
|
+
* allowance.
|
|
951
|
+
*/
|
|
952
|
+
102: {
|
|
953
|
+
message: string;
|
|
954
|
+
};
|
|
955
|
+
/**
|
|
956
|
+
* Indicates an error when an input that must be >= 0
|
|
957
|
+
*/
|
|
958
|
+
103: {
|
|
959
|
+
message: string;
|
|
960
|
+
};
|
|
961
|
+
/**
|
|
962
|
+
* Indicates overflow when adding two values
|
|
963
|
+
*/
|
|
964
|
+
104: {
|
|
965
|
+
message: string;
|
|
966
|
+
};
|
|
967
|
+
/**
|
|
968
|
+
* Indicates access to uninitialized metadata
|
|
969
|
+
*/
|
|
970
|
+
105: {
|
|
971
|
+
message: string;
|
|
972
|
+
};
|
|
973
|
+
/**
|
|
974
|
+
* Indicates that the operation would have caused `total_supply` to exceed
|
|
975
|
+
* the `cap`.
|
|
976
|
+
*/
|
|
977
|
+
106: {
|
|
978
|
+
message: string;
|
|
979
|
+
};
|
|
980
|
+
/**
|
|
981
|
+
* Indicates the supplied `cap` is not a valid cap value.
|
|
982
|
+
*/
|
|
983
|
+
107: {
|
|
984
|
+
message: string;
|
|
985
|
+
};
|
|
986
|
+
/**
|
|
987
|
+
* Indicates the Cap was not set.
|
|
988
|
+
*/
|
|
989
|
+
108: {
|
|
990
|
+
message: string;
|
|
991
|
+
};
|
|
992
|
+
/**
|
|
993
|
+
* Indicates the SAC address was not set.
|
|
994
|
+
*/
|
|
995
|
+
109: {
|
|
996
|
+
message: string;
|
|
997
|
+
};
|
|
998
|
+
/**
|
|
999
|
+
* Indicates a SAC address different than expected.
|
|
1000
|
+
*/
|
|
1001
|
+
110: {
|
|
1002
|
+
message: string;
|
|
1003
|
+
};
|
|
1004
|
+
/**
|
|
1005
|
+
* Indicates a missing function parameter in the SAC contract context.
|
|
1006
|
+
*/
|
|
1007
|
+
111: {
|
|
1008
|
+
message: string;
|
|
1009
|
+
};
|
|
1010
|
+
/**
|
|
1011
|
+
* Indicates an invalid function parameter in the SAC contract context.
|
|
1012
|
+
*/
|
|
1013
|
+
112: {
|
|
1014
|
+
message: string;
|
|
1015
|
+
};
|
|
1016
|
+
/**
|
|
1017
|
+
* The user is not allowed to perform this operation
|
|
1018
|
+
*/
|
|
1019
|
+
113: {
|
|
1020
|
+
message: string;
|
|
1021
|
+
};
|
|
1022
|
+
/**
|
|
1023
|
+
* The user is blocked and cannot perform this operation
|
|
1024
|
+
*/
|
|
1025
|
+
114: {
|
|
1026
|
+
message: string;
|
|
1027
|
+
};
|
|
1028
|
+
};
|
|
1029
|
+
/**
|
|
1030
|
+
* Storage key for accessing the SAC address
|
|
1031
|
+
*/
|
|
1032
|
+
export type SACAdminGenericDataKey = {
|
|
1033
|
+
tag: "Sac";
|
|
1034
|
+
values: void;
|
|
1035
|
+
};
|
|
1036
|
+
/**
|
|
1037
|
+
* Storage key for accessing the SAC address
|
|
1038
|
+
*/
|
|
1039
|
+
export type SACAdminWrapperDataKey = {
|
|
1040
|
+
tag: "Sac";
|
|
1041
|
+
values: void;
|
|
1042
|
+
};
|
|
1043
|
+
/**
|
|
1044
|
+
* Storage container for token metadata
|
|
1045
|
+
*/
|
|
1046
|
+
export interface Metadata {
|
|
1047
|
+
decimals: u32;
|
|
1048
|
+
name: string;
|
|
1049
|
+
symbol: string;
|
|
1050
|
+
}
|
|
1051
|
+
/**
|
|
1052
|
+
* Storage keys for the data associated with `FungibleToken`
|
|
1053
|
+
*/
|
|
1054
|
+
export type StorageKey = {
|
|
1055
|
+
tag: "TotalSupply";
|
|
1056
|
+
values: void;
|
|
1057
|
+
} | {
|
|
1058
|
+
tag: "Balance";
|
|
1059
|
+
values: readonly [string];
|
|
1060
|
+
} | {
|
|
1061
|
+
tag: "Allowance";
|
|
1062
|
+
values: readonly [AllowanceKey];
|
|
1063
|
+
};
|
|
1064
|
+
/**
|
|
1065
|
+
* Storage key that maps to [`AllowanceData`]
|
|
1066
|
+
*/
|
|
1067
|
+
export interface AllowanceKey {
|
|
1068
|
+
owner: string;
|
|
1069
|
+
spender: string;
|
|
1070
|
+
}
|
|
1071
|
+
/**
|
|
1072
|
+
* Storage container for the amount of tokens for which an allowance is granted
|
|
1073
|
+
* and the ledger number at which this allowance expires.
|
|
1074
|
+
*/
|
|
1075
|
+
export interface AllowanceData {
|
|
1076
|
+
amount: i128;
|
|
1077
|
+
live_until_ledger: u32;
|
|
1078
|
+
}
|
|
1079
|
+
export declare const UpgradeableError: {
|
|
1080
|
+
/**
|
|
1081
|
+
* When migration is attempted but not allowed due to upgrade state.
|
|
1082
|
+
*/
|
|
1083
|
+
1100: {
|
|
1084
|
+
message: string;
|
|
1085
|
+
};
|
|
1086
|
+
};
|
|
1087
|
+
export declare const MerkleDistributorError: {
|
|
1088
|
+
/**
|
|
1089
|
+
* The merkle root is not set.
|
|
1090
|
+
*/
|
|
1091
|
+
1300: {
|
|
1092
|
+
message: string;
|
|
1093
|
+
};
|
|
1094
|
+
/**
|
|
1095
|
+
* The provided index was already claimed.
|
|
1096
|
+
*/
|
|
1097
|
+
1301: {
|
|
1098
|
+
message: string;
|
|
1099
|
+
};
|
|
1100
|
+
/**
|
|
1101
|
+
* The proof is invalid.
|
|
1102
|
+
*/
|
|
1103
|
+
1302: {
|
|
1104
|
+
message: string;
|
|
1105
|
+
};
|
|
1106
|
+
};
|
|
1107
|
+
/**
|
|
1108
|
+
* Storage keys for the data associated with `MerkleDistributor`
|
|
1109
|
+
*/
|
|
1110
|
+
export type MerkleDistributorStorageKey = {
|
|
1111
|
+
tag: "Root";
|
|
1112
|
+
values: void;
|
|
1113
|
+
} | {
|
|
1114
|
+
tag: "Claimed";
|
|
1115
|
+
values: readonly [u32];
|
|
1116
|
+
};
|
|
1117
|
+
/**
|
|
1118
|
+
* Rounding direction for division operations
|
|
1119
|
+
*/
|
|
1120
|
+
export type Rounding = {
|
|
1121
|
+
tag: "Floor";
|
|
1122
|
+
values: void;
|
|
1123
|
+
} | {
|
|
1124
|
+
tag: "Ceil";
|
|
1125
|
+
values: void;
|
|
1126
|
+
} | {
|
|
1127
|
+
tag: "Truncate";
|
|
1128
|
+
values: void;
|
|
1129
|
+
};
|
|
1130
|
+
export declare const SorobanFixedPointError: {
|
|
1131
|
+
/**
|
|
1132
|
+
* Arithmetic overflow occurred
|
|
1133
|
+
*/
|
|
1134
|
+
1500: {
|
|
1135
|
+
message: string;
|
|
1136
|
+
};
|
|
1137
|
+
/**
|
|
1138
|
+
* Division by zero
|
|
1139
|
+
*/
|
|
1140
|
+
1501: {
|
|
1141
|
+
message: string;
|
|
1142
|
+
};
|
|
1143
|
+
};
|
|
1144
|
+
export declare const CryptoError: {
|
|
1145
|
+
/**
|
|
1146
|
+
* The merkle proof length is out of bounds.
|
|
1147
|
+
*/
|
|
1148
|
+
1400: {
|
|
1149
|
+
message: string;
|
|
1150
|
+
};
|
|
1151
|
+
/**
|
|
1152
|
+
* The index of the leaf is out of bounds.
|
|
1153
|
+
*/
|
|
1154
|
+
1401: {
|
|
1155
|
+
message: string;
|
|
1156
|
+
};
|
|
1157
|
+
/**
|
|
1158
|
+
* No data in hasher state.
|
|
1159
|
+
*/
|
|
1160
|
+
1402: {
|
|
1161
|
+
message: string;
|
|
1162
|
+
};
|
|
1163
|
+
};
|
|
1164
|
+
export declare const PausableError: {
|
|
1165
|
+
/**
|
|
1166
|
+
* The operation failed because the contract is paused.
|
|
1167
|
+
*/
|
|
1168
|
+
1000: {
|
|
1169
|
+
message: string;
|
|
1170
|
+
};
|
|
1171
|
+
/**
|
|
1172
|
+
* The operation failed because the contract is not paused.
|
|
1173
|
+
*/
|
|
1174
|
+
1001: {
|
|
1175
|
+
message: string;
|
|
1176
|
+
};
|
|
1177
|
+
};
|
|
1178
|
+
/**
|
|
1179
|
+
* Storage key for the pausable state
|
|
1180
|
+
*/
|
|
1181
|
+
export type PausableStorageKey = {
|
|
1182
|
+
tag: "Paused";
|
|
1183
|
+
values: void;
|
|
1184
|
+
};
|
|
1185
|
+
export interface Client {
|
|
1186
|
+
/**
|
|
1187
|
+
* Construct and simulate a burn transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
|
|
1188
|
+
* Destroys `amount` of tokens from `from`. Updates the total
|
|
1189
|
+
* supply accordingly.
|
|
1190
|
+
*
|
|
1191
|
+
* # Arguments
|
|
1192
|
+
*
|
|
1193
|
+
* * `e` - Access to the Soroban environment.
|
|
1194
|
+
* * `from` - The account whose tokens are destroyed.
|
|
1195
|
+
* * `amount` - The amount of tokens to burn.
|
|
1196
|
+
*
|
|
1197
|
+
* # Errors
|
|
1198
|
+
*
|
|
1199
|
+
* * [`crate::fungible::FungibleTokenError::InsufficientBalance`] - When
|
|
1200
|
+
* attempting to burn more tokens than `from` current balance.
|
|
1201
|
+
* * [`crate::fungible::FungibleTokenError::LessThanZero`] - When `amount <
|
|
1202
|
+
* 0`.
|
|
1203
|
+
*
|
|
1204
|
+
* # Events
|
|
1205
|
+
*
|
|
1206
|
+
* * topics - `["burn", from: Address]`
|
|
1207
|
+
* * data - `[amount: i128]`
|
|
1208
|
+
*/
|
|
1209
|
+
burn: ({ from, amount }: {
|
|
1210
|
+
from: string;
|
|
1211
|
+
amount: i128;
|
|
1212
|
+
}, options?: MethodOptions) => Promise<AssembledTransaction<null>>;
|
|
1213
|
+
/**
|
|
1214
|
+
* Construct and simulate a mint transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
|
|
1215
|
+
* Mint `amount` tokens to `to`. No access control — test-only.
|
|
1216
|
+
*/
|
|
1217
|
+
mint: ({ to, amount }: {
|
|
1218
|
+
to: string;
|
|
1219
|
+
amount: i128;
|
|
1220
|
+
}, options?: MethodOptions) => Promise<AssembledTransaction<null>>;
|
|
1221
|
+
/**
|
|
1222
|
+
* Construct and simulate a name transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
|
|
1223
|
+
* Returns the name for this token.
|
|
1224
|
+
*
|
|
1225
|
+
* # Arguments
|
|
1226
|
+
*
|
|
1227
|
+
* * `e` - Access to Soroban environment.
|
|
1228
|
+
*/
|
|
1229
|
+
name: (options?: MethodOptions) => Promise<AssembledTransaction<string>>;
|
|
1230
|
+
/**
|
|
1231
|
+
* Construct and simulate a symbol transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
|
|
1232
|
+
* Returns the symbol for this token.
|
|
1233
|
+
*
|
|
1234
|
+
* # Arguments
|
|
1235
|
+
*
|
|
1236
|
+
* * `e` - Access to Soroban environment.
|
|
1237
|
+
*/
|
|
1238
|
+
symbol: (options?: MethodOptions) => Promise<AssembledTransaction<string>>;
|
|
1239
|
+
/**
|
|
1240
|
+
* Construct and simulate a approve transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
|
|
1241
|
+
* Sets the amount of tokens a `spender` is allowed to spend on behalf of
|
|
1242
|
+
* an `owner`. Overrides any existing allowance set between `spender` and
|
|
1243
|
+
* `owner`.
|
|
1244
|
+
*
|
|
1245
|
+
* # Arguments
|
|
1246
|
+
*
|
|
1247
|
+
* * `e` - Access to Soroban environment.
|
|
1248
|
+
* * `owner` - The address holding the tokens.
|
|
1249
|
+
* * `spender` - The address authorized to spend the tokens.
|
|
1250
|
+
* * `amount` - The amount of tokens made available to `spender`.
|
|
1251
|
+
* * `live_until_ledger` - The ledger number at which the allowance
|
|
1252
|
+
* expires.
|
|
1253
|
+
*
|
|
1254
|
+
* # Errors
|
|
1255
|
+
*
|
|
1256
|
+
* * [`FungibleTokenError::InvalidLiveUntilLedger`] - Occurs when
|
|
1257
|
+
* attempting to set `live_until_ledger` that is less than the current
|
|
1258
|
+
* ledger number and greater than `0`.
|
|
1259
|
+
* * [`FungibleTokenError::LessThanZero`] - Occurs when `amount < 0`.
|
|
1260
|
+
*
|
|
1261
|
+
* # Events
|
|
1262
|
+
*
|
|
1263
|
+
* * topics - `["approve", from: Address, spender: Address]`
|
|
1264
|
+
* * data - `[amount: i128, live_until_ledger: u32]`
|
|
1265
|
+
*/
|
|
1266
|
+
approve: ({ owner, spender, amount, live_until_ledger }: {
|
|
1267
|
+
owner: string;
|
|
1268
|
+
spender: string;
|
|
1269
|
+
amount: i128;
|
|
1270
|
+
live_until_ledger: u32;
|
|
1271
|
+
}, options?: MethodOptions) => Promise<AssembledTransaction<null>>;
|
|
1272
|
+
/**
|
|
1273
|
+
* Construct and simulate a balance transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
|
|
1274
|
+
* Returns the amount of tokens held by `account`.
|
|
1275
|
+
*
|
|
1276
|
+
* # Arguments
|
|
1277
|
+
*
|
|
1278
|
+
* * `e` - Access to the Soroban environment.
|
|
1279
|
+
* * `account` - The address for which the balance is being queried.
|
|
1280
|
+
*/
|
|
1281
|
+
balance: ({ account }: {
|
|
1282
|
+
account: string;
|
|
1283
|
+
}, options?: MethodOptions) => Promise<AssembledTransaction<i128>>;
|
|
1284
|
+
/**
|
|
1285
|
+
* Construct and simulate a decimals transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
|
|
1286
|
+
* Returns the number of decimals used to represent amounts of this token.
|
|
1287
|
+
*
|
|
1288
|
+
* # Arguments
|
|
1289
|
+
*
|
|
1290
|
+
* * `e` - Access to Soroban environment.
|
|
1291
|
+
*/
|
|
1292
|
+
decimals: (options?: MethodOptions) => Promise<AssembledTransaction<u32>>;
|
|
1293
|
+
/**
|
|
1294
|
+
* Construct and simulate a transfer transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
|
|
1295
|
+
* Transfers `amount` of tokens from `from` to `to`.
|
|
1296
|
+
*
|
|
1297
|
+
* # Arguments
|
|
1298
|
+
*
|
|
1299
|
+
* * `e` - Access to Soroban environment.
|
|
1300
|
+
* * `from` - The address holding the tokens.
|
|
1301
|
+
* * `to` - The address receiving the transferred tokens.
|
|
1302
|
+
* * `amount` - The amount of tokens to be transferred.
|
|
1303
|
+
*
|
|
1304
|
+
* # Errors
|
|
1305
|
+
*
|
|
1306
|
+
* * [`FungibleTokenError::InsufficientBalance`] - When attempting to
|
|
1307
|
+
* transfer more tokens than `from` current balance.
|
|
1308
|
+
* * [`FungibleTokenError::LessThanZero`] - When `amount < 0`.
|
|
1309
|
+
*
|
|
1310
|
+
* # Events
|
|
1311
|
+
*
|
|
1312
|
+
* * topics - `["transfer", from: Address, to: Address]`
|
|
1313
|
+
* * data - `[to_muxed_id: Option<u64>, amount: i128]`
|
|
1314
|
+
*/
|
|
1315
|
+
transfer: ({ from, to, amount }: {
|
|
1316
|
+
from: string;
|
|
1317
|
+
to: string;
|
|
1318
|
+
amount: i128;
|
|
1319
|
+
}, options?: MethodOptions) => Promise<AssembledTransaction<null>>;
|
|
1320
|
+
/**
|
|
1321
|
+
* Construct and simulate a allowance transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
|
|
1322
|
+
* Returns the amount of tokens a `spender` is allowed to spend on behalf
|
|
1323
|
+
* of an `owner`.
|
|
1324
|
+
*
|
|
1325
|
+
* # Arguments
|
|
1326
|
+
*
|
|
1327
|
+
* * `e` - Access to Soroban environment.
|
|
1328
|
+
* * `owner` - The address holding the tokens.
|
|
1329
|
+
* * `spender` - The address authorized to spend the tokens.
|
|
1330
|
+
*/
|
|
1331
|
+
allowance: ({ owner, spender }: {
|
|
1332
|
+
owner: string;
|
|
1333
|
+
spender: string;
|
|
1334
|
+
}, options?: MethodOptions) => Promise<AssembledTransaction<i128>>;
|
|
1335
|
+
/**
|
|
1336
|
+
* Construct and simulate a burn_from transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
|
|
1337
|
+
* Destroys `amount` of tokens from `from`. Updates the total
|
|
1338
|
+
* supply accordingly.
|
|
1339
|
+
*
|
|
1340
|
+
* # Arguments
|
|
1341
|
+
*
|
|
1342
|
+
* * `e` - Access to the Soroban environment.
|
|
1343
|
+
* * `spender` - The address authorized to burn the tokens.
|
|
1344
|
+
* * `from` - The account whose tokens are destroyed.
|
|
1345
|
+
* * `amount` - The amount of tokens to burn.
|
|
1346
|
+
*
|
|
1347
|
+
* # Errors
|
|
1348
|
+
*
|
|
1349
|
+
* * [`crate::fungible::FungibleTokenError::InsufficientBalance`] - When
|
|
1350
|
+
* attempting to burn more tokens than `from` current balance.
|
|
1351
|
+
* * [`crate::fungible::FungibleTokenError::InsufficientAllowance`] - When
|
|
1352
|
+
* attempting to burn more tokens than `from` allowance.
|
|
1353
|
+
* * [`crate::fungible::FungibleTokenError::LessThanZero`] - When `amount <
|
|
1354
|
+
* 0`.
|
|
1355
|
+
*
|
|
1356
|
+
* # Events
|
|
1357
|
+
*
|
|
1358
|
+
* * topics - `["burn", from: Address]`
|
|
1359
|
+
* * data - `[amount: i128]`
|
|
1360
|
+
*/
|
|
1361
|
+
burn_from: ({ spender, from, amount }: {
|
|
1362
|
+
spender: string;
|
|
1363
|
+
from: string;
|
|
1364
|
+
amount: i128;
|
|
1365
|
+
}, options?: MethodOptions) => Promise<AssembledTransaction<null>>;
|
|
1366
|
+
/**
|
|
1367
|
+
* Construct and simulate a initialize transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
|
|
1368
|
+
* Deploy and configure the mock token.
|
|
1369
|
+
*/
|
|
1370
|
+
initialize: ({ admin, decimals, name, symbol }: {
|
|
1371
|
+
admin: string;
|
|
1372
|
+
decimals: u32;
|
|
1373
|
+
name: string;
|
|
1374
|
+
symbol: string;
|
|
1375
|
+
}, options?: MethodOptions) => Promise<AssembledTransaction<null>>;
|
|
1376
|
+
/**
|
|
1377
|
+
* Construct and simulate a total_supply transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
|
|
1378
|
+
* Returns the total amount of tokens in circulation.
|
|
1379
|
+
*
|
|
1380
|
+
* # Arguments
|
|
1381
|
+
*
|
|
1382
|
+
* * `e` - Access to the Soroban environment.
|
|
1383
|
+
*/
|
|
1384
|
+
total_supply: (options?: MethodOptions) => Promise<AssembledTransaction<i128>>;
|
|
1385
|
+
/**
|
|
1386
|
+
* Construct and simulate a transfer_from transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
|
|
1387
|
+
* Transfers `amount` of tokens from `from` to `to` using the
|
|
1388
|
+
* allowance mechanism. `amount` is then deducted from `spender`
|
|
1389
|
+
* allowance.
|
|
1390
|
+
*
|
|
1391
|
+
* # Arguments
|
|
1392
|
+
*
|
|
1393
|
+
* * `e` - Access to Soroban environment.
|
|
1394
|
+
* * `spender` - The address authorizing the transfer, and having its
|
|
1395
|
+
* allowance consumed during the transfer.
|
|
1396
|
+
* * `from` - The address holding the tokens which will be transferred.
|
|
1397
|
+
* * `to` - The address receiving the transferred tokens.
|
|
1398
|
+
* * `amount` - The amount of tokens to be transferred.
|
|
1399
|
+
*
|
|
1400
|
+
* # Errors
|
|
1401
|
+
*
|
|
1402
|
+
* * [`FungibleTokenError::InsufficientBalance`] - When attempting to
|
|
1403
|
+
* transfer more tokens than `from` current balance.
|
|
1404
|
+
* * [`FungibleTokenError::LessThanZero`] - When `amount < 0`.
|
|
1405
|
+
* * [`FungibleTokenError::InsufficientAllowance`] - When attempting to
|
|
1406
|
+
* transfer more tokens than `spender` current allowance.
|
|
1407
|
+
*
|
|
1408
|
+
* # Events
|
|
1409
|
+
*
|
|
1410
|
+
* * topics - `["transfer", from: Address, to: Address]`
|
|
1411
|
+
* * data - `[amount: i128]`
|
|
1412
|
+
*/
|
|
1413
|
+
transfer_from: ({ spender, from, to, amount }: {
|
|
1414
|
+
spender: string;
|
|
1415
|
+
from: string;
|
|
1416
|
+
to: string;
|
|
1417
|
+
amount: i128;
|
|
1418
|
+
}, options?: MethodOptions) => Promise<AssembledTransaction<null>>;
|
|
1419
|
+
}
|
|
1420
|
+
export declare class Client extends ContractClient {
|
|
1421
|
+
readonly options: ContractClientOptions;
|
|
1422
|
+
static deploy<T = Client>(
|
|
1423
|
+
/** Options for initializing a Client as well as for calling a method, with extras specific to deploying. */
|
|
1424
|
+
options: MethodOptions & Omit<ContractClientOptions, "contractId"> & {
|
|
1425
|
+
/** The hash of the Wasm blob, which must already be installed on-chain. */
|
|
1426
|
+
wasmHash: Buffer | string;
|
|
1427
|
+
/** Salt used to generate the contract's ID. Passed through to {@link Operation.createCustomContract}. Default: random. */
|
|
1428
|
+
salt?: Buffer | Uint8Array;
|
|
1429
|
+
/** The format used to decode `wasmHash`, if it's provided as a string. */
|
|
1430
|
+
format?: "hex" | "base64";
|
|
1431
|
+
}): Promise<AssembledTransaction<T>>;
|
|
1432
|
+
constructor(options: ContractClientOptions);
|
|
1433
|
+
readonly fromJSON: {
|
|
1434
|
+
burn: (json: string) => AssembledTransaction<null>;
|
|
1435
|
+
mint: (json: string) => AssembledTransaction<null>;
|
|
1436
|
+
name: (json: string) => AssembledTransaction<string>;
|
|
1437
|
+
symbol: (json: string) => AssembledTransaction<string>;
|
|
1438
|
+
approve: (json: string) => AssembledTransaction<null>;
|
|
1439
|
+
balance: (json: string) => AssembledTransaction<bigint>;
|
|
1440
|
+
decimals: (json: string) => AssembledTransaction<number>;
|
|
1441
|
+
transfer: (json: string) => AssembledTransaction<null>;
|
|
1442
|
+
allowance: (json: string) => AssembledTransaction<bigint>;
|
|
1443
|
+
burn_from: (json: string) => AssembledTransaction<null>;
|
|
1444
|
+
initialize: (json: string) => AssembledTransaction<null>;
|
|
1445
|
+
total_supply: (json: string) => AssembledTransaction<bigint>;
|
|
1446
|
+
transfer_from: (json: string) => AssembledTransaction<null>;
|
|
1447
|
+
};
|
|
1448
|
+
}
|