Skip to content

Commit f4d60b6

Browse files
Added optional Signers to XummPayloadDetailsMeta and XummPayloadOptions. (#13)
1 parent fc41946 commit f4d60b6

File tree

5 files changed

+90
-69
lines changed

5 files changed

+90
-69
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@
1919
"opened_by_deeplink": false,
2020
"return_url_app": "https://xumm.dev/beta/test?payloadId=00000000-0000-4839-af2f-f794874a80b0&customIdent=&txid=&hex=",
2121
"return_url_web": "https://xumm.dev/beta/test?payloadId=00000000-0000-4839-af2f-f794874a80b0&customIdent=&txid=&hex=",
22-
"is_xapp": false
22+
"is_xapp": false,
23+
"signers": [ "rwietsevLFg8XSmG3bEZzFein1g8RBqWDZ", "rXUMMMaopSo4RUvucwS993hBegnK8WmwV" ]
2324
},
2425
"custom_meta": {
2526
"identifier": null,

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515
"opened_by_deeplink": true,
1616
"return_url_app": "https://xumm.dev/beta/test?payloadId=00000000-0000-4839-af2f-f794874a80b0&customIdent=&txid=9B124C14528ED14C0BDA17075A39B90ABED598B77A22DFEEBD913CAC07A513BC&hex=1200032280000000240000003241833237B8665D2F4E00135E8DE646589F68400000000000000C732103709723A5967EAAED571B71DB511D87FA44CC7CDDF827A37F457A25E14D862BCD74473045022100C6A6999BD33153C6A236D78438D1BFEEEC810CFE05D0E41339B577560C9143CA022074F07881F559F56593FF680049C12FC3BCBB0B73CE02338651522891D95886F981146078086881F39B191D63B528D914FEA7F8CA2293F9EA7C06636C69656E747D15426974686F6D7020746F6F6C20762E20302E302E337E0A706C61696E2F74657874E1F1",
1717
"return_url_web": "https://xumm.dev/beta/test?payloadId=00000000-0000-4839-af2f-f794874a80b0&customIdent=&txid=9B124C14528ED14C0BDA17075A39B90ABED598B77A22DFEEBD913CAC07A513BC&hex=1200032280000000240000003241833237B8665D2F4E00135E8DE646589F68400000000000000C732103709723A5967EAAED571B71DB511D87FA44CC7CDDF827A37F457A25E14D862BCD74473045022100C6A6999BD33153C6A236D78438D1BFEEEC810CFE05D0E41339B577560C9143CA022074F07881F559F56593FF680049C12FC3BCBB0B73CE02338651522891D95886F981146078086881F39B191D63B528D914FEA7F8CA2293F9EA7C06636C69656E747D15426974686F6D7020746F6F6C20762E20302E302E337E0A706C61696E2F74657874E1F1",
18-
"is_xapp": false
18+
"is_xapp": false,
19+
"signers": null
1920
},
2021
"application": {
2122
"name": "SomeApp",

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

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,12 @@ internal static class PayloadFixtures
1919
{
2020
QrPng = "http://localhost:3001/sign/00000000-0000-4839-af2f-f794874a80b0_q.png",
2121
QrMatrix = "http://localhost:3001/sign/00000000-0000-4839-af2f-f794874a80b0_q.json",
22-
QrUriQualityOpts = new List<string> { "m", "q", "h" },
22+
QrUriQualityOpts = new List<string>
23+
{
24+
"m",
25+
"q",
26+
"h"
27+
},
2328
WebsocketStatus = "ws://localhost:3001/sign/00000000-0000-4839-af2f-f794874a80b0"
2429
},
2530
Pushed = false
@@ -42,9 +47,12 @@ internal static class PayloadFixtures
4247
Pushed = false,
4348
AppOpened = true,
4449
OpenedByDeeplink = true,
45-
ReturnUrlApp = "https://xumm.dev/beta/test?payloadId=00000000-0000-4839-af2f-f794874a80b0&customIdent=&txid=9B124C14528ED14C0BDA17075A39B90ABED598B77A22DFEEBD913CAC07A513BC&hex=1200032280000000240000003241833237B8665D2F4E00135E8DE646589F68400000000000000C732103709723A5967EAAED571B71DB511D87FA44CC7CDDF827A37F457A25E14D862BCD74473045022100C6A6999BD33153C6A236D78438D1BFEEEC810CFE05D0E41339B577560C9143CA022074F07881F559F56593FF680049C12FC3BCBB0B73CE02338651522891D95886F981146078086881F39B191D63B528D914FEA7F8CA2293F9EA7C06636C69656E747D15426974686F6D7020746F6F6C20762E20302E302E337E0A706C61696E2F74657874E1F1",
46-
ReturnUrlWeb = "https://xumm.dev/beta/test?payloadId=00000000-0000-4839-af2f-f794874a80b0&customIdent=&txid=9B124C14528ED14C0BDA17075A39B90ABED598B77A22DFEEBD913CAC07A513BC&hex=1200032280000000240000003241833237B8665D2F4E00135E8DE646589F68400000000000000C732103709723A5967EAAED571B71DB511D87FA44CC7CDDF827A37F457A25E14D862BCD74473045022100C6A6999BD33153C6A236D78438D1BFEEEC810CFE05D0E41339B577560C9143CA022074F07881F559F56593FF680049C12FC3BCBB0B73CE02338651522891D95886F981146078086881F39B191D63B528D914FEA7F8CA2293F9EA7C06636C69656E747D15426974686F6D7020746F6F6C20762E20302E302E337E0A706C61696E2F74657874E1F1",
47-
IsXapp = false
50+
ReturnUrlApp =
51+
"https://xumm.dev/beta/test?payloadId=00000000-0000-4839-af2f-f794874a80b0&customIdent=&txid=9B124C14528ED14C0BDA17075A39B90ABED598B77A22DFEEBD913CAC07A513BC&hex=1200032280000000240000003241833237B8665D2F4E00135E8DE646589F68400000000000000C732103709723A5967EAAED571B71DB511D87FA44CC7CDDF827A37F457A25E14D862BCD74473045022100C6A6999BD33153C6A236D78438D1BFEEEC810CFE05D0E41339B577560C9143CA022074F07881F559F56593FF680049C12FC3BCBB0B73CE02338651522891D95886F981146078086881F39B191D63B528D914FEA7F8CA2293F9EA7C06636C69656E747D15426974686F6D7020746F6F6C20762E20302E302E337E0A706C61696E2F74657874E1F1",
52+
ReturnUrlWeb =
53+
"https://xumm.dev/beta/test?payloadId=00000000-0000-4839-af2f-f794874a80b0&customIdent=&txid=9B124C14528ED14C0BDA17075A39B90ABED598B77A22DFEEBD913CAC07A513BC&hex=1200032280000000240000003241833237B8665D2F4E00135E8DE646589F68400000000000000C732103709723A5967EAAED571B71DB511D87FA44CC7CDDF827A37F457A25E14D862BCD74473045022100C6A6999BD33153C6A236D78438D1BFEEEC810CFE05D0E41339B577560C9143CA022074F07881F559F56593FF680049C12FC3BCBB0B73CE02338651522891D95886F981146078086881F39B191D63B528D914FEA7F8CA2293F9EA7C06636C69656E747D15426974686F6D7020746F6F6C20762E20302E302E337E0A706C61696E2F74657874E1F1",
54+
IsXapp = false,
55+
Signers = null
4856
},
4957
Application = new XummApplication
5058
{
@@ -110,7 +118,11 @@ internal static class PayloadFixtures
110118
OpenedByDeeplink = false,
111119
ReturnUrlApp = "https://xumm.dev/beta/test?payloadId=00000000-0000-4839-af2f-f794874a80b0&customIdent=&txid=&hex=",
112120
ReturnUrlWeb = "https://xumm.dev/beta/test?payloadId=00000000-0000-4839-af2f-f794874a80b0&customIdent=&txid=&hex=",
113-
IsXapp = false
121+
IsXapp = false,
122+
Signers = new[]
123+
{
124+
"rwietsevLFg8XSmG3bEZzFein1g8RBqWDZ", "rXUMMMaopSo4RUvucwS993hBegnK8WmwV"
125+
}
114126
},
115127
CustomMeta = new XummPayloadCustomMeta
116128
{
Lines changed: 40 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,60 @@
11
using System.Text.Json.Serialization;
22

3-
namespace XUMM.NET.SDK.Models.Payload
3+
namespace XUMM.NET.SDK.Models.Payload;
4+
5+
public class XummPayloadDetailsMeta
46
{
5-
public class XummPayloadDetailsMeta
6-
{
7-
[JsonPropertyName("exists")]
8-
public bool Exists { get; set; }
7+
[JsonPropertyName("exists")]
8+
public bool Exists { get; set; }
9+
10+
[JsonPropertyName("uuid")]
11+
public string Uuid { get; set; } = default!;
912

10-
[JsonPropertyName("uuid")]
11-
public string Uuid { get; set; } = default!;
13+
[JsonPropertyName("multisign")]
14+
public bool Multisign { get; set; }
1215

13-
[JsonPropertyName("multisign")]
14-
public bool Multisign { get; set; }
16+
[JsonPropertyName("submit")]
17+
public bool Submit { get; set; }
1518

16-
[JsonPropertyName("submit")]
17-
public bool Submit { get; set; }
19+
[JsonPropertyName("destination")]
20+
public string Destination { get; set; } = default!;
1821

19-
[JsonPropertyName("destination")]
20-
public string Destination { get; set; } = default!;
22+
[JsonPropertyName("resolved_destination")]
23+
public string ResolvedDestination { get; set; } = default!;
2124

22-
[JsonPropertyName("resolved_destination")]
23-
public string ResolvedDestination { get; set; } = default!;
25+
[JsonPropertyName("resolved")]
26+
public bool Resolved { get; set; }
2427

25-
[JsonPropertyName("resolved")]
26-
public bool Resolved { get; set; }
28+
[JsonPropertyName("signed")]
29+
public bool Signed { get; set; }
2730

28-
[JsonPropertyName("signed")]
29-
public bool Signed { get; set; }
31+
[JsonPropertyName("cancelled")]
32+
public bool Cancelled { get; set; }
3033

31-
[JsonPropertyName("cancelled")]
32-
public bool Cancelled { get; set; }
34+
[JsonPropertyName("expired")]
35+
public bool Expired { get; set; }
3336

34-
[JsonPropertyName("expired")]
35-
public bool Expired { get; set; }
37+
[JsonPropertyName("pushed")]
38+
public bool Pushed { get; set; }
3639

37-
[JsonPropertyName("pushed")]
38-
public bool Pushed { get; set; }
40+
[JsonPropertyName("app_opened")]
41+
public bool AppOpened { get; set; }
3942

40-
[JsonPropertyName("app_opened")]
41-
public bool AppOpened { get; set; }
43+
[JsonPropertyName("opened_by_deeplink")]
44+
public bool? OpenedByDeeplink { get; set; }
4245

43-
[JsonPropertyName("opened_by_deeplink")]
44-
public bool? OpenedByDeeplink { get; set; }
46+
[JsonPropertyName("openedimmutable_by_deeplink")]
47+
public bool? Immutable { get; set; }
4548

46-
[JsonPropertyName("openedimmutable_by_deeplink")]
47-
public bool? Immutable { get; set; }
49+
[JsonPropertyName("return_url_app")]
50+
public string? ReturnUrlApp { get; set; }
4851

49-
[JsonPropertyName("return_url_app")]
50-
public string? ReturnUrlApp { get; set; }
52+
[JsonPropertyName("return_url_web")]
53+
public string? ReturnUrlWeb { get; set; }
5154

52-
[JsonPropertyName("return_url_web")]
53-
public string? ReturnUrlWeb { get; set; }
55+
[JsonPropertyName("is_xapp")]
56+
public bool IsXapp { get; set; }
5457

55-
[JsonPropertyName("is_xapp")]
56-
public bool IsXapp { get; set; }
57-
}
58+
[JsonPropertyName("signers")]
59+
public string[]? Signers { get; set; }
5860
}
Lines changed: 29 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,36 @@
11
using System.Text.Json.Serialization;
22

3-
namespace XUMM.NET.SDK.Models.Payload
3+
namespace XUMM.NET.SDK.Models.Payload;
4+
5+
public class XummPayloadOptions
46
{
5-
public class XummPayloadOptions
6-
{
7-
/// <summary>
8-
/// Should the xumm app submit to the XRPL after signing? (Optional)
9-
/// </summary>
10-
[JsonPropertyName("submit")]
11-
public bool? Submit { get; set; }
7+
/// <summary>
8+
/// Should the xumm app submit to the XRPL after signing? (Optional)
9+
/// </summary>
10+
[JsonPropertyName("submit")]
11+
public bool? Submit { get; set; }
12+
13+
/// <summary>
14+
/// Should the transaction be signed as a multi sign transaction? (Optional)
15+
/// </summary>
16+
[JsonPropertyName("multisign")]
17+
public bool? MultiSign { get; set; }
1218

13-
/// <summary>
14-
/// Should the transaction be signed as a multi sign transaction? (Optional)
15-
/// </summary>
16-
[JsonPropertyName("multisign")]
17-
public bool? MultiSign { get; set; }
19+
/// <summary>
20+
/// After how many minutes should the payload expire? (Optional)
21+
/// </summary>
22+
[JsonPropertyName("expire")]
23+
public int Expire { get; set; }
1824

19-
/// <summary>
20-
/// After how many minutes should the payload expire? (Optional)
21-
/// </summary>
22-
[JsonPropertyName("expire")]
23-
public int Expire { get; set; }
25+
/// <summary>
26+
/// Force any of the provided accounts to sign. (Optional)
27+
/// </summary>
28+
[JsonPropertyName("signers")]
29+
public string[]? Signers { get; set; }
2430

25-
/// <summary>
26-
/// Where should the user be redirected to after resolving the payload? (Optional)
27-
/// </summary>
28-
[JsonPropertyName("return_url")]
29-
public XummPayloadReturnUrl? ReturnUrl { get; set; }
30-
}
31+
/// <summary>
32+
/// Where should the user be redirected to after resolving the payload? (Optional)
33+
/// </summary>
34+
[JsonPropertyName("return_url")]
35+
public XummPayloadReturnUrl? ReturnUrl { get; set; }
3136
}

0 commit comments

Comments
 (0)