Source

types/TransactionTypes.ts

import { SignatureHeaderAuthorization, TokenType } from "./CommonTypes";
import { SplitSignature } from "./OrderTypes";

/**
 * @typedef {Object} TransferAPIInput
 * @property {number} senderVaultId Vault ID of sender
 * @property {string} senderPublicKey Stark key of sender
 * @property {number} receiverVaultId Vault ID of receiver
 * @property {string} receiverPublicKey Stark key of receiver
 * @property {string} token Token hex string to be transfer
 * @property {number} nonce The nonce to identify the unique transactions
 * @property {number} expirationTimestamp Timestamp expiration for the transactions
 * @property {SplitSignature} signature Stark's signature includes r and s hex
 */
export interface TransferAPIInput {
  senderWalletAddress?: string;
  receiverWalletAddress?: string;
  senderVaultId: number;
  senderPublicKey: string;
  receiverVaultId: number;
  receiverPublicKey: string;
  token: string;
  quantizedAmount: string;
  nonce: number;
  expirationTimestamp: number;
  signature: SplitSignature;
  signatureHeader?: SignatureHeaderAuthorization | undefined;
}

/**
 * @typedef {Object} TransferAPIInput
 * @property {number} senderVaultId Vault ID of sender
 * @property {string} senderPublicKey Stark key of sender
 * @property {number} receiverVaultId Vault ID of receiver
 * @property {string} receiverPublicKey Stark key of receiver
 * @property {string} token Token hex string to be transfer
 * @property {number} nonce The nonce to identify the unique transactions
 * @property {number} expirationTimestamp Timestamp expiration for the transactions
 * @property {SplitSignature} signature Stark's signature includes r and s hex
 */
export interface BurnTransferAPIInput extends ItemsBurnTransferResponse {
  signature: SplitSignature;
}

/**
 * @typedef {Object} BulkTransferResponse
 * @property {number} senderWalletAddress Wallet address of sender
 * @property {string} receiverWalletAddress Wallet address of receiver
 * @property {number} senderVaultId Vault ID of sender
 * @property {string} senderPublicKey Public stark key of sender
 * @property {number} receiverVaultId Vault ID of receiver
 * @property {string} receiverPublicKey Public stark key of receiver
 * @property {string} token Token hex string to be transferred
 * @property {string} quantizedAmount Quantized amount for transferred token (calculated amount based Myria system rule)
 * + quantizedAmount = (amount * 10^18) / 10^10 (weiAmount/quantum)
 * + amount = quantizedAmount * 10^10 / 10^18 
 * @example <caption>Sample function convert to readable amount with Web3 lib</caption>
  function convertQuantizedAmountToNormalAmount(amount: string): string {
    const QUANTUM = 10000000000;
    if (!amount || Number(amount) === 0) {
      return '0';
    }
    const amountQuantum = Number(amount) * Number(QUANTUM);
    return Web3.utils.fromWei(
      String(amountQuantum.toLocaleString('fullwide', { useGrouping: false })),
    );
  }
 * @property {string} tokenId Token ID for the asset (if asset is NFTs)
 * @property {number} nonce The nonce to identify the unique transactions
 * @property {number} expirationTimestamp Timestamp expiration for the transactions
 * @property {SplitSignature} signature Stark's signature
 */
export interface BulkTransferItemResponse {
  senderWalletAddress?: string;
  receiverWalletAddress?: string;
  senderVaultId: number;
  senderPublicKey: string;
  receiverVaultId: number;
  receiverPublicKey: string;
  token: string;
  quantizedAmount: string;
  tokenId: string;
  nonce: number;
  expirationTimestamp: number;
  signature: SplitSignature;
}

export interface BulkTransferRequestAPI {
  requestId: string;
  groupRequestId: string;
  partnerRefId: string;
  description: string;
  items: TransferAPIInput[];
}

/**
 * @typedef {Object} TransferERC20Params
 * @property {string} senderWalletAddress Wallet address of sender
 * @property {string} senderPublicKey Public stark key of sender
 * @property {string} receiverPublicKey Public stark key of receiver
 * @property {string} tokenAddress Smart contract address of ERC-20 token
 * @property {string=} groupRequestId Unique group request ID for the transaction
 * @property {string=} partnerRefId Unique partner group request ID. Should be Project ID in Myria system
 * @property {string} quantizedAmount Quantized amount for transferred token (calculated amount based Myria system rule)
 * + If token type is ETH / ERC20 (ERC20, MINTABLE_ERC20)
 * + 1 - Converter for Quantized Amount: It is calculated based on standard rule: (amount * 10^18) / 10 ^ 10
 * + 2 - The calculate rule is convert the pure amount of token to WEI (10^10), then devide it to 10^10 (QUANTUM number defined between Myria and Starkware system)
 * @example <caption>Example of the converter</caption>
 * 
  function convertAmountToQuantizedAmount(amount: number | string): number {
    const wei = convertNormalAmountToWei(String(amount));
    const QUANTUM = '10000000000'; // 10^10
    return BigNumber.from(wei).div(BigNumber.from(QUANTUM)).toNumber();
  }

  function convertNormalAmountToWei(amount: string): string {
    return ethers.utils.parseEther(String(amount)).toString();
  }
 * 
 */
export interface TransferERC20Params {
  senderWalletAddress: string; // sender wallet address 
  senderPublicKey: string; // sender stark key 
  receiverPublicKey: string; // receiver stark key
  tokenAddress: string; // Token ERC20
  groupRequestId?: string;
  partnerRefId?: string;
  quantizedAmount: string; // 1 ETH -> Wei
  myriaPrivateKey?: string;
}

export interface TransferETHParams {
  senderWalletAddress: string; // sender wallet address 
  senderPublicKey: string; // sender stark key 
  receiverPublicKey: string; // receiver stark key
  groupRequestId?: string
  partnerRefId?: string;
  quantizedAmount: string; // 1 ETH -> Wei
  myriaPrivateKey?: string;
}

/**
 * @typedef {Object} TransferERC721Params
 * @property {string} senderWalletAddress Wallet address of sender
 * @property {string} senderPublicKey Public stark key of sender
 * @property {string} receiverPublicKey Public stark key of receiver
 * @property {string} tokenAddress Token address of NFT asset
 * @property {string} tokenId Token id of the specific NFT
 * @property {string} quantizedAmount quantized amount of token NFT (ERC721 and MINTABLE_ERC721) is always as 1
 * @property {string=} groupRequestId Unique group request ID for the transaction
 * @property {string=} partnerRefId Unique partner group request ID as Project ID in Myria system
 * @property {string=} myriaPrivateKey The myria private stark key is to generate the stark signature without the metamask session
 */
export interface TransferERC721Params {
  senderWalletAddress: string;
  senderPublicKey: string;
  receiverPublicKey: string;
  tokenAddress: string;
  tokenId: string;
  quantizedAmount: string;
  groupRequestId?: string;
  partnerRefId?: string;
  myriaPrivateKey?: string;
}

/**
 * @typedef {Object} TokenDataSignTransfer
 * @property {string} tokenAddress The smart contract address of the token
 * @property {string | undefined} tokenId This is only required for NFTs (ERC721)
 * @property {string | undefined} quantum This is only required for NFTs (ERC721)
 */
interface TokenDataSignTransfer {
  tokenAddress: string;
  tokenId?: string | undefined;
  quantum?: string | undefined;
}

/**
 * @typedef {Object} ItemSignableBurnParams
 * @property {string} quantizedAmount The quantized amount of tokens to be transferred
 * + If token type is NFT (ERC721, MINTABLE_ERC721), quantizedAmount should always be 1
 * + If token type is ETH / ERC20 (ERC20, MINTABLE_ERC20)
 * + 1 - Converter for Quantized Amount: It is calculated based on standard rule: (amount * 10^18) / 10 ^ 10
 * + 2 - The calculate rule is convert the pure amount of token to WEI (10^10), then devide it by 10^10 (QUANTUM number defined in platform)
 * @example <caption>Example of the converter</caption>
 * 
  function convertAmountToQuantizedAmount(amount: number | string): number {
    const wei = convertNormalAmountToWei(String(amount));
    const QUANTUM = '10000000000'; // 10^10
    return BigNumber.from(wei).div(BigNumber.from(QUANTUM)).toNumber();
  }

  function convertNormalAmountToWei(amount: string): string {
    return ethers.utils.parseEther(String(amount)).toString();
  }
 * 
 * @property {TokenType} tokenType Type of token (ETH / ERC20 / MINTABLE_ERC20 / ERC721 / MINTABLE_ERC721)
 * @property {TokenDataSignTransfer} tokenData Data of token include (contract_address / tokenId)
 */
export interface ItemSignableBurnParams {
  quantizedAmount: string;
  tokenType: TokenType;
  tokenData: TokenDataSignTransfer | undefined;
}

/**
 * @typedef {Object} ItemSignableTransferParams
 * @property {string} quantizedAmount The quantized amount of tokens to be transferred
 * + If token type is NFT (ERC721, MINTABLE_ERC721), quantizedAmount should always be 1
 * + If token type is ETH / ERC20 (ERC20, MINTABLE_ERC20)
 * + 1 - Converter for Quantized Amount: It is calculated based on standard rule: (amount * 10^18) / 10 ^ 10
 * + 2 - The calculate rule is convert the pure amount of token to WEI (10^10), then devide it by 10^10 (QUANTUM number defined in platform)
 * @example <caption>Example of the converter</caption>
 * 
  function convertAmountToQuantizedAmount(amount: number | string): number {
    const wei = convertNormalAmountToWei(String(amount));
    const QUANTUM = '10000000000'; // 10^10
    return BigNumber.from(wei).div(BigNumber.from(QUANTUM)).toNumber();
  }

  function convertNormalAmountToWei(amount: string): string {
    return ethers.utils.parseEther(String(amount)).toString();
  }
 * 
 * @property {string} receiverWalletAddress The wallet address of receiver
 * @property {TokenType} tokenType Type of token (ETH / ERC20 / MINTABLE_ERC20 / ERC721 / MINTABLE_ERC721)
 * @property {TokenDataSignTransfer} tokenData Data of token include (contract_address / tokenId)
 */
export interface ItemSignableTransferParams {
  quantizedAmount: string;
  receiverWalletAddress: string;
  tokenType: TokenType;
  tokenData: TokenDataSignTransfer | undefined;
}

/**
 * @typedef {Object} SignableBulkTransferParams
 * @property {string} senderWalletAddress Wallet address of sender
 * @property {ItemSignableTransferParams} items List of signable transferred items including information of sender and receiver (vaults, stark key, nonce, signature,..)
 */
export interface SignableBulkTransferParams {
  senderWalletAddress: string;
  items: ItemSignableTransferParams[];
}

/**
 * @typedef {Object} SignableBurnTokensParams
 * @property {string} senderWalletAddress Wallet address of sender
 * @property {ItemSignableBurnParams} items List of signable transferred items including information of token (quantizedAmount, tokenType, tokenData ,..)
 */
export interface SignableBurnTokensParams {
  senderWalletAddress: string;
  items: ItemSignableBurnParams[];
}

/**
 * @typedef {Object} BulkTransferTokenParams
 * @property {string} senderWalletAddress Wallet address of sender
 * @property {string} requestId Unique request ID for bulk transfer
 * @property {string} groupRequestId Unique group request ID and it contains multiple request IDs for bulk transfer
 * @property {string} partnerRefId The partner reference ID is to identify the partner
 * @property {string} description The description for the transfer transaction 
 * @property {ItemSignableTransferParams} items List of signable transferred items including information of sender and receiver (vaults, stark key, nonce, signature,..)
 */
export interface BulkTransferTokenParams {
  senderWalletAddress: string;
  requestId: string;
  groupRequestId: string;
  partnerRefId: string;
  description: string;
  items: ItemSignableTransferParams[];
}

/**
 * @typedef {Object} BulkTransferTokenRequestAPIParams
 * @property {string} senderWalletAddress Wallet address of sender
 * @property {string} requestId Unique request ID for bulk transfer
 * @property {string} groupRequestId Unique group request ID and it contains multiple request IDs for bulk transfer
 * @property {string} partnerRefId The partner reference ID is to identify the partner
 * @property {string} description The description for the transfer transaction 
 * @property {TransferAPIInput[]} items The list of full transferred payload
 */
export interface BulkTransferTokenRequestAPIParams {
  senderWalletAddress: string;
  items: TransferAPIInput[];
  requestId?: string;
  groupRequestId?: string;
  partnerRefId?: string;
  description?: string;
  isWaitingForValidation?: boolean;
}

/**
 * @typedef {Object} BurnTokensRequestAPIParams
 * @property {string} requestId Unique request ID for bulk transfer
 * @property {string} groupRequestId Unique group request ID and it contains multiple request IDs for bulk transfer
 * @property {string} partnerRefId The partner reference ID is to identify the partner
 * @property {string} description The description for the transfer transaction
 * @property {TransferAPIInput[]} items The list of full transferred payload
 */
export interface BurnTokensRequestAPIParams {
  requestId?: string;
  groupRequestId?: string;
  partnerRefId?: string;
  description?: string;
  items: TransferAPIInput[];
  isWaitingForValidation?: boolean;
}

export interface ICommonError {
  message: string;
  code: string;
  error: string | any | undefined;
}

/**
 * @typedef {Object} TransferTokenParams
 * @property {string} senderWalletAddress Sender's wallet address
 * @property {string=} groupRequestId UUID for whole transfer batch
 * @property {string=} requestId UUID for a subbatch, in case batch is greater than max size. (Not in use at the moment)
 * @property {string=} partnerRefId Project ID that bulk transfer should be associated with
 * @property {string=} myriaPrivateKey Myria private stark key to sign on the transactions and create the stark signature for validation
 * @property {string=} isWaitingForValidation Optional flag to validate the payload for the transferred transactions
 * @property {ItemSignableTransferParams[]} items List of signable transferred items including information for sender and receiver (vaults, stark key, nonce, signature)
 */
export interface TransferTokenParams {
  senderWalletAddress: string;
  items: ItemSignableTransferParams[];
  requestId?: string;
  groupRequestId?: string;
  partnerRefId?: string;
  description?: string;
  myriaPrivateKey?: string;
  isWaitingForValidation?: boolean;
}

/**
 * @typedef {Object} BurnTokenParams
 * @property {string} senderWalletAddress Sender's wallet address
 * @property {string=} myriaPrivateKey Myria private stark key to sign on the transactions and create the stark signature for validation
 * @property {string=} groupRequestId UUID for whole transfer batch
 * @property {string=} requestId UUID for a subbatch, in case batch is greater than max size. (Not in use at the moment)
 * @property {string=} partnerRefId Project ID that bulk transfer should be associated with
 * @property {string=} isWaitingForValidation Optional flag to validate the payload for the transferred transactions
 * @property {ItemSignableBurnParams[]} items List of signable transferred items including information of token (quantizedAmount, tokenType, tokenData, signature, ...)
 */
export interface BurnTokenParams {
  senderWalletAddress: string;
  myriaPrivateKey?: string;
  items: ItemSignableBurnParams[];
  requestId?: string;
  groupRequestId?: string;
  partnerRefId?: string;
  description?: string;
  isWaitingForValidation?: boolean;
}

/**
 * @typedef {Object} TransferCommonParams
 * @property {number} senderVaultId Vault ID of sender to locate the fund
 * @property {string} senderPublicKey Stark key of sender
 * @property {string} senderWalletAddress Wallet address of sender
 * @property {number} receiverVaultId Vault ID of receiver (destinated vault to receive the fund)
 * @property {string} receiverPublicKey Stark Key of receiver
 * @property {string} assetId The hex string of the asset ID
 * @property {string} quantizedAmount The amount of used tokens based on QUANTUM with token type
 * @property {number=} nonce The unique sequence number to locate the transaction in both of on-chain and off-chain
 * @property {number=} expirationTimestamp The generated timestamp to define the expire time for the transaction
 * @property {string=} groupRequestId Unique group request ID for the transaction
 * @property {string=} partnerRefId Unique partner group request ID as Project ID in Myria system
 * @property {TokenType} tokenType type of token for transfer
 * @property {string=} myriaPrivateStarkKey The myria private stark key is to generate the stark signature without the metamask session
 *
 */
export interface TransferCommonParams {
  senderVaultId: number;
  senderPublicKey: string;
  senderWalletAddress: string;
  receiverVaultId: number;
  receiverPublicKey: string;
  assetId: string;
  quantizedAmount: string;
  nonce?: number;
  expirationTimestamp?: number;
  groupRequestId?: string;
  partnerRefId?: string;
  tokenType: TokenType;
  timestampHeader?: number;
  myriaPrivateStarkKey?: string;
  secretKey?: string; 
  path?: string;
}

/**
 * @typedef {Object} BulkTransferTokenResponse
 * @property {BulkTransferItemResponse[]} failed Failed transactions as system rejects immediately right after the request is made.
 * @property {BulkTransferItemResponse[]} success Successful transactions in initial validation. These are the one added to queue to be processed by platform
 * @property {BulkTransferItemResponse[]} validationFailed Failed transactions due to validation issues such as signature, params missing, etc.
 */
export interface BulkTransferTokenResponse {
  failed: BulkTransferItemResponse[];
  success: BulkTransferItemResponse[];
  validationFailed: BulkTransferItemResponse[];
}

/**
 * @typedef {Object} WhitelistTokens
 * @property {TokenData[]} data list of whitelist tokens
 */
export interface WhitelistTokensResponse {
  status: string;
  data: TokenData[];
}

/**
 * @typedef {Object} TokenData
 * @property {assetType} assetType Asset type - hex string of token which is computed by Starkware algorithm
 * @property {status} status Status of token (Registered/Pending)
 * @property {quantum} quantum Quantum number (default is 10^10 and to calculate quantized amount of tokens)
 * @property {isSupportListing} isSupportListing The flag to indicate if the token is supported for listing NFTs at myria marketplace
 * @property {tokenType} tokenType Type of token (ERC20 / ETH / ERC721 / MINTABLE_ERC721)
 * @property {tokenName} tokenName Name of token
 * @property {assetInfo} assetInfo Asset info which is computed by Starkware algorithm
 * @property {tokenSymbol} tokenSymbol Symbol of token
 * @property {starkKey} starkKey Stark key registered the tokens to whitelist
 * @property {contractAddress} contractAddress Smart contract address of tokens
 */
export interface TokenData {
  assetType: string;
  status: string;
  quantum: string; // Default quantum is 10^10
  createdAt: number;
  isSupportListing: string;
  tokenType: string;
  updatedAt: number;
  tokenName: string;
  assetInfo: string;
  tokenSymbol: string; // Ex MYRIA, USDT
  starkKey: string;
  contractAddress: string;
}

export interface BurnTokenResponse extends BulkTransferTokenResponse {}

/**
 * @typedef {string} TransactionType
 * @enum {TransactionType} Type of transaction (Settlement/Deposit/Withdrawal/Transfer/Mint/FullWithdrawal)
 */

export const enum TransactionType {
  Settlement = 'SettlementRequest',
  Deposit = 'DepositRequest',
  Withdrawal = 'WithdrawalRequest',
  Transfer = 'TransferRequest',
  Mint = 'MintRequest',
  FullWithdrawal = 'FullWithdrawalRequest',
}

export enum AnimationUrlType {
  'application/vnd.apple.mpegurl' = 'application/vnd.apple.mpegurl',
  'video/mp4' = 'video/mp4',
  'video/webm' = 'video/webm',
}

/**
 * @typedef {String} TransactionStatus
 * @enum {TransactionStatus} Status of transaction (Prepare/FailedGateway/Pending/Success/Failed)
 */
export enum TransactionStatus {
  Prepare = 'Prepare',
  FailedGateway = 'FaiedGateway',
  Pending = 'Pending',
  Success = 'Success',
  Failed = 'Failed',
}
export interface TransactionCompleteParams {
  starkKey: string;
  transactionId: number;
  transactionHash: string;
}

export interface TransactionCompleteResponse {
  starkKey: string;
  transactionHash: string;
  transactionIds: string[];
}

/**
 * @typedef {Object} TransferResponse
 * @property {string} starkKey Public stark key of sender
 * @property {string} transactionCategory Unique key for transaction category which is combination of TransactionType#Nonce#StarkKey
 * @property {number} transactionId Id of the transaction.
 * @property {TransactionType} transactionType Type of the transaction (such as Withdraw, Transfer, Deposit)
 * @property {TransactionStatus} transactionStatus Status of transaction (such as Prepare, FailedGateway, Pending, Success, Failed)
 * @property {number} createdAt Created time for transaction
 */
export interface TransferResponse {
  starkKey: string;
  transactionCategory: string;
  transactionId: number;
  transactionType: TransactionType;
  transactionStatus: TransactionStatus;
  createdAt: number;
  updatedAt?: number;
}

/**
 * @typedef {Object} TransactionData
 * @property {string} assetType Asset hex string which is a combination of token address / id
 * @property {number} retryAttempt The number of attempted retries
 * @property {number} quantum The quantum number for token to calculate the quantized amount (Default is 10^10)
 * @property {number} expirationTimestamp Expiration timestamp for transaction
 * @property {TokenType} tokenType Type of token (ERC20 / MINTABLE_ERC20 / ERC721 / MINTABLE_ERC721 / ETH)
 * @property {string} partnerRefId Partner reference ID (Partner ID, Project ID of Partner) to identify who made request
 * @property {string} transactionType Type of transaction (Transfer/Deposit/Withdraw)
 * @property {string} requestId Unique request ID to keep track and re-query the status of the transaction
 * @property {SplitSignature} signature The ECDSA signature which is {r, s}
 * @property {string} tokenAddress Address of the token
 * @property {string} assetId Asset hex string which is a combination of token address / id
 * @property {string} tokenId Token ID if the transaction is an NFT
 * @property {string} tokenSymbol Symbol of the token (USDT, ETH, BNB, MYR)
 * @property {string} transactionCategory The category of the transaction which is a combination of request#nonce
 * @property {string} environment The environment of Myria system (dev/staging/preprod/prod)
 * @property {string} groupRequestId The group request ID in case of transaction batches
 * @property {number} receiverVaultId The vault ID of the receiver
 * @property {number} vaultId The vault ID of the sender
 * @property {TransactionStatus} transactionStatus The status of transaction (PREPARE / VALIDATING / PENDING / SUCCESS / COMPLETED)
 * @property {number} createdAt The time of creation of the transaction
 * @property {number} transactionId The unique ID of the transaction
 * @property {string} quantizedAmount The quantized amount of the token which is a calculated amount on Myria system
 * + quantizedAmount = (amount * 10^18) / 10^10 (weiAmount/quantum)
 * + amount = quantizedAmount * 10^10 / 10^18 
 * @example <caption>Sample function convert to readable amount with Web3 lib</caption>
 
  function convertQuantizedAmountToNormalAmount(amount: string): string {
    const QUANTUM = 10000000000;
    if (!amount || Number(amount) === 0) {
      return '0';
    }
    const amountQuantum = Number(amount) * Number(QUANTUM);
    return Web3.utils.fromWei(
      String(amountQuantum.toLocaleString('fullwide', { useGrouping: false })),
    );
  }
 * @property {string} tokenName The name of the token in transaction
 * @property {number} updatedAt The last updatedAt time for transaction
 * @property {number} nonce The unique integer nonce to identify the unique transaction
 * @property {string} receiverPublicKey The stark public key of the receiver
 * @property {string} starkKey The sender stark key
 * @property {string} description The description of the transaction
 * @property {string[]} trackingStatuses The life cycle status of the transaction (prepare/pending/success/completed)
 * @property {string} senderWalletAddress Wallet address of sender
 * @property {string} receiverWalletAddress Wallet address of sender
 */
export interface TransactionData {
  assetType: string;
  retryAttempt: number;
  quantum: number;
  expirationTimestamp: number;
  tokenType: TokenType;
  partnerRefId: string;
  transactionType: string;
  requestId: string;
  signature: SplitSignature;
  tokenAddress: string;
  assetId: string;
  tokenId: string;
  tokenSymbol: string;
  transactionCategory: string;
  environment: string;
  groupRequestId: string;
  receiverVaultId: number;
  vaultId: number;
  transactionStatus: string;
  createdAt: number;
  transactionId: number;
  quantizedAmount: string;
  tokenName: string;
  updatedAt: number;
  nonce: number;
  receiverPublicKey: string;
  starkKey: string;
  description: string;
  trackingStatuses: string[];
  senderWalletAddress: string;
  receiverWalletAddress: string;
}

export interface ItemsTransferResponse {
  senderVaultId: string;
  receiverVaultId: string;
  receiverPublicKey: string;
  token: string;
  quantizedAmount: string;
  nonce: number;
  expirationTimestamp: number;
  receiverWalletAddress?: string;
  senderWalletAddress?: string;
}
export interface ItemsBurnTransferResponse {
  senderVaultId: number;
  receiverVaultId: number;
  receiverPublicKey: string;
  token: string;
  quantizedAmount: string;
  nonce: number;
  expirationTimestamp: number;
  receiverWalletAddress?: string;
  senderWalletAddress?: string;
}

export interface SignableBulkTransferResponse {
  senderPublicKey: string,
  items: ItemsTransferResponse[],
}

export interface SignableBurnResponse {
  senderPublicKey: string;
  items: ItemsBurnTransferResponse[];
}

/**
 * @typedef {Object} TransactionPagingDetails
 * @description Query criteria for transaction lists
 * @summary In case we want to query the list of transactions on the next page (from index 43...),we will need
 * to send createdAt and transactionCategory params of last transaction in current page.
 * @property {string} starkKey Public stark key associated with transactions
 * @property {number=} limit Transactions limit per page - max number of transaction per page are 42
 * @property {number=} createdAt Timestamp to use as start value for transaction search
 * @property {string=} transactionCategory Empty for page 1. Transaction category  value for last transaction of current page to query for next page,
 * transaction category is combination of TypeOfTransaction#Nonce (for example: TransferRequest#20333221).
 */
export interface TransactionPagingDetails {
  starkKey: string;
  limit?: number;
  createdAt?: number;
  transactionCategory?: string;
}

/**
 * @typedef {Object} TransactionPagingData
 * @property {TransactionData[]} items List of the transactions data
 * @property {TransactionPagingDetails=} lastEvaluatedKey The query cursor information to be based and query for the next page
 */
export interface TransactionPagingData {
  items: TransactionData[];
  lastEvaluatedKey?: TransactionPagingDetails;
}