Skip to content

Commit 03ce38b

Browse files
authored
Merge pull request #35 from kaloudis/update-protos
Protos: update LND, Loop, Pool
2 parents 652ae0b + 58f3ec5 commit 03ce38b

File tree

24 files changed

+260
-16
lines changed

24 files changed

+260
-16
lines changed

lib/types/generated/client_pb.d.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,16 @@ export class SwapStatus extends jspb.Message {
241241
getCostOffchain(): number;
242242
setCostOffchain(value: number): void;
243243

244+
getLastHop(): Uint8Array | string;
245+
getLastHop_asU8(): Uint8Array;
246+
getLastHop_asB64(): string;
247+
setLastHop(value: Uint8Array | string): void;
248+
249+
clearOutgoingChanSetList(): void;
250+
getOutgoingChanSetList(): Array<number>;
251+
setOutgoingChanSetList(value: Array<number>): void;
252+
addOutgoingChanSet(value: number, index?: number): number;
253+
244254
getLabel(): string;
245255
setLabel(value: string): void;
246256

@@ -270,6 +280,8 @@ export namespace SwapStatus {
270280
costServer: number,
271281
costOnchain: number,
272282
costOffchain: number,
283+
lastHop: Uint8Array | string,
284+
outgoingChanSet: Array<number>,
273285
label: string,
274286
}
275287
}

lib/types/generated/client_pb.js

Lines changed: 113 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ if (goog.DEBUG && !COMPILED) {
144144
* @constructor
145145
*/
146146
proto.looprpc.SwapStatus = function(opt_data) {
147-
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
147+
jspb.Message.initialize(this, opt_data, 0, -1, proto.looprpc.SwapStatus.repeatedFields_, null);
148148
};
149149
goog.inherits(proto.looprpc.SwapStatus, jspb.Message);
150150
if (goog.DEBUG && !COMPILED) {
@@ -2024,6 +2024,13 @@ proto.looprpc.MonitorRequest.serializeBinaryToWriter = function(message, writer)
20242024

20252025

20262026

2027+
/**
2028+
* List of repeated fields within this message type.
2029+
* @private {!Array<number>}
2030+
* @const
2031+
*/
2032+
proto.looprpc.SwapStatus.repeatedFields_ = [17];
2033+
20272034

20282035

20292036
if (jspb.Message.GENERATE_TO_OBJECT) {
@@ -2069,6 +2076,8 @@ proto.looprpc.SwapStatus.toObject = function(includeInstance, msg) {
20692076
costServer: jspb.Message.getFieldWithDefault(msg, 8, 0),
20702077
costOnchain: jspb.Message.getFieldWithDefault(msg, 9, 0),
20712078
costOffchain: jspb.Message.getFieldWithDefault(msg, 10, 0),
2079+
lastHop: msg.getLastHop_asB64(),
2080+
outgoingChanSetList: (f = jspb.Message.getRepeatedField(msg, 17)) == null ? undefined : f,
20722081
label: jspb.Message.getFieldWithDefault(msg, 15, "")
20732082
};
20742083

@@ -2162,6 +2171,16 @@ proto.looprpc.SwapStatus.deserializeBinaryFromReader = function(msg, reader) {
21622171
var value = /** @type {number} */ (reader.readInt64());
21632172
msg.setCostOffchain(value);
21642173
break;
2174+
case 16:
2175+
var value = /** @type {!Uint8Array} */ (reader.readBytes());
2176+
msg.setLastHop(value);
2177+
break;
2178+
case 17:
2179+
var values = /** @type {!Array<number>} */ (reader.isDelimited() ? reader.readPackedUint64() : [reader.readUint64()]);
2180+
for (var i = 0; i < values.length; i++) {
2181+
msg.addOutgoingChanSet(values[i]);
2182+
}
2183+
break;
21652184
case 15:
21662185
var value = /** @type {string} */ (reader.readString());
21672186
msg.setLabel(value);
@@ -2293,6 +2312,20 @@ proto.looprpc.SwapStatus.serializeBinaryToWriter = function(message, writer) {
22932312
f
22942313
);
22952314
}
2315+
f = message.getLastHop_asU8();
2316+
if (f.length > 0) {
2317+
writer.writeBytes(
2318+
16,
2319+
f
2320+
);
2321+
}
2322+
f = message.getOutgoingChanSetList();
2323+
if (f.length > 0) {
2324+
writer.writePackedUint64(
2325+
17,
2326+
f
2327+
);
2328+
}
22962329
f = message.getLabel();
22972330
if (f.length > 0) {
22982331
writer.writeString(
@@ -2579,6 +2612,85 @@ proto.looprpc.SwapStatus.prototype.setCostOffchain = function(value) {
25792612
};
25802613

25812614

2615+
/**
2616+
* optional bytes last_hop = 16;
2617+
* @return {!(string|Uint8Array)}
2618+
*/
2619+
proto.looprpc.SwapStatus.prototype.getLastHop = function() {
2620+
return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 16, ""));
2621+
};
2622+
2623+
2624+
/**
2625+
* optional bytes last_hop = 16;
2626+
* This is a type-conversion wrapper around `getLastHop()`
2627+
* @return {string}
2628+
*/
2629+
proto.looprpc.SwapStatus.prototype.getLastHop_asB64 = function() {
2630+
return /** @type {string} */ (jspb.Message.bytesAsB64(
2631+
this.getLastHop()));
2632+
};
2633+
2634+
2635+
/**
2636+
* optional bytes last_hop = 16;
2637+
* Note that Uint8Array is not supported on all browsers.
2638+
* @see http://caniuse.com/Uint8Array
2639+
* This is a type-conversion wrapper around `getLastHop()`
2640+
* @return {!Uint8Array}
2641+
*/
2642+
proto.looprpc.SwapStatus.prototype.getLastHop_asU8 = function() {
2643+
return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8(
2644+
this.getLastHop()));
2645+
};
2646+
2647+
2648+
/**
2649+
* @param {!(string|Uint8Array)} value
2650+
* @return {!proto.looprpc.SwapStatus} returns this
2651+
*/
2652+
proto.looprpc.SwapStatus.prototype.setLastHop = function(value) {
2653+
return jspb.Message.setProto3BytesField(this, 16, value);
2654+
};
2655+
2656+
2657+
/**
2658+
* repeated uint64 outgoing_chan_set = 17;
2659+
* @return {!Array<number>}
2660+
*/
2661+
proto.looprpc.SwapStatus.prototype.getOutgoingChanSetList = function() {
2662+
return /** @type {!Array<number>} */ (jspb.Message.getRepeatedField(this, 17));
2663+
};
2664+
2665+
2666+
/**
2667+
* @param {!Array<number>} value
2668+
* @return {!proto.looprpc.SwapStatus} returns this
2669+
*/
2670+
proto.looprpc.SwapStatus.prototype.setOutgoingChanSetList = function(value) {
2671+
return jspb.Message.setField(this, 17, value || []);
2672+
};
2673+
2674+
2675+
/**
2676+
* @param {number} value
2677+
* @param {number=} opt_index
2678+
* @return {!proto.looprpc.SwapStatus} returns this
2679+
*/
2680+
proto.looprpc.SwapStatus.prototype.addOutgoingChanSet = function(value, opt_index) {
2681+
return jspb.Message.addToRepeatedField(this, 17, value, opt_index);
2682+
};
2683+
2684+
2685+
/**
2686+
* Clears the list making it empty but non-null.
2687+
* @return {!proto.looprpc.SwapStatus} returns this
2688+
*/
2689+
proto.looprpc.SwapStatus.prototype.clearOutgoingChanSetList = function() {
2690+
return this.setOutgoingChanSetList([]);
2691+
};
2692+
2693+
25822694
/**
25832695
* optional string label = 15;
25842696
* @return {string}

lib/types/generated/lightning_pb.d.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3285,6 +3285,9 @@ export class WalletBalanceResponse extends jspb.Message {
32853285
getUnconfirmedBalance(): number;
32863286
setUnconfirmedBalance(value: number): void;
32873287

3288+
getLockedBalance(): number;
3289+
setLockedBalance(value: number): void;
3290+
32883291
getAccountBalanceMap(): jspb.Map<string, WalletAccountBalance>;
32893292
clearAccountBalanceMap(): void;
32903293
serializeBinary(): Uint8Array;
@@ -3302,6 +3305,7 @@ export namespace WalletBalanceResponse {
33023305
totalBalance: number,
33033306
confirmedBalance: number,
33043307
unconfirmedBalance: number,
3308+
lockedBalance: number,
33053309
accountBalance: Array<[string, WalletAccountBalance.AsObject]>,
33063310
}
33073311
}

lib/types/generated/lightning_pb.js

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27401,6 +27401,7 @@ proto.lnrpc.WalletBalanceResponse.toObject = function(includeInstance, msg) {
2740127401
totalBalance: jspb.Message.getFieldWithDefault(msg, 1, 0),
2740227402
confirmedBalance: jspb.Message.getFieldWithDefault(msg, 2, 0),
2740327403
unconfirmedBalance: jspb.Message.getFieldWithDefault(msg, 3, 0),
27404+
lockedBalance: jspb.Message.getFieldWithDefault(msg, 5, 0),
2740427405
accountBalanceMap: (f = msg.getAccountBalanceMap()) ? f.toObject(includeInstance, proto.lnrpc.WalletAccountBalance.toObject) : []
2740527406
};
2740627407

@@ -27450,6 +27451,10 @@ proto.lnrpc.WalletBalanceResponse.deserializeBinaryFromReader = function(msg, re
2745027451
var value = /** @type {number} */ (reader.readInt64());
2745127452
msg.setUnconfirmedBalance(value);
2745227453
break;
27454+
case 5:
27455+
var value = /** @type {number} */ (reader.readInt64());
27456+
msg.setLockedBalance(value);
27457+
break;
2745327458
case 4:
2745427459
var value = msg.getAccountBalanceMap();
2745527460
reader.readMessage(value, function(message, reader) {
@@ -27506,6 +27511,13 @@ proto.lnrpc.WalletBalanceResponse.serializeBinaryToWriter = function(message, wr
2750627511
f
2750727512
);
2750827513
}
27514+
f = message.getLockedBalance();
27515+
if (f !== 0) {
27516+
writer.writeInt64(
27517+
5,
27518+
f
27519+
);
27520+
}
2750927521
f = message.getAccountBalanceMap(true);
2751027522
if (f && f.getLength() > 0) {
2751127523
f.serializeBinary(4, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeMessage, proto.lnrpc.WalletAccountBalance.serializeBinaryToWriter);
@@ -27567,6 +27579,24 @@ proto.lnrpc.WalletBalanceResponse.prototype.setUnconfirmedBalance = function(val
2756727579
};
2756827580

2756927581

27582+
/**
27583+
* optional int64 locked_balance = 5;
27584+
* @return {number}
27585+
*/
27586+
proto.lnrpc.WalletBalanceResponse.prototype.getLockedBalance = function() {
27587+
return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 5, 0));
27588+
};
27589+
27590+
27591+
/**
27592+
* @param {number} value
27593+
* @return {!proto.lnrpc.WalletBalanceResponse} returns this
27594+
*/
27595+
proto.lnrpc.WalletBalanceResponse.prototype.setLockedBalance = function(value) {
27596+
return jspb.Message.setProto3IntField(this, 5, value);
27597+
};
27598+
27599+
2757027600
/**
2757127601
* map<string, WalletAccountBalance> account_balance = 4;
2757227602
* @param {boolean=} opt_noLazyCreate Do not create the map if

lib/util/tests/sampleData.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,8 @@ export const lndWalletBalance: LND.WalletBalanceResponse.AsObject = {
101101
totalBalance: 84992363,
102102
confirmedBalance: 84992363,
103103
unconfirmedBalance: 0,
104-
accountBalance: []
104+
accountBalance: [],
105+
lockedBalance: 30323021
105106
};
106107

107108
const txId = '6ee4e45870ac6191e25173f29804851e9f4bcf10f65f8b63100f488989e1e7a8';
@@ -371,7 +372,9 @@ export const loopListSwaps: LOOP.ListSwapsResponse.AsObject = {
371372
costServer: 66,
372373
costOnchain: 6812,
373374
costOffchain: 2,
374-
label: `Sample Swap #${i + 1}`
375+
label: `Sample Swap #${i + 1}`,
376+
lastHop: '0a1',
377+
outgoingChanSet: []
375378
}))
376379
};
377380

package-lock.json

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
"description": "Lightning Node Connect npm module for web",
55
"main": "./dist/",
66
"config": {
7-
"lnd_release_tag": "v0.14.2-beta",
8-
"loop_release_tag": "v0.17.0-beta",
9-
"pool_release_tag": "v0.5.5-alpha",
7+
"lnd_release_tag": "v0.14.3-beta",
8+
"loop_release_tag": "v0.19.1-beta",
9+
"pool_release_tag": "v0.5.6-alpha",
1010
"faraday_release_tag": "v0.2.5-alpha",
1111
"protoc_version": "3.15.8"
1212
},
@@ -18,15 +18,15 @@
1818
"generate": "sh scripts/generate_types.sh ${npm_package_config_lnd_release_tag} ${npm_package_config_loop_release_tag} ${npm_package_config_pool_release_tag} ${npm_package_config_faraday_release_tag} ${npm_package_config_protoc_version}",
1919
"prettier": "prettier --check --write '**/*.ts*' '!dist/**' '!lib/types/**'",
2020
"lint": "tslint -p tsconfig.json",
21-
"prepare" : "npm run build",
22-
"prepublishOnly" : "npm run lint",
23-
"preversion" : "npm run lint",
24-
"version" : "npm run prettier && git add -A lib",
21+
"prepare": "npm run build",
22+
"prepublishOnly": "npm run lint",
23+
"preversion": "npm run lint",
24+
"version": "npm run prettier && git add -A lib",
2525
"postversion": "git push && git push --tags"
2626
},
2727
"repository": {
2828
"type": "git",
29-
"url": "git+https://github.com/lightninglabs/lnc.git"
29+
"url": "git+https://github.com/lightninglabs/lnc-web.git"
3030
},
3131
"keywords": [
3232
"lightning",
@@ -36,9 +36,9 @@
3636
],
3737
"author": "Evan Kaloudis",
3838
"bugs": {
39-
"url": "https://github.com/lightninglabs/lnc/issues"
39+
"url": "https://github.com/lightninglabs/lnc-web/issues"
4040
},
41-
"homepage": "https://github.com/lightninglabs/lnc#readme",
41+
"homepage": "https://github.com/lightninglabs/lnc-web#readme",
4242
"devDependencies": {
4343
"@types/crypto-js": "4.1.1",
4444
"@types/debug": "4.1.7",
@@ -72,5 +72,12 @@
7272
"os": false,
7373
"crypto": false
7474
},
75-
"files": ["dist/**/*"]
75+
"files": [
76+
"dist/**/*"
77+
],
78+
"directories": {
79+
"lib": "lib",
80+
"test": "test"
81+
},
82+
"license": "MIT"
7683
}

0 commit comments

Comments
 (0)