FunWallet

Primary class in the FunWallet SDK that orchestrates the movement of assets & data

Overview

FunWallet is the main class of the FunWallet SDK, it is responsible for coordinating the movement of assets and data between modules. It also stores information relating to the Role Based Access Control (RBAC) schema of said wallet.

Constructor

FunWallet

new FunWallet(config, apiKey)

Parameters

config
FunWalletConfig
Required

The config specifying parameters like chain ID, prefund amount and creator EOA. View FunWalletConfig docs for more on this object.

apiKey
string
Required

Developer API key.




Methods

addModule

Adds a Module to a FunWallet.

addModule(module)

Parameters

module
Module
Required

A Module object to be connected to a FunWallet.

Returns

module
object

Object containing Module.init transaction data, to address & salt.



deploy

Deploys a FunWallet to a blockchain specified by the config input parameter to the FunWallet constructor.

deploy()

Parameters

No Parameters

Returns

receipt
object

Object containing transaction confirmation information.

address
string

The address of the deployed FunWallet.



deployTx

Deploys a Transaction to a blockchain.

deployTx(transaction)

Parameters

transaction
Transaction
Required

A Transaction object to be deployed to a blockchain.

Returns

receipt
object

Object containing transaction confirmation information.



deployTxs

Deploys multiple Transaction to a blockchain.

deployTx(transaction)

Parameters

transactions
[Transaction]
Required

An array of Transaction objects to be deployed to a blockchain.

Returns

receipts
[object]

An array of objects containing transaction confirmation information.



Properties

address

Get the FunWallet address.

this.address