edge-currency-plugins 2.6.1 → 3.0.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/README.md +61 -2
- package/android/build.gradle +45 -0
- package/android/src/main/AndroidManifest.xml +2 -0
- package/android/src/main/assets/edge-currency-plugins/669.chunk.js +1 -0
- package/android/src/main/assets/edge-currency-plugins/edge-currency-plugins.js +76 -0
- package/android/src/main/java/app/edge/reactnative/currencyplugins/EdgeCurrencyPluginsModule.java +26 -0
- package/android/src/main/java/app/edge/reactnative/currencyplugins/EdgeCurrencyPluginsPackage.java +24 -0
- package/edge-currency-plugins.d.ts +34 -0
- package/edge-currency-plugins.podspec +28 -0
- package/ios/EdgeCurrencyPluginsModule.m +4 -0
- package/ios/EdgeCurrencyPluginsModule.swift +20 -0
- package/ios/edge-currency-plugins.xcodeproj/project.pbxproj +1 -0
- package/lib/common/constants.js +1 -2
- package/lib/common/plugin/CurrencyPlugin.js +17 -1
- package/lib/common/utxobased/db/Models/ProcessorTransaction.js +3 -2
- package/lib/common/utxobased/db/Processor.js +5 -0
- package/lib/common/utxobased/engine/ServerStates.js +159 -28
- package/lib/common/utxobased/engine/UtxoEngine.js +3 -2
- package/lib/common/utxobased/engine/UtxoEngineState.js +66 -72
- package/lib/common/utxobased/engine/types.js +3 -1
- package/lib/common/utxobased/info/badcoin.js +16 -19
- package/lib/common/utxobased/info/bitcoin.js +18 -26
- package/lib/common/utxobased/info/bitcoincash.js +18 -26
- package/lib/common/utxobased/info/bitcoincashtestnet.js +17 -17
- package/lib/common/utxobased/info/bitcoingold.js +16 -19
- package/lib/common/utxobased/info/bitcoingoldtestnet.js +16 -11
- package/lib/common/utxobased/info/bitcoinsv.js +16 -24
- package/lib/common/utxobased/info/bitcointestnet.js +17 -25
- package/lib/common/utxobased/info/commonInfo.js +20 -11
- package/lib/common/utxobased/info/dash.js +18 -21
- package/lib/common/utxobased/info/digibyte.js +17 -20
- package/lib/common/utxobased/info/dogecoin.js +17 -20
- package/lib/common/utxobased/info/eboost.js +16 -19
- package/lib/common/utxobased/info/feathercoin.js +16 -24
- package/lib/common/utxobased/info/groestlcoin.js +19 -22
- package/lib/common/utxobased/info/litecoin.js +18 -26
- package/lib/common/utxobased/info/qtum.js +16 -19
- package/lib/common/utxobased/info/ravencoin.js +16 -19
- package/lib/common/utxobased/info/smartcash.js +16 -19
- package/lib/common/utxobased/info/ufo.js +16 -19
- package/lib/common/utxobased/info/vertcoin.js +16 -19
- package/lib/common/utxobased/info/zcoin.js +22 -24
- package/lib/common/utxobased/keymanager/keymanager.js +1 -1
- package/lib/common/utxobased/keymanager/types.js +2 -1
- package/lib/common/utxobased/network/Blockbook.js +178 -105
- package/lib/common/utxobased/network/BlockbookElectrum.js +216 -0
- package/lib/common/utxobased/network/Socket.js +130 -66
- package/lib/common/utxobased/network/blockbookApi.js +6 -6
- package/lib/common/utxobased/network/electrumApi.js +203 -0
- package/lib/{types.js → declare-modules.d.js} +2 -0
- package/lib/index.js +7 -3
- package/lib/react-native.js +26 -0
- package/lib/src/common/constants.d.ts +0 -1
- package/lib/src/common/utxobased/db/Processor.d.ts +6 -1
- package/lib/src/common/utxobased/engine/ServerStates.d.ts +8 -0
- package/lib/src/common/utxobased/engine/UtxoEngineState.d.ts +1 -4
- package/lib/src/common/utxobased/info/commonInfo.d.ts +4 -2
- package/lib/src/common/utxobased/keymanager/types.d.ts +3 -3
- package/lib/src/common/utxobased/network/Blockbook.d.ts +20 -7
- package/lib/src/common/utxobased/network/BlockbookElectrum.d.ts +25 -0
- package/lib/src/common/utxobased/network/Socket.d.ts +11 -0
- package/lib/src/common/utxobased/network/blockbookApi.d.ts +2 -16
- package/lib/src/common/utxobased/network/electrumApi.d.ts +90 -0
- package/lib/src/index.d.ts +5 -1
- package/lib/src/react-native.d.ts +10 -0
- package/lib/test/utils.d.ts +4 -0
- package/package.json +24 -11
- package/lib/src/types.d.ts +0 -6
package/README.md
CHANGED
|
@@ -1,3 +1,62 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Edge Currency Plugin for UTXO-Based currencies
|
|
2
2
|
|
|
3
|
-
> Plugins for edge-core-js to support various cryptocurrencies such as bitcoin, bitcoin cash, and litecoin,
|
|
3
|
+
> Plugins for [edge-core-js](https://github.com/EdgeApp/edge-core-js), to support various cryptocurrencies such as bitcoin, bitcoin cash, and litecoin,
|
|
4
|
+
|
|
5
|
+
## Installing
|
|
6
|
+
|
|
7
|
+
First, add this library to your project:
|
|
8
|
+
|
|
9
|
+
```sh
|
|
10
|
+
npm i -s edge-currency-plugins
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
### Node.js
|
|
14
|
+
|
|
15
|
+
For Node.js, you should call `addEdgeCorePlugins` to register these plugins with edge-core-js:
|
|
16
|
+
|
|
17
|
+
```js
|
|
18
|
+
const { addEdgeCorePlugins, lockEdgeCorePlugins } = require("edge-core-js");
|
|
19
|
+
const plugins = require("edge-currency-plugins");
|
|
20
|
+
|
|
21
|
+
addEdgeCorePlugins(plugins);
|
|
22
|
+
|
|
23
|
+
// Once you are done adding plugins, call this:
|
|
24
|
+
lockEdgeCorePlugins();
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
You can also add plugins individually if you want to be more picky:
|
|
28
|
+
|
|
29
|
+
```js
|
|
30
|
+
addEdgeCorePlugins({
|
|
31
|
+
bitcoin: plugins.bitcoin,
|
|
32
|
+
});
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
### Browser
|
|
36
|
+
|
|
37
|
+
The bundle located in `dist/edge-currency-plugins.js` will automatically register itself with edge-core-js. Just serve the entire `dist` directory along with your app, and then load the script:
|
|
38
|
+
|
|
39
|
+
```html
|
|
40
|
+
<script src='https://example.com/app/dist/edge-currency-plugins.js'>
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
If you want to debug this project, run `yarn start` to start a Webpack server,
|
|
44
|
+
and then adjust your script URL to http://localhost:8081/edge-currency-plugins.js.
|
|
45
|
+
|
|
46
|
+
### React Native
|
|
47
|
+
|
|
48
|
+
The `edge-currency-plugins` package will automatically install itself using React Native autolinking.
|
|
49
|
+
To integrate the plugins with edge-core-js, add its URI to the context component:
|
|
50
|
+
|
|
51
|
+
```jsx
|
|
52
|
+
import { pluginUri, makePluginIo } from "edge-currency-plugins";
|
|
53
|
+
<MakeEdgeContext
|
|
54
|
+
nativeIo={{
|
|
55
|
+
"edge-currency-plugins": makePluginIo(),
|
|
56
|
+
}}
|
|
57
|
+
pluginUris={[pluginUri]}
|
|
58
|
+
// Plus other props as required...
|
|
59
|
+
/>;
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
To debug this project, run `yarn start` to start a Webpack server, and then use `debugUri` instead of `pluginUri`.
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
buildscript {
|
|
2
|
+
repositories {
|
|
3
|
+
google()
|
|
4
|
+
mavenCentral()
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
dependencies {
|
|
8
|
+
classpath 'com.android.tools.build:gradle:3.6.0'
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
apply plugin: 'com.android.library'
|
|
13
|
+
|
|
14
|
+
def safeExtGet(prop, fallback) {
|
|
15
|
+
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
def DEFAULT_COMPILE_SDK_VERSION = 28
|
|
19
|
+
def DEFAULT_BUILD_TOOLS_VERSION = '28.0.2'
|
|
20
|
+
def DEFAULT_MIN_SDK_VERSION = 19
|
|
21
|
+
def DEFAULT_TARGET_SDK_VERSION = 27
|
|
22
|
+
|
|
23
|
+
android {
|
|
24
|
+
namespace "app.edge.reactnative.currencyplugins"
|
|
25
|
+
|
|
26
|
+
compileSdkVersion safeExtGet('compileSdkVersion', DEFAULT_COMPILE_SDK_VERSION)
|
|
27
|
+
buildToolsVersion safeExtGet('buildToolsVersion', DEFAULT_BUILD_TOOLS_VERSION)
|
|
28
|
+
|
|
29
|
+
defaultConfig {
|
|
30
|
+
minSdkVersion safeExtGet('minSdkVersion', DEFAULT_MIN_SDK_VERSION)
|
|
31
|
+
targetSdkVersion safeExtGet('targetSdkVersion', DEFAULT_TARGET_SDK_VERSION)
|
|
32
|
+
versionCode 1
|
|
33
|
+
versionName '1.0'
|
|
34
|
+
}
|
|
35
|
+
lintOptions {
|
|
36
|
+
abortOnError false
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
repositories {
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
dependencies {
|
|
44
|
+
implementation 'com.facebook.react:react-native:+'
|
|
45
|
+
}
|