🌊
MoveFlow
  • 🌊MoveFlow
  • Protocol Overview
    • ☄️What is MoveFlow?
    • 💡Use Cases
    • 🏷️Glossary of Terms
      • 🪙CPT: Continuous Payment Technology
      • 💎RPT: Recurring Payment Technology
      • 🍊EPT: Event-based Payment Technology
      • 🤖DPPS: Decentralized Programmable Payment System
  • PRODUCT
    • 🫐Beginner Guide
      • Connect to Your Wallet
      • Dashboard
      • Create a New Stream
      • Managing Incoming and Outgoing Streams
      • Edit Your Address Book
    • 👥Integration with MSafe
  • DEVELOPER
    • ☄️Streaming Payment SDK
    • 🍊Subscription Checkout SDK
    • ☘️BatchCall SDK
  • RESOURCES
    • ❓FAQ
      • 🫂Meet the Team
      • 🔥Ecosystem Partners
    • 🤓Learn about Move
    • 🗝️Code of Conduct
Powered by GitBook
On this page
  • Github Link:
  • Getting Started
  • Use SDK
  1. DEVELOPER

BatchCall SDK

PreviousSubscription Checkout SDKNextFAQ

Last updated 1 year ago

Github Link:

Getting Started

Create a project using this example:

yarn add @moveflow/sdk.js

Use SDK

const { batchcall } = new SDK(Network.TESTNET)

SDK Method

  1. batchTransfer: batchTransfer(input: batchTransferPayload)

Because tokens of type CoinType may be transferred to non-existing accounts, users need to first create a recipient account and register to be able to receive CoinType before transferring tokens

The parameters that need to be:

  • recipientAddrs: Receiver address for transferring tokens

  • depositAmounts: Amount of transferred tokens

  • coinType: The currency of the transfer token, the default is APT

  • isIngoreUnregisterRecipient: Whether to ignore unregistered receiver addresses, the default is true

export type batchTransferPayload = {
  recipientAddrs: string[],
  depositAmounts: number[],
  coinType?: string
}
  1. For example, airdrop Aptos tokens into two accounts:

    
    const list = [
      { recipient: "0x20f0cbe21cb340fe56500e0889cad03f8a9e54a33e3c4acfc24ce2bdfabc4180", amount: "0.5" },
      { recipient: "0x20f0cbe21cb340fe56500e0889cad03f8a9e54a33e3c4acfc24ce2bdfabc4180", amount: "0.5" },
    ]

    const payload = sdk.batchcall.batchTransfer({
      recipientAddrs: list.map(item => item.recipient),
      depositAmounts: list.map(item => item.amount),
    });

const txid = await SignAndSubmitTransaction(payload);
☘️
https://github.com/Move-Flow/sdk.js/blob/main/BatchCall.md