@fedimint/core-web 0.0.10 → 0.1.0-alex-cache-wasm-build
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/dts/FedimintWallet.d.ts +56 -1
- package/dist/dts/FedimintWallet.d.ts.map +1 -1
- package/dist/dts/services/BalanceService.d.ts +2 -21
- package/dist/dts/services/BalanceService.d.ts.map +1 -1
- package/dist/dts/services/FederationService.d.ts +1 -1
- package/dist/dts/services/FederationService.d.ts.map +1 -1
- package/dist/dts/services/LightningService.d.ts +11 -2
- package/dist/dts/services/LightningService.d.ts.map +1 -1
- package/dist/dts/services/MintService.d.ts +13 -6
- package/dist/dts/services/MintService.d.ts.map +1 -1
- package/dist/dts/services/RecoveryService.d.ts +1 -1
- package/dist/dts/services/RecoveryService.d.ts.map +1 -1
- package/dist/dts/services/WalletService.d.ts +8 -0
- package/dist/dts/services/WalletService.d.ts.map +1 -0
- package/dist/dts/services/index.d.ts +1 -0
- package/dist/dts/services/index.d.ts.map +1 -1
- package/dist/dts/types/utils.d.ts +8 -1
- package/dist/dts/types/utils.d.ts.map +1 -1
- package/dist/dts/types/wallet.d.ts +20 -9
- package/dist/dts/types/wallet.d.ts.map +1 -1
- package/dist/dts/types/worker.d.ts +1 -1
- package/dist/dts/types/worker.d.ts.map +1 -1
- package/dist/dts/worker/WorkerClient.d.ts +1 -1
- package/dist/dts/worker/WorkerClient.d.ts.map +1 -1
- package/dist/index.d.ts +114 -38
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/worker.js +1 -1
- package/dist/worker.js.map +1 -1
- package/package.json +8 -8
- package/src/FedimintWallet.test.ts +13 -0
- package/src/FedimintWallet.ts +69 -0
- package/src/services/BalanceService.ts +5 -26
- package/src/services/FederationService.ts +9 -7
- package/src/services/LightningService.ts +81 -65
- package/src/services/MintService.test.ts +41 -0
- package/src/services/MintService.ts +41 -25
- package/src/services/RecoveryService.ts +9 -7
- package/src/services/WalletService.test.ts +24 -0
- package/src/services/WalletService.ts +10 -0
- package/src/services/index.ts +1 -0
- package/src/test/TestingService.ts +5 -4
- package/src/test/fixtures.ts +6 -0
- package/src/types/utils.ts +5 -1
- package/src/types/wallet.ts +39 -9
- package/src/types/worker.ts +3 -0
- package/src/worker/WorkerClient.ts +8 -9
- package/src/worker/worker.js +62 -0
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { BalanceService, MintService, LightningService, FederationService, RecoveryService } from './services';
|
|
1
|
+
import { BalanceService, MintService, LightningService, FederationService, RecoveryService, WalletService } from './services';
|
|
2
2
|
import { type LogLevel } from './utils/logger';
|
|
3
|
+
import { FederationConfig, JSONValue } from './types';
|
|
3
4
|
export declare class FedimintWallet {
|
|
4
5
|
private _client;
|
|
5
6
|
balance: BalanceService;
|
|
@@ -7,6 +8,7 @@ export declare class FedimintWallet {
|
|
|
7
8
|
lightning: LightningService;
|
|
8
9
|
federation: FederationService;
|
|
9
10
|
recovery: RecoveryService;
|
|
11
|
+
wallet: WalletService;
|
|
10
12
|
private _openPromise;
|
|
11
13
|
private _resolveOpen;
|
|
12
14
|
private _isOpen;
|
|
@@ -50,10 +52,63 @@ export declare class FedimintWallet {
|
|
|
50
52
|
*/
|
|
51
53
|
cleanup(): Promise<void>;
|
|
52
54
|
isOpen(): boolean;
|
|
55
|
+
previewFederation(inviteCode: string): Promise<{
|
|
56
|
+
config: FederationConfig;
|
|
57
|
+
federation_id: string;
|
|
58
|
+
}>;
|
|
53
59
|
/**
|
|
54
60
|
* Sets the log level for the library.
|
|
55
61
|
* @param level The desired log level ('DEBUG', 'INFO', 'WARN', 'ERROR', 'NONE').
|
|
56
62
|
*/
|
|
57
63
|
setLogLevel(level: LogLevel): void;
|
|
64
|
+
/**
|
|
65
|
+
* Parses a federation invite code and retrieves its details.
|
|
66
|
+
*
|
|
67
|
+
* This method sends the provided invite code to the WorkerClient for parsing.
|
|
68
|
+
* The response includes the federation_id and url.
|
|
69
|
+
*
|
|
70
|
+
* @param {string} inviteCode - The invite code to be parsed.
|
|
71
|
+
* @returns {Promise<{ federation_id: string, url: string}>}
|
|
72
|
+
* A promise that resolves to an object containing:
|
|
73
|
+
* - `federation_id`: The id of the feder.
|
|
74
|
+
* - `url`: One of the apipoints to connect to the federation
|
|
75
|
+
*
|
|
76
|
+
* @throws {Error} If the WorkerClient encounters an issue during the parsing process.
|
|
77
|
+
*
|
|
78
|
+
* @example
|
|
79
|
+
* const inviteCode = "example-invite-code";
|
|
80
|
+
* const parsedCode = await wallet.parseInviteCode(inviteCode);
|
|
81
|
+
* console.log(parsedCode.federation_id, parsedCode.url);
|
|
82
|
+
*/
|
|
83
|
+
parseInviteCode(inviteCode: string): Promise<{
|
|
84
|
+
type: string;
|
|
85
|
+
data: JSONValue;
|
|
86
|
+
requestId: number;
|
|
87
|
+
}>;
|
|
88
|
+
/**
|
|
89
|
+
* Parses a BOLT11 Lightning invoice and retrieves its details.
|
|
90
|
+
*
|
|
91
|
+
* This method sends the provided invoice string to the WorkerClient for parsing.
|
|
92
|
+
* The response includes details such as the amount, expiry, and memo.
|
|
93
|
+
*
|
|
94
|
+
* @param {string} invoiceStr - The BOLT11 invoice string to be parsed.
|
|
95
|
+
* @returns {Promise<{ amount: string, expiry: number, memo: string }>}
|
|
96
|
+
* A promise that resolves to an object containing:
|
|
97
|
+
* - `amount`: The amount specified in the invoice.
|
|
98
|
+
* - `expiry`: The expiry time of the invoice in seconds.
|
|
99
|
+
* - `memo`: A description or memo attached to the invoice.
|
|
100
|
+
*
|
|
101
|
+
* @throws {Error} If the WorkerClient encounters an issue during the parsing process.
|
|
102
|
+
*
|
|
103
|
+
* @example
|
|
104
|
+
* const invoiceStr = "lnbc1...";
|
|
105
|
+
* const parsedInvoice = await wallet.parseBolt11Invoice(invoiceStr);
|
|
106
|
+
* console.log(parsedInvoice.amount, parsedInvoice.expiry, parsedInvoice.memo);
|
|
107
|
+
*/
|
|
108
|
+
parseBolt11Invoice(invoiceStr: string): Promise<{
|
|
109
|
+
type: string;
|
|
110
|
+
data: JSONValue;
|
|
111
|
+
requestId: number;
|
|
112
|
+
}>;
|
|
58
113
|
}
|
|
59
114
|
//# sourceMappingURL=FedimintWallet.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FedimintWallet.d.ts","sourceRoot":"","sources":["../../src/FedimintWallet.ts"],"names":[],"mappings":"AACA,OAAO,EACL,cAAc,EACd,WAAW,EACX,gBAAgB,EAChB,iBAAiB,EACjB,eAAe,
|
|
1
|
+
{"version":3,"file":"FedimintWallet.d.ts","sourceRoot":"","sources":["../../src/FedimintWallet.ts"],"names":[],"mappings":"AACA,OAAO,EACL,cAAc,EACd,WAAW,EACX,gBAAgB,EAChB,iBAAiB,EACjB,eAAe,EACf,aAAa,EACd,MAAM,YAAY,CAAA;AACnB,OAAO,EAAU,KAAK,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACtD,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AAIrD,qBAAa,cAAc;IACzB,OAAO,CAAC,OAAO,CAAc;IAEtB,OAAO,EAAE,cAAc,CAAA;IACvB,IAAI,EAAE,WAAW,CAAA;IACjB,SAAS,EAAE,gBAAgB,CAAA;IAC3B,UAAU,EAAE,iBAAiB,CAAA;IAC7B,QAAQ,EAAE,eAAe,CAAA;IACzB,MAAM,EAAE,aAAa,CAAA;IAE5B,OAAO,CAAC,YAAY,CAAuC;IAC3D,OAAO,CAAC,YAAY,CAAuB;IAC3C,OAAO,CAAC,OAAO,CAAiB;IAEhC;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA4BG;gBACS,IAAI,GAAE,OAAe;IAmB3B,UAAU;IAMV,WAAW;IAKX,IAAI,CAAC,UAAU,GAAE,MAA4B;IAc7C,cAAc,CAClB,UAAU,EAAE,MAAM,EAClB,UAAU,GAAE,MAA4B;IAwB1C;;;OAGG;IACG,OAAO;IAMb,MAAM;IAIA,iBAAiB,CAAC,UAAU,EAAE,MAAM;gBAE9B,gBAAgB;uBACT,MAAM;;IAKzB;;;OAGG;IACH,WAAW,CAAC,KAAK,EAAE,QAAQ;IAK3B;;;;;;;;;;;;;;;;;;OAkBG;IACG,eAAe,CAAC,UAAU,EAAE,MAAM;cAE9B,MAAM;cACN,SAAS;mBACJ,MAAM;;IAKrB;;;;;;;;;;;;;;;;;;;OAmBG;IACG,kBAAkB,CAAC,UAAU,EAAE,MAAM;cAEjC,MAAM;cACN,SAAS;mBACJ,MAAM;;CAItB"}
|
|
@@ -7,28 +7,9 @@ import { WorkerClient } from '../worker';
|
|
|
7
7
|
export declare class BalanceService {
|
|
8
8
|
private client;
|
|
9
9
|
constructor(client: WorkerClient);
|
|
10
|
-
/**
|
|
11
|
-
* Get the balance of the current wallet in milli-satoshis (MSats)
|
|
12
|
-
*
|
|
13
|
-
* @example
|
|
14
|
-
* ```ts
|
|
15
|
-
* const balance = await wallet.balance.getBalance()
|
|
16
|
-
* ```
|
|
17
|
-
*/
|
|
10
|
+
/** https://web.fedimint.org/core/FedimintWallet/BalanceService/getBalance */
|
|
18
11
|
getBalance(): Promise<number>;
|
|
19
|
-
/**
|
|
20
|
-
* Subscribe to the balance of the current wallet in milli-satoshis (MSats)
|
|
21
|
-
*
|
|
22
|
-
* @example
|
|
23
|
-
* ```ts
|
|
24
|
-
* const unsubscribe = wallet.balance.subscribeBalance((balance) => {
|
|
25
|
-
* console.log(balance)
|
|
26
|
-
* })
|
|
27
|
-
*
|
|
28
|
-
* // ...Cleanup Later
|
|
29
|
-
* unsubscribe()
|
|
30
|
-
* ```
|
|
31
|
-
*/
|
|
12
|
+
/** https://web.fedimint.org/core/FedimintWallet/BalanceService/subscribeBalance */
|
|
32
13
|
subscribeBalance(onSuccess?: (balanceMsats: number) => void, onError?: (error: string) => void): import("..").CancelFunction;
|
|
33
14
|
}
|
|
34
15
|
//# sourceMappingURL=BalanceService.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BalanceService.d.ts","sourceRoot":"","sources":["../../../src/services/BalanceService.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAExC;;;;GAIG;AACH,qBAAa,cAAc;IACb,OAAO,CAAC,MAAM;gBAAN,MAAM,EAAE,YAAY;IAExC
|
|
1
|
+
{"version":3,"file":"BalanceService.d.ts","sourceRoot":"","sources":["../../../src/services/BalanceService.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAExC;;;;GAIG;AACH,qBAAa,cAAc;IACb,OAAO,CAAC,MAAM;gBAAN,MAAM,EAAE,YAAY;IAExC,6EAA6E;IACvE,UAAU;IAIhB,mFAAmF;IACnF,gBAAgB,CACd,SAAS,GAAE,CAAC,YAAY,EAAE,MAAM,KAAK,IAAe,EACpD,OAAO,GAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAe;CAU9C"}
|
|
@@ -5,7 +5,7 @@ export declare class FederationService {
|
|
|
5
5
|
constructor(client: WorkerClient);
|
|
6
6
|
getConfig(): Promise<JSONValue>;
|
|
7
7
|
getFederationId(): Promise<string>;
|
|
8
|
-
getInviteCode(peer
|
|
8
|
+
getInviteCode(peer?: number): Promise<string | null>;
|
|
9
9
|
listOperations(): Promise<JSONValue[]>;
|
|
10
10
|
}
|
|
11
11
|
//# sourceMappingURL=FederationService.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FederationService.d.ts","sourceRoot":"","sources":["../../../src/services/FederationService.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAExC,qBAAa,iBAAiB;IAChB,OAAO,CAAC,MAAM;gBAAN,MAAM,EAAE,YAAY;IAElC,SAAS
|
|
1
|
+
{"version":3,"file":"FederationService.d.ts","sourceRoot":"","sources":["../../../src/services/FederationService.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAExC,qBAAa,iBAAiB;IAChB,OAAO,CAAC,MAAM;gBAAN,MAAM,EAAE,YAAY;IAElC,SAAS;IAIT,eAAe;IAIf,aAAa,CAAC,IAAI,GAAE,MAAU;IAM9B,cAAc;CAGrB"}
|
|
@@ -1,17 +1,21 @@
|
|
|
1
1
|
import { WorkerClient } from '../worker';
|
|
2
|
-
import type { CreateBolt11Response, GatewayInfo, JSONObject,
|
|
2
|
+
import type { CreateBolt11Response, GatewayInfo, JSONObject, LightningGateway, LnPayState, LnReceiveState, OutgoingLightningPayment } from '../types';
|
|
3
3
|
export declare class LightningService {
|
|
4
4
|
private client;
|
|
5
5
|
constructor(client: WorkerClient);
|
|
6
|
+
/** https://web.fedimint.org/core/FedimintWallet/LightningService/createInvoice#lightning-createinvoice */
|
|
6
7
|
createInvoice(amountMsats: number, description: string, expiryTime?: number, // in seconds
|
|
7
8
|
gatewayInfo?: GatewayInfo, extraMeta?: JSONObject): Promise<CreateBolt11Response>;
|
|
8
9
|
createInvoiceTweaked(amountMsats: number, description: string, tweakKey: string, index: number, expiryTime?: number, // in seconds
|
|
9
10
|
gatewayInfo?: GatewayInfo, extraMeta?: JSONObject): Promise<CreateBolt11Response>;
|
|
10
11
|
scanReceivesForTweaks(tweakKey: string, indices: number[], extraMeta?: JSONObject): Promise<string[]>;
|
|
11
12
|
private _getDefaultGatewayInfo;
|
|
13
|
+
/** https://web.fedimint.org/core/FedimintWallet/LightningService/payInvoice#lightning-payinvoice-invoice-string */
|
|
12
14
|
payInvoice(invoice: string, gatewayInfo?: GatewayInfo, extraMeta?: JSONObject): Promise<OutgoingLightningPayment>;
|
|
15
|
+
/** https://web.fedimint.org/core/FedimintWallet/LightningService/payInvoice#lightning-payinvoicesync-invoice-string */
|
|
13
16
|
payInvoiceSync(invoice: string, timeoutMs?: number, gatewayInfo?: GatewayInfo, extraMeta?: JSONObject): Promise<{
|
|
14
17
|
success: false;
|
|
18
|
+
error?: string;
|
|
15
19
|
} | {
|
|
16
20
|
success: true;
|
|
17
21
|
data: {
|
|
@@ -20,19 +24,24 @@ export declare class LightningService {
|
|
|
20
24
|
};
|
|
21
25
|
}>;
|
|
22
26
|
subscribeLnClaim(operationId: string, onSuccess?: (state: LnReceiveState) => void, onError?: (error: string) => void): import("../types").CancelFunction;
|
|
27
|
+
/** https://web.fedimint.org/core/FedimintWallet/LightningService/payInvoice#lightning-payinvoice-invoice-string */
|
|
23
28
|
subscribeLnPay(operationId: string, onSuccess?: (state: LnPayState) => void, onError?: (error: string) => void): import("../types").CancelFunction;
|
|
29
|
+
/** https://web.fedimint.org/core/FedimintWallet/LightningService/payInvoice#lightning-payinvoice-invoice-string */
|
|
24
30
|
waitForPay(operationId: string): Promise<{
|
|
25
31
|
success: false;
|
|
32
|
+
error?: string;
|
|
26
33
|
} | {
|
|
27
34
|
success: true;
|
|
28
35
|
data: {
|
|
29
36
|
preimage: string;
|
|
30
37
|
};
|
|
31
38
|
}>;
|
|
39
|
+
/** https://web.fedimint.org/core/FedimintWallet/LightningService/createInvoice#lightning-createinvoice */
|
|
32
40
|
subscribeLnReceive(operationId: string, onSuccess?: (state: LnReceiveState) => void, onError?: (error: string) => void): import("../types").CancelFunction;
|
|
41
|
+
/** https://web.fedimint.org/core/FedimintWallet/LightningService/createInvoice#lightning-createinvoice */
|
|
33
42
|
waitForReceive(operationId: string, timeoutMs?: number): Promise<LnReceiveState>;
|
|
34
43
|
getGateway(gatewayId?: string | null, forceInternal?: boolean): Promise<LightningGateway | null>;
|
|
35
44
|
listGateways(): Promise<LightningGateway[]>;
|
|
36
|
-
updateGatewayCache(): Promise<JSONValue>;
|
|
45
|
+
updateGatewayCache(): Promise<import("../types").JSONValue>;
|
|
37
46
|
}
|
|
38
47
|
//# sourceMappingURL=LightningService.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LightningService.d.ts","sourceRoot":"","sources":["../../../src/services/LightningService.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AACxC,OAAO,KAAK,EACV,oBAAoB,EACpB,WAAW,EACX,UAAU,EACV,
|
|
1
|
+
{"version":3,"file":"LightningService.d.ts","sourceRoot":"","sources":["../../../src/services/LightningService.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AACxC,OAAO,KAAK,EACV,oBAAoB,EACpB,WAAW,EACX,UAAU,EACV,gBAAgB,EAChB,UAAU,EACV,cAAc,EACd,wBAAwB,EACzB,MAAM,UAAU,CAAA;AAEjB,qBAAa,gBAAgB;IACf,OAAO,CAAC,MAAM;gBAAN,MAAM,EAAE,YAAY;IAExC,0GAA0G;IACpG,aAAa,CACjB,WAAW,EAAE,MAAM,EACnB,WAAW,EAAE,MAAM,EACnB,UAAU,CAAC,EAAE,MAAM,EAAE,aAAa;IAClC,WAAW,CAAC,EAAE,WAAW,EACzB,SAAS,CAAC,EAAE,UAAU;IAgBlB,oBAAoB,CACxB,WAAW,EAAE,MAAM,EACnB,WAAW,EAAE,MAAM,EACnB,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,MAAM,EACb,UAAU,CAAC,EAAE,MAAM,EAAE,aAAa;IAClC,WAAW,CAAC,EAAE,WAAW,EACzB,SAAS,CAAC,EAAE,UAAU;IAmBlB,qBAAqB,CACzB,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,MAAM,EAAE,EACjB,SAAS,CAAC,EAAE,UAAU;YAaV,sBAAsB;IAMpC,mHAAmH;IAC7G,UAAU,CACd,OAAO,EAAE,MAAM,EACf,WAAW,CAAC,EAAE,WAAW,EACzB,SAAS,CAAC,EAAE,UAAU;IAcxB,uHAAuH;IACjH,cAAc,CAClB,OAAO,EAAE,MAAM,EACf,SAAS,GAAE,MAAc,EACzB,WAAW,CAAC,EAAE,WAAW,EACzB,SAAS,CAAC,EAAE,UAAU;iBAGP,KAAK;gBAAU,MAAM;;iBAErB,IAAI;cACP;YAAE,QAAQ,EAAE,MAAM,CAAC;YAAC,QAAQ,EAAE,MAAM,CAAA;SAAE;;IA+BpD,gBAAgB,CACd,WAAW,EAAE,MAAM,EACnB,SAAS,GAAE,CAAC,KAAK,EAAE,cAAc,KAAK,IAAe,EACrD,OAAO,GAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAe;IAa7C,mHAAmH;IACnH,cAAc,CACZ,WAAW,EAAE,MAAM,EACnB,SAAS,GAAE,CAAC,KAAK,EAAE,UAAU,KAAK,IAAe,EACjD,OAAO,GAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAe;IAW7C,mHAAmH;IAC7G,UAAU,CAAC,WAAW,EAAE,MAAM;iBAEnB,KAAK;gBAAU,MAAM;;iBACrB,IAAI;cAAQ;YAAE,QAAQ,EAAE,MAAM,CAAA;SAAE;;IA4BjD,0GAA0G;IAC1G,kBAAkB,CAChB,WAAW,EAAE,MAAM,EACnB,SAAS,GAAE,CAAC,KAAK,EAAE,cAAc,KAAK,IAAe,EACrD,OAAO,GAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAe;IAW7C,0GAA0G;IACpG,cAAc,CAAC,WAAW,EAAE,MAAM,EAAE,SAAS,GAAE,MAAc;IAyB7D,UAAU,CACd,SAAS,GAAE,MAAM,GAAG,IAAW,EAC/B,aAAa,GAAE,OAAe;IAY1B,YAAY;IAQZ,kBAAkB;CAGzB"}
|
|
@@ -1,16 +1,23 @@
|
|
|
1
1
|
import { WorkerClient } from '../worker';
|
|
2
|
-
import type { Duration, JSONObject, JSONValue,
|
|
2
|
+
import type { Duration, JSONObject, JSONValue, NoteCountByDenomination, ReissueExternalNotesState, SpendNotesState } from '../types';
|
|
3
3
|
export declare class MintService {
|
|
4
4
|
private client;
|
|
5
5
|
constructor(client: WorkerClient);
|
|
6
|
-
redeemEcash
|
|
6
|
+
/** https://web.fedimint.org/core/FedimintWallet/MintService/redeemEcash */
|
|
7
|
+
redeemEcash(notes: string): Promise<string>;
|
|
7
8
|
reissueExternalNotes(oobNotes: string, extraMeta?: JSONObject): Promise<string>;
|
|
8
|
-
subscribeReissueExternalNotes(operationId: string, onSuccess?: (state:
|
|
9
|
+
subscribeReissueExternalNotes(operationId: string, onSuccess?: (state: ReissueExternalNotesState) => void, onError?: (error: string) => void): import("../types").CancelFunction;
|
|
10
|
+
/** https://web.fedimint.org/core/FedimintWallet/MintService/spendNotes */
|
|
9
11
|
spendNotes(amountMsats: number, tryCancelAfter?: number | Duration, // defaults to 1 day
|
|
10
|
-
includeInvite?: boolean, extraMeta?: JSONValue): Promise<
|
|
11
|
-
|
|
12
|
+
includeInvite?: boolean, extraMeta?: JSONValue): Promise<{
|
|
13
|
+
notes: string;
|
|
14
|
+
operation_id: string;
|
|
15
|
+
}>;
|
|
16
|
+
/** https://web.fedimint.org/core/FedimintWallet/MintService/parseEcash */
|
|
17
|
+
parseNotes(oobNotes: string): Promise<number>;
|
|
12
18
|
tryCancelSpendNotes(operationId: string): Promise<void>;
|
|
13
|
-
subscribeSpendNotes(operationId: string, onSuccess?: (state:
|
|
19
|
+
subscribeSpendNotes(operationId: string, onSuccess?: (state: SpendNotesState) => void, onError?: (error: string) => void): import("../types").CancelFunction;
|
|
14
20
|
awaitSpendOobRefund(operationId: string): Promise<JSONValue>;
|
|
21
|
+
getNotesByDenomination(): Promise<NoteCountByDenomination>;
|
|
15
22
|
}
|
|
16
23
|
//# sourceMappingURL=MintService.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MintService.d.ts","sourceRoot":"","sources":["../../../src/services/MintService.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AACxC,OAAO,KAAK,EACV,QAAQ,EACR,UAAU,EACV,SAAS,
|
|
1
|
+
{"version":3,"file":"MintService.d.ts","sourceRoot":"","sources":["../../../src/services/MintService.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AACxC,OAAO,KAAK,EACV,QAAQ,EACR,UAAU,EACV,SAAS,EAGT,uBAAuB,EACvB,yBAAyB,EACzB,eAAe,EAChB,MAAM,UAAU,CAAA;AAEjB,qBAAa,WAAW;IACV,OAAO,CAAC,MAAM;gBAAN,MAAM,EAAE,YAAY;IAExC,2EAA2E;IACrE,WAAW,CAAC,KAAK,EAAE,MAAM;IAWzB,oBAAoB,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,GAAE,UAAe;IAWvE,6BAA6B,CAC3B,WAAW,EAAE,MAAM,EACnB,SAAS,GAAE,CAAC,KAAK,EAAE,yBAAyB,KAAK,IAAe,EAChE,OAAO,GAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAe;IAa7C,0EAA0E;IACpE,UAAU,CACd,WAAW,EAAE,MAAM,EAInB,cAAc,GAAE,MAAM,GAAG,QAAoB,EAAE,oBAAoB;IACnE,aAAa,GAAE,OAAe,EAC9B,SAAS,GAAE,SAAc;;;;IA0B3B,0EAA0E;IACpE,UAAU,CAAC,QAAQ,EAAE,MAAM;IAM3B,mBAAmB,CAAC,WAAW,EAAE,MAAM;IAM7C,mBAAmB,CACjB,WAAW,EAAE,MAAM,EACnB,SAAS,GAAE,CAAC,KAAK,EAAE,eAAe,KAAK,IAAe,EACtD,OAAO,GAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAe;IAWvC,mBAAmB,CAAC,WAAW,EAAE,MAAM;IAMvC,sBAAsB;CAO7B"}
|
|
@@ -8,6 +8,6 @@ export declare class RecoveryService {
|
|
|
8
8
|
subscribeToRecoveryProgress(onSuccess: (progress: {
|
|
9
9
|
module_id: number;
|
|
10
10
|
progress: JSONValue;
|
|
11
|
-
}) => void, onError: (error: string) => void): ()
|
|
11
|
+
}) => void, onError: (error: string) => void): import("../types").CancelFunction;
|
|
12
12
|
}
|
|
13
13
|
//# sourceMappingURL=RecoveryService.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RecoveryService.d.ts","sourceRoot":"","sources":["../../../src/services/RecoveryService.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAExC,qBAAa,eAAe;IACd,OAAO,CAAC,MAAM;gBAAN,MAAM,EAAE,YAAY;IAElC,oBAAoB
|
|
1
|
+
{"version":3,"file":"RecoveryService.d.ts","sourceRoot":"","sources":["../../../src/services/RecoveryService.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAExC,qBAAa,eAAe;IACd,OAAO,CAAC,MAAM;gBAAN,MAAM,EAAE,YAAY;IAElC,oBAAoB;IAQpB,oBAAoB;IAI1B,2BAA2B,CACzB,SAAS,EAAE,CAAC,QAAQ,EAAE;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,SAAS,CAAA;KAAE,KAAK,IAAI,EACzE,OAAO,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI;CAOnC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { WalletSummary } from '../types';
|
|
2
|
+
import { WorkerClient } from '../worker';
|
|
3
|
+
export declare class WalletService {
|
|
4
|
+
private client;
|
|
5
|
+
constructor(client: WorkerClient);
|
|
6
|
+
getWalletSummary(): Promise<WalletSummary>;
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=WalletService.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WalletService.d.ts","sourceRoot":"","sources":["../../../src/services/WalletService.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAExC,qBAAa,aAAa;IACZ,OAAO,CAAC,MAAM;gBAAN,MAAM,EAAE,YAAY;IAElC,gBAAgB,IAAI,OAAO,CAAC,aAAa,CAAC;CAGjD"}
|
|
@@ -3,4 +3,5 @@ export { BalanceService } from './BalanceService';
|
|
|
3
3
|
export { LightningService } from './LightningService';
|
|
4
4
|
export { RecoveryService } from './RecoveryService';
|
|
5
5
|
export { FederationService } from './FederationService';
|
|
6
|
+
export { WalletService } from './WalletService';
|
|
6
7
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/services/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/services/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA"}
|
|
@@ -12,5 +12,12 @@ type JSONValue = string | number | boolean | null | {
|
|
|
12
12
|
[key: string]: JSONValue;
|
|
13
13
|
} | JSONValue[];
|
|
14
14
|
type JSONObject = Record<string, JSONValue>;
|
|
15
|
-
|
|
15
|
+
type Result<T, U = string> = {
|
|
16
|
+
success: true;
|
|
17
|
+
data?: T;
|
|
18
|
+
} | {
|
|
19
|
+
success: false;
|
|
20
|
+
error: U;
|
|
21
|
+
};
|
|
22
|
+
export { Alias, Resolve, Duration, MSats, Sats, JSONValue, JSONObject, Result };
|
|
16
23
|
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/types/utils.ts"],"names":[],"mappings":"AAAA,KAAK,KAAK,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,CAAA;AACtB,KAAK,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,OAAO,CAAA;AAE7B,KAAK,OAAO,GAAG,KAAK,CAAC,MAAM,CAAC,CAAA;AAC5B,KAAK,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,CAAA;AAE1B,KAAK,QAAQ,GAAG;IACd,KAAK,EAAE,KAAK,CAAA;IACZ,IAAI,EAAE,OAAO,CAAA;CACd,CAAA;AAED,KAAK,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,CAAA;AAC1B,KAAK,IAAI,GAAG,KAAK,CAAC,MAAM,CAAC,CAAA;AAEzB,KAAK,SAAS,GACV,MAAM,GACN,MAAM,GACN,OAAO,GACP,IAAI,GACJ;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,GAC5B,SAAS,EAAE,CAAA;AAEf,KAAK,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAA;AAE3C,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,UAAU,EAAE,CAAA"}
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/types/utils.ts"],"names":[],"mappings":"AAAA,KAAK,KAAK,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,CAAA;AACtB,KAAK,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,OAAO,CAAA;AAE7B,KAAK,OAAO,GAAG,KAAK,CAAC,MAAM,CAAC,CAAA;AAC5B,KAAK,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,CAAA;AAE1B,KAAK,QAAQ,GAAG;IACd,KAAK,EAAE,KAAK,CAAA;IACZ,IAAI,EAAE,OAAO,CAAA;CACd,CAAA;AAED,KAAK,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,CAAA;AAC1B,KAAK,IAAI,GAAG,KAAK,CAAC,MAAM,CAAC,CAAA;AAEzB,KAAK,SAAS,GACV,MAAM,GACN,MAAM,GACN,OAAO,GACP,IAAI,GACJ;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,GAC5B,SAAS,EAAE,CAAA;AAEf,KAAK,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAA;AAE3C,KAAK,MAAM,CAAC,CAAC,EAAE,CAAC,GAAG,MAAM,IACrB;IAAE,OAAO,EAAE,IAAI,CAAC;IAAC,IAAI,CAAC,EAAE,CAAC,CAAA;CAAE,GAC3B;IAAE,OAAO,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,CAAC,CAAA;CAAE,CAAA;AAEhC,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,EAAE,CAAA"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { MSats, Duration, JSONValue } from './utils';
|
|
2
|
-
declare const MODULE_KINDS: readonly ["", "ln", "mint"];
|
|
1
|
+
import { MSats, Duration, JSONValue, JSONObject } from './utils';
|
|
2
|
+
declare const MODULE_KINDS: readonly ["", "ln", "mint", "wallet"];
|
|
3
3
|
type ModuleKind = (typeof MODULE_KINDS)[number];
|
|
4
|
+
type FederationConfig = JSONObject;
|
|
4
5
|
type GatewayInfo = {
|
|
5
6
|
gateway_id: string;
|
|
6
7
|
api: string;
|
|
@@ -78,14 +79,24 @@ type StreamEnd = {
|
|
|
78
79
|
};
|
|
79
80
|
type StreamResult<T extends JSONValue> = StreamSuccess<T> | StreamError | StreamEnd;
|
|
80
81
|
type CancelFunction = () => void;
|
|
81
|
-
type ReissueExternalNotesState = 'Created' | 'Issuing' | 'Done'
|
|
82
|
-
|
|
83
|
-
|
|
82
|
+
type ReissueExternalNotesState = 'Created' | 'Issuing' | 'Done';
|
|
83
|
+
type MintSpendNotesResponse = Array<string>;
|
|
84
|
+
type SpendNotesState = 'Created' | 'UserCanceledProcessing' | 'UserCanceledSuccess' | 'UserCanceledFailure' | 'Success' | 'Refunded';
|
|
85
|
+
type TxOutputSummary = {
|
|
86
|
+
outpoint: {
|
|
87
|
+
txid: string;
|
|
88
|
+
vout: number;
|
|
84
89
|
};
|
|
90
|
+
amount: number;
|
|
85
91
|
};
|
|
86
|
-
type
|
|
87
|
-
|
|
88
|
-
|
|
92
|
+
type WalletSummary = {
|
|
93
|
+
spendable_utxos: TxOutputSummary[];
|
|
94
|
+
unsigned_peg_out_txos: TxOutputSummary[];
|
|
95
|
+
unsigned_change_utxos: TxOutputSummary[];
|
|
96
|
+
unconfirmed_peg_out_txos: TxOutputSummary[];
|
|
97
|
+
unconfirmed_change_utxos: TxOutputSummary[];
|
|
89
98
|
};
|
|
90
|
-
|
|
99
|
+
/** Keys are powers of 2 */
|
|
100
|
+
type NoteCountByDenomination = Record<number, number>;
|
|
101
|
+
export { LightningGateway, FederationConfig, RouteHint, FeeToAmount, OutgoingLightningPayment, PayType, LnPayState, LnReceiveState, CreateBolt11Response, GatewayInfo, StreamError, StreamSuccess, StreamResult, ModuleKind, CancelFunction, ReissueExternalNotesState, MintSpendNotesResponse, SpendNotesState, WalletSummary, TxOutputSummary, NoteCountByDenomination, };
|
|
91
102
|
//# sourceMappingURL=wallet.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wallet.d.ts","sourceRoot":"","sources":["../../../src/types/wallet.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;
|
|
1
|
+
{"version":3,"file":"wallet.d.ts","sourceRoot":"","sources":["../../../src/types/wallet.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
declare const WorkerMessageTypes: readonly ["init", "initialized", "rpc", "log", "open", "join", "error", "unsubscribe", "cleanup"];
|
|
1
|
+
declare const WorkerMessageTypes: readonly ["init", "initialized", "rpc", "log", "open", "join", "error", "unsubscribe", "cleanup", "parseInviteCode", "parseBolt11Invoice", "previewFederation"];
|
|
2
2
|
export type WorkerMessageType = (typeof WorkerMessageTypes)[number];
|
|
3
3
|
export {};
|
|
4
4
|
//# sourceMappingURL=worker.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"worker.d.ts","sourceRoot":"","sources":["../../../src/types/worker.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,kBAAkB,
|
|
1
|
+
{"version":3,"file":"worker.d.ts","sourceRoot":"","sources":["../../../src/types/worker.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,kBAAkB,iKAad,CAAA;AAEV,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,kBAAkB,CAAC,CAAC,MAAM,CAAC,CAAA"}
|
|
@@ -36,7 +36,7 @@ export declare class WorkerClient {
|
|
|
36
36
|
*/
|
|
37
37
|
rpcStream<Response extends JSONValue = JSONValue, Body extends JSONValue = JSONValue>(module: ModuleKind, method: string, body: Body, onSuccess: (res: Response) => void, onError: (res: StreamError['error']) => void, onEnd?: () => void): CancelFunction;
|
|
38
38
|
private _rpcStreamInner;
|
|
39
|
-
rpcSingle<Response extends JSONValue = JSONValue>(module: ModuleKind, method: string, body: JSONValue): Promise<Response>;
|
|
39
|
+
rpcSingle<Response extends JSONValue = JSONValue, Error extends string = string>(module: ModuleKind, method: string, body: JSONValue): Promise<Response>;
|
|
40
40
|
cleanup(): Promise<void>;
|
|
41
41
|
_getRequestCounter(): number;
|
|
42
42
|
_getRequestCallbackMap(): Map<number, (value: any) => void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WorkerClient.d.ts","sourceRoot":"","sources":["../../../src/worker/WorkerClient.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EACd,SAAS,EACT,UAAU,EACV,WAAW,EAEX,iBAAiB,EAClB,MAAM,UAAU,CAAA;AAKjB,qBAAa,YAAY;IACvB,OAAO,CAAC,MAAM,CAAQ;IACtB,OAAO,CAAC,cAAc,CAAI;IAC1B,OAAO,CAAC,gBAAgB,CAA0C;IAClE,OAAO,CAAC,WAAW,CAA0C;;IAc7D,UAAU;IAMV,OAAO,CAAC,gBAAgB;IAKxB,OAAO,CAAC,iBAAiB;IAIzB,OAAO,CAAC,mBAAmB;IAuB3B,iBAAiB,CACf,QAAQ,SAAS,SAAS,GAAG,SAAS,EACtC,OAAO,SAAS,SAAS,GAAG,SAAS,EACrC,IAAI,EAAE,iBAAiB,EAAE,OAAO,CAAC,EAAE,OAAO
|
|
1
|
+
{"version":3,"file":"WorkerClient.d.ts","sourceRoot":"","sources":["../../../src/worker/WorkerClient.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EACd,SAAS,EACT,UAAU,EACV,WAAW,EAEX,iBAAiB,EAClB,MAAM,UAAU,CAAA;AAKjB,qBAAa,YAAY;IACvB,OAAO,CAAC,MAAM,CAAQ;IACtB,OAAO,CAAC,cAAc,CAAI;IAC1B,OAAO,CAAC,gBAAgB,CAA0C;IAClE,OAAO,CAAC,WAAW,CAA0C;;IAc7D,UAAU;IAMV,OAAO,CAAC,gBAAgB;IAKxB,OAAO,CAAC,iBAAiB;IAIzB,OAAO,CAAC,mBAAmB;IAuB3B,iBAAiB,CACf,QAAQ,SAAS,SAAS,GAAG,SAAS,EACtC,OAAO,SAAS,SAAS,GAAG,SAAS,EACrC,IAAI,EAAE,iBAAiB,EAAE,OAAO,CAAC,EAAE,OAAO;IA2B5C;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACH,SAAS,CACP,QAAQ,SAAS,SAAS,GAAG,SAAS,EACtC,IAAI,SAAS,SAAS,GAAG,SAAS,EAElC,MAAM,EAAE,UAAU,EAClB,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,IAAI,EACV,SAAS,EAAE,CAAC,GAAG,EAAE,QAAQ,KAAK,IAAI,EAClC,OAAO,EAAE,CAAC,GAAG,EAAE,WAAW,CAAC,OAAO,CAAC,KAAK,IAAI,EAC5C,KAAK,GAAE,MAAM,IAAe,GAC3B,cAAc;YAoCH,eAAe;IA2C7B,SAAS,CACP,QAAQ,SAAS,SAAS,GAAG,SAAS,EACtC,KAAK,SAAS,MAAM,GAAG,MAAM,EAC7B,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS;IAO/C,OAAO;IAQb,kBAAkB;IAGlB,sBAAsB,wBAzN6B,GAAG,KAAK,IAAI;CA4NhE"}
|