Docs/Protocol reference/Issue action
Issue action
A developer-focused reference for constructing and signing a tokenization issuance.
When to use#
Issue when a customer converts eligible points into wallet tokens.
The first successful issuance creates the program contract if needed. Later issuances add wallet balances for the same program. expiresAt controls the reward bucket; deadline controls how long the signed action can be submitted. The brand backend should reserve or deduct the points in the brand account before publishing the signed issuance.
Fields#
| Field | Type | Required | Meaning |
|---|---|---|---|
issuer | address | external signing | Brand wallet that signs the action. Omit together with the issuer signature for enabled API signing. |
loyaltyId | bytes32 | yes | Brand-scoped program ID. |
amount | uint256 string | yes | Number of eligible points to convert into wallet tokens. Must be greater than zero. |
expiresAt | uint256 string | yes | Use 0 for no expiry, or a Unix timestamp for an expiring bucket. |
deadline | uint256 string | yes | Last Unix timestamp when the issuance can be submitted. Use 0 for no execution deadline. |
nonce | bytes32 | yes | Unique per issuer. Replays are rejected. |
chainId | uint256 string | yes | Expected chain ID. Loyfin uses Base 8453. |
verifyingContract | address | yes | The Loyfin factory that will execute the action. |
operationHash | bytes32 | optional | Brand reference hash for correlating this action with an internal database row. Defaults to zero bytes when omitted. |
metadata | Metadata | yes | Program metadata. Required for issuance because the first issuance can create the program. |
data | hex bytes | optional | Brand-defined data. Defaults to 0x. Max 2048 bytes. |
Example#
{
"issuance": {
"issuer": "0x1111111111111111111111111111111111111111",
"loyaltyId": "0x4242424242424242424242424242424242424242424242424242424242424242",
"amount": "1000",
"expiresAt": "0",
"deadline": "1790965800",
"nonce": "0x7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a",
"chainId": "8453",
"verifyingContract": "0x3333333333333333333333333333333333333333",
"operationHash": "0x9999999999999999999999999999999999999999999999999999999999999999",
"metadata": {
"loyaltyId": "0x4242424242424242424242424242424242424242424242424242424242424242",
"name": "Bloom Coffee Rewards",
"symbol": "BLOOM",
"media": "ipfs://bafy.../bloom.png",
"description": "Rewards for Bloom Coffee customers."
},
"data": "0x"
},
"signature": "0xababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababab",
"to": "0x2222222222222222222222222222222222222222"
}