@dzapio/sdk 2.0.54 → 2.0.55

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 CHANGED
@@ -165,6 +165,7 @@ declare const chainTypes: {
165
165
  readonly suivm: "suivm";
166
166
  readonly tonvm: "tonvm";
167
167
  readonly tronvm: "tronvm";
168
+ readonly zcashvm: "zcashvm";
168
169
  };
169
170
 
170
171
  declare const zapStepAction: {
@@ -875,7 +876,13 @@ type HyperLiquidSignTypedData<M extends Record<string, unknown> = Record<string,
875
876
  type HyperLiquidTxData = {
876
877
  signTypedData: HyperLiquidSignTypedData[];
877
878
  };
878
- type TxData = EvmTxData | SvmTxData | BtcTxData | BtclnTxData | HyperLiquidTxData;
879
+ type ZcashTxData = {
880
+ from: string;
881
+ data: string;
882
+ to: string;
883
+ value: string;
884
+ };
885
+ type TxData = EvmTxData | SvmTxData | BtcTxData | BtclnTxData | HyperLiquidTxData | ZcashTxData;
879
886
  type TxRequestData<T> = {
880
887
  status: typeof STATUS.success;
881
888
  txId: string;
@@ -2873,4 +2880,4 @@ declare const robinhood: {
2873
2880
  declare const customViemChains: viemChains.Chain[];
2874
2881
  declare const viemChainsById: Record<number, viemChains.Chain>;
2875
2882
 
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 };
2883
+ 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, type ZcashTxData, 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
@@ -165,6 +165,7 @@ declare const chainTypes: {
165
165
  readonly suivm: "suivm";
166
166
  readonly tonvm: "tonvm";
167
167
  readonly tronvm: "tronvm";
168
+ readonly zcashvm: "zcashvm";
168
169
  };
169
170
 
170
171
  declare const zapStepAction: {
@@ -875,7 +876,13 @@ type HyperLiquidSignTypedData<M extends Record<string, unknown> = Record<string,
875
876
  type HyperLiquidTxData = {
876
877
  signTypedData: HyperLiquidSignTypedData[];
877
878
  };
878
- type TxData = EvmTxData | SvmTxData | BtcTxData | BtclnTxData | HyperLiquidTxData;
879
+ type ZcashTxData = {
880
+ from: string;
881
+ data: string;
882
+ to: string;
883
+ value: string;
884
+ };
885
+ type TxData = EvmTxData | SvmTxData | BtcTxData | BtclnTxData | HyperLiquidTxData | ZcashTxData;
879
886
  type TxRequestData<T> = {
880
887
  status: typeof STATUS.success;
881
888
  txId: string;
@@ -2873,4 +2880,4 @@ declare const robinhood: {
2873
2880
  declare const customViemChains: viemChains.Chain[];
2874
2881
  declare const viemChainsById: Record<number, viemChains.Chain>;
2875
2882
 
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 };
2883
+ 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, type ZcashTxData, 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.js CHANGED
@@ -11991,7 +11991,8 @@ var chainTypes = {
11991
11991
  aptosvm: "aptosvm",
11992
11992
  suivm: "suivm",
11993
11993
  tonvm: "tonvm",
11994
- tronvm: "tronvm"
11994
+ tronvm: "tronvm",
11995
+ zcashvm: "zcashvm"
11995
11996
  };
11996
11997
 
11997
11998
  // src/constants/contract.ts
@@ -17293,6 +17294,26 @@ async function classifyTronvmAddress(params) {
17293
17294
  return null;
17294
17295
  }
17295
17296
  }
17297
+ var zcashTransparentPrefixes = ["0x1cb8", "0x1cbd"];
17298
+ var isValidZcashAddress = (address) => {
17299
+ try {
17300
+ const decoded = ethers.utils.base58.decode(address);
17301
+ return decoded.length === 26 && zcashTransparentPrefixes.includes(ethers.utils.hexDataSlice(decoded, 0, 2)) && ethers.utils.hexDataSlice(decoded, 22) === ethers.utils.hexDataSlice(ethers.utils.sha256(ethers.utils.sha256(decoded.slice(0, 22))), 0, 4);
17302
+ } catch {
17303
+ return false;
17304
+ }
17305
+ };
17306
+ async function classifyZcashvmAddress({ address }) {
17307
+ const valid = isValidZcashAddress(address);
17308
+ return {
17309
+ valid,
17310
+ kind: valid ? "wallet" /* WALLET */ : "invalid" /* INVALID */,
17311
+ isNative: false,
17312
+ isToken: false,
17313
+ isContract: false,
17314
+ address
17315
+ };
17316
+ }
17296
17317
 
17297
17318
  // src/utils/address/index.ts
17298
17319
  var classifiers = {
@@ -17302,7 +17323,8 @@ var classifiers = {
17302
17323
  [chainTypes.suivm]: classifySuivmAddress,
17303
17324
  [chainTypes.aptosvm]: classifyAptosvmAddress,
17304
17325
  [chainTypes.tonvm]: classifyTonvmAddress,
17305
- [chainTypes.tronvm]: classifyTronvmAddress
17326
+ [chainTypes.tronvm]: classifyTronvmAddress,
17327
+ [chainTypes.zcashvm]: classifyZcashvmAddress
17306
17328
  };
17307
17329
  var getChainType = (chainId, chainConfig) => {
17308
17330
  var _a;
package/dist/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import { encodeAbiParameters, parseAbiParameters, keccak256, encodePacked, stringToHex, defineChain as defineChain$1, zeroAddress as zeroAddress$1, isAddress, getAddress, formatUnits, maxUint256, encodeFunctionData, http, createPublicClient, fallback, decodeAbiParameters, parseEventLogs, maxUint48, getContract } from 'viem';
2
2
  import Axios from 'axios';
3
- import { Signer, ethers } from 'ethers';
3
+ import { Signer, utils, ethers } from 'ethers';
4
4
  import * as viemChains from 'viem/chains';
5
5
  import { arcTestnet as arcTestnet$1, tempo as tempo$1, hemi as hemi$1, citrea as citrea$1, bitlayer as bitlayer$1, merlin as merlin$1, katana as katana$1 } from 'viem/chains';
6
6
  import { defineChain, ChainId } from '@bigmi/core';
@@ -11966,7 +11966,8 @@ var chainTypes = {
11966
11966
  aptosvm: "aptosvm",
11967
11967
  suivm: "suivm",
11968
11968
  tonvm: "tonvm",
11969
- tronvm: "tronvm"
11969
+ tronvm: "tronvm",
11970
+ zcashvm: "zcashvm"
11970
11971
  };
11971
11972
 
11972
11973
  // src/constants/contract.ts
@@ -17268,6 +17269,26 @@ async function classifyTronvmAddress(params) {
17268
17269
  return null;
17269
17270
  }
17270
17271
  }
17272
+ var zcashTransparentPrefixes = ["0x1cb8", "0x1cbd"];
17273
+ var isValidZcashAddress = (address) => {
17274
+ try {
17275
+ const decoded = utils.base58.decode(address);
17276
+ return decoded.length === 26 && zcashTransparentPrefixes.includes(utils.hexDataSlice(decoded, 0, 2)) && utils.hexDataSlice(decoded, 22) === utils.hexDataSlice(utils.sha256(utils.sha256(decoded.slice(0, 22))), 0, 4);
17277
+ } catch {
17278
+ return false;
17279
+ }
17280
+ };
17281
+ async function classifyZcashvmAddress({ address }) {
17282
+ const valid = isValidZcashAddress(address);
17283
+ return {
17284
+ valid,
17285
+ kind: valid ? "wallet" /* WALLET */ : "invalid" /* INVALID */,
17286
+ isNative: false,
17287
+ isToken: false,
17288
+ isContract: false,
17289
+ address
17290
+ };
17291
+ }
17271
17292
 
17272
17293
  // src/utils/address/index.ts
17273
17294
  var classifiers = {
@@ -17277,7 +17298,8 @@ var classifiers = {
17277
17298
  [chainTypes.suivm]: classifySuivmAddress,
17278
17299
  [chainTypes.aptosvm]: classifyAptosvmAddress,
17279
17300
  [chainTypes.tonvm]: classifyTonvmAddress,
17280
- [chainTypes.tronvm]: classifyTronvmAddress
17301
+ [chainTypes.tronvm]: classifyTronvmAddress,
17302
+ [chainTypes.zcashvm]: classifyZcashvmAddress
17281
17303
  };
17282
17304
  var getChainType = (chainId, chainConfig) => {
17283
17305
  var _a;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dzapio/sdk",
3
- "version": "2.0.54",
3
+ "version": "2.0.55",
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",