Examples
No transfers
(define-public (no-transfers)
(ok "no transfer events executed.")
)import { request } from "@stacks/connect";
const response = await request("stx_callContract", {
contract: "ST1PQHQKV0RJXZFY1DGX8MNSNYVE3VGZJSRTPGZGM.post-conditions",
functionName: "no-transfers",
network: "devnet",
postConditions: [],
postConditionMode: "deny"
})Single STX transfer
(define-public (single-stx-transfer)
(stx-transfer? u10000000 tx-sender (as-contract tx-sender))
)import { request } from "@stacks/connect";
import type { StxPostCondition } from "@stacks/transactions";
const stxPostCondition: StxPostCondition = {
type: 'stx-postcondition',
address: 'ST1PQHQKV0RJXZFY1DGX8MNSNYVE3VGZJSRTPGZGM',
condition: 'eq',
amount: '10000000',
};
const response = await request("stx_callContract", {
contract: "ST1PQHQKV0RJXZFY1DGX8MNSNYVE3VGZJSRTPGZGM.post-conditions",
functionName: "single-stx-transfer",
functionArgs: [],
postConditionMode: "deny",
postConditions: [stxPostCondition],
network: "devnet"
})Multiple STX transfers
Mint and Burn Events
Uncertain asset transfer amount
Hidden asset transfers
Staking STX (SIP-045)
Guarding PoX actions (SIP-045)
Last updated
Was this helpful?