Skip to main content

util

fetchCalldataDecoder()โ€‹

fetchCalldataDecoder(_data: string | Uint8Array, to: string, _chainId: string | number, recurse: boolean): Promise<{"abi": any;"def": Buffer; }>

Fetches calldata from a remote scanner based on the transaction's chainId

Parametersโ€‹

ParameterTypeDefault value
_datastring | Uint8Arrayundefined
tostringundefined
_chainIdstring | numberundefined
recursebooleantrue

Returnsโ€‹

Promise<{"abi": any;"def": Buffer; }>

MemberTypeValue
abiany-
defBuffer...

Sourceโ€‹

util.ts:582


generateAppSecret()โ€‹

generateAppSecret(deviceId: string | Buffer, password: string | Buffer, appName: string | Buffer): Buffer

Generates an application secret for use in maintaining connection to device.

Parametersโ€‹

ParameterTypeDescription
deviceIdstring | BufferThe device ID of the device you want to generate a token for.
passwordstring | BufferThe password entered when connecting to the device.
appNamestring | BufferThe name of the application.

Returnsโ€‹

Buffer

an application secret as a Buffer

Sourceโ€‹

util.ts:654


getV()โ€‹

getV(tx: any, resp: any): any

Generic signing does not return a v value like legacy ETH signing requests did. Get the v component of the signature as well as an initV parameter, which is what you need to use to re-create an @ethereumjs/tx object. There is a lot of tech debt in @ethereumjs/tx which also inherits the tech debt of ethereumjs-util.

  1. The legacy Transaction type can call _processSignature with the regular v value.
  2. Newer transaction types such as FeeMarketEIP1559Transaction will subtract 27 from the v that gets passed in, so we need to add 27 to create initV

Parametersโ€‹

ParameterTypeDescription
txanyAn @ethereumjs/tx Transaction object or Buffer (serialized tx)
respanyresponse from Lattice. Can be either legacy or generic signing variety

Returnsโ€‹

any

bn.js BN object containing the v param

Sourceโ€‹

util.ts:689


selectDefFrom4byteABI()โ€‹

selectDefFrom4byteABI(abiData: any[], selector: string): any

Takes a list of ABI data objects and a selector, and returns the earliest ABI data object that matches the selector.

Parametersโ€‹

ParameterType
abiDataany[]
selectorstring

Returnsโ€‹

any

Sourceโ€‹

util.ts:362