Skip to content

Commit

Permalink
Aptos address normalization (#121)
Browse files Browse the repository at this point in the history
  • Loading branch information
LukaStreamflow authored Jan 4, 2024
1 parent da5c995 commit 3b8c8c1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/stream/aptos/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@ function isAddressSpecial(address: string): boolean {
return false;
}

// Per this: https://github.com/aptos-labs/aptos-ts-sdk/blob/main/src/core/accountAddress.ts#L115
/**
* Aptos has inconsistencies in how it returns addresses.
* This method normalizes them to be 64 characters long, or leaves it as SPECIAL ADDRESS (0x0 - 0xf inclusive)
* Per this: https://github.com/aptos-labs/aptos-ts-sdk/blob/main/src/core/accountAddress.ts#L115
* */
export function normalizeAptosAddress(address: string): string {
if (isAddressSpecial(address)) {
return address;
Expand Down

0 comments on commit 3b8c8c1

Please sign in to comment.