@huma-finance/soroban-huma-config 0.0.8-beta.2
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 +54 -0
- package/dist/cjs/index.d.ts +451 -0
- package/dist/cjs/index.js +94 -0
- package/dist/esm/index.d.ts +451 -0
- package/dist/esm/index.js +76 -0
- package/dist/esm/package.json +1 -0
- package/dist/scripts/tsconfig.cjs.tsbuildinfo +1 -0
- package/dist/scripts/tsconfig.esm.tsbuildinfo +1 -0
- package/dist/scripts/tsconfig.types.tsbuildinfo +1 -0
- package/dist/types/index.d.ts +451 -0
- package/package.json +25 -0
- package/scripts/build.mjs +37 -0
- package/scripts/tsconfig.cjs.json +7 -0
- package/scripts/tsconfig.esm.json +7 -0
- package/scripts/tsconfig.types.json +8 -0
- package/src/index.ts +560 -0
- package/tsconfig.json +14 -0
|
@@ -0,0 +1,451 @@
|
|
|
1
|
+
import { AssembledTransaction, ContractClient, ContractClientOptions } from '@stellar/stellar-sdk/lib/contract_client/index.js';
|
|
2
|
+
import type { u32 } from '@stellar/stellar-sdk/lib/contract_client';
|
|
3
|
+
export * from '@stellar/stellar-sdk';
|
|
4
|
+
export * from '@stellar/stellar-sdk/lib/contract_client/index.js';
|
|
5
|
+
export * from '@stellar/stellar-sdk/lib/rust_types/index.js';
|
|
6
|
+
export declare const networks: {
|
|
7
|
+
readonly testnet: {
|
|
8
|
+
readonly networkPassphrase: "Test SDF Network ; September 2015";
|
|
9
|
+
readonly contractId: "CD6E7GFRHBQ627ZXK5YNMQFBBLFCXBBEU6VYXBSQ77CYOYQC5UV3HS76";
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
export declare const Errors: {
|
|
13
|
+
1: {
|
|
14
|
+
message: string;
|
|
15
|
+
};
|
|
16
|
+
2: {
|
|
17
|
+
message: string;
|
|
18
|
+
};
|
|
19
|
+
3: {
|
|
20
|
+
message: string;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
export type HumaConfigDataKey = {
|
|
24
|
+
tag: 'HumaOwner';
|
|
25
|
+
values: void;
|
|
26
|
+
} | {
|
|
27
|
+
tag: 'HumaTreasury';
|
|
28
|
+
values: void;
|
|
29
|
+
} | {
|
|
30
|
+
tag: 'Sentinel';
|
|
31
|
+
values: void;
|
|
32
|
+
} | {
|
|
33
|
+
tag: 'ProtocolFeeInBps';
|
|
34
|
+
values: void;
|
|
35
|
+
} | {
|
|
36
|
+
tag: 'IsPaused';
|
|
37
|
+
values: void;
|
|
38
|
+
} | {
|
|
39
|
+
tag: 'Pauser';
|
|
40
|
+
values: readonly [string];
|
|
41
|
+
} | {
|
|
42
|
+
tag: 'ValidLiquidityAsset';
|
|
43
|
+
values: readonly [string];
|
|
44
|
+
};
|
|
45
|
+
/**
|
|
46
|
+
* The Huma protocol has been initialized.
|
|
47
|
+
* # Fields
|
|
48
|
+
* * `huma_owner` - The address of the Huma owner account.
|
|
49
|
+
* * `huma_treasury` - The address of the Huma treasury account.
|
|
50
|
+
* * `sentinel` - The address of the Sentinel service account.
|
|
51
|
+
*/
|
|
52
|
+
export interface ProtocolInitializedEvent {
|
|
53
|
+
huma_owner: string;
|
|
54
|
+
huma_treasury: string;
|
|
55
|
+
sentinel: string;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* The Huma protocol has been paused.
|
|
59
|
+
* # Fields
|
|
60
|
+
* * `paused` - Whether the protocol is paused. The value acts as a placeholder only to get around
|
|
61
|
+
* the restriction that `contracttype` doesn't allow empty structs. The value is always `true`.
|
|
62
|
+
*/
|
|
63
|
+
export interface ProtocolPausedEvent {
|
|
64
|
+
paused: boolean;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* The Huma protocol has been unpaused.
|
|
68
|
+
* # Fields
|
|
69
|
+
* * `paused` - Whether the protocol is paused. The value acts as a placeholder only to get around
|
|
70
|
+
* the restriction that `contractype` doesn't allow empty structs. The value is always `false`.
|
|
71
|
+
*/
|
|
72
|
+
export interface ProtocolUnpausedEvent {
|
|
73
|
+
paused: boolean;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* The treasury address for the Huma protocol has changed.
|
|
77
|
+
* # Fields
|
|
78
|
+
* * `treasury` - The address of the new Huma treasury.
|
|
79
|
+
*/
|
|
80
|
+
export interface HumaTreasuryChangedEvent {
|
|
81
|
+
treasury: string;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* A pauser has been added. A pauser is someone who can pause the protocol.
|
|
85
|
+
* # Fields
|
|
86
|
+
* * `pauser` - The address of the pauser being added.
|
|
87
|
+
*/
|
|
88
|
+
export interface PauserAddedEvent {
|
|
89
|
+
pauser: string;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* A pauser has been removed.
|
|
93
|
+
* # Fields
|
|
94
|
+
* * `pauser` - The address of the pauser being removed.
|
|
95
|
+
*/
|
|
96
|
+
export interface PauserRemovedEvent {
|
|
97
|
+
pauser: string;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* New underlying asset supported by the protocol is added.
|
|
101
|
+
* # Fields
|
|
102
|
+
* * `asset` - The address of the liquidity asset being added.
|
|
103
|
+
*/
|
|
104
|
+
export interface LiquidityAssetAddedEvent {
|
|
105
|
+
asset: string;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Remove the asset that is no longer supported by the protocol.
|
|
109
|
+
* # Fields
|
|
110
|
+
* * `asset` - The address of the liquidity asset being removed.
|
|
111
|
+
*/
|
|
112
|
+
export interface LiquidityAssetRemovedEvent {
|
|
113
|
+
asset: string;
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* The account for the Sentinel Service has been changed.
|
|
117
|
+
* # Fields
|
|
118
|
+
* * `account` - The address of the new Sentinel Service.
|
|
119
|
+
*/
|
|
120
|
+
export interface SentinelServiceAccountChangedEvent {
|
|
121
|
+
account: string;
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* The protocol fee has been changed.
|
|
125
|
+
* # Fields
|
|
126
|
+
* * `old_fee_bps` - The old protocol fee in bps.
|
|
127
|
+
* * `new_fee_bps` - The new protocol fee in bps.
|
|
128
|
+
*/
|
|
129
|
+
export interface ProtocolFeeChangedEvent {
|
|
130
|
+
new_fee_bps: u32;
|
|
131
|
+
old_fee_bps: u32;
|
|
132
|
+
}
|
|
133
|
+
export interface Client {
|
|
134
|
+
/**
|
|
135
|
+
* 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.
|
|
136
|
+
*/
|
|
137
|
+
initialize: ({ huma_owner, huma_treasury, sentinel, }: {
|
|
138
|
+
huma_owner: string;
|
|
139
|
+
huma_treasury: string;
|
|
140
|
+
sentinel: string;
|
|
141
|
+
}, options?: {
|
|
142
|
+
/**
|
|
143
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
144
|
+
*/
|
|
145
|
+
fee?: number;
|
|
146
|
+
/**
|
|
147
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
148
|
+
*/
|
|
149
|
+
timeoutInSeconds?: number;
|
|
150
|
+
/**
|
|
151
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
152
|
+
*/
|
|
153
|
+
simulate?: boolean;
|
|
154
|
+
}) => Promise<AssembledTransaction<null>>;
|
|
155
|
+
/**
|
|
156
|
+
* 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.
|
|
157
|
+
*/
|
|
158
|
+
get_huma_owner: (options?: {
|
|
159
|
+
/**
|
|
160
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
161
|
+
*/
|
|
162
|
+
fee?: number;
|
|
163
|
+
/**
|
|
164
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
165
|
+
*/
|
|
166
|
+
timeoutInSeconds?: number;
|
|
167
|
+
/**
|
|
168
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
169
|
+
*/
|
|
170
|
+
simulate?: boolean;
|
|
171
|
+
}) => Promise<AssembledTransaction<string>>;
|
|
172
|
+
/**
|
|
173
|
+
* 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.
|
|
174
|
+
*/
|
|
175
|
+
get_huma_treasury: (options?: {
|
|
176
|
+
/**
|
|
177
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
178
|
+
*/
|
|
179
|
+
fee?: number;
|
|
180
|
+
/**
|
|
181
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
182
|
+
*/
|
|
183
|
+
timeoutInSeconds?: number;
|
|
184
|
+
/**
|
|
185
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
186
|
+
*/
|
|
187
|
+
simulate?: boolean;
|
|
188
|
+
}) => Promise<AssembledTransaction<string>>;
|
|
189
|
+
/**
|
|
190
|
+
* 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
|
+
*/
|
|
192
|
+
set_huma_treasury: ({ addr }: {
|
|
193
|
+
addr: string;
|
|
194
|
+
}, options?: {
|
|
195
|
+
/**
|
|
196
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
197
|
+
*/
|
|
198
|
+
fee?: number;
|
|
199
|
+
/**
|
|
200
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
201
|
+
*/
|
|
202
|
+
timeoutInSeconds?: number;
|
|
203
|
+
/**
|
|
204
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
205
|
+
*/
|
|
206
|
+
simulate?: boolean;
|
|
207
|
+
}) => Promise<AssembledTransaction<null>>;
|
|
208
|
+
/**
|
|
209
|
+
* 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.
|
|
210
|
+
*/
|
|
211
|
+
get_sentinel: (options?: {
|
|
212
|
+
/**
|
|
213
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
214
|
+
*/
|
|
215
|
+
fee?: number;
|
|
216
|
+
/**
|
|
217
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
218
|
+
*/
|
|
219
|
+
timeoutInSeconds?: number;
|
|
220
|
+
/**
|
|
221
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
222
|
+
*/
|
|
223
|
+
simulate?: boolean;
|
|
224
|
+
}) => Promise<AssembledTransaction<string>>;
|
|
225
|
+
/**
|
|
226
|
+
* 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.
|
|
227
|
+
*/
|
|
228
|
+
set_sentinel: ({ addr }: {
|
|
229
|
+
addr: string;
|
|
230
|
+
}, options?: {
|
|
231
|
+
/**
|
|
232
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
233
|
+
*/
|
|
234
|
+
fee?: number;
|
|
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>>;
|
|
244
|
+
/**
|
|
245
|
+
* 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.
|
|
246
|
+
*/
|
|
247
|
+
is_protocol_paused: (options?: {
|
|
248
|
+
/**
|
|
249
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
250
|
+
*/
|
|
251
|
+
fee?: number;
|
|
252
|
+
/**
|
|
253
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
254
|
+
*/
|
|
255
|
+
timeoutInSeconds?: number;
|
|
256
|
+
/**
|
|
257
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
258
|
+
*/
|
|
259
|
+
simulate?: boolean;
|
|
260
|
+
}) => Promise<AssembledTransaction<boolean>>;
|
|
261
|
+
/**
|
|
262
|
+
* 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
|
+
*/
|
|
264
|
+
pause_protocol: ({ caller }: {
|
|
265
|
+
caller: string;
|
|
266
|
+
}, options?: {
|
|
267
|
+
/**
|
|
268
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
269
|
+
*/
|
|
270
|
+
fee?: number;
|
|
271
|
+
/**
|
|
272
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
273
|
+
*/
|
|
274
|
+
timeoutInSeconds?: number;
|
|
275
|
+
/**
|
|
276
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
277
|
+
*/
|
|
278
|
+
simulate?: boolean;
|
|
279
|
+
}) => Promise<AssembledTransaction<null>>;
|
|
280
|
+
/**
|
|
281
|
+
* 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
|
+
*/
|
|
283
|
+
unpause_protocol: (options?: {
|
|
284
|
+
/**
|
|
285
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
286
|
+
*/
|
|
287
|
+
fee?: number;
|
|
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>>;
|
|
297
|
+
/**
|
|
298
|
+
* 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.
|
|
299
|
+
*/
|
|
300
|
+
is_pauser: ({ addr }: {
|
|
301
|
+
addr: string;
|
|
302
|
+
}, options?: {
|
|
303
|
+
/**
|
|
304
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
305
|
+
*/
|
|
306
|
+
fee?: number;
|
|
307
|
+
/**
|
|
308
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
309
|
+
*/
|
|
310
|
+
timeoutInSeconds?: number;
|
|
311
|
+
/**
|
|
312
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
313
|
+
*/
|
|
314
|
+
simulate?: boolean;
|
|
315
|
+
}) => Promise<AssembledTransaction<boolean>>;
|
|
316
|
+
/**
|
|
317
|
+
* 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.
|
|
318
|
+
*/
|
|
319
|
+
add_pauser: ({ addr }: {
|
|
320
|
+
addr: string;
|
|
321
|
+
}, options?: {
|
|
322
|
+
/**
|
|
323
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
324
|
+
*/
|
|
325
|
+
fee?: number;
|
|
326
|
+
/**
|
|
327
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
328
|
+
*/
|
|
329
|
+
timeoutInSeconds?: number;
|
|
330
|
+
/**
|
|
331
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
332
|
+
*/
|
|
333
|
+
simulate?: boolean;
|
|
334
|
+
}) => Promise<AssembledTransaction<null>>;
|
|
335
|
+
/**
|
|
336
|
+
* 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.
|
|
337
|
+
*/
|
|
338
|
+
remove_pauser: ({ addr }: {
|
|
339
|
+
addr: string;
|
|
340
|
+
}, options?: {
|
|
341
|
+
/**
|
|
342
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
343
|
+
*/
|
|
344
|
+
fee?: number;
|
|
345
|
+
/**
|
|
346
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
347
|
+
*/
|
|
348
|
+
timeoutInSeconds?: number;
|
|
349
|
+
/**
|
|
350
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
351
|
+
*/
|
|
352
|
+
simulate?: boolean;
|
|
353
|
+
}) => Promise<AssembledTransaction<null>>;
|
|
354
|
+
/**
|
|
355
|
+
* 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.
|
|
356
|
+
*/
|
|
357
|
+
is_asset_valid: ({ addr }: {
|
|
358
|
+
addr: string;
|
|
359
|
+
}, options?: {
|
|
360
|
+
/**
|
|
361
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
362
|
+
*/
|
|
363
|
+
fee?: number;
|
|
364
|
+
/**
|
|
365
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
366
|
+
*/
|
|
367
|
+
timeoutInSeconds?: number;
|
|
368
|
+
/**
|
|
369
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
370
|
+
*/
|
|
371
|
+
simulate?: boolean;
|
|
372
|
+
}) => Promise<AssembledTransaction<boolean>>;
|
|
373
|
+
/**
|
|
374
|
+
* 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.
|
|
375
|
+
*/
|
|
376
|
+
set_liquidity_asset: ({ addr, valid }: {
|
|
377
|
+
addr: string;
|
|
378
|
+
valid: boolean;
|
|
379
|
+
}, options?: {
|
|
380
|
+
/**
|
|
381
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
382
|
+
*/
|
|
383
|
+
fee?: number;
|
|
384
|
+
/**
|
|
385
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
386
|
+
*/
|
|
387
|
+
timeoutInSeconds?: number;
|
|
388
|
+
/**
|
|
389
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
390
|
+
*/
|
|
391
|
+
simulate?: boolean;
|
|
392
|
+
}) => Promise<AssembledTransaction<null>>;
|
|
393
|
+
/**
|
|
394
|
+
* 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.
|
|
395
|
+
*/
|
|
396
|
+
get_protocol_fee_bps: (options?: {
|
|
397
|
+
/**
|
|
398
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
399
|
+
*/
|
|
400
|
+
fee?: number;
|
|
401
|
+
/**
|
|
402
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
403
|
+
*/
|
|
404
|
+
timeoutInSeconds?: number;
|
|
405
|
+
/**
|
|
406
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
407
|
+
*/
|
|
408
|
+
simulate?: boolean;
|
|
409
|
+
}) => Promise<AssembledTransaction<u32>>;
|
|
410
|
+
/**
|
|
411
|
+
* 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.
|
|
412
|
+
*/
|
|
413
|
+
set_protocol_fee_bps: ({ fee_bps }: {
|
|
414
|
+
fee_bps: u32;
|
|
415
|
+
}, options?: {
|
|
416
|
+
/**
|
|
417
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
418
|
+
*/
|
|
419
|
+
fee?: number;
|
|
420
|
+
/**
|
|
421
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
422
|
+
*/
|
|
423
|
+
timeoutInSeconds?: number;
|
|
424
|
+
/**
|
|
425
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
426
|
+
*/
|
|
427
|
+
simulate?: boolean;
|
|
428
|
+
}) => Promise<AssembledTransaction<null>>;
|
|
429
|
+
}
|
|
430
|
+
export declare class Client extends ContractClient {
|
|
431
|
+
readonly options: ContractClientOptions;
|
|
432
|
+
constructor(options: ContractClientOptions);
|
|
433
|
+
readonly fromJSON: {
|
|
434
|
+
initialize: (json: string) => AssembledTransaction<null>;
|
|
435
|
+
get_huma_owner: (json: string) => AssembledTransaction<string>;
|
|
436
|
+
get_huma_treasury: (json: string) => AssembledTransaction<string>;
|
|
437
|
+
set_huma_treasury: (json: string) => AssembledTransaction<null>;
|
|
438
|
+
get_sentinel: (json: string) => AssembledTransaction<string>;
|
|
439
|
+
set_sentinel: (json: string) => AssembledTransaction<null>;
|
|
440
|
+
is_protocol_paused: (json: string) => AssembledTransaction<boolean>;
|
|
441
|
+
pause_protocol: (json: string) => AssembledTransaction<null>;
|
|
442
|
+
unpause_protocol: (json: string) => AssembledTransaction<null>;
|
|
443
|
+
is_pauser: (json: string) => AssembledTransaction<boolean>;
|
|
444
|
+
add_pauser: (json: string) => AssembledTransaction<null>;
|
|
445
|
+
remove_pauser: (json: string) => AssembledTransaction<null>;
|
|
446
|
+
is_asset_valid: (json: string) => AssembledTransaction<boolean>;
|
|
447
|
+
set_liquidity_asset: (json: string) => AssembledTransaction<null>;
|
|
448
|
+
get_protocol_fee_bps: (json: string) => AssembledTransaction<number>;
|
|
449
|
+
set_protocol_fee_bps: (json: string) => AssembledTransaction<null>;
|
|
450
|
+
};
|
|
451
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { ContractSpec } from '@stellar/stellar-sdk';
|
|
2
|
+
import { Buffer } from 'buffer';
|
|
3
|
+
import { ContractClient, } from '@stellar/stellar-sdk/lib/contract_client/index.js';
|
|
4
|
+
export * from '@stellar/stellar-sdk';
|
|
5
|
+
export * from '@stellar/stellar-sdk/lib/contract_client/index.js';
|
|
6
|
+
export * from '@stellar/stellar-sdk/lib/rust_types/index.js';
|
|
7
|
+
if (typeof window !== 'undefined') {
|
|
8
|
+
//@ts-ignore Buffer exists
|
|
9
|
+
window.Buffer = window.Buffer || Buffer;
|
|
10
|
+
}
|
|
11
|
+
export const networks = {
|
|
12
|
+
testnet: {
|
|
13
|
+
networkPassphrase: 'Test SDF Network ; September 2015',
|
|
14
|
+
contractId: 'CD6E7GFRHBQ627ZXK5YNMQFBBLFCXBBEU6VYXBSQ77CYOYQC5UV3HS76',
|
|
15
|
+
},
|
|
16
|
+
};
|
|
17
|
+
export const Errors = {
|
|
18
|
+
1: { message: '' },
|
|
19
|
+
2: { message: '' },
|
|
20
|
+
3: { message: '' },
|
|
21
|
+
};
|
|
22
|
+
export class Client extends ContractClient {
|
|
23
|
+
options;
|
|
24
|
+
constructor(options) {
|
|
25
|
+
super(new ContractSpec([
|
|
26
|
+
'AAAAAAAAAAAAAAAKaW5pdGlhbGl6ZQAAAAAAAwAAAAAAAAAKaHVtYV9vd25lcgAAAAAAEwAAAAAAAAANaHVtYV90cmVhc3VyeQAAAA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YCAtIFRoZSBhZGRyZXNzIG9mIHRoZSBsaXF1aWRpdHkgYXNzZXQgYmVpbmcgcmVtb3ZlZC4AAAAAAAAAGkxpcXVpZGl0eUFzc2V0UmVtb3ZlZEV2ZW50AAAAAAABAAAAAAAAAAVhc3NldAAAAAAAABM=',
|
|
52
|
+
'AAAAAQAAAHZUaGUgYWNjb3VudCBmb3IgdGhlIFNlbnRpbmVsIFNlcnZpY2UgaGFzIGJlZW4gY2hhbmdlZC4KIyBGaWVsZHMKKiBgYWNjb3VudGAgLSBUaGUgYWRkcmVzcyBvZiB0aGUgbmV3IFNlbnRpbmVsIFNlcnZpY2UuAAAAAAAAAAAAIlNlbnRpbmVsU2VydmljZUFjY291bnRDaGFuZ2VkRXZlbnQAAAAAAAEAAAAAAAAAB2FjY291bnQAAAAAEw==',
|
|
53
|
+
'AAAAAQAAAIlUaGUgcHJvdG9jb2wgZmVlIGhhcyBiZWVuIGNoYW5nZWQuCiMgRmllbGRzCiogYG9sZF9mZWVfYnBzYCAtIFRoZSBvbGQgcHJvdG9jb2wgZmVlIGluIGJwcy4KKiBgbmV3X2ZlZV9icHNgIC0gVGhlIG5ldyBwcm90b2NvbCBmZWUgaW4gYnBzLgAAAAAAAAAAAAAXUHJvdG9jb2xGZWVDaGFuZ2VkRXZlbnQAAAAAAgAAAAAAAAALbmV3X2ZlZV9icHMAAAAABAAAAAAAAAALb2xkX2ZlZV9icHMAAAAABA==',
|
|
54
|
+
'AAAABAAAAAAAAAAAAAAAC0NvbW1vbkVycm9yAAAAAAIAAAAAAAAAEkFscmVhZHlJbml0aWFsaXplZAAAAAAAAQAAAAAAAAAgQXV0aG9yaXplZENvbnRyYWN0Q2FsbGVyUmVxdWlyZWQAAABP',
|
|
55
|
+
]), options);
|
|
56
|
+
this.options = options;
|
|
57
|
+
}
|
|
58
|
+
fromJSON = {
|
|
59
|
+
initialize: (this.txFromJSON),
|
|
60
|
+
get_huma_owner: (this.txFromJSON),
|
|
61
|
+
get_huma_treasury: (this.txFromJSON),
|
|
62
|
+
set_huma_treasury: (this.txFromJSON),
|
|
63
|
+
get_sentinel: (this.txFromJSON),
|
|
64
|
+
set_sentinel: (this.txFromJSON),
|
|
65
|
+
is_protocol_paused: (this.txFromJSON),
|
|
66
|
+
pause_protocol: (this.txFromJSON),
|
|
67
|
+
unpause_protocol: (this.txFromJSON),
|
|
68
|
+
is_pauser: (this.txFromJSON),
|
|
69
|
+
add_pauser: (this.txFromJSON),
|
|
70
|
+
remove_pauser: (this.txFromJSON),
|
|
71
|
+
is_asset_valid: (this.txFromJSON),
|
|
72
|
+
set_liquidity_asset: (this.txFromJSON),
|
|
73
|
+
get_protocol_fee_bps: (this.txFromJSON),
|
|
74
|
+
set_protocol_fee_bps: (this.txFromJSON),
|
|
75
|
+
};
|
|
76
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"type": "module"}
|