@wasserstoff/tribes-sdk
Version:
SDK for integrating with Tribes by Astrix platform on any EVM compatible chain
82 lines (81 loc) • 2.69 kB
TypeScript
import { BaseModule } from '../core/BaseModule';
import { BalanceResponse, DepositParams, PlatformSpendParams, SpendWithSignatureParams, TokenInfo, UpdateOrganizationAdminParams, WithdrawParams } from '../types/token';
/**
* Module for managing Astrix tokens and the token dispenser
*/
export declare class TokenModule extends BaseModule {
/**
* Get the Astrix token contract
* @param useSigner Whether to use the signer
*/
private getAstrixTokenContract;
/**
* Get the token dispenser contract
* @param useSigner Whether to use the signer
*/
private getTokenDispenserContract;
/**
* Deposit Astrix tokens to the token dispenser
* @param params Deposit parameters
*/
deposit(params: DepositParams): Promise<string>;
/**
* Withdraw Astrix tokens from the token dispenser
* @param params Withdrawal parameters
*/
withdraw(params: WithdrawParams): Promise<string>;
/**
* Update the organization admin
* @param params Update parameters
*/
updateOrganizationAdmin(params: UpdateOrganizationAdminParams): Promise<string>;
/**
* Spend tokens with a signature
* @param params Spend parameters
*/
spendWithSignature(params: SpendWithSignatureParams): Promise<string>;
/**
* Platform spend tokens
* @param params Spend parameters
*/
platformSpend(params: PlatformSpendParams): Promise<string>;
/**
* Grant the spender role to an address
* @param spender Address to grant the role to
*/
grantSpenderRole(spender: string): Promise<string>;
/**
* Revoke the spender role from an address
* @param spender Address to revoke the role from
*/
revokeSpenderRole(spender: string): Promise<string>;
/**
* Get an organization's token balance
* @param organization Organization address
*/
getBalance(organization: string): Promise<BalanceResponse>;
/**
* Get the organization admin
* @param organization Organization address
*/
getOrganizationAdmin(organization: string): Promise<string>;
/**
* Get information about the Astrix token
*/
getTokenInfo(): Promise<TokenInfo>;
/**
* Check if an account has the minter role
* @param account Account to check
*/
isMinter(account: string): Promise<boolean>;
/**
* Check if an account has the burner role
* @param account Account to check
*/
isBurner(account: string): Promise<boolean>;
/**
* Get the token balance of an account
* @param account Account to check
*/
getTokenBalance(account: string): Promise<BalanceResponse>;
}