Skip to content

Commit

Permalink
feat: add uid type (#74)
Browse files Browse the repository at this point in the history
Co-authored-by: Milap Sheth <milap@interoplabs.io>
  • Loading branch information
npty and milapsheth authored Jul 19, 2024
1 parent b1f9ca6 commit 1b8d4b6
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/hip-ears-act.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@axelar-network/axelar-cgp-sui': patch
---

Added UID type
1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export * from './bcs';
export * from './tx-builder';
export * from './utils';
export * from './types';
7 changes: 7 additions & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
const { bcs } = require('@mysten/sui.js/bcs');
const { fromHEX, toHEX } = require('@mysten/bcs');

export const UID = bcs.fixedArray(32, bcs.u8()).transform({
input: (id: string) => fromHEX(id),
output: (id: number[]) => toHEX(Uint8Array.from(id)),
});

0 comments on commit 1b8d4b6

Please sign in to comment.