Skip to content

Commit

Permalink
add fujicoin
Browse files Browse the repository at this point in the history
  • Loading branch information
fujicoin committed Sep 7, 2024
1 parent 3c96288 commit bcbfa05
Show file tree
Hide file tree
Showing 16 changed files with 91 additions and 7 deletions.
23 changes: 23 additions & 0 deletions packages/blockchain-link/src/ui/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,29 @@ export default [
subscribe: '',
},
},
{
blockchain: {
name: 'Fujicoin',
worker: 'js/blockbook-worker.js',
server: [
'https://explorer.fujicoin.org',
],
debug: true,
},
data: {
address: '',
accountInfoOptions: {
page: 0,
pageSize: 25,
},
estimateFeeOptions: {
blocks: [1, 2, 10],
},
txid: '',
tx: '',
subscribe: '',
},
},
{
blockchain: {
name: 'Litecoin',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ type ElectrumClientOptions = JsonRpcClientOptions & {

const selectNetwork = (shortcut?: string) => {
switch (shortcut) {
case 'FJC':
return networks.fujicoin;
case 'REGTEST':
return networks.regtest;
case 'TEST':
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export const COINS = {
eos: require('../../../images/coins/eos.svg'),
etc: require('../../../images/coins/etc.svg'),
eth: require('../../../images/coins/eth.svg'),
fjc: require('../../../images/coins/fjc.svg'),
ltc: require('../../../images/coins/ltc.svg'),
nmc: require('../../../images/coins/nmc.svg'),
tada: require('../../../images/coins/tada.svg'),
Expand Down
1 change: 1 addition & 0 deletions packages/components/src/images/coins/fjc.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 4 additions & 1 deletion packages/connect-common/files/coins.json
Original file line number Diff line number Diff line change
Expand Up @@ -1077,7 +1077,10 @@
"bech32_prefix": "fc",
"blockchain_link": {
"type": "blockbook",
"url": ["https://explorer.fujicoin.org"]
"url": [
"https://explorer.fujicoin.org",
"https://explorer2.fujicoin.org"
]
},
"blocktime_seconds": 60,
"cashaddr_prefix": null,
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions packages/suite-desktop-core/src/modules/auto-updater.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ const updaterURL = app.commandLine.getSwitchValue('updater-url');
export const SERVICE_NAME = 'auto-updater';

export const init: Module = ({ mainWindow, store }) => {
return;

const { logger } = global;
if (!isFeatureFlagEnabled('DESKTOP_AUTO_UPDATER') && !enableUpdater) {
logger.info(SERVICE_NAME, 'Disabled via feature flag');
Expand Down
12 changes: 6 additions & 6 deletions packages/suite-desktop/electron-builder-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ const isCodesignBuild = process.env.IS_CODESIGN_BUILD === 'true';
// to be able to use patterns like ${author} and ${arch}
module.exports = {
// distingush between dev and prod builds
appId: `io.trezor.TrezorSuite${isCodesignBuild ? '' : '.dev'}`,
appId: `fujicoin.org.TrezorSuite${isCodesignBuild ? '' : '.dev'}`,
extraMetadata: {
version: suiteVersion,
// distingush between dev and prod builds so different userDataDir is used
name: `@trezor/suite-desktop${isCodesignBuild ? '' : '-dev'}`,
},
productName: 'Trezor Suite',
productName: 'Fujicoin Trezor Suite',
copyright: 'Copyright © ${author}',
asar: true,
asarUnpack: ['**/*.node'],
Expand Down Expand Up @@ -92,7 +92,7 @@ module.exports = {
},
],
icon: 'build/static/images/desktop/512x512.icns',
artifactName: 'Trezor-Suite-${version}-mac-${arch}.${ext}',
artifactName: 'Fujicoin-Trezor-Suite-${version}-mac-${arch}.${ext}',
hardenedRuntime: true,
gatekeeperAssess: false,
darkModeSupport: true,
Expand Down Expand Up @@ -126,7 +126,7 @@ module.exports = {
},
],
icon: 'build/static/images/desktop/512x512.png',
artifactName: 'Trezor-Suite-${version}-win-${arch}.${ext}',
artifactName: 'Fujicoin-Trezor-Suite-${version}-win-${arch}.${ext}',
target: ['nsis'],
signDlls: true,
},
Expand All @@ -150,8 +150,8 @@ module.exports = {
},
],
icon: 'build/static/images/desktop/512x512.png',
artifactName: 'Trezor-Suite-${version}-linux-${arch}.${ext}',
executableName: 'trezor-suite',
artifactName: 'Fujicoin-Trezor-Suite-${version}-linux-${arch}.${ext}',
executableName: 'fujicoin-trezor-suite',
category: 'Utility',
target: ['AppImage'],
},
Expand Down
1 change: 1 addition & 0 deletions packages/suite-desktop/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,4 @@
"glob": "^10.3.10"
}
}

2 changes: 2 additions & 0 deletions packages/suite/src/constants/suite/protocol.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import type { Network } from 'src/types/wallet';
export enum PROTOCOL_SCHEME {
BITCOIN = 'bitcoin',
LITECOIN = 'litecoin',
FUJICOIN = 'fujicoin',
BITCOIN_CASH = 'bitcoincash',
BITCOIN_GOLD = 'bitcoingold',
DASH = 'dash',
Expand All @@ -21,6 +22,7 @@ export enum PROTOCOL_SCHEME {
export const PROTOCOL_TO_NETWORK: Partial<{ [key in PROTOCOL_SCHEME]: Network['symbol'] }> = {
[PROTOCOL_SCHEME.BITCOIN]: 'btc',
[PROTOCOL_SCHEME.LITECOIN]: 'ltc',
[PROTOCOL_SCHEME.FUJICOIN]: 'fjc',
[PROTOCOL_SCHEME.BITCOIN_CASH]: 'bch',
[PROTOCOL_SCHEME.BITCOIN_GOLD]: 'btg',
[PROTOCOL_SCHEME.DASH]: 'dash',
Expand Down
4 changes: 4 additions & 0 deletions packages/suite/src/support/messages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2977,6 +2977,10 @@ export default defineMessages({
defaultMessage: 'Ethereum Holesky',
id: 'TR_NETWORK_ETHEREUM_HOLESKY',
},
TR_NETWORK_FUJICOIN: {
defaultMessage: 'Fujicoin',
id: 'TR_NETWORK_FUJICOIN',
},
TR_NETWORK_LITECOIN: {
defaultMessage: 'Litecoin',
id: 'TR_NETWORK_LITECOIN',
Expand Down
12 changes: 12 additions & 0 deletions packages/utxo-lib/src/networks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,18 @@ export const bitcoingold: Network = {
forkId: 0x4f /* 79 */,
};

export const fujicoin: Network = {
messagePrefix: '\x19FujiCoin Signed Message:\n',
bech32: 'fc',
bip32: {
public: 0x0488b21e,
private: 0x0488ade4,
},
pubKeyHash: 0x24,
scriptHash: 0x10,
wif: 0xa4,
};

export const litecoin: Network = {
messagePrefix: '\x19Litecoin Signed Message:\n',
bech32: 'ltc',
Expand Down
1 change: 1 addition & 0 deletions suite-common/suite-constants/src/protocol.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { NetworkSymbol } from '@suite-common/wallet-config';
export enum PROTOCOL_SCHEME {
BITCOIN = 'bitcoin',
LITECOIN = 'litecoin',
FUJICOIN = 'fujicoin',
BITCOIN_CASH = 'bitcoincash',
BITCOIN_GOLD = 'bitcoingold',
DASH = 'dash',
Expand Down
29 changes: 29 additions & 0 deletions suite-common/wallet-config/src/networksConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,35 @@ export const networks = {
},
coingeckoId: 'bitcoin',
},
fjc: {
name: 'Fujicoin',
networkType: 'bitcoin',
bip43Path: "m/84'/75'/i'",
decimals: 8,
testnet: false,
explorer: {
tx: 'https://explorer.fujicoin.org/tx/',
account: 'https://explorer.fujicoin.org/xpub/',
address: 'https://explorer.fujicoin.org/address/',
},
features: ['rbf', 'sign-verify'],
customBackends: ['blockbook', 'electrum'],
accountTypes: {
taproot: {
name: 'Fujicoin (Taproot)',
bip43Path: "m/86'/75'/i'",
features: ['rbf'],
},
segwit: {
name: 'Fujicoin (Legacy Segwit)',
bip43Path: "m/49'/75'/i'",
},
legacy: {
name: 'Fujicoin (Legacy)',
bip43Path: "m/44'/75'/i'",
},
},
},
ltc: {
name: 'Litecoin',
networkType: 'bitcoin',
Expand Down
1 change: 1 addition & 0 deletions suite-common/wallet-utils/src/__fixtures__/accountUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ export const accountTitleFixture = [
{ symbol: 'zec', title: 'TR_NETWORK_ZCASH' },
{ symbol: 'eth', title: 'TR_NETWORK_ETHEREUM' },
{ symbol: 'etc', title: 'TR_NETWORK_ETHEREUM_CLASSIC' },
{ symbol: 'fjc', title: 'TR_NETWORK_FUJICOIN' },
{ symbol: 'xem', title: 'TR_NETWORK_NEM' },
{ symbol: 'xlm', title: 'TR_NETWORK_STELLAR' },
{ symbol: 'ada', title: 'TR_NETWORK_CARDANO' },
Expand Down
2 changes: 2 additions & 0 deletions suite-common/wallet-utils/src/accountUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,8 @@ export const getTitleForNetwork = (symbol: NetworkSymbol) => {
return 'TR_NETWORK_ZCASH';
case 'eth':
return 'TR_NETWORK_ETHEREUM';
case 'fjc':
return 'TR_NETWORK_FUJICOIN';
case 'tsep':
return 'TR_NETWORK_ETHEREUM_SEPOLIA';
case 'thol':
Expand Down

0 comments on commit bcbfa05

Please sign in to comment.