Symverse Wallet JavaScript API
It provides json rpc communication interface and development library with symverse blockchain, rpc api.
https://www.npmjs.com/package/symjs
npm:Installation
Node.js
npm i symjs
Yarn
yarn add symjs
A minified, browserified file dist/symjs.js
is included for use in the browser. Including this file simply attaches the symjs
object to window:
<script src='dist/symjs.js'></script>
Usage
Use the symjs object directly from the global namespace:
console // { utils: ...} const symjs = ;console; // {network: ..., utils: ..., signer: ...}
Network connect(symverse rpc
)
const symjs = ;symjsnetwork
There you go, now you can use it:
// Return Promise Object By Json RPC symjsnetworkcall; symjsnetworkcall;
- Send Raw Transaction example:
let privateKey = "2a43aa399cb2efe186317e0b09f4a7ef88b83cff05089b145709881bf4db3a20"let params = from:"0x00021000000000010002" nonce: 210 gasPrice: 1000000000000 gasLimit: 41000 to: "0x00021000000000020002" value: 5 workNodes: "0x00021000000000010002" chainId: 7777 //require;// Return Promise Object By Json RPC symjsnetworkcall;
- Send SCT Raw Transaction example:
//sct input toolssymjsparamsct20symjsparamsct20symjsparamsct20symjsparamsct20 symjsparamsct21 ...symjsparamsct30 ...symjsparamsct40 ......
let privateKey = "1a43aa399cb2efe186317e0b09f4a7ef88b83cff05089b145709881bf4db3a20"let params = from: "0x00021000000000010002" nonce: 214 gasPrice: '0x09184e72a000000' gasLimit: '0x271000' workNodes: "0x00021000000000010002" type: 1 input: "0x"+symjsparamsct20 chainId: 7777; // Return Promise Object By Json RPC symjsnetworkcall;
- Citizen api call example:
// Return Promise Object By Json RPC let citizenInfo = await symjsnetworkcallcitizenlet count = await symjsnetworkcallcitizen
- Warrant api call example:
// Return Promise Object By Json RPC let blockNumber = await symjsnetworkcallwarrant
- Sct api call example:
// Return Promise Object By Json RPC let constract = await symjsnetworkcallsctlet account = await symjsnetworkcallsct
Contact
https://www.symverse.com/
Please contact us on this page.