mnee
Version:
A simple package for interacting with the MNEE USD
3 lines (2 loc) • 19.3 kB
JavaScript
import{Utils as t,LockingScript as e,OP as r,TransactionSignature as n,Hash as o,UnlockingScript as s,Transaction as i,PublicKey as a,Script as c,P2PKH as u,PrivateKey as d}from"@bsv/sdk";class f{lock(n,o){let s=[];if("string"==typeof n){const e=t.fromBase58Check(n);if(0!==e.prefix[0]&&111!==e.prefix[0])throw new Error("only P2PKH is supported");s=e.data}else s=n;const i=new e;return i.writeOpCode(r.OP_DUP).writeOpCode(r.OP_HASH160).writeBin(s).writeOpCode(r.OP_EQUALVERIFY).writeOpCode(r.OP_CHECKSIGVERIFY).writeBin(o.encode(!0)).writeOpCode(r.OP_CHECKSIG),i}userUnlock(t,e="all",r=!1,i,a){return{sign:async function(c,u){var d,f,p;let l=n.SIGHASH_FORKID;"all"===e&&(l|=n.SIGHASH_ALL),"none"===e&&(l|=n.SIGHASH_NONE),"single"===e&&(l|=n.SIGHASH_SINGLE),r&&(l|=n.SIGHASH_ANYONECANPAY);const h=c.inputs[u],m=c.inputs.filter((t,e)=>e!==u),g=h.sourceTXID?h.sourceTXID:null==(d=h.sourceTransaction)?void 0:d.id("hex");if(!g)throw new Error("The input sourceTXID or sourceTransaction is required for transaction signing.");if(i||(i=null==(f=h.sourceTransaction)?void 0:f.outputs[h.sourceOutputIndex].satoshis),!i)throw new Error("The sourceSatoshis or input sourceTransaction is required for transaction signing.");if(a||(a=null==(p=h.sourceTransaction)?void 0:p.outputs[h.sourceOutputIndex].lockingScript),!a)throw new Error("The lockingScript or input sourceTransaction is required for transaction signing.");const w=n.format({sourceTXID:g,sourceOutputIndex:h.sourceOutputIndex,sourceSatoshis:i,transactionVersion:c.version,otherInputs:m,inputIndex:u,outputs:c.outputs,inputSequence:h.sequence||4294967295,subscript:a,lockTime:c.lockTime,scope:l}),x=t.sign(o.sha256(w)),y=new n(x.r,x.s,l),v=new s;return v.writeBin(y.toChecksigFormat()),v.writeBin(t.toPublicKey().encode(!0)),v},estimateLength:async function(){return 182}}}unlock(t,e,r="all",i=!1,a,c){return{sign:async function(u,d){var f,p,l;let h=n.SIGHASH_FORKID;"all"===r&&(h|=n.SIGHASH_ALL),"none"===r&&(h|=n.SIGHASH_NONE),"single"===r&&(h|=n.SIGHASH_SINGLE),i&&(h|=n.SIGHASH_ANYONECANPAY);const m=u.inputs[d],g=u.inputs.filter((t,e)=>e!==d),w=m.sourceTXID?m.sourceTXID:null==(f=m.sourceTransaction)?void 0:f.id("hex");if(!w)throw new Error("The input sourceTXID or sourceTransaction is required for transaction signing.");if(a||(a=null==(p=m.sourceTransaction)?void 0:p.outputs[m.sourceOutputIndex].satoshis),!a)throw new Error("The sourceSatoshis or input sourceTransaction is required for transaction signing.");if(c||(c=null==(l=m.sourceTransaction)?void 0:l.outputs[m.sourceOutputIndex].lockingScript),!c)throw new Error("The lockingScript or input sourceTransaction is required for transaction signing.");const x=n.format({sourceTXID:w,sourceOutputIndex:m.sourceOutputIndex,sourceSatoshis:a,transactionVersion:u.version,otherInputs:g,inputIndex:d,outputs:u.outputs,inputSequence:m.sequence||4294967295,subscript:c,lockTime:u.lockTime,scope:h}),y=t.sign(o.sha256(x)),v=new n(y.r,y.s,h),T=new s;return T.writeBin(v.toChecksigFormat()),T.writeScript(e),T},estimateLength:async function(){return 182}}}}const p=t=>Buffer.from(t).toString("hex"),l=(t,r,n,o=!1)=>{let s="";if(void 0!==(null==r?void 0:r.dataB64)&&void 0!==(null==r?void 0:r.contentType)){const t=p("ord"),e=Buffer.from(r.dataB64,"base64").toString("hex").trim();if(!e)throw new Error("Invalid file data");const n=p(r.contentType);if(!n)throw new Error("Invalid media type");s=`OP_0 OP_IF ${t} OP_1 ${n} OP_0 ${e} OP_ENDIF`}let i=`${s?`${s} ${o?"OP_CODESEPARATOR ":""}`:""}${t.toASM()}`;if(n&&(!n.app||!n.type))throw new Error("MAP.app and MAP.type are required fields");if(null!=n&&n.app&&null!=n&&n.type){i=`${i?`${i} `:""}OP_RETURN ${p("1PuQa7K62MiKCtssSLKy1kh56WWU7MtUR5")} ${p("SET")}`;for(const[t,e]of Object.entries(n))"cmd"!==t&&(i=`${i} ${p(t)} ${p(e)}`)}return e.fromASM(i)},h=e=>{var n,s;let i;for(let n=0;n<e.chunks.length;n++){var a;const o=e.chunks[n];n>=2&&3===(null==(a=o.data)?void 0:a.length)&&"ord"==t.toUTF8(o.data)&&e.chunks[n-1].op==r.OP_IF&&e.chunks[n-2].op==r.OP_FALSE&&(i=n+1)}if(void 0===i)return;const c={file:{hash:"",size:0,type:""},fields:{}};for(let a=i;a<e.chunks.length;a+=2){var u,d;const i=e.chunks[a];if(i.op==r.OP_ENDIF)break;if(i.op>r.OP_16)return;const f=e.chunks[a+1];if(f.op>r.OP_PUSHDATA4)return;if(null!=(u=i.data)&&u.length)continue;let p=0;switch(i.op>r.OP_PUSHDATA4&&i.op<=r.OP_16?p=i.op-80:null!=(d=i.data)&&d.length&&(p=i.data[0]),p){case 0:if(c.file.size=(null==(n=f.data)?void 0:n.length)||0,null==(s=f.data)||!s.length)break;c.file.hash=t.toBase64(o.sha256(f.data)),c.file.content=f.data;break;case 1:c.file.type=Buffer.from(f.data||[]).toString()}}return c},m=e=>e.map(e=>{const n=e.chunks;for(let e=0;e<=n.length-4;e++){var o,s,i;if(n.length>e+6&&n[0+e].op===r.OP_DUP&&n[1+e].op===r.OP_HASH160&&20===(null==(o=n[2+e].data)?void 0:o.length)&&n[3+e].op===r.OP_EQUALVERIFY&&n[4+e].op===r.OP_CHECKSIGVERIFY&&33===(null==(s=n[5+e].data)?void 0:s.length)&&n[6+e].op===r.OP_CHECKSIG)return{cosigner:t.toHex(n[5+e].data||[]),address:t.toBase58Check(n[2+e].data||[],[0])};if(n[0+e].op===r.OP_DUP&&n[1+e].op===r.OP_HASH160&&20===(null==(i=n[2+e].data)?void 0:i.length)&&n[3+e].op===r.OP_EQUALVERIFY&&n[4+e].op===r.OP_CHECKSIG)return{cosigner:"",address:t.toBase58Check(n[2+e].data||[],[0])}}}),g=(e,r,n)=>{const o=e.senders.includes(r)?"send":"receive",s=e.height>0?"confirmed":"unconfirmed";if(!e.rawtx)return null;const a=t.toArray(e.rawtx,"base64"),c=t.toHex(a),u=i.fromHex(c).outputs.map(t=>t.lockingScript),d=m(u),f=u.map(h),p=d.map(t=>t.address),l=p.indexOf(n.feeAddress),g=e.senders[0];let w=0;const x=new Map;f.forEach((e,o)=>{var s;const i=null==e||null==(s=e.file)?void 0:s.content;if(!i)return;const a=t.toUTF8(i);if(!a)return;let c;try{c=JSON.parse(a)}catch(t){return void console.error("Failed to parse inscription JSON:",t)}if("bsv-20"!==c.p||c.id!==n.tokenId)return;const u=parseInt(c.amt,10);if(Number.isNaN(u))return;if(l===o&&g===r)return void(w+=u);const d=p[o],f=x.get(d)||0;x.set(d,f+u)});const y=x.get(r)||0;if("send"===o){const t=x.get(g)||0;x.set(g,t-y)}let v=[];v="receive"===o?[{address:g,amount:y}]:Array.from(x.entries()).map(([t,e])=>({address:t,amount:e})).filter(t=>t.address!==r&&t.address!==n.feeAddress&&t.amount>0);const T=v.reduce((t,e)=>t+e.amount,0);return{txid:e.txid,height:e.height,type:o,status:s,amount:T,fee:w,score:e.score,counterparties:v}},w="ae59f3b898ec61acbdb6cc7a245fabeded0c094bf046f35206a3aec60ef88127_0",x="020a177d6a5e6f3a8689acd2e313bd1cf0dcf5a243d1cc67b7218602aee9e04b2f",y="1inHbiwj2jrEcZPiSYnfgJ8FmS1Bmk4Dh",v="833a7720966a2a435db28d967385e8aa7284b6150ebb39482cc5228b73e1703f_0",T="55cde0733049a226fdb6abc387ee9dcd036e859f7cbc69ab90050c0435139f00_0",S="833a7720966a2a435db28d967385e8aa7284b6150ebb39482cc5228b73e1703f_0";class A{constructor(t){if(this.mneeApiKey=void 0,this.mneeConfig=void 0,this.mneeApi=void 0,"production"!==t.environment&&"sandbox"!==t.environment)throw new Error('Invalid environment. Must be either "production" or "sandbox"');const e="production"===t.environment;this.mneeApiKey=null!=t&&t.apiKey?t.apiKey:e?"92982ec1c0975f31979da515d46bae9f":"54f1fd1688ba66a58a67675b82feb93e",this.mneeApi=e?"https://proxy-api.mnee.net":"https://sandbox-proxy-api.mnee.net",this.getCosignerConfig()}async getCosignerConfig(){try{const t=await fetch(`${this.mneeApi}/v1/config?auth_token=${this.mneeApiKey}`,{method:"GET"});if(!t.ok)throw new Error(`HTTP error! status: ${t.status}`);const e=await t.json();return this.mneeConfig=e,e}catch(t){return void console.error("Failed to fetch config:",t)}}toAtomicAmount(t){if(!this.mneeConfig)throw new Error("Config not fetched");return Math.round(t*10**this.mneeConfig.decimals)}fromAtomicAmount(t){if(!this.mneeConfig)throw new Error("Config not fetched");return t/10**this.mneeConfig.decimals}async createInscription(t,e,r){const n={p:"bsv-20",op:"transfer",id:r.tokenId,amt:e.toString()};return{lockingScript:l((new f).lock(t,a.fromString(r.approver)),{dataB64:Buffer.from(JSON.stringify(n)).toString("base64"),contentType:"application/bsv-20"}),satoshis:1}}async getUtxos(t,e=["transfer","deploy+mint"]){try{const r=Array.isArray(t)?t:[t],n=await fetch(`${this.mneeApi}/v1/utxos?auth_token=${this.mneeApiKey}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)});if(!n.ok)throw new Error(`HTTP error! status: ${n.status}`);const o=await n.json();return e.length?o.filter(t=>e.includes(t.data.bsv21.op.toLowerCase())):o}catch(t){return console.error("Failed to fetch UTXOs:",t),[]}}async fetchRawTx(t){const e=await fetch(`${this.mneeApi}/v1/tx/${t}?auth_token=${this.mneeApiKey}`);if(404===e.status)throw new Error("Transaction not found");if(200!==e.status)throw new Error(`${e.status} - Failed to fetch rawtx for txid: ${t}`);const{rawtx:r}=await e.json();return i.fromHex(Buffer.from(r,"base64").toString("hex"))}async getSignatures(e,r){try{const s=65;let a;switch(e.format){case"beef":a=i.fromHexBEEF(e.rawtx);break;case"ef":a=i.fromHexEF(e.rawtx);break;default:a=i.fromHex(e.rawtx)}const d=e.sigRequests.flatMap(e=>[r].map(r=>{const i=n.format({sourceTXID:e.prevTxid,sourceOutputIndex:e.outputIndex,sourceSatoshis:e.satoshis,transactionVersion:a.version,otherInputs:a.inputs.filter((t,r)=>r!==e.inputIndex),inputIndex:e.inputIndex,outputs:a.outputs,inputSequence:a.inputs[e.inputIndex].sequence||0,subscript:e.script?c.fromHex(e.script):(new u).lock(r.toPublicKey().toAddress()),lockTime:a.lockTime,scope:e.sigHashType||s}),d=r.sign(o.sha256(i)),f=new n(d.r,d.s,e.sigHashType||s);return{sig:t.toHex(f.toChecksigFormat()),pubKey:r.toPublicKey().toString(),inputIndex:e.inputIndex,sigHashType:e.sigHashType||s,csIdx:e.csIdx}}));return Promise.resolve({sigResponses:d})}catch(t){var s;return console.error("getSignatures error",t),{error:{message:null!=(s=t.message)?s:"unknown",cause:t.cause}}}}async transfer(e,r){try{var o;const a=this.mneeConfig||await this.getCosignerConfig();if(!a)throw new Error("Config not fetched");const u=e.reduce((t,e)=>t+e.amount,0);if(u<=0)return{error:"Invalid amount"};const f=this.toAtomicAmount(u),p=d.fromWif(r),l=p.toAddress(),h=await this.getUtxos(l);if(h.reduce((t,e)=>t+(e.data.bsv21.amt||0),0)<f)return{error:"Insufficient MNEE balance"};const m=void 0!==e.find(t=>t.address===a.burnAddress)?0:null==(o=a.fees.find(t=>f>=t.min&&f<=t.max))?void 0:o.fee;if(void 0===m)return{error:"Fee ranges inadequate"};const g=new i(1,[],[],0);let w=0;const x=[];let y="";for(;w<f+m;){const t=h.shift();if(!t)return{error:"Insufficient MNEE balance"};const e=await this.fetchRawTx(t.txid);if(!e)return{error:"Failed to fetch source transaction"};x.push(t.owners[0]),y=y||t.owners[0],g.addInput({sourceTXID:t.txid,sourceOutputIndex:t.vout,sourceTransaction:e,unlockingScript:new s}),w+=t.data.bsv21.amt}for(const t of e)g.addOutput(await this.createInscription(t.address,this.toAtomicAmount(t.amount),a));m>0&&g.addOutput(await this.createInscription(a.feeAddress,m,a));const v=w-f-m;v>0&&g.addOutput(await this.createInscription(y,v,a));const T=g.inputs.map((t,e)=>{var r,o;if(!t.sourceTXID)throw new Error("Source TXID is undefined");return{prevTxid:t.sourceTXID,outputIndex:t.sourceOutputIndex,inputIndex:e,address:x[e],script:null==(r=t.sourceTransaction)?void 0:r.outputs[t.sourceOutputIndex].lockingScript.toHex(),satoshis:(null==(o=t.sourceTransaction)?void 0:o.outputs[t.sourceOutputIndex].satoshis)||1,sigHashType:n.SIGHASH_ALL|n.SIGHASH_ANYONECANPAY|n.SIGHASH_FORKID}}),S=g.toHex(),A=await this.getSignatures({rawtx:S,sigRequests:T},p);if(null==A||!A.sigResponses)return{error:"Failed to get signatures"};for(const e of A.sigResponses)g.inputs[e.inputIndex].unlockingScript=(new c).writeBin(t.toArray(e.sig,"hex")).writeBin(t.toArray(e.pubKey,"hex"));const I=t.toBase64(g.toBinary()),b=await fetch(`${this.mneeApi}/v1/transfer?auth_token=${this.mneeApiKey}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({rawtx:I})});if(!b.ok)throw new Error(`HTTP error! status: ${b.status}`);const{rawtx:E}=await b.json();if(!E)return{error:"Failed to broadcast transaction"};const C=t.toArray(E,"base64");return{txid:i.fromBinary(C).id("hex"),rawtx:t.toHex(C)}}catch(t){let e="Transaction submission failed";return t instanceof Error&&(e=t.message,t.message.includes("HTTP error")&&console.error("HTTP error details:",t)),console.error("Failed to transfer tokens:",e),{error:e}}}async getBalance(t){try{if(!this.mneeConfig&&!await this.getCosignerConfig())throw new Error("Config not fetched");const e=(await this.getUtxos(t)).reduce((t,e)=>("transfer"===e.data.bsv21.op&&(t+=e.data.bsv21.amt),t),0);return{address:t,amount:e,decimalAmount:this.fromAtomicAmount(e)}}catch(e){return console.error("Failed to fetch balance:",e),{address:t,amount:0,decimalAmount:0}}}async getBalances(t){try{if(!this.mneeConfig&&!await this.getCosignerConfig())throw new Error("Config not fetched");const e=await this.getUtxos(t);return t.map(t=>{const r=e.filter(e=>e.owners.includes(t)).reduce((t,e)=>("transfer"===e.data.bsv21.op&&(t+=e.data.bsv21.amt),t),0);return{address:t,amount:r,decimalAmount:this.fromAtomicAmount(r)}})}catch(e){return console.error("Failed to fetch balances:",e),t.map(t=>({address:t,amount:0,decimalAmount:0}))}}async validateMneeTx(e,r){try{const n=this.mneeConfig||await this.getCosignerConfig();if(!n)throw new Error("Config not fetched");const o=i.fromHex(e),s=o.outputs.map(t=>t.lockingScript),a=m(s);return r?r.forEach((e,r)=>{var s;const{address:i,amount:c}=e;if(!a.find(t=>(null==t?void 0:t.cosigner)===n.approver))throw new Error(`Cosigner not found for address: ${i} at index: ${r}`);if(!a.find(t=>(null==t?void 0:t.address)===i))throw new Error(`Address not found in script for address: ${i} at index: ${r}`);const u=h(o.outputs[r].lockingScript),d=null==u||null==(s=u.file)?void 0:s.content;if(!d)throw new Error("Invalid inscription content");const f=t.toUTF8(d);if(!f)throw new Error("Invalid inscription content");const p=JSON.parse(f);if("bsv-20"!==p.p)throw new Error(`Invalid bsv 20 protocol: ${p.p}`);if("transfer"!==p.op)throw new Error(`Invalid operation: ${p.op}`);if(p.id!==n.tokenId)throw new Error(`Invalid token id: ${p.id}`);if(p.amt!==this.toAtomicAmount(c).toString())throw new Error(`Invalid amount: ${p.amt}`)}):a.forEach(t=>{if(""!==(null==t?void 0:t.cosigner)&&(null==t?void 0:t.cosigner)!==n.approver)throw new Error("Invalid or missing cosigner")}),!0}catch(t){return console.error(t),!1}}async getMneeSyncs(t,e=0,r=100){try{const n=Array.isArray(t)?t:[t],o=await fetch(`${this.mneeApi}/v1/sync?auth_token=${this.mneeApiKey}&from=${e}&limit=${r}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)});if(!o.ok)throw new Error(`HTTP error! status: ${o.status}`);const s=await o.json();return n.map(t=>{const e=s.filter(e=>e.senders.includes(t)||e.receivers.includes(t));return{address:t,syncs:e}})}catch(e){return console.error("Failed to fetch syncs:",e),Array.isArray(t)?t.map(t=>({address:t,syncs:[]})):[{address:t,syncs:[]}]}}async getRecentTxHistory(t,e,r){try{const n=this.mneeConfig||await this.getCosignerConfig();if(!n)throw new Error("Config not fetched");const o=await this.getMneeSyncs(t,e,r),{syncs:s}=o[0];if(!s||0===s.length)return{address:t,history:[],nextScore:e||0};const i=[];for(const e of s){const r=g(e,t,n);r&&i.push(r)}const a=i.length>0?i[i.length-1].score:e||0;return r&&i.length>r?{address:t,history:i.slice(0,r),nextScore:a}:{address:t,history:i,nextScore:a}}catch(r){return console.error("Failed to fetch tx history:",r),{address:t,history:[],nextScore:e||0}}}async getRecentTxHistories(t){var e=this;try{const r=this.mneeConfig||await this.getCosignerConfig();if(!r)throw new Error("Config not fetched");const n={};t.forEach(t=>{const e=`${t.fromScore||0}:${t.limit||100}`;n[e]||(n[e]=[]),n[e].push(t)});const o=Object.entries(n).map(async function([t,n]){const[o,s]=t.split(":").map(Number),i=n.map(t=>t.address);return(await e.getMneeSyncs(i,o,s)).map(({address:t,syncs:e})=>{const o=n.find(e=>e.address===t);if(!e||0===e.length)return{address:t,history:[],nextScore:(null==o?void 0:o.fromScore)||0};const s=[];for(const n of e){const e=g(n,t,r);e&&s.push(e)}const i=s.length>0?s[s.length-1].score:(null==o?void 0:o.fromScore)||0,a=null==o?void 0:o.limit;return a&&s.length>a?{address:t,history:s.slice(0,a),nextScore:i}:{address:t,history:s,nextScore:i}})});return(await Promise.all(o)).flat()}catch(e){return console.error("Failed to fetch tx histories:",e),t.map(({address:t,fromScore:e})=>({address:t,history:[],nextScore:e||0}))}}async parseTransaction(e,r){const n=e.id("hex"),o=e.outputs.map(t=>t.lockingScript),s=e.inputs.map(t=>({txid:t.sourceTXID,vout:t.sourceOutputIndex}));let i=[],a=[],c=0n,u=0n,d="production",f="transfer";for(const e of s){var p;if(!e.txid)continue;const o=(await this.fetchRawTx(e.txid)).outputs[e.vout],s=m([o.lockingScript])[0];(null==s?void 0:s.address)===r.mintAddress&&(f=n===r.tokenId.split("_")[0]?"deploy":"mint");const a=h(o.lockingScript),u=null==a||null==(p=a.file)?void 0:p.content;if(!u)continue;const l=t.toUTF8(u);if(!l)continue;const g=JSON.parse(l);if(g){const t=s.address===y;g.id===w&&s.cosigner===x||(""===s.cosigner&&"deploy+mint"===g.op&&t?(d="production",f="mint"):d="sandbox"),"transfer"===f&&(t||"1A1QNEkLuvAALsmG4Me3iubP8zb5C6jpv5"===s.address||"1BW7cejD27vDLiHsbK1Hvf1y4JTKvC1Yue"===s.address||"1AZNdbFYBDFTAEgzZMfPzANxyNrpGJZAUY"===s.address)&&(f="mint"),c+=BigInt(g.amt),i.push({address:s.address,amount:parseInt(g.amt)})}}for(const e of o){var l;const r=m([e])[0],n=h(e),o=null==n||null==(l=n.file)?void 0:l.content;if(!o)continue;const s=t.toUTF8(o);if(!s)continue;const i=JSON.parse(s);i&&("burn"===i.op&&(f="burn"),"deploy+mint"===i.op&&(f="deploy"),i.id===w&&r.cosigner===x||(d=""===r.cosigner&&r.address===y?"production":"sandbox"),u+=BigInt(i.amt),a.push({address:r.address,amount:parseInt(i.amt)}))}if("deploy"!==f&&c!==u)throw new Error("Inputs and outputs are not equal");return n===w.split("_")[0]?d="production":[v,T,S].some(t=>n===t.split("_")[0])&&(d="sandbox"),{txid:n,environment:d,type:f,inputs:i,outputs:a}}async parseTx(t){const e=this.mneeConfig||await this.getCosignerConfig();if(!e)throw new Error("Config not fetched");const r=await this.fetchRawTx(t);if(!r)throw new Error("Failed to fetch transaction");return await this.parseTransaction(r,e)}async parseTxFromRawTx(t){const e=i.fromHex(t),r=this.mneeConfig||await this.getCosignerConfig();if(!r)throw new Error("Config not fetched");return await this.parseTransaction(e,r)}}class I{constructor(t){this.service=void 0,this.service=new A(t)}async validateMneeTx(t,e){return this.service.validateMneeTx(t,e)}toAtomicAmount(t){return this.service.toAtomicAmount(t)}fromAtomicAmount(t){return this.service.fromAtomicAmount(t)}async config(){return this.service.getCosignerConfig()}async balance(t){return this.service.getBalance(t)}async balances(t){return this.service.getBalances(t)}async transfer(t,e){return this.service.transfer(t,e)}async recentTxHistory(t,e,r){return this.service.getRecentTxHistory(t,e,r)}async recentTxHistories(t){return this.service.getRecentTxHistories(t)}async parseTx(t){return this.service.parseTx(t)}async parseTxFromRawTx(t){return this.service.parseTxFromRawTx(t)}}export{I as default};
//# sourceMappingURL=index.modern.js.map