@sudoplatform/sudo-virtual-cards
    Preparing search index...

    Class DefaultSudoVirtualCardsClient

    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

    Index

    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>

    • Returns Promise<ArrayBuffer>

    • 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>

    • Sets an optional callback to handle sign-in when operations are attempted while not signed in.

      When set, all operations (exception subscriptions and initialization/reset) will check sign-in status before performing their normal behavior. If the client is not signed in, the callback will be invoked to allow the host app to perform sign-in. Once the callback completes, then the client will attempt the original operation that triggered the callback. If the callback throws an error, then the error will be propagated to the caller and the original operation will not be attempted. To clear the callback, call this method with no arguments or undefined.

      Parameters

      • Optionalcallback: SudoPlatformSignInCallback

      Returns void

    • 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