Hierarchy

  • DAppClientOptions

Properties

analytics?: AnalyticsInterface

The analytics instance that will be used by the SDK

appUrl?: string

A URL to the website of the application

blockExplorer?: BlockExplorer

The block explorer used by the SDK

colorMode?: ColorMode

Set the color mode for the UI elements (alerts and toasts)

description?: string

Description of the application

disableDefaultEvents?: boolean

Disable all default Events and UI elements. If passed together with "eventHandlers", the default eventHandlers will be removed, and the ones passed by the user will be added.

disclaimerText?: string

A disclaimer text that will be displayed in the pairing alert

enableAppSwitching?: boolean

Automatically switch between apps on Mobile Devices (Enabled by Default)

enableMetrics?: boolean

Enable metrics tracking (Disabled by Default)

errorMessages?: Record<string, Record<string | number, string>>

A list of contracts that the DApp is using. Allows to attach human readable error messages for to error codes

eventHandlers?: {
    ACKNOWLEDGE_RECEIVED: undefined | {
        handler: BeaconEventHandlerFunction<{
            extraInfo: ExtraInfo;
            message: AcknowledgeResponse;
            walletInfo: WalletInfo;
        }>;
    };
    ACTIVE_ACCOUNT_SET: undefined | {
        handler: BeaconEventHandlerFunction<AccountInfo>;
    };
    ACTIVE_TRANSPORT_SET: undefined | {
        handler: BeaconEventHandlerFunction<Transport<PeerInfo, any, any>>;
    };
    BROADCAST_REQUEST_ERROR: undefined | {
        handler: BeaconEventHandlerFunction<{
            errorResponse: ErrorResponse;
            walletInfo: WalletInfo;
        }>;
    };
    BROADCAST_REQUEST_SENT: undefined | {
        handler: BeaconEventHandlerFunction<RequestSentInfo>;
    };
    BROADCAST_REQUEST_SUCCESS: undefined | {
        handler: BeaconEventHandlerFunction<{
            blockExplorer: BlockExplorer;
            connectionContext: ConnectionContext;
            network: Network;
            output: BroadcastResponse;
            walletInfo: WalletInfo;
        }>;
    };
    CHANNEL_CLOSED: undefined | {
        handler: BeaconEventHandlerFunction<string>;
    };
    HIDE_UI: undefined | {
        handler: BeaconEventHandlerFunction<undefined | ("alert" | "toast")[]>;
    };
    INTERNAL_ERROR: undefined | {
        handler: BeaconEventHandlerFunction<{
            buttons?: AlertButton[];
            text: string;
        }>;
    };
    INVALID_ACTIVE_ACCOUNT_STATE: undefined | {
        handler: BeaconEventHandlerFunction<undefined>;
    };
    LOCAL_RATE_LIMIT_REACHED: undefined | {
        handler: BeaconEventHandlerFunction<undefined>;
    };
    NO_PERMISSIONS: undefined | {
        handler: BeaconEventHandlerFunction<undefined>;
    };
    OPERATION_REQUEST_ERROR: undefined | {
        handler: BeaconEventHandlerFunction<{
            errorMessages: Record<string, Record<string | number, string>>;
            errorResponse: ErrorResponse;
            walletInfo: WalletInfo;
        }>;
    };
    OPERATION_REQUEST_SENT: undefined | {
        handler: BeaconEventHandlerFunction<RequestSentInfo>;
    };
    OPERATION_REQUEST_SUCCESS: undefined | {
        handler: BeaconEventHandlerFunction<{
            account: AccountInfo;
            blockExplorer: BlockExplorer;
            connectionContext: ConnectionContext;
            output: OperationResponse;
            walletInfo: WalletInfo;
        }>;
    };
    PAIR_INIT: undefined | {
        handler: BeaconEventHandlerFunction<{
            analytics: AnalyticsInterface;
            disclaimerText?: string;
            featuredWallets?: string[];
            networkType: NetworkType;
            p2pPeerInfo: (() => Promise<P2PPairingRequest>);
            postmessagePeerInfo: (() => Promise<PostMessagePairingRequest>);
            walletConnectPeerInfo: (() => Promise<WalletConnectPairingRequest>);
            abortedHandler?() => void;
        }>;
    };
    PAIR_SUCCESS: undefined | {
        handler: BeaconEventHandlerFunction<ExtendedP2PPairingResponse | ExtendedPostMessagePairingResponse | ExtendedWalletConnectPairingResponse>;
    };
    PERMISSION_REQUEST_ERROR: undefined | {
        handler: BeaconEventHandlerFunction<{
            errorResponse: ErrorResponse;
            walletInfo: WalletInfo;
        }>;
    };
    PERMISSION_REQUEST_SENT: undefined | {
        handler: BeaconEventHandlerFunction<RequestSentInfo>;
    };
    PERMISSION_REQUEST_SUCCESS: undefined | {
        handler: BeaconEventHandlerFunction<{
            account: AccountInfo;
            blockExplorer: BlockExplorer;
            connectionContext: ConnectionContext;
            output: PermissionResponseOutput;
            walletInfo: WalletInfo;
        }>;
    };
    PROOF_OF_EVENT_CHALLENGE_REQUEST_ERROR: undefined | {
        handler: BeaconEventHandlerFunction<{
            errorResponse: ErrorResponse;
            walletInfo: WalletInfo;
        }>;
    };
    PROOF_OF_EVENT_CHALLENGE_REQUEST_SENT: undefined | {
        handler: BeaconEventHandlerFunction<RequestSentInfo>;
    };
    PROOF_OF_EVENT_CHALLENGE_REQUEST_SUCCESS: undefined | {
        handler: BeaconEventHandlerFunction<{
            account: AccountInfo;
            blockExplorer: BlockExplorer;
            connectionContext: ConnectionContext;
            output: ProofOfEventChallengeResponse;
            walletInfo: WalletInfo;
        }>;
    };
    SHOW_PREPARE: undefined | {
        handler: BeaconEventHandlerFunction<{
            walletInfo?: WalletInfo;
        }>;
    };
    SIGN_REQUEST_ERROR: undefined | {
        handler: BeaconEventHandlerFunction<{
            errorResponse: ErrorResponse;
            walletInfo: WalletInfo;
        }>;
    };
    SIGN_REQUEST_SENT: undefined | {
        handler: BeaconEventHandlerFunction<RequestSentInfo>;
    };
    SIGN_REQUEST_SUCCESS: undefined | {
        handler: BeaconEventHandlerFunction<{
            connectionContext: ConnectionContext;
            output: SignPayloadResponse;
            walletInfo: WalletInfo;
        }>;
    };
    SIMULATED_PROOF_OF_EVENT_CHALLENGE_REQUEST_ERROR: undefined | {
        handler: BeaconEventHandlerFunction<{
            errorResponse: ErrorResponse;
            walletInfo: WalletInfo;
        }>;
    };
    SIMULATED_PROOF_OF_EVENT_CHALLENGE_REQUEST_SENT: undefined | {
        handler: BeaconEventHandlerFunction<RequestSentInfo>;
    };
    SIMULATED_PROOF_OF_EVENT_CHALLENGE_REQUEST_SUCCESS: undefined | {
        handler: BeaconEventHandlerFunction<{
            account: AccountInfo;
            blockExplorer: BlockExplorer;
            connectionContext: ConnectionContext;
            output: SimulatedProofOfEventChallengeResponse;
            walletInfo: WalletInfo;
        }>;
    };
    UNKNOWN: undefined | {
        handler: BeaconEventHandlerFunction<undefined>;
    };
}

An object that will be used to overwrite default event handler behaviour.

If you plan to overwrite all default events, use "disableDefaultEvents" instead.

This will overwrite the default event handler, so this can lead to unexpected behavior in some cases. We recommend that you overwrite all handlers if you want to use your own UI.

If you simply want to be notified of events happening, but do not want to overwrite the default behavior, please use subscribeToEvent() on the DAppClient instead.

Type declaration

  • ACKNOWLEDGE_RECEIVED: undefined | {
        handler: BeaconEventHandlerFunction<{
            extraInfo: ExtraInfo;
            message: AcknowledgeResponse;
            walletInfo: WalletInfo;
        }>;
    }
  • ACTIVE_ACCOUNT_SET: undefined | {
        handler: BeaconEventHandlerFunction<AccountInfo>;
    }
  • ACTIVE_TRANSPORT_SET: undefined | {
        handler: BeaconEventHandlerFunction<Transport<PeerInfo, any, any>>;
    }
  • BROADCAST_REQUEST_ERROR: undefined | {
        handler: BeaconEventHandlerFunction<{
            errorResponse: ErrorResponse;
            walletInfo: WalletInfo;
        }>;
    }
  • BROADCAST_REQUEST_SENT: undefined | {
        handler: BeaconEventHandlerFunction<RequestSentInfo>;
    }
  • BROADCAST_REQUEST_SUCCESS: undefined | {
        handler: BeaconEventHandlerFunction<{
            blockExplorer: BlockExplorer;
            connectionContext: ConnectionContext;
            network: Network;
            output: BroadcastResponse;
            walletInfo: WalletInfo;
        }>;
    }
  • CHANNEL_CLOSED: undefined | {
        handler: BeaconEventHandlerFunction<string>;
    }
  • HIDE_UI: undefined | {
        handler: BeaconEventHandlerFunction<undefined | ("alert" | "toast")[]>;
    }
  • INTERNAL_ERROR: undefined | {
        handler: BeaconEventHandlerFunction<{
            buttons?: AlertButton[];
            text: string;
        }>;
    }
  • INVALID_ACTIVE_ACCOUNT_STATE: undefined | {
        handler: BeaconEventHandlerFunction<undefined>;
    }
  • LOCAL_RATE_LIMIT_REACHED: undefined | {
        handler: BeaconEventHandlerFunction<undefined>;
    }
  • NO_PERMISSIONS: undefined | {
        handler: BeaconEventHandlerFunction<undefined>;
    }
  • OPERATION_REQUEST_ERROR: undefined | {
        handler: BeaconEventHandlerFunction<{
            errorMessages: Record<string, Record<string | number, string>>;
            errorResponse: ErrorResponse;
            walletInfo: WalletInfo;
        }>;
    }
  • OPERATION_REQUEST_SENT: undefined | {
        handler: BeaconEventHandlerFunction<RequestSentInfo>;
    }
  • OPERATION_REQUEST_SUCCESS: undefined | {
        handler: BeaconEventHandlerFunction<{
            account: AccountInfo;
            blockExplorer: BlockExplorer;
            connectionContext: ConnectionContext;
            output: OperationResponse;
            walletInfo: WalletInfo;
        }>;
    }
  • PAIR_INIT: undefined | {
        handler: BeaconEventHandlerFunction<{
            analytics: AnalyticsInterface;
            disclaimerText?: string;
            featuredWallets?: string[];
            networkType: NetworkType;
            p2pPeerInfo: (() => Promise<P2PPairingRequest>);
            postmessagePeerInfo: (() => Promise<PostMessagePairingRequest>);
            walletConnectPeerInfo: (() => Promise<WalletConnectPairingRequest>);
            abortedHandler?() => void;
        }>;
    }
  • PAIR_SUCCESS: undefined | {
        handler: BeaconEventHandlerFunction<ExtendedP2PPairingResponse | ExtendedPostMessagePairingResponse | ExtendedWalletConnectPairingResponse>;
    }
  • PERMISSION_REQUEST_ERROR: undefined | {
        handler: BeaconEventHandlerFunction<{
            errorResponse: ErrorResponse;
            walletInfo: WalletInfo;
        }>;
    }
  • PERMISSION_REQUEST_SENT: undefined | {
        handler: BeaconEventHandlerFunction<RequestSentInfo>;
    }
  • PERMISSION_REQUEST_SUCCESS: undefined | {
        handler: BeaconEventHandlerFunction<{
            account: AccountInfo;
            blockExplorer: BlockExplorer;
            connectionContext: ConnectionContext;
            output: PermissionResponseOutput;
            walletInfo: WalletInfo;
        }>;
    }
  • PROOF_OF_EVENT_CHALLENGE_REQUEST_ERROR: undefined | {
        handler: BeaconEventHandlerFunction<{
            errorResponse: ErrorResponse;
            walletInfo: WalletInfo;
        }>;
    }
  • PROOF_OF_EVENT_CHALLENGE_REQUEST_SENT: undefined | {
        handler: BeaconEventHandlerFunction<RequestSentInfo>;
    }
  • PROOF_OF_EVENT_CHALLENGE_REQUEST_SUCCESS: undefined | {
        handler: BeaconEventHandlerFunction<{
            account: AccountInfo;
            blockExplorer: BlockExplorer;
            connectionContext: ConnectionContext;
            output: ProofOfEventChallengeResponse;
            walletInfo: WalletInfo;
        }>;
    }
  • SHOW_PREPARE: undefined | {
        handler: BeaconEventHandlerFunction<{
            walletInfo?: WalletInfo;
        }>;
    }
  • SIGN_REQUEST_ERROR: undefined | {
        handler: BeaconEventHandlerFunction<{
            errorResponse: ErrorResponse;
            walletInfo: WalletInfo;
        }>;
    }
  • SIGN_REQUEST_SENT: undefined | {
        handler: BeaconEventHandlerFunction<RequestSentInfo>;
    }
  • SIGN_REQUEST_SUCCESS: undefined | {
        handler: BeaconEventHandlerFunction<{
            connectionContext: ConnectionContext;
            output: SignPayloadResponse;
            walletInfo: WalletInfo;
        }>;
    }
  • SIMULATED_PROOF_OF_EVENT_CHALLENGE_REQUEST_ERROR: undefined | {
        handler: BeaconEventHandlerFunction<{
            errorResponse: ErrorResponse;
            walletInfo: WalletInfo;
        }>;
    }
  • SIMULATED_PROOF_OF_EVENT_CHALLENGE_REQUEST_SENT: undefined | {
        handler: BeaconEventHandlerFunction<RequestSentInfo>;
    }
  • SIMULATED_PROOF_OF_EVENT_CHALLENGE_REQUEST_SUCCESS: undefined | {
        handler: BeaconEventHandlerFunction<{
            account: AccountInfo;
            blockExplorer: BlockExplorer;
            connectionContext: ConnectionContext;
            output: SimulatedProofOfEventChallengeResponse;
            walletInfo: WalletInfo;
        }>;
    }
  • UNKNOWN: undefined | {
        handler: BeaconEventHandlerFunction<undefined>;
    }
featuredWallets?: string[]

The wallets that will be featured in the UI.

iconUrl?: string

A URL to the icon of the application

matrixNodes?: NodeDistributions

A list of matrix nodes to connect to. If a non-empty array is passed, the default options will be overwritten. One node will be randomly selected based on the local keypair and the other nodes will be used as a fallback in case the primary node goes down.

Only provide the hostname, no https:// prefix. Eg. { [Regions.EU1]: ['matrix.example.com'] }

name: string

Name of the application

network?: Network

Indicates on which network the DApp is running on.

preferredNetwork?: NetworkType

Deprecated

Please use "network" instead. Indicates on which network the DApp is planning to run. This is currently used to adjust the URLs of web-wallets in the pairing alert if they use different URLs for testnets. You will still have to define the network you intend to use during the permission request.

storage?: Storage

The storage that will be used by the SDK

walletConnectOptions?: RequireAtLeastOne<{
    projectId?: string;
    relayUrl?: string;
}, "projectId" | "relayUrl">

Configuration that is passed to the WalletConnect transport.

This is required to enable WalletConnect connections.

Type declaration

  • Optional projectId?: string

    The projectId of the application. Has to be obtained from https://cloud.walletconnect.com/

  • Optional relayUrl?: string

    The relay server to connect to

Generated using TypeDoc