fix: minor fixes

This commit is contained in:
c4605
2025-04-21 13:00:59 +02:00
parent 3a66af7c78
commit 485a2827a6
4 changed files with 9 additions and 7 deletions

View File

@@ -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,

View File

@@ -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,

View File

@@ -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

View File

@@ -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<typeof Error>) {
super(...args)
this.name = "BroSDKErrorBase"
this.name = `${SDK_NAME}ErrorBase`
}
}