Sudo Platform Virtual Cards client API

All methods should be expected to be able to throw the following errors defined in @sudoplatform/sudo-common:

NotSignedInError User not signed in. Sign in before performing the operation.

AccountLockedError Account has been locked. Contact support.

ServiceError Transient error at the service. Try the operation again

Implements

Constructors

Methods

  • Create key pair and secret key for use by the Virtual Cards Client if they have not already been created.

    The key pair is used to register a public key with the service for the encryption of virtual card and transaction details.

    The secret key is used for client side encryption of user specific card metadata.

    Returns Promise<CreateKeysIfAbsentResult>

  • Export the cryptographic keys to a key archive.

    Returns Promise<ArrayBuffer>

    Key archive data.

  • Imports cryptographic keys from a key archive.

    Parameters

    • archiveData: ArrayBuffer

      Key archive data to import the keys from.

    Returns Promise<void>

  • Removes any cached data maintained by this client.

    Returns Promise<void>

  • Request a review of an unfunded funding source, identified by id. Note that reviewing a funding source which is not unfunded will be a no-op but is not an error.

    Parameters

    • id: string

      The identifier of the funding source to review.

    Returns Promise<FundingSource>

    The funding source that was reviewed.

    FundingSourceNotFoundError No funding source matching the specified ID could be found.

  • Subscribe to changes to funding sources

    Parameters

    • id: string

      unique identifier to differentiate subscriptions; note that specifying a duplicate subscription id will replace the previous subscription.

    • subscriber: FundingSourceChangeSubscriber

      implementation of callback to be invoked when funding source change occurs

    Returns Promise<void>

  • Unsubscribe from changes to funding sources

    Parameters

    • id: string

      unique identifier to differentiate subscription

    Returns void