From c3b26244bc949f8d01ec27fd9b68a86fa00f9d1b Mon Sep 17 00:00:00 2001 From: platfowner Date: Wed, 14 Feb 2024 14:12:18 +0900 Subject: [PATCH 1/2] Add descriptions about get and set operations to JSON_RPC_API.md --- JSON_RPC_API.md | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/JSON_RPC_API.md b/JSON_RPC_API.md index 1a5b61770..f4b3c8bca 100644 --- a/JSON_RPC_API.md +++ b/JSON_RPC_API.md @@ -65,7 +65,15 @@ Returns the value, write rule, owner rule, or function at the given path in the An array of objects with properties: - protoVer: `String` - protocol version -- ref: `String` - reference path +- type: `String` - "GET_VALUE" | "GET_RULE" | "GET_FUNCTION" | "GET_OWNER" | "GET" +- ref: `String` - reference path to get a value/rule/owner/function of. Only required if the type is not "GET". +- op_list: `Array` - array of get operations ({ type, ref, [is_shallow, is_global, is_final, include_tree_info, include_proof, include_version] }). Only required if the type is "GET". +- is_shallow: `Boolean` | `undefined` - an optional get request parameter. When specified as `true`, the shallow result (only the keys of the children) will be returned. +- is_global: `Boolean` | `undefined` - an optional get request parameter. When specified as `true`, the given ref will be interpreted as a global path. +- is_final: `Boolean` | `undefined` - an optional get request parameter. When specified as `true`, the finalization result will be returned. +- include_tree_info: `Boolean` | `undefined` - an optional get request parameter. When specified as `true`, the result will include additional state tree information. +- include_proof: `Boolean` | `undefined` - an optional get request parameter. When specified as `true`, the result will include state proof hashes. +- include_version: `Boolean` | `undefined` - an optional get request parameter. When specified as `true`, the result will include state versions. **Returns** @@ -1698,7 +1706,7 @@ Sends a transaction body and its signature to the blockchain node as a dryrun. An object with properties: - protoVer: `String` - protocol version -- tx_body: `Object` - transaction body object +- tx_body: `Object` - transaction body object (see [ain_sendSignedTransaction](#ain_sendsignedtransaction) for the details) - signature: `String` - signature of the transaction **Returns** @@ -1790,7 +1798,15 @@ Sends a transaction body and its signature to the blockchain node. An object with properties: - protoVer: `String` - protocol version -- tx_body: `Object` - transaction body object +- tx_body: `Object` - transaction body object with properties: + - operation: `Object` - transaction operation with properties: + - type: `String` - "SET_VALUE" | "SET_RULE" | "SET_FUNCTION" | "SET_OWNER" | "SET". When type = "SET", op_list is used instead of ref and value. + - ref: `String` - reference path to get a value/rule/owner/function of. Only required if the type is not "SET". + - value: `Any` - value/rule/function/owner to set + - op_list: `Array` - array of set operations ({ type, ref, value }). Only required if the type is "SET". + - timestamp: `Number()` - timestamp when the transaction was created + - nonce: `-2|-1|Number()` - nonce value where `-2` means _unordered_ transaction, `-1` means _ordered_ transaction (using timestamp), and `Number` means _numbered (or indexed)_ transaction (like the Ethereum Network). + - gas_price: `Number()` - gas price value in micro unit (10-6) to apply to compute the gas cost of the transaction. The gas cost computation rule is _gas_cost_ = _gas_amount_ x _gas_price_ x _106_ where the gas amount is the basically the number of DB write operations of the transaction and gas cost is charged in AIN unit. - signature: `String` - signature of the transaction **Returns** @@ -1881,11 +1897,11 @@ Sends multiple transactions at once to the blockchain node. An object with properties: - protoVer: `String` - protocol version -- `Array` - an array of transaction objects (with signature and transaction body) +- tx_list: `Array` - an array of objects with signature and transaction body (see [ain_sendSignedTransaction](#ain_sendsignedtransaction) for the details) **Returns** -`Array` - an array of transaction hashes. +`Array` - an array of the transaction hashes and the execution results. **Example** From 46e15a918b68982fd0bf4ed8a65b09dc16136082 Mon Sep 17 00:00:00 2001 From: platfowner Date: Wed, 14 Feb 2024 14:19:51 +0900 Subject: [PATCH 2/2] Fix descriptions about unordered nonce and ordered nonce --- JSON_RPC_API.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/JSON_RPC_API.md b/JSON_RPC_API.md index f4b3c8bca..9ec76df8b 100644 --- a/JSON_RPC_API.md +++ b/JSON_RPC_API.md @@ -1805,7 +1805,7 @@ An object with properties: - value: `Any` - value/rule/function/owner to set - op_list: `Array` - array of set operations ({ type, ref, value }). Only required if the type is "SET". - timestamp: `Number()` - timestamp when the transaction was created - - nonce: `-2|-1|Number()` - nonce value where `-2` means _unordered_ transaction, `-1` means _ordered_ transaction (using timestamp), and `Number` means _numbered (or indexed)_ transaction (like the Ethereum Network). + - nonce: `-2|-1|Number()` - nonce value where `-2` means _ordered_ transaction, `-1` means _unordered_ transaction (using timestamp), and `Number` means _numbered (or indexed)_ transaction (like the Ethereum Network). - gas_price: `Number()` - gas price value in micro unit (10-6) to apply to compute the gas cost of the transaction. The gas cost computation rule is _gas_cost_ = _gas_amount_ x _gas_price_ x _106_ where the gas amount is the basically the number of DB write operations of the transaction and gas cost is charged in AIN unit. - signature: `String` - signature of the transaction