Class Gateway

A class used to make the connected gateways available, taking care of target specific conversions.

Hierarchy

  • Gateway

Constructors

  • Create a Gateway instance

    Parameters

    • record: T3rnPrimitivesXdnsFullGatewayRecord

    Returns Gateway

Properties

allowedSideEffects: string[]
createSfx: {} = {}

Type declaration

    decimals: number
    executionVendor: string
    gatewayType: any
    id: string
    record: T3rnPrimitivesXdnsFullGatewayRecord
    rpc: string
    ticker: string
    tokenId: number
    tokens: [] = []
    valueTypeSize: number
    vendor: string

    Methods

    • Create a transfer side effect, taking care of target specific encodings

      Parameters

      • args: {
            enforceExecutioner?: string;
            from: string;
            insurance: string | number | BN;
            maxReward: string | number | BN;
            nonce: number;
            signature?: string;
            to: string;
            value: string | number | BN;
        }

        The arguments to create the side effect

        • Optional enforceExecutioner?: string

          The address of the executioner

        • from: string

          The address of the sender

        • insurance: string | number | BN

          The insurance for the side effect

        • maxReward: string | number | BN

          The maximum reward for the side effect

        • nonce: number

          The nonce of the side effect

        • Optional signature?: string

          The signature of the side effect

        • to: string

          The address of the receiver

        • value: string | number | BN

          The value to transfer

      Returns T3rnTypesSideEffect

    • Encode transfer arguments

      Parameters

      • from: string

        The address of the sender

      • to: string

        The address of the receiver

      • value: string | number | BN

        The value to transfer

      • insurance: string | number | BN

        The insurance for the side effect

      • reward: string | number | BN

        The reward for the side effect

      Returns string[]

    • Convert a float value into the correct integer, accounting for decimals

      Parameters

      • value: number

        The value to convert

      Returns BN

    • Get gateway type from vendor

      Parameters

      • vendor: string

        The vendor of the gateway

      Returns GatewayType

    • Parse LE encoded value to correct integer, accounting for decimals

      Parameters

      • value: string

        The value to convert

      Returns BN

    • Parse integer to float, accounting for decimals

      Parameters

      • value: number | BN

        The integer value to be converted

      Returns number

    • Convert an address into t3rn compatible form. For example, we want to ensure we pass the public key for polkadot addresses

      Parameters

      • addr: string

      Returns string

    Generated using TypeDoc