Zebec Network
  • 💰Zebec Network
  • ➡️ZBC to ZBCN Migration Guide
  • 🗞️Zebec Network white Paper
  • 📈ZBCN Tokemonics
  • 🥳Getting Started
    • How to get started?
    • Benefits of Using Zebec Protocol
    • Deposit
    • Start Streaming
    • Withdraw Funds
  • 👾Safe
    • Create Safe
    • Deposit in Safe
    • Sending a Transaction
    • Zapps
    • Signing a Transaction
  • ZEBEC SOLANA
    • 🖥️Zebec Solana Sdk
      • 🖱️Streaming
        • Initialize Zebec Stream
        • Create Fee Vault
        • Update Fee Vault
        • Collect Fees
        • Deposit
        • Withdraw Deposited Token
        • Start Streaming
        • Pause Stream
        • Resume Stream
        • Cancel Stream
        • Withdraw Streamed Token
  • ZEBEC SILVER CARD
    • 💳Silver Card Sdk
      • 🔧Installation
      • 👨‍🚀Quick Start
      • ✉️Fetch Quote
      • ⚖️Configuration Parameters
      • 📦Recipient Fields
      • 🔁Responses
      • 🔢Environment Variables
      • 🌎Supported Countries
  • Zebec Bridge
    • Bridge Sdk
      • Creating clients
      • Initialize Proxy Account
      • Initialize Token Account
      • Deposit
        • Token Transfer
        • Deposit to Zebec
      • Withdraw Deposited
        • Withdraw From Zebec
        • Token Transfer
      • Init Stream
      • Pause/Resume Stream
      • Cancel Stream
      • Update Stream
  • Zebec Near
    • Zebec Near Sdk
      • Normal Stream
        • Initialize Near Stream
        • Initialize Token Stream
        • Pause/Resume Stream
        • Withdraw Stream
        • Update Stream
        • Cancel Stream
        • Claim Stream
        • View methods
      • Multisig Factory
        • Create Multisig Account
      • Multisig Stream
        • Initialize Near Stream
        • Initialize Token Stream
        • Pause/Resume Stream
        • Withdraw Stream
        • Update Stream
        • Cancel Stream
        • Claim Stream
        • View methods
  • ZEBEC EVM
    • Zebec Evm Sdk
      • Zebec Stream Client
        • Creating Clients
        • Whitelisting Tokens
        • Deposit into Zebec Wallet
        • Withdraw from Zebec Wallet
        • Initiating a Stream
        • Pause/Resume/Cancel Stream
        • Updating a Stream
        • Withdraw Streamed Tokens
        • Getting Stream Details
        • Whitelisted Tokens on BSC and Nautilus
      • Zebec Bulk Client
        • Bulk Instant Transfer
      • Zebec Multisig Stream
        • NFT
    • Zapps Compatible
Powered by GitBook
On this page
  1. Zebec Near
  2. Zebec Near Sdk
  3. Multisig Stream

Initialize Near Stream

Let's suppose this multisig requires two of its member to confirm a request and multisigservices1 is an instance created for member1 and multisigservices2 is an instance created for member2. A native stream can be done in the following way.

const params: InitStreamParams = {
    canCancel: true,
    canUpdate: true,
    startTime: (nowInSec() + 15).toString(),
    endTime: (nowInSec() + 20).toString(),
    receiver: member2,
    streamRate: NearAmount.parse("0.001").toString(),
};

const payload = await multisigservices1.initStream(params);

const result = await wallet.signAndTransactions(payload);

Then to confirm the request by another member you need to retrieve the requestId from the result which can be done in the following way.

const successValue = (result[result.length - 1].status as FinalExecutionStatus).SuccessValue;
if (!successValue) throw new Error("successValue is missing");
const requestId = Number(Buffer.from(successValue, "base64").toString());

Then request can be confirmed by another member in the following way.

const confirmPayload = await multiSigService2.confirm({ requestId: Number(requestId) });
const result = await wallet.signAndTransactions(payload);
PreviousMultisig StreamNextInitialize Token Stream

Last updated 2 years ago