Skip to content

Interfaces Available and its Uses

The SDK provides several interfaces, each serving different purposes. Here are the interfaces available and their uses:

Database: Provides CRUD operations on a database.

  • Methods:
    • create(collectionName: string, data: any): Promise<any>
    • read(collectionName: string, query: string): Promise<any>
    • update(collectionName: string, updateData: any, key: string): Promise<any>
    • delete(collectionName: string, query: string): Promise<any>
  • Usage: This interface is used for interacting with a database to perform create, read, update, and delete operations.

SkcCmsConnectOptions: Defines options for CMS connection.

  • Parameters:
    • email?: string
    • password?: string
    • apiKey?: string
  • Usage: This interface is used to specify the connection options when connecting to the CMS.

KeyPairDetails: Defines details of a cryptographic key pair.

  • Parameters:
    • privKey?: string
    • pubKey: string
    • address: string
    • xPrivKey?: string
    • xPubKey?: string
  • Usage: This interface is used to describe the details of a generated key pair.

KeyGenerationResult: Describes the result of key pair generation for Ethereum and Cosmos.

  • Parameters:
    • mnemonic: string | undefined
    • ethKeyPair: KeyPairDetails
    • cosmosKeyPair: KeyPairDetails
  • Usage: This interface is used to capture the result of generating key pairs, including the mnemonic and key pair details for Ethereum and Cosmos.

User: Interface for a User.

  • Parameters:
    • id: string
    • name: string | null (Optional)
    • userName: string
    • address: string | null (Optional)
    • publicKey: string | null (Optional)
    • extPublicKey: string | null (Optional)
    • signerOption: 'vault' | 'aws' | null (Optional)
    • roles: ('admin' | 'user')[] | null (Optional)
    • status: 'requested' | 'accepted' | null (Optional)
    • derivedKeys: (Optional)
      • key: (Optional)
        • pubKey: string | null
        • address: string | null
      • id: string | null
    • authorizations: (Optional)
      • privacyService: string | null
    • updatedAt: string
    • createdAt: string
    • enableAPIKey: boolean | null (Optional)
    • apiKey: string | null (Optional)
    • apiKeyIndex: string | null (Optional)
    • email: string
    • resetPasswordToken: string | null (Optional)
    • resetPasswordExpiration: string | null (Optional)
    • salt: string | null (Optional)
    • hash: string | null (Optional)
    • loginAttempts: number | null (Optional)
    • lockUntil: string | null (Optional)
    • password: string | null
  • Usage: This interface is used to define the structure of a user object within the system.

TradeTokenDetails: Defines the Trade Token details.

  • Parameters:
    • address: string
    • owner: string
    • name: string
    • symbol: string
    • decimals: number
    • totalSupply: string
    • balances: Record<string, string>[]
    • attachments: any[]
  • Usage: This interface is used to describe the details of a trade token.

PrivacyServiceGateway: Handles interactions with the Privacy Service.

  • Methods:
    • decrypt(cipherText: string, assetId: string, assetType: string): Promise<any>
  • Usage: This interface is used for decrypting messages using the privacy service.

PrivacyServiceConnectOptions: Defines connection options for the Privacy Service.

  • Parameters:
    • email?: string
    • password?: string
    • apiKey?: string
  • Usage: This interface is used to specify the connection options when connecting to the privacy service.

VaultClientOptions: Configuration for the Vault client.

  • Parameters:
    • pluginPath: string
    • vaultAddress: string
    • vaultToken: string
  • Usage: This interface is used to configure the Vault client.

ApiGatewayConfig: Configuration for API Gateway access.

  • Parameters:
    • apiId: string
    • stage: string
    • region: string
    • secretId: string
    • credentials:
      • accessKeyId: string
      • secretAccessKey: string
    • Usage: This interface is used to configure access to the API Gateway.

These interfaces are integral to the SDK, providing structured ways to interact with various components such as databases, CMS, cryptographic key management, and privacy services.