mainnet-js 1.1.34 → 2.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/dist/index.html +1 -1
- package/dist/{mainnet-1.1.34.js → mainnet-2.0.0.js} +25 -337
- package/dist/module/db/SqlProvider.d.ts +2 -2
- package/dist/module/db/SqlProvider.d.ts.map +1 -1
- package/dist/module/db/SqlProvider.js +6 -24
- package/dist/module/db/SqlProvider.js.map +1 -1
- package/dist/module/index.d.ts +0 -3
- package/dist/module/index.d.ts.map +1 -1
- package/dist/module/index.js +3 -6
- package/dist/module/index.js.map +1 -1
- package/dist/module/transaction/Wif.d.ts +4 -8
- package/dist/module/transaction/Wif.d.ts.map +1 -1
- package/dist/module/transaction/Wif.js +6 -10
- package/dist/module/transaction/Wif.js.map +1 -1
- package/dist/module/util/deriveCashaddr.d.ts +1 -0
- package/dist/module/util/deriveCashaddr.d.ts.map +1 -1
- package/dist/module/util/deriveCashaddr.js +8 -1
- package/dist/module/util/deriveCashaddr.js.map +1 -1
- package/dist/module/wallet/Base.d.ts +1 -1
- package/dist/module/wallet/Base.js +1 -1
- package/dist/module/wallet/Util.d.ts +2 -2
- package/dist/module/wallet/Util.js +2 -2
- package/dist/module/wallet/Wif.d.ts +0 -28
- package/dist/module/wallet/Wif.d.ts.map +1 -1
- package/dist/module/wallet/Wif.js +2 -109
- package/dist/module/wallet/Wif.js.map +1 -1
- package/dist/module/wallet/createWallet.d.ts +0 -12
- package/dist/module/wallet/createWallet.d.ts.map +1 -1
- package/dist/module/wallet/createWallet.js +0 -43
- package/dist/module/wallet/createWallet.js.map +1 -1
- package/dist/module/wallet/interface.d.ts +0 -2
- package/dist/module/wallet/interface.d.ts.map +1 -1
- package/dist/module/webhook/Webhook.d.ts +1 -6
- package/dist/module/webhook/Webhook.d.ts.map +1 -1
- package/dist/module/webhook/Webhook.js +0 -4
- package/dist/module/webhook/Webhook.js.map +1 -1
- package/dist/module/webhook/index.d.ts +0 -1
- package/dist/module/webhook/index.d.ts.map +1 -1
- package/dist/module/webhook/index.js +0 -1
- package/dist/module/webhook/index.js.map +1 -1
- package/dist/module/webhook/interface.d.ts +0 -1
- package/dist/module/webhook/interface.d.ts.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +5 -10
- package/src/db/SqlProvider.test.ts +2 -18
- package/src/db/SqlProvider.ts +5 -26
- package/src/index.ts +3 -7
- package/src/transaction/Wif.ts +2 -19
- package/src/util/deriveCashaddr.test.ts +8 -0
- package/src/util/deriveCashaddr.ts +9 -0
- package/src/wallet/Base.ts +1 -1
- package/src/wallet/Util.ts +2 -2
- package/src/wallet/Wif.test.ts +0 -23
- package/src/wallet/Wif.ts +2 -148
- package/src/wallet/createWallet.ts +0 -53
- package/src/wallet/interface.ts +0 -2
- package/src/webhook/Webhook.ts +4 -10
- package/src/webhook/index.ts +0 -1
- package/src/webhook/interface.ts +0 -1
- package/webpack.config.cjs +7 -7
- package/dist/module/slp/GsppProvider.d.ts +0 -55
- package/dist/module/slp/GsppProvider.d.ts.map +0 -1
- package/dist/module/slp/GsppProvider.js +0 -204
- package/dist/module/slp/GsppProvider.js.map +0 -1
- package/dist/module/slp/SlpDbProvider.d.ts +0 -52
- package/dist/module/slp/SlpDbProvider.d.ts.map +0 -1
- package/dist/module/slp/SlpDbProvider.js +0 -175
- package/dist/module/slp/SlpDbProvider.js.map +0 -1
- package/dist/module/slp/SlpDbTemplates.d.ts +0 -313
- package/dist/module/slp/SlpDbTemplates.d.ts.map +0 -1
- package/dist/module/slp/SlpDbTemplates.js +0 -375
- package/dist/module/slp/SlpDbTemplates.js.map +0 -1
- package/dist/module/slp/SlpLibAuth.d.ts +0 -210
- package/dist/module/slp/SlpLibAuth.d.ts.map +0 -1
- package/dist/module/slp/SlpLibAuth.js +0 -451
- package/dist/module/slp/SlpLibAuth.js.map +0 -1
- package/dist/module/slp/SlpProvider.d.ts +0 -24
- package/dist/module/slp/SlpProvider.d.ts.map +0 -1
- package/dist/module/slp/SlpProvider.js +0 -29
- package/dist/module/slp/SlpProvider.js.map +0 -1
- package/dist/module/slp/index.d.ts +0 -6
- package/dist/module/slp/index.d.ts.map +0 -1
- package/dist/module/slp/index.js +0 -5
- package/dist/module/slp/index.js.map +0 -1
- package/dist/module/slp/interface.d.ts +0 -114
- package/dist/module/slp/interface.d.ts.map +0 -1
- package/dist/module/slp/interface.js +0 -7
- package/dist/module/slp/interface.js.map +0 -1
- package/dist/module/util/bchaddr.d.ts +0 -2
- package/dist/module/util/bchaddr.d.ts.map +0 -1
- package/dist/module/util/bchaddr.js +0 -16
- package/dist/module/util/bchaddr.js.map +0 -1
- package/dist/module/wallet/Slp.d.ts +0 -431
- package/dist/module/wallet/Slp.d.ts.map +0 -1
- package/dist/module/wallet/Slp.js +0 -770
- package/dist/module/wallet/Slp.js.map +0 -1
- package/dist/module/webhook/WebhookSlp.d.ts +0 -15
- package/dist/module/webhook/WebhookSlp.d.ts.map +0 -1
- package/dist/module/webhook/WebhookSlp.js +0 -100
- package/dist/module/webhook/WebhookSlp.js.map +0 -1
- package/src/slp/GsppProvider.test.ts +0 -40
- package/src/slp/GsppProvider.ts +0 -329
- package/src/slp/SlpDbProvider.test.ts +0 -27
- package/src/slp/SlpDbProvider.ts +0 -291
- package/src/slp/SlpDbTemplates.ts +0 -400
- package/src/slp/SlpLibAuth.test.ts +0 -162
- package/src/slp/SlpLibAuth.ts +0 -532
- package/src/slp/SlpProvider.ts +0 -100
- package/src/slp/index.ts +0 -6
- package/src/slp/interface.ts +0 -128
- package/src/util/bchaddr.test.ts +0 -27
- package/src/util/bchaddr.ts +0 -27
- package/src/wallet/Slp.test.headless.js +0 -120
- package/src/wallet/Slp.test.ts +0 -1000
- package/src/wallet/Slp.ts +0 -1014
- package/src/webhook/WebhookSlp.test.ts +0 -288
- package/src/webhook/WebhookSlp.ts +0 -123
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { SlpTokenBalance, SlpTokenInfo, SlpTxI, SlpUtxoI } from "./interface.js";
|
|
2
|
-
import BigNumber from "bignumber.js";
|
|
3
|
-
export declare type SlpWatchTransactionCallback = (tx: SlpTxI) => void;
|
|
4
|
-
export declare type SlpCancelWatchFn = () => Promise<void>;
|
|
5
|
-
export declare type SlpWatchBalanceCallback = (balance: SlpTokenBalance) => void;
|
|
6
|
-
export interface SlpProvider {
|
|
7
|
-
SlpOutpoints(slpaddr: string): Promise<String[]>;
|
|
8
|
-
SlpUtxos(slpaddr: string): Promise<SlpUtxoI[]>;
|
|
9
|
-
SlpTokenInfo(tokenId: string): Promise<SlpTokenInfo | undefined>;
|
|
10
|
-
SlpSpendableUtxos(slpaddr: string, tokenId?: string): Promise<SlpUtxoI[]>;
|
|
11
|
-
SlpBatonUtxos(slpaddr: string, tokenId?: string): Promise<SlpUtxoI[]>;
|
|
12
|
-
SlpAllTokenBalances(slpaddr: string): Promise<SlpTokenBalance[]>;
|
|
13
|
-
SlpTokenBalance(slpaddr: string, tokenId: string): Promise<SlpTokenBalance>;
|
|
14
|
-
SlpAddressTransactionHistory(slpaddr: string, tokenId?: string): Promise<SlpTxI[]>;
|
|
15
|
-
SlpWaitForTransaction(slpaddr: string, tokenId?: string): Promise<SlpTxI>;
|
|
16
|
-
SlpWaitForBalance(value: BigNumber.Value, slpaddr: string, tokenId: string): Promise<SlpTokenBalance>;
|
|
17
|
-
SlpWatchBalance(callback: SlpWatchBalanceCallback, slpaddr: string, tokenId: string): SlpCancelWatchFn;
|
|
18
|
-
SlpWatchTransactions(callback: SlpWatchTransactionCallback, slpaddr?: string, tokenId?: string): SlpCancelWatchFn;
|
|
19
|
-
}
|
|
20
|
-
export declare function _convertBalanceBigNumbers(balances: SlpTokenBalance[]): SlpTokenBalance[];
|
|
21
|
-
export declare function _convertUtxoBigNumbers(utxos: SlpUtxoI[]): SlpUtxoI[];
|
|
22
|
-
export declare function _convertSlpTokenInfo(tokenInfo: SlpTokenInfo | undefined): SlpTokenInfo | undefined;
|
|
23
|
-
export declare function _emptyTokenBalance(tokenId: string): SlpTokenBalance;
|
|
24
|
-
//# sourceMappingURL=SlpProvider.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SlpProvider.d.ts","sourceRoot":"","sources":["../../../src/slp/SlpProvider.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,YAAY,EACZ,MAAM,EACN,QAAQ,EACT,MAAM,gBAAgB,CAAC;AACxB,OAAO,SAAS,MAAM,cAAc,CAAC;AAErC,oBAAY,2BAA2B,GAAG,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;AAC/D,oBAAY,gBAAgB,GAAG,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;AACnD,oBAAY,uBAAuB,GAAG,CAAC,OAAO,EAAE,eAAe,KAAK,IAAI,CAAC;AAEzE,MAAM,WAAW,WAAW;IAE1B,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;IAGjD,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC;IAG/C,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,GAAG,SAAS,CAAC,CAAC;IAGjE,iBAAiB,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC;IAG1E,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC;IAGtE,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,EAAE,CAAC,CAAC;IAGjE,eAAe,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC;IAG5E,4BAA4B,CAC1B,OAAO,EAAE,MAAM,EACf,OAAO,CAAC,EAAE,MAAM,GACf,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;IAGrB,qBAAqB,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAG1E,iBAAiB,CACf,KAAK,EAAE,SAAS,CAAC,KAAK,EACtB,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,eAAe,CAAC,CAAC;IAG5B,eAAe,CACb,QAAQ,EAAE,uBAAuB,EACjC,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,GACd,gBAAgB,CAAC;IAGpB,oBAAoB,CAClB,QAAQ,EAAE,2BAA2B,EACrC,OAAO,CAAC,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE,MAAM,GACf,gBAAgB,CAAC;CACrB;AAED,wBAAgB,yBAAyB,CACvC,QAAQ,EAAE,eAAe,EAAE,GAC1B,eAAe,EAAE,CAGnB;AAED,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,QAAQ,EAAE,GAAG,QAAQ,EAAE,CAGpE;AAED,wBAAgB,oBAAoB,CAClC,SAAS,EAAE,YAAY,GAAG,SAAS,GAClC,YAAY,GAAG,SAAS,CAW1B;AAED,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,eAAe,CAOnE"}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import BigNumber from "bignumber.js";
|
|
2
|
-
export function _convertBalanceBigNumbers(balances) {
|
|
3
|
-
balances.forEach((val) => (val.value = new BigNumber(val.value)));
|
|
4
|
-
return balances;
|
|
5
|
-
}
|
|
6
|
-
export function _convertUtxoBigNumbers(utxos) {
|
|
7
|
-
utxos.forEach((val) => (val.value = new BigNumber(val.value)));
|
|
8
|
-
return utxos;
|
|
9
|
-
}
|
|
10
|
-
export function _convertSlpTokenInfo(tokenInfo) {
|
|
11
|
-
if (!tokenInfo)
|
|
12
|
-
return tokenInfo;
|
|
13
|
-
for (const key in tokenInfo) {
|
|
14
|
-
if (tokenInfo[key] === null) {
|
|
15
|
-
tokenInfo[key] = "";
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
tokenInfo.initialAmount = new BigNumber(tokenInfo.initialAmount);
|
|
19
|
-
return tokenInfo;
|
|
20
|
-
}
|
|
21
|
-
export function _emptyTokenBalance(tokenId) {
|
|
22
|
-
return {
|
|
23
|
-
value: new BigNumber(0),
|
|
24
|
-
ticker: "",
|
|
25
|
-
name: "",
|
|
26
|
-
tokenId: tokenId,
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
//# sourceMappingURL=SlpProvider.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SlpProvider.js","sourceRoot":"","sources":["../../../src/slp/SlpProvider.ts"],"names":[],"mappings":"AAMA,OAAO,SAAS,MAAM,cAAc,CAAC;AA2DrC,MAAM,UAAU,yBAAyB,CACvC,QAA2B;IAE3B,QAAQ,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,KAAK,GAAG,IAAI,SAAS,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IAClE,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED,MAAM,UAAU,sBAAsB,CAAC,KAAiB;IACtD,KAAK,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,KAAK,GAAG,IAAI,SAAS,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IAC/D,OAAO,KAAK,CAAC;AACf,CAAC;AAED,MAAM,UAAU,oBAAoB,CAClC,SAAmC;IAEnC,IAAI,CAAC,SAAS;QAAE,OAAO,SAAS,CAAC;IAEjC,KAAK,MAAM,GAAG,IAAI,SAAS,EAAE;QAC3B,IAAI,SAAS,CAAC,GAAG,CAAC,KAAK,IAAI,EAAE;YAC3B,SAAS,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC;SACrB;KACF;IACD,SAAS,CAAC,aAAa,GAAG,IAAI,SAAS,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC;IAEjE,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,OAAe;IAChD,OAAO;QACL,KAAK,EAAE,IAAI,SAAS,CAAC,CAAC,CAAC;QACvB,MAAM,EAAE,EAAE;QACV,IAAI,EAAE,EAAE;QACR,OAAO,EAAE,OAAO;KACE,CAAC;AACvB,CAAC"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export { SlpDbProvider } from "./SlpDbProvider.js";
|
|
2
|
-
export { GsppProvider } from "./GsppProvider.js";
|
|
3
|
-
export { SlpProvider } from "./SlpProvider.js";
|
|
4
|
-
export { default as BigNumber } from "bignumber.js";
|
|
5
|
-
export * from "./interface.js";
|
|
6
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/slp/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,cAAc,CAAC;AAEpD,cAAc,gBAAgB,CAAC"}
|
package/dist/module/slp/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/slp/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,cAAc,CAAC;AAEpD,cAAc,gBAAgB,CAAC"}
|
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
import BigNumber from "bignumber.js";
|
|
2
|
-
import { UtxoI, TxI } from "../interface.js";
|
|
3
|
-
export declare enum SlpTokenType {
|
|
4
|
-
Type1 = 1,
|
|
5
|
-
NftParent = 129,
|
|
6
|
-
NftChild = 65
|
|
7
|
-
}
|
|
8
|
-
export interface SlpDbResponse {
|
|
9
|
-
t: any[];
|
|
10
|
-
u: any[];
|
|
11
|
-
c: any[];
|
|
12
|
-
g: any[];
|
|
13
|
-
a: any[];
|
|
14
|
-
x: any[];
|
|
15
|
-
s: any[];
|
|
16
|
-
}
|
|
17
|
-
export interface SlpDbTx {
|
|
18
|
-
tx: any;
|
|
19
|
-
in: any[];
|
|
20
|
-
out: any[];
|
|
21
|
-
slp: any;
|
|
22
|
-
blk: any;
|
|
23
|
-
}
|
|
24
|
-
export interface GsppTx {
|
|
25
|
-
inputs: string[];
|
|
26
|
-
outputs: string[];
|
|
27
|
-
tokenId: string;
|
|
28
|
-
groupId: string;
|
|
29
|
-
type: SlpTokenType;
|
|
30
|
-
ticker: string;
|
|
31
|
-
decimals: number;
|
|
32
|
-
txType: string;
|
|
33
|
-
txHash: string;
|
|
34
|
-
}
|
|
35
|
-
export interface SlpTxI extends TxI {
|
|
36
|
-
details: SlpDbTx | GsppTx;
|
|
37
|
-
}
|
|
38
|
-
export interface SlpUtxoI extends UtxoI {
|
|
39
|
-
value: BigNumber;
|
|
40
|
-
decimals: number;
|
|
41
|
-
ticker: string;
|
|
42
|
-
tokenId: string;
|
|
43
|
-
type: SlpTokenType;
|
|
44
|
-
isBaton: boolean;
|
|
45
|
-
}
|
|
46
|
-
export interface SlpFormattedUtxo {
|
|
47
|
-
ticker: string;
|
|
48
|
-
tokenId: string;
|
|
49
|
-
value: string;
|
|
50
|
-
satoshis: number;
|
|
51
|
-
decimals: number;
|
|
52
|
-
txId: string;
|
|
53
|
-
index: number;
|
|
54
|
-
utxoId: string;
|
|
55
|
-
type: SlpTokenType;
|
|
56
|
-
}
|
|
57
|
-
export interface SlpTokenBalance {
|
|
58
|
-
value: BigNumber;
|
|
59
|
-
ticker: string;
|
|
60
|
-
name: string;
|
|
61
|
-
tokenId: string;
|
|
62
|
-
type: SlpTokenType;
|
|
63
|
-
decimals: number;
|
|
64
|
-
}
|
|
65
|
-
export interface SlpSendRequest {
|
|
66
|
-
slpaddr: string;
|
|
67
|
-
value: BigNumber.Value;
|
|
68
|
-
tokenId: string;
|
|
69
|
-
}
|
|
70
|
-
export interface SlpTokenInfo {
|
|
71
|
-
name: string;
|
|
72
|
-
ticker: string;
|
|
73
|
-
tokenId: string;
|
|
74
|
-
parentTokenId: string;
|
|
75
|
-
initialAmount: BigNumber.Value;
|
|
76
|
-
decimals: number;
|
|
77
|
-
documentUrl?: string;
|
|
78
|
-
documentHash?: string;
|
|
79
|
-
type: SlpTokenType;
|
|
80
|
-
}
|
|
81
|
-
export interface SlpGenesisOptions {
|
|
82
|
-
name: string;
|
|
83
|
-
ticker: string;
|
|
84
|
-
initialAmount: BigNumber.Value;
|
|
85
|
-
decimals: number;
|
|
86
|
-
documentUrl?: string;
|
|
87
|
-
documentHash?: string;
|
|
88
|
-
endBaton?: boolean;
|
|
89
|
-
type?: SlpTokenType;
|
|
90
|
-
tokenReceiverSlpAddr?: string;
|
|
91
|
-
batonReceiverSlpAddr?: string;
|
|
92
|
-
parentTokenId?: string;
|
|
93
|
-
}
|
|
94
|
-
export interface SlpMintOptions {
|
|
95
|
-
value: BigNumber.Value;
|
|
96
|
-
tokenId: string;
|
|
97
|
-
endBaton?: boolean;
|
|
98
|
-
tokenReceiverSlpAddr?: string;
|
|
99
|
-
batonReceiverSlpAddr?: string;
|
|
100
|
-
}
|
|
101
|
-
export interface SlpGenesisResult {
|
|
102
|
-
tokenId: string;
|
|
103
|
-
balance: SlpTokenBalance;
|
|
104
|
-
}
|
|
105
|
-
export interface SlpSendResponse {
|
|
106
|
-
txId: string;
|
|
107
|
-
balance: SlpTokenBalance;
|
|
108
|
-
explorerUrl: string;
|
|
109
|
-
}
|
|
110
|
-
export interface SlpMintResult {
|
|
111
|
-
txId: string;
|
|
112
|
-
balance: SlpTokenBalance;
|
|
113
|
-
}
|
|
114
|
-
//# sourceMappingURL=interface.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"interface.d.ts","sourceRoot":"","sources":["../../../src/slp/interface.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export var SlpTokenType;
|
|
2
|
-
(function (SlpTokenType) {
|
|
3
|
-
SlpTokenType[SlpTokenType["Type1"] = 1] = "Type1";
|
|
4
|
-
SlpTokenType[SlpTokenType["NftParent"] = 129] = "NftParent";
|
|
5
|
-
SlpTokenType[SlpTokenType["NftChild"] = 65] = "NftChild";
|
|
6
|
-
})(SlpTokenType || (SlpTokenType = {}));
|
|
7
|
-
//# sourceMappingURL=interface.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"interface.js","sourceRoot":"","sources":["../../../src/slp/interface.ts"],"names":[],"mappings":"AAGA,MAAM,CAAN,IAAY,YAIX;AAJD,WAAY,YAAY;IACtB,iDAAY,CAAA;IACZ,2DAAgB,CAAA;IAChB,wDAAe,CAAA;AACjB,CAAC,EAJW,YAAY,KAAZ,YAAY,QAIvB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"bchaddr.d.ts","sourceRoot":"","sources":["../../../src/util/bchaddr.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EACb,YAAY,EACZ,cAAc,EACd,aAAa,EACb,YAAY,GACb,MAAM,eAAe,CAAC"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
export { toCashAddress, toSlpAddress, isValidAddress, isCashAddress, isSlpAddress, } from "bchaddrjs-slp";
|
|
2
|
-
// import bchaddr from "bchaddrjs-slp";
|
|
3
|
-
// export { isValidAddress, isCashAddress, isSlpAddress } from "bchaddrjs-slp";
|
|
4
|
-
// export function toCashAddress(address: string) {
|
|
5
|
-
// if (["bchreg", "slpreg"].some(val => address.includes(val))) {
|
|
6
|
-
// return bchaddr.toRegtestAddress(bchaddr.toCashAddress(address));
|
|
7
|
-
// }
|
|
8
|
-
// return bchaddr.toCashAddress(address);
|
|
9
|
-
// }
|
|
10
|
-
// export function toSlpAddress(address: string) {
|
|
11
|
-
// if (["bchreg", "slpreg"].some(val => address.includes(val))) {
|
|
12
|
-
// return bchaddr.toSlpRegtestAddress(address);
|
|
13
|
-
// }
|
|
14
|
-
// return bchaddr.toSlpAddress(address);
|
|
15
|
-
// }
|
|
16
|
-
//# sourceMappingURL=bchaddr.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"bchaddr.js","sourceRoot":"","sources":["../../../src/util/bchaddr.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EACb,YAAY,EACZ,cAAc,EACd,aAAa,EACb,YAAY,GACb,MAAM,eAAe,CAAC;AAEvB,uCAAuC;AAEvC,+EAA+E;AAE/E,mDAAmD;AACnD,mEAAmE;AACnE,uEAAuE;AACvE,MAAM;AAEN,2CAA2C;AAC3C,IAAI;AAEJ,kDAAkD;AAClD,mEAAmE;AACnE,mDAAmD;AACnD,MAAM;AAEN,0CAA0C;AAC1C,IAAI"}
|
|
@@ -1,431 +0,0 @@
|
|
|
1
|
-
import { Wallet, RegTestWallet, TestNetWallet, WifWallet, TestNetWifWallet, RegTestWifWallet, WatchWallet, TestNetWatchWallet, RegTestWatchWallet } from "../wallet/Wif.js";
|
|
2
|
-
import { SlpFormattedUtxo, SlpGenesisOptions, SlpGenesisResult, SlpMintOptions, SlpMintResult, SlpSendRequest, SlpSendResponse, SlpTokenBalance, SlpTokenInfo, SlpTxI, SlpUtxoI } from "../slp/interface.js";
|
|
3
|
-
import { ImageI } from "../qr/interface.js";
|
|
4
|
-
import { ElectrumRawTransaction } from "../network/interface.js";
|
|
5
|
-
import BigNumber from "bignumber.js";
|
|
6
|
-
import { SlpCancelWatchFn, SlpProvider, SlpWatchBalanceCallback, SlpWatchTransactionCallback } from "../slp/SlpProvider.js";
|
|
7
|
-
/**
|
|
8
|
-
* Class to manage an slp enabled wallet.
|
|
9
|
-
*/
|
|
10
|
-
export declare class Slp {
|
|
11
|
-
slpaddr: string;
|
|
12
|
-
readonly wallet: Wallet;
|
|
13
|
-
provider: SlpProvider;
|
|
14
|
-
private spentParentUtxos;
|
|
15
|
-
static get walletType(): typeof Wallet;
|
|
16
|
-
static defaultProvider: string;
|
|
17
|
-
/**
|
|
18
|
-
* Initializes an Slp Wallet.
|
|
19
|
-
*
|
|
20
|
-
* @param wallet A non-slp wallet object
|
|
21
|
-
*/
|
|
22
|
-
constructor(wallet: Wallet);
|
|
23
|
-
/**
|
|
24
|
-
* setProvider - sets the provider to fetch slp data from
|
|
25
|
-
*/
|
|
26
|
-
setProvider(provider: SlpProvider): SlpProvider;
|
|
27
|
-
/**
|
|
28
|
-
* getDepositAddress - get the slp deposit address
|
|
29
|
-
*
|
|
30
|
-
* a high-level function,
|
|
31
|
-
*
|
|
32
|
-
* @see {@link https://rest-unstable.mainnet.cash/api-docs/#/wallet%2Fslp/slpDepositAddress|/wallet/slp/deposit_address} for REST endpoint
|
|
33
|
-
*
|
|
34
|
-
* @returns The the slp address as a string
|
|
35
|
-
*/
|
|
36
|
-
getDepositAddress(): string;
|
|
37
|
-
/**
|
|
38
|
-
* getDepositQr - get an slp address qrcode, encoded for display on the web
|
|
39
|
-
*
|
|
40
|
-
* a high-level function
|
|
41
|
-
*
|
|
42
|
-
* @see {@link https://rest-unstable.mainnet.cash/api-docs/#/wallet%2Fslp/slpDepositQr|/wallet/slp/deposit_qr} for REST endpoint
|
|
43
|
-
*
|
|
44
|
-
* @returns The qrcode for the slp address
|
|
45
|
-
*/
|
|
46
|
-
getDepositQr(): ImageI;
|
|
47
|
-
/**
|
|
48
|
-
* getTokenInfo - get data associated with a token
|
|
49
|
-
*
|
|
50
|
-
* a high-level function
|
|
51
|
-
*
|
|
52
|
-
* @see {@link https://rest-unstable.mainnet.cash/api-docs/#/wallet%2Fslp/slpTokenInfo|/wallet/slp/token_info} for REST endpoint
|
|
53
|
-
*
|
|
54
|
-
* @param tokenId The tokenId to request information about
|
|
55
|
-
*
|
|
56
|
-
* @returns Promise to the slp token info or undefined.
|
|
57
|
-
*/
|
|
58
|
-
getTokenInfo(tokenId: string): Promise<SlpTokenInfo | undefined>;
|
|
59
|
-
/**
|
|
60
|
-
* getSlpOutpoints - get a list of SLP unspent outpoints
|
|
61
|
-
*
|
|
62
|
-
* an intermediate function contributing to the output of wallet.getUtxos() and /wallet/utxos for slp enabled wallets
|
|
63
|
-
*
|
|
64
|
-
* @param slpaddr The slpaddr to request slp unspent outpoints for
|
|
65
|
-
*
|
|
66
|
-
* @returns Promise to a list of slp unspent outpoints
|
|
67
|
-
*/
|
|
68
|
-
getSlpOutpoints(): Promise<String[]>;
|
|
69
|
-
/**
|
|
70
|
-
* getSlpUtxos - get a list of SLP unspent outputs
|
|
71
|
-
*
|
|
72
|
-
* @returns Promise to a list of slp unspent outputs
|
|
73
|
-
*/
|
|
74
|
-
getSlpUtxos(): Promise<SlpUtxoI[]>;
|
|
75
|
-
/**
|
|
76
|
-
* getFormattedSlpUtxos - get a list of unspent outputs
|
|
77
|
-
*
|
|
78
|
-
* an intermediate function
|
|
79
|
-
*
|
|
80
|
-
* @returns Promise to a list of slp formatted unspent outputs
|
|
81
|
-
*/
|
|
82
|
-
getFormattedSlpUtxos(): Promise<SlpFormattedUtxo[]>;
|
|
83
|
-
/**
|
|
84
|
-
* getBatonUtxos - get a list of baton unspent outputs
|
|
85
|
-
*
|
|
86
|
-
* an intermediate function
|
|
87
|
-
*
|
|
88
|
-
* @param tokenId The id of the slp token
|
|
89
|
-
*
|
|
90
|
-
* @returns Promise to a list of slp unspent outputs
|
|
91
|
-
*/
|
|
92
|
-
getBatonUtxos(tokenId?: string): Promise<SlpUtxoI[]>;
|
|
93
|
-
/**
|
|
94
|
-
* getHistory - get a transaction history for a particular address
|
|
95
|
-
*
|
|
96
|
-
* an intermediate function
|
|
97
|
-
*
|
|
98
|
-
* @param tokenId The id of the slp token
|
|
99
|
-
*
|
|
100
|
-
* @returns Promise to a list of transactions
|
|
101
|
-
*/
|
|
102
|
-
getHistory(tokenId?: string): Promise<SlpTxI[]>;
|
|
103
|
-
/**
|
|
104
|
-
* getLastTransaction - get a last SLP token transaction of a particular address
|
|
105
|
-
*
|
|
106
|
-
* @param {boolean} [confirmedOnly=false] When confirmedOnly is true, results will be limited to only transactions included in a block.
|
|
107
|
-
*
|
|
108
|
-
* @returns Promise to the transaction hex or error
|
|
109
|
-
*/
|
|
110
|
-
getLastTransaction(confirmedOnly?: boolean): Promise<ElectrumRawTransaction>;
|
|
111
|
-
/**
|
|
112
|
-
* getBalance - get a token balance for a particular address
|
|
113
|
-
*
|
|
114
|
-
* a high-level function, see also /wallet/slp/balance REST endpoint
|
|
115
|
-
*
|
|
116
|
-
* @param tokenId The id of the slp token
|
|
117
|
-
*
|
|
118
|
-
* @returns Promise to an SlpTokenBalance
|
|
119
|
-
*/
|
|
120
|
-
getBalance(tokenId: string): Promise<SlpTokenBalance>;
|
|
121
|
-
/**
|
|
122
|
-
* getAllBalances - get all token balances for a particular address
|
|
123
|
-
*
|
|
124
|
-
* a high-level function, see also /wallet/slp/all_balances REST endpoint
|
|
125
|
-
*
|
|
126
|
-
* @returns Promise to an array of SlpTokenBalance
|
|
127
|
-
*/
|
|
128
|
-
getAllBalances(): Promise<SlpTokenBalance[]>;
|
|
129
|
-
/**
|
|
130
|
-
* watchBalance - set up a callback to be called upon wallet's slp balance change
|
|
131
|
-
*
|
|
132
|
-
* can be cancelled by calling the function returned from this one
|
|
133
|
-
*
|
|
134
|
-
* @param callback The callback function to be called each time the balance changes
|
|
135
|
-
* @param tokenId Specific token id to watch
|
|
136
|
-
*
|
|
137
|
-
* @returns A function to cancel the watching
|
|
138
|
-
*/
|
|
139
|
-
watchBalance(callback: SlpWatchBalanceCallback, tokenId: string): SlpCancelWatchFn;
|
|
140
|
-
/**
|
|
141
|
-
* waitForBalance - wait for address balance to be greater than or equal to the target value
|
|
142
|
-
*
|
|
143
|
-
* This call halts the program execution
|
|
144
|
-
*
|
|
145
|
-
* @param value Target balance value
|
|
146
|
-
* @param tokenId Specific token id to watch
|
|
147
|
-
*
|
|
148
|
-
* @returns Actual token balance after reaching or surpassing the target value
|
|
149
|
-
*/
|
|
150
|
-
waitForBalance(value: BigNumber.Value, tokenId: string): Promise<SlpTokenBalance>;
|
|
151
|
-
/**
|
|
152
|
-
* watchBalance - set up a callback to be called upon wallet's slp transactions occurring
|
|
153
|
-
*
|
|
154
|
-
* can be cancelled by calling the function returned from this one
|
|
155
|
-
*
|
|
156
|
-
* @param callback The callback function to be called each time the balance changes
|
|
157
|
-
* @param tokenId Specific token id to watch, optional
|
|
158
|
-
*
|
|
159
|
-
* @returns A function to cancel the watching
|
|
160
|
-
*/
|
|
161
|
-
watchTransactions(callback: SlpWatchTransactionCallback, tokenId?: string): SlpCancelWatchFn;
|
|
162
|
-
/**
|
|
163
|
-
* waitForBalance - wait for the next SLP transaction to occur
|
|
164
|
-
*
|
|
165
|
-
* This call halts the program execution
|
|
166
|
-
*
|
|
167
|
-
* @param tokenId Specific token id to watch, optional
|
|
168
|
-
*
|
|
169
|
-
* @returns Transaction object
|
|
170
|
-
*/
|
|
171
|
-
waitForTransaction(tokenId?: string): Promise<SlpTxI>;
|
|
172
|
-
/**
|
|
173
|
-
* genesis - create a new Type1 SLP token
|
|
174
|
-
*
|
|
175
|
-
* @param options Token creation options @see SlpGenesisOptions
|
|
176
|
-
*
|
|
177
|
-
* @returns Token Id and new token balance
|
|
178
|
-
*/
|
|
179
|
-
genesis(options: SlpGenesisOptions): Promise<SlpGenesisResult>;
|
|
180
|
-
/**
|
|
181
|
-
* nftParentGenesis - create a new NFT Parent token
|
|
182
|
-
*
|
|
183
|
-
* @param options Token creation options @see SlpGenesisOptions
|
|
184
|
-
*
|
|
185
|
-
* @returns Token Id and new token balance
|
|
186
|
-
*/
|
|
187
|
-
nftParentGenesis(options: SlpGenesisOptions): Promise<SlpGenesisResult>;
|
|
188
|
-
/**
|
|
189
|
-
* nftParentGenesis - create a new NFT Child token
|
|
190
|
-
*
|
|
191
|
-
* @param parentTokenId Parent token id, at least one is required and will be spent in the child genesis process
|
|
192
|
-
* @param options Token creation options @see SlpGenesisOptions
|
|
193
|
-
*
|
|
194
|
-
* @returns Token Id and new token balance
|
|
195
|
-
*/
|
|
196
|
-
nftChildGenesis(options: SlpGenesisOptions): Promise<SlpGenesisResult>;
|
|
197
|
-
/**
|
|
198
|
-
* _processGenesis - prepare the genesis transaction with given parameters
|
|
199
|
-
*
|
|
200
|
-
* a private utility wrapper to pre-process transactions
|
|
201
|
-
*
|
|
202
|
-
* @param options genesis options to controll the process
|
|
203
|
-
*
|
|
204
|
-
* @returns the created tokenId (which is genesis transaction id) and token balance
|
|
205
|
-
*/
|
|
206
|
-
private _processGenesis;
|
|
207
|
-
/**
|
|
208
|
-
* sendMax - send the maximum spendable amount for a token to an slpaddr.
|
|
209
|
-
*
|
|
210
|
-
* a high-level function, see also /wallet/slp/send_max REST endpoint
|
|
211
|
-
*
|
|
212
|
-
* @param slpaddr destination SLP address
|
|
213
|
-
* @param tokenId the id of the token to be spent
|
|
214
|
-
*
|
|
215
|
-
* @returns transaction id and token balance
|
|
216
|
-
*/
|
|
217
|
-
sendMax(slpaddr: string, tokenId: string): Promise<SlpSendResponse>;
|
|
218
|
-
/**
|
|
219
|
-
* explorerUrl Web url to a transaction on a block explorer
|
|
220
|
-
*
|
|
221
|
-
* @param txId transaction Id
|
|
222
|
-
* @returns Url string
|
|
223
|
-
*/
|
|
224
|
-
explorerUrl(txId: string): string;
|
|
225
|
-
/**
|
|
226
|
-
* send - attempt to process a list of slp send requests.
|
|
227
|
-
*
|
|
228
|
-
* a high-level function, see also /wallet/slp/send REST endpoint
|
|
229
|
-
*
|
|
230
|
-
* @param [requests] list of send requests
|
|
231
|
-
*
|
|
232
|
-
* @returns transaction id and token balance
|
|
233
|
-
*/
|
|
234
|
-
send(requests: SlpSendRequest[]): Promise<SlpSendResponse>;
|
|
235
|
-
/**
|
|
236
|
-
* _processSendRequests - given a list of sendRequests, estimate fees, build the transaction and submit it.
|
|
237
|
-
*
|
|
238
|
-
* A private utility wrapper to pre-process transactions
|
|
239
|
-
*
|
|
240
|
-
* Unstable - behavior may change without notice.
|
|
241
|
-
*
|
|
242
|
-
* @param {SlpSendRequest[]} sendRequests
|
|
243
|
-
*/
|
|
244
|
-
private _processSendRequests;
|
|
245
|
-
/**
|
|
246
|
-
* mint - create new tokens to increase the circulation supply.
|
|
247
|
-
*
|
|
248
|
-
* a high-level function, see also /wallet/slp/mint endpoint
|
|
249
|
-
*
|
|
250
|
-
* @param value amount to mint
|
|
251
|
-
* @param tokenId the tokenId of the slp being minted
|
|
252
|
-
* @param endBaton boolean indicating whether the token should continue to be "mintable"
|
|
253
|
-
*
|
|
254
|
-
* @returns transaction id and token balance
|
|
255
|
-
*/
|
|
256
|
-
mint(options: SlpMintOptions): Promise<SlpMintResult>;
|
|
257
|
-
/**
|
|
258
|
-
* _processMint - given mint parameters, prepare the transaction
|
|
259
|
-
*
|
|
260
|
-
* a private utility wrapper to pre-process transactions
|
|
261
|
-
*
|
|
262
|
-
* @param value amount to mint
|
|
263
|
-
* @param tokenId the tokenId of the slp being minted
|
|
264
|
-
* @param endBaton boolean indicating whether the token should continue to be "mintable"
|
|
265
|
-
*
|
|
266
|
-
* @returns the tokenId and minting transaction id
|
|
267
|
-
*/
|
|
268
|
-
private _processMint;
|
|
269
|
-
/**
|
|
270
|
-
* processSlpTransaction - process the prepared SLP transaction and submit it to the network
|
|
271
|
-
*
|
|
272
|
-
* @param fundingBchUtxos ensure these BCH utxos to be spent in the process
|
|
273
|
-
* @param slpOutputsResult prepared SLP outputs to be added to transaction
|
|
274
|
-
*
|
|
275
|
-
* @returns the tokenId and minting transaction id
|
|
276
|
-
*/
|
|
277
|
-
private processSlpTransaction;
|
|
278
|
-
/**
|
|
279
|
-
* _submitTransaction - transform binary transaction to hex and submit it to the network provider
|
|
280
|
-
*
|
|
281
|
-
* a private utility wrapper submit raw transactions
|
|
282
|
-
*
|
|
283
|
-
* @param transaction raw transaction
|
|
284
|
-
*
|
|
285
|
-
* @returns the transaction id of the broadcasted transaction
|
|
286
|
-
*/
|
|
287
|
-
private _submitTransaction;
|
|
288
|
-
/**
|
|
289
|
-
* substituteOptionals - substitute optional fields with default values
|
|
290
|
-
*
|
|
291
|
-
* will ensure that baton and token receiver are intialized as SLP address of this wallet if absent
|
|
292
|
-
* will ensure that baton will not be ended if endBaton is undefined
|
|
293
|
-
* a private utility wrapper substitute optionals
|
|
294
|
-
*
|
|
295
|
-
* @param options genesis or mint options to substitute values int
|
|
296
|
-
*
|
|
297
|
-
* @returns options with relevant values substituted/initialized
|
|
298
|
-
*/
|
|
299
|
-
private substituteOptionals;
|
|
300
|
-
/**
|
|
301
|
-
* fromId - create an SLP aware wallet from encoded walletId string
|
|
302
|
-
*
|
|
303
|
-
* @param walletId walletId options to steer the creation process
|
|
304
|
-
*
|
|
305
|
-
* @returns wallet instantiated accordingly to the walletId rules
|
|
306
|
-
*/
|
|
307
|
-
static fromId(walletId: string): Promise<Wallet>;
|
|
308
|
-
/**
|
|
309
|
-
* named - create an SLP aware named wallet
|
|
310
|
-
*
|
|
311
|
-
* @param name user friendly wallet alias
|
|
312
|
-
* @param dbName name under which the wallet will be stored in the database
|
|
313
|
-
* @param force force recreate wallet in the database if a record already exist
|
|
314
|
-
*
|
|
315
|
-
* @returns instantiated wallet
|
|
316
|
-
*/
|
|
317
|
-
static named(name: string, dbName?: string, force?: boolean): Promise<Wallet>;
|
|
318
|
-
/**
|
|
319
|
-
* fromSeed - create an SLP aware wallet using the seed phrase and derivation path
|
|
320
|
-
*
|
|
321
|
-
* unless specified the derivation path m/44'/245'/0'/0/0 will be userd
|
|
322
|
-
* this derivation path is standard for Electron Cash SLP and other SLP enabled wallets
|
|
323
|
-
*
|
|
324
|
-
* @param seed BIP39 12 word seed phrase
|
|
325
|
-
* @param derivationPath BIP44 HD wallet derivation path to get a single the private key from hierarchy
|
|
326
|
-
*
|
|
327
|
-
* @returns instantiated wallet
|
|
328
|
-
*/
|
|
329
|
-
static fromSeed(seed: string, derivationPath?: string): Promise<Wallet>;
|
|
330
|
-
/**
|
|
331
|
-
* newRandom - create an SLP aware random wallet
|
|
332
|
-
*
|
|
333
|
-
* if `name` parameter is specified, the wallet will also be persisted to DB
|
|
334
|
-
*
|
|
335
|
-
* @param name user friendly wallet alias
|
|
336
|
-
* @param dbName name under which the wallet will be stored in the database
|
|
337
|
-
*
|
|
338
|
-
* @returns instantiated wallet
|
|
339
|
-
*/
|
|
340
|
-
static newRandom(name?: string, dbName?: string): Promise<Wallet>;
|
|
341
|
-
/**
|
|
342
|
-
* fromWIF - create an SLP aware wallet using the private key supplied in `Wallet Import Format`
|
|
343
|
-
*
|
|
344
|
-
* @param wif WIF encoded private key string
|
|
345
|
-
*
|
|
346
|
-
* @returns instantiated wallet
|
|
347
|
-
*/
|
|
348
|
-
static fromWIF(wif: string): Promise<Wallet>;
|
|
349
|
-
/**
|
|
350
|
-
* watchOnly - create an SLP aware watch-only wallet
|
|
351
|
-
*
|
|
352
|
-
* such kind of wallet does not have a private key and is unable to spend any funds
|
|
353
|
-
* however it still allows to use many utility functions such as getting and watching balance, etc.
|
|
354
|
-
*
|
|
355
|
-
* @param address cashaddress or slpaddress of a wallet
|
|
356
|
-
*
|
|
357
|
-
* @returns instantiated wallet
|
|
358
|
-
*/
|
|
359
|
-
static watchOnly(address: string): Promise<Wallet>;
|
|
360
|
-
/**
|
|
361
|
-
* fromCashaddr - create an SLP aware watch-only wallet in the network derived from the address
|
|
362
|
-
*
|
|
363
|
-
* such kind of wallet does not have a private key and is unable to spend any funds
|
|
364
|
-
* however it still allows to use many utility functions such as getting and watching balance, etc.
|
|
365
|
-
*
|
|
366
|
-
* @param address cashaddress of a wallet
|
|
367
|
-
*
|
|
368
|
-
* @returns instantiated wallet
|
|
369
|
-
*/
|
|
370
|
-
static fromCashaddr(address: string): Promise<Wallet>;
|
|
371
|
-
/**
|
|
372
|
-
* fromSlpaddr - create an SLP aware watch-only wallet in the network derived from the address
|
|
373
|
-
*
|
|
374
|
-
* such kind of wallet does not have a private key and is unable to spend any funds
|
|
375
|
-
* however it still allows to use many utility functions such as getting and watching balance, etc.
|
|
376
|
-
*
|
|
377
|
-
* @param address slpaddress of a wallet
|
|
378
|
-
*
|
|
379
|
-
* @returns instantiated wallet
|
|
380
|
-
*/
|
|
381
|
-
static fromSlpaddr(address: string): Promise<Wallet>;
|
|
382
|
-
}
|
|
383
|
-
/**
|
|
384
|
-
* Class to manage an slp enabled testnet wallet.
|
|
385
|
-
*/
|
|
386
|
-
export declare class TestNetSlp extends Slp {
|
|
387
|
-
static get walletType(): typeof TestNetWallet;
|
|
388
|
-
}
|
|
389
|
-
/**
|
|
390
|
-
* Class to manage an slp enabled regtest wallet.
|
|
391
|
-
*/
|
|
392
|
-
export declare class RegTestSlp extends Slp {
|
|
393
|
-
static get walletType(): typeof RegTestWallet;
|
|
394
|
-
}
|
|
395
|
-
/**
|
|
396
|
-
* Class to manage a bitcoin cash wif wallet.
|
|
397
|
-
*/
|
|
398
|
-
export declare class WifSlp extends Slp {
|
|
399
|
-
static get walletType(): typeof WifWallet;
|
|
400
|
-
}
|
|
401
|
-
/**
|
|
402
|
-
* Class to manage a testnet wif wallet.
|
|
403
|
-
*/
|
|
404
|
-
export declare class TestNetWifSlp extends Slp {
|
|
405
|
-
static get walletType(): typeof TestNetWifWallet;
|
|
406
|
-
}
|
|
407
|
-
/**
|
|
408
|
-
* Class to manage a regtest wif wallet.
|
|
409
|
-
*/
|
|
410
|
-
export declare class RegTestWifSlp extends Slp {
|
|
411
|
-
static get walletType(): typeof RegTestWifWallet;
|
|
412
|
-
}
|
|
413
|
-
/**
|
|
414
|
-
* Class to manage a bitcoin cash watch wallet.
|
|
415
|
-
*/
|
|
416
|
-
export declare class WatchSlp extends Slp {
|
|
417
|
-
static get walletType(): typeof WatchWallet;
|
|
418
|
-
}
|
|
419
|
-
/**
|
|
420
|
-
* Class to manage a testnet watch wallet.
|
|
421
|
-
*/
|
|
422
|
-
export declare class TestNetWatchSlp extends Slp {
|
|
423
|
-
static get walletType(): typeof TestNetWatchWallet;
|
|
424
|
-
}
|
|
425
|
-
/**
|
|
426
|
-
* Class to manage a regtest watch wallet.
|
|
427
|
-
*/
|
|
428
|
-
export declare class RegTestWatchSlp extends Slp {
|
|
429
|
-
static get walletType(): typeof RegTestWatchWallet;
|
|
430
|
-
}
|
|
431
|
-
//# sourceMappingURL=Slp.d.ts.map
|