aboutsummaryrefslogtreecommitdiffstats
path: root/packages/website/ts/utils/constants.ts
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2017-11-29 01:16:35 +0800
committerFabio Berger <me@fabioberger.com>2017-11-29 01:16:35 +0800
commit3472bdcfd4ea0a6145dd68972f563e483baf7e6b (patch)
tree6ed8d25cd58cd243aaf94af37f4e9d1d6a98fc85 /packages/website/ts/utils/constants.ts
parent78f0ab36823127b67c1ea24b7245c51ba814b16a (diff)
downloaddexon-sol-tools-3472bdcfd4ea0a6145dd68972f563e483baf7e6b.tar
dexon-sol-tools-3472bdcfd4ea0a6145dd68972f563e483baf7e6b.tar.gz
dexon-sol-tools-3472bdcfd4ea0a6145dd68972f563e483baf7e6b.tar.bz2
dexon-sol-tools-3472bdcfd4ea0a6145dd68972f563e483baf7e6b.tar.lz
dexon-sol-tools-3472bdcfd4ea0a6145dd68972f563e483baf7e6b.tar.xz
dexon-sol-tools-3472bdcfd4ea0a6145dd68972f563e483baf7e6b.tar.zst
dexon-sol-tools-3472bdcfd4ea0a6145dd68972f563e483baf7e6b.zip
Refactor docs to be more declarative, put all hard-coded doc-related data in one place so it easier to add new doc pages
Diffstat (limited to 'packages/website/ts/utils/constants.ts')
-rw-r--r--packages/website/ts/utils/constants.ts131
1 files changed, 24 insertions, 107 deletions
diff --git a/packages/website/ts/utils/constants.ts b/packages/website/ts/utils/constants.ts
index 77a6e3e38..f307df929 100644
--- a/packages/website/ts/utils/constants.ts
+++ b/packages/website/ts/utils/constants.ts
@@ -5,12 +5,18 @@ import {
ExchangeContractErrs,
Networks,
PublicNodeUrlsByNetworkId,
- SmartContractsDocSections,
WebsitePaths,
- ZeroExJsDocSections,
} from 'ts/types';
const INFURA_API_KEY = 'T5WSC8cautR4KXyYgsRs';
+const smartContractDocSections = {
+ Introduction: 'Introduction',
+ Exchange: 'Exchange',
+ TokenTransferProxy: 'TokenTransferProxy',
+ TokenRegistry: 'TokenRegistry',
+ ZRXToken: 'ZRXToken',
+ EtherToken: 'EtherToken',
+};
export const constants = {
ANGELLIST_URL: 'https://angel.co/0xproject/jobs',
@@ -27,7 +33,6 @@ export const constants = {
FEE_RECIPIENT_ADDRESS: '0x0000000000000000000000000000000000000000',
FIREFOX_U2F_ADDON: 'https://addons.mozilla.org/en-US/firefox/addon/u2f-support-add-on/',
GITHUB_URL: 'https://github.com/0xProject',
- GITHUB_0X_JS_URL: 'https://github.com/0xProject/0x.js',
GITHUB_CONTRACTS_URL: 'https://github.com/0xProject/contracts',
GITHUB_WIKI_URL: 'https://github.com/0xProject/wiki',
HTTP_NO_CONTENT_STATUS_CODE: 204,
@@ -67,8 +72,6 @@ export const constants = {
REDDIT_URL: 'https://reddit.com/r/0xproject',
STANDARD_RELAYER_API_GITHUB: 'https://github.com/0xProject/standard-relayer-api/blob/master/README.md',
SUCCESS_STATUS: 200,
- S3_0XJS_DOCUMENTATION_JSON_ROOT: 'https://s3.amazonaws.com/0xjs-docs-jsons',
- S3_SMART_CONTRACTS_DOCUMENTATION_JSON_ROOT: 'https://s3.amazonaws.com/smart-contracts-docs-json',
UNAVAILABLE_STATUS: 503,
TAKER_FEE: new BigNumber(0),
TESTNET_NAME: 'Kovan',
@@ -154,119 +157,33 @@ export const constants = {
[Networks.rinkeby]: 4,
[Networks.kovan]: 42,
} as {[networkName: string]: number},
- // 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 :(
- public0xjsTypes: [
- 'Order',
- 'SignedOrder',
- 'ECSignature',
- 'ZeroExError',
- 'EventCallback',
- 'EventCallbackAsync',
- 'EventCallbackSync',
- 'ExchangeContractErrs',
- 'ContractEvent',
- 'Token',
- 'ExchangeEvents',
- 'IndexedFilterValues',
- 'SubscriptionOpts',
- 'BlockParam',
- 'OrderFillOrKillRequest',
- 'OrderCancellationRequest',
- 'OrderFillRequest',
- 'ContractEventEmitter',
- 'Web3Provider',
- 'ContractEventArgs',
- 'LogCancelArgs',
- 'LogFillArgs',
- 'LogErrorContractEventArgs',
- 'LogFillContractEventArgs',
- 'LogCancelContractEventArgs',
- 'TokenEvents',
- 'ExchangeContractEventArgs',
- 'TransferContractEventArgs',
- 'ApprovalContractEventArgs',
- 'TokenContractEventArgs',
- 'ZeroExConfig',
- 'TransactionReceiptWithDecodedLogs',
- 'LogWithDecodedArgs',
- 'DecodedLogArgs',
- 'MethodOpts',
- 'ValidateOrderFillableOpts',
- 'OrderTransactionOpts',
- 'ContractEventArg',
- 'LogEvent',
- 'LogEntry',
- 'DecodedLogEvent',
- ],
- menuSmartContracts: {
- introduction: [
- SmartContractsDocSections.Introduction,
- ],
- contracts: [
- SmartContractsDocSections.Exchange,
- SmartContractsDocSections.TokenRegistry,
- SmartContractsDocSections.ZRXToken,
- SmartContractsDocSections.EtherToken,
- SmartContractsDocSections.TokenTransferProxy,
- ],
- },
- menu0xjs: {
- introduction: [
- ZeroExJsDocSections.introduction,
- ],
- install: [
- ZeroExJsDocSections.installation,
- ],
- topics: [
- ZeroExJsDocSections.async,
- ZeroExJsDocSections.errors,
- ZeroExJsDocSections.versioning,
- ],
- zeroEx: [
- ZeroExJsDocSections.zeroEx,
- ],
- contracts: [
- ZeroExJsDocSections.exchange,
- ZeroExJsDocSections.token,
- ZeroExJsDocSections.tokenRegistry,
- ZeroExJsDocSections.etherToken,
- ZeroExJsDocSections.proxy,
- ],
- types: [
- ZeroExJsDocSections.types,
- ],
- },
- menuSubsectionToVersionWhenIntroduced: {
- [ZeroExJsDocSections.etherToken]: '0.7.1',
- [ZeroExJsDocSections.proxy]: '0.8.0',
- },
docToPath: {
[Docs.ZeroExJs]: WebsitePaths.ZeroExJs,
[Docs.SmartContracts]: WebsitePaths.SmartContracts,
},
+ smartContractDocSections,
contractAddresses: {
'1.0.0': {
[Networks.mainnet]: {
- [SmartContractsDocSections.Exchange]: '0x12459c951127e0c374ff9105dda097662a027093',
- [SmartContractsDocSections.TokenTransferProxy]: '0x8da0d80f5007ef1e431dd2127178d224e32c2ef4',
- [SmartContractsDocSections.ZRXToken]: '0xe41d2489571d322189246dafa5ebde1f4699f498',
- [SmartContractsDocSections.EtherToken]: '0x2956356cd2a2bf3202f771f50d3d14a367b48070',
- [SmartContractsDocSections.TokenRegistry]: '0x926a74c5c36adf004c87399e65f75628b0f98d2c',
+ [smartContractDocSections.Exchange]: '0x12459c951127e0c374ff9105dda097662a027093',
+ [smartContractDocSections.TokenTransferProxy]: '0x8da0d80f5007ef1e431dd2127178d224e32c2ef4',
+ [smartContractDocSections.ZRXToken]: '0xe41d2489571d322189246dafa5ebde1f4699f498',
+ [smartContractDocSections.EtherToken]: '0x2956356cd2a2bf3202f771f50d3d14a367b48070',
+ [smartContractDocSections.TokenRegistry]: '0x926a74c5c36adf004c87399e65f75628b0f98d2c',
},
[Networks.ropsten]: {
- [SmartContractsDocSections.Exchange]: '0x479cc461fecd078f766ecc58533d6f69580cf3ac',
- [SmartContractsDocSections.TokenTransferProxy]: '0x4e9aad8184de8833365fea970cd9149372fdf1e6',
- [SmartContractsDocSections.ZRXToken]: '0xa8e9fa8f91e5ae138c74648c9c304f1c75003a8d',
- [SmartContractsDocSections.EtherToken]: '0xc00fd9820cd2898cc4c054b7bf142de637ad129a',
- [SmartContractsDocSections.TokenRegistry]: '0x6b1a50f0bb5a7995444bd3877b22dc89c62843ed',
+ [smartContractDocSections.Exchange]: '0x479cc461fecd078f766ecc58533d6f69580cf3ac',
+ [smartContractDocSections.TokenTransferProxy]: '0x4e9aad8184de8833365fea970cd9149372fdf1e6',
+ [smartContractDocSections.ZRXToken]: '0xa8e9fa8f91e5ae138c74648c9c304f1c75003a8d',
+ [smartContractDocSections.EtherToken]: '0xc00fd9820cd2898cc4c054b7bf142de637ad129a',
+ [smartContractDocSections.TokenRegistry]: '0x6b1a50f0bb5a7995444bd3877b22dc89c62843ed',
},
[Networks.kovan]: {
- [SmartContractsDocSections.Exchange]: '0x90fe2af704b34e0224bf2299c838e04d4dcf1364',
- [SmartContractsDocSections.TokenTransferProxy]: '0x087Eed4Bc1ee3DE49BeFbd66C662B434B15d49d4',
- [SmartContractsDocSections.ZRXToken]: '0x6ff6c0ff1d68b964901f986d4c9fa3ac68346570',
- [SmartContractsDocSections.EtherToken]: '0x05d090b51c40b020eab3bfcb6a2dff130df22e9c',
- [SmartContractsDocSections.TokenRegistry]: '0xf18e504561f4347bea557f3d4558f559dddbae7f',
+ [smartContractDocSections.Exchange]: '0x90fe2af704b34e0224bf2299c838e04d4dcf1364',
+ [smartContractDocSections.TokenTransferProxy]: '0x087Eed4Bc1ee3DE49BeFbd66C662B434B15d49d4',
+ [smartContractDocSections.ZRXToken]: '0x6ff6c0ff1d68b964901f986d4c9fa3ac68346570',
+ [smartContractDocSections.EtherToken]: '0x05d090b51c40b020eab3bfcb6a2dff130df22e9c',
+ [smartContractDocSections.TokenRegistry]: '0xf18e504561f4347bea557f3d4558f559dddbae7f',
},
},
} as ContractAddresses,