@gardenfi/utils 3.1.1-beta.4 → 3.1.1-beta.6
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/index10.cjs +1 -1
- package/dist/index10.js +4 -4
- package/dist/index100.cjs +2 -1
- package/dist/index100.js +114 -119
- package/dist/index101.cjs +1 -1
- package/dist/index101.js +14 -5
- package/dist/index102.cjs +1 -1
- package/dist/index102.js +24 -21
- package/dist/index103.cjs +1 -1
- package/dist/index103.js +31 -43
- package/dist/index104.cjs +1 -1
- package/dist/index104.js +43 -37
- package/dist/index105.cjs +1 -1
- package/dist/index105.js +6 -6
- package/dist/index106.cjs +1 -1
- package/dist/index106.js +101 -88
- package/dist/index107.cjs +1 -1
- package/dist/index107.js +37 -14
- package/dist/index108.cjs +1 -1
- package/dist/index108.js +8 -3
- package/dist/index109.cjs +1 -1
- package/dist/index109.js +20 -26
- package/dist/index110.cjs +1 -2
- package/dist/index110.js +2 -25
- package/dist/index111.cjs +1 -1
- package/dist/index111.js +75 -9
- package/dist/index112.cjs +1 -1
- package/dist/index112.js +15 -8
- package/dist/index113.cjs +1 -1
- package/dist/index113.js +151 -10
- package/dist/index114.cjs +20 -1
- package/dist/index114.js +326 -11
- package/dist/index115.cjs +3 -1
- package/dist/index115.js +451 -13
- package/dist/index116.cjs +1 -1
- package/dist/index116.js +71 -19
- package/dist/index117.cjs +1 -1
- package/dist/index117.js +16 -14
- package/dist/index118.cjs +1 -1
- package/dist/index118.js +10 -4
- package/dist/index119.cjs +1 -1
- package/dist/index119.js +125 -6
- package/dist/index120.cjs +1 -1
- package/dist/index120.js +5 -18
- package/dist/index121.cjs +1 -1
- package/dist/index121.js +45 -10
- package/dist/index122.cjs +1 -1
- package/dist/index122.js +36 -56
- package/dist/index123.cjs +1 -1
- package/dist/index123.js +6 -6
- package/dist/index124.cjs +1 -1
- package/dist/index124.js +90 -13
- package/dist/index125.cjs +1 -1
- package/dist/index125.js +14 -7
- package/dist/index126.cjs +1 -1
- package/dist/index126.js +3 -138
- package/dist/index127.cjs +1 -1
- package/dist/index127.js +26 -7
- package/dist/index128.cjs +2 -1
- package/dist/index128.js +22 -19
- package/dist/index129.cjs +1 -1
- package/dist/index129.js +9 -17
- package/dist/index130.cjs +1 -1
- package/dist/index130.js +8 -43
- package/dist/index131.cjs +1 -1
- package/dist/index131.js +10 -21
- package/dist/index132.cjs +1 -1
- package/dist/index132.js +11 -80
- package/dist/index133.cjs +1 -1
- package/dist/index133.js +13 -11
- package/dist/index134.cjs +1 -1
- package/dist/index134.js +15 -7
- package/dist/index135.cjs +1 -1
- package/dist/index135.js +14 -6
- package/dist/index136.cjs +1 -1
- package/dist/index136.js +4 -41
- package/dist/index137.cjs +1 -1
- package/dist/index137.js +6 -5
- package/dist/index138.cjs +1 -1
- package/dist/index138.js +18 -13
- package/dist/index139.cjs +1 -1
- package/dist/index139.js +10 -34
- package/dist/index140.cjs +1 -1
- package/dist/index140.js +56 -53
- package/dist/index141.cjs +1 -1
- package/dist/index141.js +6 -25
- package/dist/index142.cjs +1 -1
- package/dist/index142.js +13 -6
- package/dist/index143.cjs +1 -1
- package/dist/index143.js +7 -18
- package/dist/index144.cjs +1 -1
- package/dist/index144.js +138 -15
- package/dist/index145.cjs +1 -1
- package/dist/index145.js +7 -5
- package/dist/index146.cjs +1 -1
- package/dist/index146.js +21 -13
- package/dist/index147.cjs +1 -1
- package/dist/index147.js +17 -10
- package/dist/index148.cjs +1 -1
- package/dist/index148.js +42 -11
- package/dist/index149.cjs +1 -1
- package/dist/index149.js +21 -11
- package/dist/index150.cjs +1 -1
- package/dist/index150.js +80 -8
- package/dist/index151.cjs +1 -1
- package/dist/index151.js +11 -3
- package/dist/index152.cjs +1 -1
- package/dist/index152.js +13 -16
- package/dist/index153.cjs +1 -1
- package/dist/index153.js +6 -5
- package/dist/index154.cjs +1 -1
- package/dist/index154.js +38 -168
- package/dist/index155.cjs +1 -1
- package/dist/index155.js +5 -103
- package/dist/index156.cjs +1 -1
- package/dist/index156.js +1 -1
- package/dist/index158.cjs +1 -1
- package/dist/index158.js +28 -28
- package/dist/index160.cjs +1 -1
- package/dist/index160.js +5 -5
- package/dist/index161.cjs +1 -1
- package/dist/index161.js +2 -2
- package/dist/index162.cjs +1 -1
- package/dist/index162.js +1 -1
- package/dist/index163.cjs +1 -1
- package/dist/index163.js +1 -1
- package/dist/index166.cjs +1 -1
- package/dist/index166.js +1 -1
- package/dist/index167.cjs +1 -1
- package/dist/index167.js +1 -1
- package/dist/index17.cjs +1 -1
- package/dist/index17.js +26 -16
- package/dist/index170.cjs +1 -1
- package/dist/index170.js +2 -2
- package/dist/index171.cjs +1 -1
- package/dist/index171.js +1 -1
- package/dist/index174.cjs +1 -1
- package/dist/index174.js +1 -1
- package/dist/index176.cjs +1 -1
- package/dist/index176.js +1 -1
- package/dist/index177.cjs +1 -1
- package/dist/index177.js +1 -1
- package/dist/index178.cjs +1 -1
- package/dist/index178.js +2 -2
- package/dist/index179.cjs +1 -1
- package/dist/index179.js +1 -1
- package/dist/index18.cjs +1 -1
- package/dist/index18.js +8 -8
- package/dist/index180.cjs +1 -1
- package/dist/index180.js +1 -1
- package/dist/index181.cjs +1 -1
- package/dist/index181.js +2 -2
- package/dist/index182.cjs +1 -1
- package/dist/index182.js +6 -6
- package/dist/index184.cjs +1 -1
- package/dist/index184.js +3 -3
- package/dist/index185.cjs +1 -1
- package/dist/index185.js +7 -7
- package/dist/index186.cjs +1 -1
- package/dist/index186.js +1 -1
- package/dist/index187.cjs +1 -1
- package/dist/index187.js +1 -1
- package/dist/index189.cjs +1 -1
- package/dist/index189.js +2 -2
- package/dist/index192.cjs +1 -1
- package/dist/index192.js +3 -3
- package/dist/index193.cjs +1 -1
- package/dist/index193.js +2 -2
- package/dist/index194.cjs +1 -1
- package/dist/index194.js +2 -2
- package/dist/index195.cjs +1 -1
- package/dist/index195.js +1 -1
- package/dist/index196.cjs +1 -1
- package/dist/index196.js +2 -2
- package/dist/index197.cjs +1 -1
- package/dist/index197.js +2 -2
- package/dist/index199.cjs +1 -1
- package/dist/index199.js +1 -1
- package/dist/index20.cjs +1 -1
- package/dist/index20.js +2 -2
- package/dist/index200.cjs +1 -1
- package/dist/index200.js +2 -2
- package/dist/index203.cjs +1 -1
- package/dist/index203.js +3 -3
- package/dist/index204.cjs +1 -1
- package/dist/index204.js +2 -2
- package/dist/index205.cjs +1 -1
- package/dist/index205.js +1 -1
- package/dist/index206.cjs +1 -1
- package/dist/index206.js +2 -2
- package/dist/index209.cjs +1 -1
- package/dist/index209.js +2 -2
- package/dist/index210.cjs +1 -1
- package/dist/index210.js +1 -1
- package/dist/index211.cjs +1 -1
- package/dist/index211.js +4 -4
- package/dist/index212.cjs +1 -1
- package/dist/index212.js +6 -6
- package/dist/index214.cjs +1 -1
- package/dist/index214.js +3 -3
- package/dist/index215.cjs +1 -1
- package/dist/index215.js +2 -2
- package/dist/index217.cjs +1 -1
- package/dist/index217.js +103 -24
- package/dist/index218.cjs +1 -1
- package/dist/index218.js +15 -45
- package/dist/index219.cjs +1 -1
- package/dist/index219.js +213 -8
- package/dist/index22.cjs +1 -1
- package/dist/index22.js +9 -9
- package/dist/index220.cjs +1 -1
- package/dist/index220.js +106 -101
- package/dist/index221.cjs +1 -1
- package/dist/index221.js +203 -13
- package/dist/index222.cjs +1 -1
- package/dist/index222.js +41 -213
- package/dist/index223.cjs +1 -2
- package/dist/index223.js +77 -40
- package/dist/index224.cjs +1 -1
- package/dist/index224.js +2 -2
- package/dist/index225.cjs +1 -1
- package/dist/index225.js +24 -5
- package/dist/index226.cjs +1 -1
- package/dist/index226.js +45 -9
- package/dist/index227.cjs +1 -1
- package/dist/index227.js +9 -19
- package/dist/index228.cjs +2 -1
- package/dist/index228.js +41 -8
- package/dist/index229.cjs +1 -1
- package/dist/index229.js +2 -67
- package/dist/index23.cjs +1 -1
- package/dist/index23.js +29 -12
- package/dist/index230.cjs +1 -1
- package/dist/index230.js +5 -65
- package/dist/index231.cjs +1 -1
- package/dist/index231.js +9 -187
- package/dist/index232.cjs +1 -1
- package/dist/index232.js +17 -26
- package/dist/index233.cjs +1 -1
- package/dist/index233.js +8 -76
- package/dist/index234.cjs +1 -1
- package/dist/index234.js +66 -40
- package/dist/index235.cjs +1 -1
- package/dist/index235.js +64 -15
- package/dist/index236.cjs +1 -1
- package/dist/index236.js +187 -12
- package/dist/index237.cjs +1 -1
- package/dist/index237.js +26 -106
- package/dist/index238.cjs +1 -1
- package/dist/index238.js +70 -200
- package/dist/index239.cjs +1 -1
- package/dist/index239.js +37 -39
- package/dist/index24.cjs +1 -1
- package/dist/index24.js +8 -59
- package/dist/index240.cjs +1 -1
- package/dist/index240.js +15 -77
- package/dist/index241.cjs +1 -1
- package/dist/index241.js +14 -2
- package/dist/index242.cjs +1 -1
- package/dist/index242.js +1 -1
- package/dist/index244.cjs +1 -1
- package/dist/index244.js +6 -19
- package/dist/index245.cjs +1 -1
- package/dist/index245.js +7 -7
- package/dist/index246.cjs +1 -1
- package/dist/index246.js +20 -7
- package/dist/index247.cjs +1 -1
- package/dist/index247.js +1 -1
- package/dist/index248.cjs +1 -1
- package/dist/index248.js +1 -1
- package/dist/index25.cjs +1 -16
- package/dist/index25.js +12 -113
- package/dist/index250.cjs +1 -2
- package/dist/index250.js +654 -88
- package/dist/index251.cjs +1 -1
- package/dist/index251.js +177 -14
- package/dist/index252.cjs +2 -1
- package/dist/index252.js +88 -654
- package/dist/index253.cjs +1 -1
- package/dist/index253.js +14 -177
- package/dist/index26.cjs +1 -1
- package/dist/index26.js +59 -30
- package/dist/index27.cjs +16 -1
- package/dist/index27.js +111 -24
- package/dist/index28.cjs +1 -1
- package/dist/index28.js +29 -7
- package/dist/index29.cjs +1 -1
- package/dist/index29.js +13 -171
- package/dist/index30.cjs +1 -1
- package/dist/index30.js +32 -109
- package/dist/index31.cjs +1 -1
- package/dist/index31.js +32 -30
- package/dist/index32.cjs +1 -1
- package/dist/index32.js +55 -3
- package/dist/index33.cjs +1 -1
- package/dist/index33.js +46 -2
- package/dist/index34.cjs +1 -1
- package/dist/index34.js +26 -4
- package/dist/index35.cjs +1 -2
- package/dist/index35.js +6 -59
- package/dist/index36.cjs +1 -2
- package/dist/index36.js +18 -54
- package/dist/index37.cjs +1 -3
- package/dist/index37.js +15 -215
- package/dist/index38.cjs +1 -1
- package/dist/index38.js +5 -23
- package/dist/index39.cjs +1 -1
- package/dist/index39.js +13 -18
- package/dist/index40.cjs +1 -1
- package/dist/index40.js +10 -10
- package/dist/index41.cjs +1 -1
- package/dist/index41.js +11 -19
- package/dist/index42.cjs +1 -1
- package/dist/index42.js +11 -45
- package/dist/index43.cjs +1 -1
- package/dist/index43.js +3 -13
- package/dist/index44.cjs +1 -1
- package/dist/index44.js +21 -12
- package/dist/index45.cjs +1 -1
- package/dist/index45.js +8 -24
- package/dist/index46.cjs +1 -1
- package/dist/index46.js +3 -28
- package/dist/index47.cjs +1 -1
- package/dist/index47.js +16 -47
- package/dist/index48.cjs +1 -1
- package/dist/index48.js +5 -16
- package/dist/index49.cjs +1 -1
- package/dist/index49.js +170 -10
- package/dist/index50.cjs +1 -1
- package/dist/index50.js +102 -30
- package/dist/index51.cjs +1 -1
- package/dist/index51.js +169 -34
- package/dist/index52.cjs +1 -1
- package/dist/index52.js +111 -7
- package/dist/index53.cjs +1 -1
- package/dist/index53.js +30 -29
- package/dist/index54.cjs +1 -1
- package/dist/index54.js +2 -23
- package/dist/index55.cjs +1 -1
- package/dist/index55.js +4 -8
- package/dist/index56.cjs +2 -1
- package/dist/index56.js +58 -69
- package/dist/index57.cjs +2 -1
- package/dist/index57.js +51 -43
- package/dist/index58.cjs +3 -1
- package/dist/index58.js +208 -16
- package/dist/index59.cjs +1 -1
- package/dist/index59.js +22 -36
- package/dist/index60.cjs +1 -1
- package/dist/index60.js +18 -17
- package/dist/index61.cjs +1 -1
- package/dist/index61.js +10 -6
- package/dist/index62.cjs +1 -1
- package/dist/index62.js +20 -9
- package/dist/index63.cjs +1 -1
- package/dist/index63.js +10 -10
- package/dist/index64.cjs +1 -1
- package/dist/index64.js +12 -164
- package/dist/index65.cjs +1 -1
- package/dist/index65.js +23 -31
- package/dist/index66.cjs +1 -1
- package/dist/index66.js +25 -74
- package/dist/index67.cjs +1 -1
- package/dist/index67.js +47 -13
- package/dist/index68.cjs +1 -1
- package/dist/index68.js +16 -51
- package/dist/index69.cjs +1 -1
- package/dist/index69.js +11 -7
- package/dist/index70.cjs +1 -1
- package/dist/index70.js +31 -7
- package/dist/index71.cjs +1 -1
- package/dist/index71.js +36 -21
- package/dist/index72.cjs +1 -1
- package/dist/index72.js +7 -8
- package/dist/index73.cjs +1 -1
- package/dist/index73.js +27 -29
- package/dist/index74.cjs +1 -1
- package/dist/index74.js +21 -15
- package/dist/index75.cjs +1 -1
- package/dist/index75.js +7 -73
- package/dist/index76.cjs +1 -1
- package/dist/index76.js +70 -35
- package/dist/index77.cjs +1 -1
- package/dist/index77.js +46 -16
- package/dist/index78.cjs +1 -1
- package/dist/index78.js +21 -73
- package/dist/index79.cjs +1 -1
- package/dist/index79.js +37 -12
- package/dist/index80.cjs +1 -1
- package/dist/index80.js +17 -29
- package/dist/index81.cjs +1 -2
- package/dist/index81.js +6 -120
- package/dist/index82.cjs +1 -1
- package/dist/index82.js +8 -13
- package/dist/index83.cjs +1 -1
- package/dist/index83.js +13 -24
- package/dist/index84.cjs +1 -1
- package/dist/index84.js +162 -31
- package/dist/index85.cjs +1 -1
- package/dist/index85.js +72 -39
- package/dist/index86.cjs +1 -1
- package/dist/index86.js +12 -5
- package/dist/index87.cjs +1 -1
- package/dist/index87.js +50 -102
- package/dist/index88.cjs +1 -1
- package/dist/index88.js +7 -37
- package/dist/index89.cjs +1 -1
- package/dist/index89.js +7 -8
- package/dist/index90.cjs +1 -1
- package/dist/index90.js +21 -20
- package/dist/index91.cjs +1 -1
- package/dist/index91.js +9 -2
- package/dist/index92.cjs +1 -1
- package/dist/index92.js +31 -75
- package/dist/index93.cjs +1 -1
- package/dist/index93.js +16 -15
- package/dist/index94.cjs +1 -1
- package/dist/index94.js +72 -150
- package/dist/index95.cjs +1 -20
- package/dist/index95.js +35 -326
- package/dist/index96.cjs +1 -3
- package/dist/index96.js +16 -451
- package/dist/index97.cjs +1 -1
- package/dist/index97.js +72 -70
- package/dist/index98.cjs +1 -1
- package/dist/index98.js +12 -16
- package/dist/index99.cjs +1 -1
- package/dist/index99.js +29 -10
- package/dist/src/lib/fetcher/fetcher.d.ts +1 -0
- package/dist/src/lib/retry.d.ts +3 -1
- package/package.json +1 -1
package/dist/index106.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 S=require("./index89.cjs"),k=require("./index100.cjs"),f=require("./index75.cjs"),$=require("./index107.cjs"),C=require("./index108.cjs"),B=require("./index109.cjs"),D=require("./index110.cjs"),P=require("./index80.cjs"),W=require("./index99.cjs"),y=require("./index20.cjs"),z=require("./index111.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/index106.js
CHANGED
|
@@ -1,93 +1,106 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
})
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
from: r == null ? void 0 : r.address,
|
|
36
|
-
id: C,
|
|
37
|
-
version: v
|
|
38
|
-
}
|
|
39
|
-
]
|
|
40
|
-
}, { retryCount: 0 });
|
|
41
|
-
return typeof t == "string" ? { id: t } : t;
|
|
42
|
-
} catch (t) {
|
|
43
|
-
const e = t;
|
|
44
|
-
if (b && (e.name === "MethodNotFoundRpcError" || e.name === "MethodNotSupportedRpcError" || e.name === "UnknownRpcError" || e.details.toLowerCase().includes("does not exist / is not available") || e.details.toLowerCase().includes("missing or invalid. request()") || e.details.toLowerCase().includes("did not match any variant of untagged enum") || e.details.toLowerCase().includes("account upgraded to unsupported contract") || e.details.toLowerCase().includes("eip-7702 not supported") || e.details.toLowerCase().includes("unsupported wc_ method") || // magic.link
|
|
45
|
-
e.details.toLowerCase().includes("feature toggled misconfigured") || // Trust Wallet
|
|
46
|
-
e.details.toLowerCase().includes("jsonrpcengine: response has no error or result for request"))) {
|
|
47
|
-
if (l && Object.values(l).some((n) => !n.optional)) {
|
|
48
|
-
const n = "non-optional `capabilities` are not supported on fallback to `eth_sendTransaction`.";
|
|
49
|
-
throw new L(new w(n, {
|
|
50
|
-
details: n
|
|
51
|
-
}));
|
|
52
|
-
}
|
|
53
|
-
if (h && u.length > 1) {
|
|
54
|
-
const o = "`forceAtomic` is not supported on fallback to `eth_sendTransaction`.";
|
|
55
|
-
throw new N(new w(o, {
|
|
56
|
-
details: o
|
|
57
|
-
}));
|
|
58
|
-
}
|
|
59
|
-
const a = [];
|
|
60
|
-
for (const o of u) {
|
|
61
|
-
const n = S(i, {
|
|
62
|
-
account: r,
|
|
63
|
-
chain: d,
|
|
64
|
-
data: o.data,
|
|
65
|
-
to: o.to,
|
|
66
|
-
value: o.value ? k(o.value) : void 0
|
|
67
|
-
});
|
|
68
|
-
a.push(n), m > 0 && await new Promise((x) => setTimeout(x, m));
|
|
69
|
-
}
|
|
70
|
-
const p = await Promise.allSettled(a);
|
|
71
|
-
if (p.every((o) => o.status === "rejected"))
|
|
72
|
-
throw p[0].reason;
|
|
73
|
-
const y = p.map((o) => o.status === "fulfilled" ? o.value : A);
|
|
74
|
-
return {
|
|
75
|
-
id: g([
|
|
76
|
-
...y,
|
|
77
|
-
c(d.id, { size: 32 }),
|
|
78
|
-
q
|
|
79
|
-
])
|
|
80
|
-
};
|
|
1
|
+
import { BlockNotFoundError as M } from "./index89.js";
|
|
2
|
+
import { WaitForTransactionReceiptTimeoutError as O, TransactionNotFoundError as W, TransactionReceiptNotFoundError as q } from "./index100.js";
|
|
3
|
+
import { getAction as u } from "./index75.js";
|
|
4
|
+
import { observe as z } from "./index107.js";
|
|
5
|
+
import { withResolvers as G } from "./index108.js";
|
|
6
|
+
import { withRetry as B } from "./index109.js";
|
|
7
|
+
import { stringify as H } from "./index110.js";
|
|
8
|
+
import { getBlock as J } from "./index80.js";
|
|
9
|
+
import { getTransaction as K } from "./index99.js";
|
|
10
|
+
import { getTransactionReceipt as y } from "./index20.js";
|
|
11
|
+
import { watchBlockNumber as L } from "./index111.js";
|
|
12
|
+
async function er(t, b) {
|
|
13
|
+
const {
|
|
14
|
+
checkReplacement: F = !0,
|
|
15
|
+
confirmations: a = 1,
|
|
16
|
+
hash: m,
|
|
17
|
+
onReplaced: I,
|
|
18
|
+
retryCount: N = 6,
|
|
19
|
+
retryDelay: R = ({ count: e }) => ~~(1 << e) * 200,
|
|
20
|
+
// exponential backoff
|
|
21
|
+
timeout: h = 18e4
|
|
22
|
+
} = b, E = H(["waitForTransactionReceipt", t.uid, m]), j = (() => {
|
|
23
|
+
var e;
|
|
24
|
+
return b.pollingInterval ? b.pollingInterval : (e = t.chain) != null && e.experimental_preconfirmationTime ? t.chain.experimental_preconfirmationTime : t.pollingInterval;
|
|
25
|
+
})();
|
|
26
|
+
let l, i, r, s = !1, o, c;
|
|
27
|
+
const { promise: x, resolve: A, reject: v } = G(), w = h ? setTimeout(() => {
|
|
28
|
+
c == null || c(), o == null || o(), v(new O({ hash: m }));
|
|
29
|
+
}, h) : void 0;
|
|
30
|
+
return o = z(E, { onReplaced: I, resolve: A, reject: v }, async (e) => {
|
|
31
|
+
if (r = await u(t, y, "getTransactionReceipt")({ hash: m }).catch(() => {
|
|
32
|
+
}), r && a <= 1) {
|
|
33
|
+
clearTimeout(w), e.resolve(r), o == null || o();
|
|
34
|
+
return;
|
|
81
35
|
}
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
36
|
+
c = u(t, L, "watchBlockNumber")({
|
|
37
|
+
emitMissed: !0,
|
|
38
|
+
emitOnBegin: !0,
|
|
39
|
+
poll: !0,
|
|
40
|
+
pollingInterval: j,
|
|
41
|
+
async onBlockNumber(C) {
|
|
42
|
+
const p = (T) => {
|
|
43
|
+
clearTimeout(w), c == null || c(), T(), o == null || o();
|
|
44
|
+
};
|
|
45
|
+
let d = C;
|
|
46
|
+
if (!s)
|
|
47
|
+
try {
|
|
48
|
+
if (r) {
|
|
49
|
+
if (a > 1 && (!r.blockNumber || d - r.blockNumber + 1n < a))
|
|
50
|
+
return;
|
|
51
|
+
p(() => e.resolve(r));
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
if (F && !l && (s = !0, await B(async () => {
|
|
55
|
+
l = await u(t, K, "getTransaction")({ hash: m }), l.blockNumber && (d = l.blockNumber);
|
|
56
|
+
}, {
|
|
57
|
+
delay: R,
|
|
58
|
+
retryCount: N
|
|
59
|
+
}), s = !1), r = await u(t, y, "getTransactionReceipt")({ hash: m }), a > 1 && (!r.blockNumber || d - r.blockNumber + 1n < a))
|
|
60
|
+
return;
|
|
61
|
+
p(() => e.resolve(r));
|
|
62
|
+
} catch (T) {
|
|
63
|
+
if (T instanceof W || T instanceof q) {
|
|
64
|
+
if (!l) {
|
|
65
|
+
s = !1;
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
try {
|
|
69
|
+
i = l, s = !0;
|
|
70
|
+
const k = await B(() => u(t, J, "getBlock")({
|
|
71
|
+
blockNumber: d,
|
|
72
|
+
includeTransactions: !0
|
|
73
|
+
}), {
|
|
74
|
+
delay: R,
|
|
75
|
+
retryCount: N,
|
|
76
|
+
shouldRetry: ({ error: f }) => f instanceof M
|
|
77
|
+
});
|
|
78
|
+
s = !1;
|
|
79
|
+
const n = k.transactions.find(({ from: f, nonce: D }) => f === i.from && D === i.nonce);
|
|
80
|
+
if (!n || (r = await u(t, y, "getTransactionReceipt")({
|
|
81
|
+
hash: n.hash
|
|
82
|
+
}), a > 1 && (!r.blockNumber || d - r.blockNumber + 1n < a)))
|
|
83
|
+
return;
|
|
84
|
+
let g = "replaced";
|
|
85
|
+
n.to === i.to && n.value === i.value && n.input === i.input ? g = "repriced" : n.from === n.to && n.value === 0n && (g = "cancelled"), p(() => {
|
|
86
|
+
var f;
|
|
87
|
+
(f = e.onReplaced) == null || f.call(e, {
|
|
88
|
+
reason: g,
|
|
89
|
+
replacedTransaction: i,
|
|
90
|
+
transaction: n,
|
|
91
|
+
transactionReceipt: r
|
|
92
|
+
}), e.resolve(r);
|
|
93
|
+
});
|
|
94
|
+
} catch (k) {
|
|
95
|
+
p(() => e.reject(k));
|
|
96
|
+
}
|
|
97
|
+
} else
|
|
98
|
+
p(() => e.reject(T));
|
|
99
|
+
}
|
|
100
|
+
}
|
|
86
101
|
});
|
|
87
|
-
}
|
|
102
|
+
}), x;
|
|
88
103
|
}
|
|
89
104
|
export {
|
|
90
|
-
|
|
91
|
-
A as fallbackTransactionErrorMagicIdentifier,
|
|
92
|
-
P as sendCalls
|
|
105
|
+
er as waitForTransactionReceipt
|
|
93
106
|
};
|
package/dist/index107.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/index107.js
CHANGED
|
@@ -1,17 +1,40 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
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);
|
|
32
|
+
};
|
|
33
|
+
const a = m(u);
|
|
34
|
+
return typeof a == "function" && g.set(s, a), r;
|
|
14
35
|
}
|
|
15
36
|
export {
|
|
16
|
-
|
|
37
|
+
g as cleanupCache,
|
|
38
|
+
f as listenersCache,
|
|
39
|
+
y as observe
|
|
17
40
|
};
|
package/dist/index108.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 i(){let e=()=>{},t=()=>{};return{promise:new Promise((r,o)=>{e=r,t=o}),resolve:e,reject:t}}exports.withResolvers=i;
|
package/dist/index108.js
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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 };
|
|
3
8
|
}
|
|
4
9
|
export {
|
|
5
|
-
|
|
10
|
+
i as withResolvers
|
|
6
11
|
};
|
package/dist/index109.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 u=require("./index207.cjs");function f(n,{delay:e=100,retryCount:o=2,shouldRetry:c=()=>!0}={}){return new Promise((s,y)=>{const a=async({count:r=0}={})=>{const w=async({error:t})=>{const i=typeof e=="function"?e({count:r,error:t}):e;i&&await u.wait(i),a({count:r+1})};try{const t=await n();s(t)}catch(t){if(r<o&&await c({count:r,error:t}))return w({error:t});y(t)}};a()})}exports.withRetry=f;
|
package/dist/index109.js
CHANGED
|
@@ -1,29 +1,23 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
nonce: u
|
|
21
|
-
};
|
|
22
|
-
return typeof n.chainId > "u" && (n.chainId = ((i = r.chain) == null ? void 0 : i.id) ?? await a(r, p, "getChainId")({})), typeof n.nonce > "u" && (n.nonce = await a(r, g, "getTransactionCount")({
|
|
23
|
-
address: d.address,
|
|
24
|
-
blockTag: "pending"
|
|
25
|
-
}), (t === "self" || t != null && t.address && h(t.address, d.address)) && (n.nonce += 1)), n;
|
|
1
|
+
import { wait as w } from "./index207.js";
|
|
2
|
+
function p(n, { delay: e = 100, retryCount: o = 2, shouldRetry: c = () => !0 } = {}) {
|
|
3
|
+
return new Promise((s, y) => {
|
|
4
|
+
const a = async ({ count: r = 0 } = {}) => {
|
|
5
|
+
const f = async ({ error: t }) => {
|
|
6
|
+
const i = typeof e == "function" ? e({ count: r, error: t }) : e;
|
|
7
|
+
i && await w(i), a({ count: r + 1 });
|
|
8
|
+
};
|
|
9
|
+
try {
|
|
10
|
+
const t = await n();
|
|
11
|
+
s(t);
|
|
12
|
+
} catch (t) {
|
|
13
|
+
if (r < o && await c({ count: r, error: t }))
|
|
14
|
+
return f({ error: t });
|
|
15
|
+
y(t);
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
a();
|
|
19
|
+
});
|
|
26
20
|
}
|
|
27
21
|
export {
|
|
28
|
-
|
|
22
|
+
p as withRetry
|
|
29
23
|
};
|
package/dist/index110.cjs
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
2
|
-
`),{docsPath:o,docsSlug:"account",name:"AccountNotFoundError"})}}class u extends t.BaseError{constructor({docsPath:o,metaMessages:e,type:n}){super(`Account type "${n}" is not supported.`,{docsPath:o,metaMessages:e,name:"AccountTypeNotSupportedError"})}}exports.AccountNotFoundError=c;exports.AccountTypeNotSupportedError=u;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=(e,n,i)=>JSON.stringify(e,(o,t)=>typeof t=="bigint"?t.toString():t,i);exports.stringify=r;
|
package/dist/index110.js
CHANGED
|
@@ -1,27 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
class u extends t {
|
|
3
|
-
constructor({ docsPath: o } = {}) {
|
|
4
|
-
super([
|
|
5
|
-
"Could not find an Account to execute with this Action.",
|
|
6
|
-
"Please provide an Account with the `account` argument on the Action, or by supplying an `account` to the Client."
|
|
7
|
-
].join(`
|
|
8
|
-
`), {
|
|
9
|
-
docsPath: o,
|
|
10
|
-
docsSlug: "account",
|
|
11
|
-
name: "AccountNotFoundError"
|
|
12
|
-
});
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
class s extends t {
|
|
16
|
-
constructor({ docsPath: o, metaMessages: c, type: r }) {
|
|
17
|
-
super(`Account type "${r}" is not supported.`, {
|
|
18
|
-
docsPath: o,
|
|
19
|
-
metaMessages: c,
|
|
20
|
-
name: "AccountTypeNotSupportedError"
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
}
|
|
1
|
+
const g = (r, n, i) => JSON.stringify(r, (e, t) => typeof t == "bigint" ? t.toString() : t, i);
|
|
24
2
|
export {
|
|
25
|
-
|
|
26
|
-
s as AccountTypeNotSupportedError
|
|
3
|
+
g as stringify
|
|
27
4
|
};
|
package/dist/index111.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 v=require("./index31.cjs"),w=require("./index75.cjs"),N=require("./index107.cjs"),h=require("./index112.cjs"),g=require("./index110.cjs"),m=require("./index91.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/index111.js
CHANGED
|
@@ -1,12 +1,78 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import { hexToBigInt as w } from "./index31.js";
|
|
2
|
+
import { getAction as g } from "./index75.js";
|
|
3
|
+
import { observe as y } from "./index107.js";
|
|
4
|
+
import { poll as h } from "./index112.js";
|
|
5
|
+
import { stringify as N } from "./index110.js";
|
|
6
|
+
import { getBlockNumber as v } from "./index91.js";
|
|
7
|
+
function j(r, { emitOnBegin: b = !1, emitMissed: p = !1, onBlockNumber: l, onError: a, poll: k, pollingInterval: i = r.pollingInterval }) {
|
|
8
|
+
const B = typeof k < "u" ? k : !(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"));
|
|
9
|
+
let t;
|
|
10
|
+
return B ? (() => {
|
|
11
|
+
const f = N([
|
|
12
|
+
"watchBlockNumber",
|
|
13
|
+
r.uid,
|
|
14
|
+
b,
|
|
15
|
+
p,
|
|
16
|
+
i
|
|
17
|
+
]);
|
|
18
|
+
return y(f, { onBlockNumber: l, onError: a }, (e) => h(async () => {
|
|
19
|
+
var u;
|
|
20
|
+
try {
|
|
21
|
+
const o = await g(r, v, "getBlockNumber")({ cacheTime: 0 });
|
|
22
|
+
if (t !== void 0) {
|
|
23
|
+
if (o === t)
|
|
24
|
+
return;
|
|
25
|
+
if (o - t > 1 && p)
|
|
26
|
+
for (let s = t + 1n; s < o; s++)
|
|
27
|
+
e.onBlockNumber(s, t), t = s;
|
|
28
|
+
}
|
|
29
|
+
(t === void 0 || o > t) && (e.onBlockNumber(o, t), t = o);
|
|
30
|
+
} catch (o) {
|
|
31
|
+
(u = e.onError) == null || u.call(e, o);
|
|
32
|
+
}
|
|
33
|
+
}, {
|
|
34
|
+
emitOnBegin: b,
|
|
35
|
+
interval: i
|
|
36
|
+
}));
|
|
37
|
+
})() : (() => {
|
|
38
|
+
const f = N([
|
|
39
|
+
"watchBlockNumber",
|
|
40
|
+
r.uid,
|
|
41
|
+
b,
|
|
42
|
+
p
|
|
43
|
+
]);
|
|
44
|
+
return y(f, { onBlockNumber: l, onError: a }, (e) => {
|
|
45
|
+
let u = !0, o = () => u = !1;
|
|
46
|
+
return (async () => {
|
|
47
|
+
try {
|
|
48
|
+
const s = (() => {
|
|
49
|
+
if (r.transport.type === "fallback") {
|
|
50
|
+
const c = r.transport.transports.find((n) => n.config.type === "webSocket" || n.config.type === "ipc");
|
|
51
|
+
return c ? c.value : r.transport;
|
|
52
|
+
}
|
|
53
|
+
return r.transport;
|
|
54
|
+
})(), { unsubscribe: d } = await s.subscribe({
|
|
55
|
+
params: ["newHeads"],
|
|
56
|
+
onData(c) {
|
|
57
|
+
var m;
|
|
58
|
+
if (!u)
|
|
59
|
+
return;
|
|
60
|
+
const n = w((m = c.result) == null ? void 0 : m.number);
|
|
61
|
+
e.onBlockNumber(n, t), t = n;
|
|
62
|
+
},
|
|
63
|
+
onError(c) {
|
|
64
|
+
var n;
|
|
65
|
+
(n = e.onError) == null || n.call(e, c);
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
o = d, u || o();
|
|
69
|
+
} catch (s) {
|
|
70
|
+
a == null || a(s);
|
|
71
|
+
}
|
|
72
|
+
})(), () => o();
|
|
73
|
+
});
|
|
74
|
+
})();
|
|
9
75
|
}
|
|
10
76
|
export {
|
|
11
|
-
|
|
77
|
+
j as watchBlockNumber
|
|
12
78
|
};
|
package/dist/index112.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 u=require("./index207.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/index112.js
CHANGED
|
@@ -1,11 +1,18 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { wait as r } from "./index207.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/index113.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const B=require("./index114.cjs"),M=require("./index115.cjs"),P=require("./index116.cjs"),_=require("./index71.cjs"),I=require("./index98.cjs"),b=require("./index75.cjs"),A=require("./index107.cjs"),O=require("./index112.cjs"),S=require("./index110.cjs"),$=require("./index70.cjs"),j=require("./index91.cjs"),z=require("./index93.cjs"),R=require("./index96.cjs"),U=require("./index105.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;
|