Skip to content

Commit 5a56526

Browse files
committed
refactor
1 parent dd618da commit 5a56526

File tree

8 files changed

+13
-24
lines changed

8 files changed

+13
-24
lines changed

.envrc_sample

-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,5 @@ export CHAIN_ID=tequila-0004
1616
export LCD_URI=https://tequila-lcd.terra.dev
1717
export FCD_URI=https://tequila-fcd.terra.dev
1818
export RPC_URI=
19-
export MIRROR_GRAPH_URI=https://tequila-graph.mirror.finance/graphql
20-
export STATION_STATUS_JSON=https://terra.money/station/version-web.json
2119
export SENTRY_DSN=
2220
#export USE_LOG_FILE=true

README.md

+2-8
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,8 @@
1515

1616
## Prerequisites
1717

18-
1. `Node.js` version 14 or later
19-
1. `PostgreSQL` version 12 or later
20-
21-
### Terra Core
22-
23-
1. Setup a LCD
24-
1. Configure firewall ([Reference](https://docs.terra.money/How-to/Run-a-full-Terra-node/Set-up-production-environment.html#configure-the-firewall))
18+
1. `Node.js` v16.x or later
19+
1. `PostgreSQL` v12.x or later
2520

2621
## Project setup
2722

@@ -79,7 +74,6 @@ module.exports = {
7974
| SENTRY_DSN | Sentry DSN for error management (optional) | | API, Collector |
8075
| SERVER_PORT | Listening port for API server | 3060 | API |
8176
| FCD_URI | FCD URI for Terra network | https://bombay-fcd.terra.dev | API |
82-
| STATION_STATUS_JSON | URL for Station version control | https://terra.money/station/version-web.json | API |
8377
| DISABLE_API | Disable REST APIs | false | API |
8478
| EXCLUDED_ROUTES | List of regular expression string for excluding routes | [] | API |
8579
| MIN_GAS_PRICES | Minimum gas price by denom object | {"uluna": "5.0"} | API |

package-lock.json

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "fcd",
3-
"version": "2.0.0-beta.1",
3+
"version": "2.0.0-beta.2",
44
"description": "Terra FCD Suite",
55
"main": "index.js",
66
"author": "Terra Engineering <engineering@terra.money>",
@@ -10,7 +10,7 @@
1010
"url": "https://github.com/terra-money/fcd.git"
1111
},
1212
"engines": {
13-
"node": ">=14"
13+
"node": ">=16"
1414
},
1515
"scripts": {
1616
"prettier": "prettier --write './src/**/*.ts'",

src/collector/block/accountTx.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ function extractAddressFromMsg(msg: Transaction.Message): string[] {
2424
}
2525
}
2626

27-
extractAddressesFromValue(msg.value)
27+
extractAddressesFromValue(msg)
2828
return addrs
2929
}
3030

@@ -45,6 +45,7 @@ function extractAddressFromLog(log: Transaction.Log) {
4545
export function generateAccountTxs(tx: TxEntity): AccountTxEntity[] {
4646
const msgs = tx.data.tx.body.messages
4747
const logs = tx.data.logs
48+
4849
const addrs = msgs.map(extractAddressFromMsg).flat()
4950

5051
if (logs) {

src/config.ts

-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ const {
33
LCD_URI,
44
FCD_URI,
55
RPC_URI,
6-
STATION_STATUS_JSON,
76
SENTRY_DSN,
87
USE_LOG_FILE,
98
DISABLE_API,
@@ -35,7 +34,6 @@ const config = {
3534
LCD_URI: LCD_URI || 'https://bombay-lcd.terra.dev',
3635
FCD_URI: FCD_URI || 'https://bombay-fcd.terra.dev',
3736
RPC_URI: RPC_URI || 'http://localhost:26657',
38-
STATION_STATUS_JSON_URL: STATION_STATUS_JSON || 'https://terra.money/station/version-web.json',
3937
BANK_WALLETS: BANK_WALLETS ? (JSON.parse(BANK_WALLETS) as string[]) : [],
4038
TOKEN_NETWORK: TOKEN_NETWORK,
4139
SENTRY_DSN,

src/types/account.d.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,15 @@ interface DelayedVestingAccount {
2626
}
2727

2828
interface VestingPeriod {
29-
length: string
29+
length: string // unit: seconds
3030
amount: Coins
3131
}
3232

3333
interface PeriodicVestingAccount {
3434
'@type': '/cosmos.vesting.v1beta1.PeriodicVestingAccount'
3535
base_vesting_account: BaseVestingAccount
3636
start_time: string
37+
// linear vesting from start_time to period.length (seconds)
3738
vesting_periods: VestingPeriod[]
3839
}
3940

src/types/tx.d.ts

+2-5
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,10 @@ declare namespace Transaction {
1717
}[]
1818
}
1919

20-
interface Message {
21-
type: string
22-
value: { [key: string]: any }
23-
}
20+
type Message = { [key: string]: any }
2421

2522
interface Body {
26-
messages: { [key: string]: any }[]
23+
messages: Message[]
2724
memo: string
2825
timeout_height?: string
2926
}

0 commit comments

Comments
 (0)