@veridex/sdk 1.0.0-beta.10 → 1.0.0-beta.12
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/chains/aptos/index.js +16 -2
- package/dist/chains/aptos/index.js.map +1 -1
- package/dist/chains/aptos/index.mjs +16 -2
- package/dist/chains/aptos/index.mjs.map +1 -1
- package/dist/chains/evm/index.js +2 -2
- package/dist/chains/evm/index.js.map +1 -1
- package/dist/chains/evm/index.mjs +2 -2
- package/dist/chains/evm/index.mjs.map +1 -1
- package/dist/chains/solana/index.js.map +1 -1
- package/dist/chains/solana/index.mjs.map +1 -1
- package/dist/chains/starknet/index.js.map +1 -1
- package/dist/chains/starknet/index.mjs.map +1 -1
- package/dist/chains/sui/index.js.map +1 -1
- package/dist/chains/sui/index.mjs.map +1 -1
- package/dist/constants.d.mts +1 -1
- package/dist/constants.d.ts +1 -1
- package/dist/constants.js +1 -1
- package/dist/constants.js.map +1 -1
- package/dist/constants.mjs +1 -1
- package/dist/constants.mjs.map +1 -1
- package/dist/index.js +33 -8
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +33 -8
- package/dist/index.mjs.map +1 -1
- package/dist/payload.js.map +1 -1
- package/dist/payload.mjs.map +1 -1
- package/dist/queries/index.js +8 -0
- package/dist/queries/index.js.map +1 -1
- package/dist/queries/index.mjs +8 -0
- package/dist/queries/index.mjs.map +1 -1
- package/dist/utils.js.map +1 -1
- package/dist/utils.mjs.map +1 -1
- package/dist/wormhole.js.map +1 -1
- package/dist/wormhole.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -562,7 +562,7 @@ var WORMHOLE_API = {
|
|
|
562
562
|
var HUB_ABI = [
|
|
563
563
|
"function authenticateAndDispatch((bytes authenticatorData, string clientDataJSON, uint256 challengeIndex, uint256 typeIndex, uint256 r, uint256 s) auth, uint256 publicKeyX, uint256 publicKeyY, uint16 targetChain, bytes actionPayload) external payable returns (uint64 sequence)",
|
|
564
564
|
"function authenticateRawAndDispatch(uint256 r, uint256 s, bytes32 messageHash, uint256 publicKeyX, uint256 publicKeyY, uint16 targetChain, bytes actionPayload, uint256 nonce) external payable returns (uint64 sequence)",
|
|
565
|
-
"function
|
|
565
|
+
"function userNonces(bytes32 userKeyHash) external view returns (uint256)",
|
|
566
566
|
"function encodeTransferAction(address token, address recipient, uint256 amount) external pure returns (bytes)",
|
|
567
567
|
"function encodeExecuteAction(address target, uint256 value, bytes data) external pure returns (bytes)",
|
|
568
568
|
"function encodeBridgeAction(bytes32 token, uint256 amount, uint16 targetChain, bytes32 recipient) external pure returns (bytes)",
|
|
@@ -1713,6 +1713,14 @@ var OPTIMISM_SEPOLIA_TOKENS = {
|
|
|
1713
1713
|
address: "0x4200000000000000000000000000000000000006",
|
|
1714
1714
|
decimals: 18,
|
|
1715
1715
|
isNative: false
|
|
1716
|
+
},
|
|
1717
|
+
{
|
|
1718
|
+
symbol: "WETH.base",
|
|
1719
|
+
name: "Wrapped WETH (Base via Wormhole)",
|
|
1720
|
+
address: "0xD408f6498f48aE11BcAb518dA39cF7940eE3271d",
|
|
1721
|
+
// Wormhole-wrapped Base WETH
|
|
1722
|
+
decimals: 18,
|
|
1723
|
+
isNative: false
|
|
1716
1724
|
}
|
|
1717
1725
|
]
|
|
1718
1726
|
};
|
|
@@ -1785,6 +1793,8 @@ var DEFAULT_RPC_URLS = {
|
|
|
1785
1793
|
var TESTNET_TOKEN_PRICES = {
|
|
1786
1794
|
ETH: 2500,
|
|
1787
1795
|
WETH: 2500,
|
|
1796
|
+
"WETH.BASE": 2500,
|
|
1797
|
+
// Wormhole-wrapped Base WETH
|
|
1788
1798
|
USDC: 1,
|
|
1789
1799
|
USDT: 1,
|
|
1790
1800
|
DAI: 1,
|
|
@@ -3921,16 +3931,30 @@ var SolanaClient = class {
|
|
|
3921
3931
|
// src/chains/aptos/AptosClient.ts
|
|
3922
3932
|
var import_aptos = require("aptos");
|
|
3923
3933
|
var import_js_sha3 = require("js-sha3");
|
|
3934
|
+
function normalizeAptosRpcUrl(rpcUrl) {
|
|
3935
|
+
const trimmed = rpcUrl.trim().replace(/\/+$/, "");
|
|
3936
|
+
const withoutV1 = trimmed.replace(/\/v1$/, "");
|
|
3937
|
+
try {
|
|
3938
|
+
const url = new URL(withoutV1);
|
|
3939
|
+
if (url.protocol === "https:" && !url.port) {
|
|
3940
|
+
url.port = "443";
|
|
3941
|
+
}
|
|
3942
|
+
return url.origin;
|
|
3943
|
+
} catch {
|
|
3944
|
+
return withoutV1;
|
|
3945
|
+
}
|
|
3946
|
+
}
|
|
3924
3947
|
var AptosClient = class {
|
|
3925
3948
|
config;
|
|
3926
3949
|
client;
|
|
3927
3950
|
moduleAddress;
|
|
3928
3951
|
constructor(config) {
|
|
3952
|
+
const normalizedRpcUrl = normalizeAptosRpcUrl(config.rpcUrl);
|
|
3929
3953
|
this.config = {
|
|
3930
3954
|
name: `Aptos ${config.network || "mainnet"}`,
|
|
3931
3955
|
chainId: config.wormholeChainId,
|
|
3932
3956
|
wormholeChainId: config.wormholeChainId,
|
|
3933
|
-
rpcUrl:
|
|
3957
|
+
rpcUrl: normalizedRpcUrl,
|
|
3934
3958
|
explorerUrl: config.network === "testnet" ? "https://explorer.aptoslabs.com?network=testnet" : "https://explorer.aptoslabs.com",
|
|
3935
3959
|
isEvm: false,
|
|
3936
3960
|
contracts: {
|
|
@@ -3940,7 +3964,7 @@ var AptosClient = class {
|
|
|
3940
3964
|
tokenBridge: config.tokenBridge
|
|
3941
3965
|
}
|
|
3942
3966
|
};
|
|
3943
|
-
this.client = new import_aptos.AptosClient(
|
|
3967
|
+
this.client = new import_aptos.AptosClient(normalizedRpcUrl);
|
|
3944
3968
|
this.moduleAddress = config.moduleAddress;
|
|
3945
3969
|
}
|
|
3946
3970
|
getConfig() {
|
|
@@ -7695,7 +7719,8 @@ var TESTNET_CHAINS2 = [
|
|
|
7695
7719
|
chainId: 84532,
|
|
7696
7720
|
wormholeChainId: 10004,
|
|
7697
7721
|
rpcUrl: "https://sepolia.base.org",
|
|
7698
|
-
hubAddress: "
|
|
7722
|
+
hubAddress: "0x66D87dE68327f48A099c5B9bE97020Feab9a7c82",
|
|
7723
|
+
vaultFactory: "0xCFaEb5652aa2Ee60b2229dC8895B4159749C7e53",
|
|
7699
7724
|
isHub: true
|
|
7700
7725
|
},
|
|
7701
7726
|
{
|
|
@@ -7703,14 +7728,14 @@ var TESTNET_CHAINS2 = [
|
|
|
7703
7728
|
chainId: 11155420,
|
|
7704
7729
|
wormholeChainId: 10005,
|
|
7705
7730
|
rpcUrl: "https://sepolia.optimism.io",
|
|
7706
|
-
vaultFactory: "
|
|
7731
|
+
vaultFactory: "0xA5653d54079ABeCe780F8d9597B2bc4B09fe464A"
|
|
7707
7732
|
},
|
|
7708
7733
|
{
|
|
7709
7734
|
name: "Arbitrum Sepolia",
|
|
7710
7735
|
chainId: 421614,
|
|
7711
7736
|
wormholeChainId: 10003,
|
|
7712
7737
|
rpcUrl: "https://sepolia-rollup.arbitrum.io/rpc",
|
|
7713
|
-
vaultFactory: "
|
|
7738
|
+
vaultFactory: "0xd36D3D5DB59d78f1E33813490F72DABC15C9B07c"
|
|
7714
7739
|
}
|
|
7715
7740
|
];
|
|
7716
7741
|
var MAINNET_CHAINS2 = [
|
|
@@ -10010,7 +10035,7 @@ var ERC20_ABI2 = [
|
|
|
10010
10035
|
];
|
|
10011
10036
|
var HUB_ABI2 = [
|
|
10012
10037
|
"function dispatch(tuple(bytes authenticatorData, string clientDataJSON, uint256 challengeIndex, uint256 typeIndex, uint256 r, uint256 s) signature, uint256 publicKeyX, uint256 publicKeyY, uint16 targetChain, bytes actionPayload, uint256 nonce) payable returns (uint64 sequence)",
|
|
10013
|
-
"function
|
|
10038
|
+
"function userNonces(bytes32 userKeyHash) view returns (uint256)",
|
|
10014
10039
|
"function getMessageFee() view returns (uint256)",
|
|
10015
10040
|
"function getVaultAddress(bytes32 userKeyHash) view returns (address)",
|
|
10016
10041
|
"function vaultExists(bytes32 userKeyHash) view returns (bool)",
|
|
@@ -10096,7 +10121,7 @@ var EVMClient = class {
|
|
|
10096
10121
|
return this.config;
|
|
10097
10122
|
}
|
|
10098
10123
|
async getNonce(userKeyHash) {
|
|
10099
|
-
const nonce = await this.hubContract.
|
|
10124
|
+
const nonce = await this.hubContract.userNonces(userKeyHash);
|
|
10100
10125
|
return BigInt(nonce.toString());
|
|
10101
10126
|
}
|
|
10102
10127
|
/**
|