@@ -212,6 +212,61 @@ private static Witness[] WitnessesFromJson(JArray _params)
212212 } ) . ToArray ( ) ;
213213 }
214214
215+ /// <summary>
216+ /// Invokes a function on a contract.
217+ /// <para>Request format:</para>
218+ /// <code>{
219+ /// "jsonrpc": "2.0",
220+ /// "id": 1,
221+ /// "method": "invokefunction",
222+ /// "params": [
223+ /// "An UInt160 ScriptHash", // the contract address
224+ /// "operation", // the operation to invoke
225+ /// [{"type": "ContractParameterType", "value": "The parameter value"}], // ContractParameter, the arguments
226+ /// [{
227+ /// "account": "An UInt160 or Base58Check address",
228+ /// "scopes": "WitnessScope", // WitnessScope
229+ /// "allowedcontracts": ["The contract hash(UInt160)"], // optional
230+ /// "allowedgroups": ["PublicKey"], // ECPoint, i.e. ECC PublicKey, optional
231+ /// "rules": [{"action": "WitnessRuleAction", "condition": {A json of WitnessCondition}}] // WitnessRule
232+ /// }], // A Signer array, optional
233+ /// [{"invocation": "A Base64-encoded string","verification": "A Base64-encoded string"}] // A Witness array, optional
234+ /// false // useDiagnostic, a bool value indicating whether to use diagnostic information, optional
235+ /// ]
236+ /// }</code>
237+ /// <para>Response format:</para>
238+ /// <code>{
239+ /// "jsonrpc": "2.0",
240+ /// "id": 1,
241+ /// "result": {
242+ /// "script": "A Base64-encoded string",
243+ /// "state": "A string of VMState",
244+ /// "gasconsumed": "An integer number in string",
245+ /// "exception": "The exception message",
246+ /// "stack": [{"type": "The stack item type", "value": "The stack item value"}],
247+ /// "notifications": [
248+ /// {"eventname": "The event name", "contract": "The contract hash", "state": {"interface": "A string", "id": "The GUID string"}}
249+ /// ], // The notifications, optional
250+ /// "diagnostics": {
251+ /// "invokedcontracts": {"hash": "The contract hash","call": [{"hash": "The contract hash"}]},
252+ /// "storagechanges": [{"state": "The state", "key": "The key", "value": "The value"}]
253+ /// }, // The diagnostics, optional, if useDiagnostic is true
254+ /// "session": "A GUID string" // The session id, optional
255+ /// }
256+ /// }</code>
257+ /// </summary>
258+ /// <param name="_params">An array containing the following elements:
259+ /// [0]: The script hash of the contract to invoke as a string.
260+ /// [1]: The operation to invoke as a string.
261+ /// [2]: The arguments to pass to the function as an array of ContractParameter. Optional.
262+ /// [3]: The signers as an array of Signer. Optional.
263+ /// [4]: The witnesses as an array of Witness. Optional.
264+ /// [5]: A boolean value indicating whether to use diagnostic information. Optional.
265+ /// </param>
266+ /// <returns>The result of the function invocation.</returns>
267+ /// <exception cref="RpcException">
268+ /// Thrown when the script hash is invalid, the contract is not found, or the verification fails.
269+ /// </exception>
215270 [ RpcMethod ]
216271 protected internal virtual JToken InvokeFunction ( JArray _params )
217272 {
@@ -230,6 +285,57 @@ protected internal virtual JToken InvokeFunction(JArray _params)
230285 return GetInvokeResult ( script , signers , witnesses , useDiagnostic ) ;
231286 }
232287
288+ /// <summary>
289+ /// Invokes a script.
290+ /// <para>Request format:</para>
291+ /// <code>{
292+ /// "jsonrpc": "2.0",
293+ /// "id": 1,
294+ /// "method": "invokescript",
295+ /// "params": [
296+ /// "A Base64-encoded string", // the script to invoke
297+ /// [{
298+ /// "account": "An UInt160 or Base58Check address",
299+ /// "scopes": "WitnessScope", // WitnessScope
300+ /// "allowedcontracts": ["The contract hash(UInt160)"], // optional
301+ /// "allowedgroups": ["PublicKey"], // ECPoint, i.e. ECC PublicKey, optional
302+ /// "rules": [{"action": "WitnessRuleAction", "condition": {A json of WitnessCondition}}] // WitnessRule
303+ /// }], // A Signer array, optional
304+ /// [{"invocation": "A Base64-encoded string","verification": "A Base64-encoded string"}] // A Witness array, optional
305+ /// false // useDiagnostic, a bool value indicating whether to use diagnostic information, optional
306+ /// ]
307+ /// }</code>
308+ /// <para>Response format:</para>
309+ /// <code>{
310+ /// "jsonrpc": "2.0",
311+ /// "id": 1,
312+ /// "result": {
313+ /// "script": "A Base64-encoded string",
314+ /// "state": "A string of VMState",
315+ /// "gasconsumed": "An integer number in string",
316+ /// "exception": "The exception message",
317+ /// "stack": [{"type": "The stack item type", "value": "The stack item value"}],
318+ /// "notifications": [
319+ /// {"eventname": "The event name", "contract": "The contract hash", "state": {"interface": "A string", "id": "The GUID string"}}
320+ /// ], // The notifications, optional
321+ /// "diagnostics": {
322+ /// "invokedcontracts": {"hash": "The contract hash","call": [{"hash": "The contract hash"}]},
323+ /// "storagechanges": [{"state": "The state", "key": "The key", "value": "The value"}]
324+ /// }, // The diagnostics, optional, if useDiagnostic is true
325+ /// "session": "A GUID string" // The session id, optional
326+ /// }
327+ /// }</code>
328+ /// </summary>
329+ /// <param name="_params">An array containing the following elements:
330+ /// [0]: The script as a Base64-encoded string.
331+ /// [1]: The signers as an array of Signer. Optional.
332+ /// [2]: The witnesses as an array of Witness. Optional.
333+ /// [3]: A boolean value indicating whether to use diagnostic information. Optional.
334+ /// </param>
335+ /// <returns>The result of the script invocation.</returns>
336+ /// <exception cref="RpcException">
337+ /// Thrown when the script is invalid, the verification fails, or the script hash is invalid.
338+ /// </exception>
233339 [ RpcMethod ]
234340 protected internal virtual JToken InvokeScript ( JArray _params )
235341 {
@@ -240,6 +346,27 @@ protected internal virtual JToken InvokeScript(JArray _params)
240346 return GetInvokeResult ( script , signers , witnesses , useDiagnostic ) ;
241347 }
242348
349+ /// <summary>
350+ /// <para>Request format:</para>
351+ /// <code>{
352+ /// "jsonrpc": "2.0",
353+ /// "id": 1,
354+ /// "method": "traverseiterator",
355+ /// "params": [
356+ /// "A GUID string(The session id)",
357+ /// "A GUID string(The iterator id)",
358+ /// "An integer number(The number of items to traverse)"
359+ /// ]
360+ /// }</code>
361+ /// <para>Response format:</para>
362+ /// <code>{
363+ /// "jsonrpc": "2.0",
364+ /// "id": 1,
365+ /// "result": [{"type": "The stack item type", "value": "The stack item value"}]
366+ /// }</code>
367+ /// </summary>
368+ /// <param name="_params"></param>
369+ /// <returns></returns>
243370 [ RpcMethod ]
244371 protected internal virtual JToken TraverseIterator ( JArray _params )
245372 {
@@ -261,6 +388,21 @@ protected internal virtual JToken TraverseIterator(JArray _params)
261388 return json ;
262389 }
263390
391+ /// <summary>
392+ /// Terminates a session.
393+ /// <para>Request format:</para>
394+ /// <code>{
395+ /// "jsonrpc": "2.0",
396+ /// "id": 1,
397+ /// "method": "terminatesession",
398+ /// "params": ["A GUID string(The session id)"]
399+ /// }</code>
400+ /// <para>Response format:</para>
401+ /// <code>{"jsonrpc": "2.0", "id": 1, "result": true}</code>
402+ /// </summary>
403+ /// <param name="_params">A 1-element array containing the session id as a GUID string.</param>
404+ /// <returns>True if the session is terminated successfully, otherwise false.</returns>
405+ /// <exception cref="RpcException">Thrown when the session id is invalid.</exception>
264406 [ RpcMethod ]
265407 protected internal virtual JToken TerminateSession ( JArray _params )
266408 {
@@ -277,6 +419,25 @@ protected internal virtual JToken TerminateSession(JArray _params)
277419 return result ;
278420 }
279421
422+ /// <summary>
423+ /// Gets the unclaimed gas of an address.
424+ /// <para>Request format:</para>
425+ /// <code>{
426+ /// "jsonrpc": "2.0",
427+ /// "id": 1,
428+ /// "method": "getunclaimedgas",
429+ /// "params": ["An UInt160 or Base58Check address"]
430+ /// }</code>
431+ /// <para>Response format:</para>
432+ /// <code>{"jsonrpc": "2.0", "id": 1, "result": {"unclaimed": "An integer in string", "address": "The address"}}</code>
433+ /// </summary>
434+ /// <param name="_params">An array containing the following elements:
435+ /// [0]: The address as a UInt160 or Base58Check address.
436+ /// </param>
437+ /// <returns>A JSON object containing the unclaimed gas and the address.</returns>
438+ /// <exception cref="RpcException">
439+ /// Thrown when the address is invalid.
440+ /// </exception>
280441 [ RpcMethod ]
281442 protected internal virtual JToken GetUnclaimedGas ( JArray _params )
282443 {
0 commit comments