Skip to content

Instantly share code, notes, and snippets.

@iryna-09
Created November 25, 2021 16:51
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save iryna-09/b91709491e5f950d43ea250618ce03ce to your computer and use it in GitHub Desktop.
Save iryna-09/b91709491e5f950d43ea250618ce03ce to your computer and use it in GitHub Desktop.
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