@circle-fin/user-controlled-wallets 10.5.1 → 10.5.4

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.
@@ -563,7 +563,7 @@ declare class HostUnreachableError extends HttpRequestError {
563
563
  * @param error - The AxiosError to transform.
564
564
  * @returns Specific HttpError instance based on error type and status.
565
565
  */
566
- declare function fromAxiosError(error: AxiosError): HttpRequestError | HttpResponseError;
566
+ declare function fromAxiosError(error: AxiosError): HttpResponseError | HttpRequestError;
567
567
 
568
568
  /**
569
569
  * Circle API Error Classes
@@ -103,7 +103,7 @@ type SignMessageInput = {
103
103
  /**
104
104
  * The blockchain associated with the signing. Use together with `walletAddress` as an alternative to `walletId`.
105
105
  */
106
- blockchain?: string;
106
+ blockchain?: Blockchain;
107
107
  /**
108
108
  * Indicator of whether the input message is encoded by hex. If TRUE, then the message should be a hex string. By default, it is False.
109
109
  */
@@ -135,7 +135,7 @@ type SignTransactionInput = {
135
135
  /**
136
136
  * The blockchain associated with the signing. Use together with `walletAddress` as an alternative to `walletId`.
137
137
  */
138
- blockchain?: string;
138
+ blockchain?: Blockchain;
139
139
  /**
140
140
  * Raw transaction string that needs to be signed. Excluded with `transaction`. Required without `transaction`.
141
141
  *
@@ -170,7 +170,7 @@ type SignTypedDataInput = {
170
170
  /**
171
171
  * The blockchain associated with the signing. Use together with `walletAddress` as an alternative to `walletId`.
172
172
  */
173
- blockchain?: string;
173
+ blockchain?: Blockchain;
174
174
  /**
175
175
  * A string represents the typed structured data in EIP-712.
176
176
  */
@@ -43,4 +43,4 @@
43
43
  Private-Lines: `+c+`\r
44
44
  `,i+=u;var b=Tl("putty-private-key-file-mac-key",t),E=et.util.createBuffer();na(E,r),na(E,n),na(E,a),E.putInt32(s.length()),E.putBuffer(s),E.putInt32(l.length()),E.putBuffer(l);var I=et.hmac.create();return I.start("sha1",b),I.update(E.bytes()),i+=`\r
45
45
  Private-MAC: `+I.digest().toHex()+`\r
46
- `,i},Cl.publicKeyToOpenSSH=function(e,t){var a="ssh-rsa";t=t||"";var r=et.util.createBuffer();return na(r,a),Jt(r,e.e),Jt(r,e.n),a+" "+et.util.encode64(r.bytes())+" "+t},Cl.privateKeyToOpenSSH=function(e,t){return t?et.pki.encryptRsaPrivateKey(e,t,{legacy:!0,algorithm:"aes128"}):et.pki.privateKeyToPem(e)},Cl.getPublicKeyFingerprint=function(e,t){t=t||{};var a=t.md||et.md.md5.create(),r="ssh-rsa",n=et.util.createBuffer();na(n,r),Jt(n,e.e),Jt(n,e.n),a.start(),a.update(n.getBytes());var i=a.digest();if(t.encoding==="hex"){var s=i.toHex();return t.delimiter?s.match(/.{2}/g).join(t.delimiter):s}else{if(t.encoding==="binary")return i.getBytes();if(t.encoding)throw new Error('Unknown encoding "'+t.encoding+'".')}return i};function Jt(e,t){var a=t.toString(16);a[0]>="8"&&(a="00"+a);var r=et.util.hexToBytes(a);e.putInt32(r.length),e.putBytes(r)}function na(e,t){e.putInt32(t.length),e.putString(t)}function Tl(){for(var e=et.md.sha1.create(),t=arguments.length,a=0;a<t;++a)e.update(arguments[a]);return e.digest()}const Ut=()=>Or.randomUUID(),KT=({configurationsClient:e})=>async t=>{try{return await e.Faucet.requestTestnetTokens(void 0,t)}catch(a){throw re(a)?te(a):a}};var ah="10.5.1";const nh=({client:e})=>async({xRequestId:t,...a})=>{try{return ae(await e.PINAuthentication.getUserToken({...a},t))}catch(r){throw re(r)?te(r):r}},We=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 zT(e,t)};async function zT(e,t){const a=await nh(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 HT=e=>async({userToken:t,userId:a,idempotencyKey:r,xRequestId:n})=>{try{return ae(await e.client.PINAuthentication.createUserPinChallenge(t??await We(e,a),{idempotencyKey:r??Ut()},n))}catch(i){throw re(i)?te(i):i}},$T=e=>async({userToken:t,userId:a,idempotencyKey:r,accountType:n="EOA",xRequestId:i,...s})=>{try{return ae(await e.client.Users.createUserWithPinChallenge(t??await We(e,a),{idempotencyKey:r??Ut(),accountType:n,...s},i))}catch(o){throw re(o)?te(o):o}},GT=e=>async({userToken:t,userId:a,idempotencyKey:r,xRequestId:n})=>{try{return ae(await e.client.PINAuthentication.createUserPinRestoreChallenge(t??await We(e,a),{idempotencyKey:r??Ut()},n))}catch(i){throw re(i)?te(i):i}},WT=e=>async({userToken:t,userId:a,idempotencyKey:r})=>{try{return ae(await e.client.PINAuthentication.updateUserPinChallenge(t??await We(e,a),{idempotencyKey:r??Ut()}))}catch(n){throw re(n)?te(n):n}},XT=e=>async({userToken:t,userId:a,xRequestId:r,...n})=>{try{return ae(await e.client.Signing.signUserMessage(t??await We(e,a),n,r))}catch(i){throw re(i)?te(i):i}},QT=e=>async({userToken:t,userId:a,xRequestId:r,...n})=>{try{return ae(await e.client.Signing.signUserTransaction(t??await We(e,a),{...n},r))}catch(i){throw re(i)?te(i):i}},YT=e=>async({userToken:t,userId:a,xRequestId:r,...n})=>{try{return ae(await e.client.Signing.signUserTypedData(t??await We(e,a),n,r))}catch(i){throw re(i)?te(i):i}},JT=({client:e})=>async({id:t})=>{try{return ae(await e.TokenLookup.getTokenId(t))}catch(a){throw re(a)?te(a):a}},ZT=e=>async({userToken:t,userId:a,id:r,idempotencyKey:n,xRequestId:i})=>{try{return ae(await e.client.Transactions.createUserTransactionAccelerateChallenge(t??await We(e,a),r,{idempotencyKey:n??Ut()},i))}catch(s){throw re(s)?te(s):s}},e2=e=>async({userToken:t,userId:a,id:r,idempotencyKey:n,xRequestId:i})=>{try{return ae(await e.client.Transactions.createUserTransactionCancelChallenge(t??await We(e,a),r,{idempotencyKey:n??Ut()},i))}catch(s){throw re(s)?te(s):s}},t2=e=>async({userToken:t,userId:a,idempotencyKey:r,fee:n,xRequestId:i,...s})=>{try{return ae(await e.client.Transactions.createUserTransactionTransferChallenge(t??await We(e,a),{idempotencyKey:r??Ut(),...n.config,...s},i))}catch(o){throw re(o)?te(o):o}},r2=e=>async({userToken:t,userId:a,idempotencyKey:r,fee:n,xRequestId:i,...s})=>{try{return ae(await e.client.Transactions.createUserTransactionContractExecutionChallenge(t??await We(e,a),{idempotencyKey:r??Ut(),...n.config,...s},i))}catch(o){throw re(o)?te(o):o}},a2=e=>async({userId:t,userToken:a,source:r,xRequestId:n,...i})=>{try{return ae(await e.client.Transactions.createTransactionEstimateFee(a??await We(e,t),{...i,...r},n))}catch(s){throw re(s)?te(s):s}},n2=e=>async({userToken:t,userId:a,amount:r,xRequestId:n,...i})=>{try{return ae(await e.client.Transactions.createTransferEstimateFee(t??await We(e,a),{amounts:r,...i},n))}catch(s){throw re(s)?te(s):s}},s2=e=>async({id:t,userToken:a,userId:r,txType:n,xRequestId:i})=>{try{return ae(await e.client.Transactions.getTransaction(t,a??await We(e,r),n,i))}catch(s){throw re(s)?te(s):s}},i2=({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(i){throw re(i)?te(i):i}},o2=e=>async({userToken:t,blockchain:a,destinationAddress:r,includeAll:n,operation:i,state:s,txHash:o,txType:c,userId:l,walletIds:u,from:p,pageAfter:d,pageBefore:g,pageSize:h,to:y,order:b,xRequestId:E})=>{try{return ae(await e.client.Transactions.listTransactions(t??await We(e,l),a,r,n,i,s,o,c,l,u?.join(","),p,y,g,d,h,b,E))}catch(I){throw re(I)?te(I):I}},c2=({client:e})=>async t=>{try{return ae(await e.Transactions.createValidateAddress(t))}catch(a){throw re(a)?te(a):a}},l2=({client:e})=>async({...t})=>{try{return ae(await e.PINAuthentication.createUser({...t}))}catch(a){throw re(a)?te(a):a}},u2=e=>async({userToken:t,idempotencyKey:a,userId:r,xRequestId:n,...i})=>{try{return ae(await e.client.SocialEmailAuthentication.resendOTP(t??await We(e,r),{idempotencyKey:a??Ut(),...i},n))}catch(s){throw re(s)?te(s):s}},p2=({client:e})=>async({idempotencyKey:t,xRequestId:a,...r})=>{try{return ae(await e.SocialEmailAuthentication.createDeviceTokenEmailLogin({idempotencyKey:t??Ut(),...r},a))}catch(n){throw re(n)?te(n):n}},d2=({client:e})=>async({userId:t,xRequestId:a})=>{try{return ae(await e.Users.getUser(t,a))}catch(r){throw re(r)?te(r):r}},f2=({client:e})=>async({userToken:t,xRequestId:a})=>{try{return ae(await e.Users.getUserByToken(t,a))}catch(r){throw re(r)?te(r):r}},h2=({client:e})=>async({userToken:t,challengeId:a,xRequestId:r})=>{try{return ae(await e.Users.getUserChallenge(t,a,r))}catch(n){throw re(n)?te(n):n}},m2=({client:e})=>async({pinStatus:t,securityQuestionStatus:a,from:r,to:n,pageBefore:i,pageAfter:s,pageSize:o,order:c,xRequestId:l}={})=>{try{return ae(await e.Users.listUsers(t,a,r,n,i,s,o,c,l))}catch(u){throw re(u)?te(u):u}},v2=({client:e})=>async({userToken:t,challengeStatus:a,xRequestId:r})=>{try{return ae(await e.Users.listUserChallenges(t,a,r))}catch(n){throw re(n)?te(n):n}},g2=e=>async({userId:t,userToken:a,deviceId:r,idempotencyKey:n,refreshToken:i,xRequestId:s})=>{try{return ae(await e.client.SocialEmailAuthentication.refreshUserToken(a??await We(e,t),{idempotencyKey:n??Ut(),refreshToken:i,deviceId:r},s))}catch(o){throw re(o)?te(o):o}},x2=({client:e})=>async({idempotencyKey:t,xRequestId:a,...r})=>{try{return ae(await e.SocialEmailAuthentication.createDeviceTokenSocialLogin({idempotencyKey:t??Ut(),...r},a))}catch(n){throw re(n)?te(n):n}},y2=e=>async({userToken:t,userId:a,idempotencyKey:r,accountType:n="EOA",xRequestId:i,...s})=>{try{return ae(await e.client.Wallets.createUserWallet(t??await We(e,a),{idempotencyKey:r??Ut(),accountType:n,...s},i))}catch(o){throw re(o)?te(o):o}},b2=e=>async({id:t,userToken:a,userId:r,xRequestId:n})=>{try{return ae(await e.client.Wallets.getWallet(t,a??await We(e,r),n))}catch(i){throw re(i)?te(i):i}},E2=e=>async({walletId:t,userToken:a,userId:r,includeAll:n,name:i,pageAfter:s,pageBefore:o,pageSize:c,tokenAddresses:l,standard:u,xRequestId:p})=>{try{return ae(await e.client.Wallets.listWalletNfts(a??await We(e,r),t,n,i,l?.join(","),u,o,s,c,p))}catch(d){throw re(d)?te(d):d}},C2=e=>async({walletId:t,userToken:a,userId:r,includeAll:n,name:i,pageAfter:s,pageBefore:o,pageSize:c,tokenAddresses:l,standard:u,xRequestId:p})=>{try{return ae(await e.client.Wallets.listWalletBalance(a??await We(e,r),t,n,i,l?.join(","),u,o,s,c,p))}catch(d){throw re(d)?te(d):d}},T2=e=>async({userId:t,userToken:a,address:r,blockchain:n,from:i,pageAfter:s,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 We(e,t),r,n,d,u,p,i,l,o,s,c,g,h))}catch(y){throw re(y)?te(y):y}},S2=e=>async({id:t,name:a,refId:r,userToken:n,userId:i})=>{try{return ae(await e.client.Wallets.updateWallet(t,n??await We(e,i),{name:a,refId:r}))}catch(s){throw re(s)?te(s):s}};var w2=Object.defineProperty,A2=(e,t,a)=>t in e?w2(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,I2=(e,t,a)=>A2(e,typeof t!="symbol"?t+"":t,a);const yp="https://api.circle.com";class sh{constructor(t){I2(this,"params");const{apiKey:a,baseUrl:r,storage:n,userAgent:i,headers:s}=t;this.params={client:new Vy(r??yp,{apiKey:a,version:ah,userAgent:i},s),configurationsClient:new py(r??yp,{apiKey:a,version:ah,userAgent:i},s),storage:n??new eb}}createUserPin(t){return HT(this.params)(t)}createUserPinWithWallets(t){return $T(this.params)(t)}updateUserPin(t){return WT(this.params)(t)}restoreUserPin(t){return GT(this.params)(t)}createDeviceTokenForEmailLogin(t){return p2(this.params)(t)}createDeviceTokenForSocialLogin(t){return x2(this.params)(t)}refreshUserToken(t){return g2(this.params)(t)}resendOTP(t){return u2(this.params)(t)}createWallet(t){return y2(this.params)(t)}listWallets(t){return T2(this.params)(t)}getWallet(t){return b2(this.params)(t)}updateWallet(t){return S2(this.params)(t)}getWalletTokenBalance(t){return C2(this.params)(t)}getWalletNFTBalance(t){return E2(this.params)(t)}accelerateTransaction(t){return ZT(this.params)(t)}createTransaction(t){return t2(this.params)(t)}cancelTransaction(t){return e2(this.params)(t)}getTransaction(t){return s2(this.params)(t)}listTransactions(t){return o2(this.params)(t)}estimateContractExecutionFee(t){return a2(this.params)(t)}createUserTransactionContractExecutionChallenge(t){return r2(this.params)(t)}estimateTransferFee(t){return n2(this.params)(t)}validateAddress(t){return c2(this.params)(t)}getLowestNonceTransaction(t){return i2(this.params)(t)}createUser(t){return l2(this.params)(t)}getUser(t){return d2(this.params)(t)}getUserStatus(t){return f2(this.params)(t)}listUsers(t){return m2(this.params)(t)}createUserToken(t){return nh(this.params)(t)}getUserChallenge(t){return h2(this.params)(t)}listUserChallenges(t){return v2(this.params)(t)}getToken(t){return JT(this.params)(t)}signMessage(t){return XT(this.params)(t)}signTransaction(t){return QT(this.params)(t)}signTypedData(t){return YT(this.params)(t)}requestTestnetTokens(t){return KT(this.params)(t)}createMonitoredTokens(t){return V1(this.params)(t)}updateMonitoredTokens(t){return K1(this.params)(t)}listMonitoredTokens(t){return j1(this.params)(t)}deleteMonitoredTokens(t){return M1(this.params)(t)}updateMonitoredTokensScope(t){return z1(this.params)(t)}createSubscription(t){return H1(this.params)(t)}deleteSubscription(t){return $1(this.params)(t)}getSubscription(t){return G1(this.params)(t)}getNotificationSignature(t){return W1(this.params)(t)}listSubscriptions(){return X1(this.params)()}updateSubscription(t){return Q1(this.params)(t)}}function B2(e){return new sh(e)}exports.BadGatewayError=Ia,exports.BadRequestError=ba,exports.Blockchain=Dy,exports.CircleUserControlledWalletsClient=sh,exports.ConnectionAbortedError=Ua,exports.ConnectionRefusedError=ka,exports.ConnectionResetError=Oa,exports.ConnectionTimeoutError=_a,exports.DNSNotFoundError=Na,exports.DNSTimeoutError=La,exports.Error110700=Ru,exports.Error110701=ku,exports.Error110702=_u,exports.Error110703=Uu,exports.Error155101=Fa,exports.Error155102=qa,exports.Error155103=Va,exports.Error155104=Ma,exports.Error155105=ja,exports.Error155106=Ka,exports.Error155107=za,exports.Error155108=Ha,exports.Error155109=$a,exports.Error155110=Ga,exports.Error155111=Wa,exports.Error155112=Xa,exports.Error155113=Qa,exports.Error155114=Ya,exports.Error155115=Ja,exports.Error155116=Za,exports.Error155117=en,exports.Error155118=tn,exports.Error155119=rn,exports.Error155120=an,exports.Error155121=nn,exports.Error155122=sn,exports.Error155123=on,exports.Error155124=cn,exports.Error155130=ln,exports.Error155131=un,exports.Error155132=pn,exports.Error155133=dn,exports.Error155134=fn,exports.Error155135=hn,exports.Error155136=mn,exports.Error155137=vn,exports.Error155138=gn,exports.Error155139=xn,exports.Error155140=yn,exports.Error155141=bn,exports.Error155142=En,exports.Error155143=Cn,exports.Error155144=Tn,exports.Error155145=Sn,exports.Error155146=wn,exports.Error155150=An,exports.Error155151=In,exports.Error155152=Bn,exports.Error155154=Rn,exports.Error155155=kn,exports.Error155156=_n,exports.Error155157=Un,exports.Error155158=Nn,exports.Error155159=Ln,exports.Error155160=Pn,exports.Error155201=On,exports.Error155202=Dn,exports.Error155203=Fn,exports.Error155204=qn,exports.Error155205=Vn,exports.Error155206=Mn,exports.Error155207=jn,exports.Error155208=Kn,exports.Error155209=zn,exports.Error155210=Hn,exports.Error155211=$n,exports.Error155215=Gn,exports.Error155218=Wn,exports.Error155219=Xn,exports.Error155220=Qn,exports.Error155221=Yn,exports.Error155222=Jn,exports.Error155223=Zn,exports.Error155224=es,exports.Error155225=ts,exports.Error155226=rs,exports.Error155227=as,exports.Error155228=ns,exports.Error155229=ss,exports.Error155230=is,exports.Error155231=os,exports.Error155232=cs,exports.Error155233=ls,exports.Error155234=us,exports.Error155235=ps,exports.Error155236=ds,exports.Error155237=fs,exports.Error155238=hs,exports.Error155239=ms,exports.Error155240=vs,exports.Error155241=gs,exports.Error155242=xs,exports.Error155243=ys,exports.Error155244=bs,exports.Error155245=Es,exports.Error155247=Cs,exports.Error155254=Ts,exports.Error155257=Ss,exports.Error155258=ws,exports.Error155262=As,exports.Error155264=Is,exports.Error155501=Bs,exports.Error155502=Rs,exports.Error155503=ks,exports.Error155504=_s,exports.Error155505=Us,exports.Error155506=Ns,exports.Error155507=Ls,exports.Error155508=Ps,exports.Error155509=Os,exports.Error155510=Ds,exports.Error155511=Fs,exports.Error155512=qs,exports.Error155514=Vs,exports.Error155515=Ms,exports.Error155516=js,exports.Error155517=Ks,exports.Error155601=zs,exports.Error155701=Hs,exports.Error155702=$s,exports.Error155703=Gs,exports.Error155704=Ws,exports.Error155705=Xs,exports.Error155706=Qs,exports.Error155707=Ys,exports.Error155708=Js,exports.Error155709=Zs,exports.Error155710=ei,exports.Error155711=ti,exports.Error155712=ri,exports.Error155713=ai,exports.Error155714=ni,exports.Error155715=si,exports.Error155716=ii,exports.Error155717=oi,exports.Error155718=ci,exports.Error155719=li,exports.Error155720=ui,exports.Error155721=pi,exports.Error155801=di,exports.Error155802=fi,exports.Error155803=hi,exports.Error155804=mi,exports.Error155805=vi,exports.Error155806=gi,exports.Error155807=xi,exports.Error155808=yi,exports.Error156001=bi,exports.Error156002=Ei,exports.Error156003=Ci,exports.Error156004=Ti,exports.Error156005=Si,exports.Error156006=wi,exports.Error156007=Ai,exports.Error156008=Ii,exports.Error156009=Bi,exports.Error156010=Ri,exports.Error156011=ki,exports.Error156012=_i,exports.Error156013=Ui,exports.Error156014=Ni,exports.Error156015=Li,exports.Error156016=Pi,exports.Error156017=Oi,exports.Error156018=Di,exports.Error156019=Fi,exports.Error156020=qi,exports.Error156021=Vi,exports.Error156023=Mi,exports.Error156024=ji,exports.Error156025=Ki,exports.Error156026=zi,exports.Error156027=Hi,exports.Error156030=$i,exports.Error156031=Gi,exports.Error156032=Wi,exports.Error175001=Xi,exports.Error175002=Qi,exports.Error175003=Yi,exports.Error175004=Ji,exports.Error175005=Zi,exports.Error175006=eo,exports.Error175007=to,exports.Error175008=ro,exports.Error175009=ao,exports.Error175010=no,exports.Error175011=so,exports.Error175012=io,exports.Error175013=oo,exports.Error175201=co,exports.Error175202=lo,exports.Error175203=uo,exports.Error175204=po,exports.Error175205=fo,exports.Error175301=ho,exports.Error175302=mo,exports.Error175303=vo,exports.Error175401=go,exports.Error175402=xo,exports.Error175403=yo,exports.Error175404=bo,exports.Error175405=Eo,exports.Error175406=Co,exports.Error175407=To,exports.Error175408=So,exports.Error175409=wo,exports.Error175410=Ao,exports.Error177001=Io,exports.Error177002=Bo,exports.Error177003=Ro,exports.Error177004=ko,exports.Error177005=_o,exports.Error177006=Uo,exports.Error177007=No,exports.Error177008=Lo,exports.Error177009=Po,exports.Error177010=Oo,exports.Error177011=Do,exports.Error177012=Fo,exports.Error177013=qo,exports.Error177014=Vo,exports.Error177015=Mo,exports.Error177016=jo,exports.Error177017=Ko,exports.Error177018=zo,exports.Error177019=Ho,exports.Error177020=$o,exports.Error177021=Go,exports.Error177022=Wo,exports.Error177023=Xo,exports.Error177024=Qo,exports.Error177025=Yo,exports.Error177026=Jo,exports.Error177301=Zo,exports.Error177302=ec,exports.Error177303=tc,exports.Error177304=rc,exports.Error177305=ac,exports.Error177601=nc,exports.Error177602=sc,exports.Error177603=ic,exports.Error177604=oc,exports.Error177605=cc,exports.Error177606=lc,exports.Error177607=uc,exports.Error177901=pc,exports.ForbiddenError=Ca,exports.GatewayTimeoutError=Ra,exports.HostUnreachableError=Da,exports.HttpError=ya,exports.HttpRequestError=Lt,exports.HttpResponseError=C,exports.InternalServerError=wa,exports.NetworkUnreachableError=Pa,exports.NotFoundError=Ta,exports.NotImplementedError=Aa,exports.RatelimitError=Sa,exports.ServiceUnavailableError=Ba,exports.UnauthorizedError=Ea,exports.defaultBaseUrl=yp,exports.fromAxiosError=te,exports.initiateUserControlledWalletsClient=B2;
46
+ `,i},Cl.publicKeyToOpenSSH=function(e,t){var a="ssh-rsa";t=t||"";var r=et.util.createBuffer();return na(r,a),Jt(r,e.e),Jt(r,e.n),a+" "+et.util.encode64(r.bytes())+" "+t},Cl.privateKeyToOpenSSH=function(e,t){return t?et.pki.encryptRsaPrivateKey(e,t,{legacy:!0,algorithm:"aes128"}):et.pki.privateKeyToPem(e)},Cl.getPublicKeyFingerprint=function(e,t){t=t||{};var a=t.md||et.md.md5.create(),r="ssh-rsa",n=et.util.createBuffer();na(n,r),Jt(n,e.e),Jt(n,e.n),a.start(),a.update(n.getBytes());var i=a.digest();if(t.encoding==="hex"){var s=i.toHex();return t.delimiter?s.match(/.{2}/g).join(t.delimiter):s}else{if(t.encoding==="binary")return i.getBytes();if(t.encoding)throw new Error('Unknown encoding "'+t.encoding+'".')}return i};function Jt(e,t){var a=t.toString(16);a[0]>="8"&&(a="00"+a);var r=et.util.hexToBytes(a);e.putInt32(r.length),e.putBytes(r)}function na(e,t){e.putInt32(t.length),e.putString(t)}function Tl(){for(var e=et.md.sha1.create(),t=arguments.length,a=0;a<t;++a)e.update(arguments[a]);return e.digest()}const Ut=()=>Or.randomUUID(),KT=({configurationsClient:e})=>async t=>{try{return await e.Faucet.requestTestnetTokens(void 0,t)}catch(a){throw re(a)?te(a):a}};var ah="10.5.4";const nh=({client:e})=>async({xRequestId:t,...a})=>{try{return ae(await e.PINAuthentication.getUserToken({...a},t))}catch(r){throw re(r)?te(r):r}},We=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 zT(e,t)};async function zT(e,t){const a=await nh(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 HT=e=>async({userToken:t,userId:a,idempotencyKey:r,xRequestId:n})=>{try{return ae(await e.client.PINAuthentication.createUserPinChallenge(t??await We(e,a),{idempotencyKey:r??Ut()},n))}catch(i){throw re(i)?te(i):i}},$T=e=>async({userToken:t,userId:a,idempotencyKey:r,accountType:n="EOA",xRequestId:i,...s})=>{try{return ae(await e.client.Users.createUserWithPinChallenge(t??await We(e,a),{idempotencyKey:r??Ut(),accountType:n,...s},i))}catch(o){throw re(o)?te(o):o}},GT=e=>async({userToken:t,userId:a,idempotencyKey:r,xRequestId:n})=>{try{return ae(await e.client.PINAuthentication.createUserPinRestoreChallenge(t??await We(e,a),{idempotencyKey:r??Ut()},n))}catch(i){throw re(i)?te(i):i}},WT=e=>async({userToken:t,userId:a,idempotencyKey:r})=>{try{return ae(await e.client.PINAuthentication.updateUserPinChallenge(t??await We(e,a),{idempotencyKey:r??Ut()}))}catch(n){throw re(n)?te(n):n}},XT=e=>async({userToken:t,userId:a,xRequestId:r,...n})=>{try{return ae(await e.client.Signing.signUserMessage(t??await We(e,a),n,r))}catch(i){throw re(i)?te(i):i}},QT=e=>async({userToken:t,userId:a,xRequestId:r,...n})=>{try{return ae(await e.client.Signing.signUserTransaction(t??await We(e,a),{...n},r))}catch(i){throw re(i)?te(i):i}},YT=e=>async({userToken:t,userId:a,xRequestId:r,...n})=>{try{return ae(await e.client.Signing.signUserTypedData(t??await We(e,a),n,r))}catch(i){throw re(i)?te(i):i}},JT=({client:e})=>async({id:t})=>{try{return ae(await e.TokenLookup.getTokenId(t))}catch(a){throw re(a)?te(a):a}},ZT=e=>async({userToken:t,userId:a,id:r,idempotencyKey:n,xRequestId:i})=>{try{return ae(await e.client.Transactions.createUserTransactionAccelerateChallenge(t??await We(e,a),r,{idempotencyKey:n??Ut()},i))}catch(s){throw re(s)?te(s):s}},e2=e=>async({userToken:t,userId:a,id:r,idempotencyKey:n,xRequestId:i})=>{try{return ae(await e.client.Transactions.createUserTransactionCancelChallenge(t??await We(e,a),r,{idempotencyKey:n??Ut()},i))}catch(s){throw re(s)?te(s):s}},t2=e=>async({userToken:t,userId:a,idempotencyKey:r,fee:n,xRequestId:i,...s})=>{try{return ae(await e.client.Transactions.createUserTransactionTransferChallenge(t??await We(e,a),{idempotencyKey:r??Ut(),...n.config,...s},i))}catch(o){throw re(o)?te(o):o}},r2=e=>async({userToken:t,userId:a,idempotencyKey:r,fee:n,xRequestId:i,...s})=>{try{return ae(await e.client.Transactions.createUserTransactionContractExecutionChallenge(t??await We(e,a),{idempotencyKey:r??Ut(),...n.config,...s},i))}catch(o){throw re(o)?te(o):o}},a2=e=>async({userId:t,userToken:a,source:r,xRequestId:n,...i})=>{try{return ae(await e.client.Transactions.createTransactionEstimateFee(a??await We(e,t),{...i,...r},n))}catch(s){throw re(s)?te(s):s}},n2=e=>async({userToken:t,userId:a,amount:r,xRequestId:n,...i})=>{try{return ae(await e.client.Transactions.createTransferEstimateFee(t??await We(e,a),{amounts:r,...i},n))}catch(s){throw re(s)?te(s):s}},s2=e=>async({id:t,userToken:a,userId:r,txType:n,xRequestId:i})=>{try{return ae(await e.client.Transactions.getTransaction(t,a??await We(e,r),n,i))}catch(s){throw re(s)?te(s):s}},i2=({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(i){throw re(i)?te(i):i}},o2=e=>async({userToken:t,blockchain:a,destinationAddress:r,includeAll:n,operation:i,state:s,txHash:o,txType:c,userId:l,walletIds:u,from:p,pageAfter:d,pageBefore:g,pageSize:h,to:y,order:b,xRequestId:E})=>{try{return ae(await e.client.Transactions.listTransactions(t??await We(e,l),a,r,n,i,s,o,c,l,u?.join(","),p,y,g,d,h,b,E))}catch(I){throw re(I)?te(I):I}},c2=({client:e})=>async t=>{try{return ae(await e.Transactions.createValidateAddress(t))}catch(a){throw re(a)?te(a):a}},l2=({client:e})=>async({...t})=>{try{return ae(await e.PINAuthentication.createUser({...t}))}catch(a){throw re(a)?te(a):a}},u2=e=>async({userToken:t,idempotencyKey:a,userId:r,xRequestId:n,...i})=>{try{return ae(await e.client.SocialEmailAuthentication.resendOTP(t??await We(e,r),{idempotencyKey:a??Ut(),...i},n))}catch(s){throw re(s)?te(s):s}},p2=({client:e})=>async({idempotencyKey:t,xRequestId:a,...r})=>{try{return ae(await e.SocialEmailAuthentication.createDeviceTokenEmailLogin({idempotencyKey:t??Ut(),...r},a))}catch(n){throw re(n)?te(n):n}},d2=({client:e})=>async({userId:t,xRequestId:a})=>{try{return ae(await e.Users.getUser(t,a))}catch(r){throw re(r)?te(r):r}},f2=({client:e})=>async({userToken:t,xRequestId:a})=>{try{return ae(await e.Users.getUserByToken(t,a))}catch(r){throw re(r)?te(r):r}},h2=({client:e})=>async({userToken:t,challengeId:a,xRequestId:r})=>{try{return ae(await e.Users.getUserChallenge(t,a,r))}catch(n){throw re(n)?te(n):n}},m2=({client:e})=>async({pinStatus:t,securityQuestionStatus:a,from:r,to:n,pageBefore:i,pageAfter:s,pageSize:o,order:c,xRequestId:l}={})=>{try{return ae(await e.Users.listUsers(t,a,r,n,i,s,o,c,l))}catch(u){throw re(u)?te(u):u}},v2=({client:e})=>async({userToken:t,challengeStatus:a,xRequestId:r})=>{try{return ae(await e.Users.listUserChallenges(t,a,r))}catch(n){throw re(n)?te(n):n}},g2=e=>async({userId:t,userToken:a,deviceId:r,idempotencyKey:n,refreshToken:i,xRequestId:s})=>{try{return ae(await e.client.SocialEmailAuthentication.refreshUserToken(a??await We(e,t),{idempotencyKey:n??Ut(),refreshToken:i,deviceId:r},s))}catch(o){throw re(o)?te(o):o}},x2=({client:e})=>async({idempotencyKey:t,xRequestId:a,...r})=>{try{return ae(await e.SocialEmailAuthentication.createDeviceTokenSocialLogin({idempotencyKey:t??Ut(),...r},a))}catch(n){throw re(n)?te(n):n}},y2=e=>async({userToken:t,userId:a,idempotencyKey:r,accountType:n="EOA",xRequestId:i,...s})=>{try{return ae(await e.client.Wallets.createUserWallet(t??await We(e,a),{idempotencyKey:r??Ut(),accountType:n,...s},i))}catch(o){throw re(o)?te(o):o}},b2=e=>async({id:t,userToken:a,userId:r,xRequestId:n})=>{try{return ae(await e.client.Wallets.getWallet(t,a??await We(e,r),n))}catch(i){throw re(i)?te(i):i}},E2=e=>async({walletId:t,userToken:a,userId:r,includeAll:n,name:i,pageAfter:s,pageBefore:o,pageSize:c,tokenAddresses:l,standard:u,xRequestId:p})=>{try{return ae(await e.client.Wallets.listWalletNfts(a??await We(e,r),t,n,i,l?.join(","),u,o,s,c,p))}catch(d){throw re(d)?te(d):d}},C2=e=>async({walletId:t,userToken:a,userId:r,includeAll:n,name:i,pageAfter:s,pageBefore:o,pageSize:c,tokenAddresses:l,standard:u,xRequestId:p})=>{try{return ae(await e.client.Wallets.listWalletBalance(a??await We(e,r),t,n,i,l?.join(","),u,o,s,c,p))}catch(d){throw re(d)?te(d):d}},T2=e=>async({userId:t,userToken:a,address:r,blockchain:n,from:i,pageAfter:s,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 We(e,t),r,n,d,u,p,i,l,o,s,c,g,h))}catch(y){throw re(y)?te(y):y}},S2=e=>async({id:t,name:a,refId:r,userToken:n,userId:i})=>{try{return ae(await e.client.Wallets.updateWallet(t,n??await We(e,i),{name:a,refId:r}))}catch(s){throw re(s)?te(s):s}};var w2=Object.defineProperty,A2=(e,t,a)=>t in e?w2(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,I2=(e,t,a)=>A2(e,typeof t!="symbol"?t+"":t,a);const yp="https://api.circle.com";class sh{constructor(t){I2(this,"params");const{apiKey:a,baseUrl:r,storage:n,userAgent:i,headers:s}=t;this.params={client:new Vy(r??yp,{apiKey:a,version:ah,userAgent:i},s),configurationsClient:new py(r??yp,{apiKey:a,version:ah,userAgent:i},s),storage:n??new eb}}createUserPin(t){return HT(this.params)(t)}createUserPinWithWallets(t){return $T(this.params)(t)}updateUserPin(t){return WT(this.params)(t)}restoreUserPin(t){return GT(this.params)(t)}createDeviceTokenForEmailLogin(t){return p2(this.params)(t)}createDeviceTokenForSocialLogin(t){return x2(this.params)(t)}refreshUserToken(t){return g2(this.params)(t)}resendOTP(t){return u2(this.params)(t)}createWallet(t){return y2(this.params)(t)}listWallets(t){return T2(this.params)(t)}getWallet(t){return b2(this.params)(t)}updateWallet(t){return S2(this.params)(t)}getWalletTokenBalance(t){return C2(this.params)(t)}getWalletNFTBalance(t){return E2(this.params)(t)}accelerateTransaction(t){return ZT(this.params)(t)}createTransaction(t){return t2(this.params)(t)}cancelTransaction(t){return e2(this.params)(t)}getTransaction(t){return s2(this.params)(t)}listTransactions(t){return o2(this.params)(t)}estimateContractExecutionFee(t){return a2(this.params)(t)}createUserTransactionContractExecutionChallenge(t){return r2(this.params)(t)}estimateTransferFee(t){return n2(this.params)(t)}validateAddress(t){return c2(this.params)(t)}getLowestNonceTransaction(t){return i2(this.params)(t)}createUser(t){return l2(this.params)(t)}getUser(t){return d2(this.params)(t)}getUserStatus(t){return f2(this.params)(t)}listUsers(t){return m2(this.params)(t)}createUserToken(t){return nh(this.params)(t)}getUserChallenge(t){return h2(this.params)(t)}listUserChallenges(t){return v2(this.params)(t)}getToken(t){return JT(this.params)(t)}signMessage(t){return XT(this.params)(t)}signTransaction(t){return QT(this.params)(t)}signTypedData(t){return YT(this.params)(t)}requestTestnetTokens(t){return KT(this.params)(t)}createMonitoredTokens(t){return V1(this.params)(t)}updateMonitoredTokens(t){return K1(this.params)(t)}listMonitoredTokens(t){return j1(this.params)(t)}deleteMonitoredTokens(t){return M1(this.params)(t)}updateMonitoredTokensScope(t){return z1(this.params)(t)}createSubscription(t){return H1(this.params)(t)}deleteSubscription(t){return $1(this.params)(t)}getSubscription(t){return G1(this.params)(t)}getNotificationSignature(t){return W1(this.params)(t)}listSubscriptions(){return X1(this.params)()}updateSubscription(t){return Q1(this.params)(t)}}function B2(e){return new sh(e)}exports.BadGatewayError=Ia,exports.BadRequestError=ba,exports.Blockchain=Dy,exports.CircleUserControlledWalletsClient=sh,exports.ConnectionAbortedError=Ua,exports.ConnectionRefusedError=ka,exports.ConnectionResetError=Oa,exports.ConnectionTimeoutError=_a,exports.DNSNotFoundError=Na,exports.DNSTimeoutError=La,exports.Error110700=Ru,exports.Error110701=ku,exports.Error110702=_u,exports.Error110703=Uu,exports.Error155101=Fa,exports.Error155102=qa,exports.Error155103=Va,exports.Error155104=Ma,exports.Error155105=ja,exports.Error155106=Ka,exports.Error155107=za,exports.Error155108=Ha,exports.Error155109=$a,exports.Error155110=Ga,exports.Error155111=Wa,exports.Error155112=Xa,exports.Error155113=Qa,exports.Error155114=Ya,exports.Error155115=Ja,exports.Error155116=Za,exports.Error155117=en,exports.Error155118=tn,exports.Error155119=rn,exports.Error155120=an,exports.Error155121=nn,exports.Error155122=sn,exports.Error155123=on,exports.Error155124=cn,exports.Error155130=ln,exports.Error155131=un,exports.Error155132=pn,exports.Error155133=dn,exports.Error155134=fn,exports.Error155135=hn,exports.Error155136=mn,exports.Error155137=vn,exports.Error155138=gn,exports.Error155139=xn,exports.Error155140=yn,exports.Error155141=bn,exports.Error155142=En,exports.Error155143=Cn,exports.Error155144=Tn,exports.Error155145=Sn,exports.Error155146=wn,exports.Error155150=An,exports.Error155151=In,exports.Error155152=Bn,exports.Error155154=Rn,exports.Error155155=kn,exports.Error155156=_n,exports.Error155157=Un,exports.Error155158=Nn,exports.Error155159=Ln,exports.Error155160=Pn,exports.Error155201=On,exports.Error155202=Dn,exports.Error155203=Fn,exports.Error155204=qn,exports.Error155205=Vn,exports.Error155206=Mn,exports.Error155207=jn,exports.Error155208=Kn,exports.Error155209=zn,exports.Error155210=Hn,exports.Error155211=$n,exports.Error155215=Gn,exports.Error155218=Wn,exports.Error155219=Xn,exports.Error155220=Qn,exports.Error155221=Yn,exports.Error155222=Jn,exports.Error155223=Zn,exports.Error155224=es,exports.Error155225=ts,exports.Error155226=rs,exports.Error155227=as,exports.Error155228=ns,exports.Error155229=ss,exports.Error155230=is,exports.Error155231=os,exports.Error155232=cs,exports.Error155233=ls,exports.Error155234=us,exports.Error155235=ps,exports.Error155236=ds,exports.Error155237=fs,exports.Error155238=hs,exports.Error155239=ms,exports.Error155240=vs,exports.Error155241=gs,exports.Error155242=xs,exports.Error155243=ys,exports.Error155244=bs,exports.Error155245=Es,exports.Error155247=Cs,exports.Error155254=Ts,exports.Error155257=Ss,exports.Error155258=ws,exports.Error155262=As,exports.Error155264=Is,exports.Error155501=Bs,exports.Error155502=Rs,exports.Error155503=ks,exports.Error155504=_s,exports.Error155505=Us,exports.Error155506=Ns,exports.Error155507=Ls,exports.Error155508=Ps,exports.Error155509=Os,exports.Error155510=Ds,exports.Error155511=Fs,exports.Error155512=qs,exports.Error155514=Vs,exports.Error155515=Ms,exports.Error155516=js,exports.Error155517=Ks,exports.Error155601=zs,exports.Error155701=Hs,exports.Error155702=$s,exports.Error155703=Gs,exports.Error155704=Ws,exports.Error155705=Xs,exports.Error155706=Qs,exports.Error155707=Ys,exports.Error155708=Js,exports.Error155709=Zs,exports.Error155710=ei,exports.Error155711=ti,exports.Error155712=ri,exports.Error155713=ai,exports.Error155714=ni,exports.Error155715=si,exports.Error155716=ii,exports.Error155717=oi,exports.Error155718=ci,exports.Error155719=li,exports.Error155720=ui,exports.Error155721=pi,exports.Error155801=di,exports.Error155802=fi,exports.Error155803=hi,exports.Error155804=mi,exports.Error155805=vi,exports.Error155806=gi,exports.Error155807=xi,exports.Error155808=yi,exports.Error156001=bi,exports.Error156002=Ei,exports.Error156003=Ci,exports.Error156004=Ti,exports.Error156005=Si,exports.Error156006=wi,exports.Error156007=Ai,exports.Error156008=Ii,exports.Error156009=Bi,exports.Error156010=Ri,exports.Error156011=ki,exports.Error156012=_i,exports.Error156013=Ui,exports.Error156014=Ni,exports.Error156015=Li,exports.Error156016=Pi,exports.Error156017=Oi,exports.Error156018=Di,exports.Error156019=Fi,exports.Error156020=qi,exports.Error156021=Vi,exports.Error156023=Mi,exports.Error156024=ji,exports.Error156025=Ki,exports.Error156026=zi,exports.Error156027=Hi,exports.Error156030=$i,exports.Error156031=Gi,exports.Error156032=Wi,exports.Error175001=Xi,exports.Error175002=Qi,exports.Error175003=Yi,exports.Error175004=Ji,exports.Error175005=Zi,exports.Error175006=eo,exports.Error175007=to,exports.Error175008=ro,exports.Error175009=ao,exports.Error175010=no,exports.Error175011=so,exports.Error175012=io,exports.Error175013=oo,exports.Error175201=co,exports.Error175202=lo,exports.Error175203=uo,exports.Error175204=po,exports.Error175205=fo,exports.Error175301=ho,exports.Error175302=mo,exports.Error175303=vo,exports.Error175401=go,exports.Error175402=xo,exports.Error175403=yo,exports.Error175404=bo,exports.Error175405=Eo,exports.Error175406=Co,exports.Error175407=To,exports.Error175408=So,exports.Error175409=wo,exports.Error175410=Ao,exports.Error177001=Io,exports.Error177002=Bo,exports.Error177003=Ro,exports.Error177004=ko,exports.Error177005=_o,exports.Error177006=Uo,exports.Error177007=No,exports.Error177008=Lo,exports.Error177009=Po,exports.Error177010=Oo,exports.Error177011=Do,exports.Error177012=Fo,exports.Error177013=qo,exports.Error177014=Vo,exports.Error177015=Mo,exports.Error177016=jo,exports.Error177017=Ko,exports.Error177018=zo,exports.Error177019=Ho,exports.Error177020=$o,exports.Error177021=Go,exports.Error177022=Wo,exports.Error177023=Xo,exports.Error177024=Qo,exports.Error177025=Yo,exports.Error177026=Jo,exports.Error177301=Zo,exports.Error177302=ec,exports.Error177303=tc,exports.Error177304=rc,exports.Error177305=ac,exports.Error177601=nc,exports.Error177602=sc,exports.Error177603=ic,exports.Error177604=oc,exports.Error177605=cc,exports.Error177606=lc,exports.Error177607=uc,exports.Error177901=pc,exports.ForbiddenError=Ca,exports.GatewayTimeoutError=Ra,exports.HostUnreachableError=Da,exports.HttpError=ya,exports.HttpRequestError=Lt,exports.HttpResponseError=C,exports.InternalServerError=wa,exports.NetworkUnreachableError=Pa,exports.NotFoundError=Ta,exports.NotImplementedError=Aa,exports.RatelimitError=Sa,exports.ServiceUnavailableError=Ba,exports.UnauthorizedError=Ea,exports.defaultBaseUrl=yp,exports.fromAxiosError=te,exports.initiateUserControlledWalletsClient=B2;
@@ -43,4 +43,4 @@ import ga from"util";import ct,{Readable as lh}from"stream";import bp,{resolve a
43
43
  Private-Lines: `+c+`\r
44
44
  `,i+=u;var b=Cl("putty-private-key-file-mac-key",t),E=et.util.createBuffer();rr(E,a),rr(E,n),rr(E,r),E.putInt32(s.length()),E.putBuffer(s),E.putInt32(l.length()),E.putBuffer(l);var I=et.hmac.create();return I.start("sha1",b),I.update(E.bytes()),i+=`\r
45
45
  Private-MAC: `+I.digest().toHex()+`\r
46
- `,i},El.publicKeyToOpenSSH=function(e,t){var r="ssh-rsa";t=t||"";var a=et.util.createBuffer();return rr(a,r),Jt(a,e.e),Jt(a,e.n),r+" "+et.util.encode64(a.bytes())+" "+t},El.privateKeyToOpenSSH=function(e,t){return t?et.pki.encryptRsaPrivateKey(e,t,{legacy:!0,algorithm:"aes128"}):et.pki.privateKeyToPem(e)},El.getPublicKeyFingerprint=function(e,t){t=t||{};var r=t.md||et.md.md5.create(),a="ssh-rsa",n=et.util.createBuffer();rr(n,a),Jt(n,e.e),Jt(n,e.n),r.start(),r.update(n.getBytes());var i=r.digest();if(t.encoding==="hex"){var s=i.toHex();return t.delimiter?s.match(/.{2}/g).join(t.delimiter):s}else{if(t.encoding==="binary")return i.getBytes();if(t.encoding)throw new Error('Unknown encoding "'+t.encoding+'".')}return i};function Jt(e,t){var r=t.toString(16);r[0]>="8"&&(r="00"+r);var a=et.util.hexToBytes(r);e.putInt32(a.length),e.putBytes(a)}function rr(e,t){e.putInt32(t.length),e.putString(t)}function Cl(){for(var e=et.md.sha1.create(),t=arguments.length,r=0;r<t;++r)e.update(arguments[r]);return e.digest()}const Ut=()=>ph(),$T=({configurationsClient:e})=>async t=>{try{return await e.Faucet.requestTestnetTokens(void 0,t)}catch(r){throw ae(r)?te(r):r}};var nh="10.5.1";const sh=({client:e})=>async({xRequestId:t,...r})=>{try{return re(await e.PINAuthentication.getUserToken({...r},t))}catch(a){throw ae(a)?te(a):a}},We=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 GT(e,t)};async function GT(e,t){const r=await sh(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 WT=e=>async({userToken:t,userId:r,idempotencyKey:a,xRequestId:n})=>{try{return re(await e.client.PINAuthentication.createUserPinChallenge(t??await We(e,r),{idempotencyKey:a??Ut()},n))}catch(i){throw ae(i)?te(i):i}},XT=e=>async({userToken:t,userId:r,idempotencyKey:a,accountType:n="EOA",xRequestId:i,...s})=>{try{return re(await e.client.Users.createUserWithPinChallenge(t??await We(e,r),{idempotencyKey:a??Ut(),accountType:n,...s},i))}catch(o){throw ae(o)?te(o):o}},QT=e=>async({userToken:t,userId:r,idempotencyKey:a,xRequestId:n})=>{try{return re(await e.client.PINAuthentication.createUserPinRestoreChallenge(t??await We(e,r),{idempotencyKey:a??Ut()},n))}catch(i){throw ae(i)?te(i):i}},YT=e=>async({userToken:t,userId:r,idempotencyKey:a})=>{try{return re(await e.client.PINAuthentication.updateUserPinChallenge(t??await We(e,r),{idempotencyKey:a??Ut()}))}catch(n){throw ae(n)?te(n):n}},JT=e=>async({userToken:t,userId:r,xRequestId:a,...n})=>{try{return re(await e.client.Signing.signUserMessage(t??await We(e,r),n,a))}catch(i){throw ae(i)?te(i):i}},ZT=e=>async({userToken:t,userId:r,xRequestId:a,...n})=>{try{return re(await e.client.Signing.signUserTransaction(t??await We(e,r),{...n},a))}catch(i){throw ae(i)?te(i):i}},eS=e=>async({userToken:t,userId:r,xRequestId:a,...n})=>{try{return re(await e.client.Signing.signUserTypedData(t??await We(e,r),n,a))}catch(i){throw ae(i)?te(i):i}},tS=({client:e})=>async({id:t})=>{try{return re(await e.TokenLookup.getTokenId(t))}catch(r){throw ae(r)?te(r):r}},aS=e=>async({userToken:t,userId:r,id:a,idempotencyKey:n,xRequestId:i})=>{try{return re(await e.client.Transactions.createUserTransactionAccelerateChallenge(t??await We(e,r),a,{idempotencyKey:n??Ut()},i))}catch(s){throw ae(s)?te(s):s}},rS=e=>async({userToken:t,userId:r,id:a,idempotencyKey:n,xRequestId:i})=>{try{return re(await e.client.Transactions.createUserTransactionCancelChallenge(t??await We(e,r),a,{idempotencyKey:n??Ut()},i))}catch(s){throw ae(s)?te(s):s}},nS=e=>async({userToken:t,userId:r,idempotencyKey:a,fee:n,xRequestId:i,...s})=>{try{return re(await e.client.Transactions.createUserTransactionTransferChallenge(t??await We(e,r),{idempotencyKey:a??Ut(),...n.config,...s},i))}catch(o){throw ae(o)?te(o):o}},sS=e=>async({userToken:t,userId:r,idempotencyKey:a,fee:n,xRequestId:i,...s})=>{try{return re(await e.client.Transactions.createUserTransactionContractExecutionChallenge(t??await We(e,r),{idempotencyKey:a??Ut(),...n.config,...s},i))}catch(o){throw ae(o)?te(o):o}},iS=e=>async({userId:t,userToken:r,source:a,xRequestId:n,...i})=>{try{return re(await e.client.Transactions.createTransactionEstimateFee(r??await We(e,t),{...i,...a},n))}catch(s){throw ae(s)?te(s):s}},oS=e=>async({userToken:t,userId:r,amount:a,xRequestId:n,...i})=>{try{return re(await e.client.Transactions.createTransferEstimateFee(t??await We(e,r),{amounts:a,...i},n))}catch(s){throw ae(s)?te(s):s}},cS=e=>async({id:t,userToken:r,userId:a,txType:n,xRequestId:i})=>{try{return re(await e.client.Transactions.getTransaction(t,r??await We(e,a),n,i))}catch(s){throw ae(s)?te(s):s}},lS=({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(i){throw ae(i)?te(i):i}},uS=e=>async({userToken:t,blockchain:r,destinationAddress:a,includeAll:n,operation:i,state:s,txHash:o,txType:c,userId:l,walletIds:u,from:p,pageAfter:d,pageBefore:g,pageSize:h,to:y,order:b,xRequestId:E})=>{try{return re(await e.client.Transactions.listTransactions(t??await We(e,l),r,a,n,i,s,o,c,l,u?.join(","),p,y,g,d,h,b,E))}catch(I){throw ae(I)?te(I):I}},pS=({client:e})=>async t=>{try{return re(await e.Transactions.createValidateAddress(t))}catch(r){throw ae(r)?te(r):r}},dS=({client:e})=>async({...t})=>{try{return re(await e.PINAuthentication.createUser({...t}))}catch(r){throw ae(r)?te(r):r}},fS=e=>async({userToken:t,idempotencyKey:r,userId:a,xRequestId:n,...i})=>{try{return re(await e.client.SocialEmailAuthentication.resendOTP(t??await We(e,a),{idempotencyKey:r??Ut(),...i},n))}catch(s){throw ae(s)?te(s):s}},hS=({client:e})=>async({idempotencyKey:t,xRequestId:r,...a})=>{try{return re(await e.SocialEmailAuthentication.createDeviceTokenEmailLogin({idempotencyKey:t??Ut(),...a},r))}catch(n){throw ae(n)?te(n):n}},mS=({client:e})=>async({userId:t,xRequestId:r})=>{try{return re(await e.Users.getUser(t,r))}catch(a){throw ae(a)?te(a):a}},vS=({client:e})=>async({userToken:t,xRequestId:r})=>{try{return re(await e.Users.getUserByToken(t,r))}catch(a){throw ae(a)?te(a):a}},gS=({client:e})=>async({userToken:t,challengeId:r,xRequestId:a})=>{try{return re(await e.Users.getUserChallenge(t,r,a))}catch(n){throw ae(n)?te(n):n}},xS=({client:e})=>async({pinStatus:t,securityQuestionStatus:r,from:a,to:n,pageBefore:i,pageAfter:s,pageSize:o,order:c,xRequestId:l}={})=>{try{return re(await e.Users.listUsers(t,r,a,n,i,s,o,c,l))}catch(u){throw ae(u)?te(u):u}},yS=({client:e})=>async({userToken:t,challengeStatus:r,xRequestId:a})=>{try{return re(await e.Users.listUserChallenges(t,r,a))}catch(n){throw ae(n)?te(n):n}},bS=e=>async({userId:t,userToken:r,deviceId:a,idempotencyKey:n,refreshToken:i,xRequestId:s})=>{try{return re(await e.client.SocialEmailAuthentication.refreshUserToken(r??await We(e,t),{idempotencyKey:n??Ut(),refreshToken:i,deviceId:a},s))}catch(o){throw ae(o)?te(o):o}},ES=({client:e})=>async({idempotencyKey:t,xRequestId:r,...a})=>{try{return re(await e.SocialEmailAuthentication.createDeviceTokenSocialLogin({idempotencyKey:t??Ut(),...a},r))}catch(n){throw ae(n)?te(n):n}},CS=e=>async({userToken:t,userId:r,idempotencyKey:a,accountType:n="EOA",xRequestId:i,...s})=>{try{return re(await e.client.Wallets.createUserWallet(t??await We(e,r),{idempotencyKey:a??Ut(),accountType:n,...s},i))}catch(o){throw ae(o)?te(o):o}},TS=e=>async({id:t,userToken:r,userId:a,xRequestId:n})=>{try{return re(await e.client.Wallets.getWallet(t,r??await We(e,a),n))}catch(i){throw ae(i)?te(i):i}},SS=e=>async({walletId:t,userToken:r,userId:a,includeAll:n,name:i,pageAfter:s,pageBefore:o,pageSize:c,tokenAddresses:l,standard:u,xRequestId:p})=>{try{return re(await e.client.Wallets.listWalletNfts(r??await We(e,a),t,n,i,l?.join(","),u,o,s,c,p))}catch(d){throw ae(d)?te(d):d}},wS=e=>async({walletId:t,userToken:r,userId:a,includeAll:n,name:i,pageAfter:s,pageBefore:o,pageSize:c,tokenAddresses:l,standard:u,xRequestId:p})=>{try{return re(await e.client.Wallets.listWalletBalance(r??await We(e,a),t,n,i,l?.join(","),u,o,s,c,p))}catch(d){throw ae(d)?te(d):d}},AS=e=>async({userId:t,userToken:r,address:a,blockchain:n,from:i,pageAfter:s,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 We(e,t),a,n,d,u,p,i,l,o,s,c,g,h))}catch(y){throw ae(y)?te(y):y}},IS=e=>async({id:t,name:r,refId:a,userToken:n,userId:i})=>{try{return re(await e.client.Wallets.updateWallet(t,n??await We(e,i),{name:r,refId:a}))}catch(s){throw ae(s)?te(s):s}};var BS=Object.defineProperty,RS=(e,t,r)=>t in e?BS(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,kS=(e,t,r)=>RS(e,typeof t!="symbol"?t+"":t,r);const xp="https://api.circle.com";class ih{constructor(t){kS(this,"params");const{apiKey:r,baseUrl:a,storage:n,userAgent:i,headers:s}=t;this.params={client:new Ky(a??xp,{apiKey:r,version:nh,userAgent:i},s),configurationsClient:new hy(a??xp,{apiKey:r,version:nh,userAgent:i},s),storage:n??new rb}}createUserPin(t){return WT(this.params)(t)}createUserPinWithWallets(t){return XT(this.params)(t)}updateUserPin(t){return YT(this.params)(t)}restoreUserPin(t){return QT(this.params)(t)}createDeviceTokenForEmailLogin(t){return hS(this.params)(t)}createDeviceTokenForSocialLogin(t){return ES(this.params)(t)}refreshUserToken(t){return bS(this.params)(t)}resendOTP(t){return fS(this.params)(t)}createWallet(t){return CS(this.params)(t)}listWallets(t){return AS(this.params)(t)}getWallet(t){return TS(this.params)(t)}updateWallet(t){return IS(this.params)(t)}getWalletTokenBalance(t){return wS(this.params)(t)}getWalletNFTBalance(t){return SS(this.params)(t)}accelerateTransaction(t){return aS(this.params)(t)}createTransaction(t){return nS(this.params)(t)}cancelTransaction(t){return rS(this.params)(t)}getTransaction(t){return cS(this.params)(t)}listTransactions(t){return uS(this.params)(t)}estimateContractExecutionFee(t){return iS(this.params)(t)}createUserTransactionContractExecutionChallenge(t){return sS(this.params)(t)}estimateTransferFee(t){return oS(this.params)(t)}validateAddress(t){return pS(this.params)(t)}getLowestNonceTransaction(t){return lS(this.params)(t)}createUser(t){return dS(this.params)(t)}getUser(t){return mS(this.params)(t)}getUserStatus(t){return vS(this.params)(t)}listUsers(t){return xS(this.params)(t)}createUserToken(t){return sh(this.params)(t)}getUserChallenge(t){return gS(this.params)(t)}listUserChallenges(t){return yS(this.params)(t)}getToken(t){return tS(this.params)(t)}signMessage(t){return JT(this.params)(t)}signTransaction(t){return ZT(this.params)(t)}signTypedData(t){return eS(this.params)(t)}requestTestnetTokens(t){return $T(this.params)(t)}createMonitoredTokens(t){return K1(this.params)(t)}updateMonitoredTokens(t){return $1(this.params)(t)}listMonitoredTokens(t){return H1(this.params)(t)}deleteMonitoredTokens(t){return z1(this.params)(t)}updateMonitoredTokensScope(t){return G1(this.params)(t)}createSubscription(t){return W1(this.params)(t)}deleteSubscription(t){return X1(this.params)(t)}getSubscription(t){return Q1(this.params)(t)}getNotificationSignature(t){return Y1(this.params)(t)}listSubscriptions(){return J1(this.params)()}updateSubscription(t){return Z1(this.params)(t)}}function _S(e){return new ih(e)}export{Ir as BadGatewayError,br as BadRequestError,qy as Blockchain,ih as CircleUserControlledWalletsClient,Ur as ConnectionAbortedError,kr as ConnectionRefusedError,Or as ConnectionResetError,_r as ConnectionTimeoutError,Nr as DNSNotFoundError,Lr as DNSTimeoutError,Bu as Error110700,Ru as Error110701,ku as Error110702,_u as Error110703,Fr as Error155101,Vr as Error155102,qr as Error155103,Mr as Error155104,jr as Error155105,Kr as Error155106,zr as Error155107,Hr as Error155108,$r as Error155109,Gr as Error155110,Wr as Error155111,Xr as Error155112,Qr as Error155113,Yr as Error155114,Jr as Error155115,Zr as Error155116,en as Error155117,tn as Error155118,an as Error155119,rn as Error155120,nn as Error155121,sn as Error155122,on as Error155123,cn as Error155124,ln as Error155130,un as Error155131,pn as Error155132,dn as Error155133,fn as Error155134,hn as Error155135,mn as Error155136,vn as Error155137,gn as Error155138,xn as Error155139,yn as Error155140,bn as Error155141,En as Error155142,Cn as Error155143,Tn as Error155144,Sn as Error155145,wn as Error155146,An as Error155150,In as Error155151,Bn as Error155152,Rn as Error155154,kn as Error155155,_n as Error155156,Un as Error155157,Nn as Error155158,Ln as Error155159,Pn as Error155160,On as Error155201,Dn as Error155202,Fn as Error155203,Vn as Error155204,qn as Error155205,Mn as Error155206,jn as Error155207,Kn as Error155208,zn as Error155209,Hn as Error155210,$n as Error155211,Gn as Error155215,Wn as Error155218,Xn as Error155219,Qn as Error155220,Yn as Error155221,Jn as Error155222,Zn as Error155223,es as Error155224,ts as Error155225,as as Error155226,rs as Error155227,ns as Error155228,ss as Error155229,is as Error155230,os as Error155231,cs as Error155232,ls as Error155233,us as Error155234,ps as Error155235,ds as Error155236,fs as Error155237,hs as Error155238,ms as Error155239,vs as Error155240,gs as Error155241,xs as Error155242,ys as Error155243,bs as Error155244,Es as Error155245,Cs as Error155247,Ts as Error155254,Ss as Error155257,ws as Error155258,As as Error155262,Is as Error155264,Bs as Error155501,Rs as Error155502,ks as Error155503,_s as Error155504,Us as Error155505,Ns as Error155506,Ls as Error155507,Ps as Error155508,Os as Error155509,Ds as Error155510,Fs as Error155511,Vs as Error155512,qs as Error155514,Ms as Error155515,js as Error155516,Ks as Error155517,zs as Error155601,Hs as Error155701,$s as Error155702,Gs as Error155703,Ws as Error155704,Xs as Error155705,Qs as Error155706,Ys as Error155707,Js as Error155708,Zs as Error155709,ei as Error155710,ti as Error155711,ai as Error155712,ri as Error155713,ni as Error155714,si as Error155715,ii as Error155716,oi as Error155717,ci as Error155718,li as Error155719,ui as Error155720,pi as Error155721,di as Error155801,fi as Error155802,hi as Error155803,mi as Error155804,vi as Error155805,gi as Error155806,xi as Error155807,yi as Error155808,bi as Error156001,Ei as Error156002,Ci as Error156003,Ti as Error156004,Si as Error156005,wi as Error156006,Ai as Error156007,Ii as Error156008,Bi as Error156009,Ri as Error156010,ki as Error156011,_i as Error156012,Ui as Error156013,Ni as Error156014,Li as Error156015,Pi as Error156016,Oi as Error156017,Di as Error156018,Fi as Error156019,Vi as Error156020,qi as Error156021,Mi as Error156023,ji as Error156024,Ki as Error156025,zi as Error156026,Hi as Error156027,$i as Error156030,Gi as Error156031,Wi as Error156032,Xi as Error175001,Qi as Error175002,Yi as Error175003,Ji as Error175004,Zi as Error175005,eo as Error175006,to as Error175007,ao as Error175008,ro as Error175009,no as Error175010,so as Error175011,io as Error175012,oo as Error175013,co as Error175201,lo as Error175202,uo as Error175203,po as Error175204,fo as Error175205,ho as Error175301,mo as Error175302,vo as Error175303,go as Error175401,xo as Error175402,yo as Error175403,bo as Error175404,Eo as Error175405,Co as Error175406,To as Error175407,So as Error175408,wo as Error175409,Ao as Error175410,Io as Error177001,Bo as Error177002,Ro as Error177003,ko as Error177004,_o as Error177005,Uo as Error177006,No as Error177007,Lo as Error177008,Po as Error177009,Oo as Error177010,Do as Error177011,Fo as Error177012,Vo as Error177013,qo as Error177014,Mo as Error177015,jo as Error177016,Ko as Error177017,zo as Error177018,Ho as Error177019,$o as Error177020,Go as Error177021,Wo as Error177022,Xo as Error177023,Qo as Error177024,Yo as Error177025,Jo as Error177026,Zo as Error177301,ec as Error177302,tc as Error177303,ac as Error177304,rc as Error177305,nc as Error177601,sc as Error177602,ic as Error177603,oc as Error177604,cc as Error177605,lc as Error177606,uc as Error177607,pc as Error177901,Cr as ForbiddenError,Rr as GatewayTimeoutError,Dr as HostUnreachableError,yr as HttpError,Lt as HttpRequestError,C as HttpResponseError,wr as InternalServerError,Pr as NetworkUnreachableError,Tr as NotFoundError,Ar as NotImplementedError,Sr as RatelimitError,Br as ServiceUnavailableError,Er as UnauthorizedError,xp as defaultBaseUrl,te as fromAxiosError,_S as initiateUserControlledWalletsClient};
46
+ `,i},El.publicKeyToOpenSSH=function(e,t){var r="ssh-rsa";t=t||"";var a=et.util.createBuffer();return rr(a,r),Jt(a,e.e),Jt(a,e.n),r+" "+et.util.encode64(a.bytes())+" "+t},El.privateKeyToOpenSSH=function(e,t){return t?et.pki.encryptRsaPrivateKey(e,t,{legacy:!0,algorithm:"aes128"}):et.pki.privateKeyToPem(e)},El.getPublicKeyFingerprint=function(e,t){t=t||{};var r=t.md||et.md.md5.create(),a="ssh-rsa",n=et.util.createBuffer();rr(n,a),Jt(n,e.e),Jt(n,e.n),r.start(),r.update(n.getBytes());var i=r.digest();if(t.encoding==="hex"){var s=i.toHex();return t.delimiter?s.match(/.{2}/g).join(t.delimiter):s}else{if(t.encoding==="binary")return i.getBytes();if(t.encoding)throw new Error('Unknown encoding "'+t.encoding+'".')}return i};function Jt(e,t){var r=t.toString(16);r[0]>="8"&&(r="00"+r);var a=et.util.hexToBytes(r);e.putInt32(a.length),e.putBytes(a)}function rr(e,t){e.putInt32(t.length),e.putString(t)}function Cl(){for(var e=et.md.sha1.create(),t=arguments.length,r=0;r<t;++r)e.update(arguments[r]);return e.digest()}const Ut=()=>ph(),$T=({configurationsClient:e})=>async t=>{try{return await e.Faucet.requestTestnetTokens(void 0,t)}catch(r){throw ae(r)?te(r):r}};var nh="10.5.4";const sh=({client:e})=>async({xRequestId:t,...r})=>{try{return re(await e.PINAuthentication.getUserToken({...r},t))}catch(a){throw ae(a)?te(a):a}},We=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 GT(e,t)};async function GT(e,t){const r=await sh(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 WT=e=>async({userToken:t,userId:r,idempotencyKey:a,xRequestId:n})=>{try{return re(await e.client.PINAuthentication.createUserPinChallenge(t??await We(e,r),{idempotencyKey:a??Ut()},n))}catch(i){throw ae(i)?te(i):i}},XT=e=>async({userToken:t,userId:r,idempotencyKey:a,accountType:n="EOA",xRequestId:i,...s})=>{try{return re(await e.client.Users.createUserWithPinChallenge(t??await We(e,r),{idempotencyKey:a??Ut(),accountType:n,...s},i))}catch(o){throw ae(o)?te(o):o}},QT=e=>async({userToken:t,userId:r,idempotencyKey:a,xRequestId:n})=>{try{return re(await e.client.PINAuthentication.createUserPinRestoreChallenge(t??await We(e,r),{idempotencyKey:a??Ut()},n))}catch(i){throw ae(i)?te(i):i}},YT=e=>async({userToken:t,userId:r,idempotencyKey:a})=>{try{return re(await e.client.PINAuthentication.updateUserPinChallenge(t??await We(e,r),{idempotencyKey:a??Ut()}))}catch(n){throw ae(n)?te(n):n}},JT=e=>async({userToken:t,userId:r,xRequestId:a,...n})=>{try{return re(await e.client.Signing.signUserMessage(t??await We(e,r),n,a))}catch(i){throw ae(i)?te(i):i}},ZT=e=>async({userToken:t,userId:r,xRequestId:a,...n})=>{try{return re(await e.client.Signing.signUserTransaction(t??await We(e,r),{...n},a))}catch(i){throw ae(i)?te(i):i}},eS=e=>async({userToken:t,userId:r,xRequestId:a,...n})=>{try{return re(await e.client.Signing.signUserTypedData(t??await We(e,r),n,a))}catch(i){throw ae(i)?te(i):i}},tS=({client:e})=>async({id:t})=>{try{return re(await e.TokenLookup.getTokenId(t))}catch(r){throw ae(r)?te(r):r}},aS=e=>async({userToken:t,userId:r,id:a,idempotencyKey:n,xRequestId:i})=>{try{return re(await e.client.Transactions.createUserTransactionAccelerateChallenge(t??await We(e,r),a,{idempotencyKey:n??Ut()},i))}catch(s){throw ae(s)?te(s):s}},rS=e=>async({userToken:t,userId:r,id:a,idempotencyKey:n,xRequestId:i})=>{try{return re(await e.client.Transactions.createUserTransactionCancelChallenge(t??await We(e,r),a,{idempotencyKey:n??Ut()},i))}catch(s){throw ae(s)?te(s):s}},nS=e=>async({userToken:t,userId:r,idempotencyKey:a,fee:n,xRequestId:i,...s})=>{try{return re(await e.client.Transactions.createUserTransactionTransferChallenge(t??await We(e,r),{idempotencyKey:a??Ut(),...n.config,...s},i))}catch(o){throw ae(o)?te(o):o}},sS=e=>async({userToken:t,userId:r,idempotencyKey:a,fee:n,xRequestId:i,...s})=>{try{return re(await e.client.Transactions.createUserTransactionContractExecutionChallenge(t??await We(e,r),{idempotencyKey:a??Ut(),...n.config,...s},i))}catch(o){throw ae(o)?te(o):o}},iS=e=>async({userId:t,userToken:r,source:a,xRequestId:n,...i})=>{try{return re(await e.client.Transactions.createTransactionEstimateFee(r??await We(e,t),{...i,...a},n))}catch(s){throw ae(s)?te(s):s}},oS=e=>async({userToken:t,userId:r,amount:a,xRequestId:n,...i})=>{try{return re(await e.client.Transactions.createTransferEstimateFee(t??await We(e,r),{amounts:a,...i},n))}catch(s){throw ae(s)?te(s):s}},cS=e=>async({id:t,userToken:r,userId:a,txType:n,xRequestId:i})=>{try{return re(await e.client.Transactions.getTransaction(t,r??await We(e,a),n,i))}catch(s){throw ae(s)?te(s):s}},lS=({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(i){throw ae(i)?te(i):i}},uS=e=>async({userToken:t,blockchain:r,destinationAddress:a,includeAll:n,operation:i,state:s,txHash:o,txType:c,userId:l,walletIds:u,from:p,pageAfter:d,pageBefore:g,pageSize:h,to:y,order:b,xRequestId:E})=>{try{return re(await e.client.Transactions.listTransactions(t??await We(e,l),r,a,n,i,s,o,c,l,u?.join(","),p,y,g,d,h,b,E))}catch(I){throw ae(I)?te(I):I}},pS=({client:e})=>async t=>{try{return re(await e.Transactions.createValidateAddress(t))}catch(r){throw ae(r)?te(r):r}},dS=({client:e})=>async({...t})=>{try{return re(await e.PINAuthentication.createUser({...t}))}catch(r){throw ae(r)?te(r):r}},fS=e=>async({userToken:t,idempotencyKey:r,userId:a,xRequestId:n,...i})=>{try{return re(await e.client.SocialEmailAuthentication.resendOTP(t??await We(e,a),{idempotencyKey:r??Ut(),...i},n))}catch(s){throw ae(s)?te(s):s}},hS=({client:e})=>async({idempotencyKey:t,xRequestId:r,...a})=>{try{return re(await e.SocialEmailAuthentication.createDeviceTokenEmailLogin({idempotencyKey:t??Ut(),...a},r))}catch(n){throw ae(n)?te(n):n}},mS=({client:e})=>async({userId:t,xRequestId:r})=>{try{return re(await e.Users.getUser(t,r))}catch(a){throw ae(a)?te(a):a}},vS=({client:e})=>async({userToken:t,xRequestId:r})=>{try{return re(await e.Users.getUserByToken(t,r))}catch(a){throw ae(a)?te(a):a}},gS=({client:e})=>async({userToken:t,challengeId:r,xRequestId:a})=>{try{return re(await e.Users.getUserChallenge(t,r,a))}catch(n){throw ae(n)?te(n):n}},xS=({client:e})=>async({pinStatus:t,securityQuestionStatus:r,from:a,to:n,pageBefore:i,pageAfter:s,pageSize:o,order:c,xRequestId:l}={})=>{try{return re(await e.Users.listUsers(t,r,a,n,i,s,o,c,l))}catch(u){throw ae(u)?te(u):u}},yS=({client:e})=>async({userToken:t,challengeStatus:r,xRequestId:a})=>{try{return re(await e.Users.listUserChallenges(t,r,a))}catch(n){throw ae(n)?te(n):n}},bS=e=>async({userId:t,userToken:r,deviceId:a,idempotencyKey:n,refreshToken:i,xRequestId:s})=>{try{return re(await e.client.SocialEmailAuthentication.refreshUserToken(r??await We(e,t),{idempotencyKey:n??Ut(),refreshToken:i,deviceId:a},s))}catch(o){throw ae(o)?te(o):o}},ES=({client:e})=>async({idempotencyKey:t,xRequestId:r,...a})=>{try{return re(await e.SocialEmailAuthentication.createDeviceTokenSocialLogin({idempotencyKey:t??Ut(),...a},r))}catch(n){throw ae(n)?te(n):n}},CS=e=>async({userToken:t,userId:r,idempotencyKey:a,accountType:n="EOA",xRequestId:i,...s})=>{try{return re(await e.client.Wallets.createUserWallet(t??await We(e,r),{idempotencyKey:a??Ut(),accountType:n,...s},i))}catch(o){throw ae(o)?te(o):o}},TS=e=>async({id:t,userToken:r,userId:a,xRequestId:n})=>{try{return re(await e.client.Wallets.getWallet(t,r??await We(e,a),n))}catch(i){throw ae(i)?te(i):i}},SS=e=>async({walletId:t,userToken:r,userId:a,includeAll:n,name:i,pageAfter:s,pageBefore:o,pageSize:c,tokenAddresses:l,standard:u,xRequestId:p})=>{try{return re(await e.client.Wallets.listWalletNfts(r??await We(e,a),t,n,i,l?.join(","),u,o,s,c,p))}catch(d){throw ae(d)?te(d):d}},wS=e=>async({walletId:t,userToken:r,userId:a,includeAll:n,name:i,pageAfter:s,pageBefore:o,pageSize:c,tokenAddresses:l,standard:u,xRequestId:p})=>{try{return re(await e.client.Wallets.listWalletBalance(r??await We(e,a),t,n,i,l?.join(","),u,o,s,c,p))}catch(d){throw ae(d)?te(d):d}},AS=e=>async({userId:t,userToken:r,address:a,blockchain:n,from:i,pageAfter:s,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 We(e,t),a,n,d,u,p,i,l,o,s,c,g,h))}catch(y){throw ae(y)?te(y):y}},IS=e=>async({id:t,name:r,refId:a,userToken:n,userId:i})=>{try{return re(await e.client.Wallets.updateWallet(t,n??await We(e,i),{name:r,refId:a}))}catch(s){throw ae(s)?te(s):s}};var BS=Object.defineProperty,RS=(e,t,r)=>t in e?BS(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,kS=(e,t,r)=>RS(e,typeof t!="symbol"?t+"":t,r);const xp="https://api.circle.com";class ih{constructor(t){kS(this,"params");const{apiKey:r,baseUrl:a,storage:n,userAgent:i,headers:s}=t;this.params={client:new Ky(a??xp,{apiKey:r,version:nh,userAgent:i},s),configurationsClient:new hy(a??xp,{apiKey:r,version:nh,userAgent:i},s),storage:n??new rb}}createUserPin(t){return WT(this.params)(t)}createUserPinWithWallets(t){return XT(this.params)(t)}updateUserPin(t){return YT(this.params)(t)}restoreUserPin(t){return QT(this.params)(t)}createDeviceTokenForEmailLogin(t){return hS(this.params)(t)}createDeviceTokenForSocialLogin(t){return ES(this.params)(t)}refreshUserToken(t){return bS(this.params)(t)}resendOTP(t){return fS(this.params)(t)}createWallet(t){return CS(this.params)(t)}listWallets(t){return AS(this.params)(t)}getWallet(t){return TS(this.params)(t)}updateWallet(t){return IS(this.params)(t)}getWalletTokenBalance(t){return wS(this.params)(t)}getWalletNFTBalance(t){return SS(this.params)(t)}accelerateTransaction(t){return aS(this.params)(t)}createTransaction(t){return nS(this.params)(t)}cancelTransaction(t){return rS(this.params)(t)}getTransaction(t){return cS(this.params)(t)}listTransactions(t){return uS(this.params)(t)}estimateContractExecutionFee(t){return iS(this.params)(t)}createUserTransactionContractExecutionChallenge(t){return sS(this.params)(t)}estimateTransferFee(t){return oS(this.params)(t)}validateAddress(t){return pS(this.params)(t)}getLowestNonceTransaction(t){return lS(this.params)(t)}createUser(t){return dS(this.params)(t)}getUser(t){return mS(this.params)(t)}getUserStatus(t){return vS(this.params)(t)}listUsers(t){return xS(this.params)(t)}createUserToken(t){return sh(this.params)(t)}getUserChallenge(t){return gS(this.params)(t)}listUserChallenges(t){return yS(this.params)(t)}getToken(t){return tS(this.params)(t)}signMessage(t){return JT(this.params)(t)}signTransaction(t){return ZT(this.params)(t)}signTypedData(t){return eS(this.params)(t)}requestTestnetTokens(t){return $T(this.params)(t)}createMonitoredTokens(t){return K1(this.params)(t)}updateMonitoredTokens(t){return $1(this.params)(t)}listMonitoredTokens(t){return H1(this.params)(t)}deleteMonitoredTokens(t){return z1(this.params)(t)}updateMonitoredTokensScope(t){return G1(this.params)(t)}createSubscription(t){return W1(this.params)(t)}deleteSubscription(t){return X1(this.params)(t)}getSubscription(t){return Q1(this.params)(t)}getNotificationSignature(t){return Y1(this.params)(t)}listSubscriptions(){return J1(this.params)()}updateSubscription(t){return Z1(this.params)(t)}}function _S(e){return new ih(e)}export{Ir as BadGatewayError,br as BadRequestError,qy as Blockchain,ih as CircleUserControlledWalletsClient,Ur as ConnectionAbortedError,kr as ConnectionRefusedError,Or as ConnectionResetError,_r as ConnectionTimeoutError,Nr as DNSNotFoundError,Lr as DNSTimeoutError,Bu as Error110700,Ru as Error110701,ku as Error110702,_u as Error110703,Fr as Error155101,Vr as Error155102,qr as Error155103,Mr as Error155104,jr as Error155105,Kr as Error155106,zr as Error155107,Hr as Error155108,$r as Error155109,Gr as Error155110,Wr as Error155111,Xr as Error155112,Qr as Error155113,Yr as Error155114,Jr as Error155115,Zr as Error155116,en as Error155117,tn as Error155118,an as Error155119,rn as Error155120,nn as Error155121,sn as Error155122,on as Error155123,cn as Error155124,ln as Error155130,un as Error155131,pn as Error155132,dn as Error155133,fn as Error155134,hn as Error155135,mn as Error155136,vn as Error155137,gn as Error155138,xn as Error155139,yn as Error155140,bn as Error155141,En as Error155142,Cn as Error155143,Tn as Error155144,Sn as Error155145,wn as Error155146,An as Error155150,In as Error155151,Bn as Error155152,Rn as Error155154,kn as Error155155,_n as Error155156,Un as Error155157,Nn as Error155158,Ln as Error155159,Pn as Error155160,On as Error155201,Dn as Error155202,Fn as Error155203,Vn as Error155204,qn as Error155205,Mn as Error155206,jn as Error155207,Kn as Error155208,zn as Error155209,Hn as Error155210,$n as Error155211,Gn as Error155215,Wn as Error155218,Xn as Error155219,Qn as Error155220,Yn as Error155221,Jn as Error155222,Zn as Error155223,es as Error155224,ts as Error155225,as as Error155226,rs as Error155227,ns as Error155228,ss as Error155229,is as Error155230,os as Error155231,cs as Error155232,ls as Error155233,us as Error155234,ps as Error155235,ds as Error155236,fs as Error155237,hs as Error155238,ms as Error155239,vs as Error155240,gs as Error155241,xs as Error155242,ys as Error155243,bs as Error155244,Es as Error155245,Cs as Error155247,Ts as Error155254,Ss as Error155257,ws as Error155258,As as Error155262,Is as Error155264,Bs as Error155501,Rs as Error155502,ks as Error155503,_s as Error155504,Us as Error155505,Ns as Error155506,Ls as Error155507,Ps as Error155508,Os as Error155509,Ds as Error155510,Fs as Error155511,Vs as Error155512,qs as Error155514,Ms as Error155515,js as Error155516,Ks as Error155517,zs as Error155601,Hs as Error155701,$s as Error155702,Gs as Error155703,Ws as Error155704,Xs as Error155705,Qs as Error155706,Ys as Error155707,Js as Error155708,Zs as Error155709,ei as Error155710,ti as Error155711,ai as Error155712,ri as Error155713,ni as Error155714,si as Error155715,ii as Error155716,oi as Error155717,ci as Error155718,li as Error155719,ui as Error155720,pi as Error155721,di as Error155801,fi as Error155802,hi as Error155803,mi as Error155804,vi as Error155805,gi as Error155806,xi as Error155807,yi as Error155808,bi as Error156001,Ei as Error156002,Ci as Error156003,Ti as Error156004,Si as Error156005,wi as Error156006,Ai as Error156007,Ii as Error156008,Bi as Error156009,Ri as Error156010,ki as Error156011,_i as Error156012,Ui as Error156013,Ni as Error156014,Li as Error156015,Pi as Error156016,Oi as Error156017,Di as Error156018,Fi as Error156019,Vi as Error156020,qi as Error156021,Mi as Error156023,ji as Error156024,Ki as Error156025,zi as Error156026,Hi as Error156027,$i as Error156030,Gi as Error156031,Wi as Error156032,Xi as Error175001,Qi as Error175002,Yi as Error175003,Ji as Error175004,Zi as Error175005,eo as Error175006,to as Error175007,ao as Error175008,ro as Error175009,no as Error175010,so as Error175011,io as Error175012,oo as Error175013,co as Error175201,lo as Error175202,uo as Error175203,po as Error175204,fo as Error175205,ho as Error175301,mo as Error175302,vo as Error175303,go as Error175401,xo as Error175402,yo as Error175403,bo as Error175404,Eo as Error175405,Co as Error175406,To as Error175407,So as Error175408,wo as Error175409,Ao as Error175410,Io as Error177001,Bo as Error177002,Ro as Error177003,ko as Error177004,_o as Error177005,Uo as Error177006,No as Error177007,Lo as Error177008,Po as Error177009,Oo as Error177010,Do as Error177011,Fo as Error177012,Vo as Error177013,qo as Error177014,Mo as Error177015,jo as Error177016,Ko as Error177017,zo as Error177018,Ho as Error177019,$o as Error177020,Go as Error177021,Wo as Error177022,Xo as Error177023,Qo as Error177024,Yo as Error177025,Jo as Error177026,Zo as Error177301,ec as Error177302,tc as Error177303,ac as Error177304,rc as Error177305,nc as Error177601,sc as Error177602,ic as Error177603,oc as Error177604,cc as Error177605,lc as Error177606,uc as Error177607,pc as Error177901,Cr as ForbiddenError,Rr as GatewayTimeoutError,Dr as HostUnreachableError,yr as HttpError,Lt as HttpRequestError,C as HttpResponseError,wr as InternalServerError,Pr as NetworkUnreachableError,Tr as NotFoundError,Ar as NotImplementedError,Sr as RatelimitError,Br as ServiceUnavailableError,Er as UnauthorizedError,xp as defaultBaseUrl,te as fromAxiosError,_S as initiateUserControlledWalletsClient};
package/package.json CHANGED
@@ -16,7 +16,7 @@
16
16
  "build": "node ./../../packages/rollup/build.js",
17
17
  "release": "npm publish --access public"
18
18
  },
19
- "version": "10.5.1",
19
+ "version": "10.5.4",
20
20
  "devDependencies": {
21
21
  "@rollup/plugin-typescript": "^11.1.4",
22
22
  "@shared/clients": "workspace:*",