Socket
Socket
Sign inDemoInstall

elven-tools

Package Overview
Dependencies
14
Maintainers
1
Versions
87
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.11.0 to 1.11.1

104

build/index.js
#!/usr/bin/env node
var Mo=Object.create;var we=Object.defineProperty;var Lo=Object.getOwnPropertyDescriptor;var Fo=Object.getOwnPropertyNames,De=Object.getOwnPropertySymbols,Do=Object.getPrototypeOf,Re=Object.prototype.hasOwnProperty,Oo=Object.prototype.propertyIsEnumerable;var Oe=(r,e,t)=>e in r?we(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,M=(r,e)=>{for(var t in e||(e={}))Re.call(e,t)&&Oe(r,t,e[t]);if(De)for(var t of De(e))Oo.call(e,t)&&Oe(r,t,e[t]);return r};var Ro=(r,e,t,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of Fo(e))!Re.call(r,a)&&a!==t&&we(r,a,{get:()=>e[a],enumerable:!(s=Lo(e,a))||s.enumerable});return r};var A=(r,e,t)=>(t=r!=null?Mo(Do(r)):{},Ro(e||!r||!r.__esModule?we(t,"default",{value:r,enumerable:!0}):t,r));var l=(r,e,t)=>new Promise((s,a)=>{var i=p=>{try{c(t.next(p))}catch(N){a(N)}},d=p=>{try{c(t.throw(p))}catch(N){a(N)}},c=p=>p.done?s(p.value):Promise.resolve(p.value).then(i,d);c((t=t.apply(r,e)).next())});var z=require("process");var pe=require("process"),so=require("fs"),oo=A(require("ora")),ao=A(require("prompts"));var _n=require("cosmiconfig"),Hn=require("process");var Co="elven-tools",Io={node:"^12.20.0 || ^14.13.1 || >=16.0.0"},Eo="build/types",jo="1.11.0",$o={smartContractVersionTagName:"v1.7.0",minterDappVersionTagName:"v2.2.1"},Bo="Interacting with custom NFT related Smart Contracts on the Elrond blockchain",Go="build/index.js",Qo={"elven-tools":"./build/index.js"},Uo={generate:"npm run build && node build/index.js",build:"rimraf build && node ./esbuild.config.js && tsc","dev:lint":"eslint src/** --fix","dev:prettier":"prettier --write 'src/**/*.{js,ts,json}'",prepublishOnly:"npm run build"},qo="Julian \u0106wirko <julian.io>",Ko="MIT",Yo="https://github.com/ElvenTools/elven-tools-cli",Vo={type:"git",url:"https://github.com/ElvenTools/elven-tools-cli"},Jo=["elrond","blockchain","sdk","javascript","nft","cli"],zo={"@types/cross-spawn":"^6.0.2","@types/download":"8.0.0","@types/ledgerhq__hw-transport":"^4.21.4","@types/node":"^16.11.12","@types/prompt":"^1.1.2","@types/prompts":"^2.0.14","@typescript-eslint/eslint-plugin":"^4.27.0","@typescript-eslint/parser":"^4.27.0",esbuild:"^0.14.2",eslint:"^7.29.0","eslint-config-prettier":"^8.3.0","eslint-plugin-prettier":"^3.4.0",prettier:"^2.5.1",rimraf:"^3.0.2",typescript:"^4.5.3"},Wo={"@elrondnetwork/erdjs":"10.2.5","@elrondnetwork/erdjs-network-providers":"^0.1.5","@elrondnetwork/erdjs-walletcore":"^1.0.0",axios:"^0.27.2","bignumber.js":"9.0.2",cosmiconfig:"^7.0.1","cross-fetch":"^3.1.5","cross-spawn":"7.0.3",download:"8.0.0",install:"^0.13.0",npm:"^8.10.0",ora:"5.4.1","p-throttle":"4.1.1",prompts:"^2.4.2"},_={name:Co,engines:Io,types:Eo,version:jo,elvenTools:$o,description:Bo,main:Go,bin:Qo,scripts:Uo,author:qo,license:Ko,homepage:Yo,repository:Vo,keywords:Jo,devDependencies:zo,dependencies:Wo};var _o="elventools",Ho=(0,_n.cosmiconfigSync)(_o),n=Ho.search((0,Hn.cwd)()),Ce,m=((Ce=n==null?void 0:n.config)==null?void 0:Ce.chain)||"devnet",Ie,Ee,Zn=(Ee=(Ie=n==null?void 0:n.config)==null?void 0:Ie.nftMinterSc)==null?void 0:Ee.deployNftMinterSC,je,$e,Xn=(($e=(je=n==null?void 0:n.config)==null?void 0:je.nftMinterSc)==null?void 0:$e.deployGasLimit)||12e7,Be,Ge,er=((Ge=(Be=n==null?void 0:n.config)==null?void 0:Be.nftMinterSc)==null?void 0:Ge.version)||_.elvenTools.smartContractVersionTagName,Qe,Ue,tr=((Ue=(Qe=n==null?void 0:n.config)==null?void 0:Qe.nftMinterSc)==null?void 0:Ue.issueCollectionTokenGasLimit)||8e7,qe,Ke,nr=((Ke=(qe=n==null?void 0:n.config)==null?void 0:qe.nftMinterSc)==null?void 0:Ke.issueValue)||.05,Ye,Ve,rr=((Ve=(Ye=n==null?void 0:n.config)==null?void 0:Ye.nftMinterSc)==null?void 0:Ve.assignRolesGasLimit)||8e7,Je,ze,sr=((ze=(Je=n==null?void 0:n.config)==null?void 0:Je.nftMinterSc)==null?void 0:ze.issueTokenFnName)||"issueToken",We,_e,or=((_e=(We=n==null?void 0:n.config)==null?void 0:We.nftMinterSc)==null?void 0:_e.setLocalRolesFnName)||"setLocalRoles",He,Ze,ar=((Ze=(He=n==null?void 0:n.config)==null?void 0:He.nftMinterSc)==null?void 0:Ze.mintBaseGasLimit)||125e5,Xe,et,ir=(et=(Xe=n==null?void 0:n.config)==null?void 0:Xe.nftMinterSc)==null?void 0:et.tokenSellingPrice,tt,nt,lr=((nt=(tt=n==null?void 0:n.config)==null?void 0:tt.nftMinterSc)==null?void 0:nt.mintFnName)||"mint",rt,st,cr=((st=(rt=n==null?void 0:n.config)==null?void 0:rt.nftMinterSc)==null?void 0:st.giveawayBaseGasLimit)||125e5,ot,at,dr=((at=(ot=n==null?void 0:n.config)==null?void 0:ot.nftMinterSc)==null?void 0:at.giveawayFnName)||"giveaway",it,lt,pr=((lt=(it=n==null?void 0:n.config)==null?void 0:it.nftMinterSc)==null?void 0:lt.setDropFnName)||"setDrop",ct,dt,ye=((dt=(ct=n==null?void 0:n.config)==null?void 0:ct.nftMinterSc)==null?void 0:dt.setUnsetDropGasLimit)||5e6,pt,mt,mr=((mt=(pt=n==null?void 0:n.config)==null?void 0:pt.nftMinterSc)==null?void 0:mt.unsetDropFnName)||"unsetDrop",ut,gt,he=((gt=(ut=n==null?void 0:n.config)==null?void 0:ut.nftMinterSc)==null?void 0:gt.pauseUnpauseGasLimit)||45e5,ft,wt,ur=((wt=(ft=n==null?void 0:n.config)==null?void 0:ft.nftMinterSc)==null?void 0:wt.pauseMintingFnName)||"pauseMinting",yt,ht,gr=((ht=(yt=n==null?void 0:n.config)==null?void 0:yt.nftMinterSc)==null?void 0:ht.unpauseMintingFnName)||"startMinting",bt,Nt,fr=((Nt=(bt=n==null?void 0:n.config)==null?void 0:bt.nftMinterSc)==null?void 0:Nt.setNewPriceGasLimit)||45e5,Tt,At,wr=((At=(Tt=n==null?void 0:n.config)==null?void 0:Tt.nftMinterSc)==null?void 0:At.setNewPriceFnName)||"setNewPrice",xt,vt,yr=((vt=(xt=n==null?void 0:n.config)==null?void 0:xt.nftMinterSc)==null?void 0:vt.shuffleFnName)||"shuffle",kt,St,hr=((St=(kt=n==null?void 0:n.config)==null?void 0:kt.nftMinterSc)==null?void 0:St.shuffleGasLimit)||5e6,Pt,Mt,br=((Mt=(Pt=n==null?void 0:n.config)==null?void 0:Pt.nftMinterSc)==null?void 0:Mt.getTotalTokensLeftFnName)||"getTotalTokensLeft",Lt,Ft,Nr=((Ft=(Lt=n==null?void 0:n.config)==null?void 0:Lt.nftMinterSc)==null?void 0:Ft.getProvenanceHashFnName)||"getProvenanceHash",Dt,Ot,Tr=((Ot=(Dt=n==null?void 0:n.config)==null?void 0:Dt.nftMinterSc)==null?void 0:Ot.getDropTokensLeftFnName)||"getDropTokensLeft",Rt,Ct,Ar=((Ct=(Rt=n==null?void 0:n.config)==null?void 0:Rt.nftMinterSc)==null?void 0:Ct.getNftPriceFnName)||"getNftPrice",It,Et,xr=((Et=(It=n==null?void 0:n.config)==null?void 0:It.nftMinterSc)==null?void 0:Et.getNftTokenIdFnName)||"getNftTokenId",jt,$t,vr=(($t=(jt=n==null?void 0:n.config)==null?void 0:jt.nftMinterSc)==null?void 0:$t.getNftTokenNameFnName)||"getNftTokenName",Bt,Gt,kr=((Gt=(Bt=n==null?void 0:n.config)==null?void 0:Bt.nftMinterSc)==null?void 0:Gt.getCollectionTokenNameFnName)||"getCollectionTokenName",Qt,Ut,Sr=((Ut=(Qt=n==null?void 0:n.config)==null?void 0:Qt.nftMinterSc)==null?void 0:Ut.getTokensLimitPerAddressTotalFnName)||"getTokensLimitPerAddressTotal",qt,Kt,Pr=((Kt=(qt=n==null?void 0:n.config)==null?void 0:qt.nftMinterSc)==null?void 0:Kt.getMintedPerAddressTotalFnName)||"getMintedPerAddressTotal",Yt,Vt,Mr=((Vt=(Yt=n==null?void 0:n.config)==null?void 0:Yt.nftMinterSc)==null?void 0:Vt.changeBaseCidsFnName)||"changeBaseCids",Jt,zt,Lr=((zt=(Jt=n==null?void 0:n.config)==null?void 0:Jt.nftMinterSc)==null?void 0:zt.changeBaseCidsGasLimit)||5e6,Wt,_t,Fr=((_t=(Wt=n==null?void 0:n.config)==null?void 0:Wt.nftMinterSc)==null?void 0:_t.setNewTokensLimitPerAddressFnName)||"setNewTokensLimitPerAddress",Ht,Zt,Dr=((Zt=(Ht=n==null?void 0:n.config)==null?void 0:Ht.nftMinterSc)==null?void 0:Zt.setNewTokensLimitPerAddressGasLimit)||5e6,Xt,en,Or=((en=(Xt=n==null?void 0:n.config)==null?void 0:Xt.nftMinterSc)==null?void 0:en.claimScFundsFnName)||"claimScFunds",tn,nn,Rr=((nn=(tn=n==null?void 0:n.config)==null?void 0:tn.nftMinterSc)==null?void 0:nn.claimScFundsGasLimit)||6e6,rn,sn,Cr=((sn=(rn=n==null?void 0:n.config)==null?void 0:rn.nftMinterSc)==null?void 0:sn.getMintedPerAddressPerDropFnName)||"getMintedPerAddressPerDrop",on,an,Ir=((an=(on=n==null?void 0:n.config)==null?void 0:on.nftMinterSc)==null?void 0:an.getTokensLimitPerAddressPerDropFnName)||"getTokensLimitPerAddressPerDrop",ln,cn,K=((cn=(ln=n==null?void 0:n.config)==null?void 0:ln.nftMinterSc)==null?void 0:cn.allowlistBatchSize)||320,dn,pn,Er=((pn=(dn=n==null?void 0:n.config)==null?void 0:dn.nftMinterSc)==null?void 0:pn.populateAllowlistFnName)||"populateAllowlist",mn,un,jr=((un=(mn=n==null?void 0:n.config)==null?void 0:mn.nftMinterSc)==null?void 0:un.populateAllowlistBaseGasLimit)||6e6,gn,fn,$r=((fn=(gn=n==null?void 0:n.config)==null?void 0:gn.nftMinterSc)==null?void 0:fn.clearAllowlistFnName)||"clearAllowlist",wn,yn,Br=((yn=(wn=n==null?void 0:n.config)==null?void 0:wn.nftMinterSc)==null?void 0:yn.clearAllowlistBaseGasLimit)||5e6,hn,bn,Gr=((bn=(hn=n==null?void 0:n.config)==null?void 0:hn.nftMinterSc)==null?void 0:bn.removeAllowlistAddressFnName)||"removeAllowlistAddress",Nn,Tn,Qr=((Tn=(Nn=n==null?void 0:n.config)==null?void 0:Nn.nftMinterSc)==null?void 0:Tn.removeAllowlistAddressLimit)||5e6,An,xn,be=((xn=(An=n==null?void 0:n.config)==null?void 0:An.nftMinterSc)==null?void 0:xn.getAllowlistFnName)||"getAllowlistSize",vn,kn,Ur=((kn=(vn=n==null?void 0:n.config)==null?void 0:vn.nftMinterSc)==null?void 0:kn.isAllowlistEnabledFnName)||"isAllowlistEnabled",Sn,Pn,qr=((Pn=(Sn=n==null?void 0:n.config)==null?void 0:Sn.nftMinterSc)==null?void 0:Pn.getAllowlistAddressCheckFn)||"getAllowlistAddressCheck",Mn,Ln,Kr=((Ln=(Mn=n==null?void 0:n.config)==null?void 0:Mn.nftMinterSc)==null?void 0:Ln.enableAllowlistFnName)||"enableAllowlist",Fn,Dn,Yr=((Dn=(Fn=n==null?void 0:n.config)==null?void 0:Fn.nftMinterSc)==null?void 0:Dn.disableAllowlistFnName)||"disableAllowlist",On,Rn,Ne=((Rn=(On=n==null?void 0:n.config)==null?void 0:On.nftMinterSc)==null?void 0:Rn.enableDisableAllowlistGasLimit)||6e6,Cn,In,Vr=((In=(Cn=n==null?void 0:n.config)==null?void 0:Cn.nftMinterSc)==null?void 0:In.isDropActiveFnName)||"isDropActive",En,jn,E=((jn=(En=n==null?void 0:n.config)==null?void 0:En.nftMinterSc)==null?void 0:jn.tokensPerOneTx)||95,$n,Bn,Jr=((Bn=($n=n==null?void 0:n.config)==null?void 0:$n.nftMinterSc)==null?void 0:Bn.isMintingPausedFnName)||"isMintingPaused",Gn,Qn,zr=((Qn=(Gn=n==null?void 0:n.config)==null?void 0:Gn.nftMinterSc)==null?void 0:Qn.getTotalSupplyFnName)||"getTotalSupply",Un,qn,Wr=((qn=(Un=n==null?void 0:n.config)==null?void 0:Un.nftMinterSc)==null?void 0:qn.getTotalSupplyOfCurrentDropFnName)||"getTotalSupplyOfCurrentDrop",Kn,Yn,_r=((Yn=(Kn=n==null?void 0:n.config)==null?void 0:Kn.collectionNftOwners)==null?void 0:Yn.apiCallsPerSecond)||5,Vn,Jn,Zo=((Jn=(Vn=n==null?void 0:n.config)==null?void 0:Vn.minterDapp)==null?void 0:Jn.version)||_.elvenTools.minterDappVersionTagName,zn,X=(zn=n==null?void 0:n.config)==null?void 0:zn.apiProviderEndpoint,H={local:X||"http://localhost:7950",testnet:X||"https://testnet-api.elrond.com",devnet:X||"https://devnet-api.elrond.com",mainnet:X||"https://api.elrond.com"},Wn,q=(Wn=n==null?void 0:n.config)==null?void 0:Wn.gatewayProviderEndpoint,Hr={local:q||"http://localhost:7950",testnet:q||"https://testnet-gateway.elrond.com",devnet:q||"https://devnet-gateway.elrond.com",mainnet:q||"https://gateway.elrond.com"},g={testnet:"T",devnet:"D",mainnet:"1"},ee={devnet:"https://devnet-explorer.elrond.com",testnet:"https://testnet-explorer.elrond.com",mainnet:"https://explorer.elrond.com"},Zr=`Enter mnemonic (seed phrase)
`,Xr=`Enter the name for the collection token (ex. MyName123).
"use strict";var Po=Object.create;var fe=Object.defineProperty;var Mo=Object.getOwnPropertyDescriptor;var Lo=Object.getOwnPropertyNames,Fe=Object.getOwnPropertySymbols,Fo=Object.getPrototypeOf,Oe=Object.prototype.hasOwnProperty,Do=Object.prototype.propertyIsEnumerable;var De=(r,e,t)=>e in r?fe(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,P=(r,e)=>{for(var t in e||(e={}))Oe.call(e,t)&&De(r,t,e[t]);if(Fe)for(var t of Fe(e))Do.call(e,t)&&De(r,t,e[t]);return r};var Oo=(r,e,t,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of Lo(e))!Oe.call(r,a)&&a!==t&&fe(r,a,{get:()=>e[a],enumerable:!(s=Mo(e,a))||s.enumerable});return r};var A=(r,e,t)=>(t=r!=null?Po(Fo(r)):{},Oo(e||!r||!r.__esModule?fe(t,"default",{value:r,enumerable:!0}):t,r));var l=(r,e,t)=>new Promise((s,a)=>{var i=p=>{try{c(t.next(p))}catch(N){a(N)}},d=p=>{try{c(t.throw(p))}catch(N){a(N)}},c=p=>p.done?s(p.value):Promise.resolve(p.value).then(i,d);c((t=t.apply(r,e)).next())});var J=require("process");var de=require("process"),ro=require("fs"),so=A(require("ora")),oo=A(require("prompts"));var Wn=require("cosmiconfig"),_n=require("process");var W={name:"elven-tools",engines:{node:"^12.20.0 || ^14.13.1 || >=16.0.0"},types:"build/types",version:"1.11.1",elvenTools:{smartContractVersionTagName:"v1.7.0",minterDappVersionTagName:"v3.0.0"},description:"Interacting with custom NFT related Smart Contracts on the Elrond blockchain",main:"build/index.js",bin:{"elven-tools":"./build/index.js"},scripts:{generate:"npm run build && node build/index.js",build:"rimraf build && node ./esbuild.config.js && tsc","dev:lint":"eslint src/** --fix","dev:prettier":"prettier --write 'src/**/*.{js,ts,json}'",prepublishOnly:"npm run build"},author:"Julian \u0106wirko <julian.io>",license:"MIT",homepage:"https://github.com/ElvenTools/elven-tools-cli",repository:{type:"git",url:"https://github.com/ElvenTools/elven-tools-cli"},keywords:["elrond","blockchain","sdk","javascript","nft","cli"],devDependencies:{"@types/cross-spawn":"^6.0.2","@types/download":"8.0.0","@types/ledgerhq__hw-transport":"^4.21.4","@types/node":"^16.11.12","@types/prompt":"^1.1.2","@types/prompts":"^2.0.14","@typescript-eslint/eslint-plugin":"^4.27.0","@typescript-eslint/parser":"^4.27.0",esbuild:"^0.14.2",eslint:"^7.29.0","eslint-config-prettier":"^8.3.0","eslint-plugin-prettier":"^3.4.0",prettier:"^2.5.1",rimraf:"^3.0.2",typescript:"^4.5.3"},dependencies:{"@elrondnetwork/erdjs":"10.2.7","@elrondnetwork/erdjs-network-providers":"0.1.6","@elrondnetwork/erdjs-walletcore":"1.0.0",axios:"^0.27.2","bignumber.js":"9.0.2",cosmiconfig:"^7.0.1","cross-fetch":"^3.1.5","cross-spawn":"7.0.3",download:"8.0.0",install:"^0.13.0",npm:"^8.10.0",ora:"5.4.1","p-throttle":"4.1.1",prompts:"^2.4.2"}};var Co="elventools",Io=(0,Wn.cosmiconfigSync)(Co),n=Io.search((0,_n.cwd)()),Re,m=((Re=n==null?void 0:n.config)==null?void 0:Re.chain)||"devnet",Ce,Ie,Hn=(Ie=(Ce=n==null?void 0:n.config)==null?void 0:Ce.nftMinterSc)==null?void 0:Ie.deployNftMinterSC,Ee,je,Zn=((je=(Ee=n==null?void 0:n.config)==null?void 0:Ee.nftMinterSc)==null?void 0:je.deployGasLimit)||12e7,$e,Be,Xn=((Be=($e=n==null?void 0:n.config)==null?void 0:$e.nftMinterSc)==null?void 0:Be.version)||W.elvenTools.smartContractVersionTagName,Ge,Qe,er=((Qe=(Ge=n==null?void 0:n.config)==null?void 0:Ge.nftMinterSc)==null?void 0:Qe.issueCollectionTokenGasLimit)||8e7,Ue,qe,tr=((qe=(Ue=n==null?void 0:n.config)==null?void 0:Ue.nftMinterSc)==null?void 0:qe.issueValue)||.05,Ke,Ye,nr=((Ye=(Ke=n==null?void 0:n.config)==null?void 0:Ke.nftMinterSc)==null?void 0:Ye.assignRolesGasLimit)||8e7,Ve,Je,rr=((Je=(Ve=n==null?void 0:n.config)==null?void 0:Ve.nftMinterSc)==null?void 0:Je.issueTokenFnName)||"issueToken",ze,We,sr=((We=(ze=n==null?void 0:n.config)==null?void 0:ze.nftMinterSc)==null?void 0:We.setLocalRolesFnName)||"setLocalRoles",_e,He,or=((He=(_e=n==null?void 0:n.config)==null?void 0:_e.nftMinterSc)==null?void 0:He.mintBaseGasLimit)||125e5,Ze,Xe,ar=(Xe=(Ze=n==null?void 0:n.config)==null?void 0:Ze.nftMinterSc)==null?void 0:Xe.tokenSellingPrice,et,tt,ir=((tt=(et=n==null?void 0:n.config)==null?void 0:et.nftMinterSc)==null?void 0:tt.mintFnName)||"mint",nt,rt,lr=((rt=(nt=n==null?void 0:n.config)==null?void 0:nt.nftMinterSc)==null?void 0:rt.giveawayBaseGasLimit)||125e5,st,ot,cr=((ot=(st=n==null?void 0:n.config)==null?void 0:st.nftMinterSc)==null?void 0:ot.giveawayFnName)||"giveaway",at,it,dr=((it=(at=n==null?void 0:n.config)==null?void 0:at.nftMinterSc)==null?void 0:it.setDropFnName)||"setDrop",lt,ct,we=((ct=(lt=n==null?void 0:n.config)==null?void 0:lt.nftMinterSc)==null?void 0:ct.setUnsetDropGasLimit)||5e6,dt,pt,pr=((pt=(dt=n==null?void 0:n.config)==null?void 0:dt.nftMinterSc)==null?void 0:pt.unsetDropFnName)||"unsetDrop",mt,ut,ye=((ut=(mt=n==null?void 0:n.config)==null?void 0:mt.nftMinterSc)==null?void 0:ut.pauseUnpauseGasLimit)||45e5,gt,ft,mr=((ft=(gt=n==null?void 0:n.config)==null?void 0:gt.nftMinterSc)==null?void 0:ft.pauseMintingFnName)||"pauseMinting",wt,yt,ur=((yt=(wt=n==null?void 0:n.config)==null?void 0:wt.nftMinterSc)==null?void 0:yt.unpauseMintingFnName)||"startMinting",ht,bt,gr=((bt=(ht=n==null?void 0:n.config)==null?void 0:ht.nftMinterSc)==null?void 0:bt.setNewPriceGasLimit)||45e5,Nt,Tt,fr=((Tt=(Nt=n==null?void 0:n.config)==null?void 0:Nt.nftMinterSc)==null?void 0:Tt.setNewPriceFnName)||"setNewPrice",At,xt,wr=((xt=(At=n==null?void 0:n.config)==null?void 0:At.nftMinterSc)==null?void 0:xt.shuffleFnName)||"shuffle",vt,kt,yr=((kt=(vt=n==null?void 0:n.config)==null?void 0:vt.nftMinterSc)==null?void 0:kt.shuffleGasLimit)||5e6,St,Pt,hr=((Pt=(St=n==null?void 0:n.config)==null?void 0:St.nftMinterSc)==null?void 0:Pt.getTotalTokensLeftFnName)||"getTotalTokensLeft",Mt,Lt,br=((Lt=(Mt=n==null?void 0:n.config)==null?void 0:Mt.nftMinterSc)==null?void 0:Lt.getProvenanceHashFnName)||"getProvenanceHash",Ft,Dt,Nr=((Dt=(Ft=n==null?void 0:n.config)==null?void 0:Ft.nftMinterSc)==null?void 0:Dt.getDropTokensLeftFnName)||"getDropTokensLeft",Ot,Rt,Tr=((Rt=(Ot=n==null?void 0:n.config)==null?void 0:Ot.nftMinterSc)==null?void 0:Rt.getNftPriceFnName)||"getNftPrice",Ct,It,Ar=((It=(Ct=n==null?void 0:n.config)==null?void 0:Ct.nftMinterSc)==null?void 0:It.getNftTokenIdFnName)||"getNftTokenId",Et,jt,xr=((jt=(Et=n==null?void 0:n.config)==null?void 0:Et.nftMinterSc)==null?void 0:jt.getNftTokenNameFnName)||"getNftTokenName",$t,Bt,vr=((Bt=($t=n==null?void 0:n.config)==null?void 0:$t.nftMinterSc)==null?void 0:Bt.getCollectionTokenNameFnName)||"getCollectionTokenName",Gt,Qt,kr=((Qt=(Gt=n==null?void 0:n.config)==null?void 0:Gt.nftMinterSc)==null?void 0:Qt.getTokensLimitPerAddressTotalFnName)||"getTokensLimitPerAddressTotal",Ut,qt,Sr=((qt=(Ut=n==null?void 0:n.config)==null?void 0:Ut.nftMinterSc)==null?void 0:qt.getMintedPerAddressTotalFnName)||"getMintedPerAddressTotal",Kt,Yt,Pr=((Yt=(Kt=n==null?void 0:n.config)==null?void 0:Kt.nftMinterSc)==null?void 0:Yt.changeBaseCidsFnName)||"changeBaseCids",Vt,Jt,Mr=((Jt=(Vt=n==null?void 0:n.config)==null?void 0:Vt.nftMinterSc)==null?void 0:Jt.changeBaseCidsGasLimit)||5e6,zt,Wt,Lr=((Wt=(zt=n==null?void 0:n.config)==null?void 0:zt.nftMinterSc)==null?void 0:Wt.setNewTokensLimitPerAddressFnName)||"setNewTokensLimitPerAddress",_t,Ht,Fr=((Ht=(_t=n==null?void 0:n.config)==null?void 0:_t.nftMinterSc)==null?void 0:Ht.setNewTokensLimitPerAddressGasLimit)||5e6,Zt,Xt,Dr=((Xt=(Zt=n==null?void 0:n.config)==null?void 0:Zt.nftMinterSc)==null?void 0:Xt.claimScFundsFnName)||"claimScFunds",en,tn,Or=((tn=(en=n==null?void 0:n.config)==null?void 0:en.nftMinterSc)==null?void 0:tn.claimScFundsGasLimit)||6e6,nn,rn,Rr=((rn=(nn=n==null?void 0:n.config)==null?void 0:nn.nftMinterSc)==null?void 0:rn.getMintedPerAddressPerDropFnName)||"getMintedPerAddressPerDrop",sn,on,Cr=((on=(sn=n==null?void 0:n.config)==null?void 0:sn.nftMinterSc)==null?void 0:on.getTokensLimitPerAddressPerDropFnName)||"getTokensLimitPerAddressPerDrop",an,ln,q=((ln=(an=n==null?void 0:n.config)==null?void 0:an.nftMinterSc)==null?void 0:ln.allowlistBatchSize)||320,cn,dn,Ir=((dn=(cn=n==null?void 0:n.config)==null?void 0:cn.nftMinterSc)==null?void 0:dn.populateAllowlistFnName)||"populateAllowlist",pn,mn,Er=((mn=(pn=n==null?void 0:n.config)==null?void 0:pn.nftMinterSc)==null?void 0:mn.populateAllowlistBaseGasLimit)||6e6,un,gn,jr=((gn=(un=n==null?void 0:n.config)==null?void 0:un.nftMinterSc)==null?void 0:gn.clearAllowlistFnName)||"clearAllowlist",fn,wn,$r=((wn=(fn=n==null?void 0:n.config)==null?void 0:fn.nftMinterSc)==null?void 0:wn.clearAllowlistBaseGasLimit)||5e6,yn,hn,Br=((hn=(yn=n==null?void 0:n.config)==null?void 0:yn.nftMinterSc)==null?void 0:hn.removeAllowlistAddressFnName)||"removeAllowlistAddress",bn,Nn,Gr=((Nn=(bn=n==null?void 0:n.config)==null?void 0:bn.nftMinterSc)==null?void 0:Nn.removeAllowlistAddressLimit)||5e6,Tn,An,he=((An=(Tn=n==null?void 0:n.config)==null?void 0:Tn.nftMinterSc)==null?void 0:An.getAllowlistFnName)||"getAllowlistSize",xn,vn,Qr=((vn=(xn=n==null?void 0:n.config)==null?void 0:xn.nftMinterSc)==null?void 0:vn.isAllowlistEnabledFnName)||"isAllowlistEnabled",kn,Sn,Ur=((Sn=(kn=n==null?void 0:n.config)==null?void 0:kn.nftMinterSc)==null?void 0:Sn.getAllowlistAddressCheckFn)||"getAllowlistAddressCheck",Pn,Mn,qr=((Mn=(Pn=n==null?void 0:n.config)==null?void 0:Pn.nftMinterSc)==null?void 0:Mn.enableAllowlistFnName)||"enableAllowlist",Ln,Fn,Kr=((Fn=(Ln=n==null?void 0:n.config)==null?void 0:Ln.nftMinterSc)==null?void 0:Fn.disableAllowlistFnName)||"disableAllowlist",Dn,On,be=((On=(Dn=n==null?void 0:n.config)==null?void 0:Dn.nftMinterSc)==null?void 0:On.enableDisableAllowlistGasLimit)||6e6,Rn,Cn,Yr=((Cn=(Rn=n==null?void 0:n.config)==null?void 0:Rn.nftMinterSc)==null?void 0:Cn.isDropActiveFnName)||"isDropActive",In,En,I=((En=(In=n==null?void 0:n.config)==null?void 0:In.nftMinterSc)==null?void 0:En.tokensPerOneTx)||95,jn,$n,Vr=(($n=(jn=n==null?void 0:n.config)==null?void 0:jn.nftMinterSc)==null?void 0:$n.isMintingPausedFnName)||"isMintingPaused",Bn,Gn,Jr=((Gn=(Bn=n==null?void 0:n.config)==null?void 0:Bn.nftMinterSc)==null?void 0:Gn.getTotalSupplyFnName)||"getTotalSupply",Qn,Un,zr=((Un=(Qn=n==null?void 0:n.config)==null?void 0:Qn.nftMinterSc)==null?void 0:Un.getTotalSupplyOfCurrentDropFnName)||"getTotalSupplyOfCurrentDrop",qn,Kn,Wr=((Kn=(qn=n==null?void 0:n.config)==null?void 0:qn.collectionNftOwners)==null?void 0:Kn.apiCallsPerSecond)||5,Yn,Vn,Eo=((Vn=(Yn=n==null?void 0:n.config)==null?void 0:Yn.minterDapp)==null?void 0:Vn.version)||W.elvenTools.minterDappVersionTagName,Jn,Z=(Jn=n==null?void 0:n.config)==null?void 0:Jn.apiProviderEndpoint,_={local:Z||"http://localhost:7950",testnet:Z||"https://testnet-api.elrond.com",devnet:Z||"https://devnet-api.elrond.com",mainnet:Z||"https://api.elrond.com"},zn,U=(zn=n==null?void 0:n.config)==null?void 0:zn.gatewayProviderEndpoint,_r={local:U||"http://localhost:7950",testnet:U||"https://testnet-gateway.elrond.com",devnet:U||"https://devnet-gateway.elrond.com",mainnet:U||"https://gateway.elrond.com"},g={testnet:"T",devnet:"D",mainnet:"1"},X={devnet:"https://devnet-explorer.elrond.com",testnet:"https://testnet-explorer.elrond.com",mainnet:"https://explorer.elrond.com"},Hr=`Enter mnemonic (seed phrase)
`,Zr=`Enter the name for the collection token (ex. MyName123).
(3-20 characters, alphanumeric only)
`,es=`Enter the ticker for the collection token (ex. MYNAME).
`,Xr=`Enter the ticker for the collection token (ex. MYNAME).
(3-10 characters, alphanumeric and uppercase only)
`,ts=`Enter the name for NFTs. If not provided, the name of the collection will be used.
`,es=`Enter the name for NFTs. If not provided, the name of the collection will be used.
Each name will additionally get a unique number, so don't add the numbers here. (Optional)
`,te=`Provide the base assets files IPFS CID:
`,ne=`Provide the base metadata files IPFS CID:
`,ns=`Provide amount of tokens in collection:
`,re=`Provide the seling price (ex. 0.5 for 0.5 EGLD):
`,rs=`Provide the royalties value (ex. 20 for 20%) [optional]:
`,ss=`Provide tags (ex. tag1,tag2,tag3) [optional]:
`,os=`Provide the provenance hash (sha256 hash of all images) [optional]:
`,se=`Total tokens limit per one address per whole collection (the best is to keep it as low as possible):
`,as=`Provide the file extension:
`,is=`Provide how many tokens should be minted.
`,ee=`Provide the base assets files IPFS CID:
`,te=`Provide the base metadata files IPFS CID:
`,ts=`Provide amount of tokens in collection:
`,ne=`Provide the seling price (ex. 0.5 for 0.5 EGLD):
`,ns=`Provide the royalties value (ex. 20 for 20%) [optional]:
`,rs=`Provide tags (ex. tag1,tag2,tag3) [optional]:
`,ss=`Provide the provenance hash (sha256 hash of all images) [optional]:
`,re=`Total tokens limit per one address per whole collection (the best is to keep it as low as possible):
`,os=`Provide the file extension:
`,as=`Provide how many tokens should be minted.
Take into account possible limitations set on the Smart Contract.
You need to provide the value which fits in limits as a whole. Max ${E} because of the max gas limit per transaction:
`,ls=`Provide the address for giveaway:
`,cs=`Provide how many tokens you want to give away.
You need to provide the value which fits in limits as a whole. Max ${I} because of the max gas limit per transaction:
`,is=`Provide the address for giveaway:
`,ls=`Provide how many tokens you want to give away.
Take into account possible limitations set on the Smart Contract
You need to provide the value which fits in limits as a whole. Max ${E} because of the max gas limit per transaction:
`,ds=`Provide the amount of the tokens for the drop:
`,ps=`Are you sure that you want to proceed?
`,ms=`Decide if the contract can be upgraded in the future.
`,us=`Decide if the contract's storage can be read by other contracts. Not recommended in this case.
`,gs=`Decide if the contract can receive funds. Recommended because of the royalties.
`,fs=`Provide the tokens limit per single address per whole drop (the best is to keep it as low as possible) [optional]:
`,ws=`Do you want to attach the metadata JSON file in the Assets/Uris?
You need to provide the value which fits in limits as a whole. Max ${I} because of the max gas limit per transaction:
`,cs=`Provide the amount of the tokens for the drop:
`,ds=`Are you sure that you want to proceed?
`,ps=`Decide if the contract can be upgraded in the future.
`,ms=`Decide if the contract's storage can be read by other contracts. Not recommended in this case.
`,us=`Decide if the contract can receive funds. Recommended because of the royalties.
`,gs=`Provide the tokens limit per single address per whole drop (the best is to keep it as low as possible) [optional]:
`,fs=`Do you want to attach the metadata JSON file in the Assets/Uris?
(It will be attached and encoded in the attributes anyway, but some marketplaces require that).
`,ys=`Provide the list of addresses. Max ${K} addresses per one transaction.
`,ws=`Provide the list of addresses. Max ${q} addresses per one transaction.
You can add more by sending more transactions. Separate them with comma (","):
`,hs=`Provide the collection ticker
`,bs=`Do you want to exclude smart contract addresses?
`,Ns=`Do you want to filter by metadata JSON file name? Provide names without the extension separated by a comma (example: 123,555,9999) [you can ommit that, just confirm empty]
`,Ts=`Please provide the project name (directory name) in which the dapp should be initialized.
`,As=`Provide address to remove.
`,xs="walletKey.pem",vs="sc/nft-minter/elven-nft-minter.abi.json",ks="sc/nft-minter/elven-nft-minter.wasm",Ss=`https://raw.githubusercontent.com/ElvenTools/elven-nft-minter-sc/${er}/output/elven-nft-minter.abi.json`,Ps=`https://raw.githubusercontent.com/ElvenTools/elven-nft-minter-sc/${er}/output/elven-nft-minter.wasm`,Te=`https://github.com/ElvenTools/elven-tools-dapp/archive/refs/tags/${Zo}.zip`,j="output.json",Ms="allowlist.json";var o=require("@elrondnetwork/erdjs"),Ae=A(require("axios")),oe=require("@elrondnetwork/erdjs-walletcore"),ae=require("@elrondnetwork/erdjs-network-providers"),Ls=A(require("prompts")),ie=A(require("bignumber.js")),xe=A(require("ora")),u=require("fs"),$=require("process");var le=(0,$.cwd)(),D=(r,e)=>{let t=e.isJSON===void 0?!0:e.isJSON,s=e.noExitOnError===void 0?!1:e.noExitOnError,a=`${le}/${r}`;try{(0,u.accessSync)(a,u.constants.R_OK|u.constants.W_OK)}catch(c){if(!s)console.error(`There is no ${r}!`),(0,$.exit)(9);else return}let d=(0,u.readFileSync)(a).toString("utf8");return t?JSON.parse(d):d};var ve=()=>q?new ae.ProxyNetworkProvider(Hr[m],{timeout:1e4}):new ae.ApiNetworkProvider(H[m],{timeout:1e4}),Fs=(r,e)=>new o.SmartContract({address:e?new o.Address(e):void 0,abi:r}),Ds=r=>l(void 0,null,function*(){let t=(0,oe.parseUserKey)(r).generatePublicKey().toAddress();return new o.Account(t)}),Os=r=>oe.UserSigner.fromPem(r),Rs=(r,e)=>l(void 0,null,function*(){try{(0,u.accessSync)(r,u.constants.R_OK|u.constants.W_OK);let t=yield u.promises.readFile(r,{encoding:"utf8"}),s=JSON.parse(t),a=o.AbiRegistry.create(s);return new o.SmartContractAbi(a)}catch(t){let s=yield Ae.default.get(e),a=o.AbiRegistry.create(s.data);return new o.SmartContractAbi(a)}}),Cs=(r,e)=>l(void 0,null,function*(){try{(0,u.accessSync)(r,u.constants.R_OK|u.constants.W_OK);let t=yield u.promises.readFile(r);return o.Code.fromBuffer(t)}catch(t){let s=yield Ae.default.get(e,{responseType:"arraybuffer",transformResponse:[],headers:{Accept:"application/wasm"}}),a=Buffer.from(s.data);return o.Code.fromBuffer(a)}}),Is=(r,e,t,s,a,i,d,c,p,N,w,L,W=!0,O=!1,Z=!1,Q=!1)=>e.deploy({code:r,codeMetadata:new o.CodeMetadata(W,O,Z),gasLimit:t,initArguments:[o.BytesValue.fromUTF8(s.trim()),o.BytesValue.fromUTF8(i.trim()),new o.U32Value(d),new o.U32Value(c),new o.BigUIntValue(new ie.default(Number(N)*100||0)),new o.BigUIntValue(o.TokenPayment.egldFromAmount(p.trim()).valueOf()),o.BytesValue.fromUTF8(a.trim()),o.BytesValue.fromUTF8((w==null?void 0:w.trim())||""),o.BytesValue.fromUTF8((L==null?void 0:L.trim())||""),new o.BooleanValue(Q)],chainID:g[m]}),ce=({scAddress:r,sellingPrice:e,tokenId:t})=>{let s=`${le}/${j}`;try{(0,u.accessSync)(s,u.constants.R_OK|u.constants.W_OK);let a=(0,u.readFileSync)(s,{encoding:"utf8"}),i=M(M(M(M({},JSON.parse(a)),r?{nftMinterScAddress:r.bech32()}:{}),e?{nftMinterScCollectionSellingPrice:o.TokenPayment.egldFromAmount(e).toString()}:{}),t?{nftMinterCollectionToken:t}:{});return(0,u.writeFileSync)(s,JSON.stringify(i,null,2))}catch(a){return(0,u.writeFileSync)(s,JSON.stringify(M(M(M({},r?{nftMinterScAddress:r.bech32()}:{}),e?{nftMinterScCollectionSellingPrice:o.TokenPayment.egldFromAmount(e).toString()}:{}),t?{nftMinterCollectionToken:t}:{}),null,2))}},Es=(r,e,t,s,a,i)=>r.call({func:new o.ContractFunction(sr),args:[o.BytesValue.fromUTF8(s.trim()),o.BytesValue.fromUTF8(a.trim()),...i?[o.BytesValue.fromUTF8(i.trim())]:[]],value:o.TokenPayment.egldFromAmount(t),gasLimit:e,chainID:g[m]}),f=()=>{let r=D(j,{noExitOnError:!0}),e=Zn||(r==null?void 0:r.nftMinterScAddress);return e||(console.log("Smart Contract address isn't provided. Please deploy it or add the address to the configuration if it is already deployed."),(0,$.exit)(9)),e},js=(r,e)=>r.call({func:new o.ContractFunction(or),gasLimit:e,chainID:g[m]}),$s=(r,e,t)=>{let s=t||1,a=D(j,{noExitOnError:!0}),i=ir||(a==null?void 0:a.nftMinterScCollectionSellingPrice);if(!i)console.log("Price per token isn't provided. Please add it to the config file."),(0,$.exit)(9);else{let d=new o.SmartContract({address:new o.Address(r)}),c=new ie.default(i).times(s);return d.call({func:new o.ContractFunction(lr),gasLimit:e+e/2*(t-1),chainID:g[m],args:[new o.U32Value(s)],value:o.TokenPayment.egldFromBigInteger(c)})}},Bs=(r,e,t,s)=>{let a=s||1;return r.call({func:new o.ContractFunction(dr),gasLimit:e+e/2*(s-1),chainID:g[m],args:[new o.AddressValue(new o.Address(t.trim())),new o.U32Value(a)]})},Gs=(r,e,t,s)=>r.call({func:new o.ContractFunction(pr),gasLimit:e,chainID:g[m],args:[new o.U32Value(t),...s?[new o.U32Value(s)]:[]]}),Qs=(r,e)=>r.call({func:new o.ContractFunction(mr),gasLimit:e,chainID:g[m]}),Us=(r,e)=>r.call({func:new o.ContractFunction(ur),gasLimit:e,chainID:g[m]}),qs=(r,e)=>r.call({func:new o.ContractFunction(gr),gasLimit:e,chainID:g[m]}),Ks=(r,e)=>r.call({func:new o.ContractFunction(Kr),gasLimit:e,chainID:g[m]}),Ys=(r,e)=>r.call({func:new o.ContractFunction(Yr),gasLimit:e,chainID:g[m]}),h=(r,e,t,s)=>l(void 0,null,function*(){r.setNonce(e.nonce),e.incrementNonce(),t.sign(r);let a=(0,xe.default)("Processing the transaction...");a.start(),yield s.sendTransaction(r);let d=yield new o.TransactionWatcher(s).awaitCompleted(r),c=d.hash,p=d.status;a.stop(),console.log(`
Transaction status: ${p}`),console.log(`Transaction link: ${ee[m]}/transactions/${c}
`)}),Vs=(r,e,t)=>r.call({func:new o.ContractFunction(wr),gasLimit:e,chainID:g[m],args:[new o.BigUIntValue(o.TokenPayment.egldFromAmount(t.trim()).valueOf())]}),Xo=[{type:"select",name:"areYouSureAnswer",message:ps,choices:[{title:"Yes",value:"yes"},{title:"No",value:"no"}]}],k=()=>l(void 0,null,function*(){let{areYouSureAnswer:r}=yield(0,Ls.default)(Xo);r!=="yes"&&(console.log("Aborted!"),(0,$.exit)(9))}),Js=(r,e)=>new o.Transaction({data:new o.TransactionPayload("ClaimDeveloperRewards"),gasLimit:6e6,chainID:g[m],sender:e.address,receiver:r.getAddress(),value:o.TokenPayment.egldFromAmount(0)}),zs=(r,e)=>new o.SmartContract({address:new o.Address(r)}).call({func:new o.ContractFunction(yr),gasLimit:e,chainID:g[m],args:[]}),ke=(r,e,t,s=[])=>{let i=new o.SmartContract({address:new o.Address(e)}).createQuery({func:new o.ContractFunction(r),args:s});return t.queryContract(i)},ea=r=>{var t,s;return((s=(t=r.getReturnDataParts())==null?void 0:t[0])==null?void 0:s.toString("hex"))==="01"?"true":"false"},Se=r=>{var t,s;let e=(s=(t=r.getReturnDataParts())==null?void 0:t[0])==null?void 0:s.toString("hex");return new ie.default(e,16).toString(10)},ta=r=>{var t,s;return(s=(t=r.getReturnDataParts())==null?void 0:t[0])==null?void 0:s.toString("utf8")},T=i=>l(void 0,[i],function*({functionName:r,resultLabel:e,resultType:t,resultModifier:s,args:a}){let d=f(),c=(0,xe.default)("Processing query...");try{let p=ve();c.start();let N=yield ke(r,d,p,a);c.stop();let w;t==="string"?w=ta(N):t==="boolean"?w=ea(N):w=Se(N),s==null||s(w.trim()),console.log(`${e||"Query results:"} `,s?s(w.trim()):w.trim())}catch(p){c.stop(),console.log(p==null?void 0:p.message)}}),Ws=r=>{T({functionName:Pr,resultLabel:"Tokens already minted per address:",resultType:"number",args:[new o.AddressValue(new o.Address(r))]})},_s=r=>{T({functionName:Cr,resultLabel:"Tokens already minted per address per drop:",resultType:"number",args:[new o.AddressValue(new o.Address(r))]})},Hs=r=>{T({functionName:qr,resultType:"boolean",resultLabel:"Result:",resultModifier:e=>e==="true"?"Provided address is included!":"Provided address isn't included!",args:[new o.AddressValue(new o.Address(r))]})},Zs=(r,e,t,s)=>r.call({func:new o.ContractFunction(Mr),gasLimit:e,chainID:g[m],args:[o.BytesValue.fromUTF8(t.trim()),o.BytesValue.fromUTF8(s.trim())]}),Xs=(r,e,t)=>r.call({func:new o.ContractFunction(Fr),gasLimit:e,chainID:g[m],args:[new o.U32Value(t)]}),eo=(r,e)=>r.call({func:new o.ContractFunction(Or),gasLimit:e,chainID:g[m]}),to=(r,e,t)=>{let s=()=>new o.List(new o.ListType(new o.AddressType),t.map(a=>new o.AddressValue(new o.Address(a))));return r.call({func:new o.ContractFunction(Er),gasLimit:e+185e4*(t.length-1),chainID:g[m],args:[s()]})},no=(r,e,t)=>r.call({func:new o.ContractFunction($r),gasLimit:e+445e3*(t-1),chainID:g[m]}),ro=(r,e,t)=>r.call({func:new o.ContractFunction(Gr),gasLimit:e,chainID:g[m],args:[new o.AddressValue(new o.Address(t))]});var de=()=>l(void 0,null,function*(){let r=D(xs,{isJSON:!1}),e=ve(),t=yield Ds(r),s=yield e.getAccount(t.address);return t.update(s),{signer:Os(r),userAccount:t,provider:e}}),b=r=>l(void 0,null,function*(){let e=yield Rs(vs,Ss),t=yield Cs(ks,Ps),s=Fs(e,r),a=yield de();return M({scWasmCode:t,smartContract:s},a)});var me=require("@elrondnetwork/erdjs/out"),na=()=>l(void 0,null,function*(){D(j,{noExitOnError:!0})&&(0,so.unlinkSync)(`${le}/${j}`);let e=[{type:"select",name:"nftSCupgradable",message:ms,choices:[{title:"Yes",value:!0},{title:"No",value:!1}]},{type:"select",name:"nftSCreadable",message:us,choices:[{title:"No",value:!1},{title:"Yes",value:!0}]},{type:"select",name:"nftSCpayable",message:gs,choices:[{title:"Yes",value:!0},{title:"No",value:!1}]},{type:"text",name:"deployNftMinterImgCid",message:te,validate:s=>s?!0:"Required!"},{type:"text",name:"deployNftMinterMetaCid",message:ne,validate:s=>s?!0:"Required!"},{type:"select",name:"metadataInAssets",message:ws,choices:[{title:"No",value:!1},{title:"Yes",value:!0}]},{type:"select",name:"deployNftMinterImgExt",message:as,choices:[{title:".png",value:".png"},{title:".jpg",value:".jpg"},{title:".gif",value:".gif"},{title:".mp3",value:".mp3"},{title:".mp4",value:".mp4"}]},{type:"number",name:"deployNftMinterAmountOfTokens",message:ns,min:1,validate:s=>!s||s<1?"Required and min 1!":!0},{type:"text",name:"deployNftMinterSellingPrice",message:re,validate:s=>!Number(s)||Number(s)<=0?"Required and min 0!":!0},{type:"number",name:"deployNftMinterTokensLimitPerAddress",message:se,validate:s=>s&&s>=1?!0:"Min 1!"},{type:"number",name:"deployNftMinterRoyalties",message:rs,min:0,max:100,validate:s=>s>=0&&s<=100||!s?!0:"Should be a number in range 0-100"},{type:"text",name:"deployNftMinterTags",message:ss},{type:"text",name:"deployNftMinterProvenanceHash",message:os}],t=(0,oo.default)("Processing the transaction...");try{let{scWasmCode:s,smartContract:a,userAccount:i,signer:d,provider:c}=yield b(),{deployNftMinterImgCid:p,deployNftMinterImgExt:N,deployNftMinterMetaCid:w,deployNftMinterAmountOfTokens:L,deployNftMinterTokensLimitPerAddress:W,deployNftMinterSellingPrice:O,deployNftMinterRoyalties:Z,deployNftMinterTags:Q,deployNftMinterProvenanceHash:U,nftSCupgradable:x,nftSCreadable:y,nftSCpayable:R,metadataInAssets:C}=yield(0,ao.default)(e);yield k(),(!p||!w||!L||!O)&&(console.log("You have to provide CIDs, amount of tokens and selling price!"),(0,pe.exit)(9));let F=Is(s,a,Xn,p,N,w,L,W,O,Z,Q,U,x,y,R,C);F.setNonce(i.nonce),i.incrementNonce(),d.sign(F),t.start();let P=me.SmartContract.computeAddress(F.getSender(),F.getNonce());a.setAddress(P),yield c.sendTransaction(F);let ge=yield new me.TransactionWatcher(c).awaitCompleted(F),fe=ge.status,I=ge.hash;t.stop(),console.log(`
Deployment transaction executed: ${fe}`),console.log(`Deployment tx: ${ee[m]}/transactions/${I}
`),console.log(`Smart Contract address: ${P}
`),ce({scAddress:P,sellingPrice:O})}catch(s){t.stop(),console.log(s==null?void 0:s.message)}}),io=r=>l(void 0,null,function*(){let e={nftMinter:"nft-minter"};(r==="-h"||r==="--help")&&(console.log(`========================
`,ys=`Provide the collection ticker
`,hs=`Do you want to exclude smart contract addresses?
`,bs=`Do you want to filter by metadata JSON file name? Provide names without the extension separated by a comma (example: 123,555,9999) [you can ommit that, just confirm empty]
`,Ns=`Please provide the project name (directory name) in which the dapp should be initialized.
`,Ts=`Provide address to remove.
`,As="walletKey.pem",xs="sc/nft-minter/elven-nft-minter.abi.json",vs="sc/nft-minter/elven-nft-minter.wasm",ks=`https://raw.githubusercontent.com/ElvenTools/elven-nft-minter-sc/${Xn}/output/elven-nft-minter.abi.json`,Ss=`https://raw.githubusercontent.com/ElvenTools/elven-nft-minter-sc/${Xn}/output/elven-nft-minter.wasm`,Ne=`https://github.com/ElvenTools/elven-tools-dapp/archive/refs/tags/${Eo}.zip`,E="output.json",Ps="allowlist.json";var o=require("@elrondnetwork/erdjs"),Te=A(require("axios")),se=require("@elrondnetwork/erdjs-walletcore"),oe=require("@elrondnetwork/erdjs-network-providers"),Ms=A(require("prompts")),ae=A(require("bignumber.js")),Ae=A(require("ora")),u=require("fs"),j=require("process");var ie=(0,j.cwd)(),F=(r,e)=>{let t=e.isJSON===void 0?!0:e.isJSON,s=e.noExitOnError===void 0?!1:e.noExitOnError,a=`${ie}/${r}`;try{(0,u.accessSync)(a,u.constants.R_OK|u.constants.W_OK)}catch(c){if(!s)console.error(`There is no ${r}!`),(0,j.exit)(9);else return}let d=(0,u.readFileSync)(a).toString("utf8");return t?JSON.parse(d):d};var xe=()=>U?new oe.ProxyNetworkProvider(_r[m],{timeout:1e4}):new oe.ApiNetworkProvider(_[m],{timeout:1e4}),Ls=(r,e)=>new o.SmartContract({address:e?new o.Address(e):void 0,abi:r}),Fs=r=>l(void 0,null,function*(){let t=(0,se.parseUserKey)(r).generatePublicKey().toAddress();return new o.Account(t)}),Ds=r=>se.UserSigner.fromPem(r),Os=(r,e)=>l(void 0,null,function*(){try{(0,u.accessSync)(r,u.constants.R_OK|u.constants.W_OK);let t=yield u.promises.readFile(r,{encoding:"utf8"}),s=JSON.parse(t),a=o.AbiRegistry.create(s);return new o.SmartContractAbi(a)}catch(t){let s=yield Te.default.get(e),a=o.AbiRegistry.create(s.data);return new o.SmartContractAbi(a)}}),Rs=(r,e)=>l(void 0,null,function*(){try{(0,u.accessSync)(r,u.constants.R_OK|u.constants.W_OK);let t=yield u.promises.readFile(r);return o.Code.fromBuffer(t)}catch(t){let s=yield Te.default.get(e,{responseType:"arraybuffer",transformResponse:[],headers:{Accept:"application/wasm"}}),a=Buffer.from(s.data);return o.Code.fromBuffer(a)}}),Cs=(r,e,t,s,a,i,d,c,p,N,w,M,z=!0,D=!1,H=!1,G=!1)=>e.deploy({code:r,codeMetadata:new o.CodeMetadata(z,D,H),gasLimit:t,initArguments:[o.BytesValue.fromUTF8(s.trim()),o.BytesValue.fromUTF8(i.trim()),new o.U32Value(d),new o.U32Value(c),new o.BigUIntValue(new ae.default(Number(N)*100||0)),new o.BigUIntValue(o.TokenPayment.egldFromAmount(p.trim()).valueOf()),o.BytesValue.fromUTF8(a.trim()),o.BytesValue.fromUTF8((w==null?void 0:w.trim())||""),o.BytesValue.fromUTF8((M==null?void 0:M.trim())||""),new o.BooleanValue(G)],chainID:g[m]}),le=({scAddress:r,sellingPrice:e,tokenId:t})=>{let s=`${ie}/${E}`;try{(0,u.accessSync)(s,u.constants.R_OK|u.constants.W_OK);let a=(0,u.readFileSync)(s,{encoding:"utf8"}),i=P(P(P(P({},JSON.parse(a)),r?{nftMinterScAddress:r.bech32()}:{}),e?{nftMinterScCollectionSellingPrice:o.TokenPayment.egldFromAmount(e).toString()}:{}),t?{nftMinterCollectionToken:t}:{});return(0,u.writeFileSync)(s,JSON.stringify(i,null,2))}catch(a){return(0,u.writeFileSync)(s,JSON.stringify(P(P(P({},r?{nftMinterScAddress:r.bech32()}:{}),e?{nftMinterScCollectionSellingPrice:o.TokenPayment.egldFromAmount(e).toString()}:{}),t?{nftMinterCollectionToken:t}:{}),null,2))}},Is=(r,e,t,s,a,i)=>r.call({func:new o.ContractFunction(rr),args:[o.BytesValue.fromUTF8(s.trim()),o.BytesValue.fromUTF8(a.trim()),...i?[o.BytesValue.fromUTF8(i.trim())]:[]],value:o.TokenPayment.egldFromAmount(t),gasLimit:e,chainID:g[m]}),f=()=>{let r=F(E,{noExitOnError:!0}),e=Hn||(r==null?void 0:r.nftMinterScAddress);return e||(console.log("Smart Contract address isn't provided. Please deploy it or add the address to the configuration if it is already deployed."),(0,j.exit)(9)),e},Es=(r,e)=>r.call({func:new o.ContractFunction(sr),gasLimit:e,chainID:g[m]}),js=(r,e,t)=>{let s=t||1,a=F(E,{noExitOnError:!0}),i=ar||(a==null?void 0:a.nftMinterScCollectionSellingPrice);if(!i)console.log("Price per token isn't provided. Please add it to the config file."),(0,j.exit)(9);else{let d=new o.SmartContract({address:new o.Address(r)}),c=new ae.default(i).times(s);return d.call({func:new o.ContractFunction(ir),gasLimit:e+e/2*(t-1),chainID:g[m],args:[new o.U32Value(s)],value:o.TokenPayment.egldFromBigInteger(c)})}},$s=(r,e,t,s)=>{let a=s||1;return r.call({func:new o.ContractFunction(cr),gasLimit:e+e/2*(s-1),chainID:g[m],args:[new o.AddressValue(new o.Address(t.trim())),new o.U32Value(a)]})},Bs=(r,e,t,s)=>r.call({func:new o.ContractFunction(dr),gasLimit:e,chainID:g[m],args:[new o.U32Value(t),...s?[new o.U32Value(s)]:[]]}),Gs=(r,e)=>r.call({func:new o.ContractFunction(pr),gasLimit:e,chainID:g[m]}),Qs=(r,e)=>r.call({func:new o.ContractFunction(mr),gasLimit:e,chainID:g[m]}),Us=(r,e)=>r.call({func:new o.ContractFunction(ur),gasLimit:e,chainID:g[m]}),qs=(r,e)=>r.call({func:new o.ContractFunction(qr),gasLimit:e,chainID:g[m]}),Ks=(r,e)=>r.call({func:new o.ContractFunction(Kr),gasLimit:e,chainID:g[m]}),h=(r,e,t,s)=>l(void 0,null,function*(){r.setNonce(e.nonce),e.incrementNonce(),t.sign(r);let a=(0,Ae.default)("Processing the transaction...");a.start(),yield s.sendTransaction(r);let d=yield new o.TransactionWatcher(s).awaitCompleted(r),c=d.hash,p=d.status;a.stop(),console.log(`
Transaction status: ${p}`),console.log(`Transaction link: ${X[m]}/transactions/${c}
`)}),Ys=(r,e,t)=>r.call({func:new o.ContractFunction(fr),gasLimit:e,chainID:g[m],args:[new o.BigUIntValue(o.TokenPayment.egldFromAmount(t.trim()).valueOf())]}),jo=[{type:"select",name:"areYouSureAnswer",message:ds,choices:[{title:"Yes",value:"yes"},{title:"No",value:"no"}]}],v=()=>l(void 0,null,function*(){let{areYouSureAnswer:r}=yield(0,Ms.default)(jo);r!=="yes"&&(console.log("Aborted!"),(0,j.exit)(9))}),Vs=(r,e)=>new o.Transaction({data:new o.TransactionPayload("ClaimDeveloperRewards"),gasLimit:6e6,chainID:g[m],sender:e.address,receiver:r.getAddress(),value:o.TokenPayment.egldFromAmount(0)}),Js=(r,e)=>new o.SmartContract({address:new o.Address(r)}).call({func:new o.ContractFunction(wr),gasLimit:e,chainID:g[m],args:[]}),ve=(r,e,t,s=[])=>{let i=new o.SmartContract({address:new o.Address(e)}).createQuery({func:new o.ContractFunction(r),args:s});return t.queryContract(i)},$o=r=>{var t,s;return((s=(t=r.getReturnDataParts())==null?void 0:t[0])==null?void 0:s.toString("hex"))==="01"?"true":"false"},ke=r=>{var t,s;let e=(s=(t=r.getReturnDataParts())==null?void 0:t[0])==null?void 0:s.toString("hex");return new ae.default(e,16).toString(10)},Bo=r=>{var t,s;return(s=(t=r.getReturnDataParts())==null?void 0:t[0])==null?void 0:s.toString("utf8")},T=i=>l(void 0,[i],function*({functionName:r,resultLabel:e,resultType:t,resultModifier:s,args:a}){let d=f(),c=(0,Ae.default)("Processing query...");try{let p=xe();c.start();let N=yield ve(r,d,p,a);c.stop();let w;t==="string"?w=Bo(N):t==="boolean"?w=$o(N):w=ke(N),s==null||s(w.trim()),console.log(`${e||"Query results:"} `,s?s(w.trim()):w.trim())}catch(p){c.stop(),console.log(p==null?void 0:p.message)}}),zs=r=>{T({functionName:Sr,resultLabel:"Tokens already minted per address:",resultType:"number",args:[new o.AddressValue(new o.Address(r))]})},Ws=r=>{T({functionName:Rr,resultLabel:"Tokens already minted per address per drop:",resultType:"number",args:[new o.AddressValue(new o.Address(r))]})},_s=r=>{T({functionName:Ur,resultType:"boolean",resultLabel:"Result:",resultModifier:e=>e==="true"?"Provided address is included!":"Provided address isn't included!",args:[new o.AddressValue(new o.Address(r))]})},Hs=(r,e,t,s)=>r.call({func:new o.ContractFunction(Pr),gasLimit:e,chainID:g[m],args:[o.BytesValue.fromUTF8(t.trim()),o.BytesValue.fromUTF8(s.trim())]}),Zs=(r,e,t)=>r.call({func:new o.ContractFunction(Lr),gasLimit:e,chainID:g[m],args:[new o.U32Value(t)]}),Xs=(r,e)=>r.call({func:new o.ContractFunction(Dr),gasLimit:e,chainID:g[m]}),eo=(r,e,t)=>{let s=()=>new o.List(new o.ListType(new o.AddressType),t.map(a=>new o.AddressValue(new o.Address(a))));return r.call({func:new o.ContractFunction(Ir),gasLimit:e+185e4*(t.length-1),chainID:g[m],args:[s()]})},to=(r,e,t)=>r.call({func:new o.ContractFunction(jr),gasLimit:e+445e3*(t-1),chainID:g[m]}),no=(r,e,t)=>r.call({func:new o.ContractFunction(Br),gasLimit:e,chainID:g[m],args:[new o.AddressValue(new o.Address(t))]});var ce=()=>l(void 0,null,function*(){let r=F(As,{isJSON:!1}),e=xe(),t=yield Fs(r),s=yield e.getAccount(t.address);return t.update(s),{signer:Ds(r),userAccount:t,provider:e}}),b=r=>l(void 0,null,function*(){let e=yield Os(xs,ks),t=yield Rs(vs,Ss),s=Ls(e,r),a=yield ce();return P({scWasmCode:t,smartContract:s},a)});var pe=require("@elrondnetwork/erdjs/out"),Go=()=>l(void 0,null,function*(){F(E,{noExitOnError:!0})&&(0,ro.unlinkSync)(`${ie}/${E}`);let e=[{type:"select",name:"nftSCupgradable",message:ps,choices:[{title:"Yes",value:!0},{title:"No",value:!1}]},{type:"select",name:"nftSCreadable",message:ms,choices:[{title:"No",value:!1},{title:"Yes",value:!0}]},{type:"select",name:"nftSCpayable",message:us,choices:[{title:"Yes",value:!0},{title:"No",value:!1}]},{type:"text",name:"deployNftMinterImgCid",message:ee,validate:s=>s?!0:"Required!"},{type:"text",name:"deployNftMinterMetaCid",message:te,validate:s=>s?!0:"Required!"},{type:"select",name:"metadataInAssets",message:fs,choices:[{title:"No",value:!1},{title:"Yes",value:!0}]},{type:"select",name:"deployNftMinterImgExt",message:os,choices:[{title:".png",value:".png"},{title:".jpg",value:".jpg"},{title:".gif",value:".gif"},{title:".mp3",value:".mp3"},{title:".mp4",value:".mp4"}]},{type:"number",name:"deployNftMinterAmountOfTokens",message:ts,min:1,validate:s=>!s||s<1?"Required and min 1!":!0},{type:"text",name:"deployNftMinterSellingPrice",message:ne,validate:s=>!Number(s)||Number(s)<=0?"Required and min 0!":!0},{type:"number",name:"deployNftMinterTokensLimitPerAddress",message:re,validate:s=>s&&s>=1?!0:"Min 1!"},{type:"number",name:"deployNftMinterRoyalties",message:ns,min:0,max:100,validate:s=>s>=0&&s<=100||!s?!0:"Should be a number in range 0-100"},{type:"text",name:"deployNftMinterTags",message:rs},{type:"text",name:"deployNftMinterProvenanceHash",message:ss}],t=(0,so.default)("Processing the transaction...");try{let{scWasmCode:s,smartContract:a,userAccount:i,signer:d,provider:c}=yield b(),{deployNftMinterImgCid:p,deployNftMinterImgExt:N,deployNftMinterMetaCid:w,deployNftMinterAmountOfTokens:M,deployNftMinterTokensLimitPerAddress:z,deployNftMinterSellingPrice:D,deployNftMinterRoyalties:H,deployNftMinterTags:G,deployNftMinterProvenanceHash:Q,nftSCupgradable:x,nftSCreadable:y,nftSCpayable:O,metadataInAssets:R}=yield(0,oo.default)(e);yield v(),(!p||!w||!M||!D)&&(console.log("You have to provide CIDs, amount of tokens and selling price!"),(0,de.exit)(9));let L=Cs(s,a,Zn,p,N,w,M,z,D,H,G,Q,x,y,O,R);L.setNonce(i.nonce),i.incrementNonce(),d.sign(L),t.start();let S=pe.SmartContract.computeAddress(L.getSender(),L.getNonce());a.setAddress(S),yield c.sendTransaction(L);let ue=yield new pe.TransactionWatcher(c).awaitCompleted(L),ge=ue.status,C=ue.hash;t.stop(),console.log(`
Deployment transaction executed: ${ge}`),console.log(`Deployment tx: ${X[m]}/transactions/${C}
`),console.log(`Smart Contract address: ${S}
`),le({scAddress:S,sellingPrice:D})}catch(s){t.stop(),console.log(s==null?void 0:s.message)}}),ao=r=>l(void 0,null,function*(){let e={nftMinter:"nft-minter"};(r==="-h"||r==="--help")&&(console.log(`========================
Available commands:
========================
${Object.values(e).join(`
`)}`),(0,pe.exit)(9)),(!r||!Object.values(e).includes(r))&&(console.log(`===========================================================
`)}`),(0,de.exit)(9)),(!r||!Object.values(e).includes(r))&&(console.log(`===========================================================
Plaese provide a proper deploy command. Available commands:
===========================================================
${Object.values(e).join(`
`)}`),(0,pe.exit)(9)),r===e.nftMinter&&na()});var lo=require("@elrondnetwork/erdjs"),Le=A(require("cross-fetch")),co=require("buffer"),po=A(require("fs")),Y=require("process"),mo=A(require("ora")),uo=A(require("p-throttle")),go=A(require("prompts"));var Pe=100,Me=(0,mo.default)("Processing, please wait..."),ra=r=>{var t,s,a;let e=r?co.Buffer.from(r,"base64").toString():void 0;return e?(a=(s=(t=e.split(";").filter(i=>i.includes("metadata")))==null?void 0:t[0].split("/"))==null?void 0:s[1].split("."))==null?void 0:a[0]:""},fo=()=>l(void 0,null,function*(){let r="",e=[{type:"text",name:"collectionTicker",message:hs,validate:t=>t?!0:"Required!"},{type:"select",name:"noSmartContracts",message:bs,choices:[{title:"Yes",value:!0},{title:"No",value:!1}]},{type:"list",name:"fileNamesList",message:Ns}];try{let{collectionTicker:t,noSmartContracts:s,fileNamesList:a}=yield(0,go.default)(e);t||(console.log("You have to provide CIDs, amount of tokens and selling price!"),(0,Y.exit)(9));let i=[];r=yield(yield(0,Le.default)(`${H[m]}/collections/${t}/nfts/count`)).text(),console.log(`There are ${r} tokens in that collection.`),Number(r)===0&&(console.log(`
`)}`),(0,de.exit)(9)),r===e.nftMinter&&Go()});var io=require("@elrondnetwork/erdjs"),Me=A(require("cross-fetch")),lo=require("buffer"),co=A(require("fs")),K=require("process"),po=A(require("ora")),mo=A(require("p-throttle")),uo=A(require("prompts"));var Se=100,Pe=(0,po.default)("Processing, please wait..."),Qo=r=>{var t,s,a;let e=r?lo.Buffer.from(r,"base64").toString():void 0;return e?(a=(s=(t=e.split(";").filter(i=>i.includes("metadata")))==null?void 0:t[0].split("/"))==null?void 0:s[1].split("."))==null?void 0:a[0]:""},go=()=>l(void 0,null,function*(){let r="",e=[{type:"text",name:"collectionTicker",message:ys,validate:t=>t?!0:"Required!"},{type:"select",name:"noSmartContracts",message:hs,choices:[{title:"Yes",value:!0},{title:"No",value:!1}]},{type:"list",name:"fileNamesList",message:bs}];try{let{collectionTicker:t,noSmartContracts:s,fileNamesList:a}=yield(0,uo.default)(e);t||(console.log("You have to provide CIDs, amount of tokens and selling price!"),(0,K.exit)(9));let i=[];r=yield(yield(0,Me.default)(`${_[m]}/collections/${t}/nfts/count`)).text(),console.log(`There are ${r} tokens in that collection.`),Number(r)===0&&(console.log(`
There are no tokens. Please check if you configured the proper chain. By default, it will be the devnet. You can change it using the .elventoolsrc configuration file.
`),(0,Y.exit)(9)),Me.start();let p=yield(()=>new Promise(x=>{let y=Math.ceil(Number(r)/Pe),R=(0,uo.default)({limit:_r,interval:1e3}),C=0,F=R(P=>l(void 0,null,function*(){let fe=(yield(yield(0,Le.default)(`${H[m]}/collections/${t}/nfts?withOwner=true&from=${P*Pe}&size=${Pe}`)).json()).map(I=>({owner:I.owner,identifier:I.identifier,metadataFileName:ra(I.attributes)}));if(P>=Math.ceil(y/2)&&(Me.text="Almost there..."),i.push(fe),C>=y-1){Me.stop();let I=i.flat();return x(I)}C<y&&C++}));for(let P=0;P<y;P++)l(void 0,null,function*(){return F(P)})}))();s&&(p=p.filter(x=>typeof x.owner=="string"&&!lo.Address.fromString(x.owner).isContractAddress()));let N=p.length,w="";N===0&&(console.log("No addresses found!"),(0,Y.exit)(9));let L=(x,y,R)=>R.findIndex(C=>C.owner===x.owner)===y,W=p.filter(L),O=x=>p.filter(y=>y.owner===x.owner).map(y=>({identifier:y.identifier,metadataFileName:y.metadataFileName})),Q=W.map(x=>{let y=O(x);return{owner:x.owner,tokens:y,tokensCount:y.length}}).sort((x,y)=>y.tokensCount-x.tokensCount),U=Q;a!=null&&a[0]&&(U=Q.filter(x=>a.some(y=>x.tokens.findIndex(R=>R.metadataFileName===y)>-1))),U&&po.default.writeFileSync(`${(0,Y.cwd)()}/nft-collection-owners.json`,JSON.stringify(U,null,2),"utf8"),s&&(w=`${s?" Without smart contract addresses.":""}`),console.log(`Done, ${U.length} addresses saved.${w}`),console.log("Check the nft-collection-owners.json file"),console.log(`You can also export them to CSV using:
https://github.com/ElvenTools/elven-tools-collection-owners-csv`)}catch(t){console.log(t==null?void 0:t.message)}});var wo=A(require("fs")),yo=require("@elrondnetwork/erdjs-walletcore"),ho=A(require("prompts")),ue=require("process");var bo=()=>l(void 0,null,function*(){let r=[{type:"text",name:"seed",message:Zr,validate:e=>e?!0:"Required!"}];try{let{seed:e}=yield(0,ho.default)(r);e||(console.log("You have to provide the seed phrase value!"),(0,ue.exit)());let s=yo.Mnemonic.fromString(e).deriveKey(),a=s.hex(),i=s.generatePublicKey().hex(),d=Buffer.from(a+i).toString("base64"),c=s.generatePublicKey().toAddress().bech32(),p=`-----BEGIN PRIVATE KEY for ${c}-----`,N=`-----END PRIVATE KEY for ${c}-----`,w=`${p}
`),(0,K.exit)(9)),Pe.start();let p=yield(()=>new Promise(x=>{let y=Math.ceil(Number(r)/Se),O=(0,mo.default)({limit:Wr,interval:1e3}),R=0,L=O(S=>l(void 0,null,function*(){let ge=(yield(yield(0,Me.default)(`${_[m]}/collections/${t}/nfts?withOwner=true&from=${S*Se}&size=${Se}`)).json()).map(C=>({owner:C.owner,identifier:C.identifier,metadataFileName:Qo(C.attributes)}));if(S>=Math.ceil(y/2)&&(Pe.text="Almost there..."),i.push(ge),R>=y-1){Pe.stop();let C=i.flat();return x(C)}R<y&&R++}));for(let S=0;S<y;S++)l(void 0,null,function*(){return L(S)})}))();s&&(p=p.filter(x=>typeof x.owner=="string"&&!io.Address.fromString(x.owner).isContractAddress()));let N=p.length,w="";N===0&&(console.log("No addresses found!"),(0,K.exit)(9));let M=(x,y,O)=>O.findIndex(R=>R.owner===x.owner)===y,z=p.filter(M),D=x=>p.filter(y=>y.owner===x.owner).map(y=>({identifier:y.identifier,metadataFileName:y.metadataFileName})),G=z.map(x=>{let y=D(x);return{owner:x.owner,tokens:y,tokensCount:y.length}}).sort((x,y)=>y.tokensCount-x.tokensCount),Q=G;a!=null&&a[0]&&(Q=G.filter(x=>a.some(y=>x.tokens.findIndex(O=>O.metadataFileName===y)>-1))),Q&&co.default.writeFileSync(`${(0,K.cwd)()}/nft-collection-owners.json`,JSON.stringify(Q,null,2),"utf8"),s&&(w=`${s?" Without smart contract addresses.":""}`),console.log(`Done, ${Q.length} addresses saved.${w}`),console.log("Check the nft-collection-owners.json file"),console.log(`You can also export them to CSV using:
https://github.com/ElvenTools/elven-tools-collection-owners-csv`)}catch(t){console.log(t==null?void 0:t.message)}});var fo=A(require("fs")),wo=require("@elrondnetwork/erdjs-walletcore"),yo=A(require("prompts")),me=require("process");var ho=()=>l(void 0,null,function*(){let r=[{type:"text",name:"seed",message:Hr,validate:e=>e?!0:"Required!"}];try{let{seed:e}=yield(0,yo.default)(r);e||(console.log("You have to provide the seed phrase value!"),(0,me.exit)());let s=wo.Mnemonic.fromString(e).deriveKey(),a=s.hex(),i=s.generatePublicKey().hex(),d=Buffer.from(a+i).toString("base64"),c=s.generatePublicKey().toAddress().bech32(),p=`-----BEGIN PRIVATE KEY for ${c}-----`,N=`-----END PRIVATE KEY for ${c}-----`,w=`${p}
${d.replace(/([^\n]{1,64})/g,`$1
`)}${N}`;wo.default.writeFileSync("walletKey.pem",w),console.log("File saved as walletKey.pem"),(0,ue.exit)()}catch(e){console.log(e.message),(0,ue.exit)()}});var No=A(require("ora")),S=A(require("prompts"));var V=require("process"),sa=()=>l(void 0,null,function*(){let r=f(),e=[{type:"text",name:"tokenName",message:Xr,validate:s=>s?s.length>20||s.length<3?"Length between 3 and 20 characters!":new RegExp(/^[a-zA-Z0-9]+$/).test(s)?!0:"Alphanumeric characters only!":"Required!"},{type:"text",name:"tokenTicker",message:es,validate:s=>s?s.length>10||s.length<3?"Length between 3 and 10 characters!":new RegExp(/^[A-Z0-9]+$/).test(s)?!0:"Alphanumeric UPPERCASE only!":"Required!"},{type:"text",name:"nftTokenName",message:ts}],t=(0,No.default)("Processing the transaction...");try{let{tokenName:s,tokenTicker:a,nftTokenName:i}=yield(0,S.default)(e);(!s||!a)&&(console.log("You have to provide the token name and ticker value!"),(0,V.exit)(9));let{smartContract:d,userAccount:c,signer:p,provider:N}=yield b(r),w=Es(d,tr,nr,s,a,i);yield h(w,c,p,N)}catch(s){t.stop(),console.log(s==null?void 0:s.message)}}),oa=()=>l(void 0,null,function*(){let r=f();try{let{smartContract:e,userAccount:t,signer:s,provider:a}=yield b(r),i=js(e,rr);yield h(i,t,s,a)}catch(e){console.log(e==null?void 0:e.message)}}),aa=()=>l(void 0,null,function*(){let r=f(),e=[{type:"number",name:"tokensAmount",message:is,validate:t=>t&&t>0&&t<=E?!0:`Required a number greater than 0 and lower than ${E} because of the max gas limits!`}];try{let{tokensAmount:t}=yield(0,S.default)(e);yield k();let{userAccount:s,signer:a,provider:i}=yield de(),d=$s(r,ar,Number(t));yield h(d,s,a,i)}catch(t){console.log(t==null?void 0:t.message)}}),ia=()=>l(void 0,null,function*(){let r=f(),e=[{type:"text",name:"giveawayAddress",message:ls,validate:t=>t?!0:"Required!"},{type:"number",name:"giveawayTokensAmount",message:cs,validate:t=>t&&t>0&&t<=E?!0:`Required a number greater than 0 and lower than ${E} because of the max gas limits!`}];try{let{giveawayAddress:t,giveawayTokensAmount:s}=yield(0,S.default)(e);t||(console.log("You have to provide the give away address!"),(0,V.exit)(9)),yield k();let{smartContract:a,userAccount:i,signer:d,provider:c}=yield b(r),p=Bs(a,cr,t,Number(s));yield h(p,i,d,c)}catch(t){console.log(t==null?void 0:t.message)}}),la=()=>l(void 0,null,function*(){let r=[{type:"number",name:"dropTokensAmount",message:ds,validate:t=>t?!0:"Required!"},{type:"number",name:"dropTokensLimitPerAddressPerDrop",message:fs}],e=f();try{let{dropTokensAmount:t,dropTokensLimitPerAddressPerDrop:s}=yield(0,S.default)(r),{smartContract:a,userAccount:i,signer:d,provider:c}=yield b(e),p=Gs(a,ye,t,s);yield h(p,i,d,c)}catch(t){console.log(t==null?void 0:t.message)}}),ca=()=>l(void 0,null,function*(){let r=f();try{let{smartContract:e,userAccount:t,signer:s,provider:a}=yield b(r),i=Qs(e,ye);yield h(i,t,s,a)}catch(e){console.log(e==null?void 0:e.message)}}),da=()=>l(void 0,null,function*(){let r=f();try{yield k();let{smartContract:e,userAccount:t,signer:s,provider:a}=yield b(r),i=Us(e,he);yield h(i,t,s,a)}catch(e){console.log(e==null?void 0:e.message)}}),pa=()=>l(void 0,null,function*(){let r=f();try{yield k();let{smartContract:e,userAccount:t,signer:s,provider:a}=yield b(r),i=qs(e,he);yield h(i,t,s,a)}catch(e){console.log(e==null?void 0:e.message)}}),ma=()=>l(void 0,null,function*(){let r=[{type:"text",name:"newPrice",message:re,validate:t=>!Number(t)||Number(t)<=0?"Required and min 0!":!0}],e=f();try{let{newPrice:t}=yield(0,S.default)(r);yield k();let{smartContract:s,userAccount:a,signer:i,provider:d}=yield b(e),c=Vs(s,fr,t);yield h(c,a,i,d),ce({sellingPrice:t})}catch(t){console.log(t==null?void 0:t.message)}}),ua=()=>l(void 0,null,function*(){let r=f();try{let{smartContract:e,userAccount:t,signer:s,provider:a}=yield b(r),i=Js(e,t);yield h(i,t,s,a)}catch(e){console.log(e==null?void 0:e.message)}}),ga=()=>l(void 0,null,function*(){let r=f();try{let{userAccount:e,signer:t,provider:s}=yield de(),a=zs(r,hr);yield h(a,e,t,s)}catch(e){console.log(e==null?void 0:e.message)}}),fa=()=>l(void 0,null,function*(){let r=[{type:"text",name:"nftMinterImgCid",message:te,validate:t=>t?!0:"Required!"},{type:"text",name:"nftMinterMetaCid",message:ne,validate:t=>t?!0:"Required!"}],e=f();try{let{nftMinterImgCid:t,nftMinterMetaCid:s}=yield(0,S.default)(r);yield k();let{smartContract:a,userAccount:i,signer:d,provider:c}=yield b(e),p=Zs(a,Lr,t,s);yield h(p,i,d,c)}catch(t){console.log(t==null?void 0:t.message)}}),wa=()=>l(void 0,null,function*(){let r=[{type:"number",name:"nftMinterTokensLimitPerAddress",message:se,validate:t=>t&&t>=1?!0:"Minimum 1!"}],e=f();try{let{nftMinterTokensLimitPerAddress:t}=yield(0,S.default)(r);yield k();let{smartContract:s,userAccount:a,signer:i,provider:d}=yield b(e),c=Xs(s,Dr,t);yield h(c,a,i,d)}catch(t){console.log(t==null?void 0:t.message)}}),ya=()=>l(void 0,null,function*(){let r=f();try{yield k();let{smartContract:e,userAccount:t,signer:s,provider:a}=yield b(r),i=Ks(e,Ne);yield h(i,t,s,a)}catch(e){console.log(e==null?void 0:e.message)}}),ha=()=>l(void 0,null,function*(){let r=f();try{yield k();let{smartContract:e,userAccount:t,signer:s,provider:a}=yield b(r),i=Ys(e,Ne);yield h(i,t,s,a)}catch(e){console.log(e==null?void 0:e.message)}}),ba=()=>l(void 0,null,function*(){let r=[{type:"text",name:"address",message:`Provide the address:
`,validate:e=>e?!0:"Required!"}];try{let{address:e}=yield(0,S.default)(r);Ws(e)}catch(e){console.log(e==null?void 0:e.message)}}),Na=()=>l(void 0,null,function*(){let r=[{type:"text",name:"address",message:`Provide the address:
`,validate:e=>e?!0:"Required!"}];try{let{address:e}=yield(0,S.default)(r);_s(e)}catch(e){console.log(e==null?void 0:e.message)}}),Ta=()=>l(void 0,null,function*(){let r=f();try{let{smartContract:e,userAccount:t,signer:s,provider:a}=yield b(r),i=eo(e,Rr);yield h(i,t,s,a)}catch(e){console.log(e==null?void 0:e.message)}}),Aa=()=>l(void 0,null,function*(){let r=f(),e=[{type:"list",name:"addressesList",message:ys,validate:t=>t&&t.length>0?!0:"Required at least one address!"}];try{let{smartContract:t,userAccount:s,signer:a,provider:i}=yield b(r),d=D(Ms,{noExitOnError:!0}),c=[];if(d)console.log(" "),console.log(`Populating addresses from the file: allowlist.json (max ${K} addresses per file/transaction).`),console.log(" "),yield k(),c=d;else{console.log(" "),console.log("There is no allowlist.json file with the addresses."),console.log("You will be providing addresses by hand."),console.log(" "),yield k();let{addressesList:N}=yield(0,S.default)(e);c=N}Array.isArray(c)&&c.length>K&&(console.log(`The amount of addresses is more than ${K}. Please split it into batches with a max of ${K} addresses per transaction.`),(0,V.exit)(9));let p=to(t,jr,c);yield h(p,s,a,i)}catch(t){console.log(t==null?void 0:t.message)}}),xa=()=>l(void 0,null,function*(){let r=f();try{yield k();let{smartContract:e,userAccount:t,signer:s,provider:a}=yield b(r),i=yield ke(be,r,a),d=no(e,Br,Number(Se(i)));yield h(d,t,s,a)}catch(e){console.log(e==null?void 0:e.message)}}),va=()=>l(void 0,null,function*(){let r=f(),e=[{type:"text",name:"address",message:As,validate:t=>t?!0:"Required!"}];try{let{address:t}=yield(0,S.default)(e);yield k();let{smartContract:s,userAccount:a,signer:i,provider:d}=yield b(r),c=ro(s,Qr,t);yield h(c,a,i,d)}catch(t){console.log(t==null?void 0:t.message)}}),ka=()=>l(void 0,null,function*(){let r=[{type:"text",name:"address",message:`Provide the address to check if it is included in the allowlist:
`,validate:e=>e?!0:"Required!"}];try{let{address:e}=yield(0,S.default)(r);Hs(e)}catch(e){console.log(e==null?void 0:e.message)}}),To=r=>l(void 0,null,function*(){let e={issueCollectionToken:"issue-collection-token",setLocalRoles:"set-roles",mint:"mint",giveaway:"giveaway",claimScFunds:"claim-sc-funds",setDrop:"set-drop",unsetDrop:"unset-drop",pauseMinting:"pause-minting",startMinting:"start-minting",setNewPrice:"set-new-price",claimDevRewards:"claim-dev-rewards",shuffle:"shuffle",populateAllowlist:"populate-allowlist",clearAllowlist:"clear-allowlist",removeAllowlistAddress:"remove-allowlist-address",enableAllowlist:"enable-allowlist",disableAllowlist:"disable-allowlist",changeBaseCids:"change-base-cids",setNewTokensLimitPerAddress:"set-new-tokens-limit-per-address",getTotalTokensLeft:"get-total-tokens-left",getProvenanceHash:"get-provenance-hash",getDropTokensLeft:"get-drop-tokens-left",getNftPrice:"get-nft-price",getNftTokenId:"get-nft-token-id",getNftTokenName:"get-nft-token-name",getCollectionTokenName:"get-collection-token-name",getTokensLimitPerAddressTotal:"get-tokens-limit-per-address-total",getMintedPerAddressTotal:"get-minted-per-address-total",getMintedPerAddressPerDrop:"get-minted-per-address-per-drop",getTokensLimitPerAddressPerDrop:"get-tokens-limit-per-address-per-drop",getAllowlistSize:"get-allowlist-size",isAllowlistEnabled:"is-allowlist-enabled",getAllowlistAddressCheck:"get-allowlist-address-check",isDropActive:"is-drop-active",isMintingPaused:"is-minting-paused",getTotalSupply:"get-total-supply",getTotalSupplyOfCurrentDrop:"get-total-supply-of-current-drop"};switch((r==="-h"||r==="--help")&&(console.log(`========================
`)}${N}`;fo.default.writeFileSync("walletKey.pem",w),console.log("File saved as walletKey.pem"),(0,me.exit)()}catch(e){console.log(e.message),(0,me.exit)()}});var bo=A(require("ora")),k=A(require("prompts"));var Y=require("process"),Uo=()=>l(void 0,null,function*(){let r=f(),e=[{type:"text",name:"tokenName",message:Zr,validate:s=>s?s.length>20||s.length<3?"Length between 3 and 20 characters!":new RegExp(/^[a-zA-Z0-9]+$/).test(s)?!0:"Alphanumeric characters only!":"Required!"},{type:"text",name:"tokenTicker",message:Xr,validate:s=>s?s.length>10||s.length<3?"Length between 3 and 10 characters!":new RegExp(/^[A-Z0-9]+$/).test(s)?!0:"Alphanumeric UPPERCASE only!":"Required!"},{type:"text",name:"nftTokenName",message:es}],t=(0,bo.default)("Processing the transaction...");try{let{tokenName:s,tokenTicker:a,nftTokenName:i}=yield(0,k.default)(e);(!s||!a)&&(console.log("You have to provide the token name and ticker value!"),(0,Y.exit)(9));let{smartContract:d,userAccount:c,signer:p,provider:N}=yield b(r),w=Is(d,er,tr,s,a,i);yield h(w,c,p,N)}catch(s){t.stop(),console.log(s==null?void 0:s.message)}}),qo=()=>l(void 0,null,function*(){let r=f();try{let{smartContract:e,userAccount:t,signer:s,provider:a}=yield b(r),i=Es(e,nr);yield h(i,t,s,a)}catch(e){console.log(e==null?void 0:e.message)}}),Ko=()=>l(void 0,null,function*(){let r=f(),e=[{type:"number",name:"tokensAmount",message:as,validate:t=>t&&t>0&&t<=I?!0:`Required a number greater than 0 and lower than ${I} because of the max gas limits!`}];try{let{tokensAmount:t}=yield(0,k.default)(e);yield v();let{userAccount:s,signer:a,provider:i}=yield ce(),d=js(r,or,Number(t));yield h(d,s,a,i)}catch(t){console.log(t==null?void 0:t.message)}}),Yo=()=>l(void 0,null,function*(){let r=f(),e=[{type:"text",name:"giveawayAddress",message:is,validate:t=>t?!0:"Required!"},{type:"number",name:"giveawayTokensAmount",message:ls,validate:t=>t&&t>0&&t<=I?!0:`Required a number greater than 0 and lower than ${I} because of the max gas limits!`}];try{let{giveawayAddress:t,giveawayTokensAmount:s}=yield(0,k.default)(e);t||(console.log("You have to provide the give away address!"),(0,Y.exit)(9)),yield v();let{smartContract:a,userAccount:i,signer:d,provider:c}=yield b(r),p=$s(a,lr,t,Number(s));yield h(p,i,d,c)}catch(t){console.log(t==null?void 0:t.message)}}),Vo=()=>l(void 0,null,function*(){let r=[{type:"number",name:"dropTokensAmount",message:cs,validate:t=>t?!0:"Required!"},{type:"number",name:"dropTokensLimitPerAddressPerDrop",message:gs}],e=f();try{let{dropTokensAmount:t,dropTokensLimitPerAddressPerDrop:s}=yield(0,k.default)(r),{smartContract:a,userAccount:i,signer:d,provider:c}=yield b(e),p=Bs(a,we,t,s);yield h(p,i,d,c)}catch(t){console.log(t==null?void 0:t.message)}}),Jo=()=>l(void 0,null,function*(){let r=f();try{let{smartContract:e,userAccount:t,signer:s,provider:a}=yield b(r),i=Gs(e,we);yield h(i,t,s,a)}catch(e){console.log(e==null?void 0:e.message)}}),zo=()=>l(void 0,null,function*(){let r=f();try{yield v();let{smartContract:e,userAccount:t,signer:s,provider:a}=yield b(r),i=Qs(e,ye);yield h(i,t,s,a)}catch(e){console.log(e==null?void 0:e.message)}}),Wo=()=>l(void 0,null,function*(){let r=f();try{yield v();let{smartContract:e,userAccount:t,signer:s,provider:a}=yield b(r),i=Us(e,ye);yield h(i,t,s,a)}catch(e){console.log(e==null?void 0:e.message)}}),_o=()=>l(void 0,null,function*(){let r=[{type:"text",name:"newPrice",message:ne,validate:t=>!Number(t)||Number(t)<=0?"Required and min 0!":!0}],e=f();try{let{newPrice:t}=yield(0,k.default)(r);yield v();let{smartContract:s,userAccount:a,signer:i,provider:d}=yield b(e),c=Ys(s,gr,t);yield h(c,a,i,d),le({sellingPrice:t})}catch(t){console.log(t==null?void 0:t.message)}}),Ho=()=>l(void 0,null,function*(){let r=f();try{let{smartContract:e,userAccount:t,signer:s,provider:a}=yield b(r),i=Vs(e,t);yield h(i,t,s,a)}catch(e){console.log(e==null?void 0:e.message)}}),Zo=()=>l(void 0,null,function*(){let r=f();try{let{userAccount:e,signer:t,provider:s}=yield ce(),a=Js(r,yr);yield h(a,e,t,s)}catch(e){console.log(e==null?void 0:e.message)}}),Xo=()=>l(void 0,null,function*(){let r=[{type:"text",name:"nftMinterImgCid",message:ee,validate:t=>t?!0:"Required!"},{type:"text",name:"nftMinterMetaCid",message:te,validate:t=>t?!0:"Required!"}],e=f();try{let{nftMinterImgCid:t,nftMinterMetaCid:s}=yield(0,k.default)(r);yield v();let{smartContract:a,userAccount:i,signer:d,provider:c}=yield b(e),p=Hs(a,Mr,t,s);yield h(p,i,d,c)}catch(t){console.log(t==null?void 0:t.message)}}),ea=()=>l(void 0,null,function*(){let r=[{type:"number",name:"nftMinterTokensLimitPerAddress",message:re,validate:t=>t&&t>=1?!0:"Minimum 1!"}],e=f();try{let{nftMinterTokensLimitPerAddress:t}=yield(0,k.default)(r);yield v();let{smartContract:s,userAccount:a,signer:i,provider:d}=yield b(e),c=Zs(s,Fr,t);yield h(c,a,i,d)}catch(t){console.log(t==null?void 0:t.message)}}),ta=()=>l(void 0,null,function*(){let r=f();try{yield v();let{smartContract:e,userAccount:t,signer:s,provider:a}=yield b(r),i=qs(e,be);yield h(i,t,s,a)}catch(e){console.log(e==null?void 0:e.message)}}),na=()=>l(void 0,null,function*(){let r=f();try{yield v();let{smartContract:e,userAccount:t,signer:s,provider:a}=yield b(r),i=Ks(e,be);yield h(i,t,s,a)}catch(e){console.log(e==null?void 0:e.message)}}),ra=()=>l(void 0,null,function*(){let r=[{type:"text",name:"address",message:`Provide the address:
`,validate:e=>e?!0:"Required!"}];try{let{address:e}=yield(0,k.default)(r);zs(e)}catch(e){console.log(e==null?void 0:e.message)}}),sa=()=>l(void 0,null,function*(){let r=[{type:"text",name:"address",message:`Provide the address:
`,validate:e=>e?!0:"Required!"}];try{let{address:e}=yield(0,k.default)(r);Ws(e)}catch(e){console.log(e==null?void 0:e.message)}}),oa=()=>l(void 0,null,function*(){let r=f();try{let{smartContract:e,userAccount:t,signer:s,provider:a}=yield b(r),i=Xs(e,Or);yield h(i,t,s,a)}catch(e){console.log(e==null?void 0:e.message)}}),aa=()=>l(void 0,null,function*(){let r=f(),e=[{type:"list",name:"addressesList",message:ws,validate:t=>t&&t.length>0?!0:"Required at least one address!"}];try{let{smartContract:t,userAccount:s,signer:a,provider:i}=yield b(r),d=F(Ps,{noExitOnError:!0}),c=[];if(d)console.log(" "),console.log(`Populating addresses from the file: allowlist.json (max ${q} addresses per file/transaction).`),console.log(" "),yield v(),c=d;else{console.log(" "),console.log("There is no allowlist.json file with the addresses."),console.log("You will be providing addresses by hand."),console.log(" "),yield v();let{addressesList:N}=yield(0,k.default)(e);c=N}Array.isArray(c)&&c.length>q&&(console.log(`The amount of addresses is more than ${q}. Please split it into batches with a max of ${q} addresses per transaction.`),(0,Y.exit)(9));let p=eo(t,Er,c);yield h(p,s,a,i)}catch(t){console.log(t==null?void 0:t.message)}}),ia=()=>l(void 0,null,function*(){let r=f();try{yield v();let{smartContract:e,userAccount:t,signer:s,provider:a}=yield b(r),i=yield ve(he,r,a),d=to(e,$r,Number(ke(i)));yield h(d,t,s,a)}catch(e){console.log(e==null?void 0:e.message)}}),la=()=>l(void 0,null,function*(){let r=f(),e=[{type:"text",name:"address",message:Ts,validate:t=>t?!0:"Required!"}];try{let{address:t}=yield(0,k.default)(e);yield v();let{smartContract:s,userAccount:a,signer:i,provider:d}=yield b(r),c=no(s,Gr,t);yield h(c,a,i,d)}catch(t){console.log(t==null?void 0:t.message)}}),ca=()=>l(void 0,null,function*(){let r=[{type:"text",name:"address",message:`Provide the address to check if it is included in the allowlist:
`,validate:e=>e?!0:"Required!"}];try{let{address:e}=yield(0,k.default)(r);_s(e)}catch(e){console.log(e==null?void 0:e.message)}}),No=r=>l(void 0,null,function*(){let e={issueCollectionToken:"issue-collection-token",setLocalRoles:"set-roles",mint:"mint",giveaway:"giveaway",claimScFunds:"claim-sc-funds",setDrop:"set-drop",unsetDrop:"unset-drop",pauseMinting:"pause-minting",startMinting:"start-minting",setNewPrice:"set-new-price",claimDevRewards:"claim-dev-rewards",shuffle:"shuffle",populateAllowlist:"populate-allowlist",clearAllowlist:"clear-allowlist",removeAllowlistAddress:"remove-allowlist-address",enableAllowlist:"enable-allowlist",disableAllowlist:"disable-allowlist",changeBaseCids:"change-base-cids",setNewTokensLimitPerAddress:"set-new-tokens-limit-per-address",getTotalTokensLeft:"get-total-tokens-left",getProvenanceHash:"get-provenance-hash",getDropTokensLeft:"get-drop-tokens-left",getNftPrice:"get-nft-price",getNftTokenId:"get-nft-token-id",getNftTokenName:"get-nft-token-name",getCollectionTokenName:"get-collection-token-name",getTokensLimitPerAddressTotal:"get-tokens-limit-per-address-total",getMintedPerAddressTotal:"get-minted-per-address-total",getMintedPerAddressPerDrop:"get-minted-per-address-per-drop",getTokensLimitPerAddressPerDrop:"get-tokens-limit-per-address-per-drop",getAllowlistSize:"get-allowlist-size",isAllowlistEnabled:"is-allowlist-enabled",getAllowlistAddressCheck:"get-allowlist-address-check",isDropActive:"is-drop-active",isMintingPaused:"is-minting-paused",getTotalSupply:"get-total-supply",getTotalSupplyOfCurrentDrop:"get-total-supply-of-current-drop"};switch((r==="-h"||r==="--help")&&(console.log(`========================
Available commands:
========================
${Object.values(e).join(`
`)}`),(0,V.exit)(9)),(!r||!Object.values(e).includes(r))&&(console.log(`====================================================
`)}`),(0,Y.exit)(9)),(!r||!Object.values(e).includes(r))&&(console.log(`====================================================
Plaese provide a proper command. Available commands:
====================================================
${Object.values(e).join(`
`)}`),(0,V.exit)(9)),r){case e.issueCollectionToken:sa();break;case e.setLocalRoles:oa();break;case e.mint:aa();break;case e.giveaway:ia();break;case e.setDrop:la();break;case e.unsetDrop:ca();break;case e.pauseMinting:da();break;case e.startMinting:pa();break;case e.setNewPrice:ma();break;case e.claimDevRewards:ua();break;case e.shuffle:ga();break;case e.populateAllowlist:Aa();break;case e.clearAllowlist:xa();break;case e.removeAllowlistAddress:va();break;case e.enableAllowlist:ya();break;case e.disableAllowlist:ha();break;case e.changeBaseCids:fa();break;case e.setNewTokensLimitPerAddress:wa();break;case e.claimScFunds:Ta();break;case e.getTotalTokensLeft:T({functionName:br,resultLabel:"Total tokens left:",resultType:"number"});break;case e.getProvenanceHash:T({functionName:Nr,resultLabel:"Provenance hash of the collection:",resultType:"string"});break;case e.getDropTokensLeft:T({functionName:Tr,resultLabel:"Tokens left for the current drop:",resultType:"number"});break;case e.getNftPrice:T({functionName:Ar,resultLabel:"Current NFT price is:",resultType:"number"});break;case e.getNftTokenId:T({functionName:xr,resultLabel:"NFT token id:",resultType:"string"});break;case e.getNftTokenName:T({functionName:vr,resultLabel:"NFT token name:",resultType:"string"});break;case e.getCollectionTokenName:T({functionName:kr,resultLabel:"Collection token name:",resultType:"string"});break;case e.getTokensLimitPerAddressTotal:T({functionName:Sr,resultLabel:"Tokens limit per address:",resultType:"number"});break;case e.getMintedPerAddressPerDrop:Na();break;case e.getTokensLimitPerAddressPerDrop:T({functionName:Ir,resultLabel:"Tokens limit per address per current drop:",resultType:"number"});break;case e.getMintedPerAddressTotal:ba();break;case e.getAllowlistSize:T({functionName:be,resultLabel:"Total size of the Allowlist:",resultType:"number"});break;case e.isAllowlistEnabled:T({functionName:Ur,resultLabel:"Result:",resultModifier:t=>t==="true"?"The allowlist is enabled!":"The allowlist is disabled!",resultType:"boolean"});break;case e.getAllowlistAddressCheck:ka();break;case e.isDropActive:T({functionName:Vr,resultLabel:"Result:",resultModifier:t=>t==="true"?"The drop is active!":"The drop is not active!",resultType:"boolean"});break;case e.isMintingPaused:T({functionName:Jr,resultLabel:"Result:",resultModifier:t=>t==="true"?"The minting is paused!":"The minting is not paused!",resultType:"boolean"});break;case e.getTotalSupply:T({functionName:zr,resultLabel:"Total supply of the collection:",resultType:"number"});break;case e.getTotalSupplyOfCurrentDrop:T({functionName:Wr,resultLabel:"Total supply of current drop:",resultType:"number"});break}});var Ao=A(require("prompts")),xo=A(require("download")),Fe=A(require("cross-spawn")),vo=require("process");var Sa=/^[^\s^\x00-\x1f\\?*:"";<>|/.][^\x00-\x1f\\?*:"";<>|/]*[^\s^\x00-\x1f\\?*:"";<>|/.]+$/g,ko=()=>l(void 0,null,function*(){let r=[{type:"text",name:"dappDirectoryName",message:Ts,validate:e=>e?new RegExp(Sa).test(e)?!0:"Wrong format for the directory name!":"Required!"}];try{let{dappDirectoryName:e}=yield(0,Ao.default)(r);e||(console.log("You have to provide the directory name!"),(0,vo.exit)(9)),(0,xo.default)(Te,`${process.cwd()}/${e}`,{extract:!0,strip:1}).then(()=>{process.chdir(e),Fe.default.sync("npm",["install"],{stdio:"inherit"}),Fe.default.sync("cp",[".env.example",".env.local"],{stdio:"inherit"}),process.chdir(".."),console.log(`
`)}`),(0,Y.exit)(9)),r){case e.issueCollectionToken:Uo();break;case e.setLocalRoles:qo();break;case e.mint:Ko();break;case e.giveaway:Yo();break;case e.setDrop:Vo();break;case e.unsetDrop:Jo();break;case e.pauseMinting:zo();break;case e.startMinting:Wo();break;case e.setNewPrice:_o();break;case e.claimDevRewards:Ho();break;case e.shuffle:Zo();break;case e.populateAllowlist:aa();break;case e.clearAllowlist:ia();break;case e.removeAllowlistAddress:la();break;case e.enableAllowlist:ta();break;case e.disableAllowlist:na();break;case e.changeBaseCids:Xo();break;case e.setNewTokensLimitPerAddress:ea();break;case e.claimScFunds:oa();break;case e.getTotalTokensLeft:T({functionName:hr,resultLabel:"Total tokens left:",resultType:"number"});break;case e.getProvenanceHash:T({functionName:br,resultLabel:"Provenance hash of the collection:",resultType:"string"});break;case e.getDropTokensLeft:T({functionName:Nr,resultLabel:"Tokens left for the current drop:",resultType:"number"});break;case e.getNftPrice:T({functionName:Tr,resultLabel:"Current NFT price is:",resultType:"number"});break;case e.getNftTokenId:T({functionName:Ar,resultLabel:"NFT token id:",resultType:"string"});break;case e.getNftTokenName:T({functionName:xr,resultLabel:"NFT token name:",resultType:"string"});break;case e.getCollectionTokenName:T({functionName:vr,resultLabel:"Collection token name:",resultType:"string"});break;case e.getTokensLimitPerAddressTotal:T({functionName:kr,resultLabel:"Tokens limit per address:",resultType:"number"});break;case e.getMintedPerAddressPerDrop:sa();break;case e.getTokensLimitPerAddressPerDrop:T({functionName:Cr,resultLabel:"Tokens limit per address per current drop:",resultType:"number"});break;case e.getMintedPerAddressTotal:ra();break;case e.getAllowlistSize:T({functionName:he,resultLabel:"Total size of the Allowlist:",resultType:"number"});break;case e.isAllowlistEnabled:T({functionName:Qr,resultLabel:"Result:",resultModifier:t=>t==="true"?"The allowlist is enabled!":"The allowlist is disabled!",resultType:"boolean"});break;case e.getAllowlistAddressCheck:ca();break;case e.isDropActive:T({functionName:Yr,resultLabel:"Result:",resultModifier:t=>t==="true"?"The drop is active!":"The drop is not active!",resultType:"boolean"});break;case e.isMintingPaused:T({functionName:Vr,resultLabel:"Result:",resultModifier:t=>t==="true"?"The minting is paused!":"The minting is not paused!",resultType:"boolean"});break;case e.getTotalSupply:T({functionName:Jr,resultLabel:"Total supply of the collection:",resultType:"number"});break;case e.getTotalSupplyOfCurrentDrop:T({functionName:zr,resultLabel:"Total supply of current drop:",resultType:"number"});break}});var To=A(require("prompts")),Ao=A(require("download")),Le=A(require("cross-spawn")),xo=require("process");var da=/^[^\s^\x00-\x1f\\?*:"";<>|/.][^\x00-\x1f\\?*:"";<>|/]*[^\s^\x00-\x1f\\?*:"";<>|/.]+$/g,vo=()=>l(void 0,null,function*(){let r=[{type:"text",name:"dappDirectoryName",message:Ns,validate:e=>e?new RegExp(da).test(e)?!0:"Wrong format for the directory name!":"Required!"}];try{let{dappDirectoryName:e}=yield(0,To.default)(r);e||(console.log("You have to provide the directory name!"),(0,xo.exit)(9)),(0,Ao.default)(Ne,`${process.cwd()}/${e}`,{extract:!0,strip:1}).then(()=>{process.chdir(e),Le.default.sync("npm",["install"],{stdio:"inherit"}),Le.default.sync("cp",[".env.example",".env.local"],{stdio:"inherit"}),process.chdir(".."),console.log(`
`),console.log(`The Minter Dapp is initialized in the ${e} directory. Npm dependencies installed. .env.example copied into .env.local - change the settings there. Check the docs on how to run the Dapp: https://www.elven.tools`),console.log(`
`)}).catch(t=>{t&&console.log(`Can't download the ${Te} (${t.statusCode}:${t.statusMessage})`)})}catch(e){console.log(e==null?void 0:e.message)}});var B={deploy:"deploy",derivePem:"derive-pem",nftMinter:"nft-minter",collectionNftOwners:"collection-nft-owners",initDapp:"init-dapp"},J=z.argv,G=J?J[2]:void 0;(G==="--version"||G==="-v")&&(console.log(_.version),(0,z.exit)());var Pa=Object.values(B),So=[...Pa,"--version","-v","--help","-h"],Ma=`========================
`)}).catch(t=>{t&&console.log(`Can't download the ${Ne} (${t.statusCode}:${t.statusMessage})`)})}catch(e){console.log(e==null?void 0:e.message)}});var $={deploy:"deploy",derivePem:"derive-pem",nftMinter:"nft-minter",collectionNftOwners:"collection-nft-owners",initDapp:"init-dapp"},V=J.argv,B=V?V[2]:void 0;(B==="--version"||B==="-v")&&(console.log(W.version),(0,J.exit)());var pa=Object.values($),ko=[...pa,"--version","-v","--help","-h"],ma=`========================
Available commands:
========================
${So.join(`
`)}`;(G==="--help"||G==="-h")&&(console.log(Ma),(0,z.exit)(9));(!G||!Object.values(B).includes(G))&&(console.log(`====================================================
${ko.join(`
`)}`;(B==="--help"||B==="-h")&&(console.log(ma),(0,J.exit)(9));(!B||!Object.values($).includes(B))&&(console.log(`====================================================
Plaese provide a proper command. Available commands:
====================================================
${So.join(`
`)}`),(0,z.exit)(9));switch(G){case B.derivePem:bo();break;case B.deploy:io(J?J[3]:void 0);break;case B.nftMinter:To(J?J[3]:void 0);break;case B.collectionNftOwners:fo();break;case B.initDapp:ko();break;default:break}
${ko.join(`
`)}`),(0,J.exit)(9));switch(B){case $.derivePem:ho();break;case $.deploy:ao(V?V[3]:void 0);break;case $.nftMinter:No(V?V[3]:void 0);break;case $.collectionNftOwners:go();break;case $.initDapp:vo();break;default:break}

@@ -0,1 +1,5 @@

### [1.11.1](https://github.com/ElvenTools/elven-tools-cli/releases/tag/v1.11.1)
- bump dapp version, new major version of the dapp, check its changelog [here](https://github.com/ElvenTools/elven-tools-dapp/blob/main/CHANGELOG.md)
- update erdjs
### [1.11.0](https://github.com/ElvenTools/elven-tools-cli/releases/tag/v1.11.0) (2022-06-18)

@@ -2,0 +6,0 @@ - changes in the configuration structure

@@ -7,6 +7,6 @@ {

"types": "build/types",
"version": "1.11.0",
"version": "1.11.1",
"elvenTools": {
"smartContractVersionTagName": "v1.7.0",
"minterDappVersionTagName": "v2.2.1"
"minterDappVersionTagName": "v3.0.0"
},

@@ -58,5 +58,5 @@ "description": "Interacting with custom NFT related Smart Contracts on the Elrond blockchain",

"dependencies": {
"@elrondnetwork/erdjs": "10.2.5",
"@elrondnetwork/erdjs-network-providers": "^0.1.5",
"@elrondnetwork/erdjs-walletcore": "^1.0.0",
"@elrondnetwork/erdjs": "10.2.7",
"@elrondnetwork/erdjs-network-providers": "0.1.6",
"@elrondnetwork/erdjs-walletcore": "1.0.0",
"axios": "^0.27.2",

@@ -63,0 +63,0 @@ "bignumber.js": "9.0.2",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc