Skip to content

Commit

Permalink
Add regtest network
Browse files Browse the repository at this point in the history
  • Loading branch information
emilcondrea committed Dec 10, 2024
1 parent 55c1e12 commit 4c7b190
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sats-connect/core",
"version": "0.4.2",
"version": "0.4.3",
"main": "dist/index.mjs",
"module": "dist/index.mjs",
"types": "dist/index.d.mts",
Expand Down
8 changes: 6 additions & 2 deletions src/runes/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,12 @@ const urlNetworkSuffix = {
[BitcoinNetworkType.Testnet]: '-testnet',
[BitcoinNetworkType.Signet]: '-signet',
};
export const ORDINALS_API_BASE_URL = (network: BitcoinNetworkType = BitcoinNetworkType.Mainnet) =>
`https://ordinals${urlNetworkSuffix[network]}.xverse.app/v1`;
export const ORDINALS_API_BASE_URL = (network: BitcoinNetworkType = BitcoinNetworkType.Mainnet) => {
if (network === BitcoinNetworkType.Regtest) {
throw new Error('Ordinals API does not support regtest network');
}
return `https://ordinals${urlNetworkSuffix[network]}.xverse.app/v1`;
};

export class RunesApi {
client: AxiosInstance;
Expand Down
1 change: 1 addition & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export enum BitcoinNetworkType {
Mainnet = 'Mainnet',
Testnet = 'Testnet',
Signet = 'Signet',
Regtest = 'Regtest',
}

export interface BitcoinNetwork {
Expand Down

0 comments on commit 4c7b190

Please sign in to comment.