{"_id":"@aqua.xyz/games-identity-sdk","_rev":"2-7b10f45a09fe9d209f05d189ae3c610b","name":"@aqua.xyz/games-identity-sdk","dist-tags":{"latest":"1.0.21"},"versions":{"1.0.19":{"name":"@aqua.xyz/games-identity-sdk","packageManager":"yarn@3.2.4","version":"1.0.19","description":"A typescript library using aqua identity authentication.","main":"dist/index.js","module":"dist/index.mjs","typings":"dist/index.d.ts","type":"module","scripts":{"clean":"rm -rf dist/","eslint":"eslint --cache --fix ./src","eslint:check":"eslint ./src","build":"rollup -c --configPlugin @rollup/plugin-typescript","prettier":"prettier --write ./src","production":"npm run version:bump --silent && npm run version:add --silent"},"author":"","license":"ISC","dependencies":{"events":"^3.1.0","query-string":"^6.12.1","rollup-plugin-summary":"^2.0.0"},"devDependencies":{"@rollup/plugin-commonjs":"24.0.1","@rollup/plugin-node-resolve":"15.0.1","@rollup/plugin-terser":"0.4.0","@rollup/plugin-typescript":"11.0.0","@tsconfig/node14":"^1.0.3","@types/events":"^3.0.0","@typescript-eslint/eslint-plugin":"^5.46.1","@typescript-eslint/parser":"^5.47.0","esbuild":"^0.17.12","eslint":"8.34.0","eslint-config-prettier":"^8.6.0","eslint-plugin-import":"^2.26.0","eslint-plugin-promise":"^6.1.1","prettier":"2.8.3","rollup":"^3.19.1","rollup-plugin-dts":"^5.2.0","rollup-plugin-esbuild":"^5.0.0","typescript":"^4.9.4"},"types":"./dist/index.d.ts","repository":{"type":"git","url":"git+https://github.com/aquaxyz/games-identity-sdk.git"},"keywords":["aquaxyz","games-identity"],"bugs":{"url":"https://github.com/aquaxyz/games-identity-sdk/issues"},"homepage":"https://github.com/aquaxyz/games-identity-sdk#readme","gitHead":"d191d85542edec3f7424ded9f0f48ef595bd93e0","_id":"@aqua.xyz/games-identity-sdk@1.0.19","_nodeVersion":"19.4.0","_npmVersion":"9.2.0","dist":{"integrity":"sha512-+lC5xRH44CPZZbP61S2W5upmqbc0bDle9uJkBug9khy8J3sRrkm8kXJ6xxjEaMrI/eSJ8ZXOdaBr3PXP4M9GeQ==","shasum":"9515e6196b5d3924c23bc73efb8554cebf4b5d4b","tarball":"https://registry.npmjs.org/@aqua.xyz/games-identity-sdk/-/games-identity-sdk-1.0.19.tgz","fileCount":24,"unpackedSize":124016,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAjo9+kF7L/nBxxqw2fzpF3HgMKhRzieR2Uhp5zije/HAiBR5y0YUqPhlr1ZiuQOM1eeF0HcUuRr6jAn/eEhoRQsQg=="}]},"_npmUser":{"name":"denisapopa","email":"denisa@aqua.xyz"},"directories":{},"maintainers":[{"name":"aquaxyz","email":"engineering@aqua.xyz"},{"name":"denisapopa","email":"denisa@aqua.xyz"},{"name":"razvan.aqua","email":"razvan@aqua.xyz"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/games-identity-sdk_1.0.19_1684241208902_0.973262681808106"},"_hasShrinkwrap":false},"1.0.20":{"name":"@aqua.xyz/games-identity-sdk","packageManager":"yarn@3.2.4","version":"1.0.20","description":"A typescript library using aqua identity authentication.","main":"dist/index.js","module":"dist/index.mjs","typings":"dist/index.d.ts","type":"module","scripts":{"clean":"rm -rf dist/","eslint":"eslint --cache --fix ./src","eslint:check":"eslint ./src","build":"rollup -c --configPlugin @rollup/plugin-typescript","prettier":"prettier --write ./src","production":"npm run version:bump --silent && npm run version:add --silent"},"author":"","license":"ISC","dependencies":{"events":"^3.1.0","query-string":"^6.12.1","rollup-plugin-summary":"^2.0.0"},"devDependencies":{"@rollup/plugin-commonjs":"24.0.1","@rollup/plugin-node-resolve":"15.0.1","@rollup/plugin-terser":"0.4.0","@rollup/plugin-typescript":"11.0.0","@tsconfig/node14":"^1.0.3","@types/events":"^3.0.0","@typescript-eslint/eslint-plugin":"^5.46.1","@typescript-eslint/parser":"^5.47.0","esbuild":"^0.17.12","eslint":"8.34.0","eslint-config-prettier":"^8.6.0","eslint-plugin-import":"^2.26.0","eslint-plugin-promise":"^6.1.1","prettier":"2.8.3","rollup":"^3.19.1","rollup-plugin-dts":"^5.2.0","rollup-plugin-esbuild":"^5.0.0","typescript":"^4.9.4"},"types":"./dist/index.d.ts","repository":{"type":"git","url":"git+https://github.com/aquaxyz/games-identity-sdk.git"},"keywords":["aquaxyz","games-identity"],"bugs":{"url":"https://github.com/aquaxyz/games-identity-sdk/issues"},"homepage":"https://github.com/aquaxyz/games-identity-sdk#readme","gitHead":"4df5397ceac90cc322b3cf6b7474431e932522fd","_id":"@aqua.xyz/games-identity-sdk@1.0.20","_nodeVersion":"19.4.0","_npmVersion":"9.2.0","dist":{"integrity":"sha512-9ZYfncqL115uU+Qp65hKhtkzXssh8h/3fwvL+oy24jEj+Xv2+258D3/aDait4v5+UxkLMr31L6fp6T71mSJU8Q==","shasum":"088bf7132212c876e4674c266060b24100c69768","tarball":"https://registry.npmjs.org/@aqua.xyz/games-identity-sdk/-/games-identity-sdk-1.0.20.tgz","fileCount":24,"unpackedSize":124016,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC65JegQ33CCO0tqs+Vad0jT0XZcW+ZCP8YnTLNQcyomQIgDm6p5Na/WxUcuPO+HIrIvc6JSIT9hycu4OfcIOzAQqk="}]},"_npmUser":{"name":"denisapopa","email":"denisa@aqua.xyz"},"directories":{},"maintainers":[{"name":"aquaxyz","email":"engineering@aqua.xyz"},{"name":"denisapopa","email":"denisa@aqua.xyz"},{"name":"razvan.aqua","email":"razvan@aqua.xyz"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/games-identity-sdk_1.0.20_1684495406505_0.2237460965648017"},"_hasShrinkwrap":false},"1.0.21":{"name":"@aqua.xyz/games-identity-sdk","packageManager":"yarn@3.2.4","version":"1.0.21","description":"A typescript library using aqua identity authentication.","main":"dist/index.js","module":"dist/index.mjs","typings":"dist/index.d.ts","type":"module","scripts":{"clean":"rm -rf dist/","eslint":"eslint --cache --fix ./src","eslint:check":"eslint ./src","build":"rollup -c --configPlugin @rollup/plugin-typescript","prettier":"prettier --write ./src","production":"npm run version:bump --silent && npm run version:add --silent"},"author":"","license":"ISC","dependencies":{"events":"^3.1.0","query-string":"^6.12.1","rollup-plugin-summary":"^2.0.0"},"devDependencies":{"@rollup/plugin-commonjs":"24.0.1","@rollup/plugin-node-resolve":"15.0.1","@rollup/plugin-terser":"0.4.0","@rollup/plugin-typescript":"11.0.0","@tsconfig/node14":"^1.0.3","@types/events":"^3.0.0","@typescript-eslint/eslint-plugin":"^5.46.1","@typescript-eslint/parser":"^5.47.0","esbuild":"^0.17.12","eslint":"8.34.0","eslint-config-prettier":"^8.6.0","eslint-plugin-import":"^2.26.0","eslint-plugin-promise":"^6.1.1","prettier":"2.8.3","rollup":"^3.19.1","rollup-plugin-dts":"^5.2.0","rollup-plugin-esbuild":"^5.0.0","typescript":"^4.9.4"},"types":"./dist/index.d.ts","repository":{"type":"git","url":"git+https://github.com/aquaxyz/games-identity-sdk.git"},"keywords":["aquaxyz","games-identity"],"bugs":{"url":"https://github.com/aquaxyz/games-identity-sdk/issues"},"homepage":"https://github.com/aquaxyz/games-identity-sdk#readme","gitHead":"4c873430ea4281f21399cd1eb58fc88b6dd21b65","_id":"@aqua.xyz/games-identity-sdk@1.0.21","_nodeVersion":"19.4.0","_npmVersion":"9.2.0","dist":{"integrity":"sha512-lxZE7IKuXLMtMioHxebFJpvSJpfFvLO5OKIjE51Rjl8fVNtRZnrfdmyDjk4k9CeZMewYUuupKe0nE9T1b2np0Q==","shasum":"7bc375d6de8791c63690636d1519cb1a5b3ec33c","tarball":"https://registry.npmjs.org/@aqua.xyz/games-identity-sdk/-/games-identity-sdk-1.0.21.tgz","fileCount":24,"unpackedSize":124495,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCuEhTQt8bhv1GpdB3Tx3BSeLFtfEEFLAE6F+Zqv7XLugIhAIN2MO8W6GGrfgX9+V2xsRLhke4vSmxw1XpxLY+MILYu"}]},"_npmUser":{"name":"denisapopa","email":"denisa@aqua.xyz"},"directories":{},"maintainers":[{"name":"aquaxyz","email":"engineering@aqua.xyz"},{"name":"denisapopa","email":"denisa@aqua.xyz"},{"name":"razvan.aqua","email":"razvan@aqua.xyz"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/games-identity-sdk_1.0.21_1686120927062_0.7172538920779687"},"_hasShrinkwrap":false}},"time":{"created":"2023-05-16T12:46:48.824Z","1.0.19":"2023-05-16T12:46:49.079Z","modified":"2023-06-07T06:55:27.435Z","1.0.20":"2023-05-19T11:23:26.693Z","1.0.21":"2023-06-07T06:55:27.291Z"},"maintainers":[{"name":"aquaxyz","email":"engineering@aqua.xyz"},{"name":"denisapopa","email":"denisa@aqua.xyz"},{"name":"razvan.aqua","email":"razvan@aqua.xyz"}],"description":"A typescript library using aqua identity authentication.","homepage":"https://github.com/aquaxyz/games-identity-sdk#readme","keywords":["aquaxyz","games-identity"],"repository":{"type":"git","url":"git+https://github.com/aquaxyz/games-identity-sdk.git"},"bugs":{"url":"https://github.com/aquaxyz/games-identity-sdk/issues"},"license":"ISC","readme":"# @aqua.xyz/games-identity-sdk\n\nA typescript library using aqua identity authentication.\n\n## Installation\n\n### Using yarn\n\n```sh\n# Using yarn\n$ yarn add @aqua.xyz/games-identity-sdk\n\n# Using npm\n$ npm install @aqua.xyz/games-identity-sdk\n```\n\n### Example usage\n\n```js\nimport {\n  AquaIdentitySDK,\n  Environment,\n  EVENTS,\n  NFTTypes,\n} from \"@aqua.xyz/games-identity-sdk\";\n\n```\n\n#### Production Mode\n```js\nconst aquaIdentity = new AquaIdentitySDK({\n  environment: Environment.PRODUCTION,\n});\n```\n\n```js\nconst login = async () => {\n  await aquaIdentity.login({ isLandscape: true });\n};\n\nconst logout = async () => {\n  await aquaIdentity.logout();\n};\n\nconst getWalletAddress = async () => {\n  await aquaIdentity.getWalletAddress();\n};\n\nconst isNFTAwarded = async () => {\n  await aquaIdentity.isNFTAwarded({\n    nftType: NFTTypes.SKIP, // NFTTypes.SLOWDOWN  ||  NFTTypes.SKIP  || NFTType.REDO\n  });\n};\n\nconst awardNFT = async () => {\n  await aquaIdentity.awardNFT({\n    nftType: NFTTypes.SLOWDOWN, // NFTTypes.SLOWDOWN  ||  NFTTypes.SKIP  || NFTType.REDO\n  });\n};\n\nconst verifyUserIdentity = async () => {\n    await aquaIdentity.verifyUserIdentity({\n        walletAddress: YOUR_WALLET_ADDRESS, // Replace YOUR_WALLET_ADDRESS with the wallet address that needs to be verified\n        jwtToken: YOUR_TOKEN // Replace YOUR_TOKEN with the jwt token\n\n    })\n}\n\nconst getOwnedDetailedNFTs = async () => {\n    await aquaIdentity.getOwnedDetailedNFTs({\n        walletAddress: YOUR_WALLET_ADDRESS // Replace YOUR_WALLET_ADDRESS with your wallet address\n    })\n}\n\nconst getAwardedDetailedNFTs = async () => {\n    await aquaIdentity.getAwardedDetailedNFTs({\n        walletAddress: YOUR_WALLET_ADDRESS // Replace YOUR_WALLET_ADDRESS with your wallet address\n    })\n}\n\n// ------- Example usage in game logic to retrieve the list of owned NFTs -------\nconst nftsList = await retrieveNFTList();\n\n// Response would contain the NFTs the user already owns:\nnftsList = [\n  NFTTypes.SKIP,\n  NFTTypes.REDO,\n  NFTTypes.SLOWDOWN\n];\n\n// ------- Example usage in game logic to award the SLOWDOWN NFT on first game win -------\nif (playerWonFirstGameInLudo) {\n  const hasNFTBeenAwarded = await isNFTAwarded({ nftType: NFTTypes.SLOWDOWN });\n\n  if (!hasNFTBeenAwarded) {\n    // The \"slowdown\" NFT is not owned by the current logged in user\n\n    await awardNFT({ nftType: NFTTypes.SLOWDOWN }); // Awarding \"slowdown\" NFT to the current logged in user\n \n    // Game displays awarding message - example: \"Congrats, you won the \"slowdown\" NFT\n  } else {\n    // Game should not display the awarding message, if the NFT has been already awarded by winning a first match in a different game\n  }\n}\n\naquaIdentity.on(EVENTS.AQUA_IDENTITY_MODAL_CLOSE, () => {\n  // When this gets triggered, that means that login, getWalletAddress or \n  // logout methods finished the execution\n  // It means that everything is stored on aqua.xyz and here is the \n  // place where you may want to manage your local state, update or remove state\n});\n\naquaIdentity.on(EVENTS.AQUA_IDENTITY_SUCCESSFULLY_LOG_IN, (event) => {\n  // Example of response\n  // event = { \n  //   \"data\": {\n  //     \"isLoggedIn\": true,\n  //     \"jwtToken\":  \"sfsaxewgwdsf...\",\n  //     \"walletAddress\": \"0xewgwt34...\",\n  //     \"profile\": {\n  //        \"username\":\"John\",\n  //        \"avatar\": \"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0...\"\n  //     },\n  //     \"nftList\": [\n  //         \"skip\",\n  //         \"redo\",\n  //         \"slowdown\"\n  //     ],\n  //     \"nfts\": {\n  //        0: 1,\n  //        1: 0,\n  //        2: 0,\n  //      }\n  //   }\n  //   }\n  // }\n  console.log(\"AQUA_IDENTITY_SUCCESSFULLY_LOG_IN\", event.data);\n});\n\naquaIdentity.on(EVENTS.AQUA_IDENTITY_SUCCESSFULLY_LOG_OUT, () => {\n  // Example of response\n  // event = { \n  //   \"data\": {\n  //     \"isLogout\": true\n  //   }\n  // }\n  console.log(\"SUCCESSFULLY_LOG_OUT\");\n});\n\naquaIdentity.on(EVENTS.AQUA_IDENTITY_WALLET_ADDRESS, (event) => {\n  // Example of response\n  // event = { \n  //   \"data\": {\n  //     \"isLoggedIn\": true,\n  //     \"jwtToken\":  \"sfsaxewgwdsf...\",\n  //     \"walletAddress\": \"0xewgwt34...\",\n  //     \"profile\": {\n  //        \"username\":\"John\",\n  //        \"avatar\": \"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0...\"\n  //     },\n  //     \"nftList\": [\n  //         \"skip\",\n  //         \"redo\",\n  //         \"slowdown\"\n  //     ],\n  //     \"nfts\": {\n  //        0: 1,\n  //        1: 0,\n  //        2: 0,\n  //      }\n  //   }\n  //   }\n  // }\n  console.log(\"SUCCESSFULLY_RETRIEVED_WALLET_ADDRESS\", event);\n});\n\naquaIdentity.on(EVENTS.AQUA_IDENTITY_VERIFY_USER_IDENTITY, (event) => {\n  // Example of response\n  // event = { \n  //   \"data\": {\n  //     \"valid\": true,\n  //     \"walletAddress\": \"0xewgwt34...\",\n  //   }\n  // }\n  console.log(\"SUCCESSFULLY_VERIFIED_USER\");\n});\n\naquaIdentity.on(EVENTS.AQUA_IDENTITY_IS_NFT_AWARDED, (event) => {\n  // Example of response\n  // event = { \n  //   \"data\": {\n  //     \"valid\": true\n  //   }\n  // }\n  console.log(\"SUCCESSFULLY_VALIDATE_NFT_OWNERSHIP\", event);\n});\n\naquaIdentity.on(EVENTS.AQUA_IDENTITY_AWARD_NFT, (event) => {\n  // Example of response\n  // event = { \n  //   \"data\": {\n  //     \"valid\": true\n  //   }\n  // }\n  console.log(\"SUCCESSFULLY_AWARD_NFT\", event);\n});\n\naquaIdentity.on(EVENTS.AQUA_IDENTITY_RETRIEVE_NFT_LIST, (event) => {\n  // Example of response\n  // event = { \n  //   \"data\": {\n  //     \"nftList\": ['skip']\n  //   }\n  // }\n  console.log(\"SUCCESSFULLY_AQUA_IDENTITY_RETRIEVE_NFT_LIST\", event);\n});\n\naquaIdentity.on(EVENTS.AQUA_IDENTITY_OWNED_NFTS_DETAILS, (event) => {\n  // Example of response\n  // event = { \n  //   \"data\": {\n  //     \"nfts\": {\n  //        0: 1,\n  //        1: 0,\n  //        2: 0,\n  //      }\n  //   }\n  // }\n  console.log(\"SUCCESSFULLY_RETRIEVE_OWNED_NFTS_DETAILS\", event);\n});\naquaIdentity.on(EVENTS.AQUA_IDENTITY_AWARDED_NFTS_DETAILS, (event) => {\n  // Example of response\n  // event = { \n  //   \"data\": {\n  //     \"nfts\": {\n  //        0: 1,\n  //        1: 0,\n  //        2: 0,\n  //      }\n  //   }\n  // }\n  console.log(\"SUCCESSFULLY_RETRIEVE_AWARDED_NFTS_DETAILS\", event);\n});\n```\n\n### Environments\n\n#### Development\n\nFor the `DEVELOPMENT` environment, the local server will run on `https://new-prod-aqua.netlify.app:8080/`.\n\n#### Production\nFor the `PRODUCTION` environment, the local server will run on `https://games.aqua.xyz:8080/`.\n\n","readmeFilename":"README.md"}