connectMarsPay
Connect to MarsPay built-in wallet or external wallet for secure interaction between DApp and user wallet. MarsPay wallet supports mainstream EVM blockchains; external wallets support multi-platform access, including WalletConnect and TokenPocket.
After successful connection, you can use web3.js and ethers.js to call on-chain contracts without additional configuration.
The following chain list represents the chain types currently supported by MarsPay, with more chains to be added continuously. If the required chain is not yet supported by MarsPay, use external wallet connection.
Ethereum
ETH
BNB Chain
BSC
Polygon
POLYGON
Avalanche-C
AVAXC
TRON
TRON
Arbitrum One
ARBITRUM
Poly Smart Chain
PSC
Viction
VIC
Request Parameters:
chainList
Array
Yes
Array of public chain abbreviations to connect (e.g., ["ETH", "BSC"]).
walletSupports
Array
No
Array of supported external wallets (e.g., ["WalletConnect", "TokenPocket"]). If not passed, defaults to connecting MarsPay; passing this adds wallet support.
Response Parameters:
chainType
String
Abbreviation of the chain for the successfully connected wallet.
account
String
Wallet address for the successful connection.
Call Example:
Last updated