@ember-finance/sdk 1.0.7 → 1.0.9
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/vaults/api/apis/accounts-api.d.ts +73 -3
- package/dist/src/vaults/api/apis/accounts-api.js +145 -0
- package/dist/src/vaults/api/apis/vaults-api.d.ts +100 -25
- package/dist/src/vaults/api/apis/vaults-api.js +161 -8
- package/dist/src/vaults/api/models/apy-history.d.ts +29 -0
- package/dist/src/vaults/api/models/apy-history.js +15 -0
- package/dist/src/vaults/api/models/borrowed.d.ts +27 -0
- package/dist/src/vaults/api/models/borrowed.js +15 -0
- package/dist/src/vaults/api/models/coin-price.d.ts +21 -0
- package/dist/src/vaults/api/models/coin-price.js +15 -0
- package/dist/src/vaults/api/models/exposure-protocol.d.ts +23 -1
- package/dist/src/vaults/api/models/fee.d.ts +23 -0
- package/dist/src/vaults/api/models/fee.js +15 -0
- package/dist/src/vaults/api/models/index.d.ts +17 -0
- package/dist/src/vaults/api/models/index.js +17 -0
- package/dist/src/vaults/api/models/lp.d.ts +50 -0
- package/dist/src/vaults/api/models/lp.js +15 -0
- package/dist/src/vaults/api/models/perps.d.ts +22 -0
- package/dist/src/vaults/api/models/perps.js +15 -0
- package/dist/src/vaults/api/models/pnl-history-interval.d.ts +17 -0
- package/dist/src/vaults/api/models/pnl-history-interval.js +21 -0
- package/dist/src/vaults/api/models/pnl-history.d.ts +4 -0
- package/dist/src/vaults/api/models/position-value.d.ts +37 -0
- package/dist/src/vaults/api/models/position-value.js +15 -0
- package/dist/src/vaults/api/models/position.d.ts +29 -0
- package/dist/src/vaults/api/models/position.js +15 -0
- package/dist/src/vaults/api/models/process-requests-summary-event.d.ts +53 -0
- package/dist/src/vaults/api/models/process-requests-summary-event.js +15 -0
- package/dist/src/vaults/api/models/protocol-fee-collected-event.d.ts +41 -0
- package/dist/src/vaults/api/models/protocol-fee-collected-event.js +15 -0
- package/dist/src/vaults/api/models/protocol.d.ts +0 -9
- package/dist/src/vaults/api/models/protocol.js +0 -8
- package/dist/src/vaults/api/models/raw-event-event-data.d.ts +6 -1
- package/dist/src/vaults/api/models/raw-event.d.ts +5 -0
- package/dist/src/vaults/api/models/raw-event.js +6 -1
- package/dist/src/vaults/api/models/reward.d.ts +23 -0
- package/dist/src/vaults/api/models/reward.js +15 -0
- package/dist/src/vaults/api/models/supplied.d.ts +27 -0
- package/dist/src/vaults/api/models/supplied.js +15 -0
- package/dist/src/vaults/api/models/vault-deposit-without-minting-shares-event.d.ts +41 -0
- package/dist/src/vaults/api/models/vault-deposit-without-minting-shares-event.js +15 -0
- package/dist/src/vaults/api/models/vault-platform-fee-charged-event.d.ts +33 -0
- package/dist/src/vaults/api/models/vault-platform-fee-charged-event.js +15 -0
- package/dist/src/vaults/api/models/vault-withdrawal-without-redeeming-shares-event.d.ts +41 -0
- package/dist/src/vaults/api/models/vault-withdrawal-without-redeeming-shares-event.js +15 -0
- package/dist/src/vaults/api/models/yield-aggregate-value.d.ts +29 -0
- package/dist/src/vaults/api/models/yield-aggregate-value.js +15 -0
- package/dist/src/vaults/on-chain-calls/operator.d.ts +11 -0
- package/dist/src/vaults/on-chain-calls/operator.js +16 -0
- package/dist/src/vaults/on-chain-calls/tx-builder.d.ts +17 -0
- package/dist/src/vaults/on-chain-calls/tx-builder.js +64 -0
- package/dist/src/vaults/on-chain-calls/user.d.ts +9 -0
- package/dist/src/vaults/on-chain-calls/user.js +16 -0
- package/package.json +2 -1
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Ember Protocol Vaults API
|
|
3
|
+
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
4
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: 1.0.0
|
|
6
|
+
*
|
|
7
|
+
*
|
|
8
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
9
|
+
* https://openapi-generator.tech
|
|
10
|
+
* Do not edit the class manually.
|
|
11
|
+
*/
|
|
12
|
+
export interface YieldAggregateValue {
|
|
13
|
+
/**
|
|
14
|
+
* The unrealized yield value of the account in e9 in USDC
|
|
15
|
+
*/
|
|
16
|
+
unrealizedYieldUsdE9: string;
|
|
17
|
+
/**
|
|
18
|
+
* The realized yield value of the account in e9 in USDC
|
|
19
|
+
*/
|
|
20
|
+
realizedYieldUsdE9: string;
|
|
21
|
+
/**
|
|
22
|
+
* The total yield value of the account in e9 in USDC
|
|
23
|
+
*/
|
|
24
|
+
totalYieldUsdE9: string;
|
|
25
|
+
/**
|
|
26
|
+
* The total deposits of the account in e9 in USDC
|
|
27
|
+
*/
|
|
28
|
+
totalDepositsUsdE9: string;
|
|
29
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
/**
|
|
5
|
+
* Ember Protocol Vaults API
|
|
6
|
+
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
7
|
+
*
|
|
8
|
+
* The version of the OpenAPI document: 1.0.0
|
|
9
|
+
*
|
|
10
|
+
*
|
|
11
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
12
|
+
* https://openapi-generator.tech
|
|
13
|
+
* Do not edit the class manually.
|
|
14
|
+
*/
|
|
15
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -54,6 +54,17 @@ export declare class OperatorCalls extends OnChainCalls {
|
|
|
54
54
|
depositToVaultWithoutMintingShares(vaultId: string, subAccount: string, amount: NumStr, options?: IVaultOptionalParams & {
|
|
55
55
|
coinId?: string;
|
|
56
56
|
} & SuiTransactionBlockResponseOptions): Promise<OnChainCallResponse>;
|
|
57
|
+
/**
|
|
58
|
+
* Deposit to vault without minting shares v2
|
|
59
|
+
* @param vaultId The id of the vault to deposit to
|
|
60
|
+
* @param subAccount The sub account to deposit from
|
|
61
|
+
* @param coinId The id of the coin to deposit
|
|
62
|
+
* @param options Optional tx execution params
|
|
63
|
+
* @returns OnChainCallResponse
|
|
64
|
+
*/
|
|
65
|
+
depositToVaultWithoutMintingSharesV2(vaultId: string, subAccount: string, coinId: string, options?: IVaultOptionalParams & {
|
|
66
|
+
coinId?: string;
|
|
67
|
+
} & SuiTransactionBlockResponseOptions): Promise<OnChainCallResponse>;
|
|
57
68
|
/**
|
|
58
69
|
* Update vault rate
|
|
59
70
|
* @param vaultId The id of the vault to update the rate for
|
|
@@ -104,6 +104,22 @@ class OperatorCalls extends onchain_calls_1.OnChainCalls {
|
|
|
104
104
|
}
|
|
105
105
|
return this.execCall(txb, options);
|
|
106
106
|
}
|
|
107
|
+
/**
|
|
108
|
+
* Deposit to vault without minting shares v2
|
|
109
|
+
* @param vaultId The id of the vault to deposit to
|
|
110
|
+
* @param subAccount The sub account to deposit from
|
|
111
|
+
* @param coinId The id of the coin to deposit
|
|
112
|
+
* @param options Optional tx execution params
|
|
113
|
+
* @returns OnChainCallResponse
|
|
114
|
+
*/
|
|
115
|
+
async depositToVaultWithoutMintingSharesV2(vaultId, subAccount, coinId, options) {
|
|
116
|
+
const txb = options?.txBlock || new library_sui_1.TransactionBlock();
|
|
117
|
+
this.txBuilder.depositToVaultWithoutMintingSharesV2(vaultId, subAccount, coinId, {
|
|
118
|
+
...options,
|
|
119
|
+
txBlock: txb
|
|
120
|
+
});
|
|
121
|
+
return this.execCall(txb, options);
|
|
122
|
+
}
|
|
107
123
|
/**
|
|
108
124
|
* Update vault rate
|
|
109
125
|
* @param vaultId The id of the vault to update the rate for
|
|
@@ -180,6 +180,15 @@ export declare class TxBuilder {
|
|
|
180
180
|
* @returns TransactionBlock
|
|
181
181
|
*/
|
|
182
182
|
depositToVaultWithoutMintingShares(vaultId: string, subAccount: string, coinId: string, options?: ITxBuilderOptionalParams): TransactionBlock;
|
|
183
|
+
/**
|
|
184
|
+
* Deposit to vault without minting shares v2
|
|
185
|
+
* @param vaultId Id of the vault
|
|
186
|
+
* @param subAccount Sub account of the vault
|
|
187
|
+
* @param coinId Id of the coin
|
|
188
|
+
* @param options Optional tx building params
|
|
189
|
+
* @returns TransactionBlock
|
|
190
|
+
*/
|
|
191
|
+
depositToVaultWithoutMintingSharesV2(vaultId: string, subAccount: string, coinId: string, options?: ITxBuilderOptionalParams): TransactionBlock;
|
|
183
192
|
/**
|
|
184
193
|
* Withdraw from vault without redeeming shares
|
|
185
194
|
* @param vaultId Id of the vault
|
|
@@ -227,6 +236,14 @@ export declare class TxBuilder {
|
|
|
227
236
|
* @returns TransactionBlock
|
|
228
237
|
*/
|
|
229
238
|
depositAsset(vaultId: string, coinId: string, options?: ITxBuilderOptionalParams): TransactionBlock;
|
|
239
|
+
/**
|
|
240
|
+
* Deposit asset internal
|
|
241
|
+
* @param vaultId Id of the vault
|
|
242
|
+
* @param coinId Id of the coin
|
|
243
|
+
* @param options Optional tx building params
|
|
244
|
+
* @returns TransactionBlock
|
|
245
|
+
*/
|
|
246
|
+
depositAssetInternal(vaultId: string, coinId: string, options?: ITxBuilderOptionalParams): TransactionBlock;
|
|
230
247
|
/**
|
|
231
248
|
* Mint shares
|
|
232
249
|
* @param vaultId Id of the vault
|
|
@@ -560,6 +560,35 @@ class TxBuilder {
|
|
|
560
560
|
txb.setSenderIfNotSet(options.sender);
|
|
561
561
|
return txb;
|
|
562
562
|
}
|
|
563
|
+
/**
|
|
564
|
+
* Deposit to vault without minting shares v2
|
|
565
|
+
* @param vaultId Id of the vault
|
|
566
|
+
* @param subAccount Sub account of the vault
|
|
567
|
+
* @param coinId Id of the coin
|
|
568
|
+
* @param options Optional tx building params
|
|
569
|
+
* @returns TransactionBlock
|
|
570
|
+
*/
|
|
571
|
+
depositToVaultWithoutMintingSharesV2(vaultId, subAccount, coinId, options) {
|
|
572
|
+
const txb = options?.txBlock || new library_sui_1.TransactionBlock();
|
|
573
|
+
txb.moveCall({
|
|
574
|
+
arguments: [
|
|
575
|
+
txb.object(vaultId),
|
|
576
|
+
txb.object(this.parser.getProtocolConfig()),
|
|
577
|
+
txb.pure.address(subAccount),
|
|
578
|
+
txb.object(coinId)
|
|
579
|
+
],
|
|
580
|
+
typeArguments: [
|
|
581
|
+
this.parser.getDepositCoinType(vaultId),
|
|
582
|
+
this.parser.getReceiptCoinType(vaultId)
|
|
583
|
+
],
|
|
584
|
+
target: `${this.parser.getPackageId()}::gateway::deposit_to_vault_without_minting_shares_v2`
|
|
585
|
+
});
|
|
586
|
+
if (options?.gasBudget)
|
|
587
|
+
txb.setGasBudget(options.gasBudget);
|
|
588
|
+
if (options?.sender)
|
|
589
|
+
txb.setSenderIfNotSet(options.sender);
|
|
590
|
+
return txb;
|
|
591
|
+
}
|
|
563
592
|
/**
|
|
564
593
|
* Withdraw from vault without redeeming shares
|
|
565
594
|
* @param vaultId Id of the vault
|
|
@@ -720,6 +749,41 @@ class TxBuilder {
|
|
|
720
749
|
txb.setSenderIfNotSet(options.sender);
|
|
721
750
|
return txb;
|
|
722
751
|
}
|
|
752
|
+
/**
|
|
753
|
+
* Deposit asset internal
|
|
754
|
+
* @param vaultId Id of the vault
|
|
755
|
+
* @param coinId Id of the coin
|
|
756
|
+
* @param options Optional tx building params
|
|
757
|
+
* @returns TransactionBlock
|
|
758
|
+
*/
|
|
759
|
+
depositAssetInternal(vaultId, coinId, options) {
|
|
760
|
+
const txb = options?.txBlock || new library_sui_1.TransactionBlock();
|
|
761
|
+
const balance = txb.moveCall({
|
|
762
|
+
target: `0x2::coin::into_balance`,
|
|
763
|
+
typeArguments: [this.parser.getDepositCoinType(vaultId)],
|
|
764
|
+
arguments: [txb.object(coinId)]
|
|
765
|
+
});
|
|
766
|
+
const receiptToken = txb.moveCall({
|
|
767
|
+
arguments: [
|
|
768
|
+
txb.object(vaultId),
|
|
769
|
+
txb.object(this.parser.getProtocolConfig()),
|
|
770
|
+
txb.object(balance)
|
|
771
|
+
],
|
|
772
|
+
typeArguments: [
|
|
773
|
+
this.parser.getDepositCoinType(vaultId),
|
|
774
|
+
this.parser.getReceiptCoinType(vaultId)
|
|
775
|
+
],
|
|
776
|
+
target: `${this.parser.getPackageId()}::vault::deposit_asset`
|
|
777
|
+
});
|
|
778
|
+
if (options?.sender) {
|
|
779
|
+
txb.transferObjects([receiptToken], txb.pure.address(options.sender));
|
|
780
|
+
}
|
|
781
|
+
if (options?.gasBudget)
|
|
782
|
+
txb.setGasBudget(options.gasBudget);
|
|
783
|
+
if (options?.sender)
|
|
784
|
+
txb.setSenderIfNotSet(options.sender);
|
|
785
|
+
return txb;
|
|
786
|
+
}
|
|
723
787
|
/**
|
|
724
788
|
* Mint shares
|
|
725
789
|
* @param vaultId Id of the vault
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { OnChainCalls } from "./onchain-calls";
|
|
2
2
|
import { IDeployment, IVaultOptionalParams } from "../interfaces";
|
|
3
3
|
import { OnChainCallResponse, Signer, SuiAddress, SuiClient, SuiTransactionBlockResponseOptions, NumStr } from "@firefly-exchange/library-sui";
|
|
4
|
+
import { TransactionObjectArgument } from "@mysten/sui/transactions";
|
|
4
5
|
export declare class UserCalls extends OnChainCalls {
|
|
5
6
|
constructor(_network: string, _suiClient: SuiClient, _deployment: IDeployment, _signer?: Signer, _walletAddress?: string, _isUIWallet?: boolean);
|
|
6
7
|
/**
|
|
@@ -13,6 +14,14 @@ export declare class UserCalls extends OnChainCalls {
|
|
|
13
14
|
depositAsset(vaultId: string, amount: NumStr, options?: IVaultOptionalParams & {
|
|
14
15
|
coinId?: string;
|
|
15
16
|
} & SuiTransactionBlockResponseOptions): Promise<OnChainCallResponse>;
|
|
17
|
+
/**
|
|
18
|
+
* Deposit asset into a vault internal
|
|
19
|
+
* @param vaultId The id of the vault to deposit into
|
|
20
|
+
* @param coinId The id of the coin to deposit
|
|
21
|
+
* @param options Optional tx execution params
|
|
22
|
+
* @returns OnChainCallResponse
|
|
23
|
+
*/
|
|
24
|
+
depositAssetInternal(vaultId: string, coinId: string | TransactionObjectArgument, sender: string, options?: IVaultOptionalParams & SuiTransactionBlockResponseOptions): Promise<OnChainCallResponse>;
|
|
16
25
|
/**
|
|
17
26
|
* Mint shares of a vault
|
|
18
27
|
* @param vaultId The id of the vault to mint shares for
|
|
@@ -35,6 +35,22 @@ class UserCalls extends onchain_calls_1.OnChainCalls {
|
|
|
35
35
|
}
|
|
36
36
|
return this.execCall(txb, options);
|
|
37
37
|
}
|
|
38
|
+
/**
|
|
39
|
+
* Deposit asset into a vault internal
|
|
40
|
+
* @param vaultId The id of the vault to deposit into
|
|
41
|
+
* @param coinId The id of the coin to deposit
|
|
42
|
+
* @param options Optional tx execution params
|
|
43
|
+
* @returns OnChainCallResponse
|
|
44
|
+
*/
|
|
45
|
+
async depositAssetInternal(vaultId, coinId, sender, options) {
|
|
46
|
+
const txb = options?.txBlock || new library_sui_1.TransactionBlock();
|
|
47
|
+
this.txBuilder.depositAssetInternal(vaultId, coinId, {
|
|
48
|
+
...options,
|
|
49
|
+
txBlock: txb,
|
|
50
|
+
sender
|
|
51
|
+
});
|
|
52
|
+
return this.execCall(txb, options);
|
|
53
|
+
}
|
|
38
54
|
/**
|
|
39
55
|
* Mint shares of a vault
|
|
40
56
|
* @param vaultId The id of the vault to mint shares for
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ember-finance/sdk",
|
|
3
3
|
"description": "Ember Protocol SDK",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.9",
|
|
5
5
|
"module": "./dist/index.js",
|
|
6
6
|
"main": "./dist/index.js",
|
|
7
7
|
"types": "./dist/index.d.ts",
|
|
@@ -41,6 +41,7 @@
|
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
43
|
"@firefly-exchange/library-sui": "^2.8.22",
|
|
44
|
+
"axios": "^1.12.2",
|
|
44
45
|
"yargs": "^17.6.2",
|
|
45
46
|
"yarn": "^1.22.19"
|
|
46
47
|
},
|