Skip to main content

Create Smart Contract Wallet

Initialization

The init method is a fundamental feature of the Fuse Wallet Flutter SDK that enables you to setup a wallet & authenticate the user's provided credentials. The method requires the use of a PRIVATE_KEY which you can get in the Fuse Developer Console here. When you send a request to the server using this method, it verifies the credentials and if the credentials are valid, developers can use the getSender() to return an address.

//Enter your Fuse Developer API Key
final apiKey = 'API_KEY';

// Generate a random Ethereum private key
final String privateKey = await Mnemonic.generatePrivateKey();
final EthPrivateKey credentials = EthPrivateKey.fromHex(privateKey);

final fuseSDK = await FuseSDK.init(apiKey, credentials);

Access the wallet

// Create Wallet
final smartContractAddress = fuseSDK.wallet.getSender();
print('Smart contract wallet address: $smartContractAddress');

Code example

For more code examples on using the Fuse Wallet SDK for Creating Address using Flutter, you can check out the official Flutter SDK repository.

Was this page helpful?