Factory Methods
Factory methods of Azoth SDK for creating instances and getting network information
AzothSDK.create()
AzothSDK.create()
Creates a new instance of the Azoth SDK.
static create(
provider: ethers.Provider | ethers.Signer,
network: NetworkName = 'polygon',
tokenSymbol: TokenSymbol = 'USDT',
contractVersion?: string
): AzothSDK
Parameters:
provider
: An ethers.js Provider or Signer instancenetwork
(optional): Blockchain network to use (default: 'polygon')tokenSymbol
(optional): Stablecoin to use (default: 'USDT')contractVersion
(optional): Specific contract version to use (defaults to the latest version for the selected network)
Returns:
A new
AzothSDK
instanceExample:
const provider = new ethers.JsonRpcProvider('https://polygon-rpc.com');
const azoth = AzothSDK.create(provider, 'polygon', 'USDT');
AzothSDK.getAvailableNetworks()
AzothSDK.getAvailableNetworks()
Returns a list of all networks supported by the SDK.
static getAvailableNetworks(): NetworkName[]
Returns:
Array of network names
Example:
const networks = AzothSDK.getAvailableNetworks();
console.log(networks); // ['polygon', 'bsc', 'avalanche', ...]
AzothSDK.getAvailableTokens()
AzothSDK.getAvailableTokens()
Returns a list of tokens available for a specific network.
static getAvailableTokens(network: NetworkName): TokenSymbol[]
Parameters:
network
: The network to check for available tokens
Returns:
Array of token symbols available on the specified network
Example:
const tokens = AzothSDK.getAvailableTokens('polygon');
console.log(tokens); // ['USDT', 'USDC']
Last updated