ClientOptions

Object including the options to instantiate the connext client with.

The object contains the following fields:

Name Type Description
rpcProviderUrl String the Web3 provider URL used by the client
nodeUrl String url of the node
mnemonic? String (optional) Mnemonic of the signing wallet
externalWallet? any (optional) External wallet address
channelProvider? ChannelProvider (optional) Injected ChannelProvider
keyGen? () => Promise Function passed in by wallets to generate ephemeral keys
store? object Maps to set/get from CF. Defaults localStorage
logLevel? number Depth of logging
natsUrl? String Initially hardcoded
natsClusterId? String Initially hardcoded
natsToken? String Initially hardcoded

If the optional values are not provided, they will default to the ones that synchronize with the hub’s configuration values. However, you must pass at least one signing option (mnemonic, externalWallet, or channelProvider).

Object literals

Type aliases

BigNumber

BigNumber: BigNumber

CallbackStruct

CallbackStruct: object

Type declaration

ConditionResolvers

ConditionResolvers: object

Type declaration

ConditionalExecutors

ConditionalExecutors: object

Type declaration

InternalClientOptions

InternalClientOptions: ClientOptions & object

ProposalValidator

ProposalValidator: object

Type declaration

Variables

API_TIMEOUT

API_TIMEOUT: 5000 = 5000

BigNumber

BigNumber: BigNumber = utils.BigNumber

MAX_RETRIES

MAX_RETRIES: 20 = 20

createPaymentId

createPaymentId: createRandom32ByteHexString = createRandom32ByteHexString

createPreImage

createPreImage: createRandom32ByteHexString = createRandom32ByteHexString

baseAppValidation

  • baseAppValidation(app: AppInstanceInfo, registeredInfo: RegisteredAppDetails, isVirtual: boolean, connext: ConnextInternal): Promise

  • Defined in validation/appProposals.ts:125

Parameters

app: AppInstanceInfo

registeredInfo: RegisteredAppDetails

isVirtual: boolean

connext: ConnextInternal

Returns Promise

calculateExchange

Parameters

amount: BigNumber

swapRate: string

Returns BigNumber

capitalize

Parameters

str: string

Returns string

connect

  • connect(opts: ClientOptions): Promise<ConnextInternal>

  • Defined in connext.ts:62

    Creates a new client-node connection with node at specified url

Parameters

opts: ClientOptions

The options to instantiate the client with. At a minimum, must contain the nodeUrl and a client signing key or mnemonic

Returns Promise<ConnextInternal>

createLinkedHash

  • createLinkedHash(action: UnidirectionalLinkedTransferAppActionBigNumber): string

  • Defined in lib/utils.ts:65

Parameters

action: UnidirectionalLinkedTransferAppActionBigNumber

Returns string

createRandom32ByteHexString

Returns string

delay

Parameters

ms: number

Returns Promise<void>

falsy

Parameters

x: string | undefined

Returns boolean

freeBalanceAddressFromXpub

  • freeBalanceAddressFromXpub(xpub: string): string

  • Defined in lib/utils.ts:61

Parameters

xpub: string

Returns string

insertDefault

  • insertDefault(val: string, obj: any, keys: string[]): any

  • Defined in lib/utils.ts:39

Parameters

val: string

obj: any

keys: string[]

Returns any

invalid32ByteHexString

Parameters

value: any

Returns string | undefined

invalidAddress

Parameters

value: string

Returns string | undefined

invalidXpub

Parameters

value: string

Returns string | undefined

isValidAddress

Parameters

value: any

Returns boolean

notBigNumber

Parameters

value: any

Returns string | undefined

notBigNumberish

Parameters

value: any

Returns string | undefined

notGreaterThan

  • notGreaterThan(value: any, ceil: utils.BigNumberish): string | undefined

  • Defined in validation/bn.ts:31

Parameters

value: any

ceil: utils.BigNumberish

Returns string | undefined

notGreaterThanOrEqualTo

  • notGreaterThanOrEqualTo(value: any, ceil: utils.BigNumberish): string | undefined

  • Defined in validation/bn.ts:40

Parameters

value: any

ceil: utils.BigNumberish

Returns string | undefined

notLessThan

  • notLessThan(value: any, floor: utils.BigNumberish): string | undefined

  • Defined in validation/bn.ts:50

Parameters

value: any

floor: utils.BigNumberish

Returns string | undefined

notLessThanOrEqualTo

  • notLessThanOrEqualTo(value: any, floor: utils.BigNumberish): string | undefined

  • Defined in validation/bn.ts:59

Parameters

value: any

floor: utils.BigNumberish

Returns string | undefined

notNegative

Parameters

value: any

Returns string | undefined

notPositive

Parameters

value: any

Returns string | undefined

objMap

  • objMap<T, F, R>(obj: T, func: function): object

  • Defined in lib/utils.ts:13

Type parameters

T

  • F: keyof T

  • R

    Parameters

    obj: T

    func: function

    *   *   (val: T\[F\], field: F): R
    
        *   #### Parameters
    
            ##### val: T\[F\]
    
            ##### field: F
    
    
            #### Returns R
    

    Returns object

    objMapPromise

    • objMapPromise<T, F, R>(obj: T, func: function): Promise

    • Defined in lib/utils.ts:26

    Type parameters

    T

  • F: keyof T

  • R

    Parameters

    obj: T

    func: function

    *   *   (val: T\[F\], field: F): Promise<R\>
    
        *   #### Parameters
    
            ##### val: T\[F\]
    
            ##### field: F
    
    
            #### Returns Promise<R\>
    

    Returns Promise<object>

    prettyLog

    Parameters

    app: AppInstanceInfo

    Returns string

    publicIdentifierToAddress

    • publicIdentifierToAddress(publicIdentifier: string): string

    • Defined in lib/utils.ts:57

    Parameters

    publicIdentifier: string

    Returns string

    replaceBN

    Parameters

    key: string

    value: any

    Returns any

    validateLinkedTransferApp

    • validateLinkedTransferApp(app: AppInstanceInfo, registeredInfo: RegisteredAppDetails, isVirtual: boolean, connext: ConnextInternal): Promise

    • Defined in validation/appProposals.ts:100

    Parameters

    app: AppInstanceInfo

    registeredInfo: RegisteredAppDetails

    isVirtual: boolean

    connext: ConnextInternal

    Returns Promise

    validateSimpleTransferApp

    • validateSimpleTransferApp(app: AppInstanceInfo, registeredInfo: RegisteredAppDetails, isVirtual: boolean, connext: ConnextInternal): Promise

    • Defined in validation/appProposals.ts:68

    Parameters

    app: AppInstanceInfo

    registeredInfo: RegisteredAppDetails

    isVirtual: boolean

    connext: ConnextInternal

    Returns Promise

    validateSwapApp

    • validateSwapApp(app: AppInstanceInfo, registeredInfo: RegisteredAppDetails, isVirtual: boolean, connext: ConnextInternal): Promise

    • Defined in validation/appProposals.ts:18

    Parameters

    app: AppInstanceInfo

    registeredInfo: RegisteredAppDetails

    isVirtual: boolean

    connext: ConnextInternal

    Returns Promise

    validateTransferApp

    • validateTransferApp(app: AppInstanceInfo, registeredInfo: RegisteredAppDetails, isVirtual: boolean, connext: ConnextInternal): Promise

    • Defined in validation/appProposals.ts:37

    Parameters

    app: AppInstanceInfo

    registeredInfo: RegisteredAppDetails

    isVirtual: boolean

    connext: ConnextInternal

    Returns Promise

    Object literals

    appProposalValidation

    appProposalValidation: object

    SimpleTransferApp

    SimpleTransferApp: validateSimpleTransferApp = validateSimpleTransferApp

    SimpleTwoPartySwapApp

    SimpleTwoPartySwapApp: validateSwapApp = validateSwapApp

    UnidirectionalLinkedTransferApp

    UnidirectionalLinkedTransferApp: validateLinkedTransferApp = validateLinkedTransferApp

    UnidirectionalTransferApp

    UnidirectionalTransferApp: validateTransferApp = validateTransferApp