Skip to content

Instantly share code, notes, and snippets.

@WietseWind
Last active July 20, 2023 13:14
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save WietseWind/c7b6addfd9b8cb465894209cc9073c47 to your computer and use it in GitHub Desktop.
Save WietseWind/c7b6addfd9b8cb465894209cc9073c47 to your computer and use it in GitHub Desktop.
PayChan in Xumm
// Creating the channel
{
"txjson": {
"TransactionType": "PaymentChannelCreate",
"Amount": "1000000",
"Destination": "rfHn6cB5mmqZ6fHZ4fdemCDSxqLTijgMwo",
"PublicKey": "037E3F11237DF2E0EBFE3B5872A5BB76F1C05DE079BA44E157E7896F0AFC7F7BE8", // Only needed if not the signer
"SettleDelay": 1
}
}
// Signing a receipt
{
"txjson": {
"TransactionType": "PaymentChannelAuthorize",
"Channel": "5542564CB513FB955DDC37F905819C518698F9A60BCC33B02BAD3CA33B66702F",
"Amount": "500000"
}
}
// Claiming the receipt
{
"txjson": {
"TransactionType": "PaymentChannelClaim",
"Channel": "5542564CB513FB955DDC37F905819C518698F9A60BCC33B02BAD3CA33B66702F",
"PublicKey": "0350714189757DA0403CE1FF2025522337EA1B60D9796B11D5559EE914982D6AC3",
"Signature": "304502210091E5012EB5A9BE2530353A35F183694677574285A390B38973EF6E3D97519D9C02202C7806E525C6F7536CBE81992119C2014119174F4AB7C9B3F2065D8ADCD55FAC",
"Amount": "750000", // Claim, NO NEED, USE BALANCE CUMULATIVE ONLY
"Balance": "500000" // Current channel balance + claim post claim
}
}
// Closing the channel
{
"txjson": {
"TransactionType": "PaymentChannelClaim",
"Channel": "F4F3F3CEB117C5EB10597536C76034D1801C0C4980044B632D4CB7F1E9EC0956",
"Flags": 131072
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment