@gardenfi/react-hooks 0.0.2-beta.2 → 0.0.2-beta.20

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/index2.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react"),q=require("./index3.cjs"),s=require("@gardenfi/core"),i=require("@catalogfi/utils"),m=require("@gardenfi/orderbook"),x=require("./index5.cjs"),w=n.createContext({isExecuting:!1,isExecutorRequired:!1}),S=({children:u,config:a})=>{const[e,v]=n.useState(),[C,O]=n.useState(),{pendingOrders:d}=q.useOrderbook(e),E=n.useMemo(()=>!!(e!=null&&e.secretManager.isInitialized),[e]),f=n.useMemo(()=>!!d.find(r=>{const t=r.status;return t===s.OrderStatus.InitiateDetected||t===s.OrderStatus.Initiated||t===s.OrderStatus.CounterPartyInitiateDetected||t===s.OrderStatus.CounterPartyInitiated||t===s.OrderStatus.RedeemDetected||t===s.OrderStatus.Expired}),[d]),G=async r=>{if(!e||!a.walletClient)return i.Err("Garden not initialized");const t=await e.swap(r);if(t.error)return i.Err(t.error);if(m.isBitcoin(t.val.source_swap.chain))return i.Ok(t.val);const o=await s.switchOrAddNetwork(r.fromAsset.chain,a.walletClient);if(o.error)return i.Err("Failed to switch network: "+o.error);const l=o.val.walletClient,c=await e.evmRelay.init(l,t.val);if(c.error)return i.Err(c.error);const h={...t.val,source_swap:{...t.val.source_swap,initiate_tx_hash:c.val}};return i.Ok(h)};return n.useEffect(()=>{var r;if(a.walletClient){if(!((r=a.walletClient.account)!=null&&r.address))throw new Error("WalletClient doesn't have an account");v(new s.Garden({environment:a.environment,evmWallet:a.walletClient}))}},[a.walletClient]),n.useEffect(()=>{e&&O(()=>async({fromAsset:r,toAsset:t,amount:o,isExactOut:l=!1})=>await e.quote.getQuote(x.constructOrderpair(r,t),o,l))},[e]),n.createElement(w.Provider,{value:{orderBook:e==null?void 0:e.orderbook,quote:e==null?void 0:e.quote,swapAndInitiate:G,pendingOrders:d,getQuote:C,garden:e,isExecuting:E,isExecutorRequired:f}},u)},k=()=>{const u=n.useContext(w);if(!u)throw new Error("useGarden must be used within a GardenProvider");return u};exports.GardenContext=w;exports.GardenProvider=S;exports.useGarden=k;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react"),x=require("./index3.cjs"),n=require("@gardenfi/core"),a=require("./index5.cjs"),h=require("@gardenfi/orderbook"),G=require("./index6.cjs"),v=s.createContext({isExecuting:!1,isExecutorRequired:!1}),_=({children:d,config:t})=>{const[i,O]=s.useState(),{pendingOrders:c,isExecuting:C}=x.useOrderbook(i),E=s.useMemo(()=>!!c.find(r=>{const e=r.status;return e===n.OrderStatus.InitiateDetected||e===n.OrderStatus.Initiated||e===n.OrderStatus.CounterPartyInitiateDetected||e===n.OrderStatus.CounterPartyInitiated||e===n.OrderStatus.RedeemDetected||e===n.OrderStatus.Expired}),[c]),w=s.useMemo(()=>new n.Quote(t.quoteUrl||n.API[t.environment].quote),[t.quoteUrl,t.environment]),m=s.useMemo(()=>async({fromAsset:r,toAsset:e,amount:o,isExactOut:u=!1,request:l})=>await w.getQuote(G.constructOrderpair(r,e),o,u,l),[w]),p=async r=>{if(!i||!t.walletClient)return a.Err("Garden not initialized");const e=await i.swap(r);if(e.error)return a.Err(e.error);if(h.isBitcoin(e.val.source_swap.chain))return a.Ok(e.val);const o=await n.switchOrAddNetwork(r.fromAsset.chain,t.walletClient);if(o.error)return a.Err("Failed to switch network: "+o.error);const u=o.val.walletClient,l=await i.evmRelay.init(u,e.val);if(l.error)return a.Err(l.error);const q={...e.val,source_swap:{...e.val.source_swap,initiate_tx_hash:l.val}};return a.Ok(q)},k=async r=>{if(!i||!t.walletClient)return a.Err("garden not initialized");if(h.isBitcoin(r.source_swap.chain))return a.Err("Not an EVM order: sourceSwap.chain is Bitcoin");const e=await n.switchOrAddNetwork(r.source_swap.chain,t.walletClient);if(e.error)return a.Err("Failed to switch network: "+e.error);const o=e.val.walletClient,u=await i.evmRelay.init(o,r);if(u.error)return a.Err(u.error);const l={...r,source_swap:{...r.source_swap,initiate_tx_hash:u.val}};return a.Ok(l)};return s.useEffect(()=>{var r;if(t.walletClient){if(!((r=t.walletClient.account)!=null&&r.address))throw new Error("WalletClient doesn't have an account");O(new n.Garden({environment:t.environment,evmWallet:t.walletClient,siweOpts:t.siweOpts??{domain:window.location.hostname,store:t.store}}))}},[t.walletClient]),s.createElement(v.Provider,{value:{orderBook:i==null?void 0:i.orderbook,quote:w,swapAndInitiate:p,pendingOrders:c,getQuote:m,garden:i,isExecuting:C,isExecutorRequired:E,evmInitiate:k}},d)},R=()=>{const d=s.useContext(v);if(!d)throw new Error("useGarden must be used within a GardenProvider");return d};exports.GardenContext=v;exports.GardenProvider=_;exports.useGarden=R;
package/dist/index2.js CHANGED
@@ -1,90 +1,116 @@
1
- import v, { createContext as k, useState as d, useMemo as w, useEffect as m } from "react";
2
- import { useOrderbook as I } from "./index3.js";
3
- import { OrderStatus as i, Garden as q, switchOrAddNetwork as y } from "@gardenfi/core";
4
- import { Err as s, Ok as f } from "@catalogfi/utils";
5
- import { isBitcoin as P } from "@gardenfi/orderbook";
6
- import { constructOrderpair as _ } from "./index5.js";
7
- const p = k({
1
+ import h, { createContext as k, useState as y, useMemo as d, useEffect as I } from "react";
2
+ import { useOrderbook as q } from "./index3.js";
3
+ import { OrderStatus as l, Quote as P, API as W, Garden as A, switchOrAddNetwork as p } from "@gardenfi/core";
4
+ import { Err as a, Ok as m } from "./index5.js";
5
+ import { isBitcoin as v } from "@gardenfi/orderbook";
6
+ import { constructOrderpair as b } from "./index6.js";
7
+ const C = k({
8
8
  isExecuting: !1,
9
9
  isExecutorRequired: !1
10
- }), B = ({
11
- children: a,
12
- config: n
10
+ }), M = ({
11
+ children: u,
12
+ config: t
13
13
  }) => {
14
- const [e, C] = d(), [h, x] = d(), { pendingOrders: u } = I(e), E = w(() => !!(e != null && e.secretManager.isInitialized), [e]), G = w(() => !!u.find((r) => {
15
- const t = r.status;
16
- return t === i.InitiateDetected || t === i.Initiated || t === i.CounterPartyInitiateDetected || t === i.CounterPartyInitiated || t === i.RedeemDetected || t === i.Expired;
17
- }), [u]), O = async (r) => {
18
- if (!e || !n.walletClient) return s("Garden not initialized");
19
- const t = await e.swap(r);
20
- if (t.error) return s(t.error);
21
- if (P(t.val.source_swap.chain)) return f(t.val);
22
- const o = await y(
14
+ const [n, f] = y(), { pendingOrders: c, isExecuting: x } = q(n), E = d(() => !!c.find((r) => {
15
+ const e = r.status;
16
+ return e === l.InitiateDetected || e === l.Initiated || e === l.CounterPartyInitiateDetected || e === l.CounterPartyInitiated || e === l.RedeemDetected || e === l.Expired;
17
+ }), [c]), w = d(() => new P(t.quoteUrl || W[t.environment].quote), [t.quoteUrl, t.environment]), _ = d(
18
+ () => async ({
19
+ fromAsset: r,
20
+ toAsset: e,
21
+ amount: i,
22
+ isExactOut: o = !1,
23
+ request: s
24
+ }) => await w.getQuote(
25
+ b(r, e),
26
+ i,
27
+ o,
28
+ s
29
+ ),
30
+ [w]
31
+ ), O = async (r) => {
32
+ if (!n || !t.walletClient) return a("Garden not initialized");
33
+ const e = await n.swap(r);
34
+ if (e.error) return a(e.error);
35
+ if (v(e.val.source_swap.chain)) return m(e.val);
36
+ const i = await p(
23
37
  r.fromAsset.chain,
24
- n.walletClient
38
+ t.walletClient
25
39
  );
26
- if (o.error)
27
- return s("Failed to switch network: " + o.error);
28
- const l = o.val.walletClient, c = await e.evmRelay.init(l, t.val);
29
- if (c.error) return s(c.error);
30
- const R = {
31
- ...t.val,
40
+ if (i.error)
41
+ return a("Failed to switch network: " + i.error);
42
+ const o = i.val.walletClient, s = await n.evmRelay.init(o, e.val);
43
+ if (s.error) return a(s.error);
44
+ const G = {
45
+ ...e.val,
32
46
  source_swap: {
33
- ...t.val.source_swap,
34
- initiate_tx_hash: c.val
47
+ ...e.val.source_swap,
48
+ initiate_tx_hash: s.val
35
49
  }
36
50
  };
37
- return f(R);
51
+ return m(G);
52
+ }, R = async (r) => {
53
+ if (!n || !t.walletClient) return a("garden not initialized");
54
+ if (v(r.source_swap.chain))
55
+ return a("Not an EVM order: sourceSwap.chain is Bitcoin");
56
+ const e = await p(
57
+ r.source_swap.chain,
58
+ t.walletClient
59
+ );
60
+ if (e.error)
61
+ return a("Failed to switch network: " + e.error);
62
+ const i = e.val.walletClient, o = await n.evmRelay.init(i, r);
63
+ if (o.error) return a(o.error);
64
+ const s = {
65
+ ...r,
66
+ source_swap: {
67
+ ...r.source_swap,
68
+ initiate_tx_hash: o.val
69
+ }
70
+ };
71
+ return m(s);
38
72
  };
39
- return m(() => {
73
+ return I(() => {
40
74
  var r;
41
- if (n.walletClient) {
42
- if (!((r = n.walletClient.account) != null && r.address))
75
+ if (t.walletClient) {
76
+ if (!((r = t.walletClient.account) != null && r.address))
43
77
  throw new Error("WalletClient doesn't have an account");
44
- C(
45
- new q({
46
- environment: n.environment,
47
- evmWallet: n.walletClient
78
+ f(
79
+ new A({
80
+ environment: t.environment,
81
+ evmWallet: t.walletClient,
82
+ siweOpts: t.siweOpts ?? {
83
+ domain: window.location.hostname,
84
+ store: t.store
85
+ }
48
86
  })
49
87
  );
50
88
  }
51
- }, [n.walletClient]), m(() => {
52
- e && x(
53
- () => async ({
54
- fromAsset: r,
55
- toAsset: t,
56
- amount: o,
57
- isExactOut: l = !1
58
- }) => await e.quote.getQuote(
59
- _(r, t),
60
- o,
61
- l
62
- )
63
- );
64
- }, [e]), /* @__PURE__ */ v.createElement(
65
- p.Provider,
89
+ }, [t.walletClient]), /* @__PURE__ */ h.createElement(
90
+ C.Provider,
66
91
  {
67
92
  value: {
68
- orderBook: e == null ? void 0 : e.orderbook,
69
- quote: e == null ? void 0 : e.quote,
93
+ orderBook: n == null ? void 0 : n.orderbook,
94
+ quote: w,
70
95
  swapAndInitiate: O,
71
- pendingOrders: u,
72
- getQuote: h,
73
- garden: e,
74
- isExecuting: E,
75
- isExecutorRequired: G
96
+ pendingOrders: c,
97
+ getQuote: _,
98
+ garden: n,
99
+ isExecuting: x,
100
+ isExecutorRequired: E,
101
+ evmInitiate: R
76
102
  }
77
103
  },
78
- a
104
+ u
79
105
  );
80
- }, M = () => {
81
- const a = v.useContext(p);
82
- if (!a)
106
+ }, N = () => {
107
+ const u = h.useContext(C);
108
+ if (!u)
83
109
  throw new Error("useGarden must be used within a GardenProvider");
84
- return a;
110
+ return u;
85
111
  };
86
112
  export {
87
- p as GardenContext,
88
- B as GardenProvider,
89
- M as useGarden
113
+ C as GardenContext,
114
+ M as GardenProvider,
115
+ N as useGarden
90
116
  };
package/dist/index3.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("@gardenfi/core"),o=require("react"),f=e=>{const[b,c]=o.useState([]);return o.useEffect(()=>{if(!e||!e.secretManager.isInitialized)return;console.log("started executor",e.secretManager.isInitialized);const n=e.execute(),r=s=>c(s);return e.on("onPendingOrdersChanged",r),()=>{(async()=>(await n)())(),e.off("onPendingOrdersChanged",r)}},[e]),o.useEffect(()=>{e&&e.blockNumberFetcher.fetchBlockNumbers().then(n=>{if(n.error)return;const{val:r}=n;e.orderbook.fetchOrders(!0,!0,{per_page:500}).then(s=>{if(s.error)return;const l=a.filterDeadlineExpiredOrders(s.val.data).map(t=>{const i=r[t.source_swap.chain],u=r[t.destination_swap.chain];if(!i||!u)return;const d=a.ParseOrderStatus(t,i,u);return{...t,status:d}}).filter(t=>t!==void 0);c(l)})})},[e]),{pendingOrders:b}};exports.useOrderbook=f;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("@gardenfi/core"),n=require("react"),O=e=>{const[l,u]=n.useState([]),[c,b]=n.useState(!1);return n.useEffect(()=>{if(!e)return;const t=()=>{e.secretManager.isInitialized&&b(!0)};return t(),e.secretManager.on("initialized",t),()=>{e.secretManager.off("initialized",t)}},[e]),n.useEffect(()=>{if(!e||!c)return;const t=e.execute(),i=s=>u(s);return e.on("onPendingOrdersChanged",i),()=>{(async()=>(await t)())(),e.off("onPendingOrdersChanged",i)}},[e,c]),n.useEffect(()=>{e&&e.blockNumberFetcher.fetchBlockNumbers().then(t=>{if(t.error)return;const{val:i}=t;e.orderbook.fetchOrders(!0,!0,{per_page:500}).then(s=>{if(s.error)return;const d=f.filterDeadlineExpiredOrders(s.val.data).map(r=>{const o=i[r.source_swap.chain],a=i[r.destination_swap.chain];if(!o||!a)return;const h=f.ParseOrderStatus(r,o,a);return{...r,status:h}}).filter(r=>r!==void 0);u(d)})})},[e]),{pendingOrders:l,isExecuting:c}};exports.useOrderbook=O;
package/dist/index3.js CHANGED
@@ -1,40 +1,47 @@
1
- import { filterDeadlineExpiredOrders as l, ParseOrderStatus as d } from "@gardenfi/core";
2
- import { useState as h, useEffect as u } from "react";
3
- const O = (e) => {
4
- const [a, o] = h([]);
5
- return u(() => {
6
- if (!e || !e.secretManager.isInitialized) return;
7
- console.log("started executor", e.secretManager.isInitialized);
8
- const s = e.execute(), r = (n) => o(n);
9
- return e.on("onPendingOrdersChanged", r), () => {
10
- (async () => (await s)())(), e.off("onPendingOrdersChanged", r);
1
+ import { filterDeadlineExpiredOrders as m, ParseOrderStatus as p } from "@gardenfi/core";
2
+ import { useState as f, useEffect as o } from "react";
3
+ const z = (e) => {
4
+ const [l, c] = f([]), [s, b] = f(!1);
5
+ return o(() => {
6
+ if (!e) return;
7
+ const t = () => {
8
+ e.secretManager.isInitialized && b(!0);
11
9
  };
12
- }, [e]), u(() => {
13
- e && e.blockNumberFetcher.fetchBlockNumbers().then((s) => {
14
- if (s.error) return;
15
- const { val: r } = s;
10
+ return t(), e.secretManager.on("initialized", t), () => {
11
+ e.secretManager.off("initialized", t);
12
+ };
13
+ }, [e]), o(() => {
14
+ if (!e || !s) return;
15
+ const t = e.execute(), i = (n) => c(n);
16
+ return e.on("onPendingOrdersChanged", i), () => {
17
+ (async () => (await t)())(), e.off("onPendingOrdersChanged", i);
18
+ };
19
+ }, [e, s]), o(() => {
20
+ e && e.blockNumberFetcher.fetchBlockNumbers().then((t) => {
21
+ if (t.error) return;
22
+ const { val: i } = t;
16
23
  e.orderbook.fetchOrders(!0, !0, {
17
24
  per_page: 500
18
25
  }).then((n) => {
19
26
  if (n.error) return;
20
- const b = l(n.val.data).map((t) => {
21
- const i = r[t.source_swap.chain], c = r[t.destination_swap.chain];
22
- if (!i || !c) return;
23
- const f = d(
24
- t,
25
- i,
26
- c
27
+ const d = m(n.val.data).map((r) => {
28
+ const u = i[r.source_swap.chain], a = i[r.destination_swap.chain];
29
+ if (!u || !a) return;
30
+ const h = p(
31
+ r,
32
+ u,
33
+ a
27
34
  );
28
35
  return {
29
- ...t,
30
- status: f
36
+ ...r,
37
+ status: h
31
38
  };
32
- }).filter((t) => t !== void 0);
33
- o(b);
39
+ }).filter((r) => r !== void 0);
40
+ c(d);
34
41
  });
35
42
  });
36
- }, [e]), { pendingOrders: a };
43
+ }, [e]), { pendingOrders: l, isExecuting: s };
37
44
  };
38
45
  export {
39
- O as useOrderbook
46
+ z as useOrderbook
40
47
  };
package/dist/index5.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=(r,c)=>`${r.chain}:${r.atomicSwapAddress}::${c.chain}:${c.atomicSwapAddress}`;exports.constructOrderpair=a;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var u=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)},l=(e,t,r)=>(u(e,t,"read from private field"),r?r.call(e):t.get(e)),f=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},h=(e,t,r,i)=>(u(e,t,"write to private field"),t.set(e,r),r),n,o,a;class s{constructor(t,r,i=void 0){f(this,n,void 0),f(this,o,void 0),f(this,a,void 0),h(this,n,t),h(this,a,i),h(this,o,r)}get ok(){return l(this,n)}get error(){return l(this,a)}get val(){return l(this,o)}}n=new WeakMap,o=new WeakMap,a=new WeakMap;const d=e=>new s(!0,e),v=(e,...t)=>{if(typeof e=="string"&&t&&t.length>0){let r=[e,...t].map(i=>{if(i){if(i instanceof Error)return i.message;if(typeof i=="string")return i;if(i!=null&&i.toString)return i.toString()}});return new s(!1,null,r.filter(i=>i!==void 0).join(" "))}return new s(!1,null,e)};exports.Err=v;exports.Ok=d;exports.Result=s;
package/dist/index5.js CHANGED
@@ -1,4 +1,48 @@
1
- const r = (a, c) => `${a.chain}:${a.atomicSwapAddress}::${c.chain}:${c.atomicSwapAddress}`;
1
+ var u = (e, t, r) => {
2
+ if (!t.has(e))
3
+ throw TypeError("Cannot " + r);
4
+ }, s = (e, t, r) => (u(e, t, "read from private field"), r ? r.call(e) : t.get(e)), h = (e, t, r) => {
5
+ if (t.has(e))
6
+ throw TypeError("Cannot add the same private member more than once");
7
+ t instanceof WeakSet ? t.add(e) : t.set(e, r);
8
+ }, l = (e, t, r, i) => (u(e, t, "write to private field"), t.set(e, r), r), n, a, o;
9
+ class f {
10
+ constructor(t, r, i = void 0) {
11
+ h(this, n, void 0), h(this, a, void 0), h(this, o, void 0), l(this, n, t), l(this, o, i), l(this, a, r);
12
+ }
13
+ get ok() {
14
+ return s(this, n);
15
+ }
16
+ get error() {
17
+ return s(this, o);
18
+ }
19
+ get val() {
20
+ return s(this, a);
21
+ }
22
+ }
23
+ n = /* @__PURE__ */ new WeakMap(), a = /* @__PURE__ */ new WeakMap(), o = /* @__PURE__ */ new WeakMap();
24
+ const d = (e) => new f(!0, e), p = (e, ...t) => {
25
+ if (typeof e == "string" && t && t.length > 0) {
26
+ let r = [e, ...t].map((i) => {
27
+ if (i) {
28
+ if (i instanceof Error)
29
+ return i.message;
30
+ if (typeof i == "string")
31
+ return i;
32
+ if (i != null && i.toString)
33
+ return i.toString();
34
+ }
35
+ });
36
+ return new f(
37
+ !1,
38
+ null,
39
+ r.filter((i) => i !== void 0).join(" ")
40
+ );
41
+ }
42
+ return new f(!1, null, e);
43
+ };
2
44
  export {
3
- r as constructOrderpair
45
+ p as Err,
46
+ d as Ok,
47
+ f as Result
4
48
  };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=(r,c)=>`${r.chain}:${r.atomicSwapAddress}::${c.chain}:${c.atomicSwapAddress}`;exports.constructOrderpair=a;
package/dist/index6.js ADDED
@@ -0,0 +1,4 @@
1
+ const r = (a, c) => `${a.chain}:${a.atomicSwapAddress}::${c.chain}:${c.atomicSwapAddress}`;
2
+ export {
3
+ r as constructOrderpair
4
+ };
@@ -1,4 +1,5 @@
1
1
  export { GardenProvider, useGarden } from './lib/context/GardenProvider';
2
+ export type { QuoteParams, GardenContextType, GardenProviderProps, } from './lib/context/gardenProvider.types';
2
3
  export { useOrderbook } from './lib/hooks/useOrderbook';
3
4
  export { BitcoinNetwork } from '@catalogfi/wallets';
4
5
  export { environment, GARDEN_CONFIG } from './lib/gardenConfig';
@@ -1,8 +1,8 @@
1
1
  import { WalletClient } from 'viem';
2
2
  import { OrderWithStatus, IGardenJS, IQuote, QuoteResponse, SwapParams } from '@gardenfi/core';
3
- import { AsyncResult, Result } from '@catalogfi/utils';
3
+ import { AsyncResult, Request, Result } from '@catalogfi/utils';
4
4
  import { Asset, IOrderbook, MatchedOrder } from '@gardenfi/orderbook';
5
- import { Environment, IStore } from '@gardenfi/utils';
5
+ import { Environment, IStore, SiweOpts } from '@gardenfi/utils';
6
6
 
7
7
  export type GardenContextType = {
8
8
  /**
@@ -46,6 +46,13 @@ export type GardenContextType = {
46
46
  * @returns {IQuote}
47
47
  */
48
48
  quote?: IQuote;
49
+ /**
50
+ * Initiates the order in the EVM chain. This can be useful if the initiation is failed when `swapAndInitiate` function is called.
51
+ * @param order - The order to initiate.
52
+ * @returns {AsyncResult<MatchedOrder, string>} - The initiated order.
53
+ * @NOTE This is only required if the source chain is EVM.
54
+ */
55
+ evmInitiate?: (order: MatchedOrder) => AsyncResult<MatchedOrder, string>;
49
56
  };
50
57
  export type GardenProviderProps = {
51
58
  children: React.ReactNode;
@@ -57,6 +64,7 @@ export type GardenProviderProps = {
57
64
  quoteUrl?: string;
58
65
  bitcoinRPCUrl?: string;
59
66
  blockNumberFetcherUrl?: string;
67
+ siweOpts?: SiweOpts;
60
68
  };
61
69
  };
62
70
  export type QuoteParams = {
@@ -64,4 +72,5 @@ export type QuoteParams = {
64
72
  toAsset: Asset;
65
73
  amount: number;
66
74
  isExactOut?: boolean;
75
+ request?: Request;
67
76
  };
@@ -2,4 +2,5 @@ import { IGardenJS, OrderWithStatus } from '@gardenfi/core';
2
2
 
3
3
  export declare const useOrderbook: (garden: IGardenJS | undefined) => {
4
4
  pendingOrders: OrderWithStatus[];
5
+ isExecuting: boolean;
5
6
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gardenfi/react-hooks",
3
- "version": "0.0.2-beta.2",
3
+ "version": "0.0.2-beta.20",
4
4
  "type": "module",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.js",
@@ -26,14 +26,12 @@
26
26
  "registry": "https://registry.npmjs.org/"
27
27
  },
28
28
  "dependencies": {
29
- "@catalogfi/utils": "^0.1.6",
30
29
  "@catalogfi/wallets": "^0.2.51",
31
- "@gardenfi/core": "^0.3.0-beta.15",
32
- "@gardenfi/orderbook": "^0.2.0-beta.42",
33
- "@gardenfi/utils": "^0.0.1-beta.20",
30
+ "@gardenfi/core": "^0.3.0-beta.26",
31
+ "@gardenfi/orderbook": "^2.0.0",
32
+ "@gardenfi/utils": "^2.0.0",
34
33
  "react": "^18.3.1",
35
- "viem": "^2.21.15",
36
- "wagmi": "^2.12.16"
34
+ "viem": "^2.21.15"
37
35
  },
38
36
  "devDependencies": {
39
37
  "@types/react": "^18",
File without changes