DFNS

Dfns is a cybersecurity company providing crypto wallet infrastructure. The company develops a wallet-as-a-service infrastructure in Web3. To use DFNS with expand.network SDK, follow these steps:-

Step 1: Installation

User needs to install the expand.network SDK using the following command:

npm i expand-network

Step 2: Wallet Initialisation

const { WalletDFNS , prepareTransaction } = require('expand-network');
async function initialiseDFNSWallet(){
    const options = {};
    options.privateKey = process.env.DFNS_PRIVATE_KEY;
    options.credId = process.env.DFNS_CRED_ID;
    options.xApiKey = process.env.X_API_KEY;
    options.appId = process.env.DFNS_APP_ID;
    options.authToken = process.env.DFNS_ACCESS_TOKEN;
    options.baseUrl = process.env.DFNS_API_URL;
    options.walletId = process.env.WALLET_ID;
    options.appOrigin = 'http://localhost:3000';
    const wallet  = await new WalletDFNS(options);
    return wallet;
}

const wallet = await initialiseDFNSWallet();    // Initialise the wallet client

Step 3: Prepare Transaction

Step 4: Sign Transaction

Step 5: Send Transaction

Sample code to perform a swap using DFNS:

Last updated