format react with linter

This commit is contained in:
Jesse de Wit
2023-11-10 21:26:19 +01:00
committed by ok300
parent 48fe09ea98
commit 707a11c3fa
12 changed files with 207 additions and 207 deletions

View File

@@ -1,47 +1,47 @@
import {
BreezEvent,
connect,
defaultConfig,
EnvironmentType,
mnemonicToSeed,
NodeConfig,
NodeConfigVariant,
nodeInfo
} from "@breeztech/react-native-breez-sdk"
type BreezEvent,
connect,
defaultConfig,
EnvironmentType,
mnemonicToSeed,
type NodeConfig,
NodeConfigVariant,
nodeInfo
} from '@breeztech/react-native-breez-sdk'
const exampleGettingStarted = async () => {
// ANCHOR: init-sdk
// SDK events listener
const onBreezEvent = (e: BreezEvent) => {
console.log(`Received event ${e.type}`)
// ANCHOR: init-sdk
// SDK events listener
const onBreezEvent = (e: BreezEvent) => {
console.log(`Received event ${e.type}`)
}
// Create the default config
const seed = await mnemonicToSeed('<mnemonics words>')
const inviteCode = '<invite code>'
const apiKey = '<api key>'
const nodeConfig: NodeConfig = {
type: NodeConfigVariant.GREENLIGHT,
config: {
inviteCode
}
}
// Create the default config
const seed = await mnemonicToSeed("<mnemonics words>")
const inviteCode = "<invite code>"
const apiKey = "<api key>"
const nodeConfig: NodeConfig = {
type: NodeConfigVariant.GREENLIGHT,
config: {
inviteCode
}
}
const config = await defaultConfig(
EnvironmentType.PRODUCTION,
apiKey,
nodeConfig
)
const config = await defaultConfig(
EnvironmentType.PRODUCTION,
apiKey,
nodeConfig
)
// Connect to the Breez SDK make it ready for use
await connect(config, seed, onBreezEvent)
// ANCHOR_END: init-sdk
// Connect to the Breez SDK make it ready for use
await connect(config, seed, onBreezEvent)
// ANCHOR_END: init-sdk
}
const exampleFetchNodeInfo = async () => {
// ANCHOR: fetch-balance
const nodeState = await nodeInfo()
const balanceLn = nodeState.channelsBalanceMsat
const balanceOnchain = nodeState.onchainBalanceMsat
// ANCHOR_END: fetch-balance
// ANCHOR: fetch-balance
const nodeState = await nodeInfo()
const balanceLn = nodeState.channelsBalanceMsat
const balanceOnchain = nodeState.onchainBalanceMsat
// ANCHOR_END: fetch-balance
}