Module: util
Functionsโ
fetchCalldataDecoderโ
โธ fetchCalldataDecoder(_data
, to
, _chainId
, recurse?
): Promise
<{ abi
: any
; def
: Buffer
}>
Fetches calldata from a remote scanner based on the transaction's chainId
Parametersโ
Name | Type | Default value |
---|---|---|
_data | string | Uint8Array | undefined |
to | string | undefined |
_chainId | string | number | undefined |
recurse | boolean | true |
Returnsโ
Promise
<{ abi
: any
; def
: Buffer
}>
Defined inโ
fetchWithTimeoutโ
โธ fetchWithTimeout(url
, options
): Promise
<Response
>
Parametersโ
Name | Type |
---|---|
url | any |
options | any |
Returnsโ
Promise
<Response
>
Defined inโ
generateAppSecretโ
โธ generateAppSecret(deviceId
, password
, appName
): Buffer
Generates an application secret for use in maintaining connection to device.
Parametersโ
Name | Type | Description |
---|---|---|
deviceId | string | Buffer | The device ID of the device you want to generate a token for. |
password | string | Buffer | The password entered when connecting to the device. |
appName | string | Buffer | The name of the application. |
Returnsโ
Buffer
an application secret as a Buffer
Defined inโ
getVโ
โธ getV(tx
, resp
): 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.
- The legacy
Transaction
type can call_processSignature
with the regularv
value. - Newer transaction types such as
FeeMarketEIP1559Transaction
will subtract 27 from thev
that gets passed in, so we need to add27
to createinitV
Parametersโ
Name | Type | Description |
---|---|---|
tx | any | An @ethereumjs/tx Transaction object or Buffer (serialized tx) |
resp | any | response from Lattice. Can be either legacy or generic signing variety |
Returnsโ
any
bn.js BN object containing the v
param
Defined inโ
selectDefFrom4byteABIโ
โธ selectDefFrom4byteABI(abiData
, selector
): any
Takes a list of ABI data objects and a selector, and returns the earliest ABI data object that matches the selector.
Parametersโ
Name | Type |
---|---|
abiData | any [] |
selector | string |
Returnsโ
any