@circle-fin/user-controlled-wallets 10.3.0 → 10.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -43,4 +43,4 @@
43
43
  Private-Lines: `+c+`\r
44
44
  `,s+=u;var y=yl("putty-private-key-file-mac-key",t),C=Je.util.createBuffer();aa(C,r),aa(C,n),aa(C,a),C.putInt32(i.length()),C.putBuffer(i),C.putInt32(l.length()),C.putBuffer(l);var I=Je.hmac.create();return I.start("sha1",y),I.update(C.bytes()),s+=`\r
45
45
  Private-MAC: `+I.digest().toHex()+`\r
46
- `,s},xl.publicKeyToOpenSSH=function(e,t){var a="ssh-rsa";t=t||"";var r=Je.util.createBuffer();return aa(r,a),Jt(r,e.e),Jt(r,e.n),a+" "+Je.util.encode64(r.bytes())+" "+t},xl.privateKeyToOpenSSH=function(e,t){return t?Je.pki.encryptRsaPrivateKey(e,t,{legacy:!0,algorithm:"aes128"}):Je.pki.privateKeyToPem(e)},xl.getPublicKeyFingerprint=function(e,t){t=t||{};var a=t.md||Je.md.md5.create(),r="ssh-rsa",n=Je.util.createBuffer();aa(n,r),Jt(n,e.e),Jt(n,e.n),a.start(),a.update(n.getBytes());var s=a.digest();if(t.encoding==="hex"){var i=s.toHex();return t.delimiter?i.match(/.{2}/g).join(t.delimiter):i}else{if(t.encoding==="binary")return s.getBytes();if(t.encoding)throw new Error('Unknown encoding "'+t.encoding+'".')}return s};function Jt(e,t){var a=t.toString(16);a[0]>="8"&&(a="00"+a);var r=Je.util.hexToBytes(a);e.putInt32(r.length),e.putBytes(r)}function aa(e,t){e.putInt32(t.length),e.putString(t)}function yl(){for(var e=Je.md.sha1.create(),t=arguments.length,a=0;a<t;++a)e.update(arguments[a]);return e.digest()}const Ut=()=>Or.randomUUID(),OT=({configurationsClient:e})=>async t=>{try{return await e.Faucet.requestTestnetTokens(void 0,t)}catch(a){throw te(a)?ee(a):a}};var Z0="10.3.0";const eh=({client:e})=>async({xRequestId:t,...a})=>{try{return ae(await e.PINAuthentication.getUserToken({...a},t))}catch(r){throw te(r)?ee(r):r}},Ke=async(e,t,a=!1)=>{let r;return e.storage&&(r=await e.storage.get("userToken:"+t)),!a&&r?.userToken!=null&&r.expirationTime>Date.now()?r.userToken:await DT(e,t)};async function DT(e,t){const a=await eh(e)({userId:t});if(!a.data?.userToken)throw new Error("Could not fetch user token");return e.storage&&await e.storage.set("userToken:"+t,{...a.data,expirationTime:Date.now()+3e3*1e3}),a.data.userToken}const FT=e=>async({userToken:t,userId:a,idempotencyKey:r,xRequestId:n})=>{try{return ae(await e.client.PINAuthentication.createUserPinChallenge(t??await Ke(e,a),{idempotencyKey:r??Ut()},n))}catch(s){throw te(s)?ee(s):s}},qT=e=>async({userToken:t,userId:a,idempotencyKey:r,accountType:n="EOA",xRequestId:s,...i})=>{try{return ae(await e.client.Users.createUserWithPinChallenge(t??await Ke(e,a),{idempotencyKey:r??Ut(),accountType:n,...i},s))}catch(o){throw te(o)?ee(o):o}},VT=e=>async({userToken:t,userId:a,idempotencyKey:r,xRequestId:n})=>{try{return ae(await e.client.PINAuthentication.createUserPinRestoreChallenge(t??await Ke(e,a),{idempotencyKey:r??Ut()},n))}catch(s){throw te(s)?ee(s):s}},MT=e=>async({userToken:t,userId:a,idempotencyKey:r})=>{try{return ae(await e.client.PINAuthentication.updateUserPinChallenge(t??await Ke(e,a),{idempotencyKey:r??Ut()}))}catch(n){throw te(n)?ee(n):n}},jT=e=>async({userToken:t,userId:a,xRequestId:r,...n})=>{try{return ae(await e.client.Signing.signUserMessage(t??await Ke(e,a),n,r))}catch(s){throw te(s)?ee(s):s}},KT=e=>async({userToken:t,userId:a,xRequestId:r,...n})=>{try{return ae(await e.client.Signing.signUserTransaction(t??await Ke(e,a),{...n},r))}catch(s){throw te(s)?ee(s):s}},zT=e=>async({userToken:t,userId:a,xRequestId:r,...n})=>{try{return ae(await e.client.Signing.signUserTypedData(t??await Ke(e,a),n,r))}catch(s){throw te(s)?ee(s):s}},HT=({client:e})=>async({id:t})=>{try{return ae(await e.TokenLookup.getTokenId(t))}catch(a){throw te(a)?ee(a):a}},$T=e=>async({userToken:t,userId:a,id:r,idempotencyKey:n,xRequestId:s})=>{try{return ae(await e.client.Transactions.createUserTransactionAccelerateChallenge(t??await Ke(e,a),r,{idempotencyKey:n??Ut()},s))}catch(i){throw te(i)?ee(i):i}},GT=e=>async({userToken:t,userId:a,id:r,idempotencyKey:n,xRequestId:s})=>{try{return ae(await e.client.Transactions.createUserTransactionCancelChallenge(t??await Ke(e,a),r,{idempotencyKey:n??Ut()},s))}catch(i){throw te(i)?ee(i):i}},WT=e=>async({userToken:t,userId:a,idempotencyKey:r,fee:n,xRequestId:s,...i})=>{try{return ae(await e.client.Transactions.createUserTransactionTransferChallenge(t??await Ke(e,a),{idempotencyKey:r??Ut(),...n.config,...i},s))}catch(o){throw te(o)?ee(o):o}},XT=e=>async({userToken:t,userId:a,idempotencyKey:r,fee:n,xRequestId:s,...i})=>{try{return ae(await e.client.Transactions.createUserTransactionContractExecutionChallenge(t??await Ke(e,a),{idempotencyKey:r??Ut(),...n.config,...i},s))}catch(o){throw te(o)?ee(o):o}},QT=e=>async({userId:t,userToken:a,source:r,xRequestId:n,...s})=>{try{return ae(await e.client.Transactions.createTransactionEstimateFee(a??await Ke(e,t),{...s,...r},n))}catch(i){throw te(i)?ee(i):i}},YT=e=>async({userToken:t,userId:a,amount:r,xRequestId:n,...s})=>{try{return ae(await e.client.Transactions.createTransferEstimateFee(t??await Ke(e,a),{amounts:r,...s},n))}catch(i){throw te(i)?ee(i):i}},JT=e=>async({id:t,userToken:a,userId:r,txType:n,xRequestId:s})=>{try{return ae(await e.client.Transactions.getTransaction(t,a??await Ke(e,r),n,s))}catch(i){throw te(i)?ee(i):i}},ZT=({client:e})=>async({blockchain:t,address:a,walletId:r,xRequestId:n}={})=>{try{return ae(await e.Transactions.getLowestNonceTransaction(t,a,r,{headers:n?{"X-Request-Id":n}:void 0}))}catch(s){throw te(s)?ee(s):s}},e2=e=>async({userToken:t,blockchain:a,destinationAddress:r,includeAll:n,operation:s,state:i,txHash:o,txType:c,userId:l,walletIds:u,from:p,pageAfter:d,pageBefore:g,pageSize:h,to:b,order:y,xRequestId:C})=>{try{return ae(await e.client.Transactions.listTransactions(t??await Ke(e,l),a,r,n,s,i,o,c,l,u?.join(","),p,b,g,d,h,y,C))}catch(I){throw te(I)?ee(I):I}},t2=({client:e})=>async t=>{try{return ae(await e.Transactions.createValidateAddress(t))}catch(a){throw te(a)?ee(a):a}},r2=({client:e})=>async({...t})=>{try{return ae(await e.PINAuthentication.createUser({...t}))}catch(a){throw te(a)?ee(a):a}},a2=e=>async({userToken:t,idempotencyKey:a,userId:r,xRequestId:n,...s})=>{try{return ae(await e.client.SocialEmailAuthentication.resendOTP(t??await Ke(e,r),{idempotencyKey:a??Ut(),...s},n))}catch(i){throw te(i)?ee(i):i}},n2=({client:e})=>async({idempotencyKey:t,xRequestId:a,...r})=>{try{return ae(await e.SocialEmailAuthentication.createDeviceTokenEmailLogin({idempotencyKey:t??Ut(),...r},a))}catch(n){throw te(n)?ee(n):n}},i2=({client:e})=>async({userId:t,xRequestId:a})=>{try{return ae(await e.Users.getUser(t,a))}catch(r){throw te(r)?ee(r):r}},s2=({client:e})=>async({userToken:t,xRequestId:a})=>{try{return ae(await e.Users.getUserByToken(t,a))}catch(r){throw te(r)?ee(r):r}},o2=({client:e})=>async({userToken:t,challengeId:a,xRequestId:r})=>{try{return ae(await e.Users.getUserChallenge(t,a,r))}catch(n){throw te(n)?ee(n):n}},c2=({client:e})=>async({pinStatus:t,securityQuestionStatus:a,from:r,to:n,pageBefore:s,pageAfter:i,pageSize:o,order:c,xRequestId:l}={})=>{try{return ae(await e.Users.listUsers(t,a,r,n,s,i,o,c,l))}catch(u){throw te(u)?ee(u):u}},l2=({client:e})=>async({userToken:t,challengeStatus:a,xRequestId:r})=>{try{return ae(await e.Users.listUserChallenges(t,a,r))}catch(n){throw te(n)?ee(n):n}},u2=e=>async({userId:t,userToken:a,deviceId:r,idempotencyKey:n,refreshToken:s,xRequestId:i})=>{try{return ae(await e.client.SocialEmailAuthentication.refreshUserToken(a??await Ke(e,t),{idempotencyKey:n??Ut(),refreshToken:s,deviceId:r},i))}catch(o){throw te(o)?ee(o):o}},p2=({client:e})=>async({idempotencyKey:t,xRequestId:a,...r})=>{try{return ae(await e.SocialEmailAuthentication.createDeviceTokenSocialLogin({idempotencyKey:t??Ut(),...r},a))}catch(n){throw te(n)?ee(n):n}},d2=e=>async({userToken:t,userId:a,idempotencyKey:r,accountType:n="EOA",xRequestId:s,...i})=>{try{return ae(await e.client.Wallets.createUserWallet(t??await Ke(e,a),{idempotencyKey:r??Ut(),accountType:n,...i},s))}catch(o){throw te(o)?ee(o):o}},f2=e=>async({id:t,userToken:a,userId:r,xRequestId:n})=>{try{return ae(await e.client.Wallets.getWallet(t,a??await Ke(e,r),n))}catch(s){throw te(s)?ee(s):s}},h2=e=>async({walletId:t,userToken:a,userId:r,includeAll:n,name:s,pageAfter:i,pageBefore:o,pageSize:c,tokenAddresses:l,standard:u,xRequestId:p})=>{try{return ae(await e.client.Wallets.listWalletNfts(a??await Ke(e,r),t,n,s,l?.join(","),u,o,i,c,p))}catch(d){throw te(d)?ee(d):d}},m2=e=>async({walletId:t,userToken:a,userId:r,includeAll:n,name:s,pageAfter:i,pageBefore:o,pageSize:c,tokenAddresses:l,standard:u,xRequestId:p})=>{try{return ae(await e.client.Wallets.listWalletBalance(a??await Ke(e,r),t,n,s,l?.join(","),u,o,i,c,p))}catch(d){throw te(d)?ee(d):d}},v2=e=>async({userId:t,userToken:a,address:r,blockchain:n,from:s,pageAfter:i,pageBefore:o,pageSize:c,to:l,walletSetId:u,refId:p,scaCore:d,order:g,xRequestId:h})=>{try{return ae(await e.client.Wallets.listWallets(a??await Ke(e,t),r,n,d,u,p,s,l,o,i,c,g,h))}catch(b){throw te(b)?ee(b):b}},g2=e=>async({id:t,name:a,refId:r,userToken:n,userId:s})=>{try{return ae(await e.client.Wallets.updateWallet(t,n??await Ke(e,s),{name:a,refId:r}))}catch(i){throw te(i)?ee(i):i}};var x2=Object.defineProperty,y2=(e,t,a)=>t in e?x2(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,b2=(e,t,a)=>y2(e,typeof t!="symbol"?t+"":t,a);const vp="https://api.circle.com";class th{constructor(t){b2(this,"params");const{apiKey:a,baseUrl:r,storage:n,userAgent:s,headers:i}=t;this.params={client:new Ny(r??vp,{apiKey:a,version:Z0,userAgent:s},i),configurationsClient:new ny(r??vp,{apiKey:a,version:Z0,userAgent:s},i),storage:n??new G1}}createUserPin(t){return FT(this.params)(t)}createUserPinWithWallets(t){return qT(this.params)(t)}updateUserPin(t){return MT(this.params)(t)}restoreUserPin(t){return VT(this.params)(t)}createDeviceTokenForEmailLogin(t){return n2(this.params)(t)}createDeviceTokenForSocialLogin(t){return p2(this.params)(t)}refreshUserToken(t){return u2(this.params)(t)}resendOTP(t){return a2(this.params)(t)}createWallet(t){return d2(this.params)(t)}listWallets(t){return v2(this.params)(t)}getWallet(t){return f2(this.params)(t)}updateWallet(t){return g2(this.params)(t)}getWalletTokenBalance(t){return m2(this.params)(t)}getWalletNFTBalance(t){return h2(this.params)(t)}accelerateTransaction(t){return $T(this.params)(t)}createTransaction(t){return WT(this.params)(t)}cancelTransaction(t){return GT(this.params)(t)}getTransaction(t){return JT(this.params)(t)}listTransactions(t){return e2(this.params)(t)}estimateContractExecutionFee(t){return QT(this.params)(t)}createUserTransactionContractExecutionChallenge(t){return XT(this.params)(t)}estimateTransferFee(t){return YT(this.params)(t)}validateAddress(t){return t2(this.params)(t)}getLowestNonceTransaction(t){return ZT(this.params)(t)}createUser(t){return r2(this.params)(t)}getUser(t){return i2(this.params)(t)}getUserStatus(t){return s2(this.params)(t)}listUsers(t){return c2(this.params)(t)}createUserToken(t){return eh(this.params)(t)}getUserChallenge(t){return o2(this.params)(t)}listUserChallenges(t){return l2(this.params)(t)}getToken(t){return HT(this.params)(t)}signMessage(t){return jT(this.params)(t)}signTransaction(t){return KT(this.params)(t)}signTypedData(t){return zT(this.params)(t)}requestTestnetTokens(t){return OT(this.params)(t)}createMonitoredTokens(t){return N1(this.params)(t)}updateMonitoredTokens(t){return O1(this.params)(t)}listMonitoredTokens(t){return P1(this.params)(t)}deleteMonitoredTokens(t){return L1(this.params)(t)}updateMonitoredTokensScope(t){return D1(this.params)(t)}createSubscription(t){return F1(this.params)(t)}deleteSubscription(t){return q1(this.params)(t)}getSubscription(t){return V1(this.params)(t)}getNotificationSignature(t){return M1(this.params)(t)}listSubscriptions(){return j1(this.params)()}updateSubscription(t){return K1(this.params)(t)}}function E2(e){return new th(e)}exports.BadGatewayError=Aa,exports.BadRequestError=ya,exports.Blockchain=ky,exports.CircleUserControlledWalletsClient=th,exports.ConnectionAbortedError=_a,exports.ConnectionRefusedError=Ra,exports.ConnectionResetError=Pa,exports.ConnectionTimeoutError=ka,exports.DNSNotFoundError=Ua,exports.DNSTimeoutError=Na,exports.Error110700=Au,exports.Error110701=Iu,exports.Error110702=Bu,exports.Error110703=Ru,exports.Error155101=Da,exports.Error155102=Fa,exports.Error155103=qa,exports.Error155104=Va,exports.Error155105=Ma,exports.Error155106=ja,exports.Error155107=Ka,exports.Error155108=za,exports.Error155109=Ha,exports.Error155110=$a,exports.Error155111=Ga,exports.Error155112=Wa,exports.Error155113=Xa,exports.Error155114=Qa,exports.Error155115=Ya,exports.Error155116=Ja,exports.Error155117=Za,exports.Error155118=en,exports.Error155119=tn,exports.Error155120=rn,exports.Error155121=an,exports.Error155122=nn,exports.Error155123=sn,exports.Error155124=on,exports.Error155130=cn,exports.Error155131=ln,exports.Error155132=un,exports.Error155133=pn,exports.Error155134=dn,exports.Error155135=fn,exports.Error155136=hn,exports.Error155137=mn,exports.Error155138=vn,exports.Error155139=gn,exports.Error155140=xn,exports.Error155141=yn,exports.Error155142=bn,exports.Error155143=En,exports.Error155144=Cn,exports.Error155145=Tn,exports.Error155146=Sn,exports.Error155150=wn,exports.Error155151=An,exports.Error155152=In,exports.Error155154=Bn,exports.Error155155=Rn,exports.Error155156=kn,exports.Error155157=_n,exports.Error155158=Un,exports.Error155159=Nn,exports.Error155160=Ln,exports.Error155201=Pn,exports.Error155202=On,exports.Error155203=Dn,exports.Error155204=Fn,exports.Error155205=qn,exports.Error155206=Vn,exports.Error155207=Mn,exports.Error155208=jn,exports.Error155209=Kn,exports.Error155210=zn,exports.Error155211=Hn,exports.Error155215=$n,exports.Error155218=Gn,exports.Error155219=Wn,exports.Error155220=Xn,exports.Error155221=Qn,exports.Error155222=Yn,exports.Error155223=Jn,exports.Error155224=Zn,exports.Error155225=ei,exports.Error155226=ti,exports.Error155227=ri,exports.Error155228=ai,exports.Error155229=ni,exports.Error155230=ii,exports.Error155231=si,exports.Error155232=oi,exports.Error155233=ci,exports.Error155234=li,exports.Error155235=ui,exports.Error155236=pi,exports.Error155237=di,exports.Error155238=fi,exports.Error155239=hi,exports.Error155240=mi,exports.Error155241=vi,exports.Error155242=gi,exports.Error155243=xi,exports.Error155244=yi,exports.Error155245=bi,exports.Error155247=Ei,exports.Error155254=Ci,exports.Error155257=Ti,exports.Error155258=Si,exports.Error155262=wi,exports.Error155264=Ai,exports.Error155501=Ii,exports.Error155502=Bi,exports.Error155503=Ri,exports.Error155504=ki,exports.Error155505=_i,exports.Error155506=Ui,exports.Error155507=Ni,exports.Error155508=Li,exports.Error155509=Pi,exports.Error155510=Oi,exports.Error155511=Di,exports.Error155512=Fi,exports.Error155514=qi,exports.Error155515=Vi,exports.Error155516=Mi,exports.Error155517=ji,exports.Error155601=Ki,exports.Error155701=zi,exports.Error155702=Hi,exports.Error155703=$i,exports.Error155704=Gi,exports.Error155705=Wi,exports.Error155706=Xi,exports.Error155707=Qi,exports.Error155708=Yi,exports.Error155709=Ji,exports.Error155710=Zi,exports.Error155711=es,exports.Error155712=ts,exports.Error155713=rs,exports.Error155714=as,exports.Error155715=ns,exports.Error155716=is,exports.Error155717=ss,exports.Error155718=os,exports.Error155719=cs,exports.Error155720=ls,exports.Error155721=us,exports.Error155801=ps,exports.Error155802=ds,exports.Error155803=fs,exports.Error155804=hs,exports.Error155805=ms,exports.Error155806=vs,exports.Error155807=gs,exports.Error155808=xs,exports.Error156001=ys,exports.Error156002=bs,exports.Error156003=Es,exports.Error156004=Cs,exports.Error156005=Ts,exports.Error156006=Ss,exports.Error156007=ws,exports.Error156008=As,exports.Error156009=Is,exports.Error156010=Bs,exports.Error156011=Rs,exports.Error156012=ks,exports.Error156013=_s,exports.Error156014=Us,exports.Error156015=Ns,exports.Error156016=Ls,exports.Error156017=Ps,exports.Error156018=Os,exports.Error156019=Ds,exports.Error156020=Fs,exports.Error156021=qs,exports.Error156023=Vs,exports.Error156024=Ms,exports.Error156025=js,exports.Error156026=Ks,exports.Error156027=zs,exports.Error156030=Hs,exports.Error156031=$s,exports.Error156032=Gs,exports.Error175001=Ws,exports.Error175002=Xs,exports.Error175003=Qs,exports.Error175004=Ys,exports.Error175005=Js,exports.Error175006=Zs,exports.Error175007=eo,exports.Error175008=to,exports.Error175009=ro,exports.Error175010=ao,exports.Error175011=no,exports.Error175012=io,exports.Error175013=so,exports.Error175201=oo,exports.Error175202=co,exports.Error175203=lo,exports.Error175204=uo,exports.Error175205=po,exports.Error175301=fo,exports.Error175302=ho,exports.Error175303=mo,exports.Error175401=vo,exports.Error175402=go,exports.Error175403=xo,exports.Error175404=yo,exports.Error175405=bo,exports.Error175406=Eo,exports.Error175407=Co,exports.Error175408=To,exports.Error175409=So,exports.Error175410=wo,exports.Error177001=Ao,exports.Error177002=Io,exports.Error177003=Bo,exports.Error177004=Ro,exports.Error177005=ko,exports.Error177006=_o,exports.Error177007=Uo,exports.Error177008=No,exports.Error177009=Lo,exports.Error177010=Po,exports.Error177011=Oo,exports.Error177012=Do,exports.Error177013=Fo,exports.Error177014=qo,exports.Error177015=Vo,exports.Error177016=Mo,exports.Error177017=jo,exports.Error177018=Ko,exports.Error177019=zo,exports.Error177020=Ho,exports.Error177021=$o,exports.Error177022=Go,exports.Error177023=Wo,exports.Error177024=Xo,exports.Error177025=Qo,exports.Error177026=Yo,exports.Error177301=Jo,exports.Error177302=Zo,exports.Error177303=ec,exports.Error177304=tc,exports.Error177305=rc,exports.Error177601=ac,exports.Error177602=nc,exports.Error177603=ic,exports.Error177604=sc,exports.Error177605=oc,exports.Error177606=cc,exports.Error177607=lc,exports.Error177901=uc,exports.ForbiddenError=Ea,exports.GatewayTimeoutError=Ba,exports.HostUnreachableError=Oa,exports.HttpError=xa,exports.HttpRequestError=Lt,exports.HttpResponseError=E,exports.InternalServerError=Sa,exports.NetworkUnreachableError=La,exports.NotFoundError=Ca,exports.NotImplementedError=wa,exports.RatelimitError=Ta,exports.ServiceUnavailableError=Ia,exports.UnauthorizedError=ba,exports.defaultBaseUrl=vp,exports.fromAxiosError=ee,exports.initiateUserControlledWalletsClient=E2;
46
+ `,s},xl.publicKeyToOpenSSH=function(e,t){var a="ssh-rsa";t=t||"";var r=Je.util.createBuffer();return aa(r,a),Jt(r,e.e),Jt(r,e.n),a+" "+Je.util.encode64(r.bytes())+" "+t},xl.privateKeyToOpenSSH=function(e,t){return t?Je.pki.encryptRsaPrivateKey(e,t,{legacy:!0,algorithm:"aes128"}):Je.pki.privateKeyToPem(e)},xl.getPublicKeyFingerprint=function(e,t){t=t||{};var a=t.md||Je.md.md5.create(),r="ssh-rsa",n=Je.util.createBuffer();aa(n,r),Jt(n,e.e),Jt(n,e.n),a.start(),a.update(n.getBytes());var s=a.digest();if(t.encoding==="hex"){var i=s.toHex();return t.delimiter?i.match(/.{2}/g).join(t.delimiter):i}else{if(t.encoding==="binary")return s.getBytes();if(t.encoding)throw new Error('Unknown encoding "'+t.encoding+'".')}return s};function Jt(e,t){var a=t.toString(16);a[0]>="8"&&(a="00"+a);var r=Je.util.hexToBytes(a);e.putInt32(r.length),e.putBytes(r)}function aa(e,t){e.putInt32(t.length),e.putString(t)}function yl(){for(var e=Je.md.sha1.create(),t=arguments.length,a=0;a<t;++a)e.update(arguments[a]);return e.digest()}const Ut=()=>Or.randomUUID(),OT=({configurationsClient:e})=>async t=>{try{return await e.Faucet.requestTestnetTokens(void 0,t)}catch(a){throw te(a)?ee(a):a}};var Z0="10.3.1";const eh=({client:e})=>async({xRequestId:t,...a})=>{try{return ae(await e.PINAuthentication.getUserToken({...a},t))}catch(r){throw te(r)?ee(r):r}},Ke=async(e,t,a=!1)=>{let r;return e.storage&&(r=await e.storage.get("userToken:"+t)),!a&&r?.userToken!=null&&r.expirationTime>Date.now()?r.userToken:await DT(e,t)};async function DT(e,t){const a=await eh(e)({userId:t});if(!a.data?.userToken)throw new Error("Could not fetch user token");return e.storage&&await e.storage.set("userToken:"+t,{...a.data,expirationTime:Date.now()+3e3*1e3}),a.data.userToken}const FT=e=>async({userToken:t,userId:a,idempotencyKey:r,xRequestId:n})=>{try{return ae(await e.client.PINAuthentication.createUserPinChallenge(t??await Ke(e,a),{idempotencyKey:r??Ut()},n))}catch(s){throw te(s)?ee(s):s}},qT=e=>async({userToken:t,userId:a,idempotencyKey:r,accountType:n="EOA",xRequestId:s,...i})=>{try{return ae(await e.client.Users.createUserWithPinChallenge(t??await Ke(e,a),{idempotencyKey:r??Ut(),accountType:n,...i},s))}catch(o){throw te(o)?ee(o):o}},VT=e=>async({userToken:t,userId:a,idempotencyKey:r,xRequestId:n})=>{try{return ae(await e.client.PINAuthentication.createUserPinRestoreChallenge(t??await Ke(e,a),{idempotencyKey:r??Ut()},n))}catch(s){throw te(s)?ee(s):s}},MT=e=>async({userToken:t,userId:a,idempotencyKey:r})=>{try{return ae(await e.client.PINAuthentication.updateUserPinChallenge(t??await Ke(e,a),{idempotencyKey:r??Ut()}))}catch(n){throw te(n)?ee(n):n}},jT=e=>async({userToken:t,userId:a,xRequestId:r,...n})=>{try{return ae(await e.client.Signing.signUserMessage(t??await Ke(e,a),n,r))}catch(s){throw te(s)?ee(s):s}},KT=e=>async({userToken:t,userId:a,xRequestId:r,...n})=>{try{return ae(await e.client.Signing.signUserTransaction(t??await Ke(e,a),{...n},r))}catch(s){throw te(s)?ee(s):s}},zT=e=>async({userToken:t,userId:a,xRequestId:r,...n})=>{try{return ae(await e.client.Signing.signUserTypedData(t??await Ke(e,a),n,r))}catch(s){throw te(s)?ee(s):s}},HT=({client:e})=>async({id:t})=>{try{return ae(await e.TokenLookup.getTokenId(t))}catch(a){throw te(a)?ee(a):a}},$T=e=>async({userToken:t,userId:a,id:r,idempotencyKey:n,xRequestId:s})=>{try{return ae(await e.client.Transactions.createUserTransactionAccelerateChallenge(t??await Ke(e,a),r,{idempotencyKey:n??Ut()},s))}catch(i){throw te(i)?ee(i):i}},GT=e=>async({userToken:t,userId:a,id:r,idempotencyKey:n,xRequestId:s})=>{try{return ae(await e.client.Transactions.createUserTransactionCancelChallenge(t??await Ke(e,a),r,{idempotencyKey:n??Ut()},s))}catch(i){throw te(i)?ee(i):i}},WT=e=>async({userToken:t,userId:a,idempotencyKey:r,fee:n,xRequestId:s,...i})=>{try{return ae(await e.client.Transactions.createUserTransactionTransferChallenge(t??await Ke(e,a),{idempotencyKey:r??Ut(),...n.config,...i},s))}catch(o){throw te(o)?ee(o):o}},XT=e=>async({userToken:t,userId:a,idempotencyKey:r,fee:n,xRequestId:s,...i})=>{try{return ae(await e.client.Transactions.createUserTransactionContractExecutionChallenge(t??await Ke(e,a),{idempotencyKey:r??Ut(),...n.config,...i},s))}catch(o){throw te(o)?ee(o):o}},QT=e=>async({userId:t,userToken:a,source:r,xRequestId:n,...s})=>{try{return ae(await e.client.Transactions.createTransactionEstimateFee(a??await Ke(e,t),{...s,...r},n))}catch(i){throw te(i)?ee(i):i}},YT=e=>async({userToken:t,userId:a,amount:r,xRequestId:n,...s})=>{try{return ae(await e.client.Transactions.createTransferEstimateFee(t??await Ke(e,a),{amounts:r,...s},n))}catch(i){throw te(i)?ee(i):i}},JT=e=>async({id:t,userToken:a,userId:r,txType:n,xRequestId:s})=>{try{return ae(await e.client.Transactions.getTransaction(t,a??await Ke(e,r),n,s))}catch(i){throw te(i)?ee(i):i}},ZT=({client:e})=>async({blockchain:t,address:a,walletId:r,xRequestId:n}={})=>{try{return ae(await e.Transactions.getLowestNonceTransaction(t,a,r,{headers:n?{"X-Request-Id":n}:void 0}))}catch(s){throw te(s)?ee(s):s}},e2=e=>async({userToken:t,blockchain:a,destinationAddress:r,includeAll:n,operation:s,state:i,txHash:o,txType:c,userId:l,walletIds:u,from:p,pageAfter:d,pageBefore:g,pageSize:h,to:b,order:y,xRequestId:C})=>{try{return ae(await e.client.Transactions.listTransactions(t??await Ke(e,l),a,r,n,s,i,o,c,l,u?.join(","),p,b,g,d,h,y,C))}catch(I){throw te(I)?ee(I):I}},t2=({client:e})=>async t=>{try{return ae(await e.Transactions.createValidateAddress(t))}catch(a){throw te(a)?ee(a):a}},r2=({client:e})=>async({...t})=>{try{return ae(await e.PINAuthentication.createUser({...t}))}catch(a){throw te(a)?ee(a):a}},a2=e=>async({userToken:t,idempotencyKey:a,userId:r,xRequestId:n,...s})=>{try{return ae(await e.client.SocialEmailAuthentication.resendOTP(t??await Ke(e,r),{idempotencyKey:a??Ut(),...s},n))}catch(i){throw te(i)?ee(i):i}},n2=({client:e})=>async({idempotencyKey:t,xRequestId:a,...r})=>{try{return ae(await e.SocialEmailAuthentication.createDeviceTokenEmailLogin({idempotencyKey:t??Ut(),...r},a))}catch(n){throw te(n)?ee(n):n}},i2=({client:e})=>async({userId:t,xRequestId:a})=>{try{return ae(await e.Users.getUser(t,a))}catch(r){throw te(r)?ee(r):r}},s2=({client:e})=>async({userToken:t,xRequestId:a})=>{try{return ae(await e.Users.getUserByToken(t,a))}catch(r){throw te(r)?ee(r):r}},o2=({client:e})=>async({userToken:t,challengeId:a,xRequestId:r})=>{try{return ae(await e.Users.getUserChallenge(t,a,r))}catch(n){throw te(n)?ee(n):n}},c2=({client:e})=>async({pinStatus:t,securityQuestionStatus:a,from:r,to:n,pageBefore:s,pageAfter:i,pageSize:o,order:c,xRequestId:l}={})=>{try{return ae(await e.Users.listUsers(t,a,r,n,s,i,o,c,l))}catch(u){throw te(u)?ee(u):u}},l2=({client:e})=>async({userToken:t,challengeStatus:a,xRequestId:r})=>{try{return ae(await e.Users.listUserChallenges(t,a,r))}catch(n){throw te(n)?ee(n):n}},u2=e=>async({userId:t,userToken:a,deviceId:r,idempotencyKey:n,refreshToken:s,xRequestId:i})=>{try{return ae(await e.client.SocialEmailAuthentication.refreshUserToken(a??await Ke(e,t),{idempotencyKey:n??Ut(),refreshToken:s,deviceId:r},i))}catch(o){throw te(o)?ee(o):o}},p2=({client:e})=>async({idempotencyKey:t,xRequestId:a,...r})=>{try{return ae(await e.SocialEmailAuthentication.createDeviceTokenSocialLogin({idempotencyKey:t??Ut(),...r},a))}catch(n){throw te(n)?ee(n):n}},d2=e=>async({userToken:t,userId:a,idempotencyKey:r,accountType:n="EOA",xRequestId:s,...i})=>{try{return ae(await e.client.Wallets.createUserWallet(t??await Ke(e,a),{idempotencyKey:r??Ut(),accountType:n,...i},s))}catch(o){throw te(o)?ee(o):o}},f2=e=>async({id:t,userToken:a,userId:r,xRequestId:n})=>{try{return ae(await e.client.Wallets.getWallet(t,a??await Ke(e,r),n))}catch(s){throw te(s)?ee(s):s}},h2=e=>async({walletId:t,userToken:a,userId:r,includeAll:n,name:s,pageAfter:i,pageBefore:o,pageSize:c,tokenAddresses:l,standard:u,xRequestId:p})=>{try{return ae(await e.client.Wallets.listWalletNfts(a??await Ke(e,r),t,n,s,l?.join(","),u,o,i,c,p))}catch(d){throw te(d)?ee(d):d}},m2=e=>async({walletId:t,userToken:a,userId:r,includeAll:n,name:s,pageAfter:i,pageBefore:o,pageSize:c,tokenAddresses:l,standard:u,xRequestId:p})=>{try{return ae(await e.client.Wallets.listWalletBalance(a??await Ke(e,r),t,n,s,l?.join(","),u,o,i,c,p))}catch(d){throw te(d)?ee(d):d}},v2=e=>async({userId:t,userToken:a,address:r,blockchain:n,from:s,pageAfter:i,pageBefore:o,pageSize:c,to:l,walletSetId:u,refId:p,scaCore:d,order:g,xRequestId:h})=>{try{return ae(await e.client.Wallets.listWallets(a??await Ke(e,t),r,n,d,u,p,s,l,o,i,c,g,h))}catch(b){throw te(b)?ee(b):b}},g2=e=>async({id:t,name:a,refId:r,userToken:n,userId:s})=>{try{return ae(await e.client.Wallets.updateWallet(t,n??await Ke(e,s),{name:a,refId:r}))}catch(i){throw te(i)?ee(i):i}};var x2=Object.defineProperty,y2=(e,t,a)=>t in e?x2(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,b2=(e,t,a)=>y2(e,typeof t!="symbol"?t+"":t,a);const vp="https://api.circle.com";class th{constructor(t){b2(this,"params");const{apiKey:a,baseUrl:r,storage:n,userAgent:s,headers:i}=t;this.params={client:new Ny(r??vp,{apiKey:a,version:Z0,userAgent:s},i),configurationsClient:new ny(r??vp,{apiKey:a,version:Z0,userAgent:s},i),storage:n??new G1}}createUserPin(t){return FT(this.params)(t)}createUserPinWithWallets(t){return qT(this.params)(t)}updateUserPin(t){return MT(this.params)(t)}restoreUserPin(t){return VT(this.params)(t)}createDeviceTokenForEmailLogin(t){return n2(this.params)(t)}createDeviceTokenForSocialLogin(t){return p2(this.params)(t)}refreshUserToken(t){return u2(this.params)(t)}resendOTP(t){return a2(this.params)(t)}createWallet(t){return d2(this.params)(t)}listWallets(t){return v2(this.params)(t)}getWallet(t){return f2(this.params)(t)}updateWallet(t){return g2(this.params)(t)}getWalletTokenBalance(t){return m2(this.params)(t)}getWalletNFTBalance(t){return h2(this.params)(t)}accelerateTransaction(t){return $T(this.params)(t)}createTransaction(t){return WT(this.params)(t)}cancelTransaction(t){return GT(this.params)(t)}getTransaction(t){return JT(this.params)(t)}listTransactions(t){return e2(this.params)(t)}estimateContractExecutionFee(t){return QT(this.params)(t)}createUserTransactionContractExecutionChallenge(t){return XT(this.params)(t)}estimateTransferFee(t){return YT(this.params)(t)}validateAddress(t){return t2(this.params)(t)}getLowestNonceTransaction(t){return ZT(this.params)(t)}createUser(t){return r2(this.params)(t)}getUser(t){return i2(this.params)(t)}getUserStatus(t){return s2(this.params)(t)}listUsers(t){return c2(this.params)(t)}createUserToken(t){return eh(this.params)(t)}getUserChallenge(t){return o2(this.params)(t)}listUserChallenges(t){return l2(this.params)(t)}getToken(t){return HT(this.params)(t)}signMessage(t){return jT(this.params)(t)}signTransaction(t){return KT(this.params)(t)}signTypedData(t){return zT(this.params)(t)}requestTestnetTokens(t){return OT(this.params)(t)}createMonitoredTokens(t){return N1(this.params)(t)}updateMonitoredTokens(t){return O1(this.params)(t)}listMonitoredTokens(t){return P1(this.params)(t)}deleteMonitoredTokens(t){return L1(this.params)(t)}updateMonitoredTokensScope(t){return D1(this.params)(t)}createSubscription(t){return F1(this.params)(t)}deleteSubscription(t){return q1(this.params)(t)}getSubscription(t){return V1(this.params)(t)}getNotificationSignature(t){return M1(this.params)(t)}listSubscriptions(){return j1(this.params)()}updateSubscription(t){return K1(this.params)(t)}}function E2(e){return new th(e)}exports.BadGatewayError=Aa,exports.BadRequestError=ya,exports.Blockchain=ky,exports.CircleUserControlledWalletsClient=th,exports.ConnectionAbortedError=_a,exports.ConnectionRefusedError=Ra,exports.ConnectionResetError=Pa,exports.ConnectionTimeoutError=ka,exports.DNSNotFoundError=Ua,exports.DNSTimeoutError=Na,exports.Error110700=Au,exports.Error110701=Iu,exports.Error110702=Bu,exports.Error110703=Ru,exports.Error155101=Da,exports.Error155102=Fa,exports.Error155103=qa,exports.Error155104=Va,exports.Error155105=Ma,exports.Error155106=ja,exports.Error155107=Ka,exports.Error155108=za,exports.Error155109=Ha,exports.Error155110=$a,exports.Error155111=Ga,exports.Error155112=Wa,exports.Error155113=Xa,exports.Error155114=Qa,exports.Error155115=Ya,exports.Error155116=Ja,exports.Error155117=Za,exports.Error155118=en,exports.Error155119=tn,exports.Error155120=rn,exports.Error155121=an,exports.Error155122=nn,exports.Error155123=sn,exports.Error155124=on,exports.Error155130=cn,exports.Error155131=ln,exports.Error155132=un,exports.Error155133=pn,exports.Error155134=dn,exports.Error155135=fn,exports.Error155136=hn,exports.Error155137=mn,exports.Error155138=vn,exports.Error155139=gn,exports.Error155140=xn,exports.Error155141=yn,exports.Error155142=bn,exports.Error155143=En,exports.Error155144=Cn,exports.Error155145=Tn,exports.Error155146=Sn,exports.Error155150=wn,exports.Error155151=An,exports.Error155152=In,exports.Error155154=Bn,exports.Error155155=Rn,exports.Error155156=kn,exports.Error155157=_n,exports.Error155158=Un,exports.Error155159=Nn,exports.Error155160=Ln,exports.Error155201=Pn,exports.Error155202=On,exports.Error155203=Dn,exports.Error155204=Fn,exports.Error155205=qn,exports.Error155206=Vn,exports.Error155207=Mn,exports.Error155208=jn,exports.Error155209=Kn,exports.Error155210=zn,exports.Error155211=Hn,exports.Error155215=$n,exports.Error155218=Gn,exports.Error155219=Wn,exports.Error155220=Xn,exports.Error155221=Qn,exports.Error155222=Yn,exports.Error155223=Jn,exports.Error155224=Zn,exports.Error155225=ei,exports.Error155226=ti,exports.Error155227=ri,exports.Error155228=ai,exports.Error155229=ni,exports.Error155230=ii,exports.Error155231=si,exports.Error155232=oi,exports.Error155233=ci,exports.Error155234=li,exports.Error155235=ui,exports.Error155236=pi,exports.Error155237=di,exports.Error155238=fi,exports.Error155239=hi,exports.Error155240=mi,exports.Error155241=vi,exports.Error155242=gi,exports.Error155243=xi,exports.Error155244=yi,exports.Error155245=bi,exports.Error155247=Ei,exports.Error155254=Ci,exports.Error155257=Ti,exports.Error155258=Si,exports.Error155262=wi,exports.Error155264=Ai,exports.Error155501=Ii,exports.Error155502=Bi,exports.Error155503=Ri,exports.Error155504=ki,exports.Error155505=_i,exports.Error155506=Ui,exports.Error155507=Ni,exports.Error155508=Li,exports.Error155509=Pi,exports.Error155510=Oi,exports.Error155511=Di,exports.Error155512=Fi,exports.Error155514=qi,exports.Error155515=Vi,exports.Error155516=Mi,exports.Error155517=ji,exports.Error155601=Ki,exports.Error155701=zi,exports.Error155702=Hi,exports.Error155703=$i,exports.Error155704=Gi,exports.Error155705=Wi,exports.Error155706=Xi,exports.Error155707=Qi,exports.Error155708=Yi,exports.Error155709=Ji,exports.Error155710=Zi,exports.Error155711=es,exports.Error155712=ts,exports.Error155713=rs,exports.Error155714=as,exports.Error155715=ns,exports.Error155716=is,exports.Error155717=ss,exports.Error155718=os,exports.Error155719=cs,exports.Error155720=ls,exports.Error155721=us,exports.Error155801=ps,exports.Error155802=ds,exports.Error155803=fs,exports.Error155804=hs,exports.Error155805=ms,exports.Error155806=vs,exports.Error155807=gs,exports.Error155808=xs,exports.Error156001=ys,exports.Error156002=bs,exports.Error156003=Es,exports.Error156004=Cs,exports.Error156005=Ts,exports.Error156006=Ss,exports.Error156007=ws,exports.Error156008=As,exports.Error156009=Is,exports.Error156010=Bs,exports.Error156011=Rs,exports.Error156012=ks,exports.Error156013=_s,exports.Error156014=Us,exports.Error156015=Ns,exports.Error156016=Ls,exports.Error156017=Ps,exports.Error156018=Os,exports.Error156019=Ds,exports.Error156020=Fs,exports.Error156021=qs,exports.Error156023=Vs,exports.Error156024=Ms,exports.Error156025=js,exports.Error156026=Ks,exports.Error156027=zs,exports.Error156030=Hs,exports.Error156031=$s,exports.Error156032=Gs,exports.Error175001=Ws,exports.Error175002=Xs,exports.Error175003=Qs,exports.Error175004=Ys,exports.Error175005=Js,exports.Error175006=Zs,exports.Error175007=eo,exports.Error175008=to,exports.Error175009=ro,exports.Error175010=ao,exports.Error175011=no,exports.Error175012=io,exports.Error175013=so,exports.Error175201=oo,exports.Error175202=co,exports.Error175203=lo,exports.Error175204=uo,exports.Error175205=po,exports.Error175301=fo,exports.Error175302=ho,exports.Error175303=mo,exports.Error175401=vo,exports.Error175402=go,exports.Error175403=xo,exports.Error175404=yo,exports.Error175405=bo,exports.Error175406=Eo,exports.Error175407=Co,exports.Error175408=To,exports.Error175409=So,exports.Error175410=wo,exports.Error177001=Ao,exports.Error177002=Io,exports.Error177003=Bo,exports.Error177004=Ro,exports.Error177005=ko,exports.Error177006=_o,exports.Error177007=Uo,exports.Error177008=No,exports.Error177009=Lo,exports.Error177010=Po,exports.Error177011=Oo,exports.Error177012=Do,exports.Error177013=Fo,exports.Error177014=qo,exports.Error177015=Vo,exports.Error177016=Mo,exports.Error177017=jo,exports.Error177018=Ko,exports.Error177019=zo,exports.Error177020=Ho,exports.Error177021=$o,exports.Error177022=Go,exports.Error177023=Wo,exports.Error177024=Xo,exports.Error177025=Qo,exports.Error177026=Yo,exports.Error177301=Jo,exports.Error177302=Zo,exports.Error177303=ec,exports.Error177304=tc,exports.Error177305=rc,exports.Error177601=ac,exports.Error177602=nc,exports.Error177603=ic,exports.Error177604=sc,exports.Error177605=oc,exports.Error177606=cc,exports.Error177607=lc,exports.Error177901=uc,exports.ForbiddenError=Ea,exports.GatewayTimeoutError=Ba,exports.HostUnreachableError=Oa,exports.HttpError=xa,exports.HttpRequestError=Lt,exports.HttpResponseError=E,exports.InternalServerError=Sa,exports.NetworkUnreachableError=La,exports.NotFoundError=Ca,exports.NotImplementedError=wa,exports.RatelimitError=Ta,exports.ServiceUnavailableError=Ia,exports.UnauthorizedError=ba,exports.defaultBaseUrl=vp,exports.fromAxiosError=ee,exports.initiateUserControlledWalletsClient=E2;
@@ -43,4 +43,4 @@ import ga from"util";import Tt,{Readable as nh}from"stream";import xp from"path"
43
43
  Private-Lines: `+c+`\r
44
44
  `,s+=u;var y=yl("putty-private-key-file-mac-key",t),C=Je.util.createBuffer();ar(C,a),ar(C,n),ar(C,r),C.putInt32(i.length()),C.putBuffer(i),C.putInt32(l.length()),C.putBuffer(l);var I=Je.hmac.create();return I.start("sha1",y),I.update(C.bytes()),s+=`\r
45
45
  Private-MAC: `+I.digest().toHex()+`\r
46
- `,s},xl.publicKeyToOpenSSH=function(e,t){var r="ssh-rsa";t=t||"";var a=Je.util.createBuffer();return ar(a,r),Jt(a,e.e),Jt(a,e.n),r+" "+Je.util.encode64(a.bytes())+" "+t},xl.privateKeyToOpenSSH=function(e,t){return t?Je.pki.encryptRsaPrivateKey(e,t,{legacy:!0,algorithm:"aes128"}):Je.pki.privateKeyToPem(e)},xl.getPublicKeyFingerprint=function(e,t){t=t||{};var r=t.md||Je.md.md5.create(),a="ssh-rsa",n=Je.util.createBuffer();ar(n,a),Jt(n,e.e),Jt(n,e.n),r.start(),r.update(n.getBytes());var s=r.digest();if(t.encoding==="hex"){var i=s.toHex();return t.delimiter?i.match(/.{2}/g).join(t.delimiter):i}else{if(t.encoding==="binary")return s.getBytes();if(t.encoding)throw new Error('Unknown encoding "'+t.encoding+'".')}return s};function Jt(e,t){var r=t.toString(16);r[0]>="8"&&(r="00"+r);var a=Je.util.hexToBytes(r);e.putInt32(a.length),e.putBytes(a)}function ar(e,t){e.putInt32(t.length),e.putString(t)}function yl(){for(var e=Je.md.sha1.create(),t=arguments.length,r=0;r<t;++r)e.update(arguments[r]);return e.digest()}const Ut=()=>sh(),FT=({configurationsClient:e})=>async t=>{try{return await e.Faucet.requestTestnetTokens(void 0,t)}catch(r){throw te(r)?ee(r):r}};var Z0="10.3.0";const eh=({client:e})=>async({xRequestId:t,...r})=>{try{return re(await e.PINAuthentication.getUserToken({...r},t))}catch(a){throw te(a)?ee(a):a}},Ke=async(e,t,r=!1)=>{let a;return e.storage&&(a=await e.storage.get("userToken:"+t)),!r&&a?.userToken!=null&&a.expirationTime>Date.now()?a.userToken:await VT(e,t)};async function VT(e,t){const r=await eh(e)({userId:t});if(!r.data?.userToken)throw new Error("Could not fetch user token");return e.storage&&await e.storage.set("userToken:"+t,{...r.data,expirationTime:Date.now()+3e3*1e3}),r.data.userToken}const qT=e=>async({userToken:t,userId:r,idempotencyKey:a,xRequestId:n})=>{try{return re(await e.client.PINAuthentication.createUserPinChallenge(t??await Ke(e,r),{idempotencyKey:a??Ut()},n))}catch(s){throw te(s)?ee(s):s}},MT=e=>async({userToken:t,userId:r,idempotencyKey:a,accountType:n="EOA",xRequestId:s,...i})=>{try{return re(await e.client.Users.createUserWithPinChallenge(t??await Ke(e,r),{idempotencyKey:a??Ut(),accountType:n,...i},s))}catch(o){throw te(o)?ee(o):o}},jT=e=>async({userToken:t,userId:r,idempotencyKey:a,xRequestId:n})=>{try{return re(await e.client.PINAuthentication.createUserPinRestoreChallenge(t??await Ke(e,r),{idempotencyKey:a??Ut()},n))}catch(s){throw te(s)?ee(s):s}},KT=e=>async({userToken:t,userId:r,idempotencyKey:a})=>{try{return re(await e.client.PINAuthentication.updateUserPinChallenge(t??await Ke(e,r),{idempotencyKey:a??Ut()}))}catch(n){throw te(n)?ee(n):n}},zT=e=>async({userToken:t,userId:r,xRequestId:a,...n})=>{try{return re(await e.client.Signing.signUserMessage(t??await Ke(e,r),n,a))}catch(s){throw te(s)?ee(s):s}},HT=e=>async({userToken:t,userId:r,xRequestId:a,...n})=>{try{return re(await e.client.Signing.signUserTransaction(t??await Ke(e,r),{...n},a))}catch(s){throw te(s)?ee(s):s}},$T=e=>async({userToken:t,userId:r,xRequestId:a,...n})=>{try{return re(await e.client.Signing.signUserTypedData(t??await Ke(e,r),n,a))}catch(s){throw te(s)?ee(s):s}},GT=({client:e})=>async({id:t})=>{try{return re(await e.TokenLookup.getTokenId(t))}catch(r){throw te(r)?ee(r):r}},WT=e=>async({userToken:t,userId:r,id:a,idempotencyKey:n,xRequestId:s})=>{try{return re(await e.client.Transactions.createUserTransactionAccelerateChallenge(t??await Ke(e,r),a,{idempotencyKey:n??Ut()},s))}catch(i){throw te(i)?ee(i):i}},XT=e=>async({userToken:t,userId:r,id:a,idempotencyKey:n,xRequestId:s})=>{try{return re(await e.client.Transactions.createUserTransactionCancelChallenge(t??await Ke(e,r),a,{idempotencyKey:n??Ut()},s))}catch(i){throw te(i)?ee(i):i}},QT=e=>async({userToken:t,userId:r,idempotencyKey:a,fee:n,xRequestId:s,...i})=>{try{return re(await e.client.Transactions.createUserTransactionTransferChallenge(t??await Ke(e,r),{idempotencyKey:a??Ut(),...n.config,...i},s))}catch(o){throw te(o)?ee(o):o}},YT=e=>async({userToken:t,userId:r,idempotencyKey:a,fee:n,xRequestId:s,...i})=>{try{return re(await e.client.Transactions.createUserTransactionContractExecutionChallenge(t??await Ke(e,r),{idempotencyKey:a??Ut(),...n.config,...i},s))}catch(o){throw te(o)?ee(o):o}},JT=e=>async({userId:t,userToken:r,source:a,xRequestId:n,...s})=>{try{return re(await e.client.Transactions.createTransactionEstimateFee(r??await Ke(e,t),{...s,...a},n))}catch(i){throw te(i)?ee(i):i}},ZT=e=>async({userToken:t,userId:r,amount:a,xRequestId:n,...s})=>{try{return re(await e.client.Transactions.createTransferEstimateFee(t??await Ke(e,r),{amounts:a,...s},n))}catch(i){throw te(i)?ee(i):i}},e2=e=>async({id:t,userToken:r,userId:a,txType:n,xRequestId:s})=>{try{return re(await e.client.Transactions.getTransaction(t,r??await Ke(e,a),n,s))}catch(i){throw te(i)?ee(i):i}},t2=({client:e})=>async({blockchain:t,address:r,walletId:a,xRequestId:n}={})=>{try{return re(await e.Transactions.getLowestNonceTransaction(t,r,a,{headers:n?{"X-Request-Id":n}:void 0}))}catch(s){throw te(s)?ee(s):s}},a2=e=>async({userToken:t,blockchain:r,destinationAddress:a,includeAll:n,operation:s,state:i,txHash:o,txType:c,userId:l,walletIds:u,from:p,pageAfter:d,pageBefore:g,pageSize:h,to:b,order:y,xRequestId:C})=>{try{return re(await e.client.Transactions.listTransactions(t??await Ke(e,l),r,a,n,s,i,o,c,l,u?.join(","),p,b,g,d,h,y,C))}catch(I){throw te(I)?ee(I):I}},r2=({client:e})=>async t=>{try{return re(await e.Transactions.createValidateAddress(t))}catch(r){throw te(r)?ee(r):r}},n2=({client:e})=>async({...t})=>{try{return re(await e.PINAuthentication.createUser({...t}))}catch(r){throw te(r)?ee(r):r}},i2=e=>async({userToken:t,idempotencyKey:r,userId:a,xRequestId:n,...s})=>{try{return re(await e.client.SocialEmailAuthentication.resendOTP(t??await Ke(e,a),{idempotencyKey:r??Ut(),...s},n))}catch(i){throw te(i)?ee(i):i}},s2=({client:e})=>async({idempotencyKey:t,xRequestId:r,...a})=>{try{return re(await e.SocialEmailAuthentication.createDeviceTokenEmailLogin({idempotencyKey:t??Ut(),...a},r))}catch(n){throw te(n)?ee(n):n}},o2=({client:e})=>async({userId:t,xRequestId:r})=>{try{return re(await e.Users.getUser(t,r))}catch(a){throw te(a)?ee(a):a}},c2=({client:e})=>async({userToken:t,xRequestId:r})=>{try{return re(await e.Users.getUserByToken(t,r))}catch(a){throw te(a)?ee(a):a}},l2=({client:e})=>async({userToken:t,challengeId:r,xRequestId:a})=>{try{return re(await e.Users.getUserChallenge(t,r,a))}catch(n){throw te(n)?ee(n):n}},u2=({client:e})=>async({pinStatus:t,securityQuestionStatus:r,from:a,to:n,pageBefore:s,pageAfter:i,pageSize:o,order:c,xRequestId:l}={})=>{try{return re(await e.Users.listUsers(t,r,a,n,s,i,o,c,l))}catch(u){throw te(u)?ee(u):u}},p2=({client:e})=>async({userToken:t,challengeStatus:r,xRequestId:a})=>{try{return re(await e.Users.listUserChallenges(t,r,a))}catch(n){throw te(n)?ee(n):n}},d2=e=>async({userId:t,userToken:r,deviceId:a,idempotencyKey:n,refreshToken:s,xRequestId:i})=>{try{return re(await e.client.SocialEmailAuthentication.refreshUserToken(r??await Ke(e,t),{idempotencyKey:n??Ut(),refreshToken:s,deviceId:a},i))}catch(o){throw te(o)?ee(o):o}},f2=({client:e})=>async({idempotencyKey:t,xRequestId:r,...a})=>{try{return re(await e.SocialEmailAuthentication.createDeviceTokenSocialLogin({idempotencyKey:t??Ut(),...a},r))}catch(n){throw te(n)?ee(n):n}},h2=e=>async({userToken:t,userId:r,idempotencyKey:a,accountType:n="EOA",xRequestId:s,...i})=>{try{return re(await e.client.Wallets.createUserWallet(t??await Ke(e,r),{idempotencyKey:a??Ut(),accountType:n,...i},s))}catch(o){throw te(o)?ee(o):o}},m2=e=>async({id:t,userToken:r,userId:a,xRequestId:n})=>{try{return re(await e.client.Wallets.getWallet(t,r??await Ke(e,a),n))}catch(s){throw te(s)?ee(s):s}},v2=e=>async({walletId:t,userToken:r,userId:a,includeAll:n,name:s,pageAfter:i,pageBefore:o,pageSize:c,tokenAddresses:l,standard:u,xRequestId:p})=>{try{return re(await e.client.Wallets.listWalletNfts(r??await Ke(e,a),t,n,s,l?.join(","),u,o,i,c,p))}catch(d){throw te(d)?ee(d):d}},g2=e=>async({walletId:t,userToken:r,userId:a,includeAll:n,name:s,pageAfter:i,pageBefore:o,pageSize:c,tokenAddresses:l,standard:u,xRequestId:p})=>{try{return re(await e.client.Wallets.listWalletBalance(r??await Ke(e,a),t,n,s,l?.join(","),u,o,i,c,p))}catch(d){throw te(d)?ee(d):d}},x2=e=>async({userId:t,userToken:r,address:a,blockchain:n,from:s,pageAfter:i,pageBefore:o,pageSize:c,to:l,walletSetId:u,refId:p,scaCore:d,order:g,xRequestId:h})=>{try{return re(await e.client.Wallets.listWallets(r??await Ke(e,t),a,n,d,u,p,s,l,o,i,c,g,h))}catch(b){throw te(b)?ee(b):b}},y2=e=>async({id:t,name:r,refId:a,userToken:n,userId:s})=>{try{return re(await e.client.Wallets.updateWallet(t,n??await Ke(e,s),{name:r,refId:a}))}catch(i){throw te(i)?ee(i):i}};var b2=Object.defineProperty,E2=(e,t,r)=>t in e?b2(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,C2=(e,t,r)=>E2(e,typeof t!="symbol"?t+"":t,r);const vp="https://api.circle.com";class th{constructor(t){C2(this,"params");const{apiKey:r,baseUrl:a,storage:n,userAgent:s,headers:i}=t;this.params={client:new Py(a??vp,{apiKey:r,version:Z0,userAgent:s},i),configurationsClient:new sy(a??vp,{apiKey:r,version:Z0,userAgent:s},i),storage:n??new X1}}createUserPin(t){return qT(this.params)(t)}createUserPinWithWallets(t){return MT(this.params)(t)}updateUserPin(t){return KT(this.params)(t)}restoreUserPin(t){return jT(this.params)(t)}createDeviceTokenForEmailLogin(t){return s2(this.params)(t)}createDeviceTokenForSocialLogin(t){return f2(this.params)(t)}refreshUserToken(t){return d2(this.params)(t)}resendOTP(t){return i2(this.params)(t)}createWallet(t){return h2(this.params)(t)}listWallets(t){return x2(this.params)(t)}getWallet(t){return m2(this.params)(t)}updateWallet(t){return y2(this.params)(t)}getWalletTokenBalance(t){return g2(this.params)(t)}getWalletNFTBalance(t){return v2(this.params)(t)}accelerateTransaction(t){return WT(this.params)(t)}createTransaction(t){return QT(this.params)(t)}cancelTransaction(t){return XT(this.params)(t)}getTransaction(t){return e2(this.params)(t)}listTransactions(t){return a2(this.params)(t)}estimateContractExecutionFee(t){return JT(this.params)(t)}createUserTransactionContractExecutionChallenge(t){return YT(this.params)(t)}estimateTransferFee(t){return ZT(this.params)(t)}validateAddress(t){return r2(this.params)(t)}getLowestNonceTransaction(t){return t2(this.params)(t)}createUser(t){return n2(this.params)(t)}getUser(t){return o2(this.params)(t)}getUserStatus(t){return c2(this.params)(t)}listUsers(t){return u2(this.params)(t)}createUserToken(t){return eh(this.params)(t)}getUserChallenge(t){return l2(this.params)(t)}listUserChallenges(t){return p2(this.params)(t)}getToken(t){return GT(this.params)(t)}signMessage(t){return zT(this.params)(t)}signTransaction(t){return HT(this.params)(t)}signTypedData(t){return $T(this.params)(t)}requestTestnetTokens(t){return FT(this.params)(t)}createMonitoredTokens(t){return P1(this.params)(t)}updateMonitoredTokens(t){return F1(this.params)(t)}listMonitoredTokens(t){return D1(this.params)(t)}deleteMonitoredTokens(t){return O1(this.params)(t)}updateMonitoredTokensScope(t){return V1(this.params)(t)}createSubscription(t){return q1(this.params)(t)}deleteSubscription(t){return M1(this.params)(t)}getSubscription(t){return j1(this.params)(t)}getNotificationSignature(t){return K1(this.params)(t)}listSubscriptions(){return z1(this.params)()}updateSubscription(t){return H1(this.params)(t)}}function T2(e){return new th(e)}export{Ar as BadGatewayError,yr as BadRequestError,Uy as Blockchain,th as CircleUserControlledWalletsClient,_r as ConnectionAbortedError,Rr as ConnectionRefusedError,Pr as ConnectionResetError,kr as ConnectionTimeoutError,Ur as DNSNotFoundError,Nr as DNSTimeoutError,Au as Error110700,Iu as Error110701,Bu as Error110702,Ru as Error110703,Dr as Error155101,Fr as Error155102,Vr as Error155103,qr as Error155104,Mr as Error155105,jr as Error155106,Kr as Error155107,zr as Error155108,Hr as Error155109,$r as Error155110,Gr as Error155111,Wr as Error155112,Xr as Error155113,Qr as Error155114,Yr as Error155115,Jr as Error155116,Zr as Error155117,en as Error155118,tn as Error155119,an as Error155120,rn as Error155121,nn as Error155122,sn as Error155123,on as Error155124,cn as Error155130,ln as Error155131,un as Error155132,pn as Error155133,dn as Error155134,fn as Error155135,hn as Error155136,mn as Error155137,vn as Error155138,gn as Error155139,xn as Error155140,yn as Error155141,bn as Error155142,En as Error155143,Cn as Error155144,Tn as Error155145,Sn as Error155146,wn as Error155150,An as Error155151,In as Error155152,Bn as Error155154,Rn as Error155155,kn as Error155156,_n as Error155157,Un as Error155158,Nn as Error155159,Ln as Error155160,Pn as Error155201,On as Error155202,Dn as Error155203,Fn as Error155204,Vn as Error155205,qn as Error155206,Mn as Error155207,jn as Error155208,Kn as Error155209,zn as Error155210,Hn as Error155211,$n as Error155215,Gn as Error155218,Wn as Error155219,Xn as Error155220,Qn as Error155221,Yn as Error155222,Jn as Error155223,Zn as Error155224,ei as Error155225,ti as Error155226,ai as Error155227,ri as Error155228,ni as Error155229,ii as Error155230,si as Error155231,oi as Error155232,ci as Error155233,li as Error155234,ui as Error155235,pi as Error155236,di as Error155237,fi as Error155238,hi as Error155239,mi as Error155240,vi as Error155241,gi as Error155242,xi as Error155243,yi as Error155244,bi as Error155245,Ei as Error155247,Ci as Error155254,Ti as Error155257,Si as Error155258,wi as Error155262,Ai as Error155264,Ii as Error155501,Bi as Error155502,Ri as Error155503,ki as Error155504,_i as Error155505,Ui as Error155506,Ni as Error155507,Li as Error155508,Pi as Error155509,Oi as Error155510,Di as Error155511,Fi as Error155512,Vi as Error155514,qi as Error155515,Mi as Error155516,ji as Error155517,Ki as Error155601,zi as Error155701,Hi as Error155702,$i as Error155703,Gi as Error155704,Wi as Error155705,Xi as Error155706,Qi as Error155707,Yi as Error155708,Ji as Error155709,Zi as Error155710,es as Error155711,ts as Error155712,as as Error155713,rs as Error155714,ns as Error155715,is as Error155716,ss as Error155717,os as Error155718,cs as Error155719,ls as Error155720,us as Error155721,ps as Error155801,ds as Error155802,fs as Error155803,hs as Error155804,ms as Error155805,vs as Error155806,gs as Error155807,xs as Error155808,ys as Error156001,bs as Error156002,Es as Error156003,Cs as Error156004,Ts as Error156005,Ss as Error156006,ws as Error156007,As as Error156008,Is as Error156009,Bs as Error156010,Rs as Error156011,ks as Error156012,_s as Error156013,Us as Error156014,Ns as Error156015,Ls as Error156016,Ps as Error156017,Os as Error156018,Ds as Error156019,Fs as Error156020,Vs as Error156021,qs as Error156023,Ms as Error156024,js as Error156025,Ks as Error156026,zs as Error156027,Hs as Error156030,$s as Error156031,Gs as Error156032,Ws as Error175001,Xs as Error175002,Qs as Error175003,Ys as Error175004,Js as Error175005,Zs as Error175006,eo as Error175007,to as Error175008,ao as Error175009,ro as Error175010,no as Error175011,io as Error175012,so as Error175013,oo as Error175201,co as Error175202,lo as Error175203,uo as Error175204,po as Error175205,fo as Error175301,ho as Error175302,mo as Error175303,vo as Error175401,go as Error175402,xo as Error175403,yo as Error175404,bo as Error175405,Eo as Error175406,Co as Error175407,To as Error175408,So as Error175409,wo as Error175410,Ao as Error177001,Io as Error177002,Bo as Error177003,Ro as Error177004,ko as Error177005,_o as Error177006,Uo as Error177007,No as Error177008,Lo as Error177009,Po as Error177010,Oo as Error177011,Do as Error177012,Fo as Error177013,Vo as Error177014,qo as Error177015,Mo as Error177016,jo as Error177017,Ko as Error177018,zo as Error177019,Ho as Error177020,$o as Error177021,Go as Error177022,Wo as Error177023,Xo as Error177024,Qo as Error177025,Yo as Error177026,Jo as Error177301,Zo as Error177302,ec as Error177303,tc as Error177304,ac as Error177305,rc as Error177601,nc as Error177602,ic as Error177603,sc as Error177604,oc as Error177605,cc as Error177606,lc as Error177607,uc as Error177901,Er as ForbiddenError,Br as GatewayTimeoutError,Or as HostUnreachableError,xr as HttpError,Lt as HttpRequestError,E as HttpResponseError,Sr as InternalServerError,Lr as NetworkUnreachableError,Cr as NotFoundError,wr as NotImplementedError,Tr as RatelimitError,Ir as ServiceUnavailableError,br as UnauthorizedError,vp as defaultBaseUrl,ee as fromAxiosError,T2 as initiateUserControlledWalletsClient};
46
+ `,s},xl.publicKeyToOpenSSH=function(e,t){var r="ssh-rsa";t=t||"";var a=Je.util.createBuffer();return ar(a,r),Jt(a,e.e),Jt(a,e.n),r+" "+Je.util.encode64(a.bytes())+" "+t},xl.privateKeyToOpenSSH=function(e,t){return t?Je.pki.encryptRsaPrivateKey(e,t,{legacy:!0,algorithm:"aes128"}):Je.pki.privateKeyToPem(e)},xl.getPublicKeyFingerprint=function(e,t){t=t||{};var r=t.md||Je.md.md5.create(),a="ssh-rsa",n=Je.util.createBuffer();ar(n,a),Jt(n,e.e),Jt(n,e.n),r.start(),r.update(n.getBytes());var s=r.digest();if(t.encoding==="hex"){var i=s.toHex();return t.delimiter?i.match(/.{2}/g).join(t.delimiter):i}else{if(t.encoding==="binary")return s.getBytes();if(t.encoding)throw new Error('Unknown encoding "'+t.encoding+'".')}return s};function Jt(e,t){var r=t.toString(16);r[0]>="8"&&(r="00"+r);var a=Je.util.hexToBytes(r);e.putInt32(a.length),e.putBytes(a)}function ar(e,t){e.putInt32(t.length),e.putString(t)}function yl(){for(var e=Je.md.sha1.create(),t=arguments.length,r=0;r<t;++r)e.update(arguments[r]);return e.digest()}const Ut=()=>sh(),FT=({configurationsClient:e})=>async t=>{try{return await e.Faucet.requestTestnetTokens(void 0,t)}catch(r){throw te(r)?ee(r):r}};var Z0="10.3.1";const eh=({client:e})=>async({xRequestId:t,...r})=>{try{return re(await e.PINAuthentication.getUserToken({...r},t))}catch(a){throw te(a)?ee(a):a}},Ke=async(e,t,r=!1)=>{let a;return e.storage&&(a=await e.storage.get("userToken:"+t)),!r&&a?.userToken!=null&&a.expirationTime>Date.now()?a.userToken:await VT(e,t)};async function VT(e,t){const r=await eh(e)({userId:t});if(!r.data?.userToken)throw new Error("Could not fetch user token");return e.storage&&await e.storage.set("userToken:"+t,{...r.data,expirationTime:Date.now()+3e3*1e3}),r.data.userToken}const qT=e=>async({userToken:t,userId:r,idempotencyKey:a,xRequestId:n})=>{try{return re(await e.client.PINAuthentication.createUserPinChallenge(t??await Ke(e,r),{idempotencyKey:a??Ut()},n))}catch(s){throw te(s)?ee(s):s}},MT=e=>async({userToken:t,userId:r,idempotencyKey:a,accountType:n="EOA",xRequestId:s,...i})=>{try{return re(await e.client.Users.createUserWithPinChallenge(t??await Ke(e,r),{idempotencyKey:a??Ut(),accountType:n,...i},s))}catch(o){throw te(o)?ee(o):o}},jT=e=>async({userToken:t,userId:r,idempotencyKey:a,xRequestId:n})=>{try{return re(await e.client.PINAuthentication.createUserPinRestoreChallenge(t??await Ke(e,r),{idempotencyKey:a??Ut()},n))}catch(s){throw te(s)?ee(s):s}},KT=e=>async({userToken:t,userId:r,idempotencyKey:a})=>{try{return re(await e.client.PINAuthentication.updateUserPinChallenge(t??await Ke(e,r),{idempotencyKey:a??Ut()}))}catch(n){throw te(n)?ee(n):n}},zT=e=>async({userToken:t,userId:r,xRequestId:a,...n})=>{try{return re(await e.client.Signing.signUserMessage(t??await Ke(e,r),n,a))}catch(s){throw te(s)?ee(s):s}},HT=e=>async({userToken:t,userId:r,xRequestId:a,...n})=>{try{return re(await e.client.Signing.signUserTransaction(t??await Ke(e,r),{...n},a))}catch(s){throw te(s)?ee(s):s}},$T=e=>async({userToken:t,userId:r,xRequestId:a,...n})=>{try{return re(await e.client.Signing.signUserTypedData(t??await Ke(e,r),n,a))}catch(s){throw te(s)?ee(s):s}},GT=({client:e})=>async({id:t})=>{try{return re(await e.TokenLookup.getTokenId(t))}catch(r){throw te(r)?ee(r):r}},WT=e=>async({userToken:t,userId:r,id:a,idempotencyKey:n,xRequestId:s})=>{try{return re(await e.client.Transactions.createUserTransactionAccelerateChallenge(t??await Ke(e,r),a,{idempotencyKey:n??Ut()},s))}catch(i){throw te(i)?ee(i):i}},XT=e=>async({userToken:t,userId:r,id:a,idempotencyKey:n,xRequestId:s})=>{try{return re(await e.client.Transactions.createUserTransactionCancelChallenge(t??await Ke(e,r),a,{idempotencyKey:n??Ut()},s))}catch(i){throw te(i)?ee(i):i}},QT=e=>async({userToken:t,userId:r,idempotencyKey:a,fee:n,xRequestId:s,...i})=>{try{return re(await e.client.Transactions.createUserTransactionTransferChallenge(t??await Ke(e,r),{idempotencyKey:a??Ut(),...n.config,...i},s))}catch(o){throw te(o)?ee(o):o}},YT=e=>async({userToken:t,userId:r,idempotencyKey:a,fee:n,xRequestId:s,...i})=>{try{return re(await e.client.Transactions.createUserTransactionContractExecutionChallenge(t??await Ke(e,r),{idempotencyKey:a??Ut(),...n.config,...i},s))}catch(o){throw te(o)?ee(o):o}},JT=e=>async({userId:t,userToken:r,source:a,xRequestId:n,...s})=>{try{return re(await e.client.Transactions.createTransactionEstimateFee(r??await Ke(e,t),{...s,...a},n))}catch(i){throw te(i)?ee(i):i}},ZT=e=>async({userToken:t,userId:r,amount:a,xRequestId:n,...s})=>{try{return re(await e.client.Transactions.createTransferEstimateFee(t??await Ke(e,r),{amounts:a,...s},n))}catch(i){throw te(i)?ee(i):i}},e2=e=>async({id:t,userToken:r,userId:a,txType:n,xRequestId:s})=>{try{return re(await e.client.Transactions.getTransaction(t,r??await Ke(e,a),n,s))}catch(i){throw te(i)?ee(i):i}},t2=({client:e})=>async({blockchain:t,address:r,walletId:a,xRequestId:n}={})=>{try{return re(await e.Transactions.getLowestNonceTransaction(t,r,a,{headers:n?{"X-Request-Id":n}:void 0}))}catch(s){throw te(s)?ee(s):s}},a2=e=>async({userToken:t,blockchain:r,destinationAddress:a,includeAll:n,operation:s,state:i,txHash:o,txType:c,userId:l,walletIds:u,from:p,pageAfter:d,pageBefore:g,pageSize:h,to:b,order:y,xRequestId:C})=>{try{return re(await e.client.Transactions.listTransactions(t??await Ke(e,l),r,a,n,s,i,o,c,l,u?.join(","),p,b,g,d,h,y,C))}catch(I){throw te(I)?ee(I):I}},r2=({client:e})=>async t=>{try{return re(await e.Transactions.createValidateAddress(t))}catch(r){throw te(r)?ee(r):r}},n2=({client:e})=>async({...t})=>{try{return re(await e.PINAuthentication.createUser({...t}))}catch(r){throw te(r)?ee(r):r}},i2=e=>async({userToken:t,idempotencyKey:r,userId:a,xRequestId:n,...s})=>{try{return re(await e.client.SocialEmailAuthentication.resendOTP(t??await Ke(e,a),{idempotencyKey:r??Ut(),...s},n))}catch(i){throw te(i)?ee(i):i}},s2=({client:e})=>async({idempotencyKey:t,xRequestId:r,...a})=>{try{return re(await e.SocialEmailAuthentication.createDeviceTokenEmailLogin({idempotencyKey:t??Ut(),...a},r))}catch(n){throw te(n)?ee(n):n}},o2=({client:e})=>async({userId:t,xRequestId:r})=>{try{return re(await e.Users.getUser(t,r))}catch(a){throw te(a)?ee(a):a}},c2=({client:e})=>async({userToken:t,xRequestId:r})=>{try{return re(await e.Users.getUserByToken(t,r))}catch(a){throw te(a)?ee(a):a}},l2=({client:e})=>async({userToken:t,challengeId:r,xRequestId:a})=>{try{return re(await e.Users.getUserChallenge(t,r,a))}catch(n){throw te(n)?ee(n):n}},u2=({client:e})=>async({pinStatus:t,securityQuestionStatus:r,from:a,to:n,pageBefore:s,pageAfter:i,pageSize:o,order:c,xRequestId:l}={})=>{try{return re(await e.Users.listUsers(t,r,a,n,s,i,o,c,l))}catch(u){throw te(u)?ee(u):u}},p2=({client:e})=>async({userToken:t,challengeStatus:r,xRequestId:a})=>{try{return re(await e.Users.listUserChallenges(t,r,a))}catch(n){throw te(n)?ee(n):n}},d2=e=>async({userId:t,userToken:r,deviceId:a,idempotencyKey:n,refreshToken:s,xRequestId:i})=>{try{return re(await e.client.SocialEmailAuthentication.refreshUserToken(r??await Ke(e,t),{idempotencyKey:n??Ut(),refreshToken:s,deviceId:a},i))}catch(o){throw te(o)?ee(o):o}},f2=({client:e})=>async({idempotencyKey:t,xRequestId:r,...a})=>{try{return re(await e.SocialEmailAuthentication.createDeviceTokenSocialLogin({idempotencyKey:t??Ut(),...a},r))}catch(n){throw te(n)?ee(n):n}},h2=e=>async({userToken:t,userId:r,idempotencyKey:a,accountType:n="EOA",xRequestId:s,...i})=>{try{return re(await e.client.Wallets.createUserWallet(t??await Ke(e,r),{idempotencyKey:a??Ut(),accountType:n,...i},s))}catch(o){throw te(o)?ee(o):o}},m2=e=>async({id:t,userToken:r,userId:a,xRequestId:n})=>{try{return re(await e.client.Wallets.getWallet(t,r??await Ke(e,a),n))}catch(s){throw te(s)?ee(s):s}},v2=e=>async({walletId:t,userToken:r,userId:a,includeAll:n,name:s,pageAfter:i,pageBefore:o,pageSize:c,tokenAddresses:l,standard:u,xRequestId:p})=>{try{return re(await e.client.Wallets.listWalletNfts(r??await Ke(e,a),t,n,s,l?.join(","),u,o,i,c,p))}catch(d){throw te(d)?ee(d):d}},g2=e=>async({walletId:t,userToken:r,userId:a,includeAll:n,name:s,pageAfter:i,pageBefore:o,pageSize:c,tokenAddresses:l,standard:u,xRequestId:p})=>{try{return re(await e.client.Wallets.listWalletBalance(r??await Ke(e,a),t,n,s,l?.join(","),u,o,i,c,p))}catch(d){throw te(d)?ee(d):d}},x2=e=>async({userId:t,userToken:r,address:a,blockchain:n,from:s,pageAfter:i,pageBefore:o,pageSize:c,to:l,walletSetId:u,refId:p,scaCore:d,order:g,xRequestId:h})=>{try{return re(await e.client.Wallets.listWallets(r??await Ke(e,t),a,n,d,u,p,s,l,o,i,c,g,h))}catch(b){throw te(b)?ee(b):b}},y2=e=>async({id:t,name:r,refId:a,userToken:n,userId:s})=>{try{return re(await e.client.Wallets.updateWallet(t,n??await Ke(e,s),{name:r,refId:a}))}catch(i){throw te(i)?ee(i):i}};var b2=Object.defineProperty,E2=(e,t,r)=>t in e?b2(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,C2=(e,t,r)=>E2(e,typeof t!="symbol"?t+"":t,r);const vp="https://api.circle.com";class th{constructor(t){C2(this,"params");const{apiKey:r,baseUrl:a,storage:n,userAgent:s,headers:i}=t;this.params={client:new Py(a??vp,{apiKey:r,version:Z0,userAgent:s},i),configurationsClient:new sy(a??vp,{apiKey:r,version:Z0,userAgent:s},i),storage:n??new X1}}createUserPin(t){return qT(this.params)(t)}createUserPinWithWallets(t){return MT(this.params)(t)}updateUserPin(t){return KT(this.params)(t)}restoreUserPin(t){return jT(this.params)(t)}createDeviceTokenForEmailLogin(t){return s2(this.params)(t)}createDeviceTokenForSocialLogin(t){return f2(this.params)(t)}refreshUserToken(t){return d2(this.params)(t)}resendOTP(t){return i2(this.params)(t)}createWallet(t){return h2(this.params)(t)}listWallets(t){return x2(this.params)(t)}getWallet(t){return m2(this.params)(t)}updateWallet(t){return y2(this.params)(t)}getWalletTokenBalance(t){return g2(this.params)(t)}getWalletNFTBalance(t){return v2(this.params)(t)}accelerateTransaction(t){return WT(this.params)(t)}createTransaction(t){return QT(this.params)(t)}cancelTransaction(t){return XT(this.params)(t)}getTransaction(t){return e2(this.params)(t)}listTransactions(t){return a2(this.params)(t)}estimateContractExecutionFee(t){return JT(this.params)(t)}createUserTransactionContractExecutionChallenge(t){return YT(this.params)(t)}estimateTransferFee(t){return ZT(this.params)(t)}validateAddress(t){return r2(this.params)(t)}getLowestNonceTransaction(t){return t2(this.params)(t)}createUser(t){return n2(this.params)(t)}getUser(t){return o2(this.params)(t)}getUserStatus(t){return c2(this.params)(t)}listUsers(t){return u2(this.params)(t)}createUserToken(t){return eh(this.params)(t)}getUserChallenge(t){return l2(this.params)(t)}listUserChallenges(t){return p2(this.params)(t)}getToken(t){return GT(this.params)(t)}signMessage(t){return zT(this.params)(t)}signTransaction(t){return HT(this.params)(t)}signTypedData(t){return $T(this.params)(t)}requestTestnetTokens(t){return FT(this.params)(t)}createMonitoredTokens(t){return P1(this.params)(t)}updateMonitoredTokens(t){return F1(this.params)(t)}listMonitoredTokens(t){return D1(this.params)(t)}deleteMonitoredTokens(t){return O1(this.params)(t)}updateMonitoredTokensScope(t){return V1(this.params)(t)}createSubscription(t){return q1(this.params)(t)}deleteSubscription(t){return M1(this.params)(t)}getSubscription(t){return j1(this.params)(t)}getNotificationSignature(t){return K1(this.params)(t)}listSubscriptions(){return z1(this.params)()}updateSubscription(t){return H1(this.params)(t)}}function T2(e){return new th(e)}export{Ar as BadGatewayError,yr as BadRequestError,Uy as Blockchain,th as CircleUserControlledWalletsClient,_r as ConnectionAbortedError,Rr as ConnectionRefusedError,Pr as ConnectionResetError,kr as ConnectionTimeoutError,Ur as DNSNotFoundError,Nr as DNSTimeoutError,Au as Error110700,Iu as Error110701,Bu as Error110702,Ru as Error110703,Dr as Error155101,Fr as Error155102,Vr as Error155103,qr as Error155104,Mr as Error155105,jr as Error155106,Kr as Error155107,zr as Error155108,Hr as Error155109,$r as Error155110,Gr as Error155111,Wr as Error155112,Xr as Error155113,Qr as Error155114,Yr as Error155115,Jr as Error155116,Zr as Error155117,en as Error155118,tn as Error155119,an as Error155120,rn as Error155121,nn as Error155122,sn as Error155123,on as Error155124,cn as Error155130,ln as Error155131,un as Error155132,pn as Error155133,dn as Error155134,fn as Error155135,hn as Error155136,mn as Error155137,vn as Error155138,gn as Error155139,xn as Error155140,yn as Error155141,bn as Error155142,En as Error155143,Cn as Error155144,Tn as Error155145,Sn as Error155146,wn as Error155150,An as Error155151,In as Error155152,Bn as Error155154,Rn as Error155155,kn as Error155156,_n as Error155157,Un as Error155158,Nn as Error155159,Ln as Error155160,Pn as Error155201,On as Error155202,Dn as Error155203,Fn as Error155204,Vn as Error155205,qn as Error155206,Mn as Error155207,jn as Error155208,Kn as Error155209,zn as Error155210,Hn as Error155211,$n as Error155215,Gn as Error155218,Wn as Error155219,Xn as Error155220,Qn as Error155221,Yn as Error155222,Jn as Error155223,Zn as Error155224,ei as Error155225,ti as Error155226,ai as Error155227,ri as Error155228,ni as Error155229,ii as Error155230,si as Error155231,oi as Error155232,ci as Error155233,li as Error155234,ui as Error155235,pi as Error155236,di as Error155237,fi as Error155238,hi as Error155239,mi as Error155240,vi as Error155241,gi as Error155242,xi as Error155243,yi as Error155244,bi as Error155245,Ei as Error155247,Ci as Error155254,Ti as Error155257,Si as Error155258,wi as Error155262,Ai as Error155264,Ii as Error155501,Bi as Error155502,Ri as Error155503,ki as Error155504,_i as Error155505,Ui as Error155506,Ni as Error155507,Li as Error155508,Pi as Error155509,Oi as Error155510,Di as Error155511,Fi as Error155512,Vi as Error155514,qi as Error155515,Mi as Error155516,ji as Error155517,Ki as Error155601,zi as Error155701,Hi as Error155702,$i as Error155703,Gi as Error155704,Wi as Error155705,Xi as Error155706,Qi as Error155707,Yi as Error155708,Ji as Error155709,Zi as Error155710,es as Error155711,ts as Error155712,as as Error155713,rs as Error155714,ns as Error155715,is as Error155716,ss as Error155717,os as Error155718,cs as Error155719,ls as Error155720,us as Error155721,ps as Error155801,ds as Error155802,fs as Error155803,hs as Error155804,ms as Error155805,vs as Error155806,gs as Error155807,xs as Error155808,ys as Error156001,bs as Error156002,Es as Error156003,Cs as Error156004,Ts as Error156005,Ss as Error156006,ws as Error156007,As as Error156008,Is as Error156009,Bs as Error156010,Rs as Error156011,ks as Error156012,_s as Error156013,Us as Error156014,Ns as Error156015,Ls as Error156016,Ps as Error156017,Os as Error156018,Ds as Error156019,Fs as Error156020,Vs as Error156021,qs as Error156023,Ms as Error156024,js as Error156025,Ks as Error156026,zs as Error156027,Hs as Error156030,$s as Error156031,Gs as Error156032,Ws as Error175001,Xs as Error175002,Qs as Error175003,Ys as Error175004,Js as Error175005,Zs as Error175006,eo as Error175007,to as Error175008,ao as Error175009,ro as Error175010,no as Error175011,io as Error175012,so as Error175013,oo as Error175201,co as Error175202,lo as Error175203,uo as Error175204,po as Error175205,fo as Error175301,ho as Error175302,mo as Error175303,vo as Error175401,go as Error175402,xo as Error175403,yo as Error175404,bo as Error175405,Eo as Error175406,Co as Error175407,To as Error175408,So as Error175409,wo as Error175410,Ao as Error177001,Io as Error177002,Bo as Error177003,Ro as Error177004,ko as Error177005,_o as Error177006,Uo as Error177007,No as Error177008,Lo as Error177009,Po as Error177010,Oo as Error177011,Do as Error177012,Fo as Error177013,Vo as Error177014,qo as Error177015,Mo as Error177016,jo as Error177017,Ko as Error177018,zo as Error177019,Ho as Error177020,$o as Error177021,Go as Error177022,Wo as Error177023,Xo as Error177024,Qo as Error177025,Yo as Error177026,Jo as Error177301,Zo as Error177302,ec as Error177303,tc as Error177304,ac as Error177305,rc as Error177601,nc as Error177602,ic as Error177603,sc as Error177604,oc as Error177605,cc as Error177606,lc as Error177607,uc as Error177901,Er as ForbiddenError,Br as GatewayTimeoutError,Or as HostUnreachableError,xr as HttpError,Lt as HttpRequestError,E as HttpResponseError,Sr as InternalServerError,Lr as NetworkUnreachableError,Cr as NotFoundError,wr as NotImplementedError,Tr as RatelimitError,Ir as ServiceUnavailableError,br as UnauthorizedError,vp as defaultBaseUrl,ee as fromAxiosError,T2 as initiateUserControlledWalletsClient};
package/package.json CHANGED
@@ -7,27 +7,26 @@
7
7
  "axios": "^1.15.0"
8
8
  },
9
9
  "scripts": {
10
- "test": "jest",
11
- "test:watch": "jest --watch",
12
- "test:coverage": "jest --coverage",
10
+ "test": "vitest run",
11
+ "test:watch": "vitest watch",
12
+ "test:coverage": "vitest run --coverage",
13
13
  "lint": "eslint --ext .js,.jsx,.ts,.tsx,.json . --fix",
14
14
  "lint:report": "eslint --ext .js,.jsx,.ts,.tsx,.json . --output-file eslint_report.json --format json",
15
15
  "check:type": "tsc --project tsconfig.json --pretty --noEmit",
16
16
  "build": "node ./../../packages/rollup/build.js",
17
17
  "release": "npm publish --access public"
18
18
  },
19
- "version": "10.3.0",
19
+ "version": "10.3.1",
20
20
  "devDependencies": {
21
21
  "@rollup/plugin-typescript": "^11.1.4",
22
22
  "@shared/clients": "workspace:*",
23
23
  "@shared/core": "workspace:*",
24
24
  "@shared/eslint-config": "workspace:*",
25
- "@shared/jest": "workspace:*",
26
25
  "@shared/rollup": "workspace:*",
27
26
  "@shared/tsconfig": "workspace:*",
28
- "@types/jest": "^29.5.5",
27
+ "@shared/vitest": "workspace:*",
29
28
  "eslint": "^8.49.0",
30
- "jest": "^29.7.0"
29
+ "vitest": "^3.2.1"
31
30
  },
32
31
  "files": [
33
32
  "dist/*",