Documentation for functions available for FTX through the PENDAX SDK
Due to recent events related to FTX.com - We have decided to stop the development and documentation of FTX capabilities. They will remain in the PENDAX SDK for documentation purposes only. Please use all FTX functions and integrations with caution. Current events may result in failure of FTX servers to respond.
Create an Exchange Object
Before you can interact with PENDAX functions, you must first create an Exchange object with which to use when using PENDAX. You can create one or multiple, and reference them together or individually throughout your code.
Once an Exchange object has been created you may use any of the available functions allowed by that exchange by referencing the name of the Exchange object you created.
Example using multiple Exchange Objects for executing PENDAX functions:
This function takes in an options object. Optional and required parameters are listed below.
Required Parameters:
nickname: "mySubaccount"
Available Parameters:
nickname: "mySubaccount"
Example Usage:
async function deleteSubaccount() {
myFtxAccount.deleteSubaccount({
nickname: "myUnwantedSubaccount",
});
}
Get Subaccount Balances
getSubaccountBalances(options)
This function takes in an options object. Optional and required parameters are listed below.
Required Parameters:
nickname: "my subaccount"
Available Parameters:
nickname: "my subaccount"
Example Usage:
async function getSubaccountBalances(options) {
try {
let result = await myFtxAccount.getSubaccountBalances(options);
console.log(result.data.result);
} catch (error) {
console.log(error.message);
}
}
getSubaccountBalances({
nickname: "my subaccount"
});
Transfer Between Subaccounts
transferBetweenSubaccounts(options)
This function takes in an options object. Optional and required parameters are listed below.
Required Parameters:
"coin": "BTC",
"size": 10,
"source": null,
//null or "main" denotes the use of main account for source of funds. else supply the subaccount you want to transfer from
"destination": "sub1"
Available Parameters:
"coin": "BTC",
"size": 10,
"source": null,
//null or "main" denotes the use of main account for source of funds. else supply the subaccount you want to transfer from
"destination": "sub1"
Example Usage:
async function transferBetweenSubaccounts(options) {
try {
let result = await myFtxAccount.transferBetweenSubaccounts(options);
console.log(result.data.result);
} catch (error) {
console.log(error.message);
console.log(error.response.data.error);
}
}
transferBetweenSubaccounts({
"coin": "BTC",
"size": 10,
"source": null,
"destination": "sub1"
});