diff --git a/src/sdkUtils/bridgeFromBRC20.ts b/src/sdkUtils/bridgeFromBRC20.ts index 1049790..44806ab 100644 --- a/src/sdkUtils/bridgeFromBRC20.ts +++ b/src/sdkUtils/bridgeFromBRC20.ts @@ -136,7 +136,7 @@ export async function bridgeFromBRC20( !equalBytes( info.fromAddressScriptPubKey, addressToScriptPubKey( - info.fromChain === KnownChainId.Bitcoin.Mainnet + info.fromChain === KnownChainId.BRC20.Mainnet ? btc.NETWORK : btc.TEST_NETWORK, info.fromAddress, @@ -160,7 +160,7 @@ export async function bridgeFromBRC20( !equalBytes( info.toAddressScriptPubKey, addressToScriptPubKey( - info.fromChain === KnownChainId.Bitcoin.Mainnet + info.fromChain === KnownChainId.BRC20.Mainnet ? btc.NETWORK : btc.TEST_NETWORK, info.toAddress, diff --git a/src/sdkUtils/bridgeFromRunes.ts b/src/sdkUtils/bridgeFromRunes.ts index bc1613d..27bd07f 100644 --- a/src/sdkUtils/bridgeFromRunes.ts +++ b/src/sdkUtils/bridgeFromRunes.ts @@ -147,7 +147,7 @@ export async function bridgeFromRunes( !equalBytes( info.fromAddressScriptPubKey, addressToScriptPubKey( - info.fromChain === KnownChainId.Bitcoin.Mainnet + info.fromChain === KnownChainId.Runes.Mainnet ? btc.NETWORK : btc.TEST_NETWORK, info.fromAddress, @@ -171,7 +171,7 @@ export async function bridgeFromRunes( !equalBytes( info.toAddressScriptPubKey, addressToScriptPubKey( - info.fromChain === KnownChainId.Bitcoin.Mainnet + info.fromChain === KnownChainId.Runes.Mainnet ? btc.NETWORK : btc.TEST_NETWORK, info.toAddress, diff --git a/src/sdkUtils/types.ts b/src/sdkUtils/types.ts index a008954..b411503 100644 --- a/src/sdkUtils/types.ts +++ b/src/sdkUtils/types.ts @@ -1,4 +1,5 @@ import { isAddress } from "viem" +import { SDK_NAME } from "../bitcoinUtils/constants" import { EVMEndpointContract } from "../evmUtils/evmContractAddresses" import { BigNumber } from "../utils/BigNumber" import { InvalidMethodParametersError } from "../utils/errors" @@ -6,7 +7,7 @@ import { InvalidMethodParametersError } from "../utils/errors" type SDKBrandedLiteral< Type extends string, T extends string | number, -> = `${T} (BroSDK ${Type})` +> = `${T} (${typeof SDK_NAME} ${Type})` /** * Represents a unique identifier for a blockchain network. @@ -63,7 +64,7 @@ export const isEVMAddress = isAddress export type RuneIdCombined = `${number}:${number}` export const evmNativeCurrencyAddress = Symbol( - "[BroSDK] EVM Native Currency Address", + `[${SDK_NAME}] EVM Native Currency Address`, ) export type EVMNativeCurrencyAddress = typeof evmNativeCurrencyAddress diff --git a/src/utils/errors.ts b/src/utils/errors.ts index 237f6cd..f183a29 100644 --- a/src/utils/errors.ts +++ b/src/utils/errors.ts @@ -1,3 +1,4 @@ +import { SDK_NAME } from "../bitcoinUtils/constants" import { ChainId, TokenId } from "../sdkUtils/types" import { SwapRouteViaALEX, @@ -8,7 +9,7 @@ import { export class BroSDKErrorBase extends Error { constructor(...args: ConstructorParameters) { super(...args) - this.name = "BroSDKErrorBase" + this.name = `${SDK_NAME}ErrorBase` } }