feat: add more exports

This commit is contained in:
c4605
2025-04-24 23:12:56 +02:00
parent e049f7020d
commit 0b242937a9
4 changed files with 19 additions and 6 deletions

View File

@@ -151,6 +151,8 @@ export {
} from "./sdkUtils/bridgeFromRunes"
export {
BridgeFromStacksInput,
BridgeFromStacksInput_ContractCallOptions,
BridgeFromStacksInput_sendTransactionFn,
BridgeFromStacksOutput,
} from "./sdkUtils/bridgeFromStacks"
export {

View File

@@ -6,6 +6,7 @@ export {
SDKNumber,
SDKNumberifyNestly,
toSDKNumberOrUndefined,
formatSDKNumber,
EVMAddress,
evmNativeCurrencyAddress,
EVMNativeCurrencyAddress,

View File

@@ -2,9 +2,6 @@ import * as btc from "@scure/btc-signer"
import { FungiblePostConditionWire } from "@stacks/transactions"
import { addressToScriptPubKey } from "../bitcoinUtils/bitcoinHelpers"
import { getTerminatingStacksTokenContractAddress } from "../evmUtils/peggingHelpers"
import { contractAssignedChainIdFromKnownChain } from "../stacksUtils/crossContractDataMapping"
import { isSupportedStacksRoute } from "../stacksUtils/peggingHelpers"
import { StacksContractName } from "../stacksUtils/stxContractAddresses"
import {
composeTxBro,
ContractCallOptions,
@@ -12,6 +9,9 @@ import {
getStacksTokenContractInfo,
numberToStacksContractNumber,
} from "../stacksUtils/contractHelpers"
import { contractAssignedChainIdFromKnownChain } from "../stacksUtils/crossContractDataMapping"
import { isSupportedStacksRoute } from "../stacksUtils/peggingHelpers"
import { StacksContractName } from "../stacksUtils/stxContractAddresses"
import {
checkRouteValid,
KnownRoute_FromStacks_ToBitcoin,
@@ -26,6 +26,14 @@ import { KnownChainId, KnownTokenId } from "../utils/types/knownIds"
import { ChainId, SDKNumber, TokenId } from "./types"
import { SDKGlobalContext } from "./types.internal"
export type BridgeFromStacksInput_ContractCallOptions = ContractCallOptions
export type BridgeFromStacksInput_sendTransactionFn = (
tx: BridgeFromStacksInput_ContractCallOptions,
) => Promise<{
txid: string
}>
export interface BridgeFromStacksInput {
fromChain: ChainId
toChain: ChainId
@@ -34,9 +42,7 @@ export interface BridgeFromStacksInput {
fromAddress: string
toAddress: string
amount: SDKNumber
sendTransaction: (tx: ContractCallOptions) => Promise<{
txid: string
}>
sendTransaction: BridgeFromStacksInput_sendTransactionFn
}
export interface BridgeFromStacksOutput {

View File

@@ -58,6 +58,10 @@ export function toSDKNumberOrUndefined<
return BigNumber.toString(n) as SDKNumber
}
export function formatSDKNumber(n: SDKNumber | number | bigint | BigNumber): `${number}` {
return toSDKNumberOrUndefined(n) as `${number}`
}
export type EVMAddress = `0x${string}`
export const isEVMAddress = isAddress