@dzapio/sdk 2.0.52 → 2.0.54
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.
- package/dist/index.d.mts +114 -65
- package/dist/index.d.ts +114 -65
- package/dist/index.js +239 -111
- package/dist/index.mjs +240 -113
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import * as viem from 'viem';
|
|
2
|
-
import { TypedDataDomain, Prettify, WalletClient, TransactionReceipt, WalletCallReceipt as WalletCallReceipt$1, ChainFormatters, Chain as Chain$1, Assign } from 'viem';
|
|
3
1
|
import { Signer } from 'ethers';
|
|
2
|
+
import * as viem from 'viem';
|
|
3
|
+
import { TypedDataDomain, TypedData, Prettify, WalletClient, TransactionReceipt, WalletCallReceipt as WalletCallReceipt$1, ChainFormatters, Chain as Chain$1, Assign } from 'viem';
|
|
4
4
|
import * as viemChains from 'viem/chains';
|
|
5
5
|
import { Chain as Chain$2 } from 'viem/chains';
|
|
6
6
|
import { ChainId } from '@bigmi/core';
|
|
@@ -153,6 +153,92 @@ declare const AllowanceTypes: {
|
|
|
153
153
|
};
|
|
154
154
|
type AllowanceType = (typeof AllowanceTypes)[keyof typeof AllowanceTypes];
|
|
155
155
|
|
|
156
|
+
declare const chainTypes: {
|
|
157
|
+
readonly evm: "evm";
|
|
158
|
+
readonly bvm: "bvm";
|
|
159
|
+
readonly svm: "svm";
|
|
160
|
+
readonly aptosvm: "aptosvm";
|
|
161
|
+
readonly cosmos: "cosmos";
|
|
162
|
+
readonly nearvm: "nearvm";
|
|
163
|
+
readonly starknetvm: "starknetvm";
|
|
164
|
+
readonly stellarvm: "stellarvm";
|
|
165
|
+
readonly suivm: "suivm";
|
|
166
|
+
readonly tonvm: "tonvm";
|
|
167
|
+
readonly tronvm: "tronvm";
|
|
168
|
+
};
|
|
169
|
+
|
|
170
|
+
declare const zapStepAction: {
|
|
171
|
+
readonly execute: "execute";
|
|
172
|
+
readonly approve: "approve";
|
|
173
|
+
};
|
|
174
|
+
declare const zapPreExecutionStepType: {
|
|
175
|
+
readonly sign: "sign";
|
|
176
|
+
};
|
|
177
|
+
|
|
178
|
+
type TransactionError = {
|
|
179
|
+
status: Exclude<TxnStatus, TxnStatus.success>;
|
|
180
|
+
error: any;
|
|
181
|
+
errorMsg: string;
|
|
182
|
+
code: StatusCodes;
|
|
183
|
+
};
|
|
184
|
+
|
|
185
|
+
type StepAction = keyof typeof zapStepAction;
|
|
186
|
+
type ZapPreExecutionStepType = keyof typeof zapPreExecutionStepType;
|
|
187
|
+
type ZapEvmTxnDetails = {
|
|
188
|
+
type: typeof chainTypes.evm;
|
|
189
|
+
txnId: HexString;
|
|
190
|
+
callData: HexString;
|
|
191
|
+
callTo: HexString;
|
|
192
|
+
value: string;
|
|
193
|
+
estimatedGas: string;
|
|
194
|
+
};
|
|
195
|
+
type ZapBvmTxnDetails = {
|
|
196
|
+
type: typeof chainTypes.bvm;
|
|
197
|
+
txnId: HexString;
|
|
198
|
+
data: string;
|
|
199
|
+
};
|
|
200
|
+
type SVMTxnDetails = {
|
|
201
|
+
type: typeof chainTypes.svm;
|
|
202
|
+
txnId: HexString;
|
|
203
|
+
data: string[];
|
|
204
|
+
blockhash?: {
|
|
205
|
+
blockhash: string;
|
|
206
|
+
lastValidBlockHeight: number;
|
|
207
|
+
};
|
|
208
|
+
estimatedGas: string;
|
|
209
|
+
isJitoTx?: boolean;
|
|
210
|
+
};
|
|
211
|
+
type ZapTxnDetails = ZapEvmTxnDetails | ZapBvmTxnDetails | SVMTxnDetails;
|
|
212
|
+
type ZapTypedDataPayload = {
|
|
213
|
+
domain: TypedDataDomain;
|
|
214
|
+
types: TypedData;
|
|
215
|
+
primaryType: string;
|
|
216
|
+
message: Record<string, unknown>;
|
|
217
|
+
};
|
|
218
|
+
type ZapSignPreExecutionStep = {
|
|
219
|
+
id: string;
|
|
220
|
+
type: typeof zapPreExecutionStepType.sign;
|
|
221
|
+
data: ZapTypedDataPayload;
|
|
222
|
+
};
|
|
223
|
+
type ZapPreExecutionStep = ZapSignPreExecutionStep;
|
|
224
|
+
type ZapSignPreExecutionStepData = {
|
|
225
|
+
id: string;
|
|
226
|
+
type: typeof zapPreExecutionStepType.sign;
|
|
227
|
+
signature: HexString;
|
|
228
|
+
message: Record<string, unknown>;
|
|
229
|
+
};
|
|
230
|
+
type ZapPreExecutionResult = Prettify<{
|
|
231
|
+
status: TxnStatus.success;
|
|
232
|
+
code: StatusCodes | number;
|
|
233
|
+
preExecutionStepsData: ZapPreExecutionStepData[];
|
|
234
|
+
} | TransactionError>;
|
|
235
|
+
type ZapPreExecutionStepData = ZapSignPreExecutionStepData;
|
|
236
|
+
type ZapTransactionStep<T extends ZapTxnDetails = ZapTxnDetails> = {
|
|
237
|
+
action: StepAction;
|
|
238
|
+
data: T;
|
|
239
|
+
};
|
|
240
|
+
type ZapStep = ZapTransactionStep;
|
|
241
|
+
|
|
156
242
|
declare const zapFeeType: {
|
|
157
243
|
readonly fee: "fee";
|
|
158
244
|
readonly ata: "ata";
|
|
@@ -173,10 +259,13 @@ declare const zapPathAction: {
|
|
|
173
259
|
readonly bridge: "bridge";
|
|
174
260
|
readonly deposit: "deposit";
|
|
175
261
|
readonly withdraw: "withdraw";
|
|
262
|
+
readonly borrow: "borrow";
|
|
176
263
|
readonly stake: "stake";
|
|
177
264
|
readonly unstake: "unstake";
|
|
178
265
|
readonly increase: "increase";
|
|
179
266
|
readonly harvest: "harvest";
|
|
267
|
+
readonly long: "long";
|
|
268
|
+
readonly short: "short";
|
|
180
269
|
};
|
|
181
270
|
|
|
182
271
|
type ZapRefundType = (typeof zapRefundType)[keyof typeof zapRefundType];
|
|
@@ -222,56 +311,6 @@ type ZapFee = ZapAsset & {
|
|
|
222
311
|
type: ZapFeeType;
|
|
223
312
|
};
|
|
224
313
|
|
|
225
|
-
declare const chainTypes: {
|
|
226
|
-
readonly evm: "evm";
|
|
227
|
-
readonly bvm: "bvm";
|
|
228
|
-
readonly svm: "svm";
|
|
229
|
-
readonly aptosvm: "aptosvm";
|
|
230
|
-
readonly cosmos: "cosmos";
|
|
231
|
-
readonly nearvm: "nearvm";
|
|
232
|
-
readonly starknetvm: "starknetvm";
|
|
233
|
-
readonly stellarvm: "stellarvm";
|
|
234
|
-
readonly suivm: "suivm";
|
|
235
|
-
readonly tonvm: "tonvm";
|
|
236
|
-
readonly tronvm: "tronvm";
|
|
237
|
-
};
|
|
238
|
-
|
|
239
|
-
declare const zapStepAction: {
|
|
240
|
-
readonly execute: "execute";
|
|
241
|
-
};
|
|
242
|
-
|
|
243
|
-
type StepAction = keyof typeof zapStepAction;
|
|
244
|
-
type ZapEvmTxnDetails = {
|
|
245
|
-
type: typeof chainTypes.evm;
|
|
246
|
-
txnId: HexString;
|
|
247
|
-
callData: HexString;
|
|
248
|
-
callTo: HexString;
|
|
249
|
-
value: string;
|
|
250
|
-
estimatedGas: string;
|
|
251
|
-
};
|
|
252
|
-
type ZapBvmTxnDetails = {
|
|
253
|
-
type: typeof chainTypes.bvm;
|
|
254
|
-
txnId: HexString;
|
|
255
|
-
data: string;
|
|
256
|
-
};
|
|
257
|
-
type SVMTxnDetails = {
|
|
258
|
-
type: typeof chainTypes.svm;
|
|
259
|
-
txnId: HexString;
|
|
260
|
-
data: string[];
|
|
261
|
-
blockhash?: {
|
|
262
|
-
blockhash: string;
|
|
263
|
-
lastValidBlockHeight: number;
|
|
264
|
-
};
|
|
265
|
-
estimatedGas: string;
|
|
266
|
-
isJitoTx?: boolean;
|
|
267
|
-
};
|
|
268
|
-
type ZapTxnDetails = ZapEvmTxnDetails | ZapBvmTxnDetails | SVMTxnDetails;
|
|
269
|
-
type ZapTransactionStep<T extends ZapTxnDetails = ZapTxnDetails> = {
|
|
270
|
-
action: StepAction;
|
|
271
|
-
data: T;
|
|
272
|
-
};
|
|
273
|
-
type ZapStep = ZapTransactionStep;
|
|
274
|
-
|
|
275
314
|
type ZapRouteRequestPositionDetails = {
|
|
276
315
|
nftId: string;
|
|
277
316
|
};
|
|
@@ -296,6 +335,7 @@ type ZapBuildTxnResponse = {
|
|
|
296
335
|
output: ZapOutput[];
|
|
297
336
|
steps: ZapStep[];
|
|
298
337
|
path: ZapPath[];
|
|
338
|
+
preExecutionSteps?: ZapPreExecutionStep[];
|
|
299
339
|
};
|
|
300
340
|
type ZapBuildTxnRequest = {
|
|
301
341
|
srcToken: string;
|
|
@@ -308,6 +348,7 @@ type ZapBuildTxnRequest = {
|
|
|
308
348
|
account: string;
|
|
309
349
|
integrator?: ZapIntegratorConfig;
|
|
310
350
|
permitData?: string;
|
|
351
|
+
preExecutionStepsData?: ZapPreExecutionStepData[];
|
|
311
352
|
amount?: string;
|
|
312
353
|
estimateGas?: boolean;
|
|
313
354
|
positionDetails?: ZapRouteRequestPositionDetails;
|
|
@@ -326,9 +367,12 @@ type ZapBundleAction = {
|
|
|
326
367
|
srcChainId: number;
|
|
327
368
|
destToken?: string;
|
|
328
369
|
destChainId?: number;
|
|
370
|
+
destAmount?: string;
|
|
329
371
|
positionDetails?: ZapRouteRequestPositionDetails;
|
|
330
372
|
poolDetails?: ZapRouteRequestPoolDetails;
|
|
331
373
|
protocol?: string;
|
|
374
|
+
permitData?: HexString;
|
|
375
|
+
batchPermitData?: HexString;
|
|
332
376
|
};
|
|
333
377
|
type ZapBundleRequest = {
|
|
334
378
|
actions: ZapBundleAction[];
|
|
@@ -341,6 +385,7 @@ type ZapBundleRequest = {
|
|
|
341
385
|
integrator?: ZapIntegratorConfig;
|
|
342
386
|
allowedDexes?: string[];
|
|
343
387
|
allowedBridges?: string[];
|
|
388
|
+
preExecutionStepsData?: ZapPreExecutionStepData[];
|
|
344
389
|
};
|
|
345
390
|
|
|
346
391
|
type ZapPoolDetailsRequest = {
|
|
@@ -1019,6 +1064,12 @@ type BroadcastTxResponse = {
|
|
|
1019
1064
|
message: string;
|
|
1020
1065
|
};
|
|
1021
1066
|
|
|
1067
|
+
type ZapStepsResult = {
|
|
1068
|
+
status: TxnStatus.success;
|
|
1069
|
+
code: StatusCodes | number;
|
|
1070
|
+
txnHash?: string;
|
|
1071
|
+
} | DZapTransactionResponse;
|
|
1072
|
+
|
|
1022
1073
|
type DecodeTransactionParameters = {
|
|
1023
1074
|
txHash: string;
|
|
1024
1075
|
chainId: number;
|
|
@@ -1973,12 +2024,7 @@ declare class DZapClient {
|
|
|
1973
2024
|
chainId: number;
|
|
1974
2025
|
signer: Signer | WalletClient;
|
|
1975
2026
|
txnData: EvmTxData;
|
|
1976
|
-
}): Promise<{
|
|
1977
|
-
status: TxnStatus;
|
|
1978
|
-
error: any;
|
|
1979
|
-
errorMsg: any;
|
|
1980
|
-
code: StatusCodes;
|
|
1981
|
-
} | {
|
|
2027
|
+
}): Promise<TransactionError | {
|
|
1982
2028
|
status: TxnStatus;
|
|
1983
2029
|
code: StatusCodes;
|
|
1984
2030
|
txnHash: HexString;
|
|
@@ -2046,15 +2092,18 @@ declare class DZapClient {
|
|
|
2046
2092
|
rpcUrls?: string[];
|
|
2047
2093
|
service: AvailableDZapServices;
|
|
2048
2094
|
}>): Promise<SignPermitResponse<T>>;
|
|
2049
|
-
zap({ request, steps, signer, }: {
|
|
2095
|
+
zap({ request, steps, preExecutionSteps, signer, rpcUrls, }: {
|
|
2050
2096
|
request: ZapBuildTxnRequest | ZapBundleRequest;
|
|
2051
2097
|
signer: WalletClient | Signer;
|
|
2052
2098
|
steps?: ZapTransactionStep[];
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2099
|
+
preExecutionSteps?: ZapPreExecutionStep[];
|
|
2100
|
+
rpcUrls?: string[];
|
|
2101
|
+
}): Promise<ZapStepsResult>;
|
|
2102
|
+
prepareZapPreExecutionData({ preExecutionSteps, signer, account, }: {
|
|
2103
|
+
preExecutionSteps?: ZapPreExecutionStep[];
|
|
2104
|
+
signer: WalletClient | Signer;
|
|
2105
|
+
account?: string;
|
|
2106
|
+
}): Promise<ZapPreExecutionResult>;
|
|
2058
2107
|
buildZapTxn(request: ZapBuildTxnRequest): Promise<ZapBuildTxnResponse>;
|
|
2059
2108
|
getZapQuote(request: ZapQuoteRequest): Promise<ZapQuoteResponse>;
|
|
2060
2109
|
getZapBundleQuote(request: ZapBundleRequest): Promise<ZapQuoteResponse>;
|
|
@@ -2824,4 +2873,4 @@ declare const robinhood: {
|
|
|
2824
2873
|
declare const customViemChains: viemChains.Chain[];
|
|
2825
2874
|
declare const viemChainsById: Record<number, viemChains.Chain>;
|
|
2826
2875
|
|
|
2827
|
-
export { type AllowanceType, AllowanceTypes, type ApiRpcResponse, type ApprovalMode, ApprovalModes, type BatchPermitCallbackParams, type BtcTxData, type BtclnTxData, type Chain, type ChainData, type ContractErrorResponse, DZapClient, DZapPermitMode, type DZapTransactionResponse, type DecodeTxnDataClientParams, type DecodeTxnDataClientParamsWithoutService, type DecodeTxnDataResponse, type EvmTxData, type Fee, type FeeDetails, type GaslessTradeBuildTxnResponse, type HexString, type HyperLiquidTxData, OtherAbis, type ParamQuotes, type PermitMode, PermitTypes, type ProtocolAmountErrorDetails, type ProtocolAmountReason, type ProtocolErrorInfo, type ProtocolErrorType, type ProtocolRouteErrorDetails, type ProtocolRouteReason, type ProtocolSlippageErrorDetails, type ProtocolUnknownErrorDetails, type ProviderDetails, type PsbtInput, type PsbtOutput, type QuoteFilter, QuoteFilters, STATUS, type SVMTxnDetails, Services, type SignPermitResponse, type SignatureCallbackParams, SignatureExpiryInSecs, type SinglePermitCallbackParams, StatusCodes, type StepAction, type SvmTxData, type SwapAmountsPatchResult, type SwapInfo, type Token, type TokenInfo, type TokenPermitData, type TokenResponse, type TradeBuildTxnRequest, type TradeBuildTxnRequestData, type TradeBuildTxnResponse, type TradeGasBuildTxnResponse, type TradePath, type TradeQuotesRequest, type TradeQuotesRequestData, type TradeQuotesResponse, type TradeStatusResponse, type TradeStep, TxnStatus, type UnavailableRoutes, type ZapAsset, type ZapBuildTxnRequest, type ZapBuildTxnResponse, type ZapBundleAction, type ZapBundleRequest, type ZapBundleSrcToken, type ZapBvmTxnDetails, type ZapChains, type ZapEvmTxnDetails, type ZapFee, type ZapFeeType, type ZapIntegratorConfig, type ZapOutput, type ZapPath, type ZapPathAction, type ZapPathAsset, type ZapPool, type ZapPoolDetails, type ZapPoolDetailsRequest, type ZapPoolsRequest, type ZapPoolsResponse, type ZapPosition, type ZapPositionsRequest, type ZapPositionsResponse, type ZapProviders, type ZapQuoteRequest, type ZapQuoteResponse, type ZapRefund, type ZapRefundType, type ZapRouteRequestPoolDetails, type ZapRouteRequestPositionDetails, type ZapStatus, type ZapStatusRequest, type ZapStatusResponse, type ZapStatusStep, type ZapStep, type ZapTransactionStep, type ZapTxnDetails, type ZapUnderlyingToken, type ZapUnderlyingTokenWithAmount, arcTestnet, arthera, astralisTestnet, bitcoinTestnet, bitlayer, checkEIP2612PermitSupport, citrea, classifyAddress, contractErrorActions, customViemChains, erc20Functions, extendViemChain, fiveIre, formatToken, getTokensPairKey, hemi, hyperEvm, hyperliquid, katana, merlin, patchSwapAmountsFromTx, pushTestnet, robinhood, stableChain, tempo, viemChainsById, zapFeeType, zapPathAction, zapRefundType, zapStepAction };
|
|
2876
|
+
export { type AllowanceType, AllowanceTypes, type ApiRpcResponse, type ApprovalMode, ApprovalModes, type BatchPermitCallbackParams, type BtcTxData, type BtclnTxData, type Chain, type ChainData, type ContractErrorResponse, DZapClient, DZapPermitMode, type DZapTransactionResponse, type DecodeTxnDataClientParams, type DecodeTxnDataClientParamsWithoutService, type DecodeTxnDataResponse, type EvmTxData, type Fee, type FeeDetails, type GaslessTradeBuildTxnResponse, type HexString, type HyperLiquidTxData, OtherAbis, type ParamQuotes, type PermitMode, PermitTypes, type ProtocolAmountErrorDetails, type ProtocolAmountReason, type ProtocolErrorInfo, type ProtocolErrorType, type ProtocolRouteErrorDetails, type ProtocolRouteReason, type ProtocolSlippageErrorDetails, type ProtocolUnknownErrorDetails, type ProviderDetails, type PsbtInput, type PsbtOutput, type QuoteFilter, QuoteFilters, STATUS, type SVMTxnDetails, Services, type SignPermitResponse, type SignatureCallbackParams, SignatureExpiryInSecs, type SinglePermitCallbackParams, StatusCodes, type StepAction, type SvmTxData, type SwapAmountsPatchResult, type SwapInfo, type Token, type TokenInfo, type TokenPermitData, type TokenResponse, type TradeBuildTxnRequest, type TradeBuildTxnRequestData, type TradeBuildTxnResponse, type TradeGasBuildTxnResponse, type TradePath, type TradeQuotesRequest, type TradeQuotesRequestData, type TradeQuotesResponse, type TradeStatusResponse, type TradeStep, TxnStatus, type UnavailableRoutes, type ZapAsset, type ZapBuildTxnRequest, type ZapBuildTxnResponse, type ZapBundleAction, type ZapBundleRequest, type ZapBundleSrcToken, type ZapBvmTxnDetails, type ZapChains, type ZapEvmTxnDetails, type ZapFee, type ZapFeeType, type ZapIntegratorConfig, type ZapOutput, type ZapPath, type ZapPathAction, type ZapPathAsset, type ZapPool, type ZapPoolDetails, type ZapPoolDetailsRequest, type ZapPoolsRequest, type ZapPoolsResponse, type ZapPosition, type ZapPositionsRequest, type ZapPositionsResponse, type ZapPreExecutionResult, type ZapPreExecutionStep, type ZapPreExecutionStepData, type ZapPreExecutionStepType, type ZapProviders, type ZapQuoteRequest, type ZapQuoteResponse, type ZapRefund, type ZapRefundType, type ZapRouteRequestPoolDetails, type ZapRouteRequestPositionDetails, type ZapSignPreExecutionStep, type ZapSignPreExecutionStepData, type ZapStatus, type ZapStatusRequest, type ZapStatusResponse, type ZapStatusStep, type ZapStep, type ZapTransactionStep, type ZapTxnDetails, type ZapTypedDataPayload, type ZapUnderlyingToken, type ZapUnderlyingTokenWithAmount, arcTestnet, arthera, astralisTestnet, bitcoinTestnet, bitlayer, checkEIP2612PermitSupport, citrea, classifyAddress, contractErrorActions, customViemChains, erc20Functions, extendViemChain, fiveIre, formatToken, getTokensPairKey, hemi, hyperEvm, hyperliquid, katana, merlin, patchSwapAmountsFromTx, pushTestnet, robinhood, stableChain, tempo, viemChainsById, zapFeeType, zapPathAction, zapPreExecutionStepType, zapRefundType, zapStepAction };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import * as viem from 'viem';
|
|
2
|
-
import { TypedDataDomain, Prettify, WalletClient, TransactionReceipt, WalletCallReceipt as WalletCallReceipt$1, ChainFormatters, Chain as Chain$1, Assign } from 'viem';
|
|
3
1
|
import { Signer } from 'ethers';
|
|
2
|
+
import * as viem from 'viem';
|
|
3
|
+
import { TypedDataDomain, TypedData, Prettify, WalletClient, TransactionReceipt, WalletCallReceipt as WalletCallReceipt$1, ChainFormatters, Chain as Chain$1, Assign } from 'viem';
|
|
4
4
|
import * as viemChains from 'viem/chains';
|
|
5
5
|
import { Chain as Chain$2 } from 'viem/chains';
|
|
6
6
|
import { ChainId } from '@bigmi/core';
|
|
@@ -153,6 +153,92 @@ declare const AllowanceTypes: {
|
|
|
153
153
|
};
|
|
154
154
|
type AllowanceType = (typeof AllowanceTypes)[keyof typeof AllowanceTypes];
|
|
155
155
|
|
|
156
|
+
declare const chainTypes: {
|
|
157
|
+
readonly evm: "evm";
|
|
158
|
+
readonly bvm: "bvm";
|
|
159
|
+
readonly svm: "svm";
|
|
160
|
+
readonly aptosvm: "aptosvm";
|
|
161
|
+
readonly cosmos: "cosmos";
|
|
162
|
+
readonly nearvm: "nearvm";
|
|
163
|
+
readonly starknetvm: "starknetvm";
|
|
164
|
+
readonly stellarvm: "stellarvm";
|
|
165
|
+
readonly suivm: "suivm";
|
|
166
|
+
readonly tonvm: "tonvm";
|
|
167
|
+
readonly tronvm: "tronvm";
|
|
168
|
+
};
|
|
169
|
+
|
|
170
|
+
declare const zapStepAction: {
|
|
171
|
+
readonly execute: "execute";
|
|
172
|
+
readonly approve: "approve";
|
|
173
|
+
};
|
|
174
|
+
declare const zapPreExecutionStepType: {
|
|
175
|
+
readonly sign: "sign";
|
|
176
|
+
};
|
|
177
|
+
|
|
178
|
+
type TransactionError = {
|
|
179
|
+
status: Exclude<TxnStatus, TxnStatus.success>;
|
|
180
|
+
error: any;
|
|
181
|
+
errorMsg: string;
|
|
182
|
+
code: StatusCodes;
|
|
183
|
+
};
|
|
184
|
+
|
|
185
|
+
type StepAction = keyof typeof zapStepAction;
|
|
186
|
+
type ZapPreExecutionStepType = keyof typeof zapPreExecutionStepType;
|
|
187
|
+
type ZapEvmTxnDetails = {
|
|
188
|
+
type: typeof chainTypes.evm;
|
|
189
|
+
txnId: HexString;
|
|
190
|
+
callData: HexString;
|
|
191
|
+
callTo: HexString;
|
|
192
|
+
value: string;
|
|
193
|
+
estimatedGas: string;
|
|
194
|
+
};
|
|
195
|
+
type ZapBvmTxnDetails = {
|
|
196
|
+
type: typeof chainTypes.bvm;
|
|
197
|
+
txnId: HexString;
|
|
198
|
+
data: string;
|
|
199
|
+
};
|
|
200
|
+
type SVMTxnDetails = {
|
|
201
|
+
type: typeof chainTypes.svm;
|
|
202
|
+
txnId: HexString;
|
|
203
|
+
data: string[];
|
|
204
|
+
blockhash?: {
|
|
205
|
+
blockhash: string;
|
|
206
|
+
lastValidBlockHeight: number;
|
|
207
|
+
};
|
|
208
|
+
estimatedGas: string;
|
|
209
|
+
isJitoTx?: boolean;
|
|
210
|
+
};
|
|
211
|
+
type ZapTxnDetails = ZapEvmTxnDetails | ZapBvmTxnDetails | SVMTxnDetails;
|
|
212
|
+
type ZapTypedDataPayload = {
|
|
213
|
+
domain: TypedDataDomain;
|
|
214
|
+
types: TypedData;
|
|
215
|
+
primaryType: string;
|
|
216
|
+
message: Record<string, unknown>;
|
|
217
|
+
};
|
|
218
|
+
type ZapSignPreExecutionStep = {
|
|
219
|
+
id: string;
|
|
220
|
+
type: typeof zapPreExecutionStepType.sign;
|
|
221
|
+
data: ZapTypedDataPayload;
|
|
222
|
+
};
|
|
223
|
+
type ZapPreExecutionStep = ZapSignPreExecutionStep;
|
|
224
|
+
type ZapSignPreExecutionStepData = {
|
|
225
|
+
id: string;
|
|
226
|
+
type: typeof zapPreExecutionStepType.sign;
|
|
227
|
+
signature: HexString;
|
|
228
|
+
message: Record<string, unknown>;
|
|
229
|
+
};
|
|
230
|
+
type ZapPreExecutionResult = Prettify<{
|
|
231
|
+
status: TxnStatus.success;
|
|
232
|
+
code: StatusCodes | number;
|
|
233
|
+
preExecutionStepsData: ZapPreExecutionStepData[];
|
|
234
|
+
} | TransactionError>;
|
|
235
|
+
type ZapPreExecutionStepData = ZapSignPreExecutionStepData;
|
|
236
|
+
type ZapTransactionStep<T extends ZapTxnDetails = ZapTxnDetails> = {
|
|
237
|
+
action: StepAction;
|
|
238
|
+
data: T;
|
|
239
|
+
};
|
|
240
|
+
type ZapStep = ZapTransactionStep;
|
|
241
|
+
|
|
156
242
|
declare const zapFeeType: {
|
|
157
243
|
readonly fee: "fee";
|
|
158
244
|
readonly ata: "ata";
|
|
@@ -173,10 +259,13 @@ declare const zapPathAction: {
|
|
|
173
259
|
readonly bridge: "bridge";
|
|
174
260
|
readonly deposit: "deposit";
|
|
175
261
|
readonly withdraw: "withdraw";
|
|
262
|
+
readonly borrow: "borrow";
|
|
176
263
|
readonly stake: "stake";
|
|
177
264
|
readonly unstake: "unstake";
|
|
178
265
|
readonly increase: "increase";
|
|
179
266
|
readonly harvest: "harvest";
|
|
267
|
+
readonly long: "long";
|
|
268
|
+
readonly short: "short";
|
|
180
269
|
};
|
|
181
270
|
|
|
182
271
|
type ZapRefundType = (typeof zapRefundType)[keyof typeof zapRefundType];
|
|
@@ -222,56 +311,6 @@ type ZapFee = ZapAsset & {
|
|
|
222
311
|
type: ZapFeeType;
|
|
223
312
|
};
|
|
224
313
|
|
|
225
|
-
declare const chainTypes: {
|
|
226
|
-
readonly evm: "evm";
|
|
227
|
-
readonly bvm: "bvm";
|
|
228
|
-
readonly svm: "svm";
|
|
229
|
-
readonly aptosvm: "aptosvm";
|
|
230
|
-
readonly cosmos: "cosmos";
|
|
231
|
-
readonly nearvm: "nearvm";
|
|
232
|
-
readonly starknetvm: "starknetvm";
|
|
233
|
-
readonly stellarvm: "stellarvm";
|
|
234
|
-
readonly suivm: "suivm";
|
|
235
|
-
readonly tonvm: "tonvm";
|
|
236
|
-
readonly tronvm: "tronvm";
|
|
237
|
-
};
|
|
238
|
-
|
|
239
|
-
declare const zapStepAction: {
|
|
240
|
-
readonly execute: "execute";
|
|
241
|
-
};
|
|
242
|
-
|
|
243
|
-
type StepAction = keyof typeof zapStepAction;
|
|
244
|
-
type ZapEvmTxnDetails = {
|
|
245
|
-
type: typeof chainTypes.evm;
|
|
246
|
-
txnId: HexString;
|
|
247
|
-
callData: HexString;
|
|
248
|
-
callTo: HexString;
|
|
249
|
-
value: string;
|
|
250
|
-
estimatedGas: string;
|
|
251
|
-
};
|
|
252
|
-
type ZapBvmTxnDetails = {
|
|
253
|
-
type: typeof chainTypes.bvm;
|
|
254
|
-
txnId: HexString;
|
|
255
|
-
data: string;
|
|
256
|
-
};
|
|
257
|
-
type SVMTxnDetails = {
|
|
258
|
-
type: typeof chainTypes.svm;
|
|
259
|
-
txnId: HexString;
|
|
260
|
-
data: string[];
|
|
261
|
-
blockhash?: {
|
|
262
|
-
blockhash: string;
|
|
263
|
-
lastValidBlockHeight: number;
|
|
264
|
-
};
|
|
265
|
-
estimatedGas: string;
|
|
266
|
-
isJitoTx?: boolean;
|
|
267
|
-
};
|
|
268
|
-
type ZapTxnDetails = ZapEvmTxnDetails | ZapBvmTxnDetails | SVMTxnDetails;
|
|
269
|
-
type ZapTransactionStep<T extends ZapTxnDetails = ZapTxnDetails> = {
|
|
270
|
-
action: StepAction;
|
|
271
|
-
data: T;
|
|
272
|
-
};
|
|
273
|
-
type ZapStep = ZapTransactionStep;
|
|
274
|
-
|
|
275
314
|
type ZapRouteRequestPositionDetails = {
|
|
276
315
|
nftId: string;
|
|
277
316
|
};
|
|
@@ -296,6 +335,7 @@ type ZapBuildTxnResponse = {
|
|
|
296
335
|
output: ZapOutput[];
|
|
297
336
|
steps: ZapStep[];
|
|
298
337
|
path: ZapPath[];
|
|
338
|
+
preExecutionSteps?: ZapPreExecutionStep[];
|
|
299
339
|
};
|
|
300
340
|
type ZapBuildTxnRequest = {
|
|
301
341
|
srcToken: string;
|
|
@@ -308,6 +348,7 @@ type ZapBuildTxnRequest = {
|
|
|
308
348
|
account: string;
|
|
309
349
|
integrator?: ZapIntegratorConfig;
|
|
310
350
|
permitData?: string;
|
|
351
|
+
preExecutionStepsData?: ZapPreExecutionStepData[];
|
|
311
352
|
amount?: string;
|
|
312
353
|
estimateGas?: boolean;
|
|
313
354
|
positionDetails?: ZapRouteRequestPositionDetails;
|
|
@@ -326,9 +367,12 @@ type ZapBundleAction = {
|
|
|
326
367
|
srcChainId: number;
|
|
327
368
|
destToken?: string;
|
|
328
369
|
destChainId?: number;
|
|
370
|
+
destAmount?: string;
|
|
329
371
|
positionDetails?: ZapRouteRequestPositionDetails;
|
|
330
372
|
poolDetails?: ZapRouteRequestPoolDetails;
|
|
331
373
|
protocol?: string;
|
|
374
|
+
permitData?: HexString;
|
|
375
|
+
batchPermitData?: HexString;
|
|
332
376
|
};
|
|
333
377
|
type ZapBundleRequest = {
|
|
334
378
|
actions: ZapBundleAction[];
|
|
@@ -341,6 +385,7 @@ type ZapBundleRequest = {
|
|
|
341
385
|
integrator?: ZapIntegratorConfig;
|
|
342
386
|
allowedDexes?: string[];
|
|
343
387
|
allowedBridges?: string[];
|
|
388
|
+
preExecutionStepsData?: ZapPreExecutionStepData[];
|
|
344
389
|
};
|
|
345
390
|
|
|
346
391
|
type ZapPoolDetailsRequest = {
|
|
@@ -1019,6 +1064,12 @@ type BroadcastTxResponse = {
|
|
|
1019
1064
|
message: string;
|
|
1020
1065
|
};
|
|
1021
1066
|
|
|
1067
|
+
type ZapStepsResult = {
|
|
1068
|
+
status: TxnStatus.success;
|
|
1069
|
+
code: StatusCodes | number;
|
|
1070
|
+
txnHash?: string;
|
|
1071
|
+
} | DZapTransactionResponse;
|
|
1072
|
+
|
|
1022
1073
|
type DecodeTransactionParameters = {
|
|
1023
1074
|
txHash: string;
|
|
1024
1075
|
chainId: number;
|
|
@@ -1973,12 +2024,7 @@ declare class DZapClient {
|
|
|
1973
2024
|
chainId: number;
|
|
1974
2025
|
signer: Signer | WalletClient;
|
|
1975
2026
|
txnData: EvmTxData;
|
|
1976
|
-
}): Promise<{
|
|
1977
|
-
status: TxnStatus;
|
|
1978
|
-
error: any;
|
|
1979
|
-
errorMsg: any;
|
|
1980
|
-
code: StatusCodes;
|
|
1981
|
-
} | {
|
|
2027
|
+
}): Promise<TransactionError | {
|
|
1982
2028
|
status: TxnStatus;
|
|
1983
2029
|
code: StatusCodes;
|
|
1984
2030
|
txnHash: HexString;
|
|
@@ -2046,15 +2092,18 @@ declare class DZapClient {
|
|
|
2046
2092
|
rpcUrls?: string[];
|
|
2047
2093
|
service: AvailableDZapServices;
|
|
2048
2094
|
}>): Promise<SignPermitResponse<T>>;
|
|
2049
|
-
zap({ request, steps, signer, }: {
|
|
2095
|
+
zap({ request, steps, preExecutionSteps, signer, rpcUrls, }: {
|
|
2050
2096
|
request: ZapBuildTxnRequest | ZapBundleRequest;
|
|
2051
2097
|
signer: WalletClient | Signer;
|
|
2052
2098
|
steps?: ZapTransactionStep[];
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2099
|
+
preExecutionSteps?: ZapPreExecutionStep[];
|
|
2100
|
+
rpcUrls?: string[];
|
|
2101
|
+
}): Promise<ZapStepsResult>;
|
|
2102
|
+
prepareZapPreExecutionData({ preExecutionSteps, signer, account, }: {
|
|
2103
|
+
preExecutionSteps?: ZapPreExecutionStep[];
|
|
2104
|
+
signer: WalletClient | Signer;
|
|
2105
|
+
account?: string;
|
|
2106
|
+
}): Promise<ZapPreExecutionResult>;
|
|
2058
2107
|
buildZapTxn(request: ZapBuildTxnRequest): Promise<ZapBuildTxnResponse>;
|
|
2059
2108
|
getZapQuote(request: ZapQuoteRequest): Promise<ZapQuoteResponse>;
|
|
2060
2109
|
getZapBundleQuote(request: ZapBundleRequest): Promise<ZapQuoteResponse>;
|
|
@@ -2824,4 +2873,4 @@ declare const robinhood: {
|
|
|
2824
2873
|
declare const customViemChains: viemChains.Chain[];
|
|
2825
2874
|
declare const viemChainsById: Record<number, viemChains.Chain>;
|
|
2826
2875
|
|
|
2827
|
-
export { type AllowanceType, AllowanceTypes, type ApiRpcResponse, type ApprovalMode, ApprovalModes, type BatchPermitCallbackParams, type BtcTxData, type BtclnTxData, type Chain, type ChainData, type ContractErrorResponse, DZapClient, DZapPermitMode, type DZapTransactionResponse, type DecodeTxnDataClientParams, type DecodeTxnDataClientParamsWithoutService, type DecodeTxnDataResponse, type EvmTxData, type Fee, type FeeDetails, type GaslessTradeBuildTxnResponse, type HexString, type HyperLiquidTxData, OtherAbis, type ParamQuotes, type PermitMode, PermitTypes, type ProtocolAmountErrorDetails, type ProtocolAmountReason, type ProtocolErrorInfo, type ProtocolErrorType, type ProtocolRouteErrorDetails, type ProtocolRouteReason, type ProtocolSlippageErrorDetails, type ProtocolUnknownErrorDetails, type ProviderDetails, type PsbtInput, type PsbtOutput, type QuoteFilter, QuoteFilters, STATUS, type SVMTxnDetails, Services, type SignPermitResponse, type SignatureCallbackParams, SignatureExpiryInSecs, type SinglePermitCallbackParams, StatusCodes, type StepAction, type SvmTxData, type SwapAmountsPatchResult, type SwapInfo, type Token, type TokenInfo, type TokenPermitData, type TokenResponse, type TradeBuildTxnRequest, type TradeBuildTxnRequestData, type TradeBuildTxnResponse, type TradeGasBuildTxnResponse, type TradePath, type TradeQuotesRequest, type TradeQuotesRequestData, type TradeQuotesResponse, type TradeStatusResponse, type TradeStep, TxnStatus, type UnavailableRoutes, type ZapAsset, type ZapBuildTxnRequest, type ZapBuildTxnResponse, type ZapBundleAction, type ZapBundleRequest, type ZapBundleSrcToken, type ZapBvmTxnDetails, type ZapChains, type ZapEvmTxnDetails, type ZapFee, type ZapFeeType, type ZapIntegratorConfig, type ZapOutput, type ZapPath, type ZapPathAction, type ZapPathAsset, type ZapPool, type ZapPoolDetails, type ZapPoolDetailsRequest, type ZapPoolsRequest, type ZapPoolsResponse, type ZapPosition, type ZapPositionsRequest, type ZapPositionsResponse, type ZapProviders, type ZapQuoteRequest, type ZapQuoteResponse, type ZapRefund, type ZapRefundType, type ZapRouteRequestPoolDetails, type ZapRouteRequestPositionDetails, type ZapStatus, type ZapStatusRequest, type ZapStatusResponse, type ZapStatusStep, type ZapStep, type ZapTransactionStep, type ZapTxnDetails, type ZapUnderlyingToken, type ZapUnderlyingTokenWithAmount, arcTestnet, arthera, astralisTestnet, bitcoinTestnet, bitlayer, checkEIP2612PermitSupport, citrea, classifyAddress, contractErrorActions, customViemChains, erc20Functions, extendViemChain, fiveIre, formatToken, getTokensPairKey, hemi, hyperEvm, hyperliquid, katana, merlin, patchSwapAmountsFromTx, pushTestnet, robinhood, stableChain, tempo, viemChainsById, zapFeeType, zapPathAction, zapRefundType, zapStepAction };
|
|
2876
|
+
export { type AllowanceType, AllowanceTypes, type ApiRpcResponse, type ApprovalMode, ApprovalModes, type BatchPermitCallbackParams, type BtcTxData, type BtclnTxData, type Chain, type ChainData, type ContractErrorResponse, DZapClient, DZapPermitMode, type DZapTransactionResponse, type DecodeTxnDataClientParams, type DecodeTxnDataClientParamsWithoutService, type DecodeTxnDataResponse, type EvmTxData, type Fee, type FeeDetails, type GaslessTradeBuildTxnResponse, type HexString, type HyperLiquidTxData, OtherAbis, type ParamQuotes, type PermitMode, PermitTypes, type ProtocolAmountErrorDetails, type ProtocolAmountReason, type ProtocolErrorInfo, type ProtocolErrorType, type ProtocolRouteErrorDetails, type ProtocolRouteReason, type ProtocolSlippageErrorDetails, type ProtocolUnknownErrorDetails, type ProviderDetails, type PsbtInput, type PsbtOutput, type QuoteFilter, QuoteFilters, STATUS, type SVMTxnDetails, Services, type SignPermitResponse, type SignatureCallbackParams, SignatureExpiryInSecs, type SinglePermitCallbackParams, StatusCodes, type StepAction, type SvmTxData, type SwapAmountsPatchResult, type SwapInfo, type Token, type TokenInfo, type TokenPermitData, type TokenResponse, type TradeBuildTxnRequest, type TradeBuildTxnRequestData, type TradeBuildTxnResponse, type TradeGasBuildTxnResponse, type TradePath, type TradeQuotesRequest, type TradeQuotesRequestData, type TradeQuotesResponse, type TradeStatusResponse, type TradeStep, TxnStatus, type UnavailableRoutes, type ZapAsset, type ZapBuildTxnRequest, type ZapBuildTxnResponse, type ZapBundleAction, type ZapBundleRequest, type ZapBundleSrcToken, type ZapBvmTxnDetails, type ZapChains, type ZapEvmTxnDetails, type ZapFee, type ZapFeeType, type ZapIntegratorConfig, type ZapOutput, type ZapPath, type ZapPathAction, type ZapPathAsset, type ZapPool, type ZapPoolDetails, type ZapPoolDetailsRequest, type ZapPoolsRequest, type ZapPoolsResponse, type ZapPosition, type ZapPositionsRequest, type ZapPositionsResponse, type ZapPreExecutionResult, type ZapPreExecutionStep, type ZapPreExecutionStepData, type ZapPreExecutionStepType, type ZapProviders, type ZapQuoteRequest, type ZapQuoteResponse, type ZapRefund, type ZapRefundType, type ZapRouteRequestPoolDetails, type ZapRouteRequestPositionDetails, type ZapSignPreExecutionStep, type ZapSignPreExecutionStepData, type ZapStatus, type ZapStatusRequest, type ZapStatusResponse, type ZapStatusStep, type ZapStep, type ZapTransactionStep, type ZapTxnDetails, type ZapTypedDataPayload, type ZapUnderlyingToken, type ZapUnderlyingTokenWithAmount, arcTestnet, arthera, astralisTestnet, bitcoinTestnet, bitlayer, checkEIP2612PermitSupport, citrea, classifyAddress, contractErrorActions, customViemChains, erc20Functions, extendViemChain, fiveIre, formatToken, getTokensPairKey, hemi, hyperEvm, hyperliquid, katana, merlin, patchSwapAmountsFromTx, pushTestnet, robinhood, stableChain, tempo, viemChainsById, zapFeeType, zapPathAction, zapPreExecutionStepType, zapRefundType, zapStepAction };
|