Skip to content

Commit

Permalink
feat: OrchestrationAccountI.sendAll amounts accepts an array of Amoun…
Browse files Browse the repository at this point in the history
…tArg
  • Loading branch information
0xpatrickdev committed Aug 9, 2024
1 parent bd7c95e commit 49fc4c7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
10 changes: 9 additions & 1 deletion packages/orchestration/src/orchestration-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,15 @@ export interface OrchestrationAccountI {
* @param amount - the amount to send
* @returns void
*/
send: (toAccount: ChainAddress, amount: AmountArg) => Promise<void>;
send: (toAccount: ChainAddress, amounts: AmountArg) => Promise<void>;

/**
* 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
*/
sendAll: (toAccount: ChainAddress, amounts: AmountArg[]) => Promise<void>;

/**
* Transfer an amount to another account, typically on another chain.
Expand Down
3 changes: 3 additions & 0 deletions packages/orchestration/src/utils/orchestrationAccount.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ export const orchestrationAccountMethods = {
getBalance: M.call(M.any()).returns(Vow$(DenomAmountShape)),
getBalances: M.call().returns(Vow$(M.arrayOf(DenomAmountShape))),
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),
Expand Down

0 comments on commit 49fc4c7

Please sign in to comment.