当您看到 MultiversX 区块链中交易中使用的字段时,有一个称为“版本”的字段,通常设置为“1”:
POST https://gateway.multiversx.com/transaction/send HTTP/1.1
Content-Type: application/json
{
"version": 1,
"chainId": "v1.0.141",
"nonce": 42,
"value": "100000000000000000",
"receiver": "erd1...",
"sender": "erd1...",
"gasPrice": 1000000000,
"gasLimit": 70000,
"data": "food for cats",
"signature": "..."
}
它的含义是什么?
在撰写本文时,有 2 个版本可以处理交易,它们之间的差异会影响派生和检查交易签名的机制。
基本上,如果未来需要不同的东西并且您仍然希望保持向后兼容性,这是一种轻松添加新机制的方法。