edge-currency-plugins 2.5.4 → 2.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/bch.js +2 -2
- package/lib/bsv.js +2 -2
- package/lib/btc.js +2 -2
- package/lib/common/plugin/{makeCurrencyPlugin.js → CurrencyPlugin.js} +13 -9
- package/lib/common/plugin/{makeMetadata.js → Metadata.js} +4 -4
- package/lib/common/plugin/{pluginState.js → PluginState.js} +6 -6
- package/lib/common/plugin/{serverScores.js → ServerScores.js} +8 -1
- package/lib/common/plugin/types.js +8 -0
- package/lib/common/utxobased/db/{makeProcessor.js → Processor.js} +3 -3
- package/lib/common/utxobased/engine/{makeServerStates.js → ServerStates.js} +140 -45
- package/lib/common/utxobased/engine/{makeUtxoEngine.js → UtxoEngine.js} +18 -18
- package/lib/common/utxobased/engine/{makeUtxoEngineState.js → UtxoEngineState.js} +27 -22
- package/lib/common/utxobased/engine/types.js +5 -0
- package/lib/common/utxobased/info/bitcoin.js +6 -0
- package/lib/common/utxobased/info/bitcoincash.js +6 -0
- package/lib/common/utxobased/info/dash.js +6 -0
- package/lib/common/utxobased/info/digibyte.js +6 -0
- package/lib/common/utxobased/info/dogecoin.js +6 -0
- package/lib/common/utxobased/info/groestlcoin.js +6 -0
- package/lib/common/utxobased/info/litecoin.js +6 -0
- package/lib/common/utxobased/network/{BlockBook.js → Blockbook.js} +28 -24
- package/lib/common/utxobased/network/Socket.js +4 -4
- package/lib/firo.js +2 -2
- package/lib/ftc.js +2 -2
- package/lib/index.js +2 -2
- package/lib/ltc.js +2 -2
- package/lib/src/common/plugin/{makeEngineEmitter.d.ts → EngineEmitter.d.ts} +1 -1
- package/lib/src/common/plugin/{makeMetadata.d.ts → Metadata.d.ts} +1 -1
- package/lib/src/common/plugin/{pluginState.d.ts → PluginState.d.ts} +2 -2
- package/lib/src/common/plugin/{serverScores.d.ts → ServerScores.d.ts} +1 -1
- package/lib/src/common/plugin/types.d.ts +9 -2
- package/lib/src/common/utxobased/db/Models/ProcessorTransaction.d.ts +3 -3
- package/lib/src/common/utxobased/db/util/utxo.d.ts +1 -1
- package/lib/src/common/utxobased/engine/{makeServerStates.d.ts → ServerStates.d.ts} +8 -5
- package/lib/src/common/utxobased/engine/{makeUtxoEngineState.d.ts → UtxoEngineState.d.ts} +9 -9
- package/lib/src/common/utxobased/engine/{makeUtxoWalletTools.d.ts → UtxoWalletTools.d.ts} +2 -2
- package/lib/src/common/utxobased/engine/types.d.ts +4 -0
- package/lib/src/common/utxobased/engine/util/getOwnUtxosFromTx.d.ts +1 -1
- package/lib/src/common/utxobased/network/{BlockBook.d.ts → Blockbook.d.ts} +10 -10
- package/lib/src/common/utxobased/network/Socket.d.ts +1 -1
- package/lib/tbch.js +2 -2
- package/lib/tbtc.js +2 -2
- package/lib/tbtg.js +2 -2
- package/package.json +1 -1
- /package/lib/common/plugin/{makeCurrencyTools.js → CurrencyTools.js} +0 -0
- /package/lib/common/plugin/{makeEngineEmitter.js → EngineEmitter.js} +0 -0
- /package/lib/common/utxobased/db/{makeBaselets.js → Baselets.js} +0 -0
- /package/lib/common/utxobased/db/{makeMutex.js → Mutex.js} +0 -0
- /package/lib/common/utxobased/engine/{makeUtxoWalletTools.js → UtxoWalletTools.js} +0 -0
- /package/lib/common/utxobased/network/{MakeSocketEmitter.js → SocketEmitter.js} +0 -0
- /package/lib/common/utxobased/network/{BlockBookAPI.js → blockbookApi.js} +0 -0
- /package/lib/src/common/plugin/{makeCurrencyPlugin.d.ts → CurrencyPlugin.d.ts} +0 -0
- /package/lib/src/common/plugin/{makeCurrencyTools.d.ts → CurrencyTools.d.ts} +0 -0
- /package/lib/src/common/utxobased/db/{makeBaselets.d.ts → Baselets.d.ts} +0 -0
- /package/lib/src/common/utxobased/db/{makeMutex.d.ts → Mutex.d.ts} +0 -0
- /package/lib/src/common/utxobased/db/{makeProcessor.d.ts → Processor.d.ts} +0 -0
- /package/lib/src/common/utxobased/engine/{makeUtxoEngine.d.ts → UtxoEngine.d.ts} +0 -0
- /package/lib/src/common/utxobased/network/{MakeSocketEmitter.d.ts → SocketEmitter.d.ts} +0 -0
- /package/lib/src/common/utxobased/network/{BlockBookAPI.d.ts → blockbookApi.d.ts} +0 -0
- /package/lib/test/common/plugin/{currencyPlugin.fixtures → CurrencyPlugin.fixtures}/common.d.ts +0 -0
- /package/lib/test/common/plugin/{currencyPlugin.fixtures → CurrencyPlugin.fixtures}/currencies/bitcoin.d.ts +0 -0
- /package/lib/test/common/plugin/{currencyPlugin.fixtures → CurrencyPlugin.fixtures}/currencies/bitcoincash.d.ts +0 -0
- /package/lib/test/common/plugin/{currencyPlugin.fixtures → CurrencyPlugin.fixtures}/currencies/bitcoinsv.d.ts +0 -0
- /package/lib/test/common/plugin/{currencyPlugin.fixtures → CurrencyPlugin.fixtures}/currencies/digibyte.d.ts +0 -0
- /package/lib/test/common/plugin/{currencyPlugin.fixtures → CurrencyPlugin.fixtures}/currencies/feathercoin.d.ts +0 -0
- /package/lib/test/common/plugin/{currencyPlugin.fixtures → CurrencyPlugin.fixtures}/currencies/groestlcoin.d.ts +0 -0
- /package/lib/test/common/plugin/{currencyPlugin.fixtures → CurrencyPlugin.fixtures}/currencies/litecoin.d.ts +0 -0
- /package/lib/test/common/plugin/{currencyPlugin.fixtures → CurrencyPlugin.fixtures}/currencies/smartcash.d.ts +0 -0
- /package/lib/test/common/plugin/{currencyPlugin.fixtures → CurrencyPlugin.fixtures}/currencies/zcoin.d.ts +0 -0
- /package/lib/test/common/plugin/{currencyPlugin.fixtures → CurrencyPlugin.fixtures}/index.d.ts +0 -0
- /package/lib/test/common/plugin/{currencyPlugin.spec.d.ts → CurrencyPlugin.spec.d.ts} +0 -0
- /package/lib/test/common/plugin/{makeMetadata.spec.d.ts → Metadata.spec.d.ts} +0 -0
- /package/lib/test/common/plugin/{serverScores.spec.d.ts → ServerScores.spec.d.ts} +0 -0
- /package/lib/test/common/utxobased/network/{BlockBook.spec.d.ts → Blockbook.spec.d.ts} +0 -0
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import { EdgeLog, EdgeTransaction } from 'edge-core-js/types';
|
|
2
|
-
import { EngineEmitter } from '../../plugin/
|
|
3
|
-
import { PluginState } from '../../plugin/
|
|
1
|
+
import { EdgeIo, EdgeLog, EdgeTransaction } from 'edge-core-js/types';
|
|
2
|
+
import { EngineEmitter } from '../../plugin/EngineEmitter';
|
|
3
|
+
import { PluginState } from '../../plugin/PluginState';
|
|
4
4
|
import { PluginInfo } from '../../plugin/types';
|
|
5
5
|
import { SafeWalletInfo } from '../keymanager/cleaners';
|
|
6
|
-
import {
|
|
6
|
+
import { Blockbook } from '../network/Blockbook';
|
|
7
7
|
import Deferred from '../network/Deferred';
|
|
8
8
|
import { WsTask } from '../network/Socket';
|
|
9
|
+
import { UtxoInitOptions } from './types';
|
|
9
10
|
interface ServerState {
|
|
10
|
-
blockbook:
|
|
11
|
+
blockbook: Blockbook;
|
|
11
12
|
blockSubscriptionStatus: 'unsubscribed' | 'subscribing' | 'subscribed';
|
|
12
13
|
blockHeight: number;
|
|
13
14
|
txids: Set<string>;
|
|
@@ -15,6 +16,8 @@ interface ServerState {
|
|
|
15
16
|
}
|
|
16
17
|
interface ServerStateConfig {
|
|
17
18
|
engineEmitter: EngineEmitter;
|
|
19
|
+
initOptions: UtxoInitOptions;
|
|
20
|
+
io: EdgeIo;
|
|
18
21
|
log: EdgeLog;
|
|
19
22
|
pluginInfo: PluginInfo;
|
|
20
23
|
pluginState: PluginState;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { EdgeFreshAddress, EdgeIo, EdgeLog, EdgeTransaction } from 'edge-core-js/types';
|
|
2
|
-
import { EngineEmitter } from '../../plugin/
|
|
3
|
-
import { PluginState } from '../../plugin/
|
|
2
|
+
import { EngineEmitter } from '../../plugin/EngineEmitter';
|
|
3
|
+
import { PluginState } from '../../plugin/PluginState';
|
|
4
4
|
import { ChangePath, CurrencyFormat, EngineConfig, PluginInfo } from '../../plugin/types';
|
|
5
|
-
import { Processor } from '../db/
|
|
5
|
+
import { Processor } from '../db/Processor';
|
|
6
6
|
import { IAddress, IProcessorTransaction, IUTXO } from '../db/types';
|
|
7
7
|
import { SafeWalletInfo } from '../keymanager/cleaners';
|
|
8
|
-
import { BlockbookAccountUtxo } from '../network/
|
|
8
|
+
import { BlockbookAccountUtxo } from '../network/blockbookApi';
|
|
9
9
|
import { WsTask } from '../network/Socket';
|
|
10
10
|
import AwaitLock from './await-lock';
|
|
11
|
-
import { ServerStates } from './
|
|
12
|
-
import {
|
|
11
|
+
import { ServerStates } from './ServerStates';
|
|
12
|
+
import { UtxoWalletTools } from './UtxoWalletTools';
|
|
13
13
|
export interface UtxoEngineState {
|
|
14
14
|
processedPercent: number;
|
|
15
15
|
start: () => Promise<void>;
|
|
@@ -28,7 +28,7 @@ export interface UtxoEngineState {
|
|
|
28
28
|
processUtxos: (utxos: IUTXO[]) => Promise<void>;
|
|
29
29
|
}
|
|
30
30
|
export interface UtxoEngineStateConfig extends EngineConfig {
|
|
31
|
-
walletTools:
|
|
31
|
+
walletTools: UtxoWalletTools;
|
|
32
32
|
walletInfo: SafeWalletInfo;
|
|
33
33
|
processor: Processor;
|
|
34
34
|
}
|
|
@@ -36,7 +36,7 @@ export declare function makeUtxoEngineState(config: UtxoEngineStateConfig): Utxo
|
|
|
36
36
|
interface CommonArgs {
|
|
37
37
|
pluginInfo: PluginInfo;
|
|
38
38
|
walletInfo: SafeWalletInfo;
|
|
39
|
-
walletTools:
|
|
39
|
+
walletTools: UtxoWalletTools;
|
|
40
40
|
processor: Processor;
|
|
41
41
|
emitter: EngineEmitter;
|
|
42
42
|
taskCache: TaskCache;
|
|
@@ -109,7 +109,7 @@ interface TransactionChangedArgs {
|
|
|
109
109
|
walletId: string;
|
|
110
110
|
tx: IProcessorTransaction;
|
|
111
111
|
emitter: EngineEmitter;
|
|
112
|
-
walletTools:
|
|
112
|
+
walletTools: UtxoWalletTools;
|
|
113
113
|
pluginInfo: PluginInfo;
|
|
114
114
|
processor: Processor;
|
|
115
115
|
}
|
|
@@ -7,7 +7,7 @@ export interface WalletToolsConfig {
|
|
|
7
7
|
pluginInfo: PluginInfo;
|
|
8
8
|
publicKey: PublicKey;
|
|
9
9
|
}
|
|
10
|
-
export interface
|
|
10
|
+
export interface UtxoWalletTools {
|
|
11
11
|
getPubkey: (args: AddressPath) => string;
|
|
12
12
|
getScriptPubkey: (args: AddressPath) => ScriptPubkeyReturn;
|
|
13
13
|
getScriptPubkeyFromWif: (wif: string, format: CurrencyFormat) => ScriptPubkeyReturn;
|
|
@@ -49,5 +49,5 @@ interface SignMessageArgs {
|
|
|
49
49
|
message: string;
|
|
50
50
|
xprivKeys: CurrencyFormatKeys;
|
|
51
51
|
}
|
|
52
|
-
export declare function makeUtxoWalletTools(config: WalletToolsConfig):
|
|
52
|
+
export declare function makeUtxoWalletTools(config: WalletToolsConfig): UtxoWalletTools;
|
|
53
53
|
export {};
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { EdgeSpendInfo } from 'edge-core-js/types';
|
|
2
2
|
import { Input, Output } from '../keymanager/utxopicker/types';
|
|
3
|
+
export declare type UtxoInitOptions = ReturnType<typeof asUtxoInitOptions>;
|
|
4
|
+
export declare const asUtxoInitOptions: import("cleaners").ObjectCleaner<{
|
|
5
|
+
nowNodeApiKey: string | undefined;
|
|
6
|
+
}>;
|
|
3
7
|
export declare const asUtxoUserSettings: import("cleaners").ObjectCleaner<{
|
|
4
8
|
blockbookServers: string[];
|
|
5
9
|
enableCustomServers: boolean;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { EngineInfo } from '../../../plugin/types';
|
|
2
|
-
import { Processor } from '../../db/
|
|
2
|
+
import { Processor } from '../../db/Processor';
|
|
3
3
|
import { IProcessorTransaction, IUTXO } from '../../db/types';
|
|
4
4
|
export declare const getOwnUtxosFromTx: (engineInfo: EngineInfo, processor: Processor, tx: IProcessorTransaction) => Promise<IUTXO[]>;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { Cleaner } from 'cleaners';
|
|
2
2
|
import { EdgeLog, EdgeTransaction } from 'edge-core-js/types';
|
|
3
|
-
import { EngineEmitter } from '../../plugin/
|
|
4
|
-
import { AddressResponse, AddresssMessageParams, AddressUtxosResponse, BroadcastTxResponse, InfoResponse, SubscribeAddressResponse, TransactionResponse } from './
|
|
3
|
+
import { EngineEmitter } from '../../plugin/EngineEmitter';
|
|
4
|
+
import { AddressResponse, AddresssMessageParams, AddressUtxosResponse, BroadcastTxResponse, InfoResponse, SubscribeAddressResponse, TransactionResponse } from './blockbookApi';
|
|
5
5
|
import Deferred from './Deferred';
|
|
6
|
-
import { SocketEmitter } from './MakeSocketEmitter';
|
|
7
6
|
import { OnQueueSpaceCB } from './Socket';
|
|
7
|
+
import { SocketEmitter } from './SocketEmitter';
|
|
8
8
|
export declare type WatchAddressesCB = (response: SubscribeAddressResponse) => void | Promise<void>;
|
|
9
9
|
export declare type WatchBlocksCB = () => void | Promise<void>;
|
|
10
|
-
export interface
|
|
10
|
+
export interface Blockbook {
|
|
11
11
|
isConnected: boolean;
|
|
12
12
|
connect: () => Promise<void>;
|
|
13
13
|
disconnect: () => Promise<void>;
|
|
@@ -20,14 +20,14 @@ export interface BlockBook {
|
|
|
20
20
|
fetchTransaction: (hash: string) => Promise<TransactionResponse>;
|
|
21
21
|
broadcastTx: (transaction: EdgeTransaction) => Promise<BroadcastTxResponse>;
|
|
22
22
|
}
|
|
23
|
-
interface
|
|
24
|
-
|
|
23
|
+
interface BlockbookConfig {
|
|
24
|
+
asAddress?: Cleaner<string>;
|
|
25
|
+
connectionUri: string;
|
|
25
26
|
engineEmitter: EngineEmitter;
|
|
26
|
-
wsAddress: string;
|
|
27
27
|
log: EdgeLog;
|
|
28
|
-
walletId: string;
|
|
29
28
|
onQueueSpaceCB: OnQueueSpaceCB;
|
|
30
|
-
|
|
29
|
+
socketEmitter: SocketEmitter;
|
|
30
|
+
walletId: string;
|
|
31
31
|
}
|
|
32
|
-
export declare function
|
|
32
|
+
export declare function makeBlockbook(config: BlockbookConfig): Blockbook;
|
|
33
33
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Cleaner } from 'cleaners';
|
|
2
2
|
import { EdgeLog } from 'edge-core-js/types';
|
|
3
3
|
import Deferred from './Deferred';
|
|
4
|
-
import { SocketEmitter } from './
|
|
4
|
+
import { SocketEmitter } from './SocketEmitter';
|
|
5
5
|
import { ReadyState } from './types';
|
|
6
6
|
export declare type OnFailHandler = (error: Error) => void;
|
|
7
7
|
export interface WsTask<T> {
|
package/lib/tbch.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _CurrencyPlugin = require('./common/plugin/CurrencyPlugin');
|
|
4
4
|
var _bitcoincashtestnet = require('./common/utxobased/info/bitcoincashtestnet');
|
|
5
5
|
|
|
6
6
|
const plugin = (options) =>
|
|
7
|
-
|
|
7
|
+
_CurrencyPlugin.makeCurrencyPlugin.call(void 0, options, _bitcoincashtestnet.info)
|
|
8
8
|
|
|
9
9
|
if (typeof window !== 'undefined') {
|
|
10
10
|
_optionalChain([window, 'access', _ => _.addEdgeCorePlugins, 'optionalCall', _2 => _2({
|
package/lib/tbtc.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _CurrencyPlugin = require('./common/plugin/CurrencyPlugin');
|
|
4
4
|
var _bitcointestnet = require('./common/utxobased/info/bitcointestnet');
|
|
5
5
|
|
|
6
6
|
const plugin = (options) =>
|
|
7
|
-
|
|
7
|
+
_CurrencyPlugin.makeCurrencyPlugin.call(void 0, options, _bitcointestnet.info)
|
|
8
8
|
|
|
9
9
|
if (typeof window !== 'undefined') {
|
|
10
10
|
_optionalChain([window, 'access', _ => _.addEdgeCorePlugins, 'optionalCall', _2 => _2({
|
package/lib/tbtg.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _CurrencyPlugin = require('./common/plugin/CurrencyPlugin');
|
|
4
4
|
var _bitcoingoldtestnet = require('./common/utxobased/info/bitcoingoldtestnet');
|
|
5
5
|
|
|
6
6
|
const plugin = (options) =>
|
|
7
|
-
|
|
7
|
+
_CurrencyPlugin.makeCurrencyPlugin.call(void 0, options, _bitcoingoldtestnet.info)
|
|
8
8
|
|
|
9
9
|
if (typeof window !== 'undefined') {
|
|
10
10
|
_optionalChain([window, 'access', _ => _.addEdgeCorePlugins, 'optionalCall', _2 => _2({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "edge-currency-plugins",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.6.0",
|
|
4
4
|
"description": "Edge currency plugins to fetch and process wallet accounts, balances and transactions.",
|
|
5
5
|
"repository": "https://github.com/EdgeApp/edge-currency-plugins",
|
|
6
6
|
"license": "MIT",
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/lib/test/common/plugin/{currencyPlugin.fixtures → CurrencyPlugin.fixtures}/common.d.ts
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/lib/test/common/plugin/{currencyPlugin.fixtures → CurrencyPlugin.fixtures}/index.d.ts
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|