1"use strict";(self.webpackChunk_gokiprotocol_goki_interface=self.webpackChunk_gokiprotocol_goki_interface||[]).push([[3638],{63638:(t,e,n)=>{n.r(e),n.d(e,{QuarryMinterTab:()=>b,default:()=>C});var i=n(23233),r=n(27115),a=n(56673),o=n(26062),l=n(17329),u=n(68534),d=n(97122),c=n(58164),p=n(70555),s=n(50774),h=n(44789),m=n(82006),Z=n(51028),w=n(87598),y=n(46510),M=n(65053),f=n(11059),k=n(44746);const v=t=>{let{token:e,minter:n}=t;const[r,o]=(0,d.useState)(""),{sdkMut:u}=(0,f.eC)(),{wrapTx:c}=(0,h.B)(),{signAndConfirmTX:s}=(0,a._W)(),Z=(0,d.useMemo)((()=>{try{return e?l.dt.parse(e,r):null}catch(t){return null}}),[e,r]);return null!==u&&void 0!==u&&u.provider.wallet.publicKey.equals(n.account.minterAuthority)?(0,k.BX)(w.Z,{title:"Self Mint",children:[(0,k.tZ)(y.A,{label:"Mint Amount",tokens:[],token:e,inputValue:r,inputOnChange:o}),(0,k.tZ)(m.Z,{disabled:!Z,onClick:async t=>{(0,p.default)(Z,"mint amount");const e=i.CO.load({provider:t.provider}),r=await e.mintWrapper.performMint({amount:Z,minter:{accountId:n.publicKey,accountInfo:{data:n.account}}});await s(await c(r),`Mint ${Z.formatUnits()} to self`)},children:"Self Mint"})]}):(0,k.tZ)(w.Z,{title:"Self Mint",padded:!0,children:(0,k.tZ)("p",{children:"You are not the minter authority."})})},A=()=>{var t;const{signAndConfirmTX:e}=(0,a._W)(),{meta:n}=(0,s.dg)(),{wrapTx:f}=(0,h.B)(),{mintWrapper:A}=(0,r.Aq)(),{minterAuthorityKey:b}=(0,c.UO)(),C=null===n||void 0===n||null===(t=n.quarry)||void 0===t?void 0:t.mintWrapper,g=(0,a.up)(b),{data:W}=(0,u.a)({queryKey:["quarryMinterKey",null===C||void 0===C?void 0:C.toString(),null===g||void 0===g?void 0:g.toString()],queryFn:async()=>{if(!C||!g)return(0,a.M4)(C,g);const[t]=await(0,i.gY)(C,g);return t}}),{data:S}=(0,r.OW)(W),[K,B]=(0,d.useState)(""),{data:O}=(0,a.dQ)((0,o.e8)(A,(t=>t.account.tokenMint))),T=(0,d.useMemo)((()=>{try{return(0,o.e8)(O,(t=>l.dt.parse(t,K)))}catch(t){return null}}),[O,K]);return A?S?O?g?S?(0,k.BX)("div",{children:[(0,k.tZ)(w.Z,{title:"Minter Info",children:(0,k.tZ)(Z.d,{attributes:{Key:S.publicKey,Bump:S.account.bump,Allowance:new l.dt(O,S.account.allowance),"Mint Wrapper":S.account.mintWrapper,"Minter Authority":S.account.minterAuthority}})}),(0,k.BX)(w.Z,{title:"Set Allowance",children:[(0,k.tZ)(y.A,{label:"Allowance",tokens:[],token:O,inputValue:K,inputOnChange:B}),(0,k.tZ)(m.Z,{disabled:!T,onClick:async t=>{const n=i.CO.load({provider:t.provider});(0,p.default)(T,"allowance amt");const r=await n.mintWrapper.minterUpdate(A.publicKey,g,T.toU64());await e(await f(r),`Set allowance to ${T.formatUnits()}`)},children:"Set Allowance"})]}),(0,k.tZ)(v,{token:O,minter:S})]}):(0,k.BX)(w.Z,{title:"Minter",children:[(0,k.BX)("p",{children:["The minter at ",null===W||void 0===W?void 0:W.toString()," does not exist."]}),(0,k.tZ)(y.A,{label:"Allowance",tokens:[],token:O,inputValue:K,inputOnChange:B}),(0,k.tZ)(m.Z,{disabled:!T||!g,onClick:async t=>{(0,p.default)(T,"allowance amt"),(0,p.default)(g,"minter authority");const n=i.CO.load({provider:t.provider}),r=await n.mintWrapper.newMinterWithAllowance(A.publicKey,g,T.toU64());await e(await f(r),"Create minter")},children:"Initialize Minter"})]}):(0,k.tZ)(w.Z,{title:"Minter",children:"Minter authority not found."}):(0,k.tZ)(w.Z,{title:"Minter",children:"Token not found."}):(0,k.tZ)(w.Z,{title:"Minter",padded:!0,children:(0,k.tZ)(M.T,{})}):(0,k.tZ)(w.Z,{title:"Minter",padded:!0,children:"Mint Wrapper does not exist."})},b=()=>(0,k.tZ)(A,{}),C=b}}]); 2//# sourceMappingURL=3638.b4151fe5.chunk.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.