UNPKG

@skalenetwork/metaport

Version:

SKALE Metaport Widget

391 lines (390 loc) 10.5 kB
/** * @license * SKALE Metaport * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>. */ import { MainnetChain, SChain } from '@skalenetwork/ima-js'; import { Chain } from '@wagmi/core'; import proxyEndpoints from '../metadata/proxy.json'; import { SkaleNetwork } from './interfaces'; export { proxyEndpoints as PROXY_ENDPOINTS }; export declare const CHAIN_IDS: { [network in SkaleNetwork]: number; }; export declare function isMainnetChainId(chainId: number | BigInt, skaleNetwork: SkaleNetwork): boolean; export declare function getChainEndpoint(mainnetEndpoint: string, network: SkaleNetwork, chainName: string): string; export declare function getSChainEndpoint(network: SkaleNetwork, sChainName: string, protocol?: 'http' | 'ws'): string; export declare function getMainnetAbi(network: string): { message_proxy_mainnet_address: string; linker_address: string; community_pool_address: string; deposit_box_eth_address: string; deposit_box_erc20_address: string; deposit_box_erc721_address: string; deposit_box_erc1155_address: string; deposit_box_erc721_with_metadata_address: string; message_proxy_mainnet_abi: ({ type: string; anonymous: boolean; name: string; inputs: { type: string; name: string; indexed: boolean; }[]; constant?: undefined; stateMutability?: undefined; payable?: undefined; outputs?: undefined; } | { type: string; name: string; constant: boolean; stateMutability: string; payable: boolean; inputs: { type: string; name: string; }[]; outputs: { type: string; name: string; }[]; anonymous?: undefined; } | { type: string; name: string; constant: boolean; payable: boolean; inputs: ({ type: string; name: string; components?: undefined; } | { type: string; name: string; components: { type: string; name: string; }[]; })[]; outputs: any[]; anonymous?: undefined; stateMutability?: undefined; })[]; linker_abi: ({ type: string; anonymous: boolean; name: string; inputs: { type: string; name: string; indexed: boolean; }[]; constant?: undefined; payable?: undefined; outputs?: undefined; stateMutability?: undefined; } | { type: string; name: string; constant: boolean; payable: boolean; inputs: { type: string; name: string; }[]; outputs: any[]; anonymous?: undefined; stateMutability?: undefined; } | { type: string; name: string; constant: boolean; stateMutability: string; payable: boolean; inputs: { type: string; name: string; }[]; outputs: { type: string; name: string; }[]; anonymous?: undefined; })[]; community_pool_abi: ({ type: string; anonymous: boolean; name: string; inputs: { type: string; name: string; indexed: boolean; }[]; constant?: undefined; stateMutability?: undefined; payable?: undefined; outputs?: undefined; } | { type: string; name: string; constant: boolean; stateMutability: string; payable: boolean; inputs: { type: string; name: string; }[]; outputs: { type: string; name: string; }[]; anonymous?: undefined; } | { type: string; name: string; constant: boolean; payable: boolean; inputs: { type: string; name: string; }[]; outputs: { type: string; name: string; }[]; anonymous?: undefined; stateMutability?: undefined; })[]; deposit_box_eth_abi: ({ type: string; anonymous: boolean; name: string; inputs: { type: string; name: string; indexed: boolean; }[]; constant?: undefined; stateMutability?: undefined; payable?: undefined; outputs?: undefined; } | { type: string; name: string; constant: boolean; stateMutability: string; payable: boolean; inputs: { type: string; name: string; }[]; outputs: { type: string; name: string; }[]; anonymous?: undefined; } | { type: string; name: string; constant: boolean; payable: boolean; inputs: { type: string; name: string; }[]; outputs: any[]; anonymous?: undefined; stateMutability?: undefined; })[]; deposit_box_erc20_abi: ({ type: string; name: string; inputs: any[]; anonymous?: undefined; constant?: undefined; payable?: undefined; outputs?: undefined; stateMutability?: undefined; } | { type: string; anonymous: boolean; name: string; inputs: { type: string; name: string; indexed: boolean; }[]; constant?: undefined; payable?: undefined; outputs?: undefined; stateMutability?: undefined; } | { type: string; name: string; constant: boolean; payable: boolean; inputs: { type: string; name: string; }[]; outputs: any[]; anonymous?: undefined; stateMutability?: undefined; } | { type: string; name: string; constant: boolean; stateMutability: string; payable: boolean; inputs: { type: string; name: string; }[]; outputs: { type: string; name: string; }[]; anonymous?: undefined; })[]; deposit_box_erc721_abi: ({ type: string; anonymous: boolean; name: string; inputs: { type: string; name: string; indexed: boolean; }[]; constant?: undefined; payable?: undefined; outputs?: undefined; stateMutability?: undefined; } | { type: string; name: string; constant: boolean; payable: boolean; inputs: { type: string; name: string; }[]; outputs: any[]; anonymous?: undefined; stateMutability?: undefined; } | { type: string; name: string; constant: boolean; stateMutability: string; payable: boolean; inputs: { type: string; name: string; }[]; outputs: { type: string; name: string; }[]; anonymous?: undefined; })[]; deposit_box_erc1155_abi: ({ type: string; anonymous: boolean; name: string; inputs: { type: string; name: string; indexed: boolean; }[]; constant?: undefined; payable?: undefined; outputs?: undefined; stateMutability?: undefined; } | { type: string; name: string; constant: boolean; payable: boolean; inputs: { type: string; name: string; }[]; outputs: any[]; anonymous?: undefined; stateMutability?: undefined; } | { type: string; name: string; constant: boolean; stateMutability: string; payable: boolean; inputs: { type: string; name: string; }[]; outputs: { type: string; name: string; }[]; anonymous?: undefined; })[]; deposit_box_erc721_with_metadata_abi: ({ type: string; anonymous: boolean; name: string; inputs: { type: string; name: string; indexed: boolean; }[]; constant?: undefined; payable?: undefined; outputs?: undefined; stateMutability?: undefined; } | { type: string; name: string; constant: boolean; payable: boolean; inputs: { type: string; name: string; }[]; outputs: any[]; anonymous?: undefined; stateMutability?: undefined; } | { type: string; name: string; constant: boolean; stateMutability: string; payable: boolean; inputs: { type: string; name: string; }[]; outputs: { type: string; name: string; }[]; anonymous?: undefined; })[]; }; export declare function initIMA(mainnetEndpoint: string, network: SkaleNetwork, chainName: string): MainnetChain | SChain; export declare function initMainnet(mainnetEndpoint: string, network: string): MainnetChain; export declare function initSChain(network: SkaleNetwork, chainName: string): SChain; export declare function enforceNetwork(chainId: bigint, walletClient: any, switchNetwork: (chainId: number | undefined) => Promise<Chain | undefined>, skaleNetwork: SkaleNetwork, chainName: string): Promise<bigint>;