Skip to content

Commit f164270

Browse files
PathfindingFallback and ForceNetwork payload options (#30)
* Added `PathfindingFallback` and `ForceNetwork` to the Payload Options.
1 parent 92e86da commit f164270

File tree

5 files changed

+35
-9
lines changed

5 files changed

+35
-9
lines changed

src/XUMM.NET.SDK.Tests/Data/payload-cancel.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
"multisign": false,
1010
"submit": false,
1111
"pathfinding": true,
12+
"pathfinding_fallback": true,
13+
"force_network": "MAINNET",
1214
"destination": "",
1315
"resolved_destination": "",
1416
"resolved": false,

src/XUMM.NET.SDK.Tests/Data/payload-get.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44
"uuid": "00000000-0000-4839-af2f-f794874a80b0",
55
"multisign": false,
66
"submit": false,
7-
"pathfinding": null,
7+
"pathfinding": false,
8+
"pathfinding_fallback": false,
9+
"force_network": null,
810
"destination": "",
911
"resolved_destination": "",
1012
"resolved": true,

src/XUMM.NET.SDK.Tests/Fixtures/PayloadFixtures.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@ internal static class PayloadFixtures
3838
Uuid = "00000000-0000-4839-af2f-f794874a80b0",
3939
Multisign = false,
4040
Submit = false,
41-
Pathfinding = null,
41+
Pathfinding = false,
42+
PathfindingFallback = false,
43+
ForceNetwork = null,
4244
Destination = string.Empty,
4345
ResolvedDestination = string.Empty,
4446
Resolved = true,
@@ -109,6 +111,8 @@ internal static class PayloadFixtures
109111
Multisign = false,
110112
Submit = false,
111113
Pathfinding = true,
114+
PathfindingFallback = true,
115+
ForceNetwork = "MAINNET",
112116
Destination = string.Empty,
113117
ResolvedDestination = string.Empty,
114118
Resolved = false,

src/XUMM.NET.SDK/Models/Payload/XummPayloadDetailsMeta.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,13 @@ public class XummPayloadDetailsMeta
1717
public bool Submit { get; set; }
1818

1919
[JsonPropertyName("pathfinding")]
20-
public bool? Pathfinding { get; set; }
20+
public bool Pathfinding { get; set; }
21+
22+
[JsonPropertyName("pathfinding_fallback")]
23+
public bool PathfindingFallback { get; set; }
24+
25+
[JsonPropertyName("force_network")]
26+
public string? ForceNetwork { get; set; } = default!;
2127

2228
[JsonPropertyName("destination")]
2329
public string Destination { get; set; } = default!;

src/XUMM.NET.SDK/Models/Payload/XummPayloadOptions.cs

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,37 +5,49 @@ namespace XUMM.NET.SDK.Models.Payload;
55
public class XummPayloadOptions
66
{
77
/// <summary>
8-
/// Should the xumm app submit to the XRPL after signing? (Optional)
8+
/// (Optional) Should the xumm app submit to the XRPL after signing?
99
/// </summary>
1010
[JsonPropertyName("submit")]
1111
public bool? Submit { get; set; }
1212

1313
/// <summary>
14-
/// Allow pathfinding for regular Payment type transactions, so the user can select the asset to send to deliver the requested asset amount.
14+
/// (Optional) Allow pathfinding for regular Payment type transactions, so the user can select the asset to send to deliver the requested asset amount.
1515
/// </summary>
1616
[JsonPropertyName("pathfinding")]
1717
public bool? Pathfinding { get; set; }
1818

1919
/// <summary>
20-
/// Should the transaction be signed as a multi sign transaction? (Optional)
20+
/// (Optional) Allow Xumm clients &lt; version 2.4.0 to fall back from modern pathfinding UX to a native 1:1 asset payment.
21+
/// </summary>
22+
[JsonPropertyName("pathfinding_fallback")]
23+
public bool? PathfindingFallback { get; set; }
24+
25+
/// <summary>
26+
/// (Optional) Should the transaction be signed as a multi sign transaction?
2127
/// </summary>
2228
[JsonPropertyName("multisign")]
2329
public bool? MultiSign { get; set; }
2430

2531
/// <summary>
26-
/// After how many minutes should the payload expire? (Optional)
32+
/// (Optional) After how many minutes should the payload expire?
2733
/// </summary>
2834
[JsonPropertyName("expire")]
2935
public int Expire { get; set; }
3036

3137
/// <summary>
32-
/// Force any of the provided accounts to sign. (Optional)
38+
/// (Optional) Force any of the provided accounts to sign.
3339
/// </summary>
3440
[JsonPropertyName("signers")]
3541
public string[]? Signers { get; set; }
3642

3743
/// <summary>
38-
/// Where should the user be redirected to after resolving the payload? (Optional)
44+
/// (Optional) When set, the payload can only be opened by a device connected to the specified network. Xumm 2.5.0 and higher required.
45+
/// </summary>
46+
[JsonPropertyName("force_network")]
47+
public string? ForceNetwork { get; set; }
48+
49+
/// <summary>
50+
/// (Optional) Where should the user be redirected to after resolving the payload?
3951
/// </summary>
4052
[JsonPropertyName("return_url")]
4153
public XummPayloadReturnUrl? ReturnUrl { get; set; }

0 commit comments

Comments
 (0)