Deposit to MegaVault
Deposit USDC into MegaVault
Method Declaration
Python
async def deposit(
self, wallet: Wallet, address: str, subaccount_number: int, amount: Decimal
) -> AnyParameters
| Parameter | Location | Type | Description |
|---|---|---|---|
account | query | Account | Owner's account information |
subaccount | query | SubaccountInfo | Subaccount information |
amount | query | Decimal | Amount in usdc to deposit |
Response
| Status | Meaning | Schema | Description |
|---|---|---|---|
200 | OK | TxHash | The transaction hash. |
400 | Bad Request | The request was malformed or invalid. | |
404 | Not Found | The subaccount was not found. |
Withdraw from MegaVault
Withdraw funds (USDC) from the subaccount to the address.
Method Declaration
Python
async def withdraw(
self,
wallet: Wallet,
address: str,
subaccount_number: int,
min_amount: Decimal,
shares: Optional[int],
) -> AnyParameters
| Parameter | Location | Type | Description |
|---|---|---|---|
account | query | Account | Owner's account |
subaccount | query | SubaccountInfo | Subaccount information |
min_amount | query | Decimal | Minimum amount to withdraw i usdc |
shares | query | BigInt | Number of shares |
Response
| Status | Meaning | Schema | Description |
|---|---|---|---|
200 | OK | TxHash | The transaction hash. |
400 | Bad Request | The request was malformed or invalid. | |
404 | Not Found | The subaccount was not found. |
Get Owner Shares in MegaVault
Query the shares associated with an Address.
Method Declaration
Python
async def get_owner_shares(
self, address: str
) -> vault_query.QueryMegavaultOwnerSharesResponseParameters
| Parameter | Location | Type | Description |
|---|---|---|---|
address | query | Address | The wallet address that owns the subaccount. |
Response
| Status | Meaning | Schema | |
|---|---|---|---|
200 | OK | QueryMegavaultOwnerSharesResponse | |
400 | Bad Request | The request was malformed or invalid. |
Get Withdrawal Info of MegaVault
Query the withdrawal information for a specified number of shares.
Method Declaration
Python
async def get_withdrawal_info(
self, shares: int
) -> vault_query.QueryMegavaultWithdrawalInfoResponseParameters
| Parameter | Location | Type | Description |
|---|---|---|---|
shares | query | BigInt | Number of shares |
Response
| Status | Meaning | Schema | |
|---|---|---|---|
200 | OK | QueryMegavaultWithdrawalInfoResponse | |
400 | Bad Request | The request was malformed or invalid. |