Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
* [Liquidation](developer/api-and-sdk/data-types/transaction/liquidation.md)
* [UpdateGlobalVar](developer/api-and-sdk/data-types/transaction/update\_global\_var.md)
* [Private Key & Signature](developer/api-and-sdk/private-key-and-signature/private\_key.md)
* [Algorithm](developer/api-and-sdk/private-key-and-signature/encode/algorithm.md)
* [ChangePubKey](developer/api-and-sdk/private-key-and-signature/encode/chaneg\_pubkey.md)
* [Withdraw](developer/api-and-sdk/private-key-and-signature/encode/withdraw.md)
* [Transfer](developer/api-and-sdk/private-key-and-signature/encode/transfer.md)
Expand All @@ -62,7 +63,7 @@
* [Go](developer/sdk/go/changelog.md)
* [Types](developer/sdk/go/basic\_types.md)
* [Signature](developer/sdk/go/signer.md)
* [Transactions](developer/sdk/changelog/transactions/README.md)
* [Transactions](developer/sdk/go/transactions/README.md)
* [ChangePubKey](developer/sdk/go/transactions/1-change-pubkey.md)
* [Withdraw](developer/sdk/go/transactions/2-withdraw.md)
* [Transfer](developer/sdk/go/transactions/3-transfer.md)
Expand All @@ -74,6 +75,19 @@
* [Liquidation](developer/sdk/go/transactions/9-liquidation.md)
* [UpdateGlobalVar](developer/sdk/go/transactions/10-update-global-var.md)
* [Js](developer/sdk/js/changelog.md)
* [Dart](developer/sdk/dart/changelog.md)
* [Signature](developer/sdk/dart/signer.md)
* [Transactions](developer/sdk/dart/transactions/README.md)
* [ChangePubKey](developer/sdk/dart/transactions/1-change-pubkey.md)
* [Withdraw](developer/sdk/dart/transactions/2-withdraw.md)
* [Transfer](developer/sdk/dart/transactions/3-transfer.md)
* [ForcedExit](developer/sdk/dart/transactions/4-forced-exit.md)
* [OrderMatching](developer/sdk/dart/transactions/5-order-matching.md)
* [ContractMatching](developer/sdk/dart/transactions/6-contract-matching.md)
* [AutoDeleveraging](developer/sdk/dart/transactions/7-auto-deleveraging.md)
* [Funding](developer/sdk/dart/transactions/8-funding.md)
* [Liquidation](developer/sdk/dart/transactions/9-liquidation.md)
* [UpdateGlobalVar](developer/sdk/dart/transactions/10-update-global-var.md)

## ⚙️ Network Information

Expand Down
6 changes: 3 additions & 3 deletions developer/api-and-sdk/data-types/basic-types.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Basic types

* [ChainId](#ChainId)
* [ChainId](#chainid)
* [AccountId](#accountid)
* [SubAccountId](#subaccountid)
* [TokenId](#tokenid)
Expand All @@ -16,7 +16,7 @@
# Basic structures

* [TxLayer1Signature](#txlayer1signature)
* [ZkLinkSignature](#ZkLinkSignature)
* [ZkLinkSignature](#zklinksignature)


### ChainId
Expand Down Expand Up @@ -46,7 +46,7 @@ Conversely, when withdrawing USD, users can choose to withdraw an equivalent amo


### SlotId
The id of slot in [Order](#Order), the type is `u32`.
The id of slot in [Order](#order), the type is `u32`.

### PairId
The trading pair ID of the pertetual contract, the type is `u16`. The PairId is defined by decentralized exchange, not defined by ZkLink.
Expand Down
58 changes: 29 additions & 29 deletions developer/api-and-sdk/data-types/state-update.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ There are 4 types of AccountUpdate:
|-----------|--------------------------------------|---------------------|
| type | String | Update Name |
| updateId | i32 | Update id |
| accountId | [AccountId](basic-types.md#AccountId) | The new accout id |
| accountId | [AccountId](basic-types.md#accountid) | The new accout id |
| address | String | The account address |

Transaction that generate `AccountCreate`:
Expand All @@ -45,11 +45,11 @@ For Example:
|-----------|----------------------------------------|--------------------|
| type | String | Update name |
| updateId | i32 | Update Id |
| accountId | [AccountId](basic-types.md#AccountId) | Account id |
| oldPubkeyHash | [PubkeyHash](basic-types.md#PubkeyHash) | The old pubkeyHash |
| newPubkeyHash | [PubkeyHash](basic-types.md#PubkeyHash) | The new pubkeyHash |
| oldNonce | [Nonce](basic-types.md#Nonce) | The old nonce |
| newNonce | [Nonce](basic-types.md#Nonce) | The new nonce |
| accountId | [AccountId](basic-types.md#accountid) | Account id |
| oldPubkeyHash | [PubkeyHash](basic-types.md#pubkeyhash) | The old pubkeyHash |
| newPubkeyHash | [PubkeyHash](basic-types.md#pubkeyhash) | The new pubkeyHash |
| oldNonce | [Nonce](basic-types.md#nonce) | The old nonce |
| newNonce | [Nonce](basic-types.md#nonce) | The new nonce |

Transaction that generate `AccountChangePubkeyUpdate`:

Expand Down Expand Up @@ -77,13 +77,13 @@ For example:
|--------------|--------------------------------------------|-------------------------------|
| type | String | The update name |
| updateId | i32 | The update id |
| accountId | [AccountId](data_tpes.md#AccountId) | The account id |
| subAccountId | [SubAccountId](basic-types.md#SubAccountId) | The subaccount id |
| coinId | [TokenId](basic-types.md#TokenId) | The token id |
| accountId | [AccountId](data_tpes.md#accountid) | The account id |
| subAccountId | [SubAccountId](basic-types.md#subaccountid) | The subaccount id |
| coinId | [TokenId](basic-types.md#tokenid) | The token id |
| oldBalance | String | The old balance of subaccount |
| newBalance | String | The new balance of subaccount |
| oldNonce | [Nonce](basic-types.md#Nonce) | The old nonce of subaccount |
| newNonce | [Nonce](basic-types.md#Nonce) | The new nonce of subaccount |
| oldNonce | [Nonce](basic-types.md#nonce) | The old nonce of subaccount |
| newNonce | [Nonce](basic-types.md#nonce) | The new nonce of subaccount |

Transaction that generate `BalanceUpdate`:

Expand Down Expand Up @@ -124,17 +124,17 @@ For example
|--------------|--------------------------------------------|-----------------|
| type | String | Update name |
| updateId | i32 | Update id |
| accountId | [AccountId](basic_type.md#AccountId) | Account id |
| subAccountId | [SubAccountId](basic-types.md#SubAccountId) | Subaccount id |
| slotId | [SlotId](basic-types.md#SlotId) | Slot id |
| oldTidyOrder | [ResponseTidyOrder](#ResponseTidyOrder) | Old`TidyOrder` |
| newTidyOrder | [ResponseTidyOrder](#ResponseTidyOrder) | New `TidyOrder` |
| accountId | [AccountId](basic_type.md#accountid) | Account id |
| subAccountId | [SubAccountId](basic-types.md#subaccountid) | Subaccount id |
| slotId | [SlotId](basic-types.md#slotid) | Slot id |
| oldTidyOrder | [ResponseTidyOrder](#responsetidyorder) | Old`TidyOrder` |
| newTidyOrder | [ResponseTidyOrder](#responsetidyorder) | New `TidyOrder` |

where ResponseTidyOrder is

| Name | Type | Description |
|--------------|--------------------------------------------|--------------------------------------------------------------|
| nonce | [Nonce](#Nonce) | The slot nonce of order |
| nonce | [Nonce](#nonce) | The slot nonce of order |
| residue | String | The string format of BigDecimal, the residue balance of slot |

Transaction that generate `OrderUpdate`:
Expand Down Expand Up @@ -181,9 +181,9 @@ For Example:
|--------------------|---------------------------------------------|--------------------|
| type | String | The update name |
| update_id | i32 | update index |
| sub_account_id | [SubAccountId](basic-types.md#SubAccountId) | sub-account ID |
| old_fee_account_id | [AccountId](basic_type.md#AccountId) | Old fee account ID |
| new_fee_account_id | [AccountId](basic_type.md#AccountId) | New fee account ID |
| sub_account_id | [SubAccountId](basic-types.md#subaccountid) | sub-account ID |
| old_fee_account_id | [AccountId](basic_type.md#accountid) | Old fee account ID |
| new_fee_account_id | [AccountId](basic_type.md#accountid) | New fee account ID |

Transaction that generate `FeeAccountUpdate`:

Expand All @@ -210,9 +210,9 @@ For Example:
|-------------------------------|---------------------------------------------|-------------------------------|
| type | String | The update name |
| update_id | i32 | update index |
| sub_account_id | [SubAccountId](basic-types.md#SubAccountId) | sub-account id |
| old_insurance_fund_account_id | [AccountId](basic_type.md#AccountId) | old insurance fund account id |
| new_insurance_fund_account_id | [AccountId](basic_type.md#AccountId) | new insurance fund account id |
| sub_account_id | [SubAccountId](basic-types.md#subaccountid) | sub-account id |
| old_insurance_fund_account_id | [AccountId](basic_type.md#accountid) | old insurance fund account id |
| new_insurance_fund_account_id | [AccountId](basic_type.md#accountid) | new insurance fund account id |

Transaction that generate `InsuranceFundAccountUpdate`:

Expand All @@ -239,14 +239,14 @@ For example:
|-----------------|---------------------------------------------|--------------------------------------|
| type | String | The update name |
| update_id | i32 | update index |
| sub_account_id | [SubAccountId](basic-types.md#SubAccountId) | sub-account id |
| margin_id | [MarginId](basic-types.md#MarginId) | margin index |
| sub_account_id | [SubAccountId](basic-types.md#subaccountid) | sub-account id |
| margin_id | [MarginId](basic-types.md#marginid) | margin index |
| old_symbol | String | Old symbol of the margin token |
| new_symbol | String | New symbol of the margin token |
| old_index_price | String | Old index price of the margin token |
| new_index_price | String | New index price of the margin token |
| old_token_id | [TokenId](basic-types.md#TokenId) | Old margin token id of the margin_id |
| new_token_id | [TokenId](basic-types.md#TokenId) | New margin token id of the margin_id |
| old_token_id | [TokenId](basic-types.md#tokenid) | Old margin token id of the margin_id |
| new_token_id | [TokenId](basic-types.md#tokenid) | New margin token id of the margin_id |
| old_ratio | u8 | Old margin ratio of the margin token |
| new_ratio | u8 | New margin ratio of the margin token |

Expand Down Expand Up @@ -281,8 +281,8 @@ For example
| Field | Type | Description |
|-----------------------------|---------------------------------------------|--------------------------------------------------|
| update_id | i32 | update id |
| sub_account_id | [SubAccountId](basic-types.md#SubAccountId) | sub-account id |
| pair_id | [PairId](basic-types.md#PairId) | contract pair id |
| sub_account_id | [SubAccountId](basic-types.md#subaccountid) | sub-account id |
| pair_id | [PairId](basic-types.md#pairid) | contract pair id |
| old_symbol | String | old symbol of the contract pair |
| new_symbol | String | new symbol of the contract pair |
| old_maintenance_margin_rate | u16 | old maintenance margin rate of the contract pair |
Expand Down
4 changes: 2 additions & 2 deletions developer/api-and-sdk/data-types/transaction/liquidation.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

| Name | Type | Description |
|-------------|-------------------|---------------------------------|
| pairId | [PairId](#PairId) | The pair id |
| pairId | [PairId](#pairid) | The pair id |
| marketPrice | BigUint | The market price of the pair id |

{% endtab %}
Expand All @@ -33,7 +33,7 @@

| Name | Type | Description |
|------------|---------------------|-------------------------------|
| tokenId | [TokenId](#tokenId) | The token id |
| tokenId | [TokenId](#tokenid) | The token id |
| marketPrice | BigUint | The market price of the token |

{% endtab %}
Expand Down
4 changes: 2 additions & 2 deletions developer/api-and-sdk/data-types/transaction/transfer.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ L3 transfer
<tr><td> amount </td><td> BigUint </td><td> yes </td><td> Token amount, the value must be packable </td></tr>
<tr><td> fee </td><td> BugUint </td><td> yes </td><td> Fee returned by <code>estimateTransactionFee</code> API, the value should be packable </td></tr>
<tr><td> nonce </td><td> <a href="../basic-types.md#nonce">Nonce</a> </td><td> yes </td><td> Current nonce of the account |
<tr><td>signature </td><td> <a href="../basic-types.md#ZkLinkSignature">ZkLinkSignature</a> </td><td> yes </td><td> the public key hash corresponding to the signature must be aligned with the from_account </td></tr>
<tr><td>signature </td><td> <a href="../basic-types.md#zklinksignature">ZkLinkSignature</a> </td><td> yes </td><td> the public key hash corresponding to the signature must be aligned with the from_account </td></tr>
<tr><td> ts </td><td> u32 </td><td> yes </td><td> Timestamp of the API call, used as front-end request id to generate transaction hash </td></tr>
</tbody>
</table>
Expand Down Expand Up @@ -80,7 +80,7 @@ func SignTransfer() {
For more details please refer to [Golang example](https://github.com/zkLinkProtocol/zklink_sdk/tree/main/examples/Golang) in SDK
{% endtab %}

{% tab title="Javascript" }
{% tab title="Javascript" %}

```javascript
import init, * as wasm from "./web-dist/zklink-sdk-web.js";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Modify the collect-fee account.

| Name | Type | Required | Description |
|------------|-------------------------|-----------|--------------------|
| feeAccount | [AccountId](#AccountId)| yes | The fee account id |
| feeAccount | [AccountId](#accountid)| yes | The fee account id |

For example:

Expand All @@ -46,7 +46,7 @@ Modify the insurance fund account

| Name | Type | Required | Description |
|-----------|--------------------------|-----------|--------------------|
| accountId | [AccountId](#AccountId) | yes | The account id of insuranceFundAccount|
| accountId | [AccountId](#accountid) | yes | The account id of insuranceFundAccount|

For Example:

Expand All @@ -72,8 +72,8 @@ Modify the margin info in the specified index.

| Name | Type | Required | Description |
|----------|----------------------------|-----|---------------------------|
| marginId | [MarginId](#MarginId) | yes | The margin id |
| tokenId | [TokenId](#TokenId) | yes | The Token id |
| marginId | [MarginId](#marginid) | yes | The margin id |
| tokenId | [TokenId](#tokenid) | yes | The Token id |
| ratio | u8 | yes |the ratio, 100 means 1.0% |

For example
Expand Down Expand Up @@ -103,7 +103,7 @@ Modify the info of every perpetual contract pair.

| Name | Type | Required | Description |
|-----------------------|-------------------|------------|---------------------------------------------------------|
| pairId | [PairId](#PairId) | yes | The pair id |
| pairId | [PairId](#pairid) | yes | The pair id |
| symbol | String | yes | The symbol of the contract |
| initialMarginRate | u16 | yes | The initial margin rate of the contract, 100 means 0.1% |
| maintenanceMarginRate | u16 | yes | The maintenance margin rate, 100 means 0.1% |
Expand Down Expand Up @@ -134,7 +134,7 @@ Update the funding rates to accumulated funding rates of the Global Vars for all
| Name | Type | Required | Description |
|---------------|-------|-----------|-------------------|
| infos | array | yes | funding info list |
| > pairId | [PairId](#PairId) | yes | The pair id |
| > pairId | [PairId](#pairid) | yes | The pair id |
| > price | BigUint | yes | the mark price of the trade pair |
| > fundingRate | i16 | yes | the fee funding rate, the actual result needs to be divided by `10^6` |

Expand Down
2 changes: 1 addition & 1 deletion developer/api-and-sdk/json-rpc/json-rpc-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ The zkLink API follows the JSON-RPC standard and is accessed via POST.

{% tab title="Block" %}
* [getBlockByNumber](json-rpc-api.md#getblockbynumber): get the block info by block height.
* [getBlockOnChainByNumber](json-rpc-api.md#getBlockOnChainByNumber): get the transaction information in a block that is executed on L1 blockchains.
* [getBlockOnChainByNumber](json-rpc-api.md#getblockonchainbynumber): get the transaction information in a block that is executed on L1 blockchains.
{% endtab %}

{% tab title="Account" %}
Expand Down
Loading