diff --git a/@i18n/ja/community/report-a-scam.md b/@i18n/ja/community/report-a-scam.md index aa0688f7ba..702c0e027f 100644 --- a/@i18n/ja/community/report-a-scam.md +++ b/@i18n/ja/community/report-a-scam.md @@ -24,7 +24,7 @@ parent: contribute.html - [Uphold](https://support.uphold.com/hc/en-us/requests/new) - [Bitrue](https://www.bitrue.com/exchange-web/footer/contactus.html) -4. 詐欺業者がXRP Ledger上でXRPを他のトークンと交換した場合、そのトークンの発行者に連絡してください。発行者は[詐欺業者のトラストラインを凍結する](../docs/tutorials/tasks/use-tokens/freeze-a-trust-line.md)ことができるかもしれません。 +4. 詐欺業者がXRP Ledger上でXRPを他のトークンと交換した場合、そのトークンの発行者に連絡してください。発行者は[詐欺業者のトラストラインを凍結する](../docs/tutorials/how-tos/use-tokens/freeze-a-trust-line.md)ことができるかもしれません。 詐欺業者の報告に関する詳細は、[Xrplorer Forensicsのヘルプ](https://xrplorer.com/forensics/help)をご覧ください。 diff --git a/@i18n/ja/docs/_snippets/checkcash-prereqs.md b/@i18n/ja/docs/_snippets/checkcash-prereqs.md index 7c48a3040a..7e1d8f3184 100644 --- a/@i18n/ja/docs/_snippets/checkcash-prereqs.md +++ b/@i18n/ja/docs/_snippets/checkcash-prereqs.md @@ -6,4 +6,4 @@ Checkを換金するための前提条件は、正確な金額を換金する場 - 発行済み通貨用のCheckの場合は、ご自身(受取人)にイシュアーに対するトラストラインがある必要があります。このトラストライン上のご自身の限度額は、受け取る金額を追加するための残高より十分高くなければなりません。 - トラストラインと限度額について詳しくは、[トークン](../concepts/tokens/index.md)および[トラストラインと発行](../concepts/tokens/fungible-tokens/index.md)を参照してください。 - [トランザクションに安全に署名できる手段](../concepts/transactions/secure-signing.md)。 -- XRP Ledgerに接続できる[クライアントライブラリ](../references/client-libraries.md)か、それとも[HTTPライブラリ、WebSocketライブラリなど](../tutorials/http-websocket-apis/get-started.md)。 +- XRP Ledgerに接続できる[クライアントライブラリ](../references/client-libraries.md)か、それとも[HTTPライブラリ、WebSocketライブラリなど](../tutorials/http-websocket-apis/build-apps/get-started.md)。 diff --git a/@i18n/ja/docs/_snippets/post-rippled-install.md b/@i18n/ja/docs/_snippets/post-rippled-install.md index 4ee21d42e0..83712f6420 100644 --- a/@i18n/ja/docs/_snippets/post-rippled-install.md +++ b/@i18n/ja/docs/_snippets/post-rippled-install.md @@ -2,7 +2,7 @@ `rippled`ログメッセージの詳細は、[ログメッセージについて](../infrastructure/troubleshooting/understanding-log-messages.md)を参照してください。 -`rippled`が残りのネットワークと同期されたら、ストック`rippled`サーバーが完全に機能するようになります。このサーバーを、ローカル署名やXRP LedgerへのAPIアクセスに使用できます。`rippled`サーバーがネットワークと同期されているかどうかを判別するには、[`rippled`サーバーの状況](../references/http-websocket-apis/api-conventions/rippled-server-states.md)を使用します。[`rippled`のコマンドラインインターフェイス](../tutorials/http-websocket-apis/get-started.md#コマンドライン)を使用すれば、これを迅速にテストできます。 +`rippled`が残りのネットワークと同期されたら、ストック`rippled`サーバーが完全に機能するようになります。このサーバーを、ローカル署名やXRP LedgerへのAPIアクセスに使用できます。`rippled`サーバーがネットワークと同期されているかどうかを判別するには、[`rippled`サーバーの状況](../references/http-websocket-apis/api-conventions/rippled-server-states.md)を使用します。[`rippled`のコマンドラインインターフェイス](../tutorials/http-websocket-apis/build-apps/get-started.md#コマンドライン)を使用すれば、これを迅速にテストできます。 ```sh rippled server_info diff --git a/@i18n/ja/docs/concepts/accounts/account-types.md b/@i18n/ja/docs/concepts/accounts/account-types.md index 20af488ba3..416708834f 100644 --- a/@i18n/ja/docs/concepts/accounts/account-types.md +++ b/@i18n/ja/docs/concepts/accounts/account-types.md @@ -73,8 +73,8 @@ labels: - [アカウント](index.md) - [暗号鍵](cryptographic-keys.md) - **チュートリアル:** - - [レギュラーキーペアの割り当て](../../tutorials/tasks/manage-account-settings/assign-a-regular-key-pair.md) - - [レギュラーキーペアの変更または削除](../../tutorials/tasks/manage-account-settings/change-or-remove-a-regular-key-pair.md) + - [レギュラーキーペアの割り当て](../../tutorials/how-tos/manage-account-settings/assign-a-regular-key-pair.md) + - [レギュラーキーペアの変更または削除](../../tutorials/how-tos/manage-account-settings/change-or-remove-a-regular-key-pair.md) - **リファレンス:** - [account_infoメソッド][] - [SetRegularKeyトランザクション][] diff --git a/@i18n/ja/docs/concepts/accounts/cryptographic-keys.md b/@i18n/ja/docs/concepts/accounts/cryptographic-keys.md index f87d3da1d5..653dde5866 100644 --- a/@i18n/ja/docs/concepts/accounts/cryptographic-keys.md +++ b/@i18n/ja/docs/concepts/accounts/cryptographic-keys.md @@ -88,7 +88,7 @@ XRP Ledgerは、複数の[暗号署名アルゴリズム](#署名アルゴリズ **注意:** 悪意のある行為者があなたのマスター秘密鍵(またはシード)を知った場合、マスター鍵ペアが無効化されていない限り、彼らはあなたのアカウントを完全にコントロールすることができます。彼らはあなたのアカウントが保持している全ての資金を盗み、その他の回復不能な損害を与えることができます。秘密鍵は慎重に扱ってください! -マスターキーペアは変更できないため、漏えいが発生した場合には無効化せざるを得ません。[マスターキーペアをオフラインで保管](../../tutorials/tasks/manage-account-settings/offline-account-setup.md)し、代わりにアカウントのトランザクションの署名用にレギュラーキーペアを設定することを強くお勧めします。マスターキーペアを有効にしておきながらオンラインで使用することで、インターネットを使用してマスターキーペアにアクセスすることはできませんが、緊急時にマスターキーペアを使うことが可能になります。 +マスターキーペアは変更できないため、漏えいが発生した場合には無効化せざるを得ません。[マスターキーペアをオフラインで保管](../../tutorials/how-tos/manage-account-settings/offline-account-setup.md)し、代わりにアカウントのトランザクションの署名用にレギュラーキーペアを設定することを強くお勧めします。マスターキーペアを有効にしておきながらオンラインで使用することで、インターネットを使用してマスターキーペアにアクセスすることはできませんが、緊急時にマスターキーペアを使うことが可能になります。 マスターキーペアをオフラインで保管する際には、不正使用者がアクセスできる場所に秘密情報(パスフレーズ、シード、秘密鍵)を保管しないようにします。たとえば、インターネットに一切接続されない物理的に隔離されたマシンに保管したり、紙に記入して安全な場所に保管します。一般的には、インターネットと相互にやり取りをするコンピュータプログラムがアクセスできる範囲内には保管しません。マスターキーペアは、緊急時(漏えいの恐れがある場合や実際に漏えいが発生した場合にレギュラーキーペアを変更するなど)に限り、最も信頼できるデバイスでのみ使用することが理想的です。 @@ -119,7 +119,7 @@ XRP Ledgerアカウントは、_レギュラーキーペア_ と呼ばれるセ レギュラーキーペアは、マスターキーペアと同じ形式です。生成方法も同じです(例えば、[wallet_proposeメソッド][]を使用します)。唯一の違いは、レギュラーキーペアは、トランザクションに署名するアカウントと本質的に結びついていないことです。あるアカウントのマスターキーペアを別のアカウントの通常キーペアとして使用することは可能です(ただし、推奨されるものではありません)。 -[SetRegularKeyトランザクション][]は、アカウントのレギュラーキーペアを割り当てたり変更したりします。レギュラーキーペアの割り当てまたは変更に関するチュートリアルは、[レギュラーキーペアの割り当て](../../tutorials/tasks/manage-account-settings/assign-a-regular-key-pair.md)をご覧ください +[SetRegularKeyトランザクション][]は、アカウントのレギュラーキーペアを割り当てたり変更したりします。レギュラーキーペアの割り当てまたは変更に関するチュートリアルは、[レギュラーキーペアの割り当て](../../tutorials/how-tos/manage-account-settings/assign-a-regular-key-pair.md)をご覧ください ## 署名アルゴリズム @@ -248,8 +248,8 @@ XRP Ledgerアカウントキーでのsecp256k1鍵導出に、Ed25519鍵導出よ - **コンセプト:** - [発行アドレスと運用アドレス](account-types.md) - **チュートリアル:** - - [レギュラーキーペアの割り当て](../../tutorials/tasks/manage-account-settings/assign-a-regular-key-pair.md) - - [レギュラーキーペアの変更または削除](../../tutorials/tasks/manage-account-settings/change-or-remove-a-regular-key-pair.md) + - [レギュラーキーペアの割り当て](../../tutorials/how-tos/manage-account-settings/assign-a-regular-key-pair.md) + - [レギュラーキーペアの変更または削除](../../tutorials/how-tos/manage-account-settings/change-or-remove-a-regular-key-pair.md) - **リファレンス:** - [SetRegularKeyトランザクション][] - [AccountRootレジャーオブジェクト](../../references/protocol/ledger-data/ledger-entry-types/accountroot.md) diff --git a/@i18n/ja/docs/concepts/accounts/index.md b/@i18n/ja/docs/concepts/accounts/index.md index 387669c125..bfe7ec7601 100644 --- a/@i18n/ja/docs/concepts/accounts/index.md +++ b/@i18n/ja/docs/concepts/accounts/index.md @@ -63,7 +63,7 @@ XRP Ledgerでアカウントを取得する一般的な方法は次のとおり - [Paymentトランザクション][] - [AccountRootオブジェクト](../../references/protocol/ledger-data/ledger-entry-types/accountroot.md) - **チュートリアル:** - - [アカウント設定の管理(カテゴリー)](../../tutorials/tasks/manage-account-settings/index.md) + - [アカウント設定の管理(カテゴリー)](../../tutorials/how-tos/manage-account-settings/index.md) - [WebSocketを使用した着信ペイメントの監視](../../tutorials/http-websocket-apis/monitor-incoming-payments-with-websocket.md) {% raw-partial file="/docs/_snippets/common-links.md" /%} diff --git a/@i18n/ja/docs/concepts/accounts/multi-signing.md b/@i18n/ja/docs/concepts/accounts/multi-signing.md index 56d54756e7..53aa6d647a 100644 --- a/@i18n/ja/docs/concepts/accounts/multi-signing.md +++ b/@i18n/ja/docs/concepts/accounts/multi-signing.md @@ -58,7 +58,7 @@ CEOのウェイトを3、副社長3人のウェイトを各2、取締役3人の マルチシグトランザクションを正常に送信するには、以下のすべての条件を満たす必要があります。 -* トランザクションを送信するアドレス(`Account`に指定されるアドレス)は、[レジャーに`SignerList`](../../references/protocol/ledger-data/ledger-entry-types/signerlist.md)を所有する必要があります。この方法については、[マルチシグを設定する](../../tutorials/tasks/manage-account-settings/set-up-multi-signing.md)を参照してください。 +* トランザクションを送信するアドレス(`Account`に指定されるアドレス)は、[レジャーに`SignerList`](../../references/protocol/ledger-data/ledger-entry-types/signerlist.md)を所有する必要があります。この方法については、[マルチシグを設定する](../../tutorials/how-tos/manage-account-settings/set-up-multi-signing.md)を参照してください。 * トランザクションに`SigningPubKey`フィールドを空の文字列として含める必要があります。 * トランザクションに、署名の配列が指定されている[`Signers`フィールド](../../references/protocol/transactions/common-fields.md#signersフィールド)を含める必要があります。 * `Signers`配列に含まれている署名は、`SignerList`で定義されている署名と一致している必要があります。 @@ -67,13 +67,13 @@ CEOのウェイトを3、副社長3人のウェイトを各2、取締役3人の * トランザクションのすべてのフィールドは、署名収集前に定義する必要があります。フィールドの[自動入力](../../references/protocol/transactions/common-fields.md#自動入力可能なフィールド)は実行できません。 * `Signers`配列がバイナリ形式で指定される場合、この配列は署名者アドレスの数値に基づいて、低い値から順にソートされている必要があります。(JSONとして提出される場合は、[submit_multisignedメソッド][]がこの処理を自動的に実行します。) -詳細は、[マルチシグの設定](../../tutorials/tasks/manage-account-settings/set-up-multi-signing.md)を参照してください。 +詳細は、[マルチシグの設定](../../tutorials/how-tos/manage-account-settings/set-up-multi-signing.md)を参照してください。 ## 関連項目 - **チュートリアル:** - - [マルチシグを設定する](../../tutorials/tasks/manage-account-settings/set-up-multi-signing.md) - - [マルチシグトランザクションを送信する](../../tutorials/tasks/manage-account-settings/send-a-multi-signed-transaction.md) + - [マルチシグを設定する](../../tutorials/how-tos/manage-account-settings/set-up-multi-signing.md) + - [マルチシグトランザクションを送信する](../../tutorials/how-tos/manage-account-settings/send-a-multi-signed-transaction.md) - **コンセプト:** - [暗号鍵](cryptographic-keys.md) - [マルチシグトランザクションの特別なトランザクションコスト](../transactions/transaction-cost.md#特別なトランザクションコスト) diff --git a/@i18n/ja/docs/concepts/accounts/reserves.md b/@i18n/ja/docs/concepts/accounts/reserves.md index 630fc79e41..b2efecce24 100644 --- a/@i18n/ja/docs/concepts/accounts/reserves.md +++ b/@i18n/ja/docs/concepts/accounts/reserves.md @@ -54,7 +54,7 @@ XRP Ledgerでは、スパムや悪意のある使用によって、共有グロ アカウントの所有者準備金を決定するには、増分準備金にアカウントが所有するオブジェクトの数を掛けます。アカウントが所有しているオブジェクトの数を調べるには、[account_infoメソッド][]を呼び出し、`account_data.OwnerCount`を取得します。 -アドレスの必要となる合計準備金を計算するには、`OwnerCount`に`reserve_inc_xrp`を掛け、次に`reserve_base_xrp`を加えます。[この計算をPythonで行うデモ](../../tutorials/python/build-a-desktop-wallet-in-python.md#codeblock-17)があります。 +アドレスの必要となる合計準備金を計算するには、`OwnerCount`に`reserve_inc_xrp`を掛け、次に`reserve_base_xrp`を加えます。[この計算をPythonで行うデモ](../../tutorials/python/build-apps/build-a-desktop-wallet-in-python.md#codeblock-17)があります。 ## 必要準備金を下回る @@ -76,6 +76,6 @@ XRP Ledgerには、準備金要件を調整する仕組みがあります。こ - [AccountRootオブジェクト][] - [手数料の投票](../consensus-protocol/fee-voting.md) - [SetFee疑似トランザクション][]疑似トランザクション -- [チュートリアル: 必要準備金の計算と表示(Python)](../../tutorials/python/build-a-desktop-wallet-in-python.md#3-display-an-account) +- [チュートリアル: 必要準備金の計算と表示(Python)](../../tutorials/python/build-apps/build-a-desktop-wallet-in-python.md#3-display-an-account) {% raw-partial file="/docs/_snippets/common-links.md" /%} diff --git a/@i18n/ja/docs/concepts/accounts/tickets.md b/@i18n/ja/docs/concepts/accounts/tickets.md index b7b7526f02..e224baadff 100644 --- a/@i18n/ja/docs/concepts/accounts/tickets.md +++ b/@i18n/ja/docs/concepts/accounts/tickets.md @@ -63,7 +63,7 @@ XRP Ledgerのチケットは、取引をすぐに送信せずに、その取引 - **Concepts:** - [マルチシグ](multi-signing.md) - **Tutorials:** - - [チケットを使用する](../../tutorials/tasks/manage-account-settings/use-tickets.md) + - [チケットを使用する](../../tutorials/how-tos/manage-account-settings/use-tickets.md) - **References:** - [TicketCreate トランザクション][] - [トランザクションの共通フィールド](../../references/protocol/transactions/common-fields.md) diff --git a/@i18n/ja/docs/concepts/networks-and-servers/index.md b/@i18n/ja/docs/concepts/networks-and-servers/index.md index 2c30fa0209..ed449bb8cf 100644 --- a/@i18n/ja/docs/concepts/networks-and-servers/index.md +++ b/@i18n/ja/docs/concepts/networks-and-servers/index.md @@ -27,7 +27,7 @@ XRP Ledgerを動かすサーバーソフトウェアは、主に2種類ありま * 選択的に支払いパスや通貨交換のオファーを表示または非表示にすることができ、最良の取引を提供せず、彼ら自身の利益を確保する可能性があります。 * もし、アドレスの秘密鍵を送信してしまった場合、サーバーの管理者はあなたに代わって任意のトランザクションを実行し、アドレスが保有するすべての資金を転送または破棄する可能性があります。 -さらに、独自のサーバーを運営することで、[管理者アクセス権限](../../tutorials/http-websocket-apis/get-started.md#管理者アクセス権限)が与えられ、重要な管理者専用コマンドや負荷の高いコマンドを実行することができます。共有サーバーを使用する場合、同じサーバーの他のユーザーとサーバーの計算能力を共有することを考慮しなければいけません。WebSocket APIのコマンドの多くはサーバーに大きな負担をかけるので、サーバーには必要なときにレスポンスを縮小するオプションがあります。サーバーを他人と共有する場合、常に最良の結果を得られるとは限りません。 +さらに、独自のサーバーを運営することで、[管理者アクセス権限](../../tutorials/http-websocket-apis/build-apps/get-started.md#管理者アクセス権限)が与えられ、重要な管理者専用コマンドや負荷の高いコマンドを実行することができます。共有サーバーを使用する場合、同じサーバーの他のユーザーとサーバーの計算能力を共有することを考慮しなければいけません。WebSocket APIのコマンドの多くはサーバーに大きな負担をかけるので、サーバーには必要なときにレスポンスを縮小するオプションがあります。サーバーを他人と共有する場合、常に最良の結果を得られるとは限りません。 最後に、バリデーションサーバーを運用する場合、パブリックネットワークへのプロキシとしてストックサーバーを使用し、バリデーションサーバーをプライベートネットワークに置いて、ストックサーバーを通してのみ外部にアクセスできるようにすることができます。これにより、バリデーションサーバに侵入することがより困難になります。 diff --git a/@i18n/ja/docs/concepts/networks-and-servers/rippled-server-modes.md b/@i18n/ja/docs/concepts/networks-and-servers/rippled-server-modes.md index 9199bc46d9..acdc706e8a 100644 --- a/@i18n/ja/docs/concepts/networks-and-servers/rippled-server-modes.md +++ b/@i18n/ja/docs/concepts/networks-and-servers/rippled-server-modes.md @@ -12,7 +12,7 @@ labels: - [**P2Pモード**](#p2pモード) - ピアツーピアネットワークをフォローし、トランザクションを処理し、ある程度の[レジャー履歴](ledger-history.md)を維持します。このモードは、以下の役割のいずれか、またはすべてを行うように設定することができます。 - [**バリデータ**](#バリデータ) - コンセンサスに参加することで、ネットワークの安全確保に貢献します。 - - [**APIサーバー**](#apiサーバー) - 共有レジャーからデータを読み込んだり、トランザクションを送信したり、レジャーのアクティビティを監視するための[APIアクセス](../../tutorials/http-websocket-apis/get-started.md)を提供します。オプションとして、トランザクションやレジャーの履歴を完全に記録する [**全履歴サーバー**](#全履歴サーバー) とすることができます。 + - [**APIサーバー**](#apiサーバー) - 共有レジャーからデータを読み込んだり、トランザクションを送信したり、レジャーのアクティビティを監視するための[APIアクセス](../../tutorials/http-websocket-apis/build-apps/get-started.md)を提供します。オプションとして、トランザクションやレジャーの履歴を完全に記録する [**全履歴サーバー**](#全履歴サーバー) とすることができます。 - [**ハブサーバー**](#公開ハブ) - ピアツーピアネットワークの他の多くのメンバー間のメッセージを中継します。 - [**レポートモード**](#レポートモード) - リレーショナルデータベースからのAPIリクエストに対応するための専用モードです。ピアツーピアネットワークには参加しないため、P2Pモードサーバーを実行し、信頼できるgRPC接続を使用してレポートモードサーバーに接続する必要があります。 {% badge href="https://github.com/XRPLF/rippled/releases/tag/1.7.0" %}新規: rippled 1.7.0{% /badge %} - [**スタンドアロンモード**](#スタンドアロンモード) - テスト用のオフラインモードです。ピアツーピアネットワークに接続せず、コンセンサスも使用しません。 diff --git a/@i18n/ja/docs/concepts/payment-types/checks.md b/@i18n/ja/docs/concepts/payment-types/checks.md index 3fc1e7d5a2..270008a1c7 100644 --- a/@i18n/ja/docs/concepts/payment-types/checks.md +++ b/@i18n/ja/docs/concepts/payment-types/checks.md @@ -16,7 +16,7 @@ XRP LedgerのChecks機能を使用すると、指定の受取人による取消 XRP Ledger Checksには有効期限があり、この期限を過ぎると換金できなくなります。受取人が有効期限までにCheckを換金できなかった場合、Checkオブジェクトは誰かに取り消されるまでXRP Ledgerに残ります。有効期限切れになったCheckは誰でも取り消すことができます。有効期限前、あるいはChecksが換金されるまでは、送金元と受取人のみがCheckを取り消すことができます。Checkオブジェクトは、送金元がそのCheckを換金できた時点または誰かが取り消した時点でLedgerから削除されます。 -Checksは[Escrow](escrow.md)と[Payment Channel](../../tutorials/tasks/use-specialized-payment-types/use-payment-channels/index.md)に似ていますが、Checksとこれらの機能の間には重要な相違がいくつかあります。 +Checksは[Escrow](escrow.md)と[Payment Channel](../../tutorials/how-tos/use-specialized-payment-types/use-payment-channels/index.md)に似ていますが、Checksとこれらの機能の間には重要な相違がいくつかあります。 * Checksではトークンを送金できます。Payment ChannelとEscrowで送金できるのはXRPのみです。 @@ -97,19 +97,19 @@ XRP LedgerのChecksの詳細は、以下を参照してください。 - [CheckCreate][] - [CheckCash][] - [CheckCancel][] -- [Checksのチュートリアル](../../tutorials/tasks/use-specialized-payment-types/use-checks/use-checks.md) - - [Checkの送信](../../tutorials/tasks/use-specialized-payment-types/use-checks/send-a-check.md) - - [送金元アドレスに基づくChecksの検索](../../tutorials/tasks/use-specialized-payment-types/use-checks/look-up-checks-by-sender.md) - - [受取人アドレスに基づくChecksの検索](../../tutorials/tasks/use-specialized-payment-types/use-checks/look-up-checks-by-recipient.md) - - [Checkの指定された金額での換金](../../tutorials/tasks/use-specialized-payment-types/use-checks/cash-a-check-for-an-exact-amount.md) - - [Checkの変動金額での換金](../../tutorials/tasks/use-specialized-payment-types/use-checks/cash-a-check-for-a-flexible-amount.md) - - [Checkの取消し](../../tutorials/tasks/use-specialized-payment-types/use-checks/cancel-a-check.md) +- [Checksのチュートリアル](../../tutorials/how-tos/use-specialized-payment-types/use-checks/use-checks.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) + - [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) - [Checks Amendment][] 関連機能の詳細については、以下を参照してください。 * [Deposit Authorization](../accounts/depositauth.md) * [Escrow](escrow.md) -* [Payment Channelチュートリアル](../../tutorials/tasks/use-specialized-payment-types/use-payment-channels/index.md) +* [Payment Channelチュートリアル](../../tutorials/how-tos/use-specialized-payment-types/use-payment-channels/index.md) {% raw-partial file="/docs/_snippets/common-links.md" /%} diff --git a/@i18n/ja/docs/concepts/payment-types/cross-currency-payments.md b/@i18n/ja/docs/concepts/payment-types/cross-currency-payments.md index d96b5adb1c..2ade28f181 100644 --- a/@i18n/ja/docs/concepts/payment-types/cross-currency-payments.md +++ b/@i18n/ja/docs/concepts/payment-types/cross-currency-payments.md @@ -9,7 +9,7 @@ labels: --- # クロスカレンシー支払い -XRP Ledgerでは、1つ以上のトークンとXRP、またはその両方を交換して、クロスカレンシー支払いができます。[XRPによる直接支払い](../../tutorials/tasks/send-xrp.md)と同様に、このような支払いでは[Paymentトランザクションタイプ][Payment]が使用されます。XRP Ledgerでのクロスカレンシー支払いは完全にアトミックです。つまり、支払いを全額実行するか、またはまったく実行しないかのいずれかになります。 +XRP Ledgerでは、1つ以上のトークンとXRP、またはその両方を交換して、クロスカレンシー支払いができます。[XRPによる直接支払い](../../tutorials/how-tos/send-xrp.md)と同様に、このような支払いでは[Paymentトランザクションタイプ][Payment]が使用されます。XRP Ledgerでのクロスカレンシー支払いは完全にアトミックです。つまり、支払いを全額実行するか、またはまったく実行しないかのいずれかになります。 デフォルトでは、クロスカレンシー支払いでは宛先に一定額が送金され、支払元が変動コストを負担します。クロスカレンシー支払いが、[Partial Payments](partial-payments.md)で行われ、一定の送金限度内の変動額が宛先に送金される場合もあります。 diff --git a/@i18n/ja/docs/concepts/payment-types/direct-xrp-payments.md b/@i18n/ja/docs/concepts/payment-types/direct-xrp-payments.md index 36eedc1da2..be61acf0a4 100644 --- a/@i18n/ja/docs/concepts/payment-types/direct-xrp-payments.md +++ b/@i18n/ja/docs/concepts/payment-types/direct-xrp-payments.md @@ -80,7 +80,7 @@ XRP Ledgerでは、支払いを受け取ることができるアドレスは永 ## 関連項目 - **チュートリアル:** - - [XRPの送金(対話型チュートリアル)](../../tutorials/tasks/send-xrp.md) + - [XRPの送金(対話型チュートリアル)](../../tutorials/how-tos/send-xrp.md) - [WebSocketを使用した着信ペイメントの監視](../../tutorials/http-websocket-apis/monitor-incoming-payments-with-websocket.md) - **リファレンス:** - [Paymentトランザクション][] diff --git a/@i18n/ja/docs/concepts/payment-types/escrow.md b/@i18n/ja/docs/concepts/payment-types/escrow.md index bb99ec30ff..3eeeb54c84 100644 --- a/@i18n/ja/docs/concepts/payment-types/escrow.md +++ b/@i18n/ja/docs/concepts/payment-types/escrow.md @@ -82,7 +82,7 @@ reference_fee * (signer_count + 33 + (fulfillment_bytes / 16)) XRP LedgerのEscrowの詳細は、以下を参照してください: -- [Escrowチュートリアル](../../tutorials/tasks/use-specialized-payment-types/use-escrows/index.md) +- [Escrowチュートリアル](../../tutorials/how-tos/use-specialized-payment-types/use-escrows/index.md) - [トランザクションのリファレンス](../../references/protocol/transactions/index.md) - [EscrowCreateトランザクション][] - [EscrowFinishトランザクション][] diff --git a/@i18n/ja/docs/concepts/payment-types/payment-channels.md b/@i18n/ja/docs/concepts/payment-types/payment-channels.md index 7e3dba070b..73b164edb0 100644 --- a/@i18n/ja/docs/concepts/payment-types/payment-channels.md +++ b/@i18n/ja/docs/concepts/payment-types/payment-channels.md @@ -36,7 +36,7 @@ Payment Channelでは本来、そこで売買可能なものにいては、一 ## 関連項目 -- [Payment Channelの使用](../../tutorials/tasks/use-specialized-payment-types/use-payment-channels/index.md): Payment Channelを使用するプロセスを段階的に説明するチュートリアル。 +- [Payment Channelの使用](../../tutorials/how-tos/use-specialized-payment-types/use-payment-channels/index.md): Payment Channelを使用するプロセスを段階的に説明するチュートリアル。 - [Escrow](escrow.md): 速度が遅い、条件付きの大量XRP決済のための類似機能。 diff --git a/@i18n/ja/docs/concepts/payment-types/sending-payments-to-customers.md b/@i18n/ja/docs/concepts/payment-types/sending-payments-to-customers.md index 20d5350777..30e51dc4df 100644 --- a/@i18n/ja/docs/concepts/payment-types/sending-payments-to-customers.md +++ b/@i18n/ja/docs/concepts/payment-types/sending-payments-to-customers.md @@ -19,6 +19,6 @@ labels: - `Paths`フィールドを省略します。このフィールドは、発行元から直接送信する場合や、送信するトークンと受信するトークンの通貨コードと発行元が同じである限り、つまり同じステーブルコインである限り、ホットウォレットから設定する必要はありません。`Paths`フィールドは[クロスカレンシー支払い](cross-currency-payments.md)やより長いマルチホップ(rippling)支払いを対象としています。単純に経路探索を行い、トランザクションにパスを設定すると、直接の経路が利用できない場合、支払いは失敗するのではなく、より高価な遠回りのパスを取るかもしれません。悪意のあるユーザはこれを利用して利益を得る可能性があります。 - `tecPATH_DRY`の結果コードが表示された場合、通常、必要なトラストラインを顧客がまだ設定していないか、発行者のripplingが正しく設定されていないことを意味します -XRP Ledger上でステーブルコインやその他のトークンを発行するための詳しいチュートリアルは、[代替可能トークンの発行](../../tutorials/tasks/use-tokens/issue-a-fungible-token.md)をご覧ください。 +XRP Ledger上でステーブルコインやその他のトークンを発行するための詳しいチュートリアルは、[代替可能トークンの発行](../../tutorials/how-tos/use-tokens/issue-a-fungible-token.md)をご覧ください。 {% raw-partial file="/docs/_snippets/common-links.md" /%} diff --git a/@i18n/ja/docs/concepts/tokens/decentralized-exchange/index.md b/@i18n/ja/docs/concepts/tokens/decentralized-exchange/index.md index 50325b19ee..945df082ab 100644 --- a/@i18n/ja/docs/concepts/tokens/decentralized-exchange/index.md +++ b/@i18n/ja/docs/concepts/tokens/decentralized-exchange/index.md @@ -10,7 +10,7 @@ seo: XRP Ledgerには、世界でおそらく最も古い _分散型取引所_ (「DEX」と略されることもあります)があり、2012年のXRP Ledgerのローンチ以来、現在まで稼働し続けています。この取引所では、ユーザーが[トークン](../index.md)をXRPや他のトークンと売買することができ、ネットワーク自体に課される[手数料](../../transactions/fees.md)はごく僅かです。(いかなる当事者にも支払われることはありません) -**注意:** 誰でも好きな通貨コードやティッカーシンボルで[トークンを発行](../../../tutorials/tasks/use-tokens/issue-a-fungible-token.md)して、分散型取引所で販売することができます。トークンを購入する前に必ずデューデリジェンスを行い、発行者に注意を払うようにしてください。さもなければ、価値あるものを手放し、それと引き換えに価値のないトークンを受け取ることになるかもしれません。 +**注意:** 誰でも好きな通貨コードやティッカーシンボルで[トークンを発行](../../../tutorials/how-tos/use-tokens/issue-a-fungible-token.md)して、分散型取引所で販売することができます。トークンを購入する前に必ずデューデリジェンスを行い、発行者に注意を払うようにしてください。さもなければ、価値あるものを手放し、それと引き換えに価値のないトークンを受け取ることになるかもしれません。 ## 構造 diff --git a/@i18n/ja/docs/concepts/tokens/fungible-tokens/freezes.md b/@i18n/ja/docs/concepts/tokens/fungible-tokens/freezes.md index 8cbe4d9903..71b6a6250d 100644 --- a/@i18n/ja/docs/concepts/tokens/fungible-tokens/freezes.md +++ b/@i18n/ja/docs/concepts/tokens/fungible-tokens/freezes.md @@ -87,9 +87,9 @@ No Freeze設定は、アドレスのマスターキーのシークレットキ - **コンセプト:** - [トラストラインとトークンの発行](index.md) - **Tutorials:** - - [No Freezeを有効化](../../../tutorials/tasks/use-tokens/enable-no-freeze.md) - - [Global Freezeの実行](../../../tutorials/tasks/use-tokens/enact-global-freeze.md) - - [トラストラインの凍結](../../../tutorials/tasks/use-tokens/freeze-a-trust-line.md) + - [No Freezeを有効化](../../../tutorials/how-tos/use-tokens/enable-no-freeze.md) + - [Global Freezeの実行](../../../tutorials/how-tos/use-tokens/enact-global-freeze.md) + - [トラストラインの凍結](../../../tutorials/how-tos/use-tokens/freeze-a-trust-line.md) - **References:** - [account_linesメソッド][] - [account_infoメソッド][] diff --git a/@i18n/ja/docs/concepts/tokens/fungible-tokens/stablecoins/configuration.md b/@i18n/ja/docs/concepts/tokens/fungible-tokens/stablecoins/configuration.md index f39beb13af..fc1c27452f 100644 --- a/@i18n/ja/docs/concepts/tokens/fungible-tokens/stablecoins/configuration.md +++ b/@i18n/ja/docs/concepts/tokens/fungible-tokens/stablecoins/configuration.md @@ -8,7 +8,7 @@ labels: --- # ステーブルコイン発行者の設定 -トークンの発行を始める前に、XRP Ledgerアカウントで設定する必要がある項目がいくつかあります。これらの設定の例については、[代替可能トークンの発行](../../../../tutorials/tasks/use-tokens/issue-a-fungible-token.md)をご覧ください。 +トークンの発行を始める前に、XRP Ledgerアカウントで設定する必要がある項目がいくつかあります。これらの設定の例については、[代替可能トークンの発行](../../../../tutorials/how-tos/use-tokens/issue-a-fungible-token.md)をご覧ください。 設定すべき項目は以下の通りです。 diff --git a/@i18n/ja/docs/concepts/tokens/index.md b/@i18n/ja/docs/concepts/tokens/index.md index 8bf92eec83..f9df4c84f2 100644 --- a/@i18n/ja/docs/concepts/tokens/index.md +++ b/@i18n/ja/docs/concepts/tokens/index.md @@ -54,7 +54,7 @@ XRP Ledgerにおけるトークンは、[XRPと異なる性質](../../references 発行者は、ユーザがトークンを送金する際に自動で差し引かれる「送金手数料」(transfer-fees.html)を設定することができます。発行者は、自分のトークンを含む取引レートの[ティックサイズ](decentralized-exchange/ticksize.md)を定義することもできます。発行者と一般アカウントのどちらも、トラストラインを[凍結](fungible-tokens/freezes.md)することができ、トラストライン内のトークンの使用方法を制限することができます。( XRPにはこのいずれも適用されません。) -トークン発行の技術的な手順については、[代替可能トークンの発行](../../tutorials/tasks/use-tokens/issue-a-fungible-token.md) を参照してください。 +トークン発行の技術的な手順については、[代替可能トークンの発行](../../tutorials/how-tos/use-tokens/issue-a-fungible-token.md) を参照してください。 ## 関連項目 @@ -63,10 +63,10 @@ XRP Ledgerにおけるトークンは、[XRPと異なる性質](../../references - [クロスカレンシー支払い](../payment-types/cross-currency-payments.md) - [分散型取引所](decentralized-exchange/index.md) - **チュートリアル:** - - [代替可能トークンの発行](../../tutorials/tasks/use-tokens/issue-a-fungible-token.md) + - [代替可能トークンの発行](../../tutorials/how-tos/use-tokens/issue-a-fungible-token.md) - [XRP Ledgerゲートウェイの開設](../../use-cases/tokenization/stablecoin-issuer.md) - [トランザクションの結果の確認](../transactions/finality-of-results/look-up-transaction-results.md) - - [専門化した支払いタイプの使用](../../tutorials/tasks/use-specialized-payment-types/index.md) + - [専門化した支払いタイプの使用](../../tutorials/how-tos/use-specialized-payment-types/index.md) - **リファレンス:** - [Paymentトランザクション][] - [TrustSetトランザクション][] diff --git a/@i18n/ja/docs/concepts/tokens/nfts/batch-minting.md b/@i18n/ja/docs/concepts/tokens/nfts/batch-minting.md index 19a5350627..1671a6bfb8 100644 --- a/@i18n/ja/docs/concepts/tokens/nfts/batch-minting.md +++ b/@i18n/ja/docs/concepts/tokens/nfts/batch-minting.md @@ -28,7 +28,7 @@ NFTokenオブジェクトの初回販売以前の市場活動は、XRP Ledgerに プログラムまたはスクリプトを使用して、一度に多数のトークンをMintします。[チケット](../../accounts/tickets.md)を使えば、1度に200件までのトランザクションを並行して処理することができます。 -実用例としては、チュートリアルの[JavaScriptでNFTをバッチMint](../../../tutorials/javascript/modular-tutorials/nfts/batch-mint-nfts.md)をご覧ください +実用例としては、チュートリアルの[JavaScriptでNFTをバッチMint](../../../tutorials/javascript/nfts/batch-mint-nfts.md)をご覧ください ### メリット diff --git a/@i18n/ja/docs/concepts/tokens/nfts/guaranteeing-a-fixed-supply.md b/@i18n/ja/docs/concepts/tokens/nfts/guaranteeing-a-fixed-supply.md index c8f280b909..abd5426978 100644 --- a/@i18n/ja/docs/concepts/tokens/nfts/guaranteeing-a-fixed-supply.md +++ b/@i18n/ja/docs/concepts/tokens/nfts/guaranteeing-a-fixed-supply.md @@ -16,7 +16,7 @@ labels: 1. `AccountSet`を使用して、自分の運用するウォレットを発行者の認可Minterとして割り当てます。[代理Mint](authorizing-another-minter.md)を参照してください。 1. 運用アカウントで`NFTokenMint`を使ってトークンをミントします。運用中のウォレットには、発行者のためにMintされたすべてのトークンが保管されます。[Mintのバッチ処理](batch-minting.md)をご覧ください 1. 発行者の認可Minterである自分の運用するウォレットを削除するために、`AccountSet`を使用します。 -1. 発行者アカウントを"ブラックホール化"する。[マスターキーペアの無効化](../../../tutorials/tasks/manage-account-settings/disable-master-key-pair.md)をご覧ください。 +1. 発行者アカウントを"ブラックホール化"する。[マスターキーペアの無効化](../../../tutorials/how-tos/manage-account-settings/disable-master-key-pair.md)をご覧ください。 この時点で、発行者のアドレスを発行アカウントとする新たなトークンのミントは不可能となります。 diff --git a/@i18n/ja/docs/concepts/transactions/index.md b/@i18n/ja/docs/concepts/transactions/index.md index 18d48a4613..b6a7ad636c 100644 --- a/@i18n/ja/docs/concepts/transactions/index.md +++ b/@i18n/ja/docs/concepts/transactions/index.md @@ -65,7 +65,7 @@ XRP Ledgerにトランザクションを送信するには、いくつかの手 5. `rippled`サーバーはそれらのトランザクションを正規順序で前のレジャーに適用し、それらの結果を共有します。 6. 十分に[信頼できるバリデータ](../networks-and-servers/rippled-server-modes.md#バリデータ)がまったく同じレジャーを作成した場合、そのレジャーは _検証済み_ であると宣言され、そのレジャーの[トランザクションの結果](../../references/protocol/transactions/transaction-results/transaction-results.md)は不変となります。 -XRP決済の送信に関する対話型チュートリアルについては、[Send XRP](../../tutorials/tasks/send-xrp.md)を参照してください。 +XRP決済の送信に関する対話型チュートリアルについては、[Send XRP](../../tutorials/how-tos/send-xrp.md)を参照してください。 ### 未署名のトランザクションの例 @@ -205,9 +205,9 @@ XRP Ledgerは、トランザクションオブジェクトが送信元アドレ - [支払いタイプ](../payment-types/index.md) - **チュートリアル:** - [安全な署名の設定](secure-signing.md) - - [XRPの送金](../../tutorials/tasks/send-xrp.md) + - [XRPの送金](../../tutorials/how-tos/send-xrp.md) - [トランザクションの結果の確認](finality-of-results/look-up-transaction-results.md) - - [WebSocketを使用した着信ペイメントの監視](../../tutorials/http-websocket-apis/monitor-incoming-payments-with-websocket.md) + - [WebSocketを使用した着信ペイメントの監視](../../tutorials/http-websocket-apis/build-apps/monitor-incoming-payments-with-websocket.md) - [トランザクションの取り消しまたはスキップ](finality-of-results/canceling-a-transaction.md) - [信頼できるトランザクションの送信](reliable-transaction-submission.md) - **リファレンス:** diff --git a/@i18n/ja/docs/concepts/transactions/reliable-transaction-submission.md b/@i18n/ja/docs/concepts/transactions/reliable-transaction-submission.md index f4f6e23271..bacfbd2ff4 100644 --- a/@i18n/ja/docs/concepts/transactions/reliable-transaction-submission.md +++ b/@i18n/ja/docs/concepts/transactions/reliable-transaction-submission.md @@ -158,7 +158,7 @@ For each persisted transaction without validated result: **ヒント:** [`AccountTxnID`フィールド](../../references/protocol/transactions/common-fields.md#accounttxnid)を使用すると、このような状況で冗長的なトランザクションが成功しないように防ぐことができます。 - - 不正使用者に秘密鍵を使われてトランザクションを送信された場合。その場合は、可能であれば[キーペアをローテーション](../../tutorials/tasks/manage-account-settings/change-or-remove-a-regular-key-pair.md)して、送信された他のトランザクションを確認します。また、ネットワークを監査して、その秘密鍵が大規模な侵入やセキュリティ侵害に関係していたかどうかを判断する必要があります。キーペアのローテーションに成功して、不正使用者がアカウントやシステムにアクセスできなくなったら、通常のアクティビティーを再開します。 + - 不正使用者に秘密鍵を使われてトランザクションを送信された場合。その場合は、可能であれば[キーペアをローテーション](../../tutorials/how-tos/manage-account-settings/change-or-remove-a-regular-key-pair.md)して、送信された他のトランザクションを確認します。また、ネットワークを監査して、その秘密鍵が大規模な侵入やセキュリティ侵害に関係していたかどうかを判断する必要があります。キーペアのローテーションに成功して、不正使用者がアカウントやシステムにアクセスできなくなったら、通常のアクティビティーを再開します。 #### レジャーのギャップ diff --git a/@i18n/ja/docs/concepts/transactions/secure-signing.md b/@i18n/ja/docs/concepts/transactions/secure-signing.md index 3606e3268c..2fdc1a4580 100644 --- a/@i18n/ja/docs/concepts/transactions/secure-signing.md +++ b/@i18n/ja/docs/concepts/transactions/secure-signing.md @@ -48,7 +48,7 @@ labels: [構成ファイルの例](https://github.com/XRPLF/rippled/blob/8429dd67e60ba360da591bfa905b58a35638fda1/cfg/rippled-example.cfg#L1050-L1073)では、ローカルループバックネットワーク上(127.0.0.1)のポート5005でJSON-RPC(HTTP)、ポート6006でWebSocket(WS)の接続をリッスンし、接続されるすべてのクライアントを管理者として扱っています。 - **注意:** 署名に[コマンドラインAPI](../../references/http-websocket-apis/api-conventions/request-formatting.md#コマンドライン形式)を使用する場合は、コマンドラインでないクライアントで[Websocket APIやJSON-RPC APIを使用](../../tutorials/http-websocket-apis/get-started.md)する場合よりもセキュリティが弱くなります。コマンドライン構文を使用すると、秘密鍵がシステムのプロセスリストで他のユーザーに見える可能性があり、シェル履歴にプレーンテキスト形式でキーが保存される可能性があります。 + **注意:** 署名に[コマンドラインAPI](../../references/http-websocket-apis/api-conventions/request-formatting.md#コマンドライン形式)を使用する場合は、コマンドラインでないクライアントで[Websocket APIやJSON-RPC APIを使用](../../tutorials/http-websocket-apis/build-apps/get-started.md)する場合よりもセキュリティが弱くなります。コマンドライン構文を使用すると、秘密鍵がシステムのプロセスリストで他のユーザーに見える可能性があり、シェル履歴にプレーンテキスト形式でキーが保存される可能性があります。 3. サーバーの使用中は、稼働状態と最新状態を維持して、ネットワークと同期されるようにしておく必要があります。 @@ -139,7 +139,7 @@ labels: - [マルチシグ](../accounts/multi-signing.md) - **チュートリアル:** - [rippledのインストール](../../infrastructure/installation/index.md) - - [レギュラーキーペアの割り当て](../../tutorials/tasks/manage-account-settings/assign-a-regular-key-pair.md) + - [レギュラーキーペアの割り当て](../../tutorials/how-tos/manage-account-settings/assign-a-regular-key-pair.md) - [信頼できるトランザクションの送信](reliable-transaction-submission.md) - [パブリック署名の有効化](../../infrastructure/configuration/enable-public-signing.md) - **リファレンス:** diff --git a/@i18n/ja/docs/concepts/transactions/source-and-destination-tags.md b/@i18n/ja/docs/concepts/transactions/source-and-destination-tags.md index ae946371d4..e1569e6ecb 100644 --- a/@i18n/ja/docs/concepts/transactions/source-and-destination-tags.md +++ b/@i18n/ja/docs/concepts/transactions/source-and-destination-tags.md @@ -42,12 +42,12 @@ _送信元タグ_と_宛先タグ_は、XRP Ledgerの[支払い](../payment-type ## タグの必須化 -複数の顧客口座への支払いを受け取る可能性があるXRP Ledgerアドレスにとって、宛先タグなしで支払いを受け取ることは問題です。どの顧客に入金すべきかがすぐに分からないため、手作業が必要になったり、誰が受取人であったかを特定するために送金者とやり取りをしなければならなくなったりします。このようなケースを減らすために、[`RequireDest`設定を有効にする](../../tutorials/tasks/manage-account-settings/require-destination-tags.md)ことができます。そうすることで、もしユーザが支払先にタグを設定し忘れた場合、XRP Ledgerはその支払いを拒否します。その後、ユーザはそのタグを使って再度支払いを行うことができます。 +複数の顧客口座への支払いを受け取る可能性があるXRP Ledgerアドレスにとって、宛先タグなしで支払いを受け取ることは問題です。どの顧客に入金すべきかがすぐに分からないため、手作業が必要になったり、誰が受取人であったかを特定するために送金者とやり取りをしなければならなくなったりします。このようなケースを減らすために、[`RequireDest`設定を有効にする](../../tutorials/how-tos/manage-account-settings/require-destination-tags.md)ことができます。そうすることで、もしユーザが支払先にタグを設定し忘れた場合、XRP Ledgerはその支払いを拒否します。その後、ユーザはそのタグを使って再度支払いを行うことができます。 ## 関連項目 -- [宛先タグの必須化](../../tutorials/tasks/manage-account-settings/require-destination-tags.md) +- [宛先タグの必須化](../../tutorials/how-tos/manage-account-settings/require-destination-tags.md) - [支払いのタイプ](../payment-types/index.md) {% raw-partial file="/docs/_snippets/common-links.md" /%} diff --git a/@i18n/ja/docs/infrastructure/configuration/configure-amendment-voting.md b/@i18n/ja/docs/infrastructure/configuration/configure-amendment-voting.md index c9b7e4e6a5..2ea76821c4 100644 --- a/@i18n/ja/docs/infrastructure/configuration/configure-amendment-voting.md +++ b/@i18n/ja/docs/infrastructure/configuration/configure-amendment-voting.md @@ -9,7 +9,7 @@ labels: --- # Amendment投票機能の設定 -バリデーターとして設定されたサーバーは、[feature メソッド][]を使ってXRP Ledgerプロトコルの[Amendment](../../concepts/networks-and-servers/amendments.md)に投票することができます。(この方法には[管理者アクセス](../../tutorials/http-websocket-apis/get-started.md#管理者アクセス権限)が必要です). +バリデーターとして設定されたサーバーは、[feature メソッド][]を使ってXRP Ledgerプロトコルの[Amendment](../../concepts/networks-and-servers/amendments.md)に投票することができます。(この方法には[管理者アクセス](../../tutorials/http-websocket-apis/build-apps/get-started.md#管理者アクセス権限)が必要です). 例えば、「SHAMapV2」Amendmentに反対票を投じるには、以下のコマンドを実行します。 diff --git a/@i18n/ja/docs/infrastructure/configuration/configure-grpc.md b/@i18n/ja/docs/infrastructure/configuration/configure-grpc.md index 1b83b73e8d..2c84ca158a 100644 --- a/@i18n/ja/docs/infrastructure/configuration/configure-grpc.md +++ b/@i18n/ja/docs/infrastructure/configuration/configure-grpc.md @@ -49,7 +49,7 @@ gRPCを有効にするには、次の前提条件を満たす必要がありま - [XRP Ledgerの概要](/about/) - [`rippled`サーバのモード](../../concepts/networks-and-servers/rippled-server-modes.md) - **チュートリアル:** - - [HTTP / WebSocketAPIを使ってみる](../../tutorials/http-websocket-apis/get-started.md) + - [HTTP / WebSocketAPIを使ってみる](../../tutorials/http-websocket-apis/build-apps/get-started.md) - [信頼できるトランザクションの送信](../../concepts/transactions/reliable-transaction-submission.md) - [rippledサーバの管理](../installation/install-rippled-on-ubuntu.md) - **リファレンス:** diff --git a/@i18n/ja/docs/infrastructure/configuration/data-retention/configure-advisory-deletion.md b/@i18n/ja/docs/infrastructure/configuration/data-retention/configure-advisory-deletion.md index 367706b52e..cc72b0f7d9 100644 --- a/@i18n/ja/docs/infrastructure/configuration/data-retention/configure-advisory-deletion.md +++ b/@i18n/ja/docs/infrastructure/configuration/data-retention/configure-advisory-deletion.md @@ -57,7 +57,7 @@ labels: 2. サーバーに対してオンライン削除を指示する[can_deleteメソッド][]の実行をテストします。 - このコマンドの実行には[`rippled`コマンドラインインターフェイス](../../../tutorials/http-websocket-apis/get-started.md#コマンドライン)を使用できます。例: + このコマンドの実行には[`rippled`コマンドラインインターフェイス](../../../tutorials/http-websocket-apis/build-apps/get-started.md#コマンドライン)を使用できます。例: ``` $ rippled --conf=/etc/opt/ripple/rippled.cfg can_delete now diff --git a/@i18n/ja/docs/infrastructure/configuration/enable-public-signing.md b/@i18n/ja/docs/infrastructure/configuration/enable-public-signing.md index 3546d2560f..53d9cab740 100644 --- a/@i18n/ja/docs/infrastructure/configuration/enable-public-signing.md +++ b/@i18n/ja/docs/infrastructure/configuration/enable-public-signing.md @@ -11,7 +11,7 @@ labels: {% badge href="https://github.com/XRPLF/rippled/releases/tag/1.1.0" %}新規: rippled 1.1.0{% /badge %}デフォルトでは、`rippled`の署名メソッドは管理者接続に限定されています。v1.1.0以前のバージョンの`rippled`のように、署名メソッドをパブリックAPIメソッドとして使用できるようにするには、構成を変更することで、これを使用できるようにします。 -これにより、サーバーが「パブリック」[JSON-RPC接続およびWebSocket接続](../../tutorials/http-websocket-apis/get-started.md)を受け入れる場合は、これらのパブリック接続で以下のメソッドが使用できるようになります。 +これにより、サーバーが「パブリック」[JSON-RPC接続およびWebSocket接続](../../tutorials/http-websocket-apis/build-apps/get-started.md)を受け入れる場合は、これらのパブリック接続で以下のメソッドが使用できるようになります。 - [sign][signメソッド] - [sign_for][sign_forメソッド] diff --git a/@i18n/ja/docs/infrastructure/installation/install-rippled-on-centos-rhel-with-yum.md b/@i18n/ja/docs/infrastructure/installation/install-rippled-on-centos-rhel-with-yum.md index d5f3ffe4c5..f237c0dee7 100644 --- a/@i18n/ja/docs/infrastructure/installation/install-rippled-on-centos-rhel-with-yum.md +++ b/@i18n/ja/docs/infrastructure/installation/install-rippled-on-centos-rhel-with-yum.md @@ -80,7 +80,7 @@ labels: - **チュートリアル:** - [rippledの構成](../configuration/index.md) - [rippledのトラブルシューティング](../troubleshooting/index.md) - - [rippled APIの使用開始](../../tutorials/http-websocket-apis/get-started.md) + - [rippled APIの使用開始](../../tutorials/http-websocket-apis/build-apps/get-started.md) - **リファレンス:** - [rippled APIリファレンス](../../references/http-websocket-apis/index.md) - [`rippled`コマンドラインの使用](../commandline-usage.md) diff --git a/@i18n/ja/docs/infrastructure/troubleshooting/fix-sqlite-tx-db-page-size-issue.md b/@i18n/ja/docs/infrastructure/troubleshooting/fix-sqlite-tx-db-page-size-issue.md index bdd4fab315..f42342af8b 100644 --- a/@i18n/ja/docs/infrastructure/troubleshooting/fix-sqlite-tx-db-page-size-issue.md +++ b/@i18n/ja/docs/infrastructure/troubleshooting/fix-sqlite-tx-db-page-size-issue.md @@ -182,7 +182,7 @@ Terminating thread doJob:AcquisitionDone: unhandled 11. `rippled`サービスが正常に起動したかどうかを確認します。 - [コマンドラインインターフェイス](../../tutorials/http-websocket-apis/get-started.md#コマンドライン)を使用してサーバーの状況を確認できます(サーバーがJSON-RPCリクエストを受け入れないように設定している場合を除く)。次に例を示します。 + [コマンドラインインターフェイス](../../tutorials/http-websocket-apis/build-apps/get-started.md#コマンドライン)を使用してサーバーの状況を確認できます(サーバーがJSON-RPCリクエストを受け入れないように設定している場合を除く)。次に例を示します。 ``` /opt/ripple/bin/rippled server_info diff --git a/@i18n/ja/docs/references/client-libraries.md b/@i18n/ja/docs/references/client-libraries.md index 3da222ecac..1d6fed9867 100644 --- a/@i18n/ja/docs/references/client-libraries.md +++ b/@i18n/ja/docs/references/client-libraries.md @@ -12,10 +12,10 @@ seo: | 言語 | ライブラリ名 | Get Started | APIリファレンス | ソースコード | |---------------------------------|------------------------|--------------|---------------|-------------| -| **Python** | `xrpl-py` | [Pythonを使ってみよう](../tutorials/python/get-started.md) | [API リファレンス](https://xrpl-py.readthedocs.io/) | [リポジトリ](https://github.com/XRPLF/xrpl-py) | -| **JavaScript** / **TypeScript** | `xrpl.js` | [JavaScriptを使ってみよう](../tutorials/javascript/get-started.md) | [API リファレンス](https://js.xrpl.org/) | [リポジトリ](https://github.com/XRPLF/xrpl.js) | +| **Python** | `xrpl-py` | [Pythonを使ってみよう](../tutorials/python/build-apps/get-started.md) | [API リファレンス](https://xrpl-py.readthedocs.io/) | [リポジトリ](https://github.com/XRPLF/xrpl-py) | +| **JavaScript** / **TypeScript** | `xrpl.js` | [JavaScriptを使ってみよう](../tutorials/javascript/build-apps/get-started.md) | [API リファレンス](https://js.xrpl.org/) | [リポジトリ](https://github.com/XRPLF/xrpl.js) | | **JavaScript** / **TypeScript** | `xrpl-client` | [触ってみる](https://jsfiddle.net/WietseWind/35az6p1b/) | [NPM リファレンス](https://www.npmjs.com/package/xrpl-client) | [リポジトリ](https://github.com/XRPL-Labs/xrpl-client) | | **JavaScript** / **TypeScript** | `xrpl-accountlib` | [触ってみる](https://jsfiddle.net/WietseWind/gkefpnu0/) | [NPM リファレンス](https://www.npmjs.com/package/xrpl-accountlib) | [リポジトリ](https://github.com/WietseWind/xrpl-accountlib) | | **C++** | `rippled` 署名ライブラリ | [署名ライブラリを使ってみよう](https://github.com/XRPLF/rippled/tree/develop/Builds/linux#signing-library) | | ([`rippled`](https://github.com/XRPLF/rippled/))の一部 | -| **Java** | `xrpl4j` | [Javaを使ってみよう](../tutorials/java/get-started.md) | [API リファレンス](https://javadoc.io/doc/org.xrpl/) | [リポジトリ](https://github.com/XRPLF/xrpl4j) | -| **PHP** | `XRPL_PHP` | [PHPを使ってみよう](../tutorials/php/get-started.md) | [XRPL_PHP ドキュメント](https://alexanderbuzz.github.io/xrpl-php-docs/) | [リポジトリ](https://github.com/AlexanderBuzz/xrpl-php) | +| **Java** | `xrpl4j` | [Javaを使ってみよう](../tutorials/java/build-apps/get-started.md) | [API リファレンス](https://javadoc.io/doc/org.xrpl/) | [リポジトリ](https://github.com/XRPLF/xrpl4j) | +| **PHP** | `XRPL_PHP` | [PHPを使ってみよう](../tutorials/php/build-apps/get-started.md) | [XRPL_PHP ドキュメント](https://alexanderbuzz.github.io/xrpl-php-docs/) | [リポジトリ](https://github.com/AlexanderBuzz/xrpl-php) | diff --git a/@i18n/ja/docs/references/data-api.md b/@i18n/ja/docs/references/data-api.md index 96484be3bd..7bf485ba87 100644 --- a/@i18n/ja/docs/references/data-api.md +++ b/@i18n/ja/docs/references/data-api.md @@ -14,6 +14,6 @@ nav_omit: true ## Alternatives -アカウント残高や取引履歴のリクエストなど、ほとんどの一般的な操作では、[WebSocket接続](../tutorials/http-websocket-apis/get-started.md#websocket-api)または[JSON-RPC(HTTP POST)](../tutorials/http-websocket-apis/get-started.md#json-rpc)を使用して、セルフホストまたは[公開XRP Ledgerサーバー](../tutorials/public-servers.md)にリクエストすることとができます。 +アカウント残高や取引履歴のリクエストなど、ほとんどの一般的な操作では、[WebSocket接続](../tutorials/http-websocket-apis/get-started.md#websocket-api)または[JSON-RPC(HTTP POST)](../tutorials/http-websocket-apis/build-apps/get-started.md#json-rpc)を使用して、セルフホストまたは[公開XRP Ledgerサーバー](../tutorials/public-servers.md)にリクエストすることとができます。 -詳細については、[HTTP / WebSocket APIsの使用を開始する](../tutorials/http-websocket-apis/get-started.md)ページをご覧ください。 +詳細については、[HTTP / WebSocket APIsの使用を開始する](../tutorials/http-websocket-apis/build-apps/get-started.md)ページをご覧ください。 diff --git a/@i18n/ja/docs/references/http-websocket-apis/admin-api-methods/index.md b/@i18n/ja/docs/references/http-websocket-apis/admin-api-methods/index.md index 1f63f7d7d2..288ddb1b0f 100644 --- a/@i18n/ja/docs/references/http-websocket-apis/admin-api-methods/index.md +++ b/@i18n/ja/docs/references/http-websocket-apis/admin-api-methods/index.md @@ -10,7 +10,7 @@ labels: `rippled`サーバーと直接通信する際には管理APIメソッドを使用します。管理メソッドは、信頼できるサーバー運用担当者のみを対象としています。管理メソッドには、サーバーの管理、監視、デバッグのためのコマンドが含まれています。 -管理コマンドを使用できるのは、管理者として、`rippled.cfg`ファイルに指定されているホストとポートで`rippled`サーバーに接続している場合に限られます。デフォルトでは、コマンドラインクライアントが管理接続を使用します。`rippled`への接続についての詳細は、[rippled API入門](../../../tutorials/http-websocket-apis/get-started.md)を参照してください。 +管理コマンドを使用できるのは、管理者として、`rippled.cfg`ファイルに指定されているホストとポートで`rippled`サーバーに接続している場合に限られます。デフォルトでは、コマンドラインクライアントが管理接続を使用します。`rippled`への接続についての詳細は、[rippled API入門](../../../tutorials/http-websocket-apis/build-apps/get-started.md)を参照してください。 ## [キー生成メソッド](key-generation-methods/index.md) diff --git a/@i18n/ja/docs/references/http-websocket-apis/api-conventions/rate-limiting.md b/@i18n/ja/docs/references/http-websocket-apis/api-conventions/rate-limiting.md index 06db003033..aa25dcc12e 100644 --- a/@i18n/ja/docs/references/http-websocket-apis/api-conventions/rate-limiting.md +++ b/@i18n/ja/docs/references/http-websocket-apis/api-conventions/rate-limiting.md @@ -10,7 +10,7 @@ labels: `rippled`サーバはAPIクライアントが公開APIにリクエストできるレートを制限できます。レート制限はクライアントのIPアドレスに基づいて行われるため、[ネットワークアドレス変換](https://ja.wikipedia.org/wiki/ネットワークアドレス変換)の背後にいるクライアントは公開IPアドレスに基づく制限を共有します。 -**ヒント:** レート制限は、クライアントが[管理者](../../../tutorials/http-websocket-apis/get-started.md#管理者アクセス権限)として接続されているときには適用されません +**ヒント:** レート制限は、クライアントが[管理者](../../../tutorials/http-websocket-apis/build-apps/get-started.md#管理者アクセス権限)として接続されているときには適用されません クライアントがレート制限に近づいている場合、サーバーは[APIレスポンス](response-formatting.md)のトップレベルにフィールド`"warning": "load"`というフィールドを[APIレスポンス](response-formatting.md)のトップレベルに追加します。この警告はすべてのレスポンスに追加されるわけではありませんが、サーバはクライアントを切断する前に何度かこのような警告を送ることがあります。 @@ -58,7 +58,7 @@ Server is overloaded - [`rippled`サーバ](../../../concepts/networks-and-servers/index.md) - [ソフトウェアエコシステム](../../../introduction/software-ecosystem.md) - **チュートリアル:** - - [XRP Ledger APIの使用開始](../../../tutorials/http-websocket-apis/get-started.md) + - [XRP Ledger APIの使用開始](../../../tutorials/http-websocket-apis/build-apps/get-started.md) - [rippledのトラブルシューティング](../../../infrastructure/troubleshooting/index.md) - **リファレンス:** - [rippled APIリファレンス](../index.md) diff --git a/@i18n/ja/docs/references/http-websocket-apis/public-api-methods/account-methods/account_info.md b/@i18n/ja/docs/references/http-websocket-apis/public-api-methods/account-methods/account_info.md index f54654d3e0..73b4f26784 100644 --- a/@i18n/ja/docs/references/http-websocket-apis/public-api-methods/account-methods/account_info.md +++ b/@i18n/ja/docs/references/http-websocket-apis/public-api-methods/account-methods/account_info.md @@ -227,7 +227,7 @@ rippled account_info rG1QQv2nh2gr7RCZ1P8YYcBUKCCN633jCn validated | `noFreeze` | 真偽値 | `true`の場合、このアカウントは個々のトラストラインを凍結したり、グローバル凍結を行う機能を永久に放棄しています。詳細は[No Freeze](../../../../concepts/tokens/fungible-tokens/freezes.md#no-freeze)をご覧ください。 | | `passwordSpent` | 真偽値 | `false`の場合、このアカウントはトランザクションコスト0の特別な[キーリセットトランザクション](../../../../concepts/transactions/transaction-cost.md#key-resetトランザクション)を送信できます。プロトコルはこのフラグを自動的にオン/オフします。 | | `requireAuthorization` | 真偽値 | `true`の場合、このアカウントは[認可トラストライン](../../../../concepts/tokens/fungible-tokens/authorized-trust-lines.md)を使って、発行するトークンを保持できる人を制限しています。 | -| `requireDestinationTag` | 真偽値 | `true`の場合、このアカウントは受け取るすべての支払いに[宛先タグ](../../../../tutorials/tasks/manage-account-settings/require-destination-tags.md)をリクエストしています。 | +| `requireDestinationTag` | 真偽値 | `true`の場合、このアカウントは受け取るすべての支払いに[宛先タグ](../../../../tutorials/how-tos/manage-account-settings/require-destination-tags.md)をリクエストしています。 | `queue_data`パラメーターが存在する場合、以下のフィールドが含まれます。 diff --git a/@i18n/ja/docs/references/protocol/transactions/types/accountset.md b/@i18n/ja/docs/references/protocol/transactions/types/accountset.md index 0e04dfc723..4bbb1cfd5d 100644 --- a/@i18n/ja/docs/references/protocol/transactions/types/accountset.md +++ b/@i18n/ja/docs/references/protocol/transactions/types/accountset.md @@ -36,7 +36,7 @@ AccountSetトランザクションは、[XRP Ledgerのアカウント](../../led | [`Domain`](#domain) | 文字列 | Blob | _(省略可)_ このアカウントを保有するドメインのASCII小文字を表現する16進文字列。[256バイトを超える長さは使用できません。](https://github.com/XRPLF/rippled/blob/55dc7a252e08a0b02cd5aa39e9b4777af3eafe77/src/ripple/app/tx/impl/SetAccount.h#L34) | | `EmailHash` | 文字列 | Hash128 | _(省略可)_ アバターイメージの生成に使用されるメールアドレスのハッシュ。一般的に、クライアントは[Gravatar](http://en.gravatar.com/site/implement/hash/)を使用してこのイメージを表示しています。 | | `MessageKey` | 文字列 | Blob | _(省略可)_ 暗号化されたメッセージをこのアカウントに送信するための公開鍵です。キーを設定するには、正確に33バイトである必要があり、最初のバイトはキーの種類を示します。secp256k1鍵の場合は`0x02`または`0x03`、Ed25519鍵の場合は`0xED`です。キーを削除するには、空の値を使用します。 | -| `NFTokenMinter` | 文字列 | Blob | _(省略可)_ あなたのために[NFTokensをミントする](../../../../tutorials/javascript/modular-tutorials/nfts/assign-an-authorized-minter.md)ことができる別のアカウント。 _([NonFungibleTokensV1_1 amendment][]により追加されました.)_ | +| `NFTokenMinter` | 文字列 | Blob | _(省略可)_ あなたのために[NFTokensをミントする](../../../../tutorials/javascript/nfts/assign-an-authorized-minter.md)ことができる別のアカウント。 _([NonFungibleTokensV1_1 amendment][]により追加されました.)_ | | [`SetFlag`](#accountsetのフラグ) | 数値 | UInt32 | _(省略可)_ このアカウントについてオプションを有効にするための整数フラグ。 | | [`TransferRate`](#transferrate) | 符号なし整数 | UInt32 | _(省略可)_ ユーザーがこのアカウントのトークンを送金するときに請求される手数料。通貨単位の10億分の1で表現されます。手数料なしを意味する特殊なケースの`0`を除いて、`2000000000`より大きくしたり、`1000000000`より小さくしたりすることはできません。 | | [`TickSize`](../../../../concepts/tokens/decentralized-exchange/ticksize.md) | 符号なし整数 | UInt8 | _(省略可)_このアドレスによって発行されている通貨が関係するオファーに使用する為替レートの呼値の単位。それらのオファーの為替レートは、この有効桁数へと丸められます。有効な値は`3`から`15`、または無効にするための`0`です_([TickSize Amendment][]により追加されました)。_ | diff --git a/@i18n/ja/docs/references/protocol/transactions/types/setregularkey.md b/@i18n/ja/docs/references/protocol/transactions/types/setregularkey.md index f8ec9b034f..0fdf518127 100644 --- a/@i18n/ja/docs/references/protocol/transactions/types/setregularkey.md +++ b/@i18n/ja/docs/references/protocol/transactions/types/setregularkey.md @@ -37,7 +37,7 @@ labels: レギュラーキーペアとマスターキーペアの詳細は、[暗号鍵](../../../../concepts/accounts/cryptographic-keys.md)を参照してください。 -アカウントへのレギュラーキーペアの割り当てについてのチュートリアルは、[レギュラーキーペアの操作](../../../../tutorials/tasks/manage-account-settings/assign-a-regular-key-pair.md)を参照してください。 +アカウントへのレギュラーキーペアの割り当てについてのチュートリアルは、[レギュラーキーペアの操作](../../../../tutorials/how-tos/manage-account-settings/assign-a-regular-key-pair.md)を参照してください。 セキュリティを強化するために[マルチシグ](../../../../concepts/accounts/multi-signing.md)を使用できますが、マルチシグを使用する場合には[トランザクションコスト][]および[準備金](../../../../concepts/accounts/reserves.md)に追加のXRPが必要となります。 diff --git a/@i18n/ja/docs/tutorials/http-websocket-apis/monitor-incoming-payments-with-websocket.md b/@i18n/ja/docs/tutorials/http-websocket-apis/monitor-incoming-payments-with-websocket.md index 1e68a54083..33bb7ee44c 100644 --- a/@i18n/ja/docs/tutorials/http-websocket-apis/monitor-incoming-payments-with-websocket.md +++ b/@i18n/ja/docs/tutorials/http-websocket-apis/monitor-incoming-payments-with-websocket.md @@ -475,7 +475,7 @@ $("#tx_read").click((event) => { ## 次のステップ - [トランザクションの結果の確認](../../concepts/transactions/finality-of-results/look-up-transaction-results.md)で、トランザクションの実行内容を確認し、適切に対応するソフトウェアを構築します。 -- あなた自身のアドレスから[XRPの送金](../tasks/send-xrp.md)を試します。 +- あなた自身のアドレスから[XRPの送金](../how-tos/send-xrp.md)を試します。 - [Escrow](../../concepts/payment-types/escrow.md)、[Checks](../../concepts/payment-types/checks.md)または[Payment Channel](../../concepts/payment-types/payment-channels.md)のような高度なタイプのトランザクションの監視と着信通知へのレスポンスを試します。 diff --git a/@i18n/ja/docs/tutorials/javascript/get-started.md b/@i18n/ja/docs/tutorials/javascript/get-started.md index 23a1209166..d01257ec83 100644 --- a/@i18n/ja/docs/tutorials/javascript/get-started.md +++ b/@i18n/ja/docs/tutorials/javascript/get-started.md @@ -152,8 +152,8 @@ XRP Ledgerの[コンセンサス プロセス](../../concepts/consensus-protocol これで、`xrpl.js`を使って、XRP Ledgerに接続したり、ウォレットを生成したり、アカウントの情報を調べたりする方法がわかりました。 次のようなことも可能です。 -* [XRPの送信](../tasks/send-xrp.md). -* [代替可能トークンの発行](../tasks/use-tokens/issue-a-fungible-token.md) +* [XRPの送信](../how-tos/send-xrp.md). +* [代替可能トークンの発行](../how-tos/use-tokens/issue-a-fungible-token.md) * アカウントに[安全な署名](../../concepts/transactions/secure-signing.md) を設定する。 @@ -163,7 +163,7 @@ XRP Ledgerの[コンセンサス プロセス](../../concepts/consensus-protocol - [XRP Ledger Overview](/about/) - [クライアントライブラリ](../../references/client-libraries.md) - **Tutorials:** - - [XRPの送信](../tasks/send-xrp.md) + - [XRPの送信](../how-tos/send-xrp.md) - **References:** - [`xrpl.js` リファレンス](https://js.xrpl.org/) - [Public API Methods](../../references/http-websocket-apis/public-api-methods/index.md) diff --git a/@i18n/ja/docs/tutorials/tasks/manage-account-settings/use-tickets.md b/@i18n/ja/docs/tutorials/tasks/manage-account-settings/use-tickets.md index 0e21148e73..0a40876193 100644 --- a/@i18n/ja/docs/tutorials/tasks/manage-account-settings/use-tickets.md +++ b/@i18n/ja/docs/tutorials/tasks/manage-account-settings/use-tickets.md @@ -17,9 +17,9 @@ labels: - + -このページでは、[xrpl.js](https://js.xrpl.org/)ライブラリを使用したJavaScriptのサンプルを提供しています。設定方法は、[JavaScriptを使ってみよう](../../javascript/get-started.md)をご覧ください。 +このページでは、[xrpl.js](https://js.xrpl.org/)ライブラリを使用したJavaScriptのサンプルを提供しています。設定方法は、[JavaScriptを使ってみよう](../../javascript/build-apps/get-started.md)をご覧ください。 JavaScriptはWebブラウザ上で動作するため、セットアップなしで読み進められ、インタラクティブな手順を利用することができます。 diff --git a/@i18n/ja/docs/tutorials/tasks/send-xrp.md b/@i18n/ja/docs/tutorials/tasks/send-xrp.md index 7684753b33..3e0d37010e 100644 --- a/@i18n/ja/docs/tutorials/tasks/send-xrp.md +++ b/@i18n/ja/docs/tutorials/tasks/send-xrp.md @@ -23,7 +23,7 @@ steps: ['Generate', 'Connect', 'Prepare', 'Sign', 'Submit', 'Wait', 'Check'] -- このページでは、xrpl.jsライブラリーを使用するJavaScriptの例を紹介します。[xrpl.js入門ガイド](../javascript/get-started.md)に、xrpl.jsを使用してJavaScriptからXRP Ledgerデータにアクセスする方法の説明があります。 +- このページでは、xrpl.jsライブラリーを使用するJavaScriptの例を紹介します。[xrpl.js入門ガイド](../javascript/build-apps/get-started.md)に、xrpl.jsを使用してJavaScriptからXRP Ledgerデータにアクセスする方法の説明があります。 - XRP Ledgerでトランザクションを送信するには、まずアドレスと秘密鍵、そしていくらかのXRPが必要となります。次のインターフェイスを使用して、XRP Test NetにあるアドレスとTestnet XRPを入手できます。 @@ -327,7 +327,7 @@ XrplClient xrplClient = new XrplClient(rippledUrl); - 本番システム向けに[信頼できるトランザクションの送信](../../concepts/transactions/reliable-transaction-submission.md)を構築する - [xrpl.jsリファレンス](https://js.xrpl.org/)を参照して、XRP Ledgerの全機能を確認する -- [アカウント設定](../tasks/manage-account-settings/index.md)をカスタマイズする +- [アカウント設定](../how-tos/manage-account-settings/index.md)をカスタマイズする - [トランザクションのメタデータ](../../references/protocol/transactions/metadata.md)にトランザクションの結果の詳細がどのように記述されているかを知る - escrowやPayment Channelなどの[複雑な支払いタイプ](../../concepts/payment-types/index.md)について調べる diff --git a/@i18n/ja/docs/use-cases/defi/algorithmic-trading.md b/@i18n/ja/docs/use-cases/defi/algorithmic-trading.md index dae39703f0..383de3214f 100644 --- a/@i18n/ja/docs/use-cases/defi/algorithmic-trading.md +++ b/@i18n/ja/docs/use-cases/defi/algorithmic-trading.md @@ -72,9 +72,9 @@ XRP Ledgerの分散型取引所(DEX)には、「アルゴリズムトレード ### トレードの発注 -XRP Ledgerの分散型取引所で_代替可能_トークンとXRPを売買するには、通常[OfferCreateトランザクション](../../references/protocol/transactions/types/offercreate.md)を送信します。この方法でトレードを行うためのコードと技術的ステップの詳細なウォークスルーについては、[分散型取引所でのトレード](../../tutorials/tasks/use-tokens/trade-in-the-decentralized-exchange.md)をご覧ください。[Paymentトランザクション](../../references/protocol/transactions/types/payment.md)を使用して通貨を両替することも可能です。[クロスカレンしー支払い](../../concepts/payment-types/cross-currency-payments.md)を他のユーザに送ったり、長い[パス](../../concepts/tokens/fungible-tokens/paths.md)を使って裁定取引の機会を1つの操作にまとめることで、自分自身に送り返すこともできます。 +XRP Ledgerの分散型取引所で_代替可能_トークンとXRPを売買するには、通常[OfferCreateトランザクション](../../references/protocol/transactions/types/offercreate.md)を送信します。この方法でトレードを行うためのコードと技術的ステップの詳細なウォークスルーについては、[分散型取引所でのトレード](../../tutorials/how-tos/use-tokens/trade-in-the-decentralized-exchange.md)をご覧ください。[Paymentトランザクション](../../references/protocol/transactions/types/payment.md)を使用して通貨を両替することも可能です。[クロスカレンしー支払い](../../concepts/payment-types/cross-currency-payments.md)を他のユーザに送ったり、長い[パス](../../concepts/tokens/fungible-tokens/paths.md)を使って裁定取引の機会を1つの操作にまとめることで、自分自身に送り返すこともできます。 -NFTをトレードするためのコードと技術的な手順については、[JavaScriptを使用したNFTokenの送信](../../tutorials/javascript/modular-tutorials/nfts/transfer-nfts.md)を参照してください。 +NFTをトレードするためのコードと技術的な手順については、[JavaScriptを使用したNFTokenの送信](../../tutorials/javascript/nfts/transfer-nfts.md)を参照してください。 ### トレードデータの確認 diff --git a/@i18n/ja/docs/use-cases/payments/restricting-deposits-uc.md b/@i18n/ja/docs/use-cases/payments/restricting-deposits-uc.md index 6c606409e3..84f755d2b7 100644 --- a/@i18n/ja/docs/use-cases/payments/restricting-deposits-uc.md +++ b/@i18n/ja/docs/use-cases/payments/restricting-deposits-uc.md @@ -42,14 +42,14 @@ Checkは、デポジット認可が有効な場合、シンプルで親しみや この方法は最もシンプルですが、資金が保証されるわけではありません。Checkは後払いであり、Checkを現金化しようとする瞬間まで資金は動きません。Checkを現金化するときに、送金側のアカウントに必要な資金がない可能性があり、ビジネスによっては遅延やその他の問題を引き起こす可能性があります。 -[Checkの利用](../../tutorials/tasks/use-specialized-payment-types/use-checks/use-checks.md)をご覧ください。 +[Checkの利用](../../tutorials/how-tos/use-specialized-payment-types/use-checks/use-checks.md)をご覧ください。 ### Escrow 入金時の資金保証が必要な場合は、エスクローで入金してもらう方法もあります。通常のエスクローと同様に、送金者はレジャーに資金を確保し、一定の条件が満たされるまで資金を効果的にロックします。これにより、エスクローを閉じて資金を放出するときに、資金が利用できることが保証されます。 -[エスクローの利用](../../tutorials/tasks/use-specialized-payment-types/use-escrows/index.md)をご覧ください。 +[エスクローの利用](../../tutorials/how-tos/use-specialized-payment-types/use-escrows/index.md)をご覧ください。 + + + + +

Token Test Harness

+
+ Choose your ledger instance: +    + + +    + + +

+ +
+ +

+ + + + + +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Standby Account + + +
+
+ Seed + + +
+
+ XRP Balance + + +
+
+ Amount + + +
+
+ Destination + + +
+
+ Issuer + + +
+
+ Check ID + + +
+
+ + +
+ Currency + + +
+

+ +

+
+ + + + + + +
+ +

+ +
+ +
+ +
+ +
+ +
+
+
+ + + + +
+ + + + + + + + + +
+ +

+ +
+ +
+ +
+ +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Operational Account + + +
+
+ Seed + + +
+
+ XRP Balance + + +
+
+ Amount + + +
+
+ Destination + + +
+
+ Issuer + + +
+
+ Check ID + + +
+
+ + + + +
+ Currency + + +
+

+ +

+
+
+
+
+ + \ No newline at end of file diff --git a/_code-samples/quickstart/js/2.create-trustline-send-currency.html b/_code-samples/quickstart/js/2.create-trustline-send-currency.html index 0c5aa9a63f..d499b3d46c 100644 --- a/_code-samples/quickstart/js/2.create-trustline-send-currency.html +++ b/_code-samples/quickstart/js/2.create-trustline-send-currency.html @@ -58,24 +58,6 @@
- - - Public Key - - - -
- - - - - Private Key - - - -
- - Seed @@ -181,24 +163,6 @@
- - - Public Key - - - -
- - - - - Private Key - - - -
- - Seed diff --git a/_code-samples/quickstart/js/3.mint-nfts.html b/_code-samples/quickstart/js/3.mint-nfts.html index 8ed27ab813..01473eaeac 100644 --- a/_code-samples/quickstart/js/3.mint-nfts.html +++ b/_code-samples/quickstart/js/3.mint-nfts.html @@ -59,24 +59,6 @@
- - - Public Key - - - -
- - - - - Private Key - - - -
- - Seed @@ -211,24 +193,6 @@
- - - Public Key - - - -
- - - - - Private Key - - - -
- - Seed diff --git a/_code-samples/quickstart/js/4.transfer-nfts.html b/_code-samples/quickstart/js/4.transfer-nfts.html index 8aa8b1b022..6789a0d981 100644 --- a/_code-samples/quickstart/js/4.transfer-nfts.html +++ b/_code-samples/quickstart/js/4.transfer-nfts.html @@ -61,24 +61,6 @@
- - - Public Key - - - -
- - - - - Private Key - - - -
- - Seed @@ -245,24 +227,6 @@
- - - Public Key - - - -
- - - - - Private Key - - - -
- - Seed diff --git a/_code-samples/quickstart/js/5.broker-nfts.html b/_code-samples/quickstart/js/5.broker-nfts.html index 7a5929b55e..b0fc4dc290 100644 --- a/_code-samples/quickstart/js/5.broker-nfts.html +++ b/_code-samples/quickstart/js/5.broker-nfts.html @@ -61,42 +61,22 @@ - - Public Key - - - - -
- + + Seed + + + + + - - Private Key - - - - -
- - - - - Seed -
- - - - - - - - XRP Balance - - - -
- + + XRP Balance + + + + + @@ -147,24 +127,6 @@
- - - Public Key - - - -
- - - - - Private Key - - - -
- - Seed @@ -331,24 +293,6 @@
- - - Public Key - - - -
- - - - - Private Key - - - -
- - Seed diff --git a/_code-samples/quickstart/js/6.authorized-minter.html b/_code-samples/quickstart/js/6.authorized-minter.html index bf43ffb3a2..cf0528e951 100644 --- a/_code-samples/quickstart/js/6.authorized-minter.html +++ b/_code-samples/quickstart/js/6.authorized-minter.html @@ -62,24 +62,6 @@
- - - Public Key - - - -
- - - - - Private Key - - - -
- - Seed @@ -262,24 +244,6 @@
- - - Public Key - - - -
- - - - - Private Key - - - -
- - Seed diff --git a/_code-samples/quickstart/js/7.batch-minting.html b/_code-samples/quickstart/js/7.batch-minting.html index 2f0b87d359..51ca2f96bb 100644 --- a/_code-samples/quickstart/js/7.batch-minting.html +++ b/_code-samples/quickstart/js/7.batch-minting.html @@ -56,24 +56,6 @@
- - - Public Key - - - -
- - - - - Private Key - - - -
- - Seed @@ -154,4 +136,4 @@ - + \ No newline at end of file diff --git a/_code-samples/quickstart/js/8.escrow.html b/_code-samples/quickstart/js/8.escrow.html index 54300cd465..5b5ec57e73 100644 --- a/_code-samples/quickstart/js/8.escrow.html +++ b/_code-samples/quickstart/js/8.escrow.html @@ -1,4 +1,4 @@ - + Time-based Escrow Test Harness @@ -41,6 +41,7 @@ + diff --git a/_code-samples/quickstart/js/9.escrow-condition.html b/_code-samples/quickstart/js/9.escrow-condition.html index c73d10b4d0..574f6a53eb 100644 --- a/_code-samples/quickstart/js/9.escrow-condition.html +++ b/_code-samples/quickstart/js/9.escrow-condition.html @@ -116,24 +116,6 @@ - - - - - - - - - - - - - - - - - [Source and Destination Tags](../../concepts/transactions/source-and-destination-tags.md) - **Tutorials:** - [Install `rippled`](../../infrastructure/installation/index.md) - - [Send XRP](../../tutorials/tasks/send-xrp.md) + - [Send XRP](../../tutorials/how-tos/send-xrp.md) - [Set Up Secure Signing](../../concepts/transactions/secure-signing.md) - - [Monitor Incoming Payments with WebSocket](../../tutorials/http-websocket-apis/monitor-incoming-payments-with-websocket.md) + - [Monitor Incoming Payments with WebSocket](../../tutorials/http-websocket-apis/build-apps/monitor-incoming-payments-with-websocket.md) - **References:** - [Payment transaction][] - [account_info method][] diff --git a/docs/use-cases/payments/restricting-deposits-uc.md b/docs/use-cases/payments/restricting-deposits-uc.md index 90d89367f8..d172670b1e 100644 --- a/docs/use-cases/payments/restricting-deposits-uc.md +++ b/docs/use-cases/payments/restricting-deposits-uc.md @@ -42,14 +42,14 @@ 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/tasks/use-specialized-payment-types/use-checks/use-checks.md). +See: [Use Checks](../../tutorials/how-tos/use-specialized-payment-types/use-checks/use-checks.md). ### Escrow If you require a guarantee of funds at the time of deposit, another option is to have deposits made with an escrow. Like regular escrows, a sender sets aside funds on the ledger, effectively locking them up until certain conditions are met. This guarantees the funds will be available when you close the escrow to release the funds. -See: [Use Escrows](../../tutorials/tasks/use-specialized-payment-types/use-escrows/index.md). +See: [Use Escrows](../../tutorials/how-tos/use-specialized-payment-types/use-escrows/index.md).
@@ -115,24 +116,6 @@ - - - - - - - - - - - - - - - - + + +
- Public Key - - -
-
- Private Key - - -
-
Seed @@ -256,24 +239,6 @@
- Public Key - - -
-
- Private Key - - -
-
Seed @@ -288,6 +253,9 @@

- Public Key - - -
-
- Private Key - - -
-
Seed @@ -258,24 +240,6 @@
- Public Key - - -
-
- Private Key - - -
-
Seed diff --git a/_code-samples/quickstart/js/ripplex1-send-xrp.js b/_code-samples/quickstart/js/ripplex1-send-xrp.js index 63171684e0..07c1d274e3 100644 --- a/_code-samples/quickstart/js/ripplex1-send-xrp.js +++ b/_code-samples/quickstart/js/ripplex1-send-xrp.js @@ -51,16 +51,12 @@ async function getAccount(type) { if (type == 'standby') { standbyAccountField.value = my_wallet.address - standbyPubKeyField.value = my_wallet.publicKey - standbyPrivKeyField.value = my_wallet.privateKey standbyBalanceField.value = (await client.getXrpBalance(my_wallet.address)) standbySeedField.value = my_wallet.seed results += '\nStandby account created.' standbyResultField.value = results } else { operationalAccountField.value = my_wallet.address - operationalPubKeyField.value = my_wallet.publicKey - operationalPrivKeyField.value = my_wallet.privateKey operationalSeedField.value = my_wallet.seed operationalBalanceField.value = (await client.getXrpBalance(my_wallet.address)) results += '\nOperational account created.' @@ -95,14 +91,10 @@ async function getAccountsFromSeeds() { // ----------------------Populate the fields for Standby and Operational accounts. standbyAccountField.value = standby_wallet.address - standbyPubKeyField.value = standby_wallet.publicKey - standbyPrivKeyField.value = standby_wallet.privateKey standbySeedField.value = standby_wallet.seed standbyBalanceField.value = (await client.getXrpBalance(standby_wallet.address)) operationalAccountField.value = operational_wallet.address - operationalPubKeyField.value = operational_wallet.publicKey - operationalPrivKeyField.value = operational_wallet.privateKey operationalSeedField.value = operational_wallet.seed operationalBalanceField.value = (await client.getXrpBalance(operational_wallet.address)) diff --git a/_code-samples/quickstart/js/ripplex10-check.js b/_code-samples/quickstart/js/ripplex10-check.js new file mode 100644 index 0000000000..b036cd44ab --- /dev/null +++ b/_code-samples/quickstart/js/ripplex10-check.js @@ -0,0 +1,329 @@ +// ******************************************************* +// ************* Standby Send Check ********************** +// ******************************************************* +async function sendCheck() { + let net = getNet() + const client = new xrpl.Client(net) + results = 'Connecting to ' + getNet() + '....' + standbyResultField.value = results + await client.connect() + results += '\nConnected.' + standbyResultField.value = results + + const standby_wallet = xrpl.Wallet.fromSeed(standbySeedField.value) + const operational_wallet = xrpl.Wallet.fromSeed(operationalSeedField.value) + var check_amount = standbyAmountField.value + + if (standbyCurrencyField.value != "XRP") { + check_amount = { + "currency": standbyCurrencyField.value, + "value": standbyAmountField.value, + "issuer": standby_wallet.address + } + } + + const send_check_tx = { + "TransactionType": "CheckCreate", + "Account": standby_wallet.address, + "SendMax": check_amount, + "Destination": standbyDestinationField.value + } + const check_prepared = await client.autofill(send_check_tx) + const check_signed = standby_wallet.sign(check_prepared) + results += 'Sending ' + check_amount + ' ' + standbyCurrencyField + ' to ' + + standbyDestinationField.value + '...' + standbyResultField.value = results + const check_result = await client.submitAndWait(check_signed.tx_blob) + if (check_result.result.meta.TransactionResult == "tesSUCCESS") { + results += 'Transaction succeeded: https://testnet.xrpl.org/transactions/${check_signed.hash}' + standbyResultField.value = JSON.stringify(check_result.result, null, 2) + } else { + results += 'Transaction failed: See JavaScript console for details.' + standbyResultField.value = results + throw 'Error sending transaction: ${check_result.result.meta.TransactionResult}' + } + standbyBalanceField.value = (await client.getXrpBalance(standby_wallet.address)) + operationalBalanceField.value = (await client.getXrpBalance(operational_wallet.address)) + + client.disconnect() +} // end of sendCheck() + +// ******************************************************* +// *************** Standby Get Checks ******************** +// ******************************************************* + +async function getChecks() { + let net = getNet() + const client = new xrpl.Client(net) + results = 'Connecting to ' + getNet() + '....' + standbyResultField.value = results + await client.connect() + results += '\nConnected.' + standbyResultField.value = results + + results= "\nGetting standby account checks...\n" + const check_objects = await client.request({ + "id": 5, + "command": "account_objects", + "account": standbyAccountField.value, + "ledger_index": "validated", + "type": "check" + }) + standbyResultField.value = JSON.stringify(check_objects.result, null, 2) + client.disconnect() +} // End of getChecks() + +// ******************************************************* +// ************* Standby Cash Check ********************** +// ******************************************************* + +async function cashCheck() { + let net = getNet() + const client = new xrpl.Client(net) + results = 'Connecting to ' + getNet() + '....' + standbyResultField.value = results + await client.connect() + results += '\nConnected.' + standbyResultField.value = results + + const standby_wallet = xrpl.Wallet.fromSeed(standbySeedField.value) + const operational_wallet = xrpl.Wallet.fromSeed(operationalSeedField.value) + + var check_amount = standbyAmountField.value + + if (standbyCurrencyField.value != "XRP") { + check_amount = { + "value": standbyAmountField.value, + "currency": standbyCurrencyField.value, + "issuer": standbyIssuerField.value + } + } + const cash_check_tx = { + "TransactionType": "CheckCash", + "Account": standby_wallet.address, + "Amount": check_amount, + "CheckID": standbyCheckID.value + } + const cash_prepared = await client.autofill(cash_check_tx) + const cash_signed = standby_wallet.sign(cash_prepared) + results += ' Receiving ' + standbyAmountField.value + ' ' + standbyCurrencyField.value + '.\n' + standbyResultField.value = results + const check_result = await client.submitAndWait(cash_signed.tx_blob) + if (check_result.result.meta.TransactionResult == "tesSUCCESS") { + results += 'Transaction succeeded: https://testnet.xrpl.org/transactions/${cash_signed.hash}' + standbyResultField.value = results + } else { + results += 'Transaction failed: See JavaScript console for details.' + standbyResultField.value = results + throw 'Error sending transaction: ${check_result.result.meta.TransactionResult}' + } + standbyBalanceField.value = (await client.getXrpBalance(standby_wallet.address)) + operationalBalanceField.value = (await client.getXrpBalance(operational_wallet.address)) + + client.disconnect() +} // end of cashCheck() + +// ******************************************************* +// *************** Standby Cancel Check ****************** +// ******************************************************* + +async function cancelCheck() { + let net = getNet() + const client = new xrpl.Client(net) + results = 'Connecting to ' + getNet() + '....' + standbyResultField.value = results + await client.connect() + results += '\nConnected.' + standbyResultField.value = results + + const standby_wallet = xrpl.Wallet.fromSeed(standbySeedField.value) + const operational_wallet = xrpl.Wallet.fromSeed(operationalSeedField.value) + + const cancel_check_tx = { + "TransactionType": "CheckCancel", + "Account": standby_wallet.address, + "CheckID": standbyCheckID.value + } + const cancel_prepared = await client.autofill(cancel_check_tx) + const cancel_signed = standby_wallet.sign(cancel_prepared) + results += ' Cancelling check.\n' + standbyResultField.value = results + const check_result = await client.submitAndWait(cancel_signed.tx_blob) + if (check_result.result.meta.TransactionResult == "tesSUCCESS") { + results += 'Transaction succeeded: https://testnet.xrpl.org/transactions/${cash_signed.hash}' + standbyResultField.value = results + } else { + results += 'Transaction failed: See JavaScript console for details.' + standbyResultField.value = results + throw 'Error sending transaction: ${check_result.result.meta.TransactionResult}' + } + standbyBalanceField.value = (await client.getXrpBalance(standby_wallet.address)) + operationalBalanceField.value = (await client.getXrpBalance(operational_wallet.address)) + client.disconnect() +} // end of cancelCheck() + +// ******************************************************* +// ************ Operational Send Check ******************* +// ******************************************************* +async function opSendCheck() { + let net = getNet() + const client = new xrpl.Client(net) + results = 'Connecting to ' + getNet() + '....' + operationalResultField.value = results + await client.connect() + results += '\nConnected.' + operationalResultField.value = results + + const standby_wallet = xrpl.Wallet.fromSeed(standbySeedField.value) + const operational_wallet = xrpl.Wallet.fromSeed(operationalSeedField.value) + + const issue_quantity = operationalAmountField.value + var check_amount = operationalAmountField.value + + if (operationalCurrencyField.value != "XRP") { + check_amount = { + "currency": operationalCurrencyField.value, + "value": operationalAmountField.value, + "issuer": operational_wallet.address + } + } + const send_check_tx = { + "TransactionType": "CheckCreate", + "Account": operational_wallet.address, + "SendMax": check_amount, + "Destination": operationalDestinationField.value + } + const check_prepared = await client.autofill(send_check_tx) + const check_signed = operational_wallet.sign(check_prepared) + results += '\nSending check to ' + + operationalDestinationField.value + '...' + operationalResultField.value = results + const check_result = await client.submitAndWait(check_signed.tx_blob) + if (check_result.result.meta.TransactionResult == "tesSUCCESS") { + results += 'Transaction succeeded: https://testnet.xrpl.org/transactions/${check_signed.hash}' + operationalResultField.value = JSON.stringify(check_result.result, null, 2) + } else { + results += 'Transaction failed: See JavaScript console for details.' + operationalResultField.value = results + throw 'Error sending transaction: ${check_result.result.meta.TransactionResult}' + } + standbyBalanceField.value = (await client.getXrpBalance(standby_wallet.address)) + operationalBalanceField.value = (await client.getXrpBalance(operational_wallet.address)) + client.disconnect() +} // end of opSendCheck() + +// ******************************************************* +// ************ Operational Get Checks ******************* +// ******************************************************* + +async function opGetChecks() { + let net = getNet() + const client = new xrpl.Client(net) + results = 'Connecting to ' + getNet() + '....' + operationalResultField.value = results + await client.connect() + results += '\nConnected.' + operationalResultField.value = results + + results= "\nGetting standby account checks...\n" + const check_objects = await client.request({ + "id": 5, + "command": "account_objects", + "account": operationalAccountField.value, + "ledger_index": "validated", + "type": "check" + }) + operationalResultField.value = JSON.stringify(check_objects.result, null, 2) + client.disconnect() +} // End of opGetChecks() + + +// ******************************************************* +// ************* Operational Cash Check ****************** +// ******************************************************* + +async function opCashCheck() { + let net = getNet() + const client = new xrpl.Client(net) + results = 'Connecting to ' + getNet() + '....' + operationalResultField.value = results + await client.connect() + results += '\nConnected.' + operationalResultField.value = results + + const standby_wallet = xrpl.Wallet.fromSeed(standbySeedField.value) + const operational_wallet = xrpl.Wallet.fromSeed(operationalSeedField.value) + + var check_amount = operationalAmountField.value + + if (operationalCurrencyField.value != "XRP") { + check_amount = { + "value": operationalAmountField.value, + "currency": operationalCurrencyField.value, + "issuer": operationalIssuerField.value + } + } + const cash_check_tx = { + "TransactionType": "CheckCash", + "Account": operational_wallet.address, + "Amount": check_amount, + "CheckID": operationalCheckIDField.value + } + const cash_prepared = await client.autofill(cash_check_tx) + const cash_signed = operational_wallet.sign(cash_prepared) + results += ' Receiving ' + operationalAmountField.value + ' ' + operationalCurrencyField.value + '.\n' + operationalResultField.value = results + const check_result = await client.submitAndWait(cash_signed.tx_blob) + if (check_result.result.meta.TransactionResult == "tesSUCCESS") { + results += 'Transaction succeeded: https://testnet.xrpl.org/transactions/${cash_signed.hash}' + operationalResultField.value = results + } else { + results += 'Transaction failed: See JavaScript console for details.' + operationalResultField.value = results + throw 'Error sending transaction: ${check_result.result.meta.TransactionResult}' + } + standbyBalanceField.value = (await client.getXrpBalance(standby_wallet.address)) + operationalBalanceField.value = (await client.getXrpBalance(operational_wallet.address)) + client.disconnect() +} +// end of opCashCheck() + +// ******************************************************* +// ************* Operational Cancel Check **************** +// ******************************************************* + +async function opCancelCheck() { + let net = getNet() + const client = new xrpl.Client(net) + results = 'Connecting to ' + getNet() + '....' + operationalResultField.value = results + await client.connect() + results += '\nConnected.' + operationalResultField.value = results + + const standby_wallet = xrpl.Wallet.fromSeed(standbySeedField.value) + const operational_wallet = xrpl.Wallet.fromSeed(operationalSeedField.value) + + const cancel_check_tx = { + "TransactionType": "CheckCancel", + "Account": operational_wallet.address, + "CheckID": operationalCheckIDField.value + } + + const cancel_prepared = await client.autofill(cancel_check_tx) + const cancel_signed = operational_wallet.sign(cancel_prepared) + results += ' Cancelling check.\n' + operationalResultField.value = results + const check_result = await client.submitAndWait(cancel_signed.tx_blob) + if (check_result.result.meta.TransactionResult == "tesSUCCESS") { + results += 'Transaction succeeded: https://testnet.xrpl.org/transactions/${cash_signed.hash}' + operationalResultField.value = results + } else { + results += 'Transaction failed: See JavaScript console for details.' + operationalResultField.value = results + throw 'Error sending transaction: ${check_result.result.meta.TransactionResult}' + } + standbyBalanceField.value = (await client.getXrpBalance(standby_wallet.address)) + operationalBalanceField.value = (await client.getXrpBalance(operational_wallet.address)) + client.disconnect() +} // end of cancelCheck() \ No newline at end of file diff --git a/_code-samples/quickstart/js/ripplex2-send-currency.js b/_code-samples/quickstart/js/ripplex2-send-currency.js index bf7acc025e..27a6db8d80 100644 --- a/_code-samples/quickstart/js/ripplex2-send-currency.js +++ b/_code-samples/quickstart/js/ripplex2-send-currency.js @@ -70,15 +70,15 @@ async function createTrustline() { const currency_code = standbyCurrencyField.value const trustSet_tx = { "TransactionType": "TrustSet", - "Account": standbyDestinationField.value, + "Account": standbyAccountField.value, "LimitAmount": { "currency": standbyCurrencyField.value, - "issuer": standby_wallet.address, + "issuer": standbyDestinationField.value, "value": standbyAmountField.value } } const ts_prepared = await client.autofill(trustSet_tx) - const ts_signed = operational_wallet.sign(ts_prepared) + const ts_signed = standby_wallet.sign(ts_prepared) results += '\nCreating trust line from operational account to standby account...' standbyResultField.value = results const ts_result = await client.submitAndWait(ts_signed.tx_blob) @@ -164,12 +164,11 @@ async function getBalances() { command: "gateway_balances", account: standby_wallet.address, ledger_index: "validated", - hotwallet: [operational_wallet.address] }) results += JSON.stringify(standby_balances.result, null, 2) standbyResultField.value = results - results += "\nGetting operational account balances...\n" + results = "\nGetting operational account balances...\n" const operational_balances = await client.request({ command: "gateway_balances", account: operational_wallet.address, @@ -178,7 +177,6 @@ async function getBalances() { results += JSON.stringify(operational_balances.result, null, 2) operationalResultField.value = results operationalBalanceField.value = (await client.getXrpBalance(operational_wallet.address)) - standbyResultField.value = results standbyBalanceField.value = (await client.getXrpBalance(standby_wallet.address)) client.disconnect() @@ -206,15 +204,15 @@ async function oPcreateTrustline() { const operational_wallet = xrpl.Wallet.fromSeed(operationalSeedField.value) const trustSet_tx = { "TransactionType": "TrustSet", - "Account": operationalDestinationField.value, + "Account": operationalAccountField.value, "LimitAmount": { "currency": operationalCurrencyField.value, - "issuer": operational_wallet.address, + "issuer": operationalDestinationField.value, "value": operationalAmountField.value } } const ts_prepared = await client.autofill(trustSet_tx) - const ts_signed = standby_wallet.sign(ts_prepared) + const ts_signed = operational_wallet.sign(ts_prepared) results += '\nCreating trust line from operational account to ' + operationalDestinationField.value + ' account...' operationalResultField.value = results diff --git a/_code-samples/quickstart/js/ripplex5-broker-nfts.js b/_code-samples/quickstart/js/ripplex5-broker-nfts.js index 8f74d1d2df..aaa1790a73 100644 --- a/_code-samples/quickstart/js/ripplex5-broker-nfts.js +++ b/_code-samples/quickstart/js/ripplex5-broker-nfts.js @@ -199,8 +199,6 @@ async function getAccount(type) { if (type == 'standby') { standbyAccountField.value = my_wallet.address - standbyPubKeyField.value = my_wallet.publicKey - standbyPrivKeyField.value = my_wallet.privateKey standbyBalanceField.value = (await client.getXrpBalance(my_wallet.address)) standbySeedField.value = my_wallet.seed results += '\nStandby account created.' @@ -208,8 +206,6 @@ async function getAccount(type) { } if (type == 'operational') { operationalAccountField.value = my_wallet.address - operationalPubKeyField.value = my_wallet.publicKey - operationalPrivKeyField.value = my_wallet.privateKey operationalSeedField.value = my_wallet.seed operationalBalanceField.value = (await client.getXrpBalance(my_wallet.address)) results += '\nOperational account created.' @@ -217,8 +213,6 @@ async function getAccount(type) { } if (type == 'broker') { brokerAccountField.value = my_wallet.address - brokerPubKeyField.value = my_wallet.publicKey - brokerPrivKeyField.value = my_wallet.privateKey brokerSeedField.value = my_wallet.seed brokerBalanceField.value = (await client.getXrpBalance(my_wallet.address)) results += '\nBroker account created.' diff --git a/_code-samples/quickstart/py/0.All_Py_Files.zip b/_code-samples/quickstart/py/0.All_Py_Files.zip new file mode 100644 index 0000000000..89142179c3 Binary files /dev/null and b/_code-samples/quickstart/py/0.All_Py_Files.zip differ diff --git a/_code-samples/quickstart/py/conditions.py b/_code-samples/quickstart/py/conditions.py new file mode 100644 index 0000000000..71ad46a47a --- /dev/null +++ b/_code-samples/quickstart/py/conditions.py @@ -0,0 +1,11 @@ +from os import urandom +from cryptoconditions import PreimageSha256 + +secret = urandom(32) + +fulfillment = PreimageSha256(preimage=secret) + +print("Condition", fulfillment.condition_binary.hex().upper()) + +# Keep secret until you want to finish the escrow +print("Fulfillment", fulfillment.serialize_binary().hex().upper()) diff --git a/_code-samples/quickstart/py/lesson1-send-xrp.py b/_code-samples/quickstart/py/lesson1-send-xrp.py index 90993f3882..03fb330c76 100644 --- a/_code-samples/quickstart/py/lesson1-send-xrp.py +++ b/_code-samples/quickstart/py/lesson1-send-xrp.py @@ -60,9 +60,9 @@ def operational_send_xrp(): get_operational_account_info() -# Create a new window with the title "Quickstart Module 1" +# Create a new window with the title "Send and Receive XRP" window = tk.Tk() -window.title("Quickstart Module 1") +window.title("Send and Receive XRP") # Form frame frm_form = tk.Frame(relief=tk.SUNKEN, borderwidth=3) diff --git a/_code-samples/quickstart/py/lesson10-check.py b/_code-samples/quickstart/py/lesson10-check.py new file mode 100644 index 0000000000..394da6ef2f --- /dev/null +++ b/_code-samples/quickstart/py/lesson10-check.py @@ -0,0 +1,318 @@ +import tkinter as tk +import xrpl +import json + +from mod1 import get_account, get_account_info, send_xrp +from mod2 import get_balance +from mod10 import send_check, cash_check, cancel_check, get_checks + +############################################# +## Handlers ################################# +############################################# + +## Mod 10 Handlers + +def standby_send_check(): + results=send_check( + ent_standby_seed.get(), + ent_standby_amount.get(), + ent_standby_destination.get(), + ent_standby_currency.get(), + ent_standby_issuer.get() + ) + text_standby_results.delete("1.0", tk.END) + text_standby_results.insert("1.0", json.dumps(results, indent=4)) + +def standby_cash_check(): + results=cash_check( + ent_standby_seed.get(), + ent_standby_amount.get(), + ent_standby_check_id.get(), + ent_standby_currency.get(), + ent_standby_issuer.get() + ) + text_standby_results.delete("1.0", tk.END) + text_standby_results.insert("1.0", json.dumps(results, indent=4)) + +def standby_cancel_check(): + results=cancel_check( + ent_standby_seed.get(), + ent_standby_check_id.get() + ) + text_standby_results.delete("1.0", tk.END) + text_standby_results.insert("1.0", json.dumps(results, indent=4)) + +def standby_get_checks(): + results=get_checks( + ent_standby_account.get(), + ) + text_standby_results.delete("1.0", tk.END) + text_standby_results.insert("1.0", json.dumps(results, indent=4)) + +def standby_get_balance(): + results=get_balance( + ent_standby_seed.get(), + ent_operational_seed.get() + ) + text_standby_results.delete("1.0", tk.END) + text_standby_results.insert("1.0", json.dumps(results, indent=4)) + +def operational_send_check(): + results=send_check( + ent_operational_seed.get(), + ent_operational_amount.get(), + ent_operational_destination.get(), + ent_operational_currency.get(), + ent_operational_issuer.get() + ) + text_operational_results.delete("1.0", tk.END) + text_operational_results.insert("1.0", json.dumps(results, indent=4)) + +def operational_cash_check(): + results=cash_check( + ent_operational_seed.get(), + ent_operational_amount.get(), + ent_operational_check_id.get(), + ent_operational_currency.get(), + ent_operational_issuer.get() + ) + text_operational_results.delete("1.0", tk.END) + text_operational_results.insert("1.0", json.dumps(results, indent=4)) + +def operational_cancel_check(): + results=cancel_check( + ent_operational_seed.get(), + ent_operational_check_id.get() + ) + text_operational_results.delete("1.0", tk.END) + text_operational_results.insert("1.0", json.dumps(results, indent=4)) + +def operational_get_checks(): + results=get_checks( + ent_operational_account.get(), + ) + text_operational_results.delete("1.0", tk.END) + text_operational_results.insert("1.0", json.dumps(results, indent=4)) + +def operational_get_balance(): + results=get_balance( + ent_operational_seed.get(), + ent_standby_seed.get() + ) + text_operational_results.delete("1.0", tk.END) + text_operational_results.insert("1.0", json.dumps(results, indent=4)) + + +## Mod 8 Handlers + +def operational_get_transaction(): + results=get_transaction(ent_operational_account.get(), + ent_operational_look_up.get()) + text_operational_results.delete("1.0", tk.END) + text_operational_results.insert("1.0", json.dumps(results, indent=4)) + +## Mod 1 Handlers + +def get_standby_account(): + new_wallet=get_account(ent_standby_seed.get()) + ent_standby_account.delete(0, tk.END) + ent_standby_seed.delete(0, tk.END) + ent_standby_account.insert(0, new_wallet.classic_address) + ent_standby_seed.insert(0, new_wallet.seed) + + +def get_standby_account_info(): + accountInfo=get_account_info(ent_standby_account.get()) + ent_standby_balance.delete(0, tk.END) + ent_standby_balance.insert(0,accountInfo['Balance']) + text_standby_results.delete("1.0", tk.END) + text_standby_results.insert("1.0",json.dumps(accountInfo, indent=4)) + + +def standby_send_xrp(): + response=send_xrp(ent_standby_seed.get(),ent_standby_amount.get(), + ent_standby_destination.get()) + text_standby_results.delete("1.0", tk.END) + text_standby_results.insert("1.0",json.dumps(response.result, indent=4)) + get_standby_account_info() + get_operational_account_info() + + +def get_operational_account(): + new_wallet=get_account(ent_operational_seed.get()) + ent_operational_account.delete(0, tk.END) + ent_operational_account.insert(0, new_wallet.classic_address) + ent_operational_seed.delete(0, tk.END) + ent_operational_seed.insert(0, new_wallet.seed) + + +def get_operational_account_info(): + accountInfo=get_account_info(ent_operational_account.get()) + ent_operational_balance.delete(0, tk.END) + ent_operational_balance.insert(0,accountInfo['Balance']) + text_operational_results.delete("1.0", tk.END) + text_operational_results.insert("1.0",json.dumps(accountInfo, indent=4)) + + +def operational_send_xrp(): + response=send_xrp(ent_operational_seed.get(),ent_operational_amount.get(), + ent_operational_destination.get()) + text_operational_results.delete("1.0", tk.END) + text_operational_results.insert("1.0",json.dumps(response.result,indent=4)) + get_standby_account_info() + get_operational_account_info() + + +# Create a new window with the title "Conditional Escrow Example" +window=tk.Tk() +window.title("Check Example") + +# Form frame +frm_form=tk.Frame(relief=tk.SUNKEN, borderwidth=3) +frm_form.pack() + +# Create the Label and Entry widgets for "Standby Account" +lbl_standy_seed=tk.Label(master=frm_form, text="Standby Seed") +ent_standby_seed=tk.Entry(master=frm_form, width=50) +lbl_standby_account=tk.Label(master=frm_form, text="Standby Account") +ent_standby_account=tk.Entry(master=frm_form, width=50) +lbl_standby_balance=tk.Label(master=frm_form, text="XRP Balance") +ent_standby_balance=tk.Entry(master=frm_form, width=50) +lbl_standy_amount=tk.Label(master=frm_form, text="Amount") +ent_standby_amount=tk.Entry(master=frm_form, width=50) +lbl_standby_destination=tk.Label(master=frm_form, text="Destination") +ent_standby_destination=tk.Entry(master=frm_form, width=50) +lbl_standby_issuer=tk.Label(master=frm_form, text="Issuer") +ent_standby_issuer=tk.Entry(master=frm_form, width=50) +lbl_standby_check_id=tk.Label(master=frm_form, text="Check ID") +ent_standby_check_id=tk.Entry(master=frm_form, width=50) +lbl_standby_currency=tk.Label(master=frm_form, text="Currency") +ent_standby_currency=tk.Entry(master=frm_form, width=50) +lbl_standby_results=tk.Label(master=frm_form, text="Results") +text_standby_results=tk.Text(master=frm_form, height=20, width=65) + +# Place fields in a grid. +lbl_standy_seed.grid(row=0, column=0, sticky="e") +ent_standby_seed.grid(row=0, column=1) +lbl_standby_account.grid(row=2, column=0, sticky="e") +ent_standby_account.grid(row=2, column=1) +lbl_standby_balance.grid(row=3, column=0, sticky="e") +ent_standby_balance.grid(row=3, column=1) +lbl_standy_amount.grid(row=4, column=0, sticky="e") +ent_standby_amount.grid(row=4, column=1) +lbl_standby_destination.grid(row=5, column=0, sticky="e") +ent_standby_destination.grid(row=5, column=1) +lbl_standby_issuer.grid(row=6, column=0, sticky="e") +ent_standby_issuer.grid(row=6, column=1) +lbl_standby_check_id.grid(row=7, column=0, sticky="e") +ent_standby_check_id.grid(row=7, column=1) +lbl_standby_currency.grid(row=8, column=0, sticky="e") +ent_standby_currency.grid(row=8, column=1) +lbl_standby_results.grid(row=9, column=0, sticky="ne") +text_standby_results.grid(row=9, column=1, sticky="nw") + +############################################### +## Operational Account ######################## +############################################### + +# Create the Label and Entry widgets for "Operational Account" + +lbl_operational_seed=tk.Label(master=frm_form, text="Operational Seed") +ent_operational_seed=tk.Entry(master=frm_form, width=50) +lbl_operational_account=tk.Label(master=frm_form, text="Operational Account") +ent_operational_account=tk.Entry(master=frm_form, width=50) +lbl_operational_balance=tk.Label(master=frm_form, text="XRP Balance") +ent_operational_balance=tk.Entry(master=frm_form, width=50) +lbl_operational_amount=tk.Label(master=frm_form, text="Amount") +ent_operational_amount=tk.Entry(master=frm_form, width=50) +lbl_operational_destination=tk.Label(master=frm_form, text="Destination") +ent_operational_destination=tk.Entry(master=frm_form, width=50) +lbl_operational_issuer=tk.Label(master=frm_form, text="Issuer") +ent_operational_issuer=tk.Entry(master=frm_form, width=50) +lbl_operational_check_id=tk.Label(master=frm_form, text="Check ID") +ent_operational_check_id=tk.Entry(master=frm_form, width=50) +lbl_operational_currency=tk.Label(master=frm_form, text="Currency") +ent_operational_currency=tk.Entry(master=frm_form, width=50) +lbl_operational_results=tk.Label(master=frm_form,text='Results') +text_operational_results=tk.Text(master=frm_form, height=20, width=65) + +#Place the widgets in a grid +lbl_operational_seed.grid(row=0, column=4, sticky="e") +ent_operational_seed.grid(row=0, column=5, sticky="w") +lbl_operational_account.grid(row=2,column=4, sticky="e") +ent_operational_account.grid(row=2,column=5, sticky="w") +lbl_operational_balance.grid(row=3, column=4, sticky="e") +ent_operational_balance.grid(row=3, column=5, sticky="w") +lbl_operational_amount.grid(row=4, column=4, sticky="e") +ent_operational_amount.grid(row=4, column=5, sticky="w") +lbl_operational_destination.grid(row=5, column=4, sticky="e") +ent_operational_destination.grid(row=5, column=5, sticky="w") +lbl_operational_issuer.grid(row=6, column=4, sticky="e") +ent_operational_issuer.grid(row=6, column=5, sticky="w") +lbl_operational_check_id.grid(row=7, column=4, sticky="e") +ent_operational_check_id.grid(row=7, column=5, sticky="w") +lbl_operational_currency.grid(row=8, column=4, sticky="e") +ent_operational_currency.grid(row=8, column=5) +lbl_operational_results.grid(row=9, column=4, sticky="ne") +text_operational_results.grid(row=9, column=5, sticky="nw") + +############################################# +## Buttons ################################## +############################################# + +# Create the Get Standby Account Buttons +btn_get_standby_account=tk.Button(master=frm_form, text="Get Standby Account", + command=get_standby_account) +btn_get_standby_account.grid(row=0, column=2, sticky="nsew") +btn_get_standby_account_info=tk.Button(master=frm_form, + text="Get Standby Account Info", + command=get_standby_account_info) +btn_get_standby_account_info.grid(row=1, column=2, sticky="nsew") +btn_standby_send_xrp=tk.Button(master=frm_form, text="Send XRP >", + command=standby_send_xrp) +btn_standby_send_xrp.grid(row=2, column=2, sticky="nsew") +btn_standby_send_check=tk.Button(master=frm_form, text="Send Check", + command=standby_send_check) +btn_standby_send_check.grid(row=4, column=2, sticky="nsew") +btn_standby_get_checks=tk.Button(master=frm_form, text="Get Checks", + command=standby_get_checks) +btn_standby_get_checks.grid(row=5, column=2, sticky="nsew") +btn_standby_cash_check=tk.Button(master=frm_form, text="Cash Check", + command=standby_cash_check) +btn_standby_cash_check.grid(row=6, column=2, sticky="nsew") +btn_standby_cancel_check=tk.Button(master=frm_form, text="Cancel Check", + command=standby_cancel_check) +btn_standby_cancel_check.grid(row=7, column=2, sticky="nsew") +btn_standby_get_balances=tk.Button(master=frm_form, text="Get Balances", + command=standby_get_balance) +btn_standby_get_balances.grid(row=8, column=2, sticky="nsew") + +# Create the Operational Account Buttons +btn_get_operational_account=tk.Button(master=frm_form, + text="Get Operational Account", + command=get_operational_account) +btn_get_operational_account.grid(row=0, column=3, sticky="nsew") +btn_get_op_account_info=tk.Button(master=frm_form, text="Get Op Account Info", + command=get_operational_account_info) +btn_get_op_account_info.grid(row=1, column=3, sticky="nsew") +btn_op_send_xrp=tk.Button(master=frm_form, text="< Send XRP", + command=operational_send_xrp) +btn_op_send_xrp.grid(row=2, column=3, sticky="nsew") +btn_op_send_check=tk.Button(master=frm_form, text="Send Check", + command=operational_send_check) +btn_op_send_check.grid(row=4, column=3, sticky="nsew") +btn_op_get_checks=tk.Button(master=frm_form, text="Get Checks", + command=operational_get_checks) +btn_op_get_checks.grid(row=5, column=3, sticky="nsew") +btn_op_cash_check=tk.Button(master=frm_form, text="Cash Check", + command=operational_cash_check) +btn_op_cash_check.grid(row=6, column=3, sticky="nsew") +btn_op_cancel_check=tk.Button(master=frm_form, text="Cancel Check", + command=operational_cancel_check) +btn_op_cancel_check.grid(row=7, column=3, sticky="nsew") +btn_op_get_balances=tk.Button(master=frm_form, text="Get Balances", + command=operational_get_balance) +btn_op_get_balances.grid(row=8, column=3, sticky="nsew") + +# Start the application +window.mainloop() diff --git a/_code-samples/quickstart/py/lesson2-send-currency.py b/_code-samples/quickstart/py/lesson2-send-currency.py index a4969390ac..e00a74f918 100644 --- a/_code-samples/quickstart/py/lesson2-send-currency.py +++ b/_code-samples/quickstart/py/lesson2-send-currency.py @@ -68,10 +68,10 @@ def operational_configure_account(): def get_balances(): - results = get_balance(ent_operational_account.get(), ent_standby_account.get()) + results = get_balance(ent_operational_seed.get(), ent_standby_seed.get()) text_standby_results.delete("1.0", tk.END) text_standby_results.insert("1.0", json.dumps(results, indent=4)) - results = get_balance(ent_standby_account.get(), ent_operational_account.get()) + results = get_balance(ent_standby_seed.get(), ent_operational_seed.get()) text_operational_results.delete("1.0", tk.END) text_operational_results.insert("1.0", json.dumps(results, indent=4)) diff --git a/_code-samples/quickstart/py/lesson6-auth-minter.py b/_code-samples/quickstart/py/lesson6-auth-minter.py index 77de5a1261..9e8f17981b 100644 --- a/_code-samples/quickstart/py/lesson6-auth-minter.py +++ b/_code-samples/quickstart/py/lesson6-auth-minter.py @@ -24,6 +24,7 @@ from mod4 import ( ) from mod5 import broker_sale from mod6 import set_minter, mint_other +from mod7 import batch_mint, get_batch ############################################# ## Handlers ################################# diff --git a/_code-samples/quickstart/py/lesson7-batch-minting.py b/_code-samples/quickstart/py/lesson7-batch-minting.py index f9d2d154fa..e3958afcb2 100644 --- a/_code-samples/quickstart/py/lesson7-batch-minting.py +++ b/_code-samples/quickstart/py/lesson7-batch-minting.py @@ -48,9 +48,9 @@ def get_standby_account_info(): text_standby_results.insert("1.0",json.dumps(accountInfo, indent=4)) -# Create a new window with the title "Quickstart - Batch Minting" +# Create a new window with the title "Python Module - Batch Minting" window = tk.Tk() -window.title("Quickstart - Batch Minting") +window.title("Python Module - Batch Minting") # Form frame frm_form = tk.Frame(relief=tk.SUNKEN, borderwidth=3) @@ -115,7 +115,7 @@ btn_get_standby_account_info = tk.Button(master=frm_form, command = get_standby_account_info) btn_get_standby_account_info.grid(row=1, column=2, sticky = "nsew") btn_standby_batch_mint = tk.Button(master=frm_form, - text="Batch Mint", + text="Batch Mint NFTs", command = standby_batch_mint) btn_standby_batch_mint.grid(row=5, column=2, sticky = "nsew") btn_standby_get_batch_nfts = tk.Button(master=frm_form, diff --git a/_code-samples/quickstart/py/lesson9-conditional-escrow.py b/_code-samples/quickstart/py/lesson9-conditional-escrow.py index 33f8c3e3d1..ef3a6afcb8 100644 --- a/_code-samples/quickstart/py/lesson9-conditional-escrow.py +++ b/_code-samples/quickstart/py/lesson9-conditional-escrow.py @@ -4,7 +4,7 @@ import json from mod1 import get_account, get_account_info, send_xrp from mod8 import get_escrows, cancel_time_escrow, get_transaction -from mod9 import create_conditional_escrow, finish_conditional_escrow +from mod9 import create_conditional_escrow, finish_conditional_escrow, generate_condition ############################################# @@ -13,6 +13,12 @@ from mod9 import create_conditional_escrow, finish_conditional_escrow ## Mod 9 Handlers +def get_condition(): + results = generate_condition() + ent_standby_escrow_condition.delete(0, tk.END) + ent_standby_escrow_condition.insert(0, results[0]) + ent_operational_escrow_fulfillment.delete(0, tk.END) + ent_operational_escrow_fulfillment.insert(0, results[1]) def standby_create_conditional_escrow(): results = create_conditional_escrow( @@ -37,7 +43,6 @@ def operational_finish_conditional_escrow(): text_operational_results.insert("1.0", json.dumps(results, indent=4)) - ## Mod 8 Handlers def operational_get_escrows(): @@ -131,7 +136,6 @@ lbl_standby_destination = tk.Label(master=frm_form, text="Destination") ent_standby_destination = tk.Entry(master=frm_form, width=50) lbl_standby_balance = tk.Label(master=frm_form, text="XRP Balance") ent_standby_balance = tk.Entry(master=frm_form, width=50) - lbl_standby_escrow_condition = tk.Label(master=frm_form, text="Escrow Condition") ent_standby_escrow_condition = tk.Entry(master=frm_form, width=50) lbl_standby_escrow_cancel = tk.Label(master=frm_form, text="Escrow Cancel (seconds)") @@ -180,14 +184,14 @@ lbl_operational_destination = tk.Label(master=frm_form, text="Destination") ent_operational_destination = tk.Entry(master=frm_form, width=50) lbl_operational_balance = tk.Label(master=frm_form, text="XRP Balance") ent_operational_balance = tk.Entry(master=frm_form, width=50) +lbl_operational_escrow_fulfillment = tk.Label(master=frm_form, text="Escrow Fulfillment") +ent_operational_escrow_fulfillment = tk.Entry(master=frm_form, width=50) lbl_operational_sequence_number = tk.Label(master=frm_form, text="Sequence Number") ent_operational_sequence_number = tk.Entry(master=frm_form, width=50) lbl_operational_escrow_owner=tk.Label(master=frm_form, text="Escrow Owner") ent_operational_escrow_owner=tk.Entry(master=frm_form, width=50) lbl_operational_look_up = tk.Label(master=frm_form, text="Transaction to Look Up") ent_operational_look_up = tk.Entry(master=frm_form, width=50) -lbl_operational_escrow_fulfillment = tk.Label(master=frm_form, text="Escrow Fulfillment") -ent_operational_escrow_fulfillment = tk.Entry(master=frm_form, width=50) lbl_operational_results = tk.Label(master=frm_form,text='Results') text_operational_results = tk.Text(master=frm_form, height = 20, width = 65) @@ -229,13 +233,15 @@ btn_get_standby_account_info.grid(row = 1, column = 2, sticky = "nsew") btn_standby_send_xrp = tk.Button(master=frm_form, text="Send XRP >", command = standby_send_xrp) btn_standby_send_xrp.grid(row = 2, column = 2, sticky = "nsew") - +btn_standby_get_condition = tk.Button(master=frm_form, text="Get Condition", + command = get_condition) +btn_standby_get_condition.grid(row=4, column=2, sticky="nsew") btn_standby_create_escrow = tk.Button(master=frm_form, text="Create Conditional Escrow", command = standby_create_conditional_escrow) -btn_standby_create_escrow.grid(row = 4, column = 2, sticky="nsew") +btn_standby_create_escrow.grid(row=5, column = 2, sticky="nsew") btn_standby_cancel_escrow = tk.Button(master=frm_form, text="Cancel Escrow", command = standby_cancel_time_escrow) -btn_standby_cancel_escrow.grid(row=5,column = 2, sticky="nsew") +btn_standby_cancel_escrow.grid(row=6,column = 2, sticky="nsew") # Create the Operational Account Buttons btn_get_operational_account = tk.Button(master=frm_form, diff --git a/_code-samples/quickstart/py/mod1.py b/_code-samples/quickstart/py/mod1.py index 90ad06a707..aa8e591f03 100644 --- a/_code-samples/quickstart/py/mod1.py +++ b/_code-samples/quickstart/py/mod1.py @@ -1,6 +1,6 @@ import xrpl -testnet_url = "https://s.altnet.rippletest.net:51234/" +testnet_url = "https://s.devnet.rippletest.net:51234/" def get_account(seed): """get_account""" @@ -33,4 +33,5 @@ def send_xrp(seed, amount, destination): response = xrpl.transaction.submit_and_wait(payment, client, sending_wallet) except xrpl.transaction.XRPLReliableSubmissionException as e: response = f"Submit failed: {e}" + return response diff --git a/_code-samples/quickstart/py/mod10.py b/_code-samples/quickstart/py/mod10.py new file mode 100644 index 0000000000..e97a568fa3 --- /dev/null +++ b/_code-samples/quickstart/py/mod10.py @@ -0,0 +1,83 @@ +import xrpl +from xrpl.clients import JsonRpcClient +from xrpl.wallet import Wallet +from datetime import datetime +from xrpl.models.transactions import CheckCreate, CheckCash, CheckCancel +from xrpl.models.requests import AccountObjects, AccountTx, GatewayBalances + +testnet_url = "https://s.devnet.rippletest.net:51234" + +def send_check(seed, amount, destination, currency, issuer): + """send_check""" + wallet=Wallet.from_seed(seed) + client=JsonRpcClient(testnet_url) + if currency != "XRP": + amount = {"value": amount, + "currency": currency, + "issuer": issuer + } + check_tx=xrpl.models.transactions.CheckCreate( + account=wallet.address, + send_max=amount, + destination=destination + ) + # Submit the transaction and report the results + reply="" + try: + response=xrpl.transaction.submit_and_wait(check_tx,client,wallet) + reply=response.result + except xrpl.transaction.XRPLReliableSubmissionException as e: + reply=f"Submit failed: {e}" + return reply + +def cash_check(seed, amount, check_id, currency, issuer): + """cash_check""" + wallet=Wallet.from_seed(seed) + client=JsonRpcClient(testnet_url) + if currency != "XRP": + amount = { + "value": amount, + "currency": currency, + "issuer": issuer + } + finish_tx=xrpl.models.transactions.CheckCash( + account=wallet.address, + amount=amount, + check_id=check_id + ) + # Submit the transaction and report the results + reply="" + try: + response=xrpl.transaction.submit_and_wait(finish_tx,client,wallet) + reply=response.result + except xrpl.transaction.XRPLReliableSubmissionException as e: + reply=f"Submit failed: {e}" + return reply + +def cancel_check(seed, check_id): + """cancel_check""" + wallet=Wallet.from_seed(seed) + client=JsonRpcClient(testnet_url) + cancel_tx=xrpl.models.transactions.CheckCancel( + account=wallet.address, + check_id=check_id + ) + # Submit the transaction and report the results + reply="" + try: + response=xrpl.transaction.submit_and_wait(cancel_tx,client,wallet) + reply=response.result + except xrpl.transaction.XRPLReliableSubmissionException as e: + reply=f"Submit failed: {e}" + return reply + +def get_checks(account): + """get_checks""" + client=JsonRpcClient(testnet_url) + acct_checks=AccountObjects( + account=account, + ledger_index="validated", + type="check" + ) + response=client.request(acct_checks) + return response.result diff --git a/_code-samples/quickstart/py/mod2.py b/_code-samples/quickstart/py/mod2.py index 035375da8d..0775f36c79 100644 --- a/_code-samples/quickstart/py/mod2.py +++ b/_code-samples/quickstart/py/mod2.py @@ -3,7 +3,7 @@ from xrpl.clients import JsonRpcClient from xrpl.wallet import Wallet -testnet_url = "https://s.altnet.rippletest.net:51234" +testnet_url = "https://s.devnet.rippletest.net:51234" ##################### # create_trust_line # @@ -54,13 +54,14 @@ def send_currency(seed, destination, currency, amount): # get_balance # ############### -def get_balance(sb_account_id, op_account_id): +def get_balance(sb_account_seed, op_account_seed): """get_balance""" + wallet = Wallet.from_seed(sb_account_seed) + opWallet = Wallet.from_seed(op_account_seed) client=JsonRpcClient(testnet_url) balance=xrpl.models.requests.GatewayBalances( - account=sb_account_id, - ledger_index="validated", - hotwallet=[op_account_id] + account=wallet.address, + ledger_index="validated" ) response = client.request(balance) return response.result diff --git a/_code-samples/quickstart/py/mod7.py b/_code-samples/quickstart/py/mod7.py index 7ed5f048d7..64f66461fc 100644 --- a/_code-samples/quickstart/py/mod7.py +++ b/_code-samples/quickstart/py/mod7.py @@ -17,7 +17,6 @@ def batch_mint(seed, uri, flags, transfer_fee, taxon, count): ) get_seq_request = client.request(acct_info) current_sequence=get_seq_request.result['account_data']['Sequence'] - ticket_tx=xrpl.models.transactions.TicketCreate( account=wallet.address, ticket_count=int(count), diff --git a/_code-samples/quickstart/py/mod9.py b/_code-samples/quickstart/py/mod9.py index 78499a22e2..f1862c81fa 100644 --- a/_code-samples/quickstart/py/mod9.py +++ b/_code-samples/quickstart/py/mod9.py @@ -3,9 +3,17 @@ from xrpl.clients import JsonRpcClient from xrpl.wallet import Wallet from datetime import datetime from xrpl.models.transactions import EscrowCreate, EscrowFinish +from os import urandom +from cryptoconditions import PreimageSha256 testnet_url = "https://s.altnet.rippletest.net:51234" +def generate_condition(): + randy = urandom(32) + fulfillment = PreimageSha256(preimage=randy) + return (fulfillment.condition_binary.hex().upper(), + fulfillment.serialize_binary().hex().upper()) + def add_seconds(numOfSeconds): new_date = datetime.now() if new_date != '': @@ -18,6 +26,7 @@ def create_conditional_escrow(seed, amount, destination, cancel, condition): wallet=Wallet.from_seed(seed) client=JsonRpcClient(testnet_url) cancel_date = add_seconds(cancel) + finish_date = cancel_date - 200 escrow_tx=xrpl.models.transactions.EscrowCreate( account=wallet.address, diff --git a/community/report-a-scam.md b/community/report-a-scam.md index f8aba00e09..ce6fefad62 100644 --- a/community/report-a-scam.md +++ b/community/report-a-scam.md @@ -24,7 +24,7 @@ If you think you've been scammed, make sure to collect as much information as yo - [Uphold](https://support.uphold.com/hc/en-us/requests/new) - [Bitrue](https://www.bitrue.com/exchange-web/footer/contactus.html) -4. If the scammer exchanged XRP for another token on the XRP Ledger, contact the token's issuer. The issuer may be able to [freeze the scammer's trust line](../docs/tutorials/tasks/use-tokens/freeze-a-trust-line.md) to prevent the scammer from sending those tokens to others. +4. If the scammer exchanged XRP for another token on the XRP Ledger, contact the token's issuer. The issuer may be able to [freeze the scammer's trust line](../docs/tutorials/how-tos/use-tokens/freeze-a-trust-line.md) to prevent the scammer from sending those tokens to others. For more details on reporting scammers, see [Xrplorer Forensics Help](https://xrplorer.com/forensics/help). diff --git a/docs/_snippets/checkcash-prereqs.md b/docs/_snippets/checkcash-prereqs.md index 2c7c8cd419..7506c13aea 100644 --- a/docs/_snippets/checkcash-prereqs.md +++ b/docs/_snippets/checkcash-prereqs.md @@ -5,4 +5,4 @@ The prerequisites for cashing a check are the same whether you are cashing it fo - 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/get-started.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). diff --git a/docs/_snippets/post-rippled-install.md b/docs/_snippets/post-rippled-install.md index c9139d04a0..3b8b087558 100644 --- a/docs/_snippets/post-rippled-install.md +++ b/docs/_snippets/post-rippled-install.md @@ -1,6 +1,6 @@ It can take several minutes to sync with the rest of the XRP Ledger network, during which time the server outputs various warnings. For information about log messages, see [Understanding Log Messages](../infrastructure/troubleshooting/understanding-log-messages.md). -You can use the [`rippled` commandline interface](../tutorials/http-websocket-apis/get-started.md#commandline) to see if your server is synced with the network: +You can use the [`rippled` commandline interface](../tutorials/http-websocket-apis/build-apps/get-started.md#commandline) to see if your server is synced with the network: ```sh rippled server_info diff --git a/docs/concepts/accounts/account-types.md b/docs/concepts/accounts/account-types.md index 7e58a2d915..f2ba789b7c 100644 --- a/docs/concepts/accounts/account-types.md +++ b/docs/concepts/accounts/account-types.md @@ -74,8 +74,8 @@ If a standby address is compromised, the consequences are like an operational ad - [Accounts](index.md) - [Cryptographic Keys](cryptographic-keys.md) - **Tutorials:** - - [Assign a Regular Key Pair](../../tutorials/tasks/manage-account-settings/assign-a-regular-key-pair.md) - - [Change or Remove a Regular Key Pair](../../tutorials/tasks/manage-account-settings/change-or-remove-a-regular-key-pair.md) + - [Assign a Regular Key Pair](../../tutorials/how-tos/manage-account-settings/assign-a-regular-key-pair.md) + - [Change or Remove a Regular Key Pair](../../tutorials/how-tos/manage-account-settings/change-or-remove-a-regular-key-pair.md) - **References:** - [account_info method][] - [SetRegularKey transaction][] diff --git a/docs/concepts/accounts/cryptographic-keys.md b/docs/concepts/accounts/cryptographic-keys.md index 61471905e9..0cb1d94f0b 100644 --- a/docs/concepts/accounts/cryptographic-keys.md +++ b/docs/concepts/accounts/cryptographic-keys.md @@ -88,7 +88,7 @@ The [wallet_propose method][] is one way of generating a master key pair. The re **Warning:** If a malicious actor learns your master private key (or seed), they have full control over your account, unless your master key pair is disabled. They can take all the money your account holds and do other irreparable harm. Treat your secret values with care! -Because changing a master key pair is impossible, you should treat it with care proportionate to the value it holds. A good practice is to [keep your master key pair offline](../../tutorials/tasks/manage-account-settings/offline-account-setup.md) and set up a regular key pair to sign transactions from your account instead. By keeping the master key pair enabled but offline, you can be reasonably certain that no one can get access to it using the internet, but you can still go find it to use in an emergency. +Because changing a master key pair is impossible, you should treat it with care proportionate to the value it holds. A good practice is to [keep your master key pair offline](../../tutorials/how-tos/manage-account-settings/offline-account-setup.md) and set up a regular key pair to sign transactions from your account instead. By keeping the master key pair enabled but offline, you can be reasonably certain that no one can get access to it using the internet, but you can still go find it to use in an emergency. Keeping your master key pair offline means not putting the secret information (passphrase, seed, or private key) anywhere that malicious actors can get access to it. In general, this means it is not within reach of a computer program that interacts with the internet at large. For example, you could keep it on an air-gapped machine that never connects to the internet, on a piece of paper stored in a safe, or have it completely memorized. (Memorization has some drawbacks, though, including making it impossible to pass the key on after you are dead.) @@ -119,7 +119,7 @@ A good security practice is to save your master private key somewhere offline, a Regular key pairs have the same format as master key pairs. You generate them the same way (for example, using the [wallet_propose method][]). The only difference is that a regular key pair is not intrinsically tied to the account it signs transactions for. It is possible (but not a good idea) to use the master key pair from one account as the regular key pair for another account. -The [SetRegularKey transaction][] assigns or changes the regular key pair for an account. For a tutorial on assigning or changing a regular key pair, see [Assign a Regular Key Pair](../../tutorials/tasks/manage-account-settings/assign-a-regular-key-pair.md). +The [SetRegularKey transaction][] assigns or changes the regular key pair for an account. For a tutorial on assigning or changing a regular key pair, see [Assign a Regular Key Pair](../../tutorials/how-tos/manage-account-settings/assign-a-regular-key-pair.md). ## Signing Algorithms @@ -248,8 +248,8 @@ The steps to derive the XRP Ledger's secp256k1 account key pair from a seed valu - **Concepts:** - [Issuing and Operational Addresses](account-types.md) - **Tutorials:** - - [Assign a Regular Key Pair](../../tutorials/tasks/manage-account-settings/assign-a-regular-key-pair.md) - - [Change or Remove a Regular Key Pair](../../tutorials/tasks/manage-account-settings/change-or-remove-a-regular-key-pair.md) + - [Assign a Regular Key Pair](../../tutorials/how-tos/manage-account-settings/assign-a-regular-key-pair.md) + - [Change or Remove a Regular Key Pair](../../tutorials/how-tos/manage-account-settings/change-or-remove-a-regular-key-pair.md) - **References:** - [SetRegularKey transaction][] - [AccountRoot ledger object](../../references/protocol/ledger-data/ledger-entry-types/accountroot.md) diff --git a/docs/concepts/accounts/index.md b/docs/concepts/accounts/index.md index 4baa9fbdb3..5371eaa1c4 100644 --- a/docs/concepts/accounts/index.md +++ b/docs/concepts/accounts/index.md @@ -63,7 +63,7 @@ The typical way to get an account in the XRP Ledger is as follows: - [Payment transaction][] - [AccountRoot object](../../references/protocol/ledger-data/ledger-entry-types/accountroot.md) - **Tutorials:** - - [Manage Account Settings (Category)](../../tutorials/tasks/manage-account-settings/index.md) - - [Monitor Incoming Payments with WebSocket](../../tutorials/http-websocket-apis/monitor-incoming-payments-with-websocket.md) + - [Manage Account Settings (Category)](../../tutorials/how-tos/manage-account-settings/index.md) + - [Monitor Incoming Payments with WebSocket](../../tutorials/http-websocket-apis/build-apps/monitor-incoming-payments-with-websocket.md) {% raw-partial file="/docs/_snippets/common-links.md" /%} diff --git a/docs/concepts/accounts/multi-signing.md b/docs/concepts/accounts/multi-signing.md index f7d94537af..a4f9f4504b 100644 --- a/docs/concepts/accounts/multi-signing.md +++ b/docs/concepts/accounts/multi-signing.md @@ -60,7 +60,7 @@ There might be a scenario where you create a multi-signing list as a "backup pla To successfully submit a multi-signed transaction, you must do all of the following: -* The address sending the transaction (specified in the `Account` field) must have a [`SignerList` object in the ledger](../../references/protocol/ledger-data/ledger-entry-types/signerlist.md). For instructions on how to do this, see [Set Up Multi-Signing](../../tutorials/tasks/manage-account-settings/set-up-multi-signing.md). +* The address sending the transaction (specified in the `Account` field) must have a [`SignerList` object in the ledger](../../references/protocol/ledger-data/ledger-entry-types/signerlist.md). For instructions on how to do this, see [Set Up Multi-Signing](../../tutorials/how-tos/manage-account-settings/set-up-multi-signing.md). * The transaction must include the `SigningPubKey` field as an empty string. * The transaction must include a [`Signers` field](../../references/protocol/transactions/common-fields.md#signers-field) containing an array of signatures. * The signatures present in the `Signers` array must match signers defined in the `SignerList`. @@ -72,8 +72,8 @@ To successfully submit a multi-signed transaction, you must do all of the follow ## See Also - **Tutorials:** - - [Set Up Multi-Signing](../../tutorials/tasks/manage-account-settings/set-up-multi-signing.md) - - [Send a Multi-Signed Transaction](../../tutorials/tasks/manage-account-settings/send-a-multi-signed-transaction.md) + - [Set Up Multi-Signing](../../tutorials/how-tos/manage-account-settings/set-up-multi-signing.md) + - [Send a Multi-Signed Transaction](../../tutorials/how-tos/manage-account-settings/send-a-multi-signed-transaction.md) - **Concepts:** - [Cryptographic Keys](cryptographic-keys.md) - [Special Transaction Cost for Multi-signed transactions](../transactions/transaction-cost.md#special-transaction-costs) diff --git a/docs/concepts/accounts/reserves.md b/docs/concepts/accounts/reserves.md index b23955e225..1d917cbd6d 100644 --- a/docs/concepts/accounts/reserves.md +++ b/docs/concepts/accounts/reserves.md @@ -54,7 +54,7 @@ Applications can look up the current base and incremental reserve values using t To determine the owner reserve of an account, multiply the incremental reserve by the number of objects the account owns. To look up the number of objects an account owns, call the [account_info method][] and take `account_data.OwnerCount`. -To calculate an address's total reserve requirement, multiply `OwnerCount` by `reserve_inc_xrp`, then add `reserve_base_xrp`. [Here is a demonstration](../../tutorials/python/build-a-desktop-wallet-in-python.md#codeblock-17) of this calculation in Python. +To calculate an address's total reserve requirement, multiply `OwnerCount` by `reserve_inc_xrp`, then add `reserve_base_xrp`. [Here is a demonstration](../../tutorials/python/build-apps/build-a-desktop-wallet-in-python.md#codeblock-17) of this calculation in Python. ## Going Below the Reserve Requirement @@ -76,6 +76,6 @@ The XRP Ledger has a mechanism to adjust the reserve requirements. Such adjustme - [AccountRoot Object][] - [Fee Voting](../consensus-protocol/fee-voting.md) - [SetFee pseudo-transaction][] -- [Tutorial: Calculate and display the reserve requirement (Python)](../../tutorials/python/build-a-desktop-wallet-in-python.md#3-display-an-account) +- [Tutorial: Calculate and display the reserve requirement (Python)](../../tutorials/python/build-apps/build-a-desktop-wallet-in-python.md#3-display-an-account) {% raw-partial file="/docs/_snippets/common-links.md" /%} diff --git a/docs/concepts/accounts/tickets.md b/docs/concepts/accounts/tickets.md index 688068e51f..9e28a8d45e 100644 --- a/docs/concepts/accounts/tickets.md +++ b/docs/concepts/accounts/tickets.md @@ -63,7 +63,7 @@ Any account can create and use Tickets on any type of transaction. However, some - **Concepts:** - [Multi-Signing](multi-signing.md) - **Tutorials:** - - [Use Tickets](../../tutorials/tasks/manage-account-settings/use-tickets.md) + - [Use Tickets](../../tutorials/how-tos/manage-account-settings/use-tickets.md) - **References:** - [TicketCreate transaction][] - [Transaction Common Fields](../../references/protocol/transactions/common-fields.md) diff --git a/docs/concepts/networks-and-servers/index.md b/docs/concepts/networks-and-servers/index.md index ab43393902..ca5c7199b8 100644 --- a/docs/concepts/networks-and-servers/index.md +++ b/docs/concepts/networks-and-servers/index.md @@ -27,7 +27,7 @@ You need to trust the server you use. If you connect to a malicious server, ther * It could selectively show or hide payment paths and currency exchange offers to guarantee its own profit while not providing you the best deal. * If you sent it your address's secret key, it could make arbitrary transactions on your behalf, and even transfer or destroy all the money your address holds. -Additionally, running your own server gives you [admin access](../../tutorials/http-websocket-apis/get-started.md#admin-access), which allows you to run important admin-only and load-intensive commands. If you use a shared server, you have to worry about other users of the same server competing with you for the server's computing power. Many of the commands in the WebSocket API can put a lot of strain on the server, so the server has the option to scale back its responses when it needs to. If you share a server with others, you may not always get the best results possible. +Additionally, running your own server gives you [admin access](../../tutorials/http-websocket-apis/build-apps/get-started.md#admin-access), which allows you to run important admin-only and load-intensive commands. If you use a shared server, you have to worry about other users of the same server competing with you for the server's computing power. Many of the commands in the WebSocket API can put a lot of strain on the server, so the server has the option to scale back its responses when it needs to. If you share a server with others, you may not always get the best results possible. Finally, if you run a validating server, you can use a stock server as a proxy to the public network while keeping your validating server on a private network only accessible to the outside world through the stock server. This makes it more difficult to compromise the integrity of your validating server. diff --git a/docs/concepts/networks-and-servers/rippled-server-modes.md b/docs/concepts/networks-and-servers/rippled-server-modes.md index c297f63f85..f174061cc5 100644 --- a/docs/concepts/networks-and-servers/rippled-server-modes.md +++ b/docs/concepts/networks-and-servers/rippled-server-modes.md @@ -12,7 +12,7 @@ The `rippled` server software can run in several modes depending on its configur - [**P2P Mode**](#p2p-mode) - This is the main mode of the server: it follows the peer-to-peer network, processes transactions, and maintains some amount of [ledger history](ledger-history.md). This mode can be configured to do any or all of the following roles: - [**Validator**](#validators) - Helps secure the network by participating in consensus. - - [**API Server**](#api-servers) - Provides [API access](../../tutorials/http-websocket-apis/get-started.md) to read data from the shared ledger, submit transactions, and watch activity in the ledger. Optionally, this can be a [**Full History Server**](#full-history-servers), which keeps a complete record of transaction and ledger history. + - [**API Server**](#api-servers) - Provides [API access](../../tutorials/http-websocket-apis/build-apps/get-started.md) to read data from the shared ledger, submit transactions, and watch activity in the ledger. Optionally, this can be a [**Full History Server**](#full-history-servers), which keeps a complete record of transaction and ledger history. - [**Hub Server**](#public-hubs) - Relays messages between many other members of the peer-to-peer network. - [**Reporting mode**](#reporting-mode) - A specialized mode for serving API requests from a relational database. It does not participate in the peer-to-peer network, so you need to run a P2P Mode server and connect the reporting mode server using a trusted gRPC connection. - [**Stand-alone mode**](#stand-alone-mode) - An offline mode for testing. Does not connect to the peer-to-peer network or use consensus. diff --git a/docs/concepts/payment-types/checks.md b/docs/concepts/payment-types/checks.md index 78ed3a4e8b..6c87515ebf 100644 --- a/docs/concepts/payment-types/checks.md +++ b/docs/concepts/payment-types/checks.md @@ -48,19 +48,19 @@ For more information about Checks in the XRP Ledger, see: - [CheckCreate][] - [CheckCash][] - [CheckCancel][] -- [Checks Tutorials](../../tutorials/tasks/use-specialized-payment-types/use-checks/use-checks.md) - - [Send a Check](../../tutorials/tasks/use-specialized-payment-types/use-checks/send-a-check.md) - - [Look up Checks by sender address](../../tutorials/tasks/use-specialized-payment-types/use-checks/look-up-checks-by-sender.md) - - [Look up Checks by recipient address](../../tutorials/tasks/use-specialized-payment-types/use-checks/look-up-checks-by-recipient.md) - - [Cash a Check for an exact amount](../../tutorials/tasks/use-specialized-payment-types/use-checks/cash-a-check-for-an-exact-amount.md) - - [Cash a Check for a flexible amount](../../tutorials/tasks/use-specialized-payment-types/use-checks/cash-a-check-for-a-flexible-amount.md) - - [Cancel a Check](../../tutorials/tasks/use-specialized-payment-types/use-checks/cancel-a-check.md) +- [Checks Tutorials](../../tutorials/how-tos/use-specialized-payment-types/use-checks/use-checks.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) + - [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) - [Checks amendment][] For more information about related features, see: * [Deposit Authorization](../accounts/depositauth.md) * [Escrow](escrow.md) -* [Payment Channels Tutorial](../../tutorials/tasks/use-specialized-payment-types/use-payment-channels/index.md) +* [Payment Channels Tutorial](../../tutorials/how-tos/use-specialized-payment-types/use-payment-channels/index.md) {% raw-partial file="/docs/_snippets/common-links.md" /%} diff --git a/docs/concepts/payment-types/direct-xrp-payments.md b/docs/concepts/payment-types/direct-xrp-payments.md index 7d08b633fd..3a7cc47a0c 100644 --- a/docs/concepts/payment-types/direct-xrp-payments.md +++ b/docs/concepts/payment-types/direct-xrp-payments.md @@ -39,8 +39,8 @@ The basis of any financial system is transferring value. The quickest and simple ## See Also - **Tutorials:** - - [Send XRP (Interactive Tutorial)](../../tutorials/tasks/send-xrp.md) - - [Monitor Incoming Payments with WebSocket](../../tutorials/http-websocket-apis/monitor-incoming-payments-with-websocket.md) + - [Send XRP (Interactive Tutorial)](../../tutorials/how-tos/send-xrp.md) + - [Monitor Incoming Payments with WebSocket](../../tutorials/http-websocket-apis/build-apps/monitor-incoming-payments-with-websocket.md) - **References:** - [Payment transaction][] - [Transaction Results](../../references/protocol/transactions/transaction-results/transaction-results.md) diff --git a/docs/concepts/payment-types/escrow.md b/docs/concepts/payment-types/escrow.md index eaf002e84a..70634c4e0e 100644 --- a/docs/concepts/payment-types/escrow.md +++ b/docs/concepts/payment-types/escrow.md @@ -82,7 +82,7 @@ reference_fee * (signer_count + 33 + (fulfillment_bytes / 16)) For more information about Escrow in the XRP Ledger, see the following: -- [Escrow Tutorials](../../tutorials/tasks/use-specialized-payment-types/use-escrows/index.md) +- [Escrow Tutorials](../../tutorials/how-tos/use-specialized-payment-types/use-escrows/index.md) - [Transaction Reference](../../references/protocol/transactions/index.md) - [EscrowCreate transaction][] - [EscrowFinish transaction][] diff --git a/docs/concepts/payment-types/partial-payments.md b/docs/concepts/payment-types/partial-payments.md index b212d41f58..bc3db771ad 100644 --- a/docs/concepts/payment-types/partial-payments.md +++ b/docs/concepts/payment-types/partial-payments.md @@ -128,8 +128,8 @@ Using [the `delivered_amount` field](#the-delivered_amount-field) when processin - [Transactions](../transactions/index.md) - **Tutorials:** - [Look Up Transaction Results](../transactions/finality-of-results/look-up-transaction-results.md) - - [Monitor Incoming Payments with WebSocket](../../tutorials/http-websocket-apis/monitor-incoming-payments-with-websocket.md) - - [Use Specialized Payment Types](../../tutorials/tasks/use-specialized-payment-types/index.md) + - [Monitor Incoming Payments with WebSocket](../../tutorials/http-websocket-apis/build-apps/monitor-incoming-payments-with-websocket.md) + - [Use Specialized Payment Types](../../tutorials/how-tos/use-specialized-payment-types/index.md) - [List XRP as an Exchange](../../use-cases/defi/list-xrp-as-an-exchange.md) - **References:** - [Payment transaction][] diff --git a/docs/concepts/payment-types/payment-channels.md b/docs/concepts/payment-types/payment-channels.md index b5aa8ca6d3..b560aa6fcc 100644 --- a/docs/concepts/payment-types/payment-channels.md +++ b/docs/concepts/payment-types/payment-channels.md @@ -39,8 +39,8 @@ The following diagram summarizes the lifecycle of a payment channel: - **Related Concepts:** - [Escrow](escrow.md), a similar feature for higher-value, lower-speed conditional XRP payments. - **Tutorials and Use Cases:** - - [Use Payment Channels](../../tutorials/tasks/use-specialized-payment-types/use-payment-channels/index.md), a tutorial stepping through the process of using a payment channel. - - [Open a Payment Channel to Enable an Inter-Exchange Network](../../tutorials/tasks/use-specialized-payment-types/use-payment-channels/open-a-payment-channel-to-enable-an-inter-exchange-network.md) + - [Use Payment Channels](../../tutorials/how-tos/use-specialized-payment-types/use-payment-channels/index.md), a tutorial stepping through the process of using a payment channel. + - [Open a Payment Channel to Enable an Inter-Exchange Network](../../tutorials/how-tos/use-specialized-payment-types/use-payment-channels/open-a-payment-channel-to-enable-an-inter-exchange-network.md) - **References:** - [channel_authorize method][] - [channel_verify method][] diff --git a/docs/concepts/payment-types/sending-payments-to-customers.md b/docs/concepts/payment-types/sending-payments-to-customers.md index 84a4e09ce2..8e2e6558d6 100644 --- a/docs/concepts/payment-types/sending-payments-to-customers.md +++ b/docs/concepts/payment-types/sending-payments-to-customers.md @@ -19,6 +19,6 @@ Generally, when sending stablecoins, you use a [Payment transaction][]. Some of - Omit the `Paths` field. This field is unnecessary when sending directly from the issuer, or from a hot wallet as long as the tokens being sent and the tokens being received have the same currency code and issuer—that is, they're the same stablecoin. The `Paths` field is intended for [Cross-Currency Payments](cross-currency-payments.md) and longer multi-hop (rippling) payments. If you naively perform pathfinding and attach the paths to your transaction, your payment may take a more expensive indirect route rather than failing if the direct path is not available; malicious users can even set this up to. - If you get a `tecPATH_DRY` result code, this usually indicates that either the customer doesn't have the necessary trust line set up already, or your issuer's rippling settings aren't configured correctly. -For a detailed tutorial on issuing a token on the XRP Ledger, whether a stablecoin or otherwise, see [Issue a Fungible Token](../../tutorials/tasks/use-tokens/issue-a-fungible-token.md). +For a detailed tutorial on issuing a token on the XRP Ledger, whether a stablecoin or otherwise, see [Issue a Fungible Token](../../tutorials/how-tos/use-tokens/issue-a-fungible-token.md). {% raw-partial file="/docs/_snippets/common-links.md" /%} diff --git a/docs/concepts/tokens/decentralized-exchange/index.md b/docs/concepts/tokens/decentralized-exchange/index.md index 0e3df116dd..eab8ed6b33 100644 --- a/docs/concepts/tokens/decentralized-exchange/index.md +++ b/docs/concepts/tokens/decentralized-exchange/index.md @@ -12,7 +12,7 @@ targets: The XRP Ledger has possibly the world's oldest _decentralized exchange_ (sometimes abbreviated "DEX"), operating continuously since the XRP Ledger's launch in 2012. The exchange allows users to buy and sell [tokens](../index.md) for XRP or other tokens, with minimal [fees](../../transactions/fees.md) charged to the network itself (not paid out to any party). -**Caution:** Anyone can [issue a token](../../../tutorials/tasks/use-tokens/issue-a-fungible-token.md) with any currency code or ticker symbol they want and sell it in the decentralized exchange. Always perform due diligence before buying a token, and pay attention to the issuer. Otherwise, you might give up something of value and receive worthless tokens in exchange. +**Caution:** Anyone can [issue a token](../../../tutorials/how-tos/use-tokens/issue-a-fungible-token.md) with any currency code or ticker symbol they want and sell it in the decentralized exchange. Always perform due diligence before buying a token, and pay attention to the issuer. Otherwise, you might give up something of value and receive worthless tokens in exchange. ## Structure diff --git a/docs/concepts/tokens/fungible-tokens/freezes.md b/docs/concepts/tokens/fungible-tokens/freezes.md index 96765711a3..a975612198 100644 --- a/docs/concepts/tokens/fungible-tokens/freezes.md +++ b/docs/concepts/tokens/fungible-tokens/freezes.md @@ -87,9 +87,9 @@ You can only enable the No Freeze setting with a transaction signed by your addr - **Concepts:** - [Trust Lines and Issuing](index.md) - **Tutorials:** - - [Enable No Freeze](../../../tutorials/tasks/use-tokens/enable-no-freeze.md) - - [Enact Global Freeze](../../../tutorials/tasks/use-tokens/enact-global-freeze.md) - - [Freeze a Trust Line](../../../tutorials/tasks/use-tokens/freeze-a-trust-line.md) + - [Enable No Freeze](../../../tutorials/how-tos/use-tokens/enable-no-freeze.md) + - [Enact Global Freeze](../../../tutorials/how-tos/use-tokens/enact-global-freeze.md) + - [Freeze a Trust Line](../../../tutorials/how-tos/use-tokens/freeze-a-trust-line.md) - **References:** - [account_lines method][] - [account_info method][] diff --git a/docs/concepts/tokens/fungible-tokens/stablecoins/configuration.md b/docs/concepts/tokens/fungible-tokens/stablecoins/configuration.md index 49a6b0f370..f173cffbb2 100644 --- a/docs/concepts/tokens/fungible-tokens/stablecoins/configuration.md +++ b/docs/concepts/tokens/fungible-tokens/stablecoins/configuration.md @@ -8,7 +8,7 @@ labels: --- # Stablecoin Configuration -There are some settings you must configure on your XRP Ledger account before you start issuing tokens. For examples of how to configure these settings, see [Issue a Fungible Token](../../../../tutorials/tasks/use-tokens/issue-a-fungible-token.md). +There are some settings you must configure on your XRP Ledger account before you start issuing tokens. For examples of how to configure these settings, see [Issue a Fungible Token](../../../../tutorials/how-tos/use-tokens/issue-a-fungible-token.md). Settings you might want to configure include: diff --git a/docs/concepts/tokens/nfts/batch-minting.md b/docs/concepts/tokens/nfts/batch-minting.md index edcbb25d6a..cc50d9f490 100644 --- a/docs/concepts/tokens/nfts/batch-minting.md +++ b/docs/concepts/tokens/nfts/batch-minting.md @@ -28,7 +28,7 @@ Any market activity before the initial sale of the NFT is not recorded on the XR Use a program or script to mint many tokens at once. You might find that [Tickets](../../accounts/tickets.md) help you submit transactions in parallel, up to a current limit of 200 transactions in one group. -For a practical example, see the [Batch Mint NFTs Using JavaScript](../../../tutorials/javascript/modular-tutorials/nfts/batch-mint-nfts.md) tutorial. +For a practical example, see the [Batch Mint NFTs Using JavaScript](../../../tutorials/javascript/nfts/batch-mint-nfts.md) tutorial. ### Benefits diff --git a/docs/concepts/tokens/nfts/guaranteeing-a-fixed-supply.md b/docs/concepts/tokens/nfts/guaranteeing-a-fixed-supply.md index c4cedc3c00..97e98c30f3 100644 --- a/docs/concepts/tokens/nfts/guaranteeing-a-fixed-supply.md +++ b/docs/concepts/tokens/nfts/guaranteeing-a-fixed-supply.md @@ -16,7 +16,7 @@ To guarantee a fixed number of NFTs: 1. Use `AccountSet` to assign your operational wallet as an authorized minter for the issuer. See [Authorizing Another Account to Mint Your NFTs](authorizing-another-minter.md). 1. Use your operational account to mint the tokens using `NFTokenMint`. The operational wallet holds all of the tokens minted for the Issuer. See [Batch Minting](batch-minting.md). 1. Use `AccountSet` to remove your operational wallet as an authorized minter for the Issuer. -1. “Blackhole” the Issuer account. See [Disable Master Key Pair](../../../tutorials/tasks/manage-account-settings/disable-master-key-pair.md). +1. “Blackhole” the Issuer account. See [Disable Master Key Pair](../../../tutorials/how-tos/manage-account-settings/disable-master-key-pair.md). At this point, it is impossible for any new tokens to be minted with the issuer’s address as the issuing account. diff --git a/docs/concepts/transactions/finality-of-results/look-up-transaction-results.md b/docs/concepts/transactions/finality-of-results/look-up-transaction-results.md index a806aad71d..737917eaad 100644 --- a/docs/concepts/transactions/finality-of-results/look-up-transaction-results.md +++ b/docs/concepts/transactions/finality-of-results/look-up-transaction-results.md @@ -446,7 +446,7 @@ Most other transactions create a specific type of ledger entry and [adjust the s - [Finality of Results](index.md) - [Reliable Transaction Submission](../reliable-transaction-submission.md) - **Tutorials:** - - [Monitor Incoming Payments with WebSocket](../../../tutorials/http-websocket-apis/monitor-incoming-payments-with-websocket.md) + - [Monitor Incoming Payments with WebSocket](../../../tutorials/http-websocket-apis/build-apps/monitor-incoming-payments-with-websocket.md) - **References:** - [Ledger Entry Types Reference](../../../references/protocol/ledger-data/ledger-entry-types/index.md) - All possible fields of all types of ledger entries - [Transaction Metadata](../../../references/protocol/transactions/metadata.md) - Summary of the metadata format and fields that appear in metadata diff --git a/docs/concepts/transactions/index.md b/docs/concepts/transactions/index.md index 3da934795a..d27cb8f34a 100644 --- a/docs/concepts/transactions/index.md +++ b/docs/concepts/transactions/index.md @@ -65,7 +65,7 @@ Sending a transaction to the XRP Ledger involves several steps: 5. The servers apply those transactions to the previous ledger in a canonical order and share their results. 6. If enough [trusted validators](../networks-and-servers/rippled-server-modes.md#validators) created the exact same ledger, that ledger is declared _validated_ and the [results of the transactions](../../references/protocol/transactions/transaction-results/transaction-results.md) in that ledger are immutable. -See [Send XRP](../../tutorials/tasks/send-xrp.md) for an interactive tutorial in sending XRP payments. +See [Send XRP](../../tutorials/how-tos/send-xrp.md) for an interactive tutorial in sending XRP payments. ### Example Unsigned Transaction @@ -207,9 +207,9 @@ Example response from the `tx` command: - [Payment Types](../payment-types/index.md) - **Tutorials:** - [Set Up Secure Signing](secure-signing.md) - - [Send XRP](../../tutorials/tasks/send-xrp.md) + - [Send XRP](../../tutorials/how-tos/send-xrp.md) - [Look Up Transaction Results](finality-of-results/look-up-transaction-results.md) - - [Monitor Incoming Payments with WebSocket](../../tutorials/http-websocket-apis/monitor-incoming-payments-with-websocket.md) + - [Monitor Incoming Payments with WebSocket](../../tutorials/http-websocket-apis/build-apps/monitor-incoming-payments-with-websocket.md) - [Cancel or Skip a Transaction](finality-of-results/canceling-a-transaction.md) - [Reliable Transaction Submission](reliable-transaction-submission.md) - **References:** diff --git a/docs/concepts/transactions/reliable-transaction-submission.md b/docs/concepts/transactions/reliable-transaction-submission.md index e5dba438db..a4349824b7 100644 --- a/docs/concepts/transactions/reliable-transaction-submission.md +++ b/docs/concepts/transactions/reliable-transaction-submission.md @@ -170,7 +170,7 @@ The difference between the two transaction failure cases (labeled (1) and (2) in **Tip:** The [`AccountTxnID` field](../../references/protocol/transactions/common-fields.md#accounttxnid) can help prevent redundant transactions from succeeding in this situation. - - A malicious actor may have used your secret key to send a transaction. If this is the case, [rotate your key pair](../../tutorials/tasks/manage-account-settings/change-or-remove-a-regular-key-pair.md) if you can, and check for other transactions sent. You should also audit your network to determine if the secret key was part of a larger intrusion or security leak. When you successfully rotate your key pair and are certain that the malicious actor no longer has access to your accounts and systems, you can resume normal activities. + - A malicious actor may have used your secret key to send a transaction. If this is the case, [rotate your key pair](../../tutorials/how-tos/manage-account-settings/change-or-remove-a-regular-key-pair.md) if you can, and check for other transactions sent. You should also audit your network to determine if the secret key was part of a larger intrusion or security leak. When you successfully rotate your key pair and are certain that the malicious actor no longer has access to your accounts and systems, you can resume normal activities. #### Ledger Gaps diff --git a/docs/concepts/transactions/secure-signing.md b/docs/concepts/transactions/secure-signing.md index 707efc5649..1bcdcd8880 100644 --- a/docs/concepts/transactions/secure-signing.md +++ b/docs/concepts/transactions/secure-signing.md @@ -47,7 +47,7 @@ In this configuration, you run `rippled` on the machine that generates the trans The [example config file](https://github.com/XRPLF/rippled/blob/8429dd67e60ba360da591bfa905b58a35638fda1/cfg/rippled-example.cfg#L1050-L1073) listens for connections on the local loopback network (127.0.0.1), with JSON-RPC (HTTP) on port 5005 and WebSocket (WS) on port 6006, and treats all connected clients as admin. - **Caution:** Using the [commandline API](../../references/http-websocket-apis/api-conventions/request-formatting.md#commandline-format) for signatures is less secure than [using the Websocket or JSON-RPC APIs](../../tutorials/http-websocket-apis/get-started.md) through non-commandline clients. When using the commandline syntax, your secret key may be visible to other users in the system's process listing, and your shell history may save the key in plain text. + **Caution:** Using the [commandline API](../../references/http-websocket-apis/api-conventions/request-formatting.md#commandline-format) for signatures is less secure than [using the Websocket or JSON-RPC APIs](../../tutorials/http-websocket-apis/build-apps/get-started.md) through non-commandline clients. When using the commandline syntax, your secret key may be visible to other users in the system's process listing, and your shell history may save the key in plain text. 3. Maintain the server to keep it running, updated, and in sync with the network while you're using it. @@ -140,7 +140,7 @@ To use this configuration, follow the steps for [running `rippled` on a private - [Multi-Signing](../accounts/multi-signing.md) - **Tutorials:** - [Install rippled](../../infrastructure/installation/index.md) - - [Assign a Regular Key Pair](../../tutorials/tasks/manage-account-settings/assign-a-regular-key-pair.md) + - [Assign a Regular Key Pair](../../tutorials/how-tos/manage-account-settings/assign-a-regular-key-pair.md) - [Reliable Transaction Submission](reliable-transaction-submission.md) - [Enable Public Signing](../../infrastructure/configuration/enable-public-signing.md) - **References:** diff --git a/docs/concepts/transactions/source-and-destination-tags.md b/docs/concepts/transactions/source-and-destination-tags.md index c5866c0c02..903bd13f0b 100644 --- a/docs/concepts/transactions/source-and-destination-tags.md +++ b/docs/concepts/transactions/source-and-destination-tags.md @@ -42,12 +42,12 @@ Assigning tags in numerical order provides less privacy to customers. Since all ## Requiring Tags -For an XRP Ledger address that may receive payments intended for several customer accounts, receiving a payment _without_ a destination tag can be a problem: it is not immediately obvious which customer to credit, which can require a manual intervention and a discussion with the sender to figure out who was the intended recipient. To reduce cases like this, you can [enable the `RequireDest` setting](../../tutorials/tasks/manage-account-settings/require-destination-tags.md). That way, if a user forgets to include a destination tag in a payment, the XRP Ledger rejects their payment instead of giving you money you don't know what to do with. The user can then send the payment again, using the tag as they should have. +For an XRP Ledger address that may receive payments intended for several customer accounts, receiving a payment _without_ a destination tag can be a problem: it is not immediately obvious which customer to credit, which can require a manual intervention and a discussion with the sender to figure out who was the intended recipient. To reduce cases like this, you can [enable the `RequireDest` setting](../../tutorials/how-tos/manage-account-settings/require-destination-tags.md). That way, if a user forgets to include a destination tag in a payment, the XRP Ledger rejects their payment instead of giving you money you don't know what to do with. The user can then send the payment again, using the tag as they should have. ## See Also -- [Require Destination Tags](../../tutorials/tasks/manage-account-settings/require-destination-tags.md) +- [Require Destination Tags](../../tutorials/how-tos/manage-account-settings/require-destination-tags.md) - [Payment Types](../payment-types/index.md) {% raw-partial file="/docs/_snippets/common-links.md" /%} diff --git a/docs/concepts/transactions/transaction-cost.md b/docs/concepts/transactions/transaction-cost.md index 53a178c694..abeb13b3bb 100644 --- a/docs/concepts/transactions/transaction-cost.md +++ b/docs/concepts/transactions/transaction-cost.md @@ -53,7 +53,7 @@ This divides transactions into roughly three categories: ## Local Load Cost -Each `rippled` server maintains a cost threshold based on its current load. If you submit a transaction with a `Fee` value that is lower than current load-based transaction cost of the `rippled` server, that server neither applies nor relays the transaction. (**Note:** If you submit a transaction through an [admin connection](../../tutorials/http-websocket-apis/get-started.md), the server applies and relays the transaction as long as the transaction meets the un-scaled minimum transaction cost.) A transaction is very unlikely to survive [the consensus process](../consensus-protocol/index.md) unless its `Fee` value meets the requirements of a majority of servers. +Each `rippled` server maintains a cost threshold based on its current load. If you submit a transaction with a `Fee` value that is lower than current load-based transaction cost of the `rippled` server, that server neither applies nor relays the transaction. (**Note:** If you submit a transaction through an [admin connection](../../tutorials/http-websocket-apis/build-apps/get-started.md), the server applies and relays the transaction as long as the transaction meets the un-scaled minimum transaction cost.) A transaction is very unlikely to survive [the consensus process](../consensus-protocol/index.md) unless its `Fee` value meets the requirements of a majority of servers. ## Open Ledger Cost diff --git a/docs/img/conditional-escrow1.png b/docs/img/conditional-escrow1.png index dc737feefb..364ea085bf 100644 Binary files a/docs/img/conditional-escrow1.png and b/docs/img/conditional-escrow1.png differ diff --git a/docs/img/conditional-escrow2.png b/docs/img/conditional-escrow2.png index 694b50f040..e1dc7580ec 100644 Binary files a/docs/img/conditional-escrow2.png and b/docs/img/conditional-escrow2.png differ diff --git a/docs/img/conditional-escrow3.png b/docs/img/conditional-escrow3.png index ed5d4f8896..429d86f93a 100644 Binary files a/docs/img/conditional-escrow3.png and b/docs/img/conditional-escrow3.png differ diff --git a/docs/img/conditional-escrow4.png b/docs/img/conditional-escrow4.png index 78b9c6a4c6..338a49cd9e 100644 Binary files a/docs/img/conditional-escrow4.png and b/docs/img/conditional-escrow4.png differ diff --git a/docs/img/conditional-escrow5.png b/docs/img/conditional-escrow5.png index 76c57cf6ba..6e268a79b4 100644 Binary files a/docs/img/conditional-escrow5.png and b/docs/img/conditional-escrow5.png differ diff --git a/docs/img/introduction1-howdy.png b/docs/img/introduction1-howdy.png index 685656d497..d15dfc2d8c 100644 Binary files a/docs/img/introduction1-howdy.png and b/docs/img/introduction1-howdy.png differ diff --git a/docs/img/quickstart-checks1.png b/docs/img/quickstart-checks1.png new file mode 100644 index 0000000000..908b0937a6 Binary files /dev/null and b/docs/img/quickstart-checks1.png differ diff --git a/docs/img/quickstart-checks2.png b/docs/img/quickstart-checks2.png new file mode 100644 index 0000000000..2274bf6243 Binary files /dev/null and b/docs/img/quickstart-checks2.png differ diff --git a/docs/img/quickstart-checks3.png b/docs/img/quickstart-checks3.png new file mode 100644 index 0000000000..d9391107cf Binary files /dev/null and b/docs/img/quickstart-checks3.png differ diff --git a/docs/img/quickstart-checks4.png b/docs/img/quickstart-checks4.png new file mode 100644 index 0000000000..f55b3f6b12 Binary files /dev/null and b/docs/img/quickstart-checks4.png differ diff --git a/docs/img/quickstart-checks5.png b/docs/img/quickstart-checks5.png new file mode 100644 index 0000000000..b05eec9f28 Binary files /dev/null and b/docs/img/quickstart-checks5.png differ diff --git a/docs/img/quickstart-checks6.png b/docs/img/quickstart-checks6.png new file mode 100644 index 0000000000..58fc506f6d Binary files /dev/null and b/docs/img/quickstart-checks6.png differ diff --git a/docs/img/quickstart-checks7.png b/docs/img/quickstart-checks7.png new file mode 100644 index 0000000000..c6f64c8b9f Binary files /dev/null and b/docs/img/quickstart-checks7.png differ diff --git a/docs/img/quickstart-checks8.png b/docs/img/quickstart-checks8.png new file mode 100644 index 0000000000..943f2b7010 Binary files /dev/null and b/docs/img/quickstart-checks8.png differ diff --git a/docs/img/quickstart-escrow1.png b/docs/img/quickstart-escrow1.png index 4c88077a6e..067534b3a1 100644 Binary files a/docs/img/quickstart-escrow1.png and b/docs/img/quickstart-escrow1.png differ diff --git a/docs/img/quickstart-escrow2.png b/docs/img/quickstart-escrow2.png index 906c5c84fc..8b069c248d 100644 Binary files a/docs/img/quickstart-escrow2.png and b/docs/img/quickstart-escrow2.png differ diff --git a/docs/img/quickstart-escrow3.png b/docs/img/quickstart-escrow3.png index d6081d4043..54a5318a8d 100644 Binary files a/docs/img/quickstart-escrow3.png and b/docs/img/quickstart-escrow3.png differ diff --git a/docs/img/quickstart-escrow4.png b/docs/img/quickstart-escrow4.png index daf0dacb35..cc0c2e6fd2 100644 Binary files a/docs/img/quickstart-escrow4.png and b/docs/img/quickstart-escrow4.png differ diff --git a/docs/img/quickstart-escrow5.png b/docs/img/quickstart-escrow5.png index d79e118513..a768cd8d0e 100644 Binary files a/docs/img/quickstart-escrow5.png and b/docs/img/quickstart-escrow5.png differ diff --git a/docs/img/quickstart-escrow6.png b/docs/img/quickstart-escrow6.png index a7d4566c05..9ccfcfd8c4 100644 Binary files a/docs/img/quickstart-escrow6.png and b/docs/img/quickstart-escrow6.png differ diff --git a/docs/img/quickstart-escrow7.png b/docs/img/quickstart-escrow7.png index 70d88d2785..79b9d6fd09 100644 Binary files a/docs/img/quickstart-escrow7.png and b/docs/img/quickstart-escrow7.png differ diff --git a/docs/img/quickstart-escrow8.png b/docs/img/quickstart-escrow8.png index 605cc91717..650c9d96b7 100644 Binary files a/docs/img/quickstart-escrow8.png and b/docs/img/quickstart-escrow8.png differ diff --git a/docs/img/quickstart-escrow9.png b/docs/img/quickstart-escrow9.png index 224390e02c..69746a1923 100644 Binary files a/docs/img/quickstart-escrow9.png and b/docs/img/quickstart-escrow9.png differ diff --git a/docs/img/quickstart-py-checks1.png b/docs/img/quickstart-py-checks1.png new file mode 100644 index 0000000000..3f57cea708 Binary files /dev/null and b/docs/img/quickstart-py-checks1.png differ diff --git a/docs/img/quickstart-py-checks2.png b/docs/img/quickstart-py-checks2.png new file mode 100644 index 0000000000..82220ee2dc Binary files /dev/null and b/docs/img/quickstart-py-checks2.png differ diff --git a/docs/img/quickstart-py-checks3.png b/docs/img/quickstart-py-checks3.png new file mode 100644 index 0000000000..a5e4ddd658 Binary files /dev/null and b/docs/img/quickstart-py-checks3.png differ diff --git a/docs/img/quickstart-py-checks4.png b/docs/img/quickstart-py-checks4.png new file mode 100644 index 0000000000..20c45603f8 Binary files /dev/null and b/docs/img/quickstart-py-checks4.png differ diff --git a/docs/img/quickstart-py-checks5.png b/docs/img/quickstart-py-checks5.png new file mode 100644 index 0000000000..cd1ce12449 Binary files /dev/null and b/docs/img/quickstart-py-checks5.png differ diff --git a/docs/img/quickstart-py-checks6.png b/docs/img/quickstart-py-checks6.png new file mode 100644 index 0000000000..7786ec3ba5 Binary files /dev/null and b/docs/img/quickstart-py-checks6.png differ diff --git a/docs/img/quickstart-py-checks7.png b/docs/img/quickstart-py-checks7.png new file mode 100644 index 0000000000..c5494724a6 Binary files /dev/null and b/docs/img/quickstart-py-checks7.png differ diff --git a/docs/img/quickstart-py-checks8.png b/docs/img/quickstart-py-checks8.png new file mode 100644 index 0000000000..9a003ee480 Binary files /dev/null and b/docs/img/quickstart-py-checks8.png differ diff --git a/docs/img/quickstart1.png b/docs/img/quickstart1.png index f8ff06a598..e15584d71c 100644 Binary files a/docs/img/quickstart1.png and b/docs/img/quickstart1.png differ diff --git a/docs/img/quickstart10.png b/docs/img/quickstart10.png index dc9330959c..e76bc8419c 100644 Binary files a/docs/img/quickstart10.png and b/docs/img/quickstart10.png differ diff --git a/docs/img/quickstart11.png b/docs/img/quickstart11.png index caf2648536..2c3899544e 100644 Binary files a/docs/img/quickstart11.png and b/docs/img/quickstart11.png differ diff --git a/docs/img/quickstart12.png b/docs/img/quickstart12.png index 20441696cf..9ca385bbb8 100644 Binary files a/docs/img/quickstart12.png and b/docs/img/quickstart12.png differ diff --git a/docs/img/quickstart13.png b/docs/img/quickstart13.png index e279613004..f66a7afff5 100644 Binary files a/docs/img/quickstart13.png and b/docs/img/quickstart13.png differ diff --git a/docs/img/quickstart14.png b/docs/img/quickstart14.png index a28e61c7f2..8bb801fc1d 100644 Binary files a/docs/img/quickstart14.png and b/docs/img/quickstart14.png differ diff --git a/docs/img/quickstart15.png b/docs/img/quickstart15.png index acd6f6a55b..ca28fb8e17 100644 Binary files a/docs/img/quickstart15.png and b/docs/img/quickstart15.png differ diff --git a/docs/img/quickstart16.png b/docs/img/quickstart16.png index 580804c4ec..0543359223 100644 Binary files a/docs/img/quickstart16.png and b/docs/img/quickstart16.png differ diff --git a/docs/img/quickstart17.png b/docs/img/quickstart17.png index 22430e8425..436df141c6 100644 Binary files a/docs/img/quickstart17.png and b/docs/img/quickstart17.png differ diff --git a/docs/img/quickstart18.png b/docs/img/quickstart18.png index 3ab37e6739..6607a4a363 100644 Binary files a/docs/img/quickstart18.png and b/docs/img/quickstart18.png differ diff --git a/docs/img/quickstart19.png b/docs/img/quickstart19.png index a446453ea9..0e2b6597d5 100644 Binary files a/docs/img/quickstart19.png and b/docs/img/quickstart19.png differ diff --git a/docs/img/quickstart2.png b/docs/img/quickstart2.png index 531a67954d..ccc9170d6c 100644 Binary files a/docs/img/quickstart2.png and b/docs/img/quickstart2.png differ diff --git a/docs/img/quickstart20.png b/docs/img/quickstart20.png index a9ab7941b4..eb1e4b9d90 100644 Binary files a/docs/img/quickstart20.png and b/docs/img/quickstart20.png differ diff --git a/docs/img/quickstart21.png b/docs/img/quickstart21.png index fdb00c6dde..fc402bc15d 100644 Binary files a/docs/img/quickstart21.png and b/docs/img/quickstart21.png differ diff --git a/docs/img/quickstart22.png b/docs/img/quickstart22.png index 2c9b31b8ab..62559f83f2 100644 Binary files a/docs/img/quickstart22.png and b/docs/img/quickstart22.png differ diff --git a/docs/img/quickstart23.png b/docs/img/quickstart23.png index 774ce4ecb4..da0db3cfbd 100644 Binary files a/docs/img/quickstart23.png and b/docs/img/quickstart23.png differ diff --git a/docs/img/quickstart24.png b/docs/img/quickstart24.png index 06b22e579f..894ce827d8 100644 Binary files a/docs/img/quickstart24.png and b/docs/img/quickstart24.png differ diff --git a/docs/img/quickstart25.png b/docs/img/quickstart25.png index d3f851dfd0..a1ce9c1fd4 100644 Binary files a/docs/img/quickstart25.png and b/docs/img/quickstart25.png differ diff --git a/docs/img/quickstart26.png b/docs/img/quickstart26.png index 546da5efdd..4e74214290 100644 Binary files a/docs/img/quickstart26.png and b/docs/img/quickstart26.png differ diff --git a/docs/img/quickstart27.png b/docs/img/quickstart27.png index a76bd0fac6..dcebab2a6c 100644 Binary files a/docs/img/quickstart27.png and b/docs/img/quickstart27.png differ diff --git a/docs/img/quickstart28.png b/docs/img/quickstart28.png index c83c0b9af6..4e308e3bc3 100644 Binary files a/docs/img/quickstart28.png and b/docs/img/quickstart28.png differ diff --git a/docs/img/quickstart29.png b/docs/img/quickstart29.png index 1a0e9531a8..7d7ca70902 100644 Binary files a/docs/img/quickstart29.png and b/docs/img/quickstart29.png differ diff --git a/docs/img/quickstart3.png b/docs/img/quickstart3.png index 63beced880..84be6261ef 100644 Binary files a/docs/img/quickstart3.png and b/docs/img/quickstart3.png differ diff --git a/docs/img/quickstart30.png b/docs/img/quickstart30.png index 9809be408c..da5e06bbd8 100644 Binary files a/docs/img/quickstart30.png and b/docs/img/quickstart30.png differ diff --git a/docs/img/quickstart31.png b/docs/img/quickstart31.png index 853d4adcee..ef7e2663fd 100644 Binary files a/docs/img/quickstart31.png and b/docs/img/quickstart31.png differ diff --git a/docs/img/quickstart32.png b/docs/img/quickstart32.png index e98fc07b63..cd1f393469 100644 Binary files a/docs/img/quickstart32.png and b/docs/img/quickstart32.png differ diff --git a/docs/img/quickstart33-batch-mint.png b/docs/img/quickstart33-batch-mint.png index 7dcf289d27..f8c0a55c31 100644 Binary files a/docs/img/quickstart33-batch-mint.png and b/docs/img/quickstart33-batch-mint.png differ diff --git a/docs/img/quickstart4.png b/docs/img/quickstart4.png index b381d5ca2f..ceef3a7fb4 100644 Binary files a/docs/img/quickstart4.png and b/docs/img/quickstart4.png differ diff --git a/docs/img/quickstart5.png b/docs/img/quickstart5.png index eef4349512..b9fe040b7f 100644 Binary files a/docs/img/quickstart5.png and b/docs/img/quickstart5.png differ diff --git a/docs/img/quickstart6.png b/docs/img/quickstart6.png index 6049449a2f..2a87fc10f0 100644 Binary files a/docs/img/quickstart6.png and b/docs/img/quickstart6.png differ diff --git a/docs/img/quickstart7.png b/docs/img/quickstart7.png index cfc7e3f0ab..36e3d103b6 100644 Binary files a/docs/img/quickstart7.png and b/docs/img/quickstart7.png differ diff --git a/docs/img/quickstart8.png b/docs/img/quickstart8.png index 760143f767..7cc7d16c79 100644 Binary files a/docs/img/quickstart8.png and b/docs/img/quickstart8.png differ diff --git a/docs/img/quickstart9.png b/docs/img/quickstart9.png index f8507b1a8a..8a23b6ad13 100644 Binary files a/docs/img/quickstart9.png and b/docs/img/quickstart9.png differ diff --git a/docs/img/ripplex10-check.js b/docs/img/ripplex10-check.js new file mode 100644 index 0000000000..b036cd44ab --- /dev/null +++ b/docs/img/ripplex10-check.js @@ -0,0 +1,329 @@ +// ******************************************************* +// ************* Standby Send Check ********************** +// ******************************************************* +async function sendCheck() { + let net = getNet() + const client = new xrpl.Client(net) + results = 'Connecting to ' + getNet() + '....' + standbyResultField.value = results + await client.connect() + results += '\nConnected.' + standbyResultField.value = results + + const standby_wallet = xrpl.Wallet.fromSeed(standbySeedField.value) + const operational_wallet = xrpl.Wallet.fromSeed(operationalSeedField.value) + var check_amount = standbyAmountField.value + + if (standbyCurrencyField.value != "XRP") { + check_amount = { + "currency": standbyCurrencyField.value, + "value": standbyAmountField.value, + "issuer": standby_wallet.address + } + } + + const send_check_tx = { + "TransactionType": "CheckCreate", + "Account": standby_wallet.address, + "SendMax": check_amount, + "Destination": standbyDestinationField.value + } + const check_prepared = await client.autofill(send_check_tx) + const check_signed = standby_wallet.sign(check_prepared) + results += 'Sending ' + check_amount + ' ' + standbyCurrencyField + ' to ' + + standbyDestinationField.value + '...' + standbyResultField.value = results + const check_result = await client.submitAndWait(check_signed.tx_blob) + if (check_result.result.meta.TransactionResult == "tesSUCCESS") { + results += 'Transaction succeeded: https://testnet.xrpl.org/transactions/${check_signed.hash}' + standbyResultField.value = JSON.stringify(check_result.result, null, 2) + } else { + results += 'Transaction failed: See JavaScript console for details.' + standbyResultField.value = results + throw 'Error sending transaction: ${check_result.result.meta.TransactionResult}' + } + standbyBalanceField.value = (await client.getXrpBalance(standby_wallet.address)) + operationalBalanceField.value = (await client.getXrpBalance(operational_wallet.address)) + + client.disconnect() +} // end of sendCheck() + +// ******************************************************* +// *************** Standby Get Checks ******************** +// ******************************************************* + +async function getChecks() { + let net = getNet() + const client = new xrpl.Client(net) + results = 'Connecting to ' + getNet() + '....' + standbyResultField.value = results + await client.connect() + results += '\nConnected.' + standbyResultField.value = results + + results= "\nGetting standby account checks...\n" + const check_objects = await client.request({ + "id": 5, + "command": "account_objects", + "account": standbyAccountField.value, + "ledger_index": "validated", + "type": "check" + }) + standbyResultField.value = JSON.stringify(check_objects.result, null, 2) + client.disconnect() +} // End of getChecks() + +// ******************************************************* +// ************* Standby Cash Check ********************** +// ******************************************************* + +async function cashCheck() { + let net = getNet() + const client = new xrpl.Client(net) + results = 'Connecting to ' + getNet() + '....' + standbyResultField.value = results + await client.connect() + results += '\nConnected.' + standbyResultField.value = results + + const standby_wallet = xrpl.Wallet.fromSeed(standbySeedField.value) + const operational_wallet = xrpl.Wallet.fromSeed(operationalSeedField.value) + + var check_amount = standbyAmountField.value + + if (standbyCurrencyField.value != "XRP") { + check_amount = { + "value": standbyAmountField.value, + "currency": standbyCurrencyField.value, + "issuer": standbyIssuerField.value + } + } + const cash_check_tx = { + "TransactionType": "CheckCash", + "Account": standby_wallet.address, + "Amount": check_amount, + "CheckID": standbyCheckID.value + } + const cash_prepared = await client.autofill(cash_check_tx) + const cash_signed = standby_wallet.sign(cash_prepared) + results += ' Receiving ' + standbyAmountField.value + ' ' + standbyCurrencyField.value + '.\n' + standbyResultField.value = results + const check_result = await client.submitAndWait(cash_signed.tx_blob) + if (check_result.result.meta.TransactionResult == "tesSUCCESS") { + results += 'Transaction succeeded: https://testnet.xrpl.org/transactions/${cash_signed.hash}' + standbyResultField.value = results + } else { + results += 'Transaction failed: See JavaScript console for details.' + standbyResultField.value = results + throw 'Error sending transaction: ${check_result.result.meta.TransactionResult}' + } + standbyBalanceField.value = (await client.getXrpBalance(standby_wallet.address)) + operationalBalanceField.value = (await client.getXrpBalance(operational_wallet.address)) + + client.disconnect() +} // end of cashCheck() + +// ******************************************************* +// *************** Standby Cancel Check ****************** +// ******************************************************* + +async function cancelCheck() { + let net = getNet() + const client = new xrpl.Client(net) + results = 'Connecting to ' + getNet() + '....' + standbyResultField.value = results + await client.connect() + results += '\nConnected.' + standbyResultField.value = results + + const standby_wallet = xrpl.Wallet.fromSeed(standbySeedField.value) + const operational_wallet = xrpl.Wallet.fromSeed(operationalSeedField.value) + + const cancel_check_tx = { + "TransactionType": "CheckCancel", + "Account": standby_wallet.address, + "CheckID": standbyCheckID.value + } + const cancel_prepared = await client.autofill(cancel_check_tx) + const cancel_signed = standby_wallet.sign(cancel_prepared) + results += ' Cancelling check.\n' + standbyResultField.value = results + const check_result = await client.submitAndWait(cancel_signed.tx_blob) + if (check_result.result.meta.TransactionResult == "tesSUCCESS") { + results += 'Transaction succeeded: https://testnet.xrpl.org/transactions/${cash_signed.hash}' + standbyResultField.value = results + } else { + results += 'Transaction failed: See JavaScript console for details.' + standbyResultField.value = results + throw 'Error sending transaction: ${check_result.result.meta.TransactionResult}' + } + standbyBalanceField.value = (await client.getXrpBalance(standby_wallet.address)) + operationalBalanceField.value = (await client.getXrpBalance(operational_wallet.address)) + client.disconnect() +} // end of cancelCheck() + +// ******************************************************* +// ************ Operational Send Check ******************* +// ******************************************************* +async function opSendCheck() { + let net = getNet() + const client = new xrpl.Client(net) + results = 'Connecting to ' + getNet() + '....' + operationalResultField.value = results + await client.connect() + results += '\nConnected.' + operationalResultField.value = results + + const standby_wallet = xrpl.Wallet.fromSeed(standbySeedField.value) + const operational_wallet = xrpl.Wallet.fromSeed(operationalSeedField.value) + + const issue_quantity = operationalAmountField.value + var check_amount = operationalAmountField.value + + if (operationalCurrencyField.value != "XRP") { + check_amount = { + "currency": operationalCurrencyField.value, + "value": operationalAmountField.value, + "issuer": operational_wallet.address + } + } + const send_check_tx = { + "TransactionType": "CheckCreate", + "Account": operational_wallet.address, + "SendMax": check_amount, + "Destination": operationalDestinationField.value + } + const check_prepared = await client.autofill(send_check_tx) + const check_signed = operational_wallet.sign(check_prepared) + results += '\nSending check to ' + + operationalDestinationField.value + '...' + operationalResultField.value = results + const check_result = await client.submitAndWait(check_signed.tx_blob) + if (check_result.result.meta.TransactionResult == "tesSUCCESS") { + results += 'Transaction succeeded: https://testnet.xrpl.org/transactions/${check_signed.hash}' + operationalResultField.value = JSON.stringify(check_result.result, null, 2) + } else { + results += 'Transaction failed: See JavaScript console for details.' + operationalResultField.value = results + throw 'Error sending transaction: ${check_result.result.meta.TransactionResult}' + } + standbyBalanceField.value = (await client.getXrpBalance(standby_wallet.address)) + operationalBalanceField.value = (await client.getXrpBalance(operational_wallet.address)) + client.disconnect() +} // end of opSendCheck() + +// ******************************************************* +// ************ Operational Get Checks ******************* +// ******************************************************* + +async function opGetChecks() { + let net = getNet() + const client = new xrpl.Client(net) + results = 'Connecting to ' + getNet() + '....' + operationalResultField.value = results + await client.connect() + results += '\nConnected.' + operationalResultField.value = results + + results= "\nGetting standby account checks...\n" + const check_objects = await client.request({ + "id": 5, + "command": "account_objects", + "account": operationalAccountField.value, + "ledger_index": "validated", + "type": "check" + }) + operationalResultField.value = JSON.stringify(check_objects.result, null, 2) + client.disconnect() +} // End of opGetChecks() + + +// ******************************************************* +// ************* Operational Cash Check ****************** +// ******************************************************* + +async function opCashCheck() { + let net = getNet() + const client = new xrpl.Client(net) + results = 'Connecting to ' + getNet() + '....' + operationalResultField.value = results + await client.connect() + results += '\nConnected.' + operationalResultField.value = results + + const standby_wallet = xrpl.Wallet.fromSeed(standbySeedField.value) + const operational_wallet = xrpl.Wallet.fromSeed(operationalSeedField.value) + + var check_amount = operationalAmountField.value + + if (operationalCurrencyField.value != "XRP") { + check_amount = { + "value": operationalAmountField.value, + "currency": operationalCurrencyField.value, + "issuer": operationalIssuerField.value + } + } + const cash_check_tx = { + "TransactionType": "CheckCash", + "Account": operational_wallet.address, + "Amount": check_amount, + "CheckID": operationalCheckIDField.value + } + const cash_prepared = await client.autofill(cash_check_tx) + const cash_signed = operational_wallet.sign(cash_prepared) + results += ' Receiving ' + operationalAmountField.value + ' ' + operationalCurrencyField.value + '.\n' + operationalResultField.value = results + const check_result = await client.submitAndWait(cash_signed.tx_blob) + if (check_result.result.meta.TransactionResult == "tesSUCCESS") { + results += 'Transaction succeeded: https://testnet.xrpl.org/transactions/${cash_signed.hash}' + operationalResultField.value = results + } else { + results += 'Transaction failed: See JavaScript console for details.' + operationalResultField.value = results + throw 'Error sending transaction: ${check_result.result.meta.TransactionResult}' + } + standbyBalanceField.value = (await client.getXrpBalance(standby_wallet.address)) + operationalBalanceField.value = (await client.getXrpBalance(operational_wallet.address)) + client.disconnect() +} +// end of opCashCheck() + +// ******************************************************* +// ************* Operational Cancel Check **************** +// ******************************************************* + +async function opCancelCheck() { + let net = getNet() + const client = new xrpl.Client(net) + results = 'Connecting to ' + getNet() + '....' + operationalResultField.value = results + await client.connect() + results += '\nConnected.' + operationalResultField.value = results + + const standby_wallet = xrpl.Wallet.fromSeed(standbySeedField.value) + const operational_wallet = xrpl.Wallet.fromSeed(operationalSeedField.value) + + const cancel_check_tx = { + "TransactionType": "CheckCancel", + "Account": operational_wallet.address, + "CheckID": operationalCheckIDField.value + } + + const cancel_prepared = await client.autofill(cancel_check_tx) + const cancel_signed = operational_wallet.sign(cancel_prepared) + results += ' Cancelling check.\n' + operationalResultField.value = results + const check_result = await client.submitAndWait(cancel_signed.tx_blob) + if (check_result.result.meta.TransactionResult == "tesSUCCESS") { + results += 'Transaction succeeded: https://testnet.xrpl.org/transactions/${cash_signed.hash}' + operationalResultField.value = results + } else { + results += 'Transaction failed: See JavaScript console for details.' + operationalResultField.value = results + throw 'Error sending transaction: ${check_result.result.meta.TransactionResult}' + } + standbyBalanceField.value = (await client.getXrpBalance(standby_wallet.address)) + operationalBalanceField.value = (await client.getXrpBalance(operational_wallet.address)) + client.disconnect() +} // end of cancelCheck() \ No newline at end of file diff --git a/docs/index.page.tsx b/docs/index.page.tsx index e9cc34fd12..4385f80cd9 100644 --- a/docs/index.page.tsx +++ b/docs/index.page.tsx @@ -13,10 +13,6 @@ const recommendedPages = [ description: 'Public API Methods', link: '/docs/references/http-websocket-apis/public-api-methods/', }, - { - description: 'Getting Started with Python', - link: '/docs/tutorials/get-started/get-started-using-python/', - }, { description: 'Run a Validator', link: '/docs/infrastructure/configuration/server-modes/run-rippled-as-a-validator/', @@ -291,11 +287,11 @@ export default function Docs() {

{translate('Getting Started')}

- -
{translate('Quickstart to XRP Ledger')}
+
+
{translate('Introduction to the XRP Ledger')}

{translate('An introduction to fundamental aspects of the XRP Ledger.')}

-
{translate('Get Started')}
+
{translate('Introduction')}
quick-start
@@ -325,19 +321,19 @@ export default function Docs() {
- + Java Logo
{translate('Java')}
diff --git a/docs/infrastructure/configuration/configure-amendment-voting.md b/docs/infrastructure/configuration/configure-amendment-voting.md index 6a8985d36c..5c74dbdecf 100644 --- a/docs/infrastructure/configuration/configure-amendment-voting.md +++ b/docs/infrastructure/configuration/configure-amendment-voting.md @@ -9,7 +9,7 @@ labels: --- # Configure Amendment Voting -Servers configured as validators can vote on [amendments](../../concepts/networks-and-servers/amendments.md) to the XRP Ledger protocol using the [feature method][]. (This method requires [admin access](../../tutorials/http-websocket-apis/get-started.md#admin-access).) +Servers configured as validators can vote on [amendments](../../concepts/networks-and-servers/amendments.md) to the XRP Ledger protocol using the [feature method][]. (This method requires [admin access](../../tutorials/http-websocket-apis/build-apps/get-started.md#admin-access).) For example, to vote against the "SHAMapV2" amendment, run the following command: diff --git a/docs/infrastructure/configuration/configure-grpc.md b/docs/infrastructure/configuration/configure-grpc.md index ab018fd143..9ba2c8108b 100644 --- a/docs/infrastructure/configuration/configure-grpc.md +++ b/docs/infrastructure/configuration/configure-grpc.md @@ -49,7 +49,7 @@ To enable gRPC on your server, complete the following steps: - [XRP Ledger Overview](/about/) - [`rippled` Server Modes](../../concepts/networks-and-servers/rippled-server-modes.md) - **Tutorials:** - - [Get Started Using HTTP / WebSocket APIs](../../tutorials/http-websocket-apis/get-started.md) + - [Get Started Using HTTP / WebSocket APIs](../../tutorials/http-websocket-apis/build-apps/get-started.md) - [Reliable Transaction Submission](../../concepts/transactions/reliable-transaction-submission.md) - [Manage the rippled Server](../installation/install-rippled-on-ubuntu.md) - **References:** diff --git a/docs/infrastructure/configuration/data-retention/configure-advisory-deletion.md b/docs/infrastructure/configuration/data-retention/configure-advisory-deletion.md index 4cbfb0ff08..5fd71d47c6 100644 --- a/docs/infrastructure/configuration/data-retention/configure-advisory-deletion.md +++ b/docs/infrastructure/configuration/data-retention/configure-advisory-deletion.md @@ -57,7 +57,7 @@ To configure advisory deletion with a daily schedule, perform the following step 2. Test running the [can_delete method][] to prompt the server to run online deletion. - You can use the [`rippled` commandline interface](../../../tutorials/http-websocket-apis/get-started.md#commandline) to run this command. For example: + You can use the [`rippled` commandline interface](../../../tutorials/http-websocket-apis/build-apps/get-started.md#commandline) to run this command. For example: ``` $ rippled --conf=/etc/opt/ripple/rippled.cfg can_delete now diff --git a/docs/infrastructure/configuration/enable-public-signing.md b/docs/infrastructure/configuration/enable-public-signing.md index 7b22f31a94..fec0827423 100644 --- a/docs/infrastructure/configuration/enable-public-signing.md +++ b/docs/infrastructure/configuration/enable-public-signing.md @@ -11,7 +11,7 @@ labels: By default, the signing methods for [`rippled`](../../concepts/networks-and-servers/index.md) are limited to [administrative connections](../../references/http-websocket-apis/admin-api-methods/index.md). If you want to allow signing methods to be used as public API methods (like with versions of `rippled` before v1.1.0), you can enable it with a configuration change. -This enables the following methods to be used on "public" [JSON-RPC and WebSocket connections](../../tutorials/http-websocket-apis/get-started.md), if your server accepts them: +This enables the following methods to be used on "public" [JSON-RPC and WebSocket connections](../../tutorials/http-websocket-apis/build-apps/get-started.md), if your server accepts them: - [sign][sign method] - [sign_for][sign_for method] @@ -51,8 +51,8 @@ To enable public signing, perform the following steps: - [Cryptographic Keys](../../concepts/accounts/cryptographic-keys.md) - **Tutorials:** - [Set Up Secure Signing](../../concepts/transactions/secure-signing.md) - - [Get Started Using HTTP / WebSocket APIs](../../tutorials/http-websocket-apis/get-started.md) - - [Get Started Using JavaScript](../../tutorials/javascript/get-started.md) + - [Get Started Using HTTP / WebSocket APIs](../../tutorials/http-websocket-apis/build-apps/get-started.md) + - [Get Started Using JavaScript](../../tutorials/javascript/build-apps/get-started.md) - **References:** - [sign method][] - [sign_for method][] diff --git a/docs/infrastructure/installation/install-rippled-on-centos-rhel-with-yum.md b/docs/infrastructure/installation/install-rippled-on-centos-rhel-with-yum.md index f1069e8cd5..f82d682f77 100644 --- a/docs/infrastructure/installation/install-rippled-on-centos-rhel-with-yum.md +++ b/docs/infrastructure/installation/install-rippled-on-centos-rhel-with-yum.md @@ -112,7 +112,7 @@ Before you install `rippled`, you must meet the [System Requirements](system-req - **Tutorials:** - [Configure rippled](../configuration/index.md) - [Troubleshoot rippled](../troubleshooting/index.md) - - [Get Started with the rippled API](../../tutorials/http-websocket-apis/get-started.md) + - [Get Started with the rippled API](../../tutorials/http-websocket-apis/build-apps/get-started.md) - **References:** - [rippled API Reference](../../references/http-websocket-apis/index.md) - [`rippled` Commandline Usage](../commandline-usage.md) diff --git a/docs/infrastructure/installation/install-rippled-on-ubuntu.md b/docs/infrastructure/installation/install-rippled-on-ubuntu.md index 6bdff8b471..b15b3fb471 100644 --- a/docs/infrastructure/installation/install-rippled-on-ubuntu.md +++ b/docs/infrastructure/installation/install-rippled-on-ubuntu.md @@ -149,7 +149,7 @@ Before you install `rippled`, you must meet the [System Requirements](system-req - **Tutorials:** - [Configure rippled](../configuration/index.md) - [Troubleshoot rippled](../troubleshooting/index.md) - - [Get Started with the rippled API](../../tutorials/http-websocket-apis/get-started.md) + - [Get Started with the rippled API](../../tutorials/http-websocket-apis/build-apps/get-started.md) - **References:** - [rippled API Reference](../../references/http-websocket-apis/index.md) - [`rippled` Commandline Usage](../commandline-usage.md) diff --git a/docs/infrastructure/installation/rippled-1-3-migration-instructions.md b/docs/infrastructure/installation/rippled-1-3-migration-instructions.md index 561f58e428..78849feb6e 100644 --- a/docs/infrastructure/installation/rippled-1-3-migration-instructions.md +++ b/docs/infrastructure/installation/rippled-1-3-migration-instructions.md @@ -120,7 +120,7 @@ The `rippled` v1.3 package includes an updated auto-update script that works on - **Tutorials:** - [Update Automatically on Linux](update-rippled-automatically-on-linux.md) - [Troubleshoot rippled](../troubleshooting/index.md) - - [Get Started with the rippled API](../../tutorials/http-websocket-apis/get-started.md) + - [Get Started with the rippled API](../../tutorials/http-websocket-apis/build-apps/get-started.md) - **References:** - [rippled API Reference](../../references/http-websocket-apis/index.md) - [`rippled` Commandline Usage](../commandline-usage.md) diff --git a/docs/infrastructure/troubleshooting/fix-sqlite-tx-db-page-size-issue.md b/docs/infrastructure/troubleshooting/fix-sqlite-tx-db-page-size-issue.md index e7773ba57e..6c9d301f34 100644 --- a/docs/infrastructure/troubleshooting/fix-sqlite-tx-db-page-size-issue.md +++ b/docs/infrastructure/troubleshooting/fix-sqlite-tx-db-page-size-issue.md @@ -183,7 +183,7 @@ To migrate your transaction database to a larger page size, perform the followin 11. Confirm that the `rippled` service started successfully. - You can use the [commandline interface](../../tutorials/http-websocket-apis/get-started.md#commandline) to check the server status (unless you have configured your server not to accept JSON-RPC requests). For example: + You can use the [commandline interface](../../tutorials/http-websocket-apis/build-apps/get-started.md#commandline) to check the server status (unless you have configured your server not to accept JSON-RPC requests). For example: ``` /opt/ripple/bin/rippled server_info diff --git a/docs/infrastructure/troubleshooting/understanding-log-messages.md b/docs/infrastructure/troubleshooting/understanding-log-messages.md index 3aec765b25..961a003b36 100644 --- a/docs/infrastructure/troubleshooting/understanding-log-messages.md +++ b/docs/infrastructure/troubleshooting/understanding-log-messages.md @@ -129,7 +129,7 @@ The entry contains the IP address of the client that exceeded its rate limit, an If you see frequent messages from the same IP address, you may want to block those IP addresses from your network to reduce the load on your server's public API. (For example, you may be able to configure your firewall to block those IP addresses.) -To avoid being dropped by rate limiting on your own server, [connect as an admin](../../tutorials/http-websocket-apis/get-started.md#admin-access). +To avoid being dropped by rate limiting on your own server, [connect as an admin](../../tutorials/http-websocket-apis/build-apps/get-started.md#admin-access). ## InboundLedger 11 timeouts for ledger diff --git a/docs/introduction/index.md b/docs/introduction/index.md index 406bca183f..16d74820f7 100644 --- a/docs/introduction/index.md +++ b/docs/introduction/index.md @@ -7,7 +7,8 @@ top_nav_grouping: Article Types --- # Introduction -This is a quick introduction to the principal features of the XRP Ledger (XRPL). Read this to get a high level understanding of the XRPL, then you can read more about areas of particular interest. The XRP Ledger is a blockchain that permanently records digital transactions of tokens between accounts. The sections below expand on the concepts introduced in that sentence. +![Howdy!](/docs/img/introduction1-howdy.png) +The XRP Ledger is a blockchain that permanently records digital transactions of tokens between accounts. The sections below expand on the concepts introduced in that sentence. {% child-pages /%} diff --git a/docs/references/client-libraries.md b/docs/references/client-libraries.md index 860662b479..1e129c7467 100644 --- a/docs/references/client-libraries.md +++ b/docs/references/client-libraries.md @@ -12,11 +12,11 @@ For other programming languages, you can access the XRP Ledger through the [HTTP | Language | Library Name | Get Started | API Reference | Source Code | |---------------------------------|---------------------------|-------------|--------------|-------------| -| **Python** | `xrpl-py` | [Get Started Using Python](../tutorials/python/get-started.md) | [API Reference](https://xrpl-py.readthedocs.io/) | [Repo](https://github.com/XRPLF/xrpl-py) | -| **JavaScript** / **TypeScript** | `xrpl.js` | [Get Started](../tutorials/javascript/get-started.md) | [API Reference](https://js.xrpl.org/) | [Repo](https://github.com/XRPLF/xrpl.js) | +| **Python** | `xrpl-py` | [Get Started Using Python](../tutorials/python/build-apps/get-started.md) | [API Reference](https://xrpl-py.readthedocs.io/) | [Repo](https://github.com/XRPLF/xrpl-py) | +| **JavaScript** / **TypeScript** | `xrpl.js` | [Get Started](../tutorials/javascript/build-apps/get-started.md) | [API Reference](https://js.xrpl.org/) | [Repo](https://github.com/XRPLF/xrpl.js) | | **JavaScript** / **TypeScript** | `xrpl-client` | [Get Started](https://jsfiddle.net/WietseWind/35az6p1b/) | [NPM Reference](https://www.npmjs.com/package/xrpl-client) | [Repo](https://github.com/XRPL-Labs/xrpl-client) | | **JavaScript** / **TypeScript** | `xrpl-accountlib` | [Get Started](https://jsfiddle.net/WietseWind/gkefpnu0/) | [NPM Reference](https://www.npmjs.com/package/xrpl-accountlib) | [Repo](https://github.com/WietseWind/xrpl-accountlib) | | **C++** | `rippled` Signing Library | [Get Started](https://github.com/XRPLF/rippled/tree/develop/Builds/linux#signing-library) | | (Part of [`rippled`](https://github.com/XRPLF/rippled/)) | -| **Java** | `xrpl4j` | [Get Started Using Java](../tutorials/java/get-started.md) | [API Reference](https://javadoc.io/doc/org.xrpl/) | [Repo](https://github.com/XRPLF/xrpl4j) | -| **PHP** | `XRPL_PHP` | [Get Started Using PHP](../tutorials/php/get-started.md) | [XRPL_PHP Docs](https://alexanderbuzz.github.io/xrpl-php-docs/) | [Repo](https://github.com/AlexanderBuzz/xrpl-php) | +| **Java** | `xrpl4j` | [Get Started Using Java](../tutorials/java/build-apps/get-started.md) | [API Reference](https://javadoc.io/doc/org.xrpl/) | [Repo](https://github.com/XRPLF/xrpl4j) | +| **PHP** | `XRPL_PHP` | [Get Started Using PHP](../tutorials/php/build-apps/get-started.md) | [XRPL_PHP Docs](https://alexanderbuzz.github.io/xrpl-php-docs/) | [Repo](https://github.com/AlexanderBuzz/xrpl-php) | | **Ruby** | `XRPB` | | [XRPB Docs](https://www.rubydoc.info/gems/xrbp) | [Repo](https://github.com/DevNullProd/XRBP) | diff --git a/docs/references/data-api.md b/docs/references/data-api.md index 346b8c5d25..ec4f204832 100644 --- a/docs/references/data-api.md +++ b/docs/references/data-api.md @@ -15,6 +15,6 @@ For information on the old Data API, see the [rippled-historical-database reposi ## Alternatives -For most common operations, like requesting account balances or transaction history, you can query a self-hosted or [public XRP Ledger server](../tutorials/public-servers.md) using a [WebSocket connection](../tutorials/http-websocket-apis/get-started.md#websocket-api) or [JSON-RPC (HTTP POST)](../tutorials/http-websocket-apis/get-started.md#json-rpc). +For most common operations, like requesting account balances or transaction history, you can query a self-hosted or [public XRP Ledger server](../tutorials/public-servers.md) using a [WebSocket connection](../tutorials/http-websocket-apis/build-apps/get-started.md#websocket-api) or [JSON-RPC (HTTP POST)](../tutorials/http-websocket-apis/build-apps/get-started.md#json-rpc). -See the [Get Started Using HTTP / WebSocket APIs](../tutorials/http-websocket-apis/get-started.md) page for more information. +See the [Get Started Using HTTP / WebSocket APIs](../tutorials/http-websocket-apis/build-apps/get-started.md) page for more information. diff --git a/docs/references/http-websocket-apis/admin-api-methods/index.md b/docs/references/http-websocket-apis/admin-api-methods/index.md index 9650fe5cac..ebe02c4b57 100644 --- a/docs/references/http-websocket-apis/admin-api-methods/index.md +++ b/docs/references/http-websocket-apis/admin-api-methods/index.md @@ -10,7 +10,7 @@ labels: Administer a `rippled` server using these admin API methods. Admin methods are meant only for trusted personnel in charge of keeping the server operational. Admin methods include commands for managing, monitoring, and debugging the server. -Admin commands are available only if you connect to `rippled` on a host and port that the `rippled.cfg` file identifies as admin. By default, the commandline client uses an admin connection. For more information on connecting to `rippled`, see [Getting Started with the `rippled` API](../../../tutorials/http-websocket-apis/get-started.md). +Admin commands are available only if you connect to `rippled` on a host and port that the `rippled.cfg` file identifies as admin. By default, the commandline client uses an admin connection. For more information on connecting to `rippled`, see [Getting Started with the `rippled` API](../../../tutorials/http-websocket-apis/build-apps/get-started.md). ## [Key Generation Methods](key-generation-methods/index.md) @@ -48,7 +48,7 @@ Use these methods to sign transactions. * **[`sign`](signing-methods/sign.md)** - Cryptographically sign a transaction. * **[`sign_for`](signing-methods/sign_for.md)** - Contribute to a multi-signature. -By default, these methods are [admin-only](../../../tutorials/http-websocket-apis/get-started.md#admin-access). They can be used as public methods if the server admin has [enabled public signing](../../../infrastructure/configuration/enable-public-signing.md). +By default, these methods are [admin-only](../../../tutorials/http-websocket-apis/build-apps/get-started.md#admin-access). They can be used as public methods if the server admin has [enabled public signing](../../../infrastructure/configuration/enable-public-signing.md). ## [Peer Management Methods](peer-management-methods/index.md) diff --git a/docs/references/http-websocket-apis/api-conventions/rate-limiting.md b/docs/references/http-websocket-apis/api-conventions/rate-limiting.md index 82c853f44d..ee4c525aae 100644 --- a/docs/references/http-websocket-apis/api-conventions/rate-limiting.md +++ b/docs/references/http-websocket-apis/api-conventions/rate-limiting.md @@ -10,7 +10,7 @@ labels: The `rippled` server limits the rate at which API clients can make requests on public APIs. Rate limiting is based on the IP address of the client, so clients behind [network address translation](https://en.wikipedia.org/wiki/Network_address_translation) share a limit based on their public IP address. -**Tip:** Rate limiting does not apply when the client is connected [as an admin](../../../tutorials/http-websocket-apis/get-started.md#admin-access). +**Tip:** Rate limiting does not apply when the client is connected [as an admin](../../../tutorials/http-websocket-apis/build-apps/get-started.md#admin-access). When a client is approaching the rate limit, the server adds the field `"warning": "load"` at the top level of an [API response](response-formatting.md). This warning is not added to every response, but the server may send several such warnings before it disconnects a client. @@ -58,7 +58,7 @@ The usage rate drops off exponentially over time, so a client that does not make - [The `rippled` Server](../../../concepts/networks-and-servers/index.md) - [Software Ecosystem](../../../introduction/software-ecosystem.md) - **Tutorials:** - - [Getting Started with XRP Ledger APIs](../../../tutorials/http-websocket-apis/get-started.md) + - [Getting Started with XRP Ledger APIs](../../../tutorials/http-websocket-apis/build-apps/get-started.md) - [Troubleshooting rippled](../../../infrastructure/troubleshooting/index.md) - **References:** - [rippled API Reference](../index.md) diff --git a/docs/references/http-websocket-apis/api-conventions/response-formatting.md b/docs/references/http-websocket-apis/api-conventions/response-formatting.md index 6f742fce00..f0d49f033d 100644 --- a/docs/references/http-websocket-apis/api-conventions/response-formatting.md +++ b/docs/references/http-websocket-apis/api-conventions/response-formatting.md @@ -130,7 +130,7 @@ Example warning: This warning indicates that the one or more [amendments](../../../concepts/networks-and-servers/amendments.md) to the XRP Ledger protocol are scheduled to become enabled, but the current server does not have an implementation for those amendments. If those amendments become enabled, the current server will become [amendment blocked](../../../concepts/networks-and-servers/amendments.md#amendment-blocked-servers), so you should [upgrade to the latest `rippled` version](../../../infrastructure/installation/index.md) as soon as possible. -The server only sends this warning if the client is [connected as an admin](../../../tutorials/http-websocket-apis/get-started.md#admin-access). +The server only sends this warning if the client is [connected as an admin](../../../tutorials/http-websocket-apis/build-apps/get-started.md#admin-access). This warning includes a `details` field with the following fields: @@ -190,7 +190,7 @@ It is generally safe to ignore this warning. - [Amendments](../../../concepts/networks-and-servers/amendments.md) - [Known Amendments](/resources/known-amendments.md) - **Tutorials:** - - [Get Started with XRP Ledger APIs](../../../tutorials/http-websocket-apis/get-started.md) + - [Get Started with XRP Ledger APIs](../../../tutorials/http-websocket-apis/build-apps/get-started.md) - [Install and Update `rippled`](../../../infrastructure/installation/index.md) - **References:** - [feature method][] diff --git a/docs/references/http-websocket-apis/public-api-methods/account-methods/account_info.md b/docs/references/http-websocket-apis/public-api-methods/account-methods/account_info.md index 1ca1c14da6..3db20ebd29 100644 --- a/docs/references/http-websocket-apis/public-api-methods/account-methods/account_info.md +++ b/docs/references/http-websocket-apis/public-api-methods/account-methods/account_info.md @@ -227,7 +227,7 @@ The `account_flags` field contains the following nested fields: | `noFreeze` | Boolean | If `true`, the account has permanently given up the abilities to freeze individual trust lines or end a global freeze. See [No Freeze](../../../../concepts/tokens/fungible-tokens/freezes.md#no-freeze) for details. | | `passwordSpent` | Boolean | If `false`, the account can send a special [key reset transaction](../../../../concepts/transactions/transaction-cost.md#key-reset-transaction) with a transaction cost of 0. The protocol turns this flag on and off automatically; it is not controlled by a user-facing setting. | | `requireAuthorization` | Boolean | If `true`, the account is using [Authorized Trust Lines](../../../../concepts/tokens/fungible-tokens/authorized-trust-lines.md) to limit who can hold the tokens it issues. | -| `requireDestinationTag` | Boolean | If `true`, the account [requires a destination tag](../../../../tutorials/tasks/manage-account-settings/require-destination-tags.md) on all payments it receives. | +| `requireDestinationTag` | Boolean | If `true`, the account [requires a destination tag](../../../../tutorials/how-tos/manage-account-settings/require-destination-tags.md) on all payments it receives. | The `queue_data` field, if present, contains the following nested fields: diff --git a/docs/references/protocol/ledger-data/ledger-entry-types/check.md b/docs/references/protocol/ledger-data/ledger-entry-types/check.md index a506aa23b0..d1b7a26595 100644 --- a/docs/references/protocol/ledger-data/ledger-entry-types/check.md +++ b/docs/references/protocol/ledger-data/ledger-entry-types/check.md @@ -75,6 +75,6 @@ The ID of a `Check` entry is the [SHA-512Half][] of the following values, concat * The `Sequence` number of the [CheckCreate transaction][] that created the `Check`. If the CheckCreate transaction used a [Ticket](../../../../concepts/accounts/tickets.md), use the `TicketSequence` value instead. -See the tutorial showing how to [Send a Check](../../../../tutorials/tasks/use-specialized-payment-types/use-checks/send-a-check.md). +See the tutorial showing how to [Send a Check](../../../../tutorials/how-tos/use-specialized-payment-types/use-checks/send-a-check.md). {% raw-partial file="/docs/_snippets/common-links.md" /%} diff --git a/docs/references/protocol/transactions/types/accountset.md b/docs/references/protocol/transactions/types/accountset.md index 286d7bfeab..f789fbaa70 100644 --- a/docs/references/protocol/transactions/types/accountset.md +++ b/docs/references/protocol/transactions/types/accountset.md @@ -36,7 +36,7 @@ An AccountSet transaction modifies the properties of an [account in the XRP Ledg | [`Domain`](#domain) | String | Blob | _(Optional)_ The domain that owns this account, as a string of hex representing the ASCII for the domain in lowercase. [Cannot be more than 256 bytes in length.](https://github.com/XRPLF/rippled/blob/55dc7a252e08a0b02cd5aa39e9b4777af3eafe77/src/ripple/app/tx/impl/SetAccount.h#L34) | | `EmailHash` | String | Hash128 | _(Optional)_ An arbitrary 128-bit value. Conventionally, clients treat this as the md5 hash of an email address to use for displaying a [Gravatar](http://en.gravatar.com/site/implement/hash/) image. | | `MessageKey` | String | Blob | _(Optional)_ Public key for sending encrypted messages to this account. To set the key, it must be exactly 33 bytes, with the first byte indicating the key type: `0x02` or `0x03` for secp256k1 keys, `0xED` for Ed25519 keys. To remove the key, use an empty value. | -| `NFTokenMinter` | String | Blob | _(Optional)_ Another account that can [mint NFTokens for you](../../../../tutorials/javascript/modular-tutorials/nfts/assign-an-authorized-minter.md). _(Added by the [NonFungibleTokensV1_1 amendment][].)_ | +| `NFTokenMinter` | String | Blob | _(Optional)_ Another account that can [mint NFTokens for you](../../../../tutorials/javascript/nfts/assign-an-authorized-minter.md). _(Added by the [NonFungibleTokensV1_1 amendment][].)_ | | [`SetFlag`](#accountset-flags) | Number | UInt32 | _(Optional)_ Integer flag to enable for this account. | | [`TransferRate`](#transferrate) | Number | UInt32 | _(Optional)_ The fee to charge when users transfer this account's tokens, represented as billionths of a unit. Cannot be more than `2000000000` or less than `1000000000`, except for the special case `0` meaning no fee. | | [`TickSize`](../../../../concepts/tokens/decentralized-exchange/ticksize.md) | Number | UInt8 | _(Optional)_ Tick size to use for offers involving a currency issued by this address. The exchange rates of those offers is rounded to this many significant digits. Valid values are `3` to `15` inclusive, or `0` to disable. _(Added by the [TickSize amendment][])_ | diff --git a/docs/references/protocol/transactions/types/setregularkey.md b/docs/references/protocol/transactions/types/setregularkey.md index 71814c9fce..413115872b 100644 --- a/docs/references/protocol/transactions/types/setregularkey.md +++ b/docs/references/protocol/transactions/types/setregularkey.md @@ -39,7 +39,7 @@ You can protect your account by assigning a regular key pair to it and using it For more information about regular and master key pairs, see [Cryptographic Keys](../../../../concepts/accounts/cryptographic-keys.md). -For a tutorial on assigning a regular key pair to an account, see [Working with a Regular Key Pair](../../../../tutorials/tasks/manage-account-settings/assign-a-regular-key-pair.md). +For a tutorial on assigning a regular key pair to an account, see [Working with a Regular Key Pair](../../../../tutorials/how-tos/manage-account-settings/assign-a-regular-key-pair.md). For even greater security, you can use [multi-signing](../../../../concepts/accounts/multi-signing.md), but multi-signing requires additional XRP for the [transaction cost][] and [reserve](../../../../concepts/accounts/reserves.md). diff --git a/docs/tutorials/tasks/index.md b/docs/tutorials/how-tos/index.md similarity index 51% rename from docs/tutorials/tasks/index.md rename to docs/tutorials/how-tos/index.md index c2824ea1eb..77b024c16d 100644 --- a/docs/tutorials/tasks/index.md +++ b/docs/tutorials/how-tos/index.md @@ -1,13 +1,13 @@ --- -html: tasks.html +html: how-tos.html parent: tutorials.html top_nav_grouping: Article Types metadata: indexPage: true --- -# Tasks +# How To's -Common tasks on the XRP Ledger. +These examples provide step-by-step instructions for administrative tasks. {% child-pages /%} diff --git a/docs/tutorials/tasks/manage-account-settings/assign-a-regular-key-pair.md b/docs/tutorials/how-tos/manage-account-settings/assign-a-regular-key-pair.md similarity index 100% rename from docs/tutorials/tasks/manage-account-settings/assign-a-regular-key-pair.md rename to docs/tutorials/how-tos/manage-account-settings/assign-a-regular-key-pair.md diff --git a/docs/tutorials/tasks/manage-account-settings/change-or-remove-a-regular-key-pair.md b/docs/tutorials/how-tos/manage-account-settings/change-or-remove-a-regular-key-pair.md similarity index 100% rename from docs/tutorials/tasks/manage-account-settings/change-or-remove-a-regular-key-pair.md rename to docs/tutorials/how-tos/manage-account-settings/change-or-remove-a-regular-key-pair.md diff --git a/docs/tutorials/tasks/manage-account-settings/disable-master-key-pair.md b/docs/tutorials/how-tos/manage-account-settings/disable-master-key-pair.md similarity index 100% rename from docs/tutorials/tasks/manage-account-settings/disable-master-key-pair.md rename to docs/tutorials/how-tos/manage-account-settings/disable-master-key-pair.md diff --git a/docs/tutorials/tasks/manage-account-settings/index.md b/docs/tutorials/how-tos/manage-account-settings/index.md similarity index 100% rename from docs/tutorials/tasks/manage-account-settings/index.md rename to docs/tutorials/how-tos/manage-account-settings/index.md diff --git a/docs/tutorials/tasks/manage-account-settings/offline-account-setup.md b/docs/tutorials/how-tos/manage-account-settings/offline-account-setup.md similarity index 99% rename from docs/tutorials/tasks/manage-account-settings/offline-account-setup.md rename to docs/tutorials/how-tos/manage-account-settings/offline-account-setup.md index 84edf10c31..a06ccc0655 100644 --- a/docs/tutorials/tasks/manage-account-settings/offline-account-setup.md +++ b/docs/tutorials/how-tos/manage-account-settings/offline-account-setup.md @@ -18,7 +18,7 @@ A highly secure [signing configuration](../../../concepts/transactions/secure-si To use offline signing, you must meet the following prerequisites: - You must have one computer to use as an offline machine. This machine must be set up with a [supported operating system](../../../infrastructure/installation/system-requirements.md). See your operating system's support for offline setup instructions. (For example, [Red Hat Enterprise Linux DVD ISO installation instructions](https://access.redhat.com/solutions/7227).) Be sure that the software and physical media you use are not infected with malware. -- You must have a separate computer to use as an online machine. This machine does not need to run `rippled` but it must be able to connect to the XRP Ledger network and receive information about the state of the shared ledger. For example, you can use a [WebSocket connection to a public server](../../http-websocket-apis/get-started.md). +- You must have a separate computer to use as an online machine. This machine does not need to run `rippled` but it must be able to connect to the XRP Ledger network and receive information about the state of the shared ledger. For example, you can use a [WebSocket connection to a public server](../../http-websocket-apis/build-apps/get-started.md). - You must have a secure way to transfer signed transaction binary data from the offline machine to the online machine. - One way to do this is with a QR code generator on the offline machine, and a QR code scanner on the online machine. (In this case, your "online machine" could be a handheld device such as a smartphone.) - Another way is to copy files from the offline machine to an online machine using physical media. If you use this method, be sure not to use physical media that could infect your offline machine with malicious software. (For example, do not reuse the same USB drive on both online and offline machines.) diff --git a/docs/tutorials/tasks/manage-account-settings/require-destination-tags.md b/docs/tutorials/how-tos/manage-account-settings/require-destination-tags.md similarity index 98% rename from docs/tutorials/tasks/manage-account-settings/require-destination-tags.md rename to docs/tutorials/how-tos/manage-account-settings/require-destination-tags.md index 1c41679250..c3a3b45b55 100644 --- a/docs/tutorials/tasks/manage-account-settings/require-destination-tags.md +++ b/docs/tutorials/how-tos/manage-account-settings/require-destination-tags.md @@ -23,8 +23,8 @@ This tutorial demonstrates how to enable the Require Destination Tag flag on you - You need a funded XRP Ledger account, with an address, secret key, and some XRP. For production, you can use the same address and secret consistently. For this tutorial, you can generate new test credentials as needed. - You need a connection to the XRP Ledger network. As shown in this tutorial, you can use public servers for testing. - You should be familiar with the Getting Started instructions for your preferred client library. This page provides examples for the following: - - **JavaScript** with the [xrpl.js library](https://github.com/XRPLF/xrpl.js/). See [Get Started Using JavaScript](../../javascript/get-started.md) for setup steps. - - **Python** with the [`xrpl-py` library](https://xrpl-py.readthedocs.io/). See [Get Started using Python](../../python/get-started.md) for setup steps. + - **JavaScript** with the [xrpl.js library](https://github.com/XRPLF/xrpl.js/). See [Get Started Using JavaScript](../../javascript/build-apps/get-started.md) for setup steps. + - **Python** with the [`xrpl-py` library](https://xrpl-py.readthedocs.io/). See [Get Started using Python](../../python/build-apps/get-started.md) for setup steps. - You can also read along and use the interactive steps in your browser without any setup. diff --git a/docs/tutorials/tasks/manage-account-settings/send-a-multi-signed-transaction.md b/docs/tutorials/how-tos/manage-account-settings/send-a-multi-signed-transaction.md similarity index 100% rename from docs/tutorials/tasks/manage-account-settings/send-a-multi-signed-transaction.md rename to docs/tutorials/how-tos/manage-account-settings/send-a-multi-signed-transaction.md diff --git a/docs/tutorials/tasks/manage-account-settings/set-up-multi-signing.md b/docs/tutorials/how-tos/manage-account-settings/set-up-multi-signing.md similarity index 100% rename from docs/tutorials/tasks/manage-account-settings/set-up-multi-signing.md rename to docs/tutorials/how-tos/manage-account-settings/set-up-multi-signing.md diff --git a/docs/tutorials/tasks/manage-account-settings/use-tickets.md b/docs/tutorials/how-tos/manage-account-settings/use-tickets.md similarity index 99% rename from docs/tutorials/tasks/manage-account-settings/use-tickets.md rename to docs/tutorials/how-tos/manage-account-settings/use-tickets.md index 184046ffb6..18d5eb6e63 100644 --- a/docs/tutorials/tasks/manage-account-settings/use-tickets.md +++ b/docs/tutorials/how-tos/manage-account-settings/use-tickets.md @@ -20,7 +20,7 @@ steps: ['Generate', 'Connect', 'Check Sequence', 'Prepare & Sign', 'Submit', 'Wa -This page provides JavaScript examples that use the [xrpl.js](https://js.xrpl.org/) library. See [Get Started Using JavaScript](../../javascript/get-started.md) for setup instructions. +This page provides JavaScript examples that use the [xrpl.js](https://js.xrpl.org/) library. See [Get Started Using JavaScript](../../javascript/build-apps/get-started.md) for setup instructions. Since JavaScript works in the web browser, you can read along and use the interactive steps without any setup. diff --git a/docs/tutorials/tasks/send-xrp.md b/docs/tutorials/how-tos/send-xrp.md similarity index 97% rename from docs/tutorials/tasks/send-xrp.md rename to docs/tutorials/how-tos/send-xrp.md index a9f061403b..652dc7141e 100644 --- a/docs/tutorials/tasks/send-xrp.md +++ b/docs/tutorials/how-tos/send-xrp.md @@ -24,10 +24,10 @@ This tutorial explains how to send a direct XRP Payment using `xrpl.js` for Java To interact with the XRP Ledger, you need to set up a dev environment with the necessary tools. This tutorial provides examples using the following options: -- **JavaScript** with the [xrpl.js library](https://github.com/XRPLF/xrpl.js/). See [Get Started Using JavaScript](../javascript/get-started.md) for setup steps. -- **Python** with the [`xrpl-py` library](https://xrpl-py.readthedocs.io/). See [Get Started using Python](../python/get-started.md) for setup steps. -- **Java** with the [xrpl4j library](https://github.com/XRPLF/xrpl4j). See [Get Started Using Java](../java/get-started.md) for setup steps. -- **PHP** with the [XRPL_PHP library](https://github.com/AlexanderBuzz/xrpl-php). See [Get Started Using PHP](../php/get-started.md) for setup steps. +- **JavaScript** with the [xrpl.js library](https://github.com/XRPLF/xrpl.js/). See [Get Started Using JavaScript](../javascript/build-apps/get-started.md) for setup steps. +- **Python** with the [`xrpl-py` library](https://xrpl-py.readthedocs.io/). See [Get Started using Python](../python/build-apps/get-started.md) for setup steps. +- **Java** with the [xrpl4j library](https://github.com/XRPLF/xrpl4j). See [Get Started Using Java](../java/build-apps/get-started.md) for setup steps. +- **PHP** with the [XRPL_PHP library](https://github.com/AlexanderBuzz/xrpl-php). See [Get Started Using PHP](../php/build-apps/get-started.md) for setup steps. ## Send a Payment on the Test Net @@ -477,11 +477,11 @@ $client = new JsonRpcClient("http://localhost:5005"); After completing this tutorial, you may want to try the following: -- [Issue a token](../tasks/use-tokens/issue-a-fungible-token.md) on the XRP Ledger Testnet. -- [Trade in the Decentralized Exchange](../tasks/use-tokens/trade-in-the-decentralized-exchange.md). +- [Issue a token](../how-tos/use-tokens/issue-a-fungible-token.md) on the XRP Ledger Testnet. +- [Trade in the Decentralized Exchange](../how-tos/use-tokens/trade-in-the-decentralized-exchange.md). - Build [Reliable transaction submission](../../concepts/transactions/reliable-transaction-submission.md) for production systems. - Check your [client library](../../references/client-libraries.md)'s API reference for the full range of XRP Ledger functionality. -- Customize your [Account Settings](../tasks/manage-account-settings/index.md). +- Customize your [Account Settings](../how-tos/manage-account-settings/index.md). - Learn how [Transaction Metadata](../../references/protocol/transactions/metadata.md) describes the outcome of a transaction in detail. - Explore more [Payment Types](../../concepts/payment-types/index.md) such as Escrows and Payment Channels. diff --git a/docs/tutorials/tasks/use-specialized-payment-types/index.md b/docs/tutorials/how-tos/use-specialized-payment-types/index.md similarity index 100% rename from docs/tutorials/tasks/use-specialized-payment-types/index.md rename to docs/tutorials/how-tos/use-specialized-payment-types/index.md diff --git a/docs/tutorials/tasks/use-specialized-payment-types/use-checks/cancel-a-check.md b/docs/tutorials/how-tos/use-specialized-payment-types/use-checks/cancel-a-check.md similarity index 100% rename from docs/tutorials/tasks/use-specialized-payment-types/use-checks/cancel-a-check.md rename to docs/tutorials/how-tos/use-specialized-payment-types/use-checks/cancel-a-check.md diff --git a/docs/tutorials/tasks/use-specialized-payment-types/use-checks/cash-a-check-for-a-flexible-amount.md b/docs/tutorials/how-tos/use-specialized-payment-types/use-checks/cash-a-check-for-a-flexible-amount.md similarity index 100% rename from docs/tutorials/tasks/use-specialized-payment-types/use-checks/cash-a-check-for-a-flexible-amount.md rename to docs/tutorials/how-tos/use-specialized-payment-types/use-checks/cash-a-check-for-a-flexible-amount.md diff --git a/docs/tutorials/tasks/use-specialized-payment-types/use-checks/cash-a-check-for-an-exact-amount.md b/docs/tutorials/how-tos/use-specialized-payment-types/use-checks/cash-a-check-for-an-exact-amount.md similarity index 100% rename from docs/tutorials/tasks/use-specialized-payment-types/use-checks/cash-a-check-for-an-exact-amount.md rename to docs/tutorials/how-tos/use-specialized-payment-types/use-checks/cash-a-check-for-an-exact-amount.md diff --git a/docs/tutorials/tasks/use-specialized-payment-types/use-checks/look-up-checks-by-recipient.md b/docs/tutorials/how-tos/use-specialized-payment-types/use-checks/look-up-checks-by-recipient.md similarity index 100% rename from docs/tutorials/tasks/use-specialized-payment-types/use-checks/look-up-checks-by-recipient.md rename to docs/tutorials/how-tos/use-specialized-payment-types/use-checks/look-up-checks-by-recipient.md diff --git a/docs/tutorials/tasks/use-specialized-payment-types/use-checks/look-up-checks-by-sender.md b/docs/tutorials/how-tos/use-specialized-payment-types/use-checks/look-up-checks-by-sender.md similarity index 100% rename from docs/tutorials/tasks/use-specialized-payment-types/use-checks/look-up-checks-by-sender.md rename to docs/tutorials/how-tos/use-specialized-payment-types/use-checks/look-up-checks-by-sender.md diff --git a/docs/tutorials/tasks/use-specialized-payment-types/use-checks/send-a-check.md b/docs/tutorials/how-tos/use-specialized-payment-types/use-checks/send-a-check.md similarity index 100% rename from docs/tutorials/tasks/use-specialized-payment-types/use-checks/send-a-check.md rename to docs/tutorials/how-tos/use-specialized-payment-types/use-checks/send-a-check.md diff --git a/docs/tutorials/tasks/use-specialized-payment-types/use-checks/use-checks.md b/docs/tutorials/how-tos/use-specialized-payment-types/use-checks/use-checks.md similarity index 100% rename from docs/tutorials/tasks/use-specialized-payment-types/use-checks/use-checks.md rename to docs/tutorials/how-tos/use-specialized-payment-types/use-checks/use-checks.md diff --git a/docs/tutorials/tasks/use-specialized-payment-types/use-escrows/cancel-an-expired-escrow.md b/docs/tutorials/how-tos/use-specialized-payment-types/use-escrows/cancel-an-expired-escrow.md similarity index 100% rename from docs/tutorials/tasks/use-specialized-payment-types/use-escrows/cancel-an-expired-escrow.md rename to docs/tutorials/how-tos/use-specialized-payment-types/use-escrows/cancel-an-expired-escrow.md diff --git a/docs/tutorials/tasks/use-specialized-payment-types/use-escrows/index.md b/docs/tutorials/how-tos/use-specialized-payment-types/use-escrows/index.md similarity index 100% rename from docs/tutorials/tasks/use-specialized-payment-types/use-escrows/index.md rename to docs/tutorials/how-tos/use-specialized-payment-types/use-escrows/index.md diff --git a/docs/tutorials/tasks/use-specialized-payment-types/use-escrows/look-up-escrows.md b/docs/tutorials/how-tos/use-specialized-payment-types/use-escrows/look-up-escrows.md similarity index 100% rename from docs/tutorials/tasks/use-specialized-payment-types/use-escrows/look-up-escrows.md rename to docs/tutorials/how-tos/use-specialized-payment-types/use-escrows/look-up-escrows.md diff --git a/docs/tutorials/tasks/use-specialized-payment-types/use-escrows/send-a-conditionally-held-escrow.md b/docs/tutorials/how-tos/use-specialized-payment-types/use-escrows/send-a-conditionally-held-escrow.md similarity index 100% rename from docs/tutorials/tasks/use-specialized-payment-types/use-escrows/send-a-conditionally-held-escrow.md rename to docs/tutorials/how-tos/use-specialized-payment-types/use-escrows/send-a-conditionally-held-escrow.md diff --git a/docs/tutorials/tasks/use-specialized-payment-types/use-escrows/send-a-time-held-escrow.md b/docs/tutorials/how-tos/use-specialized-payment-types/use-escrows/send-a-time-held-escrow.md similarity index 100% rename from docs/tutorials/tasks/use-specialized-payment-types/use-escrows/send-a-time-held-escrow.md rename to docs/tutorials/how-tos/use-specialized-payment-types/use-escrows/send-a-time-held-escrow.md diff --git a/docs/tutorials/tasks/use-specialized-payment-types/use-escrows/use-an-escrow-as-a-smart-contract.md b/docs/tutorials/how-tos/use-specialized-payment-types/use-escrows/use-an-escrow-as-a-smart-contract.md similarity index 100% rename from docs/tutorials/tasks/use-specialized-payment-types/use-escrows/use-an-escrow-as-a-smart-contract.md rename to docs/tutorials/how-tos/use-specialized-payment-types/use-escrows/use-an-escrow-as-a-smart-contract.md diff --git a/docs/tutorials/tasks/use-specialized-payment-types/use-payment-channels/index.md b/docs/tutorials/how-tos/use-specialized-payment-types/use-payment-channels/index.md similarity index 100% rename from docs/tutorials/tasks/use-specialized-payment-types/use-payment-channels/index.md rename to docs/tutorials/how-tos/use-specialized-payment-types/use-payment-channels/index.md diff --git a/docs/tutorials/tasks/use-specialized-payment-types/use-payment-channels/open-a-payment-channel-to-enable-an-inter-exchange-network.md b/docs/tutorials/how-tos/use-specialized-payment-types/use-payment-channels/open-a-payment-channel-to-enable-an-inter-exchange-network.md similarity index 100% rename from docs/tutorials/tasks/use-specialized-payment-types/use-payment-channels/open-a-payment-channel-to-enable-an-inter-exchange-network.md rename to docs/tutorials/how-tos/use-specialized-payment-types/use-payment-channels/open-a-payment-channel-to-enable-an-inter-exchange-network.md diff --git a/docs/tutorials/tasks/use-tokens/create-an-automated-market-maker.md b/docs/tutorials/how-tos/use-tokens/create-an-automated-market-maker.md similarity index 99% rename from docs/tutorials/tasks/use-tokens/create-an-automated-market-maker.md rename to docs/tutorials/how-tos/use-tokens/create-an-automated-market-maker.md index 4b5f211399..25026667c1 100644 --- a/docs/tutorials/tasks/use-tokens/create-an-automated-market-maker.md +++ b/docs/tutorials/how-tos/use-tokens/create-an-automated-market-maker.md @@ -26,7 +26,7 @@ An [Automated Market Maker (AMM)](../../../concepts/tokens/decentralized-exchang - You must have an XRP Ledger address and some XRP. For development and testing purposes, you can get these from a [Faucet](/resources/dev-tools/xrp-faucets). - You should be familiar with the Getting Started instructions for your preferred client library. This page provides examples for the following: - - **JavaScript** with the [xrpl.js library](https://github.com/XRPLF/xrpl.js/) **version 2.11.0 or later**. See [Get Started Using JavaScript](../../javascript/get-started.md) for setup steps. + - **JavaScript** with the [xrpl.js library](https://github.com/XRPLF/xrpl.js/) **version 2.11.0 or later**. See [Get Started Using JavaScript](../../javascript/build-apps/get-started.md) for setup steps. - You can also read along and use the interactive steps in your browser without any setup. - You should have a basic understanding of how [tokens](../../../concepts/tokens/index.md) work in the XRP Ledger. - You may want to read about [Automated Market Makers in the XRP Ledger](../../../concepts/tokens/decentralized-exchange/automated-market-makers.md) first. diff --git a/docs/tutorials/tasks/use-tokens/enable-no-freeze.md b/docs/tutorials/how-tos/use-tokens/enable-no-freeze.md similarity index 99% rename from docs/tutorials/tasks/use-tokens/enable-no-freeze.md rename to docs/tutorials/how-tos/use-tokens/enable-no-freeze.md index d923121aba..9508130777 100644 --- a/docs/tutorials/tasks/use-tokens/enable-no-freeze.md +++ b/docs/tutorials/how-tos/use-tokens/enable-no-freeze.md @@ -18,7 +18,7 @@ If you [issue tokens](../../../concepts/tokens/index.md) in the XRP Ledger, can - You need a connection to the XRP Ledger network. As shown in this tutorial, you can use public servers for testing. - You should be familiar with the Getting Started instructions for your preferred client library. This page provides examples for the following: - - **JavaScript** with the [xrpl.js library](https://github.com/XRPLF/xrpl.js/). See [Get Started Using JavaScript](../../javascript/get-started.md) for setup steps. + - **JavaScript** with the [xrpl.js library](https://github.com/XRPLF/xrpl.js/). See [Get Started Using JavaScript](../../javascript/build-apps/get-started.md) for setup steps. - You don't need to have [issued a token](issue-a-fungible-token.md) in the XRP Ledger to enable No Freeze, but the main reason you would do so is if you intend to or have already issued such a token. diff --git a/docs/tutorials/tasks/use-tokens/enact-global-freeze.md b/docs/tutorials/how-tos/use-tokens/enact-global-freeze.md similarity index 99% rename from docs/tutorials/tasks/use-tokens/enact-global-freeze.md rename to docs/tutorials/how-tos/use-tokens/enact-global-freeze.md index 46a29f2263..93ebebd9e5 100644 --- a/docs/tutorials/tasks/use-tokens/enact-global-freeze.md +++ b/docs/tutorials/how-tos/use-tokens/enact-global-freeze.md @@ -21,7 +21,7 @@ If you [issue tokens](../../../concepts/tokens/index.md) in the XRP Ledger, can - You need a connection to the XRP Ledger network. As shown in this tutorial, you can use public servers for testing. - You should be familiar with the Getting Started instructions for your preferred client library. This page provides examples for the following: - - **JavaScript** with the [xrpl.js library](https://github.com/XRPLF/xrpl.js/). See [Get Started Using JavaScript](../../javascript/get-started.md) for setup steps. + - **JavaScript** with the [xrpl.js library](https://github.com/XRPLF/xrpl.js/). See [Get Started Using JavaScript](../../javascript/build-apps/get-started.md) for setup steps. - You don't need to have [issued a token](issue-a-fungible-token.md) in the XRP Ledger to enact a Global Freeze, but the main reason you would do so is if you have already issued such a token. diff --git a/docs/tutorials/tasks/use-tokens/freeze-a-trust-line.md b/docs/tutorials/how-tos/use-tokens/freeze-a-trust-line.md similarity index 99% rename from docs/tutorials/tasks/use-tokens/freeze-a-trust-line.md rename to docs/tutorials/how-tos/use-tokens/freeze-a-trust-line.md index 23007a3ac4..af34c4c41c 100644 --- a/docs/tutorials/tasks/use-tokens/freeze-a-trust-line.md +++ b/docs/tutorials/how-tos/use-tokens/freeze-a-trust-line.md @@ -22,7 +22,7 @@ This tutorial shows the steps to [freeze an individual trust line](../../../conc - You need a connection to the XRP Ledger network. As shown in this tutorial, you can use public servers for testing. - You should be familiar with the Getting Started instructions for your preferred client library. This page provides examples for the following: - - **JavaScript** with the [xrpl.js library](https://github.com/XRPLF/xrpl.js/). See [Get Started Using JavaScript](../../javascript/get-started.md) for setup steps. + - **JavaScript** with the [xrpl.js library](https://github.com/XRPLF/xrpl.js/). See [Get Started Using JavaScript](../../javascript/build-apps/get-started.md) for setup steps. - This tutorial assumes **you have already [issued a token](issue-a-fungible-token.md)** in the XRP Ledger. - You **cannot** have enabled the [No Freeze setting](../../../concepts/tokens/fungible-tokens/freezes.md#no-freeze), which gives up your ability to freeze individual trust lines. diff --git a/docs/tutorials/tasks/use-tokens/index.md b/docs/tutorials/how-tos/use-tokens/index.md similarity index 100% rename from docs/tutorials/tasks/use-tokens/index.md rename to docs/tutorials/how-tos/use-tokens/index.md diff --git a/docs/tutorials/tasks/use-tokens/issue-a-fungible-token.md b/docs/tutorials/how-tos/use-tokens/issue-a-fungible-token.md similarity index 99% rename from docs/tutorials/tasks/use-tokens/issue-a-fungible-token.md rename to docs/tutorials/how-tos/use-tokens/issue-a-fungible-token.md index 14a4657e1b..eaf92c6094 100644 --- a/docs/tutorials/tasks/use-tokens/issue-a-fungible-token.md +++ b/docs/tutorials/how-tos/use-tokens/issue-a-fungible-token.md @@ -20,9 +20,9 @@ Anyone can issue various types of tokens in the XRP Ledger, ranging from informa - Each address needs enough XRP to satisfy the [reserve requirement](../../../concepts/accounts/reserves.md) including the additional reserve for a trust line. - You need a connection to the XRP Ledger network. As shown in this tutorial, you can use public servers for testing. - You should be familiar with the Getting Started instructions for your preferred client library. This page provides examples for the following: - - **JavaScript** with the [xrpl.js library](https://github.com/XRPLF/xrpl.js/). See [Get Started Using JavaScript](../../javascript/get-started.md) for setup steps. - - **Python** with the [`xrpl-py` library](https://xrpl-py.readthedocs.io/). See [Get Started using Python](../../python/get-started.md) for setup steps. - - **Java** with the [xrpl4j library](https://github.com/XRPLF/xrpl4j). See [Get Started Using Java](../../java/get-started.md) for setup steps. + - **JavaScript** with the [xrpl.js library](https://github.com/XRPLF/xrpl.js/). See [Get Started Using JavaScript](../../javascript/build-apps/get-started.md) for setup steps. + - **Python** with the [`xrpl-py` library](https://xrpl-py.readthedocs.io/). See [Get Started using Python](../../python/build-apps/get-started.md) for setup steps. + - **Java** with the [xrpl4j library](https://github.com/XRPLF/xrpl4j). See [Get Started Using Java](../../java/build-apps/get-started.md) for setup steps. - You can also read along and use the interactive steps in your browser without any setup. diff --git a/docs/tutorials/tasks/use-tokens/trade-in-the-decentralized-exchange.md b/docs/tutorials/how-tos/use-tokens/trade-in-the-decentralized-exchange.md similarity index 98% rename from docs/tutorials/tasks/use-tokens/trade-in-the-decentralized-exchange.md rename to docs/tutorials/how-tos/use-tokens/trade-in-the-decentralized-exchange.md index 4af8efcc3a..addb5b283a 100644 --- a/docs/tutorials/tasks/use-tokens/trade-in-the-decentralized-exchange.md +++ b/docs/tutorials/how-tos/use-tokens/trade-in-the-decentralized-exchange.md @@ -18,8 +18,8 @@ This tutorial demonstrates how you can buy and sell tokens in the [decentralized - You need a connection to the XRP Ledger network. As shown in this tutorial, you can use public servers for testing. - You should be familiar with the Getting Started instructions for your preferred client library. This page provides examples for the following: - - **JavaScript** with the [xrpl.js library](https://github.com/XRPLF/xrpl.js/). See [Get Started Using JavaScript](../../javascript/get-started.md) for setup steps. - - **Python** with the [`xrpl-py` library](https://xrpl-py.readthedocs.io/). See [Get Started using Python](../../python/get-started.md) for setup steps. + - **JavaScript** with the [xrpl.js library](https://github.com/XRPLF/xrpl.js/). See [Get Started Using JavaScript](../../javascript/build-apps/get-started.md) for setup steps. + - **Python** with the [`xrpl-py` library](https://xrpl-py.readthedocs.io/). See [Get Started using Python](../../python/build-apps/get-started.md) for setup steps. - You can also read along and use the interactive steps in your browser without any setup. diff --git a/docs/tutorials/tasks/use-xrpl-sidechains/index.md b/docs/tutorials/how-tos/use-xrpl-sidechains/index.md similarity index 100% rename from docs/tutorials/tasks/use-xrpl-sidechains/index.md rename to docs/tutorials/how-tos/use-xrpl-sidechains/index.md diff --git a/docs/tutorials/tasks/use-xrpl-sidechains/set-up-iou-iou-bridge.md b/docs/tutorials/how-tos/use-xrpl-sidechains/set-up-iou-iou-bridge.md similarity index 100% rename from docs/tutorials/tasks/use-xrpl-sidechains/set-up-iou-iou-bridge.md rename to docs/tutorials/how-tos/use-xrpl-sidechains/set-up-iou-iou-bridge.md diff --git a/docs/tutorials/tasks/use-xrpl-sidechains/set-up-xrp-xrp-bridge.md b/docs/tutorials/how-tos/use-xrpl-sidechains/set-up-xrp-xrp-bridge.md similarity index 100% rename from docs/tutorials/tasks/use-xrpl-sidechains/set-up-xrp-xrp-bridge.md rename to docs/tutorials/how-tos/use-xrpl-sidechains/set-up-xrp-xrp-bridge.md diff --git a/docs/tutorials/tasks/use-xrpl-sidechains/submit-cross-chain-transaction.md b/docs/tutorials/how-tos/use-xrpl-sidechains/submit-cross-chain-transaction.md similarity index 100% rename from docs/tutorials/tasks/use-xrpl-sidechains/submit-cross-chain-transaction.md rename to docs/tutorials/how-tos/use-xrpl-sidechains/submit-cross-chain-transaction.md diff --git a/docs/tutorials/http-websocket-apis/get-started.md b/docs/tutorials/http-websocket-apis/build-apps/get-started.md similarity index 60% rename from docs/tutorials/http-websocket-apis/get-started.md rename to docs/tutorials/http-websocket-apis/build-apps/get-started.md index 76d9061a4f..34bc4ec3a6 100644 --- a/docs/tutorials/http-websocket-apis/get-started.md +++ b/docs/tutorials/http-websocket-apis/build-apps/get-started.md @@ -12,7 +12,7 @@ showcase_icon: assets/img/logos/globe.svg --- # Get Started Using HTTP / WebSocket APIs -If you don't have or don't want to use a [client library](../../references/client-libraries.md) in your preferred programming language, you can access the XRP Ledger directly through the APIs of its core server software, [`rippled`](../../concepts/networks-and-servers/index.md). The server provides APIs over JSON-RPC and WebSocket protocols. If you don't [run your own instance of `rippled`](../../infrastructure/installation/index.md) you can still use a [public server][public servers]. +If you don't have or don't want to use a [client library](../../../references/client-libraries.md) in your preferred programming language, you can access the XRP Ledger directly through the APIs of its core server software, [`rippled`](../../../concepts/networks-and-servers/index.md). The server provides APIs over JSON-RPC and WebSocket protocols. If you don't [run your own instance of `rippled`](../../../infrastructure/installation/index.md) you can still use a [public server][public servers]. **Tip:** You can dive right into the API with the [**WebSocket API Tool**](/resources/dev-tools/websocket-api-tool), or use the [XRP Ledger Explorer](https://livenet.xrpl.org/) to watch the progress of the ledger live. @@ -21,21 +21,21 @@ If you don't have or don't want to use a [client library](../../references/clien Both JSON-RPC and WebSocket are HTTP-based protocols, and for the most part the data provided over both protocols is the same. The major differences are as follows: - JSON-RPC uses individual HTTP requests and responses for each call, similar to a RESTful API. You can use any common HTTP client such as [curl](https://curl.se/), [Postman](https://www.postman.com/downloads/), or [Requests](https://requests.readthedocs.io/) to access this API. -- WebSocket uses a persistent connection that allows the server to push data to the client. Functions that require push messages, like [event subscriptions](../../references/http-websocket-apis/public-api-methods/subscription-methods/subscribe.md), are only available using WebSocket. +- WebSocket uses a persistent connection that allows the server to push data to the client. Functions that require push messages, like [event subscriptions](../../../references/http-websocket-apis/public-api-methods/subscription-methods/subscribe.md), are only available using WebSocket. Both APIs can be served unencrypted (`http://` and `ws://`) or encrypted using TLS (`https://` and `wss://`). Unencrypted connections should not be served over open networks, but can be used when the client is on the same machine as the server. ## Admin Access -The API methods are divided into [Public Methods](../../references/http-websocket-apis/public-api-methods/index.md) and [Admin Methods](../../references/http-websocket-apis/admin-api-methods/index.md) so that organizations can offer public servers for the benefit of the community. To access admin methods, or admin functionality of public methods, you must connect to the API on a **port and IP address marked as admin** in the server's config file. +The API methods are divided into [Public Methods](../../../references/http-websocket-apis/public-api-methods/index.md) and [Admin Methods](../../../references/http-websocket-apis/admin-api-methods/index.md) so that organizations can offer public servers for the benefit of the community. To access admin methods, or admin functionality of public methods, you must connect to the API on a **port and IP address marked as admin** in the server's config file. The [example config file](https://github.com/XRPLF/rippled/blob/f00f263852c472938bf8e993e26c7f96f435935c/cfg/rippled-example.cfg#L1154-L1179) listens for connections on the local loopback network (127.0.0.1), with JSON-RPC (HTTP) on port 5005 and WebSocket (WS) on port 6006, and treats all connected clients as admin. ## WebSocket API -If you are looking to try out some methods on the XRP Ledger, you can skip writing your own WebSocket code and go straight to using the API at the [WebSocket API Tool](/resources/dev-tools/websocket-api-tool). Later on, when you want to connect to your own `rippled` server, you can [build your own client](monitor-incoming-payments-with-websocket.md) or use a [client library](../../references/client-libraries.md) with WebSocket support. +If you are looking to try out some methods on the XRP Ledger, you can skip writing your own WebSocket code and go straight to using the API at the [WebSocket API Tool](/resources/dev-tools/websocket-api-tool). Later on, when you want to connect to your own `rippled` server, you can [build your own client](monitor-incoming-payments-with-websocket.md) or use a [client library](../../../references/client-libraries.md) with WebSocket support. Example WebSocket API request: @@ -49,7 +49,7 @@ Example WebSocket API request: The response shows you the current status of the server. -Read more: [Request Formatting >](../../references/http-websocket-apis/api-conventions/request-formatting.md) [Response Formatting >](../../references/http-websocket-apis/api-conventions/response-formatting.md) [About the server_info method >][server_info method] +Read more: [Request Formatting >](../../../references/http-websocket-apis/api-conventions/request-formatting.md) [Response Formatting >](../../../references/http-websocket-apis/api-conventions/response-formatting.md) [About the server_info method >][server_info method] ## JSON-RPC @@ -73,7 +73,7 @@ Content-Type: application/json The response shows you the current status of the server. -Read more: [Request Formatting >](../../references/http-websocket-apis/api-conventions/request-formatting.md#json-rpc-format) [Response Formatting >](../../references/http-websocket-apis/api-conventions/response-formatting.md) [About the server_info method >][server_info method] +Read more: [Request Formatting >](../../../references/http-websocket-apis/api-conventions/request-formatting.md#json-rpc-format) [Response Formatting >](../../../references/http-websocket-apis/api-conventions/response-formatting.md) [About the server_info method >][server_info method] ## Commandline @@ -85,7 +85,7 @@ Example commandline request: rippled --conf=/etc/opt/ripple/rippled.cfg server_info ``` -Read more: [Commandline Usage Reference >](../../infrastructure/commandline-usage.md) +Read more: [Commandline Usage Reference >](../../../infrastructure/commandline-usage.md) **Caution:** The commandline interface is intended for administrative purposes only and is _not a supported API_. New versions of `rippled` may introduce breaking changes to the commandline API without warning! @@ -93,21 +93,21 @@ Read more: [Commandline Usage Reference >](../../infrastructure/commandline-usag For a full list of API methods, see: -- [Public `rippled` Methods](../../references/http-websocket-apis/public-api-methods/index.md): Methods available on public servers, including looking up data from the ledger and submitting transactions. -- [Admin `rippled` Methods](../../references/http-websocket-apis/admin-api-methods/index.md): Methods for [managing](../../infrastructure/installation/install-rippled-on-ubuntu.md) the `rippled` server. +- [Public `rippled` Methods](../../../references/http-websocket-apis/public-api-methods/index.md): Methods available on public servers, including looking up data from the ledger and submitting transactions. +- [Admin `rippled` Methods](../../../references/http-websocket-apis/admin-api-methods/index.md): Methods for [managing](../../../infrastructure/installation/install-rippled-on-ubuntu.md) the `rippled` server. ## See Also - **Concepts:** - [XRP Ledger Overview](/about/) - - [Client Libraries](../../references/client-libraries.md) - - [Parallel Networks](../../concepts/networks-and-servers/parallel-networks.md) + - [Client Libraries](../../../references/client-libraries.md) + - [Parallel Networks](../../../concepts/networks-and-servers/parallel-networks.md) - **Tutorials:** - [Get Started Using JavaScript](get-started.md) - - [Reliable Transaction Submission](../../concepts/transactions/reliable-transaction-submission.md) - - [Manage the rippled Server](../../infrastructure/installation/install-rippled-on-ubuntu.md) + - [Reliable Transaction Submission](../../../concepts/transactions/reliable-transaction-submission.md) + - [Manage the rippled Server](../../../infrastructure/installation/install-rippled-on-ubuntu.md) - **References:** - - [rippled API Reference](../../references/http-websocket-apis/index.md) + - [rippled API Reference](../../../references/http-websocket-apis/index.md) {% raw-partial file="/docs/_snippets/common-links.md" /%} diff --git a/docs/tutorials/http-websocket-apis/build-apps/index.md b/docs/tutorials/http-websocket-apis/build-apps/index.md new file mode 100644 index 0000000000..76532518b8 --- /dev/null +++ b/docs/tutorials/http-websocket-apis/build-apps/index.md @@ -0,0 +1,13 @@ +--- +html: build-apps-with-http-websocket.html +parent: javascript.html +top_nav_grouping: Article Types +metadata: + indexPage: true +--- +# Build Applications with HTTP-Websocket Library + +Build applications in HTTP-Websocket. + + +{% child-pages /%} diff --git a/docs/tutorials/http-websocket-apis/monitor-incoming-payments-with-websocket.md b/docs/tutorials/http-websocket-apis/build-apps/monitor-incoming-payments-with-websocket.md similarity index 79% rename from docs/tutorials/http-websocket-apis/monitor-incoming-payments-with-websocket.md rename to docs/tutorials/http-websocket-apis/build-apps/monitor-incoming-payments-with-websocket.md index 88cc76d150..da23fa39e0 100644 --- a/docs/tutorials/http-websocket-apis/monitor-incoming-payments-with-websocket.md +++ b/docs/tutorials/http-websocket-apis/build-apps/monitor-incoming-payments-with-websocket.md @@ -10,7 +10,7 @@ labels: --- # Monitor Incoming Payments with WebSocket -This tutorial shows how to monitor for incoming [payments](../../concepts/payment-types/index.md) using the [WebSocket API](../../references/http-websocket-apis/index.md). Since all XRP Ledger transactions are public, anyone can monitor incoming payments to any address. +This tutorial shows how to monitor for incoming [payments](../../../concepts/payment-types/index.md) using the [WebSocket API](../../../references/http-websocket-apis/index.md). Since all XRP Ledger transactions are public, anyone can monitor incoming payments to any address. WebSocket follows a model where the client and server open one connection, then send messages both ways through the same connection, which stays open until explicitly closed (or until the connection fails). This is in contrast to the HTTP-based API model (including JSON-RPC and RESTful APIs), where the client opens and closes a new connection for each request.[¹](#footnote-1) @@ -19,8 +19,8 @@ WebSocket follows a model where the client and server open one connection, then ## Prerequisites - The examples in this page use JavaScript and the WebSocket protocol, which are available in all major modern browsers. If you have some JavaScript knowledge and expertise in another programming language with a WebSocket client, you can follow along while adapting the instructions to the language of your choice. -- You need a stable internet connection and access to an XRP Ledger server. The embedded examples connect to Ripple's pool of public servers. If you [run your own `rippled` or Clio server](../../infrastructure/installation/index.md), you can also connect to that server locally. -- To properly handle XRP values without rounding errors, you need access to a number type that can do math on 64-bit unsigned integers. The examples in this tutorial use [big.js](https://github.com/MikeMcl/big.js/). If you are working with [tokens](../../concepts/tokens/index.md), you need even more precision. For more information, see [Currency Precision](../../references/protocol/data-types/currency-formats.md#xrp-precision). +- You need a stable internet connection and access to an XRP Ledger server. The embedded examples connect to Ripple's pool of public servers. If you [run your own `rippled` or Clio server](../../../infrastructure/installation/index.md), you can also connect to that server locally. +- To properly handle XRP values without rounding errors, you need access to a number type that can do math on 64-bit unsigned integers. The examples in this tutorial use [big.js](https://github.com/MikeMcl/big.js/). If you are working with [tokens](../../../concepts/tokens/index.md), you need even more precision. For more information, see [Currency Precision](../../../references/protocol/data-types/currency-formats.md#xrp-precision). @@ -71,7 +71,7 @@ The above example opens a secure connection (`wss://`) to one of Ripple's public const socket = new WebSocket('ws://localhost:6006') ``` -**Tip:** By default, connecting to a local `rippled` server gives you access to the full set of [admin methods](../../references/http-websocket-apis/admin-api-methods/index.md) and admin-only data in some responses such as [server_info][server_info method], plus the [public methods](../../references/http-websocket-apis/public-api-methods/index.md) that are available when you connect to public servers over the internet. +**Tip:** By default, connecting to a local `rippled` server gives you access to the full set of [admin methods](../../../references/http-websocket-apis/admin-api-methods/index.md) and admin-only data in some responses such as [server_info][server_info method], plus the [public methods](../../../references/http-websocket-apis/public-api-methods/index.md) that are available when you connect to public servers over the internet. Example: @@ -123,11 +123,11 @@ Since WebSocket connections can have several messages going each way and there i - An `id` field that matches the `id` provided in the request this is a response for. (This is important because responses may arrive out of order.) - - A `status` field that indicates whether the API successfully processed your request. The string value `success` indicates [a successful response](../../references/http-websocket-apis/api-conventions/response-formatting.md). The string value `error` indicates [an error](../../references/http-websocket-apis/api-conventions/error-formatting.md). + - A `status` field that indicates whether the API successfully processed your request. The string value `success` indicates [a successful response](../../../references/http-websocket-apis/api-conventions/response-formatting.md). The string value `error` indicates [an error](../../../references/http-websocket-apis/api-conventions/error-formatting.md). - **Warning:** When submitting transactions, a `status` of `success` at the top level of the WebSocket message does not mean that the transaction itself succeeded. It only indicates that the server understood your request. For looking up a transaction's actual outcome, see [Look Up Transaction Results](../../concepts/transactions/finality-of-results/look-up-transaction-results.md). + **Warning:** When submitting transactions, a `status` of `success` at the top level of the WebSocket message does not mean that the transaction itself succeeded. It only indicates that the server understood your request. For looking up a transaction's actual outcome, see [Look Up Transaction Results](../../../concepts/transactions/finality-of-results/look-up-transaction-results.md). -- For follow-up messages from [subscriptions](../../references/http-websocket-apis/public-api-methods/subscription-methods/subscribe.md), the `type` indicates the type of follow-up message it is, such as the notification of a new transaction, ledger, or validation; or a follow-up to an ongoing [pathfinding request](../../references/http-websocket-apis/public-api-methods/path-and-order-book-methods/path_find.md). Your client only receives these messages if it subscribes to them. +- For follow-up messages from [subscriptions](../../../references/http-websocket-apis/public-api-methods/subscription-methods/subscribe.md), the `type` indicates the type of follow-up message it is, such as the notification of a new transaction, ledger, or validation; or a follow-up to an ongoing [pathfinding request](../../../references/http-websocket-apis/public-api-methods/path-and-order-book-methods/path_find.md). Your client only receives these messages if it subscribes to them. **Tip:** The [xrpl.js library for JavaScript](https://js.xrpl.org/) handles this step by default. All asynchronous API requests use Promises to provide the response, and you can listen to streams using the `.on(event, callback)` method of the `Client`. @@ -341,27 +341,27 @@ WS_HANDLERS["transaction"] = log_tx ## 4. Read Incoming Payments -When you subscribe to an account, you get messages for _all transactions to or from the account_, as well as _transactions that affect the account indirectly_, such as trading its [tokens](../../concepts/tokens/index.md). If your goal is to recognize when the account has received incoming payments, you must filter the transactions stream and process the payments based on the amount they actually delivered. Look for the following information: +When you subscribe to an account, you get messages for _all transactions to or from the account_, as well as _transactions that affect the account indirectly_, such as trading its [tokens](../../../concepts/tokens/index.md). If your goal is to recognize when the account has received incoming payments, you must filter the transactions stream and process the payments based on the amount they actually delivered. Look for the following information: -- The **`validated` field** indicates that the transaction's outcome is [final](../../concepts/transactions/finality-of-results/index.md). This should always be the case when you subscribe to `accounts`, but if you _also_ subscribe to `accounts_proposed` or the `transactions_proposed` stream then the server sends similar messages on the same connection for unconfirmed transactions. As a precaution, it's best to always check the `validated` field. -- The **`meta.TransactionResult` field** is the [transaction result](../../references/protocol/transactions/transaction-results/transaction-results.md). If the result is not `tesSUCCESS`, the transaction failed and cannot have delivered any value. +- The **`validated` field** indicates that the transaction's outcome is [final](../../../concepts/transactions/finality-of-results/index.md). This should always be the case when you subscribe to `accounts`, but if you _also_ subscribe to `accounts_proposed` or the `transactions_proposed` stream then the server sends similar messages on the same connection for unconfirmed transactions. As a precaution, it's best to always check the `validated` field. +- The **`meta.TransactionResult` field** is the [transaction result](../../../references/protocol/transactions/transaction-results/transaction-results.md). If the result is not `tesSUCCESS`, the transaction failed and cannot have delivered any value. - The **`transaction.Account`** field is the sender of the transaction. If you are only looking for transactions sent by others, you can ignore any transactions where this field matches your account's address. (Keep in mind, it _is_ possible to make a cross-currency payment to yourself.) - The **`transaction.TransactionType` field** is the type of transaction. The transaction types that can possibly deliver currency to an account are as follows: - - **[Payment transactions][]** can deliver XRP or [tokens](../../concepts/tokens/index.md). Filter these by the `transaction.Destination` field, which contains the address of the recipient, and always use the `meta.delivered_amount` to see how much the payment actually delivered. XRP amounts are [formatted as strings](../../references/protocol/data-types/basic-data-types.md#specifying-currency-amounts). + - **[Payment transactions][]** can deliver XRP or [tokens](../../../concepts/tokens/index.md). Filter these by the `transaction.Destination` field, which contains the address of the recipient, and always use the `meta.delivered_amount` to see how much the payment actually delivered. XRP amounts are [formatted as strings](../../../references/protocol/data-types/basic-data-types.md#specifying-currency-amounts). - **Warning:** If you use the `transaction.Amount` field instead, you may be vulnerable to the [partial payments exploit](../../concepts/payment-types/partial-payments.md#partial-payments-exploit). Malicious users can use this exploit to trick you into allowing the malicious user to trade or withdraw more money than they paid you. + **Warning:** If you use the `transaction.Amount` field instead, you may be vulnerable to the [partial payments exploit](../../../concepts/payment-types/partial-payments.md#partial-payments-exploit). Malicious users can use this exploit to trick you into allowing the malicious user to trade or withdraw more money than they paid you. - **[CheckCash transactions][]** allow an account to receive money authorized by a different account's [CheckCreate transaction][]. Look at the metadata of a **CheckCash transaction** to see how much currency the account received. - - **[EscrowFinish transactions][]** can deliver XRP by finishing an [Escrow](../../concepts/payment-types/escrow.md) created by a previous [EscrowCreate transaction][]. Look at the metadata of the **EscrowFinish transaction** to see which account received XRP from the escrow and how much. + - **[EscrowFinish transactions][]** can deliver XRP by finishing an [Escrow](../../../concepts/payment-types/escrow.md) created by a previous [EscrowCreate transaction][]. Look at the metadata of the **EscrowFinish transaction** to see which account received XRP from the escrow and how much. - - **[OfferCreate transactions][]** can deliver XRP or tokens by consuming offers your account has previously placed in the XRP Ledger's [decentralized exchange](../../concepts/tokens/decentralized-exchange/index.md). If you never place offers, you cannot receive money this way. Look at the metadata to see what currency the account received, if any, and how much. + - **[OfferCreate transactions][]** can deliver XRP or tokens by consuming offers your account has previously placed in the XRP Ledger's [decentralized exchange](../../../concepts/tokens/decentralized-exchange/index.md). If you never place offers, you cannot receive money this way. Look at the metadata to see what currency the account received, if any, and how much. - - **[PaymentChannelClaim transactions][]** can deliver XRP from a [payment channel](../../concepts/payment-types/payment-channels.md). Look at the metadata to see which accounts, if any, received XRP from the transaction. + - **[PaymentChannelClaim transactions][]** can deliver XRP from a [payment channel](../../../concepts/payment-types/payment-channels.md). Look at the metadata to see which accounts, if any, received XRP from the transaction. - **[PaymentChannelFund transactions][]** can return XRP from a closed (expired) payment channel to the sender. -- The **`meta` field** contains [transaction metadata](../../references/protocol/transactions/metadata.md), including exactly how much of which currency or currencies was delivered where. See [Look Up transaction Results](../../concepts/transactions/finality-of-results/look-up-transaction-results.md) for more information on how to understand transaction metadata. +- The **`meta` field** contains [transaction metadata](../../../references/protocol/transactions/metadata.md), including exactly how much of which currency or currencies was delivered where. See [Look Up transaction Results](../../../concepts/transactions/finality-of-results/look-up-transaction-results.md) for more information on how to understand transaction metadata. The following sample code looks at transaction metadata of all the above transaction types to report how much XRP an account received: @@ -472,9 +472,9 @@ $("#tx_read").click((event) => { ## Next Steps -- [Look Up Transaction Results](../../concepts/transactions/finality-of-results/look-up-transaction-results.md) to see exactly what a transaction did, and build your software to react appropriately. -- Try [Sending XRP](../tasks/send-xrp.md) from your own address. -- Try monitoring for transactions of advanced types like [Escrows](../../concepts/payment-types/escrow.md), [Checks](../../concepts/payment-types/checks.md), or [Payment Channels](../../concepts/payment-types/payment-channels.md), and responding to incoming notifications. +- [Look Up Transaction Results](../../../concepts/transactions/finality-of-results/look-up-transaction-results.md) to see exactly what a transaction did, and build your software to react appropriately. +- Try [Sending XRP](../../how-tos/send-xrp.md) from your own address. +- Try monitoring for transactions of advanced types like [Escrows](../../../concepts/payment-types/escrow.md), [Checks](../../../concepts/payment-types/checks.md), or [Payment Channels](../../../concepts/payment-types/payment-channels.md), and responding to incoming notifications. ## Other Programming Languages @@ -503,14 +503,14 @@ Many programming languages have libraries for sending and receiving data over a ## See Also - **Concepts:** - - [Transactions](../../concepts/transactions/index.md) - - [Finality of Results](../../concepts/transactions/finality-of-results/index.md) - How to know when a transaction's success or failure is final. (Short version: if a transaction is in a validated ledger, its outcome and metadata are final.) + - [Transactions](../../../concepts/transactions/index.md) + - [Finality of Results](../../../concepts/transactions/finality-of-results/index.md) - How to know when a transaction's success or failure is final. (Short version: if a transaction is in a validated ledger, its outcome and metadata are final.) - **Tutorials:** - - [Reliable Transaction Submission](../../concepts/transactions/reliable-transaction-submission.md) - - [Look Up Transaction Results](../../concepts/transactions/finality-of-results/look-up-transaction-results.md) + - [Reliable Transaction Submission](../../../concepts/transactions/reliable-transaction-submission.md) + - [Look Up Transaction Results](../../../concepts/transactions/finality-of-results/look-up-transaction-results.md) - **References:** - - [Transaction Types](../../references/protocol/transactions/types/index.md) - - [Transaction Metadata](../../references/protocol/transactions/metadata.md) - Summary of the metadata format and fields that appear in metadata - - [Transaction Results](../../references/protocol/transactions/transaction-results/transaction-results.md) - Tables of all possible result codes for transactions. + - [Transaction Types](../../../references/protocol/transactions/types/index.md) + - [Transaction Metadata](../../../references/protocol/transactions/metadata.md) - Summary of the metadata format and fields that appear in metadata + - [Transaction Results](../../../references/protocol/transactions/transaction-results/transaction-results.md) - Tables of all possible result codes for transactions. {% raw-partial file="/docs/_snippets/common-links.md" /%} diff --git a/docs/tutorials/index.md b/docs/tutorials/index.md index a751b277c7..956b37e473 100644 --- a/docs/tutorials/index.md +++ b/docs/tutorials/index.md @@ -9,35 +9,34 @@ The XRP Ledger tutorials walk you through the steps to learn and get started wit ## Get Started with SDKs -These tutorials walk you through the basics of building a very simple XRP Ledger-connected application using SDKs. +These tutorials walk you through the basics of building a very simple XRP Ledger-connected application using your favorite programming language. {% card-grid %} -{% xrpl-card title="Python" body="Using xrpl.py, a pure Python library." href="/docs/tutorials/python/get-started/" image="/img/logos/python.svg" imageAlt="Python logo" /%} +{% xrpl-card title="Javascript" body="Using the xrpl.js client library." href="/docs/tutorials/javascript/" image="/img/logos/javascript.svg" imageAlt="Javascript logo" /%} -{% xrpl-card title="Java" body="Using xrpl4j, a pure Java library." href="/docs/tutorials/java/get-started/" image="/img/logos/java.svg" imageAlt="Java logo" /%} +{% xrpl-card title="Python" body="Using xrpl.py, a pure Python library." href="/docs/tutorials/python/" image="/img/logos/python.svg" imageAlt="Python logo" /%} -{% xrpl-card title="Javascript" body="Using the xrpl.js client library." href="/docs/tutorials/javascript/get-started/" image="/img/logos/javascript.svg" imageAlt="Javascript logo" /%} +
-{% xrpl-card title="PHP" body="Using the XRPL_PHP client library." href="/docs/tutorials/php/get-started/" image="/img/logos/php.svg" imageAlt="PHP logo" /%} +{% xrpl-card title="Java" body="Using xrpl4j, a pure Java library." href="/docs/tutorials/java/" image="/img/logos/java.svg" imageAlt="Java logo" /%} -{% xrpl-card title="HTTP & WebSocket APIs" body="Access the XRP Ledger directly through the APIs of its core server." href="/docs/tutorials/http-websocket-apis/get-started/" image="/img/logos/globe.svg" imageAlt="globe icon" /%} +{% xrpl-card title="PHP" body="Using the XRPL_PHP client library." href="/docs/tutorials/php/" image="/img/logos/php.svg" imageAlt="PHP logo" /%} + +{% xrpl-card title="HTTP & WebSocket APIs" body="Access the XRP Ledger directly through the APIs of its core server." href="/docs/tutorials/http-websocket-apis/" image="/img/logos/globe.svg" imageAlt="globe icon" /%} {% /card-grid %} -## XRP Ledger Use Cases +## How To's + +These examples provide step-by-step instructions for administrative tasks. {% card-grid %} -{% xrpl-card title="Payments" body="Send and receive payments on the XRP Ledger." href="/docs/use-cases/payments/" /%} -{% xrpl-card title="DeFi" body="Decentralized Finance (DeFi) is about enabling fast, secure financial transactions without a central authority." href="/docs/use-cases/defi/" /%} -{% xrpl-card title="Tokens" body="Create and trade fungible and non-fungible tokens on the XRP Ledger." href="/docs/use-cases/tokenization/" /%} -{% /card-grid %} -## Manage XRP Ledger Servers +{% xrpl-card title="Manage Account Settings" body="Set up your XRP Ledger account to send and receive payments the way you want it to." href="/docs/tutorials/how-tos/manage-account-settings/" /%} +{% xrpl-card title="Use Specialized Payment Types" body="Use advanced features like Escrow and Payment Channels to build smart applications on the XRP Ledger." href="/docs/tutorials/how-tos/use-specialized-payment-types/" /%} +{% xrpl-card title="Use Tokens" body="Create and trade tokens (fungible or otherwise) in the XRP Ledger." href="/docs/tutorials/how-tos/use-tokens/" /%} +{% xrpl-card title="Use XRPL Sidechains" body="Bridge XRP and tokens from Mainnet to XRPL sidechains." href="/docs/tutorials/how-tos/use-xrpl-sidechains/" /%} -{% card-grid %} -{% xrpl-card title="Install rippled server" body="Set up the core XRP Ledger server." href="/docs/infrastructure/installation/" /%} -{% xrpl-card title="Configure rippled server" body="Customize your core XRP Ledger server's settings." href="/docs/infrastructure/configuration/" /%} -{% xrpl-card title="Troubleshooting" body="Diagnose and solve issues with XRP Ledger servers and infrastructure." href="/docs/infrastructure/troubleshooting/" /%} -{% xrpl-card title="Install Clio server" body="Set up the Clio server for efficiently querying XRP Ledger data." href="/docs/infrastructure/installation/install-clio-on-ubuntu" /%} -{% /card-grid %} + +{% /card-grid %} \ No newline at end of file diff --git a/docs/tutorials/java/get-started.md b/docs/tutorials/java/build-apps/get-started.md similarity index 71% rename from docs/tutorials/java/get-started.md rename to docs/tutorials/java/build-apps/get-started.md index ce57a113db..26237bbb2c 100644 --- a/docs/tutorials/java/get-started.md +++ b/docs/tutorials/java/build-apps/get-started.md @@ -1,5 +1,5 @@ --- -html: get-started-using-java.html +html: get-started-using-java-library.html parent: java.html funnel: Build doc_type: Tutorials @@ -13,7 +13,7 @@ labels: - Development showcase_icon: assets/img/logos/java.svg --- -# Get Started Using Java +# Get Started Using Java Library This tutorial walks you through the basics of building an XRP Ledger-connected application using [`xrpl4j`](https://github.com/XRPLF/xrpl4j), a pure Java library built to interact with the XRP Ledger. @@ -77,7 +77,7 @@ Check out the [xrpl4j sample project](https://github.com/XRPLF/xrpl4j-sample) fo ## Start Building -When you're working with the XRP Ledger, there are a few things you'll need to manage, whether you're adding XRP to your [account](../../concepts/accounts/index.md), integrating with the [decentralized exchange](../../concepts/tokens/decentralized-exchange/index.md), or [issuing tokens](../../concepts/tokens/index.md). This tutorial walks you through basic patterns common to getting started with all of these use cases and provides sample code for implementing them. +When you're working with the XRP Ledger, there are a few things you'll need to manage, whether you're adding XRP to your [account](../../../concepts/accounts/index.md), integrating with the [decentralized exchange](../../../concepts/tokens/decentralized-exchange/index.md), or [issuing tokens](../../../concepts/tokens/index.md). This tutorial walks you through basic patterns common to getting started with all of these use cases and provides sample code for implementing them. Here are the basic steps you'll need to cover for almost any XRP Ledger project: @@ -95,9 +95,9 @@ you can use an [`XrplClient`](https://javadoc.io/doc/org.xrpl/xrpl4j-client/3.0. #### Connect to the production XRP Ledger -The sample code in the previous section shows you how to connect to the Testnet, which is one of the available [parallel networks](../../concepts/networks-and-servers/parallel-networks.md). When you're ready to integrate with the production XRP Ledger, you'll need to connect to the Mainnet. You can do that in two ways: +The sample code in the previous section shows you how to connect to the Testnet, which is one of the available [parallel networks](../../../concepts/networks-and-servers/parallel-networks.md). When you're ready to integrate with the production XRP Ledger, you'll need to connect to the Mainnet. You can do that in two ways: -* By [installing the core server](../../infrastructure/installation/index.md) (`rippled`) and running a node yourself. The core server connects to the Mainnet by default, but you can [change the configuration to use Testnet or Devnet](../../infrastructure/configuration/connect-your-rippled-to-the-xrp-test-net.md). [There are good reasons to run your own core server](../../concepts/networks-and-servers/index.md#reasons-to-run-your-own-server). If you run your own server, you can connect to it like so: +* By [installing the core server](../../../infrastructure/installation/index.md) (`rippled`) and running a node yourself. The core server connects to the Mainnet by default, but you can [change the configuration to use Testnet or Devnet](../../../infrastructure/configuration/connect-your-rippled-to-the-xrp-test-net.md). [There are good reasons to run your own core server](../../../concepts/networks-and-servers/index.md#reasons-to-run-your-own-server). If you run your own server, you can connect to it like so: ``` final HttpUrl rippledUrl = HttpUrl.get("http://localhost:5005/"); @@ -115,7 +115,7 @@ The sample code in the previous section shows you how to connect to the Testnet, ### 2. Get account -To store value and execute transactions on the XRP Ledger, you need to get an account: a [set of keys](../../concepts/accounts/cryptographic-keys.md#key-components) and an [address](../../concepts/accounts/addresses.md) that's been [funded with enough XRP](../../concepts/accounts/index.md#creating-accounts) to meet the [account reserve](../../concepts/accounts/reserves.md). The address is the identifier of your account and you use the [private key](../../concepts/accounts/cryptographic-keys.md#private-key) to sign transactions that you submit to the XRP Ledger. For production purposes, you should take care to store your keys and set up a [secure signing method](../../concepts/transactions/secure-signing.md). +To store value and execute transactions on the XRP Ledger, you need to get an account: a [set of keys](../../../concepts/accounts/cryptographic-keys.md#key-components) and an [address](../../../concepts/accounts/addresses.md) that's been [funded with enough XRP](../../../concepts/accounts/index.md#creating-accounts) to meet the [account reserve](../../../concepts/accounts/reserves.md). The address is the identifier of your account and you use the [private key](../../../concepts/accounts/cryptographic-keys.md#private-key) to sign transactions that you submit to the XRP Ledger. For production purposes, you should take care to store your keys and set up a [secure signing method](../../../concepts/transactions/secure-signing.md). To generate a new account, `xrpl4j` provides the [`DefaultWalletFactory`](https://javadoc.io/doc/org.xrpl/xrpl4j-keypairs/latest/org/xrpl/xrpl4j/wallet/DefaultWalletFactory.html). @@ -137,13 +137,13 @@ Wallet { } ``` -For testing and development purposes, you can use a `FaucetClient` connected to the XRP Ledger [Testnet](../../concepts/networks-and-servers/parallel-networks.md): +For testing and development purposes, you can use a `FaucetClient` connected to the XRP Ledger [Testnet](../../../concepts/networks-and-servers/parallel-networks.md): {% code-snippet file="/_code-samples/get-started/java/GetAccountInfo.java" from="// Fund the account using the testnet Faucet" before="// Look up your Account Info" language="java" /%} ### 3. Query the XRP Ledger -You can query the XRP Ledger to get information about [a specific account](../../references/http-websocket-apis/public-api-methods/account-methods/index.md), [a specific transaction](../../references/http-websocket-apis/public-api-methods/transaction-methods/tx.md), the state of a [current or a historical ledger](../../references/http-websocket-apis/public-api-methods/ledger-methods/index.md), and [the XRP Ledger's decentralized exchange](../../references/http-websocket-apis/public-api-methods/path-and-order-book-methods/index.md). You need to make these queries, among other reasons, to look up account info to follow best practices for [reliable transaction submission](../../concepts/transactions/reliable-transaction-submission.md). +You can query the XRP Ledger to get information about [a specific account](../../../references/http-websocket-apis/public-api-methods/account-methods/index.md), [a specific transaction](../../../references/http-websocket-apis/public-api-methods/transaction-methods/tx.md), the state of a [current or a historical ledger](../../../references/http-websocket-apis/public-api-methods/ledger-methods/index.md), and [the XRP Ledger's decentralized exchange](../../../references/http-websocket-apis/public-api-methods/path-and-order-book-methods/index.md). You need to make these queries, among other reasons, to look up account info to follow best practices for [reliable transaction submission](../../../concepts/transactions/reliable-transaction-submission.md). Here, we'll use the [`XrplClient` we constructed](#1-connect-to-the-xrp-ledger) to look up information about the [account we got](#2-get-account) in the previous step. @@ -211,18 +211,18 @@ The response fields contained in `AccountInfoResult` that you want to inspect in * `accountData.sequence` — This is the sequence number of the next valid transaction for the account. You need to specify the sequence number when you prepare transactions. -* `accountData.balance` — This is the account's balance of XRP, in drops. You can use this to confirm that you have enough XRP to send (if you're making a payment) and to meet the [current transaction cost](../../concepts/transactions/transaction-cost.md#current-transaction-cost) for a given transaction. +* `accountData.balance` — This is the account's balance of XRP, in drops. You can use this to confirm that you have enough XRP to send (if you're making a payment) and to meet the [current transaction cost](../../../concepts/transactions/transaction-cost.md#current-transaction-cost) for a given transaction. -* `validated` — Indicates whether the returned data is from a [validated ledger](../../concepts/ledgers/open-closed-validated-ledgers.md). When inspecting transactions, it's important to confirm that [the results are final](../../concepts/transactions/finality-of-results/index.md) before further processing the transaction. If `validated` is `true` then you know for sure the results won't change. For more information about best practices for transaction processing, see [Reliable Transaction Submission](../../concepts/transactions/reliable-transaction-submission.md). +* `validated` — Indicates whether the returned data is from a [validated ledger](../../../concepts/ledgers/open-closed-validated-ledgers.md). When inspecting transactions, it's important to confirm that [the results are final](../../../concepts/transactions/finality-of-results/index.md) before further processing the transaction. If `validated` is `true` then you know for sure the results won't change. For more information about best practices for transaction processing, see [Reliable Transaction Submission](../../../concepts/transactions/reliable-transaction-submission.md). -For a detailed description of every response field, see [account_info](../../references/http-websocket-apis/public-api-methods/account-methods/account_info.md#response-format). +For a detailed description of every response field, see [account_info](../../../references/http-websocket-apis/public-api-methods/account-methods/account_info.md#response-format). ## Keep on building Now that you know how to use `xrpl4j` to connect to the XRP Ledger, get an account, and look up information about it, you can also use `xrpl4j` to: -* [Send XRP](../tasks/send-xrp.md). -* [Set up secure signing](../../concepts/transactions/secure-signing.md) for your account. +* [Send XRP](../../how-tos/send-xrp.md). +* [Set up secure signing](../../../concepts/transactions/secure-signing.md) for your account. {% raw-partial file="/docs/_snippets/common-links.md" /%} diff --git a/docs/tutorials/java/build-apps/index.md b/docs/tutorials/java/build-apps/index.md new file mode 100644 index 0000000000..7674e9fae5 --- /dev/null +++ b/docs/tutorials/java/build-apps/index.md @@ -0,0 +1,13 @@ +--- +html: build-apps-with-java.html +parent: java.html +top_nav_grouping: Article Types +metadata: + indexPage: true +--- +# Build Applications with Java Library + +Build full-featured applications in Java. + + +{% child-pages /%} diff --git a/docs/tutorials/java/index.md b/docs/tutorials/java/index.md index 014d7b435c..3da7309c83 100644 --- a/docs/tutorials/java/index.md +++ b/docs/tutorials/java/index.md @@ -7,7 +7,17 @@ metadata: --- # Java -XRPL tutorials in Java. +You can create your own interface to try out the capabilities and support your specific business needs. These tutorials build a test harness interface to try out features of the XRP Ledger. The harness displays multiple accounts, so that you can transfer tokens from one account to the other and see the results in real time. +Typically, the example functions involve four steps. -{% child-pages /%} +- Connect to the XRP Ledger and instantiate your wallet. +- Make changes to the XRP Ledger using transactions. +- Get the state of accounts and tokens on the XRP Ledger using requests. +- Disconnect from the XRP Ledger. + +Once familiar with the library functions, you can build sample applications in Java. We anticipate that the applications you build greatly improve upon these examples. Your feedback and contributions are most welcome. + +## Tutorial Modules + +{% child-pages /%} \ No newline at end of file diff --git a/docs/tutorials/javascript/build-a-browser-wallet-in-javascript.md b/docs/tutorials/javascript/build-apps/build-a-browser-wallet-in-javascript.md similarity index 81% rename from docs/tutorials/javascript/build-a-browser-wallet-in-javascript.md rename to docs/tutorials/javascript/build-apps/build-a-browser-wallet-in-javascript.md index 1687a75abd..87ff40aeff 100644 --- a/docs/tutorials/javascript/build-a-browser-wallet-in-javascript.md +++ b/docs/tutorials/javascript/build-apps/build-a-browser-wallet-in-javascript.md @@ -18,7 +18,7 @@ To complete this tutorial, you should meet the following guidelines: 1. You have [Node.js](https://nodejs.org/en/download/) v14 or higher installed. 2. You have [Yarn](https://yarnpkg.com/en/docs/install) (v1.17.3 or higher) installed. -3. You are somewhat familiar with coding with JavaScript and have completed the [Get Started Using JavaScript](../javascript/get-started.md) tutorial. +3. You are somewhat familiar with coding with JavaScript and have completed the [Get Started Using JavaScript](./get-started.md) tutorial. ## Source Code @@ -34,8 +34,8 @@ This application can: - Show updates to the XRP Ledger in real-time. - View any XRP Ledger account's activity, including showing how much XRP was delivered by each transaction. -- Show how much XRP is set aside for the account's [reserve requirement](../../concepts/accounts/reserves.md). -- Send [direct XRP payments](../../concepts/payment-types/direct-xrp-payments.md), and provide feedback about the intended destination address, including: +- Show how much XRP is set aside for the account's [reserve requirement](../../../concepts/accounts/reserves.md). +- Send [direct XRP payments](../../../concepts/payment-types/direct-xrp-payments.md), and provide feedback about the intended destination address, including: - Displaying your account's available balance - Verifying that the destination address is valid - Validating the account has enough XRP to send @@ -116,11 +116,11 @@ This basic setup creates a homepage and applies some visual styles. The goal is To make that happen, we need to connect to the XRP Ledger and look up the account and the latest validated ledger. -5. In the `src/` directory, make a new folder named `helpers`. Create a new file there named `get-wallet-details.js` and define a function named `getWalletDetails` there. This function uses the [account_info method](../../references/http-websocket-apis/public-api-methods/account-methods/account_info.md) to fetch account details and the [server_info method](../../references/http-websocket-apis/public-api-methods/server-info-methods/server_info.md) to calculate the current [reserves](../../concepts/accounts/reserves.md). The code to do all this is as follows: +5. In the `src/` directory, make a new folder named `helpers`. Create a new file there named `get-wallet-details.js` and define a function named `getWalletDetails` there. This function uses the [account_info method](../../../references/http-websocket-apis/public-api-methods/account-methods/account_info.md) to fetch account details and the [server_info method](../../../references/http-websocket-apis/public-api-methods/server-info-methods/server_info.md) to calculate the current [reserves](../../../concepts/accounts/reserves.md). The code to do all this is as follows: {% code-snippet file="/_code-samples/build-a-browser-wallet/js/src/helpers/get-wallet-details.js" language="js" /%} -6. Now, let's add the code to `index.js` file to fetch the account and ledger details and display them on the home page. Copy the code written below to the `index.js` file. Here we render the wallet details using the function we defined in `get-wallet-details.js`. In order to make sure we have up to date ledger data, we are using the [ledger stream](../../references/http-websocket-apis/public-api-methods/subscription-methods/subscribe.md#ledger-stream) to listen for ledger close events. +6. Now, let's add the code to `index.js` file to fetch the account and ledger details and display them on the home page. Copy the code written below to the `index.js` file. Here we render the wallet details using the function we defined in `get-wallet-details.js`. In order to make sure we have up to date ledger data, we are using the [ledger stream](../../../references/http-websocket-apis/public-api-methods/subscription-methods/subscribe.md#ledger-stream) to listen for ledger close events. {% code-snippet file="/_code-samples/build-a-browser-wallet/js/index.js" language="js" /%} @@ -152,7 +152,7 @@ Now that we've created the home page, we can move on to the "Send XRP" page. Thi 3. Copy the contents of the {% repo-link path="_code-samples/build-a-browser-wallet/js/src/send-xrp/send-xrp.html" %}send-xrp.html{% /repo-link %} file to your `send-xrp.html` file. The provided HTML code includes three input fields for the destination address, amount, and destination tag, each with their corresponding labels. -4. Now that we have the HTML code, let's add the JavaScript code. In the `helpers` folder, create a new file named `submit-transaction.js` and copy the code written below to the file. In this file, we are using the [submit](../../references/http-websocket-apis/public-api-methods/transaction-methods/submit.md) method to submit the transaction to the XRPL. Before submitting every transaction needs to be signed by a wallet, learn more about [signing](../../references/http-websocket-apis/admin-api-methods/signing-methods/sign.md) a transaction. +4. Now that we have the HTML code, let's add the JavaScript code. In the `helpers` folder, create a new file named `submit-transaction.js` and copy the code written below to the file. In this file, we are using the [submit](../../../references/http-websocket-apis/public-api-methods/transaction-methods/submit.md) method to submit the transaction to the XRPL. Before submitting every transaction needs to be signed by a wallet, learn more about [signing](../../../references/http-websocket-apis/admin-api-methods/signing-methods/sign.md) a transaction. {% code-snippet file="/_code-samples/build-a-browser-wallet/js/src/helpers/submit-transaction.js" language="js" /%} @@ -181,7 +181,7 @@ Now that we have created the home page and the send XRP page, let's create the t - Delivered amount: The amount of XRP or tokens delivered by the transaction, if applicable. - Link: A link to the transaction on the XRP Ledger Explorer. -**Caution:** When displaying how much money a transaction delivered, always use the `delivered_amount` field from the metadata, not the `Amount` field from the transaction instructions. [Partial Payments](../../concepts/payment-types/partial-payments.md) can deliver much less than the stated `Amount` and still be successful. +**Caution:** When displaying how much money a transaction delivered, always use the `delivered_amount` field from the metadata, not the `Amount` field from the transaction instructions. [Partial Payments](../../../concepts/payment-types/partial-payments.md) can deliver much less than the stated `Amount` and still be successful. ![Transactions Page Screenshot](/docs/img/js-wallet-transaction.png) @@ -190,23 +190,23 @@ Now that we have created the home page and the send XRP page, let's create the t {% code-snippet file="/_code-samples/build-a-browser-wallet/js/src/transaction-history/transaction-history.js" language="js" /%} -This code uses [account_tx](../../references/http-websocket-apis/public-api-methods/account-methods/account_tx.md) to fetch transactions we've sent to and from this account. In order to get all the results, we're using the `marker` parameter to paginate through the incomplete list of transactions until we reach the end. +This code uses [account_tx](../../../references/http-websocket-apis/public-api-methods/account-methods/account_tx.md) to fetch transactions we've sent to and from this account. In order to get all the results, we're using the `marker` parameter to paginate through the incomplete list of transactions until we reach the end. 3. Create a file named `transaction-history.html` and copy the code from {% repo-link path="_code-samples/build-a-browser-wallet/js/src/transaction-history/transaction-history.html" %}transaction-history.html{% /repo-link %} into it. `transaction-history.html` defines a table which displays the fields mentioned above. -You can use this code as a starting point for displaying your account's transaction history. If you want an additional challenge, try expanding it to support different transaction types (e.g. [TrustSet](../../references/protocol/transactions/types/trustset.md)). If you want inspiration for how to handle this, you can check out the [XRP Ledger Explorer](https://livenet.xrpl.org/) to see how the transaction details are displayed. +You can use this code as a starting point for displaying your account's transaction history. If you want an additional challenge, try expanding it to support different transaction types (e.g. [TrustSet](../../../references/protocol/transactions/types/trustset.md)). If you want inspiration for how to handle this, you can check out the [XRP Ledger Explorer](https://livenet.xrpl.org/) to see how the transaction details are displayed. ## Next Steps Now that you have a functional wallet, you can take it in several new directions. The following are a few ideas: -- You could support more of the XRP Ledger's [transaction types](../../references/protocol/transactions/types/index.md) including [tokens](../../concepts/tokens/index.md) and [cross-currency payments](../../concepts/payment-types/cross-currency-payments.md) +- You could support more of the XRP Ledger's [transaction types](../../../references/protocol/transactions/types/index.md) including [tokens](../../../concepts/tokens/index.md) and [cross-currency payments](../../../concepts/payment-types/cross-currency-payments.md) - You could add support for displaying multiple tokens, beyond just XRP -- You could support creating [offers](../../concepts/tokens/decentralized-exchange/offers.md) in the [decentralized exchange](../../concepts/tokens/decentralized-exchange/index.md) +- You could support creating [offers](../../../concepts/tokens/decentralized-exchange/offers.md) in the [decentralized exchange](../../../concepts/tokens/decentralized-exchange/index.md) - You could add new ways to request payments, such as with QR codes or URIs that open in your wallet. -- You could support better account security including allowing users to set [regular key pairs](../../concepts/accounts/cryptographic-keys.md#regular-key-pair) or handle [multi-signing](../../concepts/accounts/multi-signing.md). +- You could support better account security including allowing users to set [regular key pairs](../../../concepts/accounts/cryptographic-keys.md#regular-key-pair) or handle [multi-signing](../../../concepts/accounts/multi-signing.md). - Or you could take your code to production by following the [Building for Production with Vite](https://vitejs.dev/guide/build.html#public-base-path) guide. {% raw-partial file="/docs/_snippets/common-links.md" /%} diff --git a/docs/tutorials/javascript/build-a-desktop-wallet-in-javascript.md b/docs/tutorials/javascript/build-apps/build-a-desktop-wallet-in-javascript.md similarity index 98% rename from docs/tutorials/javascript/build-a-desktop-wallet-in-javascript.md rename to docs/tutorials/javascript/build-apps/build-a-desktop-wallet-in-javascript.md index 01e7418795..4993780cb1 100644 --- a/docs/tutorials/javascript/build-a-desktop-wallet-in-javascript.md +++ b/docs/tutorials/javascript/build-apps/build-a-desktop-wallet-in-javascript.md @@ -14,7 +14,7 @@ This tutorial demonstrates how to build a desktop wallet for the XRP Ledger usin To complete this tutorial, you should meet the following requirements: - You have [Node.js](https://nodejs.org/) 14+ installed. -- You are somewhat familiar with modern JavaScript programming and have completed the [Get Started Using JavaScript tutorial](../javascript/get-started.md). +- You are somewhat familiar with modern JavaScript programming and have completed the [Get Started Using JavaScript tutorial](./get-started.md). - You have some understanding of the XRP Ledger, its capabilities, and of cryptocurrency in general. Ideally you have completed the [Basic XRPL guide](https://learn.xrpl.org/). ### Source Code @@ -42,13 +42,13 @@ The application we are going to build here will be capable of the following: - Showing updates to the XRP Ledger in real-time. - Viewing any XRP Ledger account's activity "read-only" including showing how much XRP was delivered by each transaction. -- Sending [direct XRP payments](../../concepts/payment-types/direct-xrp-payments.md), and providing feedback about the intended destination address, including: +- Sending [direct XRP payments](../../../concepts/payment-types/direct-xrp-payments.md), and providing feedback about the intended destination address, including: - Whether the intended destination already exists in the XRP Ledger, or the payment would have to fund its creation. - If the address doesn't want to receive XRP (**Disallow XRP** flag enabled). - - If the address has a [verified domain name](../../references/xrp-ledger-toml.md#account-verification) associated with it. + - If the address has a [verified domain name](../../../references/xrp-ledger-toml.md#account-verification) associated with it. -The application in this tutorial _doesn't_ have the ability to send or trade [tokens](../../concepts/tokens/index.md) or -use other [payment types](../../concepts/payment-types/index.md) like [Escrow](https://xrpl.org/escrow.html) or [Payment Channels](https://xrpl.org/payment-channels.html). However, it provides a foundation +The application in this tutorial _doesn't_ have the ability to send or trade [tokens](../../../concepts/tokens/index.md) or +use other [payment types](../../../concepts/payment-types/index.md) like [Escrow](https://xrpl.org/escrow.html) or [Payment Channels](https://xrpl.org/payment-channels.html). However, it provides a foundation that you can implement those and other features on top of. In addition to the above features, you'll also learn a bit about Events, IPC (inter-process-communication) and asynchronous (async) code in JavaScript. @@ -225,7 +225,7 @@ const getValidatedLedgerIndex = async () => { const createWindow = () => { ``` -This helper function does the following: It establishes a WebSocket connection to the XRP Ledger, calls the XRP Ledger API's [ledger method](../../references/http-websocket-apis/public-api-methods/ledger-methods/ledger.md) and returns the ledger index from the response. We will wire up this function at the end of this step. +This helper function does the following: It establishes a WebSocket connection to the XRP Ledger, calls the XRP Ledger API's [ledger method](../../../references/http-websocket-apis/public-api-methods/ledger-methods/ledger.md) and returns the ledger index from the response. We will wire up this function at the end of this step. 2. In order to attach a preloader script, modify the `createWindow` method in `index.js` by adding the following code: @@ -1394,7 +1394,7 @@ One of the biggest shortcomings of the wallet app from the previous step is that This step shows how to add some checks on destination addresses to warn the user before sending XRP. -One type of check we could make is to verify the domain name associated with an XRP Ledger address; this is called [account domain verification](../../references/xrp-ledger-toml.md#account-verification). When an account's domain is verified, we can could show it like this: +One type of check we could make is to verify the domain name associated with an XRP Ledger address; this is called [account domain verification](../../../references/xrp-ledger-toml.md#account-verification). When an account's domain is verified, we can could show it like this: ![Screenshot: Step 8, use domain verification](/docs/img/javascript-wallet-8.png) @@ -1402,9 +1402,9 @@ One type of check we could make is to verify the domain name associated with an {% code-snippet file="/_code-samples/build-a-desktop-wallet/js/library/8_helpers.js" language="js" /%} -The code in `8_helpers.js` looks up the account on the ledger by sending an [`account_info`](../../references/http-websocket-apis/public-api-methods/account-methods/account_info.md) request. +The code in `8_helpers.js` looks up the account on the ledger by sending an [`account_info`](../../../references/http-websocket-apis/public-api-methods/account-methods/account_info.md) request. -If the account does exist, the code checks for the [`lsfDisallowXRP` flag](../../references/protocol/ledger-data/ledger-entry-types/accountroot.md#accountroot-flags). +If the account does exist, the code checks for the [`lsfDisallowXRP` flag](../../../references/protocol/ledger-data/ledger-entry-types/accountroot.md#accountroot-flags). 2. Import the new helper function in `index.js`: diff --git a/docs/tutorials/javascript/get-started.md b/docs/tutorials/javascript/build-apps/get-started.md similarity index 71% rename from docs/tutorials/javascript/get-started.md rename to docs/tutorials/javascript/build-apps/get-started.md index b995361ea2..e03c5074db 100644 --- a/docs/tutorials/javascript/get-started.md +++ b/docs/tutorials/javascript/build-apps/get-started.md @@ -1,5 +1,5 @@ --- -html: get-started-using-javascript.html +html: get-started-using-javascript-library.html parent: javascript.html seo: description: Build an entry-level JavaScript application for querying the XRP Ledger. @@ -9,7 +9,7 @@ labels: - Development showcase_icon: assets/img/logos/javascript.svg --- -# Get Started Using JavaScript +# Get Started Using JavaScript Library This tutorial guides you through the basics of building an XRP Ledger-connected application in JavaScript or TypeScript using the [`xrpl.js`](https://github.com/XRPLF/xrpl.js/) client library in either Node.js or web browsers. @@ -43,7 +43,7 @@ npm install xrpl ## Start Building -When you're working with the XRP Ledger, there are a few things you'll need to manage, whether you're adding XRP to your [account](../../concepts/accounts/index.md), integrating with the [decentralized exchange](../../concepts/tokens/decentralized-exchange/index.md), or [issuing tokens](../../concepts/tokens/index.md). This tutorial walks you through basic patterns common to getting started with all of these use cases and provides sample code for implementing them. +When you're working with the XRP Ledger, there are a few things you'll need to manage, whether you're adding XRP to your [account](../../../concepts/accounts/index.md), integrating with the [decentralized exchange](../../../concepts/tokens/decentralized-exchange/index.md), or [issuing tokens](../../../concepts/tokens/index.md). This tutorial walks you through basic patterns common to getting started with all of these use cases and provides sample code for implementing them. Here are some steps you use in many XRP Ledger projects: @@ -94,9 +94,9 @@ To make queries and submit transactions, you need to connect to the XRP Ledger. #### Connect to the XRP Ledger Mainnet -The sample code in the previous section shows you how to connect to the Testnet, which is one of the available [parallel networks](../../concepts/networks-and-servers/parallel-networks.md). When you're ready to move to production, you'll need to connect to the XRP Ledger Mainnet. You can do that in two ways: +The sample code in the previous section shows you how to connect to the Testnet, which is one of the available [parallel networks](../../../concepts/networks-and-servers/parallel-networks.md). When you're ready to move to production, you'll need to connect to the XRP Ledger Mainnet. You can do that in two ways: -* By [installing the core server](../../infrastructure/installation/index.md) (`rippled`) and running a node yourself. The core server connects to the Mainnet by default, but you can [change the configuration to use Testnet or Devnet](../../infrastructure/configuration/connect-your-rippled-to-the-xrp-test-net.md). [There are good reasons to run your own core server](../../concepts/networks-and-servers/index.md#reasons-to-run-your-own-server). If you run your own server, you can connect to it like so: +* By [installing the core server](../../../infrastructure/installation/index.md) (`rippled`) and running a node yourself. The core server connects to the Mainnet by default, but you can [change the configuration to use Testnet or Devnet](../../../infrastructure/configuration/connect-your-rippled-to-the-xrp-test-net.md). [There are good reasons to run your own core server](../../../concepts/networks-and-servers/index.md#reasons-to-run-your-own-server). If you run your own server, you can connect to it like so: ``` const MY_SERVER = "ws://localhost:6006/" @@ -135,14 +135,14 @@ const test_wallet = xrpl.Wallet.fromSeed("sn3nxiW7v8KXzPzAqzyHXbSSKNuN9") // Tes ### 4. Query the XRP Ledger -Use the Client's `request()` method to access the XRP Ledger's [WebSocket API](../../references/http-websocket-apis/api-conventions/request-formatting.md). For example: +Use the Client's `request()` method to access the XRP Ledger's [WebSocket API](../../../references/http-websocket-apis/api-conventions/request-formatting.md). For example: {% code-snippet file="/_code-samples/get-started/js/get-acct-info.js" from="// Get info" before="// Listen to ledger close events" language="js" /%} ### 5. Listen for Events -You can set up handlers for various types of events in `xrpl.js`, such as whenever the XRP Ledger's [consensus process](../../concepts/consensus-protocol/index.md) produces a new [ledger version](../../concepts/ledgers/index.md). To do that, first call the [subscribe method][] to get the type of events you want, then attach an event handler using the `on(eventType, callback)` method of the client. +You can set up handlers for various types of events in `xrpl.js`, such as whenever the XRP Ledger's [consensus process](../../../concepts/consensus-protocol/index.md) produces a new [ledger version](../../../concepts/ledgers/index.md). To do that, first call the [subscribe method][] to get the type of events you want, then attach an event handler using the `on(eventType, callback)` method of the client. {% code-snippet file="/_code-samples/get-started/js/get-acct-info.js" from="// Listen to ledger close events" before="// Disconnect when done" language="js" /%} @@ -151,23 +151,23 @@ You can set up handlers for various types of events in `xrpl.js`, such as whenev Now that you know how to use `xrpl.js` to connect to the XRP Ledger, get an account, and look up information about it, you can also: -* [Send XRP](../tasks/send-xrp.md). -* [Issue a Fungible Token](../tasks/use-tokens/issue-a-fungible-token.md) -* [Set up secure signing](../../concepts/transactions/secure-signing.md) for your account. +* [Send XRP](../../how-tos/send-xrp.md). +* [Issue a Fungible Token](../../how-tos/use-tokens/issue-a-fungible-token.md) +* [Set up secure signing](../../../concepts/transactions/secure-signing.md) for your account. ## See Also - **Concepts:** - [XRP Ledger Overview](/about/) - - [Client Libraries](../../references/client-libraries.md) + - [Client Libraries](../../../references/client-libraries.md) - **Tutorials:** - - [Send XRP](../tasks/send-xrp.md) + - [Send XRP](../../how-tos/send-xrp.md) - **References:** - [`xrpl.js` Reference](https://js.xrpl.org/) - - [Public API Methods](../../references/http-websocket-apis/public-api-methods/index.md) - - [API Conventions](../../references/http-websocket-apis/api-conventions/index.md) - - [base58 Encodings](../../references/protocol/data-types/base58-encodings.md) - - [Transaction Formats](../../references/protocol/transactions/index.md) + - [Public API Methods](../../../references/http-websocket-apis/public-api-methods/index.md) + - [API Conventions](../../../references/http-websocket-apis/api-conventions/index.md) + - [base58 Encodings](../../../references/protocol/data-types/base58-encodings.md) + - [Transaction Formats](../../../references/protocol/transactions/index.md) {% raw-partial file="/docs/_snippets/common-links.md" /%} diff --git a/docs/tutorials/javascript/build-apps/index.md b/docs/tutorials/javascript/build-apps/index.md new file mode 100644 index 0000000000..5a333ced3f --- /dev/null +++ b/docs/tutorials/javascript/build-apps/index.md @@ -0,0 +1,13 @@ +--- +html: build-apps-with-javascript.html +parent: javascript.html +top_nav_grouping: Article Types +metadata: + indexPage: true +--- +# Build Applications with JavaScript Library + +Build full-featured applications in JavaScript. + + +{% child-pages /%} diff --git a/docs/tutorials/javascript/index.md b/docs/tutorials/javascript/index.md index 555a583973..d2b871fef2 100644 --- a/docs/tutorials/javascript/index.md +++ b/docs/tutorials/javascript/index.md @@ -7,7 +7,28 @@ metadata: --- # JavaScript -XRPL tutorials in JavaScript. +You can create your own interface to try out the capabilities and support your specific business needs. These tutorials build a test harness interface to try out features of the XRP Ledger. The harness displays multiple accounts, so that you can transfer tokens from one account to the other and see the results in real time. +Typically, the example functions involve four steps. -{% child-pages /%} +- Connect to the XRP Ledger and instantiate your wallet. +- Make changes to the XRP Ledger using transactions. +- Get the state of accounts and tokens on the XRP Ledger using requests. +- Disconnect from the XRP Ledger. + +Each lesson builds the Token Test Harness one section at a time, with complete JavaScript and HTML code samples and a code walkthrough. You can download the source code, manipulate it in a text editor, and run it in your favorite browser. + +Much of this is “brute force” code that sacrifices conciseness for readability. Each example builds on the previous examples, adding a new JavaScript file and the supporting HTML UI. + +Once familiar with the library functions, you can build sample applications in JavaScript. We anticipate that the applications you build greatly improve upon these examples. Your feedback and contributions are most welcome. + +To get started: +- create a new folder on your local disk and install the JavaScript library using npm. + + `npm install xrpl` + +- Clone or download the [Sample modules](https://github.com/XRPLF/xrpl-dev-portal/tree/master/_code-samples/quickstart/js/). + +## Tutorial Modules + +{% child-pages /%} \ No newline at end of file diff --git a/docs/tutorials/javascript/modular-tutorials/index.md b/docs/tutorials/javascript/modular-tutorials/index.md deleted file mode 100644 index d46e8e7cf5..0000000000 --- a/docs/tutorials/javascript/modular-tutorials/index.md +++ /dev/null @@ -1,13 +0,0 @@ ---- -html: modular-tutorials-in-javascript.html -parent: javascript.html -top_nav_grouping: Article Types -metadata: - indexPage: true ---- -# Modular Tutorials in JavaScript - -Modular XRPL tutorials in JavaScript. - - -{% child-pages /%} diff --git a/docs/tutorials/javascript/modular-tutorials/send-payments/index.md b/docs/tutorials/javascript/modular-tutorials/send-payments/index.md deleted file mode 100644 index 92001f5272..0000000000 --- a/docs/tutorials/javascript/modular-tutorials/send-payments/index.md +++ /dev/null @@ -1,46 +0,0 @@ ---- -html: send-payments-using-javascript.html -parent: modular-tutorials-in-javascript.html -seo: - description: Use a JavaScript test harness to send XRP, trade currencies, and mint and trade NFTs. -labels: - - Accounts - - Cross-Currency - - Non-fungible Tokens, NFTs - - Payments - - Quickstart - - Tokens - - XRP ---- -# Send Payments Using JavaScript - -The XRP Ledger (XRPL) is a robust, secure, customizable service. You can create your own interface to try out the capabilities and support your specific business needs. - -This quickstart describes a test harness interface you can build to try out the XRP Ledger. The test harness displays multiple accounts, so that you can transfer tokens from one account to the other and see the results in real time. The image below shows the Token Test Harness at the completion of step 4. - -![Quickstart Tutorial Window](/docs/img/quickstart1.png) - -That is a lot of fields and buttons, all working together to perform some significant practical tasks. But getting _started_ with the XRP Ledger is not that complicated. When you eat the elephant a bite at a time, none of the tasks are difficult to consume. - -Typically, the example functions for interacting with the XRP Ledger involve four steps. - -1. Connect to the XRP Ledger and instantiate your wallet. -2. Make changes to the XRP Ledger using transactions. -3. Get the state of accounts and tokens on the XRP Ledger using requests. -4. Disconnect from the XRP Ledger. - -Each lesson shows you how to build the Token Test Harness one section at a time. Each module lets you try out meaningful interactions with the test ledger, with complete JavaScript and HTML code samples and a code walkthrough. There is also a link to the complete source code for each section that can be modified with a text editor and run in a browser. If you cannot wait, you can follow the prerequisites below, then jump to lesson 4, [Create Conditional Escrows](create-conditional-escrows.md), and try out the complete test harness right away. - -This quickstart tutorial introduces you to the API used to implement features and explore the capabilities of XRP Ledger. It does not represent *all* of the capabilities of the API and this example is not intended for production or secure payment use. - -Much of this is “brute force” code that sacrifices conciseness for readability. Each example builds on the previous examples, adding a new JavaScript file and the supporting UI. We anticipate that the applications you build greatly improve upon these examples. Your feedback and contributions are most welcome. - -## Prerequisites - -To get started, create a new folder on your local disk and install the JavaScript library using `npm`. - -``` -npm install xrpl -``` - -Download and expand the [Quickstart Samples](https://github.com/XRPLF/xrpl-dev-portal/tree/master/_code-samples/quickstart/js/). diff --git a/docs/tutorials/javascript/modular-tutorials/nfts/assign-an-authorized-minter.md b/docs/tutorials/javascript/nfts/assign-an-authorized-minter.md similarity index 99% rename from docs/tutorials/javascript/modular-tutorials/nfts/assign-an-authorized-minter.md rename to docs/tutorials/javascript/nfts/assign-an-authorized-minter.md index 5abbda0375..7c4153d4c5 100644 --- a/docs/tutorials/javascript/modular-tutorials/nfts/assign-an-authorized-minter.md +++ b/docs/tutorials/javascript/nfts/assign-an-authorized-minter.md @@ -48,7 +48,7 @@ To authorize another account to create NFTs for your account: ## Mint an NFT for Another Account
- +
This example uses the Operational account, which was authorized in the previous step, to mint a token on behalf of the Standby account. @@ -209,7 +209,7 @@ Report success standbyResultField.value = results ``` -This transaction blob is the same as the one used for the previous [`mintToken()` function](mint-and-burn-nfts.md#mint-token), with the addition of the `Issuer` field. +This transaction blob is the same as the one used for the previous [`mintToken()` function](./mint-and-burn-nfts.md#mint-token), with the addition of the `Issuer` field. ```javascript const tx_json = { diff --git a/docs/tutorials/javascript/modular-tutorials/nfts/batch-mint-nfts.md b/docs/tutorials/javascript/nfts/batch-mint-nfts.md similarity index 98% rename from docs/tutorials/javascript/modular-tutorials/nfts/batch-mint-nfts.md rename to docs/tutorials/javascript/nfts/batch-mint-nfts.md index a7d8651847..2dd31030f7 100644 --- a/docs/tutorials/javascript/modular-tutorials/nfts/batch-mint-nfts.md +++ b/docs/tutorials/javascript/nfts/batch-mint-nfts.md @@ -35,14 +35,14 @@ You can download the [Quickstart Samples](https://github.com/XRPLF/xrpl-dev-port ## Batch Mint NFTs
- +
This example lets you mint multiple NFTs for a single unique item. The NFT might represent "prints" of an original artwork, tickets to an event, or another limited set of unique items. To batch mint a non-fungible token objects: -1. Set the **Flags** field. For testing purposes, we recommend setting the value to _8_. This sets the _tsTransferable_ flag, meaning that the NFT object can be transferred to another account. Otherwise, the NFT object can only be transferred back to the issuing account. See [NFTokenMint](../../../../references/protocol/transactions/types/nftokenmint.md) for information about all of the available flags for minting NFTs. +1. Set the **Flags** field. For testing purposes, we recommend setting the value to _8_. This sets the _tsTransferable_ flag, meaning that the NFT object can be transferred to another account. Otherwise, the NFT object can only be transferred back to the issuing account. See [NFTokenMint](../../../../docs/references/protocol/transactions/types/nftokenmint.md) for information about all of the available flags for minting NFTs. 2. Enter the **Token URL**. This is a URI that points to the data or metadata associated with the NFT object. You can use the sample URI provided if you do not have one of your own. 3. Enter a **Token Count** of up to 200 NFTs to create in one batch. 4. Enter the **Transfer Fee**, a percentage of the proceeds that the original creator receives from future sales of the NFT. This is a value of 0-50000 inclusive, allowing transfer fees between 0.000% and 50.000% in increments of 0.001%. If you do not set the **Flags** field to allow the NFT to be transferrable, set this field to 0. diff --git a/docs/tutorials/javascript/modular-tutorials/nfts/broker-an-nft-sale.md b/docs/tutorials/javascript/nfts/broker-an-nft-sale.md similarity index 99% rename from docs/tutorials/javascript/modular-tutorials/nfts/broker-an-nft-sale.md rename to docs/tutorials/javascript/nfts/broker-an-nft-sale.md index b30707ef22..ad635c8dbe 100644 --- a/docs/tutorials/javascript/modular-tutorials/nfts/broker-an-nft-sale.md +++ b/docs/tutorials/javascript/nfts/broker-an-nft-sale.md @@ -43,7 +43,7 @@ You can download the [Quickstart Samples](https://github.com/XRPLF/xrpl-dev-port ## Prepare a Brokered Transaction
- +
1. Use the Standby account to create an NFT Sell Offer with the Broker account as the destination. diff --git a/docs/tutorials/javascript/modular-tutorials/nfts/index.md b/docs/tutorials/javascript/nfts/index.md similarity index 100% rename from docs/tutorials/javascript/modular-tutorials/nfts/index.md rename to docs/tutorials/javascript/nfts/index.md diff --git a/docs/tutorials/javascript/modular-tutorials/nfts/mint-and-burn-nfts.md b/docs/tutorials/javascript/nfts/mint-and-burn-nfts.md similarity index 99% rename from docs/tutorials/javascript/modular-tutorials/nfts/mint-and-burn-nfts.md rename to docs/tutorials/javascript/nfts/mint-and-burn-nfts.md index 2c6c6be965..4552a9f2ff 100644 --- a/docs/tutorials/javascript/modular-tutorials/nfts/mint-and-burn-nfts.md +++ b/docs/tutorials/javascript/nfts/mint-and-burn-nfts.md @@ -38,12 +38,12 @@ You can download the [Quickstart Samples](https://github.com/XRPLF/xrpl-dev-port ## Mint an NFT
- +
To mint a non-fungible token object: -1. Set the **Flags** field. For testing purposes, we recommend setting the value to _8_. This sets the _tsTransferable_ flag, meaning that the NFT object can be transferred to another account. Otherwise, the NFT object can only be transferred back to the issuing account. See [NFTokenMint](../../../../references/protocol/transactions/types/nftokenmint.md) for information about all of the available flags for minting NFTs. +1. Set the **Flags** field. For testing purposes, we recommend setting the value to _8_. This sets the _tsTransferable_ flag, meaning that the NFT object can be transferred to another account. Otherwise, the NFT object can only be transferred back to the issuing account. 2. Enter the **Token URL**. This is a URI that points to the data or metadata associated with the NFT object. You can use the sample URI provided if you do not have one of your own. 3. Enter the **Transfer Fee**, a percentage of the proceeds from future sales of the NFT that will be returned to the original creator. This is a value of 0-50000 inclusive, allowing transfer rates between 0.000% and 50.000% in increments of 0.001%. If you do not set the **Flags** field to allow the NFT to be transferrable, set this field to 0. 4. Click **Mint NFT**. diff --git a/docs/tutorials/javascript/modular-tutorials/nfts/transfer-nfts.md b/docs/tutorials/javascript/nfts/transfer-nfts.md similarity index 99% rename from docs/tutorials/javascript/modular-tutorials/nfts/transfer-nfts.md rename to docs/tutorials/javascript/nfts/transfer-nfts.md index a527b93d8b..dc98421e37 100644 --- a/docs/tutorials/javascript/modular-tutorials/nfts/transfer-nfts.md +++ b/docs/tutorials/javascript/nfts/transfer-nfts.md @@ -42,7 +42,7 @@ You can download the [Quickstart Samples](https://github.com/XRPLF/xrpl-dev-port ## Create a Sell Offer
- +
To create a NFT sell offer: diff --git a/docs/tutorials/javascript/modular-tutorials/send-payments/create-accounts-send-xrp.md b/docs/tutorials/javascript/send-payments/create-accounts-send-xrp.md similarity index 99% rename from docs/tutorials/javascript/modular-tutorials/send-payments/create-accounts-send-xrp.md rename to docs/tutorials/javascript/send-payments/create-accounts-send-xrp.md index e1f25bcdf5..98862f83e1 100644 --- a/docs/tutorials/javascript/modular-tutorials/send-payments/create-accounts-send-xrp.md +++ b/docs/tutorials/javascript/send-payments/create-accounts-send-xrp.md @@ -36,7 +36,7 @@ Download and expand the [Quickstart Samples](https://github.com/XRPLF/xrpl-dev-p ## Usage
- +
To get test accounts: @@ -52,7 +52,7 @@ To get test accounts: You can transfer XRP between your new accounts. Each account has its own fields and buttons.
- +
To transfer XRP from the Standby account to the Operational account: diff --git a/docs/tutorials/javascript/modular-tutorials/send-payments/create-conditional-escrows.md b/docs/tutorials/javascript/send-payments/create-conditional-escrows.md similarity index 99% rename from docs/tutorials/javascript/modular-tutorials/send-payments/create-conditional-escrows.md rename to docs/tutorials/javascript/send-payments/create-conditional-escrows.md index 6d5c9e54ee..1ee0c06dad 100644 --- a/docs/tutorials/javascript/modular-tutorials/send-payments/create-conditional-escrows.md +++ b/docs/tutorials/javascript/send-payments/create-conditional-escrows.md @@ -62,7 +62,7 @@ To get test accounts: ### Create Conditional Escrow:
- +
When you create a conditional escrow, you need to specify the amount you want to reserve and the `Condition` value you generated above. You can also set a cancel date and time, after which the escrow is no longer available. diff --git a/docs/tutorials/javascript/modular-tutorials/send-payments/create-time-based-escrows.md b/docs/tutorials/javascript/send-payments/create-time-based-escrows.md similarity index 99% rename from docs/tutorials/javascript/modular-tutorials/send-payments/create-time-based-escrows.md rename to docs/tutorials/javascript/send-payments/create-time-based-escrows.md index 627e7a1084..df68e38c29 100644 --- a/docs/tutorials/javascript/modular-tutorials/send-payments/create-time-based-escrows.md +++ b/docs/tutorials/javascript/send-payments/create-time-based-escrows.md @@ -45,7 +45,7 @@ To get test accounts: ## Create Escrow
- +
You can create a time-based escrow with a minimum time to finish the escrow and a cancel time after which the funds in escrow are no longer available to the recipient. This is a test harness: while a practical scenario might express time in days or weeks, this form lets you set the finish and cancel times in seconds so that you can quickly run through a variety of scenarios. (There are 86,400 seconds in a day, if you want to play with longer term escrows.) diff --git a/docs/tutorials/javascript/modular-tutorials/send-payments/create-trust-line-send-currency.md b/docs/tutorials/javascript/send-payments/create-trust-line-send-currency.md similarity index 99% rename from docs/tutorials/javascript/modular-tutorials/send-payments/create-trust-line-send-currency.md rename to docs/tutorials/javascript/send-payments/create-trust-line-send-currency.md index 54079af809..d7210681e8 100644 --- a/docs/tutorials/javascript/modular-tutorials/send-payments/create-trust-line-send-currency.md +++ b/docs/tutorials/javascript/send-payments/create-trust-line-send-currency.md @@ -42,7 +42,7 @@ Open the Token Test Harness and get accounts: ## Create Trust Line
- +
To create a trust line between accounts: diff --git a/docs/tutorials/javascript/send-payments/index.md b/docs/tutorials/javascript/send-payments/index.md new file mode 100644 index 0000000000..417d57b740 --- /dev/null +++ b/docs/tutorials/javascript/send-payments/index.md @@ -0,0 +1,13 @@ +--- +html: send-payments-using-javascript.html +parent: javascript.html +top_nav_grouping: Article Types +metadata: + indexPage: true +--- +# Send Payments Using JavaScript + +Send XRP and issued currency on the XRP Ledger using JavaScript. + + +{% child-pages /%} diff --git a/docs/tutorials/javascript/send-payments/send-and-cash-checks.md b/docs/tutorials/javascript/send-payments/send-and-cash-checks.md new file mode 100644 index 0000000000..e173d8e5af --- /dev/null +++ b/docs/tutorials/javascript/send-payments/send-and-cash-checks.md @@ -0,0 +1,901 @@ +--- +html: send-and-cash-checks.html +parent: send-payments-using-javascript.html +labels: + - Accounts + - Quickstart + - Transaction Sending + - Checks + - XRP +--- +# Send and Cash Checks + +This example shows how to: + +1. Send a check to transfer XRP or issued currency to another account. +2. Get a list of checks you have sent or received. +3. Cash a check received from another account. +4. Cancel a check you have sent. + +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. +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. + + +[![Empty Check Form](/docs/img/quickstart-checks1.png)](/docs/img/quickstart-checks1.png) + +## Prerequisites + +Clone or download the [Modular Tutorial Samples](https://github.com/XRPLF/xrpl-dev-portal/tree/master/content/_code-samples/quickstart/js/){.github-code-download}. + +**Note:** Without the Quickstart Samples, you will not be able to try the examples that follow. + +## Usage + +To get test accounts: + +1. Open and launch `10check.html`. +2. Click **Get Standby Account**. +3. Click **Get Operational Account**. + +[![Form with New Accounts](/docs/img/quickstart-checks2.png)](/docs/img/quickstart-checks2.png) + +You can transfer XRP between your new accounts. Each account has its own fields and buttons. + +
+ +
+ +### Send a Check for XRP + +To send a check for XRP from the Standby account to the Operational account: + +1. On the Standby (left) side of the form, enter the **Amount** of XRP to send, in drops. +2. Copy and paste the **Operational Account** field to the Standby **Destination** field. +3. Set the **Currency** to _XRP_. +4. Click **Send Check**. + +[![Send Check Settings](/docs/img/quickstart-checks3.png)](/docs/img/quickstart-checks3.png) + +### Send a Check for an Issued Currency + +To send a check for an issued currency token from the Standby account to the Operational account: + +1. On the Standby side of the form, enter the **Amount** of currency to send. +2. Copy and paste the **Operational Account** field to the Standby **Destination** field. +3. Copy the **Standby Account** field and paste the value in the **Issuer** field. +4. Enter the **Currency** code for your token. +5. Click **Send Check**. + +[![Send Token Check Settings](/docs/img/quickstart-checks4.png)](/docs/img/quickstart-checks4.png) + + +### 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. + +[![Get Checks with index highlighted](/docs/img/quickstart-checks5.png)](/docs/img/quickstart-checks5.png) + +### Cash Check + +To cash a check you have received: + +1. Enter the **Check ID** (**index** value). +2. Enter the **Amount** you want to collect, up to the full amount of the check. +3. Enter the currency code. + a. If you cashing a check for XRP, enter _XRP_ in the **Currency** field. + b. If you are cashing a check for an issued currency token: + 1. Enter the **Issuer** of the token. + 2. Enter the **Currency** code for the token. +4. Click **Cash Check**. + +[![Cashed check results](/docs/img/quickstart-checks6.png)](/docs/img/quickstart-checks6.png) + + +### Get Balances + +Click **Get Balances** to get a list of obligations and assets for each account. + +[![Account Balances](/docs/img/quickstart-checks7.png)](/docs/img/quickstart-checks7.png) + +### Cancel Check + +To cancel a check you have previously sent to another account. + +1. Enter the **Check ID** (**index** value). +2. Click **Cancel Check**. + +[![Canceled check results](/docs/img/quickstart-checks8.png)](/docs/img/quickstart-checks8.png) + + +# Code Walkthrough + +You can download the [Quickstart Samples](https://github.com/XRPLF/xrpl-dev-portal/tree/master/content/_code-samples/quickstart/js/){.github-code-download} in the source repository for this website. + +## ripplex10-check.js + +### sendCheck() + +Connect to the XRP ledger. + +```javascript +async function sendCheck() { + let net = getNet() + const client = new xrpl.Client(net) + results = 'Connecting to ' + getNet() + '....' + standbyResultField.value = results + await client.connect() + results += '\nConnected.' + standbyResultField.value = results +``` + +Instantiate the account wallets. + +```javascript + const standby_wallet = xrpl.Wallet.fromSeed(standbySeedField.value) + const operational_wallet = xrpl.Wallet.fromSeed(operationalSeedField.value) +``` + +Create the `check_amount` variable, based on the standby amount field. + +```javascript + var check_amount = standbyAmountField.value +``` + +If the currency is anything but _XRP_, it's an issued currency. Update the `check_amount` variable to include the `currency` and `issuer` fields. + +```javascript + if (standbyCurrencyField.value != "XRP") { + check_amount = { + "currency": standbyCurrencyField.value, + "value": standbyAmountField.value, + "issuer": standby_wallet.address + } + } +``` + +Define the `CheckCreate` transaction. + +```javascript + const send_check_tx = { + "TransactionType": "CheckCreate", + "Account": standby_wallet.address, + "SendMax": check_amount, + "Destination": standbyDestinationField.value + } +``` + +Prepare and sign the transaction. + +```javascript + const check_prepared = await client.autofill(send_check_tx) + const check_signed = standby_wallet.sign(check_prepared) + results += 'Sending ' + check_amount + ' ' + standbyCurrencyField + ' to ' + + standbyDestinationField.value + '...' + standbyResultField.value = results +``` + +Submit the transaction to the XRP Ledger and wait for the response. + +``` + const check_result = await client.submitAndWait(check_signed.tx_blob) +``` + +Report the results + +```javascript + if (check_result.result.meta.TransactionResult == "tesSUCCESS") { + results += 'Transaction succeeded: https://testnet.xrpl.org/transactions/${check_signed.hash}' + standbyResultField.value = JSON.stringify(check_result.result, null, 2) + } else { + results += 'Transaction failed: See JavaScript console for details.' + standbyResultField.value = results + throw 'Error sending transaction: ${check_result.result.meta.TransactionResult}' + } +``` + +Update the XRP balance fields. + +```javascript + standbyBalanceField.value = (await client.getXrpBalance(standby_wallet.address)) + operationalBalanceField.value = (await client.getXrpBalance(operational_wallet.address)) +``` + +Disconnect from the XRP Ledger. + +```javascript + client.disconnect() +} // end of sendCheck() +``` + +### getChecks() + +```javascript +async function getChecks() { +``` + +Connect to the XRP Ledger. + +```javascript + let net = getNet() + const client = new xrpl.Client(net) + results = 'Connecting to ' + getNet() + '....' + standbyResultField.value = results + await client.connect() + results += '\nConnected.' + standbyResultField.value = results + results= "\nGetting standby account checks...\n" +``` + +Define and send the `account_objects` request, specifying `check` objects. + +```javascript + const check_objects = await client.request({ + "id": 5, + "command": "account_objects", + "account": standbyAccountField.value, + "ledger_index": "validated", + "type": "check" + }) +``` + +Report the results. + +```javascript + standbyResultField.value = JSON.stringify(check_objects.result, null, 2) +``` + +Disconnect from the XRP Ledger. + +```javascript + client.disconnect() +} // End of getChecks() +``` +### cashCheck() + +Connect to the XRP Ledger and instantiate the account wallets. + +```javascript +async function cashCheck() { + let net = getNet() + const client = new xrpl.Client(net) + results = 'Connecting to ' + getNet() + '....' + standbyResultField.value = results + await client.connect() + results += '\nConnected.' + standbyResultField.value = results + + const standby_wallet = xrpl.Wallet.fromSeed(standbySeedField.value) + const operational_wallet = xrpl.Wallet.fromSeed(operationalSeedField.value) +``` + +Set the `check_amount` variable to the value in the **Amount** field. + +```javascript + var check_amount = standbyAmountField.value +``` + +If the **Currency** is anything other than `XRP`, the check is for an issued currency. Redefine the variable to include the `currency` and `issuer` for the token. + +``` + if (standbyCurrencyField.value != "XRP") { + check_amount = { + "value": standbyAmountField.value, + "currency": standbyCurrencyField.value, + "issuer": standbyIssuerField.value + } + } +``` + +Define the `CheckCash` transaction. + +```javascript + const cash_check_tx = { + "TransactionType": "CheckCash", + "Account": standby_wallet.address, + "Amount": check_amount, + "CheckID": standbyCheckID.value + } +``` + +Prepare and sign the transaction. + +```javascript + const cash_prepared = await client.autofill(cash_check_tx) + const cash_signed = standby_wallet.sign(cash_prepared) + results += ' Receiving ' + standbyAmountField.value + ' ' + standbyCurrencyField.value + '.\n' + standbyResultField.value = results +``` + +Submit the transaction and wait for the results. + +```javascript + const check_result = await client.submitAndWait(cash_signed.tx_blob) +``` + +Report the results. + +```javascript + if (check_result.result.meta.TransactionResult == "tesSUCCESS") { + results += 'Transaction succeeded: https://testnet.xrpl.org/transactions/${cash_signed.hash}' + standbyResultField.value = results + } else { + results += 'Transaction failed: See JavaScript console for details.' + standbyResultField.value = results + throw 'Error sending transaction: ${check_result.result.meta.TransactionResult}' + } +``` + +Update the XRP balance fields. + +```javascript + standbyBalanceField.value = (await client.getXrpBalance(standby_wallet.address)) + operationalBalanceField.value = (await client.getXrpBalance(operational_wallet.address)) +``` + +Disconnect from the XRP Ledger. + +```javascript + client.disconnect() +} // end of cashCheck() +``` + +### cancelCheck + +Connect to the XRP Ledger and instantiate the account wallets. + +```javascript +async function cancelCheck() { + let net = getNet() + const client = new xrpl.Client(net) + results = 'Connecting to ' + getNet() + '....' + standbyResultField.value = results + await client.connect() + results += '\nConnected.' + standbyResultField.value = results + + const standby_wallet = xrpl.Wallet.fromSeed(standbySeedField.value) + const operational_wallet = xrpl.Wallet.fromSeed(operationalSeedField.value) +``` + +Define the `CheckCancel` transaction. + +```javascript + const cancel_check_tx = { + "TransactionType": "CheckCancel", + "Account": standby_wallet.address, + "CheckID": standbyCheckID.value + } +``` + +Prepare and sign the transaction object. + +```javascript + const cancel_prepared = await client.autofill(cancel_check_tx) + const cancel_signed = standby_wallet.sign(cancel_prepared) + results += ' Cancelling check.\n' + standbyResultField.value = results +``` + +Submit the transaction and wait for the results. + +```javascript + const check_result = await client.submitAndWait(cancel_signed.tx_blob) +``` + +Report the results. + +```javascript + if (check_result.result.meta.TransactionResult == "tesSUCCESS") { + results += 'Transaction succeeded: https://testnet.xrpl.org/transactions/${cash_signed.hash}' + standbyResultField.value = results + } else { + results += 'Transaction failed: See JavaScript console for details.' + standbyResultField.value = results + throw 'Error sending transaction: ${check_result.result.meta.TransactionResult}' + } +``` + +Update the XRP balance fields. + +```javascript + standbyBalanceField.value = (await client.getXrpBalance(standby_wallet.address)) + operationalBalanceField.value = (await client.getXrpBalance(operational_wallet.address)) +``` + +Disconnect from the XRP Ledger. + +```javascript + client.disconnect() +} // end of cancelCheck() +``` + +### Reciprocal functions for the Operational account. + +```javascript +// ******************************************************* +// ************ Operational Send Check ******************* +// ******************************************************* +async function opSendCheck() { + let net = getNet() + const client = new xrpl.Client(net) + results = 'Connecting to ' + getNet() + '....' + operationalResultField.value = results + await client.connect() + results += '\nConnected.' + operationalResultField.value = results + + const standby_wallet = xrpl.Wallet.fromSeed(standbySeedField.value) + const operational_wallet = xrpl.Wallet.fromSeed(operationalSeedField.value) + + const issue_quantity = operationalAmountField.value + var check_amount = operationalAmountField.value + + if (operationalCurrencyField.value != "XRP") { + check_amount = { + "currency": operationalCurrencyField.value, + "value": operationalAmountField.value, + "issuer": operational_wallet.address + } + } + const send_check_tx = { + "TransactionType": "CheckCreate", + "Account": operational_wallet.address, + "SendMax": check_amount, + "Destination": operationalDestinationField.value + } + const check_prepared = await client.autofill(send_check_tx) + const check_signed = operational_wallet.sign(check_prepared) + results += '\nSending check to ' + + operationalDestinationField.value + '...' + operationalResultField.value = results + const check_result = await client.submitAndWait(check_signed.tx_blob) + if (check_result.result.meta.TransactionResult == "tesSUCCESS") { + results += 'Transaction succeeded: https://testnet.xrpl.org/transactions/${check_signed.hash}' + operationalResultField.value = JSON.stringify(check_result.result, null, 2) + } else { + results += 'Transaction failed: See JavaScript console for details.' + operationalResultField.value = results + throw 'Error sending transaction: ${check_result.result.meta.TransactionResult}' + } + standbyBalanceField.value = (await client.getXrpBalance(standby_wallet.address)) + operationalBalanceField.value = (await client.getXrpBalance(operational_wallet.address)) + client.disconnect() +} // end of opSendCheck() + +// ******************************************************* +// ************ Operational Get Checks ******************* +// ******************************************************* + +async function opGetChecks() { + let net = getNet() + const client = new xrpl.Client(net) + results = 'Connecting to ' + getNet() + '....' + operationalResultField.value = results + await client.connect() + results += '\nConnected.' + operationalResultField.value = results + + results= "\nGetting standby account checks...\n" + const check_objects = await client.request({ + "id": 5, + "command": "account_objects", + "account": operationalAccountField.value, + "ledger_index": "validated", + "type": "check" + }) + operationalResultField.value = JSON.stringify(check_objects.result, null, 2) + client.disconnect() +} // End of opGetChecks() + + +// ******************************************************* +// ************* Operational Cash Check ****************** +// ******************************************************* + +async function opCashCheck() { + let net = getNet() + const client = new xrpl.Client(net) + results = 'Connecting to ' + getNet() + '....' + operationalResultField.value = results + await client.connect() + results += '\nConnected.' + operationalResultField.value = results + + const standby_wallet = xrpl.Wallet.fromSeed(standbySeedField.value) + const operational_wallet = xrpl.Wallet.fromSeed(operationalSeedField.value) + + var check_amount = operationalAmountField.value + + if (operationalCurrencyField.value != "XRP") { + check_amount = { + "value": operationalAmountField.value, + "currency": operationalCurrencyField.value, + "issuer": operationalIssuerField.value + } + } + const cash_check_tx = { + "TransactionType": "CheckCash", + "Account": operational_wallet.address, + "Amount": check_amount, + "CheckID": operationalCheckIDField.value + } + const cash_prepared = await client.autofill(cash_check_tx) + const cash_signed = operational_wallet.sign(cash_prepared) + results += ' Receiving ' + operationalAmountField.value + ' ' + operationalCurrencyField.value + '.\n' + operationalResultField.value = results + const check_result = await client.submitAndWait(cash_signed.tx_blob) + if (check_result.result.meta.TransactionResult == "tesSUCCESS") { + results += 'Transaction succeeded: https://testnet.xrpl.org/transactions/${cash_signed.hash}' + operationalResultField.value = results + } else { + results += 'Transaction failed: See JavaScript console for details.' + operationalResultField.value = results + throw 'Error sending transaction: ${check_result.result.meta.TransactionResult}' + } + standbyBalanceField.value = (await client.getXrpBalance(standby_wallet.address)) + operationalBalanceField.value = (await client.getXrpBalance(operational_wallet.address)) + client.disconnect() +} +// end of opCashCheck() + +// ******************************************************* +// ************* Operational Cancel Check **************** +// ******************************************************* + +async function opCancelCheck() { + let net = getNet() + const client = new xrpl.Client(net) + results = 'Connecting to ' + getNet() + '....' + operationalResultField.value = results + await client.connect() + results += '\nConnected.' + operationalResultField.value = results + + const standby_wallet = xrpl.Wallet.fromSeed(standbySeedField.value) + const operational_wallet = xrpl.Wallet.fromSeed(operationalSeedField.value) + + const cancel_check_tx = { + "TransactionType": "CheckCancel", + "Account": operational_wallet.address, + "CheckID": operationalCheckIDField.value + } + + const cancel_prepared = await client.autofill(cancel_check_tx) + const cancel_signed = operational_wallet.sign(cancel_prepared) + results += ' Cancelling check.\n' + operationalResultField.value = results + const check_result = await client.submitAndWait(cancel_signed.tx_blob) + if (check_result.result.meta.TransactionResult == "tesSUCCESS") { + results += 'Transaction succeeded: https://testnet.xrpl.org/transactions/${cash_signed.hash}' + operationalResultField.value = results + } else { + results += 'Transaction failed: See JavaScript console for details.' + operationalResultField.value = results + throw 'Error sending transaction: ${check_result.result.meta.TransactionResult}' + } + standbyBalanceField.value = (await client.getXrpBalance(standby_wallet.address)) + operationalBalanceField.value = (await client.getXrpBalance(operational_wallet.address)) + client.disconnect() +} // end of cancelCheck() +``` + +## 10.check.html + +```html + + + Token Test Harness + + + + + + + + + + + + + + +

Token Test Harness

+
+ Choose your ledger instance: +    + + +    + + +

+ +
+ +

+ + + + + +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Standby Account + + +
+
+ Public Key + + +
+
+ Private Key + + +
+
+ Seed + + +
+
+ XRP Balance + + +
+
+ Amount + + +
+
+ Destination + + +
+
+ Issuer + + +
+
+ Check ID + + +
+
+ + +
+ Currency + + +
+

+ +

+
+ + + + + + +
+ +

+ +
+ +
+ +
+ +
+ +
+
+
+ + + + +
+ + + + + + + + + +
+ +

+ +
+ +
+ +
+ +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Operational Account + + +
+
+ Public Key + + +
+
+ Private Key + + +
+
+ Seed + + +
+
+ XRP Balance + + +
+
+ Amount + + +
+
+ Destination + + +
+
+ Issuer + + +
+
+ Check ID + + +
+
+ + + + +
+ Currency + + +
+

+ +

+
+
+
+
+ + +``` \ No newline at end of file diff --git a/docs/tutorials/php/get-started.md b/docs/tutorials/php/build-apps/get-started.md similarity index 69% rename from docs/tutorials/php/get-started.md rename to docs/tutorials/php/build-apps/get-started.md index 3669173794..1ac84f9281 100644 --- a/docs/tutorials/php/get-started.md +++ b/docs/tutorials/php/build-apps/get-started.md @@ -13,7 +13,7 @@ labels: - Development showcase_icon: assets/img/logos/java.svg --- -# Get Started Using PHP +# Get Started Using PHP Library This tutorial walks you through the basics of building an XRP Ledger-connected application using [`XRPL_PHP`](https://github.com/AlexanderBuzz/xrpl-php), a PHP library built to interact with the XRP Ledger. @@ -45,7 +45,7 @@ composer require hardcastle/xrpl_php ## Start Building -When you're working with the XRP Ledger, there are a few things you'll need to manage, whether you're adding XRP to your [account](../../concepts/accounts/index.md), integrating with the [decentralized exchange](../../concepts/tokens/decentralized-exchange/index.md), or [issuing tokens](../../concepts/tokens/index.md). This tutorial walks you through basic patterns common to getting started with all of these use cases and provides sample code for implementing them. +When you're working with the XRP Ledger, there are a few things you'll need to manage, whether you're adding XRP to your [account](../../../concepts/accounts/index.md), integrating with the [decentralized exchange](../../../concepts/tokens/decentralized-exchange/index.md), or [issuing tokens](../../../concepts/tokens/index.md). This tutorial walks you through basic patterns common to getting started with all of these use cases and provides sample code for implementing them. Here are the basic steps you'll need to cover for almost any XRP Ledger project: @@ -75,9 +75,9 @@ Note that PHP has no native support for WebSockets, so the Client does not estab #### Connect to the production XRP Ledger -The sample code in the previous section shows you how to connect to the Testnet, which is one of the available [parallel networks](../../concepts/networks-and-servers/parallel-networks.md). When you're ready to integrate with the production XRP Ledger, you'll need to connect to the Mainnet. You can do that in two ways: +The sample code in the previous section shows you how to connect to the Testnet, which is one of the available [parallel networks](../../../concepts/networks-and-servers/parallel-networks.md). When you're ready to integrate with the production XRP Ledger, you'll need to connect to the Mainnet. You can do that in two ways: -* By [installing the core server](../../infrastructure/installation/index.md) (`rippled`) and running a node yourself. The core server connects to the Mainnet by default, but you can [change the configuration to use Testnet or Devnet](../../infrastructure/configuration/connect-your-rippled-to-the-xrp-test-net.md). [There are good reasons to run your own core server](../../concepts/networks-and-servers/index.md#reasons-to-run-your-own-server). If you run your own server, you can connect to it like so: +* By [installing the core server](../../../infrastructure/installation/index.md) (`rippled`) and running a node yourself. The core server connects to the Mainnet by default, but you can [change the configuration to use Testnet or Devnet](../../../infrastructure/configuration/connect-your-rippled-to-the-xrp-test-net.md). [There are good reasons to run your own core server](../../../concepts/networks-and-servers/index.md#reasons-to-run-your-own-server). If you run your own server, you can connect to it like so: ``` use XRPL_PHP\Client\JsonRpcClient; @@ -99,7 +99,7 @@ The sample code in the previous section shows you how to connect to the Testnet, ### 2. Get account -To store value and execute transactions on the XRP Ledger, you need to get an account: a [set of keys](../../concepts/accounts/cryptographic-keys.md#key-components) and an [address](../../concepts/accounts/addresses.md) that's been [funded with enough XRP](../../concepts/accounts/index.md#creating-accounts) to meet the [account reserve](../../concepts/accounts/reserves.md). The address is the identifier of your account and you use the [private key](../../concepts/accounts/cryptographic-keys.md#private-key) to sign transactions that you submit to the XRP Ledger. For production purposes, you should take care to store your keys and set up a [secure signing method](../../concepts/transactions/secure-signing.md). +To store value and execute transactions on the XRP Ledger, you need to get an account: a [set of keys](../../../concepts/accounts/cryptographic-keys.md#key-components) and an [address](../../../concepts/accounts/addresses.md) that's been [funded with enough XRP](../../../concepts/accounts/index.md#creating-accounts) to meet the [account reserve](../../../concepts/accounts/reserves.md). The address is the identifier of your account and you use the [private key](../../../concepts/accounts/cryptographic-keys.md#private-key) to sign transactions that you submit to the XRP Ledger. For production purposes, you should take care to store your keys and set up a [secure signing method](../../../concepts/transactions/secure-signing.md). To generate a new account, `PHP_XRPL` provides the static `generate()` method in the `Wallet` class: @@ -138,13 +138,13 @@ print_r([ ``` -For testing and development purposes, you can use the `fundWallet()` helper function on the XRP Ledger [Testnet](../../concepts/networks-and-servers/parallel-networks.md): +For testing and development purposes, you can use the `fundWallet()` helper function on the XRP Ledger [Testnet](../../../concepts/networks-and-servers/parallel-networks.md): {% code-snippet file="/_code-samples/get-started/php/get-account-info.php" from=", then clos **Full code for this step:** {% repo-link path="_code-samples/build-a-desktop-wallet/py/3_account.py" %}`3_account.py`{% /repo-link %} -Now that you have a working, ongoing connection to the XRP Ledger, it's time to start adding some "wallet" functionality that lets you manage an individual account. For this step, you should prompt the user to input their address or master seed, then use that to display information about their account including how much XRP is set aside for the [reserve requirement](../../concepts/accounts/reserves.md). +Now that you have a working, ongoing connection to the XRP Ledger, it's time to start adding some "wallet" functionality that lets you manage an individual account. For this step, you should prompt the user to input their address or master seed, then use that to display information about their account including how much XRP is set aside for the [reserve requirement](../../../concepts/accounts/reserves.md). The prompt is in a pop-up dialog like this: @@ -181,7 +181,7 @@ In the `XRPLMonitorThread` class, rename and update the `watch_xrpl()` method as {% code-snippet file="/_code-samples/build-a-desktop-wallet/py/3_account.py" from="async def watch_xrpl" before="async def on_connected" language="py" /%} -The newly renamed `watch_xrpl_account()` method now takes an address and optional wallet and saves them for later. (The GUI thread provides these based on user input.) This method also adds a new case for [transaction stream messages](../../references/http-websocket-apis/public-api-methods/subscription-methods/subscribe.md#transaction-streams). When it sees a new transaction, the worker does not yet do anything with the transaction itself, but it uses that as a trigger to get the account's latest XRP balance and other info using the [account_info method][]. When _that_ response arrives, the worker passes the account data to the GUI for display. +The newly renamed `watch_xrpl_account()` method now takes an address and optional wallet and saves them for later. (The GUI thread provides these based on user input.) This method also adds a new case for [transaction stream messages](../../../references/http-websocket-apis/public-api-methods/subscription-methods/subscribe.md#transaction-streams). When it sees a new transaction, the worker does not yet do anything with the transaction itself, but it uses that as a trigger to get the account's latest XRP balance and other info using the [account_info method][]. When _that_ response arrives, the worker passes the account data to the GUI for display. Still in the `XRPLMonitorThread` class, update the `on_connected()` method as follows: @@ -203,7 +203,7 @@ Update the `build_ui()` method definition as follows: {% code-snippet file="/_code-samples/build-a-desktop-wallet/py/3_account.py" from="def build_ui(self):" before="def run_bg_job(self, job):" language="py" /%} -This adds a [`wx.StaticBox`](https://docs.wxpython.org/wx.StaticBox.html) with several new widgets, then uses the `AutoGridBagSizer` (defined above) to lay them out in 2×4 grid within the box. These new widgets are all static text to display [details of the account](../../references/protocol/ledger-data/ledger-entry-types/accountroot.md), though some of them start with placeholder text. (Since they require data from the ledger, you have to wait for the worker thread to send that data back.) +This adds a [`wx.StaticBox`](https://docs.wxpython.org/wx.StaticBox.html) with several new widgets, then uses the `AutoGridBagSizer` (defined above) to lay them out in 2×4 grid within the box. These new widgets are all static text to display [details of the account](../../../references/protocol/ledger-data/ledger-entry-types/accountroot.md), though some of them start with placeholder text. (Since they require data from the ledger, you have to wait for the worker thread to send that data back.) **Caution:** You may notice that even though the constructor for this class sees the `wallet` variable, it does not save it as a property of the object. This is because the wallet mostly needs to be managed by the worker thread, not the GUI thread, and updating it in both places might not be thread-safe. @@ -211,7 +211,7 @@ Add a new `prompt_for_account()` method to the `TWaXLFrame` class: {% code-snippet file="/_code-samples/build-a-desktop-wallet/py/3_account.py" from="def prompt_for_account" before="def update_ledger" language="py" /%} -The constructor calls this method to prompt the user for their [address](../../concepts/accounts/addresses.md) or [master seed](../../concepts/accounts/cryptographic-keys.md#seed), then processes the user input to decode whatever value the user put in, and use it accordingly. With wxPython, you usually follow this pattern with dialog boxes: +The constructor calls this method to prompt the user for their [address](../../../concepts/accounts/addresses.md) or [master seed](../../../concepts/accounts/cryptographic-keys.md#seed), then processes the user input to decode whatever value the user put in, and use it accordingly. With wxPython, you usually follow this pattern with dialog boxes: 1. Create a new instance of a dialog class, such as a [`wx.TextEntryDialog`](https://docs.wxpython.org/wx.TextEntryDialog.html). 2. Use `showModal()` to display it to the user and get a return code based on which button the user clicked. @@ -285,7 +285,7 @@ Have the worker use the [account_tx method][] to look up the account's transacti {% code-snippet file="/_code-samples/build-a-desktop-wallet/py/4_tx_history.py" from="# Get the first page of the account's transaction history" before="class AutoGridBagSizer" language="py" /%} -**Note:** You may have to [paginate](../../references/http-websocket-apis/api-conventions/markers-and-pagination.md) across multiple [account_tx][account_tx method] requests and responses if you want the _complete_ list of transactions that affected an account since its creation. This example does not show pagination, so the app only displays the most recent transactions to affect the account. +**Note:** You may have to [paginate](../../../references/http-websocket-apis/api-conventions/markers-and-pagination.md) across multiple [account_tx][account_tx method] requests and responses if you want the _complete_ list of transactions that affected an account since its creation. This example does not show pagination, so the app only displays the most recent transactions to affect the account. Now, edit the `build_ui()` method of the `TWaXLFrame` class. **Update the beginning of the method** to add a new [`wx.Notebook`](https://docs.wxpython.org/wx.Notebook.html), which makes a "tabs" interface, and make the `main_panel` into the first tab, as follows: @@ -301,7 +301,7 @@ Add the following helper method to the `TWaXLFrame` class: {% code-snippet file="/_code-samples/build-a-desktop-wallet/py/4_tx_history.py" from="def displayable_amount" before="def add_tx_row" language="py" /%} -This method takes a [currency amount](../../references/protocol/data-types/basic-data-types.md#specifying-currency-amounts) and converts it into a string for display to a human. Since it's used with the [`delivered_amount` field](../../references/protocol/transactions/metadata.md#delivered_amount) in particular, it also handles the special case for pre-2014 partial payments where the delivered amount is unavailable. +This method takes a [currency amount](../../../references/protocol/data-types/basic-data-types.md#specifying-currency-amounts) and converts it into a string for display to a human. Since it's used with the [`delivered_amount` field](../../../references/protocol/transactions/metadata.md#delivered_amount) in particular, it also handles the special case for pre-2014 partial payments where the delivered amount is unavailable. After that, add another helper method to the `TWaXLFrame` class: @@ -324,7 +324,7 @@ As before, you can test your wallet app with your own test account if you use th **Full code for this step:** {% repo-link path="_code-samples/build-a-desktop-wallet/py/5_send_xrp.py" %}`5_send_xrp.py`{% /repo-link %} -Until now, you've made the app able to view data from the ledger, and it's capable of showing the transactions an account has received. Now it's finally time to make the app capable of _sending_ transactions. For now, you can stick to sending [direct XRP payments](../../concepts/payment-types/direct-xrp-payments.md) because there are more complexities involved in sending [issued tokens](../../concepts/tokens/index.md). +Until now, you've made the app able to view data from the ledger, and it's capable of showing the transactions an account has received. Now it's finally time to make the app capable of _sending_ transactions. For now, you can stick to sending [direct XRP payments](../../../concepts/payment-types/direct-xrp-payments.md) because there are more complexities involved in sending [issued tokens](../../../concepts/tokens/index.md). The main window gets a new "Send XRP" button: @@ -346,13 +346,13 @@ Add a new method to the `XRPLMonitorThread` class to send an XRP payment based o {% code-snippet file="/_code-samples/build-a-desktop-wallet/py/5_send_xrp.py" from="def send_xrp" before="class AutoGridBagSizer" language="py" /%} -In this flow, the app sends the transaction without waiting for it to be confirmed by the consensus process. You should be careful to mark any results from the initial submission as "pending" or "tentative" since the actual result of the transaction [isn't final until it's confirmed](../../concepts/transactions/finality-of-results/index.md). Since the app is also subscribed to the account's transactions, it automatically gets notified when the transaction is confirmed. +In this flow, the app sends the transaction without waiting for it to be confirmed by the consensus process. You should be careful to mark any results from the initial submission as "pending" or "tentative" since the actual result of the transaction [isn't final until it's confirmed](../../../concepts/transactions/finality-of-results/index.md). Since the app is also subscribed to the account's transactions, it automatically gets notified when the transaction is confirmed. Now, create a custom dialog for the user to input the necessary details for the payment: {% code-snippet file="/_code-samples/build-a-desktop-wallet/py/5_send_xrp.py" from="class SendXRPDialog" before="def on_to_edit" language="py" /%} -This subclass of [`wx.Dialog`](https://docs.wxpython.org/wx.Dialog.html) has several custom widgets, which are laid out using the `GridBagSizer` defined earlier. Notably, it has text boxes for the "To" address, the amount of XRP, and the [destination tag](../../concepts/transactions/source-and-destination-tags.md) to use, if any. (A destination tag is kind of like a phone extension for an XRP Ledger address: for addresses owned by individuals, you don't need it, but if the destination address has many users then you need to specify it so that the destination knows which recipient you intended. It's common to need a destination tag to deposit at a cryptocurrency exchange.) The dialog also has **OK** and **Cancel** buttons, which automatically function to cancel or complete the dialog, although the "OK" button is labeled "Send" instead to make it clearer what the app does when the user clicks it. +This subclass of [`wx.Dialog`](https://docs.wxpython.org/wx.Dialog.html) has several custom widgets, which are laid out using the `GridBagSizer` defined earlier. Notably, it has text boxes for the "To" address, the amount of XRP, and the [destination tag](../../../concepts/transactions/source-and-destination-tags.md) to use, if any. (A destination tag is kind of like a phone extension for an XRP Ledger address: for addresses owned by individuals, you don't need it, but if the destination address has many users then you need to specify it so that the destination knows which recipient you intended. It's common to need a destination tag to deposit at a cryptocurrency exchange.) The dialog also has **OK** and **Cancel** buttons, which automatically function to cancel or complete the dialog, although the "OK" button is labeled "Send" instead to make it clearer what the app does when the user clicks it. The `SendXRPDialog` constructor also binds two event handlers for when the user inputs text in the "to" and "destination tag" fields, so you need the definitions for those handlers to the same class. First, add `on_to_edit()`: @@ -430,7 +430,7 @@ You can now use your wallet to send XRP! You can even fund an entirely new accou 3. Open your wallet app and provide a **Secret** (seed) value from an already-funded address, such as one you got from the [Testnet Faucet](/resources/dev-tools/xrp-faucets). -4. Send at least the [base reserve](../../concepts/accounts/reserves.md) (currently 10 XRP) to the brand-new classic address you generated in the Python interpreter. +4. Send at least the [base reserve](../../../concepts/accounts/reserves.md) (currently 10 XRP) to the brand-new classic address you generated in the Python interpreter. 5. Wait for the transaction to be confirmed, then close your wallet app. @@ -445,7 +445,7 @@ You can now use your wallet to send XRP! You can even fund an entirely new accou One of the biggest shortcomings of the wallet app from the previous step is that it doesn't provide a lot of protections or feedback for users to save them from human error and scams. These sorts of protections are extra important when dealing with the cryptocurrency space, because decentralized systems like the XRP Ledger don't have an admin or support team you can ask to cancel or refund a payment if you made a mistake such as sending it to the wrong address. This step shows how to add some checks on destination addresses to warn the user before sending. -One type of check you can make is to verify the domain name associated with an XRP Ledger address; this is called [account domain verification](../../references/xrp-ledger-toml.md#account-verification). When an account's domain is verified, you could show it like this: +One type of check you can make is to verify the domain name associated with an XRP Ledger address; this is called [account domain verification](../../../references/xrp-ledger-toml.md#account-verification). When an account's domain is verified, you could show it like this: ![Screenshot: domain verified destination](/docs/img/python-wallet-6.png) @@ -467,7 +467,7 @@ In the `XRPLMonitorThread` class, add a new `check_destination()` method to chec This code uses [`xrpl.asyncio.account.get_account_info()`](https://xrpl-py.readthedocs.io/en/stable/source/xrpl.asyncio.account.html#xrpl.asyncio.account.get_account_info) to look up the account in the ledger; unlike using the client's `request()` method, `get_account_info()` raises an exception if the account is not found. -If the account _does_ exist, the code checks for the [`lsfDisallowXRP` flag](../../references/protocol/ledger-data/ledger-entry-types/accountroot.md#accountroot-flags). Note that this is an `lsf` (ledger state flag) value because this is an object from the ledger state data; these are different than the flag values the [AccountSet transaction][] uses to configure the same settings. +If the account _does_ exist, the code checks for the [`lsfDisallowXRP` flag](../../../references/protocol/ledger-data/ledger-entry-types/accountroot.md#accountroot-flags). Note that this is an `lsf` (ledger state flag) value because this is an object from the ledger state data; these are different than the flag values the [AccountSet transaction][] uses to configure the same settings. Finally, the code decodes the account's `Domain` field, if present, and performs domain verification using the method imported above. @@ -522,7 +522,7 @@ Finally, calculate the maximum amount the user can send and provide it to the Se {% code-snippet file="/_code-samples/build-a-desktop-wallet/py/6_verification_and_polish.py" from="xrp_bal = Decimal" before="dlg.CenterOnScreen()" language="py" /%} -The formula this code uses to calculate the maximum amount the user can send is the account's XRP balance, minus its [reserve](../../concepts/accounts/reserves.md) and minus the [transaction cost](../../concepts/transactions/transaction-cost.md). The calculation uses the `Decimal` class to avoid rounding errors, but ultimately it has to be converted down to a `float` because that's what wxPython's [`wx.SpinCtrlDouble`](https://docs.wxpython.org/wx.SpinCtrlDouble.html) accepts for minimum and maximum values. Still there is less opportunity for floating-point rounding errors to occur if the conversion happens _after_ the other calculations. +The formula this code uses to calculate the maximum amount the user can send is the account's XRP balance, minus its [reserve](../../../concepts/accounts/reserves.md) and minus the [transaction cost](../../../concepts/transactions/transaction-cost.md). The calculation uses the `Decimal` class to avoid rounding errors, but ultimately it has to be converted down to a `float` because that's what wxPython's [`wx.SpinCtrlDouble`](https://docs.wxpython.org/wx.SpinCtrlDouble.html) accepts for minimum and maximum values. Still there is less opportunity for floating-point rounding errors to occur if the conversion happens _after_ the other calculations. Test your wallet app the same way you did in the previous steps. To test domain verification, try entering the following addresses in the "To" box of the Send XRP dialog: @@ -546,10 +546,10 @@ To test X-addresses, try the following addresses: Now that you have a functional wallet, you can take it in several new directions. The following are a few ideas: -- You could support more of the XRP Ledger's [transaction types](../../references/protocol/transactions/types/index.md) including [tokens](../../concepts/tokens/index.md) and [cross-currency payments](../../concepts/payment-types/cross-currency-payments.md) +- You could support more of the XRP Ledger's [transaction types](../../../references/protocol/transactions/types/index.md) including [tokens](../../../concepts/tokens/index.md) and [cross-currency payments](../../../concepts/payment-types/cross-currency-payments.md) - Example code for displaying token balances and other objects: {% repo-link path="_code-samples/build-a-desktop-wallet/py/7_owned_objects.py" %}`7_owned_objects.py`{% /repo-link %} -- Allow the user to trade in the [decentralized exchange](../../concepts/tokens/decentralized-exchange/index.md) +- Allow the user to trade in the [decentralized exchange](../../../concepts/tokens/decentralized-exchange/index.md) - Add a way to request payments, such as with QR codes or URIs that open in your wallet. -- Support better account security including [regular key pairs](../../concepts/accounts/cryptographic-keys.md#regular-key-pair) or [multi-signing](../../concepts/accounts/multi-signing.md). +- Support better account security including [regular key pairs](../../../concepts/accounts/cryptographic-keys.md#regular-key-pair) or [multi-signing](../../../concepts/accounts/multi-signing.md). {% raw-partial file="/docs/_snippets/common-links.md" /%} diff --git a/docs/tutorials/python/get-started.md b/docs/tutorials/python/build-apps/get-started.md similarity index 70% rename from docs/tutorials/python/get-started.md rename to docs/tutorials/python/build-apps/get-started.md index 4270f4207e..e6ad160dd1 100644 --- a/docs/tutorials/python/get-started.md +++ b/docs/tutorials/python/build-apps/get-started.md @@ -4,7 +4,7 @@ seo: labels: - Development --- -# Get Started Using Python +# Get Started Using Python Library This tutorial walks you through the basics of building an XRP Ledger-connected application using [`xrpl-py`](https://github.com/XRPLF/xrpl-py), a pure [Python](https://www.python.org) library built to interact with the XRP Ledger using native Python models and methods. @@ -36,7 +36,7 @@ pip3 install xrpl-py ## Start Building -When you're working with the XRP Ledger, there are a few things you'll need to manage, whether you're adding XRP to your [account](../../concepts/accounts/index.md), integrating with the [decentralized exchange](../../concepts/tokens/decentralized-exchange/index.md), or [issuing tokens](../../concepts/tokens/index.md). This tutorial walks you through basic patterns common to getting started with all of these use cases and provides sample code for implementing them. +When you're working with the XRP Ledger, there are a few things you'll need to manage, whether you're adding XRP to your [account](../../../concepts/accounts/index.md), integrating with the [decentralized exchange](../../../concepts/tokens/decentralized-exchange/index.md), or [issuing tokens](../../../concepts/tokens/index.md). This tutorial walks you through basic patterns common to getting started with all of these use cases and provides sample code for implementing them. Here are the basic steps you'll need to cover for almost any XRP Ledger project: @@ -53,9 +53,9 @@ To make queries and submit transactions, you need to connect to the XRP Ledger. #### Connect to the production XRP Ledger -The sample code in the previous section shows you how to connect to the Testnet, which is a [parallel network](../../concepts/networks-and-servers/parallel-networks.md) for testing where the money has no real value. When you're ready to integrate with the production XRP Ledger, you'll need to connect to the Mainnet. You can do that in two ways: +The sample code in the previous section shows you how to connect to the Testnet, which is a [parallel network](../../../concepts/networks-and-servers/parallel-networks.md) for testing where the money has no real value. When you're ready to integrate with the production XRP Ledger, you'll need to connect to the Mainnet. You can do that in two ways: -* By [installing the core server](../../infrastructure/installation/index.md) (`rippled`) and running a node yourself. The core server connects to the Mainnet by default, but you can [change the configuration to use Testnet or Devnet](../../infrastructure/configuration/connect-your-rippled-to-the-xrp-test-net.md). [There are good reasons to run your own core server](../../concepts/networks-and-servers/index.md#reasons-to-run-your-own-server). If you run your own server, you can connect to it like so: +* By [installing the core server](../../../infrastructure/installation/index.md) (`rippled`) and running a node yourself. The core server connects to the Mainnet by default, but you can [change the configuration to use Testnet or Devnet](../../../infrastructure/configuration/connect-your-rippled-to-the-xrp-test-net.md). [There are good reasons to run your own core server](../../../concepts/networks-and-servers/index.md#reasons-to-run-your-own-server). If you run your own server, you can connect to it like so: ``` from xrpl.clients import JsonRpcClient @@ -76,9 +76,9 @@ The sample code in the previous section shows you how to connect to the Testnet, ### 2. Get account -To store value and execute transactions on the XRP Ledger, you need an account: a [set of keys](../../concepts/accounts/cryptographic-keys.md#key-components) and an [address](../../concepts/accounts/addresses.md) that's been [funded with enough XRP](../../concepts/accounts/index.md#creating-accounts) to meet the [account reserve](../../concepts/accounts/reserves.md). The address is the identifier of your account and you use the [private key](../../concepts/accounts/cryptographic-keys.md#private-key) to sign transactions that you submit to the XRP Ledger. +To store value and execute transactions on the XRP Ledger, you need an account: a [set of keys](../../../concepts/accounts/cryptographic-keys.md#key-components) and an [address](../../../concepts/accounts/addresses.md) that's been [funded with enough XRP](../../../concepts/accounts/index.md#creating-accounts) to meet the [account reserve](../../../concepts/accounts/reserves.md). The address is the identifier of your account and you use the [private key](../../../concepts/accounts/cryptographic-keys.md#private-key) to sign transactions that you submit to the XRP Ledger. -For testing and development purposes, you can use the [XRP Faucets](/resources/dev-tools/xrp-faucets) to generate keys and fund the account on the Testnet or Devnet. For production purposes, you should take care to store your keys and set up a [secure signing method](../../concepts/transactions/secure-signing.md). Another difference in production is that XRP has real worth, so you can't get it for free from a faucet. +For testing and development purposes, you can use the [XRP Faucets](/resources/dev-tools/xrp-faucets) to generate keys and fund the account on the Testnet or Devnet. For production purposes, you should take care to store your keys and set up a [secure signing method](../../../concepts/transactions/secure-signing.md). Another difference in production is that XRP has real worth, so you can't get it for free from a faucet. To create and fund an account on the Testnet, `xrpl-py` provides the [`generate_faucet_wallet`](https://xrpl-py.readthedocs.io/en/latest/source/xrpl.wallet.html#xrpl.wallet.generate_faucet_wallet) method: @@ -128,7 +128,7 @@ The X-address format [packs the address and destination tag](https://github.com/ ### 3. Query the XRP Ledger -You can query the XRP Ledger to get information about [a specific account](../../references/http-websocket-apis/public-api-methods/account-methods/index.md), [a specific transaction](../../references/http-websocket-apis/public-api-methods/transaction-methods/tx.md), the state of a [current or a historical ledger](../../references/http-websocket-apis/public-api-methods/ledger-methods/index.md), and [the XRP Ledger's decentralized exchange](../../references/http-websocket-apis/public-api-methods/path-and-order-book-methods/index.md). You need to make these queries, among other reasons, to look up account info to follow best practices for [reliable transaction submission](../../concepts/transactions/reliable-transaction-submission.md). +You can query the XRP Ledger to get information about [a specific account](../../../references/http-websocket-apis/public-api-methods/account-methods/index.md), [a specific transaction](../../../references/http-websocket-apis/public-api-methods/transaction-methods/tx.md), the state of a [current or a historical ledger](../../../references/http-websocket-apis/public-api-methods/ledger-methods/index.md), and [the XRP Ledger's decentralized exchange](../../../references/http-websocket-apis/public-api-methods/path-and-order-book-methods/index.md). You need to make these queries, among other reasons, to look up account info to follow best practices for [reliable transaction submission](../../../concepts/transactions/reliable-transaction-submission.md). Here, we use `xrpl-py`'s [`xrpl.account`](https://xrpl-py.readthedocs.io/en/latest/source/xrpl.account.html) module to look up information about the [account we got](#2-get-account) in the previous step. @@ -193,18 +193,18 @@ The response fields that you want to inspect in most cases are: * `account_data.Sequence` — This is the sequence number of the next valid transaction for the account. You need to specify the sequence number when you prepare transactions. With `xrpl-py`, you can use the [`get_next_valid_seq_number`](https://xrpl-py.readthedocs.io/en/latest/source/xrpl.account.html#xrpl.account.get_next_valid_seq_number) to get this automatically from the XRP Ledger. See an example of this usage in the project [README](https://github.com/XRPLF/xrpl-py#serialize-and-sign-transactions). -* `account_data.Balance` — This is the account's balance of [XRP, in drops][]. You can use this to confirm that you have enough XRP to send (if you're making a payment) and to meet the [current transaction cost](../../concepts/transactions/transaction-cost.md#current-transaction-cost) for a given transaction. +* `account_data.Balance` — This is the account's balance of [XRP, in drops][]. You can use this to confirm that you have enough XRP to send (if you're making a payment) and to meet the [current transaction cost](../../../concepts/transactions/transaction-cost.md#current-transaction-cost) for a given transaction. -* `validated` — Indicates whether the returned data is from a [validated ledger](../../concepts/ledgers/open-closed-validated-ledgers.md). When inspecting transactions, it's important to confirm that [the results are final](../../concepts/transactions/finality-of-results/index.md) before further processing the transaction. If `validated` is `true` then you know for sure the results won't change. For more information about best practices for transaction processing, see [Reliable Transaction Submission](../../concepts/transactions/reliable-transaction-submission.md). +* `validated` — Indicates whether the returned data is from a [validated ledger](../../../concepts/ledgers/open-closed-validated-ledgers.md). When inspecting transactions, it's important to confirm that [the results are final](../../../concepts/transactions/finality-of-results/index.md) before further processing the transaction. If `validated` is `true` then you know for sure the results won't change. For more information about best practices for transaction processing, see [Reliable Transaction Submission](../../../concepts/transactions/reliable-transaction-submission.md). -For a detailed description of every response field, see [account_info](../../references/http-websocket-apis/public-api-methods/account-methods/account_info.md#response-format). +For a detailed description of every response field, see [account_info](../../../references/http-websocket-apis/public-api-methods/account-methods/account_info.md#response-format). ## Keep on building Now that you know how to use `xrpl-py` to connect to the XRP Ledger, get an account, and look up information about it, you can also use `xrpl-py` to: -* [Send XRP](../tasks/send-xrp.md). -* [Set up secure signing](../../concepts/transactions/secure-signing.md) for your account. +* [Send XRP](../../how-tos/send-xrp.md). +* [Set up secure signing](../../../concepts/transactions/secure-signing.md) for your account. {% raw-partial file="/docs/_snippets/common-links.md" /%} diff --git a/docs/tutorials/python/build-apps/index.md b/docs/tutorials/python/build-apps/index.md new file mode 100644 index 0000000000..dca92e1376 --- /dev/null +++ b/docs/tutorials/python/build-apps/index.md @@ -0,0 +1,14 @@ +--- +html: build-apps-in-python.html +parent: python.html +top_nav_grouping: Article Types +metadata: + indexPage: true +seo: + description: Build full-featured applications in Python. +--- +# Build Applications in Python + +Build full-featured applications in Python + +{% child-pages /%} diff --git a/docs/tutorials/python/index.md b/docs/tutorials/python/index.md index 2f5b678716..90efc7a611 100644 --- a/docs/tutorials/python/index.md +++ b/docs/tutorials/python/index.md @@ -7,7 +7,30 @@ metadata: --- # Python -XRPL tutorials in Python. +You can create your own interface to try out the capabilities and support your specific business needs. These tutorials build a test harness interface to try out features of the XRP Ledger. The harness displays multiple accounts, so that you can transfer tokens from one account to the other and see the results in real time. +Typically, the example functions involve four steps. +- Connect to the XRP Ledger and instantiate your wallet. +- Make changes to the XRP Ledger using transactions. +- Get the state of accounts and tokens on the XRP Ledger using requests. +- Disconnect from the XRP Ledger. + +Each lesson builds the Token Test Harness one section at a time, with complete Python code that incrementally builds a user interface and separate files that contain the business logic. After describing usage, each lesson provides a code walkthrough. You can download the source code, manipulate it in your favorite IDE, and run it to interact with the XRP Ledger. + +Once familiar with the library functions, you can build sample applications in Python. We anticipate that the applications you build greatly improve upon these examples. Your feedback and contributions are most welcome. + +To get started: + +- Create a new folder on your local disk and install the Python library (xrpl-py) using pip. +

+ `pip3 install xrpl-py` + +- Clone or download the [Sample modules](https://github.com/XRPLF/xrpl-dev-portal/tree/master/_code-samples/quickstart/py/). + +**Note**: Without the sample modules, you won't be able to try the examples that follow. + +## Tutorial Modules + {% child-pages /%} + diff --git a/docs/tutorials/python/modular-tutorials/index.md b/docs/tutorials/python/modular-tutorials/index.md deleted file mode 100644 index 4d40ba3d73..0000000000 --- a/docs/tutorials/python/modular-tutorials/index.md +++ /dev/null @@ -1,15 +0,0 @@ ---- -html: modular-tutorials-in-python.html -parent: python.html -top_nav_grouping: Article Types -metadata: - indexPage: true -seo: - description: Modular XRPL tutorials in Python. ---- -# Modular Tutorials in Python - -These tutorials take an incremental approach to implementing functionality, so you can reuse parts from the earlier tutorials on your way to making more advanced software. - - -{% child-pages /%} diff --git a/docs/tutorials/python/modular-tutorials/send-payments/index.md b/docs/tutorials/python/modular-tutorials/send-payments/index.md deleted file mode 100644 index 15c6360534..0000000000 --- a/docs/tutorials/python/modular-tutorials/send-payments/index.md +++ /dev/null @@ -1,56 +0,0 @@ ---- -html: send-payments-using-python.html -parent: modular-tutorials-in-python.html -seo: - description: Use a Python test harness to send XRP,trade currencies, and more. -labels: - - Accounts - - Cross-Currency - - Non-fungible Tokens, NFTs - - Payments - - Quickstart - - Tokens - - XRP ---- -# Send Payments Using Python - -The XRP Ledger (XRPL) is a robust, secure, customizable service. You can create your own interface to try out the capabilities and support your specific business needs. - -This quickstart describes a test harness interface you can build to try out the XRP Ledger. The test harness displays multiple accounts, so that you can transfer tokens from one account to the other and see the results in real time. The image below shows the Token Test Harness at the completion of step 4. - -[![Quickstart Tutorial Window](/docs/img/quickstart-py15.png)](/docs/img/quickstart-py15.png) - -That is a lot of fields and buttons, all working together to perform some significant practical tasks. But getting _started_ with the XRP Ledger is not that complicated. When you eat the elephant a bite at a time, none of the tasks are difficult to consume. - -Typically, the example functions for interacting with the XRP Ledger involve four steps. - -1. Connect to the XRP Ledger and instantiate your wallet. -2. Make changes to the XRP Ledger using transactions. -3. Get the state of accounts and tokens on the XRP Ledger using requests. -4. Disconnect from the XRP Ledger. - -Each lesson shows you how to build the Token Test Harness one section at a time. Each module lets you try out meaningful interactions with the test ledger, with complete Python code samples and a code walkthrough. There is also a link to the complete source code for each section that can be modified with a text editor and run in a Python environment. You can try out the examples in any order. - -This quickstart tutorial introduces you to the API used to implement features and explore the capabilities of XRP Ledger. It does not represent _all_ of the capabilities of the API and this example is not intended for production or secure payment use. - -Much of this is “brute force” code that sacrifices conciseness for readability. Each example builds on the previous step, adding a new Python UI file and a module to support the new behavior in the lesson. We expect the applications you build to greatly improve upon these examples. Your feedback and contributions are most welcome. - -In this quickstart, you can: - -1. [Create Accounts and Send XRP](create-accounts-send-xrp.md) -2. [Create Trust Line and Send Currency](create-trust-line-send-currency.md). -3. [Create Time-Based Escrows](create-time-based-escrows.md) -4. [Create Conditional Escrows](create-conditional-escrows.md) - - -## Prerequisites - -To get started, create a new folder on your local disk and install the Python library (xrpl-py) using `pip`. - -``` -pip3 install xrpl-py -``` - -Download the python [Quickstart Samples](https://github.com/XRPLF/xrpl-dev-portal/tree/master/_code-samples/quickstart/py/). - -**Note:** Without the Quickstart Samples, you will not be able to try the examples that follow. diff --git a/docs/tutorials/python/modular-tutorials/nfts/assign-an-authorized-minter.md b/docs/tutorials/python/nfts/assign-an-authorized-minter.md similarity index 100% rename from docs/tutorials/python/modular-tutorials/nfts/assign-an-authorized-minter.md rename to docs/tutorials/python/nfts/assign-an-authorized-minter.md diff --git a/docs/tutorials/python/modular-tutorials/nfts/batch-mint-nfts.md b/docs/tutorials/python/nfts/batch-mint-nfts.md similarity index 99% rename from docs/tutorials/python/modular-tutorials/nfts/batch-mint-nfts.md rename to docs/tutorials/python/nfts/batch-mint-nfts.md index 38dd38e9c0..948ccdd92d 100644 --- a/docs/tutorials/python/modular-tutorials/nfts/batch-mint-nfts.md +++ b/docs/tutorials/python/nfts/batch-mint-nfts.md @@ -44,7 +44,7 @@ This example lets you mint multiple NFTs for a single unique item. The NFT might To batch mint non-fungible token objects: 1. Enter the **NFT URI**. This is a URI that points to the data or metadata associated with the NFT object. You can use this sample URI if you do not have one of your own: ipfs://bafybeigdyrzt5sfp7udm7hu76uh7y26nf4dfuylqabf3oclgtqy55fbzdi. -2. Set the **Flags** field. For testing purposes, we recommend setting the value to _8_. This sets the _tsTransferable_ flag, meaning that the NFT object can be transferred to another account. Otherwise, the NFT object can only be transferred back to the issuing account. See [NFTokenMint](../../../../references/protocol/transactions/types/nftokenmint.md) for available NFT minting flags. +2. Set the **Flags** field. For testing purposes, we recommend setting the value to _8_. This sets the _tsTransferable_ flag, meaning that the NFT object can be transferred to another account. Otherwise, the NFT object can only be transferred back to the issuing account. See [NFTokenMint](../../../references/protocol/transactions/types/nftokenmint.md) for available NFT minting flags. 3. Enter the **Transfer Fee**, a percentage of the proceeds that the original creator receives from future sales of the NFT. This is a value of 0-50000 inclusive, allowing transfer fees between 0.000% and 50.000% in increments of 0.001%. If you do not set the **Flags** field to allow the NFT to be transferrable, set this field to 0. 4. Enter the **Taxon** for the NFT. If you do not have a need for the Taxon field, set this value to 0. 5. Enter an **NFT Count** of up to 200 NFTs to create in one batch. diff --git a/docs/tutorials/python/modular-tutorials/nfts/broker-an-nft-sale.md b/docs/tutorials/python/nfts/broker-an-nft-sale.md similarity index 100% rename from docs/tutorials/python/modular-tutorials/nfts/broker-an-nft-sale.md rename to docs/tutorials/python/nfts/broker-an-nft-sale.md diff --git a/docs/tutorials/python/modular-tutorials/nfts/index.md b/docs/tutorials/python/nfts/index.md similarity index 100% rename from docs/tutorials/python/modular-tutorials/nfts/index.md rename to docs/tutorials/python/nfts/index.md diff --git a/docs/tutorials/python/modular-tutorials/nfts/mint-and-burn-nfts.md b/docs/tutorials/python/nfts/mint-and-burn-nfts.md similarity index 100% rename from docs/tutorials/python/modular-tutorials/nfts/mint-and-burn-nfts.md rename to docs/tutorials/python/nfts/mint-and-burn-nfts.md diff --git a/docs/tutorials/python/modular-tutorials/nfts/transfer-nfts.md b/docs/tutorials/python/nfts/transfer-nfts.md similarity index 100% rename from docs/tutorials/python/modular-tutorials/nfts/transfer-nfts.md rename to docs/tutorials/python/nfts/transfer-nfts.md diff --git a/docs/tutorials/python/modular-tutorials/send-payments/create-accounts-send-xrp.md b/docs/tutorials/python/send-payments/create-accounts-send-xrp.md similarity index 99% rename from docs/tutorials/python/modular-tutorials/send-payments/create-accounts-send-xrp.md rename to docs/tutorials/python/send-payments/create-accounts-send-xrp.md index 9ceb30947f..e9e7c3827e 100644 --- a/docs/tutorials/python/modular-tutorials/send-payments/create-accounts-send-xrp.md +++ b/docs/tutorials/python/send-payments/create-accounts-send-xrp.md @@ -34,9 +34,8 @@ Download and expand the [Quickstart Samples](https://github.com/XRPLF/xrpl-dev-p **Note:** Without the Quickstart Samples, you will not be able to try the examples that follow. ## Usage -
- +
To get test accounts: @@ -53,7 +52,7 @@ To get test accounts: You can transfer XRP between your new accounts. Each account has its own fields and buttons.
- +
To transfer XRP from the Standby account to the Operational account: diff --git a/docs/tutorials/python/modular-tutorials/send-payments/create-conditional-escrows.md b/docs/tutorials/python/send-payments/create-conditional-escrows.md similarity index 100% rename from docs/tutorials/python/modular-tutorials/send-payments/create-conditional-escrows.md rename to docs/tutorials/python/send-payments/create-conditional-escrows.md diff --git a/docs/tutorials/python/modular-tutorials/send-payments/create-time-based-escrows.md b/docs/tutorials/python/send-payments/create-time-based-escrows.md similarity index 100% rename from docs/tutorials/python/modular-tutorials/send-payments/create-time-based-escrows.md rename to docs/tutorials/python/send-payments/create-time-based-escrows.md diff --git a/docs/tutorials/python/modular-tutorials/send-payments/create-trust-line-send-currency.md b/docs/tutorials/python/send-payments/create-trust-line-send-currency.md similarity index 99% rename from docs/tutorials/python/modular-tutorials/send-payments/create-trust-line-send-currency.md rename to docs/tutorials/python/send-payments/create-trust-line-send-currency.md index 0101c55e65..92e0851284 100644 --- a/docs/tutorials/python/modular-tutorials/send-payments/create-trust-line-send-currency.md +++ b/docs/tutorials/python/send-payments/create-trust-line-send-currency.md @@ -221,7 +221,7 @@ Return the result. ### configure_account -This example shows how to set and clear configuration flags using the `AccountSet` method. The `ASF_DEFAULT_RIPPLE` flag is pertinent to experimentation with transfer of issued currencies to third-party accounts, so it is demonstrated here. You can set any of the configuration flags using the same structure, substituting the particular flags you want to set. See [AccountSet Flags](../../../../references/protocol/transactions/types/accountset.md#accountset-flags). +This example shows how to set and clear configuration flags using the `AccountSet` method. The `ASF_DEFAULT_RIPPLE` flag is pertinent to experimentation with transfer of issued currencies to third-party accounts, so it is demonstrated here. You can set any of the configuration flags using the same structure, substituting the particular flags you want to set. See [AccountSet Flags](../../../references/protocol/transactions/types/accountset.md#accountset-flags). Send the account seed and a Boolean value for whether to enable or disable rippling. ```python diff --git a/docs/tutorials/python/send-payments/index.md b/docs/tutorials/python/send-payments/index.md new file mode 100644 index 0000000000..79308d2270 --- /dev/null +++ b/docs/tutorials/python/send-payments/index.md @@ -0,0 +1,22 @@ +--- +html: send-payments-using-python.html +parent: modular-tutorials-in-python.html +seo: + description: Use a Python test harness to send XRP,trade currencies, and more. +labels: + - Accounts + - Cross-Currency + - Non-fungible Tokens, NFTs + - Payments + - Quickstart + - Tokens + - XRP +metadata: + indexPage: true +--- +# Send Payments Using Python + +Send XRP and issued currency on the XRP Ledger using JavaScript. + + +{% child-pages /%} diff --git a/docs/tutorials/python/send-payments/send-and-cash-checks.md b/docs/tutorials/python/send-payments/send-and-cash-checks.md new file mode 100644 index 0000000000..342edac643 --- /dev/null +++ b/docs/tutorials/python/send-payments/send-and-cash-checks.md @@ -0,0 +1,662 @@ +--- +html: send-and-cash-checks.html +parent: send-payments-using-python.html +labels: + - Accounts + - Quickstart + - Transaction Sending + - Checks + - XRP +--- +# Send and Cash Checks + +This example shows how to: + +1. Send a check to transfer XRP or issued currency to another account. +2. Get a list of checks you have sent or received. +3. Cash a check received from another account. +4. Cancel a check you have sent. + +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. +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. + + +[![Empty Check Form](/docs/img/quickstart-py-checks1.png)](/docs/img/quickstart-py-checks1.png) + +## Prerequisites + +If you haven't done so already, create a new folder on your local disk and install the Python library using `pip`. + +``` + pip3 install xrpl-py +``` + +Clone or download the [Modular Tutorial Samples](https://github.com/XRPLF/xrpl-dev-portal/tree/master/content/_code-samples/quickstart/py/){.github-code-download}. + +**Note:** Without the Quickstart Samples, you will not be able to try the examples that follow. + +## Usage + +To get test accounts: + +1. Open and launch `lesson10-check.py`. +2. Click **Get Standby Account**. +3. Click **Get Operational Account**. +4. Click **Get Standby Account Info**. +5. Click **Get Operational Account Info**. +5. Copy and paste the **Standby Seed** and **Operational Seed** fields to a persistent location, such as a Notepad, so that you can reuse the accounts after reloading the form. + +[![Form with New Accounts](/docs/img/quickstart-py-checks2.png)](/docs/img/quickstart-py-checks2.png) + +You can transfer XRP between your new accounts. Each account has its own fields and buttons. + +
+ +
+ +### Send a Check for XRP + +To send a check for XRP from the Standby account to the Operational account: + +1. On the Standby (left) side of the form, enter the **Amount** of XRP to send in drops. +2. Copy and paste the **Operational Account** field to the Standby **Destination** field. +3. Set the **Currency** to _XRP_. +4. Click **Send Check**. + +[![Send Check Settings](/docs/img/quickstart-py-checks3.png)](/docs/img/quickstart-py-checks3.png) + +### Send a Check for an Issued Currency + +To send a check for an issued currency token from the Standby account to the Operational account: + +1. On the Standby side of the form, enter the **Amount** of currency to send. +2. Copy and paste the **Operational Account** field to the Standby **Destination** field. +3. Copy the **Standby Account** field and paste the value in the **Issuer** field. +4. Enter the **Currency** code for your token. +5. Click **Send Check**. + +[![Send Token Check Settings](/docs/img/quickstart-py-checks4.png)](/docs/img/quickstart-py-checks4.png) + + +### 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. + +[![Get Checks with index highlighted](/docs/img/quickstart-py-checks5.png)](/docs/img/quickstart-py-checks5.png) + +### Cash Check + +To cash a check you have received: + +1. Enter the **Check ID** (**index** value). +2. Enter the **Amount** you want to collect, up to the full amount of the check. +3. Enter the currency code. + a. If you cashing a check for XRP, enter _XRP_ in the **Currency** field. + b. If you are cashing a check for an issued currency token: + 1. Enter the **Issuer** of the token. + 2. Enter the **Currency** code for the token. +4. Click **Cash Check**. + +[![Cashed check results](/docs/img/quickstart-py-checks6.png)](/docs/img/quickstart-py-checks6.png) + + +### Get Balances + +Click **Get Balances** to get a list of obligations and assets for each account. + +[![Account Balances](/docs/img/quickstart-py-checks7.png)](/docs/img/quickstart-py-checks7.png) + +### Cancel Check + +To cancel a check you have previously sent to another account. + +1. Enter the **Check ID** (**index** value). +2. Click **Cancel Check**. + +[![Canceled check results](/docs/img/quickstart-py-checks8.png)](/docs/img/quickstart-py-checks8.png) + + +# Code Walkthrough + +You can download the [Quickstart Samples](https://github.com/XRPLF/xrpl-dev-portal/tree/master/content/_code-samples/quickstart/py/){.github-code-download} in the source repository for this website. + +## mod10.py + +Import dependencies. + +```python +import xrpl +from xrpl.clients import JsonRpcClient +from xrpl.wallet import Wallet +from datetime import datetime +from xrpl.models.transactions import CheckCreate, CheckCash, CheckCancel +from xrpl.models.requests import AccountObjects, AccountTx, GatewayBalances +``` + +Set the TestNet URL. + +```python +testnet_url = "https://s.altnet.rippletest.net:51234" +``` +### send_check + +Pass the arguments for the account seed, check amount, and destination account. Set the currency type to _XRP_, or if it is an issued currency token provide the currency type and issuer. + +```python +def send_check(seed, amount, destination, currency, issuer): + """send_check""" +``` + +Instantiate the account wallet and create a client connection. + +```python + wallet=Wallet.from_seed(seed) + client=JsonRpcClient(testnet_url) +``` + +Create the amount variable. If you are sending XRP, the amount variable is fine as is. If you are sending issued currency, you need to create an amount object that includes the currency and the issuer. + +```python + if currency != "XRP": + amount = {"value": amount, + "currency": currency, + "issuer": issuer + } +``` + +Define the `CheckCreate` transaction. + +```python + check_tx=xrpl.models.transactions.CheckCreate( + account=wallet.address, + send_max=amount, + destination=destination + ) +``` + +Submit the transaction and report the results. + +```python + reply="" + try: + response=xrpl.transaction.submit_and_wait(check_tx,client,wallet) + reply=response.result + except xrpl.transaction.XRPLReliableSubmissionException as e: + reply=f"Submit failed: {e}" + return reply +``` + +### cash_check + +Pass the values for seed, amount, and check_id. Set the currency type to _XRP_, or include the currency type and issuer. + +```python +def cash_check(seed, amount, check_id, currency, issuer): + """cash_check""" +``` + +Instantiate the account wallet and create a client connection. + +```python + wallet=Wallet.from_seed(seed) + client=JsonRpcClient(testnet_url) +``` + +If using an issued currency token, create an amount object that includes the currency type and issuer. + +```python + if currency != "XRP": + amount = { + "value": amount, + "currency": currency, + "issuer": issuer + } +``` + +Define the CheckCash transaction. + +```python + finish_tx=xrpl.models.transactions.CheckCash( + account=wallet.address, + amount=amount, + check_id=check_id + ) +``` + +Submit the transaction and report the results. + +```python + reply="" + try: + response=xrpl.transaction.submit_and_wait(finish_tx,client,wallet) + reply=response.result + except xrpl.transaction.XRPLReliableSubmissionException as e: + reply=f"Submit failed: {e}" + return reply +``` + +### cancel_check + +Pass the values for the account seed and the check ID. + +```python +def cancel_check(seed, check_id): + """cancel_check""" +``` + +Instantiate the account wallet and create a client connection. + +```python + wallet=Wallet.from_seed(seed) + client=JsonRpcClient(testnet_url) +``` + +Define the CheckCancel transaction. + +```python + cancel_tx=xrpl.models.transactions.CheckCancel( + account=wallet.address, + check_id=check_id + ) +``` + +Submit the transaction and report the results + +```python + reply="" + try: + response=xrpl.transaction.submit_and_wait(cancel_tx,client,wallet) + reply=response.result + except xrpl.transaction.XRPLReliableSubmissionException as e: + reply=f"Submit failed: {e}" + return reply +``` + +### get_checks + +```python +def get_checks(account): + """get_checks""" +``` + +Create a client connection. + +```python + client=JsonRpcClient(testnet_url) +``` + +Define the AccountObjects request, specifying the type _check_. + +```python + acct_checks=AccountObjects( + account=account, + ledger_index="validated", + type="check" + ) +``` + +Send the request and report the results. + +```python + response=client.request(acct_checks) + return response.result +``` + +## lesson10-check.py + +This example builds on `lesson2-send-currency.py`. Changes are noted below. + +```python +import tkinter as tk +import xrpl +import json + +from mod1 import get_account, get_account_info, send_xrp +from mod2 import get_balance +``` + +Import check-specific functions. + +```python +from mod10 import send_check, cash_check, cancel_check, get_checks + +############################################# +## Handlers ################################# +############################################# +``` + +Add handlers for module 10. + +```python +## Mod 10 Handlers + +def standby_send_check(): + results=send_check( + ent_standby_seed.get(), + ent_standby_amount.get(), + ent_standby_destination.get(), + ent_standby_currency.get(), + ent_standby_issuer.get() + ) + text_standby_results.delete("1.0", tk.END) + text_standby_results.insert("1.0", json.dumps(results, indent=4)) + +def standby_cash_check(): + results=cash_check( + ent_standby_seed.get(), + ent_standby_amount.get(), + ent_standby_check_id.get(), + ent_standby_currency.get(), + ent_standby_issuer.get() + ) + text_standby_results.delete("1.0", tk.END) + text_standby_results.insert("1.0", json.dumps(results, indent=4)) + +def standby_cancel_check(): + results=cancel_check( + ent_standby_seed.get(), + ent_standby_check_id.get() + ) + text_standby_results.delete("1.0", tk.END) + text_standby_results.insert("1.0", json.dumps(results, indent=4)) + +def standby_get_checks(): + results=get_checks( + ent_standby_account.get(), + ) + text_standby_results.delete("1.0", tk.END) + text_standby_results.insert("1.0", json.dumps(results, indent=4)) + +def standby_get_balance(): + results=get_balance( + ent_standby_seed.get(), + ent_operational_seed.get() + ) + text_standby_results.delete("1.0", tk.END) + text_standby_results.insert("1.0", json.dumps(results, indent=4)) + +def operational_send_check(): + results=send_check( + ent_operational_seed.get(), + ent_operational_amount.get(), + ent_operational_destination.get(), + ent_operational_currency.get(), + ent_operational_issuer.get() + ) + text_operational_results.delete("1.0", tk.END) + text_operational_results.insert("1.0", json.dumps(results, indent=4)) + +def operational_cash_check(): + results=cash_check( + ent_operational_seed.get(), + ent_operational_amount.get(), + ent_operational_check_id.get(), + ent_operational_currency.get(), + ent_operational_issuer.get() + ) + text_operational_results.delete("1.0", tk.END) + text_operational_results.insert("1.0", json.dumps(results, indent=4)) + +def operational_cancel_check(): + results=cancel_check( + ent_operational_seed.get(), + ent_operational_check_id.get() + ) + text_operational_results.delete("1.0", tk.END) + text_standby_results.insert("1.0", json.dumps(results, indent=4)) + +def operational_get_checks(): + results=get_checks( + ent_operational_account.get(), + ) + text_operational_results.delete("1.0", tk.END) + text_operational_results.insert("1.0", json.dumps(results, indent=4)) + +def operational_get_balance(): + results=get_balance( + ent_operational_seed.get(), + ent_standby_seed.get() + ) + text_operational_results.delete("1.0", tk.END) + text_operational_results.insert("1.0", json.dumps(results, indent=4)) + +## Mod 1 Handlers + +def get_standby_account(): + new_wallet=get_account(ent_standby_seed.get()) + ent_standby_account.delete(0, tk.END) + ent_standby_seed.delete(0, tk.END) + ent_standby_account.insert(0, new_wallet.classic_address) + ent_standby_seed.insert(0, new_wallet.seed) + + +def get_standby_account_info(): + accountInfo=get_account_info(ent_standby_account.get()) + ent_standby_balance.delete(0, tk.END) + ent_standby_balance.insert(0,accountInfo['Balance']) + text_standby_results.delete("1.0", tk.END) + text_standby_results.insert("1.0",json.dumps(accountInfo, indent=4)) + + +def standby_send_xrp(): + response=send_xrp(ent_standby_seed.get(),ent_standby_amount.get(), + ent_standby_destination.get()) + text_standby_results.delete("1.0", tk.END) + text_standby_results.insert("1.0",json.dumps(response.result, indent=4)) + get_standby_account_info() + get_operational_account_info() + + +def get_operational_account(): + new_wallet=get_account(ent_operational_seed.get()) + ent_operational_account.delete(0, tk.END) + ent_operational_account.insert(0, new_wallet.classic_address) + ent_operational_seed.delete(0, tk.END) + ent_operational_seed.insert(0, new_wallet.seed) + + +def get_operational_account_info(): + accountInfo=get_account_info(ent_operational_account.get()) + ent_operational_balance.delete(0, tk.END) + ent_operational_balance.insert(0,accountInfo['Balance']) + text_operational_results.delete("1.0", tk.END) + text_operational_results.insert("1.0",json.dumps(accountInfo, indent=4)) + + +def operational_send_xrp(): + response=send_xrp(ent_operational_seed.get(),ent_operational_amount.get(), + ent_operational_destination.get()) + text_operational_results.delete("1.0", tk.END) + text_operational_results.insert("1.0",json.dumps(response.result,indent=4)) + get_standby_account_info() + get_operational_account_info() + + +# Create a new window with the title "Check Example" +window=tk.Tk() +window.title("Check Example") + +# Form frame +frm_form=tk.Frame(relief=tk.SUNKEN, borderwidth=3) +frm_form.pack() + +# Create the Label and Entry widgets for "Standby Account" +lbl_standy_seed=tk.Label(master=frm_form, text="Standby Seed") +ent_standby_seed=tk.Entry(master=frm_form, width=50) +lbl_standby_account=tk.Label(master=frm_form, text="Standby Account") +ent_standby_account=tk.Entry(master=frm_form, width=50) +lbl_standby_balance=tk.Label(master=frm_form, text="XRP Balance") +ent_standby_balance=tk.Entry(master=frm_form, width=50) +lbl_standy_amount=tk.Label(master=frm_form, text="Amount") +ent_standby_amount=tk.Entry(master=frm_form, width=50) +lbl_standby_destination=tk.Label(master=frm_form, text="Destination") +ent_standby_destination=tk.Entry(master=frm_form, width=50) +``` + +Add fields for _Issuer_ and _Check ID_. + +```python +lbl_standby_issuer=tk.Label(master=frm_form, text="Issuer") +ent_standby_issuer=tk.Entry(master=frm_form, width=50) +lbl_standby_check_id=tk.Label(master=frm_form, text="Check ID") +ent_standby_check_id=tk.Entry(master=frm_form, width=50) +lbl_standby_currency=tk.Label(master=frm_form, text="Currency") +ent_standby_currency=tk.Entry(master=frm_form, width=50) +lbl_standby_results=tk.Label(master=frm_form, text="Results") +text_standby_results=tk.Text(master=frm_form, height=20, width=65) + +# Place fields in a grid. +lbl_standy_seed.grid(row=0, column=0, sticky="e") +ent_standby_seed.grid(row=0, column=1) +lbl_standby_account.grid(row=2, column=0, sticky="e") +ent_standby_account.grid(row=2, column=1) +lbl_standby_balance.grid(row=3, column=0, sticky="e") +ent_standby_balance.grid(row=3, column=1) +lbl_standy_amount.grid(row=4, column=0, sticky="e") +ent_standby_amount.grid(row=4, column=1) +lbl_standby_destination.grid(row=5, column=0, sticky="e") +ent_standby_destination.grid(row=5, column=1) +``` + +Place the _Issuer_ and _Check ID_ fields in the grid. + +```python +lbl_standby_issuer.grid(row=6, column=0, sticky="e") +ent_standby_issuer.grid(row=6, column=1) +lbl_standby_check_id.grid(row=7, column=0, sticky="e") +ent_standby_check_id.grid(row=7, column=1) +lbl_standby_currency.grid(row=8, column=0, sticky="e") +ent_standby_currency.grid(row=8, column=1) +lbl_standby_results.grid(row=9, column=0, sticky="ne") +text_standby_results.grid(row=9, column=1, sticky="nw") + +############################################### +## Operational Account ######################## +############################################### + +# Create the Label and Entry widgets for "Operational Account" + +lbl_operational_seed=tk.Label(master=frm_form, text="Operational Seed") +ent_operational_seed=tk.Entry(master=frm_form, width=50) +lbl_operational_account=tk.Label(master=frm_form, text="Operational Account") +ent_operational_account=tk.Entry(master=frm_form, width=50) +lbl_operational_balance=tk.Label(master=frm_form, text="XRP Balance") +ent_operational_balance=tk.Entry(master=frm_form, width=50) +lbl_operational_amount=tk.Label(master=frm_form, text="Amount") +ent_operational_amount=tk.Entry(master=frm_form, width=50) +lbl_operational_destination=tk.Label(master=frm_form, text="Destination") +ent_operational_destination=tk.Entry(master=frm_form, width=50) +``` + +Add fields for the _Issuer_ and _Check ID_. + +```python +lbl_operational_issuer=tk.Label(master=frm_form, text="Issuer") +ent_operational_issuer=tk.Entry(master=frm_form, width=50) +lbl_operational_check_id=tk.Label(master=frm_form, text="Check ID") +ent_operational_check_id=tk.Entry(master=frm_form, width=50) +lbl_operational_currency=tk.Label(master=frm_form, text="Currency") +ent_operational_currency=tk.Entry(master=frm_form, width=50) +lbl_operational_results=tk.Label(master=frm_form,text='Results') +text_operational_results=tk.Text(master=frm_form, height=20, width=65) + +#Place the widgets in a grid +lbl_operational_seed.grid(row=0, column=4, sticky="e") +ent_operational_seed.grid(row=0, column=5, sticky="w") +lbl_operational_account.grid(row=2,column=4, sticky="e") +ent_operational_account.grid(row=2,column=5, sticky="w") +lbl_operational_balance.grid(row=3, column=4, sticky="e") +ent_operational_balance.grid(row=3, column=5, sticky="w") +lbl_operational_amount.grid(row=4, column=4, sticky="e") +ent_operational_amount.grid(row=4, column=5, sticky="w") +lbl_operational_destination.grid(row=5, column=4, sticky="e") +ent_operational_destination.grid(row=5, column=5, sticky="w") +``` + +Place the _Issuer_ and _Check ID_ fields in the grid. + +```python +lbl_operational_issuer.grid(row=6, column=4, sticky="e") +ent_operational_issuer.grid(row=6, column=5, sticky="w") +lbl_operational_check_id.grid(row=7, column=4, sticky="e") +ent_operational_check_id.grid(row=7, column=5, sticky="w") +lbl_operational_currency.grid(row=8, column=4, sticky="e") +ent_operational_currency.grid(row=8, column=5) +lbl_operational_results.grid(row=9, column=4, sticky="ne") +text_operational_results.grid(row=9, column=5, sticky="nw") + +############################################# +## Buttons ################################## +############################################# + +# Create the Get Standby Account Buttons +btn_get_standby_account=tk.Button(master=frm_form, text="Get Standby Account", + command=get_standby_account) +btn_get_standby_account.grid(row=0, column=2, sticky="nsew") +btn_get_standby_account_info=tk.Button(master=frm_form, + text="Get Standby Account Info", + command=get_standby_account_info) +btn_get_standby_account_info.grid(row=1, column=2, sticky="nsew") +btn_standby_send_xrp=tk.Button(master=frm_form, text="Send XRP >", + command=standby_send_xrp) +btn_standby_send_xrp.grid(row=2, column=2, sticky="nsew") +``` + +Add standby buttons for **Send Check**, **Get Checks**, **Cash Check**, **Cancel Check**, and **Get Balances**. + + +```python +btn_standby_send_check=tk.Button(master=frm_form, text="Send Check", + command=standby_send_check) +btn_standby_send_check.grid(row=4, column=2, sticky="nsew") +btn_standby_get_checks=tk.Button(master=frm_form, text="Get Checks", + command=standby_get_checks) +btn_standby_get_checks.grid(row=5, column=2, sticky="nsew") +btn_standby_cash_check=tk.Button(master=frm_form, text="Cash Check", + command=standby_cash_check) +btn_standby_cash_check.grid(row=6, column=2, sticky="nsew") +btn_standby_cancel_check=tk.Button(master=frm_form, text="Cancel Check", + command=standby_cancel_check) +btn_standby_cancel_check.grid(row=7, column=2, sticky="nsew") +btn_standby_get_balances=tk.Button(master=frm_form, text="Get Balances", + command=standby_get_balance) +btn_standby_get_balances.grid(row=8, column=2, sticky="nsew") + +# Create the Operational Account Buttons +btn_get_operational_account=tk.Button(master=frm_form, + text="Get Operational Account", + command=get_operational_account) +btn_get_operational_account.grid(row=0, column=3, sticky="nsew") +btn_get_op_account_info=tk.Button(master=frm_form, text="Get Op Account Info", + command=get_operational_account_info) +btn_get_op_account_info.grid(row=1, column=3, sticky="nsew") +btn_op_send_xrp=tk.Button(master=frm_form, text="< Send XRP", + command=operational_send_xrp) +btn_op_send_xrp.grid(row=2, column=3, sticky="nsew") +``` + +Add operational buttons for **Send Check**, **Get Checks**, **Cash Check**, **Cancel Check**, and **Get Balances**. + + +```javascript +btn_op_send_check=tk.Button(master=frm_form, text="Send Check", + command=operational_send_check) +btn_op_send_check.grid(row=4, column=3, sticky="nsew") +btn_op_get_checks=tk.Button(master=frm_form, text="Get Checks", + command=operational_get_checks) +btn_op_get_checks.grid(row=5, column=3, sticky="nsew") +btn_op_cash_check=tk.Button(master=frm_form, text="Cash Check", + command=operational_cash_check) +btn_op_cash_check.grid(row=6, column=3, sticky="nsew") +btn_op_cancel_check=tk.Button(master=frm_form, text="Cancel Check", + command=operational_cancel_check) +btn_op_cancel_check.grid(row=7, column=3, sticky="nsew") +btn_op_get_balances=tk.Button(master=frm_form, text="Get Balances", + command=operational_get_balance) +btn_op_get_balances.grid(row=8, column=3, sticky="nsew") + +# Start the application +window.mainloop() +``` \ No newline at end of file diff --git a/docs/use-cases/defi/algorithmic-trading.md b/docs/use-cases/defi/algorithmic-trading.md index 8eace8814a..961ceae1b7 100644 --- a/docs/use-cases/defi/algorithmic-trading.md +++ b/docs/use-cases/defi/algorithmic-trading.md @@ -72,9 +72,9 @@ The legal requirements for trading on a blockchain vary by jurisdiction. In many ### Placing Trades -Buying and selling _fungible_ tokens and XRP within the XRP Ledger's decentralized exchange typically involves sending [OfferCreate transactions](../../references/protocol/transactions/types/offercreate.md). For a detailed walkthrough of the code and technical steps to place a trade this way, see [Trade in the Decentralized Exchange](../../tutorials/tasks/use-tokens/trade-in-the-decentralized-exchange.md). It is also possible to exchange currencies using the [Payment transaction type](../../references/protocol/transactions/types/payment.md). You could send a [cross-currency payment](../../concepts/payment-types/cross-currency-payments.md) to another user or even send it back to yourself, using a long [path](../../concepts/tokens/fungible-tokens/paths.md) to link arbitrage opportunities together into a single operation. +Buying and selling _fungible_ tokens and XRP within the XRP Ledger's decentralized exchange typically involves sending [OfferCreate transactions](../../references/protocol/transactions/types/offercreate.md). For a detailed walkthrough of the code and technical steps to place a trade this way, see [Trade in the Decentralized Exchange](../../tutorials/how-tos/use-tokens/trade-in-the-decentralized-exchange.md). It is also possible to exchange currencies using the [Payment transaction type](../../references/protocol/transactions/types/payment.md). You could send a [cross-currency payment](../../concepts/payment-types/cross-currency-payments.md) to another user or even send it back to yourself, using a long [path](../../concepts/tokens/fungible-tokens/paths.md) to link arbitrage opportunities together into a single operation. -Non-fungible tokens work differently; for the code and technical steps to trade NFTs, see [Transfer NFTokens Using JavaScript](../../tutorials/javascript/modular-tutorials/nfts/transfer-nfts.md). +Non-fungible tokens work differently; for the code and technical steps to trade NFTs, see [Transfer NFTokens Using JavaScript](../../tutorials/javascript/nfts/transfer-nfts.md). ### Reading Trade Data diff --git a/docs/use-cases/defi/list-xrp-as-an-exchange.md b/docs/use-cases/defi/list-xrp-as-an-exchange.md index 1ee9537191..534e17167b 100644 --- a/docs/use-cases/defi/list-xrp-as-an-exchange.md +++ b/docs/use-cases/defi/list-xrp-as-an-exchange.md @@ -614,9 +614,9 @@ Off-Ledger Balances