LinkedWallets

Offers functionalities for linking external wallets, adding or removing them as needed for a single managed user

📘

For more inspiration, check out these recipes involving managed users


addLinkedWalletForManagedUser(userId: string, wallet: AddLinkedWalletForManagedUserRequest)**:

Add a new linked wallet for a managed user

const userId = 'northstake_user_guuid'

const {body:linkedWallet:} AddLinkedWalletForManagedUserRequest = {
    walletType: TokenEnum.Eth,
    walletAddress: '0x1234567890'
  }

const { body: newWallet } = await api.managedUsersLinkedWallets.addLinkedWalletForUser(userId , linkedWallet)
  

deleteLinkedWalletForManagedUser(userId: string, walletAddress: string, type: TokenEnum)**:

Delete a linked wallet for a managed user

const userId = 'northstake_user_guuid'
const walletAddress= '0x12345'

await api.managedUsersLinkedWallets.deleteLinkedWalletForUser(userId , walletAddress, TokenEnum.Eth)

listLinkedWalletsForUser(userId: string)**:

List linked wallets for a managed user

const userId = 'northstake_user_guuid'
const  {body:wallets}  = await apii.managedUsersLinkedWallets.listLinkedWalletsForUser(userId)
  
for (const wallet of wallets) {
    console.log(wallet.walletAddress)
    console.log(wallet.walletType)
  }