@ember-finance/sdk 2.0.3 → 2.0.4
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/dist/src/sui-vaults/on-chain-calls/operator.d.ts +19 -1
- package/dist/src/sui-vaults/on-chain-calls/operator.js +32 -0
- package/dist/src/sui-vaults/on-chain-calls/tx-builder.d.ts +42 -0
- package/dist/src/sui-vaults/on-chain-calls/tx-builder.js +139 -0
- package/dist/src/sui-vaults/on-chain-calls/vault-admin.d.ts +24 -0
- package/dist/src/sui-vaults/on-chain-calls/vault-admin.js +45 -0
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { OnChainCalls } from "./onchain-calls.js";
|
|
2
2
|
import { ISuiDeployment, IVaultOptionalParams } from "../interfaces/index.js";
|
|
3
|
-
import { OnChainCallResponse, Signer, SuiClient, SuiTransactionBlockResponseOptions } from "@firefly-exchange/library-sui";
|
|
3
|
+
import { OnChainCallResponse, Signer, SuiAddress, SuiClient, SuiTransactionBlockResponseOptions } from "@firefly-exchange/library-sui";
|
|
4
4
|
import { NumStr } from "@firefly-exchange/library-sui";
|
|
5
5
|
export declare class OperatorCalls extends OnChainCalls {
|
|
6
6
|
constructor(_network: string, _suiClient: SuiClient, _deployment: ISuiDeployment, _signer?: Signer, _walletAddress?: string);
|
|
@@ -82,4 +82,22 @@ export declare class OperatorCalls extends OnChainCalls {
|
|
|
82
82
|
* @returns OnChainCallResponse
|
|
83
83
|
*/
|
|
84
84
|
setBlacklistedAccount(vaultId: string, account: string, isBlacklisted: boolean, options?: IVaultOptionalParams & SuiTransactionBlockResponseOptions): Promise<OnChainCallResponse>;
|
|
85
|
+
/**
|
|
86
|
+
* Set/unset user in deposit user list
|
|
87
|
+
* @param vaultId The id of the vault
|
|
88
|
+
* @param user The user address to set in the list
|
|
89
|
+
* @param status Whether the user should be in the list
|
|
90
|
+
* @param options Optional tx execution params
|
|
91
|
+
* @returns OnChainCallResponse
|
|
92
|
+
*/
|
|
93
|
+
setDepositUserList(vaultId: string, user: SuiAddress, status: boolean, options?: IVaultOptionalParams & SuiTransactionBlockResponseOptions): Promise<OnChainCallResponse>;
|
|
94
|
+
/**
|
|
95
|
+
* Set/unset user in fee exemption list
|
|
96
|
+
* @param vaultId The id of the vault
|
|
97
|
+
* @param user The user address to set in the list
|
|
98
|
+
* @param status Whether the user should be in the list
|
|
99
|
+
* @param options Optional tx execution params
|
|
100
|
+
* @returns OnChainCallResponse
|
|
101
|
+
*/
|
|
102
|
+
setFeeExemptionList(vaultId: string, user: SuiAddress, status: boolean, options?: IVaultOptionalParams & SuiTransactionBlockResponseOptions): Promise<OnChainCallResponse>;
|
|
85
103
|
}
|
|
@@ -145,4 +145,36 @@ export class OperatorCalls extends OnChainCalls {
|
|
|
145
145
|
});
|
|
146
146
|
return this.execCall(txb, options);
|
|
147
147
|
}
|
|
148
|
+
/**
|
|
149
|
+
* Set/unset user in deposit user list
|
|
150
|
+
* @param vaultId The id of the vault
|
|
151
|
+
* @param user The user address to set in the list
|
|
152
|
+
* @param status Whether the user should be in the list
|
|
153
|
+
* @param options Optional tx execution params
|
|
154
|
+
* @returns OnChainCallResponse
|
|
155
|
+
*/
|
|
156
|
+
async setDepositUserList(vaultId, user, status, options) {
|
|
157
|
+
const txb = options?.txBlock || new TransactionBlock();
|
|
158
|
+
this.txBuilder.setDepositUserList(vaultId, user, status, {
|
|
159
|
+
...options,
|
|
160
|
+
txBlock: txb
|
|
161
|
+
});
|
|
162
|
+
return this.execCall(txb, options);
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* Set/unset user in fee exemption list
|
|
166
|
+
* @param vaultId The id of the vault
|
|
167
|
+
* @param user The user address to set in the list
|
|
168
|
+
* @param status Whether the user should be in the list
|
|
169
|
+
* @param options Optional tx execution params
|
|
170
|
+
* @returns OnChainCallResponse
|
|
171
|
+
*/
|
|
172
|
+
async setFeeExemptionList(vaultId, user, status, options) {
|
|
173
|
+
const txb = options?.txBlock || new TransactionBlock();
|
|
174
|
+
this.txBuilder.setFeeExemptionList(vaultId, user, status, {
|
|
175
|
+
...options,
|
|
176
|
+
txBlock: txb
|
|
177
|
+
});
|
|
178
|
+
return this.execCall(txb, options);
|
|
179
|
+
}
|
|
148
180
|
}
|
|
@@ -163,6 +163,48 @@ export declare class TxBuilder {
|
|
|
163
163
|
* @returns TransactionBlock
|
|
164
164
|
*/
|
|
165
165
|
setBlacklistedAccount(vaultId: string, account: string, isBlacklisted: boolean, options?: ITxBuilderOptionalParams): TransactionBlock;
|
|
166
|
+
/**
|
|
167
|
+
* Sets a user on the deposit user list
|
|
168
|
+
* @param vaultId Id of the vault
|
|
169
|
+
* @param user Address of the user
|
|
170
|
+
* @param status Status of the user in the deposit list
|
|
171
|
+
* @param options Optional tx building params
|
|
172
|
+
* @returns TransactionBlock
|
|
173
|
+
*/
|
|
174
|
+
setDepositUserList(vaultId: string, user: string, status: boolean, options?: ITxBuilderOptionalParams): TransactionBlock;
|
|
175
|
+
/**
|
|
176
|
+
* Sets a user on the fee exemption list
|
|
177
|
+
* @param vaultId Id of the vault
|
|
178
|
+
* @param user Address of the user
|
|
179
|
+
* @param status Status of the user in the fee exemption list
|
|
180
|
+
* @param options Optional tx building params
|
|
181
|
+
* @returns TransactionBlock
|
|
182
|
+
*/
|
|
183
|
+
setFeeExemptionList(vaultId: string, user: string, status: boolean, options?: ITxBuilderOptionalParams): TransactionBlock;
|
|
184
|
+
/**
|
|
185
|
+
* Sets the permanent withdrawal fee percentage
|
|
186
|
+
* @param vaultId Id of the vault
|
|
187
|
+
* @param permanentFeePercentage Permanent fee percentage
|
|
188
|
+
* @param options Optional tx building params
|
|
189
|
+
* @returns TransactionBlock
|
|
190
|
+
*/
|
|
191
|
+
setPermanentFeePercentage(vaultId: string, permanentFeePercentage: NumStr, options?: ITxBuilderOptionalParams): TransactionBlock;
|
|
192
|
+
/**
|
|
193
|
+
* Sets the time based withdrawal fee percentage
|
|
194
|
+
* @param vaultId Id of the vault
|
|
195
|
+
* @param timeBasedFeePercentage Time based fee percentage
|
|
196
|
+
* @param options Optional tx building params
|
|
197
|
+
* @returns TransactionBlock
|
|
198
|
+
*/
|
|
199
|
+
setTimeBasedFeePercentage(vaultId: string, timeBasedFeePercentage: NumStr, options?: ITxBuilderOptionalParams): TransactionBlock;
|
|
200
|
+
/**
|
|
201
|
+
* Sets the time based withdrawal fee threshold
|
|
202
|
+
* @param vaultId Id of the vault
|
|
203
|
+
* @param timeBasedFeeThreshold Time based fee threshold
|
|
204
|
+
* @param options Optional tx building params
|
|
205
|
+
* @returns TransactionBlock
|
|
206
|
+
*/
|
|
207
|
+
setTimeBasedFeeThreshold(vaultId: string, timeBasedFeeThreshold: NumStr, options?: ITxBuilderOptionalParams): TransactionBlock;
|
|
166
208
|
/**
|
|
167
209
|
* Updates the rate of the vault
|
|
168
210
|
* @param vaultId Id of the vault
|
|
@@ -501,6 +501,145 @@ export class TxBuilder {
|
|
|
501
501
|
txb.setSenderIfNotSet(options.sender);
|
|
502
502
|
return txb;
|
|
503
503
|
}
|
|
504
|
+
/**
|
|
505
|
+
* Sets a user on the deposit user list
|
|
506
|
+
* @param vaultId Id of the vault
|
|
507
|
+
* @param user Address of the user
|
|
508
|
+
* @param status Status of the user in the deposit list
|
|
509
|
+
* @param options Optional tx building params
|
|
510
|
+
* @returns TransactionBlock
|
|
511
|
+
*/
|
|
512
|
+
setDepositUserList(vaultId, user, status, options) {
|
|
513
|
+
const txb = options?.txBlock || new TransactionBlock();
|
|
514
|
+
txb.moveCall({
|
|
515
|
+
arguments: [
|
|
516
|
+
txb.object(vaultId),
|
|
517
|
+
txb.object(this.parser.getProtocolConfig()),
|
|
518
|
+
txb.pure.address(user),
|
|
519
|
+
txb.pure.bool(status)
|
|
520
|
+
],
|
|
521
|
+
typeArguments: [
|
|
522
|
+
this.parser.getDepositCoinType(vaultId),
|
|
523
|
+
this.parser.getReceiptCoinType(vaultId)
|
|
524
|
+
],
|
|
525
|
+
target: `${this.parser.getPackageId()}::gateway::set_deposit_user_list`
|
|
526
|
+
});
|
|
527
|
+
if (options?.gasBudget)
|
|
528
|
+
txb.setGasBudget(options.gasBudget);
|
|
529
|
+
if (options?.sender)
|
|
530
|
+
txb.setSenderIfNotSet(options.sender);
|
|
531
|
+
return txb;
|
|
532
|
+
}
|
|
533
|
+
/**
|
|
534
|
+
* Sets a user on the fee exemption list
|
|
535
|
+
* @param vaultId Id of the vault
|
|
536
|
+
* @param user Address of the user
|
|
537
|
+
* @param status Status of the user in the fee exemption list
|
|
538
|
+
* @param options Optional tx building params
|
|
539
|
+
* @returns TransactionBlock
|
|
540
|
+
*/
|
|
541
|
+
setFeeExemptionList(vaultId, user, status, options) {
|
|
542
|
+
const txb = options?.txBlock || new TransactionBlock();
|
|
543
|
+
txb.moveCall({
|
|
544
|
+
arguments: [
|
|
545
|
+
txb.object(vaultId),
|
|
546
|
+
txb.object(this.parser.getProtocolConfig()),
|
|
547
|
+
txb.pure.address(user),
|
|
548
|
+
txb.pure.bool(status)
|
|
549
|
+
],
|
|
550
|
+
typeArguments: [
|
|
551
|
+
this.parser.getDepositCoinType(vaultId),
|
|
552
|
+
this.parser.getReceiptCoinType(vaultId)
|
|
553
|
+
],
|
|
554
|
+
target: `${this.parser.getPackageId()}::gateway::set_fee_exemption_list`
|
|
555
|
+
});
|
|
556
|
+
if (options?.gasBudget)
|
|
557
|
+
txb.setGasBudget(options.gasBudget);
|
|
558
|
+
if (options?.sender)
|
|
559
|
+
txb.setSenderIfNotSet(options.sender);
|
|
560
|
+
return txb;
|
|
561
|
+
}
|
|
562
|
+
/**
|
|
563
|
+
* Sets the permanent withdrawal fee percentage
|
|
564
|
+
* @param vaultId Id of the vault
|
|
565
|
+
* @param permanentFeePercentage Permanent fee percentage
|
|
566
|
+
* @param options Optional tx building params
|
|
567
|
+
* @returns TransactionBlock
|
|
568
|
+
*/
|
|
569
|
+
setPermanentFeePercentage(vaultId, permanentFeePercentage, options) {
|
|
570
|
+
const txb = options?.txBlock || new TransactionBlock();
|
|
571
|
+
txb.moveCall({
|
|
572
|
+
arguments: [
|
|
573
|
+
txb.object(vaultId),
|
|
574
|
+
txb.object(this.parser.getProtocolConfig()),
|
|
575
|
+
txb.pure.u64(permanentFeePercentage)
|
|
576
|
+
],
|
|
577
|
+
typeArguments: [
|
|
578
|
+
this.parser.getDepositCoinType(vaultId),
|
|
579
|
+
this.parser.getReceiptCoinType(vaultId)
|
|
580
|
+
],
|
|
581
|
+
target: `${this.parser.getPackageId()}::gateway::set_permanent_fee_percentage`
|
|
582
|
+
});
|
|
583
|
+
if (options?.gasBudget)
|
|
584
|
+
txb.setGasBudget(options.gasBudget);
|
|
585
|
+
if (options?.sender)
|
|
586
|
+
txb.setSenderIfNotSet(options.sender);
|
|
587
|
+
return txb;
|
|
588
|
+
}
|
|
589
|
+
/**
|
|
590
|
+
* Sets the time based withdrawal fee percentage
|
|
591
|
+
* @param vaultId Id of the vault
|
|
592
|
+
* @param timeBasedFeePercentage Time based fee percentage
|
|
593
|
+
* @param options Optional tx building params
|
|
594
|
+
* @returns TransactionBlock
|
|
595
|
+
*/
|
|
596
|
+
setTimeBasedFeePercentage(vaultId, timeBasedFeePercentage, options) {
|
|
597
|
+
const txb = options?.txBlock || new TransactionBlock();
|
|
598
|
+
txb.moveCall({
|
|
599
|
+
arguments: [
|
|
600
|
+
txb.object(vaultId),
|
|
601
|
+
txb.object(this.parser.getProtocolConfig()),
|
|
602
|
+
txb.pure.u64(timeBasedFeePercentage)
|
|
603
|
+
],
|
|
604
|
+
typeArguments: [
|
|
605
|
+
this.parser.getDepositCoinType(vaultId),
|
|
606
|
+
this.parser.getReceiptCoinType(vaultId)
|
|
607
|
+
],
|
|
608
|
+
target: `${this.parser.getPackageId()}::gateway::set_time_based_fee_percentage`
|
|
609
|
+
});
|
|
610
|
+
if (options?.gasBudget)
|
|
611
|
+
txb.setGasBudget(options.gasBudget);
|
|
612
|
+
if (options?.sender)
|
|
613
|
+
txb.setSenderIfNotSet(options.sender);
|
|
614
|
+
return txb;
|
|
615
|
+
}
|
|
616
|
+
/**
|
|
617
|
+
* Sets the time based withdrawal fee threshold
|
|
618
|
+
* @param vaultId Id of the vault
|
|
619
|
+
* @param timeBasedFeeThreshold Time based fee threshold
|
|
620
|
+
* @param options Optional tx building params
|
|
621
|
+
* @returns TransactionBlock
|
|
622
|
+
*/
|
|
623
|
+
setTimeBasedFeeThreshold(vaultId, timeBasedFeeThreshold, options) {
|
|
624
|
+
const txb = options?.txBlock || new TransactionBlock();
|
|
625
|
+
txb.moveCall({
|
|
626
|
+
arguments: [
|
|
627
|
+
txb.object(vaultId),
|
|
628
|
+
txb.object(this.parser.getProtocolConfig()),
|
|
629
|
+
txb.pure.u64(timeBasedFeeThreshold)
|
|
630
|
+
],
|
|
631
|
+
typeArguments: [
|
|
632
|
+
this.parser.getDepositCoinType(vaultId),
|
|
633
|
+
this.parser.getReceiptCoinType(vaultId)
|
|
634
|
+
],
|
|
635
|
+
target: `${this.parser.getPackageId()}::gateway::set_time_based_fee_threshold`
|
|
636
|
+
});
|
|
637
|
+
if (options?.gasBudget)
|
|
638
|
+
txb.setGasBudget(options.gasBudget);
|
|
639
|
+
if (options?.sender)
|
|
640
|
+
txb.setSenderIfNotSet(options.sender);
|
|
641
|
+
return txb;
|
|
642
|
+
}
|
|
504
643
|
/**
|
|
505
644
|
* Updates the rate of the vault
|
|
506
645
|
* @param vaultId Id of the vault
|
|
@@ -61,4 +61,28 @@ export declare class VaultAdminCalls extends OnChainCalls {
|
|
|
61
61
|
* @returns OnChainCallResponse
|
|
62
62
|
*/
|
|
63
63
|
updateVaultMaxTVL(vaultId: string, maxTVL: NumStr, options?: IVaultOptionalParams & SuiTransactionBlockResponseOptions): Promise<OnChainCallResponse>;
|
|
64
|
+
/**
|
|
65
|
+
* Set permanent withdrawal fee percentage
|
|
66
|
+
* @param vaultId The id of the vault
|
|
67
|
+
* @param permanentFeePercentage The new permanent fee percentage
|
|
68
|
+
* @param options Optional tx execution params
|
|
69
|
+
* @returns OnChainCallResponse
|
|
70
|
+
*/
|
|
71
|
+
setPermanentFeePercentage(vaultId: string, permanentFeePercentage: NumStr, options?: IVaultOptionalParams & SuiTransactionBlockResponseOptions): Promise<OnChainCallResponse>;
|
|
72
|
+
/**
|
|
73
|
+
* Set time based withdrawal fee percentage
|
|
74
|
+
* @param vaultId The id of the vault
|
|
75
|
+
* @param timeBasedFeePercentage The new time based fee percentage
|
|
76
|
+
* @param options Optional tx execution params
|
|
77
|
+
* @returns OnChainCallResponse
|
|
78
|
+
*/
|
|
79
|
+
setTimeBasedFeePercentage(vaultId: string, timeBasedFeePercentage: NumStr, options?: IVaultOptionalParams & SuiTransactionBlockResponseOptions): Promise<OnChainCallResponse>;
|
|
80
|
+
/**
|
|
81
|
+
* Set time based withdrawal fee threshold
|
|
82
|
+
* @param vaultId The id of the vault
|
|
83
|
+
* @param timeBasedFeeThreshold The new time based fee threshold
|
|
84
|
+
* @param options Optional tx execution params
|
|
85
|
+
* @returns OnChainCallResponse
|
|
86
|
+
*/
|
|
87
|
+
setTimeBasedFeeThreshold(vaultId: string, timeBasedFeeThreshold: NumStr, options?: IVaultOptionalParams & SuiTransactionBlockResponseOptions): Promise<OnChainCallResponse>;
|
|
64
88
|
}
|
|
@@ -107,4 +107,49 @@ export class VaultAdminCalls extends OnChainCalls {
|
|
|
107
107
|
this.txBuilder.updateVaultMaxTVL(vaultId, maxTVL, { ...options, txBlock: txb });
|
|
108
108
|
return this.execCall(txb, options);
|
|
109
109
|
}
|
|
110
|
+
/**
|
|
111
|
+
* Set permanent withdrawal fee percentage
|
|
112
|
+
* @param vaultId The id of the vault
|
|
113
|
+
* @param permanentFeePercentage The new permanent fee percentage
|
|
114
|
+
* @param options Optional tx execution params
|
|
115
|
+
* @returns OnChainCallResponse
|
|
116
|
+
*/
|
|
117
|
+
async setPermanentFeePercentage(vaultId, permanentFeePercentage, options) {
|
|
118
|
+
const txb = options?.txBlock || new TransactionBlock();
|
|
119
|
+
this.txBuilder.setPermanentFeePercentage(vaultId, permanentFeePercentage, {
|
|
120
|
+
...options,
|
|
121
|
+
txBlock: txb
|
|
122
|
+
});
|
|
123
|
+
return this.execCall(txb, options);
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Set time based withdrawal fee percentage
|
|
127
|
+
* @param vaultId The id of the vault
|
|
128
|
+
* @param timeBasedFeePercentage The new time based fee percentage
|
|
129
|
+
* @param options Optional tx execution params
|
|
130
|
+
* @returns OnChainCallResponse
|
|
131
|
+
*/
|
|
132
|
+
async setTimeBasedFeePercentage(vaultId, timeBasedFeePercentage, options) {
|
|
133
|
+
const txb = options?.txBlock || new TransactionBlock();
|
|
134
|
+
this.txBuilder.setTimeBasedFeePercentage(vaultId, timeBasedFeePercentage, {
|
|
135
|
+
...options,
|
|
136
|
+
txBlock: txb
|
|
137
|
+
});
|
|
138
|
+
return this.execCall(txb, options);
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Set time based withdrawal fee threshold
|
|
142
|
+
* @param vaultId The id of the vault
|
|
143
|
+
* @param timeBasedFeeThreshold The new time based fee threshold
|
|
144
|
+
* @param options Optional tx execution params
|
|
145
|
+
* @returns OnChainCallResponse
|
|
146
|
+
*/
|
|
147
|
+
async setTimeBasedFeeThreshold(vaultId, timeBasedFeeThreshold, options) {
|
|
148
|
+
const txb = options?.txBlock || new TransactionBlock();
|
|
149
|
+
this.txBuilder.setTimeBasedFeeThreshold(vaultId, timeBasedFeeThreshold, {
|
|
150
|
+
...options,
|
|
151
|
+
txBlock: txb
|
|
152
|
+
});
|
|
153
|
+
return this.execCall(txb, options);
|
|
154
|
+
}
|
|
110
155
|
}
|