@ember-finance/sdk 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +102 -0
  3. package/dist/index.d.ts +1 -0
  4. package/dist/index.js +2 -0
  5. package/dist/src/common/types.d.ts +1 -0
  6. package/dist/src/common/types.js +2 -0
  7. package/dist/src/vaults/bluefin-vaults.d.ts +15 -0
  8. package/dist/src/vaults/bluefin-vaults.js +19 -0
  9. package/dist/src/vaults/interfaces/bcs.d.ts +29 -0
  10. package/dist/src/vaults/interfaces/bcs.js +18 -0
  11. package/dist/src/vaults/interfaces/index.d.ts +82 -0
  12. package/dist/src/vaults/interfaces/index.js +2 -0
  13. package/dist/src/vaults/on-chain-calls/admin.d.ts +88 -0
  14. package/dist/src/vaults/on-chain-calls/admin.js +144 -0
  15. package/dist/src/vaults/on-chain-calls/index.d.ts +6 -0
  16. package/dist/src/vaults/on-chain-calls/index.js +22 -0
  17. package/dist/src/vaults/on-chain-calls/onchain-calls.d.ts +34 -0
  18. package/dist/src/vaults/on-chain-calls/onchain-calls.js +53 -0
  19. package/dist/src/vaults/on-chain-calls/operator.d.ts +74 -0
  20. package/dist/src/vaults/on-chain-calls/operator.js +136 -0
  21. package/dist/src/vaults/on-chain-calls/tx-builder.d.ts +252 -0
  22. package/dist/src/vaults/on-chain-calls/tx-builder.js +805 -0
  23. package/dist/src/vaults/on-chain-calls/user.d.ts +47 -0
  24. package/dist/src/vaults/on-chain-calls/user.js +114 -0
  25. package/dist/src/vaults/on-chain-calls/vault-admin.d.ts +64 -0
  26. package/dist/src/vaults/on-chain-calls/vault-admin.js +114 -0
  27. package/dist/src/vaults/on-chain-calls/vault.d.ts +42 -0
  28. package/dist/src/vaults/on-chain-calls/vault.js +79 -0
  29. package/dist/src/vaults/utils/common.d.ts +2 -0
  30. package/dist/src/vaults/utils/common.js +8 -0
  31. package/dist/src/vaults/utils/deployment-parser.d.ts +13 -0
  32. package/dist/src/vaults/utils/deployment-parser.js +49 -0
  33. package/dist/src/vaults/utils/index.d.ts +2 -0
  34. package/dist/src/vaults/utils/index.js +18 -0
  35. package/package.json +79 -0
@@ -0,0 +1,252 @@
1
+ import { DeploymentParser } from "../utils";
2
+ import { IDeployment, ITxBuilderOptionalParams } from "../interfaces";
3
+ import { NumStr, TransactionBlock } from "@firefly-exchange/library-sui";
4
+ export declare class TxBuilder {
5
+ parser: DeploymentParser;
6
+ constructor(_deployment: IDeployment);
7
+ /**
8
+ * Pauses or unpauses the non-admin operations
9
+ * @param pause True if the non-admin operations should be paused, false otherwise
10
+ * @param options Optional tx building params
11
+ * @returns TransactionBlock
12
+ */
13
+ pauseNonAdminOperations(pause: boolean, options?: ITxBuilderOptionalParams): TransactionBlock;
14
+ /**
15
+ * Increases the version of the protocol supported. Only admin can invoke this
16
+ * @param options Optional tx building params
17
+ * @returns TransactionBlock
18
+ */
19
+ increaseProtocolVersion(options?: ITxBuilderOptionalParams): TransactionBlock;
20
+ /**
21
+ * Updates the platform fee recipient
22
+ * @param recipient Address of the platform fee recipient
23
+ * @param options Optional tx building params
24
+ * @returns TransactionBlock
25
+ */
26
+ updatePlatformFeeRecipient(recipient: string, options?: ITxBuilderOptionalParams): TransactionBlock;
27
+ /**
28
+ * Updates the min rate
29
+ * @param minRate Minimum rate for the protocol
30
+ * @param options Optional tx building params
31
+ * @returns TransactionBlock
32
+ */
33
+ updateMinRate(minRate: NumStr, options?: ITxBuilderOptionalParams): TransactionBlock;
34
+ /**
35
+ * Updates the max rate
36
+ * @param maxRate Maximum rate for the protocol
37
+ * @param options Optional tx building params
38
+ * @returns TransactionBlock
39
+ */
40
+ updateMaxRate(maxRate: NumStr, options?: ITxBuilderOptionalParams): TransactionBlock;
41
+ /**
42
+ * Updates the max rate interval
43
+ * @param maxRateInterval Maximum rate interval for the protocol
44
+ * @param options Optional tx building params
45
+ * @returns TransactionBlock
46
+ */
47
+ updateMaxRateInterval(maxRateInterval: NumStr, options?: ITxBuilderOptionalParams): TransactionBlock;
48
+ /**
49
+ * Updates the default rate
50
+ * @param defaultRate Default rate for the protocol
51
+ * @param options Optional tx building params
52
+ * @returns TransactionBlock
53
+ */
54
+ updateDefaultRate(defaultRate: NumStr, options?: ITxBuilderOptionalParams): TransactionBlock;
55
+ /**
56
+ * Updates the max fee percentage
57
+ * @param maxFeePercentage Max fee percentage for the protocol
58
+ * @param options Optional tx building params
59
+ * @returns TransactionBlock
60
+ */
61
+ updateMaxFeePercentage(maxFeePercentage: NumStr, options?: ITxBuilderOptionalParams): TransactionBlock;
62
+ /**
63
+ * Creates a new vault
64
+ * @param depositCoinType Type of the deposit coin
65
+ * @param receiptCoinType Type of the receipt coin
66
+ * @param name Name of the vault
67
+ * @param admin Admin of the vault
68
+ * @param operator Operator of the vault
69
+ * @param maxRateChangePerUpdate Max rate change per update
70
+ * @param feePercentage Fee percentage
71
+ * @param minWithdrawalShares Min withdrawal shares
72
+ * @param rateUpdateInterval Rate update interval
73
+ * @param maxTVL Max TVL
74
+ * @param subAccounts Sub accounts
75
+ * @param options Optional tx building params
76
+ * @returns TransactionBlock
77
+ */
78
+ createVault(depositCoinType: string, receiptCoinType: string, name: string, admin: string, operator: string, maxRateChangePerUpdate: NumStr, feePercentage: NumStr, minWithdrawalShares: NumStr, rateUpdateInterval: NumStr, maxTVL: NumStr, subAccounts: string[], options?: ITxBuilderOptionalParams): TransactionBlock;
79
+ /**
80
+ * Updates vault admin
81
+ * @param vaultId Id of the vault
82
+ * @param admin Admin of the vault
83
+ * @param options Optional tx building params
84
+ * @returns TransactionBlock
85
+ */
86
+ updateVaultAdmin(vaultId: string, admin: string, options?: ITxBuilderOptionalParams): TransactionBlock;
87
+ /**
88
+ * Updates the paused status of the vault
89
+ * @param vaultId Id of the vault
90
+ * @param paused Paused status of the vault
91
+ * @param options Optional tx building params
92
+ * @returns TransactionBlock
93
+ */
94
+ updateVaultPausedStatus(vaultId: string, paused: boolean, options?: ITxBuilderOptionalParams): TransactionBlock;
95
+ /**
96
+ * Updates the operator of the vault
97
+ * @param vaultId Id of the vault
98
+ * @param operator Operator of the vault
99
+ * @param options Optional tx building params
100
+ * @returns TransactionBlock
101
+ */
102
+ updateVaultOperator(vaultId: string, operator: string, options?: ITxBuilderOptionalParams): TransactionBlock;
103
+ /**
104
+ * Updates the min withdrawal shares of the vault
105
+ * @param vaultId Id of the vault
106
+ * @param minWithdrawalShares Min withdrawal shares
107
+ * @param options Optional tx building params
108
+ * @returns TransactionBlock
109
+ */
110
+ updateVaultMinWithdrawalShares(vaultId: string, minWithdrawalShares: NumStr, options?: ITxBuilderOptionalParams): TransactionBlock;
111
+ /**
112
+ * Sets a sub account
113
+ * @param vaultId Id of the vault
114
+ * @param subAccount Sub account of the vault
115
+ * @param isActive Is active
116
+ * @param options Optional tx building params
117
+ * @returns TransactionBlock
118
+ */
119
+ setSubAccount(vaultId: string, subAccount: string, isActive: boolean, options?: ITxBuilderOptionalParams): TransactionBlock;
120
+ /**
121
+ * Updates vault max TVL
122
+ * @param vaultId Id of the vault
123
+ * @param maxTVL Max TVL of the vault
124
+ * @param options Optional tx building params
125
+ * @returns TransactionBlock
126
+ */
127
+ updateVaultMaxTVL(vaultId: string, maxTVL: NumStr, options?: ITxBuilderOptionalParams): TransactionBlock;
128
+ /**
129
+ * Updates the rate update interval of the vault
130
+ * @param vaultId Id of the vault
131
+ * @param rateUpdateInterval Rate update interval in ms
132
+ * @param options Optional tx building params
133
+ * @returns TransactionBlock
134
+ */
135
+ updateVaultRateUpdateInterval(vaultId: string, rateUpdateInterval: NumStr, options?: ITxBuilderOptionalParams): TransactionBlock;
136
+ /**
137
+ * Updates the fee percentage of the vault
138
+ * @param vaultId Id of the vault
139
+ * @param feePercentage Fee percentage
140
+ * @param options Optional tx building params
141
+ * @returns TransactionBlock
142
+ */
143
+ updateVaultFeePercentage(vaultId: string, feePercentage: NumStr, options?: ITxBuilderOptionalParams): TransactionBlock;
144
+ /**
145
+ * Set min withdrawal shares
146
+ * @param vaultId Id of the vault
147
+ * @param minWithdrawalShares Min withdrawal shares
148
+ * @param options Optional tx building params
149
+ * @returns TransactionBlock
150
+ */
151
+ setMinWithdrawalShares(vaultId: string, minWithdrawalShares: NumStr, options?: ITxBuilderOptionalParams): TransactionBlock;
152
+ /**
153
+ * Sets a blacklisted account
154
+ * @param vaultId Id of the vault
155
+ * @param account Address of the account
156
+ * @param isBlacklisted Is blacklisted
157
+ * @param options Optional tx building params
158
+ * @returns TransactionBlock
159
+ */
160
+ setBlacklistedAccount(vaultId: string, account: string, isBlacklisted: boolean, options?: ITxBuilderOptionalParams): TransactionBlock;
161
+ /**
162
+ * Updates the rate of the vault
163
+ * @param vaultId Id of the vault
164
+ * @param rate Rate of the vault
165
+ * @param options Optional tx building params
166
+ * @returns TransactionBlock
167
+ */
168
+ updateVaultRate(vaultId: string, rate: NumStr, options?: ITxBuilderOptionalParams): TransactionBlock;
169
+ /**
170
+ * Deposit to vault without minting shares
171
+ * @param vaultId Id of the vault
172
+ * @param subAccount Sub account of the vault
173
+ * @param coinId Id of the coin
174
+ * @param options Optional tx building params
175
+ * @returns TransactionBlock
176
+ */
177
+ depositToVaultWithoutMintingShares(vaultId: string, subAccount: string, coinId: string, options?: ITxBuilderOptionalParams): TransactionBlock;
178
+ /**
179
+ * Withdraw from vault without redeeming shares
180
+ * @param vaultId Id of the vault
181
+ * @param subAccount Sub account of the vault
182
+ * @param amount Amount to withdraw
183
+ * @param options Optional tx building params
184
+ * @returns TransactionBlock
185
+ */
186
+ withdrawFromVaultWithoutRedeemingShares(vaultId: string, subAccount: string, amount: NumStr, options?: ITxBuilderOptionalParams): TransactionBlock;
187
+ /**
188
+ * Process withdrawal requests
189
+ * @param vaultId Id of the vault
190
+ * @param requestCount Max number of requests to process
191
+ * @param options Optional tx building params
192
+ * @returns TransactionBlock
193
+ */
194
+ processWithdrawalRequests(vaultId: string, requestCount: NumStr, options?: ITxBuilderOptionalParams): TransactionBlock;
195
+ /**
196
+ * Process withdrawal requests up to timestamp
197
+ * @param vaultId Id of the vault
198
+ * @param timestamp Timestamp
199
+ * @param options Optional tx building params
200
+ * @returns TransactionBlock
201
+ */
202
+ processWithdrawalRequestsUpToTimestamp(vaultId: string, timestamp: NumStr, options?: ITxBuilderOptionalParams): TransactionBlock;
203
+ /**
204
+ * Charge platform fee
205
+ * @param vaultId Id of the vault
206
+ * @param options Optional tx building params
207
+ * @returns TransactionBlock
208
+ */
209
+ chargePlatformFee(vaultId: string, options?: ITxBuilderOptionalParams): TransactionBlock;
210
+ /**
211
+ * Collect platform fee
212
+ * @param vaultId Id of the vault
213
+ * @param options Optional tx building params
214
+ * @returns TransactionBlock
215
+ */
216
+ collectPlatformFee(vaultId: string, options?: ITxBuilderOptionalParams): TransactionBlock;
217
+ /**
218
+ * Deposit asset
219
+ * @param vaultId Id of the vault
220
+ * @param coinId Id of the coin
221
+ * @param options Optional tx building params
222
+ * @returns TransactionBlock
223
+ */
224
+ depositAsset(vaultId: string, coinId: string, options?: ITxBuilderOptionalParams): TransactionBlock;
225
+ /**
226
+ * Mint shares
227
+ * @param vaultId Id of the vault
228
+ * @param coinId Id of the coin
229
+ * @param shares Amount of shares
230
+ * @param receiver Address of the receiver
231
+ * @param options Optional tx building params
232
+ * @returns TransactionBlock
233
+ */
234
+ mintShares(vaultId: string, coinId: string, shares: NumStr, receiver: string, options?: ITxBuilderOptionalParams): TransactionBlock;
235
+ /**
236
+ * Redeems shares
237
+ * @param vaultId Id of the vault
238
+ * @param sharesCoinId Id of the shares coin
239
+ * @param receiver Address of the receiver
240
+ * @param options Optional tx building params
241
+ * @returns TransactionBlock
242
+ */
243
+ redeemShares(vaultId: string, sharesCoinId: string, receiver: string, options?: ITxBuilderOptionalParams): TransactionBlock;
244
+ /**
245
+ * Cancel pending withdrawal request
246
+ * @param vaultId Id of the vault
247
+ * @param sequenceNumber Sequence number of the withdrawal request
248
+ * @param options Optional tx building params
249
+ * @returns TransactionBlock
250
+ */
251
+ cancelPendingWithdrawalRequest(vaultId: string, sequenceNumber: NumStr, options?: ITxBuilderOptionalParams): TransactionBlock;
252
+ }