@qso-soft/shared
Version:
Shared library for QSO-soft
713 lines • 25.9 kB
JavaScript
export const MERKLY_CONTRACTS = {
arbitrum: '0xaa58e77238f0e4a565343a89a79b4addd744d649',
polygon: '0xa184998eC58dc1dA77a1F9f1e361541257A50CF4',
scroll: '0x7dfb5e7808b5eb4fb8b9e7169537575f6ff1a218',
bsc: '0xFDc9018aF0E37AbF89233554C937eB5068127080',
opBNB: '0xE47b05F2026a82048caAECf5caE58e5AAE2405eA',
linea: '0xDB3Bb6D5a8EeEAfc64C66C176900E6B82b23dd5f',
zkSync: '0x6dd28C2c5B91DD63b4d4E78EcAC7139878371768',
};
export const DEST_NETWORK_IDS = {
arbitrum: 110,
polygon: 109,
scroll: 214,
conflux: 212,
opBNB: 202,
bsc: 56,
linea: 59144,
zkSync: 324,
};
export const MERKLY_ABI = [
{
inputs: [
{ internalType: 'uint256', name: '_minGasToTransfer', type: 'uint256' },
{ internalType: 'address', name: '_layerZeroEndpoint', type: 'address' },
{ internalType: 'uint256', name: '_startMintId', type: 'uint256' },
{ internalType: 'uint256', name: '_endMintId', type: 'uint256' },
],
stateMutability: 'nonpayable',
type: 'constructor',
},
{
anonymous: false,
inputs: [
{ indexed: true, internalType: 'address', name: 'owner', type: 'address' },
{ indexed: true, internalType: 'address', name: 'approved', type: 'address' },
{ indexed: true, internalType: 'uint256', name: 'tokenId', type: 'uint256' },
],
name: 'Approval',
type: 'event',
},
{
anonymous: false,
inputs: [
{ indexed: true, internalType: 'address', name: 'owner', type: 'address' },
{ indexed: true, internalType: 'address', name: 'operator', type: 'address' },
{ indexed: false, internalType: 'bool', name: 'approved', type: 'bool' },
],
name: 'ApprovalForAll',
type: 'event',
},
{
anonymous: false,
inputs: [{ indexed: false, internalType: 'bytes32', name: '_hashedPayload', type: 'bytes32' }],
name: 'CreditCleared',
type: 'event',
},
{
anonymous: false,
inputs: [
{ indexed: false, internalType: 'bytes32', name: '_hashedPayload', type: 'bytes32' },
{ indexed: false, internalType: 'bytes', name: '_payload', type: 'bytes' },
],
name: 'CreditStored',
type: 'event',
},
{
anonymous: false,
inputs: [
{ indexed: false, internalType: 'uint16', name: '_srcChainId', type: 'uint16' },
{ indexed: false, internalType: 'bytes', name: '_srcAddress', type: 'bytes' },
{ indexed: false, internalType: 'uint64', name: '_nonce', type: 'uint64' },
{ indexed: false, internalType: 'bytes', name: '_payload', type: 'bytes' },
{ indexed: false, internalType: 'bytes', name: '_reason', type: 'bytes' },
],
name: 'MessageFailed',
type: 'event',
},
{
anonymous: false,
inputs: [
{ indexed: true, internalType: 'address', name: 'previousOwner', type: 'address' },
{ indexed: true, internalType: 'address', name: 'newOwner', type: 'address' },
],
name: 'OwnershipTransferred',
type: 'event',
},
{
anonymous: false,
inputs: [
{ indexed: true, internalType: 'uint16', name: '_srcChainId', type: 'uint16' },
{ indexed: true, internalType: 'bytes', name: '_srcAddress', type: 'bytes' },
{ indexed: true, internalType: 'address', name: '_toAddress', type: 'address' },
{ indexed: false, internalType: 'uint256[]', name: '_tokenIds', type: 'uint256[]' },
],
name: 'ReceiveFromChain',
type: 'event',
},
{
anonymous: false,
inputs: [
{ indexed: false, internalType: 'uint16', name: '_srcChainId', type: 'uint16' },
{ indexed: false, internalType: 'bytes', name: '_srcAddress', type: 'bytes' },
{ indexed: false, internalType: 'uint64', name: '_nonce', type: 'uint64' },
{ indexed: false, internalType: 'bytes32', name: '_payloadHash', type: 'bytes32' },
],
name: 'RetryMessageSuccess',
type: 'event',
},
{
anonymous: false,
inputs: [
{ indexed: true, internalType: 'uint16', name: '_dstChainId', type: 'uint16' },
{ indexed: true, internalType: 'address', name: '_from', type: 'address' },
{ indexed: true, internalType: 'bytes', name: '_toAddress', type: 'bytes' },
{ indexed: false, internalType: 'uint256[]', name: '_tokenIds', type: 'uint256[]' },
],
name: 'SendToChain',
type: 'event',
},
{
anonymous: false,
inputs: [
{ indexed: false, internalType: 'uint16', name: '_dstChainId', type: 'uint16' },
{ indexed: false, internalType: 'uint256', name: '_dstChainIdToBatchLimit', type: 'uint256' },
],
name: 'SetDstChainIdToBatchLimit',
type: 'event',
},
{
anonymous: false,
inputs: [
{ indexed: false, internalType: 'uint16', name: '_dstChainId', type: 'uint16' },
{ indexed: false, internalType: 'uint256', name: '_dstChainIdToTransferGas', type: 'uint256' },
],
name: 'SetDstChainIdToTransferGas',
type: 'event',
},
{
anonymous: false,
inputs: [
{ indexed: false, internalType: 'uint16', name: '_dstChainId', type: 'uint16' },
{ indexed: false, internalType: 'uint16', name: '_type', type: 'uint16' },
{ indexed: false, internalType: 'uint256', name: '_minDstGas', type: 'uint256' },
],
name: 'SetMinDstGas',
type: 'event',
},
{
anonymous: false,
inputs: [{ indexed: false, internalType: 'uint256', name: '_minGasToTransferAndStore', type: 'uint256' }],
name: 'SetMinGasToTransferAndStore',
type: 'event',
},
{
anonymous: false,
inputs: [{ indexed: false, internalType: 'address', name: 'precrime', type: 'address' }],
name: 'SetPrecrime',
type: 'event',
},
{
anonymous: false,
inputs: [
{ indexed: false, internalType: 'uint16', name: '_remoteChainId', type: 'uint16' },
{ indexed: false, internalType: 'bytes', name: '_path', type: 'bytes' },
],
name: 'SetTrustedRemote',
type: 'event',
},
{
anonymous: false,
inputs: [
{ indexed: false, internalType: 'uint16', name: '_remoteChainId', type: 'uint16' },
{ indexed: false, internalType: 'bytes', name: '_remoteAddress', type: 'bytes' },
],
name: 'SetTrustedRemoteAddress',
type: 'event',
},
{
anonymous: false,
inputs: [
{ indexed: true, internalType: 'address', name: 'from', type: 'address' },
{ indexed: true, internalType: 'address', name: 'to', type: 'address' },
{ indexed: true, internalType: 'uint256', name: 'tokenId', type: 'uint256' },
],
name: 'Transfer',
type: 'event',
},
{
inputs: [],
name: 'DEFAULT_PAYLOAD_SIZE_LIMIT',
outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }],
stateMutability: 'view',
type: 'function',
},
{
inputs: [],
name: 'FUNCTION_TYPE_SEND',
outputs: [{ internalType: 'uint16', name: '', type: 'uint16' }],
stateMutability: 'view',
type: 'function',
},
{
inputs: [
{ internalType: 'address', name: 'to', type: 'address' },
{ internalType: 'uint256', name: 'tokenId', type: 'uint256' },
],
name: 'approve',
outputs: [],
stateMutability: 'nonpayable',
type: 'function',
},
{
inputs: [{ internalType: 'address', name: 'owner', type: 'address' }],
name: 'balanceOf',
outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }],
stateMutability: 'view',
type: 'function',
},
{
inputs: [
{ internalType: 'uint16', name: '_dstChainId', type: 'uint16' },
{ internalType: 'address', name: '_zroPaymentAddress', type: 'address' },
{ internalType: 'bytes', name: '_adapterParams', type: 'bytes' },
],
name: 'bridgeGas',
outputs: [],
stateMutability: 'payable',
type: 'function',
},
{
inputs: [{ internalType: 'bytes', name: '_payload', type: 'bytes' }],
name: 'clearCredits',
outputs: [],
stateMutability: 'nonpayable',
type: 'function',
},
{
inputs: [{ internalType: 'uint16', name: '', type: 'uint16' }],
name: 'dstChainIdToBatchLimit',
outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }],
stateMutability: 'view',
type: 'function',
},
{
inputs: [{ internalType: 'uint16', name: '', type: 'uint16' }],
name: 'dstChainIdToTransferGas',
outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }],
stateMutability: 'view',
type: 'function',
},
{
inputs: [
{ internalType: 'uint16', name: '_dstChainId', type: 'uint16' },
{ internalType: 'bool', name: '_useZro', type: 'bool' },
{ internalType: 'bytes', name: '_adapterParams', type: 'bytes' },
],
name: 'estimateGasBridgeFee',
outputs: [
{ internalType: 'uint256', name: 'nativeFee', type: 'uint256' },
{ internalType: 'uint256', name: 'zroFee', type: 'uint256' },
],
stateMutability: 'view',
type: 'function',
},
{
inputs: [
{ internalType: 'uint16', name: '_dstChainId', type: 'uint16' },
{ internalType: 'bytes', name: '_toAddress', type: 'bytes' },
{ internalType: 'uint256[]', name: '_tokenIds', type: 'uint256[]' },
{ internalType: 'bool', name: '_useZro', type: 'bool' },
{ internalType: 'bytes', name: '_adapterParams', type: 'bytes' },
],
name: 'estimateSendBatchFee',
outputs: [
{ internalType: 'uint256', name: 'nativeFee', type: 'uint256' },
{ internalType: 'uint256', name: 'zroFee', type: 'uint256' },
],
stateMutability: 'view',
type: 'function',
},
{
inputs: [
{ internalType: 'uint16', name: '_dstChainId', type: 'uint16' },
{ internalType: 'bytes', name: '_toAddress', type: 'bytes' },
{ internalType: 'uint256', name: '_tokenId', type: 'uint256' },
{ internalType: 'bool', name: '_useZro', type: 'bool' },
{ internalType: 'bytes', name: '_adapterParams', type: 'bytes' },
],
name: 'estimateSendFee',
outputs: [
{ internalType: 'uint256', name: 'nativeFee', type: 'uint256' },
{ internalType: 'uint256', name: 'zroFee', type: 'uint256' },
],
stateMutability: 'view',
type: 'function',
},
{
inputs: [
{ internalType: 'uint16', name: '', type: 'uint16' },
{ internalType: 'bytes', name: '', type: 'bytes' },
{ internalType: 'uint64', name: '', type: 'uint64' },
],
name: 'failedMessages',
outputs: [{ internalType: 'bytes32', name: '', type: 'bytes32' }],
stateMutability: 'view',
type: 'function',
},
{
inputs: [],
name: 'fee',
outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }],
stateMutability: 'view',
type: 'function',
},
{
inputs: [
{ internalType: 'uint16', name: '_srcChainId', type: 'uint16' },
{ internalType: 'bytes', name: '_srcAddress', type: 'bytes' },
],
name: 'forceResumeReceive',
outputs: [],
stateMutability: 'nonpayable',
type: 'function',
},
{
inputs: [{ internalType: 'uint256', name: 'tokenId', type: 'uint256' }],
name: 'getApproved',
outputs: [{ internalType: 'address', name: '', type: 'address' }],
stateMutability: 'view',
type: 'function',
},
{
inputs: [
{ internalType: 'uint16', name: '_version', type: 'uint16' },
{ internalType: 'uint16', name: '_chainId', type: 'uint16' },
{ internalType: 'address', name: '', type: 'address' },
{ internalType: 'uint256', name: '_configType', type: 'uint256' },
],
name: 'getConfig',
outputs: [{ internalType: 'bytes', name: '', type: 'bytes' }],
stateMutability: 'view',
type: 'function',
},
{
inputs: [{ internalType: 'uint16', name: '_remoteChainId', type: 'uint16' }],
name: 'getTrustedRemoteAddress',
outputs: [{ internalType: 'bytes', name: '', type: 'bytes' }],
stateMutability: 'view',
type: 'function',
},
{
inputs: [
{ internalType: 'address', name: 'owner', type: 'address' },
{ internalType: 'address', name: 'operator', type: 'address' },
],
name: 'isApprovedForAll',
outputs: [{ internalType: 'bool', name: '', type: 'bool' }],
stateMutability: 'view',
type: 'function',
},
{
inputs: [
{ internalType: 'uint16', name: '_srcChainId', type: 'uint16' },
{ internalType: 'bytes', name: '_srcAddress', type: 'bytes' },
],
name: 'isTrustedRemote',
outputs: [{ internalType: 'bool', name: '', type: 'bool' }],
stateMutability: 'view',
type: 'function',
},
{
inputs: [],
name: 'lzEndpoint',
outputs: [{ internalType: 'contract ILayerZeroEndpoint', name: '', type: 'address' }],
stateMutability: 'view',
type: 'function',
},
{
inputs: [
{ internalType: 'uint16', name: '_srcChainId', type: 'uint16' },
{ internalType: 'bytes', name: '_srcAddress', type: 'bytes' },
{ internalType: 'uint64', name: '_nonce', type: 'uint64' },
{ internalType: 'bytes', name: '_payload', type: 'bytes' },
],
name: 'lzReceive',
outputs: [],
stateMutability: 'nonpayable',
type: 'function',
},
{
inputs: [],
name: 'maxMintId',
outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }],
stateMutability: 'view',
type: 'function',
},
{
inputs: [
{ internalType: 'uint16', name: '', type: 'uint16' },
{ internalType: 'uint16', name: '', type: 'uint16' },
],
name: 'minDstGasLookup',
outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }],
stateMutability: 'view',
type: 'function',
},
{
inputs: [],
name: 'minGasToTransferAndStore',
outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }],
stateMutability: 'view',
type: 'function',
},
{ inputs: [], name: 'mint', outputs: [], stateMutability: 'payable', type: 'function' },
{
inputs: [],
name: 'name',
outputs: [{ internalType: 'string', name: '', type: 'string' }],
stateMutability: 'view',
type: 'function',
},
{
inputs: [],
name: 'nextMintId',
outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }],
stateMutability: 'view',
type: 'function',
},
{
inputs: [
{ internalType: 'uint16', name: '_srcChainId', type: 'uint16' },
{ internalType: 'bytes', name: '_srcAddress', type: 'bytes' },
{ internalType: 'uint64', name: '_nonce', type: 'uint64' },
{ internalType: 'bytes', name: '_payload', type: 'bytes' },
],
name: 'nonblockingLzReceive',
outputs: [],
stateMutability: 'nonpayable',
type: 'function',
},
{
inputs: [],
name: 'owner',
outputs: [{ internalType: 'address', name: '', type: 'address' }],
stateMutability: 'view',
type: 'function',
},
{
inputs: [{ internalType: 'uint256', name: 'tokenId', type: 'uint256' }],
name: 'ownerOf',
outputs: [{ internalType: 'address', name: '', type: 'address' }],
stateMutability: 'view',
type: 'function',
},
{
inputs: [{ internalType: 'uint16', name: '', type: 'uint16' }],
name: 'payloadSizeLimitLookup',
outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }],
stateMutability: 'view',
type: 'function',
},
{
inputs: [],
name: 'precrime',
outputs: [{ internalType: 'address', name: '', type: 'address' }],
stateMutability: 'view',
type: 'function',
},
{ inputs: [], name: 'renounceOwnership', outputs: [], stateMutability: 'nonpayable', type: 'function' },
{
inputs: [
{ internalType: 'uint16', name: '_srcChainId', type: 'uint16' },
{ internalType: 'bytes', name: '_srcAddress', type: 'bytes' },
{ internalType: 'uint64', name: '_nonce', type: 'uint64' },
{ internalType: 'bytes', name: '_payload', type: 'bytes' },
],
name: 'retryMessage',
outputs: [],
stateMutability: 'payable',
type: 'function',
},
{
inputs: [
{ internalType: 'address', name: 'from', type: 'address' },
{ internalType: 'address', name: 'to', type: 'address' },
{ internalType: 'uint256', name: 'tokenId', type: 'uint256' },
],
name: 'safeTransferFrom',
outputs: [],
stateMutability: 'nonpayable',
type: 'function',
},
{
inputs: [
{ internalType: 'address', name: 'from', type: 'address' },
{ internalType: 'address', name: 'to', type: 'address' },
{ internalType: 'uint256', name: 'tokenId', type: 'uint256' },
{ internalType: 'bytes', name: 'data', type: 'bytes' },
],
name: 'safeTransferFrom',
outputs: [],
stateMutability: 'nonpayable',
type: 'function',
},
{
inputs: [
{ internalType: 'address', name: '_from', type: 'address' },
{ internalType: 'uint16', name: '_dstChainId', type: 'uint16' },
{ internalType: 'bytes', name: '_toAddress', type: 'bytes' },
{ internalType: 'uint256[]', name: '_tokenIds', type: 'uint256[]' },
{ internalType: 'address payable', name: '_refundAddress', type: 'address' },
{ internalType: 'address', name: '_zroPaymentAddress', type: 'address' },
{ internalType: 'bytes', name: '_adapterParams', type: 'bytes' },
],
name: 'sendBatchFrom',
outputs: [],
stateMutability: 'payable',
type: 'function',
},
{
inputs: [
{ internalType: 'address', name: '_from', type: 'address' },
{ internalType: 'uint16', name: '_dstChainId', type: 'uint16' },
{ internalType: 'bytes', name: '_toAddress', type: 'bytes' },
{ internalType: 'uint256', name: '_tokenId', type: 'uint256' },
{ internalType: 'address payable', name: '_refundAddress', type: 'address' },
{ internalType: 'address', name: '_zroPaymentAddress', type: 'address' },
{ internalType: 'bytes', name: '_adapterParams', type: 'bytes' },
],
name: 'sendFrom',
outputs: [],
stateMutability: 'payable',
type: 'function',
},
{
inputs: [
{ internalType: 'address', name: 'operator', type: 'address' },
{ internalType: 'bool', name: 'approved', type: 'bool' },
],
name: 'setApprovalForAll',
outputs: [],
stateMutability: 'nonpayable',
type: 'function',
},
{
inputs: [
{ internalType: 'uint16', name: '_version', type: 'uint16' },
{ internalType: 'uint16', name: '_chainId', type: 'uint16' },
{ internalType: 'uint256', name: '_configType', type: 'uint256' },
{ internalType: 'bytes', name: '_config', type: 'bytes' },
],
name: 'setConfig',
outputs: [],
stateMutability: 'nonpayable',
type: 'function',
},
{
inputs: [
{ internalType: 'uint16', name: '_dstChainId', type: 'uint16' },
{ internalType: 'uint256', name: '_dstChainIdToBatchLimit', type: 'uint256' },
],
name: 'setDstChainIdToBatchLimit',
outputs: [],
stateMutability: 'nonpayable',
type: 'function',
},
{
inputs: [
{ internalType: 'uint16', name: '_dstChainId', type: 'uint16' },
{ internalType: 'uint256', name: '_dstChainIdToTransferGas', type: 'uint256' },
],
name: 'setDstChainIdToTransferGas',
outputs: [],
stateMutability: 'nonpayable',
type: 'function',
},
{
inputs: [{ internalType: 'uint256', name: '_fee', type: 'uint256' }],
name: 'setFee',
outputs: [],
stateMutability: 'nonpayable',
type: 'function',
},
{
inputs: [
{ internalType: 'uint16', name: '_dstChainId', type: 'uint16' },
{ internalType: 'uint16', name: '_packetType', type: 'uint16' },
{ internalType: 'uint256', name: '_minGas', type: 'uint256' },
],
name: 'setMinDstGas',
outputs: [],
stateMutability: 'nonpayable',
type: 'function',
},
{
inputs: [{ internalType: 'uint256', name: '_minGasToTransferAndStore', type: 'uint256' }],
name: 'setMinGasToTransferAndStore',
outputs: [],
stateMutability: 'nonpayable',
type: 'function',
},
{
inputs: [
{ internalType: 'uint16', name: '_dstChainId', type: 'uint16' },
{ internalType: 'uint256', name: '_size', type: 'uint256' },
],
name: 'setPayloadSizeLimit',
outputs: [],
stateMutability: 'nonpayable',
type: 'function',
},
{
inputs: [{ internalType: 'address', name: '_precrime', type: 'address' }],
name: 'setPrecrime',
outputs: [],
stateMutability: 'nonpayable',
type: 'function',
},
{
inputs: [{ internalType: 'uint16', name: '_version', type: 'uint16' }],
name: 'setReceiveVersion',
outputs: [],
stateMutability: 'nonpayable',
type: 'function',
},
{
inputs: [{ internalType: 'uint16', name: '_version', type: 'uint16' }],
name: 'setSendVersion',
outputs: [],
stateMutability: 'nonpayable',
type: 'function',
},
{
inputs: [
{ internalType: 'uint16', name: '_remoteChainId', type: 'uint16' },
{ internalType: 'bytes', name: '_path', type: 'bytes' },
],
name: 'setTrustedRemote',
outputs: [],
stateMutability: 'nonpayable',
type: 'function',
},
{
inputs: [
{ internalType: 'uint16', name: '_remoteChainId', type: 'uint16' },
{ internalType: 'bytes', name: '_remoteAddress', type: 'bytes' },
],
name: 'setTrustedRemoteAddress',
outputs: [],
stateMutability: 'nonpayable',
type: 'function',
},
{
inputs: [{ internalType: 'bytes32', name: '', type: 'bytes32' }],
name: 'storedCredits',
outputs: [
{ internalType: 'uint16', name: 'srcChainId', type: 'uint16' },
{ internalType: 'address', name: 'toAddress', type: 'address' },
{ internalType: 'uint256', name: 'index', type: 'uint256' },
{ internalType: 'bool', name: 'creditsRemain', type: 'bool' },
],
stateMutability: 'view',
type: 'function',
},
{
inputs: [{ internalType: 'bytes4', name: 'interfaceId', type: 'bytes4' }],
name: 'supportsInterface',
outputs: [{ internalType: 'bool', name: '', type: 'bool' }],
stateMutability: 'view',
type: 'function',
},
{
inputs: [],
name: 'symbol',
outputs: [{ internalType: 'string', name: '', type: 'string' }],
stateMutability: 'view',
type: 'function',
},
{
inputs: [{ internalType: 'uint256', name: 'id', type: 'uint256' }],
name: 'tokenURI',
outputs: [{ internalType: 'string', name: '', type: 'string' }],
stateMutability: 'view',
type: 'function',
},
{
inputs: [
{ internalType: 'address', name: 'from', type: 'address' },
{ internalType: 'address', name: 'to', type: 'address' },
{ internalType: 'uint256', name: 'tokenId', type: 'uint256' },
],
name: 'transferFrom',
outputs: [],
stateMutability: 'nonpayable',
type: 'function',
},
{
inputs: [{ internalType: 'address', name: 'newOwner', type: 'address' }],
name: 'transferOwnership',
outputs: [],
stateMutability: 'nonpayable',
type: 'function',
},
{
inputs: [{ internalType: 'uint16', name: '', type: 'uint16' }],
name: 'trustedRemoteLookup',
outputs: [{ internalType: 'bytes', name: '', type: 'bytes' }],
stateMutability: 'view',
type: 'function',
},
{ inputs: [], name: 'withdraw', outputs: [], stateMutability: 'payable', type: 'function' },
];
//# sourceMappingURL=data.js.map