@gardenfi/core 2.5.2-beta.2 → 2.5.2-beta.4

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/README.md CHANGED
@@ -10,8 +10,8 @@ yarn add `@gardenfi/core`
10
10
 
11
11
  ## Usage
12
12
 
13
- 1. Creating an atomic swap: ([should create an order with valid parameters](https://github.com/catalogfi/garden.js/blob/main/packages/core/src/lib/garden/garden.spec.ts#L150))
14
- 2. Interacting with created orders: ([should initiate and redeem](https://github.com/catalogfi/garden.js/blob/main/packages/core/src/lib/garden/garden.spec.ts#L197))
13
+ 1. Creating an atomic swap: ([should create an order with valid parameters](https://github.com/hashiraio/garden.js/blob/main/packages/core/src/lib/garden/garden.spec.ts#L150))
14
+ 2. Interacting with created orders: ([should initiate and redeem](https://github.com/hashiraio/garden.js/blob/main/packages/core/src/lib/garden/garden.spec.ts#L197))
15
15
 
16
16
  ## Setup
17
17
 
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-s2tkcnpk.cjs");class w extends e.BaseError{constructor({callbackSelector:o,cause:a,data:c,extraData:u,sender:d,urls:r}){var n;super(a.shortMessage||"An error occurred while fetching for an offchain result.",{cause:a,metaMessages:[...a.metaMessages||[],(n=a.metaMessages)!=null&&n.length?"":[],"Offchain Gateway Call:",r&&[" Gateway URL(s):",...r.map(f=>` ${e.getUrl(f)}`)],` Sender: ${d}`,` Data: ${c}`,` Callback selector: ${o}`,` Extra data: ${u}`].flat(),name:"OffchainLookupError"})}}class k extends e.BaseError{constructor({result:o,url:a}){super("Offchain gateway response is malformed. Response data must be a hex value.",{metaMessages:[`Gateway URL: ${e.getUrl(a)}`,`Response: ${e.stringify(o)}`],name:"OffchainLookupResponseMalformedError"})}}class b extends e.BaseError{constructor({sender:o,to:a}){super("Reverted sender address does not match target contract address (`to`).",{metaMessages:[`Contract address: ${a}`,`OffchainLookup sender address: ${o}`],name:"OffchainLookupSenderMismatchError"})}}const L="0x556f1830",y={name:"OffchainLookup",type:"error",inputs:[{name:"sender",type:"address"},{name:"urls",type:"string[]"},{name:"callData",type:"bytes"},{name:"callbackFunction",type:"bytes4"},{name:"extraData",type:"bytes"}]};async function E(i,{blockNumber:o,blockTag:a,data:c,to:u}){const{args:d}=e.decodeErrorResult({data:c,abi:[y]}),[r,n,f,l,s]=d,{ccipRead:t}=i,h=t&&typeof(t==null?void 0:t.request)=="function"?t.request:m;try{if(!e.isAddressEqual(u,r))throw new b({sender:r,to:u});const p=n.includes(e.localBatchGatewayUrl)?await e.localBatchGatewayRequest({data:f,ccipRequest:h}):await h({data:f,sender:r,urls:n}),{data:g}=await e.call(i,{blockNumber:o,blockTag:a,data:e.concat([l,e.encodeAbiParameters([{type:"bytes"},{type:"bytes"}],[p,s])]),to:u});return g}catch(p){throw new w({callbackSelector:l,cause:p,data:c,extraData:s,sender:r,urls:n})}}async function m({data:i,sender:o,urls:a}){var u;let c=new Error("An unknown error occurred.");for(let d=0;d<a.length;d++){const r=a[d],n=r.includes("{data}")?"GET":"POST",f=n==="POST"?{data:i,sender:o}:void 0,l=n==="POST"?{"Content-Type":"application/json"}:{};try{const s=await fetch(r.replace("{sender}",o.toLowerCase()).replace("{data}",i),{body:JSON.stringify(f),headers:l,method:n});let t;if((u=s.headers.get("Content-Type"))!=null&&u.startsWith("application/json")?t=(await s.json()).data:t=await s.text(),!s.ok){c=new e.HttpRequestError({body:f,details:t!=null&&t.error?e.stringify(t.error):s.statusText,headers:s.headers,status:s.status,url:r});continue}if(!e.isHex(t)){c=new k({result:t,url:r});continue}return t}catch(s){c=new e.HttpRequestError({body:f,details:s.message,url:r})}}throw c}exports.ccipRequest=m;exports.offchainLookup=E;exports.offchainLookupAbiItem=y;exports.offchainLookupSignature=L;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-9VBMeQEM.cjs");class w extends e.BaseError{constructor({callbackSelector:o,cause:a,data:c,extraData:u,sender:d,urls:r}){var n;super(a.shortMessage||"An error occurred while fetching for an offchain result.",{cause:a,metaMessages:[...a.metaMessages||[],(n=a.metaMessages)!=null&&n.length?"":[],"Offchain Gateway Call:",r&&[" Gateway URL(s):",...r.map(f=>` ${e.getUrl(f)}`)],` Sender: ${d}`,` Data: ${c}`,` Callback selector: ${o}`,` Extra data: ${u}`].flat(),name:"OffchainLookupError"})}}class k extends e.BaseError{constructor({result:o,url:a}){super("Offchain gateway response is malformed. Response data must be a hex value.",{metaMessages:[`Gateway URL: ${e.getUrl(a)}`,`Response: ${e.stringify(o)}`],name:"OffchainLookupResponseMalformedError"})}}class b extends e.BaseError{constructor({sender:o,to:a}){super("Reverted sender address does not match target contract address (`to`).",{metaMessages:[`Contract address: ${a}`,`OffchainLookup sender address: ${o}`],name:"OffchainLookupSenderMismatchError"})}}const L="0x556f1830",y={name:"OffchainLookup",type:"error",inputs:[{name:"sender",type:"address"},{name:"urls",type:"string[]"},{name:"callData",type:"bytes"},{name:"callbackFunction",type:"bytes4"},{name:"extraData",type:"bytes"}]};async function E(i,{blockNumber:o,blockTag:a,data:c,to:u}){const{args:d}=e.decodeErrorResult({data:c,abi:[y]}),[r,n,f,l,s]=d,{ccipRead:t}=i,h=t&&typeof(t==null?void 0:t.request)=="function"?t.request:m;try{if(!e.isAddressEqual(u,r))throw new b({sender:r,to:u});const p=n.includes(e.localBatchGatewayUrl)?await e.localBatchGatewayRequest({data:f,ccipRequest:h}):await h({data:f,sender:r,urls:n}),{data:g}=await e.call(i,{blockNumber:o,blockTag:a,data:e.concat([l,e.encodeAbiParameters([{type:"bytes"},{type:"bytes"}],[p,s])]),to:u});return g}catch(p){throw new w({callbackSelector:l,cause:p,data:c,extraData:s,sender:r,urls:n})}}async function m({data:i,sender:o,urls:a}){var u;let c=new Error("An unknown error occurred.");for(let d=0;d<a.length;d++){const r=a[d],n=r.includes("{data}")?"GET":"POST",f=n==="POST"?{data:i,sender:o}:void 0,l=n==="POST"?{"Content-Type":"application/json"}:{};try{const s=await fetch(r.replace("{sender}",o.toLowerCase()).replace("{data}",i),{body:JSON.stringify(f),headers:l,method:n});let t;if((u=s.headers.get("Content-Type"))!=null&&u.startsWith("application/json")?t=(await s.json()).data:t=await s.text(),!s.ok){c=new e.HttpRequestError({body:f,details:t!=null&&t.error?e.stringify(t.error):s.statusText,headers:s.headers,status:s.status,url:r});continue}if(!e.isHex(t)){c=new k({result:t,url:r});continue}return t}catch(s){c=new e.HttpRequestError({body:f,details:s.message,url:r})}}throw c}exports.ccipRequest=m;exports.offchainLookup=E;exports.offchainLookupAbiItem=y;exports.offchainLookupSignature=L;
@@ -1,4 +1,4 @@
1
- import { B as p, g as m, s as w, d as k, i as b, l as L, a as O, c as E, b as x, e as R, H as y, f as M } from "./index-D-NHDZrP.js";
1
+ import { B as p, g as m, s as w, d as k, i as b, l as L, a as O, c as E, b as x, e as R, H as y, f as M } from "./index-BsWv07Gh.js";
2
2
  class S extends p {
3
3
  constructor({ callbackSelector: r, cause: a, data: n, extraData: i, sender: f, urls: t }) {
4
4
  var o;