diff --git a/V3(Recommended)/EN/aster-chain.md b/V3(Recommended)/EN/aster-chain.md index 95c2594..e674bb5 100644 --- a/V3(Recommended)/EN/aster-chain.md +++ b/V3(Recommended)/EN/aster-chain.md @@ -17,6 +17,18 @@ - [Deposit Stake (TRADE)](#deposit-stake-trade) - [Update Lock Period (TRADE)](#update-lock-period-trade) - [Claim Rewards (TRADE)](#claim-rewards-trade) +- [Aster-Chain Perp Withdraw & Transfer Endpoints](#aster-chain-perp-withdraw--transfer-endpoints) + - [User Withdraw (WITHDRAW)](#user-withdraw-withdraw) + - [User Solana Withdraw (WITHDRAW)](#user-solana-withdraw-withdraw) + - [Get Withdraw Info (USER_DATA)](#get-withdraw-info-user_data) + - [Deposit/Withdraw History (USER_DATA)](#depositwithdraw-history-user_data) + - [Wallet Transfer (TRADE)](#wallet-transfer-trade) +- [Aster-Chain Spot Withdraw & Transfer Endpoints](#aster-chain-spot-withdraw--transfer-endpoints) + - [User Withdraw (WITHDRAW)](#user-withdraw-withdraw-1) + - [User Solana Withdraw (WITHDRAW)](#user-solana-withdraw-withdraw-1) + - [Wallet Transfer (TRADE)](#wallet-transfer-trade-1) +- [Aster-Chain Withdraw Endpoints](#aster-chain-withdraw-endpoints) + - [Estimate Withdraw Fee (NONE)](#estimate-withdraw-fee-none) --- @@ -299,3 +311,302 @@ Claim accumulated staking rewards. The on-chain action type is `TokenDelegate` ( | 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 Perp Withdraw & Transfer Endpoints + +## User Withdraw (WITHDRAW) + +> **Response:** + +```javascript +{ + "withdrawId": "987654321", + "hash": "0xabc123..." +} +``` + +`POST /aster-chain/v3/perp/user-withdraw` + +Submit a withdrawal request from the perp account to an on-chain address. + +**Weight:** 5 + +**Parameters:** + +| Name | Type | Mandatory | Description | +|------|------|-----------|-------------| +| asset | STRING | YES | Asset name (e.g. `"USDT"`) | +| chainId | INTEGER | YES | Target chain ID | +| amount | STRING | YES | Withdrawal amount | +| fee | STRING | YES | Withdrawal fee | +| receiver | STRING | YES | Recipient on-chain address | +| userNonce | STRING | YES | User-side nonce included in the signature | +| userSignature | STRING | YES | User signature over the withdrawal parameters | + +--- + +## User Solana Withdraw (WITHDRAW) + +> **Response:** + +```javascript +{ + "withdrawId": "987654321", + "hash": "0xabc123..." +} +``` + +`POST /aster-chain/v3/perp/user-solana-withdraw` + +Submit a withdrawal request from the perp account to a Solana address. + +**Weight:** 5 + +**Parameters:** + +| Name | Type | Mandatory | Description | +|------|------|-----------|-------------| +| asset | STRING | YES | Asset name (e.g. `"USDT"`) | +| chainId | INTEGER | YES | Target chain ID | +| amount | STRING | YES | Withdrawal amount | +| fee | STRING | YES | Withdrawal fee | +| receiver | STRING | YES | Recipient Solana address | +| userNonce | STRING | YES | User-side nonce included in the signature | +| userSignature | STRING | YES | User signature over the withdrawal parameters | + +--- + +## Get Withdraw Info (USER_DATA) + +> **Response:** + +```javascript +{ + "userDailyLimit": "10000", + "userRemainingDailyLimit": "9500", + "totalDailyLimit": "100000", + "totalRemainingDailyLimit": "95000", + "balances": { + "USDT": { + "currency": "USDT", + "spotTotalWithdrawAmount": "0", + "perpTotalWithdrawAmount": "500", + "dailyLimit": "5000", + "chainBalances": { + "1": { + "chainId": 1, + "spotMaxWithdrawAmount": "1000", + "perpMaxWithdrawAmount": "4500", + "chainLimit": "5000", + "withdrawFee": "0.5" + } + } + } + } +} +``` + +`GET /aster-chain/v3/perp/user-withdraw-info` + +Query the current user's withdrawal limits and available balances per asset and chain. + +**Weight:** 1 + +**Parameters:** + +None + +--- + +## Deposit/Withdraw History (USER_DATA) + +> **Response:** + +```javascript +[ + { + "id": "12345", + "type": "WITHDRAW", // "DEPOSIT" or "WITHDRAW" + "asset": "USDT", + "amount": "100", + "state": "COMPLETED", + "txHash": "0xabc123...", + "time": 1699900800000, + "chainId": 1, + "accountType": "perp" + } +] +``` + +`GET /aster-chain/v3/perp/deposit-withdraw-history` + +Query the deposit and withdrawal history for the current user's perp account. + +**Weight:** 5 + +**Parameters:** + +| Name | Type | Mandatory | Description | +|------|------|-----------|-------------| +| chainId | STRING | NO | Filter records by chain ID | + +--- + +## Wallet Transfer (TRADE) + +> **Response:** + +```javascript +{ + "tranId": 123456789, + "status": "SUCCESS" +} +``` + +`POST /aster-chain/v3/perp/wallet/transfer` + +Transfer assets between the spot wallet and the perp account. + +**Weight:** 5 + +**Parameters:** + +| Name | Type | Mandatory | Description | +|------|------|-----------|-------------| +| asset | STRING | YES | Asset name (e.g. `"USDT"`) | +| amount | DECIMAL | YES | Transfer amount, must be greater than 0 | +| clientTranId | STRING | YES | Client-defined transfer ID | +| kindType | STRING | YES | Transfer direction: `"SPOT_FUTURE"` (spot → perp) or `"FUTURE_SPOT"` (perp → spot) | +| 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 Spot Withdraw & Transfer Endpoints + +## User Withdraw (WITHDRAW) + +> **Response:** + +```javascript +{ + "withdrawId": "987654321", + "hash": "0xabc123..." +} +``` + +`POST /aster-chain/v3/spot/user-withdraw` + +Submit a withdrawal request from the spot account to an on-chain address. + +**Weight:** 5 + +**Parameters:** + +| Name | Type | Mandatory | Description | +|------|------|-----------|-------------| +| asset | STRING | YES | Asset name (e.g. `"USDT"`) | +| chainId | INTEGER | YES | Target chain ID | +| amount | STRING | YES | Withdrawal amount | +| fee | STRING | YES | Withdrawal fee | +| receiver | STRING | YES | Recipient on-chain address | +| userNonce | STRING | YES | User-side nonce included in the signature | +| userSignature | STRING | YES | User signature over the withdrawal parameters | + +--- + +## User Solana Withdraw (WITHDRAW) + +> **Response:** + +```javascript +{ + "withdrawId": "987654321", + "hash": "0xabc123..." +} +``` + +`POST /aster-chain/v3/spot/user-solana-withdraw` + +Submit a withdrawal request from the spot account to a Solana address. + +**Weight:** 5 + +**Parameters:** + +| Name | Type | Mandatory | Description | +|------|------|-----------|-------------| +| asset | STRING | YES | Asset name (e.g. `"USDT"`) | +| chainId | INTEGER | YES | Target chain ID | +| amount | DECIMAL | YES | Withdrawal amount | +| fee | DECIMAL | YES | Withdrawal fee | +| receiver | STRING | YES | Recipient Solana address | +| userNonce | STRING | YES | User-side nonce included in the signature | +| userSignature | STRING | YES | User signature over the withdrawal parameters | + +--- + + +## Wallet Transfer (TRADE) + +> **Response:** + +```javascript +{ + "tranId": 123456789, + "status": "SUCCESS" +} +``` + +`POST /aster-chain/v3/spot/wallet/transfer` + +Transfer assets between the spot wallet and the perp account. + +**Weight:** 5 + +**Parameters:** + +| Name | Type | Mandatory | Description | +|------|------|-----------|-------------| +| asset | STRING | YES | Asset name (e.g. `"USDT"`) | +| amount | DECIMAL | YES | Transfer amount, must be greater than 0 | +| clientTranId | STRING | YES | Client-defined transfer ID | +| kindType | STRING | YES | Transfer direction: `"SPOT_FUTURE"` (spot → perp) or `"FUTURE_SPOT"` (perp → spot) | +| 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 Withdraw Endpoints + +## Estimate Withdraw Fee (NONE) + +> **Response:** + +```javascript +{ + "gasPrice": 1000000000, + "gasLimit": 21000, + "nativePrice": "1800.00", + "tokenPrice": "1.00", + "gasCost": "0.000021", + "gasUsdValue": "0.038" +} +``` + +`GET /aster-chain/v3/withdraw/estimateFee` + +Estimate the gas fee for a withdrawal on the specified chain and asset. + +**Weight:** 1 + +**Parameters:** + +| Name | Type | Mandatory | Description | +|------|------|-----------|-------------| +| chainId | INTEGER | YES | Target chain ID | +| asset | STRING | YES | Asset name (e.g. `"USDT"`) | 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 6582338..2dd9323 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" @@ -17,6 +17,18 @@ - [追加质押 (TRADE)](#追加质押-trade) - [更新锁定期 (TRADE)](#更新锁定期-trade) - [领取奖励 (TRADE)](#领取奖励-trade) +- [Aster-Chain 合约提现与划转接口](#aster-chain-合约提现与划转接口) + - [合约提现 (WITHDRAW)](#合约提现-withdraw) + - [合约 Solana 提现 (WITHDRAW)](#合约-solana-提现-withdraw) + - [查询提现信息 (USER_DATA)](#查询提现信息-user_data) + - [充提记录 (USER_DATA)](#充提记录-user_data) + - [钱包划转 (TRADE)](#钱包划转-trade) +- [Aster-Chain 现货提现与划转接口](#aster-chain-现货提现与划转接口) + - [现货提现 (WITHDRAW)](#现货提现-withdraw) + - [现货 Solana 提现 (WITHDRAW)](#现货-solana-提现-withdraw) + - [钱包划转 (TRADE)](#钱包划转-trade-1) +- [Aster-Chain 提现接口](#aster-chain-提现接口) + - [估算提现手续费 (NONE)](#估算提现手续费-none) --- @@ -299,3 +311,301 @@ | nonce | LONG | YES | 微秒时间戳 | | user | STRING | YES | 发起账户钱包地址 | | signature | STRING | YES | EIP-712 签名,使用 `user` 账户的钱包私钥签名 | + +--- + +# Aster-Chain 合约提现与划转接口 + +## 合约提现 (WITHDRAW) + +> **响应:** + +```javascript +{ + "withdrawId": "987654321", + "hash": "0xabc123..." +} +``` + +`POST /aster-chain/v3/perp/user-withdraw` + +从合约账户提现至链上地址。 + +**权重:** 5 + +**参数:** + +| 名称 | 类型 | 是否必需 | 描述 | +|------|------|---------|------| +| asset | STRING | YES | 资产名称(如 `"USDT"`) | +| chainId | INTEGER | YES | 目标链 ID | +| amount | STRING | YES | 提现金额 | +| fee | STRING | YES | 提现手续费 | +| receiver | STRING | YES | 接收方链上地址 | +| userNonce | STRING | YES | 签名中包含的用户端 nonce | +| userSignature | STRING | YES | 用户对提现参数的签名 | + +--- + +## 合约 Solana 提现 (WITHDRAW) + +> **响应:** + +```javascript +{ + "withdrawId": "987654321", + "hash": "0xabc123..." +} +``` + +`POST /aster-chain/v3/perp/user-solana-withdraw` + +从合约账户提现至 Solana 地址。 + +**权重:** 5 + +**参数:** + +| 名称 | 类型 | 是否必需 | 描述 | +|------|------|---------|------| +| asset | STRING | YES | 资产名称(如 `"USDT"`) | +| chainId | INTEGER | YES | 目标链 ID | +| amount | STRING | YES | 提现金额 | +| fee | STRING | YES | 提现手续费 | +| receiver | STRING | YES | 接收方 Solana 地址 | +| userNonce | STRING | YES | 签名中包含的用户端 nonce | +| userSignature | STRING | YES | 用户对提现参数的签名 | + +--- + +## 查询提现信息 (USER_DATA) + +> **响应:** + +```javascript +{ + "userDailyLimit": "10000", + "userRemainingDailyLimit": "9500", + "totalDailyLimit": "100000", + "totalRemainingDailyLimit": "95000", + "balances": { + "USDT": { + "currency": "USDT", + "spotTotalWithdrawAmount": "0", + "perpTotalWithdrawAmount": "500", + "dailyLimit": "5000", + "chainBalances": { + "1": { + "chainId": 1, + "spotMaxWithdrawAmount": "1000", + "perpMaxWithdrawAmount": "4500", + "chainLimit": "5000", + "withdrawFee": "0.5" + } + } + } + } +} +``` + +`GET /aster-chain/v3/perp/user-withdraw-info` + +查询当前用户各资产、各链的提现限额及可用余额。 + +**权重:** 1 + +**参数:** + +无 + +--- + +## 充提记录 (USER_DATA) + +> **响应:** + +```javascript +[ + { + "id": "12345", + "type": "WITHDRAW", // "DEPOSIT" 或 "WITHDRAW" + "asset": "USDT", + "amount": "100", + "state": "COMPLETED", + "txHash": "0xabc123...", + "time": 1699900800000, + "chainId": 1, + "accountType": "perp" + } +] +``` + +`GET /aster-chain/v3/perp/deposit-withdraw-history` + +查询当前用户合约账户的充值与提现历史记录。 + +**权重:** 5 + +**参数:** + +| 名称 | 类型 | 是否必需 | 描述 | +|------|------|---------|------| +| chainId | STRING | NO | 按链 ID 过滤记录 | + +--- + +## 钱包划转 (TRADE) + +> **响应:** + +```javascript +{ + "tranId": 123456789, + "status": "SUCCESS" +} +``` + +`POST /aster-chain/v3/perp/wallet/transfer` + +在现货钱包与合约账户之间划转资产。 + +**权重:** 5 + +**参数:** + +| 名称 | 类型 | 是否必需 | 描述 | +|------|------|---------|------| +| asset | STRING | YES | 资产名称(如 `"USDT"`) | +| amount | DECIMAL | YES | 划转金额,必须大于 0 | +| clientTranId | STRING | YES | 客户端自定义划转 ID | +| kindType | STRING | YES | 划转方向:`"SPOT_FUTURE"`(现货 → 合约)或 `"FUTURE_SPOT"`(合约 → 现货) | +| nonce | LONG | YES | 微秒时间戳 | +| user | STRING | YES | 发起账户钱包地址 | +| signature | STRING | YES | EIP-712 签名,使用 `user` 账户的钱包私钥签名 | + +--- + +# Aster-Chain 现货提现与划转接口 + +## 现货提现 (WITHDRAW) + +> **响应:** + +```javascript +{ + "withdrawId": "987654321", + "hash": "0xabc123..." +} +``` + +`POST /aster-chain/v3/spot/user-withdraw` + +从现货账户提现至链上地址。 + +**权重:** 5 + +**参数:** + +| 名称 | 类型 | 是否必需 | 描述 | +|------|------|---------|------| +| asset | STRING | YES | 资产名称(如 `"USDT"`) | +| chainId | INTEGER | YES | 目标链 ID | +| amount | STRING | YES | 提现金额 | +| fee | STRING | YES | 提现手续费 | +| receiver | STRING | YES | 接收方链上地址 | +| userNonce | STRING | YES | 签名中包含的用户端 nonce | +| userSignature | STRING | YES | 用户对提现参数的签名 | + +--- + +## 现货 Solana 提现 (WITHDRAW) + +> **响应:** + +```javascript +{ + "withdrawId": "987654321", + "hash": "0xabc123..." +} +``` + +`POST /aster-chain/v3/spot/user-solana-withdraw` + +从现货账户提现至 Solana 地址。 + +**权重:** 5 + +**参数:** + +| 名称 | 类型 | 是否必需 | 描述 | +|------|------|---------|------| +| asset | STRING | YES | 资产名称(如 `"USDT"`) | +| chainId | INTEGER | YES | 目标链 ID | +| amount | DECIMAL | YES | 提现金额 | +| fee | DECIMAL | YES | 提现手续费 | +| receiver | STRING | YES | 接收方 Solana 地址 | +| userNonce | STRING | YES | 签名中包含的用户端 nonce | +| userSignature | STRING | YES | 用户对提现参数的签名 | + +--- + +## 钱包划转 (TRADE) + +> **响应:** + +```javascript +{ + "tranId": 123456789, + "status": "SUCCESS" +} +``` + +`POST /aster-chain/v3/spot/wallet/transfer` + +在现货钱包与合约账户之间划转资产。 + +**权重:** 5 + +**参数:** + +| 名称 | 类型 | 是否必需 | 描述 | +|------|------|---------|------| +| asset | STRING | YES | 资产名称(如 `"USDT"`) | +| amount | DECIMAL | YES | 划转金额,必须大于 0 | +| clientTranId | STRING | YES | 客户端自定义划转 ID | +| kindType | STRING | YES | 划转方向:`"SPOT_FUTURE"`(现货 → 合约)或 `"FUTURE_SPOT"`(合约 → 现货) | +| nonce | LONG | YES | 微秒时间戳 | +| user | STRING | YES | 发起账户钱包地址 | +| signature | STRING | YES | EIP-712 签名,使用 `user` 账户的钱包私钥签名 | + +--- + +# Aster-Chain 提现接口 + +## 估算提现手续费 (NONE) + +> **响应:** + +```javascript +{ + "gasPrice": 1000000000, + "gasLimit": 21000, + "nativePrice": "1800.00", + "tokenPrice": "1.00", + "gasCost": "0.000021", + "gasUsdValue": "0.038" +} +``` + +`GET /aster-chain/v3/withdraw/estimateFee` + +估算指定链和资产的提现 Gas 手续费。 + +**权重:** 1 + +**参数:** + +| 名称 | 类型 | 是否必需 | 描述 | +|------|------|---------|------| +| chainId | INTEGER | YES | 目标链 ID | +| asset | STRING | YES | 资产名称(如 `"USDT"`) |