Skip to content

Commit

Permalink
feat: export CosmosOrchestrationInvitationMakersInterface
Browse files Browse the repository at this point in the history
  • Loading branch information
turadg committed Sep 5, 2024
1 parent c97a00d commit dbf4e15
Showing 1 changed file with 22 additions and 18 deletions.
40 changes: 22 additions & 18 deletions packages/orchestration/src/exos/cosmos-orchestration-account.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit dbf4e15

Please sign in to comment.