configure-postparams

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Configuring PostParams on Art Blocks Tokens

配置Art Blocks代币的PostParam参数

What Are PostParams?

什么是PostParam?

PostParams (Post-Mint Parameters / PMP) are on-chain configurable parameters embedded in certain Art Blocks art scripts. After minting, authorized wallets can set values that directly affect the token's on-chain visual output — no re-mint required.
Each parameter has an
authOption
controlling who can configure it:
authOption
Who can configure
Artist
Project artist only
TokenOwner
Current token owner only
Address
A specific configured contract address only
ArtistAndTokenOwner
Artist or token owner
ArtistAndAddress
Artist or specific contract address
TokenOwnerAndAddress
Token owner or specific contract address
ArtistAndTokenOwnerAndAddress
Artist, token owner, or specific contract address
PostParam(铸币后参数/PMP)是嵌入在部分Art Blocks艺术脚本中的链上可配置参数。铸币完成后,授权钱包可以设置参数值,直接影响代币的链上视觉输出——无需重新铸币。
每个参数都有一个
authOption
字段,用于控制谁可以对其进行配置:
authOption
可配置主体
Artist
仅项目创作者
TokenOwner
仅当前代币持有者
Address
仅指定的合约地址
ArtistAndTokenOwner
创作者或代币持有者
ArtistAndAddress
创作者或指定合约地址
TokenOwnerAndAddress
代币持有者或指定合约地址
ArtistAndTokenOwnerAndAddress
创作者、代币持有者或指定合约地址

Token ID Format

代币ID格式

<contract_address>-<token_number>
Example:
0xa7d8d9ef8d8ce8992df33d8b8cf4aebabd5bd270-78000000
<合约地址>-<代币编号>
示例:
0xa7d8d9ef8d8ce8992df33d8b8cf4aebabd5bd270-78000000

Workflow

操作流程

Step 1 — Discover available params

步骤1 — 发现可用参数

discover_postparams(tokenId, chainId?)
Returns: param keys, types, value constraints, current values, and
authOption
for each param. Always show this to the user before asking for values — they need to know what's configurable and within what constraints.
discover_postparams(tokenId, chainId?)
返回结果:每个参数的键、类型、值约束、当前值及
authOption
。在请求用户输入参数值前,务必先展示这些信息——用户需要了解可配置项及其约束条件。

Step 2 — Build the configuration transaction

步骤2 — 构建配置交易

build_configure_postparams_transaction(tokenId, values, chainId?, signerAddress?)
  • values
    is a key-value object — keys must match param keys from
    discover_postparams
  • Always pass
    signerAddress
    when known — needed to determine artist status and validate authorization
  • One transaction configures all passed params at once
Returns an unsigned transaction object ready to sign and submit.
build_configure_postparams_transaction(tokenId, values, chainId?, signerAddress?)
  • values
    是键值对对象——键必须与
    discover_postparams
    返回的参数键匹配
  • 已知签名者地址时务必传入
    signerAddress
    ——这用于判断创作者身份并验证授权
  • 单次交易可同时配置所有传入的参数
返回一个待签名和提交的未签名交易对象。

Value Formats by Type

按类型划分的值格式

TypeFormatExample
Bool
"true"
or
"false"
"true"
Select
One of the allowed option strings
"red"
Uint256Range
Non-negative integer string
"42"
Int256Range
Integer string (can be negative)
"-5"
DecimalRange
Decimal string
"3.14"
HexColor
Hex color with
#
"#FF0000"
Timestamp
Unix timestamp in seconds
"1700000000"
String
Any text string
"hello world"
类型格式要求示例
Bool
"true"
"false"
"true"
Select
允许的选项字符串之一
"red"
Uint256Range
非负整数字符串
"42"
Int256Range
整数字符串(可负数)
"-5"
DecimalRange
十进制数字字符串
"3.14"
HexColor
#
的十六进制颜色值
"#FF0000"
Timestamp
以秒为单位的Unix时间戳
"1700000000"
String
任意文本字符串
"hello world"

Notes

注意事项

  • Always call
    discover_postparams
    first
    — param keys and types are project-specific and not guessable
  • String
    params
    : the
    configuringArtistString
    flag on the built transaction depends on whether
    signerAddress
    matches the project artist — always pass
    signerAddress
    for
    String
    type params
  • Authorization: if the user's address doesn't match the
    authOption
    for a param, the transaction will revert on-chain. Check
    authOption
    against the user's role before proceeding
  • One transaction per call, but you can configure multiple params in a single call by passing multiple keys in
    values
  • 务必先调用
    discover_postparams
    ——参数的键和类型是项目专属的,无法猜测
  • String
    类型参数
    :构建交易时的
    configuringArtistString
    标志取决于
    signerAddress
    是否与项目创作者匹配——对于
    String
    类型参数,务必传入
    signerAddress
  • 授权验证:如果用户地址不符合参数的
    authOption
    要求,交易将在链上回滚。在操作前请检查用户角色是否符合
    authOption
    的要求
  • 单次调用对应一笔交易,但你可以通过在
    values
    中传入多个键,在单次调用中配置多个参数",