@hyperbridge/sdk 2.8.8 → 2.8.10
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 +406 -18
- package/dist/browser/index.js +724 -58
- package/dist/browser/index.js.map +1 -1
- package/dist/node/index.cjs +729 -54
- package/dist/node/index.cjs.map +1 -1
- package/dist/node/index.d.cts +8 -5
- package/dist/node/index.d.ts +8 -5
- package/dist/node/index.js +724 -58
- package/dist/node/index.js.map +1 -1
- package/dist/node/{intents-helpers-BCsIHRts.d.cts → intents-helpers-BKj42imQ.d.cts} +721 -225
- package/dist/node/{intents-helpers-BCsIHRts.d.ts → intents-helpers-BKj42imQ.d.ts} +721 -225
- package/dist/node/intents-helpers.cjs +104 -27
- package/dist/node/intents-helpers.cjs.map +1 -1
- package/dist/node/intents-helpers.d.cts +2 -1
- package/dist/node/intents-helpers.d.ts +2 -1
- package/dist/node/intents-helpers.js +100 -29
- package/dist/node/intents-helpers.js.map +1 -1
- package/package.json +1 -1
|
@@ -6,6 +6,7 @@ import { PublicClient, TransactionReceipt, Hex, Log, ContractFunctionArgs, Chain
|
|
|
6
6
|
import { Chain } from 'viem/chains';
|
|
7
7
|
import { ApiPromise } from '@polkadot/api';
|
|
8
8
|
import { KeyringPair } from '@polkadot/keyring/types';
|
|
9
|
+
import { RuntimeVersion } from '@polkadot/types/interfaces';
|
|
9
10
|
|
|
10
11
|
declare const _default$1: {
|
|
11
12
|
ABI: readonly [{
|
|
@@ -1027,50 +1028,50 @@ declare class ChainConfigService {
|
|
|
1027
1028
|
constructor(env?: NodeJS.ProcessEnv);
|
|
1028
1029
|
private getConfig;
|
|
1029
1030
|
getChainConfig(chain: string): ChainConfig;
|
|
1030
|
-
getIntentGatewayAddress(chain: string): HexString$
|
|
1031
|
-
getTokenGatewayAddress(chain: string): HexString$
|
|
1032
|
-
getHostAddress(chain: string): HexString$
|
|
1031
|
+
getIntentGatewayAddress(chain: string): HexString$2;
|
|
1032
|
+
getTokenGatewayAddress(chain: string): HexString$2;
|
|
1033
|
+
getHostAddress(chain: string): HexString$2;
|
|
1033
1034
|
getWrappedNativeAssetWithDecimals(chain: string): {
|
|
1034
|
-
asset: HexString$
|
|
1035
|
+
asset: HexString$2;
|
|
1035
1036
|
decimals: number;
|
|
1036
1037
|
};
|
|
1037
|
-
getDaiAsset(chain: string): HexString$
|
|
1038
|
-
getAssetAddress(chain: string, symbol: ConfiguredAssetSymbol): HexString$
|
|
1038
|
+
getDaiAsset(chain: string): HexString$2;
|
|
1039
|
+
getAssetAddress(chain: string, symbol: ConfiguredAssetSymbol): HexString$2 | undefined;
|
|
1039
1040
|
/**
|
|
1040
1041
|
* Resolves configured token metadata from an address on a specific chain.
|
|
1041
1042
|
* This is used by SDK helpers that accept token addresses rather than caller-
|
|
1042
1043
|
* supplied symbols or decimals.
|
|
1043
1044
|
*/
|
|
1044
|
-
getAssetMetadataByAddress(chain: string, address: HexString$
|
|
1045
|
+
getAssetMetadataByAddress(chain: string, address: HexString$2): {
|
|
1045
1046
|
symbol: ConfiguredAssetSymbol;
|
|
1046
|
-
address: HexString$
|
|
1047
|
+
address: HexString$2;
|
|
1047
1048
|
decimals?: number;
|
|
1048
1049
|
} | undefined;
|
|
1049
|
-
getUsdtAsset(chain: string): HexString$
|
|
1050
|
-
getUsdcAsset(chain: string): HexString$
|
|
1050
|
+
getUsdtAsset(chain: string): HexString$2;
|
|
1051
|
+
getUsdcAsset(chain: string): HexString$2;
|
|
1051
1052
|
getUsdcDecimals(chain: string): number;
|
|
1052
1053
|
getUsdtDecimals(chain: string): number;
|
|
1053
|
-
getCNgnAsset(chain: string): HexString$
|
|
1054
|
+
getCNgnAsset(chain: string): HexString$2 | undefined;
|
|
1054
1055
|
/**
|
|
1055
1056
|
* Address of `symbol` on `chain` from the per-chain asset table, matched
|
|
1056
1057
|
* case-insensitively ("cNGN" ≡ "CNGN"). This table is the single source of
|
|
1057
1058
|
* truth for token addresses — the simplex asset registry resolves through
|
|
1058
1059
|
* it, so a new asset is added once in `chain.ts` and nowhere else.
|
|
1059
1060
|
*/
|
|
1060
|
-
getAssetBySymbol(chain: string, symbol: string): HexString$
|
|
1061
|
+
getAssetBySymbol(chain: string, symbol: string): HexString$2 | undefined;
|
|
1061
1062
|
/** Resolves a configured token symbol case-insensitively on a specific chain. */
|
|
1062
1063
|
getAssetMetadataBySymbol(chain: string, symbol: string): {
|
|
1063
1064
|
symbol: ConfiguredAssetSymbol;
|
|
1064
|
-
address: HexString$
|
|
1065
|
+
address: HexString$2;
|
|
1065
1066
|
decimals?: number;
|
|
1066
1067
|
} | undefined;
|
|
1067
1068
|
getCNgnDecimals(chain: string): number | undefined;
|
|
1068
|
-
getExtAsset(chain: string): HexString$
|
|
1069
|
+
getExtAsset(chain: string): HexString$2 | undefined;
|
|
1069
1070
|
getExtDecimals(chain: string): number | undefined;
|
|
1070
1071
|
/** Configured exotic (non-USD) tokens on a chain, for selection UIs. EXT is a test asset and is not offered. */
|
|
1071
1072
|
getKnownExoticTokens(chain: string): Array<{
|
|
1072
1073
|
symbol: string;
|
|
1073
|
-
address: HexString$
|
|
1074
|
+
address: HexString$2;
|
|
1074
1075
|
decimals?: number;
|
|
1075
1076
|
}>;
|
|
1076
1077
|
/** Known ERC-4626 treasury vaults on a chain, for selection UIs. */
|
|
@@ -1079,30 +1080,30 @@ declare class ChainConfigService {
|
|
|
1079
1080
|
getConsensusStateId(chain: string): string;
|
|
1080
1081
|
getHyperbridgeChainId(): number;
|
|
1081
1082
|
getRpcUrl(chain: string): string;
|
|
1082
|
-
getUniswapRouterV2Address(chain: string): HexString$
|
|
1083
|
-
getAerodromeRouterAddress(chain: string): HexString$
|
|
1084
|
-
getUniswapV2FactoryAddress(chain: string): HexString$
|
|
1085
|
-
getUniswapV3FactoryAddress(chain: string): HexString$
|
|
1086
|
-
getUniversalRouterAddress(chain: string): HexString$
|
|
1087
|
-
getUniswapV3QuoterAddress(chain: string): HexString$
|
|
1088
|
-
getUniswapV4QuoterAddress(chain: string): HexString$
|
|
1089
|
-
getUniswapV4PositionManagerAddress(chain: string): HexString$
|
|
1090
|
-
getUniswapV4PoolManagerAddress(chain: string): HexString$
|
|
1091
|
-
getUniswapV4StateViewAddress(chain: string): HexString$
|
|
1083
|
+
getUniswapRouterV2Address(chain: string): HexString$2;
|
|
1084
|
+
getAerodromeRouterAddress(chain: string): HexString$2;
|
|
1085
|
+
getUniswapV2FactoryAddress(chain: string): HexString$2;
|
|
1086
|
+
getUniswapV3FactoryAddress(chain: string): HexString$2;
|
|
1087
|
+
getUniversalRouterAddress(chain: string): HexString$2;
|
|
1088
|
+
getUniswapV3QuoterAddress(chain: string): HexString$2;
|
|
1089
|
+
getUniswapV4QuoterAddress(chain: string): HexString$2;
|
|
1090
|
+
getUniswapV4PositionManagerAddress(chain: string): HexString$2;
|
|
1091
|
+
getUniswapV4PoolManagerAddress(chain: string): HexString$2;
|
|
1092
|
+
getUniswapV4StateViewAddress(chain: string): HexString$2;
|
|
1092
1093
|
getUniswapV4PoolConfigs(chain: string): UniswapV4PoolConfigData[];
|
|
1093
|
-
getPermit2Address(chain: string): HexString$
|
|
1094
|
-
getSolverAccountAddress(chain: string): HexString$
|
|
1094
|
+
getPermit2Address(chain: string): HexString$2;
|
|
1095
|
+
getSolverAccountAddress(chain: string): HexString$2 | undefined;
|
|
1095
1096
|
getCoingeckoId(chain: string): string | undefined;
|
|
1096
1097
|
getEtherscanApiKey(): string | undefined;
|
|
1097
|
-
getCalldispatcherAddress(chain: string): HexString$
|
|
1098
|
+
getCalldispatcherAddress(chain: string): HexString$2;
|
|
1098
1099
|
getTokenStorageSlots(chain: string, tokenAddress: string): {
|
|
1099
1100
|
balanceSlot: number;
|
|
1100
1101
|
allowanceSlot: number;
|
|
1101
1102
|
} | undefined;
|
|
1102
1103
|
getPopularTokens(chain: string): string[];
|
|
1103
|
-
getEntryPointV08Address(chain: string): HexString$
|
|
1104
|
-
getCirclePaymasterAddress(chain: string): HexString$
|
|
1105
|
-
getSimplexPaymasterAddress(chain: string): HexString$
|
|
1104
|
+
getEntryPointV08Address(chain: string): HexString$2;
|
|
1105
|
+
getCirclePaymasterAddress(chain: string): HexString$2 | undefined;
|
|
1106
|
+
getSimplexPaymasterAddress(chain: string): HexString$2 | undefined;
|
|
1106
1107
|
getHyperbridgeAddress(): string;
|
|
1107
1108
|
/**
|
|
1108
1109
|
* Get the LayerZero Endpoint ID for the chain
|
|
@@ -1114,7 +1115,7 @@ declare class ChainConfigService {
|
|
|
1114
1115
|
* On Ethereum: OFT Adapter (locks/unlocks USDT)
|
|
1115
1116
|
* On other chains: OFT contract (mints/burns USDT0)
|
|
1116
1117
|
*/
|
|
1117
|
-
getUsdt0OftAddress(chain: string): HexString$
|
|
1118
|
+
getUsdt0OftAddress(chain: string): HexString$2 | undefined;
|
|
1118
1119
|
}
|
|
1119
1120
|
|
|
1120
1121
|
type IStateMachine = {
|
|
@@ -1164,33 +1165,33 @@ declare class SubstrateChain implements IChain {
|
|
|
1164
1165
|
* @param key - The H256 hash key (as a 0x-prefixed hex string)
|
|
1165
1166
|
* @returns The storage key as a hex string
|
|
1166
1167
|
*/
|
|
1167
|
-
requestReceiptKey(key: HexString$
|
|
1168
|
+
requestReceiptKey(key: HexString$2): HexString$2;
|
|
1168
1169
|
/**
|
|
1169
1170
|
* Returns the storage key for a request commitment in the child trie
|
|
1170
1171
|
* The request commitment is the key
|
|
1171
1172
|
* @param key - The H256 hash key (as a 0x-prefixed hex string)
|
|
1172
1173
|
* @returns The storage key as a hex string
|
|
1173
1174
|
*/
|
|
1174
|
-
requestCommitmentKey(key: HexString$
|
|
1175
|
+
requestCommitmentKey(key: HexString$2): HexString$2;
|
|
1175
1176
|
/**
|
|
1176
1177
|
* Queries a request commitment from the ISMP child trie storage.
|
|
1177
1178
|
* @param {HexString} commitment - The commitment hash to look up.
|
|
1178
1179
|
* @returns {Promise<HexString | undefined>} The commitment data if found, undefined otherwise.
|
|
1179
1180
|
*/
|
|
1180
|
-
queryRequestCommitment(commitment: HexString$
|
|
1181
|
+
queryRequestCommitment(commitment: HexString$2): Promise<HexString$2 | undefined>;
|
|
1181
1182
|
/**
|
|
1182
1183
|
* Queries the request receipt.
|
|
1183
1184
|
* @param {HexString} commitment - The commitment to query.
|
|
1184
1185
|
* @returns {Promise<HexString | undefined>} The relayer address responsible for delivering the request.
|
|
1185
1186
|
*/
|
|
1186
|
-
queryRequestReceipt(commitment: HexString$
|
|
1187
|
+
queryRequestReceipt(commitment: HexString$2): Promise<HexString$2 | undefined>;
|
|
1187
1188
|
/**
|
|
1188
1189
|
* Returns the storage key for a response receipt in the child trie.
|
|
1189
1190
|
* A response receipt is keyed by the originating *request* commitment.
|
|
1190
1191
|
* @param {HexString} key - The request commitment (0x-prefixed H256 hex string)
|
|
1191
1192
|
* @returns {HexString} The storage key as a hex string
|
|
1192
1193
|
*/
|
|
1193
|
-
responseReceiptKey(key: HexString$
|
|
1194
|
+
responseReceiptKey(key: HexString$2): HexString$2;
|
|
1194
1195
|
/**
|
|
1195
1196
|
* Queries the response receipt for a request commitment. For a GET, Hyperbridge
|
|
1196
1197
|
* produces the response as it processes the request, so the presence of a response
|
|
@@ -1198,7 +1199,7 @@ declare class SubstrateChain implements IChain {
|
|
|
1198
1199
|
* @param {HexString} commitment - The originating request commitment to query.
|
|
1199
1200
|
* @returns {Promise<HexString | undefined>} The receipt data if present, otherwise undefined.
|
|
1200
1201
|
*/
|
|
1201
|
-
queryResponseReceipt(commitment: HexString$
|
|
1202
|
+
queryResponseReceipt(commitment: HexString$2): Promise<HexString$2 | undefined>;
|
|
1202
1203
|
/**
|
|
1203
1204
|
* Queries the state-machine commitment Hyperbridge holds for a counterparty chain at an
|
|
1204
1205
|
* exact height — the `BoundedStateCommitments` map that `state_machine_commitment` (and thus
|
|
@@ -1207,7 +1208,7 @@ declare class SubstrateChain implements IChain {
|
|
|
1207
1208
|
* @param {StateMachineHeight} height - The counterparty state machine id + height.
|
|
1208
1209
|
* @returns {Promise<HexString | undefined>} The committed state root, or undefined if absent.
|
|
1209
1210
|
*/
|
|
1210
|
-
queryStateMachineCommitment(height: StateMachineHeight): Promise<HexString$
|
|
1211
|
+
queryStateMachineCommitment(height: StateMachineHeight): Promise<HexString$2 | undefined>;
|
|
1211
1212
|
/**
|
|
1212
1213
|
* Returns the current timestamp of the chain.
|
|
1213
1214
|
* @returns {Promise<bigint>} The current timestamp.
|
|
@@ -1220,7 +1221,7 @@ declare class SubstrateChain implements IChain {
|
|
|
1220
1221
|
* @param {bigint} [at] - The block number to query at.
|
|
1221
1222
|
* @returns {Promise<HexString>} The proof.
|
|
1222
1223
|
*/
|
|
1223
|
-
queryProof(message: IMessage, counterparty: string, at?: bigint): Promise<HexString$
|
|
1224
|
+
queryProof(message: IMessage, counterparty: string, at?: bigint): Promise<HexString$2>;
|
|
1224
1225
|
/**
|
|
1225
1226
|
* Submit an unsigned ISMP transaction to the chain. Resolves when the transaction is finalized.
|
|
1226
1227
|
* @param message - The message to be submitted.
|
|
@@ -1239,7 +1240,7 @@ declare class SubstrateChain implements IChain {
|
|
|
1239
1240
|
* @param _address - Optional address (ignored for Substrate; present for IChain compatibility).
|
|
1240
1241
|
* @returns The state proof as a hexadecimal string.
|
|
1241
1242
|
*/
|
|
1242
|
-
queryStateProof(at: bigint, keys: HexString$
|
|
1243
|
+
queryStateProof(at: bigint, keys: HexString$2[], _address?: HexString$2): Promise<HexString$2>;
|
|
1243
1244
|
/**
|
|
1244
1245
|
* Get the latest state machine height for a given state machine ID.
|
|
1245
1246
|
* @param {StateMachineIdParams} stateMachineId - The state machine ID.
|
|
@@ -1266,7 +1267,7 @@ declare class SubstrateChain implements IChain {
|
|
|
1266
1267
|
* @param message The ISMP message to encode.
|
|
1267
1268
|
* @returns The encoded message as a hexadecimal string.
|
|
1268
1269
|
*/
|
|
1269
|
-
encode(message: IIsmpMessage): HexString$
|
|
1270
|
+
encode(message: IIsmpMessage): HexString$2;
|
|
1270
1271
|
/**
|
|
1271
1272
|
* Queries the latest proven height for this chain from pallet-ismp.
|
|
1272
1273
|
*/
|
|
@@ -1280,7 +1281,7 @@ declare class SubstrateChain implements IChain {
|
|
|
1280
1281
|
* @param currentEpoch - The current authority set id on the destination EVM chain
|
|
1281
1282
|
*/
|
|
1282
1283
|
queryConsensusProofs(neededHeight: bigint, currentEpoch: bigint): Promise<{
|
|
1283
|
-
proofs: HexString$
|
|
1284
|
+
proofs: HexString$2[];
|
|
1284
1285
|
provenHeight: bigint;
|
|
1285
1286
|
} | undefined>;
|
|
1286
1287
|
private getPalletIndex;
|
|
@@ -1307,7 +1308,7 @@ declare function convertStateMachineEnumToString(stateMachine: {
|
|
|
1307
1308
|
*/
|
|
1308
1309
|
declare function convertStateIdToStateMachineId(stateId: {
|
|
1309
1310
|
Evm?: number;
|
|
1310
|
-
Substrate?: HexString$
|
|
1311
|
+
Substrate?: HexString$2;
|
|
1311
1312
|
Polkadot?: number;
|
|
1312
1313
|
Kusama?: number;
|
|
1313
1314
|
}): string;
|
|
@@ -1406,22 +1407,22 @@ declare function deriveHttpUrl(wsUrl: string): string;
|
|
|
1406
1407
|
* @param userOp - The PackedUserOperation to encode
|
|
1407
1408
|
* @returns Hex-encoded SCALE bytes
|
|
1408
1409
|
*/
|
|
1409
|
-
declare function encodeUserOpScale(userOp: PackedUserOperation): HexString$
|
|
1410
|
+
declare function encodeUserOpScale(userOp: PackedUserOperation): HexString$2;
|
|
1410
1411
|
/**
|
|
1411
1412
|
* Decodes a SCALE-encoded PackedUserOperation.
|
|
1412
1413
|
*
|
|
1413
1414
|
* @param hex - The hex-encoded SCALE bytes
|
|
1414
1415
|
* @returns The decoded PackedUserOperation
|
|
1415
1416
|
*/
|
|
1416
|
-
declare function decodeUserOpScale(hex: HexString$
|
|
1417
|
+
declare function decodeUserOpScale(hex: HexString$2): PackedUserOperation;
|
|
1417
1418
|
/** One directed leg of a phantom order: `standardAmount` of `tokenA` quoted in `tokenB`. */
|
|
1418
1419
|
interface PhantomOrderLeg {
|
|
1419
|
-
tokenA: HexString$
|
|
1420
|
-
tokenB: HexString$
|
|
1420
|
+
tokenA: HexString$2;
|
|
1421
|
+
tokenB: HexString$2;
|
|
1421
1422
|
standardAmount: bigint;
|
|
1422
1423
|
}
|
|
1423
1424
|
interface PhantomOrderEvent {
|
|
1424
|
-
commitment: HexString$
|
|
1425
|
+
commitment: HexString$2;
|
|
1425
1426
|
chain: string;
|
|
1426
1427
|
createdAt: number;
|
|
1427
1428
|
/**
|
|
@@ -1430,21 +1431,35 @@ interface PhantomOrderEvent {
|
|
|
1430
1431
|
*/
|
|
1431
1432
|
legs: PhantomOrderLeg[];
|
|
1432
1433
|
}
|
|
1434
|
+
/** The pallet's phantom order timings, as the chain currently has them. */
|
|
1435
|
+
interface PhantomTimings {
|
|
1436
|
+
/**
|
|
1437
|
+
* Blocks after registration during which the pallet accepts a bid: the `PhantomBidWindow`
|
|
1438
|
+
* storage value, or the `PhantomOrderBidWindowBlocks` runtime constant when that value is zero,
|
|
1439
|
+
* which is the same fallback the pallet's own `phantom_bid_window()` applies.
|
|
1440
|
+
*/
|
|
1441
|
+
bidWindowBlocks: number;
|
|
1442
|
+
/**
|
|
1443
|
+
* Blocks between generations (`PhantomOrderInterval`). Zero is meaningful rather than unset —
|
|
1444
|
+
* the pallet generates once and never regenerates — so there is no constant to fall back to.
|
|
1445
|
+
*/
|
|
1446
|
+
intervalBlocks: number;
|
|
1447
|
+
}
|
|
1433
1448
|
/** One phantom bid to place, and the bid it replaces on the same chain. */
|
|
1434
1449
|
interface PhantomBid {
|
|
1435
1450
|
/** The phantom order commitment being bid on. */
|
|
1436
|
-
commitment: HexString$
|
|
1451
|
+
commitment: HexString$2;
|
|
1437
1452
|
/** The SCALE-encoded PackedUserOperation backing the quote. */
|
|
1438
|
-
userOp: HexString$
|
|
1453
|
+
userOp: HexString$2;
|
|
1439
1454
|
/**
|
|
1440
1455
|
* A live bid from a previous interval on the same chain, retracted alongside this one to
|
|
1441
1456
|
* reclaim its deposit. Best-effort: a retraction that fails never affects the bid.
|
|
1442
1457
|
*/
|
|
1443
|
-
retractCommitment?: HexString$
|
|
1458
|
+
retractCommitment?: HexString$2;
|
|
1444
1459
|
}
|
|
1445
1460
|
/** What became of one bid in a batch. */
|
|
1446
1461
|
interface PhantomBidOutcome {
|
|
1447
|
-
commitment: HexString$
|
|
1462
|
+
commitment: HexString$2;
|
|
1448
1463
|
success: boolean;
|
|
1449
1464
|
/** The dispatch error that rejected this bid, when it failed. */
|
|
1450
1465
|
error?: string;
|
|
@@ -1453,8 +1468,8 @@ interface PhantomBidBatchResult {
|
|
|
1453
1468
|
/** One entry per submitted bid, in the order they were given. */
|
|
1454
1469
|
bids: PhantomBidOutcome[];
|
|
1455
1470
|
/** The block and extrinsic the bids landed in. */
|
|
1456
|
-
blockHash?: HexString$
|
|
1457
|
-
extrinsicHash?: HexString$
|
|
1471
|
+
blockHash?: HexString$2;
|
|
1472
|
+
extrinsicHash?: HexString$2;
|
|
1458
1473
|
/**
|
|
1459
1474
|
* The batch reached the pool but its inclusion was not observed, so no per-bid outcome is
|
|
1460
1475
|
* known. Same contract as {@link BidSubmissionResult.pending}: in flight, do not re-sign.
|
|
@@ -1468,17 +1483,22 @@ interface PollPhantomOrdersOptions {
|
|
|
1468
1483
|
intervalMs?: number;
|
|
1469
1484
|
/**
|
|
1470
1485
|
* Most blocks scanned in a single poll, so a long outage catches up over several ticks instead of
|
|
1471
|
-
* one
|
|
1486
|
+
* one burst. Defaults to 10 — several times the rate the chain produces blocks, so recovery is
|
|
1487
|
+
* still quick, but small enough to bound both the work one `state_queryStorage` call asks of the
|
|
1488
|
+
* node and the requests the per-block fallback queues ahead of a bid submission.
|
|
1472
1489
|
*/
|
|
1473
1490
|
maxBlocksPerPoll?: number;
|
|
1474
|
-
/**
|
|
1475
|
-
* How many blocks before the current head to start from on the first poll. Defaults to 0 (start
|
|
1476
|
-
* at the head). Set this to the runtime's bid window to have a restarting process pick up orders
|
|
1477
|
-
* whose window is still open.
|
|
1478
|
-
*/
|
|
1479
|
-
lookbackBlocks?: number;
|
|
1480
1491
|
/** Notified when a poll fails; polling continues regardless. */
|
|
1481
1492
|
onError?: (err: unknown) => void;
|
|
1493
|
+
/**
|
|
1494
|
+
* Notified when the cursor was forced forward past a backlog too old to bid on, with the range
|
|
1495
|
+
* that was never scanned. Nothing else reports it, and skipping blocks is worth a line in the log.
|
|
1496
|
+
*/
|
|
1497
|
+
onSkip?: (skipped: {
|
|
1498
|
+
from: number;
|
|
1499
|
+
to: number;
|
|
1500
|
+
head: number;
|
|
1501
|
+
}) => void;
|
|
1482
1502
|
}
|
|
1483
1503
|
/**
|
|
1484
1504
|
* Service for interacting with Hyperbridge's pallet-intents coprocessor.
|
|
@@ -1492,8 +1512,14 @@ declare class IntentsCoprocessor {
|
|
|
1492
1512
|
private ownsConnection;
|
|
1493
1513
|
/** Cached result of whether the node exposes intents_* RPC methods */
|
|
1494
1514
|
private hasIntentsRpc;
|
|
1515
|
+
/** The pallet's phantom timings, read once. Cleared on failure so the read retries. */
|
|
1516
|
+
private phantomTimingsRead;
|
|
1495
1517
|
/** The HTTP-backed api, connected on first use. Cleared after a failed attempt so it retries. */
|
|
1496
1518
|
private httpApi;
|
|
1519
|
+
/** Last runtime version read from the node, for {@link confirmedRuntimeVersion} to compare against. */
|
|
1520
|
+
private lastRuntimeVersion;
|
|
1521
|
+
/** Set once the node refuses `state_queryStorage`, so the poll stops asking for it. */
|
|
1522
|
+
private rangeQueryUnavailable;
|
|
1497
1523
|
private submissionQueue;
|
|
1498
1524
|
/**
|
|
1499
1525
|
* Creates and connects an IntentsCoprocessor to a Hyperbridge node.
|
|
@@ -1651,7 +1677,7 @@ declare class IntentsCoprocessor {
|
|
|
1651
1677
|
* @param userOp - The encoded PackedUserOperation as hex string
|
|
1652
1678
|
* @returns BidSubmissionResult with success status and block/extrinsic hash
|
|
1653
1679
|
*/
|
|
1654
|
-
submitBid(commitment: HexString$
|
|
1680
|
+
submitBid(commitment: HexString$2, userOp: HexString$2): Promise<BidSubmissionResult>;
|
|
1655
1681
|
/**
|
|
1656
1682
|
* Retracts a bid from Hyperbridge and reclaims the deposit
|
|
1657
1683
|
*
|
|
@@ -1660,7 +1686,7 @@ declare class IntentsCoprocessor {
|
|
|
1660
1686
|
* @param commitment - The order commitment hash (bytes32)
|
|
1661
1687
|
* @returns BidSubmissionResult with success status and block/extrinsic hash
|
|
1662
1688
|
*/
|
|
1663
|
-
retractBid(commitment: HexString$
|
|
1689
|
+
retractBid(commitment: HexString$2): Promise<BidSubmissionResult>;
|
|
1664
1690
|
/**
|
|
1665
1691
|
* Places a new bid and retracts a previous one in a single transaction via utility.batch.
|
|
1666
1692
|
*
|
|
@@ -1681,7 +1707,7 @@ declare class IntentsCoprocessor {
|
|
|
1681
1707
|
* @param userOp - The encoded PackedUserOperation as hex string
|
|
1682
1708
|
* @returns BidSubmissionResult with success status and block/extrinsic hash
|
|
1683
1709
|
*/
|
|
1684
|
-
submitBidWithRetraction(retractCommitment: HexString$
|
|
1710
|
+
submitBidWithRetraction(retractCommitment: HexString$2, bidCommitment: HexString$2, userOp: HexString$2): Promise<BidSubmissionResult>;
|
|
1685
1711
|
/**
|
|
1686
1712
|
* Places every phantom bid of one interval in a single extrinsic, retracting each chain's
|
|
1687
1713
|
* previous bid alongside it.
|
|
@@ -1723,7 +1749,7 @@ declare class IntentsCoprocessor {
|
|
|
1723
1749
|
* @param commitment - The order commitment hash (bytes32)
|
|
1724
1750
|
* @returns Array of BidStorageEntry objects
|
|
1725
1751
|
*/
|
|
1726
|
-
getBidStorageEntries(commitment: HexString$
|
|
1752
|
+
getBidStorageEntries(commitment: HexString$2): Promise<BidStorageEntry[]>;
|
|
1727
1753
|
/**
|
|
1728
1754
|
* Fetches all bids for a given order commitment from Hyperbridge.
|
|
1729
1755
|
*
|
|
@@ -1734,7 +1760,7 @@ declare class IntentsCoprocessor {
|
|
|
1734
1760
|
* @param commitment - The order commitment hash (bytes32)
|
|
1735
1761
|
* @returns Array of FillerBid objects containing filler address, userOp, and deposit
|
|
1736
1762
|
*/
|
|
1737
|
-
getBidsForOrder(commitment: HexString$
|
|
1763
|
+
getBidsForOrder(commitment: HexString$2): Promise<FillerBid[]>;
|
|
1738
1764
|
/**
|
|
1739
1765
|
* Fetches bids using the custom intents_getBidsForOrder RPC.
|
|
1740
1766
|
* Single round-trip but does not include deposit amounts.
|
|
@@ -1757,11 +1783,61 @@ declare class IntentsCoprocessor {
|
|
|
1757
1783
|
* Returns `null` if the key is absent (e.g. the node is not an offchain worker
|
|
1758
1784
|
* or the commitment has expired and been cleared).
|
|
1759
1785
|
*/
|
|
1760
|
-
fetchPhantomOrder(commitment: HexString$
|
|
1786
|
+
fetchPhantomOrder(commitment: HexString$2): Promise<Order | null>;
|
|
1761
1787
|
/**
|
|
1762
1788
|
* Reads the PhantomOrderRegistered events emitted in a single block.
|
|
1789
|
+
*
|
|
1790
|
+
* Costs two RPCs per block when `knownVersion` is supplied and four without it, which is why the
|
|
1791
|
+
* poll goes to the trouble of establishing one. `api.at(hash)` has to work out which metadata to
|
|
1792
|
+
* decode the block against, and with nothing to go on it fetches the header and then the runtime
|
|
1793
|
+
* version at its parent — every block, forever. Its cheaper paths are a registry already pinned
|
|
1794
|
+
* to this exact hash (only ever the previous block's) or one matching a version the caller
|
|
1795
|
+
* names, so naming the version is the only way out. See `getBlockRegistry` in
|
|
1796
|
+
* `@polkadot/api/base/Init`; the `getUpgradeVersion` shortcut that would otherwise skip the
|
|
1797
|
+
* lookup only covers chains hardcoded in `@polkadot/types-known`, which Hyperbridge is not.
|
|
1798
|
+
*
|
|
1799
|
+
* @param knownVersion - the runtime version this block is known to run, if the caller has
|
|
1800
|
+
* established one. Passing a version the block does not actually run decodes it against the
|
|
1801
|
+
* wrong metadata, so this is for callers that have checked, not a place to pass a guess.
|
|
1802
|
+
*/
|
|
1803
|
+
getPhantomOrdersInBlock(blockNumber: number, knownVersion?: RuntimeVersion): Promise<PhantomOrderEvent[]>;
|
|
1804
|
+
/**
|
|
1805
|
+
* The same read, for a caller that already holds the block's hash.
|
|
1806
|
+
*
|
|
1807
|
+
* Split out so the poll can fetch a whole range's hashes in one concurrent wave — which the
|
|
1808
|
+
* provider coalesces into a single batched request — and then read each block's events knowing
|
|
1809
|
+
* its hash. `chain_getBlockHash` is the half of the pair that parallelises safely: it takes no
|
|
1810
|
+
* historic block hash, so it never triggers polkadot-js's per-hash registry resolution, and
|
|
1811
|
+
* concurrent calls cannot race each other's registry state.
|
|
1812
|
+
*/
|
|
1813
|
+
getPhantomOrdersAtHash(blockHash: HexString$2, knownVersion?: RuntimeVersion): Promise<PhantomOrderEvent[]>;
|
|
1814
|
+
/**
|
|
1815
|
+
* Every block's phantom orders across a whole range, in one `state_queryStorage` call.
|
|
1816
|
+
*
|
|
1817
|
+
* This is the cheap path: the request cost of a scan stops depending on how many blocks it
|
|
1818
|
+
* covers. The events key is the only key queried, and both bounds are block hashes the caller
|
|
1819
|
+
* already holds.
|
|
1820
|
+
*
|
|
1821
|
+
* Two properties of the RPC shape the result.
|
|
1822
|
+
*
|
|
1823
|
+
* It returns *diffs*: `query_storage_unfiltered` in `sc-rpc` pushes a change set for a block only
|
|
1824
|
+
* when the value differs from the previous block in the range (`has_changed`, and the set is
|
|
1825
|
+
* dropped when empty), so a block whose events encode byte-for-byte identically to its
|
|
1826
|
+
* predecessor's is simply absent. That happens on a quiet chain, where consecutive blocks carry
|
|
1827
|
+
* nothing but the timestamp inherent's `ExtrinsicSuccess`. It is safe here because an absent
|
|
1828
|
+
* block provably carries no phantom orders: a `PhantomOrderRegistered` commitment is derived from
|
|
1829
|
+
* the block number (`phantom_order_commitment`), so a block that registered orders can never
|
|
1830
|
+
* encode identically to any other block. Absent therefore means "same as the previous block",
|
|
1831
|
+
* and the previous block having orders would contradict that.
|
|
1832
|
+
*
|
|
1833
|
+
* And it is gated by `--rpc-methods` (`check_if_safe` in `sc-rpc`), which answers a denied call
|
|
1834
|
+
* with `Method not found`. The node this reads from must already run unsafe RPC to serve
|
|
1835
|
+
* `offchain_localStorageGet` for the orders themselves, so this is normally available; the poll
|
|
1836
|
+
* falls back to reading block by block when it is not.
|
|
1837
|
+
*
|
|
1838
|
+
* @returns one entry per block the node reported a change for, in ascending block order.
|
|
1763
1839
|
*/
|
|
1764
|
-
|
|
1840
|
+
getPhantomOrdersInRange(fromBlockHash: HexString$2, toBlockHash: HexString$2): Promise<PhantomOrderEvent[][]>;
|
|
1765
1841
|
/**
|
|
1766
1842
|
* Polls for newly registered phantom orders, invoking the callback once per block that carries
|
|
1767
1843
|
* any, with all of that block's orders.
|
|
@@ -1788,9 +1864,87 @@ declare class IntentsCoprocessor {
|
|
|
1788
1864
|
* socket that looks alive while delivering nothing. It also means a websocket outage does not
|
|
1789
1865
|
* pause phantom bidding at all — the two transports fail independently.
|
|
1790
1866
|
*
|
|
1867
|
+
* What the cadence does *not* describe is the request rate, which is what rate limiters police.
|
|
1868
|
+
* A tick costs four requests whatever the range covers — the head, the runtime version, the two
|
|
1869
|
+
* bounding block hashes as one batched request, and one `state_queryStorage` for every block's
|
|
1870
|
+
* events — and they go out back-to-back, so an interval well under any per-second limit could
|
|
1871
|
+
* still arrive as a burst over it. Three things keep that in bounds: the provider coalesces
|
|
1872
|
+
* concurrent calls into one request and paces requests through the endpoint's token bucket (see
|
|
1873
|
+
* `http`), and `maxBlocksPerPoll` bounds the range. A 429 that gets through anyway backs the
|
|
1874
|
+
* poll off for a doubling number of ticks, so a limiter that is already shedding load is not
|
|
1875
|
+
* handed the next window's budget in rejections too.
|
|
1876
|
+
*
|
|
1877
|
+
* Where the node will not serve `state_queryStorage` the poll reads block by block instead, at
|
|
1878
|
+
* three requests plus one per block; see {@link scanRangeAtOnce}.
|
|
1879
|
+
*
|
|
1791
1880
|
* Returns a function that stops polling.
|
|
1792
1881
|
*/
|
|
1793
1882
|
pollPhantomOrders(callback: (events: PhantomOrderEvent[]) => void, options?: PollPhantomOrdersOptions): () => void;
|
|
1883
|
+
/**
|
|
1884
|
+
* The Hyperbridge head, over HTTP like every other read here.
|
|
1885
|
+
*
|
|
1886
|
+
* Exposed for callers that have to know how old something is: a phantom order carries the block
|
|
1887
|
+
* it was registered at, and only against the head does that become "still biddable" or "long
|
|
1888
|
+
* expired".
|
|
1889
|
+
*/
|
|
1890
|
+
latestBlockNumber(): Promise<number>;
|
|
1891
|
+
/**
|
|
1892
|
+
* The pallet's phantom timings, read from chain state.
|
|
1893
|
+
*
|
|
1894
|
+
* Both are governance-settable and neither is derivable: on Nexus today the window is 15 while
|
|
1895
|
+
* the runtime constant behind it is 25, so anything hard-coded is wrong in one direction or the
|
|
1896
|
+
* other — too tight and live orders are dropped, too loose and bids are sent into a closed
|
|
1897
|
+
* window for the pallet to reject.
|
|
1898
|
+
*
|
|
1899
|
+
* Read once per instance and cached, because a governance change to either is rare and a read
|
|
1900
|
+
* per poll tick would be a request per tick forever. The cost is that a change is picked up on
|
|
1901
|
+
* the next restart rather than immediately. A failed read is not cached, so it retries.
|
|
1902
|
+
*/
|
|
1903
|
+
phantomTimings(): Promise<PhantomTimings>;
|
|
1904
|
+
private readPhantomTimings;
|
|
1905
|
+
/**
|
|
1906
|
+
* A whole range of blocks in one `state_queryStorage` call, or `null` when that is not available
|
|
1907
|
+
* and the caller should read block by block.
|
|
1908
|
+
*
|
|
1909
|
+
* Two conditions have to hold, and both are about decoding rather than the range itself.
|
|
1910
|
+
*
|
|
1911
|
+
* The version must be confirmed for this tick — an upgrade inside the range means blocks decode
|
|
1912
|
+
* against different metadata, and one call cannot do that.
|
|
1913
|
+
*
|
|
1914
|
+
* And that confirmed version must still be the one the api's own registry was built for.
|
|
1915
|
+
* `state_queryStorage` declares no historic block hash, so rpc-core skips its registry swap and
|
|
1916
|
+
* decodes the reply against the default registry — fixed at connect, with no
|
|
1917
|
+
* `subscribeRuntimeVersion` on an HTTP api to refresh it. After an upgrade the two diverge, and
|
|
1918
|
+
* the per-block path takes over for good: `api.at(hash, version)` resolves, and builds, the right
|
|
1919
|
+
* registry. That costs a restart to get the cheap path back, which is the correct direction to
|
|
1920
|
+
* fail in.
|
|
1921
|
+
*/
|
|
1922
|
+
private scanRangeAtOnce;
|
|
1923
|
+
/**
|
|
1924
|
+
* The runtime version this tick's blocks may be decoded against, or `undefined` when that cannot
|
|
1925
|
+
* be established and each block must resolve its own.
|
|
1926
|
+
*
|
|
1927
|
+
* Naming a version to `api.at` is what removes two of the four RPCs a block scan costs, and it
|
|
1928
|
+
* is only sound while the version is actually the block's. Getting that wrong is not a loud
|
|
1929
|
+
* failure: events decoded against the wrong metadata come back as a shape the scan does not
|
|
1930
|
+
* recognise, so the block reads as carrying no phantom orders and the cursor advances past it —
|
|
1931
|
+
* exactly the silent miss the block cursor exists to rule out.
|
|
1932
|
+
*
|
|
1933
|
+
* So the version is read fresh each tick and only used when it matches the previous reading.
|
|
1934
|
+
* `specVersion` only ever increases, and this read happens *after* the head read, so two equal
|
|
1935
|
+
* readings mean no upgrade landed anywhere in between — and therefore none in the range about to
|
|
1936
|
+
* be scanned. A reading that differs means an upgrade landed inside the range: that tick falls
|
|
1937
|
+
* back to per-block resolution, which is exact, and the version is used from the next tick on
|
|
1938
|
+
* once it has been seen twice.
|
|
1939
|
+
*
|
|
1940
|
+
* The gap this leaves is a backlog reaching back past an upgrade, whose oldest blocks predate
|
|
1941
|
+
* even the previous reading. Recovering from an outage that long means those bid windows closed
|
|
1942
|
+
* many upgrades ago, so nothing is lost that was still winnable.
|
|
1943
|
+
*
|
|
1944
|
+
* A version that cannot be read at all yields `undefined` rather than an error: the scan is
|
|
1945
|
+
* about to make the same request against the same endpoint and is the better place to report it.
|
|
1946
|
+
*/
|
|
1947
|
+
private confirmedRuntimeVersion;
|
|
1794
1948
|
/**
|
|
1795
1949
|
* The poll cadence for the runtime this instance is connected to: Gargantua polls every block,
|
|
1796
1950
|
* everything else every 15s. Falls back to the slower cadence if the runtime cannot be read,
|
|
@@ -1805,7 +1959,7 @@ declare class IntentsCoprocessor {
|
|
|
1805
1959
|
type IIsmpMessage = IRequestMessage | ITimeoutPostRequestMessage | IGetResponseMessage | IGetRequestMessage | IConsensusMessage | IBatchConsensusAndPostRequestMessage | IBatchConsensusAndGetResponseMessage;
|
|
1806
1960
|
interface IConsensusMessage {
|
|
1807
1961
|
kind: "Consensus";
|
|
1808
|
-
consensusProof: HexString$
|
|
1962
|
+
consensusProof: HexString$2;
|
|
1809
1963
|
}
|
|
1810
1964
|
interface IRequestMessage {
|
|
1811
1965
|
/**
|
|
@@ -1823,7 +1977,7 @@ interface IRequestMessage {
|
|
|
1823
1977
|
/**
|
|
1824
1978
|
* The signer of the message.
|
|
1825
1979
|
*/
|
|
1826
|
-
signer: HexString$
|
|
1980
|
+
signer: HexString$2;
|
|
1827
1981
|
}
|
|
1828
1982
|
interface IGetRequestMessage {
|
|
1829
1983
|
/**
|
|
@@ -1845,7 +1999,7 @@ interface IGetRequestMessage {
|
|
|
1845
1999
|
/**
|
|
1846
2000
|
* The signer of the message.
|
|
1847
2001
|
*/
|
|
1848
|
-
signer: HexString$
|
|
2002
|
+
signer: HexString$2;
|
|
1849
2003
|
}
|
|
1850
2004
|
interface IGetResponse {
|
|
1851
2005
|
/**
|
|
@@ -1873,7 +2027,7 @@ interface IGetResponseMessage {
|
|
|
1873
2027
|
/**
|
|
1874
2028
|
* The signer of the message.
|
|
1875
2029
|
*/
|
|
1876
|
-
signer: HexString$
|
|
2030
|
+
signer: HexString$2;
|
|
1877
2031
|
}
|
|
1878
2032
|
interface ITimeoutPostRequestMessage {
|
|
1879
2033
|
/**
|
|
@@ -1891,17 +2045,17 @@ interface ITimeoutPostRequestMessage {
|
|
|
1891
2045
|
}
|
|
1892
2046
|
interface IBatchConsensusAndPostRequestMessage {
|
|
1893
2047
|
kind: "BatchConsensusAndPostRequest";
|
|
1894
|
-
consensusProofs: HexString$
|
|
2048
|
+
consensusProofs: HexString$2[];
|
|
1895
2049
|
requests: IPostRequest[];
|
|
1896
2050
|
proof: IProof;
|
|
1897
|
-
signer: HexString$
|
|
2051
|
+
signer: HexString$2;
|
|
1898
2052
|
}
|
|
1899
2053
|
interface IBatchConsensusAndGetResponseMessage {
|
|
1900
2054
|
kind: "BatchConsensusAndGetResponse";
|
|
1901
|
-
consensusProofs: HexString$
|
|
2055
|
+
consensusProofs: HexString$2[];
|
|
1902
2056
|
responses: IGetResponse[];
|
|
1903
2057
|
proof: IProof;
|
|
1904
|
-
signer: HexString$
|
|
2058
|
+
signer: HexString$2;
|
|
1905
2059
|
}
|
|
1906
2060
|
interface IProof {
|
|
1907
2061
|
/**
|
|
@@ -1919,7 +2073,7 @@ interface IProof {
|
|
|
1919
2073
|
/**
|
|
1920
2074
|
* The encoded storage proof
|
|
1921
2075
|
*/
|
|
1922
|
-
proof: HexString$
|
|
2076
|
+
proof: HexString$2;
|
|
1923
2077
|
}
|
|
1924
2078
|
/**
|
|
1925
2079
|
* Interface representing a chain.
|
|
@@ -1933,18 +2087,18 @@ interface IChain {
|
|
|
1933
2087
|
/**
|
|
1934
2088
|
* Returns the state trie key for the request-receipt storage item for the given request commitment.
|
|
1935
2089
|
*/
|
|
1936
|
-
requestReceiptKey(commitment: HexString$
|
|
2090
|
+
requestReceiptKey(commitment: HexString$2): HexString$2;
|
|
1937
2091
|
/**
|
|
1938
2092
|
* Query and return the request-receipt for the given request commitment.
|
|
1939
2093
|
*/
|
|
1940
|
-
queryRequestReceipt(commitment: HexString$
|
|
2094
|
+
queryRequestReceipt(commitment: HexString$2): Promise<HexString$2 | undefined>;
|
|
1941
2095
|
/**
|
|
1942
2096
|
* Query and return the encoded storage proof for the provided keys at the given height.
|
|
1943
2097
|
* @param address - Optional contract address for EVM chains; defaults to host contract when omitted.
|
|
1944
2098
|
*/
|
|
1945
|
-
queryStateProof(at: bigint, keys: HexString$
|
|
1946
|
-
queryProof(message: IMessage, counterparty: string, at?: bigint): Promise<HexString$
|
|
1947
|
-
encode(message: IIsmpMessage): HexString$
|
|
2099
|
+
queryStateProof(at: bigint, keys: HexString$2[], address?: HexString$2): Promise<HexString$2>;
|
|
2100
|
+
queryProof(message: IMessage, counterparty: string, at?: bigint): Promise<HexString$2>;
|
|
2101
|
+
encode(message: IIsmpMessage): HexString$2;
|
|
1948
2102
|
/**
|
|
1949
2103
|
* Get the latest state machine height for a given state machine ID.
|
|
1950
2104
|
*/
|
|
@@ -1969,18 +2123,18 @@ interface IEvmChain extends IChain {
|
|
|
1969
2123
|
getHostNonce(): Promise<bigint>;
|
|
1970
2124
|
quoteNative(request: IPostRequest | IGetRequest, fee: bigint): Promise<bigint>;
|
|
1971
2125
|
getFeeTokenWithDecimals(): Promise<{
|
|
1972
|
-
address: HexString$
|
|
2126
|
+
address: HexString$2;
|
|
1973
2127
|
decimals: number;
|
|
1974
2128
|
}>;
|
|
1975
|
-
getPlaceOrderCalldata(txHash: string, intentGatewayAddress: string, occurrenceIndex?: number): Promise<HexString$
|
|
1976
|
-
broadcastTransaction(signedTransaction: HexString$
|
|
1977
|
-
getTransactionReceipt(hash: HexString$
|
|
2129
|
+
getPlaceOrderCalldata(txHash: string, intentGatewayAddress: string, occurrenceIndex?: number): Promise<HexString$2>;
|
|
2130
|
+
broadcastTransaction(signedTransaction: HexString$2): Promise<TransactionReceipt>;
|
|
2131
|
+
getTransactionReceipt(hash: HexString$2): Promise<TransactionReceipt>;
|
|
1978
2132
|
}
|
|
1979
2133
|
|
|
1980
2134
|
type EstimateGasCallData = ContractFunctionArgs<typeof _default$1.ABI, "nonpayable" | "payable", "handlePostRequests">;
|
|
1981
|
-
type HexString$
|
|
2135
|
+
type HexString$2 = `0x${string}`;
|
|
1982
2136
|
type StateMachineId = string;
|
|
1983
|
-
type BytesLikeHex = HexString$
|
|
2137
|
+
type BytesLikeHex = HexString$2;
|
|
1984
2138
|
interface IConfig {
|
|
1985
2139
|
source: IEvmConfig | ISubstrateConfig | IPolkadotHubConfig | IPharosConfig;
|
|
1986
2140
|
dest: IEvmConfig | ISubstrateConfig | IPolkadotHubConfig | IPharosConfig;
|
|
@@ -1990,7 +2144,7 @@ interface IConfig {
|
|
|
1990
2144
|
interface IEvmConfig {
|
|
1991
2145
|
rpcUrl: string;
|
|
1992
2146
|
stateMachineId: string;
|
|
1993
|
-
host: HexString$
|
|
2147
|
+
host: HexString$2;
|
|
1994
2148
|
consensusStateId: string;
|
|
1995
2149
|
}
|
|
1996
2150
|
/**
|
|
@@ -2022,25 +2176,25 @@ interface IHyperbridgeConfig {
|
|
|
2022
2176
|
interface IPostRequest {
|
|
2023
2177
|
source: string;
|
|
2024
2178
|
dest: string;
|
|
2025
|
-
from: HexString$
|
|
2026
|
-
to: HexString$
|
|
2179
|
+
from: HexString$2;
|
|
2180
|
+
to: HexString$2;
|
|
2027
2181
|
nonce: bigint;
|
|
2028
|
-
body: HexString$
|
|
2182
|
+
body: HexString$2;
|
|
2029
2183
|
timeoutTimestamp: bigint;
|
|
2030
2184
|
}
|
|
2031
2185
|
interface IGetRequest {
|
|
2032
2186
|
source: string;
|
|
2033
2187
|
dest: string;
|
|
2034
|
-
from: HexString$
|
|
2188
|
+
from: HexString$2;
|
|
2035
2189
|
nonce: bigint;
|
|
2036
2190
|
height: bigint;
|
|
2037
|
-
keys: HexString$
|
|
2191
|
+
keys: HexString$2[];
|
|
2038
2192
|
timeoutTimestamp: bigint;
|
|
2039
|
-
context: HexString$
|
|
2193
|
+
context: HexString$2;
|
|
2040
2194
|
}
|
|
2041
2195
|
interface GetResponseStorageValues {
|
|
2042
|
-
key: HexString$
|
|
2043
|
-
value: HexString$
|
|
2196
|
+
key: HexString$2;
|
|
2197
|
+
value: HexString$2;
|
|
2044
2198
|
}
|
|
2045
2199
|
interface IPostResponse {
|
|
2046
2200
|
post: IPostRequest;
|
|
@@ -2048,9 +2202,9 @@ interface IPostResponse {
|
|
|
2048
2202
|
timeoutTimestamp: bigint;
|
|
2049
2203
|
}
|
|
2050
2204
|
type IMessage = {
|
|
2051
|
-
Requests: HexString$
|
|
2205
|
+
Requests: HexString$2[];
|
|
2052
2206
|
} | {
|
|
2053
|
-
Responses: HexString$
|
|
2207
|
+
Responses: HexString$2[];
|
|
2054
2208
|
};
|
|
2055
2209
|
type IndexerQueryClient = GraphQLClient;
|
|
2056
2210
|
interface ClientConfig {
|
|
@@ -2215,10 +2369,10 @@ interface RequestResponse {
|
|
|
2215
2369
|
nodes: Array<{
|
|
2216
2370
|
source: string;
|
|
2217
2371
|
dest: string;
|
|
2218
|
-
to: HexString$
|
|
2219
|
-
from: HexString$
|
|
2372
|
+
to: HexString$2;
|
|
2373
|
+
from: HexString$2;
|
|
2220
2374
|
nonce: bigint;
|
|
2221
|
-
body: HexString$
|
|
2375
|
+
body: HexString$2;
|
|
2222
2376
|
timeoutTimestamp: bigint;
|
|
2223
2377
|
statusMetadata: {
|
|
2224
2378
|
nodes: Array<{
|
|
@@ -2238,12 +2392,12 @@ interface GetRequestResponse {
|
|
|
2238
2392
|
nodes: Array<{
|
|
2239
2393
|
source: string;
|
|
2240
2394
|
dest: string;
|
|
2241
|
-
to: HexString$
|
|
2242
|
-
from: HexString$
|
|
2395
|
+
to: HexString$2;
|
|
2396
|
+
from: HexString$2;
|
|
2243
2397
|
nonce: bigint;
|
|
2244
2398
|
height: bigint;
|
|
2245
|
-
keys: HexString$
|
|
2246
|
-
context: HexString$
|
|
2399
|
+
keys: HexString$2[];
|
|
2400
|
+
context: HexString$2;
|
|
2247
2401
|
timeoutTimestamp: bigint;
|
|
2248
2402
|
statusMetadata: {
|
|
2249
2403
|
nodes: Array<{
|
|
@@ -2343,20 +2497,20 @@ type RequestStatusWithMetadata = {
|
|
|
2343
2497
|
interface GenericRequestWithStatuses {
|
|
2344
2498
|
source: string;
|
|
2345
2499
|
dest: string;
|
|
2346
|
-
from: HexString$
|
|
2500
|
+
from: HexString$2;
|
|
2347
2501
|
nonce: bigint;
|
|
2348
2502
|
timeoutTimestamp: bigint;
|
|
2349
2503
|
statuses: Array<RequestStatusWithMetadata>;
|
|
2350
2504
|
}
|
|
2351
2505
|
interface PostRequestWithStatus extends GenericRequestWithStatuses {
|
|
2352
|
-
to: HexString$
|
|
2353
|
-
body: HexString$
|
|
2506
|
+
to: HexString$2;
|
|
2507
|
+
body: HexString$2;
|
|
2354
2508
|
}
|
|
2355
2509
|
interface GetRequestWithStatus extends GenericRequestWithStatuses {
|
|
2356
2510
|
height: bigint;
|
|
2357
|
-
keys: HexString$
|
|
2358
|
-
context: HexString$
|
|
2359
|
-
commitment: HexString$
|
|
2511
|
+
keys: HexString$2[];
|
|
2512
|
+
context: HexString$2;
|
|
2513
|
+
commitment: HexString$2;
|
|
2360
2514
|
}
|
|
2361
2515
|
interface GetResponseByRequestIdResponse {
|
|
2362
2516
|
getResponses: {
|
|
@@ -2399,7 +2553,7 @@ interface AssetTeleported {
|
|
|
2399
2553
|
to: string;
|
|
2400
2554
|
amount: bigint;
|
|
2401
2555
|
dest: string;
|
|
2402
|
-
commitment: HexString$
|
|
2556
|
+
commitment: HexString$2;
|
|
2403
2557
|
createdAt: Date;
|
|
2404
2558
|
blockNumber: number;
|
|
2405
2559
|
}
|
|
@@ -2409,7 +2563,7 @@ interface AssetTeleportedResponse {
|
|
|
2409
2563
|
interface StateMachineIdParams {
|
|
2410
2564
|
stateId: {
|
|
2411
2565
|
Evm?: number;
|
|
2412
|
-
Substrate?: HexString$
|
|
2566
|
+
Substrate?: HexString$2;
|
|
2413
2567
|
Polkadot?: number;
|
|
2414
2568
|
Kusama?: number;
|
|
2415
2569
|
};
|
|
@@ -2452,73 +2606,73 @@ interface TokenInfo {
|
|
|
2452
2606
|
interface DecodedOrderPlacedLog extends Log {
|
|
2453
2607
|
eventName: string;
|
|
2454
2608
|
args: {
|
|
2455
|
-
user: HexString$
|
|
2609
|
+
user: HexString$2;
|
|
2456
2610
|
source: string;
|
|
2457
2611
|
destination: string;
|
|
2458
2612
|
deadline: bigint;
|
|
2459
2613
|
nonce: bigint;
|
|
2460
2614
|
fees: bigint;
|
|
2461
|
-
session: HexString$
|
|
2462
|
-
beneficiary: HexString$
|
|
2615
|
+
session: HexString$2;
|
|
2616
|
+
beneficiary: HexString$2;
|
|
2463
2617
|
predispatch: Array<{
|
|
2464
|
-
token: HexString$
|
|
2618
|
+
token: HexString$2;
|
|
2465
2619
|
amount: bigint;
|
|
2466
2620
|
}>;
|
|
2467
2621
|
inputs: Array<{
|
|
2468
|
-
token: HexString$
|
|
2622
|
+
token: HexString$2;
|
|
2469
2623
|
amount: bigint;
|
|
2470
2624
|
}>;
|
|
2471
2625
|
outputs: Array<{
|
|
2472
|
-
token: HexString$
|
|
2626
|
+
token: HexString$2;
|
|
2473
2627
|
amount: bigint;
|
|
2474
2628
|
}>;
|
|
2475
2629
|
/**
|
|
2476
2630
|
* Calldata executed via the CallDispatcher before escrow.
|
|
2477
2631
|
* Absent on logs emitted under the pre-#1092 event schema.
|
|
2478
2632
|
*/
|
|
2479
|
-
predispatchCall?: HexString$
|
|
2633
|
+
predispatchCall?: HexString$2;
|
|
2480
2634
|
/**
|
|
2481
2635
|
* Calldata executed on the destination chain during the fill.
|
|
2482
2636
|
* Absent on logs emitted under the pre-#1092 event schema.
|
|
2483
2637
|
*/
|
|
2484
|
-
outputCall?: HexString$
|
|
2638
|
+
outputCall?: HexString$2;
|
|
2485
2639
|
/**
|
|
2486
2640
|
* Attribution tag supplied by the order placer.
|
|
2487
2641
|
* Absent on logs emitted under the pre-#1092 event schema.
|
|
2488
2642
|
*/
|
|
2489
|
-
graffiti?: HexString$
|
|
2643
|
+
graffiti?: HexString$2;
|
|
2490
2644
|
};
|
|
2491
|
-
transactionHash: HexString$
|
|
2645
|
+
transactionHash: HexString$2;
|
|
2492
2646
|
}
|
|
2493
2647
|
interface DecodedPostRequestEvent extends Log {
|
|
2494
2648
|
eventName: string;
|
|
2495
2649
|
args: {
|
|
2496
2650
|
source: string;
|
|
2497
2651
|
dest: string;
|
|
2498
|
-
from: HexString$
|
|
2499
|
-
to: HexString$
|
|
2652
|
+
from: HexString$2;
|
|
2653
|
+
to: HexString$2;
|
|
2500
2654
|
nonce: bigint;
|
|
2501
2655
|
timeoutTimestamp: bigint;
|
|
2502
|
-
body: HexString$
|
|
2656
|
+
body: HexString$2;
|
|
2503
2657
|
fee: bigint;
|
|
2504
2658
|
};
|
|
2505
|
-
transactionHash: HexString$
|
|
2659
|
+
transactionHash: HexString$2;
|
|
2506
2660
|
}
|
|
2507
2661
|
interface DecodedPostResponseEvent extends Log {
|
|
2508
2662
|
eventName: string;
|
|
2509
2663
|
args: {
|
|
2510
2664
|
source: string;
|
|
2511
2665
|
dest: string;
|
|
2512
|
-
from: HexString$
|
|
2513
|
-
to: HexString$
|
|
2666
|
+
from: HexString$2;
|
|
2667
|
+
to: HexString$2;
|
|
2514
2668
|
nonce: bigint;
|
|
2515
2669
|
timeoutTimestamp: bigint;
|
|
2516
|
-
body: HexString$
|
|
2517
|
-
response: HexString$
|
|
2670
|
+
body: HexString$2;
|
|
2671
|
+
response: HexString$2;
|
|
2518
2672
|
responseTimeoutTimestamp: bigint;
|
|
2519
2673
|
fee: bigint;
|
|
2520
2674
|
};
|
|
2521
|
-
transactionHash: HexString$
|
|
2675
|
+
transactionHash: HexString$2;
|
|
2522
2676
|
}
|
|
2523
2677
|
/**
|
|
2524
2678
|
* Options for canceling an order
|
|
@@ -2540,11 +2694,11 @@ interface Deployment {
|
|
|
2540
2694
|
/**
|
|
2541
2695
|
* The raw state machine ID bytes for the deployment chain (hashed on-chain)
|
|
2542
2696
|
*/
|
|
2543
|
-
chain: HexString$
|
|
2697
|
+
chain: HexString$2;
|
|
2544
2698
|
/**
|
|
2545
2699
|
* The gateway identifier
|
|
2546
2700
|
*/
|
|
2547
|
-
gateway: HexString$
|
|
2701
|
+
gateway: HexString$2;
|
|
2548
2702
|
}
|
|
2549
2703
|
/**
|
|
2550
2704
|
* Represents the body of a request
|
|
@@ -2553,11 +2707,11 @@ interface RequestBody {
|
|
|
2553
2707
|
/**
|
|
2554
2708
|
* Represents the commitment of an order
|
|
2555
2709
|
*/
|
|
2556
|
-
commitment: HexString$
|
|
2710
|
+
commitment: HexString$2;
|
|
2557
2711
|
/**
|
|
2558
2712
|
* Stores the identifier for the beneficiary
|
|
2559
2713
|
*/
|
|
2560
|
-
beneficiary: HexString$
|
|
2714
|
+
beneficiary: HexString$2;
|
|
2561
2715
|
/**
|
|
2562
2716
|
* An array of token identifiers
|
|
2563
2717
|
*/
|
|
@@ -2725,8 +2879,8 @@ interface ExecutionResult {
|
|
|
2725
2879
|
* Any tokens exchanged during the fill process
|
|
2726
2880
|
*/
|
|
2727
2881
|
exchanges?: Array<{
|
|
2728
|
-
fromToken: HexString$
|
|
2729
|
-
toToken: HexString$
|
|
2882
|
+
fromToken: HexString$2;
|
|
2883
|
+
toToken: HexString$2;
|
|
2730
2884
|
fromAmount: string;
|
|
2731
2885
|
toAmount: string;
|
|
2732
2886
|
exchangeRate: string;
|
|
@@ -2748,15 +2902,15 @@ interface DispatchPost {
|
|
|
2748
2902
|
/**
|
|
2749
2903
|
* Bytes representation of the destination state machine
|
|
2750
2904
|
*/
|
|
2751
|
-
dest: HexString$
|
|
2905
|
+
dest: HexString$2;
|
|
2752
2906
|
/**
|
|
2753
2907
|
* The destination module
|
|
2754
2908
|
*/
|
|
2755
|
-
to: HexString$
|
|
2909
|
+
to: HexString$2;
|
|
2756
2910
|
/**
|
|
2757
2911
|
* The request body
|
|
2758
2912
|
*/
|
|
2759
|
-
body: HexString$
|
|
2913
|
+
body: HexString$2;
|
|
2760
2914
|
/**
|
|
2761
2915
|
* Timeout for this request in seconds
|
|
2762
2916
|
*/
|
|
@@ -2769,13 +2923,13 @@ interface DispatchPost {
|
|
|
2769
2923
|
/**
|
|
2770
2924
|
* Who pays for this request?
|
|
2771
2925
|
*/
|
|
2772
|
-
payer: HexString$
|
|
2926
|
+
payer: HexString$2;
|
|
2773
2927
|
}
|
|
2774
2928
|
interface DispatchGet {
|
|
2775
2929
|
/**
|
|
2776
2930
|
* Bytes representation of the destination state machine
|
|
2777
2931
|
*/
|
|
2778
|
-
dest: HexString$
|
|
2932
|
+
dest: HexString$2;
|
|
2779
2933
|
/**
|
|
2780
2934
|
* Height at which to read the state machine
|
|
2781
2935
|
*/
|
|
@@ -2783,7 +2937,7 @@ interface DispatchGet {
|
|
|
2783
2937
|
/**
|
|
2784
2938
|
* Raw storage keys to fetch values from the counterparty
|
|
2785
2939
|
*/
|
|
2786
|
-
keys: HexString$
|
|
2940
|
+
keys: HexString$2[];
|
|
2787
2941
|
/**
|
|
2788
2942
|
* Timeout for this request in seconds
|
|
2789
2943
|
*/
|
|
@@ -2795,17 +2949,17 @@ interface DispatchGet {
|
|
|
2795
2949
|
/**
|
|
2796
2950
|
* Context for the request
|
|
2797
2951
|
*/
|
|
2798
|
-
context: HexString$
|
|
2952
|
+
context: HexString$2;
|
|
2799
2953
|
/**
|
|
2800
2954
|
* Who pays for this request?
|
|
2801
2955
|
*/
|
|
2802
|
-
payer: HexString$
|
|
2956
|
+
payer: HexString$2;
|
|
2803
2957
|
}
|
|
2804
2958
|
interface StateMachineHeight {
|
|
2805
2959
|
id: {
|
|
2806
2960
|
stateId: {
|
|
2807
2961
|
Evm?: number;
|
|
2808
|
-
Substrate?: HexString$
|
|
2962
|
+
Substrate?: HexString$2;
|
|
2809
2963
|
Polkadot?: number;
|
|
2810
2964
|
Kusama?: number;
|
|
2811
2965
|
};
|
|
@@ -2821,26 +2975,26 @@ interface HostParams {
|
|
|
2821
2975
|
* The fee token contract address. This will typically be DAI.
|
|
2822
2976
|
* but we allow it to be configurable to prevent future regrets.
|
|
2823
2977
|
*/
|
|
2824
|
-
feeToken: HexString$
|
|
2978
|
+
feeToken: HexString$2;
|
|
2825
2979
|
/**
|
|
2826
2980
|
* The admin account, this only has the rights to freeze, or unfreeze the bridge
|
|
2827
2981
|
*/
|
|
2828
|
-
admin: HexString$
|
|
2982
|
+
admin: HexString$2;
|
|
2829
2983
|
/**
|
|
2830
2984
|
* Ismp message handler contract. This performs all verification logic
|
|
2831
2985
|
* needed to validate cross-chain messages before they are dispatched to local modules
|
|
2832
2986
|
*/
|
|
2833
|
-
handler: HexString$
|
|
2987
|
+
handler: HexString$2;
|
|
2834
2988
|
/**
|
|
2835
2989
|
* The authorized host manager contract, is itself an `IIsmpModule`
|
|
2836
2990
|
* which receives governance requests from the Hyperbridge chain to either
|
|
2837
2991
|
* withdraw revenue from the host or update its protocol parameters
|
|
2838
2992
|
*/
|
|
2839
|
-
hostManager: HexString$
|
|
2993
|
+
hostManager: HexString$2;
|
|
2840
2994
|
/**
|
|
2841
2995
|
* The local UniswapV2Router02 contract, used for swapping the native token to the feeToken.
|
|
2842
2996
|
*/
|
|
2843
|
-
uniswapV2: HexString$
|
|
2997
|
+
uniswapV2: HexString$2;
|
|
2844
2998
|
/**
|
|
2845
2999
|
* The unstaking period of Polkadot's validators. In order to prevent long-range attacks
|
|
2846
3000
|
*/
|
|
@@ -2852,7 +3006,7 @@ interface HostParams {
|
|
|
2852
3006
|
/**
|
|
2853
3007
|
* The consensus client contract which handles consensus proof verification
|
|
2854
3008
|
*/
|
|
2855
|
-
consensusClient: HexString$
|
|
3009
|
+
consensusClient: HexString$2;
|
|
2856
3010
|
/**
|
|
2857
3011
|
* State machines whose state commitments are accepted
|
|
2858
3012
|
*/
|
|
@@ -2860,7 +3014,7 @@ interface HostParams {
|
|
|
2860
3014
|
/**
|
|
2861
3015
|
* The state machine identifier for hyperbridge
|
|
2862
3016
|
*/
|
|
2863
|
-
hyperbridge: HexString$
|
|
3017
|
+
hyperbridge: HexString$2;
|
|
2864
3018
|
}
|
|
2865
3019
|
interface OrderStatusMetadata {
|
|
2866
3020
|
status: OrderStatus;
|
|
@@ -2942,9 +3096,9 @@ interface OrderResponse {
|
|
|
2942
3096
|
};
|
|
2943
3097
|
}
|
|
2944
3098
|
interface PhantomOrderPriceSnapshot {
|
|
2945
|
-
commitment: HexString$
|
|
2946
|
-
tokenA: HexString$
|
|
2947
|
-
tokenB: HexString$
|
|
3099
|
+
commitment: HexString$2;
|
|
3100
|
+
tokenA: HexString$2;
|
|
3101
|
+
tokenB: HexString$2;
|
|
2948
3102
|
standardAmount: bigint;
|
|
2949
3103
|
blockNumber: bigint;
|
|
2950
3104
|
medianPrice: bigint;
|
|
@@ -2983,7 +3137,7 @@ interface LiquiditySlice {
|
|
|
2983
3137
|
interface AvailableLiquidity {
|
|
2984
3138
|
sourceChain: Chains;
|
|
2985
3139
|
destinationChain: Chains;
|
|
2986
|
-
tokenAddress: HexString$
|
|
3140
|
+
tokenAddress: HexString$2;
|
|
2987
3141
|
updatedAt: Date;
|
|
2988
3142
|
destination: LiquiditySlice;
|
|
2989
3143
|
unrestricted: LiquiditySlice;
|
|
@@ -3041,7 +3195,7 @@ interface Transaction {
|
|
|
3041
3195
|
/**
|
|
3042
3196
|
* The address to send the transaction to (typically the Universal Router address)
|
|
3043
3197
|
*/
|
|
3044
|
-
to: HexString$
|
|
3198
|
+
to: HexString$2;
|
|
3045
3199
|
/**
|
|
3046
3200
|
* The value to send with the transaction (in wei)
|
|
3047
3201
|
*/
|
|
@@ -3049,7 +3203,7 @@ interface Transaction {
|
|
|
3049
3203
|
/**
|
|
3050
3204
|
* The calldata for the transaction
|
|
3051
3205
|
*/
|
|
3052
|
-
data: HexString$
|
|
3206
|
+
data: HexString$2;
|
|
3053
3207
|
}
|
|
3054
3208
|
interface StorageFacade {
|
|
3055
3209
|
get<T>(key: string): Promise<T | undefined>;
|
|
@@ -3060,15 +3214,15 @@ interface PaymentInfo {
|
|
|
3060
3214
|
/** Accepts a standard 20-byte address; the SDK pads to bytes32 internally when needed. */
|
|
3061
3215
|
beneficiary: BytesLikeHex;
|
|
3062
3216
|
assets: TokenInfo[];
|
|
3063
|
-
call: HexString$
|
|
3217
|
+
call: HexString$2;
|
|
3064
3218
|
}
|
|
3065
3219
|
interface DispatchInfo {
|
|
3066
3220
|
assets: TokenInfo[];
|
|
3067
|
-
call: HexString$
|
|
3221
|
+
call: HexString$2;
|
|
3068
3222
|
}
|
|
3069
3223
|
interface Order {
|
|
3070
3224
|
id?: string;
|
|
3071
|
-
user: HexString$
|
|
3225
|
+
user: HexString$2;
|
|
3072
3226
|
/** Accepts either `"EVM-1"` style IDs or their hex-encoded form. */
|
|
3073
3227
|
source: StateMachineId;
|
|
3074
3228
|
/** Accepts either `"EVM-42161"` style IDs or their hex-encoded form. */
|
|
@@ -3076,7 +3230,7 @@ interface Order {
|
|
|
3076
3230
|
deadline: bigint;
|
|
3077
3231
|
nonce: bigint;
|
|
3078
3232
|
fees: bigint;
|
|
3079
|
-
session: HexString$
|
|
3233
|
+
session: HexString$2;
|
|
3080
3234
|
predispatch: DispatchInfo;
|
|
3081
3235
|
inputs: TokenInfo[];
|
|
3082
3236
|
output: PaymentInfo;
|
|
@@ -3088,18 +3242,30 @@ interface CancelOrderOptions {
|
|
|
3088
3242
|
interface FillOptions {
|
|
3089
3243
|
relayerFee: bigint;
|
|
3090
3244
|
nativeDispatchFee: bigint;
|
|
3245
|
+
/**
|
|
3246
|
+
* Last block number at which this fill may execute. `0n` means no bound.
|
|
3247
|
+
*
|
|
3248
|
+
* A solver bidding through the coprocessor signs this calldata and then has no further
|
|
3249
|
+
* say in when it is used: the order's `deadline` is placer-chosen with no ceiling, and
|
|
3250
|
+
* retracting the bid on Hyperbridge does not reach the destination chain. Without a bound
|
|
3251
|
+
* the placer can sit on a signed bid and execute it once the price has moved their way.
|
|
3252
|
+
*
|
|
3253
|
+
* In blocks, matching `order.deadline`, so both read against the same clock. Dropped when
|
|
3254
|
+
* encoding against a gateway whose implementation predates the field.
|
|
3255
|
+
*/
|
|
3256
|
+
validUntil: bigint;
|
|
3091
3257
|
outputs: TokenInfo[];
|
|
3092
3258
|
}
|
|
3093
3259
|
interface PackedUserOperation {
|
|
3094
|
-
sender: HexString$
|
|
3260
|
+
sender: HexString$2;
|
|
3095
3261
|
nonce: bigint;
|
|
3096
|
-
initCode: HexString$
|
|
3097
|
-
callData: HexString$
|
|
3098
|
-
accountGasLimits: HexString$
|
|
3262
|
+
initCode: HexString$2;
|
|
3263
|
+
callData: HexString$2;
|
|
3264
|
+
accountGasLimits: HexString$2;
|
|
3099
3265
|
preVerificationGas: bigint;
|
|
3100
|
-
gasFees: HexString$
|
|
3101
|
-
paymasterAndData: HexString$
|
|
3102
|
-
signature: HexString$
|
|
3266
|
+
gasFees: HexString$2;
|
|
3267
|
+
paymasterAndData: HexString$2;
|
|
3268
|
+
signature: HexString$2;
|
|
3103
3269
|
}
|
|
3104
3270
|
interface SigningAccount {
|
|
3105
3271
|
/**
|
|
@@ -3112,29 +3278,29 @@ interface SigningAccount {
|
|
|
3112
3278
|
* Returns the 65-byte `r ‖ s ‖ v` signature as 0x-hex, `v` 27 or 28 — the
|
|
3113
3279
|
* `eth_signTypedData_v4` form. Bid validation recovers against exactly this.
|
|
3114
3280
|
*/
|
|
3115
|
-
signTypedData: (typedData: unknown) => Promise<HexString$
|
|
3281
|
+
signTypedData: (typedData: unknown) => Promise<HexString$2>;
|
|
3116
3282
|
}
|
|
3117
3283
|
interface SubmitBidOptions {
|
|
3118
3284
|
order: Order;
|
|
3119
3285
|
fillOptions: FillOptions;
|
|
3120
|
-
solverAccount: HexString$
|
|
3286
|
+
solverAccount: HexString$2;
|
|
3121
3287
|
/** Canonical signer used for bid message signing and raw-hash operations. */
|
|
3122
3288
|
solverSigner: SigningAccount;
|
|
3123
3289
|
nonce: bigint;
|
|
3124
|
-
entryPointAddress: HexString$
|
|
3290
|
+
entryPointAddress: HexString$2;
|
|
3125
3291
|
callGasLimit: bigint;
|
|
3126
3292
|
verificationGasLimit: bigint;
|
|
3127
3293
|
preVerificationGas: bigint;
|
|
3128
3294
|
maxFeePerGas: bigint;
|
|
3129
3295
|
maxPriorityFeePerGas: bigint;
|
|
3130
3296
|
/** Pre-built ERC-7821 calldata encoding the UserOp execution (approvals + fillOrder). */
|
|
3131
|
-
callData: HexString$
|
|
3297
|
+
callData: HexString$2;
|
|
3132
3298
|
/**
|
|
3133
3299
|
* Optional packed paymasterAndData for EntryPoint v0.8.
|
|
3134
3300
|
* Must be built BEFORE calling prepareSubmitBid so the hash covers paymaster bytes.
|
|
3135
3301
|
* Defaults to "0x" (EntryPoint deposit pays gas).
|
|
3136
3302
|
*/
|
|
3137
|
-
paymasterAndData?: HexString$
|
|
3303
|
+
paymasterAndData?: HexString$2;
|
|
3138
3304
|
}
|
|
3139
3305
|
interface EstimateFillOrderParams {
|
|
3140
3306
|
order: Order;
|
|
@@ -3186,8 +3352,9 @@ interface OrderFeesQuote {
|
|
|
3186
3352
|
/**
|
|
3187
3353
|
* The amount to set as `Order.fees`, denominated in the source-chain fee
|
|
3188
3354
|
* token. Same-chain fills carry a 2x margin over the estimated fill gas without
|
|
3189
|
-
* a gas-price bump. Cross-chain
|
|
3190
|
-
*
|
|
3355
|
+
* a gas-price bump. Cross-chain orders originating on Ethereum mainnet use 50%
|
|
3356
|
+
* SDK-only gas-price headroom; other source chains use 10%. The settlement
|
|
3357
|
+
* relayer fee is then added with a further 5% buffer over the whole sum.
|
|
3191
3358
|
*/
|
|
3192
3359
|
fees: bigint;
|
|
3193
3360
|
/**
|
|
@@ -3201,7 +3368,7 @@ interface OrderFeesQuote {
|
|
|
3201
3368
|
* The source-chain fee token `fees` is denominated in — check the user's
|
|
3202
3369
|
* balance and allowance against this address when paying the fee directly.
|
|
3203
3370
|
*/
|
|
3204
|
-
feeToken: HexString$
|
|
3371
|
+
feeToken: HexString$2;
|
|
3205
3372
|
/** The underlying gas estimate the quote was derived from. */
|
|
3206
3373
|
estimate: FillOrderEstimate;
|
|
3207
3374
|
}
|
|
@@ -3216,11 +3383,11 @@ interface BidSubmissionResult {
|
|
|
3216
3383
|
/**
|
|
3217
3384
|
* Block hash where the bid was included
|
|
3218
3385
|
*/
|
|
3219
|
-
blockHash?: HexString$
|
|
3386
|
+
blockHash?: HexString$2;
|
|
3220
3387
|
/**
|
|
3221
3388
|
* Extrinsic hash of the bid transaction
|
|
3222
3389
|
*/
|
|
3223
|
-
extrinsicHash?: HexString$
|
|
3390
|
+
extrinsicHash?: HexString$2;
|
|
3224
3391
|
/**
|
|
3225
3392
|
* Error message if submission failed
|
|
3226
3393
|
*/
|
|
@@ -3241,7 +3408,7 @@ interface BidSubmissionResult {
|
|
|
3241
3408
|
*/
|
|
3242
3409
|
interface BidStorageEntry {
|
|
3243
3410
|
/** The order commitment hash (H256) */
|
|
3244
|
-
commitment: HexString$
|
|
3411
|
+
commitment: HexString$2;
|
|
3245
3412
|
/** The filler's Substrate account ID (SS58 encoded) */
|
|
3246
3413
|
filler: string;
|
|
3247
3414
|
/** The deposit amount stored on-chain (BalanceOf<T> = u128) */
|
|
@@ -3264,11 +3431,11 @@ interface FillerBid {
|
|
|
3264
3431
|
*/
|
|
3265
3432
|
interface SelectOptions {
|
|
3266
3433
|
/** The order commitment hash (bytes32) */
|
|
3267
|
-
commitment: HexString$
|
|
3434
|
+
commitment: HexString$2;
|
|
3268
3435
|
/** The solver address to select */
|
|
3269
|
-
solver: HexString$
|
|
3436
|
+
solver: HexString$2;
|
|
3270
3437
|
/** The EIP-712 signature from the session key */
|
|
3271
|
-
signature: HexString$
|
|
3438
|
+
signature: HexString$2;
|
|
3272
3439
|
}
|
|
3273
3440
|
/**
|
|
3274
3441
|
* A first-class, executable solver bid surfaced to consumers of the intents SDK.
|
|
@@ -3286,7 +3453,7 @@ interface SelectOptions {
|
|
|
3286
3453
|
*/
|
|
3287
3454
|
interface Bid {
|
|
3288
3455
|
/** The solver account that submitted this bid (`userOp.sender`). */
|
|
3289
|
-
readonly solverAddress: HexString$
|
|
3456
|
+
readonly solverAddress: HexString$2;
|
|
3290
3457
|
/** Decoded `FillOptions.outputs` — the tokens and amounts the solver offers. */
|
|
3291
3458
|
readonly outputs: TokenInfo[];
|
|
3292
3459
|
/** Relayer fee from the decoded fill options. */
|
|
@@ -3335,8 +3502,8 @@ type IntentOrderStatusKey = keyof typeof IntentOrderStatus;
|
|
|
3335
3502
|
/** Tagged union of all possible status updates yielded by the intent order execution stream */
|
|
3336
3503
|
type IntentOrderStatusUpdate = {
|
|
3337
3504
|
status: "AWAITING_PLACE_ORDER";
|
|
3338
|
-
to: HexString$
|
|
3339
|
-
data: HexString$
|
|
3505
|
+
to: HexString$2;
|
|
3506
|
+
data: HexString$2;
|
|
3340
3507
|
/**
|
|
3341
3508
|
* The order's native-token input amounts. Native inputs cannot be
|
|
3342
3509
|
* pulled via allowance, so this must be part of the placement
|
|
@@ -3350,62 +3517,62 @@ type IntentOrderStatusUpdate = {
|
|
|
3350
3517
|
* (fee-token rail).
|
|
3351
3518
|
*/
|
|
3352
3519
|
nativeFee: bigint;
|
|
3353
|
-
sessionPrivateKey: HexString$
|
|
3520
|
+
sessionPrivateKey: HexString$2;
|
|
3354
3521
|
/** Exact source-chain fee-token amount encoded in `data`. */
|
|
3355
3522
|
feeTokenAmount: bigint;
|
|
3356
3523
|
/** Source-chain ERC-20 token charged for `feeTokenAmount`. */
|
|
3357
|
-
feeTokenAddress: HexString$
|
|
3524
|
+
feeTokenAddress: HexString$2;
|
|
3358
3525
|
} | {
|
|
3359
3526
|
status: "ORDER_PLACED";
|
|
3360
3527
|
order: Order;
|
|
3361
3528
|
receipt: TransactionReceipt;
|
|
3362
3529
|
} | {
|
|
3363
3530
|
status: "AWAITING_BIDS";
|
|
3364
|
-
commitment: HexString$
|
|
3531
|
+
commitment: HexString$2;
|
|
3365
3532
|
totalFilledAssets: TokenInfo[];
|
|
3366
3533
|
remainingAssets: TokenInfo[];
|
|
3367
3534
|
} | {
|
|
3368
3535
|
status: "NEW_BID";
|
|
3369
|
-
commitment: HexString$
|
|
3536
|
+
commitment: HexString$2;
|
|
3370
3537
|
bid: Bid;
|
|
3371
3538
|
} | {
|
|
3372
3539
|
status: "BIDS_RECEIVED";
|
|
3373
|
-
commitment: HexString$
|
|
3540
|
+
commitment: HexString$2;
|
|
3374
3541
|
bidCount: number;
|
|
3375
3542
|
bids: Bid[];
|
|
3376
3543
|
} | {
|
|
3377
3544
|
status: "BID_SELECTED";
|
|
3378
|
-
commitment: HexString$
|
|
3379
|
-
selectedSolver: HexString$
|
|
3380
|
-
userOpHash: HexString$
|
|
3545
|
+
commitment: HexString$2;
|
|
3546
|
+
selectedSolver: HexString$2;
|
|
3547
|
+
userOpHash: HexString$2;
|
|
3381
3548
|
userOp: PackedUserOperation;
|
|
3382
|
-
transactionHash?: HexString$
|
|
3549
|
+
transactionHash?: HexString$2;
|
|
3383
3550
|
} | {
|
|
3384
3551
|
status: "FILLED";
|
|
3385
|
-
commitment: HexString$
|
|
3386
|
-
userOpHash: HexString$
|
|
3387
|
-
selectedSolver: HexString$
|
|
3388
|
-
transactionHash?: HexString$
|
|
3552
|
+
commitment: HexString$2;
|
|
3553
|
+
userOpHash: HexString$2;
|
|
3554
|
+
selectedSolver: HexString$2;
|
|
3555
|
+
transactionHash?: HexString$2;
|
|
3389
3556
|
totalFilledAssets: TokenInfo[];
|
|
3390
3557
|
remainingAssets: TokenInfo[];
|
|
3391
3558
|
} | {
|
|
3392
3559
|
status: "PARTIAL_FILL";
|
|
3393
|
-
commitment: HexString$
|
|
3394
|
-
userOpHash: HexString$
|
|
3395
|
-
selectedSolver: HexString$
|
|
3396
|
-
transactionHash?: HexString$
|
|
3560
|
+
commitment: HexString$2;
|
|
3561
|
+
userOpHash: HexString$2;
|
|
3562
|
+
selectedSolver: HexString$2;
|
|
3563
|
+
transactionHash?: HexString$2;
|
|
3397
3564
|
filledAssets: TokenInfo[];
|
|
3398
3565
|
totalFilledAssets: TokenInfo[];
|
|
3399
3566
|
remainingAssets: TokenInfo[];
|
|
3400
3567
|
} | {
|
|
3401
3568
|
status: "EXPIRED";
|
|
3402
|
-
commitment: HexString$
|
|
3569
|
+
commitment: HexString$2;
|
|
3403
3570
|
totalFilledAssets?: TokenInfo[];
|
|
3404
3571
|
remainingAssets?: TokenInfo[];
|
|
3405
3572
|
error: string;
|
|
3406
3573
|
} | {
|
|
3407
3574
|
status: "FAILED";
|
|
3408
|
-
commitment?: HexString$
|
|
3575
|
+
commitment?: HexString$2;
|
|
3409
3576
|
totalFilledAssets?: TokenInfo[];
|
|
3410
3577
|
remainingAssets?: TokenInfo[];
|
|
3411
3578
|
error: string;
|
|
@@ -3413,10 +3580,10 @@ type IntentOrderStatusUpdate = {
|
|
|
3413
3580
|
/** Result of selecting a bid and submitting to the bundler */
|
|
3414
3581
|
interface SelectBidResult {
|
|
3415
3582
|
userOp: PackedUserOperation;
|
|
3416
|
-
userOpHash: HexString$
|
|
3417
|
-
solverAddress: HexString$
|
|
3418
|
-
commitment: HexString$
|
|
3419
|
-
txnHash?: HexString$
|
|
3583
|
+
userOpHash: HexString$2;
|
|
3584
|
+
solverAddress: HexString$2;
|
|
3585
|
+
commitment: HexString$2;
|
|
3586
|
+
txnHash?: HexString$2;
|
|
3420
3587
|
fillStatus?: "full" | "partial";
|
|
3421
3588
|
/** Assets filled in this user operation (best-effort, based on on-chain PartialFill logs) */
|
|
3422
3589
|
filledAssets?: TokenInfo[];
|
|
@@ -3424,7 +3591,7 @@ interface SelectBidResult {
|
|
|
3424
3591
|
/** Options for executing an intent order */
|
|
3425
3592
|
interface ExecuteIntentOrderOptions {
|
|
3426
3593
|
order: Order;
|
|
3427
|
-
sessionPrivateKey?: HexString$
|
|
3594
|
+
sessionPrivateKey?: HexString$2;
|
|
3428
3595
|
/** Duration in ms to collect bids before selecting the best one. */
|
|
3429
3596
|
auctionTimeMs: number;
|
|
3430
3597
|
pollIntervalMs?: number;
|
|
@@ -3434,19 +3601,19 @@ interface ExecuteIntentOrderOptions {
|
|
|
3434
3601
|
*/
|
|
3435
3602
|
solver?: {
|
|
3436
3603
|
/** Only bids from this address (matched against userOp.sender) will be considered */
|
|
3437
|
-
address: HexString$
|
|
3604
|
+
address: HexString$2;
|
|
3438
3605
|
/** After this many ms without a matching bid, execution falls back to any solver */
|
|
3439
3606
|
timeoutMs: number;
|
|
3440
3607
|
};
|
|
3441
3608
|
}
|
|
3442
3609
|
/** Options for resuming execution of a previously placed intent order */
|
|
3443
3610
|
interface ResumeIntentOrderOptions {
|
|
3444
|
-
sessionPrivateKey?: HexString$
|
|
3611
|
+
sessionPrivateKey?: HexString$2;
|
|
3445
3612
|
/** Duration in ms to collect bids before selecting the best one. */
|
|
3446
3613
|
auctionTimeMs: number;
|
|
3447
3614
|
pollIntervalMs?: number;
|
|
3448
3615
|
solver?: {
|
|
3449
|
-
address: HexString$
|
|
3616
|
+
address: HexString$2;
|
|
3450
3617
|
timeoutMs: number;
|
|
3451
3618
|
};
|
|
3452
3619
|
}
|
|
@@ -3467,8 +3634,238 @@ declare function sortPoolSymbols<Symbol extends string>(symbolA: Symbol, symbolB
|
|
|
3467
3634
|
/** Canonical indexer pool ID for a pair of canonical token symbols. */
|
|
3468
3635
|
declare function poolSlug(symbolA: string, symbolB: string): string;
|
|
3469
3636
|
|
|
3470
|
-
declare function encodeERC7821ExecuteBatch(calls: ERC7821Call[]): HexString$
|
|
3471
|
-
declare function decodeERC7821ExecuteBatch(callData: HexString$
|
|
3637
|
+
declare function encodeERC7821ExecuteBatch(calls: ERC7821Call[]): HexString$2;
|
|
3638
|
+
declare function decodeERC7821ExecuteBatch(callData: HexString$2): ERC7821Call[] | null;
|
|
3639
|
+
|
|
3640
|
+
/**
|
|
3641
|
+
* `FillOptions` gained a `validUntil` field. Adding a field to a struct changes the
|
|
3642
|
+
* enclosing function's selector, so `fillOrder` has two incompatible shapes in the wild:
|
|
3643
|
+
*
|
|
3644
|
+
* v1 fillOrder(Order, (uint256 relayerFee, uint256 nativeDispatchFee, TokenInfo[] outputs))
|
|
3645
|
+
* v2 fillOrder(Order, (uint256 relayerFee, uint256 nativeDispatchFee, uint256 validUntil, TokenInfo[] outputs))
|
|
3646
|
+
*
|
|
3647
|
+
* The selectors differ (`0x5cfb1ea5` vs `0xa5470064`), so a v2 payload sent to a v1
|
|
3648
|
+
* deployment finds no matching function and reverts rather than mis-decoding — which is the
|
|
3649
|
+
* safe failure, but it does mean callers have to know which shape a gateway speaks.
|
|
3650
|
+
*/
|
|
3651
|
+
type FillOptionsVersion = 1 | 2;
|
|
3652
|
+
/**
|
|
3653
|
+
* The v1 `fillOrder`, kept only so we can still talk to deployments that predate `validUntil`.
|
|
3654
|
+
*
|
|
3655
|
+
* Exported because consumers that cannot use {@link decodeFillOrder} still have to accept both
|
|
3656
|
+
* shapes. The indexer decodes bid calldata with ethers rather than viem (viem's byte handling
|
|
3657
|
+
* throws inside SubQuery's VM2 sandbox), so it rebuilds this decode itself and needs the same
|
|
3658
|
+
* definition rather than a second copy that can drift out of step with this one.
|
|
3659
|
+
*/
|
|
3660
|
+
declare const FILL_ORDER_V1_ABI: readonly [{
|
|
3661
|
+
readonly type: "function";
|
|
3662
|
+
readonly name: "fillOrder";
|
|
3663
|
+
readonly stateMutability: "payable";
|
|
3664
|
+
readonly outputs: readonly [];
|
|
3665
|
+
readonly inputs: readonly [{
|
|
3666
|
+
readonly name: "order";
|
|
3667
|
+
readonly type: "tuple";
|
|
3668
|
+
readonly internalType: "struct Order";
|
|
3669
|
+
readonly components: readonly [{
|
|
3670
|
+
readonly name: "user";
|
|
3671
|
+
readonly type: "bytes32";
|
|
3672
|
+
readonly internalType: "bytes32";
|
|
3673
|
+
}, {
|
|
3674
|
+
readonly name: "source";
|
|
3675
|
+
readonly type: "bytes";
|
|
3676
|
+
readonly internalType: "bytes";
|
|
3677
|
+
}, {
|
|
3678
|
+
readonly name: "destination";
|
|
3679
|
+
readonly type: "bytes";
|
|
3680
|
+
readonly internalType: "bytes";
|
|
3681
|
+
}, {
|
|
3682
|
+
readonly name: "deadline";
|
|
3683
|
+
readonly type: "uint256";
|
|
3684
|
+
readonly internalType: "uint256";
|
|
3685
|
+
}, {
|
|
3686
|
+
readonly name: "nonce";
|
|
3687
|
+
readonly type: "uint256";
|
|
3688
|
+
readonly internalType: "uint256";
|
|
3689
|
+
}, {
|
|
3690
|
+
readonly name: "fees";
|
|
3691
|
+
readonly type: "uint256";
|
|
3692
|
+
readonly internalType: "uint256";
|
|
3693
|
+
}, {
|
|
3694
|
+
readonly name: "session";
|
|
3695
|
+
readonly type: "address";
|
|
3696
|
+
readonly internalType: "address";
|
|
3697
|
+
}, {
|
|
3698
|
+
readonly name: "predispatch";
|
|
3699
|
+
readonly type: "tuple";
|
|
3700
|
+
readonly internalType: "struct DispatchInfo";
|
|
3701
|
+
readonly components: readonly [{
|
|
3702
|
+
readonly name: "assets";
|
|
3703
|
+
readonly type: "tuple[]";
|
|
3704
|
+
readonly internalType: "struct TokenInfo[]";
|
|
3705
|
+
readonly components: readonly [{
|
|
3706
|
+
readonly name: "token";
|
|
3707
|
+
readonly type: "bytes32";
|
|
3708
|
+
readonly internalType: "bytes32";
|
|
3709
|
+
}, {
|
|
3710
|
+
readonly name: "amount";
|
|
3711
|
+
readonly type: "uint256";
|
|
3712
|
+
readonly internalType: "uint256";
|
|
3713
|
+
}];
|
|
3714
|
+
}, {
|
|
3715
|
+
readonly name: "call";
|
|
3716
|
+
readonly type: "bytes";
|
|
3717
|
+
readonly internalType: "bytes";
|
|
3718
|
+
}];
|
|
3719
|
+
}, {
|
|
3720
|
+
readonly name: "inputs";
|
|
3721
|
+
readonly type: "tuple[]";
|
|
3722
|
+
readonly internalType: "struct TokenInfo[]";
|
|
3723
|
+
readonly components: readonly [{
|
|
3724
|
+
readonly name: "token";
|
|
3725
|
+
readonly type: "bytes32";
|
|
3726
|
+
readonly internalType: "bytes32";
|
|
3727
|
+
}, {
|
|
3728
|
+
readonly name: "amount";
|
|
3729
|
+
readonly type: "uint256";
|
|
3730
|
+
readonly internalType: "uint256";
|
|
3731
|
+
}];
|
|
3732
|
+
}, {
|
|
3733
|
+
readonly name: "output";
|
|
3734
|
+
readonly type: "tuple";
|
|
3735
|
+
readonly internalType: "struct PaymentInfo";
|
|
3736
|
+
readonly components: readonly [{
|
|
3737
|
+
readonly name: "beneficiary";
|
|
3738
|
+
readonly type: "bytes32";
|
|
3739
|
+
readonly internalType: "bytes32";
|
|
3740
|
+
}, {
|
|
3741
|
+
readonly name: "assets";
|
|
3742
|
+
readonly type: "tuple[]";
|
|
3743
|
+
readonly internalType: "struct TokenInfo[]";
|
|
3744
|
+
readonly components: readonly [{
|
|
3745
|
+
readonly name: "token";
|
|
3746
|
+
readonly type: "bytes32";
|
|
3747
|
+
readonly internalType: "bytes32";
|
|
3748
|
+
}, {
|
|
3749
|
+
readonly name: "amount";
|
|
3750
|
+
readonly type: "uint256";
|
|
3751
|
+
readonly internalType: "uint256";
|
|
3752
|
+
}];
|
|
3753
|
+
}, {
|
|
3754
|
+
readonly name: "call";
|
|
3755
|
+
readonly type: "bytes";
|
|
3756
|
+
readonly internalType: "bytes";
|
|
3757
|
+
}];
|
|
3758
|
+
}];
|
|
3759
|
+
}, {
|
|
3760
|
+
readonly name: "options";
|
|
3761
|
+
readonly type: "tuple";
|
|
3762
|
+
readonly internalType: "struct FillOptions";
|
|
3763
|
+
readonly components: readonly [{
|
|
3764
|
+
readonly name: "relayerFee";
|
|
3765
|
+
readonly type: "uint256";
|
|
3766
|
+
readonly internalType: "uint256";
|
|
3767
|
+
}, {
|
|
3768
|
+
readonly name: "nativeDispatchFee";
|
|
3769
|
+
readonly type: "uint256";
|
|
3770
|
+
readonly internalType: "uint256";
|
|
3771
|
+
}, {
|
|
3772
|
+
readonly name: "outputs";
|
|
3773
|
+
readonly type: "tuple[]";
|
|
3774
|
+
readonly internalType: "struct TokenInfo[]";
|
|
3775
|
+
readonly components: readonly [{
|
|
3776
|
+
readonly name: "token";
|
|
3777
|
+
readonly type: "bytes32";
|
|
3778
|
+
readonly internalType: "bytes32";
|
|
3779
|
+
}, {
|
|
3780
|
+
readonly name: "amount";
|
|
3781
|
+
readonly type: "uint256";
|
|
3782
|
+
readonly internalType: "uint256";
|
|
3783
|
+
}];
|
|
3784
|
+
}];
|
|
3785
|
+
}];
|
|
3786
|
+
}];
|
|
3787
|
+
/**
|
|
3788
|
+
* IntentGateway implementations deployed before `FillOptions.validUntil` existed.
|
|
3789
|
+
*
|
|
3790
|
+
* The list is of *legacy* implementations rather than current ones, so the default is v2 and
|
|
3791
|
+
* nothing has to be added here when a new implementation ships — only when an old one is
|
|
3792
|
+
* discovered. Once every deployment is upgraded this set is vestigial and still correct.
|
|
3793
|
+
*
|
|
3794
|
+
* The alternative, listing known-good implementations, would be the version constant this
|
|
3795
|
+
* replaced wearing a different hat: a value someone must remember to update on every upgrade,
|
|
3796
|
+
* where forgetting breaks every fill on the chain.
|
|
3797
|
+
*/
|
|
3798
|
+
declare const LEGACY_FILL_OPTIONS_IMPLEMENTATIONS: Set<string>;
|
|
3799
|
+
/**
|
|
3800
|
+
* Chains whose IntentGateway has not been redeployed with `FillOptions.validUntil` yet.
|
|
3801
|
+
*
|
|
3802
|
+
* A blunter instrument than {@link LEGACY_FILL_OPTIONS_IMPLEMENTATIONS} and used for the same
|
|
3803
|
+
* reason: those chains run a pre-`validUntil` implementation whose address is not tracked here,
|
|
3804
|
+
* so the address check would wrongly read them as current and every fill would revert on a
|
|
3805
|
+
* selector that does not exist.
|
|
3806
|
+
*
|
|
3807
|
+
* Delete a chain from this set when its gateway is redeployed. Once the set is empty the
|
|
3808
|
+
* implementation-address check covers everything on its own.
|
|
3809
|
+
*/
|
|
3810
|
+
declare const CHAINS_WITHOUT_VALID_UNTIL: Set<number>;
|
|
3811
|
+
/** Test seam: drop memoised detection results. */
|
|
3812
|
+
declare function resetFillOptionsVersionCache(): void;
|
|
3813
|
+
/**
|
|
3814
|
+
* Works out which `FillOptions` shape a gateway accepts from the implementation it delegates to.
|
|
3815
|
+
*
|
|
3816
|
+
* EIP-1967 standardises three slots, all holding addresses — there is no version field to read,
|
|
3817
|
+
* and the contract deliberately does not carry one either: a hand-maintained version constant is
|
|
3818
|
+
* a second source of truth that has to be bumped on the right upgrade. The implementation address
|
|
3819
|
+
* is the value the proxy already updates, so it is what identifies the deployed code.
|
|
3820
|
+
*/
|
|
3821
|
+
declare function getFillOptionsVersion(client: PublicClient, gateway: HexString$2): Promise<FillOptionsVersion>;
|
|
3822
|
+
/**
|
|
3823
|
+
* ABI-encodes a `fillOrder` call in the shape the target gateway understands.
|
|
3824
|
+
*
|
|
3825
|
+
* On a v1 gateway `validUntil` is dropped — there is nowhere to put it and no check on the
|
|
3826
|
+
* other side. That is a real loss of protection, so callers that rely on the bound should
|
|
3827
|
+
* surface it rather than assume it took effect.
|
|
3828
|
+
*/
|
|
3829
|
+
declare function encodeFillOrder(order: Order, options: FillOptions, version: FillOptionsVersion): HexString$2;
|
|
3830
|
+
/**
|
|
3831
|
+
* Decodes a `fillOrder` call of either shape.
|
|
3832
|
+
*
|
|
3833
|
+
* v2 is tried first and v1 is the fallback; the selectors differ, so there is no shape a
|
|
3834
|
+
* decode could silently get wrong. `validUntil` reads as `0n` for a v1 payload, which is the
|
|
3835
|
+
* same value that means "no bound" in v2 — accurate, since a v1 fill genuinely has none.
|
|
3836
|
+
*
|
|
3837
|
+
* @returns The decoded order and options, or `null` if the calldata is not a `fillOrder`.
|
|
3838
|
+
*/
|
|
3839
|
+
declare function decodeFillOrder(data: HexString$2): {
|
|
3840
|
+
order: Order;
|
|
3841
|
+
options: FillOptions;
|
|
3842
|
+
} | null;
|
|
3843
|
+
|
|
3844
|
+
type HexString$1 = `0x${string}`;
|
|
3845
|
+
/** A decoded `getPoolAndPositionInfo` return: the pool's key words plus the packed position info. */
|
|
3846
|
+
interface PoolAndPositionInfo {
|
|
3847
|
+
currency0: HexString$1;
|
|
3848
|
+
currency1: HexString$1;
|
|
3849
|
+
/**
|
|
3850
|
+
* The ABI-encoded PoolKey exactly as returned, i.e. the first five words. A static struct's
|
|
3851
|
+
* abi.encode IS its concatenated words, so `keccak256` of this slice is the pool id — no
|
|
3852
|
+
* re-encoding, and no chance of the re-encoding disagreeing with what the chain hashed.
|
|
3853
|
+
*/
|
|
3854
|
+
poolKeyEncoded: HexString$1;
|
|
3855
|
+
tickLower: number;
|
|
3856
|
+
tickUpper: number;
|
|
3857
|
+
}
|
|
3858
|
+
/**
|
|
3859
|
+
* How much of `outputToken` a position is currently worth. Zero when the token is not one of the
|
|
3860
|
+
* pool's currencies, or when the price has moved the position entirely onto the other side — both
|
|
3861
|
+
* ordinary outcomes, not errors.
|
|
3862
|
+
*/
|
|
3863
|
+
declare function positionAmountOfToken(params: {
|
|
3864
|
+
info: PoolAndPositionInfo;
|
|
3865
|
+
liquidity: bigint;
|
|
3866
|
+
sqrtPriceX96: bigint;
|
|
3867
|
+
outputToken: string;
|
|
3868
|
+
}): bigint;
|
|
3472
3869
|
|
|
3473
3870
|
type HexString = `0x${string}`;
|
|
3474
3871
|
/**
|
|
@@ -3871,6 +4268,10 @@ declare const FILL_ORDER_ABI: readonly [{
|
|
|
3871
4268
|
readonly name: "nativeDispatchFee";
|
|
3872
4269
|
readonly type: "uint256";
|
|
3873
4270
|
readonly internalType: "uint256";
|
|
4271
|
+
}, {
|
|
4272
|
+
readonly name: "validUntil";
|
|
4273
|
+
readonly type: "uint256";
|
|
4274
|
+
readonly internalType: "uint256";
|
|
3874
4275
|
}, {
|
|
3875
4276
|
readonly name: "outputs";
|
|
3876
4277
|
readonly type: "tuple[]";
|
|
@@ -4994,6 +5395,20 @@ interface PhantomLegAggregation {
|
|
|
4994
5395
|
/** The verified, inventory-backed solvers quoting this leg; bidCount === bidders.length. */
|
|
4995
5396
|
bidders: PhantomLegBidder[];
|
|
4996
5397
|
}
|
|
5398
|
+
/**
|
|
5399
|
+
* A Uniswap V4 position a bid declared, after the on-chain ownership check — i.e. one this solver
|
|
5400
|
+
* really holds and can fund a fill from.
|
|
5401
|
+
*
|
|
5402
|
+
* A bid is the only place a position is ever named, so a consumer that wants to value these between
|
|
5403
|
+
* bid windows (an order fill drains a position inside the fill transaction, while wallet and vault
|
|
5404
|
+
* balances barely move) has to take them from here.
|
|
5405
|
+
*/
|
|
5406
|
+
interface SolverV4Position {
|
|
5407
|
+
solver: HexString;
|
|
5408
|
+
/** The chain the bid was for. A bid is per chain, so no other chain's reads can see it. */
|
|
5409
|
+
chain: string;
|
|
5410
|
+
tokenId: bigint;
|
|
5411
|
+
}
|
|
4997
5412
|
/** The aggregated result for a single phantom order's bid window. */
|
|
4998
5413
|
interface PhantomAggregation {
|
|
4999
5414
|
/**
|
|
@@ -5003,6 +5418,21 @@ interface PhantomAggregation {
|
|
|
5003
5418
|
*/
|
|
5004
5419
|
legs: PhantomLegAggregation[];
|
|
5005
5420
|
lpBalances: LpBalance[];
|
|
5421
|
+
/**
|
|
5422
|
+
* Every declared position that passed the ownership check, across all bids in this window.
|
|
5423
|
+
* Empty when the chain has no configured V4 deployment, since nothing is read there.
|
|
5424
|
+
*/
|
|
5425
|
+
positions: SolverV4Position[];
|
|
5426
|
+
/**
|
|
5427
|
+
* Every solver whose bid passed verification in this window, whether or not it ended up backing
|
|
5428
|
+
* a leg, holding any inventory, or declaring anything.
|
|
5429
|
+
*
|
|
5430
|
+
* The other three fields are all filtered — `legs` drops unbacked quotes, `lpBalances` skips
|
|
5431
|
+
* tokens a solver does not hold, and `positions` only lists what was declared — so a solver that
|
|
5432
|
+
* bid while holding nothing anywhere appears in none of them. This is the only complete answer
|
|
5433
|
+
* to "who bid this window", which is what a consumer reconciling per-solver state needs.
|
|
5434
|
+
*/
|
|
5435
|
+
solvers: HexString[];
|
|
5006
5436
|
}
|
|
5007
5437
|
interface AggregationLogger {
|
|
5008
5438
|
warn: (payload: unknown, message: string) => void;
|
|
@@ -5012,13 +5442,24 @@ interface AggregationLogger {
|
|
|
5012
5442
|
*
|
|
5013
5443
|
* A bid that declares V4 positions is quoting off those pools, and a pool price is what a trade
|
|
5014
5444
|
* gets BEFORE the pool takes its fee — so the amount such a bid names is more than the solver
|
|
5015
|
-
* would actually be left holding once the swap that sources it clears.
|
|
5016
|
-
*
|
|
5017
|
-
*
|
|
5445
|
+
* would actually be left holding once the swap that sources it clears. Netting that cost out here
|
|
5446
|
+
* is what makes a pool-priced quote comparable to a wallet-funded one, whose inventory has already
|
|
5447
|
+
* paid its cost of goods.
|
|
5448
|
+
*/
|
|
5449
|
+
declare const UNISWAP_QUOTE_HAIRCUT_BPS = 10n;
|
|
5450
|
+
/**
|
|
5451
|
+
* Haircut applied to every phantom quote that is NOT priced off a Uniswap V4 pool, in basis points.
|
|
5452
|
+
*
|
|
5453
|
+
* A wallet-funded quote is still the best case the solver sees at bid time; the published rate is
|
|
5454
|
+
* what the protocol tells takers they can trade against, so it is shaded by this margin rather
|
|
5455
|
+
* than being the most optimistic number any bidder named. Pool-priced quotes pay
|
|
5456
|
+
* {@link UNISWAP_QUOTE_HAIRCUT_BPS} instead of this — not on top of it.
|
|
5018
5457
|
*/
|
|
5019
|
-
declare const
|
|
5458
|
+
declare const PHANTOM_QUOTE_HAIRCUT_BPS = 5n;
|
|
5020
5459
|
/** Applies {@link UNISWAP_QUOTE_HAIRCUT_BPS} to a quoted output amount, rounding down. */
|
|
5021
5460
|
declare function applyUniswapQuoteHaircut(amount: bigint): bigint;
|
|
5461
|
+
/** Applies {@link PHANTOM_QUOTE_HAIRCUT_BPS} to a quoted output amount, rounding down. */
|
|
5462
|
+
declare function applyPhantomQuoteHaircut(amount: bigint): bigint;
|
|
5022
5463
|
declare function weightedMedian(entries: {
|
|
5023
5464
|
price: bigint;
|
|
5024
5465
|
weight: bigint;
|
|
@@ -5054,14 +5495,61 @@ declare const recoverBidSignerViem: RecoverBidSigner;
|
|
|
5054
5495
|
/** Promise-caching delegation reader produced by {@link memoizedDelegationCheck}. */
|
|
5055
5496
|
type DelegationReader = (evmRpcUrl: string, account: string, solverAccount: string) => Promise<boolean>;
|
|
5056
5497
|
declare function fetchBidsForOrder(nodeUrl: string, commitment: string): Promise<RpcBidInfo[]>;
|
|
5498
|
+
/**
|
|
5499
|
+
* Sums the solver's redeemable balance of a single token on one chain: the raw ERC-20 balance plus
|
|
5500
|
+
* any ERC-4626 vault positions wrapping it.
|
|
5501
|
+
*
|
|
5502
|
+
* This is THE definition of "a solver's balance" — the periodic sweep and any per-event re-read
|
|
5503
|
+
* must use it rather than a bare `balanceOf`, because simplex funds fills straight out of a vault
|
|
5504
|
+
* inside the fill transaction: the wallet ends the block roughly where it started while
|
|
5505
|
+
* `maxWithdraw` is what actually moved, so a wallet-only read misses such a fill entirely.
|
|
5506
|
+
*
|
|
5507
|
+
* `blockTag` reads the balance as of a specific block ("0x..." or a tag), so a caller replaying an
|
|
5508
|
+
* event records the balance as of that event rather than stamping today's balance onto a
|
|
5509
|
+
* historical row. It defaults to the chain head, which is what a periodic sweep wants.
|
|
5510
|
+
*/
|
|
5511
|
+
declare function getTotalSolverBalance(evmRpcUrl: string, chain: string, token: string, solver: string, yieldVaults: YieldVaultMap, blockTag?: string): Promise<bigint>;
|
|
5057
5512
|
/** PositionManager + StateView addresses for a chain's Uniswap V4 deployment. */
|
|
5058
5513
|
interface UniswapV4Contracts {
|
|
5059
5514
|
positionManager: string;
|
|
5060
5515
|
stateView: string;
|
|
5061
5516
|
}
|
|
5517
|
+
/** Everything a declared position's contribution depends on, read once and reused across legs. */
|
|
5518
|
+
interface V4PositionState {
|
|
5519
|
+
/** Current on-chain owner. Compared against the bid's signer, never trusted from the bid. */
|
|
5520
|
+
owner: string;
|
|
5521
|
+
info: PoolAndPositionInfo;
|
|
5522
|
+
liquidity: bigint;
|
|
5523
|
+
sqrtPriceX96: bigint;
|
|
5524
|
+
}
|
|
5525
|
+
/**
|
|
5526
|
+
* Reads a declared position: who owns it, how much liquidity it holds, and the price its pool is
|
|
5527
|
+
* currently at. Null when the position does not exist — a solver may name a burned tokenId, which
|
|
5528
|
+
* is not an RPC failure and must not sink the run.
|
|
5529
|
+
*
|
|
5530
|
+
* Exported because a bid is the only place a position is ever named: a consumer that persists the
|
|
5531
|
+
* tokenIds this run verified can re-value them later (at `blockTag`) with exactly these reads, and
|
|
5532
|
+
* `owner` is what tells it a position has since been transferred away.
|
|
5533
|
+
*/
|
|
5534
|
+
declare function readV4Position(params: {
|
|
5535
|
+
evmRpcUrl: string;
|
|
5536
|
+
contracts: UniswapV4Contracts;
|
|
5537
|
+
tokenId: bigint;
|
|
5538
|
+
keccak: (hex: HexString) => HexString;
|
|
5539
|
+
/** Block to read at; defaults to the chain head. */
|
|
5540
|
+
blockTag?: string;
|
|
5541
|
+
logger?: AggregationLogger;
|
|
5542
|
+
}): Promise<V4PositionState | null>;
|
|
5062
5543
|
/** Promise-caching balance reader produced by [`memoizedSolverBalance`]. */
|
|
5063
5544
|
type SolverBalanceReader = (evmRpcUrl: string, chain: string, token: string, solver: string) => Promise<bigint>;
|
|
5064
|
-
declare function memoizedSolverBalance(yieldVaults: YieldVaultMap
|
|
5545
|
+
declare function memoizedSolverBalance(yieldVaults: YieldVaultMap,
|
|
5546
|
+
/**
|
|
5547
|
+
* Block to read each chain at, keyed by state machine id; anything absent reads the head. Block
|
|
5548
|
+
* numbers are per chain, so a caller handling an event on one chain can pin that chain to the
|
|
5549
|
+
* event's block while the rest of its sweep stays at the head, where the numbers would mean
|
|
5550
|
+
* nothing.
|
|
5551
|
+
*/
|
|
5552
|
+
blockTags?: Record<string, string>): SolverBalanceReader;
|
|
5065
5553
|
/**
|
|
5066
5554
|
* Aggregates every bid for a phantom order into a single price/liquidity snapshot.
|
|
5067
5555
|
*
|
|
@@ -5506,6 +5994,10 @@ declare const ABI: readonly [{
|
|
|
5506
5994
|
readonly name: "nativeDispatchFee";
|
|
5507
5995
|
readonly type: "uint256";
|
|
5508
5996
|
readonly internalType: "uint256";
|
|
5997
|
+
}, {
|
|
5998
|
+
readonly name: "validUntil";
|
|
5999
|
+
readonly type: "uint256";
|
|
6000
|
+
readonly internalType: "uint256";
|
|
5509
6001
|
}, {
|
|
5510
6002
|
readonly name: "outputs";
|
|
5511
6003
|
readonly type: "tuple[]";
|
|
@@ -6911,6 +7403,10 @@ declare const _default: {
|
|
|
6911
7403
|
readonly name: "nativeDispatchFee";
|
|
6912
7404
|
readonly type: "uint256";
|
|
6913
7405
|
readonly internalType: "uint256";
|
|
7406
|
+
}, {
|
|
7407
|
+
readonly name: "validUntil";
|
|
7408
|
+
readonly type: "uint256";
|
|
7409
|
+
readonly internalType: "uint256";
|
|
6914
7410
|
}, {
|
|
6915
7411
|
readonly name: "outputs";
|
|
6916
7412
|
readonly type: "tuple[]";
|
|
@@ -7928,4 +8424,4 @@ declare const _default: {
|
|
|
7928
8424
|
}];
|
|
7929
8425
|
};
|
|
7930
8426
|
|
|
7931
|
-
export { type DecodedPostResponseEvent as $, type AssetTeleported as A, type BuyAndSellRates as B, ChainConfigService as C, type SubmitBidOptions as D, type EstimateGasCallData as E, type PackedUserOperation as F, type GetRequestWithStatus as G, type HexString$
|
|
8427
|
+
export { type DecodedPostResponseEvent as $, type AssetTeleported as A, type BuyAndSellRates as B, ChainConfigService as C, type SubmitBidOptions as D, type EstimateGasCallData as E, type PackedUserOperation as F, type GetRequestWithStatus as G, type HexString$2 as H, type IChain as I, type FillerBid as J, type Bid as K, type EstimateFillOrderParams as L, type FillOrderEstimate as M, type OrderFeesQuote as N, type Order as O, type PostRequestWithStatus as P, type QueryBuyAndSellRatesParams as Q, type RetryConfig as R, type StateMachineIdParams as S, type Transaction as T, type ERC7821Call as U, type OrderWithStatus as V, OrderStatus as W, type TokenGatewayAssetTeleportedWithStatus as X, TeleportStatus as Y, type DecodedOrderPlacedLog as Z, type DecodedPostRequestEvent as _, type IEvmConfig as a, type RequestCommitment as a$, type AllStatusKey as a0, type AssetTeleportedResponse as a1, type BidStorageEntry as a2, type BidSubmissionResult as a3, type BlockMetadata as a4, type BytesLikeHex as a5, CHAINS_WITHOUT_VALID_UNTIL as a6, type CancelOptions as a7, type ChainConfig as a8, type ChainConfigData as a9, type IPostResponse as aA, type IRequestMessage as aB, type ISubstrateConfig as aC, type ITimeoutPostRequestMessage as aD, ABI as aE, type IntentGatewayParams as aF, IntentOrderStatus as aG, type IntentOrderStatusKey as aH, type IsmpRequest as aI, LEGACY_FILL_OPTIONS_IMPLEMENTATIONS as aJ, type LiquiditySlice as aK, type OrderResponse as aL, type OrderStatusMetadata as aM, PHANTOM_QUOTE_HAIRCUT_BPS as aN, type PaymentInfo as aO, type PhantomBid as aP, type PhantomBidBatchResult as aQ, type PhantomBidDeclaration as aR, type PhantomBidOutcome as aS, type PhantomOrderEvent as aT, type PhantomOrderLeg as aU, type PhantomOrderPriceSnapshot as aV, type PhantomOrderPriceSnapshotsResponse as aW, type PhantomTimings as aX, type PollPhantomOrdersOptions as aY, type PostRequestStatus as aZ, type RequestBody as a_, type ConfiguredAssetSymbolInput as aa, type Deployment as ab, type DispatchGet as ac, type DispatchInfo as ad, type DispatchPost as ae, type Erc4626VaultConfigData as af, type ExecuteIntentOrderOptions as ag, type ExecutionResult as ah, FILL_ORDER_V1_ABI as ai, type FillOptions as aj, type FillOptionsVersion as ak, type FillerConfig as al, type GetRequestResponse as am, type GetResponseByRequestIdResponse as an, type GetResponseStorageValues as ao, type HostParams as ap, HyperClientStatus as aq, type IBatchConsensusAndGetResponseMessage as ar, type IBatchConsensusAndPostRequestMessage as as, type IConfig as at, type IConsensusMessage as au, type IGetRequestMessage as av, type IGetResponse as aw, type IGetResponseMessage as ax, type IHyperbridgeConfig as ay, INCLUSION_TIMEOUT_MS as az, type IMessage as b, type OrderCommitmentFn as b$, RequestKind as b0, type RequestResponse as b1, RequestStatus as b2, type RequestStatusKey as b3, type SelectOptions as b4, type SigningAccount as b5, type StateMachineId as b6, type StateMachineResponse as b7, type StorageFacade as b8, TimeoutStatus as b9, encodeISMPMessage as bA, encodePhantomBidDeclaration as bB, encodeUserOpScale as bC, getChainId as bD, getConfigByStateMachineId as bE, getFillOptionsVersion as bF, getViemChain as bG, hyperbridgeAddress as bH, pharosAtlantic as bI, pharosMainnet as bJ, polkadotAssetHubPaseo as bK, polkadotHubMainnet as bL, poolSlug as bM, resetFillOptionsVersionCache as bN, sortPoolSymbols as bO, tronChainIds as bP, tronNile as bQ, type AggregationLogger as bR, type BidNonceKeyFn as bS, type BidSignature as bT, ENTRY_POINT_V08_ADDRESS as bU, FILL_ORDER_ABI as bV, type FetchLike as bW, type FillData as bX, type HexString as bY, _default as bZ, type LpBalance as b_, type TimeoutStatusKey as ba, type TokenGatewayAssetTeleportedResponse as bb, type TokenInfo as bc, type TokenPrice as bd, type TokenPricesResponse as be, UNISWAP_QUOTE_HAIRCUT_BPS as bf, type UniswapV4PoolConfigData as bg, applyPhantomQuoteHaircut as bh, applyUniswapQuoteHaircut as bi, chainConfigs as bj, convertCodecToIGetRequest as bk, convertCodecToIProof as bl, convertIGetRequestToCodec as bm, convertIProofToCodec as bn, convertStateIdToStateMachineId as bo, convertStateMachineEnumToString as bp, convertStateMachineIdToEnum as bq, decodeAcceptedSourceChains as br, decodeERC7821ExecuteBatch as bs, decodeFillOrder as bt, decodePhantomBidDeclaration as bu, decodeUserOpScale as bv, deriveHttpUrl as bw, encodeAcceptedSourceChains as bx, encodeERC7821ExecuteBatch as by, encodeFillOrder as bz, type StateMachineHeight as c, type PhantomAggregation as c0, type PhantomLegAggregation as c1, type PhantomLegBidder as c2, type PoolAndPositionInfo as c3, type RecoverBidSigner as c4, type RpcBidInfo as c5, type SolverBalanceReader as c6, type SolverV4Position as c7, type UniswapV4Contracts as c8, type V4PositionState as c9, type YieldVaultMap as ca, aggregatePhantomBids as cb, extractFillData as cc, fetchBidsForOrder as cd, getTotalSolverBalance as ce, memoizedSolverBalance as cf, orderCommitmentFromDecoded as cg, positionAmountOfToken as ch, readV4Position as ci, recoverBidSignerViem as cj, setAggregationFetch as ck, splitBidSignature as cl, weightedMedian as cm, zipFillLegs as cn, type IIsmpMessage as d, type IPostRequest as e, type IGetRequest as f, type IPolkadotHubConfig as g, type IPharosConfig as h, type StateMachineUpdate as i, type ResponseCommitmentWithValues as j, type RequestStatusWithMetadata as k, type PostRequestTimeoutStatus as l, SubstrateChain as m, type ClientConfig as n, type IndexerQueryClient as o, type IProof as p, type IEvmChain as q, IntentsCoprocessor as r, Chains as s, type ConfiguredAssetSymbol as t, type AvailableLiquidity as u, type IntentOrderStatusUpdate as v, type SelectBidResult as w, type ResumeIntentOrderOptions as x, type CancelOrderOptions as y, type CancelQuote as z };
|