@solana/transactions 2.0.0-experimental.fc4e943 → 2.0.0-experimental.fd11bd1
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/README.md +314 -5
- package/dist/index.browser.cjs +470 -224
- package/dist/index.browser.cjs.map +1 -1
- package/dist/index.browser.js +469 -225
- package/dist/index.browser.js.map +1 -1
- package/dist/index.development.js +891 -942
- package/dist/index.development.js.map +1 -1
- package/dist/index.native.js +469 -225
- package/dist/index.native.js.map +1 -1
- package/dist/index.node.cjs +470 -224
- package/dist/index.node.cjs.map +1 -1
- package/dist/index.node.js +469 -225
- package/dist/index.node.js.map +1 -1
- package/dist/index.production.min.js +20 -16
- package/dist/types/decompile-transaction.d.ts +7 -0
- package/dist/types/durable-nonce.d.ts +3 -3
- package/dist/types/serializers/address-table-lookup.d.ts +5 -3
- package/dist/types/serializers/instruction.d.ts +4 -2
- package/dist/types/serializers/message.d.ts +4 -4
- package/dist/types/serializers/transaction.d.ts +7 -4
- package/dist/types/signatures.d.ts +1 -0
- package/dist/types/wire-transaction.d.ts +1 -1
- package/package.json +12 -11
- package/dist/types/serializers/unimplemented.d.ts +0 -3
|
@@ -2,23 +2,27 @@ this.globalThis = this.globalThis || {};
|
|
|
2
2
|
this.globalThis.solanaWeb3 = (function (exports) {
|
|
3
3
|
'use strict';
|
|
4
4
|
|
|
5
|
-
var dr=Object.defineProperty;var ur=(e,r,n)=>r in e?dr(e,r,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[r]=n;var y=(e,r,n)=>(ur(e,typeof r!="symbol"?r+"":r,n),n);var S=e=>{let r=e.reduce((o,i)=>o+i.length,0),n=new Uint8Array(r),t=0;return e.forEach(o=>{n.set(o,t),t+=o.length;}),n},le=(e,r)=>{if(e.length>=r)return e;let n=new Uint8Array(r).fill(0);return n.set(e),n},L=(e,r)=>le(e.slice(0,r),r);var b=class extends Error{constructor(n){super(`Serializer [${n}] cannot deserialize empty buffers.`);y(this,"name","DeserializingEmptyBufferError");}},x=class extends Error{constructor(n,t,o){super(`Serializer [${n}] expected ${t} bytes, got ${o}.`);y(this,"name","NotEnoughBytesError");}},I=class extends Error{constructor(n){n??(n="Expected a fixed-size serializer, got a variable-size one.");super(n);y(this,"name","ExpectedFixedSizeSerializerError");}};function _(e,r,n){return {description:n??`fixed(${r}, ${e.description})`,fixedSize:r,maxSize:r,serialize:t=>L(e.serialize(t),r),deserialize:(t,o=0)=>{if(t=t.slice(o,o+r),t.length<r)throw new x("fixSerializer",r,t.length);e.fixedSize!==null&&(t=L(t,e.fixedSize));let[i]=e.deserialize(t,0);return [i,o+r]}}}function k(e,r,n){return {description:e.description,fixedSize:e.fixedSize,maxSize:e.maxSize,serialize:t=>e.serialize(r(t)),deserialize:(t,o=0)=>{let[i,s]=e.deserialize(t,o);return n?[n(i,t,o),s]:[i,s]}}}var M=class extends Error{constructor(n,t,o){let i=`Expected a string of base ${t}, got [${n}].`;super(i);y(this,"name","InvalidBaseStringError");this.cause=o;}};var fe=e=>{let r=e.length,n=BigInt(r);return {description:`base${r}`,fixedSize:null,maxSize:null,serialize(t){if(!t.match(new RegExp(`^[${e}]*$`)))throw new M(t,r);if(t==="")return new Uint8Array;let o=[...t],i=o.findIndex(f=>f!==e[0]);i=i===-1?o.length:i;let s=Array(i).fill(0);if(i===o.length)return Uint8Array.from(s);let c=o.slice(i),u=0n,d=1n;for(let f=c.length-1;f>=0;f-=1)u+=d*BigInt(e.indexOf(c[f])),d*=n;let l=[];for(;u>0n;)l.unshift(Number(u%256n)),u/=256n;return Uint8Array.from(s.concat(l))},deserialize(t,o=0){if(t.length===0)return ["",0];let i=t.slice(o),s=i.findIndex(l=>l!==0);s=s===-1?i.length:s;let c=e[0].repeat(s);if(s===i.length)return [c,t.length];let u=i.slice(s).reduce((l,f)=>l*256n+BigInt(f),0n),d=[];for(;u>0n;)d.unshift(e[Number(u%n)]),u/=n;return [c+d.join(""),t.length]}}};var E=fe("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz");var me=e=>e.replace(/\u0000/g,"");var Z={description:"utf8",fixedSize:null,maxSize:null,serialize(e){return new TextEncoder().encode(e)},deserialize(e,r=0){let n=new TextDecoder().decode(e.slice(r));return [me(n),e.length]}};var P;(function(e){e.Little="le",e.Big="be";})(P||(P={}));var V=class extends RangeError{constructor(n,t,o,i){super(`Serializer [${n}] expected number to be between ${t} and ${o}, got ${i}.`);y(this,"name","NumberOutOfRangeError");}};function F(e){let r,n=e.name;return e.size>1&&(r=!("endian"in e.options)||e.options.endian===P.Little,n+=r?"(le)":"(be)"),{description:e.options.description??n,fixedSize:e.size,maxSize:e.size,serialize(t){e.range&&J(e.name,e.range[0],e.range[1],t);let o=new ArrayBuffer(e.size);return e.set(new DataView(o),t,r),new Uint8Array(o)},deserialize(t,o=0){let i=t.slice(o,o+e.size);mr("i8",i,e.size);let s=fr(i);return [e.get(s,r),o+e.size]}}}var lr=e=>e.buffer.slice(e.byteOffset,e.byteLength+e.byteOffset),fr=e=>new DataView(lr(e)),J=(e,r,n,t)=>{if(t<r||t>n)throw new V(e,r,n,t)},mr=(e,r,n)=>{if(r.length===0)throw new b(e);if(r.length<n)throw new x(e,n,r.length)};var w=(e={})=>F({name:"u8",size:1,range:[0,+"0xff"],set:(r,n)=>r.setUint8(0,Number(n)),get:r=>r.getUint8(0),options:e});var R=(e={})=>F({name:"u32",size:4,range:[0,+"0xffffffff"],set:(r,n,t)=>r.setUint32(0,Number(n),t),get:(r,n)=>r.getUint32(0,n),options:e});var p=(e={})=>({description:e.description??"shortU16",fixedSize:null,maxSize:3,serialize:r=>{J("shortU16",0,65535,r);let n=[0];for(let t=0;;t+=1){let o=r>>t*7;if(o===0)break;let i=127&o;n[t]=i,t>0&&(n[t-1]|=128);}return new Uint8Array(n)},deserialize:(r,n=0)=>{let t=0,o=0;for(;++o;){let i=o-1,s=r[n+i],c=127&s;if(t|=c<<i*7,!(s&128))break}return [t,n+o]}});var W=class extends Error{constructor(n,t,o){super(`Expected [${n}] to have ${t} items, got ${o}.`);y(this,"name","InvalidNumberOfItemsError");}},H=class extends Error{constructor(n,t){super(`The remainder of the buffer (${n} bytes) cannot be split into chunks of ${t} bytes. Serializers of "remainder" size must have a remainder that is a multiple of its item size. In other words, ${n} modulo ${t} should be equal to zero.`);y(this,"name","InvalidArrayLikeRemainderSizeError");}},j=class extends Error{constructor(n){super(`Unrecognized array-like serializer size: ${JSON.stringify(n)}`);y(this,"name","UnrecognizedArrayLikeSerializerSizeError");}};function v(e){return e.reduce((r,n)=>r===null||n===null?null:r+n,0)}function ge(e,r,n,t){if(typeof e=="number")return [e,t];if(typeof e=="object")return e.deserialize(n,t);if(e==="remainder"){let o=v(r);if(o===null)throw new I('Serializers of "remainder" size must have fixed-size items.');let i=n.slice(t).length;if(i%o!==0)throw new H(i,o);return [i/o,t]}throw new j(e)}function D(e){return typeof e=="object"?e.description:`${e}`}function Q(e,r){if(typeof e!="number")return null;if(e===0)return 0;let n=v(r);return n===null?null:n*e}function pe(e,r){return typeof e=="object"?e.serialize(r):new Uint8Array}function h(e,r={}){let n=r.size??R();if(n==="remainder"&&e.fixedSize===null)throw new I('Serializers of "remainder" size must have fixed-size items.');return {description:r.description??`array(${e.description}; ${D(n)})`,fixedSize:Q(n,[e.fixedSize]),maxSize:Q(n,[e.maxSize]),serialize:t=>{if(typeof n=="number"&&t.length!==n)throw new W("array",n,t.length);return S([pe(n,t.length),...t.map(o=>e.serialize(o))])},deserialize:(t,o=0)=>{if(typeof n=="object"&&t.slice(o).length===0)return [[],o];let[i,s]=ge(n,[e.fixedSize],t,o);o=s;let c=[];for(let u=0;u<i;u+=1){let[d,l]=e.deserialize(t,o);c.push(d),o=l;}return [c,o]}}}function U(e={}){let r=e.size??"variable",n=e.description??`bytes(${D(r)})`,t={description:n,fixedSize:null,maxSize:null,serialize:o=>new Uint8Array(o),deserialize:(o,i=0)=>{let s=o.slice(i);return [s,i+s.length]}};return r==="variable"?t:typeof r=="number"?_(t,r,n):{description:n,fixedSize:null,maxSize:null,serialize:o=>{let i=t.serialize(o),s=r.serialize(i.length);return S([s,i])},deserialize:(o,i=0)=>{if(o.slice(i).length===0)throw new b("bytes");let[s,c]=r.deserialize(o,i),u=Number(s);i=c;let d=o.slice(i,i+u);if(d.length<u)throw new x("bytes",u,d.length);let[l,f]=t.deserialize(d);return i+=f,[l,i]}}}function ee(e={}){let r=e.size??R(),n=e.encoding??Z,t=e.description??`string(${n.description}; ${D(r)})`;return r==="variable"?{...n,description:t}:typeof r=="number"?_(n,r,t):{description:t,fixedSize:null,maxSize:null,serialize:o=>{let i=n.serialize(o),s=r.serialize(i.length);return S([s,i])},deserialize:(o,i=0)=>{if(o.slice(i).length===0)throw new b("string");let[s,c]=r.deserialize(o,i),u=Number(s);i=c;let d=o.slice(i,i+u);if(d.length<u)throw new x("string",u,d.length);let[l,f]=n.deserialize(d);return i+=f,[l,i]}}}function T(e,r={}){let n=e.map(([t,o])=>`${String(t)}: ${o.description}`).join(", ");return {description:r.description??`struct(${n})`,fixedSize:v(e.map(([,t])=>t.fixedSize)),maxSize:v(e.map(([,t])=>t.maxSize)),serialize:t=>{let o=e.map(([i,s])=>s.serialize(t[i]));return S(o)},deserialize:(t,o=0)=>{let i={};return e.forEach(([s,c])=>{let[u,d]=c.deserialize(t,o);o=d,i[s]=u;}),[i,o]}}}function A(e){if("signatures"in e){let{signatures:r,...n}=e;return n}else return e}function qt(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 n=E.serialize(e).byteLength;if(n!==32)throw new Error(`Expected input string to decode to a byte array of length 32. Actual length: ${n}`)}catch(r){throw new Error(`\`${e}\` is not a blockhash`,{cause:r})}}function Xt(e,r){if("lifetimeConstraint"in r&&r.lifetimeConstraint.blockhash===e.blockhash&&r.lifetimeConstraint.lastValidBlockHeight===e.lastValidBlockHeight)return r;let n={...A(r),lifetimeConstraint:e};return Object.freeze(n),n}function Qt({version:e}){let r={instructions:[],version:e};return Object.freeze(r),r}var g=(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))(g||{});var gr=1;function B(e){return e>=2}function C(e){return (e&gr)!==0}function re(e,r){return e|r}var ye="SysvarRecentB1ockHashes11111111111111111111",he="11111111111111111111111111111111";function uo(e){if(!xe(e))throw new Error("Transaction is not a durable nonce transaction")}function pr(e,r){return {accounts:[{address:e,role:g.WRITABLE},{address:ye,role:g.READONLY},{address:r,role:g.READONLY_SIGNER}],data:new Uint8Array([4,0,0,0]),programAddress:he}}function yr(e){return e.programAddress===he&&e.data!=null&&hr(e.data)&&e.accounts?.length===3&&e.accounts[0].address!=null&&e.accounts[0].role===g.WRITABLE&&e.accounts[1].address===ye&&e.accounts[1].role===g.READONLY&&e.accounts[2].address!=null&&e.accounts[2].role===g.READONLY_SIGNER}function hr(e){return e.byteLength===4&&e[0]===4&&e[1]===0&&e[2]===0&&e[3]===0}function xe(e){return "lifetimeConstraint"in e&&typeof e.lifetimeConstraint.nonce=="string"&&e.instructions[0]!=null&&yr(e.instructions[0])}function lo({nonce:e,nonceAccountAddress:r,nonceAuthorityAddress:n},t){let o=xe(t);if(o&&t.lifetimeConstraint.nonce===e&&t.instructions[0].accounts[0].address===r&&t.instructions[0].accounts[2].address===n)return t;let i={...A(t),instructions:[pr(r,n),...o?t.instructions.slice(1):t.instructions],lifetimeConstraint:{nonce:e}};return Object.freeze(i),i}function po(e,r){if("feePayer"in r&&e===r.feePayer)return r;let n={...A(r),feePayer:e};return Object.freeze(n),n}function To(e,r){let n={...A(r),instructions:[...r.instructions,e]};return Object.freeze(n),n}function So(e,r){let n={...A(r),instructions:[e,...r.instructions]};return Object.freeze(n),n}function $(e,r,n=0){if(r.length-n<=0)throw new Error(`Codec [${e}] cannot decode empty byte arrays.`)}function N(e,r,n,t=0){let o=n.length-t;if(o<r)throw new Error(`Codec [${e}] expected ${r} bytes, got ${o}.`)}var K=e=>{let r=e.filter(i=>i.length);if(r.length===0)return e.length?e[0]:new Uint8Array;if(r.length===1)return r[0];let n=r.reduce((i,s)=>i+s.length,0),t=new Uint8Array(n),o=0;return r.forEach(i=>{t.set(i,o),o+=i.length;}),t},xr=(e,r)=>{if(e.length>=r)return e;let n=new Uint8Array(r).fill(0);return n.set(e),n},ne=(e,r)=>xr(e.length<=r?e:e.slice(0,r),r);function z(e,r,n){if(e.fixedSize!==r.fixedSize)throw new Error(`Encoder and decoder must have the same fixed size, got [${e.fixedSize}] and [${r.fixedSize}].`);if(e.maxSize!==r.maxSize)throw new Error(`Encoder and decoder must have the same max size, got [${e.maxSize}] and [${r.maxSize}].`);if(n===void 0&&e.description!==r.description)throw new Error(`Encoder and decoder must have the same description, got [${e.description}] and [${r.description}]. Pass a custom description as a third argument if you want to override the description and bypass this error.`);return {decode:r.decode,description:n??e.description,encode:e.encode,fixedSize:e.fixedSize,maxSize:e.maxSize}}function Te(e,r,n){return {description:n??`fixed(${r}, ${e.description})`,fixedSize:r,maxSize:r}}function te(e,r,n){return {...Te(e,r,n),encode:t=>ne(e.encode(t),r)}}function oe(e,r,n){return {...Te(e,r,n),decode:(t,o=0)=>{N("fixCodec",r,t,o),(o>0||t.length>r)&&(t=t.slice(o,o+r)),e.fixedSize!==null&&(t=ne(t,e.fixedSize));let[i]=e.decode(t,0);return [i,o+r]}}}function Se(e,r){return {description:e.description,encode:n=>e.encode(r(n)),fixedSize:e.fixedSize,maxSize:e.maxSize}}function Tr(e,r,n,t){if(t<r||t>n)throw new Error(`Codec [${e}] expected number to be in the range [${r}, ${n}], got ${t}.`)}function be(e){let r,n=e.name;return e.size>1&&(r=!("endian"in e.options)||e.options.endian===0,n+=r?"(le)":"(be)"),{description:e.options.description??n,fixedSize:e.size,littleEndian:r,maxSize:e.size}}function Ae(e){let r=be(e);return {description:r.description,encode(n){e.range&&Tr(e.name,e.range[0],e.range[1],n);let t=new ArrayBuffer(e.size);return e.set(new DataView(t),n,r.littleEndian),new Uint8Array(t)},fixedSize:r.fixedSize,maxSize:r.maxSize}}function ze(e){let r=be(e);return {decode(n,t=0){$(r.description,n,t),N(r.description,e.size,n,t);let o=new DataView(Sr(n,t,e.size));return [e.get(o,r.littleEndian),t+e.size]},description:r.description,fixedSize:r.fixedSize,maxSize:r.maxSize}}function Sr(e,r,n){let t=e.byteOffset+(r??0),o=n??e.byteLength;return e.buffer.slice(t,t+o)}var Ee=(e={})=>Ae({name:"u32",options:e,range:[0,+"0xffffffff"],set:(r,n,t)=>r.setUint32(0,n,t),size:4}),Ie=(e={})=>ze({get:(r,n)=>r.getUint32(0,n),name:"u32",options:e,size:4});var we=(e={})=>Ae({name:"u8",options:e,range:[0,+"0xff"],set:(r,n)=>r.setUint8(0,n),size:1}),Be=(e={})=>ze({get:r=>r.getUint8(0),name:"u8",options:e,size:1}),Ce=(e={})=>z(we(e),Be(e));function br(e,r,n=r){if(!r.match(new RegExp(`^[${e}]*$`)))throw new Error(`Expected a string of base ${e.length}, got [${n}].`)}var Ar=e=>{let r=e.length,n=BigInt(r);return {description:`base${r}`,encode(t){if(br(e,t),t==="")return new Uint8Array;let o=[...t],i=o.findIndex(f=>f!==e[0]);i=i===-1?o.length:i;let s=Array(i).fill(0);if(i===o.length)return Uint8Array.from(s);let c=o.slice(i),u=0n,d=1n;for(let f=c.length-1;f>=0;f-=1)u+=d*BigInt(e.indexOf(c[f])),d*=n;let l=[];for(;u>0n;)l.unshift(Number(u%256n)),u/=256n;return Uint8Array.from(s.concat(l))},fixedSize:null,maxSize:null}},zr=e=>{let r=e.length,n=BigInt(r);return {decode(t,o=0){let i=o===0?t:t.slice(o);if(i.length===0)return ["",0];let s=i.findIndex(l=>l!==0);s=s===-1?i.length:s;let c=e[0].repeat(s);if(s===i.length)return [c,t.length];let u=i.slice(s).reduce((l,f)=>l*256n+BigInt(f),0n),d=[];for(;u>0n;)d.unshift(e[Number(u%n)]),u/=n;return [c+d.join(""),t.length]},description:`base${r}`,fixedSize:null,maxSize:null}};var ve="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz",De=()=>Ar(ve),Ne=()=>zr(ve);var Er=e=>e.replace(/\u0000/g,"");var Ir=globalThis.TextDecoder,wr=globalThis.TextEncoder,Br=()=>{let e;return {description:"utf8",encode:r=>new Uint8Array((e||(e=new wr)).encode(r)),fixedSize:null,maxSize:null}},Cr=()=>{let e;return {decode(r,n=0){let t=(e||(e=new Ir)).decode(r.slice(n));return [Er(t),r.length]},description:"utf8",fixedSize:null,maxSize:null}};var _e=(e={})=>{let r=e.size??Ee(),n=e.encoding??Br(),t=e.description??`string(${n.description}; ${Re(r)})`;return r==="variable"?{...n,description:t}:typeof r=="number"?te(n,r,t):{description:t,encode:o=>{let i=n.encode(o),s=r.encode(i.length);return K([s,i])},fixedSize:null,maxSize:null}},ke=(e={})=>{let r=e.size??Ie(),n=e.encoding??Cr(),t=e.description??`string(${n.description}; ${Re(r)})`;return r==="variable"?{...n,description:t}:typeof r=="number"?oe(n,r,t):{decode:(o,i=0)=>{$("string",o,i);let[s,c]=r.decode(o,i),u=Number(s);i=c;let d=o.slice(i,i+u);N("string",u,d);let[l,f]=n.decode(d);return i+=f,[l,i]},description:t,fixedSize:null,maxSize:null}};function Re(e){return typeof e=="object"?e.description:`${e}`}function Ue(){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")}async function $e(){if(Ue(),typeof globalThis.crypto>"u"||typeof globalThis.crypto.subtle?.exportKey!="function")throw new Error("No key export implementation could be found")}async function Oe(){if(Ue(),typeof globalThis.crypto>"u"||typeof globalThis.crypto.subtle?.sign!="function")throw new Error("No signing implementation could be found")}var ie,se;function Le(){return ie||(ie=De()),ie}function vr(){return se||(se=Ne()),se}function Dr(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=Le().encode(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 Nr(e){return Dr(e),e}function _r(e){return Se(_e({description:e?.description??"Base58EncodedAddress",encoding:Le(),size:32}),r=>Nr(r))}function Me(e){return ke({description:e?.description??"Base58EncodedAddress",encoding:vr(),size:32})}function Y(e){return z(_r(e),Me(e))}function O(){return new Intl.Collator("en",{caseFirst:"lower",ignorePunctuation:!1,localeMatcher:"best fit",numeric:!1,sensitivity:"variant",usage:"sort"}).compare}async function Pe(e){if(await $e(),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),[n]=Me().decode(new Uint8Array(r));return n}function Ve(e,r,n){e[r]=n(e[r]??{role:g.READONLY});}var m=Symbol("AddressMapTypeProperty");function Fe(e,r){let n={[e]:{[m]:0,role:g.WRITABLE_SIGNER}},t=new Set;for(let o of r){Ve(n,o.programAddress,s=>{if(t.add(o.programAddress),m in s){if(C(s.role))switch(s[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(s[m]===2)return s}return {[m]:2,role:g.READONLY}});let i;if(o.accounts)for(let s of o.accounts)Ve(n,s.address,c=>{let{address:u,...d}=s;if(m in c)switch(c[m]){case 0:return c;case 1:{let l=re(c.role,d.role);if("lookupTableAddress"in d){if(c.lookupTableAddress!==d.lookupTableAddress&&(i||(i=O()))(d.lookupTableAddress,c.lookupTableAddress)<0)return {[m]:1,...d,role:l}}else if(B(d.role))return {[m]:2,role:l};return c.role!==l?{...c,role:l}:c}case 2:{let l=re(c.role,d.role);if(t.has(s.address)){if(C(d.role))throw new Error(`This transaction includes an address (\`${s.address}\`) which is both invoked and marked writable. Program addresses may not be writable.`);return c.role!==l?{...c,role:l}:c}else return "lookupTableAddress"in d&&!B(c.role)?{...d,[m]:1,role:l}:c.role!==l?{...c,role:l}:c}}return "lookupTableAddress"in d?{...d,[m]:1}:{...d,[m]:2}});}return n}function We(e){let r;return Object.entries(e).sort(([t,o],[i,s])=>{if(o[m]!==s[m]){if(o[m]===0)return -1;if(s[m]===0)return 1;if(o[m]===2)return -1;if(s[m]===2)return 1}let c=B(o.role);if(c!==B(s.role))return c?-1:1;let u=C(o.role);return u!==C(s.role)?u?-1:1:(r||(r=O()),o[m]===1&&s[m]===1&&o.lookupTableAddress!==s.lookupTableAddress?r(o.lookupTableAddress,s.lookupTableAddress):r(t,i))}).map(([t,o])=>({address:t,...o}))}function He(e){var n;let r={};for(let t of e){if(!("lookupTableAddress"in t))continue;let o=r[n=t.lookupTableAddress]||(r[n]={readableIndices:[],writableIndices:[]});t.role===g.WRITABLE?o.writableIndices.push(t.addressIndex):o.readableIndices.push(t.addressIndex);}return Object.keys(r).sort(O()).map(t=>({lookupTableAddress:t,...r[t]}))}function je(e){let r=0,n=0,t=0;for(let o of e){if("lookupTableAddress"in o)break;let i=C(o.role);B(o.role)?(t++,i||n++):i||r++;}return {numReadonlyNonSignerAccounts:r,numReadonlySignerAccounts:n,numSignerAccounts:t}}function kr(e){let r={};for(let[n,t]of e.entries())r[t.address]=n;return r}function Ke(e,r){let n=kr(r);return e.map(({accounts:t,data:o,programAddress:i})=>({programAddressIndex:n[i],...t?{accountIndices:t.map(({address:s})=>n[s])}:null,...o?{data:o}:null}))}function Ye(e){return "nonce"in e?e.nonce:e.blockhash}function Ge(e){let r=e.findIndex(t=>"lookupTableAddress"in t);return (r===-1?e:e.slice(0,r)).map(({address:t})=>t)}function G(e){let r=Fe(e.feePayer,e.instructions),n=We(r);return {...e.version!=="legacy"?{addressTableLookups:He(n)}:null,header:je(n),instructions:Ke(e.instructions,n),lifetimeToken:Ye(e.lifetimeConstraint),staticAccounts:Ge(n),version:e.version}}function qe(e){let r=G(e),n;if("signatures"in e){n=[];for(let t=0;t<r.header.numSignerAccounts;t++)n[t]=e.signatures[r.staticAccounts[t]]??new Uint8Array(Array(64).fill(0));}else n=Array(r.header.numSignerAccounts).fill(new Uint8Array(Array(64).fill(0)));return {compiledMessage:r,signatures:n}}function Rr(e){let r=Y();return {description:e?.description??r.description,deserialize:r.decode,fixedSize:r.fixedSize,maxSize:r.maxSize,serialize:r.encode}}function Xe(){return T([["lookupTableAddress",Rr(void 0)],["writableIndices",h(w(),{size:p()})],["readableIndices",h(w(),{size:p()})]],void 0)}function Ze(e){return e.reduce((r,n)=>r===null||n===null?null:r+n,0)}function Je(e,r){let n=e.map(([t,o])=>`${String(t)}: ${o.description}`).join(", ");return {description:r??`struct(${n})`,fixedSize:Ze(e.map(([,t])=>t.fixedSize)),maxSize:Ze(e.map(([,t])=>t.maxSize))}}function Qe(e,r={}){return {...Je(e,r.description),encode:n=>{let t=e.map(([o,i])=>i.encode(n[o]));return K(t)}}}function er(e,r={}){return {...Je(e,r.description),decode:(n,t=0)=>{let o={};return e.forEach(([i,s])=>{let[c,u]=s.decode(n,t);t=u,o[i]=c;}),[o,t]}}}function rr(e,r={}){return z(Qe(e,r),er(e,r))}var ae;function Ur(){return ae||(ae=Ce()),ae}function ce(e){let r=Ur();return {...r,description:e??r.description}}var $r=void 0,Or=void 0,Lr=void 0,Mr=void 0;function nr(){return rr([["numSignerAccounts",ce($r)],["numReadonlySignerAccounts",ce(Or)],["numReadonlyNonSignerAccounts",ce(Lr)]],{description:Mr})}function tr(){return k(T([["programAddressIndex",w(void 0)],["accountIndices",h(w({description:""}),{description:"",size:p()})],["data",U({description:"",size:p()})]]),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:r,data:n,...t}=e;return {...t,...r.length?{accountIndices:r}:null,...n.byteLength?{data:n}:null}})}var de=128,or={description:"",fixedSize:null,maxSize:1};function Pr(e,r=0){let n=e[r];return n&de?[n^de,r+1]:["legacy",r]}function Vr(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|de])}function Fr(){return {...or,decode:Pr}}function Wr(){return {...or,encode:Vr}}function ir(){return z(Wr(),Fr())}function Hr(e,r){let n=r+e[0].toUpperCase()+e.slice(1);return new Error(`No ${e} exists for ${r}. Use \`get${n}()\` if you need a ${e}, and \`get${r}Codec()\` if you need to both encode and decode ${r}`)}function q(e){return ()=>{throw Hr("decoder",e)}}var jr={description:"",fixedSize:null,maxSize:null};function Kr(e){return e.version==="legacy"?T(sr()).serialize(e):k(T([...sr(),["addressTableLookups",Yr()]]),r=>r.version==="legacy"?r:{...r,addressTableLookups:r.addressTableLookups??[]}).serialize(e)}function ue(e){return {description:e.description,deserialize:e.decode,fixedSize:e.fixedSize,maxSize:e.maxSize,serialize:e.encode}}function sr(){return [["version",ue(ir())],["header",ue(nr())],["staticAccounts",h(ue(Y()),{description:"",size:p()})],["lifetimeToken",ee({description:"",encoding:E,size:32})],["instructions",h(tr(),{description:"",size:p()})]]}function Yr(){return h(Xe(),{size:p()})}function X(){return {...jr,deserialize:q("CompiledMessage"),serialize:Kr}}var Gr={description:"",fixedSize:null,maxSize:null};function qr(e){let r=qe(e);return T([["signatures",h(U({size:64}),{size:p()})],["compiledMessage",X()]]).serialize(r)}function ar(){return {...Gr,deserialize:q("CompiledMessage"),serialize:qr}}async function cr(e,r){await Oe();let n=await crypto.subtle.sign("Ed25519",e,r);return new Uint8Array(n)}function Xr(e){try{if(e.length<64||e.length>88)throw new Error("Expected input string to decode to a byte array of length 64.");let n=E.serialize(e).byteLength;if(n!==64)throw new Error(`Expected input string to decode to a byte array of length 64. Actual length: ${n}`)}catch(r){throw new Error(`\`${e}\` is not a transaction signature`,{cause:r})}}function Ns(e){return !(e.length<64||e.length>88||E.serialize(e).byteLength!==64)}async function Zr(e,r){let n=X().serialize(e);return await cr(r,n)}function _s(e){let r=e.signatures[e.feePayer];if(!r)throw new Error("Could not determine this transaction's signature. Make sure that the transaction has been signed by its fee payer.");return r}async function ks(e,r){let n=G(r),t="signatures"in r?{...r.signatures}:{},o=await Promise.all(e.map(s=>Promise.all([Pe(s.publicKey),Zr(n,s.privateKey)])));for(let[s,c]of o)t[s]=c;let i={...r,signatures:t};return Object.freeze(i),i}function Rs(e){return Xr(e),e}function Ls(e){let r=ar().serialize(e);return btoa(String.fromCharCode(...r))}
|
|
5
|
+
function N(e,n,r=0){if(n.length-r<=0)throw new Error(`Codec [${e}] cannot decode empty byte arrays.`)}function w(e,n,r,t=0){let o=r.length-t;if(o<n)throw new Error(`Codec [${e}] expected ${n} bytes, got ${o}.`)}var k=e=>{let n=e.filter(i=>i.length);if(n.length===0)return e.length?e[0]:new Uint8Array;if(n.length===1)return n[0];let r=n.reduce((i,s)=>i+s.length,0),t=new Uint8Array(r),o=0;return n.forEach(i=>{t.set(i,o),o+=i.length;}),t},Bn=(e,n)=>{if(e.length>=n)return e;let r=new Uint8Array(n).fill(0);return r.set(e),r},Z=(e,n)=>Bn(e.length<=n?e:e.slice(0,n),n);function z(e,n,r){if(e.fixedSize!==n.fixedSize)throw new Error(`Encoder and decoder must have the same fixed size, got [${e.fixedSize}] and [${n.fixedSize}].`);if(e.maxSize!==n.maxSize)throw new Error(`Encoder and decoder must have the same max size, got [${e.maxSize}] and [${n.maxSize}].`);if(r===void 0&&e.description!==n.description)throw new Error(`Encoder and decoder must have the same description, got [${e.description}] and [${n.description}]. Pass a custom description as a third argument if you want to override the description and bypass this error.`);return {decode:n.decode,description:r??e.description,encode:e.encode,fixedSize:e.fixedSize,maxSize:e.maxSize}}function ge(e,n,r){return {description:r??`fixed(${n}, ${e.description})`,fixedSize:n,maxSize:n}}function U(e,n,r){return {...ge(e,n,r),encode:t=>Z(e.encode(t),n)}}function O(e,n,r){return {...ge(e,n,r),decode:(t,o=0)=>{w("fixCodec",n,t,o),(o>0||t.length>n)&&(t=t.slice(o,o+n)),e.fixedSize!==null&&(t=Z(t,e.fixedSize));let[i]=e.decode(t,0);return [i,o+n]}}}function B(e,n){return {description:e.description,encode:r=>e.encode(n(r)),fixedSize:e.fixedSize,maxSize:e.maxSize}}function D(e,n){return {decode:(r,t=0)=>{let[o,i]=e.decode(r,t);return [n(o,r,t),i]},description:e.description,fixedSize:e.fixedSize,maxSize:e.maxSize}}function pe(e,n,r,t){if(t<n||t>r)throw new Error(`Codec [${e}] expected number to be in the range [${n}, ${r}], got ${t}.`)}function me(e){let n,r=e.name;return e.size>1&&(n=!("endian"in e.options)||e.options.endian===0,r+=n?"(le)":"(be)"),{description:e.options.description??r,fixedSize:e.size,littleEndian:n,maxSize:e.size}}function Te(e){let n=me(e);return {description:n.description,encode(r){e.range&&pe(e.name,e.range[0],e.range[1],r);let t=new ArrayBuffer(e.size);return e.set(new DataView(t),r,n.littleEndian),new Uint8Array(t)},fixedSize:n.fixedSize,maxSize:n.maxSize}}function ye(e){let n=me(e);return {decode(r,t=0){N(n.description,r,t),w(n.description,e.size,r,t);let o=new DataView(wn(r,t,e.size));return [e.get(o,n.littleEndian),t+e.size]},description:n.description,fixedSize:n.fixedSize,maxSize:n.maxSize}}function wn(e,n,r){let t=e.byteOffset+(n??0),o=r??e.byteLength;return e.buffer.slice(t,t+o)}var m=(e={})=>({description:e.description??"shortU16",encode:n=>{pe("shortU16",0,65535,n);let r=[0];for(let t=0;;t+=1){let o=n>>t*7;if(o===0)break;let i=127&o;r[t]=i,t>0&&(r[t-1]|=128);}return new Uint8Array(r)},fixedSize:null,maxSize:3}),T=(e={})=>({decode:(n,r=0)=>{let t=0,o=0;for(;++o;){let i=o-1,s=n[r+i],c=127&s;if(t|=c<<i*7,!(s&128))break}return [t,r+o]},description:e.description??"shortU16",fixedSize:null,maxSize:3});var P=(e={})=>Te({name:"u32",options:e,range:[0,+"0xffffffff"],set:(n,r,t)=>n.setUint32(0,r,t),size:4}),W=(e={})=>ye({get:(n,r)=>n.getUint32(0,r),name:"u32",options:e,size:4});var S=(e={})=>Te({name:"u8",options:e,range:[0,+"0xff"],set:(n,r)=>n.setUint8(0,r),size:1}),x=(e={})=>ye({get:n=>n.getUint8(0),name:"u8",options:e,size:1});function Dn(e,n,r=n){if(!n.match(new RegExp(`^[${e}]*$`)))throw new Error(`Expected a string of base ${e.length}, got [${r}].`)}var vn=e=>{let n=e.length,r=BigInt(n);return {description:`base${n}`,encode(t){if(Dn(e,t),t==="")return new Uint8Array;let o=[...t],i=o.findIndex(p=>p!==e[0]);i=i===-1?o.length:i;let s=Array(i).fill(0);if(i===o.length)return Uint8Array.from(s);let c=o.slice(i),u=0n,a=1n;for(let p=c.length-1;p>=0;p-=1)u+=a*BigInt(e.indexOf(c[p])),a*=r;let l=[];for(;u>0n;)l.unshift(Number(u%256n)),u/=256n;return Uint8Array.from(s.concat(l))},fixedSize:null,maxSize:null}},Nn=e=>{let n=e.length,r=BigInt(n);return {decode(t,o=0){let i=o===0?t:t.slice(o);if(i.length===0)return ["",0];let s=i.findIndex(l=>l!==0);s=s===-1?i.length:s;let c=e[0].repeat(s);if(s===i.length)return [c,t.length];let u=i.slice(s).reduce((l,p)=>l*256n+BigInt(p),0n),a=[];for(;u>0n;)a.unshift(e[Number(u%r)]),u/=r;return [c+a.join(""),t.length]},description:`base${n}`,fixedSize:null,maxSize:null}};var Ae="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz",I=()=>vn(Ae),_=()=>Nn(Ae);var kn=e=>e.replace(/\u0000/g,"");var _n=globalThis.TextDecoder,Ln=globalThis.TextEncoder,Rn=()=>{let e;return {description:"utf8",encode:n=>new Uint8Array((e||(e=new Ln)).encode(n)),fixedSize:null,maxSize:null}},Mn=()=>{let e;return {decode(n,r=0){let t=(e||(e=new _n)).decode(n.slice(r));return [kn(t),n.length]},description:"utf8",fixedSize:null,maxSize:null}};var $=(e={})=>{let n=e.size??P(),r=e.encoding??Rn(),t=e.description??`string(${r.description}; ${he(n)})`;return n==="variable"?{...r,description:t}:typeof n=="number"?U(r,n,t):{description:t,encode:o=>{let i=r.encode(o),s=n.encode(i.length);return k([s,i])},fixedSize:null,maxSize:null}},V=(e={})=>{let n=e.size??W(),r=e.encoding??Mn(),t=e.description??`string(${r.description}; ${he(n)})`;return n==="variable"?{...r,description:t}:typeof n=="number"?O(r,n,t):{decode:(o,i=0)=>{N("string",o,i);let[s,c]=n.decode(o,i),u=Number(s);i=c;let a=o.slice(i,i+u);w("string",u,a);let[l,p]=r.decode(a);return i+=p,[l,i]},description:t,fixedSize:null,maxSize:null}};function he(e){return typeof e=="object"?e.description:`${e}`}function C(e){if("signatures"in e){let{signatures:n,...r}=e;return r}else return e}var J;function Cr(e){J||(J=I());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=J.encode(e).byteLength;if(r!==32)throw new Error(`Expected input string to decode to a byte array of length 32. Actual length: ${r}`)}catch(n){throw new Error(`\`${e}\` is not a blockhash`,{cause:n})}}function be(e,n){if("lifetimeConstraint"in n&&n.lifetimeConstraint.blockhash===e.blockhash&&n.lifetimeConstraint.lastValidBlockHeight===e.lastValidBlockHeight)return n;let r={...C(n),lifetimeConstraint:e};return Object.freeze(r),r}function Ee({version:e}){let n={instructions:[],version:e};return Object.freeze(n),n}var g=(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))(g||{});var Un=1;function y(e){return e>=2}function v(e){return (e&Un)!==0}function Q(e,n){return e|n}var xe="SysvarRecentB1ockHashes11111111111111111111",Ie="11111111111111111111111111111111";function $r(e){if(!Ce(e))throw new Error("Transaction is not a durable nonce transaction")}function Se(e,n){return {accounts:[{address:e,role:g.WRITABLE},{address:xe,role:g.READONLY},{address:n,role:g.READONLY_SIGNER}],data:new Uint8Array([4,0,0,0]),programAddress:Ie}}function F(e){return e.programAddress===Ie&&e.data!=null&&On(e.data)&&e.accounts?.length===3&&e.accounts[0].address!=null&&e.accounts[0].role===g.WRITABLE&&e.accounts[1].address===xe&&e.accounts[1].role===g.READONLY&&e.accounts[2].address!=null&&y(e.accounts[2].role)}function On(e){return e.byteLength===4&&e[0]===4&&e[1]===0&&e[2]===0&&e[3]===0}function Ce(e){return "lifetimeConstraint"in e&&typeof e.lifetimeConstraint.nonce=="string"&&e.instructions[0]!=null&&F(e.instructions[0])}function Pn(e,n,r){return e.accounts[0].address===n&&e.accounts[2].address===r}function ze({nonce:e,nonceAccountAddress:n,nonceAuthorityAddress:r},t){let o,i=t.instructions[0];if(i&&F(i))if(Pn(i,n,r)){if(Ce(t)&&t.lifetimeConstraint.nonce===e)return t;o=[i,...t.instructions.slice(1)];}else o=[Se(n,r),...t.instructions.slice(1)];else o=[Se(n,r),...t.instructions];let s={...C(t),instructions:o,lifetimeConstraint:{nonce:e}};return Object.freeze(s),s}function Be(e,n){if("feePayer"in n&&e===n.feePayer)return n;let r={...C(n),feePayer:e};return Object.freeze(r),r}function we(e,n){let r={...C(n),instructions:[...n.instructions,e]};return Object.freeze(r),r}function qr(e,n){let r={...C(n),instructions:[e,...n.instructions]};return Object.freeze(r),r}function H(e){return e.reduce((n,r)=>n===null||r===null?null:n+r,0)}function Wn(e,n,r,t){if(typeof e=="number")return [e,t];if(typeof e=="object")return e.decode(r,t);if(e==="remainder"){let o=H(n);if(o===null)throw new Error('Codecs of "remainder" size must have fixed-size items.');let i=r.slice(t).length;if(i%o!==0)throw new Error(`The remainder of the byte array (${i} bytes) cannot be split into chunks of ${o} bytes. Codecs of "remainder" size must have a remainder that is a multiple of its item size. In other words, ${i} modulo ${o} should be equal to zero.`);return [i/o,t]}throw new Error(`Unrecognized array-like codec size: ${JSON.stringify(e)}`)}function $n(e){return typeof e=="object"?e.description:`${e}`}function De(e,n){if(typeof e!="number")return null;if(e===0)return 0;let r=H(n);return r===null?null:r*e}function Vn(e,n){return typeof e=="object"?e.encode(n):new Uint8Array}function Fn(e,n,r){if(n!==r)throw new Error(`Expected [${e}] to have ${n} items, got ${r}.`)}function ve(e,n,r){if(n==="remainder"&&e.fixedSize===null)throw new Error('Codecs of "remainder" size must have fixed-size items.');return {description:r??`array(${e.description}; ${$n(n)})`,fixedSize:De(n,[e.fixedSize]),maxSize:De(n,[e.maxSize])}}function A(e,n={}){let r=n.size??P();return {...ve(e,r,n.description),encode:t=>(typeof r=="number"&&Fn("array",r,t.length),k([Vn(r,t.length),...t.map(o=>e.encode(o))]))}}function h(e,n={}){let r=n.size??W();return {...ve(e,r,n.description),decode:(t,o=0)=>{if(typeof r=="object"&&t.slice(o).length===0)return [[],o];let[i,s]=Wn(r,[e.fixedSize],t,o);o=s;let c=[];for(let u=0;u<i;u+=1){let[a,l]=e.decode(t,o);c.push(a),o=l;}return [c,o]}}}function K(e={}){let n=e.size??"variable",r=typeof n=="object"?n.description:`${n}`,t=e.description??`bytes(${r})`,o={description:t,encode:i=>i,fixedSize:null,maxSize:null};return n==="variable"?o:typeof n=="number"?U(o,n,t):{...o,encode:i=>{let s=o.encode(i),c=n.encode(s.length);return k([c,s])}}}function j(e={}){let n=e.size??"variable",r=typeof n=="object"?n.description:`${n}`,t=e.description??`bytes(${r})`,o={decode:(i,s=0)=>{let c=i.slice(s);return [c,s+c.length]},description:t,fixedSize:null,maxSize:null};return n==="variable"?o:typeof n=="number"?O(o,n,t):{...o,decode:(i,s=0)=>{N("bytes",i,s);let[c,u]=n.decode(i,s),a=Number(c);s=u;let l=i.slice(s,s+a);w("bytes",a,l);let[p,zn]=o.decode(l);return s+=zn,[p,s]}}}function Ne(e,n){let r=e.map(([t,o])=>`${String(t)}: ${o.description}`).join(", ");return {description:n??`struct(${r})`,fixedSize:H(e.map(([,t])=>t.fixedSize)),maxSize:H(e.map(([,t])=>t.maxSize))}}function b(e,n={}){return {...Ne(e,n.description),encode:r=>{let t=e.map(([o,i])=>i.encode(r[o]));return k(t)}}}function E(e,n={}){return {...Ne(e,n.description),decode:(r,t=0)=>{let o={};return e.forEach(([i,s])=>{let[c,u]=s.decode(r,t);t=u,o[i]=c;}),[o,t]}}}function ke(){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")}async function _e(){if(ke(),typeof globalThis.crypto>"u"||typeof globalThis.crypto.subtle?.exportKey!="function")throw new Error("No key export implementation could be found")}async function Le(){if(ke(),typeof globalThis.crypto>"u"||typeof globalThis.crypto.subtle?.sign!="function")throw new Error("No signing implementation could be found")}var ee,ne;function Re(){return ee||(ee=I()),ee}function Hn(){return ne||(ne=_()),ne}function Y(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=Re().encode(e).byteLength;if(t!==32)throw new Error(`Expected input string to decode to a byte array of length 32. Actual length: ${t}`)}catch(n){throw new Error(`\`${e}\` is not a base-58 encoded address`,{cause:n})}}function Kn(e){return Y(e),e}function q(e){return B($({description:e?.description??"Base58EncodedAddress",encoding:Re(),size:32}),n=>Kn(n))}function R(e){return V({description:e?.description??"Base58EncodedAddress",encoding:Hn(),size:32})}function M(){return new Intl.Collator("en",{caseFirst:"lower",ignorePunctuation:!1,localeMatcher:"best fit",numeric:!1,sensitivity:"variant",usage:"sort"}).compare}async function Me(e){if(await _e(),e.type!=="public"||e.algorithm.name!=="Ed25519")throw new Error("The `CryptoKey` must be an `Ed25519` public key");let n=await crypto.subtle.exportKey("raw",e),[r]=R().decode(new Uint8Array(n));return r}function Ue(e,n,r){e[n]=r(e[n]??{role:g.READONLY});}var f=Symbol("AddressMapTypeProperty");function Oe(e,n){let r={[e]:{[f]:0,role:g.WRITABLE_SIGNER}},t=new Set;for(let o of n){Ue(r,o.programAddress,s=>{if(t.add(o.programAddress),f in s){if(v(s.role))switch(s[f]){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(s[f]===2)return s}return {[f]:2,role:g.READONLY}});let i;if(o.accounts)for(let s of o.accounts)Ue(r,s.address,c=>{let{address:u,...a}=s;if(f in c)switch(c[f]){case 0:return c;case 1:{let l=Q(c.role,a.role);if("lookupTableAddress"in a){if(c.lookupTableAddress!==a.lookupTableAddress&&(i||(i=M()))(a.lookupTableAddress,c.lookupTableAddress)<0)return {[f]:1,...a,role:l}}else if(y(a.role))return {[f]:2,role:l};return c.role!==l?{...c,role:l}:c}case 2:{let l=Q(c.role,a.role);if(t.has(s.address)){if(v(a.role))throw new Error(`This transaction includes an address (\`${s.address}\`) which is both invoked and marked writable. Program addresses may not be writable.`);return c.role!==l?{...c,role:l}:c}else return "lookupTableAddress"in a&&!y(c.role)?{...a,[f]:1,role:l}:c.role!==l?{...c,role:l}:c}}return "lookupTableAddress"in a?{...a,[f]:1}:{...a,[f]:2}});}return r}function Pe(e){let n;return Object.entries(e).sort(([t,o],[i,s])=>{if(o[f]!==s[f]){if(o[f]===0)return -1;if(s[f]===0)return 1;if(o[f]===2)return -1;if(s[f]===2)return 1}let c=y(o.role);if(c!==y(s.role))return c?-1:1;let u=v(o.role);return u!==v(s.role)?u?-1:1:(n||(n=M()),o[f]===1&&s[f]===1&&o.lookupTableAddress!==s.lookupTableAddress?n(o.lookupTableAddress,s.lookupTableAddress):n(t,i))}).map(([t,o])=>({address:t,...o}))}function We(e){var r;let n={};for(let t of e){if(!("lookupTableAddress"in t))continue;let o=n[r=t.lookupTableAddress]||(n[r]={readableIndices:[],writableIndices:[]});t.role===g.WRITABLE?o.writableIndices.push(t.addressIndex):o.readableIndices.push(t.addressIndex);}return Object.keys(n).sort(M()).map(t=>({lookupTableAddress:t,...n[t]}))}function $e(e){let n=0,r=0,t=0;for(let o of e){if("lookupTableAddress"in o)break;let i=v(o.role);y(o.role)?(t++,i||r++):i||n++;}return {numReadonlyNonSignerAccounts:n,numReadonlySignerAccounts:r,numSignerAccounts:t}}function jn(e){let n={};for(let[r,t]of e.entries())n[t.address]=r;return n}function Ve(e,n){let r=jn(n);return e.map(({accounts:t,data:o,programAddress:i})=>({programAddressIndex:r[i],...t?{accountIndices:t.map(({address:s})=>r[s])}:null,...o?{data:o}:null}))}function Fe(e){return "nonce"in e?e.nonce:e.blockhash}function He(e){let n=e.findIndex(t=>"lookupTableAddress"in t);return (n===-1?e:e.slice(0,n)).map(({address:t})=>t)}function G(e){let n=Oe(e.feePayer,e.instructions),r=Pe(n);return {...e.version!=="legacy"?{addressTableLookups:We(r)}:null,header:$e(r),instructions:Ve(e.instructions,r),lifetimeToken:Fe(e.lifetimeConstraint),staticAccounts:He(r),version:e.version}}function Ke(e){let n=G(e),r;if("signatures"in e){r=[];for(let t=0;t<n.header.numSignerAccounts;t++)r[t]=e.signatures[n.staticAccounts[t]]??new Uint8Array(Array(64).fill(0));}else r=Array(n.header.numSignerAccounts).fill(new Uint8Array(Array(64).fill(0)));return {compiledMessage:n,signatures:r}}function je(e,...n){return n.reduce((r,t)=>t(r),e)}function Yn(e){let{header:n}=e,r=n.numSignerAccounts-n.numReadonlySignerAccounts,t=e.staticAccounts.length-n.numSignerAccounts-n.numReadonlyNonSignerAccounts,o=[],i=0;for(let s=0;s<r;s++)o.push({address:e.staticAccounts[i],role:g.WRITABLE_SIGNER}),i++;for(let s=0;s<n.numReadonlySignerAccounts;s++)o.push({address:e.staticAccounts[i],role:g.READONLY_SIGNER}),i++;for(let s=0;s<t;s++)o.push({address:e.staticAccounts[i],role:g.WRITABLE}),i++;for(let s=0;s<n.numReadonlyNonSignerAccounts;s++)o.push({address:e.staticAccounts[i],role:g.READONLY}),i++;return o}function qn(e,n){let r=n[e.programAddressIndex]?.address;if(!r)throw new Error(`Could not find program address at index ${e.programAddressIndex}`);let t=e.accountIndices?.map(i=>n[i]),{data:o}=e;return {programAddress:r,...t&&t.length?{accounts:t}:{},...o&&o.length?{data:o}:{}}}function Gn(e,n,r){if(!n||!F(n))return {blockhash:e,lastValidBlockHeight:r??2n**64n-1n};{let t=n.accounts[0].address;Y(t);let o=n.accounts[2].address;return Y(o),{nonce:e,nonceAccountAddress:t,nonceAuthorityAddress:o}}}function Xn(e){let{compiledMessage:{staticAccounts:n},signatures:r}=e;return r.reduce((t,o,i)=>{if(o.every(u=>u===0))return t;let c=n[i];return {...t,[c]:o}},{})}function Ye(e,n){let{compiledMessage:r}=e;if("addressTableLookups"in r&&r.addressTableLookups.length>0)throw new Error("Cannot convert transaction with addressTableLookups");let t=r.staticAccounts[0];if(!t)throw new Error("No fee payer set in CompiledTransaction");let o=Yn(r),i=r.instructions.map(a=>qn(a,o)),s=i[0],c=Gn(r.lifetimeToken,s,n),u=Xn(e);return je(Ee({version:r.version}),a=>Be(t,a),a=>i.reduce((l,p)=>we(p,l),a),a=>"blockhash"in c?be(c,a):ze(c,a),a=>e.signatures.length?{...a,signatures:u}:a)}var qe="lookupTableAddress",Ge="writableIndices",Xe="readableIndices",Ze="addressTableLookup",re;function Je(){return re||(re=b([["lookupTableAddress",q({description:qe})],["writableIndices",A(S(),{description:Ge,size:m()})],["readableIndices",A(S(),{description:Xe,size:m()})]],{description:Ze})),re}var te;function Qe(){return te||(te=E([["lookupTableAddress",R({description:qe})],["writableIndices",h(x(),{description:Ge,size:T()})],["readableIndices",h(x(),{description:Xe,size:T()})]],{description:Ze})),te}var oe;function Zn(){return oe||(oe=S()),oe}function ie(e){let n=Zn();return {...n,description:e??n.description}}var se;function Jn(){return se||(se=x()),se}function ce(e){let n=Jn();return {...n,description:e??n.description}}var en=void 0,nn=void 0,rn=void 0,tn=void 0;function on(){return b([["numSignerAccounts",ie(en)],["numReadonlySignerAccounts",ie(nn)],["numReadonlyNonSignerAccounts",ie(rn)]],{description:tn})}function sn(){return E([["numSignerAccounts",ce(en)],["numReadonlySignerAccounts",ce(nn)],["numReadonlyNonSignerAccounts",ce(rn)]],{description:tn})}var cn="programAddressIndex",an=void 0,dn="accountIndices",un="data",ae;function ln(){return ae||(ae=B(b([["programAddressIndex",S({description:cn})],["accountIndices",A(S({description:an}),{description:dn,size:m()})],["data",K({description:un,size:m()})]]),e=>e.accountIndices!==void 0&&e.data!==void 0?e:{...e,accountIndices:e.accountIndices??[],data:e.data??new Uint8Array(0)})),ae}var de;function fn(){return de||(de=D(E([["programAddressIndex",x({description:cn})],["accountIndices",h(x({description:an}),{description:dn,size:T()})],["data",j({description:un,size:T()})]]),e=>{if(e.accountIndices.length&&e.data.byteLength)return e;let{accountIndices:n,data:r,...t}=e;return {...t,...n.length?{accountIndices:n}:null,...r.byteLength?{data:r}:null}})),de}var ue=128,gn={description:"",fixedSize:null,maxSize:1};function Qn(e,n=0){let r=e[n];return r&ue?[r^ue,n+1]:["legacy",n]}function er(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|ue])}function pn(){return {...gn,decode:Qn}}function mn(){return {...gn,encode:er}}var Tn="staticAccounts",yn="lifetimeToken",An="instructions",hn="addressTableLookups";function nr(){return b(bn())}function rr(){return B(b([...bn(),["addressTableLookups",or()]]),e=>e.version==="legacy"?e:{...e,addressTableLookups:e.addressTableLookups??[]})}function bn(){return [["version",mn()],["header",on()],["staticAccounts",A(q(),{description:Tn,size:m()})],["lifetimeToken",$({description:yn,encoding:I(),size:32})],["instructions",A(ln(),{description:An,size:m()})]]}function tr(){return [["version",pn()],["header",sn()],["staticAccounts",h(R(),{description:Tn,size:T()})],["lifetimeToken",V({description:yn,encoding:_(),size:32})],["instructions",h(fn(),{description:An,size:T()})],["addressTableLookups",ir()]]}function or(){return A(Je(),{description:hn,size:m()})}function ir(){return h(Qe(),{description:hn,size:T()})}var En="message";function X(){return {description:En,encode:e=>e.version==="legacy"?nr().encode(e):rr().encode(e),fixedSize:null,maxSize:null}}function Sn(){return D(E(tr(),{description:En}),({addressTableLookups:e,...n})=>n.version==="legacy"||!e?.length?n:{...n,addressTableLookups:e})}var xn="signatures",In="transaction";function sr(){return b([["signatures",A(K({size:64}),{description:xn,size:m()})],["compiledMessage",X()]],{description:In})}function cr(){return D(j({size:64}),e=>e)}function ar(){return E([["signatures",h(cr(),{description:xn,size:T()})],["compiledMessage",Sn()]],{description:In})}function le(){return B(sr(),Ke)}function dr(e){return D(ar(),n=>Ye(n,e))}function si(e){return z(le(),dr(e))}async function Cn(e,n){await Le();let r=await crypto.subtle.sign("Ed25519",e,n);return new Uint8Array(r)}var L,fe;function ur(e){L||(L=I());try{if(e.length<64||e.length>88)throw new Error("Expected input string to decode to a byte array of length 64.");let r=L.encode(e).byteLength;if(r!==64)throw new Error(`Expected input string to decode to a byte array of length 64. Actual length: ${r}`)}catch(n){throw new Error(`\`${e}\` is not a transaction signature`,{cause:n})}}function Si(e){return L||(L=I()),!(e.length<64||e.length>88||L.encode(e).byteLength!==64)}function xi(e){fe||(fe=_());let n=e.signatures[e.feePayer];if(!n)throw new Error("Could not determine this transaction's signature. Make sure that the transaction has been signed by its fee payer.");return fe.decode(n)[0]}async function Ii(e,n){let r=G(n),t="signatures"in n?{...n.signatures}:{},o=X().encode(r),i=await Promise.all(e.map(c=>Promise.all([Me(c.publicKey),Cn(c.privateKey,o)])));for(let[c,u]of i)t[c]=u;let s={...n,signatures:t};return Object.freeze(s),s}function Ci(e){return ur(e),e}function zi(e){let n=e.instructions.flatMap(t=>t.accounts?.filter(o=>y(o.role))??[]).map(t=>t.address);new Set([e.feePayer,...n]).forEach(t=>{if(!e.signatures[t])throw new Error(`Transaction is missing signature for address \`${t}\``)});}function vi(e){let n=le().encode(e);return btoa(String.fromCharCode(...n))}
|
|
6
6
|
|
|
7
|
-
exports.appendTransactionInstruction =
|
|
8
|
-
exports.assertIsBlockhash =
|
|
9
|
-
exports.assertIsDurableNonceTransaction =
|
|
10
|
-
exports.assertIsTransactionSignature =
|
|
11
|
-
exports.
|
|
12
|
-
exports.
|
|
13
|
-
exports.
|
|
14
|
-
exports.
|
|
15
|
-
exports.
|
|
16
|
-
exports.
|
|
17
|
-
exports.
|
|
18
|
-
exports.
|
|
19
|
-
exports.
|
|
20
|
-
exports.
|
|
21
|
-
exports.
|
|
7
|
+
exports.appendTransactionInstruction = we;
|
|
8
|
+
exports.assertIsBlockhash = Cr;
|
|
9
|
+
exports.assertIsDurableNonceTransaction = $r;
|
|
10
|
+
exports.assertIsTransactionSignature = ur;
|
|
11
|
+
exports.assertTransactionIsFullySigned = zi;
|
|
12
|
+
exports.createTransaction = Ee;
|
|
13
|
+
exports.getBase64EncodedWireTransaction = vi;
|
|
14
|
+
exports.getSignatureFromTransaction = xi;
|
|
15
|
+
exports.getTransactionCodec = si;
|
|
16
|
+
exports.getTransactionDecoder = dr;
|
|
17
|
+
exports.getTransactionEncoder = le;
|
|
18
|
+
exports.isAdvanceNonceAccountInstruction = F;
|
|
19
|
+
exports.isTransactionSignature = Si;
|
|
20
|
+
exports.prependTransactionInstruction = qr;
|
|
21
|
+
exports.setTransactionFeePayer = Be;
|
|
22
|
+
exports.setTransactionLifetimeUsingBlockhash = be;
|
|
23
|
+
exports.setTransactionLifetimeUsingDurableNonce = ze;
|
|
24
|
+
exports.signTransaction = Ii;
|
|
25
|
+
exports.transactionSignature = Ci;
|
|
22
26
|
|
|
23
27
|
return exports;
|
|
24
28
|
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { getCompiledTransaction } from './compile-transaction';
|
|
2
|
+
import { ITransactionWithSignatures } from './signatures';
|
|
3
|
+
type CompiledTransaction = ReturnType<typeof getCompiledTransaction>;
|
|
4
|
+
type CompilableTransaction = Parameters<typeof getCompiledTransaction>[0];
|
|
5
|
+
export declare function decompileTransaction(compiledTransaction: CompiledTransaction, lastValidBlockHeight?: bigint): CompilableTransaction | (CompilableTransaction & ITransactionWithSignatures);
|
|
6
|
+
export {};
|
|
7
|
+
//# sourceMappingURL=decompile-transaction.d.ts.map
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { Base58EncodedAddress } from '@solana/addresses';
|
|
2
|
-
import { IInstruction, IInstructionWithAccounts, IInstructionWithData } from '@solana/instructions';
|
|
3
|
-
import { ReadonlyAccount, ReadonlySignerAccount, WritableAccount } from '@solana/instructions/dist/types/accounts';
|
|
2
|
+
import { IInstruction, IInstructionWithAccounts, IInstructionWithData, ReadonlyAccount, ReadonlySignerAccount, WritableAccount, WritableSignerAccount } from '@solana/instructions';
|
|
4
3
|
import { ITransactionWithSignatures } from './signatures';
|
|
5
4
|
import { BaseTransaction } from './types';
|
|
6
5
|
type AdvanceNonceAccountInstruction<TNonceAccountAddress extends string = string, TNonceAuthorityAddress extends string = string> = IInstruction<'11111111111111111111111111111111'> & IInstructionWithAccounts<readonly [
|
|
7
6
|
WritableAccount<TNonceAccountAddress>,
|
|
8
7
|
ReadonlyAccount<'SysvarRecentB1ockHashes11111111111111111111'>,
|
|
9
|
-
ReadonlySignerAccount<TNonceAuthorityAddress>
|
|
8
|
+
ReadonlySignerAccount<TNonceAuthorityAddress> | WritableSignerAccount<TNonceAuthorityAddress>
|
|
10
9
|
]> & IInstructionWithData<AdvanceNonceAccountInstructionData>;
|
|
11
10
|
type AdvanceNonceAccountInstructionData = Uint8Array & {
|
|
12
11
|
readonly __brand: unique symbol;
|
|
@@ -30,6 +29,7 @@ export interface IDurableNonceTransaction<TNonceAccountAddress extends string =
|
|
|
30
29
|
readonly lifetimeConstraint: NonceLifetimeConstraint<TNonceValue>;
|
|
31
30
|
}
|
|
32
31
|
export declare function assertIsDurableNonceTransaction(transaction: BaseTransaction | (BaseTransaction & IDurableNonceTransaction)): asserts transaction is BaseTransaction & IDurableNonceTransaction;
|
|
32
|
+
export declare function isAdvanceNonceAccountInstruction(instruction: IInstruction): instruction is AdvanceNonceAccountInstruction;
|
|
33
33
|
export declare function setTransactionLifetimeUsingDurableNonce<TTransaction extends BaseTransaction, TNonceAccountAddress extends string = string, TNonceAuthorityAddress extends string = string, TNonceValue extends string = string>({ nonce, nonceAccountAddress, nonceAuthorityAddress, }: DurableNonceConfig<TNonceAccountAddress, TNonceAuthorityAddress, TNonceValue>, transaction: TTransaction | (TTransaction & IDurableNonceTransaction)): Omit<TTransaction, keyof ITransactionWithSignatures> & IDurableNonceTransaction<TNonceAccountAddress, TNonceAuthorityAddress, TNonceValue>;
|
|
34
34
|
export {};
|
|
35
35
|
//# sourceMappingURL=durable-nonce.d.ts.map
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { getCompiledAddressTableLookups } from '../compile-address-table-lookups';
|
|
1
|
+
import { type Codec, type Decoder, type Encoder } from '@solana/codecs-core';
|
|
2
|
+
import type { getCompiledAddressTableLookups } from '../compile-address-table-lookups';
|
|
3
3
|
type AddressTableLookup = ReturnType<typeof getCompiledAddressTableLookups>[number];
|
|
4
|
-
export declare function
|
|
4
|
+
export declare function getAddressTableLookupEncoder(): Encoder<AddressTableLookup>;
|
|
5
|
+
export declare function getAddressTableLookupDecoder(): Decoder<AddressTableLookup>;
|
|
6
|
+
export declare function getAddressTableLookupCodec(): Codec<AddressTableLookup>;
|
|
5
7
|
export {};
|
|
6
8
|
//# sourceMappingURL=address-table-lookup.d.ts.map
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Codec, Decoder, Encoder } from '@solana/codecs-core';
|
|
2
2
|
import { getCompiledInstructions } from '../compile-instructions';
|
|
3
3
|
type Instruction = ReturnType<typeof getCompiledInstructions>[number];
|
|
4
|
-
export declare function
|
|
4
|
+
export declare function getInstructionEncoder(): Encoder<Instruction>;
|
|
5
|
+
export declare function getInstructionDecoder(): Decoder<Instruction>;
|
|
6
|
+
export declare function getInstructionCodec(): Codec<Instruction>;
|
|
5
7
|
export {};
|
|
6
8
|
//# sourceMappingURL=instruction.d.ts.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Codec, Decoder, Encoder } from '@solana/codecs-core';
|
|
2
2
|
import { CompiledMessage } from '../message';
|
|
3
|
-
export declare function getCompiledMessageEncoder():
|
|
4
|
-
export declare function getCompiledMessageDecoder():
|
|
5
|
-
export declare function getCompiledMessageCodec():
|
|
3
|
+
export declare function getCompiledMessageEncoder(): Encoder<CompiledMessage>;
|
|
4
|
+
export declare function getCompiledMessageDecoder(): Decoder<CompiledMessage>;
|
|
5
|
+
export declare function getCompiledMessageCodec(): Codec<CompiledMessage>;
|
|
6
6
|
//# sourceMappingURL=message.d.ts.map
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { Codec, Decoder, Encoder } from '@solana/codecs-core';
|
|
2
|
+
import { compileMessage } from '../message';
|
|
3
|
+
import { ITransactionWithSignatures } from '../signatures';
|
|
4
|
+
type CompilableTransaction = Parameters<typeof compileMessage>[0];
|
|
5
|
+
export declare function getTransactionEncoder(): Encoder<CompilableTransaction | (CompilableTransaction & ITransactionWithSignatures)>;
|
|
6
|
+
export declare function getTransactionDecoder(lastValidBlockHeight?: bigint): Decoder<CompilableTransaction | (CompilableTransaction & ITransactionWithSignatures)>;
|
|
7
|
+
export declare function getTransactionCodec(lastValidBlockHeight?: bigint): Codec<CompilableTransaction | (CompilableTransaction & ITransactionWithSignatures)>;
|
|
5
8
|
export {};
|
|
6
9
|
//# sourceMappingURL=transaction.d.ts.map
|
|
@@ -16,4 +16,5 @@ export declare function isTransactionSignature(putativeTransactionSignature: str
|
|
|
16
16
|
export declare function getSignatureFromTransaction(transaction: ITransactionWithFeePayer & ITransactionWithSignatures): TransactionSignature;
|
|
17
17
|
export declare function signTransaction<TTransaction extends Parameters<typeof compileMessage>[0]>(keyPairs: CryptoKeyPair[], transaction: TTransaction | (TTransaction & ITransactionWithSignatures)): Promise<TTransaction & ITransactionWithSignatures>;
|
|
18
18
|
export declare function transactionSignature(putativeTransactionSignature: string): TransactionSignature;
|
|
19
|
+
export declare function assertTransactionIsFullySigned<TTransaction extends Parameters<typeof compileMessage>[0]>(transaction: TTransaction & ITransactionWithSignatures): asserts transaction is TTransaction & IFullySignedTransaction;
|
|
19
20
|
//# sourceMappingURL=signatures.d.ts.map
|
|
@@ -2,5 +2,5 @@ import { getTransactionEncoder } from './serializers/transaction';
|
|
|
2
2
|
export type Base64EncodedWireTransaction = string & {
|
|
3
3
|
readonly __brand: unique symbol;
|
|
4
4
|
};
|
|
5
|
-
export declare function getBase64EncodedWireTransaction(transaction: Parameters<ReturnType<typeof getTransactionEncoder>['
|
|
5
|
+
export declare function getBase64EncodedWireTransaction(transaction: Parameters<ReturnType<typeof getTransactionEncoder>['encode']>[0]): Base64EncodedWireTransaction;
|
|
6
6
|
//# sourceMappingURL=wire-transaction.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@solana/transactions",
|
|
3
|
-
"version": "2.0.0-experimental.
|
|
3
|
+
"version": "2.0.0-experimental.fd11bd1",
|
|
4
4
|
"description": "Helpers for creating and serializing transactions",
|
|
5
5
|
"exports": {
|
|
6
6
|
"browser": {
|
|
@@ -46,17 +46,18 @@
|
|
|
46
46
|
"maintained node versions"
|
|
47
47
|
],
|
|
48
48
|
"dependencies": {
|
|
49
|
-
"@
|
|
50
|
-
"@solana/
|
|
51
|
-
"@solana/codecs-
|
|
52
|
-
"@solana/codecs-
|
|
53
|
-
"@solana/codecs-
|
|
54
|
-
"@solana/
|
|
49
|
+
"@solana/addresses": "2.0.0-experimental.fd11bd1",
|
|
50
|
+
"@solana/codecs-core": "2.0.0-experimental.fd11bd1",
|
|
51
|
+
"@solana/codecs-data-structures": "2.0.0-experimental.fd11bd1",
|
|
52
|
+
"@solana/codecs-numbers": "2.0.0-experimental.fd11bd1",
|
|
53
|
+
"@solana/codecs-strings": "2.0.0-experimental.fd11bd1",
|
|
54
|
+
"@solana/functional": "2.0.0-experimental.fd11bd1",
|
|
55
|
+
"@solana/keys": "2.0.0-experimental.fd11bd1"
|
|
55
56
|
},
|
|
56
57
|
"devDependencies": {
|
|
57
58
|
"@solana/eslint-config-solana": "^1.0.2",
|
|
58
|
-
"@swc/jest": "^0.2.
|
|
59
|
-
"@types/jest": "^29.5.
|
|
59
|
+
"@swc/jest": "^0.2.29",
|
|
60
|
+
"@types/jest": "^29.5.6",
|
|
60
61
|
"@types/node": "^20.6.3",
|
|
61
62
|
"@typescript-eslint/eslint-plugin": "^6.7.0",
|
|
62
63
|
"@typescript-eslint/parser": "^6.3.0",
|
|
@@ -64,13 +65,13 @@
|
|
|
64
65
|
"eslint": "^8.45.0",
|
|
65
66
|
"eslint-plugin-sort-keys-fix": "^1.1.2",
|
|
66
67
|
"jest": "^29.7.0",
|
|
67
|
-
"jest-runner-eslint": "^2.1.
|
|
68
|
+
"jest-runner-eslint": "^2.1.2",
|
|
68
69
|
"jest-runner-prettier": "^1.0.0",
|
|
69
70
|
"prettier": "^2.8",
|
|
70
71
|
"tsup": "7.2.0",
|
|
71
72
|
"typescript": "^5.2.2",
|
|
72
73
|
"version-from-git": "^1.1.1",
|
|
73
|
-
"@solana/instructions": "2.0.0-experimental.
|
|
74
|
+
"@solana/instructions": "2.0.0-experimental.fd11bd1",
|
|
74
75
|
"build-scripts": "0.0.0",
|
|
75
76
|
"test-config": "0.0.0",
|
|
76
77
|
"test-matchers": "0.0.0",
|