@multi-transaction/account
v1.3.2
Published
Multi Transaction Account implementation.
Downloads
28
Readme
Multi Transaction Account
Multi Transaction Account implementation
Install
pnpm add @multi-transaction/core @multi-transaction/account
Examples
import { MultiTransaction, Amount, Gas } from '@multi-transaction/core';
import { MultiSendAccount } from '@multi-transaction/account';
const account = MultiSendAccount.new(connection, 'alice.near');
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 account.send(mTransaction);
Call Contract Method
await account.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 account.view({
contractId: 'wrap.near',
methodName: 'ft_balance_of',
args: {
account_id: 'alice.near',
},
});