mirror of
https://github.com/XRPLF/xrpl-dev-portal.git
synced 2025-11-04 11:55:50 +00:00
Remove legacy links to RippleAPI 1.x docs
This commit is contained in:
@@ -6,6 +6,7 @@ cta_text: XRPを送金しよう
|
||||
embed_ripple_lib: true
|
||||
filters:
|
||||
- interactive_steps
|
||||
- include_code
|
||||
labels:
|
||||
- 支払い
|
||||
- XRP
|
||||
@@ -13,7 +14,7 @@ top_nav_grouping: 人気ページ
|
||||
---
|
||||
# XRPの送金
|
||||
|
||||
このチュートリアルでは、RippleAPI for JavaScriptを使用してシンプルなXRP送金を行う方法について説明します。まずは、XRP Test Netを使用してプロセスを順に進めます。次に、そのプロセスと、本番で同様の処理を行う場合に発生する追加要件とを比較します。
|
||||
このチュートリアルでは、xrpl.jsを使用してシンプルなXRP送金を行う方法について説明します。まずは、XRP Testnetを使用してプロセスを順に進めます。次に、そのプロセスと、本番で同様の処理を行う場合に発生する追加要件とを比較します。
|
||||
|
||||
## 前提条件
|
||||
|
||||
@@ -21,26 +22,37 @@ top_nav_grouping: 人気ページ
|
||||
<script type="application/javascript" src="assets/js/tutorials/send-xrp.js"></script>
|
||||
{% set use_network = "Testnet" %}
|
||||
|
||||
- このページでは、ripple-lib(RippleAPI)ライブラリーバージョン1.8.2を使用するJavaScriptの例を紹介します。[RippleAPI入門ガイド](get-started-with-rippleapi-for-javascript.html)に、RippleAPIを使用してJavaScriptからXRP Ledgerデータにアクセスする方法の説明があります。
|
||||
- このページでは、xrpl.jsライブラリーを使用するJavaScriptの例を紹介します。[xrpl.js入門ガイド](get-started-using-javascript.html)に、xrpl.jsを使用してJavaScriptからXRP Ledgerデータにアクセスする方法の説明があります。
|
||||
|
||||
- XRP Ledgerでトランザクションを送信するには、まずアドレスと秘密鍵、そしていくらかのXRPが必要となります。次のインターフェイスを使用して、XRP Test NetにあるアドレスとTest Net XRPを入手できます。
|
||||
- XRP Ledgerでトランザクションを送信するには、まずアドレスと秘密鍵、そしていくらかのXRPが必要となります。次のインターフェイスを使用して、XRP Test NetにあるアドレスとTestnet XRPを入手できます。
|
||||
|
||||
{% include '_snippets/interactive-tutorials/generate-step.ja.md' %}
|
||||
|
||||
## Test Netでの送金
|
||||
## Testnetでの送金
|
||||
{% set n = cycler(* range(1,99)) %}
|
||||
|
||||
### {{n.next()}}. Test Netサーバーへの接続
|
||||
### {{n.next()}}. Testnetサーバーへの接続
|
||||
|
||||
必須の自動入力可能フィールドに入力されるようにするために、ripple-libを、アカウントの現在のステータスと共有レジャー自体を取得できるサーバーに接続する必要があります。(セキュリティを高めるために、トランザクションの署名はオフライン中に行うことを推奨します。ただしその場合は、自動入力可能フィールドに手動で入力する必要があります。)トランザクションの送信先となるネットワークに接続する必要があります。
|
||||
|
||||
以下のサンプルコードでは、新しいRippleAPIインスタンスを作成し、Rippleが運用している公開XRP Test Netサーバーに接続します。
|
||||
以下のサンプルコードでは公開XRP Testnetサーバーに接続します。
|
||||
|
||||
<!-- MULTICODE_BLOCK_START -->
|
||||
|
||||
_JavaScript_
|
||||
|
||||
{{ include_code("_code-samples/get-started/js/base.js", language="js") }}
|
||||
|
||||
_Python_
|
||||
|
||||
{{ include_code("_code-samples/send-xrp/py/send-xrp.py", start_with="# Connect", end_before="# Get credentials", language="py") }}
|
||||
|
||||
_Java_
|
||||
|
||||
{{ include_code("_code-samples/send-xrp/java/SendXrp.java", start_with="// Connect", end_before="// Prepare transaction", language="java") }}
|
||||
|
||||
<!-- MULTICODE_BLOCK_END -->
|
||||
|
||||
```js
|
||||
ripple = require('ripple-lib')
|
||||
api = new ripple.RippleAPI({server: 'wss://s.altnet.rippletest.net:51233'})
|
||||
api.connect()
|
||||
```
|
||||
|
||||
このチュートリアルでは、以下のボタンをクリックすることでブラウザーから直接接続できます。
|
||||
|
||||
@@ -67,29 +79,23 @@ XRP送金に対して指定する必要がある必要最小限の指示は次
|
||||
- XRPを受け取るアドレス(`"Destination"`)。このアドレスは送信元アドレスと同じものではいけません。
|
||||
- 送金するXRP額(`"Amount"`)。通常、XRPの「drop数」を示す整数として指定します。1,000,000ドロップは1 XRPです。
|
||||
|
||||
技術上、一部の追加のフィールドは実行可能なトランザクションに含める必要があり、また、省略可能なフィールドでも、`LastLedgerSequence`などは含めることを強く推奨します。[`prepareTransaction()`メソッド](rippleapi-reference.html#preparetransaction)は、トランザクションの残りのフィールドに適切なデフォルトを自動的に入力します。上記の送金を準備する際の例を示します。
|
||||
技術上、一部の追加のフィールドは実行可能なトランザクションに含める必要があり、また、省略可能なフィールドでも、`LastLedgerSequence`などは含めることを強く推奨します。[`autofill()`メソッド](https://js.xrpl.org/classes/Client.html#autofill)は、トランザクションの残りのフィールドに適切なデフォルトを自動的に入力します。上記の送金を準備する際の例を示します。
|
||||
|
||||
```js
|
||||
// Continuing after connecting to the API
|
||||
async function doPrepare() {
|
||||
const sender = "rPT1Sjq2YGrBMTttX4GZHjKu9dyfzbpAYe"
|
||||
const preparedTx = await api.prepareTransaction({
|
||||
"TransactionType": "Payment",
|
||||
"Account": sender,
|
||||
"Amount": api.xrpToDrops("22"), // Same as "Amount": "22000000"
|
||||
"Destination": "rUCzEr6jrEyMpjhs4wSdQdz4g8Y382NxfM"
|
||||
}, {
|
||||
// Expire this transaction if it doesn't execute within ~5 minutes:
|
||||
"maxLedgerVersionOffset": 75
|
||||
})
|
||||
const maxLedgerVersion = preparedTx.instructions.maxLedgerVersion
|
||||
console.log("準備されたトランザクション指示:", preparedTx.txJSON)
|
||||
console.log("トランザクションコスト:", preparedTx.instructions.fee, "XRP")
|
||||
console.log("トランザクションの有効期限はこのレジャー後:", maxLedgerVersion)
|
||||
return preparedTx.txJSON
|
||||
}
|
||||
txJSON = doPrepare()
|
||||
```
|
||||
<!-- MULTICODE_BLOCK_START -->
|
||||
|
||||
_JavaScript_
|
||||
|
||||
{{ include_code("_code-samples/send-xrp/js/send-xrp.js", start_with="// Prepare", end_before="// Sign", language="js" ) }}
|
||||
|
||||
_Python_
|
||||
|
||||
{{ include_code("_code-samples/send-xrp/py/send-xrp.py", start_with="# Prepare", end_before="# Sign", language="py" ) }}
|
||||
|
||||
_Java_
|
||||
|
||||
{{ include_code("_code-samples/send-xrp/java/SendXrp.java", start_with="// Prepare", end_before="// Sign", language="java") }}
|
||||
|
||||
<!-- MULTICODE_BLOCK_END -->
|
||||
|
||||
{{ start_step("Prepare") }}
|
||||
<div class="input-group mb-3">
|
||||
@@ -109,16 +115,27 @@ txJSON = doPrepare()
|
||||
|
||||
### {{n.next()}}. トランザクションの指示への署名
|
||||
|
||||
RippleAPIの[sign()メソッド](rippleapi-reference.html#sign)を使用して、トランザクションに署名します。最初の引数は、署名するJSONトランザクションの文字列バージョンです。
|
||||
xrpl.jsの[Wallet.sign()メソッド](https://js.xrpl.org/classes/Wallet.html#sign)を使用して、トランザクションに署名します。最初の引数は、署名するJSONトランザクションの文字列バージョンです。
|
||||
|
||||
<!-- MULTICODE_BLOCK_START -->
|
||||
|
||||
_JavaScript_
|
||||
|
||||
{{ include_code("_code-samples/send-xrp/js/send-xrp.js",
|
||||
start_with="// Sign", end_before="// Submit", language="js" ) }}
|
||||
|
||||
_Python_
|
||||
|
||||
{{ include_code("_code-samples/send-xrp/py/send-xrp.py",
|
||||
start_with="# Sign", end_before="# Submit", language="py" ) }}
|
||||
|
||||
_Java_
|
||||
|
||||
{{ include_code("_code-samples/send-xrp/java/SendXrp.java",
|
||||
start_with="// Sign", end_before="// Submit", language="java" ) }}
|
||||
|
||||
<!-- MULTICODE_BLOCK_END -->
|
||||
|
||||
```js
|
||||
// Continuing from the previous step...
|
||||
const response = api.sign(txJSON, "s████████████████████████████")
|
||||
const txID = response.id
|
||||
console.log("Identifying hash:", txID)
|
||||
const txBlob = response.signedTransaction
|
||||
console.log("Signed blob:", txBlob)
|
||||
```
|
||||
|
||||
署名処理の結果は、署名を含むトランザクションオブジェクトになります。通常、XRP Ledger APIは、署名済みトランザクションがトランザクションの正規の[バイナリーフォーマット](serialization.html)(「ブロブ」と呼ばれる)の16進数表現になることを想定しています。
|
||||
|
||||
@@ -132,27 +149,22 @@ console.log("Signed blob:", txBlob)
|
||||
|
||||
### {{n.next()}}. 署名済みブロブの送信
|
||||
|
||||
[submit()メソッド](rippleapi-reference.html#submit)を使用して、トランザクションをネットワークに送信します。送信する前に、[getLedgerVersion()メソッド](rippleapi-reference.html#getledgerversion)を使用して最新の検証済みレジャーインデックスを書き留めておくことをお勧めします。この送信の結果としてトランザクションが追加される可能性のある最も古いレジャーバージョンは、送信時に最新の検証済みレジャーより1つ大きなバージョンとなります。
|
||||
トランザクションをネットワークに送信します。
|
||||
|
||||
ただし、同じトランザクションが以前に送信されたことがある場合、そのトランザクションはすでに以前のレジャーに入っています。(2回目の送信は成功しませんが、正しいレジャーバージョンの中を確認しないと、すでに成功していたことに気付かない可能性があります。)
|
||||
<!-- MULTICODE_BLOCK_START -->
|
||||
|
||||
```js
|
||||
// use txBlob from the previous example
|
||||
async function doSubmit(txBlob) {
|
||||
const latestLedgerVersion = await api.getLedgerVersion()
|
||||
_JavaScript_
|
||||
|
||||
const result = await api.submit(txBlob)
|
||||
{{ include_code("_code-samples/send-xrp/js/send-xrp.js", start_with="// Submit", end_before="// Wait", language="js" ) }}
|
||||
|
||||
console.log("予備結果コード:", result.resultCode)
|
||||
console.log("予備結果メッセージ", result.resultMessage)
|
||||
_Python_
|
||||
|
||||
// Return the earliest ledger index this transaction could appear in
|
||||
// as a result of this submission, which is the first one after the
|
||||
// validated ledger at time of submission.
|
||||
return latestLedgerVersion + 1
|
||||
}
|
||||
const earliestLedgerVersion = doSubmit(txBlob)
|
||||
```
|
||||
{{ include_code("_code-samples/send-xrp/py/send-xrp.py", start_with="# Submit", end_before="# Wait", language="py") }}
|
||||
|
||||
_Java_
|
||||
{{ include_code("_code-samples/send-xrp/java/SendXrp.java", start_with="// Submit", end_before="// Wait", language="java" ) }}
|
||||
|
||||
<!-- MULTICODE_BLOCK_END -->
|
||||
|
||||
このメソッドは、ローカルでトランザクションを適用しようと試みたときの**一時的な**結果を返します。この結果は、トランザクションが検証済みレジャーに含まれた時点で変わる_可能性があります_。当初は成功していたトランザクションが最終的に失敗となったり、当初失敗していたトランザクションが最終的に成功する場合があります。しかしながら、一時的な結果はほとんどの場合は最終結果と一致するため、ここで`tesSUCCESS`が表示されたらひとまず安心しても問題ありません。😁
|
||||
|
||||
@@ -175,16 +187,21 @@ const earliestLedgerVersion = doSubmit(txBlob)
|
||||
|
||||
ほとんどのトランザクションは送信後の次のレジャーバージョンに承認されます。つまり、4~7秒でトランザクションの結果が最終的なものになる可能性があります。XRP Ledgerがビジーになっているか、ネットワーク接続の品質が悪いためにトランザクションをネットワーク内で中継する処理が遅延した場合は、トランザクション確定までにもう少し時間がかかることがあります。(トランザクションの有効期限を設定する方法については、[信頼できるトランザクションの送信](reliable-transaction-submission.html)を参照してください。)
|
||||
|
||||
RippleAPIの`ledger`イベントタイプを使用して、新しい検証済みレジャーバージョンがあるときにコードが実行されるようにしておきます。例:
|
||||
<!-- MULTICODE_BLOCK_START -->
|
||||
|
||||
```js
|
||||
api.on('ledger', ledger => {
|
||||
console.log("レジャーインデックス", ledger.ledgerVersion, "は検証されました。")
|
||||
if (ledger.ledgerVersion > maxLedgerVersion) {
|
||||
console.log("トランザクションはまだ検証されていませんなら、有効期限が切れています。")
|
||||
}
|
||||
})
|
||||
```
|
||||
_JavaScript_
|
||||
|
||||
{{ include_code("_code-samples/send-xrp/js/send-xrp.js", start_with="// Wait", end_before="// Check", language="js" ) }}
|
||||
|
||||
_Python_
|
||||
|
||||
{{ include_code("_code-samples/send-xrp/py/send-xrp.py", start_with="# Wait", end_before="# Check", language="py") }}
|
||||
|
||||
_Java_
|
||||
|
||||
{{ include_code("_code-samples/send-xrp/java/SendXrp.java", start_with="// Wait", end_before="// Check", language="java" ) }}
|
||||
|
||||
<!-- MULTICODE_BLOCK_END -->
|
||||
|
||||
{{ start_step("Wait") }}
|
||||
{% include '_snippets/interactive-tutorials/wait-step.ja.md' %}
|
||||
@@ -193,25 +210,26 @@ api.on('ledger', ledger => {
|
||||
|
||||
### {{n.next()}}. トランザクションステータスの確認
|
||||
|
||||
トランザクションが行った内容を正確に把握するために、トランザクションが検証済みレジャーバージョンに記録されたときにトランザクションの結果を調べる必要があります。例えば、[getTransaction()メソッド](rippleapi-reference.html#gettransaction)を使用して、トランザクションのステータスを確認できます。
|
||||
トランザクションが行った内容を正確に把握するために、トランザクションが検証済みレジャーバージョンに記録されたときにトランザクションの結果を調べる必要があります。例えば、[txメソッド][]を使用して、トランザクションのステータスを確認できます。
|
||||
|
||||
```js
|
||||
// Continues from previous examples.
|
||||
// earliestLedgerVersion was noted when the transaction was submitted.
|
||||
// txID was noted when the transaction was signed.
|
||||
try {
|
||||
tx = await api.getTransaction(txID, {minLedgerVersion: earliestLedgerVersion})
|
||||
console.log("トランザクションの結果:", tx.outcome.result)
|
||||
console.log("残高変化:", JSON.stringify(tx.outcome.balanceChanges))
|
||||
} catch(error) {
|
||||
console.log("トランザクションの結果を取得出来ませんでした。エラー:", error)
|
||||
}
|
||||
<!-- MULTICODE_BLOCK_START -->
|
||||
|
||||
```
|
||||
_JavaScript_
|
||||
|
||||
RippleAPIの`getTransaction()`メソッドは、トランザクションが検証済みレジャーバージョンに登録された場合にのみ成功を返します。登録されなかった場合は、`await`式が例外を発生させます。
|
||||
{{ include_code("_code-samples/send-xrp/js/send-xrp.js", start_with="// Check", end_before="// End of", language="js" ) }}
|
||||
|
||||
**注意:** 他のAPIは、まだ検証されていないレジャーバージョンからの暫定的な結果を返す場合があります。例えば、`rippled` APIの[txメソッド][]を使用した場合は、応答内の`"validated": true`を探して、データが検証済みレジャーバージョンからのものであることを確認してください。検証済みレジャーバージョンからのものではないトランザクション結果は、変わる可能性があります。詳細は、[結果のファイナリティー](finality-of-results.html)を参照してください。
|
||||
_Python_
|
||||
|
||||
{{ include_code("_code-samples/send-xrp/py/send-xrp.py", start_with="# Check", language="py") }}
|
||||
|
||||
_Java_
|
||||
|
||||
{{ include_code("_code-samples/send-xrp/java/SendXrp.java", start_with="// Check", language="java" ) }}
|
||||
|
||||
<!-- MULTICODE_BLOCK_END -->
|
||||
|
||||
|
||||
**注意:** APIは、まだ検証されていないレジャーバージョンからの暫定的な結果を返す場合があります。例えば、`rippled` APIの[txメソッド][]を使用した場合は、応答内の`"validated": true`を探して、データが検証済みレジャーバージョンからのものであることを確認してください。検証済みレジャーバージョンからのものではないトランザクション結果は、変わる可能性があります。詳細は、[結果のファイナリティー](finality-of-results.html)を参照してください。
|
||||
|
||||
{{ start_step("Check") }}
|
||||
<button id="get-tx-button" class="btn btn-primary previous-steps-required">トランザクションステータスを確認する</button>
|
||||
@@ -228,36 +246,73 @@ RippleAPIの`getTransaction()`メソッドは、トランザクションが検
|
||||
|
||||
### 実際のXRPアカウントの取得
|
||||
|
||||
このチュートリアルでは、Test Net XRPがすでに資金供給されているアドレスをボタンで取得しましたが、それが可能だったのはTest Net XRPに何の価値もないからです。実際のXRPでは、XRPを所有している他者からXRPを入手する必要があります。(たとえば、取引所で購入する方法など。)RippleAPIの[generateAddress()メソッド](rippleapi-reference.html#generateaddress)を使用して、本番またはTest Netで機能するアドレスとシークレットを生成できます。
|
||||
このチュートリアルでは、Test Net XRPがすでに資金供給されているアドレスをボタンで取得しましたが、それが可能だったのはTest Net XRPに何の価値もないからです。実際のXRPでは、XRPを所有している他者からXRPを入手する必要があります。(たとえば、取引所で購入する方法など。)[xrpl.jsのWallet()クラス](https://js.xrpl.org/classes/Wallet.html)を使用して、本番またはTestnetで機能するアドレスとシークレットを生成できます。
|
||||
|
||||
<!-- MULTICODE_BLOCK_START -->
|
||||
|
||||
_JavaScript_
|
||||
|
||||
```js
|
||||
const generated = api.generateAddress()
|
||||
console.log(generated.address) // 例: rGCkuB7PBr5tNy68tPEABEtcdno4hE6Y7f
|
||||
console.log(generated.secret) // 例: sp6JS7f14BuwFY8Mw6bTtLKWauoUs
|
||||
const wallet = new xrpl.Wallet()
|
||||
console.log(wallet.address) // Example: rGCkuB7PBr5tNy68tPEABEtcdno4hE6Y7f
|
||||
console.log(wallet.seed) // Example: sp6JS7f14BuwFY8Mw6bTtLKWauoUs
|
||||
```
|
||||
|
||||
_Python_
|
||||
|
||||
```py
|
||||
from xrpl.wallet import Wallet
|
||||
my_wallet = Wallet.create()
|
||||
print(my_wallet.classic_address) # Example: rGCkuB7PBr5tNy68tPEABEtcdno4hE6Y7f
|
||||
print(my_wallet.seed) # Example: sp6JS7f14BuwFY8Mw6bTtLKWauoUs
|
||||
```
|
||||
|
||||
_Java_
|
||||
|
||||
```java
|
||||
WalletFactory walletFactory = DefaultWalletFactory.getInstance();
|
||||
SeedWalletGenerationResult generationResult = walletFactory.randomWallet(false);
|
||||
Wallet wallet = generationResult.wallet();
|
||||
System.out.println(wallet.classicAddress()); // Example: rGCkuB7PBr5tNy68tPEABEtcdno4hE6Y7f
|
||||
System.out.println(generationResult.seed()); // Example: sp6JS7f14BuwFY8Mw6bTtLKWauoUs
|
||||
```
|
||||
|
||||
<!-- MULTICODE_BLOCK_END -->
|
||||
|
||||
**警告:** ローカルマシンで安全な方法で生成したアドレスとシークレットのみを使用してください。別のコンピューターでアドレスとシークレットを生成して、ネットワーク経由でそれらを自分に送信した場合は、ネットワーク上の他の人がその情報を見ることができる可能性があります。その情報見ることができる人は、あなたと同じようにあなたのXRPを操作できます。また、Test Netと本番で同じアドレスを使用しないことも推奨します。指定したパラメーターによっては、一方のネットワークに向けて作成したトランザクションが、もう一方のネットワークでも実行可能になるおそれがあるためです。
|
||||
|
||||
アドレスとシークレットを生成しても、直接XRPを入手できるわけではありません。単に乱数を選択しているだけです。また、そのアドレスでXRPを受け取って[アカウントに資金供給](accounts.html#アカウントの作成)する必要があります。XRPを取得する方法として最も一般的なのは、取引所から購入し、所有しているアドレスに入れる方法です。詳細は、Rippleの[XRP購入ガイド](https://ripple.com/xrp/buy-xrp/)を参照してください。
|
||||
アドレスとシークレットを生成しても、直接XRPを入手できるわけではありません。単に乱数を選択しているだけです。また、そのアドレスでXRPを受け取って[アカウントに資金供給](accounts.html#アカウントの作成)する必要があります。XRPを取得する方法として最も一般的なのは、取引所から購入し、所有しているアドレスに入れる方法です。詳細は、[XRP Overview](xrp-overview.html)を参照してください。
|
||||
|
||||
### 本番XRP Ledgerへの接続
|
||||
|
||||
`RippleAPI`オブジェクトのインスタンスを作成するときに、適切なXRP Ledgerと同期しているサーバーを指定する必要があります。多くの場合はRippleの公開サーバーを、以下のスニペットなどで使用できます。
|
||||
XRP Ledgerと同期しているサーバーを指定する必要があります。多くの場合は公開サーバーを、以下のスニペットなどで使用できます。
|
||||
|
||||
<!-- MULTICODE_BLOCK_START -->
|
||||
|
||||
_JavaScript_
|
||||
|
||||
```js
|
||||
ripple = require('ripple-lib')
|
||||
api = new ripple.RippleAPI({server: 'wss://s1.ripple.com:51233'})
|
||||
const xrpl = require('xrpl')
|
||||
const api = new xrpl.Client('wss://xrplcluster.com')
|
||||
api.connect()
|
||||
```
|
||||
|
||||
自分で[`rippled`をインストール](install-rippled.html)した場合は、デフォルトで本番ネットワークに接続されます。(代わりに、[Test Netに接続するように構成](connect-your-rippled-to-the-xrp-test-net.html)することもできます。)サーバーが同期されると(通常は起動から約15分以内)、RippleAPIをサーバーにローカルで接続することができます。そうすると、[さまざまなメリット](rippled-server-modes.html#ストックサーバーを運用する理由)があります。以下の例は、RippleAPIをデフォルト構成で運用されているサーバーに接続する方法を示しています。
|
||||
_Python_
|
||||
|
||||
```js
|
||||
ripple = require('ripple-lib')
|
||||
api = new ripple.RippleAPI({server: 'ws://localhost:6006'})
|
||||
api.connect()
|
||||
```py
|
||||
from xrpl.clients import JsonRpcClient
|
||||
client = JsonRpcClient("https://xrplcluster.com")
|
||||
```
|
||||
|
||||
_Java_
|
||||
|
||||
```java
|
||||
final HttpUrl rippledUrl = HttpUrl.get("https://xrplcluster.com");
|
||||
XrplClient xrplClient = new XrplClient(rippledUrl);
|
||||
```
|
||||
|
||||
<!-- MULTICODE_BLOCK_END -->
|
||||
|
||||
**ヒント:** ローカル接続では、WebSocketプロトコルのTLSで暗号化されたバージョン(`wss`)ではなく、暗号化されていないバージョン(`ws`)を使用します。この方式は、通信が同じマシンの中だけで行われてマシンの外に出て行かないという点で安全で、TLS証明書が不要であるため設定が簡単です。外部ネットワークとの接続では、必ず`wss`を使用してください。
|
||||
|
||||
## 次のステップ
|
||||
@@ -265,7 +320,7 @@ api.connect()
|
||||
このチュートリアルを完了後は、以下を試してみてください。
|
||||
|
||||
- 本番システム向けに[信頼できるトランザクションの送信](reliable-transaction-submission.html)を構築する
|
||||
- [RippleAPI JavaScriptリファレンス](rippleapi-reference.html)を参照して、XRP Ledgerの全機能を確認する
|
||||
- [xrpl.jsリファレンス](https://js.xrpl.org/)を参照して、XRP Ledgerの全機能を確認する
|
||||
- [アカウント設定](manage-account-settings.html)をカスタマイズする
|
||||
- [トランザクションのメタデータ](transaction-metadata.html)にトランザクションの結果の詳細がどのように記述されているかを知る
|
||||
- escrowやPayment Channelなどの[複雑な支払いタイプ](complex-payment-types.html)について調べる
|
||||
|
||||
@@ -35,7 +35,7 @@ labels:
|
||||
XRP Ledgerで署名するためのソフトウェアオプションは次のとおりです。
|
||||
|
||||
- パッケージ(`.deb`または`.rpm`。使用するLinuxディストリビューションによって異なる)ファイルから[`rippled`をインストール](install-rippled.html)し、[スタンドアロンモードで実行します](rippled-server-modes.html)。
|
||||
- [ripple-lib](rippleapi-reference.html)とその依存関係をオフラインでインストールします。例えば、Yarn Package Managerでは、[オフラインでの使用に関して推奨される手順](https://yarnpkg.com/blog/2016/11/24/offline-mirror/)があります。
|
||||
- [xrpl.js](https://github.com/XRPLF/xrpl.js/)とその依存関係をオフラインでインストールします。例えば、Yarn Package Managerでは、[オフラインでの使用に関して推奨される手順](https://yarnpkg.com/blog/2016/11/24/offline-mirror/)があります。
|
||||
- 関連項目: [安全な署名の設定](set-up-secure-signing.html)
|
||||
|
||||
オフラインマシンでトランザクションの指示を生成するプロセスを容易にするために、カスタムソフトウェアを設定することもできます。例えば、ソフトウェアで次に使用する[シーケンス番号][]を追跡したり、送信するトランザクションのタイプに応じた設定済みテンプレートを含めるといったことが可能です。
|
||||
|
||||
@@ -90,7 +90,7 @@ _JavaScript_
|
||||
|
||||
### {{n.next()}}. Prepare and Sign TicketCreate
|
||||
|
||||
Construct a [TicketCreate transaction][] using the sequence number you determined in the previous step. Use the `TicketCount` field to specify how many Tickets to create. For example, to [prepare a transaction](rippleapi-reference.html#preparetransaction) that would make 10 Tickets:
|
||||
Construct a [TicketCreate transaction][] using the sequence number you determined in the previous step. Use the `TicketCount` field to specify how many Tickets to create. For example, to prepare a transaction that would make 10 Tickets:
|
||||
|
||||
<!-- MULTICODE_BLOCK_START -->
|
||||
|
||||
@@ -165,7 +165,7 @@ The power of Tickets is that you can carry on with your account's business as us
|
||||
|
||||
### {{n.next()}}. Check Available Tickets
|
||||
|
||||
When you want to send a Ticketed transaction, you need to know what Ticket Sequence number to use for it. If you've been keeping careful track of your account, you already know which Tickets you have, but if you're not sure, you can use the [account_objects method][] (or [`getAccountObjects()`](rippleapi-reference.html#getaccountobjects)) to look up your available tickets. For example:
|
||||
When you want to send a Ticketed transaction, you need to know what Ticket Sequence number to use for it. If you've been keeping careful track of your account, you already know which Tickets you have, but if you're not sure, you can use the [account_objects method][] to look up your available tickets. For example:
|
||||
|
||||
<!-- MULTICODE_BLOCK_START -->
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ XRP Ledgerプロトコルは、ネットワークのすべてのサーバーで
|
||||
|
||||
### トランザクションのタイムライン
|
||||
|
||||
XRP Ledgerには、[`rippled` API](rippled-api.html)や[RippleAPI](rippleapi-reference.html)など、トランザクションを送信するためのAPIがいくつかあります。使用するAPIにかかわらず、トランザクションは以下のようにレジャーに適用されます。
|
||||
XRP Ledgerには、[HTTP / WebSocket API](rippled-api.html)や[クライアントライブラリ](client-libraries.html)など、トランザクションを送信するためのAPIがいくつかあります。使用するAPIにかかわらず、トランザクションは以下のようにレジャーに適用されます。
|
||||
|
||||
1. アカウント所有者は、トランザクションを作成して署名します。
|
||||
2. 所有者は、トランザクション候補として、そのトランザクションをネットワークに送信します。
|
||||
@@ -61,9 +61,7 @@ APIは、現在の進行中のレジャーにトランザクション候補を
|
||||
|
||||
`LastLedgerSequence`パラメーターを使用すれば、トランザクションが迅速に確認されず、将来のレジャーに含まれるような好ましくないケースを防止できます。`LastLedgerSequence`パラメーターは、各トランザクションに指定する必要があります。自動プロセスでは、最後に検証されたレジャーインデックスよりも4つ大きい数値を使用して、トランザクションが予測可能な方法で、かつ迅速に検証または拒否されるようにします。
|
||||
|
||||
`rippled` APIを使用するアプリケーションは、トランザクションの送信時に、`LastLedgerSequence`を明示的に指定する必要があります。
|
||||
|
||||
RippleAPIでは、[Transaction Instructions](rippleapi-reference.html#transaction-instructions)で説明されている`maxLedgerVersion`フィールドを使用して`LastLedgerSequence`を指定します。RippleAPIは、デフォルトで自動的に適切な値を提供します。期限なしで実行される可能性のあるトランザクションを実行する場合には、`maxLedgerVersion`を`null`に指定して故意に`LastLedgerSequence`を省略できますが、これはお勧めできません。
|
||||
トランザクションの送信時に、`LastLedgerSequence`を明示的に指定する必要があります。
|
||||
|
||||
## ベストプラクティス
|
||||
|
||||
@@ -185,9 +183,9 @@ For each persisted transaction without validated result:
|
||||
|
||||
アプリケーションでのこれらのアクションの実行方法は、アプリケーションが使用するAPIによって異なります。アプリケーションでは、以下のインターフェイスを使用できます。
|
||||
|
||||
1. [`rippled` API](rippled-api.html)
|
||||
2. [RippleAPI](rippleapi-reference.html)
|
||||
3. `rippled`上にレイヤーされた、任意の数の他のソフトウェアAPI
|
||||
1. [HTTP / WebSocket API](rippled-api.html)
|
||||
2. [クライアントライブラリ](client-libraries.html)
|
||||
3. 任意の数の他のソフトウェアAPI
|
||||
|
||||
### rippled - トランザクションの送信と確認
|
||||
|
||||
|
||||
@@ -74,9 +74,9 @@ labels:
|
||||
|
||||
この構成では、トランザクションにローカルで署名するために使用しているプログラミング言語のクライアントライブラリを使用します。使用しているプログラミング言語に対応するクライアントライブラリが必要です。Rippleは、XRP Ledgerのトランザクションにローカルで署名することができる次のクライアントライブラリを公開しています。
|
||||
|
||||
- **RippleAPI(ripple-lib)for JavaScript**
|
||||
- [設定](get-started-with-rippleapi-for-javascript.html)
|
||||
- [APIリファレンス](rippleapi-reference.html)
|
||||
- **xrpl.js (JavaScript / TypeScript)**
|
||||
- [設定](get-started-using-javascript.html)
|
||||
- [APIリファレンス](https://js.xrpl.org/)
|
||||
- **Signing Library for C++**(`rippled`に付属)
|
||||
- [ドキュメント](https://github.com/ripple/rippled/tree/develop/Builds/linux#signing-library)
|
||||
|
||||
@@ -126,8 +126,8 @@ Rippleが公開したものでないクライアントライブラリを使用
|
||||
- **リファレンス:**
|
||||
- [signメソッド][]
|
||||
- [submitメソッド][]
|
||||
- [RippleAPIリファレンス](rippleapi-reference.html)
|
||||
|
||||
- [xrpl.jsリファレンス](https://js.xrpl.org/)
|
||||
- [`xrpl-py`リファレンス](https://xrpl-py.readthedocs.io/)
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -150,8 +150,9 @@ To use this configuration, follow the steps for [running `rippled` on a private
|
||||
- **References:**
|
||||
- [sign method][]
|
||||
- [submit method][]
|
||||
- [RippleAPI Reference](rippleapi-reference.html)
|
||||
- [xrpl.js Reference](https://js.xrpl.org/)
|
||||
- [`xrpl-py` Reference](https://xrpl-py.readthedocs.io/en/latest/index.html)
|
||||
- [`xrpl4j` Reference](https://javadoc.io/doc/org.xrpl/)
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -37,10 +37,6 @@ _[Checks Amendment][]が必要です。_
|
||||
| `Account` | 文字列(アドレス) | Checkを取り消す送信元のアドレス。(あなたのアドレスです。) |
|
||||
| `CheckID` | 文字列 | レジャーで取り消すCheckオブジェクトのID。この情報を確認するには、[txメソッド][]を使用してCheckCreateトランザクションのメタデータを調べるか、または[account_objectsメソッド][]を使用してCheckを探します。 |
|
||||
|
||||
[RippleAPI](rippleapi-reference.html)を使用している場合は、`prepareCheckCancel()`ヘルパーメソッドを使用できます。
|
||||
|
||||
**注記:** CheckはRippleAPIバージョン0.19.0以降でサポートされています。
|
||||
|
||||
### CheckCancelトランザクションの準備の例
|
||||
|
||||
Checkを取り消す例を以下に示します。
|
||||
@@ -58,7 +54,7 @@ Checkを取り消す例を以下に示します。
|
||||
}
|
||||
```
|
||||
|
||||
*RippleAPI*
|
||||
*ripple-lib 1.x*
|
||||
|
||||
```js
|
||||
{% include '_code-samples/checks/js/prepareCancel.js' %}
|
||||
@@ -74,7 +70,7 @@ Checkを取り消す例を以下に示します。
|
||||
|
||||
<!-- MULTICODE_BLOCK_START -->
|
||||
|
||||
*RippleAPI*
|
||||
*ripple-lib 1.x*
|
||||
|
||||
```js
|
||||
{% include '_code-samples/checks/js/signCancel.js' %}
|
||||
@@ -93,7 +89,7 @@ Checkを取り消す例を以下に示します。
|
||||
|
||||
<!-- MULTICODE_BLOCK_START -->
|
||||
|
||||
*RippleAPI*
|
||||
*ripple-lib 1.x*
|
||||
|
||||
```
|
||||
{% include '_code-samples/checks/js/sign-cancel-resp.txt' %}
|
||||
@@ -117,7 +113,7 @@ Checkを取り消す例を以下に示します。
|
||||
|
||||
<!-- MULTICODE_BLOCK_START -->
|
||||
|
||||
*RippleAPI*
|
||||
*ripple-lib 1.x*
|
||||
|
||||
```js
|
||||
{% include '_code-samples/checks/js/submitCancel.js' %}
|
||||
@@ -136,7 +132,7 @@ Checkを取り消す例を以下に示します。
|
||||
|
||||
<!-- MULTICODE_BLOCK_START -->
|
||||
|
||||
*RippleAPI*
|
||||
*ripple-lib 1.x*
|
||||
|
||||
```js
|
||||
{% include '_code-samples/checks/js/submit-cancel-resp.txt' %}
|
||||
@@ -164,7 +160,7 @@ Checkを取り消す例を以下に示します。
|
||||
|
||||
<!-- MULTICODE_BLOCK_START -->
|
||||
|
||||
*RippleAPI*
|
||||
*ripple-lib 1.x*
|
||||
|
||||
```js
|
||||
{% include '_code-samples/checks/js/getCancelTx.js' %}
|
||||
@@ -183,7 +179,7 @@ Checkを取り消す例を以下に示します。
|
||||
|
||||
<!-- MULTICODE_BLOCK_START -->
|
||||
|
||||
*RippleAPI*
|
||||
*ripple-lib 1.x*
|
||||
|
||||
```json
|
||||
{% include '_code-samples/checks/js/get-cancel-tx-resp.txt' %}
|
||||
@@ -198,7 +194,6 @@ Checkを取り消す例を以下に示します。
|
||||
<!-- MULTICODE_BLOCK_END -->
|
||||
|
||||
<!--{# common link defs #}-->
|
||||
[RippleAPI]: rippleapi-reference.html
|
||||
{% include '_snippets/rippled-api-links.md' %}
|
||||
{% include '_snippets/tx-type-links.md' %}
|
||||
{% include '_snippets/rippled_versions.md' %}
|
||||
|
||||
@@ -22,9 +22,8 @@ To cancel a Check with this tutorial, you need the following:
|
||||
- You need the ID of a Check object currently in the ledger.
|
||||
- For example, this tutorial includes examples that cancel a Check with the ID `49647F0D748DC3FE26BDACBC57F251AADEFFF391403EC9BF87C97F67E9977FB0`, although you must use a different ID to go through these steps yourself.
|
||||
- The **address** and **secret key** of a funded account to send the CheckCancel transaction. This address must be either the sender or the recipient of the Check, unless the Check is expired.
|
||||
- A secure way to sign transactions, such as [RippleAPI][] or your own [`rippled` server](install-rippled.html).
|
||||
- A client library that can connect to a `rippled` server, such as [RippleAPI][] or any HTTP or WebSocket library.
|
||||
- For more information, see [Get Started with the `rippled` API](get-started-using-http-websocket-apis.html).
|
||||
- A [secure way to sign transactions](set-up-secure-signing.html).
|
||||
- A [client library](client-libraries.html) or any HTTP or WebSocket library.
|
||||
|
||||
|
||||
## {{cancel_n.next()}}. Prepare the CheckCancel transaction
|
||||
@@ -37,10 +36,6 @@ Figure out the values of the [CheckCancel transaction][] fields. The following f
|
||||
| `Account` | String (Address) | The address of the sender who is canceling the Check. (In other words, your address.) |
|
||||
| `CheckID` | String | The ID of the Check object in the ledger to cancel. You can get this information by looking up the metadata of the CheckCreate transaction using the [tx method][] or by looking for Checks using the [account_objects method][]. |
|
||||
|
||||
If you are using [RippleAPI](rippleapi-reference.html), you can use the `prepareCheckCancel()` helper method.
|
||||
|
||||
**Note:** RippleAPI supports Checks in versions 0.19.0 and up.
|
||||
|
||||
### Example CheckCancel Preparation
|
||||
|
||||
The following examples demonstrate how to cancel a Check.
|
||||
@@ -58,7 +53,7 @@ The following examples demonstrate how to cancel a Check.
|
||||
}
|
||||
```
|
||||
|
||||
*RippleAPI*
|
||||
*ripple-lib 1.x*
|
||||
|
||||
```js
|
||||
{% include '_code-samples/checks/js/prepareCancel.js' %}
|
||||
@@ -74,7 +69,7 @@ The following examples demonstrate how to cancel a Check.
|
||||
|
||||
<!-- MULTICODE_BLOCK_START -->
|
||||
|
||||
*RippleAPI*
|
||||
*ripple-lib 1.x*
|
||||
|
||||
```js
|
||||
{% include '_code-samples/checks/js/signCancel.js' %}
|
||||
@@ -93,7 +88,7 @@ The following examples demonstrate how to cancel a Check.
|
||||
|
||||
<!-- MULTICODE_BLOCK_START -->
|
||||
|
||||
*RippleAPI*
|
||||
*ripple-lib 1.x*
|
||||
|
||||
```
|
||||
{% include '_code-samples/checks/js/sign-cancel-resp.txt' %}
|
||||
@@ -117,7 +112,7 @@ The following examples demonstrate how to cancel a Check.
|
||||
|
||||
<!-- MULTICODE_BLOCK_START -->
|
||||
|
||||
*RippleAPI*
|
||||
*ripple-lib 1.x*
|
||||
|
||||
```js
|
||||
{% include '_code-samples/checks/js/submitCancel.js' %}
|
||||
@@ -136,7 +131,7 @@ The following examples demonstrate how to cancel a Check.
|
||||
|
||||
<!-- MULTICODE_BLOCK_START -->
|
||||
|
||||
*RippleAPI*
|
||||
*ripple-lib 1.x*
|
||||
|
||||
```js
|
||||
{% include '_code-samples/checks/js/submit-cancel-resp.txt' %}
|
||||
@@ -164,7 +159,7 @@ Look for a `DeletedNode` object in the transaction metadata with `"LedgerEntryTy
|
||||
|
||||
<!-- MULTICODE_BLOCK_START -->
|
||||
|
||||
*RippleAPI*
|
||||
*ripple-lib 1.x*
|
||||
|
||||
```js
|
||||
{% include '_code-samples/checks/js/getCancelTx.js' %}
|
||||
@@ -183,7 +178,7 @@ Look for a `DeletedNode` object in the transaction metadata with `"LedgerEntryTy
|
||||
|
||||
<!-- MULTICODE_BLOCK_START -->
|
||||
|
||||
*RippleAPI*
|
||||
*ripple-lib 1.x*
|
||||
|
||||
```json
|
||||
{% include '_code-samples/checks/js/get-cancel-tx-resp.txt' %}
|
||||
@@ -198,7 +193,6 @@ Look for a `DeletedNode` object in the transaction metadata with `"LedgerEntryTy
|
||||
<!-- MULTICODE_BLOCK_END -->
|
||||
|
||||
<!--{# common link defs #}-->
|
||||
[RippleAPI]: rippleapi-reference.html
|
||||
{% include '_snippets/rippled-api-links.md' %}
|
||||
{% include '_snippets/tx-type-links.md' %}
|
||||
{% include '_snippets/rippled_versions.md' %}
|
||||
|
||||
@@ -50,7 +50,7 @@ Checkを変動金額で換金するためのトランザクションを準備す
|
||||
}
|
||||
```
|
||||
|
||||
*RippleAPI*
|
||||
*ripple-lib 1.x*
|
||||
|
||||
```js
|
||||
{% include '_code-samples/checks/js/prepareCashFlex.js' %}
|
||||
@@ -211,6 +211,5 @@ Checkが変動する`DeliverMin`の額で換金された場合は、Checkは少
|
||||
- 発行済み通貨に[送金手数料](transfer-fees.html)がある場合、受取人への入金額を上回る額がCheckの送金元から引き落とされます。(この差額が送金手数料であり、これがイシュアーに戻されることによりイシュアーの正味の債務は減少します。)
|
||||
|
||||
<!--{# common links #}-->
|
||||
[RippleAPI]: rippleapi-reference.html
|
||||
{% include '_snippets/tx-type-links.md' %}
|
||||
{% include '_snippets/rippled-api-links.md' %}
|
||||
|
||||
@@ -50,7 +50,7 @@ The following examples show how to prepare a transaction to cash a Check for a f
|
||||
}
|
||||
```
|
||||
|
||||
*RippleAPI*
|
||||
*ripple-lib 1.x*
|
||||
|
||||
```js
|
||||
{% include '_code-samples/checks/js/prepareCashFlex.js' %}
|
||||
@@ -211,6 +211,5 @@ If the Check was cashed for a flexible `DeliverMin` amount and succeeded, you ca
|
||||
- If the issued currency has a [transfer fee](transfer-fees.html), the Check's sender may be debited more than the recipient is credited. (The difference is the transfer fee, which is returned to the issuer as a decreased net obligation.)
|
||||
|
||||
<!--{# common links #}-->
|
||||
[RippleAPI]: rippleapi-reference.html
|
||||
{% include '_snippets/tx-type-links.md' %}
|
||||
{% include '_snippets/rippled-api-links.md' %}
|
||||
|
||||
@@ -49,7 +49,7 @@ Checkを正確な金額で換金するためのトランザクションを準備
|
||||
}
|
||||
```
|
||||
|
||||
*RippleAPI*
|
||||
*ripple-lib 1.x*
|
||||
|
||||
```js
|
||||
{% include '_code-samples/checks/js/prepareCashExact.js' %}
|
||||
@@ -155,6 +155,5 @@ Checkを換金できない場合、Checkはレジャーに残るため、後日
|
||||
<!-- MULTICODE_BLOCK_END -->
|
||||
|
||||
<!--{# common links #}-->
|
||||
[RippleAPI]: rippleapi-reference.html
|
||||
{% include '_snippets/tx-type-links.md' %}
|
||||
{% include '_snippets/rippled-api-links.md' %}
|
||||
|
||||
@@ -49,7 +49,7 @@ The following examples show how to prepare a transaction to cash a Check for a f
|
||||
}
|
||||
```
|
||||
|
||||
*RippleAPI*
|
||||
*ripple-lib 1.x*
|
||||
|
||||
```js
|
||||
{% include '_code-samples/checks/js/prepareCashExact.js' %}
|
||||
@@ -155,6 +155,5 @@ If cashing the Check failed, the Check remains in the ledger so you can try cash
|
||||
<!-- MULTICODE_BLOCK_END -->
|
||||
|
||||
<!--{# common links #}-->
|
||||
[RippleAPI]: rippleapi-reference.html
|
||||
{% include '_snippets/tx-type-links.md' %}
|
||||
{% include '_snippets/rippled-api-links.md' %}
|
||||
|
||||
@@ -17,7 +17,6 @@ _[Checks Amendment][]が必要です。_
|
||||
|
||||
**注記:**`account_objects`コマンドのコマンドラインインターフェイスでは`type`フィールドは受け入れられません。代わりに[jsonメソッド][]を使用してコマンドラインからJSON-RPCフォーマットの要求を送信できます。
|
||||
|
||||
**注記:** RippleAPIには、`account_objects`メソッドの組み込みサポートはありません。`api.connection.request(websocket_request_json)`メソッドを使用して、Webフォーマットで未加工の要求を作成できます。
|
||||
|
||||
### 要求の例
|
||||
|
||||
@@ -81,6 +80,5 @@ for (i=0; i < account_objects_response.account_objects.length; i++) {
|
||||
```
|
||||
|
||||
<!--{# common links #}-->
|
||||
[RippleAPI]: rippleapi-reference.html
|
||||
{% include '_snippets/tx-type-links.md' %}
|
||||
{% include '_snippets/rippled-api-links.md' %}
|
||||
|
||||
@@ -17,13 +17,11 @@ To get a list of all incoming and outgoing Checks for an account, use the `accou
|
||||
|
||||
**Note:** The commandline interface to the `account_objects` command does not accept the `type` field. You can use the [json method][] to send the JSON-RPC format request on the commandline instead.
|
||||
|
||||
**Note:** RippleAPI does not have built-in support for the `account_objects` method. You can make a raw request in the WebSocket format using the `api.connection.request(websocket_request_json)` method.
|
||||
|
||||
### Example Request
|
||||
|
||||
<!-- MULTICODE_BLOCK_START -->
|
||||
|
||||
*RippleAPI*
|
||||
*ripple-lib 1.x*
|
||||
|
||||
```js
|
||||
{% include '_code-samples/checks/js/getChecks.js' %}
|
||||
@@ -41,7 +39,7 @@ To get a list of all incoming and outgoing Checks for an account, use the `accou
|
||||
|
||||
<!-- MULTICODE_BLOCK_START -->
|
||||
|
||||
*RippleAPI*
|
||||
*ripple-lib 1.x*
|
||||
|
||||
```
|
||||
{% include '_code-samples/checks/js/get-checks-resp.txt' %}
|
||||
@@ -81,6 +79,5 @@ for (i=0; i < account_objects_response.account_objects.length; i++) {
|
||||
```
|
||||
|
||||
<!--{# common links #}-->
|
||||
[RippleAPI]: rippleapi-reference.html
|
||||
{% include '_snippets/tx-type-links.md' %}
|
||||
{% include '_snippets/rippled-api-links.md' %}
|
||||
|
||||
@@ -19,8 +19,6 @@ _[Checks Amendment][]が必要です。_
|
||||
|
||||
**注記:**`account_objects`コマンドのコマンドラインインターフェイスでは`type`フィールドは受け入れられません。代わりに[jsonメソッド][]を使用してコマンドラインからJSON-RPCフォーマットの要求を送信できます。
|
||||
|
||||
**注意:** RippleAPIには、`account_objects`メソッドの組み込みサポートはありません。`api.connection.request(websocket_request_json)`メソッドを使用して、Webフォーマットで未加工の要求を作成できます。このメソッドに対する応答のフォーマットは`rippled` APIフォーマットです。(たとえばXRPは小数ではなく整数の「drop数」で指定します。)
|
||||
|
||||
### 要求の例
|
||||
|
||||
<!-- MULTICODE_BLOCK_START -->
|
||||
@@ -82,6 +80,5 @@ for (i=0; i < account_objects_response.account_objects.length; i++) {
|
||||
```
|
||||
|
||||
<!--{# common links #}-->
|
||||
[RippleAPI]: rippleapi-reference.html
|
||||
{% include '_snippets/tx-type-links.md' %}
|
||||
{% include '_snippets/rippled-api-links.md' %}
|
||||
|
||||
@@ -19,13 +19,11 @@ To get a list of all incoming and outgoing Checks for an account, use the `accou
|
||||
|
||||
**Note:** The commandline interface to the `account_objects` command does not accept the `type` field. You can use the [json method][] to send the JSON-RPC format request on the commandline instead.
|
||||
|
||||
**Caution:** RippleAPI does not have built-in support for the `account_objects` method. You can make a raw request in the WebSocket format using the `api.connection.request(websocket_request_json)` method. The response to this method is in the `rippled` API format. (For example, XRP is specified in integer "drops" rather than as a decimal.)
|
||||
|
||||
### Example Request
|
||||
|
||||
<!-- MULTICODE_BLOCK_START -->
|
||||
|
||||
*RippleAPI*
|
||||
*ripple-lib 1.x*
|
||||
|
||||
```js
|
||||
{% include '_code-samples/checks/js/getChecks.js' %}
|
||||
@@ -43,7 +41,7 @@ To get a list of all incoming and outgoing Checks for an account, use the `accou
|
||||
|
||||
<!-- MULTICODE_BLOCK_START -->
|
||||
|
||||
*RippleAPI*
|
||||
*ripple-lib 1.x*
|
||||
|
||||
```
|
||||
{% include '_code-samples/checks/js/get-checks-resp.txt' %}
|
||||
@@ -82,6 +80,5 @@ for (i=0; i < account_objects_response.account_objects.length; i++) {
|
||||
```
|
||||
|
||||
<!--{# common links #}-->
|
||||
[RippleAPI]: rippleapi-reference.html
|
||||
{% include '_snippets/tx-type-links.md' %}
|
||||
{% include '_snippets/rippled-api-links.md' %}
|
||||
|
||||
@@ -26,9 +26,8 @@ XRP Ledgerの外部でGrand PaymentsはBoxSend SGに請求書(IDは`46060241FA
|
||||
- Checkの送信元である資金供給のあるアカウントの**アドレス**と**シークレットキー**。
|
||||
- [XRP Ledger Test Net Faucet](xrp-test-net-faucet.html)を使用して、10,000 Test Net XRPを保有する資金供給のあるアドレスおよびシークレットを取得できます。
|
||||
- Checkを受領する資金供給のあるアカウントの**アドレス**。
|
||||
- トランザクションに安全に署名できる手段([RippleAPI][]や各自の[`rippled`サーバー](install-rippled.html)など)。
|
||||
- `rippled`サーバーに接続できるクライアントライブラリ([RippleAPI][]、HTTPライブラリ、またはWebSocketライブラリなど)。
|
||||
- 詳細は、[`rippled` APIの使用開始](get-started-using-http-websocket-apis.html)を参照してください。
|
||||
- トランザクションに[安全に署名できる手段](set-up-secure-signing.html)。
|
||||
- [クライアントライブラリ](client-libraries.html)またはHTTPライブラリ、WebSocketライブラリなど。
|
||||
|
||||
## {{send_n.next()}}.CheckCreateトランザクションの準備
|
||||
|
||||
@@ -41,10 +40,6 @@ Checkの額と、Checkを現金化できる当事者を決定します。[CheckC
|
||||
| `Destination` | 文字列(アドレス) | Checkを換金できる指定受取人のアドレス。 |
|
||||
| `SendMax` | 文字列またはオブジェクト(額) | Checkが現金化されるときに送金元から引き出される最大額。XRPの場合、XRPのdrop数を示す文字列を使用します。発行済み通貨の場合、`currency`、`issuer`、および`value` フィールドを含むオブジェクトを使用します。詳細は、[通貨額の指定][]を参照してください。受取人がXRP以外の通貨で正確な額のCheckを換金できるようにし、かつ[送金手数料](transfer-fees.html)を含めるには、送金手数料分の追加パーセンテージを必ず指定してください。(たとえば受取人が送金手数料2%でCheckをイシュアーからの100 CADに現金化できるようにするには、`SendMax`をイシュアーからの102 CADに設定する必要があります。) |
|
||||
|
||||
[RippleAPI](rippleapi-reference.html)を使用している場合は、`prepareCheckCreate()`ヘルパーメソッドを使用できます。
|
||||
|
||||
**注記:** ChecksはRippleAPIバージョン0.19.0以上でサポートされています。
|
||||
|
||||
### CheckCreateトランザクションの準備の例
|
||||
|
||||
以下の例は、BoxSend SG(rBXsgNkPcDN2runsvWmwxk3Lh97zdgo9za)がGrand Payments(rGPnRH1EBpHeTF2QG8DCAgM7z5pb75LAis)宛てに作成した100 XRPのCheckです。追加(オプション)のメタデータとして、BoxSend SGはGrand Paymentsの請求書のIDを追加しています。これによりGrand PaymentsはこのCheckがどの請求書に対する支払いかを確認できます。
|
||||
@@ -63,7 +58,7 @@ Checkの額と、Checkを現金化できる当事者を決定します。[CheckC
|
||||
}
|
||||
```
|
||||
|
||||
*RippleAPI*
|
||||
*ripple-lib 1.x*
|
||||
|
||||
```js
|
||||
{% include '_code-samples/checks/js/prepareCreate.js' %}
|
||||
@@ -241,7 +236,6 @@ Checkの額と、Checkを現金化できる当事者を決定します。[CheckC
|
||||
<!-- MULTICODE_BLOCK_END -->
|
||||
|
||||
<!--{# common link defs #}-->
|
||||
[RippleAPI]: rippleapi-reference.html
|
||||
{% include '_snippets/rippled-api-links.md' %}
|
||||
{% include '_snippets/tx-type-links.md' %}
|
||||
{% include '_snippets/rippled_versions.md' %}
|
||||
|
||||
@@ -41,17 +41,13 @@ Decide how much money the Check is for and who can cash it. Figure out the value
|
||||
| `Destination` | String (Address) | The address of the intended recipient who can cash the Check. |
|
||||
| `SendMax` | String or Object (Amount) | The maximum amount the sender can be debited when this Check gets cashed. For XRP, use a string representing drops of XRP. For issued currencies, use an object with `currency`, `issuer`, and `value` fields. See [Specifying Currency Amounts][] for details. If you want the recipient to be able to cash the Check for an exact amount of a non-XRP currency with a [transfer fee](transfer-fees.html), remember to include an extra percentage to pay for the transfer fee. (For example, for the recipient to cash a Check for 100 CAD from an issuer with a 2% transfer fee, you must set the `SendMax` to 102 CAD from that issuer.) |
|
||||
|
||||
If you are using [RippleAPI](rippleapi-reference.html), you can use the `prepareCheckCreate()` helper method.
|
||||
|
||||
**Note:** RippleAPI supports Checks in versions 0.19.0 and up.
|
||||
|
||||
### Example CheckCreate Preparation
|
||||
|
||||
The following example shows a prepared Check from BoxSend SG (`rBXsgNkPcDN2runsvWmwxk3Lh97zdgo9za`) to Grand Payments (`rGPnRH1EBpHeTF2QG8DCAgM7z5pb75LAis`) for 100 XRP. As additional (optional) metadata, BoxSend SG adds the ID of the invoice from Grand Payments so Grand Payments knows which invoice this Check is intended to pay.
|
||||
|
||||
<!-- MULTICODE_BLOCK_START -->
|
||||
|
||||
*RippleAPI*
|
||||
*ripple-lib 1.x*
|
||||
|
||||
```js
|
||||
{% include '_code-samples/checks/js/prepareCreate.js' %}
|
||||
@@ -80,7 +76,7 @@ The following example shows a prepared Check from BoxSend SG (`rBXsgNkPcDN2runsv
|
||||
|
||||
<!-- MULTICODE_BLOCK_START -->
|
||||
|
||||
*RippleAPI*
|
||||
*ripple-lib 1.x*
|
||||
|
||||
```js
|
||||
{% include '_code-samples/checks/js/signCreate.js' %}
|
||||
@@ -104,7 +100,7 @@ The following example shows a prepared Check from BoxSend SG (`rBXsgNkPcDN2runsv
|
||||
|
||||
<!-- MULTICODE_BLOCK_START -->
|
||||
|
||||
*RippleAPI*
|
||||
*ripple-lib 1.x*
|
||||
|
||||
```js
|
||||
{% include '_code-samples/checks/js/sign-create-resp.txt' %}
|
||||
@@ -134,7 +130,7 @@ The following example shows a prepared Check from BoxSend SG (`rBXsgNkPcDN2runsv
|
||||
|
||||
<!-- MULTICODE_BLOCK_START -->
|
||||
|
||||
*RippleAPI*
|
||||
*ripple-lib 1.x*
|
||||
|
||||
```js
|
||||
{% include '_code-samples/checks/js/submitCreate.js' %}
|
||||
@@ -158,7 +154,7 @@ The following example shows a prepared Check from BoxSend SG (`rBXsgNkPcDN2runsv
|
||||
|
||||
<!-- MULTICODE_BLOCK_START -->
|
||||
|
||||
*RippleAPI*
|
||||
*ripple-lib 1.x*
|
||||
|
||||
```js
|
||||
{% include '_code-samples/checks/js/submit-create-resp.txt' %}
|
||||
@@ -190,13 +186,11 @@ Use the [tx method][] with the CheckCreate transaction's identifying hash to che
|
||||
|
||||
Look for a `CreatedNode` object in the transaction metadata with a `LedgerEntryType` of `"Check"`. This indicates that the transaction created a [Check ledger object](check.html). The `LedgerIndex` of this object is the ID of the Check. In the following example, the Check's ID is `84C61BE9B39B2C4A2267F67504404F1EC76678806C1B901EA781D1E3B4CE0CD9`.
|
||||
|
||||
**Note:** RippleAPI does not report the Check's ID when you look up a CheckCreate transaction. You can work around this by calculating the Check's ID from the [Check ID format](check.html#check-id-format), as in the example RippleAPI code below, or you can use the [`getAccountObjects()` method](rippleapi-reference.html#getaccountobjects) to look up the Check and find its ID.
|
||||
|
||||
### Example Request
|
||||
|
||||
<!-- MULTICODE_BLOCK_START -->
|
||||
|
||||
*RippleAPI*
|
||||
*ripple-lib 1.x*
|
||||
|
||||
```
|
||||
{% include '_code-samples/checks/js/getCreateTx.js' %}
|
||||
@@ -220,7 +214,7 @@ Look for a `CreatedNode` object in the transaction metadata with a `LedgerEntryT
|
||||
|
||||
<!-- MULTICODE_BLOCK_START -->
|
||||
|
||||
*RippleAPI*
|
||||
*ripple-lib 1.x*
|
||||
|
||||
```
|
||||
{% include '_code-samples/checks/js/get-create-tx-resp.txt' %}
|
||||
@@ -241,7 +235,6 @@ Look for a `CreatedNode` object in the transaction metadata with a `LedgerEntryT
|
||||
<!-- MULTICODE_BLOCK_END -->
|
||||
|
||||
<!--{# common link defs #}-->
|
||||
[RippleAPI]: rippleapi-reference.html
|
||||
{% include '_snippets/rippled-api-links.md' %}
|
||||
{% include '_snippets/tx-type-links.md' %}
|
||||
{% include '_snippets/rippled_versions.md' %}
|
||||
|
||||
@@ -41,7 +41,7 @@ Main article: [Trust Lines and Issuing](trust-lines-and-issuing.html).
|
||||
|
||||
### XRP
|
||||
|
||||
[**XRP**](xrp.html) is the native cryptocurrency of the XRP Ledger. XRP can be sent directly from any XRP Ledger address to any other, without going through a gateway or liquidity provider. This helps make XRP a convenient bridge currency. For more information on XRP, see the [XRP Portal](https://ripple.com/xrp/).
|
||||
[**XRP**](xrp.html) is the native cryptocurrency of the XRP Ledger. XRP can be sent directly from any XRP Ledger address to any other, without going through a gateway or liquidity provider. This helps make XRP a convenient bridge currency. For more information on XRP, see the [XRP Overview](xrp-overview.html).
|
||||
|
||||
Issuing gateways do not need to accumulate or exchange XRP. They must only hold a small balance of XRP to meet the [reserve requirements](reserves.html) and pay the [cost of sending transactions](transaction-cost.html) through the network. The XRP equivalent of $10 USD should be enough for at least one year of transaction costs for a busy gateway.
|
||||
|
||||
@@ -54,9 +54,8 @@ The XRP Ledger contains a [decentralized asset exchange](decentralized-exchange.
|
||||
|
||||
Currency traders who hold a gateway's issued currencies can provide liquidity to other popular currencies, without the gateway needing to float a large reserve in various destination currencies. The gateway also does not need to take on the risk of holding a variety of currencies. However, a gateway _may_ still want to provide liquidity to XRP or other popular currencies at a baseline rate, especially when the gateway is new to the exchange. If you do provide liquidity, **use a different address for trading than your issuing address.**
|
||||
|
||||
Third-party liquidity providers can use the [`rippled` APIs](rippled-api.html), [RippleAPI JavaScript Library](rippleapi-reference.html), or a third-party client application to access the distributed exchange. It may also help client applications to surface information about your gateway to clients if you provide an [`xrp-ledger.toml` file](xrp-ledger-toml.html).
|
||||
Liquidity providers can use the [HTTP / WebSocket APIs](rippled-api.html), [client libraries](client-libraries.html), or another application to access the distributed exchange. It may also help client applications to surface information about your gateway to clients if you provide an [`xrp-ledger.toml` file](xrp-ledger-toml.html).
|
||||
|
||||
Contact [partners@ripple.com](mailto:partners@ripple.com) for help establishing liquidity between your gateway and others.
|
||||
|
||||
|
||||
## Suggested Business Practices
|
||||
@@ -381,23 +380,23 @@ Historically, Ripple (the company) issued gateway bulletins to introduce new fea
|
||||
|
||||
## Infrastructure
|
||||
|
||||
For the gateway's own security as well as the stability of the network, Ripple recommends that each gateway run its own `rippled` servers. Ripple provides detailed and individualized recommendations to businesses interested in running a significant XRP-based business.
|
||||
For the gateway's own security as well as the stability of the network, each gateway should run its own `rippled` servers including one [validator](rippled-server-modes.html#validators).
|
||||
|
||||
Contact [partners@ripple.com](mailto:partners@ripple.com) to see how Ripple can help.
|
||||
|
||||
### APIs and Middleware
|
||||
|
||||
There are several interfaces you can use to connect to the XRP Ledger, depending on your needs and your existing software:
|
||||
|
||||
* [`rippled`](rippled-api.html) provides JSON-RPC and WebSocket APIs that can be used as a low-level interface to all core XRP Ledger functionality.
|
||||
* [RippleAPI](rippleapi-reference.html) provides a simplified API for JavaScript applications.
|
||||
* [Client Libraries](client-libraries.html) are available in several programming languages to provide convenient utilities for accessing the XRP Ledger.
|
||||
* Other tools such as [xApps](https://xumm.readme.io/docs/xapps) are also available.
|
||||
|
||||
|
||||
## Tool Security
|
||||
|
||||
Any time you submit an XRP Ledger transaction, it must be signed using your secret key. The secret key gives full control over your XRP Ledger address. **Never** send your secret key to a server run by someone else. Either use your own `rippled` server, or sign the transactions locally before sending them to a `rippled` server.
|
||||
|
||||
The examples in this document show API methods that include a secret key. This is only safe if you control `rippled` server yourself, *and* you connect to it over a connection that is secure from outside listeners. (For example, you could connect over a loopback (`localhost`) network, a private network, or an encrypted VPN.) Alternatively, you could use [RippleAPI](rippleapi-reference.html) to sign transactions locally before submitting them to a third-party server.
|
||||
The examples in this document show API methods that include a secret key. This is only safe if you control `rippled` server yourself, *and* you connect to it over a connection that is secure from outside listeners. For instructions and examples of other secure configurations, see [Set Up Secure Signing](set-up-secure-signing.html).
|
||||
|
||||
|
||||
## Default Ripple
|
||||
@@ -607,7 +606,7 @@ To make things simpler for your customers, we recommend accepting payments to ei
|
||||
|
||||
As an added precaution, we recommend comparing the balances of your issuing address with the collateral funds in your internal accounting system as of each new XRP Ledger ledger version. The issuing address's negative balances should match the assets you have allocated to XRP Ledger outside the network. If the two do not match up, then you should suspend processing payments into and out of the XRP Ledger until you have resolved the discrepancy.
|
||||
|
||||
* Use `rippled`'s [gateway_balances method][] or [RippleAPI's `getTrustlines` method](rippleapi-reference.html#gettrustlines) to check your balances.
|
||||
* Use the [gateway_balances method][] to check your balances.
|
||||
* If you have a [Transfer Fee](#transfer-fees) set, then your obligations within the XRP Ledger decrease slightly whenever other XRP Ledger addresses transfer your issued currencies among themselves.
|
||||
|
||||
|
||||
@@ -761,10 +760,7 @@ The first requirement to bouncing payments is [robustly monitoring for incoming
|
||||
|
||||
Second, you should send bounced payments as Partial Payments. Since third parties can manipulate the cost of pathways between addresses, Partial Payments allow you to divest yourself of the full amount without being concerned about exchange rates within the XRP Ledger. You should publicize your bounced payments policy as part of your terms of use. Send the bounced payment from either an operational address or a standby address.
|
||||
|
||||
* To send a Partial Payment using `rippled`, enable the [`tfPartialPayment` flag](payment.html#payment-flags) on the transaction. Set the `Amount` field to the amount you received and omit the `SendMax` field.
|
||||
* To send a Partial Payment using RippleAPI, set the `allowPartialPayment` field of the [Payment object](rippleapi-reference.html#payment) to `true`. Set the `source.maxAmount` and `destination.amount` both equal to the amount you received.
|
||||
|
||||
You should use the `SourceTag` value (`source.tag` in RippleAPI) from the incoming payment as the `DestinationTag` value (`destination.tag` in RippleAPI) for the return payment.
|
||||
To send a Partial Payment, enable the [`tfPartialPayment` flag](payment.html#payment-flags) on the transaction. Set the `Amount` field to the amount you received and omit the `SendMax` field. You should use the `SourceTag` value from the incoming payment as the `DestinationTag` value for the return payment.
|
||||
|
||||
To prevent two systems from bouncing payments back and forth indefinitely, you can set a new Source Tag for the outgoing return payment. If you receive an unexpected payment whose Destination Tag matches the Source Tag of a return you sent, then do not bounce it back again.
|
||||
|
||||
|
||||
@@ -311,7 +311,7 @@ XRP残高</i></b></td>
|
||||
|
||||
CharlieというユーザーがAlpha Exchangeに50,000XRPを入金したいと希望しています。これには、以下のステップが伴います。
|
||||
|
||||
1. Charlieは50,000XRPの支払いを([RippleAPI](rippleapi-reference.html)または類似のソフトウェアを使用して)、Alpha Exchangeの[コールドウォレット](#アカウント)に送信します。
|
||||
1. Charlieは50,000XRPの支払いを、Alpha Exchangeの[コールドウォレット](#アカウント)に送信します。
|
||||
|
||||
a. Charlieは識別子(このケースでは`789`)を支払いに追加し、Alpha Exchangeにある自身のアカウントに関連付けます。これは、[ _宛先タグ_ ](become-an-xrp-ledger-gateway.html#source-and-destination-tags)と呼ばれます。(これを使用するには、Alpha Exchangeは、すべての入金でCharlieのような宛先タグを必要とするように、すべてのアカウントでasfRequireDestフラグをオンに設定している必要があります。詳細については、[AccountSet Flags](accountset.html#accountsetのフラグ)を参照してください。)
|
||||
|
||||
|
||||
@@ -311,7 +311,7 @@ To track [off-ledger XRP balances](#on-ledger-and-off-ledger), exchanges need to
|
||||
|
||||
A user named Charlie wants to deposit 50,000 XRP to Alpha Exchange. Doing this involves the following steps:
|
||||
|
||||
1. Charlie submits a payment of 50,000 XRP (by using [RippleAPI](rippleapi-reference.html) or similar software) to Alpha Exchange's [cold wallet](#accounts).
|
||||
1. Charlie submits a payment of 50,000 XRP to Alpha Exchange's [cold wallet](#accounts).
|
||||
|
||||
a. Charlie adds an identifier (in this case, `789`) to the payment to associate it with his account at Alpha Exchange. This is called a [_destination tag_](become-an-xrp-ledger-gateway.html#source-and-destination-tags). (To use this, Alpha Exchange should have set the `asfRequireDest` flag on all of its accounts to require all incoming payments to have a destination tag like Charlie's. For more information, see [AccountSet Flags](accountset.html#accountset-flags)).
|
||||
|
||||
|
||||
Reference in New Issue
Block a user