brackets-curlyインターフェース

INTMAX Client SDK のインターフェース定義と型仕様

IntMaxClient は、INTMAX ネットワークと連携するために設計された SDK インターフェースです。アカウント管理、トランザクション操作、Deposit、Withdrawal といった主要機能を提供します。以下に各機能の概要を示します。

このインターフェースは、INTMAX ネットワークとのシームレスな統合のための高レベル API を提供します。アカウントのログイン・ログアウト、トランザクション管理、Deposit・Withdrawal 処理を統合し、シンプルな関数で複雑なブロックチェーン操作を実行できます。また、WebAssembly のサポートにより、高速かつ安全な処理を実現します。

export interface INTMAXClient {
  // properties
  isLoggedIn: boolean;
  address: string; // INTMAX address
  tokenBalances: TokenBalance[] | undefined;

  // account
  login: () => Promise<LoginResponse>;
  logout: () => Promise<void>;
  getPrivateKey: () => Promise<string | undefined>;
  signMessage: (message: string) => Promise<SignMessageResponse>;
  verifySignature: (
    signature: SignMessageResponse,
    message: string | Uint8Array,
  ) => Promise<boolean>;
  sync: () => Promise<void>;
  updatePublicClientRpc: (url: string) => void;

  // token
  getTokensList: () => Promise<Token[]>;
  fetchTokenBalances: () => Promise<TokenBalancesResponse>;
  getPaginatedTokens: (params: {
    tokenIndexes?: number[];
    perPage?: number;
    cursor?: string;
  }) => Promise<PaginatedResponse<Token>>;

  // transaction
  fetchTransactions: (params?: FetchTransactionsRequest) => Promise<FetchTransactionsResponse>;
  broadcastTransaction: (
    rawTransfers: BroadcastTransactionRequest[],    isWithdrawal?: boolean,
  ) => Promise<BroadcastTransactionResponse>;
  waitForTransactionConfirmation: (
    params: WaitForTransactionConfirmationRequest,
  ) => Promise<WaitForTransactionConfirmationResponse>;

  //receiveTxs
  fetchTransfers: (params?: FetchTransactionsRequest) => Promise<FetchTransactionsResponse>;

  // deposit
  estimateDepositGas: (params: PrepareEstimateDepositTransactionRequest) => Promise<bigint>;
  deposit: (params: PrepareDepositTransactionRequest) => Promise<PrepareDepositTransactionResponse>;
  fetchDeposits: (params?: FetchTransactionsRequest) => Promise<FetchTransactionsResponse>;

  // withdrawal
  fetchWithdrawals: (params?: FetchWithdrawalsRequest) => Promise<FetchWithdrawalsResponse>;
  withdraw: (params: WithdrawRequest) => Promise<WithdrawalResponse>;
  claimWithdrawal: (params: ContractWithdrawal[]) => Promise<ClaimWithdrawalTransactionResponse>;

  // Fees
  getTransferFee: () => Promise<FeeResponse>;
  getWithdrawalFee: (token: Token) => Promise<FeeResponse>;
}

関数一覧の概要

関数一覧 は、INTMAX Client SDK の主要なプロパティとインターフェースを示しています。ユーザー認証、トークン残高管理、INTMAX ネットワークとの連携をシームレスに行えます。認証状態、トークン情報、ページネーション付きデータ取得のための明確で標準化されたメソッドにより、さまざまなユースケースでの効率的な統合と拡張性を実現します。

基本インターフェース

リクエストインターフェース(Token・Transaction・Deposit)

リクエストインターフェース(Withdrawal)

最終更新