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

2.0.0-beta.1 • 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',
  },
});

/@multi-transaction/wallet-selector/

    Package Sidebar

    Install

    npm i @multi-transaction/wallet-selector

    Weekly Downloads

    0

    Version

    2.0.0-beta.1

    License

    MIT

    Unpacked Size

    21.4 kB

    Total Files

    15

    Last publish

    Collaborators

    • hanakannzashi