@hyperbridge/sdk 2.3.0 → 2.3.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.
@@ -52,9 +52,9 @@ declare const _default$1: {
52
52
  readonly name: "nonce";
53
53
  readonly type: "uint64";
54
54
  }, {
55
- readonly internalType: "address";
55
+ readonly internalType: "bytes";
56
56
  readonly name: "from";
57
- readonly type: "address";
57
+ readonly type: "bytes";
58
58
  }, {
59
59
  readonly internalType: "uint64";
60
60
  readonly name: "timeoutTimestamp";
@@ -149,9 +149,9 @@ declare const _default$1: {
149
149
  readonly name: "nonce";
150
150
  readonly type: "uint64";
151
151
  }, {
152
- readonly internalType: "address";
152
+ readonly internalType: "bytes";
153
153
  readonly name: "from";
154
- readonly type: "address";
154
+ readonly type: "bytes";
155
155
  }, {
156
156
  readonly internalType: "uint64";
157
157
  readonly name: "timeoutTimestamp";
@@ -1104,6 +1104,30 @@ declare class SubstrateChain implements IChain {
1104
1104
  * @returns {Promise<HexString | undefined>} The relayer address responsible for delivering the request.
1105
1105
  */
1106
1106
  queryRequestReceipt(commitment: HexString): Promise<HexString | undefined>;
1107
+ /**
1108
+ * Returns the storage key for a response receipt in the child trie.
1109
+ * A response receipt is keyed by the originating *request* commitment.
1110
+ * @param {HexString} key - The request commitment (0x-prefixed H256 hex string)
1111
+ * @returns {HexString} The storage key as a hex string
1112
+ */
1113
+ responseReceiptKey(key: HexString): HexString;
1114
+ /**
1115
+ * Queries the response receipt for a request commitment. For a GET, Hyperbridge
1116
+ * produces the response as it processes the request, so the presence of a response
1117
+ * receipt indicates the request has already been delivered and handled.
1118
+ * @param {HexString} commitment - The originating request commitment to query.
1119
+ * @returns {Promise<HexString | undefined>} The receipt data if present, otherwise undefined.
1120
+ */
1121
+ queryResponseReceipt(commitment: HexString): Promise<HexString | undefined>;
1122
+ /**
1123
+ * Queries the state-machine commitment Hyperbridge holds for a counterparty chain at an
1124
+ * exact height — the `BoundedStateCommitments` map that `state_machine_commitment` (and thus
1125
+ * proof verification) reads. Returns the committed `stateRoot`, or undefined if Hyperbridge
1126
+ * has not finalized that chain at exactly that height.
1127
+ * @param {StateMachineHeight} height - The counterparty state machine id + height.
1128
+ * @returns {Promise<HexString | undefined>} The committed state root, or undefined if absent.
1129
+ */
1130
+ queryStateMachineCommitment(height: StateMachineHeight): Promise<HexString | undefined>;
1107
1131
  /**
1108
1132
  * Returns the current timestamp of the chain.
1109
1133
  * @returns {Promise<bigint>} The current timestamp.
@@ -1377,10 +1401,19 @@ declare class IntentsCoprocessor {
1377
1401
  */
1378
1402
  retractBid(commitment: HexString): Promise<BidSubmissionResult>;
1379
1403
  /**
1380
- * Retracts a previous bid and places a new one in a single transaction via utility.batch.
1381
- * The retraction runs first, so the old deposit is reclaimed even if the new bid then fails
1382
- * (batch is non-atomic a failing call interrupts the batch without reverting the calls that
1383
- * already succeeded, unlike batchAll which would roll the retraction back too).
1404
+ * Places a new bid and retracts a previous one in a single transaction via utility.batch.
1405
+ *
1406
+ * The new bid is the primary operation, so `placeBid` MUST run first. `utility.batch` is
1407
+ * non-atomic: a failing call interrupts the batch (via a BatchInterrupted event) without
1408
+ * reverting the calls that already succeeded. Placing first guarantees the new bid lands even
1409
+ * when the retraction then fails — which it routinely does, because a previous commitment's bid
1410
+ * may already be gone (or was itself never placed), making `retractBid` return `BidNotFound`.
1411
+ *
1412
+ * Ordering retraction first (the previous behaviour) caused a self-sustaining cascade: a
1413
+ * `BidNotFound` on the leading retract skipped the trailing `placeBid`, so the current bid never
1414
+ * landed, so the *next* interval's retract of that never-placed commitment also failed, and so
1415
+ * on — silently, because the batch extrinsic itself reports success. The deposit reclaim is
1416
+ * best-effort; landing the bid is not.
1384
1417
  *
1385
1418
  * @param retractCommitment - The order commitment of the bid to retract (bytes32)
1386
1419
  * @param bidCommitment - The order commitment of the new bid (bytes32)
@@ -52,9 +52,9 @@ declare const _default$1: {
52
52
  readonly name: "nonce";
53
53
  readonly type: "uint64";
54
54
  }, {
55
- readonly internalType: "address";
55
+ readonly internalType: "bytes";
56
56
  readonly name: "from";
57
- readonly type: "address";
57
+ readonly type: "bytes";
58
58
  }, {
59
59
  readonly internalType: "uint64";
60
60
  readonly name: "timeoutTimestamp";
@@ -149,9 +149,9 @@ declare const _default$1: {
149
149
  readonly name: "nonce";
150
150
  readonly type: "uint64";
151
151
  }, {
152
- readonly internalType: "address";
152
+ readonly internalType: "bytes";
153
153
  readonly name: "from";
154
- readonly type: "address";
154
+ readonly type: "bytes";
155
155
  }, {
156
156
  readonly internalType: "uint64";
157
157
  readonly name: "timeoutTimestamp";
@@ -1104,6 +1104,30 @@ declare class SubstrateChain implements IChain {
1104
1104
  * @returns {Promise<HexString | undefined>} The relayer address responsible for delivering the request.
1105
1105
  */
1106
1106
  queryRequestReceipt(commitment: HexString): Promise<HexString | undefined>;
1107
+ /**
1108
+ * Returns the storage key for a response receipt in the child trie.
1109
+ * A response receipt is keyed by the originating *request* commitment.
1110
+ * @param {HexString} key - The request commitment (0x-prefixed H256 hex string)
1111
+ * @returns {HexString} The storage key as a hex string
1112
+ */
1113
+ responseReceiptKey(key: HexString): HexString;
1114
+ /**
1115
+ * Queries the response receipt for a request commitment. For a GET, Hyperbridge
1116
+ * produces the response as it processes the request, so the presence of a response
1117
+ * receipt indicates the request has already been delivered and handled.
1118
+ * @param {HexString} commitment - The originating request commitment to query.
1119
+ * @returns {Promise<HexString | undefined>} The receipt data if present, otherwise undefined.
1120
+ */
1121
+ queryResponseReceipt(commitment: HexString): Promise<HexString | undefined>;
1122
+ /**
1123
+ * Queries the state-machine commitment Hyperbridge holds for a counterparty chain at an
1124
+ * exact height — the `BoundedStateCommitments` map that `state_machine_commitment` (and thus
1125
+ * proof verification) reads. Returns the committed `stateRoot`, or undefined if Hyperbridge
1126
+ * has not finalized that chain at exactly that height.
1127
+ * @param {StateMachineHeight} height - The counterparty state machine id + height.
1128
+ * @returns {Promise<HexString | undefined>} The committed state root, or undefined if absent.
1129
+ */
1130
+ queryStateMachineCommitment(height: StateMachineHeight): Promise<HexString | undefined>;
1107
1131
  /**
1108
1132
  * Returns the current timestamp of the chain.
1109
1133
  * @returns {Promise<bigint>} The current timestamp.
@@ -1377,10 +1401,19 @@ declare class IntentsCoprocessor {
1377
1401
  */
1378
1402
  retractBid(commitment: HexString): Promise<BidSubmissionResult>;
1379
1403
  /**
1380
- * Retracts a previous bid and places a new one in a single transaction via utility.batch.
1381
- * The retraction runs first, so the old deposit is reclaimed even if the new bid then fails
1382
- * (batch is non-atomic a failing call interrupts the batch without reverting the calls that
1383
- * already succeeded, unlike batchAll which would roll the retraction back too).
1404
+ * Places a new bid and retracts a previous one in a single transaction via utility.batch.
1405
+ *
1406
+ * The new bid is the primary operation, so `placeBid` MUST run first. `utility.batch` is
1407
+ * non-atomic: a failing call interrupts the batch (via a BatchInterrupted event) without
1408
+ * reverting the calls that already succeeded. Placing first guarantees the new bid lands even
1409
+ * when the retraction then fails — which it routinely does, because a previous commitment's bid
1410
+ * may already be gone (or was itself never placed), making `retractBid` return `BidNotFound`.
1411
+ *
1412
+ * Ordering retraction first (the previous behaviour) caused a self-sustaining cascade: a
1413
+ * `BidNotFound` on the leading retract skipped the trailing `placeBid`, so the current bid never
1414
+ * landed, so the *next* interval's retract of that never-placed commitment also failed, and so
1415
+ * on — silently, because the batch extrinsic itself reports success. The deposit reclaim is
1416
+ * best-effort; landing the bid is not.
1384
1417
  *
1385
1418
  * @param retractCommitment - The order commitment of the bid to retract (bytes32)
1386
1419
  * @param bidCommitment - The order commitment of the new bid (bytes32)