@buildonspark/spark-sdk 0.1.35 → 0.1.37
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 +15 -0
- package/dist/{RequestLightningSendInput-BtR12ZlP.d.cts → RequestLightningSendInput-39_zGri6.d.cts} +1 -1
- package/dist/{RequestLightningSendInput-Dfx7JYWT.d.ts → RequestLightningSendInput-B4JdzclX.d.ts} +1 -1
- package/dist/address/index.cjs +7 -2
- package/dist/address/index.d.cts +2 -2
- package/dist/address/index.d.ts +2 -2
- package/dist/address/index.js +3 -3
- package/dist/{chunk-5IXRSN47.js → chunk-2CDJZQN4.js} +1 -1
- package/dist/{chunk-YQBZR7YC.js → chunk-A74XSEW3.js} +1 -1
- package/dist/{chunk-PZRENZXV.js → chunk-C5LTJBI7.js} +215 -6
- package/dist/{chunk-B2CHXWG6.js → chunk-FWQPAPXK.js} +2 -2
- package/dist/{chunk-EVTP3LXL.js → chunk-I4JI6TYN.js} +2 -2
- package/dist/{chunk-74S7NOHT.js → chunk-MVRQ5US7.js} +7 -2
- package/dist/{chunk-UDT7KKB6.js → chunk-NS4UZRQ7.js} +1 -1
- package/dist/{chunk-W7N2ABBH.js → chunk-RAPBVYJY.js} +7 -12
- package/dist/{chunk-7TM6XZIQ.js → chunk-RULOY5WX.js} +2 -2
- package/dist/{chunk-3FT662ZE.js → chunk-RZDD6X5A.js} +143 -68
- package/dist/{chunk-C4URKX6J.js → chunk-YWFZ5ECA.js} +1 -1
- package/dist/graphql/objects/index.cjs +7 -2
- package/dist/graphql/objects/index.d.cts +4 -4
- package/dist/graphql/objects/index.d.ts +4 -4
- package/dist/graphql/objects/index.js +1 -1
- package/dist/{index-BBzdQhqB.d.ts → index-CxAi2L8y.d.ts} +10 -8
- package/dist/{index-D-We3A27.d.cts → index-Dm17Ggfe.d.cts} +10 -8
- package/dist/index.cjs +365 -85
- package/dist/index.d.cts +6 -6
- package/dist/index.d.ts +6 -6
- package/dist/index.js +11 -11
- package/dist/index.node.cjs +365 -85
- package/dist/index.node.d.cts +7 -7
- package/dist/index.node.d.ts +7 -7
- package/dist/index.node.js +11 -11
- package/dist/native/chunk-C3WN3D4O.js +19 -0
- package/dist/native/index.cjs +365 -85
- package/dist/native/index.d.cts +16 -4
- package/dist/native/index.d.ts +16 -4
- package/dist/native/index.js +363 -88
- package/dist/native/{wasm-A6KGFTNV.js → wasm-PZWVEGEE.js} +1 -1
- package/dist/native/{xhr-transport-TERT4PBA.js → xhr-transport-WHMS3FGG.js} +1 -1
- package/dist/{network-Bc-W9qLR.d.ts → network-DobHpaV6.d.ts} +1 -1
- package/dist/{network-Dbxfi7Tp.d.cts → network-GFGEHkS4.d.cts} +1 -1
- package/dist/proto/lrc20.cjs +7 -2
- package/dist/proto/lrc20.d.cts +1 -1
- package/dist/proto/lrc20.d.ts +1 -1
- package/dist/proto/lrc20.js +3 -3
- package/dist/proto/spark.cjs +221 -7
- package/dist/proto/spark.d.cts +1 -1
- package/dist/proto/spark.d.ts +1 -1
- package/dist/proto/spark.js +6 -2
- package/dist/{sdk-types-BZhxaXMN.d.ts → sdk-types-BeI6DM_M.d.ts} +1 -1
- package/dist/{sdk-types-BPwagWYa.d.cts → sdk-types-BuVMn2rX.d.cts} +1 -1
- package/dist/services/config.cjs +17 -17
- package/dist/services/config.d.cts +4 -4
- package/dist/services/config.d.ts +4 -4
- package/dist/services/config.js +4 -4
- package/dist/services/connection.cjs +217 -7
- package/dist/services/connection.d.cts +4 -4
- package/dist/services/connection.d.ts +4 -4
- package/dist/services/connection.js +3 -3
- package/dist/services/index.cjs +227 -22
- package/dist/services/index.d.cts +4 -4
- package/dist/services/index.d.ts +4 -4
- package/dist/services/index.js +7 -7
- package/dist/services/lrc-connection.cjs +7 -2
- package/dist/services/lrc-connection.d.cts +4 -4
- package/dist/services/lrc-connection.d.ts +4 -4
- package/dist/services/lrc-connection.js +4 -4
- package/dist/services/token-transactions.cjs +7 -2
- package/dist/services/token-transactions.d.cts +4 -4
- package/dist/services/token-transactions.d.ts +4 -4
- package/dist/services/token-transactions.js +4 -4
- package/dist/services/wallet-config.cjs +7 -2
- package/dist/services/wallet-config.d.cts +4 -4
- package/dist/services/wallet-config.d.ts +4 -4
- package/dist/services/wallet-config.js +1 -1
- package/dist/signer/signer.cjs +11 -11
- package/dist/signer/signer.d.cts +2 -2
- package/dist/signer/signer.d.ts +2 -2
- package/dist/signer/signer.js +2 -2
- package/dist/{signer-DQfFgVNA.d.cts → signer-C1t40Wus.d.cts} +1 -1
- package/dist/{signer-Db_TjQFj.d.ts → signer-DFGw9RRp.d.ts} +1 -1
- package/dist/{spark-FHwyinrG.d.cts → spark-DXYE9gMM.d.cts} +29 -3
- package/dist/{spark-FHwyinrG.d.ts → spark-DXYE9gMM.d.ts} +29 -3
- package/dist/types/index.cjs +219 -7
- package/dist/types/index.d.cts +4 -4
- package/dist/types/index.d.ts +4 -4
- package/dist/types/index.js +3 -3
- package/dist/utils/index.cjs +7 -2
- package/dist/utils/index.d.cts +5 -5
- package/dist/utils/index.d.ts +5 -5
- package/dist/utils/index.js +3 -3
- package/dist/{wasm-W3WBILBX.js → wasm-7OWFHDMS.js} +1 -1
- package/dist/{xhr-transport-DSTXEBFS.js → xhr-transport-RH6LDRXS.js} +1 -1
- package/package.json +3 -4
- package/src/proto/common.ts +1 -1
- package/src/proto/google/protobuf/descriptor.ts +1 -1
- package/src/proto/google/protobuf/duration.ts +1 -1
- package/src/proto/google/protobuf/empty.ts +1 -1
- package/src/proto/google/protobuf/timestamp.ts +1 -1
- package/src/proto/mock.ts +2 -2
- package/src/proto/spark.ts +271 -8
- package/src/proto/spark_authn.ts +2 -2
- package/src/proto/validate/validate.ts +1 -1
- package/src/services/transfer.ts +1 -0
- package/src/signer/signer.ts +6 -11
- package/src/spark-wallet/spark-wallet.ts +177 -73
- package/src/tests/integration/deposit.test.ts +5 -0
- package/src/tests/integration/ssp/static_deposit.test.ts +4 -0
- package/src/tests/spark-wallet/queryNodes.test.ts +89 -0
- package/dist/native/chunk-OVEXKBAZ.js +0 -14
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# @buildonspark/spark-sdk
|
|
2
2
|
|
|
3
|
+
## 0.1.37
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- - Return static deposit address instead of throwing error when trying to create after first time.
|
|
8
|
+
- Handle window undefined in buffer polyfill.
|
|
9
|
+
- Add static deposit transactions to get all transaction request.
|
|
10
|
+
|
|
11
|
+
## 0.1.36
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- Updated dependencies
|
|
16
|
+
- @buildonspark/lrc20-sdk@0.0.57
|
|
17
|
+
|
|
3
18
|
## 0.1.35
|
|
4
19
|
|
|
5
20
|
### Patch Changes
|
package/dist/{RequestLightningSendInput-BtR12ZlP.d.cts → RequestLightningSendInput-39_zGri6.d.cts}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Query } from '@lightsparkdev/core';
|
|
2
2
|
import { B as BitcoinNetwork } from './BitcoinNetwork-TnABML0T.cjs';
|
|
3
|
-
import { S as SparkSigner } from './signer-
|
|
3
|
+
import { S as SparkSigner } from './signer-C1t40Wus.cjs';
|
|
4
4
|
|
|
5
5
|
/** This enum identifies the unit of currency associated with a CurrencyAmount. **/
|
|
6
6
|
declare enum CurrencyUnit {
|
package/dist/{RequestLightningSendInput-Dfx7JYWT.d.ts → RequestLightningSendInput-B4JdzclX.d.ts}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Query } from '@lightsparkdev/core';
|
|
2
2
|
import { B as BitcoinNetwork } from './BitcoinNetwork-TnABML0T.js';
|
|
3
|
-
import { S as SparkSigner } from './signer-
|
|
3
|
+
import { S as SparkSigner } from './signer-DFGw9RRp.js';
|
|
4
4
|
|
|
5
5
|
/** This enum identifies the unit of currency associated with a CurrencyAmount. **/
|
|
6
6
|
declare enum CurrencyUnit {
|
package/dist/address/index.cjs
CHANGED
|
@@ -31,8 +31,13 @@ var import_buffer = require("buffer");
|
|
|
31
31
|
if (typeof globalThis.Buffer === "undefined") {
|
|
32
32
|
globalThis.Buffer = import_buffer.Buffer;
|
|
33
33
|
}
|
|
34
|
-
if (typeof
|
|
35
|
-
window.global
|
|
34
|
+
if (typeof window !== "undefined") {
|
|
35
|
+
if (typeof window.global === "undefined") {
|
|
36
|
+
window.global = window;
|
|
37
|
+
}
|
|
38
|
+
if (typeof window.globalThis === "undefined") {
|
|
39
|
+
window.globalThis = window;
|
|
40
|
+
}
|
|
36
41
|
}
|
|
37
42
|
|
|
38
43
|
// src/address/address.ts
|
package/dist/address/index.d.cts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { a as NetworkType } from '../network-
|
|
1
|
+
import { a as NetworkType } from '../network-GFGEHkS4.cjs';
|
|
2
2
|
import '@buildonspark/lrc20-sdk';
|
|
3
3
|
import '@scure/btc-signer';
|
|
4
4
|
import 'bitcoinjs-lib';
|
|
5
|
-
import '../spark-
|
|
5
|
+
import '../spark-DXYE9gMM.cjs';
|
|
6
6
|
import '@bufbuild/protobuf/wire';
|
|
7
7
|
import 'nice-grpc-common';
|
|
8
8
|
import '../BitcoinNetwork-TnABML0T.cjs';
|
package/dist/address/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { a as NetworkType } from '../network-
|
|
1
|
+
import { a as NetworkType } from '../network-DobHpaV6.js';
|
|
2
2
|
import '@buildonspark/lrc20-sdk';
|
|
3
3
|
import '@scure/btc-signer';
|
|
4
4
|
import 'bitcoinjs-lib';
|
|
5
|
-
import '../spark-
|
|
5
|
+
import '../spark-DXYE9gMM.js';
|
|
6
6
|
import '@bufbuild/protobuf/wire';
|
|
7
7
|
import 'nice-grpc-common';
|
|
8
8
|
import '../BitcoinNetwork-TnABML0T.js';
|
package/dist/address/index.js
CHANGED
|
@@ -2,11 +2,11 @@ import {
|
|
|
2
2
|
decodeSparkAddress,
|
|
3
3
|
encodeSparkAddress,
|
|
4
4
|
isValidSparkAddress
|
|
5
|
-
} from "../chunk-
|
|
5
|
+
} from "../chunk-2CDJZQN4.js";
|
|
6
6
|
import "../chunk-VTUGIIWI.js";
|
|
7
7
|
import "../chunk-TWF35O6M.js";
|
|
8
|
-
import "../chunk-
|
|
9
|
-
import "../chunk-
|
|
8
|
+
import "../chunk-C5LTJBI7.js";
|
|
9
|
+
import "../chunk-MVRQ5US7.js";
|
|
10
10
|
export {
|
|
11
11
|
decodeSparkAddress,
|
|
12
12
|
encodeSparkAddress,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
__export
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-MVRQ5US7.js";
|
|
4
4
|
|
|
5
5
|
// src/proto/spark.ts
|
|
6
6
|
var spark_exports = {};
|
|
@@ -43,6 +43,8 @@ __export(spark_exports, {
|
|
|
43
43
|
FinalizeTokenTransactionRequest: () => FinalizeTokenTransactionRequest,
|
|
44
44
|
FinalizeTransferRequest: () => FinalizeTransferRequest,
|
|
45
45
|
FinalizeTransferResponse: () => FinalizeTransferResponse,
|
|
46
|
+
FinalizeTransferWithTransferPackageRequest: () => FinalizeTransferWithTransferPackageRequest,
|
|
47
|
+
FinalizeTransferWithTransferPackageRequest_RefundSignaturesEntry: () => FinalizeTransferWithTransferPackageRequest_RefundSignaturesEntry,
|
|
46
48
|
FreezeTokensPayload: () => FreezeTokensPayload,
|
|
47
49
|
FreezeTokensRequest: () => FreezeTokensRequest,
|
|
48
50
|
FreezeTokensResponse: () => FreezeTokensResponse,
|
|
@@ -6757,6 +6759,203 @@ var FinalizeTransferRequest = {
|
|
|
6757
6759
|
return message;
|
|
6758
6760
|
}
|
|
6759
6761
|
};
|
|
6762
|
+
function createBaseFinalizeTransferWithTransferPackageRequest() {
|
|
6763
|
+
return {
|
|
6764
|
+
transferId: "",
|
|
6765
|
+
ownerIdentityPublicKey: new Uint8Array(0),
|
|
6766
|
+
transferPackage: void 0,
|
|
6767
|
+
refundSignatures: {}
|
|
6768
|
+
};
|
|
6769
|
+
}
|
|
6770
|
+
var FinalizeTransferWithTransferPackageRequest = {
|
|
6771
|
+
encode(message, writer = new BinaryWriter4()) {
|
|
6772
|
+
if (message.transferId !== "") {
|
|
6773
|
+
writer.uint32(10).string(message.transferId);
|
|
6774
|
+
}
|
|
6775
|
+
if (message.ownerIdentityPublicKey.length !== 0) {
|
|
6776
|
+
writer.uint32(18).bytes(message.ownerIdentityPublicKey);
|
|
6777
|
+
}
|
|
6778
|
+
if (message.transferPackage !== void 0) {
|
|
6779
|
+
TransferPackage.encode(message.transferPackage, writer.uint32(26).fork()).join();
|
|
6780
|
+
}
|
|
6781
|
+
Object.entries(message.refundSignatures).forEach(([key, value]) => {
|
|
6782
|
+
FinalizeTransferWithTransferPackageRequest_RefundSignaturesEntry.encode(
|
|
6783
|
+
{ key, value },
|
|
6784
|
+
writer.uint32(34).fork()
|
|
6785
|
+
).join();
|
|
6786
|
+
});
|
|
6787
|
+
return writer;
|
|
6788
|
+
},
|
|
6789
|
+
decode(input, length) {
|
|
6790
|
+
const reader = input instanceof BinaryReader4 ? input : new BinaryReader4(input);
|
|
6791
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
6792
|
+
const message = createBaseFinalizeTransferWithTransferPackageRequest();
|
|
6793
|
+
while (reader.pos < end) {
|
|
6794
|
+
const tag = reader.uint32();
|
|
6795
|
+
switch (tag >>> 3) {
|
|
6796
|
+
case 1: {
|
|
6797
|
+
if (tag !== 10) {
|
|
6798
|
+
break;
|
|
6799
|
+
}
|
|
6800
|
+
message.transferId = reader.string();
|
|
6801
|
+
continue;
|
|
6802
|
+
}
|
|
6803
|
+
case 2: {
|
|
6804
|
+
if (tag !== 18) {
|
|
6805
|
+
break;
|
|
6806
|
+
}
|
|
6807
|
+
message.ownerIdentityPublicKey = reader.bytes();
|
|
6808
|
+
continue;
|
|
6809
|
+
}
|
|
6810
|
+
case 3: {
|
|
6811
|
+
if (tag !== 26) {
|
|
6812
|
+
break;
|
|
6813
|
+
}
|
|
6814
|
+
message.transferPackage = TransferPackage.decode(reader, reader.uint32());
|
|
6815
|
+
continue;
|
|
6816
|
+
}
|
|
6817
|
+
case 4: {
|
|
6818
|
+
if (tag !== 34) {
|
|
6819
|
+
break;
|
|
6820
|
+
}
|
|
6821
|
+
const entry4 = FinalizeTransferWithTransferPackageRequest_RefundSignaturesEntry.decode(
|
|
6822
|
+
reader,
|
|
6823
|
+
reader.uint32()
|
|
6824
|
+
);
|
|
6825
|
+
if (entry4.value !== void 0) {
|
|
6826
|
+
message.refundSignatures[entry4.key] = entry4.value;
|
|
6827
|
+
}
|
|
6828
|
+
continue;
|
|
6829
|
+
}
|
|
6830
|
+
}
|
|
6831
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
6832
|
+
break;
|
|
6833
|
+
}
|
|
6834
|
+
reader.skip(tag & 7);
|
|
6835
|
+
}
|
|
6836
|
+
return message;
|
|
6837
|
+
},
|
|
6838
|
+
fromJSON(object) {
|
|
6839
|
+
return {
|
|
6840
|
+
transferId: isSet3(object.transferId) ? globalThis.String(object.transferId) : "",
|
|
6841
|
+
ownerIdentityPublicKey: isSet3(object.ownerIdentityPublicKey) ? bytesFromBase642(object.ownerIdentityPublicKey) : new Uint8Array(0),
|
|
6842
|
+
transferPackage: isSet3(object.transferPackage) ? TransferPackage.fromJSON(object.transferPackage) : void 0,
|
|
6843
|
+
refundSignatures: isObject2(object.refundSignatures) ? Object.entries(object.refundSignatures).reduce((acc, [key, value]) => {
|
|
6844
|
+
acc[key] = bytesFromBase642(value);
|
|
6845
|
+
return acc;
|
|
6846
|
+
}, {}) : {}
|
|
6847
|
+
};
|
|
6848
|
+
},
|
|
6849
|
+
toJSON(message) {
|
|
6850
|
+
const obj = {};
|
|
6851
|
+
if (message.transferId !== "") {
|
|
6852
|
+
obj.transferId = message.transferId;
|
|
6853
|
+
}
|
|
6854
|
+
if (message.ownerIdentityPublicKey.length !== 0) {
|
|
6855
|
+
obj.ownerIdentityPublicKey = base64FromBytes2(message.ownerIdentityPublicKey);
|
|
6856
|
+
}
|
|
6857
|
+
if (message.transferPackage !== void 0) {
|
|
6858
|
+
obj.transferPackage = TransferPackage.toJSON(message.transferPackage);
|
|
6859
|
+
}
|
|
6860
|
+
if (message.refundSignatures) {
|
|
6861
|
+
const entries = Object.entries(message.refundSignatures);
|
|
6862
|
+
if (entries.length > 0) {
|
|
6863
|
+
obj.refundSignatures = {};
|
|
6864
|
+
entries.forEach(([k, v]) => {
|
|
6865
|
+
obj.refundSignatures[k] = base64FromBytes2(v);
|
|
6866
|
+
});
|
|
6867
|
+
}
|
|
6868
|
+
}
|
|
6869
|
+
return obj;
|
|
6870
|
+
},
|
|
6871
|
+
create(base) {
|
|
6872
|
+
return FinalizeTransferWithTransferPackageRequest.fromPartial(base ?? {});
|
|
6873
|
+
},
|
|
6874
|
+
fromPartial(object) {
|
|
6875
|
+
const message = createBaseFinalizeTransferWithTransferPackageRequest();
|
|
6876
|
+
message.transferId = object.transferId ?? "";
|
|
6877
|
+
message.ownerIdentityPublicKey = object.ownerIdentityPublicKey ?? new Uint8Array(0);
|
|
6878
|
+
message.transferPackage = object.transferPackage !== void 0 && object.transferPackage !== null ? TransferPackage.fromPartial(object.transferPackage) : void 0;
|
|
6879
|
+
message.refundSignatures = Object.entries(object.refundSignatures ?? {}).reduce(
|
|
6880
|
+
(acc, [key, value]) => {
|
|
6881
|
+
if (value !== void 0) {
|
|
6882
|
+
acc[key] = value;
|
|
6883
|
+
}
|
|
6884
|
+
return acc;
|
|
6885
|
+
},
|
|
6886
|
+
{}
|
|
6887
|
+
);
|
|
6888
|
+
return message;
|
|
6889
|
+
}
|
|
6890
|
+
};
|
|
6891
|
+
function createBaseFinalizeTransferWithTransferPackageRequest_RefundSignaturesEntry() {
|
|
6892
|
+
return { key: "", value: new Uint8Array(0) };
|
|
6893
|
+
}
|
|
6894
|
+
var FinalizeTransferWithTransferPackageRequest_RefundSignaturesEntry = {
|
|
6895
|
+
encode(message, writer = new BinaryWriter4()) {
|
|
6896
|
+
if (message.key !== "") {
|
|
6897
|
+
writer.uint32(10).string(message.key);
|
|
6898
|
+
}
|
|
6899
|
+
if (message.value.length !== 0) {
|
|
6900
|
+
writer.uint32(18).bytes(message.value);
|
|
6901
|
+
}
|
|
6902
|
+
return writer;
|
|
6903
|
+
},
|
|
6904
|
+
decode(input, length) {
|
|
6905
|
+
const reader = input instanceof BinaryReader4 ? input : new BinaryReader4(input);
|
|
6906
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
6907
|
+
const message = createBaseFinalizeTransferWithTransferPackageRequest_RefundSignaturesEntry();
|
|
6908
|
+
while (reader.pos < end) {
|
|
6909
|
+
const tag = reader.uint32();
|
|
6910
|
+
switch (tag >>> 3) {
|
|
6911
|
+
case 1: {
|
|
6912
|
+
if (tag !== 10) {
|
|
6913
|
+
break;
|
|
6914
|
+
}
|
|
6915
|
+
message.key = reader.string();
|
|
6916
|
+
continue;
|
|
6917
|
+
}
|
|
6918
|
+
case 2: {
|
|
6919
|
+
if (tag !== 18) {
|
|
6920
|
+
break;
|
|
6921
|
+
}
|
|
6922
|
+
message.value = reader.bytes();
|
|
6923
|
+
continue;
|
|
6924
|
+
}
|
|
6925
|
+
}
|
|
6926
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
6927
|
+
break;
|
|
6928
|
+
}
|
|
6929
|
+
reader.skip(tag & 7);
|
|
6930
|
+
}
|
|
6931
|
+
return message;
|
|
6932
|
+
},
|
|
6933
|
+
fromJSON(object) {
|
|
6934
|
+
return {
|
|
6935
|
+
key: isSet3(object.key) ? globalThis.String(object.key) : "",
|
|
6936
|
+
value: isSet3(object.value) ? bytesFromBase642(object.value) : new Uint8Array(0)
|
|
6937
|
+
};
|
|
6938
|
+
},
|
|
6939
|
+
toJSON(message) {
|
|
6940
|
+
const obj = {};
|
|
6941
|
+
if (message.key !== "") {
|
|
6942
|
+
obj.key = message.key;
|
|
6943
|
+
}
|
|
6944
|
+
if (message.value.length !== 0) {
|
|
6945
|
+
obj.value = base64FromBytes2(message.value);
|
|
6946
|
+
}
|
|
6947
|
+
return obj;
|
|
6948
|
+
},
|
|
6949
|
+
create(base) {
|
|
6950
|
+
return FinalizeTransferWithTransferPackageRequest_RefundSignaturesEntry.fromPartial(base ?? {});
|
|
6951
|
+
},
|
|
6952
|
+
fromPartial(object) {
|
|
6953
|
+
const message = createBaseFinalizeTransferWithTransferPackageRequest_RefundSignaturesEntry();
|
|
6954
|
+
message.key = object.key ?? "";
|
|
6955
|
+
message.value = object.value ?? new Uint8Array(0);
|
|
6956
|
+
return message;
|
|
6957
|
+
}
|
|
6958
|
+
};
|
|
6760
6959
|
function createBaseFinalizeTransferResponse() {
|
|
6761
6960
|
return { transfer: void 0 };
|
|
6762
6961
|
}
|
|
@@ -12107,7 +12306,7 @@ var InitiateUtxoSwapRequest = {
|
|
|
12107
12306
|
writer.uint32(50).bytes(message.userSignature);
|
|
12108
12307
|
}
|
|
12109
12308
|
if (message.transfer !== void 0) {
|
|
12110
|
-
|
|
12309
|
+
StartTransferRequest.encode(message.transfer, writer.uint32(58).fork()).join();
|
|
12111
12310
|
}
|
|
12112
12311
|
if (message.spendTxSigningJob !== void 0) {
|
|
12113
12312
|
SigningJob.encode(message.spendTxSigningJob, writer.uint32(66).fork()).join();
|
|
@@ -12167,7 +12366,7 @@ var InitiateUtxoSwapRequest = {
|
|
|
12167
12366
|
if (tag !== 58) {
|
|
12168
12367
|
break;
|
|
12169
12368
|
}
|
|
12170
|
-
message.transfer =
|
|
12369
|
+
message.transfer = StartTransferRequest.decode(reader, reader.uint32());
|
|
12171
12370
|
continue;
|
|
12172
12371
|
}
|
|
12173
12372
|
case 8: {
|
|
@@ -12192,7 +12391,7 @@ var InitiateUtxoSwapRequest = {
|
|
|
12192
12391
|
amount: isSet3(object.creditAmountSats) ? { $case: "creditAmountSats", creditAmountSats: globalThis.Number(object.creditAmountSats) } : isSet3(object.maxFeeSats) ? { $case: "maxFeeSats", maxFeeSats: globalThis.Number(object.maxFeeSats) } : void 0,
|
|
12193
12392
|
sspSignature: isSet3(object.sspSignature) ? bytesFromBase642(object.sspSignature) : new Uint8Array(0),
|
|
12194
12393
|
userSignature: isSet3(object.userSignature) ? bytesFromBase642(object.userSignature) : new Uint8Array(0),
|
|
12195
|
-
transfer: isSet3(object.transfer) ?
|
|
12394
|
+
transfer: isSet3(object.transfer) ? StartTransferRequest.fromJSON(object.transfer) : void 0,
|
|
12196
12395
|
spendTxSigningJob: isSet3(object.spendTxSigningJob) ? SigningJob.fromJSON(object.spendTxSigningJob) : void 0
|
|
12197
12396
|
};
|
|
12198
12397
|
},
|
|
@@ -12216,7 +12415,7 @@ var InitiateUtxoSwapRequest = {
|
|
|
12216
12415
|
obj.userSignature = base64FromBytes2(message.userSignature);
|
|
12217
12416
|
}
|
|
12218
12417
|
if (message.transfer !== void 0) {
|
|
12219
|
-
obj.transfer =
|
|
12418
|
+
obj.transfer = StartTransferRequest.toJSON(message.transfer);
|
|
12220
12419
|
}
|
|
12221
12420
|
if (message.spendTxSigningJob !== void 0) {
|
|
12222
12421
|
obj.spendTxSigningJob = SigningJob.toJSON(message.spendTxSigningJob);
|
|
@@ -12246,7 +12445,7 @@ var InitiateUtxoSwapRequest = {
|
|
|
12246
12445
|
}
|
|
12247
12446
|
message.sspSignature = object.sspSignature ?? new Uint8Array(0);
|
|
12248
12447
|
message.userSignature = object.userSignature ?? new Uint8Array(0);
|
|
12249
|
-
message.transfer = object.transfer !== void 0 && object.transfer !== null ?
|
|
12448
|
+
message.transfer = object.transfer !== void 0 && object.transfer !== null ? StartTransferRequest.fromPartial(object.transfer) : void 0;
|
|
12250
12449
|
message.spendTxSigningJob = object.spendTxSigningJob !== void 0 && object.spendTxSigningJob !== null ? SigningJob.fromPartial(object.spendTxSigningJob) : void 0;
|
|
12251
12450
|
return message;
|
|
12252
12451
|
}
|
|
@@ -13304,6 +13503,14 @@ var SparkServiceDefinition = {
|
|
|
13304
13503
|
responseStream: false,
|
|
13305
13504
|
options: {}
|
|
13306
13505
|
},
|
|
13506
|
+
finalize_transfer_with_transfer_package: {
|
|
13507
|
+
name: "finalize_transfer_with_transfer_package",
|
|
13508
|
+
requestType: FinalizeTransferWithTransferPackageRequest,
|
|
13509
|
+
requestStream: false,
|
|
13510
|
+
responseType: FinalizeTransferResponse,
|
|
13511
|
+
responseStream: false,
|
|
13512
|
+
options: {}
|
|
13513
|
+
},
|
|
13307
13514
|
cancel_transfer: {
|
|
13308
13515
|
name: "cancel_transfer",
|
|
13309
13516
|
requestType: CancelTransferRequest,
|
|
@@ -13760,6 +13967,8 @@ export {
|
|
|
13760
13967
|
SendLeafKeyTweak,
|
|
13761
13968
|
SendLeafKeyTweak_PubkeySharesTweakEntry,
|
|
13762
13969
|
FinalizeTransferRequest,
|
|
13970
|
+
FinalizeTransferWithTransferPackageRequest,
|
|
13971
|
+
FinalizeTransferWithTransferPackageRequest_RefundSignaturesEntry,
|
|
13763
13972
|
FinalizeTransferResponse,
|
|
13764
13973
|
Transfer,
|
|
13765
13974
|
TransferLeaf,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
SparkServiceDefinition
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-NS4UZRQ7.js";
|
|
4
4
|
import {
|
|
5
5
|
isBun,
|
|
6
6
|
isReactNative
|
|
@@ -52,7 +52,7 @@ var Lrc20ConnectionManager = class {
|
|
|
52
52
|
} else {
|
|
53
53
|
const grpcModule = await import("nice-grpc-web");
|
|
54
54
|
const { createChannel, FetchTransport } = "default" in grpcModule ? grpcModule.default : grpcModule;
|
|
55
|
-
const { XHRTransport } = await import("./xhr-transport-
|
|
55
|
+
const { XHRTransport } = await import("./xhr-transport-RH6LDRXS.js");
|
|
56
56
|
return createChannel(
|
|
57
57
|
address,
|
|
58
58
|
isReactNative ? XHRTransport() : FetchTransport()
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
import {
|
|
10
10
|
Empty,
|
|
11
11
|
SparkServiceDefinition
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-C5LTJBI7.js";
|
|
13
13
|
|
|
14
14
|
// src/services/connection.ts
|
|
15
15
|
import { isNode } from "@lightsparkdev/core";
|
|
@@ -852,7 +852,7 @@ var ConnectionManager = class {
|
|
|
852
852
|
} else {
|
|
853
853
|
const grpcModule = await import("nice-grpc-web");
|
|
854
854
|
const { createChannel, FetchTransport } = "default" in grpcModule ? grpcModule.default : grpcModule;
|
|
855
|
-
const { XHRTransport } = await import("./xhr-transport-
|
|
855
|
+
const { XHRTransport } = await import("./xhr-transport-RH6LDRXS.js");
|
|
856
856
|
return createChannel(
|
|
857
857
|
address,
|
|
858
858
|
isReactNative ? XHRTransport() : FetchTransport()
|
|
@@ -9,8 +9,13 @@ import { Buffer as Buffer2 } from "buffer";
|
|
|
9
9
|
if (typeof globalThis.Buffer === "undefined") {
|
|
10
10
|
globalThis.Buffer = Buffer2;
|
|
11
11
|
}
|
|
12
|
-
if (typeof
|
|
13
|
-
window.global
|
|
12
|
+
if (typeof window !== "undefined") {
|
|
13
|
+
if (typeof window.global === "undefined") {
|
|
14
|
+
window.global = window;
|
|
15
|
+
}
|
|
16
|
+
if (typeof window.globalThis === "undefined") {
|
|
17
|
+
window.globalThis = window;
|
|
18
|
+
}
|
|
14
19
|
}
|
|
15
20
|
|
|
16
21
|
export {
|
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
} from "./chunk-TWF35O6M.js";
|
|
17
17
|
import {
|
|
18
18
|
Buffer
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-MVRQ5US7.js";
|
|
20
20
|
|
|
21
21
|
// src/signer/signer.ts
|
|
22
22
|
import {
|
|
@@ -25,7 +25,6 @@ import {
|
|
|
25
25
|
hexToBytes
|
|
26
26
|
} from "@noble/curves/abstract/utils";
|
|
27
27
|
import { schnorr, secp256k1 } from "@noble/curves/secp256k1";
|
|
28
|
-
import { sha256 } from "@noble/hashes/sha2";
|
|
29
28
|
import { HDKey } from "@scure/bip32";
|
|
30
29
|
import { generateMnemonic, mnemonicToSeed } from "@scure/bip39";
|
|
31
30
|
import { wordlist } from "@scure/bip39/wordlists/english";
|
|
@@ -33,15 +32,15 @@ import * as ecies from "eciesjs";
|
|
|
33
32
|
import { PARITY } from "@buildonspark/lrc20-sdk";
|
|
34
33
|
import { Receipt } from "@buildonspark/lrc20-sdk";
|
|
35
34
|
import { privateNegate, privateAdd } from "@bitcoinerlab/secp256k1";
|
|
36
|
-
import
|
|
37
|
-
import {
|
|
35
|
+
import { sha256 } from "@noble/hashes/sha2";
|
|
36
|
+
import { fromPrivateKey } from "@buildonspark/lrc20-sdk";
|
|
38
37
|
var sparkFrostModule = void 0;
|
|
39
38
|
var getSparkFrostModule = async () => {
|
|
40
39
|
if (isReactNative) {
|
|
41
40
|
return void 0;
|
|
42
41
|
}
|
|
43
42
|
if (!sparkFrostModule) {
|
|
44
|
-
sparkFrostModule = await import("./wasm-
|
|
43
|
+
sparkFrostModule = await import("./wasm-7OWFHDMS.js");
|
|
45
44
|
}
|
|
46
45
|
return sparkFrostModule;
|
|
47
46
|
};
|
|
@@ -500,15 +499,11 @@ var DefaultSparkSigner = class {
|
|
|
500
499
|
}
|
|
501
500
|
if (receipt) {
|
|
502
501
|
const receiptPrivateKey = this.getReceiptPrivateKey(receipt);
|
|
503
|
-
const tweakedKeyPair =
|
|
504
|
-
Buffer.from(receiptPrivateKey)
|
|
505
|
-
);
|
|
502
|
+
const tweakedKeyPair = fromPrivateKey(Buffer.from(receiptPrivateKey));
|
|
506
503
|
psbt.signInput(input, tweakedKeyPair, sighashTypes);
|
|
507
504
|
return psbt;
|
|
508
505
|
}
|
|
509
|
-
const keypair =
|
|
510
|
-
Buffer.from(this.identityKey.privateKey)
|
|
511
|
-
);
|
|
506
|
+
const keypair = fromPrivateKey(Buffer.from(this.identityKey.privateKey));
|
|
512
507
|
psbt.signInput(input, keypair, sighashTypes);
|
|
513
508
|
return psbt;
|
|
514
509
|
}
|
|
@@ -520,7 +515,7 @@ var DefaultSparkSigner = class {
|
|
|
520
515
|
innerKey = Buffer.concat([PARITY, innerKey.slice(1)]);
|
|
521
516
|
privateKey = Buffer.from(privateNegate(privateKey));
|
|
522
517
|
}
|
|
523
|
-
const pxhPubkey =
|
|
518
|
+
const pxhPubkey = sha256(Buffer.concat([pxh, innerKey]));
|
|
524
519
|
const receiptProof = privateAdd(privateKey, pxhPubkey);
|
|
525
520
|
return Buffer.from(receiptProof);
|
|
526
521
|
}
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
} from "./chunk-57XLH3ZR.js";
|
|
6
6
|
import {
|
|
7
7
|
decodeSparkAddress
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-2CDJZQN4.js";
|
|
9
9
|
import {
|
|
10
10
|
bigIntToPrivateKey,
|
|
11
11
|
recoverSecret
|
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
} from "./chunk-TWF35O6M.js";
|
|
18
18
|
import {
|
|
19
19
|
Buffer
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-MVRQ5US7.js";
|
|
21
21
|
|
|
22
22
|
// src/services/token-transactions.ts
|
|
23
23
|
import {
|