RAILGUN Reloaded
    Preparing search index...

    Type Alias BuildUnshieldParams

    Inputs for buildUnshield(): an ERC20 unshield, or a base-token unshield with ephemeralSigner.

    type BuildUnshieldParams = {
        walletId: string;
        encryptionKey: Uint8Array;
        tokenAddress: string;
        amount: bigint;
        recipient: string;
        transport: Transport;
        ephemeralSigner?: Ephemeral7702Signer;
        loadArtifact: (variant: ValidRailgunVariant) => Promise<Artifact>;
        publicClient: PublicClient;
    }
    Index
    walletId: string

    Wallet that spends the notes.

    encryptionKey: Uint8Array

    32-byte key used at wallet creation time.

    tokenAddress: string

    ERC20 token address with a valid EIP-55 checksum. A base-token unshield needs the wrappedNativeAddress of the network.

    amount: bigint

    Positive value of the unshield note, in token base units. The contract takes the unshield fee from this value.

    recipient: string

    Public 0x address that receives the tokens, or the native coin of a base-token unshield. Not a 0zk address.

    transport: Transport

    A broadcaster fee note can have another token than the unshield: the client then also spends notes of the fee token. A base-token unshield takes self-signed only.

    ephemeralSigner?: Ephemeral7702Signer

    Ephemeral signer from deriveEphemeral7702Signer, derived for the unshield chain. It makes a base-token unshield: tokenAddress must be the wrappedNativeAddress of the network, the unshield note pays the ephemeral address, and a type-4 RelayAdapt7702 execute in the ephemeral account unwraps the whole wrapped balance of that account and sends its whole native balance to recipient. The unshield leaves code and a nonce on the ephemeral account, so a later shield() with the same index throws ShieldEphemeralAddressUsedError. Run one unshield at a time for each ephemeral account: two overlapping unshields read the same execute nonce, and the second reverts.

    loadArtifact: (variant: ValidRailgunVariant) => Promise<Artifact>

    Return the circuit artifact for a variant, for example from @railgun-reloaded/ipfs-artifact-fetcher.

    publicClient: PublicClient

    Reads rootHistory on the RAILGUN proxy before proving. Its chain must be the unshield chain.