@ember-finance/sdk 2.6.0-pre.4 → 2.7.0

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.
@@ -66,6 +66,18 @@ export declare class OperatorCalls extends OnChainCalls {
66
66
  depositToVaultWithoutMintingSharesV2(vaultId: string, subAccount: string, coinId: string, options?: IVaultOptionalParams & {
67
67
  coinId?: string;
68
68
  } & SuiTransactionBlockResponseOptions): Promise<OnChainCallResponse>;
69
+ /**
70
+ * Deposit to vault without minting shares v3, sourcing the funds from the
71
+ * vault's accumulator (address) balance instead of a coin object. Use this
72
+ * when the vault holds an `addressBalance` but no coin objects, which is
73
+ * how funds sent via `send_funds` arrive.
74
+ * @param vaultId The id of the vault to deposit to
75
+ * @param subAccount The sub account to deposit from
76
+ * @param amount The amount to redeem from the vault's accumulator balance
77
+ * @param options Optional tx execution params
78
+ * @returns OnChainCallResponse
79
+ */
80
+ depositToVaultWithoutMintingSharesV3(vaultId: string, subAccount: string, amount: NumStr, options?: IVaultOptionalParams & SuiTransactionBlockResponseOptions): Promise<OnChainCallResponse>;
69
81
  /**
70
82
  * Update vault rate
71
83
  * @param vaultId The id of the vault to update the rate for
@@ -117,6 +117,25 @@ export class OperatorCalls extends OnChainCalls {
117
117
  });
118
118
  return this.execCall(txb, options);
119
119
  }
120
+ /**
121
+ * Deposit to vault without minting shares v3, sourcing the funds from the
122
+ * vault's accumulator (address) balance instead of a coin object. Use this
123
+ * when the vault holds an `addressBalance` but no coin objects, which is
124
+ * how funds sent via `send_funds` arrive.
125
+ * @param vaultId The id of the vault to deposit to
126
+ * @param subAccount The sub account to deposit from
127
+ * @param amount The amount to redeem from the vault's accumulator balance
128
+ * @param options Optional tx execution params
129
+ * @returns OnChainCallResponse
130
+ */
131
+ async depositToVaultWithoutMintingSharesV3(vaultId, subAccount, amount, options) {
132
+ const txb = options?.txBlock || new TransactionBlock();
133
+ this.txBuilder.depositToVaultWithoutMintingSharesV3(vaultId, subAccount, amount, {
134
+ ...options,
135
+ txBlock: txb
136
+ });
137
+ return this.execCall(txb, options);
138
+ }
120
139
  /**
121
140
  * Update vault rate
122
141
  * @param vaultId The id of the vault to update the rate for
@@ -231,6 +231,22 @@ export declare class TxBuilder {
231
231
  * @returns TransactionBlock
232
232
  */
233
233
  depositToVaultWithoutMintingSharesV2(vaultId: string, subAccount: string, coinId: string, options?: ITxBuilderOptionalParams): TransactionBlock;
234
+ /**
235
+ * Deposit to vault without minting shares v3, sourcing the funds from the
236
+ * vault's accumulator (address) balance instead of a coin object.
237
+ *
238
+ * Funds sent with `balance::send_funds`/`coin::send_funds` merge into the
239
+ * recipient's accumulator and never become coin objects, so they are
240
+ * invisible to v1/v2 and to coin enumeration. There is no redeem-all
241
+ * primitive on chain, so `amount` is explicit — read the settled balance
242
+ * first (`getBalance().addressBalance`).
243
+ * @param vaultId Id of the vault
244
+ * @param subAccount Sub account of the vault
245
+ * @param amount Amount to redeem from the vault's accumulator balance
246
+ * @param options Optional tx building params
247
+ * @returns TransactionBlock
248
+ */
249
+ depositToVaultWithoutMintingSharesV3(vaultId: string, subAccount: string, amount: NumStr, options?: ITxBuilderOptionalParams): TransactionBlock;
234
250
  /**
235
251
  * Withdraw from vault without redeeming shares
236
252
  * @param vaultId Id of the vault
@@ -726,6 +726,42 @@ export class TxBuilder {
726
726
  txb.setSenderIfNotSet(options.sender);
727
727
  return txb;
728
728
  }
729
+ /**
730
+ * Deposit to vault without minting shares v3, sourcing the funds from the
731
+ * vault's accumulator (address) balance instead of a coin object.
732
+ *
733
+ * Funds sent with `balance::send_funds`/`coin::send_funds` merge into the
734
+ * recipient's accumulator and never become coin objects, so they are
735
+ * invisible to v1/v2 and to coin enumeration. There is no redeem-all
736
+ * primitive on chain, so `amount` is explicit — read the settled balance
737
+ * first (`getBalance().addressBalance`).
738
+ * @param vaultId Id of the vault
739
+ * @param subAccount Sub account of the vault
740
+ * @param amount Amount to redeem from the vault's accumulator balance
741
+ * @param options Optional tx building params
742
+ * @returns TransactionBlock
743
+ */
744
+ depositToVaultWithoutMintingSharesV3(vaultId, subAccount, amount, options) {
745
+ const txb = options?.txBlock || new TransactionBlock();
746
+ txb.moveCall({
747
+ arguments: [
748
+ txb.object(vaultId),
749
+ txb.object(this.parser.getProtocolConfig()),
750
+ txb.pure.address(subAccount),
751
+ txb.pure.u64(amount)
752
+ ],
753
+ typeArguments: [
754
+ this.parser.getDepositCoinType(vaultId),
755
+ this.parser.getReceiptCoinType(vaultId)
756
+ ],
757
+ target: `${this.parser.getPackageId()}::gateway::deposit_to_vault_without_minting_shares_v3`
758
+ });
759
+ if (options?.gasBudget)
760
+ txb.setGasBudget(options.gasBudget);
761
+ if (options?.sender)
762
+ txb.setSenderIfNotSet(options.sender);
763
+ return txb;
764
+ }
729
765
  /**
730
766
  * Withdraw from vault without redeeming shares
731
767
  * @param vaultId Id of the vault
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ember-finance/sdk",
3
3
  "description": "Ember Protocol SDK",
4
- "version": "2.6.0-pre.4",
4
+ "version": "2.7.0",
5
5
  "type": "module",
6
6
  "module": "./dist/index.js",
7
7
  "main": "./dist/index.js",