@gardenfi/swap 0.0.2-beta.2 → 0.0.2-beta.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (230) hide show
  1. package/dist/index104.cjs +1 -1
  2. package/dist/index104.js +4 -4
  3. package/dist/index106.cjs +1 -1
  4. package/dist/index106.js +3 -3
  5. package/dist/index107.cjs +1 -1
  6. package/dist/index107.js +3 -3
  7. package/dist/index116.cjs +1 -1
  8. package/dist/index116.js +1 -1
  9. package/dist/index117.cjs +1 -1
  10. package/dist/index117.js +1 -1
  11. package/dist/index12.cjs +1 -1
  12. package/dist/index12.js +12 -12
  13. package/dist/index120.cjs +1 -1
  14. package/dist/index120.js +2 -2
  15. package/dist/index121.cjs +1 -1
  16. package/dist/index121.js +7 -7
  17. package/dist/index132.cjs +1 -1
  18. package/dist/index132.js +1 -1
  19. package/dist/index133.cjs +1 -1
  20. package/dist/index133.js +1 -1
  21. package/dist/index134.cjs +1 -1
  22. package/dist/index134.js +1 -1
  23. package/dist/index135.cjs +1 -1
  24. package/dist/index135.js +1 -1
  25. package/dist/index138.cjs +1 -1
  26. package/dist/index138.js +2 -2
  27. package/dist/index161.cjs +1 -1
  28. package/dist/index161.js +2 -2
  29. package/dist/index167.cjs +1 -1
  30. package/dist/index167.js +1 -1
  31. package/dist/index168.cjs +1 -1
  32. package/dist/index168.js +2 -2
  33. package/dist/index169.cjs +1 -1
  34. package/dist/index169.js +2 -2
  35. package/dist/index170.cjs +1 -1
  36. package/dist/index170.js +2 -2
  37. package/dist/index171.cjs +1 -1
  38. package/dist/index171.js +2 -2
  39. package/dist/index172.cjs +1 -1
  40. package/dist/index172.js +2 -2
  41. package/dist/index272.cjs +1 -1
  42. package/dist/index272.js +9 -174
  43. package/dist/index273.cjs +1 -2
  44. package/dist/index273.js +30 -91
  45. package/dist/index274.cjs +1 -1
  46. package/dist/index274.js +2 -41
  47. package/dist/index275.cjs +1 -1
  48. package/dist/index275.js +47 -4
  49. package/dist/index276.cjs +1 -1
  50. package/dist/index276.js +11 -9
  51. package/dist/index277.cjs +1 -1
  52. package/dist/index277.js +174 -30
  53. package/dist/index278.cjs +2 -1
  54. package/dist/index278.js +92 -2
  55. package/dist/index279.cjs +1 -1
  56. package/dist/index279.js +38 -45
  57. package/dist/index280.cjs +1 -1
  58. package/dist/index280.js +4 -11
  59. package/dist/index281.cjs +1 -1
  60. package/dist/index281.js +3 -3
  61. package/dist/index283.cjs +1 -2
  62. package/dist/index283.js +42 -41
  63. package/dist/index284.cjs +1 -1
  64. package/dist/index284.js +321 -2
  65. package/dist/index285.cjs +1 -1
  66. package/dist/index285.js +605 -5
  67. package/dist/index286.cjs +1 -1
  68. package/dist/index286.js +109 -10
  69. package/dist/index287.cjs +1 -1
  70. package/dist/index287.js +167 -19
  71. package/dist/index288.cjs +1 -1
  72. package/dist/index288.js +301 -8
  73. package/dist/index289.cjs +1 -1
  74. package/dist/index289.js +93 -72
  75. package/dist/index290.cjs +1 -1
  76. package/dist/index290.js +54 -63
  77. package/dist/index291.cjs +1 -1
  78. package/dist/index291.js +51 -186
  79. package/dist/index292.cjs +1 -1
  80. package/dist/index292.js +42 -20
  81. package/dist/index293.cjs +1 -1
  82. package/dist/index293.js +14 -41
  83. package/dist/index294.cjs +1 -1
  84. package/dist/index294.js +315 -23
  85. package/dist/index295.cjs +1 -1
  86. package/dist/index295.js +57 -88
  87. package/dist/index296.cjs +1 -1
  88. package/dist/index296.js +19 -40
  89. package/dist/index297.cjs +1 -1
  90. package/dist/index297.js +28 -15
  91. package/dist/index298.cjs +1 -1
  92. package/dist/index298.js +3 -13
  93. package/dist/index299.cjs +7 -1
  94. package/dist/index299.js +237 -7
  95. package/dist/index300.cjs +1 -1
  96. package/dist/index300.js +48 -38
  97. package/dist/index301.cjs +1 -1
  98. package/dist/index301.js +211 -14
  99. package/dist/index302.cjs +1 -1
  100. package/dist/index302.js +77 -38
  101. package/dist/index303.cjs +1 -1
  102. package/dist/index303.js +25 -316
  103. package/dist/index304.cjs +1 -1
  104. package/dist/index304.js +73 -602
  105. package/dist/index305.cjs +2 -1
  106. package/dist/index305.js +41 -109
  107. package/dist/index306.cjs +1 -1
  108. package/dist/index306.js +2 -168
  109. package/dist/index307.cjs +1 -1
  110. package/dist/index307.js +5 -301
  111. package/dist/index308.cjs +1 -1
  112. package/dist/index308.js +10 -93
  113. package/dist/index309.cjs +1 -1
  114. package/dist/index309.js +18 -55
  115. package/dist/index310.cjs +1 -1
  116. package/dist/index310.js +8 -53
  117. package/dist/index311.cjs +1 -1
  118. package/dist/index311.js +72 -44
  119. package/dist/index312.cjs +1 -1
  120. package/dist/index312.js +64 -14
  121. package/dist/index313.cjs +1 -1
  122. package/dist/index313.js +184 -313
  123. package/dist/index314.cjs +1 -1
  124. package/dist/index314.js +19 -56
  125. package/dist/index315.cjs +1 -1
  126. package/dist/index315.js +42 -19
  127. package/dist/index316.cjs +1 -1
  128. package/dist/index316.js +23 -27
  129. package/dist/index317.cjs +1 -1
  130. package/dist/index317.js +90 -3
  131. package/dist/index318.cjs +1 -7
  132. package/dist/index318.js +33 -230
  133. package/dist/index319.cjs +1 -1
  134. package/dist/index319.js +17 -48
  135. package/dist/index320.cjs +1 -1
  136. package/dist/index320.js +11 -210
  137. package/dist/index321.cjs +1 -1
  138. package/dist/index321.js +7 -81
  139. package/dist/index322.cjs +1 -1
  140. package/dist/index322.js +36 -28
  141. package/dist/index323.cjs +1 -1
  142. package/dist/index323.js +15 -76
  143. package/dist/index326.cjs +1 -1
  144. package/dist/index326.js +1 -1
  145. package/dist/index327.cjs +1 -1
  146. package/dist/index327.js +1 -1
  147. package/dist/index333.cjs +1 -1
  148. package/dist/index333.js +2 -2
  149. package/dist/index334.cjs +1 -1
  150. package/dist/index334.js +2 -2
  151. package/dist/index340.cjs +1 -1
  152. package/dist/index340.js +1 -1
  153. package/dist/index341.cjs +1 -1
  154. package/dist/index341.js +1 -1
  155. package/dist/index343.cjs +1 -1
  156. package/dist/index343.js +1 -1
  157. package/dist/index346.cjs +1 -1
  158. package/dist/index346.js +1 -1
  159. package/dist/index347.cjs +1 -1
  160. package/dist/index347.js +1 -1
  161. package/dist/index348.cjs +1 -1
  162. package/dist/index348.js +3 -3
  163. package/dist/index349.cjs +1 -2
  164. package/dist/index349.js +4 -193
  165. package/dist/index350.cjs +2 -1
  166. package/dist/index350.js +168 -52
  167. package/dist/index351.cjs +1 -1
  168. package/dist/index351.js +65 -331
  169. package/dist/index352.cjs +1 -1
  170. package/dist/index352.js +332 -149
  171. package/dist/index353.cjs +1 -1
  172. package/dist/index353.js +161 -5
  173. package/dist/index354.cjs +1 -1
  174. package/dist/index354.js +5 -5
  175. package/dist/index357.cjs +1 -1
  176. package/dist/index357.js +8 -205
  177. package/dist/index359.cjs +1 -1
  178. package/dist/index359.js +205 -8
  179. package/dist/index360.cjs +1 -1
  180. package/dist/index360.js +94 -68
  181. package/dist/index361.cjs +1 -1
  182. package/dist/index361.js +28 -94
  183. package/dist/index362.cjs +1 -1
  184. package/dist/index362.js +147 -27
  185. package/dist/index363.cjs +1 -1
  186. package/dist/index363.js +324 -118
  187. package/dist/index364.cjs +1 -1
  188. package/dist/index364.js +72 -353
  189. package/dist/index365.cjs +1 -1
  190. package/dist/index365.js +29 -71
  191. package/dist/index366.cjs +1 -1
  192. package/dist/index366.js +5 -31
  193. package/dist/index367.cjs +1 -1
  194. package/dist/index367.js +275 -5
  195. package/dist/index368.cjs +1 -1
  196. package/dist/index368.js +171 -4
  197. package/dist/index369.cjs +1 -1
  198. package/dist/index369.js +10 -141
  199. package/dist/index370.cjs +1 -1
  200. package/dist/index370.js +105 -273
  201. package/dist/index371.cjs +1 -1
  202. package/dist/index371.js +10 -171
  203. package/dist/index372.cjs +1 -1
  204. package/dist/index372.js +69 -10
  205. package/dist/index373.cjs +1 -1
  206. package/dist/index373.js +3 -107
  207. package/dist/index374.cjs +1 -1
  208. package/dist/index374.js +140 -9
  209. package/dist/index375.cjs +1 -1
  210. package/dist/index375.js +4 -4
  211. package/dist/index376.cjs +1 -1
  212. package/dist/index376.js +2 -79
  213. package/dist/index377.cjs +1 -1
  214. package/dist/index377.js +79 -2
  215. package/dist/index379.cjs +1 -1
  216. package/dist/index379.js +1 -1
  217. package/dist/index380.cjs +1 -1
  218. package/dist/index380.js +1 -1
  219. package/dist/index381.cjs +1 -1
  220. package/dist/index381.js +2 -22
  221. package/dist/index382.cjs +1 -1
  222. package/dist/index382.js +22 -2
  223. package/dist/index385.cjs +1 -1
  224. package/dist/index385.js +2 -2
  225. package/dist/index77.cjs +1 -1
  226. package/dist/index77.js +13 -13
  227. package/dist/index99.cjs +1 -1
  228. package/dist/index99.js +1 -1
  229. package/dist/src/lib/store/swapStore.d.ts +1 -1
  230. package/package.json +5 -5
package/dist/index104.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Y=require("./index277.cjs"),Z=require("./index123.cjs"),j=require("./index46.cjs"),ee=require("./index278.cjs"),R=require("./index93.cjs"),F=require("./index189.cjs"),A=require("./index85.cjs"),L=require("./index94.cjs"),te=require("./index221.cjs"),$=require("./index95.cjs"),ae=require("./index96.cjs"),re=require("./index84.cjs"),G=require("./index81.cjs"),oe=require("./index269.cjs"),ce=require("./index271.cjs"),ne=require("./index108.cjs"),se=require("./index181.cjs"),ie=require("./index279.cjs"),le=require("./index261.cjs"),M=require("./index280.cjs");async function ue(e,t){var P,T,H,_;const{account:a=e.account,authorizationList:s,batch:i=!!((P=e.batch)!=null&&P.multicall),blockNumber:l,blockTag:C=e.experimental_blockTag??"latest",accessList:D,blobs:k,blockOverrides:y,code:m,data:c,factory:b,factoryData:u,gas:x,gasPrice:w,maxFeePerBlobGas:p,maxFeePerGas:g,maxPriorityFeePerGas:h,nonce:q,to:r,value:J,stateOverride:K,...Q}=t,E=a?Z.parseAccount(a):void 0;if(m&&(b||u))throw new F.BaseError("Cannot provide both `code` & `factory`/`factoryData` as parameters.");if(m&&r)throw new F.BaseError("Cannot provide both `code` & `to` as parameters.");const N=m&&c,S=b&&u&&r&&c,O=N||S,U=N?W({code:m,data:c}):S?be({data:c,factory:b,factoryData:u,to:r}):c;try{le.assertRequest(t);const o=(typeof l=="bigint"?G.numberToHex(l):void 0)||C,d=y?Y.toRpc(y):void 0,f=ie.serializeStateOverride(K),V=(_=(H=(T=e.chain)==null?void 0:T.formatters)==null?void 0:H.transactionRequest)==null?void 0:_.format,B=(V||ne.formatTransactionRequest)({...ce.extract(Q,{format:V}),accessList:D,account:E,authorizationList:s,blobs:k,data:U,gas:x,gasPrice:w,maxFeePerBlobGas:p,maxFeePerGas:g,maxPriorityFeePerGas:h,nonce:q,to:O?void 0:r,value:J},"call");if(i&&de({request:B})&&!f&&!d)try{return await fe(e,{...B,blockNumber:l,blockTag:C})}catch(n){if(!(n instanceof A.ClientChainNotConfiguredError)&&!(n instanceof A.ChainDoesNotSupportContract))throw n}const X=(()=>{const n=[B,o];return f&&d?[...n,f,d]:f?[...n,f]:d?[...n,{},d]:n})(),z=await e.request({method:"eth_call",params:X});return z==="0x"?{data:void 0}:{data:z}}catch(v){const o=I(v),{offchainLookup:d,offchainLookupSignature:f}=await Promise.resolve().then(()=>require("./index240.cjs"));if(e.ccipRead!==!1&&(o==null?void 0:o.slice(0,10))===f&&r)return{data:await d(e,{data:o,to:r})};throw O&&(o==null?void 0:o.slice(0,10))==="0x101bb98d"?new L.CounterfactualDeploymentFailedError({factory:b}):oe.getCallError(v,{...t,account:E,chain:e.chain})}}function de({request:e}){const{data:t,to:a,...s}=e;return!(!t||t.startsWith(ee.aggregate3Signature)||!a||Object.values(s).filter(i=>typeof i<"u").length>0)}async function fe(e,t){var w;const{batchSize:a=1024,deployless:s=!1,wait:i=0}=typeof((w=e.batch)==null?void 0:w.multicall)=="object"?e.batch.multicall:{},{blockNumber:l,blockTag:C=e.experimental_blockTag??"latest",data:D,to:k}=t,y=(()=>{if(s)return null;if(t.multicallAddress)return t.multicallAddress;if(e.chain)return re.getChainContractAddress({blockNumber:l,chain:e.chain,contract:"multicall3"});throw new A.ClientChainNotConfiguredError})(),c=(typeof l=="bigint"?G.numberToHex(l):void 0)||C,{schedule:b}=se.createBatchScheduler({id:`${e.uid}.${c}`,wait:i,shouldSplitBatch(p){return p.reduce((h,{data:q})=>h+(q.length-2),0)>a*2},fn:async p=>{const g=p.map(r=>({allowFailure:!0,callData:r.data,target:r.to})),h=ae.encodeFunctionData({abi:j.multicall3Abi,args:[g],functionName:"aggregate3"}),q=await e.request({method:"eth_call",params:[{...y===null?{data:W({code:R.multicall3Bytecode,data:h})}:{to:y,data:h}},c]});return te.decodeFunctionResult({abi:j.multicall3Abi,args:[g],functionName:"aggregate3",data:q||"0x"})}}),[{returnData:u,success:x}]=await b({data:D,to:k});if(!x)throw new L.RawContractError({data:u});return u==="0x"?{data:void 0}:{data:u}}function W(e){const{code:t,data:a}=e;return $.encodeDeployData({abi:M.parseAbi(["constructor(bytes, bytes)"]),bytecode:R.deploylessCallViaBytecodeBytecode,args:[t,a]})}function be(e){const{data:t,factory:a,factoryData:s,to:i}=e;return $.encodeDeployData({abi:M.parseAbi(["constructor(address, bytes, address, bytes)"]),bytecode:R.deploylessCallViaFactoryBytecode,args:[i,t,a,s]})}function I(e){var a;if(!(e instanceof F.BaseError))return;const t=e.walk();return typeof(t==null?void 0:t.data)=="object"?(a=t.data)==null?void 0:a.data:t.data}exports.call=ue;exports.getRevertErrorData=I;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Y=require("./index273.cjs"),Z=require("./index123.cjs"),j=require("./index46.cjs"),ee=require("./index274.cjs"),R=require("./index93.cjs"),F=require("./index189.cjs"),A=require("./index85.cjs"),L=require("./index94.cjs"),te=require("./index221.cjs"),$=require("./index95.cjs"),ae=require("./index96.cjs"),re=require("./index84.cjs"),G=require("./index81.cjs"),oe=require("./index269.cjs"),ce=require("./index271.cjs"),ne=require("./index108.cjs"),se=require("./index181.cjs"),ie=require("./index275.cjs"),le=require("./index261.cjs"),M=require("./index276.cjs");async function ue(e,t){var P,T,H,_;const{account:a=e.account,authorizationList:s,batch:i=!!((P=e.batch)!=null&&P.multicall),blockNumber:l,blockTag:C=e.experimental_blockTag??"latest",accessList:D,blobs:k,blockOverrides:y,code:m,data:c,factory:b,factoryData:u,gas:x,gasPrice:w,maxFeePerBlobGas:p,maxFeePerGas:g,maxPriorityFeePerGas:h,nonce:q,to:r,value:J,stateOverride:K,...Q}=t,E=a?Z.parseAccount(a):void 0;if(m&&(b||u))throw new F.BaseError("Cannot provide both `code` & `factory`/`factoryData` as parameters.");if(m&&r)throw new F.BaseError("Cannot provide both `code` & `to` as parameters.");const N=m&&c,S=b&&u&&r&&c,O=N||S,U=N?W({code:m,data:c}):S?be({data:c,factory:b,factoryData:u,to:r}):c;try{le.assertRequest(t);const o=(typeof l=="bigint"?G.numberToHex(l):void 0)||C,d=y?Y.toRpc(y):void 0,f=ie.serializeStateOverride(K),V=(_=(H=(T=e.chain)==null?void 0:T.formatters)==null?void 0:H.transactionRequest)==null?void 0:_.format,B=(V||ne.formatTransactionRequest)({...ce.extract(Q,{format:V}),accessList:D,account:E,authorizationList:s,blobs:k,data:U,gas:x,gasPrice:w,maxFeePerBlobGas:p,maxFeePerGas:g,maxPriorityFeePerGas:h,nonce:q,to:O?void 0:r,value:J},"call");if(i&&de({request:B})&&!f&&!d)try{return await fe(e,{...B,blockNumber:l,blockTag:C})}catch(n){if(!(n instanceof A.ClientChainNotConfiguredError)&&!(n instanceof A.ChainDoesNotSupportContract))throw n}const X=(()=>{const n=[B,o];return f&&d?[...n,f,d]:f?[...n,f]:d?[...n,{},d]:n})(),z=await e.request({method:"eth_call",params:X});return z==="0x"?{data:void 0}:{data:z}}catch(v){const o=I(v),{offchainLookup:d,offchainLookupSignature:f}=await Promise.resolve().then(()=>require("./index240.cjs"));if(e.ccipRead!==!1&&(o==null?void 0:o.slice(0,10))===f&&r)return{data:await d(e,{data:o,to:r})};throw O&&(o==null?void 0:o.slice(0,10))==="0x101bb98d"?new L.CounterfactualDeploymentFailedError({factory:b}):oe.getCallError(v,{...t,account:E,chain:e.chain})}}function de({request:e}){const{data:t,to:a,...s}=e;return!(!t||t.startsWith(ee.aggregate3Signature)||!a||Object.values(s).filter(i=>typeof i<"u").length>0)}async function fe(e,t){var w;const{batchSize:a=1024,deployless:s=!1,wait:i=0}=typeof((w=e.batch)==null?void 0:w.multicall)=="object"?e.batch.multicall:{},{blockNumber:l,blockTag:C=e.experimental_blockTag??"latest",data:D,to:k}=t,y=(()=>{if(s)return null;if(t.multicallAddress)return t.multicallAddress;if(e.chain)return re.getChainContractAddress({blockNumber:l,chain:e.chain,contract:"multicall3"});throw new A.ClientChainNotConfiguredError})(),c=(typeof l=="bigint"?G.numberToHex(l):void 0)||C,{schedule:b}=se.createBatchScheduler({id:`${e.uid}.${c}`,wait:i,shouldSplitBatch(p){return p.reduce((h,{data:q})=>h+(q.length-2),0)>a*2},fn:async p=>{const g=p.map(r=>({allowFailure:!0,callData:r.data,target:r.to})),h=ae.encodeFunctionData({abi:j.multicall3Abi,args:[g],functionName:"aggregate3"}),q=await e.request({method:"eth_call",params:[{...y===null?{data:W({code:R.multicall3Bytecode,data:h})}:{to:y,data:h}},c]});return te.decodeFunctionResult({abi:j.multicall3Abi,args:[g],functionName:"aggregate3",data:q||"0x"})}}),[{returnData:u,success:x}]=await b({data:D,to:k});if(!x)throw new L.RawContractError({data:u});return u==="0x"?{data:void 0}:{data:u}}function W(e){const{code:t,data:a}=e;return $.encodeDeployData({abi:M.parseAbi(["constructor(bytes, bytes)"]),bytecode:R.deploylessCallViaBytecodeBytecode,args:[t,a]})}function be(e){const{data:t,factory:a,factoryData:s,to:i}=e;return $.encodeDeployData({abi:M.parseAbi(["constructor(address, bytes, address, bytes)"]),bytecode:R.deploylessCallViaFactoryBytecode,args:[i,t,a,s]})}function I(e){var a;if(!(e instanceof F.BaseError))return;const t=e.walk();return typeof(t==null?void 0:t.data)=="object"?(a=t.data)==null?void 0:a.data:t.data}exports.call=ue;exports.getRevertErrorData=I;
package/dist/index104.js CHANGED
@@ -1,7 +1,7 @@
1
- import { toRpc as Q } from "./index277.js";
1
+ import { toRpc as Q } from "./index273.js";
2
2
  import { parseAccount as U } from "./index123.js";
3
3
  import { multicall3Abi as z } from "./index46.js";
4
- import { aggregate3Signature as X } from "./index278.js";
4
+ import { aggregate3Signature as X } from "./index274.js";
5
5
  import { deploylessCallViaBytecodeBytecode as Y, deploylessCallViaFactoryBytecode as Z, multicall3Bytecode as tt } from "./index93.js";
6
6
  import { BaseError as N } from "./index189.js";
7
7
  import { ClientChainNotConfiguredError as H, ChainDoesNotSupportContract as at } from "./index85.js";
@@ -15,9 +15,9 @@ import { getCallError as st } from "./index269.js";
15
15
  import { extract as it } from "./index271.js";
16
16
  import { formatTransactionRequest as lt } from "./index108.js";
17
17
  import { createBatchScheduler as ut } from "./index181.js";
18
- import { serializeStateOverride as dt } from "./index279.js";
18
+ import { serializeStateOverride as dt } from "./index275.js";
19
19
  import { assertRequest as ft } from "./index261.js";
20
- import { parseAbi as G } from "./index280.js";
20
+ import { parseAbi as G } from "./index276.js";
21
21
  async function zt(t, a) {
22
22
  var q, E, O, P;
23
23
  const { account: e = t.account, authorizationList: s, batch: i = !!((q = t.batch) != null && q.multicall), blockNumber: l, blockTag: C = t.experimental_blockTag ?? "latest", accessList: x, blobs: D, blockOverrides: b, code: h, data: c, factory: m, factoryData: u, gas: B, gasPrice: k, maxFeePerBlobGas: y, maxFeePerGas: g, maxPriorityFeePerGas: p, nonce: w, to: o, value: $, stateOverride: W, ...I } = a, R = e ? U(e) : void 0;
package/dist/index106.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./index349.cjs"),g=require("./index355.cjs"),y=require("./index273.cjs"),t=require("./index272.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;
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
@@ -1,7 +1,7 @@
1
- import { decode as c, from as f } from "./index349.js";
1
+ import { decode as c, from as f } from "./index350.js";
2
2
  import { from as d } from "./index355.js";
3
- import { BaseError as m } from "./index273.js";
4
- import { slice as n, toNumber as l } from "./index272.js";
3
+ import { BaseError as m } from "./index278.js";
4
+ import { slice as n, toNumber as l } from "./index277.js";
5
5
  import { assert as g } from "./index281.js";
6
6
  const h = "0x8010801080108010801080108010801080108010801080108010801080108010", y = f("(uint256 chainId, address delegation, uint256 nonce, uint8 yParity, uint256 r, uint256 s), address to, bytes data");
7
7
  function a(r) {
package/dist/index107.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./index349.cjs"),c=require("./index273.cjs"),n=require("./index272.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;
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,6 +1,6 @@
1
- import { encode as i, from as o } from "./index349.js";
2
- import { BaseError as s } from "./index273.js";
3
- import { concat as u, slice as c } from "./index272.js";
1
+ import { encode as i, from as o } from "./index350.js";
2
+ import { BaseError as s } from "./index278.js";
3
+ import { concat as u, slice as c } from "./index277.js";
4
4
  const t = "0x6492649264926492649264926492649264926492649264926492649264926492";
5
5
  function d(r) {
6
6
  if (c(r, -32) !== t)
package/dist/index116.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index302.cjs");class i{constructor({network:t,base:e,cache:c=(e==null?void 0:e.cache)??new r.ClientCache}){this.network=t,this.base=e??this,this.cache=c}$extend(...t){return Object.create(this,Object.fromEntries(t.map(e=>[e.name,{value:e.register(this)}])))}}exports.Experimental_BaseClient=i;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index283.cjs");class i{constructor({network:t,base:e,cache:c=(e==null?void 0:e.cache)??new r.ClientCache}){this.network=t,this.base=e??this,this.cache=c}$extend(...t){return Object.create(this,Object.fromEntries(t.map(e=>[e.name,{value:e.register(this)}])))}}exports.Experimental_BaseClient=i;
package/dist/index116.js CHANGED
@@ -1,4 +1,4 @@
1
- import { ClientCache as c } from "./index302.js";
1
+ import { ClientCache as c } from "./index283.js";
2
2
  class h {
3
3
  constructor({
4
4
  network: e,
package/dist/index117.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("./index113.cjs"),S=require("./index316.cjs"),m=require("./index119.cjs"),T=32;function h(e){try{return g.fromBase58(e).length===T}catch{return!1}}const c=32;function d(e){return O(e)&&A(e)===c}function b(e){return d(e)}function x(e){return e.includes("::")?o(e):e}function o(e){const[n,r]=e.split("::"),i=m.isValidNamedPackage(n),t=e.slice(n.length+r.length+4),a=t.includes("<")?t.slice(0,t.indexOf("<")):t,s=t.includes("<")?S.splitGenericParameters(t.slice(t.indexOf("<")+1,t.lastIndexOf(">"))).map(f=>x(f.trim())):[];return{address:i?n:u(n),module:r,name:a,typeParams:s}}function l(e){const{address:n,module:r,name:i,typeParams:t}=typeof e=="string"?o(e):e,a=(t==null?void 0:t.length)>0?`<${t.map(s=>typeof s=="string"?s:l(s)).join(",")}>`:"";return`${n}::${r}::${i}${a}`}function u(e,n=!1){let r=e.toLowerCase();return!n&&r.startsWith("0x")&&(r=r.slice(2)),`0x${r.padStart(c*2,"0")}`}function I(e,n=!1){return u(e,n)}function O(e){return/^(0x|0X)?[a-fA-F0-9]+$/.test(e)&&e.length%2===0}function A(e){return/^(0x|0X)/.test(e)?(e.length-2)/2:e.length/2}exports.SUI_ADDRESS_LENGTH=c;exports.isValidSuiAddress=d;exports.isValidSuiObjectId=b;exports.isValidTransactionDigest=h;exports.normalizeStructTag=l;exports.normalizeSuiAddress=u;exports.normalizeSuiObjectId=I;exports.parseStructTag=o;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("./index113.cjs"),S=require("./index297.cjs"),m=require("./index119.cjs"),T=32;function h(e){try{return g.fromBase58(e).length===T}catch{return!1}}const c=32;function d(e){return O(e)&&A(e)===c}function b(e){return d(e)}function x(e){return e.includes("::")?o(e):e}function o(e){const[n,r]=e.split("::"),i=m.isValidNamedPackage(n),t=e.slice(n.length+r.length+4),a=t.includes("<")?t.slice(0,t.indexOf("<")):t,s=t.includes("<")?S.splitGenericParameters(t.slice(t.indexOf("<")+1,t.lastIndexOf(">"))).map(f=>x(f.trim())):[];return{address:i?n:u(n),module:r,name:a,typeParams:s}}function l(e){const{address:n,module:r,name:i,typeParams:t}=typeof e=="string"?o(e):e,a=(t==null?void 0:t.length)>0?`<${t.map(s=>typeof s=="string"?s:l(s)).join(",")}>`:"";return`${n}::${r}::${i}${a}`}function u(e,n=!1){let r=e.toLowerCase();return!n&&r.startsWith("0x")&&(r=r.slice(2)),`0x${r.padStart(c*2,"0")}`}function I(e,n=!1){return u(e,n)}function O(e){return/^(0x|0X)?[a-fA-F0-9]+$/.test(e)&&e.length%2===0}function A(e){return/^(0x|0X)/.test(e)?(e.length-2)/2:e.length/2}exports.SUI_ADDRESS_LENGTH=c;exports.isValidSuiAddress=d;exports.isValidSuiObjectId=b;exports.isValidTransactionDigest=h;exports.normalizeStructTag=l;exports.normalizeSuiAddress=u;exports.normalizeSuiObjectId=I;exports.parseStructTag=o;
package/dist/index117.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { fromBase58 as d } from "./index113.js";
2
- import { splitGenericParameters as l } from "./index316.js";
2
+ import { splitGenericParameters as l } from "./index297.js";
3
3
  import { isValidNamedPackage as m } from "./index119.js";
4
4
  const g = 32;
5
5
  function b(t) {
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.hyperliquid.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;
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 { hyperliquid as n } from "@gardenfi/core";
2
- import { SwapHorizontalIcon as r, BlogIcon as e } from "@gardenfi/garden-book";
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 t } from "@gardenfi/utils";
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: (i, o) => `Minimum amount is ${i} ${o}`,
9
- maxError: (i, o) => `Maximum amount is ${i} ${o}`,
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__ */ ((i) => (i.input = "input", i.output = "output", i))(E || {});
18
+ var E = /* @__PURE__ */ ((t) => (t.input = "input", t.output = "output", t))(E || {});
19
19
  const d = {
20
- [t.MAINNET]: {
20
+ [i.MAINNET]: {
21
21
  api: "https://api.garden.finance",
22
22
  explorer: "https://explorer.garden.finance"
23
23
  },
24
- [t.TESTNET]: {
24
+ [i.TESTNET]: {
25
25
  api: "https://testnet.api.garden.finance",
26
26
  explorer: "https://testnet-explorer.garden.finance"
27
27
  },
28
- [t.LOCALNET]: {
28
+ [i.LOCALNET]: {
29
29
  api: "",
30
30
  explorer: ""
31
31
  }
32
- }, A = t.TESTNET, N = (i) => d[i], b = (i) => a(i.chain) || s(i.chain) || m(i.chain) || p(i.chain) ? "~30s" : c(i.chain) ? "~10m" : "", L = {
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: r
37
+ Icon: e
38
38
  },
39
39
  history: {
40
40
  id: "history",
41
41
  label: "History",
42
42
  index: 1,
43
- Icon: e
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 D=require("./index317.cjs"),L=require("./index318.cjs"),$=require("./index119.cjs"),h=require("./index117.cjs"),F=require("./index110.cjs");var O=t=>{throw TypeError(t)},V=(t,a,e)=>a.has(t)||O("Cannot "+e),i=(t,a,e)=>(V(t,a,"read from private field"),e?e.call(t):a.get(t)),m=(t,a,e)=>a.has(t)?O("Cannot add the same private member more than once"):a instanceof WeakSet?a.add(t):a.set(t,e),M=(t,a,e,s)=>(V(t,a,"write to private field"),a.set(t,e),e),_=(t,a,e)=>(V(t,a,"access private method"),e),w,u,v,y,f,E,S,b,W,A;const x="/",z={"Mvr-Source":`@mysten/sui@${F.PACKAGE_VERSION}`};class U{constructor({cache:a,url:e,pageSize:s=50,overrides:n}){m(this,f),m(this,w),m(this,u),m(this,v),m(this,y),M(this,w,a),M(this,u,e),M(this,v,s),M(this,y,{packages:n==null?void 0:n.packages,types:n==null?void 0:n.types}),G(i(this,y))}async resolvePackage({package:a}){return p(a)?{package:await i(this,f,E).load(a)}:{package:a}}async resolveType({type:a}){if(!p(a))return{type:a};const e=[...T(a)],s=await i(this,f,S).loadMany(e),n={};for(let r=0;r<e.length;r++){const o=s[r];if(o instanceof Error)throw o;n[e[r]]=o}return{type:P(a,n)}}async resolve({types:a=[],packages:e=[]}){var R,C,I;const s=new Set;for(const d of a??[])T(d,s);const n=[...s],[r,o]=await Promise.all([n.length>0?i(this,f,S).loadMany(n):[],e.length>0?i(this,f,E).loadMany(e):[]]),c={...(R=i(this,y))==null?void 0:R.types};for(const[d,k]of n.entries()){const g=r[d];if(g instanceof Error)throw g;c[k]=g}const l={};for(const d of a??[]){const k=P(d,c);l[d]={type:k}}const N={};for(const[d,k]of(e??[]).entries()){const g=((I=(C=i(this,y))==null?void 0:C.packages)==null?void 0:I[k])??o[d];if(g instanceof Error)throw g;N[k]={package:g}}return{types:l,packages:N}}}w=new WeakMap;u=new WeakMap;v=new WeakMap;y=new WeakMap;f=new WeakSet;E=function(){return i(this,w).readSync(["#mvrPackageDataLoader",i(this,u)??""],()=>{var e;const t=new L.DataLoader(async s=>{if(!i(this,u))throw new Error(`MVR Api URL is not set for the current client (resolving ${s.join(", ")})`);const n=await _(this,f,b).call(this,s);return s.map(r=>n[r]??new Error(`Failed to resolve package: ${r}`))}),a=(e=i(this,y))==null?void 0:e.packages;if(a)for(const[s,n]of Object.entries(a))t.prime(s,n);return t})};S=function(){return i(this,w).readSync(["#mvrTypeDataLoader",i(this,u)??""],()=>{var e;const t=new L.DataLoader(async s=>{if(!i(this,u))throw new Error(`MVR Api URL is not set for the current client (resolving ${s.join(", ")})`);const n=await _(this,f,W).call(this,s);return s.map(r=>n[r]??new Error(`Failed to resolve type: ${r}`))}),a=(e=i(this,y))==null?void 0:e.types;if(a)for(const[s,n]of Object.entries(a))t.prime(s,n);return t})};b=async function(t){if(t.length===0)return{};const a=D.chunk(t,i(this,v)),e={};return await Promise.all(a.map(async s=>{var r;const n=await _(this,f,A).call(this,"/v1/resolution/bulk",{names:s});if(n!=null&&n.resolution)for(const o of Object.keys(n==null?void 0:n.resolution)){const c=(r=n.resolution[o])==null?void 0:r.package_id;c&&(e[o]=c)}})),e};W=async function(t){if(t.length===0)return{};const a=D.chunk(t,i(this,v)),e={};return await Promise.all(a.map(async s=>{var r;const n=await _(this,f,A).call(this,"/v1/struct-definition/bulk",{types:s});if(n!=null&&n.resolution)for(const o of Object.keys(n==null?void 0:n.resolution)){const c=(r=n.resolution[o])==null?void 0:r.type_tag;c&&(e[o]=c)}})),e};A=async function(t,a){if(!i(this,u))throw new Error("MVR Api URL is not set for the current client");const e=await fetch(`${i(this,u)}${t}`,{method:"POST",headers:{"Content-Type":"application/json",...z},body:JSON.stringify(a)});if(!e.ok){const s=await e.json().catch(()=>({}));throw new Error(`Failed to resolve types: ${s==null?void 0:s.message}`)}return e.json()};function G(t){if(t!=null&&t.packages)for(const[a,e]of Object.entries(t.packages)){if(!$.isValidNamedPackage(a))throw new Error(`Invalid package name: ${a}`);if(!h.isValidSuiAddress(h.normalizeSuiAddress(e)))throw new Error(`Invalid package ID: ${e}`)}if(t!=null&&t.types)for(const[a,e]of Object.entries(t.types)){if(h.parseStructTag(a).typeParams.length>0)throw new Error("Type overrides must be first-level only. If you want to supply generic types, just pass each type individually.");const s=h.parseStructTag(e);if(!h.isValidSuiAddress(s.address))throw new Error(`Invalid type: ${e}`)}}function T(t,a=new Set){if(typeof t=="string"&&!p(t))return a;const e=q(t)?t:h.parseStructTag(t);p(e.address)&&a.add(`${e.address}::${e.module}::${e.name}`);for(const s of e.typeParams)T(s,a);return a}function P(t,a){const e=q(t)?t:h.parseStructTag(t),s=`${e.address}::${e.module}::${e.name}`,n=a[s];return h.normalizeStructTag({...e,address:n?n.split("::")[0]:e.address,typeParams:e.typeParams.map(r=>P(r,a))})}function p(t){return t.includes(x)||t.includes("@")||t.includes(".sui")}function q(t){return typeof t=="object"&&"address"in t&&"module"in t&&"name"in t&&"typeParams"in t}function H(t){const a=new Set,e=new Set;for(const s of t.commands)switch(s.$kind){case"MakeMoveVec":s.MakeMoveVec.type&&j([s.MakeMoveVec.type]).forEach(o=>{e.add(o)});break;case"MoveCall":const n=s.MoveCall,r=n.package.split("::")[0];if(p(r)){if(!$.isValidNamedPackage(r))throw new Error(`Invalid package name: ${r}`);a.add(r)}j(n.typeArguments??[]).forEach(o=>{e.add(o)});break}return{packages:[...a],types:[...e]}}function J(t,a){var e;for(const s of t.commands){if((e=s.MakeMoveVec)!=null&&e.type){if(!p(s.MakeMoveVec.type))continue;if(!a.types[s.MakeMoveVec.type])throw new Error(`No resolution found for type: ${s.MakeMoveVec.type}`);s.MakeMoveVec.type=a.types[s.MakeMoveVec.type].type}const n=s.MoveCall;if(!n)continue;const r=n.package.split("::"),o=r[0];if(p(o)&&!a.packages[o])throw new Error(`No address found for package: ${o}`);p(o)&&(r[0]=a.packages[o].package,n.package=r.join("::"));const c=n.typeArguments;if(c){for(let l=0;l<c.length;l++)if(p(c[l])){if(!a.types[c[l]])throw new Error(`No resolution found for type: ${c[l]}`);c[l]=a.types[c[l]].type}n.typeArguments=c}}}function j(t){const a=new Set;for(const e of t)if(p(e)){if(!$.isValidNamedType(e))throw new Error(`Invalid type with names: ${e}`);a.add(e)}return a}exports.MvrClient=U;exports.extractMvrTypes=T;exports.findNamesInTransaction=H;exports.hasMvrName=p;exports.replaceNames=J;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const D=require("./index298.cjs"),L=require("./index299.cjs"),$=require("./index119.cjs"),h=require("./index117.cjs"),F=require("./index110.cjs");var O=t=>{throw TypeError(t)},V=(t,a,e)=>a.has(t)||O("Cannot "+e),i=(t,a,e)=>(V(t,a,"read from private field"),e?e.call(t):a.get(t)),m=(t,a,e)=>a.has(t)?O("Cannot add the same private member more than once"):a instanceof WeakSet?a.add(t):a.set(t,e),M=(t,a,e,s)=>(V(t,a,"write to private field"),a.set(t,e),e),_=(t,a,e)=>(V(t,a,"access private method"),e),w,u,v,y,f,E,S,b,W,A;const x="/",z={"Mvr-Source":`@mysten/sui@${F.PACKAGE_VERSION}`};class U{constructor({cache:a,url:e,pageSize:s=50,overrides:n}){m(this,f),m(this,w),m(this,u),m(this,v),m(this,y),M(this,w,a),M(this,u,e),M(this,v,s),M(this,y,{packages:n==null?void 0:n.packages,types:n==null?void 0:n.types}),G(i(this,y))}async resolvePackage({package:a}){return p(a)?{package:await i(this,f,E).load(a)}:{package:a}}async resolveType({type:a}){if(!p(a))return{type:a};const e=[...T(a)],s=await i(this,f,S).loadMany(e),n={};for(let r=0;r<e.length;r++){const o=s[r];if(o instanceof Error)throw o;n[e[r]]=o}return{type:P(a,n)}}async resolve({types:a=[],packages:e=[]}){var R,C,I;const s=new Set;for(const d of a??[])T(d,s);const n=[...s],[r,o]=await Promise.all([n.length>0?i(this,f,S).loadMany(n):[],e.length>0?i(this,f,E).loadMany(e):[]]),c={...(R=i(this,y))==null?void 0:R.types};for(const[d,k]of n.entries()){const g=r[d];if(g instanceof Error)throw g;c[k]=g}const l={};for(const d of a??[]){const k=P(d,c);l[d]={type:k}}const N={};for(const[d,k]of(e??[]).entries()){const g=((I=(C=i(this,y))==null?void 0:C.packages)==null?void 0:I[k])??o[d];if(g instanceof Error)throw g;N[k]={package:g}}return{types:l,packages:N}}}w=new WeakMap;u=new WeakMap;v=new WeakMap;y=new WeakMap;f=new WeakSet;E=function(){return i(this,w).readSync(["#mvrPackageDataLoader",i(this,u)??""],()=>{var e;const t=new L.DataLoader(async s=>{if(!i(this,u))throw new Error(`MVR Api URL is not set for the current client (resolving ${s.join(", ")})`);const n=await _(this,f,b).call(this,s);return s.map(r=>n[r]??new Error(`Failed to resolve package: ${r}`))}),a=(e=i(this,y))==null?void 0:e.packages;if(a)for(const[s,n]of Object.entries(a))t.prime(s,n);return t})};S=function(){return i(this,w).readSync(["#mvrTypeDataLoader",i(this,u)??""],()=>{var e;const t=new L.DataLoader(async s=>{if(!i(this,u))throw new Error(`MVR Api URL is not set for the current client (resolving ${s.join(", ")})`);const n=await _(this,f,W).call(this,s);return s.map(r=>n[r]??new Error(`Failed to resolve type: ${r}`))}),a=(e=i(this,y))==null?void 0:e.types;if(a)for(const[s,n]of Object.entries(a))t.prime(s,n);return t})};b=async function(t){if(t.length===0)return{};const a=D.chunk(t,i(this,v)),e={};return await Promise.all(a.map(async s=>{var r;const n=await _(this,f,A).call(this,"/v1/resolution/bulk",{names:s});if(n!=null&&n.resolution)for(const o of Object.keys(n==null?void 0:n.resolution)){const c=(r=n.resolution[o])==null?void 0:r.package_id;c&&(e[o]=c)}})),e};W=async function(t){if(t.length===0)return{};const a=D.chunk(t,i(this,v)),e={};return await Promise.all(a.map(async s=>{var r;const n=await _(this,f,A).call(this,"/v1/struct-definition/bulk",{types:s});if(n!=null&&n.resolution)for(const o of Object.keys(n==null?void 0:n.resolution)){const c=(r=n.resolution[o])==null?void 0:r.type_tag;c&&(e[o]=c)}})),e};A=async function(t,a){if(!i(this,u))throw new Error("MVR Api URL is not set for the current client");const e=await fetch(`${i(this,u)}${t}`,{method:"POST",headers:{"Content-Type":"application/json",...z},body:JSON.stringify(a)});if(!e.ok){const s=await e.json().catch(()=>({}));throw new Error(`Failed to resolve types: ${s==null?void 0:s.message}`)}return e.json()};function G(t){if(t!=null&&t.packages)for(const[a,e]of Object.entries(t.packages)){if(!$.isValidNamedPackage(a))throw new Error(`Invalid package name: ${a}`);if(!h.isValidSuiAddress(h.normalizeSuiAddress(e)))throw new Error(`Invalid package ID: ${e}`)}if(t!=null&&t.types)for(const[a,e]of Object.entries(t.types)){if(h.parseStructTag(a).typeParams.length>0)throw new Error("Type overrides must be first-level only. If you want to supply generic types, just pass each type individually.");const s=h.parseStructTag(e);if(!h.isValidSuiAddress(s.address))throw new Error(`Invalid type: ${e}`)}}function T(t,a=new Set){if(typeof t=="string"&&!p(t))return a;const e=q(t)?t:h.parseStructTag(t);p(e.address)&&a.add(`${e.address}::${e.module}::${e.name}`);for(const s of e.typeParams)T(s,a);return a}function P(t,a){const e=q(t)?t:h.parseStructTag(t),s=`${e.address}::${e.module}::${e.name}`,n=a[s];return h.normalizeStructTag({...e,address:n?n.split("::")[0]:e.address,typeParams:e.typeParams.map(r=>P(r,a))})}function p(t){return t.includes(x)||t.includes("@")||t.includes(".sui")}function q(t){return typeof t=="object"&&"address"in t&&"module"in t&&"name"in t&&"typeParams"in t}function H(t){const a=new Set,e=new Set;for(const s of t.commands)switch(s.$kind){case"MakeMoveVec":s.MakeMoveVec.type&&j([s.MakeMoveVec.type]).forEach(o=>{e.add(o)});break;case"MoveCall":const n=s.MoveCall,r=n.package.split("::")[0];if(p(r)){if(!$.isValidNamedPackage(r))throw new Error(`Invalid package name: ${r}`);a.add(r)}j(n.typeArguments??[]).forEach(o=>{e.add(o)});break}return{packages:[...a],types:[...e]}}function J(t,a){var e;for(const s of t.commands){if((e=s.MakeMoveVec)!=null&&e.type){if(!p(s.MakeMoveVec.type))continue;if(!a.types[s.MakeMoveVec.type])throw new Error(`No resolution found for type: ${s.MakeMoveVec.type}`);s.MakeMoveVec.type=a.types[s.MakeMoveVec.type].type}const n=s.MoveCall;if(!n)continue;const r=n.package.split("::"),o=r[0];if(p(o)&&!a.packages[o])throw new Error(`No address found for package: ${o}`);p(o)&&(r[0]=a.packages[o].package,n.package=r.join("::"));const c=n.typeArguments;if(c){for(let l=0;l<c.length;l++)if(p(c[l])){if(!a.types[c[l]])throw new Error(`No resolution found for type: ${c[l]}`);c[l]=a.types[c[l]].type}n.typeArguments=c}}}function j(t){const a=new Set;for(const e of t)if(p(e)){if(!$.isValidNamedType(e))throw new Error(`Invalid type with names: ${e}`);a.add(e)}return a}exports.MvrClient=U;exports.extractMvrTypes=T;exports.findNamesInTransaction=H;exports.hasMvrName=p;exports.replaceNames=J;
package/dist/index120.js CHANGED
@@ -1,5 +1,5 @@
1
- import { chunk as D } from "./index317.js";
2
- import { DataLoader as L } from "./index318.js";
1
+ import { chunk as D } from "./index298.js";
2
+ import { DataLoader as L } from "./index299.js";
3
3
  import { isValidNamedPackage as O, isValidNamedType as z } from "./index119.js";
4
4
  import { isValidSuiAddress as I, normalizeSuiAddress as U, parseStructTag as M, normalizeStructTag as G } from "./index117.js";
5
5
  import { PACKAGE_VERSION as H } from "./index110.js";
package/dist/index121.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("./index114.cjs"),x=require("./index317.cjs"),p=require("./index319.cjs"),I=require("./index77.cjs"),P=require("./index320.cjs"),E=require("./index313.cjs"),k=require("./index117.cjs"),N=require("./index321.cjs"),f=require("./index322.cjs"),h=require("./index323.cjs");var S=t=>{throw TypeError(t)},C=(t,e,r)=>e.has(t)||S("Cannot "+r),i=(t,e,r)=>(C(t,e,"read from private field"),r?r.call(t):e.get(t)),A=(t,e,r)=>e.has(t)?S("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,r),B=(t,e,r,n)=>(C(t,e,"write to private field"),e.set(t,r),r),a;class $ extends N.Experimental_CoreClient{constructor({jsonRpcClient:e,mvr:r}){super({network:e.network,base:e,mvr:r}),A(this,a),B(this,a,e)}async getObjects(e){const r=x.chunk(e.objectIds,50),n=[];for(const d of r){const u=await i(this,a).multiGetObjects({ids:d,options:{showOwner:!0,showType:!0,showBcs:!0,showPreviousTransaction:!0},signal:e.signal});for(const[o,s]of u.entries())s.error?n.push(f.ObjectError.fromResponse(s.error,d[o])):n.push(v(s.data))}return{objects:n}}async getOwnedObjects(e){const r=await i(this,a).getOwnedObjects({owner:e.address,limit:e.limit,cursor:e.cursor,options:{showOwner:!0,showType:!0,showBcs:!0,showPreviousTransaction:!0},filter:e.type?{StructType:e.type}:null,signal:e.signal});return{objects:r.data.map(n=>{if(n.error)throw f.ObjectError.fromResponse(n.error);return v(n.data)}),hasNextPage:r.hasNextPage,cursor:r.nextCursor??null}}async getCoins(e){const r=await i(this,a).getCoins({owner:e.address,coinType:e.coinType,limit:e.limit,cursor:e.cursor,signal:e.signal});return{objects:r.data.map(n=>({id:n.coinObjectId,version:n.version,digest:n.digest,balance:n.balance,type:`0x2::coin::Coin<${n.coinType}>`,content:Promise.resolve(_.serialize({id:n.coinObjectId,balance:{value:n.balance}}).toBytes()),owner:{$kind:"ObjectOwner",ObjectOwner:e.address},previousTransaction:n.previousTransaction})),hasNextPage:r.hasNextPage,cursor:r.nextCursor??null}}async getBalance(e){const r=await i(this,a).getBalance({owner:e.address,coinType:e.coinType,signal:e.signal});return{balance:{coinType:r.coinType,balance:r.totalBalance}}}async getAllBalances(e){return{balances:(await i(this,a).getAllBalances({owner:e.address,signal:e.signal})).map(n=>({coinType:n.coinType,balance:n.totalBalance})),hasNextPage:!1,cursor:null}}async getTransaction(e){const r=await i(this,a).getTransactionBlock({digest:e.digest,options:{showRawInput:!0,showObjectChanges:!0,showRawEffects:!0,showEvents:!0,showEffects:!0,showBalanceChanges:!0},signal:e.signal});return{transaction:T(r)}}async executeTransaction(e){const r=await i(this,a).executeTransactionBlock({transactionBlock:e.transaction,signature:e.signatures,options:{showRawEffects:!0,showEvents:!0,showObjectChanges:!0,showRawInput:!0,showEffects:!0,showBalanceChanges:!0},signal:e.signal});return{transaction:T(r)}}async dryRunTransaction(e){const r=I.Transaction.from(e.transaction),n=await i(this,a).dryRunTransactionBlock({transactionBlock:e.transaction,signal:e.signal}),{effects:d,objectTypes:u}=V({effects:n.effects,objectChanges:n.objectChanges});return{transaction:{digest:await r.getDigest(),epoch:null,effects:d,objectTypes:Promise.resolve(u),signatures:[],transaction:h.parseTransactionBcs(e.transaction),balanceChanges:n.balanceChanges.map(o=>({coinType:o.coinType,address:D(o.owner),amount:o.amount}))}}}async getReferenceGasPrice(e){const r=await i(this,a).getReferenceGasPrice({signal:e==null?void 0:e.signal});return{referenceGasPrice:String(r)}}async getDynamicFields(e){const r=await i(this,a).getDynamicFields({parentId:e.parentId,limit:e.limit,cursor:e.cursor});return{dynamicFields:r.data.map(n=>({id:n.objectId,type:n.objectType,name:{type:n.name.type,bcs:g.fromBase64(n.bcsName)}})),hasNextPage:r.hasNextPage,cursor:r.nextCursor}}async verifyZkLoginSignature(e){const r=await i(this,a).verifyZkLoginSignature({bytes:e.bytes,signature:e.signature,intentScope:e.intentScope,author:e.author});return{success:r.success,errors:r.errors}}async defaultNameServiceName(e){return{data:{name:(await i(this,a).resolveNameServiceNames(e)).data[0]}}}resolveTransactionPlugin(){return P.jsonRpcClientResolveTransactionPlugin(i(this,a))}async getMoveFunction(e){const r=await i(this,a).getNormalizedMoveFunction({package:(await this.mvr.resolvePackage({package:e.packageId})).package,module:e.moduleName,function:e.name});return{function:{packageId:k.normalizeSuiAddress(e.packageId),moduleName:e.moduleName,name:e.name,visibility:U(r.visibility),isEntry:r.isEntry,typeParameters:r.typeParameters.map(n=>({isPhantom:!1,constraints:M(n)})),parameters:r.parameters.map(n=>j(n)),returns:r.return.map(n=>j(n))}}}}a=new WeakMap;function v(t){var e;return{id:t.objectId,version:t.version,digest:t.digest,type:t.type,content:Promise.resolve(((e=t.bcs)==null?void 0:e.dataType)==="moveObject"?g.fromBase64(t.bcs.bcsBytes):new Uint8Array),owner:l(t.owner),previousTransaction:t.previousTransaction??null}}function l(t){if(t==="Immutable")return{$kind:"Immutable",Immutable:!0};if("ConsensusAddressOwner"in t)return{$kind:"ConsensusAddressOwner",ConsensusAddressOwner:{owner:t.ConsensusAddressOwner.owner,startVersion:t.ConsensusAddressOwner.start_version}};if("AddressOwner"in t)return{$kind:"AddressOwner",AddressOwner:t.AddressOwner};if("ObjectOwner"in t)return{$kind:"ObjectOwner",ObjectOwner:t.ObjectOwner};if("Shared"in t)return{$kind:"Shared",Shared:{initialSharedVersion:t.Shared.initial_shared_version}};throw new Error(`Unknown owner type: ${JSON.stringify(t)}`)}function D(t){if(t==="Immutable")return null;if("ConsensusAddressOwner"in t)return t.ConsensusAddressOwner.owner;if("AddressOwner"in t)return t.AddressOwner;if("ObjectOwner"in t)return t.ObjectOwner;if("Shared"in t)return null;throw new Error(`Unknown owner type: ${JSON.stringify(t)}`)}function T(t){var u,o,s;const e=p.bcs.SenderSignedData.parse(g.fromBase64(t.rawTransaction))[0],r={};(u=t.objectChanges)==null||u.forEach(c=>{c.type!=="published"&&(r[c.objectId]=c.objectType)});const n=p.bcs.TransactionData.serialize(e.intentMessage.value).toBytes(),d=E.TransactionDataBuilder.restore({version:2,sender:e.intentMessage.value.V1.sender,expiration:e.intentMessage.value.V1.expiration,gasData:e.intentMessage.value.V1.gasData,inputs:e.intentMessage.value.V1.kind.ProgrammableTransaction.inputs,commands:e.intentMessage.value.V1.kind.ProgrammableTransaction.commands});return{digest:t.digest,epoch:((o=t.effects)==null?void 0:o.executedEpoch)??null,effects:h.parseTransactionEffectsBcs(new Uint8Array(t.rawEffects)),objectTypes:Promise.resolve(r),transaction:{...d,bcs:n},signatures:e.txSignatures,balanceChanges:((s=t.balanceChanges)==null?void 0:s.map(c=>({coinType:c.coinType,address:D(c.owner),amount:c.amount})))??[]}}function V({bytes:t,effects:e,objectChanges:r}){var o;const n=[],d=[],u={};return r==null||r.forEach(s=>{var c,O,m,y;switch(s.type){case"published":n.push({id:s.packageId,inputState:"DoesNotExist",inputVersion:null,inputDigest:null,inputOwner:null,outputState:"PackageWrite",outputVersion:s.version,outputDigest:s.digest,outputOwner:null,idOperation:"Created"});break;case"transferred":n.push({id:s.objectId,inputState:"Exists",inputVersion:s.version,inputDigest:s.digest,inputOwner:{$kind:"AddressOwner",AddressOwner:s.sender},outputState:"ObjectWrite",outputVersion:s.version,outputDigest:s.digest,outputOwner:l(s.recipient),idOperation:"None"}),u[s.objectId]=s.objectType;break;case"mutated":n.push({id:s.objectId,inputState:"Exists",inputVersion:s.previousVersion,inputDigest:null,inputOwner:l(s.owner),outputState:"ObjectWrite",outputVersion:s.version,outputDigest:s.digest,outputOwner:l(s.owner),idOperation:"None"}),u[s.objectId]=s.objectType;break;case"deleted":n.push({id:s.objectId,inputState:"Exists",inputVersion:s.version,inputDigest:((O=(c=e.deleted)==null?void 0:c.find(w=>w.objectId===s.objectId))==null?void 0:O.digest)??null,inputOwner:null,outputState:"DoesNotExist",outputVersion:null,outputDigest:null,outputOwner:null,idOperation:"Deleted"}),u[s.objectId]=s.objectType;break;case"wrapped":n.push({id:s.objectId,inputState:"Exists",inputVersion:s.version,inputDigest:null,inputOwner:{$kind:"AddressOwner",AddressOwner:s.sender},outputState:"ObjectWrite",outputVersion:s.version,outputDigest:((y=(m=e.wrapped)==null?void 0:m.find(w=>w.objectId===s.objectId))==null?void 0:y.digest)??null,outputOwner:{$kind:"ObjectOwner",ObjectOwner:s.sender},idOperation:"None"}),u[s.objectId]=s.objectType;break;case"created":n.push({id:s.objectId,inputState:"DoesNotExist",inputVersion:null,inputDigest:null,inputOwner:null,outputState:"ObjectWrite",outputVersion:s.version,outputDigest:s.digest,outputOwner:l(s.owner),idOperation:"Created"}),u[s.objectId]=s.objectType;break}}),{objectTypes:u,effects:{bcs:t??null,digest:e.transactionDigest,version:2,status:e.status.status==="success"?{success:!0,error:null}:{success:!1,error:e.status.error},gasUsed:e.gasUsed,transactionDigest:e.transactionDigest,gasObject:{id:(o=e.gasObject)==null?void 0:o.reference.objectId,inputState:"Exists",inputVersion:null,inputDigest:null,inputOwner:null,outputState:"ObjectWrite",outputVersion:e.gasObject.reference.version,outputDigest:e.gasObject.reference.digest,outputOwner:l(e.gasObject.owner),idOperation:"None"},eventsDigest:e.eventsDigest??null,dependencies:e.dependencies??[],lamportVersion:e.gasObject.reference.version,changedObjects:n,unchangedConsensusObjects:d,auxiliaryDataDigest:null}}}const R=p.bcs.struct("Balance",{value:p.bcs.u64()}),_=p.bcs.struct("Coin",{id:p.bcs.Address,balance:R});function j(t){if(typeof t!="string"){if("Reference"in t)return{reference:"immutable",body:b(t.Reference)};if("MutableReference"in t)return{reference:"mutable",body:b(t.MutableReference)}}return{reference:null,body:b(t)}}function b(t){switch(t){case"Address":return{$kind:"address"};case"Bool":return{$kind:"bool"};case"U8":return{$kind:"u8"};case"U16":return{$kind:"u16"};case"U32":return{$kind:"u32"};case"U64":return{$kind:"u64"};case"U128":return{$kind:"u128"};case"U256":return{$kind:"u256"}}if(typeof t=="string")throw new Error(`Unknown type: ${t}`);if("Vector"in t)return{$kind:"vector",vector:b(t.Vector)};if("Struct"in t)return{$kind:"datatype",datatype:{typeName:`${k.normalizeSuiAddress(t.Struct.address)}::${t.Struct.module}::${t.Struct.name}`,typeParameters:t.Struct.typeArguments.map(e=>b(e))}};if("TypeParameter"in t)return{$kind:"typeParameter",index:t.TypeParameter};throw new Error(`Unknown type: ${JSON.stringify(t)}`)}function M(t){return t.abilities.map(e=>{switch(e){case"Copy":return"copy";case"Drop":return"drop";case"Store":return"store";case"Key":return"key";default:return"unknown"}})}function U(t){switch(t){case"Public":return"public";case"Private":return"private";case"Friend":return"friend";default:return"unknown"}}exports.JSONRpcCoreClient=$;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("./index114.cjs"),x=require("./index298.cjs"),p=require("./index300.cjs"),I=require("./index77.cjs"),P=require("./index301.cjs"),E=require("./index294.cjs"),k=require("./index117.cjs"),N=require("./index302.cjs"),f=require("./index303.cjs"),h=require("./index304.cjs");var S=t=>{throw TypeError(t)},C=(t,e,r)=>e.has(t)||S("Cannot "+r),i=(t,e,r)=>(C(t,e,"read from private field"),r?r.call(t):e.get(t)),A=(t,e,r)=>e.has(t)?S("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,r),B=(t,e,r,n)=>(C(t,e,"write to private field"),e.set(t,r),r),a;class $ extends N.Experimental_CoreClient{constructor({jsonRpcClient:e,mvr:r}){super({network:e.network,base:e,mvr:r}),A(this,a),B(this,a,e)}async getObjects(e){const r=x.chunk(e.objectIds,50),n=[];for(const d of r){const u=await i(this,a).multiGetObjects({ids:d,options:{showOwner:!0,showType:!0,showBcs:!0,showPreviousTransaction:!0},signal:e.signal});for(const[o,s]of u.entries())s.error?n.push(f.ObjectError.fromResponse(s.error,d[o])):n.push(v(s.data))}return{objects:n}}async getOwnedObjects(e){const r=await i(this,a).getOwnedObjects({owner:e.address,limit:e.limit,cursor:e.cursor,options:{showOwner:!0,showType:!0,showBcs:!0,showPreviousTransaction:!0},filter:e.type?{StructType:e.type}:null,signal:e.signal});return{objects:r.data.map(n=>{if(n.error)throw f.ObjectError.fromResponse(n.error);return v(n.data)}),hasNextPage:r.hasNextPage,cursor:r.nextCursor??null}}async getCoins(e){const r=await i(this,a).getCoins({owner:e.address,coinType:e.coinType,limit:e.limit,cursor:e.cursor,signal:e.signal});return{objects:r.data.map(n=>({id:n.coinObjectId,version:n.version,digest:n.digest,balance:n.balance,type:`0x2::coin::Coin<${n.coinType}>`,content:Promise.resolve(_.serialize({id:n.coinObjectId,balance:{value:n.balance}}).toBytes()),owner:{$kind:"ObjectOwner",ObjectOwner:e.address},previousTransaction:n.previousTransaction})),hasNextPage:r.hasNextPage,cursor:r.nextCursor??null}}async getBalance(e){const r=await i(this,a).getBalance({owner:e.address,coinType:e.coinType,signal:e.signal});return{balance:{coinType:r.coinType,balance:r.totalBalance}}}async getAllBalances(e){return{balances:(await i(this,a).getAllBalances({owner:e.address,signal:e.signal})).map(n=>({coinType:n.coinType,balance:n.totalBalance})),hasNextPage:!1,cursor:null}}async getTransaction(e){const r=await i(this,a).getTransactionBlock({digest:e.digest,options:{showRawInput:!0,showObjectChanges:!0,showRawEffects:!0,showEvents:!0,showEffects:!0,showBalanceChanges:!0},signal:e.signal});return{transaction:T(r)}}async executeTransaction(e){const r=await i(this,a).executeTransactionBlock({transactionBlock:e.transaction,signature:e.signatures,options:{showRawEffects:!0,showEvents:!0,showObjectChanges:!0,showRawInput:!0,showEffects:!0,showBalanceChanges:!0},signal:e.signal});return{transaction:T(r)}}async dryRunTransaction(e){const r=I.Transaction.from(e.transaction),n=await i(this,a).dryRunTransactionBlock({transactionBlock:e.transaction,signal:e.signal}),{effects:d,objectTypes:u}=V({effects:n.effects,objectChanges:n.objectChanges});return{transaction:{digest:await r.getDigest(),epoch:null,effects:d,objectTypes:Promise.resolve(u),signatures:[],transaction:h.parseTransactionBcs(e.transaction),balanceChanges:n.balanceChanges.map(o=>({coinType:o.coinType,address:D(o.owner),amount:o.amount}))}}}async getReferenceGasPrice(e){const r=await i(this,a).getReferenceGasPrice({signal:e==null?void 0:e.signal});return{referenceGasPrice:String(r)}}async getDynamicFields(e){const r=await i(this,a).getDynamicFields({parentId:e.parentId,limit:e.limit,cursor:e.cursor});return{dynamicFields:r.data.map(n=>({id:n.objectId,type:n.objectType,name:{type:n.name.type,bcs:g.fromBase64(n.bcsName)}})),hasNextPage:r.hasNextPage,cursor:r.nextCursor}}async verifyZkLoginSignature(e){const r=await i(this,a).verifyZkLoginSignature({bytes:e.bytes,signature:e.signature,intentScope:e.intentScope,author:e.author});return{success:r.success,errors:r.errors}}async defaultNameServiceName(e){return{data:{name:(await i(this,a).resolveNameServiceNames(e)).data[0]}}}resolveTransactionPlugin(){return P.jsonRpcClientResolveTransactionPlugin(i(this,a))}async getMoveFunction(e){const r=await i(this,a).getNormalizedMoveFunction({package:(await this.mvr.resolvePackage({package:e.packageId})).package,module:e.moduleName,function:e.name});return{function:{packageId:k.normalizeSuiAddress(e.packageId),moduleName:e.moduleName,name:e.name,visibility:U(r.visibility),isEntry:r.isEntry,typeParameters:r.typeParameters.map(n=>({isPhantom:!1,constraints:M(n)})),parameters:r.parameters.map(n=>j(n)),returns:r.return.map(n=>j(n))}}}}a=new WeakMap;function v(t){var e;return{id:t.objectId,version:t.version,digest:t.digest,type:t.type,content:Promise.resolve(((e=t.bcs)==null?void 0:e.dataType)==="moveObject"?g.fromBase64(t.bcs.bcsBytes):new Uint8Array),owner:l(t.owner),previousTransaction:t.previousTransaction??null}}function l(t){if(t==="Immutable")return{$kind:"Immutable",Immutable:!0};if("ConsensusAddressOwner"in t)return{$kind:"ConsensusAddressOwner",ConsensusAddressOwner:{owner:t.ConsensusAddressOwner.owner,startVersion:t.ConsensusAddressOwner.start_version}};if("AddressOwner"in t)return{$kind:"AddressOwner",AddressOwner:t.AddressOwner};if("ObjectOwner"in t)return{$kind:"ObjectOwner",ObjectOwner:t.ObjectOwner};if("Shared"in t)return{$kind:"Shared",Shared:{initialSharedVersion:t.Shared.initial_shared_version}};throw new Error(`Unknown owner type: ${JSON.stringify(t)}`)}function D(t){if(t==="Immutable")return null;if("ConsensusAddressOwner"in t)return t.ConsensusAddressOwner.owner;if("AddressOwner"in t)return t.AddressOwner;if("ObjectOwner"in t)return t.ObjectOwner;if("Shared"in t)return null;throw new Error(`Unknown owner type: ${JSON.stringify(t)}`)}function T(t){var u,o,s;const e=p.bcs.SenderSignedData.parse(g.fromBase64(t.rawTransaction))[0],r={};(u=t.objectChanges)==null||u.forEach(c=>{c.type!=="published"&&(r[c.objectId]=c.objectType)});const n=p.bcs.TransactionData.serialize(e.intentMessage.value).toBytes(),d=E.TransactionDataBuilder.restore({version:2,sender:e.intentMessage.value.V1.sender,expiration:e.intentMessage.value.V1.expiration,gasData:e.intentMessage.value.V1.gasData,inputs:e.intentMessage.value.V1.kind.ProgrammableTransaction.inputs,commands:e.intentMessage.value.V1.kind.ProgrammableTransaction.commands});return{digest:t.digest,epoch:((o=t.effects)==null?void 0:o.executedEpoch)??null,effects:h.parseTransactionEffectsBcs(new Uint8Array(t.rawEffects)),objectTypes:Promise.resolve(r),transaction:{...d,bcs:n},signatures:e.txSignatures,balanceChanges:((s=t.balanceChanges)==null?void 0:s.map(c=>({coinType:c.coinType,address:D(c.owner),amount:c.amount})))??[]}}function V({bytes:t,effects:e,objectChanges:r}){var o;const n=[],d=[],u={};return r==null||r.forEach(s=>{var c,O,m,y;switch(s.type){case"published":n.push({id:s.packageId,inputState:"DoesNotExist",inputVersion:null,inputDigest:null,inputOwner:null,outputState:"PackageWrite",outputVersion:s.version,outputDigest:s.digest,outputOwner:null,idOperation:"Created"});break;case"transferred":n.push({id:s.objectId,inputState:"Exists",inputVersion:s.version,inputDigest:s.digest,inputOwner:{$kind:"AddressOwner",AddressOwner:s.sender},outputState:"ObjectWrite",outputVersion:s.version,outputDigest:s.digest,outputOwner:l(s.recipient),idOperation:"None"}),u[s.objectId]=s.objectType;break;case"mutated":n.push({id:s.objectId,inputState:"Exists",inputVersion:s.previousVersion,inputDigest:null,inputOwner:l(s.owner),outputState:"ObjectWrite",outputVersion:s.version,outputDigest:s.digest,outputOwner:l(s.owner),idOperation:"None"}),u[s.objectId]=s.objectType;break;case"deleted":n.push({id:s.objectId,inputState:"Exists",inputVersion:s.version,inputDigest:((O=(c=e.deleted)==null?void 0:c.find(w=>w.objectId===s.objectId))==null?void 0:O.digest)??null,inputOwner:null,outputState:"DoesNotExist",outputVersion:null,outputDigest:null,outputOwner:null,idOperation:"Deleted"}),u[s.objectId]=s.objectType;break;case"wrapped":n.push({id:s.objectId,inputState:"Exists",inputVersion:s.version,inputDigest:null,inputOwner:{$kind:"AddressOwner",AddressOwner:s.sender},outputState:"ObjectWrite",outputVersion:s.version,outputDigest:((y=(m=e.wrapped)==null?void 0:m.find(w=>w.objectId===s.objectId))==null?void 0:y.digest)??null,outputOwner:{$kind:"ObjectOwner",ObjectOwner:s.sender},idOperation:"None"}),u[s.objectId]=s.objectType;break;case"created":n.push({id:s.objectId,inputState:"DoesNotExist",inputVersion:null,inputDigest:null,inputOwner:null,outputState:"ObjectWrite",outputVersion:s.version,outputDigest:s.digest,outputOwner:l(s.owner),idOperation:"Created"}),u[s.objectId]=s.objectType;break}}),{objectTypes:u,effects:{bcs:t??null,digest:e.transactionDigest,version:2,status:e.status.status==="success"?{success:!0,error:null}:{success:!1,error:e.status.error},gasUsed:e.gasUsed,transactionDigest:e.transactionDigest,gasObject:{id:(o=e.gasObject)==null?void 0:o.reference.objectId,inputState:"Exists",inputVersion:null,inputDigest:null,inputOwner:null,outputState:"ObjectWrite",outputVersion:e.gasObject.reference.version,outputDigest:e.gasObject.reference.digest,outputOwner:l(e.gasObject.owner),idOperation:"None"},eventsDigest:e.eventsDigest??null,dependencies:e.dependencies??[],lamportVersion:e.gasObject.reference.version,changedObjects:n,unchangedConsensusObjects:d,auxiliaryDataDigest:null}}}const R=p.bcs.struct("Balance",{value:p.bcs.u64()}),_=p.bcs.struct("Coin",{id:p.bcs.Address,balance:R});function j(t){if(typeof t!="string"){if("Reference"in t)return{reference:"immutable",body:b(t.Reference)};if("MutableReference"in t)return{reference:"mutable",body:b(t.MutableReference)}}return{reference:null,body:b(t)}}function b(t){switch(t){case"Address":return{$kind:"address"};case"Bool":return{$kind:"bool"};case"U8":return{$kind:"u8"};case"U16":return{$kind:"u16"};case"U32":return{$kind:"u32"};case"U64":return{$kind:"u64"};case"U128":return{$kind:"u128"};case"U256":return{$kind:"u256"}}if(typeof t=="string")throw new Error(`Unknown type: ${t}`);if("Vector"in t)return{$kind:"vector",vector:b(t.Vector)};if("Struct"in t)return{$kind:"datatype",datatype:{typeName:`${k.normalizeSuiAddress(t.Struct.address)}::${t.Struct.module}::${t.Struct.name}`,typeParameters:t.Struct.typeArguments.map(e=>b(e))}};if("TypeParameter"in t)return{$kind:"typeParameter",index:t.TypeParameter};throw new Error(`Unknown type: ${JSON.stringify(t)}`)}function M(t){return t.abilities.map(e=>{switch(e){case"Copy":return"copy";case"Drop":return"drop";case"Store":return"store";case"Key":return"key";default:return"unknown"}})}function U(t){switch(t){case"Public":return"public";case"Private":return"private";case"Friend":return"friend";default:return"unknown"}}exports.JSONRpcCoreClient=$;
package/dist/index121.js CHANGED
@@ -1,13 +1,13 @@
1
1
  import { fromBase64 as m } from "./index114.js";
2
- import { chunk as x } from "./index317.js";
3
- import { bcs as p } from "./index319.js";
2
+ import { chunk as x } from "./index298.js";
3
+ import { bcs as p } from "./index300.js";
4
4
  import { Transaction as C } from "./index77.js";
5
- import { jsonRpcClientResolveTransactionPlugin as I } from "./index320.js";
6
- import { TransactionDataBuilder as P } from "./index313.js";
5
+ import { jsonRpcClientResolveTransactionPlugin as I } from "./index301.js";
6
+ import { TransactionDataBuilder as P } from "./index294.js";
7
7
  import { normalizeSuiAddress as k } from "./index117.js";
8
- import { Experimental_CoreClient as E } from "./index321.js";
9
- import { ObjectError as y } from "./index322.js";
10
- import { parseTransactionBcs as N, parseTransactionEffectsBcs as A } from "./index323.js";
8
+ import { Experimental_CoreClient as E } from "./index302.js";
9
+ import { ObjectError as y } from "./index303.js";
10
+ import { parseTransactionBcs as N, parseTransactionEffectsBcs as A } from "./index304.js";
11
11
  var h = (t) => {
12
12
  throw TypeError(t);
13
13
  }, S = (t, e, r) => e.has(t) || h("Cannot " + r), i = (t, e, r) => (S(t, e, "read from private field"), r ? r.call(t) : e.get(t)), $ = (t, e, r) => e.has(t) ? h("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, r), B = (t, e, r, n) => (S(t, e, "write to private field"), e.set(t, r), r), a;
package/dist/index132.cjs CHANGED
@@ -1 +1 @@
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;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./index321.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/index132.js CHANGED
@@ -1,4 +1,4 @@
1
- import { createFilterRequestScope as r } from "./index299.js";
1
+ import { createFilterRequestScope as r } from "./index321.js";
2
2
  async function i(e) {
3
3
  const o = r(e, {
4
4
  method: "eth_newBlockFilter"
package/dist/index133.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("./index225.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;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("./index225.cjs"),s=require("./index81.cjs"),q=require("./index321.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/index133.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { encodeEventTopics as l } from "./index225.js";
2
2
  import { numberToHex as s } from "./index81.js";
3
- import { createFilterRequestScope as u } from "./index299.js";
3
+ import { createFilterRequestScope as u } from "./index321.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/index134.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("./index225.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;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("./index225.cjs"),u=require("./index81.cjs"),q=require("./index321.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/index134.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { encodeEventTopics as b } from "./index225.js";
2
2
  import { numberToHex as m } from "./index81.js";
3
- import { createFilterRequestScope as h } from "./index299.js";
3
+ import { createFilterRequestScope as h } from "./index321.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/index135.cjs CHANGED
@@ -1 +1 @@
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;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index321.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/index135.js CHANGED
@@ -1,4 +1,4 @@
1
- import { createFilterRequestScope as r } from "./index299.js";
1
+ import { createFilterRequestScope as r } from "./index321.js";
2
2
  async function a(e) {
3
3
  const n = r(e, {
4
4
  method: "eth_newPendingTransactionFilter"
package/dist/index138.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const O=require("./index123.cjs"),P=require("./index189.cjs"),E=require("./index276.cjs"),F=require("./index81.cjs"),S=require("./index328.cjs"),B=require("./index271.cjs"),N=require("./index108.cjs"),_=require("./index279.cjs"),g=require("./index261.cjs"),V=require("./index174.cjs");async function j(t,e){var u,m,d;const{account:c=t.account,prepare:o=!0}=e,r=c?O.parseAccount(c):void 0,q=(()=>{if(Array.isArray(o))return o;if((r==null?void 0:r.type)!=="local")return["blobVersionedHashes"]})();try{const a=await(async()=>{if(e.to)return e.to;if(e.authorizationList&&e.authorizationList.length>0)return await E.recoverAuthorizationAddress({authorization:e.authorizationList[0]}).catch(()=>{throw new P.BaseError("`to` is required. Could not infer from `authorizationList`")})})(),{accessList:l,authorizationList:p,blobs:x,blobVersionedHashes:y,blockNumber:b,blockTag:v,data:z,gas:s,gasPrice:G,maxFeePerBlobGas:A,maxFeePerGas:w,maxPriorityFeePerGas:R,nonce:T,value:k,stateOverride:H,...L}=o?await V.prepareTransactionRequest(t,{...e,parameters:q,to:a}):e;if(s&&e.gas!==s)return s;const i=(typeof b=="bigint"?F.numberToHex(b):void 0)||v,h=_.serializeStateOverride(H);g.assertRequest(e);const f=(d=(m=(u=t.chain)==null?void 0:u.formatters)==null?void 0:m.transactionRequest)==null?void 0:d.format,n=(f||N.formatTransactionRequest)({...B.extract(L,{format:f}),account:r,accessList:l,authorizationList:p,blobs:x,blobVersionedHashes:y,data:z,gasPrice:G,maxFeePerBlobGas:A,maxFeePerGas:w,maxPriorityFeePerGas:R,nonce:T,to:a,value:k},"estimateGas");return BigInt(await t.request({method:"eth_estimateGas",params:h?[n,i??t.experimental_blockTag??"latest",h]:i?[n,i]:[n]}))}catch(a){throw S.getEstimateGasError(a,{...e,account:r,chain:t.chain})}}exports.estimateGas=j;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const O=require("./index123.cjs"),P=require("./index189.cjs"),E=require("./index272.cjs"),F=require("./index81.cjs"),S=require("./index328.cjs"),B=require("./index271.cjs"),N=require("./index108.cjs"),_=require("./index275.cjs"),g=require("./index261.cjs"),V=require("./index174.cjs");async function j(t,e){var u,m,d;const{account:c=t.account,prepare:o=!0}=e,r=c?O.parseAccount(c):void 0,q=(()=>{if(Array.isArray(o))return o;if((r==null?void 0:r.type)!=="local")return["blobVersionedHashes"]})();try{const a=await(async()=>{if(e.to)return e.to;if(e.authorizationList&&e.authorizationList.length>0)return await E.recoverAuthorizationAddress({authorization:e.authorizationList[0]}).catch(()=>{throw new P.BaseError("`to` is required. Could not infer from `authorizationList`")})})(),{accessList:l,authorizationList:p,blobs:x,blobVersionedHashes:y,blockNumber:b,blockTag:v,data:z,gas:s,gasPrice:G,maxFeePerBlobGas:A,maxFeePerGas:w,maxPriorityFeePerGas:R,nonce:T,value:k,stateOverride:H,...L}=o?await V.prepareTransactionRequest(t,{...e,parameters:q,to:a}):e;if(s&&e.gas!==s)return s;const i=(typeof b=="bigint"?F.numberToHex(b):void 0)||v,h=_.serializeStateOverride(H);g.assertRequest(e);const f=(d=(m=(u=t.chain)==null?void 0:u.formatters)==null?void 0:m.transactionRequest)==null?void 0:d.format,n=(f||N.formatTransactionRequest)({...B.extract(L,{format:f}),account:r,accessList:l,authorizationList:p,blobs:x,blobVersionedHashes:y,data:z,gasPrice:G,maxFeePerBlobGas:A,maxFeePerGas:w,maxPriorityFeePerGas:R,nonce:T,to:a,value:k},"estimateGas");return BigInt(await t.request({method:"eth_estimateGas",params:h?[n,i??t.experimental_blockTag??"latest",h]:i?[n,i]:[n]}))}catch(a){throw S.getEstimateGasError(a,{...e,account:r,chain:t.chain})}}exports.estimateGas=j;
package/dist/index138.js CHANGED
@@ -1,11 +1,11 @@
1
1
  import { parseAccount as F } from "./index123.js";
2
2
  import { BaseError as R } from "./index189.js";
3
- import { recoverAuthorizationAddress as B } from "./index276.js";
3
+ import { recoverAuthorizationAddress as B } from "./index272.js";
4
4
  import { numberToHex as E } from "./index81.js";
5
5
  import { getEstimateGasError as N } from "./index328.js";
6
6
  import { extract as O } from "./index271.js";
7
7
  import { formatTransactionRequest as _ } from "./index108.js";
8
- import { serializeStateOverride as S } from "./index279.js";
8
+ import { serializeStateOverride as S } from "./index275.js";
9
9
  import { assertRequest as V } from "./index261.js";
10
10
  import { prepareTransactionRequest as C } from "./index174.js";
11
11
  async function $(r, t) {
package/dist/index161.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const y=require("./index277.cjs"),B=require("./index123.cjs"),D=require("./index187.cjs"),F=require("./index94.cjs"),C=require("./index206.cjs"),H=require("./index221.cjs"),A=require("./index96.cjs"),U=require("./index80.cjs"),_=require("./index81.cjs"),j=require("./index246.cjs"),z=require("./index270.cjs"),I=require("./index72.cjs"),L=require("./index90.cjs"),M=require("./index108.cjs"),P=require("./index279.cjs"),V=require("./index261.cjs");async function Z(m,v){const{blockNumber:q,blockTag:O=m.experimental_blockTag??"latest",blocks:g,returnFullTransactions:w,traceTransfers:N,validation:R}=v;try{const a=[];for(const t of g){const f=t.blockOverrides?y.toRpc(t.blockOverrides):void 0,r=t.calls.map(c=>{const e=c,o=e.account?B.parseAccount(e.account):void 0,i=e.abi?A.encodeFunctionData(e):e.data,s={...e,account:o,data:e.dataSuffix?U.concat([i||"0x",e.dataSuffix]):i,from:e.from??(o==null?void 0:o.address)};return V.assertRequest(s),M.formatTransactionRequest(s)}),b=t.stateOverrides?P.serializeStateOverride(t.stateOverrides):void 0;a.push({blockOverrides:f,calls:r,stateOverrides:b})}const u=(typeof q=="bigint"?_.numberToHex(q):void 0)||O;return(await m.request({method:"eth_simulateV1",params:[{blockStateCalls:a,returnFullTransactions:w,traceTransfers:N,validation:R},u]})).map((t,f)=>({...I.formatBlock(t),calls:t.calls.map((r,b)=>{var k,p;const{abi:c,args:e,functionName:o,to:i}=g[f].calls[b],s=((k=r.error)==null?void 0:k.data)??r.returnData,E=BigInt(r.gasUsed),T=(p=r.logs)==null?void 0:p.map(n=>L.formatLog(n)),d=r.status==="0x1"?"success":"failure",h=c&&d==="success"&&s!=="0x"?H.decodeFunctionResult({abi:c,data:s,functionName:o}):null,S=(()=>{var x;if(d==="success")return;let n;if(((x=r.error)==null?void 0:x.data)==="0x"?n=new D.AbiDecodingZeroDataError:r.error&&(n=new F.RawContractError(r.error)),!!n)return j.getContractError(n,{abi:c??[],address:i??"0x",args:e,functionName:o??"<unknown>"})})();return{data:s,gasUsed:E,logs:T,status:d,...d==="success"?{result:h}:{error:S}}})}))}catch(a){const l=a,u=z.getNodeError(l,{});throw u instanceof C.UnknownNodeError?l:u}}exports.simulateBlocks=Z;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const y=require("./index273.cjs"),B=require("./index123.cjs"),D=require("./index187.cjs"),F=require("./index94.cjs"),C=require("./index206.cjs"),H=require("./index221.cjs"),A=require("./index96.cjs"),U=require("./index80.cjs"),_=require("./index81.cjs"),j=require("./index246.cjs"),z=require("./index270.cjs"),I=require("./index72.cjs"),L=require("./index90.cjs"),M=require("./index108.cjs"),P=require("./index275.cjs"),V=require("./index261.cjs");async function Z(m,v){const{blockNumber:q,blockTag:O=m.experimental_blockTag??"latest",blocks:g,returnFullTransactions:w,traceTransfers:N,validation:R}=v;try{const a=[];for(const t of g){const f=t.blockOverrides?y.toRpc(t.blockOverrides):void 0,r=t.calls.map(c=>{const e=c,o=e.account?B.parseAccount(e.account):void 0,i=e.abi?A.encodeFunctionData(e):e.data,s={...e,account:o,data:e.dataSuffix?U.concat([i||"0x",e.dataSuffix]):i,from:e.from??(o==null?void 0:o.address)};return V.assertRequest(s),M.formatTransactionRequest(s)}),b=t.stateOverrides?P.serializeStateOverride(t.stateOverrides):void 0;a.push({blockOverrides:f,calls:r,stateOverrides:b})}const u=(typeof q=="bigint"?_.numberToHex(q):void 0)||O;return(await m.request({method:"eth_simulateV1",params:[{blockStateCalls:a,returnFullTransactions:w,traceTransfers:N,validation:R},u]})).map((t,f)=>({...I.formatBlock(t),calls:t.calls.map((r,b)=>{var k,p;const{abi:c,args:e,functionName:o,to:i}=g[f].calls[b],s=((k=r.error)==null?void 0:k.data)??r.returnData,E=BigInt(r.gasUsed),T=(p=r.logs)==null?void 0:p.map(n=>L.formatLog(n)),d=r.status==="0x1"?"success":"failure",h=c&&d==="success"&&s!=="0x"?H.decodeFunctionResult({abi:c,data:s,functionName:o}):null,S=(()=>{var x;if(d==="success")return;let n;if(((x=r.error)==null?void 0:x.data)==="0x"?n=new D.AbiDecodingZeroDataError:r.error&&(n=new F.RawContractError(r.error)),!!n)return j.getContractError(n,{abi:c??[],address:i??"0x",args:e,functionName:o??"<unknown>"})})();return{data:s,gasUsed:E,logs:T,status:d,...d==="success"?{result:h}:{error:S}}})}))}catch(a){const l=a,u=z.getNodeError(l,{});throw u instanceof C.UnknownNodeError?l:u}}exports.simulateBlocks=Z;
package/dist/index161.js CHANGED
@@ -1,4 +1,4 @@
1
- import { toRpc as S } from "./index277.js";
1
+ import { toRpc as S } from "./index273.js";
2
2
  import { parseAccount as y } from "./index123.js";
3
3
  import { AbiDecodingZeroDataError as B } from "./index187.js";
4
4
  import { RawContractError as C } from "./index94.js";
@@ -12,7 +12,7 @@ import { getNodeError as I } from "./index270.js";
12
12
  import { formatBlock as L } from "./index72.js";
13
13
  import { formatLog as V } from "./index90.js";
14
14
  import { formatTransactionRequest as Z } from "./index108.js";
15
- import { serializeStateOverride as j } from "./index279.js";
15
+ import { serializeStateOverride as j } from "./index275.js";
16
16
  import { assertRequest as G } from "./index261.js";
17
17
  async function ir(p, w) {
18
18
  const { blockNumber: b, blockTag: N = p.experimental_blockTag ?? "latest", blocks: k, returnFullTransactions: O, traceTransfers: h, validation: T } = w;
package/dist/index167.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const S=require("./index191.cjs"),k=require("./index199.cjs"),f=require("./index101.cjs"),$=require("./index300.cjs"),C=require("./index324.cjs"),B=require("./index251.cjs"),D=require("./index207.cjs"),P=require("./index143.cjs"),W=require("./index156.cjs"),y=require("./index159.cjs"),z=require("./index168.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;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const S=require("./index191.cjs"),k=require("./index199.cjs"),f=require("./index101.cjs"),$=require("./index322.cjs"),C=require("./index324.cjs"),B=require("./index251.cjs"),D=require("./index207.cjs"),P=require("./index143.cjs"),W=require("./index156.cjs"),y=require("./index159.cjs"),z=require("./index168.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/index167.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { BlockNotFoundError as M } from "./index191.js";
2
2
  import { WaitForTransactionReceiptTimeoutError as O, TransactionNotFoundError as W, TransactionReceiptNotFoundError as q } from "./index199.js";
3
3
  import { getAction as u } from "./index101.js";
4
- import { observe as z } from "./index300.js";
4
+ import { observe as z } from "./index322.js";
5
5
  import { withResolvers as G } from "./index324.js";
6
6
  import { withRetry as B } from "./index251.js";
7
7
  import { stringify as H } from "./index207.js";
package/dist/index168.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("./index300.cjs"),h=require("./index301.cjs"),g=require("./index207.cjs"),m=require("./index144.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;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const v=require("./index71.cjs"),w=require("./index101.cjs"),N=require("./index322.cjs"),h=require("./index323.cjs"),g=require("./index207.cjs"),m=require("./index144.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/index168.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 "./index300.js";
4
- import { poll as h } from "./index301.js";
3
+ import { observe as y } from "./index322.js";
4
+ import { poll as h } from "./index323.js";
5
5
  import { stringify as N } from "./index207.js";
6
6
  import { getBlockNumber as v } from "./index144.js";
7
7
  function j(r, { emitOnBegin: b = !1, emitMissed: p = !1, onBlockNumber: l, onError: a, poll: k, pollingInterval: i = r.pollingInterval }) {
package/dist/index169.cjs CHANGED
@@ -1 +1 @@
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("./index207.cjs"),p=require("./index143.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;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./index101.cjs"),q=require("./index322.cjs"),A=require("./index323.cjs"),S=require("./index207.cjs"),p=require("./index143.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/index169.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { getAction as p } from "./index101.js";
2
- import { observe as S } from "./index300.js";
3
- import { poll as x } from "./index301.js";
2
+ import { observe as S } from "./index322.js";
3
+ import { poll as x } from "./index323.js";
4
4
  import { stringify as N } from "./index207.js";
5
5
  import { getBlock as i } from "./index143.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/index170.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const B=require("./index187.cjs"),M=require("./index208.cjs"),P=require("./index217.cjs"),_=require("./index225.cjs"),I=require("./index90.cjs"),b=require("./index101.cjs"),A=require("./index300.cjs"),O=require("./index301.cjs"),S=require("./index207.cjs"),$=require("./index133.cjs"),j=require("./index144.cjs"),z=require("./index147.cjs"),R=require("./index150.cjs"),U=require("./index164.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;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const B=require("./index187.cjs"),M=require("./index208.cjs"),P=require("./index217.cjs"),_=require("./index225.cjs"),I=require("./index90.cjs"),b=require("./index101.cjs"),A=require("./index322.cjs"),O=require("./index323.cjs"),S=require("./index207.cjs"),$=require("./index133.cjs"),j=require("./index144.cjs"),z=require("./index147.cjs"),R=require("./index150.cjs"),U=require("./index164.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/index170.js CHANGED
@@ -4,8 +4,8 @@ import { decodeEventLog as A } from "./index217.js";
4
4
  import { encodeEventTopics as O } from "./index225.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 "./index300.js";
8
- import { poll as R } from "./index301.js";
7
+ import { observe as D } from "./index322.js";
8
+ import { poll as R } from "./index323.js";
9
9
  import { stringify as S } from "./index207.js";
10
10
  import { createContractEventFilter as U } from "./index133.js";
11
11
  import { getBlockNumber as j } from "./index144.js";
package/dist/index171.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const A=require("./index187.cjs"),M=require("./index208.cjs"),T=require("./index217.cjs"),B=require("./index225.cjs"),I=require("./index90.cjs"),g=require("./index101.cjs"),C=require("./index300.cjs"),O=require("./index301.cjs"),P=require("./index207.cjs"),j=require("./index134.cjs"),z=require("./index144.cjs"),R=require("./index150.cjs"),U=require("./index153.cjs"),$=require("./index164.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;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const A=require("./index187.cjs"),M=require("./index208.cjs"),T=require("./index217.cjs"),B=require("./index225.cjs"),I=require("./index90.cjs"),g=require("./index101.cjs"),C=require("./index322.cjs"),O=require("./index323.cjs"),P=require("./index207.cjs"),j=require("./index134.cjs"),z=require("./index144.cjs"),R=require("./index150.cjs"),U=require("./index153.cjs"),$=require("./index164.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/index171.js CHANGED
@@ -4,8 +4,8 @@ import { decodeEventLog as z } from "./index217.js";
4
4
  import { encodeEventTopics as A } from "./index225.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 "./index300.js";
8
- import { poll as P } from "./index301.js";
7
+ import { observe as O } from "./index322.js";
8
+ import { poll as P } from "./index323.js";
9
9
  import { stringify as R } from "./index207.js";
10
10
  import { createEventFilter as U } from "./index134.js";
11
11
  import { getBlockNumber as j } from "./index144.js";
package/dist/index172.cjs CHANGED
@@ -1 +1 @@
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("./index207.cjs"),p=require("./index135.cjs"),y=require("./index150.cjs"),T=require("./index164.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;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./index101.cjs"),f=require("./index322.cjs"),h=require("./index323.cjs"),P=require("./index207.cjs"),p=require("./index135.cjs"),y=require("./index150.cjs"),T=require("./index164.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;