shopxlabs / SHOPX_TCPeNFT_depricated

Ethereum contracts for Spl.yt Core Protocol
MIT License
1 stars 2 forks source link

[Backend] Fix broken functionality: Ability to buy an item #14

Open dipenjoshi opened 3 years ago

dipenjoshi commented 3 years ago

Based on recent incident: Frontend can successfully make a call but backend errors out saying wallet is locked.

To fix, look at Orders Module


old wallet address: 0x92389eB6c277B71CDe8bd633F8fd00f924e0f771

new buyer wallet
: 0xCeC2Fe013485e55DE26Dad05957e04f6bD4BD040



todo: add ETHs and tokens to new wallet

gusiri commented 3 years ago

image

I only can see this error. (https://community.shopify.com/c/Technical-Q-A/quot-Buy-it-now-quot-button-results-in-quot-Enter-a-valid/td-p/827101)

gusiri commented 3 years ago

0|SPLYT | Response: 403 1.215 ms 0|SPLYT | Request: POST /api/shopifies/item-bought at Mon Mar 01 2021 19:56:58 GMT+0000, IP: ::ffff:127.0.0.1, User Agent: Shopify-Captain-Hook 0|SPLYT | user { _id: 6018e1f7828667056924f508, 0|SPLYT | walletPassword: 'splytcorefoundation', 0|SPLYT | publicKey: '0x79074462602aAd182596Fe37b406760A4B86094f', 0|SPLYT | displayName: 'splyt 1', 0|SPLYT | v: 4, 0|SPLYT | etherBalance: '0', 0|SPLYT | tokenBalance: '0', 0|SPLYT | updated: 2021-02-03T04:00:23.443Z, 0|SPLYT | created: 2021-02-02T05:24:07.019Z, 0|SPLYT | roles: [ 'user' ], 0|SPLYT | profileImageURL: 0|SPLYT | './modules/users/client/img/profile/6018e1f7828667056924f508.png', 0|SPLYT | password: 'splytcorefoundation', 0|SPLYT | provider: 'local', 0|SPLYT | email: 'josh@spl.yt', 0|SPLYT | type: 'SELLER', 0|SPLYT | lastName: '1', 0|SPLYT | firstName: 'splyt' } 0|SPLYT | err null 0|SPLYT | decorated token balance: 20,482.8111 0|SPLYT | body { id: 19747800121401, 0|SPLYT | token: '0c281be28ea3c50e2d03cd311e57e179', 0|SPLYT | cart_token: 'ada0c8c1ecc36440a474eaf4823086e4', 0|SPLYT | email: null, 0|SPLYT | gateway: null, 0|SPLYT | buyer_accepts_marketing: false, 0|SPLYT | created_at: '2021-03-01T06:53:51-05:00', 0|SPLYT | updated_at: '2021-03-01T13:58:47-05:00', 0|SPLYT | landing_site: '/password', 0|SPLYT | note: null, 0|SPLYT | note_attributes: [], 0|SPLYT | referring_site: '', 0|SPLYT | shipping_lines: [], 0|SPLYT | taxes_included: false, 0|SPLYT | total_weight: 0, 0|SPLYT | currency: 'USD', 0|SPLYT | completed_at: null, 0|SPLYT | closed_at: null, 0|SPLYT | user_id: null, 0|SPLYT | location_id: null, 0|SPLYT | source_identifier: null, 0|SPLYT | source_url: null, 0|SPLYT | device_id: null, 0|SPLYT | phone: null, 0|SPLYT | customer_locale: 'en', 0|SPLYT | line_items: 0|SPLYT | [ { applied_discounts: [], 0|SPLYT | key: 'ac81098d372c4d2108053ed08b40ced8', 0|SPLYT | destination_location_id: null, 0|SPLYT | fulfillment_service: 'manual', 0|SPLYT | gift_card: false, 0|SPLYT | grams: 0, 0|SPLYT | origin_location_id: 1547686772793, 0|SPLYT | presentment_title: 'Blue Silk Tuxedo', 0|SPLYT | presentment_variant_title: '', 0|SPLYT | product_id: 4295798980665, 0|SPLYT | properties: [], 0|SPLYT | quantity: 3, 0|SPLYT | requires_shipping: true, 0|SPLYT | sku: '', 0|SPLYT | tax_lines: [], 0|SPLYT | taxable: true, 0|SPLYT | title: 'Blue Silk Tuxedo', 0|SPLYT | variant_id: 30951973191737, 0|SPLYT | variant_title: '', 0|SPLYT | variant_price: '70.00', 0|SPLYT | vendor: 'Shopify Powered by Splyt', 0|SPLYT | user_id: null, 0|SPLYT | unit_price_measurement: [Object], 0|SPLYT | rank: null, 0|SPLYT | compare_at_price: null, 0|SPLYT | line_price: '210.00', 0|SPLYT | price: '70.00' } ], 0|SPLYT | name: '#19747800121401', 0|SPLYT | source: null, 0|SPLYT | abandoned_checkout_url: 0|SPLYT | 'https://www.splytdev.com/10781130809/checkouts/0c281be28ea3c50e2d03cd311e57e179/recover?key=d1c3d21a248997cbba4d05914fb2480f', 0|SPLYT | discount_codes: [], 0|SPLYT | tax_lines: [], 0|SPLYT | source_name: 'web', 0|SPLYT | presentment_currency: 'USD', 0|SPLYT | total_discounts: '0.00', 0|SPLYT | total_line_items_price: '210.00', 0|SPLYT | total_price: '210.00', 0|SPLYT | total_tax: '0.00', 0|SPLYT | subtotal_price: '210.00' } 0|SPLYT | find by title: Blue Silk Tuxedo 0|SPLYT | Find asset by title: [ { _id: 601ca28a2ef36823a206ad71, 0|SPLYT | transactionHash: 0|SPLYT | '0xae1be9482aca34f700e4733503f641ad0b25a049449766c5fac8e4a23829df57', 0|SPLYT | user: 6018e1f7828667056924f508, 0|SPLYT | v: 0, 0|SPLYT | totalCost: 70, 0|SPLYT | address: '', 0|SPLYT | imageURL: 0|SPLYT | 'https://cdn.shopify.com/s/files/1/0107/8113/0809/products/man-adjusts-blue-tuxedo-bowtie_925x_58346340-8745-4bf5-b6b0-037fa1a2b6fa.jpg?v=1571706678', 0|SPLYT | status: '0', 0|SPLYT | inventoryCount: 100, 0|SPLYT | marketPlacesAmount: [ 2, 2 ], 0|SPLYT | marketPlaces: [ '0x79074462602aAd182596Fe37b406760A4B86094f' ], 0|SPLYT | seller: '0x79074462602aAd182596Fe37b406760A4B86094f', 0|SPLYT | term: 0, 0|SPLYT | expDate: 2022-02-04T19:31:30.480Z, 0|SPLYT | created: 2021-02-05T01:42:34.972Z, 0|SPLYT | description: 0|SPLYT | 'Blue silk tuxedo with marbled aquatic pattern and dark lining. Sleeves are complete with rounded hem and black buttons.', 0|SPLYT | title: 'Blue Silk Tuxedo' } ] 0|SPLYT | get asset info from contracts... 0|SPLYT | asset address: 0x64Caa7870d06D468bA3740F4705BA44036a59456 0|SPLYT | environment 0|SPLYT | staging 0|SPLYT | undefined 0|SPLYT | user wallet addr: 0x79074462602aAd182596Fe37b406760A4B86094f 0|SPLYT | user wallet pass: splytcorefoundation 0|SPLYT | successful unlocking of account 0|SPLYT | creating order req.body: { marketPlace: '0x92389eB6c277B71CDe8bd633F8fd00f924e0f771', 0|SPLYT | trxAmount: 7000, 0|SPLYT | quantity: 3, 0|SPLYT | status: 0, 0|SPLYT | buyerWallet: '0x92389eB6c277B71CDe8bd633F8fd00f924e0f771', 0|SPLYT | assetAddress: '0x64Caa7870d06D468bA3740F4705BA44036a59456' } 0|SPLYT | 0x64Caa7870d06D468bA3740F4705BA44036a59456 0|SPLYT | asset address: 0x64Caa7870d06D468bA3740F4705BA44036a59456 0|SPLYT | does a fractional order exist? false 0|SPLYT | orderIdHex: 0x603d470b7e24d73e0c009e6a 0|SPLYT | purchase: 0|SPLYT | order id: 0x603d470b7e24d73e0c009e6a 0|SPLYT | asset address: 0x64Caa7870d06D468bA3740F4705BA44036a59456 0|SPLYT | quantity: 3 0|SPLYT | trxAmount: 7000 0|SPLYT | marketPlace: 0x92389eB6c277B71CDe8bd633F8fd00f924e0f771 0|SPLYT | err creating order: Error: Returned error: Your account is locked. Unlock the account via CLI, personal_unlockAccount or use Trusted Signer. 0|SPLYT | Error buying product 0|SPLYT | { Error: Returned error: Your account is locked. Unlock the account via CLI, personal_unlockAccount or use Trusted Signer. 0|SPLYT | at Object.ErrorResponse (/home/ubuntu/Splyt_Core/node_modules/web3-core-helpers/lib/errors.js:28:19) 0|SPLYT | at /home/ubuntu/Splyt_Core/node_modules/web3-core-requestmanager/lib/index.js:303:36 0|SPLYT | at XMLHttpRequest.request.onreadystatechange (/home/ubuntu/Splyt_Core/node_modules/web3-providers-http/lib/index.js:98:13) 0|SPLYT | at XMLHttpRequestEventTarget.dispatchEvent (/home/ubuntu/Splyt_Core/node_modules/xhr2-cookies/dist/xml-http-request-event-target.js:34:22) 0|SPLYT | at XMLHttpRequest._setReadyState (/home/ubuntu/Splyt_Core/node_modules/xhr2-cookies/dist/xml-http-request.js:208:14) 0|SPLYT | at XMLHttpRequest._onHttpResponseEnd (/home/ubuntu/Splyt_Core/node_modules/xhr2-cookies/dist/xml-http-request.js:318:14) 0|SPLYT | at IncomingMessage. (/home/ubuntu/Splyt_Core/node_modules/xhr2-cookies/dist/xml-http-request.js:289:61) 0|SPLYT | at IncomingMessage.emit (events.js:203:15) 0|SPLYT | at endReadableNT (_stream_readable.js:1145:12) 0|SPLYT | at process._tickCallback (internal/process/next_tick.js:63:19) data: 'NotUnlocked' } 0|SPLYT | Request Body: 0|SPLYT | { 0|SPLYT | "marketPlace": "0x92389eB6c277B71CDe8bd633F8fd00f924e0f771", 0|SPLYT | "trxAmount": 7000, 0|SPLYT | "quantity": 3, 0|SPLYT | "status": 0, 0|SPLYT | "buyerWallet": "0x92389eB6c277B71CDe8bd633F8fd00f924e0f771", 0|SPLYT | "assetAddress": "0x64Caa7870d06D468bA3740F4705BA44036a59456" 0|SPLYT | } 0|SPLYT | Response Body: 0|SPLYT | { 0|SPLYT | "message": "Error: Returned error: Your account is locked. Unlock the account via CLI, personal_unlockAccount or use Trusted Signer.", 0|SPLYT | "requestUrl": "/api/shopifies/item-bought" 0|SPLYT | } 0|SPLYT | Response: 400 1085.959 ms