From dbf7268a7d7b5749002fbfafecefb0a116c05e30 Mon Sep 17 00:00:00 2001 From: 0xPatrick Date: Fri, 9 Aug 2024 14:31:06 -0400 Subject: [PATCH] fixup! feat: OrchestrationAccountI.send amounts accepts an array --- packages/orchestration/src/orchestration-api.ts | 10 +++++++++- .../orchestration/src/utils/orchestrationAccount.js | 5 ++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/packages/orchestration/src/orchestration-api.ts b/packages/orchestration/src/orchestration-api.ts index 4e5dd2c5a978..3f9bc0aa37b9 100644 --- a/packages/orchestration/src/orchestration-api.ts +++ b/packages/orchestration/src/orchestration-api.ts @@ -151,10 +151,18 @@ export interface OrchestrationAccountI { /** * Transfer amount to another account on the same chain. The promise settles when the transfer is complete. * @param toAccount - the account to send the amount to. MUST be on the same chain + * @param amount - the amount to send + * @returns void + */ + send: (toAccount: ChainAddress, amounts: AmountArg) => Promise; + + /** + * Transfer multiple amounts to another account on the same chain. The promise settles when the transfer is complete. + * @param toAccount - the account to send the amount to. MUST be on the same chain * @param amounts - the amounts to send * @returns void */ - send: (toAccount: ChainAddress, amounts: AmountArg[]) => Promise; + sendAll: (toAccount: ChainAddress, amounts: AmountArg[]) => Promise; /** * Transfer an amount to another account, typically on another chain. diff --git a/packages/orchestration/src/utils/orchestrationAccount.js b/packages/orchestration/src/utils/orchestrationAccount.js index 5e003ebe1361..f8b20eef642a 100644 --- a/packages/orchestration/src/utils/orchestrationAccount.js +++ b/packages/orchestration/src/utils/orchestrationAccount.js @@ -17,7 +17,10 @@ export const orchestrationAccountMethods = { getAddress: M.call().returns(ChainAddressShape), getBalance: M.call(M.any()).returns(Vow$(DenomAmountShape)), getBalances: M.call().returns(Vow$(M.arrayOf(DenomAmountShape))), - send: M.call(ChainAddressShape, M.arrayOf(AmountArgShape)).returns(VowShape), + send: M.call(ChainAddressShape, AmountArgShape).returns(VowShape), + sendAll: M.call(ChainAddressShape, M.arrayOf(AmountArgShape)).returns( + VowShape, + ), transfer: M.call(AmountArgShape, ChainAddressShape) .optional(M.record()) .returns(VowShape),