Skip to content

Commit e6e1133

Browse files
committed
New config
1 parent d85eb8d commit e6e1133

File tree

2 files changed

+54
-5
lines changed

2 files changed

+54
-5
lines changed

src/aleph/sdk/conf.py

Lines changed: 39 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
import os
22
from pathlib import Path
33
from shutil import which
4-
from typing import Optional
4+
from typing import Dict, Optional, Union
55

6+
from aleph_message.models import Chain
67
from pydantic import BaseSettings, Field
78

9+
from aleph.sdk.types import ChainInfo
10+
811

912
class Settings(BaseSettings):
1013
CONFIG_HOME: Optional[str] = None
@@ -38,9 +41,41 @@ class Settings(BaseSettings):
3841

3942
CODE_USES_SQUASHFS: bool = which("mksquashfs") is not None # True if command exists
4043

41-
AVAX_RPC: str = "https://api.avax.network/ext/bc/C/rpc"
42-
AVAX_CHAIN_ID: int = 43114
43-
AVAX_ALEPH_SUPER_TOKEN = "0xc0Fbc4967259786C743361a5885ef49380473dCF" # mainnet
44+
# Web3Provider settings
45+
TOKEN_DECIMALS = 18
46+
TX_TIMEOUT = 60 * 3
47+
CHAINS: Dict[Union[Chain, str], ChainInfo] = {
48+
# TESTNETS
49+
"SEPOLIA": ChainInfo(
50+
chain_id=11155111,
51+
rpc="https://eth-sepolia.public.blastapi.io",
52+
token="0xc4bf5cbdabe595361438f8c6a187bdc330539c60",
53+
super_token="0x22064a21fee226d8ffb8818e7627d5ff6d0fc33a",
54+
),
55+
# MAINNETS
56+
Chain.ETH: ChainInfo(
57+
chain_id=1,
58+
rpc="https://eth-mainnet.public.blastapi.io",
59+
token="0x27702a26126e0B3702af63Ee09aC4d1A084EF628",
60+
),
61+
Chain.AVAX: ChainInfo(
62+
chain_id=43114,
63+
rpc="https://api.avax.network/ext/bc/C/rpc",
64+
token="0xc0Fbc4967259786C743361a5885ef49380473dCF",
65+
super_token="0xc0Fbc4967259786C743361a5885ef49380473dCF",
66+
),
67+
Chain.BASE: ChainInfo(
68+
chain_id=8453,
69+
rpc="https://base-mainnet.public.blastapi.io",
70+
token="0xc0Fbc4967259786C743361a5885ef49380473dCF",
71+
super_token="0xc0Fbc4967259786C743361a5885ef49380473dCF",
72+
),
73+
Chain.BSC: ChainInfo(
74+
chain_id=56,
75+
rpc="https://binance.llamarpc.com",
76+
token="0x82D2f8E02Afb160Dd5A480a617692e62de9038C4",
77+
),
78+
}
4479

4580
# Dns resolver
4681
DNS_IPFS_DOMAIN = "ipfs.public.aleph.sh"

src/aleph/sdk/types.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from abc import abstractmethod
22
from enum import Enum
3-
from typing import Dict, Protocol, TypeVar
3+
from typing import Dict, Optional, Protocol, TypeVar
44

55
from pydantic import BaseModel
66

@@ -64,3 +64,17 @@ class SEVMeasurement(BaseModel):
6464

6565
sev_info: SEVInfo
6666
launch_measure: str
67+
68+
69+
class ChainInfo:
70+
"""
71+
A chain information.
72+
"""
73+
74+
def __init__(
75+
self, chain_id: int, rpc: str, token: str, super_token: Optional[str] = None
76+
):
77+
self.chain_id = chain_id
78+
self.rpc = rpc
79+
self.token = token
80+
self.super_token = super_token

0 commit comments

Comments
 (0)