advanced_trade library

Constants

coinbaseApiProduction → const String
coinbaseApiSandbox → const String

Functions

convertParamsToString(Map<String, dynamic> queryParameters) String?
Converts a map of query parameters to a string.
createLimitOrder({required String clientOrderId, required String productId, required String side, required String baseSize, required String limitPrice, bool postOnly = false, required Credential credential, bool isSandbox = false, Client? client}) Future<Map<String, dynamic>?>
Creates a limit order. GTC: Good Till Cancelled. Buy or sell a specified quantity of an Asset at a specified price. If posted, the Order will remain on the Order Book until canceled.
createMarketOrder({required String clientOrderId, required String productId, required String side, String? quoteSize, String? baseSize, required Credential credential, bool isSandbox = false, Client? client}) Future<Map<String, dynamic>?>
Creates a market order. IOC: Immediate or Cancel. Buy or sell a specified quantity of an Asset at the current best available market price.
createPortfolio({required String name, Client? client, required Credential credential, bool isSandbox = false}) Future<Portfolio?>
Creates a new portfolio.
deleteAuthorized(String endpoint, {Client? client, required Credential credential, bool isSandbox = false}) Future<Response>
Makes an authorized DELETE request to the Coinbase Advanced Trade API.
deletePortfolio({required String uuid, Client? client, required Credential credential, bool isSandbox = false}) Future<bool>
Deletes a portfolio.
editPortfolio({required String uuid, required String name, Client? client, required Credential credential, bool isSandbox = false}) Future<Portfolio?>
Edits a portfolio.
generateCoinbaseJwt(String keyName, String privateKeyPem, String uri) Future<String>
Generates a JWT for authenticating with the Coinbase API.
get(String endpoint, {Map<String, dynamic>? queryParameters, Client? client, bool isSandbox = false}) Future<Response>
Makes a GET request to the Coinbase Advanced Trade API.
getAccount({required String? uuid, Client? client, required Credential credential, bool isSandbox = false}) Future<Account?>
Gets a single account for the current user by UUID.
getAccountBalance({String? uuid, String? currency, Client? client, required Credential credential, bool isSandbox = false}) Future<double?>
Gets the balance of a single account for the current user.
getAccountByCurrency(String currency, {Client? client, required Credential credential, bool isSandbox = false}) Future<Account?>
Gets a single account for the current user by currency.
getAccounts({int? limit = 250, String? cursor, Client? client, required Credential credential, bool isSandbox = false}) Future<List<Account>>
Gets a list of accounts for the current user.
getAuthorized(String endpoint, {Map<String, dynamic>? queryParameters, Client? client, required Credential credential, bool isSandbox = false}) Future<Response>
Makes an authorized GET request to the Coinbase Advanced Trade API.
getFills({int? limit = 1000, String? orderId, String? productId, String? cursor, Client? client, required Credential credential, bool isSandbox = false}) Future<List<Fill>>
Gets a list of fills for the current user.
getKeyPermissions({Client? client, required Credential credential, bool isSandbox = false}) Future<KeyPermissions?>
Gets the key permissions.
getOrder({required String orderId, Client? client, required Credential credential, bool isSandbox = false}) Future<Order?>
Gets a single historical order for the current user by order ID.
getOrders({int? limit = 1000, String? cursor, Client? client, required Credential credential, bool isSandbox = false}) Future<List<Order>>
Gets a list of historical orders for the current user.
getPortfolioBreakdown({required String uuid, Client? client, required Credential credential, bool isSandbox = false}) Future<PortfolioBreakdown?>
Gets the breakdown of a portfolio.
getProduct({required String productId, Client? client, bool isSandbox = false}) Future<Product?>
Gets a single product by product ID.
getProductAuthorized({required String? productId, bool? getTradabilityStatus, Client? client, required Credential credential, bool isSandbox = false}) Future<Product?>
Gets a single product by product ID.
getProductBook({required String productId, int? limit, Client? client, bool isSandbox = false}) Future<ProductBook?>
Gets a public product book.
getProductBookAuthorized({required String productId, int? limit, Client? client, required Credential credential, bool isSandbox = false}) Future<ProductBook?>
Gets a product book.
getProductCandles({required String productId, required String start, required String end, required String granularity, Client? client, bool isSandbox = false}) Future<List<Candle>>
Gets public product candles.
getProductCandlesAuthorized({required String productId, required String start, required String end, required String granularity, Client? client, required Credential credential, bool isSandbox = false}) Future<List<Candle>>
Gets product candles.
getProducts({int? limit, int? offset, String? productType, List<String>? productIds, String? contractExpiryType, Client? client, bool isSandbox = false}) Future<List<Product>>
Gets a list of products.
getProductsAuthorized({int? offset, String? productType, String? contractExpiryType, Client? client, required Credential credential, bool isSandbox = false}) Future<List<Product>>
Gets a list of products.
getServerTime({Client? client, bool isSandbox = false}) Future<ServerTime?>
Gets the current time from the Coinbase Advanced API.
getTrades({required String? productId, int? limit = 10, Client? client, required Credential credential, bool isSandbox = false}) Future<List<Trade>>
Gets a list of recent market trades for a single product.
getTransactionSummary({String? productType, String? contractExpiryType, String? productVenue, Client? client, required Credential credential, bool isSandbox = false}) Future<TransactionSummary?>
Gets the transaction summary.
listPortfolios({Client? client, required Credential credential, bool isSandbox = false}) Future<List<Portfolio>>
Gets a list of portfolios for the current user.
movePortfolioFunds({required Map<String, String> funds, required String sourcePortfolioUuid, required String targetPortfolioUuid, Client? client, required Credential credential, bool isSandbox = false}) Future<bool>
Moves funds between portfolios.
nullableDouble(Map<String, dynamic> jsonObject, String key, {bool? notNullable = false}) double?
Parses a double from a JSON object, returning null if the value is null or an empty string.
nullableNumber(Map<String, dynamic> jsonObject, String key, {bool? notNullable = false}) num?
Parses a number from a JSON object, returning null if the value is null or an empty string.
postAuthorized(String endpoint, {String? body, Client? client, required Credential credential, bool isSandbox = false}) Future<Response>
Makes an authorized POST request to the Coinbase Advanced Trade API.
putAuthorized(String endpoint, {String? body, Client? client, required Credential credential, bool isSandbox = false}) Future<Response>
Makes an authorized PUT request to the Coinbase Advanced Trade API.