UNPKG

@sega-so/sega-sdk

Version:

An SDK for building applications on top of SEGA.

2 lines 38.6 kB
"use strict";var lt=Object.create;var te=Object.defineProperty,mt=Object.defineProperties,pt=Object.getOwnPropertyDescriptor,dt=Object.getOwnPropertyDescriptors,ft=Object.getOwnPropertyNames,fe=Object.getOwnPropertySymbols,gt=Object.getPrototypeOf,Ie=Object.prototype.hasOwnProperty,ve=Object.prototype.propertyIsEnumerable;var Ke=(n,e,t)=>e in n?te(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,D=(n,e)=>{for(var t in e||(e={}))Ie.call(e,t)&&Ke(n,t,e[t]);if(fe)for(var t of fe(e))ve.call(e,t)&&Ke(n,t,e[t]);return n},K=(n,e)=>mt(n,dt(e));var ge=(n,e)=>{var t={};for(var r in n)Ie.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&fe)for(var r of fe(n))e.indexOf(r)<0&&ve.call(n,r)&&(t[r]=n[r]);return t};var ht=(n,e)=>{for(var t in e)te(n,t,{get:e[t],enumerable:!0})},We=(n,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let m of ft(e))!Ie.call(n,m)&&m!==t&&te(n,m,{get:()=>e[m],enumerable:!(r=pt(e,m))||r.enumerable});return n};var v=(n,e,t)=>(t=n!=null?lt(gt(n)):{},We(e||!n||!n.__esModule?te(t,"default",{value:n,enumerable:!0}):t,n)),bt=n=>We(te({},"__esModule",{value:!0}),n);var b=(n,e,t)=>new Promise((r,m)=>{var c=T=>{try{o(t.next(T))}catch(i){m(i)}},p=T=>{try{o(t.throw(T))}catch(i){m(i)}},o=T=>T.done?r(T.value):Promise.resolve(T.value).then(c,p);o((t=t.apply(n,e)).next())});var Wt={};ht(Wt,{default:()=>Ce});module.exports=bt(Wt);var ct=require("@solana/web3.js"),U=require("@solana/spl-token");var ne=require("lodash");var Be=class{constructor(e){this.logLevel=e.logLevel!==void 0?e.logLevel:0,this.name=e.name}set level(e){this.logLevel=e}get time(){return Date.now().toString()}get moduleName(){return this.name}isLogLevel(e){return e<=this.logLevel}error(...e){return this.isLogLevel(0)?(console.error(this.time,this.name,"sdk logger error",...e),this):this}logWithError(...e){let t=e.map(r=>typeof r=="object"?JSON.stringify(r):r).join(", ");throw new Error(t)}warning(...e){return this.isLogLevel(1)?(console.warn(this.time,this.name,"sdk logger warning",...e),this):this}info(...e){return this.isLogLevel(2)?(console.info(this.time,this.name,"sdk logger info",...e),this):this}debug(...e){return this.isLogLevel(3)?(console.debug(this.time,this.name,"sdk logger debug",...e),this):this}},qe={},Tt={};function _(n){let e=(0,ne.get)(qe,n);if(!e){let t=(0,ne.get)(Tt,n);e=new Be({name:n,logLevel:t}),(0,ne.set)(qe,n,e)}return e}var C=require("@solana/web3.js"),at=v(require("axios"));var me=require("@solana/web3.js");var ot=require("@solana/web3.js");var q=v(require("bn.js")),Mt=v(require("decimal.js"));var ze=v(require("big.js")),St=v(require("bn.js"));var Ue=v(require("toformat")),yt=Ue.default,re=yt;var ie=v(require("big.js")),je=v(require("bn.js")),He=v(require("decimal.js-light"));var Q=v(require("bn.js"));var Ge=9007199254740991;function j(n){let e=_("Sega_parseBigNumberish");if(n instanceof Q.default)return n;if(typeof n=="string"){if(n.match(/^-?[0-9]+$/))return new Q.default(n);e.logWithError(`invalid BigNumberish string: ${n}`)}return typeof n=="number"?(n%1&&e.logWithError(`BigNumberish number underflow: ${n}`),(n>=Ge||n<=-Ge)&&e.logWithError(`BigNumberish number overflow: ${n}`),new Q.default(String(n))):typeof n=="bigint"?new Q.default(n.toString()):(e.error(`invalid BigNumberish value: ${n}`),new Q.default(0))}var he=_("module/fraction"),Me=re(ie.default),oe=re(He.default),wt={0:oe.ROUND_DOWN,1:oe.ROUND_HALF_UP,2:oe.ROUND_UP},Pt={0:ie.default.roundDown,1:ie.default.roundHalfUp,2:ie.default.roundUp},H=class n{constructor(e,t=new je.default(1)){this.numerator=j(e),this.denominator=j(t)}get quotient(){return this.numerator.div(this.denominator)}invert(){return new n(this.denominator,this.numerator)}add(e){let t=e instanceof n?e:new n(j(e));return this.denominator.eq(t.denominator)?new n(this.numerator.add(t.numerator),this.denominator):new n(this.numerator.mul(t.denominator).add(t.numerator.mul(this.denominator)),this.denominator.mul(t.denominator))}sub(e){let t=e instanceof n?e:new n(j(e));return this.denominator.eq(t.denominator)?new n(this.numerator.sub(t.numerator),this.denominator):new n(this.numerator.mul(t.denominator).sub(t.numerator.mul(this.denominator)),this.denominator.mul(t.denominator))}mul(e){let t=e instanceof n?e:new n(j(e));return new n(this.numerator.mul(t.numerator),this.denominator.mul(t.denominator))}div(e){let t=e instanceof n?e:new n(j(e));return new n(this.numerator.mul(t.denominator),this.denominator.mul(t.numerator))}toSignificant(e,t={groupSeparator:""},r=1){Number.isInteger(e)||he.logWithError(`${e} is not an integer.`),e<=0&&he.logWithError(`${e} is not positive.`),oe.set({precision:e+1,rounding:wt[r]});let m=new oe(this.numerator.toString()).div(this.denominator.toString()).toSignificantDigits(e);return m.toFormat(m.decimalPlaces(),t)}toFixed(e,t={groupSeparator:""},r=1){return Number.isInteger(e)||he.logWithError(`${e} is not an integer.`),e<0&&he.logWithError(`${e} is negative.`),Me.DP=e,Me.RM=Pt[r]||1,new Me(this.numerator.toString()).div(this.denominator.toString()).toFormat(e,t)}isZero(){return this.numerator.isZero()}};var cn=_("Sega_amount"),un=re(ze.default);var Ye=require("@solana/web3.js"),Re=require("@solana/spl-token"),J={chainId:101,address:Ye.PublicKey.default.toBase58(),programId:Re.TOKEN_PROGRAM_ID.toBase58(),decimals:9,symbol:"SOL",name:"solana",logoURI:"https://img-v1.raydium.io/icon/So11111111111111111111111111111111111111112.png",tags:[],priority:2,type:"sega",extensions:{coingeckoId:"solana"}},Z={chainId:101,address:"So11111111111111111111111111111111111111112",programId:Re.TOKEN_PROGRAM_ID.toBase58(),decimals:9,symbol:"WSOL",name:"Wrapped SOL",logoURI:"https://img-v1.raydium.io/icon/So11111111111111111111111111111111111111112.png",tags:[],priority:2,type:"sega",extensions:{coingeckoId:"solana"}};var be=require("@solana/web3.js");var M=require("@solana/web3.js"),Je=require("@solana/spl-token");function Le({pubkey:n,isSigner:e=!1,isWritable:t=!0}){return{pubkey:n,isWritable:t,isSigner:e}}var dn=[Le({pubkey:Je.TOKEN_PROGRAM_ID,isWritable:!1}),Le({pubkey:M.SystemProgram.programId,isWritable:!1}),Le({pubkey:M.SYSVAR_RENT_PUBKEY,isWritable:!1})];function Ze({publicKey:n,transformSol:e}){let t=Xe(n.toString());if(t instanceof M.PublicKey)return e&&t.equals(se)?Ne:t;if(e&&t.toString()===se.toBase58())return Ne;if(typeof t=="string"){if(t===M.PublicKey.default.toBase58())return M.PublicKey.default;try{return new M.PublicKey(t)}catch(r){throw new Error("invalid public key")}}throw new Error("invalid public key")}function Xe(n){try{return new M.PublicKey(n)}catch(e){return n}}var fn=new M.PublicKey("MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr"),gn=new M.PublicKey("MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr"),hn=new M.PublicKey("SysvarRent111111111111111111111111111111111"),bn=new M.PublicKey("SysvarC1ock11111111111111111111111111111111"),kt=new M.PublicKey("metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s"),Tn=new M.PublicKey("Sysvar1nstructions1111111111111111111111111"),yn=M.SystemProgram.programId,xn=new M.PublicKey("4k3Dyjzvzp8eMZWUXbBCjEvwSkkk59S5iCNLY3QrkX6R"),wn=new M.PublicKey("Ea5SjE2Y6yvCeW5dYTn7PYMuW5ikXkvbGdcmSnXeaLjS"),Pn=new M.PublicKey("SRMuApVNdxXokk5GT7XD5cUUgXMBCoAz2LHeuAoKWRt"),Sn=new M.PublicKey("EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"),An=new M.PublicKey("Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB"),kn=new M.PublicKey("mSoLzYCxHdYgdzU16g5QSh3i5K3z3KZK7ytfqcJm7So"),Cn=new M.PublicKey("7dHbWXmci3dT8UFYWYZweBLXgycu7Y3iL6trKn1Y7ARj"),In=new M.PublicKey("USDH1SM1ojwWUga67PGrgFWUHibbjqMvuMaDkRJTgkX"),Bn=new M.PublicKey("NRVwhjBQiUPYtfDT5zRBVJajzFQHaBUNtC7SNVvqRFa"),Mn=new M.PublicKey("ANAxByE6G2WjFp7A4NqtWYXb3mgruyzZYg3spfxe6Lbo"),Rn=new M.PublicKey("7vfCXTUXx5WJV5JADk17DUJ4ksgau7utNKj4b963voxs"),Ne=new M.PublicKey("So11111111111111111111111111111111111111112"),se=M.PublicKey.default;var Te=class Te{constructor({mint:e,decimals:t,symbol:r,name:m,skipMint:c=!1,isToken2022:p=!1}){if(e===se.toBase58()||e instanceof be.PublicKey&&se.equals(e)){this.decimals=Z.decimals,this.symbol=Z.symbol,this.name=Z.name,this.mint=new be.PublicKey(Z.address),this.isToken2022=!1;return}this.decimals=t,this.symbol=r||e.toString().substring(0,6),this.name=m||e.toString().substring(0,6),this.mint=c?be.PublicKey.default:Ze({publicKey:e}),this.isToken2022=p}equals(e){return this===e?!0:this.mint.equals(e.mint)}};Te.WSOL=new Te(K(D({},Z),{mint:Z.address}));var ae=Te;var ye=class ye{constructor({decimals:e,symbol:t="UNKNOWN",name:r="UNKNOWN"}){this.decimals=e,this.symbol=t,this.name=r}equals(e){return this===e}};ye.SOL=new ye(J);var Fe=ye;var $e=v(require("bn.js"));var Wn=new H(new $e.default(100));var zn=_("Sega_price");var It=require("@solana/web3.js"),Bt=v(require("bn.js"));var Ct=new q.default(0),Cr=new q.default(1),Ir=new q.default(2),Br=new q.default(3),Mr=new q.default(5),At=new q.default(10),Rr=new q.default(100),Lr=new q.default(1e3),Nr=new q.default(1e4);function De(n,e=1,t=[]){let r=[...n];if(e<=0)return t;for(;r.length;)t.push(r.splice(0,e));return t}var Ft=require("@solana/web3.js"),Dt=require("@solana/spl-token");var E=require("@solana/web3.js");var ce={CreateAccount:"CreateAccount",InitAccount:"InitAccount",CreateATA:"CreateATA",CloseAccount:"CloseAccount",TransferAmount:"TransferAmount",InitMint:"InitMint",MintTo:"MintTo",InitMarket:"InitMarket",Util1216OwnerClaim:"Util1216OwnerClaim",SetComputeUnitPrice:"SetComputeUnitPrice",SetComputeUnitLimit:"SetComputeUnitLimit",ClmmCreatePool:"ClmmCreatePool",ClmmOpenPosition:"ClmmOpenPosition",ClmmIncreasePosition:"ClmmIncreasePosition",ClmmDecreasePosition:"ClmmDecreasePosition",ClmmClosePosition:"ClmmClosePosition",ClmmSwapBaseIn:"ClmmSwapBaseIn",ClmmSwapBaseOut:"ClmmSwapBaseOut",ClmmInitReward:"ClmmInitReward",ClmmSetReward:"ClmmSetReward",ClmmCollectReward:"ClmmCollectReward",ClmmLockPosition:"ClmmLockPosition",ClmmHarvestLockPosition:"ClmmHarvestLockPosition",AmmV4Swap:"AmmV4Swap",AmmV4AddLiquidity:"AmmV4AddLiquidity",AmmV4RemoveLiquidity:"AmmV4RemoveLiquidity",AmmV4SimulatePoolInfo:"AmmV4SimulatePoolInfo",AmmV4SwapBaseIn:"AmmV4SwapBaseIn",AmmV4SwapBaseOut:"AmmV4SwapBaseOut",AmmV4CreatePool:"AmmV4CreatePool",AmmV4InitPool:"AmmV4InitPool",AmmV5AddLiquidity:"AmmV5AddLiquidity",AmmV5RemoveLiquidity:"AmmV5RemoveLiquidity",AmmV5SimulatePoolInfo:"AmmV5SimulatePoolInfo",AmmV5SwapBaseIn:"AmmV5SwapBaseIn",AmmV5SwapBaseOut:"AmmV5SwapBaseOut",RouteSwap:"RouteSwap",RouteSwap1:"RouteSwap1",RouteSwap2:"RouteSwap2",FarmV3Deposit:"FarmV3Deposit",FarmV3Withdraw:"FarmV3Withdraw",FarmV3CreateLedger:"FarmV3CreateLedger",FarmV4Withdraw:"FarmV4Withdraw",FarmV5Deposit:"FarmV5Deposit",FarmV5Withdraw:"FarmV5Withdraw",FarmV5CreateLedger:"FarmV5CreateLedger",FarmV6Deposit:"FarmV6Deposit",FarmV6Withdraw:"FarmV6Withdraw",FarmV6Create:"FarmV6Create",FarmV6Restart:"FarmV6Restart",FarmV6CreatorAddReward:"FarmV6CreatorAddReward",FarmV6CreatorWithdraw:"FarmV6CreatorWithdraw",CpmmCreatePool:"CpmmCreatePool",CpmmAddLiquidity:"CpmmAddLiquidity",CpmmWithdrawLiquidity:"CpmmWithdrawLiquidity",CpmmSwapBaseIn:"CpmmSwapBaseIn",CpmmSwapBaseOut:"CpmmSwapBaseOut",CpmmLockLp:"CpmmLockLp",CpmmCollectLockFee:"CpmmCollectLockFee",TransferTip:"TransferTip"};var rt=require("@solana/spl-token");var nt=_("Sega_txUtil"),it=1644;function xe(n){let e=[],t=[];return n.microLamports&&(e.push(E.ComputeBudgetProgram.setComputeUnitPrice({microLamports:n.microLamports})),t.push(ce.SetComputeUnitPrice)),n.units&&(e.push(E.ComputeBudgetProgram.setComputeUnitLimit({units:n.units})),t.push(ce.SetComputeUnitLimit)),{instructions:e,instructionTypes:t}}function ee(n,e){return b(this,null,function*(){var r,m;let t=e!=null?e:"confirmed";return(m=yield(r=n.getLatestBlockhash)==null?void 0:r.call(n,{commitment:t}))==null?void 0:m.blockhash})}function we(n,e){return b(this,null,function*(){return n.getSignatureStatuses([e]),new Promise((t,r)=>{let m=setTimeout(r,6e4);n.onSignature(e,c=>{if(clearTimeout(m),!c.err){t("");return}r(Object.assign(c.err,{txId:e}))},"confirmed")})})}function Rt(n,e){n.length<1&&nt.logWithError(`no instructions provided: ${n.toString()}`),e.length<1&&nt.logWithError(`no signers provided:, ${e.toString()}`);let t=new E.Transaction;t.recentBlockhash="11111111111111111111111111111111",t.feePayer=e[0],t.add(...n);try{return Buffer.from(t.serialize({verifySignatures:!1})).toString("base64").length<it}catch(r){return!1}}function ue({instructions:n,payer:e,signers:t}){return Rt(n,[e,...t])}function le({instructions:n,payer:e,lookupTableAddressAccount:t,recentBlockhash:r=E.Keypair.generate().publicKey.toString()}){let c=new E.TransactionMessage({payerKey:e,recentBlockhash:r,instructions:n}).compileToV0Message(Object.values(t!=null?t:{}));try{return Buffer.from(new E.VersionedTransaction(c).serialize()).toString("base64").length<it}catch(p){return!1}}var Lt=n=>Buffer.isBuffer(n)?n:n instanceof Uint8Array?Buffer.from(n.buffer,n.byteOffset,n.byteLength):Buffer.from(n),Nt=n=>{let e=n.serialize({requireAllSignatures:!1,verifySignatures:!1});n instanceof E.VersionedTransaction&&(e=Lt(e));try{return e instanceof Buffer?e.toString("base64"):Buffer.from(e).toString("base64")}catch(t){return e.toString("base64")}};function X(n){let e=[];return n.forEach(t=>{t instanceof E.Transaction&&(t.recentBlockhash||(t.recentBlockhash=rt.TOKEN_PROGRAM_ID.toBase58()),t.feePayer||(t.feePayer=E.Keypair.generate().publicKey)),e.push(Nt(t))}),console.log("simulate tx string:",e),e}var W=require("@solana/web3.js"),$r=new W.PublicKey("SegazTQwbYWknDZkJ6j2Kgvm5gw3MrHGKtWstZdoNKZ"),Qr=new W.PublicKey("Ajk8d9bERSaFdeoT1d8JUVfaDayrYLnAdgeB47TFMUaG"),ei=new W.PublicKey("2HbjxVVKJ7Ct72Rcd8WK4VTqmwTXL5aAggkH1CHGFGmh"),Ot=new W.PublicKey("TegaRdjn9Qeh9DfUU28X19aPPpJtj9gs8ntSYrR5H4K "),Et=new W.PublicKey("GzqQwxPSmUZnTyCfX9YWqi32MJg43ujP786ZoacL559Y"),_t=new W.PublicKey("GzqQwxPSmUZnTyCfX9YWqi32MJg43ujP786ZoacL559Y"),ti=new W.PublicKey("SegaXNnoXYTZiqUt9Xn2XqGcL56b25yzXLuJSpadcMu"),ni=new W.PublicKey("2t1hV2YqnDCPuJZqr7Fy8oAygGwZE5Q9uaQzpLC1QryJ"),ri=new W.PublicKey("BLxynZeHE123MmQgNJZiV1pwW4VYh46oZYyC66xwmtTY");var Vt={SERUM_MARKET:W.PublicKey.default,UTIL1216:W.PublicKey.default,CREATE_CPMM_POOL_PROGRAM:Ot,CREATE_CPMM_POOL_AUTH:Et,CREATE_CPMM_POOL_FEE_ACC:_t};var Kt=v(require("bn.js"));var vt=require("@solana/web3.js");var Pe=require("@solana/spl-token");var Oe=_("Sega_accountInfo_util");function st(n,e,t){return b(this,null,function*(){let{batchRequest:r,commitment:m="confirmed",chunkCount:c=100}=D({batchRequest:!1},t),p=De(e,c),o=new Array(p.length).fill([]);if(r){let T=p.map(P=>({methodName:"getMultipleAccounts",args:n._buildArgs([P.map(w=>w.toBase58())],m,"base64")})),i=De(T,10);o=(yield(yield Promise.all(i.map(P=>b(this,null,function*(){return yield n._rpcBatchRequest(P)})))).flat()).map(P=>(P.error&&Oe.logWithError(`failed to get info for multiple accounts, RPC_ERROR, ${P.error.message}`),P.result.value.map(I=>{if(I){let{data:w,executable:f,lamports:y,owner:s,rentEpoch:S}=I;return w.length!==2&&w[1]!=="base64"&&Oe.logWithError("info must be base64 encoded, RPC_ERROR"),{data:Buffer.from(w[0],"base64"),executable:f,lamports:y,owner:new ot.PublicKey(s),rentEpoch:S}}return null})))}else try{o=yield Promise.all(p.map(T=>n.getMultipleAccountsInfo(T,m)))}catch(T){T instanceof Error&&Oe.logWithError(`failed to get info for multiple accounts, RPC_ERROR, ${T.message}`)}return o.flat()})}function Ee(t){return b(this,arguments,function*({connection:n,address:e}){let r=yield st(n,[...new Set(e.map(c=>c.toString()))].map(c=>new me.PublicKey(c))),m={};for(let c=0;c<e.length;c++){let p=r[c],o=e[c];if(!p)continue;let T=new me.AddressLookupTableAccount({key:o,state:me.AddressLookupTableAccount.deserialize(p.data)});m[o.toString()]=T,Se[o.toString()]=T}return m})}var Se={};var Ae=2e3,ke=class{constructor(e){this.instructions=[];this.endInstructions=[];this.lookupTableAddress=[];this.signers=[];this.instructionTypes=[];this.endInstructionTypes=[];this.connection=e.connection,this.feePayer=e.feePayer,this.signAllTransactions=e.signAllTransactions,this.owner=e.owner,this.cluster=e.cluster,this.blockhashCommitment=e.blockhashCommitment,this.loopMultiTxStatus=!!e.loopMultiTxStatus}get AllTxData(){return{instructions:this.instructions,endInstructions:this.endInstructions,signers:this.signers,instructionTypes:this.instructionTypes,endInstructionTypes:this.endInstructionTypes,lookupTableAddress:this.lookupTableAddress}}get allInstructions(){return[...this.instructions,...this.endInstructions]}getComputeBudgetConfig(){return b(this,null,function*(){var r;let e=(yield at.default.get("https://solanacompass.com/api/fees?cacheFreshTime=300000")).data,{avg:t}=(r=e==null?void 0:e[15])!=null?r:{};if(t)return{units:6e5,microLamports:Math.min(Math.ceil(t*1e6/6e5),25e3)}})}addCustomComputeBudget(e){if(e){let{instructions:t,instructionTypes:r}=xe(e);return this.instructions.unshift(...t),this.instructionTypes.unshift(...r),!0}return!1}addTipInstruction(e){var t;return e?(this.endInstructions.push(C.SystemProgram.transfer({fromPubkey:(t=e.feePayer)!=null?t:this.feePayer,toPubkey:new C.PublicKey(e.address),lamports:BigInt(e.amount.toString())})),this.endInstructionTypes.push(ce.TransferTip),!0):!1}calComputeBudget(r){return b(this,arguments,function*({config:e,defaultIns:t}){try{let m=e||(yield this.getComputeBudgetConfig());if(this.addCustomComputeBudget(m))return;t&&this.instructions.unshift(...t)}catch(m){t&&this.instructions.unshift(...t)}})}addInstruction({instructions:e=[],endInstructions:t=[],signers:r=[],instructionTypes:m=[],endInstructionTypes:c=[],lookupTableAddress:p=[]}){return this.instructions.push(...e),this.endInstructions.push(...t),this.signers.push(...r),this.instructionTypes.push(...m),this.endInstructionTypes.push(...c),this.lookupTableAddress.push(...p.filter(o=>o!==C.PublicKey.default.toString())),this}versionBuild(r){return b(this,arguments,function*({txVersion:e,extInfo:t}){return e===0?yield this.buildV0(D({},t||{})):this.build(t)})}build(e){var r;let t=new C.Transaction;return this.allInstructions.length&&t.add(...this.allInstructions),t.feePayer=this.feePayer,(r=this.owner)!=null&&r.signer&&!this.signers.some(m=>m.publicKey.equals(this.owner.publicKey))&&this.signers.push(this.owner.signer),{builder:this,transaction:t,signers:this.signers,instructionTypes:[...this.instructionTypes,...this.endInstructionTypes],execute:m=>b(this,null,function*(){var i;let{recentBlockHash:c,skipPreflight:p=!0,sendAndConfirm:o}=m||{},T=c!=null?c:yield ee(this.connection,this.blockhashCommitment);if(t.recentBlockhash=T,this.signers.length&&t.sign(...this.signers),X([t]),(i=this.owner)!=null&&i.isKeyPair)return{txId:o?yield(0,C.sendAndConfirmTransaction)(this.connection,t,this.signers.find(P=>P.publicKey.equals(this.owner.publicKey))?this.signers:[...this.signers,this.owner.signer],{skipPreflight:p}):yield this.connection.sendRawTransaction(t.serialize(),{skipPreflight:p}),signedTx:t};if(this.signAllTransactions){let d=yield this.signAllTransactions([t]);if(this.signers.length)for(let P of d)try{P.sign(...this.signers)}catch(I){}return{txId:yield this.connection.sendRawTransaction(d[0].serialize(),{skipPreflight:p}),signedTx:d[0]}}throw new Error("please provide owner in keypair format or signAllTransactions function")}),extInfo:e||{}}}buildMultiTx(e){var i;let{extraPreBuildData:t=[],extInfo:r}=e,{transaction:m}=this.build(r),c=t.filter(d=>d.transaction.instructions.length>0),p=[m,...c.map(d=>d.transaction)],o=[this.signers,...c.map(d=>d.signers)],T=[...this.instructionTypes,...c.map(d=>d.instructionTypes).flat()];return(i=this.owner)!=null&&i.signer&&o.forEach(d=>{d.some(P=>P.publicKey.equals(this.owner.publicKey))||this.signers.push(this.owner.signer)}),{builder:this,transactions:p,signers:o,instructionTypes:T,execute:d=>b(this,null,function*(){var S;let{sequentially:P,onTxUpdate:I,skipTxCount:w=0,recentBlockHash:f,skipPreflight:y=!0}=d||{},s=f!=null?f:yield ee(this.connection,this.blockhashCommitment);if((S=this.owner)!=null&&S.isKeyPair){if(P){let g=[],A=0;for(let l of p){if(++A,A<=w)continue;let u=yield(0,C.sendAndConfirmTransaction)(this.connection,l,this.signers.find(a=>a.publicKey.equals(this.owner.publicKey))?this.signers:[...this.signers,this.owner.signer],{skipPreflight:y});g.push(u)}return{txIds:g,signedTxs:p}}return{txIds:yield yield Promise.all(p.map(g=>b(this,null,function*(){return g.recentBlockhash=s,yield this.connection.sendRawTransaction(g.serialize(),{skipPreflight:y})}))),signedTxs:p}}if(this.signAllTransactions){let g=p.map((l,u)=>(l.recentBlockhash=s,o[u].length&&l.sign(...o[u]),l));X(g);let A=yield this.signAllTransactions(g);if(P){let l=0,u=[],a=()=>b(this,null,function*(){if(!A[l])return;let x=yield this.connection.sendRawTransaction(A[l].serialize(),{skipPreflight:y});u.push({txId:x,status:"sent",signedTx:A[l]}),I==null||I([...u]),l++;let h=!1,k=null,R=null,N=B=>{k!==null&&clearInterval(k),R!==null&&this.connection.removeSignatureListener(R);let L=u.findIndex(F=>F.txId===x);if(L>-1){if(u[L].status==="error"||u[L].status==="success")return;u[L].status=B.err?"error":"success"}I==null||I([...u]),B.err||a()};this.loopMultiTxStatus&&(k=setInterval(()=>b(this,null,function*(){var B;if(h){clearInterval(k);return}try{let L=yield this.connection.getTransaction(x,{commitment:"confirmed",maxSupportedTransactionVersion:0});L&&(h=!0,clearInterval(k),N({err:((B=L.meta)==null?void 0:B.err)||null}),console.log("tx status from getTransaction:",x))}catch(L){h=!0,clearInterval(k),console.error("getTransaction timeout:",L,x)}}),Ae)),R=this.connection.onSignature(x,B=>{if(h){this.connection.removeSignatureListener(R);return}h=!0,N(B)},"confirmed"),this.connection.getSignatureStatus(x)});return yield a(),{txIds:u.map(x=>x.txId),signedTxs:A}}else{let l=[];for(let u=0;u<A.length;u+=1){let a=yield this.connection.sendRawTransaction(A[u].serialize(),{skipPreflight:y});l.push(a)}return{txIds:l,signedTxs:A}}}throw new Error("please provide owner in keypair format or signAllTransactions function")}),extInfo:r||{}}}versionMultiBuild(m){return b(this,arguments,function*({extraPreBuildData:e,txVersion:t,extInfo:r}){return t===0?yield this.buildV0MultiTx({extraPreBuildData:e,buildProps:r||{}}):this.buildMultiTx({extraPreBuildData:e,extInfo:r})})}buildV0(e){return b(this,null,function*(){var y;let f=e||{},{lookupTableCache:t={},lookupTableAddress:r=[],forerunCreate:m,recentBlockhash:c}=f,p=ge(f,["lookupTableCache","lookupTableAddress","forerunCreate","recentBlockhash"]),o=D(D({},this.cluster==="devnet"?{}:Se),t),T=Array.from(new Set([...r,...this.lookupTableAddress])),i=[];for(let s of T)o[s]===void 0&&i.push(new C.PublicKey(s));let d=yield Ee({connection:this.connection,address:i});for(let[s,S]of Object.entries(d))o[s]=S;let P=m?C.PublicKey.default.toBase58():c!=null?c:yield ee(this.connection,this.blockhashCommitment),I=new C.TransactionMessage({payerKey:this.feePayer,recentBlockhash:P,instructions:[...this.allInstructions]}).compileToV0Message(Object.values(o));(y=this.owner)!=null&&y.signer&&!this.signers.some(s=>s.publicKey.equals(this.owner.publicKey))&&this.signers.push(this.owner.signer);let w=new C.VersionedTransaction(I);return w.sign(this.signers),{builder:this,transaction:w,signers:this.signers,instructionTypes:[...this.instructionTypes,...this.endInstructionTypes],execute:s=>b(this,null,function*(){var A;let{skipPreflight:S=!0,sendAndConfirm:g}=s||{};if(X([w]),(A=this.owner)!=null&&A.isKeyPair){let l=yield this.connection.sendTransaction(w,{skipPreflight:S});return g&&(yield we(this.connection,l)),{txId:l,signedTx:w}}if(this.signAllTransactions){let l=yield this.signAllTransactions([w]);if(this.signers.length)for(let u of l)try{u.sign(this.signers)}catch(a){}return{txId:yield this.connection.sendTransaction(l[0],{skipPreflight:S}),signedTx:l[0]}}throw new Error("please provide owner in keypair format or signAllTransactions function")}),extInfo:p||{}}})}buildV0MultiTx(e){return b(this,null,function*(){var i;let{extraPreBuildData:t=[],buildProps:r}=e,{transaction:m}=yield this.buildV0(r),c=t.filter(d=>d.builder.instructions.length>0),p=[m,...c.map(d=>d.transaction)],o=[this.signers,...c.map(d=>d.signers)],T=[...this.instructionTypes,...c.map(d=>d.instructionTypes).flat()];return(i=this.owner)!=null&&i.signer&&o.forEach(d=>{d.some(P=>P.publicKey.equals(this.owner.publicKey))||this.signers.push(this.owner.signer)}),p.forEach((d,P)=>b(this,null,function*(){d.sign(o[P])})),{builder:this,transactions:p,signers:o,instructionTypes:T,buildProps:r,execute:d=>b(this,null,function*(){var y;let{sequentially:P,onTxUpdate:I,recentBlockHash:w,skipPreflight:f=!0}=d||{};if(w&&p.forEach(s=>s.message.recentBlockhash=w),X(p),(y=this.owner)!=null&&y.isKeyPair){if(P){let s=[];for(let S of p){let g=yield this.connection.sendTransaction(S,{skipPreflight:f});yield we(this.connection,g),s.push(g)}return{txIds:s,signedTxs:p}}return{txIds:yield Promise.all(p.map(s=>b(this,null,function*(){return yield this.connection.sendTransaction(s,{skipPreflight:f})}))),signedTxs:p}}if(this.signAllTransactions){let s=yield this.signAllTransactions(p);if(P){let S=0,g=[],A=()=>b(this,null,function*(){if(!s[S])return;let l=yield this.connection.sendTransaction(s[S],{skipPreflight:f});g.push({txId:l,status:"sent",signedTx:s[S]}),I==null||I([...g]),S++;let u=!1,a=null,x=null,h=k=>{a!==null&&clearInterval(a),x!==null&&this.connection.removeSignatureListener(x);let R=g.findIndex(N=>N.txId===l);if(R>-1){if(g[R].status==="error"||g[R].status==="success")return;g[R].status=k.err?"error":"success"}I==null||I([...g]),k.err||A()};this.loopMultiTxStatus&&(a=setInterval(()=>b(this,null,function*(){var k;if(u){clearInterval(a);return}try{let R=yield this.connection.getTransaction(l,{commitment:"confirmed",maxSupportedTransactionVersion:0});R&&(u=!0,clearInterval(a),h({err:((k=R.meta)==null?void 0:k.err)||null}),console.log("tx status from getTransaction:",l))}catch(R){u=!0,clearInterval(a),console.error("getTransaction timeout:",R,l)}}),Ae)),x=this.connection.onSignature(l,k=>{if(u){this.connection.removeSignatureListener(x);return}u=!0,h(k)},"confirmed"),this.connection.getSignatureStatus(l)});return A(),{txIds:[],signedTxs:s}}else{let S=[];for(let g=0;g<s.length;g+=1){let A=yield this.connection.sendTransaction(s[g],{skipPreflight:f});S.push(A)}return{txIds:S,signedTxs:s}}}throw new Error("please provide owner in keypair format or signAllTransactions function")}),extInfo:r||{}}})}sizeCheckBuild(e){return b(this,null,function*(){var I;let P=e||{},{splitIns:t=[],computeBudgetConfig:r}=P,m=ge(P,["splitIns","computeBudgetConfig"]),c=r?xe(r):{instructions:[],instructionTypes:[]},p=this.signers.reduce((w,f)=>K(D({},w),{[f.publicKey.toBase58()]:f}),{}),o=[],T=[],i=[],d=0;if(this.allInstructions.forEach(w=>{let f=[...i,w],y=r?[...c.instructions,...f]:f,S=[...new Set(f.map(g=>g.keys.filter(A=>A.isSigner).map(A=>A.pubkey.toString())).flat()).values()].map(g=>new C.PublicKey(g));if(w!==t[d]&&i.length<12&&(ue({instructions:y,payer:this.feePayer,signers:S})||ue({instructions:f,payer:this.feePayer,signers:S})))i.push(w);else{if(i.length===0)throw Error("item ins too big");d+=w===t[d]?1:0,ue({instructions:r?[...c.instructions,...i]:[...i],payer:this.feePayer,signers:S})?o.push(new C.Transaction().add(...c.instructions,...i)):o.push(new C.Transaction().add(...i)),T.push(Array.from(new Set(i.map(g=>g.keys.filter(A=>A.isSigner).map(A=>A.pubkey.toString())).flat())).map(g=>p[g]).filter(g=>g!==void 0)),i=[w]}}),i.length>0){let f=[...new Set(i.map(y=>y.keys.filter(s=>s.isSigner).map(s=>s.pubkey.toString())).flat()).values()].map(y=>p[y]).filter(y=>y!==void 0);ue({instructions:r?[...c.instructions,...i]:[...i],payer:this.feePayer,signers:f.map(y=>y.publicKey)})?o.push(new C.Transaction().add(...c.instructions,...i)):o.push(new C.Transaction().add(...i)),T.push(f)}return o.forEach(w=>w.feePayer=this.feePayer),(I=this.owner)!=null&&I.signer&&T.forEach(w=>{w.some(f=>f.publicKey.equals(this.owner.publicKey))||w.push(this.owner.signer)}),{builder:this,transactions:o,signers:T,instructionTypes:this.instructionTypes,execute:w=>b(this,null,function*(){var l;let{sequentially:f,onTxUpdate:y,skipTxCount:s=0,recentBlockHash:S,skipPreflight:g=!0}=w||{},A=S!=null?S:yield ee(this.connection,this.blockhashCommitment);if(o.forEach((u,a)=>b(this,null,function*(){u.recentBlockhash=A,T[a].length&&u.sign(...T[a])})),X(o),(l=this.owner)!=null&&l.isKeyPair){if(f){let u=0,a=[];for(let x of o){if(++u,u<=s){a.push("tx skipped");continue}let h=yield(0,C.sendAndConfirmTransaction)(this.connection,x,this.signers.find(k=>k.publicKey.equals(this.owner.publicKey))?this.signers:[...this.signers,this.owner.signer],{skipPreflight:g});a.push(h)}return{txIds:a,signedTxs:o}}return{txIds:yield Promise.all(o.map(u=>b(this,null,function*(){return yield this.connection.sendRawTransaction(u.serialize(),{skipPreflight:g})}))),signedTxs:o}}if(this.signAllTransactions){let u=yield this.signAllTransactions(o.slice(s,o.length)),a=[...o.slice(0,s),...u];if(f){let x=0,h=[],k=()=>b(this,null,function*(){if(!a[x])return;x<s&&(h.push({txId:"",status:"success",signedTx:a[x]}),y==null||y([...h]),x++,k());let R=yield this.connection.sendRawTransaction(a[x].serialize(),{skipPreflight:g});h.push({txId:R,status:"sent",signedTx:a[x]}),y==null||y([...h]),x++;let N=!1,B=null,L=null,F=V=>{B!==null&&clearInterval(B),L!==null&&this.connection.removeSignatureListener(L);let O=h.findIndex(z=>z.txId===R);if(O>-1){if(h[O].status==="error"||h[O].status==="success")return;h[O].status=V.err?"error":"success"}y==null||y([...h]),V.err||k()};this.loopMultiTxStatus&&(B=setInterval(()=>b(this,null,function*(){var V;if(N){clearInterval(B);return}try{let O=yield this.connection.getTransaction(R,{commitment:"confirmed",maxSupportedTransactionVersion:0});O&&(N=!0,clearInterval(B),F({err:((V=O.meta)==null?void 0:V.err)||null}),console.log("tx status from getTransaction:",R))}catch(O){N=!0,clearInterval(B),console.error("getTransaction timeout:",O,R)}}),Ae)),L=this.connection.onSignature(R,V=>{if(N){this.connection.removeSignatureListener(L);return}N=!0,F(V)},"confirmed"),this.connection.getSignatureStatus(R)});return yield k(),{txIds:h.map(R=>R.txId),signedTxs:a}}else{let x=[];for(let h=0;h<a.length;h+=1){let k=yield this.connection.sendRawTransaction(a[h].serialize(),{skipPreflight:g});x.push(k)}return{txIds:x,signedTxs:a}}}throw new Error("please provide owner in keypair format or signAllTransactions function")}),extInfo:m||{}}})}sizeCheckBuildV0(e){return b(this,null,function*(){var A;let g=e||{},{computeBudgetConfig:t,splitIns:r=[],lookupTableCache:m={},lookupTableAddress:c=[]}=g,p=ge(g,["computeBudgetConfig","splitIns","lookupTableCache","lookupTableAddress"]),o=D(D({},this.cluster==="devnet"?{}:Se),m),T=Array.from(new Set([...this.lookupTableAddress,...c])),i=[];for(let l of T)o[l]===void 0&&i.push(new C.PublicKey(l));let d=yield Ee({connection:this.connection,address:i});for(let[l,u]of Object.entries(d))o[l]=u;let P=t?xe(t):{instructions:[],instructionTypes:[]},I=yield ee(this.connection,this.blockhashCommitment),w=this.signers.reduce((l,u)=>K(D({},l),{[u.publicKey.toBase58()]:u}),{}),f=[],y=[],s=[],S=0;if(this.allInstructions.forEach(l=>{let u=[...s,l],a=t?[...P.instructions,...u]:u;if(l!==r[S]&&s.length<12&&(le({instructions:a,payer:this.feePayer,lookupTableAddressAccount:o})||le({instructions:u,payer:this.feePayer,lookupTableAddressAccount:o})))s.push(l);else{if(s.length===0)throw Error("item ins too big");S+=l===r[S]?1:0;let x={};for(let h of[...new Set(T)])o[h]!==void 0&&(x[h]=o[h]);if(t&&le({instructions:[...P.instructions,...s],payer:this.feePayer,lookupTableAddressAccount:o,recentBlockhash:I})){let h=new C.TransactionMessage({payerKey:this.feePayer,recentBlockhash:I,instructions:[...P.instructions,...s]}).compileToV0Message(Object.values(o));f.push(new C.VersionedTransaction(h))}else{let h=new C.TransactionMessage({payerKey:this.feePayer,recentBlockhash:I,instructions:[...s]}).compileToV0Message(Object.values(o));f.push(new C.VersionedTransaction(h))}y.push(Array.from(new Set(s.map(h=>h.keys.filter(k=>k.isSigner).map(k=>k.pubkey.toString())).flat())).map(h=>w[h]).filter(h=>h!==void 0)),s=[l]}}),s.length>0){let u=[...new Set(s.map(a=>a.keys.filter(x=>x.isSigner).map(x=>x.pubkey.toString())).flat()).values()].map(a=>w[a]).filter(a=>a!==void 0);if(t&&le({instructions:[...P.instructions,...s],payer:this.feePayer,lookupTableAddressAccount:o,recentBlockhash:I})){let a=new C.TransactionMessage({payerKey:this.feePayer,recentBlockhash:I,instructions:[...P.instructions,...s]}).compileToV0Message(Object.values(o));f.push(new C.VersionedTransaction(a))}else{let a=new C.TransactionMessage({payerKey:this.feePayer,recentBlockhash:I,instructions:[...s]}).compileToV0Message(Object.values(o));f.push(new C.VersionedTransaction(a))}y.push(u)}return(A=this.owner)!=null&&A.signer&&y.forEach(l=>{l.some(u=>u.publicKey.equals(this.owner.publicKey))||l.push(this.owner.signer)}),{builder:this,transactions:f,buildProps:e,signers:y,instructionTypes:this.instructionTypes,execute:l=>b(this,null,function*(){var R;let{sequentially:u,onTxUpdate:a,skipTxCount:x=0,recentBlockHash:h,skipPreflight:k=!0}=l||{};if(f.map((N,B)=>b(this,null,function*(){y[B].length&&N.sign(y[B]),h&&(N.message.recentBlockhash=h)})),X(f),(R=this.owner)!=null&&R.isKeyPair){if(u){let N=0,B=[];for(let L of f){if(++N,N<=x){console.log("skip tx: ",N),B.push("tx skipped");continue}let F=yield this.connection.sendTransaction(L,{skipPreflight:k});yield we(this.connection,F),B.push(F)}return{txIds:B,signedTxs:f}}return{txIds:yield Promise.all(f.map(N=>b(this,null,function*(){return yield this.connection.sendTransaction(N,{skipPreflight:k})}))),signedTxs:f}}if(this.signAllTransactions){let N=yield this.signAllTransactions(f.slice(x,f.length)),B=[...f.slice(0,x),...N];if(u){let L=0,F=[],V=()=>b(this,null,function*(){if(!B[L])return;if(L<x){F.push({txId:"",status:"success",signedTx:B[L]}),a==null||a([...F]),L++,V();return}let O=yield this.connection.sendTransaction(B[L],{skipPreflight:k});F.push({txId:O,status:"sent",signedTx:B[L]}),a==null||a([...F]),L++;let z=!1,$=null,de=null,Ve=Y=>{$!==null&&clearInterval($),de!==null&&this.connection.removeSignatureListener(de);let G=F.findIndex(ut=>ut.txId===O);if(G>-1){if(F[G].status==="error"||F[G].status==="success")return;F[G].status=Y.err?"error":"success"}a==null||a([...F]),Y.err||V()};this.loopMultiTxStatus&&($=setInterval(()=>b(this,null,function*(){var Y;if(z){clearInterval($);return}try{let G=yield this.connection.getTransaction(O,{commitment:"confirmed",maxSupportedTransactionVersion:0});G&&(z=!0,clearInterval($),Ve({err:((Y=G.meta)==null?void 0:Y.err)||null}),console.log("tx status from getTransaction:",O))}catch(G){z=!0,clearInterval($),console.error("getTransaction timeout:",G,O)}}),Ae)),de=this.connection.onSignature(O,Y=>{if(z){this.connection.removeSignatureListener(de);return}z=!0,Ve(Y)},"confirmed"),this.connection.getSignatureStatus(O)});return V(),{txIds:[],signedTxs:B}}else{let L=[];for(let F=0;F<B.length;F+=1){let V=yield this.connection.sendTransaction(B[F],{skipPreflight:k});L.push(V)}return{txIds:L,signedTxs:B}}}throw new Error("please provide owner in keypair format or signAllTransactions function")}),extInfo:p||{}}})}};var _e=(...n)=>n.map(e=>{try{return typeof e=="object"?JSON.stringify(e):e}catch(t){return e}}).join(", "),pe=class{constructor({scope:e,moduleName:t}){this.disabled=!1;this.scope=e,this.logger=_(t)}createTxBuilder(e){return this.scope.checkOwner(),new ke({connection:this.scope.connection,feePayer:e||this.scope.ownerPubKey,cluster:this.scope.cluster,owner:this.scope.owner,blockhashCommitment:this.scope.blockhashCommitment,loopMultiTxStatus:this.scope.loopMultiTxStatus,api:this.scope.api,signAllTransactions:this.scope.signAllTransactions})}logDebug(...e){this.logger.debug(_e(e))}logInfo(...e){this.logger.info(_e(e))}logAndCreateError(...e){let t=_e(e);throw new Error(t)}checkDisabled(){(this.disabled||!this.scope)&&this.logAndCreateError("module not working")}};var Ce=class extends pe{constructor(t){super(t);this._tokenList=[];this._tokenMap=new Map;this._blackTokenMap=new Set;this._mintGroup={official:new Set,jup:new Set,extra:new Set};this._whiteMap=new Set;this._extraTokenList=[]}load(t){return b(this,null,function*(){this.checkDisabled();let{forceUpdate:r=!1,type:m="strict"}=t||{},{mintList:c,blacklist:p,whiteList:o}=yield this.scope.fetchV3TokenList(r),T=yield this.scope.fetchJupTokenList(r);this._tokenList=[],this._tokenMap=new Map,this._blackTokenMap=new Set(p),this._mintGroup={official:new Set,jup:new Set,extra:new Set},this._whiteMap=new Set(o),this._tokenMap.set(J.address,J),this._mintGroup.official.add(J.address),c.forEach(i=>{var d;this._blackTokenMap.has(i.address)||(this._tokenMap.set(i.address,K(D({},i),{type:"sega",priority:2,programId:(d=i.programId)!=null?d:i.tags.includes("token-2022")?U.TOKEN_2022_PROGRAM_ID.toBase58():U.TOKEN_PROGRAM_ID.toBase58()})),this._mintGroup.official.add(i.address))}),T.forEach(i=>{var d;this._blackTokenMap.has(i.address)||this._tokenMap.has(i.address)||(this._tokenMap.set(i.address,K(D({},i),{type:"jupiter",priority:1,programId:(d=i.programId)!=null?d:i.tags.includes("token-2022")?U.TOKEN_2022_PROGRAM_ID.toBase58():U.TOKEN_PROGRAM_ID.toBase58(),tags:i.freezeAuthority?[...i.tags||[],"hasFreeze"]:i.tags})),this._mintGroup.jup.add(i.address))}),this._extraTokenList.forEach(i=>{this._blackTokenMap.has(i.address)||this._tokenMap.has(i.address)||(this._tokenMap.set(i.address,K(D({},i),{type:"extra",priority:1,programId:i.programId||i.tags.includes("token-2022")?U.TOKEN_2022_PROGRAM_ID.toBase58():U.TOKEN_PROGRAM_ID.toBase58()})),this._mintGroup.extra.add(i.address))}),this._tokenList=Array.from(this._tokenMap).map(i=>i[1])})}get tokenList(){return this._tokenList}get tokenMap(){return this._tokenMap}get blackTokenMap(){return this._blackTokenMap}get mintGroup(){return this._mintGroup}get whiteListMap(){return this._whiteMap}getTokenInfo(t){return b(this,null,function*(){if(!t)throw new Error("please input mint");let r=t.toString(),m=this._tokenMap.get(r);if(m)return m;if(r.toLocaleUpperCase()==="SOL")return J;let c=(yield this.scope.api.getTokenInfo([r]))[0];if(c)return this._mintGroup.extra.add(r),this._tokenMap.set(r,K(D({},c),{priority:2})),c;let p=yield this.scope.connection.getAccountInfo(new ct.PublicKey(r));if(!p)throw new Error(`mint address not found: ${r}`);let o=U.MintLayout.decode(p.data),T=r.toString().substring(0,6),i={chainId:101,address:r,programId:p.owner.toBase58(),logoURI:"",symbol:T,name:T,decimals:o.decimals,tags:[],extensions:{},priority:0,type:"unknown"};return this._mintGroup.extra.add(r),this._tokenMap.set(r,i),i})}}; //# sourceMappingURL=token.js.map