@metatrongg/sdk 0.8.0-dev.f506276 → 0.8.0-dev.f69896a
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.
- package/dist/browser/index.d.ts +13 -361
- package/dist/browser/index.js +1 -1
- package/dist/contracts/index.d.ts +3869 -6805
- package/dist/contracts/index.js +1 -1
- package/dist/index.js +1 -1
- package/dist/node/index.d.ts +14 -362
- package/dist/node/index.js +1 -1
- package/dist/webhook/express.js +1 -1
- package/dist/webhook/fastify.js +1 -1
- package/dist/webhook/hono.js +1 -1
- package/dist/webhook/index.js +1 -1
- package/package.json +1 -1
package/dist/browser/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as e from"zod";var t=class extends Error{status;code;body;constructor(e,t,n,r){super(n),this.name=`TronError`,this.status=e,this.code=t,this.body=r}},n=class extends t{error;errorDescription;errorUri;constructor(e,t,n,r,i){super(e,t,`oauth ${e} ${t}${r===void 0?``:`: ${r}`}`,n),this.name=`TronOauthError`,this.error=t,this.errorDescription=r,this.errorUri=i}};const r={BAD_REQUEST:4400,UNAUTHORIZED:4401,FORBIDDEN:4403,NOT_FOUND:4404,UNAVAILABLE:4503};var i=class extends Error{code;reason;constructor(e,t){super(`tron ws closed: ${e}${t===``?``:` ${t}`}`),this.name=`TronWsCloseError`,this.code=e,this.reason=t}get isApplicationError(){return this.code>=4e3&&this.code<5e3}get isPermanent(){return[r.BAD_REQUEST,r.UNAUTHORIZED,r.FORBIDDEN,r.NOT_FOUND].includes(this.code)}};async function a(e,t){if(t.raw===!0)throw Error("sendJson does not support `raw: true`; call send() directly");let n=t.method??`GET`;return e.dedupe!==void 0&&n===`GET`?await e.dedupe.run(o(t),async()=>await c(await s(e,t))):await c(await s(e,t))}function o(e){let t=e.query===void 0?``:JSON.stringify(e.query);return`GET ${e.path}?${t}|${e.bearer??``}`}async function s(e,t){let n=ee(e.issuer,t.path,t.query),r=new Headers(t.headers);t.bearer===void 0?t.basicAuth!==void 0&&r.set(`authorization`,`Basic ${ne(`${t.basicAuth.username}:${t.basicAuth.password}`)}`):r.set(`authorization`,`Bearer ${t.bearer}`),t.idempotencyKey!==void 0&&r.set(`idempotency-key`,t.idempotencyKey);let i=null;t.form===void 0?t.body!==void 0&&(r.set(`content-type`,`application/json`),i=JSON.stringify(t.body)):(r.set(`content-type`,`application/x-www-form-urlencoded`),i=new URLSearchParams(t.form).toString());let a=t.method??`GET`;e.rateLimiter!==void 0&&await e.rateLimiter.acquire(a);let o={method:a,headers:r};i!==null&&(o.body=i);let s=await e.fetch(n,o);if(t.raw===!0)return s;if(!s.ok){let e=await s.text();throw te(s.status,e)}return s}async function c(e){let n=await e.text();if(n!==``)try{return JSON.parse(n)}catch{throw new t(e.status,`non_json`,`response was not json`,n)}}function ee(e,t,n){let r=new URL(t,e.endsWith(`/`)?e:`${e}/`);if(n!==void 0){for(let[e,t]of Object.entries(n))if(t!==void 0)if(typeof t==`string`||typeof t==`number`)r.searchParams.set(e,String(t));else for(let n of t)r.searchParams.append(e,n)}return r.href}function te(e,r){let i;try{i=JSON.parse(r)}catch{return new t(e,`non_json`,`tron ${e}: non-json response`,r)}if(typeof i==`object`&&i){let a=i;if(typeof a.error==`string`&&(a.error_description!==void 0||a.error_uri!==void 0))return new n(e,a.error,r,typeof a.error_description==`string`?a.error_description:void 0,typeof a.error_uri==`string`?a.error_uri:void 0);if(typeof a.error==`string`)return new t(e,a.error,`tron ${e} ${a.error}`,r);if(Array.isArray(a.issues))return new t(e,`validation_failed`,`tron ${e} validation_failed`,r)}return new t(e,`unknown`,`tron ${e}: unknown error shape`,r)}function ne(e){return typeof Buffer<`u`?Buffer.from(e,`utf8`).toString(`base64`):btoa(e)}const l=e.string().min(3).max(18).regex(/^[a-z][a-z0-9_]*$/),re=e.string().nullable(),ie=e.string().max(256).nullable(),ae=e.url().max(2048).nullable(),oe=e.enum([`yellow`,`green`,`blue`,`white`,`black`,`red`]),u=e.enum([`super-admin`,`admin`,`read-only`]).nullable(),se=e.enum([`auto`,`online`,`offline`]),ce=e.enum([`development`,`production`]),d=e.object({id:e.string().min(1),email:e.email().nullable(),emailVerified:e.boolean(),name:l,displayName:re,bio:ie,websiteUrl:ae,image:e.string().nullish(),banner:oe,role:u,presenceStatusMode:se,environmentViewMode:ce,createdAt:e.iso.datetime(),updatedAt:e.iso.datetime()}),le=e.string().min(1);e.object({user:d,token:le.optional()}),e.object({error:e.string().min(1),traceId:e.string().min(1).optional()}),e.object({name:l,email:e.email(),password:e.string().min(8),image:e.url().optional(),callbackURL:e.url().optional()}),e.object({redirect:e.boolean(),token:le.optional(),url:e.url().optional(),user:d.optional()}),e.object({email:e.email(),password:e.string().min(1),callbackURL:e.url().optional(),rememberMe:e.boolean().optional()}),e.object({success:e.boolean()});const ue=e.object({id:e.string().min(1),token:e.string().min(1),userId:e.string().min(1),expiresAt:e.iso.datetime(),ipAddress:e.string().nullish(),userAgent:e.string().nullish(),createdAt:e.iso.datetime(),updatedAt:e.iso.datetime()});e.object({session:ue,user:d}).nullable(),e.object({status:e.boolean()}),e.object({status:e.boolean()}),e.object({email:e.email(),callbackURL:e.url().optional()}),e.object({status:e.boolean()}),e.object({email:e.email(),redirectTo:e.url().optional()}),e.object({status:e.boolean()}),e.object({newPassword:e.string().min(8),token:e.string().min(1)});const de=e.object({issuer:e.url(),authorization_endpoint:e.url(),token_endpoint:e.url(),userinfo_endpoint:e.url(),revocation_endpoint:e.url(),registration_endpoint:e.url(),response_types_supported:e.array(e.enum([`code`])),grant_types_supported:e.array(e.enum([`authorization_code`,`refresh_token`,`client_credentials`])),code_challenge_methods_supported:e.array(e.enum([`S256`])),token_endpoint_auth_methods_supported:e.array(e.enum([`client_secret_basic`,`client_secret_post`,`none`])),scopes_supported:e.array(e.enum([`openid`,`profile`,`payments:charge`,`inventory:read`,`social:read`,`developer:read`,`developer:apps`,`developer:pages`]))}),f=e.url().max(2048),p=e.string().min(1).regex(/^[A-Za-z0-9_:.-]+(?: [A-Za-z0-9_:.-]+)*$/);e.object({client_id:e.string().regex(/^tg_dc_[a-f0-9]{32}$/),client_id_issued_at:e.int().gte(0),client_name:e.string().min(1),redirect_uris:e.array(f),token_endpoint_auth_method:e.enum([`none`]),grant_types:e.array(e.enum([`authorization_code`,`refresh_token`])),response_types:e.array(e.enum([`code`])),scope:p}),e.object({error:e.enum([`invalid_redirect_uri`,`invalid_client_metadata`]),error_description:e.string().optional()}),e.object({redirect_uris:e.array(f).min(1).max(10),client_name:e.string().min(1).max(128).optional(),token_endpoint_auth_method:e.enum([`none`]).optional(),grant_types:e.array(e.enum([`authorization_code`,`refresh_token`])).optional(),response_types:e.array(e.enum([`code`])).optional(),scope:p.optional()});const m=e.string().regex(/^tg_(?:dev|prod|dc)_[A-Za-z0-9]{16,64}$/),fe=e.string().min(1).max(2048),pe=e.string().regex(/^[A-Za-z0-9_~.-]{43,128}$/),me=e.string().regex(/^[a-f0-9]{32}$/);e.object({request:me,app:e.object({id:e.string().min(1),name:e.string().min(1),logoUrl:e.url().nullable()}),clientKind:e.enum([`app`,`connector`]),scopes:e.array(e.enum([`openid`,`profile`,`payments:charge`,`inventory:read`,`social:read`,`developer:read`,`developer:apps`,`developer:pages`])).min(1),developerRole:e.object({approved:e.boolean(),policyVersion:e.string().min(1)}).nullable(),alreadyGranted:e.array(e.enum([`openid`,`profile`,`payments:charge`,`inventory:read`,`social:read`,`developer:read`,`developer:apps`,`developer:pages`])),redirectUriHost:e.string().min(1),payment:e.object({tiersCents:e.array(e.int().gt(0)).min(1),currentLimitCents:e.int().gte(0).nullable(),currentMonthSpentCents:e.int().gte(0).nullable(),payoutChains:e.array(e.string().min(1)),tron:e.object({currentMonthlyLimitTronCents:e.int().gte(0).nullable(),currentMonthSpentTronCents:e.int().gte(0).nullable(),currentAutoApproveEnabled:e.boolean()}).nullable()}).nullable()}),e.object({consentId:e.string().min(1),app:e.object({id:e.string().min(1),name:e.string().min(1),logoUrl:e.url().nullable()}),monthlyLimitCents:e.int().gte(0).nullable(),monthSpentCents:e.int().gte(0),tiersCents:e.array(e.int().gt(0)).min(1)}),e.object({app:e.object({id:e.string().min(1),name:e.string().min(1),logoUrl:e.url().nullable()}),developer:e.object({studioName:e.string().nullable(),logoUrl:e.url().nullable(),studioUrl:e.url().nullable(),studioXHandle:e.string().nullable()})}),e.object({redirect:e.url()});const he=e.int().gte(100).lte(5e6).nullable(),ge=e.int().gt(0).lte(1e8).nullable();e.object({request:me,decision:e.enum([`allow`,`deny`]),acceptDeveloperPolicy:e.boolean().optional(),payment:e.object({monthlyLimitCents:he,tron:e.object({autoApproveEnabled:e.boolean(),monthlyLimitTronCents:ge}).optional()}).optional()});const _e=e.object({access_token:e.string().min(1),token_type:e.enum([`Bearer`]),expires_in:e.int().gt(0),refresh_token:e.string().min(1).optional(),scope:p.optional()});e.object({error:e.enum([`invalid_request`,`invalid_client`,`invalid_grant`,`unauthorized_client`,`unsupported_grant_type`,`unsupported_response_type`,`invalid_scope`,`access_denied`,`server_error`,`temporarily_unavailable`,`invalid_token`,`insufficient_scope`]),error_description:e.string().optional(),error_uri:e.url().optional(),state:fe.optional()});const ve=e.string().regex(/^[A-Za-z0-9_~.-]{43,128}$/),h=e.string().regex(/^[a-f0-9]{64}$/),ye=e.object({grant_type:e.enum([`authorization_code`]),code:e.string().min(1),redirect_uri:f,code_verifier:ve,client_id:m.optional(),client_secret:h.optional()}),be=e.object({grant_type:e.enum([`refresh_token`]),refresh_token:e.string().min(1),scope:p.optional(),client_id:m.optional(),client_secret:h.optional()}),xe=e.object({grant_type:e.enum([`client_credentials`]),scope:p.optional(),client_id:m.optional(),client_secret:h.optional()});e.discriminatedUnion(`grant_type`,[ye.extend({grant_type:e.literal(`authorization_code`)}),be.extend({grant_type:e.literal(`refresh_token`)}),xe.extend({grant_type:e.literal(`client_credentials`)})]);const Se=e.object({sub:e.string().min(1),name:e.string().min(1).nullable(),preferred_username:e.string().min(1).nullable(),picture:e.url().nullable(),wallet_address:e.string().min(1).nullable()});e.object({token:e.string().min(1),token_type_hint:e.enum([`access_token`,`refresh_token`]).optional(),client_id:m.optional(),client_secret:h.optional()});const Ce=e.object({status:e.enum([`completed`]),intentId:e.string().min(1),paymentId:e.string().min(1),usdCents:e.int().gte(0),txHash:e.string().nullable()}),we=e.object({status:e.enum([`redirect`]),intentId:e.string().min(1),redirectUrl:e.url(),usdCents:e.int().gte(0)}),Te=e.discriminatedUnion(`status`,[Ce.extend({status:e.literal(`completed`)}),we.extend({status:e.literal(`redirect`)})]),Ee=e.object({error:e.enum([`monthly_limit_exceeded`]),currentLimitCents:e.int().gte(0),monthSpentCents:e.int().gte(0),attemptedUsdCents:e.int().gte(0),redirectUrl:e.url()});e.object({error:e.enum([`idempotency_key_reused`]),intentId:e.string().min(1)});const g=e.object({purpose:e.string().min(1).max(64).optional(),title:e.string().min(1).max(120).optional(),note:e.string().min(1).max(280).optional(),quantity:e.int().gte(1).lte(1e6).optional(),category:e.string().min(1).max(64).optional(),sessionId:e.string().min(1).max(128).optional(),groupId:e.string().min(1).max(128).optional(),image:e.url().max(2048).optional(),extra:e.record(e.string(),e.union([e.string().max(512),e.number(),e.boolean()])).optional()});e.object({chain:e.string().min(1),amount:e.string().regex(/^\d+$/),token:e.string().regex(/^(?:0x[0-9a-fA-F]{40}|[1-9A-HJ-NP-Za-km-z]{32,44})$/),returnUri:e.url().max(2048),potId:e.string().regex(/^0x[0-9a-fA-F]{32}$/).optional(),rakeBps:e.int().gte(0).lte(3e3).optional(),metadata:g.optional()});const De=e.object({monthlyLimitCents:e.int().gte(0).nullable(),monthSpentCents:e.int().gte(0),periodStart:e.iso.datetime(),offlineAutoChargeEnabled:e.boolean(),perTxOfflineCapCents:e.int().gte(0).nullable(),walletDelegated:e.boolean()}),Oe=e.object({chain:e.string().min(1),token:e.string().regex(/^0x[0-9a-fA-F]{40}$/),tokenDecimals:e.int().gte(0),usdRate:e.string().min(1),feed:e.object({aggregatorAddress:e.string().regex(/^0x[0-9a-fA-F]{40}$/),decimals:e.int().gte(0),answer:e.string().regex(/^\d+$/),updatedAt:e.iso.datetime()}),usdCents:e.int().gte(0).optional(),amount:e.string().regex(/^\d+$/).optional()}),ke=e.object({intentId:e.string().min(1),appId:e.string().min(1),status:e.enum([`pending`,`awaiting_funding`,`completed`,`denied`,`expired`]),paymentId:e.string().nullable(),txHash:e.string().nullable(),usdCents:e.int().gte(0),chain:e.string().min(1),token:e.string().regex(/^(?:0x[0-9a-fA-F]{40}|[1-9A-HJ-NP-Za-km-z]{32,44})$/).nullable(),grossAmount:e.string().regex(/^\d+$/).nullable(),creditedAmount:e.string().regex(/^\d+$/).nullable(),settlement:e.enum([`instant`,`locked`]).nullable(),resolvedAt:e.iso.datetime().nullable(),expiresAt:e.iso.datetime()}),Ae=e.enum([`ethereum`,`base`,`solana`]),je=e.object({intentId:e.string().min(1),consentId:e.string().min(1),app:e.object({id:e.string().min(1),name:e.string().min(1),logoUrl:e.url().nullable()}),chain:e.string().min(1),token:e.string(),amount:e.string(),vault:e.string().regex(/^(?:0x[0-9a-fA-F]{40}|[1-9A-HJ-NP-Za-km-z]{32,44})$/),appealable:e.boolean(),usdCents:e.int().gte(0),monthlyLimitCents:e.int().gte(0).nullable(),monthSpentCents:e.int().gte(0),offlineAutoChargeEnabled:e.boolean(),perTxOfflineCapCents:e.int().gte(0).nullable(),walletDelegated:e.boolean(),canonicalWalletAddress:e.string().nullable(),offlineDenialReason:e.enum([`no_active_play_session`,`driver_unavailable`,`wallet_not_delegated`,`deposit_cap_exceeded`,`insufficient_balance`,`fire_failed`]).nullable(),returnUriHost:e.string().min(1),status:e.enum([`pending`,`awaiting_funding`]),expiresAt:e.iso.datetime(),accessDenied:e.object({reason:e.enum([`not_invited`]),developer:e.object({studioName:e.string().nullable(),logoUrl:e.url().nullable(),studioUrl:e.url().nullable(),studioXHandle:e.string().nullable()})}).nullish(),environment:e.enum([`development`,`production`]),onramp:e.union([e.object({kind:e.enum([`bridge`]),from:Ae,to:Ae}),e.object({kind:e.enum([`insufficient`])})]).optional()}),Me=e.object({chain:e.string().min(1),chainId:e.int().gte(0),id:e.string().regex(/^0x[0-9a-fA-F]{32}$/),amount:e.string().regex(/^\d+$/),token:e.string().regex(/^0x[0-9a-fA-F]{40}$/),vault:e.string().regex(/^0x[0-9a-fA-F]{40}$/),data:e.string().regex(/^0x[0-9a-fA-F]*$/),appealable:e.boolean(),payer:e.string().regex(/^0x[0-9a-fA-F]{40}$/),deadline:e.int().gte(0),routerAddress:e.string().regex(/^0x[0-9a-fA-F]{40}$/),signature:e.string().regex(/^0x[0-9a-fA-F]+$/)}),Ne=e.object({redirect:e.url()}),Pe=e.object({method:e.enum([`signed`]),paymentId:e.string().min(1)}),Fe=e.object({method:e.enum([`offline`])});e.discriminatedUnion(`method`,[Pe.extend({method:e.literal(`signed`)}),Fe.extend({method:e.literal(`offline`)})]);const Ie=e.object({transaction:e.string().min(1),payer:e.string().regex(/^[1-9A-HJ-NP-Za-km-z]{32,44}$/)});e.object({signedTransaction:e.string().min(1)});const Le=e.object({consentId:e.string().min(1),app:e.object({id:e.string().min(1),name:e.string().min(1),logoUrl:e.url().nullable()}),monthlyLimitCents:e.int().gte(0).nullable(),monthSpentCents:e.int().gte(0),periodStart:e.iso.datetime(),offlineAutoChargeEnabled:e.boolean(),perTxOfflineCapCents:e.int().gte(0).nullable()}),Re=e.object({authorizations:e.array(Le)}),ze=e.int().gte(100).lte(1e5).nullable();e.object({offlineAutoChargeEnabled:e.boolean().optional(),perTxOfflineCapCents:ze.optional(),monthlyLimitCents:he.optional()});const Be=e.object({clientName:e.string().min(1),connectedAt:e.iso.datetime()});e.object({connections:e.array(Be)});const Ve=e.object({consentId:e.string().min(1),app:e.object({id:e.string().min(1),name:e.string().min(1),logoUrl:e.url().nullable()}),monthlyLimitTronCents:e.int().gte(0).nullable(),monthSpentTronCents:e.int().gte(0),autoApproveEnabled:e.boolean()});e.object({authorizations:e.array(Ve).max(200)}),e.object({monthlyTronLimitCents:ge.optional(),autoApproveEnabled:e.boolean().optional()});const _=e.string().min(3).max(40).regex(/^[a-z0-9-]+$/),He=e.object({appId:e.uuid(),name:e.string().min(1).max(80),slug:_,bannerUrl:e.url().nullable(),thumbnailUrl:e.url().nullable(),thumbnailVideoUrl:e.url().nullable(),categories:e.array(e.enum(`adventure.battle_royale.board.cards.casino.casual.fighting.idle.mmo.moba.platformer.prediction.puzzle.racing.rhythm.roguelike.rpg.rts.sandbox.shooter.simulation.sports.strategy.survival.tools.tower_defense.visual_novel.other`.split(`.`))),studio:e.object({name:e.string().min(1).max(80).nullable(),logoUrl:e.url().nullable()}).nullable(),firstPublishedAt:e.iso.datetime()}),Ue=e.object({items:e.array(He),nextBefore:e.iso.datetime().nullable()}),v=e.array(e.enum(`adventure.battle_royale.board.cards.casino.casual.fighting.idle.mmo.moba.platformer.prediction.puzzle.racing.rhythm.roguelike.rpg.rts.sandbox.shooter.simulation.sports.strategy.survival.tools.tower_defense.visual_novel.other`.split(`.`))).max(4),y=e.string().min(1).max(80),We=e.object({url:e.url().max(2048),caption:e.string().max(200).optional(),order:e.int().gte(0)}),b=e.array(We).max(6),Ge=e.object({heading:e.string().min(1).max(80),body:e.string().min(1).max(2e3),order:e.int().gte(0)}),x=e.array(Ge).max(8),Ke=e.object({label:e.string().min(1).max(40),url:e.url().max(2048),order:e.int().gte(0)}),S=e.array(Ke).max(10),qe=e.object({ownerUserId:e.uuid().nullable(),name:e.string().nullable(),logoUrl:e.url().nullable(),websiteUrl:e.url().nullable(),xHandle:e.string().nullable(),githubUrl:e.url().nullable()}),C=e.array(e.enum([`web`,`ios`,`android`,`pc`,`playstation`,`xbox`,`switch`])).max(7),w=e.enum([`single_player`,`multiplayer`,`both`]).nullable(),T=e.enum([`everyone`,`13_plus`,`16_plus`,`18_plus`]).nullable(),E=e.array(e.enum([`en`,`es`,`fr`,`de`,`pt`,`it`,`ru`,`ja`,`ko`,`zh`,`hi`,`ar`,`tr`,`vi`,`id`,`th`,`pl`,`nl`])).max(18),D=e.enum([`live`,`open_beta`,`coming_soon`]),Je=e.enum([`tron`,`onchain`,`both`]).nullable(),Ye=e.object({appId:e.uuid(),slug:_,appName:e.string(),appLogoUrl:e.url().nullable(),categories:v,tagline:y,bannerUrl:e.url().nullable(),playUrl:e.url().nullable(),discordUrl:e.url().nullable(),twitterUrl:e.url().nullable(),redditUrl:e.url().nullable(),telegramUrl:e.url().nullable(),gallery:b,chapters:x,links:S,studio:qe,platforms:C,gameType:w,ageRating:T,languages:E,releaseStatus:D,paymentsMode:Je,oauthScopes:e.array(e.string()),chains:e.array(e.string()),publishedAt:e.iso.datetime(),updatedAt:e.iso.datetime()}),Xe=e.object({appId:e.uuid(),slug:_,appName:e.string(),appLogoUrl:e.url().nullable(),categories:v,tagline:y,bannerUrl:e.url().nullable(),discordUrl:e.url().nullable(),twitterUrl:e.url().nullable(),redditUrl:e.url().nullable(),telegramUrl:e.url().nullable(),gallery:b,chapters:x,links:S,studio:qe,platforms:C,gameType:w,ageRating:T,languages:E,releaseStatus:D,publishedAt:e.iso.datetime(),updatedAt:e.iso.datetime()}),O=e.string().min(1).max(4e3),Ze=e.object({url:e.url().max(2048),kind:e.enum([`image`,`video`]),order:e.int().gte(0)}),k=e.array(Ze).max(6),Qe=e.object({up:e.int().gte(0),down:e.int().gte(0)}),A=e.object({id:e.uuid(),appId:e.uuid(),body:O,attachments:k,reactions:Qe,commentCount:e.int().gte(0),createdAt:e.iso.datetime(),updatedAt:e.iso.datetime()}),$e=e.object({updates:e.array(A),total:e.int().gte(0),hasMore:e.boolean()}),et=e.string().min(1).max(1e3),j=e.object({userId:e.uuid(),handle:e.string().nullable(),name:e.string().min(1).max(80).nullable(),avatarUrl:e.url().nullable()}),tt=e.object({id:e.uuid(),body:et,author:j,createdAt:e.iso.datetime()}),nt=e.object({comments:e.array(tt),total:e.int().gte(0),hasMore:e.boolean()}),rt=e.object({interestCount:e.int().gte(0)}),M=e.object({interested:e.boolean(),subscribed:e.boolean(),interestCount:e.int().gte(0)});e.object({interested:e.boolean()}),e.object({subscribed:e.boolean()});const it=e.object({updateId:e.uuid(),vote:e.enum([`up`,`down`])}),at=e.object({reactions:e.array(it)}),ot=e.enum([`up`,`down`]).nullable(),st=e.object({reactions:Qe,vote:ot});e.object({vote:ot});const ct=e.object({comment:tt,commentCount:e.int().gte(0)});e.object({body:et});const lt=e.object({commentCount:e.int().gte(0)});e.object({body:O,attachments:k.optional()}),e.object({body:O.optional(),attachments:k.optional()});const ut=e.object({deleted:e.literal(!0)}),dt=e.object({url:e.url().max(2048),kind:e.enum([`image`,`video`])}),ft=e.enum([`overwhelmingly_positive`,`very_positive`,`positive`,`mostly_positive`,`mixed`,`mostly_negative`,`negative`,`overwhelmingly_negative`]).nullable(),pt=e.object({count:e.int().gte(0),recommendedCount:e.int().gte(0),recommendedPct:e.number().gte(0).lte(100).nullable(),summaryLabel:ft}),N=e.boolean(),P=e.string().min(1).max(2e3),mt=e.object({helpful:e.int().gte(0),unhelpful:e.int().gte(0),funny:e.int().gte(0)}),ht=e.object({playtimeSecondsThisGame:e.int().gte(0),gamesPlayed:e.int().gte(0),reviewsWritten:e.int().gte(0)}),gt=e.string().min(1).max(2e3),_t=e.object({body:gt,repliedAt:e.iso.datetime()}).nullable(),vt=e.object({id:e.uuid(),recommended:N,body:P,reactions:mt,tippedCents:e.int().gte(0),commentCount:e.int().gte(0),author:j,authorStats:ht,developerReply:_t,createdAt:e.iso.datetime(),updatedAt:e.iso.datetime()}),yt=e.object({aggregate:pt,reviews:e.array(vt),total:e.int().gte(0),hasMore:e.boolean()}),bt=e.enum([`newest`,`oldest`,`helpful`]).default(`newest`),xt=e.enum([`payment`,`reward`]).nullable(),St=e.object({id:e.uuid(),recommended:N,body:P,createdAt:e.iso.datetime(),updatedAt:e.iso.datetime()}).nullable(),F=e.object({eligible:e.boolean(),eligibleVia:xt,review:St,isAppOwner:e.boolean()});e.object({recommended:N,body:P});const I=e.enum([`helpful`,`unhelpful`]).nullable(),Ct=e.object({reviewId:e.uuid(),vote:I,funny:e.boolean()}),wt=e.object({reactions:e.array(Ct)}),Tt=e.object({reactions:mt,vote:I,funny:e.boolean()});e.object({vote:I,funny:e.boolean()});const Et=e.object({status:e.enum([`completed`]),amountCents:e.int().gt(0),balanceCents:e.int().gte(0),tippedCents:e.int().gte(0)});e.object({amountCents:e.int().gt(0).lte(1e6),note:e.string().min(1).max(280).optional(),challengeId:e.uuid().optional(),signature:e.string().max(2e3).regex(/^0x[0-9a-fA-F]+$/).optional()});const Dt=e.string().min(1).max(1e3),Ot=e.object({id:e.uuid(),body:Dt,author:j,createdAt:e.iso.datetime()}),kt=e.object({comments:e.array(Ot),total:e.int().gte(0),hasMore:e.boolean()}),At=e.object({comment:Ot,commentCount:e.int().gte(0)});e.object({body:Dt});const jt=e.object({commentCount:e.int().gte(0)}),Mt=e.object({developerReply:_t});e.object({body:gt});const Nt=e.object({created:e.boolean()}),L=e.enum([`abuse`,`inappropriate_content`,`cheating`,`spam`,`other`]);e.object({category:L,details:e.string().max(2e3).optional()});const R=e.enum([`open`,`acknowledged`,`dismissed`]),z=e.object({id:e.uuid(),category:L,details:e.string().nullable(),status:R,acknowledgedAt:e.iso.datetime().nullable(),createdAt:e.iso.datetime()}),Pt=e.object({reports:e.array(z),total:e.int().gte(0),hasMore:e.boolean()});e.object({status:e.enum([`acknowledged`,`dismissed`])});const Ft=e.object({id:e.string().min(1),family:e.enum([`evm`,`solana`]),displayName:e.string().min(1),chainId:e.int().optional(),paymentRouter:e.string().optional(),paymentProgram:e.string().optional()}),It=e.object({chains:e.array(Ft)}),Lt=e.object({id:e.string().regex(/^0x[0-9a-f]{32}$/),chain:e.string().min(1),chainId:e.int().gt(0),payer:e.string().regex(/^0x[0-9a-fA-F]{40}$/),amount:e.string().regex(/^\d+$/),token:e.string().regex(/^0x[0-9a-fA-F]{40}$/),vault:e.string().regex(/^0x[0-9a-fA-F]{40}$/),vaultKind:e.enum([`credit`,`platform`]),processorAddress:e.string().regex(/^0x[0-9a-fA-F]{40}$/).nullable(),grossAmount:e.string().regex(/^\d+$/),creditedAmount:e.string().regex(/^\d+$/),settlement:e.enum([`instant`,`locked`]).nullable(),appealable:e.boolean(),vaultReleaseAt:e.iso.datetime().nullable(),consolidatedAt:e.iso.datetime().nullable(),status:e.enum([`pending`,`completed`,`expired`]),txHash:e.string().regex(/^0x[0-9a-fA-F]{64}$/).nullable(),blockNumber:e.string().regex(/^\d+$/).nullable(),deadline:e.iso.datetime(),signedAt:e.iso.datetime(),completedAt:e.iso.datetime().nullable(),recipientApp:e.object({id:e.string().min(1),name:e.string().min(1),logoUrl:e.url().nullable()}).nullable()}),Rt=e.object({payments:e.array(Lt),nextBefore:e.iso.datetime().nullable()}),zt=e.object({kind:e.enum([`payment`]),groupId:e.string().min(1).nullable(),id:e.string().regex(/^0x[0-9a-f]{32}$/),chain:e.string().min(1),chainId:e.int().gt(0),occurredAt:e.iso.datetime(),role:e.enum([`outgoing`,`incoming`]),payer:e.string().regex(/^0x[0-9a-fA-F]{40}$/),beneficiary:e.string().regex(/^0x[0-9a-fA-F]{40}$/).nullable(),counterparty:e.string().regex(/^0x[0-9a-fA-F]{40}$/).nullable(),app:e.object({id:e.string().min(1),name:e.string().min(1),logoUrl:e.url().nullable(),slug:e.string().nullable(),bannerUrl:e.url().nullable()}).nullable(),beneficiaryApp:e.object({id:e.string().min(1),name:e.string().min(1),logoUrl:e.url().nullable(),slug:e.string().nullable(),bannerUrl:e.url().nullable()}).nullable(),amount:e.string().regex(/^\d+$/),token:e.string().regex(/^0x[0-9a-fA-F]{40}$/),vault:e.string().regex(/^0x[0-9a-fA-F]{40}$/),vaultKind:e.enum([`credit`,`platform`]),targetKind:e.enum([`credit`,`pot`]),processorAddress:e.string().regex(/^0x[0-9a-fA-F]{40}$/).nullable(),grossAmount:e.string().regex(/^\d+$/),creditedAmount:e.string().regex(/^\d+$/),settlement:e.enum([`instant`,`locked`]).nullable(),appealable:e.boolean(),disputableLegId:e.string().regex(/^0x[0-9a-f]{32}$/).nullable(),vaultReleaseAt:e.iso.datetime().nullable(),consolidatedAt:e.iso.datetime().nullable(),status:e.enum([`pending`,`completed`,`expired`]),txHash:e.string().regex(/^0x[0-9a-fA-F]{64}$/).nullable(),blockNumber:e.string().regex(/^\d+$/).nullable(),logIndex:e.int().gte(0).nullable(),metadata:g.nullish(),usdCents:e.int().gte(0).nullable()}),Bt=e.object({kind:e.enum([`payment_withdrawal`]),groupId:e.string().min(1).nullable(),id:e.string().regex(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/),chain:e.string().min(1),occurredAt:e.iso.datetime(),role:e.enum([`incoming`]),beneficiary:e.string().regex(/^0x[0-9a-fA-F]{40}$/),counterparty:e.string().regex(/^0x[0-9a-fA-F]{40}$/),paymentId:e.string().regex(/^0x[0-9a-f]{32}$/).nullable(),vault:e.string().regex(/^0x[0-9a-fA-F]{40}$/),amount:e.string().regex(/^\d+$/),token:e.string().regex(/^0x[0-9a-fA-F]{40}$/),txHash:e.string().regex(/^0x[0-9a-fA-F]{64}$/),blockNumber:e.string().regex(/^\d+$/),logIndex:e.int().gte(0),usdCents:e.int().gte(0).nullable()}),Vt=e.object({kind:e.enum([`matured_withdrawal`]),groupId:e.string().min(1).nullable(),id:e.string().regex(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/),chain:e.string().min(1),occurredAt:e.iso.datetime(),role:e.enum([`incoming`]),beneficiary:e.string().regex(/^0x[0-9a-fA-F]{40}$/),counterparty:e.string().regex(/^0x[0-9a-fA-F]{40}$/),vault:e.string().regex(/^0x[0-9a-fA-F]{40}$/),amount:e.string().regex(/^\d+$/),token:e.string().regex(/^0x[0-9a-fA-F]{40}$/),txHash:e.string().regex(/^0x[0-9a-fA-F]{64}$/),blockNumber:e.string().regex(/^\d+$/),logIndex:e.int().gte(0),usdCents:e.int().gte(0).nullable()}),Ht=e.object({kind:e.enum([`payout_sent`]),groupId:e.string().min(1).nullable(),id:e.string().regex(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/),chain:e.string().min(1),occurredAt:e.iso.datetime(),role:e.enum([`incoming`]),recipient:e.string().regex(/^0x[0-9a-fA-F]{40}$/),counterparty:e.string().regex(/^0x[0-9a-fA-F]{40}$/),app:e.object({id:e.string().min(1),name:e.string().min(1),logoUrl:e.url().nullable(),slug:e.string().nullable(),bannerUrl:e.url().nullable()}).nullable(),vault:e.string().regex(/^0x[0-9a-fA-F]{40}$/),amount:e.string().regex(/^\d+$/),token:e.string().regex(/^0x[0-9a-fA-F]{40}$/),txHash:e.string().regex(/^0x[0-9a-fA-F]{64}$/),blockNumber:e.string().regex(/^\d+$/),logIndex:e.int().gte(0),metadata:g.nullish(),usdCents:e.int().gte(0).nullable()}),Ut=e.object({kind:e.enum([`credit_transferred`]),groupId:e.string().min(1).nullable(),id:e.string().regex(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/),chain:e.string().min(1),occurredAt:e.iso.datetime(),role:e.enum([`incoming`]),recipient:e.string().regex(/^0x[0-9a-fA-F]{40}$/),counterparty:e.string().regex(/^0x[0-9a-fA-F]{40}$/),app:e.object({id:e.string().min(1),name:e.string().min(1),logoUrl:e.url().nullable(),slug:e.string().nullable(),bannerUrl:e.url().nullable()}).nullable(),vault:e.string().regex(/^0x[0-9a-fA-F]{40}$/),amount:e.string().regex(/^\d+$/),token:e.string().regex(/^0x[0-9a-fA-F]{40}$/),txHash:e.string().regex(/^0x[0-9a-fA-F]{64}$/),blockNumber:e.string().regex(/^\d+$/),logIndex:e.int().gte(0),usdCents:e.int().gte(0).nullable()}),Wt=e.object({kind:e.enum([`pot_leg`]),groupId:e.string().min(1).nullable(),id:e.string().regex(/^0x[0-9a-f]{32}$/),chain:e.string().min(1),occurredAt:e.iso.datetime(),role:e.enum([`incoming`]),beneficiary:e.string().regex(/^0x[0-9a-fA-F]{40}$/),distributionId:e.string().regex(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/).nullable(),vault:e.string().regex(/^0x[0-9a-fA-F]{40}$/).nullable(),amount:e.string().regex(/^\d+$/),token:e.string().regex(/^0x[0-9a-fA-F]{40}$/),settlement:e.enum([`instant`,`locked`]),releaseAt:e.iso.datetime().nullable(),claimedAt:e.iso.datetime().nullable(),txHash:e.string().regex(/^0x[0-9a-fA-F]{64}$/).nullable(),blockNumber:e.string().regex(/^\d+$/).nullable(),logIndex:e.int().gte(0).nullable(),metadata:g.nullish(),usdCents:e.int().gte(0).nullable()}),Gt=e.object({kind:e.enum([`payment_autoclaim`]),groupId:e.string().min(1).nullable(),id:e.string().regex(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/),chain:e.string().min(1),occurredAt:e.iso.datetime(),role:e.enum([`incoming`]),beneficiary:e.string().regex(/^0x[0-9a-fA-F]{40}$/),paymentId:e.string().regex(/^0x[0-9a-f]{32}$/).nullable(),vault:e.string().regex(/^0x[0-9a-fA-F]{40}$/),token:e.string().regex(/^0x[0-9a-fA-F]{40}$/),autoclaimKind:e.enum([`withdraw_matured`,`withdraw_escrow`,`claim_refund`]),status:e.enum([`pending`,`in_flight`,`succeeded`,`skipped`,`failed`]),attempts:e.int().gte(0),lastError:e.string().nullable(),txHash:e.string().regex(/^0x[0-9a-fA-F]{64}$/).nullable(),settledAt:e.iso.datetime().nullable()}),Kt=e.object({kind:e.enum([`appeal`]),groupId:e.string().min(1).nullable(),id:e.string().regex(/^0x[0-9a-f]{32}$/),chain:e.string().min(1),occurredAt:e.iso.datetime(),role:e.enum([`outgoing`]),appellant:e.string().regex(/^0x[0-9a-fA-F]{40}$/),counterparty:e.string().regex(/^0x[0-9a-fA-F]{40}$/),paymentId:e.string().regex(/^0x[0-9a-f]{32}$/).nullable(),vault:e.string().regex(/^0x[0-9a-fA-F]{40}$/),amount:e.string().regex(/^\d+$/),token:e.string().regex(/^0x[0-9a-fA-F]{40}$/),status:e.enum([`pending_onchain`,`open`,`resolved_refund`,`resolved_dismiss`,`cancelled`,`force_cancelled`]),txHash:e.string().regex(/^0x[0-9a-fA-F]{64}$/).nullable(),blockNumber:e.string().regex(/^\d+$/).nullable(),logIndex:e.int().gte(0).nullable(),resolvedAt:e.iso.datetime().nullable(),refundClaimedAt:e.iso.datetime().nullable(),hasRoom:e.boolean(),resolution:e.object({resolutionId:e.string().regex(/^0x[0-9a-f]{32}$/),outcome:e.int().gte(0).lte(1),deadline:e.int().gte(0),signature:e.string().regex(/^0x[0-9a-fA-F]{130}$/)}).nullable(),usdCents:e.int().gte(0).nullable()}),qt=e.object({kind:e.enum([`moonpay_buy`]),groupId:e.string().min(1).nullable(),id:e.string().regex(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/),occurredAt:e.iso.datetime(),role:e.enum([`incoming`]),walletAddress:e.string().regex(/^0x[0-9a-fA-F]{40}$/),externalId:e.string().min(1),fiatAmountCents:e.int().gte(0),fiatCurrency:e.string().min(1),cryptoAmount:e.string().regex(/^\d+$/),cryptoToken:e.string().regex(/^0x[0-9a-fA-F]{40}$/),cryptoTxHash:e.string().regex(/^0x[0-9a-fA-F]{64}$/).nullable(),status:e.enum([`pending`,`completed`,`failed`])}),Jt=e.object({kind:e.enum([`moonpay_sell`]),groupId:e.string().min(1).nullable(),id:e.string().regex(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/),occurredAt:e.iso.datetime(),role:e.enum([`outgoing`]),walletAddress:e.string().regex(/^0x[0-9a-fA-F]{40}$/),externalId:e.string().min(1),fiatAmountCents:e.int().gte(0),fiatCurrency:e.string().min(1),cryptoAmount:e.string().regex(/^\d+$/),cryptoToken:e.string().regex(/^0x[0-9a-fA-F]{40}$/),cryptoTxHash:e.string().regex(/^0x[0-9a-fA-F]{64}$/).nullable(),status:e.enum([`pending`,`completed`,`failed`])}),Yt=e.object({kind:e.enum([`tron_deposit`]),groupId:e.string().min(1).nullable(),id:e.string().regex(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/),occurredAt:e.iso.datetime(),role:e.enum([`incoming`]),amountCents:e.int().gt(0),status:e.enum([`completed`,`disputed`,`clawed_back`]),receiptUrl:e.url().nullable(),paymentIntentId:e.string().min(1).nullable()}),Xt=e.object({userId:e.string().regex(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/),handle:e.string().nullable(),displayName:e.string().nullable(),role:e.enum([`stake`,`payout`,`dev_cut`,`purchase`,`referral`]),amountCents:e.int()}),Zt=e.object({kind:e.enum([`tron_pot`]),groupId:e.string().min(1).nullable(),id:e.string().regex(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/),occurredAt:e.iso.datetime(),role:e.enum([`incoming`,`outgoing`]),leg:e.enum([`stake`,`payout`,`dev_cut`,`purchase`,`referral`]),amountCents:e.int().gt(0),usdCents:e.int(),status:e.enum([`settled`]),app:e.object({id:e.string().min(1),name:e.string().min(1),logoUrl:e.url().nullable(),slug:e.string().nullable(),bannerUrl:e.url().nullable()}).nullable(),involvedUsers:e.array(Xt).nullish(),metadata:g.nullish()}),Qt=e.object({kind:e.enum([`tron_cashout`]),groupId:e.string().min(1).nullable(),id:e.string().regex(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/),occurredAt:e.iso.datetime(),role:e.enum([`outgoing`]),method:e.enum([`stripe`,`usdc`]),amountCents:e.int().gt(0),feeCents:e.int().gte(0),destinationAddress:e.string().regex(/^0x[0-9a-fA-F]{40}$/).nullable(),chain:e.string().min(1).nullable(),txHash:e.string().regex(/^0x[0-9a-fA-F]{64}$/).nullable(),status:e.enum([`pending`,`approved`,`rejected`,`settled`,`failed`]),stripeTransferId:e.string().min(1).nullable(),rejectionReason:e.string().min(1).nullable(),settledAt:e.iso.datetime().nullable()}),$t=e.object({kind:e.enum([`tron_transfer`]),groupId:e.string().min(1).nullable(),id:e.string().regex(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/),occurredAt:e.iso.datetime(),role:e.enum([`incoming`,`outgoing`]),amountCents:e.int().gt(0),usdCents:e.int(),status:e.enum([`settled`]),counterpartyUserId:e.string().regex(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/).nullable(),counterpartyHandle:e.string().nullable(),counterpartyDisplayName:e.string().nullable(),note:e.string().nullable()}),en=e.object({kind:e.enum([`referral_earning`]),groupId:e.string().min(1).nullable(),id:e.string().regex(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/),chain:e.string().min(1),occurredAt:e.iso.datetime(),role:e.enum([`incoming`]),referralAddress:e.string().regex(/^0x[0-9a-fA-F]{40}$/),paymentId:e.string().regex(/^0x[0-9a-f]{32}$/).nullable(),token:e.string().regex(/^0x[0-9a-fA-F]{40}$/),amount:e.string().regex(/^\d+$/),reversed:e.boolean(),txHash:e.string().regex(/^0x[0-9a-fA-F]{64}$/),logIndex:e.int().gte(0),usdCents:e.int().gte(0).nullable()}),tn=e.object({kind:e.enum([`nft_charge`]),groupId:e.string().min(1).nullable(),id:e.string().regex(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/),occurredAt:e.iso.datetime(),role:e.enum([`outgoing`]),chargeKind:e.enum([`registration`,`mint`,`transfer_gas`]),amountCents:e.int().gt(0),usdCents:e.int(),status:e.enum([`settled`]),collectionAddress:e.string().regex(/^0x[0-9a-fA-F]{40}$/).nullable(),tokenId:e.string().nullable(),counterpartyUserId:e.string().regex(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/).nullable(),counterpartyHandle:e.string().nullable(),counterpartyDisplayName:e.string().nullable()}),nn=e.discriminatedUnion(`kind`,[zt.extend({kind:e.literal(`payment`)}),Bt.extend({kind:e.literal(`payment_withdrawal`)}),Vt.extend({kind:e.literal(`matured_withdrawal`)}),Ht.extend({kind:e.literal(`payout_sent`)}),Ut.extend({kind:e.literal(`credit_transferred`)}),Wt.extend({kind:e.literal(`pot_leg`)}),Gt.extend({kind:e.literal(`payment_autoclaim`)}),Kt.extend({kind:e.literal(`appeal`)}),qt.extend({kind:e.literal(`moonpay_buy`)}),Jt.extend({kind:e.literal(`moonpay_sell`)}),Yt.extend({kind:e.literal(`tron_deposit`)}),Zt.extend({kind:e.literal(`tron_pot`)}),Qt.extend({kind:e.literal(`tron_cashout`)}),$t.extend({kind:e.literal(`tron_transfer`)}),en.extend({kind:e.literal(`referral_earning`)}),tn.extend({kind:e.literal(`nft_charge`)})]),rn=e.object({rows:e.array(nn),nextBefore:e.iso.datetime().nullable(),nextCursor:e.string().nullable(),hasHidden:e.boolean()}),an=e.object({chain:e.string().min(1),token:e.string().regex(/^0x[0-9a-fA-F]{40}$/),creditedWei:e.string().regex(/^\d+$/),drainedWei:e.string().regex(/^\d+$/),outstandingWei:e.string().regex(/^\d+$/)}),on=e.object({rows:e.array(an)}),sn=e.object({enabled:e.boolean(),direction:e.enum([`buy`,`sell`,`both`]).nullable(),countryCode:e.string().regex(/^[A-Z]{2}$/).nullable(),regionSupported:e.boolean()}),cn=e.object({url:e.url(),intentId:e.string().min(1),expiresAt:e.iso.datetime(),walletAddress:e.string().regex(/^0x[0-9a-fA-F]{40}$/)});e.object({intentId:e.string().min(1)});const ln=e.object({url:e.url(),transactionId:e.uuid(),walletAddress:e.string().regex(/^0x[0-9a-fA-F]{40}$/)});e.object({usdcAmount:e.string().regex(/^\d+$/),chain:e.string().min(1).optional()});const un=e.object({enabled:e.boolean(),balanceCents:e.int().gte(0),frozenCents:e.int().gte(0),currency:e.enum([`tron`]),flagged:e.boolean(),minDepositCents:e.int().gt(0),maxDepositCents:e.int().gt(0)}),dn=e.object({id:e.uuid(),kind:e.enum([`deposit`,`pot_stake`,`pot_payout`,`dev_earning`,`cashout_hold`,`cashout_release`,`dispute_freeze`,`dispute_unfreeze`,`hosted_billing`,`store_purchase`,`referral_earning`,`peer_transfer`,`nft_registration`,`nft_mint`,`nft_gas`]),amountCents:e.int(),currency:e.string().min(1),createdAt:e.iso.datetime()}),fn=e.object({entries:e.array(dn).max(100),nextBefore:e.iso.datetime().nullable()}),pn=e.object({clientSecret:e.string().min(1),publishableKey:e.string().min(1),amountCents:e.int().gt(0),currency:e.string().min(1),depositId:e.uuid()});e.object({amountCents:e.int().gt(0).lte(1e6)});const mn=e.object({status:e.enum([`completed`]),amountCents:e.int().gt(0),balanceCents:e.int().gte(0),recipient:e.object({userId:e.uuid(),handle:e.string().nullable(),displayName:e.string().nullable()})});e.object({recipientUserId:e.uuid(),amountCents:e.int().gt(0).lte(1e6),note:e.string().min(1).max(280).optional(),challengeId:e.uuid().optional(),signature:e.string().max(2e3).regex(/^0x[0-9a-fA-F]+$/).optional(),threadId:e.uuid().optional()});const hn=e.object({requireSignature:e.boolean()}),gn=e.object({required:e.literal(!1)}),_n=e.object({required:e.literal(!0),challengeId:e.uuid(),message:e.string(),expiresAt:e.iso.datetime()}),vn=e.discriminatedUnion(`required`,[gn.extend({required:e.literal(!1)}),_n.extend({required:e.literal(!0)})]);e.object({recipientUserId:e.uuid(),amountCents:e.int().gt(0).lte(1e6)}),e.object({balanceCents:e.int().gte(0),rakeBps:e.int().gte(0).lte(3e3)});const yn=e.object({status:e.enum([`completed`]),potId:e.string().regex(/^0x[0-9a-f]{32}$/),balanceCents:e.int().gte(0)}),bn=e.object({status:e.enum([`insufficient_balance`]),potId:e.string().regex(/^0x[0-9a-f]{32}$/),balanceCents:e.int().gte(0)}),xn=e.object({status:e.enum([`redirect`]),intentId:e.string().min(1),redirectUrl:e.url(),amountCents:e.int().gt(0),potId:e.string().regex(/^0x[0-9a-f]{32}$/)});e.discriminatedUnion(`status`,[yn.extend({status:e.literal(`completed`)}),bn.extend({status:e.literal(`insufficient_balance`)}),xn.extend({status:e.literal(`redirect`)})]),e.object({potId:e.string().regex(/^0x[0-9a-f]{32}$/),amountCents:e.int().gt(0),returnUri:e.url(),metadata:g.optional()});const Sn=e.object({status:e.enum([`completed`]),balanceCents:e.int().gte(0)}),Cn=e.object({status:e.enum([`insufficient_balance`]),balanceCents:e.int().gte(0)}),wn=e.object({status:e.enum([`redirect`]),intentId:e.string().min(1),redirectUrl:e.url(),amountCents:e.int().gt(0)});e.discriminatedUnion(`status`,[Sn.extend({status:e.literal(`completed`)}),Cn.extend({status:e.literal(`insufficient_balance`)}),wn.extend({status:e.literal(`redirect`)})]),e.object({amountCents:e.int().gt(0),returnUri:e.url(),metadata:g.optional()}),e.object({intentId:e.string().min(1),consentId:e.string().min(1),app:e.object({id:e.string().min(1),name:e.string().min(1),logoUrl:e.url().nullable()}),amountCents:e.int().gt(0),kind:e.enum([`pot_stake`,`store_purchase`]),potId:e.string().nullable(),monthlyLimitTronCents:e.int().gte(0).nullable(),monthSpentTronCents:e.int().gte(0),autoApproveEnabled:e.boolean(),balanceCents:e.int().gte(0),returnUriHost:e.string().min(1),status:e.enum([`pending`]),expiresAt:e.iso.datetime(),environment:e.enum([`development`,`production`])});const Tn=e.object({status:e.enum([`redirect`]),redirect:e.url()}),En=e.object({status:e.enum([`insufficient_balance`]),balanceCents:e.int().gte(0)});e.discriminatedUnion(`status`,[Tn.extend({status:e.literal(`redirect`)}),En.extend({status:e.literal(`insufficient_balance`)})]),e.object({status:e.enum([`distributed`,`replayed`]),potId:e.string().regex(/^0x[0-9a-f]{32}$/),potBalanceCents:e.int().gte(0)}),e.object({potId:e.string().regex(/^0x[0-9a-f]{32}$/),legs:e.array(e.object({recipientUserId:e.uuid(),amountCents:e.int().gt(0)})).max(64),rakeBps:e.int().gte(0).lte(1e4).optional(),devCutCents:e.int().gte(0).optional().default(0),closePot:e.boolean().optional().default(!0),metadata:g.optional()});const Dn=e.object({url:e.url()}),On=e.object({id:e.uuid(),method:e.enum([`stripe`,`usdc`]),status:e.enum([`pending`,`approved`,`rejected`,`settled`,`failed`]),amountCents:e.int().gt(0),feeCents:e.int().gte(0),currency:e.string().min(1),destinationAddress:e.string().regex(/^0x[0-9a-fA-F]{40}$/).nullable(),chain:e.string().min(1).nullable(),txHash:e.string().min(1).nullable(),rejectionReason:e.string().min(1).nullable(),createdAt:e.iso.datetime(),settledAt:e.iso.datetime().nullable()});e.object({method:e.enum([`stripe`,`usdc`]),amountCents:e.int().gt(0),chain:e.string().min(1).optional()});const kn=e.object({requests:e.array(On).max(100)}),An=e.object({id:e.uuid(),method:e.enum([`stripe`,`usdc`]),status:e.enum([`pending`,`approved`,`rejected`,`settled`,`failed`]),amountCents:e.int().gt(0),feeCents:e.int().gte(0),currency:e.string().min(1),destinationAddress:e.string().regex(/^0x[0-9a-fA-F]{40}$/).nullable(),chain:e.string().min(1).nullable(),txHash:e.string().min(1).nullable(),rejectionReason:e.string().min(1).nullable(),createdAt:e.iso.datetime(),settledAt:e.iso.datetime().nullable(),userId:e.uuid(),requestIdHex:e.string().regex(/^0x[0-9a-f]{32}$/).nullable(),usdcAmount:e.string().regex(/^\d+$/).nullable(),backendSignature:e.string().regex(/^0x[0-9a-f]+$/).nullable(),signatureDeadline:e.iso.datetime().nullable(),poolAddress:e.string().regex(/^0x[0-9a-fA-F]{40}$/).nullable()}),jn=e.object({requests:e.array(An).max(100)});e.object({reason:e.string().min(1).max(500)});const Mn=e.array(e.object({id:e.enum([`ethereum-mainnet`,`base-mainnet`,`ethereum-sepolia`,`base-sepolia`,`solana-mainnet`,`solana-devnet`]),displayName:e.string().min(1),family:e.enum([`evm`,`solana`]),nativeSymbol:e.string().min(1),chainId:e.int().gt(0).optional()})),Nn=e.string().min(1).max(24).regex(/^[a-z0-9]+$/).nullable(),Pn=e.object({id:e.string().min(1),name:e.string().min(1),deletedAt:e.iso.datetime().nullable()}).nullable(),B=e.object({native:e.string().regex(/^\d+(?:\.\d+)?$/),usdc:e.string().regex(/^\d+(?:\.\d+)?$/).optional()}),Fn=e.object({"ethereum-mainnet":B.optional(),"base-mainnet":B.optional(),"ethereum-sepolia":B.optional(),"base-sepolia":B.optional(),"solana-mainnet":B.optional(),"solana-devnet":B.optional()}),In=e.enum([`infinite`,`custom`,`scoped`]).nullable(),Ln=e.object({native:e.string().regex(/^\d+$/),usdc:e.string().regex(/^\d+$/)}).nullable(),Rn=e.int().gte(0).lte(1e3).nullable(),zn=e.object({mode:In,caps:Ln,policyId:e.string().min(1).nullable(),slippageBps:Rn}),Bn=e.object({address:e.union([e.string().regex(/^0x[0-9a-fA-F]{40}$/),e.string().regex(/^[1-9A-HJ-NP-Za-km-z]{32,44}$/)]),family:e.enum([`evm`,`solana`]),label:Nn,kind:e.enum([`personal`,`app`]),app:Pn,balances:Fn,delegation:zn}),Vn=e.object({chains:Mn,wallets:e.array(Bn)}),Hn=e.object({address:e.string().regex(/^0x[0-9a-fA-F]{40}$/),label:Nn});e.object({label:Nn});const Un=e.object({policyId:e.string().min(1).nullable()});e.union([e.object({mode:e.enum([`infinite`])}),e.object({mode:e.enum([`custom`]),caps:Ln}),e.object({mode:e.enum([`scoped`])})]);const Wn=e.object({ok:e.literal(!0)});e.object({name:l.optional(),displayName:re.optional(),bio:e.string().min(1).max(256).nullish(),websiteUrl:ae.optional(),banner:oe.optional(),presenceStatusMode:se.optional(),environmentViewMode:ce.optional()});const Gn=e.object({id:e.string().min(1),title:e.string().max(500),gifUrl:e.url(),previewUrl:e.url(),width:e.int().gt(0),height:e.int().gt(0)}),Kn=e.object({results:e.array(Gn)}),qn=e.object({id:e.string().min(1),name:e.string().min(1),displayName:e.string().nullable(),image:e.url().nullable()}),V=e.object({v:e.literal(1),alg:e.enum([`x25519-ecdh-hkdf-sha256-aes256gcm`]),senderPubKey:e.string().length(43).regex(/^[A-Za-z0-9_-]+$/),senderKeyId:e.string().min(1).max(128),recipientKeyId:e.string().min(1).max(128),iv:e.string().max(64).regex(/^[A-Za-z0-9_-]+$/),ct:e.string().max(16384).regex(/^[A-Za-z0-9_-]+$/)}).nullable(),Jn=e.object({kind:e.enum([`tron_transfer`]),amountCents:e.int().gt(0),recipientUserId:e.string().min(1)}),Yn=e.object({kind:e.enum([`nft_transfer`]),recipientUserId:e.string().min(1),collectionAddress:e.string().min(1),tokenId:e.string().min(1),amount:e.string().min(1),itemName:e.string().nullable(),imageAssetId:e.string().nullish()}),Xn=e.object({id:e.string().min(1),senderUserId:e.string().min(1),body:e.string().max(2e3),envelope:V.optional(),attachment:e.object({url:e.url(),count:e.int().gt(0)}).nullable(),transaction:e.union([Jn,Yn]).nullish(),sentAt:e.iso.datetime()}).nullable(),Zn=e.object({kind:e.enum([`direct`]),id:e.string().min(1),otherParticipant:qn,lastMessage:Xn,unreadCount:e.int().gte(0),pinnedAt:e.iso.datetime().nullable(),createdAt:e.iso.datetime()}),Qn=e.string().min(1).max(80).regex(/^\S(?:.*\S)?$/),$n=e.string().max(500).nullable(),er=e.url().max(2048).nullable(),tr=e.enum([`admin`,`member`]),nr=e.object({id:e.string().min(1),name:e.string().min(1),displayName:e.string().nullable(),image:e.url().nullable(),role:tr}),rr=e.object({kind:e.enum([`group`]),id:e.string().min(1),title:Qn,description:$n,logoUrl:er,participants:e.array(nr),myRole:tr,lastMessage:Xn,unreadCount:e.int().gte(0),pinnedAt:e.iso.datetime().nullable(),createdAt:e.iso.datetime()}),ir=e.discriminatedUnion(`kind`,[Zn.extend({kind:e.literal(`direct`)}),rr.extend({kind:e.literal(`group`)})]),ar=e.object({threads:e.array(ir)});e.object({thread:ir,created:e.boolean()});const or=e.object({kind:e.enum([`direct`]).optional().default(`direct`),recipientUserId:e.string().min(1)}),sr=e.object({kind:e.enum([`group`]),title:Qn,description:$n.optional(),invitedUserIds:e.array(e.string().min(1)).min(1).max(100)}),H=e.object({ok:e.literal(!0)}),U=e.object({thread:rr});e.object({title:Qn.optional(),description:$n.optional()});const cr=e.object({id:e.string().min(1),senderUserId:e.string().min(1),body:e.string().max(2e3).nullable(),envelope:V.optional()}).nullable(),lr=e.enum([`👍`,`👎`,`❤️`,`😂`,`😮`,`😢`,`🔥`,`🎉`,`🙏`,`👀`,`✅`,`🎮`]),ur=e.object({emoji:lr,count:e.int().gt(0),userIds:e.array(e.string().min(1))}),dr=e.enum([`image`]),fr=e.object({id:e.string().min(1),kind:dr,url:e.url(),contentType:e.string().min(1),fileName:e.string().min(1),byteSize:e.int().gte(0),width:e.int().gt(0).nullable(),height:e.int().gt(0).nullable()}),pr=e.object({url:e.url(),title:e.string().max(500).nullable(),description:e.string().max(1e3).nullable(),imageUrl:e.url().nullable(),siteName:e.string().max(200).nullable()}),mr=e.object({id:e.string().min(1),threadId:e.string().min(1),senderUserId:e.string().min(1),transaction:e.union([Jn,Yn]).nullish(),body:e.string().max(2e3),envelope:V.optional(),sentAt:e.iso.datetime(),editedAt:e.iso.datetime().nullable(),deletedAt:e.iso.datetime().nullable(),replyTo:cr,reactions:e.array(ur),attachments:e.array(fr),linkPreviews:e.array(pr)}),hr=e.object({messages:e.array(mr),nextBefore:e.iso.datetime().nullable()}),gr=e.string().max(2e3);e.object({body:gr.optional(),envelope:V.optional(),replyToMessageId:e.string().min(1).optional(),attachmentIds:e.array(e.string().min(1)).max(3).optional()});const _r=e.string().min(1).max(2e3);e.object({body:_r.optional(),envelope:V.optional()});const vr=e.object({aggregate:ur.nullable()}),W=e.object({attachment:fr});e.object({userIds:e.array(e.string().min(1)).min(1).max(100)});const yr=e.object({pinnedAt:e.iso.datetime()}),br=e.enum([`x25519`]),xr=e.object({userId:e.string().min(1),keyId:e.string().min(1).max(128),publicKey:e.string().length(43).regex(/^[A-Za-z0-9_-]+$/),algorithm:br}),Sr=e.object({key:xr});e.object({publicKey:e.string().length(43).regex(/^[A-Za-z0-9_-]+$/),keyId:e.string().min(1).max(128),algorithm:br});const Cr=e.object({threadId:e.string().min(1),key:xr.nullable()}),wr=e.object({keys:e.array(Cr)});e.object({threadIds:e.array(e.string().min(1)).min(1).max(200)});const Tr=e.object({exists:e.boolean(),attemptsRemaining:e.int().gte(0),kdfSalt:e.string().length(22).regex(/^[A-Za-z0-9_-]+$/).nullable(),kdfIterations:e.int().gte(1e5).lte(5e6).nullable()}),Er=e.object({ok:e.literal(!0)});e.object({scalar:e.string().length(43).regex(/^[A-Za-z0-9_-]+$/),secret:e.string().length(43).regex(/^[A-Za-z0-9_-]+$/),pinKey:e.string().length(43).regex(/^[A-Za-z0-9_-]+$/),kdfSalt:e.string().length(22).regex(/^[A-Za-z0-9_-]+$/),kdfIterations:e.int().gte(1e5).lte(5e6)});const Dr=e.union([e.object({result:e.enum([`ok`]),scalar:e.string().length(43).regex(/^[A-Za-z0-9_-]+$/)}),e.object({result:e.enum([`wrong-pin`]),attemptsRemaining:e.int().gte(0)})]);e.object({pinKey:e.string().length(43).regex(/^[A-Za-z0-9_-]+$/)}),e.object({role:tr});const Or=e.object({name:e.string().nullable(),handle:e.string().nullable()}).nullable(),kr=e.object({chain:e.string().min(1),token:e.string().regex(/^0x[0-9a-fA-F]{40}$/),amount:e.string().regex(/^\d+$/),usdCents:e.int().nullable()}),Ar=e.object({code:e.string().nullable(),xLinked:e.boolean(),referrer:Or,refereeCount:e.int().gte(0),lifetimeEarnings:e.array(kr),lifetimeUsdCents:e.int().nullable(),last30dEarnings:e.array(kr),last30dUsdCents:e.int().nullable()}),jr=e.object({code:e.string().min(1),generatedAt:e.iso.datetime()}),Mr=e.object({status:e.enum([`eligible`,`already-referred`,`self-referral`,`unknown-code`,`revoked-code`,`window-expired`]),referrer:Or}),Nr=e.object({status:e.enum([`bound`,`already-referred`,`self-referral`,`unknown-code`,`revoked-code`,`window-expired`]),referrer:Or});e.object({code:e.string().min(1).max(64),source:e.enum([`signup-url`,`manual-claim`,`cookie-restore`]).optional().default(`manual-claim`)});const G=e.string().regex(/^[a-f0-9]{64}$/);e.object({playSessionId:G,expiresAt:e.iso.datetime()});const K=e.uuid();e.object({appId:K});const Pr=e.object({ok:e.literal(!0),ttlSeconds:e.int().gt(0)});e.object({playSessionId:G,status:e.enum([`pending`,`active`,`ended`])});const Fr=e.uuid();e.object({playSessionId:G,userId:Fr}),e.object({status:e.enum([`pending`,`active`,`ended`])}),e.object({playSessionId:G}),e.object({status:e.enum([`ended`])}),e.object({playSessionId:G});const Ir=e.object({appId:K,name:e.string(),logoUrl:e.string().nullable(),sessionCount:e.int().gte(0),totalDurationSeconds:e.int().gte(0)}),Lr=e.object({apps:e.array(Ir),totalSessionCount:e.int().gte(0),totalDurationSeconds:e.int().gte(0)}),Rr=e.object({date:e.string().regex(/^\d{4}-\d{2}-\d{2}$/),appId:K,sessionCount:e.int().gte(0),totalDurationSeconds:e.int().gte(0)}),zr=e.object({from:e.string().regex(/^\d{4}-\d{2}-\d{2}$/),to:e.string().regex(/^\d{4}-\d{2}-\d{2}$/),buckets:e.array(Rr)});e.object({appId:K,sessionCount:e.int().gte(0),uniquePlayerCount:e.int().gte(0),totalDurationSeconds:e.int().gte(0)});const Br=e.object({followers:e.int().gte(0),following:e.int().gte(0),gamesPlayed:e.int().gte(0),totalPlaytimeSeconds:e.int().gte(0),reviewsLeft:e.int().gte(0),rewardsWon:e.int().gte(0),rewardsValueUsdCents:e.int().gte(0)}),Vr=e.object({date:e.string().regex(/^\d{4}-\d{2}-\d{2}$/),rewardsWon:e.int().gte(0),valueUsdCents:e.int().gte(0)}),Hr=e.object({from:e.string().regex(/^\d{4}-\d{2}-\d{2}$/),to:e.string().regex(/^\d{4}-\d{2}-\d{2}$/),totalRewardsWon:e.int().gte(0),totalValueUsdCents:e.int().gte(0),buckets:e.array(Vr)}),Ur=e.object({collectionId:e.string(),collectionAddress:e.string(),chain:e.string(),kind:e.enum([`erc721`,`erc1155`]),tokenId:e.string(),amount:e.string(),name:e.string().nullable(),description:e.string().nullable(),imageAssetId:e.string().nullable(),bannerAssetId:e.string().nullable(),devMetadata:e.record(e.string(),e.unknown()),appId:e.string().nullable(),appName:e.string().nullable(),appLogoUrl:e.string().nullable()}),Wr=e.object({items:e.array(Ur)}),Gr=e.object({id:e.string(),appId:e.string(),itemId:e.string(),amount:e.string(),priceCents:e.int().gte(0).nullable(),gasSponsored:e.boolean(),environment:e.enum([`development`,`production`]),createdAt:e.iso.datetime(),tokenId:e.string(),name:e.string().nullable(),description:e.string().nullable(),imageAssetId:e.string().nullable(),chain:e.string(),collectionAddress:e.string(),kind:e.enum([`erc721`,`erc1155`])}),Kr=e.object({permits:e.array(Gr)}),qr=e.object({mintRequestId:e.string(),txHash:e.string(),status:e.enum([`submitted`,`completed`]),mintedTokenId:e.string().nullable()}),Jr=e.object({mint:qr,charge:e.object({currency:e.enum([`tron`]),gasCents:e.int().gte(0),priceCents:e.int().gte(0),totalCents:e.int().gte(0),gasPaidBy:e.enum([`user`,`developer`])})});e.object({name:e.string(),description:e.string().optional(),image:e.string().optional(),banner_image:e.string().optional(),external_link:e.string().optional()});const Yr=e.object({trait_type:e.string(),value:e.union([e.string(),e.number(),e.boolean()])});e.object({name:e.string(),description:e.string().optional(),image:e.string().optional(),attributes:e.array(Yr),extra:e.record(e.string(),e.record(e.string(),e.unknown()))}),e.object({collectionAddress:e.string().regex(/^0x[0-9a-fA-F]{40}$/),chain:e.string().min(1),toWallet:e.string().regex(/^0x[0-9a-fA-F]{40}$/).optional(),toUserId:e.string().optional(),tokenId:e.string().regex(/^\d+$/).optional(),amount:e.string().regex(/^\d+$/).optional()});const Xr=e.object({id:e.string(),chain:e.string(),collectionAddress:e.string(),kind:e.enum([`erc721`,`erc1155`]),name:e.string().nullable(),environment:e.enum([`development`,`production`])}),Zr=e.object({collections:e.array(Xr)}),Qr=e.object({itemCount:e.int().gt(0),baselineUsdCents:e.int().gte(0),gasUsdCents:e.int().gte(0),tron:e.object({baselineCents:e.int().gte(0),gasCents:e.int().gte(0),totalCents:e.int().gte(0)}),eth:e.object({baselineWei:e.string().regex(/^\d+$/),gasWei:e.string().regex(/^\d+$/),totalWei:e.string().regex(/^\d+$/)})}),$r=e.enum([`capped`,`flexible`,`unlimited`]),ei=e.object({name:e.string().min(1).max(120).nullish(),description:e.string().max(2e3).nullish(),devMetadata:e.record(e.string(),e.unknown()).optional(),supplyType:$r.optional(),maxSupply:e.string().regex(/^\d+$/).nullish(),active:e.boolean().optional()});e.object({collectionAddress:e.string().regex(/^0x[0-9a-fA-F]{40}$/),chain:e.string().min(1),items:e.array(ei).min(1).max(50)});const q=e.object({id:e.string(),collectionId:e.string(),collectionAddress:e.string(),chain:e.string(),kind:e.enum([`erc721`,`erc1155`]),tokenId:e.string(),name:e.string().nullable(),description:e.string().nullable(),imageAssetId:e.string().nullable(),bannerAssetId:e.string().nullable(),devMetadata:e.record(e.string(),e.unknown()),supplyType:$r.nullable(),maxSupply:e.string().nullable(),active:e.boolean()}),ti=e.object({items:e.array(q),charge:e.object({currency:e.enum([`tron`]),amountCents:e.int().gte(0),baselineCents:e.int().gte(0),gasCents:e.int().gte(0),addItemTxHash:e.string()})}),ni=e.object({items:e.array(q)}),ri=e.object({id:e.string(),appId:e.string(),itemId:e.string(),userId:e.string(),amount:e.string(),priceCents:e.int().gte(0).nullable(),gasSponsored:e.boolean(),status:e.enum([`pending`,`redeemed`,`revoked`]),createdAt:e.iso.datetime()});e.object({toUserId:e.string().min(1),amount:e.string().regex(/^\d+$/).optional(),priceCents:e.int().gte(0).nullish(),gasSponsored:e.boolean().optional()});const ii=e.object({holderCount:e.int().gte(0),walletCount:e.int().gte(0),totalHeld:e.string().regex(/^\d+$/)}),ai=e.object({walletAddress:e.string(),userId:e.string().nullable(),amount:e.string().regex(/^\d+$/)}),oi=e.object({stats:ii,holders:e.array(ai)}),si=e.object({id:e.string(),appId:e.string(),itemId:e.string(),userId:e.string(),direction:e.enum([`vault_in`,`withdraw`]),lockKind:e.enum([`vault`,`burn`]).nullable(),amount:e.string(),gasSponsored:e.boolean(),status:e.enum([`pending`,`redeemed`,`revoked`]),custodyId:e.string().nullable(),createdAt:e.iso.datetime()});e.object({toUserId:e.string().min(1),lockKind:e.enum([`vault`,`burn`]),amount:e.string().regex(/^\d+$/).optional(),gasSponsored:e.boolean().optional()}),e.object({custodyId:e.string().min(1)});const ci=e.object({id:e.string(),appId:e.string(),itemId:e.string(),direction:e.enum([`vault_in`,`withdraw`]),lockKind:e.enum([`vault`,`burn`]).nullable(),amount:e.string(),gasSponsored:e.boolean(),environment:e.enum([`development`,`production`]),custodyId:e.string().nullable(),createdAt:e.iso.datetime(),tokenId:e.string(),name:e.string().nullable(),description:e.string().nullable(),imageAssetId:e.string().nullable(),chain:e.string(),collectionAddress:e.string(),kind:e.enum([`erc721`,`erc1155`])}),li=e.object({permits:e.array(ci)}),ui=e.object({permitId:e.string(),direction:e.enum([`vault_in`,`withdraw`]),vault:e.string(),collection:e.string(),user:e.string(),tokenId:e.string().regex(/^\d+$/),amount:e.string().regex(/^\d+$/),lockKind:e.enum([`vault`,`burn`]).nullable(),destination:e.string().nullable(),deadline:e.int().gt(0),signature:e.string()}),di=e.object({direction:e.enum([`vault_in`,`withdraw`]),collection:e.string(),vault:e.string(),chainId:e.int().gt(0),user:e.string(),tokenId:e.string().regex(/^\d+$/),amount:e.string().regex(/^\d+$/),nonce:e.string().regex(/^\d+$/).nullable(),deadline:e.int().gt(0),feeCents:e.int().gte(0),gasWei:e.string().regex(/^\d+$/),gasPaidBy:e.enum([`developer`,`user`]),requiresUserSignature:e.boolean()}),fi=e.object({ok:e.boolean(),txHash:e.string(),chargedCents:e.int().gte(0),gasPaidBy:e.enum([`developer`,`user`])});e.object({userSignature:e.string().min(1).optional(),deadline:e.int().gt(0).optional()});const pi=e.object({collection:e.string(),chainId:e.int().gt(0),from:e.string(),to:e.string(),tokenId:e.string().regex(/^\d+$/),amount:e.string().regex(/^\d+$/),nonce:e.string().regex(/^\d+$/),deadline:e.int().gt(0),feeCents:e.int().gte(0),gasWei:e.string().regex(/^\d+$/),selfPayAvailable:e.boolean()});e.object({toUserId:e.string().min(1),collection:e.string().min(1),tokenId:e.string().regex(/^\d+$/),amount:e.string().regex(/^\d+$/).optional()});const mi=e.object({ok:e.boolean(),txHash:e.string(),chargedCents:e.int().gte(0)});e.object({toUserId:e.string().min(1),collection:e.string().min(1),tokenId:e.string().regex(/^\d+$/),amount:e.string().regex(/^\d+$/).optional(),deadline:e.int().gt(0),userSignature:e.string().min(1),threadId:e.string().min(1).optional()});const hi=e.object({id:e.string(),collectionId:e.string(),collectionAddress:e.string(),chain:e.string(),kind:e.enum([`erc721`,`erc1155`]),tokenId:e.string(),amount:e.string(),lockKind:e.enum([`vault`,`burn`]),vaultAddress:e.string(),createdAt:e.iso.datetime(),name:e.string().nullable(),description:e.string().nullable(),imageAssetId:e.string().nullable()}),gi=e.object({custody:e.array(hi)}),_i=e.object({ok:e.boolean(),txHash:e.string()}),vi=e.object({requesterId:e.string().min(1),requesterName:e.string().min(1),requesterDisplayName:e.string().nullable(),requesterImage:e.url().nullable(),friendshipId:e.string().min(1)}),yi=e.object({accepterId:e.string().min(1),accepterName:e.string().min(1),accepterDisplayName:e.string().nullable(),accepterImage:e.url().nullable(),friendshipId:e.string().min(1)}),bi=e.object({appId:e.uuid(),appName:e.string().min(1),scope:e.enum([`publish`,`changes`,`bip_publish`])}),xi=e.object({appId:e.uuid(),appName:e.string().min(1),scope:e.enum([`publish`,`changes`,`bip_publish`]),notes:e.string().min(1).max(1e3)}),Si=e.object({appId:e.uuid(),appName:e.string().min(1),appSlug:e.string().nullable(),updateId:e.uuid()}),Ci=e.object({appId:e.uuid(),appName:e.string().min(1),appSlug:e.string().nullable()}),wi=e.object({appId:e.uuid(),appName:e.string().min(1),appLogoUrl:e.url().nullable(),inviterId:e.string().min(1),inviterName:e.string().min(1),inviterDisplayName:e.string().nullable()}),Ti=e.object({appId:e.uuid(),appName:e.string().min(1),accepterId:e.string().min(1),accepterName:e.string().min(1),accepterDisplayName:e.string().nullable(),accepterImage:e.url().nullable()}),Ei=e.union([e.object({id:e.string().min(1),kind:e.enum([`friend_request`]),payload:vi,read:e.boolean(),createdAt:e.iso.datetime()}),e.object({id:e.string().min(1),kind:e.enum([`friend_accepted`]),payload:yi,read:e.boolean(),createdAt:e.iso.datetime()}),e.object({id:e.string().min(1),kind:e.enum([`app_page_approved`]),payload:bi,read:e.boolean(),createdAt:e.iso.datetime()}),e.object({id:e.string().min(1),kind:e.enum([`app_page_rejected`]),payload:xi,read:e.boolean(),createdAt:e.iso.datetime()}),e.object({id:e.string().min(1),kind:e.enum([`bip_update_published`]),payload:Si,read:e.boolean(),createdAt:e.iso.datetime()}),e.object({id:e.string().min(1),kind:e.enum([`bip_now_playable`]),payload:Ci,read:e.boolean(),createdAt:e.iso.datetime()}),e.object({id:e.string().min(1),kind:e.enum([`app_participant_invite`]),payload:wi,read:e.boolean(),createdAt:e.iso.datetime()}),e.object({id:e.string().min(1),kind:e.enum([`app_participant_accepted`]),payload:Ti,read:e.boolean(),createdAt:e.iso.datetime()})]),Di=e.object({notifications:e.array(Ei),unreadCount:e.int().gte(0)});e.object({ok:e.literal(!0)}),e.object({read:e.boolean()});const Oi=e.enum([`online`,`offline`]),ki=e.object({user:qn,friendshipId:e.string().min(1),acceptedAt:e.iso.datetime(),onlineStatus:Oi}),Ai=e.object({friends:e.array(ki)}),ji=e.object({friends:e.array(qn)});e.object({decision:e.enum([`accept`,`reject`])});const Mi=e.object({provider:e.enum([`twitter`,`discord`,`github`]),subject:e.string().min(1),username:e.string().nullable(),name:e.string().nullable(),profilePictureUrl:e.url().nullable(),verifiedAt:e.iso.datetime().nullable()}),Ni=e.object({accounts:e.array(Mi)}),Pi=e.string().nullable(),Fi=e.url().max(2048).nullable(),Ii=e.object({studioName:e.string().min(1).max(80).nullable(),studioUrl:e.url().max(2048).nullable(),studioXHandle:Pi,githubUrl:Fi,logoUrl:e.url().max(2048).nullable()}),Li=e.object({id:e.string().min(1),name:e.string().min(1),logoUrl:e.url().max(2048).nullable(),environment:e.enum([`development`,`production`])}),Ri=e.object({profile:Ii,apps:e.array(Li)}).nullable(),zi=e.object({followers:e.int().gte(0),following:e.int().gte(0)}),Bi=e.object({gamesPlayed:e.int().gte(0),totalPlaytimeSeconds:e.int().gte(0),reviewsLeft:e.int().gte(0),rewardsWon:e.int().gte(0),rewardsValueUsdCents:e.int().gte(0)}),Vi=e.object({appId:e.string().min(1),name:e.string().min(1),logoUrl:e.url().max(2048).nullable(),sessionCount:e.int().gte(0),totalPlaytimeSeconds:e.int().gte(0)}),Hi=e.object({appId:e.string().min(1),appName:e.string().min(1),appLogoUrl:e.url().max(2048).nullable(),recommended:e.boolean(),body:e.string(),createdAt:e.iso.datetime()}),Ui=e.object({isFollowing:e.boolean(),isFollowedBy:e.boolean(),friendship:e.enum([`none`,`pending_out`,`pending_in`,`accepted`]),friendshipId:e.string().min(1).nullable()}).nullable(),Wi=e.object({id:e.string().min(1),name:e.string().min(1),displayName:e.string().nullable(),bio:e.string().nullable(),websiteUrl:e.url().max(2048).nullable(),image:e.url().nullable(),banner:oe,createdAt:e.iso.datetime(),socials:e.array(Mi),developer:Ri,counts:zi,stats:Bi,topGames:e.array(Vi),recentReviews:e.array(Hi),relationship:Ui}),Gi=e.object({id:e.string().min(1),name:e.string().min(1),displayName:e.string().nullable(),image:e.url().nullable(),socials:e.array(Mi)}),Ki=e.object({results:e.array(Gi)});e.object({ok:e.literal(!0),friendshipId:e.string().min(1)});const qi=e.object({id:e.string().min(1),keyPrefix:e.string().min(1),scopes:e.array(e.enum([`developer:read`,`developer:apps`,`developer:pages`])),createdAt:e.iso.datetime(),expiresAt:e.iso.datetime().nullable(),lastUsedAt:e.iso.datetime().nullable(),revokedAt:e.iso.datetime().nullable()}),Ji=e.object({key:qi,secret:e.string().min(1)});e.object({scopes:e.array(e.enum([`developer:read`,`developer:apps`,`developer:pages`])).min(1),expiresAt:e.iso.datetime().nullish()});const Yi=e.object({keys:e.array(qi)}),J=e.object({ok:e.literal(!0)}),Xi=e.object({id:e.string().min(1)}),Zi=e.string().regex(/^[A-Za-z0-9 ._-]{1,40}$/),Qi=e.object({chain:e.string().min(1),custody:e.enum([`server`])});e.object({name:Zi,chains:e.array(Qi).optional()});const $i=e.string().min(1).max(2048),ea=e.enum([`eth`,`tron`]),ta=e.array(ea).min(1).max(2),na=e.array(Ae).min(1).max(3).nullable();e.object({name:Zi.optional(),slug:_.nullish(),logoUrl:e.url().max(2048).nullish(),testAccess:e.enum([`private`,`public`]).optional(),redirectUris:e.array(e.url().max(2048)).max(20).optional(),embedOrigins:e.array($i).max(20).optional(),acceptedCurrencies:ta.optional(),acceptedNetworks:na.optional(),paymentStatusWebhookUrl:e.url().max(2048).nullish(),paymentStatusWebhookUrlTest:e.url().max(2048).nullish()});const Y=e.object({logoUrl:e.url().nullable()}),ra=e.object({chain:e.string().min(1),token:e.string().min(1),tokenDecimals:e.int(),lockedWei:e.string(),unlockedWei:e.string(),walletBalanceWei:e.string().nullable()}),ia=e.object({appId:e.string().min(1),balances:e.array(ra)}),aa=e.object({appId:e.string().min(1),availableCents:e.int().gte(0),lockedCents:e.int().gte(0),totalCents:e.int().gte(0)}),oa=e.object({ts:e.iso.datetime(),sumCents:e.number(),paymentCount:e.int()}),sa=e.object({appId:e.string().min(1),range:e.string().min(1),bucketSecs:e.int(),windowSecs:e.int(),chain:e.string().nullable(),buckets:e.array(oa)}),ca=e.object({ts:e.iso.datetime(),sessionCount:e.int(),uniquePlayerCount:e.int(),totalDurationSeconds:e.int()}),la=e.object({appId:e.string().min(1),range:e.string().min(1),bucketSecs:e.int(),windowSecs:e.int(),buckets:e.array(ca)}),ua=e.object({appId:e.string().min(1),earnedCents:e.int(),earningEventCount:e.int(),distinctPayers:e.int(),sessionCount:e.int(),uniquePlayerCount:e.int(),totalPlaytimeSeconds:e.int()}),da=e.object({chain:e.string().min(1),address:e.string().regex(/^0x[0-9a-fA-F]{40}$/),custody:e.enum([`server`]).nullable(),walletId:e.string().nullable(),autoSweepEnabled:e.boolean(),sweepThresholdCents:e.int().nullable()}),fa=e.object({appId:e.string().min(1),wallets:e.array(da)}),pa=e.object({appId:e.string().min(1),chain:e.string().min(1),autoSweepEnabled:e.boolean(),sweepThresholdCents:e.int().nullable()});e.object({enabled:e.boolean(),thresholdCents:e.int().gt(0).nullish()});const ma=e.object({appId:e.string().min(1),chain:e.string().min(1),custody:e.enum([`server`]),walletId:e.string().min(1),address:e.string().regex(/^0x[0-9a-fA-F]{40}$/)}),ha=e.object({appId:e.string().min(1),chain:e.string().min(1),token:e.string().min(1),txHash:e.string().min(1),amountWei:e.string().min(1),recipient:e.string().regex(/^0x[0-9a-fA-F]{40}$/)}),ga=e.object({appId:e.string().min(1),chain:e.string().min(1),recipient:e.string().regex(/^0x[0-9a-fA-F]{40}$/),transfers:e.array(e.object({token:e.string().min(1),txHash:e.string().min(1),amountWei:e.string().min(1)}))}),_a=e.object({id:e.string().min(1),clientId:e.string().min(1),environment:e.enum([`development`,`production`]),secretLast4:e.string().min(1),createdAt:e.iso.datetime(),lastUsedAt:e.iso.datetime().nullable()}),va=e.object({key:_a,clientSecret:e.string().min(1)}),ya=e.object({ok:e.literal(!0),status:e.enum([`pending`,`approved`])});e.object({reason:e.string().min(1).max(500).optional()});const ba=e.object({secret:e.string().regex(/^[a-f0-9]{64}$/),secretLast4:e.string().length(4)}),xa=e.object({appealId:e.string().regex(/^0x[0-9a-f]{32}$/),paymentId:e.string().regex(/^0x[0-9a-f]{32}$/),chain:e.string().min(1),vault:e.string().regex(/^0x[0-9a-fA-F]{40}$/),appellant:e.string().regex(/^0x[0-9a-fA-F]{40}$/),amount:e.string().regex(/^\d+$/),token:e.string().regex(/^0x[0-9a-fA-F]{40}$/),status:e.enum([`open`,`resolved_refund`,`resolved_dismiss`,`cancelled`,`force_cancelled`]),reason:e.string().nullable(),filedAt:e.iso.datetime(),resolvedAt:e.iso.datetime().nullable()}),Sa=e.object({appeals:e.array(xa)}),Ca=e.object({paymentId:e.string().regex(/^0x[0-9a-f]{32}$/),chain:e.string().min(1),vault:e.string().regex(/^0x[0-9a-fA-F]{40}$/),beneficiary:e.string().regex(/^0x[0-9a-fA-F]{40}$/),token:e.string().regex(/^0x[0-9a-fA-F]{40}$/),grossAmount:e.string().regex(/^\d+$/),creditedAmount:e.string().regex(/^\d+$/),vaultReleaseAt:e.iso.datetime(),signedAt:e.iso.datetime(),matured:e.boolean(),hasActiveAppeal:e.boolean()}),wa=e.object({deposits:e.array(Ca)}),Ta=e.object({appCount:e.int().gte(0),availableCents:e.int().gte(0),lockedCents:e.int().gte(0),totalCents:e.int().gte(0)}),Ea=e.object({userId:e.string().min(1),status:e.enum([`invited`,`accepted`,`revoked`]),name:e.string().nullable(),email:e.string().nullable(),image:e.url().nullable(),invitedAt:e.iso.datetime(),respondedAt:e.iso.datetime().nullable()}),Da=e.object({participants:e.array(Ea)});e.object({identifier:e.string().min(1).max(80)});const Oa=e.object({appId:e.string().min(1),appName:e.string().min(1),appLogoUrl:e.url().nullable(),status:e.enum([`invited`,`accepted`,`revoked`]),invitedAt:e.iso.datetime()}),ka=e.object({invites:e.array(Oa)}),Aa=e.object({id:e.string().min(1),displayName:e.string().nullable(),email:e.string().nullable()}).nullable(),ja=e.string().min(1).max(80).nullable(),Ma=e.string().min(10).max(1e3).nullable(),Na=e.object({policyVersion:e.string().min(1),policyAcceptedAt:e.iso.datetime(),logoUrl:e.url().max(2048).nullable(),email:e.email().nullable(),xHandle:Pi,teamName:ja,projectDescription:Ma}),Pa=e.object({reason:e.string().min(1).max(500).optional()}),Fa=e.object({id:e.string().min(1),userId:e.string().min(1),user:Aa,kind:e.enum([`role`,`production`]),status:e.enum([`pending`,`approved`,`rejected`,`cancelled`]),appId:e.string().min(1).nullable(),payload:e.union([e.object({kind:e.enum([`role`]),data:Na}),e.object({kind:e.enum([`production`]),data:Pa})]),reviewedBy:e.string().min(1).nullable(),reviewedAt:e.iso.datetime().nullable(),reviewNotes:e.string().nullable(),createdAt:e.iso.datetime(),updatedAt:e.iso.datetime()}).nullable(),Ia=e.object({chain:e.string().min(1),address:e.string().regex(/^0x[0-9a-fA-F]{40}$/)}),La=e.object({id:e.string().min(1),name:Zi,slug:_.nullable(),logoUrl:e.url().max(2048).nullable(),environment:e.enum([`development`,`production`]),productionApprovedAt:e.iso.datetime().nullable(),testAccess:e.enum([`private`,`public`]),createdAt:e.iso.datetime(),redirectUris:e.array(e.url().max(2048)),embedOrigins:e.array($i),acceptedCurrencies:ta,acceptedNetworks:na,payoutAddresses:e.array(Ia),keys:e.array(_a),pendingProductionRequestId:e.string().min(1).nullable(),paymentStatusWebhookUrl:e.url().max(2048).nullable(),paymentStatusWebhookSecretLast4:e.string().length(4).nullable(),paymentStatusWebhookUrlTest:e.url().max(2048).nullable(),paymentStatusWebhookSecretLast4Test:e.string().length(4).nullable()}),Ra=e.object({roleStatus:e.enum([`none`,`pending`,`approved`,`rejected`,`cancelled`]),latestRequest:Fa,profile:Ii.nullable(),apps:e.array(La)});e.object({studioName:e.string().min(1).max(80).nullish(),studioUrl:e.url().max(2048).nullish(),studioXHandle:Pi.optional(),githubUrl:Fi.optional(),logoUrl:e.url().max(2048).nullish()}),e.object({acceptPolicy:e.literal(!0),logoUrl:e.url().max(2048).optional(),email:e.email().optional(),teamName:ja.optional(),projectDescription:Ma.optional()});const za=e.object({enabled:e.boolean(),status:e.enum([`draft`,`pending_review`,`published`,`hidden`]),firstPublishedAt:e.iso.datetime().nullable(),reviewedAt:e.iso.datetime().nullable(),reviewNotes:e.string().nullable(),hiddenAt:e.iso.datetime().nullable(),hiddenReasonPublic:e.string().nullable()}),X=e.object({appId:e.uuid(),slug:_.nullable(),status:e.enum([`draft`,`pending_review`,`published`,`hidden`]),categories:v,tagline:y.nullable(),bannerUrl:e.url().max(2048).nullable(),thumbnailUrl:e.url().max(2048).nullable(),thumbnailVideoUrl:e.url().max(2048).nullable(),playUrl:e.url().max(2048).nullable(),discordUrl:e.url().max(2048).nullable(),twitterUrl:e.url().max(2048).nullable(),redditUrl:e.url().max(2048).nullable(),telegramUrl:e.url().max(2048).nullable(),gallery:b,chapters:x,links:S,platforms:C,gameType:w,ageRating:T,languages:E,releaseStatus:D,firstPublishedAt:e.iso.datetime().nullable(),reviewedAt:e.iso.datetime().nullable(),reviewNotes:e.string().nullable(),hiddenAt:e.iso.datetime().nullable(),hiddenReasonPublic:e.string().nullable(),pendingReview:e.boolean(),bip:za});e.object({categories:v.optional(),tagline:y.nullish(),bannerUrl:e.url().max(2048).nullish(),thumbnailUrl:e.url().max(2048).nullish(),thumbnailVideoUrl:e.url().max(2048).nullish(),playUrl:e.url().max(2048).nullish(),discordUrl:e.url().max(2048).nullish(),twitterUrl:e.url().max(2048).nullish(),redditUrl:e.url().max(2048).nullish(),telegramUrl:e.url().max(2048).nullish(),gallery:b.optional(),chapters:x.optional(),links:S.optional(),platforms:C.optional(),gameType:w.optional(),ageRating:T.optional(),languages:E.optional(),releaseStatus:D.optional()});const Ba=e.object({url:e.url().max(2048)});e.object({enabled:e.boolean()});const Va=e.object({playSessionId:e.string().min(1),userId:e.uuid(),appId:e.uuid(),status:e.enum([`pending`,`active`]),userHalfFresh:e.boolean(),gameHalfFresh:e.boolean(),active:e.boolean(),startedAt:e.iso.datetime(),activatedAt:e.iso.datetime().nullable(),lastSeenAt:e.iso.datetime().nullable()}),Ha=e.object({players:e.array(Va),total:e.int().gte(0),liveCount:e.int().gte(0),generatedAt:e.iso.datetime()}),Ua=e.object({id:e.string().min(1),email:e.email().nullable(),role:u,addedBy:e.string().min(1).nullable(),addedAt:e.iso.datetime(),lastAccessedAt:e.iso.datetime().nullable()}),Wa=e.object({admins:e.array(Ua)}),Ga=e.object({id:e.string()});e.object({email:e.email(),role:u.optional()});const Ka=e.object({id:e.string(),role:u});e.object({role:u});const qa=e.object({id:e.string().min(1),name:e.string().min(1),displayName:e.string().nullable(),email:e.email().nullable(),createdAt:e.iso.datetime(),bannedAt:e.iso.datetime().nullable(),deletedAt:e.iso.datetime().nullable()}),Ja=e.object({users:e.array(qa),total:e.int().gte(0),offset:e.int().gte(0),limit:e.int().gt(0)}),Ya=e.object({id:e.string(),banned:e.boolean()});e.object({banned:e.boolean(),reason:e.string().min(1).max(280).optional()});const Xa=e.object({id:e.string().min(1),actorId:e.string().min(1).nullable(),actorKind:e.enum([`user`,`system`,`service`]),action:e.string().min(1),targetType:e.string().min(1),targetId:e.string().min(1),purpose:e.string().min(1),legalBasis:e.enum([`consent`,`contract`,`legitimate-interest`,`legal-obligation`,`vital-interest`,`public-task`]),occurredAt:e.iso.datetime(),attributes:e.record(e.string(),e.unknown()),traceId:e.string().min(1).nullable()}),Za=e.object({rows:e.array(Xa),total:e.int().gte(0),offset:e.int().gte(0),limit:e.int().gt(0)}),Qa=e.object({requests:e.array(Fa)}),$a=e.object({id:e.string().min(1),status:e.enum([`pending`,`approved`,`rejected`,`cancelled`])});e.object({decision:e.enum([`approve`,`reject`]),notes:e.string().min(1).max(1e3).optional()});const eo=e.object({id:e.string().min(1),name:e.string(),environment:e.enum([`development`,`production`]),logoUrl:e.url().nullable(),productionApprovedAt:e.iso.datetime().nullable(),createdAt:e.iso.datetime()}),to=e.object({userId:e.string().min(1),email:e.email(),displayName:e.string().nullable(),image:e.url().nullable(),studio:Ii.nullable(),apps:e.array(eo),grantedAt:e.iso.datetime().nullable()}),no=e.object({developers:e.array(to)}),ro=e.object({appId:e.uuid(),appName:e.string(),ownerDisplayName:e.string().nullable(),ownerImage:e.string().nullable(),ownerUserId:e.uuid(),ownerEmail:e.string().nullable(),appLogoUrl:e.string().nullable(),slug:e.string().nullable(),status:e.enum([`draft`,`pending_review`,`published`,`hidden`]),categories:v,tagline:e.string().nullable(),submittedAt:e.iso.datetime().nullable(),firstPublishedAt:e.iso.datetime().nullable(),hiddenAt:e.iso.datetime().nullable(),hiddenReasonInternal:e.string().nullable(),pendingChangesSubmittedAt:e.iso.datetime().nullable(),bipEnabled:e.boolean(),bipStatus:e.enum([`draft`,`pending_review`,`published`,`hidden`]),bipFirstPublishedAt:e.iso.datetime().nullable(),bipHiddenAt:e.iso.datetime().nullable(),openReportCount:e.int().gte(0)}),io=e.object({items:e.array(ro)}),Z=e.object({status:e.enum([`draft`,`pending_review`,`published`,`hidden`])});e.object({reasonPublic:e.string().min(1).max(500),reasonInternal:e.string().max(2e3).optional()}),e.union([e.object({decision:e.enum([`approve`])}),e.object({decision:e.enum([`reject`]),notes:e.string().min(1).max(1e3)})]);const ao=e.object({field:e.string(),label:e.string(),from:e.string(),to:e.string()}),oo=e.object({appId:e.uuid(),submittedAt:e.iso.datetime().nullable(),changes:e.array(ao)}),so=e.object({bipStatus:e.enum([`draft`,`pending_review`,`published`,`hidden`])}),co=e.object({id:e.uuid(),category:L,details:e.string().nullable(),status:R,acknowledgedAt:e.iso.datetime().nullable(),createdAt:e.iso.datetime(),appId:e.uuid(),appName:e.string(),appSlug:e.string().nullable()}),lo=e.object({reports:e.array(co),total:e.int().gte(0),hasMore:e.boolean()}),uo=e.object({purchaseFeeBps:e.int().gte(0).lte(1e4),stakeFeeBps:e.int().gte(0).lte(1e4),updatedAt:e.iso.datetime(),updatedBy:e.string().min(1).nullable()}),Q=e.object({chain:e.string().min(1),chainId:e.int().gte(0),to:e.string().regex(/^0x[0-9a-fA-F]{40}$/),calldataHex:e.string().regex(/^0x[0-9a-fA-F]*$/)}),fo=e.object({target:e.enum([`purchase`]),envelope:Q}),po=e.object({purchaseFeeBps:e.int().gte(0).lte(1e4),stakeFeeBps:e.int().gte(0).lte(1e4),updatedAt:e.iso.datetime(),updatedBy:e.string().min(1).nullable(),envelopes:e.array(fo)});e.object({purchaseFeeBps:e.int().gte(0).lte(1e4).optional(),stakeFeeBps:e.int().gte(0).lte(1e4).optional()});const mo=e.object({appId:e.string().min(1),platformFeeBps:e.int().gte(0).lte(1e4).nullable(),rakeCapBps:e.int().gte(0).lte(3e3).nullable(),effectivePlatformFeeBps:e.int().gte(0).lte(1e4),effectiveRakeCapBps:e.int().gte(0).lte(3e3),updatedAt:e.iso.datetime().nullable(),updatedBy:e.string().min(1).nullable()});e.object({platformFeeBps:e.int().gte(0).lte(1e4).nullish(),rakeCapBps:e.int().gte(0).lte(3e3).nullish()}),e.object({chain:e.string().min(1),vaultAddress:e.string().regex(/^0x[0-9a-fA-F]{40}$/),processorAddress:e.string().regex(/^0x[0-9a-fA-F]{40}$/),action:e.enum([`add`,`remove`])}),e.object({chain:e.string().min(1),processorAddress:e.string().regex(/^0x[0-9a-fA-F]{40}$/),newTreasury:e.string().regex(/^0x[0-9a-fA-F]{40}$/)});const ho=e.object({chain:e.string().min(1),walletAddress:e.string().regex(/^0x[0-9a-fA-F]{40}$/),reason:e.string().min(1),flaggedBy:e.string().min(1),createdAt:e.iso.datetime(),updatedAt:e.iso.datetime()});e.object({chain:e.string().min(1),walletAddress:e.string().regex(/^0x[0-9a-fA-F]{40}$/),reason:e.string().min(1).max(2e3)});const go=e.object({chain:e.string().min(1),walletAddress:e.string().regex(/^0x[0-9a-fA-F]{40}$/),removed:e.literal(!0)});e.object({chain:e.string().min(1),walletAddress:e.string().regex(/^0x[0-9a-fA-F]{40}$/)});const _o=e.object({entries:e.array(ho)});e.object({chain:e.string().min(1),target:e.enum([`router`,`credit_vault`,`platform_vault`]),newOperator:e.string().regex(/^0x[0-9a-fA-F]{40}$/)}),e.object({chain:e.string().min(1),target:e.enum([`router`,`credit_vault`,`platform_vault`]),action:e.enum([`pause`,`unpause`])}),e.object({chain:e.string().min(1),vaultAddress:e.string().regex(/^0x[0-9a-fA-F]{40}$/),lockSeconds:e.int().gte(0)}),e.object({chain:e.string().min(1),account:e.string().regex(/^0x[0-9a-fA-F]{40}$/),lockSeconds:e.int().gte(0)});const vo=e.object({appealId:e.string().regex(/^0x[0-9a-f]{32}$/),paymentId:e.string().regex(/^0x[0-9a-f]{32}$/),chain:e.string().min(1),vault:e.string().regex(/^0x[0-9a-fA-F]{40}$/),appellant:e.string().regex(/^0x[0-9a-fA-F]{40}$/),amount:e.string().regex(/^\d+$/),token:e.string().regex(/^0x[0-9a-fA-F]{40}$/),status:e.enum([`open`,`resolved_refund`,`resolved_dismiss`,`cancelled`,`force_cancelled`]),reason:e.string().nullable(),filedAt:e.iso.datetime(),resolvedAt:e.iso.datetime().nullable(),resolvedBy:e.string().nullable(),resolutionNotes:e.string().nullable()}),yo=e.object({appeals:e.array(vo),nextCursorFiledAt:e.iso.datetime().nullable()}),bo=e.enum([`pending_onchain`,`open`,`resolved_refund`,`resolved_dismiss`,`cancelled`,`force_cancelled`]),xo=e.enum([`purchase`,`pot`,`matured`]),So=e.object({source:xo,chain:e.string(),amount:e.string().regex(/^\d+$/),token:e.string().regex(/^0x[0-9a-fA-F]{40}$/),vault:e.string().regex(/^0x[0-9a-fA-F]{40}$/),depositId:e.string().regex(/^0x[0-9a-f]{32}$/).nullable(),paymentId:e.string().regex(/^0x[0-9a-f]{32}$/).nullable(),appellant:e.string().regex(/^0x[0-9a-fA-F]{40}$/),appellantUserId:e.string().nullable(),respondent:e.string().regex(/^0x[0-9a-fA-F]{40}$/).nullable(),respondentUserId:e.string().nullable(),reason:e.string().nullable(),filedAt:e.iso.datetime(),resolvedAt:e.iso.datetime().nullable(),resolution:e.object({resolutionId:e.string().regex(/^0x[0-9a-f]{32}$/),outcome:e.int().gte(0).lte(1),deadline:e.int().gte(0),signature:e.string().regex(/^0x[0-9a-fA-F]+$/)}).nullable(),refundClaimedAt:e.iso.datetime().nullable()}),Co=e.enum([`party`,`admin`,`system`]),wo=e.object({id:e.string().min(1),senderUserId:e.string().nullable(),senderRole:Co,body:e.string().nullable(),attachments:e.array(fr),sentAt:e.iso.datetime()}),To=e.object({appealId:e.string().regex(/^0x[0-9a-f]{32}$/),threadId:e.string().nullable(),status:bo,readOnly:e.boolean(),canResolve:e.boolean(),detail:So,messages:e.array(wo)}),Eo=e.object({message:wo});e.object({body:e.string().min(1).max(4e3).optional(),attachmentIds:e.array(e.string().min(1)).max(3).optional()});const Do=e.object({appealId:e.string().regex(/^0x[0-9a-f]{32}$/),resolutionId:e.string().regex(/^0x[0-9a-f]{32}$/),chain:e.string().min(1),chainId:e.int().gt(0),vault:e.string().regex(/^0x[0-9a-fA-F]{40}$/),outcome:e.int().gte(0).lte(1),deadline:e.int().gte(0),signature:e.string().regex(/^0x[0-9a-fA-F]+$/),status:e.enum([`resolved_refund`,`resolved_dismiss`])});e.object({decision:e.enum([`refund`,`dismiss`]),notes:e.string().min(1).max(2e3).optional()});const Oo=e.object({asOf:e.string(),ethUsd:e.number().nullable(),solUsd:e.number().nullable(),solLamportsPerCent:e.int().nullable(),tronUsdPerToken:e.number()}),ko=e.object({appealId:e.string().regex(/^0x[0-9a-f]{32}$/),paymentId:e.string().regex(/^0x[0-9a-f]{32}$/),chain:e.string().min(1),chainId:e.int().gt(0),vault:e.string().regex(/^0x[0-9a-fA-F]{40}$/),appellant:e.string().regex(/^0x[0-9a-fA-F]{40}$/),amount:e.string().regex(/^\d+$/),deadline:e.int().gte(0),signature:e.string().regex(/^0x[0-9a-fA-F]+$/)});e.object({paymentId:e.string().regex(/^0x[0-9a-f]{32}$/),amount:e.string().regex(/^\d+$/),reason:e.string().min(1).max(2e3)}),e.object({legId:e.string().regex(/^0x[0-9a-f]{32}$/),reason:e.string().min(1).max(2e3)});const Ao=e.object({kind:e.enum([`direct`]),txHash:e.string().regex(/^0x[0-9a-fA-F]{64}$/),blockNumber:e.string().regex(/^\d+$/),recipient:e.string().regex(/^0x[0-9a-fA-F]{40}$/),amount:e.string().regex(/^\d+$/)}),jo=e.object({kind:e.enum([`pull`]),txHash:e.string().regex(/^0x[0-9a-fA-F]{64}$/),blockNumber:e.string().regex(/^\d+$/),recipient:e.string().regex(/^0x[0-9a-fA-F]{40}$/),amount:e.string().regex(/^\d+$/)});e.discriminatedUnion(`kind`,[Ao.extend({kind:e.literal(`direct`)}),jo.extend({kind:e.literal(`pull`)})]),e.object({chain:e.string().min(1),token:e.string().regex(/^0x[0-9a-fA-F]{40}$/),amount:e.string().regex(/^\d+$/),recipient:e.string().regex(/^0x[0-9a-fA-F]{40}$/).optional(),recipientUserId:e.string().min(1).optional(),metadata:g.optional()}),e.object({distributionId:e.string().regex(/^0x[0-9a-fA-F]{32}$/).optional(),txHash:e.string().regex(/^(?:0x[0-9a-fA-F]{64}|[1-9A-HJ-NP-Za-km-z]{43,88})$/),blockNumber:e.string().regex(/^\d+$/),potId:e.string().regex(/^0x[0-9a-fA-F]{32}$/),closePot:e.boolean(),legs:e.array(e.object({recipient:e.string().regex(/^(?:0x[0-9a-fA-F]{40}|[1-9A-HJ-NP-Za-km-z]{32,44})$/),amount:e.string().regex(/^\d+$/),settlement:e.enum([`instant`,`locked`])}))}),e.object({chain:e.string().min(1),token:e.string().regex(/^(?:0x[0-9a-fA-F]{40}|[1-9A-HJ-NP-Za-km-z]{32,44})$/),potId:e.string().regex(/^0x[0-9a-fA-F]{32}$/),closePot:e.boolean().optional().default(!0),legs:e.array(e.object({recipient:e.string().regex(/^(?:0x[0-9a-fA-F]{40}|[1-9A-HJ-NP-Za-km-z]{32,44})$/).optional(),recipientUserId:e.string().min(1).optional(),amount:e.string().regex(/^\d+$/),settlement:e.enum([`instant`,`locked`]).optional().default(`locked`)})).min(1).max(50),metadata:g.optional()}),e.object({potId:e.string().regex(/^0x[0-9a-fA-F]{32}$/),txHash:e.string().regex(/^0x[0-9a-fA-F]{64}$/),blockNumber:e.string().regex(/^\d+$/)}),e.object({chain:e.string().min(1),token:e.string().regex(/^0x[0-9a-fA-F]{40}$/),potId:e.string().regex(/^0x[0-9a-fA-F]{32}$/)}),e.object({status:e.enum([`ok`])});const Mo=e.object({id:e.string(),purpose:e.string(),version:e.string(),grantedAt:e.iso.datetime(),withdrawnAt:e.iso.datetime().nullable()}),No=e.object({accountId:e.string(),providerId:e.string(),hasPassword:e.boolean(),scope:e.string().nullable(),createdAt:e.iso.datetime(),updatedAt:e.iso.datetime()}),Po=e.object({id:e.string(),action:e.string(),targetType:e.string(),targetId:e.string(),purpose:e.string(),legalBasis:e.string(),occurredAt:e.iso.datetime(),traceId:e.string().nullable(),attributes:e.record(e.string(),e.unknown())}),Fo=e.object({id:e.string(),threadId:e.string(),contentMode:e.enum([`plaintext`,`e2e-encrypted`]),body:e.string().nullable(),envelope:e.unknown().optional(),note:e.string().nullable(),sentAt:e.iso.datetime(),editedAt:e.iso.datetime().nullable(),deletedAt:e.iso.datetime().nullable()});e.object({user:d,sessions:e.array(ue),consents:e.array(Mo),accounts:e.array(No),auditEvents:e.array(Po),messages:e.array(Fo),exportedAt:e.iso.datetime()}),e.object({name:l.optional(),image:e.string().min(1).max(2048).nullish()});const Io=e.object({purpose:e.string(),version:e.string(),grantedAt:e.iso.datetime(),withdrawnAt:e.iso.datetime().nullable()});e.object({consents:e.array(Io)});const Lo=e.string().regex(/^[a-z][a-z0-9-]{2,63}$/);e.object({purpose:Lo,version:e.string().min(1).max(64),granted:e.boolean()}),e.object({token:e.string().min(1),callbackURL:e.url().optional()}),e.object({response_type:e.enum([`code`]),client_id:m,redirect_uri:f,scope:p,state:fe,code_challenge:pe,code_challenge_method:e.enum([`S256`]),prompt:e.enum([`consent`]).optional()}),e.object({request:me}),e.object({client_id:e.string().min(1),return_uri:e.url()}),e.object({clientId:e.string().min(1)}),e.object({chain:e.string().min(1),token:e.string().regex(/^0x[0-9a-fA-F]{40}$/),amount:e.string().regex(/^\d+$/).optional(),usdCents:e.int().gte(0).nullish()});const Ro=Re;e.void(),e.void(),e.void(),e.object({genre:e.enum(`adventure.battle_royale.board.cards.casino.casual.fighting.idle.mmo.moba.platformer.prediction.puzzle.racing.rhythm.roguelike.rpg.rts.sandbox.shooter.simulation.sports.strategy.survival.tools.tower_defense.visual_novel.other`.split(`.`)).optional(),q:e.string().min(1).max(200).optional(),before:e.iso.datetime().optional(),limit:e.int().gte(1).lte(48).optional().default(24)}),e.object({slug:e.string().regex(/^[a-z0-9-]{3,40}$/)}),e.object({genre:e.enum(`adventure.battle_royale.board.cards.casino.casual.fighting.idle.mmo.moba.platformer.prediction.puzzle.racing.rhythm.roguelike.rpg.rts.sandbox.shooter.simulation.sports.strategy.survival.tools.tower_defense.visual_novel.other`.split(`.`)).optional(),q:e.string().min(1).max(200).optional(),before:e.iso.datetime().optional(),limit:e.int().gte(1).lte(48).optional().default(24)}),e.object({slug:e.string().regex(/^[a-z0-9-]{3,40}$/)}),e.object({slug:e.string().regex(/^[a-z0-9-]{3,40}$/)}),e.object({limit:e.int().gte(1).lte(20).optional().default(10),offset:e.int().gte(0).nullish().default(0)}),e.object({slug:e.string().regex(/^[a-z0-9-]{3,40}$/),updateId:e.uuid()}),e.object({limit:e.int().gte(1).lte(50).optional().default(20),offset:e.int().gte(0).nullish().default(0)}),e.object({slug:e.string().regex(/^[a-z0-9-]{3,40}$/)}),e.object({slug:e.string().regex(/^[a-z0-9-]{3,40}$/)}),e.object({slug:e.string().regex(/^[a-z0-9-]{3,40}$/)}),e.object({slug:e.string().regex(/^[a-z0-9-]{3,40}$/)}),e.object({slug:e.string().regex(/^[a-z0-9-]{3,40}$/)}),e.object({slug:e.string().regex(/^[a-z0-9-]{3,40}$/),updateId:e.uuid()}),e.object({slug:e.string().regex(/^[a-z0-9-]{3,40}$/),updateId:e.uuid()}),e.object({slug:e.string().regex(/^[a-z0-9-]{3,40}$/),commentId:e.uuid()}),e.object({appId:e.string().min(1)}),e.object({limit:e.int().gte(1).lte(20).optional().default(10),offset:e.int().gte(0).nullish().default(0)}),e.object({appId:e.string().min(1)}),e.object({appId:e.string().min(1),updateId:e.uuid()}),e.object({appId:e.string().min(1),updateId:e.uuid()}),e.object({file:e.string()}),e.object({appId:e.string().min(1)}),e.object({slug:e.string().regex(/^[a-z0-9-]{3,40}$/)}),e.object({sort:bt.optional(),limit:e.int().gte(1).lte(50).optional().default(10),offset:e.int().gte(0).nullish().default(0)}),e.object({slug:e.string().regex(/^[a-z0-9-]{3,40}$/)}),e.object({slug:e.string().regex(/^[a-z0-9-]{3,40}$/)}),e.object({slug:e.string().regex(/^[a-z0-9-]{3,40}$/)}),e.object({slug:e.string().regex(/^[a-z0-9-]{3,40}$/)}),e.object({slug:e.string().regex(/^[a-z0-9-]{3,40}$/),reviewId:e.uuid()}),e.object({slug:e.string().regex(/^[a-z0-9-]{3,40}$/),reviewId:e.uuid()}),e.object({slug:e.string().regex(/^[a-z0-9-]{3,40}$/),reviewId:e.uuid()}),e.object({limit:e.int().gte(1).lte(50).optional().default(20),offset:e.int().gte(0).nullish().default(0)}),e.object({slug:e.string().regex(/^[a-z0-9-]{3,40}$/),reviewId:e.uuid()}),e.object({slug:e.string().regex(/^[a-z0-9-]{3,40}$/),commentId:e.uuid()}),e.object({appId:e.uuid()}),e.object({sort:bt.optional(),limit:e.int().gte(1).lte(50).optional().default(10),offset:e.int().gte(0).nullish().default(0)}),e.object({appId:e.uuid(),reviewId:e.uuid()}),e.object({appId:e.uuid(),reviewId:e.uuid()}),e.object({appId:e.uuid()});const zo=Nt;e.object({id:e.uuid()}),e.object({status:R.optional(),limit:e.int().gte(1).lte(50).optional().default(20),offset:e.int().gte(0).nullish().default(0)});const Bo=Pt;e.object({id:e.uuid(),reportId:e.uuid()});const Vo=z;e.object({status:e.enum([`pending`,`completed`,`expired`,`all`]).optional().default(`completed`),limit:e.int().gte(1).lte(100).optional().default(20),before:e.iso.datetime().optional()}),e.object({kind:e.string().optional(),direction:e.enum([`outgoing`,`incoming`]).optional(),sort:e.enum([`newest`,`oldest`,`value_desc`,`value_asc`]).optional().default(`newest`),chain:e.string().min(1).optional(),limit:e.int().gte(1).lte(100).optional().default(20),cursor:e.string().min(1).optional(),before:e.iso.datetime().optional(),includeInactive:e.enum([`true`,`false`]).optional().default(`false`)}),e.object({groupId:e.string().min(1).max(128)}),e.object({chain:e.string().min(1).optional()}),e.object({before:e.iso.datetime().optional()}),e.object({address:e.string().regex(/^0x[0-9a-fA-F]{40}$/)}),e.object({address:e.string().regex(/^0x[0-9a-fA-F]{40}$/)}),e.object({address:e.string().regex(/^0x[0-9a-fA-F]{40}$/)}),e.object({address:e.string().regex(/^0x[0-9a-fA-F]{40}$/)});const Ho=d,Uo=d;e.object({file:e.string()});const Wo=d;e.object({q:e.string().max(200).optional()});const Go=Kn;e.union([or,sr]),e.object({id:e.string().min(1)}),e.object({id:e.string().min(1)}),e.object({id:e.string().min(1)}),e.object({limit:e.int().gt(0).lte(100).optional(),before:e.iso.datetime().optional()}),e.object({id:e.string().min(1)}),e.object({id:e.string().min(1),msgId:e.string().min(1)}),e.object({id:e.string().min(1),msgId:e.string().min(1)}),e.object({id:e.string().min(1),msgId:e.string().min(1),emoji:lr}),e.object({id:e.string().min(1),msgId:e.string().min(1),emoji:lr}),e.object({id:e.string().min(1)}),e.object({file:e.string()}),e.object({id:e.string().min(1)}),e.object({id:e.string().min(1)}),e.object({id:e.string().min(1)}),e.object({id:e.string().min(1)}),e.object({id:e.string().min(1)}),e.object({id:e.string().min(1)}),e.object({id:e.string().min(1)}),e.object({file:e.string()}),e.object({id:e.string().min(1)}),e.object({id:e.string().min(1),userId:e.string().min(1)}),e.object({id:e.string().min(1)}),e.object({id:e.string().min(1),userId:e.string().min(1)}),e.object({regenerate:e.boolean().optional()}),e.object({code:e.string().min(1).max(64)});const Ko=Pr;e.object({days:e.int().gt(0).lte(366).optional().default(30)}),e.object({appId:e.uuid()}),e.object({days:e.int().gt(0).lte(366).optional().default(30)});const qo=Kr;e.object({permitId:e.string().min(1)});const Jo=Jr;e.object({file:e.string()}),e.object({tokenId:e.string()}),e.object({appId:e.string().min(1)});const Yo=Zr;e.object({appId:e.string().min(1)});const Xo=Qr;e.object({appId:e.string().min(1)});const Zo=ni;e.object({appId:e.string().min(1)});const Qo=ti;e.object({appId:e.string().min(1),itemId:e.string().min(1)});const $o=ri;e.object({appId:e.string().min(1),itemId:e.string().min(1)});const es=oi;e.object({file:e.string()}),e.object({appId:e.string().min(1),itemId:e.string().min(1)});const ts=q;e.object({file:e.string()}),e.object({appId:e.string().min(1),itemId:e.string().min(1)});const ns=q;e.object({appId:e.string().min(1),itemId:e.string().min(1)});const rs=si;e.object({appId:e.string().min(1),itemId:e.string().min(1)});const is=si,as=li;e.object({permitId:e.string().min(1)});const os=ui;e.object({permitId:e.string().min(1)});const ss=di;e.object({permitId:e.string().min(1)});const cs=fi,ls=pi,us=mi,ds=gi,fs=gi;e.object({custodyId:e.string().min(1)});const ps=_i;e.object({id:e.string().min(1)}),e.object({id:e.string().min(1)}),e.object({id:e.string().min(1)}),e.object({handle:e.string().min(1)}),e.object({q:e.string().min(1).max(64),limit:e.int().gte(1).lte(50).optional().default(20)}),e.object({id:e.string().min(1)}),e.object({id:e.string().min(1)}),e.object({id:e.string().min(1)}),e.object({id:e.string().min(1)});const ms=Yi,hs=Ji;e.object({id:e.string().min(1)});const gs=J,_s=Xi;e.object({id:e.string().min(1)});const vs=Xi;e.object({id:e.string().min(1)});const ys=Xi;e.object({id:e.string().min(1)});const bs=Y;e.object({file:e.string()}),e.object({id:e.string().min(1)});const xs=Y;e.object({id:e.string().min(1)});const Ss=ia;e.object({id:e.string().min(1)});const Cs=aa;e.object({id:e.string().min(1)}),e.object({range:e.string().optional(),chain:e.string().optional()});const ws=sa;e.object({id:e.string().min(1)}),e.object({range:e.string().optional()});const Ts=la;e.object({id:e.string().min(1)});const Es=ua;e.object({id:e.string().min(1)}),e.object({kind:e.string().optional(),direction:e.enum([`outgoing`,`incoming`]).optional(),sort:e.enum([`newest`,`oldest`,`value_desc`,`value_asc`]).optional().default(`newest`),chain:e.string().min(1).optional(),limit:e.int().gte(1).lte(100).optional().default(20),cursor:e.string().min(1).optional(),before:e.iso.datetime().optional(),includeInactive:e.enum([`true`,`false`]).optional().default(`false`)});const Ds=rn;e.object({id:e.string().min(1)});const Os=fa;e.object({id:e.string().min(1),chain:e.string().min(1)});const ks=pa;e.object({id:e.string().min(1),chain:e.string().min(1)});const As=ma;e.object({id:e.string().min(1),chain:e.string().min(1)}),e.object({token:e.string().regex(/^0x[0-9a-fA-F]{40}$/).optional()});const js=ha;e.object({id:e.string().min(1),chain:e.string().min(1)});const Ms=ga;e.object({id:e.string().min(1),env:e.enum([`development`,`production`])});const Ns=va;e.object({id:e.string().min(1)});const Ps=ya;e.object({id:e.string().min(1)});const Fs=ba;e.object({chain:e.string().optional()});const Is=Sa;e.object({chain:e.string().optional()});const Ls=wa,Rs=Ta;e.object({id:e.string().min(1)});const zs=Da;e.object({id:e.string().min(1)});const Bs=Da;e.object({id:e.string().min(1),userId:e.string().min(1)});const Vs=J,Hs=ka;e.object({appId:e.string().min(1)});const Us=J;e.object({appId:e.string().min(1)});const Ws=J,Gs=Ra,Ks=J,qs=Y;e.object({file:e.string()});const Js=Y,Ys=J,Xs=Y;e.object({file:e.string()});const Zs=Y;e.object({appId:e.string().min(1)});const Qs=X;e.object({appId:e.string().min(1)});const $s=X;e.object({appId:e.string().min(1)}),e.void(),e.object({file:e.string()}),e.object({appId:e.string().min(1)});const ec=e.object({bannerUrl:e.url()});e.object({appId:e.string().min(1)}),e.void(),e.object({file:e.string()}),e.object({appId:e.string().min(1)});const tc=e.object({thumbnailUrl:e.url()});e.object({appId:e.string().min(1)}),e.void(),e.object({file:e.string()}),e.object({appId:e.string().min(1)});const nc=e.object({thumbnailVideoUrl:e.url()});e.object({file:e.string()}),e.object({appId:e.string().min(1)});const rc=Ba;e.object({appId:e.string().min(1)});const ic=X;e.object({appId:e.string().min(1)});const ac=X;e.object({appId:e.string().min(1)});const oc=X;e.object({appId:e.string().min(1)});const sc=X;e.object({appId:e.string().min(1)});const cc=X;e.object({id:e.string().min(1)}),e.object({id:e.string().min(1)}),e.object({search:e.string().optional(),offset:e.int().gte(0).nullish(),limit:e.int().gt(0).lte(100).optional()}),e.object({id:e.string().min(1)}),e.object({action:e.string().optional(),actorId:e.string().optional(),targetType:e.string().optional(),targetId:e.string().optional(),offset:e.int().gte(0).nullish(),limit:e.int().gt(0).lte(100).optional()}),e.object({status:e.enum([`pending`,`approved`,`rejected`,`cancelled`]).optional(),kind:e.enum([`role`,`production`]).optional()}),e.object({id:e.string().min(1)}),e.object({status:e.union([e.enum([`draft`,`pending_review`,`published`,`hidden`]),e.enum([`all`]),e.enum([`pending_changes`]),e.enum([`bip_pending_review`])]).optional()}),e.object({appId:e.string().min(1)}),e.object({appId:e.string().min(1)}),e.object({appId:e.string().min(1)}),e.object({appId:e.string().min(1)}),e.object({appId:e.string().min(1)}),e.object({appId:e.string().min(1)}),e.object({appId:e.string().min(1)}),e.object({status:e.union([R,e.enum([`all`])]).optional(),limit:e.int().gte(1).lte(50).optional().default(20),offset:e.int().gte(0).nullish().default(0)}),e.object({reportId:e.uuid()}),e.object({appId:e.string().min(1)}),e.object({appId:e.string().min(1)}),e.object({appId:e.string().min(1)}),e.object({processorId:e.string().min(1)}),e.object({chain:e.string().min(1).optional()}),e.object({vaultAddress:e.string().min(1)}),e.object({vaultAddress:e.string().min(1)}),e.object({vaultAddress:e.string().min(1)}),e.object({vaultAddress:e.string().min(1)}),e.object({status:e.array(e.enum([`open`,`resolved_refund`,`resolved_dismiss`,`cancelled`,`force_cancelled`])).optional(),chain:e.string().min(1).optional(),cursorFiledAt:e.iso.datetime().optional(),limit:e.int().gte(1).lte(100).optional()}),e.object({appealId:e.string().min(1)}),e.object({appealId:e.string().min(1)}),e.object({file:e.string()}),e.object({appealId:e.string().min(1)}),e.object({appealId:e.string().min(1)}),e.object({appealId:e.string().min(1)}),e.object({appealId:e.string().min(1)}),e.object({file:e.string()}),e.object({appealId:e.string().min(1)}),e.void(),e.void();async function lc(e,t){let n=new FormData,r=t.file instanceof Blob?t.file:new Blob([t.file],{type:t.contentType});n.append(`file`,r,t.filename);let i=await e.fetch(`${dc(e.issuer)}/me/avatar`,{method:`POST`,headers:{authorization:`Bearer ${t.bearer}`},body:n});if(!i.ok){let e=await i.text();throw Error(`tron ${i.status}: ${e}`)}let a=await i.json();return Wo.parse(a)}async function uc(e,t){let n=await a(e,{path:`/me/avatar`,method:`DELETE`,bearer:t.bearer});return Uo.parse(n)}function dc(e){return e.endsWith(`/`)?e.slice(0,-1):e}async function fc(e,t){let n=await a(e,{path:`/me/giphy/search`,bearer:t.bearer,query:{q:t.q}});return Go.parse(n)}async function pc(e,t){let n=await a(e,{path:`/me/oauth/payment-authorizations`,bearer:t.bearer});return Ro.parse(n)}async function mc(e,t){await s(e,{path:`/me/oauth/payment-authorizations/${encodeURIComponent(t.consentId)}`,method:`PATCH`,bearer:t.bearer,body:t.body})}async function hc(e,t){await s(e,{path:`/me/oauth/payment-authorizations/${encodeURIComponent(t.consentId)}`,method:`DELETE`,bearer:t.bearer})}async function gc(e,t){let n=await a(e,{path:`/me/presence/heartbeat`,method:`POST`,bearer:t.bearer});return Ko.parse(n)}async function _c(e,t){let n=await a(e,{path:`/me/profile`,method:`PATCH`,bearer:t.bearer,body:t.body});return Ho.parse(n)}async function vc(e,t){let n=await a(e,{path:`/admin/active-players`,bearer:t.bearer});return Ha.parse(n)}async function yc(e,t){let n=await a(e,{path:`/admin/app-pages`,bearer:t.bearer,query:{status:t.status}});return io.parse(n)}async function bc(e,t){let n=await a(e,{path:`/admin/app-pages/${encodeURIComponent(t.appId)}/changes`,bearer:t.bearer});return oo.parse(n)}async function xc(e,t){let n=await a(e,{path:`/admin/app-pages/${encodeURIComponent(t.appId)}/review-changes`,method:`POST`,bearer:t.bearer,body:t.body});return Z.parse(n)}async function Sc(e,t){let n=await a(e,{path:`/admin/app-pages/${encodeURIComponent(t.appId)}/hide`,method:`POST`,bearer:t.bearer,body:t.body});return Z.parse(n)}async function Cc(e,t){let n=await a(e,{path:`/admin/app-pages/${encodeURIComponent(t.appId)}/unhide`,method:`POST`,bearer:t.bearer});return Z.parse(n)}async function wc(e,t){let n=await a(e,{path:`/admin/app-pages/${encodeURIComponent(t.appId)}/review`,method:`POST`,bearer:t.bearer,body:t.body});return Z.parse(n)}async function Tc(e,t){let n=await a(e,{path:`/admin/app-pages/${encodeURIComponent(t.appId)}/review-bip`,method:`POST`,bearer:t.bearer,body:t.body});return so.parse(n)}async function Ec(e,t){let n=await a(e,{path:`/admin/app-pages/${encodeURIComponent(t.appId)}/hide-bip`,method:`POST`,bearer:t.bearer,body:t.body});return so.parse(n)}async function Dc(e,t){let n=await a(e,{path:`/admin/app-pages/${encodeURIComponent(t.appId)}/unhide-bip`,method:`POST`,bearer:t.bearer});return so.parse(n)}async function Oc(e,t){let n=await a(e,{path:`/admin/payments/appeals`,bearer:t.bearer,query:{status:t.statuses===void 0?void 0:[...t.statuses],chain:t.chain,cursorFiledAt:t.cursorFiledAt,limit:t.limit}});return yo.parse(n)}async function kc(e,t){let n=await a(e,{path:`/admin/payments/appeals/${encodeURIComponent(t.appealId)}/room`,bearer:t.bearer});return To.parse(n)}async function Ac(e,t){let n=await a(e,{path:`/admin/payments/appeals/${encodeURIComponent(t.appealId)}/room/messages`,method:`POST`,bearer:t.bearer,body:t.body});return Eo.parse(n)}async function jc(e,t){let n=new FormData,r=t.file instanceof Blob?t.file:new Blob([t.file],{type:t.contentType});n.append(`file`,r,t.filename);let i=await e.fetch(`${Nc(e.issuer)}/admin/payments/appeals/${encodeURIComponent(t.appealId)}/room/attachments`,{method:`POST`,headers:{authorization:`Bearer ${t.bearer}`},body:n});if(!i.ok){let e=await i.text();throw Error(`tron ${i.status}: ${e}`)}let a=await i.json();return W.parse(a)}async function Mc(e,t){let n=await a(e,{path:`/admin/payments/appeals/${encodeURIComponent(t.appealId)}/resolve`,method:`POST`,bearer:t.bearer,body:t.body});return Do.parse(n)}function Nc(e){return e.endsWith(`/`)?e.slice(0,-1):e}async function Pc(e,t){let n=await a(e,{path:`/admin/content-reports`,bearer:t.bearer,query:{status:t.status,limit:t.limit,offset:t.offset}});return lo.parse(n)}async function Fc(e,t){let n=await a(e,{path:`/admin/content-reports/${encodeURIComponent(t.reportId)}`,method:`PATCH`,bearer:t.bearer,body:{status:t.status}});return z.parse(n)}async function Ic(e,t){let n=await a(e,{path:`/admin/developer-requests`,bearer:t.bearer,query:{status:t.status,kind:t.kind}});return Qa.parse(n)}async function Lc(e,t){let n=await a(e,{path:`/admin/developer-requests/${encodeURIComponent(t.id)}`,method:`PATCH`,bearer:t.bearer,body:t.body});return $a.parse(n)}async function Rc(e,t){let n=await a(e,{path:`/admin/developers`,bearer:t.bearer});return no.parse(n)}async function zc(e,t){let n=await a(e,{path:`/admin/inventory/vault-custody/${encodeURIComponent(t.custodyId)}/force-withdraw`,method:`POST`,bearer:t.bearer});return ps.parse(n)}async function Bc(e,t){let n=await a(e,{path:`/admin/platform-fees`,bearer:t.bearer});return uo.parse(n)}async function Vc(e,t){let n=await a(e,{path:`/admin/platform-fees`,method:`PATCH`,bearer:t.bearer,body:t.body});return po.parse(n)}async function Hc(e,t){let n=await a(e,{path:`/admin/apps/${encodeURIComponent(t.appId)}/fee-config`,bearer:t.bearer});return mo.parse(n)}async function Uc(e,t){let n=await a(e,{path:`/admin/apps/${encodeURIComponent(t.appId)}/fee-config`,method:`PATCH`,bearer:t.bearer,body:t.body});return mo.parse(n)}async function Wc(e,t){let n=await a(e,{path:`/admin/payments/processors/whitelist`,method:`POST`,bearer:t.bearer,body:t.body});return Q.parse(n)}async function Gc(e,t){let n=await a(e,{path:`/admin/payments/processors/${encodeURIComponent(t.processorId)}/treasury`,method:`POST`,bearer:t.bearer,body:t.body});return Q.parse(n)}async function Kc(e,t){let n=await a(e,{path:`/admin/payments/vaults/${encodeURIComponent(t.vaultAddress)}/operator`,method:`POST`,bearer:t.bearer,body:t.body});return Q.parse(n)}async function qc(e,t){let n=await a(e,{path:`/admin/payments/vaults/${encodeURIComponent(t.vaultAddress)}/pause`,method:`POST`,bearer:t.bearer,body:t.body});return Q.parse(n)}async function Jc(e,t){let n=await a(e,{path:`/admin/payments/vaults/${encodeURIComponent(t.vaultAddress)}/withdraw-lock-default`,method:`POST`,bearer:t.bearer,body:t.body});return Q.parse(n)}async function Yc(e,t){let n=await a(e,{path:`/admin/payments/vaults/${encodeURIComponent(t.vaultAddress)}/withdraw-lock-override`,method:`POST`,bearer:t.bearer,body:t.body});return Q.parse(n)}async function Xc(e,t){let n=await a(e,{path:`/admin/payments/appeal-blacklist`,method:`POST`,bearer:t.bearer,body:t.body});return ho.parse(n)}async function Zc(e,t){let n=await a(e,{path:`/admin/payments/appeal-blacklist`,method:`DELETE`,bearer:t.bearer,body:t.body});return go.parse(n)}async function Qc(e,t){let n=await a(e,{path:`/admin/payments/appeal-blacklist`,bearer:t.bearer,query:{chain:t.chain}});return _o.parse(n)}async function $c(e,t){let n=await a(e,{path:`/admin/tron/cashouts${t.status===void 0?``:`?status=${encodeURIComponent(t.status)}`}`,bearer:t.bearer});return jn.parse(n)}async function el(e,t){let n=await a(e,{path:`/admin/tron/cashouts/${encodeURIComponent(t.id)}/approve`,method:`POST`,bearer:t.bearer});return An.parse(n)}async function tl(e,t){let n=await a(e,{path:`/admin/tron/cashouts/${encodeURIComponent(t.id)}/reject`,method:`POST`,bearer:t.bearer,body:t.body});return An.parse(n)}async function nl(e,t){let n=await a(e,{path:`/admin/admins`,bearer:t.bearer});return Wa.parse(n)}async function rl(e,t){let n=await a(e,{path:`/admin/admins`,method:`POST`,bearer:t.bearer,body:t.body});return Ga.parse(n)}async function il(e,t){let n=await a(e,{path:`/admin/admins/${encodeURIComponent(t.id)}`,method:`PATCH`,bearer:t.bearer,body:t.body});return Ka.parse(n)}async function al(e,t){let n=await a(e,{path:`/admin/admins/${encodeURIComponent(t.id)}`,method:`DELETE`,bearer:t.bearer});return Ga.parse(n)}async function ol(e,t){let n=await a(e,{path:`/admin/users`,bearer:t.bearer,query:{search:t.search,offset:t.offset,limit:t.limit}});return Ja.parse(n)}async function sl(e,t){let n=await a(e,{path:`/admin/users/${encodeURIComponent(t.id)}`,method:`PATCH`,bearer:t.bearer,body:t.body});return Ya.parse(n)}async function cl(e,t){let n=await a(e,{path:`/admin/audit`,bearer:t.bearer,query:{action:t.action,actorId:t.actorId,targetType:t.targetType,targetId:t.targetId,offset:t.offset,limit:t.limit}});return Za.parse(n)}async function ll(e,t){let n=await a(e,{path:`/public/apps/${encodeURIComponent(t.slug)}`,bearer:t.bearer});return Ye.parse(n)}async function ul(e,t){let n=await a(e,{path:`/me/developer`,bearer:t.bearer});return Gs.parse(n)}async function dl(e,t){let n=await a(e,{path:`/me/developer/profile`,method:`PATCH`,bearer:t.bearer,body:t.body});return Ks.parse(n)}async function fl(e,t){let n=await $(e,{path:`/me/developer/profile/logo`,bearer:t.bearer,file:t.file,filename:t.filename,contentType:t.contentType});return Js.parse(n)}async function pl(e,t){let n=await a(e,{path:`/me/developer/profile/logo`,method:`DELETE`,bearer:t.bearer});return qs.parse(n)}async function ml(e,t){let n=await a(e,{path:`/me/developer/request`,method:`POST`,bearer:t.bearer,body:t.body});return Ys.parse(n)}async function hl(e,t){let n=await $(e,{path:`/me/developer/request/logo`,bearer:t.bearer,file:t.file,filename:t.filename,contentType:t.contentType});return Zs.parse(n)}async function gl(e,t){let n=await a(e,{path:`/me/developer/request/logo`,method:`DELETE`,bearer:t.bearer});return Xs.parse(n)}async function $(e,t){let n=new FormData,r=t.file instanceof Blob?t.file:new Blob([t.file],{type:t.contentType});n.append(`file`,r,t.filename);let i=await e.fetch(`${_l(e.issuer)}${t.path}`,{method:`POST`,headers:{authorization:`Bearer ${t.bearer}`},body:n});if(!i.ok){let e=await i.text();throw Error(`tron ${i.status}: ${e}`)}return await i.json()}function _l(e){return e.endsWith(`/`)?e.slice(0,-1):e}async function vl(e,t){let n=await a(e,{path:`/public/build-in-public/${encodeURIComponent(t.slug)}/updates`,bearer:t.bearer,query:{limit:t.limit,offset:t.offset}});return $e.parse(n)}async function yl(e,t){let n=await a(e,{path:`/public/build-in-public/${encodeURIComponent(t.slug)}/updates/${encodeURIComponent(t.updateId)}/comments`,bearer:t.bearer,query:{limit:t.limit,offset:t.offset}});return nt.parse(n)}async function bl(e,t){let n=await a(e,{path:`/me/build-in-public/${encodeURIComponent(t.slug)}/reactions`,bearer:t.bearer});return at.parse(n)}async function xl(e,t){let n=await a(e,{path:`/me/build-in-public/${encodeURIComponent(t.slug)}/reactions/${encodeURIComponent(t.updateId)}`,method:`POST`,bearer:t.bearer,body:t.body});return st.parse(n)}async function Sl(e,t){let n=await a(e,{path:`/me/build-in-public/${encodeURIComponent(t.slug)}/comments/${encodeURIComponent(t.updateId)}`,method:`POST`,bearer:t.bearer,body:{body:t.body}});return ct.parse(n)}async function Cl(e,t){let n=await a(e,{path:`/me/build-in-public/${encodeURIComponent(t.slug)}/comments/${encodeURIComponent(t.commentId)}`,method:`DELETE`,bearer:t.bearer});return lt.parse(n)}async function wl(e,t){let n=await a(e,{path:`/me/developer/apps/${encodeURIComponent(t.appId)}/bip-updates`,bearer:t.bearer,query:{limit:t.limit,offset:t.offset}});return $e.parse(n)}async function Tl(e,t){let n=await a(e,{path:`/me/developer/apps/${encodeURIComponent(t.appId)}/bip-updates`,method:`POST`,bearer:t.bearer,body:t.body});return A.parse(n)}async function El(e,t){let n=await a(e,{path:`/me/developer/apps/${encodeURIComponent(t.appId)}/bip-updates/${encodeURIComponent(t.updateId)}`,method:`PATCH`,bearer:t.bearer,body:t.body});return A.parse(n)}async function Dl(e,t){let n=await a(e,{path:`/me/developer/apps/${encodeURIComponent(t.appId)}/bip-updates/${encodeURIComponent(t.updateId)}`,method:`DELETE`,bearer:t.bearer});return ut.parse(n)}async function Ol(e,t){let n=await $(e,{path:`/me/developer/apps/${encodeURIComponent(t.appId)}/bip-updates/media`,bearer:t.bearer,file:t.file,filename:t.filename,contentType:t.contentType});return dt.parse(n)}async function kl(e,t){let n=await a(e,{path:`/public/build-in-public/${encodeURIComponent(t.slug)}/interest`,bearer:t.bearer});return rt.parse(n)}async function Al(e,t){let n=await a(e,{path:`/me/build-in-public/${encodeURIComponent(t.slug)}/engagement`,bearer:t.bearer});return M.parse(n)}async function jl(e,t){let n=await a(e,{path:`/me/build-in-public/${encodeURIComponent(t.slug)}/interest`,method:`POST`,bearer:t.bearer,body:{interested:t.interested}});return M.parse(n)}async function Ml(e,t){let n=await a(e,{path:`/me/build-in-public/${encodeURIComponent(t.slug)}/subscription`,method:`POST`,bearer:t.bearer,body:{subscribed:t.subscribed}});return M.parse(n)}async function Nl(e,t){let n=await a(e,{path:`/public/build-in-public`,bearer:t.bearer,query:{genre:t.genre,q:t.q,before:t.before,limit:t.limit}});return Ue.parse(n)}async function Pl(e,t){let n=await a(e,{path:`/public/build-in-public/${encodeURIComponent(t.slug)}`,bearer:t.bearer});return Xe.parse(n)}async function Fl(e,t){let n=await a(e,{path:`/me/apps/${encodeURIComponent(t.appId)}/report`,method:`POST`,bearer:t.bearer,body:t.report});return zo.parse(n)}async function Il(e,t){let n=await a(e,{path:`/public/library`,bearer:t.bearer,query:{genre:t.genre,q:t.q,before:t.before,limit:t.limit}});return Ue.parse(n)}async function Ll(e,t){let n=await a(e,{path:`/public/apps/${encodeURIComponent(t.slug)}/reviews`,bearer:t.bearer,query:{sort:t.sort,limit:t.limit,offset:t.offset}});return yt.parse(n)}async function Rl(e,t){let n=await a(e,{path:`/me/developer/apps/${encodeURIComponent(t.appId)}/reviews`,bearer:t.bearer,query:{sort:t.sort,limit:t.limit,offset:t.offset}});return yt.parse(n)}async function zl(e,t){let n=await a(e,{path:`/me/reviews/${encodeURIComponent(t.slug)}`,bearer:t.bearer});return F.parse(n)}async function Bl(e,t){let n=await a(e,{path:`/me/reviews/${encodeURIComponent(t.slug)}`,method:`PUT`,bearer:t.bearer,body:t.review});return F.parse(n)}async function Vl(e,t){let n=await a(e,{path:`/me/reviews/${encodeURIComponent(t.slug)}`,method:`DELETE`,bearer:t.bearer});return F.parse(n)}async function Hl(e,t){let n=await a(e,{path:`/me/reviews/${encodeURIComponent(t.slug)}/reactions`,bearer:t.bearer});return wt.parse(n)}async function Ul(e,t){let n=await a(e,{path:`/me/reviews/${encodeURIComponent(t.slug)}/reactions/${encodeURIComponent(t.reviewId)}`,method:`POST`,bearer:t.bearer,body:t.reaction});return Tt.parse(n)}async function Wl(e,t){let n=await a(e,{path:`/me/reviews/${encodeURIComponent(t.slug)}/tips/${encodeURIComponent(t.reviewId)}`,method:`POST`,bearer:t.bearer,idempotencyKey:t.idempotencyKey??crypto.randomUUID(),body:t.tip});return Et.parse(n)}async function Gl(e,t){let n=await a(e,{path:`/public/apps/${encodeURIComponent(t.slug)}/reviews/${encodeURIComponent(t.reviewId)}/comments`,bearer:t.bearer,query:{limit:t.limit,offset:t.offset}});return kt.parse(n)}async function Kl(e,t){let n=await a(e,{path:`/me/reviews/${encodeURIComponent(t.slug)}/comments/${encodeURIComponent(t.reviewId)}`,method:`POST`,bearer:t.bearer,body:t.comment});return At.parse(n)}async function ql(e,t){let n=await a(e,{path:`/me/reviews/${encodeURIComponent(t.slug)}/comments/${encodeURIComponent(t.commentId)}`,method:`DELETE`,bearer:t.bearer});return jt.parse(n)}async function Jl(e,t){let n=await a(e,{path:`/me/developer/apps/${encodeURIComponent(t.appId)}/reviews/${encodeURIComponent(t.reviewId)}/reply`,method:`PUT`,bearer:t.bearer,body:t.reply});return Mt.parse(n)}async function Yl(e,t){let n=await a(e,{path:`/me/developer/apps/${encodeURIComponent(t.appId)}/reviews/${encodeURIComponent(t.reviewId)}/reply`,method:`DELETE`,bearer:t.bearer});return Mt.parse(n)}function Xl(){let e=new Map;return{run:async(t,n)=>{let r=e.get(t);if(r!==void 0)return await r;let i=(async()=>{try{return await n()}finally{e.delete(t)}})();return e.set(t,i),await i}}}function Zl(){return{debug:()=>{},info:()=>{},warn:()=>{},error:()=>{}}}function Ql(e=`[tron-sdk]`){return{debug:(t,n)=>{console.log(e,t,n??``)},info:(t,n)=>{console.info(e,t,n??``)},warn:(t,n)=>{console.warn(e,t,n??``)},error:(t,n)=>{console.error(e,t,n??``)}}}const $l=6e4,eu=60,tu=5,nu={acquire:async()=>{await Promise.resolve()}};function ru(e,t){let n=Math.max(1,t),r=e/1e3,i=n,a=Date.now(),o=[],s=null;function c(){let e=Date.now();for(i=Math.min(n,i+(e-a)*r),a=e;o.length>0&&i>=1;)--i,o.shift()?.();if(o.length>0&&s===null){let e=Math.max(5,Math.ceil((1-i)/r));s=setTimeout(()=>{s=null,c()},e)}}return{acquire:async()=>{await new Promise(e=>{o.push(e),c()})}}}const iu=e=>e===`GET`||e===`HEAD`,au=e=>e/$l*1e3;function ou(e={}){let t=ru(e.read?.requestsPerSecond??au(60),e.read?.burst??60),n=ru(e.write?.requestsPerSecond??au(5),e.write?.burst??5);return{acquire:async e=>{await(iu(e)?t:n).acquire()}}}function su(){let e=new Map;return{async get(t){return e.get(t)??null},async set(t,n){e.set(t,n)},async clear(t){e.delete(t)}}}async function cu(e,t){let n=await a(e,{path:`/payments/me/activity`,bearer:t.bearer,query:{kind:t.kind,direction:t.direction,sort:t.sort,chain:t.chain,limit:t.limit,cursor:t.cursor,before:t.before,includeInactive:t.includeInactive===!0?`true`:void 0}});return rn.parse(n)}async function lu(e,t){let n=await a(e,{path:`/payments/me/activity/group/${encodeURIComponent(t.groupId)}`,bearer:t.bearer});return rn.parse(n)}async function uu(e,t){let n=await a(e,{path:`/payments/chains`,bearer:t.bearer});return It.parse(n)}async function du(e,t){let n=await a(e,{path:`/payments/me/outstanding`,bearer:t.bearer,query:{chain:t.chain}});return on.parse(n)}async function fu(e,t){let n=await a(e,{path:`/payments/me`,bearer:t.bearer,query:{status:t.status,limit:t.limit,before:t.before}});return Rt.parse(n)}async function pu(e){let t=await a(e,{path:`/payments/rates`});return Oo.parse(t)}async function mu(e,t){let n=await a(e,{path:`/me/developer/keys`,method:`POST`,bearer:t.bearer,body:t.body});return hs.parse(n)}async function hu(e,t){let n=await a(e,{path:`/me/developer/keys`,method:`GET`,bearer:t.bearer});return ms.parse(n)}async function gu(e,t){let n=await a(e,{path:`/me/developer/keys/${encodeURIComponent(t.id)}`,method:`DELETE`,bearer:t.bearer});return gs.parse(n)}async function _u(e,t){let n=await a(e,{path:`/me/developer/apps`,method:`POST`,bearer:t.bearer,body:t.body});return _s.parse(n)}async function vu(e,t){let n=await a(e,{path:`/me/developer/apps/${encodeURIComponent(t.id)}`,method:`PATCH`,bearer:t.bearer,body:t.body});return ys.parse(n)}async function yu(e,t){let n=await a(e,{path:`/me/developer/apps/${encodeURIComponent(t.id)}`,method:`DELETE`,bearer:t.bearer});return vs.parse(n)}async function bu(e,t){let n=await $(e,{path:`/me/developer/apps/${encodeURIComponent(t.id)}/logo`,bearer:t.bearer,file:t.file,filename:t.filename,contentType:t.contentType});return xs.parse(n)}async function xu(e,t){let n=await a(e,{path:`/me/developer/apps/${encodeURIComponent(t.id)}/logo`,method:`DELETE`,bearer:t.bearer});return bs.parse(n)}async function Su(e,t){let n=await a(e,{path:`/me/developer/apps/${encodeURIComponent(t.id)}/balances`,bearer:t.bearer});return Ss.parse(n)}async function Cu(e,t){let n=await a(e,{path:`/me/developer/apps/${encodeURIComponent(t.id)}/tron-balance`,bearer:t.bearer});return Cs.parse(n)}async function wu(e,t){let n=await a(e,{path:`/me/developer/apps/${encodeURIComponent(t.id)}/activity`,bearer:t.bearer,query:{kind:t.kind,direction:t.direction,sort:t.sort,chain:t.chain,limit:t.limit,cursor:t.cursor,before:t.before}});return Ds.parse(n)}async function Tu(e,t){let n=await a(e,{path:`/me/developer/apps/${encodeURIComponent(t.id)}/earnings`,bearer:t.bearer,query:{range:t.range,chain:t.chain}});return ws.parse(n)}async function Eu(e,t){let n=await a(e,{path:`/me/developer/apps/${encodeURIComponent(t.id)}/playtime`,bearer:t.bearer,query:{range:t.range}});return Ts.parse(n)}async function Du(e,t){let n=await a(e,{path:`/me/developer/apps/${encodeURIComponent(t.id)}/overview`,bearer:t.bearer});return Es.parse(n)}async function Ou(e,t){let n=await a(e,{path:`/me/developer/apps/${encodeURIComponent(t.id)}/wallets`,bearer:t.bearer});return Os.parse(n)}async function ku(e,t){let n=await a(e,{path:`/me/developer/apps/${encodeURIComponent(t.id)}/wallets/${encodeURIComponent(t.chain)}/auto-sweep`,method:`PATCH`,bearer:t.bearer,body:t.body});return ks.parse(n)}async function Au(e,t){let n=await a(e,{path:`/me/developer/apps/${encodeURIComponent(t.id)}/wallets/${encodeURIComponent(t.chain)}/provision`,method:`POST`,bearer:t.bearer});return As.parse(n)}async function ju(e,t){let n=await a(e,{path:`/me/developer/apps/${encodeURIComponent(t.id)}/wallets/${encodeURIComponent(t.chain)}/withdraw`,method:`POST`,bearer:t.bearer,query:{token:t.token}});return js.parse(n)}async function Mu(e,t){let n=await a(e,{path:`/me/developer/apps/${encodeURIComponent(t.id)}/wallets/${encodeURIComponent(t.chain)}/consolidate`,method:`POST`,bearer:t.bearer});return Ms.parse(n)}async function Nu(e,t){let n=await a(e,{path:`/me/developer/apps/${encodeURIComponent(t.id)}/keys/${encodeURIComponent(t.env)}`,method:`PUT`,bearer:t.bearer});return Ns.parse(n)}async function Pu(e,t){let n=await a(e,{path:`/me/developer/apps/${encodeURIComponent(t.id)}/production-request`,method:`POST`,bearer:t.bearer,body:t.body});return Ps.parse(n)}async function Fu(e,t){let n=await a(e,{path:`/me/developer/apps/${encodeURIComponent(t.id)}/payment-status-webhook/secret`,method:`POST`,bearer:t.bearer});return Fs.parse(n)}async function Iu(e,t){let n=await a(e,{path:`/me/developer/payments/appeals`,bearer:t.bearer,query:{chain:t.chain}});return Is.parse(n)}async function Lu(e,t){let n=await a(e,{path:`/me/developer/payments/pending-deposits`,bearer:t.bearer,query:{chain:t.chain}});return Ls.parse(n)}async function Ru(e,t){let n=await a(e,{path:`/me/developer/payments/tron-balance`,bearer:t.bearer});return Rs.parse(n)}async function zu(e,t){let n=await a(e,{path:`/me/developer/apps/${encodeURIComponent(t.id)}/reports`,bearer:t.bearer,query:{status:t.status,limit:t.limit,offset:t.offset}});return Bo.parse(n)}async function Bu(e,t){let n=await a(e,{path:`/me/developer/apps/${encodeURIComponent(t.id)}/reports/${encodeURIComponent(t.reportId)}`,method:`PATCH`,bearer:t.bearer,body:{status:t.status}});return Vo.parse(n)}async function Vu(e,t){let n=await a(e,{path:`/me/developer/apps/${encodeURIComponent(t.appId)}/inventory/items/quote`,method:`POST`,bearer:t.bearer,body:t.registration});return Xo.parse(n)}async function Hu(e,t){let n=await a(e,{path:`/me/developer/apps/${encodeURIComponent(t.appId)}/inventory/items`,method:`POST`,bearer:t.bearer,body:t.registration});return Qo.parse(n)}async function Uu(e,t){let n=await a(e,{path:`/me/developer/apps/${encodeURIComponent(t.appId)}/inventory/collections`,bearer:t.bearer});return Yo.parse(n)}async function Wu(e,t){let n=await a(e,{path:`/me/developer/apps/${encodeURIComponent(t.appId)}/inventory/items`,bearer:t.bearer});return Zo.parse(n)}async function Gu(e,t){let n=await a(e,{path:`/me/developer/apps/${encodeURIComponent(t.appId)}/inventory/items/${encodeURIComponent(t.itemId)}/permits`,method:`POST`,bearer:t.bearer,body:t.grant});return $o.parse(n)}async function Ku(e,t){let n=await a(e,{path:`/me/developer/apps/${encodeURIComponent(t.appId)}/inventory/items/${encodeURIComponent(t.itemId)}/holders`,bearer:t.bearer});return es.parse(n)}async function qu(e,t){let n=await $(e,{path:`/me/developer/apps/${encodeURIComponent(t.appId)}/inventory/items/${encodeURIComponent(t.itemId)}/image`,bearer:t.bearer,file:t.file,filename:t.filename,contentType:t.contentType});return ts.parse(n)}async function Ju(e,t){let n=await $(e,{path:`/me/developer/apps/${encodeURIComponent(t.appId)}/inventory/items/${encodeURIComponent(t.itemId)}/banner`,bearer:t.bearer,file:t.file,filename:t.filename,contentType:t.contentType});return ns.parse(n)}async function Yu(e,t){let n=await a(e,{path:`/me/developer/apps/${encodeURIComponent(t.appId)}/page`,bearer:t.bearer});return Qs.parse(n)}async function Xu(e,t){let n=await a(e,{path:`/me/developer/apps/${encodeURIComponent(t.appId)}/page`,method:`PATCH`,bearer:t.bearer,body:t.body});return $s.parse(n)}async function Zu(e,t){let n=await $(e,{path:`/me/developer/apps/${encodeURIComponent(t.appId)}/page/banner`,bearer:t.bearer,file:t.file,filename:t.filename,contentType:t.contentType});return ec.parse(n)}async function Qu(e,t){await s(e,{path:`/me/developer/apps/${encodeURIComponent(t.appId)}/page/banner`,method:`DELETE`,bearer:t.bearer})}async function $u(e,t){let n=await $(e,{path:`/me/developer/apps/${encodeURIComponent(t.appId)}/page/thumbnail`,bearer:t.bearer,file:t.file,filename:t.filename,contentType:t.contentType});return tc.parse(n)}async function ed(e,t){await s(e,{path:`/me/developer/apps/${encodeURIComponent(t.appId)}/page/thumbnail`,method:`DELETE`,bearer:t.bearer})}async function td(e,t){let n=await $(e,{path:`/me/developer/apps/${encodeURIComponent(t.appId)}/page/thumbnail-video`,bearer:t.bearer,file:t.file,filename:t.filename,contentType:t.contentType});return nc.parse(n)}async function nd(e,t){await s(e,{path:`/me/developer/apps/${encodeURIComponent(t.appId)}/page/thumbnail-video`,method:`DELETE`,bearer:t.bearer})}async function rd(e,t){let n=await $(e,{path:`/me/developer/apps/${encodeURIComponent(t.appId)}/page/gallery`,bearer:t.bearer,file:t.file,filename:t.filename,contentType:t.contentType});return rc.parse(n)}async function id(e,t){let n=await a(e,{path:`/me/developer/apps/${encodeURIComponent(t.appId)}/page/submit-for-review`,method:`POST`,bearer:t.bearer});return ic.parse(n)}async function ad(e,t){let n=await a(e,{path:`/me/developer/apps/${encodeURIComponent(t.appId)}/page/unpublish`,method:`POST`,bearer:t.bearer});return ac.parse(n)}async function od(e,t){let n=await a(e,{path:`/me/developer/apps/${encodeURIComponent(t.appId)}/page/bip`,method:`PATCH`,bearer:t.bearer,body:t.body});return oc.parse(n)}async function sd(e,t){let n=await a(e,{path:`/me/developer/apps/${encodeURIComponent(t.appId)}/page/bip/submit-for-review`,method:`POST`,bearer:t.bearer});return sc.parse(n)}async function cd(e,t){let n=await a(e,{path:`/me/developer/apps/${encodeURIComponent(t.appId)}/page/bip/unpublish`,method:`POST`,bearer:t.bearer});return cc.parse(n)}async function ld(e,t){let n=await a(e,{path:`/me/developer/apps/${encodeURIComponent(t.id)}/participants`,method:`GET`,bearer:t.bearer});return zs.parse(n)}async function ud(e,t){let n=await a(e,{path:`/me/developer/apps/${encodeURIComponent(t.id)}/participants`,method:`POST`,bearer:t.bearer,body:t.body});return Bs.parse(n)}async function dd(e,t){let n=await a(e,{path:`/me/developer/apps/${encodeURIComponent(t.id)}/participants/${encodeURIComponent(t.userId)}`,method:`DELETE`,bearer:t.bearer});return Vs.parse(n)}async function fd(e,t){let n=await a(e,{path:`/me/developer/invites`,method:`GET`,bearer:t.bearer});return Hs.parse(n)}async function pd(e,t){let n=await a(e,{path:`/me/developer/invites/${encodeURIComponent(t.appId)}/accept`,method:`POST`,bearer:t.bearer});return Us.parse(n)}async function md(e,t){let n=await a(e,{path:`/me/developer/invites/${encodeURIComponent(t.appId)}/decline`,method:`POST`,bearer:t.bearer});return Ws.parse(n)}async function hd(e,t){let n=await a(e,{path:`/me/developer/apps/${encodeURIComponent(t.appId)}/inventory/items/${encodeURIComponent(t.itemId)}/vault-permits`,method:`POST`,bearer:t.bearer,body:t.grant});return rs.parse(n)}async function gd(e,t){let n=await a(e,{path:`/me/developer/apps/${encodeURIComponent(t.appId)}/inventory/items/${encodeURIComponent(t.itemId)}/withdraw-permits`,method:`POST`,bearer:t.bearer,body:t.grant});return is.parse(n)}async function _d(e,t){let n=await a(e,{path:`/me/inventory`,bearer:t.bearer});return Wr.parse(n)}async function vd(e,t){let n=await a(e,{path:`/oauth/inventory`,bearer:t.bearer});return Wr.parse(n)}async function yd(e,t){let n=await a(e,{path:`/me/inventory/nft-transfers/quote`,method:`POST`,bearer:t.bearer,body:t.body});return ls.parse(n)}async function bd(e,t){let n=await a(e,{path:`/me/inventory/nft-transfers`,method:`POST`,bearer:t.bearer,body:t.body});return us.parse(n)}async function xd(e,t){let n=await a(e,{path:`/me/inventory/permits`,bearer:t.bearer});return qo.parse(n)}async function Sd(e,t){let n=await a(e,{path:`/me/inventory/permits/${encodeURIComponent(t.permitId)}/redeem`,method:`POST`,bearer:t.bearer});return Jo.parse(n)}async function Cd(e,t){let n=await a(e,{path:`/oauth/inventory/mint`,method:`POST`,bearer:t.appBearer,body:t.body});return qr.parse(n)}async function wd(e,t){let n=await a(e,{path:`/me/inventory/vault-permits`,bearer:t.bearer});return as.parse(n)}async function Td(e,t){let n=await a(e,{path:`/me/inventory/vault-permits/${encodeURIComponent(t.permitId)}/sign`,method:`POST`,bearer:t.bearer});return os.parse(n)}async function Ed(e,t){let n=await a(e,{path:`/me/inventory/vault-permits/${encodeURIComponent(t.permitId)}/relayed/quote`,method:`POST`,bearer:t.bearer});return ss.parse(n)}async function Dd(e,t){let n=await a(e,{path:`/me/inventory/vault-permits/${encodeURIComponent(t.permitId)}/relayed/submit`,method:`POST`,bearer:t.bearer,body:t.body});return cs.parse(n)}async function Od(e,t){let n=await a(e,{path:`/me/inventory/vaulted`,bearer:t.bearer});return ds.parse(n)}async function kd(e,t){let n=await a(e,{path:`/oauth/inventory/vaulted`,bearer:t.bearer});return fs.parse(n)}async function Ad(e,t){let n=await a(e,{path:`/me/dm-key-backup`,bearer:t.bearer});return Tr.parse(n)}async function jd(e,t){let n=await a(e,{path:`/me/dm-key-backup`,method:`POST`,bearer:t.bearer,body:t.body});return Er.parse(n)}async function Md(e,t){let n=await a(e,{path:`/me/dm-key-backup/unlock`,method:`POST`,bearer:t.bearer,body:t.body});return Dr.parse(n)}async function Nd(e,t){let n=await a(e,{path:`/me/dm-key`,method:`PUT`,bearer:t.bearer,body:t.body});return Sr.parse(n)}async function Pd(e,n){try{let t=await a(e,{path:`/me/dm-key`,bearer:n.bearer});return Sr.parse(t)}catch(e){if(e instanceof t&&e.status===404)return null;throw e}}async function Fd(e,t){let n=await a(e,{path:`/me/threads/${encodeURIComponent(t.threadId)}/dm-key`,bearer:t.bearer});return Sr.parse(n)}async function Id(e,t){let n=await a(e,{path:`/me/threads/dm-keys`,method:`POST`,bearer:t.bearer,body:{threadIds:[...t.threadIds]}});return wr.parse(n)}async function Ld(e,t){let n=new FormData,r=t.file instanceof Blob?t.file:new Blob([t.file],{type:t.contentType});n.append(`file`,r,t.filename);let i=await e.fetch(`${zd(e.issuer)}/me/threads/${encodeURIComponent(t.threadId)}/logo`,{method:`POST`,headers:{authorization:`Bearer ${t.bearer}`},body:n});if(!i.ok){let e=await i.text();throw Error(`tron ${i.status}: ${e}`)}let a=await i.json();return U.parse(a)}async function Rd(e,t){let n=await a(e,{path:`/me/threads/${encodeURIComponent(t.threadId)}/logo`,method:`DELETE`,bearer:t.bearer});return U.parse(n)}function zd(e){return e.endsWith(`/`)?e.slice(0,-1):e}async function Bd(e,t){let n=await a(e,{path:`/me/threads/${encodeURIComponent(t.threadId)}/messages/${encodeURIComponent(t.messageId)}`,method:`DELETE`,bearer:t.bearer});return H.parse(n)}async function Vd(e,t){let n=await a(e,{path:`/me/threads/${encodeURIComponent(t.threadId)}/messages/${encodeURIComponent(t.messageId)}`,method:`PATCH`,bearer:t.bearer,body:t.body});return mr.parse(n)}async function Hd(e,t){let n=await a(e,{path:`/me/threads/${encodeURIComponent(t.threadId)}/messages/${encodeURIComponent(t.messageId)}/reactions/${encodeURIComponent(t.emoji)}`,method:`PUT`,bearer:t.bearer});return vr.parse(n)}async function Ud(e,t){let n=await a(e,{path:`/me/threads/${encodeURIComponent(t.threadId)}/messages/${encodeURIComponent(t.messageId)}/reactions/${encodeURIComponent(t.emoji)}`,method:`DELETE`,bearer:t.bearer});return vr.parse(n)}async function Wd(e,t){let n=await a(e,{path:`/me/threads/${encodeURIComponent(t.threadId)}/participants/${encodeURIComponent(t.userId)}`,method:`DELETE`,bearer:t.bearer});return U.parse(n)}async function Gd(e,t){let n=await a(e,{path:`/me/threads/${encodeURIComponent(t.threadId)}/participants/${encodeURIComponent(t.userId)}/role`,method:`PATCH`,bearer:t.bearer,body:t.body});return U.parse(n)}async function Kd(e,t){let n=await a(e,{path:`/me/threads/${encodeURIComponent(t.threadId)}`,method:`DELETE`,bearer:t.bearer});return H.parse(n)}async function qd(e,t){let n=await a(e,{path:`/me/threads/${encodeURIComponent(t.threadId)}`,method:`PATCH`,bearer:t.bearer,body:t.body});return U.parse(n)}async function Jd(e,t){let n=await a(e,{path:`/me/threads/${encodeURIComponent(t.threadId)}/hide`,method:`POST`,bearer:t.bearer});return H.parse(n)}async function Yd(e,t){let n=await a(e,{path:`/me/threads/${encodeURIComponent(t.threadId)}/invite`,method:`POST`,bearer:t.bearer,body:t.body});return U.parse(n)}async function Xd(e,t){let n=await a(e,{path:`/me/threads/${encodeURIComponent(t.threadId)}/leave`,method:`POST`,bearer:t.bearer});return H.parse(n)}async function Zd(e,t){let n=await a(e,{path:`/me/threads/${encodeURIComponent(t.threadId)}/pin`,method:`POST`,bearer:t.bearer});return yr.parse(n)}async function Qd(e,t){let n=await a(e,{path:`/me/threads/${encodeURIComponent(t.threadId)}/pin`,method:`DELETE`,bearer:t.bearer});return H.parse(n)}async function $d(e){let t=await a(e,{path:`/.well-known/oauth-authorization-server`});return de.parse(t)}function ef(e){let t=e.endsWith(`/`)?e.slice(0,-1):e;return{authorize:`${t}/oauth/authorize`,token:`${t}/oauth/token`,userinfo:`${t}/userinfo`,revoke:`${t}/oauth/revoke`}}async function tf(){let e=of(af(32));return{codeVerifier:e,codeChallenge:await nf(e)}}async function nf(e){let t=new TextEncoder().encode(e),n=await crypto.subtle.digest(`SHA-256`,t);return of(new Uint8Array(n))}function rf(e=32){return of(af(e))}function af(e){let t=new Uint8Array(e);return crypto.getRandomValues(t),t}function of(e){let t=``;for(let n of e)t+=String.fromCodePoint(n);return(typeof btoa==`function`?btoa(t):Buffer.from(t,`binary`).toString(`base64`)).replaceAll(`+`,`-`).replaceAll(`/`,`_`).replaceAll(/=+$/g,``)}async function sf(e){let t=e.pkce??await tf(),n=e.state??rf(),r=new URLSearchParams({response_type:`code`,client_id:e.clientId,redirect_uri:e.redirectUri,scope:e.scopes.join(` `),state:n,code_challenge:t.codeChallenge,code_challenge_method:`S256`});e.forceConsent===!0&&r.set(`prompt`,`consent`);let{authorize:i}=ef(e.issuer);return{url:`${i}?${r.toString()}`,state:n,codeVerifier:t.codeVerifier,codeChallenge:t.codeChallenge}}async function cf(e,t){let n={token:t.token,client_id:t.clientId};t.tokenTypeHint!==void 0&&(n.token_type_hint=t.tokenTypeHint),t.clientSecret!==void 0&&(n.client_secret=t.clientSecret),await s(e,{path:`/oauth/revoke`,method:`POST`,form:n})}async function lf(e,t){let n={grant_type:`authorization_code`,code:t.code,redirect_uri:t.redirectUri,code_verifier:t.codeVerifier,client_id:t.clientId};t.clientSecret!==void 0&&(n.client_secret=t.clientSecret);let r=await a(e,{path:`/oauth/token`,method:`POST`,form:n});return _e.parse(r)}async function uf(e,t){let n={grant_type:`refresh_token`,refresh_token:t.refreshToken,client_id:t.clientId};t.clientSecret!==void 0&&(n.client_secret=t.clientSecret),t.scope!==void 0&&(n.scope=t.scope.join(` `));let r=await a(e,{path:`/oauth/token`,method:`POST`,form:n});return _e.parse(r)}function df(e,t){return{accessToken:t.access_token,refreshToken:t.refresh_token??null,expiresAt:e+t.expires_in*1e3,scope:t.scope??null,tokenType:t.token_type}}async function ff(e,t){let n=await a(e,{path:`/userinfo`,bearer:t.bearer});return Se.parse(n)}async function pf(e,t){let n=await a(e,{path:`/payments/appeals`,method:`POST`,bearer:t.bearer,body:t.body});return ko.parse(n)}async function mf(e,t){let n=await a(e,{path:`/payments/appeals/pot-leg`,method:`POST`,bearer:t.bearer,body:t.body});return ko.parse(n)}async function hf(e,t){let n=await a(e,{path:`/payments/appeals/${encodeURIComponent(t.appealId)}/room`,bearer:t.bearer});return To.parse(n)}async function gf(e,t){let n=await a(e,{path:`/payments/appeals/${encodeURIComponent(t.appealId)}/room/messages`,method:`POST`,bearer:t.bearer,body:t.body});return Eo.parse(n)}async function _f(e,t){let n=new FormData,r=t.file instanceof Blob?t.file:new Blob([t.file],{type:t.contentType});n.append(`file`,r,t.filename);let i=await e.fetch(`${vf(e.issuer)}/payments/appeals/${encodeURIComponent(t.appealId)}/room/attachments`,{method:`POST`,headers:{authorization:`Bearer ${t.bearer}`},body:n});if(!i.ok){let e=await i.text();throw Error(`tron ${i.status}: ${e}`)}let a=await i.json();return W.parse(a)}function vf(e){return e.endsWith(`/`)?e.slice(0,-1):e}async function yf(e,t){let n=t.idempotencyKey??crypto.randomUUID(),r=await s(e,{path:`/oauth/payments/charge`,method:`POST`,bearer:t.bearer,body:t.body,idempotencyKey:n,raw:!0});if(r.status===402){let e=await c(r),t=Ee.parse(e);return{status:`monthly_limit_exceeded`,currentLimitCents:t.currentLimitCents,monthSpentCents:t.monthSpentCents,attemptedUsdCents:t.attemptedUsdCents,redirectUrl:t.redirectUrl}}if(!r.ok){let e=await r.text();throw Error(`tron ${r.status}: ${e}`)}let i=await c(r);return Te.parse(i)}async function bf(e,t){let n=await a(e,{path:`/oauth/payments/intent/${encodeURIComponent(t.intentId)}`,bearer:t.bearer});return je.parse(n)}async function xf(e,t){let n=await a(e,{path:`/oauth/payments/intent/${encodeURIComponent(t.intentId)}/sign`,method:`POST`,bearer:t.bearer});return Me.parse(n)}async function Sf(e,t){let n=await a(e,{path:`/oauth/payments/intent/${encodeURIComponent(t.intentId)}/complete`,method:`POST`,bearer:t.bearer,body:t.body});return Ne.parse(n)}async function Cf(e,t){let n=await a(e,{path:`/oauth/payments/intent/${encodeURIComponent(t.intentId)}/deny`,method:`POST`,bearer:t.bearer});return Ne.parse(n)}async function wf(e,t){let n=await a(e,{path:`/oauth/payments/intent/${encodeURIComponent(t.intentId)}/solana-prepare`,method:`POST`,bearer:t.bearer});return Ie.parse(n)}async function Tf(e,t){let n=await a(e,{path:`/oauth/payments/intent/${encodeURIComponent(t.intentId)}/solana-complete`,method:`POST`,bearer:t.bearer,body:t.body});return Ne.parse(n)}async function Ef(e,t){let n=await a(e,{path:`/oauth/payments/limits`,bearer:t.bearer});return De.parse(n)}async function Df(e,t){let n=await a(e,{path:`/payments/me/moonpay/availability`,bearer:t.bearer});return sn.parse(n)}async function Of(e,t){let n=await a(e,{path:`/payments/me/moonpay/buy-url`,method:`POST`,bearer:t.bearer,body:t.body});return cn.parse(n)}async function kf(e,t){let n=await a(e,{path:`/payments/me/moonpay/sell-url`,method:`POST`,bearer:t.bearer,body:t.body});return ln.parse(n)}async function Af(e,t){let{bearer:n,chain:r,token:i,amount:o,usdCents:s}=t,c=await a(e,{path:`/oauth/payments/price`,bearer:n,query:{chain:r,token:i,amount:o,usdCents:s===void 0?void 0:String(s)}});return Oe.parse(c)}async function jf(e,t){let n=await a(e,{path:`/oauth/payments/status/${encodeURIComponent(t.intentId)}`,bearer:t.bearer});return ke.parse(n)}async function Mf(e,t){let n=await a(e,{path:`/payments/me/tron`,bearer:t.bearer});return un.parse(n)}async function Nf(e,t){let n=await a(e,{path:`/payments/me/tron/ledger${t.before===void 0?``:`?before=${encodeURIComponent(t.before)}`}`,bearer:t.bearer});return fn.parse(n)}async function Pf(e,t){let n=await a(e,{path:`/payments/me/tron/deposit`,method:`POST`,bearer:t.bearer,body:t.body});return pn.parse(n)}async function Ff(e,t){let n=await a(e,{path:`/payments/me/tron/transfer`,method:`POST`,bearer:t.bearer,idempotencyKey:t.idempotencyKey??crypto.randomUUID(),body:t.body});return mn.parse(n)}async function If(e,t){let n=await a(e,{path:`/payments/me/tron/security`,bearer:t.bearer});return hn.parse(n)}async function Lf(e,t){let n=await a(e,{path:`/payments/me/tron/security`,method:`PUT`,bearer:t.bearer,body:t.setting});return hn.parse(n)}async function Rf(e,t){let n=await a(e,{path:`/payments/me/tron/transfer/challenge`,method:`POST`,bearer:t.bearer,body:t.body});return vn.parse(n)}async function zf(e,t){let n=await a(e,{path:`/payments/me/tron/connect`,method:`POST`,bearer:t.bearer});return Dn.parse(n)}async function Bf(e,t){let n=await a(e,{path:`/payments/me/tron/cashouts`,method:`POST`,bearer:t.bearer,body:t.body});return On.parse(n)}async function Vf(e,t){let n=await a(e,{path:`/payments/me/tron/cashouts`,bearer:t.bearer});return kn.parse(n)}function Hf(e){let t=new URL(e.apiOrigin).origin,n=e.gameOrigin??globalThis.location.origin,r=e.container??document.body,i=e.background??``,a=document.createElement(`iframe`),o=i===``?``:`&bg=${encodeURIComponent(i)}`;a.src=`${t}/presence/embed?client_id=${encodeURIComponent(e.clientId)}&origin=${encodeURIComponent(n)}${o}`,a.title=`Metatron presence`,e.styleIframe?e.styleIframe(a):(a.style.border=`0`,a.style.display=`block`,a.style.width=`190px`,a.style.height=`44px`),i!==``&&(a.style.background=i);let s=null,c=t=>{t===`overlay`?(s??=a.style.cssText,a.style.cssText=`position:fixed;inset:0;width:100%;height:100%;border:0;z-index:2147483646;opacity:1;transition:opacity 160ms ease`):s!==null&&(a.style.cssText=s,s=null),e.onPresentationChange?.(t)},ee=n=>{if(n.origin!==t||n.source!==a.contentWindow)return;let r=n.data;if(r?.source===`tg-presence`)switch(r.kind){case`play-session`:e.onPlaySessionId?.(typeof r.playSessionId==`string`?r.playSessionId:null);break;case`status`:typeof r.status==`string`&&e.onStatus?.(r.status);break;case`auth`:e.onAuthChange?.(r.authenticated===!0);break;case`expand`:c(`overlay`);break;case`collapse`:c(`chip`);break;default:break}};return window.addEventListener(`message`,ee),r.append(a),{destroy(){window.removeEventListener(`message`,ee),a.remove()}}}async function Uf(e,t){let n=await a(e,{path:`/me/stats`,bearer:t.bearer});return Br.parse(n)}async function Wf(e,t){let n=await a(e,{path:`/me/earnings/timeseries`,bearer:t.bearer,query:{days:t.days}});return Hr.parse(n)}async function Gf(e,t){let n=await a(e,{path:`/me/threads`,bearer:t.bearer,query:{limit:t.limit,cursor:t.cursor}});return ar.parse(n)}async function Kf(e,t){let n=await a(e,{path:`/me/threads`,method:`POST`,bearer:t.bearer,body:t.body});return ir.parse(n)}async function qf(e,t){let n=await a(e,{path:`/me/threads/${encodeURIComponent(t.threadId)}/messages`,bearer:t.bearer,query:{limit:t.limit,cursor:t.cursor}});return hr.parse(n)}async function Jf(e,t){await s(e,{path:`/me/threads/${encodeURIComponent(t.threadId)}/messages`,method:`POST`,bearer:t.bearer,body:t.body})}async function Yf(e,t){await s(e,{path:`/me/threads/${encodeURIComponent(t.threadId)}/read`,method:`POST`,bearer:t.bearer})}async function Xf(e,t){let n=new FormData,r=t.file instanceof Blob?t.file:new Blob([t.file],{type:t.contentType});n.append(`file`,r,t.filename);let i=await e.fetch(`${Zf(e.issuer)}/me/threads/${encodeURIComponent(t.threadId)}/attachments`,{method:`POST`,headers:{authorization:`Bearer ${t.bearer}`},body:n});if(!i.ok){let e=await i.text();throw Error(`tron ${i.status}: ${e}`)}let a=await i.json();return W.parse(a)}function Zf(e){return e.endsWith(`/`)?e.slice(0,-1):e}async function Qf(e,t){let n=await a(e,{path:`/me/notifications`,bearer:t.bearer,query:{limit:t.limit,cursor:t.cursor}});return Di.parse(n)}async function $f(e,t){await s(e,{path:`/me/notifications/${encodeURIComponent(t.notificationId)}`,method:`PATCH`,bearer:t.bearer,body:t.body})}async function ep(e,t){await s(e,{path:`/me/notifications/mark-all-read`,method:`POST`,bearer:t.bearer})}async function tp(e,t){let n=await a(e,{path:`/me/playtime`,bearer:t.bearer});return Lr.parse(n)}async function np(e,t){let n=await a(e,{path:`/me/playtime/timeseries`,bearer:t.bearer,query:{days:t.days}});return zr.parse(n)}async function rp(e,t){let n=await a(e,{path:`/users/${encodeURIComponent(t.handle)}`,bearer:t.bearer});return Wi.parse(n)}async function ip(e,t){let n=await a(e,{path:`/users/search`,bearer:t.bearer,query:{q:t.q,limit:t.limit}});return Ki.parse(n)}async function ap(e,t){let n=await a(e,{path:`/me/referral`,bearer:t.bearer});return Ar.parse(n)}async function op(e,t){let n=await a(e,{path:`/me/referral/code`,method:`POST`,bearer:t.bearer,body:{regenerate:t.regenerate??!1}});return jr.parse(n)}async function sp(e,t){let n=await a(e,{path:`/me/referral/preview`,query:{code:t.code},bearer:t.bearer});return Mr.parse(n)}async function cp(e,t){let n={code:t.code,source:t.source},r=await a(e,{path:`/me/referral/bind`,method:`POST`,bearer:t.bearer,body:n});return Nr.parse(r)}async function lp(e,t){await s(e,{path:`/users/${encodeURIComponent(t.userId)}/follow`,method:`POST`,bearer:t.bearer})}async function up(e,t){await s(e,{path:`/users/${encodeURIComponent(t.userId)}/follow`,method:`DELETE`,bearer:t.bearer})}async function dp(e,t){await s(e,{path:`/users/${encodeURIComponent(t.userId)}/friend`,method:`POST`,bearer:t.bearer})}async function fp(e,t){await s(e,{path:`/users/${encodeURIComponent(t.userId)}/friend`,method:`DELETE`,bearer:t.bearer})}async function pp(e,t){await s(e,{path:`/me/friend-requests/${encodeURIComponent(t.requestId)}`,method:`PATCH`,bearer:t.bearer,body:{decision:t.decision}})}async function mp(e,t){await s(e,{path:`/me/friend-requests/${encodeURIComponent(t.requestId)}`,method:`DELETE`,bearer:t.bearer})}async function hp(e,t){let n=await a(e,{path:`/me/friends`,bearer:t.bearer});return Ai.parse(n)}async function gp(e,t){let n=await a(e,{path:`/oauth/friends`,bearer:t.bearer});return ji.parse(n)}async function _p(e,t){let n=await a(e,{path:`/me/socials`,bearer:t.bearer});return Ni.parse(n)}async function vp(e,t){let n=await a(e,{path:`/me/wallets`,bearer:t.bearer});return Vn.parse(n)}async function yp(e,t){let n=await a(e,{path:`/me/wallets/${encodeURIComponent(t.address)}/delegate`,bearer:t.bearer});return zn.parse(n)}async function bp(e,t){let n=await a(e,{path:`/me/wallets/${encodeURIComponent(t.address)}/delegate`,method:`POST`,bearer:t.bearer,body:t.body});return Un.parse(n)}async function xp(e,t){let n=await a(e,{path:`/me/wallets/${encodeURIComponent(t.address)}/delegate`,method:`DELETE`,bearer:t.bearer});return Wn.parse(n)}async function Sp(e,t){let n=await a(e,{path:`/me/wallets/${encodeURIComponent(t.address)}`,method:`PATCH`,bearer:t.bearer,body:t.body});return Hn.parse(n)}async function Cp(e,t){let n=await a(e,{path:`/me/wallets`,bearer:t.bearer});return Vn.parse(n)}const wp=e.object({event:e.enum([`intent.completed`,`intent.denied`,`intent.expired`,`intent.txhash_indexed`]),deliveredAt:e.iso.datetime(),intent:ke});async function Tp(e){let t=e.signatureHeader;if(typeof t!=`string`||t===``)return{ok:!1,reason:`missing_signature`};let n=e.timestampHeader;if(typeof n!=`string`||n===``)return{ok:!1,reason:`missing_timestamp`};let r=Number(n);if(!Number.isFinite(r)||r<=0)return{ok:!1,reason:`invalid_timestamp`};let i=e.toleranceSeconds??300,a=Math.floor((e.now??Date.now())/1e3);if(Math.abs(a-r)>i)return{ok:!1,reason:`stale_timestamp`};if(!Dp(await Ep(e.secret,`${n}.${e.rawBody}`),t))return{ok:!1,reason:`signature_mismatch`};let o;try{o=JSON.parse(e.rawBody)}catch{return{ok:!1,reason:`schema_mismatch`}}let s=wp.safeParse(o);return s.success?{ok:!0,body:s.data}:{ok:!1,reason:`schema_mismatch`}}async function Ep(e,t){let n=new TextEncoder,r=await crypto.subtle.importKey(`raw`,n.encode(e),{name:`HMAC`,hash:`SHA-256`},!1,[`sign`]),i=await crypto.subtle.sign(`HMAC`,r,n.encode(t)),a=new Uint8Array(i),o=``;for(let e of a)o+=e.toString(16).padStart(2,`0`);return o}function Dp(e,t){let n=e.toLowerCase(),r=t.toLowerCase();if(n.length!==r.length)return!1;let i=0;for(let e=0;e<n.length;e++)i|=n.charCodeAt(e)^r.charCodeAt(e);return i===0}const Op=`x-metatron-signature`,kp=`x-metatron-timestamp`,Ap=new Set([`localhost`,`127.0.0.1`,`::1`]);function jp(e,t={}){if(!(t.isProduction??Mp()))return;let n;try{n=new URL(e)}catch{throw Error(`@metatrongg/sdk: invalid issuer URL: ${e}`)}if(n.protocol!==`https:`&&!(n.protocol===`http:`&&Ap.has(n.hostname)))throw Error(`@metatrongg/sdk: issuer must be https:// in production (got ${n.protocol}//${n.host})`)}function Mp(){return typeof process<`u`&&typeof process.env==`object`?process.env.NODE_ENV===`production`:!1}var Np=class{ctx;clientId;redirectUri;scopes;tokenStore;constructor(e){jp(e.issuer),this.ctx={issuer:e.issuer,fetch:e.fetch??fetch.bind(globalThis),logger:e.logger??Zl(),rateLimiter:e.rateLimit===!1?void 0:ou(e.rateLimit??{}),dedupe:e.dedupe===!1?void 0:Xl()},this.clientId=e.clientId,this.redirectUri=e.redirectUri,this.scopes=e.scopes,this.tokenStore=e.tokenStore}get transport(){return this.ctx}get oauth(){return{discover:async()=>await $d(this.ctx),buildAuthorizeUrl:async e=>await sf({issuer:this.ctx.issuer,clientId:this.clientId,redirectUri:this.redirectUri,scopes:this.scopes,state:e?.state,forceConsent:e?.forceConsent}),exchangeCode:async e=>{let t=await lf(this.ctx,{code:e.code,redirectUri:this.redirectUri,codeVerifier:e.codeVerifier,clientId:this.clientId}),n=df(Date.now(),t);return await this.tokenStore?.set(this.clientId,n),n},refresh:async e=>{let t=await uf(this.ctx,{refreshToken:e.refreshToken,clientId:this.clientId,scope:e.scope}),n=df(Date.now(),t);return await this.tokenStore?.set(this.clientId,n),n},revoke:async e=>{await cf(this.ctx,{token:e.token,tokenTypeHint:e.tokenTypeHint,clientId:this.clientId})},signOut:async e=>{await cf(this.ctx,{token:e.refreshToken,tokenTypeHint:`refresh_token`,clientId:this.clientId}),await this.tokenStore?.clear(this.clientId)},userInfo:async e=>await ff(this.ctx,e),getStoredTokens:async()=>await(this.tokenStore?.get(this.clientId)??Promise.resolve(null))}}get payments(){return{charge:async e=>await yf(this.ctx,e),limits:async e=>await Ef(this.ctx,e),price:async e=>await Af(this.ctx,e),status:async e=>await jf(this.ctx,e),intent:{get:async e=>await bf(this.ctx,e),sign:async e=>await xf(this.ctx,e),complete:async e=>await Sf(this.ctx,e),deny:async e=>await Cf(this.ctx,e)}}}get users(){return{get:async e=>await rp(this.ctx,e),search:async e=>await ip(this.ctx,e),follow:async e=>{await lp(this.ctx,e)},unfollow:async e=>{await up(this.ctx,e)},friendRequest:async e=>{await dp(this.ctx,e)},decideFriendRequest:async e=>{await pp(this.ctx,e)},cancelFriendRequest:async e=>{await mp(this.ctx,e)},friends:async e=>await hp(this.ctx,e),me:async e=>await a(this.ctx,{path:`/me`,bearer:e.bearer})}}get messaging(){return{listThreads:async e=>await Gf(this.ctx,e),createDirect:async e=>await Kf(this.ctx,e),listMessages:async e=>await qf(this.ctx,e),send:async e=>{await Jf(this.ctx,e)},markRead:async e=>{await Yf(this.ctx,e)},uploadAttachment:async e=>await Xf(this.ctx,e)}}get notifications(){return{list:async e=>await Qf(this.ctx,e),markAllRead:async e=>{await ep(this.ctx,e)}}}get wallets(){return{list:async e=>await vp(this.ctx,e)}}get inventory(){return{list:async e=>await _d(this.ctx,e)}}get socials(){return{list:async e=>await _p(this.ctx,e)}}get referral(){return{get:async e=>await ap(this.ctx,e),createCode:async e=>await op(this.ctx,e),preview:async e=>await sp(this.ctx,e),bind:async e=>await cp(this.ctx,e)}}};function Pp(e={}){if(typeof document>`u`)throw TypeError(`@metatrongg/sdk: cookie token store requires a browser environment`);let t=e.cookieName??`tg_sdk_tokens`,n=e.path??`/`,r=e.secure??!0,i=e.sameSite??`Lax`,a=e.maxAgeSeconds??3600*24*30;function o(e){return`${t}:${e}`}return{async get(e){let t=Fp(o(e));if(t===null)return null;try{return JSON.parse(t)}catch{return null}},async set(e,t){Ip(o(e),JSON.stringify(t),{path:n,secure:r,sameSite:i,maxAgeSeconds:a})},async clear(e){Ip(o(e),``,{path:n,secure:r,sameSite:i,maxAgeSeconds:0})}}}function Fp(e){let t=`${encodeURIComponent(e)}=`;for(let e of document.cookie.split(`; `))if(e.startsWith(t))return decodeURIComponent(e.slice(t.length));return null}function Ip(e,t,n){let r=[`${encodeURIComponent(e)}=${encodeURIComponent(t)}`,`Path=${n.path}`,`SameSite=${n.sameSite}`,`Max-Age=${n.maxAgeSeconds}`];n.secure&&r.push(`Secure`),document.cookie=r.join(`; `)}export{nu as NOOP_RATE_LIMITER,tu as SERVER_RATE_LIMIT_MAX_MUTATING,eu as SERVER_RATE_LIMIT_MAX_READ,$l as SERVER_RATE_LIMIT_WINDOW_MS,r as TRON_WS_CLOSE_CODES,Np as TronBrowserClient,t as TronError,n as TronOauthError,i as TronWsCloseError,Op as WEBHOOK_SIGNATURE_HEADER,kp as WEBHOOK_TIMESTAMP_HEADER,pd as acceptDeveloperInvite,rl as addAdmin,Xc as addAppealBlacklist,Hd as addReaction,el as approveTronCashout,Id as batchThreadDmKeys,cp as bindReferral,sf as buildAuthorizeUrl,mp as cancelFriendRequest,yf as charge,Sl as commentOnBipUpdate,Kl as commentOnGameReview,Sf as completePaymentIntent,Tf as completePaymentIntentSolana,Mu as consolidateDeveloperAppWallet,Tl as createBipUpdate,Ql as createConsoleLogger,Pp as createCookieTokenStore,bp as createDelegation,mu as createDeveloperApiKey,_u as createDeveloperApp,Gu as createDeveloperAppMintPermit,hd as createDeveloperVaultPermit,gd as createDeveloperWithdrawPermit,Kf as createDirectThread,su as createInMemoryTokenStore,Xl as createInflightDedup,Zl as createNoopLogger,ou as createRateLimiter,op as createReferralCode,Bf as createTronCashout,zf as createTronConnectOnboarding,Pf as createTronDeposit,Ff as createTronTransfer,Rf as createTronTransferChallenge,pp as decideFriendRequest,md as declineDeveloperInvite,ef as defaultEndpoints,Qu as deleteAppPageBanner,ed as deleteAppPageThumbnail,nd as deleteAppPageThumbnailVideo,uc as deleteAvatar,Dl as deleteBipUpdate,Cl as deleteBipUpdateComment,xp as deleteDelegation,yu as deleteDeveloperApp,xu as deleteDeveloperAppLogo,pl as deleteDeveloperProfileLogo,gl as deleteDeveloperRequestLogo,ql as deleteGameReviewComment,Yl as deleteGameReviewReply,Bd as deleteMessage,Vl as deleteMyGameReview,Kd as deleteThread,Rd as deleteThreadLogo,Cf as denyPaymentIntent,Vd as editMessage,lf as exchangeAuthorizationCode,bd as executeNftTransfer,$d as fetchAuthorizationServerMetadata,ff as fetchUserInfo,pf as fileAppeal,mf as fileAppealPotLeg,lp as followUser,zc as forceWithdrawVaultCustody,tf as generatePkce,rf as generateState,cu as getActivity,lu as getActivityGroup,kc as getAdminAppealRoom,Hc as getAppFeeConfig,ll as getAppPage,bc as getAppPageChanges,hf as getAppealRoom,Nl as getBipDirectory,kl as getBipInterestCount,Pl as getBipPage,yp as getDelegation,wu as getDeveloperAppActivity,Su as getDeveloperAppBalances,Tu as getDeveloperAppEarnings,Ku as getDeveloperAppInventoryItemHolders,Du as getDeveloperAppOverview,Yu as getDeveloperAppPage,Eu as getDeveloperAppPlaytime,Cu as getDeveloperAppTronBalance,Ou as getDeveloperAppWallets,Iu as getDeveloperPaymentAppeals,Lu as getDeveloperPaymentPendingDeposits,ul as getDeveloperStatus,Ru as getDeveloperTronBalanceSummary,Ad as getDmKeyBackupStatus,Wf as getEarningsTimeseries,jf as getIntentStatus,Il as getLibrary,Uf as getMeStats,Df as getMoonpayAvailability,Al as getMyBipEngagement,bl as getMyBipUpdateReactions,Pd as getMyDmKey,zl as getMyGameReview,Hl as getMyGameReviewReactions,du as getOutstanding,uu as getPaymentChains,fu as getPaymentHistory,bf as getPaymentIntent,Ef as getPaymentLimits,Af as getPaymentPrice,pu as getPaymentRates,Bc as getPlatformFees,tp as getPlaytime,np as getPlaytimeTimeseries,rp as getPublicProfile,ap as getReferral,Fd as getThreadDmKey,Mf as getTronBalance,If as getTronSecurity,Sc as hideAppPage,Ec as hideAppPageBip,Jd as hideThread,ud as inviteDeveloperAppParticipant,Yd as inviteParticipants,Xd as leaveThread,vc as listActivePlayers,Pc as listAdminContentReports,nl as listAdmins,yc as listAppPages,Qc as listAppealBlacklist,Oc as listAppealQueue,cl as listAudit,yl as listBipUpdateComments,vl as listBipUpdates,hu as listDeveloperApiKeys,zu as listDeveloperAppContentReports,Uu as listDeveloperAppInventoryCollections,Wu as listDeveloperAppInventoryItems,ld as listDeveloperAppParticipants,Rl as listDeveloperAppReviews,wl as listDeveloperBipUpdates,fd as listDeveloperInvites,Ic as listDeveloperRequests,Rc as listDevelopers,hp as listFriends,gp as listFriendsForApp,Gl as listGameReviewComments,Ll as listGameReviews,_d as listInventory,vd as listInventoryForApp,xd as listInventoryMintPermits,wd as listInventoryVaultPermits,Od as listInventoryVaulted,Qf as listNotifications,kd as listOauthInventoryVaulted,pc as listPaymentAuthorizations,_p as listSocials,qf as listThreadMessages,Gf as listThreads,$c as listTronCashoutQueue,Vf as listTronCashouts,Nf as listTronLedger,ol as listUsers,Cp as listWalletManager,vp as listWallets,ep as markAllNotificationsRead,Yf as markThreadRead,Of as mintMoonpayBuyUrl,kf as mintMoonpaySellUrl,Hf as mountPresenceWidget,wp as oauthPaymentWebhookBodySchema,Zd as pinThread,Ac as postAdminAppealRoomMessage,gf as postAppealRoomMessage,wf as preparePaymentIntentSolana,sp as previewReferral,Au as provisionDeveloperAppWallet,Nd as publishDmKey,Vu as quoteDeveloperAppInventoryRegistration,yd as quoteNftTransfer,Ed as quoteRelayedVaultPermit,Sd as redeemInventoryMintPermit,uf as refreshAccessToken,jl as registerBipInterest,Hu as registerDeveloperAppInventoryItem,tl as rejectTronCashout,al as removeAdmin,Zc as removeAppealBlacklist,fp as removeFriend,Wd as removeParticipant,Ud as removeReaction,Jl as replyToGameReview,Pu as requestDeveloperAppProduction,Cd as requestMint,Mc as resolveAppeal,wc as reviewAppPage,Tc as reviewAppPageBip,xc as reviewAppPageChanges,Lc as reviewDeveloperRequest,gu as revokeDeveloperApiKey,dd as revokeDeveloperAppParticipant,hc as revokePaymentAuthorization,cf as revokeToken,Nu as rotateDeveloperAppKey,Fu as rotateDeveloperAppPaymentWebhookSecret,Gc as rotateProcessorTreasury,fc as searchGiphy,ip as searchUsers,dp as sendFriendRequest,Jf as sendMessage,gc as sendPresenceHeartbeat,od as setAppPageBip,xl as setBipUpdateReaction,Ul as setMyGameReviewReaction,Wc as setProcessorWhitelist,Lf as setTronSecurity,Kc as setVaultOperator,qc as setVaultPause,Jc as setVaultWithdrawLockDefault,Yc as setVaultWithdrawLockOverride,jd as setupDmKeyBackup,nf as sha256Base64Url,Td as signInventoryVaultPermit,xf as signPaymentIntent,Fl as submitAppContentReport,sd as submitAppPageBipForReview,id as submitAppPageForReview,ml as submitDeveloperRequest,Dd as submitRelayedVaultPermit,Ml as subscribeBipUpdates,Wl as tipGameReview,df as toTokenSet,Fc as triageAdminContentReport,up as unfollowUser,Cc as unhideAppPage,Dc as unhideAppPageBip,Md as unlockDmKeyBackup,Qd as unpinThread,ad as unpublishAppPage,cd as unpublishAppPageBip,il as updateAdminRole,Uc as updateAppFeeConfig,Xu as updateAppPage,El as updateBipUpdate,vu as updateDeveloperApp,ku as updateDeveloperAppAutoSweep,Bu as updateDeveloperAppContentReportStatus,dl as updateDeveloperProfile,$f as updateNotification,Gd as updateParticipantRole,mc as updatePaymentAuthorization,Vc as updatePlatformFees,_c as updateProfile,qd as updateThreadSettings,sl as updateUserBan,Sp as updateWalletLabel,jc as uploadAdminAppealRoomAttachment,Zu as uploadAppPageBanner,rd as uploadAppPageGallery,$u as uploadAppPageThumbnail,td as uploadAppPageThumbnailVideo,_f as uploadAppealRoomAttachment,Xf as uploadAttachment,lc as uploadAvatar,Ol as uploadBipUpdateMedia,Ju as uploadDeveloperAppInventoryItemBanner,qu as uploadDeveloperAppInventoryItemImage,bu as uploadDeveloperAppLogo,fl as uploadDeveloperProfileLogo,hl as uploadDeveloperRequestLogo,$ as uploadMultipart,Ld as uploadThreadLogo,Bl as upsertMyGameReview,Tp as verifyWebhook,ju as withdrawDeveloperAppWallet};
|
|
1
|
+
import*as e from"zod";var t=class extends Error{status;code;body;constructor(e,t,n,r){super(n),this.name=`TronError`,this.status=e,this.code=t,this.body=r}},n=class extends t{error;errorDescription;errorUri;constructor(e,t,n,r,i){super(e,t,`oauth ${e} ${t}${r===void 0?``:`: ${r}`}`,n),this.name=`TronOauthError`,this.error=t,this.errorDescription=r,this.errorUri=i}};const r={BAD_REQUEST:4400,UNAUTHORIZED:4401,FORBIDDEN:4403,NOT_FOUND:4404,UNAVAILABLE:4503};var i=class extends Error{code;reason;constructor(e,t){super(`tron ws closed: ${e}${t===``?``:` ${t}`}`),this.name=`TronWsCloseError`,this.code=e,this.reason=t}get isApplicationError(){return this.code>=4e3&&this.code<5e3}get isPermanent(){return[r.BAD_REQUEST,r.UNAUTHORIZED,r.FORBIDDEN,r.NOT_FOUND].includes(this.code)}};async function a(e,t){if(t.raw===!0)throw Error("sendJson does not support `raw: true`; call send() directly");let n=t.method??`GET`;return e.dedupe!==void 0&&n===`GET`?await e.dedupe.run(o(t),async()=>await c(await s(e,t))):await c(await s(e,t))}function o(e){let t=e.query===void 0?``:JSON.stringify(e.query);return`GET ${e.path}?${t}|${e.bearer??``}`}async function s(e,t){let n=ee(e.issuer,t.path,t.query),r=new Headers(t.headers);t.bearer===void 0?t.basicAuth!==void 0&&r.set(`authorization`,`Basic ${ne(`${t.basicAuth.username}:${t.basicAuth.password}`)}`):r.set(`authorization`,`Bearer ${t.bearer}`),t.idempotencyKey!==void 0&&r.set(`idempotency-key`,t.idempotencyKey);let i=null;t.form===void 0?t.body!==void 0&&(r.set(`content-type`,`application/json`),i=JSON.stringify(t.body)):(r.set(`content-type`,`application/x-www-form-urlencoded`),i=new URLSearchParams(t.form).toString());let a=t.method??`GET`;e.rateLimiter!==void 0&&await e.rateLimiter.acquire(a);let o={method:a,headers:r};i!==null&&(o.body=i);let s=await e.fetch(n,o);if(t.raw===!0)return s;if(!s.ok){let e=await s.text();throw te(s.status,e)}return s}async function c(e){let n=await e.text();if(n!==``)try{return JSON.parse(n)}catch{throw new t(e.status,`non_json`,`response was not json`,n)}}function ee(e,t,n){let r=new URL(t,e.endsWith(`/`)?e:`${e}/`);if(n!==void 0){for(let[e,t]of Object.entries(n))if(t!==void 0)if(typeof t==`string`||typeof t==`number`)r.searchParams.set(e,String(t));else for(let n of t)r.searchParams.append(e,n)}return r.href}function te(e,r){let i;try{i=JSON.parse(r)}catch{return new t(e,`non_json`,`tron ${e}: non-json response`,r)}if(typeof i==`object`&&i){let a=i;if(typeof a.error==`string`&&(a.error_description!==void 0||a.error_uri!==void 0))return new n(e,a.error,r,typeof a.error_description==`string`?a.error_description:void 0,typeof a.error_uri==`string`?a.error_uri:void 0);if(typeof a.error==`string`)return new t(e,a.error,`tron ${e} ${a.error}`,r);if(Array.isArray(a.issues))return new t(e,`validation_failed`,`tron ${e} validation_failed`,r)}return new t(e,`unknown`,`tron ${e}: unknown error shape`,r)}function ne(e){return typeof Buffer<`u`?Buffer.from(e,`utf8`).toString(`base64`):btoa(e)}const l=e.string().min(3).max(18).regex(/^[a-z][a-z0-9_]*$/),re=e.string().nullable(),ie=e.string().max(256).nullable(),ae=e.url().max(2048).nullable(),oe=e.enum([`yellow`,`green`,`blue`,`white`,`black`,`red`]),u=e.enum([`super-admin`,`admin`,`read-only`]).nullable(),se=e.enum([`auto`,`online`,`offline`]),ce=e.enum([`development`,`production`]),d=e.object({id:e.string().min(1),email:e.email().nullable(),emailVerified:e.boolean(),name:l,displayName:re,bio:ie,websiteUrl:ae,image:e.string().nullish(),banner:oe,role:u,presenceStatusMode:se,environmentViewMode:ce,createdAt:e.iso.datetime(),updatedAt:e.iso.datetime()}),le=e.string().min(1);e.object({user:d,token:le.optional()}),e.object({error:e.string().min(1),traceId:e.string().min(1).optional()}),e.object({name:l,email:e.email(),password:e.string().min(8),image:e.url().optional(),callbackURL:e.url().optional()}),e.object({redirect:e.boolean(),token:le.optional(),url:e.url().optional(),user:d.optional()}),e.object({email:e.email(),password:e.string().min(1),callbackURL:e.url().optional(),rememberMe:e.boolean().optional()}),e.object({success:e.boolean()});const ue=e.object({id:e.string().min(1),token:e.string().min(1),userId:e.string().min(1),expiresAt:e.iso.datetime(),ipAddress:e.string().nullish(),userAgent:e.string().nullish(),createdAt:e.iso.datetime(),updatedAt:e.iso.datetime()});e.object({session:ue,user:d}).nullable(),e.object({status:e.boolean()}),e.object({status:e.boolean()}),e.object({email:e.email(),callbackURL:e.url().optional()}),e.object({status:e.boolean()}),e.object({email:e.email(),redirectTo:e.url().optional()}),e.object({status:e.boolean()}),e.object({newPassword:e.string().min(8),token:e.string().min(1)});const de=e.object({issuer:e.url(),authorization_endpoint:e.url(),token_endpoint:e.url(),userinfo_endpoint:e.url(),revocation_endpoint:e.url(),registration_endpoint:e.url(),response_types_supported:e.array(e.enum([`code`])),grant_types_supported:e.array(e.enum([`authorization_code`,`refresh_token`,`client_credentials`])),code_challenge_methods_supported:e.array(e.enum([`S256`])),token_endpoint_auth_methods_supported:e.array(e.enum([`client_secret_basic`,`client_secret_post`,`none`])),scopes_supported:e.array(e.enum([`openid`,`profile`,`payments:charge`,`inventory:read`,`social:read`,`developer:read`,`developer:apps`,`developer:pages`]))}),f=e.url().max(2048),p=e.string().min(1).regex(/^[A-Za-z0-9_:.-]+(?: [A-Za-z0-9_:.-]+)*$/);e.object({client_id:e.string().regex(/^tg_dc_[a-f0-9]{32}$/),client_id_issued_at:e.int().gte(0),client_name:e.string().min(1),redirect_uris:e.array(f),token_endpoint_auth_method:e.enum([`none`]),grant_types:e.array(e.enum([`authorization_code`,`refresh_token`])),response_types:e.array(e.enum([`code`])),scope:p}),e.object({error:e.enum([`invalid_redirect_uri`,`invalid_client_metadata`]),error_description:e.string().optional()}),e.object({redirect_uris:e.array(f).min(1).max(10),client_name:e.string().min(1).max(128).optional(),token_endpoint_auth_method:e.enum([`none`]).optional(),grant_types:e.array(e.enum([`authorization_code`,`refresh_token`])).optional(),response_types:e.array(e.enum([`code`])).optional(),scope:p.optional()});const m=e.string().regex(/^tg_(?:dev|prod|dc)_[A-Za-z0-9]{16,64}$/),fe=e.string().min(1).max(2048),pe=e.string().regex(/^[A-Za-z0-9_~.-]{43,128}$/),h=e.string().regex(/^[a-f0-9]{32}$/);e.object({request:h,app:e.object({id:e.string().min(1),name:e.string().min(1),logoUrl:e.url().nullable()}),clientKind:e.enum([`app`,`connector`]),scopes:e.array(e.enum([`openid`,`profile`,`payments:charge`,`inventory:read`,`social:read`,`developer:read`,`developer:apps`,`developer:pages`])).min(1),developerRole:e.object({approved:e.boolean(),policyVersion:e.string().min(1)}).nullable(),alreadyGranted:e.array(e.enum([`openid`,`profile`,`payments:charge`,`inventory:read`,`social:read`,`developer:read`,`developer:apps`,`developer:pages`])),redirectUriHost:e.string().min(1),payment:e.object({tiersCents:e.array(e.int().gt(0)).min(1),currentLimitCents:e.int().gte(0).nullable(),currentMonthSpentCents:e.int().gte(0).nullable(),payoutChains:e.array(e.string().min(1)),tron:e.object({currentMonthlyLimitTronCents:e.int().gte(0).nullable(),currentMonthSpentTronCents:e.int().gte(0).nullable(),currentAutoApproveEnabled:e.boolean()}).nullable()}).nullable()}),e.object({consentId:e.string().min(1),app:e.object({id:e.string().min(1),name:e.string().min(1),logoUrl:e.url().nullable()}),monthlyLimitCents:e.int().gte(0).nullable(),monthSpentCents:e.int().gte(0),tiersCents:e.array(e.int().gt(0)).min(1)}),e.object({app:e.object({id:e.string().min(1),name:e.string().min(1),logoUrl:e.url().nullable()}),developer:e.object({studioName:e.string().nullable(),logoUrl:e.url().nullable(),studioUrl:e.url().nullable(),studioXHandle:e.string().nullable()})}),e.object({redirect:e.url()});const me=e.int().gte(100).lte(5e6).nullable(),he=e.int().gt(0).lte(1e8).nullable();e.object({request:h,decision:e.enum([`allow`,`deny`]),acceptDeveloperPolicy:e.boolean().optional(),payment:e.object({monthlyLimitCents:me,tron:e.object({autoApproveEnabled:e.boolean(),monthlyLimitTronCents:he}).optional()}).optional()});const ge=e.object({access_token:e.string().min(1),token_type:e.enum([`Bearer`]),expires_in:e.int().gt(0),refresh_token:e.string().min(1).optional(),scope:p.optional()});e.object({error:e.enum([`invalid_request`,`invalid_client`,`invalid_grant`,`unauthorized_client`,`unsupported_grant_type`,`unsupported_response_type`,`invalid_scope`,`access_denied`,`server_error`,`temporarily_unavailable`,`invalid_token`,`insufficient_scope`]),error_description:e.string().optional(),error_uri:e.url().optional(),state:fe.optional()});const _e=e.string().regex(/^[A-Za-z0-9_~.-]{43,128}$/),g=e.string().regex(/^[a-f0-9]{64}$/),ve=e.object({grant_type:e.enum([`authorization_code`]),code:e.string().min(1),redirect_uri:f,code_verifier:_e,client_id:m.optional(),client_secret:g.optional()}),ye=e.object({grant_type:e.enum([`refresh_token`]),refresh_token:e.string().min(1),scope:p.optional(),client_id:m.optional(),client_secret:g.optional()}),be=e.object({grant_type:e.enum([`client_credentials`]),scope:p.optional(),client_id:m.optional(),client_secret:g.optional()});e.discriminatedUnion(`grant_type`,[ve.extend({grant_type:e.literal(`authorization_code`)}),ye.extend({grant_type:e.literal(`refresh_token`)}),be.extend({grant_type:e.literal(`client_credentials`)})]);const xe=e.object({sub:e.string().min(1),name:e.string().min(1).nullable(),preferred_username:e.string().min(1).nullable(),picture:e.url().nullable(),wallet_address:e.string().min(1).nullable()});e.object({token:e.string().min(1),token_type_hint:e.enum([`access_token`,`refresh_token`]).optional(),client_id:m.optional(),client_secret:g.optional()});const Se=e.object({status:e.enum([`completed`]),intentId:e.string().min(1),paymentId:e.string().min(1),usdCents:e.int().gte(0),txHash:e.string().nullable()}),Ce=e.object({status:e.enum([`redirect`]),intentId:e.string().min(1),redirectUrl:e.url(),usdCents:e.int().gte(0)}),we=e.discriminatedUnion(`status`,[Se.extend({status:e.literal(`completed`)}),Ce.extend({status:e.literal(`redirect`)})]),Te=e.object({error:e.enum([`monthly_limit_exceeded`]),currentLimitCents:e.int().gte(0),monthSpentCents:e.int().gte(0),attemptedUsdCents:e.int().gte(0),redirectUrl:e.url()});e.object({error:e.enum([`idempotency_key_reused`]),intentId:e.string().min(1)});const _=e.object({purpose:e.string().min(1).max(64).optional(),title:e.string().min(1).max(120).optional(),note:e.string().min(1).max(280).optional(),quantity:e.int().gte(1).lte(1e6).optional(),category:e.string().min(1).max(64).optional(),sessionId:e.string().min(1).max(128).optional(),groupId:e.string().min(1).max(128).optional(),image:e.url().max(2048).optional(),extra:e.record(e.string(),e.union([e.string().max(512),e.number(),e.boolean()])).optional()});e.object({chain:e.string().min(1),amount:e.string().regex(/^\d+$/),token:e.string().regex(/^0x[0-9a-fA-F]{40}$/),returnUri:e.url().max(2048),potId:e.string().regex(/^0x[0-9a-fA-F]{32}$/).optional(),rakeBps:e.int().gte(0).lte(3e3).optional(),metadata:_.optional()});const Ee=e.object({monthlyLimitCents:e.int().gte(0).nullable(),monthSpentCents:e.int().gte(0),periodStart:e.iso.datetime(),offlineAutoChargeEnabled:e.boolean(),perTxOfflineCapCents:e.int().gte(0).nullable(),walletDelegated:e.boolean()}),De=e.object({chain:e.string().min(1),token:e.string().regex(/^0x[0-9a-fA-F]{40}$/),tokenDecimals:e.int().gte(0),usdRate:e.string().min(1),feed:e.object({aggregatorAddress:e.string().regex(/^0x[0-9a-fA-F]{40}$/),decimals:e.int().gte(0),answer:e.string().regex(/^\d+$/),updatedAt:e.iso.datetime()}),usdCents:e.int().gte(0).optional(),amount:e.string().regex(/^\d+$/).optional()}),Oe=e.object({intentId:e.string().min(1),appId:e.string().min(1),status:e.enum([`pending`,`awaiting_funding`,`completed`,`denied`,`expired`]),paymentId:e.string().nullable(),txHash:e.string().nullable(),usdCents:e.int().gte(0),chain:e.string().min(1),token:e.string().regex(/^0x[0-9a-fA-F]{40}$/).nullable(),grossAmount:e.string().regex(/^\d+$/).nullable(),creditedAmount:e.string().regex(/^\d+$/).nullable(),settlement:e.enum([`instant`,`locked`]).nullable(),resolvedAt:e.iso.datetime().nullable(),expiresAt:e.iso.datetime()}),ke=e.object({intentId:e.string().min(1),consentId:e.string().min(1),app:e.object({id:e.string().min(1),name:e.string().min(1),logoUrl:e.url().nullable()}),chain:e.string().min(1),token:e.string(),amount:e.string(),vault:e.string().regex(/^0x[0-9a-fA-F]{40}$/),appealable:e.boolean(),usdCents:e.int().gte(0),monthlyLimitCents:e.int().gte(0).nullable(),monthSpentCents:e.int().gte(0),offlineAutoChargeEnabled:e.boolean(),perTxOfflineCapCents:e.int().gte(0).nullable(),walletDelegated:e.boolean(),canonicalWalletAddress:e.string().nullable(),offlineDenialReason:e.enum([`no_active_play_session`,`driver_unavailable`,`wallet_not_delegated`,`deposit_cap_exceeded`,`insufficient_balance`,`fire_failed`]).nullable(),returnUriHost:e.string().min(1),status:e.enum([`pending`,`awaiting_funding`]),expiresAt:e.iso.datetime(),accessDenied:e.object({reason:e.enum([`not_invited`]),developer:e.object({studioName:e.string().nullable(),logoUrl:e.url().nullable(),studioUrl:e.url().nullable(),studioXHandle:e.string().nullable()})}).nullish(),environment:e.enum([`development`,`production`])}),Ae=e.object({chain:e.string().min(1),chainId:e.int().gte(0),id:e.string().regex(/^0x[0-9a-fA-F]{32}$/),amount:e.string().regex(/^\d+$/),token:e.string().regex(/^0x[0-9a-fA-F]{40}$/),vault:e.string().regex(/^0x[0-9a-fA-F]{40}$/),data:e.string().regex(/^0x[0-9a-fA-F]*$/),appealable:e.boolean(),payer:e.string().regex(/^0x[0-9a-fA-F]{40}$/),deadline:e.int().gte(0),routerAddress:e.string().regex(/^0x[0-9a-fA-F]{40}$/),signature:e.string().regex(/^0x[0-9a-fA-F]+$/)}),je=e.object({redirect:e.url()}),Me=e.object({method:e.enum([`signed`]),paymentId:e.string().min(1)}),Ne=e.object({method:e.enum([`offline`])});e.discriminatedUnion(`method`,[Me.extend({method:e.literal(`signed`)}),Ne.extend({method:e.literal(`offline`)})]);const Pe=e.object({consentId:e.string().min(1),app:e.object({id:e.string().min(1),name:e.string().min(1),logoUrl:e.url().nullable()}),monthlyLimitCents:e.int().gte(0).nullable(),monthSpentCents:e.int().gte(0),periodStart:e.iso.datetime(),offlineAutoChargeEnabled:e.boolean(),perTxOfflineCapCents:e.int().gte(0).nullable()}),Fe=e.object({authorizations:e.array(Pe)}),Ie=e.int().gte(100).lte(1e5).nullable();e.object({offlineAutoChargeEnabled:e.boolean().optional(),perTxOfflineCapCents:Ie.optional(),monthlyLimitCents:me.optional()});const Le=e.object({clientName:e.string().min(1),connectedAt:e.iso.datetime()});e.object({connections:e.array(Le)});const Re=e.object({consentId:e.string().min(1),app:e.object({id:e.string().min(1),name:e.string().min(1),logoUrl:e.url().nullable()}),monthlyLimitTronCents:e.int().gte(0).nullable(),monthSpentTronCents:e.int().gte(0),autoApproveEnabled:e.boolean()});e.object({authorizations:e.array(Re).max(200)}),e.object({monthlyTronLimitCents:he.optional(),autoApproveEnabled:e.boolean().optional()});const v=e.string().min(3).max(40).regex(/^[a-z0-9-]+$/),ze=e.object({appId:e.uuid(),name:e.string().min(1).max(80),slug:v,bannerUrl:e.url().nullable(),thumbnailUrl:e.url().nullable(),thumbnailVideoUrl:e.url().nullable(),categories:e.array(e.enum(`adventure.battle_royale.board.cards.casino.casual.fighting.idle.mmo.moba.platformer.prediction.puzzle.racing.rhythm.roguelike.rpg.rts.sandbox.shooter.simulation.sports.strategy.survival.tools.tower_defense.visual_novel.other`.split(`.`))),studio:e.object({name:e.string().min(1).max(80).nullable(),logoUrl:e.url().nullable()}).nullable(),firstPublishedAt:e.iso.datetime()}),Be=e.object({items:e.array(ze),nextBefore:e.iso.datetime().nullable()}),y=e.array(e.enum(`adventure.battle_royale.board.cards.casino.casual.fighting.idle.mmo.moba.platformer.prediction.puzzle.racing.rhythm.roguelike.rpg.rts.sandbox.shooter.simulation.sports.strategy.survival.tools.tower_defense.visual_novel.other`.split(`.`))).max(4),b=e.string().min(1).max(80),Ve=e.object({url:e.url().max(2048),caption:e.string().max(200).optional(),order:e.int().gte(0)}),x=e.array(Ve).max(6),He=e.object({heading:e.string().min(1).max(80),body:e.string().min(1).max(2e3),order:e.int().gte(0)}),S=e.array(He).max(8),Ue=e.object({label:e.string().min(1).max(40),url:e.url().max(2048),order:e.int().gte(0)}),C=e.array(Ue).max(10),We=e.object({ownerUserId:e.uuid().nullable(),name:e.string().nullable(),logoUrl:e.url().nullable(),websiteUrl:e.url().nullable(),xHandle:e.string().nullable(),githubUrl:e.url().nullable()}),w=e.array(e.enum([`web`,`ios`,`android`,`pc`,`playstation`,`xbox`,`switch`])).max(7),T=e.enum([`single_player`,`multiplayer`,`both`]).nullable(),Ge=e.enum([`everyone`,`13_plus`,`16_plus`,`18_plus`]).nullable(),Ke=e.array(e.enum([`en`,`es`,`fr`,`de`,`pt`,`it`,`ru`,`ja`,`ko`,`zh`,`hi`,`ar`,`tr`,`vi`,`id`,`th`,`pl`,`nl`])).max(18),qe=e.enum([`live`,`open_beta`,`coming_soon`]),Je=e.enum([`tron`,`onchain`,`both`]).nullable(),Ye=e.object({appId:e.uuid(),slug:v,appName:e.string(),appLogoUrl:e.url().nullable(),categories:y,tagline:b,bannerUrl:e.url().nullable(),playUrl:e.url().nullable(),discordUrl:e.url().nullable(),twitterUrl:e.url().nullable(),redditUrl:e.url().nullable(),telegramUrl:e.url().nullable(),gallery:x,chapters:S,links:C,studio:We,platforms:w,gameType:T,ageRating:Ge,languages:Ke,releaseStatus:qe,paymentsMode:Je,oauthScopes:e.array(e.string()),chains:e.array(e.string()),publishedAt:e.iso.datetime(),updatedAt:e.iso.datetime()}),Xe=e.enum([`overwhelmingly_positive`,`very_positive`,`positive`,`mostly_positive`,`mixed`,`mostly_negative`,`negative`,`overwhelmingly_negative`]).nullable(),Ze=e.object({count:e.int().gte(0),recommendedCount:e.int().gte(0),recommendedPct:e.number().gte(0).lte(100).nullable(),summaryLabel:Xe}),Qe=e.boolean(),$e=e.string().min(1).max(2e3),et=e.object({helpful:e.int().gte(0),unhelpful:e.int().gte(0),funny:e.int().gte(0)}),tt=e.object({userId:e.uuid(),handle:e.string().nullable(),name:e.string().min(1).max(80).nullable(),avatarUrl:e.url().nullable()}),nt=e.object({playtimeSecondsThisGame:e.int().gte(0),gamesPlayed:e.int().gte(0),reviewsWritten:e.int().gte(0)}),rt=e.string().min(1).max(2e3),it=e.object({body:rt,repliedAt:e.iso.datetime()}).nullable(),at=e.object({id:e.uuid(),recommended:Qe,body:$e,reactions:et,tippedCents:e.int().gte(0),commentCount:e.int().gte(0),author:tt,authorStats:nt,developerReply:it,createdAt:e.iso.datetime(),updatedAt:e.iso.datetime()}),ot=e.object({aggregate:Ze,reviews:e.array(at),total:e.int().gte(0),hasMore:e.boolean()}),st=e.enum([`newest`,`oldest`,`helpful`]).default(`newest`),ct=e.enum([`payment`,`reward`]).nullable(),lt=e.object({id:e.uuid(),recommended:Qe,body:$e,createdAt:e.iso.datetime(),updatedAt:e.iso.datetime()}).nullable(),ut=e.object({eligible:e.boolean(),eligibleVia:ct,review:lt,isAppOwner:e.boolean()});e.object({recommended:Qe,body:$e});const E=e.enum([`helpful`,`unhelpful`]).nullable(),dt=e.object({reviewId:e.uuid(),vote:E,funny:e.boolean()}),ft=e.object({reactions:e.array(dt)}),pt=e.object({reactions:et,vote:E,funny:e.boolean()});e.object({vote:E,funny:e.boolean()});const mt=e.object({status:e.enum([`completed`]),amountCents:e.int().gt(0),balanceCents:e.int().gte(0),tippedCents:e.int().gte(0)});e.object({amountCents:e.int().gt(0).lte(1e6),note:e.string().min(1).max(280).optional(),challengeId:e.uuid().optional(),signature:e.string().max(2e3).regex(/^0x[0-9a-fA-F]+$/).optional()});const ht=e.string().min(1).max(1e3),gt=e.object({id:e.uuid(),body:ht,author:tt,createdAt:e.iso.datetime()}),_t=e.object({comments:e.array(gt),total:e.int().gte(0),hasMore:e.boolean()}),vt=e.object({comment:gt,commentCount:e.int().gte(0)});e.object({body:ht});const yt=e.object({commentCount:e.int().gte(0)}),bt=e.object({developerReply:it});e.object({body:rt});const xt=e.object({created:e.boolean()}),St=e.enum([`abuse`,`inappropriate_content`,`cheating`,`spam`,`other`]);e.object({category:St,details:e.string().max(2e3).optional()});const Ct=e.enum([`open`,`acknowledged`,`dismissed`]),wt=e.object({id:e.uuid(),category:St,details:e.string().nullable(),status:Ct,acknowledgedAt:e.iso.datetime().nullable(),createdAt:e.iso.datetime()}),Tt=e.object({reports:e.array(wt),total:e.int().gte(0),hasMore:e.boolean()});e.object({status:e.enum([`acknowledged`,`dismissed`])});const Et=e.object({id:e.string().min(1),family:e.enum([`evm`,`solana`]),displayName:e.string().min(1),chainId:e.int().optional(),paymentRouter:e.string().optional(),paymentProgram:e.string().optional()}),Dt=e.object({chains:e.array(Et)}),Ot=e.object({id:e.string().regex(/^0x[0-9a-f]{32}$/),chain:e.string().min(1),chainId:e.int().gt(0),payer:e.string().regex(/^0x[0-9a-fA-F]{40}$/),amount:e.string().regex(/^\d+$/),token:e.string().regex(/^0x[0-9a-fA-F]{40}$/),vault:e.string().regex(/^0x[0-9a-fA-F]{40}$/),vaultKind:e.enum([`credit`,`platform`]),processorAddress:e.string().regex(/^0x[0-9a-fA-F]{40}$/).nullable(),grossAmount:e.string().regex(/^\d+$/),creditedAmount:e.string().regex(/^\d+$/),settlement:e.enum([`instant`,`locked`]).nullable(),appealable:e.boolean(),vaultReleaseAt:e.iso.datetime().nullable(),consolidatedAt:e.iso.datetime().nullable(),status:e.enum([`pending`,`completed`,`expired`]),txHash:e.string().regex(/^0x[0-9a-fA-F]{64}$/).nullable(),blockNumber:e.string().regex(/^\d+$/).nullable(),deadline:e.iso.datetime(),signedAt:e.iso.datetime(),completedAt:e.iso.datetime().nullable(),recipientApp:e.object({id:e.string().min(1),name:e.string().min(1),logoUrl:e.url().nullable()}).nullable()}),kt=e.object({payments:e.array(Ot),nextBefore:e.iso.datetime().nullable()}),At=e.object({kind:e.enum([`payment`]),groupId:e.string().min(1).nullable(),id:e.string().regex(/^0x[0-9a-f]{32}$/),chain:e.string().min(1),chainId:e.int().gt(0),occurredAt:e.iso.datetime(),role:e.enum([`outgoing`,`incoming`]),payer:e.string().regex(/^0x[0-9a-fA-F]{40}$/),beneficiary:e.string().regex(/^0x[0-9a-fA-F]{40}$/).nullable(),counterparty:e.string().regex(/^0x[0-9a-fA-F]{40}$/).nullable(),app:e.object({id:e.string().min(1),name:e.string().min(1),logoUrl:e.url().nullable(),slug:e.string().nullable(),bannerUrl:e.url().nullable()}).nullable(),beneficiaryApp:e.object({id:e.string().min(1),name:e.string().min(1),logoUrl:e.url().nullable(),slug:e.string().nullable(),bannerUrl:e.url().nullable()}).nullable(),amount:e.string().regex(/^\d+$/),token:e.string().regex(/^0x[0-9a-fA-F]{40}$/),vault:e.string().regex(/^0x[0-9a-fA-F]{40}$/),vaultKind:e.enum([`credit`,`platform`]),targetKind:e.enum([`credit`,`pot`]),processorAddress:e.string().regex(/^0x[0-9a-fA-F]{40}$/).nullable(),grossAmount:e.string().regex(/^\d+$/),creditedAmount:e.string().regex(/^\d+$/),settlement:e.enum([`instant`,`locked`]).nullable(),appealable:e.boolean(),disputableLegId:e.string().regex(/^0x[0-9a-f]{32}$/).nullable(),vaultReleaseAt:e.iso.datetime().nullable(),consolidatedAt:e.iso.datetime().nullable(),status:e.enum([`pending`,`completed`,`expired`]),txHash:e.string().regex(/^0x[0-9a-fA-F]{64}$/).nullable(),blockNumber:e.string().regex(/^\d+$/).nullable(),logIndex:e.int().gte(0).nullable(),metadata:_.nullish(),usdCents:e.int().gte(0).nullable()}),jt=e.object({kind:e.enum([`payment_withdrawal`]),groupId:e.string().min(1).nullable(),id:e.string().regex(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/),chain:e.string().min(1),occurredAt:e.iso.datetime(),role:e.enum([`incoming`]),beneficiary:e.string().regex(/^0x[0-9a-fA-F]{40}$/),counterparty:e.string().regex(/^0x[0-9a-fA-F]{40}$/),paymentId:e.string().regex(/^0x[0-9a-f]{32}$/).nullable(),vault:e.string().regex(/^0x[0-9a-fA-F]{40}$/),amount:e.string().regex(/^\d+$/),token:e.string().regex(/^0x[0-9a-fA-F]{40}$/),txHash:e.string().regex(/^0x[0-9a-fA-F]{64}$/),blockNumber:e.string().regex(/^\d+$/),logIndex:e.int().gte(0),usdCents:e.int().gte(0).nullable()}),Mt=e.object({kind:e.enum([`matured_withdrawal`]),groupId:e.string().min(1).nullable(),id:e.string().regex(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/),chain:e.string().min(1),occurredAt:e.iso.datetime(),role:e.enum([`incoming`]),beneficiary:e.string().regex(/^0x[0-9a-fA-F]{40}$/),counterparty:e.string().regex(/^0x[0-9a-fA-F]{40}$/),vault:e.string().regex(/^0x[0-9a-fA-F]{40}$/),amount:e.string().regex(/^\d+$/),token:e.string().regex(/^0x[0-9a-fA-F]{40}$/),txHash:e.string().regex(/^0x[0-9a-fA-F]{64}$/),blockNumber:e.string().regex(/^\d+$/),logIndex:e.int().gte(0),usdCents:e.int().gte(0).nullable()}),Nt=e.object({kind:e.enum([`payout_sent`]),groupId:e.string().min(1).nullable(),id:e.string().regex(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/),chain:e.string().min(1),occurredAt:e.iso.datetime(),role:e.enum([`incoming`]),recipient:e.string().regex(/^0x[0-9a-fA-F]{40}$/),counterparty:e.string().regex(/^0x[0-9a-fA-F]{40}$/),app:e.object({id:e.string().min(1),name:e.string().min(1),logoUrl:e.url().nullable(),slug:e.string().nullable(),bannerUrl:e.url().nullable()}).nullable(),vault:e.string().regex(/^0x[0-9a-fA-F]{40}$/),amount:e.string().regex(/^\d+$/),token:e.string().regex(/^0x[0-9a-fA-F]{40}$/),txHash:e.string().regex(/^0x[0-9a-fA-F]{64}$/),blockNumber:e.string().regex(/^\d+$/),logIndex:e.int().gte(0),metadata:_.nullish(),usdCents:e.int().gte(0).nullable()}),Pt=e.object({kind:e.enum([`credit_transferred`]),groupId:e.string().min(1).nullable(),id:e.string().regex(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/),chain:e.string().min(1),occurredAt:e.iso.datetime(),role:e.enum([`incoming`]),recipient:e.string().regex(/^0x[0-9a-fA-F]{40}$/),counterparty:e.string().regex(/^0x[0-9a-fA-F]{40}$/),app:e.object({id:e.string().min(1),name:e.string().min(1),logoUrl:e.url().nullable(),slug:e.string().nullable(),bannerUrl:e.url().nullable()}).nullable(),vault:e.string().regex(/^0x[0-9a-fA-F]{40}$/),amount:e.string().regex(/^\d+$/),token:e.string().regex(/^0x[0-9a-fA-F]{40}$/),txHash:e.string().regex(/^0x[0-9a-fA-F]{64}$/),blockNumber:e.string().regex(/^\d+$/),logIndex:e.int().gte(0),usdCents:e.int().gte(0).nullable()}),Ft=e.object({kind:e.enum([`pot_leg`]),groupId:e.string().min(1).nullable(),id:e.string().regex(/^0x[0-9a-f]{32}$/),chain:e.string().min(1),occurredAt:e.iso.datetime(),role:e.enum([`incoming`]),beneficiary:e.string().regex(/^0x[0-9a-fA-F]{40}$/),distributionId:e.string().regex(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/).nullable(),vault:e.string().regex(/^0x[0-9a-fA-F]{40}$/).nullable(),amount:e.string().regex(/^\d+$/),token:e.string().regex(/^0x[0-9a-fA-F]{40}$/),settlement:e.enum([`instant`,`locked`]),releaseAt:e.iso.datetime().nullable(),claimedAt:e.iso.datetime().nullable(),txHash:e.string().regex(/^0x[0-9a-fA-F]{64}$/).nullable(),blockNumber:e.string().regex(/^\d+$/).nullable(),logIndex:e.int().gte(0).nullable(),metadata:_.nullish(),usdCents:e.int().gte(0).nullable()}),It=e.object({kind:e.enum([`payment_autoclaim`]),groupId:e.string().min(1).nullable(),id:e.string().regex(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/),chain:e.string().min(1),occurredAt:e.iso.datetime(),role:e.enum([`incoming`]),beneficiary:e.string().regex(/^0x[0-9a-fA-F]{40}$/),paymentId:e.string().regex(/^0x[0-9a-f]{32}$/).nullable(),vault:e.string().regex(/^0x[0-9a-fA-F]{40}$/),token:e.string().regex(/^0x[0-9a-fA-F]{40}$/),autoclaimKind:e.enum([`withdraw_matured`,`withdraw_escrow`,`claim_refund`]),status:e.enum([`pending`,`in_flight`,`succeeded`,`skipped`,`failed`]),attempts:e.int().gte(0),lastError:e.string().nullable(),txHash:e.string().regex(/^0x[0-9a-fA-F]{64}$/).nullable(),settledAt:e.iso.datetime().nullable()}),Lt=e.object({kind:e.enum([`appeal`]),groupId:e.string().min(1).nullable(),id:e.string().regex(/^0x[0-9a-f]{32}$/),chain:e.string().min(1),occurredAt:e.iso.datetime(),role:e.enum([`outgoing`]),appellant:e.string().regex(/^0x[0-9a-fA-F]{40}$/),counterparty:e.string().regex(/^0x[0-9a-fA-F]{40}$/),paymentId:e.string().regex(/^0x[0-9a-f]{32}$/).nullable(),vault:e.string().regex(/^0x[0-9a-fA-F]{40}$/),amount:e.string().regex(/^\d+$/),token:e.string().regex(/^0x[0-9a-fA-F]{40}$/),status:e.enum([`pending_onchain`,`open`,`resolved_refund`,`resolved_dismiss`,`cancelled`,`force_cancelled`]),txHash:e.string().regex(/^0x[0-9a-fA-F]{64}$/).nullable(),blockNumber:e.string().regex(/^\d+$/).nullable(),logIndex:e.int().gte(0).nullable(),resolvedAt:e.iso.datetime().nullable(),refundClaimedAt:e.iso.datetime().nullable(),hasRoom:e.boolean(),resolution:e.object({resolutionId:e.string().regex(/^0x[0-9a-f]{32}$/),outcome:e.int().gte(0).lte(1),deadline:e.int().gte(0),signature:e.string().regex(/^0x[0-9a-fA-F]{130}$/)}).nullable(),usdCents:e.int().gte(0).nullable()}),Rt=e.object({kind:e.enum([`moonpay_buy`]),groupId:e.string().min(1).nullable(),id:e.string().regex(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/),occurredAt:e.iso.datetime(),role:e.enum([`incoming`]),walletAddress:e.string().regex(/^0x[0-9a-fA-F]{40}$/),externalId:e.string().min(1),fiatAmountCents:e.int().gte(0),fiatCurrency:e.string().min(1),cryptoAmount:e.string().regex(/^\d+$/),cryptoToken:e.string().regex(/^0x[0-9a-fA-F]{40}$/),cryptoTxHash:e.string().regex(/^0x[0-9a-fA-F]{64}$/).nullable(),status:e.enum([`pending`,`completed`,`failed`])}),zt=e.object({kind:e.enum([`moonpay_sell`]),groupId:e.string().min(1).nullable(),id:e.string().regex(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/),occurredAt:e.iso.datetime(),role:e.enum([`outgoing`]),walletAddress:e.string().regex(/^0x[0-9a-fA-F]{40}$/),externalId:e.string().min(1),fiatAmountCents:e.int().gte(0),fiatCurrency:e.string().min(1),cryptoAmount:e.string().regex(/^\d+$/),cryptoToken:e.string().regex(/^0x[0-9a-fA-F]{40}$/),cryptoTxHash:e.string().regex(/^0x[0-9a-fA-F]{64}$/).nullable(),status:e.enum([`pending`,`completed`,`failed`])}),Bt=e.object({kind:e.enum([`tron_deposit`]),groupId:e.string().min(1).nullable(),id:e.string().regex(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/),occurredAt:e.iso.datetime(),role:e.enum([`incoming`]),amountCents:e.int().gt(0),status:e.enum([`completed`,`disputed`,`clawed_back`]),receiptUrl:e.url().nullable(),paymentIntentId:e.string().min(1).nullable()}),Vt=e.object({userId:e.string().regex(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/),handle:e.string().nullable(),displayName:e.string().nullable(),role:e.enum([`stake`,`payout`,`dev_cut`,`purchase`,`referral`]),amountCents:e.int()}),Ht=e.object({kind:e.enum([`tron_pot`]),groupId:e.string().min(1).nullable(),id:e.string().regex(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/),occurredAt:e.iso.datetime(),role:e.enum([`incoming`,`outgoing`]),leg:e.enum([`stake`,`payout`,`dev_cut`,`purchase`,`referral`]),amountCents:e.int().gt(0),usdCents:e.int(),status:e.enum([`settled`]),app:e.object({id:e.string().min(1),name:e.string().min(1),logoUrl:e.url().nullable(),slug:e.string().nullable(),bannerUrl:e.url().nullable()}).nullable(),involvedUsers:e.array(Vt).nullish(),metadata:_.nullish()}),Ut=e.object({kind:e.enum([`tron_cashout`]),groupId:e.string().min(1).nullable(),id:e.string().regex(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/),occurredAt:e.iso.datetime(),role:e.enum([`outgoing`]),method:e.enum([`stripe`,`usdc`]),amountCents:e.int().gt(0),feeCents:e.int().gte(0),destinationAddress:e.string().regex(/^0x[0-9a-fA-F]{40}$/).nullable(),chain:e.string().min(1).nullable(),txHash:e.string().regex(/^0x[0-9a-fA-F]{64}$/).nullable(),status:e.enum([`pending`,`approved`,`rejected`,`settled`,`failed`]),stripeTransferId:e.string().min(1).nullable(),rejectionReason:e.string().min(1).nullable(),settledAt:e.iso.datetime().nullable()}),Wt=e.object({kind:e.enum([`tron_transfer`]),groupId:e.string().min(1).nullable(),id:e.string().regex(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/),occurredAt:e.iso.datetime(),role:e.enum([`incoming`,`outgoing`]),amountCents:e.int().gt(0),usdCents:e.int(),status:e.enum([`settled`]),counterpartyUserId:e.string().regex(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/).nullable(),counterpartyHandle:e.string().nullable(),counterpartyDisplayName:e.string().nullable(),note:e.string().nullable()}),Gt=e.object({kind:e.enum([`referral_earning`]),groupId:e.string().min(1).nullable(),id:e.string().regex(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/),chain:e.string().min(1),occurredAt:e.iso.datetime(),role:e.enum([`incoming`]),referralAddress:e.string().regex(/^0x[0-9a-fA-F]{40}$/),paymentId:e.string().regex(/^0x[0-9a-f]{32}$/).nullable(),token:e.string().regex(/^0x[0-9a-fA-F]{40}$/),amount:e.string().regex(/^\d+$/),reversed:e.boolean(),txHash:e.string().regex(/^0x[0-9a-fA-F]{64}$/),logIndex:e.int().gte(0),usdCents:e.int().gte(0).nullable()}),Kt=e.object({kind:e.enum([`nft_charge`]),groupId:e.string().min(1).nullable(),id:e.string().regex(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/),occurredAt:e.iso.datetime(),role:e.enum([`outgoing`]),chargeKind:e.enum([`registration`,`mint`,`transfer_gas`]),amountCents:e.int().gt(0),usdCents:e.int(),status:e.enum([`settled`]),collectionAddress:e.string().regex(/^0x[0-9a-fA-F]{40}$/).nullable(),tokenId:e.string().nullable(),counterpartyUserId:e.string().regex(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/).nullable(),counterpartyHandle:e.string().nullable(),counterpartyDisplayName:e.string().nullable()}),qt=e.discriminatedUnion(`kind`,[At.extend({kind:e.literal(`payment`)}),jt.extend({kind:e.literal(`payment_withdrawal`)}),Mt.extend({kind:e.literal(`matured_withdrawal`)}),Nt.extend({kind:e.literal(`payout_sent`)}),Pt.extend({kind:e.literal(`credit_transferred`)}),Ft.extend({kind:e.literal(`pot_leg`)}),It.extend({kind:e.literal(`payment_autoclaim`)}),Lt.extend({kind:e.literal(`appeal`)}),Rt.extend({kind:e.literal(`moonpay_buy`)}),zt.extend({kind:e.literal(`moonpay_sell`)}),Bt.extend({kind:e.literal(`tron_deposit`)}),Ht.extend({kind:e.literal(`tron_pot`)}),Ut.extend({kind:e.literal(`tron_cashout`)}),Wt.extend({kind:e.literal(`tron_transfer`)}),Gt.extend({kind:e.literal(`referral_earning`)}),Kt.extend({kind:e.literal(`nft_charge`)})]),D=e.object({rows:e.array(qt),nextBefore:e.iso.datetime().nullable(),nextCursor:e.string().nullable(),hasHidden:e.boolean()}),Jt=e.object({chain:e.string().min(1),token:e.string().regex(/^0x[0-9a-fA-F]{40}$/),creditedWei:e.string().regex(/^\d+$/),drainedWei:e.string().regex(/^\d+$/),outstandingWei:e.string().regex(/^\d+$/)}),Yt=e.object({rows:e.array(Jt)}),Xt=e.object({enabled:e.boolean(),direction:e.enum([`buy`,`sell`,`both`]).nullable(),countryCode:e.string().regex(/^[A-Z]{2}$/).nullable(),regionSupported:e.boolean()}),Zt=e.object({url:e.url(),intentId:e.string().min(1),expiresAt:e.iso.datetime(),walletAddress:e.string().regex(/^0x[0-9a-fA-F]{40}$/)});e.object({intentId:e.string().min(1)});const Qt=e.object({url:e.url(),transactionId:e.uuid(),walletAddress:e.string().regex(/^0x[0-9a-fA-F]{40}$/)});e.object({usdcAmount:e.string().regex(/^\d+$/),chain:e.string().min(1).optional()});const $t=e.object({enabled:e.boolean(),balanceCents:e.int().gte(0),frozenCents:e.int().gte(0),currency:e.enum([`tron`]),flagged:e.boolean(),minDepositCents:e.int().gt(0),maxDepositCents:e.int().gt(0)}),en=e.object({id:e.uuid(),kind:e.enum([`deposit`,`pot_stake`,`pot_payout`,`dev_earning`,`cashout_hold`,`cashout_release`,`dispute_freeze`,`dispute_unfreeze`,`hosted_billing`,`store_purchase`,`referral_earning`,`peer_transfer`,`nft_registration`,`nft_mint`,`nft_gas`]),amountCents:e.int(),currency:e.string().min(1),createdAt:e.iso.datetime()}),tn=e.object({entries:e.array(en).max(100),nextBefore:e.iso.datetime().nullable()}),nn=e.object({clientSecret:e.string().min(1),publishableKey:e.string().min(1),amountCents:e.int().gt(0),currency:e.string().min(1),depositId:e.uuid()});e.object({amountCents:e.int().gt(0).lte(1e6)});const rn=e.object({status:e.enum([`completed`]),amountCents:e.int().gt(0),balanceCents:e.int().gte(0),recipient:e.object({userId:e.uuid(),handle:e.string().nullable(),displayName:e.string().nullable()})});e.object({recipientUserId:e.uuid(),amountCents:e.int().gt(0).lte(1e6),note:e.string().min(1).max(280).optional(),challengeId:e.uuid().optional(),signature:e.string().max(2e3).regex(/^0x[0-9a-fA-F]+$/).optional(),threadId:e.uuid().optional()});const an=e.object({requireSignature:e.boolean()}),on=e.object({required:e.literal(!1)}),sn=e.object({required:e.literal(!0),challengeId:e.uuid(),message:e.string(),expiresAt:e.iso.datetime()}),cn=e.discriminatedUnion(`required`,[on.extend({required:e.literal(!1)}),sn.extend({required:e.literal(!0)})]);e.object({recipientUserId:e.uuid(),amountCents:e.int().gt(0).lte(1e6)}),e.object({balanceCents:e.int().gte(0),rakeBps:e.int().gte(0).lte(3e3)});const ln=e.object({status:e.enum([`completed`]),potId:e.string().regex(/^0x[0-9a-f]{32}$/),balanceCents:e.int().gte(0)}),un=e.object({status:e.enum([`insufficient_balance`]),potId:e.string().regex(/^0x[0-9a-f]{32}$/),balanceCents:e.int().gte(0)}),dn=e.object({status:e.enum([`redirect`]),intentId:e.string().min(1),redirectUrl:e.url(),amountCents:e.int().gt(0),potId:e.string().regex(/^0x[0-9a-f]{32}$/)});e.discriminatedUnion(`status`,[ln.extend({status:e.literal(`completed`)}),un.extend({status:e.literal(`insufficient_balance`)}),dn.extend({status:e.literal(`redirect`)})]),e.object({potId:e.string().regex(/^0x[0-9a-f]{32}$/),amountCents:e.int().gt(0),returnUri:e.url(),metadata:_.optional()});const fn=e.object({status:e.enum([`completed`]),balanceCents:e.int().gte(0)}),pn=e.object({status:e.enum([`insufficient_balance`]),balanceCents:e.int().gte(0)}),mn=e.object({status:e.enum([`redirect`]),intentId:e.string().min(1),redirectUrl:e.url(),amountCents:e.int().gt(0)});e.discriminatedUnion(`status`,[fn.extend({status:e.literal(`completed`)}),pn.extend({status:e.literal(`insufficient_balance`)}),mn.extend({status:e.literal(`redirect`)})]),e.object({amountCents:e.int().gt(0),returnUri:e.url(),metadata:_.optional()}),e.object({intentId:e.string().min(1),consentId:e.string().min(1),app:e.object({id:e.string().min(1),name:e.string().min(1),logoUrl:e.url().nullable()}),amountCents:e.int().gt(0),kind:e.enum([`pot_stake`,`store_purchase`]),potId:e.string().nullable(),monthlyLimitTronCents:e.int().gte(0).nullable(),monthSpentTronCents:e.int().gte(0),autoApproveEnabled:e.boolean(),balanceCents:e.int().gte(0),returnUriHost:e.string().min(1),status:e.enum([`pending`]),expiresAt:e.iso.datetime(),environment:e.enum([`development`,`production`])});const hn=e.object({status:e.enum([`redirect`]),redirect:e.url()}),gn=e.object({status:e.enum([`insufficient_balance`]),balanceCents:e.int().gte(0)});e.discriminatedUnion(`status`,[hn.extend({status:e.literal(`redirect`)}),gn.extend({status:e.literal(`insufficient_balance`)})]),e.object({status:e.enum([`distributed`,`replayed`]),potId:e.string().regex(/^0x[0-9a-f]{32}$/),potBalanceCents:e.int().gte(0)}),e.object({potId:e.string().regex(/^0x[0-9a-f]{32}$/),legs:e.array(e.object({recipientUserId:e.uuid(),amountCents:e.int().gt(0)})).max(64),rakeBps:e.int().gte(0).lte(1e4).optional(),devCutCents:e.int().gte(0).optional().default(0),closePot:e.boolean().optional().default(!0),metadata:_.optional()});const _n=e.object({url:e.url()}),vn=e.object({id:e.uuid(),method:e.enum([`stripe`,`usdc`]),status:e.enum([`pending`,`approved`,`rejected`,`settled`,`failed`]),amountCents:e.int().gt(0),feeCents:e.int().gte(0),currency:e.string().min(1),destinationAddress:e.string().regex(/^0x[0-9a-fA-F]{40}$/).nullable(),chain:e.string().min(1).nullable(),txHash:e.string().min(1).nullable(),rejectionReason:e.string().min(1).nullable(),createdAt:e.iso.datetime(),settledAt:e.iso.datetime().nullable()});e.object({method:e.enum([`stripe`,`usdc`]),amountCents:e.int().gt(0),chain:e.string().min(1).optional()});const yn=e.object({requests:e.array(vn).max(100)}),O=e.object({id:e.uuid(),method:e.enum([`stripe`,`usdc`]),status:e.enum([`pending`,`approved`,`rejected`,`settled`,`failed`]),amountCents:e.int().gt(0),feeCents:e.int().gte(0),currency:e.string().min(1),destinationAddress:e.string().regex(/^0x[0-9a-fA-F]{40}$/).nullable(),chain:e.string().min(1).nullable(),txHash:e.string().min(1).nullable(),rejectionReason:e.string().min(1).nullable(),createdAt:e.iso.datetime(),settledAt:e.iso.datetime().nullable(),userId:e.uuid(),requestIdHex:e.string().regex(/^0x[0-9a-f]{32}$/).nullable(),usdcAmount:e.string().regex(/^\d+$/).nullable(),backendSignature:e.string().regex(/^0x[0-9a-f]+$/).nullable(),signatureDeadline:e.iso.datetime().nullable(),poolAddress:e.string().regex(/^0x[0-9a-fA-F]{40}$/).nullable()}),bn=e.object({requests:e.array(O).max(100)});e.object({reason:e.string().min(1).max(500)});const xn=e.array(e.object({id:e.enum([`ethereum-mainnet`,`base-mainnet`,`ethereum-sepolia`]),displayName:e.string().min(1),chainId:e.int().gt(0)})),k=e.string().min(1).max(24).regex(/^[a-z0-9]+$/).nullable(),Sn=e.object({id:e.string().min(1),name:e.string().min(1),deletedAt:e.iso.datetime().nullable()}).nullable(),A=e.object({native:e.string().regex(/^\d+(?:\.\d+)?$/),usdc:e.string().regex(/^\d+(?:\.\d+)?$/).optional()}),Cn=e.object({"ethereum-mainnet":A.optional(),"base-mainnet":A.optional(),"ethereum-sepolia":A.optional()}),wn=e.enum([`infinite`,`custom`,`scoped`]).nullable(),Tn=e.object({native:e.string().regex(/^\d+$/),usdc:e.string().regex(/^\d+$/)}).nullable(),En=e.object({mode:wn,caps:Tn,policyId:e.string().min(1).nullable()}),Dn=e.object({address:e.string().regex(/^0x[0-9a-fA-F]{40}$/),label:k,kind:e.enum([`personal`,`app`]),app:Sn,balances:Cn,delegation:En}),On=e.object({chains:xn,wallets:e.array(Dn)}),kn=e.object({address:e.string().regex(/^0x[0-9a-fA-F]{40}$/),label:k});e.object({label:k});const An=e.object({policyId:e.string().min(1).nullable()});e.union([e.object({mode:e.enum([`infinite`])}),e.object({mode:e.enum([`custom`]),caps:Tn}),e.object({mode:e.enum([`scoped`])})]);const jn=e.object({ok:e.literal(!0)});e.object({name:l.optional(),displayName:re.optional(),bio:e.string().min(1).max(256).nullish(),websiteUrl:ae.optional(),banner:oe.optional(),presenceStatusMode:se.optional(),environmentViewMode:ce.optional()});const Mn=e.object({id:e.string().min(1),title:e.string().max(500),gifUrl:e.url(),previewUrl:e.url(),width:e.int().gt(0),height:e.int().gt(0)}),Nn=e.object({results:e.array(Mn)}),j=e.object({id:e.string().min(1),name:e.string().min(1),displayName:e.string().nullable(),image:e.url().nullable()}),M=e.object({v:e.literal(1),alg:e.enum([`x25519-ecdh-hkdf-sha256-aes256gcm`]),senderPubKey:e.string().length(43).regex(/^[A-Za-z0-9_-]+$/),senderKeyId:e.string().min(1).max(128),recipientKeyId:e.string().min(1).max(128),iv:e.string().max(64).regex(/^[A-Za-z0-9_-]+$/),ct:e.string().max(16384).regex(/^[A-Za-z0-9_-]+$/)}).nullable(),Pn=e.object({kind:e.enum([`tron_transfer`]),amountCents:e.int().gt(0),recipientUserId:e.string().min(1)}),Fn=e.object({kind:e.enum([`nft_transfer`]),recipientUserId:e.string().min(1),collectionAddress:e.string().min(1),tokenId:e.string().min(1),amount:e.string().min(1),itemName:e.string().nullable(),imageAssetId:e.string().nullish()}),In=e.object({id:e.string().min(1),senderUserId:e.string().min(1),body:e.string().max(2e3),envelope:M.optional(),attachment:e.object({url:e.url(),count:e.int().gt(0)}).nullable(),transaction:e.union([Pn,Fn]).nullish(),sentAt:e.iso.datetime()}).nullable(),Ln=e.object({kind:e.enum([`direct`]),id:e.string().min(1),otherParticipant:j,lastMessage:In,unreadCount:e.int().gte(0),pinnedAt:e.iso.datetime().nullable(),createdAt:e.iso.datetime()}),N=e.string().min(1).max(80).regex(/^\S(?:.*\S)?$/),P=e.string().max(500).nullable(),Rn=e.url().max(2048).nullable(),F=e.enum([`admin`,`member`]),zn=e.object({id:e.string().min(1),name:e.string().min(1),displayName:e.string().nullable(),image:e.url().nullable(),role:F}),Bn=e.object({kind:e.enum([`group`]),id:e.string().min(1),title:N,description:P,logoUrl:Rn,participants:e.array(zn),myRole:F,lastMessage:In,unreadCount:e.int().gte(0),pinnedAt:e.iso.datetime().nullable(),createdAt:e.iso.datetime()}),I=e.discriminatedUnion(`kind`,[Ln.extend({kind:e.literal(`direct`)}),Bn.extend({kind:e.literal(`group`)})]),Vn=e.object({threads:e.array(I)});e.object({thread:I,created:e.boolean()});const Hn=e.object({kind:e.enum([`direct`]).optional().default(`direct`),recipientUserId:e.string().min(1)}),Un=e.object({kind:e.enum([`group`]),title:N,description:P.optional(),invitedUserIds:e.array(e.string().min(1)).min(1).max(100)}),L=e.object({ok:e.literal(!0)}),R=e.object({thread:Bn});e.object({title:N.optional(),description:P.optional()});const Wn=e.object({id:e.string().min(1),senderUserId:e.string().min(1),body:e.string().max(2e3).nullable(),envelope:M.optional()}).nullable(),z=e.enum([`👍`,`👎`,`❤️`,`😂`,`😮`,`😢`,`🔥`,`🎉`,`🙏`,`👀`,`✅`,`🎮`]),Gn=e.object({emoji:z,count:e.int().gt(0),userIds:e.array(e.string().min(1))}),Kn=e.enum([`image`]),B=e.object({id:e.string().min(1),kind:Kn,url:e.url(),contentType:e.string().min(1),fileName:e.string().min(1),byteSize:e.int().gte(0),width:e.int().gt(0).nullable(),height:e.int().gt(0).nullable()}),qn=e.object({url:e.url(),title:e.string().max(500).nullable(),description:e.string().max(1e3).nullable(),imageUrl:e.url().nullable(),siteName:e.string().max(200).nullable()}),Jn=e.object({id:e.string().min(1),threadId:e.string().min(1),senderUserId:e.string().min(1),transaction:e.union([Pn,Fn]).nullish(),body:e.string().max(2e3),envelope:M.optional(),sentAt:e.iso.datetime(),editedAt:e.iso.datetime().nullable(),deletedAt:e.iso.datetime().nullable(),replyTo:Wn,reactions:e.array(Gn),attachments:e.array(B),linkPreviews:e.array(qn)}),Yn=e.object({messages:e.array(Jn),nextBefore:e.iso.datetime().nullable()}),Xn=e.string().max(2e3);e.object({body:Xn.optional(),envelope:M.optional(),replyToMessageId:e.string().min(1).optional(),attachmentIds:e.array(e.string().min(1)).max(3).optional()});const Zn=e.string().min(1).max(2e3);e.object({body:Zn.optional(),envelope:M.optional()});const Qn=e.object({aggregate:Gn.nullable()}),V=e.object({attachment:B});e.object({userIds:e.array(e.string().min(1)).min(1).max(100)});const $n=e.object({pinnedAt:e.iso.datetime()}),er=e.enum([`x25519`]),tr=e.object({userId:e.string().min(1),keyId:e.string().min(1).max(128),publicKey:e.string().length(43).regex(/^[A-Za-z0-9_-]+$/),algorithm:er}),nr=e.object({key:tr});e.object({publicKey:e.string().length(43).regex(/^[A-Za-z0-9_-]+$/),keyId:e.string().min(1).max(128),algorithm:er});const rr=e.object({threadId:e.string().min(1),key:tr.nullable()}),ir=e.object({keys:e.array(rr)});e.object({threadIds:e.array(e.string().min(1)).min(1).max(200)});const ar=e.object({exists:e.boolean(),attemptsRemaining:e.int().gte(0),kdfSalt:e.string().length(22).regex(/^[A-Za-z0-9_-]+$/).nullable(),kdfIterations:e.int().gte(1e5).lte(5e6).nullable()}),or=e.object({ok:e.literal(!0)});e.object({scalar:e.string().length(43).regex(/^[A-Za-z0-9_-]+$/),secret:e.string().length(43).regex(/^[A-Za-z0-9_-]+$/),pinKey:e.string().length(43).regex(/^[A-Za-z0-9_-]+$/),kdfSalt:e.string().length(22).regex(/^[A-Za-z0-9_-]+$/),kdfIterations:e.int().gte(1e5).lte(5e6)});const sr=e.union([e.object({result:e.enum([`ok`]),scalar:e.string().length(43).regex(/^[A-Za-z0-9_-]+$/)}),e.object({result:e.enum([`wrong-pin`]),attemptsRemaining:e.int().gte(0)})]);e.object({pinKey:e.string().length(43).regex(/^[A-Za-z0-9_-]+$/)}),e.object({role:F});const H=e.object({name:e.string().nullable(),handle:e.string().nullable()}).nullable(),cr=e.object({chain:e.string().min(1),token:e.string().regex(/^0x[0-9a-fA-F]{40}$/),amount:e.string().regex(/^\d+$/),usdCents:e.int().nullable()}),lr=e.object({code:e.string().nullable(),xLinked:e.boolean(),referrer:H,refereeCount:e.int().gte(0),lifetimeEarnings:e.array(cr),lifetimeUsdCents:e.int().nullable(),last30dEarnings:e.array(cr),last30dUsdCents:e.int().nullable()}),ur=e.object({code:e.string().min(1),generatedAt:e.iso.datetime()}),dr=e.object({status:e.enum([`eligible`,`already-referred`,`self-referral`,`unknown-code`,`revoked-code`,`window-expired`]),referrer:H}),fr=e.object({status:e.enum([`bound`,`already-referred`,`self-referral`,`unknown-code`,`revoked-code`,`window-expired`]),referrer:H});e.object({code:e.string().min(1).max(64),source:e.enum([`signup-url`,`manual-claim`,`cookie-restore`]).optional().default(`manual-claim`)});const U=e.string().regex(/^[a-f0-9]{64}$/);e.object({playSessionId:U,expiresAt:e.iso.datetime()});const W=e.uuid();e.object({appId:W});const pr=e.object({ok:e.literal(!0),ttlSeconds:e.int().gt(0)});e.object({playSessionId:U,status:e.enum([`pending`,`active`,`ended`])});const mr=e.uuid();e.object({playSessionId:U,userId:mr}),e.object({status:e.enum([`pending`,`active`,`ended`])}),e.object({playSessionId:U}),e.object({status:e.enum([`ended`])}),e.object({playSessionId:U});const hr=e.object({appId:W,name:e.string(),logoUrl:e.string().nullable(),sessionCount:e.int().gte(0),totalDurationSeconds:e.int().gte(0)}),gr=e.object({apps:e.array(hr),totalSessionCount:e.int().gte(0),totalDurationSeconds:e.int().gte(0)}),_r=e.object({date:e.string().regex(/^\d{4}-\d{2}-\d{2}$/),appId:W,sessionCount:e.int().gte(0),totalDurationSeconds:e.int().gte(0)}),vr=e.object({from:e.string().regex(/^\d{4}-\d{2}-\d{2}$/),to:e.string().regex(/^\d{4}-\d{2}-\d{2}$/),buckets:e.array(_r)});e.object({appId:W,sessionCount:e.int().gte(0),uniquePlayerCount:e.int().gte(0),totalDurationSeconds:e.int().gte(0)});const yr=e.object({followers:e.int().gte(0),following:e.int().gte(0),gamesPlayed:e.int().gte(0),totalPlaytimeSeconds:e.int().gte(0),reviewsLeft:e.int().gte(0),rewardsWon:e.int().gte(0),rewardsValueUsdCents:e.int().gte(0)}),br=e.object({date:e.string().regex(/^\d{4}-\d{2}-\d{2}$/),rewardsWon:e.int().gte(0),valueUsdCents:e.int().gte(0)}),xr=e.object({from:e.string().regex(/^\d{4}-\d{2}-\d{2}$/),to:e.string().regex(/^\d{4}-\d{2}-\d{2}$/),totalRewardsWon:e.int().gte(0),totalValueUsdCents:e.int().gte(0),buckets:e.array(br)}),Sr=e.object({collectionId:e.string(),collectionAddress:e.string(),chain:e.string(),kind:e.enum([`erc721`,`erc1155`]),tokenId:e.string(),amount:e.string(),name:e.string().nullable(),description:e.string().nullable(),imageAssetId:e.string().nullable(),bannerAssetId:e.string().nullable(),devMetadata:e.record(e.string(),e.unknown()),appId:e.string().nullable(),appName:e.string().nullable(),appLogoUrl:e.string().nullable()}),Cr=e.object({items:e.array(Sr)}),wr=e.object({id:e.string(),appId:e.string(),itemId:e.string(),amount:e.string(),priceCents:e.int().gte(0).nullable(),gasSponsored:e.boolean(),environment:e.enum([`development`,`production`]),createdAt:e.iso.datetime(),tokenId:e.string(),name:e.string().nullable(),description:e.string().nullable(),imageAssetId:e.string().nullable(),chain:e.string(),collectionAddress:e.string(),kind:e.enum([`erc721`,`erc1155`])}),Tr=e.object({permits:e.array(wr)}),Er=e.object({mintRequestId:e.string(),txHash:e.string(),status:e.enum([`submitted`,`completed`]),mintedTokenId:e.string().nullable()}),Dr=e.object({mint:Er,charge:e.object({currency:e.enum([`tron`]),gasCents:e.int().gte(0),priceCents:e.int().gte(0),totalCents:e.int().gte(0),gasPaidBy:e.enum([`user`,`developer`])})});e.object({name:e.string(),description:e.string().optional(),image:e.string().optional(),banner_image:e.string().optional(),external_link:e.string().optional()});const Or=e.object({trait_type:e.string(),value:e.union([e.string(),e.number(),e.boolean()])});e.object({name:e.string(),description:e.string().optional(),image:e.string().optional(),attributes:e.array(Or),extra:e.record(e.string(),e.record(e.string(),e.unknown()))}),e.object({collectionAddress:e.string().regex(/^0x[0-9a-fA-F]{40}$/),chain:e.string().min(1),toWallet:e.string().regex(/^0x[0-9a-fA-F]{40}$/).optional(),toUserId:e.string().optional(),tokenId:e.string().regex(/^\d+$/).optional(),amount:e.string().regex(/^\d+$/).optional()});const kr=e.object({id:e.string(),chain:e.string(),collectionAddress:e.string(),kind:e.enum([`erc721`,`erc1155`]),name:e.string().nullable(),environment:e.enum([`development`,`production`])}),Ar=e.object({collections:e.array(kr)}),jr=e.object({itemCount:e.int().gt(0),baselineUsdCents:e.int().gte(0),gasUsdCents:e.int().gte(0),tron:e.object({baselineCents:e.int().gte(0),gasCents:e.int().gte(0),totalCents:e.int().gte(0)}),eth:e.object({baselineWei:e.string().regex(/^\d+$/),gasWei:e.string().regex(/^\d+$/),totalWei:e.string().regex(/^\d+$/)})}),Mr=e.enum([`capped`,`flexible`,`unlimited`]),Nr=e.object({name:e.string().min(1).max(120).nullish(),description:e.string().max(2e3).nullish(),devMetadata:e.record(e.string(),e.unknown()).optional(),supplyType:Mr.optional(),maxSupply:e.string().regex(/^\d+$/).nullish(),active:e.boolean().optional()});e.object({collectionAddress:e.string().regex(/^0x[0-9a-fA-F]{40}$/),chain:e.string().min(1),items:e.array(Nr).min(1).max(50)});const G=e.object({id:e.string(),collectionId:e.string(),collectionAddress:e.string(),chain:e.string(),kind:e.enum([`erc721`,`erc1155`]),tokenId:e.string(),name:e.string().nullable(),description:e.string().nullable(),imageAssetId:e.string().nullable(),bannerAssetId:e.string().nullable(),devMetadata:e.record(e.string(),e.unknown()),supplyType:Mr.nullable(),maxSupply:e.string().nullable(),active:e.boolean()}),Pr=e.object({items:e.array(G),charge:e.object({currency:e.enum([`tron`]),amountCents:e.int().gte(0),baselineCents:e.int().gte(0),gasCents:e.int().gte(0),addItemTxHash:e.string()})}),Fr=e.object({items:e.array(G)}),Ir=e.object({id:e.string(),appId:e.string(),itemId:e.string(),userId:e.string(),amount:e.string(),priceCents:e.int().gte(0).nullable(),gasSponsored:e.boolean(),status:e.enum([`pending`,`redeemed`,`revoked`]),createdAt:e.iso.datetime()});e.object({toUserId:e.string().min(1),amount:e.string().regex(/^\d+$/).optional(),priceCents:e.int().gte(0).nullish(),gasSponsored:e.boolean().optional()});const Lr=e.object({holderCount:e.int().gte(0),walletCount:e.int().gte(0),totalHeld:e.string().regex(/^\d+$/)}),Rr=e.object({walletAddress:e.string(),userId:e.string().nullable(),amount:e.string().regex(/^\d+$/)}),zr=e.object({stats:Lr,holders:e.array(Rr)}),Br=e.object({id:e.string(),appId:e.string(),itemId:e.string(),userId:e.string(),direction:e.enum([`vault_in`,`withdraw`]),lockKind:e.enum([`vault`,`burn`]).nullable(),amount:e.string(),gasSponsored:e.boolean(),status:e.enum([`pending`,`redeemed`,`revoked`]),custodyId:e.string().nullable(),createdAt:e.iso.datetime()});e.object({toUserId:e.string().min(1),lockKind:e.enum([`vault`,`burn`]),amount:e.string().regex(/^\d+$/).optional(),gasSponsored:e.boolean().optional()}),e.object({custodyId:e.string().min(1)});const Vr=e.object({id:e.string(),appId:e.string(),itemId:e.string(),direction:e.enum([`vault_in`,`withdraw`]),lockKind:e.enum([`vault`,`burn`]).nullable(),amount:e.string(),gasSponsored:e.boolean(),environment:e.enum([`development`,`production`]),custodyId:e.string().nullable(),createdAt:e.iso.datetime(),tokenId:e.string(),name:e.string().nullable(),description:e.string().nullable(),imageAssetId:e.string().nullable(),chain:e.string(),collectionAddress:e.string(),kind:e.enum([`erc721`,`erc1155`])}),Hr=e.object({permits:e.array(Vr)}),Ur=e.object({permitId:e.string(),direction:e.enum([`vault_in`,`withdraw`]),vault:e.string(),collection:e.string(),user:e.string(),tokenId:e.string().regex(/^\d+$/),amount:e.string().regex(/^\d+$/),lockKind:e.enum([`vault`,`burn`]).nullable(),destination:e.string().nullable(),deadline:e.int().gt(0),signature:e.string()}),Wr=e.object({direction:e.enum([`vault_in`,`withdraw`]),collection:e.string(),vault:e.string(),chainId:e.int().gt(0),user:e.string(),tokenId:e.string().regex(/^\d+$/),amount:e.string().regex(/^\d+$/),nonce:e.string().regex(/^\d+$/).nullable(),deadline:e.int().gt(0),feeCents:e.int().gte(0),gasWei:e.string().regex(/^\d+$/),gasPaidBy:e.enum([`developer`,`user`]),requiresUserSignature:e.boolean()}),Gr=e.object({ok:e.boolean(),txHash:e.string(),chargedCents:e.int().gte(0),gasPaidBy:e.enum([`developer`,`user`])});e.object({userSignature:e.string().min(1).optional(),deadline:e.int().gt(0).optional()});const Kr=e.object({collection:e.string(),chainId:e.int().gt(0),from:e.string(),to:e.string(),tokenId:e.string().regex(/^\d+$/),amount:e.string().regex(/^\d+$/),nonce:e.string().regex(/^\d+$/),deadline:e.int().gt(0),feeCents:e.int().gte(0),gasWei:e.string().regex(/^\d+$/),selfPayAvailable:e.boolean()});e.object({toUserId:e.string().min(1),collection:e.string().min(1),tokenId:e.string().regex(/^\d+$/),amount:e.string().regex(/^\d+$/).optional()});const qr=e.object({ok:e.boolean(),txHash:e.string(),chargedCents:e.int().gte(0)});e.object({toUserId:e.string().min(1),collection:e.string().min(1),tokenId:e.string().regex(/^\d+$/),amount:e.string().regex(/^\d+$/).optional(),deadline:e.int().gt(0),userSignature:e.string().min(1),threadId:e.string().min(1).optional()});const Jr=e.object({id:e.string(),collectionId:e.string(),collectionAddress:e.string(),chain:e.string(),kind:e.enum([`erc721`,`erc1155`]),tokenId:e.string(),amount:e.string(),lockKind:e.enum([`vault`,`burn`]),vaultAddress:e.string(),createdAt:e.iso.datetime(),name:e.string().nullable(),description:e.string().nullable(),imageAssetId:e.string().nullable()}),Yr=e.object({custody:e.array(Jr)}),Xr=e.object({ok:e.boolean(),txHash:e.string()}),Zr=e.object({requesterId:e.string().min(1),requesterName:e.string().min(1),requesterDisplayName:e.string().nullable(),requesterImage:e.url().nullable(),friendshipId:e.string().min(1)}),Qr=e.object({accepterId:e.string().min(1),accepterName:e.string().min(1),accepterDisplayName:e.string().nullable(),accepterImage:e.url().nullable(),friendshipId:e.string().min(1)}),$r=e.object({appId:e.uuid(),appName:e.string().min(1),scope:e.enum([`publish`,`changes`])}),ei=e.object({appId:e.uuid(),appName:e.string().min(1),scope:e.enum([`publish`,`changes`]),notes:e.string().min(1).max(1e3)}),ti=e.object({appId:e.uuid(),appName:e.string().min(1),appLogoUrl:e.url().nullable(),inviterId:e.string().min(1),inviterName:e.string().min(1),inviterDisplayName:e.string().nullable()}),ni=e.object({appId:e.uuid(),appName:e.string().min(1),accepterId:e.string().min(1),accepterName:e.string().min(1),accepterDisplayName:e.string().nullable(),accepterImage:e.url().nullable()}),ri=e.union([e.object({id:e.string().min(1),kind:e.enum([`friend_request`]),payload:Zr,read:e.boolean(),createdAt:e.iso.datetime()}),e.object({id:e.string().min(1),kind:e.enum([`friend_accepted`]),payload:Qr,read:e.boolean(),createdAt:e.iso.datetime()}),e.object({id:e.string().min(1),kind:e.enum([`app_page_approved`]),payload:$r,read:e.boolean(),createdAt:e.iso.datetime()}),e.object({id:e.string().min(1),kind:e.enum([`app_page_rejected`]),payload:ei,read:e.boolean(),createdAt:e.iso.datetime()}),e.object({id:e.string().min(1),kind:e.enum([`app_participant_invite`]),payload:ti,read:e.boolean(),createdAt:e.iso.datetime()}),e.object({id:e.string().min(1),kind:e.enum([`app_participant_accepted`]),payload:ni,read:e.boolean(),createdAt:e.iso.datetime()})]),ii=e.object({notifications:e.array(ri),unreadCount:e.int().gte(0)});e.object({ok:e.literal(!0)}),e.object({read:e.boolean()});const ai=e.enum([`online`,`offline`]),oi=e.object({user:j,friendshipId:e.string().min(1),acceptedAt:e.iso.datetime(),onlineStatus:ai}),si=e.object({friends:e.array(oi)}),ci=e.object({friends:e.array(j)});e.object({decision:e.enum([`accept`,`reject`])});const K=e.object({provider:e.enum([`twitter`,`discord`,`github`]),subject:e.string().min(1),username:e.string().nullable(),name:e.string().nullable(),profilePictureUrl:e.url().nullable(),verifiedAt:e.iso.datetime().nullable()}),li=e.object({accounts:e.array(K)}),q=e.string().nullable(),ui=e.url().max(2048).nullable(),di=e.object({studioName:e.string().min(1).max(80).nullable(),studioUrl:e.url().max(2048).nullable(),studioXHandle:q,githubUrl:ui,logoUrl:e.url().max(2048).nullable()}),fi=e.object({id:e.string().min(1),name:e.string().min(1),logoUrl:e.url().max(2048).nullable(),environment:e.enum([`development`,`production`])}),pi=e.object({profile:di,apps:e.array(fi)}).nullable(),mi=e.object({followers:e.int().gte(0),following:e.int().gte(0)}),hi=e.object({gamesPlayed:e.int().gte(0),totalPlaytimeSeconds:e.int().gte(0),reviewsLeft:e.int().gte(0),rewardsWon:e.int().gte(0),rewardsValueUsdCents:e.int().gte(0)}),gi=e.object({appId:e.string().min(1),name:e.string().min(1),logoUrl:e.url().max(2048).nullable(),sessionCount:e.int().gte(0),totalPlaytimeSeconds:e.int().gte(0)}),_i=e.object({appId:e.string().min(1),appName:e.string().min(1),appLogoUrl:e.url().max(2048).nullable(),recommended:e.boolean(),body:e.string(),createdAt:e.iso.datetime()}),vi=e.object({isFollowing:e.boolean(),isFollowedBy:e.boolean(),friendship:e.enum([`none`,`pending_out`,`pending_in`,`accepted`]),friendshipId:e.string().min(1).nullable()}).nullable(),yi=e.object({id:e.string().min(1),name:e.string().min(1),displayName:e.string().nullable(),bio:e.string().nullable(),websiteUrl:e.url().max(2048).nullable(),image:e.url().nullable(),banner:oe,createdAt:e.iso.datetime(),socials:e.array(K),developer:pi,counts:mi,stats:hi,topGames:e.array(gi),recentReviews:e.array(_i),relationship:vi}),bi=e.object({id:e.string().min(1),name:e.string().min(1),displayName:e.string().nullable(),image:e.url().nullable(),socials:e.array(K)}),xi=e.object({results:e.array(bi)});e.object({ok:e.literal(!0),friendshipId:e.string().min(1)});const Si=e.object({id:e.string().min(1),keyPrefix:e.string().min(1),scopes:e.array(e.enum([`developer:read`,`developer:apps`,`developer:pages`])),createdAt:e.iso.datetime(),expiresAt:e.iso.datetime().nullable(),lastUsedAt:e.iso.datetime().nullable(),revokedAt:e.iso.datetime().nullable()}),Ci=e.object({key:Si,secret:e.string().min(1)});e.object({scopes:e.array(e.enum([`developer:read`,`developer:apps`,`developer:pages`])).min(1),expiresAt:e.iso.datetime().nullish()});const wi=e.object({keys:e.array(Si)}),J=e.object({ok:e.literal(!0)}),Ti=e.object({id:e.string().min(1)}),Ei=e.string().regex(/^[A-Za-z0-9 ._-]{1,40}$/),Di=e.object({chain:e.string().min(1),custody:e.enum([`server`])});e.object({name:Ei,chains:e.array(Di).optional()});const Oi=e.string().min(1).max(2048),ki=e.enum([`eth`,`tron`]),Ai=e.array(ki).min(1).max(2);e.object({name:Ei.optional(),slug:v.nullish(),logoUrl:e.url().max(2048).nullish(),testAccess:e.enum([`private`,`public`]).optional(),redirectUris:e.array(e.url().max(2048)).max(20).optional(),embedOrigins:e.array(Oi).max(20).optional(),acceptedCurrencies:Ai.optional(),paymentStatusWebhookUrl:e.url().max(2048).nullish(),paymentStatusWebhookUrlTest:e.url().max(2048).nullish()});const Y=e.object({logoUrl:e.url().nullable()}),ji=e.object({chain:e.string().min(1),token:e.string().min(1),tokenDecimals:e.int(),lockedWei:e.string(),unlockedWei:e.string(),walletBalanceWei:e.string().nullable()}),Mi=e.object({appId:e.string().min(1),balances:e.array(ji)}),Ni=e.object({appId:e.string().min(1),availableCents:e.int().gte(0),lockedCents:e.int().gte(0),totalCents:e.int().gte(0)}),Pi=e.object({ts:e.iso.datetime(),sumCents:e.number(),paymentCount:e.int()}),Fi=e.object({appId:e.string().min(1),range:e.string().min(1),bucketSecs:e.int(),windowSecs:e.int(),chain:e.string().nullable(),buckets:e.array(Pi)}),Ii=e.object({ts:e.iso.datetime(),sessionCount:e.int(),uniquePlayerCount:e.int(),totalDurationSeconds:e.int()}),Li=e.object({appId:e.string().min(1),range:e.string().min(1),bucketSecs:e.int(),windowSecs:e.int(),buckets:e.array(Ii)}),Ri=e.object({appId:e.string().min(1),earnedCents:e.int(),earningEventCount:e.int(),distinctPayers:e.int(),sessionCount:e.int(),uniquePlayerCount:e.int(),totalPlaytimeSeconds:e.int()}),zi=e.object({chain:e.string().min(1),address:e.string().regex(/^0x[0-9a-fA-F]{40}$/),custody:e.enum([`server`]).nullable(),walletId:e.string().nullable(),autoSweepEnabled:e.boolean(),sweepThresholdCents:e.int().nullable()}),Bi=e.object({appId:e.string().min(1),wallets:e.array(zi)}),Vi=e.object({appId:e.string().min(1),chain:e.string().min(1),autoSweepEnabled:e.boolean(),sweepThresholdCents:e.int().nullable()});e.object({enabled:e.boolean(),thresholdCents:e.int().gt(0).nullish()});const Hi=e.object({appId:e.string().min(1),chain:e.string().min(1),custody:e.enum([`server`]),walletId:e.string().min(1),address:e.string().regex(/^0x[0-9a-fA-F]{40}$/)}),Ui=e.object({appId:e.string().min(1),chain:e.string().min(1),token:e.string().min(1),txHash:e.string().min(1),amountWei:e.string().min(1),recipient:e.string().regex(/^0x[0-9a-fA-F]{40}$/)}),Wi=e.object({appId:e.string().min(1),chain:e.string().min(1),recipient:e.string().regex(/^0x[0-9a-fA-F]{40}$/),transfers:e.array(e.object({token:e.string().min(1),txHash:e.string().min(1),amountWei:e.string().min(1)}))}),Gi=e.object({id:e.string().min(1),clientId:e.string().min(1),environment:e.enum([`development`,`production`]),secretLast4:e.string().min(1),createdAt:e.iso.datetime(),lastUsedAt:e.iso.datetime().nullable()}),Ki=e.object({key:Gi,clientSecret:e.string().min(1)}),qi=e.object({ok:e.literal(!0),status:e.enum([`pending`,`approved`])});e.object({reason:e.string().min(1).max(500).optional()});const Ji=e.object({secret:e.string().regex(/^[a-f0-9]{64}$/),secretLast4:e.string().length(4)}),Yi=e.object({appealId:e.string().regex(/^0x[0-9a-f]{32}$/),paymentId:e.string().regex(/^0x[0-9a-f]{32}$/),chain:e.string().min(1),vault:e.string().regex(/^0x[0-9a-fA-F]{40}$/),appellant:e.string().regex(/^0x[0-9a-fA-F]{40}$/),amount:e.string().regex(/^\d+$/),token:e.string().regex(/^0x[0-9a-fA-F]{40}$/),status:e.enum([`open`,`resolved_refund`,`resolved_dismiss`,`cancelled`,`force_cancelled`]),reason:e.string().nullable(),filedAt:e.iso.datetime(),resolvedAt:e.iso.datetime().nullable()}),Xi=e.object({appeals:e.array(Yi)}),Zi=e.object({paymentId:e.string().regex(/^0x[0-9a-f]{32}$/),chain:e.string().min(1),vault:e.string().regex(/^0x[0-9a-fA-F]{40}$/),beneficiary:e.string().regex(/^0x[0-9a-fA-F]{40}$/),token:e.string().regex(/^0x[0-9a-fA-F]{40}$/),grossAmount:e.string().regex(/^\d+$/),creditedAmount:e.string().regex(/^\d+$/),vaultReleaseAt:e.iso.datetime(),signedAt:e.iso.datetime(),matured:e.boolean(),hasActiveAppeal:e.boolean()}),Qi=e.object({deposits:e.array(Zi)}),$i=e.object({appCount:e.int().gte(0),availableCents:e.int().gte(0),lockedCents:e.int().gte(0),totalCents:e.int().gte(0)}),ea=e.object({userId:e.string().min(1),status:e.enum([`invited`,`accepted`,`revoked`]),name:e.string().nullable(),email:e.string().nullable(),image:e.url().nullable(),invitedAt:e.iso.datetime(),respondedAt:e.iso.datetime().nullable()}),ta=e.object({participants:e.array(ea)});e.object({identifier:e.string().min(1).max(80)});const na=e.object({appId:e.string().min(1),appName:e.string().min(1),appLogoUrl:e.url().nullable(),status:e.enum([`invited`,`accepted`,`revoked`]),invitedAt:e.iso.datetime()}),ra=e.object({invites:e.array(na)}),ia=e.object({id:e.string().min(1),displayName:e.string().nullable(),email:e.string().nullable()}).nullable(),aa=e.string().min(1).max(80).nullable(),oa=e.string().min(10).max(1e3).nullable(),sa=e.object({policyVersion:e.string().min(1),policyAcceptedAt:e.iso.datetime(),logoUrl:e.url().max(2048).nullable(),email:e.email().nullable(),xHandle:q,teamName:aa,projectDescription:oa}),ca=e.object({reason:e.string().min(1).max(500).optional()}),la=e.object({id:e.string().min(1),userId:e.string().min(1),user:ia,kind:e.enum([`role`,`production`]),status:e.enum([`pending`,`approved`,`rejected`,`cancelled`]),appId:e.string().min(1).nullable(),payload:e.union([e.object({kind:e.enum([`role`]),data:sa}),e.object({kind:e.enum([`production`]),data:ca})]),reviewedBy:e.string().min(1).nullable(),reviewedAt:e.iso.datetime().nullable(),reviewNotes:e.string().nullable(),createdAt:e.iso.datetime(),updatedAt:e.iso.datetime()}).nullable(),ua=e.object({chain:e.string().min(1),address:e.string().regex(/^0x[0-9a-fA-F]{40}$/)}),da=e.object({id:e.string().min(1),name:Ei,slug:v.nullable(),logoUrl:e.url().max(2048).nullable(),environment:e.enum([`development`,`production`]),productionApprovedAt:e.iso.datetime().nullable(),testAccess:e.enum([`private`,`public`]),createdAt:e.iso.datetime(),redirectUris:e.array(e.url().max(2048)),embedOrigins:e.array(Oi),acceptedCurrencies:Ai,payoutAddresses:e.array(ua),keys:e.array(Gi),pendingProductionRequestId:e.string().min(1).nullable(),paymentStatusWebhookUrl:e.url().max(2048).nullable(),paymentStatusWebhookSecretLast4:e.string().length(4).nullable(),paymentStatusWebhookUrlTest:e.url().max(2048).nullable(),paymentStatusWebhookSecretLast4Test:e.string().length(4).nullable()}),fa=e.object({roleStatus:e.enum([`none`,`pending`,`approved`,`rejected`,`cancelled`]),latestRequest:la,profile:di.nullable(),apps:e.array(da)});e.object({studioName:e.string().min(1).max(80).nullish(),studioUrl:e.url().max(2048).nullish(),studioXHandle:q.optional(),githubUrl:ui.optional(),logoUrl:e.url().max(2048).nullish()}),e.object({acceptPolicy:e.literal(!0),logoUrl:e.url().max(2048).optional(),email:e.email().optional(),teamName:aa.optional(),projectDescription:oa.optional()});const X=e.object({appId:e.uuid(),slug:v.nullable(),status:e.enum([`draft`,`pending_review`,`published`,`hidden`]),categories:y,tagline:b.nullable(),bannerUrl:e.url().max(2048).nullable(),thumbnailUrl:e.url().max(2048).nullable(),thumbnailVideoUrl:e.url().max(2048).nullable(),playUrl:e.url().max(2048).nullable(),discordUrl:e.url().max(2048).nullable(),twitterUrl:e.url().max(2048).nullable(),redditUrl:e.url().max(2048).nullable(),telegramUrl:e.url().max(2048).nullable(),gallery:x,chapters:S,links:C,platforms:w,gameType:T,ageRating:Ge,languages:Ke,releaseStatus:qe,firstPublishedAt:e.iso.datetime().nullable(),reviewedAt:e.iso.datetime().nullable(),reviewNotes:e.string().nullable(),hiddenAt:e.iso.datetime().nullable(),hiddenReasonPublic:e.string().nullable(),pendingReview:e.boolean()});e.object({categories:y.optional(),tagline:b.nullish(),bannerUrl:e.url().max(2048).nullish(),thumbnailUrl:e.url().max(2048).nullish(),thumbnailVideoUrl:e.url().max(2048).nullish(),playUrl:e.url().max(2048).nullish(),discordUrl:e.url().max(2048).nullish(),twitterUrl:e.url().max(2048).nullish(),redditUrl:e.url().max(2048).nullish(),telegramUrl:e.url().max(2048).nullish(),gallery:x.optional(),chapters:S.optional(),links:C.optional(),platforms:w.optional(),gameType:T.optional(),ageRating:Ge.optional(),languages:Ke.optional(),releaseStatus:qe.optional()});const pa=e.object({url:e.url().max(2048)}),ma=e.object({playSessionId:e.string().min(1),userId:e.uuid(),appId:e.uuid(),status:e.enum([`pending`,`active`]),userHalfFresh:e.boolean(),gameHalfFresh:e.boolean(),active:e.boolean(),startedAt:e.iso.datetime(),activatedAt:e.iso.datetime().nullable(),lastSeenAt:e.iso.datetime().nullable()}),ha=e.object({players:e.array(ma),total:e.int().gte(0),liveCount:e.int().gte(0),generatedAt:e.iso.datetime()}),ga=e.object({id:e.string().min(1),email:e.email().nullable(),role:u,addedBy:e.string().min(1).nullable(),addedAt:e.iso.datetime(),lastAccessedAt:e.iso.datetime().nullable()}),_a=e.object({admins:e.array(ga)}),va=e.object({id:e.string()});e.object({email:e.email(),role:u.optional()});const ya=e.object({id:e.string(),role:u});e.object({role:u});const ba=e.object({id:e.string().min(1),name:e.string().min(1),displayName:e.string().nullable(),email:e.email().nullable(),createdAt:e.iso.datetime(),bannedAt:e.iso.datetime().nullable(),deletedAt:e.iso.datetime().nullable()}),xa=e.object({users:e.array(ba),total:e.int().gte(0),offset:e.int().gte(0),limit:e.int().gt(0)}),Sa=e.object({id:e.string(),banned:e.boolean()});e.object({banned:e.boolean(),reason:e.string().min(1).max(280).optional()});const Ca=e.object({id:e.string().min(1),actorId:e.string().min(1).nullable(),actorKind:e.enum([`user`,`system`,`service`]),action:e.string().min(1),targetType:e.string().min(1),targetId:e.string().min(1),purpose:e.string().min(1),legalBasis:e.enum([`consent`,`contract`,`legitimate-interest`,`legal-obligation`,`vital-interest`,`public-task`]),occurredAt:e.iso.datetime(),attributes:e.record(e.string(),e.unknown()),traceId:e.string().min(1).nullable()}),wa=e.object({rows:e.array(Ca),total:e.int().gte(0),offset:e.int().gte(0),limit:e.int().gt(0)}),Ta=e.object({requests:e.array(la)}),Ea=e.object({id:e.string().min(1),status:e.enum([`pending`,`approved`,`rejected`,`cancelled`])});e.object({decision:e.enum([`approve`,`reject`]),notes:e.string().min(1).max(1e3).optional()});const Da=e.object({id:e.string().min(1),name:e.string(),environment:e.enum([`development`,`production`]),logoUrl:e.url().nullable(),productionApprovedAt:e.iso.datetime().nullable(),createdAt:e.iso.datetime()}),Oa=e.object({userId:e.string().min(1),email:e.email(),displayName:e.string().nullable(),image:e.url().nullable(),studio:di.nullable(),apps:e.array(Da),grantedAt:e.iso.datetime().nullable()}),ka=e.object({developers:e.array(Oa)}),Aa=e.object({appId:e.uuid(),appName:e.string(),ownerDisplayName:e.string().nullable(),ownerImage:e.string().nullable(),ownerUserId:e.uuid(),ownerEmail:e.string().nullable(),appLogoUrl:e.string().nullable(),slug:e.string().nullable(),status:e.enum([`draft`,`pending_review`,`published`,`hidden`]),categories:y,tagline:e.string().nullable(),submittedAt:e.iso.datetime().nullable(),firstPublishedAt:e.iso.datetime().nullable(),hiddenAt:e.iso.datetime().nullable(),hiddenReasonInternal:e.string().nullable(),pendingChangesSubmittedAt:e.iso.datetime().nullable()}),ja=e.object({items:e.array(Aa)}),Z=e.object({status:e.enum([`draft`,`pending_review`,`published`,`hidden`])});e.object({reasonPublic:e.string().min(1).max(500),reasonInternal:e.string().max(2e3).optional()}),e.union([e.object({decision:e.enum([`approve`])}),e.object({decision:e.enum([`reject`]),notes:e.string().min(1).max(1e3)})]);const Ma=e.object({field:e.string(),label:e.string(),from:e.string(),to:e.string()}),Na=e.object({appId:e.uuid(),submittedAt:e.iso.datetime().nullable(),changes:e.array(Ma)}),Pa=e.object({purchaseFeeBps:e.int().gte(0).lte(1e4),stakeFeeBps:e.int().gte(0).lte(1e4),updatedAt:e.iso.datetime(),updatedBy:e.string().min(1).nullable()}),Q=e.object({chain:e.string().min(1),chainId:e.int().gte(0),to:e.string().regex(/^0x[0-9a-fA-F]{40}$/),calldataHex:e.string().regex(/^0x[0-9a-fA-F]*$/)}),Fa=e.object({target:e.enum([`purchase`]),envelope:Q}),Ia=e.object({purchaseFeeBps:e.int().gte(0).lte(1e4),stakeFeeBps:e.int().gte(0).lte(1e4),updatedAt:e.iso.datetime(),updatedBy:e.string().min(1).nullable(),envelopes:e.array(Fa)});e.object({purchaseFeeBps:e.int().gte(0).lte(1e4).optional(),stakeFeeBps:e.int().gte(0).lte(1e4).optional()});const La=e.object({appId:e.string().min(1),platformFeeBps:e.int().gte(0).lte(1e4).nullable(),rakeCapBps:e.int().gte(0).lte(3e3).nullable(),effectivePlatformFeeBps:e.int().gte(0).lte(1e4),effectiveRakeCapBps:e.int().gte(0).lte(3e3),updatedAt:e.iso.datetime().nullable(),updatedBy:e.string().min(1).nullable()});e.object({platformFeeBps:e.int().gte(0).lte(1e4).nullish(),rakeCapBps:e.int().gte(0).lte(3e3).nullish()}),e.object({chain:e.string().min(1),vaultAddress:e.string().regex(/^0x[0-9a-fA-F]{40}$/),processorAddress:e.string().regex(/^0x[0-9a-fA-F]{40}$/),action:e.enum([`add`,`remove`])}),e.object({chain:e.string().min(1),processorAddress:e.string().regex(/^0x[0-9a-fA-F]{40}$/),newTreasury:e.string().regex(/^0x[0-9a-fA-F]{40}$/)});const Ra=e.object({chain:e.string().min(1),walletAddress:e.string().regex(/^0x[0-9a-fA-F]{40}$/),reason:e.string().min(1),flaggedBy:e.string().min(1),createdAt:e.iso.datetime(),updatedAt:e.iso.datetime()});e.object({chain:e.string().min(1),walletAddress:e.string().regex(/^0x[0-9a-fA-F]{40}$/),reason:e.string().min(1).max(2e3)});const za=e.object({chain:e.string().min(1),walletAddress:e.string().regex(/^0x[0-9a-fA-F]{40}$/),removed:e.literal(!0)});e.object({chain:e.string().min(1),walletAddress:e.string().regex(/^0x[0-9a-fA-F]{40}$/)});const Ba=e.object({entries:e.array(Ra)});e.object({chain:e.string().min(1),target:e.enum([`router`,`credit_vault`,`platform_vault`]),newOperator:e.string().regex(/^0x[0-9a-fA-F]{40}$/)}),e.object({chain:e.string().min(1),target:e.enum([`router`,`credit_vault`,`platform_vault`]),action:e.enum([`pause`,`unpause`])}),e.object({chain:e.string().min(1),vaultAddress:e.string().regex(/^0x[0-9a-fA-F]{40}$/),lockSeconds:e.int().gte(0)}),e.object({chain:e.string().min(1),account:e.string().regex(/^0x[0-9a-fA-F]{40}$/),lockSeconds:e.int().gte(0)});const Va=e.object({appealId:e.string().regex(/^0x[0-9a-f]{32}$/),paymentId:e.string().regex(/^0x[0-9a-f]{32}$/),chain:e.string().min(1),vault:e.string().regex(/^0x[0-9a-fA-F]{40}$/),appellant:e.string().regex(/^0x[0-9a-fA-F]{40}$/),amount:e.string().regex(/^\d+$/),token:e.string().regex(/^0x[0-9a-fA-F]{40}$/),status:e.enum([`open`,`resolved_refund`,`resolved_dismiss`,`cancelled`,`force_cancelled`]),reason:e.string().nullable(),filedAt:e.iso.datetime(),resolvedAt:e.iso.datetime().nullable(),resolvedBy:e.string().nullable(),resolutionNotes:e.string().nullable()}),Ha=e.object({appeals:e.array(Va),nextCursorFiledAt:e.iso.datetime().nullable()}),Ua=e.enum([`pending_onchain`,`open`,`resolved_refund`,`resolved_dismiss`,`cancelled`,`force_cancelled`]),Wa=e.enum([`purchase`,`pot`,`matured`]),Ga=e.object({source:Wa,chain:e.string(),amount:e.string().regex(/^\d+$/),token:e.string().regex(/^0x[0-9a-fA-F]{40}$/),vault:e.string().regex(/^0x[0-9a-fA-F]{40}$/),depositId:e.string().regex(/^0x[0-9a-f]{32}$/).nullable(),paymentId:e.string().regex(/^0x[0-9a-f]{32}$/).nullable(),appellant:e.string().regex(/^0x[0-9a-fA-F]{40}$/),appellantUserId:e.string().nullable(),respondent:e.string().regex(/^0x[0-9a-fA-F]{40}$/).nullable(),respondentUserId:e.string().nullable(),reason:e.string().nullable(),filedAt:e.iso.datetime(),resolvedAt:e.iso.datetime().nullable(),resolution:e.object({resolutionId:e.string().regex(/^0x[0-9a-f]{32}$/),outcome:e.int().gte(0).lte(1),deadline:e.int().gte(0),signature:e.string().regex(/^0x[0-9a-fA-F]+$/)}).nullable(),refundClaimedAt:e.iso.datetime().nullable()}),Ka=e.enum([`party`,`admin`,`system`]),qa=e.object({id:e.string().min(1),senderUserId:e.string().nullable(),senderRole:Ka,body:e.string().nullable(),attachments:e.array(B),sentAt:e.iso.datetime()}),Ja=e.object({appealId:e.string().regex(/^0x[0-9a-f]{32}$/),threadId:e.string().nullable(),status:Ua,readOnly:e.boolean(),canResolve:e.boolean(),detail:Ga,messages:e.array(qa)}),Ya=e.object({message:qa});e.object({body:e.string().min(1).max(4e3).optional(),attachmentIds:e.array(e.string().min(1)).max(3).optional()});const Xa=e.object({appealId:e.string().regex(/^0x[0-9a-f]{32}$/),resolutionId:e.string().regex(/^0x[0-9a-f]{32}$/),chain:e.string().min(1),chainId:e.int().gt(0),vault:e.string().regex(/^0x[0-9a-fA-F]{40}$/),outcome:e.int().gte(0).lte(1),deadline:e.int().gte(0),signature:e.string().regex(/^0x[0-9a-fA-F]+$/),status:e.enum([`resolved_refund`,`resolved_dismiss`])});e.object({decision:e.enum([`refund`,`dismiss`]),notes:e.string().min(1).max(2e3).optional()});const Za=e.object({appealId:e.string().regex(/^0x[0-9a-f]{32}$/),paymentId:e.string().regex(/^0x[0-9a-f]{32}$/),chain:e.string().min(1),chainId:e.int().gt(0),vault:e.string().regex(/^0x[0-9a-fA-F]{40}$/),appellant:e.string().regex(/^0x[0-9a-fA-F]{40}$/),amount:e.string().regex(/^\d+$/),deadline:e.int().gte(0),signature:e.string().regex(/^0x[0-9a-fA-F]+$/)});e.object({paymentId:e.string().regex(/^0x[0-9a-f]{32}$/),amount:e.string().regex(/^\d+$/),reason:e.string().min(1).max(2e3)}),e.object({legId:e.string().regex(/^0x[0-9a-f]{32}$/),reason:e.string().min(1).max(2e3)});const Qa=e.object({kind:e.enum([`direct`]),txHash:e.string().regex(/^0x[0-9a-fA-F]{64}$/),blockNumber:e.string().regex(/^\d+$/),recipient:e.string().regex(/^0x[0-9a-fA-F]{40}$/),amount:e.string().regex(/^\d+$/)}),$a=e.object({kind:e.enum([`pull`]),txHash:e.string().regex(/^0x[0-9a-fA-F]{64}$/),blockNumber:e.string().regex(/^\d+$/),recipient:e.string().regex(/^0x[0-9a-fA-F]{40}$/),amount:e.string().regex(/^\d+$/)});e.discriminatedUnion(`kind`,[Qa.extend({kind:e.literal(`direct`)}),$a.extend({kind:e.literal(`pull`)})]),e.object({chain:e.string().min(1),token:e.string().regex(/^0x[0-9a-fA-F]{40}$/),amount:e.string().regex(/^\d+$/),recipient:e.string().regex(/^0x[0-9a-fA-F]{40}$/).optional(),recipientUserId:e.string().min(1).optional(),metadata:_.optional()}),e.object({distributionId:e.string().regex(/^0x[0-9a-fA-F]{32}$/),txHash:e.string().regex(/^0x[0-9a-fA-F]{64}$/),blockNumber:e.string().regex(/^\d+$/),potId:e.string().regex(/^0x[0-9a-fA-F]{32}$/),closePot:e.boolean(),legs:e.array(e.object({recipient:e.string().regex(/^0x[0-9a-fA-F]{40}$/),amount:e.string().regex(/^\d+$/),settlement:e.enum([`instant`,`locked`])}))}),e.object({chain:e.string().min(1),token:e.string().regex(/^0x[0-9a-fA-F]{40}$/),potId:e.string().regex(/^0x[0-9a-fA-F]{32}$/),closePot:e.boolean().optional().default(!0),legs:e.array(e.object({recipient:e.string().regex(/^0x[0-9a-fA-F]{40}$/).optional(),recipientUserId:e.string().min(1).optional(),amount:e.string().regex(/^\d+$/),settlement:e.enum([`instant`,`locked`]).optional().default(`locked`)})).min(1).max(50),metadata:_.optional()}),e.object({potId:e.string().regex(/^0x[0-9a-fA-F]{32}$/),txHash:e.string().regex(/^0x[0-9a-fA-F]{64}$/),blockNumber:e.string().regex(/^\d+$/)}),e.object({chain:e.string().min(1),token:e.string().regex(/^0x[0-9a-fA-F]{40}$/),potId:e.string().regex(/^0x[0-9a-fA-F]{32}$/)}),e.object({status:e.enum([`ok`])});const eo=e.object({id:e.string(),purpose:e.string(),version:e.string(),grantedAt:e.iso.datetime(),withdrawnAt:e.iso.datetime().nullable()}),to=e.object({accountId:e.string(),providerId:e.string(),hasPassword:e.boolean(),scope:e.string().nullable(),createdAt:e.iso.datetime(),updatedAt:e.iso.datetime()}),no=e.object({id:e.string(),action:e.string(),targetType:e.string(),targetId:e.string(),purpose:e.string(),legalBasis:e.string(),occurredAt:e.iso.datetime(),traceId:e.string().nullable(),attributes:e.record(e.string(),e.unknown())}),ro=e.object({id:e.string(),threadId:e.string(),contentMode:e.enum([`plaintext`,`e2e-encrypted`]),body:e.string().nullable(),envelope:e.unknown().optional(),note:e.string().nullable(),sentAt:e.iso.datetime(),editedAt:e.iso.datetime().nullable(),deletedAt:e.iso.datetime().nullable()});e.object({user:d,sessions:e.array(ue),consents:e.array(eo),accounts:e.array(to),auditEvents:e.array(no),messages:e.array(ro),exportedAt:e.iso.datetime()}),e.object({name:l.optional(),image:e.string().min(1).max(2048).nullish()});const io=e.object({purpose:e.string(),version:e.string(),grantedAt:e.iso.datetime(),withdrawnAt:e.iso.datetime().nullable()});e.object({consents:e.array(io)});const ao=e.string().regex(/^[a-z][a-z0-9-]{2,63}$/);e.object({purpose:ao,version:e.string().min(1).max(64),granted:e.boolean()}),e.object({token:e.string().min(1),callbackURL:e.url().optional()}),e.object({response_type:e.enum([`code`]),client_id:m,redirect_uri:f,scope:p,state:fe,code_challenge:pe,code_challenge_method:e.enum([`S256`]),prompt:e.enum([`consent`]).optional()}),e.object({request:h}),e.object({client_id:e.string().min(1),return_uri:e.url()}),e.object({clientId:e.string().min(1)}),e.object({chain:e.string().min(1),token:e.string().regex(/^0x[0-9a-fA-F]{40}$/),amount:e.string().regex(/^\d+$/).optional(),usdCents:e.int().gte(0).nullish()});const oo=Fe;e.void(),e.void(),e.void(),e.object({genre:e.enum(`adventure.battle_royale.board.cards.casino.casual.fighting.idle.mmo.moba.platformer.prediction.puzzle.racing.rhythm.roguelike.rpg.rts.sandbox.shooter.simulation.sports.strategy.survival.tools.tower_defense.visual_novel.other`.split(`.`)).optional(),q:e.string().min(1).max(200).optional(),before:e.iso.datetime().optional(),limit:e.int().gte(1).lte(48).optional().default(24)}),e.object({slug:e.string().regex(/^[a-z0-9-]{3,40}$/)}),e.object({slug:e.string().regex(/^[a-z0-9-]{3,40}$/)}),e.object({sort:st.optional(),limit:e.int().gte(1).lte(50).optional().default(10),offset:e.int().gte(0).nullish().default(0)}),e.object({slug:e.string().regex(/^[a-z0-9-]{3,40}$/)}),e.object({slug:e.string().regex(/^[a-z0-9-]{3,40}$/)}),e.object({slug:e.string().regex(/^[a-z0-9-]{3,40}$/)}),e.object({slug:e.string().regex(/^[a-z0-9-]{3,40}$/)}),e.object({slug:e.string().regex(/^[a-z0-9-]{3,40}$/),reviewId:e.uuid()}),e.object({slug:e.string().regex(/^[a-z0-9-]{3,40}$/),reviewId:e.uuid()}),e.object({slug:e.string().regex(/^[a-z0-9-]{3,40}$/),reviewId:e.uuid()}),e.object({limit:e.int().gte(1).lte(50).optional().default(20),offset:e.int().gte(0).nullish().default(0)}),e.object({slug:e.string().regex(/^[a-z0-9-]{3,40}$/),reviewId:e.uuid()}),e.object({slug:e.string().regex(/^[a-z0-9-]{3,40}$/),commentId:e.uuid()}),e.object({appId:e.uuid()}),e.object({sort:st.optional(),limit:e.int().gte(1).lte(50).optional().default(10),offset:e.int().gte(0).nullish().default(0)}),e.object({appId:e.uuid(),reviewId:e.uuid()}),e.object({appId:e.uuid(),reviewId:e.uuid()}),e.object({appId:e.uuid()});const so=xt;e.object({id:e.uuid()}),e.object({status:Ct.optional(),limit:e.int().gte(1).lte(50).optional().default(20),offset:e.int().gte(0).nullish().default(0)});const co=Tt;e.object({id:e.uuid(),reportId:e.uuid()});const lo=wt;e.object({status:e.enum([`pending`,`completed`,`expired`,`all`]).optional().default(`completed`),limit:e.int().gte(1).lte(100).optional().default(20),before:e.iso.datetime().optional()}),e.object({kind:e.string().optional(),direction:e.enum([`outgoing`,`incoming`]).optional(),sort:e.enum([`newest`,`oldest`,`value_desc`,`value_asc`]).optional().default(`newest`),chain:e.string().min(1).optional(),limit:e.int().gte(1).lte(100).optional().default(20),cursor:e.string().min(1).optional(),before:e.iso.datetime().optional(),includeInactive:e.enum([`true`,`false`]).optional().default(`false`)}),e.object({groupId:e.string().min(1).max(128)}),e.object({chain:e.string().min(1).optional()}),e.object({before:e.iso.datetime().optional()}),e.object({address:e.string().regex(/^0x[0-9a-fA-F]{40}$/)}),e.object({address:e.string().regex(/^0x[0-9a-fA-F]{40}$/)}),e.object({address:e.string().regex(/^0x[0-9a-fA-F]{40}$/)}),e.object({address:e.string().regex(/^0x[0-9a-fA-F]{40}$/)});const uo=d,fo=d;e.object({file:e.string()});const po=d;e.object({q:e.string().max(200).optional()});const mo=Nn;e.union([Hn,Un]),e.object({id:e.string().min(1)}),e.object({id:e.string().min(1)}),e.object({id:e.string().min(1)}),e.object({limit:e.int().gt(0).lte(100).optional(),before:e.iso.datetime().optional()}),e.object({id:e.string().min(1)}),e.object({id:e.string().min(1),msgId:e.string().min(1)}),e.object({id:e.string().min(1),msgId:e.string().min(1)}),e.object({id:e.string().min(1),msgId:e.string().min(1),emoji:z}),e.object({id:e.string().min(1),msgId:e.string().min(1),emoji:z}),e.object({id:e.string().min(1)}),e.object({file:e.string()}),e.object({id:e.string().min(1)}),e.object({id:e.string().min(1)}),e.object({id:e.string().min(1)}),e.object({id:e.string().min(1)}),e.object({id:e.string().min(1)}),e.object({id:e.string().min(1)}),e.object({id:e.string().min(1)}),e.object({file:e.string()}),e.object({id:e.string().min(1)}),e.object({id:e.string().min(1),userId:e.string().min(1)}),e.object({id:e.string().min(1)}),e.object({id:e.string().min(1),userId:e.string().min(1)}),e.object({regenerate:e.boolean().optional()}),e.object({code:e.string().min(1).max(64)});const ho=pr;e.object({days:e.int().gt(0).lte(366).optional().default(30)}),e.object({appId:e.uuid()}),e.object({days:e.int().gt(0).lte(366).optional().default(30)});const go=Tr;e.object({permitId:e.string().min(1)});const _o=Dr;e.object({file:e.string()}),e.object({tokenId:e.string()}),e.object({appId:e.string().min(1)});const vo=Ar;e.object({appId:e.string().min(1)});const yo=jr;e.object({appId:e.string().min(1)});const bo=Fr;e.object({appId:e.string().min(1)});const xo=Pr;e.object({appId:e.string().min(1),itemId:e.string().min(1)});const So=Ir;e.object({appId:e.string().min(1),itemId:e.string().min(1)});const Co=zr;e.object({file:e.string()}),e.object({appId:e.string().min(1),itemId:e.string().min(1)});const wo=G;e.object({file:e.string()}),e.object({appId:e.string().min(1),itemId:e.string().min(1)});const To=G;e.object({appId:e.string().min(1),itemId:e.string().min(1)});const Eo=Br;e.object({appId:e.string().min(1),itemId:e.string().min(1)});const Do=Br,Oo=Hr;e.object({permitId:e.string().min(1)});const ko=Ur;e.object({permitId:e.string().min(1)});const Ao=Wr;e.object({permitId:e.string().min(1)});const jo=Gr,Mo=Kr,No=qr,Po=Yr,Fo=Yr;e.object({custodyId:e.string().min(1)});const Io=Xr;e.object({id:e.string().min(1)}),e.object({id:e.string().min(1)}),e.object({id:e.string().min(1)}),e.object({handle:e.string().min(1)}),e.object({q:e.string().min(1).max(64),limit:e.int().gte(1).lte(50).optional().default(20)}),e.object({id:e.string().min(1)}),e.object({id:e.string().min(1)}),e.object({id:e.string().min(1)}),e.object({id:e.string().min(1)});const Lo=wi,Ro=Ci;e.object({id:e.string().min(1)});const zo=J,Bo=Ti;e.object({id:e.string().min(1)});const Vo=Ti;e.object({id:e.string().min(1)});const Ho=Ti;e.object({id:e.string().min(1)});const Uo=Y;e.object({file:e.string()}),e.object({id:e.string().min(1)});const Wo=Y;e.object({id:e.string().min(1)});const Go=Mi;e.object({id:e.string().min(1)});const Ko=Ni;e.object({id:e.string().min(1)}),e.object({range:e.string().optional(),chain:e.string().optional()});const qo=Fi;e.object({id:e.string().min(1)}),e.object({range:e.string().optional()});const Jo=Li;e.object({id:e.string().min(1)});const Yo=Ri;e.object({id:e.string().min(1)}),e.object({kind:e.string().optional(),direction:e.enum([`outgoing`,`incoming`]).optional(),sort:e.enum([`newest`,`oldest`,`value_desc`,`value_asc`]).optional().default(`newest`),chain:e.string().min(1).optional(),limit:e.int().gte(1).lte(100).optional().default(20),cursor:e.string().min(1).optional(),before:e.iso.datetime().optional(),includeInactive:e.enum([`true`,`false`]).optional().default(`false`)});const Xo=D;e.object({id:e.string().min(1)});const Zo=Bi;e.object({id:e.string().min(1),chain:e.string().min(1)});const Qo=Vi;e.object({id:e.string().min(1),chain:e.string().min(1)});const $o=Hi;e.object({id:e.string().min(1),chain:e.string().min(1)}),e.object({token:e.string().regex(/^0x[0-9a-fA-F]{40}$/).optional()});const es=Ui;e.object({id:e.string().min(1),chain:e.string().min(1)});const ts=Wi;e.object({id:e.string().min(1),env:e.enum([`development`,`production`])});const ns=Ki;e.object({id:e.string().min(1)});const rs=qi;e.object({id:e.string().min(1)});const is=Ji;e.object({chain:e.string().optional()});const as=Xi;e.object({chain:e.string().optional()});const os=Qi,ss=$i;e.object({id:e.string().min(1)});const cs=ta;e.object({id:e.string().min(1)});const ls=ta;e.object({id:e.string().min(1),userId:e.string().min(1)});const us=J,ds=ra;e.object({appId:e.string().min(1)});const fs=J;e.object({appId:e.string().min(1)});const ps=J,ms=fa,hs=J,gs=Y;e.object({file:e.string()});const _s=Y,vs=J,ys=Y;e.object({file:e.string()});const bs=Y;e.object({appId:e.string().min(1)});const xs=X;e.object({appId:e.string().min(1)});const Ss=X;e.object({appId:e.string().min(1)}),e.void(),e.object({file:e.string()}),e.object({appId:e.string().min(1)});const Cs=e.object({bannerUrl:e.url()});e.object({appId:e.string().min(1)}),e.void(),e.object({file:e.string()}),e.object({appId:e.string().min(1)});const ws=e.object({thumbnailUrl:e.url()});e.object({appId:e.string().min(1)}),e.void(),e.object({file:e.string()}),e.object({appId:e.string().min(1)});const Ts=e.object({thumbnailVideoUrl:e.url()});e.object({file:e.string()}),e.object({appId:e.string().min(1)});const Es=pa;e.object({appId:e.string().min(1)});const Ds=X;e.object({appId:e.string().min(1)});const Os=X;e.object({id:e.string().min(1)}),e.object({id:e.string().min(1)}),e.object({search:e.string().optional(),offset:e.int().gte(0).nullish(),limit:e.int().gt(0).lte(100).optional()}),e.object({id:e.string().min(1)}),e.object({action:e.string().optional(),actorId:e.string().optional(),targetType:e.string().optional(),targetId:e.string().optional(),offset:e.int().gte(0).nullish(),limit:e.int().gt(0).lte(100).optional()}),e.object({status:e.enum([`pending`,`approved`,`rejected`,`cancelled`]).optional(),kind:e.enum([`role`,`production`]).optional()}),e.object({id:e.string().min(1)}),e.object({status:e.union([e.enum([`draft`,`pending_review`,`published`,`hidden`]),e.enum([`all`]),e.enum([`pending_changes`])]).optional()}),e.object({appId:e.string().min(1)}),e.object({appId:e.string().min(1)}),e.object({appId:e.string().min(1)}),e.object({appId:e.string().min(1)}),e.object({appId:e.string().min(1)}),e.object({appId:e.string().min(1)}),e.object({appId:e.string().min(1)}),e.object({processorId:e.string().min(1)}),e.object({chain:e.string().min(1).optional()}),e.object({vaultAddress:e.string().min(1)}),e.object({vaultAddress:e.string().min(1)}),e.object({vaultAddress:e.string().min(1)}),e.object({vaultAddress:e.string().min(1)}),e.object({status:e.array(e.enum([`open`,`resolved_refund`,`resolved_dismiss`,`cancelled`,`force_cancelled`])).optional(),chain:e.string().min(1).optional(),cursorFiledAt:e.iso.datetime().optional(),limit:e.int().gte(1).lte(100).optional()}),e.object({appealId:e.string().min(1)}),e.object({appealId:e.string().min(1)}),e.object({file:e.string()}),e.object({appealId:e.string().min(1)}),e.object({appealId:e.string().min(1)}),e.object({appealId:e.string().min(1)}),e.object({appealId:e.string().min(1)}),e.object({file:e.string()}),e.object({appealId:e.string().min(1)}),e.void(),e.void();async function ks(e,t){let n=new FormData,r=t.file instanceof Blob?t.file:new Blob([t.file],{type:t.contentType});n.append(`file`,r,t.filename);let i=await e.fetch(`${js(e.issuer)}/me/avatar`,{method:`POST`,headers:{authorization:`Bearer ${t.bearer}`},body:n});if(!i.ok){let e=await i.text();throw Error(`tron ${i.status}: ${e}`)}let a=await i.json();return po.parse(a)}async function As(e,t){let n=await a(e,{path:`/me/avatar`,method:`DELETE`,bearer:t.bearer});return fo.parse(n)}function js(e){return e.endsWith(`/`)?e.slice(0,-1):e}async function Ms(e,t){let n=await a(e,{path:`/me/giphy/search`,bearer:t.bearer,query:{q:t.q}});return mo.parse(n)}async function Ns(e,t){let n=await a(e,{path:`/me/oauth/payment-authorizations`,bearer:t.bearer});return oo.parse(n)}async function Ps(e,t){await s(e,{path:`/me/oauth/payment-authorizations/${encodeURIComponent(t.consentId)}`,method:`PATCH`,bearer:t.bearer,body:t.body})}async function Fs(e,t){await s(e,{path:`/me/oauth/payment-authorizations/${encodeURIComponent(t.consentId)}`,method:`DELETE`,bearer:t.bearer})}async function Is(e,t){let n=await a(e,{path:`/me/presence/heartbeat`,method:`POST`,bearer:t.bearer});return ho.parse(n)}async function Ls(e,t){let n=await a(e,{path:`/me/profile`,method:`PATCH`,bearer:t.bearer,body:t.body});return uo.parse(n)}async function Rs(e,t){let n=await a(e,{path:`/admin/active-players`,bearer:t.bearer});return ha.parse(n)}async function zs(e,t){let n=await a(e,{path:`/admin/app-pages`,bearer:t.bearer,query:{status:t.status}});return ja.parse(n)}async function Bs(e,t){let n=await a(e,{path:`/admin/app-pages/${encodeURIComponent(t.appId)}/changes`,bearer:t.bearer});return Na.parse(n)}async function Vs(e,t){let n=await a(e,{path:`/admin/app-pages/${encodeURIComponent(t.appId)}/review-changes`,method:`POST`,bearer:t.bearer,body:t.body});return Z.parse(n)}async function Hs(e,t){let n=await a(e,{path:`/admin/app-pages/${encodeURIComponent(t.appId)}/hide`,method:`POST`,bearer:t.bearer,body:t.body});return Z.parse(n)}async function Us(e,t){let n=await a(e,{path:`/admin/app-pages/${encodeURIComponent(t.appId)}/unhide`,method:`POST`,bearer:t.bearer});return Z.parse(n)}async function Ws(e,t){let n=await a(e,{path:`/admin/app-pages/${encodeURIComponent(t.appId)}/review`,method:`POST`,bearer:t.bearer,body:t.body});return Z.parse(n)}async function Gs(e,t){let n=await a(e,{path:`/admin/payments/appeals`,bearer:t.bearer,query:{status:t.statuses===void 0?void 0:[...t.statuses],chain:t.chain,cursorFiledAt:t.cursorFiledAt,limit:t.limit}});return Ha.parse(n)}async function Ks(e,t){let n=await a(e,{path:`/admin/payments/appeals/${encodeURIComponent(t.appealId)}/room`,bearer:t.bearer});return Ja.parse(n)}async function qs(e,t){let n=await a(e,{path:`/admin/payments/appeals/${encodeURIComponent(t.appealId)}/room/messages`,method:`POST`,bearer:t.bearer,body:t.body});return Ya.parse(n)}async function Js(e,t){let n=new FormData,r=t.file instanceof Blob?t.file:new Blob([t.file],{type:t.contentType});n.append(`file`,r,t.filename);let i=await e.fetch(`${Xs(e.issuer)}/admin/payments/appeals/${encodeURIComponent(t.appealId)}/room/attachments`,{method:`POST`,headers:{authorization:`Bearer ${t.bearer}`},body:n});if(!i.ok){let e=await i.text();throw Error(`tron ${i.status}: ${e}`)}let a=await i.json();return V.parse(a)}async function Ys(e,t){let n=await a(e,{path:`/admin/payments/appeals/${encodeURIComponent(t.appealId)}/resolve`,method:`POST`,bearer:t.bearer,body:t.body});return Xa.parse(n)}function Xs(e){return e.endsWith(`/`)?e.slice(0,-1):e}async function Zs(e,t){let n=await a(e,{path:`/admin/developer-requests`,bearer:t.bearer,query:{status:t.status,kind:t.kind}});return Ta.parse(n)}async function Qs(e,t){let n=await a(e,{path:`/admin/developer-requests/${encodeURIComponent(t.id)}`,method:`PATCH`,bearer:t.bearer,body:t.body});return Ea.parse(n)}async function $s(e,t){let n=await a(e,{path:`/admin/developers`,bearer:t.bearer});return ka.parse(n)}async function ec(e,t){let n=await a(e,{path:`/admin/inventory/vault-custody/${encodeURIComponent(t.custodyId)}/force-withdraw`,method:`POST`,bearer:t.bearer});return Io.parse(n)}async function tc(e,t){let n=await a(e,{path:`/admin/platform-fees`,bearer:t.bearer});return Pa.parse(n)}async function nc(e,t){let n=await a(e,{path:`/admin/platform-fees`,method:`PATCH`,bearer:t.bearer,body:t.body});return Ia.parse(n)}async function rc(e,t){let n=await a(e,{path:`/admin/apps/${encodeURIComponent(t.appId)}/fee-config`,bearer:t.bearer});return La.parse(n)}async function ic(e,t){let n=await a(e,{path:`/admin/apps/${encodeURIComponent(t.appId)}/fee-config`,method:`PATCH`,bearer:t.bearer,body:t.body});return La.parse(n)}async function ac(e,t){let n=await a(e,{path:`/admin/payments/processors/whitelist`,method:`POST`,bearer:t.bearer,body:t.body});return Q.parse(n)}async function oc(e,t){let n=await a(e,{path:`/admin/payments/processors/${encodeURIComponent(t.processorId)}/treasury`,method:`POST`,bearer:t.bearer,body:t.body});return Q.parse(n)}async function sc(e,t){let n=await a(e,{path:`/admin/payments/vaults/${encodeURIComponent(t.vaultAddress)}/operator`,method:`POST`,bearer:t.bearer,body:t.body});return Q.parse(n)}async function cc(e,t){let n=await a(e,{path:`/admin/payments/vaults/${encodeURIComponent(t.vaultAddress)}/pause`,method:`POST`,bearer:t.bearer,body:t.body});return Q.parse(n)}async function lc(e,t){let n=await a(e,{path:`/admin/payments/vaults/${encodeURIComponent(t.vaultAddress)}/withdraw-lock-default`,method:`POST`,bearer:t.bearer,body:t.body});return Q.parse(n)}async function uc(e,t){let n=await a(e,{path:`/admin/payments/vaults/${encodeURIComponent(t.vaultAddress)}/withdraw-lock-override`,method:`POST`,bearer:t.bearer,body:t.body});return Q.parse(n)}async function dc(e,t){let n=await a(e,{path:`/admin/payments/appeal-blacklist`,method:`POST`,bearer:t.bearer,body:t.body});return Ra.parse(n)}async function fc(e,t){let n=await a(e,{path:`/admin/payments/appeal-blacklist`,method:`DELETE`,bearer:t.bearer,body:t.body});return za.parse(n)}async function pc(e,t){let n=await a(e,{path:`/admin/payments/appeal-blacklist`,bearer:t.bearer,query:{chain:t.chain}});return Ba.parse(n)}async function mc(e,t){let n=await a(e,{path:`/admin/tron/cashouts${t.status===void 0?``:`?status=${encodeURIComponent(t.status)}`}`,bearer:t.bearer});return bn.parse(n)}async function hc(e,t){let n=await a(e,{path:`/admin/tron/cashouts/${encodeURIComponent(t.id)}/approve`,method:`POST`,bearer:t.bearer});return O.parse(n)}async function gc(e,t){let n=await a(e,{path:`/admin/tron/cashouts/${encodeURIComponent(t.id)}/reject`,method:`POST`,bearer:t.bearer,body:t.body});return O.parse(n)}async function _c(e,t){let n=await a(e,{path:`/admin/admins`,bearer:t.bearer});return _a.parse(n)}async function vc(e,t){let n=await a(e,{path:`/admin/admins`,method:`POST`,bearer:t.bearer,body:t.body});return va.parse(n)}async function yc(e,t){let n=await a(e,{path:`/admin/admins/${encodeURIComponent(t.id)}`,method:`PATCH`,bearer:t.bearer,body:t.body});return ya.parse(n)}async function bc(e,t){let n=await a(e,{path:`/admin/admins/${encodeURIComponent(t.id)}`,method:`DELETE`,bearer:t.bearer});return va.parse(n)}async function xc(e,t){let n=await a(e,{path:`/admin/users`,bearer:t.bearer,query:{search:t.search,offset:t.offset,limit:t.limit}});return xa.parse(n)}async function Sc(e,t){let n=await a(e,{path:`/admin/users/${encodeURIComponent(t.id)}`,method:`PATCH`,bearer:t.bearer,body:t.body});return Sa.parse(n)}async function Cc(e,t){let n=await a(e,{path:`/admin/audit`,bearer:t.bearer,query:{action:t.action,actorId:t.actorId,targetType:t.targetType,targetId:t.targetId,offset:t.offset,limit:t.limit}});return wa.parse(n)}async function wc(e,t){let n=await a(e,{path:`/public/apps/${encodeURIComponent(t.slug)}`,bearer:t.bearer});return Ye.parse(n)}async function Tc(e,t){let n=await a(e,{path:`/me/apps/${encodeURIComponent(t.appId)}/report`,method:`POST`,bearer:t.bearer,body:t.report});return so.parse(n)}async function Ec(e,t){let n=await a(e,{path:`/public/library`,bearer:t.bearer,query:{genre:t.genre,q:t.q,before:t.before,limit:t.limit}});return Be.parse(n)}async function Dc(e,t){let n=await a(e,{path:`/public/apps/${encodeURIComponent(t.slug)}/reviews`,bearer:t.bearer,query:{sort:t.sort,limit:t.limit,offset:t.offset}});return ot.parse(n)}async function Oc(e,t){let n=await a(e,{path:`/me/developer/apps/${encodeURIComponent(t.appId)}/reviews`,bearer:t.bearer,query:{sort:t.sort,limit:t.limit,offset:t.offset}});return ot.parse(n)}async function kc(e,t){let n=await a(e,{path:`/me/reviews/${encodeURIComponent(t.slug)}`,bearer:t.bearer});return ut.parse(n)}async function Ac(e,t){let n=await a(e,{path:`/me/reviews/${encodeURIComponent(t.slug)}`,method:`PUT`,bearer:t.bearer,body:t.review});return ut.parse(n)}async function jc(e,t){let n=await a(e,{path:`/me/reviews/${encodeURIComponent(t.slug)}`,method:`DELETE`,bearer:t.bearer});return ut.parse(n)}async function Mc(e,t){let n=await a(e,{path:`/me/reviews/${encodeURIComponent(t.slug)}/reactions`,bearer:t.bearer});return ft.parse(n)}async function Nc(e,t){let n=await a(e,{path:`/me/reviews/${encodeURIComponent(t.slug)}/reactions/${encodeURIComponent(t.reviewId)}`,method:`POST`,bearer:t.bearer,body:t.reaction});return pt.parse(n)}async function Pc(e,t){let n=await a(e,{path:`/me/reviews/${encodeURIComponent(t.slug)}/tips/${encodeURIComponent(t.reviewId)}`,method:`POST`,bearer:t.bearer,idempotencyKey:t.idempotencyKey??crypto.randomUUID(),body:t.tip});return mt.parse(n)}async function Fc(e,t){let n=await a(e,{path:`/public/apps/${encodeURIComponent(t.slug)}/reviews/${encodeURIComponent(t.reviewId)}/comments`,bearer:t.bearer,query:{limit:t.limit,offset:t.offset}});return _t.parse(n)}async function Ic(e,t){let n=await a(e,{path:`/me/reviews/${encodeURIComponent(t.slug)}/comments/${encodeURIComponent(t.reviewId)}`,method:`POST`,bearer:t.bearer,body:t.comment});return vt.parse(n)}async function Lc(e,t){let n=await a(e,{path:`/me/reviews/${encodeURIComponent(t.slug)}/comments/${encodeURIComponent(t.commentId)}`,method:`DELETE`,bearer:t.bearer});return yt.parse(n)}async function Rc(e,t){let n=await a(e,{path:`/me/developer/apps/${encodeURIComponent(t.appId)}/reviews/${encodeURIComponent(t.reviewId)}/reply`,method:`PUT`,bearer:t.bearer,body:t.reply});return bt.parse(n)}async function zc(e,t){let n=await a(e,{path:`/me/developer/apps/${encodeURIComponent(t.appId)}/reviews/${encodeURIComponent(t.reviewId)}/reply`,method:`DELETE`,bearer:t.bearer});return bt.parse(n)}function Bc(){let e=new Map;return{run:async(t,n)=>{let r=e.get(t);if(r!==void 0)return await r;let i=(async()=>{try{return await n()}finally{e.delete(t)}})();return e.set(t,i),await i}}}function Vc(){return{debug:()=>{},info:()=>{},warn:()=>{},error:()=>{}}}function Hc(e=`[tron-sdk]`){return{debug:(t,n)=>{console.log(e,t,n??``)},info:(t,n)=>{console.info(e,t,n??``)},warn:(t,n)=>{console.warn(e,t,n??``)},error:(t,n)=>{console.error(e,t,n??``)}}}const Uc=6e4,Wc=60,Gc=5,Kc={acquire:async()=>{await Promise.resolve()}};function qc(e,t){let n=Math.max(1,t),r=e/1e3,i=n,a=Date.now(),o=[],s=null;function c(){let e=Date.now();for(i=Math.min(n,i+(e-a)*r),a=e;o.length>0&&i>=1;)--i,o.shift()?.();if(o.length>0&&s===null){let e=Math.max(5,Math.ceil((1-i)/r));s=setTimeout(()=>{s=null,c()},e)}}return{acquire:async()=>{await new Promise(e=>{o.push(e),c()})}}}const Jc=e=>e===`GET`||e===`HEAD`,Yc=e=>e/Uc*1e3;function Xc(e={}){let t=qc(e.read?.requestsPerSecond??Yc(60),e.read?.burst??60),n=qc(e.write?.requestsPerSecond??Yc(5),e.write?.burst??5);return{acquire:async e=>{await(Jc(e)?t:n).acquire()}}}function Zc(){let e=new Map;return{async get(t){return e.get(t)??null},async set(t,n){e.set(t,n)},async clear(t){e.delete(t)}}}async function Qc(e,t){let n=await a(e,{path:`/payments/me/activity`,bearer:t.bearer,query:{kind:t.kind,direction:t.direction,sort:t.sort,chain:t.chain,limit:t.limit,cursor:t.cursor,before:t.before,includeInactive:t.includeInactive===!0?`true`:void 0}});return D.parse(n)}async function $c(e,t){let n=await a(e,{path:`/payments/me/activity/group/${encodeURIComponent(t.groupId)}`,bearer:t.bearer});return D.parse(n)}async function el(e,t){let n=await a(e,{path:`/payments/chains`,bearer:t.bearer});return Dt.parse(n)}async function tl(e,t){let n=await a(e,{path:`/payments/me/outstanding`,bearer:t.bearer,query:{chain:t.chain}});return Yt.parse(n)}async function nl(e,t){let n=await a(e,{path:`/payments/me`,bearer:t.bearer,query:{status:t.status,limit:t.limit,before:t.before}});return kt.parse(n)}async function rl(e,t){let n=await a(e,{path:`/me/developer/keys`,method:`POST`,bearer:t.bearer,body:t.body});return Ro.parse(n)}async function il(e,t){let n=await a(e,{path:`/me/developer/keys`,method:`GET`,bearer:t.bearer});return Lo.parse(n)}async function al(e,t){let n=await a(e,{path:`/me/developer/keys/${encodeURIComponent(t.id)}`,method:`DELETE`,bearer:t.bearer});return zo.parse(n)}async function ol(e,t){let n=await a(e,{path:`/me/developer`,bearer:t.bearer});return ms.parse(n)}async function sl(e,t){let n=await a(e,{path:`/me/developer/profile`,method:`PATCH`,bearer:t.bearer,body:t.body});return hs.parse(n)}async function cl(e,t){let n=await $(e,{path:`/me/developer/profile/logo`,bearer:t.bearer,file:t.file,filename:t.filename,contentType:t.contentType});return _s.parse(n)}async function ll(e,t){let n=await a(e,{path:`/me/developer/profile/logo`,method:`DELETE`,bearer:t.bearer});return gs.parse(n)}async function ul(e,t){let n=await a(e,{path:`/me/developer/request`,method:`POST`,bearer:t.bearer,body:t.body});return vs.parse(n)}async function dl(e,t){let n=await $(e,{path:`/me/developer/request/logo`,bearer:t.bearer,file:t.file,filename:t.filename,contentType:t.contentType});return bs.parse(n)}async function fl(e,t){let n=await a(e,{path:`/me/developer/request/logo`,method:`DELETE`,bearer:t.bearer});return ys.parse(n)}async function $(e,t){let n=new FormData,r=t.file instanceof Blob?t.file:new Blob([t.file],{type:t.contentType});n.append(`file`,r,t.filename);let i=await e.fetch(`${pl(e.issuer)}${t.path}`,{method:`POST`,headers:{authorization:`Bearer ${t.bearer}`},body:n});if(!i.ok){let e=await i.text();throw Error(`tron ${i.status}: ${e}`)}return await i.json()}function pl(e){return e.endsWith(`/`)?e.slice(0,-1):e}async function ml(e,t){let n=await a(e,{path:`/me/developer/apps`,method:`POST`,bearer:t.bearer,body:t.body});return Bo.parse(n)}async function hl(e,t){let n=await a(e,{path:`/me/developer/apps/${encodeURIComponent(t.id)}`,method:`PATCH`,bearer:t.bearer,body:t.body});return Ho.parse(n)}async function gl(e,t){let n=await a(e,{path:`/me/developer/apps/${encodeURIComponent(t.id)}`,method:`DELETE`,bearer:t.bearer});return Vo.parse(n)}async function _l(e,t){let n=await $(e,{path:`/me/developer/apps/${encodeURIComponent(t.id)}/logo`,bearer:t.bearer,file:t.file,filename:t.filename,contentType:t.contentType});return Wo.parse(n)}async function vl(e,t){let n=await a(e,{path:`/me/developer/apps/${encodeURIComponent(t.id)}/logo`,method:`DELETE`,bearer:t.bearer});return Uo.parse(n)}async function yl(e,t){let n=await a(e,{path:`/me/developer/apps/${encodeURIComponent(t.id)}/balances`,bearer:t.bearer});return Go.parse(n)}async function bl(e,t){let n=await a(e,{path:`/me/developer/apps/${encodeURIComponent(t.id)}/tron-balance`,bearer:t.bearer});return Ko.parse(n)}async function xl(e,t){let n=await a(e,{path:`/me/developer/apps/${encodeURIComponent(t.id)}/activity`,bearer:t.bearer,query:{kind:t.kind,direction:t.direction,sort:t.sort,chain:t.chain,limit:t.limit,cursor:t.cursor,before:t.before}});return Xo.parse(n)}async function Sl(e,t){let n=await a(e,{path:`/me/developer/apps/${encodeURIComponent(t.id)}/earnings`,bearer:t.bearer,query:{range:t.range,chain:t.chain}});return qo.parse(n)}async function Cl(e,t){let n=await a(e,{path:`/me/developer/apps/${encodeURIComponent(t.id)}/playtime`,bearer:t.bearer,query:{range:t.range}});return Jo.parse(n)}async function wl(e,t){let n=await a(e,{path:`/me/developer/apps/${encodeURIComponent(t.id)}/overview`,bearer:t.bearer});return Yo.parse(n)}async function Tl(e,t){let n=await a(e,{path:`/me/developer/apps/${encodeURIComponent(t.id)}/wallets`,bearer:t.bearer});return Zo.parse(n)}async function El(e,t){let n=await a(e,{path:`/me/developer/apps/${encodeURIComponent(t.id)}/wallets/${encodeURIComponent(t.chain)}/auto-sweep`,method:`PATCH`,bearer:t.bearer,body:t.body});return Qo.parse(n)}async function Dl(e,t){let n=await a(e,{path:`/me/developer/apps/${encodeURIComponent(t.id)}/wallets/${encodeURIComponent(t.chain)}/provision`,method:`POST`,bearer:t.bearer});return $o.parse(n)}async function Ol(e,t){let n=await a(e,{path:`/me/developer/apps/${encodeURIComponent(t.id)}/wallets/${encodeURIComponent(t.chain)}/withdraw`,method:`POST`,bearer:t.bearer,query:{token:t.token}});return es.parse(n)}async function kl(e,t){let n=await a(e,{path:`/me/developer/apps/${encodeURIComponent(t.id)}/wallets/${encodeURIComponent(t.chain)}/consolidate`,method:`POST`,bearer:t.bearer});return ts.parse(n)}async function Al(e,t){let n=await a(e,{path:`/me/developer/apps/${encodeURIComponent(t.id)}/keys/${encodeURIComponent(t.env)}`,method:`PUT`,bearer:t.bearer});return ns.parse(n)}async function jl(e,t){let n=await a(e,{path:`/me/developer/apps/${encodeURIComponent(t.id)}/production-request`,method:`POST`,bearer:t.bearer,body:t.body});return rs.parse(n)}async function Ml(e,t){let n=await a(e,{path:`/me/developer/apps/${encodeURIComponent(t.id)}/payment-status-webhook/secret`,method:`POST`,bearer:t.bearer});return is.parse(n)}async function Nl(e,t){let n=await a(e,{path:`/me/developer/payments/appeals`,bearer:t.bearer,query:{chain:t.chain}});return as.parse(n)}async function Pl(e,t){let n=await a(e,{path:`/me/developer/payments/pending-deposits`,bearer:t.bearer,query:{chain:t.chain}});return os.parse(n)}async function Fl(e,t){let n=await a(e,{path:`/me/developer/payments/tron-balance`,bearer:t.bearer});return ss.parse(n)}async function Il(e,t){let n=await a(e,{path:`/me/developer/apps/${encodeURIComponent(t.id)}/reports`,bearer:t.bearer,query:{status:t.status,limit:t.limit,offset:t.offset}});return co.parse(n)}async function Ll(e,t){let n=await a(e,{path:`/me/developer/apps/${encodeURIComponent(t.id)}/reports/${encodeURIComponent(t.reportId)}`,method:`PATCH`,bearer:t.bearer,body:{status:t.status}});return lo.parse(n)}async function Rl(e,t){let n=await a(e,{path:`/me/developer/apps/${encodeURIComponent(t.appId)}/inventory/items/quote`,method:`POST`,bearer:t.bearer,body:t.registration});return yo.parse(n)}async function zl(e,t){let n=await a(e,{path:`/me/developer/apps/${encodeURIComponent(t.appId)}/inventory/items`,method:`POST`,bearer:t.bearer,body:t.registration});return xo.parse(n)}async function Bl(e,t){let n=await a(e,{path:`/me/developer/apps/${encodeURIComponent(t.appId)}/inventory/collections`,bearer:t.bearer});return vo.parse(n)}async function Vl(e,t){let n=await a(e,{path:`/me/developer/apps/${encodeURIComponent(t.appId)}/inventory/items`,bearer:t.bearer});return bo.parse(n)}async function Hl(e,t){let n=await a(e,{path:`/me/developer/apps/${encodeURIComponent(t.appId)}/inventory/items/${encodeURIComponent(t.itemId)}/permits`,method:`POST`,bearer:t.bearer,body:t.grant});return So.parse(n)}async function Ul(e,t){let n=await a(e,{path:`/me/developer/apps/${encodeURIComponent(t.appId)}/inventory/items/${encodeURIComponent(t.itemId)}/holders`,bearer:t.bearer});return Co.parse(n)}async function Wl(e,t){let n=await $(e,{path:`/me/developer/apps/${encodeURIComponent(t.appId)}/inventory/items/${encodeURIComponent(t.itemId)}/image`,bearer:t.bearer,file:t.file,filename:t.filename,contentType:t.contentType});return wo.parse(n)}async function Gl(e,t){let n=await $(e,{path:`/me/developer/apps/${encodeURIComponent(t.appId)}/inventory/items/${encodeURIComponent(t.itemId)}/banner`,bearer:t.bearer,file:t.file,filename:t.filename,contentType:t.contentType});return To.parse(n)}async function Kl(e,t){let n=await a(e,{path:`/me/developer/apps/${encodeURIComponent(t.appId)}/page`,bearer:t.bearer});return xs.parse(n)}async function ql(e,t){let n=await a(e,{path:`/me/developer/apps/${encodeURIComponent(t.appId)}/page`,method:`PATCH`,bearer:t.bearer,body:t.body});return Ss.parse(n)}async function Jl(e,t){let n=await $(e,{path:`/me/developer/apps/${encodeURIComponent(t.appId)}/page/banner`,bearer:t.bearer,file:t.file,filename:t.filename,contentType:t.contentType});return Cs.parse(n)}async function Yl(e,t){await s(e,{path:`/me/developer/apps/${encodeURIComponent(t.appId)}/page/banner`,method:`DELETE`,bearer:t.bearer})}async function Xl(e,t){let n=await $(e,{path:`/me/developer/apps/${encodeURIComponent(t.appId)}/page/thumbnail`,bearer:t.bearer,file:t.file,filename:t.filename,contentType:t.contentType});return ws.parse(n)}async function Zl(e,t){await s(e,{path:`/me/developer/apps/${encodeURIComponent(t.appId)}/page/thumbnail`,method:`DELETE`,bearer:t.bearer})}async function Ql(e,t){let n=await $(e,{path:`/me/developer/apps/${encodeURIComponent(t.appId)}/page/thumbnail-video`,bearer:t.bearer,file:t.file,filename:t.filename,contentType:t.contentType});return Ts.parse(n)}async function $l(e,t){await s(e,{path:`/me/developer/apps/${encodeURIComponent(t.appId)}/page/thumbnail-video`,method:`DELETE`,bearer:t.bearer})}async function eu(e,t){let n=await $(e,{path:`/me/developer/apps/${encodeURIComponent(t.appId)}/page/gallery`,bearer:t.bearer,file:t.file,filename:t.filename,contentType:t.contentType});return Es.parse(n)}async function tu(e,t){let n=await a(e,{path:`/me/developer/apps/${encodeURIComponent(t.appId)}/page/submit-for-review`,method:`POST`,bearer:t.bearer});return Ds.parse(n)}async function nu(e,t){let n=await a(e,{path:`/me/developer/apps/${encodeURIComponent(t.appId)}/page/unpublish`,method:`POST`,bearer:t.bearer});return Os.parse(n)}async function ru(e,t){let n=await a(e,{path:`/me/developer/apps/${encodeURIComponent(t.id)}/participants`,method:`GET`,bearer:t.bearer});return cs.parse(n)}async function iu(e,t){let n=await a(e,{path:`/me/developer/apps/${encodeURIComponent(t.id)}/participants`,method:`POST`,bearer:t.bearer,body:t.body});return ls.parse(n)}async function au(e,t){let n=await a(e,{path:`/me/developer/apps/${encodeURIComponent(t.id)}/participants/${encodeURIComponent(t.userId)}`,method:`DELETE`,bearer:t.bearer});return us.parse(n)}async function ou(e,t){let n=await a(e,{path:`/me/developer/invites`,method:`GET`,bearer:t.bearer});return ds.parse(n)}async function su(e,t){let n=await a(e,{path:`/me/developer/invites/${encodeURIComponent(t.appId)}/accept`,method:`POST`,bearer:t.bearer});return fs.parse(n)}async function cu(e,t){let n=await a(e,{path:`/me/developer/invites/${encodeURIComponent(t.appId)}/decline`,method:`POST`,bearer:t.bearer});return ps.parse(n)}async function lu(e,t){let n=await a(e,{path:`/me/developer/apps/${encodeURIComponent(t.appId)}/inventory/items/${encodeURIComponent(t.itemId)}/vault-permits`,method:`POST`,bearer:t.bearer,body:t.grant});return Eo.parse(n)}async function uu(e,t){let n=await a(e,{path:`/me/developer/apps/${encodeURIComponent(t.appId)}/inventory/items/${encodeURIComponent(t.itemId)}/withdraw-permits`,method:`POST`,bearer:t.bearer,body:t.grant});return Do.parse(n)}async function du(e,t){let n=await a(e,{path:`/me/inventory`,bearer:t.bearer});return Cr.parse(n)}async function fu(e,t){let n=await a(e,{path:`/oauth/inventory`,bearer:t.bearer});return Cr.parse(n)}async function pu(e,t){let n=await a(e,{path:`/me/inventory/nft-transfers/quote`,method:`POST`,bearer:t.bearer,body:t.body});return Mo.parse(n)}async function mu(e,t){let n=await a(e,{path:`/me/inventory/nft-transfers`,method:`POST`,bearer:t.bearer,body:t.body});return No.parse(n)}async function hu(e,t){let n=await a(e,{path:`/me/inventory/permits`,bearer:t.bearer});return go.parse(n)}async function gu(e,t){let n=await a(e,{path:`/me/inventory/permits/${encodeURIComponent(t.permitId)}/redeem`,method:`POST`,bearer:t.bearer});return _o.parse(n)}async function _u(e,t){let n=await a(e,{path:`/oauth/inventory/mint`,method:`POST`,bearer:t.appBearer,body:t.body});return Er.parse(n)}async function vu(e,t){let n=await a(e,{path:`/me/inventory/vault-permits`,bearer:t.bearer});return Oo.parse(n)}async function yu(e,t){let n=await a(e,{path:`/me/inventory/vault-permits/${encodeURIComponent(t.permitId)}/sign`,method:`POST`,bearer:t.bearer});return ko.parse(n)}async function bu(e,t){let n=await a(e,{path:`/me/inventory/vault-permits/${encodeURIComponent(t.permitId)}/relayed/quote`,method:`POST`,bearer:t.bearer});return Ao.parse(n)}async function xu(e,t){let n=await a(e,{path:`/me/inventory/vault-permits/${encodeURIComponent(t.permitId)}/relayed/submit`,method:`POST`,bearer:t.bearer,body:t.body});return jo.parse(n)}async function Su(e,t){let n=await a(e,{path:`/me/inventory/vaulted`,bearer:t.bearer});return Po.parse(n)}async function Cu(e,t){let n=await a(e,{path:`/oauth/inventory/vaulted`,bearer:t.bearer});return Fo.parse(n)}async function wu(e,t){let n=await a(e,{path:`/me/dm-key-backup`,bearer:t.bearer});return ar.parse(n)}async function Tu(e,t){let n=await a(e,{path:`/me/dm-key-backup`,method:`POST`,bearer:t.bearer,body:t.body});return or.parse(n)}async function Eu(e,t){let n=await a(e,{path:`/me/dm-key-backup/unlock`,method:`POST`,bearer:t.bearer,body:t.body});return sr.parse(n)}async function Du(e,t){let n=await a(e,{path:`/me/dm-key`,method:`PUT`,bearer:t.bearer,body:t.body});return nr.parse(n)}async function Ou(e,n){try{let t=await a(e,{path:`/me/dm-key`,bearer:n.bearer});return nr.parse(t)}catch(e){if(e instanceof t&&e.status===404)return null;throw e}}async function ku(e,t){let n=await a(e,{path:`/me/threads/${encodeURIComponent(t.threadId)}/dm-key`,bearer:t.bearer});return nr.parse(n)}async function Au(e,t){let n=await a(e,{path:`/me/threads/dm-keys`,method:`POST`,bearer:t.bearer,body:{threadIds:[...t.threadIds]}});return ir.parse(n)}async function ju(e,t){let n=new FormData,r=t.file instanceof Blob?t.file:new Blob([t.file],{type:t.contentType});n.append(`file`,r,t.filename);let i=await e.fetch(`${Nu(e.issuer)}/me/threads/${encodeURIComponent(t.threadId)}/logo`,{method:`POST`,headers:{authorization:`Bearer ${t.bearer}`},body:n});if(!i.ok){let e=await i.text();throw Error(`tron ${i.status}: ${e}`)}let a=await i.json();return R.parse(a)}async function Mu(e,t){let n=await a(e,{path:`/me/threads/${encodeURIComponent(t.threadId)}/logo`,method:`DELETE`,bearer:t.bearer});return R.parse(n)}function Nu(e){return e.endsWith(`/`)?e.slice(0,-1):e}async function Pu(e,t){let n=await a(e,{path:`/me/threads/${encodeURIComponent(t.threadId)}/messages/${encodeURIComponent(t.messageId)}`,method:`DELETE`,bearer:t.bearer});return L.parse(n)}async function Fu(e,t){let n=await a(e,{path:`/me/threads/${encodeURIComponent(t.threadId)}/messages/${encodeURIComponent(t.messageId)}`,method:`PATCH`,bearer:t.bearer,body:t.body});return Jn.parse(n)}async function Iu(e,t){let n=await a(e,{path:`/me/threads/${encodeURIComponent(t.threadId)}/messages/${encodeURIComponent(t.messageId)}/reactions/${encodeURIComponent(t.emoji)}`,method:`PUT`,bearer:t.bearer});return Qn.parse(n)}async function Lu(e,t){let n=await a(e,{path:`/me/threads/${encodeURIComponent(t.threadId)}/messages/${encodeURIComponent(t.messageId)}/reactions/${encodeURIComponent(t.emoji)}`,method:`DELETE`,bearer:t.bearer});return Qn.parse(n)}async function Ru(e,t){let n=await a(e,{path:`/me/threads/${encodeURIComponent(t.threadId)}/participants/${encodeURIComponent(t.userId)}`,method:`DELETE`,bearer:t.bearer});return R.parse(n)}async function zu(e,t){let n=await a(e,{path:`/me/threads/${encodeURIComponent(t.threadId)}/participants/${encodeURIComponent(t.userId)}/role`,method:`PATCH`,bearer:t.bearer,body:t.body});return R.parse(n)}async function Bu(e,t){let n=await a(e,{path:`/me/threads/${encodeURIComponent(t.threadId)}`,method:`DELETE`,bearer:t.bearer});return L.parse(n)}async function Vu(e,t){let n=await a(e,{path:`/me/threads/${encodeURIComponent(t.threadId)}`,method:`PATCH`,bearer:t.bearer,body:t.body});return R.parse(n)}async function Hu(e,t){let n=await a(e,{path:`/me/threads/${encodeURIComponent(t.threadId)}/hide`,method:`POST`,bearer:t.bearer});return L.parse(n)}async function Uu(e,t){let n=await a(e,{path:`/me/threads/${encodeURIComponent(t.threadId)}/invite`,method:`POST`,bearer:t.bearer,body:t.body});return R.parse(n)}async function Wu(e,t){let n=await a(e,{path:`/me/threads/${encodeURIComponent(t.threadId)}/leave`,method:`POST`,bearer:t.bearer});return L.parse(n)}async function Gu(e,t){let n=await a(e,{path:`/me/threads/${encodeURIComponent(t.threadId)}/pin`,method:`POST`,bearer:t.bearer});return $n.parse(n)}async function Ku(e,t){let n=await a(e,{path:`/me/threads/${encodeURIComponent(t.threadId)}/pin`,method:`DELETE`,bearer:t.bearer});return L.parse(n)}async function qu(e){let t=await a(e,{path:`/.well-known/oauth-authorization-server`});return de.parse(t)}function Ju(e){let t=e.endsWith(`/`)?e.slice(0,-1):e;return{authorize:`${t}/oauth/authorize`,token:`${t}/oauth/token`,userinfo:`${t}/userinfo`,revoke:`${t}/oauth/revoke`}}async function Yu(){let e=$u(Qu(32));return{codeVerifier:e,codeChallenge:await Xu(e)}}async function Xu(e){let t=new TextEncoder().encode(e),n=await crypto.subtle.digest(`SHA-256`,t);return $u(new Uint8Array(n))}function Zu(e=32){return $u(Qu(e))}function Qu(e){let t=new Uint8Array(e);return crypto.getRandomValues(t),t}function $u(e){let t=``;for(let n of e)t+=String.fromCodePoint(n);return(typeof btoa==`function`?btoa(t):Buffer.from(t,`binary`).toString(`base64`)).replaceAll(`+`,`-`).replaceAll(`/`,`_`).replaceAll(/=+$/g,``)}async function ed(e){let t=e.pkce??await Yu(),n=e.state??Zu(),r=new URLSearchParams({response_type:`code`,client_id:e.clientId,redirect_uri:e.redirectUri,scope:e.scopes.join(` `),state:n,code_challenge:t.codeChallenge,code_challenge_method:`S256`});e.forceConsent===!0&&r.set(`prompt`,`consent`);let{authorize:i}=Ju(e.issuer);return{url:`${i}?${r.toString()}`,state:n,codeVerifier:t.codeVerifier,codeChallenge:t.codeChallenge}}async function td(e,t){let n={token:t.token,client_id:t.clientId};t.tokenTypeHint!==void 0&&(n.token_type_hint=t.tokenTypeHint),t.clientSecret!==void 0&&(n.client_secret=t.clientSecret),await s(e,{path:`/oauth/revoke`,method:`POST`,form:n})}async function nd(e,t){let n={grant_type:`authorization_code`,code:t.code,redirect_uri:t.redirectUri,code_verifier:t.codeVerifier,client_id:t.clientId};t.clientSecret!==void 0&&(n.client_secret=t.clientSecret);let r=await a(e,{path:`/oauth/token`,method:`POST`,form:n});return ge.parse(r)}async function rd(e,t){let n={grant_type:`refresh_token`,refresh_token:t.refreshToken,client_id:t.clientId};t.clientSecret!==void 0&&(n.client_secret=t.clientSecret),t.scope!==void 0&&(n.scope=t.scope.join(` `));let r=await a(e,{path:`/oauth/token`,method:`POST`,form:n});return ge.parse(r)}function id(e,t){return{accessToken:t.access_token,refreshToken:t.refresh_token??null,expiresAt:e+t.expires_in*1e3,scope:t.scope??null,tokenType:t.token_type}}async function ad(e,t){let n=await a(e,{path:`/userinfo`,bearer:t.bearer});return xe.parse(n)}async function od(e,t){let n=await a(e,{path:`/payments/appeals`,method:`POST`,bearer:t.bearer,body:t.body});return Za.parse(n)}async function sd(e,t){let n=await a(e,{path:`/payments/appeals/pot-leg`,method:`POST`,bearer:t.bearer,body:t.body});return Za.parse(n)}async function cd(e,t){let n=await a(e,{path:`/payments/appeals/${encodeURIComponent(t.appealId)}/room`,bearer:t.bearer});return Ja.parse(n)}async function ld(e,t){let n=await a(e,{path:`/payments/appeals/${encodeURIComponent(t.appealId)}/room/messages`,method:`POST`,bearer:t.bearer,body:t.body});return Ya.parse(n)}async function ud(e,t){let n=new FormData,r=t.file instanceof Blob?t.file:new Blob([t.file],{type:t.contentType});n.append(`file`,r,t.filename);let i=await e.fetch(`${dd(e.issuer)}/payments/appeals/${encodeURIComponent(t.appealId)}/room/attachments`,{method:`POST`,headers:{authorization:`Bearer ${t.bearer}`},body:n});if(!i.ok){let e=await i.text();throw Error(`tron ${i.status}: ${e}`)}let a=await i.json();return V.parse(a)}function dd(e){return e.endsWith(`/`)?e.slice(0,-1):e}async function fd(e,t){let n=t.idempotencyKey??crypto.randomUUID(),r=await s(e,{path:`/oauth/payments/charge`,method:`POST`,bearer:t.bearer,body:t.body,idempotencyKey:n,raw:!0});if(r.status===402){let e=await c(r),t=Te.parse(e);return{status:`monthly_limit_exceeded`,currentLimitCents:t.currentLimitCents,monthSpentCents:t.monthSpentCents,attemptedUsdCents:t.attemptedUsdCents,redirectUrl:t.redirectUrl}}if(!r.ok){let e=await r.text();throw Error(`tron ${r.status}: ${e}`)}let i=await c(r);return we.parse(i)}async function pd(e,t){let n=await a(e,{path:`/oauth/payments/intent/${encodeURIComponent(t.intentId)}`,bearer:t.bearer});return ke.parse(n)}async function md(e,t){let n=await a(e,{path:`/oauth/payments/intent/${encodeURIComponent(t.intentId)}/sign`,method:`POST`,bearer:t.bearer});return Ae.parse(n)}async function hd(e,t){let n=await a(e,{path:`/oauth/payments/intent/${encodeURIComponent(t.intentId)}/complete`,method:`POST`,bearer:t.bearer,body:t.body});return je.parse(n)}async function gd(e,t){let n=await a(e,{path:`/oauth/payments/intent/${encodeURIComponent(t.intentId)}/deny`,method:`POST`,bearer:t.bearer});return je.parse(n)}async function _d(e,t){let n=await a(e,{path:`/oauth/payments/limits`,bearer:t.bearer});return Ee.parse(n)}async function vd(e,t){let n=await a(e,{path:`/payments/me/moonpay/availability`,bearer:t.bearer});return Xt.parse(n)}async function yd(e,t){let n=await a(e,{path:`/payments/me/moonpay/buy-url`,method:`POST`,bearer:t.bearer,body:t.body});return Zt.parse(n)}async function bd(e,t){let n=await a(e,{path:`/payments/me/moonpay/sell-url`,method:`POST`,bearer:t.bearer,body:t.body});return Qt.parse(n)}async function xd(e,t){let{bearer:n,chain:r,token:i,amount:o,usdCents:s}=t,c=await a(e,{path:`/oauth/payments/price`,bearer:n,query:{chain:r,token:i,amount:o,usdCents:s===void 0?void 0:String(s)}});return De.parse(c)}async function Sd(e,t){let n=await a(e,{path:`/oauth/payments/status/${encodeURIComponent(t.intentId)}`,bearer:t.bearer});return Oe.parse(n)}async function Cd(e,t){let n=await a(e,{path:`/payments/me/tron`,bearer:t.bearer});return $t.parse(n)}async function wd(e,t){let n=await a(e,{path:`/payments/me/tron/ledger${t.before===void 0?``:`?before=${encodeURIComponent(t.before)}`}`,bearer:t.bearer});return tn.parse(n)}async function Td(e,t){let n=await a(e,{path:`/payments/me/tron/deposit`,method:`POST`,bearer:t.bearer,body:t.body});return nn.parse(n)}async function Ed(e,t){let n=await a(e,{path:`/payments/me/tron/transfer`,method:`POST`,bearer:t.bearer,idempotencyKey:t.idempotencyKey??crypto.randomUUID(),body:t.body});return rn.parse(n)}async function Dd(e,t){let n=await a(e,{path:`/payments/me/tron/security`,bearer:t.bearer});return an.parse(n)}async function Od(e,t){let n=await a(e,{path:`/payments/me/tron/security`,method:`PUT`,bearer:t.bearer,body:t.setting});return an.parse(n)}async function kd(e,t){let n=await a(e,{path:`/payments/me/tron/transfer/challenge`,method:`POST`,bearer:t.bearer,body:t.body});return cn.parse(n)}async function Ad(e,t){let n=await a(e,{path:`/payments/me/tron/connect`,method:`POST`,bearer:t.bearer});return _n.parse(n)}async function jd(e,t){let n=await a(e,{path:`/payments/me/tron/cashouts`,method:`POST`,bearer:t.bearer,body:t.body});return vn.parse(n)}async function Md(e,t){let n=await a(e,{path:`/payments/me/tron/cashouts`,bearer:t.bearer});return yn.parse(n)}function Nd(e){let t=new URL(e.apiOrigin).origin,n=e.gameOrigin??globalThis.location.origin,r=e.container??document.body,i=e.background??``,a=document.createElement(`iframe`),o=i===``?``:`&bg=${encodeURIComponent(i)}`;a.src=`${t}/presence/embed?client_id=${encodeURIComponent(e.clientId)}&origin=${encodeURIComponent(n)}${o}`,a.title=`Metatron presence`,e.styleIframe?e.styleIframe(a):(a.style.border=`0`,a.style.display=`block`,a.style.width=`190px`,a.style.height=`44px`),i!==``&&(a.style.background=i);let s=null,c=t=>{t===`overlay`?(s??=a.style.cssText,a.style.cssText=`position:fixed;inset:0;width:100%;height:100%;border:0;z-index:2147483646;opacity:1;transition:opacity 160ms ease`):s!==null&&(a.style.cssText=s,s=null),e.onPresentationChange?.(t)},ee=n=>{if(n.origin!==t||n.source!==a.contentWindow)return;let r=n.data;if(r?.source===`tg-presence`)switch(r.kind){case`play-session`:e.onPlaySessionId?.(typeof r.playSessionId==`string`?r.playSessionId:null);break;case`status`:typeof r.status==`string`&&e.onStatus?.(r.status);break;case`auth`:e.onAuthChange?.(r.authenticated===!0);break;case`expand`:c(`overlay`);break;case`collapse`:c(`chip`);break;default:break}};return window.addEventListener(`message`,ee),r.append(a),{destroy(){window.removeEventListener(`message`,ee),a.remove()}}}async function Pd(e,t){let n=await a(e,{path:`/me/stats`,bearer:t.bearer});return yr.parse(n)}async function Fd(e,t){let n=await a(e,{path:`/me/earnings/timeseries`,bearer:t.bearer,query:{days:t.days}});return xr.parse(n)}async function Id(e,t){let n=await a(e,{path:`/me/threads`,bearer:t.bearer,query:{limit:t.limit,cursor:t.cursor}});return Vn.parse(n)}async function Ld(e,t){let n=await a(e,{path:`/me/threads`,method:`POST`,bearer:t.bearer,body:t.body});return I.parse(n)}async function Rd(e,t){let n=await a(e,{path:`/me/threads/${encodeURIComponent(t.threadId)}/messages`,bearer:t.bearer,query:{limit:t.limit,cursor:t.cursor}});return Yn.parse(n)}async function zd(e,t){await s(e,{path:`/me/threads/${encodeURIComponent(t.threadId)}/messages`,method:`POST`,bearer:t.bearer,body:t.body})}async function Bd(e,t){await s(e,{path:`/me/threads/${encodeURIComponent(t.threadId)}/read`,method:`POST`,bearer:t.bearer})}async function Vd(e,t){let n=new FormData,r=t.file instanceof Blob?t.file:new Blob([t.file],{type:t.contentType});n.append(`file`,r,t.filename);let i=await e.fetch(`${Hd(e.issuer)}/me/threads/${encodeURIComponent(t.threadId)}/attachments`,{method:`POST`,headers:{authorization:`Bearer ${t.bearer}`},body:n});if(!i.ok){let e=await i.text();throw Error(`tron ${i.status}: ${e}`)}let a=await i.json();return V.parse(a)}function Hd(e){return e.endsWith(`/`)?e.slice(0,-1):e}async function Ud(e,t){let n=await a(e,{path:`/me/notifications`,bearer:t.bearer,query:{limit:t.limit,cursor:t.cursor}});return ii.parse(n)}async function Wd(e,t){await s(e,{path:`/me/notifications/${encodeURIComponent(t.notificationId)}`,method:`PATCH`,bearer:t.bearer,body:t.body})}async function Gd(e,t){await s(e,{path:`/me/notifications/mark-all-read`,method:`POST`,bearer:t.bearer})}async function Kd(e,t){let n=await a(e,{path:`/me/playtime`,bearer:t.bearer});return gr.parse(n)}async function qd(e,t){let n=await a(e,{path:`/me/playtime/timeseries`,bearer:t.bearer,query:{days:t.days}});return vr.parse(n)}async function Jd(e,t){let n=await a(e,{path:`/users/${encodeURIComponent(t.handle)}`,bearer:t.bearer});return yi.parse(n)}async function Yd(e,t){let n=await a(e,{path:`/users/search`,bearer:t.bearer,query:{q:t.q,limit:t.limit}});return xi.parse(n)}async function Xd(e,t){let n=await a(e,{path:`/me/referral`,bearer:t.bearer});return lr.parse(n)}async function Zd(e,t){let n=await a(e,{path:`/me/referral/code`,method:`POST`,bearer:t.bearer,body:{regenerate:t.regenerate??!1}});return ur.parse(n)}async function Qd(e,t){let n=await a(e,{path:`/me/referral/preview`,query:{code:t.code},bearer:t.bearer});return dr.parse(n)}async function $d(e,t){let n={code:t.code,source:t.source},r=await a(e,{path:`/me/referral/bind`,method:`POST`,bearer:t.bearer,body:n});return fr.parse(r)}async function ef(e,t){await s(e,{path:`/users/${encodeURIComponent(t.userId)}/follow`,method:`POST`,bearer:t.bearer})}async function tf(e,t){await s(e,{path:`/users/${encodeURIComponent(t.userId)}/follow`,method:`DELETE`,bearer:t.bearer})}async function nf(e,t){await s(e,{path:`/users/${encodeURIComponent(t.userId)}/friend`,method:`POST`,bearer:t.bearer})}async function rf(e,t){await s(e,{path:`/users/${encodeURIComponent(t.userId)}/friend`,method:`DELETE`,bearer:t.bearer})}async function af(e,t){await s(e,{path:`/me/friend-requests/${encodeURIComponent(t.requestId)}`,method:`PATCH`,bearer:t.bearer,body:{decision:t.decision}})}async function of(e,t){await s(e,{path:`/me/friend-requests/${encodeURIComponent(t.requestId)}`,method:`DELETE`,bearer:t.bearer})}async function sf(e,t){let n=await a(e,{path:`/me/friends`,bearer:t.bearer});return si.parse(n)}async function cf(e,t){let n=await a(e,{path:`/oauth/friends`,bearer:t.bearer});return ci.parse(n)}async function lf(e,t){let n=await a(e,{path:`/me/socials`,bearer:t.bearer});return li.parse(n)}async function uf(e,t){let n=await a(e,{path:`/me/wallets`,bearer:t.bearer});return On.parse(n)}async function df(e,t){let n=await a(e,{path:`/me/wallets/${encodeURIComponent(t.address)}/delegate`,bearer:t.bearer});return En.parse(n)}async function ff(e,t){let n=await a(e,{path:`/me/wallets/${encodeURIComponent(t.address)}/delegate`,method:`POST`,bearer:t.bearer,body:t.body});return An.parse(n)}async function pf(e,t){let n=await a(e,{path:`/me/wallets/${encodeURIComponent(t.address)}/delegate`,method:`DELETE`,bearer:t.bearer});return jn.parse(n)}async function mf(e,t){let n=await a(e,{path:`/me/wallets/${encodeURIComponent(t.address)}`,method:`PATCH`,bearer:t.bearer,body:t.body});return kn.parse(n)}async function hf(e,t){let n=await a(e,{path:`/me/wallets`,bearer:t.bearer});return On.parse(n)}const gf=e.object({event:e.enum([`intent.completed`,`intent.denied`,`intent.expired`,`intent.txhash_indexed`]),deliveredAt:e.iso.datetime(),intent:Oe});async function _f(e){let t=e.signatureHeader;if(typeof t!=`string`||t===``)return{ok:!1,reason:`missing_signature`};let n=e.timestampHeader;if(typeof n!=`string`||n===``)return{ok:!1,reason:`missing_timestamp`};let r=Number(n);if(!Number.isFinite(r)||r<=0)return{ok:!1,reason:`invalid_timestamp`};let i=e.toleranceSeconds??300,a=Math.floor((e.now??Date.now())/1e3);if(Math.abs(a-r)>i)return{ok:!1,reason:`stale_timestamp`};if(!yf(await vf(e.secret,`${n}.${e.rawBody}`),t))return{ok:!1,reason:`signature_mismatch`};let o;try{o=JSON.parse(e.rawBody)}catch{return{ok:!1,reason:`schema_mismatch`}}let s=gf.safeParse(o);return s.success?{ok:!0,body:s.data}:{ok:!1,reason:`schema_mismatch`}}async function vf(e,t){let n=new TextEncoder,r=await crypto.subtle.importKey(`raw`,n.encode(e),{name:`HMAC`,hash:`SHA-256`},!1,[`sign`]),i=await crypto.subtle.sign(`HMAC`,r,n.encode(t)),a=new Uint8Array(i),o=``;for(let e of a)o+=e.toString(16).padStart(2,`0`);return o}function yf(e,t){let n=e.toLowerCase(),r=t.toLowerCase();if(n.length!==r.length)return!1;let i=0;for(let e=0;e<n.length;e++)i|=n.charCodeAt(e)^r.charCodeAt(e);return i===0}const bf=`x-metatron-signature`,xf=`x-metatron-timestamp`,Sf=new Set([`localhost`,`127.0.0.1`,`::1`]);function Cf(e,t={}){if(!(t.isProduction??wf()))return;let n;try{n=new URL(e)}catch{throw Error(`@metatrongg/sdk: invalid issuer URL: ${e}`)}if(n.protocol!==`https:`&&!(n.protocol===`http:`&&Sf.has(n.hostname)))throw Error(`@metatrongg/sdk: issuer must be https:// in production (got ${n.protocol}//${n.host})`)}function wf(){return typeof process<`u`&&typeof process.env==`object`?process.env.NODE_ENV===`production`:!1}var Tf=class{ctx;clientId;redirectUri;scopes;tokenStore;constructor(e){Cf(e.issuer),this.ctx={issuer:e.issuer,fetch:e.fetch??fetch.bind(globalThis),logger:e.logger??Vc(),rateLimiter:e.rateLimit===!1?void 0:Xc(e.rateLimit??{}),dedupe:e.dedupe===!1?void 0:Bc()},this.clientId=e.clientId,this.redirectUri=e.redirectUri,this.scopes=e.scopes,this.tokenStore=e.tokenStore}get transport(){return this.ctx}get oauth(){return{discover:async()=>await qu(this.ctx),buildAuthorizeUrl:async e=>await ed({issuer:this.ctx.issuer,clientId:this.clientId,redirectUri:this.redirectUri,scopes:this.scopes,state:e?.state,forceConsent:e?.forceConsent}),exchangeCode:async e=>{let t=await nd(this.ctx,{code:e.code,redirectUri:this.redirectUri,codeVerifier:e.codeVerifier,clientId:this.clientId}),n=id(Date.now(),t);return await this.tokenStore?.set(this.clientId,n),n},refresh:async e=>{let t=await rd(this.ctx,{refreshToken:e.refreshToken,clientId:this.clientId,scope:e.scope}),n=id(Date.now(),t);return await this.tokenStore?.set(this.clientId,n),n},revoke:async e=>{await td(this.ctx,{token:e.token,tokenTypeHint:e.tokenTypeHint,clientId:this.clientId})},signOut:async e=>{await td(this.ctx,{token:e.refreshToken,tokenTypeHint:`refresh_token`,clientId:this.clientId}),await this.tokenStore?.clear(this.clientId)},userInfo:async e=>await ad(this.ctx,e),getStoredTokens:async()=>await(this.tokenStore?.get(this.clientId)??Promise.resolve(null))}}get payments(){return{charge:async e=>await fd(this.ctx,e),limits:async e=>await _d(this.ctx,e),price:async e=>await xd(this.ctx,e),status:async e=>await Sd(this.ctx,e),intent:{get:async e=>await pd(this.ctx,e),sign:async e=>await md(this.ctx,e),complete:async e=>await hd(this.ctx,e),deny:async e=>await gd(this.ctx,e)}}}get users(){return{get:async e=>await Jd(this.ctx,e),search:async e=>await Yd(this.ctx,e),follow:async e=>{await ef(this.ctx,e)},unfollow:async e=>{await tf(this.ctx,e)},friendRequest:async e=>{await nf(this.ctx,e)},decideFriendRequest:async e=>{await af(this.ctx,e)},cancelFriendRequest:async e=>{await of(this.ctx,e)},friends:async e=>await sf(this.ctx,e),me:async e=>await a(this.ctx,{path:`/me`,bearer:e.bearer})}}get messaging(){return{listThreads:async e=>await Id(this.ctx,e),createDirect:async e=>await Ld(this.ctx,e),listMessages:async e=>await Rd(this.ctx,e),send:async e=>{await zd(this.ctx,e)},markRead:async e=>{await Bd(this.ctx,e)},uploadAttachment:async e=>await Vd(this.ctx,e)}}get notifications(){return{list:async e=>await Ud(this.ctx,e),markAllRead:async e=>{await Gd(this.ctx,e)}}}get wallets(){return{list:async e=>await uf(this.ctx,e)}}get inventory(){return{list:async e=>await du(this.ctx,e)}}get socials(){return{list:async e=>await lf(this.ctx,e)}}get referral(){return{get:async e=>await Xd(this.ctx,e),createCode:async e=>await Zd(this.ctx,e),preview:async e=>await Qd(this.ctx,e),bind:async e=>await $d(this.ctx,e)}}};function Ef(e={}){if(typeof document>`u`)throw TypeError(`@metatrongg/sdk: cookie token store requires a browser environment`);let t=e.cookieName??`tg_sdk_tokens`,n=e.path??`/`,r=e.secure??!0,i=e.sameSite??`Lax`,a=e.maxAgeSeconds??3600*24*30;function o(e){return`${t}:${e}`}return{async get(e){let t=Df(o(e));if(t===null)return null;try{return JSON.parse(t)}catch{return null}},async set(e,t){Of(o(e),JSON.stringify(t),{path:n,secure:r,sameSite:i,maxAgeSeconds:a})},async clear(e){Of(o(e),``,{path:n,secure:r,sameSite:i,maxAgeSeconds:0})}}}function Df(e){let t=`${encodeURIComponent(e)}=`;for(let e of document.cookie.split(`; `))if(e.startsWith(t))return decodeURIComponent(e.slice(t.length));return null}function Of(e,t,n){let r=[`${encodeURIComponent(e)}=${encodeURIComponent(t)}`,`Path=${n.path}`,`SameSite=${n.sameSite}`,`Max-Age=${n.maxAgeSeconds}`];n.secure&&r.push(`Secure`),document.cookie=r.join(`; `)}export{Kc as NOOP_RATE_LIMITER,Gc as SERVER_RATE_LIMIT_MAX_MUTATING,Wc as SERVER_RATE_LIMIT_MAX_READ,Uc as SERVER_RATE_LIMIT_WINDOW_MS,r as TRON_WS_CLOSE_CODES,Tf as TronBrowserClient,t as TronError,n as TronOauthError,i as TronWsCloseError,bf as WEBHOOK_SIGNATURE_HEADER,xf as WEBHOOK_TIMESTAMP_HEADER,su as acceptDeveloperInvite,vc as addAdmin,dc as addAppealBlacklist,Iu as addReaction,hc as approveTronCashout,Au as batchThreadDmKeys,$d as bindReferral,ed as buildAuthorizeUrl,of as cancelFriendRequest,fd as charge,Ic as commentOnGameReview,hd as completePaymentIntent,kl as consolidateDeveloperAppWallet,Hc as createConsoleLogger,Ef as createCookieTokenStore,ff as createDelegation,rl as createDeveloperApiKey,ml as createDeveloperApp,Hl as createDeveloperAppMintPermit,lu as createDeveloperVaultPermit,uu as createDeveloperWithdrawPermit,Ld as createDirectThread,Zc as createInMemoryTokenStore,Bc as createInflightDedup,Vc as createNoopLogger,Xc as createRateLimiter,Zd as createReferralCode,jd as createTronCashout,Ad as createTronConnectOnboarding,Td as createTronDeposit,Ed as createTronTransfer,kd as createTronTransferChallenge,af as decideFriendRequest,cu as declineDeveloperInvite,Ju as defaultEndpoints,Yl as deleteAppPageBanner,Zl as deleteAppPageThumbnail,$l as deleteAppPageThumbnailVideo,As as deleteAvatar,pf as deleteDelegation,gl as deleteDeveloperApp,vl as deleteDeveloperAppLogo,ll as deleteDeveloperProfileLogo,fl as deleteDeveloperRequestLogo,Lc as deleteGameReviewComment,zc as deleteGameReviewReply,Pu as deleteMessage,jc as deleteMyGameReview,Bu as deleteThread,Mu as deleteThreadLogo,gd as denyPaymentIntent,Fu as editMessage,nd as exchangeAuthorizationCode,mu as executeNftTransfer,qu as fetchAuthorizationServerMetadata,ad as fetchUserInfo,od as fileAppeal,sd as fileAppealPotLeg,ef as followUser,ec as forceWithdrawVaultCustody,Yu as generatePkce,Zu as generateState,Qc as getActivity,$c as getActivityGroup,Ks as getAdminAppealRoom,rc as getAppFeeConfig,wc as getAppPage,Bs as getAppPageChanges,cd as getAppealRoom,df as getDelegation,xl as getDeveloperAppActivity,yl as getDeveloperAppBalances,Sl as getDeveloperAppEarnings,Ul as getDeveloperAppInventoryItemHolders,wl as getDeveloperAppOverview,Kl as getDeveloperAppPage,Cl as getDeveloperAppPlaytime,bl as getDeveloperAppTronBalance,Tl as getDeveloperAppWallets,Nl as getDeveloperPaymentAppeals,Pl as getDeveloperPaymentPendingDeposits,ol as getDeveloperStatus,Fl as getDeveloperTronBalanceSummary,wu as getDmKeyBackupStatus,Fd as getEarningsTimeseries,Sd as getIntentStatus,Ec as getLibrary,Pd as getMeStats,vd as getMoonpayAvailability,Ou as getMyDmKey,kc as getMyGameReview,Mc as getMyGameReviewReactions,tl as getOutstanding,el as getPaymentChains,nl as getPaymentHistory,pd as getPaymentIntent,_d as getPaymentLimits,xd as getPaymentPrice,tc as getPlatformFees,Kd as getPlaytime,qd as getPlaytimeTimeseries,Jd as getPublicProfile,Xd as getReferral,ku as getThreadDmKey,Cd as getTronBalance,Dd as getTronSecurity,Hs as hideAppPage,Hu as hideThread,iu as inviteDeveloperAppParticipant,Uu as inviteParticipants,Wu as leaveThread,Rs as listActivePlayers,_c as listAdmins,zs as listAppPages,pc as listAppealBlacklist,Gs as listAppealQueue,Cc as listAudit,il as listDeveloperApiKeys,Il as listDeveloperAppContentReports,Bl as listDeveloperAppInventoryCollections,Vl as listDeveloperAppInventoryItems,ru as listDeveloperAppParticipants,Oc as listDeveloperAppReviews,ou as listDeveloperInvites,Zs as listDeveloperRequests,$s as listDevelopers,sf as listFriends,cf as listFriendsForApp,Fc as listGameReviewComments,Dc as listGameReviews,du as listInventory,fu as listInventoryForApp,hu as listInventoryMintPermits,vu as listInventoryVaultPermits,Su as listInventoryVaulted,Ud as listNotifications,Cu as listOauthInventoryVaulted,Ns as listPaymentAuthorizations,lf as listSocials,Rd as listThreadMessages,Id as listThreads,mc as listTronCashoutQueue,Md as listTronCashouts,wd as listTronLedger,xc as listUsers,hf as listWalletManager,uf as listWallets,Gd as markAllNotificationsRead,Bd as markThreadRead,yd as mintMoonpayBuyUrl,bd as mintMoonpaySellUrl,Nd as mountPresenceWidget,gf as oauthPaymentWebhookBodySchema,Gu as pinThread,qs as postAdminAppealRoomMessage,ld as postAppealRoomMessage,Qd as previewReferral,Dl as provisionDeveloperAppWallet,Du as publishDmKey,Rl as quoteDeveloperAppInventoryRegistration,pu as quoteNftTransfer,bu as quoteRelayedVaultPermit,gu as redeemInventoryMintPermit,rd as refreshAccessToken,zl as registerDeveloperAppInventoryItem,gc as rejectTronCashout,bc as removeAdmin,fc as removeAppealBlacklist,rf as removeFriend,Ru as removeParticipant,Lu as removeReaction,Rc as replyToGameReview,jl as requestDeveloperAppProduction,_u as requestMint,Ys as resolveAppeal,Ws as reviewAppPage,Vs as reviewAppPageChanges,Qs as reviewDeveloperRequest,al as revokeDeveloperApiKey,au as revokeDeveloperAppParticipant,Fs as revokePaymentAuthorization,td as revokeToken,Al as rotateDeveloperAppKey,Ml as rotateDeveloperAppPaymentWebhookSecret,oc as rotateProcessorTreasury,Ms as searchGiphy,Yd as searchUsers,nf as sendFriendRequest,zd as sendMessage,Is as sendPresenceHeartbeat,Nc as setMyGameReviewReaction,ac as setProcessorWhitelist,Od as setTronSecurity,sc as setVaultOperator,cc as setVaultPause,lc as setVaultWithdrawLockDefault,uc as setVaultWithdrawLockOverride,Tu as setupDmKeyBackup,Xu as sha256Base64Url,yu as signInventoryVaultPermit,md as signPaymentIntent,Tc as submitAppContentReport,tu as submitAppPageForReview,ul as submitDeveloperRequest,xu as submitRelayedVaultPermit,Pc as tipGameReview,id as toTokenSet,tf as unfollowUser,Us as unhideAppPage,Eu as unlockDmKeyBackup,Ku as unpinThread,nu as unpublishAppPage,yc as updateAdminRole,ic as updateAppFeeConfig,ql as updateAppPage,hl as updateDeveloperApp,El as updateDeveloperAppAutoSweep,Ll as updateDeveloperAppContentReportStatus,sl as updateDeveloperProfile,Wd as updateNotification,zu as updateParticipantRole,Ps as updatePaymentAuthorization,nc as updatePlatformFees,Ls as updateProfile,Vu as updateThreadSettings,Sc as updateUserBan,mf as updateWalletLabel,Js as uploadAdminAppealRoomAttachment,Jl as uploadAppPageBanner,eu as uploadAppPageGallery,Xl as uploadAppPageThumbnail,Ql as uploadAppPageThumbnailVideo,ud as uploadAppealRoomAttachment,Vd as uploadAttachment,ks as uploadAvatar,Gl as uploadDeveloperAppInventoryItemBanner,Wl as uploadDeveloperAppInventoryItemImage,_l as uploadDeveloperAppLogo,cl as uploadDeveloperProfileLogo,dl as uploadDeveloperRequestLogo,$ as uploadMultipart,ju as uploadThreadLogo,Ac as upsertMyGameReview,_f as verifyWebhook,Ol as withdrawDeveloperAppWallet};
|