public class MetacoClientImpl extends Object implements MetacoClient
Modifier and Type | Field and Description |
---|---|
protected String |
metacoApiId |
protected String |
metacoApiKey |
protected String |
metacoApiUrl |
protected Boolean |
metacoTestingMode |
Constructor and Description |
---|
MetacoClientImpl(MetacoClientBuilder builder) |
Modifier and Type | Method and Description |
---|---|
TransactionBroadcastResult |
broadcastTransaction(RawTransaction rawTransaction)
Requires Authentication
Submit a signed transaction
You have to sign each of your inputs of the selected transaction (you will get those details when creating the transaction through Metaco)
Then encode the transaction in hexadecimal and send it here
|
void |
cancelOrder(String id)
Requires Authentication
Cancel the specified order
|
void |
confirmPhoneNumber(ValidateAccountRequest request)
Requires Authentication
Validate the authenticated account, throws an exception if there is an error
|
Order |
createOrder(NewOrder createOrder)
Requires Authentication
Create an order using the provided parameters
This order will be processed in our system
It will require your signature later when the trade state will be Signing
|
TransactionToSign |
createTransaction(NewTransaction newTransaction)
Requires Authentication
Create a Transaction using the provided parameters
|
AccountStatus |
getAccountStatus()
Requires Authentication
Return the details of an account (API Id, KYC Status and remaining trading amount)
|
Asset |
getAsset(String ticker)
Returns the selected Asset if it exists and its details
|
Asset[] |
getAssets()
Returns all the available Assets and their details
|
AssetsHistoryResult |
getAssetsHistory(HistoryCriteria criteria)
Returns the history for all the available assets according to the given criteria
|
AssetsHistoryResult |
getAssetsHistory(HistoryCriteria criteria,
List<String> tickers)
Returns the history for the provided assets according to the given criteria
Assets must be given using this format : USD,XAU,etc..
|
String |
getLatestDebugData()
For testing purposes only
On some requests, when you use the TestingMode of the client, you will get a DebugData, which will simplify the testing of the API and the client
As an example, a debugData could be the fake validationCode when your register an account.
|
Order |
getOrder(String id)
Requires Authentication
Returns the specified user's order
|
OrderResultPage |
getOrders()
Requires Authentication
Returns the user's orders, you will get the 500 first results
|
OrderResultPage |
getOrders(PageCriteria pageCriteria)
Requires Authentication
Returns the user's orders, according to the pageCriteria settings (the page size is limited to 500)
|
WalletDetails |
getWalletDetails(String address)
Requires Authentication
Returns the current wallet state
The transaction history is paginated, you will get the 500 first results
Contains the current balances, the values and the transaction history
|
WalletDetails |
getWalletDetails(String address,
PageCriteria pageCriteria)
Requires Authentication
Returns the current wallet state
The transaction history is paginated, you can choose your page using the pageCriteria parameter (the page size is limited to 500)
Contains the current balances, the values and the transaction history
|
AccountRegistrationResult |
registerAccount(RegisterAccountRequest request)
Register an account on Metaco
Sends an SMS to the provided phone number
If you are a wallet registering accounts for your clients, don't forget to set the provider_id with your Name/ID.
|
Order |
submitSignedOrder(String id,
RawTransaction rawTransaction)
Requires Authentication
Submit a signed order
You have to sign each of your inputs of the selected order (you will get those details by fetching the orders)
Then encode the transaction in hexadecimal and send it here
|
protected String metacoApiId
protected String metacoApiKey
protected String metacoApiUrl
protected Boolean metacoTestingMode
public MetacoClientImpl(MetacoClientBuilder builder)
public AccountRegistrationResult registerAccount(RegisterAccountRequest request) throws MetacoClientException
MetacoClient
registerAccount
in interface MetacoClient
MetacoClientException
public AccountStatus getAccountStatus() throws MetacoClientException
MetacoClient
getAccountStatus
in interface MetacoClient
MetacoClientException
public void confirmPhoneNumber(ValidateAccountRequest request) throws MetacoClientException
MetacoClient
confirmPhoneNumber
in interface MetacoClient
MetacoClientException
public Asset[] getAssets() throws MetacoClientException
MetacoClient
getAssets
in interface MetacoClient
MetacoClientException
public Asset getAsset(String ticker) throws MetacoClientException
MetacoClient
getAsset
in interface MetacoClient
MetacoClientException
public AssetsHistoryResult getAssetsHistory(HistoryCriteria criteria) throws MetacoClientException
MetacoClient
getAssetsHistory
in interface MetacoClient
MetacoClientException
public AssetsHistoryResult getAssetsHistory(HistoryCriteria criteria, List<String> tickers) throws MetacoClientException
MetacoClient
getAssetsHistory
in interface MetacoClient
MetacoClientException
public Order createOrder(NewOrder createOrder) throws MetacoClientException
MetacoClient
createOrder
in interface MetacoClient
MetacoClientException
public OrderResultPage getOrders() throws MetacoClientException
MetacoClient
getOrders
in interface MetacoClient
MetacoClientException
public OrderResultPage getOrders(PageCriteria pageCriteria) throws MetacoClientException
MetacoClient
getOrders
in interface MetacoClient
MetacoClientException
public Order getOrder(String id) throws MetacoClientException
MetacoClient
getOrder
in interface MetacoClient
MetacoClientException
public Order submitSignedOrder(String id, RawTransaction rawTransaction) throws MetacoClientException
MetacoClient
submitSignedOrder
in interface MetacoClient
MetacoClientException
public void cancelOrder(String id) throws MetacoClientException
MetacoClient
cancelOrder
in interface MetacoClient
MetacoClientException
public TransactionToSign createTransaction(NewTransaction newTransaction) throws MetacoClientException
MetacoClient
createTransaction
in interface MetacoClient
MetacoClientException
public TransactionBroadcastResult broadcastTransaction(RawTransaction rawTransaction) throws MetacoClientException
MetacoClient
broadcastTransaction
in interface MetacoClient
MetacoClientException
public WalletDetails getWalletDetails(String address) throws MetacoClientException
MetacoClient
getWalletDetails
in interface MetacoClient
MetacoClientException
public WalletDetails getWalletDetails(String address, PageCriteria pageCriteria) throws MetacoClientException
MetacoClient
getWalletDetails
in interface MetacoClient
MetacoClientException
public String getLatestDebugData()
MetacoClient
getLatestDebugData
in interface MetacoClient
Copyright © 2016 Metaco. All rights reserved.