@dzapio/sdk 2.0.53 → 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 +19 -10
- package/dist/index.d.ts +19 -10
- package/dist/index.js +25 -3
- package/dist/index.mjs +26 -4
- package/package.json +1 -1
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: {
|
|
@@ -175,6 +176,13 @@ declare const zapPreExecutionStepType: {
|
|
|
175
176
|
readonly sign: "sign";
|
|
176
177
|
};
|
|
177
178
|
|
|
179
|
+
type TransactionError = {
|
|
180
|
+
status: Exclude<TxnStatus, TxnStatus.success>;
|
|
181
|
+
error: any;
|
|
182
|
+
errorMsg: string;
|
|
183
|
+
code: StatusCodes;
|
|
184
|
+
};
|
|
185
|
+
|
|
178
186
|
type StepAction = keyof typeof zapStepAction;
|
|
179
187
|
type ZapPreExecutionStepType = keyof typeof zapPreExecutionStepType;
|
|
180
188
|
type ZapEvmTxnDetails = {
|
|
@@ -220,11 +228,11 @@ type ZapSignPreExecutionStepData = {
|
|
|
220
228
|
signature: HexString;
|
|
221
229
|
message: Record<string, unknown>;
|
|
222
230
|
};
|
|
223
|
-
type ZapPreExecutionResult = {
|
|
231
|
+
type ZapPreExecutionResult = Prettify<{
|
|
224
232
|
status: TxnStatus.success;
|
|
225
233
|
code: StatusCodes | number;
|
|
226
234
|
preExecutionStepsData: ZapPreExecutionStepData[];
|
|
227
|
-
} |
|
|
235
|
+
} | TransactionError>;
|
|
228
236
|
type ZapPreExecutionStepData = ZapSignPreExecutionStepData;
|
|
229
237
|
type ZapTransactionStep<T extends ZapTxnDetails = ZapTxnDetails> = {
|
|
230
238
|
action: StepAction;
|
|
@@ -868,7 +876,13 @@ type HyperLiquidSignTypedData<M extends Record<string, unknown> = Record<string,
|
|
|
868
876
|
type HyperLiquidTxData = {
|
|
869
877
|
signTypedData: HyperLiquidSignTypedData[];
|
|
870
878
|
};
|
|
871
|
-
type
|
|
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;
|
|
872
886
|
type TxRequestData<T> = {
|
|
873
887
|
status: typeof STATUS.success;
|
|
874
888
|
txId: string;
|
|
@@ -2017,12 +2031,7 @@ declare class DZapClient {
|
|
|
2017
2031
|
chainId: number;
|
|
2018
2032
|
signer: Signer | WalletClient;
|
|
2019
2033
|
txnData: EvmTxData;
|
|
2020
|
-
}): Promise<{
|
|
2021
|
-
status: TxnStatus;
|
|
2022
|
-
error: any;
|
|
2023
|
-
errorMsg: any;
|
|
2024
|
-
code: StatusCodes;
|
|
2025
|
-
} | {
|
|
2034
|
+
}): Promise<TransactionError | {
|
|
2026
2035
|
status: TxnStatus;
|
|
2027
2036
|
code: StatusCodes;
|
|
2028
2037
|
txnHash: HexString;
|
|
@@ -2871,4 +2880,4 @@ declare const robinhood: {
|
|
|
2871
2880
|
declare const customViemChains: viemChains.Chain[];
|
|
2872
2881
|
declare const viemChainsById: Record<number, viemChains.Chain>;
|
|
2873
2882
|
|
|
2874
|
-
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: {
|
|
@@ -175,6 +176,13 @@ declare const zapPreExecutionStepType: {
|
|
|
175
176
|
readonly sign: "sign";
|
|
176
177
|
};
|
|
177
178
|
|
|
179
|
+
type TransactionError = {
|
|
180
|
+
status: Exclude<TxnStatus, TxnStatus.success>;
|
|
181
|
+
error: any;
|
|
182
|
+
errorMsg: string;
|
|
183
|
+
code: StatusCodes;
|
|
184
|
+
};
|
|
185
|
+
|
|
178
186
|
type StepAction = keyof typeof zapStepAction;
|
|
179
187
|
type ZapPreExecutionStepType = keyof typeof zapPreExecutionStepType;
|
|
180
188
|
type ZapEvmTxnDetails = {
|
|
@@ -220,11 +228,11 @@ type ZapSignPreExecutionStepData = {
|
|
|
220
228
|
signature: HexString;
|
|
221
229
|
message: Record<string, unknown>;
|
|
222
230
|
};
|
|
223
|
-
type ZapPreExecutionResult = {
|
|
231
|
+
type ZapPreExecutionResult = Prettify<{
|
|
224
232
|
status: TxnStatus.success;
|
|
225
233
|
code: StatusCodes | number;
|
|
226
234
|
preExecutionStepsData: ZapPreExecutionStepData[];
|
|
227
|
-
} |
|
|
235
|
+
} | TransactionError>;
|
|
228
236
|
type ZapPreExecutionStepData = ZapSignPreExecutionStepData;
|
|
229
237
|
type ZapTransactionStep<T extends ZapTxnDetails = ZapTxnDetails> = {
|
|
230
238
|
action: StepAction;
|
|
@@ -868,7 +876,13 @@ type HyperLiquidSignTypedData<M extends Record<string, unknown> = Record<string,
|
|
|
868
876
|
type HyperLiquidTxData = {
|
|
869
877
|
signTypedData: HyperLiquidSignTypedData[];
|
|
870
878
|
};
|
|
871
|
-
type
|
|
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;
|
|
872
886
|
type TxRequestData<T> = {
|
|
873
887
|
status: typeof STATUS.success;
|
|
874
888
|
txId: string;
|
|
@@ -2017,12 +2031,7 @@ declare class DZapClient {
|
|
|
2017
2031
|
chainId: number;
|
|
2018
2032
|
signer: Signer | WalletClient;
|
|
2019
2033
|
txnData: EvmTxData;
|
|
2020
|
-
}): Promise<{
|
|
2021
|
-
status: TxnStatus;
|
|
2022
|
-
error: any;
|
|
2023
|
-
errorMsg: any;
|
|
2024
|
-
code: StatusCodes;
|
|
2025
|
-
} | {
|
|
2034
|
+
}): Promise<TransactionError | {
|
|
2026
2035
|
status: TxnStatus;
|
|
2027
2036
|
code: StatusCodes;
|
|
2028
2037
|
txnHash: HexString;
|
|
@@ -2871,4 +2880,4 @@ declare const robinhood: {
|
|
|
2871
2880
|
declare const customViemChains: viemChains.Chain[];
|
|
2872
2881
|
declare const viemChainsById: Record<number, viemChains.Chain>;
|
|
2873
2882
|
|
|
2874
|
-
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
|
|
@@ -14162,7 +14163,7 @@ _ZapPreExecutionStepHandler.handleSignStep = async ({ step, signer, account }) =
|
|
|
14162
14163
|
message,
|
|
14163
14164
|
primaryType
|
|
14164
14165
|
});
|
|
14165
|
-
if (result.status !== "success" /* success */
|
|
14166
|
+
if (result.status !== "success" /* success */) {
|
|
14166
14167
|
return result;
|
|
14167
14168
|
}
|
|
14168
14169
|
return {
|
|
@@ -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
|
|
@@ -14137,7 +14138,7 @@ _ZapPreExecutionStepHandler.handleSignStep = async ({ step, signer, account }) =
|
|
|
14137
14138
|
message,
|
|
14138
14139
|
primaryType
|
|
14139
14140
|
});
|
|
14140
|
-
if (result.status !== "success" /* success */
|
|
14141
|
+
if (result.status !== "success" /* success */) {
|
|
14141
14142
|
return result;
|
|
14142
14143
|
}
|
|
14143
14144
|
return {
|
|
@@ -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.
|
|
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",
|