forked from MystenLabs/sui
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add flags to zklogin methods that derive addresses and migrate zksend…
… sdk to sui sdk (MystenLabs#20310) ## 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
1 parent
8bd5399
commit ec2dc7f
Showing
25 changed files
with
470 additions
and
315 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@mysten/sui': minor | ||
--- | ||
|
||
Add legacyAddress flag to zklogin methods that generate addresses |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
--- | ||
'@mysten/sui': minor | ||
'@mysten/zklogin': minor | ||
--- | ||
|
||
All functionality from `@mysten/zklogin` has been moved to `@mysten/sui/zklogin` | ||
|
||
For most methods, simply replace the `@mysten/zklogin` import with `@mysten/sui/zklogin` | ||
|
||
2 Methods require one small additional change: | ||
|
||
`computeZkLoginAddress` and `jwtToAddress` have new `legacyAddress` flags which must be set to true for backwards compatibility: | ||
|
||
```diff | ||
- import { computeZkLoginAddress, jwtToAddress } from '@mysten/zklogin'; | ||
+ import { computeZkLoginAddress, jwtToAddress } from '@mysten/sui/zklogin'; | ||
|
||
const address = jwtToAddress( | ||
jwtAsString, | ||
salt, | ||
+ true | ||
); | ||
const address = computeZkLoginAddress({ | ||
claimName, | ||
claimValue, | ||
iss, | ||
aud, | ||
userSalt: BigInt(salt), | ||
+ legacyAddress: true, | ||
}); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.