diff --git a/ecosystem/sep-0006.md b/ecosystem/sep-0006.md index 9c309982e..f0fe74181 100644 --- a/ecosystem/sep-0006.md +++ b/ecosystem/sep-0006.md @@ -378,6 +378,22 @@ If the wallet wants to be notified that the user has completed the anchor's inte In either case, the JSON message should be identical to the response format for the [/transaction](#single-historical-transaction) endpoint. +```javascript +// Example postMessage callback at the end of an interactive withdraw, indicating that the anchor is waiting for the wallet to send a payment in the amount of 80 of the asset in question. +const target = window.opener || window.parent; +target.postMessage({ + transaction: { + id: "anchors_identifier_for_this_transaction", + status: "pending_user_transfer_start", + withdraw_anchor_account: "ANCHORS_STELLAR_ACCOUNT_ID", + withdraw_memo: "MEMO_ANCHOR_EXPECTS_TO_SEE", + withdraw_memo_type: "text|hash|id", + amount_in: "80" + // ... Any other values from the /transaction endpoint may be passed as well + } +}, "*"); +``` + As an alternative to using the `callback` parameter, the wallet can poll the transaction endpoint [`/transaction`](#single-historical-transaction) with the request `id` to check the status of the request. **`jwt` details**