Skip to content

Commit

Permalink
Add improved non-UMA LNURL compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
jklein24 committed Mar 8, 2024
1 parent 9ef03fb commit e424ad1
Show file tree
Hide file tree
Showing 6 changed files with 769 additions and 229 deletions.
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

0 comments on commit e424ad1

Please sign in to comment.