Options
All
  • Public
  • Public/Protected
  • All
Menu

Module Byte-Serialization

Arb-ts includes methods for serializing parameters for a solidity method into a single byte array to minimize calldata. It uses the following schema:

address[]:

field size (bytes) Description
length 1 Size of array
is-registered 1 1 = all registered, 0 = not all registered
addresses 4 or 20 (x length) If is registered, left-padded 4-byte integers; otherwise, eth addresses

non-address[]:

field size (bytes) Description
length 1 Size of array
items (variable) All items (concatenated)

address:

field size (bytes) Description
is-registered 1 1 = registered, 0 = not registered
address 4 or 20 If registered, left-padded 4-byte integer; otherwise, eth address

Index

Functions

Const argSerializerConstructor

  • argSerializerConstructor(arbProvider: JsonRpcProvider): (params: PrimativeOrPrimativeArray[]) => Promise<Uint8Array>
  • // to use:

    const mySerializeParamsFunction = argSerializerConstructor("rpcurl")
    mySerializeParamsFunction(["4","5", "6"])
    

    Parameters

    • arbProvider: JsonRpcProvider

    Returns (params: PrimativeOrPrimativeArray[]) => Promise<Uint8Array>

      • (params: PrimativeOrPrimativeArray[]): Promise<Uint8Array>
      • Parameters

        • params: PrimativeOrPrimativeArray[]

        Returns Promise<Uint8Array>

Generated using TypeDoc