mirror of
https://github.com/Brotocol-xyz/bro-sdk.git
synced 2026-01-12 06:44:18 +08:00
feat: add more exports
This commit is contained in:
@@ -151,6 +151,8 @@ export {
|
||||
} from "./sdkUtils/bridgeFromRunes"
|
||||
export {
|
||||
BridgeFromStacksInput,
|
||||
BridgeFromStacksInput_ContractCallOptions,
|
||||
BridgeFromStacksInput_sendTransactionFn,
|
||||
BridgeFromStacksOutput,
|
||||
} from "./sdkUtils/bridgeFromStacks"
|
||||
export {
|
||||
|
||||
@@ -6,6 +6,7 @@ export {
|
||||
SDKNumber,
|
||||
SDKNumberifyNestly,
|
||||
toSDKNumberOrUndefined,
|
||||
formatSDKNumber,
|
||||
EVMAddress,
|
||||
evmNativeCurrencyAddress,
|
||||
EVMNativeCurrencyAddress,
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user