├── .gitattributes ├── .gitignore ├── CHANGELOG.md ├── LICENSE ├── README.md ├── fetch-cache.js ├── hotfix.js ├── hotfix ├── opensea-lib-seaport.js └── safe-event-emitter-index.js ├── offers.js └── package.json /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /node_modules/ 2 | 3 | package-lock.json 4 | 5 | config.json 6 | list.txt 7 | log.txt 8 | proxy.txt 9 | .stop 10 | *.zip 11 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## 06.04.2022 2 | *Version 0.2.17* 3 | - Limit acquiring orders. 4 | - Upgrade to OpenSea 3.0.2. 5 | 6 | ## 13.03.2022 7 | *Version 0.2.16* 8 | - Fix acquire buy orders. 9 | 10 | ## 20.02.2022 11 | *Version 0.2.15* 12 | - Add timeout for `getAsset` call. 13 | 14 | *Version 0.2.14* 15 | - Upgrade to OpenSea 2.0.1. 16 | - Ignore cache for proxy checking and public IP fetching. 17 | - Fix for fetch timeout error handling (`AbortError`). 18 | 19 | ## 10.02.2022 20 | *Version 0.2.13* 21 | - Update fetch cache. 22 | - Fix wallet provider engine error handling (`ERR_UNHANDLED_ERROR`). 23 | - Properly stop wallet provider engine. 24 | - Add `clear_cache_threshold` option. 25 | 26 | ## 08.02.2022 27 | *Version 0.2.12* 28 | - Use OpenSea SDK v1.2.8. 29 | - Add custom fetch cache. 30 | - Add `skip_if_too_low` option. 31 | - Add `--log_fetch_all` option and command line argument. 32 | - Add `--log_fetch` command line argument. 33 | - Add `--log_full` command line argument. 34 | - Add `--api_key` command line argument. 35 | - Add delay adjustment and fetch delay. 36 | 37 | ## 02.02.2022 38 | *Version 0.2.11* 39 | - Fix proxy checking. 40 | - Add `--wallet` command line argument. 41 | - Add `price_increment_factor` option. 42 | - Remove restart mechanic, bot is stable enough. 43 | - Proxy fixes. Log public IP. 44 | 45 | ## 24.01.2022 46 | *Version 0.2.10* 47 | - Node.js v8 compatibility. 48 | - Fix `--resume` command line argument. 49 | - Simplify delay options. 50 | - Timeouts for SDK calls. 51 | - Add private keys option in config. 52 | 53 | ## 04.12.2021 54 | *Version 0.2.9* 55 | - Use OpenSea SDK v1.2.2. 56 | 57 | ## 19.11.2021 58 | *Version 0.2.8* 59 | - Add Troubleshooting in README. 60 | - Add option to install with Node v8.11. 61 | 62 | ## 30.10.2021 63 | *Version 0.2.7* 64 | - Add `skip_if_order_created` option in config. 65 | 66 | ## 22.10.2021 67 | *Version 0.2.6* 68 | - Error handling fix. 69 | 70 | ## 18.10.2021 71 | *Version 0.2.5* 72 | - Remove config options: 73 | - `no_skip`; 74 | - `exit_timeout`; 75 | - monitoring settings. 76 | - Add config options: 77 | - `random_delay`; 78 | - `acquire_delay`; 79 | - `acquire_random_delay`; 80 | - `skip_if_have_bid`; 81 | - `discard_threshold`. 82 | - Rename config options: 83 | - `log_all` to `log_full`; 84 | - `skip_if_lower` to `skip_if_too_high`; 85 | - `fail_threshold` to `switch_threshold`. 86 | - Add `--resume=` command line argument. 87 | - Check for success with error. 88 | - Remove scheduling and async code for better stability. 89 | 90 | ## 29.09.2021 91 | *Version 0.2.4* 92 | - Add fetch timeout in config. 93 | - Add `log_all` option in config. 94 | 95 | ## 27.09.2021 96 | *Version 0.2.3* 97 | - Mutex fixes. 98 | 99 | ## 23.09.2021 100 | *Version 0.2.2* 101 | - Use mutex locking for processing. 102 | - `skip_if_lower` and `skip_if_owner_is_buyer` options in config. 103 | - Fetch cache. 104 | - Add proxy switching delay. 105 | - Hotfixes: 106 | - OpenSea wETH approval requests disabled. 107 | - Add error handler for `safe-event-emitter`. 108 | 109 | ## 22.09.2021 110 | *Version 0.2.1* 111 | - Tag `v0.2.1`. 112 | - Add proxy notation in `README`. 113 | 114 | ## 15.09.2021 115 | *Version 0.1.12* 116 | - Add `restart_threshold` option in config. 117 | - Add `proxy_checking` option in config. 118 | - Add `log_fetch` option in config. 119 | - Destroy agents when switch proxy. 120 | - Don't fetch asset if no need. 121 | 122 | ## 11.09.2021 123 | *Version 0.1.11* 124 | - Expiration time bug fix. 125 | 126 | ## 10.09.2021 127 | *Version 0.1.10* 128 | - Improve proxy support. 129 | - Add socks proxy support. 130 | - Add proxy checking. 131 | - Add Cookie and User-Agent in config. 132 | 133 | ## 09.09.2021 134 | *Version 0.1.9* 135 | - Add http proxy support. 136 | - Add restart delay option. 137 | 138 | ## 08.09.2021 139 | *Version 0.1.8* 140 | - Add no skip option in config. 141 | 142 | *Version 0.1.7* 143 | - Skipping fix. 144 | 145 | *Version 0.1.6* 146 | - Advanced price settings in list file. 147 | - Auto restart. 148 | - Progress saving. 149 | - No duplicate offers. 150 | 151 | ## 07.09.2021 152 | *Version 0.1.5* 153 | - Auto price feature. 154 | - Event handling. 155 | 156 | ## 04.09.2021 157 | *Version 0.1.4* 158 | - Monitoring feature. 159 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2021-2022 Mitya Selivanov 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 19 | SOFTWARE. 20 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # sea-offers-bot-js 2 | Multiple buy orders **bot** for **OpenSea** with automatic price calculation and proxy support. 3 | 4 | If something don't work, feel free to [open an issue][issues-link]. 5 | 6 | The code is **obfuscated**. [Contact me][contact-link] if you need access to unobfuscated source code, guidance, or you have a new feature proposal. 7 | 8 | Join [our Discord][discord-link]! 9 | 10 | ## Some tips to successfully run automatic operations on OpenSea 11 | - Have an OpenSea [API key][api-key-link]. 12 | - Use proxies. In case you don't have a good private proxy, Tor is currently better than any bad or public proxy. 13 | - Specify Cookies and User-Agent. 14 | - Specify random delays. 15 | - You can run multiple bot instances simultaneously with different configurations. 16 | - Don't do too many requests in a short time. 17 | 18 | You can use this bot alongside with [tor-multiproxy][tor-multiproxy-link]. 19 | 20 | Be very precautious with automatic trading! 21 | Have a separate account with small balance for testing unknown bots and services. 22 | 23 | ## Configuration 24 | 25 | ### Required settings 26 | - `network` - network name (use `mainnet` or `rinkeby`). 27 | - `infura_key` or `alchemy_key` - Infura or Alchemy node API key. 28 | - `mnemonic` or `private_keys` - MetaMask mnemonic phrase or array with private keys. 29 | - `wallet_address` - buyer wallet address. 30 | - `opensea_key` - OpenSea API key. 31 | 32 | ### Optional settings 33 | - `expiration` - expiration time for offer in hours. Default: `24`. 34 | - `discard_threshold` - how much consecutive fails to discard an asset. Default: `10`. 35 | - `price_auto` - enable auto price calculation. Default: `true`. 36 | - `price_floor` - minimum price in `wETH`. Default: `0.0001`. 37 | - `price_roof` - maximum price in `wETH`. Default: `1`. 38 | - `price_epsilon` - price increment in `wETH`. Default: `0.0001`. 39 | - `price_increment_factor`- minimum price increment factor. Default: `0.1` (10%). 40 | - Delay options: 41 | - `delay` - delay between buy orders in milliseconds, *including processing time*. Default: `5000`. 42 | - `random_factor` - additional random delay factor. Default: `0.5`. 43 | - `random_delay` - additional random delay roof in milliseconds. Default: `0`. 44 | - Actual delay between offers will be in range: 45 | - from `delay`; 46 | - to `delay * (1 + random_factor) + random_delay`. 47 | - `process_timeout` - timeout for SDK calls in milliseconds. Default: `10000`. 48 | - Skipping options: 49 | - `skip_if_have_bid` - skip offer duplicates. Default: `true`. 50 | - `skip_if_too_low` - skip an asset if the floor price is higher than the current highest bid. Default: `false`. 51 | - `skip_if_too_high` - skip an asset if the roof price is lower than the current highest bid. Default: `true`. 52 | - `skip_if_owner_is_buyer` - skip an asset if you already own it. Default: `true`. 53 | - `skip_if_order_created` - skip an asset if an error occured but order was created. Default: `false`. 54 | - Logging options: 55 | - `log_opensea` - print OpenSea log messages. Default: `false`. 56 | - `log_fetch` - log fetch calls. Default: `false`. 57 | - `log_fetch_all` - log fetch headers and body. Default: `false`. 58 | - `log_full` - log full error messages. Default: `false`. 59 | - Proxy settings: 60 | - `proxy_list` - proxies list file. No proxy by default. 61 | - `proxy_protocol` - proxy protocol. Should be `http://` or `socks://`. Default: `http://`. 62 | - `proxy_checking` - enable proxy checking. Default: `true`. 63 | - `switch_threshold` - how much fails to switch proxy. Default: `10`. 64 | - `switch_delay` - proxy switching delay in milliseconds. Default: `2000`. 65 | - HTTP request options: 66 | - `cookie` - Cookie data. No Cookie by default. 67 | - `user_agent` - User-Agent data. No User-Agent by default. 68 | - `fetch_timeout` - fetch request timeout in milliseconds. Default: `10000`. 69 | - `cache_timeout` - fetch cache timeout in milliseconds. Default: `60000`. 70 | - `clear_cache_threshold` - how much consecutive fails to clear cache. Default: `5`. 71 | 72 | Values `floor`, `roof`, `epsilon` for price calculation will be taken from the assets list file if specified, or from the config otherwise. 73 | 74 | If auto price calculation is disabled, only the `floor` value will be used to create a buy order. 75 | 76 | Default config file: `config.json`. 77 | 78 | **Example** 79 | ```json 80 | { 81 | "network": "rinkeby", 82 | "infura_key": "", 83 | "private_keys": [ "" ], 84 | "wallet_address": "", 85 | 86 | "price_auto": true, 87 | "price_floor": 0.001, 88 | "price_roof": 100, 89 | "price_epsilon": 0.001, 90 | 91 | "expiration": 4, 92 | 93 | "delay": 500 94 | } 95 | ``` 96 | 97 | ## Assets list file 98 | Each line contains a link to the asset on OpenSea and floor, roof, epsilon price values in `wETH` as floating-point numbers. 99 | If there is no value specified, it will be taken from the config. First number is `floor`, second is `roof` and last is `epsilon`. 100 | 101 | Asset line notation: ` [floor price] [roof price] [epsilon]` 102 | 103 | Default list file: `list.txt`. 104 | 105 | **Example** 106 | ``` 107 | https://testnets.opensea.io/assets/0x08a62684d8d609dcc7cfb0664cf9aabec86504e5/100 0.01 100 108 | https://testnets.opensea.io/assets/0x08a62684d8d609dcc7cfb0664cf9aabec86504e5/200 109 | https://testnets.opensea.io/assets/0x08a62684d8d609dcc7cfb0664cf9aabec86504e5/300 0.2 200 0.1 110 | ``` 111 | 112 | ## Proxies list file 113 | Available proxy notation: 114 | - `protocol://user:pass@host:port` 115 | - `protocol://host:port:user:pass` 116 | 117 | Available protocols: 118 | - `http://` - for HTTP proxy. 119 | - `socks://` - for SOCKS 4/5 proxy. 120 | 121 | Host should be an **IPv4** address. 122 | Protocol can be omitted, in which case the value `proxy_protocol` from the configuration will be used. 123 | 124 | **Example** 125 | ``` 126 | socks://127.0.0.1:9050 127 | 127.0.0.1:8080 128 | ``` 129 | 130 | ## Command line arguments 131 | - `--file=` - assets list file. Default: `list.txt`. 132 | - `--output=` - output log file. Default: `log.txt`. 133 | - `--verbose` - print all messages to the console. 134 | - `--config=` - config file. Default: `config.json`. 135 | - You can override some config options with these arguments: 136 | - `--api_key=` - OpenSea API key. 137 | - `--wallet=
` - buyer wallet address. 138 | - `--proxy=` - proxies list file. 139 | - `--log_opensea` - print OpenSea log messages. 140 | - `--log_fetch` - log fetch calls. 141 | - `--log_fetch_all` - log fetch headers and body. 142 | - `--log_full` - log full error messages. 143 | - `--resume=` - resume progress from specified line. 144 | - `--stop` - properly stop currently running bot instance. 145 | 146 | ## Auto price calculation formula 147 | For each asset: 148 | 149 | `bid price = max(floor, min(max(highest bid + epsilon, highest bid * (1 + increment factor)), roof)` 150 | - `highest bid` is the current highest bid price for the asset. 151 | - `floor`, `roof`, `epsilon` values taken from assets list file if specified, or from config otherwise. 152 | - `increment factor` value taken from config. 153 | 154 | ## Usage 155 | You should have an Infura or Alchemy API key, an OpenSea API key, an OpenSea account and a MetaMask account. 156 | 157 | Make sure to have installed recent version of **Node.js** 158 | with **Git**, **Python** and **C/C++** build tools (**npm** may require this to install dependencies). 159 | - Install the package. 160 | - Create a config file. 161 | - Run `offers.js`. 162 | 163 | **Example** 164 | ```shell 165 | npm install 166 | node offers.js --config=config.json --file=list.txt 167 | ``` 168 | 169 | **Demo video** - https://youtu.be/sGwS2v-S2wk 170 | 171 | ## Troubleshooting 172 | If the bot don't work with recent Node.js version, try to use **v16**. 173 | You can use **NVM** to easily switch versions. 174 | 175 | If you getting error `0308010C:digital envelope routines::unsupported`, 176 | you should use Node.js **v16** or set environment variable `NODE_OPTIONS=--openssl-legacy-provider`. 177 | See also - https://github.com/webpack/webpack/issues/14532 178 | 179 | If you getting error `FetchError: request to ... failed, reason: certificate has expired`, 180 | and you are using an old Node.js version, set environment variable `NODE_TLS_REJECT_UNAUTHORIZED=0`. 181 | 182 | ## For tip 183 | - `btc` Bitcoin `bc1qau5y9wf49ammclhscuelwlm6370d9lqph6g9um` 184 | - `btc` Bitcoin (Legacy) `369h9iMSq8ihjYMwdwhbn2ffXMrprHvxav` 185 | - `eth` Ethereum `0x98556fb56e3079696738579dBE70a5Fa761110b9` 186 | 187 | [api-key-link]: https://docs.opensea.io/reference/request-an-api-key 188 | [tor-multiproxy-link]: https://github.com/automainint/tor-multiproxy 189 | [issues-link]: https://github.com/automainint/sea-offers-bot-js/issues 190 | [contact-link]: https://guattari.ru/contact 191 | [discord-link]: https://guattari.ru/discord 192 | -------------------------------------------------------------------------------- /fetch-cache.js: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2022 Mitya Selivanov 2 | */ 3 | 4 | 'use strict'; 5 | 6 | const abort_controller = require('abort-controller'); 7 | const default_fetch_upstream = require('node-fetch'); 8 | 9 | const default_fetch_timeout = 10000; 10 | const default_cache_timeout = 5000; 11 | const default_autoclean_count = 20; 12 | 13 | function default_request_filter(url, request_options) { 14 | return !request_options || 15 | !('method' in request_options) || 16 | request_options['method'] == 'GET'; 17 | } 18 | 19 | function default_response_filter(response) { 20 | return response.status == 200; 21 | } 22 | 23 | function default_wrap_options(request_options) { 24 | return request_options; 25 | } 26 | 27 | const options = { 28 | fetch_upstream: default_fetch_upstream, 29 | fetch_timeout: default_fetch_timeout, 30 | cache_timeout: default_cache_timeout, 31 | request_filter: default_request_filter, 32 | response_filter: default_response_filter, 33 | wrap_options: default_wrap_options, 34 | autoclean_count: default_autoclean_count 35 | }; 36 | 37 | let response_pool = {}; 38 | let autoclean_index = 0; 39 | 40 | function clear() { 41 | response_pool = {}; 42 | } 43 | 44 | function save_response(url, response) { 45 | if (options.response_filter(response)) { 46 | response_pool[url] = { 47 | time: Date.now(), 48 | response: response.clone() 49 | }; 50 | } 51 | 52 | return response; 53 | } 54 | 55 | function load_response(url) { 56 | return response_pool[url].response.clone(); 57 | } 58 | 59 | function time_elapsed(url) { 60 | return Date.now() - response_pool[url].time; 61 | } 62 | 63 | function check_timeout(url) { 64 | return (url in response_pool) && 65 | time_elapsed(url) < options.cache_timeout; 66 | } 67 | 68 | function autoclean() { 69 | const entries = Object.entries(response_pool); 70 | 71 | if (entries.length == 0) { 72 | return; 73 | } 74 | 75 | if (autoclean_index >= entries.length) { 76 | autoclean_index = 0; 77 | } 78 | 79 | for ( let i = 0; 80 | autoclean_index + i < entries.length && 81 | i < options.autoclean_count; 82 | i++) { 83 | const [ key, value ] = entries[autoclean_index + i]; 84 | 85 | if (Date.now() - value.time >= options.cache_timeout) { 86 | delete response_pool[key]; 87 | } 88 | } 89 | 90 | autoclean_index += options.autoclean_count; 91 | } 92 | 93 | var fetch; 94 | 95 | async function cache(custom_fetch, url, request_options) { 96 | if (custom_fetch === fetch) { 97 | throw new Error('Infinite recursion.'); 98 | } 99 | 100 | autoclean(); 101 | 102 | if (!options.request_filter(url, request_options)) { 103 | return await custom_fetch(url, request_options); 104 | } 105 | 106 | if (check_timeout(url)) { 107 | return load_response(url); 108 | } 109 | 110 | return save_response(url, await custom_fetch(url, request_options)); 111 | } 112 | 113 | fetch = function(url, request_options) { 114 | let timeout_id = 0; 115 | let wrapped_options = options.wrap_options(request_options); 116 | 117 | if (!wrapped_options) { 118 | wrapped_options = {}; 119 | } 120 | 121 | if (!('signal' in wrapped_options)) { 122 | const controller = new abort_controller(); 123 | 124 | timeout_id = setTimeout( 125 | () => controller.abort(), 126 | options.fetch_timeout); 127 | 128 | wrapped_options.signal = controller.signal; 129 | } 130 | 131 | const clear_if_have_timeout = () => { 132 | if (timeout_id != 0) { 133 | clearTimeout(timeout_id); 134 | } 135 | }; 136 | 137 | return cache(options.fetch_upstream, url, wrapped_options) 138 | .then(response => { 139 | clear_if_have_timeout(); 140 | return response; 141 | }) 142 | .catch(error => { 143 | clear_if_have_timeout(); 144 | throw error; 145 | }); 146 | } 147 | 148 | module.exports = { 149 | fetch: fetch, 150 | cache: cache, 151 | clear: clear, 152 | options: options 153 | }; 154 | -------------------------------------------------------------------------------- /hotfix.js: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2022 Mitya Selivanov 2 | */ 3 | 4 | 'use strict'; 5 | 6 | async function hotfix() { 7 | const { copyFile } = require('fs'); 8 | 9 | console.log('\nRun hotfix...'); 10 | 11 | /* Proper error handling. 12 | */ 13 | console.log('* Fix safe-event-emitter error handling.'); 14 | await copyFile( 15 | './hotfix/safe-event-emitter-index.js', 16 | './node_modules/safe-event-emitter/index.js', 17 | (err) => { 18 | if (err) { 19 | console.log(err); 20 | } 21 | }); 22 | 23 | /* Disable wETH approval. 24 | */ 25 | console.log('* Disable opensea-js wETH approval.'); 26 | await copyFile( 27 | './hotfix/opensea-lib-seaport.js', 28 | './node_modules/opensea-js/lib/seaport.js', 29 | (err) => { 30 | if (err) { 31 | console.log(err); 32 | } 33 | }); 34 | } 35 | 36 | hotfix().then(() => { 37 | console.log('Hotfix done.\n'); 38 | }); 39 | -------------------------------------------------------------------------------- /hotfix/safe-event-emitter-index.js: -------------------------------------------------------------------------------- 1 | const util = require('util') 2 | const EventEmitter = require('events/') 3 | 4 | var R = typeof Reflect === 'object' ? Reflect : null 5 | var ReflectApply = R && typeof R.apply === 'function' 6 | ? R.apply 7 | : function ReflectApply(target, receiver, args) { 8 | return Function.prototype.apply.call(target, receiver, args); 9 | } 10 | 11 | module.exports = SafeEventEmitter 12 | 13 | 14 | function SafeEventEmitter() { 15 | EventEmitter.call(this) 16 | } 17 | 18 | util.inherits(SafeEventEmitter, EventEmitter) 19 | 20 | SafeEventEmitter.prototype.emit = function (type) { 21 | // copied from https://github.com/Gozala/events/blob/master/events.js 22 | // modified lines are commented with "edited:" 23 | var args = []; 24 | for (var i = 1; i < arguments.length; i++) args.push(arguments[i]); 25 | var doError = (type === 'error'); 26 | 27 | var events = this._events; 28 | if (events !== undefined) 29 | doError = (doError && events.error === undefined); 30 | else if (!doError) 31 | return false; 32 | 33 | // If there is no 'error' event listener then throw. 34 | if (doError) { 35 | var er; 36 | if (args.length > 0) 37 | er = args[0]; 38 | if (er instanceof Error) { 39 | // Note: The comments on the `throw` lines are intentional, they show 40 | // up in Node's output if this results in an unhandled exception. 41 | throw er; // Unhandled 'error' event 42 | } 43 | // At least give some kind of context to the user 44 | var err = new Error('Unhandled error.' + (er ? ' (' + er.message + ')' : '')); 45 | err.context = er; 46 | throw err; // Unhandled 'error' event 47 | } 48 | 49 | var handler = events[type]; 50 | 51 | if (handler === undefined) 52 | return false; 53 | 54 | if (typeof handler === 'function') { 55 | // edited: using safeApply 56 | safeApply(handler, this, args); 57 | } else { 58 | var len = handler.length; 59 | var listeners = arrayClone(handler, len); 60 | for (var i = 0; i < len; ++i) 61 | // edited: using safeApply 62 | safeApply(listeners[i], this, args); 63 | } 64 | 65 | return true; 66 | } 67 | 68 | function safeApply(handler, context, args) { 69 | try { 70 | ReflectApply(handler, context, args) 71 | } catch (err) { 72 | setTimeout(() => { 73 | /* HOTFIX by @automainint 74 | * Proper error handling. 75 | */ 76 | if (global.SAFE_EVENT_EMITTER_HANDLER) { 77 | global.SAFE_EVENT_EMITTER_HANDLER(err); 78 | } else { 79 | console.log(err); 80 | } 81 | }) 82 | } 83 | } 84 | 85 | function arrayClone(arr, n) { 86 | var copy = new Array(n); 87 | for (var i = 0; i < n; ++i) 88 | copy[i] = arr[i]; 89 | return copy; 90 | } 91 | -------------------------------------------------------------------------------- /offers.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | const _0x3d8e30 = _0x5880; 3 | (function (_0x5ee034, _0x43db11) { 4 | const _0x3baa2d = _0x5880, _0x3d653b = _0x5ee034(); 5 | while (!![]) { 6 | try { 7 | const _0x25f17e = -parseInt(_0x3baa2d(0xfe)) / 0x1 * (-parseInt(_0x3baa2d(0x122)) / 0x2) + parseInt(_0x3baa2d(0x13d)) / 0x3 + -parseInt(_0x3baa2d(0x13c)) / 0x4 * (-parseInt(_0x3baa2d(0xf5)) / 0x5) + parseInt(_0x3baa2d(0xed)) / 0x6 * (-parseInt(_0x3baa2d(0x171)) / 0x7) + parseInt(_0x3baa2d(0x19b)) / 0x8 + -parseInt(_0x3baa2d(0x191)) / 0x9 * (-parseInt(_0x3baa2d(0x10a)) / 0xa) + -parseInt(_0x3baa2d(0x192)) / 0xb * (parseInt(_0x3baa2d(0x157)) / 0xc); 8 | if (_0x25f17e === _0x43db11) 9 | break; 10 | else 11 | _0x3d653b['push'](_0x3d653b['shift']()); 12 | } catch (_0x3463d8) { 13 | _0x3d653b['push'](_0x3d653b['shift']()); 14 | } 15 | } 16 | }(_0x1871, 0xcfabf)); 17 | const { 18 | appendFileSync: _0x5ed1d4, 19 | writeFileSync: _0x42ea64, 20 | readFileSync: _0x51cf73 21 | } = require('fs'), {isNullOrUndefined: _0x375b04} = require(_0x3d8e30(0x164)), _0x4e6336 = require('yargs'), _0x55d390 = require(_0x3d8e30(0x18d)), _0x200585 = require(_0x3d8e30(0xe7)), _0x35db60 = require(_0x3d8e30(0x19e)), _0x277f3d = !!_0x4e6336['argv'][_0x3d8e30(0x148)], _0x14ba09 = _0x4e6336[_0x3d8e30(0x169)]['resume'] || 0x0, _0x45b43c = _0x4e6336[_0x3d8e30(0x169)]['file'] || _0x3d8e30(0x100), _0xc1c0af = _0x4e6336[_0x3d8e30(0x169)][_0x3d8e30(0x114)] || _0x3d8e30(0x163), _0x43d692 = _0x4e6336['argv'][_0x3d8e30(0x13e)] || _0x3d8e30(0xc8), _0x113fa8 = _0x4e6336[_0x3d8e30(0x169)][_0x3d8e30(0x11a)], _0x2f3304 = _0x4e6336[_0x3d8e30(0x169)][_0x3d8e30(0x15b)], _0x1d1878 = _0x4e6336[_0x3d8e30(0x169)]['proxy'], _0xfd45a1 = !!_0x4e6336['argv'][_0x3d8e30(0x152)], _0x53a483 = !!_0x4e6336['argv']['log_opensea'], _0x5d5efb = !!_0x4e6336['argv'][_0x3d8e30(0x11e)], _0x1190bd = !!_0x4e6336[_0x3d8e30(0x169)][_0x3d8e30(0x15c)], _0x239f36 = !!_0x4e6336['argv'][_0x3d8e30(0xcd)], _0x2a0bd5 = '.stop', _0x30026d = _0x3d8e30(0x16c), _0x90ca67 = 'https://api.ipify.org?format=json'; 22 | var _0x565a4b, _0x133f6c, _0x349c2b, _0x22c89e = 0x0, _0x14f874 = _0x14ba09, _0x45f5e0 = ![], _0x213cfd = [], _0xef1a96 = 0x0; 23 | function _0x49bcb9(_0x294187) { 24 | const _0x47d5ef = _0x3d8e30; 25 | _0xfd45a1 && console[_0x47d5ef(0x137)](_0x294187), _0x5ed1d4(_0x43d692, _0x294187 + '\x0a'); 26 | } 27 | function _0x5aeefa(_0x4f06b1) { 28 | const _0x303588 = _0x3d8e30; 29 | let _0x451c47 = ''; 30 | try { 31 | _0x451c47 = '\x0a' + (_0x4f06b1['stack'] ? _0x4f06b1['stack'] : _0x4f06b1[_0x303588(0x18f)] ? _0x303588(0x15e) + _0x4f06b1[_0x303588(0x18f)] : '' + _0x4f06b1); 32 | } catch (_0x16793b) { 33 | _0x451c47 = _0x4f06b1; 34 | } 35 | _0xfd45a1 && console[_0x303588(0xd4)](_0x451c47), _0x5ed1d4(_0x43d692, _0x451c47 + '\x0a'); 36 | } 37 | function _0x5176ed(_0x5e9360) { 38 | const _0x1e5275 = _0x3d8e30; 39 | return _0x5e9360 === _0x1e5275(0x11c) || _0x5e9360 === _0x1e5275(0xf9) ? _0x1e5275(0x11c) : _0x1e5275(0xc6); 40 | } 41 | function _0x49dab1() { 42 | const _0x4b7d5e = _0x3d8e30; 43 | try { 44 | _0x49bcb9(_0x4b7d5e(0x121)); 45 | var _0x5dcd43 = JSON['parse'](_0x51cf73(_0xc1c0af)); 46 | return _0x5dcd43[_0x4b7d5e(0xc9)] = 'infura_key' in _0x5dcd43, _0x5dcd43['node_key'] = _0x5dcd43[_0x4b7d5e(0x140)] || _0x5dcd43[_0x4b7d5e(0x146)], !!_0x5dcd43['network'] && (_0x5dcd43['network'] = _0x5176ed(_0x5dcd43['network'])), !(_0x4b7d5e(0xd9) in _0x5dcd43) && (_0x5dcd43[_0x4b7d5e(0xd9)] = 0x1388), !(_0x4b7d5e(0x142) in _0x5dcd43) && (_0x5dcd43[_0x4b7d5e(0x142)] = 0.5), !(_0x4b7d5e(0x198) in _0x5dcd43) && (_0x5dcd43[_0x4b7d5e(0x198)] = 0x0), !(_0x4b7d5e(0x161) in _0x5dcd43) && (_0x5dcd43[_0x4b7d5e(0x161)] = 0x18), !(_0x4b7d5e(0x125) in _0x5dcd43) && (_0x5dcd43[_0x4b7d5e(0x125)] = !![]), !(_0x4b7d5e(0xf0) in _0x5dcd43) && (_0x5dcd43[_0x4b7d5e(0xf0)] = ![]), !(_0x4b7d5e(0x17e) in _0x5dcd43) && (_0x5dcd43[_0x4b7d5e(0x17e)] = !![]), !(_0x4b7d5e(0x103) in _0x5dcd43) && (_0x5dcd43[_0x4b7d5e(0x103)] = !![]), !('skip_if_order_created' in _0x5dcd43) && (_0x5dcd43[_0x4b7d5e(0x172)] = ![]), !(_0x4b7d5e(0x109) in _0x5dcd43) && (_0x5dcd43['switch_threshold'] = 0xa), !('discard_threshold' in _0x5dcd43) && (_0x5dcd43[_0x4b7d5e(0xe5)] = 0xa), !(_0x4b7d5e(0x12a) in _0x5dcd43) && (_0x5dcd43[_0x4b7d5e(0x12a)] = 0x3), !('price_auto' in _0x5dcd43) && (_0x5dcd43['price_auto'] = !![]), !(_0x4b7d5e(0xcc) in _0x5dcd43) && (_0x5dcd43[_0x4b7d5e(0xcc)] = 0.0001), !('price_floor' in _0x5dcd43) && (_0x5dcd43[_0x4b7d5e(0xf4)] = 0.0001), !('price_roof' in _0x5dcd43) && (_0x5dcd43[_0x4b7d5e(0x102)] = 0x1), !(_0x4b7d5e(0xf1) in _0x5dcd43) && (_0x5dcd43['price_increment_factor'] = 0.1), !(_0x4b7d5e(0x124) in _0x5dcd43) && (_0x5dcd43[_0x4b7d5e(0x124)] = 'http://'), !('proxy_checking' in _0x5dcd43) && (_0x5dcd43['proxy_checking'] = !![]), !(_0x4b7d5e(0x10d) in _0x5dcd43) && (_0x5dcd43[_0x4b7d5e(0x10d)] = 0x7d0), !(_0x4b7d5e(0x112) in _0x5dcd43) && (_0x5dcd43[_0x4b7d5e(0x112)] = ![]), !(_0x4b7d5e(0x11e) in _0x5dcd43) && (_0x5dcd43[_0x4b7d5e(0x11e)] = ![]), !(_0x4b7d5e(0x15c) in _0x5dcd43) && (_0x5dcd43[_0x4b7d5e(0x15c)] = ![]), !(_0x4b7d5e(0xcd) in _0x5dcd43) && (_0x5dcd43['log_full'] = ![]), !(_0x4b7d5e(0x12d) in _0x5dcd43) && (_0x5dcd43[_0x4b7d5e(0x12d)] = 0x5), !(_0x4b7d5e(0x159) in _0x5dcd43) && (_0x5dcd43[_0x4b7d5e(0x159)] = 0x2710), !('cache_timeout' in _0x5dcd43) && (_0x5dcd43[_0x4b7d5e(0x133)] = 0xea60), !(_0x4b7d5e(0xda) in _0x5dcd43) && (_0x5dcd43['process_timeout'] = 0x2710), 'log_opensea' in _0x4e6336[_0x4b7d5e(0x169)] && (_0x5dcd43['log_opensea'] = _0x53a483), _0x4b7d5e(0x11e) in _0x4e6336[_0x4b7d5e(0x169)] && (_0x5dcd43[_0x4b7d5e(0x11e)] = _0x5d5efb), _0x4b7d5e(0x15c) in _0x4e6336[_0x4b7d5e(0x169)] && (_0x5dcd43['log_fetch_all'] = _0x1190bd), 'log_full' in _0x4e6336[_0x4b7d5e(0x169)] && (_0x5dcd43[_0x4b7d5e(0xcd)] = _0x239f36), _0x113fa8 && (_0x5dcd43['api_key'] = _0x113fa8), _0x2f3304 && (_0x5dcd43[_0x4b7d5e(0x10c)] = _0x2f3304), _0x1d1878 && (_0x5dcd43['proxy_list'] = _0x1d1878), _0x5dcd43; 47 | } catch (_0x6069df) { 48 | _0x5aeefa(_0x6069df); 49 | } 50 | return {}; 51 | } 52 | function _0x3fefcc(_0x29909c) { 53 | const _0x5a1c1c = _0x3d8e30; 54 | let _0x45f1d6 = !![]; 55 | return !(_0x5a1c1c(0xc7) in _0x29909c) && (_0x49bcb9(_0x5a1c1c(0x17b)), _0x45f1d6 = ![]), !('mnemonic' in _0x29909c) && !(_0x5a1c1c(0x10e) in _0x29909c) && (_0x49bcb9('Missing\x20MetaMask\x20mnemonic\x20or\x20private\x20keys.'), _0x45f1d6 = ![]), !('mnemonic' in _0x29909c) && _0x5a1c1c(0x10e) in _0x29909c && _0x29909c[_0x5a1c1c(0x10e)][_0x5a1c1c(0x17c)] <= 0x0 && (_0x49bcb9(_0x5a1c1c(0x18e)), _0x45f1d6 = ![]), !('node_key' in _0x29909c) && (_0x49bcb9(_0x5a1c1c(0x13f)), _0x45f1d6 = ![]), !(_0x5a1c1c(0x10c) in _0x29909c) && (_0x49bcb9(_0x5a1c1c(0x130)), _0x45f1d6 = ![]), _0x29909c[_0x5a1c1c(0xd9)] < 0x0 && (_0x49bcb9(_0x5a1c1c(0x154)), _0x45f1d6 = ![]), _0x29909c[_0x5a1c1c(0x142)] < 0x0 && (_0x49bcb9('Invalid\x20random\x20factor.'), _0x45f1d6 = ![]), _0x29909c[_0x5a1c1c(0x142)] > 0x3 && (_0x49bcb9(_0x5a1c1c(0x119)), _0x45f1d6 = ![]), _0x29909c[_0x5a1c1c(0x198)] < 0x0 && (_0x49bcb9(_0x5a1c1c(0x14a)), _0x45f1d6 = ![]), _0x29909c[_0x5a1c1c(0x10d)] < 0x0 && (_0x49bcb9(_0x5a1c1c(0xdc)), _0x45f1d6 = ![]), _0x29909c[_0x5a1c1c(0x159)] < 0x0 && (_0x49bcb9(_0x5a1c1c(0x196)), _0x45f1d6 = ![]), _0x29909c[_0x5a1c1c(0x133)] < 0x0 && (_0x49bcb9(_0x5a1c1c(0xd3)), _0x45f1d6 = ![]), _0x29909c[_0x5a1c1c(0xda)] < 0x0 && (_0x49bcb9(_0x5a1c1c(0x107)), _0x45f1d6 = ![]), _0x29909c[_0x5a1c1c(0x12d)] < 0x0 && (_0x49bcb9('Invalid\x20clear\x20cache\x20threshold.'), _0x45f1d6 = ![]), _0x29909c[_0x5a1c1c(0x12a)] < 0x0 && (_0x49bcb9('Invalid\x20gas\x20price\x20addition.'), _0x45f1d6 = ![]), _0x29909c[_0x5a1c1c(0xf4)] < 0x0 && _0x49bcb9(_0x5a1c1c(0x15f)), (_0x29909c[_0x5a1c1c(0x102)] < 0x0 || _0x29909c[_0x5a1c1c(0x102)] < _0x29909c[_0x5a1c1c(0xf4)]) && _0x49bcb9(_0x5a1c1c(0x184)), _0x29909c[_0x5a1c1c(0xcc)] < 0x0 && (_0x49bcb9(_0x5a1c1c(0xd6)), _0x45f1d6 = ![]), (_0x29909c[_0x5a1c1c(0xf1)] < 0x0 || _0x29909c[_0x5a1c1c(0xf1)] > 0x1) && (_0x49bcb9(_0x5a1c1c(0x14c)), _0x45f1d6 = ![]), _0x29909c[_0x5a1c1c(0x161)] < 0x0 && (_0x49bcb9(_0x5a1c1c(0x101)), _0x45f1d6 = ![]), _0x45f1d6; 56 | } 57 | function _0x52f35b(_0x4cd56c) { 58 | const _0x263759 = _0x3d8e30; 59 | _0x565a4b[_0x263759(0x112)] && _0x49bcb9(_0x263759(0x18c) + ('' + _0x4cd56c)[_0x263759(0x117)]('\x0a', _0x263759(0xe8))); 60 | } 61 | function _0x269d14(_0xaa217c) { 62 | const _0x272c89 = _0x3d8e30; 63 | try { 64 | let _0x4ee9c7 = _0x565a4b[_0x272c89(0x124)], _0x436d46 = _0xaa217c['replace']('\x20', ''); 65 | _0x436d46[_0x272c89(0x14e)]('//') && (_0x4ee9c7 = _0x436d46[_0x272c89(0x117)](/\/\/.*$/g, '//'), _0x436d46 = _0x436d46['replace'](/^.*\/\//g, '')); 66 | if (_0x436d46[_0x272c89(0x14e)]('@') && (_0x436d46[_0x272c89(0xec)](/\:/g) || [])[_0x272c89(0x17c)] == 0x2) { 67 | const _0x2d2493 = _0x436d46[_0x272c89(0x117)](/.*@/, ''), _0x110101 = _0x436d46[_0x272c89(0x117)]('@' + _0x2d2493, ''); 68 | if (!_0x110101 || _0x110101['length'] == 0x0) 69 | return _0x49bcb9(_0x272c89(0x131) + _0xaa217c + '.'), {}; 70 | if (!_0x2d2493 || _0x2d2493[_0x272c89(0x17c)] == 0x0) 71 | return _0x49bcb9('Error:\x20Invalid\x20proxy\x20syntax\x20-\x20' + _0xaa217c + '.'), {}; 72 | const _0xecdb9f = _0x110101[_0x272c89(0xce)](':'), _0x22ba06 = _0x2d2493[_0x272c89(0xce)](':'); 73 | if (_0xecdb9f[_0x272c89(0x17c)] != 0x2) 74 | return _0x49bcb9(_0x272c89(0x131) + _0xaa217c + '.'), {}; 75 | if (_0x22ba06['length'] != 0x2) 76 | return _0x49bcb9(_0x272c89(0x131) + _0xaa217c + '.'), {}; 77 | return { 78 | 'protocol': _0x4ee9c7, 79 | 'user': _0xecdb9f[0x0], 80 | 'pass': _0xecdb9f[0x1], 81 | 'host': _0x22ba06[0x0], 82 | 'port': parseInt(_0x22ba06[0x1]) 83 | }; 84 | } 85 | const _0x338794 = _0x436d46[_0x272c89(0xce)](':'); 86 | if (_0x338794[_0x272c89(0x17c)] == 0x2) 87 | return { 88 | 'protocol': _0x4ee9c7, 89 | 'host': _0x338794[0x0], 90 | 'port': parseInt(_0x338794[0x1]) 91 | }; 92 | if (_0x338794['length'] == 0x4) 93 | return { 94 | 'protocol': _0x4ee9c7, 95 | 'user': _0x338794[0x2], 96 | 'pass': _0x338794[0x3], 97 | 'host': _0x338794[0x0], 98 | 'port': parseInt(_0x338794[0x1]) 99 | }; 100 | } catch (_0x5c5334) { 101 | _0x5aeefa(_0x5c5334); 102 | } 103 | return _0x49bcb9(_0x272c89(0x131) + _0xaa217c + '.'), {}; 104 | } 105 | function _0x4154c3() { 106 | const _0x44a10f = _0x3d8e30; 107 | if (_0x55d390[_0x44a10f(0x12f)]) 108 | _0x55d390[_0x44a10f(0x12f)][_0x44a10f(0x115)](); 109 | if (_0x200585[_0x44a10f(0x12f)]) 110 | _0x200585[_0x44a10f(0x12f)]['destroy'](); 111 | } 112 | function _0x3713cb(_0x4468a4, _0x30a66c) { 113 | const _0x53f096 = _0x3d8e30; 114 | _0x4154c3(), _0x55d390[_0x53f096(0x12f)] = _0x4468a4, _0x200585[_0x53f096(0x12f)] = _0x30a66c; 115 | } 116 | function _0x50c33b(_0x3192bc) { 117 | const _0x56b9b8 = _0x3d8e30; 118 | _0x4154c3(), _0x55d390[_0x56b9b8(0x12f)] = _0x3192bc, _0x200585[_0x56b9b8(0x12f)] = _0x3192bc; 119 | } 120 | function _0x2e95d7() { 121 | const _0x6d6856 = _0x3d8e30; 122 | _0x4154c3(), _0x55d390[_0x6d6856(0x12f)] = new _0x55d390['Agent'](), _0x200585['globalAgent'] = new _0x200585[(_0x6d6856(0x16d))](); 123 | } 124 | function _0x18e698(_0x425193, _0x487c8f) { 125 | const _0x1537e3 = _0x3d8e30; 126 | try { 127 | const _0x1a5571 = _0x269d14(_0x487c8f); 128 | if (_0x1a5571 && _0x1a5571 !== {}) { 129 | let _0xc0dc71; 130 | _0x1a5571[_0x1537e3(0x11d)] && _0x1a5571[_0x1537e3(0x11d)][_0x1537e3(0x17c)] > 0x0 ? _0xc0dc71 = '' + _0x1a5571[_0x1537e3(0x1a0)] + _0x1a5571[_0x1537e3(0x11d)] + ':' + _0x1a5571['pass'] + '@' + _0x1a5571['host'] + ':' + _0x1a5571[_0x1537e3(0x12b)] : _0xc0dc71 = '' + _0x1a5571['protocol'] + _0x1a5571['host'] + ':' + _0x1a5571[_0x1537e3(0x12b)]; 131 | if (_0x1a5571['protocol'][_0x1537e3(0x14e)](_0x1537e3(0x18d))) { 132 | _0x3713cb(new require('http-proxy-agent')(_0xc0dc71), new require(_0x1537e3(0x19c))(_0xc0dc71)), _0x49bcb9('\x0a\x20\x20\x20Switch\x20proxy\x20' + _0x425193 + _0x1537e3(0x15a) + _0x1a5571[_0x1537e3(0x1a0)] + _0x1a5571[_0x1537e3(0x149)] + ':' + _0x1a5571[_0x1537e3(0x12b)]); 133 | return; 134 | } 135 | if (_0x1a5571[_0x1537e3(0x1a0)]['includes'](_0x1537e3(0xdf))) { 136 | _0x50c33b(new require(_0x1537e3(0x160))(_0xc0dc71)), _0x49bcb9(_0x1537e3(0xd1) + _0x425193 + _0x1537e3(0x15a) + _0x1a5571['protocol'] + _0x1a5571['host'] + ':' + _0x1a5571[_0x1537e3(0x12b)]); 137 | return; 138 | } 139 | _0x49bcb9('Error:\x20Proxy\x20not\x20supported\x20-\x20' + _0x487c8f + '.'); 140 | } 141 | _0x2e95d7(); 142 | } catch (_0x44bfc5) { 143 | _0x5aeefa(_0x44bfc5); 144 | } 145 | } 146 | function _0x1871() { 147 | const _0x5afac6 = [ 148 | 'tokenId', 149 | 'SAFE_EVENT_EMITTER_HANDLER', 150 | 'Fatal\x20error:\x20No\x20OpenSeaPort.', 151 | 'gas_price_addition', 152 | 'port', 153 | 'toLowerCase', 154 | 'clear_cache_threshold', 155 | '\x20Internal\x20processing\x20error.\x20Set\x20log_full\x20option\x20to\x20see\x20more\x20info.', 156 | 'globalAgent', 157 | 'Missing\x20wallet\x20address.', 158 | 'Error:\x20Invalid\x20proxy\x20syntax\x20-\x20', 159 | '\x20Request\x20timeout.', 160 | 'cache_timeout', 161 | 'ProcessTimeout', 162 | 'TransactionDenied', 163 | '\x20Internal\x20server\x20error.', 164 | 'log', 165 | 'Using\x20network:\x20rinkeby...', 166 | 'filter', 167 | 'random', 168 | 'then', 169 | '3548gUhzFy', 170 | '2721696SighjP', 171 | 'output', 172 | 'Missing\x20blockchain\x20node\x20API\x20key.', 173 | 'infura_key', 174 | '\x0aBody:\x20', 175 | 'random_factor', 176 | 'opensea_key', 177 | '\x20Offer\x20discarded.\x20Too\x20many\x20errors.', 178 | 'unknown', 179 | 'alchemy_key', 180 | 'API\x20Error\x20500', 181 | 'stop', 182 | 'host', 183 | 'Invalid\x20random\x20delay.', 184 | 'maker', 185 | 'Invalid\x20price\x20increment\x20factor.', 186 | '\x20Request\x20was\x20blocked\x20by\x20Cloudflare.', 187 | 'includes', 188 | '\x20Offer\x20succeed.', 189 | 'FetchTimeout', 190 | 'Network', 191 | 'verbose', 192 | '\x0a\x20%\x20Order\x20created', 193 | 'Invalid\x20delay.', 194 | '\x0a\x20%\x20All\x20assets\x20approved', 195 | 'Using\x20Alchemy...', 196 | '12dpARMd', 197 | '\x20Offer\x20skipped.\x20Price\x20too\x20high.', 198 | 'fetch_timeout', 199 | '\x20-\x20', 200 | 'wallet', 201 | 'log_fetch_all', 202 | '\x0a\x20%\x20Transaction\x20confirmed', 203 | 'Error:\x20', 204 | 'Warning!\x20Invalid\x20price\x20floor.', 205 | 'socks-proxy-agent', 206 | 'expiration', 207 | '\x0a\x20%\x20Order\x20cancelled', 208 | 'config.json', 209 | 'util', 210 | '\x0a\x20%\x20Asset\x20approved', 211 | 'abort-controller', 212 | 'engine', 213 | 'node_key', 214 | 'argv', 215 | '\x0a\x20\x20\x20Fetching\x0a\x20\x20\x20', 216 | '\x0aStarting...', 217 | 'https://opensea.io/', 218 | 'Agent', 219 | 'Error:\x20No\x20mnemonic\x20phrase\x20or\x20private\x20keys.', 220 | 'async-mutex', 221 | 'owner', 222 | '14aQMZkH', 223 | 'skip_if_order_created', 224 | 'TransactionConfirmed', 225 | '...\x0a', 226 | 'Init\x20event\x20handlers...', 227 | 'parse', 228 | 'orders', 229 | 'aborted', 230 | '\x20Acquiring\x20asset...', 231 | 'Content-Type', 232 | 'Missing\x20network\x20name.', 233 | 'length', 234 | 'TransactionCreated', 235 | 'skip_if_too_high', 236 | '\x0a\x20%\x20Wrap\x20ETH', 237 | 'proxy_list', 238 | 'application/json', 239 | 'tokenAddress', 240 | '\x0a\x20%\x20Order\x20denied', 241 | 'Warning!\x20Invalid\x20price\x20roof.', 242 | 'ApproveAsset', 243 | '\x0a\x20\x20\x20\x20\x20Address:\x20', 244 | 'request_filter', 245 | 'round', 246 | 'ApproveAllAssets', 247 | '\x0a\x20%\x20Currency\x20approved', 248 | 'Rinkeby', 249 | '\x0a\x20\x20\x20OpenSea:\x20\x20', 250 | 'http', 251 | 'Private\x20keys\x20array\x20is\x20empty.', 252 | 'message', 253 | 'stringify', 254 | '18QojIRi', 255 | '35746271eIFdSN', 256 | 'cookie', 257 | '\x0a\x20%\x20Transaction\x20denied', 258 | 'bignumber.js', 259 | 'Invalid\x20fetch\x20timeput.', 260 | 'MatchOrders', 261 | 'random_delay', 262 | 'https://eth-', 263 | '\x20Offer\x20skipped.\x20Already\x20own\x20this\x20asset.', 264 | '12587176QZbpRJ', 265 | 'https-proxy-agent', 266 | 'cloudflare', 267 | './fetch-cache.js', 268 | 'mnemonic', 269 | 'protocol', 270 | 'fetch', 271 | '\x0a\x20\x20\x20Public\x20IP:\x20', 272 | 'rinkeby', 273 | 'network', 274 | 'log.txt', 275 | 'is_infura', 276 | 'OrderDenied', 277 | '\x0a\x20\x20\x20', 278 | 'price_epsilon', 279 | 'log_full', 280 | 'split', 281 | '\x20\x20\x20Invalid\x20asset\x20on\x20line\x20', 282 | 'type', 283 | '\x0a\x20\x20\x20Switch\x20proxy\x20', 284 | '\x0a\x20%\x20Account\x20initialized', 285 | 'Invalid\x20cache\x20timeput.', 286 | 'error', 287 | 'acquire', 288 | 'Invalid\x20price\x20epsilon.', 289 | 'Using\x20provided\x20OpenSea\x20API\x20key...', 290 | '\x0a\x20!\x20', 291 | 'delay', 292 | 'process_timeout', 293 | '\x0a\x20%\x20Orders\x20matched', 294 | 'Invalid\x20switch\x20delay.', 295 | 'privateKeys', 296 | '\x0aBody\x20(JSON):\x20', 297 | 'socks', 298 | 'CancelOrder', 299 | '\x0a\x20\x20\x20\x20\x20Price:\x20\x20\x20', 300 | 'addListener', 301 | 'api', 302 | 'currentPrice', 303 | 'discard_threshold', 304 | 'API\x20Error\x20408', 305 | 'https', 306 | '\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20', 307 | 'opensea-js', 308 | '\x0a\x20\x20\x20\x20\x20Id:\x20\x20\x20\x20\x20\x20', 309 | 'TransactionFailed', 310 | 'match', 311 | '1504986sqwPWu', 312 | 'now', 313 | '\x20Offer\x20skipped.\x20Price\x20too\x20low.', 314 | 'skip_if_too_low', 315 | 'price_increment_factor', 316 | 'API\x20Error\x20429', 317 | 'WrapEth', 318 | 'price_floor', 319 | '3925VtaPxZ', 320 | 'Auto\x20price\x20enabled.', 321 | 'options', 322 | 'user-agent', 323 | 'live', 324 | 'user_agent', 325 | 'text', 326 | 'gasPriceAddition', 327 | 'body', 328 | '4tCaKGu', 329 | 'ApproveCurrency', 330 | 'list.txt', 331 | 'Invalid\x20expiration\x20time.', 332 | 'price_roof', 333 | 'skip_if_owner_is_buyer', 334 | '\x20Request\x20was\x20throttled.', 335 | 'gas_price', 336 | '\x0a\x20*\x20', 337 | 'Invalid\x20process\x20timeout.', 338 | 'OpenSeaPort', 339 | 'switch_threshold', 340 | '2900390hWlUPp', 341 | 'utf-8', 342 | 'wallet_address', 343 | 'switch_delay', 344 | 'private_keys', 345 | '\x0a\x20%\x20Transaction\x20created', 346 | '\x0aHeaders:\x20', 347 | '\x20Fetch\x20timeout.', 348 | 'log_opensea', 349 | '\x20Offer\x20skipped.\x20Already\x20have\x20a\x20bid.', 350 | 'config', 351 | 'destroy', 352 | 'Mutex', 353 | 'replace', 354 | '@truffle/hdwallet-provider', 355 | 'Invalid\x20random\x20factor\x20-\x20too\x20big.', 356 | 'api_key', 357 | 'Init\x20proxies...', 358 | 'mainnet', 359 | 'user', 360 | 'log_fetch', 361 | 'agent', 362 | 'headers', 363 | '\x0aInit\x20config...', 364 | '422472ovjpjz', 365 | 'catch', 366 | 'proxy_protocol', 367 | 'skip_if_have_bid', 368 | 'https://' 369 | ]; 370 | _0x1871 = function () { 371 | return _0x5afac6; 372 | }; 373 | return _0x1871(); 374 | } 375 | function _0x36a761() { 376 | const _0x43f71e = _0x3d8e30; 377 | _0x213cfd && _0x213cfd['length'] > 0x0 && (_0xef1a96 = (_0xef1a96 + 0x1) % _0x213cfd[_0x43f71e(0x17c)], _0x18e698(_0xef1a96 + 0x1, _0x213cfd[_0xef1a96])); 378 | } 379 | async function _0xcd4c75(_0x3ba385) { 380 | const _0x367fa2 = _0x3d8e30; 381 | if (_0x3ba385 <= 0x0) 382 | return; 383 | const _0x59d827 = require(_0x367fa2(0x16f))[_0x367fa2(0x116)], _0x30f558 = new _0x59d827(); 384 | let _0x187b63 = await _0x30f558[_0x367fa2(0xd5)](); 385 | setTimeout(() => { 386 | _0x187b63(); 387 | }, _0x3ba385), _0x187b63 = await _0x30f558[_0x367fa2(0xd5)](), _0x187b63(); 388 | } 389 | function _0x2dd9e5(_0x2cd0b0, _0x44507f) { 390 | return new Promise((_0x1d8dce, _0x2ef2c9) => { 391 | const _0x57762c = _0x5880; 392 | _0x2cd0b0 < 0x0 && _0x2ef2c9(new Error(_0x57762c(0x134))); 393 | const _0x357242 = setTimeout(() => { 394 | const _0x3d8677 = _0x57762c; 395 | _0x2ef2c9(new Error(_0x3d8677(0x134))); 396 | }, _0x2cd0b0); 397 | _0x44507f()[_0x57762c(0x13b)](_0x12733c => { 398 | clearTimeout(_0x357242), _0x1d8dce(_0x12733c); 399 | })[_0x57762c(0x123)](_0x23de55 => { 400 | clearTimeout(_0x357242), _0x2ef2c9(_0x23de55); 401 | }); 402 | }); 403 | } 404 | async function _0x4b274b() { 405 | const _0x49e7c4 = _0x3d8e30; 406 | let _0xf706a9; 407 | try { 408 | _0xf706a9 = await global[_0x49e7c4(0x1a1)](_0x90ca67); 409 | } catch (_0x164ac3) { 410 | try { 411 | _0xf706a9 = await global['fetch'](_0x90ca67); 412 | } catch (_0xddba70) { 413 | return _0x5aeefa(_0xddba70), _0x49e7c4(0x145); 414 | } 415 | } 416 | try { 417 | let _0x46e6c1 = await _0xf706a9[_0x49e7c4(0xfb)](), _0x39dbe1 = JSON[_0x49e7c4(0x176)](_0x46e6c1); 418 | if ('ip' in _0x39dbe1) 419 | return _0x39dbe1['ip']; 420 | _0x5aeefa(_0x46e6c1); 421 | } catch (_0x1064ac) { 422 | _0x5aeefa(_0x1064ac); 423 | } 424 | return _0x49e7c4(0x145); 425 | } 426 | async function _0x2d49c2() { 427 | const _0x13e7f8 = _0x3d8e30; 428 | if (!_0x213cfd || _0x213cfd['length'] == 0x0) 429 | return; 430 | let _0x24cae6 = ![]; 431 | try { 432 | while (!_0x24cae6) { 433 | _0x24cae6 = !![], _0x36a761(); 434 | if (_0x565a4b['proxy_checking'] && global[_0x13e7f8(0x1a1)]) 435 | try { 436 | await global['fetch'](_0x30026d); 437 | } catch (_0x191bbd) { 438 | try { 439 | await global[_0x13e7f8(0x1a1)](_0x30026d); 440 | } catch (_0x5e8ab2) { 441 | _0x5aeefa(_0x5e8ab2), _0x24cae6 = ![]; 442 | } 443 | } 444 | !_0x24cae6 && await _0xcd4c75(_0x565a4b[_0x13e7f8(0x10d)]); 445 | } 446 | let _0x272396 = await _0x4b274b(); 447 | _0x49bcb9(_0x13e7f8(0x1a2) + _0x272396); 448 | } catch (_0x199302) { 449 | _0x5aeefa(_0x199302); 450 | } 451 | } 452 | function _0xac8016(_0x7dc574) { 453 | const _0x2924c5 = _0x3d8e30; 454 | return _0x51cf73(_0x7dc574, _0x2924c5(0x10b))[_0x2924c5(0xce)]('\x0a')[_0x2924c5(0x139)](Boolean); 455 | } 456 | async function _0x48282d() { 457 | const _0x227b69 = _0x3d8e30; 458 | try { 459 | if (_0x565a4b[_0x227b69(0x180)]) { 460 | _0x49bcb9(_0x227b69(0x11b)); 461 | const _0x4c8c1d = _0xac8016(_0x565a4b['proxy_list']); 462 | let _0x27b513 = 0x0, _0x145f00 = _0xef1a96; 463 | for (const _0x10550f of _0x4c8c1d) { 464 | _0x10550f && _0x10550f['length'] > 0x0 && (_0x213cfd[_0x27b513] = _0x10550f, _0x27b513 == _0x145f00 && (_0xef1a96--, await _0x2d49c2(), _0x49bcb9('')), _0x27b513++); 465 | } 466 | } 467 | } catch (_0x48eb56) { 468 | _0x5aeefa(_0x48eb56); 469 | } 470 | } 471 | function _0x2bac44() { 472 | const _0x1530b8 = _0x3d8e30; 473 | try { 474 | _0x49bcb9('Init\x20OpenSea\x20SDK...'); 475 | const _0x5e47ab = require(_0x1530b8(0xe9)), _0x17e4a1 = require(_0x1530b8(0x118)); 476 | global[_0x1530b8(0x128)] = _0x11a2ee => { 477 | _0x5aeefa(_0x11a2ee); 478 | }; 479 | _0x565a4b['network'] === _0x1530b8(0x11c) ? _0x49bcb9('Using\x20network:\x20mainnet...') : _0x49bcb9(_0x1530b8(0x138)); 480 | _0x565a4b[_0x1530b8(0xc9)] ? _0x49bcb9('Using\x20Infura...') : _0x49bcb9(_0x1530b8(0x156)); 481 | let _0xfeb69f = { 'providerOrUrl': _0x565a4b[_0x1530b8(0xc9)] ? _0x1530b8(0x126) + _0x565a4b[_0x1530b8(0xc7)] + '.infura.io/v3/' + _0x565a4b[_0x1530b8(0x168)] : _0x1530b8(0x199) + _0x565a4b[_0x1530b8(0xc7)] + '.alchemyapi.io/v2/' + _0x565a4b[_0x1530b8(0x168)] }; 482 | if ('mnemonic' in _0x565a4b) 483 | _0xfeb69f[_0x1530b8(0x19f)] = { 'phrase': _0x565a4b[_0x1530b8(0x19f)] }; 484 | else { 485 | if (_0x1530b8(0x10e) in _0x565a4b && _0x565a4b[_0x1530b8(0x10e)][_0x1530b8(0x17c)] >= 0x1) 486 | _0xfeb69f[_0x1530b8(0xdd)] = _0x565a4b[_0x1530b8(0x10e)]; 487 | else 488 | return _0x49bcb9(_0x1530b8(0x16e)), null; 489 | } 490 | _0x349c2b = new _0x17e4a1(_0xfeb69f); 491 | if (_0x375b04(_0x349c2b)) 492 | return ![]; 493 | _0x349c2b[_0x1530b8(0x167)]['on'](_0x1530b8(0xd4), _0x51a982 => _0x5aeefa(_0x51a982)); 494 | _0x565a4b[_0x1530b8(0x143)] && _0x49bcb9(_0x1530b8(0xd7)); 495 | let _0x12c1a5 = { 496 | 'networkName': _0x565a4b[_0x1530b8(0xc7)] === _0x1530b8(0x11c) ? _0x5e47ab['Network']['Main'] : _0x5e47ab[_0x1530b8(0x151)][_0x1530b8(0x18b)], 497 | 'apiKey': _0x565a4b[_0x1530b8(0x143)] 498 | }; 499 | return _0x565a4b[_0x1530b8(0x105)] && (_0x12c1a5['gasPrice'] = _0x565a4b[_0x1530b8(0x105)]), _0x133f6c = new _0x5e47ab[(_0x1530b8(0x108))](_0x349c2b, _0x12c1a5, _0x166fd3 => _0x52f35b(_0x166fd3)), !_0x375b04(_0x133f6c); 500 | } catch (_0x859a45) { 501 | _0x5aeefa(_0x859a45); 502 | } 503 | return ![]; 504 | } 505 | function _0x503bcf() { 506 | const _0x3ec312 = _0x3d8e30; 507 | return _0x565a4b[_0x3ec312(0xd9)] * 0.08; 508 | } 509 | function _0x1cf6aa(_0x303e58) { 510 | const _0x8caf71 = _0x3d8e30; 511 | let _0x2773ee = { ..._0x303e58 }; 512 | return _0x2773ee[_0x8caf71(0x11f)] = _0x200585[_0x8caf71(0x12f)], _0x303e58 && _0x8caf71(0x120) in _0x303e58 ? _0x2773ee[_0x8caf71(0x120)] = _0x303e58[_0x8caf71(0x120)] : _0x2773ee[_0x8caf71(0x120)] = {}, _0x565a4b['user_agent'] && (_0x2773ee[_0x8caf71(0x120)][_0x8caf71(0xf8)] = _0x565a4b[_0x8caf71(0xfa)]), _0x565a4b[_0x8caf71(0x193)] && (_0x2773ee[_0x8caf71(0x120)][_0x8caf71(0x193)] = _0x565a4b['cookie']), _0x2773ee; 513 | } 514 | function _0xf574c7(_0x276020, _0x18db61) { 515 | const _0x1ffd03 = _0x3d8e30; 516 | if (!_0x565a4b[_0x1ffd03(0x11e)]) 517 | return; 518 | _0x49bcb9(_0x1ffd03(0x16a) + _0x276020); 519 | if (!_0x565a4b[_0x1ffd03(0x15c)]) 520 | return; 521 | _0x1ffd03(0x120) in _0x18db61 && _0x49bcb9(_0x1ffd03(0x110) + JSON[_0x1ffd03(0x190)](_0x18db61[_0x1ffd03(0x120)], null, '\x20\x20') + '\x0a'), _0x1ffd03(0xfd) in _0x18db61 && (_0x1ffd03(0x120) in _0x18db61 && _0x1ffd03(0x17a) in _0x18db61[_0x1ffd03(0x120)] && _0x18db61[_0x1ffd03(0x120)][_0x1ffd03(0x17a)] == _0x1ffd03(0x181) ? _0x49bcb9(_0x1ffd03(0xde) + JSON['stringify'](JSON[_0x1ffd03(0x176)](_0x18db61[_0x1ffd03(0xfd)]), null, '\x20\x20') + '\x0a') : _0x49bcb9(_0x1ffd03(0x141) + JSON['stringify'](_0x18db61[_0x1ffd03(0xfd)], null, '\x20\x20') + '\x0a')); 522 | } 523 | function _0x4735ab() { 524 | const _0x236777 = _0x3d8e30; 525 | _0x35db60['options']['fetch_timeout'] = _0x565a4b[_0x236777(0x159)], _0x35db60[_0x236777(0xf7)][_0x236777(0x133)] = _0x565a4b['cache_timeout']; 526 | const _0x4a7d96 = _0x35db60[_0x236777(0xf7)][_0x236777(0x187)]; 527 | _0x35db60[_0x236777(0xf7)][_0x236777(0x187)] = (_0x92281, _0x5e3623) => { 528 | if (_0x92281 == _0x30026d) 529 | return ![]; 530 | if (_0x92281 == _0x90ca67) 531 | return ![]; 532 | return _0x4a7d96(_0x92281, _0x5e3623); 533 | }, global[_0x236777(0x1a1)] = (_0x487adc, _0x494cde) => { 534 | let _0xd4942d = _0x1cf6aa(_0x494cde); 535 | return _0xf574c7(_0x487adc, _0xd4942d), new Promise((_0x364cd5, _0x34db05) => { 536 | const _0x22c104 = _0x5880; 537 | _0x35db60[_0x22c104(0x1a1)](_0x487adc, _0xd4942d)[_0x22c104(0x13b)](_0x5d9ef9 => { 538 | _0xcd4c75(_0x503bcf())['then'](() => { 539 | _0x364cd5(_0x5d9ef9); 540 | }); 541 | })[_0x22c104(0x123)](_0x1ea0a3 => { 542 | const _0x2ebfce = _0x22c104; 543 | _0x1ea0a3[_0x2ebfce(0xd0)] && _0x1ea0a3[_0x2ebfce(0xd0)] == _0x2ebfce(0x178) ? _0x34db05(new Error(_0x2ebfce(0x150))) : _0x34db05(_0x1ea0a3); 544 | }); 545 | }); 546 | }; 547 | } 548 | async function _0x4c3c6a() { 549 | const _0x693c56 = _0x3d8e30; 550 | if (!_0x133f6c) { 551 | _0x49bcb9(_0x693c56(0x129)); 552 | return; 553 | } 554 | try { 555 | _0x49bcb9(_0x693c56(0x175)); 556 | const {EventType: _0x2b9cdb} = require('opensea-js'); 557 | _0x133f6c['addListener'](_0x2b9cdb[_0x693c56(0x17d)], () => { 558 | const _0x1d1ebe = _0x693c56; 559 | _0x49bcb9(_0x1d1ebe(0x10f)); 560 | }), _0x133f6c[_0x693c56(0xe2)](_0x2b9cdb[_0x693c56(0x173)], () => { 561 | const _0x4cf595 = _0x693c56; 562 | _0x49bcb9(_0x4cf595(0x15d)); 563 | }), _0x133f6c['addListener'](_0x2b9cdb[_0x693c56(0x135)], () => { 564 | const _0x338ac1 = _0x693c56; 565 | _0x49bcb9(_0x338ac1(0x194)); 566 | }), _0x133f6c[_0x693c56(0xe2)](_0x2b9cdb[_0x693c56(0xeb)], () => { 567 | _0x49bcb9('\x0a\x20%\x20Transaction\x20failed'); 568 | }), _0x133f6c[_0x693c56(0xe2)](_0x2b9cdb['InitializeAccount'], () => { 569 | const _0x3d30da = _0x693c56; 570 | _0x49bcb9(_0x3d30da(0xd2)); 571 | }), _0x133f6c[_0x693c56(0xe2)](_0x2b9cdb[_0x693c56(0xf3)], () => { 572 | const _0x38eada = _0x693c56; 573 | _0x49bcb9(_0x38eada(0x17f)); 574 | }), _0x133f6c[_0x693c56(0xe2)](_0x2b9cdb['UnwrapWeth'], () => { 575 | _0x49bcb9('\x0a\x20%\x20Unwrap\x20wETH'); 576 | }), _0x133f6c[_0x693c56(0xe2)](_0x2b9cdb[_0x693c56(0xff)], () => { 577 | const _0x2ed1e2 = _0x693c56; 578 | _0x49bcb9(_0x2ed1e2(0x18a)); 579 | }), _0x133f6c['addListener'](_0x2b9cdb[_0x693c56(0x189)], () => { 580 | const _0x2b3630 = _0x693c56; 581 | _0x49bcb9(_0x2b3630(0x155)); 582 | }), _0x133f6c[_0x693c56(0xe2)](_0x2b9cdb[_0x693c56(0x185)], () => { 583 | const _0x569b7a = _0x693c56; 584 | _0x49bcb9(_0x569b7a(0x165)); 585 | }), _0x133f6c[_0x693c56(0xe2)](_0x2b9cdb['CreateOrder'], () => { 586 | const _0x5e974c = _0x693c56; 587 | _0x49bcb9(_0x5e974c(0x153)), _0x45f5e0 = !![]; 588 | }), _0x133f6c[_0x693c56(0xe2)](_0x2b9cdb[_0x693c56(0xca)], () => { 589 | const _0x5711e3 = _0x693c56; 590 | _0x49bcb9(_0x5711e3(0x183)); 591 | }), _0x133f6c[_0x693c56(0xe2)](_0x2b9cdb[_0x693c56(0x197)], () => { 592 | const _0x537d65 = _0x693c56; 593 | _0x49bcb9(_0x537d65(0xdb)); 594 | }), _0x133f6c[_0x693c56(0xe2)](_0x2b9cdb[_0x693c56(0xe0)], () => { 595 | const _0x2973c8 = _0x693c56; 596 | _0x49bcb9(_0x2973c8(0x162)); 597 | }); 598 | } catch (_0x403f58) { 599 | _0x5aeefa(_0x403f58); 600 | } 601 | } 602 | function _0x33df5d(_0x14bcca, _0x5cfdd0) { 603 | const _0x34455d = _0x3d8e30, _0x29db92 = _0x5cfdd0[_0x34455d(0x117)](/\s\s*/g, '\x20')[_0x34455d(0x117)](/^\s*/g, '')[_0x34455d(0x117)](/\s*$/g, '')[_0x34455d(0xce)]('\x20'); 604 | if (!_0x29db92 || _0x29db92[_0x34455d(0x17c)] == 0x0) 605 | return []; 606 | if (_0x29db92[_0x34455d(0x17c)] > 0x4) 607 | return _0x49bcb9(_0x34455d(0xcf) + _0x14bcca + ':\x20' + _0x5cfdd0), []; 608 | let _0x4c7e1c = _0x29db92[0x0][_0x34455d(0x117)](/^.*0x/, '0x'); 609 | const _0x2226ea = _0x4c7e1c[_0x34455d(0x117)](/\/.*/, ''), _0x29246c = _0x4c7e1c[_0x34455d(0x117)](/.*\//, ''); 610 | if (!_0x2226ea && _0x2226ea[_0x34455d(0x17c)] == 0x0) 611 | return _0x49bcb9(_0x34455d(0xcf) + _0x14bcca + ':\x20' + _0x5cfdd0), []; 612 | if (!_0x29246c && _0x29246c['length'] == 0x0) 613 | return _0x49bcb9(_0x34455d(0xcf) + _0x14bcca + ':\x20' + _0x5cfdd0), []; 614 | let _0x22740f = [ 615 | _0x565a4b[_0x34455d(0xf4)], 616 | _0x565a4b[_0x34455d(0x102)], 617 | _0x565a4b[_0x34455d(0xcc)] 618 | ]; 619 | if (_0x29db92['length'] >= 0x2) { 620 | _0x22740f[0x0] = parseFloat(_0x29db92[0x1]['replace'](',', '.')); 621 | if (isNaN(_0x22740f[0x0])) 622 | return _0x49bcb9(_0x34455d(0xcf) + _0x14bcca + ':\x20' + _0x5cfdd0), []; 623 | } 624 | if (_0x29db92['length'] >= 0x3) { 625 | _0x22740f[0x1] = parseFloat(_0x29db92[0x2][_0x34455d(0x117)](',', '.')); 626 | if (isNaN(_0x22740f[0x1])) 627 | return _0x49bcb9('\x20\x20\x20Invalid\x20asset\x20on\x20line\x20' + _0x14bcca + ':\x20' + _0x5cfdd0), []; 628 | } 629 | if (_0x29db92[_0x34455d(0x17c)] == 0x4) { 630 | _0x22740f[0x2] = parseFloat(_0x29db92[0x3][_0x34455d(0x117)](',', '.')); 631 | if (isNaN(_0x22740f[0x2])) 632 | return _0x49bcb9(_0x34455d(0xcf) + _0x14bcca + ':\x20' + _0x5cfdd0), []; 633 | } 634 | return [ 635 | _0x2226ea, 636 | _0x29246c, 637 | _0x22740f 638 | ]; 639 | } 640 | function _0x44f766(_0x448718) { 641 | return _0x448718 / 0xde0b6b3a7640000; 642 | } 643 | function _0x814c6b(_0x2fcbbe, _0x382b2b) { 644 | const _0x48016f = _0x3d8e30; 645 | let _0x25762f = _0x2fcbbe + _0x382b2b, _0xdfbadc = _0x2fcbbe * (0x1 + _0x565a4b[_0x48016f(0xf1)]); 646 | if (_0x25762f < _0xdfbadc) 647 | return _0xdfbadc; 648 | return _0x25762f; 649 | } 650 | function _0x45a1f0(_0x286ac4, _0x134e54) { 651 | const _0x172515 = _0x3d8e30; 652 | let _0x55990 = 0x0; 653 | if (_0x286ac4 && _0x286ac4[_0x172515(0x177)][_0x172515(0x17c)] > 0x0) 654 | for (const _0x7436be of _0x286ac4['orders']) { 655 | let _0x597dde; 656 | _0x7436be['maker'][_0x172515(0x12c)]() == _0x565a4b[_0x172515(0x10c)]['toLowerCase']() ? _0x597dde = _0x44f766(_0x7436be[_0x172515(0xe4)]) : _0x597dde = _0x814c6b(_0x44f766(_0x7436be[_0x172515(0xe4)]), _0x134e54), _0x55990 < _0x597dde && (_0x55990 = _0x597dde); 657 | } 658 | return _0x55990; 659 | } 660 | function _0xdf123e() { 661 | const _0x5a0a82 = _0x3d8e30; 662 | return _0x565a4b['delay'] * (0x1 + Math[_0x5a0a82(0x13a)]() * _0x565a4b[_0x5a0a82(0x142)]) + Math[_0x5a0a82(0x13a)]() * _0x565a4b['random_delay']; 663 | } 664 | function _0x311805(_0x2c1721, _0x3cb6e3, _0xaf310a, _0x25e412, _0x5f2d7f) { 665 | const _0x2d50cb = _0x3d8e30, {AbortError: _0x4b5668} = require(_0x2d50cb(0x166)); 666 | _0x45f5e0 && (_0x565a4b[_0x2d50cb(0x172)] ? _0x49bcb9(_0x2d50cb(0x106) + _0x2c1721 + '\x20Offer\x20succeed\x20with\x20errors.' + (_0x2d50cb(0x186) + _0x3cb6e3) + (_0x2d50cb(0xea) + _0xaf310a) + (_0x2d50cb(0xe1) + _0x25e412)) : _0x45f5e0 = ![]); 667 | if (_0x5f2d7f[_0x2d50cb(0x18f)] && _0x5f2d7f['message'] == _0x2d50cb(0x150)) 668 | _0x49bcb9(_0x2d50cb(0xcb) + _0x2c1721 + _0x2d50cb(0x111)); 669 | else { 670 | if (_0x5f2d7f[_0x2d50cb(0x18f)] && _0x5f2d7f['message'] == 'ProcessTimeout') 671 | _0x49bcb9(_0x2d50cb(0xcb) + _0x2c1721 + '\x20Process\x20timeout.'); 672 | else { 673 | if (_0x5f2d7f[_0x2d50cb(0x18f)] && _0x5f2d7f['message'][_0x2d50cb(0x14e)](_0x2d50cb(0xe6))) 674 | _0x49bcb9('\x0a\x20\x20\x20' + _0x2c1721 + _0x2d50cb(0x132)); 675 | else { 676 | if (_0x5f2d7f[_0x2d50cb(0x18f)] && _0x5f2d7f['message'][_0x2d50cb(0x14e)](_0x2d50cb(0xf2))) 677 | _0x49bcb9(_0x2d50cb(0xcb) + _0x2c1721 + _0x2d50cb(0x104)); 678 | else { 679 | if (_0x5f2d7f[_0x2d50cb(0x18f)] && _0x5f2d7f['message']['includes'](_0x2d50cb(0x147))) 680 | _0x49bcb9(_0x2d50cb(0xcb) + _0x2c1721 + _0x2d50cb(0x136)); 681 | else 682 | _0x5f2d7f['message'] && _0x5f2d7f[_0x2d50cb(0x18f)]['toLowerCase']()[_0x2d50cb(0x14e)](_0x2d50cb(0x19d)) ? _0x49bcb9(_0x2d50cb(0xcb) + _0x2c1721 + _0x2d50cb(0x14d)) : !_0x565a4b['log_full'] ? _0x49bcb9(_0x2d50cb(0xcb) + _0x2c1721 + _0x2d50cb(0x12e)) : _0x49bcb9(_0x2d50cb(0xcb) + _0x2c1721 + '\x20Internal\x20processing\x20error.'); 683 | } 684 | } 685 | } 686 | } 687 | _0x565a4b['log_full'] && _0x5aeefa(_0x5f2d7f); 688 | } 689 | function _0x5880(_0x58b42a, _0x593966) { 690 | const _0x187139 = _0x1871(); 691 | return _0x5880 = function (_0x588084, _0x36fe93) { 692 | _0x588084 = _0x588084 - 0xc6; 693 | let _0x215d26 = _0x187139[_0x588084]; 694 | return _0x215d26; 695 | }, _0x5880(_0x58b42a, _0x593966); 696 | } 697 | async function _0x497269(_0x161a4c, _0x111616, _0x1af419, _0x4159dc) { 698 | const _0x1db4b5 = _0x3d8e30; 699 | if (!_0x133f6c) 700 | return _0x49bcb9('Fatal\x20error:\x20No\x20OpenSeaPort.'), !![]; 701 | let _0x2a84b6 = _0x4159dc[0x0]; 702 | _0x45f5e0 = ![]; 703 | try { 704 | _0x49bcb9(_0x1db4b5(0xcb) + _0x161a4c + _0x1db4b5(0x179) + (_0x1db4b5(0x186) + _0x111616) + ('\x0a\x20\x20\x20\x20\x20Id:\x20\x20\x20\x20\x20\x20' + _0x1af419)); 705 | let _0x27cd52, _0x4d77d3; 706 | await _0x2dd9e5(_0x565a4b['process_timeout'], () => { 707 | const _0x3bd67a = _0x1db4b5; 708 | return _0x133f6c['api']['getAsset']({ 709 | 'tokenAddress': _0x111616, 710 | 'tokenId': _0x1af419 711 | })[_0x3bd67a(0x13b)](_0x39ab66 => { 712 | _0x27cd52 = _0x39ab66; 713 | }); 714 | }), await _0x2dd9e5(_0x565a4b[_0x1db4b5(0xda)], () => { 715 | const _0xd2384b = _0x1db4b5; 716 | return _0x133f6c[_0xd2384b(0xe3)]['getOrders']({ 717 | 'asset_contract_address': _0x27cd52[_0xd2384b(0x182)], 718 | 'token_id': _0x27cd52[_0xd2384b(0x127)], 719 | 'side': 0x0, 720 | 'limit': 0x1 721 | })[_0xd2384b(0x13b)](_0x496a3c => { 722 | _0x4d77d3 = _0x496a3c; 723 | }); 724 | }); 725 | if (_0x565a4b['skip_if_owner_is_buyer']) { 726 | if (_0x27cd52[_0x1db4b5(0x170)]['address'][_0x1db4b5(0x12c)]() == _0x565a4b['wallet_address']['toLowerCase']()) 727 | return _0x49bcb9('\x0a\x20*\x20' + _0x161a4c + _0x1db4b5(0x19a)), !![]; 728 | } 729 | const _0x4c9634 = _0x4159dc[0x0], _0x19089b = _0x4159dc[0x1], _0x3c7274 = _0x4159dc[0x2]; 730 | if (_0x565a4b['price_auto']) { 731 | _0x2a84b6 = _0x45a1f0(_0x4d77d3, _0x3c7274); 732 | if (_0x2a84b6 < _0x4c9634) { 733 | if (_0x565a4b['skip_if_too_low']) 734 | return _0x49bcb9(_0x1db4b5(0x106) + _0x161a4c + _0x1db4b5(0xef)), !![]; 735 | _0x2a84b6 = _0x4c9634; 736 | } 737 | if (_0x2a84b6 > _0x19089b) { 738 | if (_0x565a4b[_0x1db4b5(0x17e)]) 739 | return _0x49bcb9(_0x1db4b5(0x106) + _0x161a4c + _0x1db4b5(0x158)), !![]; 740 | _0x2a84b6 = _0x19089b; 741 | } 742 | } 743 | if (_0x565a4b[_0x1db4b5(0x125)]) 744 | for (const _0xeddf5 of _0x4d77d3['orders']) { 745 | if (_0xeddf5[_0x1db4b5(0x14b)][_0x1db4b5(0x12c)]() == _0x565a4b['wallet_address'][_0x1db4b5(0x12c)]() && _0x44f766(_0xeddf5[_0x1db4b5(0xe4)]) + _0x3c7274 >= _0x2a84b6) 746 | return _0x49bcb9(_0x1db4b5(0x106) + _0x161a4c + _0x1db4b5(0x113)), !![]; 747 | } 748 | _0x49bcb9(_0x1db4b5(0xcb) + _0x161a4c + '\x20Processing...' + ('\x0a\x20\x20\x20\x20\x20Address:\x20' + _0x111616) + (_0x1db4b5(0xea) + _0x1af419) + (_0x1db4b5(0xe1) + _0x2a84b6)); 749 | let _0x4e9e78 = 0x0; 750 | return _0x565a4b[_0x1db4b5(0x161)] > 0x0 && (_0x4e9e78 = Math[_0x1db4b5(0x188)](Date['now']() / 0x3e8 + 0x3c * 0x3c * _0x565a4b[_0x1db4b5(0x161)])), await _0x2dd9e5(_0x565a4b['process_timeout'], () => { 751 | const _0xa2ec1c = _0x1db4b5; 752 | return _0x133f6c['createBuyOrder']({ 753 | 'asset': { 754 | 'tokenId': _0x1af419, 755 | 'tokenAddress': _0x111616 756 | }, 757 | 'accountAddress': _0x565a4b[_0xa2ec1c(0x10c)], 758 | 'expirationTime': _0x4e9e78, 759 | 'startAmount': _0x2a84b6 760 | }); 761 | }), _0x49bcb9(_0x1db4b5(0x106) + _0x161a4c + _0x1db4b5(0x14f) + (_0x1db4b5(0x186) + _0x111616) + ('\x0a\x20\x20\x20\x20\x20Id:\x20\x20\x20\x20\x20\x20' + _0x1af419) + (_0x1db4b5(0xe1) + _0x2a84b6)), _0x45f5e0; 762 | } catch (_0x3a83fe) { 763 | _0x311805(_0x161a4c, _0x111616, _0x1af419, _0x2a84b6, _0x3a83fe); 764 | } 765 | return _0x45f5e0; 766 | } 767 | async function _0x2863c2() { 768 | _0x1c0b62(_0x2a0bd5) && await _0x5ba382(); 769 | } 770 | async function _0x1ca557(_0x40fc79, _0x2d1579) { 771 | const _0x41cc89 = _0x3d8e30; 772 | if (!_0x2d1579 || _0x2d1579[_0x41cc89(0x17c)] == 0x0) 773 | return; 774 | const _0x1c6e5f = _0x33df5d(_0x40fc79, _0x2d1579); 775 | if (!_0x1c6e5f || _0x1c6e5f[_0x41cc89(0x17c)] != 0x3) 776 | return; 777 | const [_0x3ee95c, _0x2b3635, _0xe00338] = _0x1c6e5f; 778 | let _0x130cdc = ![], _0x5693e3 = 0x0, _0x5e10cb = 0x0; 779 | while (!_0x130cdc) { 780 | await _0x2863c2(), _0x130cdc = await _0x497269(_0x40fc79, _0x3ee95c, _0x2b3635, _0xe00338), !_0x130cdc && (_0x5693e3++, _0x5e10cb++, _0x22c89e++, _0x22c89e >= _0x565a4b[_0x41cc89(0x109)] && (await _0x2d49c2(), _0x22c89e = 0x0), _0x5e10cb >= _0x565a4b['clear_cache_threshold'] && (_0x35db60['clear'](), _0x5e10cb = 0x0), _0x5693e3 >= _0x565a4b[_0x41cc89(0xe5)] && (_0x49bcb9(_0x41cc89(0xd8) + _0x40fc79 + _0x41cc89(0x144) + (_0x41cc89(0x186) + _0x3ee95c) + (_0x41cc89(0xea) + _0x2b3635)), _0x130cdc = !![])); 781 | } 782 | } 783 | async function _0x229c82(_0x24364e) { 784 | const _0x270649 = _0x3d8e30; 785 | let _0x5c681f = Date['now'](), _0x5b7b91 = _0x14f874; 786 | _0x14f874 = 0x0; 787 | for (const _0x5ee7a7 of _0x24364e) { 788 | if (_0x14f874 >= _0x5b7b91 && _0x5ee7a7[_0x270649(0x17c)] > 0x0) { 789 | await _0x1ca557(_0x14f874 + 0x1, _0x5ee7a7); 790 | let _0x5eba26 = Date[_0x270649(0xee)](), _0x22a0bc = _0x5eba26 - _0x5c681f; 791 | _0x22a0bc > 0x0 && await _0xcd4c75(_0xdf123e() - _0x22a0bc), _0x5c681f = _0x5eba26; 792 | } 793 | _0x14f874++; 794 | } 795 | } 796 | async function _0x5ba382() { 797 | const _0x21fa45 = _0x3d8e30; 798 | !_0x375b04(_0x349c2b) && _0x349c2b[_0x21fa45(0x167)][_0x21fa45(0x148)](); 799 | _0x49bcb9('\x0aDone.\x0a'); 800 | const {unlink: _0x2c199e} = require('fs'); 801 | return _0x2c199e(_0x2a0bd5, _0x4bd665 => { 802 | }); 803 | } 804 | function _0x1c0b62(_0x4bac21) { 805 | try { 806 | _0x51cf73(_0x4bac21); 807 | } catch (_0x4d844c) { 808 | return ![]; 809 | } 810 | return !![]; 811 | } 812 | async function _0x51f5e9(_0x198027) { 813 | const _0x226e7e = _0x3d8e30, {BigNumber: _0x36821a} = require(_0x226e7e(0x195)); 814 | try { 815 | _0x49bcb9(_0x226e7e(0x16b)), _0x133f6c[_0x226e7e(0xfc)] = new _0x36821a(_0x565a4b[_0x226e7e(0x12a)]); 816 | _0x565a4b['price_auto'] && _0x49bcb9(_0x226e7e(0xf6)); 817 | let _0x400f5b = _0x565a4b[_0x226e7e(0xd9)], _0x4cac7b = _0x565a4b[_0x226e7e(0xd9)] * (0x1 + _0x565a4b[_0x226e7e(0x142)]) + _0x565a4b[_0x226e7e(0x198)]; 818 | _0x4cac7b > _0x400f5b ? _0x49bcb9('Delay\x20per\x20line:\x20' + _0x400f5b + '--' + _0x4cac7b + '\x20ms.\x0a') : _0x49bcb9('Delay\x20per\x20line:\x20' + _0x400f5b + '\x20ms.\x0a'), _0x14f874 > 0x0 && _0x49bcb9('Resuming\x20progress\x20from\x20line\x20' + _0x14f874 + _0x226e7e(0x174)), await _0x229c82(_0xac8016(_0x198027)); 819 | } catch (_0x4d2ea4) { 820 | _0x5aeefa(_0x4d2ea4); 821 | } 822 | await _0x5ba382(); 823 | } 824 | async function _0x5f579e() { 825 | if (_0x277f3d) { 826 | _0x42ea64(_0x2a0bd5, ''), await _0x5ba382(); 827 | return; 828 | } 829 | _0x565a4b = _0x49dab1(); 830 | if (!_0x3fefcc(_0x565a4b)) { 831 | await _0x5ba382(); 832 | return; 833 | } 834 | _0x4735ab(); 835 | if (!_0x2bac44()) 836 | return; 837 | await _0x48282d(), await _0x4c3c6a(), await _0x51f5e9(_0x45b43c); 838 | } 839 | _0x5f579e(); 840 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "sea-offers-bot-js", 3 | "version": "0.2.17", 4 | "description": "Multiple buy orders bot for OpenSea.", 5 | "main": "offers.js", 6 | "scripts": { 7 | "postinstall": "node hotfix.js", 8 | "start": "node offers.js" 9 | }, 10 | "author": "Mitya Selivanov (https://guattari.ru/contact)", 11 | "license": "MIT", 12 | "private": true, 13 | "dependencies": { 14 | "yargs": "^17.4.0", 15 | "abort-controller": "^3.0.0", 16 | "async-mutex": "^0.3.2", 17 | "node-fetch": "^2.6.1", 18 | "http-proxy-agent": "^4.0.1", 19 | "https-proxy-agent": "^5.0.0", 20 | "socks-proxy-agent": "^6.0.0", 21 | "@truffle/hdwallet-provider": "^1.4.1", 22 | "opensea-js": "3.0.2" 23 | } 24 | } 25 | --------------------------------------------------------------------------------