Options
All
  • Public
  • Public/Protected
  • All
Menu

Class XuperSDK

Hierarchy

  • XuperSDK

Implements

Index

Constructors

constructor

Properties

Private Optional account

account: AccountModel

Private accountInstance

accountInstance: Account

Private contractInstance

contractInstance: Contract

Private options

options: Options

Private plugins

plugins: Plugin[]

Private transactionInstance

transactionInstance: Transaction

Static instance

instance: XuperSDK

Methods

checkAddress

  • checkAddress(address?: undefined | string): boolean

checkMnemonic

  • checkMnemonic(mnemonic: string, language: Language): boolean

checkStatus

  • checkStatus(): Promise<any>

create

createContractAccount

  • createContractAccount(contractAccountName: number, address?: undefined | string): Promise<any>
  • Parameters

    • contractAccountName: number
    • Optional address: undefined | string

    Returns Promise<any>

deploySolidityContract

  • deploySolidityContract(contractAccount: string, contractName: string, bin: string, abi: string, lang: string, initArgs: any, upgrade?: boolean, account?: AccountModel): Promise<any>

deployWasmContract

  • deployWasmContract(contractAccount: string, contractName: string, code: string, lang: string, initArgs: any, upgrade?: boolean, account?: AccountModel): Promise<any>

export

  • export(password: string): string

getBalance

  • getBalance(address?: undefined | string): Promise<any>

getBalanceDetail

  • getBalanceDetail(address?: undefined | string): Promise<any>

getBlockByHeight

  • getBlockByHeight(height: string): Promise<any>
  • Parameters

    • height: string

    Returns Promise<any>

getBlockById

  • getBlockById(blockid: string): Promise<any>
  • Parameters

    • blockid: string

    Returns Promise<any>

getBlockChains

  • getBlockChains(): Promise<any>

getContractAccounts

  • getContractAccounts(address?: undefined | string): Promise<any>

getContracts

  • getContracts(target: string): Promise<any>

import

  • import(password: string, privateKeyStr: string, cache?: boolean): AccountModel

invoke

invokeContarct

  • invokeContarct(contractName: string, methodName: string, moduleName: string, args: any, amount?: string, account?: AccountModel): Promise<any>
  • Parameters

    • contractName: string
    • methodName: string
    • moduleName: string
    • args: any
    • Default value amount: string = "0"
    • Optional account: AccountModel

    Returns Promise<any>

invokeSolidityContarct

  • invokeSolidityContarct(contractName: string, methodName: string, moduleName: string, args: any, amount?: string, account?: AccountModel): Promise<any>
  • Parameters

    • contractName: string
    • methodName: string
    • moduleName: string
    • args: any
    • Default value amount: string = "0"
    • Optional account: AccountModel

    Returns Promise<any>

postTransaction

queryACL

  • queryACL(contractAccount: string, contractInfo?: ContractInfo): Promise<any>

queryContractStatData

  • queryContractStatData(): Promise<any>

queryTransaction

  • queryTransaction(txid: string): Promise<any>

retrieve

  • Parameters

    • mnemonic: string
    • Default value language: Language = Language.SimplifiedChinese
    • Default value cryptography: Cryptography = Cryptography.EccFIPS
    • Default value cache: boolean = false

    Returns AccountModel

transactionIdToHex

  • transactionIdToHex(t: Required<string>): string

transfer

Static getInstance