-
Notifications
You must be signed in to change notification settings - Fork 33
/
interfaces.ts
130 lines (116 loc) · 3.27 KB
/
interfaces.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
import { SlpTransactionType, SlpTransactionDetails } from 'slpjs';
import { Decimal128 } from 'mongodb';
import BigNumber from 'bignumber.js';
export type cashAddr = string;
export interface GraphTxn {
details: SlpTransactionDetails;
outputs: GraphTxnOutput[];
inputs: GraphTxnInput[];
prevPruneHeight: number|null;
blockHash: Buffer|null;
}
export interface GraphTxnOutput {
address: string|null;
vout: number;
bchSatoshis: number|null;
slpAmount: BigNumber;
spendTxid: string | null;
status: TokenUtxoStatus|BatonUtxoStatus;
invalidReason: string | null;
}
export interface GraphTxnInput {
txid: string;
vout: number;
slpAmount: BigNumber;
address: string;
bchSatoshis: number;
}
export interface TokenStatsDbo {
block_created: number|null;
approx_txns_since_genesis: number|null;
}
export interface TokenDBObject {
schema_version: number;
tokenDetails: SlpTransactionDetailsDbo;
tokenStats: TokenStatsDbo;
mintBatonUtxo: string;
mintBatonStatus: TokenBatonStatus;
lastUpdatedBlock: number;
nftParentId?: string;
_pruningState: TokenPruneStateDbo;
}
export interface TokenPruneStateDbo {
pruneHeight: number;
sendCount: number;
mintCount: number;
}
export interface GraphTxnDbo {
tokenDetails: {
tokenIdHex: string;
nftGroupIdHex?: string;
};
graphTxn: GraphTxnDetailsDbo;
}
export interface SlpTransactionDetailsDbo {
transactionType: SlpTransactionType;
tokenIdHex: string;
versionType: number;
timestamp: string | null;
timestamp_unix: number | null;
symbol: string;
name: string;
documentUri: string;
documentSha256Hex: string | null;
decimals: number;
containsBaton: boolean;
batonVout: number | null;
genesisOrMintQuantity: Decimal128 | null;
sendOutputs: Decimal128[] | null;
}
export interface GraphTxnDetailsDbo {
txid: string;
details: SlpTransactionDetailsDbo;
outputs: GraphTxnOutputDbo[];
inputs: GraphTxnInputDbo[];
_blockHash: Buffer | null;
_pruneHeight: number | null;
}
export interface GraphTxnOutputDbo {
address: string;
vout: number;
bchSatoshis: number;
slpAmount: Decimal128;
spendTxid: string | null;
status: TokenUtxoStatus | BatonUtxoStatus;
invalidReason: string | null;
}
export interface GraphTxnInputDbo {
txid: string;
vout: number;
slpAmount: Decimal128;
address: string;
bchSatoshis: number;
}
export enum TokenUtxoStatus {
"UNSPENT" = "UNSPENT",
"SPENT_SAME_TOKEN" = "SPENT_SAME_TOKEN",
"SPENT_WRONG_TOKEN" = "SPENT_WRONG_TOKEN",
"SPENT_NOT_IN_SEND" = "SPENT_NOT_IN_SEND",
"SPENT_INVALID_SLP" = "SPENT_INVALID_SLP",
"MISSING_BCH_VOUT" = "MISSING_BCH_VOUT",
"EXCESS_INPUT_BURNED" = "EXCESS_INPUT_BURNED",
}
export enum BatonUtxoStatus {
"BATON_UNSPENT" = "BATON_UNSPENT",
"BATON_SPENT_IN_MINT" = "BATON_SPENT_IN_MINT",
"BATON_SPENT_NOT_IN_MINT" = "BATON_SPENT_NOT_IN_MINT",
"BATON_SPENT_INVALID_SLP" = "BATON_SPENT_INVALID_SLP",
"BATON_MISSING_BCH_VOUT" = "BATON_MISSING_BCH_VOUT"
}
export enum TokenBatonStatus {
"NEVER_CREATED" = "NEVER_CREATED",
"ALIVE" = "ALIVE",
"DEAD_BURNED" = "DEAD_BURNED",
"DEAD_ENDED" = "DEAD_ENDED",
"UNKNOWN" = "UNKNOWN"
}