@ocap/client 1.31.0 → 1.31.2
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/dist/base.js +1 -1
- package/dist/bridge.js +288 -0
- package/dist/bridge.js.map +1 -0
- package/dist/browser.d.ts +51 -1
- package/dist/bundle.js +1 -1
- package/dist/extension.js +111 -4
- package/dist/extension.js.map +1 -1
- package/dist/report.html +2 -2
- package/dist/schema/graphql.json +238 -1
- package/dist/schema/graphql.txt +2 -2
- package/dist/types.js +64 -2
- package/dist/types.js.map +1 -1
- package/dist/verify.js +9 -0
- package/dist/verify.js.map +1 -1
- package/docs/QUERIES.md +33 -0
- package/docs/README.md +84 -10
- package/docs/api-reference-transaction-helpers.ja.md +1 -1
- package/docs/api-reference-transaction-helpers.md +1 -1
- package/docs/api-reference-transaction-helpers.zh-TW.md +1 -1
- package/docs/api-reference-transaction-helpers.zh.md +1 -1
- package/lib/base.js +1 -1
- package/lib/bridge.js +290 -0
- package/lib/bridge.js.map +1 -0
- package/lib/extension.js +111 -4
- package/lib/extension.js.map +1 -1
- package/lib/node.d.ts +51 -1
- package/lib/schema/graphql.json +238 -1
- package/lib/schema/graphql.txt +2 -2
- package/lib/types.js +64 -2
- package/lib/types.js.map +1 -1
- package/lib/verify.js +9 -0
- package/lib/verify.js.map +1 -1
- package/package.json +14 -11
package/docs/README.md
CHANGED
|
@@ -86,6 +86,7 @@ response objects the chain returns — this is a server-side convention.
|
|
|
86
86
|
* [sendUpdateTokenFactoryTx(params, extra)](#GraphQLClient+sendUpdateTokenFactoryTx) ⇒ `Promise.<string>`
|
|
87
87
|
* [sendMintTokenTx(params, extra)](#GraphQLClient+sendMintTokenTx) ⇒ `Promise.<string>`
|
|
88
88
|
* [sendBurnTokenTx(params, extra)](#GraphQLClient+sendBurnTokenTx) ⇒ `Promise.<string>`
|
|
89
|
+
* [sendReleaseBridgeTokenTx(params, extra)](#GraphQLClient+sendReleaseBridgeTokenTx) ⇒ `Promise.<string>`
|
|
89
90
|
* [encodeAccountMigrateTx(params)](#GraphQLClient+encodeAccountMigrateTx) ⇒ [`Promise.<TxEncodeOutput>`](#GraphQLClient.TxEncodeOutput)
|
|
90
91
|
* [encodeDelegateTx(params)](#GraphQLClient+encodeDelegateTx) ⇒ [`Promise.<TxEncodeOutput>`](#GraphQLClient.TxEncodeOutput)
|
|
91
92
|
* [encodeRevokeDelegateTx(params)](#GraphQLClient+encodeRevokeDelegateTx) ⇒ [`Promise.<TxEncodeOutput>`](#GraphQLClient.TxEncodeOutput)
|
|
@@ -124,6 +125,7 @@ response objects the chain returns — this is a server-side convention.
|
|
|
124
125
|
* [encodeUpdateTokenFactoryTx(params)](#GraphQLClient+encodeUpdateTokenFactoryTx) ⇒ [`Promise.<TxEncodeOutput>`](#GraphQLClient.TxEncodeOutput)
|
|
125
126
|
* [encodeMintTokenTx(params)](#GraphQLClient+encodeMintTokenTx) ⇒ [`Promise.<TxEncodeOutput>`](#GraphQLClient.TxEncodeOutput)
|
|
126
127
|
* [encodeBurnTokenTx(params)](#GraphQLClient+encodeBurnTokenTx) ⇒ [`Promise.<TxEncodeOutput>`](#GraphQLClient.TxEncodeOutput)
|
|
128
|
+
* [encodeReleaseBridgeTokenTx(params)](#GraphQLClient+encodeReleaseBridgeTokenTx) ⇒ [`Promise.<TxEncodeOutput>`](#GraphQLClient.TxEncodeOutput)
|
|
127
129
|
* [getAccountState(params)](#GraphQLClient+getAccountState) ⇒ [`Promise.<ResponseGetAccountState>`](#GraphQLClient.ResponseGetAccountState)
|
|
128
130
|
* [getAssetState(params)](#GraphQLClient+getAssetState) ⇒ [`Promise.<ResponseGetAssetState>`](#GraphQLClient.ResponseGetAssetState)
|
|
129
131
|
* [getFactoryState(params)](#GraphQLClient+getFactoryState) ⇒ [`Promise.<ResponseGetFactoryState>`](#GraphQLClient.ResponseGetFactoryState)
|
|
@@ -310,6 +312,7 @@ response objects the chain returns — this is a server-side convention.
|
|
|
310
312
|
* [PubKey](#GraphQLClient.PubKey) : `object`
|
|
311
313
|
* [RateLimit](#GraphQLClient.RateLimit) : `object`
|
|
312
314
|
* [ReceiptChange](#GraphQLClient.ReceiptChange) : `object`
|
|
315
|
+
* [ReleaseBridgeTokenTx](#GraphQLClient.ReleaseBridgeTokenTx) : `object`
|
|
313
316
|
* [ResponseEstimateGas](#GraphQLClient.ResponseEstimateGas) : `object`
|
|
314
317
|
* [ResponseGetAccountState](#GraphQLClient.ResponseGetAccountState) : `object`
|
|
315
318
|
* [ResponseGetAccountTokens](#GraphQLClient.ResponseGetAccountTokens) : `object`
|
|
@@ -482,6 +485,7 @@ response objects the chain returns — this is a server-side convention.
|
|
|
482
485
|
* [UpdateTokenFactoryTxInput](#GraphQLClient.UpdateTokenFactoryTxInput) : `Object`
|
|
483
486
|
* [MintTokenTxInput](#GraphQLClient.MintTokenTxInput) : `Object`
|
|
484
487
|
* [BurnTokenTxInput](#GraphQLClient.BurnTokenTxInput) : `Object`
|
|
488
|
+
* [ReleaseBridgeTokenTxInput](#GraphQLClient.ReleaseBridgeTokenTxInput) : `Object`
|
|
485
489
|
|
|
486
490
|
### new GraphQLClient(endpoint, autoInit, \[options])
|
|
487
491
|
|
|
@@ -1350,6 +1354,18 @@ Send BurnTokenTx transaction and get the hash, use [getTx](#GraphQLClient+getTx)
|
|
|
1350
1354
|
| params | [`BurnTokenTxInput`](#GraphQLClient.BurnTokenTxInput) |
|
|
1351
1355
|
| extra | `object` |
|
|
1352
1356
|
|
|
1357
|
+
### graphQLClient.sendReleaseBridgeTokenTx(params, extra) ⇒ `Promise.<string>`
|
|
1358
|
+
|
|
1359
|
+
Send ReleaseBridgeTokenTx transaction and get the hash, use [getTx](#GraphQLClient+getTx) to get transaction detail
|
|
1360
|
+
|
|
1361
|
+
**Kind**: instance method of [`GraphQLClient`](#GraphQLClient)\
|
|
1362
|
+
**Returns**: `Promise.<string>` - returns transaction hash if success, otherwise error was thrown
|
|
1363
|
+
|
|
1364
|
+
| Param | Type |
|
|
1365
|
+
| ------ | ----------------------------------------------------------------------- |
|
|
1366
|
+
| params | [`ReleaseBridgeTokenTxInput`](#GraphQLClient.ReleaseBridgeTokenTxInput) |
|
|
1367
|
+
| extra | `object` |
|
|
1368
|
+
|
|
1353
1369
|
### graphQLClient.encodeAccountMigrateTx(params) ⇒ [`Promise.<TxEncodeOutput>`](#GraphQLClient.TxEncodeOutput)
|
|
1354
1370
|
|
|
1355
1371
|
Encode a AccountMigrateTx transaction for later use
|
|
@@ -1768,6 +1784,17 @@ Encode a BurnTokenTx transaction for later use
|
|
|
1768
1784
|
| ------ | ----------------------------------------------------- |
|
|
1769
1785
|
| params | [`BurnTokenTxInput`](#GraphQLClient.BurnTokenTxInput) |
|
|
1770
1786
|
|
|
1787
|
+
### graphQLClient.encodeReleaseBridgeTokenTx(params) ⇒ [`Promise.<TxEncodeOutput>`](#GraphQLClient.TxEncodeOutput)
|
|
1788
|
+
|
|
1789
|
+
Encode a ReleaseBridgeTokenTx transaction for later use
|
|
1790
|
+
|
|
1791
|
+
**Kind**: instance method of [`GraphQLClient`](#GraphQLClient)\
|
|
1792
|
+
**Returns**: [`Promise.<TxEncodeOutput>`](#GraphQLClient.TxEncodeOutput) - result - we provide two formats of the encoding result, binary presentation and human readable object
|
|
1793
|
+
|
|
1794
|
+
| Param | Type |
|
|
1795
|
+
| ------ | ----------------------------------------------------------------------- |
|
|
1796
|
+
| params | [`ReleaseBridgeTokenTxInput`](#GraphQLClient.ReleaseBridgeTokenTxInput) |
|
|
1797
|
+
|
|
1771
1798
|
### graphQLClient.getAccountState(params) ⇒ [`Promise.<ResponseGetAccountState>`](#GraphQLClient.ResponseGetAccountState)
|
|
1772
1799
|
|
|
1773
1800
|
getAccountState
|
|
@@ -2294,6 +2321,7 @@ Structure of GraphQLClient.AddressFilterInput
|
|
|
2294
2321
|
| sender | `string` |
|
|
2295
2322
|
| receiver | `string` |
|
|
2296
2323
|
| ...direction | `GraphQLClient.Direction` |
|
|
2324
|
+
| gasPayer | `string` |
|
|
2297
2325
|
|
|
2298
2326
|
### GraphQLClient.AssetFilterInput : `object`
|
|
2299
2327
|
|
|
@@ -3024,9 +3052,11 @@ Structure of GraphQLClient.TxFilterInput
|
|
|
3024
3052
|
**Kind**: static typedef of [`GraphQLClient`](#GraphQLClient)\
|
|
3025
3053
|
**Properties**
|
|
3026
3054
|
|
|
3027
|
-
| Name
|
|
3028
|
-
|
|
|
3029
|
-
| txs
|
|
3055
|
+
| Name | Type |
|
|
3056
|
+
| --------- | ---------------- |
|
|
3057
|
+
| txs | `Array.<string>` |
|
|
3058
|
+
| gasPayer | `string` |
|
|
3059
|
+
| evidences | `Array.<string>` |
|
|
3030
3060
|
|
|
3031
3061
|
### GraphQLClient.TypeFilterInput : `object`
|
|
3032
3062
|
|
|
@@ -4461,6 +4491,7 @@ Structure of GraphQLClient.IndexedTransaction
|
|
|
4461
4491
|
| code | `string` |
|
|
4462
4492
|
| tokenSymbols | `Array.<...GraphQLClient.TokenMeta>` |
|
|
4463
4493
|
| receipts | `Array.<...GraphQLClient.TransactionReceipt>` |
|
|
4494
|
+
| gasPayer | `string` |
|
|
4464
4495
|
|
|
4465
4496
|
### GraphQLClient.JoinRollupTx : `object`
|
|
4466
4497
|
|
|
@@ -4536,7 +4567,7 @@ Structure of GraphQLClient.LedgerEntry
|
|
|
4536
4567
|
| sequence | `number` |
|
|
4537
4568
|
| hash | `string` |
|
|
4538
4569
|
| from | `string` |
|
|
4539
|
-
| nonce | `
|
|
4570
|
+
| nonce | `string` |
|
|
4540
4571
|
| pk | `string` |
|
|
4541
4572
|
| signature | `string` |
|
|
4542
4573
|
| txRaw | `string` |
|
|
@@ -4833,6 +4864,28 @@ Structure of GraphQLClient.ReceiptChange
|
|
|
4833
4864
|
| action | `string` |
|
|
4834
4865
|
| value | `string` |
|
|
4835
4866
|
|
|
4867
|
+
### GraphQLClient.ReleaseBridgeTokenTx : `object`
|
|
4868
|
+
|
|
4869
|
+
Structure of GraphQLClient.ReleaseBridgeTokenTx
|
|
4870
|
+
|
|
4871
|
+
**Kind**: static typedef of [`GraphQLClient`](#GraphQLClient)\
|
|
4872
|
+
**Properties**
|
|
4873
|
+
|
|
4874
|
+
| Name | Type |
|
|
4875
|
+
| -------------- | --------------------------- |
|
|
4876
|
+
| kind | `number` |
|
|
4877
|
+
| evidence | `string` |
|
|
4878
|
+
| ordinal | `number` |
|
|
4879
|
+
| to | `string` |
|
|
4880
|
+
| amount | `string` |
|
|
4881
|
+
| ethChainId | `string` |
|
|
4882
|
+
| epoch | `number` |
|
|
4883
|
+
| ethSender | `string` |
|
|
4884
|
+
| claimSignature | `string` |
|
|
4885
|
+
| signatures | `Array.<string>` |
|
|
4886
|
+
| bridge | `string` |
|
|
4887
|
+
| ...data | [`Any`](#GraphQLClient.Any) |
|
|
4888
|
+
|
|
4836
4889
|
### GraphQLClient.ResponseEstimateGas : `object`
|
|
4837
4890
|
|
|
4838
4891
|
Structure of GraphQLClient.ResponseEstimateGas
|
|
@@ -5056,7 +5109,7 @@ Checkout the following snippet for the format of ResponseGetLedgerEntry:
|
|
|
5056
5109
|
"sequence": 123,
|
|
5057
5110
|
"hash": "abc",
|
|
5058
5111
|
"from": "abc",
|
|
5059
|
-
"nonce":
|
|
5112
|
+
"nonce": "abc",
|
|
5060
5113
|
"pk": "abc",
|
|
5061
5114
|
"signature": "abc",
|
|
5062
5115
|
"txRaw": "abc",
|
|
@@ -5946,6 +5999,7 @@ Structure of GraphQLClient.Transaction
|
|
|
5946
5999
|
| serviceFee | `string` |
|
|
5947
6000
|
| gasFee | `string` |
|
|
5948
6001
|
| gasPaid | `string` |
|
|
6002
|
+
| gasPayer | `string` |
|
|
5949
6003
|
|
|
5950
6004
|
### GraphQLClient.TransactionConfig : `object`
|
|
5951
6005
|
|
|
@@ -6375,11 +6429,12 @@ Structure of GraphQLClient.VaultConfig
|
|
|
6375
6429
|
**Kind**: static typedef of [`GraphQLClient`](#GraphQLClient)\
|
|
6376
6430
|
**Properties**
|
|
6377
6431
|
|
|
6378
|
-
| Name
|
|
6379
|
-
|
|
|
6380
|
-
| slashedStake
|
|
6381
|
-
| txFee
|
|
6382
|
-
| txGas
|
|
6432
|
+
| Name | Type |
|
|
6433
|
+
| ------------- | ---------------- |
|
|
6434
|
+
| slashedStake | `string` |
|
|
6435
|
+
| txFee | `string` |
|
|
6436
|
+
| txGas | `Array.<string>` |
|
|
6437
|
+
| bridgeReserve | `string` |
|
|
6383
6438
|
|
|
6384
6439
|
### GraphQLClient.VerifyAccountRiskResult : `object`
|
|
6385
6440
|
|
|
@@ -8059,3 +8114,22 @@ Checkout the following snippet for the format of SendTxParams:
|
|
|
8059
8114
|
| [input.tx.signatures] | `array` | transaction signatures, should be set when it's a multisig transaction |
|
|
8060
8115
|
| input.wallet | `object` | the wallet used to sign the transaction, either a forge managed wallet or user managed wallet |
|
|
8061
8116
|
| [input.signature] | `string` | the signature of the tx, if this parameter exist, we will not sign the transaction |
|
|
8117
|
+
|
|
8118
|
+
### GraphQLClient.ReleaseBridgeTokenTxInput : `Object`
|
|
8119
|
+
|
|
8120
|
+
**Kind**: static typedef of [`GraphQLClient`](#GraphQLClient)\
|
|
8121
|
+
**Properties**
|
|
8122
|
+
|
|
8123
|
+
| Name | Type | Description |
|
|
8124
|
+
| --------------------- | ------------------------------------------------------------- | --------------------------------------------------------------------------------------------- |
|
|
8125
|
+
| input | `object` | |
|
|
8126
|
+
| input.tx | `object` | data of the transaction |
|
|
8127
|
+
| input.tx.itx | [`ReleaseBridgeTokenTx`](#GraphQLClient.ReleaseBridgeTokenTx) | the actual transaction object |
|
|
8128
|
+
| [input.tx.pk] | `string` | the sender pk |
|
|
8129
|
+
| [input.tx.from] | `string` | the sender address, can be derived from wallet |
|
|
8130
|
+
| [input.tx.nonce] | `number` | the tx nonce, defaults to Date.now if not set |
|
|
8131
|
+
| [input.tx.chainId] | `string` | the chainId |
|
|
8132
|
+
| [input.tx.signature] | `string` | transaction signature |
|
|
8133
|
+
| [input.tx.signatures] | `array` | transaction signatures, should be set when it's a multisig transaction |
|
|
8134
|
+
| input.wallet | `object` | the wallet used to sign the transaction, either a forge managed wallet or user managed wallet |
|
|
8135
|
+
| [input.signature] | `string` | the signature of the tx, if this parameter exist, we will not sign the transaction |
|
|
@@ -328,7 +328,7 @@ console.log('New token factory address:', factoryAddress);
|
|
|
328
328
|
|
|
329
329
|
<x-field-group>
|
|
330
330
|
<x-field data-name="address" data-type="string" data-required="true" data-desc="更新するトークンファクトリーのアドレス。"></x-field>
|
|
331
|
-
<x-field data-name="feeRate" data-type="number" data-required="false" data-desc="
|
|
331
|
+
<x-field data-name="feeRate" data-type="number" data-required="false" data-desc="ミントおよびバーンの新しい手数料率。作成後は引き下げのみ可能で、引き上げはチェーンに拒否されます。"></x-field>
|
|
332
332
|
<x-field data-name="data" data-type="object" data-required="false" data-desc="トークンファクトリーの新しいメタデータ。"></x-field>
|
|
333
333
|
<x-field data-name="wallet" data-type="WalletObject" data-required="true" data-desc="ファクトリーの所有者のウォレット。"></x-field>
|
|
334
334
|
</x-field-group>
|
|
@@ -328,7 +328,7 @@ Updates the `feeRate` and `data` for an existing token factory.
|
|
|
328
328
|
|
|
329
329
|
<x-field-group>
|
|
330
330
|
<x-field data-name="address" data-type="string" data-required="true" data-desc="The address of the token factory to update."></x-field>
|
|
331
|
-
<x-field data-name="feeRate" data-type="number" data-required="false" data-desc="The new fee rate for minting and burning."></x-field>
|
|
331
|
+
<x-field data-name="feeRate" data-type="number" data-required="false" data-desc="The new fee rate for minting and burning. It can only be lowered after creation; the chain rejects an increase."></x-field>
|
|
332
332
|
<x-field data-name="data" data-type="object" data-required="false" data-desc="New metadata for the token factory."></x-field>
|
|
333
333
|
<x-field data-name="wallet" data-type="WalletObject" data-required="true" data-desc="The wallet of the factory's owner."></x-field>
|
|
334
334
|
</x-field-group>
|
|
@@ -328,7 +328,7 @@ console.log('新代幣工廠地址:', factoryAddress);
|
|
|
328
328
|
|
|
329
329
|
<x-field-group>
|
|
330
330
|
<x-field data-name="address" data-type="string" data-required="true" data-desc="要更新的代幣工廠地址。"></x-field>
|
|
331
|
-
<x-field data-name="feeRate" data-type="number" data-required="false" data-desc="
|
|
331
|
+
<x-field data-name="feeRate" data-type="number" data-required="false" data-desc="鑄造和銷毀的新手續費率。建立後只能調低;鏈會拒絕調高。"></x-field>
|
|
332
332
|
<x-field data-name="data" data-type="object" data-required="false" data-desc="代幣工廠的新元資料。"></x-field>
|
|
333
333
|
<x-field data-name="wallet" data-type="WalletObject" data-required="true" data-desc="工廠擁有者的錢包。"></x-field>
|
|
334
334
|
</x-field-group>
|
|
@@ -328,7 +328,7 @@ console.log('New token factory address:', factoryAddress);
|
|
|
328
328
|
|
|
329
329
|
<x-field-group>
|
|
330
330
|
<x-field data-name="address" data-type="string" data-required="true" data-desc="要更新的通证工厂的地址。"></x-field>
|
|
331
|
-
<x-field data-name="feeRate" data-type="number" data-required="false" data-desc="
|
|
331
|
+
<x-field data-name="feeRate" data-type="number" data-required="false" data-desc="铸造和销毁的新费率。创建后只能调低;链会拒绝调高。"></x-field>
|
|
332
332
|
<x-field data-name="data" data-type="object" data-required="false" data-desc="通证工厂的新元数据。"></x-field>
|
|
333
333
|
<x-field data-name="wallet" data-type="WalletObject" data-required="true" data-desc="工厂所有者的钱包。"></x-field>
|
|
334
334
|
</x-field-group>
|