Skip to content

Commit

Permalink
Add regtest network (#52)
Browse files Browse the repository at this point in the history
* Add regtest network
  • Loading branch information
emilcondrea authored Dec 10, 2024
1 parent 55c1e12 commit ee25959
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

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 ee25959

Please sign in to comment.