Skip to content

Commit

Permalink
[zksend] add claimedBy property when loading assets of claimed link (#…
Browse files Browse the repository at this point in the history
…20244)

## Description 

Describe the changes or additions included in this PR.

## Test plan 

How did you test the new or updated feature?

---

## Release notes

Check each box that your changes affect. If none of the boxes relate to
your changes, release notes aren't required.

For each box you select, include information after the relevant heading
that describes the impact of your changes that a user might notice and
any actions they must take to implement updates.

- [ ] Protocol: 
- [ ] Nodes (Validators and Full nodes): 
- [ ] Indexer: 
- [ ] JSON-RPC: 
- [ ] GraphQL: 
- [ ] CLI: 
- [ ] Rust SDK:
- [ ] REST API:
  • Loading branch information
hayes-mysten authored Nov 13, 2024
1 parent 43d7c3d commit 364a93a
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 6 deletions.
5 changes: 5 additions & 0 deletions .changeset/loud-pianos-compare.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@mysten/zksend': minor
---

Remove decoding spaces to `+` in zksend wallet url hashes
5 changes: 5 additions & 0 deletions .changeset/witty-adults-notice.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@mysten/zksend': minor
---

Add claimedBy property that is set when claimedAssets are loaded
2 changes: 2 additions & 0 deletions sdk/zksend/src/links/claim.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ export class ZkSendLink {
creatorAddress?: string;
assets?: LinkAssets;
claimed?: boolean;
claimedBy?: string;
bagObject?: SuiObjectData | null;

#client: SuiClient;
Expand Down Expand Up @@ -532,6 +533,7 @@ export class ZkSendLink {
? input.value
: bcs.Address.parse(new Uint8Array((input.value as { Pure: number[] }).Pure));

this.claimedBy = receiver;
this.assets = getAssetsFromTransaction({
transaction: tx,
address: receiver,
Expand Down
7 changes: 1 addition & 6 deletions sdk/zksend/src/wallet/channel/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,12 +131,7 @@ export class StashedHost {
const parsed = new URL(url);

const urlHashData = parsed.hash
? Object.fromEntries(
[...new URLSearchParams(parsed.hash.slice(1))].map(([key, value]) => [
key,
value.replace(/ /g, '+'),
]),
)
? Object.fromEntries([...new URLSearchParams(parsed.hash.slice(1))])
: {};

const request = parse(StashedRequest, {
Expand Down

0 comments on commit 364a93a

Please sign in to comment.