util
convertRecoveryToV()โ
convertRecoveryToV(
recovery:number,txData:any):Buffer|BN
Convert a recovery parameter (0/1) to the proper v value format based on transaction type. Consolidates the v parameter conversion logic used across ethereum.ts and util.ts.
Parametersโ
| Parameter | Type | Description |
|---|---|---|
recovery | number | Recovery parameter (0 or 1) |
txData | any | Transaction data containing chainId, useEIP155, and type |
Returnsโ
Buffer | BN
The properly formatted v value as Buffer or BN
Sourceโ
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โ
| Parameter | Type | Default value |
|---|---|---|
_data | string | Uint8Array | undefined |
to | string | undefined |
_chainId | string | number | undefined |
recurse | boolean | true |
Returnsโ
Promise<{"abi": any;"def": Buffer; }>
| Member | Type | Value |
|---|---|---|
abi | any | - |
def | Buffer | ... |
Sourceโ
generateAppSecret()โ
generateAppSecret(
deviceId:string|Buffer,password:string|Buffer,appName:string|Buffer):Buffer
Generates an application secret for use in maintaining connection to device.
Parametersโ
| Parameter | 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
Sourceโ
getV()โ
getV(
tx:any,resp:any):BN
Get the v component of signature using viem parsing.
Parametersโ
| Parameter | Type | Description |
|---|---|---|
tx | any | Serialized transaction (Buffer or hex string) |
resp | any | Lattice response with sig and pubkey |
Returnsโ
BN
BN object containing the v param
Sourceโ
getYParity()โ
getYParity(
messageHash:any,signature?:any,publicKey?:string|Buffer|Uint8Array):number
Get the y-parity value for a signature by recovering the public key.
Usage:
- Simple: getYParity(messageHash, signature, publicKey)
- Object: getYParity({ messageHash, signature, publicKey })
- Legacy: getYParity(tx, response)
Parametersโ
| Parameter | Type | Description |
|---|---|---|
messageHash | any | The 32-byte message hash (or tx object for legacy) |
signature? | any | Object with r and s values |
publicKey? | string | Buffer | Uint8Array | Expected public key |
Returnsโ
number
0 or 1 for the y-parity value
Sourceโ
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โ
| Parameter | Type |
|---|---|
abiData | any[] |
selector | string |
Returnsโ
any