Skip to main content

Which wallets are right for my use case?

In order to let your users access DeFi, they will need an -compatible wallet. There are plenty of considerations when selecting a wallet schema that works for you:
  • Who will maintain custody of funds?
  • What permissions must exist for my use case?
  • Where in my stack should transaction signatures originate?
  • How can my users on and off ramp funds?
Actions SDK supports popular embedded wallet providers to address all of these questions while remaining flexible to your use case.

Embedded Wallet Providers

Embedded wallet providers give your users the ability to sign onchain transactions through your app’s existing email authentication and authorization flows. Actions works with:
https://mintcdn.com/optimism-373f39ad-feat-swap-documentation/VFj3KHIP5uIpEDS-/public/img/actions/Privy.png?fit=max&auto=format&n=VFj3KHIP5uIpEDS-&q=85&s=183f16ff57d6430de3703e9004763bb3

Privy

https://mintcdn.com/optimism-373f39ad-feat-swap-documentation/VFj3KHIP5uIpEDS-/public/img/actions/turnkey.png?fit=max&auto=format&n=VFj3KHIP5uIpEDS-&q=85&s=db624156d70e541a17d00bb898930f07

Turnkey

https://mintcdn.com/optimism-373f39ad-feat-swap-documentation/VFj3KHIP5uIpEDS-/public/img/actions/dynamic.png?fit=max&auto=format&n=VFj3KHIP5uIpEDS-&q=85&s=892fb5fee702b69f75e69ae3dce10ddd

Dynamic

Gas Sponsorship

Signing and sending onchain transactions requires gas, or fee payment, which adds additional overhead for you and friction for users. Actions supports gas sponsorship via a combination of smart contract wallets and paymasters. First, configure a paymaster in the chain config by specifying a bundler url. Now, any transactions submitted via an actions SmartWallet on that chain will automatically use your paymaster, therefore eliminating the need for the wallet to pay gas.

Connect your wallet to Actions

Regardless of where and how transactions are signed, Actions has you covered.
1

Choose a wallet provider

Follow embedded wallet provider documentation and installation steps. Actions works with Typescript clients, both frontend React and backend Node.
2

Import Actions SDK

Import Actions SDK alongside your chosen wallet provider SDK.
3

Create and fetch embedded user wallets

Follow embedded wallet provider documentation for wallet creation and access.
4

Pass the wallet to Actions

Call actions.wallet.toActionsWallet(...), and pass in the provider wallet.
5

Take Action

The returned Wallet is now capable of calling Actions functions like Lend, Swap, Borrow, and Pay!
// Lend tokens
const lendReceipt = await wallet.lend.openPosition({ ... });

// Swap tokens via Uniswap or Velodrome/Aerodrome
const swapReceipt = await wallet.swap.execute({
  amountIn: 100,
  assetIn: USDC,
  assetOut: ETH,
  chainId: base.id,
});

Wallet Namespaces

Once you have an Actions wallet, it exposes DeFi operations through namespaces:
NamespaceDescriptionReference
wallet.lendOpen, close, and query lending positions via Morpho, Aave, and moreLend Documentation
wallet.swapSwap tokens via Uniswap V4 and Velodrome/AerodromeSwap Documentation
wallet.getBalance()Get wallet token balancesWallet Documentation
wallet.send()Send tokens to an addressComing soon
wallet.borrowOpen and close borrow positionsComing soon

Smart wallets & signers

In addition to using embedded provider wallets directly, Actions supports the creation of custom smart contract wallets. This additional wallet type is separate from, but still controlled by the owner of the embedded wallet. If you configure it, Actions will deploy a EIP-4337 compliant Coinbase Smart Wallets on the chains you’ve chosen to support. Once created, an embedded wallet can be added as a signer on the smart wallet, capable of signing transactions on behalf of the Smart Wallet. See Wallet Documentation for additional details.