@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.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
2
|
-
import { j as VaultStatus, h as VaultMetadata, g as UserPosition, e as MultiChainUserPosition, b as AsyncRequestStatusInfo, l as VaultTopology, V as VaultDistribution, d as InboundRouteWithBalance } from '../spokeRoutes-
|
|
2
|
+
import { j as VaultStatus, h as VaultMetadata, g as UserPosition, e as MultiChainUserPosition, b as AsyncRequestStatusInfo, l as VaultTopology, V as VaultDistribution, d as InboundRouteWithBalance } from '../spokeRoutes-FgKCJQYa.cjs';
|
|
3
3
|
import * as _tanstack_query_core from '@tanstack/query-core';
|
|
4
4
|
import { Address } from 'viem';
|
|
5
5
|
|
package/dist/react/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
2
|
-
import { j as VaultStatus, h as VaultMetadata, g as UserPosition, e as MultiChainUserPosition, b as AsyncRequestStatusInfo, l as VaultTopology, V as VaultDistribution, d as InboundRouteWithBalance } from '../spokeRoutes-
|
|
2
|
+
import { j as VaultStatus, h as VaultMetadata, g as UserPosition, e as MultiChainUserPosition, b as AsyncRequestStatusInfo, l as VaultTopology, V as VaultDistribution, d as InboundRouteWithBalance } from '../spokeRoutes-FgKCJQYa.js';
|
|
3
3
|
import * as _tanstack_query_core from '@tanstack/query-core';
|
|
4
4
|
import { Address } from 'viem';
|
|
5
5
|
|
package/dist/react/index.js
CHANGED
|
@@ -101,10 +101,12 @@ var OFT_ROUTES = {
|
|
|
101
101
|
]: { oft: "0x19cFCE47eD54a88614648DC3f19A5980097007dD", token: "0x94b008aA00579c1307B0EF2c499aD98a8ce58e58" }
|
|
102
102
|
},
|
|
103
103
|
/**
|
|
104
|
-
*
|
|
104
|
+
* USDF — USD Flow OFT. Bridges PYUSD (Ethereum) ↔ USDF (Flow EVM).
|
|
105
|
+
* On Ethereum: underlying is PayPal USD (PYUSD, 0x6c3ea9...).
|
|
106
|
+
* On Flow: the OFT itself IS the token (USDF, 0x2aabea...).
|
|
105
107
|
* Routes verified: Eth→Flow ✓
|
|
106
108
|
*/
|
|
107
|
-
|
|
109
|
+
USDF: {
|
|
108
110
|
[
|
|
109
111
|
747
|
|
110
112
|
/* flowEVMMainnet */
|
|
@@ -114,6 +116,23 @@ var OFT_ROUTES = {
|
|
|
114
116
|
/* ethereum */
|
|
115
117
|
]: { oft: "0xfa0e06b54986ad96de87a8c56fea76fbd8d493f8", token: "0x6c3ea9036406852006290770BEdFcAbA0e23A0e8" }
|
|
116
118
|
},
|
|
119
|
+
/**
|
|
120
|
+
* PYUSD — PayPal USD bridged via OFTAdapter (Paxos / LayerZero).
|
|
121
|
+
* Lock/mint architecture: locks PYUSD on Arbitrum, mints PYUSD0 on Flow EVM.
|
|
122
|
+
* On Arbitrum: OFTAdapter wraps native PYUSD (0x46850a...).
|
|
123
|
+
* On Flow: OFTAdapter wraps PYUSD0 (0x99aF3E...), which is the native Paxos token.
|
|
124
|
+
* Routes verified: Arb↔Flow ✓ (EID 30336). No Eth or Base peers.
|
|
125
|
+
*/
|
|
126
|
+
PYUSD: {
|
|
127
|
+
[
|
|
128
|
+
747
|
|
129
|
+
/* flowEVMMainnet */
|
|
130
|
+
]: { oft: "0x26d27d5AF2F6f1c14F40013C8619d97aaf015509", token: "0x99aF3EeA856556646C98c8B9b2548Fe815240750" },
|
|
131
|
+
[
|
|
132
|
+
42161
|
|
133
|
+
/* arbitrum */
|
|
134
|
+
]: { oft: "0x3CD2b89C49D130C08f1d683225b2e5DeB63ff876", token: "0x46850aD61C2B7d64d08c9C754F45254596696984" }
|
|
135
|
+
},
|
|
117
136
|
/**
|
|
118
137
|
* WFLOW — Wrapped FLOW NativeOFTAdapter (issued by Flow Foundation).
|
|
119
138
|
* Routes verified: Eth→Flow ✓
|
|
@@ -1773,6 +1792,7 @@ async function getUserPositionMultiChain(vault, user) {
|
|
|
1773
1792
|
});
|
|
1774
1793
|
const [withdrawShares, timelockEndsAt] = withdrawalRequest;
|
|
1775
1794
|
const spokeShares = {};
|
|
1795
|
+
const rawSpokeShares = {};
|
|
1776
1796
|
if (topo.spokeChainIds.length > 0) {
|
|
1777
1797
|
let hubShareOft = null;
|
|
1778
1798
|
try {
|
|
@@ -1795,7 +1815,7 @@ async function getUserPositionMultiChain(vault, user) {
|
|
|
1795
1815
|
const spokePromises = topo.spokeChainIds.map(async (spokeChainId) => {
|
|
1796
1816
|
try {
|
|
1797
1817
|
const spokeEid = CHAIN_ID_TO_EID[spokeChainId];
|
|
1798
|
-
if (!spokeEid) return { chainId: spokeChainId, balance: 0n };
|
|
1818
|
+
if (!spokeEid) return { chainId: spokeChainId, balance: 0n, rawBalance: 0n };
|
|
1799
1819
|
const spokeOftBytes32 = await hubClient.readContract({
|
|
1800
1820
|
address: hubShareOft,
|
|
1801
1821
|
abi: OFT_ABI,
|
|
@@ -1804,10 +1824,10 @@ async function getUserPositionMultiChain(vault, user) {
|
|
|
1804
1824
|
});
|
|
1805
1825
|
const spokeOft = getAddress(`0x${spokeOftBytes32.slice(-40)}`);
|
|
1806
1826
|
if (spokeOft === "0x0000000000000000000000000000000000000000") {
|
|
1807
|
-
return { chainId: spokeChainId, balance: 0n };
|
|
1827
|
+
return { chainId: spokeChainId, balance: 0n, rawBalance: 0n };
|
|
1808
1828
|
}
|
|
1809
1829
|
const spokeClient = createChainClient(spokeChainId);
|
|
1810
|
-
if (!spokeClient) return { chainId: spokeChainId, balance: 0n };
|
|
1830
|
+
if (!spokeClient) return { chainId: spokeChainId, balance: 0n, rawBalance: 0n };
|
|
1811
1831
|
const [rawBalance, spokeOftDecimals] = await spokeClient.multicall({
|
|
1812
1832
|
contracts: [
|
|
1813
1833
|
{ address: spokeOft, abi: ERC20_ABI, functionName: "balanceOf", args: [u] },
|
|
@@ -1823,14 +1843,15 @@ async function getUserPositionMultiChain(vault, user) {
|
|
|
1823
1843
|
} else {
|
|
1824
1844
|
balance = rawBalance;
|
|
1825
1845
|
}
|
|
1826
|
-
return { chainId: spokeChainId, balance };
|
|
1846
|
+
return { chainId: spokeChainId, balance, rawBalance };
|
|
1827
1847
|
} catch {
|
|
1828
|
-
return { chainId: spokeChainId, balance: 0n };
|
|
1848
|
+
return { chainId: spokeChainId, balance: 0n, rawBalance: 0n };
|
|
1829
1849
|
}
|
|
1830
1850
|
});
|
|
1831
1851
|
const results = await Promise.all(spokePromises);
|
|
1832
|
-
for (const { chainId, balance } of results) {
|
|
1852
|
+
for (const { chainId, balance, rawBalance } of results) {
|
|
1833
1853
|
spokeShares[chainId] = balance;
|
|
1854
|
+
rawSpokeShares[chainId] = rawBalance;
|
|
1834
1855
|
}
|
|
1835
1856
|
}
|
|
1836
1857
|
}
|
|
@@ -1850,6 +1871,7 @@ async function getUserPositionMultiChain(vault, user) {
|
|
|
1850
1871
|
return {
|
|
1851
1872
|
hubShares,
|
|
1852
1873
|
spokeShares,
|
|
1874
|
+
rawSpokeShares,
|
|
1853
1875
|
totalShares,
|
|
1854
1876
|
estimatedAssets,
|
|
1855
1877
|
sharePrice,
|