Wallet adapter interface

interface WalletAdapter {
    account: undefined | IAccount;
    changeNetwork: (
        network: Network,
    ) => Promise<{ account?: IAccount; network: Network }>;
    checkSupport: () => Promise<void>;
    connect: () => Promise<void>;
    connected: boolean;
    connecting: boolean;
    deriveAccount: (index: number) => Promise<IAccount>;
    disconnect: () => Promise<void>;
    icon: string;
    name: string;
    network: Network;
    signMessage: (
        message: {
            from: string;
            gasFeeCap: string;
            gasLimit: number;
            gasPremium: string;
            method: number;
            nonce: number;
            params: string;
            to: string;
            value: string;
            version: 0;
        },
    ) => Promise<Signature>;
    support: "NotChecked" | "Detected" | "NotDetected" | "NotSupported";
    url: string;
    sign(data: Uint8Array): Promise<Signature>;
}

Hierarchy

Properties

account: undefined | IAccount
changeNetwork: (
    network: Network,
) => Promise<{ account?: IAccount; network: Network }>
checkSupport: () => Promise<void>
connect: () => Promise<void>
connected: boolean
connecting: boolean
deriveAccount: (index: number) => Promise<IAccount>
disconnect: () => Promise<void>
icon: string
name: string
network: Network
signMessage: (
    message: {
        from: string;
        gasFeeCap: string;
        gasLimit: number;
        gasPremium: string;
        method: number;
        nonce: number;
        params: string;
        to: string;
        value: string;
        version: 0;
    },
) => Promise<Signature>

Sign filecoin message

Type declaration

    • (
          message: {
              from: string;
              gasFeeCap: string;
              gasLimit: number;
              gasPremium: string;
              method: number;
              nonce: number;
              params: string;
              to: string;
              value: string;
              version: 0;
          },
      ): Promise<Signature>
    • Parameters

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

        Filecoin message to sign

      Returns Promise<Signature>

support: "NotChecked" | "Detected" | "NotDetected" | "NotSupported"
url: string

Methods

  • Sign raw bytes

    Parameters

    • data: Uint8Array

      raw bytes to sign

    Returns Promise<Signature>