Commit f81cab4e authored by tom goriunov's avatar tom goriunov Committed by GitHub

add missing redirects from old URLs (#1080)

* add missing redirects from old URLs

Fixes #1078

* [skip ci] add more redirects
parent 7b8c9847
const oldUrls = [ const oldUrls = [
// ACCOUNT
{ {
oldPath: '/account/tag_transaction', source: '/account/tag_address',
newPath: '/account/tag_address?tab=tx', destination: '/account/tag-address',
}, },
{ {
oldPath: '/pending-transactions', source: '/account/tag_address/new',
newPath: '/txs?tab=pending', destination: '/account/tag-address',
}, },
{ {
oldPath: '/tx/:hash/internal-transactions', source: '/account/tag_transaction',
newPath: '/tx/:hash?tab=internal', destination: '/account/tag-address?tab=tx',
}, },
{ {
oldPath: '/tx/:hash/logs', source: '/account/tag_transaction/new',
newPath: '/tx/:hash?tab=logs', destination: '/account/tag-address?tab=tx',
}, },
{ {
oldPath: '/tx/:hash/raw-trace', source: '/account/watchlist_address/:id/edit',
newPath: '/tx/:hash?tab=raw_trace', destination: '/account/watchlist',
}, },
{ {
oldPath: '/tx/:hash/state', source: '/account/watchlist_address/new',
newPath: '/tx/:hash?tab=state', destination: '/account/watchlist',
}, },
{ {
oldPath: '/uncles', source: '/account/api_key',
newPath: '/blocks?tab=uncles', destination: '/account/api-key',
}, },
{ {
oldPath: '/reorgs', source: '/account/api_key/:id/edit',
newPath: '/blocks?tab=reorgs', destination: '/account/api-key',
}, },
{ {
oldPath: '/block/:height/transactions', source: '/account/api_key/new',
newPath: '/block/:height?tab=txs', destination: '/account/api-key',
}, },
{ {
oldPath: '/address/:hash/transactions', source: '/account/custom_abi',
newPath: '/address/:hash', destination: '/account/custom-abi',
}, },
{ {
oldPath: '/address/:hash/token-transfers', source: '/account/custom_abi/:id/edit',
newPath: '/address/:hash?tab=token_transfers', destination: '/account/custom-abi',
}, },
{ {
oldPath: '/address/:hash/tokens', source: '/account/custom_abi/new',
newPath: '/address/:hash?tab=tokens', destination: '/account/custom-abi',
}, },
{ {
oldPath: '/address/:hash/internal-transactions', source: '/account/public_tags_request',
newPath: '/address/:hash?tab=internal_txns', destination: '/account/public-tags-request',
}, },
{ {
oldPath: '/address/:hash/coin-balances', source: '/account/public_tags_request/:id/edit',
newPath: '/address/:hash?tab=coin_balance_history', destination: '/account/public-tags-request',
}, },
{ {
oldPath: '/address/:hash/validations', source: '/account/public_tags_request/new',
newPath: '/address/:hash?tab=blocks_validated', destination: '/account/public-tags-request',
},
// TRANSACTIONS
{
source: '/pending-transactions',
destination: '/txs?tab=pending',
},
{
source: '/tx/:hash/internal-transactions',
destination: '/tx/:hash?tab=internal',
},
{
source: '/tx/:hash/logs',
destination: '/tx/:hash?tab=logs',
},
{
source: '/tx/:hash/raw-trace',
destination: '/tx/:hash?tab=raw_trace',
},
{
source: '/tx/:hash/state',
destination: '/tx/:hash?tab=state',
},
{
source: '/tx/:hash/token-transfers',
destination: '/tx/:hash?tab=token_transfers',
},
// BLOCKS
{
source: '/blocks/:height/:path*',
destination: '/block/:height/:path*',
},
{
source: '/uncles',
destination: '/blocks?tab=uncles',
},
{
source: '/reorgs',
destination: '/blocks?tab=reorgs',
},
{
source: '/block/:height/transactions',
destination: '/block/:height?tab=txs',
},
{
source: '/block/:height/withdrawals',
destination: '/block/:height?tab=withdrawals',
},
// ADDRESS
{
source: '/address/:hash/transactions',
destination: '/address/:hash',
},
{
source: '/address/:hash/token-transfers',
destination: '/address/:hash?tab=token_transfers',
},
{
source: '/address/:hash/tokens',
destination: '/address/:hash?tab=tokens',
},
{
source: '/address/:hash/internal-transactions',
destination: '/address/:hash?tab=internal_txns',
},
{
source: '/address/:hash/coin-balances',
destination: '/address/:hash?tab=coin_balance_history',
},
{
source: '/address/:hash/logs',
destination: '/address/:hash?tab=logs',
},
{
source: '/address/:hash/validations',
destination: '/address/:hash?tab=blocks_validated',
},
{
source: '/address/:hash/contracts',
destination: '/address/:hash?tab=contract',
},
{
source: '/address/:hash/read-contract',
destination: '/address/:hash?tab=read_contract',
},
{
source: '/address/:hash/read-proxy',
destination: '/address/:hash?tab=read_proxy',
},
{
source: '/address/:hash/write-contract',
destination: '/address/:hash?tab=write_contract',
},
{
source: '/address/:hash/write-proxy',
destination: '/address/:hash?tab=write_proxy',
},
{
source: '/address/:hash/tokens/:token_hash/token-transfers',
destination: '/address/:hash?tab=token_transfers&token=:token_hash',
},
// CONTRACT VERIFICATION
{
source: '/address/:hash/contract_verifications/new',
destination: '/address/:hash/contract_verification',
},
{
source: '/address/:hash/verify-via-flattened-code/new',
destination: '/address/:hash/contract_verification?method=flatten_source_code',
},
{
source: '/address/:hash/verify-via-standard-json-input/new',
destination: '/address/:hash/contract_verification?method=standard_input',
},
{
source: '/address/:hash/verify-via-metadata-json/new',
destination: '/address/:hash/contract_verification?method=sourcify',
},
{
source: '/address/:hash/verify-via-multi-part-files/new',
destination: '/address/:hash/contract_verification?method=multi_part_file',
},
{
source: '/address/:hash/verify-vyper-contract/new',
destination: '/address/:hash/contract_verification?method=vyper_contract',
},
// TOKENS
{
source: '/tokens/:hash/:path*',
destination: '/token/:hash/:path*',
},
{
source: '/token/:hash/token-transfers',
destination: '/token/:hash',
},
{
source: '/token/:hash/token-holders',
destination: '/token/:hash/?tab=holders',
},
{
source: '/token/:hash/inventory',
destination: '/token/:hash/?tab=inventory',
}, },
{ {
oldPath: '/address/:hash/tokens/:token_hash/token-transfers', source: '/token/:hash/instance/:id/token-transfers',
newPath: '/address/:hash?tab=token_transfers&token=:token_hash', destination: '/token/:hash/instance/:id',
}, },
// contract verification
{ {
oldPath: '/address/:hash/contract_verifications/new', source: '/token/:hash/instance/:id/token-holders',
newPath: '/address/:hash/contract_verification', destination: '/token/:hash/instance/:id?tab=holders',
}, },
{ {
oldPath: '/address/:hash/verify-via-flattened-code/new', source: '/token/:hash/instance/:id/metadata',
newPath: '/address/:hash/contract_verification?method=flatten_source_code', destination: '/token/:hash/instance/:id?tab=metadata',
}, },
{ {
oldPath: '/address/:hash/verify-via-standard-json-input/new', source: '/token/:hash/read-contract',
newPath: '/address/:hash/contract_verification?method=standard_input', destination: '/token/:hash?tab=read_contract',
}, },
{ {
oldPath: '/address/:hash/verify-via-metadata-json/new', source: '/token/:hash/read-proxy',
newPath: '/address/:hash/contract_verification?method=sourcify', destination: '/token/:hash?tab=read_proxy',
}, },
{ {
oldPath: '/address/:hash/verify-via-multi-part-files/new', source: '/token/:hash/write-contract',
newPath: '/address/:hash/contract_verification?method=multi_part_file', destination: '/token/:hash?tab=write_contract',
}, },
{ {
oldPath: '/address/:hash/verify-vyper-contract/new', source: '/token/:hash/write-proxy',
newPath: '/address/:hash/contract_verification?method=vyper_contract', destination: '/token/:hash?tab=write_proxy',
}, },
]; ];
async function redirects() { async function redirects() {
return [ return [
...oldUrls.map(item => { ...oldUrls.map((item) => ({ ...item, permanent: false })),
const source = item.oldPath;
const destination = item.newPath;
return { source, destination, permanent: false };
}),
]; ];
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment