UNPKG

@faktoryfun/styx-sdk

Version:

Bitcoin deposit SDK for Stacks applications, enabling trustless Bitcoin-to-sBTC deposits

273 lines (272 loc) 12.7 kB
import { NetworkType } from "./types"; export declare const NETWORK_CONFIGS: { readonly mainnet: { readonly name: "Mainnet"; readonly apiUrl: "https://styx-be.vercel.app"; readonly stacksNetwork: "mainnet"; readonly bitcoinNetwork: "mainnet"; }; readonly testnet: { readonly name: "Testnet"; readonly apiUrl: "https://backend-styx-testnet.vercel.app"; readonly stacksNetwork: "testnet"; readonly bitcoinNetwork: "testnet"; }; readonly regtest: { readonly name: "Regtest"; readonly apiUrl: "https://backend-styx-testnet.vercel.app"; readonly stacksNetwork: "regtest"; readonly bitcoinNetwork: "regtest"; readonly bitcoinApiUrl: "https://mempool.bitcoin.regtest.hiro.so/api/v1"; }; }; export declare const MAINNET_POOLS: { readonly main: { readonly id: "main"; readonly type: "legacy"; readonly contractAddress: "SP6SA6BTPNN5WDAWQ7GWJF1T5E2KWY01K9SZDBJQ.styx-v1"; readonly btcAddress: "bc1qlh3zk77pc4mlyqz0dqhjvn6p2g5tfqj8qvqxfy"; readonly name: "Legacy Styx Pool"; readonly description: "Original sBTC bridge with USDA/PEPE swaps"; readonly supportedSwapTypes: readonly ["sbtc", "usda", "pepe"]; readonly minDepositSats: 10000; readonly maxDepositSats: 300000; readonly isActive: true; }; readonly aibtc: { readonly id: "aibtc"; readonly type: "aibtc"; readonly contractAddress: "SPV9K21TBFAK4KNRJXF5DFP8N7W46G4V9RCJDC22.btc2sbtc"; readonly btcAddress: "bc1qex5rfzcytljulw0k69rnh2n89vp3fwh0kes79s"; readonly name: "AI BTC Pool"; readonly description: "AI-powered BTC to sBTC bridge with AI token swaps"; readonly supportedSwapTypes: readonly ["sbtc", "aibtc"]; readonly minDepositSats: 10000; readonly maxDepositSats: 1000000; readonly isActive: true; }; }; export declare const TESTNET_POOLS: { readonly main: { readonly id: "main"; readonly type: "legacy"; readonly contractAddress: "ST6SA6BTPNN5WDAWQ7GWJF1T5E2KWY01KBRYYSZN.styx-v1"; readonly btcAddress: "tb1qmed265dnezfrrptfsgzsxuxwsrpff0eeqn29ph"; readonly name: "Legacy Styx Pool (Testnet)"; readonly description: "Original sBTC bridge with USDA/PEPE swaps (Testnet)"; readonly supportedSwapTypes: readonly ["sbtc", "usda", "pepe"]; readonly minDepositSats: 10000; readonly maxDepositSats: 300000; readonly isActive: true; }; readonly aibtc: { readonly id: "aibtc"; readonly type: "aibtc"; readonly contractAddress: "STV9K21TBFAK4KNRJXF5DFP8N7W46G4V9RJ5XDY2.btc2sbtc"; readonly btcAddress: "tb1q8pm9ud5rpc8cy802s37mwqey83h6jzkkarayp2"; readonly name: "AI BTC Pool (Testnet)"; readonly description: "AI-powered BTC to sBTC bridge with AI token swaps (Testnet)"; readonly supportedSwapTypes: readonly ["sbtc", "aibtc"]; readonly minDepositSats: 10000; readonly maxDepositSats: 1000000; readonly isActive: true; }; }; export declare const REGTEST_POOLS: { readonly main: { readonly id: "main"; readonly type: "legacy"; readonly contractAddress: "ST6SA6BTPNN5WDAWQ7GWJF1T5E2KWY01KBRYYSZN.styx-v1"; readonly btcAddress: "bcrt1qmed265dnezfrrptfsgzsxuxwsrpff0eeqn29ph"; readonly name: "Legacy Styx Pool (Regtest)"; readonly description: "Original sBTC bridge with USDA/PEPE swaps (Regtest)"; readonly supportedSwapTypes: readonly ["sbtc", "usda", "pepe"]; readonly minDepositSats: 10000; readonly maxDepositSats: 300000; readonly isActive: true; }; readonly aibtc: { readonly id: "aibtc"; readonly type: "aibtc"; readonly contractAddress: "STV9K21TBFAK4KNRJXF5DFP8N7W46G4V9RJ5XDY2.btc2sbtc"; readonly btcAddress: "bcrt1q8pm9ud5rpc8cy802s37mwqey83h6jzkkarayp2"; readonly name: "AI BTC Pool (Regtest)"; readonly description: "AI-powered BTC to sBTC bridge with AI token swaps (Regtest)"; readonly supportedSwapTypes: readonly ["sbtc", "aibtc"]; readonly minDepositSats: 10000; readonly maxDepositSats: 1000000; readonly isActive: true; }; }; export declare const POOL_CONFIGS: { readonly mainnet: { readonly main: { readonly id: "main"; readonly type: "legacy"; readonly contractAddress: "SP6SA6BTPNN5WDAWQ7GWJF1T5E2KWY01K9SZDBJQ.styx-v1"; readonly btcAddress: "bc1qlh3zk77pc4mlyqz0dqhjvn6p2g5tfqj8qvqxfy"; readonly name: "Legacy Styx Pool"; readonly description: "Original sBTC bridge with USDA/PEPE swaps"; readonly supportedSwapTypes: readonly ["sbtc", "usda", "pepe"]; readonly minDepositSats: 10000; readonly maxDepositSats: 300000; readonly isActive: true; }; readonly aibtc: { readonly id: "aibtc"; readonly type: "aibtc"; readonly contractAddress: "SPV9K21TBFAK4KNRJXF5DFP8N7W46G4V9RCJDC22.btc2sbtc"; readonly btcAddress: "bc1qex5rfzcytljulw0k69rnh2n89vp3fwh0kes79s"; readonly name: "AI BTC Pool"; readonly description: "AI-powered BTC to sBTC bridge with AI token swaps"; readonly supportedSwapTypes: readonly ["sbtc", "aibtc"]; readonly minDepositSats: 10000; readonly maxDepositSats: 1000000; readonly isActive: true; }; }; readonly testnet: { readonly main: { readonly id: "main"; readonly type: "legacy"; readonly contractAddress: "ST6SA6BTPNN5WDAWQ7GWJF1T5E2KWY01KBRYYSZN.styx-v1"; readonly btcAddress: "tb1qmed265dnezfrrptfsgzsxuxwsrpff0eeqn29ph"; readonly name: "Legacy Styx Pool (Testnet)"; readonly description: "Original sBTC bridge with USDA/PEPE swaps (Testnet)"; readonly supportedSwapTypes: readonly ["sbtc", "usda", "pepe"]; readonly minDepositSats: 10000; readonly maxDepositSats: 300000; readonly isActive: true; }; readonly aibtc: { readonly id: "aibtc"; readonly type: "aibtc"; readonly contractAddress: "STV9K21TBFAK4KNRJXF5DFP8N7W46G4V9RJ5XDY2.btc2sbtc"; readonly btcAddress: "tb1q8pm9ud5rpc8cy802s37mwqey83h6jzkkarayp2"; readonly name: "AI BTC Pool (Testnet)"; readonly description: "AI-powered BTC to sBTC bridge with AI token swaps (Testnet)"; readonly supportedSwapTypes: readonly ["sbtc", "aibtc"]; readonly minDepositSats: 10000; readonly maxDepositSats: 1000000; readonly isActive: true; }; }; readonly regtest: { readonly main: { readonly id: "main"; readonly type: "legacy"; readonly contractAddress: "ST6SA6BTPNN5WDAWQ7GWJF1T5E2KWY01KBRYYSZN.styx-v1"; readonly btcAddress: "bcrt1qmed265dnezfrrptfsgzsxuxwsrpff0eeqn29ph"; readonly name: "Legacy Styx Pool (Regtest)"; readonly description: "Original sBTC bridge with USDA/PEPE swaps (Regtest)"; readonly supportedSwapTypes: readonly ["sbtc", "usda", "pepe"]; readonly minDepositSats: 10000; readonly maxDepositSats: 300000; readonly isActive: true; }; readonly aibtc: { readonly id: "aibtc"; readonly type: "aibtc"; readonly contractAddress: "STV9K21TBFAK4KNRJXF5DFP8N7W46G4V9RJ5XDY2.btc2sbtc"; readonly btcAddress: "bcrt1q8pm9ud5rpc8cy802s37mwqey83h6jzkkarayp2"; readonly name: "AI BTC Pool (Regtest)"; readonly description: "AI-powered BTC to sBTC bridge with AI token swaps (Regtest)"; readonly supportedSwapTypes: readonly ["sbtc", "aibtc"]; readonly minDepositSats: 10000; readonly maxDepositSats: 1000000; readonly isActive: true; }; }; }; export declare const DEPOSIT_BTC_ADDRESS: "bc1qlh3zk77pc4mlyqz0dqhjvn6p2g5tfqj8qvqxfy"; export declare const MIN_DEPOSIT_SATS = 10000; export declare const MAX_DEPOSIT_SATS = 300000; export type PoolType = "legacy" | "aibtc"; export type PoolId = keyof typeof MAINNET_POOLS; export declare function getNetworkConfig(network: NetworkType): { readonly name: "Mainnet"; readonly apiUrl: "https://styx-be.vercel.app"; readonly stacksNetwork: "mainnet"; readonly bitcoinNetwork: "mainnet"; } | { readonly name: "Testnet"; readonly apiUrl: "https://backend-styx-testnet.vercel.app"; readonly stacksNetwork: "testnet"; readonly bitcoinNetwork: "testnet"; } | { readonly name: "Regtest"; readonly apiUrl: "https://backend-styx-testnet.vercel.app"; readonly stacksNetwork: "regtest"; readonly bitcoinNetwork: "regtest"; readonly bitcoinApiUrl: "https://mempool.bitcoin.regtest.hiro.so/api/v1"; }; export declare function getPoolConfig(network: NetworkType, poolId: PoolId): { readonly id: "main"; readonly type: "legacy"; readonly contractAddress: "SP6SA6BTPNN5WDAWQ7GWJF1T5E2KWY01K9SZDBJQ.styx-v1"; readonly btcAddress: "bc1qlh3zk77pc4mlyqz0dqhjvn6p2g5tfqj8qvqxfy"; readonly name: "Legacy Styx Pool"; readonly description: "Original sBTC bridge with USDA/PEPE swaps"; readonly supportedSwapTypes: readonly ["sbtc", "usda", "pepe"]; readonly minDepositSats: 10000; readonly maxDepositSats: 300000; readonly isActive: true; } | { readonly id: "aibtc"; readonly type: "aibtc"; readonly contractAddress: "SPV9K21TBFAK4KNRJXF5DFP8N7W46G4V9RCJDC22.btc2sbtc"; readonly btcAddress: "bc1qex5rfzcytljulw0k69rnh2n89vp3fwh0kes79s"; readonly name: "AI BTC Pool"; readonly description: "AI-powered BTC to sBTC bridge with AI token swaps"; readonly supportedSwapTypes: readonly ["sbtc", "aibtc"]; readonly minDepositSats: 10000; readonly maxDepositSats: 1000000; readonly isActive: true; } | { readonly id: "main"; readonly type: "legacy"; readonly contractAddress: "ST6SA6BTPNN5WDAWQ7GWJF1T5E2KWY01KBRYYSZN.styx-v1"; readonly btcAddress: "tb1qmed265dnezfrrptfsgzsxuxwsrpff0eeqn29ph"; readonly name: "Legacy Styx Pool (Testnet)"; readonly description: "Original sBTC bridge with USDA/PEPE swaps (Testnet)"; readonly supportedSwapTypes: readonly ["sbtc", "usda", "pepe"]; readonly minDepositSats: 10000; readonly maxDepositSats: 300000; readonly isActive: true; } | { readonly id: "aibtc"; readonly type: "aibtc"; readonly contractAddress: "STV9K21TBFAK4KNRJXF5DFP8N7W46G4V9RJ5XDY2.btc2sbtc"; readonly btcAddress: "tb1q8pm9ud5rpc8cy802s37mwqey83h6jzkkarayp2"; readonly name: "AI BTC Pool (Testnet)"; readonly description: "AI-powered BTC to sBTC bridge with AI token swaps (Testnet)"; readonly supportedSwapTypes: readonly ["sbtc", "aibtc"]; readonly minDepositSats: 10000; readonly maxDepositSats: 1000000; readonly isActive: true; } | { readonly id: "main"; readonly type: "legacy"; readonly contractAddress: "ST6SA6BTPNN5WDAWQ7GWJF1T5E2KWY01KBRYYSZN.styx-v1"; readonly btcAddress: "bcrt1qmed265dnezfrrptfsgzsxuxwsrpff0eeqn29ph"; readonly name: "Legacy Styx Pool (Regtest)"; readonly description: "Original sBTC bridge with USDA/PEPE swaps (Regtest)"; readonly supportedSwapTypes: readonly ["sbtc", "usda", "pepe"]; readonly minDepositSats: 10000; readonly maxDepositSats: 300000; readonly isActive: true; } | { readonly id: "aibtc"; readonly type: "aibtc"; readonly contractAddress: "STV9K21TBFAK4KNRJXF5DFP8N7W46G4V9RJ5XDY2.btc2sbtc"; readonly btcAddress: "bcrt1q8pm9ud5rpc8cy802s37mwqey83h6jzkkarayp2"; readonly name: "AI BTC Pool (Regtest)"; readonly description: "AI-powered BTC to sBTC bridge with AI token swaps (Regtest)"; readonly supportedSwapTypes: readonly ["sbtc", "aibtc"]; readonly minDepositSats: 10000; readonly maxDepositSats: 1000000; readonly isActive: true; }; export declare function getPoolBtcAddress(network: NetworkType, poolId: PoolId): "bc1qlh3zk77pc4mlyqz0dqhjvn6p2g5tfqj8qvqxfy" | "bc1qex5rfzcytljulw0k69rnh2n89vp3fwh0kes79s" | "tb1qmed265dnezfrrptfsgzsxuxwsrpff0eeqn29ph" | "tb1q8pm9ud5rpc8cy802s37mwqey83h6jzkkarayp2" | "bcrt1qmed265dnezfrrptfsgzsxuxwsrpff0eeqn29ph" | "bcrt1q8pm9ud5rpc8cy802s37mwqey83h6jzkkarayp2"; export declare function getApiUrl(network: NetworkType): string; export declare function getDefaultPoolForSwapType(swapType: string): PoolId;