Skip to content
This repository has been archived by the owner on Jul 1, 2024. It is now read-only.

Utilities for anchors and wallets implementing SEP6 transfer protocol

Notifications You must be signed in to change notification settings

stellar-deprecated/anchor-transfer-utils

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

anchor-transfer-utils

Utility functions for implementing the interactive SEP6 flow. This helps implement the postMessage message handling involved in showing the interactive webapp.

Installation

Using NPM

npm install --save @stellar/anchor-transfer-utils

Standalone

<script src="https://unpkg.com/@stellar/[email protected]/lib/index.js" />

Usage for Anchors

Withdrawal

For anchors using the interactive web flow, use the finalizeTransaction helper to communicate back to the wallet when a withdraw is ready for payment.

const AnchorTransferUtils = require("@stellar/anchor-transfer-utils")
AnchorTransferUtils.finalizeWithdrawal({
  id: "id_representing_anchor_transaction",
  amount_in: "80.12",
  withdraw_anchour_account: "<Stellar public account id>",
  withdraw_memo: "<Some unique identifier>",
  withdraw_memo_type: "text" | "hash" | "id"
})

About

Utilities for anchors and wallets implementing SEP6 transfer protocol

Resources

Stars

Watchers

Forks

Packages

No packages published