[toc]
This doc will show how to connect the Aptos DApps in HyperPay wallet.
HyperPay wallet supports Aptos devnet.You can add aptos network in lastest version.
If DApp wants to show HyperPay wallet info in DAppBrowser. There are several ways to do.
- If DApp uses aptos-wallet-adapter to integrate the wallet, nothing needs to be done. Hyperpay DAppBrowser can directly display relevant wallet information, as shown in the following picture: aptos-wallet-adapter supports wallets:
{
Aptos official wallet
Martian wallet
Fewcha wallet
Hippo wallet
Hippo web wallet
Pontem Wallet
Spika wallet
HyperPay wallet
etc...
}
- If DApp wants to display HyperPay directly. We can provide wallet logo, etc.
enum DAppMethod: String, Decodable, CaseIterable {
case connect
case disconnect
case signMessage
case signTransaction
case account
case signAndSubmitTransaction
case signTransaction
}
You can also refer to aptos-core. We use the wallet-adapter as the connection method wallet-adapter and support npmjs wallet-adapter If Aptos DApp wants to show HyperPay wallet info in DAppBrowser.
const wallets = useMemo(
() => [
new HyperPayWalletAdapter(),
new HippoExtensionWalletAdapter(),
new MartianWalletAdapter(),
new AptosWalletAdapter(),
new FewchaWalletAdapter(),
new PontemWalletAdapter(),
new SpikaWalletAdapter()
],
[]
);
const isHyperPayInstalled = window.isHyperPay || window.hyperpay
await window.hyperpay.connect();
Once the mobile application is connected to HyperPay wallet, it will be able to read the connected account's address and publicKey
const account = await window.hyperpay.account();
console.log(account);
etc.