diff --git a/V3(Recommended)/EN/aster-chain.md b/V3(Recommended)/EN/aster-chain.md index 29ba55a..95c2594 100644 --- a/V3(Recommended)/EN/aster-chain.md +++ b/V3(Recommended)/EN/aster-chain.md @@ -9,6 +9,14 @@ - [Get Account Status (USER_DATA)](#get-account-status-user_data) - [Modify Account Status (TRADE)](#modify-account-status-trade) - [Transfer to Address (WITHDRAW)](#transfer-to-address-withdraw) +- [Aster-Chain Staking Endpoints](#aster-chain-staking-endpoints) + - [Get Staking Account Status (USER_DATA)](#get-staking-account-status-user_data) + - [Get My Staking (USER_DATA)](#get-my-staking-user_data) + - [Get Claimable Rewards (USER_DATA)](#get-claimable-rewards-user_data) + - [Create Staking (TRADE)](#create-staking-trade) + - [Deposit Stake (TRADE)](#deposit-stake-trade) + - [Update Lock Period (TRADE)](#update-lock-period-trade) + - [Claim Rewards (TRADE)](#claim-rewards-trade) --- @@ -92,3 +100,202 @@ Transfer assets to another Aster Chain address. The recipient address must belon | nonce | LONG | YES | Microsecond timestamp | | user | STRING | YES | Source account wallet address | | signature | STRING | YES | EIP-712 signature, signed with the `user` account's wallet private key | + +--- + +# Aster-Chain Staking Endpoints + +## Get Staking Account Status (USER_DATA) + +> **Response:** + +```javascript +{ + "stakeAccountStatus": "ACTIVE" // "ACTIVE", "INACTIVE", or "PENDING" +} +``` + +`GET /aster-chain/v3/staking/stakeAccountStatus` + +Query the staking account status of the current user. + +**Weight:** 1 + +**Parameters:** + +| Name | Type | Mandatory | Description | +|------|------|-----------|-------------| +| nonce | LONG | YES | Microsecond timestamp | +| signer | STRING | YES | Agent wallet address (sub-wallet authorized to sign on behalf of the account) | +| signature | STRING | YES | EIP-712 signature, signed with the `signer` wallet private key | + +--- + +## Get My Staking (USER_DATA) + +> **Response:** + +```javascript +{ + "validatorAddress": "0x1a2b3c4d...", + "stakeAmount": "1000.00", + "periodCode": "90D", + "startTime": 1699900800000, + "endTime": 1707676800000, + "status": "ACTIVE" // "ACTIVE", "UNLOCKING", or "COMPLETED" +} +``` + +`GET /aster-chain/v3/staking/myStaking` + +Query the current user's staking position details. + +**Weight:** 1 + +**Parameters:** + +| Name | Type | Mandatory | Description | +|------|------|-----------|-------------| +| nonce | LONG | YES | Microsecond timestamp | +| signer | STRING | YES | Agent wallet address (sub-wallet authorized to sign on behalf of the account) | +| signature | STRING | YES | EIP-712 signature, signed with the `signer` wallet private key | + +--- + +## Get Claimable Rewards (USER_DATA) + +> **Response:** + +```javascript +{ + "claimableAmount": "12.50", + "asset": "ASTER", + "accruedRewards": "25.00", + "lastClaimTime": 1699900800000 +} +``` + +`GET /aster-chain/v3/staking/claimableRewards` + +Query the amount of staking rewards available to claim for the current user. + +**Weight:** 1 + +**Parameters:** + +| Name | Type | Mandatory | Description | +|------|------|-----------|-------------| +| nonce | LONG | YES | Microsecond timestamp | +| signer | STRING | YES | Agent wallet address (sub-wallet authorized to sign on behalf of the account) | +| signature | STRING | YES | EIP-712 signature, signed with the `signer` wallet private key | + +--- + +## Create Staking (TRADE) + +> **Response:** + +```javascript +{ + "result": "SUCCESS" +} +``` + +`POST /aster-chain/v3/staking/create` + +Create a new staking position by delegating tokens to a validator. The on-chain action type is `TokenDelegate` (`Stake`). + +**Weight:** 5 + +**Parameters:** + +| Name | Type | Mandatory | Description | +|------|------|-----------|-------------| +| validatorAddress | STRING | YES | Target validator's on-chain address | +| stakeAmount | DECIMAL | YES | Amount of tokens to stake, must be greater than 0 | +| periodCode | STRING | YES | Lock period code. Allowed values: `"26_WEEKS"`, `"52_WEEKS"`, `"104_WEEKS"`, `"156_WEEKS"`, `"208_WEEKS"` | +| nonce | LONG | YES | Microsecond timestamp | +| user | STRING | YES | Source account wallet address | +| signature | STRING | YES | EIP-712 signature, signed with the `user` account's wallet private key | + +--- + +## Deposit Stake (TRADE) + +> **Response:** + +```javascript +{ + "result": "SUCCESS" +} +``` + +`POST /aster-chain/v3/staking/deposit` + +Add tokens to an existing staking position on the specified validator. The on-chain action type is `TokenDelegate` (`AddStake`). + +**Weight:** 5 + +**Parameters:** + +| Name | Type | Mandatory | Description | +|------|------|-----------|-------------| +| validatorAddress | STRING | YES | Target validator's on-chain address | +| stakeAmount | DECIMAL | YES | Amount of additional tokens to stake, must be greater than 0 | +| nonce | LONG | YES | Microsecond timestamp | +| user | STRING | YES | Source account wallet address | +| signature | STRING | YES | EIP-712 signature, signed with the `user` account's wallet private key | + +--- + +## Update Lock Period (TRADE) + +> **Response:** + +```javascript +{ + "result": "SUCCESS" +} +``` + +`POST /aster-chain/v3/staking/updateLockPeriod` + +Extend the lock period of the current staking position. The on-chain action type is `TokenDelegate` (`ExtendStakingTime`). + +**Weight:** 5 + +**Parameters:** + +| Name | Type | Mandatory | Description | +|------|------|-----------|-------------| +| periodCode | STRING | YES | New lock period code. Allowed values: `"26_WEEKS"`, `"52_WEEKS"`, `"104_WEEKS"`, `"156_WEEKS"`, `"208_WEEKS"`. Must be longer than the current lock period. | +| nonce | LONG | YES | Microsecond timestamp | +| user | STRING | YES | Source account wallet address | +| signature | STRING | YES | EIP-712 signature, signed with the `user` account's wallet private key | + +--- + +## Claim Rewards (TRADE) + +> **Response:** + +```javascript +{ + "result": "SUCCESS" +} +``` + +`POST /aster-chain/v3/staking/claimRewards` + +Claim accumulated staking rewards. The on-chain action type is `TokenDelegate` (`ClaimRewards`). + +**Weight:** 5 + +**Parameters:** + +| Name | Type | Mandatory | Description | +|------|------|-----------|-------------| +| requestedAmount | DECIMAL | YES | Amount of rewards to claim, must be greater than 0 and not exceed the claimable balance | +| nonce | LONG | YES | Microsecond timestamp | +| user | STRING | YES | Source account wallet address | +| signature | STRING | YES | EIP-712 signature, signed with the `user` account's wallet private key | diff --git a/V3(Recommended)/EN/aster-finance-prediction-api-tesetnet.md b/V3(Recommended)/EN/aster-finance-prediction-api-tesetnet.md index b2d532a..d6b092f 100644 --- a/V3(Recommended)/EN/aster-finance-prediction-api-tesetnet.md +++ b/V3(Recommended)/EN/aster-finance-prediction-api-tesetnet.md @@ -475,6 +475,9 @@ In order to comply with the `market lot size`, the `quantity` must satisfy the f "LIMIT", "MARKET" ], // Supported order types + "settleIntervalSeconds": 5, //twap price internal + "settlementDataPointCount": 5, //twap price data count + "reduceOnly": false, //reduceOnly "timeInForce": [ "GTC", "IOC", diff --git "a/V3(Recommended)/\344\270\255\346\226\207/aster-chain_CN.md" "b/V3(Recommended)/\344\270\255\346\226\207/aster-chain_CN.md" index f37e324..6582338 100644 --- "a/V3(Recommended)/\344\270\255\346\226\207/aster-chain_CN.md" +++ "b/V3(Recommended)/\344\270\255\346\226\207/aster-chain_CN.md" @@ -9,6 +9,14 @@ - [查询账户状态 (USER_DATA)](#查询账户状态-user_data) - [修改账户状态 (TRADE)](#修改账户状态-trade) - [转账至地址 (WITHDRAW)](#转账至地址-withdraw) +- [Aster-Chain 质押接口](#aster-chain-质押接口) + - [查询质押账户状态 (USER_DATA)](#查询质押账户状态-user_data) + - [查询我的质押 (USER_DATA)](#查询我的质押-user_data) + - [查询可领取奖励 (USER_DATA)](#查询可领取奖励-user_data) + - [创建质押 (TRADE)](#创建质押-trade) + - [追加质押 (TRADE)](#追加质押-trade) + - [更新锁定期 (TRADE)](#更新锁定期-trade) + - [领取奖励 (TRADE)](#领取奖励-trade) --- @@ -92,3 +100,202 @@ | nonce | LONG | YES | 微秒时间戳 | | user | STRING | YES | 发起账户钱包地址 | | signature | STRING | YES | EIP-712 签名,使用 `user` 账户的钱包私钥签名 | + +--- + +# Aster-Chain 质押接口 + +## 查询质押账户状态 (USER_DATA) + +> **响应:** + +```javascript +{ + "stakeAccountStatus": "ACTIVE" // "ACTIVE"、"INACTIVE" 或 "PENDING" +} +``` + +`GET /aster-chain/v3/staking/stakeAccountStatus` + +查询当前用户的质押账户状态。 + +**权重:** 1 + +**参数:** + +| 名称 | 类型 | 是否必需 | 描述 | +|------|------|---------|------| +| nonce | LONG | YES | 微秒时间戳 | +| signer | STRING | YES | 代理钱包地址(被授权代表账户签名的子钱包) | +| signature | STRING | YES | EIP-712 签名,使用 `signer` 钱包私钥签名 | + +--- + +## 查询我的质押 (USER_DATA) + +> **响应:** + +```javascript +{ + "validatorAddress": "0x1a2b3c4d...", + "stakeAmount": "1000.00", + "periodCode": "90D", + "startTime": 1699900800000, + "endTime": 1707676800000, + "status": "ACTIVE" // "ACTIVE"、"UNLOCKING" 或 "COMPLETED" +} +``` + +`GET /aster-chain/v3/staking/myStaking` + +查询当前用户的质押仓位详情。 + +**权重:** 1 + +**参数:** + +| 名称 | 类型 | 是否必需 | 描述 | +|------|------|---------|------| +| nonce | LONG | YES | 微秒时间戳 | +| signer | STRING | YES | 代理钱包地址(被授权代表账户签名的子钱包) | +| signature | STRING | YES | EIP-712 签名,使用 `signer` 钱包私钥签名 | + +--- + +## 查询可领取奖励 (USER_DATA) + +> **响应:** + +```javascript +{ + "claimableAmount": "12.50", + "asset": "ASTER", + "accruedRewards": "25.00", + "lastClaimTime": 1699900800000 +} +``` + +`GET /aster-chain/v3/staking/claimableRewards` + +查询当前用户可领取的质押奖励数量。 + +**权重:** 1 + +**参数:** + +| 名称 | 类型 | 是否必需 | 描述 | +|------|------|---------|------| +| nonce | LONG | YES | 微秒时间戳 | +| signer | STRING | YES | 代理钱包地址(被授权代表账户签名的子钱包) | +| signature | STRING | YES | EIP-712 签名,使用 `signer` 钱包私钥签名 | + +--- + +## 创建质押 (TRADE) + +> **响应:** + +```javascript +{ + "result": "SUCCESS" +} +``` + +`POST /aster-chain/v3/staking/create` + +创建新的质押仓位,将代币委托至指定验证节点。链上操作类型为 `TokenDelegate`(`Stake`)。 + +**权重:** 5 + +**参数:** + +| 名称 | 类型 | 是否必需 | 描述 | +|------|------|---------|------| +| validatorAddress | STRING | YES | 目标验证节点的链上地址 | +| stakeAmount | DECIMAL | YES | 质押代币数量,必须大于 0 | +| periodCode | STRING | YES | 锁定周期代码,可选值:`"26_WEEKS"`、`"52_WEEKS"`、`"104_WEEKS"`、`"156_WEEKS"`、`"208_WEEKS"` | +| nonce | LONG | YES | 微秒时间戳 | +| user | STRING | YES | 发起账户钱包地址 | +| signature | STRING | YES | EIP-712 签名,使用 `user` 账户的钱包私钥签名 | + +--- + +## 追加质押 (TRADE) + +> **响应:** + +```javascript +{ + "result": "SUCCESS" +} +``` + +`POST /aster-chain/v3/staking/deposit` + +向指定验证节点的已有质押仓位追加代币。链上操作类型为 `TokenDelegate`(`AddStake`)。 + +**权重:** 5 + +**参数:** + +| 名称 | 类型 | 是否必需 | 描述 | +|------|------|---------|------| +| validatorAddress | STRING | YES | 目标验证节点的链上地址 | +| stakeAmount | DECIMAL | YES | 追加质押的代币数量,必须大于 0 | +| nonce | LONG | YES | 微秒时间戳 | +| user | STRING | YES | 发起账户钱包地址 | +| signature | STRING | YES | EIP-712 签名,使用 `user` 账户的钱包私钥签名 | + +--- + +## 更新锁定期 (TRADE) + +> **响应:** + +```javascript +{ + "result": "SUCCESS" +} +``` + +`POST /aster-chain/v3/staking/updateLockPeriod` + +延长当前质押仓位的锁定周期。链上操作类型为 `TokenDelegate`(`ExtendStakingTime`)。 + +**权重:** 5 + +**参数:** + +| 名称 | 类型 | 是否必需 | 描述 | +|------|------|---------|------| +| periodCode | STRING | YES | 新的锁定周期代码,可选值:`"26_WEEKS"`、`"52_WEEKS"`、`"104_WEEKS"`、`"156_WEEKS"`、`"208_WEEKS"`,须长于当前锁定周期 | +| nonce | LONG | YES | 微秒时间戳 | +| user | STRING | YES | 发起账户钱包地址 | +| signature | STRING | YES | EIP-712 签名,使用 `user` 账户的钱包私钥签名 | + +--- + +## 领取奖励 (TRADE) + +> **响应:** + +```javascript +{ + "result": "SUCCESS" +} +``` + +`POST /aster-chain/v3/staking/claimRewards` + +领取已累积的质押奖励。链上操作类型为 `TokenDelegate`(`ClaimRewards`)。 + +**权重:** 5 + +**参数:** + +| 名称 | 类型 | 是否必需 | 描述 | +|------|------|---------|------| +| requestedAmount | DECIMAL | YES | 申请领取的奖励数量,必须大于 0 且不超过可领取余额 | +| nonce | LONG | YES | 微秒时间戳 | +| user | STRING | YES | 发起账户钱包地址 | +| signature | STRING | YES | EIP-712 签名,使用 `user` 账户的钱包私钥签名 | diff --git "a/V3(Recommended)/\344\270\255\346\226\207/aster-finance-prediction-api-testnet.md" "b/V3(Recommended)/\344\270\255\346\226\207/aster-finance-prediction-api-testnet.md" index ff8bcb7..e82d6c1 100644 --- "a/V3(Recommended)/\344\270\255\346\226\207/aster-finance-prediction-api-testnet.md" +++ "b/V3(Recommended)/\344\270\255\346\226\207/aster-finance-prediction-api-testnet.md" @@ -475,6 +475,9 @@ Lots是拍卖术语,`LOT_SIZE` 过滤器对订单中的 `quantity` 也就是 "FOK", "GTX" ], //预测事件的TIF + "settleIntervalSeconds": 5, //twap 价格数据周期 + "settlementDataPointCount": 5, //twap 价格数据数量 + "reduceOnly": false, //是否只减仓 "liveRound":{ "marketName": "USD1_UP_DOWN_5M_1778483280", //预测市场的名字 "symbolIds": [