@ember-finance/sdk 1.0.8 → 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.
Files changed (52) hide show
  1. package/dist/src/vaults/api/apis/accounts-api.d.ts +73 -3
  2. package/dist/src/vaults/api/apis/accounts-api.js +145 -0
  3. package/dist/src/vaults/api/apis/vaults-api.d.ts +100 -25
  4. package/dist/src/vaults/api/apis/vaults-api.js +161 -8
  5. package/dist/src/vaults/api/models/apy-history.d.ts +29 -0
  6. package/dist/src/vaults/api/models/apy-history.js +15 -0
  7. package/dist/src/vaults/api/models/borrowed.d.ts +27 -0
  8. package/dist/src/vaults/api/models/borrowed.js +15 -0
  9. package/dist/src/vaults/api/models/coin-price.d.ts +21 -0
  10. package/dist/src/vaults/api/models/coin-price.js +15 -0
  11. package/dist/src/vaults/api/models/exposure-protocol.d.ts +23 -1
  12. package/dist/src/vaults/api/models/fee.d.ts +23 -0
  13. package/dist/src/vaults/api/models/fee.js +15 -0
  14. package/dist/src/vaults/api/models/index.d.ts +17 -0
  15. package/dist/src/vaults/api/models/index.js +17 -0
  16. package/dist/src/vaults/api/models/lp.d.ts +50 -0
  17. package/dist/src/vaults/api/models/lp.js +15 -0
  18. package/dist/src/vaults/api/models/perps.d.ts +22 -0
  19. package/dist/src/vaults/api/models/perps.js +15 -0
  20. package/dist/src/vaults/api/models/pnl-history-interval.d.ts +17 -0
  21. package/dist/src/vaults/api/models/pnl-history-interval.js +21 -0
  22. package/dist/src/vaults/api/models/pnl-history.d.ts +4 -0
  23. package/dist/src/vaults/api/models/position-value.d.ts +37 -0
  24. package/dist/src/vaults/api/models/position-value.js +15 -0
  25. package/dist/src/vaults/api/models/position.d.ts +29 -0
  26. package/dist/src/vaults/api/models/position.js +15 -0
  27. package/dist/src/vaults/api/models/process-requests-summary-event.d.ts +53 -0
  28. package/dist/src/vaults/api/models/process-requests-summary-event.js +15 -0
  29. package/dist/src/vaults/api/models/protocol-fee-collected-event.d.ts +41 -0
  30. package/dist/src/vaults/api/models/protocol-fee-collected-event.js +15 -0
  31. package/dist/src/vaults/api/models/protocol.d.ts +0 -9
  32. package/dist/src/vaults/api/models/protocol.js +0 -8
  33. package/dist/src/vaults/api/models/raw-event-event-data.d.ts +6 -1
  34. package/dist/src/vaults/api/models/raw-event.d.ts +5 -0
  35. package/dist/src/vaults/api/models/raw-event.js +6 -1
  36. package/dist/src/vaults/api/models/reward.d.ts +23 -0
  37. package/dist/src/vaults/api/models/reward.js +15 -0
  38. package/dist/src/vaults/api/models/supplied.d.ts +27 -0
  39. package/dist/src/vaults/api/models/supplied.js +15 -0
  40. package/dist/src/vaults/api/models/vault-deposit-without-minting-shares-event.d.ts +41 -0
  41. package/dist/src/vaults/api/models/vault-deposit-without-minting-shares-event.js +15 -0
  42. package/dist/src/vaults/api/models/vault-platform-fee-charged-event.d.ts +33 -0
  43. package/dist/src/vaults/api/models/vault-platform-fee-charged-event.js +15 -0
  44. package/dist/src/vaults/api/models/vault-withdrawal-without-redeeming-shares-event.d.ts +41 -0
  45. package/dist/src/vaults/api/models/vault-withdrawal-without-redeeming-shares-event.js +15 -0
  46. package/dist/src/vaults/api/models/yield-aggregate-value.d.ts +29 -0
  47. package/dist/src/vaults/api/models/yield-aggregate-value.js +15 -0
  48. package/dist/src/vaults/on-chain-calls/tx-builder.d.ts +8 -0
  49. package/dist/src/vaults/on-chain-calls/tx-builder.js +35 -0
  50. package/dist/src/vaults/on-chain-calls/user.d.ts +9 -0
  51. package/dist/src/vaults/on-chain-calls/user.js +16 -0
  52. package/package.json +3 -2
@@ -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 });
@@ -236,6 +236,14 @@ export declare class TxBuilder {
236
236
  * @returns TransactionBlock
237
237
  */
238
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;
239
247
  /**
240
248
  * Mint shares
241
249
  * @param vaultId Id of the vault
@@ -749,6 +749,41 @@ class TxBuilder {
749
749
  txb.setSenderIfNotSet(options.sender);
750
750
  return txb;
751
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
+ }
752
787
  /**
753
788
  * Mint shares
754
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.8",
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
  },
@@ -80,4 +81,4 @@
80
81
  "files": [
81
82
  "dist"
82
83
  ]
83
- }
84
+ }