@dzapio/sdk 2.0.10 → 2.0.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,12 +1,13 @@
1
1
  import { Signer } from 'ethers';
2
2
  import { Prettify, TypedDataDomain, WalletClient } from 'viem';
3
- import { DZapAbis, GaslessTxType, OtherAbis, QuoteFilters, Services, STATUS, STATUS_RESPONSE } from './../constants';
3
+ import { DZapAbis, GaslessTxType, OtherAbis, QuoteFilters, STATUS, STATUS_RESPONSE, Services } from './../constants';
4
4
  import { ApprovalModes } from './../constants/approval';
5
5
  import { PermitTypes } from './../constants/permit';
6
6
  import { AppEnv, ContractVersion, StatusCodes, TxnStatus } from './../enums';
7
7
  import { PsbtInput, PsbtOutput } from './btc';
8
8
  import { GaslessBridgeParams, GaslessSwapParams } from './permit';
9
9
  export type HexString = `0x${string}`;
10
+ export type StatusResponse = keyof typeof STATUS_RESPONSE;
10
11
  export type ChainData = {
11
12
  [key in number]: Chain;
12
13
  };
@@ -360,26 +361,40 @@ export type SwapInfo = {
360
361
  toToken: string;
361
362
  returnToAmount: bigint;
362
363
  };
363
- export type HistoryTokenData = {
364
- asset: Omit<TokenInfo, 'price' | 'balance'>;
364
+ type StatusAsset = {
365
+ contract: string;
366
+ chainId: number;
367
+ name?: string;
368
+ symbol?: string;
369
+ decimals?: number;
370
+ logo?: string | undefined;
371
+ };
372
+ export type TransactionInfo = {
373
+ asset: StatusAsset;
365
374
  amount: string;
366
- amountUSD: string;
367
- status: keyof typeof STATUS_RESPONSE;
375
+ amountUSD: number;
368
376
  txHash: string;
369
377
  account: string;
370
- timestamp: number;
371
378
  };
372
- export type TxPairData = {
373
- input: HistoryTokenData;
374
- output: Omit<HistoryTokenData, 'txHash' | 'status' | 'timestamp'>;
375
- received: HistoryTokenData;
379
+ export type TxStatusForPair = {
380
+ source: TransactionInfo;
381
+ destination: TransactionInfo & {
382
+ timestamp?: number;
383
+ };
384
+ expected?: Omit<TransactionInfo, 'txHash' | 'status'>;
385
+ status: StatusResponse;
376
386
  provider: ProviderDetails;
377
387
  allowUserTxOnDestChain: boolean;
378
388
  message?: string;
379
- providerTxLink?: string;
389
+ protocolExplorerLink?: string;
380
390
  };
381
391
  export type TradeStatusResponse = {
382
- [pair: string]: TxPairData;
392
+ status: StatusResponse;
393
+ gasless: boolean;
394
+ txHash: string;
395
+ chainId: number;
396
+ timestamp: number;
397
+ transactions: TxStatusForPair[];
383
398
  };
384
399
  export type EIP2612GaslessExecuteTxParams = {
385
400
  permitData: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dzapio/sdk",
3
- "version": "2.0.10",
3
+ "version": "2.0.11",
4
4
  "description": "A TypeScript/JavaScript SDK for interacting with the DZap protocol, providing utilities for DeFi operations including Swaps, Bridges, and Zaps.",
5
5
  "main": "dist/index.js",
6
6
  "source": "src/index.ts",