@dzapio/sdk 2.0.14 → 2.0.16

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.
Files changed (108) hide show
  1. package/dist/{dZapClient/index.d.ts → index.d.mts} +912 -12
  2. package/dist/index.d.ts +1919 -17
  3. package/dist/index.js +16305 -2
  4. package/dist/index.mjs +16261 -0
  5. package/package.json +13 -31
  6. package/dist/api/index.d.ts +0 -31
  7. package/dist/artifacts/ERC20Permit.d.ts +0 -374
  8. package/dist/artifacts/Permit2.d.ts +0 -700
  9. package/dist/artifacts/Permit2Proxy.d.ts +0 -416
  10. package/dist/artifacts/default/DZapCoreAbi.d.ts +0 -2
  11. package/dist/artifacts/default/DZapCoreV2Abi.d.ts +0 -2
  12. package/dist/artifacts/default/DZapDcaAbi.d.ts +0 -2
  13. package/dist/artifacts/default/Permit2Abi.d.ts +0 -700
  14. package/dist/artifacts/default/erc20Abi.d.ts +0 -165
  15. package/dist/artifacts/default/index.d.ts +0 -6
  16. package/dist/artifacts/index.d.ts +0 -2
  17. package/dist/artifacts/staging/DZapCoreSwapAbi.d.ts +0 -2
  18. package/dist/artifacts/staging/index.d.ts +0 -2
  19. package/dist/axios/baseClient.d.ts +0 -2
  20. package/dist/axios/index.d.ts +0 -8
  21. package/dist/chains/definitions/arthera.d.ts +0 -35
  22. package/dist/chains/definitions/fiveIre.d.ts +0 -35
  23. package/dist/chains/definitions/hyperEvm.d.ts +0 -35
  24. package/dist/chains/definitions/hyperliquid.d.ts +0 -35
  25. package/dist/chains/definitions/pushTestnet.d.ts +0 -35
  26. package/dist/chains/definitions/stable.d.ts +0 -36
  27. package/dist/chains/index.d.ts +0 -179
  28. package/dist/config/index.d.ts +0 -36
  29. package/dist/constants/address.d.ts +0 -13
  30. package/dist/constants/approval.d.ts +0 -7
  31. package/dist/constants/axios.d.ts +0 -2
  32. package/dist/constants/chains.d.ts +0 -32
  33. package/dist/constants/contract.d.ts +0 -6
  34. package/dist/constants/erc20.d.ts +0 -25
  35. package/dist/constants/httpMethods.d.ts +0 -2
  36. package/dist/constants/index.d.ts +0 -48
  37. package/dist/constants/permit.d.ts +0 -29
  38. package/dist/constants/permit2.d.ts +0 -2
  39. package/dist/constants/rpc.d.ts +0 -2
  40. package/dist/constants/urlConstants.d.ts +0 -16
  41. package/dist/enums/index.d.ts +0 -47
  42. package/dist/index.js.map +0 -1
  43. package/dist/index.m.js +0 -2
  44. package/dist/index.m.js.map +0 -1
  45. package/dist/index.umd.js +0 -2
  46. package/dist/index.umd.js.map +0 -1
  47. package/dist/service/cache/cacheProvider.d.ts +0 -10
  48. package/dist/service/cache/constant.d.ts +0 -2
  49. package/dist/service/price/index.d.ts +0 -16
  50. package/dist/service/price/provider/coingecko/config.d.ts +0 -6
  51. package/dist/service/price/provider/coingecko/index.d.ts +0 -9
  52. package/dist/service/price/provider/defiLlama/config.d.ts +0 -3
  53. package/dist/service/price/provider/defiLlama/index.d.ts +0 -9
  54. package/dist/service/price/provider/defiLlama/types.d.ts +0 -11
  55. package/dist/service/price/provider/dzap/index.d.ts +0 -6
  56. package/dist/service/price/types/IPriceProvider.d.ts +0 -14
  57. package/dist/transactionHandlers/generic.d.ts +0 -24
  58. package/dist/transactionHandlers/permit.d.ts +0 -61
  59. package/dist/transactionHandlers/trade.d.ts +0 -26
  60. package/dist/transactionHandlers/zap.d.ts +0 -37
  61. package/dist/types/axiosClient.d.ts +0 -6
  62. package/dist/types/btc.d.ts +0 -45
  63. package/dist/types/chains.d.ts +0 -3
  64. package/dist/types/contract.d.ts +0 -14
  65. package/dist/types/eip-2612.d.ts +0 -24
  66. package/dist/types/index.d.ts +0 -497
  67. package/dist/types/permit.d.ts +0 -191
  68. package/dist/types/wallet.d.ts +0 -2
  69. package/dist/types/zap/broadcast.d.ts +0 -15
  70. package/dist/types/zap/build.d.ts +0 -44
  71. package/dist/types/zap/index.d.ts +0 -34
  72. package/dist/types/zap/path.d.ts +0 -33
  73. package/dist/types/zap/pool.d.ts +0 -39
  74. package/dist/types/zap/position.d.ts +0 -27
  75. package/dist/types/zap/quote.d.ts +0 -7
  76. package/dist/types/zap/status.d.ts +0 -28
  77. package/dist/types/zap/step.d.ts +0 -30
  78. package/dist/utils/amount.d.ts +0 -82
  79. package/dist/utils/axios.d.ts +0 -13
  80. package/dist/utils/date.d.ts +0 -1
  81. package/dist/utils/decoder/swap/abis.d.ts +0 -643
  82. package/dist/utils/decoder/swap/inputDataDecoder.d.ts +0 -14
  83. package/dist/utils/eip-2612/eip2612Permit.d.ts +0 -23
  84. package/dist/utils/eip-5792/batchApproveTokens.d.ts +0 -21
  85. package/dist/utils/eip-5792/index.d.ts +0 -3
  86. package/dist/utils/eip-5792/isBatchTxnSupportedByWallet.d.ts +0 -6
  87. package/dist/utils/eip-5792/sendBatchCalls.d.ts +0 -10
  88. package/dist/utils/eip-5792/waitForBatchTransactionReceipt.d.ts +0 -4
  89. package/dist/utils/encodeApproveCall.d.ts +0 -6
  90. package/dist/utils/erc20.d.ts +0 -65
  91. package/dist/utils/errors.d.ts +0 -17
  92. package/dist/utils/index.d.ts +0 -4566
  93. package/dist/utils/multicall.d.ts +0 -14
  94. package/dist/utils/permit2/domain.d.ts +0 -2
  95. package/dist/utils/permit2/index.d.ts +0 -4
  96. package/dist/utils/permit2/nonce.d.ts +0 -15
  97. package/dist/utils/permit2/permitData.d.ts +0 -23
  98. package/dist/utils/permit2/values.d.ts +0 -54
  99. package/dist/utils/permit2/witnessData.d.ts +0 -4
  100. package/dist/utils/signIntent/custom.d.ts +0 -11
  101. package/dist/utils/signIntent/gasless.d.ts +0 -12
  102. package/dist/utils/signTypedData.d.ts +0 -11
  103. package/dist/utils/tokens.d.ts +0 -8
  104. package/dist/utils/updateQuotes.d.ts +0 -3
  105. package/dist/zap/constants/index.d.ts +0 -2
  106. package/dist/zap/constants/path.d.ts +0 -8
  107. package/dist/zap/constants/step.d.ts +0 -3
  108. package/dist/zap/constants/urls.d.ts +0 -13
@@ -1,44 +0,0 @@
1
- import { HexString } from '..';
2
- import { ZapPath } from './path';
3
- import { ZapStep } from './step';
4
- export type ZapRouteRequestPositionDetails = {
5
- nftId: string;
6
- };
7
- export type ZapRouteRequestPoolDetails = {
8
- lowerTick: number;
9
- upperTick: number;
10
- metadata?: unknown;
11
- };
12
- export type ZapIntegratorConfig = {
13
- id: string;
14
- feeBps: number;
15
- wallet: string;
16
- };
17
- export type ZapBuildTxnResponse = {
18
- amountOut: string;
19
- approvalData: {
20
- callTo: HexString;
21
- approveTo: HexString;
22
- amount: string;
23
- } | null;
24
- steps: ZapStep[];
25
- path: ZapPath[];
26
- };
27
- export type ZapBuildTxnRequest = {
28
- srcToken: string;
29
- srcChainId: number;
30
- destToken: string;
31
- destChainId: number;
32
- recipient: string;
33
- refundee: string;
34
- slippage: number;
35
- account: string;
36
- integrator?: ZapIntegratorConfig;
37
- permitData?: string;
38
- amount?: string;
39
- estimateGas?: boolean;
40
- positionDetails?: ZapRouteRequestPositionDetails;
41
- poolDetails?: ZapRouteRequestPoolDetails;
42
- allowedBridges?: string[];
43
- allowedDexes?: string[];
44
- };
@@ -1,34 +0,0 @@
1
- import { HexString, ProviderDetails } from '../';
2
- import { ZapPathAsset } from './path';
3
- export type ZapProviders = Record<string, ProviderDetails>;
4
- export type ZapChains = {
5
- [key: string]: {
6
- name: string;
7
- supportedProviders: string[];
8
- };
9
- };
10
- export type ZapFee = {
11
- amount: string;
12
- amountUSD: string;
13
- asset: ZapPathAsset;
14
- included: boolean;
15
- };
16
- export type ZapUnderlyingToken = {
17
- chainId: number;
18
- address: HexString;
19
- name?: string;
20
- symbol: string;
21
- decimals: number;
22
- logo?: string | null;
23
- };
24
- export type ZapUnderlyingTokenWithAmount = ZapUnderlyingToken & {
25
- amount: string;
26
- amountUSD: string;
27
- };
28
- export * from './build';
29
- export * from './path';
30
- export * from './pool';
31
- export * from './position';
32
- export * from './quote';
33
- export * from './status';
34
- export * from './step';
@@ -1,33 +0,0 @@
1
- import { ZapFee, ZapUnderlyingToken } from '.';
2
- import { HexString, ProviderDetails } from '../..';
3
- import { zapPathAction } from '../../zap/constants/path';
4
- export type ZapPathAction = keyof typeof zapPathAction;
5
- export type ZapPathAsset = {
6
- chainId: number;
7
- address: HexString;
8
- symbol: string;
9
- logo: string;
10
- decimals: number;
11
- price: string;
12
- type: string;
13
- name: string;
14
- provider?: ProviderDetails;
15
- underlyingTokens?: ZapUnderlyingToken[];
16
- };
17
- export type ZapPath = {
18
- action: ZapPathAction;
19
- protocol: ProviderDetails;
20
- fee: ZapFee[];
21
- estimatedDuration: number;
22
- input: {
23
- asset: ZapPathAsset;
24
- amount: string;
25
- amountUSD: string;
26
- }[];
27
- output: {
28
- asset: ZapPathAsset;
29
- amount: string;
30
- amountUSD: string;
31
- dust?: boolean;
32
- }[];
33
- };
@@ -1,39 +0,0 @@
1
- import { ZapUnderlyingToken } from '.';
2
- import { HexString } from '..';
3
- export type ZapPoolDetailsRequest = {
4
- address: HexString;
5
- chainId: number;
6
- provider: string;
7
- };
8
- export type ZapPoolsRequest = {
9
- chainId: number;
10
- provider: string;
11
- limit?: number;
12
- offset?: number;
13
- };
14
- export type ZapPoolsResponse = {
15
- pools: ZapPool[];
16
- pages: number;
17
- limit: number;
18
- offset: number;
19
- };
20
- export type ZapPool = {
21
- address: string;
22
- chainId: number;
23
- name: string;
24
- provider: string;
25
- underlyingAssets: ZapUnderlyingToken[];
26
- tvl: string;
27
- apr: number;
28
- metadata?: unknown;
29
- symbol: string;
30
- decimals: number;
31
- };
32
- export type ZapPoolDetails = {
33
- address: string;
34
- slot0: {
35
- sqrtPriceX96: string;
36
- tick: number;
37
- tickSpacing: number;
38
- };
39
- };
@@ -1,27 +0,0 @@
1
- import { ZapUnderlyingTokenWithAmount } from '.';
2
- import { HexString } from '..';
3
- export type ZapPositionsRequest = {
4
- account: HexString;
5
- chainId: number;
6
- provider: string;
7
- };
8
- export type ZapPosition = {
9
- underlyingAssets: ZapUnderlyingTokenWithAmount[];
10
- address: string;
11
- apr: number;
12
- name: string;
13
- chainId: number;
14
- provider: string;
15
- amount: string;
16
- amountUSD: string;
17
- nftDetails?: {
18
- id: string;
19
- manager: HexString;
20
- };
21
- metadata?: unknown;
22
- decimals: number;
23
- };
24
- export type ZapPositionsResponse = {
25
- positions: ZapPosition[];
26
- count: number;
27
- };
@@ -1,7 +0,0 @@
1
- import { ZapBuildTxnResponse, ZapBuildTxnRequest } from './build';
2
- export type ZapQuoteResponse = Omit<ZapBuildTxnResponse, 'steps'>;
3
- export type ZapQuoteRequest = Omit<ZapBuildTxnRequest, 'refundee' | 'recipient' | 'account'> & Partial<{
4
- refundee: string;
5
- recipient: string;
6
- account: string;
7
- }>;
@@ -1,28 +0,0 @@
1
- import { ProviderDetails } from '..';
2
- import { ZapPathAsset } from './path';
3
- export type ZapStatus = 'PENDING' | 'COMPLETED' | 'FAILED' | 'REFUNDED';
4
- export type ZapStatusAsset = {
5
- asset: ZapPathAsset;
6
- amount: string;
7
- amountUSD: string;
8
- };
9
- export type ZapStatusStep = {
10
- chainId: number;
11
- hash?: string;
12
- status: ZapStatus;
13
- action: string;
14
- protocol: ProviderDetails;
15
- input: ZapStatusAsset[];
16
- output: ZapStatusAsset[];
17
- };
18
- export type ZapStatusResponse = {
19
- status: ZapStatus;
20
- steps: ZapStatusStep[];
21
- recipient: string;
22
- timestamp: number;
23
- completedAt: number;
24
- };
25
- export type ZapStatusRequest = {
26
- chainId: number;
27
- txnHash: string;
28
- };
@@ -1,30 +0,0 @@
1
- import { HexString } from '..';
2
- import { chainTypes } from '../../constants/chains';
3
- import { zapStepAction } from '../../zap/constants/step';
4
- export type StepAction = keyof typeof zapStepAction;
5
- export type ZapEvmTxnDetails = {
6
- type: typeof chainTypes.evm;
7
- txnId: HexString;
8
- callData: HexString;
9
- callTo: HexString;
10
- value: string;
11
- estimatedGas: string;
12
- };
13
- export type ZapBvmTxnDetails = {
14
- type: typeof chainTypes.bvm;
15
- txnId: HexString;
16
- data: string;
17
- };
18
- export type SVMTxnDetails = {
19
- type: typeof chainTypes.svm;
20
- txnId: HexString;
21
- data: string[];
22
- estimatedGas: string;
23
- isJitoTx?: boolean;
24
- };
25
- export type ZapTxnDetails = ZapEvmTxnDetails | ZapBvmTxnDetails | SVMTxnDetails;
26
- export type ZapTransactionStep<T extends ZapTxnDetails = ZapTxnDetails> = {
27
- action: StepAction;
28
- data: T;
29
- };
30
- export type ZapStep = ZapTransactionStep;
@@ -1,82 +0,0 @@
1
- import { Fee, TradeQuote } from '../types';
2
- export declare const calculateAmountUSD: (amountInWei: string, decimals: number, price: string) => string;
3
- export declare const calculateNetGasFeeUsd: (item: TradeQuote) => string;
4
- export declare const calculateNetAmountUsd: (item: TradeQuote) => string;
5
- export declare const calculateNetGasFee: (item: TradeQuote) => bigint;
6
- export declare const updateFee: (fee: Fee, tokensPrice: Record<number, Record<string, string | null>>) => {
7
- isUpdated: boolean;
8
- fee: {
9
- gasFee: {
10
- amountUSD: string;
11
- address: string;
12
- decimals: number;
13
- chainId: number;
14
- symbol: string;
15
- logo?: string;
16
- amount: string;
17
- included: boolean;
18
- }[];
19
- providerFee: {
20
- amountUSD: string;
21
- address: string;
22
- decimals: number;
23
- chainId: number;
24
- symbol: string;
25
- logo?: string;
26
- amount: string;
27
- included: boolean;
28
- }[];
29
- protocolFee: {
30
- amountUSD: string;
31
- address: string;
32
- decimals: number;
33
- chainId: number;
34
- symbol: string;
35
- logo?: string;
36
- amount: string;
37
- included: boolean;
38
- }[];
39
- };
40
- };
41
- export declare const updatePath: (data: TradeQuote, tokensPrice: Record<number, Record<string, string | null>>) => {
42
- fee: {
43
- gasFee: {
44
- amountUSD: string;
45
- address: string;
46
- decimals: number;
47
- chainId: number;
48
- symbol: string;
49
- logo?: string;
50
- amount: string;
51
- included: boolean;
52
- }[];
53
- providerFee: {
54
- amountUSD: string;
55
- address: string;
56
- decimals: number;
57
- chainId: number;
58
- symbol: string;
59
- logo?: string;
60
- amount: string;
61
- included: boolean;
62
- }[];
63
- protocolFee: {
64
- amountUSD: string;
65
- address: string;
66
- decimals: number;
67
- chainId: number;
68
- symbol: string;
69
- logo?: string;
70
- amount: string;
71
- included: boolean;
72
- }[];
73
- };
74
- srcAmountUSD: string;
75
- destAmountUSD: string;
76
- type: string;
77
- exchange: import("../types").ProviderDetails;
78
- srcToken: import("../types").Token;
79
- srcAmount: string;
80
- destToken: import("../types").Token;
81
- destAmount: string;
82
- }[];
@@ -1,13 +0,0 @@
1
- import { CancelToken, Method } from 'axios';
2
- import AxiosClient from '../axios';
3
- type Invoke = {
4
- endpoint: string;
5
- data?: any;
6
- method?: Method;
7
- cancelToken?: CancelToken;
8
- shouldRetry?: boolean;
9
- baseClient?: AxiosClient;
10
- };
11
- export declare const invoke: ({ endpoint, data, method, cancelToken, shouldRetry }: Invoke) => Promise<any>;
12
- export declare const invokeZap: ({ endpoint, data, method, cancelToken, shouldRetry }: Invoke) => Promise<any>;
13
- export {};
@@ -1 +0,0 @@
1
- export declare const generateDeadline: (expiryInSecs: number) => bigint;