-
Notifications
You must be signed in to change notification settings - Fork 137
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollback SEP23 (Muxed Account strkeys) support. (#349)
* Don't accept muxed accounts as a destination. * Always encode xdr.MuxedAccount to G addresses. * Rename helper function. * Always show ed25219 address in transaction source and fee bump fee source. * Remove SEP23 support. * Update changelog.
- Loading branch information
Showing
15 changed files
with
118 additions
and
275 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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import xdr from '../generated/stellar-xdr_generated'; | ||
import { StrKey } from '../strkey'; | ||
|
||
/** | ||
* Returns a XDR.MuxedAccount forcing the ed25519 discriminant. | ||
* @function | ||
* @param {string} address address to encode to XDR. | ||
* @returns {xdr.MuxedAccount} MuxedAccount with ed25519 discriminant. | ||
*/ | ||
export function decodeAddressToMuxedAccount(address) { | ||
return xdr.MuxedAccount.keyTypeEd25519( | ||
StrKey.decodeEd25519PublicKey(address) | ||
); | ||
} | ||
|
||
/** | ||
* Converts an xdr.MuxedAccount to its string representation, forcing the ed25519 representation. | ||
* @function | ||
* @param {xdr.MuxedAccount} muxedAccount . | ||
* @returns {string} address | ||
*/ | ||
export function encodeMuxedAccountToAddress(muxedAccount) { | ||
let ed25519; | ||
if (muxedAccount.switch() === xdr.CryptoKeyType.keyTypeEd25519()) { | ||
ed25519 = muxedAccount.ed25519(); | ||
} else { | ||
ed25519 = muxedAccount.med25519().ed25519(); | ||
} | ||
|
||
return StrKey.encodeEd25519PublicKey(ed25519); | ||
} |
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.