jcc_wallet 1.0.5 → 1.1.1
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 +28 -30
- package/lib/constant/index.js.map +1 -1
- package/lib/eth/index.d.ts +0 -1
- package/lib/eth/index.js +16 -13
- package/lib/eth/index.js.map +1 -1
- package/lib/index.d.ts +2 -6
- package/lib/index.js +17 -13
- package/lib/index.js.map +1 -1
- package/lib/jingchangWallet/index.d.ts +4 -3
- package/lib/jingchangWallet/index.js +31 -26
- package/lib/jingchangWallet/index.js.map +1 -1
- package/lib/moac/index.d.ts +0 -1
- package/lib/moac/index.js +9 -6
- package/lib/moac/index.js.map +1 -1
- package/lib/types/index.d.ts +12 -12
- package/lib/types/index.js +0 -2
- package/lib/util/index.d.ts +0 -1
- package/lib/util/index.js +15 -12
- package/lib/util/index.js.map +1 -1
- package/lib/x-wallet/index.d.ts +21 -0
- package/lib/x-wallet/index.js +82 -0
- package/lib/x-wallet/index.js.map +1 -0
- package/package.json +15 -19
- package/CHANGELOG.md +0 -124
- package/dist/jcc-wallet.min.js +0 -38
- package/lib/bvcadt/index.d.ts +0 -30
- package/lib/bvcadt/index.js +0 -59
- package/lib/bvcadt/index.js.map +0 -1
- package/lib/call/index.d.ts +0 -30
- package/lib/call/index.js +0 -59
- package/lib/call/index.js.map +0 -1
- package/lib/jingtum/index.d.ts +0 -37
- package/lib/jingtum/index.js +0 -62
- package/lib/jingtum/index.js.map +0 -1
- package/lib/ripple/index.d.ts +0 -30
- package/lib/ripple/index.js +0 -57
- package/lib/ripple/index.js.map +0 -1
- package/lib/stm/index.d.ts +0 -29
- package/lib/stm/index.js +0 -50
- package/lib/stm/index.js.map +0 -1
package/lib/bvcadt/index.d.ts
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { ICreateOptionsModel, IWalletModel } from "../types";
|
|
2
|
-
/**
|
|
3
|
-
* check bvcadt address is valid or not
|
|
4
|
-
*
|
|
5
|
-
* @param {string} address
|
|
6
|
-
* @returns {boolean} return true if valid
|
|
7
|
-
*/
|
|
8
|
-
declare const isValidAddress: (address: string) => boolean;
|
|
9
|
-
/**
|
|
10
|
-
* check bvcadt secret is valid or not
|
|
11
|
-
*
|
|
12
|
-
* @param {string} secret
|
|
13
|
-
* @returns {boolean} return true if valid
|
|
14
|
-
*/
|
|
15
|
-
declare const isValidSecret: (secret: string) => boolean;
|
|
16
|
-
/**
|
|
17
|
-
* get bvcadt address with secret
|
|
18
|
-
*
|
|
19
|
-
* @param {string} secret
|
|
20
|
-
* @returns {(string | null)} return address if valid, otherwise return null
|
|
21
|
-
*/
|
|
22
|
-
declare const getAddress: (secret: string) => string;
|
|
23
|
-
/**
|
|
24
|
-
* create bvcadt wallet
|
|
25
|
-
*
|
|
26
|
-
* @param {ICreateOptionsModel} [opt={}]
|
|
27
|
-
* @returns {(IWalletModel | null)} return IWalletModel if succress, otherwise return null
|
|
28
|
-
*/
|
|
29
|
-
declare const createWallet: (opt?: ICreateOptionsModel) => IWalletModel;
|
|
30
|
-
export { isValidAddress, isValidSecret, getAddress, createWallet };
|
package/lib/bvcadt/index.js
DELETED
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
var wallet_1 = require("@swtc/wallet");
|
|
4
|
-
var Wallet = wallet_1.Factory("bvcadt");
|
|
5
|
-
/**
|
|
6
|
-
* check bvcadt address is valid or not
|
|
7
|
-
*
|
|
8
|
-
* @param {string} address
|
|
9
|
-
* @returns {boolean} return true if valid
|
|
10
|
-
*/
|
|
11
|
-
var isValidAddress = function (address) {
|
|
12
|
-
return Wallet.isValidAddress(address);
|
|
13
|
-
};
|
|
14
|
-
exports.isValidAddress = isValidAddress;
|
|
15
|
-
/**
|
|
16
|
-
* check bvcadt secret is valid or not
|
|
17
|
-
*
|
|
18
|
-
* @param {string} secret
|
|
19
|
-
* @returns {boolean} return true if valid
|
|
20
|
-
*/
|
|
21
|
-
var isValidSecret = function (secret) {
|
|
22
|
-
return Wallet.isValidSecret(secret);
|
|
23
|
-
};
|
|
24
|
-
exports.isValidSecret = isValidSecret;
|
|
25
|
-
/**
|
|
26
|
-
* get bvcadt address with secret
|
|
27
|
-
*
|
|
28
|
-
* @param {string} secret
|
|
29
|
-
* @returns {(string | null)} return address if valid, otherwise return null
|
|
30
|
-
*/
|
|
31
|
-
var getAddress = function (secret) {
|
|
32
|
-
try {
|
|
33
|
-
var wallet = Wallet.fromSecret(secret);
|
|
34
|
-
return wallet.address;
|
|
35
|
-
}
|
|
36
|
-
catch (error) {
|
|
37
|
-
return null;
|
|
38
|
-
}
|
|
39
|
-
};
|
|
40
|
-
exports.getAddress = getAddress;
|
|
41
|
-
/**
|
|
42
|
-
* create bvcadt wallet
|
|
43
|
-
*
|
|
44
|
-
* @param {ICreateOptionsModel} [opt={}]
|
|
45
|
-
* @returns {(IWalletModel | null)} return IWalletModel if succress, otherwise return null
|
|
46
|
-
*/
|
|
47
|
-
var createWallet = function (opt) {
|
|
48
|
-
if (opt === void 0) { opt = {}; }
|
|
49
|
-
var wallet;
|
|
50
|
-
try {
|
|
51
|
-
wallet = Wallet.generate(opt);
|
|
52
|
-
}
|
|
53
|
-
catch (error) {
|
|
54
|
-
wallet = null;
|
|
55
|
-
}
|
|
56
|
-
return wallet;
|
|
57
|
-
};
|
|
58
|
-
exports.createWallet = createWallet;
|
|
59
|
-
//# sourceMappingURL=index.js.map
|
package/lib/bvcadt/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/bvcadt/index.ts"],"names":[],"mappings":";;AAAA,uCAAwD;AAExD,IAAM,MAAM,GAAG,gBAAa,CAAC,QAAQ,CAAC,CAAC;AACvC;;;;;GAKG;AACH,IAAM,cAAc,GAAG,UAAC,OAAe;IACrC,OAAO,MAAM,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;AACxC,CAAC,CAAC;AA2CO,wCAAc;AAzCvB;;;;;GAKG;AACH,IAAM,aAAa,GAAG,UAAC,MAAc;IACnC,OAAO,MAAM,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;AACtC,CAAC,CAAC;AAiCuB,sCAAa;AA/BtC;;;;;GAKG;AACH,IAAM,UAAU,GAAG,UAAC,MAAc;IAChC,IAAI;QACF,IAAM,MAAM,GAAG,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;QACzC,OAAO,MAAM,CAAC,OAAO,CAAC;KACvB;IAAC,OAAO,KAAK,EAAE;QACd,OAAO,IAAI,CAAC;KACb;AACH,CAAC,CAAC;AAkBsC,gCAAU;AAhBlD;;;;;GAKG;AACH,IAAM,YAAY,GAAG,UAAC,GAA6B;IAA7B,oBAAA,EAAA,QAA6B;IACjD,IAAI,MAAoB,CAAC;IACzB,IAAI;QACF,MAAM,GAAG,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;KAC/B;IAAC,OAAO,KAAK,EAAE;QACd,MAAM,GAAG,IAAI,CAAC;KACf;IACD,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC;AAEkD,oCAAY"}
|
package/lib/call/index.d.ts
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { ICreateOptionsModel, IWalletModel } from "../types";
|
|
2
|
-
/**
|
|
3
|
-
* check call address is valid or not
|
|
4
|
-
*
|
|
5
|
-
* @param {string} address
|
|
6
|
-
* @returns {boolean} return true if valid
|
|
7
|
-
*/
|
|
8
|
-
declare const isValidAddress: (address: string) => boolean;
|
|
9
|
-
/**
|
|
10
|
-
* check call secret is valid or not
|
|
11
|
-
*
|
|
12
|
-
* @param {string} secret
|
|
13
|
-
* @returns {boolean} return true if valid
|
|
14
|
-
*/
|
|
15
|
-
declare const isValidSecret: (secret: string) => boolean;
|
|
16
|
-
/**
|
|
17
|
-
* get call address with secret
|
|
18
|
-
*
|
|
19
|
-
* @param {string} secret
|
|
20
|
-
* @returns {(string | null)} return address if valid, otherwise return null
|
|
21
|
-
*/
|
|
22
|
-
declare const getAddress: (secret: string) => string;
|
|
23
|
-
/**
|
|
24
|
-
* create call wallet
|
|
25
|
-
*
|
|
26
|
-
* @param {ICreateOptionsModel} [opt={}]
|
|
27
|
-
* @returns {(IWalletModel | null)} return IWalletModel if succress, otherwise return null
|
|
28
|
-
*/
|
|
29
|
-
declare const createWallet: (opt?: ICreateOptionsModel) => IWalletModel;
|
|
30
|
-
export { isValidAddress, isValidSecret, getAddress, createWallet };
|
package/lib/call/index.js
DELETED
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
var wallet_1 = require("@swtc/wallet");
|
|
4
|
-
var Wallet = wallet_1.Factory("call");
|
|
5
|
-
/**
|
|
6
|
-
* check call address is valid or not
|
|
7
|
-
*
|
|
8
|
-
* @param {string} address
|
|
9
|
-
* @returns {boolean} return true if valid
|
|
10
|
-
*/
|
|
11
|
-
var isValidAddress = function (address) {
|
|
12
|
-
return Wallet.isValidAddress(address);
|
|
13
|
-
};
|
|
14
|
-
exports.isValidAddress = isValidAddress;
|
|
15
|
-
/**
|
|
16
|
-
* check call secret is valid or not
|
|
17
|
-
*
|
|
18
|
-
* @param {string} secret
|
|
19
|
-
* @returns {boolean} return true if valid
|
|
20
|
-
*/
|
|
21
|
-
var isValidSecret = function (secret) {
|
|
22
|
-
return Wallet.isValidSecret(secret);
|
|
23
|
-
};
|
|
24
|
-
exports.isValidSecret = isValidSecret;
|
|
25
|
-
/**
|
|
26
|
-
* get call address with secret
|
|
27
|
-
*
|
|
28
|
-
* @param {string} secret
|
|
29
|
-
* @returns {(string | null)} return address if valid, otherwise return null
|
|
30
|
-
*/
|
|
31
|
-
var getAddress = function (secret) {
|
|
32
|
-
try {
|
|
33
|
-
var wallet = Wallet.fromSecret(secret);
|
|
34
|
-
return wallet.address;
|
|
35
|
-
}
|
|
36
|
-
catch (error) {
|
|
37
|
-
return null;
|
|
38
|
-
}
|
|
39
|
-
};
|
|
40
|
-
exports.getAddress = getAddress;
|
|
41
|
-
/**
|
|
42
|
-
* create call wallet
|
|
43
|
-
*
|
|
44
|
-
* @param {ICreateOptionsModel} [opt={}]
|
|
45
|
-
* @returns {(IWalletModel | null)} return IWalletModel if succress, otherwise return null
|
|
46
|
-
*/
|
|
47
|
-
var createWallet = function (opt) {
|
|
48
|
-
if (opt === void 0) { opt = {}; }
|
|
49
|
-
var wallet;
|
|
50
|
-
try {
|
|
51
|
-
wallet = Wallet.generate(opt);
|
|
52
|
-
}
|
|
53
|
-
catch (error) {
|
|
54
|
-
wallet = null;
|
|
55
|
-
}
|
|
56
|
-
return wallet;
|
|
57
|
-
};
|
|
58
|
-
exports.createWallet = createWallet;
|
|
59
|
-
//# sourceMappingURL=index.js.map
|
package/lib/call/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/call/index.ts"],"names":[],"mappings":";;AAAA,uCAAwD;AAExD,IAAM,MAAM,GAAG,gBAAa,CAAC,MAAM,CAAC,CAAC;AAErC;;;;;GAKG;AACH,IAAM,cAAc,GAAG,UAAC,OAAe;IACrC,OAAO,MAAM,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;AACxC,CAAC,CAAC;AA2CO,wCAAc;AAzCvB;;;;;GAKG;AACH,IAAM,aAAa,GAAG,UAAC,MAAc;IACnC,OAAO,MAAM,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;AACtC,CAAC,CAAC;AAiCuB,sCAAa;AA/BtC;;;;;GAKG;AACH,IAAM,UAAU,GAAG,UAAC,MAAc;IAChC,IAAI;QACF,IAAM,MAAM,GAAG,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;QACzC,OAAO,MAAM,CAAC,OAAO,CAAC;KACvB;IAAC,OAAO,KAAK,EAAE;QACd,OAAO,IAAI,CAAC;KACb;AACH,CAAC,CAAC;AAkBsC,gCAAU;AAhBlD;;;;;GAKG;AACH,IAAM,YAAY,GAAG,UAAC,GAA6B;IAA7B,oBAAA,EAAA,QAA6B;IACjD,IAAI,MAAoB,CAAC;IACzB,IAAI;QACF,MAAM,GAAG,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;KAC/B;IAAC,OAAO,KAAK,EAAE;QACd,MAAM,GAAG,IAAI,CAAC;KACf;IACD,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC;AAEkD,oCAAY"}
|
package/lib/jingtum/index.d.ts
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { IWalletModel } from "../types";
|
|
2
|
-
/**
|
|
3
|
-
* check swtc or bizain address is valid or not
|
|
4
|
-
*
|
|
5
|
-
* @param {string} address
|
|
6
|
-
* @param {string} [chain="swt"] the default value is `swt` which means the chain is swtc,
|
|
7
|
-
* if the value is `bwt` which means the chain is bizain
|
|
8
|
-
* @returns {boolean} return true if valid
|
|
9
|
-
*/
|
|
10
|
-
declare const isValidAddress: (address: string, chain?: string) => boolean;
|
|
11
|
-
/**
|
|
12
|
-
* check swtc or bizain secret is valid or not
|
|
13
|
-
*
|
|
14
|
-
* @param {string} secret
|
|
15
|
-
* @param {string} [chain="swt"] the default value is `swt` which means the chain is swtc,
|
|
16
|
-
* if the value is `bwt` which means the chain is bizain
|
|
17
|
-
* @returns {boolean} return true if valid
|
|
18
|
-
*/
|
|
19
|
-
declare const isValidSecret: (secret: string, chain?: string) => boolean;
|
|
20
|
-
/**
|
|
21
|
-
* get address with secret
|
|
22
|
-
*
|
|
23
|
-
* @param {string} secret
|
|
24
|
-
* @param {string} [chain="swt"] the default value is `swt` which means the chain is swtc,
|
|
25
|
-
* if the value is `bwt` which means the chain is bizain
|
|
26
|
-
* @returns {(string | null)} return address if valid, otherwise return null
|
|
27
|
-
*/
|
|
28
|
-
declare const getAddress: (secret: string, chain?: string) => string;
|
|
29
|
-
/**
|
|
30
|
-
* create swtc or bizain wallet
|
|
31
|
-
*
|
|
32
|
-
* @param {string} [chain="swt"] the default value is `swt` which means create swtc wallet,
|
|
33
|
-
* if the value is `bwt` which means create bizain wallet
|
|
34
|
-
* @returns {IWalletModel}
|
|
35
|
-
*/
|
|
36
|
-
declare const createWallet: (chain?: string) => IWalletModel;
|
|
37
|
-
export { isValidAddress, isValidSecret, getAddress, createWallet };
|
package/lib/jingtum/index.js
DELETED
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
var wallet_1 = require("@swtc/wallet");
|
|
4
|
-
/**
|
|
5
|
-
* check swtc or bizain address is valid or not
|
|
6
|
-
*
|
|
7
|
-
* @param {string} address
|
|
8
|
-
* @param {string} [chain="swt"] the default value is `swt` which means the chain is swtc,
|
|
9
|
-
* if the value is `bwt` which means the chain is bizain
|
|
10
|
-
* @returns {boolean} return true if valid
|
|
11
|
-
*/
|
|
12
|
-
var isValidAddress = function (address, chain) {
|
|
13
|
-
if (chain === void 0) { chain = "swt"; }
|
|
14
|
-
return wallet_1.Factory(chain).isValidAddress(address);
|
|
15
|
-
};
|
|
16
|
-
exports.isValidAddress = isValidAddress;
|
|
17
|
-
/**
|
|
18
|
-
* check swtc or bizain secret is valid or not
|
|
19
|
-
*
|
|
20
|
-
* @param {string} secret
|
|
21
|
-
* @param {string} [chain="swt"] the default value is `swt` which means the chain is swtc,
|
|
22
|
-
* if the value is `bwt` which means the chain is bizain
|
|
23
|
-
* @returns {boolean} return true if valid
|
|
24
|
-
*/
|
|
25
|
-
var isValidSecret = function (secret, chain) {
|
|
26
|
-
if (chain === void 0) { chain = "swt"; }
|
|
27
|
-
return wallet_1.Factory(chain).isValidSecret(secret);
|
|
28
|
-
};
|
|
29
|
-
exports.isValidSecret = isValidSecret;
|
|
30
|
-
/**
|
|
31
|
-
* get address with secret
|
|
32
|
-
*
|
|
33
|
-
* @param {string} secret
|
|
34
|
-
* @param {string} [chain="swt"] the default value is `swt` which means the chain is swtc,
|
|
35
|
-
* if the value is `bwt` which means the chain is bizain
|
|
36
|
-
* @returns {(string | null)} return address if valid, otherwise return null
|
|
37
|
-
*/
|
|
38
|
-
var getAddress = function (secret, chain) {
|
|
39
|
-
if (chain === void 0) { chain = "swt"; }
|
|
40
|
-
try {
|
|
41
|
-
var wallet = wallet_1.Factory(chain).fromSecret(secret);
|
|
42
|
-
return wallet.address;
|
|
43
|
-
}
|
|
44
|
-
catch (error) {
|
|
45
|
-
return null;
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
|
-
exports.getAddress = getAddress;
|
|
49
|
-
/**
|
|
50
|
-
* create swtc or bizain wallet
|
|
51
|
-
*
|
|
52
|
-
* @param {string} [chain="swt"] the default value is `swt` which means create swtc wallet,
|
|
53
|
-
* if the value is `bwt` which means create bizain wallet
|
|
54
|
-
* @returns {IWalletModel}
|
|
55
|
-
*/
|
|
56
|
-
var createWallet = function (chain) {
|
|
57
|
-
if (chain === void 0) { chain = "swt"; }
|
|
58
|
-
var wallet = wallet_1.Factory(chain).generate();
|
|
59
|
-
return wallet;
|
|
60
|
-
};
|
|
61
|
-
exports.createWallet = createWallet;
|
|
62
|
-
//# sourceMappingURL=index.js.map
|
package/lib/jingtum/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/jingtum/index.ts"],"names":[],"mappings":";;AAAA,uCAAwD;AAGxD;;;;;;;GAOG;AACH,IAAM,cAAc,GAAG,UAAC,OAAe,EAAE,KAAa;IAAb,sBAAA,EAAA,aAAa;IACpD,OAAO,gBAAa,CAAC,KAAK,CAAC,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;AACtD,CAAC,CAAC;AA2CO,wCAAc;AAzCvB;;;;;;;GAOG;AACH,IAAM,aAAa,GAAG,UAAC,MAAc,EAAE,KAAqB;IAArB,sBAAA,EAAA,aAAqB;IAC1D,OAAO,gBAAa,CAAC,KAAK,CAAC,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;AACpD,CAAC,CAAC;AA+BuB,sCAAa;AA7BtC;;;;;;;GAOG;AACH,IAAM,UAAU,GAAG,UAAC,MAAc,EAAE,KAAqB;IAArB,sBAAA,EAAA,aAAqB;IACvD,IAAI;QACF,IAAM,MAAM,GAAG,gBAAa,CAAC,KAAK,CAAC,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;QACvD,OAAO,MAAM,CAAC,OAAO,CAAC;KACvB;IAAC,OAAO,KAAK,EAAE;QACd,OAAO,IAAI,CAAC;KACb;AACH,CAAC,CAAC;AAcsC,gCAAU;AAZlD;;;;;;GAMG;AACH,IAAM,YAAY,GAAG,UAAC,KAAqB;IAArB,sBAAA,EAAA,aAAqB;IACzC,IAAM,MAAM,GAAG,gBAAa,CAAC,KAAK,CAAC,CAAC,QAAQ,EAAE,CAAC;IAC/C,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC;AAEkD,oCAAY"}
|
package/lib/ripple/index.d.ts
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { ICreateOptionsModel, IWalletModel } from "../types";
|
|
2
|
-
/**
|
|
3
|
-
* check ripple secret is valid or not
|
|
4
|
-
*
|
|
5
|
-
* @param {string} secret
|
|
6
|
-
* @returns {boolean} return true if valid
|
|
7
|
-
*/
|
|
8
|
-
declare const isValidSecret: (secret: string) => boolean;
|
|
9
|
-
/**
|
|
10
|
-
* check ripple address is valid or not
|
|
11
|
-
*
|
|
12
|
-
* @param {string} address
|
|
13
|
-
* @returns {boolean} return true if valid
|
|
14
|
-
*/
|
|
15
|
-
declare const isValidAddress: (address: string) => boolean;
|
|
16
|
-
/**
|
|
17
|
-
* get address with secret
|
|
18
|
-
*
|
|
19
|
-
* @param {string} secret
|
|
20
|
-
* @returns {(string | null)} return address if valid, otherwise return null
|
|
21
|
-
*/
|
|
22
|
-
declare const getAddress: (secret: string) => string;
|
|
23
|
-
/**
|
|
24
|
-
* create ripple wallet
|
|
25
|
-
*
|
|
26
|
-
* @param {ICreateOptionsModel} opt
|
|
27
|
-
* @returns {IWalletModel}
|
|
28
|
-
*/
|
|
29
|
-
declare const createWallet: (opt: ICreateOptionsModel) => IWalletModel;
|
|
30
|
-
export { isValidSecret, isValidAddress, getAddress, createWallet };
|
package/lib/ripple/index.js
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
var wallet_1 = require("@swtc/wallet");
|
|
4
|
-
var Wallet = wallet_1.Factory("xrp");
|
|
5
|
-
/**
|
|
6
|
-
* check ripple secret is valid or not
|
|
7
|
-
*
|
|
8
|
-
* @param {string} secret
|
|
9
|
-
* @returns {boolean} return true if valid
|
|
10
|
-
*/
|
|
11
|
-
var isValidSecret = function (secret) {
|
|
12
|
-
return Wallet.isValidSecret(secret);
|
|
13
|
-
};
|
|
14
|
-
exports.isValidSecret = isValidSecret;
|
|
15
|
-
/**
|
|
16
|
-
* check ripple address is valid or not
|
|
17
|
-
*
|
|
18
|
-
* @param {string} address
|
|
19
|
-
* @returns {boolean} return true if valid
|
|
20
|
-
*/
|
|
21
|
-
var isValidAddress = function (address) {
|
|
22
|
-
return Wallet.isValidAddress(address);
|
|
23
|
-
};
|
|
24
|
-
exports.isValidAddress = isValidAddress;
|
|
25
|
-
/**
|
|
26
|
-
* get address with secret
|
|
27
|
-
*
|
|
28
|
-
* @param {string} secret
|
|
29
|
-
* @returns {(string | null)} return address if valid, otherwise return null
|
|
30
|
-
*/
|
|
31
|
-
var getAddress = function (secret) {
|
|
32
|
-
try {
|
|
33
|
-
var wallet = Wallet.fromSecret(secret);
|
|
34
|
-
return wallet.address;
|
|
35
|
-
}
|
|
36
|
-
catch (error) {
|
|
37
|
-
return null;
|
|
38
|
-
}
|
|
39
|
-
};
|
|
40
|
-
exports.getAddress = getAddress;
|
|
41
|
-
/**
|
|
42
|
-
* create ripple wallet
|
|
43
|
-
*
|
|
44
|
-
* @param {ICreateOptionsModel} opt
|
|
45
|
-
* @returns {IWalletModel}
|
|
46
|
-
*/
|
|
47
|
-
var createWallet = function (opt) {
|
|
48
|
-
try {
|
|
49
|
-
var wallet = Wallet.generate(opt);
|
|
50
|
-
return wallet;
|
|
51
|
-
}
|
|
52
|
-
catch (error) {
|
|
53
|
-
return null;
|
|
54
|
-
}
|
|
55
|
-
};
|
|
56
|
-
exports.createWallet = createWallet;
|
|
57
|
-
//# sourceMappingURL=index.js.map
|
package/lib/ripple/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/ripple/index.ts"],"names":[],"mappings":";;AAAA,uCAAwD;AAExD,IAAM,MAAM,GAAG,gBAAa,CAAC,KAAK,CAAC,CAAC;AAEpC;;;;;GAKG;AACH,IAAM,aAAa,GAAG,UAAC,MAAc;IACnC,OAAO,MAAM,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;AACtC,CAAC,CAAC;AA0CO,sCAAa;AAxCtB;;;;;GAKG;AACH,IAAM,cAAc,GAAG,UAAC,OAAe;IACrC,OAAO,MAAM,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;AACxC,CAAC,CAAC;AAgCsB,wCAAc;AA9BtC;;;;;GAKG;AACH,IAAM,UAAU,GAAG,UAAC,MAAc;IAChC,IAAI;QACF,IAAM,MAAM,GAAG,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;QACzC,OAAO,MAAM,CAAC,OAAO,CAAC;KACvB;IAAC,OAAO,KAAK,EAAE;QACd,OAAO,IAAI,CAAC;KACb;AACH,CAAC,CAAC;AAiBsC,gCAAU;AAflD;;;;;GAKG;AACH,IAAM,YAAY,GAAG,UAAC,GAAwB;IAC5C,IAAI;QACF,IAAM,MAAM,GAAG,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;QACpC,OAAO,MAAM,CAAC;KACf;IAAC,OAAO,KAAK,EAAE;QACd,OAAO,IAAI,CAAC;KACb;AACH,CAAC,CAAC;AAEkD,oCAAY"}
|
package/lib/stm/index.d.ts
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { IWalletModel } from "../types";
|
|
2
|
-
/**
|
|
3
|
-
* check stream secret is valid or not
|
|
4
|
-
*
|
|
5
|
-
* @param {string} secret
|
|
6
|
-
* @returns {boolean} return true if valid
|
|
7
|
-
*/
|
|
8
|
-
declare const isValidSecret: (secret: string) => boolean;
|
|
9
|
-
/**
|
|
10
|
-
* check stream address is valid or not
|
|
11
|
-
*
|
|
12
|
-
* @param {string} address
|
|
13
|
-
* @returns {boolean} return true if valid
|
|
14
|
-
*/
|
|
15
|
-
declare const isValidAddress: (address: string) => boolean;
|
|
16
|
-
/**
|
|
17
|
-
* create stream wallet
|
|
18
|
-
*
|
|
19
|
-
* @returns {IWalletModel}
|
|
20
|
-
*/
|
|
21
|
-
declare const createWallet: () => IWalletModel;
|
|
22
|
-
/**
|
|
23
|
-
* get address with secret
|
|
24
|
-
*
|
|
25
|
-
* @param {string} secret
|
|
26
|
-
* @returns {(string | null)} return address if valid, otherwise return null
|
|
27
|
-
*/
|
|
28
|
-
declare const getAddress: (secret: string) => string;
|
|
29
|
-
export { isValidSecret, isValidAddress, createWallet, getAddress };
|
package/lib/stm/index.js
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
var wallet_1 = require("@swtc/wallet");
|
|
4
|
-
var Wallet = wallet_1.Factory("stm");
|
|
5
|
-
/**
|
|
6
|
-
* check stream secret is valid or not
|
|
7
|
-
*
|
|
8
|
-
* @param {string} secret
|
|
9
|
-
* @returns {boolean} return true if valid
|
|
10
|
-
*/
|
|
11
|
-
var isValidSecret = function (secret) {
|
|
12
|
-
return Wallet.isValidSecret(secret);
|
|
13
|
-
};
|
|
14
|
-
exports.isValidSecret = isValidSecret;
|
|
15
|
-
/**
|
|
16
|
-
* check stream address is valid or not
|
|
17
|
-
*
|
|
18
|
-
* @param {string} address
|
|
19
|
-
* @returns {boolean} return true if valid
|
|
20
|
-
*/
|
|
21
|
-
var isValidAddress = function (address) {
|
|
22
|
-
return Wallet.isValidAddress(address);
|
|
23
|
-
};
|
|
24
|
-
exports.isValidAddress = isValidAddress;
|
|
25
|
-
/**
|
|
26
|
-
* create stream wallet
|
|
27
|
-
*
|
|
28
|
-
* @returns {IWalletModel}
|
|
29
|
-
*/
|
|
30
|
-
var createWallet = function () {
|
|
31
|
-
return Wallet.generate();
|
|
32
|
-
};
|
|
33
|
-
exports.createWallet = createWallet;
|
|
34
|
-
/**
|
|
35
|
-
* get address with secret
|
|
36
|
-
*
|
|
37
|
-
* @param {string} secret
|
|
38
|
-
* @returns {(string | null)} return address if valid, otherwise return null
|
|
39
|
-
*/
|
|
40
|
-
var getAddress = function (secret) {
|
|
41
|
-
try {
|
|
42
|
-
var wallet = Wallet.fromSecret(secret);
|
|
43
|
-
return wallet.address;
|
|
44
|
-
}
|
|
45
|
-
catch (error) {
|
|
46
|
-
return null;
|
|
47
|
-
}
|
|
48
|
-
};
|
|
49
|
-
exports.getAddress = getAddress;
|
|
50
|
-
//# sourceMappingURL=index.js.map
|
package/lib/stm/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/stm/index.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AACb,uCAAwD;AAExD,IAAM,MAAM,GAAG,gBAAa,CAAC,KAAK,CAAC,CAAC;AACpC;;;;;GAKG;AACH,IAAM,aAAa,GAAG,UAAC,MAAc;IACnC,OAAO,MAAM,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;AACtC,CAAC,CAAC;AAoCO,sCAAa;AAlCtB;;;;;GAKG;AACH,IAAM,cAAc,GAAG,UAAC,OAAe;IACrC,OAAO,MAAM,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;AACxC,CAAC,CAAC;AA0BsB,wCAAc;AAxBtC;;;;GAIG;AACH,IAAM,YAAY,GAAG;IACnB,OAAO,MAAM,CAAC,QAAQ,EAAE,CAAC;AAC3B,CAAC,CAAC;AAiBsC,oCAAY;AAfpD;;;;;GAKG;AACH,IAAM,UAAU,GAAG,UAAC,MAAc;IAChC,IAAI;QACF,IAAM,MAAM,GAAG,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;QACzC,OAAO,MAAM,CAAC,OAAO,CAAC;KACvB;IAAC,OAAO,KAAK,EAAE;QACd,OAAO,IAAI,CAAC;KACb;AACH,CAAC,CAAC;AAEoD,gCAAU"}
|