Gno Wallet
The Gno Wallet is an extension on the tm2-js-client Wallet, outlined here.
Account Methods
transferFunds
Initiates a native currency transfer transaction between accounts
Parameters
tostring the bech32 address of the receiverfundsMap<string, number> the denomination -> value map for fundsfeeTxFee the custom transaction fee, if any
Returns Promise<string>
Usage
let fundsMap = new Map<string, number>([
["ugnot", 10],
]);
await wallet.transferFunds('g1flk9z2qmkgqeyrl654r3639rzgz7xczdfwwqw7', fundsMap);
// returns the transaction hash
callMethod
Invokes the specified method on a GNO contract
Parameters
pathstring the gno package / realm pathmethodstring the method nameargsstring[] the method arguments, if anyfundsMap<string, number> the denomination -> value map for fundsfeeTxFee the custom transaction fee, if any
Returns Promise<string>
Usage
let fundsMap = new Map<string, number>([
["ugnot", 10],
]);
await wallet.callMethod('gno.land/r/demo/foo20', 'TotalBalance', []);
// returns the transaction hash
deployPackage
Deploys the specified package / realm
Parameters
gnoPackageMemPackage the package / realm to be deployedfundsMap<string, number> the denomination -> value map for fundsfeeTxFee the custom transaction fee, if any
Returns Promise<string>
Usage
const memPackage: MemPackage = // ...
await wallet.deployPackage(memPackage);
// returns the transaction hash