@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.mjs
CHANGED
|
@@ -364,7 +364,7 @@ var WORMHOLE_API = {
|
|
|
364
364
|
var HUB_ABI = [
|
|
365
365
|
"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)",
|
|
366
366
|
"function authenticateRawAndDispatch(uint256 r, uint256 s, bytes32 messageHash, uint256 publicKeyX, uint256 publicKeyY, uint16 targetChain, bytes actionPayload, uint256 nonce) external payable returns (uint64 sequence)",
|
|
367
|
-
"function
|
|
367
|
+
"function userNonces(bytes32 userKeyHash) external view returns (uint256)",
|
|
368
368
|
"function encodeTransferAction(address token, address recipient, uint256 amount) external pure returns (bytes)",
|
|
369
369
|
"function encodeExecuteAction(address target, uint256 value, bytes data) external pure returns (bytes)",
|
|
370
370
|
"function encodeBridgeAction(bytes32 token, uint256 amount, uint16 targetChain, bytes32 recipient) external pure returns (bytes)",
|
|
@@ -1515,6 +1515,14 @@ var OPTIMISM_SEPOLIA_TOKENS = {
|
|
|
1515
1515
|
address: "0x4200000000000000000000000000000000000006",
|
|
1516
1516
|
decimals: 18,
|
|
1517
1517
|
isNative: false
|
|
1518
|
+
},
|
|
1519
|
+
{
|
|
1520
|
+
symbol: "WETH.base",
|
|
1521
|
+
name: "Wrapped WETH (Base via Wormhole)",
|
|
1522
|
+
address: "0xD408f6498f48aE11BcAb518dA39cF7940eE3271d",
|
|
1523
|
+
// Wormhole-wrapped Base WETH
|
|
1524
|
+
decimals: 18,
|
|
1525
|
+
isNative: false
|
|
1518
1526
|
}
|
|
1519
1527
|
]
|
|
1520
1528
|
};
|
|
@@ -1587,6 +1595,8 @@ var DEFAULT_RPC_URLS = {
|
|
|
1587
1595
|
var TESTNET_TOKEN_PRICES = {
|
|
1588
1596
|
ETH: 2500,
|
|
1589
1597
|
WETH: 2500,
|
|
1598
|
+
"WETH.BASE": 2500,
|
|
1599
|
+
// Wormhole-wrapped Base WETH
|
|
1590
1600
|
USDC: 1,
|
|
1591
1601
|
USDT: 1,
|
|
1592
1602
|
DAI: 1,
|
|
@@ -3728,16 +3738,30 @@ var SolanaClient = class {
|
|
|
3728
3738
|
// src/chains/aptos/AptosClient.ts
|
|
3729
3739
|
import { AptosClient as AptosSDK } from "aptos";
|
|
3730
3740
|
import { sha3_256 } from "js-sha3";
|
|
3741
|
+
function normalizeAptosRpcUrl(rpcUrl) {
|
|
3742
|
+
const trimmed = rpcUrl.trim().replace(/\/+$/, "");
|
|
3743
|
+
const withoutV1 = trimmed.replace(/\/v1$/, "");
|
|
3744
|
+
try {
|
|
3745
|
+
const url = new URL(withoutV1);
|
|
3746
|
+
if (url.protocol === "https:" && !url.port) {
|
|
3747
|
+
url.port = "443";
|
|
3748
|
+
}
|
|
3749
|
+
return url.origin;
|
|
3750
|
+
} catch {
|
|
3751
|
+
return withoutV1;
|
|
3752
|
+
}
|
|
3753
|
+
}
|
|
3731
3754
|
var AptosClient = class {
|
|
3732
3755
|
config;
|
|
3733
3756
|
client;
|
|
3734
3757
|
moduleAddress;
|
|
3735
3758
|
constructor(config) {
|
|
3759
|
+
const normalizedRpcUrl = normalizeAptosRpcUrl(config.rpcUrl);
|
|
3736
3760
|
this.config = {
|
|
3737
3761
|
name: `Aptos ${config.network || "mainnet"}`,
|
|
3738
3762
|
chainId: config.wormholeChainId,
|
|
3739
3763
|
wormholeChainId: config.wormholeChainId,
|
|
3740
|
-
rpcUrl:
|
|
3764
|
+
rpcUrl: normalizedRpcUrl,
|
|
3741
3765
|
explorerUrl: config.network === "testnet" ? "https://explorer.aptoslabs.com?network=testnet" : "https://explorer.aptoslabs.com",
|
|
3742
3766
|
isEvm: false,
|
|
3743
3767
|
contracts: {
|
|
@@ -3747,7 +3771,7 @@ var AptosClient = class {
|
|
|
3747
3771
|
tokenBridge: config.tokenBridge
|
|
3748
3772
|
}
|
|
3749
3773
|
};
|
|
3750
|
-
this.client = new AptosSDK(
|
|
3774
|
+
this.client = new AptosSDK(normalizedRpcUrl);
|
|
3751
3775
|
this.moduleAddress = config.moduleAddress;
|
|
3752
3776
|
}
|
|
3753
3777
|
getConfig() {
|
|
@@ -7520,7 +7544,8 @@ var TESTNET_CHAINS2 = [
|
|
|
7520
7544
|
chainId: 84532,
|
|
7521
7545
|
wormholeChainId: 10004,
|
|
7522
7546
|
rpcUrl: "https://sepolia.base.org",
|
|
7523
|
-
hubAddress: "
|
|
7547
|
+
hubAddress: "0x66D87dE68327f48A099c5B9bE97020Feab9a7c82",
|
|
7548
|
+
vaultFactory: "0xCFaEb5652aa2Ee60b2229dC8895B4159749C7e53",
|
|
7524
7549
|
isHub: true
|
|
7525
7550
|
},
|
|
7526
7551
|
{
|
|
@@ -7528,14 +7553,14 @@ var TESTNET_CHAINS2 = [
|
|
|
7528
7553
|
chainId: 11155420,
|
|
7529
7554
|
wormholeChainId: 10005,
|
|
7530
7555
|
rpcUrl: "https://sepolia.optimism.io",
|
|
7531
|
-
vaultFactory: "
|
|
7556
|
+
vaultFactory: "0xA5653d54079ABeCe780F8d9597B2bc4B09fe464A"
|
|
7532
7557
|
},
|
|
7533
7558
|
{
|
|
7534
7559
|
name: "Arbitrum Sepolia",
|
|
7535
7560
|
chainId: 421614,
|
|
7536
7561
|
wormholeChainId: 10003,
|
|
7537
7562
|
rpcUrl: "https://sepolia-rollup.arbitrum.io/rpc",
|
|
7538
|
-
vaultFactory: "
|
|
7563
|
+
vaultFactory: "0xd36D3D5DB59d78f1E33813490F72DABC15C9B07c"
|
|
7539
7564
|
}
|
|
7540
7565
|
];
|
|
7541
7566
|
var MAINNET_CHAINS2 = [
|
|
@@ -9835,7 +9860,7 @@ var ERC20_ABI2 = [
|
|
|
9835
9860
|
];
|
|
9836
9861
|
var HUB_ABI2 = [
|
|
9837
9862
|
"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)",
|
|
9838
|
-
"function
|
|
9863
|
+
"function userNonces(bytes32 userKeyHash) view returns (uint256)",
|
|
9839
9864
|
"function getMessageFee() view returns (uint256)",
|
|
9840
9865
|
"function getVaultAddress(bytes32 userKeyHash) view returns (address)",
|
|
9841
9866
|
"function vaultExists(bytes32 userKeyHash) view returns (bool)",
|
|
@@ -9921,7 +9946,7 @@ var EVMClient = class {
|
|
|
9921
9946
|
return this.config;
|
|
9922
9947
|
}
|
|
9923
9948
|
async getNonce(userKeyHash) {
|
|
9924
|
-
const nonce = await this.hubContract.
|
|
9949
|
+
const nonce = await this.hubContract.userNonces(userKeyHash);
|
|
9925
9950
|
return BigInt(nonce.toString());
|
|
9926
9951
|
}
|
|
9927
9952
|
/**
|