Wemix
Wallet Structure
The custodial wallet of Wemix has the following structure.
- Main Address
- Fee Address
- Child Address
TIP
The fee address is used to recharge the child address with the fees (WEMIX) required to gather tokens.
Child Address
Generates child addresses by calling the Generate Child Address API. Generally, one child address is given to each end user. Generated child addresses can be checked from [Child Address Information] from the console or by calling the Access Child Address List API.
Response example
[
{
"address": "0x236c41418f0320DC7233C8c9dC99EEa5930341D9",
"name": "test address 001"
}
]
Deposit
Deposit Status
When an asset from the outside arrives at the main or a child address, Octet recognizes it as a deposit. However, the deposit is not finalized even if the deposit transaction is included in the blocks. Additional blocks must be generated to finalize(FINALIZED
) the transaction to ensure the integrity of the transaction. When an asset is sent to a main or a child address but has not arrived, that transaction is not recognized. Therefore, there is no FAILED
status for the deposit transaction.
Status name | Description |
---|---|
UNFINALIZED | Deposit transaction is included in the blocks |
FINALIZED | Deposit transaction is included in the blocks and the next block is generated |
The number of blocks required to finalize the deposit is different depending on the network. Both testnet and mainnet require additional 20 blocks to finalize the transaction.
Testnet | Mainnet |
---|---|
20 block (about 20s) | 20 block (about 20s) |
Deposit Confirmation
1. Checking from the Console
You can check the deposit status from [Transaction History] on the console. UNFINALIZED
deposits are displayed as ‘Processing’, and FINALIZED
deposits are displayed as ‘Completed’.
2. Checking with Webhooks
When a deposit is finalized to a main or a child address, a deposit webhook will be sent. You can check the deposit status from the received webhook. For more information about how to use webhooks and their data structure, check the 'Webhook' page.
Gathering
Gathering Process and Fees
Assets stored in child addresses don’t move to the main address unless gathering is requested. Therefore, gatherings should be made regularly to avoid a deficit in the main address.
When a gathering of a specific asset is requested, all WEMIXs or tokens stored in every child address transfer to the main address. At this point, one transaction occurs per each child address. For example, when 10 child addresses store WEMIXs, 10 transactions will occur in total.
1. Gathering WEMIX
A WEMIX gathering fee occurs for each transaction, and it is deducted from the asset to be gathered. Gathering will not be made for child addresses with assets less than the expected fees. Gathering process is as follows.
- Request gathering.
- Generate a transaction for each child addresses to be gathered.
- Calculates the optimal fees and propagates the transactions.
- Gathering is completed when transactions are confirmed in the blocks.
2. Gathering Tokens
A token-gathering fee occurs for each transaction. When there are not enough WEMIXs in the child address, WEMIXs in the fee address will be recharged to the child address. A fee (fee-recharging cost) will occur for this process as well. The child address pays the fee with the transferred WEMIXs and proceeds with the gathering. Gathering process is as follows.
- Request gathering.
- Recharge WEMIXs to pay the fee from the fee address to the child address.
- Generate a transaction for each child addresses to be gathered.
- Calculates the optimal fees and propagates the transactions.
- Gathering is completed when transactions are confirmed in the blocks.
Gathering Status
Gathering status can be specified into seven types, depending on the process. The asset stored in the child address is in AWAITING_GATHERING
status.
When it needs a recharging of fees for the gathering, the status of the asset changes to AWAITING_FEE_INJECTION
. When the fee transfer transaction is generated, the status of the asset changes to FEE_INJECTING
. When it fails to recharge the fee, the status of the asset is processed to FEE_INJECTION_FAILED
.
When the fee transfer is successful and generates a gathering transaction, the asset status changes to GATHERING
. When the transaction is included in the blocks, the status of the asset is processed to COMPLETED
and finishes the gathering.
When a gathering is tried and failed, the status of the asset remains as GATHERING_FAILED
. Assets with a status of fee injection failed or gathering failed are included in the gathering target again. When a gathering is tried but failed to generate a transaction due to insufficient fees, it remains in AWAITING_GATHERING
status.
Status name | Description |
---|---|
AWAITING_GATHERING | Awaiting gathering |
AWAITING_FEE_INJECTION | Awaiting fee injection |
FEE_INJECTING | Processing fee injection |
FEE_INJECTION_FAILED | Failed fee injection |
GATHERING | Generate gathering transaction |
COMPLETED | Complete gathering transaction |
GATHERING_FAILED | Failed gathering transaction |
Gather
Transfers the assets stored in the child address to the main address. Gatherings can be processed by one of the following two methods.
1. Gathering from the Console
You can gather from Console - Select a wallet - [Gathering History]. Click the [Gather] button, check the assets and the amount to gather, then proceed with the gathering.
2. Gathering with API
The gathering will be processed by calling the Request Gathering API.
Response example
[
{
"success": true,
"uuid": "97410344-a48b-4f7e-a1ee-2feff91bebaa",
"childAddresses": [
"0x42d0aAE9A2305D66d20bE4361535FdB44670F933"
]
},
{
"success": false,
"childAddresses": [
"0x94c1e678705cA8FB2d5929B37d01aAb14ffA9D7d"
],
"errorCode": "ERR_0420002",
"errorMessage": "The amount to be gathered is less than the minimum amount to be gathered."
}
]
Gathering Status Confirmation
1. Checking from the Console
You can check the gathering history from Select a wallet - [Gathering History] - [Gathering History].
2. Checking with API
You can check the gathering history by calling the Access Gathering Request Information API.
Response example
[
{
"idx": 735,
"status": "COMPLETED",
"createdDate": "2022-11-11T06:31:20.115Z",
"modifiedDate": "2022-11-11T06:33:00.000Z",
"coin": {
"idx": 11,
"symbol": "WEMIX",
"nameKo": "위믹스",
"nameEn": "Wemix",
"status": "ACTIVATED",
"type": "DEFAULT",
"contractAddress": null,
"decimals": 18,
"createdDate": "2022-11-11T02:52:24.052Z",
"modifiedDate": "2022-11-11T02:52:24.052Z"
},
"feeInjectionTransaction": null,
"feeInjectionFee": null,
"gatheringTransaction": {
"idx": 234857,
"uuid": "02b4a8eb-563c-4ce9-9d00-7741e70709a2",
"type": "GATHERING",
"txid": "0xbf899468f079ab0f00b136aeed35cfab7495d9ea0045a67298a7b22f5a02fe31",
"fromAddress": "0xb0F3290133dfB34Cee6b30d55463ff93E6F94621",
"toAddress": "0x5401fC8E23f594aF7db8de753b81393cc14e0dc2",
"amount": "9.99769000000000000000",
"usedFee": "0.00231000000000000000",
"nonce": 0,
"blockHeight": "10096021",
"serialized": null,
"memo": null,
"status": "FINALIZED",
"outputIndex": 0,
"createdDate": "2022-11-11T06:32:00.337Z",
"modifiedDate": "2022-11-11T06:33:00.000Z",
"unfinalizedDate": "2022-11-11T06:33:00.000Z",
"finalizedDate": "2022-11-11T06:33:00.000Z",
"failedDate": null,
"coin": {
"idx": 11,
"symbol": "WEMIX",
"nameKo": "위믹스",
"nameEn": "Wemix",
"status": "ACTIVATED",
"type": "DEFAULT",
"contractAddress": null,
"decimals": 18,
"createdDate": "2022-11-11T02:52:24.052Z",
"modifiedDate": "2022-11-11T02:52:24.052Z"
}
},
"gatheringFee": {
"idx": 1381612,
"gasLimit": "21000.00000000000000000000",
"gasPrice": "110.00000000000000000000",
"rate": null,
"unit": "gwei",
"createdDate": "2022-11-11T06:31:20.107Z",
"modifiedDate": "2022-11-11T06:31:20.107Z"
}
}
]
3. Checking with Webhooks
When the gathering to the main address is finished, a gathering webhook will be sent. You can check the gathering status from the webhook. For more information about how to use webhooks and their data structure, check the 'Webhook' page.
Withdrawal
Withdrawal Process
Assets must be withdrawn from the main address to transfer them from a custodial wallet to the outside. An asset cannot be transferred outside from the child address.
- Request withdrawal.
- Generate transaction.
- Calculates the optimal fees and propagates the transactions.
- Withdrawal is completed when the transactions are confirmed in the blocks.
Withdrawal Status
Unlike a deposit, a withdrawal is finalized(FINALIZED
) at the moment when the transaction is included in the blocks.
Status name | Description |
---|---|
AWAITING_DECISION | Awaiting withdrawal approval |
REJECTED | Withdrawal is denied |
AWAITING_WITHDRAWAL | Approved and awaiting withdrawal |
PENDING | Withdrawal transaction is generated |
FINALIZED | Withdrawal transaction is included in the blocks |
FAILED | Withdrawal transaction failed |
Withdraw
You can request a withdrawal from the main address to the outside by calling the Request Withdrawal API. The uuid
value will be returned when the withdrawal request is successful. The value can be used to access the withdrawal process.
Response example
{
"uuid": "8bc699a0-7dbd-4b34-b546-e908b448907d"
}
Withdrawal Confirmation
1. Checking from the Console
You can check the withdrawal status from [Transaction History] on the console. AWAITING_WITHDRAWAL
or PENDING
withdrawals are displayed as ‘Processing’, and FINALIZED
withdrawals are displayed as ‘Completed’.
2. Checking with API
You can check the progress of a specific withdrawal transaction by calling the Access Withdrawal Transaction Information API.
Response example
{
"idx": 2220480,
"coin": {
"idx": 11,
"symbol": "WEMIX",
"nameKo": "위믹스",
"nameEn": "Wemix",
"status": "ACTIVATED",
"type": "DEFAULT",
"contractAddress": null,
"decimals": 18,
"createdDate": "2022-11-11T02:52:24.052Z",
"modifiedDate": "2022-11-11T02:52:24.052Z"
},
"uuid": "8bc699a0-7dbd-4b34-b546-e908b448907d",
"fromAddress": "0x5401fC8E23f594aF7db8de753b81393cc14e0dc2",
"toAddress": "0x3971bc926EEdb0301aE3e6cF80D4FE12F9053F6b",
"amount": "10.00000000000000000000",
"memo": null,
"requestId": "202211111535",
"type": "API",
"description": "",
"requiredApprovalCount": 2,
"useApiAutoApproval": false,
"useFeeDelegation": false,
"feePayerAddress": null,
"status": "AWAITING_DECISION",
"createdDate": "2022-11-11T06:35:26.586Z",
"modifiedDate": "2022-11-11T06:35:26.586Z",
"rejectedDate": null,
"transaction": null
}
3. Checking with Webhooks
When the withdrawal from the main address is finished, a withdrawal webhook will be sent. You can check the withdrawal status from the webhook. For more information about how to use webhooks and their data structure, check the Webhook page.
Balance Access Criteria
You can check the balance of the asset stored in a specific address by calling the Access Address Balance API. The accessed balances are specified into total balances and liquid balances.
- Total balance is all assets with a confirmation of 1 or above.
- Liquid balance refers to the assets that can be gathered or withdrawn. The liquid balance of a child address represents the assets that can be gathered, while the liquid balance of the main address represents the assets that can be withdrawn.
Fees
Estimated Fees
Estimated fees are calculated by multiplying the gas limit and the gas price.
Estimated Fees = Gas Limit x Max Fee Per Gas
- Gas Limit is the maximum gas usage. Octet sets WEMIX gas limit to 21,000, and the gas limit for tokens is set to 100,000 since it varies depending on how the tokens are implemented. The actual gas usage could be less than that, and the fees are charged for the actual gas usage.
- Max Fee Per Gas is the maximum value of the fee per gas. You can access the value in real-time by calling the Fee/Gas API. Actual fee per gas could be less than that.
Transaction Fees
Transaction Fees are calculated by multiplying the gas usage and the gas price.
Transaction Fees = Usage by Txn x Gas Price
- Gas Price includes the fee paid to the miner, Max Priority Fee Per Gas. Octet sets the value to 110 Gwei.
Faucet
In the case of the testnet, you must obtain a testing WEMIX from the faucet website and deposit it. When an actual WEMIX is deposited in the testnet, it will not be recognized.
Updated about 1 year ago