forked from mcintyre94/Jupalyse
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e003071
commit 3ce5a61
Showing
4 changed files
with
59 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { StringifiedNumber } from "./types"; | ||
|
||
export function numberDisplay(value: StringifiedNumber, decimals: number) { | ||
const formatter = Intl.NumberFormat("en-US", { | ||
maximumFractionDigits: decimals, | ||
}); | ||
|
||
// @ts-expect-error Typescript doesn't know about this format | ||
return formatter.format(`${value}E-${decimals}`); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import { Address } from "@solana/web3.js"; | ||
|
||
type StringifiedDate = string & { __brand: "StringifiedDate" }; | ||
export type StringifiedNumber = string & { __brand: "StringifiedNumber" }; | ||
|
||
export enum DCAStatus { | ||
OPEN = 0, | ||
CLOSED = 1, | ||
} | ||
|
||
export type DCAFetchedAccount = { | ||
createdAt: StringifiedDate; | ||
cycleFrequency: number; | ||
dcaKey: Address; | ||
inputMint: Address; | ||
outputMint: Address; | ||
inDeposited: StringifiedNumber; | ||
inAmountPerCycle: StringifiedNumber; | ||
status: DCAStatus; | ||
}; | ||
|
||
export type FetchDCAsResponse = { | ||
ok: boolean; | ||
data: { | ||
dcaAccounts: DCAFetchedAccount[]; | ||
}; | ||
}; | ||
|
||
export type MintData = { | ||
address: Address; | ||
name: string; | ||
symbol: string; | ||
decimals: number; | ||
logoURI: string; | ||
}; | ||
|
||
export type FetchMintsResponse = { | ||
content: MintData[]; | ||
}; |
This file was deleted.
Oops, something went wrong.