Options
All
  • Public
  • Public/Protected
  • All
Menu

Xuper SDK (JS/TS)

Index

Type aliases

AccountModel

AccountModel: object

Type declaration

  • address: string
  • Optional mnemonic?: undefined | string
  • privateKey: PrivateKey
  • publicKey: PublicKey

AuthModel

AuthModel: object

Type declaration

  • fee: string | number | BN
  • sign: Function

ContractInfo

ContractInfo: object

Type declaration

  • contarctName: string
  • contractMethod: string

ContractRequesttModel

ContractRequesttModel: object

Type declaration

  • Optional amount?: undefined | string
  • args: any
  • Optional contract_name?: undefined | string
  • method_name: string
  • module_name: string

ErrorOptions

ErrorOptions: object

Type declaration

  • Optional isFront?: undefined | false | true
  • Optional name?: undefined | string
  • Optional stackIgnore?: [number, number]

Options

Options: object

Type declaration

  • chain: string
  • Optional env?: undefined | object
  • node: string
  • Optional plugins?: Plugin[]

Plugin

Plugin: object

Type declaration

  • args: any
  • func: PluginFunc
  • hookFuncs: string[]
  • init: Function
  • name: string

PluginFunc

PluginFunc: object

Type declaration

  • [prop: string]: Function

PrivateKey

PrivateKey: object & PublicKey

PublicKey

PublicKey: object

Type declaration

  • Curvname: string
  • X: string
  • Y: string

SignInfoModel

SignInfoModel: object

Type declaration

  • PublicKey: string
  • Sign: string

TransactionInfomationModel

TransactionInfomationModel: object

Type declaration

  • amount: string | number | BN
  • Optional desc?: undefined | string
  • Optional fee?: string | number | BN
  • to: string

TransactionModel

TransactionModel: object

Type declaration

  • authRequire: string[]

    Auth

  • Optional authRequireSigns?: any[]

    Auth sign

  • autogen: boolean
  • coinbase: boolean
  • Optional contractRequests?: any[]

    Contract requests

  • desc: string

    Transaction description

  • initiator: string

    Transaction initiator

  • Optional initiatorSigns?: SignInfoModel[]

    initiator sign

  • nonce: string

    Nonce

  • timestamp: number

    Timestamp

  • txInputs: TXInput[]

    Inputs

  • Optional txInputsExt?: any[]

    Inputs

  • txOutputs: any[]

    Outputs

  • Optional txOutputsExt?: any[]

    Outputs

  • Optional txid?: undefined | string

    Transaction ID

  • version: number

    SDK version

Variables

Const VERSION

VERSION: 1 = 1
file

(constants) Created by SmilingXinyi smilingxinyi@gmail.com on 2020/7/2

Let client

client: any = null

Let endorsorClient

endorsorClient: any = null

Functions

XuperError

  • XuperError(errorCode: number | string, message: string, name?: string, isFront?: boolean, payload?: Error): ErrorInterface
  • Parameters

    • errorCode: number | string
    • message: string
    • Default value name: string = "Xuper SDK error"
    • Default value isFront: boolean = true
    • Optional payload: Error

    Returns ErrorInterface

Const accountContractList

  • accountContractList(node: string, body: any): Promise<any>

Const accountList

  • accountList(node: string, body: any): Promise<any>

Const addressContractList

  • addressContractList(node: string, body: any): Promise<any>

Const endorser

  • endorser(node: string, body: any): Promise<any>

Const gRPCPromise

  • gRPCPromise(service: string, body: any): Promise<unknown>
  • Parameters

    • service: string
    • body: any

    Returns Promise<unknown>

Const getBalance

  • getBalance(node: string, body: any): Promise<any>

Const getBalanceDetail

  • getBalanceDetail(node: string, body: any): Promise<any>

Const getBlock

  • getBlock(node: string, body: any): Promise<any>

Const getBlockByHeight

  • getBlockByHeight(node: string, body: any): Promise<any>

Const getBlockChains

  • getBlockChains(node: string, body: any): Promise<any>

Const getStatus

  • getStatus(node: string, body: any): Promise<any>

Const initializationClient

  • initializationClient(node: string): void

Const initializationEndorseClient

  • initializationEndorseClient(node: string): void

Const plugin

  • plugin(args?: any): object
  • plugin(args: any): object

Const postTransaction

  • postTransaction(node: string, body: any): Promise<any>

Const preExec

  • preExec(node: string, body: any): Promise<any>

Const preExecWithFee

  • preExecWithFee(node: string, body: any): Promise<any>

Const queryACL

  • queryACL(node: string, body: any): Promise<any>

Const queryContractStatData

  • queryContractStatData(node: string, body: any): Promise<any>

Const queryTransaction

  • queryTransaction(node: string, body: any): Promise<any>

Const wrapperRequest

  • wrapperRequest(request: object, body: any): Promise<unknown>
  • Parameters

    • request: object
      • gRPCService: string
      • Optional httpGetMethod?: undefined | false | true
      • httpService: string
    • body: any

    Returns Promise<unknown>

Object literals

Const Errors

Errors: object

ACCOUNT_NOT_EXIST

ACCOUNT_NOT_EXIST: ErrorInterface = XuperError(6001, 'Account not exist')

PARAMETER_ERROR

PARAMETER_ERROR: ErrorInterface = XuperError(6002, 'Parameter error')

UTXO_NOT_ENOUGH

UTXO_NOT_ENOUGH: ErrorInterface = XuperError(1001, 'Utxo is not enough')

PARAMETER_EMPTY_FUNC

  • PARAMETER_EMPTY_FUNC(params?: string | string[]): XuperError1

Const defaultOpts

defaultOpts: object

isFront

isFront: true = true

name

name: string = "Xuper SDK Error"