@oydual31/more-vaults-sdk 0.2.7 → 0.2.9
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/react/index.cjs +30 -8
- package/dist/react/index.cjs.map +1 -1
- package/dist/react/index.d.cts +1 -1
- package/dist/react/index.d.ts +1 -1
- package/dist/react/index.js +30 -8
- package/dist/react/index.js.map +1 -1
- package/dist/{spokeRoutes-z7s_5ooO.d.cts → spokeRoutes-FgKCJQYa.d.cts} +5 -2
- package/dist/{spokeRoutes-z7s_5ooO.d.ts → spokeRoutes-FgKCJQYa.d.ts} +5 -2
- package/dist/viem/index.cjs +51 -8
- package/dist/viem/index.cjs.map +1 -1
- package/dist/viem/index.d.cts +44 -14
- package/dist/viem/index.d.ts +44 -14
- package/dist/viem/index.js +51 -9
- package/dist/viem/index.js.map +1 -1
- package/package.json +1 -1
- package/src/viem/chains.ts +16 -3
- package/src/viem/index.ts +1 -0
- package/src/viem/redeemFlows.ts +50 -10
- package/src/viem/userHelpers.ts +14 -8
package/dist/react/index.cjs
CHANGED
|
@@ -103,10 +103,12 @@ var OFT_ROUTES = {
|
|
|
103
103
|
]: { oft: "0x19cFCE47eD54a88614648DC3f19A5980097007dD", token: "0x94b008aA00579c1307B0EF2c499aD98a8ce58e58" }
|
|
104
104
|
},
|
|
105
105
|
/**
|
|
106
|
-
*
|
|
106
|
+
* USDF — USD Flow OFT. Bridges PYUSD (Ethereum) ↔ USDF (Flow EVM).
|
|
107
|
+
* On Ethereum: underlying is PayPal USD (PYUSD, 0x6c3ea9...).
|
|
108
|
+
* On Flow: the OFT itself IS the token (USDF, 0x2aabea...).
|
|
107
109
|
* Routes verified: Eth→Flow ✓
|
|
108
110
|
*/
|
|
109
|
-
|
|
111
|
+
USDF: {
|
|
110
112
|
[
|
|
111
113
|
747
|
|
112
114
|
/* flowEVMMainnet */
|
|
@@ -116,6 +118,23 @@ var OFT_ROUTES = {
|
|
|
116
118
|
/* ethereum */
|
|
117
119
|
]: { oft: "0xfa0e06b54986ad96de87a8c56fea76fbd8d493f8", token: "0x6c3ea9036406852006290770BEdFcAbA0e23A0e8" }
|
|
118
120
|
},
|
|
121
|
+
/**
|
|
122
|
+
* PYUSD — PayPal USD bridged via OFTAdapter (Paxos / LayerZero).
|
|
123
|
+
* Lock/mint architecture: locks PYUSD on Arbitrum, mints PYUSD0 on Flow EVM.
|
|
124
|
+
* On Arbitrum: OFTAdapter wraps native PYUSD (0x46850a...).
|
|
125
|
+
* On Flow: OFTAdapter wraps PYUSD0 (0x99aF3E...), which is the native Paxos token.
|
|
126
|
+
* Routes verified: Arb↔Flow ✓ (EID 30336). No Eth or Base peers.
|
|
127
|
+
*/
|
|
128
|
+
PYUSD: {
|
|
129
|
+
[
|
|
130
|
+
747
|
|
131
|
+
/* flowEVMMainnet */
|
|
132
|
+
]: { oft: "0x26d27d5AF2F6f1c14F40013C8619d97aaf015509", token: "0x99aF3EeA856556646C98c8B9b2548Fe815240750" },
|
|
133
|
+
[
|
|
134
|
+
42161
|
|
135
|
+
/* arbitrum */
|
|
136
|
+
]: { oft: "0x3CD2b89C49D130C08f1d683225b2e5DeB63ff876", token: "0x46850aD61C2B7d64d08c9C754F45254596696984" }
|
|
137
|
+
},
|
|
119
138
|
/**
|
|
120
139
|
* WFLOW — Wrapped FLOW NativeOFTAdapter (issued by Flow Foundation).
|
|
121
140
|
* Routes verified: Eth→Flow ✓
|
|
@@ -1775,6 +1794,7 @@ async function getUserPositionMultiChain(vault, user) {
|
|
|
1775
1794
|
});
|
|
1776
1795
|
const [withdrawShares, timelockEndsAt] = withdrawalRequest;
|
|
1777
1796
|
const spokeShares = {};
|
|
1797
|
+
const rawSpokeShares = {};
|
|
1778
1798
|
if (topo.spokeChainIds.length > 0) {
|
|
1779
1799
|
let hubShareOft = null;
|
|
1780
1800
|
try {
|
|
@@ -1797,7 +1817,7 @@ async function getUserPositionMultiChain(vault, user) {
|
|
|
1797
1817
|
const spokePromises = topo.spokeChainIds.map(async (spokeChainId) => {
|
|
1798
1818
|
try {
|
|
1799
1819
|
const spokeEid = CHAIN_ID_TO_EID[spokeChainId];
|
|
1800
|
-
if (!spokeEid) return { chainId: spokeChainId, balance: 0n };
|
|
1820
|
+
if (!spokeEid) return { chainId: spokeChainId, balance: 0n, rawBalance: 0n };
|
|
1801
1821
|
const spokeOftBytes32 = await hubClient.readContract({
|
|
1802
1822
|
address: hubShareOft,
|
|
1803
1823
|
abi: OFT_ABI,
|
|
@@ -1806,10 +1826,10 @@ async function getUserPositionMultiChain(vault, user) {
|
|
|
1806
1826
|
});
|
|
1807
1827
|
const spokeOft = viem.getAddress(`0x${spokeOftBytes32.slice(-40)}`);
|
|
1808
1828
|
if (spokeOft === "0x0000000000000000000000000000000000000000") {
|
|
1809
|
-
return { chainId: spokeChainId, balance: 0n };
|
|
1829
|
+
return { chainId: spokeChainId, balance: 0n, rawBalance: 0n };
|
|
1810
1830
|
}
|
|
1811
1831
|
const spokeClient = createChainClient(spokeChainId);
|
|
1812
|
-
if (!spokeClient) return { chainId: spokeChainId, balance: 0n };
|
|
1832
|
+
if (!spokeClient) return { chainId: spokeChainId, balance: 0n, rawBalance: 0n };
|
|
1813
1833
|
const [rawBalance, spokeOftDecimals] = await spokeClient.multicall({
|
|
1814
1834
|
contracts: [
|
|
1815
1835
|
{ address: spokeOft, abi: ERC20_ABI, functionName: "balanceOf", args: [u] },
|
|
@@ -1825,14 +1845,15 @@ async function getUserPositionMultiChain(vault, user) {
|
|
|
1825
1845
|
} else {
|
|
1826
1846
|
balance = rawBalance;
|
|
1827
1847
|
}
|
|
1828
|
-
return { chainId: spokeChainId, balance };
|
|
1848
|
+
return { chainId: spokeChainId, balance, rawBalance };
|
|
1829
1849
|
} catch {
|
|
1830
|
-
return { chainId: spokeChainId, balance: 0n };
|
|
1850
|
+
return { chainId: spokeChainId, balance: 0n, rawBalance: 0n };
|
|
1831
1851
|
}
|
|
1832
1852
|
});
|
|
1833
1853
|
const results = await Promise.all(spokePromises);
|
|
1834
|
-
for (const { chainId, balance } of results) {
|
|
1854
|
+
for (const { chainId, balance, rawBalance } of results) {
|
|
1835
1855
|
spokeShares[chainId] = balance;
|
|
1856
|
+
rawSpokeShares[chainId] = rawBalance;
|
|
1836
1857
|
}
|
|
1837
1858
|
}
|
|
1838
1859
|
}
|
|
@@ -1852,6 +1873,7 @@ async function getUserPositionMultiChain(vault, user) {
|
|
|
1852
1873
|
return {
|
|
1853
1874
|
hubShares,
|
|
1854
1875
|
spokeShares,
|
|
1876
|
+
rawSpokeShares,
|
|
1855
1877
|
totalShares,
|
|
1856
1878
|
estimatedAssets,
|
|
1857
1879
|
sharePrice,
|