zPass docs
  • zPass
    • Introduction
    • Quickstart
    • Background
    • Benefits & Use Cases
    • Technical Foundations
    • System Participants
    • Powered by Aleo
  • Fundamentals
    • Issuer
    • Holder
    • Verifier
    • Off-chain flow
    • On-chain flow
    • Local Execution with WASM
  • ZPass Programs
    • Background
    • Verify offchain program
    • zPass issuance program
    • zPass hiding program
    • zPass invalidate program
    • zPass invalidate hiding program
    • zPass merkle tree size 8 program
  • ZPass SDK
    • Methods References
      • constructor
      • setNewHost
      • issueZPass
      • getZPassRecord
      • proveOnChain
      • proveOffChain
      • verifyOnChain
      • verifyOffChain
      • signCredential
      • initThreadPool
      • createAleoWorker
      • getMerkleRoot
      • getMerkleTree
      • getMerkleProof
      • getLeavesHashes
      • signMerkleRoot
  • Example Usage
    • Step-by-step Guide
Powered by GitBook
On this page
  • Description
  • Parameters
  • Returns
  • Example
  1. ZPass SDK
  2. Methods References

issueZPass

Description

The issueZPass method allows you to issue a new ZPass credential on-chain. This method handles the on-chain interaction for creating a new ZPass credential.

Parameters

  • options (OnChainOptions): An object containing the necessary parameters for on-chain interaction:

    • programName (string): The Aleo program name

    • functionName (string): Name of the function to execute

    • inputs (string[]): Array of input parameters for the function

    • fee (number): Transaction fee in microcredits

    • privateFee (boolean): Whether to use private fee

    • feeRecord (string, optional): Record for private fee payment if private fee is used

Returns

Returns a Promise that resolves to a string containing the transaction ID of the issued ZPass.

  • transactionId (string): The transaction ID of the issued ZPass

Example

const transactionId = await zpass.issueZPass({
    programName,
    functionName: functionName,
    inputs: [signature, `{
      issuer: ${issuer},
      subject: ${subject},
      dob: ${dob},
      nationality: ${nationality},
      expiry: ${expiry}
    }`,
      `{ salt: ${salt} }`,
    ],
    fee: 300000,
    privateFee: false,
  });
PrevioussetNewHostNextgetZPassRecord

Last updated 4 months ago