Skip to content

Commit

Permalink
fixup! feat: OrchestrationAccountI.send amounts accepts an array
Browse files Browse the repository at this point in the history
  • Loading branch information
0xpatrickdev committed Aug 9, 2024
1 parent 6c508bb commit dbf7268
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
10 changes: 9 additions & 1 deletion packages/orchestration/src/orchestration-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<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
*/
send: (toAccount: ChainAddress, amounts: AmountArg[]) => Promise<void>;
sendAll: (toAccount: ChainAddress, amounts: AmountArg[]) => Promise<void>;

/**
* Transfer an amount to another account, typically on another chain.
Expand Down
5 changes: 4 additions & 1 deletion packages/orchestration/src/utils/orchestrationAccount.js
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down

0 comments on commit dbf7268

Please sign in to comment.