@gardenfi/swap 0.1.3-beta.6 → 0.1.3-beta.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index106.cjs +1 -1
- package/dist/index106.js +1 -1
- package/dist/index107.cjs +1 -1
- package/dist/index107.js +1 -1
- package/dist/index113.cjs +1 -1
- package/dist/index113.js +1 -1
- package/dist/index116.cjs +1 -1
- package/dist/index116.js +1 -1
- package/dist/index117.cjs +1 -1
- package/dist/index117.js +1 -1
- package/dist/index120.cjs +1 -1
- package/dist/index120.js +2 -2
- package/dist/index121.cjs +1 -1
- package/dist/index121.js +7 -7
- package/dist/index126.cjs +1 -1
- package/dist/index126.js +2 -2
- package/dist/index127.cjs +1 -1
- package/dist/index127.js +1 -1
- package/dist/index128.cjs +1 -1
- package/dist/index128.js +1 -1
- package/dist/index129.cjs +1 -1
- package/dist/index129.js +1 -1
- package/dist/index130.cjs +1 -1
- package/dist/index130.js +2 -2
- package/dist/index132.cjs +1 -1
- package/dist/index132.js +1 -1
- package/dist/index133.cjs +1 -1
- package/dist/index133.js +1 -1
- package/dist/index134.cjs +1 -1
- package/dist/index134.js +1 -1
- package/dist/index135.cjs +1 -1
- package/dist/index135.js +1 -1
- package/dist/index138.cjs +1 -1
- package/dist/index138.js +1 -1
- package/dist/index140.cjs +1 -1
- package/dist/index140.js +1 -1
- package/dist/index148.cjs +1 -1
- package/dist/index148.js +1 -1
- package/dist/index149.cjs +1 -1
- package/dist/index149.js +1 -1
- package/dist/index154.cjs +1 -1
- package/dist/index154.js +1 -1
- package/dist/index162.cjs +1 -1
- package/dist/index162.js +2 -2
- package/dist/index167.cjs +1 -1
- package/dist/index167.js +2 -2
- package/dist/index168.cjs +1 -1
- package/dist/index168.js +2 -2
- package/dist/index169.cjs +1 -1
- package/dist/index169.js +2 -2
- package/dist/index170.cjs +1 -1
- package/dist/index170.js +2 -2
- package/dist/index171.cjs +1 -1
- package/dist/index171.js +2 -2
- package/dist/index172.cjs +1 -1
- package/dist/index172.js +2 -2
- package/dist/index173.cjs +1 -1
- package/dist/index173.js +2 -2
- package/dist/index178.cjs +1 -1
- package/dist/index178.js +1 -1
- package/dist/index181.cjs +1 -1
- package/dist/index181.js +1 -1
- package/dist/index278.cjs +1 -1
- package/dist/index278.js +1 -1
- package/dist/index299.cjs +1 -1
- package/dist/index299.js +37 -7
- package/dist/index300.cjs +1 -1
- package/dist/index300.js +14 -36
- package/dist/index301.cjs +1 -1
- package/dist/index301.js +8 -15
- package/dist/index302.cjs +1 -1
- package/dist/index302.js +7 -8
- package/dist/index303.cjs +1 -1
- package/dist/index303.js +43 -10
- package/dist/index304.cjs +1 -1
- package/dist/index304.js +320 -16
- package/dist/index305.cjs +1 -1
- package/dist/index305.js +604 -21
- package/dist/index306.cjs +1 -1
- package/dist/index306.js +110 -14
- package/dist/index307.cjs +1 -1
- package/dist/index307.js +167 -13
- package/dist/index308.cjs +1 -1
- package/dist/index308.js +300 -13
- package/dist/index309.cjs +1 -1
- package/dist/index309.js +93 -9
- package/dist/index310.cjs +1 -1
- package/dist/index310.js +54 -13
- package/dist/index311.cjs +1 -1
- package/dist/index311.js +51 -23
- package/dist/index312.cjs +1 -1
- package/dist/index312.js +43 -30
- package/dist/index313.cjs +1 -2
- package/dist/index313.js +15 -18
- package/dist/index314.cjs +1 -1
- package/dist/index314.js +317 -14
- package/dist/index315.cjs +1 -1
- package/dist/index315.js +59 -11
- package/dist/index316.cjs +1 -1
- package/dist/index316.js +19 -42
- package/dist/index317.cjs +1 -1
- package/dist/index317.js +27 -318
- package/dist/index318.cjs +1 -1
- package/dist/index318.js +3 -605
- package/dist/index319.cjs +7 -1
- package/dist/index319.js +235 -107
- package/dist/index320.cjs +1 -1
- package/dist/index320.js +48 -168
- package/dist/index321.cjs +1 -1
- package/dist/index321.js +203 -292
- package/dist/index322.cjs +1 -1
- package/dist/index322.js +81 -93
- package/dist/index323.cjs +1 -1
- package/dist/index323.js +28 -55
- package/dist/index324.cjs +1 -1
- package/dist/index324.js +70 -47
- package/dist/index325.cjs +1 -1
- package/dist/index325.js +9 -44
- package/dist/index326.cjs +1 -1
- package/dist/index326.js +15 -14
- package/dist/index327.cjs +1 -1
- package/dist/index327.js +21 -316
- package/dist/index328.cjs +1 -1
- package/dist/index328.js +13 -59
- package/dist/index329.cjs +1 -1
- package/dist/index329.js +12 -18
- package/dist/index330.cjs +1 -1
- package/dist/index330.js +13 -28
- package/dist/index331.cjs +1 -1
- package/dist/index331.js +9 -3
- package/dist/index332.cjs +1 -7
- package/dist/index332.js +15 -237
- package/dist/index333.cjs +1 -1
- package/dist/index333.js +26 -48
- package/dist/index334.cjs +1 -1
- package/dist/index334.js +27 -208
- package/dist/index335.cjs +2 -1
- package/dist/index335.js +18 -81
- package/dist/index336.cjs +1 -1
- package/dist/index336.js +13 -28
- package/dist/index337.cjs +1 -1
- package/dist/index337.js +11 -76
- package/dist/index349.cjs +1 -2
- package/dist/index349.js +4 -193
- package/dist/index350.cjs +2 -1
- package/dist/index350.js +168 -52
- package/dist/index351.cjs +1 -1
- package/dist/index351.js +65 -331
- package/dist/index352.cjs +1 -1
- package/dist/index352.js +332 -149
- package/dist/index353.cjs +1 -1
- package/dist/index353.js +161 -5
- package/dist/index354.cjs +1 -1
- package/dist/index354.js +5 -5
- package/dist/index361.cjs +1 -1
- package/dist/index361.js +91 -137
- package/dist/index362.cjs +1 -1
- package/dist/index362.js +28 -3
- package/dist/index363.cjs +1 -1
- package/dist/index363.js +144 -129
- package/dist/index364.cjs +1 -1
- package/dist/index364.js +331 -71
- package/dist/index365.cjs +1 -1
- package/dist/index365.js +72 -27
- package/dist/index366.cjs +1 -1
- package/dist/index366.js +31 -148
- package/dist/index367.cjs +1 -1
- package/dist/index367.js +5 -354
- package/dist/index368.cjs +1 -1
- package/dist/index368.js +274 -72
- package/dist/index369.cjs +1 -1
- package/dist/index369.js +171 -32
- package/dist/index370.cjs +1 -1
- package/dist/index370.js +10 -6
- package/dist/index371.cjs +1 -1
- package/dist/index371.js +105 -273
- package/dist/index372.cjs +1 -1
- package/dist/index372.js +10 -171
- package/dist/index373.cjs +1 -1
- package/dist/index373.js +141 -10
- package/dist/index374.cjs +1 -1
- package/dist/index374.js +3 -107
- package/dist/index375.cjs +1 -1
- package/dist/index375.js +133 -9
- package/dist/index383.cjs +1 -1
- package/dist/index383.js +106 -59
- package/dist/index384.cjs +1 -1
- package/dist/index384.js +3 -110
- package/dist/index385.cjs +1 -1
- package/dist/index385.js +63 -3
- package/dist/index77.cjs +1 -1
- package/dist/index77.js +13 -13
- package/dist/index9.cjs +1 -1
- package/dist/index9.js +16 -14
- package/dist/src/lib/store/swapStore.d.ts +1 -1
- package/package.json +5 -5
package/dist/index106.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./index350.cjs"),g=require("./index356.cjs"),y=require("./index278.cjs"),t=require("./index277.cjs"),h=require("./index281.cjs"),o="0x8010801080108010801080108010801080108010801080108010801080108010",u=s.from("(uint256 chainId, address delegation, uint256 nonce, uint8 yParity, uint256 r, uint256 s), address to, bytes data");function a(r){if(typeof r=="string"){if(t.slice(r,-32)!==o)throw new c(r)}else h.assert(r.authorization)}function m(r){a(r);const n=t.toNumber(t.slice(r,-64,-32)),d=t.slice(r,-n-64,-64),f=t.slice(r,0,-n-64),[e,l,i]=s.decode(u,d);return{authorization:g.from({address:e.delegation,chainId:Number(e.chainId),nonce:e.nonce,yParity:e.yParity,r:e.r,s:e.s}),signature:f,...i&&i!=="0x"?{data:i,to:l}:{}}}function b(r){try{return a(r),!0}catch{return!1}}class c extends y.BaseError{constructor(n){super(`Value \`${n}\` is an invalid ERC-8010 wrapped signature.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SignatureErc8010.InvalidWrappedSignatureError"})}}exports.InvalidWrappedSignatureError=c;exports.assert=a;exports.magicBytes=o;exports.suffixParameters=u;exports.unwrap=m;exports.validate=b;
|
package/dist/index106.js
CHANGED
package/dist/index107.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./index350.cjs"),c=require("./index278.cjs"),n=require("./index277.cjs"),t="0x6492649264926492649264926492649264926492649264926492649264926492";function i(r){if(n.slice(r,-32)!==t)throw new s(r)}function d(r){const{data:e,signature:u,to:o}=r;return n.concat(a.encode(a.from("address, bytes, bytes"),[o,e,u]),t)}function l(r){try{return i(r),!0}catch{return!1}}class s extends c.BaseError{constructor(e){super(`Value \`${e}\` is an invalid ERC-6492 wrapped signature.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SignatureErc6492.InvalidWrappedSignatureError"})}}exports.InvalidWrappedSignatureError=s;exports.assert=i;exports.magicBytes=t;exports.validate=l;exports.wrap=d;
|
package/dist/index107.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { encode as i, from as o } from "./
|
|
1
|
+
import { encode as i, from as o } from "./index350.js";
|
|
2
2
|
import { BaseError as s } from "./index278.js";
|
|
3
3
|
import { concat as u, slice as c } from "./index277.js";
|
|
4
4
|
const t = "0x6492649264926492649264926492649264926492649264926492649264926492";
|
package/dist/index113.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./index383.cjs"),s=e=>o.base58.encode(e),t=e=>o.base58.decode(e);exports.fromBase58=t;exports.toBase58=s;
|
package/dist/index113.js
CHANGED
package/dist/index116.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index303.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
package/dist/index117.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("./index113.cjs"),S=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("./index113.cjs"),S=require("./index317.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
package/dist/index120.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const D=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const D=require("./index318.cjs"),L=require("./index319.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 "./
|
|
2
|
-
import { DataLoader as L } from "./
|
|
1
|
+
import { chunk as D } from "./index318.js";
|
|
2
|
+
import { DataLoader as L } from "./index319.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("./index331.cjs"),p=require("./index333.cjs"),I=require("./index77.cjs"),P=require("./index334.cjs"),E=require("./index327.cjs"),k=require("./index117.cjs"),N=require("./index335.cjs"),f=require("./index336.cjs"),h=require("./index337.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("./index318.cjs"),p=require("./index320.cjs"),I=require("./index77.cjs"),P=require("./index321.cjs"),E=require("./index314.cjs"),k=require("./index117.cjs"),N=require("./index322.cjs"),f=require("./index323.cjs"),h=require("./index324.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 "./
|
|
3
|
-
import { bcs as p } from "./
|
|
2
|
+
import { chunk as x } from "./index318.js";
|
|
3
|
+
import { bcs as p } from "./index320.js";
|
|
4
4
|
import { Transaction as C } from "./index77.js";
|
|
5
|
-
import { jsonRpcClientResolveTransactionPlugin as I } from "./
|
|
6
|
-
import { TransactionDataBuilder as P } from "./
|
|
5
|
+
import { jsonRpcClientResolveTransactionPlugin as I } from "./index321.js";
|
|
6
|
+
import { TransactionDataBuilder as P } from "./index314.js";
|
|
7
7
|
import { normalizeSuiAddress as k } from "./index117.js";
|
|
8
|
-
import { Experimental_CoreClient as E } from "./
|
|
9
|
-
import { ObjectError as y } from "./
|
|
10
|
-
import { parseTransactionBcs as N, parseTransactionEffectsBcs as A } from "./
|
|
8
|
+
import { Experimental_CoreClient as E } from "./index322.js";
|
|
9
|
+
import { ObjectError as y } from "./index323.js";
|
|
10
|
+
import { parseTransactionBcs as N, parseTransactionEffectsBcs as A } from "./index324.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/index126.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./index46.cjs"),R=require("./index221.cjs"),b=require("./index96.cjs"),m=require("./index84.cjs"),y=require("./index88.cjs"),C=require("./index81.cjs"),w=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./index46.cjs"),R=require("./index221.cjs"),b=require("./index96.cjs"),m=require("./index84.cjs"),y=require("./index88.cjs"),C=require("./index81.cjs"),w=require("./index325.cjs"),T=require("./index242.cjs"),v=require("./index245.cjs"),x=require("./index326.cjs"),B=require("./index101.cjs"),N=require("./index105.cjs");async function k(a,n){const{blockNumber:c,blockTag:f,coinType:i,name:t,gatewayUrls:h,strict:A}=n,{chain:r}=a,g=(()=>{if(n.universalResolverAddress)return n.universalResolverAddress;if(!r)throw new Error("client chain not configured. universalResolverAddress is required.");return m.getChainContractAddress({blockNumber:c,chain:r,contract:"ensUniversalResolver"})})(),u=r==null?void 0:r.ensTlds;if(u&&!u.some(e=>t.endsWith(e)))return null;const d=i!=null?[v.namehash(t),BigInt(i)]:[v.namehash(t)];try{const e=b.encodeFunctionData({abi:o.addressResolverAbi,functionName:"addr",args:d}),q={address:g,abi:o.universalResolverResolveAbi,functionName:"resolveWithGateways",args:[C.toHex(x.packetToBytes(t)),e,h??[T.localBatchGatewayUrl]],blockNumber:c,blockTag:f},l=await B.getAction(a,N.readContract,"readContract")(q);if(l[0]==="0x")return null;const s=R.decodeFunctionResult({abi:o.addressResolverAbi,args:d,functionName:"addr",data:l[0]});return s==="0x"||y.trim(s)==="0x00"?null:s}catch(e){if(A)throw e;if(w.isNullUniversalResolverError(e))return null;throw e}}exports.getEnsAddress=k;
|
package/dist/index126.js
CHANGED
|
@@ -4,10 +4,10 @@ import { encodeFunctionData as b } from "./index96.js";
|
|
|
4
4
|
import { getChainContractAddress as w } from "./index84.js";
|
|
5
5
|
import { trim as y } from "./index88.js";
|
|
6
6
|
import { toHex as C } from "./index81.js";
|
|
7
|
-
import { isNullUniversalResolverError as x } from "./
|
|
7
|
+
import { isNullUniversalResolverError as x } from "./index325.js";
|
|
8
8
|
import { localBatchGatewayUrl as N } from "./index242.js";
|
|
9
9
|
import { namehash as m } from "./index245.js";
|
|
10
|
-
import { packetToBytes as T } from "./
|
|
10
|
+
import { packetToBytes as T } from "./index326.js";
|
|
11
11
|
import { getAction as U } from "./index101.js";
|
|
12
12
|
import { readContract as k } from "./index105.js";
|
|
13
13
|
async function K(s, o) {
|
package/dist/index127.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./index327.cjs"),g=require("./index101.cjs"),l=require("./index130.cjs");async function v(t,{blockNumber:r,blockTag:a,assetGatewayUrls:n,name:s,gatewayUrls:c,strict:o,universalResolverAddress:u}){const e=await g.getAction(t,l.getEnsText,"getEnsText")({blockNumber:r,blockTag:a,key:"avatar",name:s,universalResolverAddress:u,gatewayUrls:c,strict:o});if(!e)return null;try{return await i.parseAvatarRecord(t,{record:e,gatewayUrls:n})}catch{return null}}exports.getEnsAvatar=v;
|
package/dist/index127.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { parseAvatarRecord as m } from "./
|
|
1
|
+
import { parseAvatarRecord as m } from "./index327.js";
|
|
2
2
|
import { getAction as u } from "./index101.js";
|
|
3
3
|
import { getEnsText as f } from "./index130.js";
|
|
4
4
|
async function y(t, { blockNumber: a, blockTag: e, assetGatewayUrls: n, name: o, gatewayUrls: c, strict: i, universalResolverAddress: s }) {
|
package/dist/index128.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("./index46.cjs"),h=require("./index84.cjs"),A=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("./index46.cjs"),h=require("./index84.cjs"),A=require("./index325.cjs"),w=require("./index242.cjs"),y=require("./index101.cjs"),C=require("./index105.cjs");async function R(t,r){const{address:a,blockNumber:s,blockTag:o,coinType:c=60n,gatewayUrls:i,strict:l}=r,{chain:n}=t,u=(()=>{if(r.universalResolverAddress)return r.universalResolverAddress;if(!n)throw new Error("client chain not configured. universalResolverAddress is required.");return h.getChainContractAddress({blockNumber:s,chain:n,contract:"ensUniversalResolver"})})();try{const e={address:u,abi:g.universalResolverReverseAbi,args:[a,c,i??[w.localBatchGatewayUrl]],functionName:"reverseWithGateways",blockNumber:s,blockTag:o},d=y.getAction(t,C.readContract,"readContract"),[v]=await d(e);return v||null}catch(e){if(l)throw e;if(A.isNullUniversalResolverError(e))return null;throw e}}exports.getEnsName=R;
|
package/dist/index128.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { universalResolverReverseAbi as m } from "./index46.js";
|
|
2
2
|
import { getChainContractAddress as f } from "./index84.js";
|
|
3
|
-
import { isNullUniversalResolverError as h } from "./
|
|
3
|
+
import { isNullUniversalResolverError as h } from "./index325.js";
|
|
4
4
|
import { localBatchGatewayUrl as w } from "./index242.js";
|
|
5
5
|
import { getAction as A } from "./index101.js";
|
|
6
6
|
import { readContract as R } from "./index105.js";
|
package/dist/index129.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./index84.cjs"),l=require("./index81.cjs"),v=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./index84.cjs"),l=require("./index81.cjs"),v=require("./index326.cjs"),y=require("./index101.cjs"),f=require("./index105.cjs");async function g(n,r){const{blockNumber:o,blockTag:i,name:s}=r,{chain:e}=n,a=(()=>{if(r.universalResolverAddress)return r.universalResolverAddress;if(!e)throw new Error("client chain not configured. universalResolverAddress is required.");return u.getChainContractAddress({blockNumber:o,chain:e,contract:"ensUniversalResolver"})})(),t=e==null?void 0:e.ensTlds;if(t&&!t.some(d=>s.endsWith(d)))throw new Error(`${s} is not a valid ENS TLD (${t==null?void 0:t.join(", ")}) for chain "${e.name}" (id: ${e.id}).`);const[c]=await y.getAction(n,f.readContract,"readContract")({address:a,abi:[{inputs:[{type:"bytes"}],name:"findResolver",outputs:[{type:"address"},{type:"bytes32"},{type:"uint256"}],stateMutability:"view",type:"function"}],functionName:"findResolver",args:[l.toHex(v.packetToBytes(s))],blockNumber:o,blockTag:i});return c}exports.getEnsResolver=g;
|
package/dist/index129.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { getChainContractAddress as l } from "./index84.js";
|
|
2
2
|
import { toHex as u } from "./index81.js";
|
|
3
|
-
import { packetToBytes as v } from "./
|
|
3
|
+
import { packetToBytes as v } from "./index326.js";
|
|
4
4
|
import { getAction as f } from "./index101.js";
|
|
5
5
|
import { readContract as m } from "./index105.js";
|
|
6
6
|
async function g(s, t) {
|
package/dist/index130.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./index46.cjs"),q=require("./index221.cjs"),A=require("./index96.cjs"),R=require("./index84.cjs"),b=require("./index81.cjs"),f=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./index46.cjs"),q=require("./index221.cjs"),A=require("./index96.cjs"),R=require("./index84.cjs"),b=require("./index81.cjs"),f=require("./index325.cjs"),y=require("./index242.cjs"),C=require("./index245.cjs"),w=require("./index326.cjs"),x=require("./index101.cjs"),m=require("./index105.cjs");async function T(o,r){const{blockNumber:a,blockTag:l,key:d,name:n,gatewayUrls:v,strict:h}=r,{chain:t}=o,g=(()=>{if(r.universalResolverAddress)return r.universalResolverAddress;if(!t)throw new Error("client chain not configured. universalResolverAddress is required.");return R.getChainContractAddress({blockNumber:a,chain:t,contract:"ensUniversalResolver"})})(),c=t==null?void 0:t.ensTlds;if(c&&!c.some(e=>n.endsWith(e)))return null;try{const e={address:g,abi:s.universalResolverResolveAbi,args:[b.toHex(w.packetToBytes(n)),A.encodeFunctionData({abi:s.textResolverAbi,functionName:"text",args:[C.namehash(n),d]}),v??[y.localBatchGatewayUrl]],functionName:"resolveWithGateways",blockNumber:a,blockTag:l},i=await x.getAction(o,m.readContract,"readContract")(e);if(i[0]==="0x")return null;const u=q.decodeFunctionResult({abi:s.textResolverAbi,functionName:"text",data:i[0]});return u===""?null:u}catch(e){if(h)throw e;if(f.isNullUniversalResolverError(e))return null;throw e}}exports.getEnsText=T;
|
package/dist/index130.js
CHANGED
|
@@ -3,10 +3,10 @@ import { decodeFunctionResult as h } from "./index221.js";
|
|
|
3
3
|
import { encodeFunctionData as A } from "./index96.js";
|
|
4
4
|
import { getChainContractAddress as R } from "./index84.js";
|
|
5
5
|
import { toHex as b } from "./index81.js";
|
|
6
|
-
import { isNullUniversalResolverError as g } from "./
|
|
6
|
+
import { isNullUniversalResolverError as g } from "./index325.js";
|
|
7
7
|
import { localBatchGatewayUrl as w } from "./index242.js";
|
|
8
8
|
import { namehash as x } from "./index245.js";
|
|
9
|
-
import { packetToBytes as y } from "./
|
|
9
|
+
import { packetToBytes as y } from "./index326.js";
|
|
10
10
|
import { getAction as C } from "./index101.js";
|
|
11
11
|
import { readContract as N } from "./index105.js";
|
|
12
12
|
async function j(n, e) {
|
package/dist/index132.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./index302.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
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("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("./index225.cjs"),s=require("./index81.cjs"),q=require("./index302.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 "./
|
|
3
|
+
import { createFilterRequestScope as u } from "./index302.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("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("./index225.cjs"),u=require("./index81.cjs"),q=require("./index302.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 "./
|
|
3
|
+
import { createFilterRequestScope as h } from "./index302.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("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index302.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
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("./index272.cjs"),F=require("./index81.cjs"),S=require("./
|
|
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
|
@@ -2,7 +2,7 @@ import { parseAccount as F } from "./index123.js";
|
|
|
2
2
|
import { BaseError as R } from "./index189.js";
|
|
3
3
|
import { recoverAuthorizationAddress as B } from "./index272.js";
|
|
4
4
|
import { numberToHex as E } from "./index81.js";
|
|
5
|
-
import { getEstimateGasError as N } from "./
|
|
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
8
|
import { serializeStateOverride as S } from "./index275.js";
|
package/dist/index140.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const y=require("./index123.cjs"),j=require("./index204.cjs"),z=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const y=require("./index123.cjs"),j=require("./index204.cjs"),z=require("./index329.cjs"),N=require("./index271.cjs"),O=require("./index73.cjs"),V=require("./index108.cjs"),h=require("./index101.cjs"),$=require("./index261.cjs"),D=require("./index143.cjs"),J=require("./index146.cjs");async function K(r,a){var P,g,m,d,F;const{account:s=r.account,accessList:w,authorizationList:B,chain:t=r.chain,blobVersionedHashes:T,blobs:I,data:M,gas:k,gasPrice:A,maxFeePerBlobGas:p,maxFeePerGas:R,maxPriorityFeePerGas:S,nonce:n,nonceManager:u,to:v,type:C,value:E,..._}=a,H=await(async()=>{if(!s||!u||typeof n<"u")return n;const o=y.parseAccount(s),x=t?t.id:await h.getAction(r,J.getChainId,"getChainId")({});return await u.consume({address:o.address,chainId:x,client:r})})();$.assertRequest(a);const f=(g=(P=t==null?void 0:t.formatters)==null?void 0:P.transactionRequest)==null?void 0:g.format,l=(f||V.formatTransactionRequest)({...N.extract(_,{format:f}),account:s?y.parseAccount(s):void 0,accessList:w,authorizationList:B,blobs:I,blobVersionedHashes:T,data:M,gas:k,gasPrice:A,maxFeePerBlobGas:p,maxFeePerGas:R,maxPriorityFeePerGas:S,nonce:H,to:v,type:C,value:E},"fillTransaction");try{const o=await r.request({method:"eth_fillTransaction",params:[l]}),e=(((d=(m=t==null?void 0:t.formatters)==null?void 0:m.transaction)==null?void 0:d.format)||O.formatTransaction)(o.tx);delete e.blockHash,delete e.blockNumber,delete e.r,delete e.s,delete e.transactionIndex,delete e.v,delete e.yParity,e.data=e.input,e.gas&&(e.gas=a.gas??e.gas),e.gasPrice&&(e.gasPrice=a.gasPrice??e.gasPrice),e.maxFeePerBlobGas&&(e.maxFeePerBlobGas=a.maxFeePerBlobGas??e.maxFeePerBlobGas),e.maxFeePerGas&&(e.maxFeePerGas=a.maxFeePerGas??e.maxFeePerGas),e.maxPriorityFeePerGas&&(e.maxPriorityFeePerGas=a.maxPriorityFeePerGas??e.maxPriorityFeePerGas),e.nonce&&(e.nonce=a.nonce??e.nonce);const c=await(async()=>{var i,q;if(typeof((i=t==null?void 0:t.fees)==null?void 0:i.baseFeeMultiplier)=="function"){const L=await h.getAction(r,D.getBlock,"getBlock")({});return t.fees.baseFeeMultiplier({block:L,client:r,request:a})}return((q=t==null?void 0:t.fees)==null?void 0:q.baseFeeMultiplier)??1.2})();if(c<1)throw new j.BaseFeeScalarError;const G=10**(((F=c.toString().split(".")[1])==null?void 0:F.length)??0),b=i=>i*BigInt(Math.ceil(c*G))/BigInt(G);return e.maxFeePerGas&&!a.maxFeePerGas&&(e.maxFeePerGas=b(e.maxFeePerGas)),e.gasPrice&&!a.gasPrice&&(e.gasPrice=b(e.gasPrice)),{raw:o.raw,transaction:{from:l.from,...e}}}catch(o){throw z.getTransactionError(o,{...a,chain:r.chain})}}exports.fillTransaction=K;
|
package/dist/index140.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { parseAccount as p } from "./index123.js";
|
|
2
2
|
import { BaseFeeScalarError as z } from "./index204.js";
|
|
3
|
-
import { getTransactionError as N } from "./
|
|
3
|
+
import { getTransactionError as N } from "./index329.js";
|
|
4
4
|
import { extract as V } from "./index271.js";
|
|
5
5
|
import { formatTransaction as j } from "./index73.js";
|
|
6
6
|
import { formatTransactionRequest as D } from "./index108.js";
|
package/dist/index148.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("./index330.cjs"),d=require("./index101.cjs"),f=require("./index105.cjs");async function g(a,i){const{address:n,factory:r,factoryData:o}=i;try{const[e,t,c,s,u,m,y]=await d.getAction(a,f.readContract,"readContract")({abi:l,address:n,functionName:"eip712Domain",factory:r,factoryData:o});return{domain:{name:t,version:c,chainId:Number(s),verifyingContract:u,salt:m},extensions:y,fields:e}}catch(e){const t=e;throw t.name==="ContractFunctionExecutionError"&&t.cause.name==="ContractFunctionZeroDataError"?new p.Eip712DomainNotFoundError({address:n}):t}}const l=[{inputs:[],name:"eip712Domain",outputs:[{name:"fields",type:"bytes1"},{name:"name",type:"string"},{name:"version",type:"string"},{name:"chainId",type:"uint256"},{name:"verifyingContract",type:"address"},{name:"salt",type:"bytes32"},{name:"extensions",type:"uint256[]"}],stateMutability:"view",type:"function"}];exports.getEip712Domain=g;
|
package/dist/index148.js
CHANGED
package/dist/index149.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./index81.cjs"),a=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./index81.cjs"),a=require("./index331.cjs");async function y(r,{blockCount:i,blockNumber:e,blockTag:n="latest",rewardPercentiles:s}){const t=typeof e=="bigint"?o.numberToHex(e):void 0,u=await r.request({method:"eth_feeHistory",params:[o.numberToHex(i),t||n,s]},{dedupe:!!t});return a.formatFeeHistory(u)}exports.getFeeHistory=y;
|
package/dist/index149.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { numberToHex as o } from "./index81.js";
|
|
2
|
-
import { formatFeeHistory as f } from "./
|
|
2
|
+
import { formatFeeHistory as f } from "./index331.js";
|
|
3
3
|
async function u(r, { blockCount: i, blockNumber: e, blockTag: n = "latest", rewardPercentiles: s }) {
|
|
4
4
|
const t = typeof e == "bigint" ? o(e) : void 0, a = await r.request({
|
|
5
5
|
method: "eth_feeHistory",
|
package/dist/index154.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./index81.cjs"),u=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./index81.cjs"),u=require("./index332.cjs");async function i(o,{address:t,blockNumber:e,blockTag:r,storageKeys:n}){const a=r??"latest",c=e!==void 0?s.numberToHex(e):void 0,f=await o.request({method:"eth_getProof",params:[t,n,c||a]});return u.formatProof(f)}exports.getProof=i;
|
package/dist/index154.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { numberToHex as c } from "./index81.js";
|
|
2
|
-
import { formatProof as s } from "./
|
|
2
|
+
import { formatProof as s } from "./index332.js";
|
|
3
3
|
async function d(t, { address: e, blockNumber: o, blockTag: r, storageKeys: n }) {
|
|
4
4
|
const f = r ?? "latest", a = o !== void 0 ? c(o) : void 0, m = await t.request({
|
|
5
5
|
method: "eth_getProof",
|
package/dist/index162.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const z=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const z=require("./index333.cjs"),a=require("./index334.cjs"),K=require("./index123.cjs"),t=require("./index183.cjs"),Q=require("./index93.cjs"),W=require("./index189.cjs"),X=require("./index96.cjs"),Y=require("./index131.cjs"),Z=require("./index161.cjs"),v=require("./index71.cjs"),$="0x6080604052348015600e575f80fd5b5061016d8061001c5f395ff3fe608060405234801561000f575f80fd5b5060043610610029575f3560e01c8063f8b2cb4f1461002d575b5f80fd5b610047600480360381019061004291906100db565b61005d565b604051610054919061011e565b60405180910390f35b5f8173ffffffffffffffffffffffffffffffffffffffff16319050919050565b5f80fd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f6100aa82610081565b9050919050565b6100ba816100a0565b81146100c4575f80fd5b50565b5f813590506100d5816100b1565b92915050565b5f602082840312156100f0576100ef61007d565b5b5f6100fd848285016100c7565b91505092915050565b5f819050919050565b61011881610106565b82525050565b5f6020820190506101315f83018461010f565b9291505056fea26469706673582212203b9fe929fe995c7cf9887f0bdba8a36dd78e8b73f149b17d2d9ad7cd09d2dc6264736f6c634300081a0033";async function _(h,r){const{blockNumber:k,blockTag:C,calls:N,stateOverrides:q,traceAssetChanges:f,traceTransfers:T,validation:w}=r,n=r.account?K.parseAccount(r.account):void 0;if(f&&!n)throw new W.BaseError("`account` is required when `traceAssetChanges` is true");const B=n?z.encode(z.from("constructor(bytes, bytes)"),{bytecode:Q.deploylessCallViaBytecodeBytecode,args:[$,a.encodeData(a.from("function getBalance(address)"),[n.address])]}):void 0,c=f?await Promise.all(r.calls.map(async s=>{if(!s.data&&!s.abi)return;const{accessList:e}=await Y.createAccessList(h,{account:n.address,...s,data:s.abi?X.encodeFunctionData(s):s.data});return e.map(({address:o,storageKeys:d})=>d.length>0?o:null)})).then(s=>s.flat().filter(Boolean)):[],i=await Z.simulateBlocks(h,{blockNumber:k,blockTag:C,blocks:[...f?[{calls:[{data:B}],stateOverrides:q},{calls:c.map((s,e)=>({abi:[a.from("function balanceOf(address) returns (uint256)")],functionName:"balanceOf",args:[n.address],to:s,from:t.zeroAddress,nonce:e})),stateOverrides:[{address:t.zeroAddress,nonce:0}]}]:[],{calls:[...N,{}].map(s=>({...s,from:n==null?void 0:n.address})),stateOverrides:q},...f?[{calls:[{data:B}]},{calls:c.map((s,e)=>({abi:[a.from("function balanceOf(address) returns (uint256)")],functionName:"balanceOf",args:[n.address],to:s,from:t.zeroAddress,nonce:e})),stateOverrides:[{address:t.zeroAddress,nonce:0}]},{calls:c.map((s,e)=>({to:s,abi:[a.from("function decimals() returns (uint256)")],functionName:"decimals",from:t.zeroAddress,nonce:e})),stateOverrides:[{address:t.zeroAddress,nonce:0}]},{calls:c.map((s,e)=>({to:s,abi:[a.from("function tokenURI(uint256) returns (string)")],functionName:"tokenURI",args:[0n],from:t.zeroAddress,nonce:e})),stateOverrides:[{address:t.zeroAddress,nonce:0}]},{calls:c.map((s,e)=>({to:s,abi:[a.from("function symbol() returns (string)")],functionName:"symbol",from:t.zeroAddress,nonce:e})),stateOverrides:[{address:t.zeroAddress,nonce:0}]}]:[]],traceTransfers:T,validation:w}),P=f?i[2]:i[0],[l,u,,b,m,g,A,p]=f?i:[],{calls:I,...D}=P,F=I.slice(0,-1)??[],L=(l==null?void 0:l.calls)??[],R=(u==null?void 0:u.calls)??[],U=[...L,...R].map(s=>s.status==="success"?v.hexToBigInt(s.data):null),E=(b==null?void 0:b.calls)??[],H=(m==null?void 0:m.calls)??[],S=[...E,...H].map(s=>s.status==="success"?v.hexToBigInt(s.data):null),j=((g==null?void 0:g.calls)??[]).map(s=>s.status==="success"?s.result:null),x=((p==null?void 0:p.calls)??[]).map(s=>s.status==="success"?s.result:null),M=((A==null?void 0:A.calls)??[]).map(s=>s.status==="success"?s.result:null),y=[];for(const[s,e]of S.entries()){const o=U[s];if(typeof e!="bigint"||typeof o!="bigint")continue;const d=j[s-1],V=x[s-1],G=M[s-1],O=s===0?{address:t.ethAddress,decimals:18,symbol:"ETH"}:{address:c[s-1],decimals:G||d?Number(d??1):void 0,symbol:V??void 0};y.some(J=>J.token.address===O.address)||y.push({token:O,value:{pre:o,post:e,diff:e-o}})}return{assetChanges:y,block:D,results:F}}exports.simulateCalls=_;
|
package/dist/index162.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { encode as K, from as M } from "./
|
|
2
|
-
import { encodeData as Q, from as c } from "./
|
|
1
|
+
import { encode as K, from as M } from "./index333.js";
|
|
2
|
+
import { encodeData as Q, from as c } from "./index334.js";
|
|
3
3
|
import { parseAccount as S } from "./index123.js";
|
|
4
4
|
import { zeroAddress as f, ethAddress as W } from "./index183.js";
|
|
5
5
|
import { deploylessCallViaBytecodeBytecode as X } from "./index93.js";
|
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("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const S=require("./index191.cjs"),k=require("./index199.cjs"),f=require("./index101.cjs"),$=require("./index299.cjs"),C=require("./index301.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,8 +1,8 @@
|
|
|
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 "./
|
|
5
|
-
import { withResolvers as G } from "./
|
|
4
|
+
import { observe as z } from "./index299.js";
|
|
5
|
+
import { withResolvers as G } from "./index301.js";
|
|
6
6
|
import { withRetry as B } from "./index251.js";
|
|
7
7
|
import { stringify as H } from "./index207.js";
|
|
8
8
|
import { getBlock as J } from "./index143.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("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const v=require("./index71.cjs"),w=require("./index101.cjs"),N=require("./index299.cjs"),h=require("./index300.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 "./
|
|
4
|
-
import { poll as h } from "./
|
|
3
|
+
import { observe as y } from "./index299.js";
|
|
4
|
+
import { poll as h } from "./index300.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("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./index101.cjs"),q=require("./index299.cjs"),A=require("./index300.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 "./
|
|
3
|
-
import { poll as x } from "./
|
|
2
|
+
import { observe as S } from "./index299.js";
|
|
3
|
+
import { poll as x } from "./index300.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 }) {
|