viem
Version:
256 lines • 8.75 kB
JavaScript
import { bindActionDecorators } from '../clients/createClient.js';
import * as accessKeyActions from './actions/accessKey.js';
import * as ammActions from './actions/amm.js';
import * as channelActions from './actions/channel.js';
import * as dexActions from './actions/dex.js';
import * as faucetActions from './actions/faucet.js';
import * as feeActions from './actions/fee.js';
import * as nonceActions from './actions/nonce.js';
import * as policyActions from './actions/policy.js';
import * as receivePolicyActions from './actions/receivePolicy.js';
import * as rewardActions from './actions/reward.js';
import * as simulateActions from './actions/simulate.js';
import * as tokenActions from './actions/token.js';
import * as validatorActions from './actions/validator.js';
import * as virtualAddressActions from './actions/virtualAddress.js';
import * as zoneActions from './actions/zone.js';
function bindActions(client, actions, keys) {
const bound = {};
for (const key of keys)
bound[key] = bindActionDecorators(client, actions[key]);
return bound;
}
export function decorator() {
return (client) => {
return {
accessKey: bindActions(client, accessKeyActions, [
'authorize',
'authorizeSync',
'burnWitness',
'burnWitnessSync',
'getMetadata',
'getRemainingLimit',
'isAdmin',
'isWitnessBurned',
'revoke',
'revokeSync',
'signAuthorization',
'updateLimit',
'updateLimitSync',
'verifyHash',
'watchAdminAuthorized',
'watchWitness',
'watchWitnessBurned',
]),
amm: bindActions(client, ammActions, [
'getPool',
'getLiquidityBalance',
'burn',
'burnSync',
'mint',
'mintSync',
'rebalanceSwap',
'rebalanceSwapSync',
'watchBurn',
'watchMint',
'watchRebalanceSwap',
]),
channel: bindActions(client, channelActions, [
'close',
'closeSync',
'getStates',
'open',
'openSync',
'requestClose',
'requestCloseSync',
'settle',
'settleSync',
'signVoucher',
'topUp',
'topUpSync',
'withdraw',
'withdrawSync',
]),
dex: bindActions(client, dexActions, [
'buy',
'buySync',
'cancel',
'cancelSync',
'cancelStale',
'cancelStaleSync',
'createPair',
'createPairSync',
'getBalance',
'getBuyQuote',
'getOrder',
'getOrderbook',
'getTickLevel',
'getSellQuote',
'place',
'placeSync',
'placeFlip',
'placeFlipSync',
'sell',
'sellSync',
'withdraw',
'withdrawSync',
'watchFlipOrderPlaced',
'watchOrderCancelled',
'watchOrderFilled',
'watchOrderPlaced',
]),
faucet: bindActions(client, faucetActions, ['fund', 'fundSync']),
nonce: bindActions(client, nonceActions, [
'getNonce',
'watchNonceIncremented',
]),
fee: bindActions(client, feeActions, [
'validateToken',
'getUserToken',
'setUserToken',
'setUserTokenSync',
'getValidatorToken',
'setValidatorToken',
'setValidatorTokenSync',
'watchSetUserToken',
'watchSetValidatorToken',
]),
policy: bindActions(client, policyActions, [
'create',
'createSync',
'setAdmin',
'setAdminSync',
'modifyWhitelist',
'modifyWhitelistSync',
'modifyBlacklist',
'modifyBlacklistSync',
'getData',
'isAuthorized',
'watchCreate',
'watchAdminUpdated',
'watchWhitelistUpdated',
'watchBlacklistUpdated',
]),
receivePolicy: bindActions(client, receivePolicyActions, [
'burn',
'burnSync',
'claim',
'claimSync',
'get',
'getBlockedBalance',
'set',
'setSync',
'validate',
'watchBlocked',
'watchBurned',
'watchClaimed',
'watchUpdated',
]),
reward: bindActions(client, rewardActions, [
'claim',
'claimSync',
'distribute',
'distributeSync',
'getGlobalRewardPerToken',
'getPendingRewards',
'getUserRewardInfo',
'setRecipient',
'setRecipientSync',
'watchRewardDistributed',
'watchRewardRecipientSet',
]),
simulate: bindActions(client, simulateActions, [
'simulateBlocks',
'simulateCalls',
]),
token: bindActions(client, tokenActions, [
'approve',
'approveSync',
'burnBlocked',
'burnBlockedSync',
'burn',
'burnSync',
'changeTransferPolicy',
'changeTransferPolicySync',
'create',
'createSync',
'getAllowance',
'getBalance',
'getMetadata',
'getTotalSupply',
'getRoleAdmin',
'hasRole',
'grantRoles',
'grantRolesSync',
'mint',
'mintSync',
'pause',
'pauseSync',
'renounceRoles',
'renounceRolesSync',
'revokeRoles',
'revokeRolesSync',
'setSupplyCap',
'setSupplyCapSync',
'setRoleAdmin',
'setRoleAdminSync',
'transfer',
'transferSync',
'unpause',
'unpauseSync',
'prepareUpdateQuoteToken',
'prepareUpdateQuoteTokenSync',
'updateQuoteToken',
'updateQuoteTokenSync',
'watchApprove',
'watchBurn',
'watchCreate',
'watchMint',
'watchAdminRole',
'watchRole',
'watchTransfer',
'watchUpdateQuoteToken',
]),
validator: bindActions(client, validatorActions, [
'add',
'addSync',
'changeOwner',
'changeOwnerSync',
'changeStatus',
'changeStatusSync',
'get',
'getByIndex',
'getCount',
'getNextFullDkgCeremony',
'getOwner',
'list',
'setNextFullDkgCeremony',
'setNextFullDkgCeremonySync',
'update',
'updateSync',
]),
virtualAddress: bindActions(client, virtualAddressActions, [
'getMasterAddress',
'registerMaster',
'registerMasterSync',
'resolve',
]),
zone: bindActions(client, zoneActions, [
'deposit',
'depositSync',
'encryptedDeposit',
'encryptedDepositSync',
'getAuthorizationTokenInfo',
'getDepositStatus',
'getWithdrawalFee',
'getZoneInfo',
'requestWithdrawal',
'requestWithdrawalSync',
'requestVerifiableWithdrawal',
'requestVerifiableWithdrawalSync',
'signAuthorizationToken',
]),
};
};
}
//# sourceMappingURL=Decorator.js.map