@allbridge/bridge-core-sdk 3.15.4-alpha.1 → 3.16.0-alpha.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.
Files changed (52) hide show
  1. package/dist/browser/index.js +3 -3
  2. package/dist/browser/index.js.map +4 -4
  3. package/dist/cjs/index.js +4 -4
  4. package/dist/cjs/index.js.map +4 -4
  5. package/dist/esm/index.js +4 -4
  6. package/dist/esm/index.js.map +4 -4
  7. package/dist/src/services/bridge/srb/index.js +11 -10
  8. package/dist/src/services/bridge/srb/index.js.map +1 -1
  9. package/dist/src/services/bridge/utils.js +1 -1
  10. package/dist/src/services/bridge/utils.js.map +1 -1
  11. package/dist/src/services/liquidity-pool/srb/index.js +17 -14
  12. package/dist/src/services/liquidity-pool/srb/index.js.map +1 -1
  13. package/dist/src/services/models/srb/bridge-contract.d.ts +801 -0
  14. package/dist/src/services/models/srb/{bridge.js → bridge-contract.js} +49 -97
  15. package/dist/src/services/models/srb/bridge-contract.js.map +1 -0
  16. package/dist/src/services/models/srb/gas-oracle-contract.d.ts +350 -0
  17. package/dist/src/services/models/srb/gas-oracle-contract.js +87 -0
  18. package/dist/src/services/models/srb/gas-oracle-contract.js.map +1 -0
  19. package/dist/src/services/models/srb/messenger-contract.d.ts +573 -0
  20. package/dist/src/services/models/srb/messenger-contract.js +111 -0
  21. package/dist/src/services/models/srb/messenger-contract.js.map +1 -0
  22. package/dist/src/services/models/srb/pool-contract.d.ts +690 -0
  23. package/dist/src/services/models/srb/pool-contract.js +125 -0
  24. package/dist/src/services/models/srb/pool-contract.js.map +1 -0
  25. package/dist/src/services/models/srb/token-contract.d.ts +437 -160
  26. package/dist/src/services/models/srb/token-contract.js +41 -288
  27. package/dist/src/services/models/srb/token-contract.js.map +1 -1
  28. package/dist/src/services/models/srb/utils.d.ts +6 -0
  29. package/dist/src/services/models/srb/utils.js +35 -0
  30. package/dist/src/services/models/srb/utils.js.map +1 -0
  31. package/dist/src/services/token/srb/index.js +1 -1
  32. package/dist/src/services/token/srb/index.js.map +1 -1
  33. package/dist/src/utils/srb/index.d.ts +5 -6
  34. package/dist/src/utils/srb/index.js +1 -1
  35. package/dist/src/utils/srb/index.js.map +1 -1
  36. package/dist/src/version.d.ts +1 -1
  37. package/dist/src/version.js +1 -1
  38. package/package.json +2 -2
  39. package/dist/src/services/models/srb/bridge.d.ts +0 -169
  40. package/dist/src/services/models/srb/bridge.js.map +0 -1
  41. package/dist/src/services/models/srb/pool.d.ts +0 -293
  42. package/dist/src/services/models/srb/pool.js +0 -233
  43. package/dist/src/services/models/srb/pool.js.map +0 -1
  44. package/dist/src/services/utils/srb/assembled-tx.d.ts +0 -73
  45. package/dist/src/services/utils/srb/assembled-tx.js +0 -143
  46. package/dist/src/services/utils/srb/assembled-tx.js.map +0 -1
  47. package/dist/src/services/utils/srb/build-tx.d.ts +0 -48
  48. package/dist/src/services/utils/srb/build-tx.js +0 -62
  49. package/dist/src/services/utils/srb/build-tx.js.map +0 -1
  50. package/dist/src/services/utils/srb/method-options.d.ts +0 -47
  51. package/dist/src/services/utils/srb/method-options.js +0 -5
  52. package/dist/src/services/utils/srb/method-options.js.map +0 -1
@@ -1,137 +1,90 @@
1
- import { ContractSpec } from "stellar-sdk";
2
- import type { i128, u32 } from "../../utils/srb/assembled-tx";
3
- import { AssembledTransaction } from "../../utils/srb/assembled-tx";
4
- import type { ClassOptions } from "../../utils/srb/method-options";
5
- export * from "../../utils/srb/assembled-tx";
6
- export * from "../../utils/srb/method-options";
7
- export declare const networks: {
8
- readonly testnet: {
9
- readonly networkPassphrase: "Test SDF Network ; September 2015";
10
- readonly contractId: "CACOK7HB7D7SRPMH3LYYOW77T6D4D2F7TR7UEVKY2TVSUDSRDM6DZVLK";
11
- };
12
- };
13
- /**
14
-
15
- */
16
- export interface AllowanceDataKey {
17
- /**
18
-
19
- */
20
- from: string;
21
- /**
22
-
23
- */
24
- spender: string;
25
- }
26
- /**
27
-
28
- */
29
- export interface AllowanceValue {
30
- /**
31
-
32
- */
33
- amount: i128;
1
+ import { contract } from "@stellar/stellar-sdk";
2
+ import u32 = contract.u32;
3
+ import i128 = contract.i128;
4
+ import AssembledTransaction = contract.AssembledTransaction;
5
+ import ContractClient = contract.Client;
6
+ import ContractClientOptions = contract.ClientOptions;
7
+ export declare const Errors: {};
8
+ export interface TokenContract {
34
9
  /**
35
-
10
+ * 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. *
11
+ * Returns the allowance for `spender` to transfer from `from`.
12
+ *
13
+ * The amount returned is the amount that spender is allowed to transfer
14
+ * out of from's balance. When the spender transfers amounts, the allowance
15
+ * will be reduced by the amount transfered.
16
+ *
17
+ * # Arguments
18
+ *
19
+ * * `from` - The address holding the balance of tokens to be drawn from.
20
+ * * `spender` - The address spending the tokens held by `from`.
36
21
  */
37
- expiration_ledger: u32;
38
- }
39
- /**
40
-
41
- */
42
- export type DataKey = {
43
- tag: "Allowance";
44
- values: readonly [AllowanceDataKey];
45
- } | {
46
- tag: "Balance";
47
- values: readonly [string];
48
- } | {
49
- tag: "Nonce";
50
- values: readonly [string];
51
- } | {
52
- tag: "State";
53
- values: readonly [string];
54
- } | {
55
- tag: "Admin";
56
- values: void;
57
- };
58
- /**
59
-
60
- */
61
- export interface TokenMetadata {
62
- /**
63
-
64
- */
65
- decimal: u32;
66
- /**
67
-
68
- */
69
- name: string;
70
- /**
71
-
72
- */
73
- symbol: string;
74
- }
75
- /**
76
-
77
- */
78
- export declare const Errors: {};
79
- export declare class TokenContract {
80
- readonly options: ClassOptions;
81
- spec: ContractSpec;
82
- constructor(options: ClassOptions);
83
- private readonly parsers;
84
- /**
85
- * 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.
86
- */
87
- initialize: ({ admin, decimal, name, symbol }: {
88
- admin: string;
89
- decimal: u32;
90
- name: string;
91
- symbol: string;
22
+ allowance: ({ from, spender }: {
23
+ from: string;
24
+ spender: string;
92
25
  }, options?: {
93
26
  /**
94
- * The fee to pay for the transaction. Default: 100.
27
+ * The fee to pay for the transaction. Default: BASE_FEE
95
28
  */
96
29
  fee?: number;
97
- }) => Promise<AssembledTransaction<void>>;
98
- /**
99
- * 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.
100
- */
101
- mint: ({ to, amount }: {
102
- to: string;
103
- amount: i128;
104
- }, options?: {
105
30
  /**
106
- * The fee to pay for the transaction. Default: 100.
31
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
107
32
  */
108
- fee?: number;
109
- }) => Promise<AssembledTransaction<void>>;
110
- /**
111
- * Construct and simulate a set_admin 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.
112
- */
113
- setAdmin: ({ new_admin }: {
114
- new_admin: string;
115
- }, options?: {
33
+ timeoutInSeconds?: number;
116
34
  /**
117
- * The fee to pay for the transaction. Default: 100.
35
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
118
36
  */
119
- fee?: number;
120
- }) => Promise<AssembledTransaction<void>>;
37
+ simulate?: boolean;
38
+ }) => Promise<AssembledTransaction<i128>>;
121
39
  /**
122
- * 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.
40
+ * Construct and simulate a authorized 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. *
41
+ * Returns true if `id` is authorized to use its balance.
42
+ *
43
+ * # Arguments
44
+ *
45
+ * * `id` - The address for which token authorization is being checked.
123
46
  */
124
- allowance: ({ from, spender }: {
125
- from: string;
126
- spender: string;
47
+ authorized: ({ id }: {
48
+ id: string;
127
49
  }, options?: {
128
50
  /**
129
- * The fee to pay for the transaction. Default: 100.
51
+ * The fee to pay for the transaction. Default: BASE_FEE
130
52
  */
131
53
  fee?: number;
132
- }) => Promise<AssembledTransaction<bigint>>;
54
+ /**
55
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
56
+ */
57
+ timeoutInSeconds?: number;
58
+ /**
59
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
60
+ */
61
+ simulate?: boolean;
62
+ }) => Promise<AssembledTransaction<boolean>>;
133
63
  /**
134
- * 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.
64
+ * 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. *
65
+ * Set the allowance by `amount` for `spender` to transfer/burn from
66
+ * `from`.
67
+ *
68
+ * The amount set is the amount that spender is approved to transfer out of
69
+ * from's balance. The spender will be allowed to transfer amounts, and
70
+ * when an amount is transferred the allowance will be reduced by the
71
+ * amount transfered.
72
+ *
73
+ * # Arguments
74
+ *
75
+ * * `from` - The address holding the balance of tokens to be drawn from.
76
+ * * `spender` - The address being authorized to spend the tokens held by
77
+ * `from`.
78
+ * * `amount` - The tokens to be made available to `spender`.
79
+ * * `expiration_ledger` - The ledger number where this allowance expires. Cannot
80
+ * be less than the current ledger number unless the amount is being set to 0.
81
+ * An expired entry (where expiration_ledger < the current ledger number)
82
+ * should be treated as a 0 amount allowance.
83
+ *
84
+ * # Events
85
+ *
86
+ * Emits an event with topics `["approve", from: Address,
87
+ * spender: Address], data = [amount: i128, expiration_ledger: u32]`
135
88
  */
136
89
  approve: ({ from, spender, amount, expiration_ledger, }: {
137
90
  from: string;
@@ -140,109 +93,433 @@ export declare class TokenContract {
140
93
  expiration_ledger: u32;
141
94
  }, options?: {
142
95
  /**
143
- * The fee to pay for the transaction. Default: 100.
96
+ * The fee to pay for the transaction. Default: BASE_FEE
144
97
  */
145
98
  fee?: number;
146
- }) => Promise<AssembledTransaction<void>>;
99
+ /**
100
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
101
+ */
102
+ timeoutInSeconds?: number;
103
+ /**
104
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
105
+ */
106
+ simulate?: boolean;
107
+ }) => Promise<AssembledTransaction<null>>;
147
108
  /**
148
- * 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.
109
+ * 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. *
110
+ * Returns the balance of `id`.
111
+ *
112
+ * # Arguments
113
+ *
114
+ * * `id` - The address for which a balance is being queried. If the
115
+ * address has no existing balance, returns 0.
149
116
  */
150
117
  balance: ({ id }: {
151
118
  id: string;
152
119
  }, options?: {
153
120
  /**
154
- * The fee to pay for the transaction. Default: 100.
121
+ * The fee to pay for the transaction. Default: BASE_FEE
155
122
  */
156
123
  fee?: number;
157
- }) => Promise<AssembledTransaction<bigint>>;
158
- /**
159
- * Construct and simulate a spendable_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.
160
- */
161
- spendableBalance: ({ id }: {
162
- id: string;
163
- }, options?: {
164
124
  /**
165
- * The fee to pay for the transaction. Default: 100.
125
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
166
126
  */
167
- fee?: number;
168
- }) => Promise<AssembledTransaction<bigint>>;
127
+ timeoutInSeconds?: number;
128
+ /**
129
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
130
+ */
131
+ simulate?: boolean;
132
+ }) => Promise<AssembledTransaction<i128>>;
169
133
  /**
170
- * 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.
134
+ * 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. *
135
+ * Burn `amount` from `from`.
136
+ *
137
+ * Reduces from's balance by the amount, without transferring the balance
138
+ * to another holder's balance.
139
+ *
140
+ * # Arguments
141
+ *
142
+ * * `from` - The address holding the balance of tokens which will be
143
+ * burned from.
144
+ * * `amount` - The amount of tokens to be burned.
145
+ *
146
+ * # Events
147
+ *
148
+ * Emits an event with topics `["burn", from: Address], data = [amount:
149
+ * i128]`
171
150
  */
172
- transfer: ({ from, to, amount }: {
151
+ burn: ({ from, amount }: {
173
152
  from: string;
174
- to: string;
175
153
  amount: i128;
176
154
  }, options?: {
177
155
  /**
178
- * The fee to pay for the transaction. Default: 100.
156
+ * The fee to pay for the transaction. Default: BASE_FEE
179
157
  */
180
158
  fee?: number;
181
- }) => Promise<AssembledTransaction<void>>;
159
+ /**
160
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
161
+ */
162
+ timeoutInSeconds?: number;
163
+ /**
164
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
165
+ */
166
+ simulate?: boolean;
167
+ }) => Promise<AssembledTransaction<null>>;
182
168
  /**
183
- * 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.
169
+ * 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. *
170
+ * Burn `amount` from `from`, consuming the allowance of `spender`.
171
+ *
172
+ * Reduces from's balance by the amount, without transferring the balance
173
+ * to another holder's balance.
174
+ *
175
+ * The spender will be allowed to burn the amount from from's balance, if
176
+ * the amount is less than or equal to the allowance that the spender has
177
+ * on the from's balance. The spender's allowance on from's balance will be
178
+ * reduced by the amount.
179
+ *
180
+ * # Arguments
181
+ *
182
+ * * `spender` - The address authorizing the burn, and having its allowance
183
+ * consumed during the burn.
184
+ * * `from` - The address holding the balance of tokens which will be
185
+ * burned from.
186
+ * * `amount` - The amount of tokens to be burned.
187
+ *
188
+ * # Events
189
+ *
190
+ * Emits an event with topics `["burn", from: Address], data = [amount:
191
+ * i128]`
184
192
  */
185
- transferFrom: ({ spender, from, to, amount }: {
193
+ burn_from: ({ spender, from, amount }: {
186
194
  spender: string;
187
195
  from: string;
188
- to: string;
189
196
  amount: i128;
190
197
  }, options?: {
191
198
  /**
192
- * The fee to pay for the transaction. Default: 100.
199
+ * The fee to pay for the transaction. Default: BASE_FEE
193
200
  */
194
201
  fee?: number;
195
- }) => Promise<AssembledTransaction<void>>;
202
+ /**
203
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
204
+ */
205
+ timeoutInSeconds?: number;
206
+ /**
207
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
208
+ */
209
+ simulate?: boolean;
210
+ }) => Promise<AssembledTransaction<null>>;
196
211
  /**
197
- * 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.
212
+ * Construct and simulate a clawback 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. *
213
+ * Clawback `amount` from `from` account. `amount` is burned in the
214
+ * clawback process.
215
+ *
216
+ * # Arguments
217
+ *
218
+ * * `from` - The address holding the balance from which the clawback will
219
+ * take tokens.
220
+ * * `amount` - The amount of tokens to be clawed back.
221
+ *
222
+ * # Events
223
+ *
224
+ * Emits an event with topics `["clawback", admin: Address, to: Address],
225
+ * data = [amount: i128]`
198
226
  */
199
- burn: ({ from, amount }: {
227
+ clawback: ({ from, amount }: {
200
228
  from: string;
201
229
  amount: i128;
202
230
  }, options?: {
203
231
  /**
204
- * The fee to pay for the transaction. Default: 100.
232
+ * The fee to pay for the transaction. Default: BASE_FEE
205
233
  */
206
234
  fee?: number;
207
- }) => Promise<AssembledTransaction<void>>;
235
+ /**
236
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
237
+ */
238
+ timeoutInSeconds?: number;
239
+ /**
240
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
241
+ */
242
+ simulate?: boolean;
243
+ }) => Promise<AssembledTransaction<null>>;
208
244
  /**
209
- * 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.
245
+ * 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. *
246
+ * Returns the number of decimals used to represent amounts of this token.
247
+ *
248
+ * # Panics
249
+ *
250
+ * If the contract has not yet been initialized.
210
251
  */
211
- burnFrom: ({ spender, from, amount }: {
212
- spender: string;
213
- from: string;
252
+ decimals: (options?: {
253
+ /**
254
+ * The fee to pay for the transaction. Default: BASE_FEE
255
+ */
256
+ fee?: number;
257
+ /**
258
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
259
+ */
260
+ timeoutInSeconds?: number;
261
+ /**
262
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
263
+ */
264
+ simulate?: boolean;
265
+ }) => Promise<AssembledTransaction<u32>>;
266
+ /**
267
+ * 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. *
268
+ * Mints `amount` to `to`.
269
+ *
270
+ * # Arguments
271
+ *
272
+ * * `to` - The address which will receive the minted tokens.
273
+ * * `amount` - The amount of tokens to be minted.
274
+ *
275
+ * # Events
276
+ *
277
+ * Emits an event with topics `["mint", admin: Address, to: Address], data
278
+ * = [amount: i128]`
279
+ */
280
+ mint: ({ to, amount }: {
281
+ to: string;
214
282
  amount: i128;
215
283
  }, options?: {
216
284
  /**
217
- * The fee to pay for the transaction. Default: 100.
285
+ * The fee to pay for the transaction. Default: BASE_FEE
218
286
  */
219
287
  fee?: number;
220
- }) => Promise<AssembledTransaction<void>>;
288
+ /**
289
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
290
+ */
291
+ timeoutInSeconds?: number;
292
+ /**
293
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
294
+ */
295
+ simulate?: boolean;
296
+ }) => Promise<AssembledTransaction<null>>;
221
297
  /**
222
- * 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.
298
+ * 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. *
299
+ * Returns the name for this token.
300
+ *
301
+ * # Panics
302
+ *
303
+ * If the contract has not yet been initialized.
223
304
  */
224
- decimals: (options?: {
305
+ name: (options?: {
225
306
  /**
226
- * The fee to pay for the transaction. Default: 100.
307
+ * The fee to pay for the transaction. Default: BASE_FEE
227
308
  */
228
309
  fee?: number;
229
- }) => Promise<AssembledTransaction<number>>;
310
+ /**
311
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
312
+ */
313
+ timeoutInSeconds?: number;
314
+ /**
315
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
316
+ */
317
+ simulate?: boolean;
318
+ }) => Promise<AssembledTransaction<string>>;
230
319
  /**
231
- * 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.
320
+ * Construct and simulate a set_admin 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. *
321
+ * Sets the administrator to the specified address `new_admin`.
322
+ *
323
+ * # Arguments
324
+ *
325
+ * * `new_admin` - The address which will henceforth be the administrator
326
+ * of this token contract.
327
+ *
328
+ * # Events
329
+ *
330
+ * Emits an event with topics `["set_admin", admin: Address], data =
331
+ * [new_admin: Address]`
232
332
  */
233
- name: (options?: {
333
+ set_admin: ({ new_admin }: {
334
+ new_admin: string;
335
+ }, options?: {
234
336
  /**
235
- * The fee to pay for the transaction. Default: 100.
337
+ * The fee to pay for the transaction. Default: BASE_FEE
236
338
  */
237
339
  fee?: number;
340
+ /**
341
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
342
+ */
343
+ timeoutInSeconds?: number;
344
+ /**
345
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
346
+ */
347
+ simulate?: boolean;
348
+ }) => Promise<AssembledTransaction<null>>;
349
+ /**
350
+ * Construct and simulate a admin 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. *
351
+ * Returns the admin of the contract.
352
+ *
353
+ * # Panics
354
+ *
355
+ * If the admin is not set.
356
+ */
357
+ admin: (options?: {
358
+ /**
359
+ * The fee to pay for the transaction. Default: BASE_FEE
360
+ */
361
+ fee?: number;
362
+ /**
363
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
364
+ */
365
+ timeoutInSeconds?: number;
366
+ /**
367
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
368
+ */
369
+ simulate?: boolean;
238
370
  }) => Promise<AssembledTransaction<string>>;
239
371
  /**
240
- * 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.
372
+ * Construct and simulate a set_authorized 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. *
373
+ * Sets whether the account is authorized to use its balance. If
374
+ * `authorized` is true, `id` should be able to use its balance.
375
+ *
376
+ * # Arguments
377
+ *
378
+ * * `id` - The address being (de-)authorized.
379
+ * * `authorize` - Whether or not `id` can use its balance.
380
+ *
381
+ * # Events
382
+ *
383
+ * Emits an event with topics `["set_authorized", id: Address], data =
384
+ * [authorize: bool]`
385
+ */
386
+ set_authorized: ({ id, authorize }: {
387
+ id: string;
388
+ authorize: boolean;
389
+ }, options?: {
390
+ /**
391
+ * The fee to pay for the transaction. Default: BASE_FEE
392
+ */
393
+ fee?: number;
394
+ /**
395
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
396
+ */
397
+ timeoutInSeconds?: number;
398
+ /**
399
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
400
+ */
401
+ simulate?: boolean;
402
+ }) => Promise<AssembledTransaction<null>>;
403
+ /**
404
+ * 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. *
405
+ * Returns the symbol for this token.
406
+ *
407
+ * # Panics
408
+ *
409
+ * If the contract has not yet been initialized.
241
410
  */
242
411
  symbol: (options?: {
243
412
  /**
244
- * The fee to pay for the transaction. Default: 100.
413
+ * The fee to pay for the transaction. Default: BASE_FEE
245
414
  */
246
415
  fee?: number;
416
+ /**
417
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
418
+ */
419
+ timeoutInSeconds?: number;
420
+ /**
421
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
422
+ */
423
+ simulate?: boolean;
247
424
  }) => Promise<AssembledTransaction<string>>;
425
+ /**
426
+ * 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. *
427
+ * Transfer `amount` from `from` to `to`.
428
+ *
429
+ * # Arguments
430
+ *
431
+ * * `from` - The address holding the balance of tokens which will be
432
+ * withdrawn from.
433
+ * * `to` - The address which will receive the transferred tokens.
434
+ * * `amount` - The amount of tokens to be transferred.
435
+ *
436
+ * # Events
437
+ *
438
+ * Emits an event with topics `["transfer", from: Address, to: Address],
439
+ * data = [amount: i128]`
440
+ */
441
+ transfer: ({ from, to, amount }: {
442
+ from: string;
443
+ to: string;
444
+ amount: i128;
445
+ }, options?: {
446
+ /**
447
+ * The fee to pay for the transaction. Default: BASE_FEE
448
+ */
449
+ fee?: number;
450
+ /**
451
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
452
+ */
453
+ timeoutInSeconds?: number;
454
+ /**
455
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
456
+ */
457
+ simulate?: boolean;
458
+ }) => Promise<AssembledTransaction<null>>;
459
+ /**
460
+ * 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. *
461
+ * Transfer `amount` from `from` to `to`, consuming the allowance that
462
+ * `spender` has on `from`'s balance. Authorized by spender
463
+ * (`spender.require_auth()`).
464
+ *
465
+ * The spender will be allowed to transfer the amount from from's balance
466
+ * if the amount is less than or equal to the allowance that the spender
467
+ * has on the from's balance. The spender's allowance on from's balance
468
+ * will be reduced by the amount.
469
+ *
470
+ * # Arguments
471
+ *
472
+ * * `spender` - The address authorizing the transfer, and having its
473
+ * allowance consumed during the transfer.
474
+ * * `from` - The address holding the balance of tokens which will be
475
+ * withdrawn from.
476
+ * * `to` - The address which will receive the transferred tokens.
477
+ * * `amount` - The amount of tokens to be transferred.
478
+ *
479
+ * # Events
480
+ *
481
+ * Emits an event with topics `["transfer", from: Address, to: Address],
482
+ * data = [amount: i128]`
483
+ */
484
+ transfer_from: ({ spender, from, to, amount }: {
485
+ spender: string;
486
+ from: string;
487
+ to: string;
488
+ amount: i128;
489
+ }, options?: {
490
+ /**
491
+ * The fee to pay for the transaction. Default: BASE_FEE
492
+ */
493
+ fee?: number;
494
+ /**
495
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
496
+ */
497
+ timeoutInSeconds?: number;
498
+ /**
499
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
500
+ */
501
+ simulate?: boolean;
502
+ }) => Promise<AssembledTransaction<null>>;
503
+ }
504
+ export declare class TokenContract extends ContractClient {
505
+ readonly options: ContractClientOptions;
506
+ constructor(options: ContractClientOptions);
507
+ readonly fromJSON: {
508
+ allowance: (json: string) => contract.AssembledTransaction<bigint>;
509
+ authorized: (json: string) => contract.AssembledTransaction<boolean>;
510
+ approve: (json: string) => contract.AssembledTransaction<null>;
511
+ balance: (json: string) => contract.AssembledTransaction<bigint>;
512
+ burn: (json: string) => contract.AssembledTransaction<null>;
513
+ burn_from: (json: string) => contract.AssembledTransaction<null>;
514
+ clawback: (json: string) => contract.AssembledTransaction<null>;
515
+ decimals: (json: string) => contract.AssembledTransaction<number>;
516
+ mint: (json: string) => contract.AssembledTransaction<null>;
517
+ name: (json: string) => contract.AssembledTransaction<string>;
518
+ set_admin: (json: string) => contract.AssembledTransaction<null>;
519
+ admin: (json: string) => contract.AssembledTransaction<string>;
520
+ set_authorized: (json: string) => contract.AssembledTransaction<null>;
521
+ symbol: (json: string) => contract.AssembledTransaction<string>;
522
+ transfer: (json: string) => contract.AssembledTransaction<null>;
523
+ transfer_from: (json: string) => contract.AssembledTransaction<null>;
524
+ };
248
525
  }