Wallet Structure

The custodial wallet of Solana has the following structure.

  • Main Address
  • Fee Address
  • Child Address

TIP
A fee (SOL) will be charged from the fee address when gathering. However, the fee will be charged from the fee address only when the fee delegation feature is enabled when withdrawing.






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": "8Y1Fw9f2K2zVUmcRmvnULsBwpRg8aRxKjVzfALti7SVx",
    "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 nameDescription
UNFINALIZEDDeposit transaction is included in the blocks
FINALIZEDDeposit 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.

TestnetMainnet
20 block (about 6s)20 block (about 12s)


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

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 SOLs 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 SOLs, 10 transactions will occur in total.

At this point, the gathering will not be made if the assets to be gathered are less than the expected fees. Gathering process is as follows.

  1. Request gathering.
  2. Generate a transaction for each child addresses to be gathered.
  3. Calculates the optimal fees and propagates the transactions.
  4. Gathering is completed when transactions are confirmed in the blocks.


Gathering Fees

Gathering fees are deducted from the fee address using the solana fee delegation feature. Therefore, you must store the fee (SOL) in the fee address before the gathering to avoid a deficit in the main address.

When the balance of the fee address is insufficient, only the maximum possible transaction that could be generated will be gathered. For example, if a gathering has to be processed for 10 child addresses, and the fee address balance is only enough to generate five transactions, then only five addresses will be gathered and not the others.



Gathering Status

Gathering status can be specified into four statuses, depending on the gathering process. The asset stored in the child address is in AWAITING_GATHERING status.

When a gathering request is made and generated 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 will be processed as GATHERING_FAILED. Assets with GATHERING_FAILED status 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 nameDescription
AWAITING_GATHERINGAwaiting gathering
GATHERINGGenerate gathering transaction
COMPLETEDComplete gathering transaction
GATHERING_FAILEDFailed 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": [
      "8Y1Fw9f2K2zVUmcRmvnULsBwpRg8aRxKjVzfALti7SVx"
    ]
  },
  {
    "success": false,
    "childAddresses": [
      "Ek2fgHXmLWDnCt8sEmUMmT6Hvr8uz79ZxPtRcMRyiJRm"
    ],
    "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": 66,
    "status": "COMPLETED",
    "createdDate": "2022-12-29T08:09:03.777Z",
    "modifiedDate": "2022-12-29T08:20:00.000Z",
    "coin": {
      "idx": 9,
      "symbol": "SOL",
      "nameKo": "솔라나",
      "nameEn": "Solana",
      "status": "ACTIVATED",
      "type": "DEFAULT",
      "contractAddress": null,
      "decimals": 9,
      "iconUrl": "https://s2.coinmarketcap.com/static/img/coins/64x64/5426.png",
      "deleteWalletMinAmount": "0.00010000000000000000",
      "createdDate": "2022-07-26T03:06:49.352Z",
      "modifiedDate": "2022-09-02T06:49:46.152Z"
    },
    "feeInjectionTransaction": null,
    "feeInjectionFee": null,
    "gatheringTransaction": {
      "idx": 8965,
      "uuid": "32c266f2-b395-4e82-b737-670ae7767600",
      "type": "GATHERING",
      "txid": "4oxFJCoskRufKQGsiVtSpLzSFv2VWqVi29Uc8hdcoxEKbEvVTay1K1AcYsSMbTAbgusWVGUe8TU6wtHc9UjFdTNV",
      "fromAddress": "Ek2fgHXmLWDnCt8sEmUMmT6Hvr8uz79ZxPtRcMRyiJRm",
      "toAddress": "8Y1Fw9f2K2zVUmcRmvnULsBwpRg8aRxKjVzfALti7SVx",
      "amount": "0.00005971000000000000",
      "usedFee": "0.00049029000000000000",
      "nonce": null,
      "blockHeight": "2133581",
      "serialized": null,
      "memo": null,
      "status": "FINALIZED",
      "outputIndex": null,
      "createdDate": "2022-12-29T08:10:00.262Z",
      "modifiedDate": "2022-12-29T08:20:00.000Z",
      "unfinalizedDate": "2022-12-29T08:20:00.000Z",
      "finalizedDate": "2022-12-29T08:20:00.000Z",
      "failedDate": null,
      "coin": {
        "idx": 9,
        "symbol": "SOL",
        "nameKo": "솔라나",
        "nameEn": "Solana",
        "status": "ACTIVATED",
        "type": "DEFAULT",
        "contractAddress": null,
        "decimals": 9,
        "iconUrl": "https://s2.coinmarketcap.com/static/img/coins/64x64/5426.png",
        "deleteWalletMinAmount": "0.00010000000000000000",
        "createdDate": "2022-09-20T07:40:18.511Z",
        "modifiedDate": "2022-12-23T06:13:37.636Z"
      }
    },
    "gatheringFee": {
      "idx": 151,
      "gasLimit": null,
      "gasPrice": "0.00005000000000000000",
      "unit": "lamport",
      "schedulerData": null,
      "createdDate": "2022-12-29T08:09:03.769Z",
      "modifiedDate": "2022-12-29T08:09:03.769Z"
    }
  }
]

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.

  1. Request withdrawal.
  2. Generate transaction.
  3. Calculates the optimal fees and propagates the transactions.
  4. 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 nameDescription
AWAITING_DECISIONAwaiting withdrawal approval
REJECTEDWithdrawal is denied
AWAITING_WITHDRAWALApproved and awaiting withdrawal
PENDINGWithdrawal transaction is generated
FINALIZEDWithdrawal transaction is included in the blocks
FAILEDWithdrawal transaction failed


Withdrawal Fees

You need to choose whether to use fee delegation for withdrawals.


1. Using Fee Delegation

The withdrawal fee will be deducted from the fee address if the fee delegation feature is enabled. In this case, the fee address should have assets(SOL) to pay the fee. Withdrawal will not proceed if the withdrawal fee is insufficient.


2. Not Using Fee Delegation

The withdrawal fee will be deducted from the main address if the fee delegation feature is disabled. Therefore, the main address should have assets(SOL) to pay the fee. Withdrawal will not proceed if the withdrawal fee is insufficient.



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": "18012e3f-07f3-45ec-862b-f020c0ca935a"
}


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": 608,
  "uuid": "07efdcb2-b3fd-4fe7-bf47-c0b460b289e3",
  "fromAddress": "Ek2fgHXmLWDnCt8sEmUMmT6Hvr8uz79ZxPtRcMRyiJRm",
  "toAddress": "8Y1Fw9f2K2zVUmcRmvnULsBwpRg8aRxKjVzfALti7SVx",
  "amount": "1.22300000000000000000",
  "memo": null,
  "requestId": "20221030170000",
  "type": "API",
  "description": "",
  "requiredApprovalCount": 1,
  "useApiAutoApproval": true,
  "status": "SENT",
  "createdDate": "2022-01-25T09:25:02.383Z",
  "modifiedDate": "2022-01-25T09:25:10.000Z",
  "rejectedDate": 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

Solana transaction fee is determined by the base fee per signature. Therefore, in general, 0.000005 SOL of fee occurs for a transaction. However, if fee delegation is enabled, two signatures are required, which occurs 0.00001 SOL of fee.






Faucet

In the case of the testnet, you must obtain a testing SOL from the faucet website and deposit it. When an actual SOL is deposited in the testnet, it will not be recognized.

TIP : Must proceed with DEVNET’s faucet.