-
Notifications
You must be signed in to change notification settings - Fork 3
feat: ldk-node serializable types #434
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
57207f8
feat: use serializable types from updated ldk-node
ovitrif a1db6f8
refactor: replace LnPeer with direct use of PeerDetails
ovitrif 8818e16
chore: use new ldk-node version from jitpack
ovitrif 97729fa
chore: lint
ovitrif c3da66f
chore: update baseline
ovitrif 698d954
fix: has external peers check efficiency
ovitrif 4e622f9
refactor: pass copy to clipboard text to callback
ovitrif 1e3c044
fix: peer details in ln node screen
ovitrif 4e13133
refactor: rename to trustedPeers & trustedPeerNodeIds
ovitrif a18e264
refactor: extract uri as var
ovitrif 4dffac9
feat: add quiet zone to qr code
ovitrif 7d4c1b2
fix: clear qr bitmap early on change
ovitrif a616a91
fix: prevent tooltip from consuming tap events
ovitrif 71af030
feat: polish qr transitions
ovitrif 905987b
chore: upgrade to bitkit-core 0.1.18
ovitrif 23b156e
refactor: add section header parameters
ovitrif 9e58ac8
Merge pull request #441 from synonymdev/feat/qr-quiet-zone
jvsena42 a0717bb
feat: polish channel orders dev settings screen
ovitrif 96f49e0
fix: print 'null'
ovitrif 059fd2c
Merge pull request #442 from synonymdev/bitkit-core-serializable
jvsena42 d8465b3
fix: handle potential empty address error
ovitrif 7826c49
Merge branch 'master' into feat/ldk-node-serializable
ovitrif File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| package to.bitkit.ext | ||
|
|
||
| import org.lightningdevkit.ldknode.PeerDetails | ||
|
|
||
| val PeerDetails.host get() = address.substringBefore(":") | ||
|
|
||
| val PeerDetails.port get() = address.substringAfter(":") | ||
|
|
||
| val PeerDetails.uri get() = "$nodeId@$address" | ||
|
|
||
| fun PeerDetails.Companion.parse(uri: String): PeerDetails { | ||
| val parts = uri.split("@") | ||
| require(parts.size == 2) { "Invalid uri format, expected: '<nodeId>@<host>:<port>', got: '$uri'" } | ||
|
|
||
| val nodeId = parts[0] | ||
|
|
||
| val addressParts = parts[1].split(":") | ||
| require(addressParts.size == 2) { "Invalid uri format, expected: '<nodeId>@<host>:<port>', got: '$uri'" } | ||
|
|
||
| val host = addressParts[0] | ||
| val port = addressParts[1] | ||
| val address = "$host:$port" | ||
|
|
||
| return PeerDetails( | ||
| nodeId = nodeId, | ||
| address = address, | ||
| isConnected = false, | ||
| isPersisted = false, | ||
| ) | ||
| } | ||
|
|
||
| fun PeerDetails.Companion.from(nodeId: String, host: String, port: String) = PeerDetails( | ||
| nodeId = nodeId, | ||
| address = "$host:$port", | ||
| isConnected = false, | ||
| isPersisted = false, | ||
| ) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.