@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
package/dist/browser/index.d.ts
CHANGED
|
@@ -1736,7 +1736,10 @@ declare class SubstrateChain implements IChain {
|
|
|
1736
1736
|
*/
|
|
1737
1737
|
latestStateMachineHeight(stateMachineId: StateMachineIdParams): Promise<bigint>;
|
|
1738
1738
|
/**
|
|
1739
|
-
* Get the state machine update time for a given state machine height.
|
|
1739
|
+
* Get the state machine update time for a given state machine height. Reads the
|
|
1740
|
+
* `BoundedStateMachineUpdateTime` map in pallet-ismp directly, so the height is either
|
|
1741
|
+
* still retained on-chain or it has been evicted — there's no intermediate RPC to
|
|
1742
|
+
* reinterpret the absence.
|
|
1740
1743
|
* @param {StateMachineHeight} stateMachineHeight - The state machine height.
|
|
1741
1744
|
* @returns {Promise<bigint>} The statemachine update time in seconds.
|
|
1742
1745
|
*/
|
package/dist/browser/index.js
CHANGED
|
@@ -7441,29 +7441,28 @@ var SubstrateChain = class _SubstrateChain {
|
|
|
7441
7441
|
return BigInt(latestHeight);
|
|
7442
7442
|
}
|
|
7443
7443
|
/**
|
|
7444
|
-
* Get the state machine update time for a given state machine height.
|
|
7444
|
+
* Get the state machine update time for a given state machine height. Reads the
|
|
7445
|
+
* `BoundedStateMachineUpdateTime` map in pallet-ismp directly, so the height is either
|
|
7446
|
+
* still retained on-chain or it has been evicted — there's no intermediate RPC to
|
|
7447
|
+
* reinterpret the absence.
|
|
7445
7448
|
* @param {StateMachineHeight} stateMachineHeight - The state machine height.
|
|
7446
7449
|
* @returns {Promise<bigint>} The statemachine update time in seconds.
|
|
7447
7450
|
*/
|
|
7448
7451
|
async stateMachineUpdateTime(stateMachineHeight) {
|
|
7449
|
-
|
|
7450
|
-
const
|
|
7451
|
-
|
|
7452
|
-
|
|
7453
|
-
|
|
7454
|
-
const payload = {
|
|
7455
|
-
id: stateMachineId,
|
|
7456
|
-
height: Number(stateMachineHeight.height)
|
|
7452
|
+
if (!this.api) throw new Error("API not initialized");
|
|
7453
|
+
const id = {
|
|
7454
|
+
stateId: stateMachineHeight.id.stateId,
|
|
7455
|
+
// on-chain StateMachineId encodes consensusStateId as [u8; 4]
|
|
7456
|
+
consensusStateId: toHex(toBytes(stateMachineHeight.id.consensusStateId))
|
|
7457
7457
|
};
|
|
7458
|
-
|
|
7459
|
-
|
|
7460
|
-
|
|
7461
|
-
|
|
7462
|
-
|
|
7463
|
-
|
|
7464
|
-
}
|
|
7465
|
-
throw error;
|
|
7458
|
+
const updateTime = await this.api.query.ismp.boundedStateMachineUpdateTime(
|
|
7459
|
+
id,
|
|
7460
|
+
Number(stateMachineHeight.height)
|
|
7461
|
+
);
|
|
7462
|
+
if (updateTime.isNone) {
|
|
7463
|
+
throw new MissingConsensusUpdateTimeError(MISSING_CONSENSUS_UPDATE_TIME_MESSAGE);
|
|
7466
7464
|
}
|
|
7465
|
+
return BigInt(updateTime.unwrap().toString());
|
|
7467
7466
|
}
|
|
7468
7467
|
/**
|
|
7469
7468
|
* Get the challenge period for a given state machine id.
|