@buildonspark/spark-sdk 0.0.14 → 0.0.16
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/proto/spark.d.ts +111 -3
- package/dist/proto/spark.js +994 -43
- package/dist/proto/spark.js.map +1 -1
- package/dist/services/lightning.js +1 -0
- package/dist/services/lightning.js.map +1 -1
- package/dist/services/transfer.js +2 -0
- package/dist/services/transfer.js.map +1 -1
- package/dist/services/wallet-config.d.ts +1 -0
- package/dist/services/wallet-config.js +1 -0
- package/dist/services/wallet-config.js.map +1 -1
- package/dist/signer/signer.js +1 -1
- package/dist/signer/signer.js.map +1 -1
- package/dist/spark-sdk.d.ts +1 -1
- package/dist/spark-sdk.js +8 -4
- package/dist/spark-sdk.js.map +1 -1
- package/dist/tests/utils/test-faucet.d.ts +1 -0
- package/dist/tests/utils/test-faucet.js +9 -0
- package/dist/tests/utils/test-faucet.js.map +1 -1
- package/dist/utils/keys.d.ts +1 -1
- package/dist/utils/keys.js +4 -3
- package/dist/utils/keys.js.map +1 -1
- package/dist/utils/wasm-wrapper.js +9 -9
- package/dist/utils/wasm-wrapper.js.map +1 -1
- package/package.json +4 -3
- package/src/examples/example.js +247 -0
- package/src/examples/example.ts +207 -0
- package/src/graphql/client.ts +282 -0
- package/src/graphql/mutations/CompleteCoopExit.ts +19 -0
- package/src/graphql/mutations/CompleteLeavesSwap.ts +17 -0
- package/src/graphql/mutations/RequestCoopExit.ts +20 -0
- package/src/graphql/mutations/RequestLightningReceive.ts +26 -0
- package/src/graphql/mutations/RequestLightningSend.ts +17 -0
- package/src/graphql/mutations/RequestSwapLeaves.ts +24 -0
- package/src/graphql/objects/BitcoinNetwork.ts +22 -0
- package/src/graphql/objects/CompleteCoopExitInput.ts +41 -0
- package/src/graphql/objects/CompleteCoopExitOutput.ts +45 -0
- package/src/graphql/objects/CompleteLeavesSwapInput.ts +45 -0
- package/src/graphql/objects/CompleteLeavesSwapOutput.ts +45 -0
- package/src/graphql/objects/CompleteSeedReleaseInput.ts +41 -0
- package/src/graphql/objects/CompleteSeedReleaseOutput.ts +43 -0
- package/src/graphql/objects/Connection.ts +90 -0
- package/src/graphql/objects/CoopExitFeeEstimateInput.ts +41 -0
- package/src/graphql/objects/CoopExitFeeEstimateOutput.ts +52 -0
- package/src/graphql/objects/CoopExitRequest.ts +118 -0
- package/src/graphql/objects/CurrencyAmount.ts +74 -0
- package/src/graphql/objects/CurrencyUnit.ts +32 -0
- package/src/graphql/objects/Entity.ts +202 -0
- package/src/graphql/objects/GetChallengeInput.ts +37 -0
- package/src/graphql/objects/GetChallengeOutput.ts +43 -0
- package/src/graphql/objects/Invoice.ts +83 -0
- package/src/graphql/objects/Leaf.ts +59 -0
- package/src/graphql/objects/LeavesSwapFeeEstimateInput.ts +37 -0
- package/src/graphql/objects/LeavesSwapFeeEstimateOutput.ts +52 -0
- package/src/graphql/objects/LeavesSwapRequest.ts +192 -0
- package/src/graphql/objects/LightningReceiveFeeEstimateInput.ts +41 -0
- package/src/graphql/objects/LightningReceiveFeeEstimateOutput.ts +52 -0
- package/src/graphql/objects/LightningReceiveRequest.ts +147 -0
- package/src/graphql/objects/LightningReceiveRequestStatus.ts +34 -0
- package/src/graphql/objects/LightningSendFeeEstimateInput.ts +37 -0
- package/src/graphql/objects/LightningSendFeeEstimateOutput.ts +52 -0
- package/src/graphql/objects/LightningSendRequest.ts +134 -0
- package/src/graphql/objects/LightningSendRequestStatus.ts +28 -0
- package/src/graphql/objects/NotifyReceiverTransferInput.ts +41 -0
- package/src/graphql/objects/PageInfo.ts +58 -0
- package/src/graphql/objects/Provider.ts +41 -0
- package/src/graphql/objects/RequestCoopExitInput.ts +41 -0
- package/src/graphql/objects/RequestCoopExitOutput.ts +45 -0
- package/src/graphql/objects/RequestLeavesSwapInput.ts +55 -0
- package/src/graphql/objects/RequestLeavesSwapOutput.ts +45 -0
- package/src/graphql/objects/RequestLightningReceiveInput.ts +58 -0
- package/src/graphql/objects/RequestLightningReceiveOutput.ts +45 -0
- package/src/graphql/objects/RequestLightningSendInput.ts +41 -0
- package/src/graphql/objects/RequestLightningSendOutput.ts +45 -0
- package/src/graphql/objects/SparkCoopExitRequestStatus.ts +20 -0
- package/src/graphql/objects/SparkLeavesSwapRequestStatus.ts +20 -0
- package/src/graphql/objects/SparkTransferToLeavesConnection.ts +79 -0
- package/src/graphql/objects/SparkWalletUser.ts +86 -0
- package/src/graphql/objects/StartSeedReleaseInput.ts +37 -0
- package/src/graphql/objects/SwapLeaf.ts +53 -0
- package/src/graphql/objects/Transfer.ts +98 -0
- package/src/graphql/objects/UserLeafInput.ts +28 -0
- package/src/graphql/objects/VerifyChallengeInput.ts +51 -0
- package/src/graphql/objects/VerifyChallengeOutput.ts +43 -0
- package/src/graphql/objects/WalletUserIdentityPublicKeyInput.ts +37 -0
- package/src/graphql/objects/WalletUserIdentityPublicKeyOutput.ts +43 -0
- package/src/graphql/objects/index.ts +67 -0
- package/src/graphql/queries/CoopExitFeeEstimate.ts +18 -0
- package/src/graphql/queries/CurrentUser.ts +10 -0
- package/src/graphql/queries/LightningReceiveFeeEstimate.ts +18 -0
- package/src/graphql/queries/LightningSendFeeEstimate.ts +16 -0
- package/src/proto/common.ts +431 -0
- package/src/proto/google/protobuf/descriptor.ts +6625 -0
- package/src/proto/google/protobuf/duration.ts +197 -0
- package/src/proto/google/protobuf/empty.ts +83 -0
- package/src/proto/google/protobuf/timestamp.ts +226 -0
- package/src/proto/mock.ts +151 -0
- package/src/proto/spark.ts +12727 -0
- package/src/proto/spark_authn.ts +673 -0
- package/src/proto/validate/validate.ts +6047 -0
- package/src/services/config.ts +71 -0
- package/src/services/connection.ts +264 -0
- package/src/services/coop-exit.ts +190 -0
- package/src/services/deposit.ts +327 -0
- package/src/services/lightning.ts +341 -0
- package/src/services/lrc20.ts +42 -0
- package/src/services/token-transactions.ts +499 -0
- package/src/services/transfer.ts +1188 -0
- package/src/services/tree-creation.ts +618 -0
- package/src/services/wallet-config.ts +141 -0
- package/src/signer/signer.ts +531 -0
- package/src/spark-sdk.ts +1644 -0
- package/src/tests/adaptor-signature.test.ts +64 -0
- package/src/tests/bitcoin.test.ts +122 -0
- package/src/tests/coop-exit.test.ts +233 -0
- package/src/tests/deposit.test.ts +98 -0
- package/src/tests/keys.test.ts +82 -0
- package/src/tests/lightning.test.ts +307 -0
- package/src/tests/secret-sharing.test.ts +63 -0
- package/src/tests/swap.test.ts +252 -0
- package/src/tests/test-util.ts +92 -0
- package/src/tests/tokens.test.ts +47 -0
- package/src/tests/transfer.test.ts +371 -0
- package/src/tests/tree-creation.test.ts +56 -0
- package/src/tests/utils/spark-testing-wallet.ts +37 -0
- package/src/tests/utils/test-faucet.ts +257 -0
- package/src/types/grpc.ts +8 -0
- package/src/types/index.ts +3 -0
- package/src/utils/adaptor-signature.ts +189 -0
- package/src/utils/bitcoin.ts +138 -0
- package/src/utils/crypto.ts +14 -0
- package/src/utils/index.ts +12 -0
- package/src/utils/keys.ts +92 -0
- package/src/utils/mempool.ts +42 -0
- package/src/utils/network.ts +70 -0
- package/src/utils/proof.ts +17 -0
- package/src/utils/response-validation.ts +26 -0
- package/src/utils/secret-sharing.ts +263 -0
- package/src/utils/signing.ts +96 -0
- package/src/utils/token-hashing.ts +163 -0
- package/src/utils/token-keyshares.ts +31 -0
- package/src/utils/token-transactions.ts +71 -0
- package/src/utils/transaction.ts +45 -0
- package/src/utils/wasm-wrapper.ts +57 -0
- package/src/utils/wasm.ts +154 -0
- package/src/wasm/spark_bindings.d.ts +208 -0
- package/src/wasm/spark_bindings.js +1161 -0
- package/src/wasm/spark_bindings_bg.wasm +0 -0
- package/src/wasm/spark_bindings_bg.wasm.d.ts +136 -0
package/dist/proto/spark.js
CHANGED
|
@@ -52,6 +52,43 @@ export function networkToJSON(object) {
|
|
|
52
52
|
return "UNRECOGNIZED";
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
|
+
export var TokenTransactionStatus;
|
|
56
|
+
(function (TokenTransactionStatus) {
|
|
57
|
+
TokenTransactionStatus[TokenTransactionStatus["TOKEN_TRANSACTION_STARTED"] = 0] = "TOKEN_TRANSACTION_STARTED";
|
|
58
|
+
TokenTransactionStatus[TokenTransactionStatus["TOKEN_TRANSACTION_SIGNED"] = 1] = "TOKEN_TRANSACTION_SIGNED";
|
|
59
|
+
TokenTransactionStatus[TokenTransactionStatus["TOKEN_TRANSACTION_FINALIZED"] = 2] = "TOKEN_TRANSACTION_FINALIZED";
|
|
60
|
+
TokenTransactionStatus[TokenTransactionStatus["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
|
|
61
|
+
})(TokenTransactionStatus || (TokenTransactionStatus = {}));
|
|
62
|
+
export function tokenTransactionStatusFromJSON(object) {
|
|
63
|
+
switch (object) {
|
|
64
|
+
case 0:
|
|
65
|
+
case "TOKEN_TRANSACTION_STARTED":
|
|
66
|
+
return TokenTransactionStatus.TOKEN_TRANSACTION_STARTED;
|
|
67
|
+
case 1:
|
|
68
|
+
case "TOKEN_TRANSACTION_SIGNED":
|
|
69
|
+
return TokenTransactionStatus.TOKEN_TRANSACTION_SIGNED;
|
|
70
|
+
case 2:
|
|
71
|
+
case "TOKEN_TRANSACTION_FINALIZED":
|
|
72
|
+
return TokenTransactionStatus.TOKEN_TRANSACTION_FINALIZED;
|
|
73
|
+
case -1:
|
|
74
|
+
case "UNRECOGNIZED":
|
|
75
|
+
default:
|
|
76
|
+
return TokenTransactionStatus.UNRECOGNIZED;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
export function tokenTransactionStatusToJSON(object) {
|
|
80
|
+
switch (object) {
|
|
81
|
+
case TokenTransactionStatus.TOKEN_TRANSACTION_STARTED:
|
|
82
|
+
return "TOKEN_TRANSACTION_STARTED";
|
|
83
|
+
case TokenTransactionStatus.TOKEN_TRANSACTION_SIGNED:
|
|
84
|
+
return "TOKEN_TRANSACTION_SIGNED";
|
|
85
|
+
case TokenTransactionStatus.TOKEN_TRANSACTION_FINALIZED:
|
|
86
|
+
return "TOKEN_TRANSACTION_FINALIZED";
|
|
87
|
+
case TokenTransactionStatus.UNRECOGNIZED:
|
|
88
|
+
default:
|
|
89
|
+
return "UNRECOGNIZED";
|
|
90
|
+
}
|
|
91
|
+
}
|
|
55
92
|
export var TransferStatus;
|
|
56
93
|
(function (TransferStatus) {
|
|
57
94
|
TransferStatus[TransferStatus["TRANSFER_STATUS_SENDER_INITIATED"] = 0] = "TRANSFER_STATUS_SENDER_INITIATED";
|
|
@@ -61,6 +98,7 @@ export var TransferStatus;
|
|
|
61
98
|
TransferStatus[TransferStatus["TRANSFER_STATUSR_RECEIVER_REFUND_SIGNED"] = 4] = "TRANSFER_STATUSR_RECEIVER_REFUND_SIGNED";
|
|
62
99
|
TransferStatus[TransferStatus["TRANSFER_STATUS_COMPLETED"] = 5] = "TRANSFER_STATUS_COMPLETED";
|
|
63
100
|
TransferStatus[TransferStatus["TRANSFER_STATUS_EXPIRED"] = 6] = "TRANSFER_STATUS_EXPIRED";
|
|
101
|
+
TransferStatus[TransferStatus["TRANSFER_STATUS_RETURNED"] = 7] = "TRANSFER_STATUS_RETURNED";
|
|
64
102
|
TransferStatus[TransferStatus["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
|
|
65
103
|
})(TransferStatus || (TransferStatus = {}));
|
|
66
104
|
export function transferStatusFromJSON(object) {
|
|
@@ -86,6 +124,9 @@ export function transferStatusFromJSON(object) {
|
|
|
86
124
|
case 6:
|
|
87
125
|
case "TRANSFER_STATUS_EXPIRED":
|
|
88
126
|
return TransferStatus.TRANSFER_STATUS_EXPIRED;
|
|
127
|
+
case 7:
|
|
128
|
+
case "TRANSFER_STATUS_RETURNED":
|
|
129
|
+
return TransferStatus.TRANSFER_STATUS_RETURNED;
|
|
89
130
|
case -1:
|
|
90
131
|
case "UNRECOGNIZED":
|
|
91
132
|
default:
|
|
@@ -108,6 +149,8 @@ export function transferStatusToJSON(object) {
|
|
|
108
149
|
return "TRANSFER_STATUS_COMPLETED";
|
|
109
150
|
case TransferStatus.TRANSFER_STATUS_EXPIRED:
|
|
110
151
|
return "TRANSFER_STATUS_EXPIRED";
|
|
152
|
+
case TransferStatus.TRANSFER_STATUS_RETURNED:
|
|
153
|
+
return "TRANSFER_STATUS_RETURNED";
|
|
111
154
|
case TransferStatus.UNRECOGNIZED:
|
|
112
155
|
default:
|
|
113
156
|
return "UNRECOGNIZED";
|
|
@@ -2053,6 +2096,76 @@ export const TokenTransaction = {
|
|
|
2053
2096
|
return message;
|
|
2054
2097
|
},
|
|
2055
2098
|
};
|
|
2099
|
+
function createBaseTokenTransactionWithStatus() {
|
|
2100
|
+
return { tokenTransaction: undefined, status: 0 };
|
|
2101
|
+
}
|
|
2102
|
+
export const TokenTransactionWithStatus = {
|
|
2103
|
+
encode(message, writer = new BinaryWriter()) {
|
|
2104
|
+
if (message.tokenTransaction !== undefined) {
|
|
2105
|
+
TokenTransaction.encode(message.tokenTransaction, writer.uint32(10).fork()).join();
|
|
2106
|
+
}
|
|
2107
|
+
if (message.status !== 0) {
|
|
2108
|
+
writer.uint32(16).int32(message.status);
|
|
2109
|
+
}
|
|
2110
|
+
return writer;
|
|
2111
|
+
},
|
|
2112
|
+
decode(input, length) {
|
|
2113
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
2114
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
2115
|
+
const message = createBaseTokenTransactionWithStatus();
|
|
2116
|
+
while (reader.pos < end) {
|
|
2117
|
+
const tag = reader.uint32();
|
|
2118
|
+
switch (tag >>> 3) {
|
|
2119
|
+
case 1: {
|
|
2120
|
+
if (tag !== 10) {
|
|
2121
|
+
break;
|
|
2122
|
+
}
|
|
2123
|
+
message.tokenTransaction = TokenTransaction.decode(reader, reader.uint32());
|
|
2124
|
+
continue;
|
|
2125
|
+
}
|
|
2126
|
+
case 2: {
|
|
2127
|
+
if (tag !== 16) {
|
|
2128
|
+
break;
|
|
2129
|
+
}
|
|
2130
|
+
message.status = reader.int32();
|
|
2131
|
+
continue;
|
|
2132
|
+
}
|
|
2133
|
+
}
|
|
2134
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
2135
|
+
break;
|
|
2136
|
+
}
|
|
2137
|
+
reader.skip(tag & 7);
|
|
2138
|
+
}
|
|
2139
|
+
return message;
|
|
2140
|
+
},
|
|
2141
|
+
fromJSON(object) {
|
|
2142
|
+
return {
|
|
2143
|
+
tokenTransaction: isSet(object.tokenTransaction) ? TokenTransaction.fromJSON(object.tokenTransaction) : undefined,
|
|
2144
|
+
status: isSet(object.status) ? tokenTransactionStatusFromJSON(object.status) : 0,
|
|
2145
|
+
};
|
|
2146
|
+
},
|
|
2147
|
+
toJSON(message) {
|
|
2148
|
+
const obj = {};
|
|
2149
|
+
if (message.tokenTransaction !== undefined) {
|
|
2150
|
+
obj.tokenTransaction = TokenTransaction.toJSON(message.tokenTransaction);
|
|
2151
|
+
}
|
|
2152
|
+
if (message.status !== 0) {
|
|
2153
|
+
obj.status = tokenTransactionStatusToJSON(message.status);
|
|
2154
|
+
}
|
|
2155
|
+
return obj;
|
|
2156
|
+
},
|
|
2157
|
+
create(base) {
|
|
2158
|
+
return TokenTransactionWithStatus.fromPartial(base ?? {});
|
|
2159
|
+
},
|
|
2160
|
+
fromPartial(object) {
|
|
2161
|
+
const message = createBaseTokenTransactionWithStatus();
|
|
2162
|
+
message.tokenTransaction = (object.tokenTransaction !== undefined && object.tokenTransaction !== null)
|
|
2163
|
+
? TokenTransaction.fromPartial(object.tokenTransaction)
|
|
2164
|
+
: undefined;
|
|
2165
|
+
message.status = object.status ?? 0;
|
|
2166
|
+
return message;
|
|
2167
|
+
},
|
|
2168
|
+
};
|
|
2056
2169
|
function createBaseTokenTransactionSignatures() {
|
|
2057
2170
|
return { ownerSignatures: [] };
|
|
2058
2171
|
}
|
|
@@ -3037,6 +3150,211 @@ export const GetOwnedTokenLeavesRequest = {
|
|
|
3037
3150
|
return message;
|
|
3038
3151
|
},
|
|
3039
3152
|
};
|
|
3153
|
+
function createBaseQueryTokenTransactionsRequest() {
|
|
3154
|
+
return { leafIds: [], ownerPublicKeys: [], tokenPublicKeys: [], tokenTransactionHashes: [], limit: 0, offset: 0 };
|
|
3155
|
+
}
|
|
3156
|
+
export const QueryTokenTransactionsRequest = {
|
|
3157
|
+
encode(message, writer = new BinaryWriter()) {
|
|
3158
|
+
for (const v of message.leafIds) {
|
|
3159
|
+
writer.uint32(10).string(v);
|
|
3160
|
+
}
|
|
3161
|
+
for (const v of message.ownerPublicKeys) {
|
|
3162
|
+
writer.uint32(18).bytes(v);
|
|
3163
|
+
}
|
|
3164
|
+
for (const v of message.tokenPublicKeys) {
|
|
3165
|
+
writer.uint32(26).bytes(v);
|
|
3166
|
+
}
|
|
3167
|
+
for (const v of message.tokenTransactionHashes) {
|
|
3168
|
+
writer.uint32(34).bytes(v);
|
|
3169
|
+
}
|
|
3170
|
+
if (message.limit !== 0) {
|
|
3171
|
+
writer.uint32(40).int64(message.limit);
|
|
3172
|
+
}
|
|
3173
|
+
if (message.offset !== 0) {
|
|
3174
|
+
writer.uint32(48).int64(message.offset);
|
|
3175
|
+
}
|
|
3176
|
+
return writer;
|
|
3177
|
+
},
|
|
3178
|
+
decode(input, length) {
|
|
3179
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
3180
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
3181
|
+
const message = createBaseQueryTokenTransactionsRequest();
|
|
3182
|
+
while (reader.pos < end) {
|
|
3183
|
+
const tag = reader.uint32();
|
|
3184
|
+
switch (tag >>> 3) {
|
|
3185
|
+
case 1: {
|
|
3186
|
+
if (tag !== 10) {
|
|
3187
|
+
break;
|
|
3188
|
+
}
|
|
3189
|
+
message.leafIds.push(reader.string());
|
|
3190
|
+
continue;
|
|
3191
|
+
}
|
|
3192
|
+
case 2: {
|
|
3193
|
+
if (tag !== 18) {
|
|
3194
|
+
break;
|
|
3195
|
+
}
|
|
3196
|
+
message.ownerPublicKeys.push(reader.bytes());
|
|
3197
|
+
continue;
|
|
3198
|
+
}
|
|
3199
|
+
case 3: {
|
|
3200
|
+
if (tag !== 26) {
|
|
3201
|
+
break;
|
|
3202
|
+
}
|
|
3203
|
+
message.tokenPublicKeys.push(reader.bytes());
|
|
3204
|
+
continue;
|
|
3205
|
+
}
|
|
3206
|
+
case 4: {
|
|
3207
|
+
if (tag !== 34) {
|
|
3208
|
+
break;
|
|
3209
|
+
}
|
|
3210
|
+
message.tokenTransactionHashes.push(reader.bytes());
|
|
3211
|
+
continue;
|
|
3212
|
+
}
|
|
3213
|
+
case 5: {
|
|
3214
|
+
if (tag !== 40) {
|
|
3215
|
+
break;
|
|
3216
|
+
}
|
|
3217
|
+
message.limit = longToNumber(reader.int64());
|
|
3218
|
+
continue;
|
|
3219
|
+
}
|
|
3220
|
+
case 6: {
|
|
3221
|
+
if (tag !== 48) {
|
|
3222
|
+
break;
|
|
3223
|
+
}
|
|
3224
|
+
message.offset = longToNumber(reader.int64());
|
|
3225
|
+
continue;
|
|
3226
|
+
}
|
|
3227
|
+
}
|
|
3228
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
3229
|
+
break;
|
|
3230
|
+
}
|
|
3231
|
+
reader.skip(tag & 7);
|
|
3232
|
+
}
|
|
3233
|
+
return message;
|
|
3234
|
+
},
|
|
3235
|
+
fromJSON(object) {
|
|
3236
|
+
return {
|
|
3237
|
+
leafIds: globalThis.Array.isArray(object?.leafIds) ? object.leafIds.map((e) => globalThis.String(e)) : [],
|
|
3238
|
+
ownerPublicKeys: globalThis.Array.isArray(object?.ownerPublicKeys)
|
|
3239
|
+
? object.ownerPublicKeys.map((e) => bytesFromBase64(e))
|
|
3240
|
+
: [],
|
|
3241
|
+
tokenPublicKeys: globalThis.Array.isArray(object?.tokenPublicKeys)
|
|
3242
|
+
? object.tokenPublicKeys.map((e) => bytesFromBase64(e))
|
|
3243
|
+
: [],
|
|
3244
|
+
tokenTransactionHashes: globalThis.Array.isArray(object?.tokenTransactionHashes)
|
|
3245
|
+
? object.tokenTransactionHashes.map((e) => bytesFromBase64(e))
|
|
3246
|
+
: [],
|
|
3247
|
+
limit: isSet(object.limit) ? globalThis.Number(object.limit) : 0,
|
|
3248
|
+
offset: isSet(object.offset) ? globalThis.Number(object.offset) : 0,
|
|
3249
|
+
};
|
|
3250
|
+
},
|
|
3251
|
+
toJSON(message) {
|
|
3252
|
+
const obj = {};
|
|
3253
|
+
if (message.leafIds?.length) {
|
|
3254
|
+
obj.leafIds = message.leafIds;
|
|
3255
|
+
}
|
|
3256
|
+
if (message.ownerPublicKeys?.length) {
|
|
3257
|
+
obj.ownerPublicKeys = message.ownerPublicKeys.map((e) => base64FromBytes(e));
|
|
3258
|
+
}
|
|
3259
|
+
if (message.tokenPublicKeys?.length) {
|
|
3260
|
+
obj.tokenPublicKeys = message.tokenPublicKeys.map((e) => base64FromBytes(e));
|
|
3261
|
+
}
|
|
3262
|
+
if (message.tokenTransactionHashes?.length) {
|
|
3263
|
+
obj.tokenTransactionHashes = message.tokenTransactionHashes.map((e) => base64FromBytes(e));
|
|
3264
|
+
}
|
|
3265
|
+
if (message.limit !== 0) {
|
|
3266
|
+
obj.limit = Math.round(message.limit);
|
|
3267
|
+
}
|
|
3268
|
+
if (message.offset !== 0) {
|
|
3269
|
+
obj.offset = Math.round(message.offset);
|
|
3270
|
+
}
|
|
3271
|
+
return obj;
|
|
3272
|
+
},
|
|
3273
|
+
create(base) {
|
|
3274
|
+
return QueryTokenTransactionsRequest.fromPartial(base ?? {});
|
|
3275
|
+
},
|
|
3276
|
+
fromPartial(object) {
|
|
3277
|
+
const message = createBaseQueryTokenTransactionsRequest();
|
|
3278
|
+
message.leafIds = object.leafIds?.map((e) => e) || [];
|
|
3279
|
+
message.ownerPublicKeys = object.ownerPublicKeys?.map((e) => e) || [];
|
|
3280
|
+
message.tokenPublicKeys = object.tokenPublicKeys?.map((e) => e) || [];
|
|
3281
|
+
message.tokenTransactionHashes = object.tokenTransactionHashes?.map((e) => e) || [];
|
|
3282
|
+
message.limit = object.limit ?? 0;
|
|
3283
|
+
message.offset = object.offset ?? 0;
|
|
3284
|
+
return message;
|
|
3285
|
+
},
|
|
3286
|
+
};
|
|
3287
|
+
function createBaseQueryTokenTransactionsResponse() {
|
|
3288
|
+
return { tokenTransactionsWithStatus: [], offset: 0 };
|
|
3289
|
+
}
|
|
3290
|
+
export const QueryTokenTransactionsResponse = {
|
|
3291
|
+
encode(message, writer = new BinaryWriter()) {
|
|
3292
|
+
for (const v of message.tokenTransactionsWithStatus) {
|
|
3293
|
+
TokenTransactionWithStatus.encode(v, writer.uint32(10).fork()).join();
|
|
3294
|
+
}
|
|
3295
|
+
if (message.offset !== 0) {
|
|
3296
|
+
writer.uint32(16).int64(message.offset);
|
|
3297
|
+
}
|
|
3298
|
+
return writer;
|
|
3299
|
+
},
|
|
3300
|
+
decode(input, length) {
|
|
3301
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
3302
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
3303
|
+
const message = createBaseQueryTokenTransactionsResponse();
|
|
3304
|
+
while (reader.pos < end) {
|
|
3305
|
+
const tag = reader.uint32();
|
|
3306
|
+
switch (tag >>> 3) {
|
|
3307
|
+
case 1: {
|
|
3308
|
+
if (tag !== 10) {
|
|
3309
|
+
break;
|
|
3310
|
+
}
|
|
3311
|
+
message.tokenTransactionsWithStatus.push(TokenTransactionWithStatus.decode(reader, reader.uint32()));
|
|
3312
|
+
continue;
|
|
3313
|
+
}
|
|
3314
|
+
case 2: {
|
|
3315
|
+
if (tag !== 16) {
|
|
3316
|
+
break;
|
|
3317
|
+
}
|
|
3318
|
+
message.offset = longToNumber(reader.int64());
|
|
3319
|
+
continue;
|
|
3320
|
+
}
|
|
3321
|
+
}
|
|
3322
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
3323
|
+
break;
|
|
3324
|
+
}
|
|
3325
|
+
reader.skip(tag & 7);
|
|
3326
|
+
}
|
|
3327
|
+
return message;
|
|
3328
|
+
},
|
|
3329
|
+
fromJSON(object) {
|
|
3330
|
+
return {
|
|
3331
|
+
tokenTransactionsWithStatus: globalThis.Array.isArray(object?.tokenTransactionsWithStatus)
|
|
3332
|
+
? object.tokenTransactionsWithStatus.map((e) => TokenTransactionWithStatus.fromJSON(e))
|
|
3333
|
+
: [],
|
|
3334
|
+
offset: isSet(object.offset) ? globalThis.Number(object.offset) : 0,
|
|
3335
|
+
};
|
|
3336
|
+
},
|
|
3337
|
+
toJSON(message) {
|
|
3338
|
+
const obj = {};
|
|
3339
|
+
if (message.tokenTransactionsWithStatus?.length) {
|
|
3340
|
+
obj.tokenTransactionsWithStatus = message.tokenTransactionsWithStatus.map((e) => TokenTransactionWithStatus.toJSON(e));
|
|
3341
|
+
}
|
|
3342
|
+
if (message.offset !== 0) {
|
|
3343
|
+
obj.offset = Math.round(message.offset);
|
|
3344
|
+
}
|
|
3345
|
+
return obj;
|
|
3346
|
+
},
|
|
3347
|
+
create(base) {
|
|
3348
|
+
return QueryTokenTransactionsResponse.fromPartial(base ?? {});
|
|
3349
|
+
},
|
|
3350
|
+
fromPartial(object) {
|
|
3351
|
+
const message = createBaseQueryTokenTransactionsResponse();
|
|
3352
|
+
message.tokenTransactionsWithStatus =
|
|
3353
|
+
object.tokenTransactionsWithStatus?.map((e) => TokenTransactionWithStatus.fromPartial(e)) || [];
|
|
3354
|
+
message.offset = object.offset ?? 0;
|
|
3355
|
+
return message;
|
|
3356
|
+
},
|
|
3357
|
+
};
|
|
3040
3358
|
function createBaseLeafWithPreviousTransactionData() {
|
|
3041
3359
|
return { leaf: undefined, previousTransactionHash: new Uint8Array(0), previousTransactionVout: 0 };
|
|
3042
3360
|
}
|
|
@@ -3182,29 +3500,104 @@ export const GetOwnedTokenLeavesResponse = {
|
|
|
3182
3500
|
return message;
|
|
3183
3501
|
},
|
|
3184
3502
|
};
|
|
3185
|
-
function
|
|
3186
|
-
return {
|
|
3187
|
-
id: "",
|
|
3188
|
-
treeId: "",
|
|
3189
|
-
value: 0,
|
|
3190
|
-
parentNodeId: undefined,
|
|
3191
|
-
nodeTx: new Uint8Array(0),
|
|
3192
|
-
refundTx: new Uint8Array(0),
|
|
3193
|
-
vout: 0,
|
|
3194
|
-
verifyingPublicKey: new Uint8Array(0),
|
|
3195
|
-
ownerIdentityPublicKey: new Uint8Array(0),
|
|
3196
|
-
signingKeyshare: undefined,
|
|
3197
|
-
status: "",
|
|
3198
|
-
network: 0,
|
|
3199
|
-
};
|
|
3503
|
+
function createBaseCancelSignedTokenTransactionRequest() {
|
|
3504
|
+
return { finalTokenTransaction: undefined, senderIdentityPublicKey: new Uint8Array(0) };
|
|
3200
3505
|
}
|
|
3201
|
-
export const
|
|
3506
|
+
export const CancelSignedTokenTransactionRequest = {
|
|
3202
3507
|
encode(message, writer = new BinaryWriter()) {
|
|
3203
|
-
if (message.
|
|
3204
|
-
writer.uint32(10).
|
|
3508
|
+
if (message.finalTokenTransaction !== undefined) {
|
|
3509
|
+
TokenTransaction.encode(message.finalTokenTransaction, writer.uint32(10).fork()).join();
|
|
3205
3510
|
}
|
|
3206
|
-
if (message.
|
|
3207
|
-
writer.uint32(18).
|
|
3511
|
+
if (message.senderIdentityPublicKey.length !== 0) {
|
|
3512
|
+
writer.uint32(18).bytes(message.senderIdentityPublicKey);
|
|
3513
|
+
}
|
|
3514
|
+
return writer;
|
|
3515
|
+
},
|
|
3516
|
+
decode(input, length) {
|
|
3517
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
3518
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
3519
|
+
const message = createBaseCancelSignedTokenTransactionRequest();
|
|
3520
|
+
while (reader.pos < end) {
|
|
3521
|
+
const tag = reader.uint32();
|
|
3522
|
+
switch (tag >>> 3) {
|
|
3523
|
+
case 1: {
|
|
3524
|
+
if (tag !== 10) {
|
|
3525
|
+
break;
|
|
3526
|
+
}
|
|
3527
|
+
message.finalTokenTransaction = TokenTransaction.decode(reader, reader.uint32());
|
|
3528
|
+
continue;
|
|
3529
|
+
}
|
|
3530
|
+
case 2: {
|
|
3531
|
+
if (tag !== 18) {
|
|
3532
|
+
break;
|
|
3533
|
+
}
|
|
3534
|
+
message.senderIdentityPublicKey = reader.bytes();
|
|
3535
|
+
continue;
|
|
3536
|
+
}
|
|
3537
|
+
}
|
|
3538
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
3539
|
+
break;
|
|
3540
|
+
}
|
|
3541
|
+
reader.skip(tag & 7);
|
|
3542
|
+
}
|
|
3543
|
+
return message;
|
|
3544
|
+
},
|
|
3545
|
+
fromJSON(object) {
|
|
3546
|
+
return {
|
|
3547
|
+
finalTokenTransaction: isSet(object.finalTokenTransaction)
|
|
3548
|
+
? TokenTransaction.fromJSON(object.finalTokenTransaction)
|
|
3549
|
+
: undefined,
|
|
3550
|
+
senderIdentityPublicKey: isSet(object.senderIdentityPublicKey)
|
|
3551
|
+
? bytesFromBase64(object.senderIdentityPublicKey)
|
|
3552
|
+
: new Uint8Array(0),
|
|
3553
|
+
};
|
|
3554
|
+
},
|
|
3555
|
+
toJSON(message) {
|
|
3556
|
+
const obj = {};
|
|
3557
|
+
if (message.finalTokenTransaction !== undefined) {
|
|
3558
|
+
obj.finalTokenTransaction = TokenTransaction.toJSON(message.finalTokenTransaction);
|
|
3559
|
+
}
|
|
3560
|
+
if (message.senderIdentityPublicKey.length !== 0) {
|
|
3561
|
+
obj.senderIdentityPublicKey = base64FromBytes(message.senderIdentityPublicKey);
|
|
3562
|
+
}
|
|
3563
|
+
return obj;
|
|
3564
|
+
},
|
|
3565
|
+
create(base) {
|
|
3566
|
+
return CancelSignedTokenTransactionRequest.fromPartial(base ?? {});
|
|
3567
|
+
},
|
|
3568
|
+
fromPartial(object) {
|
|
3569
|
+
const message = createBaseCancelSignedTokenTransactionRequest();
|
|
3570
|
+
message.finalTokenTransaction =
|
|
3571
|
+
(object.finalTokenTransaction !== undefined && object.finalTokenTransaction !== null)
|
|
3572
|
+
? TokenTransaction.fromPartial(object.finalTokenTransaction)
|
|
3573
|
+
: undefined;
|
|
3574
|
+
message.senderIdentityPublicKey = object.senderIdentityPublicKey ?? new Uint8Array(0);
|
|
3575
|
+
return message;
|
|
3576
|
+
},
|
|
3577
|
+
};
|
|
3578
|
+
function createBaseTreeNode() {
|
|
3579
|
+
return {
|
|
3580
|
+
id: "",
|
|
3581
|
+
treeId: "",
|
|
3582
|
+
value: 0,
|
|
3583
|
+
parentNodeId: undefined,
|
|
3584
|
+
nodeTx: new Uint8Array(0),
|
|
3585
|
+
refundTx: new Uint8Array(0),
|
|
3586
|
+
vout: 0,
|
|
3587
|
+
verifyingPublicKey: new Uint8Array(0),
|
|
3588
|
+
ownerIdentityPublicKey: new Uint8Array(0),
|
|
3589
|
+
signingKeyshare: undefined,
|
|
3590
|
+
status: "",
|
|
3591
|
+
network: 0,
|
|
3592
|
+
};
|
|
3593
|
+
}
|
|
3594
|
+
export const TreeNode = {
|
|
3595
|
+
encode(message, writer = new BinaryWriter()) {
|
|
3596
|
+
if (message.id !== "") {
|
|
3597
|
+
writer.uint32(10).string(message.id);
|
|
3598
|
+
}
|
|
3599
|
+
if (message.treeId !== "") {
|
|
3600
|
+
writer.uint32(18).string(message.treeId);
|
|
3208
3601
|
}
|
|
3209
3602
|
if (message.value !== 0) {
|
|
3210
3603
|
writer.uint32(24).uint64(message.value);
|
|
@@ -3608,6 +4001,59 @@ export const SecretShare = {
|
|
|
3608
4001
|
return message;
|
|
3609
4002
|
},
|
|
3610
4003
|
};
|
|
4004
|
+
function createBaseSecretProof() {
|
|
4005
|
+
return { proofs: [] };
|
|
4006
|
+
}
|
|
4007
|
+
export const SecretProof = {
|
|
4008
|
+
encode(message, writer = new BinaryWriter()) {
|
|
4009
|
+
for (const v of message.proofs) {
|
|
4010
|
+
writer.uint32(10).bytes(v);
|
|
4011
|
+
}
|
|
4012
|
+
return writer;
|
|
4013
|
+
},
|
|
4014
|
+
decode(input, length) {
|
|
4015
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
4016
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
4017
|
+
const message = createBaseSecretProof();
|
|
4018
|
+
while (reader.pos < end) {
|
|
4019
|
+
const tag = reader.uint32();
|
|
4020
|
+
switch (tag >>> 3) {
|
|
4021
|
+
case 1: {
|
|
4022
|
+
if (tag !== 10) {
|
|
4023
|
+
break;
|
|
4024
|
+
}
|
|
4025
|
+
message.proofs.push(reader.bytes());
|
|
4026
|
+
continue;
|
|
4027
|
+
}
|
|
4028
|
+
}
|
|
4029
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
4030
|
+
break;
|
|
4031
|
+
}
|
|
4032
|
+
reader.skip(tag & 7);
|
|
4033
|
+
}
|
|
4034
|
+
return message;
|
|
4035
|
+
},
|
|
4036
|
+
fromJSON(object) {
|
|
4037
|
+
return {
|
|
4038
|
+
proofs: globalThis.Array.isArray(object?.proofs) ? object.proofs.map((e) => bytesFromBase64(e)) : [],
|
|
4039
|
+
};
|
|
4040
|
+
},
|
|
4041
|
+
toJSON(message) {
|
|
4042
|
+
const obj = {};
|
|
4043
|
+
if (message.proofs?.length) {
|
|
4044
|
+
obj.proofs = message.proofs.map((e) => base64FromBytes(e));
|
|
4045
|
+
}
|
|
4046
|
+
return obj;
|
|
4047
|
+
},
|
|
4048
|
+
create(base) {
|
|
4049
|
+
return SecretProof.fromPartial(base ?? {});
|
|
4050
|
+
},
|
|
4051
|
+
fromPartial(object) {
|
|
4052
|
+
const message = createBaseSecretProof();
|
|
4053
|
+
message.proofs = object.proofs?.map((e) => e) || [];
|
|
4054
|
+
return message;
|
|
4055
|
+
},
|
|
4056
|
+
};
|
|
3611
4057
|
function createBaseLeafRefundTxSigningJob() {
|
|
3612
4058
|
return { leafId: "", refundTxSigningJob: undefined };
|
|
3613
4059
|
}
|
|
@@ -3773,6 +4219,7 @@ function createBaseStartSendTransferRequest() {
|
|
|
3773
4219
|
leavesToSend: [],
|
|
3774
4220
|
receiverIdentityPublicKey: new Uint8Array(0),
|
|
3775
4221
|
expiryTime: undefined,
|
|
4222
|
+
keyTweakProofs: {},
|
|
3776
4223
|
};
|
|
3777
4224
|
}
|
|
3778
4225
|
export const StartSendTransferRequest = {
|
|
@@ -3792,6 +4239,9 @@ export const StartSendTransferRequest = {
|
|
|
3792
4239
|
if (message.expiryTime !== undefined) {
|
|
3793
4240
|
Timestamp.encode(toTimestamp(message.expiryTime), writer.uint32(42).fork()).join();
|
|
3794
4241
|
}
|
|
4242
|
+
Object.entries(message.keyTweakProofs).forEach(([key, value]) => {
|
|
4243
|
+
StartSendTransferRequest_KeyTweakProofsEntry.encode({ key: key, value }, writer.uint32(50).fork()).join();
|
|
4244
|
+
});
|
|
3795
4245
|
return writer;
|
|
3796
4246
|
},
|
|
3797
4247
|
decode(input, length) {
|
|
@@ -3836,6 +4286,16 @@ export const StartSendTransferRequest = {
|
|
|
3836
4286
|
message.expiryTime = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
|
|
3837
4287
|
continue;
|
|
3838
4288
|
}
|
|
4289
|
+
case 6: {
|
|
4290
|
+
if (tag !== 50) {
|
|
4291
|
+
break;
|
|
4292
|
+
}
|
|
4293
|
+
const entry6 = StartSendTransferRequest_KeyTweakProofsEntry.decode(reader, reader.uint32());
|
|
4294
|
+
if (entry6.value !== undefined) {
|
|
4295
|
+
message.keyTweakProofs[entry6.key] = entry6.value;
|
|
4296
|
+
}
|
|
4297
|
+
continue;
|
|
4298
|
+
}
|
|
3839
4299
|
}
|
|
3840
4300
|
if ((tag & 7) === 4 || tag === 0) {
|
|
3841
4301
|
break;
|
|
@@ -3857,6 +4317,12 @@ export const StartSendTransferRequest = {
|
|
|
3857
4317
|
? bytesFromBase64(object.receiverIdentityPublicKey)
|
|
3858
4318
|
: new Uint8Array(0),
|
|
3859
4319
|
expiryTime: isSet(object.expiryTime) ? fromJsonTimestamp(object.expiryTime) : undefined,
|
|
4320
|
+
keyTweakProofs: isObject(object.keyTweakProofs)
|
|
4321
|
+
? Object.entries(object.keyTweakProofs).reduce((acc, [key, value]) => {
|
|
4322
|
+
acc[key] = SecretProof.fromJSON(value);
|
|
4323
|
+
return acc;
|
|
4324
|
+
}, {})
|
|
4325
|
+
: {},
|
|
3860
4326
|
};
|
|
3861
4327
|
},
|
|
3862
4328
|
toJSON(message) {
|
|
@@ -3876,6 +4342,15 @@ export const StartSendTransferRequest = {
|
|
|
3876
4342
|
if (message.expiryTime !== undefined) {
|
|
3877
4343
|
obj.expiryTime = message.expiryTime.toISOString();
|
|
3878
4344
|
}
|
|
4345
|
+
if (message.keyTweakProofs) {
|
|
4346
|
+
const entries = Object.entries(message.keyTweakProofs);
|
|
4347
|
+
if (entries.length > 0) {
|
|
4348
|
+
obj.keyTweakProofs = {};
|
|
4349
|
+
entries.forEach(([k, v]) => {
|
|
4350
|
+
obj.keyTweakProofs[k] = SecretProof.toJSON(v);
|
|
4351
|
+
});
|
|
4352
|
+
}
|
|
4353
|
+
}
|
|
3879
4354
|
return obj;
|
|
3880
4355
|
},
|
|
3881
4356
|
create(base) {
|
|
@@ -3888,6 +4363,82 @@ export const StartSendTransferRequest = {
|
|
|
3888
4363
|
message.leavesToSend = object.leavesToSend?.map((e) => LeafRefundTxSigningJob.fromPartial(e)) || [];
|
|
3889
4364
|
message.receiverIdentityPublicKey = object.receiverIdentityPublicKey ?? new Uint8Array(0);
|
|
3890
4365
|
message.expiryTime = object.expiryTime ?? undefined;
|
|
4366
|
+
message.keyTweakProofs = Object.entries(object.keyTweakProofs ?? {}).reduce((acc, [key, value]) => {
|
|
4367
|
+
if (value !== undefined) {
|
|
4368
|
+
acc[key] = SecretProof.fromPartial(value);
|
|
4369
|
+
}
|
|
4370
|
+
return acc;
|
|
4371
|
+
}, {});
|
|
4372
|
+
return message;
|
|
4373
|
+
},
|
|
4374
|
+
};
|
|
4375
|
+
function createBaseStartSendTransferRequest_KeyTweakProofsEntry() {
|
|
4376
|
+
return { key: "", value: undefined };
|
|
4377
|
+
}
|
|
4378
|
+
export const StartSendTransferRequest_KeyTweakProofsEntry = {
|
|
4379
|
+
encode(message, writer = new BinaryWriter()) {
|
|
4380
|
+
if (message.key !== "") {
|
|
4381
|
+
writer.uint32(10).string(message.key);
|
|
4382
|
+
}
|
|
4383
|
+
if (message.value !== undefined) {
|
|
4384
|
+
SecretProof.encode(message.value, writer.uint32(18).fork()).join();
|
|
4385
|
+
}
|
|
4386
|
+
return writer;
|
|
4387
|
+
},
|
|
4388
|
+
decode(input, length) {
|
|
4389
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
4390
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
4391
|
+
const message = createBaseStartSendTransferRequest_KeyTweakProofsEntry();
|
|
4392
|
+
while (reader.pos < end) {
|
|
4393
|
+
const tag = reader.uint32();
|
|
4394
|
+
switch (tag >>> 3) {
|
|
4395
|
+
case 1: {
|
|
4396
|
+
if (tag !== 10) {
|
|
4397
|
+
break;
|
|
4398
|
+
}
|
|
4399
|
+
message.key = reader.string();
|
|
4400
|
+
continue;
|
|
4401
|
+
}
|
|
4402
|
+
case 2: {
|
|
4403
|
+
if (tag !== 18) {
|
|
4404
|
+
break;
|
|
4405
|
+
}
|
|
4406
|
+
message.value = SecretProof.decode(reader, reader.uint32());
|
|
4407
|
+
continue;
|
|
4408
|
+
}
|
|
4409
|
+
}
|
|
4410
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
4411
|
+
break;
|
|
4412
|
+
}
|
|
4413
|
+
reader.skip(tag & 7);
|
|
4414
|
+
}
|
|
4415
|
+
return message;
|
|
4416
|
+
},
|
|
4417
|
+
fromJSON(object) {
|
|
4418
|
+
return {
|
|
4419
|
+
key: isSet(object.key) ? globalThis.String(object.key) : "",
|
|
4420
|
+
value: isSet(object.value) ? SecretProof.fromJSON(object.value) : undefined,
|
|
4421
|
+
};
|
|
4422
|
+
},
|
|
4423
|
+
toJSON(message) {
|
|
4424
|
+
const obj = {};
|
|
4425
|
+
if (message.key !== "") {
|
|
4426
|
+
obj.key = message.key;
|
|
4427
|
+
}
|
|
4428
|
+
if (message.value !== undefined) {
|
|
4429
|
+
obj.value = SecretProof.toJSON(message.value);
|
|
4430
|
+
}
|
|
4431
|
+
return obj;
|
|
4432
|
+
},
|
|
4433
|
+
create(base) {
|
|
4434
|
+
return StartSendTransferRequest_KeyTweakProofsEntry.fromPartial(base ?? {});
|
|
4435
|
+
},
|
|
4436
|
+
fromPartial(object) {
|
|
4437
|
+
const message = createBaseStartSendTransferRequest_KeyTweakProofsEntry();
|
|
4438
|
+
message.key = object.key ?? "";
|
|
4439
|
+
message.value = (object.value !== undefined && object.value !== null)
|
|
4440
|
+
? SecretProof.fromPartial(object.value)
|
|
4441
|
+
: undefined;
|
|
3891
4442
|
return message;
|
|
3892
4443
|
},
|
|
3893
4444
|
};
|
|
@@ -4588,7 +5139,7 @@ export const CompleteSendTransferResponse = {
|
|
|
4588
5139
|
},
|
|
4589
5140
|
};
|
|
4590
5141
|
function createBaseQueryPendingTransfersRequest() {
|
|
4591
|
-
return { participant: undefined, transferIds: [] };
|
|
5142
|
+
return { participant: undefined, transferIds: [], network: 0 };
|
|
4592
5143
|
}
|
|
4593
5144
|
export const QueryPendingTransfersRequest = {
|
|
4594
5145
|
encode(message, writer = new BinaryWriter()) {
|
|
@@ -4603,6 +5154,9 @@ export const QueryPendingTransfersRequest = {
|
|
|
4603
5154
|
for (const v of message.transferIds) {
|
|
4604
5155
|
writer.uint32(26).string(v);
|
|
4605
5156
|
}
|
|
5157
|
+
if (message.network !== 0) {
|
|
5158
|
+
writer.uint32(32).int32(message.network);
|
|
5159
|
+
}
|
|
4606
5160
|
return writer;
|
|
4607
5161
|
},
|
|
4608
5162
|
decode(input, length) {
|
|
@@ -4633,6 +5187,13 @@ export const QueryPendingTransfersRequest = {
|
|
|
4633
5187
|
message.transferIds.push(reader.string());
|
|
4634
5188
|
continue;
|
|
4635
5189
|
}
|
|
5190
|
+
case 4: {
|
|
5191
|
+
if (tag !== 32) {
|
|
5192
|
+
break;
|
|
5193
|
+
}
|
|
5194
|
+
message.network = reader.int32();
|
|
5195
|
+
continue;
|
|
5196
|
+
}
|
|
4636
5197
|
}
|
|
4637
5198
|
if ((tag & 7) === 4 || tag === 0) {
|
|
4638
5199
|
break;
|
|
@@ -4654,6 +5215,7 @@ export const QueryPendingTransfersRequest = {
|
|
|
4654
5215
|
transferIds: globalThis.Array.isArray(object?.transferIds)
|
|
4655
5216
|
? object.transferIds.map((e) => globalThis.String(e))
|
|
4656
5217
|
: [],
|
|
5218
|
+
network: isSet(object.network) ? networkFromJSON(object.network) : 0,
|
|
4657
5219
|
};
|
|
4658
5220
|
},
|
|
4659
5221
|
toJSON(message) {
|
|
@@ -4667,6 +5229,9 @@ export const QueryPendingTransfersRequest = {
|
|
|
4667
5229
|
if (message.transferIds?.length) {
|
|
4668
5230
|
obj.transferIds = message.transferIds;
|
|
4669
5231
|
}
|
|
5232
|
+
if (message.network !== 0) {
|
|
5233
|
+
obj.network = networkToJSON(message.network);
|
|
5234
|
+
}
|
|
4670
5235
|
return obj;
|
|
4671
5236
|
},
|
|
4672
5237
|
create(base) {
|
|
@@ -4697,6 +5262,7 @@ export const QueryPendingTransfersRequest = {
|
|
|
4697
5262
|
}
|
|
4698
5263
|
}
|
|
4699
5264
|
message.transferIds = object.transferIds?.map((e) => e) || [];
|
|
5265
|
+
message.network = object.network ?? 0;
|
|
4700
5266
|
return message;
|
|
4701
5267
|
},
|
|
4702
5268
|
};
|
|
@@ -5015,7 +5581,7 @@ export const ClaimTransferTweakKeysRequest = {
|
|
|
5015
5581
|
},
|
|
5016
5582
|
};
|
|
5017
5583
|
function createBaseClaimTransferSignRefundsRequest() {
|
|
5018
|
-
return { transferId: "", ownerIdentityPublicKey: new Uint8Array(0), signingJobs: [] };
|
|
5584
|
+
return { transferId: "", ownerIdentityPublicKey: new Uint8Array(0), signingJobs: [], keyTweakProofs: {} };
|
|
5019
5585
|
}
|
|
5020
5586
|
export const ClaimTransferSignRefundsRequest = {
|
|
5021
5587
|
encode(message, writer = new BinaryWriter()) {
|
|
@@ -5028,6 +5594,10 @@ export const ClaimTransferSignRefundsRequest = {
|
|
|
5028
5594
|
for (const v of message.signingJobs) {
|
|
5029
5595
|
LeafRefundTxSigningJob.encode(v, writer.uint32(26).fork()).join();
|
|
5030
5596
|
}
|
|
5597
|
+
Object.entries(message.keyTweakProofs).forEach(([key, value]) => {
|
|
5598
|
+
ClaimTransferSignRefundsRequest_KeyTweakProofsEntry.encode({ key: key, value }, writer.uint32(34).fork())
|
|
5599
|
+
.join();
|
|
5600
|
+
});
|
|
5031
5601
|
return writer;
|
|
5032
5602
|
},
|
|
5033
5603
|
decode(input, length) {
|
|
@@ -5055,7 +5625,115 @@ export const ClaimTransferSignRefundsRequest = {
|
|
|
5055
5625
|
if (tag !== 26) {
|
|
5056
5626
|
break;
|
|
5057
5627
|
}
|
|
5058
|
-
message.signingJobs.push(LeafRefundTxSigningJob.decode(reader, reader.uint32()));
|
|
5628
|
+
message.signingJobs.push(LeafRefundTxSigningJob.decode(reader, reader.uint32()));
|
|
5629
|
+
continue;
|
|
5630
|
+
}
|
|
5631
|
+
case 4: {
|
|
5632
|
+
if (tag !== 34) {
|
|
5633
|
+
break;
|
|
5634
|
+
}
|
|
5635
|
+
const entry4 = ClaimTransferSignRefundsRequest_KeyTweakProofsEntry.decode(reader, reader.uint32());
|
|
5636
|
+
if (entry4.value !== undefined) {
|
|
5637
|
+
message.keyTweakProofs[entry4.key] = entry4.value;
|
|
5638
|
+
}
|
|
5639
|
+
continue;
|
|
5640
|
+
}
|
|
5641
|
+
}
|
|
5642
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
5643
|
+
break;
|
|
5644
|
+
}
|
|
5645
|
+
reader.skip(tag & 7);
|
|
5646
|
+
}
|
|
5647
|
+
return message;
|
|
5648
|
+
},
|
|
5649
|
+
fromJSON(object) {
|
|
5650
|
+
return {
|
|
5651
|
+
transferId: isSet(object.transferId) ? globalThis.String(object.transferId) : "",
|
|
5652
|
+
ownerIdentityPublicKey: isSet(object.ownerIdentityPublicKey)
|
|
5653
|
+
? bytesFromBase64(object.ownerIdentityPublicKey)
|
|
5654
|
+
: new Uint8Array(0),
|
|
5655
|
+
signingJobs: globalThis.Array.isArray(object?.signingJobs)
|
|
5656
|
+
? object.signingJobs.map((e) => LeafRefundTxSigningJob.fromJSON(e))
|
|
5657
|
+
: [],
|
|
5658
|
+
keyTweakProofs: isObject(object.keyTweakProofs)
|
|
5659
|
+
? Object.entries(object.keyTweakProofs).reduce((acc, [key, value]) => {
|
|
5660
|
+
acc[key] = SecretProof.fromJSON(value);
|
|
5661
|
+
return acc;
|
|
5662
|
+
}, {})
|
|
5663
|
+
: {},
|
|
5664
|
+
};
|
|
5665
|
+
},
|
|
5666
|
+
toJSON(message) {
|
|
5667
|
+
const obj = {};
|
|
5668
|
+
if (message.transferId !== "") {
|
|
5669
|
+
obj.transferId = message.transferId;
|
|
5670
|
+
}
|
|
5671
|
+
if (message.ownerIdentityPublicKey.length !== 0) {
|
|
5672
|
+
obj.ownerIdentityPublicKey = base64FromBytes(message.ownerIdentityPublicKey);
|
|
5673
|
+
}
|
|
5674
|
+
if (message.signingJobs?.length) {
|
|
5675
|
+
obj.signingJobs = message.signingJobs.map((e) => LeafRefundTxSigningJob.toJSON(e));
|
|
5676
|
+
}
|
|
5677
|
+
if (message.keyTweakProofs) {
|
|
5678
|
+
const entries = Object.entries(message.keyTweakProofs);
|
|
5679
|
+
if (entries.length > 0) {
|
|
5680
|
+
obj.keyTweakProofs = {};
|
|
5681
|
+
entries.forEach(([k, v]) => {
|
|
5682
|
+
obj.keyTweakProofs[k] = SecretProof.toJSON(v);
|
|
5683
|
+
});
|
|
5684
|
+
}
|
|
5685
|
+
}
|
|
5686
|
+
return obj;
|
|
5687
|
+
},
|
|
5688
|
+
create(base) {
|
|
5689
|
+
return ClaimTransferSignRefundsRequest.fromPartial(base ?? {});
|
|
5690
|
+
},
|
|
5691
|
+
fromPartial(object) {
|
|
5692
|
+
const message = createBaseClaimTransferSignRefundsRequest();
|
|
5693
|
+
message.transferId = object.transferId ?? "";
|
|
5694
|
+
message.ownerIdentityPublicKey = object.ownerIdentityPublicKey ?? new Uint8Array(0);
|
|
5695
|
+
message.signingJobs = object.signingJobs?.map((e) => LeafRefundTxSigningJob.fromPartial(e)) || [];
|
|
5696
|
+
message.keyTweakProofs = Object.entries(object.keyTweakProofs ?? {}).reduce((acc, [key, value]) => {
|
|
5697
|
+
if (value !== undefined) {
|
|
5698
|
+
acc[key] = SecretProof.fromPartial(value);
|
|
5699
|
+
}
|
|
5700
|
+
return acc;
|
|
5701
|
+
}, {});
|
|
5702
|
+
return message;
|
|
5703
|
+
},
|
|
5704
|
+
};
|
|
5705
|
+
function createBaseClaimTransferSignRefundsRequest_KeyTweakProofsEntry() {
|
|
5706
|
+
return { key: "", value: undefined };
|
|
5707
|
+
}
|
|
5708
|
+
export const ClaimTransferSignRefundsRequest_KeyTweakProofsEntry = {
|
|
5709
|
+
encode(message, writer = new BinaryWriter()) {
|
|
5710
|
+
if (message.key !== "") {
|
|
5711
|
+
writer.uint32(10).string(message.key);
|
|
5712
|
+
}
|
|
5713
|
+
if (message.value !== undefined) {
|
|
5714
|
+
SecretProof.encode(message.value, writer.uint32(18).fork()).join();
|
|
5715
|
+
}
|
|
5716
|
+
return writer;
|
|
5717
|
+
},
|
|
5718
|
+
decode(input, length) {
|
|
5719
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
5720
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
5721
|
+
const message = createBaseClaimTransferSignRefundsRequest_KeyTweakProofsEntry();
|
|
5722
|
+
while (reader.pos < end) {
|
|
5723
|
+
const tag = reader.uint32();
|
|
5724
|
+
switch (tag >>> 3) {
|
|
5725
|
+
case 1: {
|
|
5726
|
+
if (tag !== 10) {
|
|
5727
|
+
break;
|
|
5728
|
+
}
|
|
5729
|
+
message.key = reader.string();
|
|
5730
|
+
continue;
|
|
5731
|
+
}
|
|
5732
|
+
case 2: {
|
|
5733
|
+
if (tag !== 18) {
|
|
5734
|
+
break;
|
|
5735
|
+
}
|
|
5736
|
+
message.value = SecretProof.decode(reader, reader.uint32());
|
|
5059
5737
|
continue;
|
|
5060
5738
|
}
|
|
5061
5739
|
}
|
|
@@ -5068,36 +5746,29 @@ export const ClaimTransferSignRefundsRequest = {
|
|
|
5068
5746
|
},
|
|
5069
5747
|
fromJSON(object) {
|
|
5070
5748
|
return {
|
|
5071
|
-
|
|
5072
|
-
|
|
5073
|
-
? bytesFromBase64(object.ownerIdentityPublicKey)
|
|
5074
|
-
: new Uint8Array(0),
|
|
5075
|
-
signingJobs: globalThis.Array.isArray(object?.signingJobs)
|
|
5076
|
-
? object.signingJobs.map((e) => LeafRefundTxSigningJob.fromJSON(e))
|
|
5077
|
-
: [],
|
|
5749
|
+
key: isSet(object.key) ? globalThis.String(object.key) : "",
|
|
5750
|
+
value: isSet(object.value) ? SecretProof.fromJSON(object.value) : undefined,
|
|
5078
5751
|
};
|
|
5079
5752
|
},
|
|
5080
5753
|
toJSON(message) {
|
|
5081
5754
|
const obj = {};
|
|
5082
|
-
if (message.
|
|
5083
|
-
obj.
|
|
5084
|
-
}
|
|
5085
|
-
if (message.ownerIdentityPublicKey.length !== 0) {
|
|
5086
|
-
obj.ownerIdentityPublicKey = base64FromBytes(message.ownerIdentityPublicKey);
|
|
5755
|
+
if (message.key !== "") {
|
|
5756
|
+
obj.key = message.key;
|
|
5087
5757
|
}
|
|
5088
|
-
if (message.
|
|
5089
|
-
obj.
|
|
5758
|
+
if (message.value !== undefined) {
|
|
5759
|
+
obj.value = SecretProof.toJSON(message.value);
|
|
5090
5760
|
}
|
|
5091
5761
|
return obj;
|
|
5092
5762
|
},
|
|
5093
5763
|
create(base) {
|
|
5094
|
-
return
|
|
5764
|
+
return ClaimTransferSignRefundsRequest_KeyTweakProofsEntry.fromPartial(base ?? {});
|
|
5095
5765
|
},
|
|
5096
5766
|
fromPartial(object) {
|
|
5097
|
-
const message =
|
|
5098
|
-
message.
|
|
5099
|
-
message.
|
|
5100
|
-
|
|
5767
|
+
const message = createBaseClaimTransferSignRefundsRequest_KeyTweakProofsEntry();
|
|
5768
|
+
message.key = object.key ?? "";
|
|
5769
|
+
message.value = (object.value !== undefined && object.value !== null)
|
|
5770
|
+
? SecretProof.fromPartial(object.value)
|
|
5771
|
+
: undefined;
|
|
5101
5772
|
return message;
|
|
5102
5773
|
},
|
|
5103
5774
|
};
|
|
@@ -5873,6 +6544,7 @@ function createBaseUserSignedRefund() {
|
|
|
5873
6544
|
userSignature: new Uint8Array(0),
|
|
5874
6545
|
signingCommitments: undefined,
|
|
5875
6546
|
userSignatureCommitment: undefined,
|
|
6547
|
+
network: 0,
|
|
5876
6548
|
};
|
|
5877
6549
|
}
|
|
5878
6550
|
export const UserSignedRefund = {
|
|
@@ -5892,6 +6564,9 @@ export const UserSignedRefund = {
|
|
|
5892
6564
|
if (message.userSignatureCommitment !== undefined) {
|
|
5893
6565
|
SigningCommitment.encode(message.userSignatureCommitment, writer.uint32(42).fork()).join();
|
|
5894
6566
|
}
|
|
6567
|
+
if (message.network !== 0) {
|
|
6568
|
+
writer.uint32(48).int32(message.network);
|
|
6569
|
+
}
|
|
5895
6570
|
return writer;
|
|
5896
6571
|
},
|
|
5897
6572
|
decode(input, length) {
|
|
@@ -5936,6 +6611,13 @@ export const UserSignedRefund = {
|
|
|
5936
6611
|
message.userSignatureCommitment = SigningCommitment.decode(reader, reader.uint32());
|
|
5937
6612
|
continue;
|
|
5938
6613
|
}
|
|
6614
|
+
case 6: {
|
|
6615
|
+
if (tag !== 48) {
|
|
6616
|
+
break;
|
|
6617
|
+
}
|
|
6618
|
+
message.network = reader.int32();
|
|
6619
|
+
continue;
|
|
6620
|
+
}
|
|
5939
6621
|
}
|
|
5940
6622
|
if ((tag & 7) === 4 || tag === 0) {
|
|
5941
6623
|
break;
|
|
@@ -5955,6 +6637,7 @@ export const UserSignedRefund = {
|
|
|
5955
6637
|
userSignatureCommitment: isSet(object.userSignatureCommitment)
|
|
5956
6638
|
? SigningCommitment.fromJSON(object.userSignatureCommitment)
|
|
5957
6639
|
: undefined,
|
|
6640
|
+
network: isSet(object.network) ? networkFromJSON(object.network) : 0,
|
|
5958
6641
|
};
|
|
5959
6642
|
},
|
|
5960
6643
|
toJSON(message) {
|
|
@@ -5974,6 +6657,9 @@ export const UserSignedRefund = {
|
|
|
5974
6657
|
if (message.userSignatureCommitment !== undefined) {
|
|
5975
6658
|
obj.userSignatureCommitment = SigningCommitment.toJSON(message.userSignatureCommitment);
|
|
5976
6659
|
}
|
|
6660
|
+
if (message.network !== 0) {
|
|
6661
|
+
obj.network = networkToJSON(message.network);
|
|
6662
|
+
}
|
|
5977
6663
|
return obj;
|
|
5978
6664
|
},
|
|
5979
6665
|
create(base) {
|
|
@@ -5991,6 +6677,7 @@ export const UserSignedRefund = {
|
|
|
5991
6677
|
(object.userSignatureCommitment !== undefined && object.userSignatureCommitment !== null)
|
|
5992
6678
|
? SigningCommitment.fromPartial(object.userSignatureCommitment)
|
|
5993
6679
|
: undefined;
|
|
6680
|
+
message.network = object.network ?? 0;
|
|
5994
6681
|
return message;
|
|
5995
6682
|
},
|
|
5996
6683
|
};
|
|
@@ -8529,7 +9216,7 @@ export const TreeNodeIds = {
|
|
|
8529
9216
|
},
|
|
8530
9217
|
};
|
|
8531
9218
|
function createBaseQueryNodesRequest() {
|
|
8532
|
-
return { source: undefined, includeParents: false };
|
|
9219
|
+
return { source: undefined, includeParents: false, network: 0 };
|
|
8533
9220
|
}
|
|
8534
9221
|
export const QueryNodesRequest = {
|
|
8535
9222
|
encode(message, writer = new BinaryWriter()) {
|
|
@@ -8544,6 +9231,9 @@ export const QueryNodesRequest = {
|
|
|
8544
9231
|
if (message.includeParents !== false) {
|
|
8545
9232
|
writer.uint32(24).bool(message.includeParents);
|
|
8546
9233
|
}
|
|
9234
|
+
if (message.network !== 0) {
|
|
9235
|
+
writer.uint32(32).int32(message.network);
|
|
9236
|
+
}
|
|
8547
9237
|
return writer;
|
|
8548
9238
|
},
|
|
8549
9239
|
decode(input, length) {
|
|
@@ -8574,6 +9264,13 @@ export const QueryNodesRequest = {
|
|
|
8574
9264
|
message.includeParents = reader.bool();
|
|
8575
9265
|
continue;
|
|
8576
9266
|
}
|
|
9267
|
+
case 4: {
|
|
9268
|
+
if (tag !== 32) {
|
|
9269
|
+
break;
|
|
9270
|
+
}
|
|
9271
|
+
message.network = reader.int32();
|
|
9272
|
+
continue;
|
|
9273
|
+
}
|
|
8577
9274
|
}
|
|
8578
9275
|
if ((tag & 7) === 4 || tag === 0) {
|
|
8579
9276
|
break;
|
|
@@ -8590,6 +9287,7 @@ export const QueryNodesRequest = {
|
|
|
8590
9287
|
? { $case: "nodeIds", nodeIds: TreeNodeIds.fromJSON(object.nodeIds) }
|
|
8591
9288
|
: undefined,
|
|
8592
9289
|
includeParents: isSet(object.includeParents) ? globalThis.Boolean(object.includeParents) : false,
|
|
9290
|
+
network: isSet(object.network) ? networkFromJSON(object.network) : 0,
|
|
8593
9291
|
};
|
|
8594
9292
|
},
|
|
8595
9293
|
toJSON(message) {
|
|
@@ -8603,6 +9301,9 @@ export const QueryNodesRequest = {
|
|
|
8603
9301
|
if (message.includeParents !== false) {
|
|
8604
9302
|
obj.includeParents = message.includeParents;
|
|
8605
9303
|
}
|
|
9304
|
+
if (message.network !== 0) {
|
|
9305
|
+
obj.network = networkToJSON(message.network);
|
|
9306
|
+
}
|
|
8606
9307
|
return obj;
|
|
8607
9308
|
},
|
|
8608
9309
|
create(base) {
|
|
@@ -8625,6 +9326,7 @@ export const QueryNodesRequest = {
|
|
|
8625
9326
|
}
|
|
8626
9327
|
}
|
|
8627
9328
|
message.includeParents = object.includeParents ?? false;
|
|
9329
|
+
message.network = object.network ?? 0;
|
|
8628
9330
|
return message;
|
|
8629
9331
|
},
|
|
8630
9332
|
};
|
|
@@ -9245,6 +9947,231 @@ export const QueryUnusedDepositAddressesResponse = {
|
|
|
9245
9947
|
return message;
|
|
9246
9948
|
},
|
|
9247
9949
|
};
|
|
9950
|
+
function createBaseQueryBalanceRequest() {
|
|
9951
|
+
return { identityPublicKey: new Uint8Array(0), network: 0 };
|
|
9952
|
+
}
|
|
9953
|
+
export const QueryBalanceRequest = {
|
|
9954
|
+
encode(message, writer = new BinaryWriter()) {
|
|
9955
|
+
if (message.identityPublicKey.length !== 0) {
|
|
9956
|
+
writer.uint32(10).bytes(message.identityPublicKey);
|
|
9957
|
+
}
|
|
9958
|
+
if (message.network !== 0) {
|
|
9959
|
+
writer.uint32(16).int32(message.network);
|
|
9960
|
+
}
|
|
9961
|
+
return writer;
|
|
9962
|
+
},
|
|
9963
|
+
decode(input, length) {
|
|
9964
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
9965
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
9966
|
+
const message = createBaseQueryBalanceRequest();
|
|
9967
|
+
while (reader.pos < end) {
|
|
9968
|
+
const tag = reader.uint32();
|
|
9969
|
+
switch (tag >>> 3) {
|
|
9970
|
+
case 1: {
|
|
9971
|
+
if (tag !== 10) {
|
|
9972
|
+
break;
|
|
9973
|
+
}
|
|
9974
|
+
message.identityPublicKey = reader.bytes();
|
|
9975
|
+
continue;
|
|
9976
|
+
}
|
|
9977
|
+
case 2: {
|
|
9978
|
+
if (tag !== 16) {
|
|
9979
|
+
break;
|
|
9980
|
+
}
|
|
9981
|
+
message.network = reader.int32();
|
|
9982
|
+
continue;
|
|
9983
|
+
}
|
|
9984
|
+
}
|
|
9985
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
9986
|
+
break;
|
|
9987
|
+
}
|
|
9988
|
+
reader.skip(tag & 7);
|
|
9989
|
+
}
|
|
9990
|
+
return message;
|
|
9991
|
+
},
|
|
9992
|
+
fromJSON(object) {
|
|
9993
|
+
return {
|
|
9994
|
+
identityPublicKey: isSet(object.identityPublicKey)
|
|
9995
|
+
? bytesFromBase64(object.identityPublicKey)
|
|
9996
|
+
: new Uint8Array(0),
|
|
9997
|
+
network: isSet(object.network) ? networkFromJSON(object.network) : 0,
|
|
9998
|
+
};
|
|
9999
|
+
},
|
|
10000
|
+
toJSON(message) {
|
|
10001
|
+
const obj = {};
|
|
10002
|
+
if (message.identityPublicKey.length !== 0) {
|
|
10003
|
+
obj.identityPublicKey = base64FromBytes(message.identityPublicKey);
|
|
10004
|
+
}
|
|
10005
|
+
if (message.network !== 0) {
|
|
10006
|
+
obj.network = networkToJSON(message.network);
|
|
10007
|
+
}
|
|
10008
|
+
return obj;
|
|
10009
|
+
},
|
|
10010
|
+
create(base) {
|
|
10011
|
+
return QueryBalanceRequest.fromPartial(base ?? {});
|
|
10012
|
+
},
|
|
10013
|
+
fromPartial(object) {
|
|
10014
|
+
const message = createBaseQueryBalanceRequest();
|
|
10015
|
+
message.identityPublicKey = object.identityPublicKey ?? new Uint8Array(0);
|
|
10016
|
+
message.network = object.network ?? 0;
|
|
10017
|
+
return message;
|
|
10018
|
+
},
|
|
10019
|
+
};
|
|
10020
|
+
function createBaseQueryBalanceResponse() {
|
|
10021
|
+
return { balance: 0, nodeBalances: {} };
|
|
10022
|
+
}
|
|
10023
|
+
export const QueryBalanceResponse = {
|
|
10024
|
+
encode(message, writer = new BinaryWriter()) {
|
|
10025
|
+
if (message.balance !== 0) {
|
|
10026
|
+
writer.uint32(8).uint64(message.balance);
|
|
10027
|
+
}
|
|
10028
|
+
Object.entries(message.nodeBalances).forEach(([key, value]) => {
|
|
10029
|
+
QueryBalanceResponse_NodeBalancesEntry.encode({ key: key, value }, writer.uint32(18).fork()).join();
|
|
10030
|
+
});
|
|
10031
|
+
return writer;
|
|
10032
|
+
},
|
|
10033
|
+
decode(input, length) {
|
|
10034
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
10035
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
10036
|
+
const message = createBaseQueryBalanceResponse();
|
|
10037
|
+
while (reader.pos < end) {
|
|
10038
|
+
const tag = reader.uint32();
|
|
10039
|
+
switch (tag >>> 3) {
|
|
10040
|
+
case 1: {
|
|
10041
|
+
if (tag !== 8) {
|
|
10042
|
+
break;
|
|
10043
|
+
}
|
|
10044
|
+
message.balance = longToNumber(reader.uint64());
|
|
10045
|
+
continue;
|
|
10046
|
+
}
|
|
10047
|
+
case 2: {
|
|
10048
|
+
if (tag !== 18) {
|
|
10049
|
+
break;
|
|
10050
|
+
}
|
|
10051
|
+
const entry2 = QueryBalanceResponse_NodeBalancesEntry.decode(reader, reader.uint32());
|
|
10052
|
+
if (entry2.value !== undefined) {
|
|
10053
|
+
message.nodeBalances[entry2.key] = entry2.value;
|
|
10054
|
+
}
|
|
10055
|
+
continue;
|
|
10056
|
+
}
|
|
10057
|
+
}
|
|
10058
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
10059
|
+
break;
|
|
10060
|
+
}
|
|
10061
|
+
reader.skip(tag & 7);
|
|
10062
|
+
}
|
|
10063
|
+
return message;
|
|
10064
|
+
},
|
|
10065
|
+
fromJSON(object) {
|
|
10066
|
+
return {
|
|
10067
|
+
balance: isSet(object.balance) ? globalThis.Number(object.balance) : 0,
|
|
10068
|
+
nodeBalances: isObject(object.nodeBalances)
|
|
10069
|
+
? Object.entries(object.nodeBalances).reduce((acc, [key, value]) => {
|
|
10070
|
+
acc[key] = Number(value);
|
|
10071
|
+
return acc;
|
|
10072
|
+
}, {})
|
|
10073
|
+
: {},
|
|
10074
|
+
};
|
|
10075
|
+
},
|
|
10076
|
+
toJSON(message) {
|
|
10077
|
+
const obj = {};
|
|
10078
|
+
if (message.balance !== 0) {
|
|
10079
|
+
obj.balance = Math.round(message.balance);
|
|
10080
|
+
}
|
|
10081
|
+
if (message.nodeBalances) {
|
|
10082
|
+
const entries = Object.entries(message.nodeBalances);
|
|
10083
|
+
if (entries.length > 0) {
|
|
10084
|
+
obj.nodeBalances = {};
|
|
10085
|
+
entries.forEach(([k, v]) => {
|
|
10086
|
+
obj.nodeBalances[k] = Math.round(v);
|
|
10087
|
+
});
|
|
10088
|
+
}
|
|
10089
|
+
}
|
|
10090
|
+
return obj;
|
|
10091
|
+
},
|
|
10092
|
+
create(base) {
|
|
10093
|
+
return QueryBalanceResponse.fromPartial(base ?? {});
|
|
10094
|
+
},
|
|
10095
|
+
fromPartial(object) {
|
|
10096
|
+
const message = createBaseQueryBalanceResponse();
|
|
10097
|
+
message.balance = object.balance ?? 0;
|
|
10098
|
+
message.nodeBalances = Object.entries(object.nodeBalances ?? {}).reduce((acc, [key, value]) => {
|
|
10099
|
+
if (value !== undefined) {
|
|
10100
|
+
acc[key] = globalThis.Number(value);
|
|
10101
|
+
}
|
|
10102
|
+
return acc;
|
|
10103
|
+
}, {});
|
|
10104
|
+
return message;
|
|
10105
|
+
},
|
|
10106
|
+
};
|
|
10107
|
+
function createBaseQueryBalanceResponse_NodeBalancesEntry() {
|
|
10108
|
+
return { key: "", value: 0 };
|
|
10109
|
+
}
|
|
10110
|
+
export const QueryBalanceResponse_NodeBalancesEntry = {
|
|
10111
|
+
encode(message, writer = new BinaryWriter()) {
|
|
10112
|
+
if (message.key !== "") {
|
|
10113
|
+
writer.uint32(10).string(message.key);
|
|
10114
|
+
}
|
|
10115
|
+
if (message.value !== 0) {
|
|
10116
|
+
writer.uint32(16).uint64(message.value);
|
|
10117
|
+
}
|
|
10118
|
+
return writer;
|
|
10119
|
+
},
|
|
10120
|
+
decode(input, length) {
|
|
10121
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
10122
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
10123
|
+
const message = createBaseQueryBalanceResponse_NodeBalancesEntry();
|
|
10124
|
+
while (reader.pos < end) {
|
|
10125
|
+
const tag = reader.uint32();
|
|
10126
|
+
switch (tag >>> 3) {
|
|
10127
|
+
case 1: {
|
|
10128
|
+
if (tag !== 10) {
|
|
10129
|
+
break;
|
|
10130
|
+
}
|
|
10131
|
+
message.key = reader.string();
|
|
10132
|
+
continue;
|
|
10133
|
+
}
|
|
10134
|
+
case 2: {
|
|
10135
|
+
if (tag !== 16) {
|
|
10136
|
+
break;
|
|
10137
|
+
}
|
|
10138
|
+
message.value = longToNumber(reader.uint64());
|
|
10139
|
+
continue;
|
|
10140
|
+
}
|
|
10141
|
+
}
|
|
10142
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
10143
|
+
break;
|
|
10144
|
+
}
|
|
10145
|
+
reader.skip(tag & 7);
|
|
10146
|
+
}
|
|
10147
|
+
return message;
|
|
10148
|
+
},
|
|
10149
|
+
fromJSON(object) {
|
|
10150
|
+
return {
|
|
10151
|
+
key: isSet(object.key) ? globalThis.String(object.key) : "",
|
|
10152
|
+
value: isSet(object.value) ? globalThis.Number(object.value) : 0,
|
|
10153
|
+
};
|
|
10154
|
+
},
|
|
10155
|
+
toJSON(message) {
|
|
10156
|
+
const obj = {};
|
|
10157
|
+
if (message.key !== "") {
|
|
10158
|
+
obj.key = message.key;
|
|
10159
|
+
}
|
|
10160
|
+
if (message.value !== 0) {
|
|
10161
|
+
obj.value = Math.round(message.value);
|
|
10162
|
+
}
|
|
10163
|
+
return obj;
|
|
10164
|
+
},
|
|
10165
|
+
create(base) {
|
|
10166
|
+
return QueryBalanceResponse_NodeBalancesEntry.fromPartial(base ?? {});
|
|
10167
|
+
},
|
|
10168
|
+
fromPartial(object) {
|
|
10169
|
+
const message = createBaseQueryBalanceResponse_NodeBalancesEntry();
|
|
10170
|
+
message.key = object.key ?? "";
|
|
10171
|
+
message.value = object.value ?? 0;
|
|
10172
|
+
return message;
|
|
10173
|
+
},
|
|
10174
|
+
};
|
|
9248
10175
|
export const SparkServiceDefinition = {
|
|
9249
10176
|
name: "SparkService",
|
|
9250
10177
|
fullName: "spark.SparkService",
|
|
@@ -9425,6 +10352,14 @@ export const SparkServiceDefinition = {
|
|
|
9425
10352
|
responseStream: false,
|
|
9426
10353
|
options: {},
|
|
9427
10354
|
},
|
|
10355
|
+
query_balance: {
|
|
10356
|
+
name: "query_balance",
|
|
10357
|
+
requestType: QueryBalanceRequest,
|
|
10358
|
+
requestStream: false,
|
|
10359
|
+
responseType: QueryBalanceResponse,
|
|
10360
|
+
responseStream: false,
|
|
10361
|
+
options: {},
|
|
10362
|
+
},
|
|
9428
10363
|
query_user_signed_refunds: {
|
|
9429
10364
|
name: "query_user_signed_refunds",
|
|
9430
10365
|
requestType: QueryUserSignedRefundsRequest,
|
|
@@ -9474,6 +10409,22 @@ export const SparkServiceDefinition = {
|
|
|
9474
10409
|
responseStream: false,
|
|
9475
10410
|
options: {},
|
|
9476
10411
|
},
|
|
10412
|
+
query_token_transactions: {
|
|
10413
|
+
name: "query_token_transactions",
|
|
10414
|
+
requestType: QueryTokenTransactionsRequest,
|
|
10415
|
+
requestStream: false,
|
|
10416
|
+
responseType: QueryTokenTransactionsResponse,
|
|
10417
|
+
responseStream: false,
|
|
10418
|
+
options: {},
|
|
10419
|
+
},
|
|
10420
|
+
cancel_signed_token_transaction: {
|
|
10421
|
+
name: "cancel_signed_token_transaction",
|
|
10422
|
+
requestType: CancelSignedTokenTransactionRequest,
|
|
10423
|
+
requestStream: false,
|
|
10424
|
+
responseType: Empty,
|
|
10425
|
+
responseStream: false,
|
|
10426
|
+
options: {},
|
|
10427
|
+
},
|
|
9477
10428
|
return_lightning_payment: {
|
|
9478
10429
|
name: "return_lightning_payment",
|
|
9479
10430
|
requestType: ReturnLightningPaymentRequest,
|