@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.
- package/dist/browser/index.d.ts +63 -9
- package/dist/browser/index.js +328 -82
- package/dist/browser/index.js.map +1 -1
- package/dist/node/{IntentGatewayV2-C55Aitcb.d.cts → IntentGatewayV2-SB851bZs.d.cts} +41 -8
- package/dist/node/{IntentGatewayV2-C55Aitcb.d.ts → IntentGatewayV2-SB851bZs.d.ts} +41 -8
- package/dist/node/index.cjs +328 -82
- package/dist/node/index.cjs.map +1 -1
- package/dist/node/index.d.cts +24 -3
- package/dist/node/index.d.ts +24 -3
- package/dist/node/index.js +328 -82
- package/dist/node/index.js.map +1 -1
- package/dist/node/intents-helpers.cjs.map +1 -1
- package/dist/node/intents-helpers.d.cts +1 -1
- package/dist/node/intents-helpers.d.ts +1 -1
- package/dist/node/intents-helpers.js.map +1 -1
- package/package.json +2 -1
package/dist/browser/index.d.ts
CHANGED
|
@@ -57,9 +57,9 @@ declare const _default: {
|
|
|
57
57
|
readonly name: "nonce";
|
|
58
58
|
readonly type: "uint64";
|
|
59
59
|
}, {
|
|
60
|
-
readonly internalType: "
|
|
60
|
+
readonly internalType: "bytes";
|
|
61
61
|
readonly name: "from";
|
|
62
|
-
readonly type: "
|
|
62
|
+
readonly type: "bytes";
|
|
63
63
|
}, {
|
|
64
64
|
readonly internalType: "uint64";
|
|
65
65
|
readonly name: "timeoutTimestamp";
|
|
@@ -154,9 +154,9 @@ declare const _default: {
|
|
|
154
154
|
readonly name: "nonce";
|
|
155
155
|
readonly type: "uint64";
|
|
156
156
|
}, {
|
|
157
|
-
readonly internalType: "
|
|
157
|
+
readonly internalType: "bytes";
|
|
158
158
|
readonly name: "from";
|
|
159
|
-
readonly type: "
|
|
159
|
+
readonly type: "bytes";
|
|
160
160
|
}, {
|
|
161
161
|
readonly internalType: "uint64";
|
|
162
162
|
readonly name: "timeoutTimestamp";
|
|
@@ -1142,9 +1142,16 @@ declare class EvmChain implements IChain {
|
|
|
1142
1142
|
queryProof(message: IMessage, counterparty: string, at?: bigint): Promise<HexString>;
|
|
1143
1143
|
/**
|
|
1144
1144
|
* Query and return the encoded storage proof for the provided keys at the given height.
|
|
1145
|
+
*
|
|
1146
|
+
* Keys may be either:
|
|
1147
|
+
* - 32-byte storage slots — read from `address` (or the host contract when omitted), or
|
|
1148
|
+
* - 52-byte cross-chain GET keys encoded as `address(20) || slot(32)`, where the target
|
|
1149
|
+
* contract is embedded in the key. These may span multiple contracts.
|
|
1150
|
+
*
|
|
1145
1151
|
* @param {bigint} at - The block height at which to query the storage proof.
|
|
1146
1152
|
* @param {HexString[]} keys - The keys for which to query the storage proof.
|
|
1147
|
-
* @param {HexString} address - Optional contract address
|
|
1153
|
+
* @param {HexString} address - Optional contract address; forces all keys to be read as slots
|
|
1154
|
+
* of this contract. Omit to let 52-byte keys carry their own contract address.
|
|
1148
1155
|
* @returns {Promise<HexString>} The encoded storage proof.
|
|
1149
1156
|
*/
|
|
1150
1157
|
queryStateProof(at: bigint, keys: HexString[], address?: HexString): Promise<HexString>;
|
|
@@ -1638,6 +1645,30 @@ declare class SubstrateChain implements IChain {
|
|
|
1638
1645
|
* @returns {Promise<HexString | undefined>} The relayer address responsible for delivering the request.
|
|
1639
1646
|
*/
|
|
1640
1647
|
queryRequestReceipt(commitment: HexString): Promise<HexString | undefined>;
|
|
1648
|
+
/**
|
|
1649
|
+
* Returns the storage key for a response receipt in the child trie.
|
|
1650
|
+
* A response receipt is keyed by the originating *request* commitment.
|
|
1651
|
+
* @param {HexString} key - The request commitment (0x-prefixed H256 hex string)
|
|
1652
|
+
* @returns {HexString} The storage key as a hex string
|
|
1653
|
+
*/
|
|
1654
|
+
responseReceiptKey(key: HexString): HexString;
|
|
1655
|
+
/**
|
|
1656
|
+
* Queries the response receipt for a request commitment. For a GET, Hyperbridge
|
|
1657
|
+
* produces the response as it processes the request, so the presence of a response
|
|
1658
|
+
* receipt indicates the request has already been delivered and handled.
|
|
1659
|
+
* @param {HexString} commitment - The originating request commitment to query.
|
|
1660
|
+
* @returns {Promise<HexString | undefined>} The receipt data if present, otherwise undefined.
|
|
1661
|
+
*/
|
|
1662
|
+
queryResponseReceipt(commitment: HexString): Promise<HexString | undefined>;
|
|
1663
|
+
/**
|
|
1664
|
+
* Queries the state-machine commitment Hyperbridge holds for a counterparty chain at an
|
|
1665
|
+
* exact height — the `BoundedStateCommitments` map that `state_machine_commitment` (and thus
|
|
1666
|
+
* proof verification) reads. Returns the committed `stateRoot`, or undefined if Hyperbridge
|
|
1667
|
+
* has not finalized that chain at exactly that height.
|
|
1668
|
+
* @param {StateMachineHeight} height - The counterparty state machine id + height.
|
|
1669
|
+
* @returns {Promise<HexString | undefined>} The committed state root, or undefined if absent.
|
|
1670
|
+
*/
|
|
1671
|
+
queryStateMachineCommitment(height: StateMachineHeight): Promise<HexString | undefined>;
|
|
1641
1672
|
/**
|
|
1642
1673
|
* Returns the current timestamp of the chain.
|
|
1643
1674
|
* @returns {Promise<bigint>} The current timestamp.
|
|
@@ -1911,10 +1942,19 @@ declare class IntentsCoprocessor {
|
|
|
1911
1942
|
*/
|
|
1912
1943
|
retractBid(commitment: HexString): Promise<BidSubmissionResult>;
|
|
1913
1944
|
/**
|
|
1914
|
-
*
|
|
1915
|
-
*
|
|
1916
|
-
*
|
|
1917
|
-
*
|
|
1945
|
+
* Places a new bid and retracts a previous one in a single transaction via utility.batch.
|
|
1946
|
+
*
|
|
1947
|
+
* The new bid is the primary operation, so `placeBid` MUST run first. `utility.batch` is
|
|
1948
|
+
* non-atomic: a failing call interrupts the batch (via a BatchInterrupted event) without
|
|
1949
|
+
* reverting the calls that already succeeded. Placing first guarantees the new bid lands even
|
|
1950
|
+
* when the retraction then fails — which it routinely does, because a previous commitment's bid
|
|
1951
|
+
* may already be gone (or was itself never placed), making `retractBid` return `BidNotFound`.
|
|
1952
|
+
*
|
|
1953
|
+
* Ordering retraction first (the previous behaviour) caused a self-sustaining cascade: a
|
|
1954
|
+
* `BidNotFound` on the leading retract skipped the trailing `placeBid`, so the current bid never
|
|
1955
|
+
* landed, so the *next* interval's retract of that never-placed commitment also failed, and so
|
|
1956
|
+
* on — silently, because the batch extrinsic itself reports success. The deposit reclaim is
|
|
1957
|
+
* best-effort; landing the bid is not.
|
|
1918
1958
|
*
|
|
1919
1959
|
* @param retractCommitment - The order commitment of the bid to retract (bytes32)
|
|
1920
1960
|
* @param bidCommitment - The order commitment of the new bid (bytes32)
|
|
@@ -3748,6 +3788,20 @@ declare class GetRequestClient {
|
|
|
3748
3788
|
*/
|
|
3749
3789
|
getRequestStatusStream(hash: HexString): AsyncGenerator<RequestStatusWithMetadata, void>;
|
|
3750
3790
|
private streamInternal;
|
|
3791
|
+
/**
|
|
3792
|
+
* Self-delivers a GET request to Hyperbridge — the request→Hyperbridge hop that would
|
|
3793
|
+
* otherwise require an external relayer.
|
|
3794
|
+
*
|
|
3795
|
+
* Mirrors the relayer path (and {@link OrderCanceller}): prove the request commitment on
|
|
3796
|
+
* the source chain at the Hyperbridge-finalized source height, prove the requested keys on
|
|
3797
|
+
* the destination chain at the request's height, wait out the source challenge period, then
|
|
3798
|
+
* submit an unsigned `GetRequest` message. Source and destination may each be EVM or
|
|
3799
|
+
* substrate — proofs are built via the chain-agnostic {@link IChain} methods.
|
|
3800
|
+
*
|
|
3801
|
+
* Idempotent: returns early if Hyperbridge already holds the response receipt. The caller
|
|
3802
|
+
* wraps this best-effort, so a failure leaves the stream observing as before.
|
|
3803
|
+
*/
|
|
3804
|
+
private deliverToHyperbridge;
|
|
3751
3805
|
/**
|
|
3752
3806
|
* Snapshot helper: returns the `HYPERBRIDGE_FINALIZED` event with source-chain
|
|
3753
3807
|
* calldata if prerequisites are met, or `undefined` if we're still waiting
|