diff options
Diffstat (limited to 'packages/0x.js')
-rw-r--r-- | packages/0x.js/package.json | 26 | ||||
-rw-r--r-- | packages/0x.js/src/0x.ts | 12 | ||||
-rw-r--r-- | packages/0x.js/src/index.ts | 71 | ||||
-rw-r--r-- | packages/0x.js/src/monorepo_scripts/postpublish.ts | 8 | ||||
-rw-r--r-- | packages/0x.js/src/monorepo_scripts/stage_docs.ts | 8 |
5 files changed, 52 insertions, 73 deletions
diff --git a/packages/0x.js/package.json b/packages/0x.js/package.json index cf7b1962f..83a08bce4 100644 --- a/packages/0x.js/package.json +++ b/packages/0x.js/package.json @@ -16,7 +16,7 @@ "types": "lib/src/index.d.ts", "scripts": { "watch_without_deps": "yarn pre_build && tsc -w", - "build": "yarn pre_build && yarn build:all && copyfiles -u 3 './lib/src/monorepo_scripts/**/*' ./scripts", + "build": "yarn pre_build && yarn build:all", "build:all": "run-p build:umd:prod build:commonjs; exit 0;", "pre_build": "run-s update_artifacts generate_contract_wrappers", "copy_artifacts": "copyfiles -u 2 './src/artifacts/**/*.json' ./lib/src/artifacts", @@ -28,14 +28,11 @@ "rebuild_and_test": "run-s build test", "test:coverage": "nyc npm run test --all && yarn coverage:report:lcov", "coverage:report:lcov": "nyc report --reporter=text-lcov > coverage/lcov.info", - "clean": "shx rm -rf _bundles lib test_temp scripts src/generated_contract_wrappers", + "clean": "shx rm -rf _bundles lib test_temp src/generated_contract_wrappers", "build:umd:prod": "NODE_ENV=production webpack", "build:commonjs": "tsc && yarn copy_artifacts && copyfiles -u 3 './lib/src/monorepo_scripts/**/*' ./scripts", "run_mocha": "mocha --require source-map-support/register --require make-promises-safe lib/test/**/*_test.js lib/test/global_hooks.js --timeout 10000 --bail --exit", - "manual:postpublish": "yarn build; node ./scripts/postpublish.js", - "docs:stage": "node scripts/stage_docs.js", - "docs:json": "typedoc --excludePrivate --excludeExternals --target ES5 --json $JSON_FILE_PATH $PROJECT_FILES", - "upload_docs_json": "aws s3 cp generated_docs/index.json $S3_URL --profile 0xproject --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers --content-type application/json" + "docs:json": "typedoc --excludePrivate --excludeExternals --target ES5 --json $JSON_FILE_PATH $PROJECT_FILES" }, "config": { "contracts": "ZRXToken", @@ -44,22 +41,7 @@ "packages/0x.js/_bundles/index.js", "packages/0x.js/_bundles/index.min.js" ], - "docPublishConfigs": { - "extraFileIncludes": [ - "../types/src/index.ts", - "../ethereum-types/src/index.ts", - "../contract-wrappers/src/types.ts", - "../contract-wrappers/src/contract_wrappers/ether_token_wrapper.ts", - "../contract-wrappers/src/contract_wrappers/exchange_wrapper.ts", - "../contract-wrappers/src/contract_wrappers/erc20_proxy_wrapper.ts", - "../contract-wrappers/src/contract_wrappers/erc721_proxy_wrapper.ts", - "../contract-wrappers/src/contract_wrappers/erc20_token_wrapper.ts", - "../contract-wrappers/src/contract_wrappers/erc721_token_wrapper.ts", - "../order-watcher/src/order_watcher/order_watcher.ts" - ], - "s3BucketPath": "s3://doc-jsons/0x.js/", - "s3StagingBucketPath": "s3://staging-doc-jsons/0x.js/" - } + "shouldPublishDocs": true } }, "repository": { diff --git a/packages/0x.js/src/0x.ts b/packages/0x.js/src/0x.ts index 48d00c1ac..cdcdac474 100644 --- a/packages/0x.js/src/0x.ts +++ b/packages/0x.js/src/0x.ts @@ -9,13 +9,7 @@ import { EtherTokenWrapper, ExchangeWrapper, } from '@0xproject/contract-wrappers'; -import { - assetDataUtils, - ecSignOrderHashAsync, - generatePseudoRandomSalt, - isValidSignatureAsync, - orderHashUtils, -} from '@0xproject/order-utils'; +import { assetDataUtils, generatePseudoRandomSalt, signatureUtils, orderHashUtils } from '@0xproject/order-utils'; // HACK: Since we export assetDataUtils from ZeroEx and it has AssetProxyId, ERC20AssetData and ERC721AssetData // in it's public interface, we need to import these types here. // tslint:disable-next-line:no-unused-variable @@ -197,7 +191,7 @@ export class ZeroEx { * @return Whether the signature is valid for the supplied signerAddress and data. */ public async isValidSignatureAsync(data: string, signature: string, signerAddress: string): Promise<boolean> { - const isValid = await isValidSignatureAsync( + const isValid = await signatureUtils.isValidSignatureAsync( this._contractWrappers.getProvider(), data, signature, @@ -247,7 +241,7 @@ export class ZeroEx { signerAddress: string, signerType: SignerType = SignerType.Default, ): Promise<string> { - const signature = await ecSignOrderHashAsync( + const signature = await signatureUtils.ecSignOrderHashAsync( this._contractWrappers.getProvider(), orderHash, signerAddress, diff --git a/packages/0x.js/src/index.ts b/packages/0x.js/src/index.ts index 2ba60e730..5e465c38c 100644 --- a/packages/0x.js/src/index.ts +++ b/packages/0x.js/src/index.ts @@ -1,32 +1,13 @@ export { ZeroEx } from './0x'; -export { Web3ProviderEngine, RPCSubprovider } from '@0xproject/subproviders'; - export { - ExchangeContractErrs, - Order, - SignedOrder, - SignerType, - ECSignature, - OrderStateValid, - OrderStateInvalid, - OrderState, - Token, - ERC20AssetData, - ERC721AssetData, - AssetProxyId, -} from '@0xproject/types'; - -export { - BlockParamLiteral, - FilterObject, - BlockParam, - LogWithDecodedArgs, - ContractEventArg, - Provider, - TransactionReceipt, - TransactionReceiptWithDecodedLogs, -} from 'ethereum-types'; + Web3ProviderEngine, + RPCSubprovider, + Callback, + JSONRPCRequestPayloadWithMethod, + ErrorCallback, + Subprovider, +} from '@0xproject/subproviders'; export { EventCallback, @@ -52,15 +33,53 @@ export { ERC20TokenApprovalEventArgs, ERC20TokenEvents, ERC20TokenEventArgs, + ERC721TokenEventArgs, ERC721TokenApprovalEventArgs, ERC721TokenApprovalForAllEventArgs, ERC721TokenTransferEventArgs, ERC721TokenEvents, ExchangeCancelUpToEventArgs, ExchangeAssetProxyRegisteredEventArgs, + ExchangeSignatureValidatorApprovalEventArgs, ExchangeFillEventArgs, ExchangeCancelEventArgs, ExchangeEventArgs, ContractWrappersConfig, OrderInfo, } from '@0xproject/contract-wrappers'; + +export { + ExchangeContractErrs, + Order, + SignedOrder, + ECSignature, + OrderStateValid, + OrderStateInvalid, + OrderState, + Token, + ERC20AssetData, + ERC721AssetData, + AssetProxyId, + OrderRelevantState, +} from '@0xproject/types'; + +export { + BlockParamLiteral, + FilterObject, + BlockParam, + LogWithDecodedArgs, + ContractEventArg, + Provider, + TransactionReceipt, + TransactionReceiptWithDecodedLogs, + LogTopic, + JSONRPCRequestPayload, + JSONRPCResponsePayload, + JSONRPCErrorCallback, + TransactionReceiptStatus, + LogEntry, + DecodedLogArgs, + LogEntryEvent, + DecodedLogEntry, + DecodedLogEntryEvent, +} from 'ethereum-types'; diff --git a/packages/0x.js/src/monorepo_scripts/postpublish.ts b/packages/0x.js/src/monorepo_scripts/postpublish.ts deleted file mode 100644 index dcb99d0f7..000000000 --- a/packages/0x.js/src/monorepo_scripts/postpublish.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { postpublishUtils } from '@0xproject/monorepo-scripts'; - -import * as packageJSON from '../package.json'; -import * as tsConfigJSON from '../tsconfig.json'; - -const cwd = `${__dirname}/..`; -// tslint:disable-next-line:no-floating-promises -postpublishUtils.runAsync(packageJSON, tsConfigJSON, cwd); diff --git a/packages/0x.js/src/monorepo_scripts/stage_docs.ts b/packages/0x.js/src/monorepo_scripts/stage_docs.ts deleted file mode 100644 index e732ac8eb..000000000 --- a/packages/0x.js/src/monorepo_scripts/stage_docs.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { postpublishUtils } from '@0xproject/monorepo-scripts'; - -import * as packageJSON from '../package.json'; -import * as tsConfigJSON from '../tsconfig.json'; - -const cwd = `${__dirname}/..`; -// tslint:disable-next-line:no-floating-promises -postpublishUtils.publishDocsToStagingAsync(packageJSON, tsConfigJSON, cwd); |