0xproject / 0x-launch-kit-backend Goto Github PK
View Code? Open in Web Editor NEWLaunch a 0x relayer in under a minute [DEPRECATED]
License: Other
Launch a 0x relayer in under a minute [DEPRECATED]
License: Other
Hello,
I add order using /v2/order
api and i fill the order from my application but the order is still returned from /v2/orderbook
API
The service crash on Debian, after minutes running
Error: Failed to fetch parent block.
at Object. (/root/0x/0x-launch-kit/node_modules/ethereumjs-blockstream/output/source/block-reconciler.js:106:27)
at step (/root/0x/0x-launch-kit/node_modules/ethereumjs-blockstream/output/source/block-reconciler.js:32:23)
at Object.next (/root/0x/0x-launch-kit/node_modules/ethereumjs-blockstream/output/source/block-reconciler.js:13:53)
at fulfilled (/root/0x/0x-launch-kit/node_modules/ethereumjs-blockstream/output/source/block-reconciler.js:4:58)
at process._tickCallback (internal/process/next_tick.js:68:7)
{ code: -32000, message: 'unknown block' }
Error: Failed to fetch parent block.
at Object. (/root/0x/0x-launch-kit/node_modules/ethereumjs-blockstream/output/source/block-reconciler.js:106:27)
at step (/root/0x/0x-launch-kit/node_modules/ethereumjs-blockstream/output/source/block-reconciler.js:32:23)
at Object.next (/root/0x/0x-launch-kit/node_modules/ethereumjs-blockstream/output/source/block-reconciler.js:13:53)
at fulfilled (/root/0x/0x-launch-kit/node_modules/ethereumjs-blockstream/output/source/block-reconciler.js:4:58)
at process._tickCallback (internal/process/next_tick.js:68:7)
Error: Failed to fetch parent block.
at Object. (/root/0x/0x-launch-kit/node_modules/ethereumjs-blockstream/output/source/block-reconciler.js:106:27)
at step (/root/0x/0x-launch-kit/node_modules/ethereumjs-blockstream/output/source/block-reconciler.js:32:23)
at Object.next (/root/0x/0x-launch-kit/node_modules/ethereumjs-blockstream/output/source/block-reconciler.js:13:53)
at fulfilled (/root/0x/0x-launch-kit/node_modules/ethereumjs-blockstream/output/source/block-reconciler.js:4:58)
at process._tickCallback (internal/process/next_tick.js:68:7)
When I try to run Launch Kit backend, I get the following issue: Error: ENOENT: no such file or directory, open '%PARENT_PATH%/metadata.json'
where %PARENT_PATH% is the folder above the one where Launch Kit is installed.
To reproduce:
git clone https://github.com/0xProject/0x-launch-kit-backend.git 0x-backend
cd 0x-backend
yarn
yarn start:js
I fixed locally by changing path.join(__dirname, '../../metadata.json');
to path.join(__dirname, '../metadata.json');
in js/config.js
.
Sometimes when you try running 0x-launch-kit
on Windows you'll get an error like this:
Error: Cannot find module './build/Release/scrypt'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:603:15)
at Function.Module._load (internal/modules/cjs/loader.js:529:25)
at Module.require (internal/modules/cjs/loader.js:658:17)
at require (internal/modules/cjs/helpers.js:22:18)
at Object.<anonymous> (C:\Users\leonidlogvinov\0x-launch-kit\node_modules\scrypt\index.js:3:20)
at Module._compile (internal/modules/cjs/loader.js:722:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:733:10)
at Module.load (internal/modules/cjs/loader.js:620:32)
at tryModuleLoad (internal/modules/cjs/loader.js:560:12)
at Function.Module._load (internal/modules/cjs/loader.js:552:3)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
We are aware of that problem but it seems to stem from one of our dependencies, and is an issue shared across many Ethereum dev tools.
Here is the list of issues on other projects related to it that might help you resolve it:
When re-starting the backend service with a database containing a number of orders, the re-initialization is slow as orders are validated before adding to orderwatcher. The validation is per order and can take some time (and become rate limited).
During this time the http service has not been started and will not respond to any requests.
Once the backend is updated with mesh we can bulk add orders and bootstrap efficiently.
Right now, the relay does not retrieve the partially filled value of each order on the orderbook. This is necessary to the UX to not display the full amount on the orderbook or to show to the user that they have less balance locked on the order, as the order was already filled.
Three approaches can be done here to help solve this:
When running yarn
or yarn install
:
error An unexpected error occurred: "https://registry.yarnpkg.com/har-validator/-/har-validator-5.1.2.tgz: Request failed \"404 Not Found\"".
Querying this endpoint via curl is fine but returns a schema error when queried via 0x Connect:
client.getFeeRecipientsAsync()
Error: Expected feeRecipients to conform to schema /relayerApiFeeRecipientsResponseSchema
Encountered: {
"total": 1,
"page": 0,
"perPage": 20,
"records": [
"0x4448FC893284740551a5F776b4EC42cA0B010a1B"
]
}
Validation errors: instance does not match allOf schema [subschema 1] with 1 error[s]:, instance.records[0] does not match pattern "^0x[0-9a-f]{40}$"
at Object.assert (/Users/lauren/github/0x-hackathon/node_modules/@0x/assert/lib/src/index.js:76:19)
at Object.doesConformToSchema (/Users/lauren/github/0x-hackathon/node_modules/@0x/assert/lib/src/index.js:64:24)
curl queries are fine:
curl 'http://localhost:3000/v2/fee_recipients' {"total":1,"page":0,"perPage":20,"records":["0x4448FC893284740551a5F776b4EC42cA0B010a1B"]}
@dekz - Found another one:
When I hit local Launch Kit (.ts version) endpoint via curl /v2/orderbook it is properly returning bids and asks.
But when i use the 0x Connect client for the exact same query it doesn't return the actual records with the rest of the response. Records field is always empty in the response:
client.getOrderbookAsync(
{ "baseAssetData": baseAssetData,
"quoteAssetData": quoteAssetData
})
.then(
(r) => console.log(r),
(e) => console.log(e)
)
// query returns empty records:
{ bids: { total: 0, page: 1, perPage: 10, records: [] },
asks: { total: 5, page: 1, perPage: 10, records: [] } }
Here's what the curl response for same exact query looks like, seems correct:
curl 'http://localhost:3000/v2/orderbook?baseAssetData=0xf47261b00000000000000000000000002002d3812f58e35f0ea1ffbf80a75a38c32175fa"eAssetData=0xf47261b0000000000000000000000000d0a1e359811322d97991e03f863a0c30c2cf029c'
{"bids":{"total":0,"page":0,"perPage":20,"records":[]},"asks":{"total":5,"page":0,"perPage":20,"records":[{"metaData":{},"order":{"signature":"0x1baf04b260c29cad9c6bb8812ea4c61a2681fadd578be000d2e770697d76d90fc811a301d55a161613920bbdeb64798157654b5adc2634f0a1f0579f67c62c04bd02","senderAddress":"0x0000000000000000000000000000000000000000","makerAddress":"0x063aaf1fbbf0238f1cb571a5e9a6d91304798887","takerAddress":"0x0000000000000000000000000000000000000000","makerFee":"0","takerFee":"0","makerAssetAmount":"1000000000000000000","takerAssetAmount":"50000000000000","makerAssetData":"0xf47261b00000000000000000000000002002d3812f58e35f0ea1ffbf80a75a38c32175fa","takerAssetData":"0xf47261b0000000000000000000000000d0a1e359811322d97991e03f863a0c30c2cf029c","salt":"26834400093700189474277646721932965984745061693386137028316104425807600698868","exchangeAddress":"0x35dd2932454449b14cee11a94d3674a936d5d7b2","feeRecipientAddress":"0x0000000000000000000000000000000000000000","expirationTimeSeconds":"1547675321658"}},{"metaData":{},"order":{"signature":"0x1cfe8e9d8a323049babeaa413e507905f2f2a1e8f1e399fa7457db0ab67218024c069d8e82c89cfb519bbd92f1878da527f16c82dda55ed2d05fc2bb8806e922f802","senderAddress":"0x0000000000000000000000000000000000000000","makerAddress":"0x063aaf1fbbf0238f1cb571a5e9a6d91304798887","takerAddress":"0x0000000000000000000000000000000000000000","makerFee":"0","takerFee":"0","makerAssetAmount":"2000000000000000000","takerAssetAmount":"20000000000000","makerAssetData":"0xf47261b00000000000000000000000002002d3812f58e35f0ea1ffbf80a75a38c32175fa","takerAssetData":"0xf47261b0000000000000000000000000d0a1e359811322d97991e03f863a0c30c2cf029c","salt":"23021941304080017233667145501165113484278445408483391664784942613403220214467","exchangeAddress":"0x35dd2932454449b14cee11a94d3674a936d5d7b2","feeRecipientAddress":"0x0000000000000000000000000000000000000000","expirationTimeSeconds":"1547681622628"}},{"metaData":{},"order":{"signature":"0x1b462e392e6008295fa29adb32d68427b7835969eca098942a585422682793f1ed67ad7f5caaa281b4852dd7e9c3acffb8fe123bb36ae62adf4cce71f9e5cef7b402","senderAddress":"0x0000000000000000000000000000000000000000","makerAddress":"0xb78f09d705dedaca26dc99e9ee7d789be7b38fcc","takerAddress":"0x0000000000000000000000000000000000000000","makerFee":"0","takerFee":"0","makerAssetAmount":"1000000000000000000","takerAssetAmount":"10000000000000","makerAssetData":"0xf47261b00000000000000000000000002002d3812f58e35f0ea1ffbf80a75a38c32175fa","takerAssetData":"0xf47261b0000000000000000000000000d0a1e359811322d97991e03f863a0c30c2cf029c","salt":"57718887633272621300663749607971996856877233498333220590130402684590306265495","exchangeAddress":"0x35dd2932454449b14cee11a94d3674a936d5d7b2","feeRecipientAddress":"0x0000000000000000000000000000000000000000","expirationTimeSeconds":"1547684162302"}},{"metaData":{},"order":{"signature":"0x1b34607ea85f31174ec2b6f3c0813c8890144f1e26b57cf75719dff889a930ccf270ec6f397e074643d8ad28f86000325adb1656574d0b78f2e559ac9f9e06f31102","senderAddress":"0x0000000000000000000000000000000000000000","makerAddress":"0xb78f09d705dedaca26dc99e9ee7d789be7b38fcc","takerAddress":"0x0000000000000000000000000000000000000000","makerFee":"0","takerFee":"0","makerAssetAmount":"1000000000000000000","takerAssetAmount":"17000000000000","makerAssetData":"0xf47261b00000000000000000000000002002d3812f58e35f0ea1ffbf80a75a38c32175fa","takerAssetData":"0xf47261b0000000000000000000000000d0a1e359811322d97991e03f863a0c30c2cf029c","salt":"90216706402638628412782469223982886692502260413125767364808989292368542931132","exchangeAddress":"0x35dd2932454449b14cee11a94d3674a936d5d7b2","feeRecipientAddress":"0x0000000000000000000000000000000000000000","expirationTimeSeconds":"1547687884512"}},{"metaData":{},"order":{"signature":"0x1bff4d0aa4ef7657c6c2df7bd959340a0259657a27aeb616fb8d6bca04d94cc8ce3165ddb083c820f1059e2eb39ea8f3bf1d76060458e513ceb3623347c287d0b902","senderAddress":"0x0000000000000000000000000000000000000000","makerAddress":"0x063aaf1fbbf0238f1cb571a5e9a6d91304798887","takerAddress":"0x0000000000000000000000000000000000000000","makerFee":"0","takerFee":"0","makerAssetAmount":"1000000000000000000","takerAssetAmount":"13000000000000","makerAssetData":"0xf47261b00000000000000000000000002002d3812f58e35f0ea1ffbf80a75a38c32175fa","takerAssetData":"0xf47261b0000000000000000000000000d0a1e359811322d97991e03f863a0c30c2cf029c","salt":"62855717622068651739943073684441414449311622915772187888148272159221902181113","exchangeAddress":"0x35dd2932454449b14cee11a94d3674a936d5d7b2","feeRecipientAddress":"0x0000000000000000000000000000000000000000","expirationTimeSeconds":"1547688659771"}}]}}
It appears that OrderWatcher isn't getting the orders in the database when restarted. This means expired orders and invalid orders aren't pruned if the service goes down.
When you restart the container all the orders on the database are lost.
You can fix this problem.
root@9fcc641df655:/usr/src/app# yarn outdated
yarn outdated v1.12.1
info Color legend :
"<red>" : Major Update backward-incompatible updates
"<yellow>" : Minor Update backward-compatible features
"<green>" : Patch Update backward-compatible bug fixes
Package Current Wanted Latest Package Type URL
@0x/assert 2.0.1 2.0.7 2.0.7 dependencies https://github.com/0xProject/0x-monorepo/packages/assert/README.md
@0x/connect 4.0.1 4.0.4 5.0.3 dependencies https://github.com/0xProject/0x-monorepo/packages/connect/README.md
@0x/contract-addresses 2.2.1 2.2.3 2.2.3 dependencies https://github.com/0xProject/0x-monorepo/packages/contract-addresses/README.md
@0x/json-schemas 3.0.1 3.0.7 3.0.7 dependencies https://github.com/0xProject/0x-monorepo/packages/json-schemas/README.md
@0x/order-watcher 3.0.1 3.0.4 4.0.4 dependencies https://github.com/0xProject/0x-monorepo
@0x/subproviders 3.0.1 3.0.3 4.0.3 dependencies
@0x/types 2.0.1 2.2.0 2.2.0 dependencies https://github.com/0xProject/0x-monorepo/packages/types/README.md
@0x/typescript-typings 4.0.0 4.2.0 4.2.0 dependencies https://github.com/0xProject/0x-monorepo/packages/typescript-typings#readme
@0x/utils 4.0.2 4.2.3 4.2.3 dependencies https://github.com/0xProject/0x-monorepo/packages/utils/README.md
@0x/web3-wrapper 4.0.1 4.0.2 6.0.3 dependencies https://github.com/0xProject/0x-monorepo/packages/web3-wrapper/README.md
@babel/polyfill 7.0.0 7.4.0 7.4.0 dependencies https://babeljs.io/
@types/express 4.16.0 4.16.1 4.16.1 devDependencies https://github.com/DefinitelyTyped/DefinitelyTyped.git
@types/lodash 4.14.118 4.14.123 4.14.123 devDependencies https://github.com/DefinitelyTyped/DefinitelyTyped.git
0x.js 4.0.1 4.0.3 6.0.4 dependencies https://github.com/0xProject/0x-monorepo
dotenv 6.2.0 6.2.0 7.0.0 dependencies https://github.com/motdotla/dotenv#readme
http-status-codes 1.3.0 1.3.2 1.3.2 dependencies https://github.com/prettymuchbryce/node-http-status#readme
prettier 1.15.2 1.16.4 1.16.4 devDependencies https://prettier.io
reflect-metadata 0.1.12 0.1.13 0.1.13 dependencies http://rbuckton.github.io/reflect-metadata
sqlite3 4.0.4 4.0.6 4.0.6 dependencies http://github.com/mapbox/node-sqlite3
tslint 5.11.0 5.14.0 5.14.0 devDependencies https://palantir.github.io/tslint
typeorm 0.2.7 0.2.7 0.2.15 dependencies https://github.com/typeorm/typeorm#readme
typescript 3.1.6 3.3.4000 3.3.4000 devDependencies https://www.typescriptlang.org/
The colors got lost in copy/pasting. @0x/connect, @0x/order-watcher, @0x/subproviders, @0x/web3-wrapper, 0x.js, and dotenv, are all red and so will need to be upgraded manually. The others can be easily upgraded with yarn upgrade
The changes for 0x.js look like they should be compatible. I haven't looked at the other changelogs. https://github.com/0xProject/0x-monorepo/tree/development/packages
Let's add SRA-compliant WS hooks: https://github.com/0xProject/standard-relayer-api
In publishing the latest versions of the 0x Python packages, we're migrating from v4 to v5 of Web3.py. v5 will not accept any non-checksummed addresses for any inputs to any contracts.
We have an end-to-end tested example of the Python SRA client, which creates an order, posts it to the Launch Kit backend, retrieves the order from the order book, and then fills the order. After migrating this example to v5 of Web3.py, this test is failing with the following output:
131 ... expirationTimeSeconds=round(
132 ... (datetime.utcnow() + timedelta(days=1)).timestamp()
133 ... )
134 ... )
135
136 >>> from zero_ex.order_utils import generate_order_hash_hex
137 >>> order_hash_hex = generate_order_hash_hex(
138 ... order, contract_addresses.exchange
139 ... )
140 >>> relayer.post_order_with_http_info(
UNEXPECTED EXCEPTION: ApiException()
Traceback (most recent call last):
File "/home/gene/.pythonz/pythons/CPython-3.7.2/lib/python3.7/doctest.py", line 1329, in __run
compileflags, 1), test.globs)
File "<doctest zero_ex.sra_client[21]>", line 7, in <module>
File "/home/gene/dev/0x-monorepo/python-packages/sra_client/src/zero_ex/sra_client/api/default_api.py", line 1096, in post_order_with_http_info
collection_formats=collection_formats,
File "/home/gene/dev/0x-monorepo/python-packages/sra_client/src/zero_ex/sra_client/api_client.py", line 385, in call_api
_request_timeout,
File "/home/gene/dev/0x-monorepo/python-packages/sra_client/src/zero_ex/sra_client/api_client.py", line 183, in __call_api
_request_timeout=_request_timeout,
File "/home/gene/dev/0x-monorepo/python-packages/sra_client/src/zero_ex/sra_client/api_client.py", line 455, in request
body=body,
File "/home/gene/dev/0x-monorepo/python-packages/sra_client/src/zero_ex/sra_client/rest.py", line 349, in POST
body=body,
File "/home/gene/dev/0x-monorepo/python-packages/sra_client/src/zero_ex/sra_client/rest.py", line 253, in request
raise ApiException(http_resp=r)
zero_ex.sra_client.rest.ApiException: (400)
Reason: Bad Request
HTTP response headers: HTTPHeaderDict({'X-Powered-By': 'Express', 'Access-Control-Allow-Origin': '*', 'Content-Type': 'application/json; charset=utf-8', 'Content-Length': '267', 'ETag': 'W/"10b-nhI1Hv/zADdsZ/uIGTlKZ6WiCIo"', 'Date': 'Wed, 07 Aug 2019 23:32:56 GMT', 'Connection': 'keep-alive'})
HTTP response body: {"code":100,"reason":"Validation Failed","validationErrors":[{"field":"instance","code":1001,"reason":"does not match allOf schema </orderSchema> with 1 error[s]:"},{"field":"instance.makerAddress","code":1001,"reason":"does not match pattern \"^0x[0-9a-f]{40}$\""}]}
/home/gene/dev/0x-monorepo/python-packages/sra_client/src/zero_ex/sra_client/__init__.py:140: UnexpectedException
The reason for the failure is that the example is sending a checksummed (mixed case) address for the makerAddress
, and this build of Launch Kit is verifying that address against an old version of @0x/json-schemas
. In version 3.1.1.1 the schemas were updated to allow for mixed case addresses.
However, simply accepting mixed case addresses in posting an order will not be sufficient to get these Python SRA client example working, because after posting an order, the example retrieves the order and fills it. So Launch Kit must also be changed to store the orders in mixed case as well, such that the retrieval will yield the case given in the posting.
I have deployed both 0x-launch-kit-backend and 0x-launch-kit-frontend in my local system
I can able to create a sell order. It is listed in orders
I am running things in Ropsten Testnet
In 0X Instant Html code . I replace my relayer URL in orderSource and mention networkId:3
I can get values in record in asset_pairs api
While run instant in-browser got "Tokens Unavailable".
Thanks in advance
Sorry for my bad English.
getting quite a few error message like failed to get price of currency pair mkr/weth
in Chrome console and UI does not accept (show?) any orders using wETH on Kovan and infura/Kovan with my project ID.
backend.js:6 0x-launch-kit-frontend::Market::Actions Failed to get price of currency pair zrx/weth
Im getting Unknown fee token: 0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2
error when trying to use this settings:
MAKER_FEE_ASSET_DATA: '0xf47261b0000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2'
TAKER_FEE_ASSET_DATA: '0xf47261b0000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2'
MAKER_FEE_UNIT_AMOUNT: '100000000000000'
TAKER_FEE_UNIT_AMOUNT: '100000000000000'
The token id should be stripped out of the asset pairs endpoint so that only a single asset pair per contract is returned.
Adding 10 ERC721 Axie orders would result in 10 different asset pairs.
1 Asset pair per ERC721 contract
Hi @dekz,
Following up on our video chat earlier...
Pasted my console output below.
(Context: Running 0x Launch Kit locally in .ts mode and generating signed orders via CodeSandbox)
Steps to reproduce:
1/ Generate signed order (in this case, from CodeSandbox w/ Metamask)
2/ Use 0x Connect to .submitOrderAsync() to local Launch Kit Relayer
3/ Query local Launch Kit via CLI GET request, see that it returns order data properly. example:
curl http://localhost:3000/v2/order/0xc29a9d9b797f0071b80aacf66369d866f2ddabff1a91dddbfe5fcd954158ec25
4/ Query local Launch Kit with 0x Connect via .getOrderAsync() and get error from /relayerApiOrderSchema, example:
client.getOrderAsync('0xc29a9d9b797f0071b80aacf66369d866f2ddabff1a91dddbfe5fcd954158ec25')
Error:
client.getOrderAsync('0xc29a9d9b797f0071b80aacf66369d866f2ddabff1a91dddbfe5fcd954158ec25')
Error: Expected relayerApiOrder to conform to schema /relayerApiOrderSchema
Encountered: {
"signature": "0x1b462e392e6008295fa29adb32d68427b7835969eca098942a585422682793f1ed67ad7f5caaa281b4852dd7e9c3acffb8fe123bb36ae62adf4cce71f9e5cef7b402",
"senderAddress": "0x0000000000000000000000000000000000000000",
"makerAddress": "0xb78f09d705dedaca26dc99e9ee7d789be7b38fcc",
"takerAddress": "0x0000000000000000000000000000000000000000",
"makerFee": "0",
"takerFee": "0",
"makerAssetAmount": "1000000000000000000",
"takerAssetAmount": "10000000000000",
"makerAssetData": "0xf47261b00000000000000000000000002002d3812f58e35f0ea1ffbf80a75a38c32175fa",
"takerAssetData": "0xf47261b0000000000000000000000000d0a1e359811322d97991e03f863a0c30c2cf029c",
"salt": "57718887633272621300663749607971996856877233498333220590130402684590306265495",
"exchangeAddress": "0x35dd2932454449b14cee11a94d3674a936d5d7b2",
"feeRecipientAddress": "0x0000000000000000000000000000000000000000",
"expirationTimeSeconds": "1547684162302"
}
Validation errors: instance requires property "order", instance requires property "metaData"
at Object.assert (/Users/lauren/github/0x-hackathon/node_modules/@0x/assert/lib/src/index.js:76:19)
at Object.doesConformToSchema (/Users/lauren/github/0x-hackathon/node_modules/@0x/assert/lib/src/index.js:64:24)...
Accidentally leaked my database passwords because even though its in .gitignore, it appears to have been included in the git cache. Was lucky to catch it on the test database, but could be bad if others don't notice
Hey, I delete the js directory then run yarn build:ts
and the js directory still doesn't appear.
SRA Docs:
Bids will be sorted in descending order by price, and asks will be sorted in ascending order by price. Within the price sorted orders, the orders are further sorted by taker fee price which is defined as the takerFee divided by takerTokenAmount. After taker fee price, orders are to be sorted by expiration in ascending order.
If an SRA pull orders from mesh to their local database can get orders with proxy id's different than ERC20 and ERC721, this causes the endpoint get v2/asset_pairs to fail because mesh orders could be AssetProxyId.MultiAsset, AssetProxyId.StaticCall, AssetProxyId.ERC1155. We can solve this filtering the orders which have non-supported proxy's
public static async getAssetPairsAsync(
page: number,
perPage: number,
assetDataA: string,
assetDataB: string,
): Promise<PaginatedCollection<AssetPairsItem>> {
const connection = getDBConnection();
const signedOrderModels = (await connection.manager.find(SignedOrderModel)) as Array<
Required<SignedOrderModel>
;
const assetPairsItems: AssetPairsItem[] = signedOrderModels.map(deserializeOrder).filter(filterNonAsset).map(signedOrderToAssetPair);
using this function:
const filterNonAsset = (signedOrder: SignedOrder): boolean => {
const assetProxyId = assetDataUtils.decodeAssetProxyId(signedOrder.makerAssetData);
switch (assetProxyId) {
case AssetProxyId.MultiAsset:
return false;
case AssetProxyId.StaticCall:
return false;
case AssetProxyId.ERC1155:
return false;
default:
return true;
}
};
Hey, is asset_pairs supposed to give a list of supported asset pairs, or a list of asset_pairs which currently have maker orders
Hey, in the fee config, does 1
refer to 1 ZRX or 10^-18 ZRX
https://github.com/0xProject/0x-launch-kit/blob/master/ts/src/config.ts#L37
https://github.com/0xProject/0x-launch-kit/blob/master/ts/src/config.ts#L41
Although I git the 0x-lauch-kit package (backend + frontend) to work out of the box, whenever I try just to run the backend, it fails to accept ws connections and to retrieve price data.
The Chrome console is filled with error messages like :
browser.js:19 WebSocket connection to 'ws://127.0.0.1:3000/' failed: Error during WebSocket handshake: Unexpected response code: 404
W3CWebSocket @ browser.js:19
(anonymous) @ orders_channel_factory.js:168
(anonymous) @ orders_channel_factory.js:167
step @ orders_channel_factory.js:125
(anonymous) @ orders_channel_factory.js:55
(anonymous) @ orders_channel_factory.js:27
push../node_modules/@0x/connect/lib/src/orders_channel_factory.js.__awaiter @ orders_channel_factory.js:4
createWebSocketOrdersChannelAsync @ orders_channel_factory.js:161
(anonymous) @ sra_websocket_order_provider.js:603
step @ sra_websocket_order_provider.js:167
(anonymous) @ sra_websocket_order_provider.js:97
(anonymous) @ sra_websocket_order_provider.js:69
push../node_modules/@0x/orderbook/lib/src/order_provider/sra_websocket_order_provider.js.__awaiter @ sra_websocket_order_provider.js:46
SRAWebsocketOrderProvider._createOrdersChannelAsync @ sra_websocket_order_provider.js:526
(anonymous) @ sra_websocket_order_provider.js:359
step @ sra_websocket_order_provider.js:167
(anonymous) @ sra_websocket_order_provider.js:97
fulfilled @ sra_websocket_order_provider.js:49
index.js:1437 0x-launch-kit-frontend::Market::Actions Failed to get price of currency pair zrx/weth
console.<computed> @ index.js:1437
r @ backend.js:6
t.<computed> @ logdown.min.js:149
_callee2$ @ actions.ts:91
tryCatch @ runtime.js:45
invoke @ runtime.js:264
prototype.<computed> @ runtime.js:98
asyncGeneratorStep @ asyncToGenerator.js:3
_throw @ asyncToGenerator.js:29
logdown.min.js:149 0x-launch-kit-frontend::gas_price_estimation {gasPriceInWei: BigNumber, estimatedTimeMs: 30000}
browser.js:19 WebSocket connection to 'ws://127.0.0.1:3000/' failed: Error during WebSocket handshake: Unexpected response code: 404
W3CWebSocket @ browser.js:19
(anonymous) @ orders_channel_factory.js:168
(anonymous) @ orders_channel_factory.js:167
step @ orders_channel_factory.js:125
(anonymous) @ orders_channel_factory.js:55
(anonymous) @ orders_channel_factory.js:27
push../node_modules/@0x/connect/lib/src/orders_channel_factory.js.__awaiter @ orders_channel_factory.js:4
createWebSocketOrdersChannelAsync @ orders_channel_factory.js:161
(anonymous) @ sra_websocket_order_provider.js:603
step @ sra_websocket_order_provider.js:167
(anonymous) @ sra_websocket_order_provider.js:97
(anonymous) @ sra_websocket_order_provider.js:69
push../node_modules/@0x/orderbook/lib/src/order_provider/sra_websocket_order_provider.js.__awaiter @ sra_websocket_order_provider.js:46
SRAWebsocketOrderProvider._createOrdersChannelAsync @ sra_websocket_order_provider.js:526
(anonymous) @ sra_websocket_order_provider.js:359
step @ sra_websocket_order_provider.js:167
(anonymous) @ sra_websocket_order_provider.js:97
fulfilled @ sra_websocket_order_provider.js:49
index.js:1437 0x-launch-kit-frontend::Store::Market::Actions getUserOrders: fetch orders from the relayer failed. Error: Creating websocket connection to ws://127.0.0.1:3000/
at SRAWebsocketOrderProvider.<anonymous> (sra_websocket_order_provider.js:612)
at step (sra_websocket_order_provider.js:167)
at Object.throw (sra_websocket_order_provider.js:97)
at rejected (sra_websocket_order_provider.js:57)
console.<computed> @ index.js:1437
r @ backend.js:6
t.<computed> @ logdown.min.js:149
_callee2$ @ actions.ts:104
tryCatch @ runtime.js:45
invoke @ runtime.js:264
prototype.<computed> @ runtime.js:98
asyncGeneratorStep @ asyncToGenerator.js:3
_throw @ asyncToGenerator.js:29
browser.js:19 WebSocket connection to 'ws://127.0.0.1:3000/' failed: Error during WebSocket handshake: Unexpected response code: 404
W3CWebSocket @ browser.js:19
(anonymous) @ orders_channel_factory.js:168
(anonymous) @ orders_channel_factory.js:167
step @ orders_channel_factory.js:125
(anonymous) @ orders_channel_factory.js:55
(anonymous) @ orders_channel_factory.js:27
push../node_modules/@0x/connect/lib/src/orders_channel_factory.js.__awaiter @ orders_channel_factory.js:4
createWebSocketOrdersChannelAsync @ orders_channel_factory.js:161
(anonymous) @ sra_websocket_order_provider.js:603
step @ sra_websocket_order_provider.js:167
(anonymous) @ sra_websocket_order_provider.js:97
(anonymous) @ sra_websocket_order_provider.js:69
push../node_modules/@0x/orderbook/lib/src/order_provider/sra_websocket_order_provider.js.__awaiter @ sra_websocket_order_provider.js:46
SRAWebsocketOrderProvider._createOrdersChannelAsync @ sra_websocket_order_provider.js:526
(anonymous) @ sra_websocket_order_provider.js:359
step @ sra_websocket_order_provider.js:167
(anonymous) @ sra_websocket_order_provider.js:97
fulfilled @ sra_websocket_order_provider.js:49
index.js:1437 0x-launch-kit-frontend::Store::Market::Actions getAllOrders: fetch orders from the relayer failed. Error: Creating websocket connection to ws://127.0.0.1:3000/
at SRAWebsocketOrderProvider.<anonymous> (sra_websocket_order_provider.js:612)
at step (sra_websocket_order_provider.js:167)
at Object.throw (sra_websocket_order_provider.js:97)
at rejected (sra_websocket_order_provider.js:57)
console.<computed> @ index.js:1437
r @ backend.js:6
t.<computed> @ logdown.min.js:149
_callee$ @ actions.ts:83
tryCatch @ runtime.js:45
invoke @ runtime.js:264
prototype.<computed> @ runtime.js:98
asyncGeneratorStep @ asyncToGenerator.js:3
_throw @ asyncToGenerator.js:29
Promise.then (async)
asyncGeneratorStep @ asyncToGenerator.js:13
_next @ asyncToGenerator.js:25
(anonymous) @ asyncToGenerator.js:32
(anonymous) @ asyncToGenerator.js:21
(anonymous) @ actions.ts:66
(anonymous) @ index.js:8
dispatch @ redux.js:613
_callee7$ @ actions.ts:300
tryCatch @ runtime.js:45
invoke @ runtime.js:264
prototype.<computed> @ runtime.js:98
asyncGeneratorStep @ asyncToGenerator.js:3
_next @ asyncToGenerator.js:25
(anonymous) @ asyncToGenerator.js:32
(anonymous) @ asyncToGenerator.js:21
(anonymous) @ actions.ts:298
(anonymous) @ index.js:8
dispatch @ redux.js:613
_callee3$ @ actions.ts:54
tryCatch @ runtime.js:45
invoke @ runtime.js:264
prototype.<computed> @ runtime.js:98
asyncGeneratorStep @ asyncToGenerator.js:3
_next @ asyncToGenerator.js:25
(anonymous) @ asyncToGenerator.js:32
(anonymous) @ asyncToGenerator.js:21
(anonymous) @ actions.ts:45
(anonymous) @ index.js:8
dispatch @ redux.js:613
_callee$ @ actions.ts:31
tryCatch @ runtime.js:45
invoke @ runtime.js:264
prototype.<computed> @ runtime.js:98
asyncGeneratorStep @ asyncToGenerator.js:3
_next @ asyncToGenerator.js:25
Promise.then (async)
asyncGeneratorStep @ asyncToGenerator.js:13
_next @ asyncToGenerator.js:25
Promise.then (async)
asyncGeneratorStep @ asyncToGenerator.js:13
_next @ asyncToGenerator.js:25
(anonymous) @ asyncToGenerator.js:32
(anonymous) @ asyncToGenerator.js:21
(anonymous) @ actions.ts:20
(anonymous) @ index.js:8
onUpdateStore @ app.tsx:103
_callee2$ @ app.tsx:66
tryCatch @ runtime.js:45
invoke @ runtime.js:264
prototype.<computed> @ runtime.js:98
asyncGeneratorStep @ asyncToGenerator.js:3
_next @ asyncToGenerator.js:25
(anonymous) @ asyncToGenerator.js:32
(anonymous) @ asyncToGenerator.js:21
Show 14 more frames
logdown.min.js:149 0x-launch-kit-frontend::gas_price_estimation {gasPriceInWei: BigNumber, estimatedTimeMs: 30000}
browser.js:19 WebSocket connection to 'ws://127.0.0.1:3000/' failed: Error during WebSocket handshake: Unexpected response code: 404
W3CWebSocket @ browser.js:19
(anonymous) @ orders_channel_factory.js:168
(anonymous) @ orders_channel_factory.js:167
step @ orders_channel_factory.js:125
(anonymous) @ orders_channel_factory.js:55
(anonymous) @ orders_channel_factory.js:27
push../node_modules/@0x/connect/lib/src/orders_channel_factory.js.__awaiter @ orders_channel_factory.js:4
createWebSocketOrdersChannelAsync @ orders_channel_factory.js:161
(anonymous) @ sra_websocket_order_provider.js:603
step @ sra_websocket_order_provider.js:167
(anonymous) @ sra_websocket_order_provider.js:97
(anonymous) @ sra_websocket_order_provider.js:69
push../node_modules/@0x/orderbook/lib/src/order_provider/sra_websocket_order_provider.js.__awaiter @ sra_websocket_order_provider.js:46
SRAWebsocketOrderProvider._createOrdersChannelAsync @ sra_websocket_order_provider.js:526
(anonymous) @ sra_websocket_order_provider.js:359
step @ sra_websocket_order_provider.js:167
(anonymous) @ sra_websocket_order_provider.js:97
fulfilled @ sra_websocket_order_provider.js:49
index.js:1437 0x-launch-kit-frontend::Store::Market::Actions getUserOrders: fetch orders from the relayer failed. Error: Creating websocket connection to ws://127.0.0.1:3000/
at SRAWebsocketOrderProvider.<anonymous> (sra_websocket_order_provider.js:612)
at step (sra_websocket_order_provider.js:167)
at Object.throw (sra_websocket_order_provider.js:97)
at rejected (sra_websocket_order_provider.js:57)
console.<computed> @ index.js:1437
r @ backend.js:6
t.<computed> @ logdown.min.js:149
_callee2$ @ actions.ts:104
tryCatch @ runtime.js:45
invoke @ runtime.js:264
prototype.<computed> @ runtime.js:98
asyncGeneratorStep @ asyncToGenerator.js:3
_throw @ asyncToGenerator.js:29
logdown.min.js:149 0x-launch-kit-frontend::gas_price_estimation {gasPriceInWei: BigNumber, estimatedTimeMs: 30000}
browser.js:19 WebSocket connection to 'ws://127.0.0.1:3000/' failed: Error during WebSocket handshake: Unexpected response code: 404
W3CWebSocket @ browser.js:19
(anonymous) @ orders_channel_factory.js:168
(anonymous) @ orders_channel_factory.js:167
step @ orders_channel_factory.js:125
(anonymous) @ orders_channel_factory.js:55
(anonymous) @ orders_channel_factory.js:27
push../node_modules/@0x/connect/lib/src/orders_channel_factory.js.__awaiter @ orders_channel_factory.js:4
createWebSocketOrdersChannelAsync @ orders_channel_factory.js:161
(anonymous) @ sra_websocket_order_provider.js:603
step @ sra_websocket_order_provider.js:167
(anonymous) @ sra_websocket_order_provider.js:97
(anonymous) @ sra_websocket_order_provider.js:69
push../node_modules/@0x/orderbook/lib/src/order_provider/sra_websocket_order_provider.js.__awaiter @ sra_websocket_order_provider.js:46
SRAWebsocketOrderProvider._createOrdersChannelAsync @ sra_websocket_order_provider.js:526
(anonymous) @ sra_websocket_order_provider.js:359
step @ sra_websocket_order_provider.js:167
(anonymous) @ sra_websocket_order_provider.js:97
fulfilled @ sra_websocket_order_provider.js:49
index.js:1437 0x-launch-kit-frontend::Market::Actions Failed to get price of currency pair mkr/weth
console.<computed> @ index.js:1437
r @ backend.js:6
t.<computed> @ logdown.min.js:149
_callee2$ @ actions.ts:91
tryCatch @ runtime.js:45
invoke @ runtime.js:264
prototype.<computed> @ runtime.js:98
asyncGeneratorStep @ asyncToGenerator.js:3
_throw @ asyncToGenerator.js:29
browser.js:19 WebSocket connection to 'ws://127.0.0.1:3000/' failed: Error during WebSocket handshake: Unexpected response code: 404
W3CWebSocket @ browser.js:19
(anonymous) @ orders_channel_factory.js:168
(anonymous) @ orders_channel_factory.js:167
step @ orders_channel_factory.js:125
(anonymous) @ orders_channel_factory.js:55
(anonymous) @ orders_channel_factory.js:27
push../node_modules/@0x/connect/lib/src/orders_channel_factory.js.__awaiter @ orders_channel_factory.js:4
createWebSocketOrdersChannelAsync @ orders_channel_factory.js:161
(anonymous) @ sra_websocket_order_provider.js:603
step @ sra_websocket_order_provider.js:167
(anonymous) @ sra_websocket_order_provider.js:97
(anonymous) @ sra_websocket_order_provider.js:69
push../node_modules/@0x/orderbook/lib/src/order_provider/sra_websocket_order_provider.js.__awaiter @ sra_websocket_order_provider.js:46
SRAWebsocketOrderProvider._createOrdersChannelAsync @ sra_websocket_order_provider.js:526
(anonymous) @ sra_websocket_order_provider.js:359
step @ sra_websocket_order_provider.js:167
(anonymous) @ sra_websocket_order_provider.js:97
fulfilled @ sra_websocket_order_provider.js:49
index.js:1437 0x-launch-kit-frontend::Market::Actions Failed to get price of currency pair feo1/weth
console.<computed> @ index.js:1437
r @ backend.js:6
t.<computed> @ logdown.min.js:149
_callee2$ @ actions.ts:91
tryCatch @ runtime.js:45
invoke @ runtime.js:264
prototype.<computed> @ runtime.js:98
asyncGeneratorStep @ asyncToGenerator.js:3
_throw @ asyncToGenerator.js:29
Promise.then (async)
asyncGeneratorStep @ asyncToGenerator.js:13
_next @ asyncToGenerator.js:25
(anonymous) @ asyncToGenerator.js:32
(anonymous) @ asyncToGenerator.js:21
(anonymous) @ actions.ts:79
_callee3$ @ actions.ts:74
tryCatch @ runtime.js:45
invoke @ runtime.js:264
prototype.<computed> @ runtime.js:98
asyncGeneratorStep @ asyncToGenerator.js:3
_next @ asyncToGenerator.js:25
(anonymous) @ asyncToGenerator.js:32
(anonymous) @ asyncToGenerator.js:21
(anonymous) @ actions.ts:74
(anonymous) @ index.js:8
dispatch @ redux.js:613
_callee3$ @ actions.ts:45
tryCatch @ runtime.js:45
invoke @ runtime.js:264
prototype.<computed> @ runtime.js:98
asyncGeneratorStep @ asyncToGenerator.js:3
_next @ asyncToGenerator.js:25
(anonymous) @ asyncToGenerator.js:32
(anonymous) @ asyncToGenerator.js:21
(anonymous) @ actions.ts:45
(anonymous) @ index.js:8
dispatch @ redux.js:613
_callee$ @ actions.ts:31
tryCatch @ runtime.js:45
invoke @ runtime.js:264
prototype.<computed> @ runtime.js:98
asyncGeneratorStep @ asyncToGenerator.js:3
_next @ asyncToGenerator.js:25
Promise.then (async)
asyncGeneratorStep @ asyncToGenerator.js:13
_next @ asyncToGenerator.js:25
Promise.then (async)
asyncGeneratorStep @ asyncToGenerator.js:13
_next @ asyncToGenerator.js:25
(anonymous) @ asyncToGenerator.js:32
(anonymous) @ asyncToGenerator.js:21
(anonymous) @ actions.ts:20
(anonymous) @ index.js:8
onUpdateStore @ app.tsx:103
_callee2$ @ app.tsx:66
tryCatch @ runtime.js:45
invoke @ runtime.js:264
prototype.<computed> @ runtime.js:98
asyncGeneratorStep @ asyncToGenerator.js:3
_next @ asyncToGenerator.js:25
(anonymous) @ asyncToGenerator.js:32
(anonymous) @ asyncToGenerator.js:21
Show 12 more frames
browser.js:19 WebSocket connection to 'ws://127.0.0.1:3000/' failed: Error during WebSocket handshake: Unexpected response code: 404
Hey, I'm working on adding an admin panel and heroku buildpack to 0x-launch-kit in a fork. Wondering if I should keep it as a separate fork, or merge into 0x-launch-kit.
After running yarn start:js
and curl http://localhost:3000/v2/orders
, the following error is displayed.
EntityMetadataNotFound: No metadata for "SignedOrderModel" was found.
This error is only an issue when using the js codebase. When using the ts codebase there are no typeorm errors.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.