Constructors

Properties

config:
    | undefined
    | {
        derivationPath: string;
        network: "mainnet"
        | "testnet";
        rpc: { token: string; url: string };
        unit?: { decimals: number; symbol: "FIL" | "tFIL" };
    }
provider: EIP1193Provider
snap: Snap

Methods

  • Estimate the gas for a message

    maxFee is optional and defaults to 100000000000000000 attoFIL (0.1 FIL)

    Parameters

    • params: {
          maxFee?: string;
          message: {
              gasFeeCap?: string;
              gasLimit?: number;
              gasPremium?: string;
              method?: number;
              nonce?: number;
              params?: string;
              to: string;
              value: string;
              version?: 0;
          };
      }

      fil_getGasForMessage RPC method params

    Returns Promise<
        | JsonifyObject<{ error: SnapError; result: null }>
        | JsonifyObject<{ error: null; result: MessageGasEstimate }>,
    >

  • Configure the snap

    Parameters

    • params: Partial<
          {
              derivationPath: string;
              network: "mainnet"
              | "testnet";
              rpc: { token: string; url: string };
              unit?: { decimals: number; symbol: "FIL" | "tFIL" };
          },
      > = {}

    Returns Promise<ConfigureResponse>

  • Send a signed message

    Parameters

    • params: {
          message: {
              from: string;
              gasFeeCap: string;
              gasLimit: number;
              gasPremium: string;
              method: number;
              nonce: number;
              params: string;
              to: string;
              value: string;
              version: 0;
          };
          signature: { data: string; type: "SECP256K1" };
      }

    Returns Promise<SendMessageResponse>

  • Sign a message

    Parameters

    • params: {
          gasFeeCap?: string;
          gasLimit?: number;
          gasPremium?: string;
          method?: number;
          nonce?: number;
          params?: string;
          to: string;
          value: string;
          version?: 0;
      }

    Returns Promise<SignMessageResponse>