Private ERC-20 Transfers

Private Transfers require you to "Generate Proof" and, optionally, make use of "Relayers": See UX for Private Transactions

RAILGUN users may transfer multiple ERC-20 tokens to other RAILGUN users in a single transaction, in a fully encrypted and privacy-preserving way.

Imports


import {
  calculateGasPrice,
  NetworkName,
  TXIDVersion,
  type FeeTokenDetails,
  type RailgunERC20AmountRecipient,
  type RailgunWalletInfo,
  type TransactionGasDetails,
} from "@railgun-community/shared-models";
import {
  gasEstimateForUnprovenTransfer,
  generateTransferProof,
  populateProvedTransfer,
} from "@railgun-community/wallet";
import {
  getGasDetailsForTransaction,
  getOriginalGasDetailsForTransaction,
  serializeERC20Transfer,
} from "../util";
import { TEST_NETWORK, TEST_TOKEN } from "../../utils/constants";
import { getProviderWallet } from "../../utils/provider";
import {
  getBroadcasterDetails,
  getBroadcasterFeeRecipientDetails,
  getFeeTokenDetails,
} from "../../waku/waku";

Gas Estimate

Generate Proof

Populate Transaction

Example Usage

Last updated