@bitgo/public-types 4.25.0 → 4.26.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/src/schema/lightning/payment.d.ts +14 -0
- package/dist/src/schema/lightning/payment.js +13 -1
- package/dist/src/schema/lightning/payment.js.map +1 -1
- package/dist/src/schema/transactionRequest/intents/intent.d.ts +52 -2
- package/dist/src/schema/transactionRequest/intents/lightningPaymentIntent.d.ts +52 -2
- package/dist/src/schema/transactionRequest/intents/lightningPaymentIntent.js +15 -6
- package/dist/src/schema/transactionRequest/intents/lightningPaymentIntent.js.map +1 -1
- package/package.json +1 -1
- package/src/schema/lightning/payment.ts +18 -0
- package/src/schema/transactionRequest/intents/lightningPaymentIntent.ts +19 -7
|
@@ -1,4 +1,18 @@
|
|
|
1
1
|
import * as t from "io-ts";
|
|
2
|
+
export declare const LightningOnchainRecipient: t.TypeC<{
|
|
3
|
+
amountSat: import("io-ts-types").BigIntFromStringC;
|
|
4
|
+
address: t.StringC;
|
|
5
|
+
}>;
|
|
6
|
+
export type LightningOnchainRecipient = t.TypeOf<typeof LightningOnchainRecipient>;
|
|
7
|
+
export declare const LightningOnchainRequest: t.IntersectionC<[t.TypeC<{
|
|
8
|
+
recipients: t.ArrayC<t.TypeC<{
|
|
9
|
+
amountSat: import("io-ts-types").BigIntFromStringC;
|
|
10
|
+
address: t.StringC;
|
|
11
|
+
}>>;
|
|
12
|
+
}>, t.PartialC<{
|
|
13
|
+
satsPerVbyte: import("io-ts-types").BigIntFromStringC;
|
|
14
|
+
}>]>;
|
|
15
|
+
export type LightningOnchainRequest = t.TypeOf<typeof LightningOnchainRequest>;
|
|
2
16
|
export declare const LightningPaymentRequest: t.IntersectionC<[t.TypeC<{
|
|
3
17
|
invoice: t.StringC;
|
|
4
18
|
}>, t.PartialC<{
|
|
@@ -23,9 +23,21 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.LightningPaymentRequestWithSig = exports.LightningPaymentRequest = void 0;
|
|
26
|
+
exports.LightningPaymentRequestWithSig = exports.LightningPaymentRequest = exports.LightningOnchainRequest = exports.LightningOnchainRecipient = void 0;
|
|
27
27
|
const t = __importStar(require("io-ts"));
|
|
28
28
|
const io_ts_types_1 = require("io-ts-types");
|
|
29
|
+
exports.LightningOnchainRecipient = t.type({
|
|
30
|
+
amountSat: io_ts_types_1.BigIntFromString,
|
|
31
|
+
address: t.string,
|
|
32
|
+
});
|
|
33
|
+
exports.LightningOnchainRequest = t.intersection([
|
|
34
|
+
t.type({
|
|
35
|
+
recipients: t.array(exports.LightningOnchainRecipient),
|
|
36
|
+
}),
|
|
37
|
+
t.partial({
|
|
38
|
+
satsPerVbyte: io_ts_types_1.BigIntFromString,
|
|
39
|
+
}),
|
|
40
|
+
]);
|
|
29
41
|
exports.LightningPaymentRequest = t.intersection([
|
|
30
42
|
t.type({
|
|
31
43
|
invoice: t.string,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"payment.js","sourceRoot":"","sources":["../../../../src/schema/lightning/payment.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yCAA2B;AAC3B,6CAA+C;AAElC,QAAA,uBAAuB,GAAG,CAAC,CAAC,YAAY,CAAC;IACpD,CAAC,CAAC,IAAI,CAAC;QACL,OAAO,EAAE,CAAC,CAAC,MAAM;KAClB,CAAC;IACF,CAAC,CAAC,OAAO,CAAC;QACR,UAAU,EAAE,8BAAgB;QAC5B,YAAY,EAAE,8BAAgB;QAC9B,aAAa,EAAE,CAAC,CAAC,MAAM;KACxB,CAAC;CACH,CAAC,CAAC;AAEU,QAAA,8BAA8B,GAAG,CAAC,CAAC,IAAI,CAAC;IACnD,aAAa,EAAE,+BAAuB;IACtC,SAAS,EAAE,CAAC,CAAC,MAAM;CACpB,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"file":"payment.js","sourceRoot":"","sources":["../../../../src/schema/lightning/payment.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yCAA2B;AAC3B,6CAA+C;AAElC,QAAA,yBAAyB,GAAG,CAAC,CAAC,IAAI,CAAC;IAC9C,SAAS,EAAE,8BAAgB;IAC3B,OAAO,EAAE,CAAC,CAAC,MAAM;CAClB,CAAC,CAAC;AAKU,QAAA,uBAAuB,GAAG,CAAC,CAAC,YAAY,CAAC;IACpD,CAAC,CAAC,IAAI,CAAC;QACL,UAAU,EAAE,CAAC,CAAC,KAAK,CAAC,iCAAyB,CAAC;KAC/C,CAAC;IACF,CAAC,CAAC,OAAO,CAAC;QACR,YAAY,EAAE,8BAAgB;KAC/B,CAAC;CACH,CAAC,CAAC;AAGU,QAAA,uBAAuB,GAAG,CAAC,CAAC,YAAY,CAAC;IACpD,CAAC,CAAC,IAAI,CAAC;QACL,OAAO,EAAE,CAAC,CAAC,MAAM;KAClB,CAAC;IACF,CAAC,CAAC,OAAO,CAAC;QACR,UAAU,EAAE,8BAAgB;QAC5B,YAAY,EAAE,8BAAgB;QAC9B,aAAa,EAAE,CAAC,CAAC,MAAM;KACxB,CAAC;CACH,CAAC,CAAC;AAEU,QAAA,8BAA8B,GAAG,CAAC,CAAC,IAAI,CAAC;IACnD,aAAa,EAAE,+BAAuB;IACtC,SAAS,EAAE,CAAC,CAAC,MAAM;CACpB,CAAC,CAAC"}
|
|
@@ -2227,7 +2227,7 @@ export declare const TransactionIntent: t.UnionC<[t.IntersectionC<[t.Intersectio
|
|
|
2227
2227
|
}>]>>;
|
|
2228
2228
|
}>]>, t.PartialC<{
|
|
2229
2229
|
memo: t.UnionC<[t.Type<string, string, unknown>, t.UndefinedC]>;
|
|
2230
|
-
}>]>, t.IntersectionC<[t.IntersectionC<[t.TypeC<{
|
|
2230
|
+
}>]>, t.UnionC<[t.IntersectionC<[t.IntersectionC<[t.TypeC<{
|
|
2231
2231
|
intentType: t.KeyofC<{
|
|
2232
2232
|
payment: t.LiteralC<"payment">;
|
|
2233
2233
|
transferToken: t.LiteralC<"transferToken">;
|
|
@@ -2278,7 +2278,57 @@ export declare const TransactionIntent: t.UnionC<[t.IntersectionC<[t.Intersectio
|
|
|
2278
2278
|
signature: t.StringC;
|
|
2279
2279
|
}>, t.TypeC<{
|
|
2280
2280
|
intentType: t.LiteralC<"payment">;
|
|
2281
|
-
}>]>, t.IntersectionC<[t.IntersectionC<[t.
|
|
2281
|
+
}>]>, t.IntersectionC<[t.IntersectionC<[t.TypeC<{
|
|
2282
|
+
intentType: t.KeyofC<{
|
|
2283
|
+
payment: t.LiteralC<"payment">;
|
|
2284
|
+
transferToken: t.LiteralC<"transferToken">;
|
|
2285
|
+
consolidate: t.LiteralC<"consolidate">;
|
|
2286
|
+
consolidateToken: t.LiteralC<"consolidateToken">;
|
|
2287
|
+
fanout: t.LiteralC<"fanout">;
|
|
2288
|
+
stake: t.LiteralC<"stake">;
|
|
2289
|
+
unstake: t.LiteralC<"unstake">;
|
|
2290
|
+
delegate: t.LiteralC<"delegate">;
|
|
2291
|
+
undelegate: t.LiteralC<"undelegate">;
|
|
2292
|
+
switchValidator: t.LiteralC<"switchValidator">;
|
|
2293
|
+
claim: t.LiteralC<"claim">;
|
|
2294
|
+
stakeClaimRewards: t.LiteralC<"stakeClaimRewards">;
|
|
2295
|
+
pledge: t.LiteralC<"pledge">;
|
|
2296
|
+
voteDelegation: t.LiteralC<"voteDelegation">;
|
|
2297
|
+
vote: t.LiteralC<"vote">;
|
|
2298
|
+
createAccount: t.LiteralC<"createAccount">;
|
|
2299
|
+
updateAccount: t.LiteralC<"updateAccount">;
|
|
2300
|
+
addTrustLine: t.LiteralC<"addTrustLine">;
|
|
2301
|
+
removeTrustLine: t.LiteralC<"removeTrustLine">;
|
|
2302
|
+
signMessage: t.LiteralC<"signMessage">;
|
|
2303
|
+
signTypedStructuredData: t.LiteralC<"signTypedStructuredData">;
|
|
2304
|
+
enableToken: t.LiteralC<"enableToken">;
|
|
2305
|
+
authorize: t.LiteralC<"authorize">;
|
|
2306
|
+
acceleration: t.LiteralC<"acceleration">;
|
|
2307
|
+
fillNonce: t.LiteralC<"fillNonce">;
|
|
2308
|
+
walletRecovery: t.LiteralC<"walletRecovery">;
|
|
2309
|
+
contractCall: t.LiteralC<"contractCall">;
|
|
2310
|
+
deactivate: t.LiteralC<"deactivate">;
|
|
2311
|
+
customTx: t.LiteralC<"customTx">;
|
|
2312
|
+
closeAssociatedTokenAccount: t.LiteralC<"closeAssociatedTokenAccount">;
|
|
2313
|
+
stakeWithCallData: t.LiteralC<"stakeWithCallData">;
|
|
2314
|
+
feeAddressTransfer: t.LiteralC<"feeAddressTransfer">;
|
|
2315
|
+
createBtcDelegation: t.LiteralC<"createBtcDelegation">;
|
|
2316
|
+
}>;
|
|
2317
|
+
}>, t.PartialC<{
|
|
2318
|
+
sequenceId: t.UnionC<[t.Type<string, string, unknown>, t.UndefinedC]>;
|
|
2319
|
+
comment: t.UnionC<[t.Type<string, string, unknown>, t.UndefinedC]>;
|
|
2320
|
+
nonce: t.UnionC<[t.Type<string | number, string | number, unknown>, t.UndefinedC]>;
|
|
2321
|
+
}>]>, t.TypeC<{
|
|
2322
|
+
intentType: t.LiteralC<"payment">;
|
|
2323
|
+
onchainRequest: t.IntersectionC<[t.TypeC<{
|
|
2324
|
+
recipients: t.ArrayC<t.TypeC<{
|
|
2325
|
+
amountSat: import("io-ts-types").BigIntFromStringC;
|
|
2326
|
+
address: t.StringC;
|
|
2327
|
+
}>>;
|
|
2328
|
+
}>, t.PartialC<{
|
|
2329
|
+
satsPerVbyte: import("io-ts-types").BigIntFromStringC;
|
|
2330
|
+
}>]>;
|
|
2331
|
+
}>]>]>, t.IntersectionC<[t.IntersectionC<[t.IntersectionC<[t.TypeC<{
|
|
2282
2332
|
intentType: t.KeyofC<{
|
|
2283
2333
|
payment: t.LiteralC<"payment">;
|
|
2284
2334
|
transferToken: t.LiteralC<"transferToken">;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as t from "io-ts";
|
|
2
|
-
export declare const LightningPaymentIntent: t.IntersectionC<[t.IntersectionC<[t.TypeC<{
|
|
2
|
+
export declare const LightningPaymentIntent: t.UnionC<[t.IntersectionC<[t.IntersectionC<[t.TypeC<{
|
|
3
3
|
intentType: t.KeyofC<{
|
|
4
4
|
payment: t.LiteralC<"payment">;
|
|
5
5
|
transferToken: t.LiteralC<"transferToken">;
|
|
@@ -50,5 +50,55 @@ export declare const LightningPaymentIntent: t.IntersectionC<[t.IntersectionC<[t
|
|
|
50
50
|
signature: t.StringC;
|
|
51
51
|
}>, t.TypeC<{
|
|
52
52
|
intentType: t.LiteralC<"payment">;
|
|
53
|
-
}>]
|
|
53
|
+
}>]>, t.IntersectionC<[t.IntersectionC<[t.TypeC<{
|
|
54
|
+
intentType: t.KeyofC<{
|
|
55
|
+
payment: t.LiteralC<"payment">;
|
|
56
|
+
transferToken: t.LiteralC<"transferToken">;
|
|
57
|
+
consolidate: t.LiteralC<"consolidate">;
|
|
58
|
+
consolidateToken: t.LiteralC<"consolidateToken">;
|
|
59
|
+
fanout: t.LiteralC<"fanout">;
|
|
60
|
+
stake: t.LiteralC<"stake">;
|
|
61
|
+
unstake: t.LiteralC<"unstake">;
|
|
62
|
+
delegate: t.LiteralC<"delegate">;
|
|
63
|
+
undelegate: t.LiteralC<"undelegate">;
|
|
64
|
+
switchValidator: t.LiteralC<"switchValidator">;
|
|
65
|
+
claim: t.LiteralC<"claim">;
|
|
66
|
+
stakeClaimRewards: t.LiteralC<"stakeClaimRewards">;
|
|
67
|
+
pledge: t.LiteralC<"pledge">;
|
|
68
|
+
voteDelegation: t.LiteralC<"voteDelegation">;
|
|
69
|
+
vote: t.LiteralC<"vote">;
|
|
70
|
+
createAccount: t.LiteralC<"createAccount">;
|
|
71
|
+
updateAccount: t.LiteralC<"updateAccount">;
|
|
72
|
+
addTrustLine: t.LiteralC<"addTrustLine">;
|
|
73
|
+
removeTrustLine: t.LiteralC<"removeTrustLine">;
|
|
74
|
+
signMessage: t.LiteralC<"signMessage">;
|
|
75
|
+
signTypedStructuredData: t.LiteralC<"signTypedStructuredData">;
|
|
76
|
+
enableToken: t.LiteralC<"enableToken">;
|
|
77
|
+
authorize: t.LiteralC<"authorize">;
|
|
78
|
+
acceleration: t.LiteralC<"acceleration">;
|
|
79
|
+
fillNonce: t.LiteralC<"fillNonce">;
|
|
80
|
+
walletRecovery: t.LiteralC<"walletRecovery">;
|
|
81
|
+
contractCall: t.LiteralC<"contractCall">;
|
|
82
|
+
deactivate: t.LiteralC<"deactivate">;
|
|
83
|
+
customTx: t.LiteralC<"customTx">;
|
|
84
|
+
closeAssociatedTokenAccount: t.LiteralC<"closeAssociatedTokenAccount">;
|
|
85
|
+
stakeWithCallData: t.LiteralC<"stakeWithCallData">;
|
|
86
|
+
feeAddressTransfer: t.LiteralC<"feeAddressTransfer">;
|
|
87
|
+
createBtcDelegation: t.LiteralC<"createBtcDelegation">;
|
|
88
|
+
}>;
|
|
89
|
+
}>, t.PartialC<{
|
|
90
|
+
sequenceId: t.UnionC<[t.Type<string, string, unknown>, t.UndefinedC]>;
|
|
91
|
+
comment: t.UnionC<[t.Type<string, string, unknown>, t.UndefinedC]>;
|
|
92
|
+
nonce: t.UnionC<[t.Type<string | number, string | number, unknown>, t.UndefinedC]>;
|
|
93
|
+
}>]>, t.TypeC<{
|
|
94
|
+
intentType: t.LiteralC<"payment">;
|
|
95
|
+
onchainRequest: t.IntersectionC<[t.TypeC<{
|
|
96
|
+
recipients: t.ArrayC<t.TypeC<{
|
|
97
|
+
amountSat: import("io-ts-types").BigIntFromStringC;
|
|
98
|
+
address: t.StringC;
|
|
99
|
+
}>>;
|
|
100
|
+
}>, t.PartialC<{
|
|
101
|
+
satsPerVbyte: import("io-ts-types").BigIntFromStringC;
|
|
102
|
+
}>]>;
|
|
103
|
+
}>]>]>;
|
|
54
104
|
export type LightningPaymentIntent = t.TypeOf<typeof LightningPaymentIntent>;
|
|
@@ -28,11 +28,20 @@ const t = __importStar(require("io-ts"));
|
|
|
28
28
|
const baseIntent_1 = require("./baseIntent");
|
|
29
29
|
const intentType_1 = require("./intentType");
|
|
30
30
|
const payment_1 = require("../../lightning/payment");
|
|
31
|
-
exports.LightningPaymentIntent = t.
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
31
|
+
exports.LightningPaymentIntent = t.union([
|
|
32
|
+
t.intersection([
|
|
33
|
+
baseIntent_1.BaseIntent,
|
|
34
|
+
payment_1.LightningPaymentRequestWithSig,
|
|
35
|
+
t.type({
|
|
36
|
+
intentType: intentType_1.intentTypes.payment,
|
|
37
|
+
}),
|
|
38
|
+
]),
|
|
39
|
+
t.intersection([
|
|
40
|
+
baseIntent_1.BaseIntent,
|
|
41
|
+
t.type({
|
|
42
|
+
intentType: intentType_1.intentTypes.payment,
|
|
43
|
+
onchainRequest: payment_1.LightningOnchainRequest,
|
|
44
|
+
}),
|
|
45
|
+
]),
|
|
37
46
|
]);
|
|
38
47
|
//# sourceMappingURL=lightningPaymentIntent.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lightningPaymentIntent.js","sourceRoot":"","sources":["../../../../../src/schema/transactionRequest/intents/lightningPaymentIntent.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yCAA2B;AAC3B,6CAA0C;AAC1C,6CAA2C;AAC3C,
|
|
1
|
+
{"version":3,"file":"lightningPaymentIntent.js","sourceRoot":"","sources":["../../../../../src/schema/transactionRequest/intents/lightningPaymentIntent.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yCAA2B;AAC3B,6CAA0C;AAC1C,6CAA2C;AAC3C,qDAGiC;AAKpB,QAAA,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC;IAC5C,CAAC,CAAC,YAAY,CAAC;QACb,uBAAU;QACV,wCAA8B;QAC9B,CAAC,CAAC,IAAI,CAAC;YACL,UAAU,EAAE,wBAAW,CAAC,OAAO;SAChC,CAAC;KACH,CAAC;IACF,CAAC,CAAC,YAAY,CAAC;QACb,uBAAU;QACV,CAAC,CAAC,IAAI,CAAC;YACL,UAAU,EAAE,wBAAW,CAAC,OAAO;YAC/B,cAAc,EAAE,iCAAuB;SACxC,CAAC;KACH,CAAC;CACH,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,24 @@
|
|
|
1
1
|
import * as t from "io-ts";
|
|
2
2
|
import { BigIntFromString } from "io-ts-types";
|
|
3
3
|
|
|
4
|
+
export const LightningOnchainRecipient = t.type({
|
|
5
|
+
amountSat: BigIntFromString,
|
|
6
|
+
address: t.string,
|
|
7
|
+
});
|
|
8
|
+
export type LightningOnchainRecipient = t.TypeOf<
|
|
9
|
+
typeof LightningOnchainRecipient
|
|
10
|
+
>;
|
|
11
|
+
|
|
12
|
+
export const LightningOnchainRequest = t.intersection([
|
|
13
|
+
t.type({
|
|
14
|
+
recipients: t.array(LightningOnchainRecipient),
|
|
15
|
+
}),
|
|
16
|
+
t.partial({
|
|
17
|
+
satsPerVbyte: BigIntFromString,
|
|
18
|
+
}),
|
|
19
|
+
]);
|
|
20
|
+
export type LightningOnchainRequest = t.TypeOf<typeof LightningOnchainRequest>;
|
|
21
|
+
|
|
4
22
|
export const LightningPaymentRequest = t.intersection([
|
|
5
23
|
t.type({
|
|
6
24
|
invoice: t.string,
|
|
@@ -1,17 +1,29 @@
|
|
|
1
1
|
import * as t from "io-ts";
|
|
2
2
|
import { BaseIntent } from "./baseIntent";
|
|
3
3
|
import { intentTypes } from "./intentType";
|
|
4
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
LightningOnchainRequest,
|
|
6
|
+
LightningPaymentRequestWithSig,
|
|
7
|
+
} from "../../lightning/payment";
|
|
5
8
|
|
|
6
9
|
/**
|
|
7
10
|
* @title Lightning Payment Intent
|
|
8
11
|
*/
|
|
9
|
-
export const LightningPaymentIntent = t.
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
export const LightningPaymentIntent = t.union([
|
|
13
|
+
t.intersection([
|
|
14
|
+
BaseIntent,
|
|
15
|
+
LightningPaymentRequestWithSig,
|
|
16
|
+
t.type({
|
|
17
|
+
intentType: intentTypes.payment,
|
|
18
|
+
}),
|
|
19
|
+
]),
|
|
20
|
+
t.intersection([
|
|
21
|
+
BaseIntent,
|
|
22
|
+
t.type({
|
|
23
|
+
intentType: intentTypes.payment,
|
|
24
|
+
onchainRequest: LightningOnchainRequest,
|
|
25
|
+
}),
|
|
26
|
+
]),
|
|
15
27
|
]);
|
|
16
28
|
|
|
17
29
|
export type LightningPaymentIntent = t.TypeOf<typeof LightningPaymentIntent>;
|