conflict_resolution
stringlengths
27
16k
<<<<<<< /// <reference path="../../typings/tacoUtils.d.ts" /> ======= /// <reference path="../../typings/taco-utils.d.ts" /> /// <reference path="../../typings/taco-kits.d.ts" /> >>>>>>> /// <reference path="../../typings/tacoUtils.d.ts" /> /// <reference path="../../typings/taco-kits.d.ts" /> <<<<<<< import templateManager = require ("./utils/templateManager"); import cordovaWrapper = require ("./utils/cordovaWrapper"); ======= import templateManager = require ("./utils/template-manager"); import cordovaWrapper = require ("./utils/cordova-wrapper"); import projectHelper = require ("./utils/project-helper"); >>>>>>> import templateManager = require ("./utils/templateManager"); import cordovaWrapper = require ("./utils/cordovaWrapper"); import projectHelper = require("./utils/project-helper");
<<<<<<< import { parseRpcError, getErrorTypeFromErrorMessage } from '../utils/rpc_errors'; ======= import exponentialBackoff from '../utils/exponential-backoff'; import { parseRpcError } from '../utils/rpc_errors'; >>>>>>> import exponentialBackoff from '../utils/exponential-backoff'; import { parseRpcError, getErrorTypeFromErrorMessage } from '../utils/rpc_errors'; <<<<<<< } else { const errorMessage = `[${response.error.code}] ${response.error.message}: ${response.error.data}`; // NOTE: All this hackery is happening because structured errors not implemented // TODO: Fix when https://github.com/nearprotocol/nearcore/issues/1839 gets resolved if (response.error.data === 'Timeout' || errorMessage.includes('Timeout error')) { throw new TypedError('send_tx_commit has timed out.', 'TimeoutError'); } else { throw new TypedError(errorMessage, getErrorTypeFromErrorMessage(response.error.data)); ======= return response.result; } catch (error) { if (error.type === 'TimeoutError') { console.warn(`Retrying request to ${method} as it has timed out`, params); return null; >>>>>>> return response.result; } catch (error) { if (error.type === 'TimeoutError') { console.warn(`Retrying request to ${method} as it has timed out`, params); return null;
<<<<<<< var self = this; ======= var self: TemplateManager = this; var templateSrcPath: string = null; >>>>>>> var self: TemplateManager = this; <<<<<<< return TemplateManager.copyTemplateItemsToProject(cordovaParameters); ======= /* Cordova's --copy-from behavior: "cordova create [project path] --copy-from [template path]" supports 2 scenarios: 1) The template is for the entire project; 2) The template is only for the www assets. Cordova looks for a "www" folder at the root of the specified path ("the template"). If it finds one, then it assumes we are in case 1), otherwise it assumes we are in case 2). For case 1), Cordova looks for 4 specific items at the root of the template: "config.xml", "www\", "merges\" and "hooks\". When it finds one of those items, Cordova copies it to the user's project, otherwise it uses the default for that particular item. It ignores everything else in the template. For case 2), Cordova copies everything it finds in the template over to the "www\" folder of the user's project, and uses default items for everything else ("config.xml", "merges\", etc). What this means for TACO project creation: If we are in case 1), we need to copy the template items that Cordova ignored. For simplicity, we will simply recursively copy the entire template folder to the user's project, while using the "clobber = false" option of the NCP package. That way, all the items get copied over, but those that were already copied by Cordova are ignored. If we are in case 2), it means we don't have anything to do, because Cordova already copied all the template items to the "www\" folder of the user's project. */ // If we are in case 2) (see above comment), we need to skip the copy step var skipCopy: boolean = !fs.readdirSync(templateSrcPath).some(function (itemPath: string): boolean { return path.basename(itemPath) === "www"; }); if (skipCopy) { return Q.resolve({}); } // If we reach this point, we are in case 1) (see above comment), so we need to perform a recursive copy var filterFunc: (itemPath: string) => boolean = function (itemPath: string): boolean { // Return true if the item path is not in our list of git files to ignore return TemplateManager.GIT_FILE_LIST.indexOf(path.basename(itemPath)) === -1; }; var options: tacoUtility.ICopyOptions = { clobber: false, filter: filterFunc }; return utils.copyRecursive(templateSrcPath, cordovaParameters.projectPath, options); >>>>>>> return TemplateManager.copyTemplateItemsToProject(cordovaParameters); <<<<<<< var templateZip: admZip = new admZip(templateOverrideInfo.templateInfo.url); ======= var templateZip: AdmZip = new AdmZip(templateOverrideInfo.templateInfo.url); >>>>>>> var templateZip: AdmZip = new AdmZip(templateOverrideInfo.templateInfo.url); <<<<<<< private acquireFromTacoKits(templateId: string, kitId: string, tempTemplateDir: string): Q.Promise<string> { var self = this; ======= private acquireFromGit(templateUrl: string): Q.Promise<string> { loggerHelper.logSeparatorLine(); logger.log(resources.getString("CommandCreateGitTemplateHeader")); return this.gitClone(templateUrl); } private gitClone(repo: string): Q.Promise<string> { var deferred: Q.Deferred<any> = Q.defer<any>(); // Set up a temporary folder for the git clone var tmpDir: string = os.tmpdir(); var cloneTo: string = "taco_template_" + crypto.pseudoRandomBytes(20).toString("hex"); while (fs.existsSync(path.join(tmpDir, cloneTo))) { cloneTo = "taco_template_" + crypto.pseudoRandomBytes(20).toString("hex"); } var destination: string = path.join(tmpDir, cloneTo); var command: string = "git"; var args: string[] = [ "clone", "--depth", // Use the "--depth 1" option to minimize bandwidth usage, as we are only interested in the final state of the repo "1", repo, destination ]; var options: childProcess.IExecOptions = { cwd: tmpDir, stdio: "inherit" }; // Set cwd for the git child process to be in the temporary dir to ensure any created log or other files get created there childProcess.spawn(command, args, options) .on("error", function (err: any): void { if (err.code === "ENOENT") { // ENOENT error thrown if no git is found deferred.reject(errorHelper.get(TacoErrorCodes.CommandCreateNoGit)); } else { deferred.reject(err); } }) .on("exit", function (code: number): void { if (code) { deferred.reject(errorHelper.get(TacoErrorCodes.CommandCreateGitCloneError)); } else { deferred.resolve(destination); } }); return deferred.promise; } private acquireFromTacoKits(templateId: string, kitId: string): Q.Promise<string> { var self: TemplateManager = this; >>>>>>> private acquireFromTacoKits(templateId: string, kitId: string, tempTemplateDir: string): Q.Promise<string> { var self: TemplateManager = this; <<<<<<< var templateInfo: TacoKits.ITemplateInfo = templateOverrideForKit.templateInfo; var extractDestination: string = TemplateManager.createUnusedFolderPath(tempTemplateDir); ======= var templateInfo: TacoKits.ITemplateInfo = templateOverrideForKit.templateInfo; self.templateName = templateInfo.name; return self.findTemplatePath(templateId, templateOverrideForKit.kitId, templateInfo); }); } >>>>>>> var templateInfo: TacoKits.ITemplateInfo = templateOverrideForKit.templateInfo; var extractDestination: string = TemplateManager.createUnusedFolderPath(tempTemplateDir); <<<<<<< // Extract the template archive to the temporary folder var templateZip: admZip = new admZip(templateInfo.url); ======= // Extract the template archive to the cache var templateZip: AdmZip = new AdmZip(templateInfo.url); >>>>>>> // Extract the template archive to the temporary folder var templateZip: AdmZip = new AdmZip(templateInfo.url);
<<<<<<< NearProtocolConfig, LightClientProof, LightClientProofRequest ======= GenesisConfig, LightClientProof, LightClientProofRequest, GasPrice >>>>>>> NearProtocolConfig, LightClientProof, LightClientProofRequest, GasPrice
<<<<<<< ======= /// <reference path="typings/del.d.ts" /> /// <reference path="typings/archiver.d.ts" /> >>>>>>> /// <reference path="typings/del.d.ts" /> /// <reference path="typings/archiver.d.ts" /> <<<<<<< ======= import archiver = require ("archiver"); import zlib = require ("zlib"); import dtsUtil = require ("../tools/tsdefinition-util"); >>>>>>> <<<<<<< gulp.task("install-build", ["build", "prepare-templates"], function (): Q.Promise<any> { return gulpUtil.installModules(tacoModules, buildConfig.buildSrc); ======= gulp.task("copy-build", ["build"], function (): any { return gulp.src(path.join(buildConfig.buildSrc, "/**")).pipe(gulp.dest(buildConfig.buildBin)); }); function TrimEnd(str: string, chars: string[]): string { // Trim "/" from the end var index: number = str.length - 1; while (chars.indexOf(str[index]) > -1) { index--; } return str.substring(0, index + 1); } gulp.task("install-build", ["copy-build", "prepare-templates"], function (): Q.Promise<any> { var paths = modulesToInstallAndTest.map(function (m: string): string { return path.resolve(buildConfig.buildBin, m); }); return paths.reduce(function (soFar: Q.Promise<any>, val: string): Q.Promise<any> { return soFar.then(function (): Q.Promise<any> { console.log("Installing " + val); var deferred = Q.defer<Buffer>(); child_process.exec("npm install", { cwd: val }, deferred.makeNodeResolver()); return deferred.promise; }); }, Q({})).then(function (): void { // Check whether the taco-cli is in the path and warn if not var binpath = path.resolve(buildConfig.buildBin, "taco-cli", "bin"); var pathsInPATH: string[] = process.env.PATH.split(path.delimiter); for (var i: number = 0; i < pathsInPATH.length; i++) { // Trim "/" from the end if (TrimEnd(pathsInPATH[i], [path.sep, "/"]) === binpath) { // PATH contains the location of the compiled taco executable return; } } console.warn("Warning: the compiled 'taco' CLI is not in your PATH. Consider adding " + binpath + " to PATH."); }); >>>>>>> gulp.task("install-build", ["build", "prepare-templates"], function (): Q.Promise<any> { return gulpUtil.installModules(tacoModules, buildConfig.buildSrc); <<<<<<< return gulpUtil.prepareTemplates(buildConfig.templates, buildConfig.buildTemplates); ======= var buildTemplatesPath: string = path.resolve(buildConfig.buildTemplates); var promises: Q.Promise<any>[] = []; if (!fs.existsSync(buildTemplatesPath)) { fs.mkdirSync(buildTemplatesPath); } // Read the templates dir to discover the different kits var templatesPath: string = buildConfig.templates; var kits: string[] = getChildDirectoriesSync(templatesPath); kits.forEach(function (kitValue: string, index: number, array: string[]): void { // Read the kit's dir for all the available templates var kitSrcPath: string = path.join(buildConfig.templates, kitValue); var kitTargetPath: string = path.join(buildTemplatesPath, kitValue); if (!fs.existsSync(kitTargetPath)) { fs.mkdirSync(kitTargetPath); } var kitTemplates: string[] = getChildDirectoriesSync(kitSrcPath); kitTemplates.forEach(function (templateValue: string, index: number, array: string[]): void { // Create the template's archive var templateSrcPath: string = path.resolve(kitSrcPath, templateValue); var templateTargetPath: string = path.join(kitTargetPath, templateValue + ".zip"); var archive: any = archiver("zip"); var outputStream: NodeJS.WritableStream = fs.createWriteStream(templateTargetPath); var deferred: Q.Deferred<any> = Q.defer<any>(); archive.on("error", function (err: Error): void { deferred.reject(err); }); outputStream.on("close", function (): void { deferred.resolve({}); }); archive.pipe(outputStream); // Note: archiver.bulk() automatically ignores files starting with "."; if this behavior ever changes, or if a different package is used // to archive the templates, some logic to exclude the ".taco-ignore" files found in the templates will need to be added here archive.bulk({ expand: true, cwd: path.join(templatesPath, kitValue), src: [templateValue + "/**"] }).finalize(); promises.push(deferred.promise); }); }); return Q.all(promises); >>>>>>> return gulpUtil.prepareTemplates(buildConfig.templates, buildConfig.buildTemplates);
<<<<<<< cordovaCli?: string; templateDisplayName?: string; isKitProject?: boolean; kitId?: string; ======= >>>>>>> templateDisplayName?: string; cordovaCli?: string; isKitProject?: boolean; kitId?: string; <<<<<<< .then(function (): Q.Promise<any> { return self.createTacoJsonFile() .then(function (): Q.Promise<any> { self.finalize(); return Q.resolve({}); ======= .then(function (templateDisplayName: string): Q.Promise<any> { self.finalize(templateDisplayName); return Q.resolve(null); >>>>>>> .then(function (templateDisplayName: string): Q.Promise<any> { return self.createTacoJsonFile() .then(function (): Q.Promise<any> { self.finalize(); return Q.resolve(null);
<<<<<<< import resources = require("../resources/resourceManager"); import TacoUtility = require("taco-utils"); ======= import rimraf = require ("rimraf"); import util = require ("util"); import buildMod = require ("../cli/build"); import setupMod = require ("../cli/setup"); import TacoUtility = require ("taco-utils"); import utils = TacoUtility.UtilHelper; import resources = TacoUtility.ResourcesManager; >>>>>>> import buildMod = require("../cli/build"); import resources = require("../resources/resourceManager"); import ServerMock = require("./utils/serverMock"); import SetupMock = require("./utils/setupMock"); import setupMod = require("../cli/setup"); import TacoUtility = require("taco-utils"); <<<<<<< import utils = TacoUtility.UtilHelper; ======= >>>>>>> import utils = TacoUtility.UtilHelper;
<<<<<<< this.printCommandTable(list.args, this.indent); logger.logLine("\n" + this.indent + resources.getString("command.help.usage.options") + "\n", level.NormalBold); this.printCommandTable(list.options, this.indent + this.indent); ======= if (list.args) { this.printCommandTable(list.args, this.indent); } if (list.options) { logger.logLine("\n" + this.indent + resourcesManager.getString("command.help.usage.options") + "\n", level.NormalBold); this.printCommandTable(list.options, this.indent + this.indent); } >>>>>>> if (list.args) { this.printCommandTable(list.args, this.indent); } if (list.options) { logger.logLine("\n" + this.indent + resources.getString("command.help.usage.options") + "\n", level.NormalBold); this.printCommandTable(list.options, this.indent + this.indent); }
<<<<<<< runCommand(args).then(telemetryProperties => { telemetryShouldEqual(telemetryProperties, expected); }).done(() => done(), done); ======= runCommand(args) .then(telemetryProperties => telemetryShouldEqual(telemetryProperties, expected)) .done(() => done(), done); >>>>>>> runCommand(args).then(telemetryProperties => { telemetryShouldEqual(telemetryProperties, expected); }).done(() => done(), done); <<<<<<< .finally(() => testHttpServer.removeAllListeners("request")) .then(telemetryProperties => { telemetryShouldEqual(telemetryProperties, expected, 28427, 28379); }).done(() => done(), done); ======= .finally(() => { testIosHttpServer.removeAllListeners("request"); testAndroidHttpServer.removeAllListeners("request") }) .then(telemetryProperties => telemetryShouldEqual(telemetryProperties, expected, 28379, 28379)) .done(() => done(), done); >>>>>>> .finally(() => { testIosHttpServer.removeAllListeners("request"); testAndroidHttpServer.removeAllListeners("request") }) .then(telemetryProperties => telemetryShouldEqual(telemetryProperties, expected, 28379, 28379)) .done(() => done(), done); <<<<<<< runCommand(args).then(telemetryProperties => { telemetryShouldEqual(telemetryProperties, expected); }).done(() => done(), done); ======= runCommand(args) .then(telemetryProperties => telemetryShouldEqual(telemetryProperties, expected)) .then(() => done(), done); >>>>>>> runCommand(args) .then(telemetryProperties => telemetryShouldEqual(telemetryProperties, expected)) .then(() => done(), done); <<<<<<< runCommand(args).then(telemetryProperties => { telemetryShouldEqual(telemetryProperties, expected); }).done(() => done(), done); ======= runCommand(args) .then(telemetryProperties => telemetryShouldEqual(telemetryProperties, expected)) .then(() => done(), done) >>>>>>> runCommand(args) .then(telemetryProperties => telemetryShouldEqual(telemetryProperties, expected)) .then(() => done(), done);
<<<<<<< var parsedArgs: IParsedArgs = Taco.parseArgs(process.argv.slice(2)); var commandProperties: ICommandTelemetryProperties = {}; Taco.runWithParsedArgs(parsedArgs) .then(function (): void { if (parsedArgs.command) { parsedArgs.command.getTelemetryProperties().then(function (properties: ICommandTelemetryProperties): void { commandProperties = properties; }); } }).done(function (): void { telemetryHelper.sendCommandSuccessTelemetry(parsedArgs.commandName, commandProperties, parsedArgs.args); }, function (reason: any): any { ======= // We check if there is a new taco-cli version available, and if so, we print a message before exiting the application new CheckForNewerVersion().showOnExitAndIgnoreFailures(); Taco.runWithArgs(process.argv.slice(2)).done(null, function (reason: any): any { >>>>>>> // We check if there is a new taco-cli version available, and if so, we print a message before exiting the application new CheckForNewerVersion().showOnExitAndIgnoreFailures(); var parsedArgs: IParsedArgs = Taco.parseArgs(process.argv.slice(2)); var commandProperties: ICommandTelemetryProperties = {}; Taco.runWithParsedArgs(parsedArgs) .then(function (): void { if (parsedArgs.command) { parsedArgs.command.getTelemetryProperties().then(function (properties: ICommandTelemetryProperties): void { commandProperties = properties; }); } }).done(function (): void { telemetryHelper.sendCommandSuccessTelemetry(parsedArgs.commandName, commandProperties, parsedArgs.args); }, function (reason: any): any {
<<<<<<< var tacoModules = ["taco-utils", "taco-kits", "taco-dependency-installer", "taco-cli", "remotebuild", "taco-remote", "taco-remote-lib"]; ======= var tacoModules = ["taco-utils", "taco-kits", "taco-cli", "remotebuild", "taco-remote", "taco-remote-lib"]; var allModules = tacoModules.concat(["taco-remote-multiplexer"]); >>>>>>> var tacoModules = ["taco-utils", "taco-kits", "taco-dependency-installer", "taco-cli", "remotebuild", "taco-remote", "taco-remote-lib"]; var allModules = tacoModules.concat(["taco-remote-multiplexer"]);
<<<<<<< return gulpUtils.copyFiles( [ "/**/package.json", "/**/resources.json", "/**/test/**", "/**/commands.json", "/**/TacoKitMetaData.json", "/**/bin/**", "/**/templates/**", "/**/examples/**", "/**/*.ps1", "/**/dynamicDependencies.json", "/**/platformDependencies.json" ], buildConfig.src, buildConfig.buildPackages).then(function (): void { /* replace %TACO_BUILD_PACKAGES% with the absolute path of buildConfig.buildPackages in the built output */ replace({ regex: /%TACO_BUILD_PACKAGES%/g, replacement: JSON.stringify(path.resolve(buildConfig.buildPackages)).replace(/"/g, ""), paths: [buildConfig.buildPackages], includes: "*.json", recursive: true, silent: false }); }); ======= var filesToCopy: string[] = [ "/**/package.json", "/**/resources.json", "/**/test/**", "/**/commands.json", "/**/TacoKitMetaData.json", "/**/bin/**", "/**/templates/**", "/**/examples/**", "/**/*.ps1", ]; return Q.all([ gulpUtils.copyFiles(filesToCopy, buildConfig.src, buildConfig.buildPackages), gulpUtils.copyDynamicDependenciesJson("/**/dynamicDependencies.json", buildConfig.src, buildConfig.buildPackages) ]); >>>>>>> var filesToCopy: string[] = [ "/**/package.json", "/**/resources.json", "/**/test/**", "/**/commands.json", "/**/TacoKitMetaData.json", "/**/bin/**", "/**/templates/**", "/**/examples/**", "/**/*.ps1", "/**/platformDependencies.json" ]; return Q.all([ gulpUtils.copyFiles(filesToCopy, buildConfig.src, buildConfig.buildPackages), gulpUtils.copyDynamicDependenciesJson("/**/dynamicDependencies.json", buildConfig.src, buildConfig.buildPackages) ]);
<<<<<<< // Note not import: We don't want to refer to should_module, but we need the require to occur since it modifies the prototype of Object. import archiver = require("archiver"); import fs = require("fs"); import mocha = require("mocha"); import os = require("os"); import path = require ("path"); import rimraf = require("rimraf"); var should_module = require("should"); import wrench = require("wrench"); import zlib = require("zlib"); import resources = require("../resources/resourceManager"); import tacoKits = require("taco-kits"); import tacoUtils = require("taco-utils"); import templates = require ("../cli/utils/templateManager"); ======= import archiver = require ("archiver"); import fs = require ("fs"); import mocha = require ("mocha"); import os = require ("os"); import path = require ("path"); import rimraf = require ("rimraf"); import wrench = require ("wrench"); import zlib = require ("zlib"); import templates = require ("../cli/utils/templateManager"); import tacoKits = require ("taco-kits"); import tacoUtils = require ("taco-utils"); >>>>>>> import archiver = require("archiver"); import fs = require("fs"); import mocha = require("mocha"); import os = require("os"); import path = require ("path"); import rimraf = require("rimraf"); // Note not import: We don't want to refer to should_module, but we need the require to occur since it modifies the prototype of Object. var should_module = require("should"); import wrench = require("wrench"); import zlib = require("zlib"); import resources = require("../resources/resourceManager"); import tacoKits = require("taco-kits"); import tacoUtils = require("taco-utils"); import templates = require ("../cli/utils/templateManager"); <<<<<<< import utils = tacoUtils.UtilHelper; ======= import resources = tacoUtils.ResourcesManager; import utils = tacoUtils.UtilHelper; >>>>>>> import utils = tacoUtils.UtilHelper;
<<<<<<< import TacoProjectHelper = projectHelper.TacoProjectHelper; import telemetry = tacoUtility.Telemetry; ======= >>>>>>> import telemetry = tacoUtility.Telemetry; <<<<<<< TacoProjectHelper.cdToProjectRoot(); telemetry.init(require("../package.json").version); ======= projectHelper.cdToProjectRoot(); >>>>>>> projectHelper.cdToProjectRoot(); telemetry.init(require("../package.json").version);
<<<<<<< if (Array.isArray(value)) { const _remove_count = remove_count; remove_count = 0; ======= if (typeof value !== 'object') { continue; } else if (Array.isArray(value)) { >>>>>>> if (typeof value !== 'object') { continue; } else if (Array.isArray(value)) { const _remove_count = remove_count; remove_count = 0;
<<<<<<< async createMidstreamVersion(id: string, sequence: number, versionLabel: string, updateCursor: string, supportBundleSpec: any, preflightSpec: any, appSpec: any, kotsAppSpec: any, appTitle: string | null, appIcon: string | null): Promise<void> { const q = `insert into app_version (app_id, sequence, created_at, version_label, update_cursor, supportbundle_spec, preflight_spec, app_spec, kots_app_spec) values ($1, $2, $3, $4, $5, $6, $7, $8, $9)`; ======= async createMidstreamVersion(id: string, sequence: number, versionLabel: string, releaseNotes: string, updateCursor: string, supportBundleSpec: any, preflightSpec: any, appSpec: any, kotsAppSpec: any, appTitle: string | null): Promise<void> { const q = `insert into app_version (app_id, sequence, created_at, version_label, release_notes, update_cursor, supportbundle_spec, preflight_spec, app_spec, kots_app_spec) values ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10)`; >>>>>>> async createMidstreamVersion(id: string, sequence: number, versionLabel: string, releaseNotes: string, updateCursor: string, supportBundleSpec: any, preflightSpec: any, appSpec: any, kotsAppSpec: any, appTitle: string | null, appIcon: string | null): Promise<void> { const q = `insert into app_version (app_id, sequence, created_at, version_label, release_notes, update_cursor, supportbundle_spec, preflight_spec, app_spec, kots_app_spec) values ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10)`;
<<<<<<< ======= import GitHubApi from "@octokit/rest"; import jwt from "jsonwebtoken"; import { Cluster } from "../cluster"; >>>>>>> import GitHubApi from "@octokit/rest"; import jwt from "jsonwebtoken"; import { Cluster } from "../cluster";
<<<<<<< extractAppTitleFromTarball, extractAppIconFromTarball ======= extractAppTitleFromTarball, >>>>>>> extractAppTitleFromTarball, extractAppIconFromTarball <<<<<<< const appIcon = await extractAppIconFromTarball(buffer); await stores.kotsAppStore.createMidstreamVersion(app.id, newSequence, cursorAndVersion.versionLabel, cursorAndVersion.cursor, supportBundleSpec, preflightSpec, appSpec, kotsAppSpec, appTitle, appIcon); ======= await stores.kotsAppStore.createMidstreamVersion(app.id, newSequence, installationSpec.versionLabel, installationSpec.releaseNotes, installationSpec.cursor, supportBundleSpec, preflightSpec, appSpec, kotsAppSpec, appTitle); >>>>>>> const appIcon = await extractAppIconFromTarball(buffer); await stores.kotsAppStore.createMidstreamVersion(app.id, newSequence, installationSpec.versionLabel, installationSpec.releaseNotes, installationSpec.cursor, supportBundleSpec, preflightSpec, appSpec, kotsAppSpec, appTitle, appIcon); <<<<<<< await stores.kotsAppStore.createMidstreamVersion(kotsApp.id, 0, cursorAndVersion.versionLabel, cursorAndVersion.cursor, supportBundleSpec, preflightSpec, appSpec, kotsAppSpec, appTitle, appIcon); ======= await stores.kotsAppStore.createMidstreamVersion(kotsApp.id, 0, installationSpec.versionLabel, installationSpec.releaseNotes, installationSpec.cursor, supportBundleSpec, preflightSpec, appSpec, kotsAppSpec, appTitle); >>>>>>> await stores.kotsAppStore.createMidstreamVersion(kotsApp.id, 0, installationSpec.versionLabel, installationSpec.releaseNotes, installationSpec.cursor, supportBundleSpec, preflightSpec, appSpec, kotsAppSpec, appTitle, appIcon); <<<<<<< const appIcon = await extractAppIconFromTarball(buffer); await stores.kotsAppStore.createMidstreamVersion(app.id, 0, cursorAndVersion.versionLabel, cursorAndVersion.cursor, supportBundleSpec, preflightSpec, appSpec, kotsAppSpec, appTitle, appIcon); ======= await stores.kotsAppStore.createMidstreamVersion(app.id, 0, installationSpec.versionLabel, installationSpec.releaseNotes, installationSpec.cursor, supportBundleSpec, preflightSpec, appSpec, kotsAppSpec, appTitle); >>>>>>> const appIcon = await extractAppIconFromTarball(buffer); await stores.kotsAppStore.createMidstreamVersion(app.id, 0, installationSpec.versionLabel, installationSpec.releaseNotes, installationSpec.cursor, supportBundleSpec, preflightSpec, appSpec, kotsAppSpec, appTitle, appIcon);
<<<<<<< extractPreflightSpecFromTarball, extractSupportBundleSpecFromTarball, extractAppTitleFromTarball ======= extractPreflightSpecFromTarball, extractAppSpecFromTarball, extractKotsAppSpecFromTarball >>>>>>> extractPreflightSpecFromTarball, extractAppSpecFromTarball, extractKotsAppSpecFromTarball, extractSupportBundleSpecFromTarball, extractAppTitleFromTarball <<<<<<< await request.app.locals.stores.kotsAppStore.createMidstreamVersion(kotsApp.id, 0, cursorAndVersion.versionLabel, cursorAndVersion.cursor, undefined, undefined, undefined); // TODO parse and get support bundle and prefight from the upload ======= >>>>>>>
<<<<<<< await request.app.locals.stores.kotsAppStore.createMidstreamVersion(kotsApp.id, 0, cursorAndVersion.versionLabel, cursorAndVersion.cursor, supportBundleSpec, preflightSpec, appSpec, kotsAppSpec, appTitle, appIcon); ======= await request.app.locals.stores.kotsAppStore.createMidstreamVersion(kotsApp.id, 0, installationSpec.versionLabel, installationSpec.releaseNotes, installationSpec.cursor, supportBundleSpec, preflightSpec, appSpec, kotsAppSpec, appTitle); >>>>>>> await request.app.locals.stores.kotsAppStore.createMidstreamVersion(kotsApp.id, 0, installationSpec.versionLabel, installationSpec.releaseNotes, installationSpec.cursor, supportBundleSpec, preflightSpec, appSpec, kotsAppSpec, appTitle, appIcon); <<<<<<< await stores.kotsAppStore.createMidstreamVersion(kotsApp.id, newSequence, cursorAndVersion.versionLabel, cursorAndVersion.cursor, supportBundleSpec, preflightSpec, appSpec, kotsAppSpec, appTitle, appIcon); ======= await stores.kotsAppStore.createMidstreamVersion(kotsApp.id, newSequence, installationSpec.versionLabel, installationSpec.releaseNotes, installationSpec.cursor, supportBundleSpec, preflightSpec, appSpec, kotsAppSpec, appTitle); >>>>>>> await stores.kotsAppStore.createMidstreamVersion(kotsApp.id, newSequence, installationSpec.versionLabel, installationSpec.releaseNotes, installationSpec.cursor, supportBundleSpec, preflightSpec, appSpec, kotsAppSpec, appTitle, appIcon);
<<<<<<< export * from './src/findInArray' ======= export * from './tavern/createTavernName' export * from './tavern/tavernModifiers' >>>>>>> export * from './src/findInArray' export * from './tavern/createTavernName' export * from './tavern/tavernModifiers'
<<<<<<< import { AR as ARBase, ARAddOptions, ARAddVideoOptions, ARAddBoxOptions, ARAddModelOptions, ARAddSphereOptions, ARAddTextOptions, ARAddTubeOptions, ARDebugLevel, ARFaceTrackingActions, ARImageTrackingActions, ARLoadedEventData, ARNode, ARPlaneDetectedEventData, ARPlaneTappedEventData, ARPosition, ARSceneTappedEventData, ARTrackingFaceEventData, ARTrackingFaceEventType, ARTrackingImageDetectedEventData, ARTrackingMode } from "./ar-common"; ======= import { AR as ARBase, ARAddOptions, ARAddImageOptions, ARAddBoxOptions, ARAddModelOptions, ARAddSphereOptions, ARAddTextOptions, ARAddTubeOptions, ARDebugLevel, ARFaceTrackingActions, ARImageTrackingActions, ARLoadedEventData, ARNode, ARPlaneDetectedEventData, ARPlaneTappedEventData, ARPosition, ARSceneTappedEventData, ARTrackingFaceEventData, ARTrackingFaceEventType, ARTrackingImageDetectedEventData, ARTrackingMode } from "./ar-common"; >>>>>>> import { AR as ARBase, ARAddOptions, ARAddImageOptions, ARAddVideoOptions, ARAddBoxOptions, ARAddModelOptions, ARAddSphereOptions, ARAddTextOptions, ARAddTubeOptions, ARDebugLevel, ARFaceTrackingActions, ARImageTrackingActions, ARLoadedEventData, ARNode, ARPlaneDetectedEventData, ARPlaneTappedEventData, ARPosition, ARSceneTappedEventData, ARTrackingFaceEventData, ARTrackingFaceEventType, ARTrackingImageDetectedEventData, ARTrackingMode } from "./ar-common"; <<<<<<< import { ARVideo } from "./nodes/ios/arvideo"; ======= import { ARImage } from "./nodes/ios/arimage"; >>>>>>> import { ARVideo } from "./nodes/ios/arvideo"; import { ARImage } from "./nodes/ios/arimage"; <<<<<<< const addVideo = (options: ARAddVideoOptions, parentNode: SCNNode): Promise<ARVideo> => { return new Promise((resolve, reject) => { const video = ARVideo.create(options); ARState.shapes.set(video.id, video); parentNode.addChildNode(video.ios); resolve(video); }); }; ======= const addImage = (options: ARAddImageOptions, parentNode: SCNNode): Promise<ARImage> => { return ARImage.create(options).then((image) => { ARState.shapes.set(image.id, image); parentNode.addChildNode(image.ios); return image; }); }; >>>>>>> const addVideo = (options: ARAddVideoOptions, parentNode: SCNNode): Promise<ARVideo> => { return new Promise((resolve, reject) => { const video = ARVideo.create(options); ARState.shapes.set(video.id, video); parentNode.addChildNode(video.ios); resolve(video); }); }; const addImage = (options: ARAddImageOptions, parentNode: SCNNode): Promise<ARImage> => { return ARImage.create(options).then((image) => { ARState.shapes.set(image.id, image); parentNode.addChildNode(image.ios); return image; }); }; <<<<<<< addVideo(options: ARAddVideoOptions): Promise<ARVideo> { return addVideo(options, this.resolveParentNode(options)); } ======= addImage(options: ARAddImageOptions): Promise<ARGroup> { return addImage(options, this.resolveParentNode(options)); } >>>>>>> addVideo(options: ARAddVideoOptions): Promise<ARVideo> { return addVideo(options, this.resolveParentNode(options)); } addImage(options: ARAddImageOptions): Promise<ARGroup> { return addImage(options, this.resolveParentNode(options)); }
<<<<<<< import { ARUIView } from "./nodes/ios/aruiview"; ======= import { ARGroup } from "./nodes/ios/argroup"; import { ImageSource, fromNativeSource } from "tns-core-modules/image-source"; >>>>>>> import { ARUIView } from "./nodes/ios/aruiview"; import { ARGroup } from "./nodes/ios/argroup"; import { ImageSource, fromNativeSource } from "tns-core-modules/image-source"; <<<<<<< const addUIView = (options: ARUIViewOptions, parentNode: SCNNode): Promise<ARUIView> => { return new Promise((resolve, reject) => { const view = ARUIView.create(options); ARState.shapes.set(view.id, view); parentNode.addChildNode(view.ios); resolve(view); }); }; ======= const addNode = (options: ARAddOptions, parentNode: SCNNode): Promise<ARGroup> => { return new Promise((resolve, reject) => { const group = ARGroup.create(options); ARState.shapes.set(group.id, group); parentNode.addChildNode(group.ios); resolve(group); }); }; >>>>>>> const addUIView = (options: ARUIViewOptions, parentNode: SCNNode): Promise<ARUIView> => { return new Promise((resolve, reject) => { const view = ARUIView.create(options); ARState.shapes.set(view.id, view); parentNode.addChildNode(view.ios); resolve(view); }); }; const addNode = (options: ARAddOptions, parentNode: SCNNode): Promise<ARGroup> => { return new Promise((resolve, reject) => { const group = ARGroup.create(options); ARState.shapes.set(group.id, group); parentNode.addChildNode(group.ios); resolve(group); }); }; <<<<<<< addUIView(options: ARUIViewOptions): Promise<ARUIView> { return addUIView(options, this.resolveParentNode(options)); } ======= addNode(options: ARAddModelOptions): Promise<ARGroup> { return addNode(options, this.resolveParentNode(options)); } >>>>>>> addUIView(options: ARUIViewOptions): Promise<ARUIView> { return addUIView(options, this.resolveParentNode(options)); } addNode(options: ARAddModelOptions): Promise<ARGroup> { return addNode(options, this.resolveParentNode(options)); }
<<<<<<< import * as application from 'tns-core-modules/application'; import { AR as ARBase, ARAddBoxOptions, ARAddOptions, ARUIViewOptions, ARAddModelOptions, ARAddSphereOptions, ARAddTextOptions, ARAddTubeOptions, ARDebugLevel, ARFaceTrackingActions, ARImageTrackingActions, ARLoadedEventData, ARNode, ARPlaneDetectedEventData, ARPlaneTappedEventData, ARPosition, ARSceneTappedEventData, ARTrackingFaceEventData, ARTrackingFaceEventType, ARTrackingImageDetectedEventData, ARTrackingMode } from "./ar-common"; ======= import * as application from "tns-core-modules/application"; import { fromNativeSource, ImageSource } from "tns-core-modules/image-source"; import { AR as ARBase, ARAddBoxOptions, ARAddImageOptions, ARAddModelOptions, ARAddOptions, ARAddSphereOptions, ARAddTextOptions, ARAddTubeOptions, ARAddVideoOptions, ARCommonNode, ARDebugLevel, ARFaceTrackingActions, ARImageTrackingActions, ARLoadedEventData, ARNode, ARPlaneDetectedEventData, ARPlaneTappedEventData, ARPosition, ARSceneTappedEventData, ARTrackingFaceEventData, ARTrackingFaceEventType, ARTrackingImageDetectedEventData, ARTrackingMode, ARVideoNode } from "./ar-common"; >>>>>>> import * as application from 'tns-core-modules/application'; import { fromNativeSource, ImageSource } from "tns-core-modules/image-source"; import { AR as ARBase, ARAddBoxOptions, ARAddImageOptions, ARAddModelOptions, ARAddOptions, ARAddSphereOptions, ARAddTextOptions, ARAddTubeOptions, ARAddVideoOptions, ARCommonNode, ARDebugLevel, ARFaceTrackingActions, ARImageTrackingActions, ARLoadedEventData, ARNode, ARPlaneDetectedEventData, ARPlaneTappedEventData, ARPosition, ARSceneTappedEventData, ARTrackingFaceEventData, ARTrackingFaceEventType, ARTrackingImageDetectedEventData, ARTrackingMode, ARUIViewOptions, ARVideoNode } from "./ar-common"; <<<<<<< import { ARUIView } from "./nodes/ios/aruiview"; import { ARGroup } from "./nodes/ios/argroup"; import { ImageSource, fromNativeSource } from "tns-core-modules/image-source"; ======= import { ARVideo } from "./nodes/ios/arvideo"; >>>>>>> import { ARUIView } from "./nodes/ios/aruiview"; import { ARVideo } from "./nodes/ios/arvideo"; <<<<<<< addUIView(options: ARUIViewOptions): Promise<ARUIView> { return addUIView(options, this.resolveParentNode(options)); } addNode(options: ARAddModelOptions): Promise<ARGroup> { ======= addNode(options: ARAddOptions): Promise<ARGroup> { >>>>>>> addUIView(options: ARUIViewOptions): Promise<ARUIView> { return addUIView(options, this.resolveParentNode(options)); } addNode(options: ARAddOptions): Promise<ARGroup> {
<<<<<<< import { getBinPath, getGoRuntimePath } from './goPath'; ======= import { getBinPath, getGoRuntimePath } from './goPath'; import { getCoverage } from './goCover'; if (!getGoRuntimePath()) { vscode.window.showInformationMessage("No 'go' binary could be found on PATH or in GOROOT."); } >>>>>>> import { getBinPath, getGoRuntimePath } from './goPath'; import { getCoverage } from './goCover'; <<<<<<< function runTool(cmd: string, args: string[], cwd: string, severity: string, useStdErr: boolean, notFoundError: string) { return new Promise((resolve, reject) => { cp.execFile(cmd, args, { cwd: cwd }, (err, stdout, stderr) => { ======= export function check(filename: string, buildOnSave = true, lintOnSave = true, vetOnSave = true, coverOnSave = false): Promise<ICheckResult[]> { var gobuild = !buildOnSave ? Promise.resolve([]) : new Promise((resolve, reject) => { var tmppath = path.normalize(path.join(os.tmpdir(), "go-code-check")) var cwd = path.dirname(filename) var args = ["build", "-o", tmppath, "."]; if (filename.match(/_test.go$/i)) { args = ['test', '-copybinary', '-o', tmppath, '-c', '.'] } cp.execFile(getGoRuntimePath(), args, { cwd: cwd }, (err, stdout, stderr) => { >>>>>>> function runTool(cmd: string, args: string[], cwd: string, severity: string, useStdErr: boolean, notFoundError: string) { return new Promise((resolve, reject) => { cp.execFile(cmd, args, { cwd: cwd }, (err, stdout, stderr) => {
<<<<<<< export type LottiePlayer = { ======= export type FilterSizeConfig = { width: string; height: string; x: string; y: string; }; type LottiePlayer = { >>>>>>> export type FilterSizeConfig = { width: string; height: string; x: string; y: string; }; export type LottiePlayer = {
<<<<<<< /** * Bi-directional iterator. * * {@link Iterator Bidirectional iterators} are iterators that can be used to access the sequence of elements * in a range in both directions (towards the end and towards the beginning). * * All {@link IArrayIterator random-access iterators} are also valid {@link Iterrator bidirectional iterators}. * * There is not a single type of {@link Iterator bidirectional iterator}: {@link Container Each container} * may define its own specific iterator type able to iterate through it and access its elements. * * <a href="http://samchon.github.io/tstl/images/class_diagram/abstract_containers.png" target="_blank"> * <img src="http://samchon.github.io/tstl/images/class_diagram/abstract_containers.png" style="max-width: 100%" /></a> * * @reference http://www.cplusplus.com/reference/iterator/BidirectionalIterator * @author Jeongho Nam <http://samchon.org> */ export abstract class Iterator<T> implements IComparable<Iterator<T>> { /** * @hidden */ protected source_: base.Container<T>; /* --------------------------------------------------------- CONSTRUCTORS --------------------------------------------------------- */ /** * Construct from the source {@link Container container}. * * @param source The source container. */ protected constructor(source: base.Container<T>) { this.source_ = source; } /* --------------------------------------------------------- MOVERS --------------------------------------------------------- */ /** * Get iterator to previous element. * * If current iterator is the first item(equal with {@link Container.begin Container.begin()}), * returns {@link Container.end Container.end()}. * * @return An iterator of the previous item. */ public abstract prev(): Iterator<T>; /** * Get iterator to next element. * * If current iterator is the last item, returns {@link Container.end Container.end()}. * * @return An iterator of the next item. */ public abstract next(): Iterator<T>; /** * Advances the {@link Iterator} by <i>n</i> element positions. * * @param n Number of element positions to advance. * @return An advanced iterator. */ public abstract advance(n: number): Iterator<T>; /* --------------------------------------------------------- ACCESSORS --------------------------------------------------------- */ /** * Get source container. * * Get source container of this iterator is directing for. */ public abstract source(): base.Container<T>; /** * Whether an iterator is equal with the iterator. * * Compare two iterators and returns whether they are equal or not. * * #### Note * Iterator's {@link equals equals()} only compare souce container and index number. * * Although elements in a pair, key and value are {@link equal_to equal_to}, if the source map or * index number is different, then the {@link equals equals()} will return false. If you want to * compare the elements of a pair, compare them directly by yourself. * * @param obj An iterator to compare * @return Indicates whether equal or not. */ public abstract equals(obj: Iterator<T>): boolean; /** * Get value of the iterator is pointing. * * @return A value of the iterator. */ public abstract get value(): T; // TS2.0 New Feature public abstract swap(obj: Iterator<T>): void; } } namespace std { /** * This class reverses the direction in which a bidirectional or random-access iterator iterates through a range. * * A copy of the original iterator (the {@link Iterator base iterator}) is kept internally and used to reflect * the operations performed on the {@link ReverseIterator}: whenever the {@link ReverseIterator} is incremented, its * {@link Iterator base iterator} is decreased, and vice versa. A copy of the {@link Iterator base iterator} with the * current state can be obtained at any time by calling member {@link base}. * * Notice however that when an iterator is reversed, the reversed version does not point to the same element in * the range, but to <b>the one preceding it</b>. This is so, in order to arrange for the past-the-end element of a * range: An iterator pointing to a past-the-end element in a range, when reversed, is pointing to the last element * (not past it) of the range (this would be the first element of the reversed range). And if an iterator to the * first element in a range is reversed, the reversed iterator points to the element before the first element (this * would be the past-the-end element of the reversed range). * * <a href="http://samchon.github.io/tstl/images/class_diagram/abstract_containers.png" target="_blank"> * <img src="http://samchon.github.io/tstl/images/class_diagram/abstract_containers.png" style="max-width: 100%" /></a> * * @reference http://www.cplusplus.com/reference/iterator/reverse_iterator * @author Jeongho Nam <http://samchon.org> */ export abstract class ReverseIterator<T, Source extends base.Container<T>, Base extends Iterator<T>, This extends ReverseIterator<T, Source, Base, This>> extends Iterator<T> { /** * @hidden */ protected base_: Base; /* --------------------------------------------------------- CONSTRUCTORS --------------------------------------------------------- */ /** * Construct from base iterator. * * @param base A reference of the base iterator, which iterates in the opposite direction. */ protected constructor(base: Base) { if (base == null) super(null); else { super(base.source()); this.base_ = base.prev() as Base; } } // CREATE A NEW OBJECT WITH SAME (DERIVED) TYPE /** * @hidden */ protected abstract _Create_neighbor(base: Base): This; /* --------------------------------------------------------- ACCESSORS --------------------------------------------------------- */ public source(): Source { return this.source_ as Source; } /** * Return base iterator. * * Return a reference of the base iteraotr. * * The base iterator is an iterator of the same type as the one used to construct the {@link ReverseIterator}, * but pointing to the element next to the one the {@link ReverseIterator} is currently pointing to * (a {@link ReverseIterator} has always an offset of -1 with respect to its base iterator). * * @return A reference of the base iterator, which iterates in the opposite direction. */ public base(): Base { return this.base_.next() as Base; } /** * Get value of the iterator is pointing. * * @return A value of the reverse iterator. */ public get value(): T { return this.base_.value; } /* --------------------------------------------------------- MOVERS --------------------------------------------------------- */ /** * @inheritdoc */ public prev(): This { return this._Create_neighbor(this.base().next() as Base); } /** * @inheritdoc */ public next(): This { return this._Create_neighbor(this.base().prev() as Base); } /** * @inheritdoc */ public advance(n: number): This { return this._Create_neighbor(this.base().advance(-n) as Base); } /* --------------------------------------------------------- COMPARES --------------------------------------------------------- */ /** * @inheritdoc */ public equals(obj: This): boolean { return this.base_.equals(obj.base_); } /** * @inheritdoc */ public swap(obj: This): void { this.base_.swap(obj.base_); } } ======= >>>>>>>
<<<<<<< const exchangeContract = await this._getExchangeContractAsync(); let unavailableAmountInBaseUnits = await exchangeContract.getUnavailableValueT.call(orderHashHex); ======= const exchangeContract = await this.getExchangeContractAsync(); let unavailableAmountInBaseUnits = await exchangeContract.getUnavailableValueT.call(orderHash); >>>>>>> const exchangeContract = await this._getExchangeContractAsync(); let unavailableAmountInBaseUnits = await exchangeContract.getUnavailableValueT.call(orderHash); <<<<<<< const exchangeContract = await this._getExchangeContractAsync(); let fillAmountInBaseUnits = await exchangeContract.filled.call(orderHashHex); ======= const exchangeContract = await this.getExchangeContractAsync(); let fillAmountInBaseUnits = await exchangeContract.filled.call(orderHash); >>>>>>> const exchangeContract = await this._getExchangeContractAsync(); let fillAmountInBaseUnits = await exchangeContract.filled.call(orderHash); <<<<<<< const exchangeContract = await this._getExchangeContractAsync(); let cancelledAmountInBaseUnits = await exchangeContract.cancelled.call(orderHashHex); ======= const exchangeContract = await this.getExchangeContractAsync(); let cancelledAmountInBaseUnits = await exchangeContract.cancelled.call(orderHash); >>>>>>> const exchangeContract = await this._getExchangeContractAsync(); let cancelledAmountInBaseUnits = await exchangeContract.cancelled.call(orderHash);
<<<<<<< import { assetProxyUtils, crypto, orderHashUtils } from '@0xproject/order-utils'; import { AssetProxyId, LogWithDecodedArgs, SignedOrder } from '@0xproject/types'; ======= import { SignedOrder } from '@0xproject/types'; >>>>>>> import { assetProxyUtils, crypto, orderHashUtils } from '@0xproject/order-utils'; import { AssetProxyId, SignedOrder } from '@0xproject/types';
<<<<<<< let missingBaseMinerals = this.getMissingBasicMinerals(reactionQueue, verbose); ======= const missingBaseMinerals = this.getMissingBasicMinerals(reactionQueue); >>>>>>> const missingBaseMinerals = this.getMissingBasicMinerals(reactionQueue); <<<<<<< getMissingBasicMinerals(reactionQueue: Reaction[], verbose = false): { [resourceType: string]: number } { let requiredBasicMinerals = this.getRequiredBasicMinerals(reactionQueue); if (verbose) console.log(`Required basic minerals: ${JSON.stringify(requiredBasicMinerals)}`); if (verbose) console.log(`assets: ${JSON.stringify(this.assets)}`); let missingBasicMinerals: { [resourceType: string]: number } = {}; for (let mineralType in requiredBasicMinerals) { let amountMissing = requiredBasicMinerals[mineralType] - (this.assets[mineralType] || 0); ======= getMissingBasicMinerals(reactionQueue: Reaction[]): { [resourceType: string]: number } { const requiredBasicMinerals = this.getRequiredBasicMinerals(reactionQueue); const missingBasicMinerals: { [resourceType: string]: number } = {}; for (const mineralType in requiredBasicMinerals) { const amountMissing = requiredBasicMinerals[mineralType] - (this.assets[mineralType] || 0); >>>>>>> getMissingBasicMinerals(reactionQueue: Reaction[], verbose = false): { [resourceType: string]: number } { let requiredBasicMinerals = this.getRequiredBasicMinerals(reactionQueue); if (verbose) console.log(`Required basic minerals: ${JSON.stringify(requiredBasicMinerals)}`); if (verbose) console.log(`assets: ${JSON.stringify(this.assets)}`); let missingBasicMinerals: { [resourceType: string]: number } = {}; for (let mineralType in requiredBasicMinerals) { const amountMissing = requiredBasicMinerals[mineralType] - (this.assets[mineralType] || 0);
<<<<<<< import { artifacts as erc1155Artifacts } from '@0x/contracts-erc1155'; import { artifacts as erc20Artifacts } from '@0x/contracts-erc20'; import { artifacts as erc721Artifacts } from '@0x/contracts-erc721'; import { BatchMatchOrder, LogDecoder, orderUtils, Web3ProviderEngine } from '@0x/contracts-test-utils'; import { BatchMatchedFillResults, FillResults, MatchedFillResults, OrderInfo, SignedOrder, SignedZeroExTransaction, } from '@0x/types'; ======= import { FillResults, formatters, OrderInfo, orderUtils, Web3ProviderEngine } from '@0x/contracts-test-utils'; import { SignedOrder, SignedZeroExTransaction } from '@0x/types'; >>>>>>> import { artifacts as erc1155Artifacts } from '@0x/contracts-erc1155'; import { artifacts as erc20Artifacts } from '@0x/contracts-erc20'; import { artifacts as erc721Artifacts } from '@0x/contracts-erc721'; import { BatchMatchOrder, LogDecoder, orderUtils, Web3ProviderEngine } from '@0x/contracts-test-utils'; import { BatchMatchedFillResults, FillResults, MatchedFillResults, OrderInfo, SignedOrder, SignedZeroExTransaction, } from '@0x/types'; <<<<<<< ======= opts: { takerAssetFillAmount: BigNumber }, ): Promise<TransactionReceiptWithDecodedLogs> { const params = formatters.createMarketSellOrders(orders, opts.takerAssetFillAmount); const txReceipt = await this._exchange.marketSellOrders.awaitTransactionSuccessAsync( params.orders, params.takerAssetFillAmount, params.signatures, { from }, ); return txReceipt; } public async marketSellOrdersNoThrowAsync( orders: SignedOrder[], from: string, >>>>>>> <<<<<<< ======= opts: { makerAssetFillAmount: BigNumber }, ): Promise<TransactionReceiptWithDecodedLogs> { const params = formatters.createMarketBuyOrders(orders, opts.makerAssetFillAmount); const txReceipt = await this._exchange.marketBuyOrders.awaitTransactionSuccessAsync( params.orders, params.makerAssetFillAmount, params.signatures, { from }, ); return txReceipt; } public async marketBuyOrdersNoThrowAsync( orders: SignedOrder[], from: string, >>>>>>> <<<<<<< const txHash = await this._exchange.batchCancelOrders.sendTransactionAsync(orders, { from }); const tx = await this._logDecoder.getTxWithDecodedLogsAsync(txHash); return tx; ======= const params = formatters.createBatchCancel(orders); const txReceipt = await this._exchange.batchCancelOrders.awaitTransactionSuccessAsync(params.orders, { from }); return txReceipt; >>>>>>> const txHash = await this._exchange.batchCancelOrders.sendTransactionAsync(orders, { from }); const tx = await this._logDecoder.getTxWithDecodedLogsAsync(txHash); return tx;
<<<<<<< libBytes.publicReadFirst4.callAsync(byteArrayLessThan4Bytes), RevertReasons.LibBytesGreaterOrEqualTo4LengthRequired, ======= libBytes.publicReadBytes4.callAsync(byteArrayLessThan4Bytes, new BigNumber(0)), constants.LIB_BYTES_GREATER_OR_EQUAL_TO_4_LENGTH_REQUIRED, >>>>>>> libBytes.publicReadBytes4.callAsync(byteArrayLessThan4Bytes, new BigNumber(0)), RevertReasons.LibBytesGreaterOrEqualTo4LengthRequired, <<<<<<< libBytes.publicReadBytes.callAsync(byteArrayShorterThan32Bytes, offset), RevertReasons.LibBytesGreaterOrEqualTo32LengthRequired, ======= libBytes.publicReadBytesWithLength.callAsync(byteArrayShorterThan32Bytes, offset), constants.LIB_BYTES_GREATER_OR_EQUAL_TO_32_LENGTH_REQUIRED, >>>>>>> libBytes.publicReadBytesWithLength.callAsync(byteArrayShorterThan32Bytes, offset), RevertReasons.LibBytesGreaterOrEqualTo32LengthRequired, <<<<<<< libBytes.publicReadBytes.callAsync(testBytes32, offset), RevertReasons.LibBytesGreaterOrEqualToNestedBytesLengthRequired, ======= libBytes.publicReadBytesWithLength.callAsync(testBytes32, offset), constants.LIB_BYTES_GREATER_OR_EQUAL_TO_NESTED_BYTES_LENGTH_REQUIRED, >>>>>>> libBytes.publicReadBytesWithLength.callAsync(testBytes32, offset), RevertReasons.LibBytesGreaterOrEqualToNestedBytesLengthRequired, <<<<<<< libBytes.publicReadBytes.callAsync(byteArrayShorterThan32Bytes, badOffset), RevertReasons.LibBytesGreaterOrEqualTo32LengthRequired, ======= libBytes.publicReadBytesWithLength.callAsync(byteArrayShorterThan32Bytes, badOffset), constants.LIB_BYTES_GREATER_OR_EQUAL_TO_32_LENGTH_REQUIRED, >>>>>>> libBytes.publicReadBytesWithLength.callAsync(byteArrayShorterThan32Bytes, badOffset), RevertReasons.LibBytesGreaterOrEqualTo32LengthRequired, <<<<<<< libBytes.publicReadBytes.callAsync(testBytes32, badOffset), RevertReasons.LibBytesGreaterOrEqualTo32LengthRequired, ======= libBytes.publicReadBytesWithLength.callAsync(testBytes32, badOffset), constants.LIB_BYTES_GREATER_OR_EQUAL_TO_32_LENGTH_REQUIRED, >>>>>>> libBytes.publicReadBytesWithLength.callAsync(testBytes32, badOffset), RevertReasons.LibBytesGreaterOrEqualTo32LengthRequired, <<<<<<< libBytes.publicWriteBytes.callAsync(emptyByteArray, offset, longData), RevertReasons.LibBytesGreaterOrEqualToNestedBytesLengthRequired, ======= libBytes.publicWriteBytesWithLength.callAsync(emptyByteArray, offset, longData), constants.LIB_BYTES_GREATER_OR_EQUAL_TO_NESTED_BYTES_LENGTH_REQUIRED, >>>>>>> libBytes.publicWriteBytesWithLength.callAsync(emptyByteArray, offset, longData), RevertReasons.LibBytesGreaterOrEqualToNestedBytesLengthRequired, <<<<<<< libBytes.publicWriteBytes.callAsync(emptyByteArray, badOffset, shortData), RevertReasons.LibBytesGreaterOrEqualToNestedBytesLengthRequired, ======= libBytes.publicWriteBytesWithLength.callAsync(emptyByteArray, badOffset, shortData), constants.LIB_BYTES_GREATER_OR_EQUAL_TO_NESTED_BYTES_LENGTH_REQUIRED, >>>>>>> libBytes.publicWriteBytesWithLength.callAsync(emptyByteArray, badOffset, shortData), RevertReasons.LibBytesGreaterOrEqualToNestedBytesLengthRequired,
<<<<<<< rfqt?: SwapQuoterRfqtOpts; ======= rfqt?: { takerApiKeyWhitelist: string[]; makerAssetOfferings: RfqtMakerAssetOfferings; skipBuyRequests?: boolean; warningLogger?: LogFunction; infoLogger?: LogFunction; }; samplerOverrides?: SamplerOverrides; >>>>>>> rfqt?: SwapQuoterRfqtOpts; samplerOverrides?: SamplerOverrides;
<<<<<<< zeroEx.orderStateWatcher.addOrder(signedOrder); let eventCount = 0; ======= await zeroEx.orderStateWatcher.addOrderAsync(signedOrder); >>>>>>> zeroEx.orderStateWatcher.addOrder(signedOrder);
<<<<<<< PAYMENT_METHOD_DROPDOWN_OPENED = 'Payment Method - Dropdown Opened', PAYMENT_METHOD_OPENED_ETHERSCAN = 'Payment Method - Opened Etherscan', PAYMENT_METHOD_COPIED_ADDRESS = 'Payment Method - Copied Address', ======= BUY_NOT_ENOUGH_ETH = 'Buy - Not Enough Eth', BUY_STARTED = 'Buy - Started', BUY_SIGNATURE_DENIED = 'Buy - Signature Denied', BUY_SIMULATION_FAILED = 'Buy - Simulation Failed', BUY_TX_SUBMITTED = 'Buy - Tx Submitted', BUY_TX_SUCCEEDED = 'Buy - Tx Succeeded', BUY_TX_FAILED = 'Buy - Tx Failed', >>>>>>> PAYMENT_METHOD_DROPDOWN_OPENED = 'Payment Method - Dropdown Opened', PAYMENT_METHOD_OPENED_ETHERSCAN = 'Payment Method - Opened Etherscan', PAYMENT_METHOD_COPIED_ADDRESS = 'Payment Method - Copied Address', BUY_NOT_ENOUGH_ETH = 'Buy - Not Enough Eth', BUY_STARTED = 'Buy - Started', BUY_SIGNATURE_DENIED = 'Buy - Signature Denied', BUY_SIMULATION_FAILED = 'Buy - Simulation Failed', BUY_TX_SUBMITTED = 'Buy - Tx Submitted', BUY_TX_SUCCEEDED = 'Buy - Tx Succeeded', BUY_TX_FAILED = 'Buy - Tx Failed', <<<<<<< trackPaymentMethodDropdownOpened: trackingEventFnWithoutPayload(EventNames.PAYMENT_METHOD_DROPDOWN_OPENED), trackPaymentMethodOpenedEtherscan: trackingEventFnWithoutPayload(EventNames.PAYMENT_METHOD_OPENED_ETHERSCAN), trackPaymentMethodCopiedAddress: trackingEventFnWithoutPayload(EventNames.PAYMENT_METHOD_COPIED_ADDRESS), ======= trackBuyNotEnoughEth: (buyQuote: BuyQuote) => trackingEventFnWithPayload(EventNames.BUY_NOT_ENOUGH_ETH)(buyQuoteEventProperties(buyQuote)), trackBuyStarted: (buyQuote: BuyQuote) => trackingEventFnWithPayload(EventNames.BUY_STARTED)(buyQuoteEventProperties(buyQuote)), trackBuySignatureDenied: (buyQuote: BuyQuote) => trackingEventFnWithPayload(EventNames.BUY_SIGNATURE_DENIED)(buyQuoteEventProperties(buyQuote)), trackBuySimulationFailed: (buyQuote: BuyQuote) => trackingEventFnWithPayload(EventNames.BUY_SIMULATION_FAILED)(buyQuoteEventProperties(buyQuote)), trackBuyTxSubmitted: (buyQuote: BuyQuote, txHash: string, startTimeUnix: number, expectedEndTimeUnix: number) => trackingEventFnWithPayload(EventNames.BUY_TX_SUBMITTED)({ ...buyQuoteEventProperties(buyQuote), txHash, expectedTxTimeMs: expectedEndTimeUnix - startTimeUnix, }), trackBuyTxSucceeded: (buyQuote: BuyQuote, txHash: string, startTimeUnix: number, expectedEndTimeUnix: number) => trackingEventFnWithPayload(EventNames.BUY_TX_SUCCEEDED)({ ...buyQuoteEventProperties(buyQuote), txHash, expectedTxTimeMs: expectedEndTimeUnix - startTimeUnix, actualTxTimeMs: new Date().getTime() - startTimeUnix, }), trackBuyTxFailed: (buyQuote: BuyQuote, txHash: string, startTimeUnix: number, expectedEndTimeUnix: number) => trackingEventFnWithPayload(EventNames.BUY_TX_FAILED)({ ...buyQuoteEventProperties(buyQuote), txHash, expectedTxTimeMs: expectedEndTimeUnix - startTimeUnix, actualTxTimeMs: new Date().getTime() - startTimeUnix, }), >>>>>>> trackPaymentMethodDropdownOpened: trackingEventFnWithoutPayload(EventNames.PAYMENT_METHOD_DROPDOWN_OPENED), trackPaymentMethodOpenedEtherscan: trackingEventFnWithoutPayload(EventNames.PAYMENT_METHOD_OPENED_ETHERSCAN), trackPaymentMethodCopiedAddress: trackingEventFnWithoutPayload(EventNames.PAYMENT_METHOD_COPIED_ADDRESS), trackBuyNotEnoughEth: (buyQuote: BuyQuote) => trackingEventFnWithPayload(EventNames.BUY_NOT_ENOUGH_ETH)(buyQuoteEventProperties(buyQuote)), trackBuyStarted: (buyQuote: BuyQuote) => trackingEventFnWithPayload(EventNames.BUY_STARTED)(buyQuoteEventProperties(buyQuote)), trackBuySignatureDenied: (buyQuote: BuyQuote) => trackingEventFnWithPayload(EventNames.BUY_SIGNATURE_DENIED)(buyQuoteEventProperties(buyQuote)), trackBuySimulationFailed: (buyQuote: BuyQuote) => trackingEventFnWithPayload(EventNames.BUY_SIMULATION_FAILED)(buyQuoteEventProperties(buyQuote)), trackBuyTxSubmitted: (buyQuote: BuyQuote, txHash: string, startTimeUnix: number, expectedEndTimeUnix: number) => trackingEventFnWithPayload(EventNames.BUY_TX_SUBMITTED)({ ...buyQuoteEventProperties(buyQuote), txHash, expectedTxTimeMs: expectedEndTimeUnix - startTimeUnix, }), trackBuyTxSucceeded: (buyQuote: BuyQuote, txHash: string, startTimeUnix: number, expectedEndTimeUnix: number) => trackingEventFnWithPayload(EventNames.BUY_TX_SUCCEEDED)({ ...buyQuoteEventProperties(buyQuote), txHash, expectedTxTimeMs: expectedEndTimeUnix - startTimeUnix, actualTxTimeMs: new Date().getTime() - startTimeUnix, }), trackBuyTxFailed: (buyQuote: BuyQuote, txHash: string, startTimeUnix: number, expectedEndTimeUnix: number) => trackingEventFnWithPayload(EventNames.BUY_TX_FAILED)({ ...buyQuoteEventProperties(buyQuote), txHash, expectedTxTimeMs: expectedEndTimeUnix - startTimeUnix, actualTxTimeMs: new Date().getTime() - startTimeUnix, }),
<<<<<<< [markdownSections.introduction]: IntroMarkdownV1, [markdownSections.installation]: InstallationMarkdownV1, [markdownSections.schemas]: SchemasMarkdownV1, [markdownSections.usage]: UsageMarkdownV1, ======= [docSections.introduction]: IntroMarkdownV1, [docSections.installation]: InstallationMarkdownV1, [docSections.schemas]: SchemasMarkdownV1, [docSections.usage]: UsageMarkdownV1, }, '1.0.0': { [docSections.introduction]: IntroMarkdownV1, [docSections.installation]: InstallationMarkdownV1, [docSections.schemas]: SchemasMarkdownV2, [docSections.usage]: UsageMarkdownV1, }, }, sectionNameToModulePath: { [docSections.schemaValidator]: ['"json-schemas/src/schema_validator"'], }, menuSubsectionToVersionWhenIntroduced: {}, sections: docSections, visibleConstructors: [docSections.schemaValidator], typeConfigs: { // Note: This needs to be kept in sync with the types exported in index.ts. Unfortunately there is // currently no way to extract the re-exported types from index.ts via TypeDoc :( publicTypes: [], typeNameToExternalLink: { Schema: 'https://github.com/tdegrunt/jsonschema/blob/5c2edd4baba149964aec0f23c87ad12c25a50dfb/lib/index.d.ts#L49', >>>>>>> [markdownSections.introduction]: IntroMarkdownV1, [markdownSections.installation]: InstallationMarkdownV1, [markdownSections.schemas]: SchemasMarkdownV1, [markdownSections.usage]: UsageMarkdownV1, }, '1.0.0': { [markdownSections.introduction]: IntroMarkdownV1, [markdownSections.installation]: InstallationMarkdownV1, [markdownSections.schemas]: SchemasMarkdownV2, [markdownSections.usage]: UsageMarkdownV1,
<<<<<<< /** * Decode the ABI-encoded transaction data into its input arguments * @param callData The ABI-encoded transaction data * @returns An array representing the input arguments in order. Keynames of nested structs are preserved. */ getABIDecodedTransactionData( callData: string, ): { makerAddress: string; takerAddress: string; feeRecipientAddress: string; senderAddress: string; makerAssetAmount: BigNumber; takerAssetAmount: BigNumber; makerFee: BigNumber; takerFee: BigNumber; expirationTimeSeconds: BigNumber; salt: BigNumber; makerAssetData: string; takerAssetData: string; } { const self = (this as any) as DutchAuctionContract; const abiEncoder = self._lookupAbiEncoder( 'getAuctionDetails((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes))', ); // tslint:disable boolean-naming const abiDecodedCallData = abiEncoder.strictDecode<{ makerAddress: string; takerAddress: string; feeRecipientAddress: string; senderAddress: string; makerAssetAmount: BigNumber; takerAssetAmount: BigNumber; makerFee: BigNumber; takerFee: BigNumber; expirationTimeSeconds: BigNumber; salt: BigNumber; makerAssetData: string; takerAssetData: string; }>(callData); return abiDecodedCallData; }, /** * Decode the ABI-encoded return data from a transaction * @param returnData the data returned after transaction execution * @returns An array representing the output results in order. Keynames of nested structs are preserved. */ getABIDecodedReturnData( returnData: string, ): { beginTimeSeconds: BigNumber; endTimeSeconds: BigNumber; beginAmount: BigNumber; endAmount: BigNumber; currentAmount: BigNumber; currentTimeSeconds: BigNumber; } { const self = (this as any) as DutchAuctionContract; const abiEncoder = self._lookupAbiEncoder( 'getAuctionDetails((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes))', ); // tslint:disable boolean-naming const abiDecodedReturnData = abiEncoder.strictDecodeReturnValue<{ beginTimeSeconds: BigNumber; endTimeSeconds: BigNumber; beginAmount: BigNumber; endAmount: BigNumber; currentAmount: BigNumber; currentTimeSeconds: BigNumber; }>(returnData); return abiDecodedReturnData; }, /** * Returns the 4 byte function selector as a hex string. */ getSelector(): string { const self = (this as any) as DutchAuctionContract; const abiEncoder = self._lookupAbiEncoder( 'getAuctionDetails((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes))', ); return abiEncoder.getSelector(); }, ======= >>>>>>> /** * Returns the 4 byte function selector as a hex string. */ getSelector(): string { const self = (this as any) as DutchAuctionContract; const abiEncoder = self._lookupAbiEncoder( 'getAuctionDetails((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes))', ); return abiEncoder.getSelector(); }, <<<<<<< /** * Decode the ABI-encoded transaction data into its input arguments * @param callData The ABI-encoded transaction data * @returns An array representing the input arguments in order. Keynames of nested structs are preserved. */ getABIDecodedTransactionData( callData: string, ): { makerAddress: string; takerAddress: string; feeRecipientAddress: string; senderAddress: string; makerAssetAmount: BigNumber; takerAssetAmount: BigNumber; makerFee: BigNumber; takerFee: BigNumber; expirationTimeSeconds: BigNumber; salt: BigNumber; makerAssetData: string; takerAssetData: string; } { const self = (this as any) as DutchAuctionContract; const abiEncoder = self._lookupAbiEncoder( 'matchOrders((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes),(address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes),bytes,bytes)', ); // tslint:disable boolean-naming const abiDecodedCallData = abiEncoder.strictDecode<{ makerAddress: string; takerAddress: string; feeRecipientAddress: string; senderAddress: string; makerAssetAmount: BigNumber; takerAssetAmount: BigNumber; makerFee: BigNumber; takerFee: BigNumber; expirationTimeSeconds: BigNumber; salt: BigNumber; makerAssetData: string; takerAssetData: string; }>(callData); return abiDecodedCallData; }, /** * Decode the ABI-encoded return data from a transaction * @param returnData the data returned after transaction execution * @returns An array representing the output results in order. Keynames of nested structs are preserved. */ getABIDecodedReturnData( returnData: string, ): { left: { makerAssetFilledAmount: BigNumber; takerAssetFilledAmount: BigNumber; makerFeePaid: BigNumber; takerFeePaid: BigNumber; }; right: { makerAssetFilledAmount: BigNumber; takerAssetFilledAmount: BigNumber; makerFeePaid: BigNumber; takerFeePaid: BigNumber; }; leftMakerAssetSpreadAmount: BigNumber; } { const self = (this as any) as DutchAuctionContract; const abiEncoder = self._lookupAbiEncoder( 'matchOrders((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes),(address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes),bytes,bytes)', ); // tslint:disable boolean-naming const abiDecodedReturnData = abiEncoder.strictDecodeReturnValue<{ left: { makerAssetFilledAmount: BigNumber; takerAssetFilledAmount: BigNumber; makerFeePaid: BigNumber; takerFeePaid: BigNumber; }; right: { makerAssetFilledAmount: BigNumber; takerAssetFilledAmount: BigNumber; makerFeePaid: BigNumber; takerFeePaid: BigNumber; }; leftMakerAssetSpreadAmount: BigNumber; }>(returnData); return abiDecodedReturnData; }, /** * Returns the 4 byte function selector as a hex string. */ getSelector(): string { const self = (this as any) as DutchAuctionContract; const abiEncoder = self._lookupAbiEncoder( 'matchOrders((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes),(address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes),bytes,bytes)', ); return abiEncoder.getSelector(); }, ======= >>>>>>> /** * Returns the 4 byte function selector as a hex string. */ getSelector(): string { const self = (this as any) as DutchAuctionContract; const abiEncoder = self._lookupAbiEncoder( 'matchOrders((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes),(address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes),bytes,bytes)', ); return abiEncoder.getSelector(); },
<<<<<<< import {orderFactory} from './utils/order_factory'; import {FillOrderValidationErrs, Token, SignedOrder} from '../src/types'; ======= import {ExchangeContractErrs, SignedOrder, Token} from '../src/types'; >>>>>>> import {orderFactory} from './utils/order_factory'; import {Token, SignedOrder, ExchangeContractErrs} from '../src/types'; <<<<<<< let web3: Web3; let tokens: Token[]; let fillScenarios: FillScenarios; ======= >>>>>>> let zrxTokenAddress: string; let fillScenarios: FillScenarios; <<<<<<< let coinBase: string; ======= let fillScenarios: FillScenarios; let coinbase: string; >>>>>>> let coinbase: string;
<<<<<<< numberOfAssetsAvailable?: number; ======= affiliateInfo?: AffiliateInfo; >>>>>>> numberOfAssetsAvailable?: number; affiliateInfo?: AffiliateInfo; <<<<<<< numberOfAssetsAvailable, ======= affiliateInfo: state.affiliateInfo, >>>>>>> numberOfAssetsAvailable, affiliateInfo: state.affiliateInfo,
<<<<<<< import {signedOrdersSchema} from '../schemas/signed_orders_schema'; ======= import {orderFillRequestsSchema} from '../schemas/order_fill_requests_schema'; import {orderCancellationRequestsSchema} from '../schemas/order_cancel_schema'; >>>>>>> import {signedOrdersSchema} from '../schemas/signed_orders_schema'; import {orderFillRequestsSchema} from '../schemas/order_fill_requests_schema'; import {orderCancellationRequestsSchema} from '../schemas/order_cancel_schema';
<<<<<<< ======= let fillScenarios: FillScenarios; let coinBase: string; let makerAddress: string; >>>>>>> let coinBase: string; let makerAddress: string; <<<<<<< takerAddress = userAddresses[1]; ======= [coinBase, makerAddress, takerAddress] = userAddresses; tokens = await zeroEx.tokenRegistry.getTokensAsync(); >>>>>>> [coinBase, makerAddress, takerAddress] = userAddresses;
<<<<<<< const callback = (logEvent: DecodedLogEvent<LogFillContractEventArgs>) => { ======= const callback = (err: Error, logEvent: LogEvent<LogFillContractEventArgs>) => { >>>>>>> const callback = (err: Error, logEvent: DecodedLogEvent<LogFillContractEventArgs>) => { <<<<<<< const callback = (logEvent: DecodedLogEvent<LogCancelContractEventArgs>) => { ======= const callback = (err: Error, logEvent: LogEvent<LogCancelContractEventArgs>) => { >>>>>>> const callback = (err: Error, logEvent: DecodedLogEvent<LogCancelContractEventArgs>) => { <<<<<<< const callbackNeverToBeCalled = (logEvent: DecodedLogEvent<LogFillContractEventArgs>) => { ======= const callbackNeverToBeCalled = (err: Error, logEvent: LogEvent<LogFillContractEventArgs>) => { >>>>>>> const callbackNeverToBeCalled = (err: Error, logEvent: DecodedLogEvent<LogFillContractEventArgs>) => { <<<<<<< const callback = (logEvent: DecodedLogEvent<LogFillContractEventArgs>) => { ======= const callback = (err: Error, logEvent: LogEvent<LogFillContractEventArgs>) => { >>>>>>> const callback = (err: Error, logEvent: DecodedLogEvent<LogFillContractEventArgs>) => { <<<<<<< const callbackNeverToBeCalled = (logEvent: DecodedLogEvent<LogFillContractEventArgs>) => { ======= const callbackNeverToBeCalled = (err: Error, logEvent: LogEvent<LogFillContractEventArgs>) => { >>>>>>> const callbackNeverToBeCalled = (err: Error, logEvent: DecodedLogEvent<LogFillContractEventArgs>) => {
<<<<<<< Ecosystem = '/ecosystem', ======= Community = '/community', Ecosystem = '/eap', MarketMaker = '/market-maker', >>>>>>> Ecosystem = '/eap',
<<<<<<< } // Combinatorial testing types export enum FeeRecipientAddressScenario { BurnAddress = 'BURN_ADDRESS', EthUserAddress = 'ETH_USER_ADDRESS', } export enum OrderAssetAmountScenario { Zero = 'ZERO', Large = 'LARGE', Small = 'SMALL', } export enum TakerScenario { CorrectlySpecified = 'CORRECTLY_SPECIFIED', IncorrectlySpecified = 'INCORRECTLY_SPECIFIED', Unspecified = 'UNSPECIFIED', } export enum ExpirationTimeSecondsScenario { InPast = 'IN_PAST', InFuture = 'IN_FUTURE', } export enum AssetDataScenario { ERC721 = 'ERC721', ZRXFeeToken = 'ZRX_FEE_TOKEN', ERC20FiveDecimals = 'ERC20_FIVE_DECIMALS', ERC20NonZRXEighteenDecimals = 'ERC20_NON_ZRX_EIGHTEEN_DECIMALS', } export enum TakerAssetFillAmountScenario { Zero = 'ZERO', GreaterThanRemainingFillableTakerAssetAmount = 'GREATER_THAN_REMAINING_FILLABLE_TAKER_ASSET_AMOUNT', LessThanRemainingFillableTakerAssetAmount = 'LESS_THAN_REMAINING_FILLABLE_TAKER_ASSET_AMOUNT', ExactlyRemainingFillableTakerAssetAmount = 'EXACTLY_REMAINING_FILLABLE_TAKER_ASSET_AMOUNT', } export interface OrderScenario { takerScenario: TakerScenario; feeRecipientScenario: FeeRecipientAddressScenario; makerAssetAmountScenario: OrderAssetAmountScenario; takerAssetAmountScenario: OrderAssetAmountScenario; makerFeeScenario: OrderAssetAmountScenario; takerFeeScenario: OrderAssetAmountScenario; expirationTimeSecondsScenario: ExpirationTimeSecondsScenario; makerAssetDataScenario: AssetDataScenario; takerAssetDataScenario: AssetDataScenario; } export enum BalanceAmountScenario { Exact = 'EXACT', TooLow = 'TOO_LOW', Higher = 'HIGHER', } export enum AllowanceAmountScenario { Exact = 'EXACT', TooLow = 'TOO_LOW', Higher = 'HIGHER', Unlimited = 'UNLIMITED', } export interface TraderStateScenario { traderAssetBalance: BalanceAmountScenario; traderAssetAllowance: AllowanceAmountScenario; zrxFeeBalance: BalanceAmountScenario; zrxFeeAllowance: AllowanceAmountScenario; } export interface FillScenario { orderScenario: OrderScenario; takerAssetFillAmountScenario: TakerAssetFillAmountScenario; makerStateScenario: TraderStateScenario; takerStateScenario: TraderStateScenario; ======= } export enum RevertReasons { OrderUnfillable = 'ORDER_UNFILLABLE', InvalidMaker = 'INVALID_MAKER', InvalidTaker = 'INVALID_TAKER', InvalidSender = 'INVALID_SENDER', InvalidOrderSignature = 'INVALID_ORDER_SIGNATURE', InvalidTakerAmount = 'INVALID_TAKER_AMOUNT', RoundingError = 'ROUNDING_ERROR', InvalidSignature = 'INVALID_SIGNATURE', SignatureIllegal = 'SIGNATURE_ILLEGAL', SignatureUnsupported = 'SIGNATURE_UNSUPPORTED', InvalidNewOrderEpoch = 'INVALID_NEW_ORDER_EPOCH', CompleteFillFailed = 'COMPLETE_FILL_FAILED', NegativeSpreadRequired = 'NEGATIVE_SPREAD_REQUIRED', ReentrancyIllegal = 'REENTRANCY_ILLEGAL', InvalidTxHash = 'INVALID_TX_HASH', InvalidTxSignature = 'INVALID_TX_SIGNATURE', FailedExecution = 'FAILED_EXECUTION', AssetProxyMismatch = 'ASSET_PROXY_MISMATCH', AssetProxyIdMismatch = 'ASSET_PROXY_ID_MISMATCH', LengthGreaterThan0Required = 'LENGTH_GREATER_THAN_0_REQUIRED', Length0Required = 'LENGTH_0_REQUIRED', Length65Required = 'LENGTH_65_REQUIRED', InvalidAmount = 'INVALID_AMOUNT', TransferFailed = 'TRANSFER_FAILED', SenderNotAuthorized = 'SENDER_NOT_AUTHORIZED', TargetNotAuthorized = 'TARGET_NOT_AUTHORIZED', TargetAlreadyAuthorized = 'TARGET_ALREADY_AUTHORIZED', IndexOutOfBounds = 'INDEX_OUT_OF_BOUNDS', AuthorizedAddressMismatch = 'AUTHORIZED_ADDRESS_MISMATCH', OnlyContractOwner = 'ONLY_CONTRACT_OWNER', MakerNotWhitelisted = 'MAKER_NOT_WHITELISTED', TakerNotWhitelisted = 'TAKER_NOT_WHITELISTED', AssetProxyDoesNotExist = 'ASSET_PROXY_DOES_NOT_EXIST', LibBytesGreaterThanZeroLengthRequired = 'GREATER_THAN_ZERO_LENGTH_REQUIRED', LibBytesGreaterOrEqualTo4LengthRequired = 'GREATER_OR_EQUAL_TO_4_LENGTH_REQUIRED', LibBytesGreaterOrEqualTo20LengthRequired = 'GREATER_OR_EQUAL_TO_20_LENGTH_REQUIRED', LibBytesGreaterOrEqualTo32LengthRequired = 'GREATER_OR_EQUAL_TO_32_LENGTH_REQUIRED', LibBytesGreaterOrEqualToNestedBytesLengthRequired = 'GREATER_OR_EQUAL_TO_NESTED_BYTES_LENGTH_REQUIRED', LibBytesGreaterOrEqualToSourceBytesLengthRequired = 'GREATER_OR_EQUAL_TO_SOURCE_BYTES_LENGTH_REQUIRED', Erc20InsufficientBalance = 'ERC20_INSUFFICIENT_BALANCE', Erc20InsufficientAllowance = 'ERC20_INSUFFICIENT_ALLOWANCE', >>>>>>> } // Combinatorial testing types export enum FeeRecipientAddressScenario { BurnAddress = 'BURN_ADDRESS', EthUserAddress = 'ETH_USER_ADDRESS', } export enum OrderAssetAmountScenario { Zero = 'ZERO', Large = 'LARGE', Small = 'SMALL', } export enum TakerScenario { CorrectlySpecified = 'CORRECTLY_SPECIFIED', IncorrectlySpecified = 'INCORRECTLY_SPECIFIED', Unspecified = 'UNSPECIFIED', } export enum ExpirationTimeSecondsScenario { InPast = 'IN_PAST', InFuture = 'IN_FUTURE', } export enum AssetDataScenario { ERC721 = 'ERC721', ZRXFeeToken = 'ZRX_FEE_TOKEN', ERC20FiveDecimals = 'ERC20_FIVE_DECIMALS', ERC20NonZRXEighteenDecimals = 'ERC20_NON_ZRX_EIGHTEEN_DECIMALS', } export enum TakerAssetFillAmountScenario { Zero = 'ZERO', GreaterThanRemainingFillableTakerAssetAmount = 'GREATER_THAN_REMAINING_FILLABLE_TAKER_ASSET_AMOUNT', LessThanRemainingFillableTakerAssetAmount = 'LESS_THAN_REMAINING_FILLABLE_TAKER_ASSET_AMOUNT', ExactlyRemainingFillableTakerAssetAmount = 'EXACTLY_REMAINING_FILLABLE_TAKER_ASSET_AMOUNT', } export interface OrderScenario { takerScenario: TakerScenario; feeRecipientScenario: FeeRecipientAddressScenario; makerAssetAmountScenario: OrderAssetAmountScenario; takerAssetAmountScenario: OrderAssetAmountScenario; makerFeeScenario: OrderAssetAmountScenario; takerFeeScenario: OrderAssetAmountScenario; expirationTimeSecondsScenario: ExpirationTimeSecondsScenario; makerAssetDataScenario: AssetDataScenario; takerAssetDataScenario: AssetDataScenario; } export enum BalanceAmountScenario { Exact = 'EXACT', TooLow = 'TOO_LOW', Higher = 'HIGHER', } export enum AllowanceAmountScenario { Exact = 'EXACT', TooLow = 'TOO_LOW', Higher = 'HIGHER', Unlimited = 'UNLIMITED', } export interface TraderStateScenario { traderAssetBalance: BalanceAmountScenario; traderAssetAllowance: AllowanceAmountScenario; zrxFeeBalance: BalanceAmountScenario; zrxFeeAllowance: AllowanceAmountScenario; } export interface FillScenario { orderScenario: OrderScenario; takerAssetFillAmountScenario: TakerAssetFillAmountScenario; makerStateScenario: TraderStateScenario; takerStateScenario: TraderStateScenario; } export enum RevertReasons { OrderUnfillable = 'ORDER_UNFILLABLE', InvalidMaker = 'INVALID_MAKER', InvalidTaker = 'INVALID_TAKER', InvalidSender = 'INVALID_SENDER', InvalidOrderSignature = 'INVALID_ORDER_SIGNATURE', InvalidTakerAmount = 'INVALID_TAKER_AMOUNT', RoundingError = 'ROUNDING_ERROR', InvalidSignature = 'INVALID_SIGNATURE', SignatureIllegal = 'SIGNATURE_ILLEGAL', SignatureUnsupported = 'SIGNATURE_UNSUPPORTED', InvalidNewOrderEpoch = 'INVALID_NEW_ORDER_EPOCH', CompleteFillFailed = 'COMPLETE_FILL_FAILED', NegativeSpreadRequired = 'NEGATIVE_SPREAD_REQUIRED', ReentrancyIllegal = 'REENTRANCY_ILLEGAL', InvalidTxHash = 'INVALID_TX_HASH', InvalidTxSignature = 'INVALID_TX_SIGNATURE', FailedExecution = 'FAILED_EXECUTION', AssetProxyMismatch = 'ASSET_PROXY_MISMATCH', AssetProxyIdMismatch = 'ASSET_PROXY_ID_MISMATCH', LengthGreaterThan0Required = 'LENGTH_GREATER_THAN_0_REQUIRED', Length0Required = 'LENGTH_0_REQUIRED', Length65Required = 'LENGTH_65_REQUIRED', InvalidAmount = 'INVALID_AMOUNT', TransferFailed = 'TRANSFER_FAILED', SenderNotAuthorized = 'SENDER_NOT_AUTHORIZED', TargetNotAuthorized = 'TARGET_NOT_AUTHORIZED', TargetAlreadyAuthorized = 'TARGET_ALREADY_AUTHORIZED', IndexOutOfBounds = 'INDEX_OUT_OF_BOUNDS', AuthorizedAddressMismatch = 'AUTHORIZED_ADDRESS_MISMATCH', OnlyContractOwner = 'ONLY_CONTRACT_OWNER', MakerNotWhitelisted = 'MAKER_NOT_WHITELISTED', TakerNotWhitelisted = 'TAKER_NOT_WHITELISTED', AssetProxyDoesNotExist = 'ASSET_PROXY_DOES_NOT_EXIST', LibBytesGreaterThanZeroLengthRequired = 'GREATER_THAN_ZERO_LENGTH_REQUIRED', LibBytesGreaterOrEqualTo4LengthRequired = 'GREATER_OR_EQUAL_TO_4_LENGTH_REQUIRED', LibBytesGreaterOrEqualTo20LengthRequired = 'GREATER_OR_EQUAL_TO_20_LENGTH_REQUIRED', LibBytesGreaterOrEqualTo32LengthRequired = 'GREATER_OR_EQUAL_TO_32_LENGTH_REQUIRED', LibBytesGreaterOrEqualToNestedBytesLengthRequired = 'GREATER_OR_EQUAL_TO_NESTED_BYTES_LENGTH_REQUIRED', LibBytesGreaterOrEqualToSourceBytesLengthRequired = 'GREATER_OR_EQUAL_TO_SOURCE_BYTES_LENGTH_REQUIRED', Erc20InsufficientBalance = 'ERC20_INSUFFICIENT_BALANCE', Erc20InsufficientAllowance = 'ERC20_INSUFFICIENT_ALLOWANCE',
<<<<<<< import {constants} from '../src/utils/constants'; import {web3Factory} from './utils/web3_factory'; ======= import {constants} from './utils/constants'; >>>>>>> import {constants} from './utils/constants'; import {web3Factory} from './utils/web3_factory';
<<<<<<< import { assetProxyUtils, crypto } from '@0xproject/order-utils'; import { AssetProxyId, LogWithDecodedArgs, SignedOrder } from '@0xproject/types'; ======= import { SignedOrder } from '@0xproject/types'; >>>>>>> import { assetProxyUtils, crypto } from '@0xproject/order-utils'; import { AssetProxyId, SignedOrder } from '@0xproject/types';
<<<<<<< export const HOST_DOMAINS = [ '0x-instant-staging.s3-website-us-east-1.amazonaws.com', '0x-instant-dogfood.s3-website-us-east-1.amazonaws.com', 'localhost', '127.0.0.1', '0.0.0.0', 'unpkg.com', 'jsdelivr.com', ]; export const ROLLBAR_CLIENT_TOKEN = process.env.ROLLBAR_CLIENT_TOKEN; export const INSTANT_ENVIRONMENT = process.env.INSTANT_ENVIRONMENT as | 'dogfood' | 'staging' | 'development' | 'production' | undefined; export const ROLLBAR_ENABLED = process.env.ROLLBAR_ENABLED; ======= export const INSTANT_DISCHARGE_TARGET = process.env.INSTANT_DISCHARGE_TARGET as | 'production' | 'dogfood' | 'staging' | undefined; >>>>>>> export const HOST_DOMAINS = [ '0x-instant-staging.s3-website-us-east-1.amazonaws.com', '0x-instant-dogfood.s3-website-us-east-1.amazonaws.com', 'localhost', '127.0.0.1', '0.0.0.0', 'unpkg.com', 'jsdelivr.com', ]; export const ROLLBAR_CLIENT_TOKEN = process.env.ROLLBAR_CLIENT_TOKEN; export const ROLLBAR_ENABLED = process.env.ROLLBAR_ENABLED; export const INSTANT_DISCHARGE_TARGET = process.env.INSTANT_DISCHARGE_TARGET as | 'production' | 'dogfood' | 'staging' | undefined;
<<<<<<< export type SolidityTypes = keyof typeof SolidityTypes; export enum ExchangeContractErrs { ERROR_FILL_EXPIRED, // Order has already expired ERROR_FILL_NO_VALUE, // Order has already been fully filled or cancelled ERROR_FILL_TRUNCATION, // Rounding error too large ERROR_FILL_BALANCE_ALLOWANCE, // Insufficient balance or allowance for token transfer ERROR_CANCEL_EXPIRED, // Order has already expired ERROR_CANCEL_NO_VALUE, // Order has already been fully filled or cancelled }; export interface ContractResponse { logs: ContractEvent[]; } export interface ContractEvent { event: string; args: any; } export interface Order { maker: string; taker?: string; makerFee: BigNumber.BigNumber; takerFee: BigNumber.BigNumber; makerTokenAmount: BigNumber.BigNumber; takerTokenAmount: BigNumber.BigNumber; makerTokenAddress: string; takerTokenAddress: string; salt: BigNumber.BigNumber; feeRecipient: string; expirationUnixTimestampSec: BigNumber.BigNumber; } export interface SignedOrder extends Order { ecSignature: ECSignature; } ======= export type SolidityTypes = keyof typeof SolidityTypes; // [address, name, symbol, projectUrl, decimals, ipfsHash, swarmHash] export type TokenMetadata = [string, string, string, string, BigNumber.BigNumber, string, string]; export interface Token { name: string; address: string; symbol: string; decimals: number; url: string; }; >>>>>>> export type SolidityTypes = keyof typeof SolidityTypes; export enum ExchangeContractErrs { ERROR_FILL_EXPIRED, // Order has already expired ERROR_FILL_NO_VALUE, // Order has already been fully filled or cancelled ERROR_FILL_TRUNCATION, // Rounding error too large ERROR_FILL_BALANCE_ALLOWANCE, // Insufficient balance or allowance for token transfer ERROR_CANCEL_EXPIRED, // Order has already expired ERROR_CANCEL_NO_VALUE, // Order has already been fully filled or cancelled }; export interface ContractResponse { logs: ContractEvent[]; } export interface ContractEvent { event: string; args: any; } export interface Order { maker: string; taker?: string; makerFee: BigNumber.BigNumber; takerFee: BigNumber.BigNumber; makerTokenAmount: BigNumber.BigNumber; takerTokenAmount: BigNumber.BigNumber; makerTokenAddress: string; takerTokenAddress: string; salt: BigNumber.BigNumber; feeRecipient: string; expirationUnixTimestampSec: BigNumber.BigNumber; } export interface SignedOrder extends Order { ecSignature: ECSignature; } // [address, name, symbol, projectUrl, decimals, ipfsHash, swarmHash] export type TokenMetadata = [string, string, string, string, BigNumber.BigNumber, string, string]; export interface Token { name: string; address: string; symbol: string; decimals: number; url: string; }
<<<<<<< import { OrderState } from '@0xproject/types'; import { BlockParamLiteral, LogEntryEvent } from 'ethereum-types'; ======= import { LogEntryEvent, OrderState } from '@0xproject/types'; >>>>>>> import { OrderState } from '@0xproject/types'; import { LogEntryEvent } from 'ethereum-types'; <<<<<<< * isVerbose: Weather the order watcher should be verbose. Default=true. ======= >>>>>>> * isVerbose: Weather the order watcher should be verbose. Default=true. <<<<<<< stateLayer: BlockParamLiteral; orderExpirationCheckingIntervalMs: number; eventPollingIntervalMs: number; expirationMarginMs: number; cleanupJobIntervalMs: number; isVerbose: boolean; ======= orderExpirationCheckingIntervalMs?: number; eventPollingIntervalMs?: number; expirationMarginMs?: number; cleanupJobIntervalMs?: number; isVerbose?: boolean; >>>>>>> orderExpirationCheckingIntervalMs: number; eventPollingIntervalMs: number; expirationMarginMs: number; cleanupJobIntervalMs: number; isVerbose: boolean;
<<<<<<< transformElement?: (taroElement: TaroElement, element: Element) => TaroElement }, reconciler: (reconciler: Reconciler<any>) => void ======= transformElement?: (taroElement: TaroElement, element: Element) => TaroElement, renderHTMLTag: boolean } >>>>>>> transformElement?: (taroElement: TaroElement, element: Element) => TaroElement renderHTMLTag: boolean }, reconciler: (reconciler: Reconciler<any>) => void <<<<<<< ]) }, reconciler<T> (reconciler: Reconciler<T>) { Object.assign(CurrentReconciler, reconciler) ======= ]), renderHTMLTag: false >>>>>>> ]), renderHTMLTag: false }, reconciler<T> (reconciler: Reconciler<T>) { Object.assign(CurrentReconciler, reconciler)
<<<<<<< private exchangeContractErrToMsg = { [ExchangeContractErrs.ERROR_FILL_EXPIRED]: 'The order you attempted to fill is expired', [ExchangeContractErrs.ERROR_CANCEL_EXPIRED]: 'The order you attempted to cancel is expired', [ExchangeContractErrs.ERROR_FILL_NO_VALUE]: 'This order has already been filled or cancelled', [ExchangeContractErrs.ERROR_CANCEL_NO_VALUE]: 'This order has already been filled or cancelled', [ExchangeContractErrs.ERROR_FILL_TRUNCATION]: 'The rounding error was too large when filling this order', [ExchangeContractErrs.ERROR_FILL_BALANCE_ALLOWANCE]: 'Maker or taker has insufficient balance or allowance', }; ======= private exchangeContractIfExists?: ExchangeContract; >>>>>>> private exchangeContractErrToMsg = { [ExchangeContractErrs.ERROR_FILL_EXPIRED]: 'The order you attempted to fill is expired', [ExchangeContractErrs.ERROR_CANCEL_EXPIRED]: 'The order you attempted to cancel is expired', [ExchangeContractErrs.ERROR_FILL_NO_VALUE]: 'This order has already been filled or cancelled', [ExchangeContractErrs.ERROR_CANCEL_NO_VALUE]: 'This order has already been filled or cancelled', [ExchangeContractErrs.ERROR_FILL_TRUNCATION]: 'The rounding error was too large when filling this order', [ExchangeContractErrs.ERROR_FILL_BALANCE_ALLOWANCE]: 'Maker or taker has insufficient balance or allowance', }; private exchangeContractIfExists?: ExchangeContract; <<<<<<< const senderAddress = await this.web3Wrapper.getSenderAddressOrThrowAsync(); const exchangeInstance = await this.getExchangeInstanceOrThrowAsync(); ======= const senderAddressIfExists = await this.web3Wrapper.getSenderAddressIfExistsAsync(); assert.assert(!_.isUndefined(senderAddressIfExists), ZeroExError.USER_HAS_NO_ASSOCIATED_ADDRESSES); const exchangeContract = await this.getExchangeContractAsync(); >>>>>>> const senderAddress = await this.web3Wrapper.getSenderAddressOrThrowAsync(); const exchangeInstance = await this.getExchangeContractAsync(); <<<<<<< public async fillOrderAsync(signedOrder: SignedOrder, fillAmount: BigNumber.BigNumber, shouldCheckTransfer: boolean = true): Promise<ContractResponse> { assert.doesConformToSchema('signedOrder', JSON.parse(JSON.stringify(signedOrder)), signedOrderSchema); assert.isBoolean('shouldCheckTransfer', shouldCheckTransfer); const senderAddress = await this.web3Wrapper.getSenderAddressOrThrowAsync(); const exchangeInstance = await this.getExchangeInstanceOrThrowAsync(); const taker = _.isUndefined(signedOrder.taker) ? constants.NULL_ADDRESS : signedOrder.taker; const orderAddresses: OrderAddresses = [ signedOrder.maker, taker, signedOrder.makerTokenAddress, signedOrder.takerTokenAddress, signedOrder.feeRecipient, ]; const orderValues: OrderValues = [ signedOrder.makerTokenAmount, signedOrder.takerTokenAmount, signedOrder.makerFee, signedOrder.takerFee, signedOrder.expirationUnixTimestampSec, signedOrder.salt, ]; const response: ContractResponse = await exchangeInstance.fill( orderAddresses, orderValues, fillAmount, shouldCheckTransfer, signedOrder.ecSignature.v, signedOrder.ecSignature.r, signedOrder.ecSignature.s, { from: senderAddress, }, ); this.throwErrorLogsAsErrors(response.logs); return response; } private async getExchangeInstanceOrThrowAsync(): Promise<ExchangeContract> { const contractInstance = await this.instantiateContractIfExistsAsync((ExchangeArtifacts as any)); return contractInstance as ExchangeContract; } private throwErrorLogsAsErrors(logs: ContractEvent[]): void { const errEvent = _.find(logs, {event: 'LogError'}); if (!_.isUndefined(errEvent)) { const errCode = errEvent.args.errorId.toNumber(); const humanReadableErrMessage = this.exchangeContractErrToMsg[errCode]; throw new Error(humanReadableErrMessage); } } ======= private async getExchangeContractAsync(): Promise<ExchangeContract> { if (!_.isUndefined(this.exchangeContractIfExists)) { return this.exchangeContractIfExists; } const contractInstance = await this.instantiateContractIfExistsAsync((ExchangeArtifacts as any)); this.exchangeContractIfExists = contractInstance as ExchangeContract; return this.exchangeContractIfExists; } >>>>>>> public async fillOrderAsync(signedOrder: SignedOrder, fillAmount: BigNumber.BigNumber, shouldCheckTransfer: boolean = true): Promise<ContractResponse> { assert.doesConformToSchema('signedOrder', JSON.parse(JSON.stringify(signedOrder)), signedOrderSchema); assert.isBoolean('shouldCheckTransfer', shouldCheckTransfer); const senderAddress = await this.web3Wrapper.getSenderAddressOrThrowAsync(); const exchangeInstance = await this.getExchangeInstanceOrThrowAsync(); const taker = _.isUndefined(signedOrder.taker) ? constants.NULL_ADDRESS : signedOrder.taker; const orderAddresses: OrderAddresses = [ signedOrder.maker, taker, signedOrder.makerTokenAddress, signedOrder.takerTokenAddress, signedOrder.feeRecipient, ]; const orderValues: OrderValues = [ signedOrder.makerTokenAmount, signedOrder.takerTokenAmount, signedOrder.makerFee, signedOrder.takerFee, signedOrder.expirationUnixTimestampSec, signedOrder.salt, ]; const response: ContractResponse = await exchangeInstance.fill( orderAddresses, orderValues, fillAmount, shouldCheckTransfer, signedOrder.ecSignature.v, signedOrder.ecSignature.r, signedOrder.ecSignature.s, { from: senderAddress, }, ); this.throwErrorLogsAsErrors(response.logs); return response; } private async getExchangeInstanceOrThrowAsync(): Promise<ExchangeContract> { const contractInstance = await this.instantiateContractIfExistsAsync((ExchangeArtifacts as any)); return contractInstance as ExchangeContract; } private throwErrorLogsAsErrors(logs: ContractEvent[]): void { const errEvent = _.find(logs, {event: 'LogError'}); if (!_.isUndefined(errEvent)) { const errCode = errEvent.args.errorId.toNumber(); const humanReadableErrMessage = this.exchangeContractErrToMsg[errCode]; throw new Error(humanReadableErrMessage); } } private async getExchangeContractAsync(): Promise<ExchangeContract> { if (!_.isUndefined(this.exchangeContractIfExists)) { return this.exchangeContractIfExists; } const contractInstance = await this.instantiateContractIfExistsAsync((ExchangeArtifacts as any)); this.exchangeContractIfExists = contractInstance as ExchangeContract; return this.exchangeContractIfExists; }
<<<<<<< SignedOrder, SubscriptionOpts, ValidateOrderFillableOpts, ZeroExError, ======= EventCallback, ExchangeContractEventArgs, DecodedLogArgs, BlockParamLiteral, >>>>>>> EventCallback, ExchangeContractEventArgs, DecodedLogArgs, BlockParamLiteral, <<<<<<< const zrxTokenAddress = this.getZRXTokenAddress(); const exchangeTradeEmulator = new ExchangeTransferSimulator(this._tokenWrapper); ======= const zrxTokenAddress = await this.getZRXTokenAddressAsync(); const exchangeTradeEmulator = new ExchangeTransferSimulator(this._tokenWrapper, BlockParamLiteral.Latest); >>>>>>> const zrxTokenAddress = this.getZRXTokenAddress(); const exchangeTradeEmulator = new ExchangeTransferSimulator(this._tokenWrapper, BlockParamLiteral.Latest); <<<<<<< const zrxTokenAddress = this.getZRXTokenAddress(); const exchangeTradeEmulator = new ExchangeTransferSimulator(this._tokenWrapper); ======= const zrxTokenAddress = await this.getZRXTokenAddressAsync(); const exchangeTradeEmulator = new ExchangeTransferSimulator(this._tokenWrapper, BlockParamLiteral.Latest); >>>>>>> const zrxTokenAddress = this.getZRXTokenAddress(); const exchangeTradeEmulator = new ExchangeTransferSimulator(this._tokenWrapper, BlockParamLiteral.Latest); <<<<<<< const zrxTokenAddress = this.getZRXTokenAddress(); const exchangeTradeEmulator = new ExchangeTransferSimulator(this._tokenWrapper); ======= const zrxTokenAddress = await this.getZRXTokenAddressAsync(); const exchangeTradeEmulator = new ExchangeTransferSimulator(this._tokenWrapper, BlockParamLiteral.Latest); >>>>>>> const zrxTokenAddress = this.getZRXTokenAddress(); const exchangeTradeEmulator = new ExchangeTransferSimulator(this._tokenWrapper, BlockParamLiteral.Latest); <<<<<<< const zrxTokenAddress = this.getZRXTokenAddress(); const exchangeTradeEmulator = new ExchangeTransferSimulator(this._tokenWrapper); ======= const zrxTokenAddress = await this.getZRXTokenAddressAsync(); const exchangeTradeEmulator = new ExchangeTransferSimulator(this._tokenWrapper, BlockParamLiteral.Latest); >>>>>>> const zrxTokenAddress = this.getZRXTokenAddress(); const exchangeTradeEmulator = new ExchangeTransferSimulator(this._tokenWrapper, BlockParamLiteral.Latest); <<<<<<< const zrxTokenAddress = this.getZRXTokenAddress(); const exchangeTradeEmulator = new ExchangeTransferSimulator(this._tokenWrapper); ======= const zrxTokenAddress = await this.getZRXTokenAddressAsync(); const exchangeTradeEmulator = new ExchangeTransferSimulator(this._tokenWrapper, BlockParamLiteral.Latest); >>>>>>> const zrxTokenAddress = this.getZRXTokenAddress(); const exchangeTradeEmulator = new ExchangeTransferSimulator(this._tokenWrapper, BlockParamLiteral.Latest); <<<<<<< const zrxTokenAddress = this.getZRXTokenAddress(); const exchangeTradeEmulator = new ExchangeTransferSimulator(this._tokenWrapper); ======= const zrxTokenAddress = await this.getZRXTokenAddressAsync(); const exchangeTradeEmulator = new ExchangeTransferSimulator(this._tokenWrapper, BlockParamLiteral.Latest); >>>>>>> const zrxTokenAddress = this.getZRXTokenAddress(); const exchangeTradeEmulator = new ExchangeTransferSimulator(this._tokenWrapper, BlockParamLiteral.Latest); <<<<<<< const zrxTokenAddress = this.getZRXTokenAddress(); const exchangeTradeEmulator = new ExchangeTransferSimulator(this._tokenWrapper); ======= const zrxTokenAddress = await this.getZRXTokenAddressAsync(); const exchangeTradeEmulator = new ExchangeTransferSimulator(this._tokenWrapper, BlockParamLiteral.Latest); >>>>>>> const zrxTokenAddress = this.getZRXTokenAddress(); const exchangeTradeEmulator = new ExchangeTransferSimulator(this._tokenWrapper, BlockParamLiteral.Latest);
<<<<<<< SwapQuoteConsumerError, SwapQuoterRfqtOpts, SignedOrderWithFillableAmounts, SwapQuoteOrdersBreakdown, ExchangeProxyContractOpts, ======= >>>>>>> <<<<<<< import { ERC20BridgeSource } from './utils/market_operation_utils/types'; ======= export { affiliateFeeUtils } from './utils/affiliate_fee_utils'; >>>>>>> import { ERC20BridgeSource } from './utils/market_operation_utils/types'; export { affiliateFeeUtils } from './utils/affiliate_fee_utils';
<<<<<<< quoteState: AsyncProcessState; buyOrderState: AsyncProcessState; ======= quoteRequestState: AsyncProcessState; >>>>>>> quoteRequestState: AsyncProcessState; buyOrderState: AsyncProcessState; <<<<<<< quoteState: state.quoteState, buyOrderState: state.buyOrderState, ======= quoteRequestState: state.quoteRequestState, >>>>>>> quoteRequestState: state.quoteRequestState, buyOrderState: state.buyOrderState,
<<<<<<< UPDATE_SELECTED_ASSET = 'UPDATE_SELECTED_ASSET', ======= UPDATE_BUY_QUOTE_STATE_PENDING = 'UPDATE_BUY_QUOTE_STATE_PENDING', UPDATE_BUY_QUOTE_STATE_FAILURE = 'UPDATE_BUY_QUOTE_STATE_FAILURE', SET_ERROR = 'SET_ERROR', HIDE_ERROR = 'HIDE_ERROR', CLEAR_ERROR = 'CLEAR_ERROR', >>>>>>> UPDATE_SELECTED_ASSET = 'UPDATE_SELECTED_ASSET', UPDATE_BUY_QUOTE_STATE_PENDING = 'UPDATE_BUY_QUOTE_STATE_PENDING', UPDATE_BUY_QUOTE_STATE_FAILURE = 'UPDATE_BUY_QUOTE_STATE_FAILURE', SET_ERROR = 'SET_ERROR', HIDE_ERROR = 'HIDE_ERROR', CLEAR_ERROR = 'CLEAR_ERROR', <<<<<<< updateSelectedAsset: (assetData?: string) => createAction(ActionTypes.UPDATE_SELECTED_ASSET, assetData), ======= updateBuyQuoteStatePending: () => createAction(ActionTypes.UPDATE_BUY_QUOTE_STATE_PENDING), updateBuyQuoteStateFailure: () => createAction(ActionTypes.UPDATE_BUY_QUOTE_STATE_FAILURE), setError: (error?: any) => createAction(ActionTypes.SET_ERROR, error), hideError: () => createAction(ActionTypes.HIDE_ERROR), clearError: () => createAction(ActionTypes.CLEAR_ERROR), >>>>>>> updateSelectedAsset: (assetData?: string) => createAction(ActionTypes.UPDATE_SELECTED_ASSET, assetData), updateBuyQuoteStatePending: () => createAction(ActionTypes.UPDATE_BUY_QUOTE_STATE_PENDING), updateBuyQuoteStateFailure: () => createAction(ActionTypes.UPDATE_BUY_QUOTE_STATE_FAILURE), setError: (error?: any) => createAction(ActionTypes.SET_ERROR, error), hideError: () => createAction(ActionTypes.HIDE_ERROR), clearError: () => createAction(ActionTypes.CLEAR_ERROR),
<<<<<<< errorFlasher.flashNewErrorMessage(dispatch, errorMessage || 'Error fetching price, please try again'); ======= analytics.trackQuoteError(error.message ? error.message : 'other', baseUnitValue, fetchOrigin); let errorMessage; if (error.message === AssetBuyerError.InsufficientAssetLiquidity) { const assetName = assetUtils.bestNameForAsset(asset, 'of this asset'); errorMessage = `Not enough ${assetName} available`; } else if (error.message === AssetBuyerError.InsufficientZrxLiquidity) { errorMessage = 'Not enough ZRX available'; } else if ( error.message === AssetBuyerError.StandardRelayerApiError || error.message.startsWith(AssetBuyerError.AssetUnavailable) ) { const assetName = assetUtils.bestNameForAsset(asset, 'This asset'); errorMessage = `${assetName} is currently unavailable`; } if (!_.isUndefined(errorMessage)) { errorFlasher.flashNewErrorMessage(dispatch, errorMessage); } else { throw error; } >>>>>>> analytics.trackQuoteError(error.message ? error.message : 'other', baseUnitValue, fetchOrigin); errorFlasher.flashNewErrorMessage(dispatch, errorMessage || 'Error fetching price, please try again');
<<<<<<< import { ReligionStrength } from './createReligiosity' import { ProfessionNames, ProfessionSector, ProfessionType } from './professions' ======= import { LifestyleStandardName } from './lifestyleStandards' >>>>>>> import { ReligionStrength } from './createReligiosity' import { ProfessionNames, ProfessionSector, ProfessionType } from './professions' import { LifestyleStandardName } from './lifestyleStandards' <<<<<<< /** How religious they are */ religiosity: number ======= /** The number used to determine their religious fervor. */ religiosity: number socialClass: number >>>>>>> /** The number used to determine their religious fervor. */ religiosity: number socialClass: number
<<<<<<< import { signatureUtils } from './signature_utils'; import { MessagePrefixType } from './types'; ======= import { ecSignOrderHashAsync } from './signature_utils'; import { CreateOrderOpts } from './types'; >>>>>>> import { signatureUtils } from './signature_utils'; import { CreateOrderOpts } from './types'; <<<<<<< const messagePrefixOpts = { prefixType: MessagePrefixType.EthSign, shouldAddPrefixBeforeCallingEthSign: false, }; const ecSignature = await signatureUtils.ecSignOrderHashAsync( provider, orderHash, makerAddress, messagePrefixOpts, ); const signature = getVRSHexString(ecSignature); ======= const signature = await ecSignOrderHashAsync(provider, orderHash, makerAddress, SignerType.Default); >>>>>>> const signature = await signatureUtils.ecSignOrderHashAsync( provider, orderHash, makerAddress, SignerType.Default, );
<<<<<<< import { BuyQuote } from '@0x/asset-buyer'; import * as _ from 'lodash'; import { AffiliateInfo, Network, OrderSource, ProviderState } from '../types'; ======= import { AffiliateInfo, Asset, Network, OrderSource, ProviderState } from '../types'; >>>>>>> import { BuyQuote } from '@0x/asset-buyer'; import * as _ from 'lodash'; import { AffiliateInfo, Asset, Network, OrderSource, ProviderState } from '../types'; <<<<<<< BUY_NOT_ENOUGH_ETH = 'Buy - Not Enough Eth', BUY_STARTED = 'Buy - Started', BUY_SIGNATURE_DENIED = 'Buy - Signature Denied', BUY_SIMULATION_FAILED = 'Buy - Simulation Failed', BUY_TX_SUBMITTED = 'Buy - Tx Submitted', BUY_TX_SUCCEEDED = 'Buy - Tx Succeeded', BUY_TX_FAILED = 'Buy - Tx Failed', ======= TOKEN_SELECTOR_OPENED = 'Token Selector - Opened', TOKEN_SELECTOR_CLOSED = 'Token Selector - Closed', TOKEN_SELECTOR_CHOSE = 'Token Selector - Chose', TOKEN_SELECTOR_SEARCHED = 'Token Selector - Searched', >>>>>>> BUY_NOT_ENOUGH_ETH = 'Buy - Not Enough Eth', BUY_STARTED = 'Buy - Started', BUY_SIGNATURE_DENIED = 'Buy - Signature Denied', BUY_SIMULATION_FAILED = 'Buy - Simulation Failed', BUY_TX_SUBMITTED = 'Buy - Tx Submitted', BUY_TX_SUCCEEDED = 'Buy - Tx Succeeded', BUY_TX_FAILED = 'Buy - Tx Failed', TOKEN_SELECTOR_OPENED = 'Token Selector - Opened', TOKEN_SELECTOR_CLOSED = 'Token Selector - Closed', TOKEN_SELECTOR_CHOSE = 'Token Selector - Chose', TOKEN_SELECTOR_SEARCHED = 'Token Selector - Searched', <<<<<<< trackBuyNotEnoughEth: (buyQuote: BuyQuote) => trackingEventFnWithPayload(EventNames.BUY_NOT_ENOUGH_ETH)(buyQuoteEventProperties(buyQuote)), trackBuyStarted: (buyQuote: BuyQuote) => trackingEventFnWithPayload(EventNames.BUY_STARTED)(buyQuoteEventProperties(buyQuote)), trackBuySignatureDenied: (buyQuote: BuyQuote) => trackingEventFnWithPayload(EventNames.BUY_SIGNATURE_DENIED)(buyQuoteEventProperties(buyQuote)), trackBuySimulationFailed: (buyQuote: BuyQuote) => trackingEventFnWithPayload(EventNames.BUY_SIMULATION_FAILED)(buyQuoteEventProperties(buyQuote)), trackBuyTxSubmitted: (buyQuote: BuyQuote, txHash: string, startTimeUnix: number, expectedEndTimeUnix: number) => trackingEventFnWithPayload(EventNames.BUY_TX_SUBMITTED)({ ...buyQuoteEventProperties(buyQuote), txHash, expectedTxTimeMs: expectedEndTimeUnix - startTimeUnix, }), trackBuyTxSucceeded: (buyQuote: BuyQuote, txHash: string, startTimeUnix: number, expectedEndTimeUnix: number) => trackingEventFnWithPayload(EventNames.BUY_TX_SUCCEEDED)({ ...buyQuoteEventProperties(buyQuote), txHash, expectedTxTimeMs: expectedEndTimeUnix - startTimeUnix, actualTxTimeMs: new Date().getTime() - startTimeUnix, }), trackBuyTxFailed: (buyQuote: BuyQuote, txHash: string, startTimeUnix: number, expectedEndTimeUnix: number) => trackingEventFnWithPayload(EventNames.BUY_TX_FAILED)({ ...buyQuoteEventProperties(buyQuote), txHash, expectedTxTimeMs: expectedEndTimeUnix - startTimeUnix, actualTxTimeMs: new Date().getTime() - startTimeUnix, }), ======= trackTokenSelectorOpened: trackingEventFnWithoutPayload(EventNames.TOKEN_SELECTOR_OPENED), trackTokenSelectorClosed: (closedVia: TokenSelectorClosedVia) => trackingEventFnWithPayload(EventNames.TOKEN_SELECTOR_CLOSED)({ closedVia }), trackTokenSelectorChose: (payload: { assetName: string; assetData: string }) => trackingEventFnWithPayload(EventNames.TOKEN_SELECTOR_CHOSE)(payload), trackTokenSelectorSearched: (searchText: string) => trackingEventFnWithPayload(EventNames.TOKEN_SELECTOR_SEARCHED)({ searchText }), >>>>>>> trackBuyNotEnoughEth: (buyQuote: BuyQuote) => trackingEventFnWithPayload(EventNames.BUY_NOT_ENOUGH_ETH)(buyQuoteEventProperties(buyQuote)), trackBuyStarted: (buyQuote: BuyQuote) => trackingEventFnWithPayload(EventNames.BUY_STARTED)(buyQuoteEventProperties(buyQuote)), trackBuySignatureDenied: (buyQuote: BuyQuote) => trackingEventFnWithPayload(EventNames.BUY_SIGNATURE_DENIED)(buyQuoteEventProperties(buyQuote)), trackBuySimulationFailed: (buyQuote: BuyQuote) => trackingEventFnWithPayload(EventNames.BUY_SIMULATION_FAILED)(buyQuoteEventProperties(buyQuote)), trackBuyTxSubmitted: (buyQuote: BuyQuote, txHash: string, startTimeUnix: number, expectedEndTimeUnix: number) => trackingEventFnWithPayload(EventNames.BUY_TX_SUBMITTED)({ ...buyQuoteEventProperties(buyQuote), txHash, expectedTxTimeMs: expectedEndTimeUnix - startTimeUnix, }), trackBuyTxSucceeded: (buyQuote: BuyQuote, txHash: string, startTimeUnix: number, expectedEndTimeUnix: number) => trackingEventFnWithPayload(EventNames.BUY_TX_SUCCEEDED)({ ...buyQuoteEventProperties(buyQuote), txHash, expectedTxTimeMs: expectedEndTimeUnix - startTimeUnix, actualTxTimeMs: new Date().getTime() - startTimeUnix, }), trackBuyTxFailed: (buyQuote: BuyQuote, txHash: string, startTimeUnix: number, expectedEndTimeUnix: number) => trackingEventFnWithPayload(EventNames.BUY_TX_FAILED)({ ...buyQuoteEventProperties(buyQuote), txHash, expectedTxTimeMs: expectedEndTimeUnix - startTimeUnix, actualTxTimeMs: new Date().getTime() - startTimeUnix, }), trackTokenSelectorOpened: trackingEventFnWithoutPayload(EventNames.TOKEN_SELECTOR_OPENED), trackTokenSelectorClosed: (closedVia: TokenSelectorClosedVia) => trackingEventFnWithPayload(EventNames.TOKEN_SELECTOR_CLOSED)({ closedVia }), trackTokenSelectorChose: (payload: { assetName: string; assetData: string }) => trackingEventFnWithPayload(EventNames.TOKEN_SELECTOR_CHOSE)(payload), trackTokenSelectorSearched: (searchText: string) => trackingEventFnWithPayload(EventNames.TOKEN_SELECTOR_SEARCHED)({ searchText }),
<<<<<<< /** * Decode the ABI-encoded transaction data into its input arguments * @param callData The ABI-encoded transaction data * @returns An array representing the input arguments in order. Keynames of nested structs are preserved. */ getABIDecodedTransactionData(callData: string): [string, string, string, BigNumber] { const self = (this as any) as IAssetProxyContract; const abiEncoder = self._lookupAbiEncoder('transferFrom(bytes,address,address,uint256)'); // tslint:disable boolean-naming const abiDecodedCallData = abiEncoder.strictDecode<[string, string, string, BigNumber]>(callData); return abiDecodedCallData; }, /** * Decode the ABI-encoded return data from a transaction * @param returnData the data returned after transaction execution * @returns An array representing the output results in order. Keynames of nested structs are preserved. */ getABIDecodedReturnData(returnData: string): void { const self = (this as any) as IAssetProxyContract; const abiEncoder = self._lookupAbiEncoder('transferFrom(bytes,address,address,uint256)'); // tslint:disable boolean-naming const abiDecodedReturnData = abiEncoder.strictDecodeReturnValue<void>(returnData); return abiDecodedReturnData; }, /** * Returns the 4 byte function selector as a hex string. */ getSelector(): string { const self = (this as any) as IAssetProxyContract; const abiEncoder = self._lookupAbiEncoder('transferFrom(bytes,address,address,uint256)'); return abiEncoder.getSelector(); }, ======= >>>>>>> /** * Returns the 4 byte function selector as a hex string. */ getSelector(): string { const self = (this as any) as IAssetProxyContract; const abiEncoder = self._lookupAbiEncoder('transferFrom(bytes,address,address,uint256)'); return abiEncoder.getSelector(); }, <<<<<<< /** * Returns the ABI encoded transaction data needed to send an Ethereum transaction calling this method. Before * sending the Ethereum tx, this encoded tx data can first be sent to a separate signing service or can be used * to create a 0x transaction (see protocol spec for more details). * @returns The ABI encoded transaction data as a string */ getABIEncodedTransactionData(): string { const self = (this as any) as IAssetProxyContract; const abiEncodedTransactionData = self._strictEncodeArguments('getProxyId()', []); return abiEncodedTransactionData; }, /** * Decode the ABI-encoded transaction data into its input arguments * @param callData The ABI-encoded transaction data * @returns An array representing the input arguments in order. Keynames of nested structs are preserved. */ getABIDecodedTransactionData(callData: string): void { const self = (this as any) as IAssetProxyContract; const abiEncoder = self._lookupAbiEncoder('getProxyId()'); // tslint:disable boolean-naming const abiDecodedCallData = abiEncoder.strictDecode<void>(callData); return abiDecodedCallData; }, /** * Decode the ABI-encoded return data from a transaction * @param returnData the data returned after transaction execution * @returns An array representing the output results in order. Keynames of nested structs are preserved. */ getABIDecodedReturnData(returnData: string): string { const self = (this as any) as IAssetProxyContract; const abiEncoder = self._lookupAbiEncoder('getProxyId()'); // tslint:disable boolean-naming const abiDecodedReturnData = abiEncoder.strictDecodeReturnValue<string>(returnData); return abiDecodedReturnData; }, /** * Returns the 4 byte function selector as a hex string. */ getSelector(): string { const self = (this as any) as IAssetProxyContract; const abiEncoder = self._lookupAbiEncoder('getProxyId()'); return abiEncoder.getSelector(); }, ======= >>>>>>>
<<<<<<< import * as _ from 'lodash'; ======= import 'make-promises-safe'; import * as Web3 from 'web3'; >>>>>>> import 'make-promises-safe';
<<<<<<< * Encode data for multiple assets, per the AssetProxy contract specification. */ public encodeMultiAssetData = { /** * Sends a read-only call to the contract method. Returns the result that would happen if one were to send an * Ethereum transaction to this method, given the current state of the blockchain. Calls do not cost gas * since they don't modify state. * @param amounts The amounts of each asset to be traded. * @param nestedAssetData AssetProxy-compliant data describing each asset to be * traded. * @returns AssetProxy-compliant data describing the set of assets. */ async callAsync( amounts: BigNumber[], nestedAssetData: string[], callData: Partial<CallData> = {}, defaultBlock?: BlockParam, ): Promise<string> { assert.isArray('amounts', amounts); assert.isArray('nestedAssetData', nestedAssetData); assert.doesConformToSchema('callData', callData, schemas.callDataSchema, [ schemas.addressSchema, schemas.numberSchema, schemas.jsNumber, ]); if (defaultBlock !== undefined) { assert.isBlockParam('defaultBlock', defaultBlock); } const self = (this as any) as DevUtilsContract; const encodedData = self._strictEncodeArguments('encodeMultiAssetData(uint256[],bytes[])', [ amounts, nestedAssetData, ]); const encodedDataBytes = Buffer.from(encodedData.substr(2), 'hex'); let rawCallResult; try { rawCallResult = await self.evmExecAsync(encodedDataBytes); } catch (err) { BaseContract._throwIfThrownErrorIsRevertError(err); throw err; } BaseContract._throwIfCallResultIsRevertError(rawCallResult); const abiEncoder = self._lookupAbiEncoder('encodeMultiAssetData(uint256[],bytes[])'); // tslint:disable boolean-naming const result = abiEncoder.strictDecodeReturnValue<string>(rawCallResult); // tslint:enable boolean-naming return result; }, /** * Returns the ABI encoded transaction data needed to send an Ethereum transaction calling this method. Before * sending the Ethereum tx, this encoded tx data can first be sent to a separate signing service or can be used * to create a 0x transaction (see protocol spec for more details). * @param amounts The amounts of each asset to be traded. * @param nestedAssetData AssetProxy-compliant data describing each asset to be * traded. * @returns The ABI encoded transaction data as a string */ getABIEncodedTransactionData(amounts: BigNumber[], nestedAssetData: string[]): string { assert.isArray('amounts', amounts); assert.isArray('nestedAssetData', nestedAssetData); const self = (this as any) as DevUtilsContract; const abiEncodedTransactionData = self._strictEncodeArguments('encodeMultiAssetData(uint256[],bytes[])', [ amounts, nestedAssetData, ]); return abiEncodedTransactionData; }, /** * Decode the ABI-encoded transaction data into its input arguments * @param callData The ABI-encoded transaction data * @returns An array representing the input arguments in order. Keynames of nested structs are preserved. */ getABIDecodedTransactionData(callData: string): BigNumber[] { const self = (this as any) as DevUtilsContract; const abiEncoder = self._lookupAbiEncoder('encodeMultiAssetData(uint256[],bytes[])'); // tslint:disable boolean-naming const abiDecodedCallData = abiEncoder.strictDecode<BigNumber[]>(callData); return abiDecodedCallData; }, /** * Decode the ABI-encoded return data from a transaction * @param returnData the data returned after transaction execution * @returns An array representing the output results in order. Keynames of nested structs are preserved. */ getABIDecodedReturnData(returnData: string): string { const self = (this as any) as DevUtilsContract; const abiEncoder = self._lookupAbiEncoder('encodeMultiAssetData(uint256[],bytes[])'); // tslint:disable boolean-naming const abiDecodedReturnData = abiEncoder.strictDecodeReturnValue<string>(returnData); return abiDecodedReturnData; }, /** * Returns the 4 byte function selector as a hex string. */ getSelector(): string { const self = (this as any) as DevUtilsContract; const abiEncoder = self._lookupAbiEncoder('encodeMultiAssetData(uint256[],bytes[])'); return abiEncoder.getSelector(); }, }; /** * Fetches all order-relevant information needed to validate if the supplied orders are fillable. ======= * Simulates all of the transfers for each given order and returns the indices of each first failed transfer. >>>>>>> * Simulates all of the transfers for each given order and returns the indices of each first failed transfer. <<<<<<< string[] ] { const self = (this as any) as DevUtilsContract; const abiEncoder = self._lookupAbiEncoder( 'getOrderRelevantStates((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes,bytes,bytes)[],bytes[])', ); // tslint:disable boolean-naming const abiDecodedCallData = abiEncoder.strictDecode< [ Array<{ makerAddress: string; takerAddress: string; feeRecipientAddress: string; senderAddress: string; makerAssetAmount: BigNumber; takerAssetAmount: BigNumber; makerFee: BigNumber; takerFee: BigNumber; expirationTimeSeconds: BigNumber; salt: BigNumber; makerAssetData: string; takerAssetData: string; makerFeeAssetData: string; takerFeeAssetData: string; }>, string[] ] >(callData); return abiDecodedCallData; }, /** * Decode the ABI-encoded return data from a transaction * @param returnData the data returned after transaction execution * @returns An array representing the output results in order. Keynames of nested structs are preserved. */ getABIDecodedReturnData( returnData: string, ): [ Array<{ orderStatus: number; orderHash: string; orderTakerAssetFilledAmount: BigNumber }>, BigNumber[], boolean[] ] { const self = (this as any) as DevUtilsContract; const abiEncoder = self._lookupAbiEncoder( 'getOrderRelevantStates((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes,bytes,bytes)[],bytes[])', ); // tslint:disable boolean-naming const abiDecodedReturnData = abiEncoder.strictDecodeReturnValue< [ Array<{ orderStatus: number; orderHash: string; orderTakerAssetFilledAmount: BigNumber }>, BigNumber[], boolean[] ] >(returnData); return abiDecodedReturnData; }, /** * Returns the 4 byte function selector as a hex string. */ getSelector(): string { const self = (this as any) as DevUtilsContract; const abiEncoder = self._lookupAbiEncoder( 'getOrderRelevantStates((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes,bytes,bytes)[],bytes[])', ); return abiEncoder.getSelector(); }, }; /** * Calls getBatchBalances() and getBatchAllowances() for each element of assetData. */ public getBatchBalancesAndAssetProxyAllowances = { /** * Sends a read-only call to the contract method. Returns the result that would happen if one were to send an * Ethereum transaction to this method, given the current state of the blockchain. Calls do not cost gas * since they don't modify state. * @param ownerAddress Owner of the assets specified by assetData. * @param assetData Array of asset details, each encoded per the AssetProxy * contract specification. * @returns An array of asset balances from getBalance(), and an array of asset allowances from getAllowance(), with each element corresponding to the same-indexed element in the assetData input. */ async callAsync( ownerAddress: string, assetData: string[], callData: Partial<CallData> = {}, defaultBlock?: BlockParam, ): Promise<[BigNumber[], BigNumber[]]> { assert.isString('ownerAddress', ownerAddress); assert.isArray('assetData', assetData); assert.doesConformToSchema('callData', callData, schemas.callDataSchema, [ schemas.addressSchema, schemas.numberSchema, schemas.jsNumber, ]); if (defaultBlock !== undefined) { assert.isBlockParam('defaultBlock', defaultBlock); } ======= takerAddresses: string[], takerAssetFillAmounts: BigNumber[], txData?: Partial<TxData> | undefined, ): Promise<number> { assert.isArray('orders', orders); assert.isArray('takerAddresses', takerAddresses); assert.isArray('takerAssetFillAmounts', takerAssetFillAmounts); >>>>>>> takerAddresses: string[], takerAssetFillAmounts: BigNumber[], txData?: Partial<TxData> | undefined, ): Promise<number> { assert.isArray('orders', orders); assert.isArray('takerAddresses', takerAddresses); assert.isArray('takerAssetFillAmounts', takerAssetFillAmounts); <<<<<<< /** * Returns the 4 byte function selector as a hex string. */ getSelector(): string { const self = (this as any) as DevUtilsContract; const abiEncoder = self._lookupAbiEncoder('getBatchBalancesAndAssetProxyAllowances(address,bytes[])'); return abiEncoder.getSelector(); }, }; /** * Fetches all order-relevant information needed to validate if the supplied order is fillable. */ public getOrderRelevantState = { ======= >>>>>>>
<<<<<<< feeOrder = orderFactory.newSignedOrder({ makerAssetData: assetDataUtils.encodeERC20AssetData(zrxToken.address), ======= feeOrder = await orderFactory.newSignedOrderAsync({ makerAssetData: assetProxyUtils.encodeERC20AssetData(zrxToken.address), >>>>>>> feeOrder = await orderFactory.newSignedOrderAsync({ makerAssetData: assetDataUtils.encodeERC20AssetData(zrxToken.address), <<<<<<< orderWithFee = orderFactory.newSignedOrder({ makerAssetData: assetDataUtils.encodeERC20AssetData(zrxToken.address), ======= orderWithFee = await orderFactory.newSignedOrderAsync({ makerAssetData: assetProxyUtils.encodeERC20AssetData(zrxToken.address), >>>>>>> orderWithFee = await orderFactory.newSignedOrderAsync({ makerAssetData: assetDataUtils.encodeERC20AssetData(zrxToken.address), <<<<<<< signedOrder = orderFactory.newSignedOrder({ makerAssetData: assetDataUtils.encodeERC20AssetData(zrxToken.address), ======= signedOrder = await orderFactory.newSignedOrderAsync({ makerAssetData: assetProxyUtils.encodeERC20AssetData(zrxToken.address), >>>>>>> signedOrder = await orderFactory.newSignedOrderAsync({ makerAssetData: assetDataUtils.encodeERC20AssetData(zrxToken.address), <<<<<<< feeOrder = orderFactory.newSignedOrder({ makerAssetData: assetDataUtils.encodeERC20AssetData(zrxToken.address), ======= feeOrder = await orderFactory.newSignedOrderAsync({ makerAssetData: assetProxyUtils.encodeERC20AssetData(zrxToken.address), >>>>>>> feeOrder = await orderFactory.newSignedOrderAsync({ makerAssetData: assetDataUtils.encodeERC20AssetData(zrxToken.address), <<<<<<< signedOrder = orderFactory.newSignedOrder({ makerAssetData: assetDataUtils.encodeERC20AssetData(zrxToken.address), ======= signedOrder = await orderFactory.newSignedOrderAsync({ makerAssetData: assetProxyUtils.encodeERC20AssetData(zrxToken.address), >>>>>>> signedOrder = await orderFactory.newSignedOrderAsync({ makerAssetData: assetDataUtils.encodeERC20AssetData(zrxToken.address), <<<<<<< const highFeeZRXOrder = orderFactory.newSignedOrder({ makerAssetData: assetDataUtils.encodeERC20AssetData(zrxToken.address), ======= const highFeeZRXOrder = await orderFactory.newSignedOrderAsync({ makerAssetData: assetProxyUtils.encodeERC20AssetData(zrxToken.address), >>>>>>> const highFeeZRXOrder = await orderFactory.newSignedOrderAsync({ makerAssetData: assetDataUtils.encodeERC20AssetData(zrxToken.address),
<<<<<<< const zeroExEvent = await zeroEx.exchange.subscribeAsync(ExchangeEvents.LogFill, subscriptionOpts, indexFilterValues); ======= const subscriptionOpts: SubscriptionOpts = { fromBlock: 0, toBlock: 'latest', }; const zeroExEvent = await zeroEx.exchange.subscribeAsync( ExchangeEvents.LogFill, subscriptionOpts, indexFilterValues, exchangeContractAddress, ); >>>>>>> const zeroExEvent = await zeroEx.exchange.subscribeAsync( ExchangeEvents.LogFill, subscriptionOpts, indexFilterValues, exchangeContractAddress, ); <<<<<<< const zeroExEvent = await zeroEx.exchange.subscribeAsync(ExchangeEvents.LogCancel, subscriptionOpts, indexFilterValues); ======= const subscriptionOpts: SubscriptionOpts = { fromBlock: 0, toBlock: 'latest', }; const zeroExEvent = await zeroEx.exchange.subscribeAsync( ExchangeEvents.LogCancel, subscriptionOpts, indexFilterValues, exchangeContractAddress, ); >>>>>>> const zeroExEvent = await zeroEx.exchange.subscribeAsync( ExchangeEvents.LogCancel, subscriptionOpts, indexFilterValues, exchangeContractAddress, );
<<<<<<< private readonly _methodIds: { [signatureHash: string]: EventAbi } = {}; /** * Instantiate an AbiDecoder * @param abiArrays An array of contract ABI's * @return AbiDecoder instance */ ======= private readonly _methodIds: { [signatureHash: string]: { [numIndexedArgs: number]: EventAbi } } = {}; >>>>>>> private readonly _methodIds: { [signatureHash: string]: { [numIndexedArgs: number]: EventAbi } } = {}; /** * Instantiate an AbiDecoder * @param abiArrays An array of contract ABI's * @return AbiDecoder instance */
<<<<<<< private static throwValidationError(failureReason: FailureReason, tradeSide: TradeSide, transferType: TransferType): never { const errMsg = ERR_MSG_MAPPING[failureReason][tradeSide][transferType]; throw new Error(errMsg); } constructor(token: TokenWrapper) { this.store = new BalanceAndProxyAllowanceLazyStore(token); ======= constructor(token: TokenWrapper, defaultBlock: BlockParamLiteral) { this.store = new BalanceAndProxyAllowanceLazyStore(token, defaultBlock); >>>>>>> private static throwValidationError(failureReason: FailureReason, tradeSide: TradeSide, transferType: TransferType): never { const errMsg = ERR_MSG_MAPPING[failureReason][tradeSide][transferType]; throw new Error(errMsg); } constructor(token: TokenWrapper, defaultBlock: BlockParamLiteral) { this.store = new BalanceAndProxyAllowanceLazyStore(token, defaultBlock);
<<<<<<< const prevProxyAddress = constants.NULL_ADDRESS; await assetProxyDispatcher.registerAssetProxy.sendTransactionAsync( AssetProxyId.ERC20, erc20Proxy.address, prevProxyAddress, { from: owner }, ======= const prevProxyAddress = ZeroEx.NULL_ADDRESS; await web3Wrapper.awaitTransactionMinedAsync( await assetProxyDispatcher.registerAssetProxy.sendTransactionAsync( AssetProxyId.ERC20, erc20Proxy.address, prevProxyAddress, { from: owner }, ), constants.AWAIT_TRANSACTION_MINED_MS, >>>>>>> const prevProxyAddress = constants.NULL_ADDRESS; await web3Wrapper.awaitTransactionMinedAsync( await assetProxyDispatcher.registerAssetProxy.sendTransactionAsync( AssetProxyId.ERC20, erc20Proxy.address, prevProxyAddress, { from: owner }, ), constants.AWAIT_TRANSACTION_MINED_MS, <<<<<<< const prevERC20ProxyAddress = constants.NULL_ADDRESS; await assetProxyDispatcher.registerAssetProxy.sendTransactionAsync( AssetProxyId.ERC20, erc20Proxy.address, prevERC20ProxyAddress, { from: owner }, ======= const prevERC20ProxyAddress = ZeroEx.NULL_ADDRESS; await web3Wrapper.awaitTransactionMinedAsync( await assetProxyDispatcher.registerAssetProxy.sendTransactionAsync( AssetProxyId.ERC20, erc20Proxy.address, prevERC20ProxyAddress, { from: owner }, ), constants.AWAIT_TRANSACTION_MINED_MS, >>>>>>> const prevERC20ProxyAddress = constants.NULL_ADDRESS; await web3Wrapper.awaitTransactionMinedAsync( await assetProxyDispatcher.registerAssetProxy.sendTransactionAsync( AssetProxyId.ERC20, erc20Proxy.address, prevERC20ProxyAddress, { from: owner }, ), constants.AWAIT_TRANSACTION_MINED_MS, <<<<<<< const prevERC721ProxyAddress = constants.NULL_ADDRESS; await assetProxyDispatcher.registerAssetProxy.sendTransactionAsync( AssetProxyId.ERC721, erc721Proxy.address, prevERC721ProxyAddress, { from: owner }, ======= const prevERC721ProxyAddress = ZeroEx.NULL_ADDRESS; await web3Wrapper.awaitTransactionMinedAsync( await assetProxyDispatcher.registerAssetProxy.sendTransactionAsync( AssetProxyId.ERC721, erc721Proxy.address, prevERC721ProxyAddress, { from: owner }, ), constants.AWAIT_TRANSACTION_MINED_MS, >>>>>>> const prevERC721ProxyAddress = constants.NULL_ADDRESS; await web3Wrapper.awaitTransactionMinedAsync( await assetProxyDispatcher.registerAssetProxy.sendTransactionAsync( AssetProxyId.ERC721, erc721Proxy.address, prevERC721ProxyAddress, { from: owner }, ), constants.AWAIT_TRANSACTION_MINED_MS, <<<<<<< const prevProxyAddress = constants.NULL_ADDRESS; await assetProxyDispatcher.registerAssetProxy.sendTransactionAsync( AssetProxyId.ERC20, erc20Proxy.address, prevProxyAddress, { from: owner }, ======= const prevProxyAddress = ZeroEx.NULL_ADDRESS; await web3Wrapper.awaitTransactionMinedAsync( await assetProxyDispatcher.registerAssetProxy.sendTransactionAsync( AssetProxyId.ERC20, erc20Proxy.address, prevProxyAddress, { from: owner }, ), constants.AWAIT_TRANSACTION_MINED_MS, >>>>>>> const prevProxyAddress = constants.NULL_ADDRESS; await web3Wrapper.awaitTransactionMinedAsync( await assetProxyDispatcher.registerAssetProxy.sendTransactionAsync( AssetProxyId.ERC20, erc20Proxy.address, prevProxyAddress, { from: owner }, ), constants.AWAIT_TRANSACTION_MINED_MS, <<<<<<< const prevProxyAddress = constants.NULL_ADDRESS; await assetProxyDispatcher.registerAssetProxy.sendTransactionAsync( AssetProxyId.ERC20, erc20Proxy.address, prevProxyAddress, { from: owner }, ======= const prevProxyAddress = ZeroEx.NULL_ADDRESS; await web3Wrapper.awaitTransactionMinedAsync( await assetProxyDispatcher.registerAssetProxy.sendTransactionAsync( AssetProxyId.ERC20, erc20Proxy.address, prevProxyAddress, { from: owner }, ), constants.AWAIT_TRANSACTION_MINED_MS, >>>>>>> const prevProxyAddress = constants.NULL_ADDRESS; await web3Wrapper.awaitTransactionMinedAsync( await assetProxyDispatcher.registerAssetProxy.sendTransactionAsync( AssetProxyId.ERC20, erc20Proxy.address, prevProxyAddress, { from: owner }, ), constants.AWAIT_TRANSACTION_MINED_MS, <<<<<<< const prevProxyAddress = constants.NULL_ADDRESS; await assetProxyDispatcher.registerAssetProxy.sendTransactionAsync( AssetProxyId.ERC20, erc20Proxy.address, prevProxyAddress, { from: owner }, ======= const prevProxyAddress = ZeroEx.NULL_ADDRESS; await web3Wrapper.awaitTransactionMinedAsync( await assetProxyDispatcher.registerAssetProxy.sendTransactionAsync( AssetProxyId.ERC20, erc20Proxy.address, prevProxyAddress, { from: owner }, ), constants.AWAIT_TRANSACTION_MINED_MS, >>>>>>> const prevProxyAddress = constants.NULL_ADDRESS; await web3Wrapper.awaitTransactionMinedAsync( await assetProxyDispatcher.registerAssetProxy.sendTransactionAsync( AssetProxyId.ERC20, erc20Proxy.address, prevProxyAddress, { from: owner }, ), constants.AWAIT_TRANSACTION_MINED_MS, <<<<<<< const newProxyAddress = constants.NULL_ADDRESS; await assetProxyDispatcher.registerAssetProxy.sendTransactionAsync( AssetProxyId.ERC20, newProxyAddress, erc20Proxy.address, { from: owner }, ======= const newProxyAddress = ZeroEx.NULL_ADDRESS; await web3Wrapper.awaitTransactionMinedAsync( await assetProxyDispatcher.registerAssetProxy.sendTransactionAsync( AssetProxyId.ERC20, newProxyAddress, erc20Proxy.address, { from: owner }, ), constants.AWAIT_TRANSACTION_MINED_MS, >>>>>>> const newProxyAddress = constants.NULL_ADDRESS; await web3Wrapper.awaitTransactionMinedAsync( await assetProxyDispatcher.registerAssetProxy.sendTransactionAsync( AssetProxyId.ERC20, newProxyAddress, erc20Proxy.address, { from: owner }, ), constants.AWAIT_TRANSACTION_MINED_MS, <<<<<<< const prevProxyAddress = constants.NULL_ADDRESS; await assetProxyDispatcher.registerAssetProxy.sendTransactionAsync( AssetProxyId.ERC20, erc20Proxy.address, prevProxyAddress, { from: owner }, ======= const prevProxyAddress = ZeroEx.NULL_ADDRESS; await web3Wrapper.awaitTransactionMinedAsync( await assetProxyDispatcher.registerAssetProxy.sendTransactionAsync( AssetProxyId.ERC20, erc20Proxy.address, prevProxyAddress, { from: owner }, ), constants.AWAIT_TRANSACTION_MINED_MS, >>>>>>> const prevProxyAddress = constants.NULL_ADDRESS; await web3Wrapper.awaitTransactionMinedAsync( await assetProxyDispatcher.registerAssetProxy.sendTransactionAsync( AssetProxyId.ERC20, erc20Proxy.address, prevProxyAddress, { from: owner }, ), constants.AWAIT_TRANSACTION_MINED_MS, <<<<<<< const prevProxyAddress = constants.NULL_ADDRESS; await assetProxyDispatcher.registerAssetProxy.sendTransactionAsync( AssetProxyId.ERC20, erc20Proxy.address, prevProxyAddress, { from: owner }, ======= const prevProxyAddress = ZeroEx.NULL_ADDRESS; await web3Wrapper.awaitTransactionMinedAsync( await assetProxyDispatcher.registerAssetProxy.sendTransactionAsync( AssetProxyId.ERC20, erc20Proxy.address, prevProxyAddress, { from: owner }, ), constants.AWAIT_TRANSACTION_MINED_MS, >>>>>>> const prevProxyAddress = constants.NULL_ADDRESS; await web3Wrapper.awaitTransactionMinedAsync( await assetProxyDispatcher.registerAssetProxy.sendTransactionAsync( AssetProxyId.ERC20, erc20Proxy.address, prevProxyAddress, { from: owner }, ), constants.AWAIT_TRANSACTION_MINED_MS,
<<<<<<< }; zeroEx.orderStateWatcher.subscribe(callback); ======= }); zeroEx.orderStateWatcher.subscribe(callback, numConfirmations); >>>>>>> }); zeroEx.orderStateWatcher.subscribe(callback); <<<<<<< }; zeroEx.orderStateWatcher.subscribe(callback); ======= }); zeroEx.orderStateWatcher.subscribe(callback, numConfirmations); >>>>>>> }); zeroEx.orderStateWatcher.subscribe(callback); <<<<<<< }; zeroEx.orderStateWatcher.subscribe(callback); ======= }); zeroEx.orderStateWatcher.subscribe(callback, numConfirmations); >>>>>>> }); zeroEx.orderStateWatcher.subscribe(callback); <<<<<<< }; zeroEx.orderStateWatcher.subscribe(callback); ======= }); zeroEx.orderStateWatcher.subscribe(callback, numConfirmations); >>>>>>> }); zeroEx.orderStateWatcher.subscribe(callback);
<<<<<<< } export interface TransactionReceipt { blockHash: string; blockNumber: number; transactionHash: string; transactionIndex: number; from: string; to: string; status: null|0|1; cumulativeGasUsed: number; gasUsed: number; contractAddress: string|null; logs: Web3.LogEntry[]; } ======= } export interface OrderRelevantState { makerBalance: BigNumber; makerProxyAllowance: BigNumber; makerFeeBalance: BigNumber; makerFeeProxyAllowance: BigNumber; filledTakerTokenAmount: BigNumber; canceledTakerTokenAmount: BigNumber; remainingFillableMakerTokenAmount: BigNumber; } export interface OrderStateValid { isValid: true; orderHash: string; orderRelevantState: OrderRelevantState; } export interface OrderStateInvalid { isValid: false; orderHash: string; error: ExchangeContractErrs; } export type OrderState = OrderStateValid|OrderStateInvalid; export type OnOrderStateChangeCallbackSync = (orderState: OrderState) => void; export type OnOrderStateChangeCallbackAsync = (orderState: OrderState) => Promise<void>; export type OnOrderStateChangeCallback = OnOrderStateChangeCallbackAsync|OnOrderStateChangeCallbackSync; >>>>>>> } export interface OrderRelevantState { makerBalance: BigNumber; makerProxyAllowance: BigNumber; makerFeeBalance: BigNumber; makerFeeProxyAllowance: BigNumber; filledTakerTokenAmount: BigNumber; canceledTakerTokenAmount: BigNumber; remainingFillableMakerTokenAmount: BigNumber; } export interface OrderStateValid { isValid: true; orderHash: string; orderRelevantState: OrderRelevantState; } export interface OrderStateInvalid { isValid: false; orderHash: string; error: ExchangeContractErrs; } export type OrderState = OrderStateValid|OrderStateInvalid; export type OnOrderStateChangeCallbackSync = (orderState: OrderState) => void; export type OnOrderStateChangeCallbackAsync = (orderState: OrderState) => Promise<void>; export type OnOrderStateChangeCallback = OnOrderStateChangeCallbackAsync|OnOrderStateChangeCallbackSync; export interface TransactionReceipt { blockHash: string; blockNumber: number; transactionHash: string; transactionIndex: number; from: string; to: string; status: null|0|1; cumulativeGasUsed: number; gasUsed: number; contractAddress: string|null; logs: Web3.LogEntry[]; }
<<<<<<< import * as Web3 from 'web3'; import {ExchangeContractErrs, SignedOrder, Token, ZeroEx, ZeroExError} from '../src'; import {TradeSide, TransferType} from '../src/types'; import {ExchangeTransferSimulator} from '../src/utils/exchange_transfer_simulator'; import {OrderValidationUtils} from '../src/utils/order_validation_utils'; ======= import {chaiSetup} from './utils/chai_setup'; import {web3Factory} from './utils/web3_factory'; import {ZeroEx, SignedOrder, Token, ExchangeContractErrs, ZeroExError} from '../src'; import {TradeSide, TransferType, BlockParamLiteral} from '../src/types'; import {TokenUtils} from './utils/token_utils'; >>>>>>> import * as Web3 from 'web3'; import {ExchangeContractErrs, SignedOrder, Token, ZeroEx, ZeroExError} from '../src'; import {TradeSide, TransferType} from '../src/types'; import {ExchangeTransferSimulator} from '../src/utils/exchange_transfer_simulator'; import {OrderValidationUtils} from '../src/utils/order_validation_utils'; import {chaiSetup} from './utils/chai_setup'; import {web3Factory} from './utils/web3_factory'; import {ZeroEx, SignedOrder, Token, ExchangeContractErrs, ZeroExError} from '../src'; import {TradeSide, TransferType, BlockParamLiteral} from '../src/types'; import {TokenUtils} from './utils/token_utils';
<<<<<<< LiquidityProvider = 'LiquidityProvider', ======= CurveUsdcDaiUsdtBusd = 'Curve_USDC_DAI_USDT_BUSD', >>>>>>> LiquidityProvider = 'LiquidityProvider', CurveUsdcDaiUsdtBusd = 'Curve_USDC_DAI_USDT_BUSD',
<<<<<<< ContractResponse, OrderCancellationRequest, OrderFillRequest, ======= ContractResponse, OrderCancellationRequest, >>>>>>> ContractResponse, OrderCancellationRequest, OrderFillRequest, <<<<<<< * Batched version of fillOrderAsync. Executes fills atomically in a single transaction. */ public async batchFillOrderAsync(orderFillRequests: OrderFillRequest[], shouldCheckTransfer: boolean, takerAddress: string): Promise<void> { if (_.isEmpty(orderFillRequests)) { return; } assert.isBoolean('shouldCheckTransfer', shouldCheckTransfer); await assert.isSenderAddressAsync('takerAddress', takerAddress, this.web3Wrapper); _.forEach(orderFillRequests, async (orderFillRequest: OrderFillRequest) => { assert.doesConformToSchema('signedOrder', SchemaValidator.convertToJSONSchemaCompatibleObject(orderFillRequest.signedOrder as object), signedOrderSchema); assert.isBigNumber('takerTokenFillAmount', orderFillRequest.takerTokenFillAmount); await this.validateFillOrderAndThrowIfInvalidAsync( orderFillRequest.signedOrder, orderFillRequest.takerTokenFillAmount, takerAddress); }); const exchangeInstance = await this.getExchangeContractAsync(); const orderAddressesValuesAmountsAndSignatureArray = _.map(orderFillRequests, orderFillRequest => { return [ ...ExchangeWrapper.getOrderAddressesAndValues(orderFillRequest.signedOrder), orderFillRequest.takerTokenFillAmount, orderFillRequest.signedOrder.ecSignature.v, orderFillRequest.signedOrder.ecSignature.r, orderFillRequest.signedOrder.ecSignature.s, ]; }); // _.unzip doesn't type check if values have different types :'( const [orderAddressesArray, orderValuesArray, takerTokenFillAmountArray, vArray, rArray, sArray] = _.unzip<any>( orderAddressesValuesAmountsAndSignatureArray, ); const gas = await exchangeInstance.batchFill.estimateGas( orderAddressesArray, orderValuesArray, takerTokenFillAmountArray, shouldCheckTransfer, vArray, rArray, sArray, { from: takerAddress, }, ); const response: ContractResponse = await exchangeInstance.batchFill( orderAddressesArray, orderValuesArray, takerTokenFillAmountArray, shouldCheckTransfer, vArray, rArray, sArray, { from: takerAddress, gas, }, ); this.throwErrorLogsAsErrors(response.logs); } /** ======= * Attempts to fill a specific amount of an order. If the entire amount specified cannot be filled, * the fill order is abandoned. */ public async fillOrKillOrderAsync(signedOrder: SignedOrder, fillTakerAmount: BigNumber.BigNumber, takerAddress: string) { assert.doesConformToSchema('signedOrder', SchemaValidator.convertToJSONSchemaCompatibleObject(signedOrder as object), signedOrderSchema); assert.isBigNumber('fillTakerAmount', fillTakerAmount); await assert.isSenderAddressAsync('takerAddress', takerAddress, this.web3Wrapper); const exchangeInstance = await this.getExchangeContractAsync(); await this.validateFillOrderAndThrowIfInvalidAsync(signedOrder, fillTakerAmount, takerAddress); // Check that fillValue available >= fillTakerAmount const orderHashHex = await this.getOrderHashHexAsync(signedOrder); const unavailableTakerAmount = await this.getUnavailableTakerAmountAsync(orderHashHex); const remainingTakerAmount = signedOrder.takerTokenAmount.minus(unavailableTakerAmount); if (remainingTakerAmount < fillTakerAmount) { throw new Error(ExchangeContractErrs.INSUFFICIENT_REMAINING_FILL_AMOUNT); } const [orderAddresses, orderValues] = ExchangeWrapper.getOrderAddressesAndValues(signedOrder); const gas = await exchangeInstance.fillOrKill.estimateGas( orderAddresses, orderValues, fillTakerAmount, signedOrder.ecSignature.v, signedOrder.ecSignature.r, signedOrder.ecSignature.s, { from: takerAddress, }, ); const response: ContractResponse = await exchangeInstance.fillOrKill( orderAddresses, orderValues, fillTakerAmount, signedOrder.ecSignature.v, signedOrder.ecSignature.r, signedOrder.ecSignature.s, { from: takerAddress, gas, }, ); this.throwErrorLogsAsErrors(response.logs); } /** >>>>>>> * Batched version of fillOrderAsync. Executes fills atomically in a single transaction. */ public async batchFillOrderAsync(orderFillRequests: OrderFillRequest[], shouldCheckTransfer: boolean, takerAddress: string): Promise<void> { if (_.isEmpty(orderFillRequests)) { return; } assert.isBoolean('shouldCheckTransfer', shouldCheckTransfer); await assert.isSenderAddressAsync('takerAddress', takerAddress, this.web3Wrapper); _.forEach(orderFillRequests, async (orderFillRequest: OrderFillRequest) => { assert.doesConformToSchema('signedOrder', SchemaValidator.convertToJSONSchemaCompatibleObject(orderFillRequest.signedOrder as object), signedOrderSchema); assert.isBigNumber('takerTokenFillAmount', orderFillRequest.takerTokenFillAmount); await this.validateFillOrderAndThrowIfInvalidAsync( orderFillRequest.signedOrder, orderFillRequest.takerTokenFillAmount, takerAddress); }); const exchangeInstance = await this.getExchangeContractAsync(); const orderAddressesValuesAmountsAndSignatureArray = _.map(orderFillRequests, orderFillRequest => { return [ ...ExchangeWrapper.getOrderAddressesAndValues(orderFillRequest.signedOrder), orderFillRequest.takerTokenFillAmount, orderFillRequest.signedOrder.ecSignature.v, orderFillRequest.signedOrder.ecSignature.r, orderFillRequest.signedOrder.ecSignature.s, ]; }); // _.unzip doesn't type check if values have different types :'( const [orderAddressesArray, orderValuesArray, takerTokenFillAmountArray, vArray, rArray, sArray] = _.unzip<any>( orderAddressesValuesAmountsAndSignatureArray, ); const gas = await exchangeInstance.batchFill.estimateGas( orderAddressesArray, orderValuesArray, takerTokenFillAmountArray, shouldCheckTransfer, vArray, rArray, sArray, { from: takerAddress, }, ); const response: ContractResponse = await exchangeInstance.batchFill( orderAddressesArray, orderValuesArray, takerTokenFillAmountArray, shouldCheckTransfer, vArray, rArray, sArray, { from: takerAddress, gas, }, ); this.throwErrorLogsAsErrors(response.logs); } /** * Attempts to fill a specific amount of an order. If the entire amount specified cannot be filled, * the fill order is abandoned. */ public async fillOrKillOrderAsync(signedOrder: SignedOrder, fillTakerAmount: BigNumber.BigNumber, takerAddress: string) { assert.doesConformToSchema('signedOrder', SchemaValidator.convertToJSONSchemaCompatibleObject(signedOrder as object), signedOrderSchema); assert.isBigNumber('fillTakerAmount', fillTakerAmount); await assert.isSenderAddressAsync('takerAddress', takerAddress, this.web3Wrapper); const exchangeInstance = await this.getExchangeContractAsync(); await this.validateFillOrderAndThrowIfInvalidAsync(signedOrder, fillTakerAmount, takerAddress); // Check that fillValue available >= fillTakerAmount const orderHashHex = await this.getOrderHashHexAsync(signedOrder); const unavailableTakerAmount = await this.getUnavailableTakerAmountAsync(orderHashHex); const remainingTakerAmount = signedOrder.takerTokenAmount.minus(unavailableTakerAmount); if (remainingTakerAmount < fillTakerAmount) { throw new Error(ExchangeContractErrs.INSUFFICIENT_REMAINING_FILL_AMOUNT); } const [orderAddresses, orderValues] = ExchangeWrapper.getOrderAddressesAndValues(signedOrder); const gas = await exchangeInstance.fillOrKill.estimateGas( orderAddresses, orderValues, fillTakerAmount, signedOrder.ecSignature.v, signedOrder.ecSignature.r, signedOrder.ecSignature.s, { from: takerAddress, }, ); const response: ContractResponse = await exchangeInstance.fillOrKill( orderAddresses, orderValues, fillTakerAmount, signedOrder.ecSignature.v, signedOrder.ecSignature.r, signedOrder.ecSignature.s, { from: takerAddress, gas, }, ); this.throwErrorLogsAsErrors(response.logs); } /**
<<<<<<< /** * Decode the ABI-encoded transaction data into its input arguments * @param callData The ABI-encoded transaction data * @returns An array representing the input arguments in order. Keynames of nested structs are preserved. */ getABIDecodedTransactionData(callData: string): string { const self = (this as any) as ERC20TokenContract; const abiEncoder = self._lookupAbiEncoder('approve(address,uint256)'); // tslint:disable boolean-naming const abiDecodedCallData = abiEncoder.strictDecode<string>(callData); return abiDecodedCallData; }, /** * Decode the ABI-encoded return data from a transaction * @param returnData the data returned after transaction execution * @returns An array representing the output results in order. Keynames of nested structs are preserved. */ getABIDecodedReturnData(returnData: string): boolean { const self = (this as any) as ERC20TokenContract; const abiEncoder = self._lookupAbiEncoder('approve(address,uint256)'); // tslint:disable boolean-naming const abiDecodedReturnData = abiEncoder.strictDecodeReturnValue<boolean>(returnData); return abiDecodedReturnData; }, /** * Returns the 4 byte function selector as a hex string. */ getSelector(): string { const self = (this as any) as ERC20TokenContract; const abiEncoder = self._lookupAbiEncoder('approve(address,uint256)'); return abiEncoder.getSelector(); }, ======= >>>>>>> /** * Returns the 4 byte function selector as a hex string. */ getSelector(): string { const self = (this as any) as ERC20TokenContract; const abiEncoder = self._lookupAbiEncoder('approve(address,uint256)'); return abiEncoder.getSelector(); }, <<<<<<< /** * Returns the ABI encoded transaction data needed to send an Ethereum transaction calling this method. Before * sending the Ethereum tx, this encoded tx data can first be sent to a separate signing service or can be used * to create a 0x transaction (see protocol spec for more details). * @returns The ABI encoded transaction data as a string */ getABIEncodedTransactionData(): string { const self = (this as any) as ERC20TokenContract; const abiEncodedTransactionData = self._strictEncodeArguments('totalSupply()', []); return abiEncodedTransactionData; }, /** * Decode the ABI-encoded transaction data into its input arguments * @param callData The ABI-encoded transaction data * @returns An array representing the input arguments in order. Keynames of nested structs are preserved. */ getABIDecodedTransactionData(callData: string): void { const self = (this as any) as ERC20TokenContract; const abiEncoder = self._lookupAbiEncoder('totalSupply()'); // tslint:disable boolean-naming const abiDecodedCallData = abiEncoder.strictDecode<void>(callData); return abiDecodedCallData; }, /** * Decode the ABI-encoded return data from a transaction * @param returnData the data returned after transaction execution * @returns An array representing the output results in order. Keynames of nested structs are preserved. */ getABIDecodedReturnData(returnData: string): BigNumber { const self = (this as any) as ERC20TokenContract; const abiEncoder = self._lookupAbiEncoder('totalSupply()'); // tslint:disable boolean-naming const abiDecodedReturnData = abiEncoder.strictDecodeReturnValue<BigNumber>(returnData); return abiDecodedReturnData; }, /** * Returns the 4 byte function selector as a hex string. */ getSelector(): string { const self = (this as any) as ERC20TokenContract; const abiEncoder = self._lookupAbiEncoder('totalSupply()'); return abiEncoder.getSelector(); }, ======= >>>>>>> <<<<<<< /** * Decode the ABI-encoded transaction data into its input arguments * @param callData The ABI-encoded transaction data * @returns An array representing the input arguments in order. Keynames of nested structs are preserved. */ getABIDecodedTransactionData(callData: string): string { const self = (this as any) as ERC20TokenContract; const abiEncoder = self._lookupAbiEncoder('transferFrom(address,address,uint256)'); // tslint:disable boolean-naming const abiDecodedCallData = abiEncoder.strictDecode<string>(callData); return abiDecodedCallData; }, /** * Decode the ABI-encoded return data from a transaction * @param returnData the data returned after transaction execution * @returns An array representing the output results in order. Keynames of nested structs are preserved. */ getABIDecodedReturnData(returnData: string): boolean { const self = (this as any) as ERC20TokenContract; const abiEncoder = self._lookupAbiEncoder('transferFrom(address,address,uint256)'); // tslint:disable boolean-naming const abiDecodedReturnData = abiEncoder.strictDecodeReturnValue<boolean>(returnData); return abiDecodedReturnData; }, /** * Returns the 4 byte function selector as a hex string. */ getSelector(): string { const self = (this as any) as ERC20TokenContract; const abiEncoder = self._lookupAbiEncoder('transferFrom(address,address,uint256)'); return abiEncoder.getSelector(); }, ======= >>>>>>> /** * Returns the 4 byte function selector as a hex string. */ getSelector(): string { const self = (this as any) as ERC20TokenContract; const abiEncoder = self._lookupAbiEncoder('transferFrom(address,address,uint256)'); return abiEncoder.getSelector(); }, <<<<<<< /** * Returns the ABI encoded transaction data needed to send an Ethereum transaction calling this method. Before * sending the Ethereum tx, this encoded tx data can first be sent to a separate signing service or can be used * to create a 0x transaction (see protocol spec for more details). * @param _owner The address from which the balance will be retrieved * @returns The ABI encoded transaction data as a string */ getABIEncodedTransactionData(_owner: string): string { assert.isString('_owner', _owner); const self = (this as any) as ERC20TokenContract; const abiEncodedTransactionData = self._strictEncodeArguments('balanceOf(address)', [_owner.toLowerCase()]); return abiEncodedTransactionData; }, /** * Decode the ABI-encoded transaction data into its input arguments * @param callData The ABI-encoded transaction data * @returns An array representing the input arguments in order. Keynames of nested structs are preserved. */ getABIDecodedTransactionData(callData: string): string { const self = (this as any) as ERC20TokenContract; const abiEncoder = self._lookupAbiEncoder('balanceOf(address)'); // tslint:disable boolean-naming const abiDecodedCallData = abiEncoder.strictDecode<string>(callData); return abiDecodedCallData; }, /** * Decode the ABI-encoded return data from a transaction * @param returnData the data returned after transaction execution * @returns An array representing the output results in order. Keynames of nested structs are preserved. */ getABIDecodedReturnData(returnData: string): BigNumber { const self = (this as any) as ERC20TokenContract; const abiEncoder = self._lookupAbiEncoder('balanceOf(address)'); // tslint:disable boolean-naming const abiDecodedReturnData = abiEncoder.strictDecodeReturnValue<BigNumber>(returnData); return abiDecodedReturnData; }, /** * Returns the 4 byte function selector as a hex string. */ getSelector(): string { const self = (this as any) as ERC20TokenContract; const abiEncoder = self._lookupAbiEncoder('balanceOf(address)'); return abiEncoder.getSelector(); }, ======= >>>>>>> <<<<<<< /** * Decode the ABI-encoded transaction data into its input arguments * @param callData The ABI-encoded transaction data * @returns An array representing the input arguments in order. Keynames of nested structs are preserved. */ getABIDecodedTransactionData(callData: string): string { const self = (this as any) as ERC20TokenContract; const abiEncoder = self._lookupAbiEncoder('transfer(address,uint256)'); // tslint:disable boolean-naming const abiDecodedCallData = abiEncoder.strictDecode<string>(callData); return abiDecodedCallData; }, /** * Decode the ABI-encoded return data from a transaction * @param returnData the data returned after transaction execution * @returns An array representing the output results in order. Keynames of nested structs are preserved. */ getABIDecodedReturnData(returnData: string): boolean { const self = (this as any) as ERC20TokenContract; const abiEncoder = self._lookupAbiEncoder('transfer(address,uint256)'); // tslint:disable boolean-naming const abiDecodedReturnData = abiEncoder.strictDecodeReturnValue<boolean>(returnData); return abiDecodedReturnData; }, /** * Returns the 4 byte function selector as a hex string. */ getSelector(): string { const self = (this as any) as ERC20TokenContract; const abiEncoder = self._lookupAbiEncoder('transfer(address,uint256)'); return abiEncoder.getSelector(); }, ======= >>>>>>> /** * Returns the 4 byte function selector as a hex string. */ getSelector(): string { const self = (this as any) as ERC20TokenContract; const abiEncoder = self._lookupAbiEncoder('transfer(address,uint256)'); return abiEncoder.getSelector(); }, <<<<<<< /** * Returns the ABI encoded transaction data needed to send an Ethereum transaction calling this method. Before * sending the Ethereum tx, this encoded tx data can first be sent to a separate signing service or can be used * to create a 0x transaction (see protocol spec for more details). * @param _owner The address of the account owning tokens * @param _spender The address of the account able to transfer the tokens * @returns The ABI encoded transaction data as a string */ getABIEncodedTransactionData(_owner: string, _spender: string): string { assert.isString('_owner', _owner); assert.isString('_spender', _spender); const self = (this as any) as ERC20TokenContract; const abiEncodedTransactionData = self._strictEncodeArguments('allowance(address,address)', [ _owner.toLowerCase(), _spender.toLowerCase(), ]); return abiEncodedTransactionData; }, /** * Decode the ABI-encoded transaction data into its input arguments * @param callData The ABI-encoded transaction data * @returns An array representing the input arguments in order. Keynames of nested structs are preserved. */ getABIDecodedTransactionData(callData: string): string { const self = (this as any) as ERC20TokenContract; const abiEncoder = self._lookupAbiEncoder('allowance(address,address)'); // tslint:disable boolean-naming const abiDecodedCallData = abiEncoder.strictDecode<string>(callData); return abiDecodedCallData; }, /** * Decode the ABI-encoded return data from a transaction * @param returnData the data returned after transaction execution * @returns An array representing the output results in order. Keynames of nested structs are preserved. */ getABIDecodedReturnData(returnData: string): BigNumber { const self = (this as any) as ERC20TokenContract; const abiEncoder = self._lookupAbiEncoder('allowance(address,address)'); // tslint:disable boolean-naming const abiDecodedReturnData = abiEncoder.strictDecodeReturnValue<BigNumber>(returnData); return abiDecodedReturnData; }, /** * Returns the 4 byte function selector as a hex string. */ getSelector(): string { const self = (this as any) as ERC20TokenContract; const abiEncoder = self._lookupAbiEncoder('allowance(address,address)'); return abiEncoder.getSelector(); }, ======= >>>>>>>
<<<<<<< (logEvent: DecodedLogEvent<WETH9ApprovalEventArgs>) => { ======= (_logEvent: DecodedLogEvent<ApprovalContractEventArgs>) => { >>>>>>> (_logEvent: DecodedLogEvent<WETH9ApprovalEventArgs>) => { <<<<<<< (logEvent: DecodedLogEvent<WETH9ApprovalEventArgs>) => { ======= (_logEvent: DecodedLogEvent<ApprovalContractEventArgs>) => { >>>>>>> (_logEvent: DecodedLogEvent<WETH9ApprovalEventArgs>) => {
<<<<<<< PAYMENT_METHOD_DROPDOWN_OPENED = 'Payment Method - Dropdown Opened', PAYMENT_METHOD_OPENED_ETHERSCAN = 'Payment Method - Opened Etherscan', PAYMENT_METHOD_COPIED_ADDRESS = 'Payment Method - Copied Address', ======= TOKEN_SELECTOR_OPENED = 'Token Selector - Opened', TOKEN_SELECTOR_CLOSED = 'Token Selector - Closed', TOKEN_SELECTOR_CHOSE = 'Token Selector - Chose', TOKEN_SELECTOR_SEARCHED = 'Token Selector - Searched', >>>>>>> PAYMENT_METHOD_DROPDOWN_OPENED = 'Payment Method - Dropdown Opened', PAYMENT_METHOD_OPENED_ETHERSCAN = 'Payment Method - Opened Etherscan', PAYMENT_METHOD_COPIED_ADDRESS = 'Payment Method - Copied Address', TOKEN_SELECTOR_OPENED = 'Token Selector - Opened', TOKEN_SELECTOR_CLOSED = 'Token Selector - Closed', TOKEN_SELECTOR_CHOSE = 'Token Selector - Chose', TOKEN_SELECTOR_SEARCHED = 'Token Selector - Searched', <<<<<<< trackPaymentMethodDropdownOpened: trackingEventFnWithoutPayload(EventNames.PAYMENT_METHOD_DROPDOWN_OPENED), trackPaymentMethodOpenedEtherscan: trackingEventFnWithoutPayload(EventNames.PAYMENT_METHOD_OPENED_ETHERSCAN), trackPaymentMethodCopiedAddress: trackingEventFnWithoutPayload(EventNames.PAYMENT_METHOD_COPIED_ADDRESS), ======= trackTokenSelectorOpened: trackingEventFnWithoutPayload(EventNames.TOKEN_SELECTOR_OPENED), trackTokenSelectorClosed: (closedVia: TokenSelectorClosedVia) => trackingEventFnWithPayload(EventNames.TOKEN_SELECTOR_CLOSED)({ closedVia }), trackTokenSelectorChose: (payload: { assetName: string; assetData: string }) => trackingEventFnWithPayload(EventNames.TOKEN_SELECTOR_CHOSE)(payload), trackTokenSelectorSearched: (searchText: string) => trackingEventFnWithPayload(EventNames.TOKEN_SELECTOR_SEARCHED)({ searchText }), >>>>>>> trackPaymentMethodDropdownOpened: trackingEventFnWithoutPayload(EventNames.PAYMENT_METHOD_DROPDOWN_OPENED), trackPaymentMethodOpenedEtherscan: trackingEventFnWithoutPayload(EventNames.PAYMENT_METHOD_OPENED_ETHERSCAN), trackPaymentMethodCopiedAddress: trackingEventFnWithoutPayload(EventNames.PAYMENT_METHOD_COPIED_ADDRESS), trackTokenSelectorOpened: trackingEventFnWithoutPayload(EventNames.TOKEN_SELECTOR_OPENED), trackTokenSelectorClosed: (closedVia: TokenSelectorClosedVia) => trackingEventFnWithPayload(EventNames.TOKEN_SELECTOR_CLOSED)({ closedVia }), trackTokenSelectorChose: (payload: { assetName: string; assetData: string }) => trackingEventFnWithPayload(EventNames.TOKEN_SELECTOR_CHOSE)(payload), trackTokenSelectorSearched: (searchText: string) => trackingEventFnWithPayload(EventNames.TOKEN_SELECTOR_SEARCHED)({ searchText }),
<<<<<<< const callback = (logEvent: DecodedLogEvent<TransferContractEventArgs>) => { ======= const callback = (err: Error, logEvent: LogEvent<TransferContractEventArgs>) => { >>>>>>> const callback = (err: Error, logEvent: DecodedLogEvent<TransferContractEventArgs>) => { <<<<<<< const callback = (logEvent: DecodedLogEvent<ApprovalContractEventArgs>) => { ======= const callback = (err: Error, logEvent: LogEvent<ApprovalContractEventArgs>) => { >>>>>>> const callback = (err: Error, logEvent: DecodedLogEvent<ApprovalContractEventArgs>) => { <<<<<<< const callbackNeverToBeCalled = (logEvent: DecodedLogEvent<TransferContractEventArgs>) => { ======= const callbackNeverToBeCalled = (err: Error, logEvent: LogEvent<TransferContractEventArgs>) => { >>>>>>> const callbackNeverToBeCalled = (err: Error, logEvent: DecodedLogEvent<ApprovalContractEventArgs>) => { <<<<<<< const callbackToBeCalled = (logEvent: DecodedLogEvent<TransferContractEventArgs>) => { ======= const callbackToBeCalled = (err: Error, logEvent: LogEvent<TransferContractEventArgs>) => { >>>>>>> const callbackToBeCalled = (err: Error, logEvent: DecodedLogEvent<ApprovalContractEventArgs>) => { <<<<<<< const callbackNeverToBeCalled = (logEvent: DecodedLogEvent<TokenContractEventArgs>) => { ======= const callbackNeverToBeCalled = (err: Error, logEvent: LogEvent<TokenContractEventArgs>) => { >>>>>>> const callbackNeverToBeCalled = (err: Error, logEvent: DecodedLogEvent<ApprovalContractEventArgs>) => {
<<<<<<< export const signatureUtils = { /** * Verifies that the provided signature is valid according to the 0x Protocol smart contracts * @param provider Web3 provider to use for all JSON RPC requests * @param data The hex encoded data signed by the supplied signature. * @param signature A hex encoded 0x Protocol signature made up of: [TypeSpecificData][SignatureType]. * E.g [vrs][SignatureType.EIP712] * @param signerAddress The hex encoded address that signed the data, producing the supplied signature. * @return Whether the signature is valid for the supplied signerAddress and data. */ async isValidSignatureAsync( provider: Provider, data: string, signature: string, signerAddress: string, ): Promise<boolean> { assert.isWeb3Provider('provider', provider); assert.isHexString('data', data); assert.isHexString('signature', signature); assert.isETHAddressHex('signerAddress', signerAddress); const signatureTypeIndexIfExists = utils.getSignatureTypeIndexIfExists(signature); if (_.isUndefined(signatureTypeIndexIfExists)) { throw new Error(`Unrecognized signatureType in signature: ${signature}`); ======= /** * Verifies that the provided signature is valid according to the 0x Protocol smart contracts * @param data The hex encoded data signed by the supplied signature. * @param signature A hex encoded 0x Protocol signature made up of: [TypeSpecificData][SignatureType]. * E.g [vrs][SignatureType.EIP712] * @param signerAddress The hex encoded address that signed the data, producing the supplied signature. * @return Whether the signature is valid for the supplied signerAddress and data. */ export async function isValidSignatureAsync( provider: Provider, data: string, signature: string, signerAddress: string, ): Promise<boolean> { assert.isWeb3Provider('provider', provider); assert.isHexString('data', data); assert.isHexString('signature', signature); assert.isETHAddressHex('signerAddress', signerAddress); const signatureTypeIndexIfExists = utils.getSignatureTypeIndexIfExists(signature); if (_.isUndefined(signatureTypeIndexIfExists)) { throw new Error(`Unrecognized signatureType in signature: ${signature}`); } switch (signatureTypeIndexIfExists) { case SignatureType.Illegal: case SignatureType.Invalid: return false; case SignatureType.EIP712: { const ecSignature = parseECSignature(signature); return isValidECSignature(data, ecSignature, signerAddress); } case SignatureType.EthSign: { const ecSignature = parseECSignature(signature); const prefixedMessageHex = addSignedMessagePrefix(data, SignerType.Default); return isValidECSignature(prefixedMessageHex, ecSignature, signerAddress); >>>>>>> export const signatureUtils = { /** * Verifies that the provided signature is valid according to the 0x Protocol smart contracts * @param data The hex encoded data signed by the supplied signature. * @param signature A hex encoded 0x Protocol signature made up of: [TypeSpecificData][SignatureType]. * E.g [vrs][SignatureType.EIP712] * @param signerAddress The hex encoded address that signed the data, producing the supplied signature. * @return Whether the signature is valid for the supplied signerAddress and data. */ async isValidSignatureAsync( provider: Provider, data: string, signature: string, signerAddress: string, ): Promise<boolean> { assert.isWeb3Provider('provider', provider); assert.isHexString('data', data); assert.isHexString('signature', signature); assert.isETHAddressHex('signerAddress', signerAddress); const signatureTypeIndexIfExists = utils.getSignatureTypeIndexIfExists(signature); if (_.isUndefined(signatureTypeIndexIfExists)) { throw new Error(`Unrecognized signatureType in signature: ${signature}`); <<<<<<< }, /** * Verifies that the provided presigned signature is valid according to the 0x Protocol smart contracts * @param provider Web3 provider to use for all JSON RPC requests * @param data The hex encoded data signed by the supplied signature * @param signerAddress The hex encoded address that signed the data, producing the supplied signature. * @return Whether the data was preSigned by the supplied signerAddress */ async isValidPresignedSignatureAsync(provider: Provider, data: string, signerAddress: string): Promise<boolean> { assert.isWeb3Provider('provider', provider); assert.isHexString('data', data); assert.isETHAddressHex('signerAddress', signerAddress); const exchangeContract = new ExchangeContract(artifacts.Exchange.compilerOutput.abi, signerAddress, provider); const isValid = await exchangeContract.preSigned.callAsync(data, signerAddress); return isValid; }, /** * Verifies that the provided wallet signature is valid according to the 0x Protocol smart contracts * @param provider Web3 provider to use for all JSON RPC requests * @param data The hex encoded data signed by the supplied signature. * @param signature A hex encoded presigned 0x Protocol signature made up of: [SignatureType.Presigned] * @param signerAddress The hex encoded address that signed the data, producing the supplied signature. * @return Whether the data was preSigned by the supplied signerAddress. */ async isValidWalletSignatureAsync( provider: Provider, data: string, signature: string, signerAddress: string, ): Promise<boolean> { assert.isWeb3Provider('provider', provider); assert.isHexString('data', data); assert.isHexString('signature', signature); assert.isETHAddressHex('signerAddress', signerAddress); // tslint:disable-next-line:custom-no-magic-numbers const signatureWithoutType = signature.slice(-2); const walletContract = new IWalletContract(artifacts.IWallet.compilerOutput.abi, signerAddress, provider); const isValid = await walletContract.isValidSignature.callAsync(data, signatureWithoutType); return isValid; }, /** * Verifies that the provided validator signature is valid according to the 0x Protocol smart contracts * @param provider Web3 provider to use for all JSON RPC requests * @param data The hex encoded data signed by the supplied signature. * @param signature A hex encoded presigned 0x Protocol signature made up of: [SignatureType.Presigned] * @param signerAddress The hex encoded address that signed the data, producing the supplied signature. * @return Whether the data was preSigned by the supplied signerAddress. */ async isValidValidatorSignatureAsync( provider: Provider, data: string, signature: string, signerAddress: string, ): Promise<boolean> { assert.isWeb3Provider('provider', provider); assert.isHexString('data', data); assert.isHexString('signature', signature); assert.isETHAddressHex('signerAddress', signerAddress); const validatorSignature = parseValidatorSignature(signature); const exchangeContract = new ExchangeContract(artifacts.Exchange.compilerOutput.abi, signerAddress, provider); const isValidatorApproved = await exchangeContract.allowedValidators.callAsync( signerAddress, validatorSignature.validatorAddress, ); if (!isValidatorApproved) { throw new Error( `Validator ${validatorSignature.validatorAddress} was not pre-approved by ${signerAddress}.`, ); ======= case SignatureType.PreSigned: { return isValidPresignedSignatureAsync(provider, data, signerAddress); } case SignatureType.Trezor: { const prefixedMessageHex = addSignedMessagePrefix(data, SignerType.Trezor); const ecSignature = parseECSignature(signature); return isValidECSignature(prefixedMessageHex, ecSignature, signerAddress); >>>>>>> }, /** * Verifies that the provided presigned signature is valid according to the 0x Protocol smart contracts * @param provider Web3 provider to use for all JSON RPC requests * @param data The hex encoded data signed by the supplied signature * @param signerAddress The hex encoded address that signed the data, producing the supplied signature. * @return Whether the data was preSigned by the supplied signerAddress */ async isValidPresignedSignatureAsync(provider: Provider, data: string, signerAddress: string): Promise<boolean> { assert.isWeb3Provider('provider', provider); assert.isHexString('data', data); assert.isETHAddressHex('signerAddress', signerAddress); const exchangeContract = new ExchangeContract(artifacts.Exchange.compilerOutput.abi, signerAddress, provider); const isValid = await exchangeContract.preSigned.callAsync(data, signerAddress); return isValid; }, /** * Verifies that the provided wallet signature is valid according to the 0x Protocol smart contracts * @param provider Web3 provider to use for all JSON RPC requests * @param data The hex encoded data signed by the supplied signature. * @param signature A hex encoded presigned 0x Protocol signature made up of: [SignatureType.Presigned] * @param signerAddress The hex encoded address that signed the data, producing the supplied signature. * @return Whether the data was preSigned by the supplied signerAddress. */ async isValidWalletSignatureAsync( provider: Provider, data: string, signature: string, signerAddress: string, ): Promise<boolean> { assert.isWeb3Provider('provider', provider); assert.isHexString('data', data); assert.isHexString('signature', signature); assert.isETHAddressHex('signerAddress', signerAddress); // tslint:disable-next-line:custom-no-magic-numbers const signatureWithoutType = signature.slice(-2); const walletContract = new IWalletContract(artifacts.IWallet.compilerOutput.abi, signerAddress, provider); const isValid = await walletContract.isValidSignature.callAsync(data, signatureWithoutType); return isValid; }, /** * Verifies that the provided validator signature is valid according to the 0x Protocol smart contracts * @param provider Web3 provider to use for all JSON RPC requests * @param data The hex encoded data signed by the supplied signature. * @param signature A hex encoded presigned 0x Protocol signature made up of: [SignatureType.Presigned] * @param signerAddress The hex encoded address that signed the data, producing the supplied signature. * @return Whether the data was preSigned by the supplied signerAddress. */ async isValidValidatorSignatureAsync( provider: Provider, data: string, signature: string, signerAddress: string, ): Promise<boolean> { assert.isWeb3Provider('provider', provider); assert.isHexString('data', data); assert.isHexString('signature', signature); assert.isETHAddressHex('signerAddress', signerAddress); const validatorSignature = parseValidatorSignature(signature); const exchangeContract = new ExchangeContract(artifacts.Exchange.compilerOutput.abi, signerAddress, provider); const isValidatorApproved = await exchangeContract.allowedValidators.callAsync( signerAddress, validatorSignature.validatorAddress, ); if (!isValidatorApproved) { throw new Error( `Validator ${validatorSignature.validatorAddress} was not pre-approved by ${signerAddress}.`, );
<<<<<<< exchangeV2: '0x080bf510fcbf18b91105470639e9561022937712', exchange: NULL_ADDRESS, ======= exchange: NULL_ADDRESS, >>>>>>> exchangeV2: '0x080bf510fcbf18b91105470639e9561022937712', exchange: NULL_ADDRESS, <<<<<<< devUtils: '0x92d9a4d50190ae04e03914db2ee650124af844e6', zrxVault: NULL_ADDRESS, readOnlyProxy: NULL_ADDRESS, staking: NULL_ADDRESS, stakingProxy: NULL_ADDRESS, ======= devUtils: NULL_ADDRESS, >>>>>>> zrxVault: NULL_ADDRESS, readOnlyProxy: NULL_ADDRESS, staking: NULL_ADDRESS, stakingProxy: NULL_ADDRESS, devUtils: NULL_ADDRESS, <<<<<<< exchangeV2: '0xbff9493f92a3df4b0429b6d00743b3cfb4c85831', exchange: '0x725bc2f8c85ed0289d3da79cde3125d33fc1d7e6', assetProxyOwner: '0xdcf20f7b447d51f2b3e5499b7f6cbbf7295a5d26', forwarder: '0x1ebdc9758e85c1c6a85af06cc96cf89000a31913', orderValidator: '0x6eb6237350f3c110c96223e6ff9db55532525d2b', dutchAuction: '0xe5f862f7811af180990025b6259b02feb0a0b8dc', ======= exchange: '0x725bc2f8c85ed0289d3da79cde3125d33fc1d7e6', assetProxyOwner: '0xdcf20f7b447d51f2b3e5499b7f6cbbf7295a5d26', forwarder: '0x31c3890769ed3bb30b2781fd238a5bb7ecfeb7c8', orderValidator: NULL_ADDRESS, dutchAuction: NULL_ADDRESS, >>>>>>> exchangeV2: '0xbff9493f92a3df4b0429b6d00743b3cfb4c85831', exchange: '0x725bc2f8c85ed0289d3da79cde3125d33fc1d7e6', assetProxyOwner: '0xdcf20f7b447d51f2b3e5499b7f6cbbf7295a5d26', forwarder: '0x31c3890769ed3bb30b2781fd238a5bb7ecfeb7c8', orderValidator: NULL_ADDRESS, dutchAuction: NULL_ADDRESS, <<<<<<< devUtils: '0x3e0b46bad8e374e4a110c12b832cb120dbe4a479', zrxVault: '0xffd161026865ad8b4ab28a76840474935eec4dfa', readOnlyProxy: '0x8e1dfaf747b804d041adaed79d68dcef85b8de85', staking: '0xb2ca5824630e526f0f3181a4ea0447c795a84411', stakingProxy: '0x5d751aa855a1aee5fe44cf5350ed25b5727b66ae', ======= devUtils: '0x3dfd5157eec10eb1a357c1074de30787ce92cb43', >>>>>>> devUtils: '0x3dfd5157eec10eb1a357c1074de30787ce92cb43', zrxVault: '0xffd161026865ad8b4ab28a76840474935eec4dfa', readOnlyProxy: '0x8e1dfaf747b804d041adaed79d68dcef85b8de85', staking: '0xb2ca5824630e526f0f3181a4ea0447c795a84411', stakingProxy: '0x5d751aa855a1aee5fe44cf5350ed25b5727b66ae', <<<<<<< exchangeV2: '0xbff9493f92a3df4b0429b6d00743b3cfb4c85831', exchange: '0x8e1dfaf747b804d041adaed79d68dcef85b8de85', ======= exchange: '0x8e1dfaf747b804d041adaed79d68dcef85b8de85', >>>>>>> exchangeV2: '0xbff9493f92a3df4b0429b6d00743b3cfb4c85831', exchange: '0x8e1dfaf747b804d041adaed79d68dcef85b8de85', <<<<<<< assetProxyOwner: '0x5d751aa855a1aee5fe44cf5350ed25b5727b66ae', forwarder: '0x1ebdc9758e85c1c6a85af06cc96cf89000a31913', orderValidator: '0x6eb6237350f3c110c96223e6ff9db55532525d2b', dutchAuction: '0xe5f862f7811af180990025b6259b02feb0a0b8dc', ======= assetProxyOwner: '0x5d751aa855a1aee5fe44cf5350ed25b5727b66ae', forwarder: '0xc6db36aeb96a2eb52079c342c3a980c83dea8e3c', orderValidator: NULL_ADDRESS, dutchAuction: NULL_ADDRESS, >>>>>>> assetProxyOwner: '0x5d751aa855a1aee5fe44cf5350ed25b5727b66ae', forwarder: '0xc6db36aeb96a2eb52079c342c3a980c83dea8e3c', orderValidator: NULL_ADDRESS, dutchAuction: NULL_ADDRESS, <<<<<<< devUtils: '0x2d4a9abda7b8b3605c8dbd34e3550a7467c78287', zrxVault: '0xa5bf6ac73bc40790fc6ffc9dbbbce76c9176e224', readOnlyProxy: '0xffd161026865ad8b4ab28a76840474935eec4dfa', staking: '0x8ec5a989a06432dace637c8d592727627a45a592', stakingProxy: '0xb2ca5824630e526f0f3181a4ea0447c795a84411', ======= devUtils: '0xcfc66b8e75e8f075c3e1d61e6487d73dfe35d808', >>>>>>> devUtils: '0xcfc66b8e75e8f075c3e1d61e6487d73dfe35d808', zrxVault: '0xa5bf6ac73bc40790fc6ffc9dbbbce76c9176e224', readOnlyProxy: '0xffd161026865ad8b4ab28a76840474935eec4dfa', staking: '0x8ec5a989a06432dace637c8d592727627a45a592', stakingProxy: '0xb2ca5824630e526f0f3181a4ea0447c795a84411', <<<<<<< exchangeV2: '0x30589010550762d2f0d06f650d8e8b6ade6dbf4b', exchange: '0x617602cd3f734cf1e028c96b3f54c0489bed8022', assetProxyOwner: '0x3654e5363cd75c8974c76208137df9691e820e97', forwarder: '0x1ebdc9758e85c1c6a85af06cc96cf89000a31913', orderValidator: '0xbcd49bf9b75cab056610fab3c788e8ce1b209f30', dutchAuction: '0xe5f862f7811af180990025b6259b02feb0a0b8dc', ======= exchange: '0x617602cd3f734cf1e028c96b3f54c0489bed8022', assetProxyOwner: '0x3654e5363cd75c8974c76208137df9691e820e97', forwarder: '0x4c4edb103a6570fa4b58a309d7ff527b7d9f7cf2', orderValidator: NULL_ADDRESS, dutchAuction: NULL_ADDRESS, >>>>>>> exchangeV2: '0x30589010550762d2f0d06f650d8e8b6ade6dbf4b', exchange: '0x617602cd3f734cf1e028c96b3f54c0489bed8022', assetProxyOwner: '0x3654e5363cd75c8974c76208137df9691e820e97', forwarder: '0x4c4edb103a6570fa4b58a309d7ff527b7d9f7cf2', orderValidator: NULL_ADDRESS, dutchAuction: NULL_ADDRESS, <<<<<<< exchangeV2: '0x48bacb9266a570d521063ef5dd96e61686dbe788', exchange: NULL_ADDRESS, assetProxyOwner: '0x8d42e38980ce74736c21c059b2240df09958d3c8', forwarder: '0xaa86dda78e9434aca114b6676fc742a18d15a1cc', orderValidator: '0x4d3d5c850dd5bd9d6f4adda3dd039a3c8054ca29', dutchAuction: '0xa31e64ea55b9b6bbb9d6a676738e9a5b23149f84', ======= exchange: '0x48bacb9266a570d521063ef5dd96e61686dbe788', assetProxyOwner: NULL_ADDRESS, forwarder: NULL_ADDRESS, orderValidator: NULL_ADDRESS, dutchAuction: NULL_ADDRESS, >>>>>>> exchangeV2: '0x48bacb9266a570d521063ef5dd96e61686dbe788', exchange: '0x48bacb9266a570d521063ef5dd96e61686dbe788', assetProxyOwner: NULL_ADDRESS, forwarder: NULL_ADDRESS, orderValidator: NULL_ADDRESS, dutchAuction: NULL_ADDRESS,
<<<<<<< command: Command; RegExp: any; ======= command: typeof Command; >>>>>>> command: typeof Command; RegExp: any;
<<<<<<< import { getSassLoaderOption, recursiveMerge, REG_SCRIPTS, REG_SASS_SASS, REG_SASS_SCSS, REG_LESS, REG_STYLUS, REG_STYLE, REG_MEDIA, REG_FONT, REG_IMAGE, REG_VUE } from '@tarojs/runner-utils' ======= import { recursiveMerge, REG_SCRIPTS, REG_SASS, REG_LESS, REG_STYLUS, REG_STYLE, REG_MEDIA, REG_FONT, REG_IMAGE, REG_VUE } from '@tarojs/helper' import { getSassLoaderOption } from '@tarojs/runner-utils' >>>>>>> import { recursiveMerge, REG_SCRIPTS, REG_SASS_SASS, REG_SASS_SCSS, REG_LESS, REG_STYLUS, REG_STYLE, REG_MEDIA, REG_FONT, REG_IMAGE, REG_VUE } from '@tarojs/helper' import { getSassLoaderOption } from '@tarojs/runner-utils'
<<<<<<< import { GetDescriptor } from "../src/transformer/descriptor/descriptor"; ======= import { createFactoryExport } from './helpers'; >>>>>>> import { createFactoryExport } from './helpers'; import { GetDescriptor } from "../src/transformer/descriptor/descriptor"; <<<<<<< return GetDescriptor(node.typeArguments[0], typeChecker); ======= console.log(createFactoryExport); return getDescriptor(node.typeArguments[0], typeChecker); >>>>>>> console.log(createFactoryExport); return GetDescriptor(node.typeArguments[0], typeChecker);
<<<<<<< public static sourceOnly: boolean = false; ======= forceignore: any; public constructor() { if (fs.existsSync(".forceignore")) { this.forceignore = ignore().add( fs.readFileSync(".forceignore", "utf8").toString() ); } else { this.forceignore = ignore(); } } >>>>>>> public static sourceOnly: boolean = false; forceignore: any; public constructor() { if (fs.existsSync(".forceignore")) { this.forceignore = ignore().add( fs.readFileSync(".forceignore", "utf8").toString() ); } else { this.forceignore = ignore(); } }
<<<<<<< runtimePath?: string ======= blended: boolean >>>>>>> runtimePath?: string blended: boolean
<<<<<<< function Polygon(points:number[][]) : oc.TopoDS_Shape; ======= function Polygon(points:Number[][], wire?:Boolean) : oc.TopoDS_Shape; /** Creates a bspline from a list of 3-component lists (points). * This can be converted into an edge -> wire -> face via the respective BRepBuilderAPI functions. * Or used directly with BRepPrimAPI_MakeRevolution() * @example```let bspline = BSpline([[0,0,0], [40, 0, 50], [50, 0, 50]], true);```*/ function BSpline(points:Number[][], closed?:Boolean) : oc.Handle_Geom_BSplineCurve; >>>>>>> function Polygon(points:number[][], wire?:boolean) : oc.TopoDS_Shape; /** Creates a bspline from a list of 3-component lists (points). * This can be converted into an edge -> wire -> face via the respective BRepBuilderAPI functions. * Or used directly with BRepPrimAPI_MakeRevolution() * @example```let bspline = BSpline([[0,0,0], [40, 0, 50], [50, 0, 50]], true);```*/ function BSpline(points:number[][], closed?:boolean) : oc.Handle_Geom_BSplineCurve; <<<<<<< function ForEachFace(shape: oc.TopoDS_Shape, callback: (index: number, face: oc.TopoDS_Shape) => void): void; ======= function ForEachFace(shape: oc.TopoDS_Shape, callback: (index: Number, face: oc.TopoDS_Face) => void): void; >>>>>>> function ForEachFace(shape: oc.TopoDS_Shape, callback: (index: number, face: oc.TopoDS_Face) => void): void; <<<<<<< function ForEachEdge(shape: oc.TopoDS_Shape, callback: (index: number, edge: oc.TopoDS_Shape) => void): {[edgeHash: number]: number}[]; ======= function ForEachEdge(shape: oc.TopoDS_Shape, callback: (index: Number, edge: oc.TopoDS_Edge) => void): {[edgeHash:number] : Number}[]; >>>>>>> function ForEachEdge(shape: oc.TopoDS_Shape, callback: (index: number, edge: oc.TopoDS_Edge) => void): {[edgeHash:number] : Number}[];
<<<<<<< ======= import lab from '../labs/lab-slice' import incident from '../incidents/incident-slice' import incidents from '../incidents/incidents-slice' import labs from '../labs/labs-slice' import breadcrumbs from '../breadcrumbs/breadcrumbs-slice' import components from '../components/component-slice' >>>>>>>
<<<<<<< getScrollPositions, getMaxDate, getMinDate, getScrollbarWidth ======= getScrollPositions, getMaxDate, getMinDate, coerceDate >>>>>>> getScrollPositions, getMaxDate, getMinDate, getScrollbarWidth, coerceDate <<<<<<< updateGridHeaderWidth(this); ======= this.chartRowDateToX = function (date) { return getOffset(vMinDate, date, vColWidth, this.vFormat); } >>>>>>> updateGridHeaderWidth(this); this.chartRowDateToX = function (date) { return getOffset(vMinDate, date, vColWidth, this.vFormat); }
<<<<<<< addListenerDependencies(this.vLineOptions); ======= addListenerDependencies(); if (this.vEvents && typeof this.vEvents.afterLineDraw === 'function') { this.vEvents.afterLineDraw(); } >>>>>>> addListenerDependencies(this.vLineOptions); if (this.vEvents && typeof this.vEvents.afterLineDraw === 'function') { this.vEvents.afterLineDraw(); }
<<<<<<< updateGridHeaderWidth(this); ======= if (this.vEvents && this.vEvents.afterDraw) { this.vEvents.afterDraw() } >>>>>>> updateGridHeaderWidth(this); if (this.vEvents && this.vEvents.afterDraw) { this.vEvents.afterDraw() }
<<<<<<< public async query(sql: string, params?: any[]|{}, options?:SqlQueryOptions): Promise<any[]> { ======= async query(sql: string, params?: any[], options?:SqlQueryOptions): Promise<any[]> async query(sql: string, params?: Object, options?:SqlQueryOptions): Promise<any[]> async query(sql: string, params?: any, options?:SqlQueryOptions): Promise<any[]> { >>>>>>> async query(sql: string, params?: any[]|{}, options?:SqlQueryOptions): Promise<any[]> { <<<<<<< /** * If the callback function return true, the connection will be closed. */ public async queryWithOnCursorCallback(sql: string, params: any[]|{}, options:SqlQueryOptions, callback:(any)=>boolean): Promise<void> { ======= async queryWithOnCursorCallback(sql: string, params: any[], callback:(any)=>void): Promise<void> async queryWithOnCursorCallback(sql: string, params: Object, callback:(any)=>void): Promise<void> async queryWithOnCursorCallback(sql: string, params: any, callback:(any)=>void): Promise<void> { >>>>>>> /** * If the callback function return true, the connection will be closed. */ async queryWithOnCursorCallback(sql: string, params: any[]|{}, options:SqlQueryOptions, callback:(any)=>boolean): Promise<void> { <<<<<<< public async queryAsStream(sql: string, params?: any[]|{}, options?:SqlQueryOptions): Promise<ReadableStream> { ======= async queryAsStream(sql: string, params?: any[], options?:SqlQueryOptions): Promise<Readable> async queryAsStream(sql: string, params?: Object, options?:SqlQueryOptions): Promise<Readable> async queryAsStream(sql: string, params?: any, options?:SqlQueryOptions): Promise<Readable> { >>>>>>> async queryAsStream(sql: string, params?: any[]|{}, options?:SqlQueryOptions): Promise<ReadableStream> { <<<<<<< public async queryOneField(sql: string, params?: any[]|{}, options?:SqlQueryOptions): Promise<any> { ======= async queryOneField(sql: string, params?: any[], options?:SqlQueryOptions): Promise<any> async queryOneField(sql: string, params?: Object, options?:SqlQueryOptions): Promise<any> async queryOneField(sql: string, params?: any, options?:SqlQueryOptions): Promise<any> { >>>>>>> async queryOneField(sql: string, params?: any[]|{}, options?:SqlQueryOptions): Promise<any> { <<<<<<< public async queryOneColumn(sql: string, params?: any[]|{}, options?:SqlQueryOptions): Promise<any[]> { ======= async queryOneColumn(sql: string, params?: any[], options?:SqlQueryOptions): Promise<any[]> async queryOneColumn(sql: string, params?: Object, options?:SqlQueryOptions): Promise<any[]> async queryOneColumn(sql: string, params?: any, options?:SqlQueryOptions): Promise<any[]> { >>>>>>> async queryOneColumn(sql: string, params?: any[]|{}, options?:SqlQueryOptions): Promise<any[]> {
<<<<<<< // Listen for files upload ipcMain.on('database-file-submission', (event, filePaths: any) => { console.log('file paths sent from renderer', filePaths); splashWindow.close(); }); ======= >>>>>>>
<<<<<<< const { exec } = require("child_process"); const db = require('./modal'); ======= const { exec } = require('child_process'); const appMenu = require('./mainMenu'); >>>>>>> const { exec } = require("child_process"); const appMenu = require('./mainMenu'); const db = require('./modal'); <<<<<<< ======= >>>>>>> <<<<<<< // ---------Refactor------------------- console.log('query sent from frontend', data.queryString); //Checking to see if user wants to change db if(data.queryString[0] === '\\' && data.queryString[1] === 'c'){ let dbName = data.queryString.slice(3); db.changeDB(dbName); console.log("getConnectionString") db.getConnectionString(); event.sender.send('return-execute-query', `Connected to database ${dbName}`); }else{ //If normal query db.query(data.queryString) .then(returnedData => { //Getting data in row format for frontend returnedData = returnedData.rows; // Send result back to renderer event.sender.send('return-execute-query', returnedData); }) } ======= const responseObj: any = {}; exec( `docker exec postgres-1 psql -h localhost -p 5432 -U postgres -d test -c "EXPLAIN (FORMAT JSON, ANALYZE) ${data.queryString}"`, (error, stdout, stderr) => { if (error) { console.log(`error: ${error.message}`); return; } if (stderr) { console.log(`stderr: ${stderr}`); return; } console.log(`stdout-analyze: ${stdout}`); stdout = stdout .slice(stdout.indexOf('['), stdout.lastIndexOf(']') + 1) .split('+') .join(''); responseObj.analyze = stdout; responseObj.queryLabel = data.queryLabel; // event.sender.send('return-execute-query', stdout); exec( `docker exec postgres-1 psql -h localhost -p 5432 -U postgres -d test -c "${data.queryString}"`, (error, stdout, stderr) => { if (error) { console.log(`error: ${error.message}`); return; } if (stderr) { console.log(`stderr: ${stderr}`); return; } responseObj.data = stdout; console.log(`stdout-data: ${typeof stdout}`); // stdout = stdout.slice(stdout.indexOf("["), stdout.lastIndexOf("]") + 1).split("+").join(""); event.sender.send('return-execute-query', responseObj); } ); } ); >>>>>>> // ---------Refactor------------------- console.log('query sent from frontend', data.queryString); //Checking to see if user wants to change db if(data.queryString[0] === '\\' && data.queryString[1] === 'c'){ let dbName = data.queryString.slice(3); db.changeDB(dbName); console.log("getConnectionString") db.getConnectionString(); event.sender.send('return-execute-query', `Connected to database ${dbName}`); }else{ //If normal query db.query(data.queryString) .then(returnedData => { //Getting data in row format for frontend returnedData = returnedData.rows; // Send result back to renderer event.sender.send('return-execute-query', returnedData); }) }
<<<<<<< // conditional to get the correct schemaFilePath name from the Load Schema Modal if (!data.schemaFilePath) { ======= if (!data.schemaFilePath) { >>>>>>> // conditional to get the correct schemaFilePath name from the Load Schema Modal if (!data.schemaFilePath) { <<<<<<< ======= console.log(filePath); >>>>>>>
<<<<<<< } export function isEmpty(str: any): boolean { return (!str || '' === str); } export function isNotEmpty(str: any): boolean { return <boolean>(str && '' !== str); ======= } // One-time use timer for performance testing export class Timer { private _startTime: number[]; private _endTime: number[]; constructor() { this.start(); } // Get the duration of time elapsed by the timer, in milliseconds public getDuration(): number { if (!this._startTime || !this._endTime) { return -1; } else { return this._endTime[0] * 1000 + this._endTime[1] / 1000000; } } public start(): void { this._startTime = process.hrtime(); } public end(): void { if (!this._endTime) { this._endTime = process.hrtime(this._startTime); } } >>>>>>> } export function isEmpty(str: any): boolean { return (!str || '' === str); } export function isNotEmpty(str: any): boolean { return <boolean>(str && '' !== str); } // One-time use timer for performance testing export class Timer { private _startTime: number[]; private _endTime: number[]; constructor() { this.start(); } // Get the duration of time elapsed by the timer, in milliseconds public getDuration(): number { if (!this._startTime || !this._endTime) { return -1; } else { return this._endTime[0] * 1000 + this._endTime[1] / 1000000; } } public start(): void { this._startTime = process.hrtime(); } public end(): void { if (!this._endTime) { this._endTime = process.hrtime(this._startTime); } }
<<<<<<< this.registerCommand(Constants.cmdCreateProfile); this._event.on(Constants.cmdCreateProfile, () => { self.onCreateProfile(); }); this.registerCommand(Constants.cmdRemoveProfile); this._event.on(Constants.cmdRemoveProfile, () => { self.onRemoveProfile(); }); ======= this.registerCommand(Constants.cmdChooseDatabase); this._event.on(Constants.cmdChooseDatabase, () => { self.onChooseDatabase(); } ); >>>>>>> this.registerCommand(Constants.cmdCreateProfile); this._event.on(Constants.cmdCreateProfile, () => { self.onCreateProfile(); }); this.registerCommand(Constants.cmdRemoveProfile); this._event.on(Constants.cmdRemoveProfile, () => { self.onRemoveProfile(); }); this.registerCommand(Constants.cmdChooseDatabase); this._event.on(Constants.cmdChooseDatabase, () => { self.onChooseDatabase(); } );
<<<<<<< import { LanguageClient, LanguageClientOptions, ServerOptions, TransportKind, RequestType, NotificationType, INotificationHandler } from 'vscode-languageclient'; ======= import { LanguageClient, LanguageClientOptions, ServerOptions, TransportKind } from 'vscode-languageclient'; import * as Utils from '../models/utils'; import {VersionRequest} from '../models/contracts'; import Constants = require('../models/constants'); >>>>>>> import { LanguageClient, LanguageClientOptions, ServerOptions, TransportKind, RequestType, NotificationType, INotificationHandler } from 'vscode-languageclient'; import * as Utils from '../models/utils'; import {VersionRequest} from '../models/contracts'; import Constants = require('../models/constants'); <<<<<<< this.client = new LanguageClient('sqlserverclient', serverOptions, clientOptions); ======= this._client = new LanguageClient('sqlserverclient', serverOptions, clientOptions); this._client.onReady().then( () => { this.checkServiceCompatibility(); }); >>>>>>> this.client = new LanguageClient('sqlserverclient', serverOptions, clientOptions); this.client.onReady().then( () => { this.checkServiceCompatibility(); }); <<<<<<< /** * Send a request to the service client * @param type The of the request to make * @param params The params to pass with the request * @returns A thenable object for when the request receives a response */ public sendRequest<P, R, E>(type: RequestType<P, R, E>, params?: P): Thenable<R> { return this.client.sendRequest(type, params); } /** * Register a handler for a notification type * @param type The notification type to register the handler for * @param handler The handler to register */ public onNotification<P>(type: NotificationType<P>, handler: INotificationHandler<P>): void { return this.client.onNotification(type, handler); } ======= public checkServiceCompatibility(): Promise<boolean> { return new Promise<boolean>((resolve, reject) => { this._client.sendRequest(VersionRequest.type).then((result) => { Utils.logDebug('sqlserverclient version: ' + result); if (!result || !result.startsWith(Constants.serviceCompatibleVersion)) { Utils.showErrorMsg(Constants.serviceNotCompatibleError); Utils.logDebug(Constants.serviceNotCompatibleError); resolve(false); } else { resolve(true); } }); }); } >>>>>>> /** * Send a request to the service client * @param type The of the request to make * @param params The params to pass with the request * @returns A thenable object for when the request receives a response */ public sendRequest<P, R, E>(type: RequestType<P, R, E>, params?: P): Thenable<R> { return this.client.sendRequest(type, params); } /** * Register a handler for a notification type * @param type The notification type to register the handler for * @param handler The handler to register */ public onNotification<P>(type: NotificationType<P>, handler: INotificationHandler<P>): void { return this.client.onNotification(type, handler); } public checkServiceCompatibility(): Promise<boolean> { return new Promise<boolean>((resolve, reject) => { this._client.sendRequest(VersionRequest.type).then((result) => { Utils.logDebug('sqlserverclient version: ' + result); if (!result || !result.startsWith(Constants.serviceCompatibleVersion)) { Utils.showErrorMsg(Constants.serviceNotCompatibleError); Utils.logDebug(Constants.serviceNotCompatibleError); resolve(false); } else { resolve(true); } }); });
<<<<<<< export { BumperService } from "https://raw.githubusercontent.com/drashland/services/master/ci/bumper_service.ts"; export { green, red } from "https://deno.land/[email protected]/fmt/colors.ts"; ======= export { green, red } from "https://deno.land/[email protected]/fmt/colors.ts"; >>>>>>> export { BumperService } from "https://raw.githubusercontent.com/drashland/services/master/ci/bumper_service.ts"; export { green, red } from "https://deno.land/[email protected]/fmt/colors.ts";
<<<<<<< ); Rhum.asserts.assertEquals(await response.text(), '{"name":"Medium"}'); // TODO(crookse) application/x-www-form-urlencoded works, but this test // keeps failing. Fix. // data = { id: 18 }; // response = await members.fetch.get("http://localhost:3000/coffee/19/?location=from_body", { // headers: { // "Content-Type": "application/x-www-form-urlencoded;charset=UTF-8", // "Content-Length": JSON.stringify(data).length // }, // body: JSON.stringify(data) // }); // Rhum.asserts.assertEquals(await response.text(), "{\"name\":\"Medium\"}"); }); ======= body: data, }, ); members.assertEquals(await response.text(), '{"name":"Medium"}'); data = "id=19"; response = await members.fetch.get( "http://localhost:3000/coffee/19/?location=from_body", { headers: { "Content-Type": "application/x-www-form-urlencoded;charset=UTF-8", "Content-Length": data.length + 1, }, body: data, }, ); members.assertEquals(await response.text(), '{"name":"Dark"}'); >>>>>>> ); Rhum.asserts.assertEquals(await response.text(), '{"name":"Medium"}'); data = "id=19"; response = await members.fetch.get( "http://localhost:3000/coffee/19/?location=from_body", { headers: { "Content-Type": "application/x-www-form-urlencoded;charset=UTF-8", "Content-Length": data.length + 1, }, body: data, }, ); Rhum.asserts.assertEquals(await response.text(), '{"name":"Dark"}'); });
<<<<<<< export const version = "v1.2.4"; ======= export const version: string = "v1.2.5"; >>>>>>> export const version = "v1.2.5";
<<<<<<< export { green, red } from "https://deno.land/[email protected]/fmt/colors.ts"; export { IndexService } from "../services/index/index_service.ts"; ======= export { green, red } from "https://deno.land/[email protected]/fmt/colors.ts"; >>>>>>> export { green, red } from "https://deno.land/[email protected]/fmt/colors.ts"; export { IndexService } from "../services/index/index_service.ts";
<<<<<<< import { Point, LineChartOptions } from '@t/options'; ======= import { LineSeriesOptions } from '@t/options'; >>>>>>> import { LineChartOptions, LineSeriesOptions } from '@t/options'; <<<<<<< const pointOnColumn = options.xAxis?.pointOnColumn || true; ======= >>>>>>>