Repository navigation
Add eCash (ECX) plugins and Electrum sync support #466
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
7ff3282
Broadcast transactions through Electrum servers
peachbits 468c420
Send Electrum pings with positional params
peachbits 78df098
Track block height through Electrum servers
peachbits 3125424
Send the requests a task makes after a failed one
peachbits d07b693
Fetch transactions through Electrum servers
peachbits 3f80efc
Count Electrum mempool transactions as unconfirmed
peachbits 3ce80aa
Keep Electrum servers off address histories
peachbits b4b229f
Support a per-coin replay-protection nLockTime
peachbits 617c57c
Add eCash (ECX) mainnet and betanet plugins
peachbits 0dff20b
Allow splitting Bitcoin wallets into eCash (ECX)
peachbits File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,90 @@ | ||
| import { EdgeCurrencyInfo } from 'edge-core-js/types' | ||
|
|
||
| import { CoinInfo, EngineInfo, PluginInfo } from '../../plugin/types' | ||
| import { maximumFeeRateCalculator } from '../../plugin/util/maximumFeeRateCalculator' | ||
| import { | ||
| legacyMemoInfo, | ||
| utxoCustomFeeTemplate, | ||
| utxoMemoOptions | ||
| } from './commonInfo' | ||
|
|
||
| const currencyInfo: EdgeCurrencyInfo = { | ||
| assetDisplayName: 'eCash', | ||
| canReplaceByFee: true, | ||
| chainDisplayName: 'eCash', | ||
| currencyCode: 'ECX', | ||
| customFeeTemplate: utxoCustomFeeTemplate, | ||
| memoOptions: utxoMemoOptions, | ||
| pluginId: 'ecashbitcoin', | ||
| walletType: 'wallet:ecashbitcoin', | ||
|
|
||
| // Explorers: | ||
| blockExplorer: 'https://explorer.ecash.ninja/block/%s', | ||
| addressExplorer: 'https://explorer.ecash.ninja/address/%s', | ||
| transactionExplorer: 'https://explorer.ecash.ninja/tx/%s', | ||
|
|
||
| denominations: [ | ||
| { name: 'ECX', multiplier: '100000000' }, | ||
| { name: 'sats', multiplier: '1', symbol: 's' } | ||
| ], | ||
|
|
||
| // Deprecated: | ||
| ...legacyMemoInfo, | ||
| defaultSettings: { | ||
| customFeeSettings: ['satPerByte'], | ||
| blockbookServers: ['wss://blockbook.ecash.ninja/websocket'], | ||
| enableCustomServers: false | ||
| }, | ||
| displayName: 'eCash', | ||
| metaTokens: [] | ||
| } | ||
|
|
||
| const engineInfo: EngineInfo = { | ||
| formats: ['bip49', 'bip84', 'bip44', 'bip32'], | ||
| // Matches Bitcoin, so wallets split from Bitcoin find every pre-fork address: | ||
| gapLimit: 25, | ||
| feeUpdateInterval: 60000, | ||
| mempoolSpaceFeeInfoServer: 'https://explorer.ecash.ninja/api/v1/fees/precise', | ||
| defaultFeeInfo: { | ||
| lowFeeFudgeFactor: undefined, | ||
| standardFeeLowFudgeFactor: undefined, | ||
| standardFeeHighFudgeFactor: undefined, | ||
| highFeeFudgeFactor: undefined, | ||
|
|
||
| highFee: '10', | ||
| lowFee: '1', | ||
| standardFeeLow: '2', | ||
| standardFeeHigh: '5', | ||
| standardFeeLowAmount: '173200', | ||
| standardFeeHighAmount: '8670000', | ||
| maximumFeeRate: maximumFeeRateCalculator(currencyInfo, 100) | ||
| } | ||
| } | ||
|
|
||
| export const coinInfo: CoinInfo = { | ||
| name: 'ecashbitcoin', | ||
| segwit: true, | ||
| coinType: 0, | ||
| // LOCKTIME_THRESHOLD - 2, final only on eCash mainnet: | ||
| lockTime: 499999998, | ||
|
|
||
| prefixes: { | ||
| messagePrefix: ['\x18Bitcoin Signed Message:\n'], | ||
| wif: [0x80], | ||
| legacyXPriv: [0x0488ade4], | ||
| legacyXPub: [0x0488b21e], | ||
| wrappedSegwitXPriv: [0x049d7878], | ||
| wrappedSegwitXPub: [0x049d7cb2], | ||
| segwitXPriv: [0x04b2430c], | ||
| segwitXPub: [0x04b24746], | ||
| pubkeyHash: [0x00], | ||
| scriptHash: [0x05], | ||
| bech32: ['bc'] | ||
| } | ||
| } | ||
|
|
||
| export const info: PluginInfo = { | ||
| currencyInfo, | ||
| engineInfo, | ||
| coinInfo | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Warning:
ecashbitcoinbetanetis listed as a fork of mainnet Bitcoin, and EdgeApp/edge-react-gui#6294 registers it incorePlugins.ts. Every production BTC wallet will offer a split into a test network, which also runs the high-fee sweep. Is that intended, or should betanet stay behind a dev/beta flag?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Recommend disabling betanet for prod
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed. EdgeApp/edge-react-gui#6294 now registers
ecashbitcoinbetanetonly whenCONFIG.BETA_FEATURESis on, so production Bitcoin wallets never offer the betanet split. The fork list here stays, so beta builds can still test it.