diff --git a/packages/sdk/src/addresses/formats.ts b/packages/sdk/src/addresses/formats.ts index de72cc6d..db67dcc0 100644 --- a/packages/sdk/src/addresses/formats.ts +++ b/packages/sdk/src/addresses/formats.ts @@ -11,6 +11,12 @@ export const addressFormats = { p2wpkh: /^(tb1[qp]|bcrt1[qp])[a-zA-HJ-NP-Z0-9]{14,74}$/, p2tr: /^(tb1p|bcrt1p)[a-zA-HJ-NP-Z0-9]{14,74}$/ }, + signet: { + p2pkh: /^[mn][a-km-zA-HJ-NP-Z1-9]{25,34}$/, + p2sh: /^[2][a-km-zA-HJ-NP-Z1-9]{25,34}$/, + p2wpkh: /^(tb1[qp]|bcrt1[qp])[a-zA-HJ-NP-Z0-9]{14,74}$/, + p2tr: /^(tb1p|bcrt1p)[a-zA-HJ-NP-Z0-9]{14,74}$/ + }, regtest: { p2pkh: /^[mn][a-km-zA-HJ-NP-Z1-9]{25,34}$/, p2sh: /^[2][a-km-zA-HJ-NP-Z1-9]{25,34}$/, diff --git a/packages/sdk/src/api/jsonrpc.ts b/packages/sdk/src/api/jsonrpc.ts index 3234f164..d1059968 100644 --- a/packages/sdk/src/api/jsonrpc.ts +++ b/packages/sdk/src/api/jsonrpc.ts @@ -71,6 +71,7 @@ export const rpc = { }, mainnet: new JsonRpc(getRpcUrl(apiConfig.apis.mainnet.batter)), testnet: new JsonRpc(getRpcUrl(apiConfig.apis.testnet.batter)), + signet: new JsonRpc(getRpcUrl(apiConfig.apis.signet.batter)), regtest: new JsonRpc(getRpcUrl(apiConfig.apis.regtest.batter)) } as const diff --git a/packages/sdk/src/config/index.ts b/packages/sdk/src/config/index.ts index b4c2de40..51f96ae6 100644 --- a/packages/sdk/src/config/index.ts +++ b/packages/sdk/src/config/index.ts @@ -15,6 +15,11 @@ export const apiConfig = { batter: "https://testnet.ordit.io/", orderbook: "tb1qfnw26753j7kqu3q099sd48htvtk5wm4e0enmru", ipfs: "http://ipfs-gateway.ordit.io/" + }, + signet: { + batter: "https://signet.ordit.io/", + orderbook: "tb1qfnw26753j7kqu3q099sd48htvtk5wm4e0enmru", + ipfs: "http://ipfs-gateway.ordit.io/" } } } diff --git a/packages/sdk/src/config/types.ts b/packages/sdk/src/config/types.ts index 4fd68853..a844d5a6 100644 --- a/packages/sdk/src/config/types.ts +++ b/packages/sdk/src/config/types.ts @@ -1 +1 @@ -export type Network = "mainnet" | "testnet" | "regtest" +export type Network = "mainnet" | "testnet" | "regtest" | "signet" diff --git a/packages/sdk/src/utils/index.ts b/packages/sdk/src/utils/index.ts index ee5145e9..df14648d 100644 --- a/packages/sdk/src/utils/index.ts +++ b/packages/sdk/src/utils/index.ts @@ -18,7 +18,10 @@ import { export function getNetwork(value: Network) { if (value === "mainnet") { - return bitcoin.networks["bitcoin"] + return bitcoin.networks.bitcoin + } + if (value === "signet") { + return bitcoin.networks.testnet } return bitcoin.networks[value]