@multi-transaction/wallet-selector
v1.3.2
Published
Multi Transaction Wallet Selector implementation.
Downloads
24
Readme
Multi Transaction Wallet Selector
Multi Transaction Wallet Selector implementation
Install
pnpm add @multi-transaction/core @multi-transaction/wallet-selector
Examples
import { MultiTransaction, Amount, Gas } from '@multi-transaction/core';
import { setupMultiSendWalletSelector } from '@multi-transaction/wallet-selector';
const selector = await setupMultiSendWalletSelector({
network: 'mainnet',
modules: [
/* wallet modules */
],
});
Send Transaction(s)
const mTransaction = MultiTransaction
.batch('wrap.near')
.functionCall({
methodName: 'ft_transfer',
args: {
receiver_id: 'bob.near',
amount: Amount.parse('8.88', 'NEAR'),
},
attachedDeposit: Amount.ONE_YOCTO,
gas: Gas.parse('10', 'T'),
});
await selector.send(mTransaction);
Call Contract Method
await selector.call({
contractId: 'wrap.near',
methodName: 'ft_transfer',
args: {
receiver_id: 'bob.near',
amount: Amount.parse('8.88', 'NEAR'),
},
attachedDeposit: Amount.ONE_YOCTO,
gas: Gas.parse('10', 'T'),
});
View Contract Method
const amount: string = await selector.view({
contractId: 'wrap.near',
methodName: 'ft_balance_of',
args: {
account_id: 'alice.near',
},
});