prepare_transfer · Prepare a transfer
may change things: you confirm before it runsPrepare sending ETH, an ERC-20, an ERC-721 or an ERC-1155 to an address. From Chain Society #1's own wallet (0x53c00a823a735f9727a7d9ff19210c1e7dab6b9b) by default, the holder signing; from the signing wallet with from: 'wallet'. Returns the unsigned transaction(s) to sign and send in order, a simulation of the first as the signer (whether it lands, the gas), and whether the account can pay. Nothing is signed or sent here.
Input schema
{
"type": "object",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"properties": {
"wallet": {
"description": "The wallet that signs and sends: a 0x address. Required on the site-wide server; on a piece's server, its holder when omitted",
"type": "string",
"pattern": "^0x[0-9a-fA-F]{40}$"
},
"piece": {
"description": "Site-wide server: act from this piece's own wallet (its ERC-6551 account) instead; the wallet must hold the piece",
"type": "object",
"properties": {
"collection": {
"type": "string",
"pattern": "^0x[0-9a-fA-F]{40}$"
},
"tokenId": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
}
},
"required": [
"collection",
"tokenId"
]
},
"from": {
"description": "A piece's server: 'piece' (the default) acts from the piece's own wallet, the holder signing; 'wallet' acts from the signing wallet itself",
"type": "string",
"enum": [
"piece",
"wallet"
]
},
"asset": {
"type": "string",
"enum": [
"eth",
"erc20",
"erc721",
"erc1155"
]
},
"to": {
"type": "string",
"pattern": "^0x[0-9a-fA-F]{40}$"
},
"contract": {
"description": "The token contract (not for eth)",
"type": "string",
"pattern": "^0x[0-9a-fA-F]{40}$"
},
"tokenId": {
"description": "erc721 and erc1155",
"type": "string",
"pattern": "^\\d+$"
},
"amount": {
"description": "eth: in ETH (\"0.01\"); erc20: in whole tokens (\"12.5\"); erc1155: how many (whole units); not for erc721",
"type": "string"
}
},
"required": [
"asset",
"to"
]
}