@allbridge/bridge-core-sdk 3.15.4 → 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 (53) 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/dist/src/version.js.map +1 -1
  39. package/package.json +2 -2
  40. package/dist/src/services/models/srb/bridge.d.ts +0 -169
  41. package/dist/src/services/models/srb/bridge.js.map +0 -1
  42. package/dist/src/services/models/srb/pool.d.ts +0 -293
  43. package/dist/src/services/models/srb/pool.js +0 -233
  44. package/dist/src/services/models/srb/pool.js.map +0 -1
  45. package/dist/src/services/utils/srb/assembled-tx.d.ts +0 -73
  46. package/dist/src/services/utils/srb/assembled-tx.js +0 -143
  47. package/dist/src/services/utils/srb/assembled-tx.js.map +0 -1
  48. package/dist/src/services/utils/srb/build-tx.d.ts +0 -48
  49. package/dist/src/services/utils/srb/build-tx.js +0 -62
  50. package/dist/src/services/utils/srb/build-tx.js.map +0 -1
  51. package/dist/src/services/utils/srb/method-options.d.ts +0 -47
  52. package/dist/src/services/utils/srb/method-options.js +0 -5
  53. package/dist/src/services/utils/srb/method-options.js.map +0 -1
@@ -0,0 +1,573 @@
1
+ /// <reference types="node" />
2
+ import { contract } from "@stellar/stellar-sdk";
3
+ import u128 = contract.u128;
4
+ import u32 = contract.u32;
5
+ import AssembledTransaction = contract.AssembledTransaction;
6
+ import Result = contract.Result;
7
+ import ContractClient = contract.Client;
8
+ import ContractClientOptions = contract.ClientOptions;
9
+ export interface MessageSent {
10
+ message: Buffer;
11
+ }
12
+ export interface MessageReceived {
13
+ message: Buffer;
14
+ }
15
+ export interface SecondaryValidatorsSet {
16
+ new_validators: string[];
17
+ old_validators: string[];
18
+ }
19
+ export interface Config {
20
+ chain_id: u32;
21
+ other_chain_ids: Buffer;
22
+ primary_validator_key: Buffer;
23
+ secondary_validator_keys: Map<Buffer, boolean>;
24
+ }
25
+ export type DataKey = {
26
+ tag: "SentMessage";
27
+ values: readonly [Buffer];
28
+ } | {
29
+ tag: "ReceivedMessage";
30
+ values: readonly [Buffer];
31
+ };
32
+ export type Admin = readonly [string];
33
+ export type GasOracleAddress = readonly [string];
34
+ export type GasUsage = readonly [Map<u32, u128>];
35
+ export type NativeToken = readonly [string];
36
+ export type StopAuthority = readonly [string];
37
+ export declare const Errors: {
38
+ 0: {
39
+ message: string;
40
+ };
41
+ 1: {
42
+ message: string;
43
+ };
44
+ 2: {
45
+ message: string;
46
+ };
47
+ 3: {
48
+ message: string;
49
+ };
50
+ 4: {
51
+ message: string;
52
+ };
53
+ 5: {
54
+ message: string;
55
+ };
56
+ 6: {
57
+ message: string;
58
+ };
59
+ 7: {
60
+ message: string;
61
+ };
62
+ 8: {
63
+ message: string;
64
+ };
65
+ 9: {
66
+ message: string;
67
+ };
68
+ 10: {
69
+ message: string;
70
+ };
71
+ 11: {
72
+ message: string;
73
+ };
74
+ 12: {
75
+ message: string;
76
+ };
77
+ 103: {
78
+ message: string;
79
+ };
80
+ 104: {
81
+ message: string;
82
+ };
83
+ 105: {
84
+ message: string;
85
+ };
86
+ 106: {
87
+ message: string;
88
+ };
89
+ 107: {
90
+ message: string;
91
+ };
92
+ 108: {
93
+ message: string;
94
+ };
95
+ 109: {
96
+ message: string;
97
+ };
98
+ 203: {
99
+ message: string;
100
+ };
101
+ 204: {
102
+ message: string;
103
+ };
104
+ 205: {
105
+ message: string;
106
+ };
107
+ 206: {
108
+ message: string;
109
+ };
110
+ 207: {
111
+ message: string;
112
+ };
113
+ 208: {
114
+ message: string;
115
+ };
116
+ 209: {
117
+ message: string;
118
+ };
119
+ 210: {
120
+ message: string;
121
+ };
122
+ 211: {
123
+ message: string;
124
+ };
125
+ 212: {
126
+ message: string;
127
+ };
128
+ 214: {
129
+ message: string;
130
+ };
131
+ 215: {
132
+ message: string;
133
+ };
134
+ 216: {
135
+ message: string;
136
+ };
137
+ 217: {
138
+ message: string;
139
+ };
140
+ 218: {
141
+ message: string;
142
+ };
143
+ 300: {
144
+ message: string;
145
+ };
146
+ 301: {
147
+ message: string;
148
+ };
149
+ 302: {
150
+ message: string;
151
+ };
152
+ 303: {
153
+ message: string;
154
+ };
155
+ 400: {
156
+ message: string;
157
+ };
158
+ };
159
+ export interface MessengerContract {
160
+ /**
161
+ * 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.
162
+ */
163
+ initialize: ({ admin, chain_id, native_token_address, other_chain_ids, gas_oracle_address, primary_validator_key, secondary_validator_keys, }: {
164
+ admin: string;
165
+ chain_id: u32;
166
+ native_token_address: string;
167
+ other_chain_ids: Buffer;
168
+ gas_oracle_address: string;
169
+ primary_validator_key: Buffer;
170
+ secondary_validator_keys: Map<Buffer, boolean>;
171
+ }, options?: {
172
+ /**
173
+ * The fee to pay for the transaction. Default: BASE_FEE
174
+ */
175
+ fee?: number;
176
+ /**
177
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
178
+ */
179
+ timeoutInSeconds?: number;
180
+ /**
181
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
182
+ */
183
+ simulate?: boolean;
184
+ }) => Promise<AssembledTransaction<Result<void>>>;
185
+ /**
186
+ * Construct and simulate a send_message 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.
187
+ */
188
+ send_message: ({ message, sender }: {
189
+ message: Buffer;
190
+ sender: string;
191
+ }, options?: {
192
+ /**
193
+ * The fee to pay for the transaction. Default: BASE_FEE
194
+ */
195
+ fee?: number;
196
+ /**
197
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
198
+ */
199
+ timeoutInSeconds?: number;
200
+ /**
201
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
202
+ */
203
+ simulate?: boolean;
204
+ }) => Promise<AssembledTransaction<Result<void>>>;
205
+ /**
206
+ * Construct and simulate a receive_message 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.
207
+ */
208
+ receive_message: ({ message, primary_signature, primary_recovery_id, secondary_signature, secondary_recovery_id, }: {
209
+ message: Buffer;
210
+ primary_signature: Buffer;
211
+ primary_recovery_id: u32;
212
+ secondary_signature: Buffer;
213
+ secondary_recovery_id: u32;
214
+ }, options?: {
215
+ /**
216
+ * The fee to pay for the transaction. Default: BASE_FEE
217
+ */
218
+ fee?: number;
219
+ /**
220
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
221
+ */
222
+ timeoutInSeconds?: number;
223
+ /**
224
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
225
+ */
226
+ simulate?: boolean;
227
+ }) => Promise<AssembledTransaction<Result<void>>>;
228
+ /**
229
+ * Construct and simulate a set_gas_usage 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.
230
+ */
231
+ set_gas_usage: ({ chain_id, gas_usage }: {
232
+ chain_id: u32;
233
+ gas_usage: u128;
234
+ }, options?: {
235
+ /**
236
+ * The fee to pay for the transaction. Default: BASE_FEE
237
+ */
238
+ fee?: number;
239
+ /**
240
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
241
+ */
242
+ timeoutInSeconds?: number;
243
+ /**
244
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
245
+ */
246
+ simulate?: boolean;
247
+ }) => Promise<AssembledTransaction<Result<void>>>;
248
+ /**
249
+ * Construct and simulate a add_secondary_validator 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.
250
+ */
251
+ add_secondary_validator: ({ validator_address }: {
252
+ validator_address: Buffer;
253
+ }, options?: {
254
+ /**
255
+ * The fee to pay for the transaction. Default: BASE_FEE
256
+ */
257
+ fee?: number;
258
+ /**
259
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
260
+ */
261
+ timeoutInSeconds?: number;
262
+ /**
263
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
264
+ */
265
+ simulate?: boolean;
266
+ }) => Promise<AssembledTransaction<Result<void>>>;
267
+ /**
268
+ * Construct and simulate a remove_secondary_validator 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.
269
+ */
270
+ remove_secondary_validator: ({ validator_address }: {
271
+ validator_address: Buffer;
272
+ }, options?: {
273
+ /**
274
+ * The fee to pay for the transaction. Default: BASE_FEE
275
+ */
276
+ fee?: number;
277
+ /**
278
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
279
+ */
280
+ timeoutInSeconds?: number;
281
+ /**
282
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
283
+ */
284
+ simulate?: boolean;
285
+ }) => Promise<AssembledTransaction<Result<void>>>;
286
+ /**
287
+ * Construct and simulate a set_primary_validator 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.
288
+ */
289
+ set_primary_validator: ({ validator_address }: {
290
+ validator_address: Buffer;
291
+ }, options?: {
292
+ /**
293
+ * The fee to pay for the transaction. Default: BASE_FEE
294
+ */
295
+ fee?: number;
296
+ /**
297
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
298
+ */
299
+ timeoutInSeconds?: number;
300
+ /**
301
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
302
+ */
303
+ simulate?: boolean;
304
+ }) => Promise<AssembledTransaction<Result<void>>>;
305
+ /**
306
+ * 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.
307
+ */
308
+ set_admin: ({ new_admin }: {
309
+ new_admin: string;
310
+ }, options?: {
311
+ /**
312
+ * The fee to pay for the transaction. Default: BASE_FEE
313
+ */
314
+ fee?: number;
315
+ /**
316
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
317
+ */
318
+ timeoutInSeconds?: number;
319
+ /**
320
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
321
+ */
322
+ simulate?: boolean;
323
+ }) => Promise<AssembledTransaction<Result<void>>>;
324
+ /**
325
+ * Construct and simulate a set_gas_oracle 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.
326
+ */
327
+ set_gas_oracle: ({ new_address }: {
328
+ new_address: string;
329
+ }, options?: {
330
+ /**
331
+ * The fee to pay for the transaction. Default: BASE_FEE
332
+ */
333
+ fee?: number;
334
+ /**
335
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
336
+ */
337
+ timeoutInSeconds?: number;
338
+ /**
339
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
340
+ */
341
+ simulate?: boolean;
342
+ }) => Promise<AssembledTransaction<Result<void>>>;
343
+ /**
344
+ * Construct and simulate a set_other_chain_ids 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.
345
+ */
346
+ set_other_chain_ids: ({ other_chain_ids }: {
347
+ other_chain_ids: Buffer;
348
+ }, options?: {
349
+ /**
350
+ * The fee to pay for the transaction. Default: BASE_FEE
351
+ */
352
+ fee?: number;
353
+ /**
354
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
355
+ */
356
+ timeoutInSeconds?: number;
357
+ /**
358
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
359
+ */
360
+ simulate?: boolean;
361
+ }) => Promise<AssembledTransaction<Result<void>>>;
362
+ /**
363
+ * Construct and simulate a withdraw_gas_tokens 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.
364
+ */
365
+ withdraw_gas_tokens: ({ sender, amount }: {
366
+ sender: string;
367
+ amount: u128;
368
+ }, options?: {
369
+ /**
370
+ * The fee to pay for the transaction. Default: BASE_FEE
371
+ */
372
+ fee?: number;
373
+ /**
374
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
375
+ */
376
+ timeoutInSeconds?: number;
377
+ /**
378
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
379
+ */
380
+ simulate?: boolean;
381
+ }) => Promise<AssembledTransaction<Result<void>>>;
382
+ /**
383
+ * Construct and simulate a get_config 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.
384
+ */
385
+ get_config: (options?: {
386
+ /**
387
+ * The fee to pay for the transaction. Default: BASE_FEE
388
+ */
389
+ fee?: number;
390
+ /**
391
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
392
+ */
393
+ timeoutInSeconds?: number;
394
+ /**
395
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
396
+ */
397
+ simulate?: boolean;
398
+ }) => Promise<AssembledTransaction<Result<Config>>>;
399
+ /**
400
+ * Construct and simulate a has_sent_message 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.
401
+ */
402
+ has_sent_message: ({ message }: {
403
+ message: Buffer;
404
+ }, options?: {
405
+ /**
406
+ * The fee to pay for the transaction. Default: BASE_FEE
407
+ */
408
+ fee?: number;
409
+ /**
410
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
411
+ */
412
+ timeoutInSeconds?: number;
413
+ /**
414
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
415
+ */
416
+ simulate?: boolean;
417
+ }) => Promise<AssembledTransaction<Result<boolean>>>;
418
+ /**
419
+ * Construct and simulate a has_received_message 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.
420
+ */
421
+ has_received_message: ({ message }: {
422
+ message: Buffer;
423
+ }, options?: {
424
+ /**
425
+ * The fee to pay for the transaction. Default: BASE_FEE
426
+ */
427
+ fee?: number;
428
+ /**
429
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
430
+ */
431
+ timeoutInSeconds?: number;
432
+ /**
433
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
434
+ */
435
+ simulate?: boolean;
436
+ }) => Promise<AssembledTransaction<Result<boolean>>>;
437
+ /**
438
+ * Construct and simulate a get_sent_message_sequence 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.
439
+ */
440
+ get_sent_message_sequence: ({ message }: {
441
+ message: Buffer;
442
+ }, options?: {
443
+ /**
444
+ * The fee to pay for the transaction. Default: BASE_FEE
445
+ */
446
+ fee?: number;
447
+ /**
448
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
449
+ */
450
+ timeoutInSeconds?: number;
451
+ /**
452
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
453
+ */
454
+ simulate?: boolean;
455
+ }) => Promise<AssembledTransaction<Result<u32>>>;
456
+ /**
457
+ * Construct and simulate a get_gas_usage 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.
458
+ */
459
+ get_gas_usage: ({ chain_id }: {
460
+ chain_id: u32;
461
+ }, options?: {
462
+ /**
463
+ * The fee to pay for the transaction. Default: BASE_FEE
464
+ */
465
+ fee?: number;
466
+ /**
467
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
468
+ */
469
+ timeoutInSeconds?: number;
470
+ /**
471
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
472
+ */
473
+ simulate?: boolean;
474
+ }) => Promise<AssembledTransaction<Result<u128>>>;
475
+ /**
476
+ * Construct and simulate a get_transaction_cost 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.
477
+ */
478
+ get_transaction_cost: ({ chain_id }: {
479
+ chain_id: u32;
480
+ }, options?: {
481
+ /**
482
+ * The fee to pay for the transaction. Default: BASE_FEE
483
+ */
484
+ fee?: number;
485
+ /**
486
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
487
+ */
488
+ timeoutInSeconds?: number;
489
+ /**
490
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
491
+ */
492
+ simulate?: boolean;
493
+ }) => Promise<AssembledTransaction<Result<u128>>>;
494
+ /**
495
+ * Construct and simulate a get_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.
496
+ */
497
+ get_admin: (options?: {
498
+ /**
499
+ * The fee to pay for the transaction. Default: BASE_FEE
500
+ */
501
+ fee?: number;
502
+ /**
503
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
504
+ */
505
+ timeoutInSeconds?: number;
506
+ /**
507
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
508
+ */
509
+ simulate?: boolean;
510
+ }) => Promise<AssembledTransaction<Result<string>>>;
511
+ /**
512
+ * Construct and simulate a get_gas_oracle 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.
513
+ */
514
+ get_gas_oracle: (options?: {
515
+ /**
516
+ * The fee to pay for the transaction. Default: BASE_FEE
517
+ */
518
+ fee?: number;
519
+ /**
520
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
521
+ */
522
+ timeoutInSeconds?: number;
523
+ /**
524
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
525
+ */
526
+ simulate?: boolean;
527
+ }) => Promise<AssembledTransaction<Result<string>>>;
528
+ /**
529
+ * Construct and simulate a upgrade 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.
530
+ */
531
+ upgrade: ({ new_wasm_hash }: {
532
+ new_wasm_hash: Buffer;
533
+ }, options?: {
534
+ /**
535
+ * The fee to pay for the transaction. Default: BASE_FEE
536
+ */
537
+ fee?: number;
538
+ /**
539
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
540
+ */
541
+ timeoutInSeconds?: number;
542
+ /**
543
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
544
+ */
545
+ simulate?: boolean;
546
+ }) => Promise<AssembledTransaction<Result<void>>>;
547
+ }
548
+ export declare class MessengerContract extends ContractClient {
549
+ readonly options: ContractClientOptions;
550
+ constructor(options: ContractClientOptions);
551
+ readonly fromJSON: {
552
+ initialize: (json: string) => contract.AssembledTransaction<contract.Result<void, contract.ErrorMessage>>;
553
+ send_message: (json: string) => contract.AssembledTransaction<contract.Result<void, contract.ErrorMessage>>;
554
+ receive_message: (json: string) => contract.AssembledTransaction<contract.Result<void, contract.ErrorMessage>>;
555
+ set_gas_usage: (json: string) => contract.AssembledTransaction<contract.Result<void, contract.ErrorMessage>>;
556
+ add_secondary_validator: (json: string) => contract.AssembledTransaction<contract.Result<void, contract.ErrorMessage>>;
557
+ remove_secondary_validator: (json: string) => contract.AssembledTransaction<contract.Result<void, contract.ErrorMessage>>;
558
+ set_primary_validator: (json: string) => contract.AssembledTransaction<contract.Result<void, contract.ErrorMessage>>;
559
+ set_admin: (json: string) => contract.AssembledTransaction<contract.Result<void, contract.ErrorMessage>>;
560
+ set_gas_oracle: (json: string) => contract.AssembledTransaction<contract.Result<void, contract.ErrorMessage>>;
561
+ set_other_chain_ids: (json: string) => contract.AssembledTransaction<contract.Result<void, contract.ErrorMessage>>;
562
+ withdraw_gas_tokens: (json: string) => contract.AssembledTransaction<contract.Result<void, contract.ErrorMessage>>;
563
+ get_config: (json: string) => contract.AssembledTransaction<contract.Result<Config, contract.ErrorMessage>>;
564
+ has_sent_message: (json: string) => contract.AssembledTransaction<contract.Result<boolean, contract.ErrorMessage>>;
565
+ has_received_message: (json: string) => contract.AssembledTransaction<contract.Result<boolean, contract.ErrorMessage>>;
566
+ get_sent_message_sequence: (json: string) => contract.AssembledTransaction<contract.Result<number, contract.ErrorMessage>>;
567
+ get_gas_usage: (json: string) => contract.AssembledTransaction<contract.Result<bigint, contract.ErrorMessage>>;
568
+ get_transaction_cost: (json: string) => contract.AssembledTransaction<contract.Result<bigint, contract.ErrorMessage>>;
569
+ get_admin: (json: string) => contract.AssembledTransaction<contract.Result<string, contract.ErrorMessage>>;
570
+ get_gas_oracle: (json: string) => contract.AssembledTransaction<contract.Result<string, contract.ErrorMessage>>;
571
+ upgrade: (json: string) => contract.AssembledTransaction<contract.Result<void, contract.ErrorMessage>>;
572
+ };
573
+ }
@@ -0,0 +1,111 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MessengerContract = exports.Errors = void 0;
4
+ const stellar_sdk_1 = require("@stellar/stellar-sdk");
5
+ var ContractSpec = stellar_sdk_1.contract.Spec;
6
+ var ContractClient = stellar_sdk_1.contract.Client;
7
+ exports.Errors = {
8
+ 0: { message: "" },
9
+ 1: { message: "" },
10
+ 2: { message: "" },
11
+ 3: { message: "" },
12
+ 4: { message: "" },
13
+ 5: { message: "" },
14
+ 6: { message: "" },
15
+ 7: { message: "" },
16
+ 8: { message: "" },
17
+ 9: { message: "" },
18
+ 10: { message: "" },
19
+ 11: { message: "" },
20
+ 12: { message: "" },
21
+ 103: { message: "" },
22
+ 104: { message: "" },
23
+ 105: { message: "" },
24
+ 106: { message: "" },
25
+ 107: { message: "" },
26
+ 108: { message: "" },
27
+ 109: { message: "" },
28
+ 203: { message: "" },
29
+ 204: { message: "" },
30
+ 205: { message: "" },
31
+ 206: { message: "" },
32
+ 207: { message: "" },
33
+ 208: { message: "" },
34
+ 209: { message: "" },
35
+ 210: { message: "" },
36
+ 211: { message: "" },
37
+ 212: { message: "" },
38
+ 214: { message: "" },
39
+ 215: { message: "" },
40
+ 216: { message: "" },
41
+ 217: { message: "" },
42
+ 218: { message: "" },
43
+ 300: { message: "" },
44
+ 301: { message: "" },
45
+ 302: { message: "" },
46
+ 303: { message: "" },
47
+ 400: { message: "" },
48
+ };
49
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-declaration-merging
50
+ class MessengerContract extends ContractClient {
51
+ constructor(options) {
52
+ super(new ContractSpec([
53
+ "AAAAAAAAAAAAAAAKaW5pdGlhbGl6ZQAAAAAABwAAAAAAAAAFYWRtaW4AAAAAAAATAAAAAAAAAAhjaGFpbl9pZAAAAAQAAAAAAAAAFG5hdGl2ZV90b2tlbl9hZGRyZXNzAAAAEwAAAAAAAAAPb3RoZXJfY2hhaW5faWRzAAAAA+4AAAAgAAAAAAAAABJnYXNfb3JhY2xlX2FkZHJlc3MAAAAAABMAAAAAAAAAFXByaW1hcnlfdmFsaWRhdG9yX2tleQAAAAAAA+4AAABBAAAAAAAAABhzZWNvbmRhcnlfdmFsaWRhdG9yX2tleXMAAAPsAAAD7gAAAEEAAAABAAAAAQAAA+kAAAPtAAAAAAAAAAM=",
54
+ "AAAAAAAAAAAAAAAMc2VuZF9tZXNzYWdlAAAAAgAAAAAAAAAHbWVzc2FnZQAAAAPuAAAAIAAAAAAAAAAGc2VuZGVyAAAAAAATAAAAAQAAA+kAAAPtAAAAAAAAAAM=",
55
+ "AAAAAAAAAAAAAAAPcmVjZWl2ZV9tZXNzYWdlAAAAAAUAAAAAAAAAB21lc3NhZ2UAAAAD7gAAAC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AAAAAAAAAVV3JvbmdEZXN0aW5hdGlvbkNoYWluAAAAAAAA0QAAAAAAAAATVW5rbm93bkFub3RoZXJDaGFpbgAAAADSAAAAAAAAABFUb2tlbnNBbHJlYWR5U2VudAAAAAAAANMAAAAAAAAAEE1lc3NhZ2VQcm9jZXNzZWQAAADUAAAAAAAAAAxOb3RFbm91Z2hGZWUAAADWAAAAAAAAAAlOb01lc3NhZ2UAAAAAAADXAAAAAAAAAA1Ob1JlY2VpdmVQb29sAAAAAAAA2AAAAAAAAAAGTm9Qb29sAAAAAADZAAAAAAAAABNVbmtub3duQW5vdGhlclRva2VuAAAAANoAAAAAAAAAD1dyb25nQnl0ZUxlbmd0aAAAAAEsAAAAAAAAAApIYXNNZXNzYWdlAAAAAAEtAAAAAAAAABdJbnZhbGlkUHJpbWFyeVNpZ25hdHVyZQAAAAEuAAAAAAAAABlJbnZhbGlkU2Vjb25kYXJ5U2lnbmF0dXJlAAAAAAABLwAAAAAAAAARTm9HYXNEYXRhRm9yQ2hhaW4AAAAAAAGQ",
84
+ ]), options);
85
+ this.options = options;
86
+ this.fromJSON = {
87
+ initialize: (this.txFromJSON),
88
+ send_message: (this.txFromJSON),
89
+ receive_message: (this.txFromJSON),
90
+ set_gas_usage: (this.txFromJSON),
91
+ add_secondary_validator: (this.txFromJSON),
92
+ remove_secondary_validator: (this.txFromJSON),
93
+ set_primary_validator: (this.txFromJSON),
94
+ set_admin: (this.txFromJSON),
95
+ set_gas_oracle: (this.txFromJSON),
96
+ set_other_chain_ids: (this.txFromJSON),
97
+ withdraw_gas_tokens: (this.txFromJSON),
98
+ get_config: (this.txFromJSON),
99
+ has_sent_message: (this.txFromJSON),
100
+ has_received_message: (this.txFromJSON),
101
+ get_sent_message_sequence: (this.txFromJSON),
102
+ get_gas_usage: (this.txFromJSON),
103
+ get_transaction_cost: (this.txFromJSON),
104
+ get_admin: (this.txFromJSON),
105
+ get_gas_oracle: (this.txFromJSON),
106
+ upgrade: (this.txFromJSON),
107
+ };
108
+ }
109
+ }
110
+ exports.MessengerContract = MessengerContract;
111
+ //# sourceMappingURL=messenger-contract.js.map