@gardenfi/core 2.1.13-beta.1 → 2.1.13

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.
Files changed (48) hide show
  1. package/dist/{ccip-BXXQdKCk.js → ccip-BopIsmm6.js} +1 -1
  2. package/dist/{ccip-BPvhtZVs.cjs → ccip-CL6RUZeo.cjs} +1 -1
  3. package/dist/index-CBKJdpVQ.js +19741 -0
  4. package/dist/index-CCzvHnk1.cjs +71 -0
  5. package/dist/index.cjs +1 -1
  6. package/dist/index.js +26 -29
  7. package/dist/secp256k1-CHT9yKLe.js +1287 -0
  8. package/dist/secp256k1-CTwfGMq7.cjs +1 -0
  9. package/dist/src/index.d.ts +0 -4
  10. package/dist/src/lib/bitcoin/htlc.d.ts +1 -2
  11. package/dist/src/lib/blockNumberFetcher/blockNumber.d.ts +2 -1
  12. package/dist/src/lib/evm/htlc/evmHTLC.d.ts +1 -1
  13. package/dist/src/lib/evm/htlc/evmHTLC.types.d.ts +2 -2
  14. package/dist/src/lib/evm/relay/evmRelay.types.d.ts +2 -1
  15. package/dist/src/lib/garden/garden.d.ts +3 -2
  16. package/dist/src/lib/garden/garden.types.d.ts +3 -2
  17. package/dist/src/lib/quote/quote.d.ts +4 -4
  18. package/dist/src/lib/quote/quote.types.d.ts +2 -1
  19. package/dist/src/lib/secretManager/secretManager.d.ts +5 -5
  20. package/dist/src/lib/secretManager/secretManager.types.d.ts +2 -1
  21. package/dist/src/lib/starknet/checkAllowanceAndApprove.d.ts +1 -1
  22. package/dist/src/lib/starknet/htlc/starknetHTLC.d.ts +2 -1
  23. package/dist/src/lib/starknet/relay/starknetRelay.d.ts +2 -1
  24. package/dist/src/lib/starknet/starknetHTLC.types.d.ts +1 -1
  25. package/dist/src/lib/switchOrAddNetwork.d.ts +1 -1
  26. package/dist/src/lib/utils.d.ts +2 -7
  27. package/package.json +6 -9
  28. package/dist/index-aA31HWlp.js +0 -17529
  29. package/dist/index-b1gDfQbf.cjs +0 -87
  30. package/dist/secp256k1-DHG1zBMZ.cjs +0 -1
  31. package/dist/secp256k1-s7xFvDmD.js +0 -1297
  32. package/dist/src/lib/bitcoin/API.d.ts +0 -4
  33. package/dist/src/lib/bitcoin/ASConfig.d.ts +0 -19
  34. package/dist/src/lib/bitcoin/errors.d.ts +0 -16
  35. package/dist/src/lib/bitcoin/htlcScript.d.ts +0 -7
  36. package/dist/src/lib/bitcoin/interface.d.ts +0 -6
  37. package/dist/src/lib/bitcoin/paths.d.ts +0 -7
  38. package/dist/src/lib/bitcoin/provider/provider.d.ts +0 -118
  39. package/dist/src/lib/bitcoin/provider/provider.interface.d.ts +0 -99
  40. package/dist/src/lib/bitcoin/script.d.ts +0 -6
  41. package/dist/src/lib/bitcoin/sig.d.ts +0 -20
  42. package/dist/src/lib/bitcoin/utils.d.ts +0 -8
  43. package/dist/src/lib/bitcoin/wallet/abstractWallet.d.ts +0 -145
  44. package/dist/src/lib/bitcoin/wallet/baseWallet.d.ts +0 -13
  45. package/dist/src/lib/bitcoin/wallet/wallet.d.ts +0 -103
  46. package/dist/src/lib/bitcoin/wallet/wallet.interface.d.ts +0 -79
  47. package/dist/src/lib/htlc.interface.d.ts +0 -7
  48. package/dist/src/lib/identifier.d.ts +0 -19
@@ -1,4 +1,4 @@
1
- import { s as b, t as O, f as x, A as N, d as P, g as F, a as E, b as S, e as w, c as $, h as A, i as I, I as D, j as m, k as G, B as y, l as L, m as q, n as T, o as C, p as H, q as j, H as R, r as v } from "./index-aA31HWlp.js";
1
+ import { s as b, t as O, f as x, A as N, d as P, g as F, a as E, b as S, e as w, c as $, h as A, i as I, I as D, j as m, k as G, B as y, l as L, m as q, n as T, o as C, p as H, q as j, H as R, r as v } from "./index-CBKJdpVQ.js";
2
2
  function B(a) {
3
3
  const { abi: r, data: e } = a, s = b(e, 0, 4), t = r.find((o) => o.type === "function" && s === O(x(o)));
4
4
  if (!t)
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-b1gDfQbf.cjs");function A(a){const{abi:o,data:r}=a,n=e.slice(r,0,4),t=o.find(c=>c.type==="function"&&n===e.toFunctionSelector(e.formatAbiItem(c)));if(!t)throw new e.AbiFunctionSignatureNotFoundError(n,{docsPath:"/docs/contract/decodeFunctionData"});return{functionName:t.name,args:"inputs"in t&&t.inputs&&t.inputs.length>0?e.decodeAbiParameters(t.inputs,e.slice(r,4)):void 0}}const h="/docs/contract/encodeErrorResult";function b(a){const{abi:o,errorName:r,args:n}=a;let t=o[0];if(r){const d=e.getAbiItem({abi:o,args:n,name:r});if(!d)throw new e.AbiErrorNotFoundError(r,{docsPath:h});t=d}if(t.type!=="error")throw new e.AbiErrorNotFoundError(void 0,{docsPath:h});const c=e.formatAbiItem(t),s=e.toFunctionSelector(c);let i="0x";if(n&&n.length>0){if(!t.inputs)throw new e.AbiErrorInputsNotFoundError(t.name,{docsPath:h});i=e.encodeAbiParameters(t.inputs,n)}return e.concatHex([s,i])}const m="/docs/contract/encodeFunctionResult";function R(a){const{abi:o,functionName:r,result:n}=a;let t=o[0];if(r){const s=e.getAbiItem({abi:o,name:r});if(!s)throw new e.AbiFunctionNotFoundError(r,{docsPath:m});t=s}if(t.type!=="function")throw new e.AbiFunctionNotFoundError(void 0,{docsPath:m});if(!t.outputs)throw new e.AbiFunctionOutputsNotFoundError(t.name,{docsPath:m});const c=(()=>{if(t.outputs.length===0)return[];if(t.outputs.length===1)return[n];if(Array.isArray(n))return n;throw new e.InvalidArrayError(n)})();return e.encodeAbiParameters(t.outputs,c)}const k="x-batch-gateway:true";async function F(a){const{data:o,ccipRequest:r}=a,{args:[n]}=A({abi:e.batchGatewayAbi,data:o}),t=[],c=[];return await Promise.all(n.map(async(s,i)=>{try{c[i]=await r(s),t[i]=!1}catch(d){t[i]=!0,c[i]=L(d)}})),R({abi:e.batchGatewayAbi,functionName:"query",result:[t,c]})}function L(a){return a.name==="HttpRequestError"&&a.status?b({abi:e.batchGatewayAbi,errorName:"HttpError",args:[a.status,a.shortMessage]}):b({abi:[e.solidityError],errorName:"Error",args:["shortMessage"in a?a.shortMessage:a.message]})}class O extends e.BaseError{constructor({callbackSelector:o,cause:r,data:n,extraData:t,sender:c,urls:s}){var i;super(r.shortMessage||"An error occurred while fetching for an offchain result.",{cause:r,metaMessages:[...r.metaMessages||[],(i=r.metaMessages)!=null&&i.length?"":[],"Offchain Gateway Call:",s&&[" Gateway URL(s):",...s.map(d=>` ${e.getUrl(d)}`)],` Sender: ${c}`,` Data: ${n}`,` Callback selector: ${o}`,` Extra data: ${t}`].flat(),name:"OffchainLookupError"})}}class q extends e.BaseError{constructor({result:o,url:r}){super("Offchain gateway response is malformed. Response data must be a hex value.",{metaMessages:[`Gateway URL: ${e.getUrl(r)}`,`Response: ${e.stringify(o)}`],name:"OffchainLookupResponseMalformedError"})}}class P extends e.BaseError{constructor({sender:o,to:r}){super("Reverted sender address does not match target contract address (`to`).",{metaMessages:[`Contract address: ${r}`,`OffchainLookup sender address: ${o}`],name:"OffchainLookupSenderMismatchError"})}}const S="0x556f1830",w={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 x(a,{blockNumber:o,blockTag:r,data:n,to:t}){const{args:c}=e.decodeErrorResult({data:n,abi:[w]}),[s,i,d,l,f]=c,{ccipRead:u}=a,y=u&&typeof(u==null?void 0:u.request)=="function"?u.request:g;try{if(!e.isAddressEqual(t,s))throw new P({sender:s,to:t});const p=i.includes(k)?await F({data:d,ccipRequest:y}):await y({data:d,sender:s,urls:i}),{data:E}=await e.call(a,{blockNumber:o,blockTag:r,data:e.concat([l,e.encodeAbiParameters([{type:"bytes"},{type:"bytes"}],[p,f])]),to:t});return E}catch(p){throw new O({callbackSelector:l,cause:p,data:n,extraData:f,sender:s,urls:i})}}async function g({data:a,sender:o,urls:r}){var t;let n=new Error("An unknown error occurred.");for(let c=0;c<r.length;c++){const s=r[c],i=s.includes("{data}")?"GET":"POST",d=i==="POST"?{data:a,sender:o}:void 0,l=i==="POST"?{"Content-Type":"application/json"}:{};try{const f=await fetch(s.replace("{sender}",o.toLowerCase()).replace("{data}",a),{body:JSON.stringify(d),headers:l,method:i});let u;if((t=f.headers.get("Content-Type"))!=null&&t.startsWith("application/json")?u=(await f.json()).data:u=await f.text(),!f.ok){n=new e.HttpRequestError({body:d,details:u!=null&&u.error?e.stringify(u.error):f.statusText,headers:f.headers,status:f.status,url:s});continue}if(!e.isHex(u)){n=new q({result:u,url:s});continue}return u}catch(f){n=new e.HttpRequestError({body:d,details:f.message,url:s})}}throw n}exports.ccipRequest=g;exports.offchainLookup=x;exports.offchainLookupAbiItem=w;exports.offchainLookupSignature=S;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-CCzvHnk1.cjs");function A(a){const{abi:o,data:r}=a,n=e.slice(r,0,4),t=o.find(c=>c.type==="function"&&n===e.toFunctionSelector(e.formatAbiItem(c)));if(!t)throw new e.AbiFunctionSignatureNotFoundError(n,{docsPath:"/docs/contract/decodeFunctionData"});return{functionName:t.name,args:"inputs"in t&&t.inputs&&t.inputs.length>0?e.decodeAbiParameters(t.inputs,e.slice(r,4)):void 0}}const h="/docs/contract/encodeErrorResult";function b(a){const{abi:o,errorName:r,args:n}=a;let t=o[0];if(r){const d=e.getAbiItem({abi:o,args:n,name:r});if(!d)throw new e.AbiErrorNotFoundError(r,{docsPath:h});t=d}if(t.type!=="error")throw new e.AbiErrorNotFoundError(void 0,{docsPath:h});const c=e.formatAbiItem(t),s=e.toFunctionSelector(c);let i="0x";if(n&&n.length>0){if(!t.inputs)throw new e.AbiErrorInputsNotFoundError(t.name,{docsPath:h});i=e.encodeAbiParameters(t.inputs,n)}return e.concatHex([s,i])}const m="/docs/contract/encodeFunctionResult";function R(a){const{abi:o,functionName:r,result:n}=a;let t=o[0];if(r){const s=e.getAbiItem({abi:o,name:r});if(!s)throw new e.AbiFunctionNotFoundError(r,{docsPath:m});t=s}if(t.type!=="function")throw new e.AbiFunctionNotFoundError(void 0,{docsPath:m});if(!t.outputs)throw new e.AbiFunctionOutputsNotFoundError(t.name,{docsPath:m});const c=(()=>{if(t.outputs.length===0)return[];if(t.outputs.length===1)return[n];if(Array.isArray(n))return n;throw new e.InvalidArrayError(n)})();return e.encodeAbiParameters(t.outputs,c)}const k="x-batch-gateway:true";async function F(a){const{data:o,ccipRequest:r}=a,{args:[n]}=A({abi:e.batchGatewayAbi,data:o}),t=[],c=[];return await Promise.all(n.map(async(s,i)=>{try{c[i]=await r(s),t[i]=!1}catch(d){t[i]=!0,c[i]=L(d)}})),R({abi:e.batchGatewayAbi,functionName:"query",result:[t,c]})}function L(a){return a.name==="HttpRequestError"&&a.status?b({abi:e.batchGatewayAbi,errorName:"HttpError",args:[a.status,a.shortMessage]}):b({abi:[e.solidityError],errorName:"Error",args:["shortMessage"in a?a.shortMessage:a.message]})}class O extends e.BaseError{constructor({callbackSelector:o,cause:r,data:n,extraData:t,sender:c,urls:s}){var i;super(r.shortMessage||"An error occurred while fetching for an offchain result.",{cause:r,metaMessages:[...r.metaMessages||[],(i=r.metaMessages)!=null&&i.length?"":[],"Offchain Gateway Call:",s&&[" Gateway URL(s):",...s.map(d=>` ${e.getUrl(d)}`)],` Sender: ${c}`,` Data: ${n}`,` Callback selector: ${o}`,` Extra data: ${t}`].flat(),name:"OffchainLookupError"})}}class q extends e.BaseError{constructor({result:o,url:r}){super("Offchain gateway response is malformed. Response data must be a hex value.",{metaMessages:[`Gateway URL: ${e.getUrl(r)}`,`Response: ${e.stringify(o)}`],name:"OffchainLookupResponseMalformedError"})}}class P extends e.BaseError{constructor({sender:o,to:r}){super("Reverted sender address does not match target contract address (`to`).",{metaMessages:[`Contract address: ${r}`,`OffchainLookup sender address: ${o}`],name:"OffchainLookupSenderMismatchError"})}}const S="0x556f1830",w={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 x(a,{blockNumber:o,blockTag:r,data:n,to:t}){const{args:c}=e.decodeErrorResult({data:n,abi:[w]}),[s,i,d,l,f]=c,{ccipRead:u}=a,y=u&&typeof(u==null?void 0:u.request)=="function"?u.request:g;try{if(!e.isAddressEqual(t,s))throw new P({sender:s,to:t});const p=i.includes(k)?await F({data:d,ccipRequest:y}):await y({data:d,sender:s,urls:i}),{data:E}=await e.call(a,{blockNumber:o,blockTag:r,data:e.concat([l,e.encodeAbiParameters([{type:"bytes"},{type:"bytes"}],[p,f])]),to:t});return E}catch(p){throw new O({callbackSelector:l,cause:p,data:n,extraData:f,sender:s,urls:i})}}async function g({data:a,sender:o,urls:r}){var t;let n=new Error("An unknown error occurred.");for(let c=0;c<r.length;c++){const s=r[c],i=s.includes("{data}")?"GET":"POST",d=i==="POST"?{data:a,sender:o}:void 0,l=i==="POST"?{"Content-Type":"application/json"}:{};try{const f=await fetch(s.replace("{sender}",o.toLowerCase()).replace("{data}",a),{body:JSON.stringify(d),headers:l,method:i});let u;if((t=f.headers.get("Content-Type"))!=null&&t.startsWith("application/json")?u=(await f.json()).data:u=await f.text(),!f.ok){n=new e.HttpRequestError({body:d,details:u!=null&&u.error?e.stringify(u.error):f.statusText,headers:f.headers,status:f.status,url:s});continue}if(!e.isHex(u)){n=new q({result:u,url:s});continue}return u}catch(f){n=new e.HttpRequestError({body:d,details:f.message,url:s})}}throw n}exports.ccipRequest=g;exports.offchainLookup=x;exports.offchainLookupAbiItem=w;exports.offchainLookupSignature=S;