mirror of
https://github.com/XRPLF/xrpl-dev-portal.git
synced 2025-11-22 20:55:50 +00:00
Merge commit '6e7a8b8ad389845d792b6798bf7b8ddebb7b540c' into ja-multisig
This commit is contained in:
@@ -8,7 +8,7 @@ labels:
|
||||
# account_lines
|
||||
[[Source]](https://github.com/ripple/rippled/blob/master/src/ripple/rpc/handlers/AccountLines.cpp "Source")
|
||||
|
||||
The `account_lines` method returns information about an account's trust lines, including balances in all non-XRP currencies and assets. All information retrieved is relative to a particular version of the ledger.
|
||||
The `account_lines` method returns information about an account's trust lines, which contain balances in all non-XRP currencies and assets. All information retrieved is relative to a particular version of the ledger.
|
||||
|
||||
## Request Format
|
||||
|
||||
|
||||
@@ -21,6 +21,7 @@ The types of objects that may appear in the `account_objects` response for an ac
|
||||
- [Check objects](check.html) for pending Checks.
|
||||
- [DepositPreauth objects](depositpreauth-object.html) for deposit preauthorizations. [New in: rippled 1.1.0][]
|
||||
- [Ticket objects](known-amendments.html#tickets) for Tickets.
|
||||
- [NFTokenPage objects](nftokenpage.html) for collections of NFTs.
|
||||
|
||||
|
||||
## Request Format
|
||||
|
||||
@@ -251,6 +251,8 @@ The response follows the [standard format][], with a successful result containin
|
||||
| `state` | Array | Array of JSON objects containing data from the ledger's state tree, as defined below. |
|
||||
| `marker` | [Marker][] | Server-defined value indicating the response is paginated. Pass this to the next call to resume where this call left off. |
|
||||
|
||||
If a `type` field is mentioned in the request, the `state` array will be empty if the first set of array objects does not match the type requested. In such cases, you can use the `marker` from this response to paginate and retrieve further data.
|
||||
|
||||
The format of each object in the `state` array depends on whether `binary` was set to true or not in the request. Each `state` object may include the following fields:
|
||||
|
||||
| `Field` | Type | Description |
|
||||
|
||||
@@ -1,261 +0,0 @@
|
||||
---
|
||||
html: amm_info.html
|
||||
parent: path-and-order-book-methods.html
|
||||
blurb: Get info about an Automted Market Maker (AMM) instance.
|
||||
status: not_enabled
|
||||
labels:
|
||||
- 分散型取引所
|
||||
- クロスカレンシー
|
||||
- AMM
|
||||
---
|
||||
# amm_info
|
||||
[[Source]](https://github.com/gregtatcam/rippled/blob/amm-core-functionality/src/ripple/rpc/handlers/AMMInfo.cpp "Source")
|
||||
<!-- TODO: Update source link to merged version when available -->
|
||||
|
||||
`{{currentpage.name}}` メソッドは、自動マーケットメーカー(AMM)インスタンスに関する情報を取得します。
|
||||
|
||||
{% include '_snippets/amm-disclaimer.ja.md' %}
|
||||
|
||||
|
||||
### リクエストのフォーマット
|
||||
|
||||
リクエストの例
|
||||
|
||||
{% include '_snippets/no-cli-syntax.ja.md' %}
|
||||
|
||||
<!-- MULTICODE_BLOCK_START -->
|
||||
|
||||
*WebSocket*
|
||||
|
||||
```json
|
||||
{
|
||||
"command": "{{currentpage.name}}",
|
||||
"asset": {
|
||||
"currency": "XRP"
|
||||
},
|
||||
"asset2": {
|
||||
"currency": "TST",
|
||||
"issuer": "rP9jPyP5kyvFRb6ZiRghAGw5u8SGAmU4bd"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
*JSON-RPC*
|
||||
|
||||
```json
|
||||
{
|
||||
"method": "{{currentpage.name}}",
|
||||
"params": [{
|
||||
"asset": {
|
||||
"currency": "XRP"
|
||||
},
|
||||
"asset2": {
|
||||
"currency": "TST",
|
||||
"issuer": "rP9jPyP5kyvFRb6ZiRghAGw5u8SGAmU4bd"
|
||||
}
|
||||
}]
|
||||
}
|
||||
```
|
||||
|
||||
<!-- MULTICODE_BLOCK_END -->
|
||||
|
||||
[試してみる>](websocket-api-tool.html?server=wss%3A%2F%2Famm.devnet.rippletest.net%3A51233%2F#amm_info)
|
||||
|
||||
リクエストには以下のパラメーターが含まれます。
|
||||
|
||||
| `フィールド` | 型 | 説明 |
|
||||
|:-----------|:-----------------------|:-----------------------------------|
|
||||
| `asset` | オブジェクト または 文字列 | [通貨額][Currency Amount]のように、`currency`と`issuer`フィールドを持つオブジェクトとして(XRPの場合は`issuer`を省略)、検索するAMMの資産の一つを指定します。XRPの場合は、オブジェクトではなく文字列`XRP`として指定することができます。 |
|
||||
| `asset2` | オブジェクト または 文字列 | AMMの資産のもう一方を、`currency`と`issuer`フィールド(XRPの場合は`issuer`を省略)を持つオブジェクトとして、[通貨額][Currency Amount]のように指定することが可能です。 |
|
||||
|
||||
|
||||
### レスポンスのフォーマット
|
||||
|
||||
|
||||
処理が成功したレスポンスの例:
|
||||
|
||||
<!-- MULTICODE_BLOCK_START -->
|
||||
|
||||
*WebSocket*
|
||||
|
||||
```json
|
||||
{
|
||||
"result": {
|
||||
"amm": {
|
||||
"amm_account": "rp9E3FN3gNmvePGhYnf414T2TkUuoxu8vM",
|
||||
"amount": "296890496",
|
||||
"amount2": {
|
||||
"currency": "TST",
|
||||
"issuer": "rP9jPyP5kyvFRb6ZiRghAGw5u8SGAmU4bd",
|
||||
"value": "25.81656470648473"
|
||||
},
|
||||
"asset2_frozen": false,
|
||||
"auction_slot": {
|
||||
"account": "rJVUeRqDFNs2xqA7ncVE6ZoAhPUoaJJSQm",
|
||||
"auth_accounts": [
|
||||
{
|
||||
"account": "r3f2WpQMsAd8k4Zoijv2PZ78EYFJ2EdvgV"
|
||||
},
|
||||
{
|
||||
"account": "rnW8FAPgpQgA6VoESnVrUVJHBdq9QAtRZs"
|
||||
}
|
||||
],
|
||||
"discounted_fee": 0,
|
||||
"expiration": "2023-Jan-26 00:28:40.000000000 UTC",
|
||||
"price": {
|
||||
"currency": "039C99CD9AB0B70B32ECDA51EAAE471625608EA2",
|
||||
"issuer": "rp9E3FN3gNmvePGhYnf414T2TkUuoxu8vM",
|
||||
"value": "0"
|
||||
},
|
||||
"time_interval": 0
|
||||
},
|
||||
"lp_token": {
|
||||
"currency": "039C99CD9AB0B70B32ECDA51EAAE471625608EA2",
|
||||
"issuer": "rp9E3FN3gNmvePGhYnf414T2TkUuoxu8vM",
|
||||
"value": "87533.41976112682"
|
||||
},
|
||||
"trading_fee": 600,
|
||||
"vote_slots": [
|
||||
{
|
||||
"account": "rJVUeRqDFNs2xqA7ncVE6ZoAhPUoaJJSQm",
|
||||
"trading_fee": 600,
|
||||
"vote_weight": 9684
|
||||
}
|
||||
]
|
||||
},
|
||||
"ledger_current_index": 316725,
|
||||
"validated": false
|
||||
},
|
||||
"status": "success",
|
||||
"type": "response"
|
||||
}
|
||||
```
|
||||
|
||||
*JSON-RPC*
|
||||
|
||||
```json
|
||||
200 OK
|
||||
|
||||
{
|
||||
"result": {
|
||||
"amm": {
|
||||
"amm_account": "rp9E3FN3gNmvePGhYnf414T2TkUuoxu8vM",
|
||||
"amount": "296890496",
|
||||
"amount2": {
|
||||
"currency": "TST",
|
||||
"issuer": "rP9jPyP5kyvFRb6ZiRghAGw5u8SGAmU4bd",
|
||||
"value": "25.81656470648473"
|
||||
},
|
||||
"asset2_frozen": false,
|
||||
"auction_slot": {
|
||||
"account": "rJVUeRqDFNs2xqA7ncVE6ZoAhPUoaJJSQm",
|
||||
"auth_accounts": [
|
||||
{
|
||||
"account": "r3f2WpQMsAd8k4Zoijv2PZ78EYFJ2EdvgV"
|
||||
},
|
||||
{
|
||||
"account": "rnW8FAPgpQgA6VoESnVrUVJHBdq9QAtRZs"
|
||||
}
|
||||
],
|
||||
"discounted_fee": 0,
|
||||
"expiration": "2023-Jan-26 00:28:40.000000000 UTC",
|
||||
"price": {
|
||||
"currency": "039C99CD9AB0B70B32ECDA51EAAE471625608EA2",
|
||||
"issuer": "rp9E3FN3gNmvePGhYnf414T2TkUuoxu8vM",
|
||||
"value": "0"
|
||||
},
|
||||
"time_interval": 0
|
||||
},
|
||||
"lp_token": {
|
||||
"currency": "039C99CD9AB0B70B32ECDA51EAAE471625608EA2",
|
||||
"issuer": "rp9E3FN3gNmvePGhYnf414T2TkUuoxu8vM",
|
||||
"value": "87533.41976112682"
|
||||
},
|
||||
"trading_fee": 600,
|
||||
"vote_slots": [
|
||||
{
|
||||
"account": "rJVUeRqDFNs2xqA7ncVE6ZoAhPUoaJJSQm",
|
||||
"trading_fee": 600,
|
||||
"vote_weight": 9684
|
||||
}
|
||||
]
|
||||
},
|
||||
"ledger_current_index": 316745,
|
||||
"status": "success",
|
||||
"validated": false
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
<!-- MULTICODE_BLOCK_END -->
|
||||
|
||||
レスポンスは[標準フォーマット][]に従っており、成功した場合は以下のフィールドを含みます。
|
||||
|
||||
| フィールド | 型 | 説明 |
|
||||
|:-----------------------|:---------------------|:----------------------------------------------------------|
|
||||
| `amm` | オブジェクト | リクエストに含まれる資産ペアの[**AMM詳細オブジェクト**](#amm詳細オブジェクト)です。 |
|
||||
| `ledger_current_index` | [レジャーインデックス][] | _(`ledger_index`の指定がある場合は省略)_ この情報を取得する際に使用された、現在の進行中の台帳の[レジャーインデックス][]。 |
|
||||
| `ledger_hash` | [ハッシュ][] | _(`ledger_current_index`の指定がある場合は省略)_ この情報を取得する際に使用された台帳のバージョンの識別ハッシュ。 |
|
||||
| `ledger_index` | [レジャーインデックス][] | _(`ledger_current_index`の指定がある場合は省略_ この情報を取得する際に使用した台帳のバージョンの[レジャーインデックス][]。 |
|
||||
| `validated` | 真偽値 | もし`true`なら、このリクエストに使用された台帳は検証済みで、これらの結果は最終的なものです。もし省略されるか `false` に設定されると、データは未確定で変更される可能性があります。 |
|
||||
|
||||
|
||||
### AMM詳細オブジェクト
|
||||
|
||||
フィールド `amm` は、台帳上の自動マーケットメーカー(AMM)の現在の状態を記述するオブジェクトであり、以下のフィールドを含みます。
|
||||
|
||||
| フィールド | 型 | 説明 |
|
||||
|-----------------|------------|-------------|
|
||||
| `amm_account` | 文字列 | AMMアカウントの[アドレス][]です。 |
|
||||
| `amount` | [通貨額][] | AMMのプールにある1つの資産の合計額。(注記:リクエストに指定した`asset` _または_ `asset2`になります。) |
|
||||
| `amount2` | [通貨額][] | AMMのプール内の他の資産の合計額。(注意:リクエストに指定した`asset` _または_ `asset2`になります。) |
|
||||
| `asset_frozen` | 真偽値 | _(XRPの場合、省略)_ `true`の場合、`amount`の通貨は現在[凍結](freezes.html)されています。 |
|
||||
| `asset2_frozen` | 真偽値 | _(XRPの場合、省略)_ `true`の場合、`amount2`の通貨は現在[凍結](freezes.html)されています。 |
|
||||
| `auction_slot` | オブジェクト | _(省略される場合があります)_ 存在する場合、現在のオークションスロットの所有者を記述した[オークションスロットオブジェクト](#オークションスロットオブジェクト)です。 |
|
||||
| `lp_token` | [通貨額][] | このAMMのLPトークンの発行残高の合計。 |
|
||||
| `trading_fee` | 数値 | AMMの現在の取引手数料。単位は1/100,000で、1は0.001%の手数料に相当します。 |
|
||||
| `vote_slots` | 配列 | _(省略される場合があります)_ AMMの取引手数料に対する現在の投票数。[投票スロットオブジェクト](#投票スロットオブジェクト)として表示されます。 |
|
||||
|
||||
|
||||
### オークションスロットオブジェクト
|
||||
|
||||
`AMM` オブジェクトの `auction_slot` フィールドは、AMMの現在のオークションスロット保持者を表し、以下のフィールドを含みます。
|
||||
|
||||
| フィールド | 型 | 説明 |
|
||||
|------------------|-----------|-------------|
|
||||
| `account` | 文字列 | オークションスロットを所有するアカウントの[アドレス][]です。 |
|
||||
| `auth_accounts` | 配列 | オークションスロットの所有者が、取引手数料の割引の対象として指定した追加アカウントのリスト。この配列の各メンバーは、1つのフィールド `account` を持つオブジェクトで、指定したアカウントのアドレスが含まれています。 |
|
||||
| `discounted_fee` | 数値 | このAMMに対して取引を行う際に、オークションスロットの保有者、および対象となるアカウントに適用される割引後の取引手数料です。これは常に0です。 |
|
||||
| `expiration` | 文字列 | このオークションスロットが期限切れとなるISO8601 UTCタイムスタンプ。期限切れになると、オークションスロットは適用されません (ただし、別のトランザクションで置き換えられるかクリーンアップされるまで、データは台帳に残ります)。 |
|
||||
| `price` | [通貨額][] | オークションスロット所有者がオークションスロットを獲得するために支払った金額(LPトークン単位)です。これは、現在のスロット所有者を競り落とすための価格に影響します。 |
|
||||
| `time_interval` | 数値 | このオークションスロットが現在入っている72分の時間間隔を0から19までで指定します。オークションスロットは24時間後(72分間隔で20回)に失効し、現在の保有者を競り落とすためのコストと、誰かが競り落とした場合に現在の保有者が払い戻される金額に影響します。 |
|
||||
|
||||
|
||||
### 投票スロットオブジェクト
|
||||
|
||||
`vote_slots`配列の各項目は、取引手数料を設定するための流動性供給者の投票権を表し、以下のフィールドを含みます。
|
||||
|
||||
| フィールド | 型 | 説明 |
|
||||
|---------------|-------|-------------|
|
||||
| `account` | 文字列 | この流動性供給者の[アドレス][]。 |
|
||||
| `trading_fee` | 数値 | この流動性供給者が投票した取引手数料。単位は1/100,000です。 |
|
||||
| `vote_weight` | 数値 | この流動性供給者の投票が、最終的な取引手数料にどれだけカウントさ れるかを表します。これは、この流動性供給者がAMMのLPトークンをどれだけ保有しているかに比例します。値は、この流動性供給者が保有するこのLPトークンの数の100,000倍を、発行済LPトークンの総数で割ったものになります。例えば、値が1000の場合、流動性供給者はこのAMMのLPトークンの1%を保有していることを意味します。 |
|
||||
|
||||
|
||||
### 考えられるエラー
|
||||
|
||||
- [汎用エラータイプ][]のすべて。
|
||||
- `actNotFound` - この資産ペアのAMMが存在しないか、リクエストで指定された発行アカウントが存在しません。
|
||||
- `invalidParams` - 1つまたは複数のフィールドの指定に誤りがあるか、1つまたは複数の必須フィールドが欠落しています。
|
||||
|
||||
|
||||
## 関連項目
|
||||
|
||||
- [AMMオブジェクト](amm.html) - AMMオブジェクトの正規の保存形式
|
||||
- [AMMBid][] - オークションスロットと入札の仕組みについての詳細はこちら
|
||||
- [AMMVote][] - 取引手数料の投票メカニズムの詳細はこちら
|
||||
|
||||
<!--{# common link defs #}-->
|
||||
{% include '_snippets/rippled-api-links.md' %}
|
||||
{% include '_snippets/tx-type-links.md' %}
|
||||
{% include '_snippets/rippled_versions.md' %}
|
||||
@@ -1,260 +0,0 @@
|
||||
---
|
||||
html: amm_info.html
|
||||
parent: path-and-order-book-methods.html
|
||||
blurb: Get info about an Automted Market Maker (AMM) instance.
|
||||
status: not_enabled
|
||||
labels:
|
||||
- Decentralized Exchange
|
||||
- Cross-Currency
|
||||
- AMM
|
||||
---
|
||||
# amm_info
|
||||
[[Source]](https://github.com/gregtatcam/rippled/blob/amm-core-functionality/src/ripple/rpc/handlers/AMMInfo.cpp "Source")
|
||||
<!-- TODO: Update source link to merged version when available -->
|
||||
|
||||
The `{{currentpage.name}}` method gets information about an Automated Market Maker (AMM) instance.
|
||||
|
||||
{% include '_snippets/amm-disclaimer.md' %}
|
||||
|
||||
|
||||
### Request Format
|
||||
|
||||
An example of the request format:
|
||||
|
||||
{% include '_snippets/no-cli-syntax.md' %}
|
||||
|
||||
<!-- MULTICODE_BLOCK_START -->
|
||||
|
||||
*WebSocket*
|
||||
|
||||
```json
|
||||
{
|
||||
"command": "{{currentpage.name}}",
|
||||
"asset": {
|
||||
"currency": "XRP"
|
||||
},
|
||||
"asset2": {
|
||||
"currency": "TST",
|
||||
"issuer": "rP9jPyP5kyvFRb6ZiRghAGw5u8SGAmU4bd"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
*JSON-RPC*
|
||||
|
||||
```json
|
||||
{
|
||||
"method": "{{currentpage.name}}",
|
||||
"params": [{
|
||||
"asset": {
|
||||
"currency": "XRP"
|
||||
},
|
||||
"asset2": {
|
||||
"currency": "TST",
|
||||
"issuer": "rP9jPyP5kyvFRb6ZiRghAGw5u8SGAmU4bd"
|
||||
}
|
||||
}]
|
||||
}
|
||||
```
|
||||
|
||||
<!-- MULTICODE_BLOCK_END -->
|
||||
|
||||
[Try it! >](websocket-api-tool.html?server=wss%3A%2F%2Famm.devnet.rippletest.net%3A51233%2F#amm_info)
|
||||
|
||||
The request includes the following parameters:
|
||||
|
||||
| `Field` | Type | Description |
|
||||
|:---------|:-----------------|:-----------------------------------|
|
||||
| `asset` | Object or String | One of the assets of the AMM to look up, as an object with `currency` and `issuer` fields (omit `issuer` for XRP), like [currency amounts][Currency Amount]. For XRP, you can specify as the string `XRP` instead of as an object. |
|
||||
| `asset2` | Object or String | The other of the assets of the AMM, as an object with `currency` and `issuer` fields (omit `issuer` for XRP), like [currency amounts][Currency Amount]. |
|
||||
|
||||
|
||||
### Response Format
|
||||
|
||||
An example of a successful response:
|
||||
|
||||
<!-- MULTICODE_BLOCK_START -->
|
||||
|
||||
*WebSocket*
|
||||
|
||||
```json
|
||||
{
|
||||
"result": {
|
||||
"amm": {
|
||||
"amm_account": "rp9E3FN3gNmvePGhYnf414T2TkUuoxu8vM",
|
||||
"amount": "296890496",
|
||||
"amount2": {
|
||||
"currency": "TST",
|
||||
"issuer": "rP9jPyP5kyvFRb6ZiRghAGw5u8SGAmU4bd",
|
||||
"value": "25.81656470648473"
|
||||
},
|
||||
"asset2_frozen": false,
|
||||
"auction_slot": {
|
||||
"account": "rJVUeRqDFNs2xqA7ncVE6ZoAhPUoaJJSQm",
|
||||
"auth_accounts": [
|
||||
{
|
||||
"account": "r3f2WpQMsAd8k4Zoijv2PZ78EYFJ2EdvgV"
|
||||
},
|
||||
{
|
||||
"account": "rnW8FAPgpQgA6VoESnVrUVJHBdq9QAtRZs"
|
||||
}
|
||||
],
|
||||
"discounted_fee": 0,
|
||||
"expiration": "2023-Jan-26 00:28:40.000000000 UTC",
|
||||
"price": {
|
||||
"currency": "039C99CD9AB0B70B32ECDA51EAAE471625608EA2",
|
||||
"issuer": "rp9E3FN3gNmvePGhYnf414T2TkUuoxu8vM",
|
||||
"value": "0"
|
||||
},
|
||||
"time_interval": 0
|
||||
},
|
||||
"lp_token": {
|
||||
"currency": "039C99CD9AB0B70B32ECDA51EAAE471625608EA2",
|
||||
"issuer": "rp9E3FN3gNmvePGhYnf414T2TkUuoxu8vM",
|
||||
"value": "87533.41976112682"
|
||||
},
|
||||
"trading_fee": 600,
|
||||
"vote_slots": [
|
||||
{
|
||||
"account": "rJVUeRqDFNs2xqA7ncVE6ZoAhPUoaJJSQm",
|
||||
"trading_fee": 600,
|
||||
"vote_weight": 9684
|
||||
}
|
||||
]
|
||||
},
|
||||
"ledger_current_index": 316725,
|
||||
"validated": false
|
||||
},
|
||||
"status": "success",
|
||||
"type": "response"
|
||||
}
|
||||
```
|
||||
|
||||
*JSON-RPC*
|
||||
|
||||
```json
|
||||
200 OK
|
||||
|
||||
{
|
||||
"result": {
|
||||
"amm": {
|
||||
"amm_account": "rp9E3FN3gNmvePGhYnf414T2TkUuoxu8vM",
|
||||
"amount": "296890496",
|
||||
"amount2": {
|
||||
"currency": "TST",
|
||||
"issuer": "rP9jPyP5kyvFRb6ZiRghAGw5u8SGAmU4bd",
|
||||
"value": "25.81656470648473"
|
||||
},
|
||||
"asset2_frozen": false,
|
||||
"auction_slot": {
|
||||
"account": "rJVUeRqDFNs2xqA7ncVE6ZoAhPUoaJJSQm",
|
||||
"auth_accounts": [
|
||||
{
|
||||
"account": "r3f2WpQMsAd8k4Zoijv2PZ78EYFJ2EdvgV"
|
||||
},
|
||||
{
|
||||
"account": "rnW8FAPgpQgA6VoESnVrUVJHBdq9QAtRZs"
|
||||
}
|
||||
],
|
||||
"discounted_fee": 0,
|
||||
"expiration": "2023-Jan-26 00:28:40.000000000 UTC",
|
||||
"price": {
|
||||
"currency": "039C99CD9AB0B70B32ECDA51EAAE471625608EA2",
|
||||
"issuer": "rp9E3FN3gNmvePGhYnf414T2TkUuoxu8vM",
|
||||
"value": "0"
|
||||
},
|
||||
"time_interval": 0
|
||||
},
|
||||
"lp_token": {
|
||||
"currency": "039C99CD9AB0B70B32ECDA51EAAE471625608EA2",
|
||||
"issuer": "rp9E3FN3gNmvePGhYnf414T2TkUuoxu8vM",
|
||||
"value": "87533.41976112682"
|
||||
},
|
||||
"trading_fee": 600,
|
||||
"vote_slots": [
|
||||
{
|
||||
"account": "rJVUeRqDFNs2xqA7ncVE6ZoAhPUoaJJSQm",
|
||||
"trading_fee": 600,
|
||||
"vote_weight": 9684
|
||||
}
|
||||
]
|
||||
},
|
||||
"ledger_current_index": 316745,
|
||||
"status": "success",
|
||||
"validated": false
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
<!-- MULTICODE_BLOCK_END -->
|
||||
|
||||
The response follows the [standard format][], with a successful result containing the following fields:
|
||||
|
||||
| Field | Type | Description |
|
||||
|:-----------------------|:-----------------|:----------------------------------------------------------|
|
||||
| `amm` | Object | An [**AMM Description Object**](#amm-description-object) for the requested asset pair. |
|
||||
| `ledger_current_index` | [Ledger Index][] | _(Omitted if `ledger_index` is provided instead)_ The [ledger index][] of the current in-progress ledger, which was used when retrieving this information. |
|
||||
| `ledger_hash` | [Hash][] | _(Omitted if `ledger_current_index` is provided instead)_ The identifying hash of the ledger version that was used when retrieving this data. |
|
||||
| `ledger_index` | [Ledger Index][] | _(Omitted if `ledger_current_index` is provided instead)_ The [ledger index][] of the ledger version used when retrieving this information. |
|
||||
| `validated` | Boolean | If `true`, the ledger used for this request is validated and these results are final; if omitted or set to `false`, the data is pending and may change. |
|
||||
|
||||
|
||||
### AMM Description Object
|
||||
|
||||
The `amm` field is an object describing the current status of an Automated Market Maker (AMM) in the ledger, and contains the following fields:
|
||||
|
||||
| Field | Type | Description |
|
||||
|-----------------|---------------------|-------------|
|
||||
| `amm_account` | String | The [Address][] of the AMM Account. |
|
||||
| `amount` | [Currency Amount][] | The total amount of one asset in the AMM's pool. (Note: This could be `asset` _or_ `asset2` from the request.) |
|
||||
| `amount2` | [Currency Amount][] | The total amount of the other asset in the AMM's pool. (Note: This could be `asset` _or_ `asset2` from the request.) |
|
||||
| `asset_frozen` | Boolean | _(Omitted for XRP)_ If `true`, the `amount` currency is currently [frozen](freezes.html). |
|
||||
| `asset2_frozen` | Boolean | _(Omitted for XRP)_ If `true`, the `amount2` currency is currently [frozen](freezes.html). |
|
||||
| `auction_slot` | Object | _(May be omitted)_ An [Auction Slot Object](#auction-slot-object) describing the current auction slot holder, if there is one. |
|
||||
| `lp_token` | [Currency Amount][] | The total amount of this AMM's LP Tokens outstanding. |
|
||||
| `trading_fee` | Number | The AMM's current trading fee, in units of 1/100,000; a value of 1 is equivalent to a 0.001% fee. |
|
||||
| `vote_slots` | Array | _(May be omitted)_ The current votes for the AMM's trading fee, as [Vote Slot Objects](#vote-slot-objects). |
|
||||
|
||||
|
||||
### Auction Slot Object
|
||||
|
||||
The `auction_slot` field of the `amm` object describes the current auction slot holder of the AMM, and contains the following fields:
|
||||
|
||||
| Field | Type | Description |
|
||||
|------------------|---------------------|-------------|
|
||||
| `account` | String | The [Address][] of the account that owns the auction slot. |
|
||||
| `auth_accounts` | Array | A list of additional accounts that the auction slot holder has designated as being eligible of the discounted trading fee. Each member of this array is an object with one field, `account`, containing the address of the designated account. |
|
||||
| `discounted_fee` | Number | The discounted trading fee that applies to the auction slot holder, and any eligible accounts, when trading against this AMM. This is always 0. |
|
||||
| `expiration` | String | The ISO 8601 UTC timestamp after which this auction slot expires. After expired, the auction slot does not apply (but the data can remain in the ledger until another transaction replaces it or cleans it up). |
|
||||
| `price` | [Currency Amount][] | The amount, in LP Tokens, that the auction slot holder paid to win the auction slot. This affects the price to outbid the current slot holder. |
|
||||
| `time_interval` | Number | The current 72-minute time interval this auction slot is in, from 0 to 19. The auction slot expires after 24 hours (20 intervals of 72 minutes) and affects the cost to outbid the current holder and how much the current holder is refunded if someone outbids them. |
|
||||
|
||||
|
||||
### Vote Slot Objects
|
||||
|
||||
Each entry in the `vote_slots` array represents one liquidity provider's vote to set the trading fee, and contains the following fields:
|
||||
|
||||
| Field | Type | Description |
|
||||
|---------------|--------|-------------|
|
||||
| `account` | String | The [Address][] of this liquidity provider. |
|
||||
| `trading_fee` | Number | The trading fee this liquidity provider voted for, in units of 1/100,000. |
|
||||
| `vote_weight` | Number | How much this liquidity provider's vote counts towards the final trading fee. This is proportional to how much of the AMM's LP Tokens this liquidity provider holds. The value is equal to 100,000 times the number of this LP Tokens this liquidity provider holds, divided by the total number of LP Tokens outstanding. For example, a value of 1000 means that the liquidity provider holds 1% of this AMM's LP Tokens. |
|
||||
|
||||
|
||||
### Possible Errors
|
||||
|
||||
- Any of the [universal error types][].
|
||||
- `actNotFound` - The AMM for this asset pair does not exist, or an issuing account specified in the request does not exist.
|
||||
- `invalidParams` - One or more fields are specified incorrectly, or one or more required fields are missing.
|
||||
|
||||
|
||||
## See Also
|
||||
|
||||
- [AMM object](amm.html) - The canonical storage format of the AMM object
|
||||
- [AMMBid][] - More info on the auction slot and bidding mechanism
|
||||
- [AMMVote][] - More info on the trading fee voting mechanism
|
||||
|
||||
<!--{# common link defs #}-->
|
||||
{% include '_snippets/rippled-api-links.md' %}
|
||||
{% include '_snippets/tx-type-links.md' %}
|
||||
{% include '_snippets/rippled_versions.md' %}
|
||||
@@ -84,23 +84,23 @@ An example of a successful response:
|
||||
"state_accounting": {
|
||||
"connected": {
|
||||
"duration_us": "301410595",
|
||||
"transitions": 2
|
||||
"transitions": "2"
|
||||
},
|
||||
"disconnected": {
|
||||
"duration_us": "1207534",
|
||||
"transitions": 2
|
||||
"transitions": "2"
|
||||
},
|
||||
"full": {
|
||||
"duration_us": "3589171798767",
|
||||
"transitions": 2
|
||||
"transitions": "2"
|
||||
},
|
||||
"syncing": {
|
||||
"duration_us": "6182323",
|
||||
"transitions": 2
|
||||
"transitions": "2"
|
||||
},
|
||||
"tracking": {
|
||||
"duration_us": "43",
|
||||
"transitions": 2
|
||||
"transitions": "2"
|
||||
}
|
||||
},
|
||||
"time": "2021-Aug-24 20:44:43.466048 UTC",
|
||||
@@ -154,23 +154,23 @@ Headers
|
||||
"state_accounting": {
|
||||
"connected": {
|
||||
"duration_us": "172799714",
|
||||
"transitions": 1
|
||||
"transitions": "1"
|
||||
},
|
||||
"disconnected": {
|
||||
"duration_us": "309059",
|
||||
"transitions": 1
|
||||
"transitions": "1"
|
||||
},
|
||||
"full": {
|
||||
"duration_us": "6020429212246",
|
||||
"transitions": 143
|
||||
"transitions": "143"
|
||||
},
|
||||
"syncing": {
|
||||
"duration_us": "413813232",
|
||||
"transitions": 152
|
||||
"transitions": "152"
|
||||
},
|
||||
"tracking": {
|
||||
"duration_us": "266553605",
|
||||
"transitions": 152
|
||||
"transitions": "152"
|
||||
}
|
||||
},
|
||||
"time": "2021-Aug-24 20:43:43.043406 UTC",
|
||||
@@ -224,23 +224,23 @@ Headers
|
||||
"state_accounting": {
|
||||
"connected": {
|
||||
"duration_us": "172799714",
|
||||
"transitions": 1
|
||||
"transitions": "1"
|
||||
},
|
||||
"disconnected": {
|
||||
"duration_us": "309059",
|
||||
"transitions": 1
|
||||
"transitions": "1"
|
||||
},
|
||||
"full": {
|
||||
"duration_us": "6020429212246",
|
||||
"transitions": 143
|
||||
"transitions": "143"
|
||||
},
|
||||
"syncing": {
|
||||
"duration_us": "413813232",
|
||||
"transitions": 152
|
||||
"transitions": "152"
|
||||
},
|
||||
"tracking": {
|
||||
"duration_us": "266553605",
|
||||
"transitions": 152
|
||||
"transitions": "152"
|
||||
}
|
||||
},
|
||||
"time": "2021-Aug-24 20:43:43.043406 UTC",
|
||||
|
||||
@@ -1,116 +0,0 @@
|
||||
---
|
||||
html: amm.html
|
||||
parent: ledger-object-types.html
|
||||
blurb: 自動マーケットメーカー(AMM)インスタンスの定義と詳細。
|
||||
labels:
|
||||
- AMM
|
||||
status: not_enabled
|
||||
---
|
||||
# AMM
|
||||
[[Source]](https://github.com/xrplf/rippled/blob/c1e4bfb08bcc9f187d794a71d653003a6148dc68/src/ripple/protocol/impl/LedgerFormats.cpp#L265-L275 "Source")
|
||||
<!-- TODO: Update source link to merged version when available -->
|
||||
|
||||
{% include '_snippets/amm-disclaimer.ja.md' %}
|
||||
|
||||
`AMM`オブジェクトは、単一の[自動マーケットメーカー](automated-market-makers.html)(AMM)インスタンスを表します。
|
||||
|
||||
|
||||
## AMM JSONの例
|
||||
|
||||
```json
|
||||
{
|
||||
"AMMAccount" : "rE54zDvgnghAoPopCgvtiqWNq3dU5y836S",
|
||||
"Asset" : {
|
||||
"currency" : "XRP"
|
||||
},
|
||||
"Asset2" : {
|
||||
"currency" : "TST",
|
||||
"issuer" : "rP9jPyP5kyvFRb6ZiRghAGw5u8SGAmU4bd"
|
||||
},
|
||||
"AuctionSlot" : {
|
||||
"Account" : "rJVUeRqDFNs2xqA7ncVE6ZoAhPUoaJJSQm",
|
||||
"AuthAccounts" : [
|
||||
{
|
||||
"AuthAccount" : {
|
||||
"Account" : "rMKXGCbJ5d8LbrqthdG46q3f969MVK2Qeg"
|
||||
}
|
||||
},
|
||||
{
|
||||
"AuthAccount" : {
|
||||
"Account" : "rBepJuTLFJt3WmtLXYAxSjtBWAeQxVbncv"
|
||||
}
|
||||
}
|
||||
],
|
||||
"DiscountedFee" : 0,
|
||||
"Expiration" : 721870180,
|
||||
"Price" : {
|
||||
"currency" : "039C99CD9AB0B70B32ECDA51EAAE471625608EA2",
|
||||
"issuer" : "rE54zDvgnghAoPopCgvtiqWNq3dU5y836S",
|
||||
"value" : "0.8696263565463045"
|
||||
}
|
||||
},
|
||||
"Flags" : 0,
|
||||
"LPTokenBalance" : {
|
||||
"currency" : "039C99CD9AB0B70B32ECDA51EAAE471625608EA2",
|
||||
"issuer" : "rE54zDvgnghAoPopCgvtiqWNq3dU5y836S",
|
||||
"value" : "71150.53584131501"
|
||||
},
|
||||
"TradingFee" : 600,
|
||||
"VoteSlots" : [
|
||||
{
|
||||
"VoteEntry" : {
|
||||
"Account" : "rJVUeRqDFNs2xqA7ncVE6ZoAhPUoaJJSQm",
|
||||
"TradingFee" : 600,
|
||||
"VoteWeight" : 100000
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
## AMM フィールド
|
||||
|
||||
`AMM`オブジェクトは以下のフィールドを持ちます。
|
||||
|
||||
| フィールド | JSONの型 | [内部の型][] | 必須? | 説明 |
|
||||
|:-----------------|:--------------------|:------------------|:----------|--------------|
|
||||
| `Asset` | オブジェクト | STIssue | はい | このAMMが保有する2つのアセットのうちの1つの定義。JSONでは、`currency`と`issuer`フィールドを持つオブジェクトになります。 |
|
||||
| `Asset2` | オブジェクト | STIssue | はい | このAMMが保有するもう一つの資産の定義。JSONでは、`currency`と`issuer`フィールドを持つオブジェクトになります。 |
|
||||
| `AMMAccount` | 文字列 | AccountID | はい | このAMMの資産を保有する[特殊なアカウント](accountroot.html#ammの特殊なaccountrootオブジェクト)のアドレス。 |
|
||||
| `AuctionSlot` | オブジェクト | STObject | いいえ | オークションスロットの現在の所有者の詳細。[オークションスロットオブジェクト](#オークションスロットオブジェクト)形式です。|
|
||||
| `LPTokenBalance` | [通貨額][] | Amount | はい | AMMインスタンスの流動性供給者トークンの発行残高の合計。このトークンの保有者は、保有量に比例してAMMの取引手数料に投票したり、取引手数料の徴収とともに増えていくAMMの資産の一部とトークンを交換したりすることができます。 |
|
||||
| `TradingFee` | 数値 | UInt16 | はい | AMMインスタンスに対する取引に課される手数料のパーセンテージを1/100,000の単位で指定します。最大値は1000で、これは1%の手数料となります。 |
|
||||
| `VoteSlots` | 配列 | STArray | いいえ | プールの取引手数料に関する投票を表す、投票オブジェクトのリスト。|
|
||||
|
||||
### オークションスロットオブジェクト
|
||||
|
||||
`AuctionSlot`フィールドは、以下のネストしたフィールドを持つオブジェクトを含んでいます。
|
||||
|
||||
| フィールド | JSONの型 | [内部の型][] | 必須? | 説明 |
|
||||
|:----------------|:--------------------|:------------------|:----------|:--|
|
||||
| `Account` | 文字列 - アドレス | AccountID | はい | このオークションスロットの現在の所有者。 |
|
||||
| `AuthAccounts` | 配列 | STArray | いいえ | AMMインスタンスに対して取引手数料を割引した価格で取引することを許可された、最大4つの追加アカウントのリスト。 |
|
||||
| `DiscountedFee` | 文字列 | UInt32 | はい | オークションの所有者に請求される取引手数料で、`TradingFee`と同じフォーマットです。デフォルトでは0で、オークションスロットの所有者はAMMの標準的な手数料の代わりに、手数料なしで取引できることを意味します。 |
|
||||
| `Price` | [通貨額][] | Amount | はい | オークションスロットの所有者がこのスロットを落札するために支払った金額(LPトークン)。 |
|
||||
| `Expiration` | 文字列 | UInt32 | はい | このスロットの有効期限が切れる[Rippleエポック以降の経過秒数][]で指定した時刻。 |
|
||||
|
||||
## AMM フラグ
|
||||
|
||||
現在、`AMM`オブジェクトに定義されているフラグはありません。
|
||||
|
||||
## AMM ID フォーマット
|
||||
|
||||
`AMM`オブジェクトのIIは、以下の値の[SHA-512Half][]を順に繋げたものです。
|
||||
|
||||
1. `AMM`のスペースキー(`0x0041`)
|
||||
0. 第1アセットの発行者のAccountID。
|
||||
0. 第1トークンの160ビットの通貨コード。
|
||||
0. 第2アセットの発行者のAccountID。
|
||||
0. 第2トークンの160ビットの通貨コード。
|
||||
|
||||
XRPの場合、トークン・発行者ともに全て0を使用します。
|
||||
|
||||
<!--{# common link defs #}-->
|
||||
{% include '_snippets/rippled-api-links.md' %}
|
||||
{% include '_snippets/tx-type-links.md' %}
|
||||
{% include '_snippets/rippled_versions.md' %}
|
||||
@@ -1,116 +0,0 @@
|
||||
---
|
||||
html: amm.html
|
||||
parent: ledger-object-types.html
|
||||
blurb: The definition and details of an Automated Market Maker (AMM) instance.
|
||||
labels:
|
||||
- AMM
|
||||
status: not_enabled
|
||||
---
|
||||
# AMM
|
||||
[[Source]](https://github.com/gregtatcam/rippled/blob/c1e4bfb08bcc9f187d794a71d653003a6148dc68/src/ripple/protocol/impl/LedgerFormats.cpp#L265-L275 "Source")
|
||||
<!-- TODO: Update source link to merged version when available -->
|
||||
|
||||
{% include '_snippets/amm-disclaimer.md' %}
|
||||
|
||||
The `AMM` object type describes a single [Automated Market Maker](automated-market-makers.html) (AMM) instance.
|
||||
|
||||
|
||||
## Example AMM JSON
|
||||
|
||||
```json
|
||||
{
|
||||
"AMMAccount" : "rE54zDvgnghAoPopCgvtiqWNq3dU5y836S",
|
||||
"Asset" : {
|
||||
"currency" : "XRP"
|
||||
},
|
||||
"Asset2" : {
|
||||
"currency" : "TST",
|
||||
"issuer" : "rP9jPyP5kyvFRb6ZiRghAGw5u8SGAmU4bd"
|
||||
},
|
||||
"AuctionSlot" : {
|
||||
"Account" : "rJVUeRqDFNs2xqA7ncVE6ZoAhPUoaJJSQm",
|
||||
"AuthAccounts" : [
|
||||
{
|
||||
"AuthAccount" : {
|
||||
"Account" : "rMKXGCbJ5d8LbrqthdG46q3f969MVK2Qeg"
|
||||
}
|
||||
},
|
||||
{
|
||||
"AuthAccount" : {
|
||||
"Account" : "rBepJuTLFJt3WmtLXYAxSjtBWAeQxVbncv"
|
||||
}
|
||||
}
|
||||
],
|
||||
"DiscountedFee" : 0,
|
||||
"Expiration" : 721870180,
|
||||
"Price" : {
|
||||
"currency" : "039C99CD9AB0B70B32ECDA51EAAE471625608EA2",
|
||||
"issuer" : "rE54zDvgnghAoPopCgvtiqWNq3dU5y836S",
|
||||
"value" : "0.8696263565463045"
|
||||
}
|
||||
},
|
||||
"Flags" : 0,
|
||||
"LPTokenBalance" : {
|
||||
"currency" : "039C99CD9AB0B70B32ECDA51EAAE471625608EA2",
|
||||
"issuer" : "rE54zDvgnghAoPopCgvtiqWNq3dU5y836S",
|
||||
"value" : "71150.53584131501"
|
||||
},
|
||||
"TradingFee" : 600,
|
||||
"VoteSlots" : [
|
||||
{
|
||||
"VoteEntry" : {
|
||||
"Account" : "rJVUeRqDFNs2xqA7ncVE6ZoAhPUoaJJSQm",
|
||||
"TradingFee" : 600,
|
||||
"VoteWeight" : 100000
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
## AMM Fields
|
||||
|
||||
The `AMM` object has the following fields:
|
||||
|
||||
| Field | JSON Type | [Internal Type][] | Required? | Description |
|
||||
|:-----------------|:--------------------|:------------------|:----------|--------------|
|
||||
| `Asset` | Object | STIssue | Yes | The definition for one of the two assets this AMM holds. In JSON, this is an object with `currency` and `issuer` fields. |
|
||||
| `Asset2` | Object | STIssue | Yes | The definition for the other asset this AMM holds. In JSON, this is an object with `currency` and `issuer` fields. |
|
||||
| `AMMAccount` | String | AccountID | Yes | The address of the [special account](accountroot.html#special-amm-accountroot-objects) that holds this AMM's assets. |
|
||||
| `AuctionSlot` | Object | STObject | No | Details of the current owner of the auction slot, as an [Auction Slot object](#auction-slot-object). |
|
||||
| `LPTokenBalance` | [Currency Amount][] | Amount | Yes | The total outstanding balance of liquidity provider tokens from this AMM instance. The holders of these tokens can vote on the AMM's trading fee in proportion to their holdings, or redeem the tokens for a share of the AMM's assets which grows with the trading fees collected. |
|
||||
| `TradingFee` | Number | UInt16 | Yes | The percentage fee to be charged for trades against this AMM instance, in units of 1/100,000. The maximum value is 1000, for a 1% fee. |
|
||||
| `VoteSlots` | Array | STArray | No | A list of vote objects, representing votes on the pool's trading fee. |
|
||||
|
||||
### Auction Slot Object
|
||||
|
||||
The `AuctionSlot` field contains an object with the following nested fields:
|
||||
|
||||
| Field | JSON Type | [Internal Type][] | Required? | Description |
|
||||
|:----------------|:--------------------|:------------------|:----------|:--|
|
||||
| `Account` | String - Address | AccountID | Yes | The current owner of this auction slot. |
|
||||
| `AuthAccounts` | Array | STArray | No | A list of at most 4 additional accounts that are authorized to trade at the discounted fee for this AMM instance. |
|
||||
| `DiscountedFee` | String | UInt32 | Yes | The trading fee to be charged to the auction owner, in the same format as `TradingFee`. By default this is 0, meaning that the auction owner can trade at no fee instead of the standard fee for this AMM. |
|
||||
| `Price` | [Currency Amount][] | Amount | Yes | The amount the auction owner paid to win this slot, in LP Tokens. |
|
||||
| `Expiration` | String | UInt32 | Yes | The time when this slot expires, in [seconds since the Ripple Epoch][]. |
|
||||
|
||||
## AMM Flags
|
||||
|
||||
There are currently no flags defined for `AMM` objects.
|
||||
|
||||
## AMM ID Format
|
||||
|
||||
The ID of an `AMM` object is the [SHA-512Half][] of the following values, concatenated in order:
|
||||
|
||||
1. The `AMM` space key (`0x0041`)
|
||||
0. The AccountID of the first asset's issuer.
|
||||
0. The 160-bit currency code of the first token.
|
||||
0. The AccountID of the second asset's issuer.
|
||||
0. The 160-bit currency code of the second token.
|
||||
|
||||
For XRP, use all 0's for both the token and the issuer.
|
||||
|
||||
<!--{# common link defs #}-->
|
||||
{% include '_snippets/rippled-api-links.md' %}
|
||||
{% include '_snippets/tx-type-links.md' %}
|
||||
{% include '_snippets/rippled_versions.md' %}
|
||||
@@ -63,7 +63,7 @@ _([Checks Amendment][]が必要です)_
|
||||
* Checkスペースキー(`0x0043`)
|
||||
* `Check`オブジェクトを作成した[CheckCreateトランザクション][]の送信者のAccountID。
|
||||
* `Check`オブジェクトを作成した[CheckCreateトランザクション][]のシーケンス番号。
|
||||
|
||||
CheckCreateトランザクションが[Ticket](tickets.html)を使用する場合は、代わりに`TicketSequence`値を使用します。
|
||||
<!--{# common link defs #}-->
|
||||
{% include '_snippets/rippled-api-links.md' %}
|
||||
{% include '_snippets/tx-type-links.md' %}
|
||||
|
||||
@@ -183,8 +183,8 @@ curated_anchors:
|
||||
| [Hash160][] | 17 | 160 | いいえ | 160ビットの任意のバイナリ値。これにより通貨コードまたはイシュアーが定義されます。 |
|
||||
| [Hash256][] | 5 | 256 | いいえ | 256ビットの任意のバイナリ値。これは通常、トランザクション、レジャーバージョン、またはレジャーデータオブジェクトの「SHA-512ハーフ」ハッシュを表します。 |
|
||||
| [PathSet][] | 18 | 可変 | いいえ | [複数通貨間ペイメント](cross-currency-payments.html)の有効な[ペイメントパス](paths.html)のセット。 |
|
||||
| [STArray][] | 15 | 可変 | いいえ | 可変数のメンバーからなる配列。フィールドによってタイプが異なる場合があります。この例として、[memos](transaction-common-fields.html#memosフィールド)や[マルチシグ](multi-signing.html)で使用される署名者のリストがあります。 |
|
||||
| [STIssue][] | 24 | 320 | いいえ | :not_enabled: An asset definition, XRP or a token, with no quantity.<!-- TODO: translate --> |
|
||||
| [STArray][] | 15 | 可変 | いいえ | 可変数のメンバーからなる配列。フィールドによってタイプが異なる場合があります。この例として、[memos](transaction-common-fields.html#memosフィールド)や[マルチ署名](multi-signing.html)で使用される署名者のリストがあります。 |
|
||||
| [STIssue][] | 24 | 320 | いいえ | :not_enabled: 数量を含まない、資産(XRPまたはトークン)を指定します。 |
|
||||
| [STObject][] | 14 | 可変 | いいえ | 1つ以上のネストされたフィールドを含むオブジェクト。 |
|
||||
| [UInt8][] | 16 | 8 | いいえ | 8ビットの符号なし整数。 |
|
||||
| [UInt16][] | 1 | 16 | いいえ | 16ビットの符号なし整数。`TransactionType`は、このタイプの特殊なフィールドで、特定の文字列から整数値へのマッピングを含みます。 |
|
||||
@@ -268,16 +268,20 @@ XRP LedgerのハッシュタイプにはHash128、Hash160、Hash256がありま
|
||||
|
||||
これらのフィールドは、長さインディケーターを使用せずに、ビッグエンディアンバイトオーダーで特定数のビットとしてシリアル化されます。
|
||||
|
||||
<!--
|
||||
### Issueフィールド
|
||||
[STIssue]: #issueフィールド
|
||||
[STIssue]: #issueフィールド -->
|
||||
<!-- TODO: translate this section -->
|
||||
|
||||
<!--
|
||||
_(The "Issue" or "STIssue" type is part of multiple proposed extensions to the XRP Ledger protocol, including [XLS-30d: Automated Market Maker](https://github.com/XRPLF/XRPL-Standards/discussions/78) :not_enabled: and [Federated Sidechains](federated-sidechains.html) :not_enabled:)_
|
||||
-->
|
||||
|
||||
<!--
|
||||
Some fields specify a _type_ of asset, which could be XRP or a fungible [token](tokens.html), without an amount. These fields have consist of two 160-bit segments in order:
|
||||
|
||||
1. The first 160 bits are the [currency code](currency-formats.html#通貨コード) of the asset. For XRP, this is all 0's.
|
||||
2. The next 160 bits are the [AccountID of the token issuer](#accountidフィールド). For XRP, this is all 0's.
|
||||
2. The next 160 bits are the [AccountID of the token issuer](#accountidフィールド). For XRP, this is all 0's. -->
|
||||
|
||||
### オブジェクトフィールド
|
||||
[STObject]: #オブジェクトフィールド
|
||||
|
||||
@@ -184,7 +184,7 @@ Transaction instructions may contain fields of any of the following types:
|
||||
| [Hash256][] | 5 | 256 | No | A 256-bit arbitrary binary value. This usually represents the "SHA-512Half" hash of a transaction, ledger version, or ledger data object. |
|
||||
| [PathSet][] | 18 | Variable | No | A set of possible [payment paths](paths.html) for a [cross-currency payment](cross-currency-payments.html). |
|
||||
| [STArray][] | 15 | Variable | No | An array containing a variable number of members, which can be different types depending on the field. Two cases of this include [memos](transaction-common-fields.html#memos-field) and lists of signers used in [multi-signing](multi-signing.html). |
|
||||
| [STIssue][] | 24 | 160 or 320 | No | :not_enabled: An asset definition, XRP or a token, with no quantity. |
|
||||
<!-- | [STIssue][] | 24 | 160 or 320 | No | :not_enabled: An asset definition, XRP or a token, with no quantity. | -->
|
||||
| [STObject][] | 14 | Variable | No | An object containing one or more nested fields. |
|
||||
| [UInt8][] | 16 | 8 | No | An 8-bit unsigned integer. |
|
||||
| [UInt16][] | 1 | 16 | No | A 16-bit unsigned integer. The `TransactionType` is a special case of this type, with specific strings mapping to integer values. |
|
||||
@@ -300,15 +300,21 @@ The XRP Ledger has several "hash" types: Hash128, Hash160, and Hash256. These fi
|
||||
|
||||
All such fields are serialized as the specific number of bits, with no length indicator, in big-endian byte order.
|
||||
|
||||
|
||||
<!-- Issue Fields is still under development -->
|
||||
<!--
|
||||
### Issue Fields
|
||||
[STIssue]: #issue-fields
|
||||
|
||||
_(The "Issue" or "STIssue" type is part of multiple proposed extensions to the XRP Ledger protocol, including [XLS-30d: Automated Market Maker](https://github.com/XRPLF/XRPL-Standards/discussions/78) :not_enabled: and [Federated Sidechains](federated-sidechains.html) :not_enabled:)_ <!-- SPELLING_IGNORE: 30d -->
|
||||
_(The "Issue" or "STIssue" type is part of multiple proposed extensions to the XRP Ledger protocol, including [XLS-30d: Automated Market Maker](https://github.com/XRPLF/XRPL-Standards/discussions/78) :not_enabled: and [Federated Sidechains](federated-sidechains.html) :not_enabled:)_ -->
|
||||
|
||||
<!-- SPELLING_IGNORE: 30d -->
|
||||
|
||||
<!--
|
||||
Some fields specify a _type_ of asset, which could be XRP or a fungible [token](tokens.html), without an amount. These fields have consist of one or two 160-bit segments in order:
|
||||
|
||||
1. The first 160 bits are the [currency code](#currency-codes) of the asset. For XRP, this is all 0's.
|
||||
2. If the first 160 bits are all 0's (the asset is XRP), the field ends there. Otherwise, the asset is a token and the next 160 bits are the [AccountID of the token issuer](#accountid-fields).
|
||||
2. If the first 160 bits are all 0's (the asset is XRP), the field ends there. Otherwise, the asset is a token and the next 160 bits are the [AccountID of the token issuer](#accountid-fields). -->
|
||||
|
||||
|
||||
### Object Fields
|
||||
|
||||
@@ -7,7 +7,7 @@ labels:
|
||||
---
|
||||
# AccountSet
|
||||
|
||||
[[ソース]](https://github.com/ripple/rippled/blob/f65cea66ef99b1de149c02c15f06de6c61abf360/src/ripple/app/transactors/SetAccount.cpp "ソース")
|
||||
[[ソース]](https://github.com/XRPLF/rippled/blob/f65cea66ef99b1de149c02c15f06de6c61abf360/src/ripple/app/transactors/SetAccount.cpp "ソース")
|
||||
|
||||
AccountSetトランザクションは、[XRP Ledgerのアカウント](accountroot.html)のプロパティーを修正します。
|
||||
|
||||
@@ -29,23 +29,18 @@ AccountSetトランザクションは、[XRP Ledgerのアカウント](accountro
|
||||
<!--{# fix md highlighting_ #}-->
|
||||
|
||||
|
||||
| フィールド | JSONの型 | [内部の型][] | 説明 |
|
||||
| フィールド | JSONの型 | [内部の型][] | 説明 |
|
||||
|:-----------------|:-----------------|:------------------|:-------------------|
|
||||
| [ClearFlag][] | 数値 | UInt32 | _(省略可)_ このアカウントについてオプションを無効にするためのフラグの一意識別子。 |
|
||||
| [Domain][] | 文字列 | Blob | _(省略可)_ このアカウントを保有するドメインのASCII小文字を表現する16進文字列。 |
|
||||
| EmailHash | 文字列 | Hash128 | _(省略可)_ アバターイメージの生成に使用されるメールアドレスのハッシュ。一般的に、クライアントは[Gravatar](http://en.gravatar.com/site/implement/hash/)を使用してこのイメージを表示しています。 |
|
||||
| MessageKey | 文字列 | Blob | _(省略可)_ 暗号化されたメッセージをこのアカウントに送信するための公開鍵。 |
|
||||
| [SetFlag][] | 数値 | UInt32 | _(省略可)_ このアカウントについてオプションを有効にするための整数フラグ。 |
|
||||
| [TransferRate][] | 符号なし整数 | UInt32 | _(省略可)_ ユーザーがこのアカウントの発行済み通貨を送金するときに請求される手数料。通貨単位の10億分の1で表現されます。手数料なしを意味する特殊なケースの`0`を除いて、`2000000000`より大きくしたり、`1000000000`より小さくしたりすることはできません。 |
|
||||
| [TickSize][] | 符号なし整数 | UInt8 | _(省略可)_このアドレスによって発行されている通貨が関係するオファーに使用する為替レートの呼値の単位。それらのオファーの為替レートは、この有効桁数へと丸められます。有効な値は`3`から`15`、または無効にするための`0`です_([TickSize Amendment][]が必要です)。_ |
|
||||
| WalletLocator | 文字列 | Hash256 | _(省略可)_ 使用されません。 |
|
||||
| WalletSize | 数値 | UInt32 | _(省略可)_ 使用されません。 |
|
||||
|
||||
[ClearFlag]: #accountsetのフラグ
|
||||
[Domain]: #domain
|
||||
[SetFlag]: #accountsetのフラグ
|
||||
[TickSize]: ticksize.html
|
||||
[TransferRate]: accountset.html#transferrate
|
||||
| [`ClearFlag`](#accountsetのフラグ) | 数値 | UInt32 | _(省略可)_ このアカウントについてオプションを無効にするためのフラグの一意識別子。 |
|
||||
| [`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をミントする](authorize-minter.html)ことができる別のアカウント。 _([NonFungibleTokensV1_1 amendment][]によって追加されました.)_ |
|
||||
| [`SetFlag`](#accountsetのフラグ) | 数値 | UInt32 | _(省略可)_ このアカウントについてオプションを有効にするための整数フラグ。 |
|
||||
| [`TransferRate`](#transferrate) | 符号なし整数 | UInt32 | _(省略可)_ ユーザーがこのアカウントの発行済み通貨を送金するときに請求される手数料。通貨単位の10億分の1で表現されます。手数料なしを意味する特殊なケースの`0`を除いて、`2000000000`より大きくしたり、`1000000000`より小さくしたりすることはできません。 |
|
||||
| [`TickSize`](ticksize.html) | 符号なし整数 | UInt8 | _(省略可)_このアドレスによって発行されている通貨が関係するオファーに使用する為替レートの呼値の単位。それらのオファーの為替レートは、この有効桁数へと丸められます。有効な値は`3`から`15`、または無効にするための`0`です_([TickSize Amendment][]によって追加されました)。_ |
|
||||
| `WalletLocator` | 文字列 | Hash256 | _(省略可)_ 任意の256ビット値です。指定された場合、この値はアカウントの設定の一部として保存さ れますが、固有の定義や要件を持ちません。 |
|
||||
| `WalletSize` | 数値 | UInt32 | _(省略可)_ 使用されません。このフィールドはAccountSetトランザクションで有効ですが、何の機能もありません。。 |
|
||||
|
||||
これらのオプションがいずれも指定されていない場合、AccountSetトランザクションは(取引コストの消却以外に)意味がありません。詳細は、[トランザクションのキャンセルまたはスキップ](cancel-or-skip-a-transaction.html)を参照してください。
|
||||
|
||||
@@ -58,8 +53,7 @@ AccountSetトランザクションは、[XRP Ledgerのアカウント](accountro
|
||||
アカウントの`Domain`フィールドには任意のドメインを挿入できます。アカウントとドメインが同一の人物または企業に属していることを証明するには、「双方向リンク」を確立することをお勧めします。
|
||||
|
||||
- 所有するアカウントに対して、所有するドメインを`Domain`フィールドで設定します。
|
||||
- そのドメインのWebサイトで、所有アカウントをリストするテキストファイルをホスティングし、必要に応じて、XRP Ledgerの用途に関するその他の情報も記述します。慣例上、このファイルの名前は`ripple.txt`とします。
|
||||
**注意:** 中間者攻撃を防止するには、最新のTLS証明書を使用してHTTPSでWebサイトを提供します。
|
||||
- そのドメインのWebサイトで、所有アカウントをリストするテキストファイルをホスティングし、必要に応じて、XRP Ledgerの用途に関するその他の情報も記述します。慣例上、このファイルの名前は[xrp-ledger.toml file](xrp-ledger-toml.html)とします。
|
||||
|
||||
## AccountSetのフラグ
|
||||
|
||||
@@ -75,30 +69,35 @@ AccountSetトランザクションは、[XRP Ledgerのアカウント](accountro
|
||||
|
||||
使用できるAccountSetのフラグは、以下のとおりです。
|
||||
|
||||
| フラグの名前 | 10進値 | 対応するレジャーフラグ | 説明 |
|
||||
|:-----------------|:--------------|:--------------------------|:--------------|
|
||||
| asfAccountTxnID | 5 | (なし) | このアカウントの直近のトランザクションのIDを追跡します。[AccountTxnID](transaction-common-fields.html#accounttxnid)については必須です。 |
|
||||
| asfDefaultRipple | 8 | lsfDefaultRipple | このアカウントのトラストラインでの[リップリング](rippling.html)をデフォルトで有効にします。[新規: rippled 0.27.3][] |
|
||||
| asfDepositAuth | 9 | lsfDepositAuth | このアカウントに対して[Deposit Authorization](depositauth.html)を有効にします _([DepositAuth Amendment][]が必要)。_ |
|
||||
| asfDisableMaster | 4 | lsfDisableMaster | マスターキーペアの使用を禁止します。[レギュラーキー](cryptographic-keys.html)や[署名者リスト](multi-signing.html)など、トランザクションに署名するための別の手段がアカウントで設定されている場合のみ有効にできます。 |
|
||||
| asfDisallowXRP | 3 | lsfDisallowXRP | XRPがこのアカウントに送信されないようにします(`rippled`ではなくクライアントアプリケーションによって履行されます)。 |
|
||||
| asfGlobalFreeze | 7 | lsfGlobalFreeze | このアカウントによって発行されたすべての資産を[凍結](freezes.html)します。 |
|
||||
| asfNoFreeze | 6 | lsfNoFreeze | [個々のトラストラインの凍結またはGlobal Freezeの無効化](freezes.html)の機能を永続的に放棄します。このフラグは、有効にした後は無効にできません。 |
|
||||
| asfRequireAuth | 2 | lsfRequireAuth | このアドレスによって発行された残高をユーザーが保持することについて、承認を要求します。アドレスにトラストラインが接続されていない場合のみ有効にできます。 |
|
||||
| asfRequireDest | 1 | lsfRequireDestTag | トランザクションをこのアカウントに送信するための宛先タグを要求します。 |
|
||||
| フラグの名前 | 10進値 | 対応するレジャーフラグ | 説明 |
|
||||
|:----------------------------------|:------|:----------------------------------|:--------------|
|
||||
| `asfAccountTxnID` | 5 | (なし) | このアカウントの直近のトランザクションのIDを追跡します。[AccountTxnID](transaction-common-fields.html#accounttxnid)については必須です。 |
|
||||
| `asfAuthorizedNFTokenMinter` | 10 | (なし) | このアカウントの代わりに、別のアカウントが非代替性トークン(NFToken)をミントすることを許可するために使用します。認可されたアカウントを[AccountRoot](accountroot.html)オブジェクトの`NFTokenMinter`フィールドで指定します。認可されたアカウントを削除するには、このフラグを有効にして`NFTokenMinter`フィールドを省略します。 _([NonFungibleTokensV1_1 amendment][]によって追加されました。)_ |
|
||||
| `asfDefaultRipple` | 8 | `lsfDefaultRipple` | このアカウントのトラストラインでの[リップリング](rippling.html)をデフォルトで有効にします。 |
|
||||
| `asfDepositAuth` | 9 | `lsfDepositAuth` | このアカウントに対して[Deposit Authorization](depositauth.html)を有効にします _([DepositAuth Amendment][]によって追加されました)。_ |
|
||||
| `asfDisableMaster` | 4 | `lsfDisableMaster` | マスターキーペアの使用を禁止します。[レギュラーキー](cryptographic-keys.html)や[署名者リスト](multi-signing.html)など、トランザクションに署名するための別の手段がアカウントで設定されている場合のみ有効にできます。 |
|
||||
| `asfDisallowIncomingCheck` | 13 | `lsfDisallowIncomingCheck` | チェックの着信をブロックします。_([DisallowIncoming amendment][] :not_enabled: が必要です。)_ |
|
||||
| `asfDisallowIncomingNFTokenOffer` | 12 | `lsfDisallowIncomingNFTokenOffer` | NFTokenOffersの着信をブロックします。_([DisallowIncoming amendment][] :not_enabled: が必要です)_。 |
|
||||
| `asfDisallowIncomingPayChan` | 14 | `lsfDisallowIncomingPayChan` | ペイメントチャネルの着信をブロックします。_([DisallowIncoming amendment][] :not_enabled: が必要です)_。 |
|
||||
| `asfDisallowIncomingTrustline` | 15 | `lsfDisallowIncomingTrustline` | トラストラインの着信をブロックします。_([DisallowIncoming amendment][] :not_enabled: が必要です)_。 |
|
||||
| `asfDisallowXRP` | 3 | `lsfDisallowXRP` | XRPがこのアカウントに送信されないようにします(勧告的なもので、XRP Ledgerのプロトコルでは強制されません)。 |
|
||||
| `asfGlobalFreeze` | 7 | `lsfGlobalFreeze` | このアカウントによって発行されたすべての資産を[凍結](freezes.html)します。 |
|
||||
| `asfNoFreeze` | 6 | `lsfNoFreeze` | [個々のトラストラインの凍結またはGlobal Freezeの無効化](freezes.html)の機能を永続的に放棄します。このフラグは、有効にした後は無効にできません。 |
|
||||
| `asfRequireAuth` | 2 | `lsfRequireAuth` | このアドレスによって発行された残高をユーザーが保持することについて、承認を要求します。アドレスにトラストラインが接続されていない場合のみ有効にできます。 |
|
||||
| `asfRequireDest` | 1 | `lsfRequireDestTag` | トランザクションをこのアカウントに送信するための宛先タグを要求します。 |
|
||||
|
||||
`asfDisableMaster`フラグまたは`asfNoFreeze`フラグを有効にするには、マスターキーペアで署名することによって[トランザクションを承認](transaction-basics.html#トランザクションの承認)する必要があります。レギュラーキーペアやマルチシグを使用することはできません。レギュラーキーペアまたはマルチシグを使用すると、`asfDisableMaster`を無効にする(つまり、マスターキーペアを再び有効にする)ことができます。[新規: rippled 0.28.0][]
|
||||
`asfDisableMaster`フラグまたは`asfNoFreeze`フラグを有効にするには、マスターキーペアで署名することによって[トランザクションを承認](transaction-basics.html#トランザクションの承認)する必要があります。レギュラーキーペアやマルチ署名を使用することはできません。レギュラーキーペアまたはマルチ署名を使用すると、`asfDisableMaster`を無効にする(つまり、マスターキーペアを再び有効にする)ことができます。[新規: rippled 0.28.0][]
|
||||
|
||||
以下の[トランザクションフラグ](transaction-common-fields.html#flagsフィールド)はAccountSetタイプのトランザクションに固有のもので、同様の目的を果たしますが、使用することはお勧めしません。
|
||||
以下の[トランザクションフラグ](transaction-common-fields.html#flagsフィールド)はAccountSetタイプのトランザクションに固有のもので、同様の目的を果たしますが、使用することはお勧めしません。限られたスペースのため、いくつかの設定には関連する `tf` フラグがありません。また、新しい `tf` フラグは `AccountSet` トランザクションタイプには追加されていません。一つのトランザクションで複数の設定を有効にするには、`tf`フラグと`asf`フラグを組み合わせて使用することができます。
|
||||
|
||||
| フラグの名前 | 16進値 | 10進値 | 後継のAccountSetのフラグ |
|
||||
|:------------------|:-----------|:--------------|:----------------------------|
|
||||
| tfRequireDestTag | 0x00010000 | 65536 | asfRequireDest(SetFlag) |
|
||||
| tfOptionalDestTag | 0x00020000 | 131072 | asfRequireDest(ClearFlag) |
|
||||
| tfRequireAuth | 0x00040000 | 262144 | asfRequireAuth(SetFlag) |
|
||||
| tfOptionalAuth | 0x00080000 | 524288 | asfRequireAuth(ClearFlag) |
|
||||
| tfDisallowXRP | 0x00100000 | 1048576 | asfDisallowXRP(SetFlag) |
|
||||
| tfAllowXRP | 0x00200000 | 2097152 | asfDisallowXRP(ClearFlag) |
|
||||
| フラグの名前 | 16進値 | 10進値 | 後継のAccountSetのフラグ |
|
||||
|:--------------------|:-------------|:--------------|:----------------------------|
|
||||
| `tfRequireDestTag` | `0x00010000` | 65536 | asfRequireDest(SetFlag) |
|
||||
| `tfOptionalDestTag` | `0x00020000` | 131072 | asfRequireDest(ClearFlag) |
|
||||
| `tfRequireAuth` | `0x00040000` | 262144 | asfRequireAuth(SetFlag) |
|
||||
| `tfOptionalAuth` | `0x00080000` | 524288 | asfRequireAuth(ClearFlag) |
|
||||
| `tfDisallowXRP` | `0x00100000` | 1048576 | asfDisallowXRP(SetFlag) |
|
||||
| `tfAllowXRP` | `0x00200000` | 2097152 | asfDisallowXRP(ClearFlag) |
|
||||
|
||||
**注意:** トランザクションに含まれている`tf`フラグと`asf`フラグの数値は、レジャーに含まれている静的なアカウントに設定された値と合致しません。レジャーに含まれているアカウントのフラグを読み取るには、[`AccountRoot`フラグ](accountroot.html#accountrootのフラグ)を参照してください。
|
||||
|
||||
@@ -111,11 +110,24 @@ AccountSetトランザクションは、[XRP Ledgerのアカウント](accountro
|
||||
|
||||
XRP以外の通貨に関しては、それらの通貨のトラストラインを作成しないことで、無用な支払いの受入れを防止できます。XRPでは信頼が必須ではないことから、ユーザーによるアカウントへのXRPの送金を抑止するには、`asfDisallowXRP`フラグを使用します。ただし、このフラグによってアカウントが使用不可になる場合があるため、`rippled`では適用されません(このフラグを無効にしたトランザクションを送信するための十分なXRPがアカウントになかった場合、アカウントは完全に使用不可になります)。代わりに、クライアントアプリケーションでは、`asfDisallowXRP`フラグが有効なアカウントへのXRPの支払いを禁止または抑止します。
|
||||
|
||||
_すべての_ 支払いの着信をブロックしたい場合、[Deposit Authorization](depositauth.html)を有効にすることができます。これは、あなたのアカウントが[準備金要件](reserves.html)を下回らない限り、たとえXRPであっても、あらゆるトランザクションからの送金をブロックします。
|
||||
|
||||
[DisallowIncoming amendment][] :not_enabled: が有効化されている場合、着信するすべてのチェック、NFTokenOffer、ペイメントチャネル、およびトラストラインをブロックするオプションもあります。これらのオブジェクトを着信することは一般的に無害ですが、アカウントを削除することができなくなる場合があり、自分が作成したオブジェクトのリストに予期しないオブジェクトが混ざり混乱することがあります。オブジェクトの着信をブロックするには、次のアカウントフラグのいずれかを使用します。
|
||||
|
||||
- `asfDisallowIncomingCheck` - チェックオブジェクト用
|
||||
- `asfDisallowIncomingNFTOffer` - NFTokenOfferオブジェクト用
|
||||
- `asfDisallowIncomingPayChan` - PayChannelオブジェクト用
|
||||
- `asfDisallowIncomingTrustline` - RippleState(トラストライン)オブジェクト用
|
||||
|
||||
これらのレジャーエントリを作成するトランザクションが発生する場合、宛先アカウントに対応するフラグが有効になっている場合、トランザクションは`tecNO_PERMISSION`という結果コードで失敗します。Deposit Authorizationとは異なり、これらの設定は一般的に支払いを受け取ることを妨げません。また、この設定を有効にしても、自分自身がこれらのタイプのオブジェクトを作成することを妨げません(もちろん、トランザクションの宛先がこの設定を使用している場合を除きます)。
|
||||
|
||||
## TransferRate
|
||||
|
||||
TransferRateフィールドは、ユーザーの発行する通貨を相手方が送金するときに請求する手数料を指定します。詳細は、[送金手数料](transfer-fees.html)を参照してください。
|
||||
TransferRateフィールドは、ユーザーの発行する通貨を相手方が送金するときに請求する手数料を指定します。
|
||||
|
||||
`rippled`のWebSocketおよびJSON-RPCのAPIでは、TransferRate(相手方に10億単位の通貨を送金するのに必要な金額)は整数で表現します。例えば、送金手数料が20%である場合、値を`1200000000`と表現します。 値を1000000000未満にすることはできません(この値未満にした場合、トランザクションの送信について金銭の引き渡しが発生することになり、攻撃に利用されるおそれがあります)。1000000000の短縮形として、手数料なしを意味する0を指定できます。
|
||||
HTTPおよびWebSocketのAPIでは、TransferRate(相手方に10億単位の通貨を送金するのに必要な金額)は整数で表現します。例えば、送金手数料が20%である場合、値を`1200000000`と表現します。 値を1000000000未満にすることはできません(この値未満にした場合、トランザクションの送信について金銭の引き渡しが発生することになり、攻撃に利用されるおそれがあります)。`1000000000`の短縮形として、手数料なしを意味する`0`を指定できます。
|
||||
|
||||
詳細は、[送金手数料](transfer-fees.html)を参照してください。
|
||||
|
||||
<!--{# common link defs #}-->
|
||||
{% include '_snippets/rippled-api-links.md' %}
|
||||
|
||||
@@ -34,7 +34,7 @@ An AccountSet transaction modifies the properties of an [account in the XRP Ledg
|
||||
| Field | JSON Type | [Internal Type][] | Description |
|
||||
|:-----------------|:-----------------|:------------------|:-------------------|
|
||||
| [`ClearFlag`](#accountset-flags) | Number | UInt32 | _(Optional)_ Unique identifier of a flag to disable for this account. |
|
||||
| [`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/ripple/rippled/blob/55dc7a252e08a0b02cd5aa39e9b4777af3eafe77/src/ripple/app/tx/impl/SetAccount.h#L34) |
|
||||
| [`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](authorize-minter.html). _(Added by the [NonFungibleTokensV1_1 amendment][].)_ |
|
||||
|
||||
@@ -1,139 +0,0 @@
|
||||
---
|
||||
html: ammbid.html
|
||||
parent: transaction-types.html
|
||||
blurb: 自動マーケットメーカーのオークションスロットに入札することで、手数料の割引を受けることができます。
|
||||
labels:
|
||||
- AMM
|
||||
status: not_enabled
|
||||
---
|
||||
# AMMBid
|
||||
[[Source]](https://github.com/gregtatcam/rippled/blob/amm-core-functionality/src/ripple/app/tx/impl/AMMBid.cpp "Source")
|
||||
<!-- TODO: Update source link to merged version when available -->
|
||||
|
||||
{% include '_snippets/amm-disclaimer.ja.md' %}
|
||||
|
||||
[自動マーケットメーカー](automated-market-makers.html)のオークションスロットに入札することができます。落札されると、競り落とされるか24時間が経過するまで、割引料金でAMMと取引することができます。24時間が経過する前に競り落とされた場合、残り時間に応じて落札価格の一部が払い戻されます。
|
||||
|
||||
AMMのLPトークンを使って落札すると、落札額はAMMに返金され、LPトークンの残高が減ります。
|
||||
|
||||
|
||||
## {{currentpage.name}} JSONの例
|
||||
|
||||
```json
|
||||
{
|
||||
"Account" : "rJVUeRqDFNs2xqA7ncVE6ZoAhPUoaJJSQm",
|
||||
"Asset" : {
|
||||
"currency" : "XRP"
|
||||
},
|
||||
"Asset2" : {
|
||||
"currency" : "TST",
|
||||
"issuer" : "rP9jPyP5kyvFRb6ZiRghAGw5u8SGAmU4bd"
|
||||
},
|
||||
"AuthAccounts" : [
|
||||
{
|
||||
"AuthAccount" : {
|
||||
"Account" : "rMKXGCbJ5d8LbrqthdG46q3f969MVK2Qeg"
|
||||
}
|
||||
},
|
||||
{
|
||||
"AuthAccount" : {
|
||||
"Account" : "rBepJuTLFJt3WmtLXYAxSjtBWAeQxVbncv"
|
||||
}
|
||||
}
|
||||
],
|
||||
"BidMax" : {
|
||||
"currency" : "039C99CD9AB0B70B32ECDA51EAAE471625608EA2",
|
||||
"issuer" : "rE54zDvgnghAoPopCgvtiqWNq3dU5y836S",
|
||||
"value" : "100"
|
||||
},
|
||||
"Fee" : "10",
|
||||
"Flags" : 2147483648,
|
||||
"Sequence" : 9,
|
||||
"TransactionType" : "AMMBid"
|
||||
}
|
||||
```
|
||||
|
||||
{% include '_snippets/tx-fields-intro.ja.md' %}
|
||||
|
||||
| フィールド | JSONの型 | [内部の型][] | 必須? | 説明 |
|
||||
|:---------------|:-----------|:- ----------|:----- |:------------|
|
||||
| `Asset` | オブジェクト | STIssue | はい | AMMのプールにある資産の一つを定義します。JSONでは、`currency`と`issuer`フィールドを持つオブジェクトになります(XRPの場合は`issuer`を省略します)。 |
|
||||
| `Asset2` | オブジェクト | STIssue | はい | AMM のプールにあるもう一つのアセットの定義です。JSONでは、`currency`と`issuer`フィールドを持つオブジェクトになります(XRPの場合は`issuer`を省略します)。 |
|
||||
| `BidMin` | [通貨額][] | Amount | いいえ | スロットに支払う最小の金額。この値を高く設定すると、他の人から競り落とされにくくなります。省略された場合は、落札に必要な最低額を支払います。 |
|
||||
| `BidMax` | [通貨額][] | Amount | いいえ | スロットに支払う最大の金額。落札するためのコストがこの金額より高い場合、取引は失敗します。省略された場合は、落札に必要な金額を支払います。 |
|
||||
| `AuthAccounts` | 配列 | STArray | いいえ | 割引料金で取引を許可する最大4つの追加のアカウントのリスト。これには、トランザクション送信者のアドレスは含めることはできません。これらのオブジェクトはそれぞれ[Auth Accountオブジェクト](#auth-accountオブジェクト)である必要があります。. |
|
||||
|
||||
`BidMin` と `BidMax` の両方を指定することはできません。
|
||||
|
||||
### Auth Accountオブジェクト
|
||||
|
||||
`AuthAccounts` 配列の各メンバーは、以下のフィールドを持つオブジェクトである必要があります。
|
||||
|
||||
| フィールド | JSONの型 | [内部の型][] | 必須? | 説明 |
|
||||
|:---------------|:----------|:-------------|:-----|:------------|
|
||||
| `Account` | 文字列 | AccountID | はい | 認可するアカウントのアドレス。 |
|
||||
|
||||
配列に現れる他の「内部オブジェクト」と同様に、これらのオブジェクトのJSON表現は、オブジェクトタイプ`AuthAccount`のみをキーとするオブジェクトにラップされています。
|
||||
|
||||
## オークションスロットの価格
|
||||
|
||||
落札された場合、トランザクションは自動的に前のスロット所有者を競り落とし、送信者のLPトークンから落札価格が引き落とされます。落札価格は、72分ずつ20回に区切られた時間経過とともに減少します。もし送信者が落札するのに十分なLPトークンを持っていなかったり、入札価格がトランザクションの`BidMax`値より高い場合、トランザクションは`tecAMM_FAILED_BID`という結果で失敗します。
|
||||
|
||||
- オークションスロットが現在空であったり、期限切れ、または最後のインターバルである場合、**最低入札価格**はAMMの総LPトークン残高の**0.001%**です。
|
||||
|
||||
**注意:** この最小値は暫定値であり、AMM機能が最終的に完成する前に変更される可能性があります。
|
||||
|
||||
- それ以外の場合、現在の保有者に競り勝つための価格は、以下の式で計算されます。
|
||||
|
||||
P = B × 1.05 × (1 - t⁶⁰) + M
|
||||
|
||||
- `P`: 競り落とすための価格。単位はLPトークン。
|
||||
- `B`: 現在の入札価格。単位はLPトークン。
|
||||
- `t`: 現在の24時間枠で経過した時間の割合。0.05の倍数に切り捨てられる。
|
||||
- `M`: M`は上記で定義された**最低入札価格**。
|
||||
|
||||
競り落とすためのコストには、2つの特殊なケースがあります。誰かが落札してから**最初の時間枠**では、その人を競り落とすための価格は、最低入札価格+既存の入札価格の5%アップとなります。
|
||||
|
||||
P = B × 1.05 + M
|
||||
|
||||
スロットの**最後の時間枠**では、誰かを競り落とすためのコストは最低入札額のみです。
|
||||
|
||||
P = M
|
||||
|
||||
**注記:** 台帳を作成する際に、ネットワーク上のすべてのサーバーが同じ結果になるように、時間の計測は前回の台帳の[正規の終了時刻](ledgers.html#ledger-close-times) に基づいており、これはおおよその目安の時間です。
|
||||
|
||||
## 払い戻し
|
||||
|
||||
アクティブなオークションスロットを競り落とした場合、AMMは以下の計算式で前ホルダーに価格の一部を払い戻します。
|
||||
|
||||
```text
|
||||
R = B × (1 - t)
|
||||
```
|
||||
|
||||
- `R`: は返金する金額。単位はLPトークン。
|
||||
- `B`: 払い戻しの対象となる前回の入札の価格。単位はLPトークン。
|
||||
- `t`: 現在の24時間枠で経過した時間の割合。0.05の倍数に切り捨てられる。
|
||||
|
||||
特殊なケースとして、オークションスロットの最終(20番目)区間では、払い戻し額は0となる。
|
||||
|
||||
**注記:** XRP Ledgerの時刻と同様に、トランザクション処理では _前回の_ 台帳の[正規の終了時刻](ledgers.html#ledger-close-times)を使用するため、実時間と最大で約10秒の差が生じる場合があります。
|
||||
|
||||
|
||||
## エラーケース
|
||||
すべてのトランザクションで発生する可能性のあるエラーに加えて、{{currentpage.name}}トランザクションでは、次の[トランザクション結果コード](transaction-results.html)が発生する可能性があります。
|
||||
|
||||
| エラーコード | 説明 |
|
||||
|:------------------------|:---------------------------------------------|
|
||||
| `tecAMM_FAILED_BID` | このトランザクションでは、送信者が必要な入札額を支払うために十分なLPトークンを保有していないか、落札価格がトランザクションで指定された`BidMax`値より高いため、落札できませんでした。 |
|
||||
| `tecAMM_INVALID_TOKENS` | このトランザクションの送信者は、スロット価格に見合うだけのLPトークンを保有していません。 |
|
||||
| `temBAD_AMM_TOKENS` | 指定された`BidMin`または`BidMax`は、このAMMの正しいLPトークンとして指定されていません。 |
|
||||
| `temBAD_AMM_OPTIONS` | トランザクションが無効なオプションを指定しました。例えば、`AuthAccounts`のリストが長すぎるか、`BidMin`とBidMax` の両方を指定しています。 |
|
||||
| `temDISABLED` | このネットワークでは、AMM機能 :not_enabled: は有効ではありません。 |
|
||||
| `terNO_ACCOUNT` | このリクエストで指定されたアカウントのいずれかが存在しません。 |
|
||||
| `terNO_AMM` | このトランザクションの資産ペアの自動マーケットメーカーのインスタンスが存在しません。 |
|
||||
|
||||
|
||||
<!--{# common link defs #}-->
|
||||
{% include '_snippets/rippled-api-links.md' %}
|
||||
{% include '_snippets/tx-type-links.md' %}
|
||||
{% include '_snippets/rippled_versions.md' %}
|
||||
@@ -1,139 +0,0 @@
|
||||
---
|
||||
html: ammbid.html
|
||||
parent: transaction-types.html
|
||||
blurb: Bid on an Automated Market Maker's auction slot, which grants a discounted fee.
|
||||
labels:
|
||||
- AMM
|
||||
status: not_enabled
|
||||
---
|
||||
# AMMBid
|
||||
[[Source]](https://github.com/gregtatcam/rippled/blob/amm-core-functionality/src/ripple/app/tx/impl/AMMBid.cpp "Source")
|
||||
<!-- TODO: Update source link to merged version when available -->
|
||||
|
||||
{% include '_snippets/amm-disclaimer.md' %}
|
||||
|
||||
Bid on an [Automated Market Maker](automated-market-makers.html)'s (AMM's) auction slot. If you win, you can trade against the AMM at a discounted fee until you are outbid or 24 hours have passed. If you are outbid before 24 hours have passed, you are refunded part of the cost of your bid based on how much time remains.
|
||||
|
||||
You bid using the AMM's LP Tokens; the amount of a winning bid is returned to the AMM, decreasing the outstanding balance of LP Tokens.
|
||||
|
||||
|
||||
## Example {{currentpage.name}} JSON
|
||||
|
||||
```json
|
||||
{
|
||||
"Account" : "rJVUeRqDFNs2xqA7ncVE6ZoAhPUoaJJSQm",
|
||||
"Asset" : {
|
||||
"currency" : "XRP"
|
||||
},
|
||||
"Asset2" : {
|
||||
"currency" : "TST",
|
||||
"issuer" : "rP9jPyP5kyvFRb6ZiRghAGw5u8SGAmU4bd"
|
||||
},
|
||||
"AuthAccounts" : [
|
||||
{
|
||||
"AuthAccount" : {
|
||||
"Account" : "rMKXGCbJ5d8LbrqthdG46q3f969MVK2Qeg"
|
||||
}
|
||||
},
|
||||
{
|
||||
"AuthAccount" : {
|
||||
"Account" : "rBepJuTLFJt3WmtLXYAxSjtBWAeQxVbncv"
|
||||
}
|
||||
}
|
||||
],
|
||||
"BidMax" : {
|
||||
"currency" : "039C99CD9AB0B70B32ECDA51EAAE471625608EA2",
|
||||
"issuer" : "rE54zDvgnghAoPopCgvtiqWNq3dU5y836S",
|
||||
"value" : "100"
|
||||
},
|
||||
"Fee" : "10",
|
||||
"Flags" : 2147483648,
|
||||
"Sequence" : 9,
|
||||
"TransactionType" : "AMMBid"
|
||||
}
|
||||
```
|
||||
|
||||
{% include '_snippets/tx-fields-intro.md' %}
|
||||
|
||||
| Field | JSON Type | [Internal Type][] | Required? | Description |
|
||||
|:---------------|:--------------------|:------------------|:----------|:------------|
|
||||
| `Asset` | Object | STIssue | Yes | The definition for one of the assets in the AMM's pool. In JSON, this is an object with `currency` and `issuer` fields (omit `issuer` for XRP). |
|
||||
| `Asset2` | Object | STIssue | Yes | The definition for the other asset in the AMM's pool. In JSON, this is an object with `currency` and `issuer` fields (omit `issuer` for XRP). |
|
||||
| `BidMin` | [Currency Amount][] | Amount | No | Pay at least this amount for the slot. Setting this value higher makes it harder for others to outbid you. If omitted, pay the minimum necessary to win the bid. |
|
||||
| `BidMax` | [Currency Amount][] | Amount | No | Pay at most this amount for the slot. If the cost to win the bid is higher than this amount, the transaction fails. If omitted, pay as much as necessary to win the bid. |
|
||||
| `AuthAccounts` | Array | STArray | No | A list of up to 4 additional accounts that you allow to trade at the discounted fee. This cannot include the address of the transaction sender. Each of these objects should be an [Auth Account object](#auth-account-objects). |
|
||||
|
||||
You cannot specify both `BidMin` and `BidMax`.
|
||||
|
||||
### Auth Account Objects
|
||||
|
||||
Each member of the `AuthAccounts` array must be an object with the following field:
|
||||
|
||||
| Field | JSON Type | [Internal Type][] | Required? | Description |
|
||||
|:---------------|:----------|:------------------|:----------|:------------|
|
||||
| `Account` | String | AccountID | Yes | The address of the account to authorize. |
|
||||
|
||||
Like other "inner objects" that can appear in arrays, the JSON representation of each of these objects is wrapped in an object whose only key is the object type, `AuthAccount`.
|
||||
|
||||
## Auction Slot Price
|
||||
|
||||
If successful, the transaction automatically outbids the previous slot owner and debits the bid price from the sender's LP Tokens. The price to win the auction decreases over time, divided into 20 intervals of 72 minutes each. If the sender does not have enough LP Tokens to win the bid, or the price of the bid is higher than the transaction's `BidMax` value, the transaction fails with a `tecAMM_FAILED_BID` result.
|
||||
|
||||
- If the auction slot is currently empty, expired, or in its last interval, the **minimum bid** is **0.001% of the AMM's total LP Tokens balance**.
|
||||
|
||||
**Caution:** This minimum value is a placeholder and may change before the AMM feature becomes finalized.
|
||||
|
||||
- Otherwise, the price to outbid the current holder is calculated using the following formula:
|
||||
|
||||
P = B × 1.05 × (1 - t⁶⁰) + M
|
||||
|
||||
- `P` is the price to outbid, in LP Tokens.
|
||||
- `B` is the price of the current bid, in LP Tokens.
|
||||
- `t` is the fraction of time elapsed in the current 24-hour slot, rounded down to a multiple of 0.05.
|
||||
- `M` is the **minimum bid** as defined above.
|
||||
|
||||
There are two special cases for the cost to outbid someone. In the **first interval** after someone wins the bid, the price to outbid them is the minimum bid plus 5% more than the existing bid:
|
||||
|
||||
P = B × 1.05 + M
|
||||
|
||||
In the **last interval** of someone's slot, the cost to outbid someone is only the minimum bid:
|
||||
|
||||
P = M
|
||||
|
||||
**Note:** To make sure all servers in the network reach the same results when building a ledger, time measurements are based on the [official close time](ledgers.html#ledger-close-times) of the previous ledger, which is approximate.
|
||||
|
||||
## Bid Refunds
|
||||
|
||||
When you outbid an active auction slot, the AMM refunds the previous holder part of the price, using this formula:
|
||||
|
||||
```text
|
||||
R = B × (1 - t)
|
||||
```
|
||||
|
||||
- `R` is the amount to refund, in LP Tokens.
|
||||
- `B` is the price of the previous bid to be refunded, in LP Tokens.
|
||||
- `t` is the fraction of time elapsed in the current 24-hour slot, rounded down to a multiple of 0.05.
|
||||
|
||||
As a special case, during the final (20th) interval of the auction slot, the refunded amount is zero.
|
||||
|
||||
**Note:** As with all XRP Ledger times, transaction processing uses the [official close time](ledgers.html#ledger-close-times) of the _previous_ ledger, which can result in a difference of up to about 10 seconds from real time.
|
||||
|
||||
|
||||
## Error Cases
|
||||
Besides errors that can occur for all transactions, {{currentpage.name}} transactions can result in the following [transaction result codes](transaction-results.html):
|
||||
|
||||
| Error Code | Description |
|
||||
|:------------------------|:---------------------------------------------|
|
||||
| `tecAMM_FAILED_BID` | This transaction could not win the auction, either because the sender does not hold enough LP Tokens to pay the necessary bid or because the price to win the auction was higher than the transaction's specified `BidMax` value. |
|
||||
| `tecAMM_INVALID_TOKENS` | The sender of this transaction does not hold enough LP Tokens to meet the slot price. |
|
||||
| `temBAD_AMM_TOKENS` | The specified `BidMin` or `BidMax` were not specified as the correct LP Tokens for this AMM. |
|
||||
| `temBAD_AMM_OPTIONS` | The transaction specified invalid options, such as a list of `AuthAccounts` that is too long, or specifying both `BidMin` and `BidMax`. |
|
||||
| `temDISABLED` | The AMM feature :not_enabled: is not enabled on this network. |
|
||||
| `terNO_ACCOUNT` | One of the accounts specified in this request do not exist. |
|
||||
| `terNO_AMM` | The Automated Market Maker instance for the asset pair in this transaction does not exist. |
|
||||
|
||||
|
||||
<!--{# common link defs #}-->
|
||||
{% include '_snippets/rippled-api-links.md' %}
|
||||
{% include '_snippets/tx-type-links.md' %}
|
||||
{% include '_snippets/rippled_versions.md' %}
|
||||
@@ -1,71 +0,0 @@
|
||||
---
|
||||
html: ammcreate.html
|
||||
parent: transaction-types.html
|
||||
blurb: 指定された資産ペアを取引するための新しい自動マーケットメーカーを作成します。
|
||||
labels:
|
||||
- AMM
|
||||
status: not_enabled
|
||||
---
|
||||
# AMMCreate
|
||||
[[Source]](https://github.com/gregtatcam/rippled/blob/amm-core-functionality/src/ripple/app/tx/impl/AMMCreate.cpp "Source")
|
||||
<!-- TODO: Update source link to merged version when available -->
|
||||
|
||||
{% include '_snippets/amm-disclaimer.ja.md' %}
|
||||
|
||||
資産([代替可能トークン](tokens.html)または[XRP](xrp.html))のペアを取引するための新しい[自動マーケットメーカー](automated-market-makers.html)(AMM)インスタンスを作成します。
|
||||
|
||||
AMMを表す[AMMオブジェクト][]と[特殊なAccountRootオブジェクト](accountroot.html#ammの特殊なaccountrootオブジェクト)を作成します。また、両資産の開始残高の所有権を送信者から、作成された`AccountRoot`に移し、初期残高の流動性プロバイダトークン(LPトークン)をAMMアカウントから送信者に発行します。
|
||||
|
||||
**注意:** AMMを作成する際には、各資産を(ほぼ)同額ずつ投入する必要があります。そうしないと、他のユーザーがあなたの負担において、このAMMを使った取引で利益を得ることができます([アービトラージの実行](https://www.machow.ski/posts/an_introduction_to_automated_market_makers/#price-arbitrage))。流動性供給者が負う通貨リスクは、資産ペアのボラティリティ(不均衡の可能性)が高ければ高いほど、大きくなります。取引手数料が高いほど、このリスクを相殺することになりますので、資産ペアのボラティリティに応じて取引手数料を設定するとよいでしょう。
|
||||
|
||||
## {{currentpage.name}} JSONの例
|
||||
|
||||
```json
|
||||
{
|
||||
"Account" : "rJVUeRqDFNs2xqA7ncVE6ZoAhPUoaJJSQm",
|
||||
"Amount" : {
|
||||
"currency" : "TST",
|
||||
"issuer" : "rP9jPyP5kyvFRb6ZiRghAGw5u8SGAmU4bd",
|
||||
"value" : "25"
|
||||
},
|
||||
"Amount2" : "250000000",
|
||||
"Fee" : "10",
|
||||
"Flags" : 2147483648,
|
||||
"Sequence" : 6,
|
||||
"TradingFee" : 500,
|
||||
"TransactionType" : "AMMCreate"
|
||||
}
|
||||
```
|
||||
|
||||
{% include '_snippets/tx-fields-intro.md' %}
|
||||
<!--{# fix md highlighting_ #}-->
|
||||
|
||||
| フィールド | JSONの型 | [内部の型][] | 必須? | 説明 |
|
||||
|:-------------|:---- -----|:-----------|:------|:------------|
|
||||
| `Amount` | [通貨額][] | Amount | はい | このAMMの最初の資金となる2つの資産のうち、1つ目の資産です。これは正数である必要があります。 |
|
||||
| `Amount2` | [通貨額][] | Amount | はい | このAMMの最初の資金となる2つの資産のうち、2つ目の資産です。これは正数である必要があります。 |
|
||||
| `TradingFee` | 数値 | UInt16 | はい | このAMMインスタンスに対する取引に課される手数料を1/100,000単位で指定します(値1は0.001%に相当)。最大値は`1000`で、1%の手数料を意味します。最小値は `0`です。 |
|
||||
|
||||
`Amount`と`Amount2`の一方または両方は[tokens](tokens.html)であり、最大でどちらか一方を[XRP](xrp.html)にすることが可能です。通貨コードと発行者が同じものは使用できません。AMMのLPトークンは、別のAMMの資産の1つとして使用することができます。
|
||||
|
||||
## エラーケース
|
||||
|
||||
すべてのトランザクションで発生する可能性のあるエラーに加えて、{{currentpage.name}}トランザクションでは、次の[トランザクション結果コード](transaction-results.html)が発生する可能性があります。
|
||||
|
||||
| エラーコード | 説明 |
|
||||
|:--------------------|:---------------------------------------------|
|
||||
| `temDISABLED` | このネットワークでは、AMM機能 :not_enabled: は有効ではありません。 |
|
||||
| `temINVALID_FLAG` | トランザクションに無効な`Flags`値が指定されています。現在、このトランザクションタイプに定義されたフラグはないので、[グローバルフラグ](transaction-common-fields.html#グローバルフラグ)のみが許可されます。 |
|
||||
| `temBAD_AMM_TOKENS` | `Amount`と`Amount2`値が正しくありません。例えば、両方とも同じトークンを参照している場合です。 |
|
||||
| `temBAD_FEE` | `TradingFee`の値が不正です。ゼロまたは正の整数でなければならず、1000を超えることはできません。 |
|
||||
| `terNO_ACCOUNT` | リクエストで参照されたいずれかのアカウントが存在しません。|
|
||||
| `tecNO_AUTH` | 送信者は資産(`Amount`または`Amount2`)のいずれかを保有する権限がありません。 |
|
||||
| `tecNO_LINE` | 送信者は資産(`Amount`または`Amount2`)のうちいずれか1つに対するトラストラインを保有していません。 |
|
||||
| `tecFROZEN` | 資産(`Amount`または`Amount2`)の少なくとも1つが現在[凍結](freezes.html)されています。 |
|
||||
| `tecUNFUNDED_AMM` | 送信者は`Amount`と`Amount2`で指定された金額をAMMに入金するための十分な資金を保有していません。 |
|
||||
| `tecAMM_EXISTS` | この通貨ペアを扱っているAMMが既に存在しています。 |
|
||||
|
||||
<!--{# common link defs #}-->
|
||||
{% include '_snippets/rippled-api-links.md' %}
|
||||
{% include '_snippets/tx-type-links.md' %}
|
||||
{% include '_snippets/rippled_versions.md' %}
|
||||
@@ -1,71 +0,0 @@
|
||||
---
|
||||
html: ammcreate.html
|
||||
parent: transaction-types.html
|
||||
blurb: Create a new Automated Market Maker for trading a given pair of assets.
|
||||
labels:
|
||||
- AMM
|
||||
status: not_enabled
|
||||
---
|
||||
# AMMCreate
|
||||
[[Source]](https://github.com/gregtatcam/rippled/blob/amm-core-functionality/src/ripple/app/tx/impl/AMMCreate.cpp "Source")
|
||||
<!-- TODO: Update source link to merged version when available -->
|
||||
|
||||
{% include '_snippets/amm-disclaimer.md' %}
|
||||
|
||||
Create a new [Automated Market Maker](automated-market-makers.html) (AMM) instance for trading a pair of assets ([fungible tokens](tokens.html) or [XRP](xrp.html)).
|
||||
|
||||
Creates both an [AMM object][] and a [special AccountRoot object](accountroot.html#special-amm-accountroot-objects) to represent the AMM. Also transfers ownership of the starting balance of both assets from the sender to the created `AccountRoot` and issues an initial balance of liquidity provider tokens (LP Tokens) from the AMM account to the sender.
|
||||
|
||||
**Caution:** When you create the AMM, you should fund it with (approximately) equal-value amounts of each asset. Otherwise, other users can profit at your expense by trading with this AMM ([performing arbitrage](https://www.machow.ski/posts/an_introduction_to_automated_market_makers/#price-arbitrage)). The currency risk that liquidity providers take on increases with the volatility (potential for imbalance) of the asset pair. The higher the trading fee, the more it offsets this risk, so it's best to set the trading fee based on the volatility of the asset pair.
|
||||
|
||||
## Example {{currentpage.name}} JSON
|
||||
|
||||
```json
|
||||
{
|
||||
"Account" : "rJVUeRqDFNs2xqA7ncVE6ZoAhPUoaJJSQm",
|
||||
"Amount" : {
|
||||
"currency" : "TST",
|
||||
"issuer" : "rP9jPyP5kyvFRb6ZiRghAGw5u8SGAmU4bd",
|
||||
"value" : "25"
|
||||
},
|
||||
"Amount2" : "250000000",
|
||||
"Fee" : "10",
|
||||
"Flags" : 2147483648,
|
||||
"Sequence" : 6,
|
||||
"TradingFee" : 500,
|
||||
"TransactionType" : "AMMCreate"
|
||||
}
|
||||
```
|
||||
|
||||
{% include '_snippets/tx-fields-intro.md' %}
|
||||
<!--{# fix md highlighting_ #}-->
|
||||
|
||||
| Field | JSON Type | [Internal Type][] | Required? | Description |
|
||||
|:-------------|:--------------------|:------------------|:----------|:------------|
|
||||
| `Amount` | [Currency Amount][] | Amount | Yes | The first of the two assets to fund this AMM with. This must be a positive amount. |
|
||||
| `Amount2` | [Currency Amount][] | Amount | Yes | The second of the two assets to fund this AMM with. This must be a positive amount. |
|
||||
| `TradingFee` | Number | UInt16 | Yes | The fee to charge for trades against this AMM instance, in units of 1/100,000; a value of 1 is equivalent to 0.001%. The maximum value is `1000`, indicating a 1% fee. The minimum value is `0`. |
|
||||
|
||||
One or both of `Amount` and `Amount2` can be [tokens](tokens.html); at most one of them can be [XRP](xrp.html). They cannot both have the same currency code and issuer. An AMM's LP tokens _can_ be used as one of the assets for another AMM.
|
||||
|
||||
## Error Cases
|
||||
|
||||
Besides errors that can occur for all transactions, {{currentpage.name}} transactions can result in the following [transaction result codes](transaction-results.html):
|
||||
|
||||
| Error Code | Description |
|
||||
|:--------------------|:---------------------------------------------|
|
||||
| `temDISABLED` | The AMM feature :not_enabled: is not enabled on this network. |
|
||||
| `temINVALID_FLAG` | The transaction specified an invalid `Flags` value. Since there are currently no flags defined for this transaction type, only [Global Flags](transaction-common-fields.html#global-flags) are allowed. |
|
||||
| `temBAD_AMM_TOKENS` | The values of `Amount` and `Amount2` are not valid: for example, both refer to the same token. |
|
||||
| `temBAD_FEE` | The `TradingFee` value is invalid. It must be zero or a positive integer and cannot be over 1000. |
|
||||
| `terNO_ACCOUNT` | One of the accounts referenced in the request does not exist. |
|
||||
| `tecNO_AUTH` | The sender is not authorized to hold one of the deposit assets (`Amount` or `Amount2`). |
|
||||
| `tecNO_LINE` | The sender does not have a trust line for one of the deposit assets (`Amount` or `Amount2`). |
|
||||
| `tecFROZEN` | At least one of the deposit assets (`Amount` or `Amount2`) is currently [frozen](freezes.html). |
|
||||
| `tecUNFUNDED_AMM` | The sender does not hold enough money to fund the AMM with the amounts specified in `Amount` and `Amount2`. |
|
||||
| `tecAMM_EXISTS` | There is already another AMM trading this currency pair. |
|
||||
|
||||
<!--{# common link defs #}-->
|
||||
{% include '_snippets/rippled-api-links.md' %}
|
||||
{% include '_snippets/tx-type-links.md' %}
|
||||
{% include '_snippets/rippled_versions.md' %}
|
||||
@@ -1,136 +0,0 @@
|
||||
---
|
||||
html: ammdeposit.html
|
||||
parent: transaction-types.html
|
||||
blurb: LPTokenと引き換えに、自動マーケットメーカーに資金を預けます。
|
||||
labels:
|
||||
- AMM
|
||||
status: not_enabled
|
||||
---
|
||||
# AMMDeposit
|
||||
[[Source]](https://github.com/gregtatcam/rippled/blob/amm-core-functionality/src/ripple/app/tx/impl/AMMDeposit.cpp "Source")
|
||||
<!-- TODO: Update source link to merged version when available -->
|
||||
|
||||
{% include '_snippets/amm-disclaimer.ja.md' %}
|
||||
|
||||
[自動マーケットメーカー](automated-market-makers.html)(AMM)インスタンスに資金を預け、引き換えにAMMの流動性プロバイダートークン( _LPトークン_ )を受け取ります。AMMのプールにある資産の一方または両方を預けることができます。
|
||||
|
||||
トランザクションが成功すると、LPトークンを保持するためにAMMアカウント(リミット0)に[トラストライン](trust-lines-and-issuing.html)が作成されます。
|
||||
|
||||
## {{currentpage.name}} JSONの例
|
||||
|
||||
```json
|
||||
{
|
||||
"Account" : "rJVUeRqDFNs2xqA7ncVE6ZoAhPUoaJJSQm",
|
||||
"Amount" : {
|
||||
"currency" : "TST",
|
||||
"issuer" : "rP9jPyP5kyvFRb6ZiRghAGw5u8SGAmU4bd",
|
||||
"value" : "2.5"
|
||||
},
|
||||
"Amount2" : "30000000",
|
||||
"Asset" : {
|
||||
"currency" : "TST",
|
||||
"issuer" : "rP9jPyP5kyvFRb6ZiRghAGw5u8SGAmU4bd"
|
||||
},
|
||||
"Asset2" : {
|
||||
"currency" : "XRP"
|
||||
},
|
||||
"Fee" : "10",
|
||||
"Flags" : 1048576,
|
||||
"Sequence" : 7,
|
||||
"TransactionType" : "AMMDeposit"
|
||||
}
|
||||
```
|
||||
|
||||
{% include '_snippets/tx-fields-intro.ja.md' %}
|
||||
|
||||
| フィールド | JSONの型 | [内部の型][] | 必須? | 説明 |
|
||||
|:--------------|:-----------|:-----------|:------|:------------|
|
||||
| `Asset` | オブジェクト | STIssue | はい | AMMのプールにある資産の一つを定義します。JSONでは、`currency`と`issuer`フィールドを持つオブジェクトになります(XRPの場合は`issuer`を省略します)。 |
|
||||
| `Asset2` | オブジェクト | STIssue | はい | AMMのプールにあるもう一つの資産を定義します。JSONでは、`currency`と`issuer`フィールドを持つオブジェクトになります(XRPの場合は`issuer`を省略します)。 |
|
||||
| `Amount` | [通貨額][] | Amount | いいえ | AMMに預ける1つの資産の量を指定します。存在する場合、これはAMMのプールにある資産の一つ(トークンまたはXRP)と一致する必要があります。 |
|
||||
| `Amount2` | [通貨額][] | Amount | いいえ | AMMに追加する別の資産の量を指定します。存在する場合、これはAMMのプール内の他の資産と一致する必要があり、`Amount`と同じ資産にすることはできません。 |
|
||||
| `EPrice` | [通貨額][] | Amount | いいえ | 受け取った各LPトークンに支払う、預け入れ資産の最大有効価格です。 |
|
||||
| `LPTokenOut` | [通貨額][] | Amount | いいえ | AMMのLPトークンの購入数量。 |
|
||||
|
||||
|
||||
### AMMDepositモード
|
||||
|
||||
このトランザクションには5つのモードがあり、どのフラグを指定するかで定義されます。それぞれのモードは、特定のフィールドの組み合わせを必要とし、次の2つのカテゴリーに分類されます。
|
||||
|
||||
- **ダブルアセット入金**: AMMのプールにある両方(2つ)の資産を、既存の資産の残高に比例して預けます。この預け入れは手数料の対象外です。
|
||||
- **シングルアセット入金**, AMMの2つの資産のうち1つだけを預けます。AMMは、この預け入れによってプール内の資産残高がどれだけ変化したかによって、対価として支払われるLPトークンから差し引く手数料を設定します。
|
||||
|
||||
以下の項目の組み合わせは、**ダブルアセット入金**について示しています。
|
||||
|
||||
| フラグ名 | フラグ値 | 指定フィールド | 意味 |
|
||||
|--------------|--------------|------------------------|---------|
|
||||
| `tfLPToken` | `0x00010000` | `LPTokenOut`のみ | 指定された量のLPトークンを受け取るように計算された金額の、このAMMの両資産を預けます。預ける金額は、AMMの保有する2つの資産の割合と等しくなります。 |
|
||||
| `tfTwoAsset` | `0x00100000` | `Amount`と`Amount2` | このAMMの両資産を指定された金額まで預けます。実際に預ける金額は、AMMがすでに保有している資産と同じ割合を維持する必要があるため、どちらか一方の預け入れ金額が指定金額より少なくてもかまいません。引き換えに得られるLPトークンの金額は、預けた金額の合計に基づきます。 |
|
||||
|
||||
以下の項目の組み合わせは、**シングルアセット入金**について示しています。
|
||||
|
||||
| フラグ名 | フラグ値 | 指定フィールド | 意味 |
|
||||
|---------------------|--------------|------------------------|---------|
|
||||
| `tfSingleAsset` | `0x00080000` | `Amount`のみ | 指定の資産を指定の量だけ預け、その結果得られたプールのシェアに応じた量のLPトークンを受け取ります。(手数料を差し引いた金額) |
|
||||
| `tfOneAssetLPToken` | `0x00200000` | `Amount`と`LPTokenOut` | 1つの資産を指定された上限額まで預け、対価として指定金額分のLPトークンを受け取ります。(手数料を差し引いた金額) |
|
||||
| `tfLimitLPToken` | `0x00400000` | `Amount`と`EPrice` | 1つの資産を指定された金額まで預けますが、LPトークン1つにつき指定された有効価格(手数料差引後)を超えて預けることはありません。 |
|
||||
|
||||
これ以外のフィールドとフラグの組み合わせは無効です。
|
||||
|
||||
|
||||
### シングルアセット入金手数料
|
||||
|
||||
シングルアセット入金の手数料は、AMMを使って預け入れ金額の一部を他の資産と交換し、ダブルアセット入金を行った場合と同じになるように計算されます。AMMの取引手数料は、取引に必要な金額には適用されますが、残りの預け入れ金額には適用されません。 _例えば、AMMの資産プールがUSDとEURで完全に均等に分割されている場合、100USDを預けようとすると、受け取るLPトークンの量は、50EUR+50USDを預けた場合よりもわずかに少なくなります。_
|
||||
|
||||
ダブルアセット入金の場合、LPトークンを受け取る数は、以下の計算式で算出できます。
|
||||
|
||||
{{ include_svg("img/amm-single-asset-deposit-formula.svg", "L = T × ( (( 1 + (B - (F × (1 - W) × B)) ÷ P)^W) - 1)") }}
|
||||
<!-- TODO: improve graphic -->
|
||||
|
||||
- `L`: 受け取るLPトークンの量
|
||||
- `T`: 預け入れ前のLPトークンの残高合計
|
||||
- `B`: 預け入れ資産の額
|
||||
- `F`: 取引手数料
|
||||
- `W`: プール内の預金資産の重みです。これはすべてのAMMプールで0.5と定義されています(50/50の分割を意味します)ので、Wによる累乗は平方根を取ることと同一です。
|
||||
- `P`: 預け入れ前のプール内の預金資産の合計額
|
||||
|
||||
### AMMDepositフラグ
|
||||
|
||||
AMMDepositタイプのトランザクションは、以下のように[`Flags`フィールド](transaction-common-fields.html#flagsフィールド)の値を追加でサポートしています。
|
||||
|
||||
| フラグ名 | 16進数値 | 10進数値 | 説明 |
|
||||
|:--------------------|:-------------|:--------------|:----------------------|
|
||||
| `tfLPToken` | `0x00010000` | 65536 | ダブルアセット入金を行い、指定された額のLPトークンを受け取ります。 |
|
||||
| `tfSingleAsset` | `0x00080000` | 524288 | 預け入れる資産を指定して、シングルアセット入金を行います。 |
|
||||
| `tfTwoAsset` | `0x00100000` | 1048576 | 両資産を指定金額で預けるダブルアセット入金を行います。 |
|
||||
| `tfOneAssetLPToken` | `0x00200000` | 2097152 | シングルアセット入金を行い、指定された額のLPトークンを受け取ります。 |
|
||||
| `tfLimitLPToken` | `0x00400000` | 4194304 | 有効価格を指定して、シングルアセット入金を行います。 |
|
||||
|
||||
これらのフラグのうちの **1つのみ** と、任意の[グローバルフラグ](transaction-common-fields.html#グローバルフラグ)を指定する必要があります。
|
||||
|
||||
|
||||
## エラーケース
|
||||
|
||||
すべてのトランザクションで発生する可能性のあるエラーに加えて、{{currentpage.name}}トランザクションでは、次の[トランザクション結果コード](transaction-results.html)が発生する可能性があります。
|
||||
|
||||
|
||||
| エラーコード | 説明 |
|
||||
|:------------------------|:---------------------------------------------|
|
||||
| `temBAD_AMM_OPTIONS` | トランザクションで無効なフィールドの組み合わせが指定されました。詳細は、[AMMDepositモード](#ammdepositモード)を参照してください。 |
|
||||
| `tecFROZEN` | トランザクションは[凍結](freezes.html)されているトークンを預けようとしました。 |
|
||||
| `tecAMM_BALANCE` | AMMが預け入れを行うのに十分な量の資産を保有していない(たとえば、シングルアセット入金に必要な残高を保有していない)、または送信者が指定されたトークンを十分に保有していない場合など。 |
|
||||
| `temBAD_AMM_TOKENS` | トランザクションでLPトークンが正しく指定されています。例えば、`issuer`がAMMのAccountRootアドレスでない、`currency`がこのAMMのLPトークンの通貨コードでない、またはトランザクションがAssetフィールドのいずれかにこのAMMのLPトークンを指定した、など。 |
|
||||
| `tecAMM_FAILED_DEPOSIT` | 預け入れの条件が成立しませんでした。例えば、`EPrice`フィールドに指定された実効価格が低すぎる場合など。 |
|
||||
| `tecAMM_INVALID_TOKENS` | このトークンペアのAMMが存在しないか、計算の結果、預け入れ金額がゼロに丸められました。 |
|
||||
| `tecINSUF_RESERVE_LINE` | このトランザクションの送信者は、この処理による[準備金要件](reserves.html)の増加の対象であり、LPトークンを保持するための新しいトラストラインが必要で、そのための追加の所有者準備金分のXRPを保有していないためと思われます。 |
|
||||
| `tecNO_AUTH` | 送信者は、預け入れ資産のいずれかを保有する権限を持っ ていません。 |
|
||||
| `tecNO_LINE` | 送信者が預け入れ資産のうち1つに対し、トラストラインを保有していません。 |
|
||||
| `tecUNFUNDED_AMM` | 送信者の残高が、指定された預け入れを行うのに十分な量ではありません。 |
|
||||
| `terNO_ACCOUNT` | リクエストで参照されたいずれかのアカウントが存在しません。 |
|
||||
| `terNO_AMM` | このトランザクションの資産ペアの自動マーケットメーカーインスタンスが存在しません。 |
|
||||
|
||||
|
||||
<!--{# common link defs #}-->
|
||||
{% include '_snippets/rippled-api-links.md' %}
|
||||
{% include '_snippets/tx-type-links.md' %}
|
||||
{% include '_snippets/rippled_versions.md' %}
|
||||
@@ -1,137 +0,0 @@
|
||||
---
|
||||
html: ammdeposit.html
|
||||
parent: transaction-types.html
|
||||
blurb: Deposit funds into an Automated Market Maker in exchange for LPTokens.
|
||||
labels:
|
||||
- AMM
|
||||
status: not_enabled
|
||||
---
|
||||
# AMMDeposit
|
||||
[[Source]](https://github.com/gregtatcam/rippled/blob/amm-core-functionality/src/ripple/app/tx/impl/AMMDeposit.cpp "Source")
|
||||
<!-- TODO: Update source link to merged version when available -->
|
||||
|
||||
{% include '_snippets/amm-disclaimer.md' %}
|
||||
|
||||
Deposit funds into an [Automated Market Maker](automated-market-makers.html) (AMM) instance and receive the AMM's liquidity provider tokens (_LP Tokens_) in exchange. You can deposit one or both of the assets in the AMM's pool.
|
||||
|
||||
If successful, this transaction creates a [trust line](trust-lines-and-issuing.html) to the AMM Account (limit 0) to hold the LP Tokens.
|
||||
|
||||
## Example {{currentpage.name}} JSON
|
||||
|
||||
```json
|
||||
{
|
||||
"Account" : "rJVUeRqDFNs2xqA7ncVE6ZoAhPUoaJJSQm",
|
||||
"Amount" : {
|
||||
"currency" : "TST",
|
||||
"issuer" : "rP9jPyP5kyvFRb6ZiRghAGw5u8SGAmU4bd",
|
||||
"value" : "2.5"
|
||||
},
|
||||
"Amount2" : "30000000",
|
||||
"Asset" : {
|
||||
"currency" : "TST",
|
||||
"issuer" : "rP9jPyP5kyvFRb6ZiRghAGw5u8SGAmU4bd"
|
||||
},
|
||||
"Asset2" : {
|
||||
"currency" : "XRP"
|
||||
},
|
||||
"Fee" : "10",
|
||||
"Flags" : 1048576,
|
||||
"Sequence" : 7,
|
||||
"TransactionType" : "AMMDeposit"
|
||||
}
|
||||
```
|
||||
|
||||
{% include '_snippets/tx-fields-intro.md' %}
|
||||
|
||||
| Field | JSON Type | [Internal Type][] | Required? | Description |
|
||||
|:--------------|:--------------------|:------------------|:----------|:------------|
|
||||
| `Asset` | Object | STIssue | Yes | The definition for one of the assets in the AMM's pool. In JSON, this is an object with `currency` and `issuer` fields (omit `issuer` for XRP). |
|
||||
| `Asset2` | Object | STIssue | Yes | The definition for the other asset in the AMM's pool. In JSON, this is an object with `currency` and `issuer` fields (omit `issuer` for XRP). |
|
||||
| `Amount` | [Currency Amount][] | Amount | No | The amount of one asset to deposit to the AMM. If present, this must match the type of one of the assets (tokens or XRP) in the AMM's pool. |
|
||||
| `Amount2` | [Currency Amount][] | Amount | No | The amount of another asset to add to the AMM. If present, this must match the type of the other asset in the AMM's pool and cannot be the same asset as `Amount`. |
|
||||
| `EPrice` | [Currency Amount][] | Amount | No | The maximum effective price, in the deposit asset, to pay for each LP Token received. |
|
||||
| `LPTokenOut` | [Currency Amount][] | Amount | No | How many of the AMM's LP Tokens to buy. |
|
||||
|
||||
|
||||
### AMMDeposit Modes
|
||||
|
||||
This transaction has five modes, defined by which flag you specify. Each mode expects a specific combination of fields. The modes fall into two categories:
|
||||
|
||||
- **Double-asset deposits**, in which you provide both assets in the AMM's pool, proportional to the balance of the assets already there. These deposits are not subject to a fee.
|
||||
- **Single-asset deposits**, in which you provide only one of the AMM's two assets. The AMM charges a fee, debited from the LP Tokens paid out, based on how much your deposit shifts the balance of assets in the pool.
|
||||
|
||||
The following combinations of fields indicate a **double-asset deposit**:
|
||||
|
||||
| Flag Name | Flag Value | Fields Specified | Meaning |
|
||||
|--------------|--------------|------------------------|---------|
|
||||
| `tfLPToken` | `0x00010000` | `LPTokenOut` only | Deposit both of this AMM's assets, in amounts calculated so that you receive the specified amount of LP Tokens in return. The amounts deposited maintain the relative proportions of the two assets the AMM already holds. |
|
||||
| `tfTwoAsset` | `0x00100000` | `Amount` and `Amount2` | Deposit both of this AMM's assets, up to the specified amounts. The actual amounts deposited must maintain the same balance of assets as the AMM already holds, so the amount of either one deposited MAY be less than specified. The amount of LP Tokens you get in return is based on the total value deposited. |
|
||||
|
||||
The following combinations of fields indicate a **single asset deposit**:
|
||||
|
||||
| Flag Name | Flag Value | Fields Specified | Meaning |
|
||||
|---------------------|--------------|----------------------------|---------|
|
||||
| `tfSingleAsset` | `0x00080000` | `Amount` only | Deposit exactly the specified amount of one asset, and receive an amount of LP Tokens based on the resulting share of the pool (minus fees). |
|
||||
| `tfOneAssetLPToken` | `0x00200000` | `Amount` and `LPTokenOut` | Deposit up to the specified amount of one asset, so that you receive exactly the specified amount of LP Tokens in return (after fees). |
|
||||
| `tfLimitLPToken` | `0x00400000` | `Amount` and `EPrice` | Deposit up to the specified amount of one asset, but pay no more than the specified effective price per LP Token (after fees). |
|
||||
|
||||
Any other combination of these fields and flags is invalid.
|
||||
|
||||
|
||||
### Single Asset Deposit Fee
|
||||
|
||||
The fee for a single asset deposit is calculated to be the same as if you had used the AMM to trade part of the deposit amount for the other asset, then done a double-asset deposit. The AMM's trading fee applies to the amount you would need to trade for, but not to the rest of the deposit. _For example, if the AMM's asset pool is split perfectly evenly between USD and EUR, and you try to deposit 100 USD, the amount of LP Tokens you receive is slightly less than if you had deposited 50 EUR + 50 USD, because you pay the trading fee to convert some of your USD to an equal amount of EUR._
|
||||
|
||||
The formula for how many LP Tokens you receive for a double-asset deposit is:
|
||||
|
||||
{{ include_svg("img/amm-single-asset-deposit-formula.svg", "L = T × ( (( 1 + (B - (F × (1 - W) × B)) ÷ P)^W) - 1)") }}
|
||||
<!-- TODO: improve graphic -->
|
||||
|
||||
Where:
|
||||
|
||||
- `L` is the amount of LP Tokens returned
|
||||
- `T` is the total outstanding LP Tokens before the deposit
|
||||
- `B` is the amount of the asset being deposited
|
||||
- `F` is the trading fee, as a decimal
|
||||
- `W` is the weight of the deposit asset in the pool. This is defined as 0.5 for all AMM pools (meaning a 50/50 split), so exponentiation by W is equivalent to taking the square root.
|
||||
- `P` is the total amount of the deposit asset in the pool before the deposit
|
||||
|
||||
### AMMDeposit Flags
|
||||
|
||||
Transactions of the AMMDeposit type support additional values in the [`Flags` field](transaction-common-fields.html#flags-field), as follows:
|
||||
|
||||
| Flag Name | Hex Value | Decimal Value | Description |
|
||||
|:--------------------|:-------------|:--------------|:----------------------|
|
||||
| `tfLPToken` | `0x00010000` | 65536 | Perform a double-asset deposit and receive the specified amount of LP Tokens. |
|
||||
| `tfSingleAsset` | `0x00080000` | 524288 | Perform a single-asset deposit with a specified amount of the asset to deposit. |
|
||||
| `tfTwoAsset` | `0x00100000` | 1048576 | Perform a double-asset deposit with specified amounts of both assets. |
|
||||
| `tfOneAssetLPToken` | `0x00200000` | 2097152 | Perform a single-asset deposit and receive the specified amount of LP Tokens. |
|
||||
| `tfLimitLPToken` | `0x00400000` | 4194304 | Perform a single-asset deposit with a specified effective price. |
|
||||
|
||||
You must specify **exactly one** of these flags, plus any [global flags](transaction-common-fields.html#global-flags).
|
||||
|
||||
|
||||
## Error Cases
|
||||
|
||||
Besides errors that can occur for all transactions, {{currentpage.name}} transactions can result in the following [transaction result codes](transaction-results.html):
|
||||
|
||||
| Error Code | Description |
|
||||
|:------------------------|:---------------------------------------------|
|
||||
| `temBAD_AMM_OPTIONS` | The transaction specified an invalid combination of fields. See [AMMDeposit Modes](#ammdeposit-modes). |
|
||||
| `tecFROZEN` | The transaction tried to deposit a [frozen](freezes.html) token. |
|
||||
| `tecAMM_BALANCE` | The AMM does not have enough of one of the assets to accept the deposit (for example, to satisfy the trade part of a single-asset deposit) or the sender does not have enough of a given token. |
|
||||
| `temBAD_AMM_TOKENS` | The transaction specified the LP Tokens incorrectly; for example, the `issuer` is not the AMM's associated AccountRoot address or the `currency` is not the currency code for this AMM's LP Tokens, or the transaction specified this AMM's LP Tokens in one of the asset fields. |
|
||||
| `tecAMM_FAILED_DEPOSIT` | The conditions on the deposit could not be satisfied; for example, the requested effective price in the `EPrice` field is too low. |
|
||||
| `tecAMM_INVALID_TOKENS` | The AMM for this token pair does not exist, or one of the calculations resulted in a deposit amount rounding to zero. |
|
||||
| `tecINSUF_RESERVE_LINE` | The sender of this transaction does meet the increased [reserve requirement](reserves.html) of processing this transaction, probably because they need a new trust line to hold the LP Tokens, and they don't have enough XRP to meet the additional owner reserve for a new trust line. |
|
||||
| `tecNO_AUTH` | The sender is not authorized to hold one of the deposit assets. |
|
||||
| `tecNO_LINE` | The sender does not have a trust line for one of the deposit assets. |
|
||||
| `tecUNFUNDED_AMM` | The sender does not have a high enough balance to make the specified deposit. |
|
||||
| `terNO_ACCOUNT` | An account specified in the request does not exist. |
|
||||
| `terNO_AMM` | The Automated Market Maker instance for the asset pair in this transaction does not exist. |
|
||||
|
||||
|
||||
<!--{# common link defs #}-->
|
||||
{% include '_snippets/rippled-api-links.md' %}
|
||||
{% include '_snippets/tx-type-links.md' %}
|
||||
{% include '_snippets/rippled_versions.md' %}
|
||||
@@ -1,61 +0,0 @@
|
||||
---
|
||||
html: ammvote.html
|
||||
parent: transaction-types.html
|
||||
blurb: 自動マーケットメーカーインスタンスの取引手数料を投票する。
|
||||
labels:
|
||||
- AMM
|
||||
status: not_enabled
|
||||
---
|
||||
# AMMVote
|
||||
[[Source]](https://github.com/gregtatcam/rippled/blob/amm-core-functionality/src/ripple/app/tx/impl/AMMVote.cpp "Source")
|
||||
<!-- TODO: Update source link to merged version when available -->
|
||||
|
||||
{% include '_snippets/amm-disclaimer.ja.md' %}
|
||||
|
||||
[自動マーケットメーカー](automated-market-makers.html)インスタンスの取引手数料を投票します。最大8つのアカウントが、保有するAMMのLPトークンの量に比例して投票することができます。各新規投票では、投票の加重平均に基づいてAMMの取引手数料が再計算されます。
|
||||
|
||||
## {{currentpage.name}} JSONの例
|
||||
|
||||
```json
|
||||
{
|
||||
"Account" : "rJVUeRqDFNs2xqA7ncVE6ZoAhPUoaJJSQm",
|
||||
"Asset" : {
|
||||
"currency" : "XRP"
|
||||
},
|
||||
"Asset2" : {
|
||||
"currency" : "TST",
|
||||
"issuer" : "rP9jPyP5kyvFRb6ZiRghAGw5u8SGAmU4bd"
|
||||
},
|
||||
"Fee" : "10",
|
||||
"Flags" : 2147483648,
|
||||
"Sequence" : 8,
|
||||
"TradingFee" : 600,
|
||||
"TransactionType" : "AMMVote"
|
||||
}
|
||||
```
|
||||
|
||||
{% include '_snippets/tx-fields-intro.ja.md' %}
|
||||
|
||||
| フィールド | JSONの型 | [内部の型][] | 必須? | 説明 |
|
||||
|:-------------|:----------|:-----------|:-----|:------------|
|
||||
| `Asset` | Object | STIssue | はい | AMMのプールにある資産の一つを定義します。JSONでは、`currency` と `issuer` フィールドを持つオブジェクトになります(XRPの場合は`issuer`を省略します)。 |
|
||||
| `Asset2` | Object | STIssue | はい | AMMのプールにあるもう一つの資産を定義します。JSONでは、`currency` と `issuer` フィールドを持つオブジェクトになります(XRPの場合は`issuer`を省略します)。|
|
||||
| `TradingFee` | Number | UInt16 | はい | 投票に必要な手数料を100000の1の単位で指定します。最大値は1000で、1%の手数料を表します。 |
|
||||
|
||||
## エラーケース
|
||||
|
||||
すべてのトランザクションで発生する可能性のあるエラーに加えて、{{currentpage.name}}トランザクションでは、次の[トランザクション結果コード](transaction-results.html)が発生する可能性があります。
|
||||
|
||||
| エラーコード | 説明 |
|
||||
|:------------------------|:---------------------------------------------|
|
||||
| `tecAMM_INVALID_TOKENS` | 送信者は、このAMMのLPトークンを保有していないため、投票することができません。 |
|
||||
| `tecAMM_FAILED_VOTE` | このトランザクションの送信者よりも多くのLPトークンを保有しているアカウントからの投票が既に8件存在しています。 |
|
||||
| `terNO_ACCOUNT` | このトランザクションで指定されたアカウントが存在しません。 |
|
||||
| `temBAD_FEE` | このトランザクションの`TradingFee`は正しくありません。 |
|
||||
| `terNO_AMM` | このトランザクションの資産ペアの自動マーケットメーカー インスタンスが存在しません。 |
|
||||
|
||||
|
||||
<!--{# common link defs #}-->
|
||||
{% include '_snippets/rippled-api-links.md' %}
|
||||
{% include '_snippets/tx-type-links.md' %}
|
||||
{% include '_snippets/rippled_versions.md' %}
|
||||
@@ -1,61 +0,0 @@
|
||||
---
|
||||
html: ammvote.html
|
||||
parent: transaction-types.html
|
||||
blurb: Vote on the trading fee for an Automated Market Maker instance.
|
||||
labels:
|
||||
- AMM
|
||||
status: not_enabled
|
||||
---
|
||||
# AMMVote
|
||||
[[Source]](https://github.com/gregtatcam/rippled/blob/amm-core-functionality/src/ripple/app/tx/impl/AMMVote.cpp "Source")
|
||||
<!-- TODO: Update source link to merged version when available -->
|
||||
|
||||
{% include '_snippets/amm-disclaimer.md' %}
|
||||
|
||||
Vote on the trading fee for an [Automated Market Maker](automated-market-makers.html) instance. Up to 8 accounts can vote in proportion to the amount of the AMM's LP Tokens they hold. Each new vote re-calculates the AMM's trading fee based on a weighted average of the votes.
|
||||
|
||||
## Example {{currentpage.name}} JSON
|
||||
|
||||
```json
|
||||
{
|
||||
"Account" : "rJVUeRqDFNs2xqA7ncVE6ZoAhPUoaJJSQm",
|
||||
"Asset" : {
|
||||
"currency" : "XRP"
|
||||
},
|
||||
"Asset2" : {
|
||||
"currency" : "TST",
|
||||
"issuer" : "rP9jPyP5kyvFRb6ZiRghAGw5u8SGAmU4bd"
|
||||
},
|
||||
"Fee" : "10",
|
||||
"Flags" : 2147483648,
|
||||
"Sequence" : 8,
|
||||
"TradingFee" : 600,
|
||||
"TransactionType" : "AMMVote"
|
||||
}
|
||||
```
|
||||
|
||||
{% include '_snippets/tx-fields-intro.md' %}
|
||||
|
||||
| Field | JSON Type | [Internal Type][] | Required? | Description |
|
||||
|:-------------|:----------|:------------------|:----------|:------------|
|
||||
| `Asset` | Object | STIssue | Yes | The definition for one of the assets in the AMM's pool. In JSON, this is an object with `currency` and `issuer` fields (omit `issuer` for XRP). |
|
||||
| `Asset2` | Object | STIssue | Yes | The definition for the other asset in the AMM's pool. In JSON, this is an object with `currency` and `issuer` fields (omit `issuer` for XRP). |
|
||||
| `TradingFee` | Number | UInt16 | Yes | The proposed fee to vote for, in units of 1/100,000; a value of 1 is equivalent to 0.001%. The maximum value is 1000, indicating a 1% fee. |
|
||||
|
||||
## Error Cases
|
||||
|
||||
Besides errors that can occur for all transactions, {{currentpage.name}} transactions can result in the following [transaction result codes](transaction-results.html):
|
||||
|
||||
| Error Code | Description |
|
||||
|:------------------------|:---------------------------------------------|
|
||||
| `tecAMM_INVALID_TOKENS` | The sender cannot vote because they do not hold any of this AMM's LP Tokens. |
|
||||
| `tecAMM_FAILED_VOTE` | There are already 8 votes from accounts that hold more LP Tokens than the sender of this transaction. |
|
||||
| `terNO_ACCOUNT` | An account specified in this transaction does not exist. |
|
||||
| `temBAD_FEE` | The `TradingFee` from this transaction is not valid. |
|
||||
| `terNO_AMM` | The Automated Market Maker instance for the asset pair in this transaction does not exist. |
|
||||
|
||||
|
||||
<!--{# common link defs #}-->
|
||||
{% include '_snippets/rippled-api-links.md' %}
|
||||
{% include '_snippets/tx-type-links.md' %}
|
||||
{% include '_snippets/rippled_versions.md' %}
|
||||
@@ -1,125 +0,0 @@
|
||||
---
|
||||
html: ammwithdraw.html
|
||||
parent: transaction-types.html
|
||||
blurb: LPTokenを自動マーケットメーカーに返却し、プールが保有する資産の一部と引き換える。
|
||||
labels:
|
||||
- AMM
|
||||
status: not_enabled
|
||||
---
|
||||
# AMMWithdraw
|
||||
[[Source]](https://github.com/gregtatcam/rippled/blob/amm-core-functionality/src/ripple/app/tx/impl/AMMWithdraw.cpp "Source")
|
||||
<!-- TODO: Update source link to merged version when available -->
|
||||
|
||||
{% include '_snippets/amm-disclaimer.ja.md' %}
|
||||
|
||||
AMMの流動性プロバイダトークン(LPトークン)を返すことで、[自動マーケットメーカー](automated-market-makers.html)(AMM)インスタンスから資産を引き出します。
|
||||
|
||||
## {{currentpage.name}} JSONの例
|
||||
|
||||
```json
|
||||
{
|
||||
"Account" : "rJVUeRqDFNs2xqA7ncVE6ZoAhPUoaJJSQm",
|
||||
"Amount" : {
|
||||
"currency" : "TST",
|
||||
"issuer" : "rP9jPyP5kyvFRb6ZiRghAGw5u8SGAmU4bd",
|
||||
"value" : "5"
|
||||
},
|
||||
"Amount2" : "50000000",
|
||||
"Asset" : {
|
||||
"currency" : "TST",
|
||||
"issuer" : "rP9jPyP5kyvFRb6ZiRghAGw5u8SGAmU4bd"
|
||||
},
|
||||
"Asset2" : {
|
||||
"currency" : "XRP"
|
||||
},
|
||||
"Fee" : "10",
|
||||
"Flags" : 1048576,
|
||||
"Sequence" : 10,
|
||||
"TransactionType" : "AMMWithdraw"
|
||||
}
|
||||
```
|
||||
|
||||
{% include '_snippets/tx-fields-intro.md' %}
|
||||
|
||||
| フィールド | JSONの型 | [内部の型][] | 必須? | 説明 |
|
||||
|:-------------|:-----------|:-----------|:------|:------------|
|
||||
| `Asset` | オブジェクト | STIssue | はい | AMMのプールにある資産の一つを定義します。JSONでは、`currency`と`issuer`フィールドを持つオブジェクトになります(XRPの場合は`issuer`を省略します)。 |
|
||||
| `Asset2` | オブジェクト | STIssue | はい | AMMのプールにあるもう一つの資産を定義します。JSONでは、`currency`と`issuer`フィールドを持つオブジェクトです(XRPの場合は`issuer`を省略)。|
|
||||
| `Amount` | [通貨額][] | Amount | いいえ | AMMから引き出す1つの資産の量。これは、AMMのプールにある資産の1つ(トークンまたはXRP)と一致する必要があります。 |
|
||||
| `Amount2` | [通貨額][] | Amount | いいえ | AMMから引き出す他の資産の量。存在する場合、これはAMMのプール内の他の資産と一致する必要があり、`Amount`と同じにすることはできません。 |
|
||||
| `EPrice` | [通貨額][] | Amount | いいえ | 引き出しに必要な、資産の1単位あたりに支払う最低有効価格(LPトークンの返却単位)。 |
|
||||
| `LPTokenIn` | [通貨額][] | Amount | いいえ | AMMのLPトークンの引き替え数。 |
|
||||
|
||||
**注記:** ダブルアセット出金の場合、`Asset1`と`Amount1`または`Amount2`が対応していれば、`Asset2`はもう一方に対応することが可能です。しかし、両者を一致させることをお勧めします(つまり、`Amount2`は`Asset2`で定義されたアセットの金額です)。その方が混乱を招きにくくなります。
|
||||
|
||||
### AMMWithdrawモード
|
||||
|
||||
このトランザクションには、指定するフラグによって、いくつかのモードがあります。それぞれのモードは、特定のフィールドの組み合わせを必要とし、以下の2つのカテゴリーに分類されます。
|
||||
|
||||
- **ダブルアセット出金**: AMMのプールから両方の資産を、その残高と同じ割合で受け取ります。これらの引き出しには手数料はかかりません。
|
||||
- **シングルアセット出金**: AMMのプールから1つの資産を受け取ります。AMMは、あなたの引き出しによってプール内の資産残高がどれだけ変動するかによって手数料を設定します。引き出しのモードによって、手数料の額は、支払われたLPトークンの量から差し引かれるか、引き出される資産の量から差し引かれるか決まります。
|
||||
|
||||
以下の項目の組み合わせは、**ダブルアセット出金**について示しています。
|
||||
|
||||
| フラグ名 | フラグ値 | 指定フィール | 意味 |
|
||||
|-----------------|--------------|---------------- ----|---------|
|
||||
| `tfLPToken` | `0x00010000` | `LPTokenIn`のみ | 指定された量のLPトークンを返還し、AMMのプールから、LPトークンの発行総数に対する返還されたトークンの割合に基づく金額の両資産を受 け取ります。 |
|
||||
| `tfWithdrawAll` | `0x00020000` | なし | LPトークンを _全て_ 返還し、AMMのプールにある両資産を最大限受け取ります。 |
|
||||
| `tfTwoAsset` | `0x00100000` | `Amount`と`Amount2` | AMMの資産を、指定した金額を上限として、両方とも引き出します。実際に受け取る金額は、AMMのプールの資産残高の割合と同じになります。 |
|
||||
|
||||
以下の項目の組み合わせは、**シングルアセット出金**について示しています。
|
||||
|
||||
| フラグ名 | フラグ値 | 指定フィールド | 意味 |
|
||||
|-------------------------|--------------|-----------------------|---------|
|
||||
| `tfSingleAsset` | `0x00080000` | `Amount`のみ | LPトークンを必要な数だけ返還し、1つの資産を指定した量だけ出金する。 |
|
||||
| `tfOneAssetWithdrawAll` | `0x00040000` | `Amount`のみ | LPトークンを全て返還することで、1つの資産を指定した金額以上引き出します。指定された金額以上を受け取ることができない場合は失敗します。指定する金額は0でもかまいません。この場合、少しでも正の金額を引き出せば成功します。 |
|
||||
| `tfOneAssetLPToken` | `0x00200000` | `Amount`と`LPTokenIn` | 指定した量のLPトークンを返還することで、1つの資産を指定した量まで引き出します。 |
|
||||
| `tfLimitLPToken` | `0x00400000` | `Amount`と`EPrice` | 指定した1つの資産の量を上限として出金しますが、受け取る資産の一単位あたりのLPトークンで指定した有効価格より高い金額を支払うことはありません。 |
|
||||
|
||||
これら以外のフィールドとフラグの組み合わせは無効です。
|
||||
|
||||
### シングルアセット出金手数料
|
||||
|
||||
シングルアセット出金にかかる手数料は、ダブルアセット出金を行い、AMMを使用してもう一方の資産を全て引き出しにかかる資産と交換した場合と同じになるように計算されます。取引手数料は、取引に必要な金額に適用されますが、残りの引き出し分には適用されません。
|
||||
|
||||
<!-- TODO: add a formula and example calculation(s) of single-asset withdrawal fees -->
|
||||
|
||||
|
||||
### AMMWithdrawフラグ
|
||||
|
||||
AMMWithdrawタイプのトランザクションは、以下のように[`Flags`フィールド](transaction-common-fields.html#flagsフィールド)の値を追加でサポートしています。
|
||||
|
||||
| フラグ名 | 16進数値 | 10進数値 | 説明 |
|
||||
|:------------------------|:-------------|:--------------|:----------------------|
|
||||
| `tfLPToken` | `0x00010000` | 65536 | 指定された額のLPトークンを返還する、ダブルアセット出金を行います。 |
|
||||
| `tfWithdrawAll` | `0x00020000` | 131072 | LPトークンをすべて返還する、ダブルアセット出金を行います。 |
|
||||
| `tfOneAssetWithdrawAll` | `0x00040000` | 262144 | 全てのLPトークンを返還する、シングルアセット出金を行います。 |
|
||||
| `tfSingleAsset` | `0x00080000` | 524288 | 引き出す資産を指定して、シングルアセット出金を行います。|
|
||||
| `tfTwoAsset` | `0x00100000` | 1048576 | 両資産の金額を指定して、ダブルアセット出金を行います。 |
|
||||
| `tfOneAssetLPToken` | `0x00200000` | 2097152 | シングルアセット出金を行い、指定された額のLPトークンを受け取ります。 |
|
||||
| `tfLimitLPToken` | `0x00400000` | 4194304 | 有効価格を指定して、シングルアセット出金を行います。 |
|
||||
|
||||
これらのフラグのうちの **1つのみ** と、任意の[グローバルフラグ](transaction-common-fields.html#グローバルフラグ)を指定する必要があります。
|
||||
|
||||
|
||||
## エラーケース
|
||||
|
||||
すべてのトランザクションで発生する可能性のあるエラーに加えて、{{currentpage.name}}トランザクションでは、次の[トランザクション結果コード](transaction-results.html)が発生する可能性があります。
|
||||
|
||||
| エラーコード | 説明 |
|
||||
|:-------------------------|:---------------------------------------------|
|
||||
| `tecFROZEN` | トランザクションは[凍結](freezes.html)されたトークンを引き出そうとしました。 |
|
||||
| `tecAMM_BALANCE` | トランザクションによって、プールから1つの資産をすべて引き出そうとしている、もしくは`tfWithdrawAll`の場合に端数処理によって0以外の金額が残ってしまっています。 |
|
||||
| `tecAMM_FAILED_WITHDRAW` | 例えば、`EPrice`フィールドに指定された有効価格が低過ぎる場合など、引き出しに関する条件が成立しませんでした。 |
|
||||
| `tecAMM_INVALID_TOKENS` | トークンペアのAMMが存在しないか、計算の結果、引き出し額がゼロに丸められました。 |
|
||||
| `tecINSUF_RESERVE_LINE` | トランザクションの送信者は、このトランザクションを処理するための[準備金要件](reserves.html)の増加に対応できません。おそらく、引き出される資産の1つを保持するために少なくとも1つの新しいトラストラインが必要ですが、新しいトラストラインのための追加の所有者準備金分のXRPを持っていないためでしょう。 |
|
||||
| `tecNO_AUTH` | 送信者は、引き出し資産のいずれかを保有する権限を有していません。 |
|
||||
| `temBAD_AMM_OPTIONS` | トランザクションで無効なフィールドの組み合わせが指定されました。[AMMWithdrawモード](#ammwithdrawモード)を参照してください。 |
|
||||
| `temBAD_AMM_TOKENS` | 例えば、`issuer`がAMMの関連するAccountRootアドレスでない、`currency`がこのAMMのLPトークンの通貨コードでない、またはトランザクションがこのAMMのLPトークンをAssetフィールドの1つに指定した、などです。 |
|
||||
| `terNO_AMM` | トランザクションで指定した資産ペアの自動マーケットメーカーインスタンスが存在しません。 |
|
||||
|
||||
|
||||
<!--{# common link defs #}-->
|
||||
{% include '_snippets/rippled-api-links.md' %}
|
||||
{% include '_snippets/tx-type-links.md' %}
|
||||
{% include '_snippets/rippled_versions.md' %}
|
||||
@@ -1,125 +0,0 @@
|
||||
---
|
||||
html: ammwithdraw.html
|
||||
parent: transaction-types.html
|
||||
blurb: Return LPTokens into an Automated Market Maker in exchange for a share of the assets the pool holds.
|
||||
labels:
|
||||
- AMM
|
||||
status: not_enabled
|
||||
---
|
||||
# AMMWithdraw
|
||||
[[Source]](https://github.com/gregtatcam/rippled/blob/amm-core-functionality/src/ripple/app/tx/impl/AMMWithdraw.cpp "Source")
|
||||
<!-- TODO: Update source link to merged version when available -->
|
||||
|
||||
{% include '_snippets/amm-disclaimer.md' %}
|
||||
|
||||
Withdraw assets from an [Automated Market Maker](automated-market-makers.html) (AMM) instance by returning the AMM's liquidity provider tokens (LP Tokens).
|
||||
|
||||
## Example {{currentpage.name}} JSON
|
||||
|
||||
```json
|
||||
{
|
||||
"Account" : "rJVUeRqDFNs2xqA7ncVE6ZoAhPUoaJJSQm",
|
||||
"Amount" : {
|
||||
"currency" : "TST",
|
||||
"issuer" : "rP9jPyP5kyvFRb6ZiRghAGw5u8SGAmU4bd",
|
||||
"value" : "5"
|
||||
},
|
||||
"Amount2" : "50000000",
|
||||
"Asset" : {
|
||||
"currency" : "TST",
|
||||
"issuer" : "rP9jPyP5kyvFRb6ZiRghAGw5u8SGAmU4bd"
|
||||
},
|
||||
"Asset2" : {
|
||||
"currency" : "XRP"
|
||||
},
|
||||
"Fee" : "10",
|
||||
"Flags" : 1048576,
|
||||
"Sequence" : 10,
|
||||
"TransactionType" : "AMMWithdraw"
|
||||
}
|
||||
```
|
||||
|
||||
{% include '_snippets/tx-fields-intro.md' %}
|
||||
|
||||
| Field | JSON Type | [Internal Type][] | Required? | Description |
|
||||
|:-------------|:--------------------|:------------------|:----------|:------------|
|
||||
| `Asset` | Object | STIssue | Yes | The definition for one of the assets in the AMM's pool. In JSON, this is an object with `currency` and `issuer` fields (omit `issuer` for XRP). |
|
||||
| `Asset2` | Object | STIssue | Yes | The definition for the other asset in the AMM's pool. In JSON, this is an object with `currency` and `issuer` fields (omit `issuer` for XRP). |
|
||||
| `Amount` | [Currency Amount][] | Amount | No | The amount of one asset to withdraw from the AMM. This must match the type of one of the assets (tokens or XRP) in the AMM's pool. |
|
||||
| `Amount2` | [Currency Amount][] | Amount | No | The amount of another asset to withdraw from the AMM. If present, this must match the type of the other asset in the AMM's pool and cannot be the same type as `Amount`. |
|
||||
| `EPrice` | [Currency Amount][] | Amount | No | The minimum effective price, in LP Token returned, to pay per unit of the asset to withdraw. |
|
||||
| `LPTokenIn` | [Currency Amount][] | Amount | No | How many of the AMM's LP Tokens to redeem. |
|
||||
|
||||
**Note:** For a double-asset withdrawal, it is possible for `Asset` to correspond to _either_ `Amount` or `Amount2` as long as `Asset2` corresponds to the other one. It is recommended to match them (that is, `Amount2` is an amount of the asset defined in `Asset2`) because it is less confusing that way.
|
||||
|
||||
### AMMWithdraw Modes
|
||||
|
||||
This transaction has several modes, depending on which flags you specify. Each mode expects a specific combination of fields. The modes fall into two categories:
|
||||
|
||||
- **Double-asset withdrawals**, in which you receive both assets from the AMM's pool in proportions that match their balances there. These withdrawals are not subject to a fee.
|
||||
- **Single-asset withdrawals**, in which you receive one asset from the AMM's pool. The AMM charges a fee based on how much your deposit shifts the balance of assets in the pool. Depending on the withdraw mode, the amount of the fee can be added to the amount of LP Tokens paid in, or debited from the amount of the asset paid out.
|
||||
|
||||
The following combinations of fields indicate a **double-asset withdrawal**:
|
||||
|
||||
| Flag Name(s) | Flag Value | Fields Specified | Meaning |
|
||||
|-----------------|--------------|------------------------|---------|
|
||||
| `tfLPToken` | `0x00010000` | `LPTokenIn` only | Return the specified amount of LP Tokens and receive both assets from the AMM's pool in amounts based on the returned LP Tokens' share of the total LP Tokens issued. |
|
||||
| `tfWithdrawAll` | `0x00020000` | No Fields | Return _all_ of your LP Tokens and receive as much as you can of both assets in the AMM's pool. |
|
||||
| `tfTwoAsset` | `0x00100000` | `Amount` and `Amount2` | Withdraw both of this AMM's assets, in up to the specified amounts. The actual amounts received maintains the balance of assets in the AMM's pool. |
|
||||
|
||||
The following combinations of fields indicate a **single asset withdrawal**:
|
||||
|
||||
| Flag Name(s) | Flag Value | Fields Specified | Meaning |
|
||||
|-------------------------|--------------|--------------------------|---------|
|
||||
| `tfSingleAsset` | `0x00080000` | `Amount` only | Withdraw exactly the specified amount of one asset, by returning as many LP Tokens as necessary. |
|
||||
| `tfOneAssetWithdrawAll` | `0x00040000` | `Amount` only | Withdraw at least the specified amount of one asset, by returning _all_ of your LP Tokens. Fails if you can't receive at least the specified amount. The specified amount can be 0, meaning the transaction succeeds if it withdraws any positive amount. |
|
||||
| `tfOneAssetLPToken` | `0x00200000` | `Amount` and `LPTokenIn` | Withdraw up to the specified amount of one asset, by returning up to the specified amount of LP Tokens. |
|
||||
| `tfLimitLPToken` | `0x00400000` | `Amount` and `EPrice` | Withdraw up to the specified amount of one asset, but pay no more than the specified effective price in LP Tokens per unit of the asset received. |
|
||||
|
||||
Any other combination of these fields is invalid.
|
||||
|
||||
### Single Asset Withdrawal Fee
|
||||
|
||||
The fee for a single asset withdrawal is calculated to be the same as if you had done a double-asset withdrawal and then used the AMM to trade all of the other asset for the one you are withdrawing. The trading fee applies to the amount you would need to trade for, but not to the rest of the withdrawal.
|
||||
|
||||
<!-- TODO: add a formula and example calculation(s) of single-asset withdrawal fees -->
|
||||
|
||||
|
||||
### AMMWithdraw Flags
|
||||
|
||||
Transactions of the AMMWithdraw type support additional values in the [`Flags` field](transaction-common-fields.html#flags-field), as follows:
|
||||
|
||||
| Flag Name | Hex Value | Decimal Value | Description |
|
||||
|:------------------------|:-------------|:--------------|:----------------------|
|
||||
| `tfLPToken` | `0x00010000` | 65536 | Perform a double-asset withdrawal and receive the specified amount of LP Tokens. |
|
||||
| `tfWithdrawAll` | `0x00020000` | 131072 | Perform a double-asset withdrawal returning all your LP Tokens. |
|
||||
| `tfOneAssetWithdrawAll` | `0x00040000` | 262144 | Perform a single-asset withdrawal returning all of your LP Tokens. |
|
||||
| `tfSingleAsset` | `0x00080000` | 524288 | Perform a single-asset withdrawal with a specified amount of the asset to withdrawal. |
|
||||
| `tfTwoAsset` | `0x00100000` | 1048576 | Perform a double-asset withdrawal with specified amounts of both assets. |
|
||||
| `tfOneAssetLPToken` | `0x00200000` | 2097152 | Perform a single-asset withdrawal and receive the specified amount of LP Tokens. |
|
||||
| `tfLimitLPToken` | `0x00400000` | 4194304 | Perform a single-asset withdrawal with a specified effective price. |
|
||||
|
||||
You must specify **exactly one** of these flags, plus any [global flags](transaction-common-fields.html#global-flags).
|
||||
|
||||
|
||||
## Error Cases
|
||||
|
||||
Besides errors that can occur for all transactions, {{currentpage.name}} transactions can result in the following [transaction result codes](transaction-results.html):
|
||||
|
||||
| Error Code | Description |
|
||||
|:-------------------------|:---------------------------------------------|
|
||||
| `tecFROZEN` | The transaction tried to deposit a [frozen](freezes.html) token. |
|
||||
| `tecAMM_BALANCE` | The transaction would withdraw all of one asset from the pool, or rounding would cause a "withdraw all" to leave a nonzero amount behind. |
|
||||
| `tecAMM_FAILED_WITHDRAW` | The conditions on the withdrawal could not be satisfied; for example, the requested effective price in the `EPrice` field is too low. |
|
||||
| `tecAMM_INVALID_TOKENS` | The AMM for this token pair does not exist, or one of the calculations resulted in a withdrawal amount rounding to zero. |
|
||||
| `tecINSUF_RESERVE_LINE` | The sender of this transaction does not meet the increased [reserve requirement](reserves.html) of processing this transaction, probably because they need at least one new trust line to hold one of the assets to be withdrawn, and they don't have enough XRP to meet the additional owner reserve for a new trust line. |
|
||||
| `tecNO_AUTH` | The sender is not authorized to hold one of the deposit assets. |
|
||||
| `temBAD_AMM_OPTIONS` | The transaction specified an invalid combination of fields. See [AMMWithdraw Modes](#ammwithdraw-modes). |
|
||||
| `temBAD_AMM_TOKENS` | The transaction specified the LP Tokens incorrectly; for example, the `issuer` is not the AMM's associated AccountRoot address or the `currency` is not the currency code for this AMM's LP Tokens, or the transaction specified this AMM's LP Tokens in one of the asset fields. |
|
||||
| `terNO_AMM` | The Automated Market Maker instance for the asset pair in this transaction does not exist. |
|
||||
|
||||
|
||||
<!--{# common link defs #}-->
|
||||
{% include '_snippets/rippled-api-links.md' %}
|
||||
{% include '_snippets/tx-type-links.md' %}
|
||||
{% include '_snippets/rippled_versions.md' %}
|
||||
@@ -6,7 +6,7 @@ labels:
|
||||
- Checks
|
||||
---
|
||||
# CheckCreate
|
||||
[[ソース]](https://github.com/ripple/rippled/blob/master/src/ripple/app/tx/impl/CreateCheck.cpp "Source")
|
||||
[[ソース]](https://github.com/XRPLF/rippled/blob/master/src/ripple/app/tx/impl/CreateCheck.cpp "Source")
|
||||
|
||||
_([Checks Amendment][]が必要です)_
|
||||
|
||||
@@ -40,6 +40,7 @@ _([Checks Amendment][]が必要です)_
|
||||
|
||||
## エラーケース
|
||||
|
||||
- `Destination`アカウントがCheckの着信をブロックしている場合、トランザクションは結果コード`tecNO_PERMISSION`で失敗します。 _([DisallowIncoming amendment][] :not_enabled: が必要です。)_
|
||||
- `Destination`がトランザクションの送信者である場合、トランザクションは結果コード`temREDUNDANT`で失敗します。
|
||||
- `Destination`[アカウント](accounts.html)がレジャーに存在していない場合、トランザクションは結果コード`tecNO_DST`で失敗します。
|
||||
- `Destination`アカウントでRequireDestフラグが有効であるが、トランザクションに`DestinationTag`フィールドが含まれていない場合、トランザクションは結果コード`tecDST_TAG_NEEDED`で失敗します。
|
||||
|
||||
@@ -6,10 +6,11 @@ labels:
|
||||
- 非代替性トークン, NFT
|
||||
---
|
||||
# NFTokenCreateOffer
|
||||
[[ソース]](https://github.com/XRPLF/rippled/blob/master/src/ripple/app/tx/impl/NFTokenCreateOffer.cpp "ソース")
|
||||
|
||||
トランザクションを送信するアカウントが所有する `NFToken` に対する新しい _売却_ オファー、または別のアカウントが所有する `NFToken` に対する新しい _購入_ オファー を作成します。
|
||||
トランザクションを送信するアカウントが所有する`NFToken`に対する新しい _売却_ オファー、または別のアカウントが所有する`NFToken`に対する新しい _購入_ オファーを作成します。
|
||||
|
||||
成功した場合、トランザクションは[NFTokenOfferオブジェクト][]を作成します。各オファーは、オファーを提示したアカウントの [所有者準備金](reserves.html) に関連づけて1つのオブジェクトとしてカウントされます。
|
||||
成功した場合、トランザクションは[NFTokenOfferオブジェクト][]を作成します。各オファーは、オファーを提示したアカウントの[所有者準備金](reserves.html)に関連づけて1つのオブジェクトとしてカウントされます。
|
||||
|
||||
_([NonFungibleTokensV1_1 amendment][]が必要です)_
|
||||
|
||||
@@ -30,9 +31,9 @@ _([NonFungibleTokensV1_1 amendment][]が必要です)_
|
||||
|
||||
| フィールド | JSONの型 | [内部の型][] | 説明 |
|
||||
|:--------------|:--------------------|:------------------|:-------------------|
|
||||
| `Owner` | 文字列 | AccountID | _(省略可)_ 対応する `NFToken` の所有者を指定します。トークンの購入オファーである場合、このフィールドは必ず存在し、 `Account` フィールドとは異なるものでなければなりません (すでに保有しているトークンの購入オファーは無意味)。トークンの売却オファーで ある場合、このフィールドは存在してはいけません。所有者は暗黙のうちに `Account` と同じになるからです(すでに保有していないトークンを売却するオファーは無意味)。 |
|
||||
| `NFTokenID` | 文字列 | Hash256 | オファーが参照する `NFToken` オブジェクトを指定します。 |
|
||||
| `Amount` | [通貨額][] | Amount | 対応する `NFToken` に対する売却希望額または売却提示額を表します。0 を指定することは、トークンの現在の所有者が、誰でも、または `Destination` フィールドで指定されたアカウントに、トークンを無償で譲渡することを意味します。 |
|
||||
| `Owner` | 文字列 | AccountID | _(省略可)_ 対応する`NFToken`の所有者を指定します。トークンの購入オファーである場合、このフィールドは必ず存在し、`Account`フィールドとは異なるものでなければなりません(すでに保有しているトークンの購入オファーは無意味)。トークンの売却オファーである場合、このフィールドは存在してはいけません。所有者は暗黙のうちに`Account`と同じになるからです(すでに保有していないトークンを売却するオファーは無意味)。 |
|
||||
| `NFTokenID` | 文字列 | Hash256 | オファーが参照する`NFToken`オブジェクトを指定します。 |
|
||||
| `Amount` | [通貨額][] | Amount | 対応する`NFToken`に対する売却希望額または売却提示額を表します。0を指定することは、トークンの現在の所有者が、誰でも、または`Destination`フィールドで指定されたアカウントに、トークンを無償で譲渡することを意味します。 |
|
||||
| `Expiration` | 数値 | UInt32 | _(省略可)_ オファーが無効となる時間を指定します。値は[Rippleエポック以降の経過秒数][]です。 |
|
||||
| `Destination` | 文字列 | AccountID | _(省略可)_ 存在する場合、このオファーは指定されたアカウントによってのみ受け入れることが可能であることを示します。他のアカウントによってこのオファーを受け入れることはできません。 |
|
||||
|
||||
@@ -53,18 +54,19 @@ NFTokenCreateOfferタイプのトランザクションは、以下のように[`
|
||||
| エラーコード | 説明 |
|
||||
|:---------------------------------|:------------------------------------------|
|
||||
| `temDISABLED` | [NonFungibleTokensV1の修正][]は有効ではありません。 |
|
||||
| `temBAD_AMOUNT` | `Amount` フィールドが有効ではありません。例えば、購入オファーで金額がゼロであったり、金額は発行済み通貨であるが `NFToken` で [`lsfOnlyXRP` flag](nftoken.html#nftoken-フラグ) が有効になっている場合などです。 |
|
||||
| `temBAD_AMOUNT` | `Amount`フィールドが有効ではありません。例えば、購入オファーで金額がゼロであったり、金額は発行済み通貨であるが`NFToken`で[`lsfOnlyXRP`フラグ](nftoken.html#nftoken-フラグ)が有効になっている場合などです。 |
|
||||
| `temBAD_EXPIRATION` | 指定された`Expiration`は無効です(例:`0`)。 |
|
||||
| `tecDIR_FULL` | 送信者がレジャーにすでにあまりにも多くのオブジェクトを所有しているか、またはこのトークンの売買のオファーがあまりにも多く存在しています。 |
|
||||
| `tecEXPIRED` | 指定された`Expiration`の時間は既に経過しています。 |
|
||||
| `tecFROZEN` | `Amount`は発行済み通貨で、このオファーからトークンを受け取るトラストラインは[凍結](freezes.html)されています。これは売却者のトラストラインか、`NFToken`の発行者のトラストライン(`NFToken`に送金手数料がある場合)である可能性があります。 |
|
||||
| `tecINSUFFICIENT_RESERVE` | 送信者はこのオファーを提示した後、[所有者準備金](reserves.html) を満たすのに十分なXRPを持っていません。 |
|
||||
| `tecINSUFFICIENT_RESERVE` | 送信者はこのオファーを提示した後、[所有者準備金](reserves.html)を満たすのに十分なXRPを持っていません。 |
|
||||
| `tecNO_DST` | `Destination`に指定されたアカウントがレジャーに存在しません。 |
|
||||
| `tecNO_ENTRY` | `NFToken`フィールドで指定したアカウントは所有していません。 |
|
||||
| `tecNO_ISSUER` | `Amount`フィールドで指定した発行者が存在しません。 |
|
||||
| `tecNO_LINE` | `Amount`フィールドは発行済み通貨ですが、`NFToken`の発行者はそのトークンのトラストラインを持っておらず、`NFToken`は [`lsfTrustLine` フラグ](nftoken.html#nftoken-フラグ) が有効ではありません。 |
|
||||
| `tecUNFUNDED_OFFER` | 購入オファーの場合、送信者は `Amount` フィールドで指定された通貨を利用可能です。もし `Amount` が XRP である場合、これは準備不足によるものかもしれません。もし `Amount` が発行済み通貨である場合、これは[凍結](freezes.html) されている可能性があります。 |
|
||||
| `tefNFTOKEN_IS_NOT_TRANSFERABLE` | `NFToken` は [`lsfTransferable` flag](nftoken.html#nftoken-flags) が無効になっており、このトランザクションでは `NFToken` を発行者に転送したり発行者から転送したりすることはできません。 |
|
||||
| `tecNO_LINE` | `Amount`フィールドは発行済み通貨ですが、`NFToken`の発行者はそのトークンのトラストラインを持っておらず、`NFToken`は[`lsfTrustLine`フラグ](nftoken.html#nftoken-フラグ)が有効ではありません。 |
|
||||
| `tecNO_PERMISSION` | `Destination`アカウントが着信する NFTokenOffer をブロックします。 _([DisallowIncoming amendment][] :not_enabled: が必要です。)_
|
||||
| `tecUNFUNDED_OFFER` | 購入オファーの場合、送信者は`Amount`フィールドで指定された通貨を利用可能です。もし`Amount`がXRPである場合、これは準備不足によるものかもしれません。もし`Amount`が発行済み通貨である場合、これは[凍結](freezes.html)されている可能性があります。 |
|
||||
| `tefNFTOKEN_IS_NOT_TRANSFERABLE` | `NFToken`は[`lsfTransferable`フラグ](nftoken.html#nftoken-flags)が無効になっており、このトランザクションでは`NFToken`を発行者に転送したり発行者から転送したりすることはできません。 |
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,17 +1,15 @@
|
||||
---
|
||||
html: offercreate.html
|
||||
parent: transaction-types.html
|
||||
blurb: OfferCreateは通貨の交換を行う意図を定義するもので、配置時に完全に履行されていない場合はOfferオブジェクトを作成します。
|
||||
blurb: 通貨交換の注文を作成します。
|
||||
labels:
|
||||
- 分散型取引所
|
||||
---
|
||||
# OfferCreate
|
||||
|
||||
[[ソース]](https://github.com/ripple/rippled/blob/master/src/ripple/app/tx/impl/CreateOffer.cpp "Source")
|
||||
[[ソース]](https://github.com/XRPLF/rippled/blob/master/src/ripple/app/tx/impl/CreateOffer.cpp "ソース")
|
||||
|
||||
OfferCreateトランザクションは、効果的な[指値注文](http://en.wikipedia.org/wiki/limit_order)です。OfferCreateは通貨の交換を行う意図を定義するもので、配置時に完全に履行されていない場合は[Offerオブジェクト](offer.html)を作成します。オファーは部分的に履行することもできます。
|
||||
|
||||
オファーがどのように機能するかについての詳細は、[オファー](offers.html)を参照してください。
|
||||
OfferCreateトランザクションは[分散型取引所](decentralized-exchange.html)で[注文](offers.html)を作成します。
|
||||
|
||||
## {{currentpage.name}} JSONの例
|
||||
|
||||
@@ -36,35 +34,44 @@ OfferCreateトランザクションは、効果的な[指値注文](http://en.wi
|
||||
<!--{# fix md highlighting_ #}-->
|
||||
|
||||
|
||||
| フィールド | JSONの型 | [内部の型][] | 説明 |
|
||||
|:---------------|:--------------------|:------------------|:------------------|
|
||||
| [Expiration][] | 数字 | UInt32 | _(省略可)_ オファーがアクティブでなくなるまでの時間([Rippleエポック以降の経過秒数][])。 |
|
||||
| OfferSequence | 数字 | UInt32 | _(省略可)_ 最初に削除されるオファー([OfferCancel][]と同様に指定されます)。 |
|
||||
| TakerGets | [通貨額][] | Amount | オファーの作成者によって作成される金額および通貨の種類。 |
|
||||
| TakerPays | [通貨額][] | Amount | オファーの作成者によって要求される金額および通貨の種類。 |
|
||||
|
||||
[Expiration]: offers.html#オファーの有効期限
|
||||
| フィールド | JSONの型 | [内部の型][] | 説明 |
|
||||
|:-----------------|:----------|:------------|:-----------|
|
||||
| [Expiration][offers.html#オファーの有効期限] | 数字 | UInt32 | _(省略可)_ オファーがアクティブでなくなるまでの時間([Rippleエポック以降の経過秒数][])。 |
|
||||
| `OfferSequence` | 数字 | UInt32 | _(省略可)_ 最初に削除されるオファー([OfferCancel][]と同様に指定されます)。 |
|
||||
| `TakerGets` | [通貨額][] | Amount | オファーの作成者によって作成される金額および通貨の種類。 |
|
||||
| `TakerPays` | [通貨額][] | Amount | オファーの作成者によって要求される金額および通貨の種類。 |
|
||||
|
||||
## OfferCreateフラグ
|
||||
|
||||
OfferCreate型のトランザクションについては、[`Flags`フィールド](transaction-common-fields.html#flagsフィールド)で以下の値が追加でサポートされます。
|
||||
|
||||
| フラグ名 | 16進数 | 10進数 | 説明 |
|
||||
|:--------------------|:-----------|:--------------|:--------------------------|
|
||||
| tfPassive | 0x00010000 | 65536 | 有効な場合、オファーはオファーが完全に一致するオファーを消費せず、代わりにレジャーのOfferオブジェクトになります。それはまだクロスしたオファーを消費します。 |
|
||||
| tfImmediateOrCancel | 0x00020000 | 131072 | オファーを[IOC注文](http://en.wikipedia.org/wiki/Immediate_or_cancel)として扱います。有効な場合、オファーはレジャーオブジェクトにはなりません。レジャー内の既存のオファーと一致させようとするだけです。即時にオファーがどのオファーとも一致しない場合、どの通貨とも取引せずに「正常に」実行します。この場合、トランザクションは `tesSUCCESS`の[結果コード](transaction-results.html)を返しますが、レジャー内には、[Offerオブジェクト](offer.html)を作成しません。 |
|
||||
| tfFillOrKill | 0x00040000 | 262144 | オファーを[FOK注文](http://en.wikipedia.org/wiki/Fill_or_kill)として扱います。レジャー内の既存のオファーのみを一致私用とします。またこれは、全`TakerPays`の数量が取得できる場合に限られます。[fix1578 amendment][]が有効な場合でオファーを配置した時に実行できない場合、トランザクションは`tecKILLED`の[結果コード](transaction-results.html)を返します。そうでない場合は、トランザクションは、どの通貨とも取り引きせずにキャンセルされた場合でも`tesSUCCESS`の結果コードを返します。 |
|
||||
| tfSell | 0x00080000 | 524288 | 取引所で`TakerPays` Amountよりも多く取得することになっても、`TakerGets` Amountを交換します。 |
|
||||
|
||||
次の無効なフラグの組合せは、`temINVALID_FLAG`エラーを返します。
|
||||
|
||||
* tfImmediateOrCancelとtfFillOrKill
|
||||
|
||||
|
||||
|
||||
|
||||
| フラグ名 | 16進数 | 10進数 | 説明 |
|
||||
|:----------------------|:-------------|:--------------|:-------------------|
|
||||
| `tfPassive` | `0x00010000` | 65536 | 有効な場合、オファーはオファーが完全に一致するオファーを消費せず、代わりにレジャーのOfferオブジェクトになります。それはまだクロスしたオファーを消費します。 |
|
||||
| `tfImmediateOrCancel` | `0x00020000` | 131072 | オファーを[IOC注文](http://en.wikipedia.org/wiki/Immediate_or_cancel)として扱います。有効な場合、オファーはレジャーオブジェクトにはなりません。レジャー内の既存のオファーと一致させようとするだけです。即時にオファーがどのオファーとも一致しない場合、どの通貨とも取引せずに「正常に」実行します。この場合、トランザクションは`tesSUCCESS`の[結果コード](transaction-results.html)を返しますが、レジャー内には、[Offerオブジェクト](offer.html)を作成しません。 |
|
||||
| `tfFillOrKill` | `0x00040000` | 262144 | オファーを[FOK注文](http://en.wikipedia.org/wiki/Fill_or_kill)として扱います。レジャー内の既存のオファーのみを一致私用とします。またこれは、全`TakerPays`の数量が取得できる場合に限られます。[fix1578 amendment][]が有効な場合でオファーを配置した時に実行できない場合、トランザクションは`tecKILLED`の[結果コード](transaction-results.html)を返します。そうでない場合は、トランザクションは、どの通貨とも取り引きせずにキャンセルされた場合でも`tesSUCCESS`の結果コードを返します。 |
|
||||
| `tfSell` | `0x00080000` | 524288 | 取引所で`TakerPays`Amountよりも多く取得することになっても、`TakerGets` Amountを交換します。 |
|
||||
|
||||
## エラーケース
|
||||
|
||||
| エラーコード | 説明 |
|
||||
|:-------------------------|:--------------------------------------------------|
|
||||
| `temINVALID_FLAG` | トランザクションが`tfImmediateOrCancel`と`tfFillOrKill`両方を指定した場合に発生します。|
|
||||
| `tecEXPIRED` | トランザクションが指定した`Expiration`の時間が既に経過している場合に発生します。 |
|
||||
| `tecKILLED` | トランザクションが`tfFillOrKill`を指定し、全額を約定できない場合に発生します。_[ImmediateOfferKilled amendment][]_ が有効な場合、この結果コードは、トランザクションが`tfImmediateOrCancel`を指定して資金が移動せずに実行された場合にも発生します(これまでは、これは`tesSUCCESS`を返していました)。 |
|
||||
| `temBAD_EXPIRATION` | トランザクションの`Expiration`フィールドの値が無効なフォーマットの場合に発生します。 |
|
||||
| `temBAD_SEQUENCE` | トランザクションの`OfferSequence`フィールドの値が無効なフォーマットであるか、トランザクション自身の`Sequence`番号より大きい場合に発生します。 |
|
||||
| `temBAD_OFFER` | OfferがXRPとXRPを交換しようとした場合、またはトークンの無効な量やマイナスの量を交換しようとした場合に発生します。 |
|
||||
| `temREDUNDANT` | トランザクションが同じトークン(同じ発行者、通貨コード)を指定した場合に発生します。 |
|
||||
| `temBAD_CURRENCY` | トランザクションで通貨コードが"XRP"のトークンが指定された場合に発生します。 |
|
||||
| `temBAD_ISSUER` | トランザクションが無効な`issuer`値を持つトークンを指定した場合に発生します。 |
|
||||
| `tecNO_ISSUER` | トランザクションで、`issuer`の値が台帳の有効化されたアカウントでないトークンを指定した場合に発生します。|
|
||||
| `tecFROZEN` | [凍結](freezes.html)されたトラストライン(ローカルおよびグローバルの凍結を含む)上のトークンを含むトランザクションの場合に発生します。 |
|
||||
| `tecUNFUNDED_OFFER` | トランザクションの送信者が`TakerGets`の通貨を正の値で保有していない場合に発生する。(例外: `TakerGets`にトランザクションの送信者が発行するトークンを指定した場合、トランザクションは成功します)。 |
|
||||
| `tecNO_LINE` | 発行者が[Authorized Trust Lines](authorized-trust-lines.html)を使用しているトークンを含むトランザクションで、必要なトラストラインが存在しない場合に発生します。 |
|
||||
| `tecNO_AUTH` | 発行者が[Authorized Trust Lines](authorized-trust-lines.html)を使用しているトークンを含むトランザクションで、トークンを受け取るトラストラインが存在するが認証されていない場合に発生します。 |
|
||||
| `tecINSUF_RESERVE_OFFER` | 所有者が台帳に新しいOfferオブジェクトを追加するための準備要件を満たすのに十分なXRPを持っておらず、トランザクションがどの通貨も変換しなかった場合に発生します。(トランザクションが何らかの金額のトレードに成功した場合、トランザクションは結果コード`tesSUCCESS`で成功しますが、残りは台帳にOfferオブジェクトを作成しません)。 |
|
||||
| `tecDIR_FULL` | トランザクションの送信者が台帳で多くのアイテムを所有している場合、またはオーダーブックに同じ取引レートのオファーがすでに多く含まれている場合に発生します。 |
|
||||
|
||||
<!--{# common link defs #}-->
|
||||
{% include '_snippets/rippled-api-links.md' %}
|
||||
|
||||
@@ -7,7 +7,7 @@ labels:
|
||||
---
|
||||
# OfferCreate
|
||||
|
||||
[[Source]](https://github.com/ripple/rippled/blob/master/src/ripple/app/tx/impl/CreateOffer.cpp "Source")
|
||||
[[Source]](https://github.com/XRPLF/rippled/blob/master/src/ripple/app/tx/impl/CreateOffer.cpp "Source")
|
||||
|
||||
An OfferCreate transaction places an [Offer](offers.html) in the [decentralized exchange](decentralized-exchange.html).
|
||||
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
---
|
||||
html: paymentchannelcreate.html
|
||||
parent: transaction-types.html
|
||||
blurb: 一方向のChannelを作成し、XRPを供給します。
|
||||
blurb: 新しいペイメントチャネルを作成します。
|
||||
labels:
|
||||
- Payment Channel
|
||||
---
|
||||
# PaymentChannelCreate
|
||||
[[ソース]](https://github.com/ripple/rippled/blob/master/src/ripple/app/tx/impl/PayChan.cpp "Source")
|
||||
[[ソース]](https://github.com/XRPLF/rippled/blob/master/src/ripple/app/tx/impl/PayChan.cpp "ソース")
|
||||
|
||||
_[PayChan Amendment][]が必要です。_
|
||||
|
||||
一方向のChannelを作成し、XRPを供給します。このトランザクションを送信するアドレスは、Payment Channelの「支払元アドレス」になります。
|
||||
[ペイメントチャンネル](payment-channels.html)を作成し、XRPで資金を供給します。このトランザクションを送信するアドレスが、ペイメントチャネルの「送信元アドレス」となります。
|
||||
|
||||
## {{currentpage.name}} JSONの例
|
||||
|
||||
@@ -37,10 +37,12 @@ _[PayChan Amendment][]が必要です。_
|
||||
| `Amount` | 文字列 | Amount | 送金元の残高から差し引いてこのChannelに留保する[XRP、drop単位][]の額。このChannelのオープン時には、XRPを`Destination`アドレスにのみ移動できます。Channelが閉鎖すると、未請求のXRPは支払元アドレスの残高に戻されます。 |
|
||||
| `Destination` | 文字列 | AccountID | このChannelに対するXRPクレームを受け取るアドレス。Channelの「宛先アドレス」とも呼ばれます。送金元(`Account`)と同一にはできません。 |
|
||||
| `SettleDelay` | 数値 | UInt32 | Channelに未請求のXRPがある場合に、支払元アドレスがそのChannelを閉鎖するまでに待機する時間。 |
|
||||
| `PublicKey` | 文字列 | Blob | 支払元がこのChannelに対するクレームに署名するときに使用する公開鍵またはキーペア(16進数)。secp256k1公開鍵またはEd25519公開鍵を指定できます。 <!-- STYLE_OVERRIDE: will --> |
|
||||
| `PublicKey` | 文字列 | Blob | 送信元がこのチャネルに対する請求に使用する鍵ペアの33バイトの公開鍵を16進数で指定します。これはsecp256k1またはEd25519の公開鍵であることができます。キーペアの詳細については、[鍵の導出](cryptographic-keys.html#鍵導出) を参照してください。 |
|
||||
| `CancelAfter` | 数値 | UInt32 | _(省略可)_ このChannelの有効期限([Rippleエポック以降の経過秒数][])。この時刻の経過後にトランザクションがこのChannelを変更しようとすると、このChannelは閉鎖し、Channelは変更されません。この値は変更できません。Channelはこの時刻よりも早い時点で閉鎖できますが、この時刻の経過後にもオープンしたままにすることはできません。 |
|
||||
| `DestinationTag` | 数値 | UInt32 | _(省略可)_ このPayment Channelの宛先(宛先アドレスのホスティングされている受取人など) を詳しく指定するための任意のタグ。 |
|
||||
|
||||
`Destination` アカウントがペイメントチャネルの着信をブロックしている場合、トランザクションは結果コード`tecNO_PERMISSION` 失敗します。_([DisallowIncoming amendment][] :not_enabled: が必要です)_。
|
||||
|
||||
<!--{# common link defs #}-->
|
||||
{% include '_snippets/rippled-api-links.md' %}
|
||||
{% include '_snippets/tx-type-links.md' %}
|
||||
|
||||
@@ -6,7 +6,7 @@ labels:
|
||||
- Payment Channels
|
||||
---
|
||||
# PaymentChannelCreate
|
||||
[[Source]](https://github.com/ripple/rippled/blob/master/src/ripple/app/tx/impl/PayChan.cpp "Source")
|
||||
[[Source]](https://github.com/XRPLF/rippled/blob/master/src/ripple/app/tx/impl/PayChan.cpp "Source")
|
||||
|
||||
_Added by the [PayChan amendment][]._
|
||||
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
---
|
||||
html: trustset.html
|
||||
parent: transaction-types.html
|
||||
blurb: 2つのアカウントをリンクするトラストラインを作成または変更します。
|
||||
blurb: トラストラインを作成または変更します。
|
||||
labels:
|
||||
- トークン
|
||||
---
|
||||
# TrustSet
|
||||
|
||||
[[ソース]](https://github.com/ripple/rippled/blob/master/src/ripple/app/tx/impl/SetTrust.cpp "Source")
|
||||
[[ソース]](https://github.com/XRPLF/rippled/blob/master/src/ripple/app/tx/impl/SetTrust.cpp "Source")
|
||||
|
||||
2つのアカウントをリンクするトラストラインを作成または変更します。
|
||||
2つのアカウントをリンクする[トラストライン](trust-lines-and-issuing.html)を作成または変更します。
|
||||
|
||||
## {{currentpage.name}} JSONの例
|
||||
|
||||
@@ -41,18 +41,21 @@ labels:
|
||||
| `QualityIn` | 数値 | UInt32 | _(省略可)_ このトラストラインの受入額を、1,000,000,000単位当たりのこの数値の割合で評価。値`0`は、残高を額面価格で扱うことを示す省略表現です。 |
|
||||
| `QualityOut` | 数値 | UInt32 | _(省略可)_ このトラストラインの払出額を、1,000,000,000単位当たりのこの数値の割合で評価。値`0`は、残高を額面価格で扱うことを示す省略表現です。 |
|
||||
|
||||
`LimitAmount.issuer`で指定されたアカウントがトラストラインの着信をブロックしている場合、結果コード`tecNO_PERMISSION`でトランザクションが失敗します。 _([DisallowIncoming amendment][] :not_enabled: が必要です)_
|
||||
|
||||
## TrustSetのフラグ
|
||||
|
||||
TrustSetタイプのトランザクションについては、[`Flags`フィールド](transaction-common-fields.html#flagsフィールド)で以下の値が追加でサポートされます。
|
||||
|
||||
| フラグ名 | 16進数値 | 10進数値 | 説明 |
|
||||
|:----------------|:-----------|:--------------|:------------------------------|
|
||||
| tfSetfAuth | 0x00010000 | 65536 | 他方の当事者がこのアカウントからのイシュアンスを保有することを承認します。([*asfRequireAuth* AccountSet フラグ](accountset.html#accountsetのフラグ)を使用しない場合は効果がありません。)設定を解除できません。 |
|
||||
| tfSetNoRipple | 0x00020000 | 131072 | 同一通貨の2つのトラストラインでこのフラグが設定されている場合、これらのトラストライン間でのripplingがブロックされます。(詳細は、[NoRipple](rippling.html)を参照してください。)[fix1578 Amendment][]が有効な場合、トランザクションにこのフラグが使用されていてもNoRippleを有効にできないときは、そのトランザクションは結果コード`tecNO_PERMISSION`で失敗します。このAmendmentが有効ではない場合は、トラストラインでNoRippleを有効にできない場合でもトランザクションの結果が`tesSUCCESS`になることがあります(トランザクションで可能な他の変更を行います)。 |
|
||||
| tfClearNoRipple | 0x00040000 | 262144 | No-Ripplingフラグをクリアします。(詳細は、[NoRipple](rippling.html)を参照してください。) |
|
||||
| tfSetFreeze | 0x00100000 | 1048576 | トラストラインを[凍結](freezes.html)します。 |
|
||||
| tfClearFreeze | 0x00200000 | 2097152 | トラストラインを[凍結解除](freezes.html)します。 |
|
||||
| フラグ名 | 16進数値 | 10進数値 | 説明 |
|
||||
|:------------------|:-------------|:--------------|:----------------------|
|
||||
| `tfSetfAuth` | `0x00010000` | 65536 | [このアカウントから発行された通貨](issued-currencies.html)を相手方に保有させることを許可します。([*asfRequireAuth* AccountSet フラグ](accountset.html#accountsetのフラグ)を使用しない場合は効果がありません。)設定を解除できません。 |
|
||||
| `tfSetNoRipple` | `0x00020000` | 131072 | 2つのトラストラインの両方でこのフラグが有効になっている場合、同じ通貨のトラストライン間の[リップリング](rippling.html)をブロックする No Ripple フラグを有効にします。 |
|
||||
| `tfClearNoRipple` | `0x00040000` | 262144 | No Rippleフラグを無効にし、このトラストラインで[リップリング](rippling.html)を許可します。 |
|
||||
| `tfSetFreeze` | `0x00100000` | 1048576 | トラストラインを[凍結](freezes.html)します。 |
|
||||
| `tfClearFreeze` | `0x00200000` | 2097152 | トラストラインを[凍結解除](freezes.html)します。 |
|
||||
|
||||
トランザクションがNo Rippleを有効にしようとしたができない場合、結果コード `tecNO_PERMISSION` で失敗します。[fix1578 amendment][]が有効になる前は、このようなトランザクションは代わりに`tesSUCCESS`(可能な限りの他の変更を行う)という結果になりました。
|
||||
|
||||
トラストラインのAuthフラグは、トラストラインがその所有者のXRP必要準備金に反映されるかどうかを左右しません。ただしAuthフラグを有効にすると、トラストラインがデフォルト状態になることがありません。承認されたトラストラインは削除できません。イシュアーは、トラストラインの限度と残高が0であっても、`tfSetfAuth`フラグだけを使用してトラストラインを事前承認できます。
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ labels:
|
||||
---
|
||||
# TrustSet
|
||||
|
||||
[[Source]](https://github.com/ripple/rippled/blob/master/src/ripple/app/tx/impl/SetTrust.cpp "Source")
|
||||
[[Source]](https://github.com/XRPLF/rippled/blob/master/src/ripple/app/tx/impl/SetTrust.cpp "Source")
|
||||
|
||||
Create or modify a [trust line](trust-lines-and-issuing.html) linking two accounts.
|
||||
|
||||
@@ -54,7 +54,7 @@ Transactions of the TrustSet type support additional values in the [`Flags` fiel
|
||||
|:------------------|:-------------|:--------------|:--------------------------|
|
||||
| `tfSetfAuth` | `0x00010000` | 65536 | Authorize the other party to hold [currency issued by this account](issued-currencies.html). (No effect unless using the [`asfRequireAuth` AccountSet flag](accountset.html#accountset-flags).) Cannot be unset. |
|
||||
| `tfSetNoRipple` | `0x00020000` | 131072 | Enable the No Ripple flag, which blocks [rippling](rippling.html) between two trust lines of the same currency if this flag is enabled on both. |
|
||||
| `tfClearNoRipple` | `0x00040000` | 262144 | Disable the No Ripple flag, allowing [rippling](rippling.html) on this trust line.) |
|
||||
| `tfClearNoRipple` | `0x00040000` | 262144 | Disable the No Ripple flag, allowing [rippling](rippling.html) on this trust line. |
|
||||
| `tfSetFreeze` | `0x00100000` | 1048576 | [Freeze](freezes.html) the trust line. |
|
||||
| `tfClearFreeze` | `0x00200000` | 2097152 | [Unfreeze](freezes.html) the trust line. |
|
||||
|
||||
|
||||
Reference in New Issue
Block a user