hirosystems / connect

A library for building excellent user experiences with Stacks.
https://connect.stacks.js.org
MIT License
77 stars 40 forks source link

feat: multiple btc recipients support #307

Closed abdulhaseeb4239 closed 1 year ago

abdulhaseeb4239 commented 1 year ago

Description

Modified the interface to accept an array of recipient addresses and amounts in order to support multiple recipients. Updated BTCTransferOptions and BTCTransferPayload interfaces.

Link to relevant issues and documentation: #283 https://github.com/hirosystems/connect/issues/283#issuecomment-1397938096

Example: Added ability to add multiple recipients when sending a BTC transfer request

const recipients = [
      {
        recipient: '2NAm1LPPHQQ8AaLhXSYWrpApoCKcyjNJsjf',
        amount: '20000'
      }
    ];
    await openBTCTransfer(
      {
        recipients: recipients,
        appDetails: {
          name: "My App",
          icon: window.location.origin + "/my-app-logo.svg",
        },
        onCancel: () => {
          alert("Cancelled");
        },
        onFinish: (data) => {
          alert(`Transaction ID: ${data.txId}`);
          alert(`Raw transaction: ${data.txRaw}`);
        }, 
      });

For details refer to issue #283

Type of Change

changeset-bot[bot] commented 1 year ago

⚠️ No Changeset found

Latest commit: e892084e4aa1b080fb75c1f0ddb44f99f435d9d3

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

vercel[bot] commented 1 year ago

@abdulhaseeb4239 is attempting to deploy a commit to the Blockstack Team on Vercel.

A member of the Team first needs to authorize it.

CLAassistant commented 1 year ago

CLA assistant check
All committers have signed the CLA.

janniks commented 1 year ago

Merging to the existing wip branch