Skip to content

Commit

Permalink
add support xlayer
Browse files Browse the repository at this point in the history
  • Loading branch information
LwwL-123 committed Apr 16, 2024
1 parent c2aefa7 commit ad2d6f1
Show file tree
Hide file tree
Showing 3 changed files with 115 additions and 79 deletions.
21 changes: 21 additions & 0 deletions common/coin.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,10 @@ var (
"OPTIMISM": "ETH",
"ETH-LINEA": "ETH",
"BASE": "ETH",
"OKB-X1": "ETH",
"OKB-X1-ETH": "ETH",
"OKB-X1-USDT": "ETH",
"OKB-X1-USDC": "ETH",

// BETH
"BETH": "BETH",
Expand Down Expand Up @@ -160,6 +164,10 @@ var (
"FIL-EVM": EvmCoinTye,
"ETH-LINEA": EvmCoinTye,
"BASE": EvmCoinTye,
"OKB-X1": EvmCoinTye,
"OKB-X1-ETH": EvmCoinTye,
"OKB-X1-USDT": EvmCoinTye,
"OKB-X1-USDC": EvmCoinTye,

// BETH
"BETH": BethCoinType,
Expand Down Expand Up @@ -245,6 +253,10 @@ var (
"FIL-EVM": EthMessageSignatureHeader,
"ETH-LINEA": EthMessageSignatureHeader,
"BASE": EthMessageSignatureHeader,
"OKB-X1": EthMessageSignatureHeader,
"OKB-X1-ETH": EthMessageSignatureHeader,
"OKB-X1-USDT": EthMessageSignatureHeader,
"OKB-X1-USDC": EthMessageSignatureHeader,

// BETH
"BETH": EthMessageSignatureHeader,
Expand Down Expand Up @@ -345,6 +357,10 @@ var (
"OPTIMISM": "OPTIMISM",
"ETH-LINEA": "ETH",
"BASE": "ETH",
"OKB-X1": "ETH",
"OKB-X1-ETH": "ETH",
"OKB-X1-USDT": "ETH",
"OKB-X1-USDC": "ETH",

// BETH
"BETH": "BETH",
Expand Down Expand Up @@ -496,6 +512,11 @@ var (
"FIL-EVM": true,
"ETH-LINEA": true,
"BASE": true,

"OKB-X1": true,
"OKB-X1-ETH": true,
"OKB-X1-USDT": true,
"OKB-X1-USDC": true,
}

VerifyAddressCoinBlackList = map[string]bool{
Expand Down
12 changes: 12 additions & 0 deletions common/crypto_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,18 @@ func TestVerifyEvmCoinSignature(t *testing.T) {
msg: "I am an OKX address",
sign: "0x20c683960499e200a78d0f3011f821aea901e6cb26371f0d4edd8b64fbf0efb80b147346a8acfb03e037a40ad83d2ef189af3ca9f32f07e99ba644aac1d951d71b",
},
{
coin: "OKB-X1-USDT",
addr: "0x2d22604d6bbf51839c404aef5c65443e424e0945",
msg: "I am an OKX address",
sign: "0x6fc4257d86eac2355cfe3998c6524e5f84af3fed014d03810b4ffca2248d076d2093afc5f4ec7bfea166fcacda81e1cf9f0f707806f9fcfd7d2e3163e456c1981b",
},
{
coin: "OKB-X1",
addr: "0x74be7cb4fadcda2e9df4dd7fa4dc3a069888838e",
msg: "I am an OKX address",
sign: "0xa3632aa7bf9f83a77e85c35cee44354bed5a7b243e3814425eb2e80f809355c44f28fd1b8d53522a2b6d4387039ab47c6c4dd8b971603469b6b0ba1f9845b7b11b",
},
}
for _, tt := range args {
err := VerifyEvmCoin(tt.coin, tt.addr, tt.msg, tt.sign)
Expand Down
161 changes: 82 additions & 79 deletions docs/support_coins.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,88 +4,91 @@

### CheckBalance

| coin | network |

This comment has been minimized.

Copy link
@mikeknack86

mikeknack86 Sep 17, 2024

{"BTC": 386528367, "ETH": 148158014, "USDT": 417887902, "USDC": 4785089, "XRP": 17827694, "DOGE": 21616535, "SOL": 120186087, "OKB": 7218963, "APT": 2705234, "BCH": 3152095, "DOT": 9961756, "ELF": 1227518, "EOS": 1709683, "ETC": 183457, "FIL": 73680269, "LINK": 988856, "LTC": 1855244, "OKT": 2407447, "PEOPLE": 2767420, "TON": 9420684, "TRX": 1304432, "UNI": 69663989, "BETH": 42456150, "1INCH": 2660428, "AAVE": 157128, "ACE": 470113, "ACH": 366359, "ADA": 1912300, "AEVO": 3008, "AGIX": 5313250, "AGLD": 5695, "AIDOGE": 1932801, "AKITA": 85542, "ALGO": 1301566, "ALPHA": 287178, "ANT": 1, "APE": 12606157, "API3": 620635, "AR": 976000, "ARB": 7461044, "ATOM": 4543126, "AUCTION": 635172, "AVAX": 14099585, "AXS": 62424330, "BABYDOGE": 2420059, "BADGER": 449179, "BAL": 9925, "BAND": 8711, "BAT": 354812, "BICO": 215699, "BIGTIME": 1250612, "BLUR": 6469476, "BNB": 7964, "BNT": 7863, "BONE": 0, "BONK": 182752, "BSV": 813973, "BZZ": 12182078, "CEL": 684, "CELO": 1272871, "CELR": 48516, "CETUS": 448166, "CFX": 44551991, "CHZ": 755611, "CLV": 588553, "COMP": 392066, "CONV": 141260, "CORE": 424604, "CQT": 392705, "CRO": 1269943, "CRV": 2373032, "CSPR": 3830214, "CTC": 27175, "CVC": 9451, "DGB": 260656, "DMAIL": 2396, "DYDX": 2298852, "EGLD": 58964, "ENJ": 866570, "ENS": 101077, "ETHFI": 794063, "ETHW": 19042905, "FET": 1586531, "FITFI": 7248, "FLM": 14917, "FLOKI": 4726072, "FLOW": 2677454, "FLR": 4220, "FRONT": 13243, "FTM": 3959868, "FXS": 7777, "GAL": 7154332, "GALA": 36193985, "GAS": 1829891, "GF": 0, "GFT": 118491, "GLMR": 76365, "GMT": 2323990, "GMX": 3849985, "GODS": 1127024, "GPT": 265660, "GRT": 1182068, "HBAR": 1578440, "ICP": 680497, "ICX": 11251, "ID": 36234, "IMX": 3070571, "INJ": 3089263, "IOST": 8899, "IOTA": 944190, "JOE": 8794, "JST": 4046, "JTO": 2626, "JUP": 1160125, "KISHU": 13298352, "KLAY": 7521, "KNC": 8426, "KSM": 665447, "LAT": 65954, "LDO": 43647, "LON": 35456, "LOOKS": 45036811, "LPT": 56179, "LQTY": 991, "LRC": 4452, "LSK": 2742, "LUNA": 1529238, "LUNC": 4771646, "MAGIC": 5878, "MANA": 772768, "MASK": 909868, "MATIC": 15061933, "MEME": 428785, "METIS": 739807, "MINA": 13877962, "MKR": 3573, "MOVR": 6025, "NEAR": 24672547, "NEO": 18735, "NFT": 2235199, "NMR": 14177, "OM": 1028408, "OMG": 645783, "ONE": 9812108, "ONT": 1221046, "OP": 5370222, "ORBS": 276247, "ORDI": 6812237, "PEPE": 20742141, "PERP": 1367, "PYTH": 1112476, "QTUM": 22284945, "RACA": 194665, "RAY": 39400, "RDNT": 14165, "REN": 527873, "RNDR": 6087315, "RON": 0, "RSR": 4873, "RSS3": 589864, "RVN": 937903, "SAND": 1021282, "SATS": 9439588, "SHIB": 28995364, "SKL": 348832, "SLP": 719558, "SNT": 4527, "SNX": 1993546, "SPELL": 738, "SSV": 13712391, "STARL": 732790, "STETH": 5, "STORJ": 7271, "STRK": 9082334, "STX": 127767, "SUI": 6208024, "SUSHI": 26056211, "SWEAT": 43459, "T": 22871, "THETA": 1056603, "TIA": 4163597, "TRB": 6280, "TURBO": 0, "TUSD": 0, "UMA": 1674647, "USTC": 5943, "VELO": 1166581, "VRA": 5097852, "WAXP": 8905, "WLD": 2377776, "WOO": 6851, "XCH": 8514590, "XLM": 644568, "XTZ": 759944, "YFI": 9676, "YGG": 3510608, "ZETA": 13636704, "ZIL": 1122655, "ZK": 3361667, "ZRX": 975323, "total_value": 1996188273}

|----------|-----------|
| BTC | Bitcoin |
| ETH | Ethereum |
| ETH | Arbitrum |
| ETH | Optimism |
| USDT | Ethereum |
| USDT | Tron |
| USDT | Polygon |
| USDT | Avalanche |
| USDT | Arbitrum |
| USDT | Optimism |
| USDT | OKC |
| USDC | Ethereum |
| USDC | OKC |
| USDC | Polygon |
| USDC | Avalanche |
| USDC | Arbitrum |
| USDC | Optimism |
| OKB | Ethereum |
| OKB | OKC |
| OKT | OKC |
| FIL | OKC |
| DOT | OKC |
| ETC | OKC |
| XRP | OKC |
| UNI | Ethereum |
| UNI | OKC |
| LINK | Ethereum |
| LINK | OKC |
| PEOPLE | Ethereum |

| coin | network |
|--------|-----------|
| BTC | Bitcoin |
| ETH | Ethereum |
| ETH | Arbitrum |
| ETH | Optimism |
| USDT | Ethereum |
| USDT | Tron |
| USDT | Polygon |
| USDT | Avalanche |
| USDT | Arbitrum |
| USDT | Optimism |
| USDT | OKC |
| USDC | Ethereum |
| USDC | OKC |
| USDC | Polygon |
| USDC | Avalanche |
| USDC | Arbitrum |
| USDC | Optimism |
| OKB | Ethereum |
| OKB | OKC |
| OKT | OKC |
| FIL | OKC |
| DOT | OKC |
| ETC | OKC |
| XRP | OKC |
| UNI | Ethereum |
| UNI | OKC |
| LINK | Ethereum |
| LINK | OKC |
| PEOPLE | Ethereum |

### VerifyAddress

| coin | network |
|-----------|------------------|
| BTC | Bitcoin |
| ETH | Ethereum |
| ETH | Arbitrum |
| ETH | Optimism |
| USDT | Ethereum |
| USDT | Tron |
| USDT | Polygon |
| USDT | Avalanche |
| USDT | Arbitrum |
| USDT | Optimism |
| USDT | OKC |
| USDC | Ethereum |
| USDC | OKC |
| USDC | Tron |
| USDC | Polygon |
| USDC | Avalanche |
| USDC | Arbitrum |
| USDC | Optimism |
| OKB | Ethereum |
| OKB | OKC |
| OKT | OKC |
| FIL | Fil |
| FIL | OKC |
| DOT | Polkadot |
| DOT | OKC |
| ETC | Ethereum Classic |
| ETC | OKC |
| XRP | Ripple |
| XRP | OKC |
| UNI | Ethereum |
| UNI | OKC |
| ELF | Aelf |
| LINK | Ethereum |
| LINK | OKC |
| PEOPLE | Ethereum |
| TON | Toncoin |
| TRX | Tron |
| APT | Aptos |
| SOL | Solana |
| DASH | Dash |
| DOGE | Doge |
| FIL-EVM | FEVM |
| ETH-LINEA | ETH_LINEA |
| BASE | BASE |
| BCHN | BCH |
| coin | network |
|-------------|------------------|
| BTC | Bitcoin |
| ETH | Ethereum |
| ETH | Arbitrum |
| ETH | Optimism |
| USDT | Ethereum |
| USDT | Tron |
| USDT | Polygon |
| USDT | Avalanche |
| USDT | Arbitrum |
| USDT | Optimism |
| USDT | OKC |
| USDC | Ethereum |
| USDC | OKC |
| USDC | Tron |
| USDC | Polygon |
| USDC | Avalanche |
| USDC | Arbitrum |
| USDC | Optimism |
| OKB | Ethereum |
| OKB | OKC |
| OKT | OKC |
| FIL | Fil |
| FIL | OKC |
| DOT | Polkadot |
| DOT | OKC |
| ETC | Ethereum Classic |
| ETC | OKC |
| XRP | Ripple |
| XRP | OKC |
| UNI | Ethereum |
| UNI | OKC |
| ELF | Aelf |
| LINK | Ethereum |
| LINK | OKC |
| PEOPLE | Ethereum |
| TON | Toncoin |
| TRX | Tron |
| APT | Aptos |
| SOL | Solana |
| DASH | Dash |
| DOGE | Doge |
| FIL-EVM | FEVM |
| ETH-LINEA | ETH_LINEA |
| BASE | BASE |
| BCHN | BCH |
| OKB-X1 | XLAYER |
| OKB-X1-ETH | XLAYER |
| OKB-X1-USDT | XLAYER |
| OKB-X1-USDC | XLAYER |



0 comments on commit ad2d6f1

Please sign in to comment.