mirror of
https://github.com/luxfi/bridge.git
synced 2026-09-24 00:26:46 +00:00
- opnet-watcher: universal binary with plugin architecture - 3 functional plugins (OP_NET, Solana, TON) - Generic EVMPlugin handles all EVM chains (Ethereum, Base, Arbitrum, etc.) - 17 non-EVM chain stubs (Sui, NEAR, Cosmos, XRPL, ICP, etc.) - Threshold signing via luxfi/crypto (CGGMP21/FROST) - Separate txSigner hot wallet for on-chain submission - Multi-tenant API with hostname-based routing - Confirmation depth, backing sanity checks, EIP-155 local signing - manifests: 32 chain configs + 5 tenant configs (lux, zoo, hanzo, pars, spc) - k8s: fix chain IDs 1330663759→4294967299, ClusterIP services, KMS secrets - CI: conformance tests gate production deployment
42 lines
1.1 KiB
Go
42 lines
1.1 KiB
Go
// Copyright (C) 2025, Lux Industries Inc. All rights reserved.
|
|
// See the file LICENSE for licensing terms.
|
|
|
|
package plugins
|
|
|
|
import (
|
|
"context"
|
|
"fmt"
|
|
"math/big"
|
|
"net/http"
|
|
"time"
|
|
)
|
|
|
|
const PolkadotChainID uint64 = 0x444F5400 // "DOT\x00" in Teleporter namespace
|
|
|
|
// PolkadotPlugin polls a Substrate JSON-RPC node for deposit extrinsics
|
|
// from the bridge pallet. Polkadot uses sr25519 signing.
|
|
type PolkadotPlugin struct {
|
|
rpcURL string
|
|
bridgeAddr string // SS58 address
|
|
client *http.Client
|
|
}
|
|
|
|
func NewPolkadotPlugin(rpcURL, bridgeAddr string) *PolkadotPlugin {
|
|
return &PolkadotPlugin{
|
|
rpcURL: rpcURL,
|
|
bridgeAddr: bridgeAddr,
|
|
client: &http.Client{Timeout: 15 * time.Second},
|
|
}
|
|
}
|
|
|
|
func (p *PolkadotPlugin) Name() string { return "polkadot" }
|
|
func (p *PolkadotPlugin) ChainID() uint64 { return PolkadotChainID }
|
|
|
|
func (p *PolkadotPlugin) PollDeposits(ctx context.Context, fromBlock uint64) ([]DepositEvent, uint64, error) {
|
|
return nil, fromBlock, fmt.Errorf("polkadot: not yet implemented")
|
|
}
|
|
|
|
func (p *PolkadotPlugin) QueryBacking(ctx context.Context) (*big.Int, error) {
|
|
return nil, fmt.Errorf("polkadot: not yet implemented")
|
|
}
|