Skip to content

Commit 3f42e2b

Browse files
Fix/include appropriate wallet for analytics (#304)
* Include embedded wallet address when using list sessions * Increment package version
1 parent efbbfbf commit 3f42e2b

File tree

5 files changed

+10
-6
lines changed

5 files changed

+10
-6
lines changed

Assets/SequenceSDK/WaaS/Tests/MockIntentSender.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public Task<T> PostIntent<T>(string payload, string path)
4646
throw new System.NotImplementedException();
4747
}
4848

49-
public Task<Session[]> ListSessions()
49+
public Task<Session[]> ListSessions(Address walletAddress = null)
5050
{
5151
throw new System.NotImplementedException();
5252
}

Packages/Sequence-Unity/Sequence/SequenceSDK/EmbeddedWallet/IIntentSender.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ public interface IIntentSender
77
public Task<T> SendIntent<T, T2>(T2 args, IntentType type, uint timeBeforeExpiryInSeconds = 30, uint currentTime = 0);
88
public Task<bool> DropSession(string dropSessionId);
99
public Task<T> PostIntent<T>(string payload, string path);
10-
public Task<Session[]> ListSessions();
10+
public Task<Session[]> ListSessions(Address walletAddress = null);
1111
public Task<SuccessfulTransactionReturn> GetTransactionReceipt(SuccessfulTransactionReturn response);
1212
}
1313
}

Packages/Sequence-Unity/Sequence/SequenceSDK/EmbeddedWallet/IntentSender.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,10 +173,14 @@ public async Task<T> PostIntent<T>(string payload, string path)
173173
return result;
174174
}
175175

176-
public async Task<Session[]> ListSessions()
176+
public async Task<Session[]> ListSessions(Address walletAddress = null)
177177
{
178+
if (walletAddress == null)
179+
{
180+
walletAddress = _sessionWallet.GetAddress();
181+
}
178182
Session[] sessions = await SendIntent<Session[], IntentDataListSessions>(
179-
new IntentDataListSessions(_sessionWallet.GetAddress()), IntentType.ListSessions);
183+
new IntentDataListSessions(walletAddress), IntentType.ListSessions);
180184
return sessions;
181185
}
182186

Packages/Sequence-Unity/Sequence/SequenceSDK/EmbeddedWallet/SequenceWallet.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ public async Task<Session[]> ListSessions()
247247
Session[] results = null;
248248
try
249249
{
250-
results = await _intentSender.ListSessions();
250+
results = await _intentSender.ListSessions(GetWalletAddress());
251251
}
252252
catch (Exception e)
253253
{

Packages/Sequence-Unity/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "xyz.0xsequence.waas-unity",
3-
"version": "4.2.1",
3+
"version": "4.2.2",
44
"displayName": "Sequence Embedded Wallet SDK",
55
"description": "A Unity SDK for Sequence APIs",
66
"unity": "2021.3",

0 commit comments

Comments
 (0)