@bluxcc/react 0.2.7 → 0.2.8
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/Provider.d.ts +31 -0
- package/dist/hooks/useBlux.d.ts +26 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.esm.js +1 -1
- package/dist/useStellar/index.d.ts +4 -0
- package/dist/useStellar/useAccount.d.ts +25 -0
- package/dist/useStellar/useAccounts.d.ts +23 -0
- package/dist/useStellar/useAssets.d.ts +18 -0
- package/dist/useStellar/useBalances.d.ts +21 -0
- package/dist/useStellar/useClaimableBalances.d.ts +20 -0
- package/dist/useStellar/useEffects.d.ts +21 -0
- package/dist/useStellar/useLedgers.d.ts +18 -0
- package/dist/useStellar/useLiquidityPools.d.ts +21 -0
- package/dist/useStellar/useNetwork.d.ts +16 -0
- package/dist/useStellar/useOffers.d.ts +19 -0
- package/dist/useStellar/useOperations.d.ts +20 -0
- package/dist/useStellar/useOrderbook.d.ts +19 -0
- package/dist/useStellar/usePayments.d.ts +23 -3
- package/dist/useStellar/useReadContracts.d.ts +24 -0
- package/dist/useStellar/useSacAddress.d.ts +45 -0
- package/dist/useStellar/useStrictReceivePaths.d.ts +24 -0
- package/dist/useStellar/useStrictSendPaths.d.ts +22 -0
- package/dist/useStellar/useSwap.d.ts +67 -0
- package/dist/useStellar/useSwitchNetwork.d.ts +22 -5
- package/dist/useStellar/useTokenMetadata.d.ts +40 -0
- package/dist/useStellar/useTradeAggregation.d.ts +25 -0
- package/dist/useStellar/useTrades.d.ts +20 -0
- package/dist/useStellar/useTransactions.d.ts +18 -0
- package/dist/useStellar/useTransfer.d.ts +60 -0
- package/dist/useStellar/useWriteContract.d.ts +36 -0
- package/package.json +3 -3
package/dist/Provider.d.ts
CHANGED
|
@@ -4,5 +4,36 @@ type BluxProviderProps = {
|
|
|
4
4
|
config: IConfig;
|
|
5
5
|
children: React.ReactNode | any;
|
|
6
6
|
};
|
|
7
|
+
/**
|
|
8
|
+
* Root provider that initializes Blux; it must wrap any part of the app that
|
|
9
|
+
* uses Blux hooks.
|
|
10
|
+
*
|
|
11
|
+
* It applies your `config` (and its optional `appearance`) via the core
|
|
12
|
+
* `createConfig` / `setAppearance`, mounts the host element the wallet modal
|
|
13
|
+
* renders into, and supplies the TanStack `QueryClient` that every query and
|
|
14
|
+
* mutation hook depends on. Place it near the root of your tree.
|
|
15
|
+
*
|
|
16
|
+
* @param props - Component props.
|
|
17
|
+
* @param props.config - The Blux `IConfig` (`appId`, `appName`, `networks`,
|
|
18
|
+
* optional `defaultNetwork` / `appearance` / `loginMethods` / …) used to
|
|
19
|
+
* initialize the SDK.
|
|
20
|
+
* @param props.children - Your application tree.
|
|
21
|
+
* @returns The provider element wrapping `children`.
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```tsx
|
|
25
|
+
* import { BluxProvider, networks } from '@bluxcc/react';
|
|
26
|
+
*
|
|
27
|
+
* const config = {
|
|
28
|
+
* appId: 'your-app-id',
|
|
29
|
+
* appName: 'My App',
|
|
30
|
+
* networks: [networks.testnet],
|
|
31
|
+
* };
|
|
32
|
+
*
|
|
33
|
+
* <BluxProvider config={config}>
|
|
34
|
+
* <App />
|
|
35
|
+
* </BluxProvider>;
|
|
36
|
+
* ```
|
|
37
|
+
*/
|
|
7
38
|
export declare const BluxProvider: ({ config, children }: BluxProviderProps) => React.JSX.Element;
|
|
8
39
|
export {};
|
package/dist/hooks/useBlux.d.ts
CHANGED
|
@@ -1,3 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The primary wallet/session hook: returns the live `blux` instance and
|
|
3
|
+
* re-renders when the connected user or auth state changes.
|
|
4
|
+
*
|
|
5
|
+
* Use it to drive authentication and signing from the UI. The returned object
|
|
6
|
+
* exposes session actions (`login`, `logout`, `fundMe`, `profile`), signing and
|
|
7
|
+
* submission (`signTransaction`, `signMessage`, `signAuthEntry`,
|
|
8
|
+
* `sendTransaction`), and reactive state (`user`, `isAuthenticated`, `isReady`).
|
|
9
|
+
*
|
|
10
|
+
* @returns The reactive `blux` instance.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```tsx
|
|
14
|
+
* const blux = useBlux();
|
|
15
|
+
*
|
|
16
|
+
* if (!blux.isAuthenticated) {
|
|
17
|
+
* return <button onClick={() => blux.login()}>Connect wallet</button>;
|
|
18
|
+
* }
|
|
19
|
+
* return (
|
|
20
|
+
* <>
|
|
21
|
+
* <span>{blux.user?.address}</span>
|
|
22
|
+
* <button onClick={() => blux.logout()}>Disconnect</button>
|
|
23
|
+
* </>
|
|
24
|
+
* );
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
1
27
|
export declare const useBlux: () => {
|
|
2
28
|
login: () => Promise<import("@bluxcc/core/dist/store").IUser>;
|
|
3
29
|
logout: () => void;
|
package/dist/index.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("@bluxcc/core"),n=require("@stellar/stellar-sdk"),o=require("react"),l=require("@tanstack/react-query");const r=n=>{const{user:o}=e.getState();return n||(null==o?void 0:o.address)},u=n=>{const{stellar:o}=e.getState();return!n&&o?o.activeNetwork:n};const t=new l.QueryClient;Object.defineProperty(exports,"networks",{enumerable:!0,get:function(){return e.networks}}),Object.defineProperty(exports,"setAppearance",{enumerable:!0,get:function(){return e.setAppearance}}),Object.defineProperty(exports,"Asset",{enumerable:!0,get:function(){return n.Asset}}),exports.BluxProvider=({config:n,children:r})=>{const u=o.useRef(null),{appearance:i,...s}=null!=n?n:{},d=o.useMemo(()=>s,[JSON.stringify(s)]);return o.useEffect(()=>{u.current&&e.createConfig(n,u.current)},[u,d]),o.useEffect(()=>{u.current&&e.setAppearance(null!=i?i:{})},[u,i]),o.createElement(l.QueryClientProvider,{client:t},o.createElement("div",{ref:u},r))},exports.useAccount=function(n,t){var i;const s=r(null==n?void 0:n.address),d=u(null==n?void 0:n.network),a=null===(i=null==t?void 0:t.enabled)||void 0===i||i,c=[s,d],v=o.useMemo(()=>["blux","account",d,...c],[d,...c]),y=o.useMemo(()=>async()=>{const o={...n,address:s,network:d};return e.getAccount(o)},[d,...c]);return l.useQuery({...t,enabled:a,queryKey:v,queryFn:y})},exports.useAccounts=function(n,r){var t;const i=u(null==n?void 0:n.network),s=null===(t=null==r?void 0:r.enabled)||void 0===t||t,d=[null==n?void 0:n.forSigner,null==n?void 0:n.forAsset,null==n?void 0:n.sponsor,null==n?void 0:n.forLiquidityPool,null==n?void 0:n.cursor,null==n?void 0:n.limit,null==n?void 0:n.network,null==n?void 0:n.order],a=o.useMemo(()=>["blux","accounts",i,...d],[i,...d]),c=o.useMemo(()=>async()=>{const o={...n,network:i};return e.getAccounts(o)},[i,...d]);return l.useQuery({...r,enabled:s,queryKey:a,queryFn:c})},exports.useAssets=function(n,r){var t;const i=u(null==n?void 0:n.network),s=null===(t=null==r?void 0:r.enabled)||void 0===t||t,d=[null==n?void 0:n.forCode,null==n?void 0:n.forIssuer,null==n?void 0:n.cursor,null==n?void 0:n.limit,null==n?void 0:n.network,null==n?void 0:n.order],a=o.useMemo(()=>["blux","assets",i,...d],[i,n,...d]),c=o.useMemo(()=>async()=>{const o={...n,network:i};return e.getAssets(o)},[i,n,...d]);return l.useQuery({...r,enabled:s,queryKey:a,queryFn:c})},exports.useBalances=function(n,t){var i,s;const d=r(null==n?void 0:n.address),a=u(null==n?void 0:n.network),c=null===(i=null==t?void 0:t.enabled)||void 0===i||i,v=null===(s=null==n?void 0:n.includeZeroBalances)||void 0===s||s,y=[d,a,v],f=o.useMemo(()=>["blux","balances",a,...y],[a,...y]),b=o.useMemo(()=>async()=>{const o={...n,address:d,includeZeroBalances:v,network:a};return e.getBalances(o)},[a,...y]);return l.useQuery({...t,enabled:c,queryKey:f,queryFn:b})},exports.useBlux=()=>{const[n,l]=o.useState(e.blux),r=e.useExportedStore(e=>e.user),u=e.useExportedStore(e=>e.authState);return o.useEffect(()=>{l(e.blux)},[r,u]),n},exports.useClaimableBalances=function(n,t){var i;const s=r(n.claimant),d=u(null==n?void 0:n.network),a=null===(i=null==t?void 0:t.enabled)||void 0===i||i,c=[s,null==n?void 0:n.asset,null==n?void 0:n.sponsor,null==n?void 0:n.cursor,null==n?void 0:n.limit,null==n?void 0:n.network,null==n?void 0:n.order],v=o.useMemo(()=>["blux","claimableBalances",d,...c],[d,...c]),y=o.useMemo(()=>async()=>{const o={...n,claimant:s,network:d};return e.getClaimableBalances(o)},[d,...c]);return l.useQuery({...t,enabled:a,queryKey:v,queryFn:y})},exports.useEffects=function(n,r){var t;const i=u(null==n?void 0:n.network),s=null===(t=null==r?void 0:r.enabled)||void 0===t||t,d=[null==n?void 0:n.forAccount,null==n?void 0:n.forLedger,null==n?void 0:n.forTransaction,null==n?void 0:n.forOperation,null==n?void 0:n.forLiquidityPool,null==n?void 0:n.cursor,null==n?void 0:n.limit,null==n?void 0:n.network,null==n?void 0:n.order],a=o.useMemo(()=>["blux","effects",i,...d],[i,...d]),c=o.useMemo(()=>async()=>{const o={...n,network:i};return e.getEffects(o)},[i,...d]);return l.useQuery({...r,enabled:s,queryKey:a,queryFn:c})},exports.useLedgers=function(n,r){var t;const i=u(null==n?void 0:n.network),s=null===(t=null==r?void 0:r.enabled)||void 0===t||t,d=[null==n?void 0:n.ledger,null==n?void 0:n.cursor,null==n?void 0:n.limit,null==n?void 0:n.network,null==n?void 0:n.order],a=o.useMemo(()=>["blux","ledgers",i,...d],[i,n,...d]),c=o.useMemo(()=>async()=>{const o={...n,network:i};return e.getLedgers(o)},[i,n,...d]);return l.useQuery({...r,enabled:s,queryKey:a,queryFn:c})},exports.useLiquidityPools=function(n,r){var t;const i=u(null==n?void 0:n.network),s=null===(t=null==r?void 0:r.enabled)||void 0===t||t,d=[null==n?void 0:n.forAccount,null==n?void 0:n.forAssets,null==n?void 0:n.cursor,null==n?void 0:n.limit,null==n?void 0:n.network,null==n?void 0:n.order],a=o.useMemo(()=>["blux","liquidityPools",i,...d],[i,...d]),c=o.useMemo(()=>async()=>{const o={...n,network:i};return e.getLiquidityPools(o)},[i,...d]);return l.useQuery({...r,enabled:s,queryKey:a,queryFn:c})},exports.useNetwork=()=>{var n;const l=e.useExportedStore(e=>e),[r,u]=o.useState((null===(n=l.stellar)||void 0===n?void 0:n.activeNetwork)||l.config.defaultNetwork);return o.useEffect(()=>{var e;u((null===(e=l.stellar)||void 0===e?void 0:e.activeNetwork)||l.config.defaultNetwork)},[l.stellar,l.config]),r},exports.useOffers=function(n,r){var t;const i=u(null==n?void 0:n.network),s=null===(t=null==r?void 0:r.enabled)||void 0===t||t,d=[null==n?void 0:n.forAccount,null==n?void 0:n.buying,null==n?void 0:n.selling,null==n?void 0:n.sponsor,null==n?void 0:n.seller,null==n?void 0:n.cursor,null==n?void 0:n.limit,null==n?void 0:n.network,null==n?void 0:n.order],a=o.useMemo(()=>["blux","offers",i,...d],[i,...d]),c=o.useMemo(()=>async()=>{const o={...n,network:i};return e.getOffers(o)},[i,...d]);return l.useQuery({...r,enabled:s,queryKey:a,queryFn:c})},exports.useOperations=function(n,r){var t;const i=u(null==n?void 0:n.network),s=null===(t=null==r?void 0:r.enabled)||void 0===t||t,d=[null==n?void 0:n.forAccount,null==n?void 0:n.includeFailed,null==n?void 0:n.forClaimableBalance,null==n?void 0:n.forLedger,null==n?void 0:n.forTransaction,null==n?void 0:n.forLiquidityPool,null==n?void 0:n.forAccount,null==n?void 0:n.cursor,null==n?void 0:n.limit,null==n?void 0:n.network,null==n?void 0:n.order],a=o.useMemo(()=>["blux","operations",i,...d],[i,...d]),c=o.useMemo(()=>async()=>{const o={...n,network:i};return e.getOperations(o)},[i,n,...d]);return l.useQuery({...r,enabled:s,queryKey:a,queryFn:c})},exports.useOrderbook=function(n,r,t){var i;const s=u(null==r?void 0:r.network),d=null===(i=null==t?void 0:t.enabled)||void 0===i||i,a=[n[0],n[1],null==r?void 0:r.cursor,null==r?void 0:r.limit,null==r?void 0:r.network,null==r?void 0:r.order],c=o.useMemo(()=>["blux","orderbook",s,...a],[s,r,...a]),v=o.useMemo(()=>async()=>{const o={...r,network:s};return e.getOrderbook(n,o)},[s,r,...a]);return l.useQuery({...t,enabled:d,queryKey:c,queryFn:v})},exports.usePayments=function(n,r){var t;const i=u(null==n?void 0:n.network),s=null===(t=null==r?void 0:r.enabled)||void 0===t||t,d=[null==n?void 0:n.forAccount,null==n?void 0:n.includeFailed,null==n?void 0:n.forLedger,null==n?void 0:n.forTransaction,null==n?void 0:n.cursor,null==n?void 0:n.limit,null==n?void 0:n.network,null==n?void 0:n.order],a=o.useMemo(()=>["blux","payments",i,...d],[i,...d]),c=o.useMemo(()=>async()=>{const o={...n,network:i};return e.getPayments(o)},[i,...d]);return l.useQuery({...r,enabled:s,queryKey:a,queryFn:c})},exports.useReadContracts=function(n,r,t){var i;const s=u(null==r?void 0:r.network),d=null===(i=null==t?void 0:t.enabled)||void 0===i||i,a=o.useMemo(()=>JSON.stringify((null!=n?n:[]).map(e=>{var n;return{address:null==e?void 0:e.address,fn:null==e?void 0:e.fn,args:(null!==(n=null==e?void 0:e.args)&&void 0!==n?n:[]).map(e=>e.toXDR("base64"))}})),[n]),c=[s,a],v=o.useMemo(()=>["blux","readContracts",s,a],[...c]),y=o.useMemo(()=>async()=>{const o={...r,network:s};return e.readContracts(n,o)},[...c]);return l.useQuery({...t,enabled:d,queryKey:v,queryFn:y})},exports.useStrictReceivePaths=function(n,r,t){var i;const s=u(null==r?void 0:r.network),d=null===(i=null==t?void 0:t.enabled)||void 0===i||i,a=[n[0],n[1],n[2],null==r?void 0:r.cursor,null==r?void 0:r.limit,null==r?void 0:r.network,null==r?void 0:r.order],c=o.useMemo(()=>["blux","strictReceivePaths",s,...a],[s,r,...a]),v=o.useMemo(()=>async()=>{const o={...r,network:s};return e.getStrictReceivePaths(n,o)},[s,r,...a]);return l.useQuery({...t,enabled:d,queryKey:c,queryFn:v})},exports.useStrictSendPaths=function(n,r,t){var i;const s=u(null==r?void 0:r.network),d=null===(i=null==t?void 0:t.enabled)||void 0===i||i,a=[n[0],n[1],n[2],null==r?void 0:r.cursor,null==r?void 0:r.limit,null==r?void 0:r.network,null==r?void 0:r.order],c=o.useMemo(()=>["blux","strictSendPaths",s,...a],[s,r,...a]),v=o.useMemo(()=>async()=>{const o={...r,network:s};return e.getStrictSendPaths(n,o)},[s,r,...a]);return l.useQuery({...t,enabled:d,queryKey:c,queryFn:v})},exports.useSwitchNetwork=()=>({networks:e.networks,switchNetwork:e.switchNetwork}),exports.useTradeAggregation=function(n,r,t){var i;const s=u(null==r?void 0:r.network),d=null===(i=null==t?void 0:t.enabled)||void 0===i||i,a=[n[0],n[1],n[2],n[3],n[4],n[5],null==r?void 0:r.cursor,null==r?void 0:r.limit,null==r?void 0:r.network,null==r?void 0:r.order],c=o.useMemo(()=>["blux","tradeAggregation",s,...a],[s,r,...a]),v=o.useMemo(()=>async()=>{const o={...r,network:s};return e.getTradeAggregation(n,o)},[s,r,...a]);return l.useQuery({...t,enabled:d,queryKey:c,queryFn:v})},exports.useTrades=function(n,r){var t;const i=u(null==n?void 0:n.network),s=null===(t=null==r?void 0:r.enabled)||void 0===t||t,d=[null==n?void 0:n.forAssetPair,null==n?void 0:n.forOffer,null==n?void 0:n.forType,null==n?void 0:n.forLiquidityPool,null==n?void 0:n.forAccount,null==n?void 0:n.cursor,null==n?void 0:n.limit,null==n?void 0:n.network,null==n?void 0:n.order],a=o.useMemo(()=>["blux","trades",i,...d],[i,...d]),c=o.useMemo(()=>async()=>{const o={...n,network:i};return e.getTrades(o)},[i,...d]);return l.useQuery({...r,enabled:s,queryKey:a,queryFn:c})},exports.useTransactions=function(n,r){var t;const i=u(null==n?void 0:n.network),s=null===(t=null==r?void 0:r.enabled)||void 0===t||t,d=[null==n?void 0:n.forAccount,null==n?void 0:n.includeFailed,null==n?void 0:n.forClaimableBalance,null==n?void 0:n.forLedger,null==n?void 0:n.forLiquidityPool,null==n?void 0:n.cursor,null==n?void 0:n.limit,null==n?void 0:n.network,null==n?void 0:n.order],a=o.useMemo(()=>["blux","transactions",i,...d],[i,...d]),c=o.useMemo(()=>async()=>{const o={...n,network:i};return e.getTransactions(o)},[i,...d]);return l.useQuery({...r,enabled:s,queryKey:a,queryFn:c})},exports.useWriteContract=function(n){return l.useMutation({...n,mutationFn:async({call:n,options:o})=>e.writeContract(n,o)})};
|
|
1
|
+
"use strict";var e=require("@bluxcc/core"),n=require("@stellar/stellar-sdk"),r=require("react"),t=require("@tanstack/react-query");const o=n=>{const{user:r}=e.getState();return n||(null==r?void 0:r.address)},u=n=>{const{stellar:r}=e.getState();return!n&&r?r.activeNetwork:n};const l=new t.QueryClient;Object.defineProperty(exports,"BluxEvent",{enumerable:!0,get:function(){return e.BluxEvent}}),Object.defineProperty(exports,"StellarSdk",{enumerable:!0,get:function(){return e.StellarSdk}}),Object.defineProperty(exports,"ToScVal",{enumerable:!0,get:function(){return e.ToScVal}}),Object.defineProperty(exports,"events",{enumerable:!0,get:function(){return e.events}}),Object.defineProperty(exports,"getAccount",{enumerable:!0,get:function(){return e.getAccount}}),Object.defineProperty(exports,"getAccounts",{enumerable:!0,get:function(){return e.getAccounts}}),Object.defineProperty(exports,"getAssets",{enumerable:!0,get:function(){return e.getAssets}}),Object.defineProperty(exports,"getBalances",{enumerable:!0,get:function(){return e.getBalances}}),Object.defineProperty(exports,"getClaimableBalances",{enumerable:!0,get:function(){return e.getClaimableBalances}}),Object.defineProperty(exports,"getEffects",{enumerable:!0,get:function(){return e.getEffects}}),Object.defineProperty(exports,"getInitialState",{enumerable:!0,get:function(){return e.getInitialState}}),Object.defineProperty(exports,"getLedgers",{enumerable:!0,get:function(){return e.getLedgers}}),Object.defineProperty(exports,"getLiquidityPools",{enumerable:!0,get:function(){return e.getLiquidityPools}}),Object.defineProperty(exports,"getNetwork",{enumerable:!0,get:function(){return e.getNetwork}}),Object.defineProperty(exports,"getOffers",{enumerable:!0,get:function(){return e.getOffers}}),Object.defineProperty(exports,"getOperations",{enumerable:!0,get:function(){return e.getOperations}}),Object.defineProperty(exports,"getOrderbook",{enumerable:!0,get:function(){return e.getOrderbook}}),Object.defineProperty(exports,"getPayments",{enumerable:!0,get:function(){return e.getPayments}}),Object.defineProperty(exports,"getSacAddress",{enumerable:!0,get:function(){return e.getSacAddress}}),Object.defineProperty(exports,"getState",{enumerable:!0,get:function(){return e.getState}}),Object.defineProperty(exports,"getStrictReceivePaths",{enumerable:!0,get:function(){return e.getStrictReceivePaths}}),Object.defineProperty(exports,"getStrictSendPaths",{enumerable:!0,get:function(){return e.getStrictSendPaths}}),Object.defineProperty(exports,"getTokenMetadata",{enumerable:!0,get:function(){return e.getTokenMetadata}}),Object.defineProperty(exports,"getTradeAggregation",{enumerable:!0,get:function(){return e.getTradeAggregation}}),Object.defineProperty(exports,"getTrades",{enumerable:!0,get:function(){return e.getTrades}}),Object.defineProperty(exports,"getTransactions",{enumerable:!0,get:function(){return e.getTransactions}}),Object.defineProperty(exports,"networks",{enumerable:!0,get:function(){return e.networks}}),Object.defineProperty(exports,"numberish",{enumerable:!0,get:function(){return e.numberish}}),Object.defineProperty(exports,"readContracts",{enumerable:!0,get:function(){return e.readContracts}}),Object.defineProperty(exports,"setAppearance",{enumerable:!0,get:function(){return e.setAppearance}}),Object.defineProperty(exports,"subscribe",{enumerable:!0,get:function(){return e.subscribe}}),Object.defineProperty(exports,"swap",{enumerable:!0,get:function(){return e.swap}}),Object.defineProperty(exports,"switchNetwork",{enumerable:!0,get:function(){return e.switchNetwork}}),Object.defineProperty(exports,"useExportedStore",{enumerable:!0,get:function(){return e.useExportedStore}}),Object.defineProperty(exports,"writeContract",{enumerable:!0,get:function(){return e.writeContract}}),Object.defineProperty(exports,"Asset",{enumerable:!0,get:function(){return n.Asset}}),exports.BluxProvider=({config:n,children:o})=>{const u=r.useRef(null),{appearance:s,...i}=null!=n?n:{},d=r.useMemo(()=>i,[JSON.stringify(i)]);return r.useEffect(()=>{u.current&&e.createConfig(n,u.current)},[u,d]),r.useEffect(()=>{u.current&&e.setAppearance(null!=s?s:{})},[u,s]),r.createElement(t.QueryClientProvider,{client:l},r.createElement("div",{ref:u},o))},exports.useAccount=function(n,l){var s;const i=o(null==n?void 0:n.address),d=u(null==n?void 0:n.network),a=null===(s=null==l?void 0:l.enabled)||void 0===s||s,c=[i,d],v=r.useMemo(()=>["blux","account",d,...c],[d,...c]),f=r.useMemo(()=>async()=>{const r={...n,address:i,network:d};return e.getAccount(r)},[d,...c]);return t.useQuery({...l,enabled:a,queryKey:v,queryFn:f})},exports.useAccounts=function(n,o){var l;const s=u(null==n?void 0:n.network),i=null===(l=null==o?void 0:o.enabled)||void 0===l||l,d=[null==n?void 0:n.forSigner,null==n?void 0:n.forAsset,null==n?void 0:n.sponsor,null==n?void 0:n.forLiquidityPool,null==n?void 0:n.cursor,null==n?void 0:n.limit,null==n?void 0:n.network,null==n?void 0:n.order],a=r.useMemo(()=>["blux","accounts",s,...d],[s,...d]),c=r.useMemo(()=>async()=>{const r={...n,network:s};return e.getAccounts(r)},[s,...d]);return t.useQuery({...o,enabled:i,queryKey:a,queryFn:c})},exports.useAssets=function(n,o){var l;const s=u(null==n?void 0:n.network),i=null===(l=null==o?void 0:o.enabled)||void 0===l||l,d=[null==n?void 0:n.forCode,null==n?void 0:n.forIssuer,null==n?void 0:n.cursor,null==n?void 0:n.limit,null==n?void 0:n.network,null==n?void 0:n.order],a=r.useMemo(()=>["blux","assets",s,...d],[s,n,...d]),c=r.useMemo(()=>async()=>{const r={...n,network:s};return e.getAssets(r)},[s,n,...d]);return t.useQuery({...o,enabled:i,queryKey:a,queryFn:c})},exports.useBalances=function(n,l){var s,i;const d=o(null==n?void 0:n.address),a=u(null==n?void 0:n.network),c=null===(s=null==l?void 0:l.enabled)||void 0===s||s,v=null===(i=null==n?void 0:n.includeZeroBalances)||void 0===i||i,f=[d,a,v],y=r.useMemo(()=>["blux","balances",a,...f],[a,...f]),b=r.useMemo(()=>async()=>{const r={...n,address:d,includeZeroBalances:v,network:a};return e.getBalances(r)},[a,...f]);return t.useQuery({...l,enabled:c,queryKey:y,queryFn:b})},exports.useBlux=()=>{const[n,t]=r.useState(e.blux),o=e.useExportedStore(e=>e.user),u=e.useExportedStore(e=>e.authState);return r.useEffect(()=>{t(e.blux)},[o,u]),n},exports.useClaimableBalances=function(n,l){var s;const i=o(n.claimant),d=u(null==n?void 0:n.network),a=null===(s=null==l?void 0:l.enabled)||void 0===s||s,c=[i,null==n?void 0:n.asset,null==n?void 0:n.sponsor,null==n?void 0:n.cursor,null==n?void 0:n.limit,null==n?void 0:n.network,null==n?void 0:n.order],v=r.useMemo(()=>["blux","claimableBalances",d,...c],[d,...c]),f=r.useMemo(()=>async()=>{const r={...n,claimant:i,network:d};return e.getClaimableBalances(r)},[d,...c]);return t.useQuery({...l,enabled:a,queryKey:v,queryFn:f})},exports.useEffects=function(n,o){var l;const s=u(null==n?void 0:n.network),i=null===(l=null==o?void 0:o.enabled)||void 0===l||l,d=[null==n?void 0:n.forAccount,null==n?void 0:n.forLedger,null==n?void 0:n.forTransaction,null==n?void 0:n.forOperation,null==n?void 0:n.forLiquidityPool,null==n?void 0:n.cursor,null==n?void 0:n.limit,null==n?void 0:n.network,null==n?void 0:n.order],a=r.useMemo(()=>["blux","effects",s,...d],[s,...d]),c=r.useMemo(()=>async()=>{const r={...n,network:s};return e.getEffects(r)},[s,...d]);return t.useQuery({...o,enabled:i,queryKey:a,queryFn:c})},exports.useLedgers=function(n,o){var l;const s=u(null==n?void 0:n.network),i=null===(l=null==o?void 0:o.enabled)||void 0===l||l,d=[null==n?void 0:n.ledger,null==n?void 0:n.cursor,null==n?void 0:n.limit,null==n?void 0:n.network,null==n?void 0:n.order],a=r.useMemo(()=>["blux","ledgers",s,...d],[s,n,...d]),c=r.useMemo(()=>async()=>{const r={...n,network:s};return e.getLedgers(r)},[s,n,...d]);return t.useQuery({...o,enabled:i,queryKey:a,queryFn:c})},exports.useLiquidityPools=function(n,o){var l;const s=u(null==n?void 0:n.network),i=null===(l=null==o?void 0:o.enabled)||void 0===l||l,d=[null==n?void 0:n.forAccount,null==n?void 0:n.forAssets,null==n?void 0:n.cursor,null==n?void 0:n.limit,null==n?void 0:n.network,null==n?void 0:n.order],a=r.useMemo(()=>["blux","liquidityPools",s,...d],[s,...d]),c=r.useMemo(()=>async()=>{const r={...n,network:s};return e.getLiquidityPools(r)},[s,...d]);return t.useQuery({...o,enabled:i,queryKey:a,queryFn:c})},exports.useNetwork=()=>{var n;const t=e.useExportedStore(e=>e),[o,u]=r.useState((null===(n=t.stellar)||void 0===n?void 0:n.activeNetwork)||t.config.defaultNetwork);return r.useEffect(()=>{var e;u((null===(e=t.stellar)||void 0===e?void 0:e.activeNetwork)||t.config.defaultNetwork)},[t.stellar,t.config]),o},exports.useOffers=function(n,o){var l;const s=u(null==n?void 0:n.network),i=null===(l=null==o?void 0:o.enabled)||void 0===l||l,d=[null==n?void 0:n.forAccount,null==n?void 0:n.buying,null==n?void 0:n.selling,null==n?void 0:n.sponsor,null==n?void 0:n.seller,null==n?void 0:n.cursor,null==n?void 0:n.limit,null==n?void 0:n.network,null==n?void 0:n.order],a=r.useMemo(()=>["blux","offers",s,...d],[s,...d]),c=r.useMemo(()=>async()=>{const r={...n,network:s};return e.getOffers(r)},[s,...d]);return t.useQuery({...o,enabled:i,queryKey:a,queryFn:c})},exports.useOperations=function(n,o){var l;const s=u(null==n?void 0:n.network),i=null===(l=null==o?void 0:o.enabled)||void 0===l||l,d=[null==n?void 0:n.forAccount,null==n?void 0:n.includeFailed,null==n?void 0:n.forClaimableBalance,null==n?void 0:n.forLedger,null==n?void 0:n.forTransaction,null==n?void 0:n.forLiquidityPool,null==n?void 0:n.forAccount,null==n?void 0:n.cursor,null==n?void 0:n.limit,null==n?void 0:n.network,null==n?void 0:n.order],a=r.useMemo(()=>["blux","operations",s,...d],[s,...d]),c=r.useMemo(()=>async()=>{const r={...n,network:s};return e.getOperations(r)},[s,n,...d]);return t.useQuery({...o,enabled:i,queryKey:a,queryFn:c})},exports.useOrderbook=function(n,o,l){var s;const i=u(null==o?void 0:o.network),d=null===(s=null==l?void 0:l.enabled)||void 0===s||s,a=[n[0],n[1],null==o?void 0:o.cursor,null==o?void 0:o.limit,null==o?void 0:o.network,null==o?void 0:o.order],c=r.useMemo(()=>["blux","orderbook",i,...a],[i,o,...a]),v=r.useMemo(()=>async()=>{const r={...o,network:i};return e.getOrderbook(n,r)},[i,o,...a]);return t.useQuery({...l,enabled:d,queryKey:c,queryFn:v})},exports.usePayments=function(n,o){var l;const s=u(null==n?void 0:n.network),i=null===(l=null==o?void 0:o.enabled)||void 0===l||l,d=[null==n?void 0:n.forAccount,null==n?void 0:n.includeFailed,null==n?void 0:n.forLedger,null==n?void 0:n.forTransaction,null==n?void 0:n.cursor,null==n?void 0:n.limit,null==n?void 0:n.network,null==n?void 0:n.order],a=r.useMemo(()=>["blux","payments",s,...d],[s,...d]),c=r.useMemo(()=>async()=>{const r={...n,network:s};return e.getPayments(r)},[s,...d]);return t.useQuery({...o,enabled:i,queryKey:a,queryFn:c})},exports.useReadContracts=function(n,o,l){var s;const i=u(null==o?void 0:o.network),d=null===(s=null==l?void 0:l.enabled)||void 0===s||s,a=r.useMemo(()=>JSON.stringify((null!=n?n:[]).map(e=>{var n;return{address:null==e?void 0:e.address,fn:null==e?void 0:e.fn,args:(null!==(n=null==e?void 0:e.args)&&void 0!==n?n:[]).map(e=>e.toXDR("base64"))}})),[n]),c=[i,a],v=r.useMemo(()=>["blux","readContracts",i,a],[...c]),f=r.useMemo(()=>async()=>{const r={...o,network:i};return e.readContracts(n,r)},[...c]);return t.useQuery({...l,enabled:d,queryKey:v,queryFn:f})},exports.useSacAddress=function(n,t){const o=u(t);return r.useMemo(()=>{try{return{data:e.getSacAddress(n,o),error:null}}catch(e){return{data:void 0,error:e}}},[n,o])},exports.useStrictReceivePaths=function(n,o,l){var s;const i=u(null==o?void 0:o.network),d=null===(s=null==l?void 0:l.enabled)||void 0===s||s,a=[n[0],n[1],n[2],null==o?void 0:o.cursor,null==o?void 0:o.limit,null==o?void 0:o.network,null==o?void 0:o.order],c=r.useMemo(()=>["blux","strictReceivePaths",i,...a],[i,o,...a]),v=r.useMemo(()=>async()=>{const r={...o,network:i};return e.getStrictReceivePaths(n,r)},[i,o,...a]);return t.useQuery({...l,enabled:d,queryKey:c,queryFn:v})},exports.useStrictSendPaths=function(n,o,l){var s;const i=u(null==o?void 0:o.network),d=null===(s=null==l?void 0:l.enabled)||void 0===s||s,a=[n[0],n[1],n[2],null==o?void 0:o.cursor,null==o?void 0:o.limit,null==o?void 0:o.network,null==o?void 0:o.order],c=r.useMemo(()=>["blux","strictSendPaths",i,...a],[i,o,...a]),v=r.useMemo(()=>async()=>{const r={...o,network:i};return e.getStrictSendPaths(n,r)},[i,o,...a]);return t.useQuery({...l,enabled:d,queryKey:c,queryFn:v})},exports.useSwap=function(n){const r=t.useMutation({...n,mutationFn:async n=>e.swap(n)});return Object.assign(r,{swap:r.mutate,swapAsync:r.mutateAsync})},exports.useSwitchNetwork=()=>({networks:e.networks,switchNetwork:e.switchNetwork}),exports.useTokenMetadata=function(n,o,l){var s;const i=u(null==o?void 0:o.network),d=(null===(s=null==l?void 0:l.enabled)||void 0===s||s)&&Boolean(n),a=[n,i],c=r.useMemo(()=>["blux","tokenMetadata",...a],[...a]),v=r.useMemo(()=>async()=>{const r={...o,network:i};return e.getTokenMetadata(n,r)},[...a]);return t.useQuery({...l,enabled:d,queryKey:c,queryFn:v})},exports.useTradeAggregation=function(n,o,l){var s;const i=u(null==o?void 0:o.network),d=null===(s=null==l?void 0:l.enabled)||void 0===s||s,a=[n[0],n[1],n[2],n[3],n[4],n[5],null==o?void 0:o.cursor,null==o?void 0:o.limit,null==o?void 0:o.network,null==o?void 0:o.order],c=r.useMemo(()=>["blux","tradeAggregation",i,...a],[i,o,...a]),v=r.useMemo(()=>async()=>{const r={...o,network:i};return e.getTradeAggregation(n,r)},[i,o,...a]);return t.useQuery({...l,enabled:d,queryKey:c,queryFn:v})},exports.useTrades=function(n,o){var l;const s=u(null==n?void 0:n.network),i=null===(l=null==o?void 0:o.enabled)||void 0===l||l,d=[null==n?void 0:n.forAssetPair,null==n?void 0:n.forOffer,null==n?void 0:n.forType,null==n?void 0:n.forLiquidityPool,null==n?void 0:n.forAccount,null==n?void 0:n.cursor,null==n?void 0:n.limit,null==n?void 0:n.network,null==n?void 0:n.order],a=r.useMemo(()=>["blux","trades",s,...d],[s,...d]),c=r.useMemo(()=>async()=>{const r={...n,network:s};return e.getTrades(r)},[s,...d]);return t.useQuery({...o,enabled:i,queryKey:a,queryFn:c})},exports.useTransactions=function(n,o){var l;const s=u(null==n?void 0:n.network),i=null===(l=null==o?void 0:o.enabled)||void 0===l||l,d=[null==n?void 0:n.forAccount,null==n?void 0:n.includeFailed,null==n?void 0:n.forClaimableBalance,null==n?void 0:n.forLedger,null==n?void 0:n.forLiquidityPool,null==n?void 0:n.cursor,null==n?void 0:n.limit,null==n?void 0:n.network,null==n?void 0:n.order],a=r.useMemo(()=>["blux","transactions",s,...d],[s,...d]),c=r.useMemo(()=>async()=>{const r={...n,network:s};return e.getTransactions(r)},[s,...d]);return t.useQuery({...o,enabled:i,queryKey:a,queryFn:c})},exports.useTransfer=function(n){const r=t.useMutation({...n,mutationFn:async n=>e.transfer(n)});return Object.assign(r,{transfer:r.mutate,transferAsync:r.mutateAsync})},exports.useWriteContract=function(n){return t.useMutation({...n,mutationFn:async({call:n,options:r})=>e.writeContract(n,r)})};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
export { setAppearance } from '@bluxcc/core';
|
|
1
|
+
export { getAccount, getAccounts, getAssets, getBalances, getClaimableBalances, getEffects, getLedgers, getLiquidityPools, getNetwork, getOffers, getOperations, getOrderbook, getPayments, getStrictReceivePaths, getStrictSendPaths, getTradeAggregation, getTrades, getTransactions, readContracts, writeContract, swap, getSacAddress, getTokenMetadata, networks, switchNetwork, numberish, ToScVal, setAppearance, events, BluxEvent, StellarSdk, getState, subscribe, getInitialState, useExportedStore, } from '@bluxcc/core';
|
|
2
|
+
export type { Numberish, SwapOptions, SwapType, TokenMetadata, GetTokenMetadataOptions, } from '@bluxcc/core';
|
|
2
3
|
export { Asset } from '@stellar/stellar-sdk';
|
|
3
4
|
export * from './useStellar';
|
|
4
5
|
export { useBlux } from './hooks/useBlux';
|
package/dist/index.esm.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{getState as n,getAccount as l,getAccounts as o,getAssets as r,getBalances as e,getClaimableBalances as u,getEffects as i,getLedgers as d,getLiquidityPools as t,useExportedStore as v,getOffers as c,getOperations as a,getOrderbook as s,getPayments as y,readContracts as f,getStrictReceivePaths as b,getStrictSendPaths as k,getTradeAggregation as w,getTrades as q,getTransactions as m,switchNetwork as x,networks as F,writeContract as g,blux as p,createConfig as K,setAppearance as A}from"@bluxcc/core";export{networks,setAppearance}from"@bluxcc/core";export{Asset}from"@stellar/stellar-sdk";import L,{useMemo as P,useState as N,useEffect as h,useRef as B}from"react";import{useQuery as S,useMutation as C,QueryClient as O,QueryClientProvider as T}from"@tanstack/react-query";const E=l=>{const{user:o}=n();return l||(null==o?void 0:o.address)},J=l=>{const{stellar:o}=n();return!l&&o?o.activeNetwork:l};function R(n,o){var r;const e=E(null==n?void 0:n.address),u=J(null==n?void 0:n.network),i=null===(r=null==o?void 0:o.enabled)||void 0===r||r,d=[e,u],t=P(()=>["blux","account",u,...d],[u,...d]),v=P(()=>async()=>{const o={...n,address:e,network:u};return l(o)},[u,...d]);return S({...o,enabled:i,queryKey:t,queryFn:v})}function Z(n,l){var r;const e=J(null==n?void 0:n.network),u=null===(r=null==l?void 0:l.enabled)||void 0===r||r,i=[null==n?void 0:n.forSigner,null==n?void 0:n.forAsset,null==n?void 0:n.sponsor,null==n?void 0:n.forLiquidityPool,null==n?void 0:n.cursor,null==n?void 0:n.limit,null==n?void 0:n.network,null==n?void 0:n.order],d=P(()=>["blux","accounts",e,...i],[e,...i]),t=P(()=>async()=>{const l={...n,network:e};return o(l)},[e,...i]);return S({...l,enabled:u,queryKey:d,queryFn:t})}function D(n,l){var o;const e=J(null==n?void 0:n.network),u=null===(o=null==l?void 0:l.enabled)||void 0===o||o,i=[null==n?void 0:n.forCode,null==n?void 0:n.forIssuer,null==n?void 0:n.cursor,null==n?void 0:n.limit,null==n?void 0:n.network,null==n?void 0:n.order],d=P(()=>["blux","assets",e,...i],[e,n,...i]),t=P(()=>async()=>{const l={...n,network:e};return r(l)},[e,n,...i]);return S({...l,enabled:u,queryKey:d,queryFn:t})}function I(n,l){var o,r;const u=E(null==n?void 0:n.address),i=J(null==n?void 0:n.network),d=null===(o=null==l?void 0:l.enabled)||void 0===o||o,t=null===(r=null==n?void 0:n.includeZeroBalances)||void 0===r||r,v=[u,i,t],c=P(()=>["blux","balances",i,...v],[i,...v]),a=P(()=>async()=>{const l={...n,address:u,includeZeroBalances:t,network:i};return e(l)},[i,...v]);return S({...l,enabled:d,queryKey:c,queryFn:a})}function X(n,l){var o;const r=E(n.claimant),e=J(null==n?void 0:n.network),i=null===(o=null==l?void 0:l.enabled)||void 0===o||o,d=[r,null==n?void 0:n.asset,null==n?void 0:n.sponsor,null==n?void 0:n.cursor,null==n?void 0:n.limit,null==n?void 0:n.network,null==n?void 0:n.order],t=P(()=>["blux","claimableBalances",e,...d],[e,...d]),v=P(()=>async()=>{const l={...n,claimant:r,network:e};return u(l)},[e,...d]);return S({...l,enabled:i,queryKey:t,queryFn:v})}function j(n,l){var o;const r=J(null==n?void 0:n.network),e=null===(o=null==l?void 0:l.enabled)||void 0===o||o,u=[null==n?void 0:n.forAccount,null==n?void 0:n.forLedger,null==n?void 0:n.forTransaction,null==n?void 0:n.forOperation,null==n?void 0:n.forLiquidityPool,null==n?void 0:n.cursor,null==n?void 0:n.limit,null==n?void 0:n.network,null==n?void 0:n.order],d=P(()=>["blux","effects",r,...u],[r,...u]),t=P(()=>async()=>{const l={...n,network:r};return i(l)},[r,...u]);return S({...l,enabled:e,queryKey:d,queryFn:t})}function z(n,l){var o;const r=J(null==n?void 0:n.network),e=null===(o=null==l?void 0:l.enabled)||void 0===o||o,u=[null==n?void 0:n.ledger,null==n?void 0:n.cursor,null==n?void 0:n.limit,null==n?void 0:n.network,null==n?void 0:n.order],i=P(()=>["blux","ledgers",r,...u],[r,n,...u]),t=P(()=>async()=>{const l={...n,network:r};return d(l)},[r,n,...u]);return S({...l,enabled:e,queryKey:i,queryFn:t})}function G(n,l){var o;const r=J(null==n?void 0:n.network),e=null===(o=null==l?void 0:l.enabled)||void 0===o||o,u=[null==n?void 0:n.forAccount,null==n?void 0:n.forAssets,null==n?void 0:n.cursor,null==n?void 0:n.limit,null==n?void 0:n.network,null==n?void 0:n.order],i=P(()=>["blux","liquidityPools",r,...u],[r,...u]),d=P(()=>async()=>{const l={...n,network:r};return t(l)},[r,...u]);return S({...l,enabled:e,queryKey:i,queryFn:d})}const H=()=>{var n;const l=v(n=>n),[o,r]=N((null===(n=l.stellar)||void 0===n?void 0:n.activeNetwork)||l.config.defaultNetwork);return h(()=>{var n;r((null===(n=l.stellar)||void 0===n?void 0:n.activeNetwork)||l.config.defaultNetwork)},[l.stellar,l.config]),o};function M(n,l){var o;const r=J(null==n?void 0:n.network),e=null===(o=null==l?void 0:l.enabled)||void 0===o||o,u=[null==n?void 0:n.forAccount,null==n?void 0:n.buying,null==n?void 0:n.selling,null==n?void 0:n.sponsor,null==n?void 0:n.seller,null==n?void 0:n.cursor,null==n?void 0:n.limit,null==n?void 0:n.network,null==n?void 0:n.order],i=P(()=>["blux","offers",r,...u],[r,...u]),d=P(()=>async()=>{const l={...n,network:r};return c(l)},[r,...u]);return S({...l,enabled:e,queryKey:i,queryFn:d})}function Q(n,l){var o;const r=J(null==n?void 0:n.network),e=null===(o=null==l?void 0:l.enabled)||void 0===o||o,u=[null==n?void 0:n.forAccount,null==n?void 0:n.includeFailed,null==n?void 0:n.forClaimableBalance,null==n?void 0:n.forLedger,null==n?void 0:n.forTransaction,null==n?void 0:n.forLiquidityPool,null==n?void 0:n.forAccount,null==n?void 0:n.cursor,null==n?void 0:n.limit,null==n?void 0:n.network,null==n?void 0:n.order],i=P(()=>["blux","operations",r,...u],[r,...u]),d=P(()=>async()=>{const l={...n,network:r};return a(l)},[r,n,...u]);return S({...l,enabled:e,queryKey:i,queryFn:d})}function U(n,l,o){var r;const e=J(null==l?void 0:l.network),u=null===(r=null==o?void 0:o.enabled)||void 0===r||r,i=[n[0],n[1],null==l?void 0:l.cursor,null==l?void 0:l.limit,null==l?void 0:l.network,null==l?void 0:l.order],d=P(()=>["blux","orderbook",e,...i],[e,l,...i]),t=P(()=>async()=>{const o={...l,network:e};return s(n,o)},[e,l,...i]);return S({...o,enabled:u,queryKey:d,queryFn:t})}function V(n,l){var o;const r=J(null==n?void 0:n.network),e=null===(o=null==l?void 0:l.enabled)||void 0===o||o,u=[null==n?void 0:n.forAccount,null==n?void 0:n.includeFailed,null==n?void 0:n.forLedger,null==n?void 0:n.forTransaction,null==n?void 0:n.cursor,null==n?void 0:n.limit,null==n?void 0:n.network,null==n?void 0:n.order],i=P(()=>["blux","payments",r,...u],[r,...u]),d=P(()=>async()=>{const l={...n,network:r};return y(l)},[r,...u]);return S({...l,enabled:e,queryKey:i,queryFn:d})}function W(n,l,o){var r;const e=J(null==l?void 0:l.network),u=null===(r=null==o?void 0:o.enabled)||void 0===r||r,i=P(()=>JSON.stringify((null!=n?n:[]).map(n=>{var l;return{address:null==n?void 0:n.address,fn:null==n?void 0:n.fn,args:(null!==(l=null==n?void 0:n.args)&&void 0!==l?l:[]).map(n=>n.toXDR("base64"))}})),[n]),d=[e,i],t=P(()=>["blux","readContracts",e,i],[...d]),v=P(()=>async()=>{const o={...l,network:e};return f(n,o)},[...d]);return S({...o,enabled:u,queryKey:t,queryFn:v})}function Y(n,l,o){var r;const e=J(null==l?void 0:l.network),u=null===(r=null==o?void 0:o.enabled)||void 0===r||r,i=[n[0],n[1],n[2],null==l?void 0:l.cursor,null==l?void 0:l.limit,null==l?void 0:l.network,null==l?void 0:l.order],d=P(()=>["blux","strictReceivePaths",e,...i],[e,l,...i]),t=P(()=>async()=>{const o={...l,network:e};return b(n,o)},[e,l,...i]);return S({...o,enabled:u,queryKey:d,queryFn:t})}function $(n,l,o){var r;const e=J(null==l?void 0:l.network),u=null===(r=null==o?void 0:o.enabled)||void 0===r||r,i=[n[0],n[1],n[2],null==l?void 0:l.cursor,null==l?void 0:l.limit,null==l?void 0:l.network,null==l?void 0:l.order],d=P(()=>["blux","strictSendPaths",e,...i],[e,l,...i]),t=P(()=>async()=>{const o={...l,network:e};return k(n,o)},[e,l,...i]);return S({...o,enabled:u,queryKey:d,queryFn:t})}function _(n,l,o){var r;const e=J(null==l?void 0:l.network),u=null===(r=null==o?void 0:o.enabled)||void 0===r||r,i=[n[0],n[1],n[2],n[3],n[4],n[5],null==l?void 0:l.cursor,null==l?void 0:l.limit,null==l?void 0:l.network,null==l?void 0:l.order],d=P(()=>["blux","tradeAggregation",e,...i],[e,l,...i]),t=P(()=>async()=>{const o={...l,network:e};return w(n,o)},[e,l,...i]);return S({...o,enabled:u,queryKey:d,queryFn:t})}function nn(n,l){var o;const r=J(null==n?void 0:n.network),e=null===(o=null==l?void 0:l.enabled)||void 0===o||o,u=[null==n?void 0:n.forAssetPair,null==n?void 0:n.forOffer,null==n?void 0:n.forType,null==n?void 0:n.forLiquidityPool,null==n?void 0:n.forAccount,null==n?void 0:n.cursor,null==n?void 0:n.limit,null==n?void 0:n.network,null==n?void 0:n.order],i=P(()=>["blux","trades",r,...u],[r,...u]),d=P(()=>async()=>{const l={...n,network:r};return q(l)},[r,...u]);return S({...l,enabled:e,queryKey:i,queryFn:d})}function ln(n,l){var o;const r=J(null==n?void 0:n.network),e=null===(o=null==l?void 0:l.enabled)||void 0===o||o,u=[null==n?void 0:n.forAccount,null==n?void 0:n.includeFailed,null==n?void 0:n.forClaimableBalance,null==n?void 0:n.forLedger,null==n?void 0:n.forLiquidityPool,null==n?void 0:n.cursor,null==n?void 0:n.limit,null==n?void 0:n.network,null==n?void 0:n.order],i=P(()=>["blux","transactions",r,...u],[r,...u]),d=P(()=>async()=>{const l={...n,network:r};return m(l)},[r,...u]);return S({...l,enabled:e,queryKey:i,queryFn:d})}const on=()=>({networks:F,switchNetwork:x});function rn(n){return C({...n,mutationFn:async({call:n,options:l})=>g(n,l)})}const en=()=>{const[n,l]=N(p),o=v(n=>n.user),r=v(n=>n.authState);return h(()=>{l(p)},[o,r]),n},un=new O,dn=({config:n,children:l})=>{const o=B(null),{appearance:r,...e}=null!=n?n:{},u=P(()=>e,[JSON.stringify(e)]);return h(()=>{o.current&&K(n,o.current)},[o,u]),h(()=>{o.current&&A(null!=r?r:{})},[o,r]),L.createElement(T,{client:un},L.createElement("div",{ref:o},l))};export{dn as BluxProvider,R as useAccount,Z as useAccounts,D as useAssets,I as useBalances,en as useBlux,X as useClaimableBalances,j as useEffects,z as useLedgers,G as useLiquidityPools,H as useNetwork,M as useOffers,Q as useOperations,U as useOrderbook,V as usePayments,W as useReadContracts,Y as useStrictReceivePaths,$ as useStrictSendPaths,on as useSwitchNetwork,_ as useTradeAggregation,nn as useTrades,ln as useTransactions,rn as useWriteContract};
|
|
1
|
+
import{getState as n,getAccount as l,getAccounts as o,getAssets as e,getBalances as r,getClaimableBalances as u,getEffects as t,getLedgers as i,getLiquidityPools as d,useExportedStore as a,getOffers as s,getOperations as c,getOrderbook as v,getPayments as y,readContracts as f,getStrictReceivePaths as b,getStrictSendPaths as k,getTradeAggregation as w,getTrades as g,getTransactions as q,transfer as m,switchNetwork as x,networks as p,writeContract as F,swap as A,getTokenMetadata as K,getSacAddress as S,blux as P,createConfig as L,setAppearance as h}from"@bluxcc/core";export{BluxEvent,StellarSdk,ToScVal,events,getAccount,getAccounts,getAssets,getBalances,getClaimableBalances,getEffects,getInitialState,getLedgers,getLiquidityPools,getNetwork,getOffers,getOperations,getOrderbook,getPayments,getSacAddress,getState,getStrictReceivePaths,getStrictSendPaths,getTokenMetadata,getTradeAggregation,getTrades,getTransactions,networks,numberish,readContracts,setAppearance,subscribe,swap,switchNetwork,useExportedStore,writeContract}from"@bluxcc/core";export{Asset}from"@stellar/stellar-sdk";import N,{useMemo as B,useState as O,useEffect as T,useRef as C}from"react";import{useQuery as E,useMutation as R,QueryClient as j,QueryClientProvider as I}from"@tanstack/react-query";const J=l=>{const{user:o}=n();return l||(null==o?void 0:o.address)},M=l=>{const{stellar:o}=n();return!l&&o?o.activeNetwork:l};function Z(n,o){var e;const r=J(null==n?void 0:n.address),u=M(null==n?void 0:n.network),t=null===(e=null==o?void 0:o.enabled)||void 0===e||e,i=[r,u],d=B(()=>["blux","account",u,...i],[u,...i]),a=B(()=>async()=>{const o={...n,address:r,network:u};return l(o)},[u,...i]);return E({...o,enabled:t,queryKey:d,queryFn:a})}function D(n,l){var e;const r=M(null==n?void 0:n.network),u=null===(e=null==l?void 0:l.enabled)||void 0===e||e,t=[null==n?void 0:n.forSigner,null==n?void 0:n.forAsset,null==n?void 0:n.sponsor,null==n?void 0:n.forLiquidityPool,null==n?void 0:n.cursor,null==n?void 0:n.limit,null==n?void 0:n.network,null==n?void 0:n.order],i=B(()=>["blux","accounts",r,...t],[r,...t]),d=B(()=>async()=>{const l={...n,network:r};return o(l)},[r,...t]);return E({...l,enabled:u,queryKey:i,queryFn:d})}function V(n,l){var o;const r=M(null==n?void 0:n.network),u=null===(o=null==l?void 0:l.enabled)||void 0===o||o,t=[null==n?void 0:n.forCode,null==n?void 0:n.forIssuer,null==n?void 0:n.cursor,null==n?void 0:n.limit,null==n?void 0:n.network,null==n?void 0:n.order],i=B(()=>["blux","assets",r,...t],[r,n,...t]),d=B(()=>async()=>{const l={...n,network:r};return e(l)},[r,n,...t]);return E({...l,enabled:u,queryKey:i,queryFn:d})}function X(n,l){var o,e;const u=J(null==n?void 0:n.address),t=M(null==n?void 0:n.network),i=null===(o=null==l?void 0:l.enabled)||void 0===o||o,d=null===(e=null==n?void 0:n.includeZeroBalances)||void 0===e||e,a=[u,t,d],s=B(()=>["blux","balances",t,...a],[t,...a]),c=B(()=>async()=>{const l={...n,address:u,includeZeroBalances:d,network:t};return r(l)},[t,...a]);return E({...l,enabled:i,queryKey:s,queryFn:c})}function z(n,l){var o;const e=J(n.claimant),r=M(null==n?void 0:n.network),t=null===(o=null==l?void 0:l.enabled)||void 0===o||o,i=[e,null==n?void 0:n.asset,null==n?void 0:n.sponsor,null==n?void 0:n.cursor,null==n?void 0:n.limit,null==n?void 0:n.network,null==n?void 0:n.order],d=B(()=>["blux","claimableBalances",r,...i],[r,...i]),a=B(()=>async()=>{const l={...n,claimant:e,network:r};return u(l)},[r,...i]);return E({...l,enabled:t,queryKey:d,queryFn:a})}function G(n,l){var o;const e=M(null==n?void 0:n.network),r=null===(o=null==l?void 0:l.enabled)||void 0===o||o,u=[null==n?void 0:n.forAccount,null==n?void 0:n.forLedger,null==n?void 0:n.forTransaction,null==n?void 0:n.forOperation,null==n?void 0:n.forLiquidityPool,null==n?void 0:n.cursor,null==n?void 0:n.limit,null==n?void 0:n.network,null==n?void 0:n.order],i=B(()=>["blux","effects",e,...u],[e,...u]),d=B(()=>async()=>{const l={...n,network:e};return t(l)},[e,...u]);return E({...l,enabled:r,queryKey:i,queryFn:d})}function H(n,l){var o;const e=M(null==n?void 0:n.network),r=null===(o=null==l?void 0:l.enabled)||void 0===o||o,u=[null==n?void 0:n.ledger,null==n?void 0:n.cursor,null==n?void 0:n.limit,null==n?void 0:n.network,null==n?void 0:n.order],t=B(()=>["blux","ledgers",e,...u],[e,n,...u]),d=B(()=>async()=>{const l={...n,network:e};return i(l)},[e,n,...u]);return E({...l,enabled:r,queryKey:t,queryFn:d})}function Q(n,l){var o;const e=M(null==n?void 0:n.network),r=null===(o=null==l?void 0:l.enabled)||void 0===o||o,u=[null==n?void 0:n.forAccount,null==n?void 0:n.forAssets,null==n?void 0:n.cursor,null==n?void 0:n.limit,null==n?void 0:n.network,null==n?void 0:n.order],t=B(()=>["blux","liquidityPools",e,...u],[e,...u]),i=B(()=>async()=>{const l={...n,network:e};return d(l)},[e,...u]);return E({...l,enabled:r,queryKey:t,queryFn:i})}const U=()=>{var n;const l=a(n=>n),[o,e]=O((null===(n=l.stellar)||void 0===n?void 0:n.activeNetwork)||l.config.defaultNetwork);return T(()=>{var n;e((null===(n=l.stellar)||void 0===n?void 0:n.activeNetwork)||l.config.defaultNetwork)},[l.stellar,l.config]),o};function W(n,l){var o;const e=M(null==n?void 0:n.network),r=null===(o=null==l?void 0:l.enabled)||void 0===o||o,u=[null==n?void 0:n.forAccount,null==n?void 0:n.buying,null==n?void 0:n.selling,null==n?void 0:n.sponsor,null==n?void 0:n.seller,null==n?void 0:n.cursor,null==n?void 0:n.limit,null==n?void 0:n.network,null==n?void 0:n.order],t=B(()=>["blux","offers",e,...u],[e,...u]),i=B(()=>async()=>{const l={...n,network:e};return s(l)},[e,...u]);return E({...l,enabled:r,queryKey:t,queryFn:i})}function Y(n,l){var o;const e=M(null==n?void 0:n.network),r=null===(o=null==l?void 0:l.enabled)||void 0===o||o,u=[null==n?void 0:n.forAccount,null==n?void 0:n.includeFailed,null==n?void 0:n.forClaimableBalance,null==n?void 0:n.forLedger,null==n?void 0:n.forTransaction,null==n?void 0:n.forLiquidityPool,null==n?void 0:n.forAccount,null==n?void 0:n.cursor,null==n?void 0:n.limit,null==n?void 0:n.network,null==n?void 0:n.order],t=B(()=>["blux","operations",e,...u],[e,...u]),i=B(()=>async()=>{const l={...n,network:e};return c(l)},[e,n,...u]);return E({...l,enabled:r,queryKey:t,queryFn:i})}function $(n,l,o){var e;const r=M(null==l?void 0:l.network),u=null===(e=null==o?void 0:o.enabled)||void 0===e||e,t=[n[0],n[1],null==l?void 0:l.cursor,null==l?void 0:l.limit,null==l?void 0:l.network,null==l?void 0:l.order],i=B(()=>["blux","orderbook",r,...t],[r,l,...t]),d=B(()=>async()=>{const o={...l,network:r};return v(n,o)},[r,l,...t]);return E({...o,enabled:u,queryKey:i,queryFn:d})}function _(n,l){var o;const e=M(null==n?void 0:n.network),r=null===(o=null==l?void 0:l.enabled)||void 0===o||o,u=[null==n?void 0:n.forAccount,null==n?void 0:n.includeFailed,null==n?void 0:n.forLedger,null==n?void 0:n.forTransaction,null==n?void 0:n.cursor,null==n?void 0:n.limit,null==n?void 0:n.network,null==n?void 0:n.order],t=B(()=>["blux","payments",e,...u],[e,...u]),i=B(()=>async()=>{const l={...n,network:e};return y(l)},[e,...u]);return E({...l,enabled:r,queryKey:t,queryFn:i})}function nn(n,l,o){var e;const r=M(null==l?void 0:l.network),u=null===(e=null==o?void 0:o.enabled)||void 0===e||e,t=B(()=>JSON.stringify((null!=n?n:[]).map(n=>{var l;return{address:null==n?void 0:n.address,fn:null==n?void 0:n.fn,args:(null!==(l=null==n?void 0:n.args)&&void 0!==l?l:[]).map(n=>n.toXDR("base64"))}})),[n]),i=[r,t],d=B(()=>["blux","readContracts",r,t],[...i]),a=B(()=>async()=>{const o={...l,network:r};return f(n,o)},[...i]);return E({...o,enabled:u,queryKey:d,queryFn:a})}function ln(n,l,o){var e;const r=M(null==l?void 0:l.network),u=null===(e=null==o?void 0:o.enabled)||void 0===e||e,t=[n[0],n[1],n[2],null==l?void 0:l.cursor,null==l?void 0:l.limit,null==l?void 0:l.network,null==l?void 0:l.order],i=B(()=>["blux","strictReceivePaths",r,...t],[r,l,...t]),d=B(()=>async()=>{const o={...l,network:r};return b(n,o)},[r,l,...t]);return E({...o,enabled:u,queryKey:i,queryFn:d})}function on(n,l,o){var e;const r=M(null==l?void 0:l.network),u=null===(e=null==o?void 0:o.enabled)||void 0===e||e,t=[n[0],n[1],n[2],null==l?void 0:l.cursor,null==l?void 0:l.limit,null==l?void 0:l.network,null==l?void 0:l.order],i=B(()=>["blux","strictSendPaths",r,...t],[r,l,...t]),d=B(()=>async()=>{const o={...l,network:r};return k(n,o)},[r,l,...t]);return E({...o,enabled:u,queryKey:i,queryFn:d})}function en(n,l,o){var e;const r=M(null==l?void 0:l.network),u=null===(e=null==o?void 0:o.enabled)||void 0===e||e,t=[n[0],n[1],n[2],n[3],n[4],n[5],null==l?void 0:l.cursor,null==l?void 0:l.limit,null==l?void 0:l.network,null==l?void 0:l.order],i=B(()=>["blux","tradeAggregation",r,...t],[r,l,...t]),d=B(()=>async()=>{const o={...l,network:r};return w(n,o)},[r,l,...t]);return E({...o,enabled:u,queryKey:i,queryFn:d})}function rn(n,l){var o;const e=M(null==n?void 0:n.network),r=null===(o=null==l?void 0:l.enabled)||void 0===o||o,u=[null==n?void 0:n.forAssetPair,null==n?void 0:n.forOffer,null==n?void 0:n.forType,null==n?void 0:n.forLiquidityPool,null==n?void 0:n.forAccount,null==n?void 0:n.cursor,null==n?void 0:n.limit,null==n?void 0:n.network,null==n?void 0:n.order],t=B(()=>["blux","trades",e,...u],[e,...u]),i=B(()=>async()=>{const l={...n,network:e};return g(l)},[e,...u]);return E({...l,enabled:r,queryKey:t,queryFn:i})}function un(n,l){var o;const e=M(null==n?void 0:n.network),r=null===(o=null==l?void 0:l.enabled)||void 0===o||o,u=[null==n?void 0:n.forAccount,null==n?void 0:n.includeFailed,null==n?void 0:n.forClaimableBalance,null==n?void 0:n.forLedger,null==n?void 0:n.forLiquidityPool,null==n?void 0:n.cursor,null==n?void 0:n.limit,null==n?void 0:n.network,null==n?void 0:n.order],t=B(()=>["blux","transactions",e,...u],[e,...u]),i=B(()=>async()=>{const l={...n,network:e};return q(l)},[e,...u]);return E({...l,enabled:r,queryKey:t,queryFn:i})}function tn(n){const l=R({...n,mutationFn:async n=>m(n)});return Object.assign(l,{transfer:l.mutate,transferAsync:l.mutateAsync})}const dn=()=>({networks:p,switchNetwork:x});function an(n){return R({...n,mutationFn:async({call:n,options:l})=>F(n,l)})}function sn(n){const l=R({...n,mutationFn:async n=>A(n)});return Object.assign(l,{swap:l.mutate,swapAsync:l.mutateAsync})}function cn(n,l,o){var e;const r=M(null==l?void 0:l.network),u=(null===(e=null==o?void 0:o.enabled)||void 0===e||e)&&Boolean(n),t=[n,r],i=B(()=>["blux","tokenMetadata",...t],[...t]),d=B(()=>async()=>{const o={...l,network:r};return K(n,o)},[...t]);return E({...o,enabled:u,queryKey:i,queryFn:d})}function vn(n,l){const o=M(l);return B(()=>{try{return{data:S(n,o),error:null}}catch(n){return{data:void 0,error:n}}},[n,o])}const yn=()=>{const[n,l]=O(P),o=a(n=>n.user),e=a(n=>n.authState);return T(()=>{l(P)},[o,e]),n},fn=new j,bn=({config:n,children:l})=>{const o=C(null),{appearance:e,...r}=null!=n?n:{},u=B(()=>r,[JSON.stringify(r)]);return T(()=>{o.current&&L(n,o.current)},[o,u]),T(()=>{o.current&&h(null!=e?e:{})},[o,e]),N.createElement(I,{client:fn},N.createElement("div",{ref:o},l))};export{bn as BluxProvider,Z as useAccount,D as useAccounts,V as useAssets,X as useBalances,yn as useBlux,z as useClaimableBalances,G as useEffects,H as useLedgers,Q as useLiquidityPools,U as useNetwork,W as useOffers,Y as useOperations,$ as useOrderbook,_ as usePayments,nn as useReadContracts,vn as useSacAddress,ln as useStrictReceivePaths,on as useStrictSendPaths,sn as useSwap,dn as useSwitchNetwork,cn as useTokenMetadata,en as useTradeAggregation,rn as useTrades,un as useTransactions,tn as useTransfer,an as useWriteContract};
|
|
@@ -18,5 +18,9 @@ export * from './useStrictSendPaths';
|
|
|
18
18
|
export * from './useTradeAggregation';
|
|
19
19
|
export * from './useTrades';
|
|
20
20
|
export * from './useTransactions';
|
|
21
|
+
export * from './useTransfer';
|
|
21
22
|
export * from './useSwitchNetwork';
|
|
22
23
|
export * from './useWriteContract';
|
|
24
|
+
export * from './useSwap';
|
|
25
|
+
export * from './useTokenMetadata';
|
|
26
|
+
export * from './useSacAddress';
|
|
@@ -3,5 +3,30 @@ import type { GetAccountResult, GetAccountOptions } from '@bluxcc/core/dist/expo
|
|
|
3
3
|
import type { QueryOptions } from '../utils';
|
|
4
4
|
type R = GetAccountResult;
|
|
5
5
|
type O = GetAccountOptions;
|
|
6
|
+
/**
|
|
7
|
+
* Fetches a single account's on-chain state from Horizon.
|
|
8
|
+
*
|
|
9
|
+
* Wraps the core `getAccount` call in a TanStack Query. When `address` is
|
|
10
|
+
* omitted it falls back to the connected wallet's address, so it doubles as a
|
|
11
|
+
* "current account" hook. Resolves to `null` when the account does not exist on
|
|
12
|
+
* the target network (e.g. it has never been funded).
|
|
13
|
+
*
|
|
14
|
+
* @param options - `address` (the `G…` account to load; defaults to the
|
|
15
|
+
* connected wallet) and `network` (defaults to the active network).
|
|
16
|
+
* @param queryOptions - Optional TanStack Query options (`enabled`, `staleTime`,
|
|
17
|
+
* `refetchInterval`, `select`, …). `queryKey`/`queryFn` are managed by the hook.
|
|
18
|
+
* @returns A TanStack Query result; `data` is the Horizon `AccountResponse`, or
|
|
19
|
+
* `null` if the account is not found.
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```tsx
|
|
23
|
+
* // Connected wallet's account
|
|
24
|
+
* const { data: account, isLoading } = useAccount();
|
|
25
|
+
*
|
|
26
|
+
* // A specific account
|
|
27
|
+
* const { data } = useAccount({ address: 'GA…' });
|
|
28
|
+
* console.log(data?.sequence, data?.balances);
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
6
31
|
export declare function useAccount(options?: O, queryOptions?: QueryOptions<R>): UseQueryResult<R, Error>;
|
|
7
32
|
export {};
|
|
@@ -3,5 +3,28 @@ import type { GetAccountsResult, GetAccountsOptions } from '@bluxcc/core/dist/ex
|
|
|
3
3
|
import type { QueryOptions } from '../utils';
|
|
4
4
|
type R = GetAccountsResult;
|
|
5
5
|
type O = GetAccountsOptions;
|
|
6
|
+
/**
|
|
7
|
+
* Fetches a paginated list of accounts that match a filter from Horizon.
|
|
8
|
+
*
|
|
9
|
+
* Exactly one filter is required: `forSigner` (accounts a key can sign for),
|
|
10
|
+
* `forAsset` (accounts that hold a trustline to an asset), `sponsor` (accounts
|
|
11
|
+
* sponsored by an address), or `forLiquidityPool` (accounts holding pool
|
|
12
|
+
* shares). Standard pagination (`cursor`, `limit`, `order`) applies.
|
|
13
|
+
*
|
|
14
|
+
* @param options - One of the required filters above, plus optional
|
|
15
|
+
* `cursor` / `limit` / `order` and `network` (defaults to the active network).
|
|
16
|
+
* @param queryOptions - Optional TanStack Query options (`enabled`, `staleTime`,
|
|
17
|
+
* …). `queryKey`/`queryFn` are managed by the hook.
|
|
18
|
+
* @returns A TanStack Query result. `data` is `{ builder, response }`, where
|
|
19
|
+
* `response` is the Horizon collection page (`response.records`, plus
|
|
20
|
+
* `response.next()` / `response.prev()` for pagination) and `builder` is the
|
|
21
|
+
* underlying call builder for advanced queries or streaming.
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```tsx
|
|
25
|
+
* const { data } = useAccounts({ forSigner: 'GA…', limit: 20 });
|
|
26
|
+
* data?.response.records.forEach((a) => console.log(a.account_id));
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
6
29
|
export declare function useAccounts(options?: O, queryOptions?: QueryOptions<R>): UseQueryResult<R, Error>;
|
|
7
30
|
export {};
|
|
@@ -3,5 +3,23 @@ import type { GetAssetsResult, GetAssetsOptions } from "@bluxcc/core/dist/export
|
|
|
3
3
|
import type { QueryOptions } from '../utils';
|
|
4
4
|
type R = GetAssetsResult;
|
|
5
5
|
type O = GetAssetsOptions;
|
|
6
|
+
/**
|
|
7
|
+
* Fetches a paginated list of assets issued on the network from Horizon.
|
|
8
|
+
*
|
|
9
|
+
* Optionally narrow the list by `forCode` (asset code, e.g. "USDC") and/or
|
|
10
|
+
* `forIssuer` (the issuing `G…` address). With no filter it returns all assets.
|
|
11
|
+
*
|
|
12
|
+
* @param options - `forCode` / `forIssuer` filters, plus optional
|
|
13
|
+
* `cursor` / `limit` / `order` and `network` (defaults to the active network).
|
|
14
|
+
* @param queryOptions - Optional TanStack Query options. `queryKey`/`queryFn`
|
|
15
|
+
* are managed by the hook.
|
|
16
|
+
* @returns A TanStack Query result. `data` is `{ builder, response }`;
|
|
17
|
+
* `response.records` holds the asset records (supply, flags, issuer, …).
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```tsx
|
|
21
|
+
* const { data } = useAssets({ forCode: 'USDC' });
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
6
24
|
export declare function useAssets(options?: O, queryOptions?: QueryOptions<R>): UseQueryResult<R, Error>;
|
|
7
25
|
export {};
|
|
@@ -3,5 +3,26 @@ import type { GetBalancesResult, GetBalancesOptions } from "@bluxcc/core/dist/ex
|
|
|
3
3
|
import type { QueryOptions } from '../utils';
|
|
4
4
|
type R = GetBalancesResult;
|
|
5
5
|
type O = GetBalancesOptions;
|
|
6
|
+
/**
|
|
7
|
+
* Fetches an account's asset balances from Horizon.
|
|
8
|
+
*
|
|
9
|
+
* When `address` is omitted it uses the connected wallet. By default zero
|
|
10
|
+
* balances (e.g. empty trustlines) are included; set `includeZeroBalances` to
|
|
11
|
+
* `false` to drop them. Pairs well with `useTransfer`'s `onSuccess` to refetch
|
|
12
|
+
* balances after a payment.
|
|
13
|
+
*
|
|
14
|
+
* @param options - `address` (defaults to the connected wallet),
|
|
15
|
+
* `includeZeroBalances` (default `true`), and `network` (defaults to active).
|
|
16
|
+
* @param queryOptions - Optional TanStack Query options. `queryKey`/`queryFn`
|
|
17
|
+
* are managed by the hook.
|
|
18
|
+
* @returns A TanStack Query result; `data` is an array of Horizon balance lines
|
|
19
|
+
* (the native balance plus each trustline).
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```tsx
|
|
23
|
+
* const { data: balances } = useBalances();
|
|
24
|
+
* const xlm = balances?.find((b) => b.asset_type === 'native');
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
6
27
|
export declare function useBalances(options?: O, queryOptions?: QueryOptions<R>): UseQueryResult<R, Error>;
|
|
7
28
|
export {};
|
|
@@ -3,5 +3,25 @@ import type { GetClaimableBalancesResult, GetClaimableBalancesOptions } from "@b
|
|
|
3
3
|
import type { QueryOptions } from '../utils';
|
|
4
4
|
type R = GetClaimableBalancesResult;
|
|
5
5
|
type O = GetClaimableBalancesOptions;
|
|
6
|
+
/**
|
|
7
|
+
* Fetches claimable balances addressed to a claimant from Horizon.
|
|
8
|
+
*
|
|
9
|
+
* `claimant` defaults to the connected wallet, so by default it lists balances
|
|
10
|
+
* the current user can claim. `asset` is required; `sponsor` optionally filters
|
|
11
|
+
* by who reserved the balance.
|
|
12
|
+
*
|
|
13
|
+
* @param options - Required: `asset` (the `Asset` to filter by) and `claimant`
|
|
14
|
+
* (defaults to the connected wallet). Optional: `sponsor`,
|
|
15
|
+
* `cursor` / `limit` / `order`, and `network` (defaults to active).
|
|
16
|
+
* @param queryOptions - Optional TanStack Query options. `queryKey`/`queryFn`
|
|
17
|
+
* are managed by the hook.
|
|
18
|
+
* @returns A TanStack Query result. `data` is `{ builder, response }`;
|
|
19
|
+
* `response.records` holds the claimable balance records.
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```tsx
|
|
23
|
+
* const { data } = useClaimableBalances({ asset: Asset.native() });
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
6
26
|
export declare function useClaimableBalances(options: O, queryOptions?: QueryOptions<R>): UseQueryResult<R, Error>;
|
|
7
27
|
export {};
|
|
@@ -3,5 +3,26 @@ import type { GetEffectsResult, GetEffectsOptions } from "@bluxcc/core/dist/expo
|
|
|
3
3
|
import type { QueryOptions } from '../utils';
|
|
4
4
|
type R = GetEffectsResult;
|
|
5
5
|
type O = GetEffectsOptions;
|
|
6
|
+
/**
|
|
7
|
+
* Fetches a paginated list of effects (the granular results of operations) from
|
|
8
|
+
* Horizon.
|
|
9
|
+
*
|
|
10
|
+
* Effects describe concrete ledger changes — account credited, trustline
|
|
11
|
+
* created, trade executed, and so on. Filter by `forAccount`, `forLedger`,
|
|
12
|
+
* `forTransaction`, `forOperation`, or `forLiquidityPool`; with no filter the
|
|
13
|
+
* full effects feed is returned.
|
|
14
|
+
*
|
|
15
|
+
* @param options - One of the `for…` filters, plus optional
|
|
16
|
+
* `cursor` / `limit` / `order` and `network` (defaults to active).
|
|
17
|
+
* @param queryOptions - Optional TanStack Query options. `queryKey`/`queryFn`
|
|
18
|
+
* are managed by the hook.
|
|
19
|
+
* @returns A TanStack Query result. `data` is `{ builder, response }`;
|
|
20
|
+
* `response.records` holds the effect records.
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```tsx
|
|
24
|
+
* const { data } = useEffects({ forAccount: 'GA…', limit: 50 });
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
6
27
|
export declare function useEffects(options?: O, queryOptions?: QueryOptions<R>): UseQueryResult<R, Error>;
|
|
7
28
|
export {};
|
|
@@ -3,5 +3,23 @@ import type { GetLedgersResult, GetLedgersOptions } from "@bluxcc/core/dist/expo
|
|
|
3
3
|
import type { QueryOptions } from '../utils';
|
|
4
4
|
type R = GetLedgersResult;
|
|
5
5
|
type O = GetLedgersOptions;
|
|
6
|
+
/**
|
|
7
|
+
* Fetches ledgers from Horizon — either the latest ledgers or a single one.
|
|
8
|
+
*
|
|
9
|
+
* Pass `ledger` (a sequence number) to load one specific ledger; omit it to page
|
|
10
|
+
* through the most recent ledgers.
|
|
11
|
+
*
|
|
12
|
+
* @param options - `ledger` (a sequence number for a single ledger), plus
|
|
13
|
+
* optional `cursor` / `limit` / `order` and `network` (defaults to active).
|
|
14
|
+
* @param queryOptions - Optional TanStack Query options. `queryKey`/`queryFn`
|
|
15
|
+
* are managed by the hook.
|
|
16
|
+
* @returns A TanStack Query result. `data` is `{ builder, response }`;
|
|
17
|
+
* `response.records` holds the ledger records.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```tsx
|
|
21
|
+
* const { data } = useLedgers({ limit: 10, order: 'desc' });
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
6
24
|
export declare function useLedgers(options?: O, queryOptions?: QueryOptions<R>): UseQueryResult<R, Error>;
|
|
7
25
|
export {};
|
|
@@ -3,5 +3,26 @@ import type { GetLiquidityPoolsResult, GetLiquidityPoolsOptions } from "@bluxcc/
|
|
|
3
3
|
import type { QueryOptions } from '../utils';
|
|
4
4
|
type R = GetLiquidityPoolsResult;
|
|
5
5
|
type O = GetLiquidityPoolsOptions;
|
|
6
|
+
/**
|
|
7
|
+
* Fetches a paginated list of liquidity pools from Horizon.
|
|
8
|
+
*
|
|
9
|
+
* Optionally filter by `forAssets` (pools containing the given assets) or
|
|
10
|
+
* `forAccount` (pools an account holds shares in). With no filter it lists all
|
|
11
|
+
* pools.
|
|
12
|
+
*
|
|
13
|
+
* @param options - `forAssets` / `forAccount` filters, plus optional
|
|
14
|
+
* `cursor` / `limit` / `order` and `network` (defaults to active).
|
|
15
|
+
* @param queryOptions - Optional TanStack Query options. `queryKey`/`queryFn`
|
|
16
|
+
* are managed by the hook.
|
|
17
|
+
* @returns A TanStack Query result. `data` is `{ builder, response }`;
|
|
18
|
+
* `response.records` holds the liquidity pool records (reserves, shares, …).
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```tsx
|
|
22
|
+
* const { data } = useLiquidityPools({
|
|
23
|
+
* forAssets: [Asset.native(), new Asset('USDC', 'GA…')],
|
|
24
|
+
* });
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
6
27
|
export declare function useLiquidityPools(options?: O, queryOptions?: QueryOptions<R>): UseQueryResult<R, Error>;
|
|
7
28
|
export {};
|
|
@@ -1 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns the currently active Stellar network and re-renders when it changes.
|
|
3
|
+
*
|
|
4
|
+
* Reads the active network from the Blux store (falling back to the configured
|
|
5
|
+
* `defaultNetwork`), so components stay in sync after
|
|
6
|
+
* `useSwitchNetwork().switchNetwork(...)`.
|
|
7
|
+
*
|
|
8
|
+
* @returns The active network passphrase — the value the other hooks accept as
|
|
9
|
+
* their `network` option (one of `networks.mainnet` / `testnet` / …).
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```tsx
|
|
13
|
+
* const network = useNetwork();
|
|
14
|
+
* return <span>Connected to {network}</span>;
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
1
17
|
export declare const useNetwork: () => string;
|
|
@@ -3,5 +3,24 @@ import type { GetOffersResult, GetOffersOptions } from "@bluxcc/core/dist/export
|
|
|
3
3
|
import type { QueryOptions } from '../utils';
|
|
4
4
|
type R = GetOffersResult;
|
|
5
5
|
type O = GetOffersOptions;
|
|
6
|
+
/**
|
|
7
|
+
* Fetches a paginated list of open DEX offers from Horizon.
|
|
8
|
+
*
|
|
9
|
+
* Filter by `forAccount` / `seller` (offers created by an account),
|
|
10
|
+
* `buying` / `selling` (offers on a given asset side), or `sponsor`.
|
|
11
|
+
*
|
|
12
|
+
* @param options - `forAccount` / `seller` / `buying` / `selling` / `sponsor`
|
|
13
|
+
* filters, plus optional `cursor` / `limit` / `order` and `network` (defaults
|
|
14
|
+
* to active).
|
|
15
|
+
* @param queryOptions - Optional TanStack Query options. `queryKey`/`queryFn`
|
|
16
|
+
* are managed by the hook.
|
|
17
|
+
* @returns A TanStack Query result. `data` is `{ builder, response }`;
|
|
18
|
+
* `response.records` holds the offer records (price, amount, assets).
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```tsx
|
|
22
|
+
* const { data } = useOffers({ seller: 'GA…' });
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
6
25
|
export declare function useOffers(options?: O, queryOptions?: QueryOptions<R>): UseQueryResult<R, Error>;
|
|
7
26
|
export {};
|
|
@@ -3,5 +3,25 @@ import type { GetOperationsResult, GetOperationsOptions } from "@bluxcc/core/dis
|
|
|
3
3
|
import type { QueryOptions } from '../utils';
|
|
4
4
|
type R = GetOperationsResult;
|
|
5
5
|
type O = GetOperationsOptions;
|
|
6
|
+
/**
|
|
7
|
+
* Fetches a paginated list of operations from Horizon.
|
|
8
|
+
*
|
|
9
|
+
* Operations are the individual actions inside transactions (payments, trades,
|
|
10
|
+
* trustline changes, contract invocations, …). Filter by `forAccount`,
|
|
11
|
+
* `forTransaction`, `forLedger`, `forClaimableBalance`, or `forLiquidityPool`;
|
|
12
|
+
* set `includeFailed` to also include operations from failed transactions.
|
|
13
|
+
*
|
|
14
|
+
* @param options - The `for…` filters and `includeFailed`, plus optional
|
|
15
|
+
* `cursor` / `limit` / `order` and `network` (defaults to active).
|
|
16
|
+
* @param queryOptions - Optional TanStack Query options. `queryKey`/`queryFn`
|
|
17
|
+
* are managed by the hook.
|
|
18
|
+
* @returns A TanStack Query result. `data` is `{ builder, response }`;
|
|
19
|
+
* `response.records` holds the operation records.
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```tsx
|
|
23
|
+
* const { data } = useOperations({ forAccount: 'GA…', includeFailed: false });
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
6
26
|
export declare function useOperations(options?: O, queryOptions?: QueryOptions<R>): UseQueryResult<R, Error>;
|
|
7
27
|
export {};
|
|
@@ -5,5 +5,24 @@ import { CallBuilderOptions } from '../utils';
|
|
|
5
5
|
import type { QueryOptions } from '../utils';
|
|
6
6
|
type R = GetOrderbookResult;
|
|
7
7
|
type O = CallBuilderOptions;
|
|
8
|
+
/**
|
|
9
|
+
* Fetches the current DEX order book for a `selling`/`buying` asset pair from
|
|
10
|
+
* Horizon.
|
|
11
|
+
*
|
|
12
|
+
* @param args - `[selling, buying]` — the two `Asset`s whose order book to load
|
|
13
|
+
* (e.g. `[Asset.native(), usdc]`).
|
|
14
|
+
* @param options - Optional `cursor` / `limit` / `order` and `network`
|
|
15
|
+
* (defaults to active).
|
|
16
|
+
* @param queryOptions - Optional TanStack Query options. `queryKey`/`queryFn`
|
|
17
|
+
* are managed by the hook.
|
|
18
|
+
* @returns A TanStack Query result. `data` is `{ builder, response }`, where
|
|
19
|
+
* `response` holds the `bids` and `asks` arrays.
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```tsx
|
|
23
|
+
* const { data } = useOrderbook([Asset.native(), new Asset('USDC', 'GA…')]);
|
|
24
|
+
* console.log(data?.response.bids, data?.response.asks);
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
8
27
|
export declare function useOrderbook(args: [selling: Asset, buying: Asset], options?: O, queryOptions?: QueryOptions<R>): UseQueryResult<R, Error>;
|
|
9
28
|
export {};
|
|
@@ -1,12 +1,32 @@
|
|
|
1
1
|
import { UseQueryResult } from '@tanstack/react-query';
|
|
2
|
-
import type { GetPaymentsOptions } from
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import type { GetPaymentsOptions } from '@bluxcc/core/dist/exports/core/getPayments';
|
|
3
|
+
import { ServerApi } from '@stellar/stellar-sdk/lib/esm/horizon';
|
|
4
|
+
import { PaymentCallBuilder } from '@stellar/stellar-sdk/lib/esm/horizon/payment_call_builder';
|
|
5
5
|
import type { QueryOptions } from '../utils';
|
|
6
6
|
type R = {
|
|
7
7
|
builder: PaymentCallBuilder;
|
|
8
8
|
response: ServerApi.CollectionPage<ServerApi.CreateAccountOperationRecord | ServerApi.PaymentOperationRecord | ServerApi.PathPaymentOperationRecord | ServerApi.AccountMergeOperationRecord | ServerApi.PathPaymentStrictSendOperationRecord | ServerApi.InvokeHostFunctionOperationRecord>;
|
|
9
9
|
};
|
|
10
10
|
type O = GetPaymentsOptions;
|
|
11
|
+
/**
|
|
12
|
+
* Fetches a paginated list of payment operations from Horizon.
|
|
13
|
+
*
|
|
14
|
+
* Like `useOperations`, but narrowed to payment-type records (payments,
|
|
15
|
+
* create-account, path payments, account merges). Filter by `forAccount`,
|
|
16
|
+
* `forTransaction`, or `forLedger`; set `includeFailed` to include failures.
|
|
17
|
+
*
|
|
18
|
+
* @param options - `forAccount` / `forTransaction` / `forLedger` and
|
|
19
|
+
* `includeFailed`, plus optional `cursor` / `limit` / `order` and `network`
|
|
20
|
+
* (defaults to active).
|
|
21
|
+
* @param queryOptions - Optional TanStack Query options. `queryKey`/`queryFn`
|
|
22
|
+
* are managed by the hook.
|
|
23
|
+
* @returns A TanStack Query result. `data` is `{ builder, response }`;
|
|
24
|
+
* `response.records` holds the payment-related records.
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```tsx
|
|
28
|
+
* const { data } = usePayments({ forAccount: 'GA…' });
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
11
31
|
export declare function usePayments(options?: O, queryOptions?: QueryOptions<R>): UseQueryResult<R, Error>;
|
|
12
32
|
export {};
|
|
@@ -4,5 +4,29 @@ import type { IContractCall, ReadContractsOptions } from '@bluxcc/core/dist/expo
|
|
|
4
4
|
import type { QueryOptions } from '../utils';
|
|
5
5
|
type R = Awaited<ReturnType<typeof readContracts>>;
|
|
6
6
|
type O = ReadContractsOptions;
|
|
7
|
+
/**
|
|
8
|
+
* Reads from one or more Soroban contracts by simulating their calls — no
|
|
9
|
+
* transaction is submitted, so no signature or fees are required.
|
|
10
|
+
*
|
|
11
|
+
* Each call names a contract `address`, a function `fn`, and its `args` as
|
|
12
|
+
* `xdr.ScVal`s — build those with the exported `ToScVal` helpers. Results come
|
|
13
|
+
* back already decoded in `data.values`, with the raw simulation in `data.raws`.
|
|
14
|
+
* For state-changing calls use `useWriteContract` instead.
|
|
15
|
+
*
|
|
16
|
+
* @param calls - The contract calls to simulate, each `{ address, fn, args }`.
|
|
17
|
+
* @param options - Optional `network` (defaults to the active network).
|
|
18
|
+
* @param queryOptions - Optional TanStack Query options (`enabled`, `staleTime`,
|
|
19
|
+
* …). `queryKey`/`queryFn` are managed by the hook.
|
|
20
|
+
* @returns A TanStack Query result. `data` is `{ raws, values }` — `values` are
|
|
21
|
+
* the decoded return values, index-aligned with `calls`.
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```tsx
|
|
25
|
+
* const { data } = useReadContracts([
|
|
26
|
+
* { address: 'C…', fn: 'balance', args: [ToScVal.address('GA…')] },
|
|
27
|
+
* ]);
|
|
28
|
+
* const balance = data?.values[0];
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
7
31
|
export declare function useReadContracts(calls: IContractCall[], options?: O, queryOptions?: QueryOptions<R>): UseQueryResult<R, Error>;
|
|
8
32
|
export {};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { AssetArg } from '@bluxcc/core/dist/exports/core/helpers';
|
|
2
|
+
/**
|
|
3
|
+
* Result of {@link useSacAddress}. Because the underlying derivation is
|
|
4
|
+
* synchronous and local, there is no loading state — `data` is populated
|
|
5
|
+
* immediately, or `error` is set when the asset/network is invalid.
|
|
6
|
+
*/
|
|
7
|
+
export type UseSacAddressResult = {
|
|
8
|
+
/** The Stellar Asset Contract id (`C…`), or `undefined` when it can't be derived. */
|
|
9
|
+
data: string | undefined;
|
|
10
|
+
/** The error thrown while deriving, or `null` on success. */
|
|
11
|
+
error: Error | null;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Computes the Stellar Asset Contract (SAC) id of a classic asset, memoized.
|
|
15
|
+
*
|
|
16
|
+
* Every classic asset — native XLM or a `CODE:ISSUER` pair — has a deterministic
|
|
17
|
+
* Soroban contract id derived from the asset plus the network passphrase. The id
|
|
18
|
+
* is computed locally with no network call (and regardless of whether the SAC is
|
|
19
|
+
* actually deployed), so this hook is synchronous: it returns the value right
|
|
20
|
+
* away rather than a TanStack query result. Feed the result into
|
|
21
|
+
* {@link useTokenMetadata}, `transfer`'s `token` option, or
|
|
22
|
+
* `useReadContracts` / `useWriteContract`.
|
|
23
|
+
*
|
|
24
|
+
* Errors are captured rather than thrown during render: an invalid asset or a
|
|
25
|
+
* missing network passphrase surfaces as `{ data: undefined, error }`.
|
|
26
|
+
*
|
|
27
|
+
* @param asset - The asset: `'xlm'` / `'native'`, a `CODE:ISSUER` string, or an
|
|
28
|
+
* `Asset`. Pass a stable value (a string, or a memoized `Asset`) to avoid
|
|
29
|
+
* recomputing every render.
|
|
30
|
+
* @param network - Network passphrase to derive against. Defaults to the active
|
|
31
|
+
* network.
|
|
32
|
+
* @returns `{ data, error }` — see {@link UseSacAddressResult}.
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* ```tsx
|
|
36
|
+
* const { data: sac, error } = useSacAddress('USDC:GA…');
|
|
37
|
+
* // sac → 'C…'
|
|
38
|
+
*
|
|
39
|
+
* // Chain into a metadata read once the SAC is known.
|
|
40
|
+
* const { data: meta } = useTokenMetadata(sac ?? '', undefined, {
|
|
41
|
+
* enabled: Boolean(sac),
|
|
42
|
+
* });
|
|
43
|
+
* ```
|
|
44
|
+
*/
|
|
45
|
+
export declare function useSacAddress(asset: AssetArg, network?: string): UseSacAddressResult;
|
|
@@ -5,6 +5,30 @@ import { CallBuilderOptions } from '../utils';
|
|
|
5
5
|
import type { QueryOptions } from '../utils';
|
|
6
6
|
type R = GetPaymentPathResult;
|
|
7
7
|
type O = CallBuilderOptions;
|
|
8
|
+
/**
|
|
9
|
+
* Finds payment paths for a fixed destination amount (strict-receive) via
|
|
10
|
+
* Horizon.
|
|
11
|
+
*
|
|
12
|
+
* Use this when you know exactly how much the recipient should receive and want
|
|
13
|
+
* to discover which source assets/paths can deliver it (and what they would
|
|
14
|
+
* cost). For the inverse — fixing what the sender spends — use
|
|
15
|
+
* `useStrictSendPaths`.
|
|
16
|
+
*
|
|
17
|
+
* @param args - `[source, destinationAsset, destinationAmount]`: the source
|
|
18
|
+
* (a sending `G…` address, or an array of candidate source `Asset`s), the
|
|
19
|
+
* asset the destination receives, and the exact amount they receive.
|
|
20
|
+
* @param options - Optional `cursor` / `limit` / `order` and `network`
|
|
21
|
+
* (defaults to active).
|
|
22
|
+
* @param queryOptions - Optional TanStack Query options. `queryKey`/`queryFn`
|
|
23
|
+
* are managed by the hook.
|
|
24
|
+
* @returns A TanStack Query result. `data` is `{ builder, response }`;
|
|
25
|
+
* `response.records` holds each candidate path with its source amount.
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* ```tsx
|
|
29
|
+
* const { data } = useStrictReceivePaths(['GA…', new Asset('USDC', 'GA…'), '100']);
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
8
32
|
export declare function useStrictReceivePaths(args: [
|
|
9
33
|
source: string | Asset[],
|
|
10
34
|
destinationAsset: Asset,
|
|
@@ -5,6 +5,28 @@ import { CallBuilderOptions } from '../utils';
|
|
|
5
5
|
import type { QueryOptions } from '../utils';
|
|
6
6
|
type R = GetPaymentPathResult;
|
|
7
7
|
type O = CallBuilderOptions;
|
|
8
|
+
/**
|
|
9
|
+
* Finds payment paths for a fixed source amount (strict-send) via Horizon.
|
|
10
|
+
*
|
|
11
|
+
* Use this when you know exactly how much the sender will spend and want to
|
|
12
|
+
* discover the paths and how much the destination would receive. For the
|
|
13
|
+
* inverse — fixing the received amount — use `useStrictReceivePaths`.
|
|
14
|
+
*
|
|
15
|
+
* @param args - `[sourceAsset, sourceAmount, destination]`: the asset the sender
|
|
16
|
+
* spends, the exact amount they spend, and the destination (a `G…` address, or
|
|
17
|
+
* an array of candidate destination `Asset`s).
|
|
18
|
+
* @param options - Optional `cursor` / `limit` / `order` and `network`
|
|
19
|
+
* (defaults to active).
|
|
20
|
+
* @param queryOptions - Optional TanStack Query options. `queryKey`/`queryFn`
|
|
21
|
+
* are managed by the hook.
|
|
22
|
+
* @returns A TanStack Query result. `data` is `{ builder, response }`;
|
|
23
|
+
* `response.records` holds each candidate path with its destination amount.
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* ```tsx
|
|
27
|
+
* const { data } = useStrictSendPaths([Asset.native(), '50', 'GA…']);
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
8
30
|
export declare function useStrictSendPaths(args: [
|
|
9
31
|
sourceAsset: Asset,
|
|
10
32
|
sourceAmount: string,
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { swap } from '@bluxcc/core';
|
|
2
|
+
import { UseMutationResult } from '@tanstack/react-query';
|
|
3
|
+
import type { SwapOptions } from '@bluxcc/core/dist/exports/core/swap';
|
|
4
|
+
import type { MutationOptions } from '../utils';
|
|
5
|
+
type R = Awaited<ReturnType<typeof swap>>;
|
|
6
|
+
/**
|
|
7
|
+
* Variables for {@link useSwap} — the core `swap` options verbatim, so every
|
|
8
|
+
* knob it supports (`type` exactIn/exactOut, `slippage`, `to`, `memo`,
|
|
9
|
+
* `network`) is just a field on the object passed to `swap({ ... })`.
|
|
10
|
+
*/
|
|
11
|
+
export type SwapVariables = SwapOptions;
|
|
12
|
+
type V = SwapVariables;
|
|
13
|
+
/**
|
|
14
|
+
* Return type of {@link useSwap}: the full TanStack mutation result plus
|
|
15
|
+
* wagmi-style aliases — `swap` (alias of `mutate`, fire-and-forget) and
|
|
16
|
+
* `swapAsync` (alias of `mutateAsync`, returns a promise).
|
|
17
|
+
*/
|
|
18
|
+
export type UseSwapResult = UseMutationResult<R, Error, V> & {
|
|
19
|
+
swap: UseMutationResult<R, Error, V>['mutate'];
|
|
20
|
+
swapAsync: UseMutationResult<R, Error, V>['mutateAsync'];
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* Swaps one asset for another through the Stellar DEX / liquidity pools by
|
|
24
|
+
* wrapping the core `swap` in a TanStack mutation.
|
|
25
|
+
*
|
|
26
|
+
* The core call discovers the best path payment automatically and applies a
|
|
27
|
+
* slippage guardrail, so callers just describe the trade. `type: 'exactIn'`
|
|
28
|
+
* (the default) sends a fixed `amount` of `fromAsset` and lets the received
|
|
29
|
+
* amount float; `type: 'exactOut'` receives a fixed `amount` of `toAsset` and
|
|
30
|
+
* lets the spent amount float. Defaults to a self-swap; pass `to` to deliver the
|
|
31
|
+
* bought asset elsewhere. When it is a self-swap into an asset the account has
|
|
32
|
+
* never held, the required `changeTrust` is added automatically. Requires a
|
|
33
|
+
* logged-in account.
|
|
34
|
+
*
|
|
35
|
+
* Named after wagmi's mutation hooks: fire `swap({ ... })` (fire-and-forget) or
|
|
36
|
+
* `await swapAsync({ ... })`.
|
|
37
|
+
*
|
|
38
|
+
* @param mutationOptions - Optional TanStack Mutation options (`onSuccess`,
|
|
39
|
+
* `onError`, `onSettled`, …); a common use is invalidating `useBalances` on
|
|
40
|
+
* success. `mutationFn` is provided by the hook.
|
|
41
|
+
* @returns The TanStack mutation result plus `swap` (alias of `mutate`) and
|
|
42
|
+
* `swapAsync` (alias of `mutateAsync`); read `data` (the submitted
|
|
43
|
+
* transaction), `isPending`, `isSuccess`, `error`, `reset`, etc. for state.
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* ```tsx
|
|
47
|
+
* const { swap, swapAsync, isPending, error } = useSwap();
|
|
48
|
+
*
|
|
49
|
+
* // Sell exactly 100 XLM for USDC (exactIn is the default).
|
|
50
|
+
* swap({ fromAsset: 'xlm', toAsset: 'USDC:GA…', amount: '100' });
|
|
51
|
+
*
|
|
52
|
+
* // Receive exactly 50 USDC, spending up to a slippage-bounded amount of XLM.
|
|
53
|
+
* swap({ fromAsset: 'xlm', toAsset: 'USDC:GA…', amount: '50', type: 'exactOut' });
|
|
54
|
+
*
|
|
55
|
+
* // Deliver the bought asset to another account, with tighter slippage + a memo.
|
|
56
|
+
* const tx = await swapAsync({
|
|
57
|
+
* fromAsset: 'USDC:GA…',
|
|
58
|
+
* toAsset: 'xlm',
|
|
59
|
+
* amount: '25',
|
|
60
|
+
* to: 'GB…',
|
|
61
|
+
* slippage: 0.01, // 1%
|
|
62
|
+
* memo: 'cash out',
|
|
63
|
+
* });
|
|
64
|
+
* ```
|
|
65
|
+
*/
|
|
66
|
+
export declare function useSwap(mutationOptions?: MutationOptions<R, V>): UseSwapResult;
|
|
67
|
+
export {};
|
|
@@ -1,10 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Provides the list of configured networks and a setter to change the active
|
|
3
|
+
* one.
|
|
4
|
+
*
|
|
5
|
+
* Switching updates the Blux store; components that read the network via
|
|
6
|
+
* `useNetwork` (and network-scoped queries) update accordingly.
|
|
7
|
+
*
|
|
8
|
+
* @returns `{ networks, switchNetwork }` — `networks` is the map of available
|
|
9
|
+
* networks (`mainnet` / `testnet` / `sandbox` / `futurenet` / `standalone`)
|
|
10
|
+
* and `switchNetwork(network)` sets the active network.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```tsx
|
|
14
|
+
* const { networks, switchNetwork } = useSwitchNetwork();
|
|
15
|
+
* <button onClick={() => switchNetwork(networks.testnet)}>Use testnet</button>;
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
1
18
|
export declare const useSwitchNetwork: () => {
|
|
2
19
|
networks: {
|
|
3
|
-
mainnet: import("@stellar/stellar-
|
|
4
|
-
testnet: import("@stellar/stellar-
|
|
5
|
-
sandbox: import("@stellar/stellar-
|
|
6
|
-
futurenet: import("@stellar/stellar-
|
|
7
|
-
standalone: import("@stellar/stellar-
|
|
20
|
+
mainnet: import("@stellar/stellar-sdk").Networks;
|
|
21
|
+
testnet: import("@stellar/stellar-sdk").Networks;
|
|
22
|
+
sandbox: import("@stellar/stellar-sdk").Networks;
|
|
23
|
+
futurenet: import("@stellar/stellar-sdk").Networks;
|
|
24
|
+
standalone: import("@stellar/stellar-sdk").Networks;
|
|
8
25
|
};
|
|
9
26
|
switchNetwork: (newNetwork: string) => void;
|
|
10
27
|
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { UseQueryResult } from '@tanstack/react-query';
|
|
2
|
+
import type { TokenMetadata, GetTokenMetadataOptions } from '@bluxcc/core/dist/exports/core/getTokenMetadata';
|
|
3
|
+
import type { QueryOptions } from '../utils';
|
|
4
|
+
type R = TokenMetadata;
|
|
5
|
+
type O = GetTokenMetadataOptions;
|
|
6
|
+
/**
|
|
7
|
+
* Reads a SEP-41 token / Stellar Asset Contract's metadata by wrapping the core
|
|
8
|
+
* `getTokenMetadata` in a TanStack query.
|
|
9
|
+
*
|
|
10
|
+
* The read is simulation-only — no account, signing, or fees — so it works for
|
|
11
|
+
* any contract id, deployed or not yet funded. `decimals`, `name`, and `symbol`
|
|
12
|
+
* come from the standard token interface; `owner` is read separately and is
|
|
13
|
+
* `undefined` for contracts without an `owner()` function (notably Stellar Asset
|
|
14
|
+
* Contracts, which expose `admin()` instead). The query stays disabled until a
|
|
15
|
+
* non-empty `address` is provided.
|
|
16
|
+
*
|
|
17
|
+
* @param address - The token contract id (`C…`), e.g. a SAC from
|
|
18
|
+
* {@link useSacAddress} / `getSacAddress`.
|
|
19
|
+
* @param options - Core read options (currently just `network`, which defaults
|
|
20
|
+
* to the active network).
|
|
21
|
+
* @param queryOptions - Optional TanStack Query options (`enabled`, `staleTime`,
|
|
22
|
+
* `select`, …); `queryKey` and `queryFn` are provided by the hook.
|
|
23
|
+
* @returns A TanStack query result. Read `data` (the {@link TokenMetadata}),
|
|
24
|
+
* `isLoading`, `isError`, `error`, `refetch`, etc.
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```tsx
|
|
28
|
+
* // Read a token contract directly.
|
|
29
|
+
* const { data, isLoading, error } = useTokenMetadata('C…');
|
|
30
|
+
* // data → { decimals: 7, name: 'USD Coin', symbol: 'USDC', owner?: 'G…' }
|
|
31
|
+
*
|
|
32
|
+
* // Derive a classic asset's SAC, then read its metadata once it's known.
|
|
33
|
+
* const { data: sac } = useSacAddress('USDC:GA…');
|
|
34
|
+
* const { data: meta } = useTokenMetadata(sac ?? '', undefined, {
|
|
35
|
+
* enabled: Boolean(sac),
|
|
36
|
+
* });
|
|
37
|
+
* ```
|
|
38
|
+
*/
|
|
39
|
+
export declare function useTokenMetadata(address: string, options?: O, queryOptions?: QueryOptions<R>): UseQueryResult<R, Error>;
|
|
40
|
+
export {};
|
|
@@ -5,6 +5,31 @@ import { CallBuilderOptions } from '../utils';
|
|
|
5
5
|
import type { QueryOptions } from '../utils';
|
|
6
6
|
type R = GetTradeAggregationResult;
|
|
7
7
|
type O = CallBuilderOptions;
|
|
8
|
+
/**
|
|
9
|
+
* Fetches aggregated trade history (OHLC-style time buckets) for an asset pair
|
|
10
|
+
* from Horizon.
|
|
11
|
+
*
|
|
12
|
+
* Useful for building price charts: trades between `base` and `counter` are
|
|
13
|
+
* grouped into fixed `resolution`-millisecond buckets over the
|
|
14
|
+
* `start_time`–`end_time` window.
|
|
15
|
+
*
|
|
16
|
+
* @param args - `[base, counter, start_time, end_time, resolution, offset]`: the
|
|
17
|
+
* two assets, the start/end of the window (ms since epoch), the bucket size
|
|
18
|
+
* `resolution` (ms), and a timezone `offset` (ms).
|
|
19
|
+
* @param options - Optional `cursor` / `limit` / `order` and `network`
|
|
20
|
+
* (defaults to active).
|
|
21
|
+
* @param queryOptions - Optional TanStack Query options. `queryKey`/`queryFn`
|
|
22
|
+
* are managed by the hook.
|
|
23
|
+
* @returns A TanStack Query result whose `data` holds the aggregated trade
|
|
24
|
+
* records (open/high/low/close and volume) per time bucket.
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```tsx
|
|
28
|
+
* const { data } = useTradeAggregation([
|
|
29
|
+
* Asset.native(), new Asset('USDC', 'GA…'), start, end, 3_600_000, 0,
|
|
30
|
+
* ]);
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
8
33
|
export declare function useTradeAggregation(args: [
|
|
9
34
|
base: Asset,
|
|
10
35
|
counter: Asset,
|
|
@@ -3,5 +3,25 @@ import type { GetTradesResult, GetTradesOptions } from "@bluxcc/core/dist/export
|
|
|
3
3
|
import type { QueryOptions } from "../utils";
|
|
4
4
|
type R = GetTradesResult;
|
|
5
5
|
type O = GetTradesOptions;
|
|
6
|
+
/**
|
|
7
|
+
* Fetches a paginated list of executed trades from Horizon.
|
|
8
|
+
*
|
|
9
|
+
* Filter by `forAssetPair` (`[base, counter]`), `forAccount`, `forOffer`,
|
|
10
|
+
* `forLiquidityPool`, or `forType` (e.g. orderbook vs. liquidity-pool trades).
|
|
11
|
+
*
|
|
12
|
+
* @param options - The `for…` filters, plus optional `cursor` / `limit` /
|
|
13
|
+
* `order` and `network` (defaults to active).
|
|
14
|
+
* @param queryOptions - Optional TanStack Query options. `queryKey`/`queryFn`
|
|
15
|
+
* are managed by the hook.
|
|
16
|
+
* @returns A TanStack Query result. `data` is `{ builder, response }`;
|
|
17
|
+
* `response.records` holds the trade records (price, amounts, counterparties).
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```tsx
|
|
21
|
+
* const { data } = useTrades({
|
|
22
|
+
* forAssetPair: [Asset.native(), new Asset('USDC', 'GA…')],
|
|
23
|
+
* });
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
6
26
|
export declare function useTrades(options?: O, queryOptions?: QueryOptions<R>): UseQueryResult<R, Error>;
|
|
7
27
|
export {};
|
|
@@ -3,5 +3,23 @@ import type { GetTransactionsResult, GetTransactionsOptions } from "@bluxcc/core
|
|
|
3
3
|
import type { QueryOptions } from "../utils";
|
|
4
4
|
type R = GetTransactionsResult;
|
|
5
5
|
type O = GetTransactionsOptions;
|
|
6
|
+
/**
|
|
7
|
+
* Fetches a paginated list of transactions from Horizon.
|
|
8
|
+
*
|
|
9
|
+
* Filter by `forAccount`, `forLedger`, `forClaimableBalance`, or
|
|
10
|
+
* `forLiquidityPool`; set `includeFailed` to include transactions that failed.
|
|
11
|
+
*
|
|
12
|
+
* @param options - The `for…` filters and `includeFailed`, plus optional
|
|
13
|
+
* `cursor` / `limit` / `order` and `network` (defaults to active).
|
|
14
|
+
* @param queryOptions - Optional TanStack Query options. `queryKey`/`queryFn`
|
|
15
|
+
* are managed by the hook.
|
|
16
|
+
* @returns A TanStack Query result. `data` is `{ builder, response }`;
|
|
17
|
+
* `response.records` holds the transaction records.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```tsx
|
|
21
|
+
* const { data } = useTransactions({ forAccount: 'GA…', limit: 25 });
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
6
24
|
export declare function useTransactions(options?: O, queryOptions?: QueryOptions<R>): UseQueryResult<R, Error>;
|
|
7
25
|
export {};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { transfer } from '@bluxcc/core';
|
|
2
|
+
import { UseMutationResult } from '@tanstack/react-query';
|
|
3
|
+
import type { TransferOptions } from '@bluxcc/core/dist/exports/core/transfer';
|
|
4
|
+
import type { MutationOptions } from '../utils';
|
|
5
|
+
type R = Awaited<ReturnType<typeof transfer>>;
|
|
6
|
+
/**
|
|
7
|
+
* Variables for {@link useTransfer} — the core `transfer` options verbatim, so
|
|
8
|
+
* every path it supports (native XLM, issued asset, claimable balance, SEP-41
|
|
9
|
+
* token, federated address) is just a different object passed to
|
|
10
|
+
* `transfer({ ... })`.
|
|
11
|
+
*/
|
|
12
|
+
export type TransferVariables = TransferOptions;
|
|
13
|
+
type V = TransferVariables;
|
|
14
|
+
/**
|
|
15
|
+
* Return type of {@link useTransfer}: the full TanStack mutation result plus
|
|
16
|
+
* wagmi-style aliases — `transfer` (alias of `mutate`, fire-and-forget) and
|
|
17
|
+
* `transferAsync` (alias of `mutateAsync`, returns a promise).
|
|
18
|
+
*/
|
|
19
|
+
export type UseTransferResult = UseMutationResult<R, Error, V> & {
|
|
20
|
+
transfer: UseMutationResult<R, Error, V>['mutate'];
|
|
21
|
+
transferAsync: UseMutationResult<R, Error, V>['mutateAsync'];
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Sends value from the connected wallet to a recipient — native XLM, an issued
|
|
25
|
+
* asset, or a SEP-41 token — by wrapping the core `transfer` in a TanStack
|
|
26
|
+
* mutation.
|
|
27
|
+
*
|
|
28
|
+
* The core call picks the right operation for you (create-account vs. payment
|
|
29
|
+
* vs. claimable balance for classic assets, or the token contract's `transfer`
|
|
30
|
+
* when `token` is set), so callers just describe the transfer. Named after
|
|
31
|
+
* wagmi's `useSendTransaction` / `useWriteContract`: fire `transfer({ ... })`
|
|
32
|
+
* (fire-and-forget) or `await transferAsync({ ... })`.
|
|
33
|
+
*
|
|
34
|
+
* @param mutationOptions - Optional TanStack Mutation options (`onSuccess`,
|
|
35
|
+
* `onError`, `onSettled`, …); a common use is invalidating `useBalances` on
|
|
36
|
+
* success. `mutationFn` is provided by the hook.
|
|
37
|
+
* @returns The TanStack mutation result plus `transfer` (alias of `mutate`) and
|
|
38
|
+
* `transferAsync` (alias of `mutateAsync`); read `data` (the submitted
|
|
39
|
+
* transaction), `isPending`, `isSuccess`, `error`, `reset`, etc. for state.
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* ```tsx
|
|
43
|
+
* const { transfer, transferAsync, isPending, error } = useTransfer();
|
|
44
|
+
*
|
|
45
|
+
* // Native XLM
|
|
46
|
+
* transfer({ to: 'GB…', amount: '10.5' });
|
|
47
|
+
*
|
|
48
|
+
* // Issued asset, falling back to a claimable balance if the recipient
|
|
49
|
+
* // cannot receive it directly
|
|
50
|
+
* transfer({ to: 'GB…', amount: '10', asset: 'USDC:GA…', claimable: true });
|
|
51
|
+
*
|
|
52
|
+
* // SEP-41 token (integer base units)
|
|
53
|
+
* transfer({ to: 'GB…', amount: '1000000', token: 'C…' });
|
|
54
|
+
*
|
|
55
|
+
* // Await the result (e.g. in a form submit handler)
|
|
56
|
+
* const tx = await transferAsync({ to: 'alice*example.com', amount: '5' });
|
|
57
|
+
* ```
|
|
58
|
+
*/
|
|
59
|
+
export declare function useTransfer(mutationOptions?: MutationOptions<R, V>): UseTransferResult;
|
|
60
|
+
export {};
|
|
@@ -3,10 +3,46 @@ import { UseMutationResult } from '@tanstack/react-query';
|
|
|
3
3
|
import type { IContractCall, WriteContractsOptions } from '@bluxcc/core/dist/exports/utils';
|
|
4
4
|
import type { MutationOptions } from '../utils';
|
|
5
5
|
type R = Awaited<ReturnType<typeof writeContract>>;
|
|
6
|
+
/**
|
|
7
|
+
* Variables for {@link useWriteContract}: the contract `call` to invoke and
|
|
8
|
+
* optional core write `options` (e.g. `network`).
|
|
9
|
+
*/
|
|
6
10
|
export type WriteContractVariables = {
|
|
7
11
|
call: IContractCall;
|
|
8
12
|
options?: WriteContractsOptions;
|
|
9
13
|
};
|
|
10
14
|
type V = WriteContractVariables;
|
|
15
|
+
/**
|
|
16
|
+
* Submits a state-changing Soroban contract invocation as a signed, on-chain
|
|
17
|
+
* transaction.
|
|
18
|
+
*
|
|
19
|
+
* A thin wrapper over TanStack Query's `useMutation`: call `mutate` /
|
|
20
|
+
* `mutateAsync` with the contract call to sign and send it. Build `args` with
|
|
21
|
+
* the exported `ToScVal` helpers. For read-only calls (no signature, no fees)
|
|
22
|
+
* use `useReadContracts` instead.
|
|
23
|
+
*
|
|
24
|
+
* @param mutationOptions - Optional TanStack Mutation options (`onSuccess`,
|
|
25
|
+
* `onError`, `onSettled`, …); `mutationFn` is provided by the hook.
|
|
26
|
+
* @returns A TanStack mutation result. Call `mutate({ call, options })` (or
|
|
27
|
+
* `mutateAsync`) to send; read `data`, `isPending`, `isSuccess`, `error`,
|
|
28
|
+
* `reset`, etc. for state.
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* ```tsx
|
|
32
|
+
* const { mutate, isPending, data } = useWriteContract();
|
|
33
|
+
*
|
|
34
|
+
* mutate({
|
|
35
|
+
* call: {
|
|
36
|
+
* address: 'C…',
|
|
37
|
+
* fn: 'transfer',
|
|
38
|
+
* args: [
|
|
39
|
+
* ToScVal.address('GFROM…'),
|
|
40
|
+
* ToScVal.address('GTO…'),
|
|
41
|
+
* ToScVal.i128('1000000'),
|
|
42
|
+
* ],
|
|
43
|
+
* },
|
|
44
|
+
* });
|
|
45
|
+
* ```
|
|
46
|
+
*/
|
|
11
47
|
export declare function useWriteContract(mutationOptions?: MutationOptions<R, V>): UseMutationResult<R, Error, V>;
|
|
12
48
|
export {};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bluxcc/react",
|
|
3
3
|
"author": "Blux team",
|
|
4
|
-
"version": "0.2.
|
|
4
|
+
"version": "0.2.8",
|
|
5
5
|
"homepage": "https://blux.cc",
|
|
6
6
|
"description": "Connecting to the Stellar Ecosystem and Beyond",
|
|
7
7
|
"repository": {
|
|
@@ -30,8 +30,8 @@
|
|
|
30
30
|
"build": "rollup -c rollup.config.prod.js"
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {
|
|
33
|
-
"@bluxcc/core": "^0.2.
|
|
34
|
-
"@stellar/stellar-sdk": "^
|
|
33
|
+
"@bluxcc/core": "^0.2.8",
|
|
34
|
+
"@stellar/stellar-sdk": "^16.0.1",
|
|
35
35
|
"@tanstack/react-query": "^5.90.11",
|
|
36
36
|
"react": ">=17.0.0",
|
|
37
37
|
"react-dom": ">=17.0.0"
|