@hyperbridge/sdk 1.8.5 → 1.8.6-rc.1
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/browser/index.d.ts +14 -2
- package/dist/browser/index.js +7 -17
- package/dist/browser/index.js.map +1 -1
- package/dist/node/index.d.ts +14 -2
- package/dist/node/index.js +7 -17
- package/dist/node/index.js.map +1 -1
- package/package.json +3 -4
package/dist/node/index.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ import { SignerOptions, SubmittableExtrinsic } from '@polkadot/api/types';
|
|
|
9
9
|
import { ISubmittableResult } from '@polkadot/types/types';
|
|
10
10
|
import { Chain } from 'viem/chains';
|
|
11
11
|
import { TronWeb } from 'tronweb';
|
|
12
|
+
export { Account as ViemAccount } from 'viem/accounts';
|
|
12
13
|
|
|
13
14
|
declare const _default: {
|
|
14
15
|
ABI: readonly [{
|
|
@@ -2774,11 +2775,22 @@ interface PackedUserOperation {
|
|
|
2774
2775
|
paymasterAndData: HexString;
|
|
2775
2776
|
signature: HexString;
|
|
2776
2777
|
}
|
|
2778
|
+
interface SigningAccount {
|
|
2779
|
+
/** Signs a bid message hash for a given chain. Returns a 65-byte ECDSA signature. */
|
|
2780
|
+
signMessage: (messageHash: HexString, chainId: number) => Promise<HexString>;
|
|
2781
|
+
/** Signs a raw 32-byte hash, returning split signature components for EIP-7702 etc. */
|
|
2782
|
+
signRawHash: (hash: HexString) => Promise<{
|
|
2783
|
+
r: HexString;
|
|
2784
|
+
s: HexString;
|
|
2785
|
+
yParity: number;
|
|
2786
|
+
}>;
|
|
2787
|
+
}
|
|
2777
2788
|
interface SubmitBidOptions {
|
|
2778
2789
|
order: Order;
|
|
2779
2790
|
fillOptions: FillOptions;
|
|
2780
2791
|
solverAccount: HexString;
|
|
2781
|
-
|
|
2792
|
+
/** Canonical signer used for bid message signing and raw-hash operations. */
|
|
2793
|
+
solverSigner: SigningAccount;
|
|
2782
2794
|
nonce: bigint;
|
|
2783
2795
|
entryPointAddress: HexString;
|
|
2784
2796
|
callGasLimit: bigint;
|
|
@@ -8099,4 +8111,4 @@ declare const getChainId: (stateMachineId: string) => number | undefined;
|
|
|
8099
8111
|
declare const getViemChain: (chainId: number) => Chain | undefined;
|
|
8100
8112
|
declare const hyperbridgeAddress = "";
|
|
8101
8113
|
|
|
8102
|
-
export { ADDRESS_ZERO, type AllStatusKey, type AssetTeleported, type AssetTeleportedResponse, type BidStorageEntry, type BidSubmissionResult, type BlockMetadata, type BundlerGasEstimate, BundlerMethod, type CancelEvent, type CancelOptions, type CancelQuote, type ChainConfig, type ChainConfigData, ChainConfigService, Chains, type ClientConfig, DEFAULT_ADDRESS, DEFAULT_GRAFFITI, DOMAIN_TYPEHASH, DUMMY_PRIVATE_KEY, type DecodedOrderPlacedLog, type DecodedPostRequestEvent, type DecodedPostResponseEvent, type DispatchGet, type DispatchInfo, type DispatchPost, ERC20Method, type ERC7821Call, ERC7821_BATCH_MODE, type EstimateFillOrderParams, type EstimateGasCallData, EvmChain, type EvmChainParams, ABI as EvmHostABI, EvmLanguage, type ExecuteIntentOrderOptions, type ExecutionResult, type FillOptions, type FillOrderEstimate, type FillerBid, type FillerConfig, type GetRequestResponse, type GetRequestWithStatus, type GetResponseByRequestIdResponse, type GetResponseStorageValues, type HexString, type HostParams, HyperClientStatus, type HyperbridgeTxEvents, type IChain, type IConfig, type IEvmChain, type IEvmConfig, type IGetRequest, type IGetRequestMessage, type IGetResponse, type IGetResponseMessage, type IHyperbridgeConfig, type IIsmpMessage, type IMessage, type IPolkadotHubConfig, type IPostRequest, type IPostResponse, type IProof, type IRequestMessage, type ISubstrateConfig, type ITimeoutPostRequestMessage, IndexerClient, type IndexerQueryClient, IntentGateway, type IntentGatewayContext, type IntentGatewayParams, ABI$1 as IntentGatewayV2ABI, IntentOrderStatus, type IntentOrderStatusKey, type IntentOrderStatusUpdate, IntentsCoprocessor, type IsmpRequest, MOCK_ADDRESS, type NewDeployment, ORDER_V2_PARAM_TYPE, type Order, type OrderResponse, OrderStatus, OrderStatusChecker, type OrderStatusMetadata, type OrderWithStatus, PACKED_USEROP_TYPEHASH, PLACE_ORDER_SELECTOR, type PackedUserOperation, type Params, type PaymentInfo, PolkadotHubChain, type PolkadotHubChainParams, type PostRequestStatus, type PostRequestTimeoutStatus, type PostRequestWithStatus, type QuoteNativeResult, REQUEST_COMMITMENTS_SLOT, REQUEST_RECEIPTS_SLOT, RESPONSE_COMMITMENTS_SLOT, RESPONSE_RECEIPTS_SLOT, type RequestBody, type RequestCommitment, RequestKind, type RequestResponse, RequestStatus, type RequestStatusKey, type RequestStatusWithMetadata, type ResponseCommitmentWithValues, type RetryConfig, SELECT_SOLVER_TYPEHASH, STATE_COMMITMENTS_SLOT, type SelectBidResult, type SelectOptions, type StateMachineHeight, type StateMachineIdParams, type StateMachineResponse, type StateMachineUpdate, type StorageFacade, type SubmitBidOptions, SubstrateChain, Swap, TESTNET_CHAINS, type TeleportParams, TeleportStatus, TimeoutStatus, type TimeoutStatusKey, TokenGateway, type TokenGatewayAssetTeleportedResponse, type TokenGatewayAssetTeleportedWithStatus, type TokenInfo, type TokenPrice, type TokenPricesResponse, type Transaction, TronChain, type TronChainParams, USE_ETHERSCAN_CHAINS, type XcmGatewayParams, __test, adjustDecimals, bytes20ToBytes32, bytes32ToBytes20, calculateAllowanceMappingLocation, calculateBalanceMappingLocation, chainConfigs, constructRedeemEscrowRequestBody, constructRefundEscrowRequestBody, convertCodecToIGetRequest, convertCodecToIProof, convertIGetRequestToCodec, convertIProofToCodec, convertStateIdToStateMachineId, convertStateMachineEnumToString, convertStateMachineIdToEnum, createEvmChain, createQueryClient, decodeUserOpScale, encodeERC7821ExecuteBatch, encodeISMPMessage, encodeUserOpScale, encodeWithdrawalRequest, estimateGasForPost, fetchPrice, fetchSourceProof, generateRootWithProof, getChainId, getConfigByStateMachineId, getContractCallInput, getGasPriceFromEtherscan, getOrFetchStorageSlot, getOrderPlacedFromTx, getPostRequestEventFromTx, getPostResponseEventFromTx, getRequestCommitment, getStateCommitmentFieldSlot, getStateCommitmentSlot, getStorageSlot, getViemChain, hexToString, hyperbridgeAddress, maxBigInt, orderCommitment, parseStateMachineId, polkadotAssetHubPaseo, postRequestCommitment, queryAssetTeleported, queryGetRequest, queryPostRequest, requestCommitmentKey, responseCommitmentKey, retryPromise, teleport, teleportDot, transformOrderForContract, tronChainIds, tronNile };
|
|
8114
|
+
export { ADDRESS_ZERO, type AllStatusKey, type AssetTeleported, type AssetTeleportedResponse, type BidStorageEntry, type BidSubmissionResult, type BlockMetadata, type BundlerGasEstimate, BundlerMethod, type CancelEvent, type CancelOptions, type CancelQuote, type ChainConfig, type ChainConfigData, ChainConfigService, Chains, type ClientConfig, DEFAULT_ADDRESS, DEFAULT_GRAFFITI, DOMAIN_TYPEHASH, DUMMY_PRIVATE_KEY, type DecodedOrderPlacedLog, type DecodedPostRequestEvent, type DecodedPostResponseEvent, type DispatchGet, type DispatchInfo, type DispatchPost, ERC20Method, type ERC7821Call, ERC7821_BATCH_MODE, type EstimateFillOrderParams, type EstimateGasCallData, EvmChain, type EvmChainParams, ABI as EvmHostABI, EvmLanguage, type ExecuteIntentOrderOptions, type ExecutionResult, type FillOptions, type FillOrderEstimate, type FillerBid, type FillerConfig, type GetRequestResponse, type GetRequestWithStatus, type GetResponseByRequestIdResponse, type GetResponseStorageValues, type HexString, type HostParams, HyperClientStatus, type HyperbridgeTxEvents, type IChain, type IConfig, type IEvmChain, type IEvmConfig, type IGetRequest, type IGetRequestMessage, type IGetResponse, type IGetResponseMessage, type IHyperbridgeConfig, type IIsmpMessage, type IMessage, type IPolkadotHubConfig, type IPostRequest, type IPostResponse, type IProof, type IRequestMessage, type ISubstrateConfig, type ITimeoutPostRequestMessage, IndexerClient, type IndexerQueryClient, IntentGateway, type IntentGatewayContext, type IntentGatewayParams, ABI$1 as IntentGatewayV2ABI, IntentOrderStatus, type IntentOrderStatusKey, type IntentOrderStatusUpdate, IntentsCoprocessor, type IsmpRequest, MOCK_ADDRESS, type NewDeployment, ORDER_V2_PARAM_TYPE, type Order, type OrderResponse, OrderStatus, OrderStatusChecker, type OrderStatusMetadata, type OrderWithStatus, PACKED_USEROP_TYPEHASH, PLACE_ORDER_SELECTOR, type PackedUserOperation, type Params, type PaymentInfo, PolkadotHubChain, type PolkadotHubChainParams, type PostRequestStatus, type PostRequestTimeoutStatus, type PostRequestWithStatus, type QuoteNativeResult, REQUEST_COMMITMENTS_SLOT, REQUEST_RECEIPTS_SLOT, RESPONSE_COMMITMENTS_SLOT, RESPONSE_RECEIPTS_SLOT, type RequestBody, type RequestCommitment, RequestKind, type RequestResponse, RequestStatus, type RequestStatusKey, type RequestStatusWithMetadata, type ResponseCommitmentWithValues, type RetryConfig, SELECT_SOLVER_TYPEHASH, STATE_COMMITMENTS_SLOT, type SelectBidResult, type SelectOptions, type SigningAccount, type StateMachineHeight, type StateMachineIdParams, type StateMachineResponse, type StateMachineUpdate, type StorageFacade, type SubmitBidOptions, SubstrateChain, Swap, TESTNET_CHAINS, type TeleportParams, TeleportStatus, TimeoutStatus, type TimeoutStatusKey, TokenGateway, type TokenGatewayAssetTeleportedResponse, type TokenGatewayAssetTeleportedWithStatus, type TokenInfo, type TokenPrice, type TokenPricesResponse, type Transaction, TronChain, type TronChainParams, USE_ETHERSCAN_CHAINS, type XcmGatewayParams, __test, adjustDecimals, bytes20ToBytes32, bytes32ToBytes20, calculateAllowanceMappingLocation, calculateBalanceMappingLocation, chainConfigs, constructRedeemEscrowRequestBody, constructRefundEscrowRequestBody, convertCodecToIGetRequest, convertCodecToIProof, convertIGetRequestToCodec, convertIProofToCodec, convertStateIdToStateMachineId, convertStateMachineEnumToString, convertStateMachineIdToEnum, createEvmChain, createQueryClient, decodeUserOpScale, encodeERC7821ExecuteBatch, encodeISMPMessage, encodeUserOpScale, encodeWithdrawalRequest, estimateGasForPost, fetchPrice, fetchSourceProof, generateRootWithProof, getChainId, getConfigByStateMachineId, getContractCallInput, getGasPriceFromEtherscan, getOrFetchStorageSlot, getOrderPlacedFromTx, getPostRequestEventFromTx, getPostResponseEventFromTx, getRequestCommitment, getStateCommitmentFieldSlot, getStateCommitmentSlot, getStorageSlot, getViemChain, hexToString, hyperbridgeAddress, maxBigInt, orderCommitment, parseStateMachineId, polkadotAssetHubPaseo, postRequestCommitment, queryAssetTeleported, queryGetRequest, queryPostRequest, requestCommitmentKey, responseCommitmentKey, retryPromise, teleport, teleportDot, transformOrderForContract, tronChainIds, tronNile };
|
package/dist/node/index.js
CHANGED
|
@@ -7083,7 +7083,8 @@ function decodeReviveContractTrieId(accountData) {
|
|
|
7083
7083
|
var H256 = Vector(u8, 32);
|
|
7084
7084
|
var EvmStateProof = Struct({
|
|
7085
7085
|
/**
|
|
7086
|
-
* Proof of the contract state
|
|
7086
|
+
* Proof of the contract state (EVM account trie) or, for Revive / Substrate EVM, the main state trie proof
|
|
7087
|
+
* (`AccountInfo` + child root) — same SCALE shape as `SubstrateEvmProof::main_proof` on the Rust side.
|
|
7087
7088
|
*/
|
|
7088
7089
|
contractProof: Vector(Vector(u8)),
|
|
7089
7090
|
/**
|
|
@@ -7091,16 +7092,6 @@ var EvmStateProof = Struct({
|
|
|
7091
7092
|
*/
|
|
7092
7093
|
storageProof: Vector(Tuple(Vector(u8), Vector(Vector(u8))))
|
|
7093
7094
|
});
|
|
7094
|
-
var SubstrateEvmProof = Struct({
|
|
7095
|
-
main_proof: Vector(Vector(u8)),
|
|
7096
|
-
storage_proof: Vector(Tuple(Vector(u8), Vector(Vector(u8))))
|
|
7097
|
-
});
|
|
7098
|
-
function encodeSubstrateEvmProofBytes(params) {
|
|
7099
|
-
return SubstrateEvmProof.enc({
|
|
7100
|
-
main_proof: params.mainProof,
|
|
7101
|
-
storage_proof: Array.from(params.storageProof.entries())
|
|
7102
|
-
});
|
|
7103
|
-
}
|
|
7104
7095
|
var SubstrateHashing = Enum({
|
|
7105
7096
|
/* For chains that use keccak as their hashing algo */
|
|
7106
7097
|
Keccak: _void,
|
|
@@ -7618,9 +7609,9 @@ var PolkadotHubChain = class _PolkadotHubChain {
|
|
|
7618
7609
|
childRead.proof.map((p) => hexToBytes(p))
|
|
7619
7610
|
);
|
|
7620
7611
|
}
|
|
7621
|
-
const encoded =
|
|
7622
|
-
|
|
7623
|
-
storageProof: storageProofEncoded
|
|
7612
|
+
const encoded = EvmStateProof.enc({
|
|
7613
|
+
contractProof: mainProofBytes,
|
|
7614
|
+
storageProof: Array.from(storageProofEncoded.entries())
|
|
7624
7615
|
});
|
|
7625
7616
|
return bytesToHex(encoded);
|
|
7626
7617
|
}
|
|
@@ -15935,7 +15926,7 @@ var BidManager = class {
|
|
|
15935
15926
|
const {
|
|
15936
15927
|
order,
|
|
15937
15928
|
solverAccount,
|
|
15938
|
-
|
|
15929
|
+
solverSigner,
|
|
15939
15930
|
nonce,
|
|
15940
15931
|
entryPointAddress,
|
|
15941
15932
|
callGasLimit,
|
|
@@ -15964,8 +15955,7 @@ var BidManager = class {
|
|
|
15964
15955
|
const userOpHash = this.crypto.computeUserOpHash(userOp, entryPointAddress, chainId);
|
|
15965
15956
|
const sessionKey = order.session;
|
|
15966
15957
|
const messageHash = keccak256(concat([userOpHash, order.id, sessionKey]));
|
|
15967
|
-
const
|
|
15968
|
-
const solverSignature = await solverAccount_.signMessage({ message: { raw: messageHash } });
|
|
15958
|
+
const solverSignature = await solverSigner.signMessage(messageHash, Number(chainId));
|
|
15969
15959
|
const signature = concat([order.id, solverSignature]);
|
|
15970
15960
|
return { ...userOp, signature };
|
|
15971
15961
|
}
|