diff --git a/private-spec.json b/private-spec.json index 1721ef4..f1f2360 100644 --- a/private-spec.json +++ b/private-spec.json @@ -1 +1 @@ -{"openapi":"3.0.0","info":{"title":"HYPLAY API","version":"1.0.0","description":"HYPLAY API Specification","termsOfService":"https://hyplay.com","contact":{"name":"HYCHAIN Team","email":"braydon@hytopia.com","url":"https://hychain.com"}},"servers":[{"description":"HYPLAY API Server","url":"https://api.hyplay.com"},{"description":"HYPLAY API Staging Server","url":"https://staging-api.hyplay.com"},{"description":"Local Development Server","url":"http://localhost:8001"}],"components":{"parameters":{"headerAuthorizationUser":{"name":"x-authorization","in":"header","description":"The `accessToken` of the authenticating user.","example":"user_at_02z4Mv3c85Ig0gNowY9Dq0N2kjb1xwzr27ArLE0669RrRI6dLf822iPO26K1p1FP","required":true,"schema":{"type":"string"}},"headerAuthorizationUserOptional":{"name":"x-authorization","in":"header","description":"The `accessToken` of the authenticating user.","example":"user_at_02z4Mv3c85Ig0gNowY9Dq0N2kjb1xwzr27ArLE0669RrRI6dLf822iPO26K1p1FP","required":false,"schema":{"type":"string"}},"headerAuthorizationAppSecret":{"name":"x-app-authorization","in":"header","description":"The `secretKey` or `testSecretKey` of the authenticating app.","example":"test_app_sk_pBEHOVTIZjQFT6WpiQLT8c_VFfd6Vb2XHj_9IIV8-Zi06SdMIruJxIe2QMaca_X6","required":true,"schema":{"type":"string"}},"headerAuthorizationAppSecretOptional":{"name":"x-app-authorization","in":"header","description":"The `secretKey` or `testSecretKey` of the authenticating app.","example":"test_app_sk_pBEHOVTIZjQFT6WpiQLT8c_VFfd6Vb2XHj_9IIV8-Zi06SdMIruJxIe2QMaca_X6","required":false,"schema":{"type":"string"}},"headerAuthorizationSession":{"name":"x-session-authorization","in":"header","description":"The `accessToken` of the authenticating session.","example":"sca_sat_pBEHOVTIZjQFT6WpiQLT8c_VFfd6Vb2XHj_9IIV8-Zi06SdMIruJxIe2QMaca_X6","required":true,"schema":{"type":"string"}},"headerAuthorizationSessionOptional":{"name":"x-session-authorization","in":"header","description":"The `accessToken` of the authenticating session.","example":"sca_sat_pBEHOVTIZjQFT6WpiQLT8c_VFfd6Vb2XHj_9IIV8-Zi06SdMIruJxIe2QMaca_X6","required":false,"schema":{"type":"string"}},"headerAuthorizationNonce":{"name":"x-nonce","in":"header","description":"The nonce of the authenticating user.","required":true,"schema":{"type":"string"}},"headerAuthorizationNonceSignature":{"name":"x-nonce-signature","in":"header","description":"The nonce signature of the authenticating user.","required":true,"schema":{"type":"string"}},"pathAppId":{"name":"appId","in":"path","description":"An application id.","required":true,"schema":{"type":"string"}},"pathAssetId":{"name":"assetId","in":"path","description":"An asset id.","required":true,"schema":{"type":"string"}},"pathContractId":{"name":"contractId","in":"path","description":"A contract id.","required":true,"schema":{"type":"string"}},"pathContractIdOrAddress":{"name":"contractIdOrAddress","in":"path","description":"A contract id or address.","required":true,"schema":{"type":"string"}},"pathLeaderboardId":{"name":"leaderboardId","in":"path","description":"A leaderboard id.","required":true,"schema":{"type":"string"}},"pathSessionId":{"name":"sessionId","in":"path","description":"A session id.","required":true,"schema":{"type":"string"}},"pathTemplateId":{"name":"templateId","in":"path","description":"A template id.","required":true,"schema":{"type":"string"}},"pathTransactionId":{"name":"transactionId","in":"path","description":"A transaction id.","required":true,"schema":{"type":"string"}},"pathUserId":{"name":"userId","in":"path","description":"A user id.","required":true,"schema":{"type":"string"}},"pathWalletIdOrAddress":{"name":"walletIdOrAddress","in":"path","description":"A wallet id or address.","required":true,"schema":{"type":"string"}},"queryAccessTokenExpiresAt":{"name":"accessTokenExpiresAt","in":"query","description":"An optional unix timestamp in seconds specifying when the returned `accessToken` should expire. If this value is provided, all prior `accessToken` will be invalidated and a new `accessToken` will be issued in the response. If no value is provided, the returned `accessToken` will not expire unless it is invalidated.","example":1677197460,"required":false,"schema":{"type":"number"}},"queryAppleAuthCode":{"name":"appleAuthCode","in":"query","description":"A Apple OAuth 2.0 code.","required":false,"schema":{"type":"string"}},"queryAppleRedirectOverride":{"name":"appleRedirectOverride","in":"query","description":"An redirect url for apple auth.","required":false,"schema":{"type":"string"}},"queryAppId":{"name":"appId","in":"query","description":"An application id.","required":false,"schema":{"type":"string"}},"queryArgs":{"name":"args","in":"query","description":"An array of arguments.","required":false,"schema":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}]}}},"queryAs":{"name":"as","in":"query","description":"An address or walletId to perform as.","required":false,"schema":{"type":"string"}},"queryChain":{"name":"chain","in":"query","description":"A chain name.","required":false,"schema":{"type":"string","enum":["HYCHAIN","HYCHAIN_TESTNET","LOCAL"]}},"queryCursor":{"name":"cursor","in":"query","description":"An id from the record type to start the pagination of the next results, excluding the provided record id.","required":false,"schema":{"type":"string"}},"queryFunc":{"name":"func","in":"query","description":"A function name or function signature.","required":true,"schema":{"type":"string"}},"queryDiscordAuthCode":{"name":"discordAuthCode","in":"query","description":"A Discord OAuth 2.0 code.","required":false,"schema":{"type":"string"}},"queryDiscordRedirectOverride":{"name":"discordRedirectOverride","in":"query","description":"An redirect url for discord auth.","required":false,"schema":{"type":"string"}},"queryFacebookAuthCode":{"name":"facebookAuthCode","in":"query","description":"A Facebook OAuth 2.0 code.","required":false,"schema":{"type":"string"}},"queryFacebookRedirectOverride":{"name":"facebookRedirectOverride","in":"query","description":"An redirect url for facebook auth.","required":false,"schema":{"type":"string"}},"queryGoogleAuthCode":{"name":"googleAuthCode","in":"query","description":"A Google OAuth 2.0 code.","required":false,"schema":{"type":"string"}},"queryGoogleRedirectOverride":{"name":"googleRedirectOverride","in":"query","description":"An redirect url for google auth.","required":false,"schema":{"type":"string"}},"queryTwitterAuthCode":{"name":"twitterAuthCode","in":"query","description":"A Twitter OAuth 2.0 code.","required":false,"schema":{"type":"string"}},"queryTwitterRedirectOverride":{"name":"twitterRedirectOverride","in":"query","description":"An redirect url for twitter auth.","required":false,"schema":{"type":"string"}},"queryTemplateApproved":{"name":"approved","in":"query","description":"Set this query parameter to `true` to filter for approved templates.","example":"true","required":false,"schema":{"type":"string"}},"queryTemplateName":{"name":"name","in":"query","description":"A template name to partially or exactly match.","example":"token","required":false,"schema":{"type":"string"}},"queryLimit":{"name":"limit","in":"query","description":"The maximum number of items to return.","example":25,"required":false,"schema":{"type":"number"}},"queryOffset":{"name":"offset","in":"query","description":"The offset of the first item to return.","example":0,"required":false,"schema":{"type":"number"}},"queryResetAccessToken":{"name":"resetAccessToken","in":"query","description":"Set this query parameter to `true` to reset accessToken and authorityKey.","example":"true","required":false,"schema":{"type":"string"}},"queryRecaptchaToken":{"name":"hcaptchaResponse","in":"query","description":"A hCaptcha token generated client-side by completion of a user-facing hCaptcha request.","required":true,"schema":{"type":"string"}},"querySessionId":{"name":"sessionId","in":"query","description":"A session id.","required":false,"schema":{"type":"string"}},"querySort":{"name":"sort","in":"query","description":"A sort order.","required":false,"schema":{"type":"string"}},"queryUsername":{"name":"username","in":"query","description":"A user username.","example":"arkdev","required":false,"schema":{"type":"string"}},"queryUserId":{"name":"userId","in":"query","description":"A user id.","required":false,"schema":{"type":"string"}},"queryWalletAddress":{"name":"walletAddress","in":"query","description":"A wallet address.","required":false,"schema":{"type":"string"}},"queryWalletId":{"name":"walletId","in":"query","description":"A wallet id.","required":false,"schema":{"type":"string"}},"queryStateKey":{"name":"key","in":"query","description":"A string identifier unique to an app for looking up state data.","required":false,"schema":{"type":"string"}}},"responses":{"400":{"description":"An API level error occurred. This is often due to problematic data being provided by you.","content":{"application/json":{"schema":{"type":"string"}}}},"401":{"description":"An authorization error occured. This is often due to incorrect tokens or keys being provided, or accessing a resource that the provided tokens or keys do not have access to.","content":{"application/json":{"schema":{"type":"string"}}}}},"schemas":{"AppModel":{"type":"object","properties":{"id":{"type":"string","description":"This field has not had a description added."},"userId":{"type":"string","description":"This field has not had a description added."},"walletId":{"type":"string","description":"This field has not had a description added."},"iconImageAssetId":{"type":"string","description":"This field has not had a description added."},"backgroundImageAssetId":{"type":"string","description":"This field has not had a description added."},"logoImageAssetId":{"type":"string","description":"This field has not had a description added."},"galleryMediaAssetIds":{"type":"object","description":"This field has not had a description added."},"secretKey":{"type":"string","description":"This field has not had a description added."},"testSecretKey":{"type":"string","description":"This field has not had a description added."},"name":{"type":"string","description":"This field has not had a description added."},"description":{"type":"string","description":"This field has not had a description added."},"url":{"type":"string","description":"This field has not had a description added."},"discordUrl":{"type":"string","description":"This field has not had a description added."},"twitterUrl":{"type":"string","description":"This field has not had a description added."},"steamUrl":{"type":"string","description":"This field has not had a description added."},"appleIosUrl":{"type":"string","description":"This field has not had a description added."},"appleMacUrl":{"type":"string","description":"This field has not had a description added."},"googlePlayUrl":{"type":"string","description":"This field has not had a description added."},"microsoftUrl":{"type":"string","description":"This field has not had a description added."},"privacyUrl":{"type":"string","description":"This field has not had a description added."},"termsUrl":{"type":"string","description":"This field has not had a description added."},"redirectUris":{"type":"object","description":"This field has not had a description added."},"verificationStatus":{"type":"string","description":"This field has not had a description added."},"updatedAt":{"type":"string","description":"This field has not had a description added."},"createdAt":{"type":"string","description":"This field has not had a description added."}}},"AppReferralsModel":{"type":"object","properties":{"id":{"type":"string","description":"This field has not had a description added."},"appId":{"type":"string","description":"This field has not had a description added."},"referredUserId":{"type":"string","description":"This field has not had a description added."},"referrerUserId":{"type":"string","description":"This field has not had a description added."},"updatedAt":{"type":"string","description":"This field has not had a description added."},"createdAt":{"type":"string","description":"This field has not had a description added."}}},"AppTeammateModel":{"type":"object","properties":{"id":{"type":"string","description":"This field has not had a description added."},"appId":{"type":"string","description":"This field has not had a description added."},"userId":{"type":"string","description":"This field has not had a description added."},"role":{"type":"string","description":"This field has not had a description added."},"updatedAt":{"type":"string","description":"This field has not had a description added."},"createdAt":{"type":"string","description":"This field has not had a description added."}}},"AssetModel":{"type":"object","properties":{"id":{"type":"string","description":"This field has not had a description added."},"userId":{"type":"string","description":"This field has not had a description added."},"s3Url":{"type":"string","description":"This field has not had a description added."},"cdnUrl":{"type":"string","description":"This field has not had a description added."},"mime":{"type":"string","description":"This field has not had a description added."},"extension":{"type":"string","description":"This field has not had a description added."},"checksum":{"type":"string","description":"This field has not had a description added."},"size":{"type":"integer","description":"This field has not had a description added."},"updatedAt":{"type":"string","description":"This field has not had a description added."},"createdAt":{"type":"string","description":"This field has not had a description added."}}},"ContractModel":{"type":"object","properties":{"id":{"type":"string","description":"This field has not had a description added."},"appId":{"type":"string","description":"This field has not had a description added."},"userId":{"type":"string","description":"This field has not had a description added."},"templateId":{"type":"string","description":"This field has not had a description added."},"chain":{"type":"string","description":"This field has not had a description added."},"abi":{"type":"object","description":"This field has not had a description added."},"address":{"type":"string","description":"This field has not had a description added."},"name":{"type":"string","description":"This field has not had a description added."},"description":{"type":"string","description":"This field has not had a description added."},"metadata":{"type":"object","description":"This field has not had a description added."},"updatedAt":{"type":"string","description":"This field has not had a description added."},"createdAt":{"type":"string","description":"This field has not had a description added."}}},"NonceModel":{"type":"object","properties":{"id":{"type":"string","description":"This field has not had a description added."},"walletId":{"type":"string","description":"This field has not had a description added."},"nonce":{"type":"string","description":"This field has not had a description added."},"createdAt":{"type":"string","description":"This field has not had a description added."}}},"SessionModel":{"type":"object","properties":{"id":{"type":"string","description":"This field has not had a description added."},"appId":{"type":"string","description":"This field has not had a description added."},"userId":{"type":"string","description":"This field has not had a description added."},"chain":{"type":"string","description":"This field has not had a description added."},"accessToken":{"type":"string","description":"This field has not had a description added."},"exchangeCode":{"type":"string","description":"This field has not had a description added."},"scopes":{"type":"object","description":"This field has not had a description added."},"contractFunctionSelectors":{"type":"object","description":"This field has not had a description added."},"nativeAllowance":{"type":"string","description":"This field has not had a description added."},"erc20Allowances":{"type":"object","description":"This field has not had a description added."},"erc721Allowances":{"type":"object","description":"This field has not had a description added."},"erc1155Allowances":{"type":"object","description":"This field has not had a description added."},"nonce":{"type":"string","description":"This field has not had a description added."},"signatures":{"type":"object","description":"This field has not had a description added."},"deadline":{"type":"string","description":"This field has not had a description added."},"expiresAt":{"type":"string","description":"This field has not had a description added."},"endedAt":{"type":"string","description":"This field has not had a description added."},"updatedAt":{"type":"string","description":"This field has not had a description added."},"createdAt":{"type":"string","description":"This field has not had a description added."}}},"TemplateModel":{"type":"object","properties":{"id":{"type":"string","description":"This field has not had a description added."},"userId":{"type":"string","description":"This field has not had a description added."},"name":{"type":"string","description":"This field has not had a description added."},"description":{"type":"string","description":"This field has not had a description added."},"solidity":{"type":"string","description":"This field has not had a description added."},"target":{"type":"string","description":"This field has not had a description added."},"bytecode":{"type":"string","description":"This field has not had a description added."},"abi":{"type":"object","description":"This field has not had a description added."},"errors":{"type":"object","description":"This field has not had a description added."},"approved":{"type":"boolean","description":"This field has not had a description added."},"updatedAt":{"type":"string","description":"This field has not had a description added."},"createdAt":{"type":"string","description":"This field has not had a description added."}}},"TransactionModel":{"type":"object","properties":{"id":{"type":"string","description":"This field has not had a description added."},"walletId":{"type":"string","description":"This field has not had a description added."},"sessionId":{"type":"string","description":"This field has not had a description added."},"chain":{"type":"string","description":"This field has not had a description added."},"relayerAddress":{"type":"string","description":"This field has not had a description added."},"func":{"type":"string","description":"This field has not had a description added."},"args":{"type":"object","description":"This field has not had a description added."},"value":{"type":"string","description":"This field has not had a description added."},"hash":{"type":"string","description":"This field has not had a description added."},"createdAt":{"type":"string","description":"This field has not had a description added."}}},"UserModel":{"type":"object","properties":{"id":{"type":"string","description":"This field has not had a description added."},"walletId":{"type":"string","description":"This field has not had a description added."},"username":{"type":"string","description":"This field has not had a description added."},"email":{"type":"string","description":"This field has not had a description added."},"phone":{"type":"string","description":"This field has not had a description added."},"appleId":{"type":"string","description":"This field has not had a description added."},"discordId":{"type":"string","description":"This field has not had a description added."},"facebookId":{"type":"string","description":"This field has not had a description added."},"googleId":{"type":"string","description":"This field has not had a description added."},"microsoftId":{"type":"string","description":"This field has not had a description added."},"twitterId":{"type":"string","description":"This field has not had a description added."},"accessToken":{"type":"string","description":"This field has not had a description added."},"isChild":{"type":"boolean","description":"This field has not had a description added."},"accessTokenExpiresAt":{"type":"string","description":"This field has not had a description added."},"updatedAt":{"type":"string","description":"This field has not had a description added."},"createdAt":{"type":"string","description":"This field has not had a description added."}}},"WalletModel":{"type":"object","properties":{"id":{"type":"string","description":"This field has not had a description added."},"type":{"type":"string","description":"This field has not had a description added."},"address":{"type":"string","description":"This field has not had a description added."},"authorityCiphertext":{"type":"string","description":"This field has not had a description added."},"authorityBackupCiphertexts":{"type":"object","description":"This field has not had a description added."},"authorityProofSignature":{"type":"string","description":"This field has not had a description added."},"backupQuestions":{"type":"object","description":"This field has not had a description added."},"updatedAt":{"type":"string","description":"This field has not had a description added."},"createdAt":{"type":"string","description":"This field has not had a description added."}}},"AnyValue":{"description":"Can be anything. String, number, object, array, boolean, etc."}},"securitySchemes":{"basicAuth":{"type":"http","scheme":"basic","description":"Basic authentication must be send in the format of usernameOrEmail:shaPassword, where usernameOrEmail can be the username or email associated with an account, andshaPassword is a sha256 hash of the users provided plaintext password."}}},"tags":[{"name":"Users","description":"User related operations"}],"paths":{"/v1/apps":{"get":{"operationId":"getApps","summary":"Get apps","description":"Returns an array of apps owned by, or a teammate of, for the authorized user, or up to 25 public apps across HYPLAY if no authorization is provided. Supports pagination for public apps when no user authorization is provided - a `cursor` query parameter can be provided for paginating results based on last result set id.","tags":["Apps"],"parameters":[{"$ref":"#/components/parameters/headerAuthorizationUserOptional"},{"$ref":"#/components/parameters/queryCursor"}],"responses":{"200":{"description":"Returns an array of apps owned by the authorized user or public apps across HYPLAY if no authorization is provided.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/AppModel"},{"type":"object","properties":{"iconImageAsset":{"$ref":"#/components/schemas/AssetModel"},"backgroundImageAsset":{"$ref":"#/components/schemas/AssetModel"},"logoImageAsset":{"$ref":"#/components/schemas/AssetModel"},"wallet":{"$ref":"#/components/schemas/WalletModel"}}}]}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"}}},"post":{"operationId":"createApp","summary":"Create app","description":"Create a new app for the authorized user.","tags":["Apps"],"parameters":[{"$ref":"#/components/parameters/headerAuthorizationUser"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"iconImageAssetId":{"type":"string","description":"The assetId of the icon image. Icon images are recommended to be a 1:1 aspect ratio and at least 512x512 pixels."},"backgroundImageAssetId":{"type":"string","description":"The assetId of the background image. Background images are recommended to be a 16:9 aspect ratio and at least 1920x1080 pixels."},"logoImageAssetId":{"type":"string","description":"The assetId of the logo image. Logo image are used on pages like preregistration, questing, etc and can be any aspect ratio."},"galleryMediaAssetIds":{"type":"array","description":"An array of assetIds for media assets to be displayed for app promotional purposes. Such as the web page media gallery.","items":{"type":"string"}},"name":{"type":"string","description":"The name of the app."},"description":{"type":"string","format":"html","description":"A brief description of the app and what it is and does."},"url":{"type":"string","description":"The URL of the app, such as its website or where users can learn more about it."},"discordUrl":{"type":"string","description":"The URL of the app's Discord server."},"twitterUrl":{"type":"string","description":"The URL of the app's Twitter page."},"steamUrl":{"type":"string","description":"The URL of the app's Steam page."},"appleIosUrl":{"type":"string","description":"The URL of the app's Apple iOS page."},"appleMacUrl":{"type":"string","description":"The URL of the app's Apple Mac page."},"googlePlayUrl":{"type":"string","description":"The URL of the app's Google Play page."},"microsoftUrl":{"type":"string","description":"The URL of the app's Windows Store page."},"privacyUrl":{"type":"string","description":"The URL of the app's privacy policy."},"termsUrl":{"type":"string","description":"The URL of the app's terms of service."},"redirectUris":{"type":"array","description":"An array of valid redirect URIs for the user authorization flows of the app.","items":{"type":"string"}}},"required":["name"]}}}},"responses":{"200":{"description":"Successfully created a new app. Returns an app object.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/AppModel"},{"type":"object","properties":{"iconImageAsset":{"$ref":"#/components/schemas/AssetModel"},"backgroundImageAsset":{"$ref":"#/components/schemas/AssetModel"},"wallet":{"$ref":"#/components/schemas/WalletModel"}}}]}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"}}}},"/v1/apps/{appId}":{"get":{"operationId":"getPublicApp","summary":"Get public app","description":"Return a public app object for the provided appId.","tags":["Apps"],"parameters":[{"$ref":"#/components/parameters/pathAppId"}],"responses":{"200":{"description":"Returns a public app object.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/AppModel"},{"type":"object","properties":{"iconImageAsset":{"$ref":"#/components/schemas/AssetModel"},"backgroundImageAsset":{"$ref":"#/components/schemas/AssetModel"},"logoImageAsset":{"$ref":"#/components/schemas/AssetModel"},"galleryMediaAssets":{"type":"array","items":{"$ref":"#/components/schemas/AssetModel"}},"wallet":{"$ref":"#/components/schemas/WalletModel"},"totalUsers":{"type":"number"}}}]}}}},"400":{"$ref":"#/components/responses/400"}}},"patch":{"operationId":"updateApp","summary":"Update app","description":"Update an app owned by the authorized user for the provided appId.","tags":["Apps"],"parameters":[{"$ref":"#/components/parameters/headerAuthorizationUser"},{"$ref":"#/components/parameters/pathAppId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"iconImageAssetId":{"type":"string","description":"The assetId of the icon image."},"backgroundImageAssetId":{"type":"string","description":"The assetId of the background image."},"logoImageAssetId":{"type":"string","description":"The assetId of the logo image."},"galleryMediaAssetIds":{"type":"array","description":"An array of assetIds for media assets to be displayed for app promotional purposes. Such as the web page media gallery.","items":{"type":"string"}},"name":{"type":"string","description":"The name of the app."},"description":{"type":"string","format":"html","description":"A brief description of the app and what it is and does."},"url":{"type":"string","description":"The URL of the app, such as its website or where users can learn more about it."},"discordUrl":{"type":"string","description":"The URL of the app's Discord server."},"twitterUrl":{"type":"string","description":"The URL of the app's Twitter page."},"steamUrl":{"type":"string","description":"The URL of the app's Steam page."},"appleIosUrl":{"type":"string","description":"The URL of the app's Apple iOS page."},"appleMacUrl":{"type":"string","description":"The URL of the app's Apple Mac page."},"googlePlayUrl":{"type":"string","description":"The URL of the app's Google Play page."},"microsoftUrl":{"type":"string","description":"The URL of the app's Windows page."},"privacyUrl":{"type":"string","description":"The URL of the app's privacy policy."},"termsUrl":{"type":"string","description":"The URL of the app's terms of service."},"redirectUris":{"type":"array","description":"An array of valid redirect URIs for the user authorization flows of the app.","items":{"type":"string"}},"resetSecretKey":{"type":"boolean","description":"If true, reset the secretKey of the app."},"resetTestSecretKey":{"type":"boolean","description":"If true, reset the testSecretKey of the app."}}}}}},"responses":{"200":{"description":"Returns the updated app object.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AppModel"}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"}}}},"/v1/apps/{appId}/leaderboards":{"get":{"operationId":"getLeaderboards","summary":"Get leaderboards","description":"Get the leaderboards of the app.","tags":["Leaderboards"],"parameters":[{"$ref":"#/components/parameters/pathAppId"}],"responses":{"200":{"description":"Returns an array of leaderboards for the app.","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"The leaderboard ID."},"name":{"type":"string","description":"The leaderboard name."},"description":{"type":"string","description":"The leaderboard description."},"totalScores":{"type":"number","description":"The total number of users with scores in the leaderboard."}}}}}}},"400":{"$ref":"#/components/responses/400"}}},"post":{"operationId":"createLeaderboard","summary":"Create leaderboard","description":"Create a leaderboard for the app.","tags":["Leaderboards"],"parameters":[{"$ref":"#/components/parameters/headerAuthorizationAppSecret"},{"$ref":"#/components/parameters/pathAppId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"The leaderboard name."},"description":{"type":"string","description":"The leaderboard description."}},"required":["name"]}}}},"responses":{"200":{"description":"Returns the created leaderboard.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"The leaderboard ID."},"name":{"type":"string","description":"The leaderboard name."},"description":{"type":"string","description":"The leaderboard description."},"scores":{"type":"object","description":"The leaderboard scores, keyed by user ID, defaults to an empty object."},"key":{"type":"string","description":"The leaderboard hash key, used to generate hashes for client side submission of scores."},"createdAt":{"type":"number","description":"The timestamp of the leaderboard creation in seconds since the Unix epoch."}}}}}},"400":{"$ref":"#/components/responses/400"}}}},"/v1/apps/{appId}/leaderboards/{leaderboardId}":{"get":{"operationId":"getLeaderboard","summary":"Get leaderboard","description":"Get a leaderboard of the app.","tags":["Leaderboards"],"parameters":[{"$ref":"#/components/parameters/pathAppId"},{"$ref":"#/components/parameters/pathLeaderboardId"}],"responses":{"200":{"description":"Returns a leaderboard.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"The leaderboard ID."},"name":{"type":"string","description":"The leaderboard name."},"description":{"type":"string","description":"The leaderboard description."},"totalScores":{"type":"number","description":"The total number of users with scores in the leaderboard."}}}}}},"400":{"$ref":"#/components/responses/400"}}},"patch":{"operationId":"updateLeaderboard","summary":"Update leaderboard","description":"Update a leaderboard of the app.","tags":["Leaderboards"],"parameters":[{"$ref":"#/components/parameters/headerAuthorizationAppSecret"},{"$ref":"#/components/parameters/pathAppId"},{"$ref":"#/components/parameters/pathLeaderboardId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"The leaderboard name."},"description":{"type":"string","description":"The leaderboard description."}}}}}},"responses":{"200":{"description":"Returns the updated leaderboard.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"The leaderboard ID."},"name":{"type":"string","description":"The leaderboard name."},"description":{"type":"string","description":"The leaderboard description."},"scores":{"type":"object","description":"The leaderboard scores, keyed by user ID."},"key":{"type":"string","description":"The leaderboard hash key, used to generate hashes"},"createdAt":{"type":"number","description":"The timestamp of the leaderboard creation in seconds since the Unix epoch."}}}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"}}}},"/v1/apps/{appId}/leaderboards/{leaderboardId}/key":{"get":{"operationId":"getLeaderboardKey","summary":"Get leaderboard key","description":"Get the key for a leaderboard.","tags":["Leaderboards"],"parameters":[{"$ref":"#/components/parameters/headerAuthorizationAppSecret"},{"$ref":"#/components/parameters/pathAppId"},{"$ref":"#/components/parameters/pathLeaderboardId"}],"responses":{"200":{"description":"Returns the leaderboard key.","content":{"application/json":{"schema":{"type":"string"}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"}}}},"/v1/apps/{appId}/leaderboards/{leaderboardId}/score":{"get":{"operationId":"getLeaderboardScore","summary":"Get leaderboard score","description":"Get a leaderboard score.","tags":["Leaderboards"],"parameters":[{"$ref":"#/components/parameters/pathAppId"},{"$ref":"#/components/parameters/pathLeaderboardId"},{"$ref":"#/components/parameters/queryUserId"}],"responses":{"200":{"description":"Returns a score based on the provided parameters.","content":{"application/json":{"schema":{"type":"object","properties":{"userId":{"type":"string"},"score":{"type":"number"},"timestamp":{"type":"number"}}}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"}}}},"/v1/apps/{appId}/leaderboards/{leaderboardId}/scores":{"get":{"operationId":"getLeaderboardScores","summary":"Get leaderboard scores","description":"Get an array of scores for the provided leaderboardId. Returns an array default orderered by scores descending. Additionally supports pagination via the `offset` and `limit query parameters. Leaderboard scores return a default of 25 scores.","tags":["Leaderboards"],"parameters":[{"$ref":"#/components/parameters/pathAppId"},{"$ref":"#/components/parameters/pathLeaderboardId"},{"$ref":"#/components/parameters/querySort"},{"$ref":"#/components/parameters/queryOffset"},{"$ref":"#/components/parameters/queryLimit"}],"responses":{"200":{"description":"Returns an array of scores.","content":{"application/json":{"schema":{"type":"object","properties":{"scores":{"type":"array","items":{"type":"object","properties":{"userId":{"type":"string"},"username":{"type":"string"},"score":{"type":"number"},"timestamp":{"type":"number"}}}},"totalScores":{"type":"number"}}}}}},"400":{"$ref":"#/components/responses/400"}}},"post":{"operationId":"createLeaderboardScore","summary":"Create leaderboard score","description":"Create a score for the provided leaderboardId. Leaderboard scores can be provided for any user id when the app secret key authorization is provided. Alternatively, a user may submit their own scores by provided their session authorization, with a request body containing `score` and `hash`. A valid `hash` is intended to be generated for each score within the game client as sha256(leaderboardKey:userId:score).","tags":["Leaderboards"],"parameters":[{"$ref":"#/components/parameters/headerAuthorizationAppSecretOptional"},{"$ref":"#/components/parameters/headerAuthorizationSessionOptional"},{"$ref":"#/components/parameters/pathAppId"},{"$ref":"#/components/parameters/pathLeaderboardId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"userId":{"type":"string","description":"The user id to associate the score with."},"score":{"type":"number","description":"The score to submit. Can be any number."},"hash":{"type":"string","description":"The hash of the score when submitting with session authorization. Must be generated as a hash using sha256(leaderboardKey:userId:score)."}},"required":["score"]}}}},"responses":{"200":{"description":"Returns the created score.","content":{"application/json":{"schema":{"type":"object","properties":{"userId":{"type":"string"},"score":{"type":"number"},"timestamp":{"type":"number"}}}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"}}},"delete":{"operationId":"deleteLeaderboardScore","summary":"Delete leaderboard score","description":"Delete a score for the provided leaderboardId and userId.","tags":["Leaderboards"],"parameters":[{"$ref":"#/components/parameters/headerAuthorizationAppSecret"},{"$ref":"#/components/parameters/pathAppId"},{"$ref":"#/components/parameters/pathLeaderboardId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"userId":{"type":"string","description":"The user id to delete the score for."}},"required":["userId"]}}}},"responses":{"204":{"description":"Score deleted successfully."},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"}}}},"/v1/apps/{appId}/page":{"get":{"operationId":"getPage","summary":"Get page","description":"Get the HYPLAY page data for an app.","tags":["Promo Page"],"parameters":[{"$ref":"#/components/parameters/pathAppId"}],"responses":{"200":{"description":"Returns the HYPLAY page data for the app.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/AppModel"},{"type":"object","properties":{"iconImageAsset":{"$ref":"#/components/schemas/AssetModel"},"backgroundImageAsset":{"$ref":"#/components/schemas/AssetModel"},"logoImageAsset":{"$ref":"#/components/schemas/AssetModel"},"galleryMediaAssets":{"type":"array","items":{"$ref":"#/components/schemas/AssetModel"}},"preregister":{"type":"object","properties":{"visible":{"type":"boolean"},"incentiveText":{"type":"string"}}},"leaderboard":{"type":"object","properties":{"id":{"type":"string"},"visible":{"type":"boolean"}}},"referral":{"type":"object","properties":{"visible":{"type":"boolean"},"titleText":{"type":"string"},"incentiveText":{"type":"string"}}},"links":{"type":"array","items":{"type":"object","properties":{"text":{"type":"string"},"url":{"type":"string"}}}},"wallet":{"$ref":"#/components/schemas/WalletModel"},"totalUsers":{"type":"number"}}}]}}}},"400":{"$ref":"#/components/responses/400"}}},"patch":{"operationId":"updatePage","summary":"Update page","description":"Update the HYPLAY page data for an app.","tags":["Promo Page"],"parameters":[{"$ref":"#/components/parameters/headerAuthorizationUser"},{"$ref":"#/components/parameters/pathAppId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"preregisterVisible":{"type":"boolean","description":"Whether the pre-register section is visible."},"preregisterIncentiveText":{"type":"string","description":"The incentive text to display with the pre-register prompt."},"leaderboardId":{"type":"string","format":"uuid","description":"The id of the leaderboard to display."},"leaderboardVisible":{"type":"boolean","description":"Whether the leaderboard section is visible."},"referralVisible":{"type":"boolean","description":"Whether the referral section is visible."},"referralTitleText":{"type":"string","description":"The title text to display in the referral section."},"referralIncentiveText":{"type":"string","description":"The incentive text to display in the referral section."},"links":{"type":"array","items":{"type":"object","properties":{"text":{"type":"string"},"url":{"type":"string"}}}}}}}}},"responses":{"200":{"description":"Returns the updated HYPLAY page data for the app.","content":{"application/json":{"schema":{"type":"object","properties":{"preregister":{"type":"object","properties":{"visible":{"type":"boolean"},"incentiveText":{"type":"string"}}},"leaderboard":{"type":"object","properties":{"id":{"type":"string"},"visible":{"type":"boolean"}}},"referral":{"type":"object","properties":{"visible":{"type":"boolean"},"titleText":{"type":"string"},"incentiveText":{"type":"string"}}},"links":{"type":"array","items":{"type":"object","properties":{"text":{"type":"string"},"url":{"type":"string"}}}}}}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"}}}},"/v1/apps/{appId}/states":{"get":{"operationId":"getAppState","summary":"Get app state","description":"Get the public, protected, private state of an app, user or key.","tags":["Apps"],"parameters":[{"$ref":"#/components/parameters/pathAppId"},{"$ref":"#/components/parameters/queryStateKey"},{"$ref":"#/components/parameters/headerAuthorizationAppSecretOptional"},{"$ref":"#/components/parameters/headerAuthorizationSessionOptional"}],"responses":{"200":{"description":"Returns a state object that may contain public, protected, and/or private state for the app, key or user for the authorized user session.","content":{"application/json":{"schema":{"type":"object","properties":{"publicState":{"type":"object","description":"Public state data for the app or user."},"protectedState":{"type":"object","description":"Protected state data for the app or user."},"privateState":{"type":"object","description":"Private state data for the app or user."}},"required":["public","protected"]}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"}}},"post":{"operationId":"setAppState","summary":"Set app state","description":"Set arbitrary JSON blobs for public, protected and/or private state specific to an application or authorized user of an application. This is useful for saving different types of data specific to users or global configuration of your app or game in many different situations. It is intended to be highly flexible. State set for a user of your app, a unique lookup key, and the app itself are all isolated to your application. State storage is not globablly shared between applications.","tags":["Apps"],"parameters":[{"$ref":"#/components/parameters/pathAppId"},{"$ref":"#/components/parameters/headerAuthorizationAppSecretOptional"},{"$ref":"#/components/parameters/headerAuthorizationSessionOptional"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"key":{"type":"string","description":"Any unique lookup key for this data. This can be things such as a hyplay user id, an internal battle match id for your game, some arbitrary settings identifier for a system of your app and more. Keys are flexible ways to create string based lookup identifiers for data you want to store/lookup. Keys are unique to your application and are not shared globally."},"publicState":{"type":"object","description":"Public state data to set for the app or user.","additionalProperties":true},"protectedState":{"type":"object","description":"Protected state data to set for the app or user.","additionalProperties":true},"privateState":{"type":"object","description":"Private state data to set for the app or user.","additionalProperties":true},"overwrite":{"type":"boolean","description":"If true, the state will be overwritten with the provided state. If false or omitted, the state will be deep merged with the provided state."}}}}}},"responses":{"200":{"description":"Returns a state object that may contain public, protected, and/or private state for the app, or user of the app for the provided userId.","content":{"application/json":{"schema":{"type":"object","properties":{"publicState":{"type":"object","description":"Public state data for the app or user."},"protectedState":{"type":"object","description":"Protected state data for the app or user."},"privateState":{"type":"object","description":"Private state data for the app or user."}},"required":["publicState","protectedState"]}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"}}}},"/v1/apps/{appId}/teammates":{"get":{"operationId":"getAppTeammates","summary":"Get app teammates","description":"Get an array of teammates for the provided appId.","tags":["Apps"],"parameters":[{"$ref":"#/components/parameters/headerAuthorizationUser"},{"$ref":"#/components/parameters/pathAppId"}],"responses":{"200":{"description":"Returns an array of teammates.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/AppTeammateModel"},{"type":"object","properties":{"user":{"type":"object","properties":{"id":{"type":"string"},"username":{"type":"string"}}}}}]}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"}}},"post":{"operationId":"createAppTeammate","summary":"Create app teammate","description":"Create a teammate for the provided appId, userId and role. Authorized user must be the owner of the app, or be a teammate with a role of OWNER.","tags":["Apps"],"parameters":[{"$ref":"#/components/parameters/headerAuthorizationUser"},{"$ref":"#/components/parameters/pathAppId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"userId":{"type":"string","description":"The user id to add as a teammate of the app."},"role":{"type":"string","description":"The role of the teammate.","enum":["OWNER","DEVELOPER","EDITOR","ANALYST"]}},"required":["userId","role"]}}}},"responses":{"200":{"description":"Returns the created or existing teammate.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AppTeammateModel"}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"}}}},"/v1/apps/{appId}/teammates/{userId}":{"patch":{"operationId":"updateAppTeammate","summary":"Update app teammate","description":"Update the role of a teammate for the provided appId and userId. Authorized user must be the owner of the app, or be a teammate with a role of OWNER.","tags":["Apps"],"parameters":[{"$ref":"#/components/parameters/headerAuthorizationUser"},{"$ref":"#/components/parameters/pathAppId"},{"$ref":"#/components/parameters/pathUserId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"role":{"type":"string","description":"The role of the teammate.","enum":["OWNER","DEVELOPER","EDITOR","ANALYST"]}},"required":["role"]}}}},"responses":{"200":{"description":"Returns the updated teammate.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AppTeammateModel"}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"}}},"delete":{"operationId":"deleteAppTeammate","summary":"Delete app teammate","description":"Delete a teammate for the provided appId and userId. Authorized user must be the owner of the app, or be a teammate with a role of OWNER.","tags":["Apps"],"parameters":[{"$ref":"#/components/parameters/headerAuthorizationUser"},{"$ref":"#/components/parameters/pathAppId"},{"$ref":"#/components/parameters/pathUserId"}],"responses":{"204":{"description":"Teammate deleted successfully."},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"}}}},"/v1/apps/{appId}/users":{"get":{"operationId":"getAppUsers","summary":"Get app users","description":"Returns an array of public users objects representing users of the apps. A HYPLAY user is considered a user of the app if they have had at least 1 active session for the provided appId.","tags":["Apps"],"parameters":[{"$ref":"#/components/parameters/pathAppId"},{"$ref":"#/components/parameters/headerAuthorizationAppSecretOptional"},{"$ref":"#/components/parameters/queryCursor"}],"responses":{"200":{"description":"Returns an array of public user objects.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/UserModel"},{"type":"object","properties":{"wallet":{"$ref":"#/components/schemas/WalletModel"}}}]}}}},"400":{"$ref":"#/components/responses/400"}}}},"/v1/apps/{appId}/users/{userId}":{"get":{"operationId":"getAppUser","summary":"Get app user","description":"Returns a public user object representing a user of the app that also includes the `totalAppReferrals` property which represents the number of other users the user for the provided userId has referred to the provided appId.","tags":["Apps"],"parameters":[{"$ref":"#/components/parameters/pathAppId"},{"$ref":"#/components/parameters/pathUserId"}],"responses":{"200":{"description":"Returns a public user object that includes a `totalAppReferrals` property.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/UserModel"},{"type":"object","properties":{"wallet":{"$ref":"#/components/schemas/WalletModel"}}},{"type":"object","properties":{"totalAppReferrals":{"type":"integer"}}}]}}}},"400":{"$ref":"#/components/responses/400"}}}},"/v1/apps/{appId}/whitelist":{"get":{"operationId":"getWhitelist","summary":"Get whitelist","description":"Get the whitelist data for an app. Returns all data in lower case to simplify case insensitive matching.","tags":["Whitelist"],"parameters":[{"$ref":"#/components/parameters/headerAuthorizationUser"},{"$ref":"#/components/parameters/pathAppId"}],"responses":{"200":{"description":"Returns the whitelist data for the app.","content":{"application/json":{"schema":{"type":"object","properties":{"enabled":{"type":"boolean"},"userIds":{"type":"array","items":{"type":"string"}},"emails":{"type":"array","items":{"type":"string"}},"usernames":{"type":"array","items":{"type":"string"}}}}}}},"400":{"$ref":"#/components/responses/400"}}},"patch":{"operationId":"updateWhitelist","summary":"Update whitelist","description":"Update the whitelist data for an app. Existing values provided will be ignored to prevent duplicates in the list. All values are case-insensitive.","tags":["Whitelist"],"parameters":[{"$ref":"#/components/parameters/headerAuthorizationUser"},{"$ref":"#/components/parameters/pathAppId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"enabled":{"type":"boolean","description":"Whether the whitelist is enabled."},"userIds":{"type":"array","description":"User Ids to add to the whitelist.","items":{"type":"string"}},"emails":{"type":"array","description":"Emails to add to the whitelist.","items":{"type":"string"}},"usernames":{"type":"array","description":"Usernames to add to the whitelist.","items":{"type":"string"}}}}}}},"responses":{"200":{"description":"Returns the updated whitelist data for the app.","content":{"application/json":{"schema":{"type":"object","properties":{"enabled":{"type":"boolean"},"userIds":{"type":"array","items":{"type":"string"}},"emails":{"type":"array","items":{"type":"string"}},"usernames":{"type":"array","items":{"type":"string"}}}}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"}}},"delete":{"operationId":"deleteFromWhitelist","summary":"Delete from whitelist","description":"Delete entries from the whitelist for an app. All values are case-insensitive.","tags":["Whitelist"],"parameters":[{"$ref":"#/components/parameters/headerAuthorizationUser"},{"$ref":"#/components/parameters/pathAppId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"userIds":{"type":"array","description":"User Ids to add to the whitelist.","items":{"type":"string"}},"emails":{"type":"array","description":"Emails to add to the whitelist.","items":{"type":"string"}},"usernames":{"type":"array","description":"Usernames to add to the whitelist.","items":{"type":"string"}}}}}}},"responses":{"200":{"description":"Returns the updated whitelist data for the app.","content":{"application/json":{"schema":{"type":"object","properties":{"enabled":{"type":"boolean"},"userIds":{"type":"array","items":{"type":"string"}},"emails":{"type":"array","items":{"type":"string"}},"usernames":{"type":"array","items":{"type":"string"}}}}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"}}}},"/v1/assets":{"get":{"operationId":"getAssets","summary":"Get assets","description":"Returns an array of assets that have been uploaded by the authorized user ordered by most recent creation.","tags":["Assets"],"parameters":[{"$ref":"#/components/parameters/headerAuthorizationUser"}],"responses":{"200":{"description":"Returns an array of asset objects.","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AssetModel"}}}}},"400":{"$ref":"#/components/responses/400"}}},"post":{"operationId":"createAsset","summary":"Create asset","description":"Create an asset object by uploading a file in base64. Returns an asset object.","tags":["Assets"],"parameters":[{"$ref":"#/components/parameters/headerAuthorizationUser"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"fileBase64":{"type":"string","format":"byte","description":"The base64 string of the asset being uploaded. Uploads may not exceed 5mb."}}}}}},"responses":{"200":{"description":"Returns a created asset object.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssetModel"}}}},"400":{"$ref":"#/components/responses/400"}}}},"/v1/assets/{assetId}":{"get":{"operationId":"getAsset","summary":"Get asset","description":"Return an asset object that has been uploaded by the authorized user for the provided assetId.","tags":["Assets"],"parameters":[{"$ref":"#/components/parameters/pathAssetId"},{"$ref":"#/components/parameters/headerAuthorizationUser"}],"responses":{"200":{"description":"Returns an asset object.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssetModel"}}}},"400":{"$ref":"#/components/responses/400"}}}},"/v1/contracts":{"get":{"operationId":"getOwnedContracts","summary":"Get owned contracts","description":"Returned an array of contracts owned by the authorized user.","tags":["Contracts"],"parameters":[{"$ref":"#/components/parameters/headerAuthorizationUser"}],"responses":{"200":{"description":"Returns an array of contracts owned by the authorized user.","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ContractModel"}}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"}}},"post":{"operationId":"createContract","summary":"Create contract","description":"Deploy a new contract from a template, or import an already deployed contract. Deploying or importing a contract through this endpoint will create a new contract object within the HYPLAY system. Once created, you can then programmatically interact with the contract gaslessly as a user, app or through a user's session. Use HYPLAY's create transaction and read contract endpoints for interactions.","tags":["Contracts"],"parameters":[{"$ref":"#/components/parameters/headerAuthorizationAppSecretOptional"},{"$ref":"#/components/parameters/headerAuthorizationUserOptional"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"chain":{"type":"string","description":"The chain to deploy or import a contract on.","enum":["HYCHAIN","HYCHAIN_TESTNET","LOCAL"]},"templateId":{"type":"string","description":"The template id to deploy a contract for. Templates have pre-defined ABIs and bytecode, allowing quick deployment of contracts one or multiple times."},"args":{"type":"array","description":"An array of constructor arguments required by the contract template being deployed from. Only required if deploying a contract from a template that requires constructor arguments.","items":{"type":"string"}},"salt":{"type":"string","description":"A salt value as a hex string, prefixed with 0x. Only required if deploying a contract from a template as a user."},"nonce":{"type":"string","description":"A nonce value as a hex string, prefixed with 0x. Only required if deploying a contract from a template as a user."},"signatures":{"type":"array","description":"An array of authority signatures to use for the contract deployment. Only required if deploying a contract from a template as a user. Provided signature(s) must be generated by the authority wallet of a user by signing a properly formatted \"create request\" object. See the hychain-crypto-js library on NPM for convenience methods in generating these signatures and create request objects if necessary.","items":{"type":"string"}},"deadline":{"type":"integer","description":"The deadline for the contract deployment execution. This can be set to a unix timestamp in the future. Typically set this to 24 hours in the future. Only required if deploying a contract from a template as a user."},"abi":{"type":"string","format":"json","description":"JSON string of the contract's ABI when importing an already deployed contract."},"address":{"type":"string","description":"The address of a contract being imported. Only required when importing an already deployed contract."},"name":{"type":"string","description":"The contract's name. Used to help distinguish contracts from one another. Optional for deploys and imports."},"description":{"type":"string","format":"html","description":"A description of the contract and what it does. This is helpful to set as a reminder for what a contract is used for. Optional for deploys and imports."},"metadata":{"type":"string","format":"json","description":"A JSON object of metadata as a string for the contract. This is an arbitrary JSON blob and is only intended for storing public data related to the contract for any use case."}},"required":["chain"]}}}},"responses":{"200":{"description":"Successfully deployed or imported a contract. Created a new contract object. Returns a contract object.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContractModel"}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"}}}},"/v1/contracts/{contractId}":{"get":{"operationId":"getContract","summary":"Get contract","description":"Returns a contract object for the provided contractId.","tags":["Contracts"],"parameters":[{"$ref":"#/components/parameters/pathContractId"}],"responses":{"200":{"description":"Returns a contract object.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContractModel"}}}},"400":{"$ref":"#/components/responses/400"}}},"patch":{"operationId":"updateContract","summary":"Update contract","description":"Updates a contract owned by the authorized user for the provided contractId.","tags":["Contracts"],"parameters":[{"$ref":"#/components/parameters/headerAuthorizationUser"},{"$ref":"#/components/parameters/pathContractId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"abi":{"type":"string","format":"json","description":"JSON string of the contract's ABI."},"name":{"type":"string","description":"The contract's name. Named contracts are easier for users to identify during app or game authorization flows through HYPLAY."},"description":{"type":"string","description":"A description of the contract and what it does."},"metadata":{"type":"string","format":"json","description":"A JSON string of arbitrary metadata for the contract. May be used by developers for a variety of reasons."}}}}}},"responses":{"200":{"description":"Returns the updated contract object.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContractModel"}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"}}}},"/v1/contracts/{contractIdOrAddress}/read":{"get":{"operationId":"readContract","summary":"Read contract","description":"Get the value from a read function of a target contract. This endpoint is designed to be highly flexible. It can read any contract by providing a contract address for `contractIdOrAddress`. It can also read using contracts created in the HYCHAIN systems through the `POST /v1/contracts` endpoint, which will utilize the contract's ABI.\n\nAdditionally, reads can be performed as a HYCHAIN app, user or user's session provided, through header authorization, or any arbitrary address or walletId provided through the `as` query parameter. Alternatively you can omit all of this and perform a read as no specific address.\n\nThe `func` query parameter accepts a complete function signature with parameters, such as `getCount()` or `readCounter(address,uint256)`, or a known function name without parameters if a contractId was provided for `contractIdOrAddress` and the contract's ABI is known. Such as `readCounter`.","tags":["Contracts"],"parameters":[{"$ref":"#/components/parameters/pathContractIdOrAddress"},{"$ref":"#/components/parameters/headerAuthorizationAppSecretOptional"},{"$ref":"#/components/parameters/headerAuthorizationSessionOptional"},{"$ref":"#/components/parameters/headerAuthorizationUserOptional"},{"$ref":"#/components/parameters/queryChain"},{"$ref":"#/components/parameters/queryFunc"},{"$ref":"#/components/parameters/queryArgs"},{"$ref":"#/components/parameters/queryAs"}],"responses":{"200":{"description":"Returns the result of the contract read as a string.","content":{"application/json":{"schema":{"type":"string"}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"}}}},"/v1/sessions":{"post":{"operationId":"startSession","summary":"Start session","description":"Starts a new session for the authorized user for an app. All prior sessions between the user and target app will become invalidated. Operates through an oauth 2.0-like flow, allowing a `code` or `token` response type. Also supports optional whitelisted access through the app whitelist system.\n\nWhen invoked directly by developers, this endpoint should only be used to start guest sessions. Guest sessions automatically create a HYPLAY user internally that bypasses the standard HYPLAY OAuth flow in order to automatically create a temporary HYPLAY account that can later be upgraded to a standard account if the user desires.","tags":["Apps"],"parameters":[{"$ref":"#/components/parameters/headerAuthorizationUserOptional"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"appId":{"type":"string","description":"The id of the app to start a session for."},"referrerId":{"type":"string","description":"The id of the user that referred the user to the app."},"scopes":{"type":"array","description":"The scopes requested for the session.","items":{"type":"string","enum":["email"]}},"nativeAllowance":{"type":"string","description":"The maximum sum of $TOPIA that may be transferred during this session, as a wei string.","example":502124124124},"contractFunctionSelectors":{"type":"array","description":"The contracts and function selectors approved for this session.","items":{"type":"object","properties":{"address":{"type":"string","description":"Target contract's address."},"functionSelectors":{"type":"array","description":"An array of function signatures or bytes4 function selectors to approve.","items":{"type":"string"}}}}},"erc20Allowances":{"type":"array","description":"The erc20 tokens and the maximum amount that may be transferred during this session.","items":{"type":"object","properties":{"address":{"type":"string","description":"Target erc20's contract address."},"allowance":{"type":"string","description":"The maximum sum of this erc20 token that may be transferred during this session, as a wei string."}}}},"erc721Allowances":{"type":"array","description":"The erc721 token ids that may be transferred during this session.","items":{"type":"object","properties":{"address":{"type":"string","description":"Target erc721's contract address."},"approveAll":{"type":"boolean","description":"If true, app is allowed through this session to transfer all tokens of the user without limits."},"tokenIds":{"type":"array","description":"The token ids this session is allowed to transfer during this session.","items":{"type":"string"}}}}},"erc1155Allowances":{"type":"array","description":"The erc1155 token ids and the maximum amount of each unique id that may be transferred during this session.","items":{"type":"object","properties":{"address":{"type":"string","description":"Target erc1155's contract address."},"approveAll":{"type":"boolean","description":"If true, app is allowed through this session to transfer any amount of all tokens of the user without limits."},"tokenIds":{"type":"array","description":"The maximum sum of the token ids this session is allowed to transfer during this session.","items":{"type":"string"}},"allowances":{"type":"array","description":"The token id allowances this session is allowed to interact or transfer during this session.","items":{"type":"string"}}}}},"chain":{"type":"string","description":"The chain the session is to be started for.","enum":["HYCHAIN","HYCHAIN_TESTNET","LOCAL"]},"isGuest":{"type":"boolean","description":"If the session should create a guest user. This allows applications to enable guest login. A guest HYPLAY user account with a managed authority wallet is created behind the scenes. The guest account can be later upgraded to a standard HYPLAY self-custodied account if desired by the user. If isGuest is set to true, `nonce`, `signatures`, `deadline` and `expiresAt` should not be provided."},"nonce":{"type":"string","description":"A positive arbitrary integer as a string to be used as this session's nonce. Nonces are a one-time use per user. For example, User A and User B can both individually use nonce \"1\", but nonce \"1\", cannot be used again in the future for User A or User B to start a different session.","example":1},"signatures":{"type":"array","description":"An array of 1 or more session start signatures, generated by the authority(s) of a user's smart contract account. These signatures are most easily generated using the `hychain-crypto-js` npm package's `generateSessionSignature()`.","items":{"type":"string"}},"deadline":{"type":"number","description":"A timestamp in seconds of when the signature(s) for the session authorization request expire. If the deadline has been passed, attempting to start a session will fail."},"expiresAt":{"type":"number","description":"A timestamp in seconds when the session is to expire."},"responseType":{"type":"string","description":"The response type for session auth flows. If `code` is used, an accessToken will not be included, and a `exchangeCode` property will be included in the response object. This `exchangeCode` must then be exchanged using both the app's secret + exchange code to acquire the session access token. Alternatively, `token` can be used which returns a populated `accessToken` property in the response. This is less secure and essentially identical in usage for Oauth 2.0's implicit auth flow.","enum":["code","token"]}},"required":["appId","chain","responseType"]}}}},"responses":{"200":{"description":"Successfully started a new session. Returns a session object.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AppModel"}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"}}},"delete":{"operationId":"endSession","summary":"End session","description":"Ends all active sessions for a given user. This endpoint is flexible and can end sessions in a number of ways. An app can end any user's sessions of their app directly, or a user can end their own sessions for an app, or a session access token can be used to end its associated session.","tags":["Apps"],"parameters":[{"$ref":"#/components/parameters/headerAuthorizationUserOptional"},{"$ref":"#/components/parameters/headerAuthorizationSessionOptional"},{"$ref":"#/components/parameters/headerAuthorizationAppSecretOptional"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"appId":{"type":"string","description":"If the `X-App-Authorization` or `X-Session-Authorization` header is not set, `appId` must be provided to indicate the application for which to end user sessions for."},"userId":{"type":"string","description":"If the user's `X-Authorization` or `X-Session-Authorization` header is not set, `userId` must be provided to indicate the user for which to end sessions for."},"chain":{"type":"string","description":"The chain to end sessions for.","enum":["HYCHAIN","HYCHAIN_TESTNET","LOCAL"]}},"required":["chain"]}}}},"responses":{"204":{"description":"Returns an empty response indicating the session has been ended."},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"}}}},"/v1/sessions/token":{"post":{"operationId":"grantSessionToken","summary":"Grant session token","description":"Returns a session object with a valid access token when the associated exchangeCode and application authorized by using its secret key is provided.","tags":["Apps"],"parameters":[{"$ref":"#/components/parameters/headerAuthorizationAppSecret"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"exchangeCode":{"type":"string","description":"An unused exchange code associated with the provided session id. Exchange codes can only be used once and then become invalid."}},"required":["exchangeCode"]}}}},"responses":{"200":{"description":"Returns an updated session object with an `accessToken` set.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SessionModel"}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"}}}},"/v1/templates":{"get":{"operationId":"getTemplates","summary":"Get templates","description":"Returns an array of templates. Templates can be used to quickly deploy contracts to HYCHAIN and HYCHAIN_TESTNET. Templates can also be reviewed and approved by the HYPLAY team to be made available for anyone to deploy. Templates that are not approved can be deployed by anyone to HYCHAIN_TESTNET, and only deployed by the creator to HYCHAIN mainnet.","tags":["Contracts"],"parameters":[{"$ref":"#/components/parameters/queryUserId"},{"$ref":"#/components/parameters/queryTemplateName"},{"$ref":"#/components/parameters/queryTemplateApproved"}],"responses":{"200":{"description":"Returns an array of template objects.","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/TemplateModel"}}}}},"400":{"$ref":"#/components/responses/400"}}},"post":{"operationId":"createTemplate","summary":"Create template","description":"Creates a new template. Templates can be used to quickly deploy pre-approved types of contracts to HYCHAIN and HYCHAIN_TESTNET.","tags":["Contracts"],"parameters":[{"$ref":"#/components/parameters/headerAuthorizationUser"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the template."},"description":{"type":"string","format":"html","description":"A description of the template."},"solidity":{"type":"string","format":"html","description":"The solidity source code of the template to compile. This must be a flattened contract with all imports inlined."},"target":{"type":"string","description":"The contract from the inlined solidity source code that is intended to be deployed for this template.","example":"MyErc20Contract"}},"required":["name","solidity","target"]}}}},"responses":{"200":{"description":"Returns the created template object.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TemplateModel"}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"}}}},"/v1/templates/{templateId}":{"get":{"operationId":"getTemplate","summary":"Get template","description":"Returns a template object with abi, bytecode and compilation errors or warnings included.","tags":["Contracts"],"parameters":[{"$ref":"#/components/parameters/pathTemplateId"}],"responses":{"200":{"description":"Returns a template object.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TemplateModel"}}}},"400":{"$ref":"#/components/responses/400"}}}},"/v1/transactions":{"get":{"operationId":"getTransactions","summary":"Get transactions","description":"Returns an array of transactions for the provided appId, sessionId, userId or walletId. Transactions are returned in descending order of creation date.","tags":["Transactions"],"parameters":[{"$ref":"#/components/parameters/queryAppId"},{"$ref":"#/components/parameters/querySessionId"},{"$ref":"#/components/parameters/queryUserId"},{"$ref":"#/components/parameters/queryWalletId"},{"$ref":"#/components/parameters/queryChain"}],"responses":{"200":{"description":"Returns an array of transaction objects.","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/TransactionModel"}}}}},"400":{"$ref":"#/components/responses/400"}}},"post":{"operationId":"createTransaction","summary":"Create transaction","description":"Create and submit a transaction to the target contract id or address. Transactions are submitted on behalf of the authorization type used, such as an app, user or user via a user's session.\n\nTransaction submission supports contract function invocation and native transfers to contracts or externally owned accounts (EOAs).\n\nThis endpoint is designed to be highly flexible. Please refer to the HYCHAIN guides and documentation for detailed examples of the many ways this endpoint can be used.","tags":["Transactions"],"parameters":[{"$ref":"#/components/parameters/headerAuthorizationAppSecretOptional"},{"$ref":"#/components/parameters/headerAuthorizationSessionOptional"},{"$ref":"#/components/parameters/headerAuthorizationUserOptional"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"contractId":{"type":"string","description":"The contract id to target."},"address":{"type":"string","description":"The address to target."},"func":{"type":"string","description":"The function name or function signature of the contract."},"args":{"type":"array","description":"An array of arguments to pass to the function.","items":{"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}]}},"value":{"type":"number","description":"The amount of native token to send with the transaction."},"nonce":{"type":"string","description":"The nonce of the transaction."},"deadline":{"type":"number","description":"The deadline for the transaction as a timestamp in seconds."},"signatures":{"type":"array","description":"An array of signatures for the transaction.","items":{"type":"string"}},"chain":{"type":"string","description":"The chain the session is to be started for.","enum":["HYCHAIN","HYCHAIN_TESTNET","LOCAL"]}}}}}},"responses":{"200":{"description":"Returns a transaction object.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TransactionModel"}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"}}}},"/v1/transactions/{transactionId}":{"get":{"operationId":"getTransaction","summary":"Get transaction","description":"Returns a transaction object for the provided transactionId.","tags":["Transactions"],"parameters":[{"$ref":"#/components/parameters/pathTransactionId"}],"responses":{"200":{"description":"Returns a transaction object.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TransactionModel"}}}},"400":{"$ref":"#/components/responses/400"}}}},"/v1/users":{"get":{"operationId":"getUser","summary":"Get user","description":"Returns a public user object when provided a user id, username or wallet address.","tags":["Users"],"parameters":[{"$ref":"#/components/parameters/queryUserId"},{"$ref":"#/components/parameters/queryUsername"},{"$ref":"#/components/parameters/queryWalletAddress"}],"responses":{"200":{"description":"Returns a public user object.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/UserModel"},{"type":"object","properties":{"preregistered":{"type":"boolean"}}},{"type":"object","properties":{"wallet":{"$ref":"#/components/schemas/WalletModel"}}}]}}}},"400":{"$ref":"#/components/responses/400"}}},"post":{"x-visibility":"private","operationId":"createUser","summary":"Create user","description":"Creates a new user using a provided username and password. A user must have an authority wallet assigned before it can be used for transactions or authorize sessions.","tags":["Users"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"username":{"type":"string","minLength":4,"description":"The users desired username."},"email":{"type":"string","format":"email","description":"An email address to associate with the user for account recovery."},"shaPassword":{"type":"string","minLength":64,"maxLength":64,"format":"password","description":"A sha256 hash of the users plaintext password.","example":"07ecafaf8304b8a12016ad05fd498e2ab338c1bcac31cb3f002386ef4ea917ad"}},"required":["username","shaPassword"]}}}},"responses":{"200":{"description":"Successfully created a new user. Returns a user object. Before the users can start session or perform transactions, their authority wallet must first be set using the PATCH /v1/users endpoint.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserModel"}}}},"400":{"$ref":"#/components/responses/400"}}},"patch":{"x-visibility":"private","operationId":"updateCurrentUser","summary":"Update current user","description":"Update various fields specific to the current user.","tags":["Users"],"parameters":[{"$ref":"#/components/parameters/headerAuthorizationUser"},{"$ref":"#/components/parameters/headerAuthorizationNonce"},{"$ref":"#/components/parameters/headerAuthorizationNonceSignature"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","format":"email","description":"A valid, unique email address that is not currently assigned to another account."},"authorityAddress":{"type":"string","description":"The wallet address associated with the private key used to generate the authorityProofSignature. This should be generated by the `hytopia-crypto-js` library. 1-time assignment, intended for setting of newly registered accounts."},"authorityCiphertext":{"type":"string","description":"The encrypted ciphertext of the private key associated with the provided authorityAddress. This should be generated by the `hytopia-crypto-js` library. 1-time assignment, intended for setting of newly registered accounts."},"authorityBackupCiphertexts":{"type":"string","description":"A ciphertext from encrypting a players authority private key with an arbitrary backup code generated and store on their client."},"authorityBackupQuestionsCiphertext":{"type":"string","description":"A ciphertext from encrypting a players authority private key with the concatenanted answers to their recovery questions."},"authorityProofSignature":{"type":"string","description":"The proof signature required for deferred smart contract account creation. This should be generated by the `hytopia-crypto-js` library. 1-time assignment, intended for setting of newly registered accounts."},"salt":{"type":"string","description":"An arbitrary salt used by the player's client along with their client-side provided password to derive a PBKDF2 key for decrypting their authority wallet's private key. 1-time assignment, intended for setting of preregistration accounts."},"backupQuestions":{"type":"array","description":"An array of any arbitrary questions to display to the user when going through account recovery.","items":{"type":"string"}},"isChild":{"type":"boolean","description":"A true or false value indicating if a child is younger than 13 (true), or older (false)."},"shaPassword":{"type":"string","description":"A sha256 hash of the users new password. Cannot be set for users who joined using an SSO option such as Discord, Twitter, Facebook, etc. Authority wallet credentials should be re-encrypted using the new plaintext password on the client side as well, with the new ciphertext being provided with the password update to prevent divergence between a users account password and wallet decryption password."},"resetAccessToken":{"type":"boolean","description":"Revokes the user's current access token and returns a new one if true."}}}}}},"responses":{"200":{"description":"Returns the updated user object.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserModel"}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"}}}},"/v1/users/auth":{"get":{"x-visibility":"private","operationId":"authUser","summary":"Authenticate user","description":"Authenticates a user for the provided email/username and shaPassword, or creates or retrieves a user for the provided sso auth code. Return a user object containing an access token.\nIf a user is preregistered or has not completed their account setup such as assigning their authority wallet or setting their password, as long as they have had an email assigned to their account, a one-time password can be emailed to the user. This can be done by using the basic auth flow and omitting the password field or passing an empty string for the password.\nYou can then auth the user by providing the sha256(one time password) equivalent as the password for this auth endpoint.","tags":["Users"],"parameters":[{"$ref":"#/components/parameters/queryAccessTokenExpiresAt"},{"$ref":"#/components/parameters/queryResetAccessToken"},{"$ref":"#/components/parameters/queryAppleAuthCode"},{"$ref":"#/components/parameters/queryAppleRedirectOverride"},{"$ref":"#/components/parameters/queryDiscordAuthCode"},{"$ref":"#/components/parameters/queryDiscordRedirectOverride"},{"$ref":"#/components/parameters/queryFacebookAuthCode"},{"$ref":"#/components/parameters/queryFacebookRedirectOverride"},{"$ref":"#/components/parameters/queryGoogleAuthCode"},{"$ref":"#/components/parameters/queryGoogleRedirectOverride"},{"$ref":"#/components/parameters/queryTwitterAuthCode"},{"$ref":"#/components/parameters/queryTwitterRedirectOverride"}],"security":[{"basicAuth":[]},{}],"responses":{"200":{"description":"Successfully authorized the user and returns a user object.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/UserModel"},{"type":"object","properties":{"socialKeyMaterial":{"type":"string"},"wallet":{"$ref":"#/components/schemas/WalletModel"}}}]}}}},"204":{"description":"Successfully emailed a one-time password to a preregistered user."},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"}}}},"/v1/users/me":{"get":{"operationId":"getCurrentUser","summary":"Get current user","description":"Returns a public user object associated with the provided session access token.","tags":["Users"],"parameters":[{"$ref":"#/components/parameters/headerAuthorizationSession"}],"responses":{"200":{"description":"Returns a public user object.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/UserModel"},{"type":"object","properties":{"wallet":{"$ref":"#/components/schemas/WalletModel"}}}]}}}},"400":{"$ref":"#/components/responses/400"}}}},"/v1/wallets/{walletIdOrAddress}":{"get":{"operationId":"getWallet","summary":"Get wallet","description":"Returns a wallet object for the provided walletIdOrAddress. If walletIdOrAddress is a HYCHAIN system wallet id, it will return a matching wallet for the id. If walletIdOrAddress is a on chain smart contract wallet address, it will return a matching wallet from the HYCHAIN system. If a wallet is not found in HYCHAIN's systems for the address or walletId provided, a 400 error will be returned.","tags":["Wallets"],"parameters":[{"$ref":"#/components/parameters/pathWalletIdOrAddress"}],"responses":{"200":{"description":"Returns a wallet object.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/WalletModel"},{"type":"object","properties":{"mainnetRequiresUpgradeTo":{"type":"string","description":"The mainnet wallet implementation address to upgrade to if the wallet requires an upgrade, otherwise null if no upgrade required."},"testnetRequiresUpgradeTo":{"type":"string","description":"The testnet wallet implementation address to upgrade to if the wallet requires an upgrade, otherwise null if no upgrade required."},"localRequiresUpgradeTo":{"type":"string","description":"The local wallet implementation address to upgrade to if the wallet requires an upgrade, otherwise null if no upgrade required."}}}]}}}},"400":{"$ref":"#/components/responses/400"}}},"patch":{"operationId":"updateWallet","summary":"Update wallet","description":"Update various fields specific to a wallet. This endpoint is currently used for optining in to upgrade a user or application smart contract wallet to the latest implementation if necessary.","tags":["Wallets"],"parameters":[{"$ref":"#/components/parameters/pathWalletIdOrAddress"},{"$ref":"#/components/parameters/headerAuthorizationUser"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"chain":{"type":"string","description":"The chain to deploy or import a contract on.","enum":["HYCHAIN","HYCHAIN_TESTNET","LOCAL"]},"deadline":{"type":"number","description":"The deadline for the transaction as a timestamp in seconds."},"upgradeToLatest":{"type":"boolean","description":"If true, the wallet will be upgraded to the latest available wallet implementation for the provided chain."},"signatures":{"type":"array","description":"An array of signatures to authorize the upgrade.","items":{"type":"string"}}}}}}},"responses":{"200":{"description":"Returns a transaction object.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TransactionModel"}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"}}}},"/v1/wallets/{walletIdOrAddress}/balance":{"get":{"operationId":"getWalletBalance","summary":"Get wallet balance","description":"Returns the native token balance for the smart contract wallet associated with a wallet id provided for walletIdOrAddress. Or, if any address is provided for walletIdOrAddress, it will return the native token balance for the address.","tags":["Wallets"],"parameters":[{"$ref":"#/components/parameters/pathWalletIdOrAddress"},{"$ref":"#/components/parameters/queryChain"}],"responses":{"200":{"description":"Returns the native token balance for the wallet in readable string format. For example a 1e18 balance would be '1.0'.","content":{"application/json":{"schema":{"type":"string"}}}},"400":{"$ref":"#/components/responses/400"}}}}}} \ No newline at end of file +{"openapi":"3.0.0","info":{"title":"HYPLAY API","version":"1.0.0","description":"HYPLAY API Specification","termsOfService":"https://hyplay.com","contact":{"name":"HYCHAIN Team","email":"braydon@hytopia.com","url":"https://hychain.com"}},"servers":[{"description":"HYPLAY API Server","url":"https://api.hyplay.com"},{"description":"HYPLAY API Staging Server","url":"https://staging-api.hyplay.com"},{"description":"Local Development Server","url":"http://localhost:8001"}],"components":{"parameters":{"headerAuthorizationUser":{"name":"x-authorization","in":"header","description":"The `accessToken` of the authenticating user.","example":"user_at_02z4Mv3c85Ig0gNowY9Dq0N2kjb1xwzr27ArLE0669RrRI6dLf822iPO26K1p1FP","required":true,"schema":{"type":"string"}},"headerAuthorizationUserOptional":{"name":"x-authorization","in":"header","description":"The `accessToken` of the authenticating user.","example":"user_at_02z4Mv3c85Ig0gNowY9Dq0N2kjb1xwzr27ArLE0669RrRI6dLf822iPO26K1p1FP","required":false,"schema":{"type":"string"}},"headerAuthorizationAppSecret":{"name":"x-app-authorization","in":"header","description":"The `secretKey` or `testSecretKey` of the authenticating app.","example":"test_app_sk_pBEHOVTIZjQFT6WpiQLT8c_VFfd6Vb2XHj_9IIV8-Zi06SdMIruJxIe2QMaca_X6","required":true,"schema":{"type":"string"}},"headerAuthorizationAppSecretOptional":{"name":"x-app-authorization","in":"header","description":"The `secretKey` or `testSecretKey` of the authenticating app.","example":"test_app_sk_pBEHOVTIZjQFT6WpiQLT8c_VFfd6Vb2XHj_9IIV8-Zi06SdMIruJxIe2QMaca_X6","required":false,"schema":{"type":"string"}},"headerAuthorizationSession":{"name":"x-session-authorization","in":"header","description":"The `accessToken` of the authenticating session.","example":"sca_sat_pBEHOVTIZjQFT6WpiQLT8c_VFfd6Vb2XHj_9IIV8-Zi06SdMIruJxIe2QMaca_X6","required":true,"schema":{"type":"string"}},"headerAuthorizationSessionOptional":{"name":"x-session-authorization","in":"header","description":"The `accessToken` of the authenticating session.","example":"sca_sat_pBEHOVTIZjQFT6WpiQLT8c_VFfd6Vb2XHj_9IIV8-Zi06SdMIruJxIe2QMaca_X6","required":false,"schema":{"type":"string"}},"headerAuthorizationNonce":{"name":"x-nonce","in":"header","description":"The nonce of the authenticating user.","required":true,"schema":{"type":"string"}},"headerAuthorizationNonceSignature":{"name":"x-nonce-signature","in":"header","description":"The nonce signature of the authenticating user.","required":true,"schema":{"type":"string"}},"pathAppId":{"name":"appId","in":"path","description":"An application id.","required":true,"schema":{"type":"string"}},"pathAssetId":{"name":"assetId","in":"path","description":"An asset id.","required":true,"schema":{"type":"string"}},"pathContractId":{"name":"contractId","in":"path","description":"A contract id.","required":true,"schema":{"type":"string"}},"pathContractIdOrAddress":{"name":"contractIdOrAddress","in":"path","description":"A contract id or address.","required":true,"schema":{"type":"string"}},"pathLeaderboardId":{"name":"leaderboardId","in":"path","description":"A leaderboard id.","required":true,"schema":{"type":"string"}},"pathSessionId":{"name":"sessionId","in":"path","description":"A session id.","required":true,"schema":{"type":"string"}},"pathTemplateId":{"name":"templateId","in":"path","description":"A template id.","required":true,"schema":{"type":"string"}},"pathTransactionId":{"name":"transactionId","in":"path","description":"A transaction id.","required":true,"schema":{"type":"string"}},"pathUserId":{"name":"userId","in":"path","description":"A user id.","required":true,"schema":{"type":"string"}},"pathWalletIdOrAddress":{"name":"walletIdOrAddress","in":"path","description":"A wallet id or address.","required":true,"schema":{"type":"string"}},"queryAccessTokenExpiresAt":{"name":"accessTokenExpiresAt","in":"query","description":"An optional unix timestamp in seconds specifying when the returned `accessToken` should expire. If this value is provided, all prior `accessToken` will be invalidated and a new `accessToken` will be issued in the response. If no value is provided, the returned `accessToken` will not expire unless it is invalidated.","example":1677197460,"required":false,"schema":{"type":"number"}},"queryAppleAuthCode":{"name":"appleAuthCode","in":"query","description":"A Apple OAuth 2.0 code.","required":false,"schema":{"type":"string"}},"queryAppleRedirectOverride":{"name":"appleRedirectOverride","in":"query","description":"An redirect url for apple auth.","required":false,"schema":{"type":"string"}},"queryAppId":{"name":"appId","in":"query","description":"An application id.","required":false,"schema":{"type":"string"}},"queryArgs":{"name":"args","in":"query","description":"An array of arguments.","required":false,"schema":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}]}}},"queryAs":{"name":"as","in":"query","description":"An address or walletId to perform as.","required":false,"schema":{"type":"string"}},"queryChain":{"name":"chain","in":"query","description":"A chain name.","required":false,"schema":{"type":"string","enum":["HYCHAIN","HYCHAIN_TESTNET","LOCAL"]}},"queryCursor":{"name":"cursor","in":"query","description":"An id from the record type to start the pagination of the next results, excluding the provided record id.","required":false,"schema":{"type":"string"}},"queryFunc":{"name":"func","in":"query","description":"A function name or function signature.","required":true,"schema":{"type":"string"}},"queryDiscordAuthCode":{"name":"discordAuthCode","in":"query","description":"A Discord OAuth 2.0 code.","required":false,"schema":{"type":"string"}},"queryDiscordRedirectOverride":{"name":"discordRedirectOverride","in":"query","description":"An redirect url for discord auth.","required":false,"schema":{"type":"string"}},"queryFacebookAuthCode":{"name":"facebookAuthCode","in":"query","description":"A Facebook OAuth 2.0 code.","required":false,"schema":{"type":"string"}},"queryFacebookRedirectOverride":{"name":"facebookRedirectOverride","in":"query","description":"An redirect url for facebook auth.","required":false,"schema":{"type":"string"}},"queryGoogleAuthCode":{"name":"googleAuthCode","in":"query","description":"A Google OAuth 2.0 code.","required":false,"schema":{"type":"string"}},"queryGoogleRedirectOverride":{"name":"googleRedirectOverride","in":"query","description":"An redirect url for google auth.","required":false,"schema":{"type":"string"}},"queryTwitterAuthCode":{"name":"twitterAuthCode","in":"query","description":"A Twitter OAuth 2.0 code.","required":false,"schema":{"type":"string"}},"queryTwitterRedirectOverride":{"name":"twitterRedirectOverride","in":"query","description":"An redirect url for twitter auth.","required":false,"schema":{"type":"string"}},"queryTemplateApproved":{"name":"approved","in":"query","description":"Set this query parameter to `true` to filter for approved templates.","example":"true","required":false,"schema":{"type":"string"}},"queryTemplateName":{"name":"name","in":"query","description":"A template name to partially or exactly match.","example":"token","required":false,"schema":{"type":"string"}},"queryLimit":{"name":"limit","in":"query","description":"The maximum number of items to return.","example":25,"required":false,"schema":{"type":"number"}},"queryOffset":{"name":"offset","in":"query","description":"The offset of the first item to return.","example":0,"required":false,"schema":{"type":"number"}},"queryResetAccessToken":{"name":"resetAccessToken","in":"query","description":"Set this query parameter to `true` to reset accessToken and authorityKey.","example":"true","required":false,"schema":{"type":"string"}},"queryRecaptchaToken":{"name":"hcaptchaResponse","in":"query","description":"A hCaptcha token generated client-side by completion of a user-facing hCaptcha request.","required":true,"schema":{"type":"string"}},"querySessionId":{"name":"sessionId","in":"query","description":"A session id.","required":false,"schema":{"type":"string"}},"querySort":{"name":"sort","in":"query","description":"A sort order.","required":false,"schema":{"type":"string"}},"queryUsername":{"name":"username","in":"query","description":"A user username.","example":"arkdev","required":false,"schema":{"type":"string"}},"queryUserId":{"name":"userId","in":"query","description":"A user id.","required":false,"schema":{"type":"string"}},"queryWalletAddress":{"name":"walletAddress","in":"query","description":"A wallet address.","required":false,"schema":{"type":"string"}},"queryWalletId":{"name":"walletId","in":"query","description":"A wallet id.","required":false,"schema":{"type":"string"}},"queryStateKey":{"name":"key","in":"query","description":"A string identifier unique to an app for looking up state data.","required":false,"schema":{"type":"string"}}},"responses":{"400":{"description":"An API level error occurred. This is often due to problematic data being provided by you.","content":{"application/json":{"schema":{"type":"string"}}}},"401":{"description":"An authorization error occured. This is often due to incorrect tokens or keys being provided, or accessing a resource that the provided tokens or keys do not have access to.","content":{"application/json":{"schema":{"type":"string"}}}}},"schemas":{"AppModel":{"type":"object","properties":{"id":{"type":"string","description":"This field has not had a description added."},"userId":{"type":"string","description":"This field has not had a description added."},"walletId":{"type":"string","description":"This field has not had a description added."},"iconImageAssetId":{"type":"string","description":"This field has not had a description added."},"backgroundImageAssetId":{"type":"string","description":"This field has not had a description added."},"logoImageAssetId":{"type":"string","description":"This field has not had a description added."},"galleryMediaAssetIds":{"type":"object","description":"This field has not had a description added."},"secretKey":{"type":"string","description":"This field has not had a description added."},"testSecretKey":{"type":"string","description":"This field has not had a description added."},"name":{"type":"string","description":"This field has not had a description added."},"description":{"type":"string","description":"This field has not had a description added."},"url":{"type":"string","description":"This field has not had a description added."},"discordUrl":{"type":"string","description":"This field has not had a description added."},"twitterUrl":{"type":"string","description":"This field has not had a description added."},"steamUrl":{"type":"string","description":"This field has not had a description added."},"appleIosUrl":{"type":"string","description":"This field has not had a description added."},"appleMacUrl":{"type":"string","description":"This field has not had a description added."},"googlePlayUrl":{"type":"string","description":"This field has not had a description added."},"microsoftUrl":{"type":"string","description":"This field has not had a description added."},"privacyUrl":{"type":"string","description":"This field has not had a description added."},"termsUrl":{"type":"string","description":"This field has not had a description added."},"redirectUris":{"type":"object","description":"This field has not had a description added."},"verificationStatus":{"type":"string","description":"This field has not had a description added."},"updatedAt":{"type":"string","description":"This field has not had a description added."},"createdAt":{"type":"string","description":"This field has not had a description added."}}},"AppReferralsModel":{"type":"object","properties":{"id":{"type":"string","description":"This field has not had a description added."},"appId":{"type":"string","description":"This field has not had a description added."},"referredUserId":{"type":"string","description":"This field has not had a description added."},"referrerUserId":{"type":"string","description":"This field has not had a description added."},"updatedAt":{"type":"string","description":"This field has not had a description added."},"createdAt":{"type":"string","description":"This field has not had a description added."}}},"AppTeammateModel":{"type":"object","properties":{"id":{"type":"string","description":"This field has not had a description added."},"appId":{"type":"string","description":"This field has not had a description added."},"userId":{"type":"string","description":"This field has not had a description added."},"role":{"type":"string","description":"This field has not had a description added."},"updatedAt":{"type":"string","description":"This field has not had a description added."},"createdAt":{"type":"string","description":"This field has not had a description added."}}},"AssetModel":{"type":"object","properties":{"id":{"type":"string","description":"This field has not had a description added."},"userId":{"type":"string","description":"This field has not had a description added."},"s3Url":{"type":"string","description":"This field has not had a description added."},"cdnUrl":{"type":"string","description":"This field has not had a description added."},"mime":{"type":"string","description":"This field has not had a description added."},"extension":{"type":"string","description":"This field has not had a description added."},"checksum":{"type":"string","description":"This field has not had a description added."},"size":{"type":"integer","description":"This field has not had a description added."},"updatedAt":{"type":"string","description":"This field has not had a description added."},"createdAt":{"type":"string","description":"This field has not had a description added."}}},"ContractModel":{"type":"object","properties":{"id":{"type":"string","description":"This field has not had a description added."},"appId":{"type":"string","description":"This field has not had a description added."},"userId":{"type":"string","description":"This field has not had a description added."},"templateId":{"type":"string","description":"This field has not had a description added."},"chain":{"type":"string","description":"This field has not had a description added."},"abi":{"type":"object","description":"This field has not had a description added."},"address":{"type":"string","description":"This field has not had a description added."},"name":{"type":"string","description":"This field has not had a description added."},"description":{"type":"string","description":"This field has not had a description added."},"metadata":{"type":"object","description":"This field has not had a description added."},"updatedAt":{"type":"string","description":"This field has not had a description added."},"createdAt":{"type":"string","description":"This field has not had a description added."}}},"NonceModel":{"type":"object","properties":{"id":{"type":"string","description":"This field has not had a description added."},"walletId":{"type":"string","description":"This field has not had a description added."},"nonce":{"type":"string","description":"This field has not had a description added."},"createdAt":{"type":"string","description":"This field has not had a description added."}}},"SessionModel":{"type":"object","properties":{"id":{"type":"string","description":"This field has not had a description added."},"appId":{"type":"string","description":"This field has not had a description added."},"userId":{"type":"string","description":"This field has not had a description added."},"chain":{"type":"string","description":"This field has not had a description added."},"accessToken":{"type":"string","description":"This field has not had a description added."},"exchangeCode":{"type":"string","description":"This field has not had a description added."},"scopes":{"type":"object","description":"This field has not had a description added."},"contractFunctionSelectors":{"type":"object","description":"This field has not had a description added."},"nativeAllowance":{"type":"string","description":"This field has not had a description added."},"erc20Allowances":{"type":"object","description":"This field has not had a description added."},"erc721Allowances":{"type":"object","description":"This field has not had a description added."},"erc1155Allowances":{"type":"object","description":"This field has not had a description added."},"nonce":{"type":"string","description":"This field has not had a description added."},"signatures":{"type":"object","description":"This field has not had a description added."},"deadline":{"type":"string","description":"This field has not had a description added."},"expiresAt":{"type":"string","description":"This field has not had a description added."},"endedAt":{"type":"string","description":"This field has not had a description added."},"updatedAt":{"type":"string","description":"This field has not had a description added."},"createdAt":{"type":"string","description":"This field has not had a description added."}}},"TemplateModel":{"type":"object","properties":{"id":{"type":"string","description":"This field has not had a description added."},"userId":{"type":"string","description":"This field has not had a description added."},"name":{"type":"string","description":"This field has not had a description added."},"description":{"type":"string","description":"This field has not had a description added."},"solidity":{"type":"string","description":"This field has not had a description added."},"target":{"type":"string","description":"This field has not had a description added."},"bytecode":{"type":"string","description":"This field has not had a description added."},"abi":{"type":"object","description":"This field has not had a description added."},"errors":{"type":"object","description":"This field has not had a description added."},"approved":{"type":"boolean","description":"This field has not had a description added."},"updatedAt":{"type":"string","description":"This field has not had a description added."},"createdAt":{"type":"string","description":"This field has not had a description added."}}},"TransactionModel":{"type":"object","properties":{"id":{"type":"string","description":"This field has not had a description added."},"walletId":{"type":"string","description":"This field has not had a description added."},"sessionId":{"type":"string","description":"This field has not had a description added."},"chain":{"type":"string","description":"This field has not had a description added."},"relayerAddress":{"type":"string","description":"This field has not had a description added."},"func":{"type":"string","description":"This field has not had a description added."},"args":{"type":"object","description":"This field has not had a description added."},"value":{"type":"string","description":"This field has not had a description added."},"hash":{"type":"string","description":"This field has not had a description added."},"createdAt":{"type":"string","description":"This field has not had a description added."}}},"UserModel":{"type":"object","properties":{"id":{"type":"string","description":"This field has not had a description added."},"walletId":{"type":"string","description":"This field has not had a description added."},"username":{"type":"string","description":"This field has not had a description added."},"email":{"type":"string","description":"This field has not had a description added."},"phone":{"type":"string","description":"This field has not had a description added."},"appleId":{"type":"string","description":"This field has not had a description added."},"discordId":{"type":"string","description":"This field has not had a description added."},"facebookId":{"type":"string","description":"This field has not had a description added."},"googleId":{"type":"string","description":"This field has not had a description added."},"microsoftId":{"type":"string","description":"This field has not had a description added."},"twitterId":{"type":"string","description":"This field has not had a description added."},"accessToken":{"type":"string","description":"This field has not had a description added."},"isChild":{"type":"boolean","description":"This field has not had a description added."},"accessTokenExpiresAt":{"type":"string","description":"This field has not had a description added."},"updatedAt":{"type":"string","description":"This field has not had a description added."},"createdAt":{"type":"string","description":"This field has not had a description added."}}},"WalletModel":{"type":"object","properties":{"id":{"type":"string","description":"This field has not had a description added."},"type":{"type":"string","description":"This field has not had a description added."},"address":{"type":"string","description":"This field has not had a description added."},"authorityCiphertext":{"type":"string","description":"This field has not had a description added."},"authorityBackupCiphertexts":{"type":"object","description":"This field has not had a description added."},"authorityProofSignature":{"type":"string","description":"This field has not had a description added."},"backupQuestions":{"type":"object","description":"This field has not had a description added."},"updatedAt":{"type":"string","description":"This field has not had a description added."},"createdAt":{"type":"string","description":"This field has not had a description added."}}},"AnyValue":{"description":"Can be anything. String, number, object, array, boolean, etc."}},"securitySchemes":{"basicAuth":{"type":"http","scheme":"basic","description":"Basic authentication must be send in the format of usernameOrEmail:shaPassword, where usernameOrEmail can be the username or email associated with an account, andshaPassword is a sha256 hash of the users provided plaintext password."}}},"tags":[{"name":"Users","description":"User related operations"}],"paths":{"/v1/apps":{"get":{"operationId":"getApps","summary":"Get apps","description":"Returns an array of apps owned by, or a teammate of, for the authorized user, or up to 25 public apps across HYPLAY if no authorization is provided. Supports pagination for public apps when no user authorization is provided - a `cursor` query parameter can be provided for paginating results based on last result set id.","tags":["Apps"],"parameters":[{"$ref":"#/components/parameters/headerAuthorizationUserOptional"},{"$ref":"#/components/parameters/queryCursor"}],"responses":{"200":{"description":"Returns an array of apps owned by the authorized user or public apps across HYPLAY if no authorization is provided.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/AppModel"},{"type":"object","properties":{"iconImageAsset":{"$ref":"#/components/schemas/AssetModel"},"backgroundImageAsset":{"$ref":"#/components/schemas/AssetModel"},"logoImageAsset":{"$ref":"#/components/schemas/AssetModel"},"wallet":{"$ref":"#/components/schemas/WalletModel"}}}]}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"}}},"post":{"operationId":"createApp","summary":"Create app","description":"Create a new app for the authorized user.","tags":["Apps"],"parameters":[{"$ref":"#/components/parameters/headerAuthorizationUser"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"iconImageAssetId":{"type":"string","description":"The assetId of the icon image. Icon images are recommended to be a 1:1 aspect ratio and at least 512x512 pixels."},"backgroundImageAssetId":{"type":"string","description":"The assetId of the background image. Background images are recommended to be a 16:9 aspect ratio and at least 1920x1080 pixels."},"logoImageAssetId":{"type":"string","description":"The assetId of the logo image. Logo image are used on pages like preregistration, questing, etc and can be any aspect ratio."},"galleryMediaAssetIds":{"type":"array","description":"An array of assetIds for media assets to be displayed for app promotional purposes. Such as the web page media gallery.","items":{"type":"string"}},"name":{"type":"string","description":"The name of the app."},"description":{"type":"string","format":"html","description":"A brief description of the app and what it is and does."},"url":{"type":"string","description":"The URL of the app, such as its website or where users can learn more about it."},"discordUrl":{"type":"string","description":"The URL of the app's Discord server."},"twitterUrl":{"type":"string","description":"The URL of the app's Twitter page."},"steamUrl":{"type":"string","description":"The URL of the app's Steam page."},"appleIosUrl":{"type":"string","description":"The URL of the app's Apple iOS page."},"appleMacUrl":{"type":"string","description":"The URL of the app's Apple Mac page."},"googlePlayUrl":{"type":"string","description":"The URL of the app's Google Play page."},"microsoftUrl":{"type":"string","description":"The URL of the app's Windows Store page."},"privacyUrl":{"type":"string","description":"The URL of the app's privacy policy."},"termsUrl":{"type":"string","description":"The URL of the app's terms of service."},"redirectUris":{"type":"array","description":"An array of valid redirect URIs for the user authorization flows of the app.","items":{"type":"string"}}},"required":["name"]}}}},"responses":{"200":{"description":"Successfully created a new app. Returns an app object.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/AppModel"},{"type":"object","properties":{"iconImageAsset":{"$ref":"#/components/schemas/AssetModel"},"backgroundImageAsset":{"$ref":"#/components/schemas/AssetModel"},"wallet":{"$ref":"#/components/schemas/WalletModel"}}}]}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"}}}},"/v1/apps/{appId}":{"get":{"operationId":"getPublicApp","summary":"Get public app","description":"Return a public app object for the provided appId.","tags":["Apps"],"parameters":[{"$ref":"#/components/parameters/pathAppId"}],"responses":{"200":{"description":"Returns a public app object.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/AppModel"},{"type":"object","properties":{"iconImageAsset":{"$ref":"#/components/schemas/AssetModel"},"backgroundImageAsset":{"$ref":"#/components/schemas/AssetModel"},"logoImageAsset":{"$ref":"#/components/schemas/AssetModel"},"galleryMediaAssets":{"type":"array","items":{"$ref":"#/components/schemas/AssetModel"}},"wallet":{"$ref":"#/components/schemas/WalletModel"},"totalUsers":{"type":"number"}}}]}}}},"400":{"$ref":"#/components/responses/400"}}},"patch":{"operationId":"updateApp","summary":"Update app","description":"Update an app owned by the authorized user for the provided appId.","tags":["Apps"],"parameters":[{"$ref":"#/components/parameters/headerAuthorizationUser"},{"$ref":"#/components/parameters/pathAppId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"iconImageAssetId":{"type":"string","description":"The assetId of the icon image."},"backgroundImageAssetId":{"type":"string","description":"The assetId of the background image."},"logoImageAssetId":{"type":"string","description":"The assetId of the logo image."},"galleryMediaAssetIds":{"type":"array","description":"An array of assetIds for media assets to be displayed for app promotional purposes. Such as the web page media gallery.","items":{"type":"string"}},"name":{"type":"string","description":"The name of the app."},"description":{"type":"string","format":"html","description":"A brief description of the app and what it is and does."},"url":{"type":"string","description":"The URL of the app, such as its website or where users can learn more about it."},"discordUrl":{"type":"string","description":"The URL of the app's Discord server."},"twitterUrl":{"type":"string","description":"The URL of the app's Twitter page."},"steamUrl":{"type":"string","description":"The URL of the app's Steam page."},"appleIosUrl":{"type":"string","description":"The URL of the app's Apple iOS page."},"appleMacUrl":{"type":"string","description":"The URL of the app's Apple Mac page."},"googlePlayUrl":{"type":"string","description":"The URL of the app's Google Play page."},"microsoftUrl":{"type":"string","description":"The URL of the app's Windows page."},"privacyUrl":{"type":"string","description":"The URL of the app's privacy policy."},"termsUrl":{"type":"string","description":"The URL of the app's terms of service."},"redirectUris":{"type":"array","description":"An array of valid redirect URIs for the user authorization flows of the app.","items":{"type":"string"}},"resetSecretKey":{"type":"boolean","description":"If true, reset the secretKey of the app."},"resetTestSecretKey":{"type":"boolean","description":"If true, reset the testSecretKey of the app."}}}}}},"responses":{"200":{"description":"Returns the updated app object.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AppModel"}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"}}}},"/v1/apps/{appId}/leaderboards":{"get":{"operationId":"getLeaderboards","summary":"Get leaderboards","description":"Get the leaderboards of the app.","tags":["Leaderboards"],"parameters":[{"$ref":"#/components/parameters/pathAppId"}],"responses":{"200":{"description":"Returns an array of leaderboards for the app.","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"The leaderboard ID."},"name":{"type":"string","description":"The leaderboard name."},"description":{"type":"string","description":"The leaderboard description."},"totalScores":{"type":"number","description":"The total number of users with scores in the leaderboard."}}}}}}},"400":{"$ref":"#/components/responses/400"}}},"post":{"operationId":"createLeaderboard","summary":"Create leaderboard","description":"Create a leaderboard for the app.","tags":["Leaderboards"],"parameters":[{"$ref":"#/components/parameters/headerAuthorizationAppSecret"},{"$ref":"#/components/parameters/pathAppId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"The leaderboard name."},"description":{"type":"string","description":"The leaderboard description."}},"required":["name"]}}}},"responses":{"200":{"description":"Returns the created leaderboard.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"The leaderboard ID."},"name":{"type":"string","description":"The leaderboard name."},"description":{"type":"string","description":"The leaderboard description."},"scores":{"type":"object","description":"The leaderboard scores, keyed by user ID, defaults to an empty object."},"key":{"type":"string","description":"The leaderboard hash key, used to generate hashes for client side submission of scores."},"createdAt":{"type":"number","description":"The timestamp of the leaderboard creation in seconds since the Unix epoch."}}}}}},"400":{"$ref":"#/components/responses/400"}}}},"/v1/apps/{appId}/leaderboards/{leaderboardId}":{"get":{"operationId":"getLeaderboard","summary":"Get leaderboard","description":"Get a leaderboard of the app.","tags":["Leaderboards"],"parameters":[{"$ref":"#/components/parameters/pathAppId"},{"$ref":"#/components/parameters/pathLeaderboardId"}],"responses":{"200":{"description":"Returns a leaderboard.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"The leaderboard ID."},"name":{"type":"string","description":"The leaderboard name."},"description":{"type":"string","description":"The leaderboard description."},"totalScores":{"type":"number","description":"The total number of users with scores in the leaderboard."}}}}}},"400":{"$ref":"#/components/responses/400"}}},"patch":{"operationId":"updateLeaderboard","summary":"Update leaderboard","description":"Update a leaderboard of the app.","tags":["Leaderboards"],"parameters":[{"$ref":"#/components/parameters/headerAuthorizationAppSecret"},{"$ref":"#/components/parameters/pathAppId"},{"$ref":"#/components/parameters/pathLeaderboardId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"The leaderboard name."},"description":{"type":"string","description":"The leaderboard description."}}}}}},"responses":{"200":{"description":"Returns the updated leaderboard.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"The leaderboard ID."},"name":{"type":"string","description":"The leaderboard name."},"description":{"type":"string","description":"The leaderboard description."},"scores":{"type":"object","description":"The leaderboard scores, keyed by user ID."},"key":{"type":"string","description":"The leaderboard hash key, used to generate hashes"},"createdAt":{"type":"number","description":"The timestamp of the leaderboard creation in seconds since the Unix epoch."}}}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"}}}},"/v1/apps/{appId}/leaderboards/{leaderboardId}/key":{"get":{"operationId":"getLeaderboardKey","summary":"Get leaderboard key","description":"Get the key for a leaderboard.","tags":["Leaderboards"],"parameters":[{"$ref":"#/components/parameters/headerAuthorizationAppSecret"},{"$ref":"#/components/parameters/pathAppId"},{"$ref":"#/components/parameters/pathLeaderboardId"}],"responses":{"200":{"description":"Returns the leaderboard key.","content":{"application/json":{"schema":{"type":"string"}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"}}}},"/v1/apps/{appId}/leaderboards/{leaderboardId}/score":{"get":{"operationId":"getLeaderboardScore","summary":"Get leaderboard score","description":"Get a leaderboard score.","tags":["Leaderboards"],"parameters":[{"$ref":"#/components/parameters/pathAppId"},{"$ref":"#/components/parameters/pathLeaderboardId"},{"$ref":"#/components/parameters/queryUserId"}],"responses":{"200":{"description":"Returns a score based on the provided parameters.","content":{"application/json":{"schema":{"type":"object","properties":{"userId":{"type":"string"},"score":{"type":"number"},"timestamp":{"type":"number"}}}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"}}}},"/v1/apps/{appId}/leaderboards/{leaderboardId}/scores":{"get":{"operationId":"getLeaderboardScores","summary":"Get leaderboard scores","description":"Get an array of scores for the provided leaderboardId. Returns an array default orderered by scores descending. Additionally supports pagination via the `offset` and `limit query parameters. Leaderboard scores return a default of 25 scores.","tags":["Leaderboards"],"parameters":[{"$ref":"#/components/parameters/pathAppId"},{"$ref":"#/components/parameters/pathLeaderboardId"},{"$ref":"#/components/parameters/querySort"},{"$ref":"#/components/parameters/queryOffset"},{"$ref":"#/components/parameters/queryLimit"}],"responses":{"200":{"description":"Returns an array of scores.","content":{"application/json":{"schema":{"type":"object","properties":{"scores":{"type":"array","items":{"type":"object","properties":{"userId":{"type":"string"},"username":{"type":"string"},"score":{"type":"number"},"timestamp":{"type":"number"}}}},"totalScores":{"type":"number"}}}}}},"400":{"$ref":"#/components/responses/400"}}},"post":{"operationId":"createLeaderboardScore","summary":"Create leaderboard score","description":"Create a score for the provided leaderboardId. Leaderboard scores can be provided for any user id when the app secret key authorization is provided. Alternatively, a user may submit their own scores by provided their session authorization, with a request body containing `score` and `hash`. A valid `hash` is intended to be generated for each score within the game client as sha256(leaderboardKey:userId:score).","tags":["Leaderboards"],"parameters":[{"$ref":"#/components/parameters/headerAuthorizationAppSecretOptional"},{"$ref":"#/components/parameters/headerAuthorizationSessionOptional"},{"$ref":"#/components/parameters/pathAppId"},{"$ref":"#/components/parameters/pathLeaderboardId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"userId":{"type":"string","description":"The user id to associate the score with."},"score":{"type":"number","description":"The score to submit. Can be any number."},"hash":{"type":"string","description":"The hash of the score when submitting with session authorization. Must be generated as a hash using sha256(leaderboardKey:userId:score)."}},"required":["score"]}}}},"responses":{"200":{"description":"Returns the created score.","content":{"application/json":{"schema":{"type":"object","properties":{"userId":{"type":"string"},"score":{"type":"number"},"timestamp":{"type":"number"}}}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"}}},"delete":{"operationId":"deleteLeaderboardScore","summary":"Delete leaderboard score","description":"Delete a score for the provided leaderboardId and userId.","tags":["Leaderboards"],"parameters":[{"$ref":"#/components/parameters/headerAuthorizationAppSecret"},{"$ref":"#/components/parameters/pathAppId"},{"$ref":"#/components/parameters/pathLeaderboardId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"userId":{"type":"string","description":"The user id to delete the score for."}},"required":["userId"]}}}},"responses":{"204":{"description":"Score deleted successfully."},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"}}}},"/v1/apps/{appId}/page":{"get":{"operationId":"getPage","summary":"Get page","description":"Get the HYPLAY page data for an app.","tags":["Promo Page"],"parameters":[{"$ref":"#/components/parameters/pathAppId"}],"responses":{"200":{"description":"Returns the HYPLAY page data for the app.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/AppModel"},{"type":"object","properties":{"iconImageAsset":{"$ref":"#/components/schemas/AssetModel"},"backgroundImageAsset":{"$ref":"#/components/schemas/AssetModel"},"logoImageAsset":{"$ref":"#/components/schemas/AssetModel"},"galleryMediaAssets":{"type":"array","items":{"$ref":"#/components/schemas/AssetModel"}},"preregister":{"type":"object","properties":{"visible":{"type":"boolean"},"incentiveText":{"type":"string"}}},"leaderboard":{"type":"object","properties":{"id":{"type":"string"},"visible":{"type":"boolean"}}},"referral":{"type":"object","properties":{"visible":{"type":"boolean"},"titleText":{"type":"string"},"incentiveText":{"type":"string"}}},"links":{"type":"array","items":{"type":"object","properties":{"text":{"type":"string"},"url":{"type":"string"}}}},"wallet":{"$ref":"#/components/schemas/WalletModel"},"totalUsers":{"type":"number"}}}]}}}},"400":{"$ref":"#/components/responses/400"}}},"patch":{"operationId":"updatePage","summary":"Update page","description":"Update the HYPLAY page data for an app.","tags":["Promo Page"],"parameters":[{"$ref":"#/components/parameters/headerAuthorizationUser"},{"$ref":"#/components/parameters/pathAppId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"preregisterVisible":{"type":"boolean","description":"Whether the pre-register section is visible."},"preregisterIncentiveText":{"type":"string","description":"The incentive text to display with the pre-register prompt."},"leaderboardId":{"type":"string","format":"uuid","description":"The id of the leaderboard to display."},"leaderboardVisible":{"type":"boolean","description":"Whether the leaderboard section is visible."},"referralVisible":{"type":"boolean","description":"Whether the referral section is visible."},"referralTitleText":{"type":"string","description":"The title text to display in the referral section."},"referralIncentiveText":{"type":"string","description":"The incentive text to display in the referral section."},"links":{"type":"array","items":{"type":"object","properties":{"text":{"type":"string"},"url":{"type":"string"}}}}}}}}},"responses":{"200":{"description":"Returns the updated HYPLAY page data for the app.","content":{"application/json":{"schema":{"type":"object","properties":{"preregister":{"type":"object","properties":{"visible":{"type":"boolean"},"incentiveText":{"type":"string"}}},"leaderboard":{"type":"object","properties":{"id":{"type":"string"},"visible":{"type":"boolean"}}},"referral":{"type":"object","properties":{"visible":{"type":"boolean"},"titleText":{"type":"string"},"incentiveText":{"type":"string"}}},"links":{"type":"array","items":{"type":"object","properties":{"text":{"type":"string"},"url":{"type":"string"}}}}}}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"}}}},"/v1/apps/{appId}/states":{"get":{"operationId":"getAppState","summary":"Get app state","description":"Get the public, protected, private state of an app, user or key.","tags":["Apps"],"parameters":[{"$ref":"#/components/parameters/pathAppId"},{"$ref":"#/components/parameters/queryStateKey"},{"$ref":"#/components/parameters/headerAuthorizationAppSecretOptional"},{"$ref":"#/components/parameters/headerAuthorizationSessionOptional"}],"responses":{"200":{"description":"Returns a state object that may contain public, protected, and/or private state for the app, key or user for the authorized user session.","content":{"application/json":{"schema":{"type":"object","properties":{"publicState":{"type":"object","description":"Public state data for the app or user."},"protectedState":{"type":"object","description":"Protected state data for the app or user."},"privateState":{"type":"object","description":"Private state data for the app or user."}},"required":["public","protected"]}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"}}},"post":{"operationId":"setAppState","summary":"Set app state","description":"Set arbitrary JSON blobs for public, protected and/or private state specific to an application or authorized user of an application. This is useful for saving different types of data specific to users or global configuration of your app or game in many different situations. It is intended to be highly flexible. State set for a user of your app, a unique lookup key, and the app itself are all isolated to your application. State storage is not globablly shared between applications.","tags":["Apps"],"parameters":[{"$ref":"#/components/parameters/pathAppId"},{"$ref":"#/components/parameters/headerAuthorizationAppSecretOptional"},{"$ref":"#/components/parameters/headerAuthorizationSessionOptional"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"key":{"type":"string","description":"Any unique lookup key for this data. This can be things such as a hyplay user id, an internal battle match id for your game, some arbitrary settings identifier for a system of your app and more. Keys are flexible ways to create string based lookup identifiers for data you want to store/lookup. Keys are unique to your application and are not shared globally."},"publicState":{"type":"object","description":"Public state data to set for the app or user.","additionalProperties":true},"protectedState":{"type":"object","description":"Protected state data to set for the app or user.","additionalProperties":true},"privateState":{"type":"object","description":"Private state data to set for the app or user.","additionalProperties":true},"overwrite":{"type":"boolean","description":"If true, the state will be overwritten with the provided state. If false or omitted, the state will be deep merged with the provided state."}}}}}},"responses":{"200":{"description":"Returns a state object that may contain public, protected, and/or private state for the app, or user of the app for the provided userId.","content":{"application/json":{"schema":{"type":"object","properties":{"publicState":{"type":"object","description":"Public state data for the app or user."},"protectedState":{"type":"object","description":"Protected state data for the app or user."},"privateState":{"type":"object","description":"Private state data for the app or user."}},"required":["publicState","protectedState"]}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"}}}},"/v1/apps/{appId}/teammates":{"get":{"operationId":"getAppTeammates","summary":"Get app teammates","description":"Get an array of teammates for the provided appId.","tags":["Apps"],"parameters":[{"$ref":"#/components/parameters/headerAuthorizationUser"},{"$ref":"#/components/parameters/pathAppId"}],"responses":{"200":{"description":"Returns an array of teammates.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/AppTeammateModel"},{"type":"object","properties":{"user":{"type":"object","properties":{"id":{"type":"string"},"username":{"type":"string"}}}}}]}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"}}},"post":{"operationId":"createAppTeammate","summary":"Create app teammate","description":"Create a teammate for the provided appId, userId and role. Authorized user must be the owner of the app, or be a teammate with a role of OWNER.","tags":["Apps"],"parameters":[{"$ref":"#/components/parameters/headerAuthorizationUser"},{"$ref":"#/components/parameters/pathAppId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"userId":{"type":"string","description":"The user id to add as a teammate of the app."},"role":{"type":"string","description":"The role of the teammate.","enum":["OWNER","DEVELOPER","EDITOR","ANALYST"]}},"required":["userId","role"]}}}},"responses":{"200":{"description":"Returns the created or existing teammate.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AppTeammateModel"}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"}}}},"/v1/apps/{appId}/teammates/{userId}":{"patch":{"operationId":"updateAppTeammate","summary":"Update app teammate","description":"Update the role of a teammate for the provided appId and userId. Authorized user must be the owner of the app, or be a teammate with a role of OWNER.","tags":["Apps"],"parameters":[{"$ref":"#/components/parameters/headerAuthorizationUser"},{"$ref":"#/components/parameters/pathAppId"},{"$ref":"#/components/parameters/pathUserId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"role":{"type":"string","description":"The role of the teammate.","enum":["OWNER","DEVELOPER","EDITOR","ANALYST"]}},"required":["role"]}}}},"responses":{"200":{"description":"Returns the updated teammate.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AppTeammateModel"}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"}}},"delete":{"operationId":"deleteAppTeammate","summary":"Delete app teammate","description":"Delete a teammate for the provided appId and userId. Authorized user must be the owner of the app, or be a teammate with a role of OWNER.","tags":["Apps"],"parameters":[{"$ref":"#/components/parameters/headerAuthorizationUser"},{"$ref":"#/components/parameters/pathAppId"},{"$ref":"#/components/parameters/pathUserId"}],"responses":{"204":{"description":"Teammate deleted successfully."},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"}}}},"/v1/apps/{appId}/users":{"get":{"operationId":"getAppUsers","summary":"Get app users","description":"Returns an array of public users objects representing users of the apps. A HYPLAY user is considered a user of the app if they have had at least 1 active session for the provided appId.","tags":["Apps"],"parameters":[{"$ref":"#/components/parameters/pathAppId"},{"$ref":"#/components/parameters/headerAuthorizationAppSecretOptional"},{"$ref":"#/components/parameters/queryCursor"}],"responses":{"200":{"description":"Returns an array of public user objects.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/UserModel"},{"type":"object","properties":{"wallet":{"$ref":"#/components/schemas/WalletModel"}}}]}}}},"400":{"$ref":"#/components/responses/400"}}}},"/v1/apps/{appId}/users/{userId}":{"get":{"operationId":"getAppUser","summary":"Get app user","description":"Returns a public user object representing a user of the app that also includes the `totalAppReferrals` property which represents the number of other users the user for the provided userId has referred to the provided appId.","tags":["Apps"],"parameters":[{"$ref":"#/components/parameters/pathAppId"},{"$ref":"#/components/parameters/pathUserId"}],"responses":{"200":{"description":"Returns a public user object that includes a `totalAppReferrals` property.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/UserModel"},{"type":"object","properties":{"wallet":{"$ref":"#/components/schemas/WalletModel"}}},{"type":"object","properties":{"totalAppReferrals":{"type":"integer"}}}]}}}},"400":{"$ref":"#/components/responses/400"}}}},"/v1/apps/{appId}/whitelist":{"get":{"operationId":"getWhitelist","summary":"Get whitelist","description":"Get the whitelist data for an app. Returns all data in lower case to simplify case insensitive matching.","tags":["Whitelist"],"parameters":[{"$ref":"#/components/parameters/headerAuthorizationUser"},{"$ref":"#/components/parameters/pathAppId"}],"responses":{"200":{"description":"Returns the whitelist data for the app.","content":{"application/json":{"schema":{"type":"object","properties":{"enabled":{"type":"boolean"},"userIds":{"type":"array","items":{"type":"string"}},"emails":{"type":"array","items":{"type":"string"}},"usernames":{"type":"array","items":{"type":"string"}}}}}}},"400":{"$ref":"#/components/responses/400"}}},"patch":{"operationId":"updateWhitelist","summary":"Update whitelist","description":"Update the whitelist data for an app. Existing values provided will be ignored to prevent duplicates in the list. All values are case-insensitive.","tags":["Whitelist"],"parameters":[{"$ref":"#/components/parameters/headerAuthorizationUser"},{"$ref":"#/components/parameters/pathAppId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"enabled":{"type":"boolean","description":"Whether the whitelist is enabled."},"userIds":{"type":"array","description":"User Ids to add to the whitelist.","items":{"type":"string"}},"emails":{"type":"array","description":"Emails to add to the whitelist.","items":{"type":"string"}},"usernames":{"type":"array","description":"Usernames to add to the whitelist.","items":{"type":"string"}}}}}}},"responses":{"200":{"description":"Returns the updated whitelist data for the app.","content":{"application/json":{"schema":{"type":"object","properties":{"enabled":{"type":"boolean"},"userIds":{"type":"array","items":{"type":"string"}},"emails":{"type":"array","items":{"type":"string"}},"usernames":{"type":"array","items":{"type":"string"}}}}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"}}},"delete":{"operationId":"deleteFromWhitelist","summary":"Delete from whitelist","description":"Delete entries from the whitelist for an app. All values are case-insensitive.","tags":["Whitelist"],"parameters":[{"$ref":"#/components/parameters/headerAuthorizationUser"},{"$ref":"#/components/parameters/pathAppId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"userIds":{"type":"array","description":"User Ids to add to the whitelist.","items":{"type":"string"}},"emails":{"type":"array","description":"Emails to add to the whitelist.","items":{"type":"string"}},"usernames":{"type":"array","description":"Usernames to add to the whitelist.","items":{"type":"string"}}}}}}},"responses":{"200":{"description":"Returns the updated whitelist data for the app.","content":{"application/json":{"schema":{"type":"object","properties":{"enabled":{"type":"boolean"},"userIds":{"type":"array","items":{"type":"string"}},"emails":{"type":"array","items":{"type":"string"}},"usernames":{"type":"array","items":{"type":"string"}}}}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"}}}},"/v1/assets":{"get":{"operationId":"getAssets","summary":"Get assets","description":"Returns an array of assets that have been uploaded by the authorized user ordered by most recent creation.","tags":["Assets"],"parameters":[{"$ref":"#/components/parameters/headerAuthorizationUser"}],"responses":{"200":{"description":"Returns an array of asset objects.","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AssetModel"}}}}},"400":{"$ref":"#/components/responses/400"}}},"post":{"operationId":"createAsset","summary":"Create asset","description":"Create an asset object by uploading a file in base64. Returns an asset object.","tags":["Assets"],"parameters":[{"$ref":"#/components/parameters/headerAuthorizationUser"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"fileBase64":{"type":"string","format":"byte","description":"The base64 string of the asset being uploaded. Uploads may not exceed 5mb."}}}}}},"responses":{"200":{"description":"Returns a created asset object.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssetModel"}}}},"400":{"$ref":"#/components/responses/400"}}}},"/v1/assets/{assetId}":{"get":{"operationId":"getAsset","summary":"Get asset","description":"Return an asset object that has been uploaded by the authorized user for the provided assetId.","tags":["Assets"],"parameters":[{"$ref":"#/components/parameters/pathAssetId"},{"$ref":"#/components/parameters/headerAuthorizationUser"}],"responses":{"200":{"description":"Returns an asset object.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssetModel"}}}},"400":{"$ref":"#/components/responses/400"}}}},"/v1/contracts":{"get":{"operationId":"getOwnedContracts","summary":"Get owned contracts","description":"Returned an array of contracts owned by the authorized user.","tags":["Contracts"],"parameters":[{"$ref":"#/components/parameters/headerAuthorizationUser"}],"responses":{"200":{"description":"Returns an array of contracts owned by the authorized user.","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ContractModel"}}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"}}},"post":{"operationId":"createContract","summary":"Create contract","description":"Deploy a new contract from a template, or import an already deployed contract. Deploying or importing a contract through this endpoint will create a new contract object within the HYPLAY system. Once created, you can then programmatically interact with the contract gaslessly as a user, app or through a user's session. Use HYPLAY's create transaction and read contract endpoints for interactions.","tags":["Contracts"],"parameters":[{"$ref":"#/components/parameters/headerAuthorizationAppSecretOptional"},{"$ref":"#/components/parameters/headerAuthorizationUserOptional"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"chain":{"type":"string","description":"The chain to deploy or import a contract on.","enum":["HYCHAIN","HYCHAIN_TESTNET","LOCAL"]},"templateId":{"type":"string","description":"The template id to deploy a contract for. Templates have pre-defined ABIs and bytecode, allowing quick deployment of contracts one or multiple times."},"args":{"type":"array","description":"An array of constructor arguments required by the contract template being deployed from. Only required if deploying a contract from a template that requires constructor arguments.","items":{"type":"string"}},"salt":{"type":"string","description":"A salt value as a hex string, prefixed with 0x. Only required if deploying a contract from a template as a user."},"nonce":{"type":"string","description":"A nonce value as a hex string, prefixed with 0x. Only required if deploying a contract from a template as a user."},"signatures":{"type":"array","description":"An array of authority signatures to use for the contract deployment. Only required if deploying a contract from a template as a user. Provided signature(s) must be generated by the authority wallet of a user by signing a properly formatted \"create request\" object. See the hychain-crypto-js library on NPM for convenience methods in generating these signatures and create request objects if necessary.","items":{"type":"string"}},"deadline":{"type":"integer","description":"The deadline for the contract deployment execution. This can be set to a unix timestamp in the future. Typically set this to 24 hours in the future. Only required if deploying a contract from a template as a user."},"abi":{"type":"string","format":"json","description":"JSON string of the contract's ABI when importing an already deployed contract."},"address":{"type":"string","description":"The address of a contract being imported. Only required when importing an already deployed contract."},"name":{"type":"string","description":"The contract's name. Used to help distinguish contracts from one another. Optional for deploys and imports."},"description":{"type":"string","format":"html","description":"A description of the contract and what it does. This is helpful to set as a reminder for what a contract is used for. Optional for deploys and imports."},"metadata":{"type":"string","format":"json","description":"A JSON object of metadata as a string for the contract. This is an arbitrary JSON blob and is only intended for storing public data related to the contract for any use case."}},"required":["chain"]}}}},"responses":{"200":{"description":"Successfully deployed or imported a contract. Created a new contract object. Returns a contract object.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContractModel"}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"}}}},"/v1/contracts/{contractId}":{"get":{"operationId":"getContract","summary":"Get contract","description":"Returns a contract object for the provided contractId.","tags":["Contracts"],"parameters":[{"$ref":"#/components/parameters/pathContractId"}],"responses":{"200":{"description":"Returns a contract object.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContractModel"}}}},"400":{"$ref":"#/components/responses/400"}}},"patch":{"operationId":"updateContract","summary":"Update contract","description":"Updates a contract owned by the authorized user for the provided contractId.","tags":["Contracts"],"parameters":[{"$ref":"#/components/parameters/headerAuthorizationUser"},{"$ref":"#/components/parameters/pathContractId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"abi":{"type":"string","format":"json","description":"JSON string of the contract's ABI."},"name":{"type":"string","description":"The contract's name. Named contracts are easier for users to identify during app or game authorization flows through HYPLAY."},"description":{"type":"string","description":"A description of the contract and what it does."},"metadata":{"type":"string","format":"json","description":"A JSON string of arbitrary metadata for the contract. May be used by developers for a variety of reasons."}}}}}},"responses":{"200":{"description":"Returns the updated contract object.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContractModel"}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"}}}},"/v1/contracts/{contractIdOrAddress}/read":{"get":{"operationId":"readContract","summary":"Read contract","description":"Get the value from a read function of a target contract. This endpoint is designed to be highly flexible. It can read any contract by providing a contract address for `contractIdOrAddress`. It can also read using contracts created in the HYCHAIN systems through the `POST /v1/contracts` endpoint, which will utilize the contract's ABI.\n\nAdditionally, reads can be performed as a HYCHAIN app, user or user's session provided, through header authorization, or any arbitrary address or walletId provided through the `as` query parameter. Alternatively you can omit all of this and perform a read as no specific address.\n\nThe `func` query parameter accepts a complete function signature with parameters, such as `getCount()` or `readCounter(address,uint256)`, or a known function name without parameters if a contractId was provided for `contractIdOrAddress` and the contract's ABI is known. Such as `readCounter`.","tags":["Contracts"],"parameters":[{"$ref":"#/components/parameters/pathContractIdOrAddress"},{"$ref":"#/components/parameters/headerAuthorizationAppSecretOptional"},{"$ref":"#/components/parameters/headerAuthorizationSessionOptional"},{"$ref":"#/components/parameters/headerAuthorizationUserOptional"},{"$ref":"#/components/parameters/queryChain"},{"$ref":"#/components/parameters/queryFunc"},{"$ref":"#/components/parameters/queryArgs"},{"$ref":"#/components/parameters/queryAs"}],"responses":{"200":{"description":"Returns the result of the contract read as a string.","content":{"application/json":{"schema":{"type":"string"}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"}}}},"/v1/sessions":{"post":{"operationId":"startSession","summary":"Start session","description":"Starts a new session for the authorized user for an app. All prior sessions between the user and target app will become invalidated. Operates through an oauth 2.0-like flow, allowing a `code` or `token` response type. Also supports optional whitelisted access through the app whitelist system.\n\nWhen invoked directly by developers, this endpoint should only be used to start guest sessions. Guest sessions automatically create a HYPLAY user internally that bypasses the standard HYPLAY OAuth flow in order to automatically create a temporary HYPLAY account that can later be upgraded to a standard account if the user desires. When using guest sessions, you must NOT pass the X-Authorization parameter.","tags":["Apps"],"parameters":[{"$ref":"#/components/parameters/headerAuthorizationUserOptional"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"appId":{"type":"string","description":"The id of the app to start a session for."},"referrerId":{"type":"string","description":"The id of the user that referred the user to the app."},"scopes":{"type":"array","description":"The scopes requested for the session.","items":{"type":"string","enum":["email"]}},"nativeAllowance":{"type":"string","description":"The maximum sum of $TOPIA that may be transferred during this session, as a wei string.","example":502124124124},"contractFunctionSelectors":{"type":"array","description":"The contracts and function selectors approved for this session.","items":{"type":"object","properties":{"address":{"type":"string","description":"Target contract's address."},"functionSelectors":{"type":"array","description":"An array of function signatures or bytes4 function selectors to approve.","items":{"type":"string"}}}}},"erc20Allowances":{"type":"array","description":"The erc20 tokens and the maximum amount that may be transferred during this session.","items":{"type":"object","properties":{"address":{"type":"string","description":"Target erc20's contract address."},"allowance":{"type":"string","description":"The maximum sum of this erc20 token that may be transferred during this session, as a wei string."}}}},"erc721Allowances":{"type":"array","description":"The erc721 token ids that may be transferred during this session.","items":{"type":"object","properties":{"address":{"type":"string","description":"Target erc721's contract address."},"approveAll":{"type":"boolean","description":"If true, app is allowed through this session to transfer all tokens of the user without limits."},"tokenIds":{"type":"array","description":"The token ids this session is allowed to transfer during this session.","items":{"type":"string"}}}}},"erc1155Allowances":{"type":"array","description":"The erc1155 token ids and the maximum amount of each unique id that may be transferred during this session.","items":{"type":"object","properties":{"address":{"type":"string","description":"Target erc1155's contract address."},"approveAll":{"type":"boolean","description":"If true, app is allowed through this session to transfer any amount of all tokens of the user without limits."},"tokenIds":{"type":"array","description":"The maximum sum of the token ids this session is allowed to transfer during this session.","items":{"type":"string"}},"allowances":{"type":"array","description":"The token id allowances this session is allowed to interact or transfer during this session.","items":{"type":"string"}}}}},"chain":{"type":"string","description":"The chain the session is to be started for.","enum":["HYCHAIN","HYCHAIN_TESTNET","LOCAL"]},"isGuest":{"type":"boolean","description":"If the session should create a guest user. This allows applications to enable guest login. A guest HYPLAY user account with a managed authority wallet is created behind the scenes. The guest account can be later upgraded to a standard HYPLAY self-custodied account if desired by the user. If isGuest is set to true, `nonce`, `signatures`, `deadline` and `expiresAt` should not be provided."},"nonce":{"type":"string","description":"A positive arbitrary integer as a string to be used as this session's nonce. Nonces are a one-time use per user. For example, User A and User B can both individually use nonce \"1\", but nonce \"1\", cannot be used again in the future for User A or User B to start a different session.","example":1},"signatures":{"type":"array","description":"An array of 1 or more session start signatures, generated by the authority(s) of a user's smart contract account. These signatures are most easily generated using the `hychain-crypto-js` npm package's `generateSessionSignature()`.","items":{"type":"string"}},"deadline":{"type":"number","description":"A timestamp in seconds of when the signature(s) for the session authorization request expire. If the deadline has been passed, attempting to start a session will fail."},"expiresAt":{"type":"number","description":"A timestamp in seconds when the session is to expire."},"responseType":{"type":"string","description":"The response type for session auth flows. If `code` is used, an accessToken will not be included, and a `exchangeCode` property will be included in the response object. This `exchangeCode` must then be exchanged using both the app's secret + exchange code to acquire the session access token. Alternatively, `token` can be used which returns a populated `accessToken` property in the response. This is less secure and essentially identical in usage for Oauth 2.0's implicit auth flow.","enum":["code","token"]}},"required":["appId","chain","responseType"]}}}},"responses":{"200":{"description":"Successfully started a new session. Returns a session object.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AppModel"}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"}}},"delete":{"operationId":"endSession","summary":"End session","description":"Ends all active sessions for a given user. This endpoint is flexible and can end sessions in a number of ways. An app can end any user's sessions of their app directly, or a user can end their own sessions for an app, or a session access token can be used to end its associated session.","tags":["Apps"],"parameters":[{"$ref":"#/components/parameters/headerAuthorizationUserOptional"},{"$ref":"#/components/parameters/headerAuthorizationSessionOptional"},{"$ref":"#/components/parameters/headerAuthorizationAppSecretOptional"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"appId":{"type":"string","description":"If the `X-App-Authorization` or `X-Session-Authorization` header is not set, `appId` must be provided to indicate the application for which to end user sessions for."},"userId":{"type":"string","description":"If the user's `X-Authorization` or `X-Session-Authorization` header is not set, `userId` must be provided to indicate the user for which to end sessions for."},"chain":{"type":"string","description":"The chain to end sessions for.","enum":["HYCHAIN","HYCHAIN_TESTNET","LOCAL"]}},"required":["chain"]}}}},"responses":{"204":{"description":"Returns an empty response indicating the session has been ended."},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"}}}},"/v1/sessions/token":{"post":{"operationId":"grantSessionToken","summary":"Grant session token","description":"Returns a session object with a valid access token when the associated exchangeCode and application authorized by using its secret key is provided.","tags":["Apps"],"parameters":[{"$ref":"#/components/parameters/headerAuthorizationAppSecret"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"exchangeCode":{"type":"string","description":"An unused exchange code associated with the provided session id. Exchange codes can only be used once and then become invalid."}},"required":["exchangeCode"]}}}},"responses":{"200":{"description":"Returns an updated session object with an `accessToken` set.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SessionModel"}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"}}}},"/v1/templates":{"get":{"operationId":"getTemplates","summary":"Get templates","description":"Returns an array of templates. Templates can be used to quickly deploy contracts to HYCHAIN and HYCHAIN_TESTNET. Templates can also be reviewed and approved by the HYPLAY team to be made available for anyone to deploy. Templates that are not approved can be deployed by anyone to HYCHAIN_TESTNET, and only deployed by the creator to HYCHAIN mainnet.","tags":["Contracts"],"parameters":[{"$ref":"#/components/parameters/queryUserId"},{"$ref":"#/components/parameters/queryTemplateName"},{"$ref":"#/components/parameters/queryTemplateApproved"}],"responses":{"200":{"description":"Returns an array of template objects.","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/TemplateModel"}}}}},"400":{"$ref":"#/components/responses/400"}}},"post":{"operationId":"createTemplate","summary":"Create template","description":"Creates a new template. Templates can be used to quickly deploy pre-approved types of contracts to HYCHAIN and HYCHAIN_TESTNET.","tags":["Contracts"],"parameters":[{"$ref":"#/components/parameters/headerAuthorizationUser"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the template."},"description":{"type":"string","format":"html","description":"A description of the template."},"solidity":{"type":"string","format":"html","description":"The solidity source code of the template to compile. This must be a flattened contract with all imports inlined."},"target":{"type":"string","description":"The contract from the inlined solidity source code that is intended to be deployed for this template.","example":"MyErc20Contract"}},"required":["name","solidity","target"]}}}},"responses":{"200":{"description":"Returns the created template object.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TemplateModel"}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"}}}},"/v1/templates/{templateId}":{"get":{"operationId":"getTemplate","summary":"Get template","description":"Returns a template object with abi, bytecode and compilation errors or warnings included.","tags":["Contracts"],"parameters":[{"$ref":"#/components/parameters/pathTemplateId"}],"responses":{"200":{"description":"Returns a template object.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TemplateModel"}}}},"400":{"$ref":"#/components/responses/400"}}}},"/v1/transactions":{"get":{"operationId":"getTransactions","summary":"Get transactions","description":"Returns an array of transactions for the provided appId, sessionId, userId or walletId. Transactions are returned in descending order of creation date.","tags":["Transactions"],"parameters":[{"$ref":"#/components/parameters/queryAppId"},{"$ref":"#/components/parameters/querySessionId"},{"$ref":"#/components/parameters/queryUserId"},{"$ref":"#/components/parameters/queryWalletId"},{"$ref":"#/components/parameters/queryChain"}],"responses":{"200":{"description":"Returns an array of transaction objects.","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/TransactionModel"}}}}},"400":{"$ref":"#/components/responses/400"}}},"post":{"operationId":"createTransaction","summary":"Create transaction","description":"Create and submit a transaction to the target contract id or address. Transactions are submitted on behalf of the authorization type used, such as an app, user or user via a user's session.\n\nTransaction submission supports contract function invocation and native transfers to contracts or externally owned accounts (EOAs).\n\nThis endpoint is designed to be highly flexible. Please refer to the HYCHAIN guides and documentation for detailed examples of the many ways this endpoint can be used.","tags":["Transactions"],"parameters":[{"$ref":"#/components/parameters/headerAuthorizationAppSecretOptional"},{"$ref":"#/components/parameters/headerAuthorizationSessionOptional"},{"$ref":"#/components/parameters/headerAuthorizationUserOptional"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"contractId":{"type":"string","description":"The contract id to target."},"address":{"type":"string","description":"The address to target."},"func":{"type":"string","description":"The function name or function signature of the contract."},"args":{"type":"array","description":"An array of arguments to pass to the function.","items":{"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}]}},"value":{"type":"number","description":"The amount of native token to send with the transaction."},"nonce":{"type":"string","description":"The nonce of the transaction."},"deadline":{"type":"number","description":"The deadline for the transaction as a timestamp in seconds."},"signatures":{"type":"array","description":"An array of signatures for the transaction.","items":{"type":"string"}},"chain":{"type":"string","description":"The chain the session is to be started for.","enum":["HYCHAIN","HYCHAIN_TESTNET","LOCAL"]}}}}}},"responses":{"200":{"description":"Returns a transaction object.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TransactionModel"}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"}}}},"/v1/transactions/{transactionId}":{"get":{"operationId":"getTransaction","summary":"Get transaction","description":"Returns a transaction object for the provided transactionId.","tags":["Transactions"],"parameters":[{"$ref":"#/components/parameters/pathTransactionId"}],"responses":{"200":{"description":"Returns a transaction object.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TransactionModel"}}}},"400":{"$ref":"#/components/responses/400"}}}},"/v1/users":{"get":{"operationId":"getUser","summary":"Get user","description":"Returns a public user object when provided a user id, username or wallet address.","tags":["Users"],"parameters":[{"$ref":"#/components/parameters/queryUserId"},{"$ref":"#/components/parameters/queryUsername"},{"$ref":"#/components/parameters/queryWalletAddress"}],"responses":{"200":{"description":"Returns a public user object.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/UserModel"},{"type":"object","properties":{"preregistered":{"type":"boolean"}}},{"type":"object","properties":{"wallet":{"$ref":"#/components/schemas/WalletModel"}}}]}}}},"400":{"$ref":"#/components/responses/400"}}},"post":{"x-visibility":"private","operationId":"createUser","summary":"Create user","description":"Creates a new user using a provided username and password. A user must have an authority wallet assigned before it can be used for transactions or authorize sessions.","tags":["Users"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"username":{"type":"string","minLength":4,"description":"The users desired username."},"email":{"type":"string","format":"email","description":"An email address to associate with the user for account recovery."},"shaPassword":{"type":"string","minLength":64,"maxLength":64,"format":"password","description":"A sha256 hash of the users plaintext password.","example":"07ecafaf8304b8a12016ad05fd498e2ab338c1bcac31cb3f002386ef4ea917ad"}},"required":["username","shaPassword"]}}}},"responses":{"200":{"description":"Successfully created a new user. Returns a user object. Before the users can start session or perform transactions, their authority wallet must first be set using the PATCH /v1/users endpoint.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserModel"}}}},"400":{"$ref":"#/components/responses/400"}}},"patch":{"x-visibility":"private","operationId":"updateCurrentUser","summary":"Update current user","description":"Update various fields specific to the current user.","tags":["Users"],"parameters":[{"$ref":"#/components/parameters/headerAuthorizationUser"},{"$ref":"#/components/parameters/headerAuthorizationNonce"},{"$ref":"#/components/parameters/headerAuthorizationNonceSignature"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","format":"email","description":"A valid, unique email address that is not currently assigned to another account."},"authorityAddress":{"type":"string","description":"The wallet address associated with the private key used to generate the authorityProofSignature. This should be generated by the `hytopia-crypto-js` library. 1-time assignment, intended for setting of newly registered accounts."},"authorityCiphertext":{"type":"string","description":"The encrypted ciphertext of the private key associated with the provided authorityAddress. This should be generated by the `hytopia-crypto-js` library. 1-time assignment, intended for setting of newly registered accounts."},"authorityBackupCiphertexts":{"type":"string","description":"A ciphertext from encrypting a players authority private key with an arbitrary backup code generated and store on their client."},"authorityBackupQuestionsCiphertext":{"type":"string","description":"A ciphertext from encrypting a players authority private key with the concatenanted answers to their recovery questions."},"authorityProofSignature":{"type":"string","description":"The proof signature required for deferred smart contract account creation. This should be generated by the `hytopia-crypto-js` library. 1-time assignment, intended for setting of newly registered accounts."},"salt":{"type":"string","description":"An arbitrary salt used by the player's client along with their client-side provided password to derive a PBKDF2 key for decrypting their authority wallet's private key. 1-time assignment, intended for setting of preregistration accounts."},"backupQuestions":{"type":"array","description":"An array of any arbitrary questions to display to the user when going through account recovery.","items":{"type":"string"}},"isChild":{"type":"boolean","description":"A true or false value indicating if a child is younger than 13 (true), or older (false)."},"shaPassword":{"type":"string","description":"A sha256 hash of the users new password. Cannot be set for users who joined using an SSO option such as Discord, Twitter, Facebook, etc. Authority wallet credentials should be re-encrypted using the new plaintext password on the client side as well, with the new ciphertext being provided with the password update to prevent divergence between a users account password and wallet decryption password."},"resetAccessToken":{"type":"boolean","description":"Revokes the user's current access token and returns a new one if true."}}}}}},"responses":{"200":{"description":"Returns the updated user object.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserModel"}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"}}}},"/v1/users/auth":{"get":{"x-visibility":"private","operationId":"authUser","summary":"Authenticate user","description":"Authenticates a user for the provided email/username and shaPassword, or creates or retrieves a user for the provided sso auth code. Return a user object containing an access token.\nIf a user is preregistered or has not completed their account setup such as assigning their authority wallet or setting their password, as long as they have had an email assigned to their account, a one-time password can be emailed to the user. This can be done by using the basic auth flow and omitting the password field or passing an empty string for the password.\nYou can then auth the user by providing the sha256(one time password) equivalent as the password for this auth endpoint.","tags":["Users"],"parameters":[{"$ref":"#/components/parameters/queryAccessTokenExpiresAt"},{"$ref":"#/components/parameters/queryResetAccessToken"},{"$ref":"#/components/parameters/queryAppleAuthCode"},{"$ref":"#/components/parameters/queryAppleRedirectOverride"},{"$ref":"#/components/parameters/queryDiscordAuthCode"},{"$ref":"#/components/parameters/queryDiscordRedirectOverride"},{"$ref":"#/components/parameters/queryFacebookAuthCode"},{"$ref":"#/components/parameters/queryFacebookRedirectOverride"},{"$ref":"#/components/parameters/queryGoogleAuthCode"},{"$ref":"#/components/parameters/queryGoogleRedirectOverride"},{"$ref":"#/components/parameters/queryTwitterAuthCode"},{"$ref":"#/components/parameters/queryTwitterRedirectOverride"}],"security":[{"basicAuth":[]},{}],"responses":{"200":{"description":"Successfully authorized the user and returns a user object.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/UserModel"},{"type":"object","properties":{"socialKeyMaterial":{"type":"string"},"wallet":{"$ref":"#/components/schemas/WalletModel"}}}]}}}},"204":{"description":"Successfully emailed a one-time password to a preregistered user."},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"}}}},"/v1/users/me":{"get":{"operationId":"getCurrentUser","summary":"Get current user","description":"Returns a public user object associated with the provided session access token.","tags":["Users"],"parameters":[{"$ref":"#/components/parameters/headerAuthorizationSession"}],"responses":{"200":{"description":"Returns a public user object.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/UserModel"},{"type":"object","properties":{"wallet":{"$ref":"#/components/schemas/WalletModel"}}}]}}}},"400":{"$ref":"#/components/responses/400"}}}},"/v1/wallets/{walletIdOrAddress}":{"get":{"operationId":"getWallet","summary":"Get wallet","description":"Returns a wallet object for the provided walletIdOrAddress. If walletIdOrAddress is a HYCHAIN system wallet id, it will return a matching wallet for the id. If walletIdOrAddress is a on chain smart contract wallet address, it will return a matching wallet from the HYCHAIN system. If a wallet is not found in HYCHAIN's systems for the address or walletId provided, a 400 error will be returned.","tags":["Wallets"],"parameters":[{"$ref":"#/components/parameters/pathWalletIdOrAddress"}],"responses":{"200":{"description":"Returns a wallet object.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/WalletModel"},{"type":"object","properties":{"mainnetRequiresUpgradeTo":{"type":"string","description":"The mainnet wallet implementation address to upgrade to if the wallet requires an upgrade, otherwise null if no upgrade required."},"testnetRequiresUpgradeTo":{"type":"string","description":"The testnet wallet implementation address to upgrade to if the wallet requires an upgrade, otherwise null if no upgrade required."},"localRequiresUpgradeTo":{"type":"string","description":"The local wallet implementation address to upgrade to if the wallet requires an upgrade, otherwise null if no upgrade required."}}}]}}}},"400":{"$ref":"#/components/responses/400"}}},"patch":{"operationId":"updateWallet","summary":"Update wallet","description":"Update various fields specific to a wallet. This endpoint is currently used for optining in to upgrade a user or application smart contract wallet to the latest implementation if necessary.","tags":["Wallets"],"parameters":[{"$ref":"#/components/parameters/pathWalletIdOrAddress"},{"$ref":"#/components/parameters/headerAuthorizationUser"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"chain":{"type":"string","description":"The chain to deploy or import a contract on.","enum":["HYCHAIN","HYCHAIN_TESTNET","LOCAL"]},"deadline":{"type":"number","description":"The deadline for the transaction as a timestamp in seconds."},"upgradeToLatest":{"type":"boolean","description":"If true, the wallet will be upgraded to the latest available wallet implementation for the provided chain."},"signatures":{"type":"array","description":"An array of signatures to authorize the upgrade.","items":{"type":"string"}}}}}}},"responses":{"200":{"description":"Returns a transaction object.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TransactionModel"}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"}}}},"/v1/wallets/{walletIdOrAddress}/balance":{"get":{"operationId":"getWalletBalance","summary":"Get wallet balance","description":"Returns the native token balance for the smart contract wallet associated with a wallet id provided for walletIdOrAddress. Or, if any address is provided for walletIdOrAddress, it will return the native token balance for the address.","tags":["Wallets"],"parameters":[{"$ref":"#/components/parameters/pathWalletIdOrAddress"},{"$ref":"#/components/parameters/queryChain"}],"responses":{"200":{"description":"Returns the native token balance for the wallet in readable string format. For example a 1e18 balance would be '1.0'.","content":{"application/json":{"schema":{"type":"string"}}}},"400":{"$ref":"#/components/responses/400"}}}}}} \ No newline at end of file diff --git a/spec.json b/spec.json index d7f58a7..1bb9899 100644 --- a/spec.json +++ b/spec.json @@ -1 +1 @@ -{"openapi":"3.0.0","info":{"title":"HYPLAY API","version":"1.0.0","description":"HYPLAY API Specification","termsOfService":"https://hyplay.com","contact":{"name":"HYCHAIN Team","email":"braydon@hytopia.com","url":"https://hychain.com"}},"servers":[{"description":"HYPLAY API Server","url":"https://api.hyplay.com"},{"description":"HYPLAY API Staging Server","url":"https://staging-api.hyplay.com"},{"description":"Local Development Server","url":"http://localhost:8001"}],"components":{"parameters":{"headerAuthorizationUser":{"name":"x-authorization","in":"header","description":"The `accessToken` of the authenticating user.","example":"user_at_02z4Mv3c85Ig0gNowY9Dq0N2kjb1xwzr27ArLE0669RrRI6dLf822iPO26K1p1FP","required":true,"schema":{"type":"string"}},"headerAuthorizationUserOptional":{"name":"x-authorization","in":"header","description":"The `accessToken` of the authenticating user.","example":"user_at_02z4Mv3c85Ig0gNowY9Dq0N2kjb1xwzr27ArLE0669RrRI6dLf822iPO26K1p1FP","required":false,"schema":{"type":"string"}},"headerAuthorizationAppSecret":{"name":"x-app-authorization","in":"header","description":"The `secretKey` or `testSecretKey` of the authenticating app.","example":"test_app_sk_pBEHOVTIZjQFT6WpiQLT8c_VFfd6Vb2XHj_9IIV8-Zi06SdMIruJxIe2QMaca_X6","required":true,"schema":{"type":"string"}},"headerAuthorizationAppSecretOptional":{"name":"x-app-authorization","in":"header","description":"The `secretKey` or `testSecretKey` of the authenticating app.","example":"test_app_sk_pBEHOVTIZjQFT6WpiQLT8c_VFfd6Vb2XHj_9IIV8-Zi06SdMIruJxIe2QMaca_X6","required":false,"schema":{"type":"string"}},"headerAuthorizationSession":{"name":"x-session-authorization","in":"header","description":"The `accessToken` of the authenticating session.","example":"sca_sat_pBEHOVTIZjQFT6WpiQLT8c_VFfd6Vb2XHj_9IIV8-Zi06SdMIruJxIe2QMaca_X6","required":true,"schema":{"type":"string"}},"headerAuthorizationSessionOptional":{"name":"x-session-authorization","in":"header","description":"The `accessToken` of the authenticating session.","example":"sca_sat_pBEHOVTIZjQFT6WpiQLT8c_VFfd6Vb2XHj_9IIV8-Zi06SdMIruJxIe2QMaca_X6","required":false,"schema":{"type":"string"}},"headerAuthorizationNonce":{"name":"x-nonce","in":"header","description":"The nonce of the authenticating user.","required":true,"schema":{"type":"string"}},"headerAuthorizationNonceSignature":{"name":"x-nonce-signature","in":"header","description":"The nonce signature of the authenticating user.","required":true,"schema":{"type":"string"}},"pathAppId":{"name":"appId","in":"path","description":"An application id.","required":true,"schema":{"type":"string"}},"pathAssetId":{"name":"assetId","in":"path","description":"An asset id.","required":true,"schema":{"type":"string"}},"pathContractId":{"name":"contractId","in":"path","description":"A contract id.","required":true,"schema":{"type":"string"}},"pathContractIdOrAddress":{"name":"contractIdOrAddress","in":"path","description":"A contract id or address.","required":true,"schema":{"type":"string"}},"pathLeaderboardId":{"name":"leaderboardId","in":"path","description":"A leaderboard id.","required":true,"schema":{"type":"string"}},"pathSessionId":{"name":"sessionId","in":"path","description":"A session id.","required":true,"schema":{"type":"string"}},"pathTemplateId":{"name":"templateId","in":"path","description":"A template id.","required":true,"schema":{"type":"string"}},"pathTransactionId":{"name":"transactionId","in":"path","description":"A transaction id.","required":true,"schema":{"type":"string"}},"pathUserId":{"name":"userId","in":"path","description":"A user id.","required":true,"schema":{"type":"string"}},"pathWalletIdOrAddress":{"name":"walletIdOrAddress","in":"path","description":"A wallet id or address.","required":true,"schema":{"type":"string"}},"queryAccessTokenExpiresAt":{"name":"accessTokenExpiresAt","in":"query","description":"An optional unix timestamp in seconds specifying when the returned `accessToken` should expire. If this value is provided, all prior `accessToken` will be invalidated and a new `accessToken` will be issued in the response. If no value is provided, the returned `accessToken` will not expire unless it is invalidated.","example":1677197460,"required":false,"schema":{"type":"number"}},"queryAppleAuthCode":{"name":"appleAuthCode","in":"query","description":"A Apple OAuth 2.0 code.","required":false,"schema":{"type":"string"}},"queryAppleRedirectOverride":{"name":"appleRedirectOverride","in":"query","description":"An redirect url for apple auth.","required":false,"schema":{"type":"string"}},"queryAppId":{"name":"appId","in":"query","description":"An application id.","required":false,"schema":{"type":"string"}},"queryArgs":{"name":"args","in":"query","description":"An array of arguments.","required":false,"schema":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}]}}},"queryAs":{"name":"as","in":"query","description":"An address or walletId to perform as.","required":false,"schema":{"type":"string"}},"queryChain":{"name":"chain","in":"query","description":"A chain name.","required":false,"schema":{"type":"string","enum":["HYCHAIN","HYCHAIN_TESTNET","LOCAL"]}},"queryCursor":{"name":"cursor","in":"query","description":"An id from the record type to start the pagination of the next results, excluding the provided record id.","required":false,"schema":{"type":"string"}},"queryFunc":{"name":"func","in":"query","description":"A function name or function signature.","required":true,"schema":{"type":"string"}},"queryDiscordAuthCode":{"name":"discordAuthCode","in":"query","description":"A Discord OAuth 2.0 code.","required":false,"schema":{"type":"string"}},"queryDiscordRedirectOverride":{"name":"discordRedirectOverride","in":"query","description":"An redirect url for discord auth.","required":false,"schema":{"type":"string"}},"queryFacebookAuthCode":{"name":"facebookAuthCode","in":"query","description":"A Facebook OAuth 2.0 code.","required":false,"schema":{"type":"string"}},"queryFacebookRedirectOverride":{"name":"facebookRedirectOverride","in":"query","description":"An redirect url for facebook auth.","required":false,"schema":{"type":"string"}},"queryGoogleAuthCode":{"name":"googleAuthCode","in":"query","description":"A Google OAuth 2.0 code.","required":false,"schema":{"type":"string"}},"queryGoogleRedirectOverride":{"name":"googleRedirectOverride","in":"query","description":"An redirect url for google auth.","required":false,"schema":{"type":"string"}},"queryTwitterAuthCode":{"name":"twitterAuthCode","in":"query","description":"A Twitter OAuth 2.0 code.","required":false,"schema":{"type":"string"}},"queryTwitterRedirectOverride":{"name":"twitterRedirectOverride","in":"query","description":"An redirect url for twitter auth.","required":false,"schema":{"type":"string"}},"queryTemplateApproved":{"name":"approved","in":"query","description":"Set this query parameter to `true` to filter for approved templates.","example":"true","required":false,"schema":{"type":"string"}},"queryTemplateName":{"name":"name","in":"query","description":"A template name to partially or exactly match.","example":"token","required":false,"schema":{"type":"string"}},"queryLimit":{"name":"limit","in":"query","description":"The maximum number of items to return.","example":25,"required":false,"schema":{"type":"number"}},"queryOffset":{"name":"offset","in":"query","description":"The offset of the first item to return.","example":0,"required":false,"schema":{"type":"number"}},"queryResetAccessToken":{"name":"resetAccessToken","in":"query","description":"Set this query parameter to `true` to reset accessToken and authorityKey.","example":"true","required":false,"schema":{"type":"string"}},"queryRecaptchaToken":{"name":"hcaptchaResponse","in":"query","description":"A hCaptcha token generated client-side by completion of a user-facing hCaptcha request.","required":true,"schema":{"type":"string"}},"querySessionId":{"name":"sessionId","in":"query","description":"A session id.","required":false,"schema":{"type":"string"}},"querySort":{"name":"sort","in":"query","description":"A sort order.","required":false,"schema":{"type":"string"}},"queryUsername":{"name":"username","in":"query","description":"A user username.","example":"arkdev","required":false,"schema":{"type":"string"}},"queryUserId":{"name":"userId","in":"query","description":"A user id.","required":false,"schema":{"type":"string"}},"queryWalletAddress":{"name":"walletAddress","in":"query","description":"A wallet address.","required":false,"schema":{"type":"string"}},"queryWalletId":{"name":"walletId","in":"query","description":"A wallet id.","required":false,"schema":{"type":"string"}},"queryStateKey":{"name":"key","in":"query","description":"A string identifier unique to an app for looking up state data.","required":false,"schema":{"type":"string"}}},"responses":{"400":{"description":"An API level error occurred. This is often due to problematic data being provided by you.","content":{"application/json":{"schema":{"type":"string"}}}},"401":{"description":"An authorization error occured. This is often due to incorrect tokens or keys being provided, or accessing a resource that the provided tokens or keys do not have access to.","content":{"application/json":{"schema":{"type":"string"}}}}},"schemas":{"AppModel":{"type":"object","properties":{"id":{"type":"string","description":"This field has not had a description added."},"userId":{"type":"string","description":"This field has not had a description added."},"walletId":{"type":"string","description":"This field has not had a description added."},"iconImageAssetId":{"type":"string","description":"This field has not had a description added."},"backgroundImageAssetId":{"type":"string","description":"This field has not had a description added."},"logoImageAssetId":{"type":"string","description":"This field has not had a description added."},"galleryMediaAssetIds":{"type":"object","description":"This field has not had a description added."},"secretKey":{"type":"string","description":"This field has not had a description added."},"testSecretKey":{"type":"string","description":"This field has not had a description added."},"name":{"type":"string","description":"This field has not had a description added."},"description":{"type":"string","description":"This field has not had a description added."},"url":{"type":"string","description":"This field has not had a description added."},"discordUrl":{"type":"string","description":"This field has not had a description added."},"twitterUrl":{"type":"string","description":"This field has not had a description added."},"steamUrl":{"type":"string","description":"This field has not had a description added."},"appleIosUrl":{"type":"string","description":"This field has not had a description added."},"appleMacUrl":{"type":"string","description":"This field has not had a description added."},"googlePlayUrl":{"type":"string","description":"This field has not had a description added."},"microsoftUrl":{"type":"string","description":"This field has not had a description added."},"privacyUrl":{"type":"string","description":"This field has not had a description added."},"termsUrl":{"type":"string","description":"This field has not had a description added."},"redirectUris":{"type":"object","description":"This field has not had a description added."},"verificationStatus":{"type":"string","description":"This field has not had a description added."},"updatedAt":{"type":"string","description":"This field has not had a description added."},"createdAt":{"type":"string","description":"This field has not had a description added."}}},"AppReferralsModel":{"type":"object","properties":{"id":{"type":"string","description":"This field has not had a description added."},"appId":{"type":"string","description":"This field has not had a description added."},"referredUserId":{"type":"string","description":"This field has not had a description added."},"referrerUserId":{"type":"string","description":"This field has not had a description added."},"updatedAt":{"type":"string","description":"This field has not had a description added."},"createdAt":{"type":"string","description":"This field has not had a description added."}}},"AppTeammateModel":{"type":"object","properties":{"id":{"type":"string","description":"This field has not had a description added."},"appId":{"type":"string","description":"This field has not had a description added."},"userId":{"type":"string","description":"This field has not had a description added."},"role":{"type":"string","description":"This field has not had a description added."},"updatedAt":{"type":"string","description":"This field has not had a description added."},"createdAt":{"type":"string","description":"This field has not had a description added."}}},"AssetModel":{"type":"object","properties":{"id":{"type":"string","description":"This field has not had a description added."},"userId":{"type":"string","description":"This field has not had a description added."},"s3Url":{"type":"string","description":"This field has not had a description added."},"cdnUrl":{"type":"string","description":"This field has not had a description added."},"mime":{"type":"string","description":"This field has not had a description added."},"extension":{"type":"string","description":"This field has not had a description added."},"checksum":{"type":"string","description":"This field has not had a description added."},"size":{"type":"integer","description":"This field has not had a description added."},"updatedAt":{"type":"string","description":"This field has not had a description added."},"createdAt":{"type":"string","description":"This field has not had a description added."}}},"ContractModel":{"type":"object","properties":{"id":{"type":"string","description":"This field has not had a description added."},"appId":{"type":"string","description":"This field has not had a description added."},"userId":{"type":"string","description":"This field has not had a description added."},"templateId":{"type":"string","description":"This field has not had a description added."},"chain":{"type":"string","description":"This field has not had a description added."},"abi":{"type":"object","description":"This field has not had a description added."},"address":{"type":"string","description":"This field has not had a description added."},"name":{"type":"string","description":"This field has not had a description added."},"description":{"type":"string","description":"This field has not had a description added."},"metadata":{"type":"object","description":"This field has not had a description added."},"updatedAt":{"type":"string","description":"This field has not had a description added."},"createdAt":{"type":"string","description":"This field has not had a description added."}}},"NonceModel":{"type":"object","properties":{"id":{"type":"string","description":"This field has not had a description added."},"walletId":{"type":"string","description":"This field has not had a description added."},"nonce":{"type":"string","description":"This field has not had a description added."},"createdAt":{"type":"string","description":"This field has not had a description added."}}},"SessionModel":{"type":"object","properties":{"id":{"type":"string","description":"This field has not had a description added."},"appId":{"type":"string","description":"This field has not had a description added."},"userId":{"type":"string","description":"This field has not had a description added."},"chain":{"type":"string","description":"This field has not had a description added."},"accessToken":{"type":"string","description":"This field has not had a description added."},"exchangeCode":{"type":"string","description":"This field has not had a description added."},"scopes":{"type":"object","description":"This field has not had a description added."},"contractFunctionSelectors":{"type":"object","description":"This field has not had a description added."},"nativeAllowance":{"type":"string","description":"This field has not had a description added."},"erc20Allowances":{"type":"object","description":"This field has not had a description added."},"erc721Allowances":{"type":"object","description":"This field has not had a description added."},"erc1155Allowances":{"type":"object","description":"This field has not had a description added."},"nonce":{"type":"string","description":"This field has not had a description added."},"signatures":{"type":"object","description":"This field has not had a description added."},"deadline":{"type":"string","description":"This field has not had a description added."},"expiresAt":{"type":"string","description":"This field has not had a description added."},"endedAt":{"type":"string","description":"This field has not had a description added."},"updatedAt":{"type":"string","description":"This field has not had a description added."},"createdAt":{"type":"string","description":"This field has not had a description added."}}},"TemplateModel":{"type":"object","properties":{"id":{"type":"string","description":"This field has not had a description added."},"userId":{"type":"string","description":"This field has not had a description added."},"name":{"type":"string","description":"This field has not had a description added."},"description":{"type":"string","description":"This field has not had a description added."},"solidity":{"type":"string","description":"This field has not had a description added."},"target":{"type":"string","description":"This field has not had a description added."},"bytecode":{"type":"string","description":"This field has not had a description added."},"abi":{"type":"object","description":"This field has not had a description added."},"errors":{"type":"object","description":"This field has not had a description added."},"approved":{"type":"boolean","description":"This field has not had a description added."},"updatedAt":{"type":"string","description":"This field has not had a description added."},"createdAt":{"type":"string","description":"This field has not had a description added."}}},"TransactionModel":{"type":"object","properties":{"id":{"type":"string","description":"This field has not had a description added."},"walletId":{"type":"string","description":"This field has not had a description added."},"sessionId":{"type":"string","description":"This field has not had a description added."},"chain":{"type":"string","description":"This field has not had a description added."},"relayerAddress":{"type":"string","description":"This field has not had a description added."},"func":{"type":"string","description":"This field has not had a description added."},"args":{"type":"object","description":"This field has not had a description added."},"value":{"type":"string","description":"This field has not had a description added."},"hash":{"type":"string","description":"This field has not had a description added."},"createdAt":{"type":"string","description":"This field has not had a description added."}}},"UserModel":{"type":"object","properties":{"id":{"type":"string","description":"This field has not had a description added."},"walletId":{"type":"string","description":"This field has not had a description added."},"username":{"type":"string","description":"This field has not had a description added."},"email":{"type":"string","description":"This field has not had a description added."},"phone":{"type":"string","description":"This field has not had a description added."},"appleId":{"type":"string","description":"This field has not had a description added."},"discordId":{"type":"string","description":"This field has not had a description added."},"facebookId":{"type":"string","description":"This field has not had a description added."},"googleId":{"type":"string","description":"This field has not had a description added."},"microsoftId":{"type":"string","description":"This field has not had a description added."},"twitterId":{"type":"string","description":"This field has not had a description added."},"accessToken":{"type":"string","description":"This field has not had a description added."},"isChild":{"type":"boolean","description":"This field has not had a description added."},"accessTokenExpiresAt":{"type":"string","description":"This field has not had a description added."},"updatedAt":{"type":"string","description":"This field has not had a description added."},"createdAt":{"type":"string","description":"This field has not had a description added."}}},"WalletModel":{"type":"object","properties":{"id":{"type":"string","description":"This field has not had a description added."},"type":{"type":"string","description":"This field has not had a description added."},"address":{"type":"string","description":"This field has not had a description added."},"authorityCiphertext":{"type":"string","description":"This field has not had a description added."},"authorityBackupCiphertexts":{"type":"object","description":"This field has not had a description added."},"authorityProofSignature":{"type":"string","description":"This field has not had a description added."},"backupQuestions":{"type":"object","description":"This field has not had a description added."},"updatedAt":{"type":"string","description":"This field has not had a description added."},"createdAt":{"type":"string","description":"This field has not had a description added."}}},"AnyValue":{"description":"Can be anything. String, number, object, array, boolean, etc."}},"securitySchemes":{"basicAuth":{"type":"http","scheme":"basic","description":"Basic authentication must be send in the format of usernameOrEmail:shaPassword, where usernameOrEmail can be the username or email associated with an account, andshaPassword is a sha256 hash of the users provided plaintext password."}}},"tags":[{"name":"Users","description":"User related operations"}],"paths":{"/v1/apps":{"get":{"operationId":"getApps","summary":"Get apps","description":"Returns an array of apps owned by, or a teammate of, for the authorized user, or up to 25 public apps across HYPLAY if no authorization is provided. Supports pagination for public apps when no user authorization is provided - a `cursor` query parameter can be provided for paginating results based on last result set id.","tags":["Apps"],"parameters":[{"$ref":"#/components/parameters/headerAuthorizationUserOptional"},{"$ref":"#/components/parameters/queryCursor"}],"responses":{"200":{"description":"Returns an array of apps owned by the authorized user or public apps across HYPLAY if no authorization is provided.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/AppModel"},{"type":"object","properties":{"iconImageAsset":{"$ref":"#/components/schemas/AssetModel"},"backgroundImageAsset":{"$ref":"#/components/schemas/AssetModel"},"logoImageAsset":{"$ref":"#/components/schemas/AssetModel"},"wallet":{"$ref":"#/components/schemas/WalletModel"}}}]}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"}}},"post":{"operationId":"createApp","summary":"Create app","description":"Create a new app for the authorized user.","tags":["Apps"],"parameters":[{"$ref":"#/components/parameters/headerAuthorizationUser"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"iconImageAssetId":{"type":"string","description":"The assetId of the icon image. Icon images are recommended to be a 1:1 aspect ratio and at least 512x512 pixels."},"backgroundImageAssetId":{"type":"string","description":"The assetId of the background image. Background images are recommended to be a 16:9 aspect ratio and at least 1920x1080 pixels."},"logoImageAssetId":{"type":"string","description":"The assetId of the logo image. Logo image are used on pages like preregistration, questing, etc and can be any aspect ratio."},"galleryMediaAssetIds":{"type":"array","description":"An array of assetIds for media assets to be displayed for app promotional purposes. Such as the web page media gallery.","items":{"type":"string"}},"name":{"type":"string","description":"The name of the app."},"description":{"type":"string","format":"html","description":"A brief description of the app and what it is and does."},"url":{"type":"string","description":"The URL of the app, such as its website or where users can learn more about it."},"discordUrl":{"type":"string","description":"The URL of the app's Discord server."},"twitterUrl":{"type":"string","description":"The URL of the app's Twitter page."},"steamUrl":{"type":"string","description":"The URL of the app's Steam page."},"appleIosUrl":{"type":"string","description":"The URL of the app's Apple iOS page."},"appleMacUrl":{"type":"string","description":"The URL of the app's Apple Mac page."},"googlePlayUrl":{"type":"string","description":"The URL of the app's Google Play page."},"microsoftUrl":{"type":"string","description":"The URL of the app's Windows Store page."},"privacyUrl":{"type":"string","description":"The URL of the app's privacy policy."},"termsUrl":{"type":"string","description":"The URL of the app's terms of service."},"redirectUris":{"type":"array","description":"An array of valid redirect URIs for the user authorization flows of the app.","items":{"type":"string"}}},"required":["name"]}}}},"responses":{"200":{"description":"Successfully created a new app. Returns an app object.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/AppModel"},{"type":"object","properties":{"iconImageAsset":{"$ref":"#/components/schemas/AssetModel"},"backgroundImageAsset":{"$ref":"#/components/schemas/AssetModel"},"wallet":{"$ref":"#/components/schemas/WalletModel"}}}]}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"}}}},"/v1/apps/{appId}":{"get":{"operationId":"getPublicApp","summary":"Get public app","description":"Return a public app object for the provided appId.","tags":["Apps"],"parameters":[{"$ref":"#/components/parameters/pathAppId"}],"responses":{"200":{"description":"Returns a public app object.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/AppModel"},{"type":"object","properties":{"iconImageAsset":{"$ref":"#/components/schemas/AssetModel"},"backgroundImageAsset":{"$ref":"#/components/schemas/AssetModel"},"logoImageAsset":{"$ref":"#/components/schemas/AssetModel"},"galleryMediaAssets":{"type":"array","items":{"$ref":"#/components/schemas/AssetModel"}},"wallet":{"$ref":"#/components/schemas/WalletModel"},"totalUsers":{"type":"number"}}}]}}}},"400":{"$ref":"#/components/responses/400"}}},"patch":{"operationId":"updateApp","summary":"Update app","description":"Update an app owned by the authorized user for the provided appId.","tags":["Apps"],"parameters":[{"$ref":"#/components/parameters/headerAuthorizationUser"},{"$ref":"#/components/parameters/pathAppId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"iconImageAssetId":{"type":"string","description":"The assetId of the icon image."},"backgroundImageAssetId":{"type":"string","description":"The assetId of the background image."},"logoImageAssetId":{"type":"string","description":"The assetId of the logo image."},"galleryMediaAssetIds":{"type":"array","description":"An array of assetIds for media assets to be displayed for app promotional purposes. Such as the web page media gallery.","items":{"type":"string"}},"name":{"type":"string","description":"The name of the app."},"description":{"type":"string","format":"html","description":"A brief description of the app and what it is and does."},"url":{"type":"string","description":"The URL of the app, such as its website or where users can learn more about it."},"discordUrl":{"type":"string","description":"The URL of the app's Discord server."},"twitterUrl":{"type":"string","description":"The URL of the app's Twitter page."},"steamUrl":{"type":"string","description":"The URL of the app's Steam page."},"appleIosUrl":{"type":"string","description":"The URL of the app's Apple iOS page."},"appleMacUrl":{"type":"string","description":"The URL of the app's Apple Mac page."},"googlePlayUrl":{"type":"string","description":"The URL of the app's Google Play page."},"microsoftUrl":{"type":"string","description":"The URL of the app's Windows page."},"privacyUrl":{"type":"string","description":"The URL of the app's privacy policy."},"termsUrl":{"type":"string","description":"The URL of the app's terms of service."},"redirectUris":{"type":"array","description":"An array of valid redirect URIs for the user authorization flows of the app.","items":{"type":"string"}},"resetSecretKey":{"type":"boolean","description":"If true, reset the secretKey of the app."},"resetTestSecretKey":{"type":"boolean","description":"If true, reset the testSecretKey of the app."}}}}}},"responses":{"200":{"description":"Returns the updated app object.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AppModel"}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"}}}},"/v1/apps/{appId}/leaderboards":{"get":{"operationId":"getLeaderboards","summary":"Get leaderboards","description":"Get the leaderboards of the app.","tags":["Leaderboards"],"parameters":[{"$ref":"#/components/parameters/pathAppId"}],"responses":{"200":{"description":"Returns an array of leaderboards for the app.","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"The leaderboard ID."},"name":{"type":"string","description":"The leaderboard name."},"description":{"type":"string","description":"The leaderboard description."},"totalScores":{"type":"number","description":"The total number of users with scores in the leaderboard."}}}}}}},"400":{"$ref":"#/components/responses/400"}}},"post":{"operationId":"createLeaderboard","summary":"Create leaderboard","description":"Create a leaderboard for the app.","tags":["Leaderboards"],"parameters":[{"$ref":"#/components/parameters/headerAuthorizationAppSecret"},{"$ref":"#/components/parameters/pathAppId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"The leaderboard name."},"description":{"type":"string","description":"The leaderboard description."}},"required":["name"]}}}},"responses":{"200":{"description":"Returns the created leaderboard.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"The leaderboard ID."},"name":{"type":"string","description":"The leaderboard name."},"description":{"type":"string","description":"The leaderboard description."},"scores":{"type":"object","description":"The leaderboard scores, keyed by user ID, defaults to an empty object."},"key":{"type":"string","description":"The leaderboard hash key, used to generate hashes for client side submission of scores."},"createdAt":{"type":"number","description":"The timestamp of the leaderboard creation in seconds since the Unix epoch."}}}}}},"400":{"$ref":"#/components/responses/400"}}}},"/v1/apps/{appId}/leaderboards/{leaderboardId}":{"get":{"operationId":"getLeaderboard","summary":"Get leaderboard","description":"Get a leaderboard of the app.","tags":["Leaderboards"],"parameters":[{"$ref":"#/components/parameters/pathAppId"},{"$ref":"#/components/parameters/pathLeaderboardId"}],"responses":{"200":{"description":"Returns a leaderboard.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"The leaderboard ID."},"name":{"type":"string","description":"The leaderboard name."},"description":{"type":"string","description":"The leaderboard description."},"totalScores":{"type":"number","description":"The total number of users with scores in the leaderboard."}}}}}},"400":{"$ref":"#/components/responses/400"}}},"patch":{"operationId":"updateLeaderboard","summary":"Update leaderboard","description":"Update a leaderboard of the app.","tags":["Leaderboards"],"parameters":[{"$ref":"#/components/parameters/headerAuthorizationAppSecret"},{"$ref":"#/components/parameters/pathAppId"},{"$ref":"#/components/parameters/pathLeaderboardId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"The leaderboard name."},"description":{"type":"string","description":"The leaderboard description."}}}}}},"responses":{"200":{"description":"Returns the updated leaderboard.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"The leaderboard ID."},"name":{"type":"string","description":"The leaderboard name."},"description":{"type":"string","description":"The leaderboard description."},"scores":{"type":"object","description":"The leaderboard scores, keyed by user ID."},"key":{"type":"string","description":"The leaderboard hash key, used to generate hashes"},"createdAt":{"type":"number","description":"The timestamp of the leaderboard creation in seconds since the Unix epoch."}}}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"}}}},"/v1/apps/{appId}/leaderboards/{leaderboardId}/key":{"get":{"operationId":"getLeaderboardKey","summary":"Get leaderboard key","description":"Get the key for a leaderboard.","tags":["Leaderboards"],"parameters":[{"$ref":"#/components/parameters/headerAuthorizationAppSecret"},{"$ref":"#/components/parameters/pathAppId"},{"$ref":"#/components/parameters/pathLeaderboardId"}],"responses":{"200":{"description":"Returns the leaderboard key.","content":{"application/json":{"schema":{"type":"string"}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"}}}},"/v1/apps/{appId}/leaderboards/{leaderboardId}/score":{"get":{"operationId":"getLeaderboardScore","summary":"Get leaderboard score","description":"Get a leaderboard score.","tags":["Leaderboards"],"parameters":[{"$ref":"#/components/parameters/pathAppId"},{"$ref":"#/components/parameters/pathLeaderboardId"},{"$ref":"#/components/parameters/queryUserId"}],"responses":{"200":{"description":"Returns a score based on the provided parameters.","content":{"application/json":{"schema":{"type":"object","properties":{"userId":{"type":"string"},"score":{"type":"number"},"timestamp":{"type":"number"}}}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"}}}},"/v1/apps/{appId}/leaderboards/{leaderboardId}/scores":{"get":{"operationId":"getLeaderboardScores","summary":"Get leaderboard scores","description":"Get an array of scores for the provided leaderboardId. Returns an array default orderered by scores descending. Additionally supports pagination via the `offset` and `limit query parameters. Leaderboard scores return a default of 25 scores.","tags":["Leaderboards"],"parameters":[{"$ref":"#/components/parameters/pathAppId"},{"$ref":"#/components/parameters/pathLeaderboardId"},{"$ref":"#/components/parameters/querySort"},{"$ref":"#/components/parameters/queryOffset"},{"$ref":"#/components/parameters/queryLimit"}],"responses":{"200":{"description":"Returns an array of scores.","content":{"application/json":{"schema":{"type":"object","properties":{"scores":{"type":"array","items":{"type":"object","properties":{"userId":{"type":"string"},"username":{"type":"string"},"score":{"type":"number"},"timestamp":{"type":"number"}}}},"totalScores":{"type":"number"}}}}}},"400":{"$ref":"#/components/responses/400"}}},"post":{"operationId":"createLeaderboardScore","summary":"Create leaderboard score","description":"Create a score for the provided leaderboardId. Leaderboard scores can be provided for any user id when the app secret key authorization is provided. Alternatively, a user may submit their own scores by provided their session authorization, with a request body containing `score` and `hash`. A valid `hash` is intended to be generated for each score within the game client as sha256(leaderboardKey:userId:score).","tags":["Leaderboards"],"parameters":[{"$ref":"#/components/parameters/headerAuthorizationAppSecretOptional"},{"$ref":"#/components/parameters/headerAuthorizationSessionOptional"},{"$ref":"#/components/parameters/pathAppId"},{"$ref":"#/components/parameters/pathLeaderboardId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"userId":{"type":"string","description":"The user id to associate the score with."},"score":{"type":"number","description":"The score to submit. Can be any number."},"hash":{"type":"string","description":"The hash of the score when submitting with session authorization. Must be generated as a hash using sha256(leaderboardKey:userId:score)."}},"required":["score"]}}}},"responses":{"200":{"description":"Returns the created score.","content":{"application/json":{"schema":{"type":"object","properties":{"userId":{"type":"string"},"score":{"type":"number"},"timestamp":{"type":"number"}}}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"}}},"delete":{"operationId":"deleteLeaderboardScore","summary":"Delete leaderboard score","description":"Delete a score for the provided leaderboardId and userId.","tags":["Leaderboards"],"parameters":[{"$ref":"#/components/parameters/headerAuthorizationAppSecret"},{"$ref":"#/components/parameters/pathAppId"},{"$ref":"#/components/parameters/pathLeaderboardId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"userId":{"type":"string","description":"The user id to delete the score for."}},"required":["userId"]}}}},"responses":{"204":{"description":"Score deleted successfully."},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"}}}},"/v1/apps/{appId}/page":{"get":{"operationId":"getPage","summary":"Get page","description":"Get the HYPLAY page data for an app.","tags":["Promo Page"],"parameters":[{"$ref":"#/components/parameters/pathAppId"}],"responses":{"200":{"description":"Returns the HYPLAY page data for the app.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/AppModel"},{"type":"object","properties":{"iconImageAsset":{"$ref":"#/components/schemas/AssetModel"},"backgroundImageAsset":{"$ref":"#/components/schemas/AssetModel"},"logoImageAsset":{"$ref":"#/components/schemas/AssetModel"},"galleryMediaAssets":{"type":"array","items":{"$ref":"#/components/schemas/AssetModel"}},"preregister":{"type":"object","properties":{"visible":{"type":"boolean"},"incentiveText":{"type":"string"}}},"leaderboard":{"type":"object","properties":{"id":{"type":"string"},"visible":{"type":"boolean"}}},"referral":{"type":"object","properties":{"visible":{"type":"boolean"},"titleText":{"type":"string"},"incentiveText":{"type":"string"}}},"links":{"type":"array","items":{"type":"object","properties":{"text":{"type":"string"},"url":{"type":"string"}}}},"wallet":{"$ref":"#/components/schemas/WalletModel"},"totalUsers":{"type":"number"}}}]}}}},"400":{"$ref":"#/components/responses/400"}}},"patch":{"operationId":"updatePage","summary":"Update page","description":"Update the HYPLAY page data for an app.","tags":["Promo Page"],"parameters":[{"$ref":"#/components/parameters/headerAuthorizationUser"},{"$ref":"#/components/parameters/pathAppId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"preregisterVisible":{"type":"boolean","description":"Whether the pre-register section is visible."},"preregisterIncentiveText":{"type":"string","description":"The incentive text to display with the pre-register prompt."},"leaderboardId":{"type":"string","format":"uuid","description":"The id of the leaderboard to display."},"leaderboardVisible":{"type":"boolean","description":"Whether the leaderboard section is visible."},"referralVisible":{"type":"boolean","description":"Whether the referral section is visible."},"referralTitleText":{"type":"string","description":"The title text to display in the referral section."},"referralIncentiveText":{"type":"string","description":"The incentive text to display in the referral section."},"links":{"type":"array","items":{"type":"object","properties":{"text":{"type":"string"},"url":{"type":"string"}}}}}}}}},"responses":{"200":{"description":"Returns the updated HYPLAY page data for the app.","content":{"application/json":{"schema":{"type":"object","properties":{"preregister":{"type":"object","properties":{"visible":{"type":"boolean"},"incentiveText":{"type":"string"}}},"leaderboard":{"type":"object","properties":{"id":{"type":"string"},"visible":{"type":"boolean"}}},"referral":{"type":"object","properties":{"visible":{"type":"boolean"},"titleText":{"type":"string"},"incentiveText":{"type":"string"}}},"links":{"type":"array","items":{"type":"object","properties":{"text":{"type":"string"},"url":{"type":"string"}}}}}}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"}}}},"/v1/apps/{appId}/states":{"get":{"operationId":"getAppState","summary":"Get app state","description":"Get the public, protected, private state of an app, user or key.","tags":["Apps"],"parameters":[{"$ref":"#/components/parameters/pathAppId"},{"$ref":"#/components/parameters/queryStateKey"},{"$ref":"#/components/parameters/headerAuthorizationAppSecretOptional"},{"$ref":"#/components/parameters/headerAuthorizationSessionOptional"}],"responses":{"200":{"description":"Returns a state object that may contain public, protected, and/or private state for the app, key or user for the authorized user session.","content":{"application/json":{"schema":{"type":"object","properties":{"publicState":{"type":"object","description":"Public state data for the app or user."},"protectedState":{"type":"object","description":"Protected state data for the app or user."},"privateState":{"type":"object","description":"Private state data for the app or user."}},"required":["public","protected"]}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"}}},"post":{"operationId":"setAppState","summary":"Set app state","description":"Set arbitrary JSON blobs for public, protected and/or private state specific to an application or authorized user of an application. This is useful for saving different types of data specific to users or global configuration of your app or game in many different situations. It is intended to be highly flexible. State set for a user of your app, a unique lookup key, and the app itself are all isolated to your application. State storage is not globablly shared between applications.","tags":["Apps"],"parameters":[{"$ref":"#/components/parameters/pathAppId"},{"$ref":"#/components/parameters/headerAuthorizationAppSecretOptional"},{"$ref":"#/components/parameters/headerAuthorizationSessionOptional"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"key":{"type":"string","description":"Any unique lookup key for this data. This can be things such as a hyplay user id, an internal battle match id for your game, some arbitrary settings identifier for a system of your app and more. Keys are flexible ways to create string based lookup identifiers for data you want to store/lookup. Keys are unique to your application and are not shared globally."},"publicState":{"type":"object","description":"Public state data to set for the app or user.","additionalProperties":true},"protectedState":{"type":"object","description":"Protected state data to set for the app or user.","additionalProperties":true},"privateState":{"type":"object","description":"Private state data to set for the app or user.","additionalProperties":true},"overwrite":{"type":"boolean","description":"If true, the state will be overwritten with the provided state. If false or omitted, the state will be deep merged with the provided state."}}}}}},"responses":{"200":{"description":"Returns a state object that may contain public, protected, and/or private state for the app, or user of the app for the provided userId.","content":{"application/json":{"schema":{"type":"object","properties":{"publicState":{"type":"object","description":"Public state data for the app or user."},"protectedState":{"type":"object","description":"Protected state data for the app or user."},"privateState":{"type":"object","description":"Private state data for the app or user."}},"required":["publicState","protectedState"]}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"}}}},"/v1/apps/{appId}/teammates":{"get":{"operationId":"getAppTeammates","summary":"Get app teammates","description":"Get an array of teammates for the provided appId.","tags":["Apps"],"parameters":[{"$ref":"#/components/parameters/headerAuthorizationUser"},{"$ref":"#/components/parameters/pathAppId"}],"responses":{"200":{"description":"Returns an array of teammates.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/AppTeammateModel"},{"type":"object","properties":{"user":{"type":"object","properties":{"id":{"type":"string"},"username":{"type":"string"}}}}}]}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"}}},"post":{"operationId":"createAppTeammate","summary":"Create app teammate","description":"Create a teammate for the provided appId, userId and role. Authorized user must be the owner of the app, or be a teammate with a role of OWNER.","tags":["Apps"],"parameters":[{"$ref":"#/components/parameters/headerAuthorizationUser"},{"$ref":"#/components/parameters/pathAppId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"userId":{"type":"string","description":"The user id to add as a teammate of the app."},"role":{"type":"string","description":"The role of the teammate.","enum":["OWNER","DEVELOPER","EDITOR","ANALYST"]}},"required":["userId","role"]}}}},"responses":{"200":{"description":"Returns the created or existing teammate.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AppTeammateModel"}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"}}}},"/v1/apps/{appId}/teammates/{userId}":{"patch":{"operationId":"updateAppTeammate","summary":"Update app teammate","description":"Update the role of a teammate for the provided appId and userId. Authorized user must be the owner of the app, or be a teammate with a role of OWNER.","tags":["Apps"],"parameters":[{"$ref":"#/components/parameters/headerAuthorizationUser"},{"$ref":"#/components/parameters/pathAppId"},{"$ref":"#/components/parameters/pathUserId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"role":{"type":"string","description":"The role of the teammate.","enum":["OWNER","DEVELOPER","EDITOR","ANALYST"]}},"required":["role"]}}}},"responses":{"200":{"description":"Returns the updated teammate.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AppTeammateModel"}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"}}},"delete":{"operationId":"deleteAppTeammate","summary":"Delete app teammate","description":"Delete a teammate for the provided appId and userId. Authorized user must be the owner of the app, or be a teammate with a role of OWNER.","tags":["Apps"],"parameters":[{"$ref":"#/components/parameters/headerAuthorizationUser"},{"$ref":"#/components/parameters/pathAppId"},{"$ref":"#/components/parameters/pathUserId"}],"responses":{"204":{"description":"Teammate deleted successfully."},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"}}}},"/v1/apps/{appId}/users":{"get":{"operationId":"getAppUsers","summary":"Get app users","description":"Returns an array of public users objects representing users of the apps. A HYPLAY user is considered a user of the app if they have had at least 1 active session for the provided appId.","tags":["Apps"],"parameters":[{"$ref":"#/components/parameters/pathAppId"},{"$ref":"#/components/parameters/headerAuthorizationAppSecretOptional"},{"$ref":"#/components/parameters/queryCursor"}],"responses":{"200":{"description":"Returns an array of public user objects.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/UserModel"},{"type":"object","properties":{"wallet":{"$ref":"#/components/schemas/WalletModel"}}}]}}}},"400":{"$ref":"#/components/responses/400"}}}},"/v1/apps/{appId}/users/{userId}":{"get":{"operationId":"getAppUser","summary":"Get app user","description":"Returns a public user object representing a user of the app that also includes the `totalAppReferrals` property which represents the number of other users the user for the provided userId has referred to the provided appId.","tags":["Apps"],"parameters":[{"$ref":"#/components/parameters/pathAppId"},{"$ref":"#/components/parameters/pathUserId"}],"responses":{"200":{"description":"Returns a public user object that includes a `totalAppReferrals` property.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/UserModel"},{"type":"object","properties":{"wallet":{"$ref":"#/components/schemas/WalletModel"}}},{"type":"object","properties":{"totalAppReferrals":{"type":"integer"}}}]}}}},"400":{"$ref":"#/components/responses/400"}}}},"/v1/apps/{appId}/whitelist":{"get":{"operationId":"getWhitelist","summary":"Get whitelist","description":"Get the whitelist data for an app. Returns all data in lower case to simplify case insensitive matching.","tags":["Whitelist"],"parameters":[{"$ref":"#/components/parameters/headerAuthorizationUser"},{"$ref":"#/components/parameters/pathAppId"}],"responses":{"200":{"description":"Returns the whitelist data for the app.","content":{"application/json":{"schema":{"type":"object","properties":{"enabled":{"type":"boolean"},"userIds":{"type":"array","items":{"type":"string"}},"emails":{"type":"array","items":{"type":"string"}},"usernames":{"type":"array","items":{"type":"string"}}}}}}},"400":{"$ref":"#/components/responses/400"}}},"patch":{"operationId":"updateWhitelist","summary":"Update whitelist","description":"Update the whitelist data for an app. Existing values provided will be ignored to prevent duplicates in the list. All values are case-insensitive.","tags":["Whitelist"],"parameters":[{"$ref":"#/components/parameters/headerAuthorizationUser"},{"$ref":"#/components/parameters/pathAppId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"enabled":{"type":"boolean","description":"Whether the whitelist is enabled."},"userIds":{"type":"array","description":"User Ids to add to the whitelist.","items":{"type":"string"}},"emails":{"type":"array","description":"Emails to add to the whitelist.","items":{"type":"string"}},"usernames":{"type":"array","description":"Usernames to add to the whitelist.","items":{"type":"string"}}}}}}},"responses":{"200":{"description":"Returns the updated whitelist data for the app.","content":{"application/json":{"schema":{"type":"object","properties":{"enabled":{"type":"boolean"},"userIds":{"type":"array","items":{"type":"string"}},"emails":{"type":"array","items":{"type":"string"}},"usernames":{"type":"array","items":{"type":"string"}}}}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"}}},"delete":{"operationId":"deleteFromWhitelist","summary":"Delete from whitelist","description":"Delete entries from the whitelist for an app. All values are case-insensitive.","tags":["Whitelist"],"parameters":[{"$ref":"#/components/parameters/headerAuthorizationUser"},{"$ref":"#/components/parameters/pathAppId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"userIds":{"type":"array","description":"User Ids to add to the whitelist.","items":{"type":"string"}},"emails":{"type":"array","description":"Emails to add to the whitelist.","items":{"type":"string"}},"usernames":{"type":"array","description":"Usernames to add to the whitelist.","items":{"type":"string"}}}}}}},"responses":{"200":{"description":"Returns the updated whitelist data for the app.","content":{"application/json":{"schema":{"type":"object","properties":{"enabled":{"type":"boolean"},"userIds":{"type":"array","items":{"type":"string"}},"emails":{"type":"array","items":{"type":"string"}},"usernames":{"type":"array","items":{"type":"string"}}}}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"}}}},"/v1/assets":{"get":{"operationId":"getAssets","summary":"Get assets","description":"Returns an array of assets that have been uploaded by the authorized user ordered by most recent creation.","tags":["Assets"],"parameters":[{"$ref":"#/components/parameters/headerAuthorizationUser"}],"responses":{"200":{"description":"Returns an array of asset objects.","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AssetModel"}}}}},"400":{"$ref":"#/components/responses/400"}}},"post":{"operationId":"createAsset","summary":"Create asset","description":"Create an asset object by uploading a file in base64. Returns an asset object.","tags":["Assets"],"parameters":[{"$ref":"#/components/parameters/headerAuthorizationUser"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"fileBase64":{"type":"string","format":"byte","description":"The base64 string of the asset being uploaded. Uploads may not exceed 5mb."}}}}}},"responses":{"200":{"description":"Returns a created asset object.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssetModel"}}}},"400":{"$ref":"#/components/responses/400"}}}},"/v1/assets/{assetId}":{"get":{"operationId":"getAsset","summary":"Get asset","description":"Return an asset object that has been uploaded by the authorized user for the provided assetId.","tags":["Assets"],"parameters":[{"$ref":"#/components/parameters/pathAssetId"},{"$ref":"#/components/parameters/headerAuthorizationUser"}],"responses":{"200":{"description":"Returns an asset object.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssetModel"}}}},"400":{"$ref":"#/components/responses/400"}}}},"/v1/contracts":{"get":{"operationId":"getOwnedContracts","summary":"Get owned contracts","description":"Returned an array of contracts owned by the authorized user.","tags":["Contracts"],"parameters":[{"$ref":"#/components/parameters/headerAuthorizationUser"}],"responses":{"200":{"description":"Returns an array of contracts owned by the authorized user.","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ContractModel"}}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"}}},"post":{"operationId":"createContract","summary":"Create contract","description":"Deploy a new contract from a template, or import an already deployed contract. Deploying or importing a contract through this endpoint will create a new contract object within the HYPLAY system. Once created, you can then programmatically interact with the contract gaslessly as a user, app or through a user's session. Use HYPLAY's create transaction and read contract endpoints for interactions.","tags":["Contracts"],"parameters":[{"$ref":"#/components/parameters/headerAuthorizationAppSecretOptional"},{"$ref":"#/components/parameters/headerAuthorizationUserOptional"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"chain":{"type":"string","description":"The chain to deploy or import a contract on.","enum":["HYCHAIN","HYCHAIN_TESTNET","LOCAL"]},"templateId":{"type":"string","description":"The template id to deploy a contract for. Templates have pre-defined ABIs and bytecode, allowing quick deployment of contracts one or multiple times."},"args":{"type":"array","description":"An array of constructor arguments required by the contract template being deployed from. Only required if deploying a contract from a template that requires constructor arguments.","items":{"type":"string"}},"salt":{"type":"string","description":"A salt value as a hex string, prefixed with 0x. Only required if deploying a contract from a template as a user."},"nonce":{"type":"string","description":"A nonce value as a hex string, prefixed with 0x. Only required if deploying a contract from a template as a user."},"signatures":{"type":"array","description":"An array of authority signatures to use for the contract deployment. Only required if deploying a contract from a template as a user. Provided signature(s) must be generated by the authority wallet of a user by signing a properly formatted \"create request\" object. See the hychain-crypto-js library on NPM for convenience methods in generating these signatures and create request objects if necessary.","items":{"type":"string"}},"deadline":{"type":"integer","description":"The deadline for the contract deployment execution. This can be set to a unix timestamp in the future. Typically set this to 24 hours in the future. Only required if deploying a contract from a template as a user."},"abi":{"type":"string","format":"json","description":"JSON string of the contract's ABI when importing an already deployed contract."},"address":{"type":"string","description":"The address of a contract being imported. Only required when importing an already deployed contract."},"name":{"type":"string","description":"The contract's name. Used to help distinguish contracts from one another. Optional for deploys and imports."},"description":{"type":"string","format":"html","description":"A description of the contract and what it does. This is helpful to set as a reminder for what a contract is used for. Optional for deploys and imports."},"metadata":{"type":"string","format":"json","description":"A JSON object of metadata as a string for the contract. This is an arbitrary JSON blob and is only intended for storing public data related to the contract for any use case."}},"required":["chain"]}}}},"responses":{"200":{"description":"Successfully deployed or imported a contract. Created a new contract object. Returns a contract object.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContractModel"}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"}}}},"/v1/contracts/{contractId}":{"get":{"operationId":"getContract","summary":"Get contract","description":"Returns a contract object for the provided contractId.","tags":["Contracts"],"parameters":[{"$ref":"#/components/parameters/pathContractId"}],"responses":{"200":{"description":"Returns a contract object.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContractModel"}}}},"400":{"$ref":"#/components/responses/400"}}},"patch":{"operationId":"updateContract","summary":"Update contract","description":"Updates a contract owned by the authorized user for the provided contractId.","tags":["Contracts"],"parameters":[{"$ref":"#/components/parameters/headerAuthorizationUser"},{"$ref":"#/components/parameters/pathContractId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"abi":{"type":"string","format":"json","description":"JSON string of the contract's ABI."},"name":{"type":"string","description":"The contract's name. Named contracts are easier for users to identify during app or game authorization flows through HYPLAY."},"description":{"type":"string","description":"A description of the contract and what it does."},"metadata":{"type":"string","format":"json","description":"A JSON string of arbitrary metadata for the contract. May be used by developers for a variety of reasons."}}}}}},"responses":{"200":{"description":"Returns the updated contract object.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContractModel"}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"}}}},"/v1/contracts/{contractIdOrAddress}/read":{"get":{"operationId":"readContract","summary":"Read contract","description":"Get the value from a read function of a target contract. This endpoint is designed to be highly flexible. It can read any contract by providing a contract address for `contractIdOrAddress`. It can also read using contracts created in the HYCHAIN systems through the `POST /v1/contracts` endpoint, which will utilize the contract's ABI.\n\nAdditionally, reads can be performed as a HYCHAIN app, user or user's session provided, through header authorization, or any arbitrary address or walletId provided through the `as` query parameter. Alternatively you can omit all of this and perform a read as no specific address.\n\nThe `func` query parameter accepts a complete function signature with parameters, such as `getCount()` or `readCounter(address,uint256)`, or a known function name without parameters if a contractId was provided for `contractIdOrAddress` and the contract's ABI is known. Such as `readCounter`.","tags":["Contracts"],"parameters":[{"$ref":"#/components/parameters/pathContractIdOrAddress"},{"$ref":"#/components/parameters/headerAuthorizationAppSecretOptional"},{"$ref":"#/components/parameters/headerAuthorizationSessionOptional"},{"$ref":"#/components/parameters/headerAuthorizationUserOptional"},{"$ref":"#/components/parameters/queryChain"},{"$ref":"#/components/parameters/queryFunc"},{"$ref":"#/components/parameters/queryArgs"},{"$ref":"#/components/parameters/queryAs"}],"responses":{"200":{"description":"Returns the result of the contract read as a string.","content":{"application/json":{"schema":{"type":"string"}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"}}}},"/v1/sessions":{"post":{"operationId":"startSession","summary":"Start session","description":"Starts a new session for the authorized user for an app. All prior sessions between the user and target app will become invalidated. Operates through an oauth 2.0-like flow, allowing a `code` or `token` response type. Also supports optional whitelisted access through the app whitelist system.\n\nWhen invoked directly by developers, this endpoint should only be used to start guest sessions. Guest sessions automatically create a HYPLAY user internally that bypasses the standard HYPLAY OAuth flow in order to automatically create a temporary HYPLAY account that can later be upgraded to a standard account if the user desires.","tags":["Apps"],"parameters":[{"$ref":"#/components/parameters/headerAuthorizationUserOptional"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"appId":{"type":"string","description":"The id of the app to start a session for."},"referrerId":{"type":"string","description":"The id of the user that referred the user to the app."},"scopes":{"type":"array","description":"The scopes requested for the session.","items":{"type":"string","enum":["email"]}},"nativeAllowance":{"type":"string","description":"The maximum sum of $TOPIA that may be transferred during this session, as a wei string.","example":502124124124},"contractFunctionSelectors":{"type":"array","description":"The contracts and function selectors approved for this session.","items":{"type":"object","properties":{"address":{"type":"string","description":"Target contract's address."},"functionSelectors":{"type":"array","description":"An array of function signatures or bytes4 function selectors to approve.","items":{"type":"string"}}}}},"erc20Allowances":{"type":"array","description":"The erc20 tokens and the maximum amount that may be transferred during this session.","items":{"type":"object","properties":{"address":{"type":"string","description":"Target erc20's contract address."},"allowance":{"type":"string","description":"The maximum sum of this erc20 token that may be transferred during this session, as a wei string."}}}},"erc721Allowances":{"type":"array","description":"The erc721 token ids that may be transferred during this session.","items":{"type":"object","properties":{"address":{"type":"string","description":"Target erc721's contract address."},"approveAll":{"type":"boolean","description":"If true, app is allowed through this session to transfer all tokens of the user without limits."},"tokenIds":{"type":"array","description":"The token ids this session is allowed to transfer during this session.","items":{"type":"string"}}}}},"erc1155Allowances":{"type":"array","description":"The erc1155 token ids and the maximum amount of each unique id that may be transferred during this session.","items":{"type":"object","properties":{"address":{"type":"string","description":"Target erc1155's contract address."},"approveAll":{"type":"boolean","description":"If true, app is allowed through this session to transfer any amount of all tokens of the user without limits."},"tokenIds":{"type":"array","description":"The maximum sum of the token ids this session is allowed to transfer during this session.","items":{"type":"string"}},"allowances":{"type":"array","description":"The token id allowances this session is allowed to interact or transfer during this session.","items":{"type":"string"}}}}},"chain":{"type":"string","description":"The chain the session is to be started for.","enum":["HYCHAIN","HYCHAIN_TESTNET","LOCAL"]},"isGuest":{"type":"boolean","description":"If the session should create a guest user. This allows applications to enable guest login. A guest HYPLAY user account with a managed authority wallet is created behind the scenes. The guest account can be later upgraded to a standard HYPLAY self-custodied account if desired by the user. If isGuest is set to true, `nonce`, `signatures`, `deadline` and `expiresAt` should not be provided."},"nonce":{"type":"string","description":"A positive arbitrary integer as a string to be used as this session's nonce. Nonces are a one-time use per user. For example, User A and User B can both individually use nonce \"1\", but nonce \"1\", cannot be used again in the future for User A or User B to start a different session.","example":1},"signatures":{"type":"array","description":"An array of 1 or more session start signatures, generated by the authority(s) of a user's smart contract account. These signatures are most easily generated using the `hychain-crypto-js` npm package's `generateSessionSignature()`.","items":{"type":"string"}},"deadline":{"type":"number","description":"A timestamp in seconds of when the signature(s) for the session authorization request expire. If the deadline has been passed, attempting to start a session will fail."},"expiresAt":{"type":"number","description":"A timestamp in seconds when the session is to expire."},"responseType":{"type":"string","description":"The response type for session auth flows. If `code` is used, an accessToken will not be included, and a `exchangeCode` property will be included in the response object. This `exchangeCode` must then be exchanged using both the app's secret + exchange code to acquire the session access token. Alternatively, `token` can be used which returns a populated `accessToken` property in the response. This is less secure and essentially identical in usage for Oauth 2.0's implicit auth flow.","enum":["code","token"]}},"required":["appId","chain","responseType"]}}}},"responses":{"200":{"description":"Successfully started a new session. Returns a session object.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AppModel"}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"}}},"delete":{"operationId":"endSession","summary":"End session","description":"Ends all active sessions for a given user. This endpoint is flexible and can end sessions in a number of ways. An app can end any user's sessions of their app directly, or a user can end their own sessions for an app, or a session access token can be used to end its associated session.","tags":["Apps"],"parameters":[{"$ref":"#/components/parameters/headerAuthorizationUserOptional"},{"$ref":"#/components/parameters/headerAuthorizationSessionOptional"},{"$ref":"#/components/parameters/headerAuthorizationAppSecretOptional"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"appId":{"type":"string","description":"If the `X-App-Authorization` or `X-Session-Authorization` header is not set, `appId` must be provided to indicate the application for which to end user sessions for."},"userId":{"type":"string","description":"If the user's `X-Authorization` or `X-Session-Authorization` header is not set, `userId` must be provided to indicate the user for which to end sessions for."},"chain":{"type":"string","description":"The chain to end sessions for.","enum":["HYCHAIN","HYCHAIN_TESTNET","LOCAL"]}},"required":["chain"]}}}},"responses":{"204":{"description":"Returns an empty response indicating the session has been ended."},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"}}}},"/v1/sessions/token":{"post":{"operationId":"grantSessionToken","summary":"Grant session token","description":"Returns a session object with a valid access token when the associated exchangeCode and application authorized by using its secret key is provided.","tags":["Apps"],"parameters":[{"$ref":"#/components/parameters/headerAuthorizationAppSecret"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"exchangeCode":{"type":"string","description":"An unused exchange code associated with the provided session id. Exchange codes can only be used once and then become invalid."}},"required":["exchangeCode"]}}}},"responses":{"200":{"description":"Returns an updated session object with an `accessToken` set.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SessionModel"}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"}}}},"/v1/templates":{"get":{"operationId":"getTemplates","summary":"Get templates","description":"Returns an array of templates. Templates can be used to quickly deploy contracts to HYCHAIN and HYCHAIN_TESTNET. Templates can also be reviewed and approved by the HYPLAY team to be made available for anyone to deploy. Templates that are not approved can be deployed by anyone to HYCHAIN_TESTNET, and only deployed by the creator to HYCHAIN mainnet.","tags":["Contracts"],"parameters":[{"$ref":"#/components/parameters/queryUserId"},{"$ref":"#/components/parameters/queryTemplateName"},{"$ref":"#/components/parameters/queryTemplateApproved"}],"responses":{"200":{"description":"Returns an array of template objects.","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/TemplateModel"}}}}},"400":{"$ref":"#/components/responses/400"}}},"post":{"operationId":"createTemplate","summary":"Create template","description":"Creates a new template. Templates can be used to quickly deploy pre-approved types of contracts to HYCHAIN and HYCHAIN_TESTNET.","tags":["Contracts"],"parameters":[{"$ref":"#/components/parameters/headerAuthorizationUser"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the template."},"description":{"type":"string","format":"html","description":"A description of the template."},"solidity":{"type":"string","format":"html","description":"The solidity source code of the template to compile. This must be a flattened contract with all imports inlined."},"target":{"type":"string","description":"The contract from the inlined solidity source code that is intended to be deployed for this template.","example":"MyErc20Contract"}},"required":["name","solidity","target"]}}}},"responses":{"200":{"description":"Returns the created template object.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TemplateModel"}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"}}}},"/v1/templates/{templateId}":{"get":{"operationId":"getTemplate","summary":"Get template","description":"Returns a template object with abi, bytecode and compilation errors or warnings included.","tags":["Contracts"],"parameters":[{"$ref":"#/components/parameters/pathTemplateId"}],"responses":{"200":{"description":"Returns a template object.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TemplateModel"}}}},"400":{"$ref":"#/components/responses/400"}}}},"/v1/transactions":{"get":{"operationId":"getTransactions","summary":"Get transactions","description":"Returns an array of transactions for the provided appId, sessionId, userId or walletId. Transactions are returned in descending order of creation date.","tags":["Transactions"],"parameters":[{"$ref":"#/components/parameters/queryAppId"},{"$ref":"#/components/parameters/querySessionId"},{"$ref":"#/components/parameters/queryUserId"},{"$ref":"#/components/parameters/queryWalletId"},{"$ref":"#/components/parameters/queryChain"}],"responses":{"200":{"description":"Returns an array of transaction objects.","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/TransactionModel"}}}}},"400":{"$ref":"#/components/responses/400"}}},"post":{"operationId":"createTransaction","summary":"Create transaction","description":"Create and submit a transaction to the target contract id or address. Transactions are submitted on behalf of the authorization type used, such as an app, user or user via a user's session.\n\nTransaction submission supports contract function invocation and native transfers to contracts or externally owned accounts (EOAs).\n\nThis endpoint is designed to be highly flexible. Please refer to the HYCHAIN guides and documentation for detailed examples of the many ways this endpoint can be used.","tags":["Transactions"],"parameters":[{"$ref":"#/components/parameters/headerAuthorizationAppSecretOptional"},{"$ref":"#/components/parameters/headerAuthorizationSessionOptional"},{"$ref":"#/components/parameters/headerAuthorizationUserOptional"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"contractId":{"type":"string","description":"The contract id to target."},"address":{"type":"string","description":"The address to target."},"func":{"type":"string","description":"The function name or function signature of the contract."},"args":{"type":"array","description":"An array of arguments to pass to the function.","items":{"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}]}},"value":{"type":"number","description":"The amount of native token to send with the transaction."},"nonce":{"type":"string","description":"The nonce of the transaction."},"deadline":{"type":"number","description":"The deadline for the transaction as a timestamp in seconds."},"signatures":{"type":"array","description":"An array of signatures for the transaction.","items":{"type":"string"}},"chain":{"type":"string","description":"The chain the session is to be started for.","enum":["HYCHAIN","HYCHAIN_TESTNET","LOCAL"]}}}}}},"responses":{"200":{"description":"Returns a transaction object.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TransactionModel"}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"}}}},"/v1/transactions/{transactionId}":{"get":{"operationId":"getTransaction","summary":"Get transaction","description":"Returns a transaction object for the provided transactionId.","tags":["Transactions"],"parameters":[{"$ref":"#/components/parameters/pathTransactionId"}],"responses":{"200":{"description":"Returns a transaction object.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TransactionModel"}}}},"400":{"$ref":"#/components/responses/400"}}}},"/v1/users":{"get":{"operationId":"getUser","summary":"Get user","description":"Returns a public user object when provided a user id, username or wallet address.","tags":["Users"],"parameters":[{"$ref":"#/components/parameters/queryUserId"},{"$ref":"#/components/parameters/queryUsername"},{"$ref":"#/components/parameters/queryWalletAddress"}],"responses":{"200":{"description":"Returns a public user object.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/UserModel"},{"type":"object","properties":{"preregistered":{"type":"boolean"}}},{"type":"object","properties":{"wallet":{"$ref":"#/components/schemas/WalletModel"}}}]}}}},"400":{"$ref":"#/components/responses/400"}}}},"/v1/users/me":{"get":{"operationId":"getCurrentUser","summary":"Get current user","description":"Returns a public user object associated with the provided session access token.","tags":["Users"],"parameters":[{"$ref":"#/components/parameters/headerAuthorizationSession"}],"responses":{"200":{"description":"Returns a public user object.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/UserModel"},{"type":"object","properties":{"wallet":{"$ref":"#/components/schemas/WalletModel"}}}]}}}},"400":{"$ref":"#/components/responses/400"}}}},"/v1/wallets/{walletIdOrAddress}":{"get":{"operationId":"getWallet","summary":"Get wallet","description":"Returns a wallet object for the provided walletIdOrAddress. If walletIdOrAddress is a HYCHAIN system wallet id, it will return a matching wallet for the id. If walletIdOrAddress is a on chain smart contract wallet address, it will return a matching wallet from the HYCHAIN system. If a wallet is not found in HYCHAIN's systems for the address or walletId provided, a 400 error will be returned.","tags":["Wallets"],"parameters":[{"$ref":"#/components/parameters/pathWalletIdOrAddress"}],"responses":{"200":{"description":"Returns a wallet object.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/WalletModel"},{"type":"object","properties":{"mainnetRequiresUpgradeTo":{"type":"string","description":"The mainnet wallet implementation address to upgrade to if the wallet requires an upgrade, otherwise null if no upgrade required."},"testnetRequiresUpgradeTo":{"type":"string","description":"The testnet wallet implementation address to upgrade to if the wallet requires an upgrade, otherwise null if no upgrade required."},"localRequiresUpgradeTo":{"type":"string","description":"The local wallet implementation address to upgrade to if the wallet requires an upgrade, otherwise null if no upgrade required."}}}]}}}},"400":{"$ref":"#/components/responses/400"}}},"patch":{"operationId":"updateWallet","summary":"Update wallet","description":"Update various fields specific to a wallet. This endpoint is currently used for optining in to upgrade a user or application smart contract wallet to the latest implementation if necessary.","tags":["Wallets"],"parameters":[{"$ref":"#/components/parameters/pathWalletIdOrAddress"},{"$ref":"#/components/parameters/headerAuthorizationUser"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"chain":{"type":"string","description":"The chain to deploy or import a contract on.","enum":["HYCHAIN","HYCHAIN_TESTNET","LOCAL"]},"deadline":{"type":"number","description":"The deadline for the transaction as a timestamp in seconds."},"upgradeToLatest":{"type":"boolean","description":"If true, the wallet will be upgraded to the latest available wallet implementation for the provided chain."},"signatures":{"type":"array","description":"An array of signatures to authorize the upgrade.","items":{"type":"string"}}}}}}},"responses":{"200":{"description":"Returns a transaction object.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TransactionModel"}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"}}}},"/v1/wallets/{walletIdOrAddress}/balance":{"get":{"operationId":"getWalletBalance","summary":"Get wallet balance","description":"Returns the native token balance for the smart contract wallet associated with a wallet id provided for walletIdOrAddress. Or, if any address is provided for walletIdOrAddress, it will return the native token balance for the address.","tags":["Wallets"],"parameters":[{"$ref":"#/components/parameters/pathWalletIdOrAddress"},{"$ref":"#/components/parameters/queryChain"}],"responses":{"200":{"description":"Returns the native token balance for the wallet in readable string format. For example a 1e18 balance would be '1.0'.","content":{"application/json":{"schema":{"type":"string"}}}},"400":{"$ref":"#/components/responses/400"}}}}}} \ No newline at end of file +{"openapi":"3.0.0","info":{"title":"HYPLAY API","version":"1.0.0","description":"HYPLAY API Specification","termsOfService":"https://hyplay.com","contact":{"name":"HYCHAIN Team","email":"braydon@hytopia.com","url":"https://hychain.com"}},"servers":[{"description":"HYPLAY API Server","url":"https://api.hyplay.com"},{"description":"HYPLAY API Staging Server","url":"https://staging-api.hyplay.com"},{"description":"Local Development Server","url":"http://localhost:8001"}],"components":{"parameters":{"headerAuthorizationUser":{"name":"x-authorization","in":"header","description":"The `accessToken` of the authenticating user.","example":"user_at_02z4Mv3c85Ig0gNowY9Dq0N2kjb1xwzr27ArLE0669RrRI6dLf822iPO26K1p1FP","required":true,"schema":{"type":"string"}},"headerAuthorizationUserOptional":{"name":"x-authorization","in":"header","description":"The `accessToken` of the authenticating user.","example":"user_at_02z4Mv3c85Ig0gNowY9Dq0N2kjb1xwzr27ArLE0669RrRI6dLf822iPO26K1p1FP","required":false,"schema":{"type":"string"}},"headerAuthorizationAppSecret":{"name":"x-app-authorization","in":"header","description":"The `secretKey` or `testSecretKey` of the authenticating app.","example":"test_app_sk_pBEHOVTIZjQFT6WpiQLT8c_VFfd6Vb2XHj_9IIV8-Zi06SdMIruJxIe2QMaca_X6","required":true,"schema":{"type":"string"}},"headerAuthorizationAppSecretOptional":{"name":"x-app-authorization","in":"header","description":"The `secretKey` or `testSecretKey` of the authenticating app.","example":"test_app_sk_pBEHOVTIZjQFT6WpiQLT8c_VFfd6Vb2XHj_9IIV8-Zi06SdMIruJxIe2QMaca_X6","required":false,"schema":{"type":"string"}},"headerAuthorizationSession":{"name":"x-session-authorization","in":"header","description":"The `accessToken` of the authenticating session.","example":"sca_sat_pBEHOVTIZjQFT6WpiQLT8c_VFfd6Vb2XHj_9IIV8-Zi06SdMIruJxIe2QMaca_X6","required":true,"schema":{"type":"string"}},"headerAuthorizationSessionOptional":{"name":"x-session-authorization","in":"header","description":"The `accessToken` of the authenticating session.","example":"sca_sat_pBEHOVTIZjQFT6WpiQLT8c_VFfd6Vb2XHj_9IIV8-Zi06SdMIruJxIe2QMaca_X6","required":false,"schema":{"type":"string"}},"headerAuthorizationNonce":{"name":"x-nonce","in":"header","description":"The nonce of the authenticating user.","required":true,"schema":{"type":"string"}},"headerAuthorizationNonceSignature":{"name":"x-nonce-signature","in":"header","description":"The nonce signature of the authenticating user.","required":true,"schema":{"type":"string"}},"pathAppId":{"name":"appId","in":"path","description":"An application id.","required":true,"schema":{"type":"string"}},"pathAssetId":{"name":"assetId","in":"path","description":"An asset id.","required":true,"schema":{"type":"string"}},"pathContractId":{"name":"contractId","in":"path","description":"A contract id.","required":true,"schema":{"type":"string"}},"pathContractIdOrAddress":{"name":"contractIdOrAddress","in":"path","description":"A contract id or address.","required":true,"schema":{"type":"string"}},"pathLeaderboardId":{"name":"leaderboardId","in":"path","description":"A leaderboard id.","required":true,"schema":{"type":"string"}},"pathSessionId":{"name":"sessionId","in":"path","description":"A session id.","required":true,"schema":{"type":"string"}},"pathTemplateId":{"name":"templateId","in":"path","description":"A template id.","required":true,"schema":{"type":"string"}},"pathTransactionId":{"name":"transactionId","in":"path","description":"A transaction id.","required":true,"schema":{"type":"string"}},"pathUserId":{"name":"userId","in":"path","description":"A user id.","required":true,"schema":{"type":"string"}},"pathWalletIdOrAddress":{"name":"walletIdOrAddress","in":"path","description":"A wallet id or address.","required":true,"schema":{"type":"string"}},"queryAccessTokenExpiresAt":{"name":"accessTokenExpiresAt","in":"query","description":"An optional unix timestamp in seconds specifying when the returned `accessToken` should expire. If this value is provided, all prior `accessToken` will be invalidated and a new `accessToken` will be issued in the response. If no value is provided, the returned `accessToken` will not expire unless it is invalidated.","example":1677197460,"required":false,"schema":{"type":"number"}},"queryAppleAuthCode":{"name":"appleAuthCode","in":"query","description":"A Apple OAuth 2.0 code.","required":false,"schema":{"type":"string"}},"queryAppleRedirectOverride":{"name":"appleRedirectOverride","in":"query","description":"An redirect url for apple auth.","required":false,"schema":{"type":"string"}},"queryAppId":{"name":"appId","in":"query","description":"An application id.","required":false,"schema":{"type":"string"}},"queryArgs":{"name":"args","in":"query","description":"An array of arguments.","required":false,"schema":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}]}}},"queryAs":{"name":"as","in":"query","description":"An address or walletId to perform as.","required":false,"schema":{"type":"string"}},"queryChain":{"name":"chain","in":"query","description":"A chain name.","required":false,"schema":{"type":"string","enum":["HYCHAIN","HYCHAIN_TESTNET","LOCAL"]}},"queryCursor":{"name":"cursor","in":"query","description":"An id from the record type to start the pagination of the next results, excluding the provided record id.","required":false,"schema":{"type":"string"}},"queryFunc":{"name":"func","in":"query","description":"A function name or function signature.","required":true,"schema":{"type":"string"}},"queryDiscordAuthCode":{"name":"discordAuthCode","in":"query","description":"A Discord OAuth 2.0 code.","required":false,"schema":{"type":"string"}},"queryDiscordRedirectOverride":{"name":"discordRedirectOverride","in":"query","description":"An redirect url for discord auth.","required":false,"schema":{"type":"string"}},"queryFacebookAuthCode":{"name":"facebookAuthCode","in":"query","description":"A Facebook OAuth 2.0 code.","required":false,"schema":{"type":"string"}},"queryFacebookRedirectOverride":{"name":"facebookRedirectOverride","in":"query","description":"An redirect url for facebook auth.","required":false,"schema":{"type":"string"}},"queryGoogleAuthCode":{"name":"googleAuthCode","in":"query","description":"A Google OAuth 2.0 code.","required":false,"schema":{"type":"string"}},"queryGoogleRedirectOverride":{"name":"googleRedirectOverride","in":"query","description":"An redirect url for google auth.","required":false,"schema":{"type":"string"}},"queryTwitterAuthCode":{"name":"twitterAuthCode","in":"query","description":"A Twitter OAuth 2.0 code.","required":false,"schema":{"type":"string"}},"queryTwitterRedirectOverride":{"name":"twitterRedirectOverride","in":"query","description":"An redirect url for twitter auth.","required":false,"schema":{"type":"string"}},"queryTemplateApproved":{"name":"approved","in":"query","description":"Set this query parameter to `true` to filter for approved templates.","example":"true","required":false,"schema":{"type":"string"}},"queryTemplateName":{"name":"name","in":"query","description":"A template name to partially or exactly match.","example":"token","required":false,"schema":{"type":"string"}},"queryLimit":{"name":"limit","in":"query","description":"The maximum number of items to return.","example":25,"required":false,"schema":{"type":"number"}},"queryOffset":{"name":"offset","in":"query","description":"The offset of the first item to return.","example":0,"required":false,"schema":{"type":"number"}},"queryResetAccessToken":{"name":"resetAccessToken","in":"query","description":"Set this query parameter to `true` to reset accessToken and authorityKey.","example":"true","required":false,"schema":{"type":"string"}},"queryRecaptchaToken":{"name":"hcaptchaResponse","in":"query","description":"A hCaptcha token generated client-side by completion of a user-facing hCaptcha request.","required":true,"schema":{"type":"string"}},"querySessionId":{"name":"sessionId","in":"query","description":"A session id.","required":false,"schema":{"type":"string"}},"querySort":{"name":"sort","in":"query","description":"A sort order.","required":false,"schema":{"type":"string"}},"queryUsername":{"name":"username","in":"query","description":"A user username.","example":"arkdev","required":false,"schema":{"type":"string"}},"queryUserId":{"name":"userId","in":"query","description":"A user id.","required":false,"schema":{"type":"string"}},"queryWalletAddress":{"name":"walletAddress","in":"query","description":"A wallet address.","required":false,"schema":{"type":"string"}},"queryWalletId":{"name":"walletId","in":"query","description":"A wallet id.","required":false,"schema":{"type":"string"}},"queryStateKey":{"name":"key","in":"query","description":"A string identifier unique to an app for looking up state data.","required":false,"schema":{"type":"string"}}},"responses":{"400":{"description":"An API level error occurred. This is often due to problematic data being provided by you.","content":{"application/json":{"schema":{"type":"string"}}}},"401":{"description":"An authorization error occured. This is often due to incorrect tokens or keys being provided, or accessing a resource that the provided tokens or keys do not have access to.","content":{"application/json":{"schema":{"type":"string"}}}}},"schemas":{"AppModel":{"type":"object","properties":{"id":{"type":"string","description":"This field has not had a description added."},"userId":{"type":"string","description":"This field has not had a description added."},"walletId":{"type":"string","description":"This field has not had a description added."},"iconImageAssetId":{"type":"string","description":"This field has not had a description added."},"backgroundImageAssetId":{"type":"string","description":"This field has not had a description added."},"logoImageAssetId":{"type":"string","description":"This field has not had a description added."},"galleryMediaAssetIds":{"type":"object","description":"This field has not had a description added."},"secretKey":{"type":"string","description":"This field has not had a description added."},"testSecretKey":{"type":"string","description":"This field has not had a description added."},"name":{"type":"string","description":"This field has not had a description added."},"description":{"type":"string","description":"This field has not had a description added."},"url":{"type":"string","description":"This field has not had a description added."},"discordUrl":{"type":"string","description":"This field has not had a description added."},"twitterUrl":{"type":"string","description":"This field has not had a description added."},"steamUrl":{"type":"string","description":"This field has not had a description added."},"appleIosUrl":{"type":"string","description":"This field has not had a description added."},"appleMacUrl":{"type":"string","description":"This field has not had a description added."},"googlePlayUrl":{"type":"string","description":"This field has not had a description added."},"microsoftUrl":{"type":"string","description":"This field has not had a description added."},"privacyUrl":{"type":"string","description":"This field has not had a description added."},"termsUrl":{"type":"string","description":"This field has not had a description added."},"redirectUris":{"type":"object","description":"This field has not had a description added."},"verificationStatus":{"type":"string","description":"This field has not had a description added."},"updatedAt":{"type":"string","description":"This field has not had a description added."},"createdAt":{"type":"string","description":"This field has not had a description added."}}},"AppReferralsModel":{"type":"object","properties":{"id":{"type":"string","description":"This field has not had a description added."},"appId":{"type":"string","description":"This field has not had a description added."},"referredUserId":{"type":"string","description":"This field has not had a description added."},"referrerUserId":{"type":"string","description":"This field has not had a description added."},"updatedAt":{"type":"string","description":"This field has not had a description added."},"createdAt":{"type":"string","description":"This field has not had a description added."}}},"AppTeammateModel":{"type":"object","properties":{"id":{"type":"string","description":"This field has not had a description added."},"appId":{"type":"string","description":"This field has not had a description added."},"userId":{"type":"string","description":"This field has not had a description added."},"role":{"type":"string","description":"This field has not had a description added."},"updatedAt":{"type":"string","description":"This field has not had a description added."},"createdAt":{"type":"string","description":"This field has not had a description added."}}},"AssetModel":{"type":"object","properties":{"id":{"type":"string","description":"This field has not had a description added."},"userId":{"type":"string","description":"This field has not had a description added."},"s3Url":{"type":"string","description":"This field has not had a description added."},"cdnUrl":{"type":"string","description":"This field has not had a description added."},"mime":{"type":"string","description":"This field has not had a description added."},"extension":{"type":"string","description":"This field has not had a description added."},"checksum":{"type":"string","description":"This field has not had a description added."},"size":{"type":"integer","description":"This field has not had a description added."},"updatedAt":{"type":"string","description":"This field has not had a description added."},"createdAt":{"type":"string","description":"This field has not had a description added."}}},"ContractModel":{"type":"object","properties":{"id":{"type":"string","description":"This field has not had a description added."},"appId":{"type":"string","description":"This field has not had a description added."},"userId":{"type":"string","description":"This field has not had a description added."},"templateId":{"type":"string","description":"This field has not had a description added."},"chain":{"type":"string","description":"This field has not had a description added."},"abi":{"type":"object","description":"This field has not had a description added."},"address":{"type":"string","description":"This field has not had a description added."},"name":{"type":"string","description":"This field has not had a description added."},"description":{"type":"string","description":"This field has not had a description added."},"metadata":{"type":"object","description":"This field has not had a description added."},"updatedAt":{"type":"string","description":"This field has not had a description added."},"createdAt":{"type":"string","description":"This field has not had a description added."}}},"NonceModel":{"type":"object","properties":{"id":{"type":"string","description":"This field has not had a description added."},"walletId":{"type":"string","description":"This field has not had a description added."},"nonce":{"type":"string","description":"This field has not had a description added."},"createdAt":{"type":"string","description":"This field has not had a description added."}}},"SessionModel":{"type":"object","properties":{"id":{"type":"string","description":"This field has not had a description added."},"appId":{"type":"string","description":"This field has not had a description added."},"userId":{"type":"string","description":"This field has not had a description added."},"chain":{"type":"string","description":"This field has not had a description added."},"accessToken":{"type":"string","description":"This field has not had a description added."},"exchangeCode":{"type":"string","description":"This field has not had a description added."},"scopes":{"type":"object","description":"This field has not had a description added."},"contractFunctionSelectors":{"type":"object","description":"This field has not had a description added."},"nativeAllowance":{"type":"string","description":"This field has not had a description added."},"erc20Allowances":{"type":"object","description":"This field has not had a description added."},"erc721Allowances":{"type":"object","description":"This field has not had a description added."},"erc1155Allowances":{"type":"object","description":"This field has not had a description added."},"nonce":{"type":"string","description":"This field has not had a description added."},"signatures":{"type":"object","description":"This field has not had a description added."},"deadline":{"type":"string","description":"This field has not had a description added."},"expiresAt":{"type":"string","description":"This field has not had a description added."},"endedAt":{"type":"string","description":"This field has not had a description added."},"updatedAt":{"type":"string","description":"This field has not had a description added."},"createdAt":{"type":"string","description":"This field has not had a description added."}}},"TemplateModel":{"type":"object","properties":{"id":{"type":"string","description":"This field has not had a description added."},"userId":{"type":"string","description":"This field has not had a description added."},"name":{"type":"string","description":"This field has not had a description added."},"description":{"type":"string","description":"This field has not had a description added."},"solidity":{"type":"string","description":"This field has not had a description added."},"target":{"type":"string","description":"This field has not had a description added."},"bytecode":{"type":"string","description":"This field has not had a description added."},"abi":{"type":"object","description":"This field has not had a description added."},"errors":{"type":"object","description":"This field has not had a description added."},"approved":{"type":"boolean","description":"This field has not had a description added."},"updatedAt":{"type":"string","description":"This field has not had a description added."},"createdAt":{"type":"string","description":"This field has not had a description added."}}},"TransactionModel":{"type":"object","properties":{"id":{"type":"string","description":"This field has not had a description added."},"walletId":{"type":"string","description":"This field has not had a description added."},"sessionId":{"type":"string","description":"This field has not had a description added."},"chain":{"type":"string","description":"This field has not had a description added."},"relayerAddress":{"type":"string","description":"This field has not had a description added."},"func":{"type":"string","description":"This field has not had a description added."},"args":{"type":"object","description":"This field has not had a description added."},"value":{"type":"string","description":"This field has not had a description added."},"hash":{"type":"string","description":"This field has not had a description added."},"createdAt":{"type":"string","description":"This field has not had a description added."}}},"UserModel":{"type":"object","properties":{"id":{"type":"string","description":"This field has not had a description added."},"walletId":{"type":"string","description":"This field has not had a description added."},"username":{"type":"string","description":"This field has not had a description added."},"email":{"type":"string","description":"This field has not had a description added."},"phone":{"type":"string","description":"This field has not had a description added."},"appleId":{"type":"string","description":"This field has not had a description added."},"discordId":{"type":"string","description":"This field has not had a description added."},"facebookId":{"type":"string","description":"This field has not had a description added."},"googleId":{"type":"string","description":"This field has not had a description added."},"microsoftId":{"type":"string","description":"This field has not had a description added."},"twitterId":{"type":"string","description":"This field has not had a description added."},"accessToken":{"type":"string","description":"This field has not had a description added."},"isChild":{"type":"boolean","description":"This field has not had a description added."},"accessTokenExpiresAt":{"type":"string","description":"This field has not had a description added."},"updatedAt":{"type":"string","description":"This field has not had a description added."},"createdAt":{"type":"string","description":"This field has not had a description added."}}},"WalletModel":{"type":"object","properties":{"id":{"type":"string","description":"This field has not had a description added."},"type":{"type":"string","description":"This field has not had a description added."},"address":{"type":"string","description":"This field has not had a description added."},"authorityCiphertext":{"type":"string","description":"This field has not had a description added."},"authorityBackupCiphertexts":{"type":"object","description":"This field has not had a description added."},"authorityProofSignature":{"type":"string","description":"This field has not had a description added."},"backupQuestions":{"type":"object","description":"This field has not had a description added."},"updatedAt":{"type":"string","description":"This field has not had a description added."},"createdAt":{"type":"string","description":"This field has not had a description added."}}},"AnyValue":{"description":"Can be anything. String, number, object, array, boolean, etc."}},"securitySchemes":{"basicAuth":{"type":"http","scheme":"basic","description":"Basic authentication must be send in the format of usernameOrEmail:shaPassword, where usernameOrEmail can be the username or email associated with an account, andshaPassword is a sha256 hash of the users provided plaintext password."}}},"tags":[{"name":"Users","description":"User related operations"}],"paths":{"/v1/apps":{"get":{"operationId":"getApps","summary":"Get apps","description":"Returns an array of apps owned by, or a teammate of, for the authorized user, or up to 25 public apps across HYPLAY if no authorization is provided. Supports pagination for public apps when no user authorization is provided - a `cursor` query parameter can be provided for paginating results based on last result set id.","tags":["Apps"],"parameters":[{"$ref":"#/components/parameters/headerAuthorizationUserOptional"},{"$ref":"#/components/parameters/queryCursor"}],"responses":{"200":{"description":"Returns an array of apps owned by the authorized user or public apps across HYPLAY if no authorization is provided.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/AppModel"},{"type":"object","properties":{"iconImageAsset":{"$ref":"#/components/schemas/AssetModel"},"backgroundImageAsset":{"$ref":"#/components/schemas/AssetModel"},"logoImageAsset":{"$ref":"#/components/schemas/AssetModel"},"wallet":{"$ref":"#/components/schemas/WalletModel"}}}]}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"}}},"post":{"operationId":"createApp","summary":"Create app","description":"Create a new app for the authorized user.","tags":["Apps"],"parameters":[{"$ref":"#/components/parameters/headerAuthorizationUser"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"iconImageAssetId":{"type":"string","description":"The assetId of the icon image. Icon images are recommended to be a 1:1 aspect ratio and at least 512x512 pixels."},"backgroundImageAssetId":{"type":"string","description":"The assetId of the background image. Background images are recommended to be a 16:9 aspect ratio and at least 1920x1080 pixels."},"logoImageAssetId":{"type":"string","description":"The assetId of the logo image. Logo image are used on pages like preregistration, questing, etc and can be any aspect ratio."},"galleryMediaAssetIds":{"type":"array","description":"An array of assetIds for media assets to be displayed for app promotional purposes. Such as the web page media gallery.","items":{"type":"string"}},"name":{"type":"string","description":"The name of the app."},"description":{"type":"string","format":"html","description":"A brief description of the app and what it is and does."},"url":{"type":"string","description":"The URL of the app, such as its website or where users can learn more about it."},"discordUrl":{"type":"string","description":"The URL of the app's Discord server."},"twitterUrl":{"type":"string","description":"The URL of the app's Twitter page."},"steamUrl":{"type":"string","description":"The URL of the app's Steam page."},"appleIosUrl":{"type":"string","description":"The URL of the app's Apple iOS page."},"appleMacUrl":{"type":"string","description":"The URL of the app's Apple Mac page."},"googlePlayUrl":{"type":"string","description":"The URL of the app's Google Play page."},"microsoftUrl":{"type":"string","description":"The URL of the app's Windows Store page."},"privacyUrl":{"type":"string","description":"The URL of the app's privacy policy."},"termsUrl":{"type":"string","description":"The URL of the app's terms of service."},"redirectUris":{"type":"array","description":"An array of valid redirect URIs for the user authorization flows of the app.","items":{"type":"string"}}},"required":["name"]}}}},"responses":{"200":{"description":"Successfully created a new app. Returns an app object.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/AppModel"},{"type":"object","properties":{"iconImageAsset":{"$ref":"#/components/schemas/AssetModel"},"backgroundImageAsset":{"$ref":"#/components/schemas/AssetModel"},"wallet":{"$ref":"#/components/schemas/WalletModel"}}}]}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"}}}},"/v1/apps/{appId}":{"get":{"operationId":"getPublicApp","summary":"Get public app","description":"Return a public app object for the provided appId.","tags":["Apps"],"parameters":[{"$ref":"#/components/parameters/pathAppId"}],"responses":{"200":{"description":"Returns a public app object.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/AppModel"},{"type":"object","properties":{"iconImageAsset":{"$ref":"#/components/schemas/AssetModel"},"backgroundImageAsset":{"$ref":"#/components/schemas/AssetModel"},"logoImageAsset":{"$ref":"#/components/schemas/AssetModel"},"galleryMediaAssets":{"type":"array","items":{"$ref":"#/components/schemas/AssetModel"}},"wallet":{"$ref":"#/components/schemas/WalletModel"},"totalUsers":{"type":"number"}}}]}}}},"400":{"$ref":"#/components/responses/400"}}},"patch":{"operationId":"updateApp","summary":"Update app","description":"Update an app owned by the authorized user for the provided appId.","tags":["Apps"],"parameters":[{"$ref":"#/components/parameters/headerAuthorizationUser"},{"$ref":"#/components/parameters/pathAppId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"iconImageAssetId":{"type":"string","description":"The assetId of the icon image."},"backgroundImageAssetId":{"type":"string","description":"The assetId of the background image."},"logoImageAssetId":{"type":"string","description":"The assetId of the logo image."},"galleryMediaAssetIds":{"type":"array","description":"An array of assetIds for media assets to be displayed for app promotional purposes. Such as the web page media gallery.","items":{"type":"string"}},"name":{"type":"string","description":"The name of the app."},"description":{"type":"string","format":"html","description":"A brief description of the app and what it is and does."},"url":{"type":"string","description":"The URL of the app, such as its website or where users can learn more about it."},"discordUrl":{"type":"string","description":"The URL of the app's Discord server."},"twitterUrl":{"type":"string","description":"The URL of the app's Twitter page."},"steamUrl":{"type":"string","description":"The URL of the app's Steam page."},"appleIosUrl":{"type":"string","description":"The URL of the app's Apple iOS page."},"appleMacUrl":{"type":"string","description":"The URL of the app's Apple Mac page."},"googlePlayUrl":{"type":"string","description":"The URL of the app's Google Play page."},"microsoftUrl":{"type":"string","description":"The URL of the app's Windows page."},"privacyUrl":{"type":"string","description":"The URL of the app's privacy policy."},"termsUrl":{"type":"string","description":"The URL of the app's terms of service."},"redirectUris":{"type":"array","description":"An array of valid redirect URIs for the user authorization flows of the app.","items":{"type":"string"}},"resetSecretKey":{"type":"boolean","description":"If true, reset the secretKey of the app."},"resetTestSecretKey":{"type":"boolean","description":"If true, reset the testSecretKey of the app."}}}}}},"responses":{"200":{"description":"Returns the updated app object.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AppModel"}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"}}}},"/v1/apps/{appId}/leaderboards":{"get":{"operationId":"getLeaderboards","summary":"Get leaderboards","description":"Get the leaderboards of the app.","tags":["Leaderboards"],"parameters":[{"$ref":"#/components/parameters/pathAppId"}],"responses":{"200":{"description":"Returns an array of leaderboards for the app.","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"The leaderboard ID."},"name":{"type":"string","description":"The leaderboard name."},"description":{"type":"string","description":"The leaderboard description."},"totalScores":{"type":"number","description":"The total number of users with scores in the leaderboard."}}}}}}},"400":{"$ref":"#/components/responses/400"}}},"post":{"operationId":"createLeaderboard","summary":"Create leaderboard","description":"Create a leaderboard for the app.","tags":["Leaderboards"],"parameters":[{"$ref":"#/components/parameters/headerAuthorizationAppSecret"},{"$ref":"#/components/parameters/pathAppId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"The leaderboard name."},"description":{"type":"string","description":"The leaderboard description."}},"required":["name"]}}}},"responses":{"200":{"description":"Returns the created leaderboard.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"The leaderboard ID."},"name":{"type":"string","description":"The leaderboard name."},"description":{"type":"string","description":"The leaderboard description."},"scores":{"type":"object","description":"The leaderboard scores, keyed by user ID, defaults to an empty object."},"key":{"type":"string","description":"The leaderboard hash key, used to generate hashes for client side submission of scores."},"createdAt":{"type":"number","description":"The timestamp of the leaderboard creation in seconds since the Unix epoch."}}}}}},"400":{"$ref":"#/components/responses/400"}}}},"/v1/apps/{appId}/leaderboards/{leaderboardId}":{"get":{"operationId":"getLeaderboard","summary":"Get leaderboard","description":"Get a leaderboard of the app.","tags":["Leaderboards"],"parameters":[{"$ref":"#/components/parameters/pathAppId"},{"$ref":"#/components/parameters/pathLeaderboardId"}],"responses":{"200":{"description":"Returns a leaderboard.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"The leaderboard ID."},"name":{"type":"string","description":"The leaderboard name."},"description":{"type":"string","description":"The leaderboard description."},"totalScores":{"type":"number","description":"The total number of users with scores in the leaderboard."}}}}}},"400":{"$ref":"#/components/responses/400"}}},"patch":{"operationId":"updateLeaderboard","summary":"Update leaderboard","description":"Update a leaderboard of the app.","tags":["Leaderboards"],"parameters":[{"$ref":"#/components/parameters/headerAuthorizationAppSecret"},{"$ref":"#/components/parameters/pathAppId"},{"$ref":"#/components/parameters/pathLeaderboardId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"The leaderboard name."},"description":{"type":"string","description":"The leaderboard description."}}}}}},"responses":{"200":{"description":"Returns the updated leaderboard.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"The leaderboard ID."},"name":{"type":"string","description":"The leaderboard name."},"description":{"type":"string","description":"The leaderboard description."},"scores":{"type":"object","description":"The leaderboard scores, keyed by user ID."},"key":{"type":"string","description":"The leaderboard hash key, used to generate hashes"},"createdAt":{"type":"number","description":"The timestamp of the leaderboard creation in seconds since the Unix epoch."}}}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"}}}},"/v1/apps/{appId}/leaderboards/{leaderboardId}/key":{"get":{"operationId":"getLeaderboardKey","summary":"Get leaderboard key","description":"Get the key for a leaderboard.","tags":["Leaderboards"],"parameters":[{"$ref":"#/components/parameters/headerAuthorizationAppSecret"},{"$ref":"#/components/parameters/pathAppId"},{"$ref":"#/components/parameters/pathLeaderboardId"}],"responses":{"200":{"description":"Returns the leaderboard key.","content":{"application/json":{"schema":{"type":"string"}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"}}}},"/v1/apps/{appId}/leaderboards/{leaderboardId}/score":{"get":{"operationId":"getLeaderboardScore","summary":"Get leaderboard score","description":"Get a leaderboard score.","tags":["Leaderboards"],"parameters":[{"$ref":"#/components/parameters/pathAppId"},{"$ref":"#/components/parameters/pathLeaderboardId"},{"$ref":"#/components/parameters/queryUserId"}],"responses":{"200":{"description":"Returns a score based on the provided parameters.","content":{"application/json":{"schema":{"type":"object","properties":{"userId":{"type":"string"},"score":{"type":"number"},"timestamp":{"type":"number"}}}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"}}}},"/v1/apps/{appId}/leaderboards/{leaderboardId}/scores":{"get":{"operationId":"getLeaderboardScores","summary":"Get leaderboard scores","description":"Get an array of scores for the provided leaderboardId. Returns an array default orderered by scores descending. Additionally supports pagination via the `offset` and `limit query parameters. Leaderboard scores return a default of 25 scores.","tags":["Leaderboards"],"parameters":[{"$ref":"#/components/parameters/pathAppId"},{"$ref":"#/components/parameters/pathLeaderboardId"},{"$ref":"#/components/parameters/querySort"},{"$ref":"#/components/parameters/queryOffset"},{"$ref":"#/components/parameters/queryLimit"}],"responses":{"200":{"description":"Returns an array of scores.","content":{"application/json":{"schema":{"type":"object","properties":{"scores":{"type":"array","items":{"type":"object","properties":{"userId":{"type":"string"},"username":{"type":"string"},"score":{"type":"number"},"timestamp":{"type":"number"}}}},"totalScores":{"type":"number"}}}}}},"400":{"$ref":"#/components/responses/400"}}},"post":{"operationId":"createLeaderboardScore","summary":"Create leaderboard score","description":"Create a score for the provided leaderboardId. Leaderboard scores can be provided for any user id when the app secret key authorization is provided. Alternatively, a user may submit their own scores by provided their session authorization, with a request body containing `score` and `hash`. A valid `hash` is intended to be generated for each score within the game client as sha256(leaderboardKey:userId:score).","tags":["Leaderboards"],"parameters":[{"$ref":"#/components/parameters/headerAuthorizationAppSecretOptional"},{"$ref":"#/components/parameters/headerAuthorizationSessionOptional"},{"$ref":"#/components/parameters/pathAppId"},{"$ref":"#/components/parameters/pathLeaderboardId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"userId":{"type":"string","description":"The user id to associate the score with."},"score":{"type":"number","description":"The score to submit. Can be any number."},"hash":{"type":"string","description":"The hash of the score when submitting with session authorization. Must be generated as a hash using sha256(leaderboardKey:userId:score)."}},"required":["score"]}}}},"responses":{"200":{"description":"Returns the created score.","content":{"application/json":{"schema":{"type":"object","properties":{"userId":{"type":"string"},"score":{"type":"number"},"timestamp":{"type":"number"}}}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"}}},"delete":{"operationId":"deleteLeaderboardScore","summary":"Delete leaderboard score","description":"Delete a score for the provided leaderboardId and userId.","tags":["Leaderboards"],"parameters":[{"$ref":"#/components/parameters/headerAuthorizationAppSecret"},{"$ref":"#/components/parameters/pathAppId"},{"$ref":"#/components/parameters/pathLeaderboardId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"userId":{"type":"string","description":"The user id to delete the score for."}},"required":["userId"]}}}},"responses":{"204":{"description":"Score deleted successfully."},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"}}}},"/v1/apps/{appId}/page":{"get":{"operationId":"getPage","summary":"Get page","description":"Get the HYPLAY page data for an app.","tags":["Promo Page"],"parameters":[{"$ref":"#/components/parameters/pathAppId"}],"responses":{"200":{"description":"Returns the HYPLAY page data for the app.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/AppModel"},{"type":"object","properties":{"iconImageAsset":{"$ref":"#/components/schemas/AssetModel"},"backgroundImageAsset":{"$ref":"#/components/schemas/AssetModel"},"logoImageAsset":{"$ref":"#/components/schemas/AssetModel"},"galleryMediaAssets":{"type":"array","items":{"$ref":"#/components/schemas/AssetModel"}},"preregister":{"type":"object","properties":{"visible":{"type":"boolean"},"incentiveText":{"type":"string"}}},"leaderboard":{"type":"object","properties":{"id":{"type":"string"},"visible":{"type":"boolean"}}},"referral":{"type":"object","properties":{"visible":{"type":"boolean"},"titleText":{"type":"string"},"incentiveText":{"type":"string"}}},"links":{"type":"array","items":{"type":"object","properties":{"text":{"type":"string"},"url":{"type":"string"}}}},"wallet":{"$ref":"#/components/schemas/WalletModel"},"totalUsers":{"type":"number"}}}]}}}},"400":{"$ref":"#/components/responses/400"}}},"patch":{"operationId":"updatePage","summary":"Update page","description":"Update the HYPLAY page data for an app.","tags":["Promo Page"],"parameters":[{"$ref":"#/components/parameters/headerAuthorizationUser"},{"$ref":"#/components/parameters/pathAppId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"preregisterVisible":{"type":"boolean","description":"Whether the pre-register section is visible."},"preregisterIncentiveText":{"type":"string","description":"The incentive text to display with the pre-register prompt."},"leaderboardId":{"type":"string","format":"uuid","description":"The id of the leaderboard to display."},"leaderboardVisible":{"type":"boolean","description":"Whether the leaderboard section is visible."},"referralVisible":{"type":"boolean","description":"Whether the referral section is visible."},"referralTitleText":{"type":"string","description":"The title text to display in the referral section."},"referralIncentiveText":{"type":"string","description":"The incentive text to display in the referral section."},"links":{"type":"array","items":{"type":"object","properties":{"text":{"type":"string"},"url":{"type":"string"}}}}}}}}},"responses":{"200":{"description":"Returns the updated HYPLAY page data for the app.","content":{"application/json":{"schema":{"type":"object","properties":{"preregister":{"type":"object","properties":{"visible":{"type":"boolean"},"incentiveText":{"type":"string"}}},"leaderboard":{"type":"object","properties":{"id":{"type":"string"},"visible":{"type":"boolean"}}},"referral":{"type":"object","properties":{"visible":{"type":"boolean"},"titleText":{"type":"string"},"incentiveText":{"type":"string"}}},"links":{"type":"array","items":{"type":"object","properties":{"text":{"type":"string"},"url":{"type":"string"}}}}}}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"}}}},"/v1/apps/{appId}/states":{"get":{"operationId":"getAppState","summary":"Get app state","description":"Get the public, protected, private state of an app, user or key.","tags":["Apps"],"parameters":[{"$ref":"#/components/parameters/pathAppId"},{"$ref":"#/components/parameters/queryStateKey"},{"$ref":"#/components/parameters/headerAuthorizationAppSecretOptional"},{"$ref":"#/components/parameters/headerAuthorizationSessionOptional"}],"responses":{"200":{"description":"Returns a state object that may contain public, protected, and/or private state for the app, key or user for the authorized user session.","content":{"application/json":{"schema":{"type":"object","properties":{"publicState":{"type":"object","description":"Public state data for the app or user."},"protectedState":{"type":"object","description":"Protected state data for the app or user."},"privateState":{"type":"object","description":"Private state data for the app or user."}},"required":["public","protected"]}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"}}},"post":{"operationId":"setAppState","summary":"Set app state","description":"Set arbitrary JSON blobs for public, protected and/or private state specific to an application or authorized user of an application. This is useful for saving different types of data specific to users or global configuration of your app or game in many different situations. It is intended to be highly flexible. State set for a user of your app, a unique lookup key, and the app itself are all isolated to your application. State storage is not globablly shared between applications.","tags":["Apps"],"parameters":[{"$ref":"#/components/parameters/pathAppId"},{"$ref":"#/components/parameters/headerAuthorizationAppSecretOptional"},{"$ref":"#/components/parameters/headerAuthorizationSessionOptional"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"key":{"type":"string","description":"Any unique lookup key for this data. This can be things such as a hyplay user id, an internal battle match id for your game, some arbitrary settings identifier for a system of your app and more. Keys are flexible ways to create string based lookup identifiers for data you want to store/lookup. Keys are unique to your application and are not shared globally."},"publicState":{"type":"object","description":"Public state data to set for the app or user.","additionalProperties":true},"protectedState":{"type":"object","description":"Protected state data to set for the app or user.","additionalProperties":true},"privateState":{"type":"object","description":"Private state data to set for the app or user.","additionalProperties":true},"overwrite":{"type":"boolean","description":"If true, the state will be overwritten with the provided state. If false or omitted, the state will be deep merged with the provided state."}}}}}},"responses":{"200":{"description":"Returns a state object that may contain public, protected, and/or private state for the app, or user of the app for the provided userId.","content":{"application/json":{"schema":{"type":"object","properties":{"publicState":{"type":"object","description":"Public state data for the app or user."},"protectedState":{"type":"object","description":"Protected state data for the app or user."},"privateState":{"type":"object","description":"Private state data for the app or user."}},"required":["publicState","protectedState"]}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"}}}},"/v1/apps/{appId}/teammates":{"get":{"operationId":"getAppTeammates","summary":"Get app teammates","description":"Get an array of teammates for the provided appId.","tags":["Apps"],"parameters":[{"$ref":"#/components/parameters/headerAuthorizationUser"},{"$ref":"#/components/parameters/pathAppId"}],"responses":{"200":{"description":"Returns an array of teammates.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/AppTeammateModel"},{"type":"object","properties":{"user":{"type":"object","properties":{"id":{"type":"string"},"username":{"type":"string"}}}}}]}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"}}},"post":{"operationId":"createAppTeammate","summary":"Create app teammate","description":"Create a teammate for the provided appId, userId and role. Authorized user must be the owner of the app, or be a teammate with a role of OWNER.","tags":["Apps"],"parameters":[{"$ref":"#/components/parameters/headerAuthorizationUser"},{"$ref":"#/components/parameters/pathAppId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"userId":{"type":"string","description":"The user id to add as a teammate of the app."},"role":{"type":"string","description":"The role of the teammate.","enum":["OWNER","DEVELOPER","EDITOR","ANALYST"]}},"required":["userId","role"]}}}},"responses":{"200":{"description":"Returns the created or existing teammate.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AppTeammateModel"}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"}}}},"/v1/apps/{appId}/teammates/{userId}":{"patch":{"operationId":"updateAppTeammate","summary":"Update app teammate","description":"Update the role of a teammate for the provided appId and userId. Authorized user must be the owner of the app, or be a teammate with a role of OWNER.","tags":["Apps"],"parameters":[{"$ref":"#/components/parameters/headerAuthorizationUser"},{"$ref":"#/components/parameters/pathAppId"},{"$ref":"#/components/parameters/pathUserId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"role":{"type":"string","description":"The role of the teammate.","enum":["OWNER","DEVELOPER","EDITOR","ANALYST"]}},"required":["role"]}}}},"responses":{"200":{"description":"Returns the updated teammate.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AppTeammateModel"}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"}}},"delete":{"operationId":"deleteAppTeammate","summary":"Delete app teammate","description":"Delete a teammate for the provided appId and userId. Authorized user must be the owner of the app, or be a teammate with a role of OWNER.","tags":["Apps"],"parameters":[{"$ref":"#/components/parameters/headerAuthorizationUser"},{"$ref":"#/components/parameters/pathAppId"},{"$ref":"#/components/parameters/pathUserId"}],"responses":{"204":{"description":"Teammate deleted successfully."},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"}}}},"/v1/apps/{appId}/users":{"get":{"operationId":"getAppUsers","summary":"Get app users","description":"Returns an array of public users objects representing users of the apps. A HYPLAY user is considered a user of the app if they have had at least 1 active session for the provided appId.","tags":["Apps"],"parameters":[{"$ref":"#/components/parameters/pathAppId"},{"$ref":"#/components/parameters/headerAuthorizationAppSecretOptional"},{"$ref":"#/components/parameters/queryCursor"}],"responses":{"200":{"description":"Returns an array of public user objects.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/UserModel"},{"type":"object","properties":{"wallet":{"$ref":"#/components/schemas/WalletModel"}}}]}}}},"400":{"$ref":"#/components/responses/400"}}}},"/v1/apps/{appId}/users/{userId}":{"get":{"operationId":"getAppUser","summary":"Get app user","description":"Returns a public user object representing a user of the app that also includes the `totalAppReferrals` property which represents the number of other users the user for the provided userId has referred to the provided appId.","tags":["Apps"],"parameters":[{"$ref":"#/components/parameters/pathAppId"},{"$ref":"#/components/parameters/pathUserId"}],"responses":{"200":{"description":"Returns a public user object that includes a `totalAppReferrals` property.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/UserModel"},{"type":"object","properties":{"wallet":{"$ref":"#/components/schemas/WalletModel"}}},{"type":"object","properties":{"totalAppReferrals":{"type":"integer"}}}]}}}},"400":{"$ref":"#/components/responses/400"}}}},"/v1/apps/{appId}/whitelist":{"get":{"operationId":"getWhitelist","summary":"Get whitelist","description":"Get the whitelist data for an app. Returns all data in lower case to simplify case insensitive matching.","tags":["Whitelist"],"parameters":[{"$ref":"#/components/parameters/headerAuthorizationUser"},{"$ref":"#/components/parameters/pathAppId"}],"responses":{"200":{"description":"Returns the whitelist data for the app.","content":{"application/json":{"schema":{"type":"object","properties":{"enabled":{"type":"boolean"},"userIds":{"type":"array","items":{"type":"string"}},"emails":{"type":"array","items":{"type":"string"}},"usernames":{"type":"array","items":{"type":"string"}}}}}}},"400":{"$ref":"#/components/responses/400"}}},"patch":{"operationId":"updateWhitelist","summary":"Update whitelist","description":"Update the whitelist data for an app. Existing values provided will be ignored to prevent duplicates in the list. All values are case-insensitive.","tags":["Whitelist"],"parameters":[{"$ref":"#/components/parameters/headerAuthorizationUser"},{"$ref":"#/components/parameters/pathAppId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"enabled":{"type":"boolean","description":"Whether the whitelist is enabled."},"userIds":{"type":"array","description":"User Ids to add to the whitelist.","items":{"type":"string"}},"emails":{"type":"array","description":"Emails to add to the whitelist.","items":{"type":"string"}},"usernames":{"type":"array","description":"Usernames to add to the whitelist.","items":{"type":"string"}}}}}}},"responses":{"200":{"description":"Returns the updated whitelist data for the app.","content":{"application/json":{"schema":{"type":"object","properties":{"enabled":{"type":"boolean"},"userIds":{"type":"array","items":{"type":"string"}},"emails":{"type":"array","items":{"type":"string"}},"usernames":{"type":"array","items":{"type":"string"}}}}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"}}},"delete":{"operationId":"deleteFromWhitelist","summary":"Delete from whitelist","description":"Delete entries from the whitelist for an app. All values are case-insensitive.","tags":["Whitelist"],"parameters":[{"$ref":"#/components/parameters/headerAuthorizationUser"},{"$ref":"#/components/parameters/pathAppId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"userIds":{"type":"array","description":"User Ids to add to the whitelist.","items":{"type":"string"}},"emails":{"type":"array","description":"Emails to add to the whitelist.","items":{"type":"string"}},"usernames":{"type":"array","description":"Usernames to add to the whitelist.","items":{"type":"string"}}}}}}},"responses":{"200":{"description":"Returns the updated whitelist data for the app.","content":{"application/json":{"schema":{"type":"object","properties":{"enabled":{"type":"boolean"},"userIds":{"type":"array","items":{"type":"string"}},"emails":{"type":"array","items":{"type":"string"}},"usernames":{"type":"array","items":{"type":"string"}}}}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"}}}},"/v1/assets":{"get":{"operationId":"getAssets","summary":"Get assets","description":"Returns an array of assets that have been uploaded by the authorized user ordered by most recent creation.","tags":["Assets"],"parameters":[{"$ref":"#/components/parameters/headerAuthorizationUser"}],"responses":{"200":{"description":"Returns an array of asset objects.","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AssetModel"}}}}},"400":{"$ref":"#/components/responses/400"}}},"post":{"operationId":"createAsset","summary":"Create asset","description":"Create an asset object by uploading a file in base64. Returns an asset object.","tags":["Assets"],"parameters":[{"$ref":"#/components/parameters/headerAuthorizationUser"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"fileBase64":{"type":"string","format":"byte","description":"The base64 string of the asset being uploaded. Uploads may not exceed 5mb."}}}}}},"responses":{"200":{"description":"Returns a created asset object.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssetModel"}}}},"400":{"$ref":"#/components/responses/400"}}}},"/v1/assets/{assetId}":{"get":{"operationId":"getAsset","summary":"Get asset","description":"Return an asset object that has been uploaded by the authorized user for the provided assetId.","tags":["Assets"],"parameters":[{"$ref":"#/components/parameters/pathAssetId"},{"$ref":"#/components/parameters/headerAuthorizationUser"}],"responses":{"200":{"description":"Returns an asset object.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssetModel"}}}},"400":{"$ref":"#/components/responses/400"}}}},"/v1/contracts":{"get":{"operationId":"getOwnedContracts","summary":"Get owned contracts","description":"Returned an array of contracts owned by the authorized user.","tags":["Contracts"],"parameters":[{"$ref":"#/components/parameters/headerAuthorizationUser"}],"responses":{"200":{"description":"Returns an array of contracts owned by the authorized user.","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ContractModel"}}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"}}},"post":{"operationId":"createContract","summary":"Create contract","description":"Deploy a new contract from a template, or import an already deployed contract. Deploying or importing a contract through this endpoint will create a new contract object within the HYPLAY system. Once created, you can then programmatically interact with the contract gaslessly as a user, app or through a user's session. Use HYPLAY's create transaction and read contract endpoints for interactions.","tags":["Contracts"],"parameters":[{"$ref":"#/components/parameters/headerAuthorizationAppSecretOptional"},{"$ref":"#/components/parameters/headerAuthorizationUserOptional"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"chain":{"type":"string","description":"The chain to deploy or import a contract on.","enum":["HYCHAIN","HYCHAIN_TESTNET","LOCAL"]},"templateId":{"type":"string","description":"The template id to deploy a contract for. Templates have pre-defined ABIs and bytecode, allowing quick deployment of contracts one or multiple times."},"args":{"type":"array","description":"An array of constructor arguments required by the contract template being deployed from. Only required if deploying a contract from a template that requires constructor arguments.","items":{"type":"string"}},"salt":{"type":"string","description":"A salt value as a hex string, prefixed with 0x. Only required if deploying a contract from a template as a user."},"nonce":{"type":"string","description":"A nonce value as a hex string, prefixed with 0x. Only required if deploying a contract from a template as a user."},"signatures":{"type":"array","description":"An array of authority signatures to use for the contract deployment. Only required if deploying a contract from a template as a user. Provided signature(s) must be generated by the authority wallet of a user by signing a properly formatted \"create request\" object. See the hychain-crypto-js library on NPM for convenience methods in generating these signatures and create request objects if necessary.","items":{"type":"string"}},"deadline":{"type":"integer","description":"The deadline for the contract deployment execution. This can be set to a unix timestamp in the future. Typically set this to 24 hours in the future. Only required if deploying a contract from a template as a user."},"abi":{"type":"string","format":"json","description":"JSON string of the contract's ABI when importing an already deployed contract."},"address":{"type":"string","description":"The address of a contract being imported. Only required when importing an already deployed contract."},"name":{"type":"string","description":"The contract's name. Used to help distinguish contracts from one another. Optional for deploys and imports."},"description":{"type":"string","format":"html","description":"A description of the contract and what it does. This is helpful to set as a reminder for what a contract is used for. Optional for deploys and imports."},"metadata":{"type":"string","format":"json","description":"A JSON object of metadata as a string for the contract. This is an arbitrary JSON blob and is only intended for storing public data related to the contract for any use case."}},"required":["chain"]}}}},"responses":{"200":{"description":"Successfully deployed or imported a contract. Created a new contract object. Returns a contract object.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContractModel"}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"}}}},"/v1/contracts/{contractId}":{"get":{"operationId":"getContract","summary":"Get contract","description":"Returns a contract object for the provided contractId.","tags":["Contracts"],"parameters":[{"$ref":"#/components/parameters/pathContractId"}],"responses":{"200":{"description":"Returns a contract object.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContractModel"}}}},"400":{"$ref":"#/components/responses/400"}}},"patch":{"operationId":"updateContract","summary":"Update contract","description":"Updates a contract owned by the authorized user for the provided contractId.","tags":["Contracts"],"parameters":[{"$ref":"#/components/parameters/headerAuthorizationUser"},{"$ref":"#/components/parameters/pathContractId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"abi":{"type":"string","format":"json","description":"JSON string of the contract's ABI."},"name":{"type":"string","description":"The contract's name. Named contracts are easier for users to identify during app or game authorization flows through HYPLAY."},"description":{"type":"string","description":"A description of the contract and what it does."},"metadata":{"type":"string","format":"json","description":"A JSON string of arbitrary metadata for the contract. May be used by developers for a variety of reasons."}}}}}},"responses":{"200":{"description":"Returns the updated contract object.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContractModel"}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"}}}},"/v1/contracts/{contractIdOrAddress}/read":{"get":{"operationId":"readContract","summary":"Read contract","description":"Get the value from a read function of a target contract. This endpoint is designed to be highly flexible. It can read any contract by providing a contract address for `contractIdOrAddress`. It can also read using contracts created in the HYCHAIN systems through the `POST /v1/contracts` endpoint, which will utilize the contract's ABI.\n\nAdditionally, reads can be performed as a HYCHAIN app, user or user's session provided, through header authorization, or any arbitrary address or walletId provided through the `as` query parameter. Alternatively you can omit all of this and perform a read as no specific address.\n\nThe `func` query parameter accepts a complete function signature with parameters, such as `getCount()` or `readCounter(address,uint256)`, or a known function name without parameters if a contractId was provided for `contractIdOrAddress` and the contract's ABI is known. Such as `readCounter`.","tags":["Contracts"],"parameters":[{"$ref":"#/components/parameters/pathContractIdOrAddress"},{"$ref":"#/components/parameters/headerAuthorizationAppSecretOptional"},{"$ref":"#/components/parameters/headerAuthorizationSessionOptional"},{"$ref":"#/components/parameters/headerAuthorizationUserOptional"},{"$ref":"#/components/parameters/queryChain"},{"$ref":"#/components/parameters/queryFunc"},{"$ref":"#/components/parameters/queryArgs"},{"$ref":"#/components/parameters/queryAs"}],"responses":{"200":{"description":"Returns the result of the contract read as a string.","content":{"application/json":{"schema":{"type":"string"}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"}}}},"/v1/sessions":{"post":{"operationId":"startSession","summary":"Start session","description":"Starts a new session for the authorized user for an app. All prior sessions between the user and target app will become invalidated. Operates through an oauth 2.0-like flow, allowing a `code` or `token` response type. Also supports optional whitelisted access through the app whitelist system.\n\nWhen invoked directly by developers, this endpoint should only be used to start guest sessions. Guest sessions automatically create a HYPLAY user internally that bypasses the standard HYPLAY OAuth flow in order to automatically create a temporary HYPLAY account that can later be upgraded to a standard account if the user desires. When using guest sessions, you must NOT pass the X-Authorization parameter.","tags":["Apps"],"parameters":[{"$ref":"#/components/parameters/headerAuthorizationUserOptional"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"appId":{"type":"string","description":"The id of the app to start a session for."},"referrerId":{"type":"string","description":"The id of the user that referred the user to the app."},"scopes":{"type":"array","description":"The scopes requested for the session.","items":{"type":"string","enum":["email"]}},"nativeAllowance":{"type":"string","description":"The maximum sum of $TOPIA that may be transferred during this session, as a wei string.","example":502124124124},"contractFunctionSelectors":{"type":"array","description":"The contracts and function selectors approved for this session.","items":{"type":"object","properties":{"address":{"type":"string","description":"Target contract's address."},"functionSelectors":{"type":"array","description":"An array of function signatures or bytes4 function selectors to approve.","items":{"type":"string"}}}}},"erc20Allowances":{"type":"array","description":"The erc20 tokens and the maximum amount that may be transferred during this session.","items":{"type":"object","properties":{"address":{"type":"string","description":"Target erc20's contract address."},"allowance":{"type":"string","description":"The maximum sum of this erc20 token that may be transferred during this session, as a wei string."}}}},"erc721Allowances":{"type":"array","description":"The erc721 token ids that may be transferred during this session.","items":{"type":"object","properties":{"address":{"type":"string","description":"Target erc721's contract address."},"approveAll":{"type":"boolean","description":"If true, app is allowed through this session to transfer all tokens of the user without limits."},"tokenIds":{"type":"array","description":"The token ids this session is allowed to transfer during this session.","items":{"type":"string"}}}}},"erc1155Allowances":{"type":"array","description":"The erc1155 token ids and the maximum amount of each unique id that may be transferred during this session.","items":{"type":"object","properties":{"address":{"type":"string","description":"Target erc1155's contract address."},"approveAll":{"type":"boolean","description":"If true, app is allowed through this session to transfer any amount of all tokens of the user without limits."},"tokenIds":{"type":"array","description":"The maximum sum of the token ids this session is allowed to transfer during this session.","items":{"type":"string"}},"allowances":{"type":"array","description":"The token id allowances this session is allowed to interact or transfer during this session.","items":{"type":"string"}}}}},"chain":{"type":"string","description":"The chain the session is to be started for.","enum":["HYCHAIN","HYCHAIN_TESTNET","LOCAL"]},"isGuest":{"type":"boolean","description":"If the session should create a guest user. This allows applications to enable guest login. A guest HYPLAY user account with a managed authority wallet is created behind the scenes. The guest account can be later upgraded to a standard HYPLAY self-custodied account if desired by the user. If isGuest is set to true, `nonce`, `signatures`, `deadline` and `expiresAt` should not be provided."},"nonce":{"type":"string","description":"A positive arbitrary integer as a string to be used as this session's nonce. Nonces are a one-time use per user. For example, User A and User B can both individually use nonce \"1\", but nonce \"1\", cannot be used again in the future for User A or User B to start a different session.","example":1},"signatures":{"type":"array","description":"An array of 1 or more session start signatures, generated by the authority(s) of a user's smart contract account. These signatures are most easily generated using the `hychain-crypto-js` npm package's `generateSessionSignature()`.","items":{"type":"string"}},"deadline":{"type":"number","description":"A timestamp in seconds of when the signature(s) for the session authorization request expire. If the deadline has been passed, attempting to start a session will fail."},"expiresAt":{"type":"number","description":"A timestamp in seconds when the session is to expire."},"responseType":{"type":"string","description":"The response type for session auth flows. If `code` is used, an accessToken will not be included, and a `exchangeCode` property will be included in the response object. This `exchangeCode` must then be exchanged using both the app's secret + exchange code to acquire the session access token. Alternatively, `token` can be used which returns a populated `accessToken` property in the response. This is less secure and essentially identical in usage for Oauth 2.0's implicit auth flow.","enum":["code","token"]}},"required":["appId","chain","responseType"]}}}},"responses":{"200":{"description":"Successfully started a new session. Returns a session object.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AppModel"}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"}}},"delete":{"operationId":"endSession","summary":"End session","description":"Ends all active sessions for a given user. This endpoint is flexible and can end sessions in a number of ways. An app can end any user's sessions of their app directly, or a user can end their own sessions for an app, or a session access token can be used to end its associated session.","tags":["Apps"],"parameters":[{"$ref":"#/components/parameters/headerAuthorizationUserOptional"},{"$ref":"#/components/parameters/headerAuthorizationSessionOptional"},{"$ref":"#/components/parameters/headerAuthorizationAppSecretOptional"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"appId":{"type":"string","description":"If the `X-App-Authorization` or `X-Session-Authorization` header is not set, `appId` must be provided to indicate the application for which to end user sessions for."},"userId":{"type":"string","description":"If the user's `X-Authorization` or `X-Session-Authorization` header is not set, `userId` must be provided to indicate the user for which to end sessions for."},"chain":{"type":"string","description":"The chain to end sessions for.","enum":["HYCHAIN","HYCHAIN_TESTNET","LOCAL"]}},"required":["chain"]}}}},"responses":{"204":{"description":"Returns an empty response indicating the session has been ended."},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"}}}},"/v1/sessions/token":{"post":{"operationId":"grantSessionToken","summary":"Grant session token","description":"Returns a session object with a valid access token when the associated exchangeCode and application authorized by using its secret key is provided.","tags":["Apps"],"parameters":[{"$ref":"#/components/parameters/headerAuthorizationAppSecret"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"exchangeCode":{"type":"string","description":"An unused exchange code associated with the provided session id. Exchange codes can only be used once and then become invalid."}},"required":["exchangeCode"]}}}},"responses":{"200":{"description":"Returns an updated session object with an `accessToken` set.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SessionModel"}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"}}}},"/v1/templates":{"get":{"operationId":"getTemplates","summary":"Get templates","description":"Returns an array of templates. Templates can be used to quickly deploy contracts to HYCHAIN and HYCHAIN_TESTNET. Templates can also be reviewed and approved by the HYPLAY team to be made available for anyone to deploy. Templates that are not approved can be deployed by anyone to HYCHAIN_TESTNET, and only deployed by the creator to HYCHAIN mainnet.","tags":["Contracts"],"parameters":[{"$ref":"#/components/parameters/queryUserId"},{"$ref":"#/components/parameters/queryTemplateName"},{"$ref":"#/components/parameters/queryTemplateApproved"}],"responses":{"200":{"description":"Returns an array of template objects.","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/TemplateModel"}}}}},"400":{"$ref":"#/components/responses/400"}}},"post":{"operationId":"createTemplate","summary":"Create template","description":"Creates a new template. Templates can be used to quickly deploy pre-approved types of contracts to HYCHAIN and HYCHAIN_TESTNET.","tags":["Contracts"],"parameters":[{"$ref":"#/components/parameters/headerAuthorizationUser"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"The name of the template."},"description":{"type":"string","format":"html","description":"A description of the template."},"solidity":{"type":"string","format":"html","description":"The solidity source code of the template to compile. This must be a flattened contract with all imports inlined."},"target":{"type":"string","description":"The contract from the inlined solidity source code that is intended to be deployed for this template.","example":"MyErc20Contract"}},"required":["name","solidity","target"]}}}},"responses":{"200":{"description":"Returns the created template object.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TemplateModel"}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"}}}},"/v1/templates/{templateId}":{"get":{"operationId":"getTemplate","summary":"Get template","description":"Returns a template object with abi, bytecode and compilation errors or warnings included.","tags":["Contracts"],"parameters":[{"$ref":"#/components/parameters/pathTemplateId"}],"responses":{"200":{"description":"Returns a template object.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TemplateModel"}}}},"400":{"$ref":"#/components/responses/400"}}}},"/v1/transactions":{"get":{"operationId":"getTransactions","summary":"Get transactions","description":"Returns an array of transactions for the provided appId, sessionId, userId or walletId. Transactions are returned in descending order of creation date.","tags":["Transactions"],"parameters":[{"$ref":"#/components/parameters/queryAppId"},{"$ref":"#/components/parameters/querySessionId"},{"$ref":"#/components/parameters/queryUserId"},{"$ref":"#/components/parameters/queryWalletId"},{"$ref":"#/components/parameters/queryChain"}],"responses":{"200":{"description":"Returns an array of transaction objects.","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/TransactionModel"}}}}},"400":{"$ref":"#/components/responses/400"}}},"post":{"operationId":"createTransaction","summary":"Create transaction","description":"Create and submit a transaction to the target contract id or address. Transactions are submitted on behalf of the authorization type used, such as an app, user or user via a user's session.\n\nTransaction submission supports contract function invocation and native transfers to contracts or externally owned accounts (EOAs).\n\nThis endpoint is designed to be highly flexible. Please refer to the HYCHAIN guides and documentation for detailed examples of the many ways this endpoint can be used.","tags":["Transactions"],"parameters":[{"$ref":"#/components/parameters/headerAuthorizationAppSecretOptional"},{"$ref":"#/components/parameters/headerAuthorizationSessionOptional"},{"$ref":"#/components/parameters/headerAuthorizationUserOptional"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"contractId":{"type":"string","description":"The contract id to target."},"address":{"type":"string","description":"The address to target."},"func":{"type":"string","description":"The function name or function signature of the contract."},"args":{"type":"array","description":"An array of arguments to pass to the function.","items":{"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}]}},"value":{"type":"number","description":"The amount of native token to send with the transaction."},"nonce":{"type":"string","description":"The nonce of the transaction."},"deadline":{"type":"number","description":"The deadline for the transaction as a timestamp in seconds."},"signatures":{"type":"array","description":"An array of signatures for the transaction.","items":{"type":"string"}},"chain":{"type":"string","description":"The chain the session is to be started for.","enum":["HYCHAIN","HYCHAIN_TESTNET","LOCAL"]}}}}}},"responses":{"200":{"description":"Returns a transaction object.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TransactionModel"}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"}}}},"/v1/transactions/{transactionId}":{"get":{"operationId":"getTransaction","summary":"Get transaction","description":"Returns a transaction object for the provided transactionId.","tags":["Transactions"],"parameters":[{"$ref":"#/components/parameters/pathTransactionId"}],"responses":{"200":{"description":"Returns a transaction object.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TransactionModel"}}}},"400":{"$ref":"#/components/responses/400"}}}},"/v1/users":{"get":{"operationId":"getUser","summary":"Get user","description":"Returns a public user object when provided a user id, username or wallet address.","tags":["Users"],"parameters":[{"$ref":"#/components/parameters/queryUserId"},{"$ref":"#/components/parameters/queryUsername"},{"$ref":"#/components/parameters/queryWalletAddress"}],"responses":{"200":{"description":"Returns a public user object.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/UserModel"},{"type":"object","properties":{"preregistered":{"type":"boolean"}}},{"type":"object","properties":{"wallet":{"$ref":"#/components/schemas/WalletModel"}}}]}}}},"400":{"$ref":"#/components/responses/400"}}}},"/v1/users/me":{"get":{"operationId":"getCurrentUser","summary":"Get current user","description":"Returns a public user object associated with the provided session access token.","tags":["Users"],"parameters":[{"$ref":"#/components/parameters/headerAuthorizationSession"}],"responses":{"200":{"description":"Returns a public user object.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/UserModel"},{"type":"object","properties":{"wallet":{"$ref":"#/components/schemas/WalletModel"}}}]}}}},"400":{"$ref":"#/components/responses/400"}}}},"/v1/wallets/{walletIdOrAddress}":{"get":{"operationId":"getWallet","summary":"Get wallet","description":"Returns a wallet object for the provided walletIdOrAddress. If walletIdOrAddress is a HYCHAIN system wallet id, it will return a matching wallet for the id. If walletIdOrAddress is a on chain smart contract wallet address, it will return a matching wallet from the HYCHAIN system. If a wallet is not found in HYCHAIN's systems for the address or walletId provided, a 400 error will be returned.","tags":["Wallets"],"parameters":[{"$ref":"#/components/parameters/pathWalletIdOrAddress"}],"responses":{"200":{"description":"Returns a wallet object.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/WalletModel"},{"type":"object","properties":{"mainnetRequiresUpgradeTo":{"type":"string","description":"The mainnet wallet implementation address to upgrade to if the wallet requires an upgrade, otherwise null if no upgrade required."},"testnetRequiresUpgradeTo":{"type":"string","description":"The testnet wallet implementation address to upgrade to if the wallet requires an upgrade, otherwise null if no upgrade required."},"localRequiresUpgradeTo":{"type":"string","description":"The local wallet implementation address to upgrade to if the wallet requires an upgrade, otherwise null if no upgrade required."}}}]}}}},"400":{"$ref":"#/components/responses/400"}}},"patch":{"operationId":"updateWallet","summary":"Update wallet","description":"Update various fields specific to a wallet. This endpoint is currently used for optining in to upgrade a user or application smart contract wallet to the latest implementation if necessary.","tags":["Wallets"],"parameters":[{"$ref":"#/components/parameters/pathWalletIdOrAddress"},{"$ref":"#/components/parameters/headerAuthorizationUser"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"chain":{"type":"string","description":"The chain to deploy or import a contract on.","enum":["HYCHAIN","HYCHAIN_TESTNET","LOCAL"]},"deadline":{"type":"number","description":"The deadline for the transaction as a timestamp in seconds."},"upgradeToLatest":{"type":"boolean","description":"If true, the wallet will be upgraded to the latest available wallet implementation for the provided chain."},"signatures":{"type":"array","description":"An array of signatures to authorize the upgrade.","items":{"type":"string"}}}}}}},"responses":{"200":{"description":"Returns a transaction object.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TransactionModel"}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"}}}},"/v1/wallets/{walletIdOrAddress}/balance":{"get":{"operationId":"getWalletBalance","summary":"Get wallet balance","description":"Returns the native token balance for the smart contract wallet associated with a wallet id provided for walletIdOrAddress. Or, if any address is provided for walletIdOrAddress, it will return the native token balance for the address.","tags":["Wallets"],"parameters":[{"$ref":"#/components/parameters/pathWalletIdOrAddress"},{"$ref":"#/components/parameters/queryChain"}],"responses":{"200":{"description":"Returns the native token balance for the wallet in readable string format. For example a 1e18 balance would be '1.0'.","content":{"application/json":{"schema":{"type":"string"}}}},"400":{"$ref":"#/components/responses/400"}}}}}} \ No newline at end of file