@dzapio/sdk 2.0.40 → 2.0.42
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 +83 -19
- package/dist/index.d.ts +83 -19
- package/dist/index.js +115 -75
- package/dist/index.mjs +115 -76
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as viem from 'viem';
|
|
2
|
-
import { WalletCallReceipt as WalletCallReceipt$1,
|
|
2
|
+
import { WalletCallReceipt as WalletCallReceipt$1, TypedDataDomain, Prettify, WalletClient, TransactionReceipt, ChainFormatters, Chain as Chain$1, Assign } from 'viem';
|
|
3
3
|
import { Signer } from 'ethers';
|
|
4
4
|
import * as viemChains from 'viem/chains';
|
|
5
5
|
import { Chain as Chain$2 } from 'viem/chains';
|
|
@@ -753,7 +753,19 @@ type BtclnTxData = {
|
|
|
753
753
|
paymentRequest: string;
|
|
754
754
|
paymentExpiry: number;
|
|
755
755
|
};
|
|
756
|
-
type
|
|
756
|
+
type HyperLiquidSignTypedData<M extends Record<string, unknown> = Record<string, unknown>> = {
|
|
757
|
+
domain: TypedDataDomain;
|
|
758
|
+
types: Record<string, {
|
|
759
|
+
name: string;
|
|
760
|
+
type: string;
|
|
761
|
+
}[]>;
|
|
762
|
+
primaryType: string;
|
|
763
|
+
message: M;
|
|
764
|
+
};
|
|
765
|
+
type HyperLiquidTxData = {
|
|
766
|
+
signTypedData: HyperLiquidSignTypedData[];
|
|
767
|
+
};
|
|
768
|
+
type TxData = EvmTxData | SvmTxData | BtcTxData | BtclnTxData | HyperLiquidTxData;
|
|
757
769
|
type TxRequestData<T> = {
|
|
758
770
|
status: typeof STATUS.success;
|
|
759
771
|
txId: string;
|
|
@@ -921,7 +933,14 @@ type PermitErrorResponse = {
|
|
|
921
933
|
permitType: PermitMode;
|
|
922
934
|
};
|
|
923
935
|
type SignPermitResponse<T extends PermitMode = PermitMode> = T extends typeof PermitTypes.AutoPermit ? PermitSingleResponse | PermitBatchResponse | PermitErrorResponse : T extends typeof PermitTypes.PermitBatchWitnessTransferFrom ? PermitBatchResponse | PermitErrorResponse : PermitSingleResponse | PermitErrorResponse;
|
|
924
|
-
type
|
|
936
|
+
type HyperLiquidBroadcastTxData = {
|
|
937
|
+
message: Record<string, unknown>;
|
|
938
|
+
primaryType: string;
|
|
939
|
+
signatureChainId: number;
|
|
940
|
+
signature: HexString;
|
|
941
|
+
account: HexString;
|
|
942
|
+
};
|
|
943
|
+
type BroadcastTxData = string | HyperLiquidBroadcastTxData[];
|
|
925
944
|
type BroadcastTxParams = {
|
|
926
945
|
txId: string;
|
|
927
946
|
chainId: number;
|
|
@@ -2100,6 +2119,52 @@ declare const astralisTestnet: {
|
|
|
2100
2119
|
verifyHash?: ((client: viem.Client, parameters: viem.VerifyHashActionParameters) => Promise<viem.VerifyHashActionReturnType>) | undefined;
|
|
2101
2120
|
};
|
|
2102
2121
|
|
|
2122
|
+
declare const citrea: {
|
|
2123
|
+
blockExplorers: {
|
|
2124
|
+
readonly default: {
|
|
2125
|
+
readonly name: "Citrea Explorer";
|
|
2126
|
+
readonly url: "https://explorer.mainnet.citrea.xyz";
|
|
2127
|
+
readonly apiUrl: "https://explorer.mainnet.citrea.xyz/api";
|
|
2128
|
+
};
|
|
2129
|
+
};
|
|
2130
|
+
blockTime?: number | undefined | undefined;
|
|
2131
|
+
contracts: {
|
|
2132
|
+
readonly multicall3: {
|
|
2133
|
+
readonly address: "0xA738e84fdE890Bc60b99AF7ccE43990E534304de";
|
|
2134
|
+
readonly blockCreated: 2450100;
|
|
2135
|
+
};
|
|
2136
|
+
};
|
|
2137
|
+
ensTlds?: readonly string[] | undefined;
|
|
2138
|
+
id: 4114;
|
|
2139
|
+
name: "Citrea Mainnet";
|
|
2140
|
+
nativeCurrency: {
|
|
2141
|
+
readonly name: "Citrea Bitcoin";
|
|
2142
|
+
readonly symbol: "cBTC";
|
|
2143
|
+
readonly decimals: 18;
|
|
2144
|
+
};
|
|
2145
|
+
experimental_preconfirmationTime?: number | undefined | undefined;
|
|
2146
|
+
rpcUrls: {
|
|
2147
|
+
readonly default: {
|
|
2148
|
+
readonly http: readonly ["https://rpc.mainnet.citrea.xyz"];
|
|
2149
|
+
};
|
|
2150
|
+
};
|
|
2151
|
+
sourceId?: number | undefined | undefined;
|
|
2152
|
+
testnet: false;
|
|
2153
|
+
custom?: Record<string, unknown> | undefined;
|
|
2154
|
+
extendSchema?: Record<string, unknown> | undefined;
|
|
2155
|
+
fees?: viem.ChainFees<undefined> | undefined;
|
|
2156
|
+
prepareTransactionRequest?: ((args: viem.PrepareTransactionRequestParameters, options: {
|
|
2157
|
+
phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
|
|
2158
|
+
}) => Promise<viem.PrepareTransactionRequestParameters>) | [fn: ((args: viem.PrepareTransactionRequestParameters, options: {
|
|
2159
|
+
phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
|
|
2160
|
+
}) => Promise<viem.PrepareTransactionRequestParameters>) | undefined, options: {
|
|
2161
|
+
runAt: readonly ("beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters")[];
|
|
2162
|
+
}] | undefined;
|
|
2163
|
+
serializers?: viem.ChainSerializers<undefined, viem.TransactionSerializable<bigint, number>> | undefined;
|
|
2164
|
+
verifyHash?: ((client: viem.Client, parameters: viem.VerifyHashActionParameters) => Promise<viem.VerifyHashActionReturnType>) | undefined;
|
|
2165
|
+
formatters?: undefined | undefined;
|
|
2166
|
+
};
|
|
2167
|
+
|
|
2103
2168
|
declare const fiveIre: {
|
|
2104
2169
|
blockExplorers: {
|
|
2105
2170
|
readonly default: {
|
|
@@ -2251,7 +2316,7 @@ declare const hyperliquid: {
|
|
|
2251
2316
|
};
|
|
2252
2317
|
};
|
|
2253
2318
|
ensTlds?: readonly string[] | undefined;
|
|
2254
|
-
id:
|
|
2319
|
+
id: 1337;
|
|
2255
2320
|
name: "Hyperliquid";
|
|
2256
2321
|
nativeCurrency: {
|
|
2257
2322
|
readonly name: "HYPE";
|
|
@@ -2374,40 +2439,40 @@ declare const stableChain: {
|
|
|
2374
2439
|
|
|
2375
2440
|
declare const tempo: Chain$2;
|
|
2376
2441
|
|
|
2377
|
-
declare const
|
|
2442
|
+
declare const robinhood: {
|
|
2378
2443
|
blockExplorers: {
|
|
2379
2444
|
readonly default: {
|
|
2380
|
-
readonly name: "
|
|
2381
|
-
readonly url: "https://
|
|
2382
|
-
readonly apiUrl: "https://explorer.mainnet.citrea.xyz/api";
|
|
2445
|
+
readonly name: "Robinhood Scan";
|
|
2446
|
+
readonly url: "https://robinhoodchain.blockscout.com";
|
|
2383
2447
|
};
|
|
2384
2448
|
};
|
|
2385
2449
|
blockTime?: number | undefined | undefined;
|
|
2386
2450
|
contracts: {
|
|
2387
2451
|
readonly multicall3: {
|
|
2388
|
-
readonly address: "
|
|
2389
|
-
readonly blockCreated:
|
|
2452
|
+
readonly address: "0xcA11bde05977b3631167028862bE2a173976CA11";
|
|
2453
|
+
readonly blockCreated: 406;
|
|
2390
2454
|
};
|
|
2391
2455
|
};
|
|
2392
2456
|
ensTlds?: readonly string[] | undefined;
|
|
2393
|
-
id:
|
|
2394
|
-
name: "
|
|
2457
|
+
id: 4663;
|
|
2458
|
+
name: "Robinhood";
|
|
2395
2459
|
nativeCurrency: {
|
|
2396
|
-
readonly name: "Citrea Bitcoin";
|
|
2397
|
-
readonly symbol: "cBTC";
|
|
2398
2460
|
readonly decimals: 18;
|
|
2461
|
+
readonly name: "ETH";
|
|
2462
|
+
readonly symbol: "ETH";
|
|
2399
2463
|
};
|
|
2400
2464
|
experimental_preconfirmationTime?: number | undefined | undefined;
|
|
2401
2465
|
rpcUrls: {
|
|
2402
2466
|
readonly default: {
|
|
2403
|
-
readonly http: readonly ["https://rpc.mainnet.
|
|
2467
|
+
readonly http: readonly ["https://rpc.mainnet.chain.robinhood.com"];
|
|
2404
2468
|
};
|
|
2405
2469
|
};
|
|
2406
2470
|
sourceId?: number | undefined | undefined;
|
|
2407
|
-
testnet
|
|
2471
|
+
testnet?: boolean | undefined | undefined;
|
|
2408
2472
|
custom?: Record<string, unknown> | undefined;
|
|
2409
2473
|
extendSchema?: Record<string, unknown> | undefined;
|
|
2410
2474
|
fees?: viem.ChainFees<undefined> | undefined;
|
|
2475
|
+
formatters?: undefined;
|
|
2411
2476
|
prepareTransactionRequest?: ((args: viem.PrepareTransactionRequestParameters, options: {
|
|
2412
2477
|
phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
|
|
2413
2478
|
}) => Promise<viem.PrepareTransactionRequestParameters>) | [fn: ((args: viem.PrepareTransactionRequestParameters, options: {
|
|
@@ -2415,12 +2480,11 @@ declare const citrea: {
|
|
|
2415
2480
|
}) => Promise<viem.PrepareTransactionRequestParameters>) | undefined, options: {
|
|
2416
2481
|
runAt: readonly ("beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters")[];
|
|
2417
2482
|
}] | undefined;
|
|
2418
|
-
serializers?: viem.ChainSerializers<undefined, viem.TransactionSerializable
|
|
2483
|
+
serializers?: viem.ChainSerializers<undefined, viem.TransactionSerializable> | undefined;
|
|
2419
2484
|
verifyHash?: ((client: viem.Client, parameters: viem.VerifyHashActionParameters) => Promise<viem.VerifyHashActionReturnType>) | undefined;
|
|
2420
|
-
formatters?: undefined | undefined;
|
|
2421
2485
|
};
|
|
2422
2486
|
|
|
2423
2487
|
declare const customViemChains: viemChains.Chain[];
|
|
2424
2488
|
declare const viemChainsById: Record<number, viemChains.Chain>;
|
|
2425
2489
|
|
|
2426
|
-
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 EvmTxData, type Fee, type FeeDetails, type GaslessTradeBuildTxnResponse, type HexString, OtherAbis, type ParamQuotes, type PermitMode, PermitTypes, 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 SwapInfo, SwapInputDataDecoder, 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 ZapBuildTxnRequest, type ZapBuildTxnResponse, type ZapBundleAction, type ZapBundleRequest, type ZapBundleSrcToken, type ZapBvmTxnDetails, type ZapChains, type ZapEvmTxnDetails, type ZapFee, type ZapIntegratorConfig, 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 ZapRouteRequestPoolDetails, type ZapRouteRequestPositionDetails, type ZapStatus, type ZapStatusAsset, type ZapStatusRequest, type ZapStatusResponse, type ZapStatusStep, type ZapStep, type ZapTransactionStep, type ZapTxnDetails, type ZapUnderlyingToken, type ZapUnderlyingTokenWithAmount, arthera, astralisTestnet, checkEIP2612PermitSupport, citrea, classifyAddress, contractErrorActions, customViemChains, erc20Functions, extendViemChain, fiveIre, formatToken, getTokensPairKey, hemi, hyperEvm, hyperliquid, pushTestnet, stableChain, tempo, viemChainsById, zapPathAction, zapStepAction };
|
|
2490
|
+
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 EvmTxData, type Fee, type FeeDetails, type GaslessTradeBuildTxnResponse, type HexString, type HyperLiquidTxData, OtherAbis, type ParamQuotes, type PermitMode, PermitTypes, 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 SwapInfo, SwapInputDataDecoder, 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 ZapBuildTxnRequest, type ZapBuildTxnResponse, type ZapBundleAction, type ZapBundleRequest, type ZapBundleSrcToken, type ZapBvmTxnDetails, type ZapChains, type ZapEvmTxnDetails, type ZapFee, type ZapIntegratorConfig, 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 ZapRouteRequestPoolDetails, type ZapRouteRequestPositionDetails, type ZapStatus, type ZapStatusAsset, type ZapStatusRequest, type ZapStatusResponse, type ZapStatusStep, type ZapStep, type ZapTransactionStep, type ZapTxnDetails, type ZapUnderlyingToken, type ZapUnderlyingTokenWithAmount, arthera, astralisTestnet, checkEIP2612PermitSupport, citrea, classifyAddress, contractErrorActions, customViemChains, erc20Functions, extendViemChain, fiveIre, formatToken, getTokensPairKey, hemi, hyperEvm, hyperliquid, pushTestnet, robinhood, stableChain, tempo, viemChainsById, zapPathAction, zapStepAction };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as viem from 'viem';
|
|
2
|
-
import { WalletCallReceipt as WalletCallReceipt$1,
|
|
2
|
+
import { WalletCallReceipt as WalletCallReceipt$1, TypedDataDomain, Prettify, WalletClient, TransactionReceipt, ChainFormatters, Chain as Chain$1, Assign } from 'viem';
|
|
3
3
|
import { Signer } from 'ethers';
|
|
4
4
|
import * as viemChains from 'viem/chains';
|
|
5
5
|
import { Chain as Chain$2 } from 'viem/chains';
|
|
@@ -753,7 +753,19 @@ type BtclnTxData = {
|
|
|
753
753
|
paymentRequest: string;
|
|
754
754
|
paymentExpiry: number;
|
|
755
755
|
};
|
|
756
|
-
type
|
|
756
|
+
type HyperLiquidSignTypedData<M extends Record<string, unknown> = Record<string, unknown>> = {
|
|
757
|
+
domain: TypedDataDomain;
|
|
758
|
+
types: Record<string, {
|
|
759
|
+
name: string;
|
|
760
|
+
type: string;
|
|
761
|
+
}[]>;
|
|
762
|
+
primaryType: string;
|
|
763
|
+
message: M;
|
|
764
|
+
};
|
|
765
|
+
type HyperLiquidTxData = {
|
|
766
|
+
signTypedData: HyperLiquidSignTypedData[];
|
|
767
|
+
};
|
|
768
|
+
type TxData = EvmTxData | SvmTxData | BtcTxData | BtclnTxData | HyperLiquidTxData;
|
|
757
769
|
type TxRequestData<T> = {
|
|
758
770
|
status: typeof STATUS.success;
|
|
759
771
|
txId: string;
|
|
@@ -921,7 +933,14 @@ type PermitErrorResponse = {
|
|
|
921
933
|
permitType: PermitMode;
|
|
922
934
|
};
|
|
923
935
|
type SignPermitResponse<T extends PermitMode = PermitMode> = T extends typeof PermitTypes.AutoPermit ? PermitSingleResponse | PermitBatchResponse | PermitErrorResponse : T extends typeof PermitTypes.PermitBatchWitnessTransferFrom ? PermitBatchResponse | PermitErrorResponse : PermitSingleResponse | PermitErrorResponse;
|
|
924
|
-
type
|
|
936
|
+
type HyperLiquidBroadcastTxData = {
|
|
937
|
+
message: Record<string, unknown>;
|
|
938
|
+
primaryType: string;
|
|
939
|
+
signatureChainId: number;
|
|
940
|
+
signature: HexString;
|
|
941
|
+
account: HexString;
|
|
942
|
+
};
|
|
943
|
+
type BroadcastTxData = string | HyperLiquidBroadcastTxData[];
|
|
925
944
|
type BroadcastTxParams = {
|
|
926
945
|
txId: string;
|
|
927
946
|
chainId: number;
|
|
@@ -2100,6 +2119,52 @@ declare const astralisTestnet: {
|
|
|
2100
2119
|
verifyHash?: ((client: viem.Client, parameters: viem.VerifyHashActionParameters) => Promise<viem.VerifyHashActionReturnType>) | undefined;
|
|
2101
2120
|
};
|
|
2102
2121
|
|
|
2122
|
+
declare const citrea: {
|
|
2123
|
+
blockExplorers: {
|
|
2124
|
+
readonly default: {
|
|
2125
|
+
readonly name: "Citrea Explorer";
|
|
2126
|
+
readonly url: "https://explorer.mainnet.citrea.xyz";
|
|
2127
|
+
readonly apiUrl: "https://explorer.mainnet.citrea.xyz/api";
|
|
2128
|
+
};
|
|
2129
|
+
};
|
|
2130
|
+
blockTime?: number | undefined | undefined;
|
|
2131
|
+
contracts: {
|
|
2132
|
+
readonly multicall3: {
|
|
2133
|
+
readonly address: "0xA738e84fdE890Bc60b99AF7ccE43990E534304de";
|
|
2134
|
+
readonly blockCreated: 2450100;
|
|
2135
|
+
};
|
|
2136
|
+
};
|
|
2137
|
+
ensTlds?: readonly string[] | undefined;
|
|
2138
|
+
id: 4114;
|
|
2139
|
+
name: "Citrea Mainnet";
|
|
2140
|
+
nativeCurrency: {
|
|
2141
|
+
readonly name: "Citrea Bitcoin";
|
|
2142
|
+
readonly symbol: "cBTC";
|
|
2143
|
+
readonly decimals: 18;
|
|
2144
|
+
};
|
|
2145
|
+
experimental_preconfirmationTime?: number | undefined | undefined;
|
|
2146
|
+
rpcUrls: {
|
|
2147
|
+
readonly default: {
|
|
2148
|
+
readonly http: readonly ["https://rpc.mainnet.citrea.xyz"];
|
|
2149
|
+
};
|
|
2150
|
+
};
|
|
2151
|
+
sourceId?: number | undefined | undefined;
|
|
2152
|
+
testnet: false;
|
|
2153
|
+
custom?: Record<string, unknown> | undefined;
|
|
2154
|
+
extendSchema?: Record<string, unknown> | undefined;
|
|
2155
|
+
fees?: viem.ChainFees<undefined> | undefined;
|
|
2156
|
+
prepareTransactionRequest?: ((args: viem.PrepareTransactionRequestParameters, options: {
|
|
2157
|
+
phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
|
|
2158
|
+
}) => Promise<viem.PrepareTransactionRequestParameters>) | [fn: ((args: viem.PrepareTransactionRequestParameters, options: {
|
|
2159
|
+
phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
|
|
2160
|
+
}) => Promise<viem.PrepareTransactionRequestParameters>) | undefined, options: {
|
|
2161
|
+
runAt: readonly ("beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters")[];
|
|
2162
|
+
}] | undefined;
|
|
2163
|
+
serializers?: viem.ChainSerializers<undefined, viem.TransactionSerializable<bigint, number>> | undefined;
|
|
2164
|
+
verifyHash?: ((client: viem.Client, parameters: viem.VerifyHashActionParameters) => Promise<viem.VerifyHashActionReturnType>) | undefined;
|
|
2165
|
+
formatters?: undefined | undefined;
|
|
2166
|
+
};
|
|
2167
|
+
|
|
2103
2168
|
declare const fiveIre: {
|
|
2104
2169
|
blockExplorers: {
|
|
2105
2170
|
readonly default: {
|
|
@@ -2251,7 +2316,7 @@ declare const hyperliquid: {
|
|
|
2251
2316
|
};
|
|
2252
2317
|
};
|
|
2253
2318
|
ensTlds?: readonly string[] | undefined;
|
|
2254
|
-
id:
|
|
2319
|
+
id: 1337;
|
|
2255
2320
|
name: "Hyperliquid";
|
|
2256
2321
|
nativeCurrency: {
|
|
2257
2322
|
readonly name: "HYPE";
|
|
@@ -2374,40 +2439,40 @@ declare const stableChain: {
|
|
|
2374
2439
|
|
|
2375
2440
|
declare const tempo: Chain$2;
|
|
2376
2441
|
|
|
2377
|
-
declare const
|
|
2442
|
+
declare const robinhood: {
|
|
2378
2443
|
blockExplorers: {
|
|
2379
2444
|
readonly default: {
|
|
2380
|
-
readonly name: "
|
|
2381
|
-
readonly url: "https://
|
|
2382
|
-
readonly apiUrl: "https://explorer.mainnet.citrea.xyz/api";
|
|
2445
|
+
readonly name: "Robinhood Scan";
|
|
2446
|
+
readonly url: "https://robinhoodchain.blockscout.com";
|
|
2383
2447
|
};
|
|
2384
2448
|
};
|
|
2385
2449
|
blockTime?: number | undefined | undefined;
|
|
2386
2450
|
contracts: {
|
|
2387
2451
|
readonly multicall3: {
|
|
2388
|
-
readonly address: "
|
|
2389
|
-
readonly blockCreated:
|
|
2452
|
+
readonly address: "0xcA11bde05977b3631167028862bE2a173976CA11";
|
|
2453
|
+
readonly blockCreated: 406;
|
|
2390
2454
|
};
|
|
2391
2455
|
};
|
|
2392
2456
|
ensTlds?: readonly string[] | undefined;
|
|
2393
|
-
id:
|
|
2394
|
-
name: "
|
|
2457
|
+
id: 4663;
|
|
2458
|
+
name: "Robinhood";
|
|
2395
2459
|
nativeCurrency: {
|
|
2396
|
-
readonly name: "Citrea Bitcoin";
|
|
2397
|
-
readonly symbol: "cBTC";
|
|
2398
2460
|
readonly decimals: 18;
|
|
2461
|
+
readonly name: "ETH";
|
|
2462
|
+
readonly symbol: "ETH";
|
|
2399
2463
|
};
|
|
2400
2464
|
experimental_preconfirmationTime?: number | undefined | undefined;
|
|
2401
2465
|
rpcUrls: {
|
|
2402
2466
|
readonly default: {
|
|
2403
|
-
readonly http: readonly ["https://rpc.mainnet.
|
|
2467
|
+
readonly http: readonly ["https://rpc.mainnet.chain.robinhood.com"];
|
|
2404
2468
|
};
|
|
2405
2469
|
};
|
|
2406
2470
|
sourceId?: number | undefined | undefined;
|
|
2407
|
-
testnet
|
|
2471
|
+
testnet?: boolean | undefined | undefined;
|
|
2408
2472
|
custom?: Record<string, unknown> | undefined;
|
|
2409
2473
|
extendSchema?: Record<string, unknown> | undefined;
|
|
2410
2474
|
fees?: viem.ChainFees<undefined> | undefined;
|
|
2475
|
+
formatters?: undefined;
|
|
2411
2476
|
prepareTransactionRequest?: ((args: viem.PrepareTransactionRequestParameters, options: {
|
|
2412
2477
|
phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
|
|
2413
2478
|
}) => Promise<viem.PrepareTransactionRequestParameters>) | [fn: ((args: viem.PrepareTransactionRequestParameters, options: {
|
|
@@ -2415,12 +2480,11 @@ declare const citrea: {
|
|
|
2415
2480
|
}) => Promise<viem.PrepareTransactionRequestParameters>) | undefined, options: {
|
|
2416
2481
|
runAt: readonly ("beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters")[];
|
|
2417
2482
|
}] | undefined;
|
|
2418
|
-
serializers?: viem.ChainSerializers<undefined, viem.TransactionSerializable
|
|
2483
|
+
serializers?: viem.ChainSerializers<undefined, viem.TransactionSerializable> | undefined;
|
|
2419
2484
|
verifyHash?: ((client: viem.Client, parameters: viem.VerifyHashActionParameters) => Promise<viem.VerifyHashActionReturnType>) | undefined;
|
|
2420
|
-
formatters?: undefined | undefined;
|
|
2421
2485
|
};
|
|
2422
2486
|
|
|
2423
2487
|
declare const customViemChains: viemChains.Chain[];
|
|
2424
2488
|
declare const viemChainsById: Record<number, viemChains.Chain>;
|
|
2425
2489
|
|
|
2426
|
-
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 EvmTxData, type Fee, type FeeDetails, type GaslessTradeBuildTxnResponse, type HexString, OtherAbis, type ParamQuotes, type PermitMode, PermitTypes, 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 SwapInfo, SwapInputDataDecoder, 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 ZapBuildTxnRequest, type ZapBuildTxnResponse, type ZapBundleAction, type ZapBundleRequest, type ZapBundleSrcToken, type ZapBvmTxnDetails, type ZapChains, type ZapEvmTxnDetails, type ZapFee, type ZapIntegratorConfig, 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 ZapRouteRequestPoolDetails, type ZapRouteRequestPositionDetails, type ZapStatus, type ZapStatusAsset, type ZapStatusRequest, type ZapStatusResponse, type ZapStatusStep, type ZapStep, type ZapTransactionStep, type ZapTxnDetails, type ZapUnderlyingToken, type ZapUnderlyingTokenWithAmount, arthera, astralisTestnet, checkEIP2612PermitSupport, citrea, classifyAddress, contractErrorActions, customViemChains, erc20Functions, extendViemChain, fiveIre, formatToken, getTokensPairKey, hemi, hyperEvm, hyperliquid, pushTestnet, stableChain, tempo, viemChainsById, zapPathAction, zapStepAction };
|
|
2490
|
+
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 EvmTxData, type Fee, type FeeDetails, type GaslessTradeBuildTxnResponse, type HexString, type HyperLiquidTxData, OtherAbis, type ParamQuotes, type PermitMode, PermitTypes, 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 SwapInfo, SwapInputDataDecoder, 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 ZapBuildTxnRequest, type ZapBuildTxnResponse, type ZapBundleAction, type ZapBundleRequest, type ZapBundleSrcToken, type ZapBvmTxnDetails, type ZapChains, type ZapEvmTxnDetails, type ZapFee, type ZapIntegratorConfig, 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 ZapRouteRequestPoolDetails, type ZapRouteRequestPositionDetails, type ZapStatus, type ZapStatusAsset, type ZapStatusRequest, type ZapStatusResponse, type ZapStatusStep, type ZapStep, type ZapTransactionStep, type ZapTxnDetails, type ZapUnderlyingToken, type ZapUnderlyingTokenWithAmount, arthera, astralisTestnet, checkEIP2612PermitSupport, citrea, classifyAddress, contractErrorActions, customViemChains, erc20Functions, extendViemChain, fiveIre, formatToken, getTokensPairKey, hemi, hyperEvm, hyperliquid, pushTestnet, robinhood, stableChain, tempo, viemChainsById, zapPathAction, zapStepAction };
|
package/dist/index.js
CHANGED
|
@@ -10656,6 +10656,28 @@ var astralisTestnet = /* @__PURE__ */ viem.defineChain({
|
|
|
10656
10656
|
}
|
|
10657
10657
|
}
|
|
10658
10658
|
});
|
|
10659
|
+
|
|
10660
|
+
// src/utils/extendViemChain.ts
|
|
10661
|
+
function extendViemChain(base, extension) {
|
|
10662
|
+
const chain = {
|
|
10663
|
+
formatters: void 0,
|
|
10664
|
+
fees: void 0,
|
|
10665
|
+
serializers: void 0,
|
|
10666
|
+
...base,
|
|
10667
|
+
...extension
|
|
10668
|
+
};
|
|
10669
|
+
return chain;
|
|
10670
|
+
}
|
|
10671
|
+
|
|
10672
|
+
// src/chains/definitions/citrea.ts
|
|
10673
|
+
var citrea = extendViemChain(viemChains.citrea, {
|
|
10674
|
+
contracts: {
|
|
10675
|
+
multicall3: {
|
|
10676
|
+
address: "0xA738e84fdE890Bc60b99AF7ccE43990E534304de",
|
|
10677
|
+
blockCreated: 2450100
|
|
10678
|
+
}
|
|
10679
|
+
}
|
|
10680
|
+
});
|
|
10659
10681
|
var fiveIre = /* @__PURE__ */ viem.defineChain({
|
|
10660
10682
|
id: 995,
|
|
10661
10683
|
name: "5ire",
|
|
@@ -10680,20 +10702,6 @@ var fiveIre = /* @__PURE__ */ viem.defineChain({
|
|
|
10680
10702
|
}
|
|
10681
10703
|
}
|
|
10682
10704
|
});
|
|
10683
|
-
|
|
10684
|
-
// src/utils/extendViemChain.ts
|
|
10685
|
-
function extendViemChain(base, extension) {
|
|
10686
|
-
const chain = {
|
|
10687
|
-
formatters: void 0,
|
|
10688
|
-
fees: void 0,
|
|
10689
|
-
serializers: void 0,
|
|
10690
|
-
...base,
|
|
10691
|
-
...extension
|
|
10692
|
-
};
|
|
10693
|
-
return chain;
|
|
10694
|
-
}
|
|
10695
|
-
|
|
10696
|
-
// src/chains/definitions/hemi.ts
|
|
10697
10705
|
var hemi = extendViemChain(viemChains.hemi, {
|
|
10698
10706
|
contracts: {
|
|
10699
10707
|
multicall3: {
|
|
@@ -10725,7 +10733,7 @@ var hyperEvm = /* @__PURE__ */ viem.defineChain({
|
|
|
10725
10733
|
}
|
|
10726
10734
|
});
|
|
10727
10735
|
var hyperliquid = /* @__PURE__ */ viem.defineChain({
|
|
10728
|
-
id:
|
|
10736
|
+
id: 1337,
|
|
10729
10737
|
name: "Hyperliquid",
|
|
10730
10738
|
nativeCurrency: { name: "HYPE", symbol: "HYPE", decimals: 18 },
|
|
10731
10739
|
contracts: {
|
|
@@ -10770,6 +10778,30 @@ var pushTestnet = /* @__PURE__ */ viem.defineChain({
|
|
|
10770
10778
|
}
|
|
10771
10779
|
}
|
|
10772
10780
|
});
|
|
10781
|
+
var robinhood = /* @__PURE__ */ viem.defineChain({
|
|
10782
|
+
id: 4663,
|
|
10783
|
+
name: "Robinhood",
|
|
10784
|
+
nativeCurrency: {
|
|
10785
|
+
decimals: 18,
|
|
10786
|
+
name: "ETH",
|
|
10787
|
+
symbol: "ETH"
|
|
10788
|
+
},
|
|
10789
|
+
rpcUrls: {
|
|
10790
|
+
default: { http: ["https://rpc.mainnet.chain.robinhood.com"] }
|
|
10791
|
+
},
|
|
10792
|
+
blockExplorers: {
|
|
10793
|
+
default: {
|
|
10794
|
+
name: "Robinhood Scan",
|
|
10795
|
+
url: "https://robinhoodchain.blockscout.com"
|
|
10796
|
+
}
|
|
10797
|
+
},
|
|
10798
|
+
contracts: {
|
|
10799
|
+
multicall3: {
|
|
10800
|
+
address: "0xcA11bde05977b3631167028862bE2a173976CA11",
|
|
10801
|
+
blockCreated: 406
|
|
10802
|
+
}
|
|
10803
|
+
}
|
|
10804
|
+
});
|
|
10773
10805
|
var stableChain = /* @__PURE__ */ viem.defineChain({
|
|
10774
10806
|
id: 988,
|
|
10775
10807
|
name: "Stable",
|
|
@@ -10806,14 +10838,6 @@ var tempo = viemChains.tempo.extend({
|
|
|
10806
10838
|
}
|
|
10807
10839
|
}
|
|
10808
10840
|
});
|
|
10809
|
-
var citrea = extendViemChain(viemChains.citrea, {
|
|
10810
|
-
contracts: {
|
|
10811
|
-
multicall3: {
|
|
10812
|
-
address: "0xA738e84fdE890Bc60b99AF7ccE43990E534304de",
|
|
10813
|
-
blockCreated: 2450100
|
|
10814
|
-
}
|
|
10815
|
-
}
|
|
10816
|
-
});
|
|
10817
10841
|
|
|
10818
10842
|
// src/chains/index.ts
|
|
10819
10843
|
var customViemChains = [
|
|
@@ -10826,7 +10850,8 @@ var customViemChains = [
|
|
|
10826
10850
|
astralisTestnet,
|
|
10827
10851
|
tempo,
|
|
10828
10852
|
hemi,
|
|
10829
|
-
citrea
|
|
10853
|
+
citrea,
|
|
10854
|
+
robinhood
|
|
10830
10855
|
];
|
|
10831
10856
|
var viemChainsById = [...Object.values(viemChains__namespace), ...customViemChains].reduce((acc, chainData) => {
|
|
10832
10857
|
return chainData.id ? {
|
|
@@ -12886,7 +12911,7 @@ var exclusiveChainIds = {
|
|
|
12886
12911
|
abstract: 2741,
|
|
12887
12912
|
lens: 232,
|
|
12888
12913
|
citreaTestnet: 5115,
|
|
12889
|
-
hyperLiquid:
|
|
12914
|
+
hyperLiquid: 1337,
|
|
12890
12915
|
citrea: 4114,
|
|
12891
12916
|
pushTestnet: 42101,
|
|
12892
12917
|
astralisTestnet: 71261,
|
|
@@ -14769,6 +14794,61 @@ var signCustomTypedData = async (params) => {
|
|
|
14769
14794
|
}
|
|
14770
14795
|
};
|
|
14771
14796
|
|
|
14797
|
+
// src/transactionHandlers/hyperliquid.ts
|
|
14798
|
+
var HyperLiquidTxHandler = class {
|
|
14799
|
+
};
|
|
14800
|
+
HyperLiquidTxHandler.sendTransaction = async (signer, account, txnData, chainId, additionalInfo, updatedQuotes) => {
|
|
14801
|
+
var _a;
|
|
14802
|
+
const signTypedData2 = "signTypedData" in txnData.transaction ? txnData.transaction.signTypedData : null;
|
|
14803
|
+
if (!signTypedData2) {
|
|
14804
|
+
return {
|
|
14805
|
+
status: "error" /* error */,
|
|
14806
|
+
errorMsg: "Missing typed data for HyperLiquid transaction",
|
|
14807
|
+
code: 500 /* Error */
|
|
14808
|
+
};
|
|
14809
|
+
}
|
|
14810
|
+
const txData = [];
|
|
14811
|
+
for (let i = 0; i < signTypedData2.length; i++) {
|
|
14812
|
+
const typedData = signTypedData2[i];
|
|
14813
|
+
const [resp, signatureChainId] = await Promise.all([
|
|
14814
|
+
signCustomTypedData({
|
|
14815
|
+
signer,
|
|
14816
|
+
account,
|
|
14817
|
+
domain: typedData.domain,
|
|
14818
|
+
types: typedData.types,
|
|
14819
|
+
message: typedData.message,
|
|
14820
|
+
primaryType: typedData.primaryType
|
|
14821
|
+
}),
|
|
14822
|
+
signer.getChainId()
|
|
14823
|
+
]);
|
|
14824
|
+
if (resp.status !== "success" /* success */ || !((_a = resp.data) == null ? void 0 : _a.signature)) {
|
|
14825
|
+
throw new Error("Failed to sign transaction");
|
|
14826
|
+
}
|
|
14827
|
+
txData.push({
|
|
14828
|
+
primaryType: typedData.primaryType,
|
|
14829
|
+
message: typedData.message,
|
|
14830
|
+
signature: resp.data.signature,
|
|
14831
|
+
account,
|
|
14832
|
+
signatureChainId
|
|
14833
|
+
});
|
|
14834
|
+
}
|
|
14835
|
+
const txResp = await broadcastTradeTx({
|
|
14836
|
+
chainId,
|
|
14837
|
+
txData,
|
|
14838
|
+
txId: txnData.txId
|
|
14839
|
+
});
|
|
14840
|
+
if (txResp.status !== "success" /* success */) {
|
|
14841
|
+
throw new Error("Failed to broadcast or save transaction");
|
|
14842
|
+
}
|
|
14843
|
+
return {
|
|
14844
|
+
status: "success" /* success */,
|
|
14845
|
+
code: 200 /* Success */,
|
|
14846
|
+
txnHash: txResp.txnHash,
|
|
14847
|
+
additionalInfo,
|
|
14848
|
+
updatedQuotes
|
|
14849
|
+
};
|
|
14850
|
+
};
|
|
14851
|
+
|
|
14772
14852
|
// src/transactionHandlers/trade.ts
|
|
14773
14853
|
var _TradeTxnHandler = class _TradeTxnHandler {
|
|
14774
14854
|
};
|
|
@@ -14842,54 +14922,6 @@ _TradeTxnHandler.sendTxnWithBatch = async (request, signer, txnParams, chainId,
|
|
|
14842
14922
|
updatedQuotes
|
|
14843
14923
|
};
|
|
14844
14924
|
};
|
|
14845
|
-
_TradeTxnHandler.sendHyperLiquidTransaction = async (signer, txnParams, txnData, chainId, additionalInfo, updatedQuotes) => {
|
|
14846
|
-
var _a;
|
|
14847
|
-
let txnDetails;
|
|
14848
|
-
if (chainId === exclusiveChainIds.hyperLiquid) {
|
|
14849
|
-
const providerData = additionalInfo ? Object.values(additionalInfo)[0] : null;
|
|
14850
|
-
const typedData = providerData && "typedData" in providerData ? providerData.typedData : null;
|
|
14851
|
-
if (!additionalInfo || !typedData) {
|
|
14852
|
-
return {
|
|
14853
|
-
status: "error" /* error */,
|
|
14854
|
-
errorMsg: "Missing additional info for HyperLiquid transaction",
|
|
14855
|
-
code: 500 /* Error */
|
|
14856
|
-
};
|
|
14857
|
-
}
|
|
14858
|
-
const resp = await signCustomTypedData({
|
|
14859
|
-
signer,
|
|
14860
|
-
account: txnParams.from,
|
|
14861
|
-
domain: typedData.domain,
|
|
14862
|
-
types: typedData.types,
|
|
14863
|
-
message: typedData.message,
|
|
14864
|
-
primaryType: typedData.primaryType
|
|
14865
|
-
});
|
|
14866
|
-
if (resp.status !== "success" /* success */) {
|
|
14867
|
-
throw new Error("Failed to sign transaction");
|
|
14868
|
-
}
|
|
14869
|
-
txnDetails = (_a = resp.data) == null ? void 0 : _a.signature;
|
|
14870
|
-
} else {
|
|
14871
|
-
const resp = await _TradeTxnHandler.sendTransaction(signer, txnParams, chainId, additionalInfo, updatedQuotes);
|
|
14872
|
-
if (resp.status !== "success" /* success */) {
|
|
14873
|
-
throw new Error("Failed to sign transaction");
|
|
14874
|
-
}
|
|
14875
|
-
txnDetails = resp.txnHash;
|
|
14876
|
-
}
|
|
14877
|
-
const txResp = await broadcastTradeTx({
|
|
14878
|
-
chainId,
|
|
14879
|
-
txData: txnDetails,
|
|
14880
|
-
txId: txnData.txId
|
|
14881
|
-
});
|
|
14882
|
-
if (txResp.status !== "success" /* success */) {
|
|
14883
|
-
throw new Error("Failed to broadcast or save transaction");
|
|
14884
|
-
}
|
|
14885
|
-
return {
|
|
14886
|
-
status: "success" /* success */,
|
|
14887
|
-
code: 200 /* Success */,
|
|
14888
|
-
txnHash: txResp.txnHash,
|
|
14889
|
-
additionalInfo,
|
|
14890
|
-
updatedQuotes
|
|
14891
|
-
};
|
|
14892
|
-
};
|
|
14893
14925
|
_TradeTxnHandler.buildAndSendTransaction = async ({
|
|
14894
14926
|
request,
|
|
14895
14927
|
signer,
|
|
@@ -14909,8 +14941,15 @@ _TradeTxnHandler.buildAndSendTransaction = async ({
|
|
|
14909
14941
|
}
|
|
14910
14942
|
const { data, from, to, value, gasLimit, additionalInfo, updatedQuotes } = buildTxnResponseData;
|
|
14911
14943
|
const txnParams = { from, to, data, value, gasLimit };
|
|
14912
|
-
if (
|
|
14913
|
-
return
|
|
14944
|
+
if (chainId === exclusiveChainIds.hyperLiquid) {
|
|
14945
|
+
return HyperLiquidTxHandler.sendTransaction(
|
|
14946
|
+
signer,
|
|
14947
|
+
txnParams.from,
|
|
14948
|
+
buildTxnResponseData,
|
|
14949
|
+
chainId,
|
|
14950
|
+
additionalInfo,
|
|
14951
|
+
updatedQuotes
|
|
14952
|
+
);
|
|
14914
14953
|
}
|
|
14915
14954
|
if (batchTransaction && !isTypeSigner(signer)) {
|
|
14916
14955
|
return _TradeTxnHandler.sendTxnWithBatch(request, signer, txnParams, chainId, additionalInfo, updatedQuotes, multicallAddress, rpcUrls);
|
|
@@ -17029,6 +17068,7 @@ exports.hemi = hemi;
|
|
|
17029
17068
|
exports.hyperEvm = hyperEvm;
|
|
17030
17069
|
exports.hyperliquid = hyperliquid;
|
|
17031
17070
|
exports.pushTestnet = pushTestnet;
|
|
17071
|
+
exports.robinhood = robinhood;
|
|
17032
17072
|
exports.stableChain = stableChain;
|
|
17033
17073
|
exports.tempo = tempo;
|
|
17034
17074
|
exports.viemChainsById = viemChainsById;
|
package/dist/index.mjs
CHANGED
|
@@ -10630,6 +10630,28 @@ var astralisTestnet = /* @__PURE__ */ defineChain({
|
|
|
10630
10630
|
}
|
|
10631
10631
|
}
|
|
10632
10632
|
});
|
|
10633
|
+
|
|
10634
|
+
// src/utils/extendViemChain.ts
|
|
10635
|
+
function extendViemChain(base, extension) {
|
|
10636
|
+
const chain = {
|
|
10637
|
+
formatters: void 0,
|
|
10638
|
+
fees: void 0,
|
|
10639
|
+
serializers: void 0,
|
|
10640
|
+
...base,
|
|
10641
|
+
...extension
|
|
10642
|
+
};
|
|
10643
|
+
return chain;
|
|
10644
|
+
}
|
|
10645
|
+
|
|
10646
|
+
// src/chains/definitions/citrea.ts
|
|
10647
|
+
var citrea = extendViemChain(citrea$1, {
|
|
10648
|
+
contracts: {
|
|
10649
|
+
multicall3: {
|
|
10650
|
+
address: "0xA738e84fdE890Bc60b99AF7ccE43990E534304de",
|
|
10651
|
+
blockCreated: 2450100
|
|
10652
|
+
}
|
|
10653
|
+
}
|
|
10654
|
+
});
|
|
10633
10655
|
var fiveIre = /* @__PURE__ */ defineChain({
|
|
10634
10656
|
id: 995,
|
|
10635
10657
|
name: "5ire",
|
|
@@ -10654,20 +10676,6 @@ var fiveIre = /* @__PURE__ */ defineChain({
|
|
|
10654
10676
|
}
|
|
10655
10677
|
}
|
|
10656
10678
|
});
|
|
10657
|
-
|
|
10658
|
-
// src/utils/extendViemChain.ts
|
|
10659
|
-
function extendViemChain(base, extension) {
|
|
10660
|
-
const chain = {
|
|
10661
|
-
formatters: void 0,
|
|
10662
|
-
fees: void 0,
|
|
10663
|
-
serializers: void 0,
|
|
10664
|
-
...base,
|
|
10665
|
-
...extension
|
|
10666
|
-
};
|
|
10667
|
-
return chain;
|
|
10668
|
-
}
|
|
10669
|
-
|
|
10670
|
-
// src/chains/definitions/hemi.ts
|
|
10671
10679
|
var hemi = extendViemChain(hemi$1, {
|
|
10672
10680
|
contracts: {
|
|
10673
10681
|
multicall3: {
|
|
@@ -10699,7 +10707,7 @@ var hyperEvm = /* @__PURE__ */ defineChain({
|
|
|
10699
10707
|
}
|
|
10700
10708
|
});
|
|
10701
10709
|
var hyperliquid = /* @__PURE__ */ defineChain({
|
|
10702
|
-
id:
|
|
10710
|
+
id: 1337,
|
|
10703
10711
|
name: "Hyperliquid",
|
|
10704
10712
|
nativeCurrency: { name: "HYPE", symbol: "HYPE", decimals: 18 },
|
|
10705
10713
|
contracts: {
|
|
@@ -10744,6 +10752,30 @@ var pushTestnet = /* @__PURE__ */ defineChain({
|
|
|
10744
10752
|
}
|
|
10745
10753
|
}
|
|
10746
10754
|
});
|
|
10755
|
+
var robinhood = /* @__PURE__ */ defineChain({
|
|
10756
|
+
id: 4663,
|
|
10757
|
+
name: "Robinhood",
|
|
10758
|
+
nativeCurrency: {
|
|
10759
|
+
decimals: 18,
|
|
10760
|
+
name: "ETH",
|
|
10761
|
+
symbol: "ETH"
|
|
10762
|
+
},
|
|
10763
|
+
rpcUrls: {
|
|
10764
|
+
default: { http: ["https://rpc.mainnet.chain.robinhood.com"] }
|
|
10765
|
+
},
|
|
10766
|
+
blockExplorers: {
|
|
10767
|
+
default: {
|
|
10768
|
+
name: "Robinhood Scan",
|
|
10769
|
+
url: "https://robinhoodchain.blockscout.com"
|
|
10770
|
+
}
|
|
10771
|
+
},
|
|
10772
|
+
contracts: {
|
|
10773
|
+
multicall3: {
|
|
10774
|
+
address: "0xcA11bde05977b3631167028862bE2a173976CA11",
|
|
10775
|
+
blockCreated: 406
|
|
10776
|
+
}
|
|
10777
|
+
}
|
|
10778
|
+
});
|
|
10747
10779
|
var stableChain = /* @__PURE__ */ defineChain({
|
|
10748
10780
|
id: 988,
|
|
10749
10781
|
name: "Stable",
|
|
@@ -10780,14 +10812,6 @@ var tempo = tempo$1.extend({
|
|
|
10780
10812
|
}
|
|
10781
10813
|
}
|
|
10782
10814
|
});
|
|
10783
|
-
var citrea = extendViemChain(citrea$1, {
|
|
10784
|
-
contracts: {
|
|
10785
|
-
multicall3: {
|
|
10786
|
-
address: "0xA738e84fdE890Bc60b99AF7ccE43990E534304de",
|
|
10787
|
-
blockCreated: 2450100
|
|
10788
|
-
}
|
|
10789
|
-
}
|
|
10790
|
-
});
|
|
10791
10815
|
|
|
10792
10816
|
// src/chains/index.ts
|
|
10793
10817
|
var customViemChains = [
|
|
@@ -10800,7 +10824,8 @@ var customViemChains = [
|
|
|
10800
10824
|
astralisTestnet,
|
|
10801
10825
|
tempo,
|
|
10802
10826
|
hemi,
|
|
10803
|
-
citrea
|
|
10827
|
+
citrea,
|
|
10828
|
+
robinhood
|
|
10804
10829
|
];
|
|
10805
10830
|
var viemChainsById = [...Object.values(viemChains), ...customViemChains].reduce((acc, chainData) => {
|
|
10806
10831
|
return chainData.id ? {
|
|
@@ -12860,7 +12885,7 @@ var exclusiveChainIds = {
|
|
|
12860
12885
|
abstract: 2741,
|
|
12861
12886
|
lens: 232,
|
|
12862
12887
|
citreaTestnet: 5115,
|
|
12863
|
-
hyperLiquid:
|
|
12888
|
+
hyperLiquid: 1337,
|
|
12864
12889
|
citrea: 4114,
|
|
12865
12890
|
pushTestnet: 42101,
|
|
12866
12891
|
astralisTestnet: 71261,
|
|
@@ -14743,6 +14768,61 @@ var signCustomTypedData = async (params) => {
|
|
|
14743
14768
|
}
|
|
14744
14769
|
};
|
|
14745
14770
|
|
|
14771
|
+
// src/transactionHandlers/hyperliquid.ts
|
|
14772
|
+
var HyperLiquidTxHandler = class {
|
|
14773
|
+
};
|
|
14774
|
+
HyperLiquidTxHandler.sendTransaction = async (signer, account, txnData, chainId, additionalInfo, updatedQuotes) => {
|
|
14775
|
+
var _a;
|
|
14776
|
+
const signTypedData2 = "signTypedData" in txnData.transaction ? txnData.transaction.signTypedData : null;
|
|
14777
|
+
if (!signTypedData2) {
|
|
14778
|
+
return {
|
|
14779
|
+
status: "error" /* error */,
|
|
14780
|
+
errorMsg: "Missing typed data for HyperLiquid transaction",
|
|
14781
|
+
code: 500 /* Error */
|
|
14782
|
+
};
|
|
14783
|
+
}
|
|
14784
|
+
const txData = [];
|
|
14785
|
+
for (let i = 0; i < signTypedData2.length; i++) {
|
|
14786
|
+
const typedData = signTypedData2[i];
|
|
14787
|
+
const [resp, signatureChainId] = await Promise.all([
|
|
14788
|
+
signCustomTypedData({
|
|
14789
|
+
signer,
|
|
14790
|
+
account,
|
|
14791
|
+
domain: typedData.domain,
|
|
14792
|
+
types: typedData.types,
|
|
14793
|
+
message: typedData.message,
|
|
14794
|
+
primaryType: typedData.primaryType
|
|
14795
|
+
}),
|
|
14796
|
+
signer.getChainId()
|
|
14797
|
+
]);
|
|
14798
|
+
if (resp.status !== "success" /* success */ || !((_a = resp.data) == null ? void 0 : _a.signature)) {
|
|
14799
|
+
throw new Error("Failed to sign transaction");
|
|
14800
|
+
}
|
|
14801
|
+
txData.push({
|
|
14802
|
+
primaryType: typedData.primaryType,
|
|
14803
|
+
message: typedData.message,
|
|
14804
|
+
signature: resp.data.signature,
|
|
14805
|
+
account,
|
|
14806
|
+
signatureChainId
|
|
14807
|
+
});
|
|
14808
|
+
}
|
|
14809
|
+
const txResp = await broadcastTradeTx({
|
|
14810
|
+
chainId,
|
|
14811
|
+
txData,
|
|
14812
|
+
txId: txnData.txId
|
|
14813
|
+
});
|
|
14814
|
+
if (txResp.status !== "success" /* success */) {
|
|
14815
|
+
throw new Error("Failed to broadcast or save transaction");
|
|
14816
|
+
}
|
|
14817
|
+
return {
|
|
14818
|
+
status: "success" /* success */,
|
|
14819
|
+
code: 200 /* Success */,
|
|
14820
|
+
txnHash: txResp.txnHash,
|
|
14821
|
+
additionalInfo,
|
|
14822
|
+
updatedQuotes
|
|
14823
|
+
};
|
|
14824
|
+
};
|
|
14825
|
+
|
|
14746
14826
|
// src/transactionHandlers/trade.ts
|
|
14747
14827
|
var _TradeTxnHandler = class _TradeTxnHandler {
|
|
14748
14828
|
};
|
|
@@ -14816,54 +14896,6 @@ _TradeTxnHandler.sendTxnWithBatch = async (request, signer, txnParams, chainId,
|
|
|
14816
14896
|
updatedQuotes
|
|
14817
14897
|
};
|
|
14818
14898
|
};
|
|
14819
|
-
_TradeTxnHandler.sendHyperLiquidTransaction = async (signer, txnParams, txnData, chainId, additionalInfo, updatedQuotes) => {
|
|
14820
|
-
var _a;
|
|
14821
|
-
let txnDetails;
|
|
14822
|
-
if (chainId === exclusiveChainIds.hyperLiquid) {
|
|
14823
|
-
const providerData = additionalInfo ? Object.values(additionalInfo)[0] : null;
|
|
14824
|
-
const typedData = providerData && "typedData" in providerData ? providerData.typedData : null;
|
|
14825
|
-
if (!additionalInfo || !typedData) {
|
|
14826
|
-
return {
|
|
14827
|
-
status: "error" /* error */,
|
|
14828
|
-
errorMsg: "Missing additional info for HyperLiquid transaction",
|
|
14829
|
-
code: 500 /* Error */
|
|
14830
|
-
};
|
|
14831
|
-
}
|
|
14832
|
-
const resp = await signCustomTypedData({
|
|
14833
|
-
signer,
|
|
14834
|
-
account: txnParams.from,
|
|
14835
|
-
domain: typedData.domain,
|
|
14836
|
-
types: typedData.types,
|
|
14837
|
-
message: typedData.message,
|
|
14838
|
-
primaryType: typedData.primaryType
|
|
14839
|
-
});
|
|
14840
|
-
if (resp.status !== "success" /* success */) {
|
|
14841
|
-
throw new Error("Failed to sign transaction");
|
|
14842
|
-
}
|
|
14843
|
-
txnDetails = (_a = resp.data) == null ? void 0 : _a.signature;
|
|
14844
|
-
} else {
|
|
14845
|
-
const resp = await _TradeTxnHandler.sendTransaction(signer, txnParams, chainId, additionalInfo, updatedQuotes);
|
|
14846
|
-
if (resp.status !== "success" /* success */) {
|
|
14847
|
-
throw new Error("Failed to sign transaction");
|
|
14848
|
-
}
|
|
14849
|
-
txnDetails = resp.txnHash;
|
|
14850
|
-
}
|
|
14851
|
-
const txResp = await broadcastTradeTx({
|
|
14852
|
-
chainId,
|
|
14853
|
-
txData: txnDetails,
|
|
14854
|
-
txId: txnData.txId
|
|
14855
|
-
});
|
|
14856
|
-
if (txResp.status !== "success" /* success */) {
|
|
14857
|
-
throw new Error("Failed to broadcast or save transaction");
|
|
14858
|
-
}
|
|
14859
|
-
return {
|
|
14860
|
-
status: "success" /* success */,
|
|
14861
|
-
code: 200 /* Success */,
|
|
14862
|
-
txnHash: txResp.txnHash,
|
|
14863
|
-
additionalInfo,
|
|
14864
|
-
updatedQuotes
|
|
14865
|
-
};
|
|
14866
|
-
};
|
|
14867
14899
|
_TradeTxnHandler.buildAndSendTransaction = async ({
|
|
14868
14900
|
request,
|
|
14869
14901
|
signer,
|
|
@@ -14883,8 +14915,15 @@ _TradeTxnHandler.buildAndSendTransaction = async ({
|
|
|
14883
14915
|
}
|
|
14884
14916
|
const { data, from, to, value, gasLimit, additionalInfo, updatedQuotes } = buildTxnResponseData;
|
|
14885
14917
|
const txnParams = { from, to, data, value, gasLimit };
|
|
14886
|
-
if (
|
|
14887
|
-
return
|
|
14918
|
+
if (chainId === exclusiveChainIds.hyperLiquid) {
|
|
14919
|
+
return HyperLiquidTxHandler.sendTransaction(
|
|
14920
|
+
signer,
|
|
14921
|
+
txnParams.from,
|
|
14922
|
+
buildTxnResponseData,
|
|
14923
|
+
chainId,
|
|
14924
|
+
additionalInfo,
|
|
14925
|
+
updatedQuotes
|
|
14926
|
+
);
|
|
14888
14927
|
}
|
|
14889
14928
|
if (batchTransaction && !isTypeSigner(signer)) {
|
|
14890
14929
|
return _TradeTxnHandler.sendTxnWithBatch(request, signer, txnParams, chainId, additionalInfo, updatedQuotes, multicallAddress, rpcUrls);
|
|
@@ -16974,4 +17013,4 @@ var zapPathAction = {
|
|
|
16974
17013
|
harvest: "harvest"
|
|
16975
17014
|
};
|
|
16976
17015
|
|
|
16977
|
-
export { AllowanceTypes, ApprovalModes, dZapClient_default as DZapClient, DZapPermitMode, OtherAbis, PermitTypes, QuoteFilters, STATUS, Services, SignatureExpiryInSecs, StatusCodes, SwapInputDataDecoder, TxnStatus, arthera, astralisTestnet, checkEIP2612PermitSupport, citrea, classifyAddress, contractErrorActions, customViemChains, erc20Functions, extendViemChain, fiveIre, formatToken, getTokensPairKey, hemi, hyperEvm, hyperliquid, pushTestnet, stableChain, tempo, viemChainsById, zapPathAction, zapStepAction };
|
|
17016
|
+
export { AllowanceTypes, ApprovalModes, dZapClient_default as DZapClient, DZapPermitMode, OtherAbis, PermitTypes, QuoteFilters, STATUS, Services, SignatureExpiryInSecs, StatusCodes, SwapInputDataDecoder, TxnStatus, arthera, astralisTestnet, checkEIP2612PermitSupport, citrea, classifyAddress, contractErrorActions, customViemChains, erc20Functions, extendViemChain, fiveIre, formatToken, getTokensPairKey, hemi, hyperEvm, hyperliquid, pushTestnet, robinhood, stableChain, tempo, viemChainsById, zapPathAction, zapStepAction };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dzapio/sdk",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.42",
|
|
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",
|