Add explicit code language markers

This commit is contained in:
mDuo13
2020-09-08 14:16:47 -07:00
parent b0a9abd975
commit dfbdd15df5
20 changed files with 499 additions and 463 deletions

View File

@@ -99,7 +99,7 @@ It is also possible to be amendment blocked because you connected your server to
One of the first signs that your `rippled` server is amendment blocked is an `amendmentBlocked` error that is returned [when you submit a transaction](submit.html). Here's an example `amendmentBlocked` error:
```
```json
{
"result":{
"error":"amendmentBlocked",
@@ -124,7 +124,7 @@ If you are on `rippled` version 0.80.0+, you can verify that your `rippled` serv
**Example JSON-RPC Response:**
```
```json
{
"result": {
"info": {
@@ -163,7 +163,7 @@ To find out which features are blocking your `rippled` server, use the [`feature
**Example JSON-RPC Response:**
```
```json
{
"result": {
"features": {

View File

@@ -28,7 +28,7 @@ Authorized Trust Lines機能を使用するには、イシュアーがその発
要求:
```
```json
POST http://localhost:5005/
{
"method": "submit",
@@ -66,7 +66,7 @@ Authorized Trust Lines機能を使用している場合、他のアカウント
要求:
```
```json
POST http://localhost:8088/
{
"method": "submit",

View File

@@ -30,13 +30,13 @@ The following is an example of using a locally-hosted `rippled`'s [submit method
Request:
```
```json
POST http://localhost:5005/
{
"method": "submit",
"params": [
{
"secret": "sn3nxiW7v8KXzPzAqzyHXbSSKNuN9",
"secret": "s████████████████████████████",
"tx_json": {
"Account": "rUpy3eEg8rqjqfUoLeBnZkscbKbFsKXC3v",
"Fee": "15000",
@@ -75,7 +75,7 @@ POST http://localhost:8088/
"method": "submit",
"params": [
{
"secret": "sn3nxiW7v8KXzPzAqzyHXbSSKNuN9",
"secret": "s████████████████████████████",
"tx_json": {
"Account": "rsA2LpzuawewSBQXkiju3YQTMzW13pAAdW",
"Fee": "15000",

View File

@@ -98,7 +98,7 @@ No Freeze設定は、アドレスのマスターキーのシークレットキ
[WebSocket API](get-started-with-the-rippled-api.html#websocket-api)を使用してIndividual Freezeを有効にするTrustSetトランザクションを送信する例:
```
```json
{
"id": 12,
"command": "submit",
@@ -152,7 +152,7 @@ No Freeze設定は、アドレスのマスターキーのシークレットキ
[WebSocket API](get-started-with-the-rippled-api.html#websocket-api)を使用してGlobal Freezeを有効にするAccountSetトランザクションを送信する例:
```
```json
{
"id": 12,
"command": "submit",
@@ -202,7 +202,7 @@ No Freeze設定は、アドレスのマスターキーのシークレットキ
WebSocket要求:
```
```json
{
"id": 12,
"command": "submit",
@@ -261,7 +261,7 @@ WebSocket要求:
Individual Freezeを確認するためのWebSocket要求の例:
```
```json
{
"id": 15,
"command": "account_lines",
@@ -273,7 +273,7 @@ Individual Freezeを確認するためのWebSocket要求の例:
WebSocket応答の例:
```
```json
{
"id": 15,
"status": "success",
@@ -341,7 +341,7 @@ WebSocket応答の例:
WebSocket要求の例:
```
```json
{
"id": 1,
"command": "account_info",
@@ -352,7 +352,7 @@ WebSocket要求の例:
WebSocket応答:
```
```json
{
"id": 4,
"status": "success",
@@ -385,10 +385,10 @@ WebSocket応答:
上記の例では`Flags`の値は12582912です。この場合、次のJavaScriptコードのように、lsfGlobalFreezeフラグとlsfDefaultRippleフラグが有効になっています。
```js
var lsfGlobalFreeze = 0x00400000;
var lsfNoFreeze = 0x00200000;
var lsfGlobalFreeze = 0x00400000;
var lsfNoFreeze = 0x00200000;
var currentFlags = 12582912;
var currentFlags = 12582912;
console.log(currentFlags & lsfGlobalFreeze); //4194304
//therefore, Global Freeze is enabled

View File

@@ -98,7 +98,7 @@ Set the `Fee`, `Sequence`, and `LastLedgerSequence` parameters [in the typical w
Example of submitting a TrustSet transaction to enable an individual freeze using the [WebSocket API](get-started-with-the-rippled-api.html#websocket-api):
```
```json
{
"id": 12,
"command": "submit",
@@ -152,7 +152,7 @@ To enable Global Freeze on an address, send an `AccountSet` transaction with the
Example of submitting an AccountSet transaction to enable Global Freeze using the [WebSocket API](get-started-with-the-rippled-api.html#websocket-api):
```
```json
{
"id": 12,
"command": "submit",
@@ -202,7 +202,7 @@ Example of submitting an AccountSet transaction to enable No Freeze using the [W
WebSocket request:
```
```json
{
"id": 12,
"command": "submit",
@@ -273,7 +273,7 @@ Example WebSocket request to check for individual freeze:
Example WebSocket response:
```
```json
{
"id": 15,
"status": "success",

View File

@@ -63,7 +63,7 @@ XRP決済の送信に関する対話型チュートリアルについては、[S
JSON形式の未署名の[Paymentトランザクション][]の例を次に示します。
```
```json
{
"TransactionType" : "Payment",
"Account" : "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
@@ -90,7 +90,7 @@ XRP Ledgerは、トランザクションオブジェクトが送信元アドレ
トランザクションに署名すると、ネットワークに送信できるバイナリーブロブが生成されます。この場合、`rippled`の[submitコマンド](submit.html)を使用します。署名付きブロブと同じトランザクションの例を示します。このトランザクションは、WebSocket APIを使用して送信されています。
```
```json
{
"id": 2,
"command": "submit",
@@ -106,7 +106,7 @@ XRP Ledgerは、トランザクションオブジェクトが送信元アドレ
`tx`コマンドの応答の例:
```
```json
{
"id": 6,
"status": "success",

View File

@@ -63,7 +63,7 @@ See [Send XRP](send-xrp.html) for an interactive tutorial in sending XRP payment
Here is an example of an unsigned [Payment transaction][] in JSON:
```
```json
{
"TransactionType" : "Payment",
"Account" : "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
@@ -90,7 +90,7 @@ The XRP Ledger only relays and executes a transaction if the transaction object
Signing a transaction generates a binary blob that can be submitted to the network. This means using `rippled`'s [submit command](submit.html). Here is an example of the same transaction, as a signed blob, being submitted with the WebSocket API:
```
```json
{
"id": 2,
"command": "submit",
@@ -106,7 +106,7 @@ After a transaction has been submitted, you can check its status using the API,
Example response from the `tx` command:
```
```json
{
"id": 6,
"status": "success",

View File

@@ -24,7 +24,7 @@ XRP Ledgerでは、アカウントはその後のトランザクションには
*WebSocket*
```
```json
{
"command":"wallet_propose"
}
@@ -32,7 +32,7 @@ XRP Ledgerでは、アカウントはその後のトランザクションには
*JSON-RPC*
```
```json
{
"method":"wallet_propose"
}
@@ -40,7 +40,7 @@ XRP Ledgerでは、アカウントはその後のトランザクションには
*コマンドライン*
```
```sh
#Syntax: wallet_propose
rippled wallet_propose
```
@@ -56,7 +56,7 @@ rippled wallet_propose
*WebSocket*
```
```json
{
"result":{
"account_id":"rsprUqu6BHAffAeG4HpSdjBNvnA6gdnZV7",
@@ -74,7 +74,7 @@ rippled wallet_propose
*JSON-RPC*
```
```json
{
"result":{
"account_id":"rsprUqu6BHAffAeG4HpSdjBNvnA6gdnZV7",
@@ -91,7 +91,7 @@ rippled wallet_propose
*コマンドライン*
```
```json
{
"result" :{
"account_id" :"rsprUqu6BHAffAeG4HpSdjBNvnA6gdnZV7",
@@ -142,7 +142,7 @@ SetRegularKeyトランザクションでレギュラーキーペアを初めて
*WebSocket*
```
```json
{
"command":"sign",
"tx_json":{
@@ -156,7 +156,7 @@ SetRegularKeyトランザクションでレギュラーキーペアを初めて
*JSON-RPC*
```
```json
{
"method":"sign",
"params":[
@@ -174,7 +174,7 @@ SetRegularKeyトランザクションでレギュラーキーペアを初めて
*コマンドライン*
```
```sh
#Syntax: sign secret tx_json
rippled sign ssCATR7CBvn4GLd1UuU2bqqQffHki '{"TransactionType":"SetRegularKey", "Account":"rUAi7pipxGpYfPNg3LtPcf2ApiS8aw9A93", "RegularKey":"rsprUqu6BHAffAeG4HpSdjBNvnA6gdnZV7"}'
```
@@ -190,7 +190,7 @@ rippled sign ssCATR7CBvn4GLd1UuU2bqqQffHki '{"TransactionType":"SetRegularKey",
*WebSocket*
```
```json
{
"result":{
"tx_blob":"1200052280000000240000000468400000000000000A73210384CA3C528F10C75F26E0917F001338BD3C9AA1A39B9FBD583DFFFD96CF2E2D7A7446304402204BCD5663F3A2BA02D2CE374439096EC6D27273522CD6E6E0BDBFB518730EAAE402200ECD02D8D2525D6FA4642613E71E395ECCEA01C42C35A668BF092A00EB649C268114830923439D307E642CED308FD91EF701A7BAA74788141620D685FB08D81A70D0B668749CF2E130EA7540",
@@ -213,7 +213,7 @@ rippled sign ssCATR7CBvn4GLd1UuU2bqqQffHki '{"TransactionType":"SetRegularKey",
*JSON-RPC*
```
```json
{
"result":{
"status":"success",
@@ -235,7 +235,7 @@ rippled sign ssCATR7CBvn4GLd1UuU2bqqQffHki '{"TransactionType":"SetRegularKey",
*コマンドライン*
```
```json
{
"result" :{
"status" :"success",
@@ -274,7 +274,7 @@ rippled sign ssCATR7CBvn4GLd1UuU2bqqQffHki '{"TransactionType":"SetRegularKey",
*WebSocket*
```
```json
{
"command":"submit",
"tx_blob":"1200052280000000240000000468400000000000000A73210384CA3C528F10C75F26E0917F001338BD3C9AA1A39B9FBD583DFFFD96CF2E2D7A7446304402204BCD5663F3A2BA02D2CE374439096EC6D27273522CD6E6E0BDBFB518730EAAE402200ECD02D8D2525D6FA4642613E71E395ECCEA01C42C35A668BF092A00EB649C268114830923439D307E642CED308FD91EF701A7BAA74788141620D685FB08D81A70D0B668749CF2E130EA7540"
@@ -283,7 +283,7 @@ rippled sign ssCATR7CBvn4GLd1UuU2bqqQffHki '{"TransactionType":"SetRegularKey",
*JSON-RPC*
```
```json
{
"method":"submit",
"params":[
@@ -296,7 +296,7 @@ rippled sign ssCATR7CBvn4GLd1UuU2bqqQffHki '{"TransactionType":"SetRegularKey",
*コマンドライン*
```
```sh
#Syntax: submit tx_blob
rippled submit 1200052280000000240000000468400000000000000A73210384CA3C528F10C75F26E0917F001338BD3C9AA1A39B9FBD583DFFFD96CF2E2D7A7446304402204BCD5663F3A2BA02D2CE374439096EC6D27273522CD6E6E0BDBFB518730EAAE402200ECD02D8D2525D6FA4642613E71E395ECCEA01C42C35A668BF092A00EB649C268114830923439D307E642CED308FD91EF701A7BAA74788141620D685FB08D81A70D0B668749CF2E130EA7540
```
@@ -312,7 +312,7 @@ rippled submit 1200052280000000240000000468400000000000000A73210384CA3C528F10C75
*WebSocket*
```
```json
{
"result":{
"engine_result":"tesSUCCESS",
@@ -338,7 +338,7 @@ rippled submit 1200052280000000240000000468400000000000000A73210384CA3C528F10C75
*JSON-RPC*
```
```json
{
"result":{
"engine_result":"tesSUCCESS",
@@ -363,7 +363,7 @@ rippled submit 1200052280000000240000000468400000000000000A73210384CA3C528F10C75
*コマンドライン*
```
```json
{
"result" :{
"engine_result" :"tesSUCCESS",
@@ -421,7 +421,7 @@ rippled submit 1200052280000000240000000468400000000000000A73210384CA3C528F10C75
*WebSocket*
```
```json
{
"command":"sign",
"tx_json":{
@@ -434,7 +434,7 @@ rippled submit 1200052280000000240000000468400000000000000A73210384CA3C528F10C75
*JSON-RPC*
```
```json
{
"method":"sign",
"params":[
@@ -451,7 +451,7 @@ rippled submit 1200052280000000240000000468400000000000000A73210384CA3C528F10C75
*コマンドライン*
```
```sh
#Syntax: sign secret tx_json
rippled sign sh8i92YRnEjJy3fpFkL8txQSCVo79 '{"TransactionType":"AccountSet", "Account":"rUAi7pipxGpYfPNg3LtPcf2ApiS8aw9A93"}'
```
@@ -467,7 +467,7 @@ rippled sign sh8i92YRnEjJy3fpFkL8txQSCVo79 '{"TransactionType":"AccountSet", "Ac
*WebSocket*
```
```json
{
"result":{
"tx_blob":"1200032280000000240000000468400000000000000A73210330E7FC9D56BB25D6893BA3F317AE5BCF33B3291BD63DB32654A313222F7FD02074473045022100A50E867D3B1B5A39F23F1ABCA5C7C3EC755442FDAA357EFD897B865ACA7686DB02206077BF459BCE39BCCBFE1A128DA986D1E00CBEC5F0D6B0E11710F60BE2976FB88114623B8DA4A0BFB3B61AB423391A182DC693DC159E",
@@ -489,7 +489,7 @@ rippled sign sh8i92YRnEjJy3fpFkL8txQSCVo79 '{"TransactionType":"AccountSet", "Ac
*JSON-RPC*
```
```json
{
"result":{
"status":"success",
@@ -510,7 +510,7 @@ rippled sign sh8i92YRnEjJy3fpFkL8txQSCVo79 '{"TransactionType":"AccountSet", "Ac
*コマンドライン*
```
```json
{
"result" :{
"status" :"success",
@@ -548,7 +548,7 @@ rippled sign sh8i92YRnEjJy3fpFkL8txQSCVo79 '{"TransactionType":"AccountSet", "Ac
*WebSocket*
```
```json
{
"command":"submit",
"tx_blob":"1200032280000000240000000468400000000000000A73210330E7FC9D56BB25D6893BA3F317AE5BCF33B3291BD63DB32654A313222F7FD02074473045022100A50E867D3B1B5A39F23F1ABCA5C7C3EC755442FDAA357EFD897B865ACA7686DB02206077BF459BCE39BCCBFE1A128DA986D1E00CBEC5F0D6B0E11710F60BE2976FB88114623B8DA4A0BFB3B61AB423391A182DC693DC159E"
@@ -557,7 +557,7 @@ rippled sign sh8i92YRnEjJy3fpFkL8txQSCVo79 '{"TransactionType":"AccountSet", "Ac
*JSON-RPC*
```
```json
{
"method":"submit",
"params":[
@@ -570,7 +570,7 @@ rippled sign sh8i92YRnEjJy3fpFkL8txQSCVo79 '{"TransactionType":"AccountSet", "Ac
*コマンドライン*
```
```sh
#Syntax: submit tx_blob
rippled submit 1200032280000000240000000468400000000000000A73210330E7FC9D56BB25D6893BA3F317AE5BCF33B3291BD63DB32654A313222F7FD02074473045022100A50E867D3B1B5A39F23F1ABCA5C7C3EC755442FDAA357EFD897B865ACA7686DB02206077BF459BCE39BCCBFE1A128DA986D1E00CBEC5F0D6B0E11710F60BE2976FB88114623B8DA4A0BFB3B61AB423391A182DC693DC159E
```
@@ -586,7 +586,7 @@ rippled submit 1200032280000000240000000468400000000000000A73210330E7FC9D56BB25D
*WebSocket*
```
```json
{
"result":{
"engine_result":"tesSUCCESS",
@@ -611,7 +611,7 @@ rippled submit 1200032280000000240000000468400000000000000A73210330E7FC9D56BB25D
*JSON-RPC*
```
```json
{
"result":{
"engine_result":"tesSUCCESS",
@@ -635,7 +635,7 @@ rippled submit 1200032280000000240000000468400000000000000A73210330E7FC9D56BB25D
*コマンドライン*
```
```json
{
"result" :{
"engine_result" :"tesSUCCESS",

View File

@@ -24,7 +24,7 @@ An example of the request format:
*WebSocket*
```
```json
{
"command": "wallet_propose"
}
@@ -32,7 +32,7 @@ An example of the request format:
*JSON-RPC*
```
```json
{
"method": "wallet_propose"
}
@@ -40,7 +40,7 @@ An example of the request format:
*Commandline*
```
```sh
#Syntax: wallet_propose
rippled wallet_propose
```
@@ -56,7 +56,7 @@ An example of a successful response:
*WebSocket*
```
```json
{
"result": {
"account_id": "rsprUqu6BHAffAeG4HpSdjBNvnA6gdnZV7",
@@ -74,7 +74,7 @@ An example of a successful response:
*JSON-RPC*
```
```json
{
"result": {
"account_id": "rsprUqu6BHAffAeG4HpSdjBNvnA6gdnZV7",
@@ -91,7 +91,7 @@ An example of a successful response:
*Commandline*
```
```json
{
"result" : {
"account_id" : "rsprUqu6BHAffAeG4HpSdjBNvnA6gdnZV7",
@@ -142,7 +142,7 @@ An example of the request format:
*WebSocket*
```
```json
{
"command": "sign",
"tx_json": {
@@ -156,7 +156,7 @@ An example of the request format:
*JSON-RPC*
```
```json
{
"method": "sign",
"params": [
@@ -174,7 +174,7 @@ An example of the request format:
*Commandline*
```
```sh
#Syntax: sign secret tx_json
rippled sign ssCATR7CBvn4GLd1UuU2bqqQffHki '{"TransactionType": "SetRegularKey", "Account": "rUAi7pipxGpYfPNg3LtPcf2ApiS8aw9A93", "RegularKey": "rsprUqu6BHAffAeG4HpSdjBNvnA6gdnZV7"}'
```
@@ -190,7 +190,7 @@ An example of a successful response:
*WebSocket*
```
```json
{
"result": {
"tx_blob": "1200052280000000240000000468400000000000000A73210384CA3C528F10C75F26E0917F001338BD3C9AA1A39B9FBD583DFFFD96CF2E2D7A7446304402204BCD5663F3A2BA02D2CE374439096EC6D27273522CD6E6E0BDBFB518730EAAE402200ECD02D8D2525D6FA4642613E71E395ECCEA01C42C35A668BF092A00EB649C268114830923439D307E642CED308FD91EF701A7BAA74788141620D685FB08D81A70D0B668749CF2E130EA7540",
@@ -213,7 +213,7 @@ An example of a successful response:
*JSON-RPC*
```
```json
{
"result": {
"status": "success",
@@ -235,7 +235,7 @@ An example of a successful response:
*Commandline*
```
```json
{
"result" : {
"status" : "success",
@@ -274,7 +274,7 @@ An example of the request format:
*WebSocket*
```
```json
{
"command": "submit",
"tx_blob": "1200052280000000240000000468400000000000000A73210384CA3C528F10C75F26E0917F001338BD3C9AA1A39B9FBD583DFFFD96CF2E2D7A7446304402204BCD5663F3A2BA02D2CE374439096EC6D27273522CD6E6E0BDBFB518730EAAE402200ECD02D8D2525D6FA4642613E71E395ECCEA01C42C35A668BF092A00EB649C268114830923439D307E642CED308FD91EF701A7BAA74788141620D685FB08D81A70D0B668749CF2E130EA7540"
@@ -283,7 +283,7 @@ An example of the request format:
*JSON-RPC*
```
```json
{
"method":"submit",
"params": [
@@ -296,7 +296,7 @@ An example of the request format:
*Commandline*
```
```sh
#Syntax: submit tx_blob
rippled submit 1200052280000000240000000468400000000000000A73210384CA3C528F10C75F26E0917F001338BD3C9AA1A39B9FBD583DFFFD96CF2E2D7A7446304402204BCD5663F3A2BA02D2CE374439096EC6D27273522CD6E6E0BDBFB518730EAAE402200ECD02D8D2525D6FA4642613E71E395ECCEA01C42C35A668BF092A00EB649C268114830923439D307E642CED308FD91EF701A7BAA74788141620D685FB08D81A70D0B668749CF2E130EA7540
```
@@ -338,7 +338,7 @@ An example of a successful response:
*JSON-RPC*
```
```json
{
"result": {
"engine_result": "tesSUCCESS",
@@ -363,7 +363,7 @@ An example of a successful response:
*Commandline*
```
```json
{
"result" : {
"engine_result" : "tesSUCCESS",
@@ -421,7 +421,7 @@ Here's an example of the request format. Note that the request does not include
*WebSocket*
```
```json
{
"command": "sign",
"tx_json": {
@@ -434,7 +434,7 @@ Here's an example of the request format. Note that the request does not include
*JSON-RPC*
```
```json
{
"method": "sign",
"params": [
@@ -451,7 +451,7 @@ Here's an example of the request format. Note that the request does not include
*Commandline*
```
```sh
#Syntax: sign secret tx_json
rippled sign sh8i92YRnEjJy3fpFkL8txQSCVo79 '{"TransactionType": "AccountSet", "Account": "rUAi7pipxGpYfPNg3LtPcf2ApiS8aw9A93"}'
```
@@ -467,7 +467,7 @@ An example of a successful response:
*WebSocket*
```
```json
{
"result": {
"tx_blob": "1200032280000000240000000468400000000000000A73210330E7FC9D56BB25D6893BA3F317AE5BCF33B3291BD63DB32654A313222F7FD02074473045022100A50E867D3B1B5A39F23F1ABCA5C7C3EC755442FDAA357EFD897B865ACA7686DB02206077BF459BCE39BCCBFE1A128DA986D1E00CBEC5F0D6B0E11710F60BE2976FB88114623B8DA4A0BFB3B61AB423391A182DC693DC159E",
@@ -489,7 +489,7 @@ An example of a successful response:
*JSON-RPC*
```
```json
{
"result": {
"status": "success",
@@ -510,7 +510,7 @@ An example of a successful response:
*Commandline*
```
```json
{
"result" : {
"status" : "success",
@@ -548,7 +548,7 @@ An example of the request format:
*WebSocket*
```
```json
{
"command": "submit",
"tx_blob": "1200032280000000240000000468400000000000000A73210330E7FC9D56BB25D6893BA3F317AE5BCF33B3291BD63DB32654A313222F7FD02074473045022100A50E867D3B1B5A39F23F1ABCA5C7C3EC755442FDAA357EFD897B865ACA7686DB02206077BF459BCE39BCCBFE1A128DA986D1E00CBEC5F0D6B0E11710F60BE2976FB88114623B8DA4A0BFB3B61AB423391A182DC693DC159E"
@@ -557,7 +557,7 @@ An example of the request format:
*JSON-RPC*
```
```json
{
"method":"submit",
"params": [
@@ -570,7 +570,7 @@ An example of the request format:
*Commandline*
```
```sh
#Syntax: submit tx_blob
rippled submit 1200032280000000240000000468400000000000000A73210330E7FC9D56BB25D6893BA3F317AE5BCF33B3291BD63DB32654A313222F7FD02074473045022100A50E867D3B1B5A39F23F1ABCA5C7C3EC755442FDAA357EFD897B865ACA7686DB02206077BF459BCE39BCCBFE1A128DA986D1E00CBEC5F0D6B0E11710F60BE2976FB88114623B8DA4A0BFB3B61AB423391A182DC693DC159E
```
@@ -586,7 +586,7 @@ An example of a successful response:
*WebSocket*
```
```json
{
"result": {
"engine_result": "tesSUCCESS",
@@ -611,7 +611,7 @@ An example of a successful response:
*JSON-RPC*
```
```json
{
"result": {
"engine_result": "tesSUCCESS",
@@ -635,7 +635,7 @@ An example of a successful response:
*Commandline*
```
```json
{
"result" : {
"engine_result" : "tesSUCCESS",

View File

@@ -42,7 +42,7 @@ Checkを取り消す例を以下に示します。
*JSON-RPC、WebSocket、またはコマンドライン*
```
```json
{
"TransactionType": "CheckCancel",
"Account": "rUn84CUYbNjRoTQ6mSW7BVJPSVJNLb1QLo",

View File

@@ -42,7 +42,7 @@ The following examples demonstrate how to cancel a Check.
*JSON-RPC, WebSocket, or Commandline*
```
```json
{
"TransactionType": "CheckCancel",
"Account": "rUn84CUYbNjRoTQ6mSW7BVJPSVJNLb1QLo",

View File

@@ -34,7 +34,7 @@ Checkを変動金額で換金するためのトランザクションを準備す
*JSON-RPC、WebSocket、またはコマンドライン*
```
```json
{
"Account": "rGPnRH1EBpHeTF2QG8DCAgM7z5pb75LAis",
"TransactionType": "CheckCash",

View File

@@ -34,7 +34,7 @@ The following examples show how to prepare a transaction to cash a Check for a f
*JSON-RPC, WebSocket, or Commandline*
```
```json
{
"Account": "rGPnRH1EBpHeTF2QG8DCAgM7z5pb75LAis",
"TransactionType": "CheckCash",

View File

@@ -32,7 +32,7 @@ Checkを正確な金額で換金するためのトランザクションを準備
*JSON-RPC、WebSocket、またはコマンドライン*
```
```json
{
"Account": "rfkE1aSy9G8Upk4JssnwBxhEv5p4mn2KTy",
"TransactionType": "CheckCash",

View File

@@ -32,7 +32,7 @@ The following examples show how to prepare a transaction to cash a Check for a f
*JSON-RPC, WebSocket, or Commandline*
```
```json
{
"Account": "rfkE1aSy9G8Upk4JssnwBxhEv5p4mn2KTy",
"TransactionType": "CheckCash",

View File

@@ -2,8 +2,6 @@
Checks in the XRP Ledger authorize another account to claim funds later, similar to how personal paper checks work.
**Caution:** As of 2018-10-11, the [Checks amendment][] is not enabled on the XRP Ledger. You can use Checks on the [XRP Test Net](xrp-test-net-faucet.html) only.
<!--{# common link defs #}-->
{% include '_snippets/rippled-api-links.md' %}
{% include '_snippets/tx-type-links.md' %}

View File

@@ -55,100 +55,108 @@ The following example shows creation of a payment channel by [submitting](submit
Request:
POST http://localhost:5005/
Content-Type: application/json
```json
POST http://localhost:5005/
Content-Type: application/json
{
"method": "submit",
"params": [{
"secret": "s████████████████████████████",
"tx_json": {
"Account": "rN7n7otQDd6FczFgLdSqtcsAUxDkw6fzRH",
"TransactionType": "PaymentChannelCreate",
"Amount": "100000000",
"Destination": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
"SettleDelay": 86400,
"PublicKey": "023693F15967AE357D0327974AD46FE3C127113B1110D6044FD41E723689F81CC6",
"DestinationTag": 20170428
},
"fee_mult_max": 1000
}]
}
{
"method": "submit",
"params": [{
"secret": "s████████████████████████████",
"tx_json": {
"Account": "rN7n7otQDd6FczFgLdSqtcsAUxDkw6fzRH",
"TransactionType": "PaymentChannelCreate",
"Amount": "100000000",
"Destination": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
"SettleDelay": 86400,
"PublicKey": "023693F15967AE357D0327974AD46FE3C127113B1110D6044FD41E723689F81CC6",
"DestinationTag": 20170428
},
"fee_mult_max": 1000
}]
}
```json
Response:
200 OK
```json
200 OK
{
"result": {
"engine_result": "tesSUCCESS",
"engine_result_code": 0,
"engine_result_message": "The transaction was applied. Only final in a validated ledger.",
{
"result": {
"engine_result": "tesSUCCESS",
"engine_result_code": 0,
"engine_result_message": "The transaction was applied. Only final in a validated ledger.",
...
"tx_json": {
...
"tx_json": {
...
"TransactionType": "PaymentChannelCreate",
"hash": "3F93C482C0BC2A1387D9E67DF60BECBB76CC2160AE98522C77AF0074D548F67D"
}
"TransactionType": "PaymentChannelCreate",
"hash": "3F93C482C0BC2A1387D9E67DF60BECBB76CC2160AE98522C77AF0074D548F67D"
}
}
}
```
The immediate response to the `submit` request contains a _provisional_ result with the transaction's identifying `hash` value. The payer should check the transaction's _final_ result in a validated ledger and get the Channel ID from the metadata. This can be done with the `tx` command:
Request:
POST http://localhost:5005/
Content-Type: application/json
```json
POST http://localhost:5005/
Content-Type: application/json
{
"method": "tx",
"params": [{
"transaction": "3F93C482C0BC2A1387D9E67DF60BECBB76CC2160AE98522C77AF0074D548F67D"
}]
}
{
"method": "tx",
"params": [{
"transaction": "3F93C482C0BC2A1387D9E67DF60BECBB76CC2160AE98522C77AF0074D548F67D"
}]
}
```
Response:
200 OK
```json
200 OK
{
"result": {
"Account": "rN7n7otQDd6FczFgLdSqtcsAUxDkw6fzRH",
"Amount": "100000000",
"Destination": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
...
"TransactionType": "PaymentChannelCreate",
...
"hash": "3F93C482C0BC2A1387D9E67DF60BECBB76CC2160AE98522C77AF0074D548F67D",
"inLedger": 29380080,
"ledger_index": 29380080,
"meta": {
"AffectedNodes": [
...
{
"CreatedNode": {
"LedgerEntryType": "PayChannel",
"LedgerIndex": "5DB01B7FFED6B67E6B0414DED11E051D2EE2B7619CE0EAA6286D67A3A4D5BDB3",
"NewFields": {
"Account": "rN7n7otQDd6FczFgLdSqtcsAUxDkw6fzRH",
"Amount": "100000000",
"Destination": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
"DestinationTag": 20170428,
"PublicKey": "023693F15967AE357D0327974AD46FE3C127113B1110D6044FD41E723689F81CC6",
"SettleDelay": 86400
}
{
"result": {
"Account": "rN7n7otQDd6FczFgLdSqtcsAUxDkw6fzRH",
"Amount": "100000000",
"Destination": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
...
"TransactionType": "PaymentChannelCreate",
...
"hash": "3F93C482C0BC2A1387D9E67DF60BECBB76CC2160AE98522C77AF0074D548F67D",
"inLedger": 29380080,
"ledger_index": 29380080,
"meta": {
"AffectedNodes": [
...
{
"CreatedNode": {
"LedgerEntryType": "PayChannel",
"LedgerIndex": "5DB01B7FFED6B67E6B0414DED11E051D2EE2B7619CE0EAA6286D67A3A4D5BDB3",
"NewFields": {
"Account": "rN7n7otQDd6FczFgLdSqtcsAUxDkw6fzRH",
"Amount": "100000000",
"Destination": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
"DestinationTag": 20170428,
"PublicKey": "023693F15967AE357D0327974AD46FE3C127113B1110D6044FD41E723689F81CC6",
"SettleDelay": 86400
}
},
...
],
"TransactionIndex": 16,
"TransactionResult": "tesSUCCESS"
},
"status": "success",
"validated": true
}
}
},
...
],
"TransactionIndex": 16,
"TransactionResult": "tesSUCCESS"
},
"status": "success",
"validated": true
}
}
```
In the response from the JSON-RPC, the payer should look for the following:
@@ -164,39 +172,43 @@ You can look up payment channels with the [account_channels method][], using the
Request:
POST http://localhost:5005/
Content-Type: application/json
```json
POST http://localhost:5005/
Content-Type: application/json
{
"method": "account_channels",
"params": [{
"account": "rN7n7otQDd6FczFgLdSqtcsAUxDkw6fzRH",
"destination_account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
"ledger_index": "validated"
}]
}
{
"method": "account_channels",
"params": [{
"account": "rN7n7otQDd6FczFgLdSqtcsAUxDkw6fzRH",
"destination_account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
"ledger_index": "validated"
}]
}
```
Response:
200 OK
```json
200 OK
{
"result": {
{
"result": {
"account": "rN7n7otQDd6FczFgLdSqtcsAUxDkw6fzRH",
"channels": [{
"account": "rN7n7otQDd6FczFgLdSqtcsAUxDkw6fzRH",
"channels": [{
"account": "rN7n7otQDd6FczFgLdSqtcsAUxDkw6fzRH",
"amount": "100000000",
"balance": "0",
"channel_id": "5DB01B7FFED6B67E6B0414DED11E051D2EE2B7619CE0EAA6286D67A3A4D5BDB3",
"destination_account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
"destination_tag": 20170428,
"public_key": "aB44YfzW24VDEJQ2UuLPV2PvqcPCSoLnL7y5M1EzhdW4LnK5xMS3",
"public_key_hex": "023693F15967AE357D0327974AD46FE3C127113B1110D6044FD41E723689F81CC6",
"settle_delay": 86400
}],
"status": "success"
}
"amount": "100000000",
"balance": "0",
"channel_id": "5DB01B7FFED6B67E6B0414DED11E051D2EE2B7619CE0EAA6286D67A3A4D5BDB3",
"destination_account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
"destination_tag": 20170428,
"public_key": "aB44YfzW24VDEJQ2UuLPV2PvqcPCSoLnL7y5M1EzhdW4LnK5xMS3",
"public_key_hex": "023693F15967AE357D0327974AD46FE3C127113B1110D6044FD41E723689F81CC6",
"settle_delay": 86400
}],
"status": "success"
}
}
```
The payee should check that the parameters of the payment channel are suitable for their specific use case, including all of the following:
@@ -219,26 +231,30 @@ You can create claims with the [channel_authorize method][]. The following examp
Request:
POST http://localhost:5005/
Content-Type: application/json
```json
POST http://localhost:5005/
Content-Type: application/json
{
"method": "channel_authorize",
"params": [{
"channel_id": "5DB01B7FFED6B67E6B0414DED11E051D2EE2B7619CE0EAA6286D67A3A4D5BDB3",
"secret": "s████████████████████████████",
"amount": "1000000"
}]
}
{
"method": "channel_authorize",
"params": [{
"channel_id": "5DB01B7FFED6B67E6B0414DED11E051D2EE2B7619CE0EAA6286D67A3A4D5BDB3",
"secret": "s████████████████████████████",
"amount": "1000000"
}]
}
```
Response:
{
"result": {
"signature": "304402204EF0AFB78AC23ED1C472E74F4299C0C21F1B21D07EFC0A3838A420F76D783A400220154FB11B6F54320666E4C36CA7F686C16A3A0456800BBC43746F34AF50290064",
"status": "success"
}
```json
{
"result": {
"signature": "304402204EF0AFB78AC23ED1C472E74F4299C0C21F1B21D07EFC0A3838A420F76D783A400220154FB11B6F54320666E4C36CA7F686C16A3A0456800BBC43746F34AF50290064",
"status": "success"
}
}
```
## 4. The payer sends a claim to the payee as payment for goods or services.
@@ -263,67 +279,75 @@ Example of using `channel_verify` with the JSON-RPC API:
Request:
POST http://localhost:5005/
Content-Type: application/json
```json
POST http://localhost:5005/
Content-Type: application/json
{
"method": "channel_verify",
"params": [{
"channel_id": "5DB01B7FFED6B67E6B0414DED11E051D2EE2B7619CE0EAA6286D67A3A4D5BDB3",
"signature": "304402204EF0AFB78AC23ED1C472E74F4299C0C21F1B21D07EFC0A3838A420F76D783A400220154FB11B6F54320666E4C36CA7F686C16A3A0456800BBC43746F34AF50290064",
"public_key": "aB44YfzW24VDEJQ2UuLPV2PvqcPCSoLnL7y5M1EzhdW4LnK5xMS3",
"amount": "1000000"
}]
}
{
"method": "channel_verify",
"params": [{
"channel_id": "5DB01B7FFED6B67E6B0414DED11E051D2EE2B7619CE0EAA6286D67A3A4D5BDB3",
"signature": "304402204EF0AFB78AC23ED1C472E74F4299C0C21F1B21D07EFC0A3838A420F76D783A400220154FB11B6F54320666E4C36CA7F686C16A3A0456800BBC43746F34AF50290064",
"public_key": "aB44YfzW24VDEJQ2UuLPV2PvqcPCSoLnL7y5M1EzhdW4LnK5xMS3",
"amount": "1000000"
}]
}
```
Response:
200 OK
```json
200 OK
{
"result": {
"signature_verified":true,
"status":"success"
}
{
"result": {
"signature_verified":true,
"status":"success"
}
}
```
If the response shows `"signature_verified": true` then the claim's signature is genuine. The payee must **also** confirm that the channel has enough XRP available to honor the claim. To do this, the payee uses the [account_channels method][] to confirm the most recent validated state of the payment channel.
Request:
POST http://localhost:5005/
Content-Type: application/json
```json
POST http://localhost:5005/
Content-Type: application/json
{
"method": "account_channels",
"params": [{
"account": "rN7n7otQDd6FczFgLdSqtcsAUxDkw6fzRH",
"destination_account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
"ledger_index": "validated"
}]
}
{
"method": "account_channels",
"params": [{
"account": "rN7n7otQDd6FczFgLdSqtcsAUxDkw6fzRH",
"destination_account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
"ledger_index": "validated"
}]
}
```
Response:
200 OK
```json
200 OK
{
"result": {
{
"result": {
"account": "rN7n7otQDd6FczFgLdSqtcsAUxDkw6fzRH",
"channels": [{
"account": "rN7n7otQDd6FczFgLdSqtcsAUxDkw6fzRH",
"channels": [{
"account": "rN7n7otQDd6FczFgLdSqtcsAUxDkw6fzRH",
"amount": "100000000",
"balance": "0",
"channel_id": "5DB01B7FFED6B67E6B0414DED11E051D2EE2B7619CE0EAA6286D67A3A4D5BDB3",
"destination_account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
"destination_tag": 20170428,
"public_key": "aB44YfzW24VDEJQ2UuLPV2PvqcPCSoLnL7y5M1EzhdW4LnK5xMS3",
"public_key_hex": "023693F15967AE357D0327974AD46FE3C127113B1110D6044FD41E723689F81CC6",
"settle_delay": 86400
}],
"status": "success"
}
"amount": "100000000",
"balance": "0",
"channel_id": "5DB01B7FFED6B67E6B0414DED11E051D2EE2B7619CE0EAA6286D67A3A4D5BDB3",
"destination_account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
"destination_tag": 20170428,
"public_key": "aB44YfzW24VDEJQ2UuLPV2PvqcPCSoLnL7y5M1EzhdW4LnK5xMS3",
"public_key_hex": "023693F15967AE357D0327974AD46FE3C127113B1110D6044FD41E723689F81CC6",
"settle_delay": 86400
}],
"status": "success"
}
}
```
The payee should check the following:
@@ -369,54 +393,58 @@ Example of claiming XRP from a channel:
Request:
POST http://localhost:5005/
Content-Type: application/json
```json
POST http://localhost:5005/
Content-Type: application/json
{
"method": "submit",
"params": [{
"secret": "s████████████████████████████",
"tx_json": {
"Account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
"TransactionType": "PaymentChannelClaim",
"Amount": "1000000",
"Balance": "1000000",
"Channel": "5DB01B7FFED6B67E6B0414DED11E051D2EE2B7619CE0EAA6286D67A3A4D5BDB3",
"PublicKey": "023693F15967AE357D0327974AD46FE3C127113B1110D6044FD41E723689F81CC6",
"Signature": "304402204EF0AFB78AC23ED1C472E74F4299C0C21F1B21D07EFC0A3838A420F76D783A400220154FB11B6F54320666E4C36CA7F686C16A3A0456800BBC43746F34AF50290064"
},
"fee_mult_max": 1000
}]
}
Response:
200 OK
{
"result": {
"engine_result": "tesSUCCESS",
"engine_result_code": 0,
"engine_result_message": "The transaction was applied. Only final in a validated ledger.",
"status": "success",
"tx_blob": "12000F2280000000240000017450165DB01B7FFED6B67E6B0414DED11E051D2EE2B7619CE0EAA6286D67A3A4D5BDB36140000000000F42406240000000000F424068400000000000000A7121023693F15967AE357D0327974AD46FE3C127113B1110D6044FD41E723689F81CC6732103AB40A0490F9B7ED8DF29D246BF2D6269820A0EE7742ACDD457BEA7C7D0931EDB7447304502210096B933BC24DA77D8C4057B4780B282BA66C668DFE1ACF4EEC063AD6661725797022037C8823669CE91AACA8CC754C9F041359F85B0B32384AEA141EBC3603798A24C7646304402204EF0AFB78AC23ED1C472E74F4299C0C21F1B21D07EFC0A3838A420F76D783A400220154FB11B6F54320666E4C36CA7F686C16A3A0456800BBC43746F34AF5029006481144B4E9C06F24296074F7BC48F92A97916C6DC5EA9",
{
"method": "submit",
"params": [{
"secret": "s████████████████████████████",
"tx_json": {
"Account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
"TransactionType": "PaymentChannelClaim",
"Amount": "1000000",
"Balance": "1000000",
"Channel": "5DB01B7FFED6B67E6B0414DED11E051D2EE2B7619CE0EAA6286D67A3A4D5BDB3",
"Fee": "10",
"Flags": 2147483648,
"PublicKey": "023693F15967AE357D0327974AD46FE3C127113B1110D6044FD41E723689F81CC6",
"Sequence": 372,
"Signature": "304402204EF0AFB78AC23ED1C472E74F4299C0C21F1B21D07EFC0A3838A420F76D783A400220154FB11B6F54320666E4C36CA7F686C16A3A0456800BBC43746F34AF50290064",
"SigningPubKey": "03AB40A0490F9B7ED8DF29D246BF2D6269820A0EE7742ACDD457BEA7C7D0931EDB",
"TransactionType": "PaymentChannelClaim",
"TxnSignature": "304502210096B933BC24DA77D8C4057B4780B282BA66C668DFE1ACF4EEC063AD6661725797022037C8823669CE91AACA8CC754C9F041359F85B0B32384AEA141EBC3603798A24C",
"hash": "C9FE08FC88CF76C3B06622ADAA47AE99CABB3380E4D195E7751274CFD87910EB"
}
"Signature": "304402204EF0AFB78AC23ED1C472E74F4299C0C21F1B21D07EFC0A3838A420F76D783A400220154FB11B6F54320666E4C36CA7F686C16A3A0456800BBC43746F34AF50290064"
},
"fee_mult_max": 1000
}]
}
```
Response:
```json
200 OK
{
"result": {
"engine_result": "tesSUCCESS",
"engine_result_code": 0,
"engine_result_message": "The transaction was applied. Only final in a validated ledger.",
"status": "success",
"tx_blob": "12000F2280000000240000017450165DB01B7FFED6B67E6B0414DED11E051D2EE2B7619CE0EAA6286D67A3A4D5BDB36140000000000F42406240000000000F424068400000000000000A7121023693F15967AE357D0327974AD46FE3C127113B1110D6044FD41E723689F81CC6732103AB40A0490F9B7ED8DF29D246BF2D6269820A0EE7742ACDD457BEA7C7D0931EDB7447304502210096B933BC24DA77D8C4057B4780B282BA66C668DFE1ACF4EEC063AD6661725797022037C8823669CE91AACA8CC754C9F041359F85B0B32384AEA141EBC3603798A24C7646304402204EF0AFB78AC23ED1C472E74F4299C0C21F1B21D07EFC0A3838A420F76D783A400220154FB11B6F54320666E4C36CA7F686C16A3A0456800BBC43746F34AF5029006481144B4E9C06F24296074F7BC48F92A97916C6DC5EA9",
"tx_json": {
"Account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
"Amount": "1000000",
"Balance": "1000000",
"Channel": "5DB01B7FFED6B67E6B0414DED11E051D2EE2B7619CE0EAA6286D67A3A4D5BDB3",
"Fee": "10",
"Flags": 2147483648,
"PublicKey": "023693F15967AE357D0327974AD46FE3C127113B1110D6044FD41E723689F81CC6",
"Sequence": 372,
"Signature": "304402204EF0AFB78AC23ED1C472E74F4299C0C21F1B21D07EFC0A3838A420F76D783A400220154FB11B6F54320666E4C36CA7F686C16A3A0456800BBC43746F34AF50290064",
"SigningPubKey": "03AB40A0490F9B7ED8DF29D246BF2D6269820A0EE7742ACDD457BEA7C7D0931EDB",
"TransactionType": "PaymentChannelClaim",
"TxnSignature": "304502210096B933BC24DA77D8C4057B4780B282BA66C668DFE1ACF4EEC063AD6661725797022037C8823669CE91AACA8CC754C9F041359F85B0B32384AEA141EBC3603798A24C",
"hash": "C9FE08FC88CF76C3B06622ADAA47AE99CABB3380E4D195E7751274CFD87910EB"
}
}
}
```
The payee should confirm that this transaction is successful in a validated ledger. For the full details, see [Reliable Transaction Submission](reliable-transaction-submission.html).
@@ -434,44 +462,48 @@ The payee can also close a payment channel immediately after processing a claim
Example of [submitting a transaction](submit.html#sign-and-submit-mode) requesting a channel to close:
{
"method": "submit",
"params": [{
"secret": "s████████████████████████████",
"tx_json": {
"Account": "rN7n7otQDd6FczFgLdSqtcsAUxDkw6fzRH",
"TransactionType": "PaymentChannelClaim",
"Channel": "5DB01B7FFED6B67E6B0414DED11E051D2EE2B7619CE0EAA6286D67A3A4D5BDB3",
"Flags": 2147614720
},
"fee_mult_max": 1000
}]
}
```json
{
"method": "submit",
"params": [{
"secret": "s████████████████████████████",
"tx_json": {
"Account": "rN7n7otQDd6FczFgLdSqtcsAUxDkw6fzRH",
"TransactionType": "PaymentChannelClaim",
"Channel": "5DB01B7FFED6B67E6B0414DED11E051D2EE2B7619CE0EAA6286D67A3A4D5BDB3",
"Flags": 2147614720
},
"fee_mult_max": 1000
}]
}
```
After the transaction is included in a validated ledger, either party can look up the currently-scheduled expiration of the channel using the [account_channels method][]. Be sure to specify `"ledger_index": "validated"` to get data from the latest validated ledger version.
Example `account_channels` response:
{
"result": {
"account": "rN7n7otQDd6FczFgLdSqtcsAUxDkw6fzRH",
"channels": [
{
"account": "rN7n7otQDd6FczFgLdSqtcsAUxDkw6fzRH",
"amount": "100000000",
"balance": "1000000",
"channel_id": "5DB01B7FFED6B67E6B0414DED11E051D2EE2B7619CE0EAA6286D67A3A4D5BDB3",
"destination_account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
"destination_tag": 20170428,
"expiration": 547073182,
"public_key": "aB44YfzW24VDEJQ2UuLPV2PvqcPCSoLnL7y5M1EzhdW4LnK5xMS3",
"public_key_hex": "023693F15967AE357D0327974AD46FE3C127113B1110D6044FD41E723689F81CC6",
"settle_delay": 86400
}
],
"status": "success"
}
```json
{
"result": {
"account": "rN7n7otQDd6FczFgLdSqtcsAUxDkw6fzRH",
"channels": [
{
"account": "rN7n7otQDd6FczFgLdSqtcsAUxDkw6fzRH",
"amount": "100000000",
"balance": "1000000",
"channel_id": "5DB01B7FFED6B67E6B0414DED11E051D2EE2B7619CE0EAA6286D67A3A4D5BDB3",
"destination_account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
"destination_tag": 20170428,
"expiration": 547073182,
"public_key": "aB44YfzW24VDEJQ2UuLPV2PvqcPCSoLnL7y5M1EzhdW4LnK5xMS3",
"public_key_hex": "023693F15967AE357D0327974AD46FE3C127113B1110D6044FD41E723689F81CC6",
"settle_delay": 86400
}
],
"status": "success"
}
}
```
In this example, the `expiration` value 547073182 in [seconds since the Ripple Epoch][] maps to `2017-05-02T20:46:22Z`, so any claims not redeemed by that time are no longer valid.
@@ -487,107 +519,111 @@ The command to submit the transaction is the same as the previous example reques
Example of [submitting](submit.html#sign-and-submit-mode) a transaction to close an expired channel:
{
"method": "submit",
"params": [{
"secret": "s████████████████████████████",
"tx_json": {
"Account": "rN7n7otQDd6FczFgLdSqtcsAUxDkw6fzRH",
"TransactionType": "PaymentChannelClaim",
"Channel": "5DB01B7FFED6B67E6B0414DED11E051D2EE2B7619CE0EAA6286D67A3A4D5BDB3",
"Flags": 2147614720
},
"fee_mult_max": 1000
}]
}
```json
{
"method": "submit",
"params": [{
"secret": "s████████████████████████████",
"tx_json": {
"Account": "rN7n7otQDd6FczFgLdSqtcsAUxDkw6fzRH",
"TransactionType": "PaymentChannelClaim",
"Channel": "5DB01B7FFED6B67E6B0414DED11E051D2EE2B7619CE0EAA6286D67A3A4D5BDB3",
"Flags": 2147614720
},
"fee_mult_max": 1000
}]
}
```
When the transaction has been included in a validated ledger, you can look at the metadata of the transaction to confirm that it deleted the channel and returned the XRP to the sender.
Example response from using the [tx method][] to look up the transaction from this step:
{
"result": {
"Account": "rN7n7otQDd6FczFgLdSqtcsAUxDkw6fzRH",
"Channel": "5DB01B7FFED6B67E6B0414DED11E051D2EE2B7619CE0EAA6286D67A3A4D5BDB3",
"Fee": "5606",
"Flags": 2147614720,
"Sequence": 41,
"SigningPubKey": "023693F15967AE357D0327974AD46FE3C127113B1110D6044FD41E723689F81CC6",
"TransactionType": "PaymentChannelClaim",
"TxnSignature": "3044022008922FEB6F7D35D42006685BCBB007103D2A40AFAA69A7CFC10DF529F94BB6A402205D67816F50BBAEE0A2709AA3A93707304EC21133550FD2FF7436AD0C3CA6CE27",
"date": 547091262,
"hash": "9C0CAAC3DD1A74461132DA4451F9E53BDF4C93DFDBEFCE1B10021EC569013B33",
"inLedger": 29480670,
"ledger_index": 29480670,
"meta": {
"AffectedNodes": [
{
"ModifiedNode": {
"LedgerEntryType": "AccountRoot",
"LedgerIndex": "13F1A95D7AAB7108D5CE7EEAF504B2894B8C674E6D68499076441C4837282BF8",
"PreviousTxnID": "C9FE08FC88CF76C3B06622ADAA47AE99CABB3380E4D195E7751274CFD87910EB",
"PreviousTxnLgrSeq": 29385089
}
},
{
"DeletedNode": {
"FinalFields": {
"Account": "rN7n7otQDd6FczFgLdSqtcsAUxDkw6fzRH",
"Amount": "100000000",
"Balance": "1000000",
"Destination": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
"DestinationTag": 20170428,
"Expiration": 547073182,
"Flags": 0,
"OwnerNode": "0000000000000000",
"PreviousTxnID": "C5C70B2BCC515165B7F62ACC8126F8F8B655EB6E1D949A49B2358262BDA986B4",
"PreviousTxnLgrSeq": 29451256,
"PublicKey": "023693F15967AE357D0327974AD46FE3C127113B1110D6044FD41E723689F81CC6",
"SettleDelay": 86400
},
"LedgerEntryType": "PayChannel",
"LedgerIndex": "5DB01B7FFED6B67E6B0414DED11E051D2EE2B7619CE0EAA6286D67A3A4D5BDB3"
}
},
{
"ModifiedNode": {
"FinalFields": {
"Account": "rN7n7otQDd6FczFgLdSqtcsAUxDkw6fzRH",
"Balance": "1041862844",
"Flags": 0,
"OwnerCount": 2,
"Sequence": 42
},
"LedgerEntryType": "AccountRoot",
"LedgerIndex": "B1CB040A17F9469BC00376EC8719535655824AD16CB5F539DD5765FEA88FDBE3",
"PreviousFields": {
"Balance": "942868450",
"OwnerCount": 3,
"Sequence": 41
},
"PreviousTxnID": "C5C70B2BCC515165B7F62ACC8126F8F8B655EB6E1D949A49B2358262BDA986B4",
"PreviousTxnLgrSeq": 29451256
}
},
{
"ModifiedNode": {
"FinalFields": {
"Flags": 0,
"Owner": "rN7n7otQDd6FczFgLdSqtcsAUxDkw6fzRH",
"RootIndex": "E590FC40B4F24D18341569BD3702A2D4E07E7BC04D11CE63608B67979E67030C"
},
"LedgerEntryType": "DirectoryNode",
"LedgerIndex": "E590FC40B4F24D18341569BD3702A2D4E07E7BC04D11CE63608B67979E67030C"
}
```json
{
"result": {
"Account": "rN7n7otQDd6FczFgLdSqtcsAUxDkw6fzRH",
"Channel": "5DB01B7FFED6B67E6B0414DED11E051D2EE2B7619CE0EAA6286D67A3A4D5BDB3",
"Fee": "5606",
"Flags": 2147614720,
"Sequence": 41,
"SigningPubKey": "023693F15967AE357D0327974AD46FE3C127113B1110D6044FD41E723689F81CC6",
"TransactionType": "PaymentChannelClaim",
"TxnSignature": "3044022008922FEB6F7D35D42006685BCBB007103D2A40AFAA69A7CFC10DF529F94BB6A402205D67816F50BBAEE0A2709AA3A93707304EC21133550FD2FF7436AD0C3CA6CE27",
"date": 547091262,
"hash": "9C0CAAC3DD1A74461132DA4451F9E53BDF4C93DFDBEFCE1B10021EC569013B33",
"inLedger": 29480670,
"ledger_index": 29480670,
"meta": {
"AffectedNodes": [
{
"ModifiedNode": {
"LedgerEntryType": "AccountRoot",
"LedgerIndex": "13F1A95D7AAB7108D5CE7EEAF504B2894B8C674E6D68499076441C4837282BF8",
"PreviousTxnID": "C9FE08FC88CF76C3B06622ADAA47AE99CABB3380E4D195E7751274CFD87910EB",
"PreviousTxnLgrSeq": 29385089
}
],
"TransactionIndex": 7,
"TransactionResult": "tesSUCCESS"
},
"status": "success",
"validated": true
}
},
{
"DeletedNode": {
"FinalFields": {
"Account": "rN7n7otQDd6FczFgLdSqtcsAUxDkw6fzRH",
"Amount": "100000000",
"Balance": "1000000",
"Destination": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
"DestinationTag": 20170428,
"Expiration": 547073182,
"Flags": 0,
"OwnerNode": "0000000000000000",
"PreviousTxnID": "C5C70B2BCC515165B7F62ACC8126F8F8B655EB6E1D949A49B2358262BDA986B4",
"PreviousTxnLgrSeq": 29451256,
"PublicKey": "023693F15967AE357D0327974AD46FE3C127113B1110D6044FD41E723689F81CC6",
"SettleDelay": 86400
},
"LedgerEntryType": "PayChannel",
"LedgerIndex": "5DB01B7FFED6B67E6B0414DED11E051D2EE2B7619CE0EAA6286D67A3A4D5BDB3"
}
},
{
"ModifiedNode": {
"FinalFields": {
"Account": "rN7n7otQDd6FczFgLdSqtcsAUxDkw6fzRH",
"Balance": "1041862844",
"Flags": 0,
"OwnerCount": 2,
"Sequence": 42
},
"LedgerEntryType": "AccountRoot",
"LedgerIndex": "B1CB040A17F9469BC00376EC8719535655824AD16CB5F539DD5765FEA88FDBE3",
"PreviousFields": {
"Balance": "942868450",
"OwnerCount": 3,
"Sequence": 41
},
"PreviousTxnID": "C5C70B2BCC515165B7F62ACC8126F8F8B655EB6E1D949A49B2358262BDA986B4",
"PreviousTxnLgrSeq": 29451256
}
},
{
"ModifiedNode": {
"FinalFields": {
"Flags": 0,
"Owner": "rN7n7otQDd6FczFgLdSqtcsAUxDkw6fzRH",
"RootIndex": "E590FC40B4F24D18341569BD3702A2D4E07E7BC04D11CE63608B67979E67030C"
},
"LedgerEntryType": "DirectoryNode",
"LedgerIndex": "E590FC40B4F24D18341569BD3702A2D4E07E7BC04D11CE63608B67979E67030C"
}
}
],
"TransactionIndex": 7,
"TransactionResult": "tesSUCCESS"
},
"status": "success",
"validated": true
}
}
```
In the transaction's metadata, look for the following:

View File

@@ -135,21 +135,21 @@ For each persisted transaction without validated result:
- 失敗のケース1では、トランザクションはレジャーに含まれ、[XRPトランザクションコスト](transaction-cost.html)は消却されましたが、それ以外には何も起こりませんでした。この原因としては、流動性の欠如、適切でない[パス](paths.html)、またはその他の状況が考えられます。多くの場合、このような失敗の場合には、同様のトランザクションをすぐに試すと同じ結果が出ることが多いです。状況が変わるのを待ってから送信すると、別の結果が得られることがあります。
- 失敗のケース2では、トランザクションは検証済みレジャーには含まれないため、何も起こらず、トランザクションコストも消却されませんでした。これは、XRP Ledgerの現在の負荷に対してトランザクションコストが低すぎる、`LastLedgerSequence`が早すぎる、または不安定なネットワーク接続などの状況が原因である可能性があります。
- 失敗のケース1と異なり、このケースでは`LastLedgerSequence`のみを変更(または`Fee`も変更)するだけで、新しいトランザクションが成功する可能性があります。元のトランザクションと同じ`Sequence`番号を使用します。
- また、トランザクションが成功しないのはレジャーのステータスが原因である可能性もあります。例えば、トランザクションに署名するために使用されたキーペアが送信アドレスで無効になっている場合などです。トランザクションの暫定的な結果が[`tef`-class code](tef-codes.html)の場合には、修正をしない限りそのトランザクションが成功する可能性は低くなります。
- 失敗のケース3は、予期しない状態を表します。トランザクションが未処理の場合、最新の検証済みレジャーにある送信元アカウントの`Sequence`番号を確認する必要があります。([account_infoメソッド][]を使用して確認できます。)最新の検証済みレジャーにあるアカウントの`Sequence`値がトランザクションの`Sequence`値より大きい場合、同じ`Sequence`値を持つ別のトランザクションが検証済みレジャーに含まれています。システムがこの別のトランザクションを認識していない場合、予期しない状態となり、その原因が特定されるまで処理を停止しなければならなくなります。そうしないと、システムが同じ目標を達成するために複数のトランザクションを送信する可能性があります。行う必要のある手順は、具体的な原因によって変わります。考えられる原因と手順は次のとおりです。
- 前回送信したトランザクションに[展性](transaction-malleability.html)があり、実際に検証済みレジャーに含まれていたが、予想と異なるハッシュだった場合。この問題は、`tfFullyCanonicalSig`フラグが含まれないフラグのセットを指定した場合か、必要以上の署名者によってマルチ署名されたトランザクションであった場合に起こる可能性があります。これに該当する場合は、その異なるハッシュとトランザクションの最終結果を保存し、通常のアクティビティーを再開します。
- トランザクションを[キャンセル](cancel-or-skip-a-transaction.html)して置き換えたため、置き換え後のトランザクションが代わりに処理された場合。障害から復旧しようとしている場合、置き換え後のトランザクションでレコードが失われている可能性があります。その場合、当初確認していたトランザクションは恒久的に失敗し、置き換え後のトランザクションの最終結果が検証済みレジャーバージョンに記録されます。両方の最終結果を保存し、他に欠落したトランザクションや置き換えられたトランザクションがないか確認してから、通常のアクティビティーを再開します。
- アクティブ/パッシブフェイルオーバー構成で、トランザクション送信側のシステムが2台以上あり、パッシブシステムがアクティブシステムで障害が発生したと誤って認識してアクティブになったが、元のアクティブシステムも引き続きトランザクションを送信していた場合。システム間の接続をチェックして、そのうちの1台だけがアクティブであることを確認します。アカウントのトランザクション履歴を確認し[account_txメソッド][]を使用するなど)、検証済みレジャーに含まれていたすべてのトランザクションの最終結果を記録します。`Sequence`番号が同じ別のトランザクションはすべて完全に失敗しています。それらの最終結果も保存します。すべてのシステムの差異の調整を行い、システムが同時にアクティブになった原因となる問題を解決したら、通常のアクティビティーを再開します。
**ヒント:** [`AccountTxnID`フィールド](transaction-common-fields.html#accounttxnid)を使用すると、このような状況で冗長的なトランザクションが成功しないように防ぐことができます。
- 不正使用者に秘密鍵を使われてトランザクションを送信された場合。その場合は、可能であれば[キーペアをローテーション](change-or-remove-a-regular-key-pair.html)して、送信された他のトランザクションを確認します。また、ネットワークを監査して、その秘密鍵が大規模な侵入やセキュリティ侵害に関係していたかどうかを判断する必要があります。キーペアのローテーションに成功して、不正使用者がアカウントやシステムにアクセスできなくなったら、通常のアクティビティーを再開します。
#### レジャーのギャップ
@@ -189,7 +189,7 @@ For each persisted transaction without validated result:
JSON-RPC要求:
```
```json
{
"method": "account_info",
"params": [
@@ -203,7 +203,7 @@ JSON-RPC要求:
応答の本文:
```
```json
{
"result": {
"validated": true,
@@ -234,7 +234,7 @@ JSON-RPC要求:
要求:
```
```json
{
"id": "client id 1",
"method": "server_state"
@@ -243,7 +243,7 @@ JSON-RPC要求:
応答:
```
```json
{
"result": {
"status": "success",
@@ -284,13 +284,13 @@ JSON-RPC要求:
要求:
```
```json
{
"method": "sign",
"params": [
{
"offline": true,
"secret": "sssssssssssssssssssssssssssss",
"secret": "s████████████████████████████",
"tx_json": {
"Account": "rG5Ro9e3uGEZVCh3zu5gB9ydKUskCs221W",
"Sequence": 4,
@@ -315,7 +315,7 @@ JSON-RPC要求:
応答:
```
```json
{
"result": {
"tx_json": {
@@ -349,7 +349,7 @@ JSON-RPC要求:
要求:
```
```json
{
"method": "submit",
"params": [
@@ -362,7 +362,7 @@ JSON-RPC要求:
応答:
```
```json
{
"result": {
"tx_json": {
@@ -399,7 +399,7 @@ JSON-RPC要求:
要求:
```
```json
{
"method": "tx",
"params": [
@@ -413,7 +413,7 @@ JSON-RPC要求:
応答:
```
```json
{
"result": {
"validated": true,
@@ -453,7 +453,7 @@ JSON-RPC要求:
[txメソッド][]への呼び出しに`txnNotFound`エラーが返された場合には、アプリケーションで対処する必要があります。
```
```json
{
"result": {
"status": "error",
@@ -473,7 +473,7 @@ JSON-RPC要求:
[server_stateメソッド][](最後の検証済みレジャーを判断するために先に使用する)は、`result.state.complete_ledgers`のもとにレジャー履歴が完全かどうかを示します。
```
```json
{
"result": {
"status": "success",

View File

@@ -205,7 +205,7 @@ How the application does these actions depends on the API the application uses.
JSON-RPC Request:
```
```json
{
"method": "account_info",
"params": [
@@ -219,7 +219,7 @@ JSON-RPC Request:
Response body:
```
```json
{
"result": {
"validated": true,
@@ -251,7 +251,7 @@ The [server_state method][] returns the ledger index of the last validated ledge
Request:
```
```json
{
"id": "client id 1",
"method": "server_state"
@@ -260,7 +260,7 @@ Request:
Response:
```
```json
{
"result": {
"status": "success",
@@ -302,13 +302,13 @@ In this example the last validated ledger index is 10268596 (found under `result
Request:
```
```json
{
"method": "sign",
"params": [
{
"offline": true,
"secret": "sssssssssssssssssssssssssssss",
"secret": "s████████████████████████████",
"tx_json": {
"Account": "rG5Ro9e3uGEZVCh3zu5gB9ydKUskCs221W",
"Sequence": 4,
@@ -333,7 +333,7 @@ Notice also the `LastLedgerSequence` based on the last validated ledger our appl
Response:
```
```json
{
"result": {
"tx_json": {
@@ -369,7 +369,7 @@ Applications should persist the transaction's hash before submitting. The resul
Request:
```
```json
{
"method": "submit",
"params": [
@@ -382,7 +382,7 @@ Request:
Response:
```
```json
{
"result": {
"tx_json": {
@@ -420,7 +420,7 @@ The transaction hash, generated when the transaction was signed, is passed to th
Request:
```
```json
{
"method": "tx",
"params": [
@@ -434,7 +434,7 @@ Request:
Response:
```
```json
{
"result": {
"validated": true,
@@ -475,7 +475,7 @@ If the response does not include `"validated": true`, the result is provisional
Applications must handle cases where a call to the [tx method][] returns a `txnNotFound` error.
```
```json
{
"result": {
"status": "error",
@@ -495,7 +495,7 @@ The `txnNotFound` result code occurs in cases where the transaction is not inclu
The [server_state method][] (used earlier to determine the last validated ledger) indicates how complete the ledger history is, under `result.state.complete_ledgers`.
```
```json
{
"result": {
"status": "success",

View File

@@ -17,19 +17,21 @@ Keep in mind that the `Fee` for multi-signed transactions is significantly highe
Here's an example transaction ready to be multi-signed:
{
"TransactionType": "TrustSet",
"Account": "rEuLyBCvcw4CFmzv8RepSiAoNgF8tTGJQC",
"Flags": 262144,
"LimitAmount": {
"currency": "USD",
"issuer": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
"value": "100"
},
"Sequence": 2,
"SigningPubKey": "",
"Fee": "30000"
}
```json
{
"TransactionType": "TrustSet",
"Account": "rEuLyBCvcw4CFmzv8RepSiAoNgF8tTGJQC",
"Flags": 262144,
"LimitAmount": {
"currency": "USD",
"issuer": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
"value": "100"
},
"Sequence": 2,
"SigningPubKey": "",
"Fee": "30000"
}
```
(This transaction creates an accounting relationship from `rEuLyBCvcw4CFmzv8RepSiAoNgF8tTGJQC` to `rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh` with a maximum balance of 100 USD.)