Skip to content

Commit 13f1bb2

Browse files
committed
move flowTypes content into zcoins.js
1 parent 4f2d33f commit 13f1bb2

File tree

6 files changed

+35
-36
lines changed

6 files changed

+35
-36
lines changed

src/info/sigma/coinOperations.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import { bns } from 'biggystring'
44
import { InsufficientFundsError } from 'edge-core-js/types'
55

6-
import { type PrivateCoin, denominations } from './flowTypes'
6+
import { type PrivateCoin, denominations } from '../zcoins'
77

88
const getRequiredMintCountForValue = (value: string): number => {
99
let result = 0

src/info/sigma/coinUtils.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ import { toNewFormat } from '../../utils/addressFormat.js'
1010
import type { BlockHeight, StandardOutput, Utxo } from '../../utils/coinUtils'
1111
import { toBcoinFormat } from '../../utils/coinUtils'
1212
import { logger } from '../../utils/logger'
13-
import type { PrivateCoin } from './flowTypes'
13+
import type { PrivateCoin } from '../zcoins'
1414
import {
1515
denominations,
1616
OP_SIGMA_MINT,
1717
OP_SIGMA_SPEND,
1818
SIGMA_COIN
19-
} from './flowTypes'
19+
} from '../zcoins'
2020

2121
export type SpendCoin = {
2222
value: number,

src/info/sigma/flowTypes.js

Lines changed: 0 additions & 28 deletions
This file was deleted.

src/info/sigma/zcoinEngineExtension.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ import type { PluginIo } from '../../plugin/pluginIo'
1818
import { getReceiveAddresses, sumUtxos } from '../../utils/coinUtils'
1919
import type { TxOptions } from '../../utils/coinUtils.js'
2020
import { logger } from '../../utils/logger'
21+
import type { PrivateCoin } from '../zcoins'
22+
import { denominations, OP_SIGMA_MINT, RESTORE_FILE } from '../zcoins'
2123
import { getMintsToSpend } from './coinOperations'
2224
import {
2325
createPrivateCoin,
@@ -28,8 +30,6 @@ import {
2830
sumTransaction
2931
} from './coinUtils'
3032
import type { SpendCoin } from './coinUtils.js'
31-
import type { PrivateCoin } from './flowTypes'
32-
import { denominations, OP_SIGMA_MINT, RESTORE_FILE } from './flowTypes'
3333
import { ZcoinStateExtension } from './zcoinStateExtension'
3434

3535
const MILLI_TO_SEC = 1000

src/info/sigma/zcoinStateExtension.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ import { EngineState } from '../../engine/engineState'
66
import { EngineStateExtension } from '../../engine/engineStateExtension'
77
import type { StratumTask } from '../../stratum/stratumConnection'
88
import { logger } from '../../utils/logger'
9+
import type { PrivateCoin } from '../zcoins'
10+
import { SIGMA_ENCRYPTED_FILE } from '../zcoins'
911
import { type SpendCoin } from './coinUtils'
10-
import type { PrivateCoin } from './flowTypes'
11-
import { SIGMA_ENCRYPTED_FILE } from './flowTypes'
1212
import {
1313
fetchTransactionVerbose,
1414
getAnonymitySet,

src/info/zcoins.js

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,33 @@ import type { BcoinCurrencyInfo } from '../utils/bcoinExtender/bcoinExtender.js'
88
import { imageServerUrl } from './constants.js'
99
import { ZcoinEngineExtension } from './sigma/zcoinEngineExtension'
1010

11+
export const SIGMA_ENCRYPTED_FILE = 'mint.json'
12+
export const RESTORE_FILE = 'restore.json'
13+
export const OP_SIGMA_MINT = 'c3'
14+
export const OP_SIGMA_SPEND = 'c4'
15+
16+
export const SIGMA_COIN = 100000000
17+
18+
export const denominations = [
19+
'5000000',
20+
'10000000',
21+
'50000000',
22+
'100000000',
23+
'1000000000',
24+
'2500000000',
25+
'10000000000'
26+
]
27+
28+
export type PrivateCoin = {
29+
value: number,
30+
index: number,
31+
commitment: string,
32+
serialNumber: string,
33+
groupId: number,
34+
isSpend: boolean,
35+
spendTxId: string
36+
}
37+
1138
const bcoinInfo: BcoinCurrencyInfo = {
1239
type: 'zcoins',
1340
magic: 0xd9b4bef9,
@@ -41,7 +68,6 @@ const engineInfo: EngineCurrencyInfo = {
4168
standardFeeLowAmount: '173200',
4269
standardFeeHighAmount: '8670000'
4370
},
44-
requiredConfirmations: 6,
4571
timestampFromHeader(header: Buffer): number {
4672
if (header.length < 80) {
4773
throw new Error(`Cannot interpret block header ${header.toString('hex')}`)
@@ -63,6 +89,7 @@ const currencyInfo: EdgeCurrencyInfo = {
6389
{ name: 'mXZC', multiplier: '100000', symbol: 'mƵ' }
6490
],
6591
walletType: 'wallet:zcoins',
92+
requiredConfirmations: 6,
6693

6794
// Configuration options:
6895
defaultSettings: {

0 commit comments

Comments
 (0)