@ocap/client 1.28.5 → 1.28.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/base.js +1 -3
- package/dist/base.js.map +1 -1
- package/dist/browser.d.ts +270 -175
- package/dist/bundle.js +1 -1
- package/dist/extension.js +0 -8
- package/dist/extension.js.map +1 -1
- package/dist/lite.js +0 -1
- package/dist/lite.js.map +1 -1
- package/dist/module.js +1 -1
- package/dist/module.js.map +1 -1
- package/dist/report.html +2 -2
- package/docs/QUERIES.md +2 -2
- package/docs/README.md +2 -2
- package/docs/api-reference-client-methods.ja.md +6 -1
- package/docs/api-reference-client-methods.md +5 -0
- package/docs/api-reference-client-methods.zh-TW.md +6 -1
- package/docs/api-reference-client-methods.zh.md +6 -1
- package/docs/api-reference-data-types.ja.md +6 -1
- package/docs/api-reference-data-types.md +6 -1
- package/docs/api-reference-data-types.zh-TW.md +6 -1
- package/docs/api-reference-data-types.zh.md +6 -1
- package/docs/api-reference-low-level-api.ja.md +9 -5
- package/docs/api-reference-low-level-api.md +9 -5
- package/docs/api-reference-low-level-api.zh-TW.md +9 -5
- package/docs/api-reference-low-level-api.zh.md +9 -5
- package/docs/api-reference-query-mutation-methods.ja.md +5 -3
- package/docs/api-reference-query-mutation-methods.md +4 -2
- package/docs/api-reference-query-mutation-methods.zh-TW.md +5 -3
- package/docs/api-reference-query-mutation-methods.zh.md +5 -3
- package/docs/api-reference-transaction-helpers.ja.md +6 -1
- package/docs/api-reference-transaction-helpers.md +5 -0
- package/docs/api-reference-transaction-helpers.zh-TW.md +6 -1
- package/docs/api-reference-transaction-helpers.zh.md +6 -1
- package/docs/api-reference.ja.md +1 -1
- package/docs/api-reference.md +1 -1
- package/docs/api-reference.zh-TW.md +1 -1
- package/docs/api-reference.zh.md +1 -1
- package/docs/core-concepts-client-architecture.ja.md +16 -11
- package/docs/core-concepts-client-architecture.md +16 -11
- package/docs/core-concepts-client-architecture.zh-TW.md +16 -11
- package/docs/core-concepts-client-architecture.zh.md +16 -11
- package/docs/core-concepts-event-subscriptions.ja.md +12 -7
- package/docs/core-concepts-event-subscriptions.md +12 -7
- package/docs/core-concepts-event-subscriptions.zh-TW.md +12 -7
- package/docs/core-concepts-event-subscriptions.zh.md +12 -7
- package/docs/core-concepts-gas-payment.ja.md +7 -3
- package/docs/core-concepts-gas-payment.md +7 -3
- package/docs/core-concepts-gas-payment.zh-TW.md +7 -3
- package/docs/core-concepts-gas-payment.zh.md +7 -3
- package/docs/core-concepts-transaction-lifecycle.ja.md +15 -7
- package/docs/core-concepts-transaction-lifecycle.md +15 -7
- package/docs/core-concepts-transaction-lifecycle.zh-TW.md +15 -7
- package/docs/core-concepts-transaction-lifecycle.zh.md +15 -7
- package/docs/core-concepts.ja.md +1 -1
- package/docs/core-concepts.md +1 -1
- package/docs/core-concepts.zh-TW.md +1 -1
- package/docs/core-concepts.zh.md +1 -1
- package/docs/getting-started-basic-usage.ja.md +6 -1
- package/docs/getting-started-basic-usage.md +6 -1
- package/docs/getting-started-basic-usage.zh-TW.md +6 -1
- package/docs/getting-started-basic-usage.zh.md +6 -1
- package/docs/getting-started-installation.ja.md +7 -3
- package/docs/getting-started-installation.md +7 -3
- package/docs/getting-started-installation.zh-TW.md +7 -3
- package/docs/getting-started-installation.zh.md +7 -3
- package/docs/getting-started.ja.md +1 -1
- package/docs/getting-started.md +1 -1
- package/docs/getting-started.zh-TW.md +1 -1
- package/docs/getting-started.zh.md +1 -1
- package/docs/how-to-guides-delegate-permissions.ja.md +4 -1
- package/docs/how-to-guides-delegate-permissions.md +3 -0
- package/docs/how-to-guides-delegate-permissions.zh-TW.md +4 -1
- package/docs/how-to-guides-delegate-permissions.zh.md +4 -1
- package/docs/how-to-guides-manage-accounts.ja.md +4 -3
- package/docs/how-to-guides-manage-accounts.md +4 -3
- package/docs/how-to-guides-manage-accounts.zh-TW.md +4 -3
- package/docs/how-to-guides-manage-accounts.zh.md +4 -3
- package/docs/how-to-guides-manage-assets.ja.md +6 -2
- package/docs/how-to-guides-manage-assets.md +6 -2
- package/docs/how-to-guides-manage-assets.zh-TW.md +6 -2
- package/docs/how-to-guides-manage-assets.zh.md +6 -2
- package/docs/how-to-guides-manage-tokens.ja.md +8 -1
- package/docs/how-to-guides-manage-tokens.md +8 -1
- package/docs/how-to-guides-manage-tokens.zh-TW.md +8 -1
- package/docs/how-to-guides-manage-tokens.zh.md +8 -1
- package/docs/how-to-guides-stake-tokens-and-assets.ja.md +11 -5
- package/docs/how-to-guides-stake-tokens-and-assets.md +11 -5
- package/docs/how-to-guides-stake-tokens-and-assets.zh-TW.md +11 -5
- package/docs/how-to-guides-stake-tokens-and-assets.zh.md +11 -5
- package/docs/how-to-guides-transfer-tokens-and-nfts.ja.md +8 -6
- package/docs/how-to-guides-transfer-tokens-and-nfts.md +8 -6
- package/docs/how-to-guides-transfer-tokens-and-nfts.zh-TW.md +8 -6
- package/docs/how-to-guides-transfer-tokens-and-nfts.zh.md +8 -6
- package/docs/how-to-guides.ja.md +1 -1
- package/docs/how-to-guides.md +1 -1
- package/docs/how-to-guides.zh-TW.md +1 -1
- package/docs/how-to-guides.zh.md +1 -1
- package/docs/overview.ja.md +5 -3
- package/docs/overview.md +5 -3
- package/docs/overview.zh-TW.md +5 -3
- package/docs/overview.zh.md +5 -3
- package/examples/asset.js +0 -2
- package/examples/create-secondary-token.js +0 -2
- package/examples/declare.js +0 -1
- package/examples/delegate-exchange-both.js +1 -3
- package/examples/delegate-exchange.js +1 -3
- package/examples/delegate-transfer.js +0 -1
- package/examples/exchange-secondary-token.js +0 -2
- package/examples/exchange.js +0 -2
- package/examples/migrate-account.js +0 -1
- package/examples/run-no-debug.sh +0 -0
- package/examples/run.sh +0 -0
- package/examples/subscribe.js +0 -2
- package/examples/transfer-asset.js +0 -2
- package/examples/transfer-primary-token.js +0 -1
- package/examples/transfer-secondary-token.js +0 -2
- package/lib/base.js +1 -3
- package/lib/base.js.map +1 -1
- package/lib/extension.js +0 -8
- package/lib/extension.js.map +1 -1
- package/lib/lite.js +0 -1
- package/lib/lite.js.map +1 -1
- package/lib/module.js +1 -1
- package/lib/module.js.map +1 -1
- package/lib/node.d.ts +270 -175
- package/lib/node.js +1 -1
- package/lib/node.js.map +1 -1
- package/package.json +30 -32
package/docs/QUERIES.md
CHANGED
|
@@ -2244,13 +2244,13 @@ No arguments
|
|
|
2244
2244
|
* **stakeFilter**, optional, null
|
|
2245
2245
|
* **delegationFilter**, optional, null
|
|
2246
2246
|
* **tokenFactoryFilter**, optional, null
|
|
2247
|
-
* **
|
|
2247
|
+
* **includeItxData**, optional, null
|
|
2248
2248
|
|
|
2249
2249
|
#### Result Format
|
|
2250
2250
|
|
|
2251
2251
|
```graphql
|
|
2252
2252
|
{
|
|
2253
|
-
listTransactions(
|
|
2253
|
+
listTransactions(includeItxData: true) {
|
|
2254
2254
|
code
|
|
2255
2255
|
page {
|
|
2256
2256
|
cursor
|
package/docs/README.md
CHANGED
|
@@ -6219,7 +6219,7 @@ Checkout the following snippet for the format of ListTransactionsParams:
|
|
|
6219
6219
|
|
|
6220
6220
|
```json
|
|
6221
6221
|
{
|
|
6222
|
-
"
|
|
6222
|
+
"includeItxData": true
|
|
6223
6223
|
}
|
|
6224
6224
|
```
|
|
6225
6225
|
|
|
@@ -6242,7 +6242,7 @@ Checkout the following snippet for the format of ListTransactionsParams:
|
|
|
6242
6242
|
| ...stakeFilter | [`StakeFilterInput`](#GraphQLClient.StakeFilterInput) |
|
|
6243
6243
|
| ...delegationFilter | [`DelegationFilterInput`](#GraphQLClient.DelegationFilterInput) |
|
|
6244
6244
|
| ...tokenFactoryFilter | [`TokenFactoryFilterInput`](#GraphQLClient.TokenFactoryFilterInput) |
|
|
6245
|
-
|
|
|
6245
|
+
| includeItxData | `boolean` |
|
|
6246
6246
|
|
|
6247
6247
|
### GraphQLClient.ListTokensParams : `object`
|
|
6248
6248
|
|
|
@@ -16,6 +16,7 @@ const client = new GraphQLClient('https://beta.abtnetwork.io/api');
|
|
|
16
16
|
|
|
17
17
|
このセクションでは、`GraphQLClient` クラスのコアヘルパーメソッドについて詳しく解説します。
|
|
18
18
|
|
|
19
|
+
|
|
19
20
|
## コンストラクタ
|
|
20
21
|
|
|
21
22
|
### new GraphQLClient(endpoint, autoInit)
|
|
@@ -41,6 +42,7 @@ const client = new GraphQLClient('https://beta.abtnetwork.io/api', true);
|
|
|
41
42
|
|
|
42
43
|
---
|
|
43
44
|
|
|
45
|
+
|
|
44
46
|
## コアメソッド
|
|
45
47
|
|
|
46
48
|
これらのメソッドは、クライアントとチェーンと対話するための基本的な機能を提供します。
|
|
@@ -111,6 +113,7 @@ logChainToken();
|
|
|
111
113
|
|
|
112
114
|
---
|
|
113
115
|
|
|
116
|
+
|
|
114
117
|
## イベントのサブスクリプション
|
|
115
118
|
|
|
116
119
|
クライアントは WebSocket を介したリアルタイムのイベントサブスクリプションをサポートしており、アプリケーションがオンチェーンイベントに即座に反応できるようにします。
|
|
@@ -154,6 +157,7 @@ console.log('Subscribed to newBlock events...');
|
|
|
154
157
|
|
|
155
158
|
---
|
|
156
159
|
|
|
160
|
+
|
|
157
161
|
## トークンユーティリティメソッド
|
|
158
162
|
|
|
159
163
|
これらのヘルパーは、人間が読める形式のトークン量とオンチェーンの基本単位表現との間の変換を簡素化します。
|
|
@@ -200,6 +204,7 @@ convertToken();
|
|
|
200
204
|
|
|
201
205
|
---
|
|
202
206
|
|
|
207
|
+
|
|
203
208
|
## メソッドのディスカバリー
|
|
204
209
|
|
|
205
210
|
クライアントは、接続されている OCAP ノードでサポートされているすべてのトランザクションタイプに対応するメソッドを動的に生成します。これらのディスカバリーメソッドを使用すると、利用可能なすべてのトランザクション関連の関数をプログラムで一覧表示できます。
|
|
@@ -226,4 +231,4 @@ convertToken();
|
|
|
226
231
|
const sendMethods = client.getTxSendMethods();
|
|
227
232
|
console.log('Available send methods:', sendMethods);
|
|
228
233
|
// 出力例: [ 'sendPokeTx', 'sendTransferTx', ... ]
|
|
229
|
-
```
|
|
234
|
+
```
|
|
@@ -16,6 +16,7 @@ const client = new GraphQLClient('https://beta.abtnetwork.io/api');
|
|
|
16
16
|
|
|
17
17
|
This section provides a detailed reference for the core helper methods of the `GraphQLClient` class.
|
|
18
18
|
|
|
19
|
+
|
|
19
20
|
## Constructor
|
|
20
21
|
|
|
21
22
|
### new GraphQLClient(endpoint, autoInit)
|
|
@@ -41,6 +42,7 @@ const client = new GraphQLClient('https://beta.abtnetwork.io/api', true);
|
|
|
41
42
|
|
|
42
43
|
---
|
|
43
44
|
|
|
45
|
+
|
|
44
46
|
## Core Methods
|
|
45
47
|
|
|
46
48
|
These methods provide fundamental functionality for interacting with the client and the chain.
|
|
@@ -111,6 +113,7 @@ Retrieves the Protobuf message class for a given type name. This is useful for a
|
|
|
111
113
|
|
|
112
114
|
---
|
|
113
115
|
|
|
116
|
+
|
|
114
117
|
## Event Subscription
|
|
115
118
|
|
|
116
119
|
The client supports real-time event subscriptions over WebSockets, allowing your application to react instantly to on-chain events.
|
|
@@ -154,6 +157,7 @@ console.log('Subscribed to newBlock events...');
|
|
|
154
157
|
|
|
155
158
|
---
|
|
156
159
|
|
|
160
|
+
|
|
157
161
|
## Token Utility Methods
|
|
158
162
|
|
|
159
163
|
These helpers simplify conversions between the human-readable token amount and the on-chain base unit representation.
|
|
@@ -200,6 +204,7 @@ convertToken();
|
|
|
200
204
|
|
|
201
205
|
---
|
|
202
206
|
|
|
207
|
+
|
|
203
208
|
## Method Discovery
|
|
204
209
|
|
|
205
210
|
The client dynamically generates methods for every transaction type supported by the connected OCAP node. These discovery methods allow you to programmatically list all available transaction-related functions.
|
|
@@ -16,6 +16,7 @@ const client = new GraphQLClient('https://beta.abtnetwork.io/api');
|
|
|
16
16
|
|
|
17
17
|
本節為 `GraphQLClient` 類別的核心輔助方法提供了詳細的參考。
|
|
18
18
|
|
|
19
|
+
|
|
19
20
|
## 建構函式
|
|
20
21
|
|
|
21
22
|
### new GraphQLClient(endpoint, autoInit)
|
|
@@ -41,6 +42,7 @@ const client = new GraphQLClient('https://beta.abtnetwork.io/api', true);
|
|
|
41
42
|
|
|
42
43
|
---
|
|
43
44
|
|
|
45
|
+
|
|
44
46
|
## 核心方法
|
|
45
47
|
|
|
46
48
|
這些方法提供了與客戶端和鏈互動的基礎功能。
|
|
@@ -111,6 +113,7 @@ logChainToken();
|
|
|
111
113
|
|
|
112
114
|
---
|
|
113
115
|
|
|
116
|
+
|
|
114
117
|
## 事件訂閱
|
|
115
118
|
|
|
116
119
|
客戶端支援透過 WebSocket 進行的即時事件訂閱,讓您的應用程式能即時對鏈上事件作出反應。
|
|
@@ -154,6 +157,7 @@ console.log('Subscribed to newBlock events...');
|
|
|
154
157
|
|
|
155
158
|
---
|
|
156
159
|
|
|
160
|
+
|
|
157
161
|
## 代幣工具方法
|
|
158
162
|
|
|
159
163
|
這些輔助方法簡化了人類可讀的代幣數量與鏈上基礎單位表示之間的轉換。
|
|
@@ -200,6 +204,7 @@ convertToken();
|
|
|
200
204
|
|
|
201
205
|
---
|
|
202
206
|
|
|
207
|
+
|
|
203
208
|
## 方法探索
|
|
204
209
|
|
|
205
210
|
客戶端會為所連線的 OCAP 節點支援的每種交易類型動態產生方法。這些探索方法讓您能以程式化的方式列出所有可用的交易相關函式。
|
|
@@ -226,4 +231,4 @@ convertToken();
|
|
|
226
231
|
const sendMethods = client.getTxSendMethods();
|
|
227
232
|
console.log('Available send methods:', sendMethods);
|
|
228
233
|
// 範例輸出:[ 'sendPokeTx', 'sendTransferTx', ... ]
|
|
229
|
-
```
|
|
234
|
+
```
|
|
@@ -16,6 +16,7 @@ const client = new GraphQLClient('https://beta.abtnetwork.io/api');
|
|
|
16
16
|
|
|
17
17
|
本节为 `GraphQLClient` 类的核心辅助方法提供了详细的参考。
|
|
18
18
|
|
|
19
|
+
|
|
19
20
|
## 构造函数
|
|
20
21
|
|
|
21
22
|
### new GraphQLClient(endpoint, autoInit)
|
|
@@ -41,6 +42,7 @@ const client = new GraphQLClient('https://beta.abtnetwork.io/api', true);
|
|
|
41
42
|
|
|
42
43
|
---
|
|
43
44
|
|
|
45
|
+
|
|
44
46
|
## 核心方法
|
|
45
47
|
|
|
46
48
|
这些方法提供了与客户端和链进行交互的基本功能。
|
|
@@ -111,6 +113,7 @@ logChainToken();
|
|
|
111
113
|
|
|
112
114
|
---
|
|
113
115
|
|
|
116
|
+
|
|
114
117
|
## 事件订阅
|
|
115
118
|
|
|
116
119
|
客户端支持通过 WebSocket 进行实时事件订阅,使您的应用程序能够对链上事件做出即时反应。
|
|
@@ -154,6 +157,7 @@ console.log('Subscribed to newBlock events...');
|
|
|
154
157
|
|
|
155
158
|
---
|
|
156
159
|
|
|
160
|
+
|
|
157
161
|
## Token 工具方法
|
|
158
162
|
|
|
159
163
|
这些辅助方法简化了人类可读的 token 数量与链上基本单位表示之间的转换。
|
|
@@ -200,6 +204,7 @@ convertToken();
|
|
|
200
204
|
|
|
201
205
|
---
|
|
202
206
|
|
|
207
|
+
|
|
203
208
|
## 方法发现
|
|
204
209
|
|
|
205
210
|
客户端为所连接的 OCAP 节点支持的每种交易类型动态生成方法。这些发现方法允许您以编程方式列出所有可用的与交易相关的函数。
|
|
@@ -226,4 +231,4 @@ convertToken();
|
|
|
226
231
|
const sendMethods = client.getTxSendMethods();
|
|
227
232
|
console.log('Available send methods:', sendMethods);
|
|
228
233
|
// 示例输出:[ 'sendPokeTx', 'sendTransferTx', ... ]
|
|
229
|
-
```
|
|
234
|
+
```
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
このセクションでは、OCAP Client API全体で使用されるすべてのカスタムデータ構造、入力パラメータ、および応答オブジェクトに関する包括的なリファレンスを提供します。これらの型を理解することは、OCAPブロックチェーンと効果的に対話するために不可欠です。
|
|
4
4
|
|
|
5
|
+
|
|
5
6
|
## コアタイプ
|
|
6
7
|
|
|
7
8
|
これらは、さまざまなAPIコールで使用される基本的なデータ構造です。
|
|
@@ -78,6 +79,7 @@ protobufメッセージ用の汎用コンテナで、柔軟なデータ構造を
|
|
|
78
79
|
<x-field data-name="role" data-type="RoleType"></x-field>
|
|
79
80
|
</x-field-group>
|
|
80
81
|
|
|
82
|
+
|
|
81
83
|
## 入力およびフィルタータイプ
|
|
82
84
|
|
|
83
85
|
これらのオブジェクトは、GraphQLクエリのパラメータとフィルターを提供するために使用されます。
|
|
@@ -199,6 +201,7 @@ protobufメッセージ用の汎用コンテナで、柔軟なデータ構造を
|
|
|
199
201
|
</x-field>
|
|
200
202
|
</x-field-group>
|
|
201
203
|
|
|
204
|
+
|
|
202
205
|
## ステートオブジェクト
|
|
203
206
|
|
|
204
207
|
これらの型は、アカウント、アセット、トークンなど、ブロックチェーン上のさまざまなエンティティの状態を表します。
|
|
@@ -345,6 +348,7 @@ protobufメッセージ用の汎用コンテナで、柔軟なデータ構造を
|
|
|
345
348
|
<x-field data-name="data" data-type="Any"></x-field>
|
|
346
349
|
</x-field-group>
|
|
347
350
|
|
|
351
|
+
|
|
348
352
|
## トランザクションペイロード(ITX)
|
|
349
353
|
|
|
350
354
|
これらの型は、さまざまなトランザクションタイプに対する `itx` (内部トランザクション) オブジェクトを定義します。
|
|
@@ -427,6 +431,7 @@ protobufメッセージ用の汎用コンテナで、柔軟なデータ構造を
|
|
|
427
431
|
<x-field data-name="data" data-type="Any"></x-field>
|
|
428
432
|
</x-field-group>
|
|
429
433
|
|
|
434
|
+
|
|
430
435
|
## 応答ラッパー
|
|
431
436
|
|
|
432
437
|
これらの型は、APIクエリによって返されるトップレベルのオブジェクトであり、ステータスコードと要求されたデータを含みます。
|
|
@@ -479,4 +484,4 @@ protobufメッセージ用の汎用コンテナで、柔軟なデータ構造を
|
|
|
479
484
|
<x-field-group>
|
|
480
485
|
<x-field data-name="code" data-type="string"></x-field>
|
|
481
486
|
<x-field data-name="hash" data-type="string"></x-field>
|
|
482
|
-
</x-field-group>
|
|
487
|
+
</x-field-group>
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
This section provides a comprehensive reference for all the custom data structures, input parameters, and response objects used throughout the OCAP Client API. Understanding these types is essential for effectively interacting with the OCAP blockchain.
|
|
4
4
|
|
|
5
|
+
|
|
5
6
|
## Core Types
|
|
6
7
|
|
|
7
8
|
These are fundamental data structures used across various API calls.
|
|
@@ -78,6 +79,7 @@ These types define the structure of wallets used for signing transactions.
|
|
|
78
79
|
<x-field data-name="role" data-type="RoleType"></x-field>
|
|
79
80
|
</x-field-group>
|
|
80
81
|
|
|
82
|
+
|
|
81
83
|
## Input & Filter Types
|
|
82
84
|
|
|
83
85
|
These objects are used to provide parameters and filters for GraphQL queries.
|
|
@@ -199,6 +201,7 @@ These objects are used as parameters for specific query and mutation methods.
|
|
|
199
201
|
</x-field>
|
|
200
202
|
</x-field-group>
|
|
201
203
|
|
|
204
|
+
|
|
202
205
|
## State Objects
|
|
203
206
|
|
|
204
207
|
These types represent the state of various entities on the blockchain, such as accounts, assets, and tokens.
|
|
@@ -345,6 +348,7 @@ Represents the state of a token factory, used for minting and burning tokens.
|
|
|
345
348
|
<x-field data-name="data" data-type="Any"></x-field>
|
|
346
349
|
</x-field-group>
|
|
347
350
|
|
|
351
|
+
|
|
348
352
|
## Transaction Payloads (ITX)
|
|
349
353
|
|
|
350
354
|
These types define the `itx` (inner transaction) object for various transaction types.
|
|
@@ -427,6 +431,7 @@ These types define the `itx` (inner transaction) object for various transaction
|
|
|
427
431
|
<x-field data-name="data" data-type="Any"></x-field>
|
|
428
432
|
</x-field-group>
|
|
429
433
|
|
|
434
|
+
|
|
430
435
|
## Response Wrappers
|
|
431
436
|
|
|
432
437
|
These types are the top-level objects returned by API queries, containing a status code and the requested data.
|
|
@@ -479,4 +484,4 @@ These types are the top-level objects returned by API queries, containing a stat
|
|
|
479
484
|
<x-field-group>
|
|
480
485
|
<x-field data-name="code" data-type="string"></x-field>
|
|
481
486
|
<x-field data-name="hash" data-type="string"></x-field>
|
|
482
|
-
</x-field-group>
|
|
487
|
+
</x-field-group>
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
本節為整個 OCAP Client API 中使用的所有自訂資料結構、輸入參數和回應物件提供了全面的參考。理解這些類型對於有效與 OCAP 區塊鏈互動至關重要。
|
|
4
4
|
|
|
5
|
+
|
|
5
6
|
## 核心類型
|
|
6
7
|
|
|
7
8
|
這些是在各種 API 呼叫中使用的基礎資料結構。
|
|
@@ -78,6 +79,7 @@
|
|
|
78
79
|
<x-field data-name="role" data-type="RoleType"></x-field>
|
|
79
80
|
</x-field-group>
|
|
80
81
|
|
|
82
|
+
|
|
81
83
|
## 輸入與篩選器類型
|
|
82
84
|
|
|
83
85
|
這些物件用於為 GraphQL 查詢提供參數和篩選器。
|
|
@@ -199,6 +201,7 @@
|
|
|
199
201
|
</x-field>
|
|
200
202
|
</x-field-group>
|
|
201
203
|
|
|
204
|
+
|
|
202
205
|
## 狀態物件
|
|
203
206
|
|
|
204
207
|
這些類型表示區塊鏈上各種實體(如帳戶、資產和代幣)的狀態。
|
|
@@ -345,6 +348,7 @@
|
|
|
345
348
|
<x-field data-name="data" data-type="Any"></x-field>
|
|
346
349
|
</x-field-group>
|
|
347
350
|
|
|
351
|
+
|
|
348
352
|
## 交易負載 (ITX)
|
|
349
353
|
|
|
350
354
|
這些類型為各種交易類型定義了 `itx`(內部交易)物件。
|
|
@@ -427,6 +431,7 @@
|
|
|
427
431
|
<x-field data-name="data" data-type="Any"></x-field>
|
|
428
432
|
</x-field-group>
|
|
429
433
|
|
|
434
|
+
|
|
430
435
|
## 回應封裝器
|
|
431
436
|
|
|
432
437
|
這些類型是 API 查詢返回的頂層物件,包含一個狀態碼和請求的資料。
|
|
@@ -479,4 +484,4 @@
|
|
|
479
484
|
<x-field-group>
|
|
480
485
|
<x-field data-name="code" data-type="string"></x-field>
|
|
481
486
|
<x-field data-name="hash" data-type="string"></x-field>
|
|
482
|
-
</x-field-group>
|
|
487
|
+
</x-field-group>
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
本节为 OCAP 客户端 API 中使用的所有自定义数据结构、输入参数和响应对象提供了全面的参考。理解这些类型对于有效与 OCAP 区块链交互至关重要。
|
|
4
4
|
|
|
5
|
+
|
|
5
6
|
## 核心类型
|
|
6
7
|
|
|
7
8
|
这些是在各种 API 调用中使用的基本数据结构。
|
|
@@ -78,6 +79,7 @@ Protobuf 消息的通用容器,允许灵活的数据结构。
|
|
|
78
79
|
<x-field data-name="role" data-type="RoleType"></x-field>
|
|
79
80
|
</x-field-group>
|
|
80
81
|
|
|
82
|
+
|
|
81
83
|
## 输入与筛选类型
|
|
82
84
|
|
|
83
85
|
这些对象用于为 GraphQL 查询提供参数和筛选器。
|
|
@@ -199,6 +201,7 @@ Protobuf 消息的通用容器,允许灵活的数据结构。
|
|
|
199
201
|
</x-field>
|
|
200
202
|
</x-field-group>
|
|
201
203
|
|
|
204
|
+
|
|
202
205
|
## 状态对象
|
|
203
206
|
|
|
204
207
|
这些类型表示区块链上各种实体(如账户、资产和通证)的状态。
|
|
@@ -345,6 +348,7 @@ Protobuf 消息的通用容器,允许灵活的数据结构。
|
|
|
345
348
|
<x-field data-name="data" data-type="Any"></x-field>
|
|
346
349
|
</x-field-group>
|
|
347
350
|
|
|
351
|
+
|
|
348
352
|
## 交易负载 (ITX)
|
|
349
353
|
|
|
350
354
|
这些类型定义了各种交易类型的 `itx` (内部交易) 对象。
|
|
@@ -427,6 +431,7 @@ Protobuf 消息的通用容器,允许灵活的数据结构。
|
|
|
427
431
|
<x-field data-name="data" data-type="Any"></x-field>
|
|
428
432
|
</x-field-group>
|
|
429
433
|
|
|
434
|
+
|
|
430
435
|
## 响应包装器
|
|
431
436
|
|
|
432
437
|
这些类型是由 API 查询返回的顶层对象,包含一个状态码和请求的数据。
|
|
@@ -479,4 +484,4 @@ Protobuf 消息的通用容器,允许灵活的数据结构。
|
|
|
479
484
|
<x-field-group>
|
|
480
485
|
<x-field data-name="code" data-type="string"></x-field>
|
|
481
486
|
<x-field data-name="hash" data-type="string"></x-field>
|
|
482
|
-
</x-field-group>
|
|
487
|
+
</x-field-group>
|
|
@@ -4,10 +4,11 @@
|
|
|
4
4
|
|
|
5
5
|
この API は、トランザクションライフサイクルの各段階に対応する4つの主要なメソッドグループに整理されています。
|
|
6
6
|
|
|
7
|
-
1.
|
|
8
|
-
2.
|
|
9
|
-
3.
|
|
10
|
-
4.
|
|
7
|
+
1. **エンコード**: トランザクションを準備し、バイナリバッファにシリアル化します。
|
|
8
|
+
2. **署名**: エンコードされたトランザクションにデジタル署名を追加します。
|
|
9
|
+
3. **マルチ署名**: トランザクションに複数のデジタル署名を追加します。
|
|
10
|
+
4. **送信**: 署名されたトランザクションをブロックチェーンにブロードキャストします。
|
|
11
|
+
|
|
11
12
|
|
|
12
13
|
## トランザクションのエンコード
|
|
13
14
|
|
|
@@ -61,6 +62,7 @@ console.log('Encoded TX Object:', object);
|
|
|
61
62
|
console.log('Buffer to Sign:', buffer.toString('hex'));
|
|
62
63
|
```
|
|
63
64
|
|
|
65
|
+
|
|
64
66
|
## トランザクションへの署名
|
|
65
67
|
|
|
66
68
|
`sign[Type]Tx` メソッドは、エンコードステップにデジタル署名を追加することで、そのステップを基盤としています。これらのメソッドはトランザクションをエンコードし、提供されたウォレットを使用して結果のバイナリバッファに署名します。
|
|
@@ -104,6 +106,7 @@ const signedTx = await signTransferV2Tx({
|
|
|
104
106
|
console.log('Signed TX:', signedTx);
|
|
105
107
|
```
|
|
106
108
|
|
|
109
|
+
|
|
107
110
|
## トランザクションの送信
|
|
108
111
|
|
|
109
112
|
`send[Type]Tx` メソッドは、トランザクションをブロックチェーンにブロードキャストする役割を担います。これらのメソッドは、署名されていないトランザクションとウォレットが提供された場合に署名ステップを暗黙的に実行することも、すでに署名されたトランザクションを送信することもできます。
|
|
@@ -163,6 +166,7 @@ const txHash = await sendTransferV2Tx({
|
|
|
163
166
|
console.log('Pre-signed transaction sent with hash:', txHash);
|
|
164
167
|
```
|
|
165
168
|
|
|
169
|
+
|
|
166
170
|
## マルチシグネチャトランザクション
|
|
167
171
|
|
|
168
172
|
アトミックスワップのように複数の署名を必要とするワークフローでは、`multiSign[Type]Tx` メソッドが使用されます。このプロセスでは、まず一方の当事者が(標準の `sign[Type]Tx` メソッドを使用して)トランザクションに署名し、後続の当事者が対応する `multiSign[Type]Tx` メソッドを使用して自身の署名を追加します。
|
|
@@ -225,4 +229,4 @@ const txHash = await client.sendExchangeV2Tx({
|
|
|
225
229
|
});
|
|
226
230
|
|
|
227
231
|
console.log('Atomic swap transaction sent:', txHash);
|
|
228
|
-
```
|
|
232
|
+
```
|
|
@@ -4,10 +4,11 @@ The Low-level API provides granular control over the entire transaction lifecycl
|
|
|
4
4
|
|
|
5
5
|
This API is organized into four main groups of methods, each corresponding to a stage in the transaction lifecycle:
|
|
6
6
|
|
|
7
|
-
1.
|
|
8
|
-
2.
|
|
9
|
-
3.
|
|
10
|
-
4.
|
|
7
|
+
1. **Encode**: Prepare a transaction and serialize it into a binary buffer.
|
|
8
|
+
2. **Sign**: Add a digital signature to an encoded transaction.
|
|
9
|
+
3. **Multi-sign**: Add multiple digital signatures to a transaction.
|
|
10
|
+
4. **Send**: Broadcast a signed transaction to the blockchain.
|
|
11
|
+
|
|
11
12
|
|
|
12
13
|
## Encoding Transactions
|
|
13
14
|
|
|
@@ -61,6 +62,7 @@ console.log('Encoded TX Object:', object);
|
|
|
61
62
|
console.log('Buffer to Sign:', buffer.toString('hex'));
|
|
62
63
|
```
|
|
63
64
|
|
|
65
|
+
|
|
64
66
|
## Signing Transactions
|
|
65
67
|
|
|
66
68
|
The `sign[Type]Tx` methods build on the encoding step by adding a digital signature. These methods encode the transaction and then use the provided wallet to sign the resulting binary buffer.
|
|
@@ -104,6 +106,7 @@ const signedTx = await signTransferV2Tx({
|
|
|
104
106
|
console.log('Signed TX:', signedTx);
|
|
105
107
|
```
|
|
106
108
|
|
|
109
|
+
|
|
107
110
|
## Sending Transactions
|
|
108
111
|
|
|
109
112
|
The `send[Type]Tx` methods are responsible for broadcasting a transaction to the blockchain. These methods can perform the signing step implicitly if an unsigned transaction and a wallet are provided, or they can send a transaction that has already been signed.
|
|
@@ -163,6 +166,7 @@ const txHash = await sendTransferV2Tx({
|
|
|
163
166
|
console.log('Pre-signed transaction sent with hash:', txHash);
|
|
164
167
|
```
|
|
165
168
|
|
|
169
|
+
|
|
166
170
|
## Multi-Signature Transactions
|
|
167
171
|
|
|
168
172
|
For workflows requiring multiple signatures (like an atomic swap), the `multiSign[Type]Tx` methods are used. The process involves one party signing the transaction first (using a standard `sign[Type]Tx` method), and subsequent parties adding their signatures using the corresponding `multiSign[Type]Tx` method.
|
|
@@ -225,4 +229,4 @@ const txHash = await client.sendExchangeV2Tx({
|
|
|
225
229
|
});
|
|
226
230
|
|
|
227
231
|
console.log('Atomic swap transaction sent:', txHash);
|
|
228
|
-
```
|
|
232
|
+
```
|
|
@@ -4,10 +4,11 @@
|
|
|
4
4
|
|
|
5
5
|
此 API 分為四個主要的方法群組,每個群組對應交易生命週期中的一個階段:
|
|
6
6
|
|
|
7
|
-
1.
|
|
8
|
-
2.
|
|
9
|
-
3.
|
|
10
|
-
4.
|
|
7
|
+
1. **編碼**:準備一筆交易並將其序列化為二進位緩衝區。
|
|
8
|
+
2. **簽署**:為已編碼的交易新增數位簽名。
|
|
9
|
+
3. **多重簽署**:為一筆交易新增多個數位簽名。
|
|
10
|
+
4. **傳送**:將已簽署的交易廣播到區塊鏈。
|
|
11
|
+
|
|
11
12
|
|
|
12
13
|
## 編碼交易
|
|
13
14
|
|
|
@@ -61,6 +62,7 @@ console.log('Encoded TX Object:', object);
|
|
|
61
62
|
console.log('Buffer to Sign:', buffer.toString('hex'));
|
|
62
63
|
```
|
|
63
64
|
|
|
65
|
+
|
|
64
66
|
## 簽署交易
|
|
65
67
|
|
|
66
68
|
`sign[Type]Tx` 方法建立在編碼步驟之上,增加了數位簽名。這些方法會編碼交易,然後使用提供的錢包來簽署產生的二進位緩衝區。
|
|
@@ -104,6 +106,7 @@ const signedTx = await signTransferV2Tx({
|
|
|
104
106
|
console.log('Signed TX:', signedTx);
|
|
105
107
|
```
|
|
106
108
|
|
|
109
|
+
|
|
107
110
|
## 傳送交易
|
|
108
111
|
|
|
109
112
|
`send[Type]Tx` 方法負責將交易廣播到區塊鏈。如果提供的是未簽署的交易和一個錢包,這些方法可以隱式地執行簽署步驟;或者它們也可以傳送一個已經簽署過的交易。
|
|
@@ -163,6 +166,7 @@ const txHash = await sendTransferV2Tx({
|
|
|
163
166
|
console.log('Pre-signed transaction sent with hash:', txHash);
|
|
164
167
|
```
|
|
165
168
|
|
|
169
|
+
|
|
166
170
|
## 多重簽署交易
|
|
167
171
|
|
|
168
172
|
對於需要多個簽名(如原子交換)的工作流程,會使用 `multiSign[Type]Tx` 方法。此過程涉及一方先簽署交易(使用標準的 `sign[Type]Tx` 方法),然後後續的參與方使用對應的 `multiSign[Type]Tx` 方法新增他們的簽名。
|
|
@@ -225,4 +229,4 @@ const txHash = await client.sendExchangeV2Tx({
|
|
|
225
229
|
});
|
|
226
230
|
|
|
227
231
|
console.log('Atomic swap transaction sent:', txHash);
|
|
228
|
-
```
|
|
232
|
+
```
|
|
@@ -4,10 +4,11 @@
|
|
|
4
4
|
|
|
5
5
|
该 API 分为四个主要的方法组,每个方法组对应交易生命周期中的一个阶段:
|
|
6
6
|
|
|
7
|
-
1.
|
|
8
|
-
2.
|
|
9
|
-
3.
|
|
10
|
-
4.
|
|
7
|
+
1. **编码**:准备一笔交易并将其序列化为二进制缓冲区。
|
|
8
|
+
2. **签名**:向已编码的交易添加数字签名。
|
|
9
|
+
3. **多重签名**:向一笔交易添加多个数字签名。
|
|
10
|
+
4. **发送**:将已签名的交易广播到区块链。
|
|
11
|
+
|
|
11
12
|
|
|
12
13
|
## 编码交易
|
|
13
14
|
|
|
@@ -61,6 +62,7 @@ console.log('Encoded TX Object:', object);
|
|
|
61
62
|
console.log('Buffer to Sign:', buffer.toString('hex'));
|
|
62
63
|
```
|
|
63
64
|
|
|
65
|
+
|
|
64
66
|
## 签名交易
|
|
65
67
|
|
|
66
68
|
`sign[Type]Tx` 方法在编码步骤的基础上增加了数字签名。这些方法会对交易进行编码,然后使用提供的钱包对生成的二进制缓冲区进行签名。
|
|
@@ -104,6 +106,7 @@ const signedTx = await signTransferV2Tx({
|
|
|
104
106
|
console.log('Signed TX:', signedTx);
|
|
105
107
|
```
|
|
106
108
|
|
|
109
|
+
|
|
107
110
|
## 发送交易
|
|
108
111
|
|
|
109
112
|
`send[Type]Tx` 方法负责将交易广播到区块链。如果提供了未签名的交易和钱包,这些方法可以隐式执行签名步骤,也可以发送已经签名的交易。
|
|
@@ -163,6 +166,7 @@ const txHash = await sendTransferV2Tx({
|
|
|
163
166
|
console.log('Pre-signed transaction sent with hash:', txHash);
|
|
164
167
|
```
|
|
165
168
|
|
|
169
|
+
|
|
166
170
|
## 多重签名交易
|
|
167
171
|
|
|
168
172
|
对于需要多个签名的工作流(如原子交换),使用 `multiSign[Type]Tx` 方法。该过程涉及一方首先对交易进行签名(使用标准的 `sign[Type]Tx` 方法),然后后续各方使用相应的 `multiSign[Type]Tx` 方法添加他们的签名。
|
|
@@ -225,4 +229,4 @@ const txHash = await client.sendExchangeV2Tx({
|
|
|
225
229
|
});
|
|
226
230
|
|
|
227
231
|
console.log('Atomic swap transaction sent:', txHash);
|
|
228
|
-
```
|
|
232
|
+
```
|
|
@@ -2,11 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
OCAP Client は GraphQL を通じてブロックチェーンと対話します。メソッドは主に2つのタイプに分類されます。
|
|
4
4
|
|
|
5
|
-
*
|
|
6
|
-
*
|
|
5
|
+
* **クエリ**: ブロックチェーンからデータを取得するために使用される読み取り専用の操作です。アカウントの状態の取得、トランザクションのリスト表示、または一般的なチェーン情報の取得などが含まれます。これらはチェーンの状態を変更しません。
|
|
6
|
+
* **ミューテーション**: ブロックチェーンの状態を変更する書き込み操作です。トランザクションの送信がミューテーションの主な例です。
|
|
7
7
|
|
|
8
8
|
このセクションでは、クライアントが提供する利用可能なすべてのクエリおよびミューテーションメソッドの完全なリファレンスを提供します。
|
|
9
9
|
|
|
10
|
+
|
|
10
11
|
## クエリメソッド
|
|
11
12
|
|
|
12
13
|
クエリはブロックチェーンからデータを取得するために使用されます。以下は、利用可能なすべてのクエリメソッドの完全なリストです。
|
|
@@ -771,6 +772,7 @@ mempool にあるがまだ確認されていないトランザクションを取
|
|
|
771
772
|
<x-field data-name="tokenFactories" data-type="IndexedTokenFactoryState[]" data-desc="トークンファクトリー状態オブジェクトの配列。"></x-field>
|
|
772
773
|
</x-field>
|
|
773
774
|
|
|
775
|
+
|
|
774
776
|
## ミューテーションメソッド
|
|
775
777
|
|
|
776
778
|
ミューテーションは、ブロックチェーンの状態を変更するトランザクションを送信するために使用されます。
|
|
@@ -811,4 +813,4 @@ try {
|
|
|
811
813
|
} catch (error) {
|
|
812
814
|
console.error('Failed to send transaction:', error);
|
|
813
815
|
}
|
|
814
|
-
```
|
|
816
|
+
```
|
|
@@ -2,11 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
The OCAP Client interacts with the blockchain through GraphQL. Methods are categorized into two main types:
|
|
4
4
|
|
|
5
|
-
*
|
|
6
|
-
*
|
|
5
|
+
* **Queries**: These are read-only operations used to fetch data from the blockchain, such as retrieving the state of an account, listing transactions, or getting general chain information. They do not alter the state of the chain.
|
|
6
|
+
* **Mutations**: These are write operations that modify the state of the blockchain. Sending a transaction is the primary example of a mutation.
|
|
7
7
|
|
|
8
8
|
This section provides a complete reference for all available query and mutation methods provided by the client.
|
|
9
9
|
|
|
10
|
+
|
|
10
11
|
## Query Methods
|
|
11
12
|
|
|
12
13
|
Queries are used to retrieve data from the blockchain. Here is a complete list of all available query methods.
|
|
@@ -771,6 +772,7 @@ Lists all token factories on the chain.
|
|
|
771
772
|
<x-field data-name="tokenFactories" data-type="IndexedTokenFactoryState[]" data-desc="An array of token factory state objects."></x-field>
|
|
772
773
|
</x-field>
|
|
773
774
|
|
|
775
|
+
|
|
774
776
|
## Mutation Methods
|
|
775
777
|
|
|
776
778
|
Mutations are used to send transactions that modify the state of the blockchain.
|
|
@@ -2,11 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
OCAP 客戶端透過 GraphQL 與區塊鏈互動。方法分為兩大類:
|
|
4
4
|
|
|
5
|
-
*
|
|
6
|
-
*
|
|
5
|
+
* **查詢 (Queries)**:這些是唯讀操作,用於從區塊鏈擷取資料,例如檢索帳戶狀態、列出交易或取得一般鏈資訊。它們不會改變鏈的狀態。
|
|
6
|
+
* **變動 (Mutations)**:這些是會修改區塊鏈狀態的寫入操作。傳送交易是變動的主要範例。
|
|
7
7
|
|
|
8
8
|
本節提供客戶端所有可用的查詢與變動方法的完整參考。
|
|
9
9
|
|
|
10
|
+
|
|
10
11
|
## 查詢方法
|
|
11
12
|
|
|
12
13
|
查詢用於從區塊鏈中檢索資料。以下是所有可用查詢方法的完整列表。
|
|
@@ -771,6 +772,7 @@ OCAP 客戶端透過 GraphQL 與區塊鏈互動。方法分為兩大類:
|
|
|
771
772
|
<x-field data-name="tokenFactories" data-type="IndexedTokenFactoryState[]" data-desc="一個代幣工廠狀態物件的陣列。"></x-field>
|
|
772
773
|
</x-field>
|
|
773
774
|
|
|
775
|
+
|
|
774
776
|
## 變動方法
|
|
775
777
|
|
|
776
778
|
變動用於傳送會修改區塊鏈狀態的交易。
|
|
@@ -811,4 +813,4 @@ try {
|
|
|
811
813
|
} catch (error) {
|
|
812
814
|
console.error('Failed to send transaction:', error);
|
|
813
815
|
}
|
|
814
|
-
```
|
|
816
|
+
```
|