From dbf4e1520bdbf4e9eb628e010d7b5abab0b2d885 Mon Sep 17 00:00:00 2001 From: Turadg Aleahmad Date: Thu, 5 Sep 2024 14:35:17 -0700 Subject: [PATCH] feat: export CosmosOrchestrationInvitationMakersInterface --- .../src/exos/cosmos-orchestration-account.js | 40 ++++++++++--------- 1 file changed, 22 insertions(+), 18 deletions(-) diff --git a/packages/orchestration/src/exos/cosmos-orchestration-account.js b/packages/orchestration/src/exos/cosmos-orchestration-account.js index 66087ad86fa5..ea4b17c22fd9 100644 --- a/packages/orchestration/src/exos/cosmos-orchestration-account.js +++ b/packages/orchestration/src/exos/cosmos-orchestration-account.js @@ -110,6 +110,27 @@ const PUBLIC_TOPICS = { /** @type {(c: { denom: string; amount: string }) => DenomAmount} */ const toDenomAmount = c => ({ denom: c.denom, value: BigInt(c.amount) }); +export const CosmosOrchestrationInvitationMakersInterface = M.interface( + 'invitationMakers', + { + Delegate: M.call(ChainAddressShape, AmountArgShape).returns(M.promise()), + Redelegate: M.call( + ChainAddressShape, + ChainAddressShape, + AmountArgShape, + ).returns(M.promise()), + WithdrawReward: M.call(ChainAddressShape).returns(M.promise()), + Undelegate: M.call(M.arrayOf(DelegationShape)).returns(M.promise()), + DeactivateAccount: M.call().returns(M.promise()), + ReactivateAccount: M.call().returns(M.promise()), + TransferAccount: M.call().returns(M.promise()), + Send: M.call().returns(M.promise()), + SendAll: M.call().returns(M.promise()), + Transfer: M.call().returns(M.promise()), + }, +); +harden(CosmosOrchestrationInvitationMakersInterface); + /** * @param {Zone} zone * @param {object} powers @@ -176,24 +197,7 @@ export const prepareCosmosOrchestrationAccountKit = ( .returns(Vow$(M.record())), }), holder: IcaAccountHolderI, - invitationMakers: M.interface('invitationMakers', { - Delegate: M.call(ChainAddressShape, AmountArgShape).returns( - M.promise(), - ), - Redelegate: M.call( - ChainAddressShape, - ChainAddressShape, - AmountArgShape, - ).returns(M.promise()), - WithdrawReward: M.call(ChainAddressShape).returns(M.promise()), - Undelegate: M.call(M.arrayOf(DelegationShape)).returns(M.promise()), - DeactivateAccount: M.call().returns(M.promise()), - ReactivateAccount: M.call().returns(M.promise()), - TransferAccount: M.call().returns(M.promise()), - Send: M.call().returns(M.promise()), - SendAll: M.call().returns(M.promise()), - Transfer: M.call().returns(M.promise()), - }), + invitationMakers: CosmosOrchestrationInvitationMakersInterface, }, /** * @param {object} info