New concepts [Internal]

To understand the requirement of new AA fields added, and default state of all fields, and different flows for different options chosen.

npm install --save @tria-sdk/web-test@5.4.102

So, there is AA supported chain, and chains which won't support AA.

  • For a transaction, always the default wallet for a AA supported chain is going to be a AA wallet.

    • On the basis of selected of wallet in the txn popup page, user can make txns from EOA wallet, for that selectedWallet type ("EOA" or "AA") needs to be passed explicitly to the FeeController, WalletController, getAssetDetails (...type: "EOA" | "AA").

  • For a transaction, for a non-AA supported chain, it will automatically transact from EOA wallet

  • Now dapps have the option to supportAa as a default wallet for their dapp users (or not), with walletType: { embedded: true, supportAa: true (or false) }

    • supportAa: true -> default wallet AA for all AA supported chains, EOA for non-AA supported chains.

    • supportAa: false -> default wallet EOA for all AA and non-AA supported chains.

    • Requirements: pass a pimlicoApiKey, uses Tria's pimlicoApiKey as default though

  • Now dapps have the option to add isSponsored flag (false by default) when supportAa: true

    • isSponsored: true -> sponsors all gas fees for their users

    • isSponsored: false -> will use a AA wallet but user have to have native tokens in their AA wallet address, first txn will deploy the smart wallet, with gas prefund from AA address

    • Requirements: pass sponsorshipPolicyIds chain specific, for chains the dapp wants to support sponsorship of gas for.

      • For chains for which sponsorshipPolicyId won't be passed, it defaults to non sponsored AA txns.

  • Optional, dapps also have the option to choose the accountType ("Simple" | "Kernel" | "Safe" | "Biconomy") they want to create for their users.

    • default, is Simple, will be Kernel later for Tria.

  • The wallet and auth has to pass all these fields to web controllers, i.e.,

    • WalletController (all fields),

    • FeeController (all fields),

    • LitAuthProvider (only supportAa, accountType needs to be passed, for login initSession),

    • KeyringController (only supportAa, accountType, for assignDid)

  • For wallet to identify between AA data and EOA data, all the asset/history responses have a type: "EOA" | "AA" returned in wallet: {name, address, type}

Last updated