From 2de9ccec4d76cfe780f9072ea30dbd5a6bbe3d59 Mon Sep 17 00:00:00 2001 From: "progr76@gmail.com" Date: Sat, 16 Mar 2019 19:10:33 +0300 Subject: [PATCH] 0.922 --- Bin/Light/Tera-light.zip | Bin 120691 -> 120691 bytes Doc/Rus/API2.md | 150 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 150 insertions(+) diff --git a/Bin/Light/Tera-light.zip b/Bin/Light/Tera-light.zip index 4aeae19b68cd7beccadeebedb30c8dc6b14ce744..de9789139247be49ef753bc5525b2d143a3204c8 100644 GIT binary patch delta 412 zcmeyoj{WmG_6?n;jQ*RuOm#UJ{hN2#Zr@?cc)y>8PtM}__St6{1sGZ0o;N=}ef>E` z2}b|vC(bb%3d_4%92dHCg%L(Ksc}yayuv6tUGY4lgDjG0@!^$M7z4Z+ndBL`7(l>( zdfj<(`R2`v}Xy}1?1klz?jIL z_z+^XE1TH#gXe)(#$RM~!VsN2y@7A~`HPH(+=U#LV4KoIpz0MaF}krd>02J3o^^>a zfn{?57#-o26(*>^rEkAUH z(S_yeC!jpnRmOOhZw^53$1ON%jq*nj{ delta 412 zcmeyoj{WmG_6?n;jEtMROm#UJ8Jl<5Zr@?cc)y?JUCzwB?X%A^3NW(l{XQda`ucN> z5{!(~Pn=^k6z1POGf(Kw6-F4{q{clx@Cu{obj92>EB4R|DV=70?V(bE+#Fv?87cAn9lMd8s*FgJ?DkaHGPV)g|_dlp9nAotz{ z#zbxq3uLt`o7nV&=YdwnUu1OR4hlyVojkpPZ~FO*jE3Avbr6~K5U6^EON?$T#Y=(a zWnE%SU}-)BWa(c9y5Q9%Mn^a|l4Z(gphVAQ#weDhQnT}>zq-u0gL|vvY_R1sPKr$z zyb84Z&=p1(mSY(}d9JIB@hs1`0a>|M8RJ;K-vzSHgTy#kfnEf%WTyLF1G*IE^HX-> Z5chAm2J{~&Ag6!62DA*UG4ML05&*R!rWXJJ diff --git a/Doc/Rus/API2.md b/Doc/Rus/API2.md index a4cbdd3..4dbe0e0 100644 --- a/Doc/Rus/API2.md +++ b/Doc/Rus/API2.md @@ -304,3 +304,153 @@ http://127.0.0.1/api/v2/GetHistoryTransactions "NextPos": 439090 } ``` + + +=Добавочная часть к API2= + +Вариант использования: +1. Computer A (has public keys) creates a raw unsigned transaction +2. Computer B (has secret keys) grabs and signs the raw transaction +3. computer A grabs the signed transaction and transmits it. + + + +7)**/api/v2/CreateRawTransaction** - create json payment tx without a signature + +#### Parameters: +* FromID - номер счета отправителя +* FromPrivKey - приватный ключ отправителя в hex-формате +* ToID - номер счета получателя, число или публичный ключ в hex-формате (в этом случае будет создан новый счет с именем заданным в первой строке описания платежа и в качестве оплаты создания счета спишется 10 Тера) +* Amount - сумма, число с плавающей точкой или объект в формате {SumCOIN,SumCENT} +* Description - описание платежка (необязательный параметр) + +example: +```js +http://127.0.0.1/api/v2/CreateRawTransaction +{ + "FromID": 187004, + "ToID":190650, + "Amount":10.5, + "Description":"Тест" + +} +``` + +return: +```js +{ + "result": 1, + "Tx": { + "Type": 111, + "Version": 3, + "FromID": 187004, + "OperationID": 118, + "To": [ + { + "PubKey": "", + "ID": 190650, + "SumCOIN": 10, + "SumCENT": 500000000 + } + ], + "Description": "Тест", + "Sign": "" + } +} +``` + + + +8)**/api/v2/SignRawTransaction** - sign tx + +#### Parameters: +* Tx - JSON object +* FromPrivKey - sender private key in hex format + +example: +```js +http://127.0.0.1/api/v2/SignRawTransaction +{ + "Tx": { + "Type": 111, + "Version": 3, + "FromID": 187004, + "OperationID": 118, + "To": [ + { + "PubKey": "", + "ID": 190650, + "SumCOIN": 10, + "SumCENT": 500000000 + } + ], + "Description": "Тест", + "Sign": "" + }, + "FromPrivKey": "98765432108AC931F32480BFE3E78D26E45B0A4F88045D6518263DA12FA9C033" +} +``` + +return: +```js +{ + "result": 1, + "Tx": { + "Type": 111, + "Version": 3, + "FromID": 187004, + "OperationID": 118, + "To": [ + { + "PubKey": "", + "ID": 190650, + "SumCOIN": 10, + "SumCENT": 500000000 + } + ], + "Description": "Тест", + "Sign": "123456789ABCD931F3A2D45610FE8AC931F32480BFE3E78D26E45B0A4F88045D6518263DA12FA9C0332480BFE3E78D26E45B0A4F88045D6518263DA12FA9C033" + } +} +``` + +9)**/api/v2/SendRawTransaction** - send tx to TERA network + +#### Parameters: +* Tx -JSON object +* Wait - if the number 1 is set, the response to the request is not returned until the transaction is written to the blockchain (the response time to the request is increased to 8 seconds) + +example: +```js +http://127.0.0.1/api/v2/SendRawTransaction +{ + "Tx": { + "Type": 111, + "Version": 3, + "FromID": 187004, + "OperationID": 118, + "To": [ + { + "PubKey": "", + "ID": 190650, + "SumCOIN": 10, + "SumCENT": 500000000 + } + ], + "Description": "Тест", + "Sign": "123456789ABCD931F3A2D45610FE8AC931F32480BFE3E78D26E45B0A4F88045D6518263DA12FA9C0332480BFE3E78D26E45B0A4F88045D6518263DA12FA9C033" + }, + "Wait":1 +} +``` + + +return: +```js +{ + "result": 1, + "text": "Add to blockchain", + "TxID": "1234567891ABF4062B149B7C2F010000", + "BlockNum": 22222900 +} +```