lightning 5.4.2 → 5.5.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/CHANGELOG.md +4 -0
- package/README.md +4 -2
- package/lnd_methods/onchain/index.d.ts +1 -0
- package/lnd_methods/onchain/partially_sign_psbt.d.ts +28 -0
- package/lnd_methods/unauthenticated/create_wallet.d.ts +9 -1
- package/package.json +1 -1
- package/test/typescript/create_wallet.test-d.ts +11 -5
- package/test/typescript/partially_sign_psbt.test-d.ts +18 -0
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -206,8 +206,10 @@ To access unauthenticated methods like the wallet unlocker, use
|
|
|
206
206
|
chosen to be spent.
|
|
207
207
|
- [openChannel](https://github.com/alexbosworth/ln-service#openchannel): Create a new channel
|
|
208
208
|
to another node.
|
|
209
|
-
- [openChannels](https://github.com/alexbosworth/ln-service#openchannels): Open
|
|
210
|
-
|
|
209
|
+
- [openChannels](https://github.com/alexbosworth/ln-service#openchannels): Open
|
|
210
|
+
multiple channels in a single on-chain transaction batch.
|
|
211
|
+
- [partiallySignPsbt](https://github.com/alexbosworth/ln-service#partiallysignpsbt):
|
|
212
|
+
Add a partial signature to a PSBT
|
|
211
213
|
- [pay](https://github.com/alexbosworth/ln-service#pay): Make an off-chain payment.
|
|
212
214
|
- [payViaPaymentDetails](https://github.com/alexbosworth/ln-service#payviapaymentdetails): Pay
|
|
213
215
|
off-chain using details about a destination invoice.
|
|
@@ -14,6 +14,7 @@ export * from './get_utxos';
|
|
|
14
14
|
export * from './lock_utxo';
|
|
15
15
|
export * from './open_channel';
|
|
16
16
|
export * from './open_channels';
|
|
17
|
+
export * from './partially_sign_psbt';
|
|
17
18
|
export * from './prepare_for_channel_proposal';
|
|
18
19
|
export * from './propose_channel';
|
|
19
20
|
export * from './request_chain_fee_increase';
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import {
|
|
2
|
+
AuthenticatedLightningArgs,
|
|
3
|
+
AuthenticatedLightningMethod,
|
|
4
|
+
} from '../../typescript';
|
|
5
|
+
|
|
6
|
+
export type PartiallySignPsbtArgs = AuthenticatedLightningArgs<{
|
|
7
|
+
/** Funded PSBT Hex String */
|
|
8
|
+
psbt: string;
|
|
9
|
+
}>;
|
|
10
|
+
|
|
11
|
+
export type PartiallySignPsbtResult = {
|
|
12
|
+
/** Partially Signed PSBT Hex String */
|
|
13
|
+
psbt: string;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Sign a PSBT to produce a partially signed PSBT
|
|
18
|
+
*
|
|
19
|
+
* Requires `onchain:write` permission
|
|
20
|
+
*
|
|
21
|
+
* Requires LND built with `walletrpc` tag
|
|
22
|
+
*
|
|
23
|
+
* This method is not supported in LND 0.14.1 and below
|
|
24
|
+
*/
|
|
25
|
+
export const partiallySignPsbt: AuthenticatedLightningMethod<
|
|
26
|
+
PartiallySignPsbtArgs,
|
|
27
|
+
PartiallySignPsbtResult
|
|
28
|
+
>;
|
|
@@ -12,9 +12,17 @@ export type CreateWalletArgs = UnauthenticatedLightningArgs<{
|
|
|
12
12
|
seed: string;
|
|
13
13
|
}>;
|
|
14
14
|
|
|
15
|
+
export type CreateWalletResult = {
|
|
16
|
+
/** Base64 Encoded Admin Macaroon String */
|
|
17
|
+
macaroon: string;
|
|
18
|
+
};
|
|
19
|
+
|
|
15
20
|
/**
|
|
16
21
|
* Create a wallet
|
|
17
22
|
*
|
|
18
23
|
* Requires unlocked lnd and unauthenticated LND
|
|
19
24
|
*/
|
|
20
|
-
export const createWallet: UnauthenticatedLightningMethod<
|
|
25
|
+
export const createWallet: UnauthenticatedLightningMethod<
|
|
26
|
+
CreateWalletArgs,
|
|
27
|
+
CreateWalletResult
|
|
28
|
+
>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {expectError, expectType} from 'tsd';
|
|
2
2
|
import {UnauthenticatedLnd} from '../../lnd_grpc';
|
|
3
|
-
import {createWallet} from '../../lnd_methods';
|
|
3
|
+
import {createWallet, CreateWalletResult} from '../../lnd_methods';
|
|
4
4
|
|
|
5
5
|
const lnd = {} as UnauthenticatedLnd;
|
|
6
6
|
|
|
@@ -20,8 +20,14 @@ expectError(createWallet({lnd, seed}));
|
|
|
20
20
|
expectError(createWallet({lnd, passphrase, password}));
|
|
21
21
|
expectError(createWallet({lnd, passphrase, seed}));
|
|
22
22
|
|
|
23
|
-
expectType<
|
|
24
|
-
expectType<
|
|
23
|
+
expectType<CreateWalletResult>(await createWallet({lnd, password, seed}));
|
|
24
|
+
expectType<CreateWalletResult>(
|
|
25
|
+
await createWallet({lnd, passphrase, password, seed})
|
|
26
|
+
);
|
|
25
27
|
|
|
26
|
-
|
|
27
|
-
expectType<
|
|
28
|
+
createWallet({lnd, password, seed}, (err, res) => {
|
|
29
|
+
expectType<CreateWalletResult>(res);
|
|
30
|
+
});
|
|
31
|
+
createWallet({lnd, passphrase, password, seed}, (err, res) => {
|
|
32
|
+
expectType<CreateWalletResult>(res);
|
|
33
|
+
});
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import {expectError, expectType} from 'tsd';
|
|
2
|
+
import {AuthenticatedLnd} from '../../lnd_grpc';
|
|
3
|
+
import {partiallySignPsbt, PartiallySignPsbtResult} from '../../lnd_methods';
|
|
4
|
+
|
|
5
|
+
const lnd = {} as AuthenticatedLnd;
|
|
6
|
+
const psbt = 'psbt';
|
|
7
|
+
|
|
8
|
+
expectError(partiallySignPsbt());
|
|
9
|
+
expectError(partiallySignPsbt({}));
|
|
10
|
+
expectError(partiallySignPsbt({lnd}));
|
|
11
|
+
|
|
12
|
+
expectType<PartiallySignPsbtResult>(await partiallySignPsbt({lnd, psbt}));
|
|
13
|
+
|
|
14
|
+
expectType<void>(
|
|
15
|
+
partiallySignPsbt({lnd, psbt}, (error, result) => {
|
|
16
|
+
expectType<PartiallySignPsbtResult>(result);
|
|
17
|
+
})
|
|
18
|
+
);
|