Building Chaac A Mayachain Wallet with KeepKey SDK.
Open-source hardware wallet. Bitcoin, Ethereum, Solana, TON, TRON, Cosmos, and all EVM chains. Your keys never leave the device.
Open-source hardware wallet. Bitcoin, Ethereum, Solana, TON, TRON, Cosmos, and all EVM chains. Your keys never leave the device.
Using Vercel to build, deploy publish a Mayachain wallet

TLDR: repo https://github.com/keepkey/Maya-dApp
URL: https://maya-d-app.vercel.app/
Clone the repo locally:
https://github.com/keepkey/Maya-dAppRun it:
pnpm i
pnpm run dev
Mounting the wallet:
const chains = ['MAYA']; // Example chains
// @ts-ignore
const { keepkeyWallet } = await import('@coinmasters/wallet-keepkey');
const walletKeepKey: KeepKeyWallet = {
type: 'KEEPKEY',
icon: 'https://pioneers.dev/coins/keepkey.png',
chains,
wallet: keepkeyWallet,
status: 'offline',
isConnected: false,
MAYA: {}
};KeepKey config:
let keepkeyConfig = {
apiKey: localStorage.getItem('keepkeyApiKey') || '123',
pairingInfo: {
name: "Maya Wallet",
imageUrl: "https://i.pinimg.com/originals/24/77/56/247756ac928c5f60fc786aef33485f17.jpg",
basePath: 'http://localhost:1646/spec/swagger.json',
url: 'http://localhost:1646',
}
}These config params are used during pairing.

More information on KeepKey app pairing: Understanding The KeepKey REST API
Reviewing the KeepKey wallet instance class:
const wallet = keepkeyInstance['MAYA'].wallet;Wallet Object:
wallet: {
address: "maya1g9el7lzjwh9yun2c4jjzhy09j98vkhfxfqkl5k",
walletType: "KEEPKEY",
balance: [
AssetValue {
bigIntValue: 302513052572n,
decimalMultiplier: 10000000000n,
decimal: 10,
address: undefined,
chain: "MAYA",
isGasAsset: true,
isSynthetic: false,
symbol: "CACAO",
tax: undefined,
ticker: "CACAO",
type: "Native"
},
AssetValue {
bigIntValue: 41040000n,
decimalMultiplier: 100000000n,
decimal: 4,
address: undefined,
chain: "MAYA",
isGasAsset: false,
isSynthetic: false,
symbol: "CACAO",
tax: undefined,
ticker: "CACAO",
type: "Native"
}
]
}The walletMethods object:
wallet = {
deposit: async (param) => { ... },
getAccount: (e) => { ... },
getAddress: () => { ... },
getBalance: async (e) => { ... },
getFees: async () => { ... },
sendRawTransaction: async (e) => { ... },
transfer: async (param) => { ... }
};To get your address:
setWalletAddress(wallet.address);View balances:
wallet.balances[0].getValue('string')Serialize and deserializing values with AssetValue class.
Encode 500 as MAYA:
let assetString = 'MAYA.MAYA'
await AssetValue.loadStaticAssets();
const assetValue = AssetValue.fromStringSync(assetString, parseFloat("500"));Decode AssetValue to string:
assetValue?.getValue('string') // output "500"hooks/useTransfer.tsx
let sendPayload = {
assetValue,
memo,
recipient: destination,
};
const txHash = await keepkeyInstance.MAYA.walletMethods.transfer(sendPayload);const assetString = `MAYA.${asset}`;
await AssetValue.loadStaticAssets();The assetString is in THORChain asset notation. For more information, review THORChain Dev Docs.
Full guide: https://vercel.com/docs/getting-started-with-vercel
