@hyperbridge/sdk 1.9.5 → 1.9.6
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 +211 -5
- package/dist/browser/index.js +359 -5
- package/dist/browser/index.js.map +1 -1
- package/dist/node/index.d.ts +211 -5
- package/dist/node/index.js +359 -5
- package/dist/node/index.js.map +1 -1
- package/package.json +1 -1
package/dist/node/index.js
CHANGED
|
@@ -3612,6 +3612,8 @@ var Chains = /* @__PURE__ */ ((Chains3) => {
|
|
|
3612
3612
|
Chains3["POLKADOT_ASSET_HUB_PASEO"] = "EVM-420420417";
|
|
3613
3613
|
Chains3["TRON_MAINNET"] = "EVM-728126428";
|
|
3614
3614
|
Chains3["TRON_NILE"] = "EVM-3448148188";
|
|
3615
|
+
Chains3["PHAROS_MAINNET"] = "EVM-688600";
|
|
3616
|
+
Chains3["PHAROS_ATLANTIC"] = "EVM-688689";
|
|
3615
3617
|
return Chains3;
|
|
3616
3618
|
})(Chains || {});
|
|
3617
3619
|
var polkadotAssetHubPaseo = defineChain({
|
|
@@ -3625,6 +3627,22 @@ var polkadotAssetHubPaseo = defineChain({
|
|
|
3625
3627
|
default: { name: "Routescan", url: "https://polkadot.testnet.routescan.io" }
|
|
3626
3628
|
}
|
|
3627
3629
|
});
|
|
3630
|
+
var pharosMainnet = defineChain({
|
|
3631
|
+
id: 688600,
|
|
3632
|
+
name: "Pharos Mainnet",
|
|
3633
|
+
nativeCurrency: { name: "PHRS", symbol: "PHRS", decimals: 18 },
|
|
3634
|
+
rpcUrls: {
|
|
3635
|
+
default: { http: ["https://atlantic.dplabs-internal.com"] }
|
|
3636
|
+
}
|
|
3637
|
+
});
|
|
3638
|
+
var pharosAtlantic = defineChain({
|
|
3639
|
+
id: 688689,
|
|
3640
|
+
name: "Pharos Atlantic Testnet",
|
|
3641
|
+
nativeCurrency: { name: "PHRS", symbol: "PHRS", decimals: 18 },
|
|
3642
|
+
rpcUrls: {
|
|
3643
|
+
default: { http: ["https://atlantic.dplabs-internal.com"] }
|
|
3644
|
+
}
|
|
3645
|
+
});
|
|
3628
3646
|
var tronNile = defineChain({
|
|
3629
3647
|
id: 3448148188,
|
|
3630
3648
|
name: "TRON Nile Testnet",
|
|
@@ -4343,6 +4361,30 @@ var chainConfigs = {
|
|
|
4343
4361
|
defaultRpcUrl: "https://testnet-asset-hub-eth-rpc.polkadot.io",
|
|
4344
4362
|
consensusStateId: "PAS0",
|
|
4345
4363
|
coingeckoId: "polkadot"
|
|
4364
|
+
},
|
|
4365
|
+
688600: {
|
|
4366
|
+
chainId: 688600,
|
|
4367
|
+
stateMachineId: "EVM-688600" /* PHAROS_MAINNET */,
|
|
4368
|
+
viemChain: pharosMainnet,
|
|
4369
|
+
wrappedNativeDecimals: 18,
|
|
4370
|
+
addresses: {
|
|
4371
|
+
Host: "0x0000000000000000000000000000000000000000"
|
|
4372
|
+
},
|
|
4373
|
+
consensusStateId: "PHAR",
|
|
4374
|
+
coingeckoId: "pharos"
|
|
4375
|
+
},
|
|
4376
|
+
688689: {
|
|
4377
|
+
chainId: 688689,
|
|
4378
|
+
stateMachineId: "EVM-688689" /* PHAROS_ATLANTIC */,
|
|
4379
|
+
viemChain: pharosAtlantic,
|
|
4380
|
+
wrappedNativeDecimals: 18,
|
|
4381
|
+
addresses: {
|
|
4382
|
+
TokenGateway: "0x451bDd8273839AD0Ec7F4Fa798E8B3DABb223fD8",
|
|
4383
|
+
Host: "0xED54E9b64043c389173316B6351Bd25491060eA8",
|
|
4384
|
+
IntentGatewayV2: "0xb8039832c6c9266F928d038eA49A8a169300C670"
|
|
4385
|
+
},
|
|
4386
|
+
consensusStateId: "PHAR",
|
|
4387
|
+
coingeckoId: "pharos"
|
|
4346
4388
|
}
|
|
4347
4389
|
};
|
|
4348
4390
|
var configsByStateMachineId = Object.fromEntries(
|
|
@@ -5493,7 +5535,9 @@ var chains = {
|
|
|
5493
5535
|
[unichain.id]: unichain,
|
|
5494
5536
|
[tron.id]: tron,
|
|
5495
5537
|
[tronNile.id]: tronNile,
|
|
5496
|
-
[polkadotAssetHubPaseo.id]: polkadotAssetHubPaseo
|
|
5538
|
+
[polkadotAssetHubPaseo.id]: polkadotAssetHubPaseo,
|
|
5539
|
+
[pharosMainnet.id]: pharosMainnet,
|
|
5540
|
+
[pharosAtlantic.id]: pharosAtlantic
|
|
5497
5541
|
};
|
|
5498
5542
|
var DEFAULT_ADDRESS = "0x0000000000000000000000000000000000000000";
|
|
5499
5543
|
var EvmChain = class _EvmChain {
|
|
@@ -5534,8 +5578,12 @@ var EvmChain = class _EvmChain {
|
|
|
5534
5578
|
// Gnosis Chiado
|
|
5535
5579
|
420420417: "PAS0",
|
|
5536
5580
|
// Polkadot Asset Hub (Paseo)
|
|
5537
|
-
420420419: "DOT0"
|
|
5581
|
+
420420419: "DOT0",
|
|
5538
5582
|
// Polkadot Asset Hub (Polkadot)
|
|
5583
|
+
688600: "PHAR",
|
|
5584
|
+
// Pharos Mainnet
|
|
5585
|
+
688689: "PHAR"
|
|
5586
|
+
// Pharos Atlantic (Testnet)
|
|
5539
5587
|
};
|
|
5540
5588
|
if (!params.consensusStateId) {
|
|
5541
5589
|
params.consensusStateId = defaultConsensusStateIds[params.chainId];
|
|
@@ -7762,6 +7810,312 @@ var PolkadotHubChain = class _PolkadotHubChain {
|
|
|
7762
7810
|
return this.evm.getTransactionReceipt(hash);
|
|
7763
7811
|
}
|
|
7764
7812
|
};
|
|
7813
|
+
var PharosProofNodeCodec = Struct({
|
|
7814
|
+
proofNode: Vector(u8),
|
|
7815
|
+
nextBeginOffset: u32,
|
|
7816
|
+
nextEndOffset: u32
|
|
7817
|
+
});
|
|
7818
|
+
var SiblingLeftmostLeafProofCodec = Struct({
|
|
7819
|
+
slotIndex: u8,
|
|
7820
|
+
leftmostLeafKey: Vector(u8),
|
|
7821
|
+
proofPath: Vector(PharosProofNodeCodec)
|
|
7822
|
+
});
|
|
7823
|
+
var NonExistenceProofCodec = Struct({
|
|
7824
|
+
proofNodes: Vector(PharosProofNodeCodec),
|
|
7825
|
+
siblingProofs: Vector(SiblingLeftmostLeafProofCodec)
|
|
7826
|
+
});
|
|
7827
|
+
var AccountProofDataCodec = Struct({
|
|
7828
|
+
proofNodes: Vector(PharosProofNodeCodec),
|
|
7829
|
+
rawValue: Vector(u8)
|
|
7830
|
+
});
|
|
7831
|
+
var PharosStateProof = Struct({
|
|
7832
|
+
storageProof: Vector(Tuple(Vector(u8), Vector(PharosProofNodeCodec))),
|
|
7833
|
+
storageValues: Vector(Tuple(Vector(u8), Vector(u8))),
|
|
7834
|
+
nonExistenceProofs: Vector(Tuple(Vector(u8), NonExistenceProofCodec)),
|
|
7835
|
+
accountProofs: Vector(Tuple(Vector(u8), AccountProofDataCodec))
|
|
7836
|
+
});
|
|
7837
|
+
|
|
7838
|
+
// src/chains/pharos.ts
|
|
7839
|
+
var EvmHttpRpc = class {
|
|
7840
|
+
constructor(url) {
|
|
7841
|
+
this.url = url;
|
|
7842
|
+
}
|
|
7843
|
+
url;
|
|
7844
|
+
async call(method, params = []) {
|
|
7845
|
+
const response = await fetch(this.url, {
|
|
7846
|
+
method: "POST",
|
|
7847
|
+
headers: { "Content-Type": "application/json" },
|
|
7848
|
+
body: JSON.stringify({ jsonrpc: "2.0", id: Date.now(), method, params })
|
|
7849
|
+
});
|
|
7850
|
+
if (!response.ok) {
|
|
7851
|
+
throw new Error(`Pharos RPC HTTP error: ${response.status}`);
|
|
7852
|
+
}
|
|
7853
|
+
const json = await response.json();
|
|
7854
|
+
if (json.error) {
|
|
7855
|
+
throw new Error(`Pharos RPC error: ${json.error.message}`);
|
|
7856
|
+
}
|
|
7857
|
+
if (json.result === void 0) {
|
|
7858
|
+
throw new Error("Pharos RPC: missing result");
|
|
7859
|
+
}
|
|
7860
|
+
return json.result;
|
|
7861
|
+
}
|
|
7862
|
+
};
|
|
7863
|
+
function padTo32Bytes(hex) {
|
|
7864
|
+
const bytes = hexToBytes(hex);
|
|
7865
|
+
if (bytes.length > 32) {
|
|
7866
|
+
throw new Error(`Pharos value exceeds 32 bytes: ${hex}`);
|
|
7867
|
+
}
|
|
7868
|
+
const out = new Uint8Array(32);
|
|
7869
|
+
out.set(bytes, 32 - bytes.length);
|
|
7870
|
+
return out;
|
|
7871
|
+
}
|
|
7872
|
+
function rpcToProofNodes(nodes) {
|
|
7873
|
+
return nodes.map((n) => ({
|
|
7874
|
+
proofNode: Array.from(hexToBytes(n.proofNode)),
|
|
7875
|
+
nextBeginOffset: n.nextBeginOffset,
|
|
7876
|
+
nextEndOffset: n.nextEndOffset
|
|
7877
|
+
}));
|
|
7878
|
+
}
|
|
7879
|
+
function rpcToSiblingProofs(siblings) {
|
|
7880
|
+
return (siblings ?? []).map((s) => ({
|
|
7881
|
+
slotIndex: s.slotIndex,
|
|
7882
|
+
leftmostLeafKey: Array.from(hexToBytes(s.leftmostLeafKey)),
|
|
7883
|
+
proofPath: rpcToProofNodes(s.proofPath)
|
|
7884
|
+
}));
|
|
7885
|
+
}
|
|
7886
|
+
function blockTag(at) {
|
|
7887
|
+
return at === void 0 ? "latest" : `0x${at.toString(16)}`;
|
|
7888
|
+
}
|
|
7889
|
+
function newAccumulator() {
|
|
7890
|
+
return {
|
|
7891
|
+
storageProof: /* @__PURE__ */ new Map(),
|
|
7892
|
+
storageValues: /* @__PURE__ */ new Map(),
|
|
7893
|
+
nonExistenceProofs: /* @__PURE__ */ new Map(),
|
|
7894
|
+
accountProofs: /* @__PURE__ */ new Map()
|
|
7895
|
+
};
|
|
7896
|
+
}
|
|
7897
|
+
function hexKey2(bytes) {
|
|
7898
|
+
return bytesToHex(bytes);
|
|
7899
|
+
}
|
|
7900
|
+
function mapToEntries(m) {
|
|
7901
|
+
const entries = [];
|
|
7902
|
+
for (const [k, v] of m.entries()) {
|
|
7903
|
+
entries.push([Array.from(hexToBytes(k)), v]);
|
|
7904
|
+
}
|
|
7905
|
+
return entries;
|
|
7906
|
+
}
|
|
7907
|
+
function encodeAccumulator(acc) {
|
|
7908
|
+
const encoded = PharosStateProof.enc({
|
|
7909
|
+
storageProof: mapToEntries(acc.storageProof),
|
|
7910
|
+
storageValues: mapToEntries(acc.storageValues),
|
|
7911
|
+
nonExistenceProofs: mapToEntries(acc.nonExistenceProofs),
|
|
7912
|
+
accountProofs: mapToEntries(acc.accountProofs)
|
|
7913
|
+
});
|
|
7914
|
+
return bytesToHex(encoded);
|
|
7915
|
+
}
|
|
7916
|
+
var PharosChain = class _PharosChain {
|
|
7917
|
+
constructor(params, evm) {
|
|
7918
|
+
this.params = params;
|
|
7919
|
+
this.evm = evm;
|
|
7920
|
+
this.rpc = new EvmHttpRpc(replaceWebsocketWithHttp(params.rpcUrl));
|
|
7921
|
+
}
|
|
7922
|
+
params;
|
|
7923
|
+
evm;
|
|
7924
|
+
rpc;
|
|
7925
|
+
static fromParams(params) {
|
|
7926
|
+
const evm = EvmChain.fromParams(params);
|
|
7927
|
+
return new _PharosChain(params, evm);
|
|
7928
|
+
}
|
|
7929
|
+
/**
|
|
7930
|
+
* Creates a `PharosChain` by auto-detecting the EVM chain ID and `IsmpHost`
|
|
7931
|
+
* address via {@link EvmChain.create}.
|
|
7932
|
+
*
|
|
7933
|
+
* @param rpcUrl - HTTP(S) JSON-RPC URL of the Pharos node
|
|
7934
|
+
* @param bundlerUrl - Optional ERC-4337 bundler URL forwarded to `EvmChain.create`
|
|
7935
|
+
*/
|
|
7936
|
+
static async create(rpcUrl, bundlerUrl) {
|
|
7937
|
+
const evm = await EvmChain.create(rpcUrl, bundlerUrl);
|
|
7938
|
+
const chainId = Number.parseInt(evm.config.stateMachineId.replace(/^EVM-/, ""), 10);
|
|
7939
|
+
if (!Number.isFinite(chainId)) {
|
|
7940
|
+
throw new Error(`Unexpected EVM stateMachineId: ${evm.config.stateMachineId}`);
|
|
7941
|
+
}
|
|
7942
|
+
const params = {
|
|
7943
|
+
chainId,
|
|
7944
|
+
rpcUrl: evm.config.rpcUrl,
|
|
7945
|
+
host: evm.config.host,
|
|
7946
|
+
consensusStateId: evm.config.consensusStateId,
|
|
7947
|
+
bundlerUrl: evm.bundlerUrl
|
|
7948
|
+
};
|
|
7949
|
+
return new _PharosChain(params, evm);
|
|
7950
|
+
}
|
|
7951
|
+
get client() {
|
|
7952
|
+
return this.evm.client;
|
|
7953
|
+
}
|
|
7954
|
+
get host() {
|
|
7955
|
+
return this.evm.host;
|
|
7956
|
+
}
|
|
7957
|
+
get bundlerUrl() {
|
|
7958
|
+
return this.evm.bundlerUrl;
|
|
7959
|
+
}
|
|
7960
|
+
get configService() {
|
|
7961
|
+
return this.evm.configService;
|
|
7962
|
+
}
|
|
7963
|
+
get config() {
|
|
7964
|
+
return this.evm.config;
|
|
7965
|
+
}
|
|
7966
|
+
hostAddress() {
|
|
7967
|
+
return getAddress(this.evm.host);
|
|
7968
|
+
}
|
|
7969
|
+
/**
|
|
7970
|
+
* Fetch a storage proof for `slotKeys` under `address` at the given block and
|
|
7971
|
+
* merge the response into the supplied accumulator. Mirrors the membership
|
|
7972
|
+
* proof path of `PharosEvmClient::fetch_pharos_proof` on the Rust side.
|
|
7973
|
+
*/
|
|
7974
|
+
async fetchStorageProofInto(acc, at, address, slotKeys) {
|
|
7975
|
+
const rpcProof = await this.rpc.call("eth_getProof", [
|
|
7976
|
+
address,
|
|
7977
|
+
slotKeys,
|
|
7978
|
+
blockTag(at)
|
|
7979
|
+
]);
|
|
7980
|
+
for (const sp of rpcProof.storageProof) {
|
|
7981
|
+
const slotKey = hexKey2(padTo32Bytes(sp.key));
|
|
7982
|
+
if (sp.isExist) {
|
|
7983
|
+
acc.storageProof.set(slotKey, rpcToProofNodes(sp.proof));
|
|
7984
|
+
acc.storageValues.set(slotKey, Array.from(padTo32Bytes(sp.value)));
|
|
7985
|
+
} else {
|
|
7986
|
+
acc.nonExistenceProofs.set(slotKey, {
|
|
7987
|
+
proofNodes: rpcToProofNodes(sp.proof),
|
|
7988
|
+
siblingProofs: rpcToSiblingProofs(sp.siblingLeftmostLeafProofs)
|
|
7989
|
+
});
|
|
7990
|
+
}
|
|
7991
|
+
}
|
|
7992
|
+
}
|
|
7993
|
+
/**
|
|
7994
|
+
* Fetch an account proof (no storage keys) at the given block and record it on
|
|
7995
|
+
* the accumulator. Mirrors `PharosEvmClient::fetch_account_proof`.
|
|
7996
|
+
*/
|
|
7997
|
+
async fetchAccountProofInto(acc, at, address) {
|
|
7998
|
+
const rpcProof = await this.rpc.call("eth_getProof", [
|
|
7999
|
+
address,
|
|
8000
|
+
[],
|
|
8001
|
+
blockTag(at)
|
|
8002
|
+
]);
|
|
8003
|
+
const addrBytes = hexToBytes(address);
|
|
8004
|
+
acc.accountProofs.set(hexKey2(addrBytes), {
|
|
8005
|
+
proofNodes: rpcToProofNodes(rpcProof.accountProof),
|
|
8006
|
+
rawValue: Array.from(hexToBytes(rpcProof.rawValue))
|
|
8007
|
+
});
|
|
8008
|
+
}
|
|
8009
|
+
timestamp() {
|
|
8010
|
+
return this.evm.timestamp();
|
|
8011
|
+
}
|
|
8012
|
+
requestReceiptKey(commitment) {
|
|
8013
|
+
return this.evm.requestReceiptKey(commitment);
|
|
8014
|
+
}
|
|
8015
|
+
queryRequestReceipt(commitment) {
|
|
8016
|
+
return this.evm.queryRequestReceipt(commitment);
|
|
8017
|
+
}
|
|
8018
|
+
/**
|
|
8019
|
+
* Query a Pharos state proof for the request/response commitments in `message`.
|
|
8020
|
+
*
|
|
8021
|
+
* Mirrors `PharosEvmClient::query_requests_proof` / `query_responses_proof`:
|
|
8022
|
+
* for every commitment we derive the second storage slot (`slot1` from
|
|
8023
|
+
* {@link requestCommitmentKey} / {@link responseCommitmentKey}) and request it
|
|
8024
|
+
* from the ISMP host via `eth_getProof`.
|
|
8025
|
+
*/
|
|
8026
|
+
async queryProof(message, _counterparty, at) {
|
|
8027
|
+
if (at === void 0) {
|
|
8028
|
+
throw new Error("PharosChain.queryProof requires an explicit block height `at`");
|
|
8029
|
+
}
|
|
8030
|
+
const slotKeys = "Requests" in message ? message.Requests.map((c) => requestCommitmentKey(c).slot1) : message.Responses.map((c) => responseCommitmentKey(c));
|
|
8031
|
+
const acc = newAccumulator();
|
|
8032
|
+
await this.fetchStorageProofInto(acc, at, this.hostAddress(), slotKeys);
|
|
8033
|
+
return encodeAccumulator(acc);
|
|
8034
|
+
}
|
|
8035
|
+
/**
|
|
8036
|
+
* Query a Pharos state proof for arbitrary keys.
|
|
8037
|
+
*
|
|
8038
|
+
* Supports the same key shapes as `PharosEvmClient::query_state_proof`:
|
|
8039
|
+
* - 32-byte keys: ISMP host storage slots
|
|
8040
|
+
* - 52-byte keys: `address (20) || slot (32)` grouped by contract
|
|
8041
|
+
* - 20-byte keys: account queries (proves the account leaf itself)
|
|
8042
|
+
*
|
|
8043
|
+
* If `address` is provided, all keys are treated as 32-byte slots under that
|
|
8044
|
+
* contract (matching the `EvmChain.queryStateProof` contract-override shape).
|
|
8045
|
+
*/
|
|
8046
|
+
async queryStateProof(at, keys, address) {
|
|
8047
|
+
const acc = newAccumulator();
|
|
8048
|
+
if (address !== void 0) {
|
|
8049
|
+
await this.fetchStorageProofInto(acc, at, getAddress(address), keys);
|
|
8050
|
+
return encodeAccumulator(acc);
|
|
8051
|
+
}
|
|
8052
|
+
const keyBytes = keys.map((k) => hexToBytes(k));
|
|
8053
|
+
const hostAddr = this.hostAddress();
|
|
8054
|
+
const ismpSlots = [];
|
|
8055
|
+
const groups = /* @__PURE__ */ new Map();
|
|
8056
|
+
const accountQueries = [];
|
|
8057
|
+
for (const bytes of keyBytes) {
|
|
8058
|
+
if (bytes.length === 32) {
|
|
8059
|
+
ismpSlots.push(bytesToHex(bytes));
|
|
8060
|
+
} else if (bytes.length === 52) {
|
|
8061
|
+
const addr = getAddress(bytesToHex(bytes.subarray(0, 20)));
|
|
8062
|
+
const slot = bytesToHex(bytes.subarray(20, 52));
|
|
8063
|
+
const list = groups.get(addr) ?? [];
|
|
8064
|
+
list.push(slot);
|
|
8065
|
+
groups.set(addr, list);
|
|
8066
|
+
} else if (bytes.length === 20) {
|
|
8067
|
+
accountQueries.push(getAddress(bytesToHex(bytes)));
|
|
8068
|
+
} else {
|
|
8069
|
+
throw new Error(
|
|
8070
|
+
`PharosChain.queryStateProof: unsupported key length ${bytes.length}; expected 20, 32, or 52`
|
|
8071
|
+
);
|
|
8072
|
+
}
|
|
8073
|
+
}
|
|
8074
|
+
if (ismpSlots.length > 0) {
|
|
8075
|
+
await this.fetchStorageProofInto(acc, at, hostAddr, ismpSlots);
|
|
8076
|
+
}
|
|
8077
|
+
for (const [addr, slots] of groups) {
|
|
8078
|
+
await this.fetchStorageProofInto(acc, at, addr, slots);
|
|
8079
|
+
}
|
|
8080
|
+
for (const addr of accountQueries) {
|
|
8081
|
+
await this.fetchAccountProofInto(acc, at, addr);
|
|
8082
|
+
}
|
|
8083
|
+
return encodeAccumulator(acc);
|
|
8084
|
+
}
|
|
8085
|
+
encode(message) {
|
|
8086
|
+
return this.evm.encode(message);
|
|
8087
|
+
}
|
|
8088
|
+
latestStateMachineHeight(stateMachineId) {
|
|
8089
|
+
return this.evm.latestStateMachineHeight(stateMachineId);
|
|
8090
|
+
}
|
|
8091
|
+
challengePeriod(stateMachineId) {
|
|
8092
|
+
return this.evm.challengePeriod(stateMachineId);
|
|
8093
|
+
}
|
|
8094
|
+
stateMachineUpdateTime(stateMachineHeight) {
|
|
8095
|
+
return this.evm.stateMachineUpdateTime(stateMachineHeight);
|
|
8096
|
+
}
|
|
8097
|
+
getHostNonce() {
|
|
8098
|
+
return this.evm.getHostNonce();
|
|
8099
|
+
}
|
|
8100
|
+
quoteNative(request, fee) {
|
|
8101
|
+
return this.evm.quoteNative(request, fee);
|
|
8102
|
+
}
|
|
8103
|
+
getFeeTokenWithDecimals() {
|
|
8104
|
+
return this.evm.getFeeTokenWithDecimals();
|
|
8105
|
+
}
|
|
8106
|
+
getPlaceOrderCalldata(txHash, intentGatewayAddress) {
|
|
8107
|
+
return this.evm.getPlaceOrderCalldata(txHash, intentGatewayAddress);
|
|
8108
|
+
}
|
|
8109
|
+
estimateGas(request) {
|
|
8110
|
+
return this.evm.estimateGas(request);
|
|
8111
|
+
}
|
|
8112
|
+
broadcastTransaction(signedTransaction) {
|
|
8113
|
+
return this.evm.broadcastTransaction(signedTransaction);
|
|
8114
|
+
}
|
|
8115
|
+
getTransactionReceipt(hash) {
|
|
8116
|
+
return this.evm.getTransactionReceipt(hash);
|
|
8117
|
+
}
|
|
8118
|
+
};
|
|
7765
8119
|
function getPeakPosByHeight(height) {
|
|
7766
8120
|
return (1n << BigInt(height + 1)) - 2n;
|
|
7767
8121
|
}
|
|
@@ -19165,9 +19519,9 @@ async function fetchLocalAssetId(params) {
|
|
|
19165
19519
|
const palletPrefix = xxhashAsU8a("TokenGateway", 128);
|
|
19166
19520
|
const storagePrefix = xxhashAsU8a("LocalAssets", 128);
|
|
19167
19521
|
const full_key = new Uint8Array([...palletPrefix, ...storagePrefix, ...assetId]);
|
|
19168
|
-
const
|
|
19522
|
+
const hexKey3 = bytesToHex(full_key);
|
|
19169
19523
|
const storage_value = await api.rpc.state.getStorage(
|
|
19170
|
-
|
|
19524
|
+
hexKey3
|
|
19171
19525
|
);
|
|
19172
19526
|
if (storage_value.isSome) {
|
|
19173
19527
|
const assetId2 = storage_value.value.toU8a();
|
|
@@ -19440,6 +19794,6 @@ async function teleportDot(param_) {
|
|
|
19440
19794
|
return stream;
|
|
19441
19795
|
}
|
|
19442
19796
|
|
|
19443
|
-
export { ADDRESS_ZERO2 as ADDRESS_ZERO, BundlerMethod, ChainConfigService, Chains, DEFAULT_ADDRESS, DEFAULT_GRAFFITI, DOMAIN_TYPEHASH, DUMMY_PRIVATE_KEY, ERC20Method, ERC7821_BATCH_MODE, EvmChain, ABI as EvmHostABI, EvmLanguage, HyperClientStatus, IndexerClient, IntentGateway, ABI7 as IntentGatewayV2ABI, IntentOrderStatus, IntentsCoprocessor, MOCK_ADDRESS, ORDER_V2_PARAM_TYPE, OrderStatus, OrderStatusChecker, PACKED_USEROP_TYPEHASH, PLACE_ORDER_SELECTOR, PolkadotHubChain, REQUEST_COMMITMENTS_SLOT, REQUEST_RECEIPTS_SLOT, RESPONSE_COMMITMENTS_SLOT, RESPONSE_RECEIPTS_SLOT, RequestKind, RequestStatus, SELECT_SOLVER_TYPEHASH, STATE_COMMITMENTS_SLOT, SubstrateChain, Swap, TESTNET_CHAINS, TeleportStatus, TimeoutStatus, TokenGateway, TronChain, USE_ETHERSCAN_CHAINS, __test, adjustDecimals, bytes20ToBytes32, bytes32ToBytes20, calculateAllowanceMappingLocation, calculateBalanceMappingLocation, chainConfigs, constructRedeemEscrowRequestBody, constructRefundEscrowRequestBody, convertCodecToIGetRequest, convertCodecToIProof, convertIGetRequestToCodec, convertIProofToCodec, convertStateIdToStateMachineId, convertStateMachineEnumToString, convertStateMachineIdToEnum, createEvmChain, createQueryClient, decodeUserOpScale, encodeERC7821ExecuteBatch, encodeISMPMessage, encodeUserOpScale, encodeWithdrawalRequest, estimateGasForPost, fetchPrice, fetchSourceProof, generateRootWithProof, getChainId, getConfigByStateMachineId, getContractCallInput, getGasPriceFromEtherscan, getOrFetchStorageSlot, getOrderPlacedFromTx, getPostRequestEventFromTx, getPostResponseEventFromTx, getRequestCommitment, getStateCommitmentFieldSlot, getStateCommitmentSlot, getStorageSlot, getViemChain, hexToString, hyperbridgeAddress, maxBigInt, orderCommitment, parseStateMachineId, polkadotAssetHubPaseo, postRequestCommitment, queryAssetTeleported, queryGetRequest, queryPostRequest, requestCommitmentKey, responseCommitmentKey, retryPromise, teleport, teleportDot, transformOrderForContract, tronChainIds, tronNile };
|
|
19797
|
+
export { ADDRESS_ZERO2 as ADDRESS_ZERO, BundlerMethod, ChainConfigService, Chains, DEFAULT_ADDRESS, DEFAULT_GRAFFITI, DOMAIN_TYPEHASH, DUMMY_PRIVATE_KEY, ERC20Method, ERC7821_BATCH_MODE, EvmChain, ABI as EvmHostABI, EvmLanguage, HyperClientStatus, IndexerClient, IntentGateway, ABI7 as IntentGatewayV2ABI, IntentOrderStatus, IntentsCoprocessor, MOCK_ADDRESS, ORDER_V2_PARAM_TYPE, OrderStatus, OrderStatusChecker, PACKED_USEROP_TYPEHASH, PLACE_ORDER_SELECTOR, PharosChain, PolkadotHubChain, REQUEST_COMMITMENTS_SLOT, REQUEST_RECEIPTS_SLOT, RESPONSE_COMMITMENTS_SLOT, RESPONSE_RECEIPTS_SLOT, RequestKind, RequestStatus, SELECT_SOLVER_TYPEHASH, STATE_COMMITMENTS_SLOT, SubstrateChain, Swap, TESTNET_CHAINS, TeleportStatus, TimeoutStatus, TokenGateway, TronChain, USE_ETHERSCAN_CHAINS, __test, adjustDecimals, bytes20ToBytes32, bytes32ToBytes20, calculateAllowanceMappingLocation, calculateBalanceMappingLocation, chainConfigs, constructRedeemEscrowRequestBody, constructRefundEscrowRequestBody, convertCodecToIGetRequest, convertCodecToIProof, convertIGetRequestToCodec, convertIProofToCodec, convertStateIdToStateMachineId, convertStateMachineEnumToString, convertStateMachineIdToEnum, createEvmChain, createQueryClient, decodeUserOpScale, encodeERC7821ExecuteBatch, encodeISMPMessage, encodeUserOpScale, encodeWithdrawalRequest, estimateGasForPost, fetchPrice, fetchSourceProof, generateRootWithProof, getChainId, getConfigByStateMachineId, getContractCallInput, getGasPriceFromEtherscan, getOrFetchStorageSlot, getOrderPlacedFromTx, getPostRequestEventFromTx, getPostResponseEventFromTx, getRequestCommitment, getStateCommitmentFieldSlot, getStateCommitmentSlot, getStorageSlot, getViemChain, hexToString, hyperbridgeAddress, maxBigInt, orderCommitment, parseStateMachineId, pharosAtlantic, pharosMainnet, polkadotAssetHubPaseo, postRequestCommitment, queryAssetTeleported, queryGetRequest, queryPostRequest, requestCommitmentKey, responseCommitmentKey, retryPromise, teleport, teleportDot, transformOrderForContract, tronChainIds, tronNile };
|
|
19444
19798
|
//# sourceMappingURL=index.js.map
|
|
19445
19799
|
//# sourceMappingURL=index.js.map
|