Docs Técnicas
Transaction Payload Reference
``json { "kind": "Bool", "value": true } { "kind": "Integer", "value": "123" } { "kind": "Address", "value": "nbex..." } { "kind": "Text", "value": "hello" } ``
ContractArg
{ "kind": "Bool", "value": true }
{ "kind": "Integer", "value": "123" }
{ "kind": "Address", "value": "nbex..." }
{ "kind": "Text", "value": "hello" }PublishContractArtifact
{
"artifact_id": "family:v1",
"family_id": "family",
"version_id": "v1",
"source": "contract Source: ...",
"memo": "optional"
}InstantiateContract
{
"contract_id": "instance-id",
"artifact_id": "family:v1",
"admin": "nbex_admin",
"memo": "optional"
}AcceptContractVersion
{
"contract_id": "instance-id",
"artifact_id": "family:v2",
"role": "borrower",
"memo": "optional"
}UpdateContractLifecycle
{
"contract_id": "instance-id",
"lifecycle_state": "active",
"reason": "approved",
"memo": "optional"
}ContractCall
{
"contract_id": "instance-id",
"entrypoint": "repay",
"entrypoint_selector": 123456789,
"asset": "BRL",
"args": [],
"memo": "optional"
}Use entrypoint or entrypoint_selector. You do not need both.
ImportContractState
Imports an ERC-20 token state (balances, allowances) into a deployed TREA contract. The submitter must be the contract admin. The contract must be in pending lifecycle state and not yet have a migration receipt.
{
"contract_id": "my-token-001",
"manifest": {
"origin": "ethereum:0xAbCd...1234",
"metadata": {
"total_supply": "1000000000000000000",
"name": "MyToken",
"symbol": "MTK",
"decimals": 18
},
"field_map": {
"balances": "balances",
"total_supply": "totalSupply",
"name": "name",
"symbol": "symbol",
"decimals": "decimals",
"allowances": "allowances"
},
"balances": [
{ "address": "wallet:alice", "amount": "500000000000000000" },
{ "address": "wallet:bob", "amount": "500000000000000000" }
],
"allowances": [
{ "owner": "wallet:alice", "spender": "wallet:bob", "amount": "100000000000000000" }
],
"memo": "genesis import from Ethereum mainnet"
}
}| Field | Required | Description | | ----- | -------- | ----------- | | contract_id | yes | Target deployed contract instance | | manifest.origin | yes | Human-readable source identifier | | manifest.metadata.total_supply | yes | Expected total supply (decimal string) | | manifest.field_map.balances | yes | Name of the Map[Address, u128] storage field | | manifest.field_map.total_supply | yes | Name of the u128 storage field for total supply | | manifest.balances | yes | At least one entry; max 5 000 entries | | manifest.allowances | no | Optional; entries must reference owners present in balances |
All amounts are decimal strings (u128 range). The ledger validates sum(balances) == metadata.total_supply and rejects duplicate addresses, unknown field names, and values outside the native accounting range.
On success, a MigrationReceipt is persisted alongside the contract state (block height, authority, manifest hash, entry counts) for audit replay.