src
https://raw.githubusercontent.com/CatMask-Wallet/near-wallet/main/public/web.js
npm
TODO
catMask.getAccoutId(e => {
console.log(e) // accoundID
})
catMask.signMessage('you messageText..', (e)=>{
console.log(e) // {publicKey: '', signature: 'base64'}
})
catMask.signTransaction(new Uint8Array([2, 88]).toString() /*transaction hash*/, (e)=>{
console.log(e) // {publicKey: '', signature: Uint8Array.toString()}
})
- transaction and send
catMask.signTransactionAndSendRaw({
contractId: 'wrap.testnet',
actions: [
// FunctionCall
{
methodName: 'near_deposit2',
args: {},
gas: '10000000000000',
deposit: '1000000000000000000000000',
},
// transfer
{
deposit: '1000000000000000000000000'
},
// stake
{
stake: '1000000000000000000000000',
publicKey: ''
}
],
}, (e) => {
// {hash: '', res: {}}
console.log(e)
})