Function withdrawFromTradingImpl

  • Withdraws a specified amount of an asset from the trading account. If the trading account is not initialized, an error is thrown. If the asset is a EURO_TOKEN, OptionChain must be provided in the optional param.

    Throws

    Throws an error if the trading account is not initialized.

    Todo

    Add a rent checker for account creation cost.

    Todo

    Add CloseTokenAccount instruction if token account is zeroed out.

    Parameters

    • this: SdxClient
    • asset: AssetType

      The type of the asset to withdraw.

    • amount: BN

      The amount of the asset to withdraw.

    • Optional optionalAssetDetails: AssetDetails

      Optional asset details for EURO_TOKEN withdrawals.

    Returns Promise<TransactionSignature>

    A promise that resolves to the transaction signature of the withdrawal operation.

Generated using TypeDoc