@bluxcc/react 0.1.31 → 0.1.32

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@bluxcc/react",
3
3
  "author": "Blux team",
4
- "version": "0.1.31",
4
+ "version": "0.1.32",
5
5
  "homepage": "https://blux.cc",
6
6
  "description": "Connecting to the Stellar Ecosystem and Beyond",
7
7
  "repository": {
@@ -30,7 +30,7 @@
30
30
  "build": "rollup -c rollup.config.prod.js"
31
31
  },
32
32
  "peerDependencies": {
33
- "@bluxcc/core": "^0.1.22",
33
+ "@bluxcc/core": "^0.1.23",
34
34
  "@stellar/stellar-sdk": "^14.4.2",
35
35
  "@tanstack/react-query": "^5.90.11",
36
36
  "react": ">=17.0.0",
@@ -1,8 +0,0 @@
1
- import React from 'react';
2
- import { IConfig } from '@bluxcc/core/dist/types';
3
- type BluxProviderProps = {
4
- config: IConfig;
5
- children: React.ReactNode | any;
6
- };
7
- export declare const BluxProvider: ({ config, children }: BluxProviderProps) => React.JSX.Element;
8
- export {};
@@ -1,14 +0,0 @@
1
- export declare const useBlux: () => {
2
- login: () => Promise<void>;
3
- logout: () => void;
4
- profile: () => void;
5
- signMessage: (message: string, options?: {
6
- network: string;
7
- }) => Promise<unknown>;
8
- sendTransaction: (xdr: string, options?: {
9
- network: string;
10
- }) => Promise<unknown>;
11
- readonly isReady: boolean;
12
- readonly isAuthenticated: boolean;
13
- readonly user: import("@bluxcc/core/dist/store").IUser | undefined;
14
- };
package/dist/index.cjs.js DELETED
@@ -1 +0,0 @@
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),c=null===(i=null==t?void 0:t.enabled)||void 0===i||i,v=[s,d],a=o.useMemo(()=>["blux","account",d,...v],[d,...v]),y=o.useMemo(()=>async()=>{const o={...n,address:s,network:d};return e.getAccount(o)},[d,...v]);return l.useQuery({...t,enabled:c,queryKey:a,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],c=o.useMemo(()=>["blux","accounts",i,...d],[i,...d]),v=o.useMemo(()=>async()=>{const o={...n,network:i};return e.getAccounts(o)},[i,...d]);return l.useQuery({...r,enabled:s,queryKey:c,queryFn:v})},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],c=o.useMemo(()=>["blux","assets",i,...d],[i,n,...d]),v=o.useMemo(()=>async()=>{const o={...n,network:i};return e.getAssets(o)},[i,n,...d]);return l.useQuery({...r,enabled:s,queryKey:c,queryFn:v})},exports.useBalances=function(n,t){var i,s;const d=r(null==n?void 0:n.address),c=u(null==n?void 0:n.network),v=null===(i=null==t?void 0:t.enabled)||void 0===i||i,a=null===(s=null==n?void 0:n.includeZeroBalances)||void 0===s||s,y=[d,c,a],f=o.useMemo(()=>["blux","balances",c,...y],[c,...y]),b=o.useMemo(()=>async()=>{const o={...n,address:d,includeZeroBalances:a,network:c};return e.getBalances(o)},[c,...y]);return l.useQuery({...t,enabled:v,queryKey:f,queryFn:b})},exports.useBlux=()=>{const[n,l]=o.useState(e.blux),r=e.useExportedStore(e=>e);return o.useEffect(()=>{l(e.blux)},[r]),n},exports.useClaimableBalances=function(n,t){var i;const s=r(n.claimant),d=u(null==n?void 0:n.network),c=null===(i=null==t?void 0:t.enabled)||void 0===i||i,v=[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],a=o.useMemo(()=>["blux","claimableBalances",d,...v],[d,...v]),y=o.useMemo(()=>async()=>{const o={...n,claimant:s,network:d};return e.getClaimableBalances(o)},[d,...v]);return l.useQuery({...t,enabled:c,queryKey:a,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],c=o.useMemo(()=>["blux","effects",i,...d],[i,...d]),v=o.useMemo(()=>async()=>{const o={...n,network:i};return e.getEffects(o)},[i,...d]);return l.useQuery({...r,enabled:s,queryKey:c,queryFn:v})},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],c=o.useMemo(()=>["blux","ledgers",i,...d],[i,n,...d]),v=o.useMemo(()=>async()=>{const o={...n,network:i};return e.getLedgers(o)},[i,n,...d]);return l.useQuery({...r,enabled:s,queryKey:c,queryFn:v})},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],c=o.useMemo(()=>["blux","liquidityPools",i,...d],[i,...d]),v=o.useMemo(()=>async()=>{const o={...n,network:i};return e.getLiquidityPools(o)},[i,...d]);return l.useQuery({...r,enabled:s,queryKey:c,queryFn:v})},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],c=o.useMemo(()=>["blux","offers",i,...d],[i,...d]),v=o.useMemo(()=>async()=>{const o={...n,network:i};return e.getOffers(o)},[i,...d]);return l.useQuery({...r,enabled:s,queryKey:c,queryFn:v})},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],c=o.useMemo(()=>["blux","operations",i,...d],[i,...d]),v=o.useMemo(()=>async()=>{const o={...n,network:i};return e.getOperations(o)},[i,n,...d]);return l.useQuery({...r,enabled:s,queryKey:c,queryFn:v})},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,c=[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],v=o.useMemo(()=>["blux","orderbook",s,...c],[s,r,...c]),a=o.useMemo(()=>async()=>{const o={...r,network:s};return e.getOrderbook(n,o)},[s,r,...c]);return l.useQuery({...t,enabled:d,queryKey:v,queryFn:a})},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],c=o.useMemo(()=>["blux","payments",i,...d],[i,...d]),v=o.useMemo(()=>async()=>{const o={...n,network:i};return e.getPayments(o)},[i,...d]);return l.useQuery({...r,enabled:s,queryKey:c,queryFn:v})},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,c=[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],v=o.useMemo(()=>["blux","strictReceivePaths",s,...c],[s,r,...c]),a=o.useMemo(()=>async()=>{const o={...r,network:s};return e.getStrictReceivePaths(n,o)},[s,r,...c]);return l.useQuery({...t,enabled:d,queryKey:v,queryFn:a})},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,c=[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],v=o.useMemo(()=>["blux","strictSendPaths",s,...c],[s,r,...c]),a=o.useMemo(()=>async()=>{const o={...r,network:s};return e.getStrictSendPaths(n,o)},[s,r,...c]);return l.useQuery({...t,enabled:d,queryKey:v,queryFn:a})},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,c=[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],v=o.useMemo(()=>["blux","tradeAggregation",s,...c],[s,r,...c]),a=o.useMemo(()=>async()=>{const o={...r,network:s};return e.getTradeAggregation(n,o)},[s,r,...c]);return l.useQuery({...t,enabled:d,queryKey:v,queryFn:a})},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],c=o.useMemo(()=>["blux","trades",i,...d],[i,...d]),v=o.useMemo(()=>async()=>{const o={...n,network:i};return e.getTrades(o)},[i,...d]);return l.useQuery({...r,enabled:s,queryKey:c,queryFn:v})},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],c=o.useMemo(()=>["blux","transactions",i,...d],[i,...d]),v=o.useMemo(()=>async()=>{const o={...n,network:i};return e.getTransactions(o)},[i,...d]);return l.useQuery({...r,enabled:s,queryKey:c,queryFn:v})};
package/dist/index.d.ts DELETED
@@ -1,5 +0,0 @@
1
- export { setAppearance } from '@bluxcc/core';
2
- export { Asset } from '@stellar/stellar-sdk';
3
- export * from './useStellar';
4
- export { useBlux } from './hooks/useBlux';
5
- export { BluxProvider } from './Provider';
package/dist/index.esm.js DELETED
@@ -1 +0,0 @@
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,getStrictReceivePaths as f,getStrictSendPaths as k,getTradeAggregation as b,getTrades as w,getTransactions as q,switchNetwork as m,networks as x,blux as F,createConfig as g,setAppearance as p}from"@bluxcc/core";export{networks,setAppearance}from"@bluxcc/core";export{Asset}from"@stellar/stellar-sdk";import K,{useMemo as A,useState as L,useEffect as P,useRef as N}from"react";import{useQuery as B,QueryClient as h,QueryClientProvider as T}from"@tanstack/react-query";const C=l=>{const{user:o}=n();return l||(null==o?void 0:o.address)},O=l=>{const{stellar:o}=n();return!l&&o?o.activeNetwork:l};function S(n,o){var r;const e=C(null==n?void 0:n.address),u=O(null==n?void 0:n.network),i=null===(r=null==o?void 0:o.enabled)||void 0===r||r,d=[e,u],t=A(()=>["blux","account",u,...d],[u,...d]),v=A(()=>async()=>{const o={...n,address:e,network:u};return l(o)},[u,...d]);return B({...o,enabled:i,queryKey:t,queryFn:v})}function E(n,l){var r;const e=O(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=A(()=>["blux","accounts",e,...i],[e,...i]),t=A(()=>async()=>{const l={...n,network:e};return o(l)},[e,...i]);return B({...l,enabled:u,queryKey:d,queryFn:t})}function Z(n,l){var o;const e=O(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=A(()=>["blux","assets",e,...i],[e,n,...i]),t=A(()=>async()=>{const l={...n,network:e};return r(l)},[e,n,...i]);return B({...l,enabled:u,queryKey:d,queryFn:t})}function I(n,l){var o,r;const u=C(null==n?void 0:n.address),i=O(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=A(()=>["blux","balances",i,...v],[i,...v]),a=A(()=>async()=>{const l={...n,address:u,includeZeroBalances:t,network:i};return e(l)},[i,...v]);return B({...l,enabled:d,queryKey:c,queryFn:a})}function J(n,l){var o;const r=C(n.claimant),e=O(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=A(()=>["blux","claimableBalances",e,...d],[e,...d]),v=A(()=>async()=>{const l={...n,claimant:r,network:e};return u(l)},[e,...d]);return B({...l,enabled:i,queryKey:t,queryFn:v})}function R(n,l){var o;const r=O(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=A(()=>["blux","effects",r,...u],[r,...u]),t=A(()=>async()=>{const l={...n,network:r};return i(l)},[r,...u]);return B({...l,enabled:e,queryKey:d,queryFn:t})}function j(n,l){var o;const r=O(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=A(()=>["blux","ledgers",r,...u],[r,n,...u]),t=A(()=>async()=>{const l={...n,network:r};return d(l)},[r,n,...u]);return B({...l,enabled:e,queryKey:i,queryFn:t})}function z(n,l){var o;const r=O(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=A(()=>["blux","liquidityPools",r,...u],[r,...u]),d=A(()=>async()=>{const l={...n,network:r};return t(l)},[r,...u]);return B({...l,enabled:e,queryKey:i,queryFn:d})}const D=()=>{var n;const l=v(n=>n),[o,r]=L((null===(n=l.stellar)||void 0===n?void 0:n.activeNetwork)||l.config.defaultNetwork);return P(()=>{var n;r((null===(n=l.stellar)||void 0===n?void 0:n.activeNetwork)||l.config.defaultNetwork)},[l.stellar,l.config]),o};function G(n,l){var o;const r=O(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=A(()=>["blux","offers",r,...u],[r,...u]),d=A(()=>async()=>{const l={...n,network:r};return c(l)},[r,...u]);return B({...l,enabled:e,queryKey:i,queryFn:d})}function H(n,l){var o;const r=O(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=A(()=>["blux","operations",r,...u],[r,...u]),d=A(()=>async()=>{const l={...n,network:r};return a(l)},[r,n,...u]);return B({...l,enabled:e,queryKey:i,queryFn:d})}function M(n,l,o){var r;const e=O(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=A(()=>["blux","orderbook",e,...i],[e,l,...i]),t=A(()=>async()=>{const o={...l,network:e};return s(n,o)},[e,l,...i]);return B({...o,enabled:u,queryKey:d,queryFn:t})}function Q(n,l){var o;const r=O(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=A(()=>["blux","payments",r,...u],[r,...u]),d=A(()=>async()=>{const l={...n,network:r};return y(l)},[r,...u]);return B({...l,enabled:e,queryKey:i,queryFn:d})}function U(n,l,o){var r;const e=O(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=A(()=>["blux","strictReceivePaths",e,...i],[e,l,...i]),t=A(()=>async()=>{const o={...l,network:e};return f(n,o)},[e,l,...i]);return B({...o,enabled:u,queryKey:d,queryFn:t})}function V(n,l,o){var r;const e=O(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=A(()=>["blux","strictSendPaths",e,...i],[e,l,...i]),t=A(()=>async()=>{const o={...l,network:e};return k(n,o)},[e,l,...i]);return B({...o,enabled:u,queryKey:d,queryFn:t})}function W(n,l,o){var r;const e=O(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=A(()=>["blux","tradeAggregation",e,...i],[e,l,...i]),t=A(()=>async()=>{const o={...l,network:e};return b(n,o)},[e,l,...i]);return B({...o,enabled:u,queryKey:d,queryFn:t})}function X(n,l){var o;const r=O(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=A(()=>["blux","trades",r,...u],[r,...u]),d=A(()=>async()=>{const l={...n,network:r};return w(l)},[r,...u]);return B({...l,enabled:e,queryKey:i,queryFn:d})}function Y(n,l){var o;const r=O(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=A(()=>["blux","transactions",r,...u],[r,...u]),d=A(()=>async()=>{const l={...n,network:r};return q(l)},[r,...u]);return B({...l,enabled:e,queryKey:i,queryFn:d})}const $=()=>({networks:x,switchNetwork:m}),_=()=>{const[n,l]=L(F),o=v(n=>n);return P(()=>{l(F)},[o]),n},nn=new h,ln=({config:n,children:l})=>{const o=N(null),{appearance:r,...e}=null!=n?n:{},u=A(()=>e,[JSON.stringify(e)]);return P(()=>{o.current&&g(n,o.current)},[o,u]),P(()=>{o.current&&p(null!=r?r:{})},[o,r]),K.createElement(T,{client:nn},K.createElement("div",{ref:o},l),";")};export{ln as BluxProvider,S as useAccount,E as useAccounts,Z as useAssets,I as useBalances,_ as useBlux,J as useClaimableBalances,R as useEffects,j as useLedgers,z as useLiquidityPools,D as useNetwork,G as useOffers,H as useOperations,M as useOrderbook,Q as usePayments,U as useStrictReceivePaths,V as useStrictSendPaths,$ as useSwitchNetwork,W as useTradeAggregation,X as useTrades,Y as useTransactions};
@@ -1,20 +0,0 @@
1
- export { networks } from '@bluxcc/core';
2
- export * from './useAccount';
3
- export * from './useAccounts';
4
- export * from './useAssets';
5
- export * from './useBalances';
6
- export * from './useClaimableBalances';
7
- export * from './useEffects';
8
- export * from './useLedgers';
9
- export * from './useLiquidityPools';
10
- export * from './useNetwork';
11
- export * from './useOffers';
12
- export * from './useOperations';
13
- export * from './useOrderbook';
14
- export * from './usePayments';
15
- export * from './useStrictReceivePaths';
16
- export * from './useStrictSendPaths';
17
- export * from './useTradeAggregation';
18
- export * from './useTrades';
19
- export * from './useTransactions';
20
- export * from './useSwitchNetwork';
@@ -1,7 +0,0 @@
1
- import { UseQueryResult } from '@tanstack/react-query';
2
- import type { GetAccountResult, GetAccountOptions } from '@bluxcc/core/dist/exports/core/getAccount';
3
- import type { QueryOptions } from '../utils';
4
- type R = GetAccountResult;
5
- type O = GetAccountOptions;
6
- export declare function useAccount(options?: O, queryOptions?: QueryOptions<R>): UseQueryResult<R, Error>;
7
- export {};
@@ -1,7 +0,0 @@
1
- import { UseQueryResult } from '@tanstack/react-query';
2
- import type { GetAccountsResult, GetAccountsOptions } from '@bluxcc/core/dist/exports/core/getAccounts';
3
- import type { QueryOptions } from '../utils';
4
- type R = GetAccountsResult;
5
- type O = GetAccountsOptions;
6
- export declare function useAccounts(options?: O, queryOptions?: QueryOptions<R>): UseQueryResult<R, Error>;
7
- export {};
@@ -1,7 +0,0 @@
1
- import { UseQueryResult } from '@tanstack/react-query';
2
- import type { GetAssetsResult, GetAssetsOptions } from "@bluxcc/core/dist/exports/core/getAssets";
3
- import type { QueryOptions } from '../utils';
4
- type R = GetAssetsResult;
5
- type O = GetAssetsOptions;
6
- export declare function useAssets(options?: O, queryOptions?: QueryOptions<R>): UseQueryResult<R, Error>;
7
- export {};
@@ -1,7 +0,0 @@
1
- import { UseQueryResult } from '@tanstack/react-query';
2
- import type { GetBalancesResult, GetBalancesOptions } from "@bluxcc/core/dist/exports/core/getBalances";
3
- import type { QueryOptions } from '../utils';
4
- type R = GetBalancesResult;
5
- type O = GetBalancesOptions;
6
- export declare function useBalances(options?: O, queryOptions?: QueryOptions<R>): UseQueryResult<R, Error>;
7
- export {};
@@ -1,7 +0,0 @@
1
- import { UseQueryResult } from '@tanstack/react-query';
2
- import type { GetClaimableBalancesResult, GetClaimableBalancesOptions } from "@bluxcc/core/dist/exports/core/getClaimableBalances";
3
- import type { QueryOptions } from '../utils';
4
- type R = GetClaimableBalancesResult;
5
- type O = GetClaimableBalancesOptions;
6
- export declare function useClaimableBalances(options: O, queryOptions?: QueryOptions<R>): UseQueryResult<R, Error>;
7
- export {};
@@ -1,7 +0,0 @@
1
- import { UseQueryResult } from '@tanstack/react-query';
2
- import type { GetEffectsResult, GetEffectsOptions } from "@bluxcc/core/dist/exports/core/getEffects";
3
- import type { QueryOptions } from '../utils';
4
- type R = GetEffectsResult;
5
- type O = GetEffectsOptions;
6
- export declare function useEffects(options?: O, queryOptions?: QueryOptions<R>): UseQueryResult<R, Error>;
7
- export {};
@@ -1,7 +0,0 @@
1
- import { UseQueryResult } from '@tanstack/react-query';
2
- import type { GetLedgersResult, GetLedgersOptions } from "@bluxcc/core/dist/exports/core/getLedgers";
3
- import type { QueryOptions } from '../utils';
4
- type R = GetLedgersResult;
5
- type O = GetLedgersOptions;
6
- export declare function useLedgers(options?: O, queryOptions?: QueryOptions<R>): UseQueryResult<R, Error>;
7
- export {};
@@ -1,7 +0,0 @@
1
- import { UseQueryResult } from '@tanstack/react-query';
2
- import type { GetLiquidityPoolsResult, GetLiquidityPoolsOptions } from "@bluxcc/core/dist/exports/core/getLiquidityPools";
3
- import type { QueryOptions } from '../utils';
4
- type R = GetLiquidityPoolsResult;
5
- type O = GetLiquidityPoolsOptions;
6
- export declare function useLiquidityPools(options?: O, queryOptions?: QueryOptions<R>): UseQueryResult<R, Error>;
7
- export {};
@@ -1 +0,0 @@
1
- export declare const useNetwork: () => string;
@@ -1,7 +0,0 @@
1
- import { UseQueryResult } from '@tanstack/react-query';
2
- import type { GetOffersResult, GetOffersOptions } from "@bluxcc/core/dist/exports/core/getOffers";
3
- import type { QueryOptions } from '../utils';
4
- type R = GetOffersResult;
5
- type O = GetOffersOptions;
6
- export declare function useOffers(options?: O, queryOptions?: QueryOptions<R>): UseQueryResult<R, Error>;
7
- export {};
@@ -1,7 +0,0 @@
1
- import { UseQueryResult } from '@tanstack/react-query';
2
- import type { GetOperationsResult, GetOperationsOptions } from "@bluxcc/core/dist/exports/core/getOperations";
3
- import type { QueryOptions } from '../utils';
4
- type R = GetOperationsResult;
5
- type O = GetOperationsOptions;
6
- export declare function useOperations(options?: O, queryOptions?: QueryOptions<R>): UseQueryResult<R, Error>;
7
- export {};
@@ -1,9 +0,0 @@
1
- import { UseQueryResult } from '@tanstack/react-query';
2
- import type { GetOrderbookResult } from "@bluxcc/core/dist/exports/core/getOrderbook";
3
- import { Asset } from '@stellar/stellar-sdk';
4
- import { CallBuilderOptions } from '../utils';
5
- import type { QueryOptions } from '../utils';
6
- type R = GetOrderbookResult;
7
- type O = CallBuilderOptions;
8
- export declare function useOrderbook(args: [selling: Asset, buying: Asset], options?: O, queryOptions?: QueryOptions<R>): UseQueryResult<R, Error>;
9
- export {};
@@ -1,12 +0,0 @@
1
- import { UseQueryResult } from '@tanstack/react-query';
2
- import type { GetPaymentsOptions } from "@bluxcc/core/dist/exports/core/getPayments";
3
- import { PaymentCallBuilder } from '@stellar/stellar-sdk/lib/horizon/payment_call_builder';
4
- import { ServerApi } from '@stellar/stellar-sdk/lib/horizon';
5
- import type { QueryOptions } from '../utils';
6
- type R = {
7
- builder: PaymentCallBuilder;
8
- response: ServerApi.CollectionPage<ServerApi.CreateAccountOperationRecord | ServerApi.PaymentOperationRecord | ServerApi.PathPaymentOperationRecord | ServerApi.AccountMergeOperationRecord | ServerApi.PathPaymentStrictSendOperationRecord | ServerApi.InvokeHostFunctionOperationRecord>;
9
- };
10
- type O = GetPaymentsOptions;
11
- export declare function usePayments(options?: O, queryOptions?: QueryOptions<R>): UseQueryResult<R, Error>;
12
- export {};
@@ -1,13 +0,0 @@
1
- import { UseQueryResult } from '@tanstack/react-query';
2
- import type { GetPaymentPathResult } from "@bluxcc/core/dist/exports/core/getStrictReceivePaths";
3
- import { Asset } from '@stellar/stellar-sdk';
4
- import { CallBuilderOptions } from '../utils';
5
- import type { QueryOptions } from '../utils';
6
- type R = GetPaymentPathResult;
7
- type O = CallBuilderOptions;
8
- export declare function useStrictReceivePaths(args: [
9
- source: string | Asset[],
10
- destinationAsset: Asset,
11
- destinationAmount: string
12
- ], options?: O, queryOptions?: QueryOptions<R>): UseQueryResult<R, Error>;
13
- export {};
@@ -1,13 +0,0 @@
1
- import { UseQueryResult } from '@tanstack/react-query';
2
- import type { GetPaymentPathResult } from "@bluxcc/core/dist/exports/core/getStrictSendPaths";
3
- import { Asset } from '@stellar/stellar-sdk';
4
- import { CallBuilderOptions } from '../utils';
5
- import type { QueryOptions } from '../utils';
6
- type R = GetPaymentPathResult;
7
- type O = CallBuilderOptions;
8
- export declare function useStrictSendPaths(args: [
9
- sourceAsset: Asset,
10
- sourceAmount: string,
11
- destination: string | Asset[]
12
- ], options?: O, queryOptions?: QueryOptions<R>): UseQueryResult<R, Error>;
13
- export {};
@@ -1,10 +0,0 @@
1
- export declare const useSwitchNetwork: () => {
2
- networks: {
3
- mainnet: import("@stellar/stellar-base").Networks;
4
- testnet: import("@stellar/stellar-base").Networks;
5
- sandbox: import("@stellar/stellar-base").Networks;
6
- futurenet: import("@stellar/stellar-base").Networks;
7
- standalone: import("@stellar/stellar-base").Networks;
8
- };
9
- switchNetwork: (newNetwork: string) => void;
10
- };
@@ -1,16 +0,0 @@
1
- import { UseQueryResult } from '@tanstack/react-query';
2
- import type { GetTradeAggregationResult } from "@bluxcc/core/dist/exports/core/getTradeAggregation";
3
- import { Asset } from '@stellar/stellar-sdk';
4
- import { CallBuilderOptions } from '../utils';
5
- import type { QueryOptions } from '../utils';
6
- type R = GetTradeAggregationResult;
7
- type O = CallBuilderOptions;
8
- export declare function useTradeAggregation(args: [
9
- base: Asset,
10
- counter: Asset,
11
- start_time: number,
12
- end_time: number,
13
- resolution: number,
14
- offset: number
15
- ], options?: O, queryOptions?: QueryOptions<R>): UseQueryResult<R, Error>;
16
- export {};
@@ -1,7 +0,0 @@
1
- import { UseQueryResult } from '@tanstack/react-query';
2
- import type { GetTradesResult, GetTradesOptions } from "@bluxcc/core/dist/exports/core/getTrades";
3
- import type { QueryOptions } from "../utils";
4
- type R = GetTradesResult;
5
- type O = GetTradesOptions;
6
- export declare function useTrades(options?: O, queryOptions?: QueryOptions<R>): UseQueryResult<R, Error>;
7
- export {};
@@ -1,7 +0,0 @@
1
- import { UseQueryResult } from '@tanstack/react-query';
2
- import type { GetTransactionsResult, GetTransactionsOptions } from "@bluxcc/core/dist/exports/core/getTransactions";
3
- import type { QueryOptions } from "../utils";
4
- type R = GetTransactionsResult;
5
- type O = GetTransactionsOptions;
6
- export declare function useTransactions(options?: O, queryOptions?: QueryOptions<R>): UseQueryResult<R, Error>;
7
- export {};
package/dist/utils.d.ts DELETED
@@ -1,11 +0,0 @@
1
- import { UseQueryOptions } from '@tanstack/react-query';
2
- export type CallBuilderOptions = {
3
- cursor?: string;
4
- limit?: number;
5
- network?: string;
6
- order?: 'asc' | 'desc';
7
- };
8
- export type QueryOptions<T> = Omit<UseQueryOptions<T, Error>, "queryKey" | "queryFn">;
9
- export declare const checkConfigCreated: () => boolean;
10
- export declare const getAddress: (address?: string) => string;
11
- export declare const getNetwork: (network?: string) => string | undefined;