Appendices

TypeScript Interfaces

UserOptions

The user options principally include the environment and the api key

export interface UserOptions {
    env: Environment; // ["PROD", "SANDBOX"]
    apiKeyPublic: string;
    bypassDeviceCheck?: boolean;
}

StringPayload

The string payload is used to pass all of the relevant data for a given transaction. It includes, among other things, the smart contract and function to be called to purchase the asset, as well as the asset's price.

export interface StringPayload {
    assetName: string;
    collection?: string;
    price: string;
    currency: string;
    imageSrc?: string;
    imageAlt?: string;
    chainID: number;
    userAddress: string;
    contractAddress: string;
    contractFunction: string;
    contractReturn: string;
    contractParameters: string[];
    txValue: string;
    gasLimit?: string;
}

SavedCardResponse

Saved Cards can be displayed to the user and optionally used as the payment method for transactions.

export interface SavedCardResponse {
    type: string;
    id: string;
    scheme: string;
    last4: string;
    expiryMonth: number;
    expiryYear: number;
    expired: boolean;
    cardType: string;
}

PaymentInfo

Payment Info is used to convey the user's card payment details to String

export interface PaymentInfo {
    cardToken?: string; // If a new card
  	saveCard?: boolean; // If a new card
    cardId?: string;    // If a previously saved card
    cvv?: string;       // If a previously saved card
}

TransactionResponse

Transaction Response includes relevant information about a completed transaction

export interface TransactionResponse {
    txID: string;
    txUrl: string;
    txTimestamp: string;
}