@solana/transactions 2.0.0-experimental.762ff13 → 2.0.0-experimental.76cf6b4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (69) hide show
  1. package/README.md +1 -43
  2. package/dist/index.browser.cjs +260 -429
  3. package/dist/index.browser.cjs.map +1 -1
  4. package/dist/index.browser.js +256 -430
  5. package/dist/index.browser.js.map +1 -1
  6. package/dist/index.development.js +679 -829
  7. package/dist/index.development.js.map +1 -1
  8. package/dist/index.native.js +256 -432
  9. package/dist/index.native.js.map +1 -1
  10. package/dist/index.node.cjs +260 -429
  11. package/dist/index.node.cjs.map +1 -1
  12. package/dist/index.node.js +256 -432
  13. package/dist/index.node.js.map +1 -1
  14. package/dist/index.production.min.js +23 -20
  15. package/dist/types/accounts.d.ts +2 -2
  16. package/dist/types/accounts.d.ts.map +1 -0
  17. package/dist/types/blockhash.d.ts +4 -3
  18. package/dist/types/blockhash.d.ts.map +1 -0
  19. package/dist/types/compilable-transaction.d.ts +7 -0
  20. package/dist/types/compilable-transaction.d.ts.map +1 -0
  21. package/dist/types/compile-address-table-lookups.d.ts +3 -3
  22. package/dist/types/compile-address-table-lookups.d.ts.map +1 -0
  23. package/dist/types/compile-header.d.ts +1 -1
  24. package/dist/types/compile-header.d.ts.map +1 -0
  25. package/dist/types/compile-instructions.d.ts +1 -1
  26. package/dist/types/compile-instructions.d.ts.map +1 -0
  27. package/dist/types/compile-lifetime-token.d.ts +1 -1
  28. package/dist/types/compile-lifetime-token.d.ts.map +1 -0
  29. package/dist/types/compile-static-accounts.d.ts +3 -3
  30. package/dist/types/compile-static-accounts.d.ts.map +1 -0
  31. package/dist/types/compile-transaction.d.ts +6 -7
  32. package/dist/types/compile-transaction.d.ts.map +1 -0
  33. package/dist/types/create-transaction.d.ts +1 -1
  34. package/dist/types/create-transaction.d.ts.map +1 -0
  35. package/dist/types/decompile-transaction.d.ts +3 -5
  36. package/dist/types/decompile-transaction.d.ts.map +1 -0
  37. package/dist/types/durable-nonce.d.ts +5 -5
  38. package/dist/types/durable-nonce.d.ts.map +1 -0
  39. package/dist/types/fee-payer.d.ts +6 -6
  40. package/dist/types/fee-payer.d.ts.map +1 -0
  41. package/dist/types/index.d.ts +11 -9
  42. package/dist/types/index.d.ts.map +1 -0
  43. package/dist/types/instructions.d.ts +2 -2
  44. package/dist/types/instructions.d.ts.map +1 -0
  45. package/dist/types/message.d.ts +6 -10
  46. package/dist/types/message.d.ts.map +1 -0
  47. package/dist/types/serializers/address-table-lookup.d.ts +5 -5
  48. package/dist/types/serializers/address-table-lookup.d.ts.map +1 -0
  49. package/dist/types/serializers/header.d.ts +5 -5
  50. package/dist/types/serializers/header.d.ts.map +1 -0
  51. package/dist/types/serializers/index.d.ts +2 -1
  52. package/dist/types/serializers/index.d.ts.map +1 -0
  53. package/dist/types/serializers/instruction.d.ts +5 -5
  54. package/dist/types/serializers/instruction.d.ts.map +1 -0
  55. package/dist/types/serializers/message.d.ts +5 -5
  56. package/dist/types/serializers/message.d.ts.map +1 -0
  57. package/dist/types/serializers/transaction-version.d.ts +5 -5
  58. package/dist/types/serializers/transaction-version.d.ts.map +1 -0
  59. package/dist/types/serializers/transaction.d.ts +6 -8
  60. package/dist/types/serializers/transaction.d.ts.map +1 -0
  61. package/dist/types/signatures.d.ts +9 -14
  62. package/dist/types/signatures.d.ts.map +1 -0
  63. package/dist/types/types.d.ts +6 -13
  64. package/dist/types/types.d.ts.map +1 -0
  65. package/dist/types/unsigned-transaction.d.ts +1 -1
  66. package/dist/types/unsigned-transaction.d.ts.map +1 -0
  67. package/dist/types/wire-transaction.d.ts +1 -1
  68. package/dist/types/wire-transaction.d.ts.map +1 -0
  69. package/package.json +15 -15
@@ -2,27 +2,30 @@ this.globalThis = this.globalThis || {};
2
2
  this.globalThis.solanaWeb3 = (function (exports) {
3
3
  'use strict';
4
4
 
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))}
5
+ function R(e,r,n=0){if(r.length-n<=0)throw new Error(`Codec [${e}] cannot decode empty byte arrays.`)}function v(e,r,n,t=0){let o=n.length-t;if(o<r)throw new Error(`Codec [${e}] expected ${r} bytes, got ${o}.`)}var pr=(e,r)=>{if(e.length>=r)return e;let n=new Uint8Array(r).fill(0);return n.set(e),n},Tr=(e,r)=>pr(e.length<=r?e:e.slice(0,r),r);function x(e,r){return "fixedSize"in r?r.fixedSize:r.getSizeFromValue(e)}function g(e){return Object.freeze({...e,encode:r=>{let n=new Uint8Array(x(r,e));return e.write(r,n,0),n}})}function p(e){return Object.freeze({...e,decode:(r,n=0)=>e.read(r,n)[0]})}function T(e){return "fixedSize"in e&&typeof e.fixedSize=="number"}function te(e,r){if(!T(e))throw new Error(r!=null?r:"Expected a fixed-size codec, got a variable-size one.")}function yr(e){return !T(e)}function C(e,r){if(T(e)!==T(r))throw new Error("Encoder and decoder must either both be fixed-size or variable-size.");if(T(e)&&T(r)&&e.fixedSize!==r.fixedSize)throw new Error(`Encoder and decoder must have the same fixed size, got [${e.fixedSize}] and [${r.fixedSize}].`);if(!T(e)&&!T(r)&&e.maxSize!==r.maxSize)throw new Error(`Encoder and decoder must have the same max size, got [${e.maxSize}] and [${r.maxSize}].`);return {...r,...e,decode:r.decode,encode:e.encode,read:r.read,write:e.write}}function W(e,r){return g({fixedSize:r,write:(n,t,o)=>{let s=e.encode(n),i=s.length>r?s.slice(0,r):s;return t.set(i,o),o+r}})}function P(e,r){return p({fixedSize:r,read:(n,t)=>{v("fixCodec",r,n,t),(t>0||n.length>r)&&(n=n.slice(t,t+r)),T(e)&&(n=Tr(n,e.fixedSize));let[o]=e.read(n,0);return [o,t+r]}})}function z(e,r){return g({...yr(e)?{...e,getSizeFromValue:n=>e.getSizeFromValue(r(n))}:e,write:(n,t,o)=>e.write(r(n),t,o)})}function k(e,r){return p({...e,read:(n,t)=>{let[o,s]=e.read(n,t);return [r(o,n,t),s]}})}function Se(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 Ee(e){return (e==null?void 0:e.endian)!==1}function Ie(e){return g({fixedSize:e.size,write(r,n,t){e.range&&Se(e.name,e.range[0],e.range[1],r);let o=new ArrayBuffer(e.size);return e.set(new DataView(o),r,Ee(e.config)),n.set(new Uint8Array(o),t),t+e.size}})}function xe(e){return p({fixedSize:e.size,read(r,n=0){R(e.name,r,n),v(e.name,e.size,r,n);let t=new DataView(Ar(r,n,e.size));return [e.get(t,Ee(e.config)),n+e.size]}})}function Ar(e,r,n){let t=e.byteOffset+(r!=null?r:0),o=n!=null?n:e.byteLength;return e.buffer.slice(t,t+o)}var y=()=>g({getSizeFromValue:e=>e<=127?1:e<=16383?2:3,maxSize:3,write:(e,r,n)=>{Se("shortU16",0,65535,e);let t=[0];for(let o=0;;o+=1){let s=e>>o*7;if(s===0)break;let i=127&s;t[o]=i,o>0&&(t[o-1]|=128);}return r.set(t,n),n+t.length}}),A=()=>p({maxSize:3,read:(e,r)=>{let n=0,t=0;for(;++t;){let o=t-1,s=e[r+o],i=127&s;if(n|=i<<o*7,!(s&128))break}return [n,r+t]}});var _=(e={})=>Ie({config:e,name:"u32",range:[0,+"0xffffffff"],set:(r,n,t)=>r.setUint32(0,n,t),size:4}),$=(e={})=>xe({config:e,get:(r,n)=>r.getUint32(0,n),name:"u32",size:4});var B=()=>Ie({name:"u8",range:[0,+"0xff"],set:(e,r)=>e.setUint8(0,r),size:1}),D=()=>xe({get:e=>e.getUint8(0),name:"u8",size:1});function hr(e,r,n=r){if(!r.match(new RegExp(`^[${e}]*$`)))throw new Error(`Expected a string of base ${e.length}, got [${n}].`)}var br=e=>g({getSizeFromValue:r=>{let[n,t]=Ce(r,e[0]);if(t==="")return r.length;let o=we(t,e);return n.length+Math.ceil(o.toString(16).length/2)},write(r,n,t){if(hr(e,r),r==="")return t;let[o,s]=Ce(r,e[0]);if(s==="")return n.set(new Uint8Array(o.length).fill(0),t),t+o.length;let i=we(s,e),a=[];for(;i>0n;)a.unshift(Number(i%256n)),i/=256n;let d=[...Array(o.length).fill(0),...a];return n.set(d,t),t+d.length}}),Sr=e=>p({read(r,n){let t=n===0?r:r.slice(n);if(t.length===0)return ["",0];let o=t.findIndex(d=>d!==0);o=o===-1?t.length:o;let s=e[0].repeat(o);if(o===t.length)return [s,r.length];let i=t.slice(o).reduce((d,c)=>d*256n+BigInt(c),0n),a=Er(i,e);return [s+a,r.length]}});function Ce(e,r){let n=[...e].findIndex(t=>t!==r);return n===-1?[e,""]:[e.slice(0,n),e.slice(n)]}function we(e,r){let n=BigInt(r.length);return [...e].reduce((t,o)=>t*n+BigInt(r.indexOf(o)),0n)}function Er(e,r){let n=BigInt(r.length),t=[];for(;e>0n;)t.unshift(r[Number(e%n)]),e/=n;return t.join("")}var Be="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz",M=()=>br(Be),F=()=>Sr(Be);var De=()=>p({read(e,r=0){let n=e.slice(r);return [btoa(String.fromCharCode(...n)),e.length]}});var Ir=e=>e.replace(/\u0000/g,"");var xr=globalThis.TextDecoder,ze=globalThis.TextEncoder,Cr=()=>{let e;return g({getSizeFromValue:r=>(e||(e=new ze)).encode(r).length,write:(r,n,t)=>{let o=(e||(e=new ze)).encode(r);return n.set(o,t),t+o.length}})},wr=()=>{let e;return p({read(r,n){let t=(e||(e=new xr)).decode(r.slice(n));return [Ir(t),r.length]}})};function H(e={}){var t,o;let r=(t=e.size)!=null?t:_(),n=(o=e.encoding)!=null?o:Cr();return r==="variable"?n:typeof r=="number"?W(n,r):g({getSizeFromValue:s=>{let i=x(s,n);return x(i,r)+i},write:(s,i,a)=>{let d=x(s,n);return a=r.write(d,i,a),n.write(s,i,a)}})}function K(e={}){var t,o;let r=(t=e.size)!=null?t:$(),n=(o=e.encoding)!=null?o:wr();return r==="variable"?n:typeof r=="number"?P(n,r):p({read:(s,i=0)=>{R("string",s,i);let[a,d]=r.read(s,i),c=Number(a);i=d;let l=s.slice(i,i+c);v("string",c,l);let[I,ne]=n.read(l,0);return i+=ne,[I,i]}})}function N(e){if("signatures"in e){let{signatures:r,...n}=e;return n}else return e}var oe;function zr(e){oe||(oe=M());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=oe.encode(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 Br(e){if(!("lifetimeConstraint"in e&&typeof e.lifetimeConstraint.blockhash=="string"&&typeof e.lifetimeConstraint.lastValidBlockHeight=="bigint"))return !1;try{return zr(e.lifetimeConstraint.blockhash),!0}catch{return !1}}function un(e){if(!Br(e))throw new Error("Transaction does not have a blockhash lifetime")}function Ne(e,r){if("lifetimeConstraint"in r&&r.lifetimeConstraint.blockhash===e.blockhash&&r.lifetimeConstraint.lastValidBlockHeight===e.lastValidBlockHeight)return r;let n={...N(r),lifetimeConstraint:e};return Object.freeze(n),n}function ve({version:e}){let r={instructions:[],version:e};return Object.freeze(r),r}var m=(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))(m||{});var Dr=1;function h(e){return e>=2}function L(e){return (e&Dr)!==0}function ie(e,r){return e|r}var Le="SysvarRecentB1ockHashes11111111111111111111",Re="11111111111111111111111111111111";function wn(e){if(!Me(e))throw new Error("Transaction is not a durable nonce transaction")}function ke(e,r){return {accounts:[{address:e,role:m.WRITABLE},{address:Le,role:m.READONLY},{address:r,role:m.READONLY_SIGNER}],data:new Uint8Array([4,0,0,0]),programAddress:Re}}function Y(e){var r;return e.programAddress===Re&&e.data!=null&&Nr(e.data)&&((r=e.accounts)==null?void 0:r.length)===3&&e.accounts[0].address!=null&&e.accounts[0].role===m.WRITABLE&&e.accounts[1].address===Le&&e.accounts[1].role===m.READONLY&&e.accounts[2].address!=null&&h(e.accounts[2].role)}function Nr(e){return e.byteLength===4&&e[0]===4&&e[1]===0&&e[2]===0&&e[3]===0}function Me(e){return "lifetimeConstraint"in e&&typeof e.lifetimeConstraint.nonce=="string"&&e.instructions[0]!=null&&Y(e.instructions[0])}function vr(e,r,n){return e.accounts[0].address===r&&e.accounts[2].address===n}function Fe({nonce:e,nonceAccountAddress:r,nonceAuthorityAddress:n},t){let o,s=t.instructions[0];if(s&&Y(s))if(vr(s,r,n)){if(Me(t)&&t.lifetimeConstraint.nonce===e)return t;o=[s,...t.instructions.slice(1)];}else o=[ke(r,n),...t.instructions.slice(1)];else o=[ke(r,n),...t.instructions];let i={...N(t),instructions:o,lifetimeConstraint:{nonce:e}};return Object.freeze(i),i}function Ve(e,r){if("feePayer"in r&&e===r.feePayer)return r;let n={...N(r),feePayer:e};return Object.freeze(n),n}function Ue(e,r){let n={...N(r),instructions:[...r.instructions,e]};return Object.freeze(n),n}function Ln(e,r){let n={...N(r),instructions:[e,...r.instructions]};return Object.freeze(n),n}function Oe(){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 We(){var e;if(Oe(),typeof globalThis.crypto>"u"||typeof((e=globalThis.crypto.subtle)==null?void 0:e.exportKey)!="function")throw new Error("No key export implementation could be found")}async function Pe(){var e;if(Oe(),typeof globalThis.crypto>"u"||typeof((e=globalThis.crypto.subtle)==null?void 0:e.sign)!="function")throw new Error("No signing implementation could be found")}var se,ae;function _e(){return se||(se=M()),se}function kr(){return ae||(ae=F()),ae}function j(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=_e().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 Lr(e){return j(e),e}function G(){return z(H({encoding:_e(),size:32}),e=>Lr(e))}function V(){return K({encoding:kr(),size:32})}function U(){return new Intl.Collator("en",{caseFirst:"lower",ignorePunctuation:!1,localeMatcher:"best fit",numeric:!1,sensitivity:"variant",usage:"sort"}).compare}async function $e(e){if(await We(),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);return V().decode(new Uint8Array(r))}function He(e,r,n){var t;e[r]=n((t=e[r])!=null?t:{role:m.READONLY});}var f=Symbol("AddressMapTypeProperty");function Ke(e,r){let n={[e]:{[f]:0,role:m.WRITABLE_SIGNER}},t=new Set;for(let o of r){He(n,o.programAddress,i=>{if(t.add(o.programAddress),f in i){if(L(i.role))switch(i[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(i[f]===2)return i}return {[f]:2,role:m.READONLY}});let s;if(o.accounts)for(let i of o.accounts)He(n,i.address,a=>{let{address:d,...c}=i;if(f in a)switch(a[f]){case 0:return a;case 1:{let l=ie(a.role,c.role);if("lookupTableAddress"in c){if(a.lookupTableAddress!==c.lookupTableAddress&&(s||(s=U()))(c.lookupTableAddress,a.lookupTableAddress)<0)return {[f]:1,...c,role:l}}else if(h(c.role))return {[f]:2,role:l};return a.role!==l?{...a,role:l}:a}case 2:{let l=ie(a.role,c.role);if(t.has(i.address)){if(L(c.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!==l?{...a,role:l}:a}else return "lookupTableAddress"in c&&!h(a.role)?{...c,[f]:1,role:l}:a.role!==l?{...a,role:l}:a}}return "lookupTableAddress"in c?{...c,[f]:1}:{...c,[f]:2}});}return n}function Ye(e){let r;return Object.entries(e).sort(([t,o],[s,i])=>{if(o[f]!==i[f]){if(o[f]===0)return -1;if(i[f]===0)return 1;if(o[f]===2)return -1;if(i[f]===2)return 1}let a=h(o.role);if(a!==h(i.role))return a?-1:1;let d=L(o.role);return d!==L(i.role)?d?-1:1:(r||(r=U()),o[f]===1&&i[f]===1&&o.lookupTableAddress!==i.lookupTableAddress?r(o.lookupTableAddress,i.lookupTableAddress):r(t,s))}).map(([t,o])=>({address:t,...o}))}function je(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===m.WRITABLE?o.writableIndices.push(t.addressIndex):o.readableIndices.push(t.addressIndex);}return Object.keys(r).sort(U()).map(t=>({lookupTableAddress:t,...r[t]}))}function Ge(e){let r=0,n=0,t=0;for(let o of e){if("lookupTableAddress"in o)break;let s=L(o.role);h(o.role)?(t++,s||n++):s||r++;}return {numReadonlyNonSignerAccounts:r,numReadonlySignerAccounts:n,numSignerAccounts:t}}function Rr(e){let r={};for(let[n,t]of e.entries())r[t.address]=n;return r}function qe(e,r){let n=Rr(r);return e.map(({accounts:t,data:o,programAddress:s})=>({programAddressIndex:n[s],...t?{accountIndices:t.map(({address:i})=>n[i])}:null,...o?{data:o}:null}))}function Xe(e){return "nonce"in e?e.nonce:e.blockhash}function Ze(e){let r=e.findIndex(t=>"lookupTableAddress"in t);return (r===-1?e:e.slice(0,r)).map(({address:t})=>t)}function q(e){let r=Ke(e.feePayer,e.instructions),n=Ye(r);return {...e.version!=="legacy"?{addressTableLookups:je(n)}:null,header:Ge(n),instructions:qe(e.instructions,n),lifetimeToken:Xe(e.lifetimeConstraint),staticAccounts:Ze(n),version:e.version}}function Mr(e,r,n){if(r!==n)throw new Error(`Expected [${e}] to have ${r} items, got ${n}.`)}function X(e){return e.reduce((r,n)=>r===null||n===null?null:r+n,0)}function J(e){return T(e)?e.fixedSize:null}function Q(e){var r;return T(e)?e.fixedSize:(r=e.maxSize)!=null?r:null}function b(e,r={}){var s,i;let n=(s=r.size)!=null?s:_();n==="remainder"&&te(e,'Codecs of "remainder" size must have fixed-size items.');let t=Z(n,J(e)),o=(i=Z(n,Q(e)))!=null?i:void 0;return g({...t!==null?{fixedSize:t}:{getSizeFromValue:a=>(typeof n=="object"?x(a.length,n):0)+[...a].reduce((c,l)=>c+x(l,e),0),maxSize:o},write:(a,d,c)=>(typeof n=="number"&&Mr("array",n,a.length),typeof n=="object"&&(c=n.write(a.length,d,c)),a.forEach(l=>{c=e.write(l,d,c);}),c)})}function S(e,r={}){var i,a;let n=(i=r.size)!=null?i:$();n==="remainder"&&te(e,'Codecs of "remainder" size must have fixed-size items.');let t=J(e),o=Z(n,t),s=(a=Z(n,Q(e)))!=null?a:void 0;return p({...o!==null?{fixedSize:o}:{maxSize:s},read:(d,c)=>{let l=[];if(typeof n=="object"&&d.slice(c).length===0)return [l,c];let[I,ne]=Fr(n,t,d,c);c=ne;for(let be=0;be<I;be+=1){let[gr,mr]=e.read(d,c);c=mr,l.push(gr);}return [l,c]}})}function Fr(e,r,n,t){if(typeof e=="number")return [e,t];if(typeof e=="object")return e.read(n,t);if(e==="remainder"){if(r===null)throw new Error('Codecs of "remainder" size must have fixed-size items.');let o=Math.max(0,n.length-t);if(o%r!==0)throw new Error(`The remainder of the byte array (${o} bytes) cannot be split into chunks of ${r} bytes. Codecs of "remainder" size must have a remainder that is a multiple of its item size. In other words, ${o} modulo ${r} should be equal to zero.`);return [o/r,t]}throw new Error(`Unrecognized array-like codec size: ${JSON.stringify(e)}`)}function Z(e,r){return typeof e!="number"?null:e===0?0:r===null?null:r*e}function ee(e={}){var t;let r=(t=e.size)!=null?t:"variable",n=g({getSizeFromValue:o=>o.length,write:(o,s,i)=>(s.set(o,i),i+o.length)});return r==="variable"?n:typeof r=="number"?W(n,r):g({getSizeFromValue:o=>x(o.length,r)+o.length,write:(o,s,i)=>(i=r.write(o.length,s,i),n.write(o,s,i))})}function re(e={}){var t;let r=(t=e.size)!=null?t:"variable",n=p({read:(o,s)=>{let i=o.slice(s);return [i,s+i.length]}});return r==="variable"?n:typeof r=="number"?P(n,r):p({read:(o,s)=>{R("bytes",o,s);let[i,a]=r.read(o,s),d=Number(i);s=a;let c=o.slice(s,s+d);v("bytes",d,c);let[l,I]=n.read(c,0);return s+=I,[l,s]}})}function E(e){var o;let r=e.map(([,s])=>s),n=X(r.map(J)),t=(o=X(r.map(Q)))!=null?o:void 0;return g({...n===null?{getSizeFromValue:s=>e.map(([i,a])=>x(s[i],a)).reduce((i,a)=>i+a,0),maxSize:t}:{fixedSize:n},write:(s,i,a)=>(e.forEach(([d,c])=>{a=c.write(s[d],i,a);}),a)})}function w(e){var o;let r=e.map(([,s])=>s),n=X(r.map(J)),t=(o=X(r.map(Q)))!=null?o:void 0;return p({...n===null?{maxSize:t}:{fixedSize:n},read:(s,i)=>{let a={};return e.forEach(([d,c])=>{let[l,I]=c.read(s,i);i=I,a[d]=l;}),[a,i]}})}var ce;function Je(){return ce||(ce=E([["lookupTableAddress",G()],["writableIndices",b(B(),{size:y()})],["readableIndices",b(B(),{size:y()})]])),ce}var de;function Qe(){return de||(de=w([["lookupTableAddress",V()],["writableIndices",S(D(),{size:A()})],["readableIndices",S(D(),{size:A()})]])),de}var ue;function le(){return ue||(ue=B()),ue}var fe;function ge(){return fe||(fe=D()),fe}function er(){return E([["numSignerAccounts",le()],["numReadonlySignerAccounts",le()],["numReadonlyNonSignerAccounts",le()]])}function rr(){return w([["numSignerAccounts",ge()],["numReadonlySignerAccounts",ge()],["numReadonlyNonSignerAccounts",ge()]])}var me;function nr(){return me||(me=z(E([["programAddressIndex",B()],["accountIndices",b(B(),{size:y()})],["data",ee({size:y()})]]),e=>{var r,n;return e.accountIndices!==void 0&&e.data!==void 0?e:{...e,accountIndices:(r=e.accountIndices)!=null?r:[],data:(n=e.data)!=null?n:new Uint8Array(0)}})),me}var pe;function tr(){return pe||(pe=k(w([["programAddressIndex",D()],["accountIndices",S(D(),{size:A()})],["data",re({size:A()})]]),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}})),pe}var Te=128;function or(){return g({getSizeFromValue:e=>e==="legacy"?0:1,maxSize:1,write:(e,r,n)=>{if(e==="legacy")return n;if(e<0||e>127)throw new Error(`Transaction version must be in the range [0, 127]. \`${e}\` given.`);return r.set([e|Te],n),n+1}})}function ir(){return p({maxSize:1,read:(e,r)=>{let n=e[r];return n&Te?[n^Te,r+1]:["legacy",r]}})}function sr(){return E(cr())}function ar(){return z(E([...cr(),["addressTableLookups",Ur()]]),e=>{var r;return e.version==="legacy"?e:{...e,addressTableLookups:(r=e.addressTableLookups)!=null?r:[]}})}function cr(){return [["version",or()],["header",er()],["staticAccounts",b(G(),{size:y()})],["lifetimeToken",H({encoding:M(),size:32})],["instructions",b(nr(),{size:y()})]]}function Vr(){return [["version",ir()],["header",rr()],["staticAccounts",S(V(),{size:A()})],["lifetimeToken",K({encoding:F(),size:32})],["instructions",S(tr(),{size:A()})],["addressTableLookups",Or()]]}function Ur(){return b(Je(),{size:y()})}function Or(){return S(Qe(),{size:A()})}function O(){return g({getSizeFromValue:e=>e.version==="legacy"?sr().getSizeFromValue(e):ar().getSizeFromValue(e),write:(e,r,n)=>e.version==="legacy"?sr().write(e,r,n):ar().write(e,r,n)})}function ye(){return k(w(Vr()),({addressTableLookups:e,...r})=>r.version==="legacy"||!(e!=null&&e.length)?r:{...r,addressTableLookups:e})}function yo(){return C(O(),ye())}function dr(e){var t;let r=q(e),n;if("signatures"in e){n=[];for(let o=0;o<r.header.numSignerAccounts;o++)n[o]=(t=e.signatures[r.staticAccounts[o]])!=null?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 ur(e,...r){return r.reduce((n,t)=>t(n),e)}function Wr(e){let{header:r}=e,n=r.numSignerAccounts-r.numReadonlySignerAccounts,t=e.staticAccounts.length-r.numSignerAccounts-r.numReadonlyNonSignerAccounts,o=[],s=0;for(let i=0;i<n;i++)o.push({address:e.staticAccounts[s],role:m.WRITABLE_SIGNER}),s++;for(let i=0;i<r.numReadonlySignerAccounts;i++)o.push({address:e.staticAccounts[s],role:m.READONLY_SIGNER}),s++;for(let i=0;i<t;i++)o.push({address:e.staticAccounts[s],role:m.WRITABLE}),s++;for(let i=0;i<r.numReadonlyNonSignerAccounts;i++)o.push({address:e.staticAccounts[s],role:m.READONLY}),s++;return o}function Pr(e,r){var s,i;let n=(s=r[e.programAddressIndex])==null?void 0:s.address;if(!n)throw new Error(`Could not find program address at index ${e.programAddressIndex}`);let t=(i=e.accountIndices)==null?void 0:i.map(a=>r[a]),{data:o}=e;return {programAddress:n,...t&&t.length?{accounts:t}:{},...o&&o.length?{data:o}:{}}}function _r(e,r,n){if(!r||!Y(r))return {blockhash:e,lastValidBlockHeight:n!=null?n:2n**64n-1n};{let t=r.accounts[0].address;j(t);let o=r.accounts[2].address;return j(o),{nonce:e,nonceAccountAddress:t,nonceAuthorityAddress:o}}}function $r(e){let{compiledMessage:{staticAccounts:r},signatures:n}=e;return n.reduce((t,o,s)=>{if(o.every(d=>d===0))return t;let a=r[s];return {...t,[a]:o}},{})}function lr(e,r){let{compiledMessage:n}=e;if("addressTableLookups"in n&&n.addressTableLookups.length>0)throw new Error("Cannot convert transaction with addressTableLookups");let t=n.staticAccounts[0];if(!t)throw new Error("No fee payer set in CompiledTransaction");let o=Wr(n),s=n.instructions.map(c=>Pr(c,o)),i=s[0],a=_r(n.lifetimeToken,i,r),d=$r(e);return ur(ve({version:n.version}),c=>Ve(t,c),c=>s.reduce((l,I)=>Ue(I,l),c),c=>"blockhash"in a?Ne(a,c):Fe(a,c),c=>e.signatures.length?{...c,signatures:d}:c)}function Hr(){return E([["signatures",b(ee({size:64}),{size:y()})],["compiledMessage",O()]])}function Kr(){return w([["signatures",S(re({size:64}),{size:A()})],["compiledMessage",ye()]])}function Ae(){return z(Hr(),dr)}function Yr(e){return k(Kr(),r=>lr(r,e))}function Jo(e){return C(Ae(),Yr(e))}async function fr(e,r){await Pe();let n=await crypto.subtle.sign("Ed25519",e,r);return new Uint8Array(n)}var he;function pi(e){he||(he=F());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 he.decode(r)}async function jr(e,r){let n=q(r),t="signatures"in r?{...r.signatures}:{},o=O().encode(n),s=await Promise.all(e.map(a=>Promise.all([$e(a.publicKey),fr(a.privateKey,o)])));for(let[a,d]of s)t[a]=d;let i={...r,signatures:t};return Object.freeze(i),i}async function Ti(e,r){let n=await jr(e,r);return Gr(n),Object.freeze(n),n}function Gr(e){let r=e.instructions.flatMap(t=>{var o,s;return (s=(o=t.accounts)==null?void 0:o.filter(i=>h(i.role)))!=null?s:[]}).map(t=>t.address);new Set([e.feePayer,...r]).forEach(t=>{if(!e.signatures[t])throw new Error(`Transaction is missing signature for address \`${t}\``)});}function Si(e){let r=Ae().encode(e);return De().decode(r)}
6
6
 
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;
7
+ exports.appendTransactionInstruction = Ue;
8
+ exports.assertIsBlockhash = zr;
9
+ exports.assertIsDurableNonceTransaction = wn;
10
+ exports.assertIsTransactionWithBlockhashLifetime = un;
11
+ exports.assertTransactionIsFullySigned = Gr;
12
+ exports.compileMessage = q;
13
+ exports.createTransaction = ve;
14
+ exports.getBase64EncodedWireTransaction = Si;
15
+ exports.getCompiledMessageCodec = yo;
16
+ exports.getCompiledMessageDecoder = ye;
17
+ exports.getCompiledMessageEncoder = O;
18
+ exports.getSignatureFromTransaction = pi;
19
+ exports.getTransactionCodec = Jo;
20
+ exports.getTransactionDecoder = Yr;
21
+ exports.getTransactionEncoder = Ae;
22
+ exports.isAdvanceNonceAccountInstruction = Y;
23
+ exports.partiallySignTransaction = jr;
24
+ exports.prependTransactionInstruction = Ln;
25
+ exports.setTransactionFeePayer = Ve;
26
+ exports.setTransactionLifetimeUsingBlockhash = Ne;
27
+ exports.setTransactionLifetimeUsingDurableNonce = Fe;
28
+ exports.signTransaction = Ti;
26
29
 
27
30
  return exports;
28
31
 
@@ -1,4 +1,4 @@
1
- import { Base58EncodedAddress } from '@solana/addresses';
1
+ import { Address } from '@solana/addresses';
2
2
  import { IAccountLookupMeta, IAccountMeta, IInstruction, ReadonlyAccount, ReadonlyAccountLookup, ReadonlySignerAccount, WritableAccount, WritableAccountLookup, WritableSignerAccount } from '@solana/instructions';
3
3
  export declare const enum AddressMapEntryType {
4
4
  FEE_PAYER = 0,
@@ -22,7 +22,7 @@ type StaticAccountEntry = Omit<ReadonlyAccount | ReadonlySignerAccount | Writabl
22
22
  };
23
23
  declare const TYPE: unique symbol;
24
24
  export declare const ADDRESS_MAP_TYPE_PROPERTY: typeof TYPE;
25
- export declare function getAddressMapFromInstructions(feePayer: Base58EncodedAddress, instructions: readonly IInstruction[]): AddressMap;
25
+ export declare function getAddressMapFromInstructions(feePayer: Address, instructions: readonly IInstruction[]): AddressMap;
26
26
  export declare function getOrderedAccountsFromAddressMap(addressMap: AddressMap): OrderedAccounts;
27
27
  export {};
28
28
  //# sourceMappingURL=accounts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"accounts.d.ts","sourceRoot":"","sources":["../../src/accounts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAwB,MAAM,mBAAmB,CAAC;AAClE,OAAO,EAEH,kBAAkB,EAClB,YAAY,EACZ,YAAY,EAIZ,eAAe,EACf,qBAAqB,EACrB,qBAAqB,EACrB,eAAe,EACf,qBAAqB,EACrB,qBAAqB,EACxB,MAAM,sBAAsB,CAAC;AAE9B,0BAAkB,mBAAmB;IACjC,SAAS,IAAA;IACT,YAAY,IAAA;IACZ,MAAM,IAAA;CACT;AAED,KAAK,UAAU,GAAG;IACd,CAAC,OAAO,EAAE,MAAM,GAAG,oBAAoB,GAAG,uBAAuB,GAAG,kBAAkB,CAAC;CAC1F,CAAC;AACF,KAAK,oBAAoB,GAAG,IAAI,CAAC,qBAAqB,EAAE,SAAS,CAAC,GAAG;IACjE,CAAC,IAAI,CAAC,EAAE,mBAAmB,CAAC,SAAS,CAAC;CACzC,CAAC;AACF,KAAK,uBAAuB,GAAG,IAAI,CAAC,qBAAqB,GAAG,qBAAqB,EAAE,SAAS,CAAC,GAAG;IAC5F,CAAC,IAAI,CAAC,EAAE,mBAAmB,CAAC,YAAY,CAAC;CAC5C,CAAC;AACF,MAAM,MAAM,eAAe,GAAG,CAAC,YAAY,GAAG,kBAAkB,CAAC,EAAE,GAAG;IAAE,QAAQ,CAAC,OAAO,EAAE,OAAO,MAAM,CAAA;CAAE,CAAC;AAC1G,KAAK,kBAAkB,GAAG,IAAI,CAC1B,eAAe,GAAG,qBAAqB,GAAG,eAAe,GAAG,qBAAqB,EACjF,SAAS,CACZ,GAAG;IAAE,CAAC,IAAI,CAAC,EAAE,mBAAmB,CAAC,MAAM,CAAA;CAAE,CAAC;AAY3C,QAAA,MAAM,IAAI,eAAmC,CAAC;AAC9C,eAAO,MAAM,yBAAyB,EAAE,OAAO,IAAW,CAAC;AAE3D,wBAAgB,6BAA6B,CAAC,QAAQ,EAAE,OAAO,EAAE,YAAY,EAAE,SAAS,YAAY,EAAE,GAAG,UAAU,CAoJlH;AAED,wBAAgB,gCAAgC,CAAC,UAAU,EAAE,UAAU,GAAG,eAAe,CA0CxF"}
@@ -1,6 +1,6 @@
1
- import { IDurableNonceTransaction } from './durable-nonce';
2
- import { ITransactionWithSignatures } from './signatures';
3
- import { BaseTransaction } from './types';
1
+ import { IDurableNonceTransaction } from './durable-nonce.js';
2
+ import { ITransactionWithSignatures } from './signatures.js';
3
+ import { BaseTransaction } from './types.js';
4
4
  export type Blockhash = string & {
5
5
  readonly __brand: unique symbol;
6
6
  };
@@ -12,6 +12,7 @@ export interface ITransactionWithBlockhashLifetime {
12
12
  readonly lifetimeConstraint: BlockhashLifetimeConstraint;
13
13
  }
14
14
  export declare function assertIsBlockhash(putativeBlockhash: string): asserts putativeBlockhash is Blockhash;
15
+ export declare function assertIsTransactionWithBlockhashLifetime(transaction: BaseTransaction | (BaseTransaction & ITransactionWithBlockhashLifetime)): asserts transaction is BaseTransaction & ITransactionWithBlockhashLifetime;
15
16
  export declare function setTransactionLifetimeUsingBlockhash<TTransaction extends BaseTransaction & IDurableNonceTransaction>(blockhashLifetimeConstraint: BlockhashLifetimeConstraint, transaction: TTransaction | (TTransaction & ITransactionWithSignatures)): Omit<TTransaction, keyof ITransactionWithSignatures | 'lifetimeConstraint'> & ITransactionWithBlockhashLifetime;
16
17
  export declare function setTransactionLifetimeUsingBlockhash<TTransaction extends BaseTransaction | (BaseTransaction & ITransactionWithBlockhashLifetime)>(blockhashLifetimeConstraint: BlockhashLifetimeConstraint, transaction: TTransaction | (TTransaction & ITransactionWithSignatures)): Omit<TTransaction, keyof ITransactionWithSignatures> & ITransactionWithBlockhashLifetime;
17
18
  export {};
@@ -0,0 +1 @@
1
+ {"version":3,"file":"blockhash.d.ts","sourceRoot":"","sources":["../../src/blockhash.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE,0BAA0B,EAAE,MAAM,cAAc,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAG1C,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG;IAAE,QAAQ,CAAC,OAAO,EAAE,OAAO,MAAM,CAAA;CAAE,CAAC;AAErE,KAAK,2BAA2B,GAAG,QAAQ,CAAC;IACxC,SAAS,EAAE,SAAS,CAAC;IACrB,oBAAoB,EAAE,MAAM,CAAC;CAChC,CAAC,CAAC;AAEH,MAAM,WAAW,iCAAiC;IAC9C,QAAQ,CAAC,kBAAkB,EAAE,2BAA2B,CAAC;CAC5D;AAID,wBAAgB,iBAAiB,CAAC,iBAAiB,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,IAAI,SAAS,CAuBnG;AAkBD,wBAAgB,wCAAwC,CACpD,WAAW,EAAE,eAAe,GAAG,CAAC,eAAe,GAAG,iCAAiC,CAAC,GACrF,OAAO,CAAC,WAAW,IAAI,eAAe,GAAG,iCAAiC,CAK5E;AAED,wBAAgB,oCAAoC,CAAC,YAAY,SAAS,eAAe,GAAG,wBAAwB,EAChH,2BAA2B,EAAE,2BAA2B,EACxD,WAAW,EAAE,YAAY,GAAG,CAAC,YAAY,GAAG,0BAA0B,CAAC,GACxE,IAAI,CAAC,YAAY,EAAE,MAAM,0BAA0B,GAAG,oBAAoB,CAAC,GAAG,iCAAiC,CAAC;AAEnH,wBAAgB,oCAAoC,CAChD,YAAY,SAAS,eAAe,GAAG,CAAC,eAAe,GAAG,iCAAiC,CAAC,EAE5F,2BAA2B,EAAE,2BAA2B,EACxD,WAAW,EAAE,YAAY,GAAG,CAAC,YAAY,GAAG,0BAA0B,CAAC,GACxE,IAAI,CAAC,YAAY,EAAE,MAAM,0BAA0B,CAAC,GAAG,iCAAiC,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { IInstruction } from '@solana/instructions';
2
+ import { ITransactionWithBlockhashLifetime } from './blockhash.js';
3
+ import { IDurableNonceTransaction } from './durable-nonce.js';
4
+ import { ITransactionWithFeePayer } from './fee-payer.js';
5
+ import { BaseTransaction, TransactionVersion } from './types.js';
6
+ export type CompilableTransaction<TVersion extends TransactionVersion = TransactionVersion, TInstruction extends IInstruction = IInstruction> = BaseTransaction<TVersion, TInstruction> & ITransactionWithFeePayer & (ITransactionWithBlockhashLifetime | IDurableNonceTransaction);
7
+ //# sourceMappingURL=compilable-transaction.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compilable-transaction.d.ts","sourceRoot":"","sources":["../../src/compilable-transaction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEpD,OAAO,EAAE,iCAAiC,EAAE,MAAM,aAAa,CAAC;AAChE,OAAO,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAE9D,MAAM,MAAM,qBAAqB,CAC7B,QAAQ,SAAS,kBAAkB,GAAG,kBAAkB,EACxD,YAAY,SAAS,YAAY,GAAG,YAAY,IAChD,eAAe,CAAC,QAAQ,EAAE,YAAY,CAAC,GACvC,wBAAwB,GACxB,CAAC,iCAAiC,GAAG,wBAAwB,CAAC,CAAC"}
@@ -1,7 +1,7 @@
1
- import { Base58EncodedAddress } from '@solana/addresses';
2
- import { OrderedAccounts } from './accounts';
1
+ import { Address } from '@solana/addresses';
2
+ import { OrderedAccounts } from './accounts.js';
3
3
  type AddressTableLookup = Readonly<{
4
- lookupTableAddress: Base58EncodedAddress;
4
+ lookupTableAddress: Address;
5
5
  readableIndices: readonly number[];
6
6
  writableIndices: readonly number[];
7
7
  }>;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compile-address-table-lookups.d.ts","sourceRoot":"","sources":["../../src/compile-address-table-lookups.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAwB,MAAM,mBAAmB,CAAC;AAGlE,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAE7C,KAAK,kBAAkB,GAAG,QAAQ,CAAC;IAC/B,kBAAkB,EAAE,OAAO,CAAC;IAC5B,eAAe,EAAE,SAAS,MAAM,EAAE,CAAC;IACnC,eAAe,EAAE,SAAS,MAAM,EAAE,CAAC;CACtC,CAAC,CAAC;AAEH,wBAAgB,8BAA8B,CAAC,eAAe,EAAE,eAAe,GAAG,kBAAkB,EAAE,CAsBrG"}
@@ -1,4 +1,4 @@
1
- import { OrderedAccounts } from './accounts';
1
+ import { OrderedAccounts } from './accounts.js';
2
2
  type MessageHeader = Readonly<{
3
3
  numReadonlyNonSignerAccounts: number;
4
4
  numReadonlySignerAccounts: number;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compile-header.d.ts","sourceRoot":"","sources":["../../src/compile-header.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAE7C,KAAK,aAAa,GAAG,QAAQ,CAAC;IAC1B,4BAA4B,EAAE,MAAM,CAAC;IACrC,yBAAyB,EAAE,MAAM,CAAC;IAClC,iBAAiB,EAAE,MAAM,CAAC;CAC7B,CAAC,CAAC;AAEH,wBAAgB,wBAAwB,CAAC,eAAe,EAAE,eAAe,GAAG,aAAa,CAuBxF"}
@@ -1,5 +1,5 @@
1
1
  import { IInstruction } from '@solana/instructions';
2
- import { OrderedAccounts } from './accounts';
2
+ import { OrderedAccounts } from './accounts.js';
3
3
  type CompiledInstruction = Readonly<{
4
4
  accountIndices?: number[];
5
5
  data?: Uint8Array;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compile-instructions.d.ts","sourceRoot":"","sources":["../../src/compile-instructions.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEpD,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAE7C,KAAK,mBAAmB,GAAG,QAAQ,CAAC;IAChC,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAC1B,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,mBAAmB,EAAE,MAAM,CAAC;CAC/B,CAAC,CAAC;AAUH,wBAAgB,uBAAuB,CACnC,YAAY,EAAE,SAAS,YAAY,EAAE,EACrC,eAAe,EAAE,eAAe,GACjC,mBAAmB,EAAE,CASvB"}
@@ -1,3 +1,3 @@
1
- import { IDurableNonceTransaction, ITransactionWithBlockhashLifetime } from './index';
1
+ import { IDurableNonceTransaction, ITransactionWithBlockhashLifetime } from './index.js';
2
2
  export declare function getCompiledLifetimeToken(lifetimeConstraint: (ITransactionWithBlockhashLifetime | IDurableNonceTransaction)['lifetimeConstraint']): string;
3
3
  //# sourceMappingURL=compile-lifetime-token.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compile-lifetime-token.d.ts","sourceRoot":"","sources":["../../src/compile-lifetime-token.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,iCAAiC,EAAE,MAAM,SAAS,CAAC;AAEtF,wBAAgB,wBAAwB,CACpC,kBAAkB,EAAE,CAAC,iCAAiC,GAAG,wBAAwB,CAAC,CAAC,oBAAoB,CAAC,GACzG,MAAM,CAKR"}
@@ -1,4 +1,4 @@
1
- import { Base58EncodedAddress } from '@solana/addresses';
2
- import { OrderedAccounts } from './accounts';
3
- export declare function getCompiledStaticAccounts(orderedAccounts: OrderedAccounts): Base58EncodedAddress[];
1
+ import { Address } from '@solana/addresses';
2
+ import { OrderedAccounts } from './accounts.js';
3
+ export declare function getCompiledStaticAccounts(orderedAccounts: OrderedAccounts): Address[];
4
4
  //# sourceMappingURL=compile-static-accounts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compile-static-accounts.d.ts","sourceRoot":"","sources":["../../src/compile-static-accounts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAE5C,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAE7C,wBAAgB,yBAAyB,CAAC,eAAe,EAAE,eAAe,GAAG,OAAO,EAAE,CAKrF"}
@@ -1,11 +1,10 @@
1
- import { Ed25519Signature } from '@solana/keys';
2
- import { CompiledMessage, compileMessage } from './message';
3
- import { ITransactionWithSignatures } from './signatures';
4
- type CompiledTransaction = Readonly<{
1
+ import { SignatureBytes } from '@solana/keys';
2
+ import { CompilableTransaction } from './compilable-transaction.js';
3
+ import { CompiledMessage } from './message.js';
4
+ import { ITransactionWithSignatures } from './signatures.js';
5
+ export type CompiledTransaction = Readonly<{
5
6
  compiledMessage: CompiledMessage;
6
- signatures: Ed25519Signature[];
7
+ signatures: SignatureBytes[];
7
8
  }>;
8
- type CompilableTransaction = Parameters<typeof compileMessage>[0];
9
9
  export declare function getCompiledTransaction(transaction: CompilableTransaction | (CompilableTransaction & ITransactionWithSignatures)): CompiledTransaction;
10
- export {};
11
10
  //# sourceMappingURL=compile-transaction.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compile-transaction.d.ts","sourceRoot":"","sources":["../../src/compile-transaction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAE9C,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,EAAE,eAAe,EAAkB,MAAM,WAAW,CAAC;AAC5D,OAAO,EAAE,0BAA0B,EAAE,MAAM,cAAc,CAAC;AAE1D,MAAM,MAAM,mBAAmB,GAAG,QAAQ,CAAC;IACvC,eAAe,EAAE,eAAe,CAAC;IACjC,UAAU,EAAE,cAAc,EAAE,CAAC;CAChC,CAAC,CAAC;AAEH,wBAAgB,sBAAsB,CAClC,WAAW,EAAE,qBAAqB,GAAG,CAAC,qBAAqB,GAAG,0BAA0B,CAAC,GAC1F,mBAAmB,CAgBrB"}
@@ -1,4 +1,4 @@
1
- import { Transaction, TransactionVersion } from './types';
1
+ import { Transaction, TransactionVersion } from './types.js';
2
2
  type TransactionConfig<TVersion extends TransactionVersion> = Readonly<{
3
3
  version: TVersion;
4
4
  }>;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-transaction.d.ts","sourceRoot":"","sources":["../../src/create-transaction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAE1D,KAAK,iBAAiB,CAAC,QAAQ,SAAS,kBAAkB,IAAI,QAAQ,CAAC;IACnE,OAAO,EAAE,QAAQ,CAAC;CACrB,CAAC,CAAC;AAEH,wBAAgB,iBAAiB,CAAC,QAAQ,SAAS,kBAAkB,EACjE,MAAM,EAAE,iBAAiB,CAAC,QAAQ,CAAC,GACpC,OAAO,CAAC,WAAW,EAAE;IAAE,OAAO,EAAE,QAAQ,CAAA;CAAE,CAAC,CAAC"}
@@ -1,7 +1,5 @@
1
- import { getCompiledTransaction } from './compile-transaction';
2
- import { ITransactionWithSignatures } from './signatures';
3
- type CompiledTransaction = ReturnType<typeof getCompiledTransaction>;
4
- type CompilableTransaction = Parameters<typeof getCompiledTransaction>[0];
1
+ import { CompilableTransaction } from './compilable-transaction.js';
2
+ import { CompiledTransaction } from './compile-transaction.js';
3
+ import { ITransactionWithSignatures } from './signatures.js';
5
4
  export declare function decompileTransaction(compiledTransaction: CompiledTransaction, lastValidBlockHeight?: bigint): CompilableTransaction | (CompilableTransaction & ITransactionWithSignatures);
6
- export {};
7
5
  //# sourceMappingURL=decompile-transaction.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"decompile-transaction.d.ts","sourceRoot":"","sources":["../../src/decompile-transaction.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAM5D,OAAO,EAAE,0BAA0B,EAAE,MAAM,cAAc,CAAC;AAyH1D,wBAAgB,oBAAoB,CAChC,mBAAmB,EAAE,mBAAmB,EACxC,oBAAoB,CAAC,EAAE,MAAM,GAC9B,qBAAqB,GAAG,CAAC,qBAAqB,GAAG,0BAA0B,CAAC,CAyC9E"}
@@ -1,7 +1,7 @@
1
- import { Base58EncodedAddress } from '@solana/addresses';
1
+ import { Address } from '@solana/addresses';
2
2
  import { IInstruction, IInstructionWithAccounts, IInstructionWithData, ReadonlyAccount, ReadonlySignerAccount, WritableAccount, WritableSignerAccount } from '@solana/instructions';
3
- import { ITransactionWithSignatures } from './signatures';
4
- import { BaseTransaction } from './types';
3
+ import { ITransactionWithSignatures } from './signatures.js';
4
+ import { BaseTransaction } from './types.js';
5
5
  type AdvanceNonceAccountInstruction<TNonceAccountAddress extends string = string, TNonceAuthorityAddress extends string = string> = IInstruction<'11111111111111111111111111111111'> & IInstructionWithAccounts<readonly [
6
6
  WritableAccount<TNonceAccountAddress>,
7
7
  ReadonlyAccount<'SysvarRecentB1ockHashes11111111111111111111'>,
@@ -12,8 +12,8 @@ type AdvanceNonceAccountInstructionData = Uint8Array & {
12
12
  };
13
13
  type DurableNonceConfig<TNonceAccountAddress extends string = string, TNonceAuthorityAddress extends string = string, TNonceValue extends string = string> = Readonly<{
14
14
  readonly nonce: Nonce<TNonceValue>;
15
- readonly nonceAccountAddress: Base58EncodedAddress<TNonceAccountAddress>;
16
- readonly nonceAuthorityAddress: Base58EncodedAddress<TNonceAuthorityAddress>;
15
+ readonly nonceAccountAddress: Address<TNonceAccountAddress>;
16
+ readonly nonceAuthorityAddress: Address<TNonceAuthorityAddress>;
17
17
  }>;
18
18
  export type Nonce<TNonceValue extends string = string> = TNonceValue & {
19
19
  readonly __brand: unique symbol;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"durable-nonce.d.ts","sourceRoot":"","sources":["../../src/durable-nonce.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAEH,YAAY,EACZ,wBAAwB,EACxB,oBAAoB,EAEpB,eAAe,EACf,qBAAqB,EACrB,eAAe,EACf,qBAAqB,EACxB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,0BAA0B,EAAE,MAAM,cAAc,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAG1C,KAAK,8BAA8B,CAC/B,oBAAoB,SAAS,MAAM,GAAG,MAAM,EAC5C,sBAAsB,SAAS,MAAM,GAAG,MAAM,IAC9C,YAAY,CAAC,kCAAkC,CAAC,GAChD,wBAAwB,CACpB,SAAS;IACL,eAAe,CAAC,oBAAoB,CAAC;IACrC,eAAe,CAAC,6CAA6C,CAAC;IAC9D,qBAAqB,CAAC,sBAAsB,CAAC,GAAG,qBAAqB,CAAC,sBAAsB,CAAC;CAChG,CACJ,GACD,oBAAoB,CAAC,kCAAkC,CAAC,CAAC;AAC7D,KAAK,kCAAkC,GAAG,UAAU,GAAG;IACnD,QAAQ,CAAC,OAAO,EAAE,OAAO,MAAM,CAAC;CACnC,CAAC;AACF,KAAK,kBAAkB,CACnB,oBAAoB,SAAS,MAAM,GAAG,MAAM,EAC5C,sBAAsB,SAAS,MAAM,GAAG,MAAM,EAC9C,WAAW,SAAS,MAAM,GAAG,MAAM,IACnC,QAAQ,CAAC;IACT,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC,WAAW,CAAC,CAAC;IACnC,QAAQ,CAAC,mBAAmB,EAAE,OAAO,CAAC,oBAAoB,CAAC,CAAC;IAC5D,QAAQ,CAAC,qBAAqB,EAAE,OAAO,CAAC,sBAAsB,CAAC,CAAC;CACnE,CAAC,CAAC;AACH,MAAM,MAAM,KAAK,CAAC,WAAW,SAAS,MAAM,GAAG,MAAM,IAAI,WAAW,GAAG;IAAE,QAAQ,CAAC,OAAO,EAAE,OAAO,MAAM,CAAA;CAAE,CAAC;AAC3G,KAAK,uBAAuB,CAAC,WAAW,SAAS,MAAM,GAAG,MAAM,IAAI,QAAQ,CAAC;IACzE,KAAK,EAAE,KAAK,CAAC,WAAW,CAAC,CAAC;CAC7B,CAAC,CAAC;AAMH,MAAM,WAAW,wBAAwB,CACrC,oBAAoB,SAAS,MAAM,GAAG,MAAM,EAC5C,sBAAsB,SAAS,MAAM,GAAG,MAAM,EAC9C,WAAW,SAAS,MAAM,GAAG,MAAM;IAEnC,QAAQ,CAAC,YAAY,EAAE,SAAS;QAE5B,8BAA8B,CAAC,oBAAoB,EAAE,sBAAsB,CAAC;QAC5E,GAAG,YAAY,EAAE;KACpB,CAAC;IACF,QAAQ,CAAC,kBAAkB,EAAE,uBAAuB,CAAC,WAAW,CAAC,CAAC;CACrE;AAED,wBAAgB,+BAA+B,CAC3C,WAAW,EAAE,eAAe,GAAG,CAAC,eAAe,GAAG,wBAAwB,CAAC,GAC5E,OAAO,CAAC,WAAW,IAAI,eAAe,GAAG,wBAAwB,CAKnE;AAuBD,wBAAgB,gCAAgC,CAC5C,WAAW,EAAE,YAAY,GAC1B,WAAW,IAAI,8BAA8B,CAkB/C;AAgCD,wBAAgB,uCAAuC,CACnD,YAAY,SAAS,eAAe,EACpC,oBAAoB,SAAS,MAAM,GAAG,MAAM,EAC5C,sBAAsB,SAAS,MAAM,GAAG,MAAM,EAC9C,WAAW,SAAS,MAAM,GAAG,MAAM,EAEnC,EACI,KAAK,EACL,mBAAmB,EACnB,qBAAqB,GACxB,EAAE,kBAAkB,CAAC,oBAAoB,EAAE,sBAAsB,EAAE,WAAW,CAAC,EAChF,WAAW,EAAE,YAAY,GAAG,CAAC,YAAY,GAAG,wBAAwB,CAAC,GACtE,IAAI,CAAC,YAAY,EAAE,MAAM,0BAA0B,CAAC,GACnD,wBAAwB,CAAC,oBAAoB,EAAE,sBAAsB,EAAE,WAAW,CAAC,CAwCtF"}
@@ -1,9 +1,9 @@
1
- import { Base58EncodedAddress } from '@solana/addresses';
2
- import { ITransactionWithSignatures } from './signatures';
3
- import { BaseTransaction } from './types';
1
+ import { Address } from '@solana/addresses';
2
+ import { ITransactionWithSignatures } from './signatures.js';
3
+ import { BaseTransaction } from './types.js';
4
4
  export interface ITransactionWithFeePayer<TAddress extends string = string> {
5
- readonly feePayer: Base58EncodedAddress<TAddress>;
5
+ readonly feePayer: Address<TAddress>;
6
6
  }
7
- export declare function setTransactionFeePayer<TFeePayerAddress extends string, TTransaction extends BaseTransaction>(feePayer: Base58EncodedAddress<TFeePayerAddress>, transaction: (TTransaction & ITransactionWithSignatures) | (TTransaction & ITransactionWithFeePayer<string> & ITransactionWithSignatures)): Omit<TTransaction, keyof ITransactionWithSignatures> & ITransactionWithFeePayer<TFeePayerAddress>;
8
- export declare function setTransactionFeePayer<TFeePayerAddress extends string, TTransaction extends BaseTransaction>(feePayer: Base58EncodedAddress<TFeePayerAddress>, transaction: TTransaction | (TTransaction & ITransactionWithFeePayer<string>)): TTransaction & ITransactionWithFeePayer<TFeePayerAddress>;
7
+ export declare function setTransactionFeePayer<TFeePayerAddress extends string, TTransaction extends BaseTransaction>(feePayer: Address<TFeePayerAddress>, transaction: (TTransaction & ITransactionWithSignatures) | (TTransaction & ITransactionWithFeePayer<string> & ITransactionWithSignatures)): Omit<TTransaction, keyof ITransactionWithSignatures> & ITransactionWithFeePayer<TFeePayerAddress>;
8
+ export declare function setTransactionFeePayer<TFeePayerAddress extends string, TTransaction extends BaseTransaction>(feePayer: Address<TFeePayerAddress>, transaction: TTransaction | (TTransaction & ITransactionWithFeePayer<string>)): TTransaction & ITransactionWithFeePayer<TFeePayerAddress>;
9
9
  //# sourceMappingURL=fee-payer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fee-payer.d.ts","sourceRoot":"","sources":["../../src/fee-payer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAE5C,OAAO,EAAE,0BAA0B,EAAE,MAAM,cAAc,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAG1C,MAAM,WAAW,wBAAwB,CAAC,QAAQ,SAAS,MAAM,GAAG,MAAM;IACtE,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC;CACxC;AAED,wBAAgB,sBAAsB,CAAC,gBAAgB,SAAS,MAAM,EAAE,YAAY,SAAS,eAAe,EACxG,QAAQ,EAAE,OAAO,CAAC,gBAAgB,CAAC,EACnC,WAAW,EACL,CAAC,YAAY,GAAG,0BAA0B,CAAC,GAC3C,CAAC,YAAY,GAAG,wBAAwB,CAAC,MAAM,CAAC,GAAG,0BAA0B,CAAC,GACrF,IAAI,CAAC,YAAY,EAAE,MAAM,0BAA0B,CAAC,GAAG,wBAAwB,CAAC,gBAAgB,CAAC,CAAC;AAErG,wBAAgB,sBAAsB,CAAC,gBAAgB,SAAS,MAAM,EAAE,YAAY,SAAS,eAAe,EACxG,QAAQ,EAAE,OAAO,CAAC,gBAAgB,CAAC,EACnC,WAAW,EAAE,YAAY,GAAG,CAAC,YAAY,GAAG,wBAAwB,CAAC,MAAM,CAAC,CAAC,GAC9E,YAAY,GAAG,wBAAwB,CAAC,gBAAgB,CAAC,CAAC"}
@@ -1,10 +1,12 @@
1
- export * from './blockhash';
2
- export * from './create-transaction';
3
- export * from './durable-nonce';
4
- export * from './fee-payer';
5
- export * from './instructions';
6
- export * from './serializers';
7
- export * from './signatures';
8
- export * from './types';
9
- export * from './wire-transaction';
1
+ export * from './blockhash.js';
2
+ export * from './compilable-transaction.js';
3
+ export * from './create-transaction.js';
4
+ export * from './durable-nonce.js';
5
+ export * from './fee-payer.js';
6
+ export * from './instructions.js';
7
+ export * from './message.js';
8
+ export * from './serializers/index.js';
9
+ export * from './signatures.js';
10
+ export * from './types.js';
11
+ export * from './wire-transaction.js';
10
12
  //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,0BAA0B,CAAC;AACzC,cAAc,sBAAsB,CAAC;AACrC,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,oBAAoB,CAAC"}
@@ -1,5 +1,5 @@
1
- import { ITransactionWithSignatures } from './signatures';
2
- import { BaseTransaction } from './types';
1
+ import { ITransactionWithSignatures } from './signatures.js';
2
+ import { BaseTransaction } from './types.js';
3
3
  export declare function appendTransactionInstruction<TTransaction extends BaseTransaction>(instruction: TTransaction['instructions'][number], transaction: TTransaction | (TTransaction & ITransactionWithSignatures)): TTransaction | Omit<TTransaction, keyof ITransactionWithSignatures>;
4
4
  export declare function prependTransactionInstruction<TTransaction extends BaseTransaction>(instruction: TTransaction['instructions'][number], transaction: TTransaction | (TTransaction & ITransactionWithSignatures)): TTransaction | Omit<TTransaction, keyof ITransactionWithSignatures>;
5
5
  //# sourceMappingURL=instructions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"instructions.d.ts","sourceRoot":"","sources":["../../src/instructions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,MAAM,cAAc,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAG1C,wBAAgB,4BAA4B,CAAC,YAAY,SAAS,eAAe,EAC7E,WAAW,EAAE,YAAY,CAAC,cAAc,CAAC,CAAC,MAAM,CAAC,EACjD,WAAW,EAAE,YAAY,GAAG,CAAC,YAAY,GAAG,0BAA0B,CAAC,GACxE,YAAY,GAAG,IAAI,CAAC,YAAY,EAAE,MAAM,0BAA0B,CAAC,CAOrE;AAED,wBAAgB,6BAA6B,CAAC,YAAY,SAAS,eAAe,EAC9E,WAAW,EAAE,YAAY,CAAC,cAAc,CAAC,CAAC,MAAM,CAAC,EACjD,WAAW,EAAE,YAAY,GAAG,CAAC,YAAY,GAAG,0BAA0B,CAAC,GACxE,YAAY,GAAG,IAAI,CAAC,YAAY,EAAE,MAAM,0BAA0B,CAAC,CAOrE"}
@@ -1,19 +1,15 @@
1
- import { ITransactionWithBlockhashLifetime } from './blockhash';
2
- import { getCompiledAddressTableLookups } from './compile-address-table-lookups';
3
- import { getCompiledMessageHeader } from './compile-header';
4
- import { getCompiledInstructions } from './compile-instructions';
5
- import { getCompiledLifetimeToken } from './compile-lifetime-token';
6
- import { getCompiledStaticAccounts } from './compile-static-accounts';
7
- import { IDurableNonceTransaction } from './durable-nonce';
8
- import { ITransactionWithFeePayer } from './fee-payer';
9
- import { BaseTransaction } from './types';
1
+ import { CompilableTransaction } from './compilable-transaction.js';
2
+ import { getCompiledAddressTableLookups } from './compile-address-table-lookups.js';
3
+ import { getCompiledMessageHeader } from './compile-header.js';
4
+ import { getCompiledInstructions } from './compile-instructions.js';
5
+ import { getCompiledLifetimeToken } from './compile-lifetime-token.js';
6
+ import { getCompiledStaticAccounts } from './compile-static-accounts.js';
10
7
  type BaseCompiledMessage = Readonly<{
11
8
  header: ReturnType<typeof getCompiledMessageHeader>;
12
9
  instructions: ReturnType<typeof getCompiledInstructions>;
13
10
  lifetimeToken: ReturnType<typeof getCompiledLifetimeToken>;
14
11
  staticAccounts: ReturnType<typeof getCompiledStaticAccounts>;
15
12
  }>;
16
- type CompilableTransaction = BaseTransaction & ITransactionWithFeePayer & (ITransactionWithBlockhashLifetime | IDurableNonceTransaction);
17
13
  export type CompiledMessage = LegacyCompiledMessage | VersionedCompiledMessage;
18
14
  type LegacyCompiledMessage = BaseCompiledMessage & Readonly<{
19
15
  version: 'legacy';
@@ -0,0 +1 @@
1
+ {"version":3,"file":"message.d.ts","sourceRoot":"","sources":["../../src/message.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,EAAE,8BAA8B,EAAE,MAAM,iCAAiC,CAAC;AACjF,OAAO,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CAAC;AAC5D,OAAO,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AACjE,OAAO,EAAE,wBAAwB,EAAE,MAAM,0BAA0B,CAAC;AACpE,OAAO,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAC;AAEtE,KAAK,mBAAmB,GAAG,QAAQ,CAAC;IAChC,MAAM,EAAE,UAAU,CAAC,OAAO,wBAAwB,CAAC,CAAC;IACpD,YAAY,EAAE,UAAU,CAAC,OAAO,uBAAuB,CAAC,CAAC;IACzD,aAAa,EAAE,UAAU,CAAC,OAAO,wBAAwB,CAAC,CAAC;IAC3D,cAAc,EAAE,UAAU,CAAC,OAAO,yBAAyB,CAAC,CAAC;CAChE,CAAC,CAAC;AAEH,MAAM,MAAM,eAAe,GAAG,qBAAqB,GAAG,wBAAwB,CAAC;AAE/E,KAAK,qBAAqB,GAAG,mBAAmB,GAC5C,QAAQ,CAAC;IACL,OAAO,EAAE,QAAQ,CAAC;CACrB,CAAC,CAAC;AAEP,KAAK,wBAAwB,GAAG,mBAAmB,GAC/C,QAAQ,CAAC;IACL,mBAAmB,CAAC,EAAE,UAAU,CAAC,OAAO,8BAA8B,CAAC,CAAC;IACxE,OAAO,EAAE,MAAM,CAAC;CACnB,CAAC,CAAC;AAEP,wBAAgB,cAAc,CAC1B,WAAW,EAAE,qBAAqB,GAAG,QAAQ,CAAC;IAAE,OAAO,EAAE,QAAQ,CAAA;CAAE,CAAC,GACrE,qBAAqB,CAAC;AACzB,wBAAgB,cAAc,CAAC,WAAW,EAAE,qBAAqB,GAAG,wBAAwB,CAAC"}
@@ -1,8 +1,8 @@
1
- import { type Codec, type Decoder, type Encoder } from '@solana/codecs-core';
2
- import type { getCompiledAddressTableLookups } from '../compile-address-table-lookups';
1
+ import { type VariableSizeCodec, type VariableSizeDecoder, type VariableSizeEncoder } from '@solana/codecs-core';
2
+ import type { getCompiledAddressTableLookups } from '../compile-address-table-lookups.js';
3
3
  type AddressTableLookup = ReturnType<typeof getCompiledAddressTableLookups>[number];
4
- export declare function getAddressTableLookupEncoder(): Encoder<AddressTableLookup>;
5
- export declare function getAddressTableLookupDecoder(): Decoder<AddressTableLookup>;
6
- export declare function getAddressTableLookupCodec(): Codec<AddressTableLookup>;
4
+ export declare function getAddressTableLookupEncoder(): VariableSizeEncoder<AddressTableLookup>;
5
+ export declare function getAddressTableLookupDecoder(): VariableSizeDecoder<AddressTableLookup>;
6
+ export declare function getAddressTableLookupCodec(): VariableSizeCodec<AddressTableLookup>;
7
7
  export {};
8
8
  //# sourceMappingURL=address-table-lookup.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"address-table-lookup.d.ts","sourceRoot":"","sources":["../../../src/serializers/address-table-lookup.ts"],"names":[],"mappings":"AACA,OAAO,EAGH,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EAC3B,MAAM,qBAAqB,CAAC;AAI7B,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,kCAAkC,CAAC;AAEvF,KAAK,kBAAkB,GAAG,UAAU,CAAC,OAAO,8BAA8B,CAAC,CAAC,MAAM,CAAC,CAAC;AAGpF,wBAAgB,4BAA4B,IAAI,mBAAmB,CAAC,kBAAkB,CAAC,CAgBtF;AAGD,wBAAgB,4BAA4B,IAAI,mBAAmB,CAAC,kBAAkB,CAAC,CAUtF;AAED,wBAAgB,0BAA0B,IAAI,iBAAiB,CAAC,kBAAkB,CAAC,CAElF"}
@@ -1,8 +1,8 @@
1
- import { Codec, Decoder, Encoder } from '@solana/codecs-core';
2
- import { getCompiledMessageHeader } from '../compile-header';
1
+ import { FixedSizeCodec, FixedSizeDecoder, FixedSizeEncoder } from '@solana/codecs-core';
2
+ import { getCompiledMessageHeader } from '../compile-header.js';
3
3
  type MessageHeader = ReturnType<typeof getCompiledMessageHeader>;
4
- export declare function getMessageHeaderEncoder(): Encoder<MessageHeader>;
5
- export declare function getMessageHeaderDecoder(): Decoder<MessageHeader>;
6
- export declare function getMessageHeaderCodec(): Codec<MessageHeader>;
4
+ export declare function getMessageHeaderEncoder(): FixedSizeEncoder<MessageHeader, 3>;
5
+ export declare function getMessageHeaderDecoder(): FixedSizeDecoder<MessageHeader, 3>;
6
+ export declare function getMessageHeaderCodec(): FixedSizeCodec<MessageHeader, MessageHeader, 3>;
7
7
  export {};
8
8
  //# sourceMappingURL=header.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"header.d.ts","sourceRoot":"","sources":["../../../src/serializers/header.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAIzF,OAAO,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AAE7D,KAAK,aAAa,GAAG,UAAU,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAoBjE,wBAAgB,uBAAuB,IAAI,gBAAgB,CAAC,aAAa,EAAE,CAAC,CAAC,CAM5E;AAED,wBAAgB,uBAAuB,IAAI,gBAAgB,CAAC,aAAa,EAAE,CAAC,CAAC,CAM5E;AAED,wBAAgB,qBAAqB,IAAI,cAAc,CAAC,aAAa,EAAE,aAAa,EAAE,CAAC,CAAC,CAMvF"}
@@ -1,2 +1,3 @@
1
- export * from './transaction';
1
+ export * from './message.js';
2
+ export * from './transaction.js';
2
3
  //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/serializers/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC"}
@@ -1,8 +1,8 @@
1
- import { Codec, Decoder, Encoder } from '@solana/codecs-core';
2
- import { getCompiledInstructions } from '../compile-instructions';
1
+ import { VariableSizeCodec, VariableSizeDecoder, VariableSizeEncoder } from '@solana/codecs-core';
2
+ import { getCompiledInstructions } from '../compile-instructions.js';
3
3
  type Instruction = ReturnType<typeof getCompiledInstructions>[number];
4
- export declare function getInstructionEncoder(): Encoder<Instruction>;
5
- export declare function getInstructionDecoder(): Decoder<Instruction>;
6
- export declare function getInstructionCodec(): Codec<Instruction>;
4
+ export declare function getInstructionEncoder(): VariableSizeEncoder<Instruction>;
5
+ export declare function getInstructionDecoder(): VariableSizeDecoder<Instruction>;
6
+ export declare function getInstructionCodec(): VariableSizeCodec<Instruction>;
7
7
  export {};
8
8
  //# sourceMappingURL=instruction.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"instruction.d.ts","sourceRoot":"","sources":["../../../src/serializers/instruction.ts"],"names":[],"mappings":"AAAA,OAAO,EAIH,iBAAiB,EACjB,mBAAmB,EACnB,mBAAmB,EACtB,MAAM,qBAAqB,CAAC;AAW7B,OAAO,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AAElE,KAAK,WAAW,GAAG,UAAU,CAAC,OAAO,uBAAuB,CAAC,CAAC,MAAM,CAAC,CAAC;AAGtE,wBAAgB,qBAAqB,IAAI,mBAAmB,CAAC,WAAW,CAAC,CAuBxE;AAGD,wBAAgB,qBAAqB,IAAI,mBAAmB,CAAC,WAAW,CAAC,CAuBxE;AAED,wBAAgB,mBAAmB,IAAI,iBAAiB,CAAC,WAAW,CAAC,CAEpE"}
@@ -1,6 +1,6 @@
1
- import { Codec, Decoder, Encoder } from '@solana/codecs-core';
2
- import { CompiledMessage } from '../message';
3
- export declare function getCompiledMessageEncoder(): Encoder<CompiledMessage>;
4
- export declare function getCompiledMessageDecoder(): Decoder<CompiledMessage>;
5
- export declare function getCompiledMessageCodec(): Codec<CompiledMessage>;
1
+ import { VariableSizeCodec, VariableSizeDecoder, VariableSizeEncoder } from '@solana/codecs-core';
2
+ import { CompiledMessage } from '../message.js';
3
+ export declare function getCompiledMessageEncoder(): VariableSizeEncoder<CompiledMessage>;
4
+ export declare function getCompiledMessageDecoder(): VariableSizeDecoder<CompiledMessage>;
5
+ export declare function getCompiledMessageCodec(): VariableSizeCodec<CompiledMessage>;
6
6
  //# sourceMappingURL=message.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"message.d.ts","sourceRoot":"","sources":["../../../src/serializers/message.ts"],"names":[],"mappings":"AACA,OAAO,EAMH,iBAAiB,EACjB,mBAAmB,EACnB,mBAAmB,EACtB,MAAM,qBAAqB,CAAC;AAa7B,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AA2D7C,wBAAgB,yBAAyB,IAAI,mBAAmB,CAAC,eAAe,CAAC,CAiBhF;AAED,wBAAgB,yBAAyB,IAAI,mBAAmB,CAAC,eAAe,CAAC,CAOhF;AAED,wBAAgB,uBAAuB,IAAI,iBAAiB,CAAC,eAAe,CAAC,CAE5E"}
@@ -1,6 +1,6 @@
1
- import { Codec, Decoder, Encoder } from '@solana/codecs-core';
2
- import { TransactionVersion } from '../types';
3
- export declare function getTransactionVersionDecoder(): Decoder<TransactionVersion>;
4
- export declare function getTransactionVersionEncoder(): Encoder<TransactionVersion>;
5
- export declare function getTransactionVersionCodec(): Codec<TransactionVersion>;
1
+ import { VariableSizeCodec, VariableSizeDecoder, VariableSizeEncoder } from '@solana/codecs-core';
2
+ import { TransactionVersion } from '../types.js';
3
+ export declare function getTransactionVersionEncoder(): VariableSizeEncoder<TransactionVersion>;
4
+ export declare function getTransactionVersionDecoder(): VariableSizeDecoder<TransactionVersion>;
5
+ export declare function getTransactionVersionCodec(): VariableSizeCodec<TransactionVersion>;
6
6
  //# sourceMappingURL=transaction-version.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transaction-version.d.ts","sourceRoot":"","sources":["../../../src/serializers/transaction-version.ts"],"names":[],"mappings":"AAAA,OAAO,EAIH,iBAAiB,EACjB,mBAAmB,EACnB,mBAAmB,EACtB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAI9C,wBAAgB,4BAA4B,IAAI,mBAAmB,CAAC,kBAAkB,CAAC,CAgBtF;AAED,wBAAgB,4BAA4B,IAAI,mBAAmB,CAAC,kBAAkB,CAAC,CActF;AAED,wBAAgB,0BAA0B,IAAI,iBAAiB,CAAC,kBAAkB,CAAC,CAElF"}