Skip to content
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

Add improved non-UMA LNURL compatibility #22

Merged
merged 2 commits into from
Mar 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion uma/payee_data.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ type CompliancePayeeData struct {
// Utxos is a list of UTXOs of channels over which the receiver will likely receive the payment.
Utxos []string `json:"utxos"`
// UtxoCallback is the URL that the sender VASP will call to send UTXOs of the channel that the sender used to send the payment once it completes.
UtxoCallback string `json:"utxoCallback"`
UtxoCallback *string `json:"utxoCallback"`
// Signature is the base64-encoded signature of sha256(SenderAddress|ReceiverAddress|Nonce|Timestamp).
Signature string `json:"signature"`
// Nonce is a random string that is used to prevent replay attacks.
Expand Down
13 changes: 13 additions & 0 deletions uma/payer_data.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,3 +108,16 @@ type CompliancePayerData struct {
// UtxoCallback is the URL that the receiver will call to send UTXOs of the channel that the receiver used to receive the payment once it completes.
UtxoCallback string `json:"utxoCallback"`
}

func (c *CompliancePayerData) AsMap() (map[string]interface{}, error) {
complianceJson, err := json.Marshal(c)
if err != nil {
return nil, err
}
var complianceMap map[string]interface{}
err = json.Unmarshal(complianceJson, &complianceMap)
if err != nil {
return nil, err
}
return complianceMap, nil
}
Loading
Loading