@dzapio/sdk 2.0.10 → 2.0.12

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
  };
@@ -117,19 +118,25 @@ export type Fee = {
117
118
  providerFee: FeeDetails[];
118
119
  };
119
120
  export type QuoteFilter = keyof typeof QuoteFilters;
121
+ export type ProtocolFilter = {
122
+ allow?: string[];
123
+ deny?: string[];
124
+ };
120
125
  export type TradeQuotesRequest = {
121
126
  fromChain: number;
122
127
  gasless?: boolean;
123
128
  data: TradeQuotesRequestData[];
124
129
  disableEstimation?: boolean;
125
130
  account?: string;
126
- allowedProtocols?: string[];
131
+ bridges?: ProtocolFilter;
132
+ dexes?: ProtocolFilter;
127
133
  filter?: QuoteFilter;
128
134
  timingStrategy?: Partial<{
129
135
  minWaitTimeMs: number;
130
136
  maxWaitTimeMs: number;
131
137
  subsequentDelayMs: number;
132
138
  preferredResultCount: number;
139
+ relaxMinSuccessOnDelay: boolean;
133
140
  }>;
134
141
  };
135
142
  export type TradeQuotesRequestData = {
@@ -360,26 +367,40 @@ export type SwapInfo = {
360
367
  toToken: string;
361
368
  returnToAmount: bigint;
362
369
  };
363
- export type HistoryTokenData = {
364
- asset: Omit<TokenInfo, 'price' | 'balance'>;
370
+ type StatusAsset = {
371
+ contract: string;
372
+ chainId: number;
373
+ name?: string;
374
+ symbol?: string;
375
+ decimals?: number;
376
+ logo?: string | undefined;
377
+ };
378
+ export type TransactionInfo = {
379
+ asset: StatusAsset;
365
380
  amount: string;
366
- amountUSD: string;
367
- status: keyof typeof STATUS_RESPONSE;
381
+ amountUSD: number;
368
382
  txHash: string;
369
383
  account: string;
370
- timestamp: number;
371
384
  };
372
- export type TxPairData = {
373
- input: HistoryTokenData;
374
- output: Omit<HistoryTokenData, 'txHash' | 'status' | 'timestamp'>;
375
- received: HistoryTokenData;
385
+ export type TxStatusForPair = {
386
+ source: TransactionInfo;
387
+ destination: TransactionInfo & {
388
+ timestamp?: number;
389
+ };
390
+ expected?: Omit<TransactionInfo, 'txHash' | 'status'>;
391
+ status: StatusResponse;
376
392
  provider: ProviderDetails;
377
393
  allowUserTxOnDestChain: boolean;
378
394
  message?: string;
379
- providerTxLink?: string;
395
+ protocolExplorerLink?: string;
380
396
  };
381
397
  export type TradeStatusResponse = {
382
- [pair: string]: TxPairData;
398
+ status: StatusResponse;
399
+ gasless: boolean;
400
+ txHash: string;
401
+ chainId: number;
402
+ timestamp: number;
403
+ transactions: TxStatusForPair[];
383
404
  };
384
405
  export type EIP2612GaslessExecuteTxParams = {
385
406
  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.12",
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",
@@ -104,7 +104,7 @@
104
104
  "decimal.js": "^10.4.3",
105
105
  "node-cache": "^5.1.2",
106
106
  "ethers": "5.7.2",
107
- "viem": "^2.17.0"
107
+ "viem": "2.45.1"
108
108
  },
109
109
  "repository": {
110
110
  "type": "git",