github.com/nspcc-dev/neo-go@v0.105.2-0.20240517133400-6be757af3eba/pkg/rpcclient/doc.go (about) 1 /* 2 Package rpcclient implements NEO-specific JSON-RPC 2.0 client. 3 4 This package itself is designed to be a thin layer on top of the regular JSON-RPC 5 interface provided by Neo implementations. Therefore the set of methods provided 6 by clients is exactly the same as available from servers and they use data types 7 that directly correspond to JSON data exchanged. While this is the most powerful 8 and direct interface, it at the same time is not very convenient for many 9 purposes, like the most popular one --- performing test invocations and 10 creating/sending transactions that will do something to the chain. Please check 11 subpackages for more convenient APIs. 12 13 # Subpackages 14 15 The overall structure can be seen as a number of layers built on top of rpcclient 16 and on top of each other with each package and each layer solving different 17 problems. 18 19 These layers are: 20 21 - Basic RPC API, rpcclient package itself. 22 23 - Generic invocation/transaction API represented by invoker, unwrap (auxiliary, 24 but very convenient) and actor packages. These allow to perform test 25 invocations with plain Go types, use historic states for these invocations, 26 get the execution results from reader functions and create/send transactions 27 that change something on-chain. 28 29 - Standard-specific wrappers that are implemented in nep11 and nep17 packages 30 (with common methods in neptoken). They implement the respective NEP-11 and 31 NEP-17 APIs both for safe (read-only) and state-changing methods. Safe methods 32 require an Invoker to be called, while Actor is used to create/send 33 transactions. 34 35 - Contract-specific wrappers for native contracts that include management, gas, 36 neo, oracle, policy and rolemgmt packages for the respective native contracts. 37 Complete contract functionality is exposed (reusing nep17 package for gas and 38 neo). 39 40 - Notary actor and contract, a bit special since it's a NeoGo protocol 41 extension, but notary package provides both the notary native contract wrapper 42 and a notary-specific actor implementation that allows to easily wrap any 43 transaction into a notary request. 44 45 - Non-native contract-specific wrappers, currently partially provided only for 46 NNS contract (it's still in development), at the moment that's mostly an 47 example of how contract-specific wrappers can be built for other dApps 48 (reusing invoker/actor layers it's pretty easy). 49 50 # Client 51 52 After creating a client instance with or without a ClientConfig 53 you can interact with the NEO blockchain by its exposed methods. 54 55 Supported methods 56 57 calculatenetworkfee 58 findstates 59 getapplicationlog 60 getbestblockhash 61 getblock 62 getblockcount 63 getblockhash 64 getblockheader 65 getblockheadercount 66 getcommittee 67 getconnectioncount 68 getcontractstate 69 getnativecontracts 70 getnep11balances 71 getnep11properties 72 getnep11transfers 73 getnep17balances 74 getnep17transfers 75 getpeers 76 getrawmempool 77 getrawtransaction 78 getstate 79 getstateheight 80 getstateroot 81 getstorage 82 gettransactionheight 83 getunclaimedgas 84 getnextblockvalidators 85 getversion 86 invokefunction 87 invokescript 88 invokecontractverify 89 sendrawtransaction 90 submitblock 91 submitoracleresponse 92 terminatesession 93 traverseiterator 94 validateaddress 95 96 Extensions: 97 98 getblocksysfee 99 getrawnotarypool 100 getrawnotarytransaction 101 submitnotaryrequest 102 103 Unsupported methods 104 105 canceltransaction 106 claimgas 107 dumpprivkey 108 getbalance 109 getmetricblocktimestamp 110 getnewaddress 111 getwalletheight 112 importprivkey 113 listaddress 114 listplugins 115 sendfrom 116 sendmany 117 sendtoaddress 118 */ 119 package rpcclient