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 NEARChainID uint64 = 0x4E454152 // "NEAR" in Teleporter namespace
|
|
|
|
// NEARPlugin polls a NEAR JSON-RPC node for deposit receipts from the bridge contract.
|
|
// NEAR uses ed25519 signing and account-based state.
|
|
type NEARPlugin struct {
|
|
rpcURL string
|
|
bridgeAddr string // NEAR account ID (e.g., bridge.lux.near)
|
|
client *http.Client
|
|
}
|
|
|
|
func NewNEARPlugin(rpcURL, bridgeAddr string) *NEARPlugin {
|
|
return &NEARPlugin{
|
|
rpcURL: rpcURL,
|
|
bridgeAddr: bridgeAddr,
|
|
client: &http.Client{Timeout: 15 * time.Second},
|
|
}
|
|
}
|
|
|
|
func (n *NEARPlugin) Name() string { return "near" }
|
|
func (n *NEARPlugin) ChainID() uint64 { return NEARChainID }
|
|
|
|
func (n *NEARPlugin) PollDeposits(ctx context.Context, fromBlock uint64) ([]DepositEvent, uint64, error) {
|
|
return nil, fromBlock, fmt.Errorf("near: not yet implemented")
|
|
}
|
|
|
|
func (n *NEARPlugin) QueryBacking(ctx context.Context) (*big.Int, error) {
|
|
return nil, fmt.Errorf("near: not yet implemented")
|
|
}
|