@gardenfi/swap 0.0.2-beta.3 → 0.0.2-beta.5
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/index106.cjs +1 -1
- package/dist/index106.js +1 -1
- package/dist/index107.cjs +1 -1
- package/dist/index107.js +1 -1
- package/dist/index119.cjs +1 -1
- package/dist/index119.js +1 -1
- package/dist/index12.cjs +1 -1
- package/dist/index12.js +12 -12
- package/dist/index120.cjs +1 -1
- package/dist/index120.js +1 -1
- package/dist/index121.cjs +1 -1
- package/dist/index121.js +1 -1
- package/dist/index122.cjs +1 -1
- package/dist/index122.js +1 -1
- package/dist/index154.cjs +1 -1
- package/dist/index154.js +2 -2
- package/dist/index155.cjs +1 -1
- package/dist/index155.js +2 -2
- package/dist/index156.cjs +1 -1
- package/dist/index156.js +2 -2
- package/dist/index157.cjs +1 -1
- package/dist/index157.js +2 -2
- package/dist/index158.cjs +1 -1
- package/dist/index158.js +2 -2
- package/dist/index159.cjs +1 -1
- package/dist/index159.js +2 -2
- package/dist/index168.cjs +1 -1
- package/dist/index168.js +1 -1
- package/dist/index235.cjs +1 -1
- package/dist/index235.js +1 -1
- package/dist/index236.cjs +1 -1
- package/dist/index236.js +2 -2
- package/dist/index247.cjs +1 -1
- package/dist/index247.js +1 -1
- package/dist/index278.cjs +1 -1
- package/dist/index278.js +1 -1
- package/dist/index299.cjs +1 -1
- package/dist/index299.js +7 -37
- package/dist/index300.cjs +1 -1
- package/dist/index300.js +36 -14
- package/dist/index301.cjs +1 -1
- package/dist/index301.js +15 -8
- package/dist/index302.cjs +1 -1
- package/dist/index302.js +8 -7
- package/dist/index304.cjs +1 -1
- package/dist/index304.js +1 -1
- package/dist/index305.cjs +1 -1
- package/dist/index305.js +1 -1
- package/dist/index311.cjs +1 -1
- package/dist/index311.js +1 -1
- package/dist/index312.cjs +1 -1
- package/dist/index312.js +1 -1
- package/dist/index319.cjs +1 -1
- package/dist/index319.js +103 -6
- package/dist/index320.cjs +1 -1
- package/dist/index320.js +7 -7
- package/dist/index321.cjs +1 -1
- package/dist/index321.js +7 -104
- package/dist/index349.cjs +1 -1
- package/dist/index349.js +4 -77
- package/dist/index350.cjs +2 -1
- package/dist/index350.js +194 -5
- package/dist/index351.cjs +1 -1
- package/dist/index351.js +77 -4
- package/dist/index352.cjs +1 -2
- package/dist/index352.js +317 -167
- package/dist/index353.cjs +1 -1
- package/dist/index353.js +149 -332
- package/dist/index354.cjs +1 -1
- package/dist/index354.js +5 -161
- package/dist/index361.cjs +1 -1
- package/dist/index361.js +140 -3
- package/dist/index362.cjs +1 -1
- package/dist/index362.js +3 -140
- package/dist/index381.cjs +1 -1
- package/dist/index381.js +2 -22
- package/dist/index382.cjs +1 -1
- package/dist/index382.js +22 -2
- package/dist/index383.cjs +1 -1
- package/dist/index383.js +1 -1
- package/dist/src/lib/store/swapStore.d.ts +1 -1
- package/package.json +5 -5
package/dist/index106.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./index350.cjs"),g=require("./index355.cjs"),y=require("./index278.cjs"),t=require("./index277.cjs"),h=require("./index281.cjs"),o="0x8010801080108010801080108010801080108010801080108010801080108010",u=s.from("(uint256 chainId, address delegation, uint256 nonce, uint8 yParity, uint256 r, uint256 s), address to, bytes data");function a(r){if(typeof r=="string"){if(t.slice(r,-32)!==o)throw new c(r)}else h.assert(r.authorization)}function m(r){a(r);const n=t.toNumber(t.slice(r,-64,-32)),d=t.slice(r,-n-64,-64),f=t.slice(r,0,-n-64),[e,l,i]=s.decode(u,d);return{authorization:g.from({address:e.delegation,chainId:Number(e.chainId),nonce:e.nonce,yParity:e.yParity,r:e.r,s:e.s}),signature:f,...i&&i!=="0x"?{data:i,to:l}:{}}}function b(r){try{return a(r),!0}catch{return!1}}class c extends y.BaseError{constructor(n){super(`Value \`${n}\` is an invalid ERC-8010 wrapped signature.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SignatureErc8010.InvalidWrappedSignatureError"})}}exports.InvalidWrappedSignatureError=c;exports.assert=a;exports.magicBytes=o;exports.suffixParameters=u;exports.unwrap=m;exports.validate=b;
|
package/dist/index106.js
CHANGED
package/dist/index107.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./index350.cjs"),c=require("./index278.cjs"),n=require("./index277.cjs"),t="0x6492649264926492649264926492649264926492649264926492649264926492";function i(r){if(n.slice(r,-32)!==t)throw new s(r)}function d(r){const{data:e,signature:u,to:o}=r;return n.concat(a.encode(a.from("address, bytes, bytes"),[o,e,u]),t)}function l(r){try{return i(r),!0}catch{return!1}}class s extends c.BaseError{constructor(e){super(`Value \`${e}\` is an invalid ERC-6492 wrapped signature.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SignatureErc6492.InvalidWrappedSignatureError"})}}exports.InvalidWrappedSignatureError=s;exports.assert=i;exports.magicBytes=t;exports.validate=l;exports.wrap=d;
|
package/dist/index107.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { encode as i, from as o } from "./
|
|
1
|
+
import { encode as i, from as o } from "./index350.js";
|
|
2
2
|
import { BaseError as s } from "./index278.js";
|
|
3
3
|
import { concat as u, slice as c } from "./index277.js";
|
|
4
4
|
const t = "0x6492649264926492649264926492649264926492649264926492649264926492";
|
package/dist/index119.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./index299.cjs");async function o(e){const r=c.createFilterRequestScope(e,{method:"eth_newBlockFilter"}),t=await e.request({method:"eth_newBlockFilter"});return{id:t,request:r(t),type:"block"}}exports.createBlockFilter=o;
|
package/dist/index119.js
CHANGED
package/dist/index12.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("@gardenfi/core"),r=require("@gardenfi/garden-book"),t=require("@gardenfi/orderbook"),i=require("@gardenfi/utils"),c=require("./index31.cjs"),u=require("./index32.cjs"),E={minError:(e,n)=>`Minimum amount is ${e} ${n}`,maxError:(e,n)=>`Maximum amount is ${e} ${n}`,outHigh:"Output amount too high",outLow:"Output amount too less",insufficientLiquidity:!0,insufficientBalance:!0,none:"",invalidFomAssset:"Invalid From Asset",invalidToAsset:"Invalid To Asset"};var o=(e=>(e.input="input",e.output="output",e))(o||{});const a={[i.Network.MAINNET]:{api:"https://api.garden.finance",explorer:"https://explorer.garden.finance"},[i.Network.TESTNET]:{api:"https://testnet.api.garden.finance",explorer:"https://testnet-explorer.garden.finance"},[i.Network.LOCALNET]:{api:"",explorer:""}},T=i.Network.TESTNET,l=e=>a[e],d=e=>t.isEVM(e.chain)||t.isSolana(e.chain)||t.isStarknet(e.chain)||t.isSui(e.chain)?"~30s":t.isBitcoin(e.chain)?"~10m":"",p={swap:{id:"swap",label:"Swap",index:0,Icon:r.SwapHorizontalIcon},history:{id:"history",label:"History",index:1,Icon:r.BlogIcon}},m={[s.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("@gardenfi/core"),r=require("@gardenfi/garden-book"),t=require("@gardenfi/orderbook"),i=require("@gardenfi/utils"),c=require("./index31.cjs"),u=require("./index32.cjs"),E={minError:(e,n)=>`Minimum amount is ${e} ${n}`,maxError:(e,n)=>`Maximum amount is ${e} ${n}`,outHigh:"Output amount too high",outLow:"Output amount too less",insufficientLiquidity:!0,insufficientBalance:!0,none:"",invalidFomAssset:"Invalid From Asset",invalidToAsset:"Invalid To Asset"};var o=(e=>(e.input="input",e.output="output",e))(o||{});const a={[i.Network.MAINNET]:{api:"https://api.garden.finance",explorer:"https://explorer.garden.finance"},[i.Network.TESTNET]:{api:"https://testnet.api.garden.finance",explorer:"https://testnet-explorer.garden.finance"},[i.Network.LOCALNET]:{api:"",explorer:""}},T=i.Network.TESTNET,l=e=>a[e],d=e=>t.isEVM(e.chain)||t.isSolana(e.chain)||t.isStarknet(e.chain)||t.isSui(e.chain)?"~30s":t.isBitcoin(e.chain)?"~10m":"",p={swap:{id:"swap",label:"Swap",index:0,Icon:r.SwapHorizontalIcon},history:{id:"history",label:"History",index:1,Icon:r.BlogIcon}},m={[s.hyperevm.id]:"0xcA11bde05977b3631167028862bE2a173976CA11",[u.citreaTestnet.id]:"0x8470Ee1FCD47e7F9B90486bB5D142430e5C1f409",[c.botanix.id]:"0xeaE7721d779276eb0f5837e2fE260118724a2Ba4"},S={small:348,medium:408,large:496},I={small:88,medium:116,large:216};exports.API_ENDPOINTS=a;exports.BUFFER_HEIGHT=I;exports.DEFAULT_NETWORK=T;exports.Errors=E;exports.HEIGHTS=S;exports.IOType=o;exports.MULTICALL_CONTRACT_ADDRESSES=m;exports.getApiEndpoint=l;exports.getTimeEstimates=d;exports.tabs=p;
|
package/dist/index12.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { SwapHorizontalIcon as
|
|
1
|
+
import { hyperevm as n } from "@gardenfi/core";
|
|
2
|
+
import { SwapHorizontalIcon as e, BlogIcon as r } from "@gardenfi/garden-book";
|
|
3
3
|
import { isEVM as a, isSolana as s, isStarknet as m, isSui as p, isBitcoin as c } from "@gardenfi/orderbook";
|
|
4
|
-
import { Network as
|
|
4
|
+
import { Network as i } from "@gardenfi/utils";
|
|
5
5
|
import { botanix as u } from "./index31.js";
|
|
6
6
|
import { citreaTestnet as l } from "./index32.js";
|
|
7
7
|
const I = {
|
|
8
|
-
minError: (
|
|
9
|
-
maxError: (
|
|
8
|
+
minError: (t, o) => `Minimum amount is ${t} ${o}`,
|
|
9
|
+
maxError: (t, o) => `Maximum amount is ${t} ${o}`,
|
|
10
10
|
outHigh: "Output amount too high",
|
|
11
11
|
outLow: "Output amount too less",
|
|
12
12
|
insufficientLiquidity: !0,
|
|
@@ -15,32 +15,32 @@ const I = {
|
|
|
15
15
|
invalidFomAssset: "Invalid From Asset",
|
|
16
16
|
invalidToAsset: "Invalid To Asset"
|
|
17
17
|
};
|
|
18
|
-
var E = /* @__PURE__ */ ((
|
|
18
|
+
var E = /* @__PURE__ */ ((t) => (t.input = "input", t.output = "output", t))(E || {});
|
|
19
19
|
const d = {
|
|
20
|
-
[
|
|
20
|
+
[i.MAINNET]: {
|
|
21
21
|
api: "https://api.garden.finance",
|
|
22
22
|
explorer: "https://explorer.garden.finance"
|
|
23
23
|
},
|
|
24
|
-
[
|
|
24
|
+
[i.TESTNET]: {
|
|
25
25
|
api: "https://testnet.api.garden.finance",
|
|
26
26
|
explorer: "https://testnet-explorer.garden.finance"
|
|
27
27
|
},
|
|
28
|
-
[
|
|
28
|
+
[i.LOCALNET]: {
|
|
29
29
|
api: "",
|
|
30
30
|
explorer: ""
|
|
31
31
|
}
|
|
32
|
-
}, A =
|
|
32
|
+
}, A = i.TESTNET, N = (t) => d[t], b = (t) => a(t.chain) || s(t.chain) || m(t.chain) || p(t.chain) ? "~30s" : c(t.chain) ? "~10m" : "", L = {
|
|
33
33
|
swap: {
|
|
34
34
|
id: "swap",
|
|
35
35
|
label: "Swap",
|
|
36
36
|
index: 0,
|
|
37
|
-
Icon:
|
|
37
|
+
Icon: e
|
|
38
38
|
},
|
|
39
39
|
history: {
|
|
40
40
|
id: "history",
|
|
41
41
|
label: "History",
|
|
42
42
|
index: 1,
|
|
43
|
-
Icon:
|
|
43
|
+
Icon: r
|
|
44
44
|
}
|
|
45
45
|
}, B = {
|
|
46
46
|
[n.id]: "0xcA11bde05977b3631167028862bE2a173976CA11",
|
package/dist/index120.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("./index212.cjs"),s=require("./index81.cjs"),q=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("./index212.cjs"),s=require("./index81.cjs"),q=require("./index299.cjs");async function b(r,a){const{address:u,abi:n,args:c,eventName:e,fromBlock:t,strict:l,toBlock:o}=a,d=q.createFilterRequestScope(r,{method:"eth_newFilter"}),p=e?m.encodeEventTopics({abi:n,args:c,eventName:e}):void 0,i=await r.request({method:"eth_newFilter",params:[{address:u,fromBlock:typeof t=="bigint"?s.numberToHex(t):t,toBlock:typeof o=="bigint"?s.numberToHex(o):o,topics:p}]});return{abi:n,args:c,eventName:e,id:i,request:d(i),strict:!!l,type:"event"}}exports.createContractEventFilter=b;
|
package/dist/index120.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { encodeEventTopics as l } from "./index212.js";
|
|
2
2
|
import { numberToHex as s } from "./index81.js";
|
|
3
|
-
import { createFilterRequestScope as u } from "./
|
|
3
|
+
import { createFilterRequestScope as u } from "./index299.js";
|
|
4
4
|
async function h(r, a) {
|
|
5
5
|
const { address: m, abi: n, args: i, eventName: e, fromBlock: t, strict: p, toBlock: o } = a, f = u(r, {
|
|
6
6
|
method: "eth_newFilter"
|
package/dist/index121.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("./index212.cjs"),u=require("./index81.cjs"),q=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("./index212.cjs"),u=require("./index81.cjs"),q=require("./index299.cjs");async function f(o,{address:d,args:s,event:e,events:p,fromBlock:n,strict:b,toBlock:i}={}){const r=p??(e?[e]:void 0),l=q.createFilterRequestScope(o,{method:"eth_newFilter"});let t=[];r&&(t=[r.flatMap(a=>m.encodeEventTopics({abi:[a],eventName:a.name,args:s}))],e&&(t=t[0]));const c=await o.request({method:"eth_newFilter",params:[{address:d,fromBlock:typeof n=="bigint"?u.numberToHex(n):n,toBlock:typeof i=="bigint"?u.numberToHex(i):i,...t.length?{topics:t}:{}}]});return{abi:r,args:s,eventName:e?e.name:void 0,fromBlock:n,id:c,request:l(c),strict:!!b,toBlock:i,type:"event"}}exports.createEventFilter=f;
|
package/dist/index121.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { encodeEventTopics as b } from "./index212.js";
|
|
2
2
|
import { numberToHex as m } from "./index81.js";
|
|
3
|
-
import { createFilterRequestScope as h } from "./
|
|
3
|
+
import { createFilterRequestScope as h } from "./index299.js";
|
|
4
4
|
async function l(r, { address: p, args: a, event: e, events: c, fromBlock: n, strict: f, toBlock: i } = {}) {
|
|
5
5
|
const o = c ?? (e ? [e] : void 0), u = h(r, {
|
|
6
6
|
method: "eth_newFilter"
|
package/dist/index122.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index299.cjs");async function i(e){const n=r.createFilterRequestScope(e,{method:"eth_newPendingTransactionFilter"}),t=await e.request({method:"eth_newPendingTransactionFilter"});return{id:t,request:n(t),type:"transaction"}}exports.createPendingTransactionFilter=i;
|
package/dist/index122.js
CHANGED
package/dist/index154.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const S=require("./index178.cjs"),k=require("./index186.cjs"),f=require("./index101.cjs"),$=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const S=require("./index178.cjs"),k=require("./index186.cjs"),f=require("./index101.cjs"),$=require("./index300.cjs"),C=require("./index302.cjs"),B=require("./index238.cjs"),D=require("./index194.cjs"),P=require("./index130.cjs"),W=require("./index143.cjs"),y=require("./index146.cjs"),z=require("./index155.cjs");async function G(r,b){const{checkReplacement:A=!0,confirmations:c=1,hash:p,onReplaced:F,retryCount:h=6,retryDelay:N=({count:t})=>~~(1<<t)*200,timeout:w=18e4}=b,I=D.stringify(["waitForTransactionReceipt",r.uid,p]),j=(()=>{var t;return b.pollingInterval?b.pollingInterval:(t=r.chain)!=null&&t.experimental_preconfirmationTime?r.chain.experimental_preconfirmationTime:r.pollingInterval})();let s,i,e,l=!1,n,a;const{promise:E,resolve:x,reject:v}=C.withResolvers(),q=w?setTimeout(()=>{a==null||a(),n==null||n(),v(new k.WaitForTransactionReceiptTimeoutError({hash:p}))},w):void 0;return n=$.observe(I,{onReplaced:F,resolve:x,reject:v},async t=>{if(e=await f.getAction(r,y.getTransactionReceipt,"getTransactionReceipt")({hash:p}).catch(()=>{}),e&&c<=1){clearTimeout(q),t.resolve(e),n==null||n();return}a=f.getAction(r,z.watchBlockNumber,"watchBlockNumber")({emitMissed:!0,emitOnBegin:!0,poll:!0,pollingInterval:j,async onBlockNumber(M){const g=d=>{clearTimeout(q),a==null||a(),d(),n==null||n()};let T=M;if(!l)try{if(e){if(c>1&&(!e.blockNumber||T-e.blockNumber+1n<c))return;g(()=>t.resolve(e));return}if(A&&!s&&(l=!0,await B.withRetry(async()=>{s=await f.getAction(r,W.getTransaction,"getTransaction")({hash:p}),s.blockNumber&&(T=s.blockNumber)},{delay:N,retryCount:h}),l=!1),e=await f.getAction(r,y.getTransactionReceipt,"getTransactionReceipt")({hash:p}),c>1&&(!e.blockNumber||T-e.blockNumber+1n<c))return;g(()=>t.resolve(e))}catch(d){if(d instanceof k.TransactionNotFoundError||d instanceof k.TransactionReceiptNotFoundError){if(!s){l=!1;return}try{i=s,l=!0;const m=await B.withRetry(()=>f.getAction(r,P.getBlock,"getBlock")({blockNumber:T,includeTransactions:!0}),{delay:N,retryCount:h,shouldRetry:({error:u})=>u instanceof S.BlockNotFoundError});l=!1;const o=m.transactions.find(({from:u,nonce:O})=>u===i.from&&O===i.nonce);if(!o||(e=await f.getAction(r,y.getTransactionReceipt,"getTransactionReceipt")({hash:o.hash}),c>1&&(!e.blockNumber||T-e.blockNumber+1n<c)))return;let R="replaced";o.to===i.to&&o.value===i.value&&o.input===i.input?R="repriced":o.from===o.to&&o.value===0n&&(R="cancelled"),g(()=>{var u;(u=t.onReplaced)==null||u.call(t,{reason:R,replacedTransaction:i,transaction:o,transactionReceipt:e}),t.resolve(e)})}catch(m){g(()=>t.reject(m))}}else g(()=>t.reject(d))}}})}),E}exports.waitForTransactionReceipt=G;
|
package/dist/index154.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { BlockNotFoundError as M } from "./index178.js";
|
|
2
2
|
import { WaitForTransactionReceiptTimeoutError as O, TransactionNotFoundError as W, TransactionReceiptNotFoundError as q } from "./index186.js";
|
|
3
3
|
import { getAction as u } from "./index101.js";
|
|
4
|
-
import { observe as z } from "./
|
|
5
|
-
import { withResolvers as G } from "./
|
|
4
|
+
import { observe as z } from "./index300.js";
|
|
5
|
+
import { withResolvers as G } from "./index302.js";
|
|
6
6
|
import { withRetry as B } from "./index238.js";
|
|
7
7
|
import { stringify as H } from "./index194.js";
|
|
8
8
|
import { getBlock as J } from "./index130.js";
|
package/dist/index155.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const v=require("./index71.cjs"),w=require("./index101.cjs"),N=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const v=require("./index71.cjs"),w=require("./index101.cjs"),N=require("./index300.cjs"),h=require("./index301.cjs"),g=require("./index194.cjs"),m=require("./index131.cjs");function q(r,{emitOnBegin:b=!1,emitMissed:f=!1,onBlockNumber:p,onError:a,poll:i,pollingInterval:k=r.pollingInterval}){const B=typeof i<"u"?i:!(r.transport.type==="webSocket"||r.transport.type==="ipc"||r.transport.type==="fallback"&&(r.transport.transports[0].config.type==="webSocket"||r.transport.transports[0].config.type==="ipc"));let e;return B?(()=>{const l=g.stringify(["watchBlockNumber",r.uid,b,f,k]);return N.observe(l,{onBlockNumber:p,onError:a},o=>h.poll(async()=>{var u;try{const t=await w.getAction(r,m.getBlockNumber,"getBlockNumber")({cacheTime:0});if(e!==void 0){if(t===e)return;if(t-e>1&&f)for(let s=e+1n;s<t;s++)o.onBlockNumber(s,e),e=s}(e===void 0||t>e)&&(o.onBlockNumber(t,e),e=t)}catch(t){(u=o.onError)==null||u.call(o,t)}},{emitOnBegin:b,interval:k}))})():(()=>{const l=g.stringify(["watchBlockNumber",r.uid,b,f]);return N.observe(l,{onBlockNumber:p,onError:a},o=>{let u=!0,t=()=>u=!1;return(async()=>{try{const s=(()=>{if(r.transport.type==="fallback"){const c=r.transport.transports.find(n=>n.config.type==="webSocket"||n.config.type==="ipc");return c?c.value:r.transport}return r.transport})(),{unsubscribe:d}=await s.subscribe({params:["newHeads"],onData(c){var y;if(!u)return;const n=v.hexToBigInt((y=c.result)==null?void 0:y.number);o.onBlockNumber(n,e),e=n},onError(c){var n;(n=o.onError)==null||n.call(o,c)}});t=d,u||t()}catch(s){a==null||a(s)}})(),()=>t()})})()}exports.watchBlockNumber=q;
|
package/dist/index155.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { hexToBigInt as w } from "./index71.js";
|
|
2
2
|
import { getAction as g } from "./index101.js";
|
|
3
|
-
import { observe as y } from "./
|
|
4
|
-
import { poll as h } from "./
|
|
3
|
+
import { observe as y } from "./index300.js";
|
|
4
|
+
import { poll as h } from "./index301.js";
|
|
5
5
|
import { stringify as N } from "./index194.js";
|
|
6
6
|
import { getBlockNumber as v } from "./index131.js";
|
|
7
7
|
function j(r, { emitOnBegin: b = !1, emitMissed: p = !1, onBlockNumber: l, onError: a, poll: k, pollingInterval: i = r.pollingInterval }) {
|
package/dist/index156.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./index101.cjs"),q=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./index101.cjs"),q=require("./index300.cjs"),A=require("./index301.cjs"),S=require("./index194.cjs"),p=require("./index130.cjs");function v(r,{blockTag:f=r.experimental_blockTag??"latest",emitMissed:k=!1,emitOnBegin:g=!1,onBlock:y,onError:u,includeTransactions:h,poll:d,pollingInterval:m=r.pollingInterval}){const B=typeof d<"u"?d:!(r.transport.type==="webSocket"||r.transport.type==="ipc"||r.transport.type==="fallback"&&(r.transport.transports[0].config.type==="webSocket"||r.transport.transports[0].config.type==="ipc")),o=h??!1;let t;return B?(()=>{const c=S.stringify(["watchBlocks",r.uid,f,k,g,o,m]);return q.observe(c,{onBlock:y,onError:u},s=>A.poll(async()=>{var a;try{const e=await i.getAction(r,p.getBlock,"getBlock")({blockTag:f,includeTransactions:o});if(e.number!==null&&(t==null?void 0:t.number)!=null){if(e.number===t.number)return;if(e.number-t.number>1&&k)for(let l=(t==null?void 0:t.number)+1n;l<e.number;l++){const n=await i.getAction(r,p.getBlock,"getBlock")({blockNumber:l,includeTransactions:o});s.onBlock(n,t),t=n}}((t==null?void 0:t.number)==null||f==="pending"&&(e==null?void 0:e.number)==null||e.number!==null&&e.number>t.number)&&(s.onBlock(e,t),t=e)}catch(e){(a=s.onError)==null||a.call(s,e)}},{emitOnBegin:g,interval:m}))})():(()=>{let c=!0,s=!0,a=()=>c=!1;return(async()=>{try{g&&i.getAction(r,p.getBlock,"getBlock")({blockTag:f,includeTransactions:o}).then(n=>{c&&s&&(y(n,void 0),s=!1)}).catch(u);const e=(()=>{if(r.transport.type==="fallback"){const n=r.transport.transports.find(b=>b.config.type==="webSocket"||b.config.type==="ipc");return n?n.value:r.transport}return r.transport})(),{unsubscribe:l}=await e.subscribe({params:["newHeads"],async onData(n){var w;if(!c)return;const b=await i.getAction(r,p.getBlock,"getBlock")({blockNumber:(w=n.result)==null?void 0:w.number,includeTransactions:o}).catch(()=>{});c&&(y(b,t),s=!1,t=b)},onError(n){u==null||u(n)}});a=l,c||a()}catch(e){u==null||u(e)}})(),()=>a()})()}exports.watchBlocks=v;
|
package/dist/index156.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { getAction as p } from "./index101.js";
|
|
2
|
-
import { observe as S } from "./
|
|
3
|
-
import { poll as x } from "./
|
|
2
|
+
import { observe as S } from "./index300.js";
|
|
3
|
+
import { poll as x } from "./index301.js";
|
|
4
4
|
import { stringify as N } from "./index194.js";
|
|
5
5
|
import { getBlock as i } from "./index130.js";
|
|
6
6
|
function j(e, { blockTag: l = e.experimental_blockTag ?? "latest", emitMissed: k = !1, emitOnBegin: m = !1, onBlock: y, onError: u, includeTransactions: h, poll: d, pollingInterval: w = e.pollingInterval }) {
|
package/dist/index157.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const B=require("./index174.cjs"),M=require("./index195.cjs"),P=require("./index204.cjs"),_=require("./index212.cjs"),I=require("./index90.cjs"),b=require("./index101.cjs"),A=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const B=require("./index174.cjs"),M=require("./index195.cjs"),P=require("./index204.cjs"),_=require("./index212.cjs"),I=require("./index90.cjs"),b=require("./index101.cjs"),A=require("./index300.cjs"),O=require("./index301.cjs"),S=require("./index194.cjs"),$=require("./index120.cjs"),j=require("./index131.cjs"),z=require("./index134.cjs"),R=require("./index137.cjs"),U=require("./index151.cjs");function G(t,D){const{abi:v,address:l,args:u,batch:C=!0,eventName:c,fromBlock:g,onError:f,onLogs:k,poll:L,pollingInterval:h=t.pollingInterval,strict:d}=D;return(typeof L<"u"?L:typeof g=="bigint"?!0:!(t.transport.type==="webSocket"||t.transport.type==="ipc"||t.transport.type==="fallback"&&(t.transport.transports[0].config.type==="webSocket"||t.transport.transports[0].config.type==="ipc")))?(()=>{const p=d??!1,q=S.stringify(["watchContractEvent",l,u,C,t.uid,c,h,p,g]);return A.observe(q,{onLogs:k,onError:f},o=>{let s;g!==void 0&&(s=g-1n);let n,a=!1;const w=O.poll(async()=>{var y;if(!a){try{n=await b.getAction(t,$.createContractEventFilter,"createContractEventFilter")({abi:v,address:l,args:u,eventName:c,strict:p,fromBlock:g})}catch{}a=!0;return}try{let e;if(n)e=await b.getAction(t,R.getFilterChanges,"getFilterChanges")({filter:n});else{const r=await b.getAction(t,j.getBlockNumber,"getBlockNumber")({});s&&s<r?e=await b.getAction(t,z.getContractEvents,"getContractEvents")({abi:v,address:l,args:u,eventName:c,fromBlock:s+1n,toBlock:r,strict:p}):e=[],s=r}if(e.length===0)return;if(C)o.onLogs(e);else for(const r of e)o.onLogs([r])}catch(e){n&&e instanceof M.InvalidInputRpcError&&(a=!1),(y=o.onError)==null||y.call(o,e)}},{emitOnBegin:!0,interval:h});return async()=>{n&&await b.getAction(t,U.uninstallFilter,"uninstallFilter")({filter:n}),w()}})})():(()=>{const p=d??!1,q=S.stringify(["watchContractEvent",l,u,C,t.uid,c,h,p]);let o=!0,s=()=>o=!1;return A.observe(q,{onLogs:k,onError:f},n=>((async()=>{try{const a=(()=>{if(t.transport.type==="fallback"){const e=t.transport.transports.find(r=>r.config.type==="webSocket"||r.config.type==="ipc");return e?e.value:t.transport}return t.transport})(),w=c?_.encodeEventTopics({abi:v,eventName:c,args:u}):[],{unsubscribe:y}=await a.subscribe({params:["logs",{address:l,topics:w}],onData(e){var N;if(!o)return;const r=e.result;try{const{eventName:i,args:E}=P.decodeEventLog({abi:v,data:r.data,topics:r.topics,strict:d}),m=I.formatLog(r,{args:E,eventName:i});n.onLogs([m])}catch(i){let E,m;if(i instanceof B.DecodeLogDataMismatch||i instanceof B.DecodeLogTopicsMismatch){if(d)return;E=i.abiItem.name,m=(N=i.abiItem.inputs)==null?void 0:N.some(F=>!("name"in F&&F.name))}const T=I.formatLog(r,{args:m?[]:{},eventName:E});n.onLogs([T])}},onError(e){var r;(r=n.onError)==null||r.call(n,e)}});s=y,o||s()}catch(a){f==null||f(a)}})(),()=>s()))})()}exports.watchContractEvent=G;
|
package/dist/index157.js
CHANGED
|
@@ -4,8 +4,8 @@ import { decodeEventLog as A } from "./index204.js";
|
|
|
4
4
|
import { encodeEventTopics as O } from "./index212.js";
|
|
5
5
|
import { formatLog as F } from "./index90.js";
|
|
6
6
|
import { getAction as g } from "./index101.js";
|
|
7
|
-
import { observe as D } from "./
|
|
8
|
-
import { poll as R } from "./
|
|
7
|
+
import { observe as D } from "./index300.js";
|
|
8
|
+
import { poll as R } from "./index301.js";
|
|
9
9
|
import { stringify as S } from "./index194.js";
|
|
10
10
|
import { createContractEventFilter as U } from "./index120.js";
|
|
11
11
|
import { getBlockNumber as j } from "./index131.js";
|
package/dist/index158.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const A=require("./index174.cjs"),M=require("./index195.cjs"),T=require("./index204.cjs"),B=require("./index212.cjs"),I=require("./index90.cjs"),g=require("./index101.cjs"),C=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const A=require("./index174.cjs"),M=require("./index195.cjs"),T=require("./index204.cjs"),B=require("./index212.cjs"),I=require("./index90.cjs"),g=require("./index101.cjs"),C=require("./index300.cjs"),O=require("./index301.cjs"),P=require("./index194.cjs"),j=require("./index121.cjs"),z=require("./index131.cjs"),R=require("./index137.cjs"),U=require("./index140.cjs"),$=require("./index151.cjs");function G(e,{address:b,args:d,batch:w=!0,event:u,events:m,fromBlock:f,onError:c,onLogs:q,poll:F,pollingInterval:L=e.pollingInterval,strict:k}){const S=typeof F<"u"?F:typeof f=="bigint"?!0:!(e.transport.type==="webSocket"||e.transport.type==="ipc"||e.transport.type==="fallback"&&(e.transport.transports[0].config.type==="webSocket"||e.transport.transports[0].config.type==="ipc")),N=k??!1;return S?(()=>{const p=P.stringify(["watchEvent",b,d,w,e.uid,u,L,f]);return C.observe(p,{onLogs:q,onError:c},s=>{let o;f!==void 0&&(o=f-1n);let n,i=!1;const h=O.poll(async()=>{var r;if(!i){try{n=await g.getAction(e,j.createEventFilter,"createEventFilter")({address:b,args:d,event:u,events:m,strict:N,fromBlock:f})}catch{}i=!0;return}try{let t;if(n)t=await g.getAction(e,R.getFilterChanges,"getFilterChanges")({filter:n});else{const a=await g.getAction(e,z.getBlockNumber,"getBlockNumber")({});o&&o!==a?t=await g.getAction(e,U.getLogs,"getLogs")({address:b,args:d,event:u,events:m,fromBlock:o+1n,toBlock:a}):t=[],o=a}if(t.length===0)return;if(w)s.onLogs(t);else for(const a of t)s.onLogs([a])}catch(t){n&&t instanceof M.InvalidInputRpcError&&(i=!1),(r=s.onError)==null||r.call(s,t)}},{emitOnBegin:!0,interval:L});return async()=>{n&&await g.getAction(e,$.uninstallFilter,"uninstallFilter")({filter:n}),h()}})})():(()=>{let p=!0,s=()=>p=!1;return(async()=>{try{const o=(()=>{if(e.transport.type==="fallback"){const r=e.transport.transports.find(t=>t.config.type==="webSocket"||t.config.type==="ipc");return r?r.value:e.transport}return e.transport})(),n=m??(u?[u]:void 0);let i=[];n&&(i=[n.flatMap(t=>B.encodeEventTopics({abi:[t],eventName:t.name,args:d}))],u&&(i=i[0]));const{unsubscribe:h}=await o.subscribe({params:["logs",{address:b,topics:i}],onData(r){var a;if(!p)return;const t=r.result;try{const{eventName:l,args:v}=T.decodeEventLog({abi:n??[],data:t.data,topics:t.topics,strict:N}),y=I.formatLog(t,{args:v,eventName:l});q([y])}catch(l){let v,y;if(l instanceof A.DecodeLogDataMismatch||l instanceof A.DecodeLogTopicsMismatch){if(k)return;v=l.abiItem.name,y=(a=l.abiItem.inputs)==null?void 0:a.some(E=>!("name"in E&&E.name))}const D=I.formatLog(t,{args:y?[]:{},eventName:v});q([D])}},onError(r){c==null||c(r)}});s=h,p||s()}catch(o){c==null||c(o)}})(),()=>s()})()}exports.watchEvent=G;
|
package/dist/index158.js
CHANGED
|
@@ -4,8 +4,8 @@ import { decodeEventLog as z } from "./index204.js";
|
|
|
4
4
|
import { encodeEventTopics as A } from "./index212.js";
|
|
5
5
|
import { formatLog as E } from "./index90.js";
|
|
6
6
|
import { getAction as l } from "./index101.js";
|
|
7
|
-
import { observe as O } from "./
|
|
8
|
-
import { poll as P } from "./
|
|
7
|
+
import { observe as O } from "./index300.js";
|
|
8
|
+
import { poll as P } from "./index301.js";
|
|
9
9
|
import { stringify as R } from "./index194.js";
|
|
10
10
|
import { createEventFilter as U } from "./index121.js";
|
|
11
11
|
import { getBlockNumber as j } from "./index131.js";
|
package/dist/index159.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./index101.cjs"),f=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./index101.cjs"),f=require("./index300.cjs"),h=require("./index301.cjs"),P=require("./index194.cjs"),p=require("./index122.cjs"),y=require("./index137.cjs"),T=require("./index151.cjs");function w(e,{batch:l=!0,onError:s,onTransactions:g,poll:b,pollingInterval:d=e.pollingInterval}){return(typeof b<"u"?b:e.transport.type!=="webSocket"&&e.transport.type!=="ipc")?(()=>{const a=P.stringify(["watchPendingTransactions",e.uid,l,d]);return f.observe(a,{onTransactions:g,onError:s},n=>{let t;const r=h.poll(async()=>{var c;try{if(!t)try{t=await u.getAction(e,p.createPendingTransactionFilter,"createPendingTransactionFilter")({});return}catch(o){throw r(),o}const i=await u.getAction(e,y.getFilterChanges,"getFilterChanges")({filter:t});if(i.length===0)return;if(l)n.onTransactions(i);else for(const o of i)n.onTransactions([o])}catch(i){(c=n.onError)==null||c.call(n,i)}},{emitOnBegin:!0,interval:d});return async()=>{t&&await u.getAction(e,T.uninstallFilter,"uninstallFilter")({filter:t}),r()}})})():(()=>{let a=!0,n=()=>a=!1;return(async()=>{try{const{unsubscribe:t}=await e.transport.subscribe({params:["newPendingTransactions"],onData(r){if(!a)return;const c=r.result;g([c])},onError(r){s==null||s(r)}});n=t,a||n()}catch(t){s==null||s(t)}})(),()=>n()})()}exports.watchPendingTransactions=w;
|
package/dist/index159.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { getAction as u } from "./index101.js";
|
|
2
|
-
import { observe as b } from "./
|
|
3
|
-
import { poll as d } from "./
|
|
2
|
+
import { observe as b } from "./index300.js";
|
|
3
|
+
import { poll as d } from "./index301.js";
|
|
4
4
|
import { stringify as h } from "./index194.js";
|
|
5
5
|
import { createPendingTransactionFilter as P } from "./index122.js";
|
|
6
6
|
import { getFilterChanges as m } from "./index137.js";
|
package/dist/index168.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const v=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const v=require("./index302.cjs"),l=new Map;function A({fn:a,id:o,shouldSplitBatch:h,wait:y=0,sort:u}){const i=async()=>{const e=n();f();const s=e.map(({args:t})=>t);s.length!==0&&a(s).then(t=>{u&&Array.isArray(t)&&t.sort(u);for(let c=0;c<e.length;c++){const{resolve:r}=e[c];r==null||r([t[c],t])}}).catch(t=>{for(let c=0;c<e.length;c++){const{reject:r}=e[c];r==null||r(t)}})},f=()=>l.delete(o),m=()=>n().map(({args:e})=>e),n=()=>l.get(o)||[],g=e=>l.set(o,[...n(),e]);return{flush:f,async schedule(e){const{promise:s,resolve:t,reject:c}=v.withResolvers();return(h==null?void 0:h([...m(),e]))&&i(),n().length>0?(g({args:e,resolve:t,reject:c}),s):(g({args:e,resolve:t,reject:c}),setTimeout(i,y),s)}}}exports.createBatchScheduler=A;
|
package/dist/index168.js
CHANGED
package/dist/index235.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index319.cjs"),s=e.sha256;exports.sha256=s;
|
package/dist/index235.js
CHANGED
package/dist/index236.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index320.cjs"),r=require("./index321.cjs");function n(t){return e.hashSignature(r.toSignature(t))}exports.toSignatureHash=n;
|
package/dist/index236.js
CHANGED
package/dist/index247.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const F=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const F=require("./index319.cjs"),C=require("./index323.cjs"),n=require("./index324.cjs");/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const k=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),x=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),G=BigInt(0),M=BigInt(1),w=BigInt(2),h=(t,f)=>(t+f/w)/f;function N(t){const f=k,e=BigInt(3),r=BigInt(6),p=BigInt(11),a=BigInt(22),s=BigInt(23),i=BigInt(44),d=BigInt(88),o=t*t*t%f,c=o*o*t%f,g=n.pow2(c,e,f)*c%f,b=n.pow2(g,e,f)*c%f,l=n.pow2(b,w,f)*o%f,B=n.pow2(l,p,f)*l%f,I=n.pow2(B,a,f)*B%f,_=n.pow2(I,i,f)*I%f,m=n.pow2(_,d,f)*_%f,S=n.pow2(m,i,f)*I%f,P=n.pow2(S,e,f)*c%f,v=n.pow2(P,s,f)*B%f,E=n.pow2(v,r,f)*o%f,q=n.pow2(E,w,f);if(!u.eql(u.sqr(q),t))throw new Error("Cannot find square root");return q}const u=n.Field(k,void 0,void 0,{sqrt:N}),O=C.createCurve({a:G,b:BigInt(7),Fp:u,n:x,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:t=>{const f=x,e=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),r=-M*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),p=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),a=e,s=BigInt("0x100000000000000000000000000000000"),i=h(a*t,f),d=h(-r*t,f);let o=n.mod(t-i*e-d*p,f),c=n.mod(-i*r-d*a,f);const g=o>s,b=c>s;if(g&&(o=f-o),b&&(c=f-c),o>s||c>s)throw new Error("splitScalar: Endomorphism failed, k="+t);return{k1neg:g,k1:o,k2neg:b,k2:c}}}},F.sha256);exports.secp256k1=O;
|
package/dist/index247.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { sha256 as C } from "./
|
|
1
|
+
import { sha256 as C } from "./index319.js";
|
|
2
2
|
import { createCurve as G } from "./index323.js";
|
|
3
3
|
import { Field as N, mod as k, pow2 as t } from "./index324.js";
|
|
4
4
|
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
package/dist/index278.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("./index349.cjs");class r extends Error{static setStaticOptions(t){r.prototype.docsOrigin=t.docsOrigin,r.prototype.showVersion=t.showVersion,r.prototype.version=t.version}constructor(t,e={}){const i=(()=>{var a;if(e.cause instanceof r){if(e.cause.details)return e.cause.details;if(e.cause.shortMessage)return e.cause.shortMessage}return e.cause&&"details"in e.cause&&typeof e.cause.details=="string"?e.cause.details:(a=e.cause)!=null&&a.message?e.cause.message:e.details})(),u=e.cause instanceof r&&e.cause.docsPath||e.docsPath,n=e.docsOrigin??r.prototype.docsOrigin,l=`${n}${u??""}`,c=!!(e.version??r.prototype.showVersion),o=e.version??r.prototype.version,b=[t||"An error occurred.",...e.metaMessages?["",...e.metaMessages]:[],...i||u||c?["",i?`Details: ${i}`:void 0,u?`See: ${l}`:void 0,c?`Version: ${o}`:void 0]:[]].filter(a=>typeof a=="string").join(`
|
|
2
2
|
`);super(b,e.cause?{cause:e.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsOrigin",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"showVersion",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),this.cause=e.cause,this.details=i,this.docs=l,this.docsOrigin=n,this.docsPath=u,this.shortMessage=t,this.showVersion=c,this.version=o}walk(t){return d(this,t)}}Object.defineProperty(r,"defaultStaticOptions",{enumerable:!0,configurable:!0,writable:!0,value:{docsOrigin:"https://oxlib.sh",showVersion:!1,version:`ox@${f.getVersion()}`}});r.setStaticOptions(r.defaultStaticOptions);function d(s,t){return t!=null&&t(s)?s:s&&typeof s=="object"&&"cause"in s&&s.cause?d(s.cause,t):t?null:s}exports.BaseError=r;
|
package/dist/index278.js
CHANGED
package/dist/index299.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function p(e,{method:u}){var s,o;const r={};return e.transport.type==="fallback"&&((o=(s=e.transport).onResponse)==null||o.call(s,({method:t,response:a,status:c,transport:n})=>{c==="success"&&u===t&&(r[a]=n.request)})),t=>r[t]||e.request}exports.createFilterRequestScope=p;
|
package/dist/index299.js
CHANGED
|
@@ -1,40 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}, r = () => {
|
|
8
|
-
const n = c();
|
|
9
|
-
if (!n.some((t) => t.id === i))
|
|
10
|
-
return;
|
|
11
|
-
const e = g.get(s);
|
|
12
|
-
if (n.length === 1 && e) {
|
|
13
|
-
const t = e();
|
|
14
|
-
t instanceof Promise && t.catch(() => {
|
|
15
|
-
});
|
|
16
|
-
}
|
|
17
|
-
w();
|
|
18
|
-
}, o = c();
|
|
19
|
-
if (f.set(s, [
|
|
20
|
-
...o,
|
|
21
|
-
{ id: i, fns: l }
|
|
22
|
-
]), o && o.length > 0)
|
|
23
|
-
return r;
|
|
24
|
-
const u = {};
|
|
25
|
-
for (const n in l)
|
|
26
|
-
u[n] = (...e) => {
|
|
27
|
-
var p, h;
|
|
28
|
-
const t = c();
|
|
29
|
-
if (t.length !== 0)
|
|
30
|
-
for (const C of t)
|
|
31
|
-
(h = (p = C.fns)[n]) == null || h.call(p, ...e);
|
|
32
|
-
};
|
|
33
|
-
const a = m(u);
|
|
34
|
-
return typeof a == "function" && g.set(s, a), r;
|
|
1
|
+
function c(e, { method: p }) {
|
|
2
|
+
var r, o;
|
|
3
|
+
const t = {};
|
|
4
|
+
return e.transport.type === "fallback" && ((o = (r = e.transport).onResponse) == null || o.call(r, ({ method: s, response: n, status: u, transport: a }) => {
|
|
5
|
+
u === "success" && p === s && (t[n] = a.request);
|
|
6
|
+
})), (s) => t[s] || e.request;
|
|
35
7
|
}
|
|
36
8
|
export {
|
|
37
|
-
|
|
38
|
-
f as listenersCache,
|
|
39
|
-
y as observe
|
|
9
|
+
c as createFilterRequestScope
|
|
40
10
|
};
|
package/dist/index300.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=new Map,r=new Map;let b=0;function w(s,a,C){const o=++b,c=()=>i.get(s)||[],m=()=>{const t=c();i.set(s,t.filter(n=>n.id!==o))},f=()=>{const t=c();if(!t.some(e=>e.id===o))return;const n=r.get(s);if(t.length===1&&n){const e=n();e instanceof Promise&&e.catch(()=>{})}m()},l=c();if(i.set(s,[...l,{id:o,fns:a}]),l&&l.length>0)return f;const u={};for(const t in a)u[t]=(...n)=>{var p,g;const e=c();if(e.length!==0)for(const y of e)(g=(p=y.fns)[t])==null||g.call(p,...n)};const h=C(u);return typeof h=="function"&&r.set(s,h),f}exports.cleanupCache=r;exports.listenersCache=i;exports.observe=w;
|
package/dist/index300.js
CHANGED
|
@@ -1,18 +1,40 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
const f = /* @__PURE__ */ new Map(), g = /* @__PURE__ */ new Map();
|
|
2
|
+
let k = 0;
|
|
3
|
+
function y(s, l, m) {
|
|
4
|
+
const i = ++k, c = () => f.get(s) || [], w = () => {
|
|
5
|
+
const n = c();
|
|
6
|
+
f.set(s, n.filter((e) => e.id !== i));
|
|
7
|
+
}, r = () => {
|
|
8
|
+
const n = c();
|
|
9
|
+
if (!n.some((t) => t.id === i))
|
|
10
|
+
return;
|
|
11
|
+
const e = g.get(s);
|
|
12
|
+
if (n.length === 1 && e) {
|
|
13
|
+
const t = e();
|
|
14
|
+
t instanceof Promise && t.catch(() => {
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
w();
|
|
18
|
+
}, o = c();
|
|
19
|
+
if (f.set(s, [
|
|
20
|
+
...o,
|
|
21
|
+
{ id: i, fns: l }
|
|
22
|
+
]), o && o.length > 0)
|
|
23
|
+
return r;
|
|
24
|
+
const u = {};
|
|
25
|
+
for (const n in l)
|
|
26
|
+
u[n] = (...e) => {
|
|
27
|
+
var p, h;
|
|
28
|
+
const t = c();
|
|
29
|
+
if (t.length !== 0)
|
|
30
|
+
for (const C of t)
|
|
31
|
+
(h = (p = C.fns)[n]) == null || h.call(p, ...e);
|
|
12
32
|
};
|
|
13
|
-
|
|
14
|
-
|
|
33
|
+
const a = m(u);
|
|
34
|
+
return typeof a == "function" && g.set(s, a), r;
|
|
15
35
|
}
|
|
16
36
|
export {
|
|
17
|
-
|
|
37
|
+
g as cleanupCache,
|
|
38
|
+
f as listenersCache,
|
|
39
|
+
y as observe
|
|
18
40
|
};
|
package/dist/index301.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./index239.cjs");function s(o,{emitOnBegin:w,initialWaitTime:t,interval:c}){let l=!0;const a=()=>l=!1;return(async()=>{let e;w&&(e=await o({unpoll:a}));const r=await(t==null?void 0:t(e))??c;await u.wait(r);const n=async()=>{l&&(await o({unpoll:a}),await u.wait(c),n())};n()})(),a}exports.poll=s;
|
package/dist/index301.js
CHANGED
|
@@ -1,11 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
return
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { wait as r } from "./index239.js";
|
|
2
|
+
function e(o, { emitOnBegin: s, initialWaitTime: t, interval: c }) {
|
|
3
|
+
let w = !0;
|
|
4
|
+
const a = () => w = !1;
|
|
5
|
+
return (async () => {
|
|
6
|
+
let n;
|
|
7
|
+
s && (n = await o({ unpoll: a }));
|
|
8
|
+
const u = await (t == null ? void 0 : t(n)) ?? c;
|
|
9
|
+
await r(u);
|
|
10
|
+
const l = async () => {
|
|
11
|
+
w && (await o({ unpoll: a }), await r(c), l());
|
|
12
|
+
};
|
|
13
|
+
l();
|
|
14
|
+
})(), a;
|
|
8
15
|
}
|
|
9
16
|
export {
|
|
10
|
-
|
|
17
|
+
e as poll
|
|
11
18
|
};
|
package/dist/index302.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function i(){let e=()=>{},t=()=>{};return{promise:new Promise((r,o)=>{e=r,t=o}),resolve:e,reject:t}}exports.withResolvers=i;
|
package/dist/index302.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
function
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
function i() {
|
|
2
|
+
let e = () => {
|
|
3
|
+
}, n = () => {
|
|
4
|
+
};
|
|
5
|
+
return { promise: new Promise((r, o) => {
|
|
6
|
+
e = r, n = o;
|
|
7
|
+
}), resolve: e, reject: n };
|
|
7
8
|
}
|
|
8
9
|
export {
|
|
9
|
-
|
|
10
|
+
i as withResolvers
|
|
10
11
|
};
|
package/dist/index304.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("./index201.cjs"),a=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("./index201.cjs"),a=require("./index362.cjs"),c=require("./index230.cjs");function h(i){const r=i.replace(/^\.|\.$/gm,"");if(r.length===0)return new Uint8Array(1);const e=new Uint8Array(l.stringToBytes(r).byteLength+2);let t=0;const o=r.split(".");for(let s=0;s<o.length;s++){let n=l.stringToBytes(o[s]);n.byteLength>255&&(n=l.stringToBytes(a.encodeLabelhash(c.labelhash(o[s])))),e[t]=n.length,e.set(n,t+1),t+=n.length+1}return e.byteLength!==t+1?e.slice(0,t+1):e}exports.packetToBytes=h;
|
package/dist/index304.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { stringToBytes as i } from "./index201.js";
|
|
2
|
-
import { encodeLabelhash as h } from "./
|
|
2
|
+
import { encodeLabelhash as h } from "./index362.js";
|
|
3
3
|
import { labelhash as f } from "./index230.js";
|
|
4
4
|
function y(s) {
|
|
5
5
|
const o = s.replace(/^\.|\.$/gm, "");
|