# Тестирование MetaForceSpace SDK :::info :bulb: Данный документ описывает поэтапный ход тестирования функциий MetaForceSpace SDK. Описываются входные данные и получаемый результат. ::: ## :heavy_check_mark: Результаты Здесь будет размещена итоговая информация.<br> <div id="check_list"> <details> <summary><b>Чек-лист тестирования</b></summary> - [x] getStats - [x] getUserID - [x] getUserInfo - [x] getPacks - [x] getRevenueStable - [x] getRevenueMFS - [x] getDirectReferalPage - [x] getDirectReferalUserInfo - [x] getUsersInfoInMarketingTree - [x] getMarketingReferalUserInfo - [x] getAvatar - [x] getLostStableCoin - [x] getRewardType - [x] getTotalPossibilityForByingMFS - [x] getPossibilityForBuyingMFSPage - [x] getPossibilityForBuyingMFSLength - [x] getPossibilityForBuyingMFS - [ ] getDepositIds - [ ] getDeposit - [x] getRequestIds - [x] getRequest - [x] getQueue - [x] getBalancesOnWallet - [x] getBalancesOnPayment - [x] getRecentActivity - [x] setTypeReward - [x] activationPack - [x] renewPackForMFS - [ ] renewPackForSetHMFS - [x] buyMFS - [x] createRequestMfs - [x] deleteRequestMfs - [ ] hold - [ ] unhold - [ ] withdrawHMFS - [x] addToPayment - [x] getBalanceInPayment </details> </div> ## :writing_hand: Порядок действий <div id="steps"> <details> <summary>Подробности</summary><br> - [x] **Добавить стейблкоины на платежный канал в Metapayment;**<br><br> **addToPayment** (добавление 100 стейблкоинов) > :::info > Ввод: > ::: ```node forceDelta.addToPayment("0x9908Ea27465af9d86dF38aCA16FFce67a3c33A1c", "100").then(console.log) ``` >:::success > Вывод: Прошла > ::: **getBalanceInPayment** > :::info > Ввод: > ::: ```node forceDelta.getBalanceInPayment("0x9908Ea27465af9d86dF38aCA16FFce67a3c33A1c").then(console.log) ``` >:::success > Вывод: > ::: ```node= 100.0 ``` --- - [x] **Активировать первый пакет MFS (ReferrerId = 100);**<br><br> Контракт MetaForce: > ![](https://i.imgur.com/Tk66d1t.png) #### Хэш транзакции (ссылка на [PolygonScan](https://mumbai.polygonscan.com/tx/0xbf0209b26c269c5dc9056c94d0a8b66150f8021130409caf2f544ac43b3c8972)) ```node 0xbf0209b26c269c5dc9056c94d0a8b66150f8021130409caf2f544ac43b3c8972 ``` --- - [x] **Проверить Holding (с помощью изменения срока заморозки в контракте)** </details> </div> ## :pencil: Список функций :::warning Список всех тестируемых функций. C комментариями по необходимости. ::: ### 1. **getStats** > :::info > Ввод: > ::: ```node forceDelta.getStats().then(console.log) ``` >:::success > Вывод: > ::: ```node { firstPackPriceInMFS: '200.0', mfsPriceInUSD: '0.25', mfsTotalEmission: '2192200.0', workflowStage: 1 } ``` --- ### 2. **getUserID** > :::info > Ввод: > ::: ```node forceDelta.getUserID().then(console.log) ``` >:::success > Вывод: > ::: ```node= 101 ``` --- ### 3. **getUserInfo** > :::info > Ввод: > ::: ```node forceDelta.getUserInfo().then(console.log) ``` >:::success > Вывод: > ::: ```node { rewardType: 0, level: 1, registeredAt: 2023-01-20T08:37:42.000Z } ``` --- ### 4. **getPacks** > :::info > Ввод: > ::: ```node forceDelta.getPacks().then(console.log) ``` >:::success > Вывод: > ::: ```node [ { isActive: true, timeStampEndPack: 2023-02-22T08:14:01.000Z, countRenewal: BigNumber { _hex: '0x00', _isBigNumber: true } } ] ``` --- ### 5. **getDirectReferalPage** > :::info > Ввод: > ::: ```node forceDelta.getDirectReferalPage(3, 0, 5).then(console.debug) ``` >:::success > Вывод: > ::: ```node= [ { userId: 6, avatar: 'https://metaforce-hub.fra1.digitaloceanspaces.com/avatars/0xe455bf8ea6e7463a1046a0b52804526e119b4bf5136279614e0b1e8e296a4e2d.jpg', alias: '', referrerId: 5, referralsAmount: 0 }, { userId: 8, avatar: 'https://metaforce-hub.fra1.digitaloceanspaces.com/avatars/0xe4b1702d9298fee62dfeccc57d322a463ad55ca201256d01f62b45b2e1c21c10.jpg', alias: '', referrerId: 5, referralsAmount: 0 }, { userId: 39, avatar: 'https://metaforce-hub.fra1.digitaloceanspaces.com/avatars/0x318a541463286d7584b45438601196fbc1a55628e303a0613eb6d46e60640c95.jpg', alias: '', referrerId: 5, referralsAmount: 0 } ] ``` --- ### 6. **getDirectReferalUserInfo** > :::info > Ввод: > ::: ```node forceDelta.getDirectReferalUserInfo(101).then(console.log) ``` >:::success > Вывод: > ::: ```node= { userId: 101, avatar: 'https://metaforce-hub.fra1.digitaloceanspaces.com/avatars/0xf9535bac1c0dacfe011b6a07ce55ad3fdc761de7345d7b004778e93b9d222ae5.jpg', alias: '', referrerId: 1, referralsAmount: 0 } ``` --- ### 7. **getAvatar** > :::info > Ввод: > ::: ```node forceDelta.getAvatar(101).then(console.log) ``` >:::success > Вывод: > ::: ```node= https://metaforce-hub.fra1.digitaloceanspaces.com/avatars/0xf9535bac1c0dacfe011b6a07ce55ad3fdc761de7345d7b004778e93b9d222ae5.jpg ``` --- ### 8. **getTotalPossibilityForByingMFS** > :::info > Ввод: > ::: ```node forceDelta.getTotalPossibilityForByingMFS().then(console.log) ``` >:::success > Вывод: > ::: ```node= 200.0 ``` --- ### 9. **getPossibilityForBuyingMFSPage** > :::info > Ввод: > ::: ```node forceDelta.getPossibilityForBuyingMFSPage(20, 0).then(console.log) ``` >:::success > Вывод: > ::: ```node= [ { endBuyingPeriodDate: 2023-02-22T08:14:01.000Z, amount: '200.0' } ] ``` --- ### 10. **getPossibilityForBuyingMFSLength** > :::info > Ввод: > ::: ```node forceDelta.getPossibilityForBuyingMFSLength(101).then(console.log) ``` >:::success > Вывод: > ::: ```node= 1 ``` --- ### 11. **getPossibilityForBuyingMFS** > :::info > Ввод: > ::: ```node forceDelta.getPossibilityForBuyingMFS(101, 0).then(console.log) ``` >:::success > Вывод: > ::: ```node= { endBuyingPeriodDate: 2023-02-22T08:14:01.000Z, amount: '200.0' } ``` --- ### 12. **buyMFS** > :::info > Ввод: > ::: ```node forceDelta.buyMFS("200").then(console.log) ``` >:::success > Вывод: Прошла > ::: --- ### 13. **getBalancesOnPayment** > :::info > Ввод: > ::: ```node forceDelta.getBalancesOnPayment().then(console.log) ``` >:::success > Вывод: > ::: ```node= { mfs: '200.0', stablecoin: '0.0', energy: '200.0', hMfs: [ '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0' ] } ``` --- ### 14. **renewPackForMFS** > :::info > Ввод: > ::: ```node forceDelta.renewPackForMFS(1, 1).then(console.log) ``` > **Проверка продления на 1 месяц:** >:::info > Ввод: > ::: ```node forceDelta.getPacks().then(console.log) ``` >:::success > Вывод: > ::: ```node= [ { isActive: true, timeStampEndPack: 2023-03-24T08:14:01.000Z, countRenewal: BigNumber { _hex: '0x00', _isBigNumber: true } } ] ``` --- ### 15. **createRequestMfs** > :::info > Ввод: > ::: ```node forceDelta.createRequestMfs("50").then(console.log) ``` >:::success > Вывод: > ::: ```node= 1 ``` --- ### 16. **getRequest** > :::info > Ввод: > ::: ```node forceDelta.getRequest(1).then(console.log) ``` >:::success > Вывод: > ::: ```node= requester: BigNumber { _hex: '0x65', _isBigNumber: true }, usdAmount: '50.0', priority: 1, placeInQueue: 1 ``` :heavy_exclamation_mark: Для несуществующих запросов placeInQueue = 1 --- ### 17. **getRequestIds** > :::info > Ввод: > ::: ```node forceDelta.getRequestIds().then(console.log) ``` >:::success > Вывод: > ::: ```node= [ 1 ] ``` --- ### 18. **getQueue** > :::info > Ввод: > ::: ```node forceDelta.getQueue(20, 0).then(console.log) ``` >:::success > Вывод: > ::: ```node= [ 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ] ``` --- ### 19. **getBalancesOnWallet** > :::info > Ввод: > ::: ```node forceDelta.getBalancesOnWallet().then(console.log) ``` >:::success > Вывод: > ::: ```node= { mfs: '0.0', stablecoin: '99800.0', energy: '0.0', hMfs: [ '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0' ] } ``` --- ### 20. **getRecentActivity** > :::info > Ввод: > ::: ```node forceDelta.getRecentActivity(3, 1, 2).then(console.log) ``` >:::success > Вывод: > ::: ```node= [ { userId: '100', name: 'RevenueMFS', date: '2023-01-14T16:18:32.000000Z', value: '80000000000000000000' }, { userId: '100', name: 'RevenueMFS', date: '2023-01-14T16:18:26.000000Z', value: '40000000000000000000' }, { userId: '100', name: 'RevenueMFS', date: '2023-01-14T16:18:20.000000Z', value: '20000000000000000000' } ] ``` --- ### 21. **deleteRequestMfs** > :::info > Ввод: > ::: ```node forceDelta.deleteRequestMfs(1).then(console.log) ``` >:::success > Вывод: Прошла > ::: ```node= to: '0xA4D653F3208576e780caA4F205603AeCfa209180', from: '0x5b421cF148b0234bb3E38C7f173a1c58F2745255', contractAddress: null, transactionIndex: 9, gasUsed: BigNumber { _hex: '0x01d545', _isBigNumber: true }, blockHash: '0x2c29239d4e6cac90ac0ca9c31aa192c23d6973681a9b221a20153dc1998e1b72', transactionHash: '0x7c6793b3aab2b5288bb561da899a604a93522f7c18bb2e58642f84b8e0e32e07' ``` - getRequest (проверка на удаление): ```node= > forceDelta.getRequest(1).then(console.log) > { requester: BigNumber { _hex: '0x65', _isBigNumber: true }, usdAmount: '0.0', priority: 1, placeInQueue: 1 } ``` --- ### 22. **setTypeReward** > :::info > Ввод: > ::: ```node forceDelta.setTypeReward(1).then(console.log) ``` >:::success > Вывод: Прошла > ::: ```node= to: '0x309dE5395630ed2d1fdd0a25B860f25BfABf2fdA', from: '0x5b421cF148b0234bb3E38C7f173a1c58F2745255', contractAddress: null, transactionIndex: 6, gasUsed: BigNumber { _hex: '0x011838', _isBigNumber: true }, blockHash:'0x68c146e50da97040659b11d611db2fb9c10cd474bbc1f11174ecd69aa07106b1', transactionHash:'0xb76a24b47a59caf506fcdb6f98adad1dd0087d7790c5a76086bae8caf7910e61' ``` --- ### 23. **getRewardType** > :::info > Ввод: > ::: ```node forceDelta.getRewardType(101).then(console.log) ``` >:::success > Вывод: > ::: ```node= 1 ``` ### 24. **getRevenueStable** > :::info > Ввод: > ::: ```node forceDelta.getRevenueStable("20 day", 10, 1).then(console.log) ``` >:::success > Вывод: > ::: ```node= [ '6.25', '6.25', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0' ] ``` ### 25. **getRevenueMFS** > :::info > Ввод: > ::: ```node forceDelta.getRevenueMFS("20 day", 10, 2).then(console.log) ``` >:::success > Вывод: > ::: ```node= [ '20.0', '20.0', '20.0', '20.0', '20.0', '20.0', '20.0', '0.0', '0.0', '0.0' ] ``` --- ### 26. **getMarketingReferalUserInfo** > :::info > Ввод: > ::: ```node forceDelta.getMarketingReferalUserInfo(5).then(console.log) ``` >:::success > Вывод: > ::: ```node= { userId: 5, avatar: 'https://metaforce-hub.fra1.digitaloceanspaces.com/avatars/0xceebf77a833b30520287ddd9478ff51abbdffa30aa90a8d655dba0e8a79ce0c1.jpg', alias: '', referrerId: 2, referralIds: [ 105, 103 ] } ``` --- ### 27. **hold** > :::info > Ввод: > ::: ```node forceDelta.hold(1, "50").then(console.debug) ``` >:::success > Вывод: > ::: ```node= to: '0xA45322D6E9592011d62A73E683Ba9517D5dFf359', from: '0x566f5AD9d71C9AaF9F847c37Ff04DbC9645A3216', contractAddress: null, transactionIndex: 2, gasUsed: BigNumber { _hex: '0x0403cd', _isBigNumber: true } transactionHash: '0xafc629f7dbbd02837a8df75ad90d6efc0b3cdd8c63ce3853ae405c2308000099' ``` --- ### 28. **getDepositIds** > :::info > Ввод: > ::: ```node forceDelta.getDepositIds().then(console.debug) ``` >:::success > Вывод: > ::: ```node= [ 0 ] ``` --- ### 29. **getDeposit** > :::info > Ввод: > ::: ```node forceDelta.getDeposit(0).then(console.debug) ``` >:::success > Вывод: > ::: ```node= { holderId: 105, unholdingAllowed: true, level: 1, amount: '50.0', lockedUntil: 2023-02-15T12:04:09.000Z } ``` --- ### 30. **unhold** > :::info > Ввод: > ::: ```node forceDelta.unhold(0, "50").then(console.debug) ``` >:::success > Вывод: > ::: ```node= to: '0xA45322D6E9592011d62A73E683Ba9517D5dFf359', from: '0x566f5AD9d71C9AaF9F847c37Ff04DbC9645A3216', contractAddress: null, transactionIndex: 3, gasUsed: BigNumber { _hex: '0x0185d4', _isBigNumber: true } blockHash: '0xb6119fc769f3e2c2b4fd658b38332e1c6b43d07bb2ec0caeae38c99470a78645', transactionHash: '0xd3c807eb702e5bfa61db606b9fc1f327c056798ac3a220e6cc3b4781bc0d1c0a' ``` --- ### 31. **withdrawHMFS** > :::info > Ввод: > ::: ```node forceDelta.getBalancesOnPayment().then(console.debug) ``` >:::success > Вывод: > ::: ```node= { mfs: '100.0', stablecoin: '89925.0', energy: '200.0', hMfs: [ '50.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0', '0.0' ] } ``` --- ### 32. **renewPackForSetHMFS** > :::info > Ввод: > ::: ```node= > forceDelta.getPacks().then(console.debug) > [ { isActive: true, timeStampEndPack: 2023-02-24T12:39:02.000Z, countRenewal: BigNumber { _hex: '0x00', _isBigNumber: true } } ] > forceDelta.renewPackForSetHMFS(1, 1, ["50", "0", "0", "0", "0", "0", "0", "0"]).then(console.debug) ``` >:::success > Вывод: > ::: ```node= > forceDelta.getPacks().then(console.debug) > [ { isActive: true, timeStampEndPack: 2023-03-26T12:39:02.000Z, countRenewal: BigNumber { _hex: '0x01', _isBigNumber: true } } ] ``` --- ### 33. **getUsersInfoInMarketingTree** > :::info > Ввод: > ::: ```node= forceDelta.getUsersInfoInMarketingTree(1, 1, 103).then(console.debug) ``` >:::success > Вывод: > ::: ```node= [ { userId: 104, avatar: 'https://metaforce-hub.fra1.digitaloceanspaces.com/avatars/0x2e5129c19be59da29ff89133759e8d7e21d926bf22eda9cdfd27c0cd8774b8c2.jpg', alias: '', referrerId: 103, referralIds: [] }, { userId: 49, avatar: 'https://metaforce-hub.fra1.digitaloceanspaces.com/avatars/0x59c0d2b7af0a8e6d3d8e710a078764bd67b7223777026c424cdb4f599824bb79.jpg', alias: '', referrerId: 103, referralIds: [ 51 ] } ] ``` --- ### 34. **getLostStableCoin** > :::info > Ввод: > ::: ```node= forceDelta.getLostStableCoin("1 month", 5).then(console.debug) ``` >:::success > Вывод: > ::: ```node= 14880.0 ```