Skip to content

Instantly share code, notes, and snippets.

@janniks
Created April 12, 2022 16:22
Show Gist options
  • Save janniks/a427207480695a4f8c69ca526d09757a to your computer and use it in GitHub Desktop.
Save janniks/a427207480695a4f8c69ca526d09757a to your computer and use it in GitHub Desktop.
transfer — Stacks Signing
import { openSTXTransfer } from "@stacks/connect";
import { StacksTestnet } from "@stacks/network";
openSTXTransfer({
recipient: "ST2EB9WEQNR9P0K28D2DC352TM75YG3K0GT7V13CV",
amount: "100",
memo: "Reimbursement",
network: new StacksTestnet(), // for mainnet, `new StacksMainnet()`
appDetails: {
name: "My App",
icon: window.location.origin + "/my-app-logo.svg",
},
onFinish: (data) => {
console.log("Stacks Transaction:", data.stacksTransaction);
console.log("Transaction ID:", data.txId);
console.log("Raw transaction:", data.txRaw);
},
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment