0.12.14 • Published 10 days ago

alphadex-sdk-js v0.12.14

Weekly downloads
-
License
ISC
Repository
-
Last release
10 days ago

alphadex-sdk-js (AlphaDEX Javascript SDK)

alphadex-sdk-js is a typescript/javascript package to help developers integrate effortlessly with the AlphaDEX decentralised exchange on Radix DLT

It provides developers with easy access to the live data on the AlphaDEX exchange as well as a number of convenience functions and classes/types for working with the exchange.

Interesting note: alphadex-sdk-js connects to the AlphaDEX Websocket server to provide the live data feed without any intervention needed from the developer.

Installation

Node.js and NPM

You will need node.js and npm (node package manager) installed on your machine in order to add alphadex-sdk-js to your project. If you do not yet have it installed, you can find instructions to do so here

Add alphadex-sdk-js to your project

To add alphadex-sdk-js to your project, run the following command from the root directory of your project:

npm install --save alphadex-sdk-js

Updating the SDK

Update to latest patch (non-breaking changes)

To update the SDK for any new changes that are non-breaking (either bug fixes or feature additions), you can run the following command in your project directory:

npm update alphadex-sdk-js

Update to latest version (including breaking changes)

To update the SDK to the very latest version (which might include breaking changes), you can run the following command in your project directory:

npm install --save alphadex-sdk-js@latest

Usage

Import required variables and functions

To use alphadex-sdk-js in your project, you need to import at least the init function and the clientState object. You will need to import and run the init function in the first file that executes (e.g. index.js).

For ease of use it is suggested to import all the alphadex-sdk-js functions and variables as one combined reference (e.g. adex, but you can choose any name). This has the benefit that it clearly distinguishes the AlphaDEX SDK functions from your app's own native functions and will provide auto-complete functionality in your editor to help you choose the appropraite function.

Example: Import all AlphaDEX SDK functions and variables as one reference called adex.

import * as adex from "alphadex-sdk-js";

Alternatively you can import each function and variable individually.

Example: Import functions and variables individually.

import { init, clientState } from "alphadex-sdk-js";

Initialize the AlphaDEX SDK

In order to connect the AlphaDEX SDK to the live data on the AlphaDEX exchange you need to run the init function in the root file of your project (e.g. index.js). This function will connect to the AlphaDEX websocket server and ensure that the sdk variables are kept in sync with the live data on the exchange.

Example: Run the init function to initialize the sdk connection with the AlphaDEX exchange (using combined import as adex).

// import all the sdk functions and variables as adex
import * as adex from "alphadex-sdk-js";
...
// run the sdk init function to establish a live connection with the exchange
adex.init();

// use the variables with the live data in your program/app
let adexState = adex.clientState;
console.log("Status of the alphadex sdk connection: "+adexState.status);

Example: Run the init function to initialize the sdk connection with the AlphaDEX exchange (using individual imports).

// import init function and clientState variable individually
import { clientState, init } from "alphadex-sdk-js";
...
// run the sdk init function to establish a live connection with the exchange
init();

// use the variables with the live data in your program/app
let adexState = clientState;
console.log("Status of the alphadex sdk connection: "+adexState.status);

Using variables in alphadex-sdk-js

alphadex-sdk-js gives the developer access to a number of variables that are constantly updated to reflect the latest state of the AlphaDEX exchange.

All variables have a static and observable version (indicated by a $ at the end of the variable name).

Example: static and observable version of a variable

let staticStatus = adex.clientState.status;
let observableStatus = adex.clientState.status$;

All these variables are provided in one object called clientState.

clientState object

The clientState object holds all variables that reflect the live state of the AlphaDEX exchange. This object must be initialized by calling the init function.

Example: Calling the init function to initialize the clientState object and assigning the clientState object to a local variable myAdexState.

import * as adex from "alphadex-sdk-js";

// call the init function to connect to the AlphaDEX exchange
// and initialize the clientState object
adex.init();

// assign the clientState object to a local variable
let myAdexState = adex.clientState;

Variables

All the variables below are accessed as fields of the clientState object.

Example: How to access a variable.

// Accessing the status variable
let connectionStatus = adex.clientState.status

Read + Write Variables

These variables can be changed by the user. When the variables are changed they will automatically cause all related variables to update automatically.

VariableTypeDescriptionAccess
alphadexApiServerUrl($)stringThe URL of the Api/Websocket server that the SDK is connected to.Read + Write
currentCandlePeriod($)stringThe currently selected candle period. Candle data is used for candlestick charts. This variable can be changed by the user, but must be one of the valid values specified in CandlePeriods.Read + Write
currentPairAddress($)stringThe on-ledger component address of the currently selected AlphaDEX pair. alphadex-sdk-js will provide live updated details of various variables associated with the currently selected pair. The user can change this variable to another pair address and all the variables associated with the current pair will automatically update for the new pair.Read + Write
getAllPairsMarketData($)booleanFlag that indicates whether the market data for all pairs on AlphaDEX should be kept updated. Be aware that when this flag is true it could use a lot of bandwith. It is suggested to only set it to true when required.Read + Write
stateChangeFrequencynumberThe number of milliseconds between state change emits from the stateChanged$ observable variable. Setting this value to 0, will effectively mean that all state changes are emitted individually. The default for this variable is 500 i.e. the stateChanged$ observable will emit the latest state every half second.Read + Write

Read Only Variables

VariableTypeDescriptionAccess
stateChanged$Observable \<StaticState>Observable that gets emitted every time one of the AlphaDEX variables change. This observable is useful for applications that need to manually update their state variables. It emits a StaticState object that contains read-only versions of the AlphaDEX variables (similar to the clientState object, but no variables can be changed).Read Only
alphadexAddress($)stringThe on-ledger component address of the AlphaDEX exchange component.Read Only
adminBadgeAddress($)stringThe on-ledger resource address of the AlphaDEX Admin badge. AlphaDEX Admin badges are used to identify accounts that have admin permissions on the AlphaDEX exchange.Read Only
maxPlatformFee($)numberThe maximum fee that platforms/apps can specify as their platform fee (expressed in decimals). E.g. alphadexMaxPlatformFee = 0.001 (0.1%)Read Only
currentPairCandlesList($)Array of CandleA sorted list of the candle (open, close, high, low) history for the currently selected AlphaDEX pair using the candle period specified by the currentCandlePeriod variable.Read Only
currentPairInfo($)PairInfoBasic information about the currently selected AlphaDEX pair. This variable will automatically update when currentPairAddress is changed.Read Only
currentPairOrderbook($)OrderbookOrderbook information about the currently selected AlphaDEX pair. This variable will automatically update when currentPairAddress is changed.Read Only
currentPairTrades($)Array of TradeList of most recent trades for the currently selected AlphaDEX pair. The number of trades in the list is determined by the value of the maxTrades variable. This variable will automatically update when currentPairAddress is changed.Read Only
epochsPerPeriod($)numberThe number of epochs between AlphaDEX pairs checking to see if they need to update their liquidity fee.Read Only
allowRecallableTokens($)booleanIndicates whether recallable tokens are allowed in new pairs on the exchangeRead Only
allowFreezableTokens($)booleanIndicates whether freezable tokens are allowed in new pairs on the exchangeRead Only
exchangeFee($)numberThe portion of the fee due to the AlphaDEX exchange on every trade (expressed in decimals). E.g. alphadexExchangeFee = 0.0005 (0.05%)Read Only
newPairFee($)numberThe cost in XRD to create a new pair on AlphaDEX.Read Only
pairsList($)Array of PairInfoAn array/list of all the pairs listed on the AlphaDEX exchange. The list is not sorted in any particular order.Read Only
pairsMap($)Map\<string, PairInfo>A map of all the pairs listed on the AlphaDEX exchange, indexed by the pair's on-ledger component address.Read Only
platformBadgeAddress($)stringThe on-ledger resource address of the AlphaDEX Platform badge. AlphaDEX Platform badges are issued to platforms/apps that will submit orders to the AlphaDEX exchange. Each badge holds information about the platform and the platform fee for submitting orders.Read Only
priceMaxDecimals($)numberThe maximum number of decimal digits allowed in any AlphaDEX price.Read Only
priceSignificantDigits($)numberThe number of significant digits to allow in an AlphaDEX price.Read Only
status($)ClientStatusShows the status of the connection with the AlphaDEX exchange. Can be one of 3 values: "LOADING", "READY", "OFFLINE"Read Only
tokensList($)Array of TokenInfoAn array/list of all the tokens listed on the AlphaDEX exchange. The list is not sorted in any particular order.Read Only
tokensMap($)Map\<string, TokenInfo>A map of all the tokens listed on the AlphaDEX exchange, indexed by the token's on-ledger resource address.Read Only
xrdAddress($)stringThe on-ledger resource address of the XRD (Radix) token. This address is used to uniquely identify the XRD token.Read Only

Functions List

Setup Functions

Functions to initialize and destroy the SDK connection to the AlphaDEX exchange. | Function Name | Description | | ----------------------------------------------------- | --------------------------------------------------------------------------------------------------- | | init | Connects SDK to AlphaDEX exchange and initializes the clientState object. | | destroy | Stops SDK connection with AlphaDEX exchange and resets clientState object. |

Create Transaction Functions

Functions that create a transaction manifest that can be submitted to a user wallet for signing. | Function Name | Description | | ----------------------------------------------------------------------------------- | ----------- | | createCancelOrderTx | Create a transaction manifest for cancelling an exchange order. | | createExchangeOrderTx | Create a transaction manifest for an exchange order. | | createNewPlatformBadgeTx | Create a transaction manifest to create a new platform badge. | | createChangePlatformFeeTx | Create a transaction manifest to change the fee of a platform badge. | | createChangePlatformNameTx | Create a transaction manifest to change the name of a platform badge. | | createNewPairTx | Create a transaction manifest to create a new pair. | | createSwapTx | Create a transaction manifest for a swap. |

Submit Transaction Functions

Functions that submit a transaction directly to the user wallet for signing.

Function NameDescription
submitCancelOrderTransaction to cancel an exchange order.
submitExchangeOrderTransaction to create a new exchange order.
submitNewPlatformBadgeTxTransaction to create a new platform badge.
submitChangePlatformFeeTxTransaction to change the fee of a new platform badge.
submitChangePlatformNameTxTransaction to change the name of a new platform badge.
submitNewPairTxTransaction to create a new pair
submitSwapTransaction to submit a new swap
submitTransactionUtility function to submit any transaction manifest to the user wallet

Get Data Functions

Functions that fetch AlphaDEX related data from a specific account or set of accounts or the ledger.

Function NameDescription
getAccountOrdersGets all order receipts in the specified account
getPairOrdersGets specified order receipts for the specified pair
getPlatformBadgesGets all platform badges in the specified accounts
getPlatformBadgeInfoGets platform badge info for a specified platform id

Get Quotes Functions

Functions that provide an estimated quote of tokens received and exchange costs for a planned order/swap. Useful to show a user the estimated outcome of an order/swap.

Function NameDescription
getExchangeOrderQuoteEstimated quote for an exchange order
getSwapQuoteEstimated quote for a swap

Functions Details

init() async function(#functions-list)

Function that connects the SDK to the AlphaDEX exchange websocket server and initializes the clientState object.

Parameters:

ParameterDescriptionTypeExample
alphadexApiNetwork (optional)The type of AlphaDEX api/websocket server the SDK must connect to. If not specified it will use "mainnet".ApiNetwork"mainnet"
alphadexApiVersion (optional)The version of the alphadex API to use. If not specified it will use "v0". "v0" is the only current API version available.string"v0"

Returns: Promise of SDKResult

Successful SDKResult data field : nothing


destroy() (back to Functions List)

Function that disconnects the SDK from the AlphaDEX exchange websocket server and clears the clientState object.

It is suggested to call this function when a live connection to the AlphaDEX exchange is no longer needed or when the user exits your app.

Parameters: None

Returns: Nothing


getExchangeOrderQuote() async function(#functions-list)

Function that returns an estimated quote for a new AlphaDEX exchange order.

Parameters:

ParameterDescriptionTypeExample
pairAddressThe on-ledger component address of the AlphaDEX pair for this order.string"component_7t45r624hjfguyfr"
orderTypeThe type of order. Valid values = "LIMIT", "POST-ONLY", "MARKET".OrderType or stringOrderType.LIMIT or "LIMIT"
sideThe side for the order. Valid values = "BUY", "SELL".OrderSide or stringOrderSide.BUY or "BUY"
tokenAddressThe on-ledger resource address of the specified token for the order.string"resource_634gafe55ey8674j"
amountThe amount of the token to process in the ordernumber12.54
platformIdThe platform id for the order. Specified in decimalsnumber0.001
price(ignored if set to -1) The price limit to apply for the order. Either price or slippage must be specified.number4.657
slippage(ignored if set to -1) The amount of price slippage that can be tolerated for the order, specified in decimals. Either price or slippage must be specified.number0.05

Returns: Promise of SDKResult

Successful SDKResult data field : Quote (Estimated outcome of the specified exchange transaction)


createExchangeOrderTx() async function(#functions-list)

Function to create a transaction manifest for creating a new AlphaDEX exchange order.

Parameters:

ParameterDescriptionTypeExample
pairAddressThe on-ledger component address of the AlphaDEX pair for this order.string"component_7t45r624hjfguyfr"
orderTypeThe type of order. Valid values = "LIMIT", "POST-ONLY", "MARKET".OrderType or stringOrderType.LIMIT or "LIMIT"
sideThe side for the order. Valid values = "BUY", "SELL".OrderSide or stringOrderSide.BUY or "BUY"
tokenAddressThe on-ledger resource address of the specified token for the order.string"resource_634gafe55ey8674j"
amountThe amount of the token to process in the ordernumber12.54
price(ignored if orderType = "MARKET", set to -1) The price at which to submit the order.number4.657
slippage(ignored if orderType <> "MARKET", set to -1) The amount of price slippage that can be tolerated for the order, specified in decimals.number-1
platformBadgeIdThe platform badge id that should be used to determine the platform fee for the order.number564
submitAccountAddressThe on-ledger address of the account that will sign this transactionstringaccount_763gd872dg23
settleAccountAddressThe on-ledger address of the account that the order will settle to. If "", unmatched order tokens will need to be claimed later using the order receipt.stringaccount_763gd872dg23

Returns: Promise of SDKResult

Successful SDKResult data field : string (The transaction manifest to be submitted by the user)


submitExchangeOrder() async function(#functions-list)

Function to submit a new AlphaDEX exchange order.

It will create the required transaction manifest and submit to the user's wallet for signing. After the transaction the user should see a new order receipt in their wallet with the details of the order as well as any changes in tokens as a result of the order.

Parameters:

ParameterDescriptionTypeExample
pairAddressThe on-ledger component address of the AlphaDEX pair for this order.string"component_7t45r624hjfguyfr"
orderTypeThe type of order. Valid values = "LIMIT", "POST-ONLY", "MARKET".OrderType or stringOrderType.LIMIT or "LIMIT"
sideThe side for the order. Valid values = "BUY", "SELL".OrderSide or stringOrderSide.BUY or "BUY"
tokenAddressThe on-ledger resource address of the specified token for the order.string"resource_634gafe55ey8674j"
amountThe amount of the token to process in the ordernumber12.54
price(ignored if orderType = "MARKET", set to -1) The price at which to submit the order.number4.657
slippage(ignored if orderType <> "MARKET", set to -1) The amount of price slippage that can be tolerated for the order, specified in decimals.number-1
platformBadgeIdThe platform badge id that should be used to determine the platform fee for the order.number564
submitAccountAddressThe on-ledger address of the account that will sign this transactionstringaccount_763gd872dg23
settleAccountAddressThe on-ledger address of the account that the order will settle to. If "", unmatched order tokens will need to be claimed later using the order receipt.string"" or account_763gd872dg23
rdtA reference to the Radix Dapp Toolkit that has been initialised in your app. See the appropriate documentation to use the Radix Wallet in your app here.

Returns: Promise of SDKResult

Successful SDKResult data field : object (The transaction detail object returned by the Radix Gateway API)


createCancelOrderTx() async function(#functions-list)

Function to create a transaction manifest for cancelling an AlphaDEX exchange order.

Parameters:

ParameterDescriptionTypeExample
pairAddressThe on-ledger component address of the AlphaDEX pair that the order belongs to.stringcomponent_u6erf78egfq4fqd
orderIdThe id of the order to cancel.number5
accountAddressThe on-ledger address of the account that will sign this transactionstringaccount_763gd872dg23

Returns: Promise of SDKResult

Successful SDKResult data field : string (The transaction manifest to be submitted by the user)


submitCancelOrder() async function(#functions-list)

Function to cancel an AlphaDEX exchange order.

It will create the required transaction manifest and submit to the user's wallet for signing. After the transaction the user might see any unallocated tokens returned to their wallet and the order receipt should have a status of "CANCELLED".

Parameters:

ParameterDescriptionTypeExample
pairAddressThe on-ledger component address of the pair that the order to be cancelled belongs to.stringresource_u6erf78egfq4fqd
orderIdThe id fo the order to be cancelled.number5
accountAddressThe on-ledger address of the account that will sign this transactionstringaccount_763gd872dg23
rdtA reference to the Radix Dapp Toolkit that has been initialised in your app. See the appropriate documentation to use the Radix Wallet in your app here.

Returns: Promise of SDKResult

Successful SDKResult data field : object (The transaction detail object returned by the Radix Gateway API)


getSwapQuote() async function(#functions-list)

Function that returns an estimated quote for a new AlphaDEX swap.

Parameters:

ParameterDescriptionTypeExample
fromTokenAddressThe on-ledger resource address of the token to swap from.stringresource_u6erf78egfq4fqd
fromTokenAmountThe amount of the token to swapnumber5.43
toTokenAddressThe on-ledger resource address of the token to swap to.stringresource_jgefw6dgw4fjw3s
maxSlippageThe maximum price slippage to allow in the swap specified in decimalsnumber0.05
platformIdThe platform id that should be used to determine the platform fee for the swap.number12

Returns: Promise of SDKResult

Successful SDKResult data field : string (The transaction manifest to be submitted by the user)

createSwapTx() async function(#functions-list)

Function to create a transaction manifest for creating a new AlphaDEX swap order.

Parameters:

ParameterDescriptionTypeExample
fromTokenAddressThe on-ledger resource address of the token to swap from.stringresource_u6erf78egfq4fqd
fromTokenAmountThe amount of the token to swapnumber5.43
toTokenAddressThe on-ledger resource address of the token to swap to.stringresource_jgefw6dgw4fjw3s
maxSlippageThe maximum price slippage to allow in the swap specified in decimalsnumber5.43
platformIdThe platform id that should be used to determine the platform fee for the swap.number12
accountAddressThe on-ledger address of the account that will sign this transactionstringaccount_763gd872dg23

Returns: Promise of SDKResult

Successful SDKResult data field : string (The transaction manifest to be submitted by the user)


submitSwap() async function(#functions-list)

Function to submit a new AlphaDEX swap order.

It will create the required transaction manifest and submit to the user's wallet for signing. After the transaction the user should see a new order receipt in their wallet with the details of the order as well as any changes in tokens as a result of the order.

Parameters:

ParameterDescriptionTypeExample
fromTokenAddressThe on-ledger resource address of the token to swap from.stringresource_u6erf78egfq4fqd
fromTokenAmountThe amount of the token to swapnumber5.43
toTokenAddressThe on-ledger resource address of the token to swap to.stringresource_jgefw6dgw4fjw3s
maxSlippageThe maximum price slippage to allow in the swap specified in decimalsnumber5.43
platformIdThe platform id that should be used to determine the platform fee for the swap.number12
accountAddressThe on-ledger address of the account that will sign this transactionstringaccount_763gd872dg23
rdtA reference to the Radix Dapp Toolkit that has been initialised in your app. See the appropriate documentation to use the Radix Wallet in your app here.

Returns: Promise of SDKResult

Successful SDKResult data field : object (The transaction detail object returned by the Radix Gateway API)


createNewPairTx() async function(#functions-list)

Function to create a transaction manifest for creating a new AlphaDEX Pair.

Parameters:

ParameterDescriptionTypeExample
token1AddressThe on-ledger resource address of the first token in the pairstringresource_u6erf78egfq4fqd
token1AddressThe on-ledger resource address of the second token in the pairstringresource_u6erf78egfq4fqd
estimatedPriceThe estimated price of the pair in decimals. The price should be specified as the number of token2 you can get for 1 token1.number9.57
platformBadgeIdThe platform badge id of the platform through which this transaction is submittednumber12
accountAddressThe on-ledger address of the account that will sign this transactionstringaccount_763gd872dg23

Returns: Promise of SDKResult

Successful SDKResult data field : string (The transaction manifest to be submitted by the user)


submitNewPairTx() async function(#functions-list)

Function for creating a new AlphaDEX pair. It will create the required transaction manifest and submit to the user's wallet for signing. Note that there is a cost of 500XRD to create a new pair.

Parameters:

ParameterDescriptionTypeExample
token1AddressThe on-ledger resource address of the first token in the pairstringresource_u6erf78egfq4fqd
token1AddressThe on-ledger resource address of the second token in the pairstringresource_u6erf78egfq4fqd
estimatedPriceThe estimated price of the pair in decimals. The price should be specified as the number of token2 you can get for 1 token1.number9.57
platformBadgeIdThe platform badge id of the platform through which this transaction is submittednumber12
accountAddressThe on-ledger address of the account that will sign this transactionstringaccount_763gd872dg23
rdtA reference to the Radix Dapp Toolkit that has been initialised in your app. See the appropriate documentation to use the Radix Wallet in your app here.

Returns: Promise of SDKResult

Successful SDKResult data field : object (The transaction detail object returned by the Radix Gateway API)


createNewPlatformBadgeTx() async function(#functions-list)

Function to create a transaction manifest for creating a new AlphaDEX Platform Badge.

Parameters:

ParameterDescriptionTypeExample
nameThe name of the platform/app that will own the badge. Note that it is possible for a single platform to have multiple badges with different fees. It is therefore suggested that this name is consistent across platform badges for the same platform.string"My Cool App"
feeThe fee that is associated with this badge expressed in decimals. This value cannot be higher than the value specified in the alphadexMaxPlatformFee variable.number0.001
accountAddressThe on-ledger address of the account that will sign this transactionstringaccount_763gd872dg23

Returns: Promise of SDKResult

Successful SDKResult data field : string (The transaction manifest to be submitted by the user)


submitNewPlatformBadgeTx() async function(#functions-list)

Function for creating a new AlphaDEX Platform Badge. It will create the required transaction manifest and submit to the user's wallet for signing. After the transaction the user should see the new platform badge in their wallet.

Parameters:

ParameterDescriptionTypeExample
nameThe name of the platform/app that will own the badge. Note that it is possible for a single platform to have multiple badges with different fees. It is therefore suggested that this name is consistent across platform badges for the same platform.string"My Cool App"
feeThe fee that is associated with this badge expressed in decimals. This value cannot be higher than the value specified in the alphadexMaxPlatformFee variable.number0.001
accountAddressThe on-ledger address of the account that will sign this transactionstringaccount_763gd872dg23
rdtA reference to the Radix Dapp Toolkit that has been initialised in your app. See the appropriate documentation to use the Radix Wallet in your app here.

Returns: Promise of SDKResult

Successful SDKResult data field : object (The transaction detail object returned by the Radix Gateway API)


createChangePlatformFeeTx() async function(#functions-list)

Function to create a transaction manifest for changing the fee on an AlphaDEX Platform Badge.

Parameters:

ParameterDescriptionTypeExample
platformIdThe id of the platform badge for which to change the feenumber3
newFeeThe new fee for the specified badge expressed in decimals. This value cannot be higher than the value specified in the alphadexMaxPlatformFee variable.number0.001
accountAddressThe on-ledger address of the account that holds the specified platform badge and that will sign this transactionstringaccount_763gd872dg23

Returns: Promise of SDKResult

Successful SDKResult data field : string (The transaction manifest to be submitted by the user)


submitChangePlatformFeeTx() async function(#functions-list)

Function for changing the fee on an AlphaDEX Platform Badge. It will create the required transaction manifest and submit to the user's wallet for signing. After the transaction the user should see the new fee reflected in the data of the platform badge.

Parameters:

ParameterDescriptionTypeExample
platformIdThe id of the platform badge for which to change the fee.number3
newFeeThe new fee for the specified badge expressed in decimals. This value cannot be higher than the value specified in the alphadexMaxPlatformFee variable.number0.001
accountAddressThe on-ledger address of the account that holds the specified platform badge and that will sign this transactionstringaccount_763gd872dg23
rdtA reference to the Radix Dapp Toolkit that has been initialised in your app. See the appropriate documentation to use the Radix Wallet in your app here.

Returns: Promise of SDKResult

Successful SDKResult data field : object (The transaction detail object returned by the Radix Gateway API)


createChangePlatformNameTx() async function(#functions-list)

Function to create a transaction manifest for changing the platform name on an AlphaDEX Platform Badge.

Parameters:

ParameterDescriptionTypeExample
platformIdThe id of the platform badge for which to change the platform namenumber3
newNameThe new platform name for the specified badge.string"New Platform"
accountAddressThe on-ledger address of the account that holds the specified platform badge and that will sign this transactionstringaccount_763gd872dg23

Returns: Promise of SDKResult

Successful SDKResult data field : string (The transaction manifest to be submitted by the user)


submitChangePlatformNameTx() async function(#functions-list)

Function for changing the platform name on an AlphaDEX Platform Badge. It will create the required transaction manifest and submit to the user's wallet for signing. After the transaction the user should see the new platform name reflected in the data of the platform badge.

Parameters:

ParameterDescriptionTypeExample
platformIdThe id of the platform badge for which to change the fee.number3
newNameThe new platform name for the specified badge.string"New Platform"
accountAddressThe on-ledger address of the account that holds the specified platform badge and that will sign this transactionstringaccount_763gd872dg23
rdtA reference to the Radix Dapp Toolkit that has been initialised in your app. See the appropriate documentation to use the Radix Wallet in your app here.

Returns: Promise of SDKResult

Successful SDKResult data field : object (The transaction detail object returned by the Radix Gateway API)


getAccountOrders() async function(#functions-list)

Function to fetch AlphaDEX orders for a specifc pair from an account.

Parameters:

ParameterDescriptionTypeExample
accountAddressThe on-ledger
0.12.14

10 days ago

0.12.11

2 months ago

0.12.12

2 months ago

0.12.13

2 months ago

0.12.10

2 months ago

0.12.9

3 months ago

0.12.8

4 months ago

0.12.7

5 months ago

0.11.0

8 months ago

0.11.1

7 months ago

0.11.2

7 months ago

0.11.3

7 months ago

0.11.4

7 months ago

0.11.5

7 months ago

0.11.6

7 months ago

0.9.0

8 months ago

0.7.2

9 months ago

0.5.4

10 months ago

0.7.1

9 months ago

0.5.3

10 months ago

0.7.4

9 months ago

0.5.6

10 months ago

0.7.3

9 months ago

0.5.5

10 months ago

0.7.0

9 months ago

0.10.1

8 months ago

0.12.0

6 months ago

0.12.1

6 months ago

0.12.2

6 months ago

0.12.3

6 months ago

0.12.4

6 months ago

0.12.5

6 months ago

0.12.6

6 months ago

0.10.0

8 months ago

0.8.1

8 months ago

0.8.0

9 months ago

0.8.3

8 months ago

0.8.2

8 months ago

0.5.2

10 months ago

0.5.0

11 months ago

0.5.1

11 months ago

0.4.7

11 months ago

0.4.5

12 months ago

0.4.4

1 year ago

0.4.6

12 months ago

0.3.6

1 year ago

0.3.5

1 year ago

0.3.8

1 year ago

0.3.7

1 year ago

0.3.4

1 year ago

0.3.9

1 year ago

0.3.12

1 year ago

0.3.11

1 year ago

0.3.10

1 year ago

0.4.1

1 year ago

0.4.0

1 year ago

0.4.3

1 year ago

0.4.2

1 year ago

0.1.34

1 year ago

0.3.0

1 year ago

0.2.0

1 year ago

0.3.2

1 year ago

0.3.1

1 year ago

0.3.3

1 year ago

0.1.30

1 year ago

0.1.32

1 year ago

0.1.10

1 year ago

0.1.33

1 year ago

0.1.11

1 year ago

0.1.12

1 year ago

0.1.13

1 year ago

0.1.15

1 year ago

0.1.27

1 year ago

0.1.29

1 year ago

0.1.20

1 year ago

0.1.21

1 year ago

0.1.22

1 year ago

0.1.24

1 year ago

0.1.25

1 year ago

0.1.2

1 year ago

0.1.16

1 year ago

0.1.8

1 year ago

0.1.17

1 year ago

0.1.7

1 year ago

0.1.18

1 year ago

0.1.19

1 year ago

0.1.9

1 year ago

0.1.3

1 year ago

0.1.6

1 year ago

0.1.5

1 year ago

0.1.1

1 year ago

0.1.0

1 year ago