Created
November 25, 2021 16:51
-
-
Save iryna-09/b91709491e5f950d43ea250618ce03ce to your computer and use it in GitHub Desktop.
This file contains 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
val clientConnection = client.start(rpcUsername, rpcPassword) | |
val proxy = clientConnection.proxy | |
val nodes = proxy.networkMapSnapshot() | |
val partyA = getNodeWithName(nodes,"PartyA", "O=PartyA, L=London, C=GB") | |
val partyB = getNodeWithName(nodes,"PartyB", "O=PartyB, L=New York, C=US") | |
// Instead of searching for accounts owned by PartyA you can simply pass the PaymentAccountId to the MakePayment flow | |
val accountA = proxy.startTrackedFlow( | |
::PaymentAccounts, | |
partyA | |
).returnValue.getOrThrow().first() | |
// Instead of searching for accounts owned by PartyB you can simply pass the PaymentAccountId to the MakePayment flow | |
val accountB = proxy.startTrackedFlow( | |
::PaymentAccounts, | |
partyB | |
).returnValue.getOrThrow().first() | |
val paymentState = proxy.startTrackedFlow( | |
::MakePayment, | |
250 of GBP, | |
accountA.accountId, | |
accountB.accountId | |
).returnValue.getOrThrow() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment