Integrating the front-end SDK

Quick-start guide to the Proven dApp Toolkit

Install @proven-network/proven-dapp-toolkit via package manager in your front-end codebase.

Update initialisation of RadixDappToolkit like so:

// Replace this:
import {
  RadixDappToolkit,
  RadixNetwork,
  createLogger,
} from '@radixdlt/radix-dapp-toolkit';

const radixDappToolkit = RadixDappToolkit({
  networkId: RadixNetwork.Stokenet,
  dAppDefinitionAddress: "account_tdx_2_12y7ue9sslrkpywpgqyu3nj8cut0uu5arpr7qyalz7y9j7j5q4ayhv6",
  logger: createLogger(2),
})

// With this:
import ProvenDappToolkit from '@proven-network/proven-dapp-toolkit';
import {
  RadixNetwork,
  createLogger,
} from '@radixdlt/radix-dapp-toolkit';

const [radixDappToolkit, provenDappToolkit] = ProvenDappToolkit({
  networkId: RadixNetwork.Stokenet,
  dAppDefinitionAddress: "account_tdx_2_12y7ue9sslrkpywpgqyu3nj8cut0uu5arpr7qyalz7y9j7j5q4ayhv6",
  logger: createLogger(2),
})

Ensure that your data request is asking for proofs for the persona (and optionally for the accounts)

radixDappToolkit.walletApi.setRequestData(
  // Persona proof is required - note the .withProof()
  DataRequestBuilder.persona().withProof(),
  // Accounts optional but should be proofed if business logic relies on token balances
  DataRequestBuilder.accounts().atLeast(1).withProof()
)

Last updated