Home

Smart accounts

Create Smart Account with third-party Signer

It's possible to use third-party "wallet services" as signers for smart accounts. The end result is that your users will be interacting with the wallet UIs provided by these services, while using a smart account powered by Openfort.

note

Openfort creates smart accounts direcly embedded with the Openfort signer. Follow these steps to use third party signers as the owners of a deployed smart account.

Installation#

First, install the Openfort SDK:

command-line

_10
npm install @openfort/openfort-node

1. Create a smart account#

  • Decide on the type of smart account you want to create. Options include: ERC6551V1, UpgradeableV5 (default)
  • Create a signer that will be the external owner of the smart account. This is related to the externalOwnerAddress parameter.

The externalOwnerAddress needs to be the address of the signer provided by the third-party wallet service.

server.ts

_10
// Set your secret key. Remember to switch to your live secret key in production.
_10
// See your keys here: https://dashboard.openfort.xyz/apikeys
_10
const Openfort = require('@openfort/openfort-node').default;
_10
const openfort = new Openfort(YOUR_SECRET_KEY);
_10
_10
const player = await openfort.accounts.create({
_10
chainId: 80002,
_10
externalOwnerAddress: '0xbed6a05ce8719bc00db1cc81a814192c82be1bb1',
_10
accountType: 'UpgradeableV5' // Optional, defaults to UpgradeableV5
_10
})

Next Steps#

For more detailed information and advanced usage, refer to the Openfort API documentation.