You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

DERO API - Français.md 18KB

1 year ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712
  1. # DERO-HE RPC API
  2. Dero Project - dero.io
  3. February 3, 2022
  4. Written by [Slixe](https://github.com/Slixe).
  5. ## CONTENTS
  6. ### Daemon RPC API
  7. TODO
  8. ### Wallet RPC API
  9. Tout d'abord, notez que le serveur RPC n'est pas activé par défaut sur le wallet, pour se faire, lancez le wallet avec le paramètre `--rpc-server`.
  10. Le serveur RPC écoutera sur le port `40403` sur testnet.
  11. #### Echo
  12. Endpoint de test permettant de vérifier que le serveur RPC est bien activé du côté du wallet.
  13. ##### Paramètres disponibles
  14. | Name | Type | Mandatory | Comment |
  15. |:----:|:--------:|:---------:|:---------------:|
  16. | | []string | true | Array of string |
  17. ##### Body
  18. ```json
  19. {
  20. "jsonrpc": "2.0",
  21. "id": "1",
  22. "method": "Echo",
  23. "params": ["Hello", "World", "!"]
  24. }
  25. ```
  26. ##### cURL request
  27. ```json
  28. curl -X POST \
  29. http://127.0.0.1:40403/json_rpc \
  30. -H 'content-type: application/json' \
  31. -d '{
  32. "jsonrpc": "2.0",
  33. "id": "1",
  34. "method": "Echo",
  35. "params": ["Hello", "World", "!"]
  36. }'
  37. ```
  38. ##### Result
  39. ```json
  40. {
  41. "jsonrpc": "2.0",
  42. "id": "1",
  43. "result": "WALLET Hello World !"
  44. }
  45. ```
  46. #### Get Address
  47. Renvoi l'adresse DERO du portefeuille permettant de recevoir des DERO ou autres tokens.
  48. ##### Paramètres disponibles
  49. Aucun paramètre
  50. ##### Body
  51. ```json
  52. {
  53. "jsonrpc": "2.0",
  54. "id": "1",
  55. "method": "GetAddress"
  56. }
  57. ```
  58. ##### cURL request
  59. ```json
  60. curl -X POST \
  61. http://127.0.0.1:40403/json_rpc \
  62. -H 'content-type: application/json' \
  63. -d '{
  64. "jsonrpc": "2.0",
  65. "id": "1",
  66. "method": "GetAddress"
  67. }'
  68. ```
  69. ##### Result
  70. ```json
  71. {
  72. "jsonrpc": "2.0",
  73. "id": "1",
  74. "result": {
  75. "address": "deto1qyyhg0xznkaxt5udct6lnlylsexvwprun6jphv89xg008vq29jk4vqqayuknf"
  76. }
  77. }
  78. ```
  79. #### Get Balance
  80. Récupère le solde actuelle du portefeuille.
  81. ##### Paramètres disponibles
  82. Aucun paramètre
  83. ##### Body
  84. ```json
  85. {
  86. "jsonrpc": "2.0",
  87. "id": "1",
  88. "method": "GetBalance"
  89. }
  90. ```
  91. ##### cURL request
  92. ```json
  93. curl -X POST \
  94. http://127.0.0.1:40403/json_rpc \
  95. -H 'content-type: application/json' \
  96. -d '{
  97. "jsonrpc": "2.0",
  98. "id": "1",
  99. "method": "GetBalance"
  100. }'
  101. ```
  102. ##### Result
  103. ```json
  104. {
  105. "jsonrpc": "2.0",
  106. "id": "1",
  107. "result": {
  108. "balance": 800000,
  109. "unlocked_balance": 800000
  110. }
  111. }
  112. ```
  113. **NOTE**: Le montant est au format atomique. Pour rappel, 10^5 (=100000) équivaut à un 1 DERO.
  114. **Attention**: si cette adresse n'est pas enregistré sur la blockchain, vous aurez cette erreur:
  115. ```json
  116. {
  117. "jsonrpc": "2.0",
  118. "id": "1",
  119. "error": {
  120. "code": -32098,
  121. "message": "Account Unregistered"
  122. }
  123. }
  124. ```
  125. #### Get Height
  126. Retourne à quel hauteur de bloc le portefeuille est synchronisé.
  127. ##### Paramètres disponibles
  128. Aucun paramètre
  129. ##### Body
  130. ```json
  131. {
  132. "jsonrpc": "2.0",
  133. "id": "1",
  134. "method": "GetHeight"
  135. }
  136. ```
  137. ##### cURL request
  138. ```json
  139. curl -X POST \
  140. http://127.0.0.1:40403/json_rpc \
  141. -H 'content-type: application/json' \
  142. -d '{
  143. "jsonrpc": "2.0",
  144. "id": "1",
  145. "method": "GetHeight"
  146. }'
  147. ```
  148. ##### Result
  149. ```json
  150. {
  151. "jsonrpc": "2.0",
  152. "id": "1",
  153. "result": {
  154. "height": 420
  155. }
  156. }
  157. ```
  158. #### Get Transfer by TXID
  159. Retourne les détails de la transaction basé sur son hash.
  160. ##### Paramètres disponibles
  161. | Name | Type | Mandatory |
  162. |:----:|:----:|:---------:|
  163. | hash | Hash | true |
  164. ##### Body
  165. ```json
  166. {
  167. "jsonrpc": "2.0",
  168. "id": "1",
  169. "method": "GetTransferbyTXID",
  170. "params": {
  171. "txid": "2a74bcc6262f48630967129793f3b87dc30236f2cb5df6ebb09d620ec0cb503a"
  172. }
  173. }
  174. ```
  175. ##### cURL request
  176. ```json
  177. curl -X POST \
  178. http://127.0.0.1:40403/json_rpc \
  179. -H 'content-type: application/json' \
  180. -d '{
  181. "jsonrpc": "2.0",
  182. "id": "1",
  183. "method": "GetTransferbyTXID",
  184. "params": {
  185. "txid": "2a74bcc6262f48630967129793f3b87dc30236f2cb5df6ebb09d620ec0cb503a"
  186. }
  187. }'
  188. ```
  189. ##### Result
  190. ```json
  191. {
  192. "jsonrpc": "2.0",
  193. "id": "1",
  194. "result": {
  195. "entry": {
  196. "height": 31297,
  197. "topoheight": 31297,
  198. "blockhash": "44e010e6ae56e66e75b158871570233a8a8b918491efc2d02ce793a7ce258612",
  199. "minerreward": 0,
  200. "tpos": 17,
  201. "pos": 0,
  202. "coinbase": false,
  203. "incoming": true,
  204. "txid": "2a74bcc6262f48630967129793f3b87dc30236f2cb5df6ebb09d620ec0cb503a",
  205. "destination": "",
  206. "amount": 500000,
  207. "fees": 451,
  208. "proof": "deroproof1qy3zfvkwdz87xa7mvxc0qq7nsmcgkl3gsf00a2amhk7fs2yu09r4uqdzvfyyskpqckdxyd8vgtzd75mjujsyzj6swrfdy6gw7alx78ak23v6ql60ewqxy4j4rgqq0gfqsjjq9u",
  209. "status": 0,
  210. "time": "2022-02-03T17:51:16.006+01:00",
  211. "ewdata": "2efc785f92e9ffdaf1935186e0ffe561e500632722c73f95e741136389a347b8002642ae3d734c6b119a28884920036e895fc8e6a33f9c4ec6d90da1a4d1b65ef901",
  212. "data": "AqFoQ29tbWVudFNySGVsbG8gZnJvbSBTbGl4ZSAhAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==",
  213. "payloadtype": 0,
  214. "payload": "oWhDb21tZW50U3JIZWxsbyBmcm9tIFNsaXhlICEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
  215. "payload_rpc": [
  216. {
  217. "name": "Comment",
  218. "datatype": "S",
  219. "value": "Hello from Slixe !"
  220. }
  221. ],
  222. "sender": "deto1qyj4kx6azntn9psmg7dsfkuv9qs9xde0s94nmmhm2a0damffpm2zzqqcudacc",
  223. "dstport": 0,
  224. "srcport": 0
  225. }
  226. }
  227. }
  228. ```
  229. #### Get Transfers
  230. Retourne toutes les transactions présentes dans le portefeuille par rapport aux filtres appliqués.
  231. ##### Paramètres disponibles
  232. | Name | Type | Mandatory | Comment |
  233. |:----------:|:------:|:---------:|:--------------------------:|
  234. | scid | Hash | false | Smart Contract ID |
  235. | coinbase | bool | false | Accept coinbase TX ? |
  236. | in | bool | false | Accept incoming TX ? |
  237. | out | bool | false | Accept outgoing TX ? |
  238. | min_height | uint64 | false | Minimum height |
  239. | max_height | uint64 | false | Maximum height |
  240. | sender | string | false | Sender address equal |
  241. | receiver | string | false | Receiver address equal |
  242. | dstport | uint64 | false | Destination Port (Service) |
  243. | srcport | uint64 | false | Source Port (Service) |
  244. ##### Body
  245. ```json
  246. {
  247. "jsonrpc": "2.0",
  248. "id": "1",
  249. "method": "GetTransfers",
  250. "params": {
  251. "out": true,
  252. "in": true
  253. }
  254. }
  255. ```
  256. ##### cURL request
  257. ```json
  258. curl -X POST \
  259. http://127.0.0.1:40403/json_rpc \
  260. -H 'content-type: application/json' \
  261. -d '{
  262. "jsonrpc": "2.0",
  263. "id": "1",
  264. "method": "GetTransfers",
  265. "params": {
  266. "out": true,
  267. "in": true
  268. }
  269. }'
  270. ```
  271. ##### Result
  272. ```json
  273. {
  274. "jsonrpc": "2.0",
  275. "id": "1",
  276. "result": {
  277. "entries": [
  278. {
  279. "height": 31297,
  280. "topoheight": 31297,
  281. "blockhash": "44e010e6ae56e66e75b158871570233a8a8b918491efc2d02ce793a7ce258612",
  282. "minerreward": 0,
  283. "tpos": 17,
  284. "pos": 0,
  285. "coinbase": false,
  286. "incoming": true,
  287. "txid": "2a74bcc6262f48630967129793f3b87dc30236f2cb5df6ebb09d620ec0cb503a",
  288. "destination": "",
  289. "amount": 500000,
  290. "fees": 451,
  291. "proof": "deroproof1qy3zfvkwdz87xa7mvxc0qq7nsmcgkl3gsf00a2amhk7fs2yu09r4uqdzvfyyskpqckdxyd8vgtzd75mjujsyzj6swrfdy6gw7alx78ak23v6ql60ewqxy4j4rgqq0gfqsjjq9u",
  292. "status": 0,
  293. "time": "2022-02-03T17:51:16.006+01:00",
  294. "ewdata": "2efc785f92e9ffdaf1935186e0ffe561e500632722c73f95e741136389a347b8002642ae3d734c6b119a28884920036e895fc8e6a33f9c4ec6d90da1a4d1b65ef901",
  295. "data": "AqFoQ29tbWVudFNySGVsbG8gZnJvbSBTbGl4ZSAhAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==",
  296. "payloadtype": 0,
  297. "payload": "oWhDb21tZW50U3JIZWxsbyBmcm9tIFNsaXhlICEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
  298. "payload_rpc": [
  299. {
  300. "name": "Comment",
  301. "datatype": "S",
  302. "value": "Hello from Slixe !"
  303. }
  304. ],
  305. "sender": "deto1qyj4kx6azntn9psmg7dsfkuv9qs9xde0s94nmmhm2a0damffpm2zzqqcudacc",
  306. "dstport": 0,
  307. "srcport": 0
  308. }
  309. ]
  310. }
  311. }
  312. ```
  313. #### Make Integrated Address
  314. Retourne une nouvelle adresse avec des Payloads inclus.
  315. ##### Paramètres disponibles
  316. | Name | Type | Mandatory | Comment |
  317. |:-----------:|:--------:|:---------:|:----------------------------------------------------:|
  318. | address | string | false | DERO Address (if empty, the one from wallet is used) |
  319. | payload_rpc | Argument | false | Parameters to include in address |
  320. ##### Body
  321. ```json
  322. {
  323. "jsonrpc": "2.0",
  324. "id": "1",
  325. "method": "MakeIntegratedAddress",
  326. "params": {
  327. "payload_rpc": [
  328. {
  329. "name": "Comment",
  330. "datatype": "S",
  331. "value": "Hello from integrated address !"
  332. }
  333. ]
  334. }
  335. }
  336. ```
  337. ##### cURL request
  338. ```json
  339. curl -X POST \
  340. http://127.0.0.1:40403/json_rpc \
  341. -H 'content-type: application/json' \
  342. -d '{
  343. "jsonrpc": "2.0",
  344. "id": "1",
  345. "method": "MakeIntegratedAddress",
  346. "params": {
  347. "payload_rpc": [
  348. {
  349. "name": "Comment",
  350. "datatype": "S",
  351. "value": "Hello from integrated address !"
  352. }
  353. ]
  354. }
  355. }'
  356. ```
  357. ##### Result
  358. ```json
  359. {
  360. "jsonrpc": "2.0",
  361. "id": "1",
  362. "result": {
  363. "integrated_address": "detoi1qyyhg0xznkaxt5udct6lnlylsexvwprun6jphv89xg008vq29jk4vq9pdppk7mtdv4h8g5mcrayx2mrvdusxvun0d5sxjmn5v4nhyct5v4jzqctyv3ex2umnyqssvnqraw",
  364. "payload_rpc": [
  365. {
  366. "name": "Comment",
  367. "datatype": "S",
  368. "value": "Hello from integrated address !"
  369. }
  370. ]
  371. }
  372. }
  373. ```
  374. #### Split Integrated Address
  375. Retourne l'adresse DERO et les payloads inclus dans une Integrated Address.
  376. ##### Paramètres disponibles
  377. | Name | Type | Mandatory | Comment |
  378. |:------------------:|:------:|:---------:|:----------------------------:|
  379. | integrated_address | string | true | Integrated Address to decode |
  380. ##### Body
  381. ```json
  382. {
  383. "jsonrpc": "2.0",
  384. "id": "1",
  385. "method": "SplitIntegratedAddress",
  386. "params": {
  387. "integrated_address": "detoi1qyyhg0xznkaxt5udct6lnlylsexvwprun6jphv89xg008vq29jk4vq9pdppk7mtdv4h8g5mcrayx2mrvdusxvun0d5sxjmn5v4nhyct5v4jzqctyv3ex2umnyqssvnqraw"
  388. }
  389. }
  390. ```
  391. ##### cURL request
  392. ```json
  393. curl -X POST \
  394. http://127.0.0.1:40403/json_rpc \
  395. -H 'content-type: application/json' \
  396. -d '{
  397. "jsonrpc": "2.0",
  398. "id": "1",
  399. "method": "SplitIntegratedAddress",
  400. "params": {
  401. "integrated_address": "detoi1qyyhg0xznkaxt5udct6lnlylsexvwprun6jphv89xg008vq29jk4vq9pdppk7mtdv4h8g5mcrayx2mrvdusxvun0d5sxjmn5v4nhyct5v4jzqctyv3ex2umnyqssvnqraw"
  402. }
  403. }'
  404. ```
  405. ##### Result
  406. ```json
  407. {
  408. "jsonrpc": "2.0",
  409. "id": "1",
  410. "result": {
  411. "address": "deto1qyyhg0xznkaxt5udct6lnlylsexvwprun6jphv89xg008vq29jk4vqqayuknf",
  412. "payload_rpc": [
  413. {
  414. "name": "Comment",
  415. "datatype": "S",
  416. "value": "Hello from integrated address !"
  417. }
  418. ]
  419. }
  420. }
  421. ```
  422. #### Query Key
  423. Retourne la clé mnémonique (seed) associé à ce portefeuille.
  424. ##### Paramètres disponibles
  425. | Name | Type | Mandatory | Comment |
  426. |:--------:|:------:|:---------:|:--------------------------:|
  427. | key_type | string | true | Key Type ("mnemonic" only) |
  428. ##### Body
  429. ```json
  430. {
  431. "jsonrpc": "2.0",
  432. "id": "1",
  433. "method": "QueryKey",
  434. "params": {
  435. "key_type": "mnemonic"
  436. }
  437. }
  438. ```
  439. ##### cURL request
  440. ```json
  441. curl -X POST \
  442. http://127.0.0.1:40403/json_rpc \
  443. -H 'content-type: application/json' \
  444. -d '{
  445. "jsonrpc": "2.0",
  446. "id": "1",
  447. "method": "QueryKey",
  448. "params": {
  449. "key_type": "mnemonic"
  450. }
  451. }'
  452. ```
  453. ##### Result:
  454. ```json
  455. {
  456. "jsonrpc": "2.0",
  457. "id": "1",
  458. "result": {
  459. "key": "eavesdrop sailor tavern fizzle mammal were utmost stellar rafts vats dedicated dosage lynx cent after toyed coexist zippers lipstick aztec dedicated custom chrome onto launching"
  460. }
  461. }
  462. ```
  463. #### Transfer
  464. Crée une transaction et renvoi son hash.
  465. ##### Paramètres disponibles
  466. | Name | Type | Mandatory | Comment |
  467. |:-----------:|:---------:|:---------:|:------------------------:|
  468. | scid | Hash | false | SCID of asset |
  469. | destination | string | false | DERO Address of receiver |
  470. | amount | uint64 | false | Amount of token to send |
  471. | burn | uint64 | false | Amount of token to burn |
  472. | payload_rpc | Arguments | false | Payload Arguments |
  473. ##### Body
  474. ```json
  475. {
  476. "jsonrpc": "2.0",
  477. "id": "1",
  478. "method": "transfer",
  479. "params": {
  480. "scid": "00000000000000000000000000000000",
  481. "destination": "deto1qyj4kx6azntn9psmg7dsfkuv9qs9xde0s94nmmhm2a0damffpm2zzqqcudacc",
  482. "amount": 100000
  483. }
  484. }
  485. ```
  486. ##### cURL request
  487. ```json
  488. curl -X POST \
  489. http://127.0.0.1:40403/json_rpc \
  490. -H 'content-type: application/json' \
  491. -d '{
  492. "jsonrpc": "2.0",
  493. "id": "1",
  494. "method": "transfer",
  495. "params": {
  496. "scid": "00000000000000000000000000000000",
  497. "destination": "deto1qyj4kx6azntn9psmg7dsfkuv9qs9xde0s94nmmhm2a0damffpm2zzqqcudacc",
  498. "amount": 100000
  499. }
  500. }'
  501. ```
  502. ##### Result
  503. ```json
  504. {
  505. "jsonrpc": "2.0",
  506. "id": "1",
  507. "result": {
  508. "txid": "5201c319d04fb72012ecb2fd8c903feff50bbd5db39c60dfee795b9b3a90433a"
  509. }
  510. }
  511. ```
  512. #### Transfer 2
  513. Crée une transaction vers plusieurs adresses distinctes et renvoi son hash.
  514. ##### Paramètres disponibles
  515. | Name | Type | Mandatory | Comment |
  516. |:---------:|:----------:|:---------:|:-----------------------:|
  517. | transfers | []Transfer | false | see previous request |
  518. | sc | string | false | SC Code to deploy |
  519. | sc_rpc | Arguments | false | SC Call arguments |
  520. | ringsize | uint64 | false | Level of anonymity |
  521. | scid | string | false | SCID to call |
  522. | fees | uint64 | false | Tx Fees |
  523. | signer | string | false | used for gas estimation |
  524. ##### Body
  525. ```json
  526. {
  527. "jsonrpc": "2.0",
  528. "id": "1",
  529. "method": "transfer",
  530. "params": {
  531. "transfers": [{
  532. "destination": "deto1qyj4kx6azntn9psmg7dsfkuv9qs9xde0s94nmmhm2a0damffpm2zzqqcudacc",
  533. "amount": 100000
  534. },
  535. {
  536. "destination": "deto1qydvjhl67a3hmcw6zq9yt449extwshzcjxkd7lgk4uhgpyxdr494yqg6zwnc2",
  537. "amount": 100000
  538. }],
  539. "ringsize": 32
  540. }
  541. }
  542. ```
  543. ##### cURL request
  544. ```json
  545. curl -X POST \
  546. http://127.0.0.1:40403/json_rpc \
  547. -H 'content-type: application/json' \
  548. -d '{
  549. "jsonrpc": "2.0",
  550. "id": "1",
  551. "method": "transfer",
  552. "params": {
  553. "transfers": [{
  554. "destination": "deto1qyj4kx6azntn9psmg7dsfkuv9qs9xde0s94nmmhm2a0damffpm2zzqqcudacc",
  555. "amount": 100000
  556. },
  557. {
  558. "destination": "deto1qydvjhl67a3hmcw6zq9yt449extwshzcjxkd7lgk4uhgpyxdr494yqg6zwnc2",
  559. "amount": 100000
  560. }],
  561. "ringsize": 32
  562. }
  563. }'
  564. ```
  565. ##### Result
  566. ```json
  567. {
  568. "jsonrpc": "2.0",
  569. "id": "1",
  570. "result": {
  571. "txid": "3a2712ae039e3f55b4cee132ec7ab76b912d05b3c1fc2744ae2ddd2c18be893e"
  572. }
  573. }
  574. ```
  575. #### SC Invoke
  576. Crée une transaction pour appeler une function du Smart Contract et retourne son hash.
  577. ##### Paramètres disponibles
  578. | Name | Type | Mandatory | Comment |
  579. |:----------------:|:---------:|:---------:|:--------------------------:|
  580. | scid | string | true | SC ID of asset/token |
  581. | sc_rpc | Arguments | true | SC Arguments |
  582. | sc_dero_deposit | uint64 | false | Amount of DERO to deposit |
  583. | sc_token_deposit | uint64 | false | Amount of token to deposit |
  584. | ringsize | uint64 | false | Level of anonymity |
  585. ##### Body
  586. ```json
  587. {
  588. "jsonrpc": "2.0",
  589. "id": "1",
  590. "method": "scinvoke",
  591. "params": {
  592. "scid": "0000000000000000000000000000000000000000000000000000000000000001",
  593. "ringsize": 2,
  594. "sc_rpc": [{
  595. "name": "entrypoint",
  596. "datatype": "S",
  597. "value": "Register"
  598. },
  599. {
  600. "name": "name",
  601. "datatype": "S",
  602. "value": "Slixe"
  603. }]
  604. }
  605. }
  606. ```
  607. ##### cURL request
  608. ```json
  609. curl -X POST \
  610. http://127.0.0.1:40403/json_rpc \
  611. -H 'content-type: application/json' \
  612. -d '{
  613. "jsonrpc": "2.0",
  614. "id": "1",
  615. "method": "scinvoke",
  616. "params": {
  617. "scid": "0000000000000000000000000000000000000000000000000000000000000001",
  618. "ringsize": 2,
  619. "sc_rpc": [{
  620. "name": "entrypoint",
  621. "datatype": "S",
  622. "value": "Register"
  623. },
  624. {
  625. "name": "name",
  626. "datatype": "S",
  627. "value": "Slixe"
  628. }]
  629. }
  630. }'
  631. ```
  632. ##### Result
  633. ```json
  634. {
  635. "jsonrpc": "2.0",
  636. "id": "1",
  637. "result": {
  638. "txid": "bf4b2cd942f4394a03d0d66bbf8c0639f5cbcbf340becc39d4c9e02f987cecca"
  639. }
  640. }
  641. ```