{"_id":"@duhd4h/global-profile-sdk","_rev":"4-471ede58e6e35fbc2fcd9c6ae871b127","name":"@duhd4h/global-profile-sdk","dist-tags":{"latest":"0.1.11"},"versions":{"0.1.7":{"name":"@duhd4h/global-profile-sdk","version":"0.1.7","main":"dist/index.cjs.js","module":"dist/index.esm.js","types":"dist/index.d.ts","license":"MIT","private":false,"repository":{"type":"git","url":"git+https://github.com/Global-Repo/global-uikit.git#master"},"scripts":{"build":"rm -rf ./dist && rollup -c && tsc -d --emitDeclarationOnly --declarationDir dist","start":"yarn build && node ./dist","test":"jest","test:coverage":"jest --collectCoverage","lint":"eslint 'src/**/*.{js,jsx,ts,tsx}'","format:check":"prettier --check --loglevel error 'src/**/*.{js,jsx,ts,tsx}'","format:write":"prettier --write 'src/**/*.{js,jsx,ts,tsx}'"},"devDependencies":{"@babel/preset-env":"^7.13.15","@babel/preset-typescript":"^7.13.0","@rollup/plugin-commonjs":"^18.0.0","@rollup/plugin-image":"^2.0.6","@rollup/plugin-node-resolve":"^11.2.1","@types/jest":"^26.0.22","@types/node":"^14.14.39","babel-jest":"^26.6.3","graphql":"^15.5.0","graphql-request":"^3.4.0","jest":"^26.6.3","msw":"^0.28.1","node-fetch":"^2.6.1","ts-jest":"^26.5.4","web3":"^1.3.5","web3-eth-contract":"^1.3.5","web3-utils":"^1.3.5"},"peerDependencies":{"graphql":"^15.5.0","graphql-request":"^3.4.0","web3":">=1.3.5","web3-eth-contract":"=>1.3.5","web3-utils":">=1.3.5"},"dependencies":{"@types/js-cookie":"^2.2.6","js-cookie":"^2.2.1"},"gitHead":"637ff8a6c6444700eb2191516bc4df56451e2ca8","description":"This package provides some handy functions to retrieve data for Pancakeswap Profile system.","bugs":{"url":"https://github.com/Global-Repo/global-uikit/issues"},"homepage":"https://github.com/Global-Repo/global-uikit/tree/master#readme","_id":"@duhd4h/global-profile-sdk@0.1.7","_nodeVersion":"14.17.1","_npmVersion":"7.18.1","dist":{"integrity":"sha512-EMmYxV9+BGjCzgzmimZ6RO0eMbY5HguIPy/Hek9xewCQJO4x/dsXEbIz4Zl52FYmf3SKAl6AeBdOPYDGmqTF4g==","shasum":"e47bb42df2179de62964412c59bb8b4657e16f6d","tarball":"https://registry.npmjs.org/@duhd4h/global-profile-sdk/-/global-profile-sdk-0.1.7.tgz","fileCount":70,"unpackedSize":1019989,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg1SRKCRA9TVsSAnZWagAAOQ8QAJeavAAboApOM1wTzIGp\nVL4VhrvPnoRLpIf2WhpRA4ehdQRGu7KcoyoPu7uGLvg9Y30Scx8LCQeJUJu4\n0Qy13GswjmFhfV2Ihz7X84IeD5ZxHlJ9dZ5Z78169Gbc500b/66LFsqbPkW8\nNT9VG+FUNTyR/zTqg0fRDD64MiZ/3JBAjqBmtnRWnSO7mNXcAJdMTz0r2M4Q\njHMHhP7JqNtTtqAk4QK0RVXmiB8vcjTTfZOtf3uP51hbCJ+NQGIMleGttzf1\nGe6EPDEiNMielEIsargU3noYIAlcar6TxJYqOVF7c4G8LhnklmnsDv+6iLbC\npIOOi6NHRPfmKcLRVpYEHxhfJy08FzYOraFhfildZ0KNpoF3cKtJUettOeNK\nteZVkuFQ9pYOH+14EieMUQkPkPBwa4swO6rg/3ysnaO1QJcXxrVopMw1FHXf\nmNQgcdw0q5o06w2BydSoLHYbNjnrwLh6Q4lgjsoToTWJpgAPsDU8VyBl3h7L\nCmgb2xGEP3/9iFVUkzdir5auhwk8a7iL/0g5UafkbUGmBStqD2fQyGc6O6Ti\nRoFrvHaIa5DQNoVx3InRTKKpzb9lzyaIkY7JypKMBp57LZU7A3XTFeUS1ZPQ\nFQ69B+mzk2uBev0ayeYPBsQdzd2YJ156e5P5jjYRgskEfBOWDzOo0gXea+0t\nlD2y\r\n=rhEc\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICJJNAmHQ3BrnrAzuQY5v9pySWp7xZrpTHgO5dKUay4WAiAnFjUgU8ZZfN39Df21IYOf8+nWp8aVm4ufdmt6E/3Bfg=="}]},"_npmUser":{"name":"duhd4h","email":"duhd4h@gmail.com"},"directories":{},"maintainers":[{"name":"duhd4h","email":"duhd4h@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/global-profile-sdk_0.1.7_1624581193897_0.24370193691645148"},"_hasShrinkwrap":false},"0.1.8":{"name":"@duhd4h/global-profile-sdk","version":"0.1.8","main":"dist/index.cjs.js","module":"dist/index.esm.js","types":"dist/index.d.ts","license":"MIT","private":false,"repository":{"type":"git","url":"git+https://github.com/Global-Repo/global-uikit.git#master"},"scripts":{"build":"rm -rf ./dist && rollup -c && tsc -d --emitDeclarationOnly --declarationDir dist","start":"yarn build && node ./dist","test":"jest","test:coverage":"jest --collectCoverage","lint":"eslint 'src/**/*.{js,jsx,ts,tsx}'","format:check":"prettier --check --loglevel error 'src/**/*.{js,jsx,ts,tsx}'","format:write":"prettier --write 'src/**/*.{js,jsx,ts,tsx}'"},"devDependencies":{"@babel/preset-env":"^7.13.15","@babel/preset-typescript":"^7.13.0","@rollup/plugin-commonjs":"^18.0.0","@rollup/plugin-image":"^2.0.6","@rollup/plugin-node-resolve":"^11.2.1","@types/jest":"^26.0.22","@types/node":"^14.14.39","babel-jest":"^26.6.3","graphql":"^15.5.0","graphql-request":"^3.4.0","jest":"^26.6.3","msw":"^0.28.1","node-fetch":"^2.6.1","ts-jest":"^26.5.4","web3":"^1.3.5","web3-eth-contract":"^1.3.5","web3-utils":"^1.3.5"},"peerDependencies":{"graphql":"^15.5.0","graphql-request":"^3.4.0","web3":">=1.3.5","web3-eth-contract":"=>1.3.5","web3-utils":">=1.3.5"},"dependencies":{"@types/js-cookie":"^2.2.6","js-cookie":"^2.2.1"},"gitHead":"fee04578fc4347f454394c9369be4c9edcf6cacd","description":"This package provides some handy functions to retrieve data for Pancakeswap Profile system.","bugs":{"url":"https://github.com/Global-Repo/global-uikit/issues"},"homepage":"https://github.com/Global-Repo/global-uikit/tree/master#readme","_id":"@duhd4h/global-profile-sdk@0.1.8","_nodeVersion":"14.17.1","_npmVersion":"lerna/4.0.0/node@v14.17.1+x64 (darwin)","dist":{"integrity":"sha512-Y3vDQDyAGFnWSnmtF+MpFetZDDw/MzOOq2WNkfA9qMEgwBYvPwvWFMtGwM6u1+YpxZIxjiDaThR96LqWe631Yg==","shasum":"7a9ac85bd0d42f2470ed109574dda27aaa8de960","tarball":"https://registry.npmjs.org/@duhd4h/global-profile-sdk/-/global-profile-sdk-0.1.8.tgz","fileCount":70,"unpackedSize":1020248,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg1S5hCRA9TVsSAnZWagAAoJQP/RBlPpPv8WGIshjA7Hzz\nBI98/Wy0Y9qP2oJYxUz6TOIT7YyoJ2hbiCfV0GCtpBF5A6rGsNBtAg3T6ab8\n+ISI/XED2kBwTyme6oAgxlfhO8XB1Ib/Xrlwar+Pi/50vtj4RhtXk3iQ+6Ex\ncjG6pC6yBCjm+bXkI1FaGG44giTQ9UtAkgqtUe9GIyaAj0XhLDDUsq8tyUD0\n+q3/QOV/2Xo/wf3JWK6Wmw1+BoYVfKgSd4+IQ/PyxaGMWLM2H65e6nVYqbhB\n2UQ739Q4pRPPs+8uZ+hXLhotqn/7cDlyj+vU8DHBOFxS4ydHrwPwRylrfNie\nP0bDo9nkpIomflkMSevAHaOnU2p3ZXAyHK6LsNKQj+Pvgr5jLuaO5wEb0M/s\njBEuxlVAGLWozQwlgSSv2zp97HDbeUH2Fw6ZWGGvCawhmxE3Z4mG75X7xJ64\nVNWQnzNdTbzwWo8MXyor41mkwtMznMxZbpduT3tSnpQlUWKCnc53URRzA6Ec\nk7zSoofcorwgu3uRY9Cr4beIG2uJ9e1IJe+HsNlWhFgcx2vsc8idDN+mOX39\n2gXpl+qawsTXS6Thw+FTtLu2zDdFnh9fL5NuahdEZZHYjicpuCdXPn/m86wq\n4mWfn3PygUE0icfD9chyjkzzARtJz/E0Lb4IimXgbXrTFzgISkorQpN2eY70\nvFJq\r\n=MPDN\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIG7SxdZ88ZaHSXQOODrEuuu6Osck0Y3oUnnBOzslKE4XAiEA769CyWFIAsZlJtS0/zuvnjwrRz0d3q2LMtvHbnOEFcw="}]},"_npmUser":{"name":"duhd4h","email":"duhd4h@gmail.com"},"directories":{},"maintainers":[{"name":"duhd4h","email":"duhd4h@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/global-profile-sdk_0.1.8_1624583777438_0.6686466889066724"},"_hasShrinkwrap":false},"0.1.9":{"name":"@duhd4h/global-profile-sdk","version":"0.1.9","main":"dist/index.cjs.js","module":"dist/index.esm.js","types":"dist/index.d.ts","license":"MIT","private":false,"repository":{"type":"git","url":"git+https://github.com/Global-Repo/global-uikit.git#master"},"scripts":{"build":"rm -rf ./dist && rollup -c && tsc -d --emitDeclarationOnly --declarationDir dist","start":"yarn build && node ./dist","test":"jest","test:coverage":"jest --collectCoverage","lint":"eslint 'src/**/*.{js,jsx,ts,tsx}'","format:check":"prettier --check --loglevel error 'src/**/*.{js,jsx,ts,tsx}'","format:write":"prettier --write 'src/**/*.{js,jsx,ts,tsx}'"},"devDependencies":{"@babel/preset-env":"^7.13.15","@babel/preset-typescript":"^7.13.0","@rollup/plugin-commonjs":"^18.0.0","@rollup/plugin-image":"^2.0.6","@rollup/plugin-node-resolve":"^11.2.1","@types/jest":"^26.0.22","@types/node":"^14.14.39","babel-jest":"^26.6.3","graphql":"^15.5.0","graphql-request":"^3.4.0","jest":"^26.6.3","msw":"^0.28.1","node-fetch":"^2.6.1","ts-jest":"^26.5.4","web3":"^1.3.5","web3-eth-contract":"^1.3.5","web3-utils":"^1.3.5"},"peerDependencies":{"graphql":"^15.5.0","graphql-request":"^3.4.0","web3":">=1.3.5","web3-eth-contract":"=>1.3.5","web3-utils":">=1.3.5"},"dependencies":{"@types/js-cookie":"^2.2.6","js-cookie":"^2.2.1"},"gitHead":"5138a1f8a1b5f154397e30d2a73dddaf5f022cbb","description":"This package provides some handy functions to retrieve data for Pancakeswap Profile system.","bugs":{"url":"https://github.com/Global-Repo/global-uikit/issues"},"homepage":"https://github.com/Global-Repo/global-uikit/tree/master#readme","_id":"@duhd4h/global-profile-sdk@0.1.9","_nodeVersion":"14.17.1","_npmVersion":"lerna/4.0.0/node@v14.17.1+x64 (darwin)","dist":{"integrity":"sha512-afAkd2RTLvDY4giQpaeyXlqGu150C3M/XAZnQomPVrCipbAI8ZHS3Oo6WQeDUaMIzdyy+DwonB8qtJvyDlINcA==","shasum":"33d3d0c609a21dd19686aee4c2074f49af00a3d5","tarball":"https://registry.npmjs.org/@duhd4h/global-profile-sdk/-/global-profile-sdk-0.1.9.tgz","fileCount":70,"unpackedSize":1020507,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg1S9gCRA9TVsSAnZWagAAq10P/RdKX1980jr5nGN15JOd\nxckj6TggwJMnAIywMMce7xZeZewYG7EteGtFjbiKEdI88yatyhbl7/PTS32n\n3fr3fYxPqz2ikFlgp4HPB6mkoAbrbTf0LMtqQzoFm0Sy2UeLrjCn6KkpGaZC\nbEo98zkNUbQgTGbAaDuO2GfLRHNcBnxyc4gKWjhgsphCK9pD+mZNxkfT1NuH\n/Zj6y/HJLEMKVPv55vzGyomHnxQTO/jc3CR6IxEqCKgbPPIv+Qxe23rpa0t2\nG/2AUHectuQYfAwABfZiOg42jnjvXcI6styr7/AQRIBPc2ra0gqTCSQ17os0\nIML8kgHGFrtuinCXRCn4/JsAaaUzLznePjxYYhcOVyMspQwEOvM8kqFwIni4\nvoNBSQ9BT6Pq3nJ7Tf1n3M5dDAS1eaXWtaBQKxFPCbWAoZ2oCPWDtoEdiY/P\nfX5F3YQKb9ZP4Sge90t34dGxRJSPBQ93f51JV/j1rhGpGP9yrmJbkye6kDJv\nFSjNRl7oVwSt/pI27h1HvxzBbemJpEiKtyOajwp7pm4lZ7nDfOQN+olR0vBJ\nLdfmOjEP/gSNY4HYbUlIBQXPvDC+pWJnQ/7bP6pWTJTK+vqtGIb2gao5TymU\nM0KYmvJtqXVlEeA2AXsQIEpc/+yzEGq/mwgVPL+1GZTQiTFDR6SbcIiJfw0m\nv1ET\r\n=x3pz\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD4NqidicTgBTq1rwurA3npSEkLkGWkOywYOrUn1Yq3MQIhAJC5Q7Gt98hmRO6bAdnuUJ0bwGovDP0pvgjh11Xj8vbA"}]},"_npmUser":{"name":"duhd4h","email":"duhd4h@gmail.com"},"directories":{},"maintainers":[{"name":"duhd4h","email":"duhd4h@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/global-profile-sdk_0.1.9_1624584031403_0.15314997087144921"},"_hasShrinkwrap":false},"0.1.11":{"name":"@duhd4h/global-profile-sdk","version":"0.1.11","main":"dist/index.cjs.js","module":"dist/index.esm.js","types":"dist/index.d.ts","license":"MIT","private":false,"repository":{"type":"git","url":"git+https://github.com/Global-Repo/global-uikit.git#master"},"scripts":{"build":"rm -rf ./dist && rollup -c && tsc -d --emitDeclarationOnly --declarationDir dist","start":"yarn build && node ./dist","test":"jest","test:coverage":"jest --collectCoverage","lint":"eslint 'src/**/*.{js,jsx,ts,tsx}'","format:check":"prettier --check --loglevel error 'src/**/*.{js,jsx,ts,tsx}'","format:write":"prettier --write 'src/**/*.{js,jsx,ts,tsx}'"},"devDependencies":{"@babel/preset-env":"^7.13.15","@babel/preset-typescript":"^7.13.0","@rollup/plugin-commonjs":"^18.0.0","@rollup/plugin-image":"^2.0.6","@rollup/plugin-node-resolve":"^11.2.1","@types/jest":"^26.0.22","@types/node":"^14.14.39","babel-jest":"^26.6.3","graphql":"^15.5.0","graphql-request":"^3.4.0","jest":"^26.6.3","msw":"^0.28.1","node-fetch":"^2.6.1","ts-jest":"^26.5.4","web3":"^1.3.5","web3-eth-contract":"^1.3.5","web3-utils":"^1.3.5"},"peerDependencies":{"graphql":"^15.5.0","graphql-request":"^3.4.0","web3":">=1.3.5","web3-eth-contract":"=>1.3.5","web3-utils":">=1.3.5"},"dependencies":{"@types/js-cookie":"^2.2.6","js-cookie":"^2.2.1"},"gitHead":"5cf607d7fed2c0e7701ee38d299c45bc160f7bae","description":"This package provides some handy functions to retrieve data for Pancakeswap Profile system.","bugs":{"url":"https://github.com/Global-Repo/global-uikit/issues"},"homepage":"https://github.com/Global-Repo/global-uikit/tree/master#readme","_id":"@duhd4h/global-profile-sdk@0.1.11","_nodeVersion":"14.16.0","_npmVersion":"lerna/4.0.0/node@v14.16.0+x64 (linux)","dist":{"integrity":"sha512-BiiV3JBz+rCgACUiOAdgWkRznaM4pghl6j8m0QgFGdmx8/HRXO14V0l30iR0zA9pTz8fuwYBvUwMA/W28UPZLQ==","shasum":"eb127f652c45469ba89d3cead6a8853b85894251","tarball":"https://registry.npmjs.org/@duhd4h/global-profile-sdk/-/global-profile-sdk-0.1.11.tgz","fileCount":70,"unpackedSize":1021031,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg1grJCRA9TVsSAnZWagAAgi4P/2iIO7Pd9820kE4VDvsQ\nnA+n7BTxwXylDHl1nsJwg8rndP7Zg5DTJc8Z/P4dJMAYIgMuCqaig0RmW0yA\nH3LEvaI8/wyGDXWxX70QhEgTpxtEBsOGGMAYOlBjpOx90vcBGkTk4DivmA7n\n64V4594/AnEvVpKG+a/qDBBWx9qJpg/q3olIRPLEoQ3Ktna5Fbkauq5s+Qfb\nFgLJJsbJOgfqimECljApEltrKaZ/zW4XQZCrdkbstzvyl082DHj0C0mNsKFq\nMfjRMl+zw8OnCHVbEOzuc+mXk2yK7RCEtKgBS7a0FlcGFkcz3rh66uQ6Zzua\nA4xYrb2AN9rPj4st6xEgfJKP/1zMJao42f/L934MkTnYQgr5dGArZ6SSUIjK\nNC7SI9kKeJDDr3zAgo1hPGwfBysEdj/OtHSvgumOoiwnImcRuoMDTNaE4stB\nr1hzlVpBf0plEmthuS5VWy5b8qoMbrKhNfA/LX58c8v03mwgMRAt9cn3d05O\nGqYyz/rxr8344BF2fytEq31F80C01DB0m51H9NB4uOMWD3DsE2qiZ66gDKoH\n8JKWVX7+AGxGt1l8zFKlhF4KoBnm0qhYA3a9TK78o5ogd/C2DdUjdWiTYctg\nUyKZ2CXv9gvoUc6u1m51yI2gZRfuKq1X7me+EDjulWZGlJyH2cwQbBVg3CZu\nVwSp\r\n=yzD3\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDsSmdS7i9maQyJWHo2i8wcDQAEUWSjTlCgT8mtBFYp/AIhAOa79VcNbfAi6/fxJ0bkfHvMdgWSayCtzuTuzYz4mwkg"}]},"_npmUser":{"name":"duhd4h","email":"duhd4h@gmail.com"},"directories":{},"maintainers":[{"name":"duhd4h","email":"duhd4h@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/global-profile-sdk_0.1.11_1624640201044_0.47698562786653387"},"_hasShrinkwrap":false}},"time":{"created":"2021-06-25T00:33:13.851Z","0.1.7":"2021-06-25T00:33:14.060Z","modified":"2022-04-05T06:07:29.862Z","0.1.8":"2021-06-25T01:16:17.675Z","0.1.9":"2021-06-25T01:20:31.664Z","0.1.11":"2021-06-25T16:56:41.235Z"},"maintainers":[{"name":"duhd4h","email":"duhd4h@gmail.com"}],"description":"This package provides some handy functions to retrieve data for Pancakeswap Profile system.","homepage":"https://github.com/Global-Repo/global-uikit/tree/master#readme","repository":{"type":"git","url":"git+https://github.com/Global-Repo/global-uikit.git#master"},"bugs":{"url":"https://github.com/Global-Repo/global-uikit/issues"},"license":"MIT","readme":"# Pancakeswap Profile SDK\n\nThis package provides some handy functions to retrieve data for Pancakeswap Profile system.\n\nIf you're looking for React-ready solution - take a look at the [profile-hook](https://github.com/pancakeswap/pancake-toolkit/tree/master/packages/pancake-profile-hook).\n\n##### Table of Contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Initialization](#initialization)\n  - [getUsername](#getUsername)\n  - [getTeam](#getTeam)\n  - [getProfile](#getProfile)\n  - [getAchievements](#getAchievements)\n- [Roadmap](#roadmap)\n\n## Installation\n\nInstall `@pancakeswap/profile-sdk` into your project with npm:\n\n```bash\nnpm install @pancakeswap/profile-sdk --save\n```\n\nor yarn:\n\n```bash\nyarn add @pancakeswap/profile-sdk\n```\n\nThis package requires `web3` to be installed in your project. If you're using TypeScript you also should install `web3-eth-contract` and `web3-utils` to avoid type errors, although depending on your TypeScript and ESlint configuration you might skip installing those (since they are sub-packages of web3).\n\n```bash\n# npm\nnpm install web3 --save\n# yarn\nyarn add web3\n```\n\n## Usage\n\n### Initialization\n\nFirst set is to initialize the SDK with the following:\n\n```js\nimport PancakeProfileSdk from \"@pancakeswap/profile-sdk\";\n\nconst pancakeSdk = new PancakeProfileSdk();\n```\n\nYou can pass optional arguments to the constructor:\n\n- `web3` - custom web3 instance if you want to use web3 instance with custom configuration, if not provided defaults to the following configuration:\n  - HTTP provider with timeout of 10 seconds\n  - a random node is chosen on initialization from the [list of RPC nodes](src/utils/getRpcUrl.ts)\n  - the rest of the configuration is default Web3\n- `chainId` - what chain ID to use, if not provided defaults to `56`\n\n```js\nimport PancakeProfileSdk from \"@pancakeswap/profile-sdk\";\nimport Web3 from \"web3\";\n\nconst httpProvider = new Web3.providers.HttpProvider(\"https://mycustomnode.com\", {\n  timeout: 5000,\n});\nconst myWeb3 = new Web3(httpProvider);\n\nconst pancakeSdk = new PancakeProfileSdk(myWeb3, 97);\n```\n\n### getUsername\n\nReturns username for a given address. If the address does not have a profile or there is an error - returns empty string `\"\"`.\n\n```js\nimport PancakeProfileSdk from \"@pancakeswap/profile-sdk\";\n\nconst pancakeSdk = new PancakeProfileSdk();\nconst username = pancakeSdk.getUsername(\"0x123456789\");\nconsole.log(username); // \"Matatabi\"\n```\n\n### getTeam\n\nReturns team information for the team ID. In case of network error returns null. Note that at the moment `points` will return `0` for all teams (total team points will be calculated soon).\n\n```js\nimport PancakeProfileSdk from \"@pancakeswap/profile-sdk\";\n\nconst pancakeSdk = new PancakeProfileSdk();\nconst team = pancakeSdk.getTeam(1);\nconsole.log(team);\n// {\n//   id: 1,\n//   name: \"Syrup Storm\",\n//   description: \"The storm's a-comin! Watch out! These bulls are stampeding in a syrupy surge!\",\n//   isJoinable: true,\n//   users: 55123;\n//   points: 182500;\n//   images: images: {\n//     lg: \"syrup-storm-lg.png\",\n//     md: \"syrup-storm-md.png\",\n//     sm: \"syrup-storm-sm.png\",\n//     alt: \"syrup-storm-alt.png\",\n//     ipfs: \"https://gateway.pinata.cloud/ipfs/QmXKzSojwzYjtDCVgR6mVx7w7DbyYpS7zip4ovJB9fQdMG/syrup-storm.png\",\n//   },\n//   background: syrup-storm-bg.svg;\n//   textColor: \"#191326\";\n// }\n```\n\n### getProfile\n\nReturns full profile data for a given address. Under the hood retrieves username and team data using `getUsername` and `getTeam` and combines it with data from the profile contract. If address does not have a profile - returns `{ hasRegistered: false, profile: null }`. At the moment does not retrieve achievements (see [getAchievements](#getAchievements)).\n\nIt also sets `profile_${address}` cookie containing username and avatar (now only for pancakeswap.finance domain, maybe configurable in future versions)\n\n```js\nimport PancakeProfileSdk from \"@pancakeswap/profile-sdk\";\n\nconst pancakeSdk = new PancakeProfileSdk();\nconst profile = pancakeSdk.getProfile(\"0x123456789\");\nconsole.log(profile);\n// {\n//   hasRegistered: true\n//   profile: {\n//     userId: 6173,\n//     points: 2500,\n//     teamId: 1,\n//     nftAddress: \"0x11111111\",\n//     tokenId: 15,\n//     isActive: true,\n//     username: \"Matatabi\",\n//     nft: {\n//       name: \"Hiccup\",\n//       description: \"Oopsie daisy! Hiccup's had a bit of an accident. Poor little fella.\",\n//       images: {\n//         lg: \"hiccup-lg.png\",\n//         md: \"hiccup-md.png\",\n//         sm: \"hiccup-sm.png\",\n//         ipfs: \"https://gateway.pinata.cloud/ipfs/QmQ6EE6gkVzAQUdQLLM7CyrnME6LZHCoy92ZERW8HXmyjw/hiccup.png\",\n//       },\n//       sortOrder: 999,\n//       identifier: 'hiccup'\n//       type: 'pancake',\n//       variationId: 10\n//     },\n//     team: {\n//       id: 1,\n//       name: \"Syrup Storm\",\n//       description: \"The storm's a-comin! Watch out! These bulls are stampeding in a syrupy surge!\",\n//       isJoinable: true,\n//       users: 55123,\n//       points: 182500,\n//       images: images: {\n//         lg: \"syrup-storm-lg.png\",\n//         md: \"syrup-storm-md.png\",\n//         sm: \"syrup-storm-sm.png\",\n//         alt: \"syrup-storm-alt.png\",\n//         ipfs: \"https://gateway.pinata.cloud/ipfs/QmXKzSojwzYjtDCVgR6mVx7w7DbyYpS7zip4ovJB9fQdMG sy  rup-storm.png\",\n//       },\n//       background: syrup-storm-bg.svg,\n//       textColor: \"#191326\"\n//     },\n//     hasRegistered: true\n//   }\n// }\n```\n\n### getAchievements\n\nReturns array of achievements for a given address. If address has no achievements or no profile at all - returns empty array `[]`.\n\n```js\nimport PancakeProfileSdk from \"@pancakeswap/profile-sdk\";\n\nconst pancakeSdk = new PancakeProfileSdk();\n\nconst achievements = pancakeSdk.getAchievements(\"0x123456789\");\nconsole.log(achievements);\n// [\n//   {\n//     id: \"511080000\",\n//     type: \"ifo\",\n//     address: \"0x123456789\",\n//     title: {\n//       id: 999,\n//       fallback: `IFO Shopper: Belt`,\n//       data: {\n//         name: \"Belt\",\n//       },\n//     },\n//     description: {\n//       id: 999,\n//       fallback: `Committed more than $5 worth of LP in the Belt IFO`,\n//       data: {\n//         name: \"Belt\",\n//       },\n//     },\n//     badge: \"ifo-belt.svg\",\n//     points: 200,\n//   },\n//   {\n//     id: \"512010010\",\n//     type: \"teambattle\",\n//     address: \"0x123456789\",\n//     title: \"Easter Participant: Silver\",\n//     badge: \"easter-participant-silver.svg\",\n//     points: 500,\n//   },\n// ];\n```\n\n## Roadmap\n\nCurrent version of this SDK is 90% copy of existing from [pancake-frontend](https://github.com/pancakeswap/pancake-frontend) repo. There are several improvements to be made in the future versions of this SDK:\n\n- [ ] Better error handling (common bad status codes or broken internet connection)\n- [ ] Allow username & avatar cookie to be configurable or optional\n- [ ] Validate addresses with regex and don't attempt to fetch data if address is not valid\n- [ ] NodeJS support. Currently it works out of the box only in browser. Need to research different options for cross-fetch and choose the one that provides less friction and increases bundle size the least.\n","readmeFilename":"README.md"}