aboutsummaryrefslogtreecommitdiffstats
path: root/packages/pipeline/src/entities/token_metadata.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/pipeline/src/entities/token_metadata.ts')
-rw-r--r--packages/pipeline/src/entities/token_metadata.ts9
1 files changed, 5 insertions, 4 deletions
diff --git a/packages/pipeline/src/entities/token_metadata.ts b/packages/pipeline/src/entities/token_metadata.ts
index ca1e57937..911b53972 100644
--- a/packages/pipeline/src/entities/token_metadata.ts
+++ b/packages/pipeline/src/entities/token_metadata.ts
@@ -1,5 +1,8 @@
+import { BigNumber } from '@0x/utils';
import { Column, Entity, PrimaryColumn } from 'typeorm';
+import { bigNumberTransformer } from '../utils/transformers';
+
@Entity({ name: 'token_metadata', schema: 'raw' })
export class TokenMetadata {
@PrimaryColumn({ type: 'varchar', nullable: false })
@@ -8,10 +11,8 @@ export class TokenMetadata {
@PrimaryColumn({ type: 'varchar', nullable: false })
public authority!: string;
- // TODO(albrow): Convert decimals field to type BigNumber/numeric because it
- // comes from a 256-bit integer in a smart contract.
- @Column({ type: 'integer', nullable: true })
- public decimals!: number | null;
+ @Column({ type: 'numeric', transformer: bigNumberTransformer, nullable: true })
+ public decimals!: BigNumber | null;
@Column({ type: 'varchar', nullable: true })
public symbol!: string | null;