@solana/web3.js 2.0.0-experimental.b927e84 → 2.0.0-experimental.ba46ce1
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/index.browser.cjs +324 -11
- package/dist/index.browser.cjs.map +1 -1
- package/dist/index.browser.js +316 -11
- package/dist/index.browser.js.map +1 -1
- package/dist/index.development.js +1227 -232
- package/dist/index.development.js.map +1 -1
- package/dist/index.native.js +305 -11
- package/dist/index.native.js.map +1 -1
- package/dist/index.node.cjs +313 -11
- package/dist/index.node.cjs.map +1 -1
- package/dist/index.node.js +305 -11
- package/dist/index.node.js.map +1 -1
- package/dist/index.production.min.js +35 -29
- package/dist/types/cached-abortable-iterable.d.ts +11 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/rpc-subscription-coalescer.d.ts +10 -0
- package/dist/types/rpc-websocket-autopinger.d.ts +8 -0
- package/dist/types/rpc-websocket-connection-sharding.d.ts +13 -0
- package/dist/types/rpc-websocket-transport.d.ts +13 -0
- package/dist/types/rpc.d.ts +4 -3
- package/package.json +18 -19
|
@@ -2,39 +2,45 @@ this.globalThis = this.globalThis || {};
|
|
|
2
2
|
this.globalThis.solanaWeb3 = (function (exports) {
|
|
3
3
|
'use strict';
|
|
4
4
|
|
|
5
|
-
var Pe=Object.create;var Q=Object.defineProperty;var Ue=Object.getOwnPropertyDescriptor;var je=Object.getOwnPropertyNames;var Fe=Object.getPrototypeOf,Ke=Object.prototype.hasOwnProperty;var Me=(e,r,t)=>r in e?Q(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t;var We=(e,r)=>()=>(e&&(r=e(e=0)),r);var He=(e,r)=>()=>(r||e((r={exports:{}}).exports,r),r.exports);var Ge=(e,r,t,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let o of je(r))!Ke.call(e,o)&&o!==t&&Q(e,o,{get:()=>r[o],enumerable:!(n=Ue(r,o))||n.enumerable});return e};var Ve=(e,r,t)=>(t=e!=null?Pe(Fe(e)):{},Ge(r||!e||!e.__esModule?Q(t,"default",{value:e,enumerable:!0}):t,e));var b=(e,r,t)=>(Me(e,typeof r!="symbol"?r+"":r,t),t);var a=We(()=>{});var Oe=He((Uo,ke)=>{a();var Gr=Object.prototype.toString,Vr=Object.keys||function(e){var r=[];for(var t in e)r.push(t);return r};function D(e,r){var t,n,o,s,i,c,u;if(e===!0)return "true";if(e===!1)return "false";switch(typeof e){case"object":if(e===null)return null;if(e.toJSON&&typeof e.toJSON=="function")return D(e.toJSON(),r);if(u=Gr.call(e),u==="[object Array]"){for(o="[",n=e.length-1,t=0;t<n;t++)o+=D(e[t],!0)+",";return n>-1&&(o+=D(e[t],!0)),o+"]"}else if(u==="[object Object]"){for(s=Vr(e).sort(),n=s.length,o="",t=0;t<n;)i=s[t],c=D(e[i],!1),c!==void 0&&(o&&(o+=","),o+=JSON.stringify(i)+":"+c),t++;return "{"+o+"}"}else return JSON.stringify(e);case"function":case"undefined":return r?null:void 0;case"string":return JSON.stringify(e);default:return isFinite(e)?e:null}}ke.exports=function(e){var r=D(e,!1);if(r!==void 0)return ""+r};});a();a();var qe=(e=>(e[e.WRITABLE_SIGNER=3]="WRITABLE_SIGNER",e[e.READONLY_SIGNER=2]="READONLY_SIGNER",e[e.WRITABLE=1]="WRITABLE",e[e.READONLY=0]="READONLY",e))(qe||{}),ce=2,ee=1;function Zr(e){return e&~ce}function Qr(e){return e&~ee}function et(e){return e>=2}function rt(e){return (e&ee)!==0}function tt(e,r){return e|r}function nt(e){return e|ce}function ot(e){return e|ee}a();a();a();a();var E=e=>{let r=e.reduce((o,s)=>o+s.length,0),t=new Uint8Array(r),n=0;return e.forEach(o=>{t.set(o,n),n+=o.length;}),t},ue=(e,r)=>{if(e.length>=r)return e;let t=new Uint8Array(r).fill(0);return t.set(e),t},P=(e,r)=>ue(e.slice(0,r),r);a();var w=class extends Error{constructor(t){super(`Serializer [${t}] cannot deserialize empty buffers.`);b(this,"name","DeserializingEmptyBufferError");}},y=class extends Error{constructor(t,n,o){super(`Serializer [${t}] expected ${n} bytes, got ${o}.`);b(this,"name","NotEnoughBytesError");}},I=class extends Error{constructor(t){t??(t="Expected a fixed-size serializer, got a variable-size one.");super(t);b(this,"name","ExpectedFixedSizeSerializerError");}};a();function B(e,r,t){return {description:t??`fixed(${r}, ${e.description})`,fixedSize:r,maxSize:r,serialize:n=>P(e.serialize(n),r),deserialize:(n,o=0)=>{if(n=n.slice(o,o+r),n.length<r)throw new y("fixSerializer",r,n.length);e.fixedSize!==null&&(n=P(n,e.fixedSize));let[s]=e.deserialize(n,0);return [s,o+r]}}}a();function U(e,r,t){return {description:e.description,fixedSize:e.fixedSize,maxSize:e.maxSize,serialize:n=>e.serialize(r(n)),deserialize:(n,o=0)=>{let[s,i]=e.deserialize(n,o);return t?[t(s,n,o),i]:[s,i]}}}a();a();a();var j=class extends Error{constructor(t,n,o){let s=`Expected a string of base ${n}, got [${t}].`;super(s);b(this,"name","InvalidBaseStringError");this.cause=o;}};var le=e=>{let r=e.length,t=BigInt(r);return {description:`base${r}`,fixedSize:null,maxSize:null,serialize(n){if(!n.match(new RegExp(`^[${e}]*$`)))throw new j(n,r);if(n==="")return new Uint8Array;let o=[...n],s=o.findIndex(h=>h!==e[0]);s=s===-1?o.length:s;let i=Array(s).fill(0);if(s===o.length)return Uint8Array.from(i);let c=o.slice(s),u=0n,l=1n;for(let h=c.length-1;h>=0;h-=1)u+=l*BigInt(e.indexOf(c[h])),l*=t;let p=[];for(;u>0n;)p.unshift(Number(u%256n)),u/=256n;return Uint8Array.from(i.concat(p))},deserialize(n,o=0){if(n.length===0)return ["",0];let s=n.slice(o),i=s.findIndex(p=>p!==0);i=i===-1?s.length:i;let c=e[0].repeat(i);if(i===s.length)return [c,n.length];let u=s.slice(i).reduce((p,h)=>p*256n+BigInt(h),0n),l=[];for(;u>0n;)l.unshift(e[Number(u%t)]),u/=t;return [c+l.join(""),n.length]}}};a();var R=le("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz");a();var de=e=>e.replace(/\u0000/g,"");a();var re={description:"utf8",fixedSize:null,maxSize:null,serialize(e){return new TextEncoder().encode(e)},deserialize(e,r=0){let t=new TextDecoder().decode(e.slice(r));return [de(t),e.length]}};a();a();var F;(function(e){e.Little="le",e.Big="be";})(F||(F={}));a();var K=class extends RangeError{constructor(t,n,o,s){super(`Serializer [${t}] expected number to be between ${n} and ${o}, got ${s}.`);b(this,"name","NumberOutOfRangeError");}};a();function M(e){let r,t=e.name;return e.size>1&&(r=!("endian"in e.options)||e.options.endian===F.Little,t+=r?"(le)":"(be)"),{description:e.options.description??t,fixedSize:e.size,maxSize:e.size,serialize(n){e.range&&te(e.name,e.range[0],e.range[1],n);let o=new ArrayBuffer(e.size);return e.set(new DataView(o),n,r),new Uint8Array(o)},deserialize(n,o=0){let s=n.slice(o,o+e.size);Xe("i8",s,e.size);let i=Je(s);return [e.get(i,r),o+e.size]}}}var Ye=e=>e.buffer.slice(e.byteOffset,e.byteLength+e.byteOffset),Je=e=>new DataView(Ye(e)),te=(e,r,t,n)=>{if(n<r||n>t)throw new K(e,r,t,n)},Xe=(e,r,t)=>{if(r.length===0)throw new w(e);if(r.length<t)throw new y(e,t,r.length)};a();var z=(e={})=>M({name:"u8",size:1,range:[0,+"0xff"],set:(r,t)=>r.setUint8(0,Number(t)),get:r=>r.getUint8(0),options:e});a();var k=(e={})=>M({name:"u32",size:4,range:[0,+"0xffffffff"],set:(r,t,n)=>r.setUint32(0,Number(t),n),get:(r,t)=>r.getUint32(0,t),options:e});a();var S=(e={})=>({description:e.description??"shortU16",fixedSize:null,maxSize:3,serialize:r=>{te("shortU16",0,65535,r);let t=[0];for(let n=0;;n+=1){let o=r>>n*7;if(o===0)break;let s=127&o;t[n]=s,n>0&&(t[n-1]|=128);}return new Uint8Array(t)},deserialize:(r,t=0)=>{let n=0,o=0;for(;++o;){let s=o-1,i=r[t+s],c=127&i;if(n|=c<<s*7,!(i&128))break}return [n,t+o]}});a();a();var W=class extends Error{constructor(t,n,o){super(`Expected [${t}] to have ${n} items, got ${o}.`);b(this,"name","InvalidNumberOfItemsError");}},H=class extends Error{constructor(t,n){super(`The remainder of the buffer (${t} bytes) cannot be split into chunks of ${n} bytes. Serializers of "remainder" size must have a remainder that is a multiple of its item size. In other words, ${t} modulo ${n} should be equal to zero.`);b(this,"name","InvalidArrayLikeRemainderSizeError");}},G=class extends Error{constructor(t){super(`Unrecognized array-like serializer size: ${JSON.stringify(t)}`);b(this,"name","UnrecognizedArrayLikeSerializerSizeError");}};a();a();function v(e){return e.reduce((r,t)=>r===null||t===null?null:r+t,0)}function pe(e,r,t,n){if(typeof e=="number")return [e,n];if(typeof e=="object")return e.deserialize(t,n);if(e==="remainder"){let o=v(r);if(o===null)throw new I('Serializers of "remainder" size must have fixed-size items.');let s=t.slice(n).length;if(s%o!==0)throw new H(s,o);return [s/o,n]}throw new G(e)}function C(e){return typeof e=="object"?e.description:`${e}`}function ne(e,r){if(typeof e!="number")return null;if(e===0)return 0;let t=v(r);return t===null?null:t*e}function fe(e,r){return typeof e=="object"?e.serialize(r):new Uint8Array}function A(e,r={}){let t=r.size??k();if(t==="remainder"&&e.fixedSize===null)throw new I('Serializers of "remainder" size must have fixed-size items.');return {description:r.description??`array(${e.description}; ${C(t)})`,fixedSize:ne(t,[e.fixedSize]),maxSize:ne(t,[e.maxSize]),serialize:n=>{if(typeof t=="number"&&n.length!==t)throw new W("array",t,n.length);return E([fe(t,n.length),...n.map(o=>e.serialize(o))])},deserialize:(n,o=0)=>{if(typeof t=="object"&&n.slice(o).length===0)return [[],o];let[s,i]=pe(t,[e.fixedSize],n,o);o=i;let c=[];for(let u=0;u<s;u+=1){let[l,p]=e.deserialize(n,o);c.push(l),o=p;}return [c,o]}}}a();function V(e={}){let r=e.size??"variable",t=e.description??`bytes(${C(r)})`,n={description:t,fixedSize:null,maxSize:null,serialize:o=>new Uint8Array(o),deserialize:(o,s=0)=>{let i=o.slice(s);return [i,s+i.length]}};return r==="variable"?n:typeof r=="number"?B(n,r,t):{description:t,fixedSize:null,maxSize:null,serialize:o=>{let s=n.serialize(o),i=r.serialize(s.length);return E([i,s])},deserialize:(o,s=0)=>{if(o.slice(s).length===0)throw new w("bytes");let[i,c]=r.deserialize(o,s),u=Number(i);s=c;let l=o.slice(s,s+u);if(l.length<u)throw new y("bytes",u,l.length);let[p,h]=n.deserialize(l);return s+=h,[p,s]}}}a();function O(e={}){let r=e.size??k(),t=e.encoding??re,n=e.description??`string(${t.description}; ${C(r)})`;return r==="variable"?{...t,description:n}:typeof r=="number"?B(t,r,n):{description:n,fixedSize:null,maxSize:null,serialize:o=>{let s=t.serialize(o),i=r.serialize(s.length);return E([i,s])},deserialize:(o,s=0)=>{if(o.slice(s).length===0)throw new w("string");let[i,c]=r.deserialize(o,s),u=Number(i);s=c;let l=o.slice(s,s+u);if(l.length<u)throw new y("string",u,l.length);let[p,h]=t.deserialize(l);return s+=h,[p,s]}}}a();function T(e,r={}){let t=e.map(([n,o])=>`${String(n)}: ${o.description}`).join(", ");return {description:r.description??`struct(${t})`,fixedSize:v(e.map(([,n])=>n.fixedSize)),maxSize:v(e.map(([,n])=>n.maxSize)),serialize:n=>{let o=e.map(([s,i])=>i.serialize(n[s]));return E(o)},deserialize:(n,o=0)=>{let s={};return e.forEach(([i,c])=>{let[u,l]=c.deserialize(n,o);o=l,s[i]=u;}),[s,o]}}}function Qn(e){try{if(e.length<32||e.length>44)throw new Error("Expected input string to decode to a byte array of length 32.");let t=R.serialize(e).byteLength;if(t!==32)throw new Error(`Expected input string to decode to a byte array of length 32. Actual length: ${t}`)}catch(r){throw new Error(`\`${e}\` is not a base-58 encoded address`,{cause:r})}}function q(e){return O({description:e?.description??(""),encoding:R,size:32})}function Y(){return new Intl.Collator("en",{caseFirst:"lower",ignorePunctuation:!1,localeMatcher:"best fit",numeric:!1,sensitivity:"variant",usage:"sort"}).compare}function J(){if(!globalThis.isSecureContext)throw new Error("Cryptographic operations are only allowed in secure browser contexts. Read more here: https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts")}var N;async function Qe(e){return N===void 0&&(N=new Promise(r=>{e.generateKey("Ed25519",!1,["sign","verify"]).catch(()=>{r(N=!1);}).then(()=>{r(N=!0);});})),typeof N=="boolean"?N:await N}async function er(){if(J(),typeof globalThis.crypto>"u"||typeof globalThis.crypto.subtle?.generateKey!="function")throw new Error("No key generation implementation could be found");if(!await Qe(globalThis.crypto.subtle))throw new Error(`This runtime does not support the generation of Ed25519 key pairs.
|
|
5
|
+
var xt=Object.create;var me=Object.defineProperty;var It=Object.getOwnPropertyDescriptor;var At=Object.getOwnPropertyNames;var Tt=Object.getPrototypeOf,Rt=Object.prototype.hasOwnProperty;var zt=(e,t,r)=>t in e?me(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var _t=(e,t)=>()=>(e&&(t=e(e=0)),t);var Ct=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var vt=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of At(t))!Rt.call(e,o)&&o!==r&&me(e,o,{get:()=>t[o],enumerable:!(n=It(t,o))||n.enumerable});return e};var ve=(e,t,r)=>(r=e!=null?xt(Tt(e)):{},vt(t||!e||!e.__esModule?me(r,"default",{value:e,enumerable:!0}):r,e));var A=(e,t,r)=>(zt(e,typeof t!="symbol"?t+"":t,r),r);var c=_t(()=>{});var Re=Ct((Os,ft)=>{c();var Dr=Object.prototype.toString,$r=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};function Z(e,t){var r,n,o,s,i,a,u;if(e===!0)return "true";if(e===!1)return "false";switch(typeof e){case"object":if(e===null)return null;if(e.toJSON&&typeof e.toJSON=="function")return Z(e.toJSON(),t);if(u=Dr.call(e),u==="[object Array]"){for(o="[",n=e.length-1,r=0;r<n;r++)o+=Z(e[r],!0)+",";return n>-1&&(o+=Z(e[r],!0)),o+"]"}else if(u==="[object Object]"){for(s=$r(e).sort(),n=s.length,o="",r=0;r<n;)i=s[r],a=Z(e[i],!1),a!==void 0&&(o&&(o+=","),o+=JSON.stringify(i)+":"+a),r++;return "{"+o+"}"}else return JSON.stringify(e);case"function":case"undefined":return t?null:void 0;case"string":return JSON.stringify(e);default:return isFinite(e)?e:null}}ft.exports=function(e){var t=Z(e,!1);if(t!==void 0)return ""+t};});c();c();c();c();c();var v=e=>{let t=e.reduce((o,s)=>o+s.length,0),r=new Uint8Array(t),n=0;return e.forEach(o=>{r.set(o,n),n+=o.length;}),r},ke=(e,t)=>{if(e.length>=t)return e;let r=new Uint8Array(t).fill(0);return r.set(e),r},Q=(e,t)=>ke(e.slice(0,t),t);c();var k=class extends Error{constructor(r){super(`Serializer [${r}] cannot deserialize empty buffers.`);A(this,"name","DeserializingEmptyBufferError");}},R=class extends Error{constructor(r,n,o){super(`Serializer [${r}] expected ${n} bytes, got ${o}.`);A(this,"name","NotEnoughBytesError");}},D=class extends Error{constructor(r){r??(r="Expected a fixed-size serializer, got a variable-size one.");super(r);A(this,"name","ExpectedFixedSizeSerializerError");}};c();function j(e,t,r){return {description:r??`fixed(${t}, ${e.description})`,fixedSize:t,maxSize:t,serialize:n=>Q(e.serialize(n),t),deserialize:(n,o=0)=>{if(n=n.slice(o,o+t),n.length<t)throw new R("fixSerializer",t,n.length);e.fixedSize!==null&&(n=Q(n,e.fixedSize));let[s]=e.deserialize(n,0);return [s,o+t]}}}c();function ee(e,t,r){return {description:e.description,fixedSize:e.fixedSize,maxSize:e.maxSize,serialize:n=>e.serialize(t(n)),deserialize:(n,o=0)=>{let[s,i]=e.deserialize(n,o);return r?[r(s,n,o),i]:[s,i]}}}c();c();c();var te=class extends Error{constructor(r,n,o){let s=`Expected a string of base ${n}, got [${r}].`;super(s);A(this,"name","InvalidBaseStringError");this.cause=o;}};var Ne=e=>{let t=e.length,r=BigInt(t);return {description:`base${t}`,fixedSize:null,maxSize:null,serialize(n){if(!n.match(new RegExp(`^[${e}]*$`)))throw new te(n,t);if(n==="")return new Uint8Array;let o=[...n],s=o.findIndex(f=>f!==e[0]);s=s===-1?o.length:s;let i=Array(s).fill(0);if(s===o.length)return Uint8Array.from(i);let a=o.slice(s),u=0n,l=1n;for(let f=a.length-1;f>=0;f-=1)u+=l*BigInt(e.indexOf(a[f])),l*=r;let p=[];for(;u>0n;)p.unshift(Number(u%256n)),u/=256n;return Uint8Array.from(i.concat(p))},deserialize(n,o=0){if(n.length===0)return ["",0];let s=n.slice(o),i=s.findIndex(p=>p!==0);i=i===-1?s.length:i;let a=e[0].repeat(i);if(i===s.length)return [a,n.length];let u=s.slice(i).reduce((p,f)=>p*256n+BigInt(f),0n),l=[];for(;u>0n;)l.unshift(e[Number(u%r)]),u/=r;return [a+l.join(""),n.length]}}};c();var B=Ne("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz");c();var Oe=e=>e.replace(/\u0000/g,"");c();var ge={description:"utf8",fixedSize:null,maxSize:null,serialize(e){return new TextEncoder().encode(e)},deserialize(e,t=0){let r=new TextDecoder().decode(e.slice(t));return [Oe(r),e.length]}};c();c();var re;(function(e){e.Little="le",e.Big="be";})(re||(re={}));c();var ne=class extends RangeError{constructor(r,n,o,s){super(`Serializer [${r}] expected number to be between ${n} and ${o}, got ${s}.`);A(this,"name","NumberOutOfRangeError");}};c();function oe(e){let t,r=e.name;return e.size>1&&(t=!("endian"in e.options)||e.options.endian===re.Little,r+=t?"(le)":"(be)"),{description:e.options.description??r,fixedSize:e.size,maxSize:e.size,serialize(n){e.range&&be(e.name,e.range[0],e.range[1],n);let o=new ArrayBuffer(e.size);return e.set(new DataView(o),n,t),new Uint8Array(o)},deserialize(n,o=0){let s=n.slice(o,o+e.size);Ot("i8",s,e.size);let i=Nt(s);return [e.get(i,t),o+e.size]}}}var kt=e=>e.buffer.slice(e.byteOffset,e.byteLength+e.byteOffset),Nt=e=>new DataView(kt(e)),be=(e,t,r,n)=>{if(n<t||n>r)throw new ne(e,t,r,n)},Ot=(e,t,r)=>{if(t.length===0)throw new k(e);if(t.length<r)throw new R(e,r,t.length)};c();var N=(e={})=>oe({name:"u8",size:1,range:[0,+"0xff"],set:(t,r)=>t.setUint8(0,Number(r)),get:t=>t.getUint8(0),options:e});c();var H=(e={})=>oe({name:"u32",size:4,range:[0,+"0xffffffff"],set:(t,r,n)=>t.setUint32(0,Number(r),n),get:(t,r)=>t.getUint32(0,r),options:e});c();var _=(e={})=>({description:e.description??"shortU16",fixedSize:null,maxSize:3,serialize:t=>{be("shortU16",0,65535,t);let r=[0];for(let n=0;;n+=1){let o=t>>n*7;if(o===0)break;let s=127&o;r[n]=s,n>0&&(r[n-1]|=128);}return new Uint8Array(r)},deserialize:(t,r=0)=>{let n=0,o=0;for(;++o;){let s=o-1,i=t[r+s],a=127&i;if(n|=a<<s*7,!(i&128))break}return [n,r+o]}});c();c();var se=class extends Error{constructor(r,n,o){super(`Expected [${r}] to have ${n} items, got ${o}.`);A(this,"name","InvalidNumberOfItemsError");}},ie=class extends Error{constructor(r,n){super(`The remainder of the buffer (${r} bytes) cannot be split into chunks of ${n} bytes. Serializers of "remainder" size must have a remainder that is a multiple of its item size. In other words, ${r} modulo ${n} should be equal to zero.`);A(this,"name","InvalidArrayLikeRemainderSizeError");}},ae=class extends Error{constructor(r){super(`Unrecognized array-like serializer size: ${JSON.stringify(r)}`);A(this,"name","UnrecognizedArrayLikeSerializerSizeError");}};c();c();function W(e){return e.reduce((t,r)=>t===null||r===null?null:t+r,0)}function Le(e,t,r,n){if(typeof e=="number")return [e,n];if(typeof e=="object")return e.deserialize(r,n);if(e==="remainder"){let o=W(t);if(o===null)throw new D('Serializers of "remainder" size must have fixed-size items.');let s=r.slice(n).length;if(s%o!==0)throw new ie(s,o);return [s/o,n]}throw new ae(e)}function M(e){return typeof e=="object"?e.description:`${e}`}function he(e,t){if(typeof e!="number")return null;if(e===0)return 0;let r=W(t);return r===null?null:r*e}function Be(e,t){return typeof e=="object"?e.serialize(t):new Uint8Array}function O(e,t={}){let r=t.size??H();if(r==="remainder"&&e.fixedSize===null)throw new D('Serializers of "remainder" size must have fixed-size items.');return {description:t.description??`array(${e.description}; ${M(r)})`,fixedSize:he(r,[e.fixedSize]),maxSize:he(r,[e.maxSize]),serialize:n=>{if(typeof r=="number"&&n.length!==r)throw new se("array",r,n.length);return v([Be(r,n.length),...n.map(o=>e.serialize(o))])},deserialize:(n,o=0)=>{if(typeof r=="object"&&n.slice(o).length===0)return [[],o];let[s,i]=Le(r,[e.fixedSize],n,o);o=i;let a=[];for(let u=0;u<s;u+=1){let[l,p]=e.deserialize(n,o);a.push(l),o=p;}return [a,o]}}}c();function ce(e={}){let t=e.size??"variable",r=e.description??`bytes(${M(t)})`,n={description:r,fixedSize:null,maxSize:null,serialize:o=>new Uint8Array(o),deserialize:(o,s=0)=>{let i=o.slice(s);return [i,s+i.length]}};return t==="variable"?n:typeof t=="number"?j(n,t,r):{description:r,fixedSize:null,maxSize:null,serialize:o=>{let s=n.serialize(o),i=t.serialize(s.length);return v([i,s])},deserialize:(o,s=0)=>{if(o.slice(s).length===0)throw new k("bytes");let[i,a]=t.deserialize(o,s),u=Number(i);s=a;let l=o.slice(s,s+u);if(l.length<u)throw new R("bytes",u,l.length);let[p,f]=n.deserialize(l);return s+=f,[p,s]}}}c();function G(e={}){let t=e.size??H(),r=e.encoding??ge,n=e.description??`string(${r.description}; ${M(t)})`;return t==="variable"?{...r,description:n}:typeof t=="number"?j(r,t,n):{description:n,fixedSize:null,maxSize:null,serialize:o=>{let s=r.serialize(o),i=t.serialize(s.length);return v([i,s])},deserialize:(o,s=0)=>{if(o.slice(s).length===0)throw new k("string");let[i,a]=t.deserialize(o,s),u=Number(i);s=a;let l=o.slice(s,s+u);if(l.length<u)throw new R("string",u,l.length);let[p,f]=r.deserialize(l);return s+=f,[p,s]}}}c();function P(e,t={}){let r=e.map(([n,o])=>`${String(n)}: ${o.description}`).join(", ");return {description:t.description??`struct(${r})`,fixedSize:W(e.map(([,n])=>n.fixedSize)),maxSize:W(e.map(([,n])=>n.maxSize)),serialize:n=>{let o=e.map(([s,i])=>i.serialize(n[s]));return v(o)},deserialize:(n,o=0)=>{let s={};return e.forEach(([i,a])=>{let[u,l]=a.deserialize(n,o);o=l,s[i]=u;}),[s,o]}}}c();function V(){if(!globalThis.isSecureContext)throw new Error("Cryptographic operations are only allowed in secure browser contexts. Read more here: https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts")}var $;async function Lt(e){return $===void 0&&($=new Promise(t=>{e.generateKey("Ed25519",!1,["sign","verify"]).catch(()=>{t($=!1);}).then(()=>{t($=!0);});})),typeof $=="boolean"?$:await $}async function Pe(){if(V(),typeof globalThis.crypto>"u"||typeof globalThis.crypto.subtle?.digest!="function")throw new Error("No digest implementation could be found")}async function De(){if(V(),typeof globalThis.crypto>"u"||typeof globalThis.crypto.subtle?.generateKey!="function")throw new Error("No key generation implementation could be found");if(!await Lt(globalThis.crypto.subtle))throw new Error(`This runtime does not support the generation of Ed25519 key pairs.
|
|
6
6
|
|
|
7
7
|
Install and import \`@solana/webcrypto-ed25519-polyfill\` before generating keys in environments that do not support Ed25519.
|
|
8
8
|
|
|
9
|
-
For a list of runtimes that currently support Ed25519 operations, visit https://github.com/WICG/webcrypto-secure-curves/issues/20`)}async function rr(){if(J(),typeof globalThis.crypto>"u"||typeof globalThis.crypto.subtle?.exportKey!="function")throw new Error("No key export implementation could be found")}async function tr(){if(J(),typeof globalThis.crypto>"u"||typeof globalThis.crypto.subtle?.sign!="function")throw new Error("No signing implementation could be found")}async function nr(){if(J(),typeof globalThis.crypto>"u"||typeof globalThis.crypto.subtle?.verify!="function")throw new Error("No signature verification implementation could be found")}async function eo(){return await er(),await crypto.subtle.generateKey("Ed25519",!1,["sign","verify"])}async function me(e){if(await rr(),e.type!=="public"||e.algorithm.name!=="Ed25519")throw new Error("The `CryptoKey` must be an `Ed25519` public key");let r=await crypto.subtle.exportKey("raw",e),[t]=q().deserialize(new Uint8Array(r));return t}async function ge(e,r){await tr();let t=await crypto.subtle.sign("Ed25519",e,r);return new Uint8Array(t)}async function ro(e,r,t){return await nr(),await crypto.subtle.verify("Ed25519",e,r,t)}a();function $(e){if("signatures"in e){let{signatures:r,...t}=e;return t}else return e}function io(e){try{if(e.length<32||e.length>44)throw new Error("Expected input string to decode to a byte array of length 32.");let t=R.serialize(e).byteLength;if(t!==32)throw new Error(`Expected input string to decode to a byte array of length 32. Actual length: ${t}`)}catch(r){throw new Error(`\`${e}\` is not a blockhash`,{cause:r})}}function ao(e,r){if("lifetimeConstraint"in r&&r.lifetimeConstraint.blockhash===e.blockhash&&r.lifetimeConstraint.lastValidBlockHeight===e.lastValidBlockHeight)return r;let t={...$(r),lifetimeConstraint:e};return Object.freeze(t),t}function co({version:e}){let r={instructions:[],version:e};return Object.freeze(r),r}var x=(e=>(e[e.WRITABLE_SIGNER=3]="WRITABLE_SIGNER",e[e.READONLY_SIGNER=2]="READONLY_SIGNER",e[e.WRITABLE=1]="WRITABLE",e[e.READONLY=0]="READONLY",e))(x||{}),or=1;function L(e){return e>=2}function _(e){return (e&or)!==0}function he(e,r){return e|r}var xe="SysvarRecentB1ockHashes11111111111111111111",Se="11111111111111111111111111111111";function uo(e){if(!Ee(e))throw new Error("Transaction is not a durable nonce transaction")}function sr(e,r){return {accounts:[{address:e,role:x.WRITABLE},{address:xe,role:x.READONLY},{address:r,role:x.READONLY_SIGNER}],data:new Uint8Array([4,0,0,0]),programAddress:Se}}function ir(e){return e.programAddress===Se&&e.data!=null&&ar(e.data)&&e.accounts?.length===3&&e.accounts[0].address!=null&&e.accounts[0].role===x.WRITABLE&&e.accounts[1].address===xe&&e.accounts[1].role===x.READONLY&&e.accounts[2].address!=null&&e.accounts[2].role===x.READONLY_SIGNER}function ar(e){return e.byteLength===4&&e[0]===4&&e[1]===0&&e[2]===0&&e[3]===0}function Ee(e){return "lifetimeConstraint"in e&&typeof e.lifetimeConstraint.nonce=="string"&&e.instructions[0]!=null&&ir(e.instructions[0])}function lo({nonce:e,nonceAccountAddress:r,nonceAuthorityAddress:t},n){let o=Ee(n);if(o&&n.lifetimeConstraint.nonce===e&&n.instructions[0].accounts[0].address===r&&n.instructions[0].accounts[2].address===t)return n;let s={...$(n),instructions:[sr(r,t),...o?n.instructions.slice(1):n.instructions],lifetimeConstraint:{nonce:e}};return Object.freeze(s),s}function po(e,r){if("feePayer"in r&&e===r.feePayer)return r;let t={...$(r),feePayer:e};return Object.freeze(t),t}function fo(e,r){let t={...$(r),instructions:[...r.instructions,e]};return Object.freeze(t),t}function mo(e,r){let t={...$(r),instructions:[e,...r.instructions]};return Object.freeze(t),t}function be(e,r,t){e[r]=t(e[r]??{role:x.READONLY});}var m=Symbol("AddressMapTypeProperty");function cr(e,r){let t={[e]:{[m]:0,role:x.WRITABLE_SIGNER}},n=new Set;for(let o of r){be(t,o.programAddress,i=>{if(n.add(o.programAddress),m in i){if(_(i.role))switch(i[m]){case 0:throw new Error(`This transaction includes an address (\`${o.programAddress}\`) which is both invoked and set as the fee payer. Program addresses may not pay fees.`);default:throw new Error(`This transaction includes an address (\`${o.programAddress}\`) which is both invoked and marked writable. Program addresses may not be writable.`)}if(i[m]===2)return i}return {[m]:2,role:x.READONLY}});let s;if(o.accounts)for(let i of o.accounts)be(t,i.address,c=>{let{address:u,...l}=i;if(m in c)switch(c[m]){case 0:return c;case 1:{let p=he(c.role,l.role);if("lookupTableAddress"in l){if(c.lookupTableAddress!==l.lookupTableAddress&&(s||(s=Y()))(l.lookupTableAddress,c.lookupTableAddress)<0)return {[m]:1,...l,role:p}}else if(L(l.role))return {[m]:2,role:p};return c.role!==p?{...c,role:p}:c}case 2:{let p=he(c.role,l.role);if(n.has(i.address)){if(_(l.role))throw new Error(`This transaction includes an address (\`${i.address}\`) which is both invoked and marked writable. Program addresses may not be writable.`);return c.role!==p?{...c,role:p}:c}else return "lookupTableAddress"in l&&!L(c.role)?{...l,[m]:1,role:p}:c.role!==p?{...c,role:p}:c}}return "lookupTableAddress"in l?{...l,[m]:1}:{...l,[m]:2}});}return t}function ur(e){let r;return Object.entries(e).sort(([n,o],[s,i])=>{if(o[m]!==i[m]){if(o[m]===0)return -1;if(i[m]===0)return 1;if(o[m]===2)return -1;if(i[m]===2)return 1}let c=L(o.role);if(c!==L(i.role))return c?-1:1;let u=_(o.role);return u!==_(i.role)?u?-1:1:(r||(r=Y()),o[m]===1&&i[m]===1&&o.lookupTableAddress!==i.lookupTableAddress?r(o.lookupTableAddress,i.lookupTableAddress):r(n,s))}).map(([n,o])=>({address:n,...o}))}function lr(e){var r;let t={};for(let n of e){if(!("lookupTableAddress"in n))continue;let o=t[r=n.lookupTableAddress]||(t[r]={readableIndices:[],writableIndices:[]});n.role===x.WRITABLE?o.writableIndices.push(n.addressIndex):o.readableIndices.push(n.addressIndex);}return Object.keys(t).sort(Y()).map(n=>({lookupTableAddress:n,...t[n]}))}function dr(e){let r=0,t=0,n=0;for(let o of e){if("lookupTableAddress"in o)break;let s=_(o.role);L(o.role)?(n++,s||t++):s||r++;}return {numReadonlyNonSignerAccounts:r,numReadonlySignerAccounts:t,numSignerAccounts:n}}function pr(e){let r={};for(let[t,n]of e.entries())r[n.address]=t;return r}function fr(e,r){let t=pr(r);return e.map(({accounts:n,data:o,programAddress:s})=>({programAddressIndex:t[s],...n?{accountIndices:n.map(({address:i})=>t[i])}:null,...o?{data:o}:null}))}function mr(e){return "nonce"in e?e.nonce:e.blockhash}function gr(e){let r=e.findIndex(n=>"lookupTableAddress"in n);return (r===-1?e:e.slice(0,r)).map(({address:n})=>n)}function we(e){let r=cr(e.feePayer,e.instructions),t=ur(r);return {...e.version!=="legacy"?{addressTableLookups:lr(t)}:null,header:dr(t),instructions:fr(e.instructions,t),lifetimeToken:mr(e.lifetimeConstraint),staticAccounts:gr(t),version:e.version}}function hr(){return T([["lookupTableAddress",q(void 0)],["writableIndices",A(z(),{...null,size:S()})],["readableIndices",A(z(),{...void 0,size:S()})]],void 0)}function br(){return T([["numSignerAccounts",z(void 0)],["numReadonlySignerAccounts",z(void 0)],["numReadonlyNonSignerAccounts",z(void 0)]],void 0)}function yr(){return U(T([["programAddressIndex",z(void 0)],["addressIndices",A(z({description:""}),{description:"",size:S()})],["data",V({description:"",size:S()})]]),e=>e.addressIndices!==void 0&&e.data!==void 0?e:{...e,addressIndices:e.addressIndices??[],data:e.data??new Uint8Array(0)},e=>{if(e.addressIndices.length&&e.data.byteLength)return e;let{addressIndices:r,data:t,...n}=e;return {...n,...r.length?{addressIndices:r}:null,...t.byteLength?{data:t}:null}})}function xr(e,r){let t=r+e[0].toUpperCase()+e.slice(1);return new Error(`No ${e} exists for ${r}. Use \`get${t}()\` if you need a ${e}, and \`get${r}Codec()\` if you need to both encode and decode ${r}`)}function ze(e){return ()=>{throw xr("decoder",e)}}var oe=128,Sr={description:"",fixedSize:null,maxSize:1};function Er(e,r=0){let t=e[r];return t&oe?[t^oe,r+1]:["legacy",r]}function wr(e){if(e==="legacy")return new Uint8Array;if(e<0||e>127)throw new Error(`Transaction version must be in the range [0, 127]. \`${e}\` given.`);return new Uint8Array([e|oe])}function zr(){return {...Sr,deserialize:Er,serialize:wr}}var Ar={description:"",fixedSize:null,maxSize:null};function Tr(e){return e.version==="legacy"?T(ye()).serialize(e):U(T([...ye(),["addressTableLookups",Ir()]]),r=>r.version==="legacy"?r:{...r,addressTableLookups:r.addressTableLookups??[]}).serialize(e)}function ye(){return [["version",zr()],["header",br()],["staticAccounts",A(q(),{description:"",size:S()})],["lifetimeToken",O({description:"",encoding:R,size:32})],["instructions",A(yr(),{description:"",size:S()})]]}function Ir(){return A(hr(),{...null,size:S()})}function Ae(){return {...Ar,deserialize:ze("CompiledMessage"),serialize:Tr}}async function Rr(e,r){let t=Ae().serialize(e);return await ge(r,t)}async function go(e,r){let t=we(r),[n,o]=await Promise.all([me(e.publicKey),Rr(t,e.privateKey)]),s={..."signatures"in r?r.signatures:null,[n]:o},i={...r,signatures:s};return Object.freeze(i),i}function Nr(e){let r=we(e),t;if("signatures"in e){t=[];for(let n=0;n<r.header.numSignerAccounts;n++)t[n]=e.signatures[r.staticAccounts[n]]??new Uint8Array(Array(64).fill(0));}else t=Array(r.header.numSignerAccounts).fill(new Uint8Array(Array(64).fill(0)));return {compiledMessage:r,signatures:t}}var vr={description:"",fixedSize:null,maxSize:null};function Cr(e){let r=Nr(e);return T([["signatures",A(V({size:64}),{...null,size:S()})],["compiledMessage",Ae()]]).serialize(r)}function Br(){return {...vr,deserialize:ze("CompiledMessage"),serialize:Cr}}function ho(e){let r=Br().serialize(e);return btoa(String.fromCharCode(...r))}a();a();function se(e,r,t){if(Array.isArray(e))return e.map((n,o)=>se(n,[...r,o],t));if(typeof e=="object"&&e!==null){let n={};for(let o in e)Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=se(e[o],[...r,o],t));return n}else return typeof e=="bigint"?(t&&(e>Number.MAX_SAFE_INTEGER||e<-Number.MAX_SAFE_INTEGER)&&t(r,e),Number(e)):e}function kr(e,r){return se(e,[],r)}var f={},Or={getAccountInfo:[["value","data","parsed","info","lastExtendedSlotStartIndex"],["value","data","parsed","info","slashPenalty"],["value","data","parsed","info","warmupCooldownRate"],["value","data","parsed","info","tokenAmount","decimals"],["value","data","parsed","info","tokenAmount","uiAmount"],["value","data","parsed","info","rentExemptReserve","decimals"],["value","data","parsed","info","delegatedAmount","decimals"],["value","data","parsed","info","extensions",f,"state","olderTransferFee","transferFeeBasisPoints"],["value","data","parsed","info","extensions",f,"state","newerTransferFee","transferFeeBasisPoints"],["value","data","parsed","info","extensions",f,"state","preUpdateAverageRate"],["value","data","parsed","info","extensions",f,"state","currentRate"],["value","data","parsed","info","decimals"],["value","data","parsed","info","numRequiredSigners"],["value","data","parsed","info","numValidSigners"],["value","data","parsed","info","stake","delegation","warmupCooldownRate"],["value","data","parsed","info","exemptionThreshold"],["value","data","parsed","info","burnPercent"],["value","data","parsed","info","commission"],["value","data","parsed","info","votes",f,"confirmationCount"]],getBlockTime:[[]],getInflationReward:[[f,"commission"]],getRecentPerformanceSamples:[[f,"samplePeriodSecs"]],getTokenLargestAccounts:[["value",f,"decimals"],["value",f,"uiAmount"]],getTransaction:[["meta","preTokenBalances",f,"accountIndex"],["meta","preTokenBalances",f,"uiTokenAmount","decimals"],["meta","postTokenBalances",f,"accountIndex"],["meta","postTokenBalances",f,"uiTokenAmount","decimals"],["meta","rewards",f,"commission"],["meta","innerInstructions",f,"index"],["meta","innerInstructions",f,"instructions",f,"programIdIndex"],["meta","innerInstructions",f,"instructions",f,"accounts",f],["transaction","message","addressTableLookups",f,"writableIndexes",f],["transaction","message","addressTableLookups",f,"readonlyIndexes",f],["transaction","message","instructions",f,"programIdIndex"],["transaction","message","instructions",f,"accounts",f],["transaction","message","header","numReadonlySignedAccounts"],["transaction","message","header","numReadonlyUnsignedAccounts"],["transaction","message","header","numRequiredSignatures"]],getVoteAccounts:[["current",f,"commission"],["delinquent",f,"commission"]]};function Te(e,r){return e.filter(t=>t[0]===f&&typeof r=="number"||t[0]===r).map(t=>t.slice(1))}function ie(e,r){if(Array.isArray(e))return e.map((t,n)=>{let o=Te(r,n);return ie(t,o)});if(typeof e=="object"&&e!==null){let t={};for(let[n,o]of Object.entries(e)){let s=Te(r,n);t[n]=ie(o,s);}return t}else return typeof e=="number"&&r.length===0&&Number.isInteger(e)?BigInt(e):e}function Lr(e,r){let t=r?Or[r]:void 0;return ie(e,t??[])}function Ie(e){return new Proxy({},{defineProperty(){return !1},deleteProperty(){return !1},get(...r){let[t,n]=r,o=n.toString();return function(...s){let i=e?.onIntegerOverflow,c=kr(s,i?(u,l)=>i(o,u,l):void 0);return {methodName:o,params:c,responseProcessor:u=>Lr(u,o)}}}})}a();var _r=class extends Error{constructor(e){super(`JSON-RPC 2.0 error (${e.code}): ${e.message}`),Error.captureStackTrace(this,this.constructor),this.code=e.code,this.data=e.data;}get name(){return "SolanaJsonRpcError"}},ae=0;function $r(){let e=ae;return ae=(ae+1)%Number.MAX_SAFE_INTEGER,e}function Dr(e,r){return {id:$r(),jsonrpc:"2.0",method:e,params:r}}function Pr(e,r){return {async send(t){let{methodName:n,params:o,responseProcessor:s}=r,i=Dr(n,o),c=await e.transport({payload:i,signal:t?.abortSignal});if("error"in c)throw new _r(c.error);return s?s(c.result):c.result}}}function Ur(e){return new Proxy(e.api,{defineProperty(){return !1},deleteProperty(){return !1},get(r,t,n){return function(...o){let s=t.toString(),i=Reflect.get(r,s,n),c=i?i(...o):{methodName:s,params:o};return Pr(e,c)}}})}function Ne(e){return Ur(e)}var jr=globalThis.fetch,Fr=class extends Error{constructor(e){super(`HTTP error (${e.statusCode}): ${e.message}`),Error.captureStackTrace(this,this.constructor),this.statusCode=e.statusCode;}get name(){return "SolanaHttpError"}};function Hr(e){let r={};for(let t in e)r[t.toLowerCase()]=e[t];return r}function ve({httpAgentNodeOnly:e,headers:r,url:t}){let n=void 0;let o=r&&Hr(r);return async function({payload:i,signal:c}){let u=JSON.stringify(i),l={agent:n,body:u,headers:{...o,accept:"application/json","content-length":u.length.toString(),"content-type":"application/json; charset=utf-8"},method:"POST",signal:c},p=await jr(t,l);if(!p.ok)throw new Fr({message:p.statusText,statusCode:p.status});return await p.json()}}a();a();var X=class extends Error{constructor(t,n,o){let s=(typeof n[0]=="number"?n[0]:parseInt(n[0],10))+1,i="",c=s%10,u=s%100;c==1&&u!=11?i=s+"st":c==2&&u!=12?i=s+"nd":c==3&&u!=13?i=s+"rd":i=s+"th";let l=n.length>1?n.slice(1).map(p=>typeof p=="number"?`[${p}]`:p).join("."):null;super(`The ${i} argument to the \`${t}\` RPC method${l?` at path \`${l}\``:""} was \`${o}\`. This number is unsafe for use with the Solana JSON-RPC because it exceeds \`Number.MAX_SAFE_INTEGER\`.`);this.keyPath=n,this.methodName=t,this.value=o;}get name(){return "SolanaJsonRpcIntegerOverflowError"}};var Ce={onIntegerOverflow(e,r,t){throw new X(e,r,t)}};function Lo(e){return Ne({...e,api:Ie(Ce)})}a();a();function Be(e,r){let t;return async function(o){let{payload:s,signal:i}=o,c=r(s);if(c===void 0)return await e(o);if(t||(Promise.resolve().then(()=>{t=void 0;}),t={}),t[c]==null){let l=new AbortController;t[c]={abortController:l,numConsumers:0,responsePromise:e({...o,signal:l.signal})};}let u=t[c];if(u.numConsumers++,i){let l=u.responsePromise;return await new Promise((p,h)=>{let Z=$e=>{i.removeEventListener("abort",Z),u.numConsumers-=1,u.numConsumers===0&&u.abortController.abort();let De=new DOMException($e.target.reason,"AbortError");h(De);};i.addEventListener("abort",Z),l.then(p).finally(()=>{i.removeEventListener("abort",Z);});})}else return await u.responsePromise}}a();var Le=Ve(Oe(),1);function _e(e){if(!(e==null||typeof e!="object"||Array.isArray(e))&&"jsonrpc"in e&&e.jsonrpc==="2.0"&&"method"in e&&"params"in e)return (0, Le.default)([e.method,e.params])}function qr(e){let r={};for(let t in e)r[t.toLowerCase()]=e[t];return r}function Go(e){return Be(ve({...e,headers:{...e.headers?qr(e.headers):void 0,"solana-client":"js/2.0.0-development"}}),_e)}
|
|
9
|
+
For a list of runtimes that currently support Ed25519 operations, visit https://github.com/WICG/webcrypto-secure-curves/issues/20`)}async function $e(){if(V(),typeof globalThis.crypto>"u"||typeof globalThis.crypto.subtle?.exportKey!="function")throw new Error("No key export implementation could be found")}async function We(){if(V(),typeof globalThis.crypto>"u"||typeof globalThis.crypto.subtle?.sign!="function")throw new Error("No signing implementation could be found")}async function Me(){if(V(),typeof globalThis.crypto>"u"||typeof globalThis.crypto.subtle?.verify!="function")throw new Error("No signature verification implementation could be found")}function Ko(e){return !(e.length<32||e.length>44||B.serialize(e).byteLength!==32)}function Pt(e){try{if(e.length<32||e.length>44)throw new Error("Expected input string to decode to a byte array of length 32.");let r=B.serialize(e).byteLength;if(r!==32)throw new Error(`Expected input string to decode to a byte array of length 32. Actual length: ${r}`)}catch(t){throw new Error(`\`${e}\` is not a base-58 encoded address`,{cause:t})}}function jo(e){return Pt(e),e}function U(e){return G({description:e?.description??(""),encoding:B,size:32})}function le(){return new Intl.Collator("en",{caseFirst:"lower",ignorePunctuation:!1,localeMatcher:"best fit",numeric:!1,sensitivity:"variant",usage:"sort"}).compare}var Dt=37095705934669439343138083508754565189542113879843219016388785533085940283555n,I=57896044618658097711785492504343953926634992332820282019728792003956564819949n,Ue=19681161376707505956807079304988542015446066515923890162744021073123829784752n;function T(e){let t=e%I;return t>=0n?t:I+t}function C(e,t){let r=e;for(;t-- >0n;)r*=r,r%=I;return r}function $t(e){let r=e*e%I*e%I,n=C(r,2n)*r%I,o=C(n,1n)*e%I,s=C(o,5n)*o%I,i=C(s,10n)*s%I,a=C(i,20n)*i%I,u=C(a,40n)*a%I,l=C(u,80n)*u%I,p=C(l,80n)*u%I,f=C(p,10n)*s%I;return C(f,2n)*e%I}function Wt(e,t){let r=T(t*t*t),n=T(r*r*t),o=$t(e*n),s=T(e*r*o),i=T(t*s*s),a=s,u=T(s*Ue),l=i===e,p=i===T(-e),f=i===T(-e*Ue);return l&&(s=a),(p||f)&&(s=u),(T(s)&1n)===1n&&(s=T(-s)),!l&&!p?null:s}function Mt(e,t){let r=T(e*e),n=T(r-1n),o=T(Dt*r+1n),s=Wt(n,o);if(s===null)return !1;let i=(t&128)!==0;return !(s===0n&&i)}function Ut(e){let t=e.toString(16);return t.length===1?`0${t}`:t}function Ft(e){let r=`0x${e.reduce((n,o,s)=>`${Ut(s===31?o&-129:o)}${n}`,"")}`;return BigInt(r)}async function Kt(e){if(e.byteLength!==32)return !1;let t=Ft(e);return Mt(t,e[31])}var Ke=32,Fe=16,ue=[80,114,111,103,114,97,109,68,101,114,105,118,101,100,65,100,100,114,101,115,115],je=class extends Error{};async function jt({programAddress:e,seeds:t}){if(await Pe(),t.length>Fe)throw new Error(`A maximum of ${Fe} seeds may be supplied when creating an address`);let r,n=t.reduce((u,l,p)=>{let f=typeof l=="string"?(r||(r=new TextEncoder)).encode(l):l;if(f.byteLength>Ke)throw new Error(`The seed at index ${p} exceeds the maximum length of 32 bytes`);return u.push(...f),u},[]),o=U(),s=o.serialize(e),i=await crypto.subtle.digest("SHA-256",new Uint8Array([...n,...s,...ue])),a=new Uint8Array(i);if(await Kt(a))throw new je("Invalid seeds; point must fall off the Ed25519 curve");return o.deserialize(a)[0]}async function Ho({programAddress:e,seeds:t}){let r=255;for(;r>0;)try{return {bumpSeed:r,pda:await jt({programAddress:e,seeds:[...t,new Uint8Array([r])]})}}catch(n){if(n instanceof je)r--;else throw n}throw new Error("Unable to find a viable program address bump seed")}async function Go({baseAddress:e,programAddress:t,seed:r}){let{serialize:n,deserialize:o}=U(),s=typeof r=="string"?new TextEncoder().encode(r):r;if(s.byteLength>Ke)throw new Error("The seed exceeds the maximum length of 32 bytes");let i=n(t);if(i.length>=ue.length&&i.slice(-ue.length).every((l,p)=>l===ue[p]))throw new Error("programAddress cannot end with the PDA marker");let a=await crypto.subtle.digest("SHA-256",new Uint8Array([...n(e),...s,...i])),u=new Uint8Array(a);return o(u)[0]}async function He(e){if(await $e(),e.type!=="public"||e.algorithm.name!=="Ed25519")throw new Error("The `CryptoKey` must be an `Ed25519` public key");let t=await crypto.subtle.exportKey("raw",e),[r]=U().deserialize(new Uint8Array(t));return r}c();var Ht=(e=>(e[e.WRITABLE_SIGNER=3]="WRITABLE_SIGNER",e[e.READONLY_SIGNER=2]="READONLY_SIGNER",e[e.WRITABLE=1]="WRITABLE",e[e.READONLY=0]="READONLY",e))(Ht||{}),Ge=2,ye=1;function Jo(e){return e&~Ge}function Xo(e){return e&~ye}function Zo(e){return e>=2}function Qo(e){return (e&ye)!==0}function es(e,t){return e|t}function ts(e){return e|Ge}function rs(e){return e|ye}c();async function is(){return await De(),await crypto.subtle.generateKey("Ed25519",!1,["sign","verify"])}async function Ve(e,t){await We();let r=await crypto.subtle.sign("Ed25519",e,t);return new Uint8Array(r)}async function as(e,t,r){return await Me(),await crypto.subtle.verify("Ed25519",e,t,r)}c();function J(e){if("signatures"in e){let{signatures:t,...r}=e;return r}else return e}function fs(e){try{if(e.length<32||e.length>44)throw new Error("Expected input string to decode to a byte array of length 32.");let r=B.serialize(e).byteLength;if(r!==32)throw new Error(`Expected input string to decode to a byte array of length 32. Actual length: ${r}`)}catch(t){throw new Error(`\`${e}\` is not a blockhash`,{cause:t})}}function ms(e,t){if("lifetimeConstraint"in t&&t.lifetimeConstraint.blockhash===e.blockhash&&t.lifetimeConstraint.lastValidBlockHeight===e.lastValidBlockHeight)return t;let r={...J(t),lifetimeConstraint:e};return Object.freeze(r),r}function gs({version:e}){let t={instructions:[],version:e};return Object.freeze(t),t}var z=(e=>(e[e.WRITABLE_SIGNER=3]="WRITABLE_SIGNER",e[e.READONLY_SIGNER=2]="READONLY_SIGNER",e[e.WRITABLE=1]="WRITABLE",e[e.READONLY=0]="READONLY",e))(z||{}),Gt=1;function q(e){return e>=2}function Y(e){return (e&Gt)!==0}function qe(e,t){return e|t}var Xe="SysvarRecentB1ockHashes11111111111111111111",Ze="11111111111111111111111111111111";function bs(e){if(!Qe(e))throw new Error("Transaction is not a durable nonce transaction")}function Vt(e,t){return {accounts:[{address:e,role:z.WRITABLE},{address:Xe,role:z.READONLY},{address:t,role:z.READONLY_SIGNER}],data:new Uint8Array([4,0,0,0]),programAddress:Ze}}function qt(e){return e.programAddress===Ze&&e.data!=null&&Yt(e.data)&&e.accounts?.length===3&&e.accounts[0].address!=null&&e.accounts[0].role===z.WRITABLE&&e.accounts[1].address===Xe&&e.accounts[1].role===z.READONLY&&e.accounts[2].address!=null&&e.accounts[2].role===z.READONLY_SIGNER}function Yt(e){return e.byteLength===4&&e[0]===4&&e[1]===0&&e[2]===0&&e[3]===0}function Qe(e){return "lifetimeConstraint"in e&&typeof e.lifetimeConstraint.nonce=="string"&&e.instructions[0]!=null&&qt(e.instructions[0])}function hs({nonce:e,nonceAccountAddress:t,nonceAuthorityAddress:r},n){let o=Qe(n);if(o&&n.lifetimeConstraint.nonce===e&&n.instructions[0].accounts[0].address===t&&n.instructions[0].accounts[2].address===r)return n;let s={...J(n),instructions:[Vt(t,r),...o?n.instructions.slice(1):n.instructions],lifetimeConstraint:{nonce:e}};return Object.freeze(s),s}function ys(e,t){if("feePayer"in t&&e===t.feePayer)return t;let r={...J(t),feePayer:e};return Object.freeze(r),r}function ws(e,t){let r={...J(t),instructions:[...t.instructions,e]};return Object.freeze(r),r}function Ss(e,t){let r={...J(t),instructions:[e,...t.instructions]};return Object.freeze(r),r}function Ye(e,t,r){e[t]=r(e[t]??{role:z.READONLY});}var w=Symbol("AddressMapTypeProperty");function Jt(e,t){let r={[e]:{[w]:0,role:z.WRITABLE_SIGNER}},n=new Set;for(let o of t){Ye(r,o.programAddress,i=>{if(n.add(o.programAddress),w in i){if(Y(i.role))switch(i[w]){case 0:throw new Error(`This transaction includes an address (\`${o.programAddress}\`) which is both invoked and set as the fee payer. Program addresses may not pay fees.`);default:throw new Error(`This transaction includes an address (\`${o.programAddress}\`) which is both invoked and marked writable. Program addresses may not be writable.`)}if(i[w]===2)return i}return {[w]:2,role:z.READONLY}});let s;if(o.accounts)for(let i of o.accounts)Ye(r,i.address,a=>{let{address:u,...l}=i;if(w in a)switch(a[w]){case 0:return a;case 1:{let p=qe(a.role,l.role);if("lookupTableAddress"in l){if(a.lookupTableAddress!==l.lookupTableAddress&&(s||(s=le()))(l.lookupTableAddress,a.lookupTableAddress)<0)return {[w]:1,...l,role:p}}else if(q(l.role))return {[w]:2,role:p};return a.role!==p?{...a,role:p}:a}case 2:{let p=qe(a.role,l.role);if(n.has(i.address)){if(Y(l.role))throw new Error(`This transaction includes an address (\`${i.address}\`) which is both invoked and marked writable. Program addresses may not be writable.`);return a.role!==p?{...a,role:p}:a}else return "lookupTableAddress"in l&&!q(a.role)?{...l,[w]:1,role:p}:a.role!==p?{...a,role:p}:a}}return "lookupTableAddress"in l?{...l,[w]:1}:{...l,[w]:2}});}return r}function Xt(e){let t;return Object.entries(e).sort(([n,o],[s,i])=>{if(o[w]!==i[w]){if(o[w]===0)return -1;if(i[w]===0)return 1;if(o[w]===2)return -1;if(i[w]===2)return 1}let a=q(o.role);if(a!==q(i.role))return a?-1:1;let u=Y(o.role);return u!==Y(i.role)?u?-1:1:(t||(t=le()),o[w]===1&&i[w]===1&&o.lookupTableAddress!==i.lookupTableAddress?t(o.lookupTableAddress,i.lookupTableAddress):t(n,s))}).map(([n,o])=>({address:n,...o}))}function Zt(e){var t;let r={};for(let n of e){if(!("lookupTableAddress"in n))continue;let o=r[t=n.lookupTableAddress]||(r[t]={readableIndices:[],writableIndices:[]});n.role===z.WRITABLE?o.writableIndices.push(n.addressIndex):o.readableIndices.push(n.addressIndex);}return Object.keys(r).sort(le()).map(n=>({lookupTableAddress:n,...r[n]}))}function Qt(e){let t=0,r=0,n=0;for(let o of e){if("lookupTableAddress"in o)break;let s=Y(o.role);q(o.role)?(n++,s||r++):s||t++;}return {numReadonlyNonSignerAccounts:t,numReadonlySignerAccounts:r,numSignerAccounts:n}}function er(e){let t={};for(let[r,n]of e.entries())t[n.address]=r;return t}function tr(e,t){let r=er(t);return e.map(({accounts:n,data:o,programAddress:s})=>({programAddressIndex:r[s],...n?{accountIndices:n.map(({address:i})=>r[i])}:null,...o?{data:o}:null}))}function rr(e){return "nonce"in e?e.nonce:e.blockhash}function nr(e){let t=e.findIndex(n=>"lookupTableAddress"in n);return (t===-1?e:e.slice(0,t)).map(({address:n})=>n)}function et(e){let t=Jt(e.feePayer,e.instructions),r=Xt(t);return {...e.version!=="legacy"?{addressTableLookups:Zt(r)}:null,header:Qt(r),instructions:tr(e.instructions,r),lifetimeToken:rr(e.lifetimeConstraint),staticAccounts:nr(r),version:e.version}}function or(){return P([["lookupTableAddress",U(void 0)],["writableIndices",O(N(),{...null,size:_()})],["readableIndices",O(N(),{...void 0,size:_()})]],void 0)}function sr(){return P([["numSignerAccounts",N(void 0)],["numReadonlySignerAccounts",N(void 0)],["numReadonlyNonSignerAccounts",N(void 0)]],void 0)}function ir(){return ee(P([["programAddressIndex",N(void 0)],["accountIndices",O(N({description:""}),{description:"",size:_()})],["data",ce({description:"",size:_()})]]),e=>e.accountIndices!==void 0&&e.data!==void 0?e:{...e,accountIndices:e.accountIndices??[],data:e.data??new Uint8Array(0)},e=>{if(e.accountIndices.length&&e.data.byteLength)return e;let{accountIndices:t,data:r,...n}=e;return {...n,...t.length?{accountIndices:t}:null,...r.byteLength?{data:r}:null}})}function ar(e,t){let r=t+e[0].toUpperCase()+e.slice(1);return new Error(`No ${e} exists for ${t}. Use \`get${r}()\` if you need a ${e}, and \`get${t}Codec()\` if you need to both encode and decode ${t}`)}function tt(e){return ()=>{throw ar("decoder",e)}}var we=128,cr={description:"",fixedSize:null,maxSize:1};function ur(e,t=0){let r=e[t];return r&we?[r^we,t+1]:["legacy",t]}function lr(e){if(e==="legacy")return new Uint8Array;if(e<0||e>127)throw new Error(`Transaction version must be in the range [0, 127]. \`${e}\` given.`);return new Uint8Array([e|we])}function dr(){return {...cr,deserialize:ur,serialize:lr}}var pr={description:"",fixedSize:null,maxSize:null};function fr(e){return e.version==="legacy"?P(Je()).serialize(e):ee(P([...Je(),["addressTableLookups",mr()]]),t=>t.version==="legacy"?t:{...t,addressTableLookups:t.addressTableLookups??[]}).serialize(e)}function Je(){return [["version",dr()],["header",sr()],["staticAccounts",O(U(),{description:"",size:_()})],["lifetimeToken",G({description:"",encoding:B,size:32})],["instructions",O(ir(),{description:"",size:_()})]]}function mr(){return O(or(),{...null,size:_()})}function rt(){return {...pr,deserialize:tt("CompiledMessage"),serialize:fr}}async function gr(e,t){let r=rt().serialize(e);return await Ve(t,r)}async function Es(e,t){let r=et(t),n="signatures"in t?{...t.signatures}:{},o=await Promise.all(e.map(i=>Promise.all([He(i.publicKey),gr(r,i.privateKey)])));for(let[i,a]of o)n[i]=a;let s={...t,signatures:n};return Object.freeze(s),s}function br(e){let t=et(e),r;if("signatures"in e){r=[];for(let n=0;n<t.header.numSignerAccounts;n++)r[n]=e.signatures[t.staticAccounts[n]]??new Uint8Array(Array(64).fill(0));}else r=Array(t.header.numSignerAccounts).fill(new Uint8Array(Array(64).fill(0)));return {compiledMessage:t,signatures:r}}var hr={description:"",fixedSize:null,maxSize:null};function yr(e){let t=br(e);return P([["signatures",O(ce({size:64}),{...null,size:_()})],["compiledMessage",rt()]]).serialize(t)}function wr(){return {...hr,deserialize:tt("CompiledMessage"),serialize:yr}}function xs(e){let t=wr().serialize(e);return btoa(String.fromCharCode(...t))}c();c();function F(e,...t){return t.reduce((r,n)=>n(r),e)}c();function xe(e,t,r){if(Array.isArray(e))return e.map((n,o)=>xe(n,[...t,o],r));if(typeof e=="object"&&e!==null){let n={};for(let o in e)Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=xe(e[o],[...t,o],r));return n}else return typeof e=="bigint"?(r&&(e>Number.MAX_SAFE_INTEGER||e<-Number.MAX_SAFE_INTEGER)&&r(t,e),Number(e)):e}function ot(e,t){return xe(e,[],t)}var d={},Se,Ee;function Sr(){return Se||(Se={}),Se}function Er(){if(!Ee){let e=[["data","parsed","info","tokenAmount","decimals"],["data","parsed","info","tokenAmount","uiAmount"],["data","parsed","info","rentExemptReserve","decimals"],["data","parsed","info","rentExemptReserve","uiAmount"],["data","parsed","info","delegatedAmount","decimals"],["data","parsed","info","delegatedAmount","uiAmount"],["data","parsed","info","extensions",d,"state","olderTransferFee","transferFeeBasisPoints"],["data","parsed","info","extensions",d,"state","newerTransferFee","transferFeeBasisPoints"],["data","parsed","info","extensions",d,"state","preUpdateAverageRate"],["data","parsed","info","extensions",d,"state","currentRate"]],t=[...e,["data","parsed","info","lastExtendedSlotStartIndex"],["data","parsed","info","slashPenalty"],["data","parsed","info","warmupCooldownRate"],["data","parsed","info","decimals"],["data","parsed","info","numRequiredSigners"],["data","parsed","info","numValidSigners"],["data","parsed","info","stake","delegation","warmupCooldownRate"],["data","parsed","info","exemptionThreshold"],["data","parsed","info","burnPercent"],["data","parsed","info","commission"],["data","parsed","info","votes",d,"confirmationCount"]];Ee={getAccountInfo:t.map(r=>["value",...r]),getBlock:[["blockTime"],["transactions",d,"meta","preTokenBalances",d,"accountIndex"],["transactions",d,"meta","preTokenBalances",d,"uiTokenAmount","decimals"],["transactions",d,"meta","postTokenBalances",d,"accountIndex"],["transactions",d,"meta","postTokenBalances",d,"uiTokenAmount","decimals"],["transactions",d,"meta","rewards",d,"commission"],["transactions",d,"meta","innerInstructions",d,"index"],["transactions",d,"meta","innerInstructions",d,"instructions",d,"programIdIndex"],["transactions",d,"meta","innerInstructions",d,"instructions",d,"accounts",d],["transactions",d,"transaction","message","addressTableLookups",d,"writableIndexes",d],["transactions",d,"transaction","message","addressTableLookups",d,"readonlyIndexes",d],["transactions",d,"transaction","message","instructions",d,"programIdIndex"],["transactions",d,"transaction","message","instructions",d,"accounts",d],["transactions",d,"transaction","message","header","numReadonlySignedAccounts"],["transactions",d,"transaction","message","header","numReadonlyUnsignedAccounts"],["transactions",d,"transaction","message","header","numRequiredSignatures"],["rewards",d,"commission"]],getBlockTime:[[]],getClusterNodes:[[d,"featureSet"],[d,"shredVersion"]],getInflationGovernor:[["initial"],["foundation"],["foundationTerm"],["taper"],["terminal"]],getInflationRate:[["foundation"],["total"],["validator"]],getInflationReward:[[d,"commission"]],getMultipleAccounts:t.map(r=>["value",d,...r]),getProgramAccounts:t.flatMap(r=>[["value",d,"account",...r],[d,"account",...r]]),getRecentPerformanceSamples:[[d,"samplePeriodSecs"]],getTokenAccountBalance:[["value","decimals"],["value","uiAmount"]],getTokenAccountsByDelegate:e.map(r=>["value",d,"account",...r]),getTokenAccountsByOwner:e.map(r=>["value",d,"account",...r]),getTokenLargestAccounts:[["value",d,"decimals"],["value",d,"uiAmount"]],getTokenSupply:[["value","decimals"],["value","uiAmount"]],getTransaction:[["meta","preTokenBalances",d,"accountIndex"],["meta","preTokenBalances",d,"uiTokenAmount","decimals"],["meta","postTokenBalances",d,"accountIndex"],["meta","postTokenBalances",d,"uiTokenAmount","decimals"],["meta","rewards",d,"commission"],["meta","innerInstructions",d,"index"],["meta","innerInstructions",d,"instructions",d,"programIdIndex"],["meta","innerInstructions",d,"instructions",d,"accounts",d],["transaction","message","addressTableLookups",d,"writableIndexes",d],["transaction","message","addressTableLookups",d,"readonlyIndexes",d],["transaction","message","instructions",d,"programIdIndex"],["transaction","message","instructions",d,"accounts",d],["transaction","message","header","numReadonlySignedAccounts"],["transaction","message","header","numReadonlyUnsignedAccounts"],["transaction","message","header","numRequiredSignatures"]],getVersion:[["feature-set"]],getVoteAccounts:[["current",d,"commission"],["delinquent",d,"commission"]],simulateTransaction:t.map(r=>["value","accounts",d,...r])};}return Ee}function nt(e,t){return e.filter(r=>r[0]===d&&typeof t=="number"||r[0]===t).map(r=>r.slice(1))}function de(e,t){if(Array.isArray(e))return e.map((r,n)=>{let o=nt(t,n);return de(r,o)});if(typeof e=="object"&&e!==null){let r={};for(let[n,o]of Object.entries(e)){let s=nt(t,n);r[n]=de(o,s);}return r}else return typeof e=="number"&&t.length===0&&Number.isInteger(e)?BigInt(e):e}function xr(e,t){let r=t?Er()[t]:void 0;return de(e,r??[])}function Ir(e,t){let r=t?Sr()[t]:void 0;return de(e,r??[])}function st(e){return new Proxy({},{defineProperty(){return !1},deleteProperty(){return !1},get(...t){let[r,n]=t,o=n.toString();return function(...s){let i=e?.onIntegerOverflow,a=ot(s,i?(u,l)=>i(o,u,l):void 0);return {methodName:o,params:a,responseProcessor:u=>xr(u,o)}}}})}function it(e){return new Proxy({},{defineProperty(){return !1},deleteProperty(){return !1},get(...t){let[r,n]=t,o=n.toString();return function(...s){let i=e?.onIntegerOverflow;return {params:ot(s,i?(u,l)=>i(o,u,l):void 0),responseProcessor:u=>Ir(u,o),subscribeMethodName:o.replace(/Notifications$/,"Subscribe"),unsubscribeMethodName:o.replace(/Notifications$/,"Unsubscribe")}}}})}c();var ct=class extends Error{constructor(e){super(`JSON-RPC 2.0 error (${e.code}): ${e.message}`),Error.captureStackTrace(this,this.constructor),this.code=e.code,this.data=e.data;}get name(){return "SolanaJsonRpcError"}},Ie=0;function Ar(){let e=Ie;return Ie=(Ie+1)%Number.MAX_SAFE_INTEGER,e}function Te(e,t){return {id:Ar(),jsonrpc:"2.0",method:e,params:t}}function Tr(e,t){return {async send(r){let{methodName:n,params:o,responseProcessor:s}=t,i=Te(n,o),a=await e.transport({payload:i,signal:r?.abortSignal});if("error"in a)throw new ct(a.error);return s?s(a.result):a.result}}}function Rr(e){return new Proxy(e.api,{defineProperty(){return !1},deleteProperty(){return !1},get(t,r,n){return function(...o){let s=r.toString(),i=Reflect.get(t,s,n),a=i?i(...o):{methodName:s,params:o};return Tr(e,a)}}})}function ut(e){return Rr(e)}function zr(e,t){(async()=>{try{for await(let r of e);}catch{}finally{t();}})();}function _r(e,{params:t,subscribeMethodName:r,unsubscribeMethodName:n,responseProcessor:o}){return {async subscribe({abortSignal:s}){s.throwIfAborted();let i;function a(){if(i!==void 0){let g=Te(n,[i]);p.send_DO_NOT_USE_OR_YOU_WILL_BE_FIRED(g).finally(()=>{u.abort();});}else u.abort();}s.addEventListener("abort",a);let u=new AbortController,l=Te(r,t),p=await e.transport({payload:l,signal:u.signal});function f(){s.removeEventListener("abort",a);}zr(p,f);for await(let g of p)if("id"in g&&g.id===l.id){if("error"in g)throw new ct(g.error);i=g.result;break}if(i==null)throw new Error("Failed to obtain a subscription id from the server");return {async*[Symbol.asyncIterator](){for await(let g of p){if(!("params"in g)||g.params.subscription!==i)continue;let E=g.params.result;yield o?o(E):E;}}}}}}function Cr(e){return new Proxy(e.api,{defineProperty(){return !1},deleteProperty(){return !1},get(t,r,n){return function(...o){let s=r.toString(),i=Reflect.get(t,s,n);if(r.toString().endsWith("Notifications")===!1&&!i)throw new Error("Either the notification name must end in 'Notifications' or the API must supply a subscription creator function to map between the notification name and the subscribe/unsubscribe method names.");let a=i?i(...o):{params:o,subscribeMethodName:s.replace(/Notifications$/,"Subscribe"),unsubscribeMethodName:s.replace(/Notifications$/,"Unsubscribe")};return _r(e,a)}}})}function lt(e){return Cr(e)}var vr=globalThis.fetch,kr=class extends Error{constructor(e){super(`HTTP error (${e.statusCode}): ${e.message}`),Error.captureStackTrace(this,this.constructor),this.statusCode=e.statusCode;}get name(){return "SolanaHttpError"}};function Br(e){let t={};for(let r in e)t[r.toLowerCase()]=e[r];return t}function dt({httpAgentNodeOnly:e,headers:t,url:r}){let n=void 0;let o=t&&Br(t);return async function({payload:i,signal:a}){let u=JSON.stringify(i),l={agent:n,body:u,headers:{...o,accept:"application/json","content-length":u.length.toString(),"content-type":"application/json; charset=utf-8"},method:"POST",signal:a},p=await vr(r,l);if(!p.ok)throw new kr({message:p.statusText,statusCode:p.status});return await p.json()}}var X=globalThis.WebSocket,at=Symbol(void 0);async function Pr({sendBufferHighWatermark:e,signal:t,url:r}){return new Promise((n,o)=>{t.addEventListener("abort",a,{once:!0});let s=new Map;function i(h){let y=[...s.values()].filter(x=>x.__hasPolled).map(({onError:x})=>x);s.clear(),y.forEach(x=>{try{x(h);}catch{}});}function a(){i(at),b.readyState!==X.CLOSED&&b.readyState!==X.CLOSING&&b.close(1e3);}function u(h){f?.onCancel(),t.removeEventListener("abort",a),b.removeEventListener("close",u),b.removeEventListener("error",l),b.removeEventListener("open",g),b.removeEventListener("message",E),i(h);}function l(h){p||o(new Error("WebSocket failed to connect",{cause:h}));}let p=!1,f;function g(){p=!0,n({async send(h){let y=JSON.stringify(h);if(!f&&b.readyState===X.OPEN&&b.bufferedAmount>e){let x,L=new Promise((K,Et)=>{let Ce=setInterval(()=>{(b.readyState!==X.OPEN||!(b.bufferedAmount>e))&&(clearInterval(Ce),f=void 0,K());},16);x=()=>{f=void 0,clearInterval(Ce),Et(new Error("WebSocket was closed before payload could be sent"));};});f={onCancel:x,promise:L};}f&&await f.promise,b.send(y);},async*[Symbol.asyncIterator](){let h=Symbol();s.set(h,{__hasPolled:!1,queuedMessages:[]});try{for(;;){let y=s.get(h);if(!y)throw new Error("Invariant: WebSocket message iterator is missing state storage");if(y.__hasPolled)throw new Error("Invariant: WebSocket message iterator state is corrupt; iterated without first resolving existing message promise");let x=y.queuedMessages;if(x.length)y.queuedMessages=[],yield*x;else try{yield await new Promise((L,K)=>{s.set(h,{__hasPolled:!0,onError:K,onMessage:L});});}catch(L){if(L===at)return;throw new Error("WebSocket connection closed",{cause:L})}}}finally{s.delete(h);}}});}function E({data:h}){let y=JSON.parse(h);s.forEach((x,L)=>{if(x.__hasPolled){let{onMessage:K}=x;s.set(L,{__hasPolled:!1,queuedMessages:[]}),K(y);}else x.queuedMessages.push(y);});}let b=new X(r);b.addEventListener("close",u),b.addEventListener("error",l),b.addEventListener("open",g),b.addEventListener("message",E);})}function pt({sendBufferHighWatermark:e,url:t}){if(/^wss?:/i.test(t)===!1){let r=t.match(/^([^:]+):/);throw new DOMException(r?`Failed to construct 'WebSocket': The URL's scheme must be either 'ws' or 'wss'. '${r[1]}:' is not allowed.`:`Failed to construct 'WebSocket': The URL '${t}' is invalid.`)}return async function({payload:n,signal:o}){o?.throwIfAborted();let s=await Pr({sendBufferHighWatermark:e,signal:o,url:t});return o?.throwIfAborted(),await s.send(n),{[Symbol.asyncIterator]:s[Symbol.asyncIterator].bind(s),send_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:s.send.bind(s)}}}var gt=ve(Re(),1);c();c();var pe=class extends Error{constructor(r,n,o){let s=(typeof n[0]=="number"?n[0]:parseInt(n[0],10))+1,i="",a=s%10,u=s%100;a==1&&u!=11?i=s+"st":a==2&&u!=12?i=s+"nd":a==3&&u!=13?i=s+"rd":i=s+"th";let l=n.length>1?n.slice(1).map(p=>typeof p=="number"?`[${p}]`:p).join("."):null;super(`The ${i} argument to the \`${r}\` RPC method${l?` at path \`${l}\``:""} was \`${o}\`. This number is unsafe for use with the Solana JSON-RPC because it exceeds \`Number.MAX_SAFE_INTEGER\`.`);this.keyPath=n,this.methodName=r,this.value=o;}get name(){return "SolanaJsonRpcIntegerOverflowError"}};var ze={onIntegerOverflow(e,t,r){throw new pe(e,t,r)}};c();c();function Wr(e,t){(async()=>{try{for await(let r of e);}catch{}finally{t();}})();}function fe({getAbortSignalFromInputArgs:e,getCacheEntryMissingError:t,getCacheKeyFromInputArgs:r,onCacheHit:n,onCreateIterable:o}){let s=new Map;function i(a){let u=s.get(a);if(!u)throw t(a);return u}return async(...a)=>{let u=r(...a),l=e(...a);if(u===void 0)return await o(l,...a);let p=()=>{s.delete(u),l.removeEventListener("abort",f);},f=()=>{let g=i(u);g.purgeScheduled!==!0&&(g.purgeScheduled=!0,globalThis.queueMicrotask(()=>{g.purgeScheduled=!1,g.referenceCount===0&&(g.abortController.abort(),p());})),g.referenceCount--;};l.addEventListener("abort",f);try{let g=s.get(u);if(g){g.referenceCount++;let E=g.iterable,b="then"in E?await E:E;return await n(b,...a),b}else {let E=new AbortController,b=o(E.signal,...a),h={abortController:E,iterable:b,purgeScheduled:!1,referenceCount:1};s.set(u,h);let y=await b;return Wr(y,p),h.iterable=y,y}}catch(g){throw p(),g}}}var _e=Symbol(void 0);function Mr(e,t){(async()=>{try{for await(let r of e);}catch{}finally{t();}})();}function mt({getDeduplicationKey:e,rpcSubscriptions:t}){let r=new Map;return new Proxy(t,{defineProperty(){return !1},deleteProperty(){return !1},get(n,o,s){let i=Reflect.get(n,o,s);return typeof i!="function"?i:function(...a){let u=e(o,a);if(u===void 0)return i(...a);if(r.has(u))return r.get(u);let l=fe({getAbortSignalFromInputArgs:({abortSignal:f})=>f,getCacheEntryMissingError(f){return new Error(`Found no cache entry for subscription with deduplication key \`${f?.toString()}\``)},getCacheKeyFromInputArgs:()=>u,async onCacheHit(f,g){},async onCreateIterable(f,g){let b=await i(...a).subscribe({...g,abortSignal:f});return Mr(b,()=>{r.delete(u);}),b}}),p={async subscribe(...f){let g=await l(...f),{abortSignal:E}=f[0],b;return {...g,async*[Symbol.asyncIterator](){b||(b=E.aborted?Promise.reject(_e):new Promise((h,y)=>{E.addEventListener("abort",()=>{y(_e);});}));try{let h=g[Symbol.asyncIterator]();for(;;){let y=await Promise.race([h.next(),b]);if(y.done)return;yield y.value;}}catch(h){if(h===_e)return;throw r.delete(u),h}}}}};return r.set(u,p),p}}})}function Zs(e){return ut({...e,api:st(ze)})}function Qs(e){return F(lt({...e,api:it(ze)}),t=>mt({getDeduplicationKey:(...r)=>(0, gt.default)(r),rpcSubscriptions:t}))}c();c();function bt(e,t){let r;return async function(o){let{payload:s,signal:i}=o,a=t(s);if(a===void 0)return await e(o);if(r||(Promise.resolve().then(()=>{r=void 0;}),r={}),r[a]==null){let l=new AbortController;r[a]={abortController:l,numConsumers:0,responsePromise:e({...o,signal:l.signal})};}let u=r[a];if(u.numConsumers++,i){let l=u.responsePromise;return await new Promise((p,f)=>{let g=E=>{i.removeEventListener("abort",g),u.numConsumers-=1,u.numConsumers===0&&u.abortController.abort();let b=new DOMException(E.target.reason,"AbortError");f(b);};i.addEventListener("abort",g),l.then(p).finally(()=>{i.removeEventListener("abort",g);});})}else return await u.responsePromise}}c();var ht=ve(Re(),1);function Ur(e){return e==null||typeof e!="object"||Array.isArray(e)?!1:"jsonrpc"in e&&e.jsonrpc==="2.0"&&"method"in e&&typeof e.method=="string"&&"params"in e}function yt(e){return Ur(e)?(0, ht.default)([e.method,e.params]):void 0}function Fr(e){let t={};for(let r in e)t[r.toLowerCase()]=e[r];return t}function li(e){return F(dt({...e,headers:{...e.headers?Fr(e.headers):void 0,"solana-client":"js/2.0.0-development"}}),t=>bt(t,yt))}c();c();var Kr={jsonrpc:"2.0",method:"ping"};function wt({intervalMs:e,transport:t}){let r=new Map;return async(...n)=>{let o=await t(...n),s;function i(){o.send_DO_NOT_USE_OR_YOU_WILL_BE_FIRED(Kr);}function a(){clearInterval(s),s=setInterval(i,e);}if(r.has(o)===!1){r.set(o,{[Symbol.asyncIterator]:o[Symbol.asyncIterator].bind(o),send_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:(...p)=>(a(),o.send_DO_NOT_USE_OR_YOU_WILL_BE_FIRED(...p))}),(async()=>{try{for await(let p of o)a();}catch{}finally{r.delete(o),clearInterval(s),u&&globalThis.window.removeEventListener("offline",u),l&&globalThis.window.removeEventListener("online",l);}})(),globalThis.navigator.onLine&&a();let u,l;u=()=>{clearInterval(s);},l=()=>{i(),a();},globalThis.window.addEventListener("offline",u),globalThis.window.addEventListener("online",l);}return r.get(o)}}c();var jr=Symbol(void 0);function St({getShard:e,transport:t}){return fe({getAbortSignalFromInputArgs:({signal:r})=>r,getCacheEntryMissingError(r){return new Error(`Found no cache entry for connection with shard key \`${r?.toString()}\``)},getCacheKeyFromInputArgs:({payload:r})=>e?e(r):jr,onCacheHit:(r,{payload:n})=>r.send_DO_NOT_USE_OR_YOU_WILL_BE_FIRED(n),onCreateIterable:(r,n)=>t({...n,signal:r})})}function xi(e){let{getShard:t,intervalMs:r,...n}=e;return F(pt({...n,sendBufferHighWatermark:e.sendBufferHighWatermark??131072}),o=>wt({intervalMs:r??5e3,transport:o}),o=>St({getShard:t,transport:o}))}
|
|
10
10
|
|
|
11
|
-
exports.AccountRole =
|
|
12
|
-
exports.
|
|
13
|
-
exports.
|
|
14
|
-
exports.
|
|
15
|
-
exports.
|
|
16
|
-
exports.
|
|
17
|
-
exports.
|
|
18
|
-
exports.
|
|
19
|
-
exports.
|
|
20
|
-
exports.
|
|
21
|
-
exports.
|
|
22
|
-
exports.
|
|
23
|
-
exports.
|
|
24
|
-
exports.
|
|
25
|
-
exports.
|
|
26
|
-
exports.
|
|
27
|
-
exports.
|
|
28
|
-
exports.
|
|
29
|
-
exports.
|
|
30
|
-
exports.
|
|
31
|
-
exports.
|
|
32
|
-
exports.
|
|
33
|
-
exports.
|
|
34
|
-
exports.
|
|
35
|
-
exports.
|
|
36
|
-
exports.
|
|
37
|
-
exports.
|
|
11
|
+
exports.AccountRole = Ht;
|
|
12
|
+
exports.address = jo;
|
|
13
|
+
exports.appendTransactionInstruction = ws;
|
|
14
|
+
exports.assertIsBase58EncodedAddress = Pt;
|
|
15
|
+
exports.assertIsBlockhash = fs;
|
|
16
|
+
exports.assertIsDurableNonceTransaction = bs;
|
|
17
|
+
exports.createAddressWithSeed = Go;
|
|
18
|
+
exports.createDefaultRpcSubscriptionsTransport = xi;
|
|
19
|
+
exports.createDefaultRpcTransport = li;
|
|
20
|
+
exports.createSolanaRpc = Zs;
|
|
21
|
+
exports.createSolanaRpcSubscriptions = Qs;
|
|
22
|
+
exports.createTransaction = gs;
|
|
23
|
+
exports.downgradeRoleToNonSigner = Jo;
|
|
24
|
+
exports.downgradeRoleToReadonly = Xo;
|
|
25
|
+
exports.generateKeyPair = is;
|
|
26
|
+
exports.getAddressFromPublicKey = He;
|
|
27
|
+
exports.getBase58EncodedAddressCodec = U;
|
|
28
|
+
exports.getBase58EncodedAddressComparator = le;
|
|
29
|
+
exports.getBase64EncodedWireTransaction = xs;
|
|
30
|
+
exports.getProgramDerivedAddress = Ho;
|
|
31
|
+
exports.isBase58EncodedAddress = Ko;
|
|
32
|
+
exports.isSignerRole = Zo;
|
|
33
|
+
exports.isWritableRole = Qo;
|
|
34
|
+
exports.mergeRoles = es;
|
|
35
|
+
exports.prependTransactionInstruction = Ss;
|
|
36
|
+
exports.setTransactionFeePayer = ys;
|
|
37
|
+
exports.setTransactionLifetimeUsingBlockhash = ms;
|
|
38
|
+
exports.setTransactionLifetimeUsingDurableNonce = hs;
|
|
39
|
+
exports.signBytes = Ve;
|
|
40
|
+
exports.signTransaction = Es;
|
|
41
|
+
exports.upgradeRoleToSigner = ts;
|
|
42
|
+
exports.upgradeRoleToWritable = rs;
|
|
43
|
+
exports.verifySignature = as;
|
|
38
44
|
|
|
39
45
|
return exports;
|
|
40
46
|
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
type CacheKey = string | symbol;
|
|
2
|
+
type Config<TInput extends unknown[], TIterable extends AsyncIterable<unknown>> = Readonly<{
|
|
3
|
+
getAbortSignalFromInputArgs: (...args: TInput) => AbortSignal;
|
|
4
|
+
getCacheEntryMissingError: (cacheKey: CacheKey) => Error;
|
|
5
|
+
getCacheKeyFromInputArgs: (...args: TInput) => CacheKey | undefined;
|
|
6
|
+
onCacheHit: (iterable: TIterable, ...args: TInput) => Promise<void>;
|
|
7
|
+
onCreateIterable: (abortSignal: AbortSignal, ...args: TInput) => Promise<TIterable>;
|
|
8
|
+
}>;
|
|
9
|
+
export declare function getCachedAbortableIterableFactory<TInput extends unknown[], TIterable extends AsyncIterable<unknown>>({ getAbortSignalFromInputArgs, getCacheEntryMissingError, getCacheKeyFromInputArgs, onCacheHit, onCreateIterable, }: Config<TInput, TIterable>): (...args: TInput) => Promise<TIterable>;
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=cached-abortable-iterable.d.ts.map
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
export * from '@solana/addresses';
|
|
1
2
|
export * from '@solana/instructions';
|
|
2
3
|
export * from '@solana/keys';
|
|
3
4
|
export * from '@solana/transactions';
|
|
4
5
|
export * from './rpc';
|
|
5
6
|
export * from './rpc-transport';
|
|
7
|
+
export * from './rpc-websocket-transport';
|
|
6
8
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { RpcSubscriptions } from '@solana/rpc-transport/dist/types/json-rpc-types';
|
|
2
|
+
type CacheKey = string | undefined;
|
|
3
|
+
type Config<TRpcSubscriptionsMethods> = Readonly<{
|
|
4
|
+
getDeduplicationKey: GetDeduplicationKeyFn;
|
|
5
|
+
rpcSubscriptions: RpcSubscriptions<TRpcSubscriptionsMethods>;
|
|
6
|
+
}>;
|
|
7
|
+
type GetDeduplicationKeyFn = (subscriptionMethod: string | symbol, payload: unknown) => CacheKey;
|
|
8
|
+
export declare function getRpcSubscriptionsWithSubscriptionCoalescing<TRpcSubscriptionsMethods>({ getDeduplicationKey, rpcSubscriptions, }: Config<TRpcSubscriptionsMethods>): RpcSubscriptions<TRpcSubscriptionsMethods>;
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=rpc-subscription-coalescer.d.ts.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { IRpcWebSocketTransport } from '@solana/rpc-transport/dist/types/transports/transport-types';
|
|
2
|
+
type Config = Readonly<{
|
|
3
|
+
intervalMs: number;
|
|
4
|
+
transport: IRpcWebSocketTransport;
|
|
5
|
+
}>;
|
|
6
|
+
export declare function getWebSocketTransportWithAutoping({ intervalMs, transport }: Config): IRpcWebSocketTransport;
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=rpc-websocket-autopinger.d.ts.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { IRpcWebSocketTransport } from '@solana/rpc-transport/dist/types/transports/transport-types';
|
|
2
|
+
type Config = Readonly<{
|
|
3
|
+
/**
|
|
4
|
+
* You might like to open more subscriptions per connection than your RPC provider allows for.
|
|
5
|
+
* Using the initial payload as input, return a shard key from this method to assign
|
|
6
|
+
* subscriptions to separate connections. One socket will be opened per shard key.
|
|
7
|
+
*/
|
|
8
|
+
getShard?: (payload: unknown) => string | symbol;
|
|
9
|
+
transport: IRpcWebSocketTransport;
|
|
10
|
+
}>;
|
|
11
|
+
export declare function getWebSocketTransportWithConnectionSharding({ getShard, transport }: Config): IRpcWebSocketTransport;
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=rpc-websocket-connection-sharding.d.ts.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { createWebSocketTransport } from '@solana/rpc-transport';
|
|
2
|
+
import { IRpcWebSocketTransport } from '@solana/rpc-transport/dist/types/transports/transport-types';
|
|
3
|
+
export declare function createDefaultRpcSubscriptionsTransport(config: Omit<Parameters<typeof createWebSocketTransport>[0], 'sendBufferHighWatermark'> & {
|
|
4
|
+
/**
|
|
5
|
+
* You might like to open more subscriptions per connection than your RPC provider allows
|
|
6
|
+
* for. Using the initial payload as input, return a shard key from this method to assign
|
|
7
|
+
* subscriptions to separate connections. One socket will be opened per shard key.
|
|
8
|
+
*/
|
|
9
|
+
getShard?: (payload: unknown) => string;
|
|
10
|
+
intervalMs?: number;
|
|
11
|
+
sendBufferHighWatermark?: number;
|
|
12
|
+
}): IRpcWebSocketTransport;
|
|
13
|
+
//# sourceMappingURL=rpc-websocket-transport.d.ts.map
|
package/dist/types/rpc.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { SolanaRpcMethods } from '@solana/rpc-core';
|
|
2
|
-
import { createJsonRpc } from '@solana/rpc-transport';
|
|
3
|
-
import type { Rpc } from '@solana/rpc-transport/dist/types/json-rpc-types';
|
|
1
|
+
import { SolanaRpcMethods, SolanaRpcSubscriptions } from '@solana/rpc-core';
|
|
2
|
+
import { createJsonRpc, createJsonSubscriptionRpc } from '@solana/rpc-transport';
|
|
3
|
+
import type { Rpc, RpcSubscriptions } from '@solana/rpc-transport/dist/types/json-rpc-types';
|
|
4
4
|
export declare function createSolanaRpc(config: Omit<Parameters<typeof createJsonRpc>[0], 'api'>): Rpc<SolanaRpcMethods>;
|
|
5
|
+
export declare function createSolanaRpcSubscriptions(config: Omit<Parameters<typeof createJsonSubscriptionRpc>[0], 'api'>): RpcSubscriptions<SolanaRpcSubscriptions>;
|
|
5
6
|
//# sourceMappingURL=rpc.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@solana/web3.js",
|
|
3
|
-
"version": "2.0.0-experimental.
|
|
3
|
+
"version": "2.0.0-experimental.ba46ce1",
|
|
4
4
|
"description": "Solana Javascript API",
|
|
5
5
|
"exports": {
|
|
6
6
|
"browser": {
|
|
@@ -50,33 +50,31 @@
|
|
|
50
50
|
],
|
|
51
51
|
"dependencies": {
|
|
52
52
|
"fast-stable-stringify": "^1.0.0",
|
|
53
|
-
"@solana/
|
|
54
|
-
"@solana/
|
|
55
|
-
"@solana/
|
|
56
|
-
"@solana/
|
|
57
|
-
"@solana/
|
|
53
|
+
"@solana/addresses": "2.0.0-experimental.ba46ce1",
|
|
54
|
+
"@solana/functional": "2.0.0-experimental.ba46ce1",
|
|
55
|
+
"@solana/instructions": "2.0.0-experimental.ba46ce1",
|
|
56
|
+
"@solana/keys": "2.0.0-experimental.ba46ce1",
|
|
57
|
+
"@solana/rpc-core": "2.0.0-experimental.ba46ce1",
|
|
58
|
+
"@solana/rpc-transport": "2.0.0-experimental.ba46ce1",
|
|
59
|
+
"@solana/transactions": "2.0.0-experimental.ba46ce1"
|
|
58
60
|
},
|
|
59
61
|
"devDependencies": {
|
|
60
62
|
"@solana/eslint-config-solana": "^1.0.2",
|
|
61
|
-
"@swc/
|
|
62
|
-
"@
|
|
63
|
-
"@
|
|
64
|
-
"@typescript-eslint/
|
|
65
|
-
"@typescript-eslint/parser": "^6.0.0",
|
|
63
|
+
"@swc/jest": "^0.2.28",
|
|
64
|
+
"@types/jest": "^29.5.5",
|
|
65
|
+
"@typescript-eslint/eslint-plugin": "^6.7.0",
|
|
66
|
+
"@typescript-eslint/parser": "^6.3.0",
|
|
66
67
|
"agadoo": "^3.0.0",
|
|
67
68
|
"eslint": "^8.45.0",
|
|
68
69
|
"eslint-plugin-jest": "^27.2.3",
|
|
69
|
-
"eslint-plugin-react-hooks": "^4.6.0",
|
|
70
70
|
"eslint-plugin-sort-keys-fix": "^1.1.2",
|
|
71
|
-
"jest": "^29.
|
|
72
|
-
"jest-environment-jsdom": "^29.6.
|
|
71
|
+
"jest": "^29.7.0",
|
|
72
|
+
"jest-environment-jsdom": "^29.6.4",
|
|
73
73
|
"jest-runner-eslint": "^2.1.0",
|
|
74
74
|
"jest-runner-prettier": "^1.0.0",
|
|
75
|
-
"
|
|
76
|
-
"
|
|
77
|
-
"
|
|
78
|
-
"tsup": "6.7.0",
|
|
79
|
-
"typescript": "^5.1.6",
|
|
75
|
+
"prettier": "^2.8",
|
|
76
|
+
"tsup": "7.2.0",
|
|
77
|
+
"typescript": "^5.2.2",
|
|
80
78
|
"version-from-git": "^1.1.1",
|
|
81
79
|
"build-scripts": "0.0.0",
|
|
82
80
|
"test-config": "0.0.0",
|
|
@@ -95,6 +93,7 @@
|
|
|
95
93
|
"compile:typedefs": "tsc -p ./tsconfig.declarations.json",
|
|
96
94
|
"dev": "jest -c node_modules/test-config/jest-dev.config.ts --rootDir . --watch",
|
|
97
95
|
"publish-packages": "sed -i 's/@solana\\/web3\\.js-experimental/@solana\\/web3\\.js/g' package.json && sed -i 's/@solana\\/web3\\.js/@solana\\/web3\\.js-bak/g' ../library-legacy/package.json && pnpm publish --tag experimental --access public --no-git-checks && git reset --hard",
|
|
96
|
+
"style:fix": "pnpm eslint --fix src/* && pnpm prettier -w src/*",
|
|
98
97
|
"test:lint": "jest -c node_modules/test-config/jest-lint.config.ts --rootDir . --silent",
|
|
99
98
|
"test:prettier": "jest -c node_modules/test-config/jest-prettier.config.ts --rootDir . --silent",
|
|
100
99
|
"test:treeshakability:browser": "agadoo dist/index.browser.js",
|