@huma-finance/soroban-huma-config 0.0.15 → 0.0.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -4
- package/dist/cjs/index.d.ts +463 -0
- package/dist/cjs/index.js +117 -0
- package/dist/index.d.ts +85 -130
- package/dist/index.js +84 -51
- package/package.json +10 -4
- package/src/index.ts +179 -222
- package/tsconfig.cjs.json +22 -0
- package/tsconfig.json +93 -11
- package/tsconfig.tsbuildinfo +1 -0
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
/// <reference types="node"
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
/// <reference types="node" />
|
|
2
3
|
import { Buffer } from "buffer";
|
|
3
4
|
import { AssembledTransaction, Client as ContractClient, ClientOptions as ContractClientOptions } from "@stellar/stellar-sdk/contract";
|
|
4
5
|
import type { u32 } from "@stellar/stellar-sdk/contract";
|
|
@@ -6,9 +7,9 @@ export * from "@stellar/stellar-sdk";
|
|
|
6
7
|
export * as contract from "@stellar/stellar-sdk/contract";
|
|
7
8
|
export * as rpc from "@stellar/stellar-sdk/rpc";
|
|
8
9
|
export declare const networks: {
|
|
9
|
-
readonly
|
|
10
|
-
readonly networkPassphrase: "
|
|
11
|
-
readonly contractId: "
|
|
10
|
+
readonly unknown: {
|
|
11
|
+
readonly networkPassphrase: "Public Global Stellar Network ; September 2015";
|
|
12
|
+
readonly contractId: "CAVRWN3JYHZLKREHPDXFRCMEXPLPF2LIYRWKBHIRWSE62OCRTELBLQ4O";
|
|
12
13
|
};
|
|
13
14
|
};
|
|
14
15
|
export declare const Errors: {
|
|
@@ -18,6 +19,9 @@ export declare const Errors: {
|
|
|
18
19
|
102: {
|
|
19
20
|
message: string;
|
|
20
21
|
};
|
|
22
|
+
103: {
|
|
23
|
+
message: string;
|
|
24
|
+
};
|
|
21
25
|
1: {
|
|
22
26
|
message: string;
|
|
23
27
|
};
|
|
@@ -33,6 +37,12 @@ export declare const Errors: {
|
|
|
33
37
|
5: {
|
|
34
38
|
message: string;
|
|
35
39
|
};
|
|
40
|
+
6: {
|
|
41
|
+
message: string;
|
|
42
|
+
};
|
|
43
|
+
7: {
|
|
44
|
+
message: string;
|
|
45
|
+
};
|
|
36
46
|
};
|
|
37
47
|
export type HumaConfigDataKey = {
|
|
38
48
|
tag: "HumaOwner";
|
|
@@ -44,7 +54,7 @@ export type HumaConfigDataKey = {
|
|
|
44
54
|
tag: "Sentinel";
|
|
45
55
|
values: void;
|
|
46
56
|
} | {
|
|
47
|
-
tag: "
|
|
57
|
+
tag: "ProtocolFeeBps";
|
|
48
58
|
values: void;
|
|
49
59
|
} | {
|
|
50
60
|
tag: "IsPaused";
|
|
@@ -56,13 +66,6 @@ export type HumaConfigDataKey = {
|
|
|
56
66
|
tag: "ValidLiquidityAsset";
|
|
57
67
|
values: readonly [string];
|
|
58
68
|
};
|
|
59
|
-
/**
|
|
60
|
-
* The Huma protocol has been initialized.
|
|
61
|
-
* # Fields
|
|
62
|
-
* * `huma_owner` - The address of the Huma owner account.
|
|
63
|
-
* * `huma_treasury` - The address of the Huma treasury account.
|
|
64
|
-
* * `sentinel` - The address of the Sentinel service account.
|
|
65
|
-
*/
|
|
66
69
|
export interface ProtocolInitializedEvent {
|
|
67
70
|
huma_owner: string;
|
|
68
71
|
huma_treasury: string;
|
|
@@ -71,78 +74,30 @@ export interface ProtocolInitializedEvent {
|
|
|
71
74
|
export interface HumaOwnerChangedEvent {
|
|
72
75
|
huma_owner: string;
|
|
73
76
|
}
|
|
74
|
-
/**
|
|
75
|
-
* The Huma protocol has been paused.
|
|
76
|
-
* # Fields
|
|
77
|
-
* * `paused` - Whether the protocol is paused. The value acts as a placeholder only to get around
|
|
78
|
-
* the restriction that `contracttype` doesn't allow empty structs. The value is always `true`.
|
|
79
|
-
*/
|
|
80
77
|
export interface ProtocolPausedEvent {
|
|
81
78
|
paused: boolean;
|
|
82
79
|
}
|
|
83
|
-
/**
|
|
84
|
-
* The Huma protocol has been unpaused.
|
|
85
|
-
* # Fields
|
|
86
|
-
* * `paused` - Whether the protocol is paused. The value acts as a placeholder only to get around
|
|
87
|
-
* the restriction that `contractype` doesn't allow empty structs. The value is always `false`.
|
|
88
|
-
*/
|
|
89
80
|
export interface ProtocolUnpausedEvent {
|
|
90
81
|
paused: boolean;
|
|
91
82
|
}
|
|
92
|
-
/**
|
|
93
|
-
* The treasury address for the Huma protocol has changed.
|
|
94
|
-
* # Fields
|
|
95
|
-
* * `treasury` - The address of the new Huma treasury.
|
|
96
|
-
*/
|
|
97
83
|
export interface HumaTreasuryChangedEvent {
|
|
98
84
|
treasury: string;
|
|
99
85
|
}
|
|
100
|
-
/**
|
|
101
|
-
* A pauser has been added. A pauser is someone who can pause the protocol.
|
|
102
|
-
* # Fields
|
|
103
|
-
* * `pauser` - The address of the pauser being added.
|
|
104
|
-
*/
|
|
105
86
|
export interface PauserAddedEvent {
|
|
106
87
|
pauser: string;
|
|
107
88
|
}
|
|
108
|
-
/**
|
|
109
|
-
* A pauser has been removed.
|
|
110
|
-
* # Fields
|
|
111
|
-
* * `pauser` - The address of the pauser being removed.
|
|
112
|
-
*/
|
|
113
89
|
export interface PauserRemovedEvent {
|
|
114
90
|
pauser: string;
|
|
115
91
|
}
|
|
116
|
-
/**
|
|
117
|
-
* New underlying asset supported by the protocol is added.
|
|
118
|
-
* # Fields
|
|
119
|
-
* * `asset` - The address of the liquidity asset being added.
|
|
120
|
-
*/
|
|
121
92
|
export interface LiquidityAssetAddedEvent {
|
|
122
93
|
asset: string;
|
|
123
94
|
}
|
|
124
|
-
/**
|
|
125
|
-
* Remove the asset that is no longer supported by the protocol.
|
|
126
|
-
* # Fields
|
|
127
|
-
* * `asset` - The address of the liquidity asset being removed.
|
|
128
|
-
*/
|
|
129
95
|
export interface LiquidityAssetRemovedEvent {
|
|
130
96
|
asset: string;
|
|
131
97
|
}
|
|
132
|
-
/**
|
|
133
|
-
* The account for the Sentinel Service has been changed.
|
|
134
|
-
* # Fields
|
|
135
|
-
* * `account` - The address of the new Sentinel Service.
|
|
136
|
-
*/
|
|
137
98
|
export interface SentinelServiceAccountChangedEvent {
|
|
138
99
|
account: string;
|
|
139
100
|
}
|
|
140
|
-
/**
|
|
141
|
-
* The protocol fee has been changed.
|
|
142
|
-
* # Fields
|
|
143
|
-
* * `old_fee_bps` - The old protocol fee in bps.
|
|
144
|
-
* * `new_fee_bps` - The new protocol fee in bps.
|
|
145
|
-
*/
|
|
146
101
|
export interface ProtocolFeeChangedEvent {
|
|
147
102
|
new_fee_bps: u32;
|
|
148
103
|
old_fee_bps: u32;
|
|
@@ -170,9 +125,11 @@ export interface Client {
|
|
|
170
125
|
simulate?: boolean;
|
|
171
126
|
}) => Promise<AssembledTransaction<null>>;
|
|
172
127
|
/**
|
|
173
|
-
* Construct and simulate a
|
|
128
|
+
* Construct and simulate a set_huma_owner 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.
|
|
174
129
|
*/
|
|
175
|
-
|
|
130
|
+
set_huma_owner: ({ addr }: {
|
|
131
|
+
addr: string;
|
|
132
|
+
}, options?: {
|
|
176
133
|
/**
|
|
177
134
|
* The fee to pay for the transaction. Default: BASE_FEE
|
|
178
135
|
*/
|
|
@@ -185,11 +142,11 @@ export interface Client {
|
|
|
185
142
|
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
186
143
|
*/
|
|
187
144
|
simulate?: boolean;
|
|
188
|
-
}) => Promise<AssembledTransaction<
|
|
145
|
+
}) => Promise<AssembledTransaction<null>>;
|
|
189
146
|
/**
|
|
190
|
-
* Construct and simulate a
|
|
147
|
+
* Construct and simulate a set_huma_treasury 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.
|
|
191
148
|
*/
|
|
192
|
-
|
|
149
|
+
set_huma_treasury: ({ addr }: {
|
|
193
150
|
addr: string;
|
|
194
151
|
}, options?: {
|
|
195
152
|
/**
|
|
@@ -206,9 +163,11 @@ export interface Client {
|
|
|
206
163
|
simulate?: boolean;
|
|
207
164
|
}) => Promise<AssembledTransaction<null>>;
|
|
208
165
|
/**
|
|
209
|
-
* Construct and simulate a
|
|
166
|
+
* Construct and simulate a set_sentinel 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.
|
|
210
167
|
*/
|
|
211
|
-
|
|
168
|
+
set_sentinel: ({ addr }: {
|
|
169
|
+
addr: string;
|
|
170
|
+
}, options?: {
|
|
212
171
|
/**
|
|
213
172
|
* The fee to pay for the transaction. Default: BASE_FEE
|
|
214
173
|
*/
|
|
@@ -221,12 +180,13 @@ export interface Client {
|
|
|
221
180
|
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
222
181
|
*/
|
|
223
182
|
simulate?: boolean;
|
|
224
|
-
}) => Promise<AssembledTransaction<
|
|
183
|
+
}) => Promise<AssembledTransaction<null>>;
|
|
225
184
|
/**
|
|
226
|
-
* Construct and simulate a
|
|
185
|
+
* Construct and simulate a set_liquidity_asset 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.
|
|
227
186
|
*/
|
|
228
|
-
|
|
187
|
+
set_liquidity_asset: ({ addr, valid }: {
|
|
229
188
|
addr: string;
|
|
189
|
+
valid: boolean;
|
|
230
190
|
}, options?: {
|
|
231
191
|
/**
|
|
232
192
|
* The fee to pay for the transaction. Default: BASE_FEE
|
|
@@ -242,9 +202,11 @@ export interface Client {
|
|
|
242
202
|
simulate?: boolean;
|
|
243
203
|
}) => Promise<AssembledTransaction<null>>;
|
|
244
204
|
/**
|
|
245
|
-
* Construct and simulate a
|
|
205
|
+
* Construct and simulate a set_protocol_fee_bps 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
206
|
*/
|
|
247
|
-
|
|
207
|
+
set_protocol_fee_bps: ({ fee_bps }: {
|
|
208
|
+
fee_bps: u32;
|
|
209
|
+
}, options?: {
|
|
248
210
|
/**
|
|
249
211
|
* The fee to pay for the transaction. Default: BASE_FEE
|
|
250
212
|
*/
|
|
@@ -257,12 +219,12 @@ export interface Client {
|
|
|
257
219
|
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
258
220
|
*/
|
|
259
221
|
simulate?: boolean;
|
|
260
|
-
}) => Promise<AssembledTransaction<
|
|
222
|
+
}) => Promise<AssembledTransaction<null>>;
|
|
261
223
|
/**
|
|
262
|
-
* Construct and simulate a
|
|
224
|
+
* Construct and simulate a pause_protocol 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.
|
|
263
225
|
*/
|
|
264
|
-
|
|
265
|
-
|
|
226
|
+
pause_protocol: ({ caller }: {
|
|
227
|
+
caller: string;
|
|
266
228
|
}, options?: {
|
|
267
229
|
/**
|
|
268
230
|
* The fee to pay for the transaction. Default: BASE_FEE
|
|
@@ -278,9 +240,9 @@ export interface Client {
|
|
|
278
240
|
simulate?: boolean;
|
|
279
241
|
}) => Promise<AssembledTransaction<null>>;
|
|
280
242
|
/**
|
|
281
|
-
* Construct and simulate a
|
|
243
|
+
* Construct and simulate a unpause_protocol 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.
|
|
282
244
|
*/
|
|
283
|
-
|
|
245
|
+
unpause_protocol: (options?: {
|
|
284
246
|
/**
|
|
285
247
|
* The fee to pay for the transaction. Default: BASE_FEE
|
|
286
248
|
*/
|
|
@@ -293,12 +255,12 @@ export interface Client {
|
|
|
293
255
|
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
294
256
|
*/
|
|
295
257
|
simulate?: boolean;
|
|
296
|
-
}) => Promise<AssembledTransaction<
|
|
258
|
+
}) => Promise<AssembledTransaction<null>>;
|
|
297
259
|
/**
|
|
298
|
-
* Construct and simulate a
|
|
260
|
+
* Construct and simulate a add_pauser 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
261
|
*/
|
|
300
|
-
|
|
301
|
-
|
|
262
|
+
add_pauser: ({ addr }: {
|
|
263
|
+
addr: string;
|
|
302
264
|
}, options?: {
|
|
303
265
|
/**
|
|
304
266
|
* The fee to pay for the transaction. Default: BASE_FEE
|
|
@@ -314,9 +276,11 @@ export interface Client {
|
|
|
314
276
|
simulate?: boolean;
|
|
315
277
|
}) => Promise<AssembledTransaction<null>>;
|
|
316
278
|
/**
|
|
317
|
-
* Construct and simulate a
|
|
279
|
+
* Construct and simulate a remove_pauser 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.
|
|
318
280
|
*/
|
|
319
|
-
|
|
281
|
+
remove_pauser: ({ addr }: {
|
|
282
|
+
addr: string;
|
|
283
|
+
}, options?: {
|
|
320
284
|
/**
|
|
321
285
|
* The fee to pay for the transaction. Default: BASE_FEE
|
|
322
286
|
*/
|
|
@@ -331,10 +295,10 @@ export interface Client {
|
|
|
331
295
|
simulate?: boolean;
|
|
332
296
|
}) => Promise<AssembledTransaction<null>>;
|
|
333
297
|
/**
|
|
334
|
-
* Construct and simulate a
|
|
298
|
+
* 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.
|
|
335
299
|
*/
|
|
336
|
-
|
|
337
|
-
|
|
300
|
+
upgrade: ({ new_wasm_hash }: {
|
|
301
|
+
new_wasm_hash: Buffer;
|
|
338
302
|
}, options?: {
|
|
339
303
|
/**
|
|
340
304
|
* The fee to pay for the transaction. Default: BASE_FEE
|
|
@@ -348,13 +312,11 @@ export interface Client {
|
|
|
348
312
|
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
349
313
|
*/
|
|
350
314
|
simulate?: boolean;
|
|
351
|
-
}) => Promise<AssembledTransaction<
|
|
315
|
+
}) => Promise<AssembledTransaction<null>>;
|
|
352
316
|
/**
|
|
353
|
-
* Construct and simulate a
|
|
317
|
+
* Construct and simulate a get_huma_owner 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.
|
|
354
318
|
*/
|
|
355
|
-
|
|
356
|
-
addr: string;
|
|
357
|
-
}, options?: {
|
|
319
|
+
get_huma_owner: (options?: {
|
|
358
320
|
/**
|
|
359
321
|
* The fee to pay for the transaction. Default: BASE_FEE
|
|
360
322
|
*/
|
|
@@ -367,13 +329,11 @@ export interface Client {
|
|
|
367
329
|
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
368
330
|
*/
|
|
369
331
|
simulate?: boolean;
|
|
370
|
-
}) => Promise<AssembledTransaction<
|
|
332
|
+
}) => Promise<AssembledTransaction<string>>;
|
|
371
333
|
/**
|
|
372
|
-
* Construct and simulate a
|
|
334
|
+
* Construct and simulate a get_huma_treasury 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
335
|
*/
|
|
374
|
-
|
|
375
|
-
addr: string;
|
|
376
|
-
}, options?: {
|
|
336
|
+
get_huma_treasury: (options?: {
|
|
377
337
|
/**
|
|
378
338
|
* The fee to pay for the transaction. Default: BASE_FEE
|
|
379
339
|
*/
|
|
@@ -386,13 +346,11 @@ export interface Client {
|
|
|
386
346
|
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
387
347
|
*/
|
|
388
348
|
simulate?: boolean;
|
|
389
|
-
}) => Promise<AssembledTransaction<
|
|
349
|
+
}) => Promise<AssembledTransaction<string>>;
|
|
390
350
|
/**
|
|
391
|
-
* Construct and simulate a
|
|
351
|
+
* Construct and simulate a get_sentinel 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.
|
|
392
352
|
*/
|
|
393
|
-
|
|
394
|
-
addr: string;
|
|
395
|
-
}, options?: {
|
|
353
|
+
get_sentinel: (options?: {
|
|
396
354
|
/**
|
|
397
355
|
* The fee to pay for the transaction. Default: BASE_FEE
|
|
398
356
|
*/
|
|
@@ -405,14 +363,11 @@ export interface Client {
|
|
|
405
363
|
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
406
364
|
*/
|
|
407
365
|
simulate?: boolean;
|
|
408
|
-
}) => Promise<AssembledTransaction<
|
|
366
|
+
}) => Promise<AssembledTransaction<string>>;
|
|
409
367
|
/**
|
|
410
|
-
* Construct and simulate a
|
|
368
|
+
* Construct and simulate a get_protocol_fee_bps 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.
|
|
411
369
|
*/
|
|
412
|
-
|
|
413
|
-
addr: string;
|
|
414
|
-
valid: boolean;
|
|
415
|
-
}, options?: {
|
|
370
|
+
get_protocol_fee_bps: (options?: {
|
|
416
371
|
/**
|
|
417
372
|
* The fee to pay for the transaction. Default: BASE_FEE
|
|
418
373
|
*/
|
|
@@ -425,11 +380,13 @@ export interface Client {
|
|
|
425
380
|
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
426
381
|
*/
|
|
427
382
|
simulate?: boolean;
|
|
428
|
-
}) => Promise<AssembledTransaction<
|
|
383
|
+
}) => Promise<AssembledTransaction<u32>>;
|
|
429
384
|
/**
|
|
430
|
-
* Construct and simulate a
|
|
385
|
+
* Construct and simulate a is_pauser 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.
|
|
431
386
|
*/
|
|
432
|
-
|
|
387
|
+
is_pauser: ({ addr }: {
|
|
388
|
+
addr: string;
|
|
389
|
+
}, options?: {
|
|
433
390
|
/**
|
|
434
391
|
* The fee to pay for the transaction. Default: BASE_FEE
|
|
435
392
|
*/
|
|
@@ -442,13 +399,11 @@ export interface Client {
|
|
|
442
399
|
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
443
400
|
*/
|
|
444
401
|
simulate?: boolean;
|
|
445
|
-
}) => Promise<AssembledTransaction<
|
|
402
|
+
}) => Promise<AssembledTransaction<boolean>>;
|
|
446
403
|
/**
|
|
447
|
-
* Construct and simulate a
|
|
404
|
+
* Construct and simulate a is_protocol_paused 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.
|
|
448
405
|
*/
|
|
449
|
-
|
|
450
|
-
fee_bps: u32;
|
|
451
|
-
}, options?: {
|
|
406
|
+
is_protocol_paused: (options?: {
|
|
452
407
|
/**
|
|
453
408
|
* The fee to pay for the transaction. Default: BASE_FEE
|
|
454
409
|
*/
|
|
@@ -461,12 +416,12 @@ export interface Client {
|
|
|
461
416
|
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
462
417
|
*/
|
|
463
418
|
simulate?: boolean;
|
|
464
|
-
}) => Promise<AssembledTransaction<
|
|
419
|
+
}) => Promise<AssembledTransaction<boolean>>;
|
|
465
420
|
/**
|
|
466
|
-
* Construct and simulate a
|
|
421
|
+
* Construct and simulate a is_asset_valid 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.
|
|
467
422
|
*/
|
|
468
|
-
|
|
469
|
-
|
|
423
|
+
is_asset_valid: ({ addr }: {
|
|
424
|
+
addr: string;
|
|
470
425
|
}, options?: {
|
|
471
426
|
/**
|
|
472
427
|
* The fee to pay for the transaction. Default: BASE_FEE
|
|
@@ -480,29 +435,29 @@ export interface Client {
|
|
|
480
435
|
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
481
436
|
*/
|
|
482
437
|
simulate?: boolean;
|
|
483
|
-
}) => Promise<AssembledTransaction<
|
|
438
|
+
}) => Promise<AssembledTransaction<boolean>>;
|
|
484
439
|
}
|
|
485
440
|
export declare class Client extends ContractClient {
|
|
486
441
|
readonly options: ContractClientOptions;
|
|
487
442
|
constructor(options: ContractClientOptions);
|
|
488
443
|
readonly fromJSON: {
|
|
489
444
|
initialize: (json: string) => AssembledTransaction<null>;
|
|
490
|
-
get_huma_owner: (json: string) => AssembledTransaction<string>;
|
|
491
445
|
set_huma_owner: (json: string) => AssembledTransaction<null>;
|
|
492
|
-
get_huma_treasury: (json: string) => AssembledTransaction<string>;
|
|
493
446
|
set_huma_treasury: (json: string) => AssembledTransaction<null>;
|
|
494
|
-
get_sentinel: (json: string) => AssembledTransaction<string>;
|
|
495
447
|
set_sentinel: (json: string) => AssembledTransaction<null>;
|
|
496
|
-
|
|
448
|
+
set_liquidity_asset: (json: string) => AssembledTransaction<null>;
|
|
449
|
+
set_protocol_fee_bps: (json: string) => AssembledTransaction<null>;
|
|
497
450
|
pause_protocol: (json: string) => AssembledTransaction<null>;
|
|
498
451
|
unpause_protocol: (json: string) => AssembledTransaction<null>;
|
|
499
|
-
is_pauser: (json: string) => AssembledTransaction<boolean>;
|
|
500
452
|
add_pauser: (json: string) => AssembledTransaction<null>;
|
|
501
453
|
remove_pauser: (json: string) => AssembledTransaction<null>;
|
|
502
|
-
is_asset_valid: (json: string) => AssembledTransaction<boolean>;
|
|
503
|
-
set_liquidity_asset: (json: string) => AssembledTransaction<null>;
|
|
504
|
-
get_protocol_fee_bps: (json: string) => AssembledTransaction<number>;
|
|
505
|
-
set_protocol_fee_bps: (json: string) => AssembledTransaction<null>;
|
|
506
454
|
upgrade: (json: string) => AssembledTransaction<null>;
|
|
455
|
+
get_huma_owner: (json: string) => AssembledTransaction<string>;
|
|
456
|
+
get_huma_treasury: (json: string) => AssembledTransaction<string>;
|
|
457
|
+
get_sentinel: (json: string) => AssembledTransaction<string>;
|
|
458
|
+
get_protocol_fee_bps: (json: string) => AssembledTransaction<number>;
|
|
459
|
+
is_pauser: (json: string) => AssembledTransaction<boolean>;
|
|
460
|
+
is_protocol_paused: (json: string) => AssembledTransaction<boolean>;
|
|
461
|
+
is_asset_valid: (json: string) => AssembledTransaction<boolean>;
|
|
507
462
|
};
|
|
508
463
|
}
|
package/dist/index.js
CHANGED
|
@@ -1,84 +1,117 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
19
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
20
|
+
};
|
|
21
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
22
|
+
if (mod && mod.__esModule) return mod;
|
|
23
|
+
var result = {};
|
|
24
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
25
|
+
__setModuleDefault(result, mod);
|
|
26
|
+
return result;
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
exports.Client = exports.Errors = exports.networks = exports.rpc = exports.contract = void 0;
|
|
30
|
+
const buffer_1 = require("buffer");
|
|
31
|
+
const contract_1 = require("@stellar/stellar-sdk/contract");
|
|
32
|
+
__exportStar(require("@stellar/stellar-sdk"), exports);
|
|
33
|
+
exports.contract = __importStar(require("@stellar/stellar-sdk/contract"));
|
|
34
|
+
exports.rpc = __importStar(require("@stellar/stellar-sdk/rpc"));
|
|
6
35
|
if (typeof window !== "undefined") {
|
|
7
36
|
//@ts-ignore Buffer exists
|
|
8
|
-
window.Buffer = window.Buffer || Buffer;
|
|
37
|
+
window.Buffer = window.Buffer || buffer_1.Buffer;
|
|
9
38
|
}
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
networkPassphrase: "
|
|
13
|
-
contractId: "
|
|
39
|
+
exports.networks = {
|
|
40
|
+
unknown: {
|
|
41
|
+
networkPassphrase: "Public Global Stellar Network ; September 2015",
|
|
42
|
+
contractId: "CAVRWN3JYHZLKREHPDXFRCMEXPLPF2LIYRWKBHIRWSE62OCRTELBLQ4O",
|
|
14
43
|
},
|
|
15
44
|
};
|
|
16
|
-
|
|
17
|
-
101: { message: "" },
|
|
18
|
-
102: { message: "" },
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
45
|
+
exports.Errors = {
|
|
46
|
+
101: { message: "PauserRequired" },
|
|
47
|
+
102: { message: "ProtocolFeeHigherThanUpperLimit" },
|
|
48
|
+
103: { message: "InvalidNumberOfDecimalsForLiquidityAsset" },
|
|
49
|
+
1: { message: "AlreadyInitialized" },
|
|
50
|
+
2: { message: "ProtocolIsPausedOrPoolIsNotOn" },
|
|
51
|
+
3: { message: "PoolOwnerOrHumaOwnerRequired" },
|
|
52
|
+
4: { message: "PoolOperatorRequired" },
|
|
53
|
+
5: { message: "AuthorizedContractCallerRequired" },
|
|
54
|
+
6: { message: "UnsupportedFunction" },
|
|
55
|
+
7: { message: "ZeroAmountProvided" },
|
|
24
56
|
};
|
|
25
|
-
|
|
57
|
+
class Client extends contract_1.Client {
|
|
26
58
|
options;
|
|
27
59
|
constructor(options) {
|
|
28
|
-
super(new
|
|
60
|
+
super(new contract_1.Spec([
|
|
29
61
|
"AAAAAAAAAAAAAAAKaW5pdGlhbGl6ZQAAAAAAAwAAAAAAAAAKaHVtYV9vd25lcgAAAAAAEwAAAAAAAAANaHVtYV90cmVhc3VyeQAAAAAAABMAAAAAAAAACHNlbnRpbmVsAAAAEwAAAAA=",
|
|
30
|
-
"AAAAAAAAAAAAAAAOZ2V0X2h1bWFfb3duZXIAAAAAAAAAAAABAAAAEw==",
|
|
31
62
|
"AAAAAAAAAAAAAAAOc2V0X2h1bWFfb3duZXIAAAAAAAEAAAAAAAAABGFkZHIAAAATAAAAAA==",
|
|
32
|
-
"AAAAAAAAAAAAAAARZ2V0X2h1bWFfdHJlYXN1cnkAAAAAAAAAAAAAAQAAABM=",
|
|
33
63
|
"AAAAAAAAAAAAAAARc2V0X2h1bWFfdHJlYXN1cnkAAAAAAAABAAAAAAAAAARhZGRyAAAAEwAAAAA=",
|
|
34
|
-
"AAAAAAAAAAAAAAAMZ2V0X3NlbnRpbmVsAAAAAAAAAAEAAAAT",
|
|
35
64
|
"AAAAAAAAAAAAAAAMc2V0X3NlbnRpbmVsAAAAAQAAAAAAAAAEYWRkcgAAABMAAAAA",
|
|
36
|
-
"
|
|
65
|
+
"AAAAAAAAAAAAAAATc2V0X2xpcXVpZGl0eV9hc3NldAAAAAACAAAAAAAAAARhZGRyAAAAEwAAAAAAAAAFdmFsaWQAAAAAAAABAAAAAA==",
|
|
66
|
+
"AAAAAAAAAAAAAAAUc2V0X3Byb3RvY29sX2ZlZV9icHM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ZlbnQAAAAAAAEAAAAAAAAAB2FjY291bnQAAAAAEw==",
|
|
91
|
+
"AAAAAQAAAAAAAAAAAAAAF1Byb3RvY29sRmVlQ2hhbmdlZEV2ZW50AAAAAAIAAAAAAAAAC25ld19mZWVfYnBzAAAAAAQAAAAAAAAAC29sZF9mZWVfYnBzAAAAAAQ=",
|
|
92
|
+
"AAAABAAAAAAAAAAAAAAAC0NvbW1vbkVycm9yAAAAAAcAAAAAAAAAEkFscmVhZHlJbml0aWFsaXplZAAAAAAAAQAAAAAAAAAdUHJvdG9jb2xJc1BhdXNlZE9yUG9vbElzTm90T24AAAAAAAACAAAAAAAAABxQb29sT3duZXJPckh1bWFPd25lclJlcXVpcmVkAAAAAwAAAAAAAAAUUG9vbE9wZXJhdG9yUmVxdWlyZWQAAAAEAAAAAAAAACBBdXRob3JpemVkQ29udHJhY3RDYWxsZXJSZXF1aXJlZAAAAAUAAAAAAAAAE1Vuc3VwcG9ydGVkRnVuY3Rpb24AAAAABgAAAAAAAAASWmVyb0Ftb3VudFByb3ZpZGVkAAAAAAAH",
|
|
61
93
|
]), options);
|
|
62
94
|
this.options = options;
|
|
63
95
|
}
|
|
64
96
|
fromJSON = {
|
|
65
97
|
initialize: (this.txFromJSON),
|
|
66
|
-
get_huma_owner: (this.txFromJSON),
|
|
67
98
|
set_huma_owner: (this.txFromJSON),
|
|
68
|
-
get_huma_treasury: (this.txFromJSON),
|
|
69
99
|
set_huma_treasury: (this.txFromJSON),
|
|
70
|
-
get_sentinel: (this.txFromJSON),
|
|
71
100
|
set_sentinel: (this.txFromJSON),
|
|
72
|
-
|
|
101
|
+
set_liquidity_asset: (this.txFromJSON),
|
|
102
|
+
set_protocol_fee_bps: (this.txFromJSON),
|
|
73
103
|
pause_protocol: (this.txFromJSON),
|
|
74
104
|
unpause_protocol: (this.txFromJSON),
|
|
75
|
-
is_pauser: (this.txFromJSON),
|
|
76
105
|
add_pauser: (this.txFromJSON),
|
|
77
106
|
remove_pauser: (this.txFromJSON),
|
|
78
|
-
is_asset_valid: (this.txFromJSON),
|
|
79
|
-
set_liquidity_asset: (this.txFromJSON),
|
|
80
|
-
get_protocol_fee_bps: (this.txFromJSON),
|
|
81
|
-
set_protocol_fee_bps: (this.txFromJSON),
|
|
82
107
|
upgrade: (this.txFromJSON),
|
|
108
|
+
get_huma_owner: (this.txFromJSON),
|
|
109
|
+
get_huma_treasury: (this.txFromJSON),
|
|
110
|
+
get_sentinel: (this.txFromJSON),
|
|
111
|
+
get_protocol_fee_bps: (this.txFromJSON),
|
|
112
|
+
is_pauser: (this.txFromJSON),
|
|
113
|
+
is_protocol_paused: (this.txFromJSON),
|
|
114
|
+
is_asset_valid: (this.txFromJSON),
|
|
83
115
|
};
|
|
84
116
|
}
|
|
117
|
+
exports.Client = Client;
|
package/package.json
CHANGED
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.0.
|
|
2
|
+
"version": "0.0.16",
|
|
3
3
|
"name": "@huma-finance/soroban-huma-config",
|
|
4
|
-
"exports":
|
|
4
|
+
"exports": {
|
|
5
|
+
".": {
|
|
6
|
+
"require": "./dist/cjs/index.js",
|
|
7
|
+
"import": "./dist/index.js"
|
|
8
|
+
}
|
|
9
|
+
},
|
|
5
10
|
"typings": "dist/index.d.ts",
|
|
6
11
|
"scripts": {
|
|
7
|
-
"build": "tsc"
|
|
12
|
+
"build": "tsc --project ./tsconfig.json && tsc --project ./tsconfig.cjs.json",
|
|
13
|
+
"clean": "tsc --build --clean && rm -rf dist"
|
|
8
14
|
},
|
|
9
15
|
"dependencies": {
|
|
10
16
|
"@stellar/stellar-sdk": "12.1.0",
|
|
@@ -17,5 +23,5 @@
|
|
|
17
23
|
"access": "public",
|
|
18
24
|
"registry": "https://registry.npmjs.org/"
|
|
19
25
|
},
|
|
20
|
-
"gitHead": "
|
|
26
|
+
"gitHead": "73184c70388ca1526026499258cefe8daf23cbef"
|
|
21
27
|
}
|