- Consolidated duplicate UndoManagers to single instance - Fixed connection promise to only resolve on 'connected' status - Fixed WebSocketProvider import (WebsocketProvider) - Added proper doc.destroy() cleanup - Renamed isPresenceInitialized property to avoid conflict Co-Authored-By: Paperclip <noreply@paperclip.ing>
2287 lines
59 KiB
TypeScript
2287 lines
59 KiB
TypeScript
// Generated with `pnpm gen:abis`. Do not modify manually.
|
|
|
|
export const tip20 = [
|
|
{
|
|
name: 'name',
|
|
type: 'function',
|
|
stateMutability: 'view',
|
|
inputs: [],
|
|
outputs: [{ type: 'string' }],
|
|
},
|
|
{
|
|
name: 'symbol',
|
|
type: 'function',
|
|
stateMutability: 'view',
|
|
inputs: [],
|
|
outputs: [{ type: 'string' }],
|
|
},
|
|
{
|
|
name: 'decimals',
|
|
type: 'function',
|
|
stateMutability: 'view',
|
|
inputs: [],
|
|
outputs: [{ type: 'uint8' }],
|
|
},
|
|
{
|
|
name: 'totalSupply',
|
|
type: 'function',
|
|
stateMutability: 'view',
|
|
inputs: [],
|
|
outputs: [{ type: 'uint256' }],
|
|
},
|
|
{
|
|
name: 'quoteToken',
|
|
type: 'function',
|
|
stateMutability: 'view',
|
|
inputs: [],
|
|
outputs: [{ type: 'address' }],
|
|
},
|
|
{
|
|
name: 'nextQuoteToken',
|
|
type: 'function',
|
|
stateMutability: 'view',
|
|
inputs: [],
|
|
outputs: [{ type: 'address' }],
|
|
},
|
|
{
|
|
name: 'balanceOf',
|
|
type: 'function',
|
|
stateMutability: 'view',
|
|
inputs: [{ type: 'address', name: 'account' }],
|
|
outputs: [{ type: 'uint256' }],
|
|
},
|
|
{
|
|
name: 'transfer',
|
|
type: 'function',
|
|
stateMutability: 'nonpayable',
|
|
inputs: [
|
|
{ type: 'address', name: 'to' },
|
|
{ type: 'uint256', name: 'amount' },
|
|
],
|
|
outputs: [{ type: 'bool' }],
|
|
},
|
|
{
|
|
name: 'approve',
|
|
type: 'function',
|
|
stateMutability: 'nonpayable',
|
|
inputs: [
|
|
{ type: 'address', name: 'spender' },
|
|
{ type: 'uint256', name: 'amount' },
|
|
],
|
|
outputs: [{ type: 'bool' }],
|
|
},
|
|
{
|
|
name: 'allowance',
|
|
type: 'function',
|
|
stateMutability: 'view',
|
|
inputs: [
|
|
{ type: 'address', name: 'owner' },
|
|
{ type: 'address', name: 'spender' },
|
|
],
|
|
outputs: [{ type: 'uint256' }],
|
|
},
|
|
{
|
|
name: 'transferFrom',
|
|
type: 'function',
|
|
stateMutability: 'nonpayable',
|
|
inputs: [
|
|
{ type: 'address', name: 'from' },
|
|
{ type: 'address', name: 'to' },
|
|
{ type: 'uint256', name: 'amount' },
|
|
],
|
|
outputs: [{ type: 'bool' }],
|
|
},
|
|
{
|
|
name: 'mint',
|
|
type: 'function',
|
|
stateMutability: 'nonpayable',
|
|
inputs: [
|
|
{ type: 'address', name: 'to' },
|
|
{ type: 'uint256', name: 'amount' },
|
|
],
|
|
outputs: [],
|
|
},
|
|
{
|
|
name: 'burn',
|
|
type: 'function',
|
|
stateMutability: 'nonpayable',
|
|
inputs: [{ type: 'uint256', name: 'amount' }],
|
|
outputs: [],
|
|
},
|
|
{
|
|
name: 'currency',
|
|
type: 'function',
|
|
stateMutability: 'view',
|
|
inputs: [],
|
|
outputs: [{ type: 'string' }],
|
|
},
|
|
{
|
|
name: 'supplyCap',
|
|
type: 'function',
|
|
stateMutability: 'view',
|
|
inputs: [],
|
|
outputs: [{ type: 'uint256' }],
|
|
},
|
|
{
|
|
name: 'paused',
|
|
type: 'function',
|
|
stateMutability: 'view',
|
|
inputs: [],
|
|
outputs: [{ type: 'bool' }],
|
|
},
|
|
{
|
|
name: 'transferPolicyId',
|
|
type: 'function',
|
|
stateMutability: 'view',
|
|
inputs: [],
|
|
outputs: [{ type: 'uint64' }],
|
|
},
|
|
{
|
|
name: 'burnBlocked',
|
|
type: 'function',
|
|
stateMutability: 'nonpayable',
|
|
inputs: [
|
|
{ type: 'address', name: 'from' },
|
|
{ type: 'uint256', name: 'amount' },
|
|
],
|
|
outputs: [],
|
|
},
|
|
{
|
|
name: 'mintWithMemo',
|
|
type: 'function',
|
|
stateMutability: 'nonpayable',
|
|
inputs: [
|
|
{ type: 'address', name: 'to' },
|
|
{ type: 'uint256', name: 'amount' },
|
|
{ type: 'bytes32', name: 'memo' },
|
|
],
|
|
outputs: [],
|
|
},
|
|
{
|
|
name: 'burnWithMemo',
|
|
type: 'function',
|
|
stateMutability: 'nonpayable',
|
|
inputs: [
|
|
{ type: 'uint256', name: 'amount' },
|
|
{ type: 'bytes32', name: 'memo' },
|
|
],
|
|
outputs: [],
|
|
},
|
|
{
|
|
name: 'transferWithMemo',
|
|
type: 'function',
|
|
stateMutability: 'nonpayable',
|
|
inputs: [
|
|
{ type: 'address', name: 'to' },
|
|
{ type: 'uint256', name: 'amount' },
|
|
{ type: 'bytes32', name: 'memo' },
|
|
],
|
|
outputs: [],
|
|
},
|
|
{
|
|
name: 'transferFromWithMemo',
|
|
type: 'function',
|
|
stateMutability: 'nonpayable',
|
|
inputs: [
|
|
{ type: 'address', name: 'from' },
|
|
{ type: 'address', name: 'to' },
|
|
{ type: 'uint256', name: 'amount' },
|
|
{ type: 'bytes32', name: 'memo' },
|
|
],
|
|
outputs: [{ type: 'bool' }],
|
|
},
|
|
{
|
|
name: 'changeTransferPolicyId',
|
|
type: 'function',
|
|
stateMutability: 'nonpayable',
|
|
inputs: [{ type: 'uint64', name: 'newPolicyId' }],
|
|
outputs: [],
|
|
},
|
|
{
|
|
name: 'setSupplyCap',
|
|
type: 'function',
|
|
stateMutability: 'nonpayable',
|
|
inputs: [{ type: 'uint256', name: 'newSupplyCap' }],
|
|
outputs: [],
|
|
},
|
|
{
|
|
name: 'pause',
|
|
type: 'function',
|
|
stateMutability: 'nonpayable',
|
|
inputs: [],
|
|
outputs: [],
|
|
},
|
|
{
|
|
name: 'unpause',
|
|
type: 'function',
|
|
stateMutability: 'nonpayable',
|
|
inputs: [],
|
|
outputs: [],
|
|
},
|
|
{
|
|
name: 'setNextQuoteToken',
|
|
type: 'function',
|
|
stateMutability: 'nonpayable',
|
|
inputs: [{ type: 'address', name: 'newQuoteToken' }],
|
|
outputs: [],
|
|
},
|
|
{
|
|
name: 'completeQuoteTokenUpdate',
|
|
type: 'function',
|
|
stateMutability: 'nonpayable',
|
|
inputs: [],
|
|
outputs: [],
|
|
},
|
|
{
|
|
name: 'PAUSE_ROLE',
|
|
type: 'function',
|
|
stateMutability: 'view',
|
|
inputs: [],
|
|
outputs: [{ type: 'bytes32' }],
|
|
},
|
|
{
|
|
name: 'UNPAUSE_ROLE',
|
|
type: 'function',
|
|
stateMutability: 'view',
|
|
inputs: [],
|
|
outputs: [{ type: 'bytes32' }],
|
|
},
|
|
{
|
|
name: 'ISSUER_ROLE',
|
|
type: 'function',
|
|
stateMutability: 'view',
|
|
inputs: [],
|
|
outputs: [{ type: 'bytes32' }],
|
|
},
|
|
{
|
|
name: 'BURN_BLOCKED_ROLE',
|
|
type: 'function',
|
|
stateMutability: 'view',
|
|
inputs: [],
|
|
outputs: [{ type: 'bytes32' }],
|
|
},
|
|
{
|
|
name: 'permit',
|
|
type: 'function',
|
|
stateMutability: 'nonpayable',
|
|
inputs: [
|
|
{ type: 'address', name: 'owner' },
|
|
{ type: 'address', name: 'spender' },
|
|
{ type: 'uint256', name: 'value' },
|
|
{ type: 'uint256', name: 'deadline' },
|
|
{ type: 'uint8', name: 'v' },
|
|
{ type: 'bytes32', name: 'r' },
|
|
{ type: 'bytes32', name: 's' },
|
|
],
|
|
outputs: [],
|
|
},
|
|
{
|
|
name: 'nonces',
|
|
type: 'function',
|
|
stateMutability: 'view',
|
|
inputs: [{ type: 'address', name: 'owner' }],
|
|
outputs: [{ type: 'uint256' }],
|
|
},
|
|
{
|
|
name: 'DOMAIN_SEPARATOR',
|
|
type: 'function',
|
|
stateMutability: 'view',
|
|
inputs: [],
|
|
outputs: [{ type: 'bytes32' }],
|
|
},
|
|
{
|
|
name: 'distributeReward',
|
|
type: 'function',
|
|
stateMutability: 'nonpayable',
|
|
inputs: [{ type: 'uint256', name: 'amount' }],
|
|
outputs: [],
|
|
},
|
|
{
|
|
name: 'setRewardRecipient',
|
|
type: 'function',
|
|
stateMutability: 'nonpayable',
|
|
inputs: [{ type: 'address', name: 'recipient' }],
|
|
outputs: [],
|
|
},
|
|
{
|
|
name: 'claimRewards',
|
|
type: 'function',
|
|
stateMutability: 'nonpayable',
|
|
inputs: [],
|
|
outputs: [{ type: 'uint256' }],
|
|
},
|
|
{
|
|
name: 'optedInSupply',
|
|
type: 'function',
|
|
stateMutability: 'view',
|
|
inputs: [],
|
|
outputs: [{ type: 'uint128' }],
|
|
},
|
|
{
|
|
name: 'globalRewardPerToken',
|
|
type: 'function',
|
|
stateMutability: 'view',
|
|
inputs: [],
|
|
outputs: [{ type: 'uint256' }],
|
|
},
|
|
{
|
|
name: 'userRewardInfo',
|
|
type: 'function',
|
|
stateMutability: 'view',
|
|
inputs: [{ type: 'address', name: 'account' }],
|
|
outputs: [
|
|
{
|
|
type: 'tuple',
|
|
components: [
|
|
{ type: 'address', name: 'rewardRecipient' },
|
|
{ type: 'uint256', name: 'rewardPerToken' },
|
|
{ type: 'uint256', name: 'rewardBalance' },
|
|
],
|
|
},
|
|
],
|
|
},
|
|
{
|
|
name: 'getPendingRewards',
|
|
type: 'function',
|
|
stateMutability: 'view',
|
|
inputs: [{ type: 'address', name: 'account' }],
|
|
outputs: [{ type: 'uint128' }],
|
|
},
|
|
{
|
|
name: 'Transfer',
|
|
type: 'event',
|
|
inputs: [
|
|
{ type: 'address', name: 'from', indexed: true },
|
|
{ type: 'address', name: 'to', indexed: true },
|
|
{ type: 'uint256', name: 'amount' },
|
|
],
|
|
},
|
|
{
|
|
name: 'Approval',
|
|
type: 'event',
|
|
inputs: [
|
|
{ type: 'address', name: 'owner', indexed: true },
|
|
{ type: 'address', name: 'spender', indexed: true },
|
|
{ type: 'uint256', name: 'amount' },
|
|
],
|
|
},
|
|
{
|
|
name: 'Mint',
|
|
type: 'event',
|
|
inputs: [
|
|
{ type: 'address', name: 'to', indexed: true },
|
|
{ type: 'uint256', name: 'amount' },
|
|
],
|
|
},
|
|
{
|
|
name: 'Burn',
|
|
type: 'event',
|
|
inputs: [
|
|
{ type: 'address', name: 'from', indexed: true },
|
|
{ type: 'uint256', name: 'amount' },
|
|
],
|
|
},
|
|
{
|
|
name: 'BurnBlocked',
|
|
type: 'event',
|
|
inputs: [
|
|
{ type: 'address', name: 'from', indexed: true },
|
|
{ type: 'uint256', name: 'amount' },
|
|
],
|
|
},
|
|
{
|
|
name: 'TransferWithMemo',
|
|
type: 'event',
|
|
inputs: [
|
|
{ type: 'address', name: 'from', indexed: true },
|
|
{ type: 'address', name: 'to', indexed: true },
|
|
{ type: 'uint256', name: 'amount' },
|
|
{ type: 'bytes32', name: 'memo', indexed: true },
|
|
],
|
|
},
|
|
{
|
|
name: 'TransferPolicyUpdate',
|
|
type: 'event',
|
|
inputs: [
|
|
{ type: 'address', name: 'updater', indexed: true },
|
|
{ type: 'uint64', name: 'newPolicyId', indexed: true },
|
|
],
|
|
},
|
|
{
|
|
name: 'SupplyCapUpdate',
|
|
type: 'event',
|
|
inputs: [
|
|
{ type: 'address', name: 'updater', indexed: true },
|
|
{ type: 'uint256', name: 'newSupplyCap', indexed: true },
|
|
],
|
|
},
|
|
{
|
|
name: 'PauseStateUpdate',
|
|
type: 'event',
|
|
inputs: [
|
|
{ type: 'address', name: 'updater', indexed: true },
|
|
{ type: 'bool', name: 'isPaused' },
|
|
],
|
|
},
|
|
{
|
|
name: 'NextQuoteTokenSet',
|
|
type: 'event',
|
|
inputs: [
|
|
{ type: 'address', name: 'updater', indexed: true },
|
|
{ type: 'address', name: 'nextQuoteToken', indexed: true },
|
|
],
|
|
},
|
|
{
|
|
name: 'QuoteTokenUpdate',
|
|
type: 'event',
|
|
inputs: [
|
|
{ type: 'address', name: 'updater', indexed: true },
|
|
{ type: 'address', name: 'newQuoteToken', indexed: true },
|
|
],
|
|
},
|
|
{
|
|
name: 'RewardDistributed',
|
|
type: 'event',
|
|
inputs: [
|
|
{ type: 'address', name: 'funder', indexed: true },
|
|
{ type: 'uint256', name: 'amount' },
|
|
],
|
|
},
|
|
{
|
|
name: 'RewardRecipientSet',
|
|
type: 'event',
|
|
inputs: [
|
|
{ type: 'address', name: 'holder', indexed: true },
|
|
{ type: 'address', name: 'recipient', indexed: true },
|
|
],
|
|
},
|
|
{
|
|
name: 'InsufficientBalance',
|
|
type: 'error',
|
|
inputs: [
|
|
{ type: 'uint256', name: 'available' },
|
|
{ type: 'uint256', name: 'required' },
|
|
{ type: 'address', name: 'token' },
|
|
],
|
|
},
|
|
{ name: 'InsufficientAllowance', type: 'error', inputs: [] },
|
|
{ name: 'SupplyCapExceeded', type: 'error', inputs: [] },
|
|
{ name: 'InvalidSupplyCap', type: 'error', inputs: [] },
|
|
{ name: 'InvalidPayload', type: 'error', inputs: [] },
|
|
{ name: 'StringTooLong', type: 'error', inputs: [] },
|
|
{ name: 'PolicyForbids', type: 'error', inputs: [] },
|
|
{ name: 'InvalidRecipient', type: 'error', inputs: [] },
|
|
{ name: 'ContractPaused', type: 'error', inputs: [] },
|
|
{ name: 'InvalidCurrency', type: 'error', inputs: [] },
|
|
{ name: 'InvalidQuoteToken', type: 'error', inputs: [] },
|
|
{ name: 'TransfersDisabled', type: 'error', inputs: [] },
|
|
{ name: 'InvalidAmount', type: 'error', inputs: [] },
|
|
{ name: 'NoOptedInSupply', type: 'error', inputs: [] },
|
|
{ name: 'Unauthorized', type: 'error', inputs: [] },
|
|
{ name: 'ProtectedAddress', type: 'error', inputs: [] },
|
|
{ name: 'InvalidToken', type: 'error', inputs: [] },
|
|
{ name: 'Uninitialized', type: 'error', inputs: [] },
|
|
{ name: 'InvalidTransferPolicyId', type: 'error', inputs: [] },
|
|
{ name: 'PermitExpired', type: 'error', inputs: [] },
|
|
{ name: 'InvalidSignature', type: 'error', inputs: [] },
|
|
{
|
|
name: 'hasRole',
|
|
type: 'function',
|
|
stateMutability: 'view',
|
|
inputs: [
|
|
{ type: 'address', name: 'account' },
|
|
{ type: 'bytes32', name: 'role' },
|
|
],
|
|
outputs: [{ type: 'bool' }],
|
|
},
|
|
{
|
|
name: 'getRoleAdmin',
|
|
type: 'function',
|
|
stateMutability: 'view',
|
|
inputs: [{ type: 'bytes32', name: 'role' }],
|
|
outputs: [{ type: 'bytes32' }],
|
|
},
|
|
{
|
|
name: 'grantRole',
|
|
type: 'function',
|
|
stateMutability: 'nonpayable',
|
|
inputs: [
|
|
{ type: 'bytes32', name: 'role' },
|
|
{ type: 'address', name: 'account' },
|
|
],
|
|
outputs: [],
|
|
},
|
|
{
|
|
name: 'revokeRole',
|
|
type: 'function',
|
|
stateMutability: 'nonpayable',
|
|
inputs: [
|
|
{ type: 'bytes32', name: 'role' },
|
|
{ type: 'address', name: 'account' },
|
|
],
|
|
outputs: [],
|
|
},
|
|
{
|
|
name: 'renounceRole',
|
|
type: 'function',
|
|
stateMutability: 'nonpayable',
|
|
inputs: [{ type: 'bytes32', name: 'role' }],
|
|
outputs: [],
|
|
},
|
|
{
|
|
name: 'setRoleAdmin',
|
|
type: 'function',
|
|
stateMutability: 'nonpayable',
|
|
inputs: [
|
|
{ type: 'bytes32', name: 'role' },
|
|
{ type: 'bytes32', name: 'adminRole' },
|
|
],
|
|
outputs: [],
|
|
},
|
|
{
|
|
name: 'RoleMembershipUpdated',
|
|
type: 'event',
|
|
inputs: [
|
|
{ type: 'bytes32', name: 'role', indexed: true },
|
|
{ type: 'address', name: 'account', indexed: true },
|
|
{ type: 'address', name: 'sender', indexed: true },
|
|
{ type: 'bool', name: 'hasRole' },
|
|
],
|
|
},
|
|
{
|
|
name: 'RoleAdminUpdated',
|
|
type: 'event',
|
|
inputs: [
|
|
{ type: 'bytes32', name: 'role', indexed: true },
|
|
{ type: 'bytes32', name: 'newAdminRole', indexed: true },
|
|
{ type: 'address', name: 'sender', indexed: true },
|
|
],
|
|
},
|
|
{ name: 'Unauthorized', type: 'error', inputs: [] },
|
|
] as const
|
|
|
|
export const validatorConfigV2 = [
|
|
{
|
|
name: 'getActiveValidators',
|
|
type: 'function',
|
|
stateMutability: 'view',
|
|
inputs: [],
|
|
outputs: [
|
|
{
|
|
type: 'tuple[]',
|
|
name: 'validators',
|
|
components: [
|
|
{ type: 'bytes32', name: 'publicKey' },
|
|
{ type: 'address', name: 'validatorAddress' },
|
|
{ type: 'string', name: 'ingress' },
|
|
{ type: 'string', name: 'egress' },
|
|
{ type: 'address', name: 'feeRecipient' },
|
|
{ type: 'uint64', name: 'index' },
|
|
{ type: 'uint64', name: 'addedAtHeight' },
|
|
{ type: 'uint64', name: 'deactivatedAtHeight' },
|
|
],
|
|
},
|
|
],
|
|
},
|
|
{
|
|
name: 'getInitializedAtHeight',
|
|
type: 'function',
|
|
stateMutability: 'view',
|
|
inputs: [],
|
|
outputs: [{ type: 'uint64' }],
|
|
},
|
|
{
|
|
name: 'owner',
|
|
type: 'function',
|
|
stateMutability: 'view',
|
|
inputs: [],
|
|
outputs: [{ type: 'address' }],
|
|
},
|
|
{
|
|
name: 'validatorCount',
|
|
type: 'function',
|
|
stateMutability: 'view',
|
|
inputs: [],
|
|
outputs: [{ type: 'uint64' }],
|
|
},
|
|
{
|
|
name: 'validatorByIndex',
|
|
type: 'function',
|
|
stateMutability: 'view',
|
|
inputs: [{ type: 'uint64', name: 'index' }],
|
|
outputs: [
|
|
{
|
|
type: 'tuple',
|
|
components: [
|
|
{ type: 'bytes32', name: 'publicKey' },
|
|
{ type: 'address', name: 'validatorAddress' },
|
|
{ type: 'string', name: 'ingress' },
|
|
{ type: 'string', name: 'egress' },
|
|
{ type: 'address', name: 'feeRecipient' },
|
|
{ type: 'uint64', name: 'index' },
|
|
{ type: 'uint64', name: 'addedAtHeight' },
|
|
{ type: 'uint64', name: 'deactivatedAtHeight' },
|
|
],
|
|
},
|
|
],
|
|
},
|
|
{
|
|
name: 'validatorByAddress',
|
|
type: 'function',
|
|
stateMutability: 'view',
|
|
inputs: [{ type: 'address', name: 'validatorAddress' }],
|
|
outputs: [
|
|
{
|
|
type: 'tuple',
|
|
components: [
|
|
{ type: 'bytes32', name: 'publicKey' },
|
|
{ type: 'address', name: 'validatorAddress' },
|
|
{ type: 'string', name: 'ingress' },
|
|
{ type: 'string', name: 'egress' },
|
|
{ type: 'address', name: 'feeRecipient' },
|
|
{ type: 'uint64', name: 'index' },
|
|
{ type: 'uint64', name: 'addedAtHeight' },
|
|
{ type: 'uint64', name: 'deactivatedAtHeight' },
|
|
],
|
|
},
|
|
],
|
|
},
|
|
{
|
|
name: 'validatorByPublicKey',
|
|
type: 'function',
|
|
stateMutability: 'view',
|
|
inputs: [{ type: 'bytes32', name: 'publicKey' }],
|
|
outputs: [
|
|
{
|
|
type: 'tuple',
|
|
components: [
|
|
{ type: 'bytes32', name: 'publicKey' },
|
|
{ type: 'address', name: 'validatorAddress' },
|
|
{ type: 'string', name: 'ingress' },
|
|
{ type: 'string', name: 'egress' },
|
|
{ type: 'address', name: 'feeRecipient' },
|
|
{ type: 'uint64', name: 'index' },
|
|
{ type: 'uint64', name: 'addedAtHeight' },
|
|
{ type: 'uint64', name: 'deactivatedAtHeight' },
|
|
],
|
|
},
|
|
],
|
|
},
|
|
{
|
|
name: 'getNextNetworkIdentityRotationEpoch',
|
|
type: 'function',
|
|
stateMutability: 'view',
|
|
inputs: [],
|
|
outputs: [{ type: 'uint64' }],
|
|
},
|
|
{
|
|
name: 'isInitialized',
|
|
type: 'function',
|
|
stateMutability: 'view',
|
|
inputs: [],
|
|
outputs: [{ type: 'bool' }],
|
|
},
|
|
{
|
|
name: 'addValidator',
|
|
type: 'function',
|
|
stateMutability: 'nonpayable',
|
|
inputs: [
|
|
{ type: 'address', name: 'validatorAddress' },
|
|
{ type: 'bytes32', name: 'publicKey' },
|
|
{ type: 'string', name: 'ingress' },
|
|
{ type: 'string', name: 'egress' },
|
|
{ type: 'address', name: 'feeRecipient' },
|
|
{ type: 'bytes', name: 'signature' },
|
|
],
|
|
outputs: [{ type: 'uint64', name: 'index' }],
|
|
},
|
|
{
|
|
name: 'deactivateValidator',
|
|
type: 'function',
|
|
stateMutability: 'nonpayable',
|
|
inputs: [{ type: 'uint64', name: 'idx' }],
|
|
outputs: [],
|
|
},
|
|
{
|
|
name: 'rotateValidator',
|
|
type: 'function',
|
|
stateMutability: 'nonpayable',
|
|
inputs: [
|
|
{ type: 'uint64', name: 'idx' },
|
|
{ type: 'bytes32', name: 'publicKey' },
|
|
{ type: 'string', name: 'ingress' },
|
|
{ type: 'string', name: 'egress' },
|
|
{ type: 'bytes', name: 'signature' },
|
|
],
|
|
outputs: [],
|
|
},
|
|
{
|
|
name: 'setFeeRecipient',
|
|
type: 'function',
|
|
stateMutability: 'nonpayable',
|
|
inputs: [
|
|
{ type: 'uint64', name: 'idx' },
|
|
{ type: 'address', name: 'feeRecipient' },
|
|
],
|
|
outputs: [],
|
|
},
|
|
{
|
|
name: 'setIpAddresses',
|
|
type: 'function',
|
|
stateMutability: 'nonpayable',
|
|
inputs: [
|
|
{ type: 'uint64', name: 'idx' },
|
|
{ type: 'string', name: 'ingress' },
|
|
{ type: 'string', name: 'egress' },
|
|
],
|
|
outputs: [],
|
|
},
|
|
{
|
|
name: 'transferValidatorOwnership',
|
|
type: 'function',
|
|
stateMutability: 'nonpayable',
|
|
inputs: [
|
|
{ type: 'uint64', name: 'idx' },
|
|
{ type: 'address', name: 'newAddress' },
|
|
],
|
|
outputs: [],
|
|
},
|
|
{
|
|
name: 'transferOwnership',
|
|
type: 'function',
|
|
stateMutability: 'nonpayable',
|
|
inputs: [{ type: 'address', name: 'newOwner' }],
|
|
outputs: [],
|
|
},
|
|
{
|
|
name: 'setNetworkIdentityRotationEpoch',
|
|
type: 'function',
|
|
stateMutability: 'nonpayable',
|
|
inputs: [{ type: 'uint64', name: 'epoch' }],
|
|
outputs: [],
|
|
},
|
|
{
|
|
name: 'migrateValidator',
|
|
type: 'function',
|
|
stateMutability: 'nonpayable',
|
|
inputs: [{ type: 'uint64', name: 'idx' }],
|
|
outputs: [],
|
|
},
|
|
{
|
|
name: 'initializeIfMigrated',
|
|
type: 'function',
|
|
stateMutability: 'nonpayable',
|
|
inputs: [],
|
|
outputs: [],
|
|
},
|
|
{
|
|
name: 'ValidatorAdded',
|
|
type: 'event',
|
|
inputs: [
|
|
{ type: 'uint64', name: 'index', indexed: true },
|
|
{ type: 'address', name: 'validatorAddress', indexed: true },
|
|
{ type: 'bytes32', name: 'publicKey' },
|
|
{ type: 'string', name: 'ingress' },
|
|
{ type: 'string', name: 'egress' },
|
|
{ type: 'address', name: 'feeRecipient' },
|
|
],
|
|
},
|
|
{
|
|
name: 'ValidatorDeactivated',
|
|
type: 'event',
|
|
inputs: [
|
|
{ type: 'uint64', name: 'index', indexed: true },
|
|
{ type: 'address', name: 'validatorAddress', indexed: true },
|
|
],
|
|
},
|
|
{
|
|
name: 'ValidatorRotated',
|
|
type: 'event',
|
|
inputs: [
|
|
{ type: 'uint64', name: 'index', indexed: true },
|
|
{ type: 'uint64', name: 'deactivatedIndex', indexed: true },
|
|
{ type: 'address', name: 'validatorAddress', indexed: true },
|
|
{ type: 'bytes32', name: 'oldPublicKey' },
|
|
{ type: 'bytes32', name: 'newPublicKey' },
|
|
{ type: 'string', name: 'ingress' },
|
|
{ type: 'string', name: 'egress' },
|
|
{ type: 'address', name: 'caller' },
|
|
],
|
|
},
|
|
{
|
|
name: 'FeeRecipientUpdated',
|
|
type: 'event',
|
|
inputs: [
|
|
{ type: 'uint64', name: 'index', indexed: true },
|
|
{ type: 'address', name: 'feeRecipient' },
|
|
{ type: 'address', name: 'caller' },
|
|
],
|
|
},
|
|
{
|
|
name: 'IpAddressesUpdated',
|
|
type: 'event',
|
|
inputs: [
|
|
{ type: 'uint64', name: 'index', indexed: true },
|
|
{ type: 'string', name: 'ingress' },
|
|
{ type: 'string', name: 'egress' },
|
|
{ type: 'address', name: 'caller' },
|
|
],
|
|
},
|
|
{
|
|
name: 'ValidatorOwnershipTransferred',
|
|
type: 'event',
|
|
inputs: [
|
|
{ type: 'uint64', name: 'index', indexed: true },
|
|
{ type: 'address', name: 'oldAddress', indexed: true },
|
|
{ type: 'address', name: 'newAddress', indexed: true },
|
|
{ type: 'address', name: 'caller' },
|
|
],
|
|
},
|
|
{
|
|
name: 'OwnershipTransferred',
|
|
type: 'event',
|
|
inputs: [
|
|
{ type: 'address', name: 'oldOwner', indexed: true },
|
|
{ type: 'address', name: 'newOwner', indexed: true },
|
|
],
|
|
},
|
|
{
|
|
name: 'ValidatorMigrated',
|
|
type: 'event',
|
|
inputs: [
|
|
{ type: 'uint64', name: 'index', indexed: true },
|
|
{ type: 'address', name: 'validatorAddress', indexed: true },
|
|
{ type: 'bytes32', name: 'publicKey' },
|
|
],
|
|
},
|
|
{
|
|
name: 'NetworkIdentityRotationEpochSet',
|
|
type: 'event',
|
|
inputs: [
|
|
{ type: 'uint64', name: 'previousEpoch', indexed: true },
|
|
{ type: 'uint64', name: 'nextEpoch', indexed: true },
|
|
],
|
|
},
|
|
{
|
|
name: 'Initialized',
|
|
type: 'event',
|
|
inputs: [{ type: 'uint64', name: 'height' }],
|
|
},
|
|
{
|
|
name: 'SkippedValidatorMigration',
|
|
type: 'event',
|
|
inputs: [
|
|
{ type: 'uint64', name: 'index', indexed: true },
|
|
{ type: 'address', name: 'validatorAddress', indexed: true },
|
|
{ type: 'bytes32', name: 'publicKey' },
|
|
],
|
|
},
|
|
{ name: 'AlreadyInitialized', type: 'error', inputs: [] },
|
|
{
|
|
name: 'IngressAlreadyExists',
|
|
type: 'error',
|
|
inputs: [{ type: 'string', name: 'ingress' }],
|
|
},
|
|
{ name: 'EmptyV1ValidatorSet', type: 'error', inputs: [] },
|
|
{ name: 'InvalidMigrationIndex', type: 'error', inputs: [] },
|
|
{ name: 'InvalidOwner', type: 'error', inputs: [] },
|
|
{ name: 'InvalidPublicKey', type: 'error', inputs: [] },
|
|
{ name: 'InvalidSignature', type: 'error', inputs: [] },
|
|
{ name: 'InvalidSignatureFormat', type: 'error', inputs: [] },
|
|
{ name: 'InvalidValidatorAddress', type: 'error', inputs: [] },
|
|
{ name: 'MigrationNotComplete', type: 'error', inputs: [] },
|
|
{ name: 'NotInitialized', type: 'error', inputs: [] },
|
|
{
|
|
name: 'NotIp',
|
|
type: 'error',
|
|
inputs: [
|
|
{ type: 'string', name: 'input' },
|
|
{ type: 'string', name: 'backtrace' },
|
|
],
|
|
},
|
|
{
|
|
name: 'NotIpPort',
|
|
type: 'error',
|
|
inputs: [
|
|
{ type: 'string', name: 'input' },
|
|
{ type: 'string', name: 'backtrace' },
|
|
],
|
|
},
|
|
{ name: 'PublicKeyAlreadyExists', type: 'error', inputs: [] },
|
|
{ name: 'Unauthorized', type: 'error', inputs: [] },
|
|
{ name: 'AddressAlreadyHasValidator', type: 'error', inputs: [] },
|
|
{ name: 'ValidatorAlreadyDeactivated', type: 'error', inputs: [] },
|
|
{ name: 'ValidatorNotFound', type: 'error', inputs: [] },
|
|
] as const
|
|
|
|
export const signatureVerifier = [
|
|
{
|
|
name: 'recover',
|
|
type: 'function',
|
|
stateMutability: 'view',
|
|
inputs: [
|
|
{ type: 'bytes32', name: 'hash' },
|
|
{ type: 'bytes', name: 'signature' },
|
|
],
|
|
outputs: [{ type: 'address', name: 'signer' }],
|
|
},
|
|
{
|
|
name: 'verify',
|
|
type: 'function',
|
|
stateMutability: 'view',
|
|
inputs: [
|
|
{ type: 'address', name: 'signer' },
|
|
{ type: 'bytes32', name: 'hash' },
|
|
{ type: 'bytes', name: 'signature' },
|
|
],
|
|
outputs: [{ type: 'bool' }],
|
|
},
|
|
{ name: 'InvalidFormat', type: 'error', inputs: [] },
|
|
{ name: 'InvalidSignature', type: 'error', inputs: [] },
|
|
] as const
|
|
|
|
export const stablecoinDex = [
|
|
{
|
|
name: 'createPair',
|
|
type: 'function',
|
|
stateMutability: 'nonpayable',
|
|
inputs: [{ type: 'address', name: 'base' }],
|
|
outputs: [{ type: 'bytes32', name: 'key' }],
|
|
},
|
|
{
|
|
name: 'place',
|
|
type: 'function',
|
|
stateMutability: 'nonpayable',
|
|
inputs: [
|
|
{ type: 'address', name: 'token' },
|
|
{ type: 'uint128', name: 'amount' },
|
|
{ type: 'bool', name: 'isBid' },
|
|
{ type: 'int16', name: 'tick' },
|
|
],
|
|
outputs: [{ type: 'uint128', name: 'orderId' }],
|
|
},
|
|
{
|
|
name: 'placeFlip',
|
|
type: 'function',
|
|
stateMutability: 'nonpayable',
|
|
inputs: [
|
|
{ type: 'address', name: 'token' },
|
|
{ type: 'uint128', name: 'amount' },
|
|
{ type: 'bool', name: 'isBid' },
|
|
{ type: 'int16', name: 'tick' },
|
|
{ type: 'int16', name: 'flipTick' },
|
|
],
|
|
outputs: [{ type: 'uint128', name: 'orderId' }],
|
|
},
|
|
{
|
|
name: 'cancel',
|
|
type: 'function',
|
|
stateMutability: 'nonpayable',
|
|
inputs: [{ type: 'uint128', name: 'orderId' }],
|
|
outputs: [],
|
|
},
|
|
{
|
|
name: 'cancelStaleOrder',
|
|
type: 'function',
|
|
stateMutability: 'nonpayable',
|
|
inputs: [{ type: 'uint128', name: 'orderId' }],
|
|
outputs: [],
|
|
},
|
|
{
|
|
name: 'swapExactAmountIn',
|
|
type: 'function',
|
|
stateMutability: 'nonpayable',
|
|
inputs: [
|
|
{ type: 'address', name: 'tokenIn' },
|
|
{ type: 'address', name: 'tokenOut' },
|
|
{ type: 'uint128', name: 'amountIn' },
|
|
{ type: 'uint128', name: 'minAmountOut' },
|
|
],
|
|
outputs: [{ type: 'uint128', name: 'amountOut' }],
|
|
},
|
|
{
|
|
name: 'swapExactAmountOut',
|
|
type: 'function',
|
|
stateMutability: 'nonpayable',
|
|
inputs: [
|
|
{ type: 'address', name: 'tokenIn' },
|
|
{ type: 'address', name: 'tokenOut' },
|
|
{ type: 'uint128', name: 'amountOut' },
|
|
{ type: 'uint128', name: 'maxAmountIn' },
|
|
],
|
|
outputs: [{ type: 'uint128', name: 'amountIn' }],
|
|
},
|
|
{
|
|
name: 'quoteSwapExactAmountIn',
|
|
type: 'function',
|
|
stateMutability: 'view',
|
|
inputs: [
|
|
{ type: 'address', name: 'tokenIn' },
|
|
{ type: 'address', name: 'tokenOut' },
|
|
{ type: 'uint128', name: 'amountIn' },
|
|
],
|
|
outputs: [{ type: 'uint128', name: 'amountOut' }],
|
|
},
|
|
{
|
|
name: 'quoteSwapExactAmountOut',
|
|
type: 'function',
|
|
stateMutability: 'view',
|
|
inputs: [
|
|
{ type: 'address', name: 'tokenIn' },
|
|
{ type: 'address', name: 'tokenOut' },
|
|
{ type: 'uint128', name: 'amountOut' },
|
|
],
|
|
outputs: [{ type: 'uint128', name: 'amountIn' }],
|
|
},
|
|
{
|
|
name: 'balanceOf',
|
|
type: 'function',
|
|
stateMutability: 'view',
|
|
inputs: [
|
|
{ type: 'address', name: 'user' },
|
|
{ type: 'address', name: 'token' },
|
|
],
|
|
outputs: [{ type: 'uint128' }],
|
|
},
|
|
{
|
|
name: 'withdraw',
|
|
type: 'function',
|
|
stateMutability: 'nonpayable',
|
|
inputs: [
|
|
{ type: 'address', name: 'token' },
|
|
{ type: 'uint128', name: 'amount' },
|
|
],
|
|
outputs: [],
|
|
},
|
|
{
|
|
name: 'getOrder',
|
|
type: 'function',
|
|
stateMutability: 'view',
|
|
inputs: [{ type: 'uint128', name: 'orderId' }],
|
|
outputs: [
|
|
{
|
|
type: 'tuple',
|
|
components: [
|
|
{ type: 'uint128', name: 'orderId' },
|
|
{ type: 'address', name: 'maker' },
|
|
{ type: 'bytes32', name: 'bookKey' },
|
|
{ type: 'bool', name: 'isBid' },
|
|
{ type: 'int16', name: 'tick' },
|
|
{ type: 'uint128', name: 'amount' },
|
|
{ type: 'uint128', name: 'remaining' },
|
|
{ type: 'uint128', name: 'prev' },
|
|
{ type: 'uint128', name: 'next' },
|
|
{ type: 'bool', name: 'isFlip' },
|
|
{ type: 'int16', name: 'flipTick' },
|
|
],
|
|
},
|
|
],
|
|
},
|
|
{
|
|
name: 'getTickLevel',
|
|
type: 'function',
|
|
stateMutability: 'view',
|
|
inputs: [
|
|
{ type: 'address', name: 'base' },
|
|
{ type: 'int16', name: 'tick' },
|
|
{ type: 'bool', name: 'isBid' },
|
|
],
|
|
outputs: [
|
|
{ type: 'uint128', name: 'head' },
|
|
{ type: 'uint128', name: 'tail' },
|
|
{ type: 'uint128', name: 'totalLiquidity' },
|
|
],
|
|
},
|
|
{
|
|
name: 'pairKey',
|
|
type: 'function',
|
|
stateMutability: 'pure',
|
|
inputs: [
|
|
{ type: 'address', name: 'tokenA' },
|
|
{ type: 'address', name: 'tokenB' },
|
|
],
|
|
outputs: [{ type: 'bytes32' }],
|
|
},
|
|
{
|
|
name: 'nextOrderId',
|
|
type: 'function',
|
|
stateMutability: 'view',
|
|
inputs: [],
|
|
outputs: [{ type: 'uint128' }],
|
|
},
|
|
{
|
|
name: 'books',
|
|
type: 'function',
|
|
stateMutability: 'view',
|
|
inputs: [{ type: 'bytes32', name: 'pairKey' }],
|
|
outputs: [
|
|
{
|
|
type: 'tuple',
|
|
components: [
|
|
{ type: 'address', name: 'base' },
|
|
{ type: 'address', name: 'quote' },
|
|
{ type: 'int16', name: 'bestBidTick' },
|
|
{ type: 'int16', name: 'bestAskTick' },
|
|
],
|
|
},
|
|
],
|
|
},
|
|
{
|
|
name: 'MIN_TICK',
|
|
type: 'function',
|
|
stateMutability: 'pure',
|
|
inputs: [],
|
|
outputs: [{ type: 'int16' }],
|
|
},
|
|
{
|
|
name: 'MAX_TICK',
|
|
type: 'function',
|
|
stateMutability: 'pure',
|
|
inputs: [],
|
|
outputs: [{ type: 'int16' }],
|
|
},
|
|
{
|
|
name: 'TICK_SPACING',
|
|
type: 'function',
|
|
stateMutability: 'pure',
|
|
inputs: [],
|
|
outputs: [{ type: 'int16' }],
|
|
},
|
|
{
|
|
name: 'PRICE_SCALE',
|
|
type: 'function',
|
|
stateMutability: 'pure',
|
|
inputs: [],
|
|
outputs: [{ type: 'uint32' }],
|
|
},
|
|
{
|
|
name: 'MIN_ORDER_AMOUNT',
|
|
type: 'function',
|
|
stateMutability: 'pure',
|
|
inputs: [],
|
|
outputs: [{ type: 'uint128' }],
|
|
},
|
|
{
|
|
name: 'MIN_PRICE',
|
|
type: 'function',
|
|
stateMutability: 'pure',
|
|
inputs: [],
|
|
outputs: [{ type: 'uint32' }],
|
|
},
|
|
{
|
|
name: 'MAX_PRICE',
|
|
type: 'function',
|
|
stateMutability: 'pure',
|
|
inputs: [],
|
|
outputs: [{ type: 'uint32' }],
|
|
},
|
|
{
|
|
name: 'tickToPrice',
|
|
type: 'function',
|
|
stateMutability: 'pure',
|
|
inputs: [{ type: 'int16', name: 'tick' }],
|
|
outputs: [{ type: 'uint32', name: 'price' }],
|
|
},
|
|
{
|
|
name: 'priceToTick',
|
|
type: 'function',
|
|
stateMutability: 'pure',
|
|
inputs: [{ type: 'uint32', name: 'price' }],
|
|
outputs: [{ type: 'int16', name: 'tick' }],
|
|
},
|
|
{
|
|
name: 'PairCreated',
|
|
type: 'event',
|
|
inputs: [
|
|
{ type: 'bytes32', name: 'key', indexed: true },
|
|
{ type: 'address', name: 'base', indexed: true },
|
|
{ type: 'address', name: 'quote', indexed: true },
|
|
],
|
|
},
|
|
{
|
|
name: 'OrderPlaced',
|
|
type: 'event',
|
|
inputs: [
|
|
{ type: 'uint128', name: 'orderId', indexed: true },
|
|
{ type: 'address', name: 'maker', indexed: true },
|
|
{ type: 'address', name: 'token', indexed: true },
|
|
{ type: 'uint128', name: 'amount' },
|
|
{ type: 'bool', name: 'isBid' },
|
|
{ type: 'int16', name: 'tick' },
|
|
{ type: 'bool', name: 'isFlipOrder' },
|
|
{ type: 'int16', name: 'flipTick' },
|
|
],
|
|
},
|
|
{
|
|
name: 'OrderFilled',
|
|
type: 'event',
|
|
inputs: [
|
|
{ type: 'uint128', name: 'orderId', indexed: true },
|
|
{ type: 'address', name: 'maker', indexed: true },
|
|
{ type: 'address', name: 'taker', indexed: true },
|
|
{ type: 'uint128', name: 'amountFilled' },
|
|
{ type: 'bool', name: 'partialFill' },
|
|
],
|
|
},
|
|
{
|
|
name: 'OrderCancelled',
|
|
type: 'event',
|
|
inputs: [{ type: 'uint128', name: 'orderId', indexed: true }],
|
|
},
|
|
{ name: 'Unauthorized', type: 'error', inputs: [] },
|
|
{ name: 'PairDoesNotExist', type: 'error', inputs: [] },
|
|
{ name: 'PairAlreadyExists', type: 'error', inputs: [] },
|
|
{ name: 'OrderDoesNotExist', type: 'error', inputs: [] },
|
|
{ name: 'IdenticalTokens', type: 'error', inputs: [] },
|
|
{ name: 'InvalidToken', type: 'error', inputs: [] },
|
|
{
|
|
name: 'TickOutOfBounds',
|
|
type: 'error',
|
|
inputs: [{ type: 'int16', name: 'tick' }],
|
|
},
|
|
{ name: 'InvalidTick', type: 'error', inputs: [] },
|
|
{ name: 'InvalidFlipTick', type: 'error', inputs: [] },
|
|
{ name: 'InsufficientBalance', type: 'error', inputs: [] },
|
|
{ name: 'InsufficientLiquidity', type: 'error', inputs: [] },
|
|
{ name: 'InsufficientOutput', type: 'error', inputs: [] },
|
|
{ name: 'MaxInputExceeded', type: 'error', inputs: [] },
|
|
{
|
|
name: 'BelowMinimumOrderSize',
|
|
type: 'error',
|
|
inputs: [{ type: 'uint128', name: 'amount' }],
|
|
},
|
|
{ name: 'InvalidBaseToken', type: 'error', inputs: [] },
|
|
{ name: 'OrderNotStale', type: 'error', inputs: [] },
|
|
] as const
|
|
|
|
export const addressRegistry = [
|
|
{
|
|
name: 'registerVirtualMaster',
|
|
type: 'function',
|
|
stateMutability: 'nonpayable',
|
|
inputs: [{ type: 'bytes32', name: 'salt' }],
|
|
outputs: [{ type: 'bytes4', name: 'masterId' }],
|
|
},
|
|
{
|
|
name: 'getMaster',
|
|
type: 'function',
|
|
stateMutability: 'view',
|
|
inputs: [{ type: 'bytes4', name: 'masterId' }],
|
|
outputs: [{ type: 'address' }],
|
|
},
|
|
{
|
|
name: 'resolveRecipient',
|
|
type: 'function',
|
|
stateMutability: 'view',
|
|
inputs: [{ type: 'address', name: 'to' }],
|
|
outputs: [{ type: 'address', name: 'effectiveRecipient' }],
|
|
},
|
|
{
|
|
name: 'resolveVirtualAddress',
|
|
type: 'function',
|
|
stateMutability: 'view',
|
|
inputs: [{ type: 'address', name: 'virtualAddr' }],
|
|
outputs: [{ type: 'address', name: 'master' }],
|
|
},
|
|
{
|
|
name: 'isVirtualAddress',
|
|
type: 'function',
|
|
stateMutability: 'pure',
|
|
inputs: [{ type: 'address', name: 'addr' }],
|
|
outputs: [{ type: 'bool' }],
|
|
},
|
|
{
|
|
name: 'decodeVirtualAddress',
|
|
type: 'function',
|
|
stateMutability: 'pure',
|
|
inputs: [{ type: 'address', name: 'addr' }],
|
|
outputs: [
|
|
{ type: 'bool', name: 'isVirtual' },
|
|
{ type: 'bytes4', name: 'masterId' },
|
|
{ type: 'bytes6', name: 'userTag' },
|
|
],
|
|
},
|
|
{
|
|
name: 'MasterRegistered',
|
|
type: 'event',
|
|
inputs: [
|
|
{ type: 'bytes4', name: 'masterId', indexed: true },
|
|
{ type: 'address', name: 'masterAddress', indexed: true },
|
|
],
|
|
},
|
|
{
|
|
name: 'MasterIdCollision',
|
|
type: 'error',
|
|
inputs: [{ type: 'address', name: 'master' }],
|
|
},
|
|
{ name: 'InvalidMasterAddress', type: 'error', inputs: [] },
|
|
{ name: 'ProofOfWorkFailed', type: 'error', inputs: [] },
|
|
{ name: 'VirtualAddressUnregistered', type: 'error', inputs: [] },
|
|
] as const
|
|
|
|
export const feeManager = [
|
|
{
|
|
name: 'userTokens',
|
|
type: 'function',
|
|
stateMutability: 'view',
|
|
inputs: [{ type: 'address', name: 'user' }],
|
|
outputs: [{ type: 'address' }],
|
|
},
|
|
{
|
|
name: 'validatorTokens',
|
|
type: 'function',
|
|
stateMutability: 'view',
|
|
inputs: [{ type: 'address', name: 'validator' }],
|
|
outputs: [{ type: 'address' }],
|
|
},
|
|
{
|
|
name: 'setUserToken',
|
|
type: 'function',
|
|
stateMutability: 'nonpayable',
|
|
inputs: [{ type: 'address', name: 'token' }],
|
|
outputs: [],
|
|
},
|
|
{
|
|
name: 'setValidatorToken',
|
|
type: 'function',
|
|
stateMutability: 'nonpayable',
|
|
inputs: [{ type: 'address', name: 'token' }],
|
|
outputs: [],
|
|
},
|
|
{
|
|
name: 'distributeFees',
|
|
type: 'function',
|
|
stateMutability: 'nonpayable',
|
|
inputs: [
|
|
{ type: 'address', name: 'validator' },
|
|
{ type: 'address', name: 'token' },
|
|
],
|
|
outputs: [],
|
|
},
|
|
{
|
|
name: 'collectedFees',
|
|
type: 'function',
|
|
stateMutability: 'view',
|
|
inputs: [
|
|
{ type: 'address', name: 'validator' },
|
|
{ type: 'address', name: 'token' },
|
|
],
|
|
outputs: [{ type: 'uint256' }],
|
|
},
|
|
{
|
|
name: 'UserTokenSet',
|
|
type: 'event',
|
|
inputs: [
|
|
{ type: 'address', name: 'user', indexed: true },
|
|
{ type: 'address', name: 'token', indexed: true },
|
|
],
|
|
},
|
|
{
|
|
name: 'ValidatorTokenSet',
|
|
type: 'event',
|
|
inputs: [
|
|
{ type: 'address', name: 'validator', indexed: true },
|
|
{ type: 'address', name: 'token', indexed: true },
|
|
],
|
|
},
|
|
{
|
|
name: 'FeesDistributed',
|
|
type: 'event',
|
|
inputs: [
|
|
{ type: 'address', name: 'validator', indexed: true },
|
|
{ type: 'address', name: 'token', indexed: true },
|
|
{ type: 'uint256', name: 'amount' },
|
|
],
|
|
},
|
|
{ name: 'OnlyValidator', type: 'error', inputs: [] },
|
|
{ name: 'OnlySystemContract', type: 'error', inputs: [] },
|
|
{ name: 'InvalidToken', type: 'error', inputs: [] },
|
|
{ name: 'PoolDoesNotExist', type: 'error', inputs: [] },
|
|
{ name: 'InsufficientFeeTokenBalance', type: 'error', inputs: [] },
|
|
{ name: 'InternalError', type: 'error', inputs: [] },
|
|
{ name: 'CannotChangeWithinBlock', type: 'error', inputs: [] },
|
|
{ name: 'CannotChangeWithPendingFees', type: 'error', inputs: [] },
|
|
{ name: 'TokenPolicyForbids', type: 'error', inputs: [] },
|
|
] as const
|
|
|
|
export const feeAmm = [
|
|
{
|
|
name: 'M',
|
|
type: 'function',
|
|
stateMutability: 'view',
|
|
inputs: [],
|
|
outputs: [{ type: 'uint256' }],
|
|
},
|
|
{
|
|
name: 'N',
|
|
type: 'function',
|
|
stateMutability: 'view',
|
|
inputs: [],
|
|
outputs: [{ type: 'uint256' }],
|
|
},
|
|
{
|
|
name: 'SCALE',
|
|
type: 'function',
|
|
stateMutability: 'view',
|
|
inputs: [],
|
|
outputs: [{ type: 'uint256' }],
|
|
},
|
|
{
|
|
name: 'MIN_LIQUIDITY',
|
|
type: 'function',
|
|
stateMutability: 'view',
|
|
inputs: [],
|
|
outputs: [{ type: 'uint256' }],
|
|
},
|
|
{
|
|
name: 'getPoolId',
|
|
type: 'function',
|
|
stateMutability: 'pure',
|
|
inputs: [
|
|
{ type: 'address', name: 'userToken' },
|
|
{ type: 'address', name: 'validatorToken' },
|
|
],
|
|
outputs: [{ type: 'bytes32' }],
|
|
},
|
|
{
|
|
name: 'getPool',
|
|
type: 'function',
|
|
stateMutability: 'view',
|
|
inputs: [
|
|
{ type: 'address', name: 'userToken' },
|
|
{ type: 'address', name: 'validatorToken' },
|
|
],
|
|
outputs: [
|
|
{
|
|
type: 'tuple',
|
|
components: [
|
|
{ type: 'uint128', name: 'reserveUserToken' },
|
|
{ type: 'uint128', name: 'reserveValidatorToken' },
|
|
],
|
|
},
|
|
],
|
|
},
|
|
{
|
|
name: 'pools',
|
|
type: 'function',
|
|
stateMutability: 'view',
|
|
inputs: [{ type: 'bytes32', name: 'poolId' }],
|
|
outputs: [
|
|
{
|
|
type: 'tuple',
|
|
components: [
|
|
{ type: 'uint128', name: 'reserveUserToken' },
|
|
{ type: 'uint128', name: 'reserveValidatorToken' },
|
|
],
|
|
},
|
|
],
|
|
},
|
|
{
|
|
name: 'mint',
|
|
type: 'function',
|
|
stateMutability: 'nonpayable',
|
|
inputs: [
|
|
{ type: 'address', name: 'userToken' },
|
|
{ type: 'address', name: 'validatorToken' },
|
|
{ type: 'uint256', name: 'amountValidatorToken' },
|
|
{ type: 'address', name: 'to' },
|
|
],
|
|
outputs: [{ type: 'uint256', name: 'liquidity' }],
|
|
},
|
|
{
|
|
name: 'burn',
|
|
type: 'function',
|
|
stateMutability: 'nonpayable',
|
|
inputs: [
|
|
{ type: 'address', name: 'userToken' },
|
|
{ type: 'address', name: 'validatorToken' },
|
|
{ type: 'uint256', name: 'liquidity' },
|
|
{ type: 'address', name: 'to' },
|
|
],
|
|
outputs: [
|
|
{ type: 'uint256', name: 'amountUserToken' },
|
|
{ type: 'uint256', name: 'amountValidatorToken' },
|
|
],
|
|
},
|
|
{
|
|
name: 'totalSupply',
|
|
type: 'function',
|
|
stateMutability: 'view',
|
|
inputs: [{ type: 'bytes32', name: 'poolId' }],
|
|
outputs: [{ type: 'uint256' }],
|
|
},
|
|
{
|
|
name: 'liquidityBalances',
|
|
type: 'function',
|
|
stateMutability: 'view',
|
|
inputs: [
|
|
{ type: 'bytes32', name: 'poolId' },
|
|
{ type: 'address', name: 'user' },
|
|
],
|
|
outputs: [{ type: 'uint256' }],
|
|
},
|
|
{
|
|
name: 'rebalanceSwap',
|
|
type: 'function',
|
|
stateMutability: 'nonpayable',
|
|
inputs: [
|
|
{ type: 'address', name: 'userToken' },
|
|
{ type: 'address', name: 'validatorToken' },
|
|
{ type: 'uint256', name: 'amountOut' },
|
|
{ type: 'address', name: 'to' },
|
|
],
|
|
outputs: [{ type: 'uint256', name: 'amountIn' }],
|
|
},
|
|
{
|
|
name: 'Mint',
|
|
type: 'event',
|
|
inputs: [
|
|
{ type: 'address', name: 'sender' },
|
|
{ type: 'address', name: 'to', indexed: true },
|
|
{ type: 'address', name: 'userToken', indexed: true },
|
|
{ type: 'address', name: 'validatorToken', indexed: true },
|
|
{ type: 'uint256', name: 'amountValidatorToken' },
|
|
{ type: 'uint256', name: 'liquidity' },
|
|
],
|
|
},
|
|
{
|
|
name: 'Burn',
|
|
type: 'event',
|
|
inputs: [
|
|
{ type: 'address', name: 'sender', indexed: true },
|
|
{ type: 'address', name: 'userToken', indexed: true },
|
|
{ type: 'address', name: 'validatorToken', indexed: true },
|
|
{ type: 'uint256', name: 'amountUserToken' },
|
|
{ type: 'uint256', name: 'amountValidatorToken' },
|
|
{ type: 'uint256', name: 'liquidity' },
|
|
{ type: 'address', name: 'to' },
|
|
],
|
|
},
|
|
{
|
|
name: 'RebalanceSwap',
|
|
type: 'event',
|
|
inputs: [
|
|
{ type: 'address', name: 'userToken', indexed: true },
|
|
{ type: 'address', name: 'validatorToken', indexed: true },
|
|
{ type: 'address', name: 'swapper', indexed: true },
|
|
{ type: 'uint256', name: 'amountIn' },
|
|
{ type: 'uint256', name: 'amountOut' },
|
|
],
|
|
},
|
|
{ name: 'IdenticalAddresses', type: 'error', inputs: [] },
|
|
{ name: 'InvalidToken', type: 'error', inputs: [] },
|
|
{ name: 'InsufficientLiquidity', type: 'error', inputs: [] },
|
|
{ name: 'InsufficientReserves', type: 'error', inputs: [] },
|
|
{ name: 'InvalidAmount', type: 'error', inputs: [] },
|
|
{ name: 'DivisionByZero', type: 'error', inputs: [] },
|
|
{ name: 'InvalidSwapCalculation', type: 'error', inputs: [] },
|
|
] as const
|
|
|
|
export const accountKeychain = [
|
|
{
|
|
name: 'authorizeKey',
|
|
type: 'function',
|
|
stateMutability: 'nonpayable',
|
|
inputs: [
|
|
{ type: 'address', name: 'keyId' },
|
|
{ type: 'uint8', name: 'signatureType' },
|
|
{ type: 'uint64', name: 'expiry' },
|
|
{ type: 'bool', name: 'enforceLimits' },
|
|
{
|
|
type: 'tuple[]',
|
|
name: 'limits',
|
|
components: [
|
|
{ type: 'address', name: 'token' },
|
|
{ type: 'uint256', name: 'amount' },
|
|
],
|
|
},
|
|
],
|
|
outputs: [],
|
|
},
|
|
{
|
|
name: 'authorizeKey',
|
|
type: 'function',
|
|
stateMutability: 'nonpayable',
|
|
inputs: [
|
|
{ type: 'address', name: 'keyId' },
|
|
{ type: 'uint8', name: 'signatureType' },
|
|
{
|
|
type: 'tuple',
|
|
name: 'config',
|
|
components: [
|
|
{ type: 'uint64', name: 'expiry' },
|
|
{ type: 'bool', name: 'enforceLimits' },
|
|
{
|
|
type: 'tuple[]',
|
|
name: 'limits',
|
|
components: [
|
|
{ type: 'address', name: 'token' },
|
|
{ type: 'uint256', name: 'amount' },
|
|
{ type: 'uint64', name: 'period' },
|
|
],
|
|
},
|
|
{ type: 'bool', name: 'allowAnyCalls' },
|
|
{
|
|
type: 'tuple[]',
|
|
name: 'allowedCalls',
|
|
components: [
|
|
{ type: 'address', name: 'target' },
|
|
{
|
|
type: 'tuple[]',
|
|
name: 'selectorRules',
|
|
components: [
|
|
{ type: 'bytes4', name: 'selector' },
|
|
{ type: 'address[]', name: 'recipients' },
|
|
],
|
|
},
|
|
],
|
|
},
|
|
],
|
|
},
|
|
],
|
|
outputs: [],
|
|
},
|
|
{
|
|
name: 'revokeKey',
|
|
type: 'function',
|
|
stateMutability: 'nonpayable',
|
|
inputs: [{ type: 'address', name: 'keyId' }],
|
|
outputs: [],
|
|
},
|
|
{
|
|
name: 'updateSpendingLimit',
|
|
type: 'function',
|
|
stateMutability: 'nonpayable',
|
|
inputs: [
|
|
{ type: 'address', name: 'keyId' },
|
|
{ type: 'address', name: 'token' },
|
|
{ type: 'uint256', name: 'newLimit' },
|
|
],
|
|
outputs: [],
|
|
},
|
|
{
|
|
name: 'setAllowedCalls',
|
|
type: 'function',
|
|
stateMutability: 'nonpayable',
|
|
inputs: [
|
|
{ type: 'address', name: 'keyId' },
|
|
{
|
|
type: 'tuple[]',
|
|
name: 'scopes',
|
|
components: [
|
|
{ type: 'address', name: 'target' },
|
|
{
|
|
type: 'tuple[]',
|
|
name: 'selectorRules',
|
|
components: [
|
|
{ type: 'bytes4', name: 'selector' },
|
|
{ type: 'address[]', name: 'recipients' },
|
|
],
|
|
},
|
|
],
|
|
},
|
|
],
|
|
outputs: [],
|
|
},
|
|
{
|
|
name: 'removeAllowedCalls',
|
|
type: 'function',
|
|
stateMutability: 'nonpayable',
|
|
inputs: [
|
|
{ type: 'address', name: 'keyId' },
|
|
{ type: 'address', name: 'target' },
|
|
],
|
|
outputs: [],
|
|
},
|
|
{
|
|
name: 'getKey',
|
|
type: 'function',
|
|
stateMutability: 'view',
|
|
inputs: [
|
|
{ type: 'address', name: 'account' },
|
|
{ type: 'address', name: 'keyId' },
|
|
],
|
|
outputs: [
|
|
{
|
|
type: 'tuple',
|
|
components: [
|
|
{ type: 'uint8', name: 'signatureType' },
|
|
{ type: 'address', name: 'keyId' },
|
|
{ type: 'uint64', name: 'expiry' },
|
|
{ type: 'bool', name: 'enforceLimits' },
|
|
{ type: 'bool', name: 'isRevoked' },
|
|
],
|
|
},
|
|
],
|
|
},
|
|
{
|
|
name: 'getRemainingLimit',
|
|
type: 'function',
|
|
stateMutability: 'view',
|
|
inputs: [
|
|
{ type: 'address', name: 'account' },
|
|
{ type: 'address', name: 'keyId' },
|
|
{ type: 'address', name: 'token' },
|
|
],
|
|
outputs: [{ type: 'uint256', name: 'remaining' }],
|
|
},
|
|
{
|
|
name: 'getRemainingLimitWithPeriod',
|
|
type: 'function',
|
|
stateMutability: 'view',
|
|
inputs: [
|
|
{ type: 'address', name: 'account' },
|
|
{ type: 'address', name: 'keyId' },
|
|
{ type: 'address', name: 'token' },
|
|
],
|
|
outputs: [
|
|
{ type: 'uint256', name: 'remaining' },
|
|
{ type: 'uint64', name: 'periodEnd' },
|
|
],
|
|
},
|
|
{
|
|
name: 'getAllowedCalls',
|
|
type: 'function',
|
|
stateMutability: 'view',
|
|
inputs: [
|
|
{ type: 'address', name: 'account' },
|
|
{ type: 'address', name: 'keyId' },
|
|
],
|
|
outputs: [
|
|
{ type: 'bool', name: 'isScoped' },
|
|
{
|
|
type: 'tuple[]',
|
|
name: 'scopes',
|
|
components: [
|
|
{ type: 'address', name: 'target' },
|
|
{
|
|
type: 'tuple[]',
|
|
name: 'selectorRules',
|
|
components: [
|
|
{ type: 'bytes4', name: 'selector' },
|
|
{ type: 'address[]', name: 'recipients' },
|
|
],
|
|
},
|
|
],
|
|
},
|
|
],
|
|
},
|
|
{
|
|
name: 'getTransactionKey',
|
|
type: 'function',
|
|
stateMutability: 'view',
|
|
inputs: [],
|
|
outputs: [{ type: 'address' }],
|
|
},
|
|
{
|
|
name: 'KeyAuthorized',
|
|
type: 'event',
|
|
inputs: [
|
|
{ type: 'address', name: 'account', indexed: true },
|
|
{ type: 'address', name: 'publicKey', indexed: true },
|
|
{ type: 'uint8', name: 'signatureType' },
|
|
{ type: 'uint64', name: 'expiry' },
|
|
],
|
|
},
|
|
{
|
|
name: 'KeyRevoked',
|
|
type: 'event',
|
|
inputs: [
|
|
{ type: 'address', name: 'account', indexed: true },
|
|
{ type: 'address', name: 'publicKey', indexed: true },
|
|
],
|
|
},
|
|
{
|
|
name: 'SpendingLimitUpdated',
|
|
type: 'event',
|
|
inputs: [
|
|
{ type: 'address', name: 'account', indexed: true },
|
|
{ type: 'address', name: 'publicKey', indexed: true },
|
|
{ type: 'address', name: 'token', indexed: true },
|
|
{ type: 'uint256', name: 'newLimit' },
|
|
],
|
|
},
|
|
{
|
|
name: 'AccessKeySpend',
|
|
type: 'event',
|
|
inputs: [
|
|
{ type: 'address', name: 'account', indexed: true },
|
|
{ type: 'address', name: 'publicKey', indexed: true },
|
|
{ type: 'address', name: 'token', indexed: true },
|
|
{ type: 'uint256', name: 'amount' },
|
|
{ type: 'uint256', name: 'remainingLimit' },
|
|
],
|
|
},
|
|
{ name: 'UnauthorizedCaller', type: 'error', inputs: [] },
|
|
{ name: 'KeyAlreadyExists', type: 'error', inputs: [] },
|
|
{ name: 'KeyNotFound', type: 'error', inputs: [] },
|
|
{ name: 'KeyExpired', type: 'error', inputs: [] },
|
|
{ name: 'SpendingLimitExceeded', type: 'error', inputs: [] },
|
|
{ name: 'InvalidSpendingLimit', type: 'error', inputs: [] },
|
|
{ name: 'InvalidSignatureType', type: 'error', inputs: [] },
|
|
{ name: 'ZeroPublicKey', type: 'error', inputs: [] },
|
|
{ name: 'ExpiryInPast', type: 'error', inputs: [] },
|
|
{ name: 'KeyAlreadyRevoked', type: 'error', inputs: [] },
|
|
{
|
|
name: 'SignatureTypeMismatch',
|
|
type: 'error',
|
|
inputs: [
|
|
{ type: 'uint8', name: 'expected' },
|
|
{ type: 'uint8', name: 'actual' },
|
|
],
|
|
},
|
|
{ name: 'CallNotAllowed', type: 'error', inputs: [] },
|
|
{ name: 'InvalidCallScope', type: 'error', inputs: [] },
|
|
{
|
|
name: 'LegacyAuthorizeKeySelectorChanged',
|
|
type: 'error',
|
|
inputs: [{ type: 'bytes4', name: 'newSelector' }],
|
|
},
|
|
] as const
|
|
|
|
export const nonce = [
|
|
{
|
|
name: 'getNonce',
|
|
type: 'function',
|
|
stateMutability: 'view',
|
|
inputs: [
|
|
{ type: 'address', name: 'account' },
|
|
{ type: 'uint256', name: 'nonceKey' },
|
|
],
|
|
outputs: [{ type: 'uint64', name: 'nonce' }],
|
|
},
|
|
{
|
|
name: 'NonceIncremented',
|
|
type: 'event',
|
|
inputs: [
|
|
{ type: 'address', name: 'account', indexed: true },
|
|
{ type: 'uint256', name: 'nonceKey', indexed: true },
|
|
{ type: 'uint64', name: 'newNonce' },
|
|
],
|
|
},
|
|
{ name: 'ProtocolNonceNotSupported', type: 'error', inputs: [] },
|
|
{ name: 'InvalidNonceKey', type: 'error', inputs: [] },
|
|
{ name: 'NonceOverflow', type: 'error', inputs: [] },
|
|
{ name: 'ExpiringNonceReplay', type: 'error', inputs: [] },
|
|
{ name: 'ExpiringNonceSetFull', type: 'error', inputs: [] },
|
|
{ name: 'InvalidExpiringNonceExpiry', type: 'error', inputs: [] },
|
|
] as const
|
|
|
|
export const tip20Factory = [
|
|
{
|
|
name: 'createToken',
|
|
type: 'function',
|
|
stateMutability: 'nonpayable',
|
|
inputs: [
|
|
{ type: 'string', name: 'name' },
|
|
{ type: 'string', name: 'symbol' },
|
|
{ type: 'string', name: 'currency' },
|
|
{ type: 'address', name: 'quoteToken' },
|
|
{ type: 'address', name: 'admin' },
|
|
{ type: 'bytes32', name: 'salt' },
|
|
],
|
|
outputs: [{ type: 'address' }],
|
|
},
|
|
{
|
|
name: 'isTIP20',
|
|
type: 'function',
|
|
stateMutability: 'view',
|
|
inputs: [{ type: 'address', name: 'token' }],
|
|
outputs: [{ type: 'bool' }],
|
|
},
|
|
{
|
|
name: 'getTokenAddress',
|
|
type: 'function',
|
|
stateMutability: 'view',
|
|
inputs: [
|
|
{ type: 'address', name: 'sender' },
|
|
{ type: 'bytes32', name: 'salt' },
|
|
],
|
|
outputs: [{ type: 'address' }],
|
|
},
|
|
{
|
|
name: 'TokenCreated',
|
|
type: 'event',
|
|
inputs: [
|
|
{ type: 'address', name: 'token', indexed: true },
|
|
{ type: 'string', name: 'name' },
|
|
{ type: 'string', name: 'symbol' },
|
|
{ type: 'string', name: 'currency' },
|
|
{ type: 'address', name: 'quoteToken' },
|
|
{ type: 'address', name: 'admin' },
|
|
{ type: 'bytes32', name: 'salt' },
|
|
],
|
|
},
|
|
{ name: 'AddressReserved', type: 'error', inputs: [] },
|
|
{ name: 'AddressNotReserved', type: 'error', inputs: [] },
|
|
{ name: 'InvalidQuoteToken', type: 'error', inputs: [] },
|
|
{
|
|
name: 'TokenAlreadyExists',
|
|
type: 'error',
|
|
inputs: [{ type: 'address', name: 'token' }],
|
|
},
|
|
] as const
|
|
|
|
export const tip403Registry = [
|
|
{
|
|
name: 'policyIdCounter',
|
|
type: 'function',
|
|
stateMutability: 'view',
|
|
inputs: [],
|
|
outputs: [{ type: 'uint64' }],
|
|
},
|
|
{
|
|
name: 'policyExists',
|
|
type: 'function',
|
|
stateMutability: 'view',
|
|
inputs: [{ type: 'uint64', name: 'policyId' }],
|
|
outputs: [{ type: 'bool' }],
|
|
},
|
|
{
|
|
name: 'policyData',
|
|
type: 'function',
|
|
stateMutability: 'view',
|
|
inputs: [{ type: 'uint64', name: 'policyId' }],
|
|
outputs: [
|
|
{ type: 'uint8', name: 'policyType' },
|
|
{ type: 'address', name: 'admin' },
|
|
],
|
|
},
|
|
{
|
|
name: 'isAuthorized',
|
|
type: 'function',
|
|
stateMutability: 'view',
|
|
inputs: [
|
|
{ type: 'uint64', name: 'policyId' },
|
|
{ type: 'address', name: 'user' },
|
|
],
|
|
outputs: [{ type: 'bool' }],
|
|
},
|
|
{
|
|
name: 'isAuthorizedSender',
|
|
type: 'function',
|
|
stateMutability: 'view',
|
|
inputs: [
|
|
{ type: 'uint64', name: 'policyId' },
|
|
{ type: 'address', name: 'user' },
|
|
],
|
|
outputs: [{ type: 'bool' }],
|
|
},
|
|
{
|
|
name: 'isAuthorizedRecipient',
|
|
type: 'function',
|
|
stateMutability: 'view',
|
|
inputs: [
|
|
{ type: 'uint64', name: 'policyId' },
|
|
{ type: 'address', name: 'user' },
|
|
],
|
|
outputs: [{ type: 'bool' }],
|
|
},
|
|
{
|
|
name: 'isAuthorizedMintRecipient',
|
|
type: 'function',
|
|
stateMutability: 'view',
|
|
inputs: [
|
|
{ type: 'uint64', name: 'policyId' },
|
|
{ type: 'address', name: 'user' },
|
|
],
|
|
outputs: [{ type: 'bool' }],
|
|
},
|
|
{
|
|
name: 'compoundPolicyData',
|
|
type: 'function',
|
|
stateMutability: 'view',
|
|
inputs: [{ type: 'uint64', name: 'policyId' }],
|
|
outputs: [
|
|
{ type: 'uint64', name: 'senderPolicyId' },
|
|
{ type: 'uint64', name: 'recipientPolicyId' },
|
|
{ type: 'uint64', name: 'mintRecipientPolicyId' },
|
|
],
|
|
},
|
|
{
|
|
name: 'createPolicy',
|
|
type: 'function',
|
|
stateMutability: 'nonpayable',
|
|
inputs: [
|
|
{ type: 'address', name: 'admin' },
|
|
{ type: 'uint8', name: 'policyType' },
|
|
],
|
|
outputs: [{ type: 'uint64' }],
|
|
},
|
|
{
|
|
name: 'createPolicyWithAccounts',
|
|
type: 'function',
|
|
stateMutability: 'nonpayable',
|
|
inputs: [
|
|
{ type: 'address', name: 'admin' },
|
|
{ type: 'uint8', name: 'policyType' },
|
|
{ type: 'address[]', name: 'accounts' },
|
|
],
|
|
outputs: [{ type: 'uint64' }],
|
|
},
|
|
{
|
|
name: 'setPolicyAdmin',
|
|
type: 'function',
|
|
stateMutability: 'nonpayable',
|
|
inputs: [
|
|
{ type: 'uint64', name: 'policyId' },
|
|
{ type: 'address', name: 'admin' },
|
|
],
|
|
outputs: [],
|
|
},
|
|
{
|
|
name: 'modifyPolicyWhitelist',
|
|
type: 'function',
|
|
stateMutability: 'nonpayable',
|
|
inputs: [
|
|
{ type: 'uint64', name: 'policyId' },
|
|
{ type: 'address', name: 'account' },
|
|
{ type: 'bool', name: 'allowed' },
|
|
],
|
|
outputs: [],
|
|
},
|
|
{
|
|
name: 'modifyPolicyBlacklist',
|
|
type: 'function',
|
|
stateMutability: 'nonpayable',
|
|
inputs: [
|
|
{ type: 'uint64', name: 'policyId' },
|
|
{ type: 'address', name: 'account' },
|
|
{ type: 'bool', name: 'restricted' },
|
|
],
|
|
outputs: [],
|
|
},
|
|
{
|
|
name: 'createCompoundPolicy',
|
|
type: 'function',
|
|
stateMutability: 'nonpayable',
|
|
inputs: [
|
|
{ type: 'uint64', name: 'senderPolicyId' },
|
|
{ type: 'uint64', name: 'recipientPolicyId' },
|
|
{ type: 'uint64', name: 'mintRecipientPolicyId' },
|
|
],
|
|
outputs: [{ type: 'uint64' }],
|
|
},
|
|
{
|
|
name: 'PolicyAdminUpdated',
|
|
type: 'event',
|
|
inputs: [
|
|
{ type: 'uint64', name: 'policyId', indexed: true },
|
|
{ type: 'address', name: 'updater', indexed: true },
|
|
{ type: 'address', name: 'admin', indexed: true },
|
|
],
|
|
},
|
|
{
|
|
name: 'PolicyCreated',
|
|
type: 'event',
|
|
inputs: [
|
|
{ type: 'uint64', name: 'policyId', indexed: true },
|
|
{ type: 'address', name: 'updater', indexed: true },
|
|
{ type: 'uint8', name: 'policyType' },
|
|
],
|
|
},
|
|
{
|
|
name: 'WhitelistUpdated',
|
|
type: 'event',
|
|
inputs: [
|
|
{ type: 'uint64', name: 'policyId', indexed: true },
|
|
{ type: 'address', name: 'updater', indexed: true },
|
|
{ type: 'address', name: 'account', indexed: true },
|
|
{ type: 'bool', name: 'allowed' },
|
|
],
|
|
},
|
|
{
|
|
name: 'BlacklistUpdated',
|
|
type: 'event',
|
|
inputs: [
|
|
{ type: 'uint64', name: 'policyId', indexed: true },
|
|
{ type: 'address', name: 'updater', indexed: true },
|
|
{ type: 'address', name: 'account', indexed: true },
|
|
{ type: 'bool', name: 'restricted' },
|
|
],
|
|
},
|
|
{
|
|
name: 'CompoundPolicyCreated',
|
|
type: 'event',
|
|
inputs: [
|
|
{ type: 'uint64', name: 'policyId', indexed: true },
|
|
{ type: 'address', name: 'creator', indexed: true },
|
|
{ type: 'uint64', name: 'senderPolicyId' },
|
|
{ type: 'uint64', name: 'recipientPolicyId' },
|
|
{ type: 'uint64', name: 'mintRecipientPolicyId' },
|
|
],
|
|
},
|
|
{ name: 'Unauthorized', type: 'error', inputs: [] },
|
|
{ name: 'PolicyNotFound', type: 'error', inputs: [] },
|
|
{ name: 'PolicyNotSimple', type: 'error', inputs: [] },
|
|
{ name: 'InvalidPolicyType', type: 'error', inputs: [] },
|
|
{ name: 'IncompatiblePolicyType', type: 'error', inputs: [] },
|
|
{ name: 'VirtualAddressNotAllowed', type: 'error', inputs: [] },
|
|
] as const
|
|
|
|
export const validatorConfig = [
|
|
{
|
|
name: 'getValidators',
|
|
type: 'function',
|
|
stateMutability: 'view',
|
|
inputs: [],
|
|
outputs: [
|
|
{
|
|
type: 'tuple[]',
|
|
name: 'validators',
|
|
components: [
|
|
{ type: 'bytes32', name: 'publicKey' },
|
|
{ type: 'bool', name: 'active' },
|
|
{ type: 'uint64', name: 'index' },
|
|
{ type: 'address', name: 'validatorAddress' },
|
|
{ type: 'string', name: 'inboundAddress' },
|
|
{ type: 'string', name: 'outboundAddress' },
|
|
],
|
|
},
|
|
],
|
|
},
|
|
{
|
|
name: 'addValidator',
|
|
type: 'function',
|
|
stateMutability: 'nonpayable',
|
|
inputs: [
|
|
{ type: 'address', name: 'newValidatorAddress' },
|
|
{ type: 'bytes32', name: 'publicKey' },
|
|
{ type: 'bool', name: 'active' },
|
|
{ type: 'string', name: 'inboundAddress' },
|
|
{ type: 'string', name: 'outboundAddress' },
|
|
],
|
|
outputs: [],
|
|
},
|
|
{
|
|
name: 'updateValidator',
|
|
type: 'function',
|
|
stateMutability: 'nonpayable',
|
|
inputs: [
|
|
{ type: 'address', name: 'newValidatorAddress' },
|
|
{ type: 'bytes32', name: 'publicKey' },
|
|
{ type: 'string', name: 'inboundAddress' },
|
|
{ type: 'string', name: 'outboundAddress' },
|
|
],
|
|
outputs: [],
|
|
},
|
|
{
|
|
name: 'changeValidatorStatus',
|
|
type: 'function',
|
|
stateMutability: 'nonpayable',
|
|
inputs: [
|
|
{ type: 'address', name: 'validator' },
|
|
{ type: 'bool', name: 'active' },
|
|
],
|
|
outputs: [],
|
|
},
|
|
{
|
|
name: 'changeValidatorStatusByIndex',
|
|
type: 'function',
|
|
stateMutability: 'nonpayable',
|
|
inputs: [
|
|
{ type: 'uint64', name: 'index' },
|
|
{ type: 'bool', name: 'active' },
|
|
],
|
|
outputs: [],
|
|
},
|
|
{
|
|
name: 'owner',
|
|
type: 'function',
|
|
stateMutability: 'view',
|
|
inputs: [],
|
|
outputs: [{ type: 'address' }],
|
|
},
|
|
{
|
|
name: 'changeOwner',
|
|
type: 'function',
|
|
stateMutability: 'nonpayable',
|
|
inputs: [{ type: 'address', name: 'newOwner' }],
|
|
outputs: [],
|
|
},
|
|
{
|
|
name: 'getNextFullDkgCeremony',
|
|
type: 'function',
|
|
stateMutability: 'view',
|
|
inputs: [],
|
|
outputs: [{ type: 'uint64' }],
|
|
},
|
|
{
|
|
name: 'setNextFullDkgCeremony',
|
|
type: 'function',
|
|
stateMutability: 'nonpayable',
|
|
inputs: [{ type: 'uint64', name: 'epoch' }],
|
|
outputs: [],
|
|
},
|
|
{
|
|
name: 'validatorsArray',
|
|
type: 'function',
|
|
stateMutability: 'view',
|
|
inputs: [{ type: 'uint256', name: 'index' }],
|
|
outputs: [{ type: 'address' }],
|
|
},
|
|
{
|
|
name: 'validators',
|
|
type: 'function',
|
|
stateMutability: 'view',
|
|
inputs: [{ type: 'address', name: 'validator' }],
|
|
outputs: [
|
|
{
|
|
type: 'tuple',
|
|
components: [
|
|
{ type: 'bytes32', name: 'publicKey' },
|
|
{ type: 'bool', name: 'active' },
|
|
{ type: 'uint64', name: 'index' },
|
|
{ type: 'address', name: 'validatorAddress' },
|
|
{ type: 'string', name: 'inboundAddress' },
|
|
{ type: 'string', name: 'outboundAddress' },
|
|
],
|
|
},
|
|
],
|
|
},
|
|
{
|
|
name: 'validatorCount',
|
|
type: 'function',
|
|
stateMutability: 'view',
|
|
inputs: [],
|
|
outputs: [{ type: 'uint64' }],
|
|
},
|
|
{ name: 'Unauthorized', type: 'error', inputs: [] },
|
|
{ name: 'ValidatorAlreadyExists', type: 'error', inputs: [] },
|
|
{ name: 'ValidatorNotFound', type: 'error', inputs: [] },
|
|
{ name: 'InvalidPublicKey', type: 'error', inputs: [] },
|
|
{
|
|
name: 'NotHostPort',
|
|
type: 'error',
|
|
inputs: [
|
|
{ type: 'string', name: 'field' },
|
|
{ type: 'string', name: 'input' },
|
|
{ type: 'string', name: 'backtrace' },
|
|
],
|
|
},
|
|
{
|
|
name: 'NotIpPort',
|
|
type: 'error',
|
|
inputs: [
|
|
{ type: 'string', name: 'field' },
|
|
{ type: 'string', name: 'input' },
|
|
{ type: 'string', name: 'backtrace' },
|
|
],
|
|
},
|
|
] as const
|
|
|
|
export const abis = [
|
|
...tip20,
|
|
...validatorConfigV2,
|
|
...signatureVerifier,
|
|
...stablecoinDex,
|
|
...addressRegistry,
|
|
...feeManager,
|
|
...feeAmm,
|
|
...accountKeychain,
|
|
...nonce,
|
|
...tip20Factory,
|
|
...tip403Registry,
|
|
...validatorConfig,
|
|
] as const
|