Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(transpile.js): transpile typed variables with list type #22193

Merged
merged 2 commits into from May 4, 2024

Conversation

samgermain
Copy link
Member

@samgermain samgermain commented Apr 18, 2024

I looked at possibly using unwrapLists but it would be more complicated, and I think that it might actually increase build time as well

tested on #21762


I'm going to leave some notes here about how to do that though in case we decide to go that route

  • pythonTypes and unwrapLists must be move to class variables/methods
  • transpileJavaScriptToPython3 must find all the list typed variables and replace type[] with List[type]

@samgermain
Copy link
Member Author

samgermain commented Apr 18, 2024

unrelated failure: https://app.travis-ci.com/github/ccxt/ccxt/builds/270046356

FAILED bingx (PHP Async ): (explain @ run-tests.js:353)

	

	[INFO] TESTING  php {"exchange":"bingx","symbol":"all","isWs":false} 

	

	[INFO:MAIN] Exchange loaded 1181 symbols

	[INFO:MAIN] Selected SPOT SYMBOL: BTC/USDT

	[INFO:MAIN] Selected SWAP SYMBOL: BTC/USDT:USDT

	[TEST_FAILURE] [AssertionError] timestamp is impossible to be before 1230940800000 (03.01.2009) <<< bingx fetchTickers ::: {"symbol":"OMNI/USDT:USDT","timestamp":0,"datetime":"1970-01-01T00:00:00.000Z","high":null,"low":null,"bid":null,"bidVolume":0,"ask":null,"askVolume":0,"vwap":null,"open":null,"close":null,"last":null,"previousClose":null,"change":null,"percentage":null,"average":null,"baseVolume":0,"quoteVolume":0,"info":{"symbol":"OMNI-USDT","priceChange":"0.00","priceChangePercent":"0.00","lastPrice":"0.00","lastQty":"0.00","highPrice":"0.00","lowPrice":"0.00","volume":"0.00","quoteVolume":"0.00","openPrice":"0.00","openTime":"0","closeTime":"0","askPrice":"0.0","askQty":"0.0","bidPrice":"0.0","bidQty":"0.0"}} >>> 

@samgermain samgermain closed this Apr 18, 2024
@samgermain samgermain reopened this Apr 18, 2024
@samgermain
Copy link
Member Author

unrelated failed build

                },
                'broad': {},
            },
            'commonCurrencies': {
                'SNOW': 'Snowman', // Snowman vs SnowSwap conflict
            },
            'options': {
                'defaultType': 'spot',
                'accountsByType': {
                    'spot': 'FUND',
                    'swap': 'PFUTURES',
                    'future': 'SFUTURES',
                },
                'accountsById': {
                    'FUND': 'spot',
                    'PFUTURES': 'swap',
                    'SFUTURES': 'future',
                },
                'recvWindow': 5 * 1000, // 5 sec
                'broker': 'CCXT',
                'defaultNetworks': {
                    'ETH': 'ETH',
                    'USDT': 'ERC20',
                    'USDC': 'ERC20',
                    'BTC': 'BTC',
                    'LTC': 'LTC',
                },
            },
        });
    } (transpileMethodsToAllLanguages @ transpile.js:1640)
Make sure your methods don't have empty lines! (transpileMethodsToAllLanguages @ transpile.js:1641)
Failed to transpile source code from bingx.ts (transpileDerivedExchangeFile @ transpile.js:1535)
See https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md on how to build this library properly (transpileDerivedExchangeFile @ transpile.js:1536)
file:///C:/projects/ccxt/build/transpile.js:1645
            let keyword = matches[1]
                                 ^
TypeError: Cannot read properties of null (reading '1')
    at Transpiler.transpileMethodsToAllLanguages (file:///C:/projects/ccxt/build/transpile.js:1645:34)
    at Transpiler.transpileClass (file:///C:/projects/ccxt/build/transpile.js:1450:18)
    at Transpiler.transpileDerivedExchangeFile (file:///C:/projects/ccxt/build/transpile.js:1508:88)
    at file:///C:/projects/ccxt/build/transpile.js:1568:67
    at Array.map (<anonymous>)
    at Transpiler.transpileDerivedExchangeFiles (file:///C:/projects/ccxt/build/transpile.js:1568:49)
    at Transpiler.transpileEverything (file:///C:/projects/ccxt/build/transpile.js:2906:30)
    at file:///C:/projects/ccxt/build/transpile.js:2982:30
    at file:///C:/projects/ccxt/build/transpile.js:2983:11
    at ModuleJob.run (node:internal/modules/esm/module_job:218:25)

@samgermain samgermain closed this Apr 23, 2024
@samgermain samgermain reopened this Apr 23, 2024
@samgermain samgermain closed this Apr 23, 2024
@samgermain samgermain reopened this Apr 23, 2024
@samgermain
Copy link
Member Author

@samgermain samgermain closed this Apr 23, 2024
@samgermain samgermain reopened this Apr 23, 2024
@samgermain samgermain closed this Apr 27, 2024
@samgermain samgermain reopened this Apr 27, 2024
@carlosmiei carlosmiei self-assigned this May 4, 2024
@carlosmiei carlosmiei merged commit d36e03b into ccxt:master May 4, 2024
2 checks passed
DelAnt pushed a commit to DelAnt/ccxt that referenced this pull request May 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants