mirror of
https://github.com/XRPLF/xrpl-dev-portal.git
synced 2025-11-21 12:15:50 +00:00
Update more RippleAPI mentions
This commit is contained in:
@@ -32,7 +32,7 @@ XRP Ledgerの中心であるピアツーピアネットワークは、コンセ
|
||||
|
||||
プログラミングライブラリーは、XRP Ledgerデータにアクセスするために必ずしも必要なわけではありません。HTTPまたはWebSocketを使用すれば、[`rippled` API](rippled-api.html)に直接接続できるためです。ライブラリーは、`rippled` APIにアクセスする際の一般的な作業の一部を簡素化し、データをライブラリー内のプログラミング言語で理解しやすく、かつプログラミングしやすい形式に変換します。
|
||||
|
||||
[JavaScript用のxrpl.js](get-started-with-rippleapi-for-javascript.html)は、長年にわたって使用され、かつ十分なサポートがある、XRP Ledgerにアクセスするためのライブラリーです。多くの[ミドルウェアサービス](#ミドルウェア)が、このような[プログラミングライブラリー](client-libraries.html)を内部で使用しています。
|
||||
[JavaScript用のxrpl.js](get-started-using-javascript.html)は、長年にわたって使用され、かつ十分なサポートがある、XRP Ledgerにアクセスするためのライブラリーです。多くの[ミドルウェアサービス](#ミドルウェア)が、このような[プログラミングライブラリー](client-libraries.html)を内部で使用しています。
|
||||
|
||||
### ミドルウェア
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ This server exposes [`rippled` APIs](rippled-api.html) for users to look up data
|
||||
|
||||
[Programming libraries](client-libraries.html) are not strictly required to access XRP Ledger data, since you can use HTTP or WebSocket to connect to the [`rippled` APIs](rippled-api.html) directly. Libraries simplify some of the common work of accessing the `rippled` APIs, and convert the data into forms that are easier to understand and program with in the programming language of the library.
|
||||
|
||||
[xrpl.js for JavaScript](get-started-with-rippleapi-for-javascript.html) (formerly called "ripple-lib") is the longest-standing, most well-supported library for accessing the XRP Ledger. Many [middleware services](#middleware) use programming libraries like this internally.
|
||||
[xrpl.js for JavaScript](get-started-using-javascript.html) (formerly called "ripple-lib") is the longest-standing, most well-supported library for accessing the XRP Ledger. Many [middleware services](#middleware) use programming libraries like this internally.
|
||||
|
||||
### Middleware
|
||||
|
||||
|
||||
@@ -83,347 +83,7 @@ No Freeze設定は、アドレスに対して発行される通貨と、アド
|
||||
No Freeze設定は、アドレスのマスターキーのシークレットキーにより署名されたトランザクションでのみ有効にできます。[レギュラーキー](setregularkey.html)または[マルチ署名済みトランザクション](multi-signing.html)を使用してNo Freezeを有効にすることはできません。
|
||||
|
||||
|
||||
# 技術詳細
|
||||
|
||||
## Individual Freezeの有効化または無効化
|
||||
|
||||
### 使用する`rippled`
|
||||
|
||||
特定のトラストラインに対するIndividual Freezeを有効または無効にするには、`TrustSet`トランザクションを送信します。Freezeを有効にするには[`tfSetFreeze`フラグ](trustset.html#trustsetのフラグ)を使用し、無効にするには`tfClearFreeze`フラグを使用します。トランザクションのフィールドは次のとおりです。
|
||||
|
||||
| フィールド | 値 | 説明 |
|
||||
|----------------------|--------|-------------|
|
||||
| Account | 文字列 | Freezeを有効または無効にするXRP Ledgerアドレス。 |
|
||||
| TransactionType | 文字列 | `TrustSet` |
|
||||
| LimitAmount | オブジェクト | 凍結するトラストラインを定義するオブジェクト。 |
|
||||
| LimitAmount.currency | 文字列 | トラストラインの通貨(XRPは指定できません) |
|
||||
| LimitAmount.issuer | 文字列 | 凍結する取引相手のXRP Ledgerアドレス |
|
||||
| LimitAmount.value | 文字列 | この取引相手があなたに対して発行する通貨の数量として信頼できる数量を、引用符で囲んで指定します。金融機関の観点からは、通常これは`"0"`となります。 |
|
||||
| Flags | 数値 | 凍結を有効にするには、ビット`0x00100000`(tfSetFreeze)が有効な値を使用します。凍結を無効にするには、ビット`0x00200000`(tfClearFreeze)が有効な値を使用します。 |
|
||||
|
||||
`Fee`、`Sequence`、`LastLedgerSequence`パラメーターは[通常の方法で](transaction-basics.html#トランザクションへの署名とトランザクションの送信)設定します。
|
||||
|
||||
[WebSocket API](get-started-using-http-websocket-apis.html#websocket-api)を使用してIndividual Freezeを有効にするTrustSetトランザクションを送信する例:
|
||||
|
||||
```json
|
||||
{
|
||||
"id": 12,
|
||||
"command": "submit",
|
||||
"tx_json": {
|
||||
"TransactionType": "TrustSet",
|
||||
"Account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
|
||||
"Fee": "12000",
|
||||
"Flags": 1048576,
|
||||
"LastLedgerSequence": 18103014,
|
||||
"LimitAmount": {
|
||||
"currency": "USD",
|
||||
"issuer": "rsA2LpzuawewSBQXkiju3YQTMzW13pAAdW",
|
||||
"value": "110"
|
||||
},
|
||||
"Sequence": 340
|
||||
},
|
||||
"secret": "s████████████████████████████",
|
||||
"offline": false,
|
||||
"fee_mult_max": 1000
|
||||
}
|
||||
```
|
||||
|
||||
**注意:** シークレットキーを信頼できないサーバーに送信することや、安全ではないチャネル経由で送信することは避けてください。
|
||||
|
||||
|
||||
### RippleAPIを使用する
|
||||
|
||||
特定のトラストラインに対するIndividual Freezeを有効または無効にするには、[prepareTrustline](rippleapi-reference.html#preparetrustline)メソッドを使用して *Trustline* トランザクションを準備します。`trustline`パラメーターのフィールドは次のように設定してください:
|
||||
|
||||
| フィールド | 値 | 説明 |
|
||||
|--------------|--------|-------------|
|
||||
| currency | 文字列 | 凍結するトラストラインの[通貨](rippleapi-reference.html#currency)(XRPは指定できません) |
|
||||
| counterparty | 文字列 | 取引相手の[XRP Ledgerアドレス](rippleapi-reference.html#address) |
|
||||
| limit | 文字列 | この取引相手があなたに対して発行する通貨の数量として信頼できる数量を、引用符で囲んで指定します。金融機関の観点からは、通常これは`"0"`となります。 |
|
||||
| frozen | ブール値 | `true` このトラストラインのIndividual Freezeを有効にします。`false`Individual Freezeを無効にします。 |
|
||||
|
||||
残りの[トランザクションフロー](rippleapi-reference.html#transaction-flow)は他のトランザクションと同じです。
|
||||
|
||||
トラストラインのIndividual Freezeを有効にするJavaScript(ECMAScript 6)コードの例:
|
||||
|
||||
```js
|
||||
{% include '_code-samples/freeze/set-individual-freeze.js' %}
|
||||
```
|
||||
|
||||
|
||||
## Global Freezeの有効化または無効化
|
||||
|
||||
### 使用する`rippled`
|
||||
|
||||
アドレスに対してGlobal Freezeを有効にするには、`SetFlag`フィールドに[asfGlobalFreezeフラグ値](accountset.html#accountsetのフラグ)を指定した`AccountSet`トランザクションを送信します。Global Freezeを無効にするには、`ClearFlag`フィールドにasfGlobalFreezeフラグ値を指定します。
|
||||
|
||||
[WebSocket API](get-started-using-http-websocket-apis.html#websocket-api)を使用してGlobal Freezeを有効にするAccountSetトランザクションを送信する例:
|
||||
|
||||
```json
|
||||
{
|
||||
"id": 12,
|
||||
"command": "submit",
|
||||
"tx_json": {
|
||||
"TransactionType": "AccountSet",
|
||||
"Account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
|
||||
"Fee": "12000",
|
||||
"Flags": 0,
|
||||
"SetFlag": 7,
|
||||
"LastLedgerSequence": 18122753,
|
||||
"Sequence": 349
|
||||
},
|
||||
"secret": "s████████████████████████████",
|
||||
"offline": false,
|
||||
"fee_mult_max": 1000
|
||||
}
|
||||
```
|
||||
|
||||
**注意:** シークレットキーを信頼できないサーバーに送信することや、安全ではないチャネル経由で送信することは避けてください。
|
||||
|
||||
|
||||
### RippleAPIを使用する
|
||||
|
||||
アドレスに対してGlobal Freezeを有効または無効にするには、[prepareSettings](rippleapi-reference.html#preparesettings)メソッドを使用して**Settings**トランザクションを準備します。`settings`パラメーターは、次のように設定されているオブジェクトです:
|
||||
|
||||
| フィールド | 値 | 説明 |
|
||||
|--------------|--------|-------------|
|
||||
| globalFreeze | ブール値 | `true` このアドレスに対してGlobal Freezeを有効にします。`false`Global Freezeを無効にします。 |
|
||||
|
||||
残りの[トランザクションフロー](rippleapi-reference.html#transaction-flow)は他のトランザクションと同じです。
|
||||
|
||||
アドレスに対してGlobal Freezeを有効にするJavaScript(ECMAScript 6)コードの例:
|
||||
|
||||
```js
|
||||
{% include '_code-samples/freeze/set-global-freeze.js' %}
|
||||
```
|
||||
|
||||
|
||||
|
||||
## No Freezeの有効化
|
||||
|
||||
### 使用する`rippled`
|
||||
|
||||
アドレスに対してNo Freezeを有効にするには、`SetFlag`フィールドに[asfNoFreezeフラグ値](accountset.html#accountsetのフラグ)を指定した`AccountSet`トランザクションを送信します。このトランザクションをマスターキーで署名する必要があります。有効にしたNo Freezeを無効にすることはできません。
|
||||
|
||||
[WebSocket API](get-started-using-http-websocket-apis.html#websocket-api)を使用してNo Freezeを有効にするAccountSetトランザクションを送信する例:
|
||||
|
||||
WebSocket要求:
|
||||
|
||||
```json
|
||||
{
|
||||
"id": 12,
|
||||
"command": "submit",
|
||||
"tx_json": {
|
||||
"TransactionType": "AccountSet",
|
||||
"Account": "raKEEVSGnKSD9Zyvxu4z6Pqpm4ABH8FS6n",
|
||||
"Fee": "12000",
|
||||
"Flags": 0,
|
||||
"SetFlag": 6,
|
||||
"LastLedgerSequence": 18124917,
|
||||
"Sequence": 4
|
||||
},
|
||||
"secret": "s████████████████████████████",
|
||||
"offline": false,
|
||||
"fee_mult_max": 1000
|
||||
}
|
||||
```
|
||||
|
||||
**注意:** シークレットキーを信頼できないサーバーに送信することや、安全ではないチャネル経由で送信することは避けてください。
|
||||
|
||||
### RippleAPIを使用する
|
||||
|
||||
アドレスに対してNo Freezeを有効または無効にするには、[prepareSettings](rippleapi-reference.html#preparesettings)メソッドを使用して**Settings**トランザクションを準備します。有効にしたNo Freezeを無効にすることはできません。`settings`パラメーターは、次のように設定されているオブジェクトです:
|
||||
|
||||
| フィールド | 値 | 説明 |
|
||||
|----------|---------|-------------|
|
||||
| noFreeze | ブール値 | `true` |
|
||||
|
||||
このトランザクションをマスターキーで[署名](rippleapi-reference.html#sign)する必要があります。残りの[トランザクションフロー](rippleapi-reference.html#transaction-flow)は他のトランザクションと同じです。
|
||||
|
||||
アドレスに対してNo Freezeを有効にするJavaScript(ECMAScript 6)コードの例:
|
||||
|
||||
```js
|
||||
{% include '_code-samples/freeze/set-no-freeze.js' %}
|
||||
```
|
||||
|
||||
|
||||
## Individual Freezeの確認
|
||||
|
||||
### 使用する`rippled`
|
||||
|
||||
トラストラインでIndividual Freezeが有効になっているかどうかを確認するには、以下のパラメーターを持つ[account_linesメソッド][]を使用します。
|
||||
|
||||
| フィールド | 値 | 説明 |
|
||||
|----------|---------|-------------|
|
||||
| account | 文字列 | イシュアーのXRP Ledgerアドレス |
|
||||
| peer | 文字列 | 取引相手のXRP Ledgerアドレス |
|
||||
| ledger\_index | 文字列 | 最新の検証済み情報を取得するには`validated`を使用します。 |
|
||||
|
||||
応答には、発行アドレスと取引相手がリンクされている各通貨のトラストラインの配列が含まれています。各トラストラインオブジェクトで以下のフィールドを確認します:
|
||||
|
||||
| フィールド | 値 | 説明 |
|
||||
|--------------|---------|-------------|
|
||||
| freeze | ブール値 | (省略される場合があります)`true`: 発行アドレスがこのトラストラインを凍結した場合。省略されている場合は、`false`と同じです。 |
|
||||
| freeze\_peer | ブール値 | (省略される場合があります)`true`: 取引相手がこのトラストラインを凍結した場合。省略されている場合は、`false`と同じです。 |
|
||||
|
||||
Individual Freezeを確認するためのWebSocket要求の例:
|
||||
|
||||
```json
|
||||
{
|
||||
"id": 15,
|
||||
"command": "account_lines",
|
||||
"account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
|
||||
"ledger": "validated",
|
||||
"peer": "rsA2LpzuawewSBQXkiju3YQTMzW13pAAdW"
|
||||
}
|
||||
```
|
||||
|
||||
WebSocket応答の例:
|
||||
|
||||
```json
|
||||
{
|
||||
"id": 15,
|
||||
"status": "success",
|
||||
"type": "response",
|
||||
"result": {
|
||||
"account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
|
||||
"lines": [
|
||||
{
|
||||
"account": "rsA2LpzuawewSBQXkiju3YQTMzW13pAAdW",
|
||||
"balance": "10",
|
||||
"currency": "USD",
|
||||
"freeze": true,
|
||||
"limit": "110",
|
||||
"limit_peer": "0",
|
||||
"peer_authorized": true,
|
||||
"quality_in": 0,
|
||||
"quality_out": 0
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
`"freeze": true`フィールドは、 rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpnが、rsA2LpzuawewSBQXkiju3YQTMzW13pAAdWへのUSDトラストラインに対してIndividual Freezeを有効にしたことを示しています。`"freeze_peer": true`フィールドがない場合、取引相手はトラストラインを凍結 _していません_ 。
|
||||
|
||||
|
||||
### RippleAPIを使用する
|
||||
|
||||
トラストラインに対するIndividual Freezeが有効になっているかどうかを確認するには、以下のパラメーターを持つ[`getTrustlines`メソッド](rippleapi-reference.html#gettrustlines)を使用します。
|
||||
|
||||
| フィールド | 値 | 説明 |
|
||||
|---------------|---------|-------------|
|
||||
| address | 文字列 | イシュアーのXRP Ledgerアドレス |
|
||||
| options.counterparty | 文字列 | 取引相手のXRP Ledgerアドレス |
|
||||
|
||||
応答には、発行アドレスと取引相手がリンクされている各通貨のトラストラインの配列が含まれています。各トラストラインオブジェクトで以下のフィールドを確認します:
|
||||
|
||||
| フィールド | 値 | 説明 |
|
||||
|----------------------|---------|-------------|
|
||||
| specification.frozen | ブール値 | (省略される場合があります)`true`: 発行アドレスがトラストラインを凍結した場合。 |
|
||||
| counterparty.frozen | ブール値 | (省略される場合があります)`true`: 取引相手がトラストラインを凍結した場合。 |
|
||||
|
||||
トラストラインが凍結されているかどうかを確認するJavaScript(ECMAScript 6)コードの例:
|
||||
|
||||
```js
|
||||
{% include '_code-samples/freeze/check-individual-freeze.js' %}
|
||||
```
|
||||
|
||||
|
||||
## Global FreezeとNo Freezeの確認
|
||||
|
||||
### 使用する`rippled`
|
||||
|
||||
アドレスがGlobal FreezeとNo Freezeのいずれかまたは両方を有効にしているかどうかを確認するには、以下のパラメーターを持つ[account_infoメソッド][]を使用します。
|
||||
|
||||
| フィールド | 値 | 説明 |
|
||||
|----------|---------|-------------|
|
||||
| account | 文字列 | 発行アドレスのXRP Ledgerアドレス |
|
||||
| ledger\_index | 文字列 | 最新の検証済み情報を取得するには`validated`を使用します。 |
|
||||
|
||||
[ビット単位AND](https://en.wikipedia.org/wiki/Bitwise_operation#AND)演算子を使用して応答の`account_data.Flags`フィールドの値を確認します:
|
||||
|
||||
* `Flags` AND `0x00400000`([lsfGlobalFreeze](accountroot.html#accountrootのフラグ))が _ゼロ以外_ の場合: Global Freezeが有効です。
|
||||
* `Flags` AND `0x00200000`([lsfNoFreeze](accountroot.html#accountrootのフラグ))が _ゼロ以外_ の場合: No Freezeが有効です。
|
||||
|
||||
WebSocket要求の例:
|
||||
|
||||
```json
|
||||
{
|
||||
"id": 1,
|
||||
"command": "account_info",
|
||||
"account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
|
||||
"ledger_index": "validated"
|
||||
}
|
||||
```
|
||||
|
||||
WebSocket応答:
|
||||
|
||||
```json
|
||||
{
|
||||
"id": 4,
|
||||
"status": "success",
|
||||
"type": "response",
|
||||
"result": {
|
||||
"account_data": {
|
||||
"Account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
|
||||
"AccountTxnID": "41320138CA9837B34E82B3B3D6FB1E581D5DE2F0A67B3D62B5B8A8C9C8D970D0",
|
||||
"Balance": "100258663",
|
||||
"Domain": "6D64756F31332E636F6D",
|
||||
"EmailHash": "98B4375E1D753E5B91627516F6D70977",
|
||||
"Flags": 12582912,
|
||||
"LedgerEntryType": "AccountRoot",
|
||||
"MessageKey": "0000000000000000000000070000000300",
|
||||
"OwnerCount": 4,
|
||||
"PreviousTxnID": "41320138CA9837B34E82B3B3D6FB1E581D5DE2F0A67B3D62B5B8A8C9C8D970D0",
|
||||
"PreviousTxnLgrSeq": 18123095,
|
||||
"Sequence": 352,
|
||||
"TransferRate": 1004999999,
|
||||
"index": "13F1A95D7AAB7108D5CE7EEAF504B2894B8C674E6D68499076441C4837282BF8",
|
||||
"urlgravatar": "http://www.gravatar.com/avatar/98b4375e1d753e5b91627516f6d70977"
|
||||
},
|
||||
"ledger_hash": "A777B05A293A73E511669B8A4A45A298FF89AD9C9394430023008DB4A6E7FDD5",
|
||||
"ledger_index": 18123249,
|
||||
"validated": true
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
上記の例では`Flags`の値は12582912です。この場合、次のJavaScriptコードのように、lsfGlobalFreezeフラグとlsfDefaultRippleフラグが有効になっています。
|
||||
|
||||
```js
|
||||
var lsfGlobalFreeze = 0x00400000;
|
||||
var lsfNoFreeze = 0x00200000;
|
||||
|
||||
var currentFlags = 12582912;
|
||||
|
||||
console.log(currentFlags & lsfGlobalFreeze); //4194304
|
||||
//therefore, Global Freeze is enabled
|
||||
|
||||
console.log(currentFlags & lsfNoFreeze); //0
|
||||
//therefore, No Freeze is not enabled
|
||||
```
|
||||
|
||||
### RippleAPIを使用する
|
||||
|
||||
アドレスに対してGlobal FreezeとNo Freezeのいずれか、または両方が有効になっているかどうかを確認するには、以下のパラメーターを持つ[`getSettings`メソッド](rippleapi-reference.html#getsettings)を使用します。
|
||||
|
||||
| フィールド | 値 | 説明 |
|
||||
|---------------|---------|-------------|
|
||||
| address | 文字列 | 発行アドレスのXRP Ledgerアドレス |
|
||||
|
||||
応答オブジェクトの以下の値を確認します:
|
||||
|
||||
| フィールド | 値 | 説明 |
|
||||
|---------------|---------|-------------|
|
||||
| noFreeze | ブール値 | (省略される場合があります)`true`: No Freezeが有効な場合。 |
|
||||
| globalFreeze | ブール値 | (省略される場合があります)`true`: Global Freezeが有効な場合。 |
|
||||
|
||||
アドレスに対するGlobal FreezeまたはNo Freezeが有効になっているかどうかを確認するJavaScript(ECMAScript 6)コードの例:
|
||||
|
||||
```js
|
||||
{% include '_code-samples/freeze/check-global-freeze-no-freeze.js' %}
|
||||
```
|
||||
<!--{# TODO: update "See Also" with new tutorials' technical details #}-->
|
||||
|
||||
# 関連項目
|
||||
|
||||
|
||||
@@ -77,8 +77,6 @@ DefaultRippleフラグは、デフォルトで着信トラストラインでのR
|
||||
|
||||
[`rippled` API](rippled-api.html)でNoRippleフラグを有効にするには、`tfSetNoRipple`フラグを設定した[TrustSetトランザクション][]を送信します。NoRippleを無効にする(Ripplingを有効にする)には、`tfClearNoRipple`フラグを使用します。
|
||||
|
||||
[RippleAPI](rippleapi-reference.html)でNoRippleフラグを有効にするには、トラストラインの`ripplingDisabled` フィールドを`true`に設定して[Trustlineトランザクション](rippleapi-reference.html#preparetrustline)を送信します。
|
||||
|
||||
|
||||
### NoRippleステータスの確認
|
||||
|
||||
@@ -86,8 +84,6 @@ DefaultRippleフラグは、デフォルトで着信トラストラインでのR
|
||||
|
||||
[`rippled` API](rippled-api.html)でアドレスに関連付けられているトラストラインを確認するには、[account_linesメソッド][]を使用します。各トラストラインの`no_ripple`フィールドには、現在のアドレスがそのトラストラインに対してNoRippleフラグを有効にしているか否かが表示され、`no_ripple_peer`フィールドには、取引相手がNoRippleフラグを有効にしているか否かが表示されます。
|
||||
|
||||
[RippleAPI](rippleapi-reference.html)でアドレスに関連付けられているトラストラインを確認するには、[getTrustlines](rippleapi-reference.html#gettrustlines)メソッドを使用します。各トラストラインの`ripplingDisabled`フィールドには、現在のアドレスがそのトラストラインに対してNoRippleフラグを有効にしているか否かが表示され、`counterparty.ripplingDisabled`フィールドには、取引相手がNoRippleフラグを有効にしているか否かが表示されます。
|
||||
|
||||
|
||||
## 関連項目
|
||||
|
||||
|
||||
@@ -75,19 +75,14 @@ For more information, see [Default Ripple in 'Becoming an XRP Ledger Gateway'](b
|
||||
|
||||
The No Ripple flag can only be enabled on a trust line if the address has a positive or zero balance on that trust line. This is so that the feature cannot be abused to default on the obligation the trust line balance represents. (Of course, you can still default by abandoning the address.)
|
||||
|
||||
In the [`rippled` APIs](rippled-api.html), you can enable the No Ripple flag by sending a [TrustSet transaction][] with the `tfSetNoRipple` flag. You can disable No Ripple (enable rippling) with the `tfClearNoRipple` flag.
|
||||
|
||||
In [RippleAPI](rippleapi-reference.html), you can enable the No Ripple flag by sending a [Trustline transaction](rippleapi-reference.html#preparetrustline) transaction with the `ripplingDisabled` field of the trust line set to `true`. <!-- SPELLING_IGNORE: trustline -->
|
||||
To enable the No Ripple flag, send a [TrustSet transaction][] with the `tfSetNoRipple` flag. You can disable No Ripple (enable rippling) with the `tfClearNoRipple` flag instead.
|
||||
|
||||
|
||||
### Looking Up No Ripple Status
|
||||
|
||||
In the case of two accounts that mutually trust each other, the No Ripple flag is tracked separately for each account.
|
||||
|
||||
In the [`rippled` APIs](rippled-api.html), you can use the [account_lines method][] to look up the trust lines associated with an address. For each trust line, the `no_ripple` field shows whether the current address has enabled the No Ripple flag on that trust line, and the `no_ripple_peer` field shows whether the counterparty has enabled the No Ripple flag.
|
||||
|
||||
In [RippleAPI](rippleapi-reference.html), you can use the [`getTrustlines` method](rippleapi-reference.html#gettrustlines) to look up the trust lines associated with an address. For each trust line, the `ripplingDisabled` field shows whether the current address has enabled the No Ripple flag on that trust line, and the `counterparty.ripplingDisabled` field shows whether the counterparty has enabled the No Ripple flag.
|
||||
|
||||
Using the [HTTP / WebSocket APIs](rippled-api.html) or your preferred [client library](client-libraries.html), look up trust lines with the [account_lines method][]. For each trust line, the `no_ripple` field shows whether the current address has enabled the No Ripple flag on that trust line, and the `no_ripple_peer` field shows whether the counterparty has enabled the No Ripple flag.
|
||||
|
||||
## See Also
|
||||
|
||||
|
||||
@@ -41,14 +41,6 @@ XRPにはイシュアーがいないため、送金手数料が発生するこ
|
||||
|
||||
**注記:** `rippled` v0.80.0で導入され2017-11-14に有効となった[fix1201 Amendment](amendments.html)により、最大送金手数料は実効限度である約329%(32ビット整数の最大サイズに基づく)から100%に引き下げられました。送金手数料の設定が100%(`TransferRate`が`2000000000`)を上回るアカウントがレジャーにまだ含まれている可能性があります。すでに設定されている手数料はすべて、規定のレートで引き続き運用されます。
|
||||
|
||||
## RippleAPI
|
||||
|
||||
RippleAPIでは、送金手数料は`transferRate`フィールドに10進数で指定され、この数は受取人が同一通貨を1単位受領できるよう送金する必要のある額を表します。`transferRate`が`1.005`の場合、送金手数料0.5%に相当します。デフォルトでは`transferRate`は手数料なしに設定されています。`transferRate`には、`1.0`未満の値と`2.0`を上回る値は指定できません。送金手数料は、10桁の有効数字に丸められます(1の位の数字を含む)。値`null`は手数料なしの特殊なケースであり、`1.0`に相当します。
|
||||
|
||||
金融機関は、[発行アドレス][]から[Settingsトランザクション](rippleapi-reference.html#settings)を送信して、イシュアンスの`transferRate`を変更することができます。
|
||||
|
||||
アカウントの`transferRate`を確認するには、[getSettingsメソッド](rippleapi-reference.html#getsettings)を使用します。
|
||||
|
||||
## rippled
|
||||
|
||||
`rippled`のJSON-RPC APIおよびWebSocket APIでは、送金手数料は`TransferRate`フィールドに10進数で指定され、この数字は受取人が同一通貨を10億単位受領できるよう送金する必要のある額を表します。`TransferRate`が`1005000000`の場合、送金手数料0.5%に相当します。デフォルトでは`TransferRate`は手数料なしに設定されています。`TransferRate`には、`1000000000`(手数料「0%」)未満の値と`2000000000`(手数料「100%」)を上回る値は指定できません。値`0`は手数料なしの特殊なケースであり、`1000000000`に相当します。
|
||||
|
||||
@@ -47,24 +47,19 @@ In this scenario, Salazar (the sender) holds EUR issued by ACME, and wants to de
|
||||
|
||||
The transfer fee is represented by a setting on the [issuing address][]. The transfer fee cannot be less than 0% or more than 100% and is rounded down to the nearest 0.0000001%. The transfer fee applies to all currencies issued by the same account. If you want to have different transfer fees for different currencies, use different [issuing addresses][issuing address] for each currency.
|
||||
|
||||
In the [XRP Ledger protocol](protocol-reference.html), the transfer fee is specified in the `TransferRate` field, as an integer which represents the amount you must send for the recipient to get 1 billion units of the same currency. A `TransferRate` of `1005000000` is equivalent to a transfer fee of 0.5%. By default, the `TransferRate` is set to no fee. The value of `TransferRate` cannot be set to less than `1000000000` ("0%" fee) or more than `2000000000` (a "100%" fee). The value `0` is special case for no fee, equivalent to `1000000000`.
|
||||
|
||||
A token issuer can submit an [AccountSet transaction][] from its [issuing address][] to change the `TransferRate` for all its tokens.
|
||||
|
||||
Anyone can check an account's `TransferRate` with the [account_info method][]. If the `TransferRate` is omitted, then that indicates no fee.
|
||||
|
||||
**Note:** The [fix1201 amendment](amendments.html), introduced in `rippled` v0.80.0 and enabled on 2017-11-14, lowered the maximum transfer fee to 100% from an effective limit of approximately 329% (based on the maximum size of a 32-bit integer). The ledger may still contain accounts with a transfer fee setting higher than 100% (a `TransferRate` of `2000000000`). Any transfer fees already set continue to apply at their stated rate.
|
||||
|
||||
## RippleAPI
|
||||
## Client Library Support
|
||||
|
||||
In RippleAPI, the transfer fee is specified in the `transferRate` field, as a decimal which represents the amount you must send for the recipient to get 1 unit of the same currency. A `transferRate` of `1.005` is equivalent to a transfer fee of 0.5%. By default, the `transferRate` is set to no fee. The value of `transferRate` cannot be less than `1.0` or more than `2.0`. The transfer rate is rounded to 10 significant digits including the ones digit. The value `null` is a special case for no fee, equivalent to `1.0`.
|
||||
|
||||
A financial institution can send a [Settings transaction](rippleapi-reference.html#settings) from its [issuing address][] to change the `transferRate` for all its issued currencies.
|
||||
|
||||
You can check an account's `transferRate` with the [`getSettings` method](rippleapi-reference.html#getsettings).
|
||||
|
||||
## rippled
|
||||
|
||||
In `rippled`'s JSON-RPC and WebSocket APIs, the transfer fee is specified in the `TransferRate` field, as an integer which represents the amount you must send for the recipient to get 1 billion units of the same currency. A `TransferRate` of `1005000000` is equivalent to a transfer fee of 0.5%. By default, the `TransferRate` is set to no fee. The value of `TransferRate` cannot be set to less than `1000000000` ("0%" fee) or more than `2000000000` (a "100%" fee). The value `0` is special case for no fee, equivalent to `1000000000`.
|
||||
|
||||
A financial institution can submit an [AccountSet transaction][] from its [issuing address][] to change the `TransferRate` for all its issued currencies.
|
||||
|
||||
You can check an account's `TransferRate` with the [account_info method][]. If the `TransferRate` is omitted, then that indicates no fee.
|
||||
Some [client libraries](client-libraries.html) have convenience functions for getting and setting `TransferRate` functions.
|
||||
|
||||
**JavaScript:** ***TODO based on https://github.com/XRPLF/xrpl.js/pull/1720***
|
||||
|
||||
## See Also
|
||||
|
||||
|
||||
@@ -87,12 +87,7 @@ JSON形式の未署名の[Paymentトランザクション][]の例を次に示
|
||||
}
|
||||
```
|
||||
|
||||
XRP Ledgerは、トランザクションオブジェクトが送信元アドレス(`Account`内)フィールドによって承認されている場合にのみ、トランザクションを中継して実行します。単一の署名によってのみ承認されたトランザクションの場合、2つの選択肢があります。
|
||||
|
||||
1. バイナリーブロブに変換してオフラインで署名します。これが望ましい方法です。トランザクションの署名に使用されたアカウントの機密情報がネットワーク接続を介して送信されないことを意味するためです。
|
||||
* オフライン署名には[RippleAPI](rippleapi-reference.html#sign)を使用できます。
|
||||
2. `rippled`サーバーにトランザクションの署名を依頼します。[signコマンド](sign.html)はJSON形式のトランザクションと機密情報を受け取り、送信可能な署名付きバイナリートランザクション形式を返します。(アカウントの機密情報を送信するのは危険です。そのため、信頼できる暗号化された接続内か、またはローカル接続経由で、自分が管理しているサーバーのみに送信するようにしてください。)
|
||||
* ショートカットとして、`tx_json`オブジェクトを指定した[submitコマンド](submit.html)を使用してトランザクションへの署名とトランザクションの送信を同時に実行できます。これはテストと開発の目的の場合にのみ推奨されます。
|
||||
XRP Ledgerは、トランザクションオブジェクトが送信元アドレス(`Account`内)フィールドによって承認されている場合にのみ、トランザクションを中継して実行します。これを安全に行う方法については、[安全な署名の設定](set-up-secure-signing.html)を参照してください。
|
||||
|
||||
## 署名付きトランザクションブロブの例
|
||||
|
||||
|
||||
@@ -59,9 +59,9 @@ Sending a transaction to the XRP Ledger involves several steps:
|
||||
|
||||
1. Create an [unsigned transaction in JSON format](#example-unsigned-transaction).
|
||||
2. Use one or more signatures to [authorize the transaction](#authorizing-transactions).
|
||||
3. Submit a transaction to a `rippled` server. If the transaction is properly formed, the server provisionally applies the transaction to its current version of the ledger and relays the transaction to other members of the peer-to-peer network.
|
||||
3. Submit a transaction to an XRP Ledger server (usually a [`rippled` instance](the-rippled-server.html)). If the transaction is properly formed, the server provisionally applies the transaction to its current version of the ledger and relays the transaction to other members of the peer-to-peer network.
|
||||
4. The [consensus process](consensus.html) determines which provisional transactions get included in the next validated ledger.
|
||||
5. The `rippled` servers apply those transactions to the previous ledger in a canonical order and share their results.
|
||||
5. The servers apply those transactions to the previous ledger in a canonical order and share their results.
|
||||
6. If enough [trusted validators](rippled-server-modes.html#validators) created the exact same ledger, that ledger is declared _validated_ and the [results of the transactions](transaction-results.html) in that ledger are immutable.
|
||||
|
||||
See [Send XRP](send-xrp.html) for an interactive tutorial in sending XRP payments.
|
||||
@@ -87,16 +87,11 @@ Here is an example of an unsigned [Payment transaction][] in JSON:
|
||||
}
|
||||
```
|
||||
|
||||
The XRP Ledger only relays and executes a transaction if the transaction object has been authorized by the sending address (in the `Account`) field. For transactions authorized by only a single signature, you have two options:
|
||||
|
||||
1. Convert it to a binary blob and sign it offline. This is preferable, since it means that the account secret used for signing the transaction is never transmitted over any network connection.
|
||||
* You can use [RippleAPI](rippleapi-reference.html#sign) for offline signing.
|
||||
2. Have a `rippled` server sign the transaction for you. The [sign command](sign.html) takes a JSON-format transaction and secret and returns the signed binary transaction format ready for submission. (Transmitting your account secret is dangerous, so you should only do this from within a trusted and encrypted connection, or through a local connection, and only to a server you control.)
|
||||
* As a shortcut, you can use the [submit command](submit.html) with a `tx_json` object to sign and submit a transaction all at once. This is only recommended for testing and development purposes.
|
||||
The XRP Ledger only relays and executes a transaction if the transaction object has been authorized by the sending address (in the `Account`) field. For instructions on how to do this securely, see [Set Up Secure Signing](set-up-secure-signing.html).
|
||||
|
||||
## Example Signed Transaction Blob
|
||||
|
||||
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:
|
||||
Signing a transaction results in a chunk of binary data, called a "blob", that can be submitted to the network. Here is an example of the same transaction, as a signed blob, being [submitted with the WebSocket API](submit.html):
|
||||
|
||||
```json
|
||||
{
|
||||
@@ -108,9 +103,11 @@ Signing a transaction generates a binary blob that can be submitted to the netwo
|
||||
|
||||
## Example Executed Transaction with Metadata
|
||||
|
||||
After a transaction has been submitted, you can check its status using the API, for example using the [tx command](tx.html). This shows the transaction instructions, its outcome, and the [metadata](transaction-metadata.html) of all changes that were made by executing it.
|
||||
After a transaction has been executed, the XRP Ledger adds [metadata](transaction-metadata.html) to show the transaction's final outcome and all the changes that the transaction made to the shared state of the XRP Ledger.
|
||||
|
||||
**Caution:** The success of a transaction is not final unless the transaction appears in a **validated** ledger with the result code `tesSUCCESS`. See also: [Finality of Results](finality-of-results.html).
|
||||
You can check a transaction's status using the API, for example using the [tx command](tx.html).
|
||||
|
||||
**Caution:** The results of a transaction, including all its metadata, are not final unless the transaction appears in a **validated** ledger. See also: [Finality of Results](finality-of-results.html).
|
||||
|
||||
Example response from the `tx` command:
|
||||
|
||||
|
||||
@@ -119,7 +119,7 @@ XRP LedgerをスパムやDoS攻撃から守るため、各トランザクショ
|
||||
|
||||
### トランザクションコストの自動指定
|
||||
|
||||
オンラインでトランザクションに署名する場合は、`Fee`フィールドを省略できます。この場合、`rippled`または[RippleAPI](rippleapi-reference.html)が現在の要件に照らしてピアツーピアネットワークの状態を確認し、トランザクションに署名する前に`Fee`値を追加します。ただし、このようなトランザクションコストへの自動入力にはいくつかの欠点と制限事項があります。
|
||||
オンラインでトランザクションに署名する場合は、`Fee`フィールドを省略できます。この場合、`rippled`または[クライアントライブラリ](client-libraries.html)が現在の要件に照らしてピアツーピアネットワークの状態を確認し、トランザクションに署名する前に`Fee`値を追加します。ただし、このようなトランザクションコストへの自動入力にはいくつかの欠点と制限事項があります。
|
||||
|
||||
* トランザクションに署名し、分散するまでの間にネットワークのトランザクションコストが上昇した場合、そのトランザクションは承認されない場合があります。
|
||||
* 最悪の場合、トランザクションに`LastLedgerSequence`パラメーターが含まれているか、同じ`Sequence`番号を使用する新しいトランザクションによってそのトランザクションがキャンセルされない限り、トランザクションは明確に承認も拒否もされない状態のままとなってしまいます。ベストプラクティスについては、[信頼できるトランザクションの送信](reliable-transaction-submission.html)を参照してください。
|
||||
|
||||
@@ -118,15 +118,14 @@ Before signing a transaction, we recommend [looking up the current load-based tr
|
||||
|
||||
### Automatically Specifying the Transaction Cost
|
||||
|
||||
When you sign a transaction online, you can omit the `Fee` field. In this case, `rippled` or [RippleAPI](rippleapi-reference.html) checks the state of the peer-to-peer network for the current requirement and adds a `Fee` value before signing the transaction. However, there are several drawbacks and limitations to automatically filling in the transaction cost in this manner:
|
||||
|
||||
* If the network's transaction cost goes up between signing and distributing the transaction, the transaction may not be confirmed.
|
||||
* In the worst case, the transaction may be stuck in a state of being neither definitively confirmed or rejected, unless it included a `LastLedgerSequence` parameter or until you cancel it with a new transaction that uses the same `Sequence` number. See [reliable transaction submission](reliable-transaction-submission.html) for best practices.
|
||||
* You do not know in advance exactly what value you are signing for the `Fee` field.
|
||||
* If you are using `rippled`, you can also use the `fee_mult_max` and `fee_div_max` parameters of the [sign method][] to set a limit to the load scaling you are willing to sign.
|
||||
* You cannot look up the current transaction cost from an offline machine.
|
||||
* You cannot automatically specify the transaction cost when [multi-signing](multi-signing.html).
|
||||
The `Fee` field is one of the things that can be [auto-filled](transaction-common-fields.html#auto-fillable-fields) when creating a transaction. In this case, the auto-filling software provides a suitable `Fee` value based on the current load in the peer-to-peer network. However, there are several drawbacks and limitations to automatically filling in the transaction cost in this manner:
|
||||
|
||||
- If the network's transaction cost goes up between auto-filling and submitting the transaction, the transaction may not be confirmed.
|
||||
- To prevent a transaction from getting stuck in a state of being neither definitively confirmed or rejected, be sure to provide a `LastLedgerSequence` parameter so it eventually expires. Alternatively, you can try to [cancel a stuck transaction](about-canceling-a-transaction.html) by reusing the same `Sequence` number. See [reliable transaction submission](reliable-transaction-submission.html) for best practices.
|
||||
- You have to be careful that the automatically provided value isn't too high. You don't want to burn a large fee to send a small transaction.
|
||||
- If you are using `rippled`, you can also use the `fee_mult_max` and `fee_div_max` parameters of the [sign method][] to set a limit to the load scaling you are willing to sign.
|
||||
- Some client libraries (like xrpl.js and xrpl-py) have configurable maximum `Fee` values, and raise an error instead of signing a transaction whose `Fee` value is higher than the maximum.
|
||||
- You cannot auto-fill from an offline machine nor when [multi-signing](multi-signing.html).
|
||||
|
||||
|
||||
## Transaction Costs and Failed Transactions
|
||||
|
||||
@@ -70,12 +70,11 @@ Partial Payment以外の場合、トランザクションのメタデータの`d
|
||||
| [JSON-RPC / WebSocket][] | [transaction_entryメソッド][] | `result.metadata.delivered_amount` |
|
||||
| [JSON-RPC / WebSocket][] | [ledgerメソッド][](トランザクションが展開されている状態) | `result.ledger.transactions` 配列メンバーの`metaData.delivered_amount` [新規: rippled 1.2.1][] |
|
||||
| [WebSocket][] | [トランザクションサブスクリプション](subscribe.html#トランザクションストリーム) | サブスクリプションメッセージの`meta.delivered_amount` [新規: rippled 1.2.1][] |
|
||||
| [RippleAPI][] | [`getTransaction` メソッド](rippleapi-reference.html#gettransaction) | `outcome.deliveredAmount` |
|
||||
| [RippleAPI][] | [`getTransactions` メソッド](rippleapi-reference.html#gettransaction) | 配列メンバーの `outcome.deliveredAmount` |
|
||||
| ripple-lib v1.x | `getTransaction` メソッド | `outcome.deliveredAmount` |
|
||||
| ripple-lib v1.x | `getTransactions` メソッド | 配列メンバーの `outcome.deliveredAmount` |
|
||||
|
||||
[WebSocket]: rippled-api.html
|
||||
[JSON-RPC / WebSocket]: rippled-api.html
|
||||
[RippleAPI]: rippleapi-reference.html
|
||||
|
||||
## Partial Paymentの悪用
|
||||
|
||||
|
||||
@@ -70,12 +70,11 @@ You can find the `delivered_amount` field in the following places:
|
||||
| [JSON-RPC / WebSocket][] | [transaction_entry method][] | `result.metadata.delivered_amount` |
|
||||
| [JSON-RPC / WebSocket][] | [ledger method][] (with transactions expanded) | `result.ledger.transactions` array members' `metaData.delivered_amount` [New in: rippled 1.2.1][] |
|
||||
| [WebSocket][] | [Transaction subscriptions](subscribe.html#transaction-streams) | Subscription messages' `meta.delivered_amount` [New in: rippled 1.2.1][] |
|
||||
| [RippleAPI][] | [`getTransaction` method](rippleapi-reference.html#gettransaction) | `outcome.deliveredAmount` |
|
||||
| [RippleAPI][] | [`getTransactions` method](rippleapi-reference.html#gettransaction) | array members' `outcome.deliveredAmount` |
|
||||
| ripple-lib v1.x | `getTransaction` method | `outcome.deliveredAmount` |
|
||||
| ripple-lib v1.x | `getTransactions` method | array members' `outcome.deliveredAmount` |
|
||||
|
||||
[WebSocket]: rippled-api.html
|
||||
[JSON-RPC / WebSocket]: rippled-api.html
|
||||
[RippleAPI]: rippleapi-reference.html
|
||||
|
||||
## Partial Payments Exploit
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ labels:
|
||||
{% include '_snippets/public-signing-note.md' %}
|
||||
<!--_ -->
|
||||
|
||||
**注意:** 独自の`rippled`サーバーを運用している場合を除き、このコマンドを使用するのではなく、[RippleAPIを使用したローカル署名](rippleapi-reference.html#sign)を実行してください。信用できないサーバーが、トランザクションへの署名前にトランザクションに変更を加えたり、シークレットキーを悪用して、トランザクションの発行元であるかのように任意の追加的なトランザクションに署名したりするおそれがあります。
|
||||
**注意:** 独自の`rippled`サーバーを運用している場合を除き、このコマンドを使用するのではなく、[クライアントライブラリ](client-libraries.html)を実行してください。詳細については[安全な署名の設定](set-up-secure-signing.html)を参照してください。
|
||||
|
||||
## 要求フォーマット
|
||||
要求フォーマットの例:
|
||||
|
||||
@@ -13,7 +13,7 @@ The `sign` method takes a [transaction in JSON format](transaction-formats.html)
|
||||
{% include '_snippets/public-signing-note.md' %}
|
||||
<!--_ -->
|
||||
|
||||
**Caution:** Unless you run the `rippled` server yourself, you should do [local signing with RippleAPI](rippleapi-reference.html#sign) instead of using this command. An untrustworthy server could change the transaction before signing it, or use your secret key to sign additional arbitrary transactions as if they came from you.
|
||||
**Caution:** Unless you run the `rippled` server yourself, you should do local signing using a [client library](client-libraries.html) instead of using this command. For more information, see [Set Up Secure Signing](set-up-secure-signing.html).
|
||||
|
||||
## Request Format
|
||||
An example of the request format:
|
||||
|
||||
@@ -229,7 +229,7 @@ HTTP Status:200 OK
|
||||
- [ソフトウェアエコシステム](software-ecosystem.html)
|
||||
- [並列ネットワーク](parallel-networks.html)
|
||||
- **チュートリアル:**
|
||||
- [RippleAPI for JavaScriptの使用開始](get-started-with-rippleapi-for-javascript.html)
|
||||
- [xrpl.js for JavaScriptの使用開始](get-started-using-javascript.html)
|
||||
- [信頼できるトランザクションの送信](reliable-transaction-submission.html)
|
||||
- [rippledサーバーの管理](manage-the-rippled-server.html)
|
||||
- **リファレンス:**
|
||||
|
||||
@@ -100,15 +100,14 @@ For a full list of API methods, see:
|
||||
|
||||
- **Concepts:**
|
||||
- [XRP Ledger Overview](xrp-ledger-overview.html)
|
||||
- [Software Ecosystem](software-ecosystem.html)
|
||||
- [Client Libraries](client-libraries.html)
|
||||
- [Parallel Networks](parallel-networks.html)
|
||||
- **Tutorials:**
|
||||
- [Get Started with RippleAPI for JavaScript](get-started-with-rippleapi-for-javascript.html)
|
||||
- [Get Started Using JavaScript](get-started-using-javascript.html)
|
||||
- [Reliable Transaction Submission](reliable-transaction-submission.html)
|
||||
- [Manage the rippled Server](manage-the-rippled-server.html)
|
||||
- **References:**
|
||||
- [rippled API Reference](rippled-api.html)
|
||||
- [Ripple Data API v2](data-api.html)
|
||||
|
||||
<!--{# common link defs #}-->
|
||||
{% include '_snippets/rippled-api-links.md' %}
|
||||
|
||||
@@ -14,7 +14,7 @@ showcase_icon: assets/img/logos/javascript.svg
|
||||
|
||||
This tutorial guides you through the basics of building an XRP Ledger-connected application in JavaScript or TypeScript using the [`xrpl.js`](https://github.com/XRPLF/xrpl.js/) client library in either Node.js or web browsers.
|
||||
|
||||
The scripts and config files used in this guide are [available in this website's GitHub Repository](https://github.com/XRPLF/xrpl-dev-portal/tree/master/content/_code-samples/rippleapi_quickstart).
|
||||
The scripts and config files used in this guide are [available in this website's GitHub Repository]({{github_forkurl}}/tree/{{github_branch}}/content/_code-samples/get-started/js/).
|
||||
|
||||
|
||||
## Learning goals
|
||||
|
||||
@@ -94,8 +94,8 @@ main()
|
||||
Try editing the code above to do something different:
|
||||
|
||||
- Connect to the [Testnet](parallel-networks.html) public server at `wss://s.altnet.rippletest.net/` instead. [Answer >](javascript:js_interactives.step2.ex_1())
|
||||
- Look up the details of a transaction using the [`getTransaction()` method](rippleapi-reference.html#gettransaction). For the `id`, use one of the `transactionHashes` from the `getLedger()` response! [Answer >](javascript:js_interactives.step2.ex_2())
|
||||
- Convert the `totalDrops` from the response to decimal XRP. [Answer >](javascript:js_interactives.step2.ex_3())
|
||||
- Look up the details of one of the ledger's transaction using the [tx method][]. [Answer >](javascript:js_interactives.step2.ex_2())
|
||||
- Convert the `total_coins` from the response to decimal XRP. [Answer >](javascript:js_interactives.step2.ex_3())
|
||||
|
||||
|
||||
## Setup Steps
|
||||
@@ -111,8 +111,8 @@ This page has the necessary prerequisites already loaded, but you can access the
|
||||
|
||||
When you're ready to move on, continue using the XRP Ledger with these resources:
|
||||
|
||||
- [Send XRP](send-xrp.html) to send your first transaction.
|
||||
- [Understand the Concepts](concepts.html) behind the XRP Ledger's design.
|
||||
- [Use the RippleAPI Reference](rippleapi-reference.html) to see what else you can do.
|
||||
- [Install `rippled`](install-rippled.html) to participate in the network.
|
||||
- [Get Testnet XRP](xrp-testnet-faucet.html) to try sending and receiving payments.
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ This tutorial shows how to monitor for incoming [payments](payment-types.html) u
|
||||
|
||||
WebSocket follows a model where the client and server establish one connection, then send messages both ways through the same connection, which remains open until explicitly closed (or until the connection fails). This is in contrast to the HTTP-based API model (including JSON-RPC and RESTful APIs), where the client opens and closes a new connection for each request.[¹](#footnote-1)<a id="from-footnote-1"></a>
|
||||
|
||||
**Tip:** The examples in this page use JavaScript so that the examples can run natively in a web browser. If you are developing in JavaScript, you can also use the [RippleAPI library for JavaScript](rippleapi-reference.html) to simplify some tasks. This tutorial shows how to monitor for transactions _without_ using RippleAPI so that you can translate the steps to other programming languages that don't have RippleAPI.
|
||||
**Tip:** The examples in this page use JavaScript so that the examples can run natively in a web browser. If you are developing in JavaScript, you can also use the [xrpl.js library for JavaScript](https://js.xrpl.org/) to simplify some tasks. This tutorial shows how to monitor for transactions _without_ using a xrpl.js so that you can translate the steps to other programming languages that don't have a native XRP Ledger client library.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
@@ -125,7 +125,7 @@ Since WebSocket connections can have several messages going each way and there i
|
||||
|
||||
- For follow-up messages from [subscriptions](subscribe.html), the `type` indicates the type of follow-up message it is, such as the notification of a new transaction, ledger, or validation; or a follow-up to an ongoing [pathfinding request](path_find.html). Your client only receives these messages if it subscribes to them.
|
||||
|
||||
**Tip:** The [RippleAPI library for JavaScript](rippleapi-reference.html) handles this step by default. All asynchronous API requests use Promises to provide the response, and you can listen to streams using the [`.on(event, callback)` method](rippleapi-reference.html#listening-to-streams).
|
||||
**Tip:** The [xrpl.js library for JavaScript](https://js.xrpl.org/) handles this step by default. All asynchronous API requests use Promises to provide the response, and you can listen to streams using the `.on(event, callback)` method of the `Client`.
|
||||
|
||||
The following JavaScript code defines a helper function to make API requests into convenient asynchronous [Promises](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises), and sets up an interface to map other types of messages to global handlers:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user