@hyperbridge/sdk 2.6.0 → 2.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/index.d.ts +4 -1
- package/dist/browser/index.js +16 -17
- package/dist/browser/index.js.map +1 -1
- package/dist/node/{IntentGatewayV2-DuSwlT02.d.cts → IntentGatewayV2-BJUF1dsr.d.cts} +4 -1
- package/dist/node/{IntentGatewayV2-DuSwlT02.d.ts → IntentGatewayV2-BJUF1dsr.d.ts} +4 -1
- package/dist/node/index.cjs +16 -17
- package/dist/node/index.cjs.map +1 -1
- package/dist/node/index.d.cts +2 -2
- package/dist/node/index.d.ts +2 -2
- package/dist/node/index.js +16 -17
- package/dist/node/index.js.map +1 -1
- package/dist/node/intents-helpers.d.cts +2 -2
- package/dist/node/intents-helpers.d.ts +2 -2
- package/package.json +1 -1
|
@@ -1191,7 +1191,10 @@ declare class SubstrateChain implements IChain {
|
|
|
1191
1191
|
*/
|
|
1192
1192
|
latestStateMachineHeight(stateMachineId: StateMachineIdParams): Promise<bigint>;
|
|
1193
1193
|
/**
|
|
1194
|
-
* Get the state machine update time for a given state machine height.
|
|
1194
|
+
* Get the state machine update time for a given state machine height. Reads the
|
|
1195
|
+
* `BoundedStateMachineUpdateTime` map in pallet-ismp directly, so the height is either
|
|
1196
|
+
* still retained on-chain or it has been evicted — there's no intermediate RPC to
|
|
1197
|
+
* reinterpret the absence.
|
|
1195
1198
|
* @param {StateMachineHeight} stateMachineHeight - The state machine height.
|
|
1196
1199
|
* @returns {Promise<bigint>} The statemachine update time in seconds.
|
|
1197
1200
|
*/
|
|
@@ -1191,7 +1191,10 @@ declare class SubstrateChain implements IChain {
|
|
|
1191
1191
|
*/
|
|
1192
1192
|
latestStateMachineHeight(stateMachineId: StateMachineIdParams): Promise<bigint>;
|
|
1193
1193
|
/**
|
|
1194
|
-
* Get the state machine update time for a given state machine height.
|
|
1194
|
+
* Get the state machine update time for a given state machine height. Reads the
|
|
1195
|
+
* `BoundedStateMachineUpdateTime` map in pallet-ismp directly, so the height is either
|
|
1196
|
+
* still retained on-chain or it has been evicted — there's no intermediate RPC to
|
|
1197
|
+
* reinterpret the absence.
|
|
1195
1198
|
* @param {StateMachineHeight} stateMachineHeight - The state machine height.
|
|
1196
1199
|
* @returns {Promise<bigint>} The statemachine update time in seconds.
|
|
1197
1200
|
*/
|
package/dist/node/index.cjs
CHANGED
|
@@ -7402,29 +7402,28 @@ var SubstrateChain = class _SubstrateChain {
|
|
|
7402
7402
|
return BigInt(latestHeight);
|
|
7403
7403
|
}
|
|
7404
7404
|
/**
|
|
7405
|
-
* Get the state machine update time for a given state machine height.
|
|
7405
|
+
* Get the state machine update time for a given state machine height. Reads the
|
|
7406
|
+
* `BoundedStateMachineUpdateTime` map in pallet-ismp directly, so the height is either
|
|
7407
|
+
* still retained on-chain or it has been evicted — there's no intermediate RPC to
|
|
7408
|
+
* reinterpret the absence.
|
|
7406
7409
|
* @param {StateMachineHeight} stateMachineHeight - The state machine height.
|
|
7407
7410
|
* @returns {Promise<bigint>} The statemachine update time in seconds.
|
|
7408
7411
|
*/
|
|
7409
7412
|
async stateMachineUpdateTime(stateMachineHeight) {
|
|
7410
|
-
|
|
7411
|
-
const
|
|
7412
|
-
|
|
7413
|
-
|
|
7414
|
-
|
|
7415
|
-
const payload = {
|
|
7416
|
-
id: stateMachineId,
|
|
7417
|
-
height: Number(stateMachineHeight.height)
|
|
7413
|
+
if (!this.api) throw new Error("API not initialized");
|
|
7414
|
+
const id = {
|
|
7415
|
+
stateId: stateMachineHeight.id.stateId,
|
|
7416
|
+
// on-chain StateMachineId encodes consensusStateId as [u8; 4]
|
|
7417
|
+
consensusStateId: viem.toHex(viem.toBytes(stateMachineHeight.id.consensusStateId))
|
|
7418
7418
|
};
|
|
7419
|
-
|
|
7420
|
-
|
|
7421
|
-
|
|
7422
|
-
|
|
7423
|
-
|
|
7424
|
-
|
|
7425
|
-
}
|
|
7426
|
-
throw error;
|
|
7419
|
+
const updateTime = await this.api.query.ismp.boundedStateMachineUpdateTime(
|
|
7420
|
+
id,
|
|
7421
|
+
Number(stateMachineHeight.height)
|
|
7422
|
+
);
|
|
7423
|
+
if (updateTime.isNone) {
|
|
7424
|
+
throw new MissingConsensusUpdateTimeError(MISSING_CONSENSUS_UPDATE_TIME_MESSAGE);
|
|
7427
7425
|
}
|
|
7426
|
+
return BigInt(updateTime.unwrap().toString());
|
|
7428
7427
|
}
|
|
7429
7428
|
/**
|
|
7430
7429
|
* Get the challenge period for a given state machine id.
|