Skip to content

Commit

Permalink
refactor(core)!: change type of Asset.name to AssetName
Browse files Browse the repository at this point in the history
  • Loading branch information
mkazlauskas committed Jan 18, 2022
1 parent 51a57ab commit ced96ed
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/core/src/Cardano/types/Asset.ts
Expand Up @@ -4,6 +4,9 @@ import { TransactionId } from './Transaction';

export type AssetId = OpaqueString<'AssetId'>;

/**
* Hex-encoded asset name
*/
export type AssetName = OpaqueString<'AssetName'>;
export const AssetName = (value: string): AssetName => {
if (value.length > 0) {
Expand All @@ -26,6 +29,9 @@ export const AssetId = (value: string): AssetId => {
return value as unknown as AssetId;
};

/**
* Hex-encoded policy id
*/
export type PolicyId = Hash28ByteBase16<'PolicyId'>;
export const PolicyId = (value: string): PolicyId => Hash28ByteBase16(value);

Expand Down Expand Up @@ -104,7 +110,7 @@ export interface AssetMintOrBurn {
export interface Asset {
assetId: AssetId;
policyId: PolicyId;
name: string;
name: AssetName;
fingerprint: AssetFingerprint;
quantity: bigint;
/**
Expand Down

0 comments on commit ced96ed

Please sign in to comment.