diff --git a/tests/Api/TokensTest.php b/tests/Api/TokensTest.php index ee6cfda..e6757ff 100644 --- a/tests/Api/TokensTest.php +++ b/tests/Api/TokensTest.php @@ -11,6 +11,15 @@ assertMatchesResponseSnapshot($actual); }); +it('getTokens - gets tokens', function () { + $client = createMockedHttpClientWithResponse('tokens/tokens.json'); + + $actual = (new TokenEndpoints($client)) + ->getTokens(); + + assertMatchesResponseSnapshot($actual); +}); + it('getAccounts - gets the token accounts', function () { $client = createMockedHttpClientWithResponse('tokens/accounts.json'); diff --git a/tests/Api/responses/tokens/tokens.json b/tests/Api/responses/tokens/tokens.json new file mode 100644 index 0000000..f20bebd --- /dev/null +++ b/tests/Api/responses/tokens/tokens.json @@ -0,0 +1,152 @@ +[ + { + "type": "FungibleESDT", + "identifier": "HTM-f51d55", + "name": "Hatom", + "ticker": "HTM", + "owner": "erd1y5ytj48d9cd9rvgzk7zkth0gerywu2s6y0tpg23c9rrhhg50dtestnvh79", + "decimals": 18, + "isPaused": false, + "assets": { + "website": "https://hatom.com/", + "description": "HTM is the utility and governance token of Hatom, a liquidity protocol that empowers DeFi in the MultiversX blockchain", + "status": "active", + "pngUrl": "https://media.elrond.com/tokens/asset/HTM-f51d55/logo.png", + "svgUrl": "https://media.elrond.com/tokens/asset/HTM-f51d55/logo.svg", + "lockedAccounts": { + "erd1y5ytj48d9cd9rvgzk7zkth0gerywu2s6y0tpg23c9rrhhg50dtestnvh79": "Minter Account", + "erd1qqqqqqqqqqqqqpgq39rqpn2xvm0ykl2ccaa4h5zk5c9r647wdteswmap9l": "Investors Vesting", + "erd1qqqqqqqqqqqqqpgq4hl5hdvvxtm987nw5vtczgm8y89ra2hndteshlehgs": "Token Vesting" + }, + "ledgerSignature": "304402200efd7cbc3a55b1eecbdd0e53c7c949ab4c39c6359f4d28eb4e3b7257a1bd4e8302204b845636199611baeef599bca3cc1472d53baa7a216046c0f0a7baab34b66e1f", + "social": { + "blog": "https://blog.hatom.com/", + "telegram": "https://t.me/HatomProtocol", + "twitter": "https://twitter.com/HatomProtocol", + "whitepaper": "https://docs.hatom.com/getting-started/learn-more-about-hatom-token/whitepaper" + } + }, + "transactions": 51360, + "accounts": 38703, + "canUpgrade": true, + "canMint": false, + "canBurn": false, + "canChangeOwner": true, + "canAddSpecialRoles": true, + "canPause": false, + "canFreeze": false, + "canWipe": false, + "price": 2.21338616753827, + "marketCap": 34480730.90310609, + "supply": "100000000000000000000000000", + "circulatingSupply": "15578271613333333333333416" + }, + { + "type": "FungibleESDT", + "identifier": "WEGLD-bd4d79", + "name": "WrappedEGLD", + "ticker": "WEGLD", + "owner": "erd1ss6u80ruas2phpmr82r42xnkd6rxy40g9jl69frppl4qez9w2jpsqj8x97", + "decimals": 18, + "isPaused": false, + "assets": { + "website": "https://xexchange.com", + "description": "wEGLD is an ESDT token that has the same value as EGLD, the native coin of the MultiversX blockchain.", + "status": "active", + "pngUrl": "https://media.elrond.com/tokens/asset/WEGLD-bd4d79/logo.png", + "svgUrl": "https://media.elrond.com/tokens/asset/WEGLD-bd4d79/logo.svg", + "ledgerSignature": "3044022062a68d4bdd649aebb5e4ed5c6284e211c689c3b8142e59a47b01cc9997b16dfa0220475b064836849b9c4aa9c5ff18daed91a64f847bd96aa0a26768349f2cd0c24f" + }, + "transactions": 6860481, + "accounts": 131902, + "canUpgrade": true, + "canMint": true, + "canBurn": true, + "canChangeOwner": true, + "canAddSpecialRoles": true, + "canPause": true, + "canFreeze": true, + "canWipe": true, + "price": 42.62450699127219, + "marketCap": 33489009.386221197, + "supply": "785674996618222940597861", + "circulatingSupply": "785674996618222940597861" + }, + { + "type": "FungibleESDT", + "identifier": "MEX-455c57", + "name": "MEX", + "ticker": "MEX", + "owner": "erd1ss6u80ruas2phpmr82r42xnkd6rxy40g9jl69frppl4qez9w2jpsqj8x97", + "decimals": 18, + "isPaused": false, + "assets": { + "website": "https://xexchange.com", + "description": "MEX is the utility token of the xExchange.", + "status": "active", + "pngUrl": "https://media.elrond.com/tokens/asset/MEX-455c57/logo.png", + "svgUrl": "https://media.elrond.com/tokens/asset/MEX-455c57/logo.svg", + "ledgerSignature": "304402207c9727bf3a0af254052154bceefe835856e4a7f6538cb6f5c3ef12422c6ab5dd02207d7a6c88777032079cd57b5b859a6e8dee4b73bb4fa699f0340f99fb70080a8d" + }, + "transactions": 1813732, + "accounts": 98331, + "canUpgrade": true, + "canMint": true, + "canBurn": true, + "canChangeOwner": true, + "canAddSpecialRoles": true, + "canPause": true, + "canFreeze": true, + "canWipe": true, + "price": 0.000006427122425848906, + "marketCap": 26205346.831226137, + "supply": "4077306311426748277802457991213", + "circulatingSupply": "4077306311426748277802457991213" + }, + { + "type": "FungibleESDT", + "identifier": "UTK-2f80e9", + "name": "Utrust", + "ticker": "UTK", + "owner": "erd1kc3y0d3jhmv4j42lvyq84t395s7s47tucpw97grwgaj8dqlkzumsw97k34", + "decimals": 18, + "isPaused": false, + "assets": { + "website": "https://www.xmoney.com/", + "description": "Web3 L1 Payments Technology", + "status": "active", + "pngUrl": "https://media.elrond.com/tokens/asset/UTK-2f80e9/logo.png", + "svgUrl": "https://media.elrond.com/tokens/asset/UTK-2f80e9/logo.svg", + "extraTokens": [ + "UTKWEGLD-c960d1", + "METAUTKLK-e6a445", + "METAUTK-291e0e", + "SUTK-ba35f3", + "UTKWEGLDFL-082aec", + "UTKWEGLDF-5b9d50" + ], + "name": "xMoney UTK", + "ledgerSignature": "304402204f2f6035dccb8c5e16698a1a8cfd0c0d4203e9a31103147e286fa1c1ea829c16022003284c1f3c8cb23b6587c5dee3187feb1e0663b15ffbffa89dbe07e7a766eff2", + "social": { + "email": "support@xmoney.com", + "twitter": "https://twitter.com/xMoney_com", + "coinmarketcap": "https://coinmarketcap.com/currencies/utrust/", + "coingecko": "https://www.coingecko.com/en/coins/xmoney" + } + }, + "transactions": 503560, + "accounts": 76944, + "canUpgrade": true, + "canMint": true, + "canBurn": true, + "canChangeOwner": true, + "canAddSpecialRoles": true, + "canPause": true, + "canFreeze": true, + "canWipe": true, + "price": 0.06741330939393897, + "marketCap": 24650908.354071133, + "supply": "365668271973122553445481020", + "circulatingSupply": "365668271973122553445481020" + } +] diff --git a/tests/__snapshots__/TokensTest____pest_evaluable_it_getTokens___gets_tokens__1.txt b/tests/__snapshots__/TokensTest____pest_evaluable_it_getTokens___gets_tokens__1.txt new file mode 100644 index 0000000..fd7d961 Binary files /dev/null and b/tests/__snapshots__/TokensTest____pest_evaluable_it_getTokens___gets_tokens__1.txt differ