@dzapio/sdk 2.0.9 → 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,39 +361,40 @@ export type SwapInfo = {
360
361
  toToken: string;
361
362
  returnToAmount: bigint;
362
363
  };
363
- export type PartialStatusData = {
364
- receiveToken?: string;
365
- receiveAmount?: string;
366
- receiveAmountUSD?: string;
367
- };
368
- export type RefundStatusData = {
369
- refundTxHash?: string;
370
- refundToken?: string;
371
- refundAmount?: string;
372
- refundAmountUSD?: string;
373
- refundTimeStamp?: string;
364
+ type StatusAsset = {
365
+ contract: string;
366
+ chainId: number;
367
+ name?: string;
368
+ symbol?: string;
369
+ decimals?: number;
370
+ logo?: string | undefined;
374
371
  };
375
- export type TradeStatusResponseData = PartialStatusData & RefundStatusData & {
376
- srcChainId: number;
377
- srcToken: string;
378
- srcAmount: string;
379
- srcAmountUSD: string;
380
- srcTxHash: string;
381
- destChainId: number;
382
- destToken: string;
383
- destAmount: string;
384
- destAmountUSD: string;
385
- destTxHash: string;
372
+ export type TransactionInfo = {
373
+ asset: StatusAsset;
374
+ amount: string;
375
+ amountUSD: number;
376
+ txHash: string;
386
377
  account: string;
387
- recipient: string;
388
- provider: string;
378
+ };
379
+ export type TxStatusForPair = {
380
+ source: TransactionInfo;
381
+ destination: TransactionInfo & {
382
+ timestamp?: number;
383
+ };
384
+ expected?: Omit<TransactionInfo, 'txHash' | 'status'>;
385
+ status: StatusResponse;
386
+ provider: ProviderDetails;
389
387
  allowUserTxOnDestChain: boolean;
390
- status: keyof typeof STATUS_RESPONSE;
391
- outputToken?: string;
392
- refundTxHash?: string;
388
+ message?: string;
389
+ protocolExplorerLink?: string;
393
390
  };
394
391
  export type TradeStatusResponse = {
395
- [pair: string]: TradeStatusResponseData;
392
+ status: StatusResponse;
393
+ gasless: boolean;
394
+ txHash: string;
395
+ chainId: number;
396
+ timestamp: number;
397
+ transactions: TxStatusForPair[];
396
398
  };
397
399
  export type EIP2612GaslessExecuteTxParams = {
398
400
  permitData: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dzapio/sdk",
3
- "version": "2.0.9",
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",