@multi-transaction/wallet-selector
TypeScript icon, indicating that this package has built-in type declarations

1.3.2 • Public • Published

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',
  },
});

Readme

Keywords

none

Package Sidebar

Install

npm i @multi-transaction/wallet-selector

Weekly Downloads

8

Version

1.3.2

License

MIT

Unpacked Size

31.1 kB

Total Files

19

Last publish

Collaborators

  • hanakannzashi