This class represents a user in the system. It includes properties and methods that allow users to:

  • Perform transactions.
  • Manage balances.
  • Interact with the provider.

Hierarchy

  • User

Constructors

  • Remarks

    • The User class is designed to work with a provider, which must be passed in as an argument during instantiation.
    • It also takes an optional account parameter, which represents the user's account.
    • The User class includes methods to transact with parameters, retrieve balance information, store data, and more.

    Throws

    UserError

    • If no wallet is provided in the provider.
    • If the provider is not properly initialized.
    • If there is no app-enabled verifier defined when an appUtxoConfig is provided.

    Parameters

    • __namedParameters: {
          account: Account;
          appUtxoConfig?: AppUtxoConfig;
          provider: Provider;
          serialiezdSpentUtxos?: Buffer;
          serializedUtxos?: Buffer;
          transactionNonce?: number;
          verifierIdl?: Idl;
      }
      • account: Account
      • Optional appUtxoConfig?: AppUtxoConfig
      • provider: Provider
      • Optional serialiezdSpentUtxos?: Buffer
      • Optional serializedUtxos?: Buffer
      • Optional transactionNonce?: number
      • Optional verifierIdl?: Idl

    Returns User

Properties

account: Account
appUtxoConfig?: AppUtxoConfig
approved?: boolean
balance: Balance
inboxBalance: InboxBalance
provider: Provider
recentTransaction?: Transaction
recentTransactionParameters?: TransactionParameters
seed?: string
transactionHistory?: UserIndexedTransaction[]
verifierIdl: Idl

Methods

  • Adds Unspent Transaction Outputs (UTXOs) to the user.

    Remarks

    • This method is intended to add UTXOs to the user.
    • This method may also be responsible for fetching UTXOs such that the user object is not occupied while fetching.
    • Furthermore, the implementation could include calculating the user's privacy score for unshielded transactions.
    • However, it's currently not implemented and will throw an error when called.
    • Future implementations should provide the functionality for adding UTXOs.

    Returns void

  • Async

    This method approves a transaction that is waiting to be executed.

    • Before invoking this method, createShieldTransactionParameters needs to be called to prepare the parameters for the transaction.
    • This method is primarily used to grant permissions for the transfer of SPL tokens before a shield transaction.

    Throws

    UserError:

    • If the createShieldTransactionParameters method was not called before invoking this method.
    • If the associated token account does not exist.
    • If there are insufficient token balance for the transaction.
    • If there was an error in approving the token transfer.

    Returns Promise<void>

    A promise that resolves when the approval is completed.

  • Async

    This method compiles and proves a transaction.

    • It is primarily used for creating privacy-preserving transactions on the Solana blockchain.
    • Before this method is invoked, the createShieldTransactionParameters method must be called to create the parameters for the transaction.

    Throws

    UserError:

    • If the createShieldTransactionParameters method was not called before invoking this method.

    Parameters

    • Optional appParams: any

      Optional parameters for a general application.

    Returns Promise<Transaction>

    A promise that resolves to the compiled and proven transaction.

  • Async

    This method asynchronously creates transaction parameters for a shield operation.

    • The shield operation is the process of hiding tokens in a privacy-preserving manner.
    • The method takes an options object with various properties for the operation.
    • The function performs various validations including checking if a public amount is provided, if the token is defined, and if the provider is set, among other validations. If the validations fail, an error is thrown.

    Throws

    UserError:

    • If the token is "SOL" and publicAmountSpl is provided.
    • If both publicAmountSpl and publicAmountSol are not provided.
    • If token is not defined but publicAmountSpl is provided.
    • If the provider is not set.
    • If the token is not supported or token account is defined for SOL.

    Parameters

    • options: {
          appUtxo?: AppUtxoConfig;
          mergeExistingUtxos?: boolean;
          message?: Buffer;
          minimumLamports?: boolean;
          publicAmountSol?: string | number | BN;
          publicAmountSpl?: string | number | BN;
          recipient?: Account;
          senderTokenAccount?: PublicKey;
          skipDecimalConversions?: boolean;
          token: string;
          utxo?: Utxo;
          verifierIdl?: Idl;
      }

      The configuration object for the operation.

      • Optional appUtxo?: AppUtxoConfig

        Optional configuration object for app-specific UTXO.

      • Optional mergeExistingUtxos?: boolean

        Optional flag to indicate whether to merge existing UTXOs. Default is true.

      • Optional message?: Buffer

        Optional message to include in the transaction.

      • Optional minimumLamports?: boolean

        Optional, if set, will add minimum SOL to the shielded amount. Default is true.

      • Optional publicAmountSol?: string | number | BN

        The amount of SOL to add to the shielded amount.

      • Optional publicAmountSpl?: string | number | BN

        The amount of tokens to shield.

      • Optional recipient?: Account

        Optional recipient account. If not set, will shield to self.

      • Optional senderTokenAccount?: PublicKey

        Optional token account to shield from, else derives ATA.

      • Optional skipDecimalConversions?: boolean

        Optional flag to skip decimal conversions for public amounts. Default is false.

      • token: string

        The type of the token to shield ("SOL", "USDC", "USDT").

      • Optional utxo?: Utxo

        Optional UTXO to include in the transaction.

      • Optional verifierIdl?: Idl

        Optional, the Interface Description Language (IDL) for the verifier.

    Returns Promise<TransactionParameters>

    A promise that resolves to the transaction parameters for the shield operation.

  • Async

    This method is used to create the transaction parameters for storing application UTXO.

    • It performs a series of checks and operations to generate the necessary parameters.
    • The method can handle both shielding and transfer actions.

    Throws

    UserError:

    • Throws an error if the required parameters are not provided or if the max storage message size is exceeded.

    Parameters

    • __namedParameters: {
          action: Action;
          amountSol?: BN;
          amountSpl?: BN;
          appUtxo?: Utxo;
          appUtxoConfig?: AppUtxoConfig;
          minimumLamports?: boolean;
          recipientPublicKey?: string;
          senderTokenAccount?: PublicKey;
          skipDecimalConversions?: boolean;
          stringUtxo?: string;
          token?: string;
      }
      • action: Action
      • Optional amountSol?: BN
      • Optional amountSpl?: BN
      • Optional appUtxo?: Utxo
      • Optional appUtxoConfig?: AppUtxoConfig
      • Optional minimumLamports?: boolean
      • Optional recipientPublicKey?: string
      • Optional senderTokenAccount?: PublicKey
      • Optional skipDecimalConversions?: boolean
      • Optional stringUtxo?: string
      • Optional token?: string

    Returns Promise<TransactionParameters>

    Promise which resolves to the created transaction parameters.

  • Async

    This method prepares the transaction parameters for a shielded transfer operation .i.e transfer method.

    • It first checks if at least one amount is provided and if the token is defined.
    • It then retrieves the token context, converts the amounts if required, and creates output UTXOs.
    • Finally, it retrieves the input UTXOs and creates transaction parameters using the getTxParams method of TransactionParameters.

    Parameters

    • params: {
          addInUtxos?: boolean;
          addOutUtxos?: boolean;
          amountSol?: string | number | BN;
          amountSpl?: string | number | BN;
          appUtxo?: AppUtxoConfig;
          inUtxos?: Utxo[];
          message?: Buffer;
          outUtxos?: Utxo[];
          recipient?: Account;
          skipDecimalConversions?: boolean;
          token?: string;
          verifierIdl?: Idl;
      }

      Object containing parameters for the transfer operation.

      • Optional addInUtxos?: boolean

        Whether to add in UTXOs to the transaction.

      • Optional addOutUtxos?: boolean
      • Optional amountSol?: string | number | BN

        The amount of SOL tokens to transfer.

      • Optional amountSpl?: string | number | BN

        The amount of SPL tokens to transfer.

      • Optional appUtxo?: AppUtxoConfig

        Configuration for the application UTXO.

      • Optional inUtxos?: Utxo[]
      • Optional message?: Buffer

        Buffer containing a message to be included in the transaction.

      • Optional outUtxos?: Utxo[]
      • Optional recipient?: Account

        The recipient of the transfer.

      • Optional skipDecimalConversions?: boolean

        Whether to skip decimal conversions.

      • Optional token?: string

        The token to be transferred.

      • Optional verifierIdl?: Idl

        An Interface Definition Language (IDL) for the verifier.

    Returns Promise<TransactionParameters>

    • A promise that resolves to the transaction parameters.
  • Async

    This method prepares transaction parameters for an unshield operation. This involves:

    • checking the token context, recipients, balances, and UTXOs.
    • It eventually calls TransactionParameters.getTxParams to get the final transaction parameters.
    • The recent transaction parameters are then updated with the result.

    Parameters

    • params: {
          minimumLamports?: boolean;
          publicAmountSol?: string | number | BN;
          publicAmountSpl?: string | number | BN;
          recipientSol?: PublicKey;
          recipientSpl?: PublicKey;
          token: string;
      }

      Object containing parameters for the unshield operation.

      • Optional minimumLamports?: boolean

        Optional flag to indicate whether to use minimum lamports or not.

      • Optional publicAmountSol?: string | number | BN

        The amount of SOL to unshield.

      • Optional publicAmountSpl?: string | number | BN

        The amount of SPL to unshield.

      • Optional recipientSol?: PublicKey

        Recipient of the SOL token. Defaults to AUTHORITY.

      • Optional recipientSpl?: PublicKey

        Recipient of the SPL token. Defaults to AUTHORITY.

      • token: string

        The token to be unshielded.

    Returns Promise<TransactionParameters>

    • A promise that resolves to the transaction parameters.
  • Parameters

    • __namedParameters: {
          action: Action;
          appUtxo: Utxo;
          outUtxos?: Utxo[];
          programParameters: any;
          recipient?: Account;
      }
      • action: Action
      • appUtxo: Utxo
      • Optional outUtxos?: Utxo[]
      • programParameters: any
      • Optional recipient?: Account

    Returns Promise<{
        response: AxiosResponse<any, any>;
        txHash: string;
    }>

  • Returns an array of all UTXOs (unspent transaction outputs) across all tokens in the balance.

    • This method aggregates all UTXOs across all tokens stored in the balance of the user's account.
    • It's a utility method that can be used whenever you need to get an overview of all UTXOs the user has.

    Returns Utxo[]

    An array of Utxo objects.

  • Async

    This method retrieves the current balance of the user's account. If the latest parameter is set to true (which is the default), it will sync the state of the balance before returning it.

    Note

    This function checks if the necessary components such as account, provider, Poseidon hasher, Merkle Tree, and Lookup Table are initialized. If any of these components are not initialized, an error will be thrown.

    Throws

    UserError:

    • If the account or the provider is not initialized.
    • If the Poseidon hasher, the Merkle Tree, or the Lookup Table is not initialized.

    Parameters

    • latest: boolean = true

      A flag to indicate whether to sync the state of the balance before returning it. Defaults to true.

    Returns Promise<Balance>

    A promise that resolves to the current balance of the user's account.

  • Parameters

    • __namedParameters: {
          aes?: boolean;
          asMap?: boolean;
          idl: Idl;
          latestBalance?: boolean;
          latestInboxBalance?: boolean;
      }
      • Optional aes?: boolean
      • Optional asMap?: boolean
      • idl: Idl
      • Optional latestBalance?: boolean
      • Optional latestInboxBalance?: boolean

    Returns Promise<{
        inboxProgramUtxoArray: undefined;
        inboxTokenBalances: undefined | Map<string, TokenUtxoBalance>;
        programUtxoArray: undefined;
        tokenBalances: undefined | Map<string, TokenUtxoBalance>;
    } | {
        inboxProgramUtxoArray: Utxo[];
        inboxTokenBalances?: undefined;
        programUtxoArray: Utxo[];
        tokenBalances?: undefined;
    }>

  • Async

    This method retrieves the transaction history of the user.

    • If the 'latest' parameter is true, it first gets the latest balance of the user.
    • The transaction history is then retrieved and returned.
    • If any error occurs during this process, it is caught and a UserError is thrown with a specific error code.

    Parameters

    • Optional latest: boolean = true

      Optional parameter indicating whether to get the latest balance. Defaults to true.

    Returns Promise<IndexedTransaction[]>

    • Returns a Promise that resolves to an array of indexed transactions.
  • Parameters

    • commitment: string
    • latest: boolean = false
    • Optional idl: Idl

    Returns Promise<undefined | {
        status: string;
        utxo: Utxo;
    }>

  • Async

    This method retrieves all the non-accepted UTXOs that are not part of the main balance.

    Note

    If the latest parameter is set to true (which is the default), it will sync the state of the inbox balance before returning it.

    Parameters

    • latest: boolean = true

      A flag to indicate whether to sync the state of the inbox balance before returning it. Defaults to true.

    Returns Promise<InboxBalance>

    A promise that resolves to the inbox balance containing all non-accepted UTXOs.

  • Retrieves the status of the Unspent Transaction Output (UTXO).

    Remarks

    • This method is intended to retrieve the status of the Unspent Transaction Output (UTXO).
    • However, it's currently not implemented and will throw an error when called.
    • Future implementations should provide the functionality for fetching and returning the UTXO status.

    Returns void

  • Async

    Merges all UTXOs (Unspent Transaction Outputs) for a specific asset.

    • This method retrieves the UTXO inbox and balance of the user for the specified asset.
    • If the inbox for the asset is empty, it throws an error.
    • Otherwise, it retrieves the UTXOs from the balance and inbox. If the total number of UTXOs is greater than 10, it selects only the first 10.
    • It then prepares transaction parameters for a TRANSFER action and performs the transaction.
    • Finally, it updates the Merkle tree and returns the transaction hash and the response of the update.

    Parameters

    • asset: PublicKey

      The public key of the asset whose UTXOs are to be merged.

    • Optional latest: boolean = true

      Optional parameter indicating whether to get the latest UTXO inbox and balance. Defaults to true.

    Returns Promise<{
        response: AxiosResponse<any, any>;
        txHash: string;
    }>

    • Returns a Promise that resolves to an object containing the transaction hash and the response of the update to the Merkle tree.
  • Async

    Performs a shielded transfer to self, merging UTXOs in the process.

    • This method retrieves the UTXO inbox and balance of the user for the specified asset.
    • It validates the commitments provided, and if any are not found in the UTXO inbox, it throws an error.
    • It then retrieves the UTXOs from the balance and the commitments.
    • If the total number of UTXOs is greater than 10, it throws an error.
    • Otherwise, it prepares transaction parameters for a TRANSFER action and performs the transaction.
    • Finally, it updates the Merkle tree and returns the transaction hash and the response of the update.

    Parameters

    • commitments: string[]

      An array of commitment strings for merging.

    • asset: PublicKey

      The public key of the asset whose UTXOs are to be merged.

    • Optional latest: boolean = false

      Optional parameter indicating whether to get the latest UTXO inbox and balance. Defaults to false.

    Returns Promise<{
        response: AxiosResponse<any, any>;
        txHash: string;
    }>

    • Returns a Promise that resolves to an object containing the transaction hash and the response of the update to the Merkle tree.
  • Async

    This method sends a transaction that has been compiled and approved, and waits for confirmation of the transaction.

    Note

    This method is primarily used to execute a shield transaction involving SPL tokens.

    Throws

    UserError:

    • If SPL funds are not approved before invoking this method for a shield transaction.
    • If the transaction is not compiled and proof is not generated before calling this method.
    • If there was an error in sending and confirming the transaction.

    Returns Promise<string>

    A promise that resolves to the transaction hash when the transaction is confirmed.

  • Async

    This method processes a shield operation.

    Remarks

    This method performs a shield operation, which involves:

    • creating transaction parameters
    • compiling and proving the transaction
    • approving the transaction
    • sending and confirming the transaction
    • finally updating the Merkle tree.

    Parameters

    • params: {
          appUtxo?: AppUtxoConfig;
          minimumLamports?: boolean;
          publicAmountSol?: string | number | BN;
          publicAmountSpl?: string | number | BN;
          recipient?: string;
          senderTokenAccount?: PublicKey;
          skipDecimalConversions?: boolean;
          token: string;
      }

      Object containing parameters for the shield operation.

      • Optional appUtxo?: AppUtxoConfig

        Optional application UTXO configuration.

      • Optional minimumLamports?: boolean

        Optional flag to indicate whether to use minimum lamports or not.

      • Optional publicAmountSol?: string | number | BN

        Optional extra SOL amount to add to the shielded amount.

      • Optional publicAmountSpl?: string | number | BN

        The amount to shield, e.g., 1 SOL = 1, 2 USDC = 2.

      • Optional recipient?: string

        Optional recipient account. If not set, the operation will shield to self.

      • Optional senderTokenAccount?: PublicKey

        Optional sender's token account. If set, this account will be used to shield from, else derives an ATA.

      • Optional skipDecimalConversions?: boolean

        Optional flag to skip decimal conversions.

      • token: string

        The token to be shielded, e.g., "SOL", "USDC", "USDT".

    Returns Promise<{
        response: AxiosResponse<any, any>;
        txHash: string;
    }>

    • A promise that resolves to an object containing the transaction hash and the response from updating the Merkle tree.
  • Async

    This method is used to store the application UTXO.

    • It creates the transaction parameters using the provided parameters.
    • Then performs the transaction with the created parameters.
    • The method can handle both shielding and transfer actions.

    Parameters

    • __namedParameters: {
          action: Action;
          amountSol?: BN;
          amountSpl?: BN;
          appUtxo?: Utxo;
          appUtxoConfig?: AppUtxoConfig;
          minimumLamports?: boolean;
          recipientPublicKey?: string;
          senderTokenAccount?: PublicKey;
          skipDecimalConversions?: boolean;
          stringUtxo?: string;
          token?: string;
      }
      • action: Action
      • Optional amountSol?: BN
      • Optional amountSpl?: BN
      • Optional appUtxo?: Utxo
      • Optional appUtxoConfig?: AppUtxoConfig
      • Optional minimumLamports?: boolean
      • Optional recipientPublicKey?: string
      • Optional senderTokenAccount?: PublicKey
      • Optional skipDecimalConversions?: boolean
      • Optional stringUtxo?: string
      • Optional token?: string

    Returns Promise<{
        response: AxiosResponse<any, any>;
        txHash: string;
    }>

    Promise which resolves to the response of the transaction with the created parameters.

  • Stores a data message as a UTXO (unspent transaction output) in the user's account.

    • If the shield flag is set to true, it creates a shield transaction parameter using the data message.
    • If the shield flag is set to false, it attempts to find a UTXO with a non-zero SOL balance and creates a transfer transaction parameter using the data message.
    • The transaction parameters are then used to carry out the transaction.

    Throws

    UserError

    • If the size of the message exceeds the maximum allowed message size.
    • If no UTXO with sufficient SOL balance is found.

    Parameters

    • message: Buffer

      A Buffer object containing the data to be stored.

    • shield: boolean = false

      A boolean flag indicating whether to use the shield action for storing the data.

    Returns Promise<{
        response: AxiosResponse<any, any>;
        txHash: string;
    }>

    The result of the transaction.

  • Async

    This method updates the balance state by identifying spent UTXOs and decrypting new UTXOs.

    • It iterates through the UTXOs in the balance and moves spent UTXOs to spentUtxos.
    • It then fetches indexed transactions, decrypts the new UTXOs and adds them to the balance.
    • Finally, it calculates the total Solana balance and updates the balance object.

    Throws

    UserError: When the provider is undefined or not initialized.

    Parameters

    • aes: boolean = true

      A flag to indicate whether AES encryption is used. Defaults to true.

    • balance: Balance | InboxBalance

      The balance to be updated. It can be either a Balance or an InboxBalance.

    • merkleTreePdaPublicKey: PublicKey

      The public key of the Merkle Tree PDA.

    Returns Promise<Balance | InboxBalance>

    A promise that resolves to the updated balance. It can be either a Balance or an InboxBalance.

  • This method is used to sync the storage of the user account.

    • It gets all transactions of the storage verifier.
    • Filters for the ones including noop program.
    • Then it builds the merkle tree and checks versus root on-chain.

    Note

    • The method tries to decrypt each transaction and adds it to the appUtxos or decrypted data map.

    Parameters

    • idl: Idl

      The Interface Description Language (IDL) for the program.

    • aes: boolean = true

      A flag indicating whether to use AES for decryption. Default is true.

    • Optional merkleTree: PublicKey

      The public key of the Merkle tree.

    Returns Promise<undefined | Map<string, ProgramUtxoBalance>>

    A promise which resolves to the balances of the programs after synchronization.

  • Async

    This method performs a transaction using the provided transaction parameters.

    • It first sets the recent transaction parameters, compiles and proves the transaction, approves it, sends it and confirms it, and then updates the Merkle tree.
    • The method returns the transaction hash and the response from updating the Merkle tree.

    Parameters

    • params: {
          appParams?: any;
          txParams: TransactionParameters;
      }

      Object containing the transaction parameters.

      • Optional appParams?: any

        Additional parameters for the application.

      • txParams: TransactionParameters

        The parameters for the transaction.

    Returns Promise<{
        response: AxiosResponse<any, any>;
        txHash: string;
    }>

    • A promise that resolves to an object containing the transaction hash and the response from updating the Merkle tree.
  • Async

    This method is intended to perform a transaction using the provided input and output UTXOs and the specified action.

    Note

    Currently, this method is not implemented and will throw an error if called.

    Parameters

    • params: {
          action: Action;
          inUtxoCommitments: string[];
          inUtxos: Utxo[];
          outUtxos: Utxo[];
      }

      Object containing the transaction parameters.

      • action: Action

        The type of action being performed by this transaction (e.g., TRANSFER, SHIELD, UNSHIELD).

      • inUtxoCommitments: string[]

        The commitments of the input UTXOs.

      • inUtxos: Utxo[]

        The UTXOs that are being spent in this transaction.

      • outUtxos: Utxo[]

        The UTXOs that are being created by this transaction.

    Returns Promise<void>

  • Async

    This method initiates a shielded transfer operation.

    • It first checks if the recipient is provided
    • Then creates transaction parameters using the createTransferTransactionParameters method.
    • It then calls transactWithParameters with the obtained parameters.

    Parameters

    • params: {
          amountSol?: string | number | BN;
          amountSpl?: string | number | BN;
          appUtxo?: AppUtxoConfig;
          recipient: string;
          token: string;
      }

      Object containing parameters for the transfer operation.

      • Optional amountSol?: string | number | BN

        The amount of SOL tokens to transfer.

      • Optional amountSpl?: string | number | BN

        The amount of SPL tokens to transfer.

      • Optional appUtxo?: AppUtxoConfig

        Configuration for the application UTXO.

      • recipient: string

        The recipient of the transfer.

      • token: string

        The token to be transferred.

    Returns Promise<{
        response: AxiosResponse<any, any>;
        txHash: string;
    }>

    • A promise that resolves to the result of the transaction with the parameters.
  • Async

    This method processes an unshield operation.

    Remarks

    This method performs an unshield operation, which involves:

    • creating transaction parameters
    • compiling and proving the transaction
    • sending and confirming the transaction
    • finally updating the Merkle tree.

    Parameters

    • params: {
          minimumLamports?: boolean;
          publicAmountSol?: string | number | BN;
          publicAmountSpl?: string | number | BN;
          recipientSol?: PublicKey;
          recipientSpl?: PublicKey;
          token: string;
      }

      Object containing parameters for the unshield operation.

      • Optional minimumLamports?: boolean

        Optional flag to indicate whether to use minimum lamports or not.

      • Optional publicAmountSol?: string | number | BN

        The amount of SOL to unshield.

      • Optional publicAmountSpl?: string | number | BN

        The amount of SPL to unshield.

      • Optional recipientSol?: PublicKey

        Recipient of the SOL token. Defaults to AUTHORITY.

      • Optional recipientSpl?: PublicKey

        Recipient of the SPL token. Defaults to AUTHORITY.

      • token: string

        The token to be unshielded.

    Returns Promise<{
        response: AxiosResponse<any, any>;
        txHash: string;
    }>

    • A promise that resolves to an object containing the transaction hash and the response from updating the Merkle tree.
  • Async

    This method updates the Merkle tree. After updating, it resets the recent transaction parameters and approval status.

    Remarks

    This method is primarily used to update the state of the Merkle tree after a transaction. It uses the provider's relayer to update the Merkle tree and resets the transaction-related state.

    Returns Promise<AxiosResponse<any, any>>

    A promise that resolves when the Merkle tree update request to the relayer is complete.

  • Async

    This method asynchronously initializes a User instance.

    • This method initializes a User instance by using the provided Light provider, optional user seed and UTXOs, application UTXO configuration, and account.
    • If no seed is provided, a signature prompt will appear for login. If no Poseidon function is provided, it will build one. If no account is provided, it will create a new one with the given Poseidon function and seed.
    • After initializing the user, it will retrieve the user's balance.

    Throws

    UserError:

    • Throws a UserError if no wallet is provided or if there is an error while loading the user.

    Parameters

    • params: {
          account?: Account;
          appUtxoConfig?: AppUtxoConfig;
          provider: Provider;
          seed?: string;
          utxos?: Utxo[];
      }

      Object containing the initialization parameters.

      • Optional account?: Account

        Optional account to be used.

      • Optional appUtxoConfig?: AppUtxoConfig

        Optional application UTXO configuration.

      • provider: Provider

        The Light provider to be used.

      • Optional seed?: string

        Optional user seed to instantiate from. If the seed is supplied, it skips the log-in signature prompt.

      • Optional utxos?: Utxo[]

        Optional user UTXOs (Unspent Transaction Outputs) to instantiate from.

    Returns Promise<any>

    • Returns a Promise that resolves to the initialized User instance.

Generated using TypeDoc