-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.js
28 lines (26 loc) · 915 Bytes
/
main.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import Signer from '@waves/signer';
import Provider from '@waves.exchange/provider-web';
const VueSigner = {
install(Vue, options) {
let signer = null;
if (!options) {
options = {
node: '',
provider: ''
}
}
let nodeUrl = {
NODE_URL: options.node ? options.node : 'https://nodes-testnet.wavesnodes.com'
};
let provider = options.provider ? options.provider : 'https://testnet.waves.exchange/signer/';
if (options.debug) {
signer = new Signer(nodeUrl);
signer.setProvider(new Provider(provider));
} else {
signer = options.node ? new Signer(nodeUrl) : new Signer();
signer.setProvider(options.provider ? new Provider(provider) : new Provider());
}
Vue.prototype.signer = signer;
}
};
export default VueSigner;