mirror of
https://github.com/XRPLF/xrpl-dev-portal.git
synced 2025-11-04 20:05:50 +00:00
Update legacy Checks tutorial & sample code
Clean up legacy Checks tutorials
This commit is contained in:
@@ -49,10 +49,9 @@ Para más información sobre Cheques en el XRP Ledger, ver:
|
||||
- [CheckCreate][]
|
||||
- [CheckCash][]
|
||||
- [CheckCancel][]
|
||||
- [Tutoriales de cheques](../../tutorials/how-tos/use-specialized-payment-types/use-checks/use-checks.md)
|
||||
- [Tutoriales de cheques](../../tutorials/how-tos/use-specialized-payment-types/use-checks/index.md)
|
||||
- [Enviar un cheque](../../tutorials/how-tos/use-specialized-payment-types/use-checks/send-a-check.md)
|
||||
- [Buscar cheques por dirección del remitente](../../tutorials/how-tos/use-specialized-payment-types/use-checks/look-up-checks-by-sender.md)
|
||||
- [Buscar cheques por dirección del destinatario](../../tutorials/how-tos/use-specialized-payment-types/use-checks/look-up-checks-by-recipient.md)
|
||||
- [Buscar cheques](../../tutorials/how-tos/use-specialized-payment-types/use-checks/look-up-checks.md)
|
||||
- [Canjear un cheque por la cantidad exacta](../../tutorials/how-tos/use-specialized-payment-types/use-checks/cash-a-check-for-an-exact-amount.md)
|
||||
- [Canjear un cheque por una cantidad flexible](../../tutorials/how-tos/use-specialized-payment-types/use-checks/cash-a-check-for-a-flexible-amount.md)
|
||||
- [Cancelar un cheque](../../tutorials/how-tos/use-specialized-payment-types/use-checks/cancel-a-check.md)
|
||||
|
||||
@@ -97,10 +97,9 @@ XRP LedgerのChecksの詳細は、以下をご覧ください。
|
||||
- [CheckCreate][]
|
||||
- [CheckCash][]
|
||||
- [CheckCancel][]
|
||||
- [Checksのチュートリアル](../../tutorials/how-tos/use-specialized-payment-types/use-checks/use-checks.md)
|
||||
- [Checksのチュートリアル](../../tutorials/how-tos/use-specialized-payment-types/use-checks/index.md)
|
||||
- [Checkの送信](../../tutorials/how-tos/use-specialized-payment-types/use-checks/send-a-check.md)
|
||||
- [送金元アドレスに基づくChecksの検索](../../tutorials/how-tos/use-specialized-payment-types/use-checks/look-up-checks-by-sender.md)
|
||||
- [受取人アドレスに基づくChecksの検索](../../tutorials/how-tos/use-specialized-payment-types/use-checks/look-up-checks-by-recipient.md)
|
||||
- [Checksの検索](../../tutorials/how-tos/use-specialized-payment-types/use-checks/look-up-checks.md)
|
||||
- [Checkの指定された金額での換金](../../tutorials/how-tos/use-specialized-payment-types/use-checks/cash-a-check-for-an-exact-amount.md)
|
||||
- [Checkの変動金額での換金](../../tutorials/how-tos/use-specialized-payment-types/use-checks/cash-a-check-for-a-flexible-amount.md)
|
||||
- [Checkの取消し](../../tutorials/how-tos/use-specialized-payment-types/use-checks/cancel-a-check.md)
|
||||
|
||||
@@ -1,167 +0,0 @@
|
||||
---
|
||||
html: cancel-a-check.html
|
||||
parent: use-checks.html
|
||||
seo:
|
||||
description: 送金を行わずにCheckを取り消す。
|
||||
labels:
|
||||
- Checks
|
||||
---
|
||||
# Checkの取消し
|
||||
|
||||
_[Checks Amendment][]により追加されました。_
|
||||
|
||||
このチュートリアルでは、[Check](../../../../concepts/payment-types/checks.md)を取り消す手順を説明します。この手順を実行すると、送金を行わずに[レジャーのCheckオブジェクト](../../../../references/protocol/ledger-data/ledger-entry-types/check.md)が削除されます。
|
||||
|
||||
着信したCheckが不要な場合、取り消すことができます。送信時に内容を誤って入力した場合や状況が変化した場合に、送信したCheckを取り消すこともできます。有効期限切れのCheckはレジャーから削除する必要があります。これにより、送金元に[所有者準備金](../../../../concepts/accounts/reserves.md#所有者準備金)が戻ります。
|
||||
|
||||
## 前提条件
|
||||
|
||||
このチュートリアルでCheckを取り消すには、以下が必要です。
|
||||
|
||||
- 現在レジャーに記録されているCheckオブジェクトのIDが必要です。
|
||||
- たとえばこのチュートリアルの例では、IDが`49647F0D748DC3FE26BDACBC57F251AADEFFF391403EC9BF87C97F67E9977FB0`のCheckを取り消しますが、この手順を自身で実行する場合は異なるIDを使用する必要があります。
|
||||
- CheckCancelトランザクションを送信する資金供給のあるアカウントの**アドレス**と**シークレットキー**。Checkが有効期限切れでない限り、このアドレスは、Checkの送金元または受取人のいずれかでなければなりません。
|
||||
- トランザクションに[安全に署名できる手段](../../../../concepts/transactions/secure-signing.md)。
|
||||
- [クライアントライブラリ](../../../../references/client-libraries.md)またはHTTPライブラリ、WebSocketライブラリなど。
|
||||
|
||||
|
||||
## 1. CheckCancelトランザクションの準備
|
||||
|
||||
[CheckCancelトランザクション][]のフィールドの値を決定します。以下のフィールドは必要最小限のフィールドです。その他のフィールドはオプションまたは署名時に[自動入力](../../../../references/protocol/transactions/common-fields.md#自動入力可能なフィールド)可能なフィールドです。
|
||||
|
||||
| フィールド | 値 | 説明 |
|
||||
|:------------------|:-----------------|:--------------------------------------|
|
||||
| `TransactionType` | 文字列 | Checkを取り消す場合は文字列`CheckCancel`を使用します。 |
|
||||
| `Account` | 文字列(アドレス) | Checkを取り消す送信元のアドレス。(あなたのアドレスです。) |
|
||||
| `CheckID` | 文字列 | レジャーで取り消すCheckオブジェクトのID。この情報を確認するには、[txメソッド][]を使用してCheckCreateトランザクションのメタデータを調べるか、または[account_objectsメソッド][]を使用してCheckを探します。 |
|
||||
|
||||
### CheckCancelトランザクションの準備の例
|
||||
|
||||
Checkを取り消す例を以下に示します。
|
||||
|
||||
{% tabs %}
|
||||
|
||||
{% tab label="JSON-RPC、WebSocket、またはコマンドライン" %}
|
||||
```json
|
||||
{
|
||||
"TransactionType": "CheckCancel",
|
||||
"Account": "rUn84CUYbNjRoTQ6mSW7BVJPSVJNLb1QLo",
|
||||
"CheckID": "49647F0D748DC3FE26BDACBC57F251AADEFFF391403EC9BF87C97F67E9977FB0",
|
||||
"Fee": "12"
|
||||
}
|
||||
```
|
||||
{% /tab %}
|
||||
|
||||
{% tab label="ripple-lib 1.x" %}
|
||||
{% code-snippet file="/_code-samples/checks/js/prepareCancel.js" language="js" /%}
|
||||
{% /tab %}
|
||||
|
||||
{% /tabs %}
|
||||
|
||||
## 2. CheckCancelトランザクションの署名
|
||||
|
||||
{% partial file="/@i18n/ja/docs/_snippets/tutorial-sign-step.md" /%}
|
||||
|
||||
### リクエストの例
|
||||
|
||||
{% tabs %}
|
||||
|
||||
{% tab label="ripple-lib 1.x" %}
|
||||
{% code-snippet file="/_code-samples/checks/js/signCancel.js" language="js" /%}
|
||||
{% /tab %}
|
||||
|
||||
{% tab label="コマンドライン" %}
|
||||
{% code-snippet file="/_code-samples/checks/cli/sign-cancel-req.sh" language="bash" /%}
|
||||
{% /tab %}
|
||||
|
||||
{% /tabs %}
|
||||
|
||||
|
||||
### レスポンスの例
|
||||
|
||||
{% tabs %}
|
||||
|
||||
{% tab label="ripple-lib 1.x" %}
|
||||
{% code-snippet file="/_code-samples/checks/js/sign-cancel-resp.txt" language="" /%}
|
||||
{% /tab %}
|
||||
|
||||
{% tab label="コマンドライン" %}
|
||||
{% code-snippet file="/_code-samples/checks/cli/sign-cancel-resp.txt" language="json" /%}
|
||||
{% /tab %}
|
||||
|
||||
{% /tabs %}
|
||||
|
||||
|
||||
## 3. 署名済みCheckCancelトランザクションの送信
|
||||
|
||||
{% partial file="/@i18n/ja/docs/_snippets/tutorial-submit-step.md" /%}
|
||||
|
||||
### リクエストの例
|
||||
|
||||
{% tabs %}
|
||||
|
||||
{% tab label="ripple-lib 1.x" %}
|
||||
{% code-snippet file="/_code-samples/checks/js/submitCancel.js" language="js" /%}
|
||||
{% /tab %}
|
||||
|
||||
{% tab label="コマンドライン" %}
|
||||
{% code-snippet file="/_code-samples/checks/cli/submit-cancel-req.sh" language="bash" /%}
|
||||
{% /tab %}
|
||||
|
||||
{% /tabs %}
|
||||
|
||||
|
||||
### レスポンスの例
|
||||
|
||||
{% tabs %}
|
||||
|
||||
{% tab label="ripple-lib 1.x" %}
|
||||
{% code-snippet file="/_code-samples/checks/js/submit-cancel-resp.txt" language="js" /%}
|
||||
{% /tab %}
|
||||
|
||||
{% tab label="コマンドライン" %}
|
||||
{% code-snippet file="/_code-samples/checks/cli/submit-cancel-resp.txt" language="json" /%}
|
||||
{% /tab %}
|
||||
|
||||
{% /tabs %}
|
||||
|
||||
## 4. 検証の待機
|
||||
|
||||
{% partial file="/@i18n/ja/docs/_snippets/wait-for-validation.md" /%}
|
||||
|
||||
## 5. 最終結果の確認
|
||||
|
||||
トランザクションのステータスを確認するには、CheckCancelトランザクションの識別用ハッシュを指定した[txメソッド][]を使用します。トランザクションが成功したことを示す`"TransactionResult": "tesSUCCESS"`フィールドをトランザクションメタデータから検索し、またこの結果が最終結果であることを示す`"validated": true`フィールドを結果から検索します。
|
||||
|
||||
トランザクションによって[Checkレジャーオブジェクト](../../../../references/protocol/ledger-data/ledger-entry-types/check.md)が削除されたことを示す`"LedgerEntryType": "Check"`を含む`DeletedNode`オブジェクトを、トランザクションメタデータから検索します。このオブジェクトの`LedgerIndex`はCheckのIDに一致している必要があります。
|
||||
|
||||
### リクエストの例
|
||||
|
||||
{% tabs %}
|
||||
|
||||
{% tab label="ripple-lib 1.x" %}
|
||||
{% code-snippet file="/_code-samples/checks/js/getCancelTx.js" language="js" /%}
|
||||
{% /tab %}
|
||||
|
||||
{% tab label="コマンドライン" %}
|
||||
{% code-snippet file="/_code-samples/checks/cli/tx-cancel-req.sh" language="bash" /%}
|
||||
{% /tab %}
|
||||
|
||||
{% /tabs %}
|
||||
|
||||
|
||||
### レスポンスの例
|
||||
|
||||
{% tabs %}
|
||||
|
||||
{% tab label="ripple-lib 1.x" %}
|
||||
{% code-snippet file="/_code-samples/checks/js/get-cancel-tx-resp.txt" language="json" /%}
|
||||
{% /tab %}
|
||||
|
||||
{% tab label="コマンドライン" %}
|
||||
{% code-snippet file="/_code-samples/checks/cli/tx-cancel-resp.txt" language="json" /%}
|
||||
{% /tab %}
|
||||
|
||||
{% /tabs %}
|
||||
|
||||
{% raw-partial file="/docs/_snippets/common-links.md" /%}
|
||||
@@ -1,197 +0,0 @@
|
||||
---
|
||||
html: cash-a-check-for-a-flexible-amount.html
|
||||
parent: use-checks.html
|
||||
seo:
|
||||
description: Checkから可能な限りの額を受領します。
|
||||
labels:
|
||||
- Checks
|
||||
---
|
||||
# Checkの変動金額での換金
|
||||
|
||||
_[Checks Amendment][]により追加されました。_
|
||||
|
||||
Checkがレジャーに記録されており有効期限切れではない場合は、指定受取人は`DeliverMin`フィールドを指定した[CheckCashトランザクション][]を送信することで、Checkを変動金額で換金して受領できます。この方法でCheckを換金すると、受取人は送金を最大限受領でき、Checkの送金元からは、Checkの`SendMax`の全額が引き落とされるか、または可能な限りの額が引き落とされます。Checkの受取人に`DeliverMin`以上の額を送金できない場合は換金が失敗します。
|
||||
|
||||
Checkから可能な限りの額を受領したい場合には、変動金額でCheckを換金できます。
|
||||
|
||||
指定受取人は、[Checkを正確な金額で換金する](cash-a-check-for-a-flexible-amount.md)こともできます。
|
||||
|
||||
|
||||
## 前提条件
|
||||
|
||||
{% partial file="/@i18n/ja/docs/_snippets/checkcash-prereqs.md" /%}
|
||||
|
||||
## 1. CheckCashトランザクションの準備
|
||||
|
||||
[CheckCashトランザクション][]のフィールドの値を決定します。Checkを変動金額で換金する場合、以下のフィールドは必要最小限です。それ以外のフィールドはオプションまたは署名時に[自動入力](../../../../references/protocol/transactions/common-fields.md#自動入力可能なフィールド)可能なフィールドです。
|
||||
|
||||
| フィールド | 値 | 説明 |
|
||||
|:------------------|:--------------------------|:-----------------------------|
|
||||
| `TransactionType` | 文字列 | 値が`CheckCash`の場合、これはCheckCashトランザクションです。 |
|
||||
| `Account` | 文字列(アドレス) | Checkを換金する送信者のアドレス。(あなたのアドレスです。) |
|
||||
| `CheckID` | 文字列 | レジャーで換金するCheckオブジェクトのID。この情報を確認するには、[txメソッド][]を使用してCheckCreateトランザクションのメタデータを調べるか、または[account_objectsメソッド][]を使用してCheckを探します。 |
|
||||
| `DeliverMin` | 文字列またはオブジェクト(額) | Checkから受領する最小額。この額を受領できない場合はCheckの換金が失敗し、Checkがレジャーに残るので、後で換金を再試行できます。XRPの場合、XRPのdrop数を示す文字列でなければなりません。トークンの場合、これは`currency`、`issuer`、および`value` フィールドを持つオブジェクトです。`currency`フィールドと`issuer`フィールドは、Checkオブジェクトの対応するフィールドに一致しており、`value`はCheckオブジェクトの額以下でなければなりません。詳細は、[通貨額の指定][]をご覧ください。 |
|
||||
|
||||
### 変動金額で換金するCheckCashトランザクションの準備の例
|
||||
|
||||
Checkを変動金額で換金するためのトランザクションを準備する手順を以下の例に示します。
|
||||
|
||||
{% tabs %}
|
||||
|
||||
{% tab label="JSON-RPC、WebSocket、またはコマンドライン" %}
|
||||
```json
|
||||
{
|
||||
"Account": "rGPnRH1EBpHeTF2QG8DCAgM7z5pb75LAis",
|
||||
"TransactionType": "CheckCash",
|
||||
"DeliverMin": "95000000",
|
||||
"CheckID": "2E0AD0740B79BE0AAE5EDD1D5FC79E3C5C221D23C6A7F771D85569B5B91195C2"
|
||||
}
|
||||
```
|
||||
{% /tab %}
|
||||
|
||||
{% tab label="ripple-lib 1.x" %}
|
||||
{% code-snippet file="/_code-samples/checks/js/prepareCashFlex.js" language="js" /%}
|
||||
{% /tab %}
|
||||
|
||||
{% /tabs %}
|
||||
|
||||
## 2. CheckCashトランザクションの署名
|
||||
|
||||
{% partial file="/@i18n/ja/docs/_snippets/tutorial-sign-step.md" /%}
|
||||
|
||||
### リクエストの例
|
||||
|
||||
{% tabs %}
|
||||
|
||||
{% tab label="コマンドライン" %}
|
||||
{% code-snippet file="/_code-samples/checks/cli/sign-cash-flex-req.sh" language="bash" /%}
|
||||
{% /tab %}
|
||||
|
||||
{% /tabs %}
|
||||
|
||||
|
||||
### レスポンスの例
|
||||
|
||||
{% tabs %}
|
||||
|
||||
{% tab label="コマンドライン" %}
|
||||
{% code-snippet file="/_code-samples/checks/cli/sign-cash-flex-resp.txt" language="json" /%}
|
||||
{% /tab %}
|
||||
|
||||
{% /tabs %}
|
||||
|
||||
|
||||
## 3. 署名済みCheckCashトランザクションの送信
|
||||
|
||||
{% partial file="/@i18n/ja/docs/_snippets/tutorial-submit-step.md" /%}
|
||||
|
||||
### リクエストの例
|
||||
|
||||
{% tabs %}
|
||||
|
||||
{% tab label="コマンドライン" %}
|
||||
{% code-snippet file="/_code-samples/checks/cli/submit-cash-flex-req.sh" language="bash" /%}
|
||||
{% /tab %}
|
||||
|
||||
{% /tabs %}
|
||||
|
||||
|
||||
### レスポンスの例
|
||||
|
||||
{% tabs %}
|
||||
|
||||
{% tab label="コマンドライン" %}
|
||||
{% code-snippet file="/_code-samples/checks/cli/submit-cash-flex-resp.txt" language="json" /%}
|
||||
{% /tab %}
|
||||
|
||||
{% /tabs %}
|
||||
|
||||
## 4. 検証の待機
|
||||
|
||||
{% partial file="/@i18n/ja/docs/_snippets/wait-for-validation.md" /%}
|
||||
|
||||
## 5. 最終結果の確認
|
||||
|
||||
トランザクションのステータスを確認するには、CheckCashトランザクションの識別用ハッシュを指定した[txメソッド][]を使用します。トランザクションが成功したことを示す`"TransactionResult": "tesSUCCESS"`フィールドをトランザクションメタデータから検索し、またこの結果が最終結果であることを示す`"validated": true`フィールドを結果から検索します。
|
||||
|
||||
### リクエストの例
|
||||
|
||||
{% tabs %}
|
||||
|
||||
{% tab label="コマンドライン" %}
|
||||
{% code-snippet file="/_code-samples/checks/cli/tx-cash-flex-req.sh" language="bash" /%}
|
||||
{% /tab %}
|
||||
|
||||
{% /tabs %}
|
||||
|
||||
|
||||
### レスポンスの例
|
||||
|
||||
{% tabs %}
|
||||
|
||||
{% tab label="コマンドライン" %}
|
||||
{% code-snippet file="/_code-samples/checks/cli/tx-cash-flex-resp.txt" language="json" /%}
|
||||
{% /tab %}
|
||||
|
||||
{% /tabs %}
|
||||
|
||||
### エラー処理
|
||||
|
||||
[](../../../../references/protocol/transactions/transaction-results/index.md)Checkの換金が`tec`クラスコードで失敗した場合は、[すべてのトランザクションレスポンスのリスト](../../../../references/protocol/transactions/transaction-results/index.md)でコードを確認し、適切に対処してください。CheckCashトランザクションでよく返される結果コードの一部を次に示します。
|
||||
|
||||
| 結果コード | 意味 | 対処 |
|
||||
|-------------|---------|----------------|
|
||||
| `tecEXPIRED` | Checkが有効期限切れです。 | Checkを取り消して、以前より長い有効期限を設定して新しいCheckを作成するように送金元に依頼します。 |
|
||||
| `tecNO_ENTRY` | Check IDが存在していません。 | CheckCashトランザクションの`CheckID`が正しいことを確認してください。Checkがまだ取り消されていないこと、または正常に換金されていないことを確認してください。 |
|
||||
| `tecNO_LINE` | 受取人がCheckの通貨のトラストラインを所有していません。 | このイシュアーからのこの通貨を保有するには、指定された通貨とイシュアーのトラストラインを作成し、[TrustSetトランザクション][]を使用してこのトラストラインに適切な限度額を設定してから、Checkの換金を再試行します。 |
|
||||
| `tecNO_PERMISSION` | CheckCashトランザクションの送信者はCheckの`Destination`ではありません。 | Checkの`Destination`を再度確認します。 |
|
||||
| `tecNO_AUTH` | このCheckの通貨のイシュアーは[Authorized Trust Line](../../../../concepts/tokens/fungible-tokens/authorized-trust-lines.md)を使用していますが、受取人からイシュアーへのトラストラインが承認されていません。 | このトラストラインを承認するようイシュアーに依頼し、承認されたらCheckの換金を再試行します。 |
|
||||
| `tecPATH_PARTIAL` | トラストラインの限度額、または送金元に送金通貨の残高(イシュアーの[送金手数料](../../../../concepts/tokens/transfer-fees.md)がある場合はこの手数料を含む)が十分になかったことが原因で、Checkでは十分なトークンを送金できませんでした。 | 原因がトラストラインの限度額である場合は、(希望する場合には)限度額を引き上げる[TrustSetトランザクション][]を送信するか、または通貨の一部を消費して残高を減らしてから、Checkの換金を再試行します。原因が送金元の残高である場合は、送金元にCheckの通貨が積み増しされるまで待つか、または以前よりも低い額でCheckの換金を再試行します。 |
|
||||
| `tecUNFUNDED_PAYMENT` | Checkで十分なXRPを送金できませんでした。 | 送金元にXRPが積み増しされるまで待つか、または以前よりも低い額でCheckの換金を再試行します。 |
|
||||
|
||||
## 6. 送金された額の確認
|
||||
|
||||
Checkが変動する`DeliverMin`の額で換金された場合は、Checkは少なくとも`DeliverMin`の額で換金されたと想定できます。送金された額を正確に得るには、トランザクションメタデータを調べます。<!--{# TODO: Update if RIPD-1623 adds a delivered_amount field. #}-->メタデータの`AffectedNodes`配列には、通貨のタイプに応じて、Checkの換金による残高の変更を反映した1~2つのオブジェクトが含まれています。
|
||||
|
||||
- XRPの場合、Checkの送金元の`AccountRoot`オブジェクトのXRP `Balance` フィールドから引き落しが行われます。Checkの受取人(CheckCashトランザクションを送信したユーザ)の`AccountRoot`オブジェクトでは、最低でもCheckCashトランザクションの`DeliverMin`から、トランザクションの送信にかかる[トランザクションコスト](../../../../concepts/transactions/transaction-cost.md)を差し引いた額が、XRP `Balance`に入金されます。
|
||||
|
||||
たとえば以下の`ModifiedNode`は、アカウントrGPnRH1EBpHeTF2QG8DCAgM7z5pb75LAis(Checkの受取人でありこのCheckCashトランザクションの送信者)のXRP残高が`9999999970` dropから`10099999960` dropに変更されています。つまり、このトランザクションを処理した結果として、受取人に対し _正味_ 99.99999 XRPが入金されています。
|
||||
|
||||
```
|
||||
{
|
||||
"ModifiedNode": {
|
||||
"FinalFields": {
|
||||
"Account": "rGPnRH1EBpHeTF2QG8DCAgM7z5pb75LAis",
|
||||
"Balance": "10099999960",
|
||||
"Flags": 0,
|
||||
"OwnerCount": 2,
|
||||
"Sequence": 5
|
||||
},
|
||||
"LedgerEntryType": "AccountRoot",
|
||||
"LedgerIndex": "7939126A732EBBDEC715FD3CCB056EB31E65228CA17E3B2901E7D30B90FD03D3",
|
||||
"PreviousFields": {
|
||||
"Balance": "9999999970",
|
||||
"Sequence": 4
|
||||
},
|
||||
"PreviousTxnID": "0283465F0D21BE6B1E91ABDE17266C24C1B4915BAAA9A88CC098A98D5ECD3E9E",
|
||||
"PreviousTxnLgrSeq": 8005334
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
正味金額99.99999 XRPは、このCheckCashトランザクションを送信するにあたり、トランザクションコストを支払うために消却された額を差し引いた後の金額です。以下のトランザクション指示(抜粋)は、トランザクションコスト(`Fee`フィールド)がXRPの10 dropであることを示しています。これを正味残高の変更に追加することで、このCheckの換金のために受取人rGPnRH1EBpHeTF2QG8DCAgM7z5pb75LAisに _総額_ 100 XRPが入金されます。
|
||||
|
||||
```
|
||||
"Account" : "rGPnRH1EBpHeTF2QG8DCAgM7z5pb75LAis",
|
||||
"TransactionType" : "CheckCash",
|
||||
"DeliverMin" : "95000000",
|
||||
"Fee" : "10",
|
||||
```
|
||||
|
||||
- Checkの送金元または受取人がイシュアーであるトークンの場合、これらのアカウント間のトラストラインを表す`RippleState`オブジェクトでは、`Balance`がCheckの受取人に有利な方法で調整されています。
|
||||
|
||||
- イシュアーが第三者であるトークンの場合、2つの`RippleState`(送金元からイシュアーへのトラストラインとイシュアーから受取人へのトラストライン)に対する変更があります。Checkの送金元とイシュアーの関係を表す`RippleState`オブジェクトではその`Balance`がイシュアーに有利に変更され、イシュアーと受取人の間の関係を表す`RippleState`オブジェクトではその`Balance`が受取人に有利に変更されます。
|
||||
|
||||
- トークンに[送金手数料](../../../../concepts/tokens/transfer-fees.md)がある場合、受取人への入金額を上回る額がCheckの送金元から引き落とされます。(この差額が送金手数料であり、これがイシュアーに戻されることによりイシュアーの正味の債務は減少します。)
|
||||
|
||||
{% raw-partial file="/docs/_snippets/common-links.md" /%}
|
||||
@@ -1,141 +0,0 @@
|
||||
---
|
||||
html: cash-a-check-for-an-exact-amount.html
|
||||
parent: use-checks.html
|
||||
seo:
|
||||
description: Checkに指定されている額までの正確な額を受領します。
|
||||
labels:
|
||||
- Checks
|
||||
---
|
||||
# Checkの正確な金額での換金
|
||||
|
||||
_[Checks Amendment][]により追加されました。_
|
||||
|
||||
Checkがレジャーに含まれており有効期限切れではない場合は、指定の受取人は`Amount`フィールドを指定した[CheckCashトランザクション][]を送信することで、Checkを換金し、Checkに指定されている額までの正確な額を受領できます。請求書の額面通りの金額を回収したい場合など、特定の金額の受領を希望する際には、この方法でCheckを換金できます。
|
||||
|
||||
指定の受取人は、[Checkを変動金額で換金する](cash-a-check-for-a-flexible-amount.md)こともできます。
|
||||
|
||||
## 前提条件
|
||||
|
||||
{% partial file="/@i18n/ja/docs/_snippets/checkcash-prereqs.md" /%}
|
||||
|
||||
## 1. CheckCashトランザクションの準備
|
||||
|
||||
[CheckCashトランザクション][]のフィールドの値を決定します。Checkを正確な金額で換金する場合、以下のフィールドが最低限必要です。それ以外のフィールドはオプションまたは署名時に[自動入力](../../../../references/protocol/transactions/common-fields.md#自動入力可能なフィールド)可能なフィールドです。
|
||||
|
||||
| フィールド | 値 | 説明 |
|
||||
|:------------------|:--------------------------|:-----------------------------|
|
||||
| `TransactionType` | 文字列 | 値が`CheckCash`の場合、これはCheckCashトランザクションです。 |
|
||||
| `Account` | 文字列(アドレス) | Checkを換金する送信者のアドレス。(あなたのアドレスです。) |
|
||||
| `CheckID` | 文字列 | レジャーで換金するCheckオブジェクトのID。この情報を確認するには、[txメソッド][]を使用してCheckCreateトランザクションのメタデータを調べるか、または[account_objectsメソッド][]を使用してCheckを探します。 |
|
||||
| `Amount` | 文字列またはオブジェクト(額) | Checkから精算する額。XRPの場合、XRPのdrop数を示す文字列でなければなりません。トークンの場合、これは`currency`、`issuer`、および`value` フィールドを持つオブジェクトです。`currency`フィールドと`issuer`フィールドは、Checkオブジェクトの対応するフィールドに一致しており、`value`はCheckオブジェクトの額以下でなければなりません。(送金手数料のかかる通貨の場合、`SendMax`で送金手数料を支払えるように、`SendMax`よりも低い額を換金する必要があります。)この額を受領できない場合はCheckの換金が失敗し、Checkがレジャーに残るので、後で換金を再試行できます。詳細は、[通貨額の指定][]をご覧ください。 |
|
||||
|
||||
|
||||
### 正確な金額で換金するCheckCashトランザクションの準備の例
|
||||
|
||||
Checkを正確な金額で換金するためのトランザクションを準備する手順を以下の例に示します。
|
||||
|
||||
{% tabs %}
|
||||
|
||||
{% tab label="JSON-RPC、WebSocket、またはコマンドライン" %}
|
||||
```json
|
||||
{
|
||||
"Account": "rfkE1aSy9G8Upk4JssnwBxhEv5p4mn2KTy",
|
||||
"TransactionType": "CheckCash",
|
||||
"Amount": "100000000",
|
||||
"CheckID": "838766BA2B995C00744175F69A1B11E32C3DBC40E64801A4056FCBD657F57334",
|
||||
"Fee": "12"
|
||||
}
|
||||
```
|
||||
{% /tab %}
|
||||
|
||||
{% tab label="ripple-lib 1.x" %}
|
||||
{% code-snippet file="/_code-samples/checks/js/prepareCashExact.js" language="js" /%}
|
||||
{% /tab %}
|
||||
|
||||
{% /tabs %}
|
||||
|
||||
## 2. CheckCashトランザクションの署名
|
||||
|
||||
{% partial file="/@i18n/ja/docs/_snippets/tutorial-sign-step.md" /%}
|
||||
|
||||
### リクエストの例
|
||||
|
||||
{% tabs %}
|
||||
|
||||
{% tab label="コマンドライン" %}
|
||||
{% code-snippet file="/_code-samples/checks/cli/sign-cash-exact-req.sh" language="bash" /%}
|
||||
{% /tab %}
|
||||
|
||||
{% /tabs %}
|
||||
|
||||
|
||||
### レスポンスの例
|
||||
|
||||
{% tabs %}
|
||||
|
||||
{% tab label="コマンドライン" %}
|
||||
{% code-snippet file="/_code-samples/checks/cli/sign-cash-exact-resp.txt" language="json" /%}
|
||||
{% /tab %}
|
||||
|
||||
{% /tabs %}
|
||||
|
||||
|
||||
## 3. 署名済みCheckCashトランザクションの送信
|
||||
|
||||
{% partial file="/@i18n/ja/docs/_snippets/tutorial-submit-step.md" /%}
|
||||
|
||||
### リクエストの例
|
||||
|
||||
{% tabs %}
|
||||
|
||||
{% tab label="コマンドライン" %}
|
||||
{% code-snippet file="/_code-samples/checks/cli/submit-cash-exact-req.sh" language="bash" /%}
|
||||
{% /tab %}
|
||||
|
||||
{% /tabs %}
|
||||
|
||||
|
||||
### レスポンスの例
|
||||
|
||||
{% tabs %}
|
||||
|
||||
{% tab label="コマンドライン" %}
|
||||
{% code-snippet file="/_code-samples/checks/cli/submit-cash-exact-resp.txt" language="json" /%}
|
||||
{% /tab %}
|
||||
|
||||
{% /tabs %}
|
||||
|
||||
## 4. 検証の待機
|
||||
|
||||
{% partial file="/@i18n/ja/docs/_snippets/wait-for-validation.md" /%}
|
||||
|
||||
## 5.最終結果の確認
|
||||
|
||||
トランザクションのステータスを確認するには、CheckCashトランザクションの識別用ハッシュを指定した[txメソッド][]を使用します。トランザクションが成功したことを示す`"TransactionResult": "tesSUCCESS"`フィールドをトランザクションメタデータから検索し、またこの結果が最終結果であることを示す`"validated": true`フィールドを結果から検索します。
|
||||
|
||||
Checkが正確な`Amount`で換金された場合は、受取人に対し正確な額が入金されたと想定できます(トークンの金額が極めて大きい場合や小さい場合は、金額が丸められることがあります)。
|
||||
|
||||
Checkを換金できない場合、Checkはレジャーに残るため、後日換金を再試行できます。代わりに[Checkを変動金額で換金する](cash-a-check-for-a-flexible-amount.md)ことができます。
|
||||
|
||||
### リクエストの例
|
||||
|
||||
{% tabs %}
|
||||
|
||||
{% tab label="コマンドライン" %}
|
||||
{% code-snippet file="/_code-samples/checks/cli/tx-cash-exact-req.sh" language="bash" /%}
|
||||
{% /tab %}
|
||||
|
||||
{% /tabs %}
|
||||
|
||||
|
||||
### レスポンスの例
|
||||
|
||||
{% tabs %}
|
||||
|
||||
{% tab label="コマンドライン" %}
|
||||
{% code-snippet file="/_code-samples/checks/cli/tx-cash-exact-resp.txt" language="json" /%}
|
||||
{% /tab %}
|
||||
|
||||
{% /tabs %}
|
||||
|
||||
{% raw-partial file="/docs/_snippets/common-links.md" /%}
|
||||
@@ -1,73 +0,0 @@
|
||||
---
|
||||
html: look-up-checks-by-recipient.html
|
||||
parent: use-checks.html
|
||||
seo:
|
||||
description: 特定のアドレスで受信されるすべてのCheckのリストを取得する。
|
||||
labels:
|
||||
- Checks
|
||||
---
|
||||
# 受取人に基づくCheckの検索
|
||||
|
||||
_[Checks Amendment][]により追加されました。_
|
||||
|
||||
このチュートリアルでは、[Check](../../../../concepts/payment-types/checks.md)をその受取人で検索する方法を説明します。[Checkを送金元で検索する](look-up-checks-by-sender.md)こともできます。
|
||||
|
||||
## 1. 特定のアドレスのすべてのCheckの検索
|
||||
|
||||
特定のアドレスで受信および送信されるすべてのCheckのリストを取得するには、受取人アカウントのアドレスを指定した`account_objects`コマンドを実行し、リクエストの`type` フィールドを`checks`に設定します。
|
||||
|
||||
**注記:**`account_objects`コマンドのコマンドラインインターフェイスでは`type`フィールドは受け入れられません。代わりに[jsonメソッド][]を使用してコマンドラインからJSON-RPCフォーマットのリクエストを送信できます。
|
||||
|
||||
|
||||
### リクエストの例
|
||||
|
||||
{% tabs %}
|
||||
|
||||
{% tab label="RippleAPI" %}
|
||||
{% code-snippet file="/_code-samples/checks/js/getChecks.js" language="js" /%}
|
||||
{% /tab %}
|
||||
|
||||
{% tab label="JSON-RPC" %}
|
||||
{% code-snippet file="/_code-samples/checks/json-rpc/account_objects-req.json" language="json" /%}
|
||||
{% /tab %}
|
||||
|
||||
{% /tabs %}
|
||||
|
||||
### レスポンスの例
|
||||
|
||||
{% tabs %}
|
||||
|
||||
{% tab label="RippleAPI" %}
|
||||
{% code-snippet file="/_code-samples/checks/js/get-checks-resp.txt" language="" /%}
|
||||
{% /tab %}
|
||||
|
||||
{% tab label="JSON-RPC" %}
|
||||
{% code-snippet file="/_code-samples/checks/json-rpc/account_objects-resp.json" language="json" prefix="200 OK\n\n" /%}
|
||||
{% /tab %}
|
||||
|
||||
{% /tabs %}
|
||||
|
||||
|
||||
## 2. 受取人に基づくレスポンスの絞り込み
|
||||
|
||||
レスポンスには、リクエストのアカウントが送金元であるCheckと、アカウントが受取人であるCheckが含まれていることがあります。レスポンスの`account_objects`配列の各メンバーは1つのCheckを表します。これらの各Checkオブジェクトでは、`Destination`のアドレスはそのCheckの受取人のアドレスです。
|
||||
|
||||
以下の疑似コードに、受取人でレスポンスを絞り込む方法を示します。
|
||||
|
||||
```js
|
||||
recipient_address = "rBXsgNkPcDN2runsvWmwxk3Lh97zdgo9za"
|
||||
account_objects_response = get_account_objects({
|
||||
account: recipient_address,
|
||||
ledger_index: "validated",
|
||||
type: "check"
|
||||
})
|
||||
|
||||
for (i=0; i < account_objects_response.account_objects.length; i++) {
|
||||
check_object = account_objects_response.account_objects[i]
|
||||
if (check_object.Destination == recipient_address) {
|
||||
log("Check to recipient:", check_object)
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
{% raw-partial file="/docs/_snippets/common-links.md" /%}
|
||||
@@ -1,71 +0,0 @@
|
||||
---
|
||||
html: look-up-checks-by-sender.html
|
||||
parent: use-checks.html
|
||||
seo:
|
||||
description: 特定のアドレスで送信されるすべてのCheckのリストを取得する。
|
||||
labels:
|
||||
- Checks
|
||||
---
|
||||
# 送金元に基づくCheckの検索
|
||||
|
||||
_[Checks Amendment][]により追加されました。_
|
||||
|
||||
このチュートリアルでは、[Check](../../../../concepts/payment-types/checks.md)をその送金元で検索する方法を説明します。[Checkを受取人で検索する](look-up-checks-by-recipient.md)こともできます。
|
||||
|
||||
## 1. 特定のアドレスのすべてのCheckの検索
|
||||
|
||||
特定のアドレスで受信および送信されるすべてのCheckのリストを取得するには、送金元アカウントのアドレスを指定した`account_objects`コマンドを実行し、リクエストの`type` フィールドを`checks`に設定します。
|
||||
|
||||
**注記:**`account_objects`コマンドのコマンドラインインターフェイスでは`type`フィールドは受け入れられません。代わりに[jsonメソッド][]を使用してコマンドラインからJSON-RPCフォーマットのリクエストを送信できます。
|
||||
|
||||
### リクエストの例
|
||||
|
||||
{% tabs %}
|
||||
|
||||
{% tab label="RippleAPI" %}
|
||||
{% code-snippet file="/_code-samples/checks/js/getChecks.js" language="js" /%}
|
||||
{% /tab %}
|
||||
|
||||
{% tab label="JSON-RPC" %}
|
||||
{% code-snippet file="/_code-samples/checks/json-rpc/account_objects-req.json" language="json" /%}
|
||||
{% /tab %}
|
||||
|
||||
{% /tabs %}
|
||||
|
||||
### レスポンスの例
|
||||
|
||||
{% tabs %}
|
||||
|
||||
{% tab label="RippleAPI" %}
|
||||
{% code-snippet file="/_code-samples/checks/js/get-checks-resp.txt" language="" /%}
|
||||
{% /tab %}
|
||||
|
||||
{% tab label="JSON-RPC" %}
|
||||
{% code-snippet file="/_code-samples/checks/json-rpc/account_objects-resp.json" language="json" prefix="200 OK\n\n" /%}
|
||||
{% /tab %}
|
||||
|
||||
{% /tabs %}
|
||||
|
||||
## 2. 送金元に基づくレスポンスの絞り込み
|
||||
|
||||
レスポンスには、リクエストのアカウントが送金元であるCheckと、アカウントが受取人であるCheckが含まれていることがあります。レスポンスの`account_objects`配列の各メンバーは1つのCheckを表します。これらの各Checkオブジェクトでは、`Account`のアドレスはそのCheckの送金元のアドレスです。
|
||||
|
||||
以下の疑似コードに、送金元でレスポンスを絞り込む方法を示します。
|
||||
|
||||
```js
|
||||
sender_address = "rBXsgNkPcDN2runsvWmwxk3Lh97zdgo9za"
|
||||
account_objects_response = get_account_objects({
|
||||
account: sender_address,
|
||||
ledger_index: "validated",
|
||||
type: "check"
|
||||
})
|
||||
|
||||
for (i=0; i < account_objects_response.account_objects.length; i++) {
|
||||
check_object = account_objects_response.account_objects[i]
|
||||
if (check_object.Account == sender_address) {
|
||||
log("Check from sender:", check_object)
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
{% raw-partial file="/docs/_snippets/common-links.md" /%}
|
||||
@@ -1,195 +0,0 @@
|
||||
---
|
||||
html: send-a-check.html
|
||||
parent: use-checks.html
|
||||
seo:
|
||||
description: 受取人が後で現金化できるCheckオブジェクトが作成されます。
|
||||
labels:
|
||||
- Checks
|
||||
---
|
||||
# Checkの送信
|
||||
|
||||
Checkの送信は、指定受取人にあなたからの支払いを引き出す許可を与えることに似ています。このプロセスの結果、受取人が後で現金化できる[レジャーのCheckオブジェクト](../../../../references/protocol/ledger-data/ledger-entry-types/check.md)が作成されます。
|
||||
|
||||
多くの場合、Checkではなく[Payment][]が送信されます。これは、Paymentでは1つのステップで受取人に直接送金できるためです。ただし、指定受取人が[DepositAuth](../../../../concepts/accounts/depositauth.md)を使用している場合はPaymentを直接送信できないため、代替手段としてCheckが適切です。
|
||||
|
||||
このチュートリアルでは、架空の会社BoxSend SG(XRP LedgerアドレスはrBXsgNkPcDN2runsvWmwxk3Lh97zdgo9za)が架空の暗号資産コンサルタント会社Grand Payments(XRP LedgerアドレスはrGPnRH1EBpHeTF2QG8DCAgM7z5pb75LAis)に、コンサルティング料を支払う例を取り上げます。Grand PaymentsはXRPでの支払いを望んでいますが、税務処理と規制対応を簡素化するため、明示的に承認した支払いのみを受け入れます。
|
||||
|
||||
XRP Ledgerの外部でGrand PaymentsはBoxSend SGに請求書(IDは`46060241FABCF692D4D934BA2A6C4427CD4279083E38C77CBE642243E43BE291`)を送り、Grand PaymentsのXRP Ledgerアドレス(rGPnRH1EBpHeTF2QG8DCAgM7z5pb75LAis)宛てに100 XRPのCheckを送信するよう要求します。
|
||||
|
||||
|
||||
## 前提条件
|
||||
|
||||
このチュートリアルでCheckを送信するには、以下が必要です。
|
||||
|
||||
- Checkの送信元である資金供給のあるアカウントの**アドレス**と**シークレットキー**。
|
||||
- [XRP Ledger Test Net Faucet](/resources/dev-tools/xrp-faucets)を使用して、10,000 Test Net XRPを保有する資金供給のあるアドレスおよびシークレットを取得できます。
|
||||
- Checkを受領する資金供給のあるアカウントの**アドレス**。
|
||||
- トランザクションに[安全に署名できる手段](../../../../concepts/transactions/secure-signing.md)。
|
||||
- [クライアントライブラリ](../../../../references/client-libraries.md)またはHTTPライブラリ、WebSocketライブラリなど。
|
||||
|
||||
## 1. CheckCreateトランザクションの準備
|
||||
|
||||
Checkの額と、Checkを現金化できる当事者を決定します。[CheckCreateトランザクション][]のフィールドの値を決定します。以下のフィールドは必要最小限のフィールドです。その他のフィールドはオプションまたは署名時に[自動入力](../../../../references/protocol/transactions/common-fields.md#自動入力可能なフィールド)できるフィールドです。
|
||||
|
||||
| フィールド | 値 | 説明 |
|
||||
|:------------------|:--------------------------|:-----------------------------|
|
||||
| `TransactionType` | 文字列 | このフィールドには文字列`CheckCreate`を使用します。 |
|
||||
| `Account` | 文字列(アドレス) | Checkを作成する送金元のアドレス。(あなたのアドレスです。) |
|
||||
| `Destination` | 文字列(アドレス) | Checkを換金できる指定受取人のアドレス。 |
|
||||
| `SendMax` | 文字列またはオブジェクト(額) | Checkが現金化されるときに送金元から引き出される最大額。XRPの場合、XRPのdrop数を示す文字列を使用します。トークンの場合、`currency`、`issuer`、および`value` フィールドを含むオブジェクトを使用します。詳細は、[通貨額の指定][]をご覧ください。受取人がXRP以外の通貨で正確な額のCheckを換金できるようにし、かつ[送金手数料](../../../../concepts/tokens/transfer-fees.md)を含めるには、送金手数料分の追加パーセンテージを必ず指定してください。(たとえば受取人が送金手数料2%でCheckをイシュアーからの100 CADに現金化できるようにするには、`SendMax`をイシュアーからの102 CADに設定する必要があります。) |
|
||||
|
||||
### CheckCreateトランザクションの準備の例
|
||||
|
||||
以下の例は、BoxSend SG(`rBXsgNkPcDN2runsvWmwxk3Lh97zdgo9za`)がGrand Payments(`rGPnRH1EBpHeTF2QG8DCAgM7z5pb75LAis`)宛てに作成した100 XRPのCheckです。追加(オプション)のメタデータとして、BoxSend SGはGrand Paymentsの請求書のIDを追加しています。これによりGrand PaymentsはこのCheckがどの請求書に対する支払いかを確認できます。
|
||||
|
||||
{% tabs %}
|
||||
|
||||
{% tab label="ripple-lib 1.x" %}
|
||||
{% code-snippet file="/_code-samples/checks/js/prepareCreate.js" language="js" /%}
|
||||
{% /tab %}
|
||||
|
||||
{% tab label="JSON-RPC、WebSocket、またはコマンドライン" %}
|
||||
```json
|
||||
{
|
||||
"TransactionType":"CheckCreate",
|
||||
"Account":"rBXsgNkPcDN2runsvWmwxk3Lh97zdgo9za",
|
||||
"Destination":"rGPnRH1EBpHeTF2QG8DCAgM7z5pb75LAis",
|
||||
"SendMax":"100000000",
|
||||
"InvoiceID":"46060241FABCF692D4D934BA2A6C4427CD4279083E38C77CBE642243E43BE291"
|
||||
}
|
||||
```
|
||||
{% /tab %}
|
||||
|
||||
{% /tabs %}
|
||||
|
||||
## 2. CheckCreateトランザクションへの署名
|
||||
|
||||
{% partial file="/@i18n/ja/docs/_snippets/tutorial-sign-step.md" /%}
|
||||
|
||||
|
||||
### リクエストの例
|
||||
|
||||
{% tabs %}
|
||||
|
||||
{% tab label="ripple-lib 1.x" %}
|
||||
{% code-snippet file="/_code-samples/checks/js/signCreate.js" language="js" /%}
|
||||
{% /tab %}
|
||||
|
||||
{% tab label="WebSocket" %}
|
||||
{% code-snippet file="/_code-samples/checks/websocket/sign-create-req.json" language="json" /%}
|
||||
{% /tab %}
|
||||
|
||||
{% tab label="コマンドライン" %}
|
||||
{% code-snippet file="/_code-samples/checks/cli/sign-create-req.sh" language="bash" /%}
|
||||
{% /tab %}
|
||||
|
||||
{% /tabs %}
|
||||
|
||||
#### レスポンスの例
|
||||
|
||||
{% tabs %}
|
||||
|
||||
{% tab label="ripple-lib 1.x" %}
|
||||
{% code-snippet file="/_code-samples/checks/js/sign-create-resp.txt" language="js" /%}
|
||||
{% /tab %}
|
||||
|
||||
{% tab label="WebSocket" %}
|
||||
{% code-snippet file="/_code-samples/checks/websocket/sign-create-resp.json" language="json" /%}
|
||||
{% /tab %}
|
||||
|
||||
{% tab label="コマンドライン" %}
|
||||
{% code-snippet file="/_code-samples/checks/cli/sign-create-resp.txt" language="json" /%}
|
||||
{% /tab %}
|
||||
|
||||
{% /tabs %}
|
||||
|
||||
## 3.署名済みトランザクションの送信
|
||||
|
||||
{% partial file="/@i18n/ja/docs/_snippets/tutorial-submit-step.md" /%}
|
||||
|
||||
|
||||
### リクエストの例
|
||||
|
||||
{% tabs %}
|
||||
|
||||
{% tab label="ripple-lib 1.x" %}
|
||||
{% code-snippet file="/_code-samples/checks/js/submitCreate.js" language="js" /%}
|
||||
{% /tab %}
|
||||
|
||||
{% tab label="WebSocket" %}
|
||||
{% code-snippet file="/_code-samples/checks/websocket/submit-create-req.json" language="json" /%}
|
||||
{% /tab %}
|
||||
|
||||
{% tab label="コマンドライン" %}
|
||||
{% code-snippet file="/_code-samples/checks/cli/submit-create-req.sh" language="bash" /%}
|
||||
{% /tab %}
|
||||
|
||||
{% /tabs %}
|
||||
|
||||
### レスポンスの例
|
||||
|
||||
{% tabs %}
|
||||
|
||||
{% tab label="ripple-lib 1.x" %}
|
||||
{% code-snippet file="/_code-samples/checks/js/submit-create-resp.txt" language="js" /%}
|
||||
{% /tab %}
|
||||
|
||||
{% tab label="WebSocket" %}
|
||||
{% code-snippet file="/_code-samples/checks/websocket/submit-create-resp.json" language="json" /%}
|
||||
{% /tab %}
|
||||
|
||||
{% tab label="コマンドライン" %}
|
||||
{% code-snippet file="/_code-samples/checks/cli/submit-create-resp.txt" language="json" /%}
|
||||
{% /tab %}
|
||||
|
||||
{% /tabs %}
|
||||
|
||||
|
||||
## 4.検証の待機
|
||||
|
||||
{% partial file="/@i18n/ja/docs/_snippets/wait-for-validation.md" /%}
|
||||
|
||||
|
||||
## 5.最終結果の確認
|
||||
|
||||
トランザクションのステータスを確認するには、CheckCreateトランザクションの識別用ハッシュを指定した[txメソッド][]を使用します。トランザクションメタデータで、トランザクションが成功したことを示す`"TransactionResult": "tesSUCCESS"`フィールドを探し、またこの結果が最終結果であることを示す`"validated": true`フィールドを結果で探します。
|
||||
|
||||
トランザクションのメタデータで、`LedgerEntryType`が `"Check"`の`CreatedNode`オブジェクトを探します。これは、トランザクションにより[Checkレジャーオブジェクト](../../../../references/protocol/ledger-data/ledger-entry-types/check.md)が作成されたことを示します。このオブジェクトの`LedgerIndex` がCheckのIDです。以下の例ではCheckのIDは`84C61BE9B39B2C4A2267F67504404F1EC76678806C1B901EA781D1E3B4CE0CD9`です。
|
||||
|
||||
### リクエストの例
|
||||
|
||||
{% tabs %}
|
||||
|
||||
{% tab label="ripple-lib 1.x" %}
|
||||
{% code-snippet file="/_code-samples/checks/js/getCreateTx.js" language="" /%}
|
||||
{% /tab %}
|
||||
|
||||
{% tab label="WebSocket" %}
|
||||
{% code-snippet file="/_code-samples/checks/websocket/tx-create-req.json" language="json" /%}
|
||||
{% /tab %}
|
||||
|
||||
{% tab label="コマンドライン" %}
|
||||
{% code-snippet file="/_code-samples/checks/cli/tx-create-req.sh" language="bash" /%}
|
||||
{% /tab %}
|
||||
|
||||
{% /tabs %}
|
||||
|
||||
### レスポンスの例
|
||||
|
||||
{% tabs %}
|
||||
|
||||
{% tab label="ripple-lib 1.x" %}
|
||||
{% code-snippet file="/_code-samples/checks/js/get-create-tx-resp.txt" language="" /%}
|
||||
{% /tab %}
|
||||
|
||||
{% tab label="WebSocket" %}
|
||||
{% code-snippet file="/_code-samples/checks/websocket/tx-create-resp.json" language="json" /%}
|
||||
{% /tab %}
|
||||
|
||||
{% tab label="コマンドライン" %}
|
||||
{% code-snippet file="/_code-samples/checks/cli/tx-create-resp.txt" language="json" /%}
|
||||
{% /tab %}
|
||||
|
||||
{% /tabs %}
|
||||
|
||||
{% raw-partial file="/docs/_snippets/common-links.md" /%}
|
||||
@@ -42,7 +42,7 @@ Checkは、デポジット認可が有効な場合、シンプルで親しみや
|
||||
|
||||
この方法は最もシンプルですが、資金が保証されるわけではありません。Checkは後払いであり、Checkを現金化しようとする瞬間まで資金は動きません。Checkを現金化するときに、送金側のアカウントに必要な資金がない可能性があり、ビジネスによっては遅延やその他の問題を引き起こす可能性があります。
|
||||
|
||||
[Checkの利用](../../tutorials/how-tos/use-specialized-payment-types/use-checks/use-checks.md)をご覧ください。
|
||||
[Checkの利用](../../tutorials/how-tos/use-specialized-payment-types/use-checks/index.md)をご覧ください。
|
||||
|
||||
|
||||
### Escrow
|
||||
|
||||
@@ -1,100 +0,0 @@
|
||||
{
|
||||
"result": {
|
||||
"account": "rBXsgNkPcDN2runsvWmwxk3Lh97zdgo9za",
|
||||
"account_objects": [
|
||||
{
|
||||
"Account": "rBXsgNkPcDN2runsvWmwxk3Lh97zdgo9za",
|
||||
"Destination": "rGPnRH1EBpHeTF2QG8DCAgM7z5pb75LAis",
|
||||
"DestinationNode": "0000000000000000",
|
||||
"Flags": 0,
|
||||
"LedgerEntryType": "Check",
|
||||
"OwnerNode": "0000000000000000",
|
||||
"PreviousTxnID": "37D90463CDE0497DB12F18099296DA0E1E52334A785710B5F56BC9637F62429C",
|
||||
"PreviousTxnLgrSeq": 8003261,
|
||||
"SendMax": "999999000000",
|
||||
"Sequence": 5,
|
||||
"index": "2E0AD0740B79BE0AAE5EDD1D5FC79E3C5C221D23C6A7F771D85569B5B91195C2"
|
||||
},
|
||||
{
|
||||
"Balance": {
|
||||
"currency": "BAR",
|
||||
"issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji",
|
||||
"value": "0"
|
||||
},
|
||||
"Flags": 1179648,
|
||||
"HighLimit": {
|
||||
"currency": "BAR",
|
||||
"issuer": "rGPnRH1EBpHeTF2QG8DCAgM7z5pb75LAis",
|
||||
"value": "1234567890123450e79"
|
||||
},
|
||||
"HighNode": "0000000000000000",
|
||||
"LedgerEntryType": "RippleState",
|
||||
"LowLimit": {
|
||||
"currency": "BAR",
|
||||
"issuer": "rBXsgNkPcDN2runsvWmwxk3Lh97zdgo9za",
|
||||
"value": "0"
|
||||
},
|
||||
"LowNode": "0000000000000000",
|
||||
"PreviousTxnID": "D7687E275546322995764632799040CF5BDB597691683DE7C532A60BA64E5414",
|
||||
"PreviousTxnLgrSeq": 8003321,
|
||||
"index": "5A157543E6A19F14E559A3BE14876B48103502F3258893D4F6DF83E61884F20E"
|
||||
},
|
||||
{
|
||||
"Account": "rBXsgNkPcDN2runsvWmwxk3Lh97zdgo9za",
|
||||
"Destination": "rGPnRH1EBpHeTF2QG8DCAgM7z5pb75LAis",
|
||||
"DestinationNode": "0000000000000000",
|
||||
"DestinationTag": 1,
|
||||
"Flags": 0,
|
||||
"InvoiceID": "46060241FABCF692D4D934BA2A6C4427CD4279083E38C77CBE642243E43BE291",
|
||||
"LedgerEntryType": "Check",
|
||||
"OwnerNode": "0000000000000000",
|
||||
"PreviousTxnID": "09D992D4C89E2A24D4BA9BB57ED81C7003815940F39B7C87ADBF2E49034380BB",
|
||||
"PreviousTxnLgrSeq": 7841263,
|
||||
"SendMax": "100000000",
|
||||
"Sequence": 4,
|
||||
"index": "84C61BE9B39B2C4A2267F67504404F1EC76678806C1B901EA781D1E3B4CE0CD9"
|
||||
},
|
||||
{
|
||||
"Balance": {
|
||||
"currency": "FOO",
|
||||
"issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji",
|
||||
"value": "0"
|
||||
},
|
||||
"Flags": 2162688,
|
||||
"HighLimit": {
|
||||
"currency": "FOO",
|
||||
"issuer": "rGPnRH1EBpHeTF2QG8DCAgM7z5pb75LAis",
|
||||
"value": "0"
|
||||
},
|
||||
"HighNode": "0000000000000000",
|
||||
"LedgerEntryType": "RippleState",
|
||||
"LowLimit": {
|
||||
"currency": "FOO",
|
||||
"issuer": "rBXsgNkPcDN2runsvWmwxk3Lh97zdgo9za",
|
||||
"value": "10000"
|
||||
},
|
||||
"LowNode": "0000000000000000",
|
||||
"PreviousTxnID": "119400AC7A5B8BD3CC98265D0AB89FC59E6469ED64917425AEA52D40D83164A7",
|
||||
"PreviousTxnLgrSeq": 8003297,
|
||||
"index": "88003CF8348313E5CD720FBCCFADF4C4CE6C2C7F4093C943A3E01E8F547DBCAF"
|
||||
},
|
||||
{
|
||||
"Account": "rBXsgNkPcDN2runsvWmwxk3Lh97zdgo9za",
|
||||
"Destination": "rGPnRH1EBpHeTF2QG8DCAgM7z5pb75LAis",
|
||||
"DestinationNode": "0000000000000000",
|
||||
"Flags": 0,
|
||||
"LedgerEntryType": "Check",
|
||||
"OwnerNode": "0000000000000000",
|
||||
"PreviousTxnID": "C0B27D20669BAB837B3CDF4B8148B988F17CE1EF8EDF48C806AE9BF69E16F441",
|
||||
"PreviousTxnLgrSeq": 7835887,
|
||||
"SendMax": "100000000",
|
||||
"Sequence": 2,
|
||||
"index": "CEA5F0BD7B2B5C85A70AE735E4CE722C43C86410A79AB87C11938AA13A11DBF9"
|
||||
}
|
||||
],
|
||||
"ledger_hash": "386FE87ED505E28134AC7171A0B690BA87112334B22DD83194A4C7C3C9810E84",
|
||||
"ledger_index": 8003351,
|
||||
"status": "success",
|
||||
"validated": true
|
||||
}
|
||||
}
|
||||
@@ -1,100 +0,0 @@
|
||||
{
|
||||
"result" : {
|
||||
"account" : "rBXsgNkPcDN2runsvWmwxk3Lh97zdgo9za",
|
||||
"account_objects" : [
|
||||
{
|
||||
"Account" : "rBXsgNkPcDN2runsvWmwxk3Lh97zdgo9za",
|
||||
"Destination" : "rGPnRH1EBpHeTF2QG8DCAgM7z5pb75LAis",
|
||||
"DestinationNode" : "0000000000000000",
|
||||
"Flags" : 0,
|
||||
"LedgerEntryType" : "Check",
|
||||
"OwnerNode" : "0000000000000000",
|
||||
"PreviousTxnID" : "37D90463CDE0497DB12F18099296DA0E1E52334A785710B5F56BC9637F62429C",
|
||||
"PreviousTxnLgrSeq" : 8003261,
|
||||
"SendMax" : "999999000000",
|
||||
"Sequence" : 5,
|
||||
"index" : "2E0AD0740B79BE0AAE5EDD1D5FC79E3C5C221D23C6A7F771D85569B5B91195C2"
|
||||
},
|
||||
{
|
||||
"Balance" : {
|
||||
"currency" : "BAR",
|
||||
"issuer" : "rrrrrrrrrrrrrrrrrrrrBZbvji",
|
||||
"value" : "0"
|
||||
},
|
||||
"Flags" : 1179648,
|
||||
"HighLimit" : {
|
||||
"currency" : "BAR",
|
||||
"issuer" : "rGPnRH1EBpHeTF2QG8DCAgM7z5pb75LAis",
|
||||
"value" : "1234567890123450e79"
|
||||
},
|
||||
"HighNode" : "0000000000000000",
|
||||
"LedgerEntryType" : "RippleState",
|
||||
"LowLimit" : {
|
||||
"currency" : "BAR",
|
||||
"issuer" : "rBXsgNkPcDN2runsvWmwxk3Lh97zdgo9za",
|
||||
"value" : "0"
|
||||
},
|
||||
"LowNode" : "0000000000000000",
|
||||
"PreviousTxnID" : "D7687E275546322995764632799040CF5BDB597691683DE7C532A60BA64E5414",
|
||||
"PreviousTxnLgrSeq" : 8003321,
|
||||
"index" : "5A157543E6A19F14E559A3BE14876B48103502F3258893D4F6DF83E61884F20E"
|
||||
},
|
||||
{
|
||||
"Account" : "rBXsgNkPcDN2runsvWmwxk3Lh97zdgo9za",
|
||||
"Destination" : "rGPnRH1EBpHeTF2QG8DCAgM7z5pb75LAis",
|
||||
"DestinationNode" : "0000000000000000",
|
||||
"DestinationTag" : 1,
|
||||
"Flags" : 0,
|
||||
"InvoiceID" : "46060241FABCF692D4D934BA2A6C4427CD4279083E38C77CBE642243E43BE291",
|
||||
"LedgerEntryType" : "Check",
|
||||
"OwnerNode" : "0000000000000000",
|
||||
"PreviousTxnID" : "09D992D4C89E2A24D4BA9BB57ED81C7003815940F39B7C87ADBF2E49034380BB",
|
||||
"PreviousTxnLgrSeq" : 7841263,
|
||||
"SendMax" : "100000000",
|
||||
"Sequence" : 4,
|
||||
"index" : "84C61BE9B39B2C4A2267F67504404F1EC76678806C1B901EA781D1E3B4CE0CD9"
|
||||
},
|
||||
{
|
||||
"Balance" : {
|
||||
"currency" : "FOO",
|
||||
"issuer" : "rrrrrrrrrrrrrrrrrrrrBZbvji",
|
||||
"value" : "0"
|
||||
},
|
||||
"Flags" : 2162688,
|
||||
"HighLimit" : {
|
||||
"currency" : "FOO",
|
||||
"issuer" : "rGPnRH1EBpHeTF2QG8DCAgM7z5pb75LAis",
|
||||
"value" : "0"
|
||||
},
|
||||
"HighNode" : "0000000000000000",
|
||||
"LedgerEntryType" : "RippleState",
|
||||
"LowLimit" : {
|
||||
"currency" : "FOO",
|
||||
"issuer" : "rBXsgNkPcDN2runsvWmwxk3Lh97zdgo9za",
|
||||
"value" : "10000"
|
||||
},
|
||||
"LowNode" : "0000000000000000",
|
||||
"PreviousTxnID" : "119400AC7A5B8BD3CC98265D0AB89FC59E6469ED64917425AEA52D40D83164A7",
|
||||
"PreviousTxnLgrSeq" : 8003297,
|
||||
"index" : "88003CF8348313E5CD720FBCCFADF4C4CE6C2C7F4093C943A3E01E8F547DBCAF"
|
||||
},
|
||||
{
|
||||
"Account" : "rBXsgNkPcDN2runsvWmwxk3Lh97zdgo9za",
|
||||
"Destination" : "rGPnRH1EBpHeTF2QG8DCAgM7z5pb75LAis",
|
||||
"DestinationNode" : "0000000000000000",
|
||||
"Flags" : 0,
|
||||
"LedgerEntryType" : "Check",
|
||||
"OwnerNode" : "0000000000000000",
|
||||
"PreviousTxnID" : "C0B27D20669BAB837B3CDF4B8148B988F17CE1EF8EDF48C806AE9BF69E16F441",
|
||||
"PreviousTxnLgrSeq" : 7835887,
|
||||
"SendMax" : "100000000",
|
||||
"Sequence" : 2,
|
||||
"index" : "CEA5F0BD7B2B5C85A70AE735E4CE722C43C86410A79AB87C11938AA13A11DBF9"
|
||||
}
|
||||
],
|
||||
"ledger_hash" : "386FE87ED505E28134AC7171A0B690BA87112334B22DD83194A4C7C3C9810E84",
|
||||
"ledger_index" : 8003351,
|
||||
"status" : "success",
|
||||
"validated" : true
|
||||
}
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
rippled sign s████████████████████████████ '{
|
||||
"TransactionType": "CheckCancel",
|
||||
"Account": "rUn84CUYbNjRoTQ6mSW7BVJPSVJNLb1QLo",
|
||||
"CheckID": "49647F0D748DC3FE26BDACBC57F251AADEFFF391403EC9BF87C97F67E9977FB0",
|
||||
"Fee": "12"
|
||||
}'
|
||||
@@ -1,20 +0,0 @@
|
||||
Loading: "/etc/opt/ripple/rippled.cfg"
|
||||
2018-Jan-24 01:11:07 HTTPClient:NFO Connecting to 127.0.0.1:5005
|
||||
|
||||
{
|
||||
"result" : {
|
||||
"status" : "success",
|
||||
"tx_blob" : "12001222800000002400000003501849647F0D748DC3FE26BDACBC57F251AADEFFF391403EC9BF87C97F67E9977FB068400000000000000C7321022C53CD19049F32F31848DD3B3BE5CEF6A2DD1EFDA7971AB3FA49B1BAF12AEF78744630440220615F9D19FA182F08530CD978A4C216C8676D0BA9EDB53A620AC909AA0EF0FE7E02203A09CC34C3DB85CCCB3137E78081F8F2B441FB0A3B9E40901F312D3CBA0A67A181147990EC5D1D8DF69E070A968D4B186986FDF06ED0",
|
||||
"tx_json" : {
|
||||
"Account" : "rUn84CUYbNjRoTQ6mSW7BVJPSVJNLb1QLo",
|
||||
"CheckID" : "49647F0D748DC3FE26BDACBC57F251AADEFFF391403EC9BF87C97F67E9977FB0",
|
||||
"Fee" : "12",
|
||||
"Flags" : 2147483648,
|
||||
"Sequence" : 3,
|
||||
"SigningPubKey" : "022C53CD19049F32F31848DD3B3BE5CEF6A2DD1EFDA7971AB3FA49B1BAF12AEF78",
|
||||
"TransactionType" : "CheckCancel",
|
||||
"TxnSignature" : "30440220615F9D19FA182F08530CD978A4C216C8676D0BA9EDB53A620AC909AA0EF0FE7E02203A09CC34C3DB85CCCB3137E78081F8F2B441FB0A3B9E40901F312D3CBA0A67A1",
|
||||
"hash" : "414558223CA8595916BB1FEF238B3BB601B7C0E52659292251CE613E6B4370F9"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
rippled sign s████████████████████████████ '{
|
||||
"Account": "rfkE1aSy9G8Upk4JssnwBxhEv5p4mn2KTy",
|
||||
"TransactionType": "CheckCash",
|
||||
"Amount": "100000000",
|
||||
"CheckID": "838766BA2B995C00744175F69A1B11E32C3DBC40E64801A4056FCBD657F57334",
|
||||
"Fee": "12"
|
||||
}'
|
||||
@@ -1,21 +0,0 @@
|
||||
Loading: "/etc/opt/ripple/rippled.cfg"
|
||||
2018-Jan-24 01:17:54 HTTPClient:NFO Connecting to 127.0.0.1:5005
|
||||
|
||||
{
|
||||
"result" : {
|
||||
"status" : "success",
|
||||
"tx_blob" : "120011228000000024000000015018838766BA2B995C00744175F69A1B11E32C3DBC40E64801A4056FCBD657F57334614000000005F5E10068400000000000000C732102F135B14C552968B0ABE8493CC4C5795A7484D73F6BFD01379F73456F725F66ED74473045022100C64278AC90B841CD3EA9889A4847CAB3AC9927057A34130810FAA7FAC0C6E3290220347260A4C0A6DC9B699DA12510795B2B3414E1FA222AF743226345FBAAEF937C811449FF0C73CA6AF9733DA805F76CA2C37776B7C46B",
|
||||
"tx_json" : {
|
||||
"Account" : "rfkE1aSy9G8Upk4JssnwBxhEv5p4mn2KTy",
|
||||
"Amount" : "100000000",
|
||||
"CheckID" : "838766BA2B995C00744175F69A1B11E32C3DBC40E64801A4056FCBD657F57334",
|
||||
"Fee" : "12",
|
||||
"Flags" : 2147483648,
|
||||
"Sequence" : 1,
|
||||
"SigningPubKey" : "02F135B14C552968B0ABE8493CC4C5795A7484D73F6BFD01379F73456F725F66ED",
|
||||
"TransactionType" : "CheckCash",
|
||||
"TxnSignature" : "3045022100C64278AC90B841CD3EA9889A4847CAB3AC9927057A34130810FAA7FAC0C6E3290220347260A4C0A6DC9B699DA12510795B2B3414E1FA222AF743226345FBAAEF937C",
|
||||
"hash" : "0521707D510858BC8AF69D2227E1D1ADA7DB7C5B4B74115BCD0D91B62AFA8EDC"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
rippled sign s████████████████████████████ '{
|
||||
"Account": "rGPnRH1EBpHeTF2QG8DCAgM7z5pb75LAis",
|
||||
"TransactionType": "CheckCash",
|
||||
"DeliverMin": "95000000",
|
||||
"CheckID": "84C61BE9B39B2C4A2267F67504404F1EC76678806C1B901EA781D1E3B4CE0CD9"
|
||||
}'
|
||||
@@ -1,21 +0,0 @@
|
||||
Loading: "/etc/opt/ripple/rippled.cfg"
|
||||
2018-Apr-03 00:09:53 HTTPClient:NFO Connecting to 127.0.0.1:5005
|
||||
|
||||
{
|
||||
"result" : {
|
||||
"status" : "success",
|
||||
"tx_blob" : "12001122800000002400000004501884C61BE9B39B2C4A2267F67504404F1EC76678806C1B901EA781D1E3B4CE0CD968400000000000000A6A4000000005A995C073210361ACFCB478BCAE01451F95060AF94F70365BF00D7B4661EC2C69EA383762516C7446304402203D7EC220D48AA040D6915C160275D202F7F808E2B58F11B1AB05FB5E5CFCC6C00220304BBD3AD32E13150E0ED7247F2ADFAE83D0ECE329E20CFE0F8DF352934DD2FC8114A8B6B9FF3246856CADC4A0106198C066EA1F9C39",
|
||||
"tx_json" : {
|
||||
"Account" : "rGPnRH1EBpHeTF2QG8DCAgM7z5pb75LAis",
|
||||
"CheckID" : "84C61BE9B39B2C4A2267F67504404F1EC76678806C1B901EA781D1E3B4CE0CD9",
|
||||
"DeliverMin" : "95000000",
|
||||
"Fee" : "10",
|
||||
"Flags" : 2147483648,
|
||||
"Sequence" : 4,
|
||||
"SigningPubKey" : "0361ACFCB478BCAE01451F95060AF94F70365BF00D7B4661EC2C69EA383762516C",
|
||||
"TransactionType" : "CheckCash",
|
||||
"TxnSignature" : "304402203D7EC220D48AA040D6915C160275D202F7F808E2B58F11B1AB05FB5E5CFCC6C00220304BBD3AD32E13150E0ED7247F2ADFAE83D0ECE329E20CFE0F8DF352934DD2FC",
|
||||
"hash" : "A0AFE572E4736CBF49FF4D0D3FF8FDB0C4D31BD10CB4EB542230F85F0F2DD222"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
rippled sign s████████████████████████████ '{
|
||||
"TransactionType": "CheckCreate",
|
||||
"Account": "rBXsgNkPcDN2runsvWmwxk3Lh97zdgo9za",
|
||||
"Destination": "rGPnRH1EBpHeTF2QG8DCAgM7z5pb75LAis",
|
||||
"SendMax": "100000000",
|
||||
"Expiration": 570113521,
|
||||
"InvoiceID": "46060241FABCF692D4D934BA2A6C4427CD4279083E38C77CBE642243E43BE291",
|
||||
"DestinationTag": 1,
|
||||
"Fee": "12"
|
||||
}'
|
||||
@@ -1,24 +0,0 @@
|
||||
Loading: "/etc/opt/ripple/rippled.cfg"
|
||||
2018-Mar-21 21:00:05 HTTPClient:NFO Connecting to 127.0.0.1:5005
|
||||
|
||||
{
|
||||
"result" : {
|
||||
"status" : "success",
|
||||
"tx_blob" : "120010228000000024000000012A21FB3DF12E00000001501146060241FABCF692D4D934BA2A6C4427CD4279083E38C77CBE642243E43BE29168400000000000000C694000000005F5E100732103B6FCD7FAC4F665FE92415DD6E8450AD90F7D6B3D45A6CFCF2E359045FF4BB40074473045022100EB5A9001E14FC7304C4C2DF66507F9FC59D17FDCF98B43A4E30356658AB2A7CF02207127187EE0F287665D9552D15BEE6B00D3C6691C6773CE416E8A714B853F44FC8114735FF88E5269C80CD7F7AF10530DAB840BBF6FDF8314A8B6B9FF3246856CADC4A0106198C066EA1F9C39",
|
||||
"tx_json" : {
|
||||
"Account" : "rBXsgNkPcDN2runsvWmwxk3Lh97zdgo9za",
|
||||
"Destination" : "rGPnRH1EBpHeTF2QG8DCAgM7z5pb75LAis",
|
||||
"DestinationTag" : 1,
|
||||
"Expiration" : 570113521,
|
||||
"Fee" : "12",
|
||||
"Flags" : 2147483648,
|
||||
"InvoiceID" : "46060241FABCF692D4D934BA2A6C4427CD4279083E38C77CBE642243E43BE291",
|
||||
"SendMax" : "100000000",
|
||||
"Sequence" : 1,
|
||||
"SigningPubKey" : "03B6FCD7FAC4F665FE92415DD6E8450AD90F7D6B3D45A6CFCF2E359045FF4BB400",
|
||||
"TransactionType" : "CheckCreate",
|
||||
"TxnSignature" : "3045022100EB5A9001E14FC7304C4C2DF66507F9FC59D17FDCF98B43A4E30356658AB2A7CF02207127187EE0F287665D9552D15BEE6B00D3C6691C6773CE416E8A714B853F44FC",
|
||||
"hash" : "07C3B2878B6941FED97BA647244531B7E2203268B05C71C3A1A014045ADDF408"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
rippled submit 12001222800000002400000003501849647F0D748DC3FE26BDACBC57F251AADEFFF391403EC9BF87C97F67E9977FB068400000000000000C7321022C53CD19049F32F31848DD3B3BE5CEF6A2DD1EFDA7971AB3FA49B1BAF12AEF78744630440220615F9D19FA182F08530CD978A4C216C8676D0BA9EDB53A620AC909AA0EF0FE7E02203A09CC34C3DB85CCCB3137E78081F8F2B441FB0A3B9E40901F312D3CBA0A67A181147990EC5D1D8DF69E070A968D4B186986FDF06ED0
|
||||
@@ -1,23 +0,0 @@
|
||||
Loading: "/etc/opt/ripple/rippled.cfg"
|
||||
2018-Jan-24 01:11:07 HTTPClient:NFO Connecting to 127.0.0.1:5005
|
||||
|
||||
{
|
||||
"result" : {
|
||||
"engine_result" : "tesSUCCESS",
|
||||
"engine_result_code" : 0,
|
||||
"engine_result_message" : "The transaction was applied. Only final in a validated ledger.",
|
||||
"status" : "success",
|
||||
"tx_blob" : "12001222800000002400000003501849647F0D748DC3FE26BDACBC57F251AADEFFF391403EC9BF87C97F67E9977FB068400000000000000C7321022C53CD19049F32F31848DD3B3BE5CEF6A2DD1EFDA7971AB3FA49B1BAF12AEF78744630440220615F9D19FA182F08530CD978A4C216C8676D0BA9EDB53A620AC909AA0EF0FE7E02203A09CC34C3DB85CCCB3137E78081F8F2B441FB0A3B9E40901F312D3CBA0A67A181147990EC5D1D8DF69E070A968D4B186986FDF06ED0",
|
||||
"tx_json" : {
|
||||
"Account" : "rUn84CUYbNjRoTQ6mSW7BVJPSVJNLb1QLo",
|
||||
"CheckID" : "49647F0D748DC3FE26BDACBC57F251AADEFFF391403EC9BF87C97F67E9977FB0",
|
||||
"Fee" : "12",
|
||||
"Flags" : 2147483648,
|
||||
"Sequence" : 3,
|
||||
"SigningPubKey" : "022C53CD19049F32F31848DD3B3BE5CEF6A2DD1EFDA7971AB3FA49B1BAF12AEF78",
|
||||
"TransactionType" : "CheckCancel",
|
||||
"TxnSignature" : "30440220615F9D19FA182F08530CD978A4C216C8676D0BA9EDB53A620AC909AA0EF0FE7E02203A09CC34C3DB85CCCB3137E78081F8F2B441FB0A3B9E40901F312D3CBA0A67A1",
|
||||
"hash" : "414558223CA8595916BB1FEF238B3BB601B7C0E52659292251CE613E6B4370F9"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
rippled submit 120011228000000024000000015018838766BA2B995C00744175F69A1B11E32C3DBC40E64801A4056FCBD657F57334614000000005F5E10068400000000000000C732102F135B14C552968B0ABE8493CC4C5795A7484D73F6BFD01379F73456F725F66ED74473045022100C64278AC90B841CD3EA9889A4847CAB3AC9927057A34130810FAA7FAC0C6E3290220347260A4C0A6DC9B699DA12510795B2B3414E1FA222AF743226345FBAAEF937C811449FF0C73CA6AF9733DA805F76CA2C37776B7C46B
|
||||
@@ -1,24 +0,0 @@
|
||||
Loading: "/etc/opt/ripple/rippled.cfg"
|
||||
2018-Jan-24 01:17:54 HTTPClient:NFO Connecting to 127.0.0.1:5005
|
||||
|
||||
{
|
||||
"result" : {
|
||||
"engine_result" : "tesSUCCESS",
|
||||
"engine_result_code" : 0,
|
||||
"engine_result_message" : "The transaction was applied. Only final in a validated ledger.",
|
||||
"status" : "success",
|
||||
"tx_blob" : "120011228000000024000000015018838766BA2B995C00744175F69A1B11E32C3DBC40E64801A4056FCBD657F57334614000000005F5E10068400000000000000C732102F135B14C552968B0ABE8493CC4C5795A7484D73F6BFD01379F73456F725F66ED74473045022100C64278AC90B841CD3EA9889A4847CAB3AC9927057A34130810FAA7FAC0C6E3290220347260A4C0A6DC9B699DA12510795B2B3414E1FA222AF743226345FBAAEF937C811449FF0C73CA6AF9733DA805F76CA2C37776B7C46B",
|
||||
"tx_json" : {
|
||||
"Account" : "rfkE1aSy9G8Upk4JssnwBxhEv5p4mn2KTy",
|
||||
"Amount" : "100000000",
|
||||
"CheckID" : "838766BA2B995C00744175F69A1B11E32C3DBC40E64801A4056FCBD657F57334",
|
||||
"Fee" : "12",
|
||||
"Flags" : 2147483648,
|
||||
"Sequence" : 1,
|
||||
"SigningPubKey" : "02F135B14C552968B0ABE8493CC4C5795A7484D73F6BFD01379F73456F725F66ED",
|
||||
"TransactionType" : "CheckCash",
|
||||
"TxnSignature" : "3045022100C64278AC90B841CD3EA9889A4847CAB3AC9927057A34130810FAA7FAC0C6E3290220347260A4C0A6DC9B699DA12510795B2B3414E1FA222AF743226345FBAAEF937C",
|
||||
"hash" : "0521707D510858BC8AF69D2227E1D1ADA7DB7C5B4B74115BCD0D91B62AFA8EDC"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
rippled submit 12001122800000002400000004501884C61BE9B39B2C4A2267F67504404F1EC76678806C1B901EA781D1E3B4CE0CD968400000000000000A6A4000000005A995C073210361ACFCB478BCAE01451F95060AF94F70365BF00D7B4661EC2C69EA383762516C7446304402203D7EC220D48AA040D6915C160275D202F7F808E2B58F11B1AB05FB5E5CFCC6C00220304BBD3AD32E13150E0ED7247F2ADFAE83D0ECE329E20CFE0F8DF352934DD2FC8114A8B6B9FF3246856CADC4A0106198C066EA1F9C39
|
||||
@@ -1,24 +0,0 @@
|
||||
Loading: "/etc/opt/ripple/rippled.cfg"
|
||||
2018-Apr-03 00:10:30 HTTPClient:NFO Connecting to 127.0.0.1:5005
|
||||
|
||||
{
|
||||
"result" : {
|
||||
"engine_result" : "tesSUCCESS",
|
||||
"engine_result_code" : 0,
|
||||
"engine_result_message" : "The transaction was applied. Only final in a validated ledger.",
|
||||
"status" : "success",
|
||||
"tx_blob" : "12001122800000002400000004501884C61BE9B39B2C4A2267F67504404F1EC76678806C1B901EA781D1E3B4CE0CD968400000000000000A6A4000000005A995C073210361ACFCB478BCAE01451F95060AF94F70365BF00D7B4661EC2C69EA383762516C7446304402203D7EC220D48AA040D6915C160275D202F7F808E2B58F11B1AB05FB5E5CFCC6C00220304BBD3AD32E13150E0ED7247F2ADFAE83D0ECE329E20CFE0F8DF352934DD2FC8114A8B6B9FF3246856CADC4A0106198C066EA1F9C39",
|
||||
"tx_json" : {
|
||||
"Account" : "rGPnRH1EBpHeTF2QG8DCAgM7z5pb75LAis",
|
||||
"CheckID" : "84C61BE9B39B2C4A2267F67504404F1EC76678806C1B901EA781D1E3B4CE0CD9",
|
||||
"DeliverMin" : "95000000",
|
||||
"Fee" : "10",
|
||||
"Flags" : 2147483648,
|
||||
"Sequence" : 4,
|
||||
"SigningPubKey" : "0361ACFCB478BCAE01451F95060AF94F70365BF00D7B4661EC2C69EA383762516C",
|
||||
"TransactionType" : "CheckCash",
|
||||
"TxnSignature" : "304402203D7EC220D48AA040D6915C160275D202F7F808E2B58F11B1AB05FB5E5CFCC6C00220304BBD3AD32E13150E0ED7247F2ADFAE83D0ECE329E20CFE0F8DF352934DD2FC",
|
||||
"hash" : "A0AFE572E4736CBF49FF4D0D3FF8FDB0C4D31BD10CB4EB542230F85F0F2DD222"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
rippled submit 120010228000000024000000012A21FB3DF12E00000001501146060241FABCF692D4D934BA2A6C4427CD4279083E38C77CBE642243E43BE29168400000000000000C694000000005F5E100732103B6FCD7FAC4F665FE92415DD6E8450AD90F7D6B3D45A6CFCF2E359045FF4BB40074473045022100EB5A9001E14FC7304C4C2DF66507F9FC59D17FDCF98B43A4E30356658AB2A7CF02207127187EE0F287665D9552D15BEE6B00D3C6691C6773CE416E8A714B853F44FC8114735FF88E5269C80CD7F7AF10530DAB840BBF6FDF8314A8B6B9FF3246856CADC4A0106198C066EA1F9C39
|
||||
@@ -1,27 +0,0 @@
|
||||
Loading: "/etc/opt/ripple/rippled.cfg"
|
||||
2018-Mar-28 01:52:49 HTTPClient:NFO Connecting to 127.0.0.1:5005
|
||||
|
||||
{
|
||||
"result": {
|
||||
"engine_result": "terQUEUED",
|
||||
"engine_result_code": -89,
|
||||
"engine_result_message": "Held until escalated fee drops.",
|
||||
"status" : "success",
|
||||
"tx_blob" : "120010228000000024000000012A21FB3DF12E00000001501146060241FABCF692D4D934BA2A6C4427CD4279083E38C77CBE642243E43BE29168400000000000000C694000000005F5E100732103B6FCD7FAC4F665FE92415DD6E8450AD90F7D6B3D45A6CFCF2E359045FF4BB40074473045022100EB5A9001E14FC7304C4C2DF66507F9FC59D17FDCF98B43A4E30356658AB2A7CF02207127187EE0F287665D9552D15BEE6B00D3C6691C6773CE416E8A714B853F44FC8114735FF88E5269C80CD7F7AF10530DAB840BBF6FDF8314A8B6B9FF3246856CADC4A0106198C066EA1F9C39",
|
||||
"tx_json" : {
|
||||
"Account" : "rBXsgNkPcDN2runsvWmwxk3Lh97zdgo9za",
|
||||
"Destination" : "rGPnRH1EBpHeTF2QG8DCAgM7z5pb75LAis",
|
||||
"DestinationTag" : 1,
|
||||
"Expiration" : 570113521,
|
||||
"Fee" : "12",
|
||||
"Flags" : 2147483648,
|
||||
"InvoiceID" : "46060241FABCF692D4D934BA2A6C4427CD4279083E38C77CBE642243E43BE291",
|
||||
"SendMax" : "100000000",
|
||||
"Sequence" : 1,
|
||||
"SigningPubKey" : "03B6FCD7FAC4F665FE92415DD6E8450AD90F7D6B3D45A6CFCF2E359045FF4BB400",
|
||||
"TransactionType" : "CheckCreate",
|
||||
"TxnSignature" : "3045022100EB5A9001E14FC7304C4C2DF66507F9FC59D17FDCF98B43A4E30356658AB2A7CF02207127187EE0F287665D9552D15BEE6B00D3C6691C6773CE416E8A714B853F44FC",
|
||||
"hash" : "07C3B2878B6941FED97BA647244531B7E2203268B05C71C3A1A014045ADDF408"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
rippled tx 414558223CA8595916BB1FEF238B3BB601B7C0E52659292251CE613E6B4370F9
|
||||
@@ -1,89 +0,0 @@
|
||||
Loading: "/etc/opt/ripple/rippled.cfg"
|
||||
2018-Jan-24 01:11:53 HTTPClient:NFO Connecting to 127.0.0.1:5005
|
||||
|
||||
{
|
||||
"result" : {
|
||||
"Account" : "rUn84CUYbNjRoTQ6mSW7BVJPSVJNLb1QLo",
|
||||
"CheckID" : "49647F0D748DC3FE26BDACBC57F251AADEFFF391403EC9BF87C97F67E9977FB0",
|
||||
"Fee" : "12",
|
||||
"Flags" : 2147483648,
|
||||
"Sequence" : 3,
|
||||
"SigningPubKey" : "022C53CD19049F32F31848DD3B3BE5CEF6A2DD1EFDA7971AB3FA49B1BAF12AEF78",
|
||||
"TransactionType" : "CheckCancel",
|
||||
"TxnSignature" : "30440220615F9D19FA182F08530CD978A4C216C8676D0BA9EDB53A620AC909AA0EF0FE7E02203A09CC34C3DB85CCCB3137E78081F8F2B441FB0A3B9E40901F312D3CBA0A67A1",
|
||||
"date" : 570071520,
|
||||
"hash" : "414558223CA8595916BB1FEF238B3BB601B7C0E52659292251CE613E6B4370F9",
|
||||
"inLedger" : 7,
|
||||
"ledger_index" : 7,
|
||||
"meta" : {
|
||||
"AffectedNodes" : [
|
||||
{
|
||||
"ModifiedNode" : {
|
||||
"FinalFields" : {
|
||||
"Flags" : 0,
|
||||
"Owner" : "rfkE1aSy9G8Upk4JssnwBxhEv5p4mn2KTy",
|
||||
"RootIndex" : "032D861D151E38E86F46805ED1896D1A50144F65459717B6D12470A9E6E3B66E"
|
||||
},
|
||||
"LedgerEntryType" : "DirectoryNode",
|
||||
"LedgerIndex" : "032D861D151E38E86F46805ED1896D1A50144F65459717B6D12470A9E6E3B66E"
|
||||
}
|
||||
},
|
||||
{
|
||||
"DeletedNode" : {
|
||||
"FinalFields" : {
|
||||
"Account" : "rUn84CUYbNjRoTQ6mSW7BVJPSVJNLb1QLo",
|
||||
"Destination" : "rfkE1aSy9G8Upk4JssnwBxhEv5p4mn2KTy",
|
||||
"DestinationNode" : "0000000000000000",
|
||||
"DestinationTag" : 1,
|
||||
"Expiration" : 570113521,
|
||||
"Flags" : 0,
|
||||
"InvoiceID" : "46060241FABCF692D4D934BA2A6C4427CD4279083E38C77CBE642243E43BE291",
|
||||
"OwnerNode" : "0000000000000000",
|
||||
"PreviousTxnID" : "5463C6E08862A1FAE5EDAC12D70ADB16546A1F674930521295BC082494B62924",
|
||||
"PreviousTxnLgrSeq" : 6,
|
||||
"SendMax" : "100000000",
|
||||
"Sequence" : 2
|
||||
},
|
||||
"LedgerEntryType" : "Check",
|
||||
"LedgerIndex" : "49647F0D748DC3FE26BDACBC57F251AADEFFF391403EC9BF87C97F67E9977FB0"
|
||||
}
|
||||
},
|
||||
{
|
||||
"ModifiedNode" : {
|
||||
"FinalFields" : {
|
||||
"Flags" : 0,
|
||||
"Owner" : "rUn84CUYbNjRoTQ6mSW7BVJPSVJNLb1QLo",
|
||||
"RootIndex" : "AD136EC2A266027D8F202C97D294BBE32F6FC2AD5501D9853F785FE77AB94C94"
|
||||
},
|
||||
"LedgerEntryType" : "DirectoryNode",
|
||||
"LedgerIndex" : "AD136EC2A266027D8F202C97D294BBE32F6FC2AD5501D9853F785FE77AB94C94"
|
||||
}
|
||||
},
|
||||
{
|
||||
"ModifiedNode" : {
|
||||
"FinalFields" : {
|
||||
"Account" : "rUn84CUYbNjRoTQ6mSW7BVJPSVJNLb1QLo",
|
||||
"Balance" : "4999999999964",
|
||||
"Flags" : 0,
|
||||
"OwnerCount" : 1,
|
||||
"Sequence" : 4
|
||||
},
|
||||
"LedgerEntryType" : "AccountRoot",
|
||||
"LedgerIndex" : "D3A1DBAA28717975A9119EC4CBC891BA9A66236C484F03C9911F463AD3B66DE0",
|
||||
"PreviousFields" : {
|
||||
"Balance" : "4999999999976",
|
||||
"OwnerCount" : 2,
|
||||
"Sequence" : 3
|
||||
},
|
||||
"PreviousTxnID" : "5463C6E08862A1FAE5EDAC12D70ADB16546A1F674930521295BC082494B62924",
|
||||
"PreviousTxnLgrSeq" : 6
|
||||
}
|
||||
}
|
||||
],
|
||||
"TransactionIndex" : 0,
|
||||
"TransactionResult" : "tesSUCCESS"
|
||||
},
|
||||
"status" : "success",
|
||||
"validated" : true
|
||||
}
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
rippled tx 0521707D510858BC8AF69D2227E1D1ADA7DB7C5B4B74115BCD0D91B62AFA8EDC
|
||||
@@ -1,108 +0,0 @@
|
||||
Loading: "/etc/opt/ripple/rippled.cfg"
|
||||
2018-Jan-24 01:18:39 HTTPClient:NFO Connecting to 127.0.0.1:5005
|
||||
|
||||
{
|
||||
"result" : {
|
||||
"Account" : "rfkE1aSy9G8Upk4JssnwBxhEv5p4mn2KTy",
|
||||
"Amount" : "100000000",
|
||||
"CheckID" : "838766BA2B995C00744175F69A1B11E32C3DBC40E64801A4056FCBD657F57334",
|
||||
"Fee" : "12",
|
||||
"Flags" : 2147483648,
|
||||
"Sequence" : 1,
|
||||
"SigningPubKey" : "02F135B14C552968B0ABE8493CC4C5795A7484D73F6BFD01379F73456F725F66ED",
|
||||
"TransactionType" : "CheckCash",
|
||||
"TxnSignature" : "3045022100C64278AC90B841CD3EA9889A4847CAB3AC9927057A34130810FAA7FAC0C6E3290220347260A4C0A6DC9B699DA12510795B2B3414E1FA222AF743226345FBAAEF937C",
|
||||
"date" : 570071920,
|
||||
"hash" : "0521707D510858BC8AF69D2227E1D1ADA7DB7C5B4B74115BCD0D91B62AFA8EDC",
|
||||
"inLedger" : 9,
|
||||
"ledger_index" : 9,
|
||||
"meta" : {
|
||||
"AffectedNodes" : [
|
||||
{
|
||||
"ModifiedNode" : {
|
||||
"FinalFields" : {
|
||||
"Flags" : 0,
|
||||
"Owner" : "rfkE1aSy9G8Upk4JssnwBxhEv5p4mn2KTy",
|
||||
"RootIndex" : "032D861D151E38E86F46805ED1896D1A50144F65459717B6D12470A9E6E3B66E"
|
||||
},
|
||||
"LedgerEntryType" : "DirectoryNode",
|
||||
"LedgerIndex" : "032D861D151E38E86F46805ED1896D1A50144F65459717B6D12470A9E6E3B66E"
|
||||
}
|
||||
},
|
||||
{
|
||||
"ModifiedNode" : {
|
||||
"FinalFields" : {
|
||||
"Account" : "rfkE1aSy9G8Upk4JssnwBxhEv5p4mn2KTy",
|
||||
"Balance" : "1000099999988",
|
||||
"Flags" : 0,
|
||||
"OwnerCount" : 0,
|
||||
"Sequence" : 2
|
||||
},
|
||||
"LedgerEntryType" : "AccountRoot",
|
||||
"LedgerIndex" : "38E1EF3284A45B090D549EFFB014ACF68927FE0884CDAF01CE3629DF90542D66",
|
||||
"PreviousFields" : {
|
||||
"Balance" : "1000000000000",
|
||||
"Sequence" : 1
|
||||
},
|
||||
"PreviousTxnID" : "3E14D859F6B4BE923323EFC94571606455921E65173147A89BC6EDDA4374B294",
|
||||
"PreviousTxnLgrSeq" : 5
|
||||
}
|
||||
},
|
||||
{
|
||||
"DeletedNode" : {
|
||||
"FinalFields" : {
|
||||
"Account" : "rUn84CUYbNjRoTQ6mSW7BVJPSVJNLb1QLo",
|
||||
"Destination" : "rfkE1aSy9G8Upk4JssnwBxhEv5p4mn2KTy",
|
||||
"DestinationNode" : "0000000000000000",
|
||||
"DestinationTag" : 1,
|
||||
"Expiration" : 570113521,
|
||||
"Flags" : 0,
|
||||
"InvoiceID" : "6F1DFD1D0FE8A32E40E1F2C05CF1C15545BAB56B617F9C6C2D63A6B704BEF59B",
|
||||
"OwnerNode" : "0000000000000000",
|
||||
"PreviousTxnID" : "0FD9F719CDE29E6F6DF752B93EB9AC6FBB493BF989F2CB63B8C0E73A8DCDF61A",
|
||||
"PreviousTxnLgrSeq" : 8,
|
||||
"SendMax" : "100000000",
|
||||
"Sequence" : 4
|
||||
},
|
||||
"LedgerEntryType" : "Check",
|
||||
"LedgerIndex" : "838766BA2B995C00744175F69A1B11E32C3DBC40E64801A4056FCBD657F57334"
|
||||
}
|
||||
},
|
||||
{
|
||||
"ModifiedNode" : {
|
||||
"FinalFields" : {
|
||||
"Flags" : 0,
|
||||
"Owner" : "rUn84CUYbNjRoTQ6mSW7BVJPSVJNLb1QLo",
|
||||
"RootIndex" : "AD136EC2A266027D8F202C97D294BBE32F6FC2AD5501D9853F785FE77AB94C94"
|
||||
},
|
||||
"LedgerEntryType" : "DirectoryNode",
|
||||
"LedgerIndex" : "AD136EC2A266027D8F202C97D294BBE32F6FC2AD5501D9853F785FE77AB94C94"
|
||||
}
|
||||
},
|
||||
{
|
||||
"ModifiedNode" : {
|
||||
"FinalFields" : {
|
||||
"Account" : "rUn84CUYbNjRoTQ6mSW7BVJPSVJNLb1QLo",
|
||||
"Balance" : "4999899999952",
|
||||
"Flags" : 0,
|
||||
"OwnerCount" : 1,
|
||||
"Sequence" : 5
|
||||
},
|
||||
"LedgerEntryType" : "AccountRoot",
|
||||
"LedgerIndex" : "D3A1DBAA28717975A9119EC4CBC891BA9A66236C484F03C9911F463AD3B66DE0",
|
||||
"PreviousFields" : {
|
||||
"Balance" : "4999999999952",
|
||||
"OwnerCount" : 2
|
||||
},
|
||||
"PreviousTxnID" : "0FD9F719CDE29E6F6DF752B93EB9AC6FBB493BF989F2CB63B8C0E73A8DCDF61A",
|
||||
"PreviousTxnLgrSeq" : 8
|
||||
}
|
||||
}
|
||||
],
|
||||
"TransactionIndex" : 0,
|
||||
"TransactionResult" : "tesSUCCESS"
|
||||
},
|
||||
"status" : "success",
|
||||
"validated" : true
|
||||
}
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
rippled tx A0AFE572E4736CBF49FF4D0D3FF8FDB0C4D31BD10CB4EB542230F85F0F2DD222
|
||||
@@ -1,107 +0,0 @@
|
||||
Loading: "/etc/opt/ripple/rippled.cfg"
|
||||
2018-Apr-03 00:11:17 HTTPClient:NFO Connecting to 127.0.0.1:5005
|
||||
|
||||
{
|
||||
"result" : {
|
||||
"Account" : "rGPnRH1EBpHeTF2QG8DCAgM7z5pb75LAis",
|
||||
"CheckID" : "84C61BE9B39B2C4A2267F67504404F1EC76678806C1B901EA781D1E3B4CE0CD9",
|
||||
"DeliverMin" : "95000000",
|
||||
"Fee" : "10",
|
||||
"Flags" : 2147483648,
|
||||
"Sequence" : 4,
|
||||
"SigningPubKey" : "0361ACFCB478BCAE01451F95060AF94F70365BF00D7B4661EC2C69EA383762516C",
|
||||
"TransactionType" : "CheckCash",
|
||||
"TxnSignature" : "304402203D7EC220D48AA040D6915C160275D202F7F808E2B58F11B1AB05FB5E5CFCC6C00220304BBD3AD32E13150E0ED7247F2ADFAE83D0ECE329E20CFE0F8DF352934DD2FC",
|
||||
"date" : 576029432,
|
||||
"hash" : "A0AFE572E4736CBF49FF4D0D3FF8FDB0C4D31BD10CB4EB542230F85F0F2DD222",
|
||||
"inLedger" : 8005386,
|
||||
"ledger_index" : 8005386,
|
||||
"meta" : {
|
||||
"AffectedNodes" : [
|
||||
{
|
||||
"ModifiedNode" : {
|
||||
"FinalFields" : {
|
||||
"Flags" : 0,
|
||||
"Owner" : "rBXsgNkPcDN2runsvWmwxk3Lh97zdgo9za",
|
||||
"RootIndex" : "3F248A0715ECCAFC3BEE0C63C8F429ACE54ABC403AAF5F2885C2B65D62D1FAC1"
|
||||
},
|
||||
"LedgerEntryType" : "DirectoryNode",
|
||||
"LedgerIndex" : "3F248A0715ECCAFC3BEE0C63C8F429ACE54ABC403AAF5F2885C2B65D62D1FAC1"
|
||||
}
|
||||
},
|
||||
{
|
||||
"ModifiedNode" : {
|
||||
"FinalFields" : {
|
||||
"Account" : "rGPnRH1EBpHeTF2QG8DCAgM7z5pb75LAis",
|
||||
"Balance" : "10099999960",
|
||||
"Flags" : 0,
|
||||
"OwnerCount" : 2,
|
||||
"Sequence" : 5
|
||||
},
|
||||
"LedgerEntryType" : "AccountRoot",
|
||||
"LedgerIndex" : "7939126A732EBBDEC715FD3CCB056EB31E65228CA17E3B2901E7D30B90FD03D3",
|
||||
"PreviousFields" : {
|
||||
"Balance" : "9999999970",
|
||||
"Sequence" : 4
|
||||
},
|
||||
"PreviousTxnID" : "0283465F0D21BE6B1E91ABDE17266C24C1B4915BAAA9A88CC098A98D5ECD3E9E",
|
||||
"PreviousTxnLgrSeq" : 8005334
|
||||
}
|
||||
},
|
||||
{
|
||||
"DeletedNode" : {
|
||||
"FinalFields" : {
|
||||
"Account" : "rBXsgNkPcDN2runsvWmwxk3Lh97zdgo9za",
|
||||
"Destination" : "rGPnRH1EBpHeTF2QG8DCAgM7z5pb75LAis",
|
||||
"DestinationNode" : "0000000000000000",
|
||||
"DestinationTag" : 1,
|
||||
"Flags" : 0,
|
||||
"InvoiceID" : "46060241FABCF692D4D934BA2A6C4427CD4279083E38C77CBE642243E43BE291",
|
||||
"OwnerNode" : "0000000000000000",
|
||||
"PreviousTxnID" : "09D992D4C89E2A24D4BA9BB57ED81C7003815940F39B7C87ADBF2E49034380BB",
|
||||
"PreviousTxnLgrSeq" : 7841263,
|
||||
"SendMax" : "100000000",
|
||||
"Sequence" : 4
|
||||
},
|
||||
"LedgerEntryType" : "Check",
|
||||
"LedgerIndex" : "84C61BE9B39B2C4A2267F67504404F1EC76678806C1B901EA781D1E3B4CE0CD9"
|
||||
}
|
||||
},
|
||||
{
|
||||
"ModifiedNode" : {
|
||||
"FinalFields" : {
|
||||
"Account" : "rBXsgNkPcDN2runsvWmwxk3Lh97zdgo9za",
|
||||
"Balance" : "9899999920",
|
||||
"Flags" : 0,
|
||||
"OwnerCount" : 2,
|
||||
"Sequence" : 8
|
||||
},
|
||||
"LedgerEntryType" : "AccountRoot",
|
||||
"LedgerIndex" : "A9A591BA661F69433D5BEAA49F10BA2B8DEA5183EF414B9130BFE5E0328FE875",
|
||||
"PreviousFields" : {
|
||||
"Balance" : "9999999920",
|
||||
"OwnerCount" : 3
|
||||
},
|
||||
"PreviousTxnID" : "54A7A917BE9AC13962251BCF1D09803C7BBE75882B8BFC987B5933A566A48215",
|
||||
"PreviousTxnLgrSeq" : 8004870
|
||||
}
|
||||
},
|
||||
{
|
||||
"ModifiedNode" : {
|
||||
"FinalFields" : {
|
||||
"Flags" : 0,
|
||||
"Owner" : "rGPnRH1EBpHeTF2QG8DCAgM7z5pb75LAis",
|
||||
"RootIndex" : "C6A30AD85346718C7148D161663F84A96A4F0CE7F4D68C3C74D176A6C50BA6B9"
|
||||
},
|
||||
"LedgerEntryType" : "DirectoryNode",
|
||||
"LedgerIndex" : "C6A30AD85346718C7148D161663F84A96A4F0CE7F4D68C3C74D176A6C50BA6B9"
|
||||
}
|
||||
}
|
||||
],
|
||||
"TransactionIndex" : 4,
|
||||
"TransactionResult" : "tesSUCCESS"
|
||||
},
|
||||
"status" : "success",
|
||||
"validated" : true
|
||||
}
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
rippled tx 07C3B2878B6941FED97BA647244531B7E2203268B05C71C3A1A014045ADDF408
|
||||
@@ -1,88 +0,0 @@
|
||||
Loading: "/etc/opt/ripple/rippled.cfg"
|
||||
2018-Mar-28 02:17:55 HTTPClient:NFO Connecting to 127.0.0.1:5005
|
||||
|
||||
{
|
||||
"result" : {
|
||||
"Account" : "rBXsgNkPcDN2runsvWmwxk3Lh97zdgo9za",
|
||||
"Destination" : "rGPnRH1EBpHeTF2QG8DCAgM7z5pb75LAis",
|
||||
"DestinationTag" : 1,
|
||||
"Expiration" : 570113521,
|
||||
"Fee" : "12",
|
||||
"Flags" : 2147483648,
|
||||
"InvoiceID" : "46060241FABCF692D4D934BA2A6C4427CD4279083E38C77CBE642243E43BE291",
|
||||
"SendMax" : "100000000",
|
||||
"Sequence" : 1,
|
||||
"SigningPubKey" : "03B6FCD7FAC4F665FE92415DD6E8450AD90F7D6B3D45A6CFCF2E359045FF4BB400",
|
||||
"TransactionType" : "CheckCreate",
|
||||
"TxnSignature" : "3045022100EB5A9001E14FC7304C4C2DF66507F9FC59D17FDCF98B43A4E30356658AB2A7CF02207127187EE0F287665D9552D15BEE6B00D3C6691C6773CE416E8A714B853F44FC",
|
||||
"hash" : "07C3B2878B6941FED97BA647244531B7E2203268B05C71C3A1A014045ADDF408"
|
||||
|
||||
"date" : 575516100,
|
||||
"inLedger" : 7841263,
|
||||
"ledger_index" : 7841263,
|
||||
"meta" : {
|
||||
"AffectedNodes" : [
|
||||
{
|
||||
"ModifiedNode" : {
|
||||
"FinalFields" : {
|
||||
"Flags" : 0,
|
||||
"Owner" : "rBXsgNkPcDN2runsvWmwxk3Lh97zdgo9za",
|
||||
"RootIndex" : "3F248A0715ECCAFC3BEE0C63C8F429ACE54ABC403AAF5F2885C2B65D62D1FAC1"
|
||||
},
|
||||
"LedgerEntryType" : "DirectoryNode",
|
||||
"LedgerIndex" : "3F248A0715ECCAFC3BEE0C63C8F429ACE54ABC403AAF5F2885C2B65D62D1FAC1"
|
||||
}
|
||||
},
|
||||
{
|
||||
"CreatedNode" : {
|
||||
"LedgerEntryType" : "Check",
|
||||
"LedgerIndex" : "84C61BE9B39B2C4A2267F67504404F1EC76678806C1B901EA781D1E3B4CE0CD9",
|
||||
"NewFields" : {
|
||||
"Account" : "rBXsgNkPcDN2runsvWmwxk3Lh97zdgo9za",
|
||||
"Destination" : "rGPnRH1EBpHeTF2QG8DCAgM7z5pb75LAis",
|
||||
"DestinationTag" : 1,
|
||||
"InvoiceID" : "46060241FABCF692D4D934BA2A6C4427CD4279083E38C77CBE642243E43BE291",
|
||||
"SendMax" : "100000000",
|
||||
"Sequence" : 1
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"ModifiedNode" : {
|
||||
"FinalFields" : {
|
||||
"Account" : "rBXsgNkPcDN2runsvWmwxk3Lh97zdgo9za",
|
||||
"Balance" : "9999999952",
|
||||
"Flags" : 0,
|
||||
"OwnerCount" : 2,
|
||||
"Sequence" : 2
|
||||
},
|
||||
"LedgerEntryType" : "AccountRoot",
|
||||
"LedgerIndex" : "A9A591BA661F69433D5BEAA49F10BA2B8DEA5183EF414B9130BFE5E0328FE875",
|
||||
"PreviousFields" : {
|
||||
"Balance" : "9999999964",
|
||||
"OwnerCount" : 1,
|
||||
"Sequence" : 1
|
||||
},
|
||||
"PreviousTxnID" : "45AF36CF7A810D0054C38C82C898EFC7E4898DF94FA7A3AAF80CB868708F7CE0",
|
||||
"PreviousTxnLgrSeq" : 7841237
|
||||
}
|
||||
},
|
||||
{
|
||||
"ModifiedNode" : {
|
||||
"FinalFields" : {
|
||||
"Flags" : 0,
|
||||
"Owner" : "rGPnRH1EBpHeTF2QG8DCAgM7z5pb75LAis",
|
||||
"RootIndex" : "C6A30AD85346718C7148D161663F84A96A4F0CE7F4D68C3C74D176A6C50BA6B9"
|
||||
},
|
||||
"LedgerEntryType" : "DirectoryNode",
|
||||
"LedgerIndex" : "C6A30AD85346718C7148D161663F84A96A4F0CE7F4D68C3C74D176A6C50BA6B9"
|
||||
}
|
||||
}
|
||||
],
|
||||
"TransactionIndex" : 0,
|
||||
"TransactionResult" : "tesSUCCESS"
|
||||
},
|
||||
"status" : "success",
|
||||
"validated" : true
|
||||
}
|
||||
}
|
||||
@@ -1,44 +1,56 @@
|
||||
const xrpl = require('xrpl');
|
||||
'use strict'
|
||||
const xrpl = require('xrpl')
|
||||
|
||||
const secret = "sEdTPPEeMH6SAgpo6rSj8YW7a9vFfUj"; // TODO: Replace with your secret
|
||||
const checkId = ""; // TODO: Replace with your check ID
|
||||
// Define parameters. Edit this snippet with your values before running it.
|
||||
const secret = "s████████████████████████████" // Replace with your secret
|
||||
const check_id = "" // Replace with your Check ID
|
||||
|
||||
const main = async ()=> {
|
||||
async function main() {
|
||||
try {
|
||||
|
||||
// Connect ----------------------------------------------------------------
|
||||
const client = new xrpl.Client('wss://s.altnet.rippletest.net:51233');
|
||||
await client.connect();
|
||||
|
||||
// Instantiate wallet from secret. ----------------------------------------
|
||||
const wallet = await xrpl.Wallet.fromSeed(secret)
|
||||
console.log("Wallet address: ", wallet.address)
|
||||
|
||||
// Check if the check ID is provided --------------------------------------
|
||||
if (checkId.length === 0) {
|
||||
if (check_id.length === 0) {
|
||||
console.log("Please edit this snippet to provide a check ID. You can get a check ID by running create-check.js.");
|
||||
return;
|
||||
}
|
||||
|
||||
// Prepare ----------------------------------------------------------------
|
||||
const wallet = await xrpl.Wallet.fromSeed(secret);
|
||||
console.log("Wallet address: ", wallet.address);
|
||||
|
||||
const checkCancelRequest = {
|
||||
// Prepare the transaction ------------------------------------------------
|
||||
const checkcancel = {
|
||||
"TransactionType": "CheckCancel",
|
||||
"Account": wallet.address,
|
||||
"CheckID": checkId
|
||||
"CheckID": check_id
|
||||
};
|
||||
|
||||
// Auto-fill the fields ---------------------------------------------------
|
||||
const prepared = await client.autofill(checkCancelRequest);
|
||||
// Submit the transaction -------------------------------------------------
|
||||
const tx = await client.submitAndWait(
|
||||
checkcancel,
|
||||
{ autofill: true,
|
||||
wallet: wallet }
|
||||
)
|
||||
|
||||
// Submit -----------------------------------------------------------------
|
||||
const response = await client.submitAndWait(prepared, { wallet });
|
||||
console.log(JSON.stringify(response.result, null, "\t"));
|
||||
// Confirm results --------------------------------------------------------
|
||||
console.log(`Transaction result: ${JSON.stringify(tx, null, 2)}`)
|
||||
|
||||
if (tx.result.meta.TransactionResult === "tesSUCCESS") {
|
||||
// submitAndWait() only returns when the transaction's outcome is final,
|
||||
// so you don't also have to check for validated: true.
|
||||
console.log("Transaction was successful.")
|
||||
}
|
||||
|
||||
// Disconnect -------------------------------------------------------------
|
||||
await client.disconnect();
|
||||
await client.disconnect()
|
||||
|
||||
} catch (error) {
|
||||
console.error(`Error: ${error}`);
|
||||
console.error(`Error: ${error}`)
|
||||
}
|
||||
}
|
||||
|
||||
main();
|
||||
main()
|
||||
|
||||
62
_code-samples/checks/js/cash-check-exact.js
Normal file
62
_code-samples/checks/js/cash-check-exact.js
Normal file
@@ -0,0 +1,62 @@
|
||||
'use strict'
|
||||
const xrpl = require('xrpl')
|
||||
|
||||
// Define parameters. Edit this code with your values before running it.
|
||||
const secret = "s████████████████████████████" // Replace with your secret
|
||||
const check_id = "49D339B76FAB3FE3C9DFAD32EB7DB9269FD07B07E165DD7BAFDF68D14CE6CAB8"
|
||||
const amount = "30000000" // Replace with the amount you want to cash
|
||||
// String for XRP in drops
|
||||
// {currency, issuer, value} object for token amount
|
||||
|
||||
async function main() {
|
||||
try {
|
||||
// Connect to Testnet
|
||||
const client = new xrpl.Client("wss://s.altnet.rippletest.net:51233")
|
||||
await client.connect()
|
||||
|
||||
// Instantiate a wallet -----------------------------------------------
|
||||
const wallet = xrpl.Wallet.fromSeed(secret)
|
||||
console.log("Wallet address: ", wallet.address)
|
||||
|
||||
// Check if the check ID is provided ----------------------------------
|
||||
if (check_id == "49D339B76FAB3FE3C9DFAD32EB7DB9269FD07B07E165DD7BAFDF68D14CE6CAB8") {
|
||||
console.log("Please edit this snippet to provide your own check ID. You can get a check ID by running create-check.js.")
|
||||
return
|
||||
}
|
||||
|
||||
// Prepare the transaction ------------------------------------------------
|
||||
const checkcash = {
|
||||
TransactionType: "CheckCash",
|
||||
Account: wallet.address,
|
||||
CheckID: check_id,
|
||||
Amount: amount
|
||||
}
|
||||
|
||||
// Submit the transaction -------------------------------------------------
|
||||
const tx = await client.submitAndWait(
|
||||
checkcash,
|
||||
{ autofill: true,
|
||||
wallet: wallet }
|
||||
)
|
||||
|
||||
// Confirm transaction results --------------------------------------------
|
||||
console.log(`Transaction result: ${JSON.stringify(tx, null, 2)}`)
|
||||
|
||||
if (tx.result.meta.TransactionResult === "tesSUCCESS") {
|
||||
// submitAndWait() only returns when the transaction's outcome is final,
|
||||
// so you don't also have to check for validated: true.
|
||||
console.log("Transaction was successful.")
|
||||
|
||||
console.log("Balance changes:",
|
||||
JSON.stringify(xrpl.getBalanceChanges(tx.result.meta), null, 2)
|
||||
)
|
||||
}
|
||||
|
||||
// Disconnect -------------------------------------------------------------
|
||||
await client.disconnect()
|
||||
} catch (error) {
|
||||
console.log("Error: ", error)
|
||||
}
|
||||
}
|
||||
|
||||
main()
|
||||
62
_code-samples/checks/js/cash-check-flexible.js
Normal file
62
_code-samples/checks/js/cash-check-flexible.js
Normal file
@@ -0,0 +1,62 @@
|
||||
'use strict'
|
||||
const xrpl = require('xrpl')
|
||||
|
||||
// Define parameters. Edit this code with your values before running it.
|
||||
const secret = "s████████████████████████████" // Replace with your secret
|
||||
const check_id = "5C5E9F39A92908BBA7B85AECD9457E9616AD36DF1895074723253B767A380D14"
|
||||
const deliver_min = "20000000" // Replace with the minimum amount to receive
|
||||
// String for XRP in drops
|
||||
// {currency, issuer, value} object for token amount
|
||||
|
||||
async function main() {
|
||||
try {
|
||||
// Connect to Testnet
|
||||
const client = new xrpl.Client("wss://s.altnet.rippletest.net:51233")
|
||||
await client.connect()
|
||||
|
||||
// Instantiate a wallet -----------------------------------------------
|
||||
const wallet = xrpl.Wallet.fromSeed(secret)
|
||||
console.log("Wallet address: ", wallet.address)
|
||||
|
||||
// Check if the check ID is provided ----------------------------------
|
||||
if (check_id.length === 0) {
|
||||
console.log("Please edit this snippet to provide a check ID. You can get a check ID by running create-check.js.")
|
||||
return
|
||||
}
|
||||
|
||||
// Prepare the transaction ------------------------------------------------
|
||||
const checkcash = {
|
||||
TransactionType: "CheckCash",
|
||||
Account: wallet.address,
|
||||
CheckID: check_id,
|
||||
DeliverMin: deliver_min
|
||||
}
|
||||
|
||||
// Submit the transaction -------------------------------------------------
|
||||
const tx = await client.submitAndWait(
|
||||
checkcash,
|
||||
{ autofill: true,
|
||||
wallet: wallet }
|
||||
)
|
||||
|
||||
// Confirm transaction results --------------------------------------------
|
||||
console.log(`Transaction result: ${JSON.stringify(tx, null, 2)}`)
|
||||
|
||||
if (tx.result.meta.TransactionResult === "tesSUCCESS") {
|
||||
// submitAndWait() only returns when the transaction's outcome is final,
|
||||
// so you don't also have to check for validated: true.
|
||||
console.log("Transaction was successful.")
|
||||
|
||||
console.log("Balance changes:",
|
||||
JSON.stringify(xrpl.getBalanceChanges(tx.result.meta), null, 2)
|
||||
)
|
||||
}
|
||||
|
||||
// Disconnect -------------------------------------------------------------
|
||||
await client.disconnect()
|
||||
} catch (error) {
|
||||
console.log("Error: ", error)
|
||||
}
|
||||
}
|
||||
|
||||
main()
|
||||
@@ -1,43 +0,0 @@
|
||||
'use strict'
|
||||
const xrpl = require('xrpl');
|
||||
|
||||
const secret = "sEdTPPEeMH6SAgpo6rSj8YW7a9vFfUj"; // TODO: Replace with your secret
|
||||
const checkId = ""; // TODO: Replace with your check ID
|
||||
const amount = "12"; // TODO: Replace with the amount you want to cash
|
||||
|
||||
const main = async () => {
|
||||
try {
|
||||
// Connect to the testnet
|
||||
const client = new xrpl.Client("wss://s.altnet.rippletest.net:51233");
|
||||
await client.connect();
|
||||
|
||||
// Generate a wallet ------------------------------------------------------
|
||||
const wallet = await xrpl.Wallet.fromSeed(secret);
|
||||
console.log("Wallet address: ", wallet.address);
|
||||
|
||||
// Check if the check ID is provided --------------------------------------
|
||||
if (checkId.length === 0) {
|
||||
console.log("Please edit this snippet to provide a check ID. You can get a check ID by running create-check.js.");
|
||||
return;
|
||||
}
|
||||
|
||||
// Prepare the transaction ------------------------------------------------
|
||||
const transaction = {
|
||||
TransactionType: "CheckCash",
|
||||
Account: wallet.address,
|
||||
CheckID: checkId,
|
||||
Amount: amount,
|
||||
};
|
||||
|
||||
// Submit -----------------------------------------------------------------
|
||||
const response = await client.submitAndWait(transaction, { wallet });
|
||||
console.log(JSON.stringify(response.result, null, "\t"));
|
||||
|
||||
// Disconnect -------------------------------------------------------------
|
||||
await client.disconnect();
|
||||
} catch (error) {
|
||||
console.log("Error: ", error);
|
||||
}
|
||||
}
|
||||
|
||||
main()
|
||||
@@ -1,57 +1,65 @@
|
||||
'use strict'
|
||||
const xrpl = require('xrpl');
|
||||
const crypto = require('crypto');
|
||||
const hash = crypto.createHash('sha512');
|
||||
const xrpl = require('xrpl')
|
||||
|
||||
// Destination address for the check
|
||||
const destination = "rP2BPdQ9ANSK7kVWT9jkjjDxCxL7xrC7oD";
|
||||
// Amount of XRP in drops to send
|
||||
const amount = "10000000";
|
||||
|
||||
const main = async () => {
|
||||
async function main() {
|
||||
try {
|
||||
// Connect to the XRP Ledger Test Net -------------------------------------
|
||||
console.log("Connecting to Test Net...");
|
||||
const client = new xrpl.Client('wss://s.altnet.rippletest.net:51233');
|
||||
await client.connect();
|
||||
console.log("Connected to Test Net");
|
||||
console.log("Connecting to Testnet...")
|
||||
const client = new xrpl.Client('wss://s.altnet.rippletest.net:51233')
|
||||
await client.connect()
|
||||
console.log("Connected.")
|
||||
|
||||
// Generating new wallet --------------------------------------------------
|
||||
console.log("Generating new wallet...");
|
||||
const { wallet } = await client.fundWallet();
|
||||
console.log("Wallet Address:", wallet.address);
|
||||
console.log("Wallet Seed:", wallet.seed);
|
||||
// Get a new wallet ---------------------------------------------------
|
||||
console.log("Generating new wallet...")
|
||||
const wallet = (await client.fundWallet()).wallet
|
||||
console.log(" Address:", wallet.address)
|
||||
console.log(" Seed:", wallet.seed)
|
||||
|
||||
// Prepare the transaction ------------------------------------------------
|
||||
const request = {
|
||||
// Prepare the transaction --------------------------------------------
|
||||
const checkcreate = {
|
||||
"TransactionType": "CheckCreate",
|
||||
"Account": wallet.address,
|
||||
"Destination": destination,
|
||||
"SendMax": amount,
|
||||
"DestinationTag": 1,
|
||||
"Fee": "12"
|
||||
};
|
||||
|
||||
// Submit the transaction -------------------------------------------------
|
||||
console.log("Submitting transaction...");
|
||||
const tx = await client.submitAndWait(request, { wallet });
|
||||
|
||||
// Get the check ID and transaction result --------------------------------
|
||||
const checkID = tx.result.meta.AffectedNodes.reduce((prevOutput, node) => {
|
||||
if (node?.CreatedNode && node.CreatedNode?.LedgerEntryType == "Check") {
|
||||
return node.CreatedNode.LedgerIndex;
|
||||
} else {
|
||||
return prevOutput;
|
||||
"Destination": "rGPnRH1EBpHeTF2QG8DCAgM7z5pb75LAis",
|
||||
"SendMax": xrpl.xrpToDrops(120), // Can be more than you have
|
||||
"InvoiceID": "46060241FABCF692D4D934BA2A6C4427CD4279083E38C77CBE642243E43BE291"
|
||||
}
|
||||
}, null);
|
||||
|
||||
console.log(checkID ? `Check ID: ${checkID}` : "Unable to find the CheckID from parsing the metadata. Look for the LedgerIndex of the 'Check' object within 'meta'.");
|
||||
console.log(`Transaction: ${JSON.stringify(tx, null, "\t")}`);
|
||||
// Submit the transaction ---------------------------------------------
|
||||
console.log("Submitting transaction...")
|
||||
const tx = await client.submitAndWait(
|
||||
checkcreate,
|
||||
{ autofill: true,
|
||||
wallet: wallet }
|
||||
)
|
||||
|
||||
// Disconnect -------------------------------------------------------------
|
||||
await client.disconnect();
|
||||
// Get transaction result and Check ID---------------------------------
|
||||
console.log(`Transaction: ${JSON.stringify(tx, null, 2)}`)
|
||||
|
||||
if (tx.result.meta.TransactionResult === "tesSUCCESS") {
|
||||
let checkID = null
|
||||
for (const node of tx.result.meta.AffectedNodes) {
|
||||
if (node?.CreatedNode &&
|
||||
node.CreatedNode?.LedgerEntryType == "Check") {
|
||||
checkID = node.CreatedNode.LedgerIndex
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
if (checkID) {
|
||||
console.log(`Check ID: ${checkID}`)
|
||||
} else {
|
||||
console.log("Unable to find the CheckID from parsing the metadata. Look for the LedgerIndex of the 'Check' object within 'meta'.")
|
||||
}
|
||||
} else {
|
||||
console.log("Transaction failed with result code "+
|
||||
tx.result.meta.TransactionResult)
|
||||
}
|
||||
|
||||
// Disconnect ---------------------------------------------------------
|
||||
await client.disconnect()
|
||||
} catch (error) {
|
||||
console.error(`Error: ${error}`)
|
||||
}
|
||||
};
|
||||
main();
|
||||
}
|
||||
|
||||
main()
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
Connected
|
||||
Final transaction result: { type: 'checkCancel',
|
||||
address: 'rBXsgNkPcDN2runsvWmwxk3Lh97zdgo9za',
|
||||
sequence: 7,
|
||||
id: '54A7A917BE9AC13962251BCF1D09803C7BBE75882B8BFC987B5933A566A48215',
|
||||
specification:
|
||||
{ checkID: '2E0AD0740B79BE0AAE5EDD1D5FC79E3C5C221D23C6A7F771D85569B5B91195C2' },
|
||||
outcome:
|
||||
{ result: 'tesSUCCESS',
|
||||
timestamp: '2018-04-02T23:42:22.000Z',
|
||||
fee: '0.000012',
|
||||
balanceChanges: { rBXsgNkPcDN2runsvWmwxk3Lh97zdgo9za: [Array] },
|
||||
orderbookChanges: {},
|
||||
ledgerVersion: 8004870,
|
||||
indexInLedger: 3 } }
|
||||
Disconnected
|
||||
@@ -1,53 +0,0 @@
|
||||
Connected
|
||||
account_objects response: { account: 'rBXsgNkPcDN2runsvWmwxk3Lh97zdgo9za',
|
||||
account_objects:
|
||||
[ { Account: 'rBXsgNkPcDN2runsvWmwxk3Lh97zdgo9za',
|
||||
Destination: 'rGPnRH1EBpHeTF2QG8DCAgM7z5pb75LAis',
|
||||
DestinationNode: '0000000000000000',
|
||||
Flags: 0,
|
||||
LedgerEntryType: 'Check',
|
||||
OwnerNode: '0000000000000000',
|
||||
PreviousTxnID: '37D90463CDE0497DB12F18099296DA0E1E52334A785710B5F56BC9637F62429C',
|
||||
PreviousTxnLgrSeq: 8003261,
|
||||
SendMax: '999999000000',
|
||||
Sequence: 5,
|
||||
index: '2E0AD0740B79BE0AAE5EDD1D5FC79E3C5C221D23C6A7F771D85569B5B91195C2' },
|
||||
{ Account: 'rGPnRH1EBpHeTF2QG8DCAgM7z5pb75LAis',
|
||||
Destination: 'rBXsgNkPcDN2runsvWmwxk3Lh97zdgo9za',
|
||||
DestinationNode: '0000000000000000',
|
||||
Flags: 0,
|
||||
LedgerEntryType: 'Check',
|
||||
OwnerNode: '0000000000000000',
|
||||
PreviousTxnID: 'EF462F1D004E97850AECFB8EC4836DA57706FAFADF8E0914010853C1EC7F2055',
|
||||
PreviousTxnLgrSeq: 8003480,
|
||||
SendMax: [Object],
|
||||
Sequence: 2,
|
||||
index: '323CE1D169135513085268EF81ED40775725C97E7922DBABCCE48FE3FD138861' },
|
||||
{ Account: 'rBXsgNkPcDN2runsvWmwxk3Lh97zdgo9za',
|
||||
Destination: 'rGPnRH1EBpHeTF2QG8DCAgM7z5pb75LAis',
|
||||
DestinationNode: '0000000000000000',
|
||||
DestinationTag: 1,
|
||||
Flags: 0,
|
||||
InvoiceID: '46060241FABCF692D4D934BA2A6C4427CD4279083E38C77CBE642243E43BE291',
|
||||
LedgerEntryType: 'Check',
|
||||
OwnerNode: '0000000000000000',
|
||||
PreviousTxnID: '09D992D4C89E2A24D4BA9BB57ED81C7003815940F39B7C87ADBF2E49034380BB',
|
||||
PreviousTxnLgrSeq: 7841263,
|
||||
SendMax: '100000000',
|
||||
Sequence: 4,
|
||||
index: '84C61BE9B39B2C4A2267F67504404F1EC76678806C1B901EA781D1E3B4CE0CD9' },
|
||||
{ Account: 'rBXsgNkPcDN2runsvWmwxk3Lh97zdgo9za',
|
||||
Destination: 'rGPnRH1EBpHeTF2QG8DCAgM7z5pb75LAis',
|
||||
DestinationNode: '0000000000000000',
|
||||
Flags: 0,
|
||||
LedgerEntryType: 'Check',
|
||||
OwnerNode: '0000000000000000',
|
||||
PreviousTxnID: 'C0B27D20669BAB837B3CDF4B8148B988F17CE1EF8EDF48C806AE9BF69E16F441',
|
||||
PreviousTxnLgrSeq: 7835887,
|
||||
SendMax: '100000000',
|
||||
Sequence: 2,
|
||||
index: 'CEA5F0BD7B2B5C85A70AE735E4CE722C43C86410A79AB87C11938AA13A11DBF9' } ],
|
||||
ledger_hash: 'DD577D96A1064E16A5DB64C3C25BFF5EF0D8E36A18E4540B162731FA6320C46D',
|
||||
ledger_index: 8004101,
|
||||
validated: true }
|
||||
Disconnected
|
||||
@@ -1,55 +1,57 @@
|
||||
'use strict'
|
||||
const xrpl = require('xrpl');
|
||||
const xrpl = require('xrpl')
|
||||
|
||||
const address = "rEYyvXCwv1WJ6a8hW4sBx5afXbJTK97bbR"; // <-- Change this to your account
|
||||
|
||||
const main = async () => {
|
||||
async function main() {
|
||||
try {
|
||||
// Connect ----------------------------------------------------------------
|
||||
const client = new xrpl.Client('wss://s.altnet.rippletest.net:51233');
|
||||
await client.connect();
|
||||
const client = new xrpl.Client('wss://s.altnet.rippletest.net:51233')
|
||||
await client.connect()
|
||||
|
||||
let currMarker = null;
|
||||
let account_objects = [];
|
||||
|
||||
// Loop through all account objects until marker is undefined --------------
|
||||
// Loop through account objects until marker is undefined -----------------
|
||||
let current_marker = null
|
||||
let checks_found = []
|
||||
do {
|
||||
const payload = {
|
||||
const request = {
|
||||
"command": "account_objects",
|
||||
"account": address,
|
||||
"account": "rGPnRH1EBpHeTF2QG8DCAgM7z5pb75LAis",
|
||||
"ledger_index": "validated",
|
||||
"type": "check",
|
||||
};
|
||||
|
||||
if(currMarker !== null) {
|
||||
payload.marker = currMarker;
|
||||
};
|
||||
|
||||
let { result: { account_objects : checks, marker } } = await client.request(payload);
|
||||
|
||||
if (marker === currMarker) {
|
||||
break;
|
||||
"type": "check"
|
||||
}
|
||||
|
||||
account_objects.push(...checks);
|
||||
currMarker = marker;
|
||||
if (current_marker) {
|
||||
request.marker = current_marker
|
||||
}
|
||||
|
||||
} while (typeof currMarker !== "undefined")
|
||||
const response = await client.request(request)
|
||||
|
||||
checks_found = checks_found.concat(response.result.account_objects)
|
||||
current_marker = response.result.marker
|
||||
|
||||
} while (current_marker)
|
||||
|
||||
// Filter results by recipient --------------------------------------------
|
||||
// To filter by sender, check Account field instead of Destination
|
||||
const checks_by_recipient = []
|
||||
for (const check of checks_found) {
|
||||
if (check.Destination == "rGPnRH1EBpHeTF2QG8DCAgM7z5pb75LAis") {
|
||||
checks_by_recipient.push(check)
|
||||
}
|
||||
}
|
||||
|
||||
// Print results ----------------------------------------------------------
|
||||
if (account_objects.length === 0) {
|
||||
console.log("No checks found.");
|
||||
if (checks_by_recipient.length === 0) {
|
||||
console.log("No checks found.")
|
||||
} else {
|
||||
console.log("Checks: \n", JSON.stringify(account_objects, null, "\t"));
|
||||
};
|
||||
console.log("Checks: \n", JSON.stringify(checks_by_recipient, null, 2))
|
||||
}
|
||||
|
||||
// Disconnect -------------------------------------------------------------
|
||||
await client.disconnect();
|
||||
await client.disconnect()
|
||||
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
process.exit(0);
|
||||
console.log(error)
|
||||
process.exit(1)
|
||||
}
|
||||
}
|
||||
|
||||
main();
|
||||
main()
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
Connected
|
||||
Final transaction result: { type: 'checkCreate',
|
||||
address: 'rBXsgNkPcDN2runsvWmwxk3Lh97zdgo9za',
|
||||
sequence: 2,
|
||||
id: 'C0B27D20669BAB837B3CDF4B8148B988F17CE1EF8EDF48C806AE9BF69E16F441',
|
||||
specification:
|
||||
{ destination: 'rGPnRH1EBpHeTF2QG8DCAgM7z5pb75LAis',
|
||||
sendMax: { currency: 'XRP', value: '100' } },
|
||||
outcome:
|
||||
{ result: 'tesSUCCESS',
|
||||
timestamp: '2018-03-27T20:47:40.000Z',
|
||||
fee: '0.000012',
|
||||
balanceChanges: { rBXsgNkPcDN2runsvWmwxk3Lh97zdgo9za: [Array] },
|
||||
orderbookChanges: {},
|
||||
ledgerVersion: 7835887,
|
||||
indexInLedger: 0 } }
|
||||
Calculated checkID: CEA5F0BD7B2B5C85A70AE735E4CE722C43C86410A79AB87C11938AA13A11DBF9
|
||||
Disconnected
|
||||
@@ -1,21 +0,0 @@
|
||||
'use strict'
|
||||
const RippleAPI = require('ripple-lib').RippleAPI
|
||||
|
||||
// This example connects to a public Test Net server
|
||||
const api = new RippleAPI({server: 'wss://s.altnet.rippletest.net:51233'})
|
||||
api.connect().then(() => {
|
||||
console.log('Connected')
|
||||
|
||||
const tx_hash = "54A7A917BE9AC13962251BCF1D09803C7BBE75882B8BFC987B5933A566A48215"
|
||||
|
||||
return api.getTransaction(tx_hash)
|
||||
}).then(response => {
|
||||
console.log("Final transaction result:", response)
|
||||
|
||||
// Disconnect and return
|
||||
}).then(() => {
|
||||
api.disconnect().then(() => {
|
||||
console.log('Disconnected')
|
||||
process.exit()
|
||||
})
|
||||
}).catch(console.error)
|
||||
@@ -1,26 +0,0 @@
|
||||
'use strict'
|
||||
const RippleAPI = require('ripple-lib').RippleAPI
|
||||
|
||||
// This example connects to a public Test Net server
|
||||
const api = new RippleAPI({server: 'wss://s.altnet.rippletest.net:51233'})
|
||||
api.connect().then(() => {
|
||||
console.log('Connected')
|
||||
|
||||
const account_objects_request = {
|
||||
command: "account_objects",
|
||||
account: "rBXsgNkPcDN2runsvWmwxk3Lh97zdgo9za",
|
||||
ledger_index: "validated",
|
||||
type: "check"
|
||||
}
|
||||
|
||||
return api.connection.request(account_objects_request)
|
||||
}).then(response => {
|
||||
console.log("account_objects response:", response)
|
||||
|
||||
// Disconnect and return
|
||||
}).then(() => {
|
||||
api.disconnect().then(() => {
|
||||
console.log('Disconnected')
|
||||
process.exit()
|
||||
})
|
||||
}).catch(console.error)
|
||||
@@ -1,33 +0,0 @@
|
||||
'use strict'
|
||||
const RippleAPI = require('ripple-lib').RippleAPI
|
||||
const decodeAddress = require('ripple-address-codec').decodeAddress;
|
||||
const createHash = require('crypto').createHash;
|
||||
|
||||
// This example connects to a public Test Net server
|
||||
const api = new RippleAPI({server: 'wss://s.altnet.rippletest.net:51233'})
|
||||
api.connect().then(() => {
|
||||
console.log('Connected')
|
||||
|
||||
const tx_hash = "C0B27D20669BAB837B3CDF4B8148B988F17CE1EF8EDF48C806AE9BF69E16F441"
|
||||
|
||||
return api.getTransaction(tx_hash)
|
||||
}).then(response => {
|
||||
console.log("Final transaction result:", response)
|
||||
|
||||
// Re-calculate checkID to work around issue ripple-lib#876
|
||||
const checkIDhasher = createHash('sha512')
|
||||
checkIDhasher.update(Buffer.from('0043', 'hex'))
|
||||
checkIDhasher.update(new Buffer(decodeAddress(response.address)))
|
||||
const seqBuf = Buffer.alloc(4)
|
||||
seqBuf.writeUInt32BE(response.sequence, 0)
|
||||
checkIDhasher.update(seqBuf)
|
||||
const checkID = checkIDhasher.digest('hex').slice(0,64).toUpperCase()
|
||||
console.log("Calculated checkID:", checkID)
|
||||
|
||||
// Disconnect and return
|
||||
}).then(() => {
|
||||
api.disconnect().then(() => {
|
||||
console.log('Disconnected')
|
||||
process.exit()
|
||||
})
|
||||
}).catch(console.error)
|
||||
@@ -1,10 +1,9 @@
|
||||
{
|
||||
"name": "checks-examples",
|
||||
"description": "Example code for signing and submitting Checks with RippleAPI",
|
||||
"version": "0.0.1",
|
||||
"description": "Example code for signing and submitting Checks",
|
||||
"version": "0.0.2",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"ripple-lib": "^1.0.0-beta.1",
|
||||
"xrpl": "^3.0.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,41 +0,0 @@
|
||||
'use strict'
|
||||
const RippleAPI = require('ripple-lib').RippleAPI
|
||||
|
||||
// This example connects to a public Test Net server
|
||||
const api = new RippleAPI({server: 'wss://s.altnet.rippletest.net:51233'})
|
||||
api.connect().then(() => {
|
||||
console.log('Connected')
|
||||
|
||||
const sender = 'rBXsgNkPcDN2runsvWmwxk3Lh97zdgo9za'
|
||||
const options = {
|
||||
// Allow up to 60 ledger versions (~5 min) instead of the default 3 versions
|
||||
// before this transaction fails permanently.
|
||||
"maxLedgerVersionOffset": 60
|
||||
}
|
||||
return api.prepareCheckCancel(sender, {
|
||||
"checkID": "2E0AD0740B79BE0AAE5EDD1D5FC79E3C5C221D23C6A7F771D85569B5B91195C2"
|
||||
}, options)
|
||||
|
||||
}).then(prepared => {
|
||||
console.log("txJSON:", prepared.txJSON);
|
||||
|
||||
// Disconnect and return
|
||||
}).then(() => {
|
||||
api.disconnect().then(() => {
|
||||
console.log('Disconnected')
|
||||
process.exit()
|
||||
})
|
||||
}).catch(console.error)
|
||||
|
||||
|
||||
// Example output:
|
||||
//
|
||||
// Connected
|
||||
// txJSON: {"Account":"rBXsgNkPcDN2runsvWmwxk3Lh97zdgo9za",
|
||||
// "TransactionType":"CheckCancel",
|
||||
// "CheckID":"2E0AD0740B79BE0AAE5EDD1D5FC79E3C5C221D23C6A7F771D85569B5B91195C2",
|
||||
// "Flags":2147483648,
|
||||
// "LastLedgerSequence":8004884,
|
||||
// "Fee":"12",
|
||||
// "Sequence":7}
|
||||
// Disconnected
|
||||
@@ -1,46 +0,0 @@
|
||||
'use strict'
|
||||
const RippleAPI = require('ripple-lib').RippleAPI
|
||||
|
||||
// This example connects to a public Test Net server
|
||||
const api = new RippleAPI({server: 'wss://s.altnet.rippletest.net:51233'})
|
||||
api.connect().then(() => {
|
||||
console.log('Connected')
|
||||
|
||||
const sender = 'rGPnRH1EBpHeTF2QG8DCAgM7z5pb75LAis'
|
||||
const options = {
|
||||
// Allow up to 60 ledger versions (~5 min) instead of the default 3 versions
|
||||
// before this transaction fails permanently.
|
||||
"maxLedgerVersionOffset": 60
|
||||
}
|
||||
return api.prepareCheckCash(sender, {
|
||||
"checkID": "84C61BE9B39B2C4A2267F67504404F1EC76678806C1B901EA781D1E3B4CE0CD9",
|
||||
"amount": {
|
||||
"currency": "XRP",
|
||||
"value": "95" // Cash for exactly 95 XRP
|
||||
}
|
||||
}, options)
|
||||
|
||||
}).then(prepared => {
|
||||
console.log("txJSON:", prepared.txJSON);
|
||||
|
||||
// Disconnect and return
|
||||
}).then(() => {
|
||||
api.disconnect().then(() => {
|
||||
console.log('Disconnected')
|
||||
process.exit()
|
||||
})
|
||||
}).catch(console.error)
|
||||
|
||||
|
||||
// Example output:
|
||||
//
|
||||
// Connected
|
||||
// txJSON: {"Account":"rGPnRH1EBpHeTF2QG8DCAgM7z5pb75LAis",
|
||||
// "TransactionType":"CheckCash",
|
||||
// "CheckID":"84C61BE9B39B2C4A2267F67504404F1EC76678806C1B901EA781D1E3B4CE0CD9",
|
||||
// "Amount":"95000000",
|
||||
// "Flags":2147483648,
|
||||
// "LastLedgerSequence":8006841,
|
||||
// "Fee":"12",
|
||||
// "Sequence":5}
|
||||
// Disconnected
|
||||
@@ -1,46 +0,0 @@
|
||||
'use strict'
|
||||
const RippleAPI = require('ripple-lib').RippleAPI
|
||||
|
||||
// This example connects to a public Test Net server
|
||||
const api = new RippleAPI({server: 'wss://s.altnet.rippletest.net:51233'})
|
||||
api.connect().then(() => {
|
||||
console.log('Connected')
|
||||
|
||||
const sender = 'rGPnRH1EBpHeTF2QG8DCAgM7z5pb75LAis'
|
||||
const options = {
|
||||
// Allow up to 60 ledger versions (~5 min) instead of the default 3 versions
|
||||
// before this transaction fails permanently.
|
||||
"maxLedgerVersionOffset": 60
|
||||
}
|
||||
return api.prepareCheckCash(sender, {
|
||||
"checkID": "C0B27D20669BAB837B3CDF4B8148B988F17CE1EF8EDF48C806AE9BF69E16F441",
|
||||
"deliverMin": {
|
||||
"currency": "XRP",
|
||||
"value": "95" // Cash for at least 95 XRP
|
||||
}
|
||||
}, options)
|
||||
|
||||
}).then(prepared => {
|
||||
console.log("txJSON:", prepared.txJSON);
|
||||
|
||||
// Disconnect and return
|
||||
}).then(() => {
|
||||
api.disconnect().then(() => {
|
||||
console.log('Disconnected')
|
||||
process.exit()
|
||||
})
|
||||
}).catch(console.error)
|
||||
|
||||
|
||||
// Example output:
|
||||
//
|
||||
// Connected
|
||||
// txJSON: {"Account":"rGPnRH1EBpHeTF2QG8DCAgM7z5pb75LAis",
|
||||
// "TransactionType":"CheckCash",
|
||||
// "CheckID":"C0B27D20669BAB837B3CDF4B8148B988F17CE1EF8EDF48C806AE9BF69E16F441",
|
||||
// "DeliverMin":"95000000",
|
||||
// "Flags":2147483648,
|
||||
// "LastLedgerSequence":8006858,
|
||||
// "Fee":"12",
|
||||
// "Sequence":5}
|
||||
// Disconnected
|
||||
@@ -1,47 +0,0 @@
|
||||
'use strict'
|
||||
const RippleAPI = require('ripple-lib').RippleAPI
|
||||
|
||||
// This example connects to a public Test Net server
|
||||
const api = new RippleAPI({server: 'wss://s.altnet.rippletest.net:51233'})
|
||||
api.connect().then(() => {
|
||||
console.log('Connected')
|
||||
|
||||
const sender = 'rBXsgNkPcDN2runsvWmwxk3Lh97zdgo9za'
|
||||
const receiver = 'rGPnRH1EBpHeTF2QG8DCAgM7z5pb75LAis'
|
||||
const options = {
|
||||
// Allow up to 60 ledger versions (~5 min) instead of the default 3 versions
|
||||
// before this transaction fails permanently.
|
||||
"maxLedgerVersionOffset": 60
|
||||
}
|
||||
return api.prepareCheckCreate(sender, {
|
||||
"destination": receiver,
|
||||
"sendMax": {
|
||||
"currency": "XRP",
|
||||
"value": "100" // RippleAPI uses decimal XRP, not integer drops
|
||||
},
|
||||
"invoiceID": "46060241FABCF692D4D934BA2A6C4427CD4279083E38C77CBE642243E43BE291"
|
||||
}, options)
|
||||
|
||||
}).then(prepared => {
|
||||
console.log("txJSON:", prepared.txJSON);
|
||||
|
||||
// Disconnect and return
|
||||
}).then(() => {
|
||||
api.disconnect().then(() => {
|
||||
console.log('Disconnected')
|
||||
process.exit()
|
||||
})
|
||||
}).catch(console.error)
|
||||
|
||||
|
||||
// Example output:
|
||||
//
|
||||
// Connected
|
||||
// txJSON: {"Account":"rBXsgNkPcDN2runsvWmwxk3Lh97zdgo9za",
|
||||
// "TransactionType":"CheckCreate",
|
||||
// "Destination":"rGPnRH1EBpHeTF2QG8DCAgM7z5pb75LAis",
|
||||
// "SendMax":"100000000",
|
||||
// "Flags":2147483648,
|
||||
// "InvoiceID": "46060241FABCF692D4D934BA2A6C4427CD4279083E38C77CBE642243E43BE291",
|
||||
// "LastLedgerSequence":7835917,"Fee":"12","Sequence":2}
|
||||
// Disconnected
|
||||
@@ -1,2 +0,0 @@
|
||||
tx_blob is: 12001222800000002400000007201B007A251450182E0AD0740B79BE0AAE5EDD1D5FC79E3C5C221D23C6A7F771D85569B5B91195C268400000000000000C732103B6FCD7FAC4F665FE92415DD6E8450AD90F7D6B3D45A6CFCF2E359045FF4BB4007446304402205D77451B0D7BCDA1FE5B98763C5B3B2837453371FE93C2B86157C44B1867AE36022003800273848BC2F8E1C6EC7EE4B0CB2425A888AE80E586886C306C796B25678B8114735FF88E5269C80CD7F7AF10530DAB840BBF6FDF
|
||||
tx hash is: 54A7A917BE9AC13962251BCF1D09803C7BBE75882B8BFC987B5933A566A48215
|
||||
@@ -1,2 +0,0 @@
|
||||
tx_blob is: 12001022800000002400000002201B0077911368400000000000000C694000000005F5E100732103B6FCD7FAC4F665FE92415DD6E8450AD90F7D6B3D45A6CFCF2E359045FF4BB400744630440220181FE2F945EBEE632966D5FB03114611E3047ACD155AA1BDB9DF8545C7A2431502201E873A4B0D177AB250AF790CE80621E16F141506CF507586038FC4A8E95887358114735FF88E5269C80CD7F7AF10530DAB840BBF6FDF8314A8B6B9FF3246856CADC4A0106198C066EA1F9C39
|
||||
tx hash is: C0B27D20669BAB837B3CDF4B8148B988F17CE1EF8EDF48C806AE9BF69E16F441
|
||||
@@ -1,15 +0,0 @@
|
||||
'use strict'
|
||||
const RippleAPI = require('ripple-lib').RippleAPI
|
||||
|
||||
// Can sign offline if the txJSON has all required fields
|
||||
const api = new RippleAPI()
|
||||
|
||||
const txJSON = '{"Account":"rBXsgNkPcDN2runsvWmwxk3Lh97zdgo9za","TransactionType":"CheckCancel","CheckID":"2E0AD0740B79BE0AAE5EDD1D5FC79E3C5C221D23C6A7F771D85569B5B91195C2","Flags":2147483648,"LastLedgerSequence":8004884,"Fee":"12","Sequence":7}'
|
||||
|
||||
// Be careful where you store your real secret.
|
||||
const secret = 's████████████████████████████'
|
||||
|
||||
const signed = api.sign(txJSON, secret)
|
||||
|
||||
console.log("tx_blob is:", signed.signedTransaction)
|
||||
console.log("tx hash is:", signed.id)
|
||||
@@ -1,22 +0,0 @@
|
||||
'use strict'
|
||||
const RippleAPI = require('ripple-lib').RippleAPI
|
||||
|
||||
// Can sign offline if the txJSON has all required fields
|
||||
const api = new RippleAPI()
|
||||
|
||||
const txJSON = '{"Account":"rBXsgNkPcDN2runsvWmwxk3Lh97zdgo9za", \
|
||||
"TransactionType":"CheckCreate", \
|
||||
"Destination":"rGPnRH1EBpHeTF2QG8DCAgM7z5pb75LAis", \
|
||||
"SendMax":"100000000", \
|
||||
"Flags":2147483648, \
|
||||
"LastLedgerSequence":7835923, \
|
||||
"Fee":"12", \
|
||||
"Sequence":2}'
|
||||
|
||||
// Be careful where you store your real secret.
|
||||
const secret = 's████████████████████████████'
|
||||
|
||||
const signed = api.sign(txJSON, secret)
|
||||
|
||||
console.log("tx_blob is:", signed.signedTransaction)
|
||||
console.log("tx hash is:", signed.id)
|
||||
@@ -1,3 +0,0 @@
|
||||
Connected
|
||||
Preliminary transaction result: tesSUCCESS
|
||||
Disconnected
|
||||
@@ -1,3 +0,0 @@
|
||||
Connected
|
||||
Preliminary transaction result: tesSUCCESS
|
||||
Disconnected
|
||||
@@ -1,21 +0,0 @@
|
||||
'use strict'
|
||||
const RippleAPI = require('ripple-lib').RippleAPI
|
||||
|
||||
// This example connects to a public Test Net server
|
||||
const api = new RippleAPI({server: 'wss://s.altnet.rippletest.net:51233'})
|
||||
api.connect().then(() => {
|
||||
console.log('Connected')
|
||||
|
||||
const tx_blob = "12001222800000002400000007201B007A251450182E0AD0740B79BE0AAE5EDD1D5FC79E3C5C221D23C6A7F771D85569B5B91195C268400000000000000C732103B6FCD7FAC4F665FE92415DD6E8450AD90F7D6B3D45A6CFCF2E359045FF4BB4007446304402205D77451B0D7BCDA1FE5B98763C5B3B2837453371FE93C2B86157C44B1867AE36022003800273848BC2F8E1C6EC7EE4B0CB2425A888AE80E586886C306C796B25678B8114735FF88E5269C80CD7F7AF10530DAB840BBF6FDF"
|
||||
|
||||
return api.submit(tx_blob)
|
||||
}).then(response => {
|
||||
console.log("Preliminary transaction result:", response.resultCode)
|
||||
|
||||
// Disconnect and return
|
||||
}).then(() => {
|
||||
api.disconnect().then(() => {
|
||||
console.log('Disconnected')
|
||||
process.exit()
|
||||
})
|
||||
}).catch(console.error)
|
||||
@@ -1,26 +0,0 @@
|
||||
'use strict'
|
||||
const RippleAPI = require('ripple-lib').RippleAPI
|
||||
|
||||
// This example connects to a public Test Net server
|
||||
const api = new RippleAPI({server: 'wss://s.altnet.rippletest.net:51233'})
|
||||
api.connect().then(() => {
|
||||
console.log('Connected')
|
||||
|
||||
const tx_blob = "12001022800000002400000002201B0077911368400000000000000"+
|
||||
"C694000000005F5E100732103B6FCD7FAC4F665FE92415DD6E8450AD90F7D6B3D45A6"+
|
||||
"CFCF2E359045FF4BB400744630440220181FE2F945EBEE632966D5FB03114611E3047"+
|
||||
"ACD155AA1BDB9DF8545C7A2431502201E873A4B0D177AB250AF790CE80621E16F1415"+
|
||||
"06CF507586038FC4A8E95887358114735FF88E5269C80CD7F7AF10530DAB840BBF6FD"+
|
||||
"F8314A8B6B9FF3246856CADC4A0106198C066EA1F9C39"
|
||||
|
||||
return api.submit(tx_blob)
|
||||
}).then(response => {
|
||||
console.log("Preliminary transaction result:", response.resultCode)
|
||||
|
||||
// Disconnect and return
|
||||
}).then(() => {
|
||||
api.disconnect().then(() => {
|
||||
console.log('Disconnected')
|
||||
process.exit()
|
||||
})
|
||||
}).catch(console.error)
|
||||
@@ -1,10 +0,0 @@
|
||||
{
|
||||
"method": "account_objects",
|
||||
"params": [
|
||||
{
|
||||
"account": "rBXsgNkPcDN2runsvWmwxk3Lh97zdgo9za",
|
||||
"ledger_index": "validated",
|
||||
"type": "check"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,69 +0,0 @@
|
||||
{
|
||||
"result": {
|
||||
"account": "rBXsgNkPcDN2runsvWmwxk3Lh97zdgo9za",
|
||||
"account_objects": [
|
||||
{
|
||||
"Account": "rBXsgNkPcDN2runsvWmwxk3Lh97zdgo9za",
|
||||
"Destination": "rGPnRH1EBpHeTF2QG8DCAgM7z5pb75LAis",
|
||||
"DestinationNode": "0000000000000000",
|
||||
"Flags": 0,
|
||||
"LedgerEntryType": "Check",
|
||||
"OwnerNode": "0000000000000000",
|
||||
"PreviousTxnID": "37D90463CDE0497DB12F18099296DA0E1E52334A785710B5F56BC9637F62429C",
|
||||
"PreviousTxnLgrSeq": 8003261,
|
||||
"SendMax": "999999000000",
|
||||
"Sequence": 5,
|
||||
"index": "2E0AD0740B79BE0AAE5EDD1D5FC79E3C5C221D23C6A7F771D85569B5B91195C2"
|
||||
},
|
||||
{
|
||||
"Account": "rGPnRH1EBpHeTF2QG8DCAgM7z5pb75LAis",
|
||||
"Destination": "rBXsgNkPcDN2runsvWmwxk3Lh97zdgo9za",
|
||||
"DestinationNode": "0000000000000000",
|
||||
"Flags": 0,
|
||||
"LedgerEntryType": "Check",
|
||||
"OwnerNode": "0000000000000000",
|
||||
"PreviousTxnID": "EF462F1D004E97850AECFB8EC4836DA57706FAFADF8E0914010853C1EC7F2055",
|
||||
"PreviousTxnLgrSeq": 8003480,
|
||||
"SendMax": {
|
||||
"currency": "BAR",
|
||||
"issuer": "rBXsgNkPcDN2runsvWmwxk3Lh97zdgo9za",
|
||||
"value": "1000000000000000e-66"
|
||||
},
|
||||
"Sequence": 2,
|
||||
"index": "323CE1D169135513085268EF81ED40775725C97E7922DBABCCE48FE3FD138861"
|
||||
},
|
||||
{
|
||||
"Account": "rBXsgNkPcDN2runsvWmwxk3Lh97zdgo9za",
|
||||
"Destination": "rGPnRH1EBpHeTF2QG8DCAgM7z5pb75LAis",
|
||||
"DestinationNode": "0000000000000000",
|
||||
"DestinationTag": 1,
|
||||
"Flags": 0,
|
||||
"InvoiceID": "46060241FABCF692D4D934BA2A6C4427CD4279083E38C77CBE642243E43BE291",
|
||||
"LedgerEntryType": "Check",
|
||||
"OwnerNode": "0000000000000000",
|
||||
"PreviousTxnID": "09D992D4C89E2A24D4BA9BB57ED81C7003815940F39B7C87ADBF2E49034380BB",
|
||||
"PreviousTxnLgrSeq": 7841263,
|
||||
"SendMax": "100000000",
|
||||
"Sequence": 4,
|
||||
"index": "84C61BE9B39B2C4A2267F67504404F1EC76678806C1B901EA781D1E3B4CE0CD9"
|
||||
},
|
||||
{
|
||||
"Account": "rBXsgNkPcDN2runsvWmwxk3Lh97zdgo9za",
|
||||
"Destination": "rGPnRH1EBpHeTF2QG8DCAgM7z5pb75LAis",
|
||||
"DestinationNode": "0000000000000000",
|
||||
"Flags": 0,
|
||||
"LedgerEntryType": "Check",
|
||||
"OwnerNode": "0000000000000000",
|
||||
"PreviousTxnID": "C0B27D20669BAB837B3CDF4B8148B988F17CE1EF8EDF48C806AE9BF69E16F441",
|
||||
"PreviousTxnLgrSeq": 7835887,
|
||||
"SendMax": "100000000",
|
||||
"Sequence": 2,
|
||||
"index": "CEA5F0BD7B2B5C85A70AE735E4CE722C43C86410A79AB87C11938AA13A11DBF9"
|
||||
}
|
||||
],
|
||||
"ledger_hash": "4002E4E84CABAAF1BDD5636097F3042547EBAE2DEE647E1036E64AA9FDA2A10C",
|
||||
"ledger_index": 8004173,
|
||||
"status": "success",
|
||||
"validated": true
|
||||
}
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
{
|
||||
"id": "sign_req_1",
|
||||
"command": "sign",
|
||||
"tx_json": {
|
||||
"TransactionType": "CheckCreate",
|
||||
"Account": "rBXsgNkPcDN2runsvWmwxk3Lh97zdgo9za",
|
||||
"Destination": "rGPnRH1EBpHeTF2QG8DCAgM7z5pb75LAis",
|
||||
"SendMax": "100000000",
|
||||
"InvoiceID": "46060241FABCF692D4D934BA2A6C4427CD4279083E38C77CBE642243E43BE291",
|
||||
"DestinationTag": 1,
|
||||
"Fee": "12"
|
||||
},
|
||||
"secret" : "s████████████████████████████"
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
{
|
||||
"id": "sign_req_1",
|
||||
"result": {
|
||||
"tx_blob": "120010228000000024000000042E00000001501146060241FABCF692D4D934BA2A6C4427CD4279083E38C77CBE642243E43BE29168400000000000000C694000000005F5E100732103B6FCD7FAC4F665FE92415DD6E8450AD90F7D6B3D45A6CFCF2E359045FF4BB40074463044022071A341F911A8EF3B68399487CAF5BA3B59C6FE476B626698AEF044B8183721BC0220166053A859BD907251DFCCF34DD71202180EBABAE7098BB5903D16EBFC993C408114735FF88E5269C80CD7F7AF10530DAB840BBF6FDF8314A8B6B9FF3246856CADC4A0106198C066EA1F9C39",
|
||||
"tx_json": {
|
||||
"Account": "rBXsgNkPcDN2runsvWmwxk3Lh97zdgo9za",
|
||||
"Destination": "rGPnRH1EBpHeTF2QG8DCAgM7z5pb75LAis",
|
||||
"DestinationTag": 1,
|
||||
"Fee": "12",
|
||||
"Flags": 2147483648,
|
||||
"InvoiceID": "46060241FABCF692D4D934BA2A6C4427CD4279083E38C77CBE642243E43BE291",
|
||||
"SendMax": "100000000",
|
||||
"Sequence": 4,
|
||||
"SigningPubKey": "03B6FCD7FAC4F665FE92415DD6E8450AD90F7D6B3D45A6CFCF2E359045FF4BB400",
|
||||
"TransactionType": "CheckCreate",
|
||||
"TxnSignature": "3044022071A341F911A8EF3B68399487CAF5BA3B59C6FE476B626698AEF044B8183721BC0220166053A859BD907251DFCCF34DD71202180EBABAE7098BB5903D16EBFC993C40",
|
||||
"hash": "09D992D4C89E2A24D4BA9BB57ED81C7003815940F39B7C87ADBF2E49034380BB"
|
||||
}
|
||||
},
|
||||
"status": "success",
|
||||
"type": "response"
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
{
|
||||
"id": "submit_req_1",
|
||||
"command": "submit",
|
||||
"tx_blob": "120010228000000024000000042E00000001501146060241FABCF692D4D934BA2A6C4427CD4279083E38C77CBE642243E43BE29168400000000000000C694000000005F5E100732103B6FCD7FAC4F665FE92415DD6E8450AD90F7D6B3D45A6CFCF2E359045FF4BB40074463044022071A341F911A8EF3B68399487CAF5BA3B59C6FE476B626698AEF044B8183721BC0220166053A859BD907251DFCCF34DD71202180EBABAE7098BB5903D16EBFC993C408114735FF88E5269C80CD7F7AF10530DAB840BBF6FDF8314A8B6B9FF3246856CADC4A0106198C066EA1F9C39"
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
{
|
||||
"id": "submit_req_1",
|
||||
"result": {
|
||||
"engine_result": "terQUEUED",
|
||||
"engine_result_code": -89,
|
||||
"engine_result_message": "Held until escalated fee drops.",
|
||||
"tx_blob": "120010228000000024000000042E00000001501146060241FABCF692D4D934BA2A6C4427CD4279083E38C77CBE642243E43BE29168400000000000000C694000000005F5E100732103B6FCD7FAC4F665FE92415DD6E8450AD90F7D6B3D45A6CFCF2E359045FF4BB40074463044022071A341F911A8EF3B68399487CAF5BA3B59C6FE476B626698AEF044B8183721BC0220166053A859BD907251DFCCF34DD71202180EBABAE7098BB5903D16EBFC993C408114735FF88E5269C80CD7F7AF10530DAB840BBF6FDF8314A8B6B9FF3246856CADC4A0106198C066EA1F9C39",
|
||||
"tx_json": {
|
||||
"Account": "rBXsgNkPcDN2runsvWmwxk3Lh97zdgo9za",
|
||||
"Destination": "rGPnRH1EBpHeTF2QG8DCAgM7z5pb75LAis",
|
||||
"DestinationTag": 1,
|
||||
"Fee": "12",
|
||||
"Flags": 2147483648,
|
||||
"InvoiceID": "46060241FABCF692D4D934BA2A6C4427CD4279083E38C77CBE642243E43BE291",
|
||||
"SendMax": "100000000",
|
||||
"Sequence": 4,
|
||||
"SigningPubKey": "03B6FCD7FAC4F665FE92415DD6E8450AD90F7D6B3D45A6CFCF2E359045FF4BB400",
|
||||
"TransactionType": "CheckCreate",
|
||||
"TxnSignature": "3044022071A341F911A8EF3B68399487CAF5BA3B59C6FE476B626698AEF044B8183721BC0220166053A859BD907251DFCCF34DD71202180EBABAE7098BB5903D16EBFC993C40",
|
||||
"hash": "09D992D4C89E2A24D4BA9BB57ED81C7003815940F39B7C87ADBF2E49034380BB"
|
||||
}
|
||||
},
|
||||
"status": "success",
|
||||
"type": "response"
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
{
|
||||
"id": "tx_req_1",
|
||||
"command": "tx",
|
||||
"transaction": "09D992D4C89E2A24D4BA9BB57ED81C7003815940F39B7C87ADBF2E49034380BB"
|
||||
}
|
||||
@@ -1,85 +0,0 @@
|
||||
{
|
||||
"id": "tx_req_1",
|
||||
"result": {
|
||||
"Account": "rBXsgNkPcDN2runsvWmwxk3Lh97zdgo9za",
|
||||
"Destination": "rGPnRH1EBpHeTF2QG8DCAgM7z5pb75LAis",
|
||||
"DestinationTag": 1,
|
||||
"Fee": "12",
|
||||
"Flags": 2147483648,
|
||||
"InvoiceID": "46060241FABCF692D4D934BA2A6C4427CD4279083E38C77CBE642243E43BE291",
|
||||
"SendMax": "100000000",
|
||||
"Sequence": 4,
|
||||
"SigningPubKey": "03B6FCD7FAC4F665FE92415DD6E8450AD90F7D6B3D45A6CFCF2E359045FF4BB400",
|
||||
"TransactionType": "CheckCreate",
|
||||
"TxnSignature": "3044022071A341F911A8EF3B68399487CAF5BA3B59C6FE476B626698AEF044B8183721BC0220166053A859BD907251DFCCF34DD71202180EBABAE7098BB5903D16EBFC993C40",
|
||||
"date": 575516100,
|
||||
"hash": "09D992D4C89E2A24D4BA9BB57ED81C7003815940F39B7C87ADBF2E49034380BB",
|
||||
"inLedger": 7841263,
|
||||
"ledger_index": 7841263,
|
||||
"meta": {
|
||||
"AffectedNodes": [
|
||||
{
|
||||
"ModifiedNode": {
|
||||
"FinalFields": {
|
||||
"Flags": 0,
|
||||
"Owner": "rBXsgNkPcDN2runsvWmwxk3Lh97zdgo9za",
|
||||
"RootIndex": "3F248A0715ECCAFC3BEE0C63C8F429ACE54ABC403AAF5F2885C2B65D62D1FAC1"
|
||||
},
|
||||
"LedgerEntryType": "DirectoryNode",
|
||||
"LedgerIndex": "3F248A0715ECCAFC3BEE0C63C8F429ACE54ABC403AAF5F2885C2B65D62D1FAC1"
|
||||
}
|
||||
},
|
||||
{
|
||||
"CreatedNode": {
|
||||
"LedgerEntryType": "Check",
|
||||
"LedgerIndex": "84C61BE9B39B2C4A2267F67504404F1EC76678806C1B901EA781D1E3B4CE0CD9",
|
||||
"NewFields": {
|
||||
"Account": "rBXsgNkPcDN2runsvWmwxk3Lh97zdgo9za",
|
||||
"Destination": "rGPnRH1EBpHeTF2QG8DCAgM7z5pb75LAis",
|
||||
"DestinationTag": 1,
|
||||
"InvoiceID": "46060241FABCF692D4D934BA2A6C4427CD4279083E38C77CBE642243E43BE291",
|
||||
"SendMax": "100000000",
|
||||
"Sequence": 4
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"ModifiedNode": {
|
||||
"FinalFields": {
|
||||
"Account": "rBXsgNkPcDN2runsvWmwxk3Lh97zdgo9za",
|
||||
"Balance": "9999999952",
|
||||
"Flags": 0,
|
||||
"OwnerCount": 2,
|
||||
"Sequence": 5
|
||||
},
|
||||
"LedgerEntryType": "AccountRoot",
|
||||
"LedgerIndex": "A9A591BA661F69433D5BEAA49F10BA2B8DEA5183EF414B9130BFE5E0328FE875",
|
||||
"PreviousFields": {
|
||||
"Balance": "9999999964",
|
||||
"OwnerCount": 1,
|
||||
"Sequence": 4
|
||||
},
|
||||
"PreviousTxnID": "45AF36CF7A810D0054C38C82C898EFC7E4898DF94FA7A3AAF80CB868708F7CE0",
|
||||
"PreviousTxnLgrSeq": 7841237
|
||||
}
|
||||
},
|
||||
{
|
||||
"ModifiedNode": {
|
||||
"FinalFields": {
|
||||
"Flags": 0,
|
||||
"Owner": "rGPnRH1EBpHeTF2QG8DCAgM7z5pb75LAis",
|
||||
"RootIndex": "C6A30AD85346718C7148D161663F84A96A4F0CE7F4D68C3C74D176A6C50BA6B9"
|
||||
},
|
||||
"LedgerEntryType": "DirectoryNode",
|
||||
"LedgerIndex": "C6A30AD85346718C7148D161663F84A96A4F0CE7F4D68C3C74D176A6C50BA6B9"
|
||||
}
|
||||
}
|
||||
],
|
||||
"TransactionIndex": 0,
|
||||
"TransactionResult": "tesSUCCESS"
|
||||
},
|
||||
"validated": true
|
||||
},
|
||||
"status": "success",
|
||||
"type": "response"
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
The prerequisites for cashing a check are the same whether you are cashing it for an exact amount or a flexible amount.
|
||||
|
||||
- You need the ID of a Check object currently in the ledger.
|
||||
- For example, the ID of one Check in these examples is `838766BA2B995C00744175F69A1B11E32C3DBC40E64801A4056FCBD657F57334`, although you must use a different ID to go through these steps yourself.
|
||||
- The **address** and **secret key** of the Check's stated recipient. The address must match the `Destination` address in the Check object.
|
||||
- If the Check is for a [token](../concepts/tokens/index.md), you (the recipient) must have a [trust line](../concepts/tokens/fungible-tokens/index.md) to the issuer. Your limit on that trust line must be high enough to hold your previous balance plus the amount you would receive.
|
||||
- A [secure way to sign transactions](../concepts/transactions/secure-signing.md).
|
||||
- A [client library](../references/client-libraries.md) that can connect to the XRP Ledger, or [any HTTP or WebSocket client](../tutorials/http-websocket-apis/build-apps/get-started.md).
|
||||
@@ -48,10 +48,9 @@ For more information about Checks in the XRP Ledger, see:
|
||||
- [CheckCreate][]
|
||||
- [CheckCash][]
|
||||
- [CheckCancel][]
|
||||
- [Checks Tutorials](../../tutorials/how-tos/use-specialized-payment-types/use-checks/use-checks.md)
|
||||
- [Checks Tutorials](../../tutorials/how-tos/use-specialized-payment-types/use-checks/index.md)
|
||||
- [Send a Check](../../tutorials/how-tos/use-specialized-payment-types/use-checks/send-a-check.md)
|
||||
- [Look up Checks by sender address](../../tutorials/how-tos/use-specialized-payment-types/use-checks/look-up-checks-by-sender.md)
|
||||
- [Look up Checks by recipient address](../../tutorials/how-tos/use-specialized-payment-types/use-checks/look-up-checks-by-recipient.md)
|
||||
- [Look up Checks](../../tutorials/how-tos/use-specialized-payment-types/use-checks/look-up-checks.md)
|
||||
- [Cash a Check for an exact amount](../../tutorials/how-tos/use-specialized-payment-types/use-checks/cash-a-check-for-an-exact-amount.md)
|
||||
- [Cash a Check for a flexible amount](../../tutorials/how-tos/use-specialized-payment-types/use-checks/cash-a-check-for-a-flexible-amount.md)
|
||||
- [Cancel a Check](../../tutorials/how-tos/use-specialized-payment-types/use-checks/cancel-a-check.md)
|
||||
|
||||
@@ -1,29 +1,30 @@
|
||||
---
|
||||
html: cancel-a-check.html
|
||||
parent: use-checks.html
|
||||
seo:
|
||||
description: Cancel a Check object without sending money.
|
||||
description: Cancel a Check without sending money.
|
||||
labels:
|
||||
- Checks
|
||||
---
|
||||
# Cancel a Check
|
||||
|
||||
This tutorial shows how to cancel a [Check](../../../../concepts/payment-types/checks.md), which removes the [Check object from the ledger](../../../../references/protocol/ledger-data/ledger-entry-types/check.md) without sending money.
|
||||
This tutorial shows how to cancel a [Check](../../../../concepts/payment-types/checks.md), which removes the [Check entry](../../../../references/protocol/ledger-data/ledger-entry-types/check.md) from the ledger without sending money.
|
||||
|
||||
You may want to cancel an incoming Check if you do not want it. You might cancel an outgoing Check if you made a mistake when sending it or if circumstances have changed. If a Check expires, it's also necessary to cancel it to remove it from the ledger so the sender gets their [owner reserve](../../../../concepts/accounts/reserves.md#owner-reserves) back.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
To cancel a Check with this tutorial, you need the following:
|
||||
- You should be familiar with the basics of using the [xrpl.js client library](../../../javascript/build-apps/get-started.md).
|
||||
- You need an XRP Ledger account including its secret key. (You can get one on Testnet for free.) See also: [XRP Faucets](/resources/dev-tools/xrp-faucets).
|
||||
- You need the ID of a Check ledger entry that you are either the sender or recipient of. See also: [Send a Check](./send-a-check.md).
|
||||
|
||||
- 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](../../../../concepts/transactions/secure-signing.md).
|
||||
- A [client library](../../../../references/client-libraries.md) or any HTTP or WebSocket library.
|
||||
## Source Code
|
||||
|
||||
The complete source code for this tutorial is available in the source repository for this website:
|
||||
|
||||
## 1. Prepare the CheckCancel transaction
|
||||
{% repo-link path="_code-samples/checks/js/" %}Checks sample code{% /repo-link %}
|
||||
|
||||
## Steps
|
||||
|
||||
### 1. Prepare the CheckCancel transaction
|
||||
|
||||
Figure out the values of the [CheckCancel transaction][] fields. The following fields are the bare minimum; everything else is either optional or can be [auto-filled](../../../../references/protocol/transactions/common-fields.md#auto-fillable-fields) when signing:
|
||||
|
||||
@@ -31,135 +32,24 @@ Figure out the values of the [CheckCancel transaction][] fields. The following f
|
||||
|:------------------|:-----------------|:--------------------------------------|
|
||||
| `TransactionType` | String | Use the string `CheckCancel` when canceling a Check. |
|
||||
| `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][]. |
|
||||
| `CheckID` | String | The ID of the Check entry to cancel. You can get this information when you [send a check](./send-a-check.md), or by [looking up checks](./look-up-checks.md). |
|
||||
|
||||
### Example CheckCancel Preparation
|
||||
For example:
|
||||
|
||||
The following examples show how to cancel a Check.
|
||||
{% code-snippet file="/_code-samples/checks/js/cancel-check.js" from="// Prepare" before="// Submit" /%}
|
||||
|
||||
{% tabs %}
|
||||
### 2. Submit the CheckCancel transaction
|
||||
|
||||
{% tab label="JSON-RPC, WebSocket, or Commandline" %}
|
||||
```json
|
||||
{
|
||||
"TransactionType": "CheckCancel",
|
||||
"Account": "rUn84CUYbNjRoTQ6mSW7BVJPSVJNLb1QLo",
|
||||
"CheckID": "49647F0D748DC3FE26BDACBC57F251AADEFFF391403EC9BF87C97F67E9977FB0",
|
||||
"Fee": "12"
|
||||
}
|
||||
```
|
||||
{% /tab %}
|
||||
Submit the CheckCancel transaction in the usual way and wait for it to be validated. If the result code is `tesSUCCESS` and the transaction is in a validated ledger, the transaction is successful. For example:
|
||||
|
||||
{% tab label="ripple-lib 1.x" %}
|
||||
{% code-snippet file="/_code-samples/checks/js/prepareCancel.js" language="js" /%}
|
||||
{% /tab %}
|
||||
{% code-snippet file="/_code-samples/checks/js/cancel-check.js" from="// Submit" before="// Confirm" /%}
|
||||
|
||||
{% /tabs %}
|
||||
## 3. Confirm transaction result
|
||||
|
||||
## 2. Sign the CheckCancel transaction
|
||||
If the transaction succeeded, it should have a `"TransactionResult": "tesSUCCESS"` field in the metadata, and the field `"validated": true` in the result, indicating that this result is final. For example:
|
||||
|
||||
{% partial file="/docs/_snippets/tutorial-sign-step.md" /%}
|
||||
{% code-snippet file="/_code-samples/checks/js/cancel-check.js" from="// Confirm" before="// Disconnect" /%}
|
||||
|
||||
### Example Request
|
||||
|
||||
{% tabs %}
|
||||
|
||||
{% tab label="ripple-lib 1.x" %}
|
||||
{% code-snippet file="/_code-samples/checks/js/signCancel.js" language="js" /%}
|
||||
{% /tab %}
|
||||
|
||||
{% tab label="Commandline" %}
|
||||
{% code-snippet file="/_code-samples/checks/cli/sign-cancel-req.sh" language="bash" /%}
|
||||
{% /tab %}
|
||||
|
||||
{% /tabs %}
|
||||
|
||||
|
||||
### Example Response
|
||||
|
||||
{% tabs %}
|
||||
|
||||
{% tab label="ripple-lib 1.x" %}
|
||||
{% code-snippet file="/_code-samples/checks/js/sign-cancel-resp.txt" language="" /%}
|
||||
{% /tab %}
|
||||
|
||||
{% tab label="Commandline" %}
|
||||
{% code-snippet file="/_code-samples/checks/cli/sign-cancel-resp.txt" language="json" /%}
|
||||
{% /tab %}
|
||||
|
||||
{% /tabs %}
|
||||
|
||||
|
||||
## 3. Submit the signed CheckCancel transaction
|
||||
|
||||
{% partial file="/docs/_snippets/tutorial-submit-step.md" /%}
|
||||
|
||||
### Example Request
|
||||
|
||||
{% tabs %}
|
||||
|
||||
{% tab label="ripple-lib 1.x" %}
|
||||
{% code-snippet file="/_code-samples/checks/js/submitCancel.js" language="js" /%}
|
||||
{% /tab %}
|
||||
|
||||
{% tab label="Commandline" %}
|
||||
{% code-snippet file="/_code-samples/checks/cli/submit-cancel-req.sh" language="bash" /%}
|
||||
{% /tab %}
|
||||
|
||||
{% /tabs %}
|
||||
|
||||
|
||||
### Example Response
|
||||
|
||||
{% tabs %}
|
||||
|
||||
{% tab label="ripple-lib 1.x" %}
|
||||
{% code-snippet file="/_code-samples/checks/js/submit-cancel-resp.txt" language="js" /%}
|
||||
{% /tab %}
|
||||
|
||||
{% tab label="Commandline" %}
|
||||
{% code-snippet file="/_code-samples/checks/cli/submit-cancel-resp.txt" language="json" /%}
|
||||
{% /tab %}
|
||||
|
||||
{% /tabs %}
|
||||
|
||||
## 4. Wait for validation
|
||||
|
||||
{% partial file="/docs/_snippets/wait-for-validation.md" /%}
|
||||
|
||||
## 5. Confirm final result
|
||||
|
||||
Use the [tx method][] with the CheckCancel transaction's identifying hash to check its status. Look for a `"TransactionResult": "tesSUCCESS"` field in the transaction's metadata, indicating that the transaction succeeded, and the field `"validated": true` in the result, indicating that this result is final.
|
||||
|
||||
Look for a `DeletedNode` object in the transaction metadata with `"LedgerEntryType": "Check"` to indicate that the transaction removed a [Check ledger object](../../../../references/protocol/ledger-data/ledger-entry-types/check.md). The `LedgerIndex` of this object should match the ID of the Check.
|
||||
|
||||
### Example Request
|
||||
|
||||
{% tabs %}
|
||||
|
||||
{% tab label="ripple-lib 1.x" %}
|
||||
{% code-snippet file="/_code-samples/checks/js/getCancelTx.js" language="js" /%}
|
||||
{% /tab %}
|
||||
|
||||
{% tab label="Commandline" %}
|
||||
{% code-snippet file="/_code-samples/checks/cli/tx-cancel-req.sh" language="bash" /%}
|
||||
{% /tab %}
|
||||
|
||||
{% /tabs %}
|
||||
|
||||
|
||||
### Example Response
|
||||
|
||||
{% tabs %}
|
||||
|
||||
{% tab label="ripple-lib 1.x" %}
|
||||
{% code-snippet file="/_code-samples/checks/js/get-cancel-tx-resp.txt" language="json" /%}
|
||||
{% /tab %}
|
||||
|
||||
{% tab label="Commandline" %}
|
||||
{% code-snippet file="/_code-samples/checks/cli/tx-cancel-resp.txt" language="json" /%}
|
||||
{% /tab %}
|
||||
|
||||
{% /tabs %}
|
||||
{% admonition type="success" name="Tip" %}The `submitAndWait()` method in xrpl.js only returns when the transaction's result is final, so you can assume that the transaction is validated if it returns a result code of `tesSUCCESS`.{% /admonition %}
|
||||
|
||||
{% raw-partial file="/docs/_snippets/common-links.md" /%}
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
---
|
||||
html: cash-a-check-for-a-flexible-amount.html
|
||||
parent: use-checks.html
|
||||
seo:
|
||||
description: Cash a Check for as much as possible.
|
||||
labels:
|
||||
@@ -8,148 +6,68 @@ labels:
|
||||
---
|
||||
# Cash a Check for a Flexible Amount
|
||||
|
||||
As long as the Check is in the ledger and not expired, the specified recipient can cash it to receive a flexible amount by sending a [CheckCash transaction][] with a `DeliverMin` field. When cashing a Check in this way, the receiver gets as much as is possible to deliver, debiting the Check's sender for the Check's full `SendMax` amount or as much as is available. Cashing fails if it doesn't deliver at least the `DeliverMin` amount to the Check's recipient.
|
||||
This tutorial shows how to cash a [Check](/docs/concepts/payment-types/checks.md) for a flexible amount. As long as the Check is not expired, the specified recipient can cash it to receive the maximum amount available. You would cash a Check this way if you want to receive as much as possible. When doing this, you set a minimum amount to receive in case the sender does not have enough money to pay the full amount. If the check cannot deliver at least the minimum amount, cashing the check fails but you can try again later.
|
||||
|
||||
You might cash a Check for a flexible amount if you want to get as much as possible from the Check.
|
||||
|
||||
The specified recipient can also [cash the check for an exact amount](cash-a-check-for-a-flexible-amount.md).
|
||||
You can also [cash a check for an exact amount](cash-a-check-for-a-flexible-amount.md).
|
||||
|
||||
|
||||
## Prerequisites
|
||||
|
||||
{% partial file="/docs/_snippets/checkcash-prereqs.md" /%}
|
||||
- You should be familiar with the basics of using the [xrpl.js client library](../../../javascript/build-apps/get-started.md).
|
||||
- You need an XRP Ledger account including its secret key. (You can get one on Testnet for free.) See also: [XRP Faucets](/resources/dev-tools/xrp-faucets).
|
||||
- You need the ID of a Check ledger entry that you are the recipient of. See also: [Send a Check](./send-a-check.md) and [Look Up Checks](./look-up-checks.md).
|
||||
|
||||
## 1. Prepare the CheckCash transaction
|
||||
|
||||
## Source Code
|
||||
|
||||
The complete source code for this tutorial is available in the source repository for this website:
|
||||
|
||||
{% repo-link path="_code-samples/checks/js/" %}Checks sample code{% /repo-link %}
|
||||
|
||||
|
||||
## Steps
|
||||
### 1. Prepare the CheckCash transaction
|
||||
|
||||
Figure out the values of the [CheckCash transaction][] fields. To cash a check for a flexible amount, the following fields are the bare minimum; everything else is either optional or can be [auto-filled](../../../../references/protocol/transactions/common-fields.md#auto-fillable-fields) when signing:
|
||||
|
||||
| Field | Value | Description |
|
||||
|:------------------|:--------------------------|:-----------------------------|
|
||||
|:------------------|:---------------------|:-----------------------------|
|
||||
| `TransactionType` | String | The value `CheckCash` indicates this is a CheckCash transaction. |
|
||||
| `Account` | String (Address) | The address of the sender who is cashing the Check. (In other words, your address.) |
|
||||
| `CheckID` | String | The ID of the Check object in the ledger to cash. 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][]. |
|
||||
| `DeliverMin` | String or Object (Amount) | A minimum amount to receive from the Check. If you cannot receive at least this much, cashing the Check fails, leaving the Check in the ledger so you can try again. For XRP, this must be a string specifying drops of XRP. For tokens, this is an object with `currency`, `issuer`, and `value` fields. The `currency` and `issuer` fields must match the corresponding fields in the Check object, and the `value` must be less than or equal to the amount in the Check object. For more information on specifying currency amounts, see [Specifying Currency Amounts][]. |
|
||||
| `Account` | String - [Address][] | The address of the sender who is cashing the Check. (In other words, your address.) |
|
||||
| `CheckID` | String | The ID of the Check to cash. You can get this information from the person who sent you the Check, or by [looking up checks](./look-up-checks.md) where your account is the destination. |
|
||||
| `DeliverMin` | [Currency Amount][] | A minimum amount to receive from the Check. If you cannot receive at least this much, cashing the Check fails, leaving the Check in the ledger so you can try again. For XRP, this must be a string specifying drops of XRP. For tokens, this is an object with `currency`, `issuer`, and `value` fields. The `currency` and `issuer` fields must match the corresponding fields in the Check object, and the `value` must be less than or equal to the amount in the Check object. For more information on specifying currency amounts, see [Specifying Currency Amounts][]. |
|
||||
|
||||
### Example CheckCash Preparation for a flexible amount
|
||||
In the sample code, these values are hard-coded, so you should edit them to match your case:
|
||||
|
||||
The following examples show how to prepare a transaction to cash a Check for a flexible amount.
|
||||
{% code-snippet file="/_code-samples/checks/js/cash-check-flexible.js" language="js" from="// Define parameters" before="async function main()" /%}
|
||||
|
||||
{% tabs %}
|
||||
Then, you use these parameters to fill out the transaction. For example:
|
||||
|
||||
{% tab label="JSON-RPC, WebSocket, or Commandline" %}
|
||||
```json
|
||||
{
|
||||
"Account": "rGPnRH1EBpHeTF2QG8DCAgM7z5pb75LAis",
|
||||
"TransactionType": "CheckCash",
|
||||
"DeliverMin": "95000000",
|
||||
"CheckID": "2E0AD0740B79BE0AAE5EDD1D5FC79E3C5C221D23C6A7F771D85569B5B91195C2"
|
||||
}
|
||||
```
|
||||
{% /tab %}
|
||||
|
||||
{% tab label="ripple-lib 1.x" %}
|
||||
{% code-snippet file="/_code-samples/checks/js/prepareCashFlex.js" language="js" /%}
|
||||
{% /tab %}
|
||||
|
||||
{% /tabs %}
|
||||
|
||||
## 2. Sign the CheckCash transaction
|
||||
|
||||
{% partial file="/docs/_snippets/tutorial-sign-step.md" /%}
|
||||
|
||||
### Example Request
|
||||
|
||||
{% tabs %}
|
||||
|
||||
{% tab label="Commandline" %}
|
||||
{% code-snippet file="/_code-samples/checks/cli/sign-cash-flex-req.sh" language="bash" /%}
|
||||
{% /tab %}
|
||||
|
||||
{% /tabs %}
|
||||
{% code-snippet file="/_code-samples/checks/js/cash-check-flexible.js" language="js" from="// Prepare the transaction" before="// Submit the transaction" /%}
|
||||
|
||||
|
||||
### Example Response
|
||||
### 2. Submit the transaction
|
||||
|
||||
{% tabs %}
|
||||
Send the transaction and wait for it to be validated by the consensus process, as normal:
|
||||
|
||||
{% tab label="Commandline" %}
|
||||
{% code-snippet file="/_code-samples/checks/cli/sign-cash-flex-resp.txt" language="json" /%}
|
||||
{% /tab %}
|
||||
|
||||
{% /tabs %}
|
||||
{% code-snippet file="/_code-samples/checks/js/cash-check-flexible.js" from="// Submit" before="// Confirm" /%}
|
||||
|
||||
|
||||
## 3. Submit the signed CheckCash transaction
|
||||
## 3. Confirm final result
|
||||
|
||||
{% partial file="/docs/_snippets/tutorial-submit-step.md" /%}
|
||||
If the transaction succeeded, it should have a `"TransactionResult": "tesSUCCESS"` field in the metadata, and the field `"validated": true` in the result, indicating that this result is final.
|
||||
|
||||
### Example Request
|
||||
{% admonition type="success" name="Tip" %}The `submitAndWait()` method in xrpl.js only returns when the transaction's result is final, so you can assume that the transaction is validated if it returns a result code of `tesSUCCESS`.{% /admonition %}
|
||||
|
||||
{% tabs %}
|
||||
If the transaction suceeded, you can assume that it delivered at least the `DeliverMin` amount of this transaction and at most the `SendMax` of the Check. To confirm the exact balance changes that occurred as a result of cashing the check, including how much was actually debited and credited, you must look at the transaction metadata. The `xrpl.getBalanceChanges()` function can help to summarize this. For example:
|
||||
|
||||
{% tab label="Commandline" %}
|
||||
{% code-snippet file="/_code-samples/checks/cli/submit-cash-flex-req.sh" language="bash" /%}
|
||||
{% /tab %}
|
||||
{% code-snippet file="/_code-samples/checks/js/cash-check-flexible.js" from="// Confirm transaction results" before="// Disconnect" /%}
|
||||
|
||||
{% /tabs %}
|
||||
{% admonition type="info" name="Note" %}
|
||||
The metadata shows the net balance changes as the result of all of the transactions effects, which may be surprising in some cases. If an account receives exactly the same amount of XRP as it burns, its balance stays the same so it does not even appear in the list of balance changes.
|
||||
{% /admonition %}
|
||||
|
||||
|
||||
### Example Response
|
||||
|
||||
{% tabs %}
|
||||
|
||||
{% tab label="Commandline" %}
|
||||
{% code-snippet file="/_code-samples/checks/cli/submit-cash-flex-resp.txt" language="json" /%}
|
||||
{% /tab %}
|
||||
|
||||
{% /tabs %}
|
||||
|
||||
## 4. Wait for validation
|
||||
|
||||
{% partial file="/docs/_snippets/wait-for-validation.md" /%}
|
||||
|
||||
## 5. Confirm final result
|
||||
|
||||
Use the [tx method][] with the CheckCash transaction's identifying hash to check its status. Look for a `"TransactionResult": "tesSUCCESS"` field in the transaction's metadata, indicating that the transaction succeeded, and the field `"validated": true` in the result, indicating that this result is final.
|
||||
|
||||
### Example Request
|
||||
|
||||
{% tabs %}
|
||||
|
||||
{% tab label="Commandline" %}
|
||||
{% code-snippet file="/_code-samples/checks/cli/tx-cash-flex-req.sh" language="bash" /%}
|
||||
{% /tab %}
|
||||
|
||||
{% /tabs %}
|
||||
|
||||
|
||||
### Example Response
|
||||
|
||||
{% tabs %}
|
||||
|
||||
{% tab label="Commandline" %}
|
||||
{% code-snippet file="/_code-samples/checks/cli/tx-cash-flex-resp.txt" language="json" /%}
|
||||
{% /tab %}
|
||||
|
||||
{% /tabs %}
|
||||
|
||||
### Handling Errors
|
||||
|
||||
If cashing the Check failed with a `tec`-class code, look up the code in the [Full Transaction Response List](../../../../references/protocol/transactions/transaction-results/index.md) and respond accordingly. Some common possibilities for CheckCash transactions:
|
||||
|
||||
| Result Code | Meaning | How to Respond |
|
||||
|-------------|---------|----------------|
|
||||
| `tecEXPIRED` | The Check has expired. | Cancel the Check and ask the sender to create a new Check with a later Expiration time. |
|
||||
| `tecNO_ENTRY` | The Check ID doesn't exist. | Confirm that the `CheckID` from the CheckCash transaction is correct. Confirm that the Check has not already been canceled or successfully cashed. |
|
||||
| `tecNO_LINE` | The recipient doesn't have a trust line for the Check's currency. | If you want to hold this currency from this issuer, create a trust line for the specified currency and issuer with a reasonable limit using a [TrustSet transaction][], then try to cash the check again. |
|
||||
| `tecNO_PERMISSION` | The sender of the CheckCash transaction isn't the `Destination` of the Check. | Double-check the `Destination` of the Check. |
|
||||
| `tecNO_AUTH` | The issuer of the currency from the check is using [Authorized Trust Lines](../../../../concepts/tokens/fungible-tokens/authorized-trust-lines.md) but the recipient's trust line to the issuer is not approved. | Ask the issuer to authorize this trust line, then try again to cash the Check after they do. |
|
||||
| `tecPATH_PARTIAL` | The Check could not deliver enough tokens, either due to trust line limits or because the sender does not have enough balance of the token to send (including the issuer's [transfer fee](../../../../concepts/tokens/transfer-fees.md), if there is one). | If the problem is the trust line limit, send a [TrustSet transaction][] to increase your limit (if desired) or lower your balance by spending some of the currency, then try to cash the Check again. If the problem is the sender's balance, wait for the sender to have more of the Check's currency, or try again to cash the Check for a lesser amount. |
|
||||
| `tecUNFUNDED_PAYMENT` | The Check could not deliver enough XRP. | Wait for the sender to have more XRP, or try again to cash the Check for a lesser amount. |
|
||||
|
||||
## 6. Confirm delivered amount
|
||||
|
||||
If the Check was cashed for a flexible `DeliverMin` amount and succeeded, you can assume that the Check was cashed for at least the `DeliverMin` amount. To get the exact amount delivered, check the transaction metadata. The `delivered_amount` field in the metadata shows the exact amount delivered. (This field is only provided if the Check was cashed for a flexible amount. If the check was successfully cashed for a fixed amount, then the delivered amount is equal to the `Amount` of the CheckCash transaction.)
|
||||
If you are not using `getBalanceChanges()`, the following guidelines should help with parsing the metadata:
|
||||
|
||||
- For XRP, the `AccountRoot` object of the Check's sender has its XRP `Balance` field debited. The `AccountRoot` object of the Check's recipient (the one who sent the CheckCash transaction) has its XRP `Balance` credited for at least the `DeliverMin` of the CheckCash transaction minus the [transaction cost](../../../../concepts/transactions/transaction-cost.md) of sending the transaction.
|
||||
|
||||
|
||||
@@ -1,139 +1,94 @@
|
||||
---
|
||||
html: cash-a-check-for-an-exact-amount.html
|
||||
parent: use-checks.html
|
||||
seo:
|
||||
description: Cash a Check in the ledger for any exact amount up to the amount it specifies.
|
||||
description: Cash a Check for any exact amount up to the amount it specifies.
|
||||
labels:
|
||||
- Checks
|
||||
---
|
||||
# Cash a Check for an Exact Amount
|
||||
|
||||
As long as the Check is in the ledger and not expired, the specified recipient can cash it to receive any exact amount up to the amount specified in the Check by sending a [CheckCash transaction][] with an `Amount` field. You would cash a Check this way if you want to receive a specific amount, for example to pay off an invoice or bill exactly.
|
||||
This tutorial shows how to cash a [Check](/docs/concepts/payment-types/checks.md) for an exact amount. As long as the Check is not expired, the specified recipient can cash it to receive any exact amount up to the amount specified. You would cash a Check this way if you want to receive a specific amount, for example to pay off an invoice or bill exactly. If the sender does not have enough money, cashing the check fails but you can try again later.
|
||||
|
||||
The specified recipient can also [cash the check for a flexible amount](cash-a-check-for-a-flexible-amount.md).
|
||||
You can also [cash a check for a flexible amount](./cash-a-check-for-a-flexible-amount.md).
|
||||
|
||||
## Prerequisites
|
||||
|
||||
{% partial file="/docs/_snippets/checkcash-prereqs.md" /%}
|
||||
- You should be familiar with the basics of using the [xrpl.js client library](../../../javascript/build-apps/get-started.md).
|
||||
- You need an XRP Ledger account including its secret key. (You can get one on Testnet for free.) See also: [XRP Faucets](/resources/dev-tools/xrp-faucets).
|
||||
- You need the ID of a Check ledger entry that you are the recipient of. See also: [Send a Check](./send-a-check.md) and [Look Up Checks](./look-up-checks.md).
|
||||
|
||||
## 1. Prepare the CheckCash transaction
|
||||
## Source Code
|
||||
|
||||
Figure out the values of the [CheckCash transaction][] fields. To cash a check for an exact amount, the following fields are the bare minimum; everything else is either optional or can be [auto-filled](../../../../references/protocol/transactions/common-fields.md#auto-fillable-fields) when signing:
|
||||
The complete source code for this tutorial is available in the source repository for this website:
|
||||
|
||||
{% repo-link path="_code-samples/checks/js/" %}Checks sample code{% /repo-link %}
|
||||
|
||||
## Steps
|
||||
### 1. Prepare the CheckCash transaction
|
||||
|
||||
Figure out the values of the [CheckCash transaction][] fields. You also need to create a `Wallet` instance for your account's key pair. To cash a check for an exact amount, the following fields are the bare minimum; everything else is either optional or can be [auto-filled](../../../../references/protocol/transactions/common-fields.md#auto-fillable-fields) when signing:
|
||||
|
||||
| Field | Value | Description |
|
||||
|:------------------|:--------------------------|:-----------------------------|
|
||||
|:------------------|:---------------------|:-----------------------------|
|
||||
| `TransactionType` | String | The value `CheckCash` indicates this is a CheckCash transaction. |
|
||||
| `Account` | String (Address) | The address of the sender who is cashing the Check. (In other words, your address.) |
|
||||
| `CheckID` | String | The ID of the Check object in the ledger to cash. 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][]. |
|
||||
| `Amount` | String or Object (Amount) | The amount to redeem from the Check. For XRP, this must be a string specifying drops of XRP. For tokens, this is an object with `currency`, `issuer`, and `value` fields. The `currency` and `issuer` fields must match the corresponding fields in the Check object, and the `value` must be less than or equal to the amount in the Check object. (For currencies with transfer fees, you must cash the Check for less than its `SendMax` so the transfer fee can be paid by the `SendMax`.) If you cannot receive this much, cashing the Check fails, leaving the Check in the ledger so you can try again. For more information on specifying currency amounts, see [Specifying Currency Amounts][]. |
|
||||
| `Account` | String - [Address][] | The address of the sender who is cashing the Check. (In other words, your address.) |
|
||||
| `CheckID` | String | The ID of the Check to cash. You can get this information from the person who sent you the Check, or by [looking up checks](./look-up-checks.md) where your account is the destination. |
|
||||
| `Amount` | [Currency Amount][] | The amount to receive. The type of currency (token or XRP) must match the Check object. The quantity in the `value` field must be less than or equal to the amount in the Check object. (For currencies with transfer fees, you must cash the Check for less than its `SendMax` so the transfer fee can be paid by the `SendMax`.) For more information on specifying currency amounts, see [Specifying Currency Amounts][]. |
|
||||
|
||||
In the sample code, these values are hard-coded, so you should edit them to match your case:
|
||||
|
||||
{% code-snippet file="/_code-samples/checks/js/cash-check-exact.js" language="js" from="// Define parameters" before="async function main()" /%}
|
||||
|
||||
Then, you use these parameters to fill out the transaction. For example:
|
||||
|
||||
{% code-snippet file="/_code-samples/checks/js/cash-check-exact.js" language="js" from="// Prepare the transaction" before="// Submit the transaction" /%}
|
||||
|
||||
|
||||
### Example CheckCash Preparation for an exact amount
|
||||
### 2. Submit the transaction
|
||||
|
||||
The following examples show how to prepare a transaction to cash a Check for a fixed amount.
|
||||
Send the transaction and wait for it to be validated by the consensus process, as normal:
|
||||
|
||||
{% tabs %}
|
||||
{% code-snippet file="/_code-samples/checks/js/cash-check-exact.js" from="// Submit" before="// Confirm" /%}
|
||||
|
||||
|
||||
### 3. Confirm transaction result
|
||||
|
||||
If the transaction succeeded, it should have a `"TransactionResult": "tesSUCCESS"` field in the metadata, and the field `"validated": true` in the result, indicating that this result is final.
|
||||
|
||||
{% admonition type="success" name="Tip" %}The `submitAndWait()` method in xrpl.js only returns when the transaction's result is final, so you can assume that the transaction is validated if it returns a result code of `tesSUCCESS`.{% /admonition %}
|
||||
|
||||
You can look at the transaction metadata to confirm the balance changes that occurred as a result of delivering the exact amount. The `xrpl.getBalanceChanges()` function can help to summarize this. For example:
|
||||
|
||||
{% code-snippet file="/_code-samples/checks/js/cash-check-exact.js" from="// Confirm transaction results" before="// Disconnect" /%}
|
||||
|
||||
Example balance changes output:
|
||||
|
||||
{% tab label="JSON-RPC, WebSocket, or Commandline" %}
|
||||
```json
|
||||
Balance changes: [
|
||||
{
|
||||
"Account": "rfkE1aSy9G8Upk4JssnwBxhEv5p4mn2KTy",
|
||||
"TransactionType": "CheckCash",
|
||||
"Amount": "100000000",
|
||||
"CheckID": "838766BA2B995C00744175F69A1B11E32C3DBC40E64801A4056FCBD657F57334",
|
||||
"Fee": "12"
|
||||
"account": "rEHjrKs86KfPjgeZvso2uQqhU2iA7AqD6r",
|
||||
"balances": [
|
||||
{
|
||||
"currency": "XRP",
|
||||
"value": "29.999988"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"account": "rh8pPR6p87egsGuAg53QrJ7Y4PLf4Qdrf7",
|
||||
"balances": [
|
||||
{
|
||||
"currency": "XRP",
|
||||
"value": "-30"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
```
|
||||
{% /tab %}
|
||||
|
||||
{% tab label="ripple-lib 1.x" %}
|
||||
{% code-snippet file="/_code-samples/checks/js/prepareCashExact.js" language="js" /%}
|
||||
{% /tab %}
|
||||
{% admonition type="info" name="Note" %}
|
||||
The metadata shows the net balance changes as the result of all of the transactions effects, which may be surprising in some cases. For example, in the above example, rEHjr... received 30 XRP from the Check but burned 12 drops of XRP on the transaction cost, resulting in a net gain of 29.99988 XRP from the transaction.
|
||||
|
||||
{% /tabs %}
|
||||
|
||||
## 2. Sign the CheckCash transaction
|
||||
|
||||
{% partial file="/docs/_snippets/tutorial-sign-step.md" /%}
|
||||
|
||||
### Example Request
|
||||
|
||||
{% tabs %}
|
||||
|
||||
{% tab label="Commandline" %}
|
||||
{% code-snippet file="/_code-samples/checks/cli/sign-cash-exact-req.sh" language="bash" /%}
|
||||
{% /tab %}
|
||||
|
||||
{% /tabs %}
|
||||
|
||||
|
||||
### Example Response
|
||||
|
||||
{% tabs %}
|
||||
|
||||
{% tab label="Commandline" %}
|
||||
{% code-snippet file="/_code-samples/checks/cli/sign-cash-exact-resp.txt" language="json" /%}
|
||||
{% /tab %}
|
||||
|
||||
{% /tabs %}
|
||||
|
||||
|
||||
## 3. Submit the signed CheckCash transaction
|
||||
|
||||
{% partial file="/docs/_snippets/tutorial-submit-step.md" /%}
|
||||
|
||||
### Example Request
|
||||
|
||||
{% tabs %}
|
||||
|
||||
{% tab label="Commandline" %}
|
||||
{% code-snippet file="/_code-samples/checks/cli/submit-cash-exact-req.sh" language="bash" /%}
|
||||
{% /tab %}
|
||||
|
||||
{% /tabs %}
|
||||
|
||||
|
||||
### Example Response
|
||||
|
||||
{% tabs %}
|
||||
|
||||
{% tab label="Commandline" %}
|
||||
{% code-snippet file="/_code-samples/checks/cli/submit-cash-exact-resp.txt" language="json" /%}
|
||||
{% /tab %}
|
||||
|
||||
{% /tabs %}
|
||||
|
||||
## 4. Wait for validation
|
||||
|
||||
{% partial file="/docs/_snippets/wait-for-validation.md" /%}
|
||||
|
||||
## 5. Confirm final result
|
||||
|
||||
Use the [tx method][] with the CheckCash transaction's identifying hash to check its status. Look for a `"TransactionResult": "tesSUCCESS"` field in the transaction's metadata, indicating that the transaction succeeded, and the field `"validated": true` in the result, indicating that this result is final.
|
||||
|
||||
If the check was cashed for an exact `Amount` and succeeded, you can assume that the recipient was credited for exactly that amount (with possible rounding for very large or very small amounts of tokens).
|
||||
|
||||
If cashing the Check failed, the Check remains in the ledger so you can try cashing again later. You may want to [cash the Check for a flexible amount](cash-a-check-for-a-flexible-amount.md) instead.
|
||||
|
||||
### Example Request
|
||||
|
||||
{% tabs %}
|
||||
|
||||
{% tab label="Commandline" %}
|
||||
{% code-snippet file="/_code-samples/checks/cli/tx-cash-exact-req.sh" language="bash" /%}
|
||||
{% /tab %}
|
||||
|
||||
{% /tabs %}
|
||||
|
||||
|
||||
### Example Response
|
||||
|
||||
{% tabs %}
|
||||
|
||||
{% tab label="Commandline" %}
|
||||
{% code-snippet file="/_code-samples/checks/cli/tx-cash-exact-resp.txt" language="json" /%}
|
||||
{% /tab %}
|
||||
|
||||
{% /tabs %}
|
||||
If an account receives exactly the same amount of XRP as it burns, its balance stays the same so it does not even appear in the list of balance changes.
|
||||
{% /admonition %}
|
||||
|
||||
{% raw-partial file="/docs/_snippets/common-links.md" /%}
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
---
|
||||
html: use-checks.html
|
||||
parent: use-specialized-payment-types.html
|
||||
seo:
|
||||
description: Checks in the XRP Ledger authorize another account to claim funds later, similar to how personal paper checks work.
|
||||
metadata:
|
||||
@@ -12,7 +10,6 @@ labels:
|
||||
|
||||
Checks in the XRP Ledger authorize another account to claim funds later, similar to how personal paper checks work.
|
||||
|
||||
{% raw-partial file="/docs/_snippets/common-links.md" /%}
|
||||
|
||||
See also: [Modular Tutorial: Send and Cash Checks](../../../javascript/send-payments/send-and-cash-checks.md).
|
||||
|
||||
{% child-pages /%}
|
||||
@@ -1,68 +0,0 @@
|
||||
---
|
||||
html: look-up-checks-by-recipient.html
|
||||
parent: use-checks.html
|
||||
seo:
|
||||
description: Get a list of pending checks sent to an account.
|
||||
labels:
|
||||
- Checks
|
||||
---
|
||||
# Look Up Checks by Recipient
|
||||
|
||||
This tutorial shows how to look up [Checks](../../../../concepts/payment-types/checks.md) by their recipient. You may also want to [look up Checks by sender](look-up-checks-by-sender.md).
|
||||
|
||||
## 1. Look up all Checks for the address
|
||||
|
||||
To get a list of all incoming and outgoing Checks for an account, use the `account_objects` command with the recipient account's address and set the `type` field of the request to `checks`.
|
||||
|
||||
### Example Request
|
||||
|
||||
{% tabs %}
|
||||
|
||||
{% tab label="ripple-lib 1.x" %}
|
||||
{% code-snippet file="/_code-samples/checks/js/getChecks.js" language="js" /%}
|
||||
{% /tab %}
|
||||
|
||||
{% tab label="JSON-RPC" %}
|
||||
{% code-snippet file="/_code-samples/checks/json-rpc/account_objects-req.json" language="json" /%}
|
||||
{% /tab %}
|
||||
|
||||
{% /tabs %}
|
||||
|
||||
### Example Response
|
||||
|
||||
{% tabs %}
|
||||
|
||||
{% tab label="ripple-lib 1.x" %}
|
||||
{% code-snippet file="/_code-samples/checks/js/get-checks-resp.txt" language="" /%}
|
||||
{% /tab %}
|
||||
|
||||
{% tab label="JSON-RPC" %}
|
||||
{% code-snippet file="/_code-samples/checks/json-rpc/account_objects-resp.json" language="json" prefix="200 OK\n\n" /%}
|
||||
{% /tab %}
|
||||
|
||||
{% /tabs %}
|
||||
|
||||
|
||||
## 2. Filter the responses by recipient
|
||||
|
||||
The response may include Checks where the account from the request is the sender and Checks where the account is the recipient. Each member of the `account_objects` array of the response represents one Check. For each such Check object, the address in the `Destination` is address of that Check's recipient.
|
||||
|
||||
The following pseudocode demonstrates how to filter the responses by recipient:
|
||||
|
||||
```js
|
||||
recipient_address = "rBXsgNkPcDN2runsvWmwxk3Lh97zdgo9za"
|
||||
account_objects_response = get_account_objects({
|
||||
account: recipient_address,
|
||||
ledger_index: "validated",
|
||||
type: "check"
|
||||
})
|
||||
|
||||
for (i=0; i < account_objects_response.account_objects.length; i++) {
|
||||
check_object = account_objects_response.account_objects[i]
|
||||
if (check_object.Destination == recipient_address) {
|
||||
log("Check to recipient:", check_object)
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
{% raw-partial file="/docs/_snippets/common-links.md" /%}
|
||||
@@ -1,68 +0,0 @@
|
||||
---
|
||||
html: look-up-checks-by-sender.html
|
||||
parent: use-checks.html
|
||||
seo:
|
||||
description: Get a list of pending Checks sent by an account.
|
||||
labels:
|
||||
- Checks
|
||||
---
|
||||
# Look Up Checks by Sender
|
||||
|
||||
This tutorial shows how to look up [Checks](../../../../concepts/payment-types/checks.md) by their sender. You may also want to [look up Checks by recipient](look-up-checks-by-recipient.md).
|
||||
|
||||
## 1. Look up all Checks for the address
|
||||
|
||||
To get a list of all incoming and outgoing Checks for an account, use the `account_objects` command with the sending account's address and set the `type` field of the request to `checks`.
|
||||
|
||||
|
||||
### Example Request
|
||||
|
||||
{% tabs %}
|
||||
|
||||
{% tab label="ripple-lib 1.x" %}
|
||||
{% code-snippet file="/_code-samples/checks/js/getChecks.js" language="js" /%}
|
||||
{% /tab %}
|
||||
|
||||
{% tab label="JSON-RPC" %}
|
||||
{% code-snippet file="/_code-samples/checks/json-rpc/account_objects-req.json" language="json" /%}
|
||||
{% /tab %}
|
||||
|
||||
{% /tabs %}
|
||||
|
||||
### Example Response
|
||||
|
||||
{% tabs %}
|
||||
|
||||
{% tab label="ripple-lib 1.x" %}
|
||||
{% code-snippet file="/_code-samples/checks/js/get-checks-resp.txt" language="" /%}
|
||||
{% /tab %}
|
||||
|
||||
{% tab label="JSON-RPC" %}
|
||||
{% code-snippet file="/_code-samples/checks/json-rpc/account_objects-resp.json" language="json" prefix="200 OK\n\n" /%}
|
||||
{% /tab %}
|
||||
|
||||
{% /tabs %}
|
||||
|
||||
## 2. Filter the responses by sender
|
||||
|
||||
The response may include Checks where the account from the request is the sender and Checks where the account is the recipient. Each member of the `account_objects` array of the response represents one Check. For each such Check object, the address in the `Account` is address of that Check's sender.
|
||||
|
||||
The following pseudocode demonstrates how to filter the responses by sender:
|
||||
|
||||
```js
|
||||
sender_address = "rBXsgNkPcDN2runsvWmwxk3Lh97zdgo9za"
|
||||
account_objects_response = get_account_objects({
|
||||
account: sender_address,
|
||||
ledger_index: "validated",
|
||||
type: "check"
|
||||
})
|
||||
|
||||
for (i=0; i < account_objects_response.account_objects.length; i++) {
|
||||
check_object = account_objects_response.account_objects[i]
|
||||
if (check_object.Account == sender_address) {
|
||||
log("Check from sender:", check_object)
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
{% raw-partial file="/docs/_snippets/common-links.md" /%}
|
||||
@@ -0,0 +1,42 @@
|
||||
---
|
||||
seo:
|
||||
description: Get a list of pending checks sent from or to an account.
|
||||
labels:
|
||||
- Checks
|
||||
---
|
||||
# Look Up Checks
|
||||
|
||||
This tutorial shows how to look up [Checks](../../../../concepts/payment-types/checks.md) by their sender or recipient, in JavaScript.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
- You should be familiar with the basics of using the [xrpl.js client library](../../../javascript/build-apps/get-started.md).
|
||||
- To get any results, the addresses you're looking up must have at least one Check entry in the ledger. See also: [Send a Check](./send-a-check.md).
|
||||
|
||||
## Source Code
|
||||
|
||||
The complete source code for this tutorial is available in the source repository for this website:
|
||||
|
||||
{% repo-link path="_code-samples/checks/js/" %}Checks sample code{% /repo-link %}
|
||||
|
||||
## Steps
|
||||
|
||||
### 1. Look up all Checks for the address
|
||||
|
||||
To get a list of all incoming and outgoing Checks for an account, use the `account_objects` command and set the `type` field of the request to `checks`. You may need to make multiple requests if the result is [paginated](../../../../references/http-websocket-apis/api-conventions/markers-and-pagination.md).
|
||||
|
||||
{% code-snippet file="/_code-samples/checks/js/get-checks.js" from="// Loop through account objects" before="// Filter results" /%}
|
||||
|
||||
|
||||
### 2. Filter the responses by recipient
|
||||
|
||||
The response may include Checks where the account from the request is the sender or the recipient. Each member of the `account_objects` array of the response represents one Check. For each such Check object, the address in the `Destination` is address of that Check's recipient, such as in the following code:
|
||||
|
||||
{% code-snippet file="/_code-samples/checks/js/get-checks.js" from="// Filter results" before="// Disconnect" /%}
|
||||
|
||||
To filter by sender, check the address in the `Account` field of the Check instead.
|
||||
|
||||
{% admonition type="success" name="tip" %}For each Check entry in the results, the Check's ID is in the `index` field. You'll need this value to cash or cancel the Check.{% /admonition %}
|
||||
|
||||
|
||||
{% raw-partial file="/docs/_snippets/common-links.md" /%}
|
||||
@@ -1,21 +1,15 @@
|
||||
---
|
||||
html: send-a-check.html
|
||||
parent: use-checks.html
|
||||
seo:
|
||||
description: Put a Check in the ledger so its intended recipient can cash it later.
|
||||
description: Send a Check whose intended recipient can cash it to be paid later.
|
||||
labels:
|
||||
- Checks
|
||||
---
|
||||
# Send a Check
|
||||
|
||||
Sending a Check is like writing permission for an intended recipient to pull a payment from you. The outcome of this process is a [Check object in the ledger](../../../../references/protocol/ledger-data/ledger-entry-types/check.md) which the recipient can cash later.
|
||||
Sending a [Check](/docs/concepts/payment-types/checks.md) is like writing permission for an intended recipient to pull a payment from you. The outcome of this process is a [Check entry in the ledger](../../../../references/protocol/ledger-data/ledger-entry-types/check.md) which the recipient can cash later.
|
||||
|
||||
In many cases, you want to send a [Payment][] instead of a Check, since that delivers the money directly to the recipient in one step. However, if your intended recipient uses [DepositAuth](../../../../concepts/accounts/depositauth.md), you cannot send them Payments directly, so a Check is a good alternative.
|
||||
|
||||
This tutorial uses the example of a fictitious company, BoxSend SG (whose XRP Ledger address is `rBXsgNkPcDN2runsvWmwxk3Lh97zdgo9za`) paying a fictitious cryptocurrency consulting company named Grand Payments (with XRP Ledger address `rGPnRH1EBpHeTF2QG8DCAgM7z5pb75LAis`) for some consulting work. Grand Payments prefers be paid in XRP, but to simplify their taxes and regulation, only accepts payments they've explicitly approved.
|
||||
|
||||
Outside of the XRP Ledger, Grand Payments sends an invoice to BoxSend SG with the ID `46060241FABCF692D4D934BA2A6C4427CD4279083E38C77CBE642243E43BE291`, and requests a Check for 100 XRP be sent to Grand Payments' XRP Ledger address of `rGPnRH1EBpHeTF2QG8DCAgM7z5pb75LAis`. <!-- SPELLING_IGNORE: boxsend -->
|
||||
|
||||
## Prerequisites
|
||||
|
||||
To send a Check with this tutorial, you need the following:
|
||||
@@ -23,10 +17,17 @@ To send a Check with this tutorial, you need the following:
|
||||
- The **address** and **secret key** of a funded account to send the Check from.
|
||||
- You can use the [XRP Ledger Test Net Faucet](/resources/dev-tools/xrp-faucets) to get a funded address and secret with 10,000 Test Net XRP.
|
||||
- The **address** of a funded account to receive the Check.
|
||||
- A [secure way to sign transactions](../../../../concepts/transactions/secure-signing.md).
|
||||
- A [client library](../../../../references/client-libraries.md) or any HTTP or WebSocket library.
|
||||
- You should be familiar with the basics of using [xrpl.js](../../../javascript/build-apps/get-started.md).
|
||||
|
||||
## 1. Prepare the CheckCreate transaction
|
||||
## Source Code
|
||||
|
||||
The complete source code for this tutorial is available in the source repository for this website:
|
||||
|
||||
{% repo-link path="_code-samples/checks/js/" %}Checks sample code{% /repo-link %}
|
||||
|
||||
## Steps
|
||||
|
||||
### 1. Prepare the CheckCreate transaction
|
||||
|
||||
Decide how much money the Check is for and who can cash it. Figure out the values of the [CheckCreate transaction][] fields. The following fields are the bare minimum; everything else is either optional or can be [auto-filled](../../../../references/protocol/transactions/common-fields.md#auto-fillable-fields) when signing:
|
||||
|
||||
@@ -37,157 +38,28 @@ 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 tokens, 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](../../../../concepts/tokens/transfer-fees.md), 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.) |
|
||||
|
||||
### Example CheckCreate Preparation
|
||||
For example, imagine you were asked to pay a company named Grand Payments for some consulting work. By email, Grand Payments informs you that the maximum charge is 120 XRP, their XRP Ledger address is `rGPnRH1EBpHeTF2QG8DCAgM7z5pb75LAis`, and this work has been billed with an invoice ID of `46060241FABCF692D4D934BA2A6C4427CD4279083E38C77CBE642243E43BE291` which they ask you to attach for their records. The following code shows how you could use a Check to send that payment:
|
||||
|
||||
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.
|
||||
{% code-snippet file="/_code-samples/checks/js/create-check.js" language="js" from="// Prepare the transaction" before="// Submit the transaction" /%}
|
||||
|
||||
{% tabs %}
|
||||
|
||||
{% tab label="ripple-lib 1.x" %}
|
||||
{% code-snippet file="/_code-samples/checks/js/prepareCreate.js" language="js" /%}
|
||||
{% /tab %}
|
||||
|
||||
{% tab label="JSON-RPC, WebSocket, or Commandline" %}
|
||||
```json
|
||||
{
|
||||
"TransactionType": "CheckCreate",
|
||||
"Account": "rBXsgNkPcDN2runsvWmwxk3Lh97zdgo9za",
|
||||
"Destination": "rGPnRH1EBpHeTF2QG8DCAgM7z5pb75LAis",
|
||||
"SendMax": "100000000",
|
||||
"InvoiceID": "46060241FABCF692D4D934BA2A6C4427CD4279083E38C77CBE642243E43BE291"
|
||||
}
|
||||
```
|
||||
{% /tab %}
|
||||
|
||||
{% /tabs %}
|
||||
|
||||
## 2. Sign the CheckCreate transaction
|
||||
|
||||
{% partial file="/docs/_snippets/tutorial-sign-step.md" /%}
|
||||
{% admonition type="success" name="Tip" %}The `InvoiceID` is optional metadata that can be attached to any Check (or Payment). This field is purely informational and is not used in transaction processing.{% /admonition %}
|
||||
|
||||
|
||||
### Example Request
|
||||
### 2. Submit the transaction
|
||||
|
||||
{% tabs %}
|
||||
Send the transaction and wait for it to be validated by the consensus process, as normal:
|
||||
|
||||
{% tab label="ripple-lib 1.x" %}
|
||||
{% code-snippet file="/_code-samples/checks/js/signCreate.js" language="js" /%}
|
||||
{% /tab %}
|
||||
|
||||
{% tab label="WebSocket" %}
|
||||
{% code-snippet file="/_code-samples/checks/websocket/sign-create-req.json" language="json" /%}
|
||||
{% /tab %}
|
||||
|
||||
{% tab label="Commandline" %}
|
||||
{% code-snippet file="/_code-samples/checks/cli/sign-create-req.sh" language="bash" /%}
|
||||
{% /tab %}
|
||||
|
||||
{% /tabs %}
|
||||
|
||||
#### Example Response
|
||||
|
||||
{% tabs %}
|
||||
|
||||
{% tab label="ripple-lib 1.x" %}
|
||||
{% code-snippet file="/_code-samples/checks/js/sign-create-resp.txt" language="js" /%}
|
||||
{% /tab %}
|
||||
|
||||
{% tab label="WebSocket" %}
|
||||
{% code-snippet file="/_code-samples/checks/websocket/sign-create-resp.json" language="json" /%}
|
||||
{% /tab %}
|
||||
|
||||
{% tab label="Commandline" %}
|
||||
{% code-snippet file="/_code-samples/checks/cli/sign-create-resp.txt" language="json" /%}
|
||||
{% /tab %}
|
||||
|
||||
{% /tabs %}
|
||||
|
||||
## 3. Submit the signed transaction
|
||||
|
||||
{% partial file="/docs/_snippets/tutorial-submit-step.md" /%}
|
||||
|
||||
### Example Request
|
||||
|
||||
{% tabs %}
|
||||
|
||||
{% tab label="ripple-lib 1.x" %}
|
||||
{% code-snippet file="/_code-samples/checks/js/submitCreate.js" language="js" /%}
|
||||
{% /tab %}
|
||||
|
||||
{% tab label="WebSocket" %}
|
||||
{% code-snippet file="/_code-samples/checks/websocket/submit-create-req.json" language="json" /%}
|
||||
{% /tab %}
|
||||
|
||||
{% tab label="Commandline" %}
|
||||
{% code-snippet file="/_code-samples/checks/cli/submit-create-req.sh" language="bash" /%}
|
||||
{% /tab %}
|
||||
|
||||
{% /tabs %}
|
||||
|
||||
### Example Response
|
||||
|
||||
{% tabs %}
|
||||
|
||||
{% tab label="ripple-lib 1.x" %}
|
||||
{% code-snippet file="/_code-samples/checks/js/submit-create-resp.txt" language="js" /%}
|
||||
{% /tab %}
|
||||
|
||||
{% tab label="WebSocket" %}
|
||||
{% code-snippet file="/_code-samples/checks/websocket/submit-create-resp.json" language="json" /%}
|
||||
{% /tab %}
|
||||
|
||||
{% tab label="Commandline" %}
|
||||
{% code-snippet file="/_code-samples/checks/cli/submit-create-resp.txt" language="json" /%}
|
||||
{% /tab %}
|
||||
|
||||
{% /tabs %}
|
||||
{% code-snippet file="/_code-samples/checks/js/create-check.js" language="js" from="// Submit the transaction" before="// Get transaction result" /%}
|
||||
|
||||
|
||||
## 4. Wait for validation
|
||||
### 3. Confirm transaction result
|
||||
|
||||
{% partial file="/docs/_snippets/wait-for-validation.md" /%}
|
||||
If the transaction succeeded, it should have a `"TransactionResult": "tesSUCCESS"` field in the metadata, and the field `"validated": true` in the result, indicating that this result is final.
|
||||
|
||||
{% admonition type="success" name="Tip" %}The `submitAndWait()` method in xrpl.js only returns when the transaction's result is final, so you can assume that the transaction is validated if it returns a result code of `tesSUCCESS`.{% /admonition %}
|
||||
|
||||
## 5. Confirm final result
|
||||
To cash or cancel the Check later, you'll need the Check ID. You can find this in the transaction's metadata by looking for a `CreatedNode` entry with a `LedgerEntryType` of `"Check"`. This indicates that the transaction created a [Check ledger entry](../../../../references/protocol/ledger-data/ledger-entry-types/check.md). The `LedgerIndex` of this object is the ID of the Check. This should be a [hash][] value such as `84C61BE9B39B2C4A2267F67504404F1EC76678806C1B901EA781D1E3B4CE0CD9`.
|
||||
|
||||
Use the [tx method][] with the CheckCreate transaction's identifying hash to check its status. Look for a `"TransactionResult": "tesSUCCESS"` field in the transaction's metadata, indicating that the transaction succeeded, and the field `"validated": true` in the result, indicating that this result is final.
|
||||
|
||||
Look for a `CreatedNode` object in the transaction metadata with a `LedgerEntryType` of `"Check"`. This indicates that the transaction created a [Check ledger object](../../../../references/protocol/ledger-data/ledger-entry-types/check.md). The `LedgerIndex` of this object is the ID of the Check. In the following example, the Check's ID is `84C61BE9B39B2C4A2267F67504404F1EC76678806C1B901EA781D1E3B4CE0CD9`.
|
||||
|
||||
### Example Request
|
||||
|
||||
{% tabs %}
|
||||
|
||||
{% tab label="ripple-lib 1.x" %}
|
||||
{% code-snippet file="/_code-samples/checks/js/getCreateTx.js" language="" /%}
|
||||
{% /tab %}
|
||||
|
||||
{% tab label="WebSocket" %}
|
||||
{% code-snippet file="/_code-samples/checks/websocket/tx-create-req.json" language="json" /%}
|
||||
{% /tab %}
|
||||
|
||||
{% tab label="Commandline" %}
|
||||
{% code-snippet file="/_code-samples/checks/cli/tx-create-req.sh" language="bash" /%}
|
||||
{% /tab %}
|
||||
|
||||
{% /tabs %}
|
||||
|
||||
### Example Response
|
||||
|
||||
{% tabs %}
|
||||
|
||||
{% tab label="ripple-lib 1.x" %}
|
||||
{% code-snippet file="/_code-samples/checks/js/get-create-tx-resp.txt" language="" /%}
|
||||
{% /tab %}
|
||||
|
||||
{% tab label="WebSocket" %}
|
||||
{% code-snippet file="/_code-samples/checks/websocket/tx-create-resp.json" language="json" /%}
|
||||
{% /tab %}
|
||||
|
||||
{% tab label="Commandline" %}
|
||||
{% code-snippet file="/_code-samples/checks/cli/tx-create-resp.txt" language="json" /%}
|
||||
{% /tab %}
|
||||
|
||||
{% /tabs %}
|
||||
At this point, it is up to the recipient to cash the Check.
|
||||
|
||||
{% raw-partial file="/docs/_snippets/common-links.md" /%}
|
||||
|
||||
@@ -19,7 +19,7 @@ This example shows how to:
|
||||
|
||||
Checks offer another option for transferring funds between accounts. Checks have two particular advantages.
|
||||
|
||||
1. You can use a check to send funds to another account without first creating a trust line - the trust line is created automatically when the receiver chooses to accept the funds.
|
||||
1. You can use a check to send [tokens](../../../concepts/tokens/index.md) to someone who has not already created a trust line. The trust line is created automatically when the receiver chooses to accept the funds.
|
||||
2. The receiver can choose to accept less than the full amount of the check. This allows you to authorize a maximum amount when the actual cost is not finalized.
|
||||
|
||||
|
||||
@@ -27,9 +27,11 @@ Checks offer another option for transferring funds between accounts. Checks have
|
||||
|
||||
## Prerequisites
|
||||
|
||||
Clone or download the [Modular Tutorial Samples](https://github.com/XRPLF/xrpl-dev-portal/tree/master/content/_code-samples/quickstart/js/).
|
||||
Clone or download the {% repo-link path="_code-samples/quickstart/js/" %}Modular Tutorial Samples{% /repo-link %}.
|
||||
|
||||
{% admonition type="info" name="Note" %}Without the Quickstart Samples, you will not be able to try the examples that follow. {% /admonition %}
|
||||
{% admonition type="info" name="Note" %}
|
||||
Without the Modular Tutorial Samples, you will not be able to try the examples that follow.
|
||||
{% /admonition %}
|
||||
|
||||
## Usage
|
||||
|
||||
@@ -73,7 +75,7 @@ To send a check for an issued currency token from the Standby account to the Ope
|
||||
|
||||
### Get Checks
|
||||
|
||||
Click **Get Checks** to get a list of the current checks you have sent or received. To uniquely identify a check (for existence, when cashing a check), capture the _index_ value for the check.
|
||||
Click **Get Checks** to get a list of the current checks you have sent or received. To uniquely identify a check (for example, when cashing a check), use the check's ledger entry ID, in the `index` field.
|
||||
|
||||
[](/docs/img/quickstart-checks5.png)
|
||||
|
||||
@@ -103,7 +105,7 @@ Click **Get Balances** to get a list of obligations and assets for each account.
|
||||
|
||||
To cancel a check you have previously sent to another account.
|
||||
|
||||
1. Enter the **Check ID** (**index** value).
|
||||
1. Enter the **Check ID** (`index` value).
|
||||
2. Click **Cancel Check**.
|
||||
|
||||
[](/docs/img/quickstart-checks8.png)
|
||||
@@ -111,7 +113,7 @@ To cancel a check you have previously sent to another account.
|
||||
|
||||
# Code Walkthrough
|
||||
|
||||
You can download the [Quickstart Samples](https://github.com/XRPLF/xrpl-dev-portal/tree/master/content/_code-samples/quickstart/js/) in the source repository for this website.
|
||||
You can download the {% repo-link path="_code-samples/quickstart/js/" %}Modular Tutorial Samples{% /repo-link %} in the source repository for this website.
|
||||
|
||||
## ripplex10-check.js
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ Checks are a straightforward, familiar, and flexible way to transfer funds when
|
||||
|
||||
While this method is the simplest, it doesn't guarantee the funds. Checks are deferred payments, meaning funds aren't moved until the moment you try to cash the check. It's possible for the sending account to not have the necessary funds at the time the check is cashed, which can cause delays or other headaches, depending on your business.
|
||||
|
||||
See: [Use Checks](../../tutorials/how-tos/use-specialized-payment-types/use-checks/use-checks.md).
|
||||
See: [Use Checks](../../tutorials/how-tos/use-specialized-payment-types/use-checks/index.md).
|
||||
|
||||
|
||||
### Escrow
|
||||
|
||||
@@ -1,11 +1,20 @@
|
||||
/docs/tutorials/javascript/trade-on-ledger/earn-passive-income-as-a-liquidity-provider/:
|
||||
to: /docs/tutorials/javascript/amm/add-assets-to-amm/
|
||||
/docs/tutorials/javascript/trade-on-ledger/earn-passive-income-as-a-liquidity-provider:
|
||||
to: /docs/tutorials/javascript/amm/add-assets-to-amm
|
||||
type: 301
|
||||
/docs/tutorials/javascript/trade-on-ledger/use-amm-auction-slot-for-lower-fees/:
|
||||
to: /docs/tutorials/javascript/amm/trade-with-auction-slot/
|
||||
/docs/tutorials/javascript/trade-on-ledger/use-amm-auction-slot-for-lower-fees:
|
||||
to: /docs/tutorials/javascript/amm/trade-with-auction-slot
|
||||
type: 301
|
||||
/docs/references/protocol/transactions/transaction-results/transaction-results/:
|
||||
to: /docs/references/protocol/transactions/transaction-results/
|
||||
/docs/tutorials/how-tos/use-specialized-payment-types/use-checks/look-up-checks-by-recipient:
|
||||
to: /docs/tutorials/how-tos/use-specialized-payment-types/use-checks/look-up-checks
|
||||
type: 301
|
||||
/docs/tutorials/how-tos/use-specialized-payment-types/use-checks/look-up-checks-by-sender:
|
||||
to: /docs/tutorials/how-tos/use-specialized-payment-types/use-checks/look-up-checks
|
||||
type: 301
|
||||
/docs/tutorials/how-tos/use-specialized-payment-types/use-checks/use-checks:
|
||||
to: /docs/tutorials/how-tos/use-specialized-payment-types/use-checks
|
||||
type: 301
|
||||
/docs/references/protocol/transactions/transaction-results/transaction-results:
|
||||
to: /docs/references/protocol/transactions/transaction-results
|
||||
type: 301
|
||||
xrp-ledger-rpc-tool.html:
|
||||
to: /resources/dev-tools/rpc-tool
|
||||
|
||||
@@ -271,15 +271,14 @@
|
||||
expanded: false
|
||||
items:
|
||||
- page: docs/tutorials/how-tos/use-specialized-payment-types/use-payment-channels/open-a-payment-channel-to-enable-an-inter-exchange-network.md
|
||||
- page: docs/tutorials/how-tos/use-specialized-payment-types/use-checks/use-checks.md
|
||||
- page: docs/tutorials/how-tos/use-specialized-payment-types/use-checks/index.md
|
||||
expanded: false
|
||||
items:
|
||||
- page: docs/tutorials/how-tos/use-specialized-payment-types/use-checks/send-a-check.md
|
||||
- page: docs/tutorials/how-tos/use-specialized-payment-types/use-checks/cash-a-check-for-an-exact-amount.md
|
||||
- page: docs/tutorials/how-tos/use-specialized-payment-types/use-checks/cash-a-check-for-a-flexible-amount.md
|
||||
- page: docs/tutorials/how-tos/use-specialized-payment-types/use-checks/cancel-a-check.md
|
||||
- page: docs/tutorials/how-tos/use-specialized-payment-types/use-checks/look-up-checks-by-sender.md
|
||||
- page: docs/tutorials/how-tos/use-specialized-payment-types/use-checks/look-up-checks-by-recipient.md
|
||||
- page: docs/tutorials/how-tos/use-specialized-payment-types/use-checks/look-up-checks.md
|
||||
- page: docs/tutorials/how-tos/use-tokens/index.md
|
||||
expanded: false
|
||||
items:
|
||||
|
||||
Reference in New Issue
Block a user