Privacy Routing SDK
How to use privacy-routing-sdk
You can use
privacy-routing-sdk
to transfer any FRC-20 asset (including FRA) on Findora Smart Chain from Address A to Address B, and remove the link between the two addresses. Both addresses can be classical user address or contract address.Note: Privacy Routing SDK can currently only be used on the Findora Forge Testnet. See network settings for RPC details and request Forge EVM testnet
FRA
tokens here.Below is a visual representation of the major flows when routing transactions which begins on the Findora EVM wallet through the Findora UTXO layer (to break the link between the sender and final Findora EVM wallet receiver).

Privacy Routing SDK Process Flow
Here is the process flow using the SDK's APIs:

Privacy Routing API Call Flow
- BAR
- Transparent Asset
- ABAR
- Shielded Asset (
{amount, asset type, address}
masked)
Import SDK
// Use appropriate ways to importing the privacy-routing-sdk
import { Sdk } from "privacy-routing-sdk";
const { Sdk } = require("privacy-routing-sdk");
Initiate SDK
import { Sdk } from "privacy-routing-sdk";
const ENV_CONFIG = {
hostUrl: "findora RPC",
};
// Initiating the SDK configuration
await Sdk.init(ENV_CONFIG);
- FRC20 (FRA token)
- FRC20 (Customized token)
- any FRC20 token on Findora EVM
Using privacy-routing-sdk for a complete confidential cross chain transaction by the following steps,
- (1) From
EVM compatible chain
toFindora Native Chain
- Bridging FRC20(FRA token) to Findora Native Chain
await evm.transfer.fraToBar({bridgeAddress: simBridgeAddress, // bridge contract addressrecipientAddress: "0x.....", // wallet account addressamount: "100", // send amount});- Bridging FRC20(Customized token) to Findora Native Chain
/*ParametersbridgeAddress: simBridge contract addresstokenAddress: FRC20 token addresstotalAmount: send amountrecipientAddress: wallet account address*/await evm.services.approveToken(tokenAddress, simBridgeAddress, tokenAmount);return await evm.transfer.frc20ToBar({bridgeAddress: simBridgeAddress,recipientAddress,tokenAddress,tokenAmount,}); - (2) Converting Assets from
BAR
toABAR
in Findora Native Chain (entering confidential cycle)
import { findora } from "privacy-routing-sdk";
/**
Parameters
sids: consumable utxo sids
*/
const walletWrap = await findora.keypair.getWallet();
findora.transfer.barToAbar(walletWrap, sids);
- (3) Converting Assets from
ABAR
toBAR
in Fidnora Native Chain (leaving confidential cycle)
import { findora } from "privacy-routing-sdk";
/**
Parameters
commitments: consumable Abar utxo sids
*/
const walletWrap = await findora.keypair.getWallet();
findora.transferabarToBar(
walletWrap.anonWallet,
walletWrap.walletEnd,
commitments
);
- (4) Bridging from
Findora Native Chain
toEVM Compatible chain
- Bridging FRC20 (FRA token) to Findora EVM
import { findora } from "privacy-routing-sdk";const walletWrap = await findora.keypair.getWallet();await findora.transfer.barToEVM(walletWrap.walletEnd,"100", // token amountrecipientAddress, // recipient's address"","",false);- Bridging FRC20 (Customized token) to Findora EVM
import { findora, evm } from "privacy-routing-sdk";const walletWrap = await findora.keypair.getWallet();const assetCode = await evm.services.getAssetCode(prismBridgeAddress,tokenAddress, // FRC20 token addressfindoraNetworkRpcUrl);await findora.transfer.barToEVM(walletWrap.walletEnd,"100", // token amountrecipientAddress, // recipient's addressassetCode,"",false);
import { Sdk } from 'privacy-routing-sdk';
import Web3 from 'web3';
export const ENV_CONFIG = {
hostUrl: 'https://prod-forge.prod.findora.org',
feeServerUrl: 'https://forge.invisiblex.org/api/fee',
configServerUrl: 'https://columbus-config.s3.us-west-2.amazonaws.com/columbus_config_forge.json',
navticeExplorerUrl: 'https://forge.findorascan.io/',
};
export const FINDORA_EVM_CHAIN_ID = '2154';
Sdk.init({ ...ENV_CONFIG, web3: new Web3(Web3.givenProvider) });
Last modified 2mo ago