Skip to content

Commit

Permalink
feat: add uid type
Browse files Browse the repository at this point in the history
  • Loading branch information
npty committed Jul 17, 2024
1 parent 1bc4c21 commit 8b3fee7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
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 8b3fee7

Please sign in to comment.