-
Notifications
You must be signed in to change notification settings - Fork 2
/
api.ts
158 lines (155 loc) · 7.83 KB
/
api.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
import { stringify } from "qs";
export const API = {
ADDRESS: {
ANALYTICS: "addresses/analytics",
DETAIL: "addresses",
MIN_MAX_BALANCE: "addresses/min-max-balance",
TOP_ADDRESS: "addresses/top-addresses",
TOKENS: "addresses/:address/tokens",
VIEW_ADRRESSES: (txHash: string, scriptHash: string) => `scripts/contract-executions/${txHash}/${scriptHash}`
},
BLOCK: {
DETAIL: "blocks",
LIST: "blocks"
},
CONTRACT: "contracts",
DELEGATION: {
HEADER: "delegations/header",
POOL_ANALYTICS: "delegations/pool-detail-analytics",
POOL_DETAIL_HEADER: "delegations/pool-detail-header",
POOL_DETAIL: (tab: "epochs" | "delegators") => `delegations/pool-detail-${tab}`,
POOL_LIST: "delegations/pool-list",
TOP: "delegations/top"
},
EPOCH: {
CURRENT_EPOCH: "epochs/current",
DETAIL: "epochs",
LIST: "epochs"
},
POLICY: "policies",
SCRIPTS_SEARCH: "scripts/search",
POOL: "pools",
POOL_CERTIFICATE: {
POOL: "gov-actions",
POOL_CHART: "gov-actions/voting-chart",
POOL_DETAIL: (poolId: string) => `gov-actions/${poolId}/voting-procedure-detail`
},
POOL_CERTIFICATES_HISTORY: "pools/certificates-history",
DREP_CERTIFICATES_HISTORY: "dreps/:drepId/certificates-history",
DREP_OVERVIEW: "dreps/:drepId/drep-details",
DREP_OVERVIEW_CHART: "dreps/:drepId/vote-procedure-chart",
DREP_DELEGATOR: "dreps/:drepId/get-delegation",
TOKEN: {
LIST: "tokens",
TOKEN_TRX: "tokens/:tokenId/txs",
ANALYTICS: "tokens/analytics",
NATIVE_SCRIPT: (scriptHash: string) => "scripts/native-scripts/" + scriptHash,
VERIFY_SCRIPT: (scriptHash: string) => `scripts/native-scripts/${scriptHash}/verify`,
TOKENS_SCRIPTED: (scriptHash: string) => `scripts/native-scripts/${scriptHash}/tokens`,
TOKEN_HOLDERS: (scriptHash: string) => `scripts/native-scripts/${scriptHash}/holders`,
POLICIES: (scriptHash: string) => `/policies/${scriptHash}`
},
TRANSACTION: {
CURRENT: "txs/current",
DETAIL: "txs",
LIST: "txs",
GRAPH: "txs/graph",
HASH_CONTRACT: (txHash: string, address: string) => `txs/${txHash}/contract?address=${address}`,
WINERY_DETAIL: (txHash: string, wineryId: string) => `txs/${txHash}/${wineryId}`
},
STAKE: {
ANALYTICS: "stakes/analytics",
ANALYTICS_BALANCE: "stakes/analytics-balance",
ANALYTICS_REWARD: "stakes/analytics-reward",
DETAIL: "stakes",
DE_REGISTRATION: "stakes/de-registration",
TOP_DELEGATOR: "stakes/top-delegators",
REGISTRATION: "stakes/registration",
MIN_MAX_BALANCE: "stakes/min-max-balance",
STAKE_DELEGATIONS: "delegations",
INSTANT_REWARDS: "instantaneous-rewards",
REWARDS_DISTRIBUTION: "stakes/reward-distribution"
},
STAKE_LIFECYCLE: {
REGISTRATION: (stakeKey: string) => `stake-lifecycle/${stakeKey}/registrations`,
REGISTRATION_DETAIL: (stakeKey: string, hash: string) => `stake-lifecycle/${stakeKey}/registrations/${hash}`,
DELEGATION: (stakeKey: string) => `stake-lifecycle/${stakeKey}/delegations`,
DELEGATION_DETAIL: (stakeKey: string, hash: string) => `stake-lifecycle/${stakeKey}/delegations/${hash}`,
WITHDRAW: (stakeKey: string) => `stake-lifecycle/${stakeKey}/withdrawals`,
WITHDRAW_DETAIL: (stakeKey: string, hash: string) => `stake-lifecycle/${stakeKey}/withdrawals/${hash}`,
DEREGISTRATION: (stakeKey: string) => `stake-lifecycle/${stakeKey}/de-registrations`,
DEREGISTRATION_DETAIL: (stakeKey: string, hash: string) => `stake-lifecycle/${stakeKey}/de-registrations/${hash}`,
RECEIVED_REWARD: (stakeKey: string) => `stake-lifecycle/${stakeKey}/rewards`,
WALLET_ACTIVITY: (stakeKey: string) => `stake-lifecycle/${stakeKey}/wallet-activity`,
REWARDS_ACTIVITY: (stakeKey: string) => `stake-lifecycle/${stakeKey}/reward-activity`,
TABS: (stakeKey: string) => `stake-lifecycle/${stakeKey}`
},
SPO_LIFECYCLE: {
SPO_REGISTRATION: (poolId: string) => `pool-lifecycle/registration?poolView=${poolId}`,
SPO_REGISTRATION_LIST: (poolId: string) => `pool-lifecycle/registration-list?poolView=${poolId}`,
SPO_REGISTRATION_DETAIl: (poolView: string, poolId: number) =>
`pool-lifecycle/registration-detail?poolView=${poolView}&id=${poolId}`,
POOL_UPDATE: (poolId: string) => `pool-lifecycle/pool-update?poolView=${poolId}`,
POOL_UPDATE_LIST: (poolId: string) => `pool-lifecycle/pool-update-list?poolView=${poolId}`,
POOL_UPDATE_DETAIL: (poolId: number) => `pool-lifecycle/pool-update-detail?id=${poolId}`,
POOL_INFO: (poolId: string) => `pool-lifecycle/pool-info?poolView=${poolId}`,
REWARD: (poolId: string) => `pool-lifecycle/reward?poolView=${poolId}`,
SPO_DEREGISTRATION: (poolId: string) => `pool-lifecycle/de-registration?poolView=${poolId}`,
SPO_POOL_INFO: (poolId: string) => `pool-lifecycle/pool-info?poolView=${poolId}`,
SPO_DEREGISTRATION_DETAIl: (poolView: string, poolId: number) =>
`pool-lifecycle/de-registration-detail?poolView=${poolView}&id=${poolId}`,
TABS: (poolView: string) => `/pool-lifecycle/status?poolView=${poolView}`
},
MARKETS: "markets",
PROTOCOL_PARAMETER: {
LASTEST: "protocols/latest",
HISTORY: "protocols/histories/filter",
FIXED: "protocols/fixed"
},
REPORT: {
STAKE_KEY_SUMMARY: `staking-lifecycle/report/stake-key/history`,
DOWNLOAD_STAKE_KEY_SUMMARY: (reportId: number) => `staking-lifecycle/report/stake-key/${reportId}/export`,
DOWNLOAD_POOL_SUMMARY: (reportId: number) => `pool-report/detail/${reportId}/export`,
POOL_REPORT_SUMMARY: `pool-report/list`,
DASHBOARD: `staking-lifecycle/report/dashboard`,
//report for staking
STAKING_REPORTED_DETAIL: (reportId: number | string) => `staking-lifecycle/report/stake-key/${reportId}/detail`,
SREPORT_DETAIL_REGISTRATIONS: (reportId: number | string) =>
`staking-lifecycle/report/stake-key/${reportId}/registrations`,
SREPORT_DETAIL_WITHDRAWALS: (reportId: number | string) =>
`staking-lifecycle/report/stake-key/${reportId}/withdrawals`,
SREPORT_DETAIL_REWARDS: (reportId: number | string) => `staking-lifecycle/report/stake-key/${reportId}/rewards`,
SREPORT_DETAIL_DELEGATIONS: (reportId: number | string) =>
`staking-lifecycle/report/stake-key/${reportId}/delegations`,
SREPORT_DETAIL_DEGEGISTRATIONS: (reportId: number | string) =>
`staking-lifecycle/report/stake-key/${reportId}/de-registrations`,
SREPORT_WALLET_ACTIVITY: (reportId: number | string) =>
`staking-lifecycle/report/stake-key/${reportId}/wallet-activity`,
//report for pool
POOL_REPORTED_DETAIL: (reportId: number | string) => `pool-report/detail/${reportId}`,
PREPORT_REGISTRATIONS: (reportId: number | string) => `pool-report/detail/${reportId}/pool-registration`,
PREPORT_PROTOCOL_UPDATE: (reportId: number | string) => `pool-report/detail/${reportId}/pool-update`,
PREPORT_REWARD_DISTRIBUTIONS: (reportId: number | string) => `pool-report/detail/${reportId}/rewards-distribution`,
PREPORT_DEREGSITRATION: (reportId: number | string) => `pool-report/detail/${reportId}/deregistration`,
PREPORT_EPOCH_SIZE: (reportId: number | string) => `pool-report/detail/${reportId}/epoch-size`,
REPORT_LIMIT: "staking-lifecycle/report/report-limit"
},
CONTRACTS: {
VERIFY_SCRIPT: "contracts/verify/native",
SCRIPT: (address: string) => `contracts/${address}/script`
},
STORIES: (query: { [key: string]: string | number }) => `news?${stringify(query)}`,
SEARCH_ALL: (query: string) => `/search?${stringify({ query })}`,
SCRIPTS: {
SMART_CONTRACTS: "scripts/contracts",
NATIVE_SCRIPTS: "scripts/native-scripts",
ASSOCIATED_ADDRESS: (scriptHash: string) => `scripts/contracts/${scriptHash}`,
SCRIPT_TXS_DETAIL: (scriptHash: string) => `scripts/contracts/${scriptHash}/txs`
},
ADAHandle: (name: string) => `/addresses/by-ada-handle/${name}`
};
export const USER_API = {
ACTIVITY_LOG: "user/activities-log",
INFO: "user/info",
BOOKMARK: "bookmark/find-all-key"
};