@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/README.md
CHANGED
|
@@ -6,9 +6,9 @@ This library was automatically generated by Soroban CLI using a command similar
|
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
8
|
soroban contract bindings ts \
|
|
9
|
-
--rpc-url https://
|
|
10
|
-
--network-passphrase "
|
|
11
|
-
--contract-id
|
|
9
|
+
--rpc-url https://mainnet.sorobanrpc.com \
|
|
10
|
+
--network-passphrase "Public Global Stellar Network ; September 2015" \
|
|
11
|
+
--contract-id CAVRWN3JYHZLKREHPDXFRCMEXPLPF2LIYRWKBHIRWSE62OCRTELBLQ4O \
|
|
12
12
|
--output-dir ./path/to/tb-humaConfig
|
|
13
13
|
```
|
|
14
14
|
|
|
@@ -30,7 +30,7 @@ However, we've actually encountered [frustration](https://github.com/stellar/sor
|
|
|
30
30
|
|
|
31
31
|
```json
|
|
32
32
|
"scripts": {
|
|
33
|
-
"postinstall": "soroban contract bindings ts --rpc-url https://
|
|
33
|
+
"postinstall": "soroban contract bindings ts --rpc-url https://mainnet.sorobanrpc.com --network-passphrase \"Public Global Stellar Network ; September 2015\" --id CAVRWN3JYHZLKREHPDXFRCMEXPLPF2LIYRWKBHIRWSE62OCRTELBLQ4O --name tb-humaConfig"
|
|
34
34
|
}
|
|
35
35
|
```
|
|
36
36
|
|
|
@@ -0,0 +1,463 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
/// <reference types="node" />
|
|
3
|
+
import { Buffer } from "buffer";
|
|
4
|
+
import { AssembledTransaction, Client as ContractClient, ClientOptions as ContractClientOptions } from "@stellar/stellar-sdk/contract";
|
|
5
|
+
import type { u32 } from "@stellar/stellar-sdk/contract";
|
|
6
|
+
export * from "@stellar/stellar-sdk";
|
|
7
|
+
export * as contract from "@stellar/stellar-sdk/contract";
|
|
8
|
+
export * as rpc from "@stellar/stellar-sdk/rpc";
|
|
9
|
+
export declare const networks: {
|
|
10
|
+
readonly unknown: {
|
|
11
|
+
readonly networkPassphrase: "Public Global Stellar Network ; September 2015";
|
|
12
|
+
readonly contractId: "CAVRWN3JYHZLKREHPDXFRCMEXPLPF2LIYRWKBHIRWSE62OCRTELBLQ4O";
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
export declare const Errors: {
|
|
16
|
+
101: {
|
|
17
|
+
message: string;
|
|
18
|
+
};
|
|
19
|
+
102: {
|
|
20
|
+
message: string;
|
|
21
|
+
};
|
|
22
|
+
103: {
|
|
23
|
+
message: string;
|
|
24
|
+
};
|
|
25
|
+
1: {
|
|
26
|
+
message: string;
|
|
27
|
+
};
|
|
28
|
+
2: {
|
|
29
|
+
message: string;
|
|
30
|
+
};
|
|
31
|
+
3: {
|
|
32
|
+
message: string;
|
|
33
|
+
};
|
|
34
|
+
4: {
|
|
35
|
+
message: string;
|
|
36
|
+
};
|
|
37
|
+
5: {
|
|
38
|
+
message: string;
|
|
39
|
+
};
|
|
40
|
+
6: {
|
|
41
|
+
message: string;
|
|
42
|
+
};
|
|
43
|
+
7: {
|
|
44
|
+
message: string;
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
export type HumaConfigDataKey = {
|
|
48
|
+
tag: "HumaOwner";
|
|
49
|
+
values: void;
|
|
50
|
+
} | {
|
|
51
|
+
tag: "HumaTreasury";
|
|
52
|
+
values: void;
|
|
53
|
+
} | {
|
|
54
|
+
tag: "Sentinel";
|
|
55
|
+
values: void;
|
|
56
|
+
} | {
|
|
57
|
+
tag: "ProtocolFeeBps";
|
|
58
|
+
values: void;
|
|
59
|
+
} | {
|
|
60
|
+
tag: "IsPaused";
|
|
61
|
+
values: void;
|
|
62
|
+
} | {
|
|
63
|
+
tag: "Pauser";
|
|
64
|
+
values: readonly [string];
|
|
65
|
+
} | {
|
|
66
|
+
tag: "ValidLiquidityAsset";
|
|
67
|
+
values: readonly [string];
|
|
68
|
+
};
|
|
69
|
+
export interface ProtocolInitializedEvent {
|
|
70
|
+
huma_owner: string;
|
|
71
|
+
huma_treasury: string;
|
|
72
|
+
sentinel: string;
|
|
73
|
+
}
|
|
74
|
+
export interface HumaOwnerChangedEvent {
|
|
75
|
+
huma_owner: string;
|
|
76
|
+
}
|
|
77
|
+
export interface ProtocolPausedEvent {
|
|
78
|
+
paused: boolean;
|
|
79
|
+
}
|
|
80
|
+
export interface ProtocolUnpausedEvent {
|
|
81
|
+
paused: boolean;
|
|
82
|
+
}
|
|
83
|
+
export interface HumaTreasuryChangedEvent {
|
|
84
|
+
treasury: string;
|
|
85
|
+
}
|
|
86
|
+
export interface PauserAddedEvent {
|
|
87
|
+
pauser: string;
|
|
88
|
+
}
|
|
89
|
+
export interface PauserRemovedEvent {
|
|
90
|
+
pauser: string;
|
|
91
|
+
}
|
|
92
|
+
export interface LiquidityAssetAddedEvent {
|
|
93
|
+
asset: string;
|
|
94
|
+
}
|
|
95
|
+
export interface LiquidityAssetRemovedEvent {
|
|
96
|
+
asset: string;
|
|
97
|
+
}
|
|
98
|
+
export interface SentinelServiceAccountChangedEvent {
|
|
99
|
+
account: string;
|
|
100
|
+
}
|
|
101
|
+
export interface ProtocolFeeChangedEvent {
|
|
102
|
+
new_fee_bps: u32;
|
|
103
|
+
old_fee_bps: u32;
|
|
104
|
+
}
|
|
105
|
+
export interface Client {
|
|
106
|
+
/**
|
|
107
|
+
* 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.
|
|
108
|
+
*/
|
|
109
|
+
initialize: ({ huma_owner, huma_treasury, sentinel, }: {
|
|
110
|
+
huma_owner: string;
|
|
111
|
+
huma_treasury: string;
|
|
112
|
+
sentinel: string;
|
|
113
|
+
}, options?: {
|
|
114
|
+
/**
|
|
115
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
116
|
+
*/
|
|
117
|
+
fee?: number;
|
|
118
|
+
/**
|
|
119
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
120
|
+
*/
|
|
121
|
+
timeoutInSeconds?: number;
|
|
122
|
+
/**
|
|
123
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
124
|
+
*/
|
|
125
|
+
simulate?: boolean;
|
|
126
|
+
}) => Promise<AssembledTransaction<null>>;
|
|
127
|
+
/**
|
|
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.
|
|
129
|
+
*/
|
|
130
|
+
set_huma_owner: ({ addr }: {
|
|
131
|
+
addr: string;
|
|
132
|
+
}, options?: {
|
|
133
|
+
/**
|
|
134
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
135
|
+
*/
|
|
136
|
+
fee?: number;
|
|
137
|
+
/**
|
|
138
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
139
|
+
*/
|
|
140
|
+
timeoutInSeconds?: number;
|
|
141
|
+
/**
|
|
142
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
143
|
+
*/
|
|
144
|
+
simulate?: boolean;
|
|
145
|
+
}) => Promise<AssembledTransaction<null>>;
|
|
146
|
+
/**
|
|
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.
|
|
148
|
+
*/
|
|
149
|
+
set_huma_treasury: ({ addr }: {
|
|
150
|
+
addr: string;
|
|
151
|
+
}, options?: {
|
|
152
|
+
/**
|
|
153
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
154
|
+
*/
|
|
155
|
+
fee?: number;
|
|
156
|
+
/**
|
|
157
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
158
|
+
*/
|
|
159
|
+
timeoutInSeconds?: number;
|
|
160
|
+
/**
|
|
161
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
162
|
+
*/
|
|
163
|
+
simulate?: boolean;
|
|
164
|
+
}) => Promise<AssembledTransaction<null>>;
|
|
165
|
+
/**
|
|
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.
|
|
167
|
+
*/
|
|
168
|
+
set_sentinel: ({ addr }: {
|
|
169
|
+
addr: string;
|
|
170
|
+
}, options?: {
|
|
171
|
+
/**
|
|
172
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
173
|
+
*/
|
|
174
|
+
fee?: number;
|
|
175
|
+
/**
|
|
176
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
177
|
+
*/
|
|
178
|
+
timeoutInSeconds?: number;
|
|
179
|
+
/**
|
|
180
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
181
|
+
*/
|
|
182
|
+
simulate?: boolean;
|
|
183
|
+
}) => Promise<AssembledTransaction<null>>;
|
|
184
|
+
/**
|
|
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.
|
|
186
|
+
*/
|
|
187
|
+
set_liquidity_asset: ({ addr, valid }: {
|
|
188
|
+
addr: string;
|
|
189
|
+
valid: boolean;
|
|
190
|
+
}, options?: {
|
|
191
|
+
/**
|
|
192
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
193
|
+
*/
|
|
194
|
+
fee?: number;
|
|
195
|
+
/**
|
|
196
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
197
|
+
*/
|
|
198
|
+
timeoutInSeconds?: number;
|
|
199
|
+
/**
|
|
200
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
201
|
+
*/
|
|
202
|
+
simulate?: boolean;
|
|
203
|
+
}) => Promise<AssembledTransaction<null>>;
|
|
204
|
+
/**
|
|
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.
|
|
206
|
+
*/
|
|
207
|
+
set_protocol_fee_bps: ({ fee_bps }: {
|
|
208
|
+
fee_bps: u32;
|
|
209
|
+
}, options?: {
|
|
210
|
+
/**
|
|
211
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
212
|
+
*/
|
|
213
|
+
fee?: number;
|
|
214
|
+
/**
|
|
215
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
216
|
+
*/
|
|
217
|
+
timeoutInSeconds?: number;
|
|
218
|
+
/**
|
|
219
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
220
|
+
*/
|
|
221
|
+
simulate?: boolean;
|
|
222
|
+
}) => Promise<AssembledTransaction<null>>;
|
|
223
|
+
/**
|
|
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.
|
|
225
|
+
*/
|
|
226
|
+
pause_protocol: ({ caller }: {
|
|
227
|
+
caller: string;
|
|
228
|
+
}, options?: {
|
|
229
|
+
/**
|
|
230
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
231
|
+
*/
|
|
232
|
+
fee?: number;
|
|
233
|
+
/**
|
|
234
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
235
|
+
*/
|
|
236
|
+
timeoutInSeconds?: number;
|
|
237
|
+
/**
|
|
238
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
239
|
+
*/
|
|
240
|
+
simulate?: boolean;
|
|
241
|
+
}) => Promise<AssembledTransaction<null>>;
|
|
242
|
+
/**
|
|
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.
|
|
244
|
+
*/
|
|
245
|
+
unpause_protocol: (options?: {
|
|
246
|
+
/**
|
|
247
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
248
|
+
*/
|
|
249
|
+
fee?: number;
|
|
250
|
+
/**
|
|
251
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
252
|
+
*/
|
|
253
|
+
timeoutInSeconds?: number;
|
|
254
|
+
/**
|
|
255
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
256
|
+
*/
|
|
257
|
+
simulate?: boolean;
|
|
258
|
+
}) => Promise<AssembledTransaction<null>>;
|
|
259
|
+
/**
|
|
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.
|
|
261
|
+
*/
|
|
262
|
+
add_pauser: ({ addr }: {
|
|
263
|
+
addr: string;
|
|
264
|
+
}, options?: {
|
|
265
|
+
/**
|
|
266
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
267
|
+
*/
|
|
268
|
+
fee?: number;
|
|
269
|
+
/**
|
|
270
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
271
|
+
*/
|
|
272
|
+
timeoutInSeconds?: number;
|
|
273
|
+
/**
|
|
274
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
275
|
+
*/
|
|
276
|
+
simulate?: boolean;
|
|
277
|
+
}) => Promise<AssembledTransaction<null>>;
|
|
278
|
+
/**
|
|
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.
|
|
280
|
+
*/
|
|
281
|
+
remove_pauser: ({ addr }: {
|
|
282
|
+
addr: string;
|
|
283
|
+
}, 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 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.
|
|
299
|
+
*/
|
|
300
|
+
upgrade: ({ new_wasm_hash }: {
|
|
301
|
+
new_wasm_hash: Buffer;
|
|
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<null>>;
|
|
316
|
+
/**
|
|
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.
|
|
318
|
+
*/
|
|
319
|
+
get_huma_owner: (options?: {
|
|
320
|
+
/**
|
|
321
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
322
|
+
*/
|
|
323
|
+
fee?: number;
|
|
324
|
+
/**
|
|
325
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
326
|
+
*/
|
|
327
|
+
timeoutInSeconds?: number;
|
|
328
|
+
/**
|
|
329
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
330
|
+
*/
|
|
331
|
+
simulate?: boolean;
|
|
332
|
+
}) => Promise<AssembledTransaction<string>>;
|
|
333
|
+
/**
|
|
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.
|
|
335
|
+
*/
|
|
336
|
+
get_huma_treasury: (options?: {
|
|
337
|
+
/**
|
|
338
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
339
|
+
*/
|
|
340
|
+
fee?: number;
|
|
341
|
+
/**
|
|
342
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
343
|
+
*/
|
|
344
|
+
timeoutInSeconds?: number;
|
|
345
|
+
/**
|
|
346
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
347
|
+
*/
|
|
348
|
+
simulate?: boolean;
|
|
349
|
+
}) => Promise<AssembledTransaction<string>>;
|
|
350
|
+
/**
|
|
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.
|
|
352
|
+
*/
|
|
353
|
+
get_sentinel: (options?: {
|
|
354
|
+
/**
|
|
355
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
356
|
+
*/
|
|
357
|
+
fee?: number;
|
|
358
|
+
/**
|
|
359
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
360
|
+
*/
|
|
361
|
+
timeoutInSeconds?: number;
|
|
362
|
+
/**
|
|
363
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
364
|
+
*/
|
|
365
|
+
simulate?: boolean;
|
|
366
|
+
}) => Promise<AssembledTransaction<string>>;
|
|
367
|
+
/**
|
|
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.
|
|
369
|
+
*/
|
|
370
|
+
get_protocol_fee_bps: (options?: {
|
|
371
|
+
/**
|
|
372
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
373
|
+
*/
|
|
374
|
+
fee?: number;
|
|
375
|
+
/**
|
|
376
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
377
|
+
*/
|
|
378
|
+
timeoutInSeconds?: number;
|
|
379
|
+
/**
|
|
380
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
381
|
+
*/
|
|
382
|
+
simulate?: boolean;
|
|
383
|
+
}) => Promise<AssembledTransaction<u32>>;
|
|
384
|
+
/**
|
|
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.
|
|
386
|
+
*/
|
|
387
|
+
is_pauser: ({ addr }: {
|
|
388
|
+
addr: string;
|
|
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<boolean>>;
|
|
403
|
+
/**
|
|
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.
|
|
405
|
+
*/
|
|
406
|
+
is_protocol_paused: (options?: {
|
|
407
|
+
/**
|
|
408
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
409
|
+
*/
|
|
410
|
+
fee?: number;
|
|
411
|
+
/**
|
|
412
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
413
|
+
*/
|
|
414
|
+
timeoutInSeconds?: number;
|
|
415
|
+
/**
|
|
416
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
417
|
+
*/
|
|
418
|
+
simulate?: boolean;
|
|
419
|
+
}) => Promise<AssembledTransaction<boolean>>;
|
|
420
|
+
/**
|
|
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.
|
|
422
|
+
*/
|
|
423
|
+
is_asset_valid: ({ addr }: {
|
|
424
|
+
addr: string;
|
|
425
|
+
}, options?: {
|
|
426
|
+
/**
|
|
427
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
428
|
+
*/
|
|
429
|
+
fee?: number;
|
|
430
|
+
/**
|
|
431
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
432
|
+
*/
|
|
433
|
+
timeoutInSeconds?: number;
|
|
434
|
+
/**
|
|
435
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
436
|
+
*/
|
|
437
|
+
simulate?: boolean;
|
|
438
|
+
}) => Promise<AssembledTransaction<boolean>>;
|
|
439
|
+
}
|
|
440
|
+
export declare class Client extends ContractClient {
|
|
441
|
+
readonly options: ContractClientOptions;
|
|
442
|
+
constructor(options: ContractClientOptions);
|
|
443
|
+
readonly fromJSON: {
|
|
444
|
+
initialize: (json: string) => AssembledTransaction<null>;
|
|
445
|
+
set_huma_owner: (json: string) => AssembledTransaction<null>;
|
|
446
|
+
set_huma_treasury: (json: string) => AssembledTransaction<null>;
|
|
447
|
+
set_sentinel: (json: string) => AssembledTransaction<null>;
|
|
448
|
+
set_liquidity_asset: (json: string) => AssembledTransaction<null>;
|
|
449
|
+
set_protocol_fee_bps: (json: string) => AssembledTransaction<null>;
|
|
450
|
+
pause_protocol: (json: string) => AssembledTransaction<null>;
|
|
451
|
+
unpause_protocol: (json: string) => AssembledTransaction<null>;
|
|
452
|
+
add_pauser: (json: string) => AssembledTransaction<null>;
|
|
453
|
+
remove_pauser: (json: string) => AssembledTransaction<null>;
|
|
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>;
|
|
462
|
+
};
|
|
463
|
+
}
|
|
@@ -0,0 +1,117 @@
|
|
|
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"));
|
|
35
|
+
if (typeof window !== "undefined") {
|
|
36
|
+
//@ts-ignore Buffer exists
|
|
37
|
+
window.Buffer = window.Buffer || buffer_1.Buffer;
|
|
38
|
+
}
|
|
39
|
+
exports.networks = {
|
|
40
|
+
unknown: {
|
|
41
|
+
networkPassphrase: "Public Global Stellar Network ; September 2015",
|
|
42
|
+
contractId: "CAVRWN3JYHZLKREHPDXFRCMEXPLPF2LIYRWKBHIRWSE62OCRTELBLQ4O",
|
|
43
|
+
},
|
|
44
|
+
};
|
|
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" },
|
|
56
|
+
};
|
|
57
|
+
class Client extends contract_1.Client {
|
|
58
|
+
options;
|
|
59
|
+
constructor(options) {
|
|
60
|
+
super(new contract_1.Spec([
|
|
61
|
+
"AAAAAAAAAAAAAAAKaW5pdGlhbGl6ZQAAAAAAAwAAAAAAAAAKaHVtYV9vd25lcgAAAAAAEwAAAAAAAAANaHVtYV90cmVhc3VyeQAAAAAAABMAAAAAAAAACHNlbnRpbmVsAAAAEwAAAAA=",
|
|
62
|
+
"AAAAAAAAAAAAAAAOc2V0X2h1bWFfb3duZXIAAAAAAAEAAAAAAAAABGFkZHIAAAATAAAAAA==",
|
|
63
|
+
"AAAAAAAAAAAAAAARc2V0X2h1bWFfdHJlYXN1cnkAAAAAAAABAAAAAAAAAARhZGRyAAAAEwAAAAA=",
|
|
64
|
+
"AAAAAAAAAAAAAAAMc2V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dG9yUmVxdWlyZWQAAAAEAAAAAAAAACBBdXRob3JpemVkQ29udHJhY3RDYWxsZXJSZXF1aXJlZAAAAAUAAAAAAAAAE1Vuc3VwcG9ydGVkRnVuY3Rpb24AAAAABgAAAAAAAAASWmVyb0Ftb3VudFByb3ZpZGVkAAAAAAAH",
|
|
93
|
+
]), options);
|
|
94
|
+
this.options = options;
|
|
95
|
+
}
|
|
96
|
+
fromJSON = {
|
|
97
|
+
initialize: (this.txFromJSON),
|
|
98
|
+
set_huma_owner: (this.txFromJSON),
|
|
99
|
+
set_huma_treasury: (this.txFromJSON),
|
|
100
|
+
set_sentinel: (this.txFromJSON),
|
|
101
|
+
set_liquidity_asset: (this.txFromJSON),
|
|
102
|
+
set_protocol_fee_bps: (this.txFromJSON),
|
|
103
|
+
pause_protocol: (this.txFromJSON),
|
|
104
|
+
unpause_protocol: (this.txFromJSON),
|
|
105
|
+
add_pauser: (this.txFromJSON),
|
|
106
|
+
remove_pauser: (this.txFromJSON),
|
|
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),
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
exports.Client = Client;
|