import Account from './interfaces/Account'; import Utils from './Utils'; import { ethers } from 'ethers'; import { WalletState } from '@web3-onboard/core'; /** * @category SDK */ declare class Connection extends Utils { onboard: { connectWallet: typeof import("@web3-onboard/core/dist/connect").default; disconnectWallet: typeof import("@web3-onboard/core/dist/disconnect").default; setChain: typeof import("@web3-onboard/core/dist/chain").default; state: { get: () => import("@web3-onboard/core").AppState; select: { (): import("rxjs").Observable; (stateKey: T): import("rxjs").Observable; }; actions: { setWalletModules: typeof import("@web3-onboard/core/dist/store/actions").setWalletModules; setLocale: typeof import("@web3-onboard/core/dist/store/actions").setLocale; updateNotify: typeof import("@web3-onboard/core/dist/store/actions").updateNotify; customNotification: typeof import("@web3-onboard/core/dist/store/actions").customNotification; preflightNotifications: typeof import("@web3-onboard/core/dist/preflight-notifications").preflightNotifications; updateBalances: typeof import("@web3-onboard/core/dist/update-balances").default; updateAccountCenter: typeof import("@web3-onboard/core/dist/store/actions").updateAccountCenter; setPrimaryWallet: typeof import("@web3-onboard/core/dist/store/actions").setPrimaryWallet; }; }; }; wallets: Array; constructor(); /** * Reclaim signature web3 to Connect user or brand * @category Connection */ connectWeb3(): Promise; /** * Discconect user or brand to web3 * @category Connection */ disconnectWeb3(): Promise; middleWareConnected(provider: ethers.providers.Web3Provider): Promise; /** * Send a request to kanji server to connect account, need it to call API and web3 function * @param {boolean} getNewSignature * @param {string} userType can be 'customer' or 'brand', by default brand * @returns {string} return a JWT token from API * @category Connection */ connectToKanjiAccount(getNewSignature?: boolean, userType?: 'customer' | 'brand'): Promise; /** * Call Api to update current account connected * @param {Account} account Interface Account * @returns {Account} Return an interface Account of current user after update * @category Connection */ updateMyKanjiAccount(brand: Account): Promise; /** * Call Api to return current account * @returns {Account} Return an interface Account of current user after update * @category Connection */ getMyKanjiAccount(): Promise; /** * Return current connection of user * @returns {Wallet, jwt, network: {chainId,address,name} } Return all parameter of current connection from API * @category Connection */ currentConnection(): Promise<{ wallet: string; jwt: string | null; network: { chainId: number; address: string; name: string; }; } | null>; /** * Get JWT Token of authentification * @returns {string} Return a JWT token * @category Connection */ getJWT(): Promise; /** * Get Id of current web3 network connected * @returns {number} Return current ChainId of network web3 connected * @category Connection */ getIdChainNow(): Promise; /** * Return if current network chain ID is accepted in kanji platform * @param {number} currentChainId Chain id of current network web3 connected * @returns {boolean} Return true if network is accepted, false if it isn't * @category Connection */ networkInChainAccepted(currentChainId: number): Promise; /** * * @param currentChainId * @returns */ networkChainString(currentChainId: number): Promise; /** * * @returns */ networkAccepted(): Promise<{ 'ethereum-goerli': number; 'ethereum-ropsten': number; 'ethereum-rinkeby': number; 'ethereum-kovan': number; 'ethereum-mainnet': number; 'polygon-mainnet': number; 'polygon-mumbai': number; }>; /** * * @returns */ onChangeNetwork(): Promise; /** * * @param chainId */ changeNetwork(chainId: string): Promise; /** * * @returns */ currentChainIsAccepted(): Promise; setApiKey(api_key: string): Promise; } export default Connection;