Migration to Lit and AA
  • Overview
  • Getting Started
    • Installation
    • Deployment
    • FAQ
  • Reference
    • Onboarding and Wallet SDK
      • Concepts
      • Wagmi config
      • @tria-sdk/core
        • Auth Controller [INTERNAL]
        • User Controller
      • @tria-sdk/web [INTERNAL]
        • Lit Controller
        • Keyring Controller
        • Wallet Controller
        • Gas Abstraction Wallet Controller ⛽️
        • Fee Controller
        • Solana Wallet
        • WalletConnect Controller
        • 🚂Execution Engine Controller
      • @tria-sdk/connect
        • TriaProvider
        • Actions
        • Hooks
          • Internal hooks
        • Constants [Internal]
      • @tria-sdk/authenticate
        • Application
      • @tria-sdk/authenticate-web
    • Supported Networks
    • How to create Debridge Solana Calldata
    • New concepts [Internal]
    • Gas Abstraction Integrations [Internal]
  • EIP1193 - Provider (WIP)
Powered by GitBook
On this page
  • Create a instance
  • Example
  1. Reference
  2. Onboarding and Wallet SDK
  3. @tria-sdk/connect

TriaProvider

This class helps to use all the outside functions/actions for all chain interactions, adding all config at one place.

Create a instance

import { TriaProvider } from "@tria-sdk/connect";

export const triaProvider = new TriaProvider({
  authUrl: "https://auth.tria.so",
  environment: "mainnet",
  aa: {
    supportAa: true,
    pimlicoApiKey: <API_KEY>,
    accountType: "Kernel",
    isSponsored: true,
    sponsorshipPolicyIds: {
      FUSE: "sp_cheerful_thing",
      POLYGON: "sp_slim_namor",
    },
  },
} as TriaProviderParams);
export type TriaProviderParams = {
  authUrl?: string;
  dappDomain?: string;
  dappLogo?: string;
  aa?: AaDetails;
  environment?: ENV;
};
export type AaDetails = {
  supportAa: boolean;
  pimlicoApiKey?: string;
  isSponsored?: boolean;
  accountType?: AaAccountType;
  sponsorshipPolicyId?: string;
  sponsorshipPolicyIds?: ChainNameToPolicyId; // {FUSE: "sp_fuse_id", POLYGON: "sp_poly_id"}
};

export type AaAccountType = "Simple" | "Kernel" | "Safe" | "Biconomy";

Example

const { success, data: signature, message: errorMsg } = await triaProvider.signMessage({
    message: "Sign in with Tria",
    chainName: "FUSE",
});
Previous@tria-sdk/connectNextActions

Last updated 1 year ago