@hyperbridge/sdk 1.8.5 → 1.8.6
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 +15 -18
- package/dist/browser/index.js.map +1 -1
- package/dist/node/index.d.ts +14 -2
- package/dist/node/index.js +15 -18
- 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,
|
|
@@ -7613,14 +7604,21 @@ var PolkadotHubChain = class _PolkadotHubChain {
|
|
|
7613
7604
|
childKeysHex,
|
|
7614
7605
|
blockHash
|
|
7615
7606
|
]);
|
|
7607
|
+
const childNodes = childRead.proof.map((p) => hexToBytes(p));
|
|
7616
7608
|
storageProofEncoded.set(
|
|
7617
7609
|
addr20,
|
|
7618
|
-
|
|
7610
|
+
childNodes
|
|
7619
7611
|
);
|
|
7620
7612
|
}
|
|
7621
|
-
const
|
|
7622
|
-
|
|
7623
|
-
|
|
7613
|
+
const storageEntries = Array.from(storageProofEncoded.entries());
|
|
7614
|
+
const contractProofForEnc = mainProofBytes.map((b) => Array.from(b));
|
|
7615
|
+
const storageProofForEnc = storageEntries.map(([k, nodes]) => [
|
|
7616
|
+
Array.from(k),
|
|
7617
|
+
nodes.map((n) => Array.from(n))
|
|
7618
|
+
]);
|
|
7619
|
+
const encoded = EvmStateProof.enc({
|
|
7620
|
+
contractProof: contractProofForEnc,
|
|
7621
|
+
storageProof: storageProofForEnc
|
|
7624
7622
|
});
|
|
7625
7623
|
return bytesToHex(encoded);
|
|
7626
7624
|
}
|
|
@@ -15935,7 +15933,7 @@ var BidManager = class {
|
|
|
15935
15933
|
const {
|
|
15936
15934
|
order,
|
|
15937
15935
|
solverAccount,
|
|
15938
|
-
|
|
15936
|
+
solverSigner,
|
|
15939
15937
|
nonce,
|
|
15940
15938
|
entryPointAddress,
|
|
15941
15939
|
callGasLimit,
|
|
@@ -15964,8 +15962,7 @@ var BidManager = class {
|
|
|
15964
15962
|
const userOpHash = this.crypto.computeUserOpHash(userOp, entryPointAddress, chainId);
|
|
15965
15963
|
const sessionKey = order.session;
|
|
15966
15964
|
const messageHash = keccak256(concat([userOpHash, order.id, sessionKey]));
|
|
15967
|
-
const
|
|
15968
|
-
const solverSignature = await solverAccount_.signMessage({ message: { raw: messageHash } });
|
|
15965
|
+
const solverSignature = await solverSigner.signMessage(messageHash, Number(chainId));
|
|
15969
15966
|
const signature = concat([order.id, solverSignature]);
|
|
15970
15967
|
return { ...userOp, signature };
|
|
15971
15968
|
}
|