ソースを参照

tokens: Add Makefile to update token lists.

parazyd 4 年 前
コミット
a7f2619c4b
1 ファイル変更23 行追加0 行削除
  1. 23 0
      token/Makefile

+ 23 - 0
token/Makefile

@@ -0,0 +1,23 @@
+.POSIX:
+
+DLTOOL = wget -nv --show-progress -O-
+
+LISTS = \
+	erc20_token_list.json \
+	solana_token_list.json
+
+ERC20 = https://tokens.coingecko.com/uniswap/all.json
+SOL = https://github.com/solana-labs/token-list/raw/main/src/tokens/solana.tokenlist.json
+
+all: $(LISTS)
+
+erc20_token_list.json:
+	$(DLTOOL) $(ERC20) > $@
+
+solana_token_list.json:
+	$(DLTOOL) $(SOL) | sed \
+		-e 's@"symbol": "BTC"@"symbol": "SBTC"@' \
+		-e 's@"symbol": "ETH"@"symbol": "SETH"@' \
+		> $@
+
+.PHONY: all $(LISTS)