Skip to content

Use CAIP-2 in Bidyrectional #693

@volovyks

Description

@volovyks
  • Use Chain in SignBidirectionalEvent in a backwards compatible way (very important) @ChaoticTempest
#[derive(Debug, Clone, Copy)]
pub enum Chain {
    Near,
    Ethereum,
    Solana,
    Bitcoin,
    Hydration,
}

impl Chain {
    pub fn caip2_chain_id(&self) -> &str {
        match self {
            Chain::Near => "near:mainnet",
            Chain::Ethereum => "eip155:1",
            Chain::Solana => "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp",
            Chain::Bitcoin => "bip122:000000000019d6689c085ae165831e93",
            Chain::Hydration => "polkadot:2034",
        }
    }
}
  • Remove usage of dest(), make docs clear @ppca
  • Check SignNetJS @esaminu
  • Use in Hydration integration @esaminu, do not set dest to avoid confusion

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions