Developer Guide

wrappers/BaseWrapper

Index

Classes

Interfaces

Type aliases

Variables

Functions

Type aliases

CeloTransactionParams

Ƭ CeloTransactionParams: Omit‹Tx, "data"›

Defined in contractkit/src/wrappers/BaseWrapper.ts:241

Variables

Const stringToBuffer

stringToBuffer: function = hexToBuffer

Defined in contractkit/src/wrappers/BaseWrapper.ts:53

Type declaration:

▸ (input: string): Buffer

Parameters:

Name

Type

input

string

Functions

Const bufferToBytes

bufferToBytes(input: Buffer): string | number[]

Defined in contractkit/src/wrappers/BaseWrapper.ts:63

Parameters:

Name

Type

input

Buffer

Returns: string | number[]

Const bufferToString

bufferToString(buf: Buffer): string

Defined in contractkit/src/wrappers/BaseWrapper.ts:55

Parameters:

Name

Type

buf

Buffer

Returns: string

Const bytesToString

bytesToString(input: SolBytes): string

Defined in contractkit/src/wrappers/BaseWrapper.ts:65

Parameters:

Name

Type

input

SolBytes

Returns: string

Const fixidityValueToBigNumber

fixidityValueToBigNumber(input: BigNumber.Value): BigNumber‹›

Defined in contractkit/src/wrappers/BaseWrapper.ts:38

Parameters:

Name

Type

input

BigNumber.Value

Returns: BigNumber‹›

Const identity

identity<A>(a: A): A

Defined in contractkit/src/wrappers/BaseWrapper.ts:70

Identity Parser

Type parameters:

A

Parameters:

Name

Type

a

A

Returns: A

proxyCall

proxyCall<InputArgs, ParsedInputArgs, PreParsedOutput, Output>(methodFn: Method‹ParsedInputArgs, PreParsedOutput›, parseInputArgs: function, parseOutput: function): function

Defined in contractkit/src/wrappers/BaseWrapper.ts:139

Creates a proxy to call a web3 native contract method.

There are 4 cases:

  • methodFn

  • parseInputArgs => methodFn

  • parseInputArgs => methodFn => parseOutput

  • methodFn => parseOutput

Type parameters:

InputArgs: any[]

ParsedInputArgs: any[]

PreParsedOutput

Output

Parameters:

methodFn: Method‹ParsedInputArgs, PreParsedOutput›

Web3 methods function

parseInputArgs: function

parseInputArgs function, tranforms arguments into methodFn expected inputs

▸ (...args: InputArgs): ParsedInputArgs

Parameters:

Name

Type

...args

InputArgs

parseOutput: function

parseOutput function, transforms methodFn output into proxy return

▸ (o: PreParsedOutput): Output

Parameters:

Name

Type

o

PreParsedOutput

Returns: function

▸ (...args: InputArgs): Promise‹Output›

Parameters:

Name

Type

...args

InputArgs

proxyCall<InputArgs, PreParsedOutput, Output>(methodFn: Method‹InputArgs, PreParsedOutput›, x: undefined, parseOutput: function): function

Defined in contractkit/src/wrappers/BaseWrapper.ts:149

Type parameters:

InputArgs: any[]

PreParsedOutput

Output

Parameters:

methodFn: Method‹InputArgs, PreParsedOutput›

x: undefined

parseOutput: function

▸ (o: PreParsedOutput): Output

Parameters:

Name

Type

o

PreParsedOutput

Returns: function

▸ (...args: InputArgs): Promise‹Output›

Parameters:

Name

Type

...args

InputArgs

proxyCall<InputArgs, ParsedInputArgs, Output>(methodFn: Method‹ParsedInputArgs, Output›, parseInputArgs: function): function

Defined in contractkit/src/wrappers/BaseWrapper.ts:154

Type parameters:

InputArgs: any[]

ParsedInputArgs: any[]

Output

Parameters:

methodFn: Method‹ParsedInputArgs, Output›

parseInputArgs: function

▸ (...args: InputArgs): ParsedInputArgs

Parameters:

Name

Type

...args

InputArgs

Returns: function

▸ (...args: InputArgs): Promise‹Output›

Parameters:

Name

Type

...args

InputArgs

proxyCall<InputArgs, Output>(methodFn: Method‹InputArgs, Output›): function

Defined in contractkit/src/wrappers/BaseWrapper.ts:158

Type parameters:

InputArgs: any[]

Output

Parameters:

Name

Type

methodFn

Method‹InputArgs, Output›

Returns: function

▸ (...args: InputArgs): Promise‹Output›

Parameters:

Name

Type

...args

InputArgs

proxySend

proxySend<InputArgs, ParsedInputArgs, Output>(kit: ContractKit, ...sendArgs: ProxySendArgs‹InputArgs, ParsedInputArgs, Output›): function

Defined in contractkit/src/wrappers/BaseWrapper.ts:219

Creates a proxy to send a tx on a web3 native contract method.

There are 2 cases:

  • call methodFn (no pre or post parsing)

  • preParse arguments & call methodFn

Type parameters:

InputArgs: any[]

ParsedInputArgs: any[]

Output

Parameters:

Name

Type

kit

ContractKit

...sendArgs

ProxySendArgs‹InputArgs, ParsedInputArgs, Output›

Returns: function

▸ (...args: InputArgs): CeloTransactionObject‹Output›

Parameters:

Name

Type

...args

InputArgs

Const stringIdentity

stringIdentity(x: string): string

Defined in contractkit/src/wrappers/BaseWrapper.ts:71

Parameters:

Name

Type

x

string

Returns: string

Const stringToBytes

stringToBytes(input: string): string | number[]

Defined in contractkit/src/wrappers/BaseWrapper.ts:61

Parameters:

Name

Type

input

string

Returns: string | number[]

toTransactionObject

toTransactionObject<O>(kit: ContractKit, txo: TransactionObject‹O›, defaultParams?: Omit‹Tx, "data"›): CeloTransactionObject‹O›

Defined in contractkit/src/wrappers/BaseWrapper.ts:233

Type parameters:

O

Parameters:

Name

Type

kit

ContractKit

txo

TransactionObject‹O›

defaultParams?

Omit‹Tx, "data"›

Returns: CeloTransactionObject‹O›

tupleParser

tupleParser<A0, B0>(parser0: Parser‹A0, B0›): function

Defined in contractkit/src/wrappers/BaseWrapper.ts:77

Tuple parser Useful to map different input arguments

Type parameters:

A0

B0

Parameters:

Name

Type

parser0

Parser‹A0, B0›

Returns: function

▸ (...args: [A0]): [B0]

Parameters:

Name

Type

...args

[A0]

tupleParser<A0, B0, A1, B1>(parser0: Parser‹A0, B0›, parser1: Parser‹A1, B1›): function

Defined in contractkit/src/wrappers/BaseWrapper.ts:78

Type parameters:

A0

B0

A1

B1

Parameters:

Name

Type

parser0

Parser‹A0, B0›

parser1

Parser‹A1, B1›

Returns: function

▸ (...args: [A0, A1]): [B0, B1]

Parameters:

Name

Type

...args

[A0, A1]

tupleParser<A0, B0, A1, B1, A2, B2>(parser0: Parser‹A0, B0›, parser1: Parser‹A1, B1›, parser2: Parser‹A2, B2›): function

Defined in contractkit/src/wrappers/BaseWrapper.ts:82

Type parameters:

A0

B0

A1

B1

A2

B2

Parameters:

Name

Type

parser0

Parser‹A0, B0›

parser1

Parser‹A1, B1›

parser2

Parser‹A2, B2›

Returns: function

▸ (...args: [A0, A1, A2]): [B0, B1, B2]

Parameters:

Name

Type

...args

[A0, A1, A2]

tupleParser<A0, B0, A1, B1, A2, B2, A3, B3>(parser0: Parser‹A0, B0›, parser1: Parser‹A1, B1›, parser2: Parser‹A2, B2›, parser3: Parser‹A3, B3›): function

Defined in contractkit/src/wrappers/BaseWrapper.ts:87

Type parameters:

A0

B0

A1

B1

A2

B2

A3

B3

Parameters:

Name

Type

parser0

Parser‹A0, B0›

parser1

Parser‹A1, B1›

parser2

Parser‹A2, B2›

parser3

Parser‹A3, B3›

Returns: function

▸ (...args: [A0, A1, A2, A3]): [B0, B1, B2, B3]

Parameters:

Name

Type

...args

[A0, A1, A2, A3]

Const valueToBigNumber

valueToBigNumber(input: BigNumber.Value): BigNumber‹›

Defined in contractkit/src/wrappers/BaseWrapper.ts:36

Parameters:

Name

Type

input

BigNumber.Value

Returns: BigNumber‹›

Const valueToFixidityString

valueToFixidityString(input: BigNumber.Value): string

Defined in contractkit/src/wrappers/BaseWrapper.ts:42

Parameters:

Name

Type

input

BigNumber.Value

Returns: string

Const valueToFrac

valueToFrac(numerator: BigNumber.Value, denominator: BigNumber.Value): BigNumber‹›

Defined in contractkit/src/wrappers/BaseWrapper.ts:50

Parameters:

Name

Type

numerator

BigNumber.Value

denominator

BigNumber.Value

Returns: BigNumber‹›

Const valueToInt

valueToInt(input: BigNumber.Value): number

Defined in contractkit/src/wrappers/BaseWrapper.ts:45

Parameters:

Name

Type

input

BigNumber.Value

Returns: number

Const valueToString

valueToString(input: BigNumber.Value): string

Defined in contractkit/src/wrappers/BaseWrapper.ts:40

Parameters:

Name

Type

input

BigNumber.Value

Returns: string