Transfer

Rules

  • Sender has to be the asset owner

  • Asset has to be in the status available for transfer

  • JSON format

    key
    required
    description

    op

    yes

    operation. "transfer"

    p

    no

    protocol. "domain". Skip for asset transfer

    id

    yes

    the asset's inscription id

    to

    yes

    the recipient's address

Typescript example

const data = JSON.stringify(
  {
    op: "transfer",
    p: "domain",
    id: "787...i0",
    to: "kaspa:qyp4nvaq3pdq7609z09fvdgwtc9c7rg07fuw5zgeee7xpr085de59eseqfcmynn",
  },
  null,
  0
);
const buf = Buffer.from(data);
const script = new ScriptBuilder()
  .addData(XOnlyPublicKey.fromAddress(account).toString())
  .addOp(Opcodes.OpCheckSig)
  .addOp(Opcodes.OpFalse)
  .addOp(Opcodes.OpIf)
  .addData(Buffer.from("kns"))
  .addI64(0n)
  .addData(buf)
  .addOp(Opcodes.OpEndIf);

Last updated