@buildonspark/spark-sdk 0.2.10 → 0.2.12
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 +17 -1
- package/dist/bare/chunk-P6AVV7VD.js +34 -0
- package/dist/bare/index.cjs +729 -166
- package/dist/bare/index.d.cts +62 -5
- package/dist/bare/index.d.ts +62 -5
- package/dist/bare/index.js +675 -173
- package/dist/bare/{wasm-OPXXYRN5.js → wasm-F5QFVBNZ.js} +26 -0
- package/dist/bare/{xhr-transport-6GYJAFWU.js → xhr-transport-EEEC7FYA.js} +2 -2
- package/dist/{chunk-A5M55UR3.js → chunk-5VWGOHED.js} +499 -8
- package/dist/{chunk-MWBK6QBF.js → chunk-NQMQVXR5.js} +1 -1
- package/dist/chunk-NX5KPN5F.js +34 -0
- package/dist/{chunk-JXLWOQK5.js → chunk-OEK3R57K.js} +196 -162
- package/dist/{chunk-76SYPHOC.js → chunk-TB7DG5CU.js} +2 -2
- package/dist/{chunk-6CMNEDBK.js → chunk-XXTWWW6L.js} +1 -1
- package/dist/{client-Dd3QnxQu.d.ts → client-D7KDa4Ih.d.ts} +1 -1
- package/dist/{client-B9CAWKWz.d.cts → client-DVuA5-7M.d.cts} +1 -1
- package/dist/debug.cjs +725 -163
- package/dist/debug.d.cts +8 -5
- package/dist/debug.d.ts +8 -5
- package/dist/debug.js +5 -4
- package/dist/graphql/objects/index.d.cts +3 -3
- package/dist/graphql/objects/index.d.ts +3 -3
- package/dist/index.cjs +810 -246
- package/dist/index.d.cts +6 -6
- package/dist/index.d.ts +6 -6
- package/dist/index.js +11 -5
- package/dist/index.node.cjs +810 -246
- package/dist/index.node.d.cts +6 -6
- package/dist/index.node.d.ts +6 -6
- package/dist/index.node.js +10 -4
- package/dist/{xchain-address-BPwpnmuY.d.ts → logging-ClNhGzus.d.ts} +18 -4
- package/dist/{xchain-address-CNQEwLjR.d.cts → logging-D3kvES69.d.cts} +18 -4
- package/dist/native/chunk-D3SZRO65.js +36 -0
- package/dist/native/index.cjs +808 -244
- package/dist/native/index.d.cts +62 -5
- package/dist/native/index.d.ts +62 -5
- package/dist/native/index.js +769 -268
- package/dist/native/{wasm-2KV6XFEP.js → wasm-3YAXKQ7F.js} +25 -0
- package/dist/native/{xhr-transport-WHMS3FGG.js → xhr-transport-TNCG4HTW.js} +2 -2
- package/dist/proto/spark.cjs +499 -8
- package/dist/proto/spark.d.cts +1 -1
- package/dist/proto/spark.d.ts +1 -1
- package/dist/proto/spark.js +17 -1
- package/dist/proto/spark_token.d.cts +1 -1
- package/dist/proto/spark_token.d.ts +1 -1
- package/dist/proto/spark_token.js +2 -2
- package/dist/{spark-CtGJPkx4.d.cts → spark-C7OG9mGJ.d.cts} +79 -2
- package/dist/{spark-CtGJPkx4.d.ts → spark-C7OG9mGJ.d.ts} +79 -2
- package/dist/{spark-wallet-yc2KhsVY.d.cts → spark-wallet-Dg5IRQe2.d.cts} +3 -5
- package/dist/{spark-wallet-Cp3yv6cK.d.ts → spark-wallet-DiHSU-pz.d.ts} +3 -5
- package/dist/{spark-wallet.node-D4IovOHu.d.ts → spark-wallet.node-BZrxwomN.d.ts} +1 -1
- package/dist/{spark-wallet.node-D0Qw5Wb4.d.cts → spark-wallet.node-DSWb18zh.d.cts} +1 -1
- package/dist/spark_bindings/wasm/index.cjs +51 -0
- package/dist/spark_bindings/wasm/index.js +25 -0
- package/dist/tests/test-utils.cjs +725 -155
- package/dist/tests/test-utils.d.cts +4 -4
- package/dist/tests/test-utils.d.ts +4 -4
- package/dist/tests/test-utils.js +6 -5
- package/dist/{token-transactions-CwhlOgIP.d.cts → token-transactions-B-WqFYpW.d.cts} +2 -2
- package/dist/{token-transactions-0nmR9mQO.d.ts → token-transactions-DovxHIxV.d.ts} +2 -2
- package/dist/types/index.cjs +492 -9
- package/dist/types/index.d.cts +2 -2
- package/dist/types/index.d.ts +2 -2
- package/dist/types/index.js +2 -2
- package/dist/{xhr-transport-RH6LDRXS.js → xhr-transport-IWJPYF7F.js} +2 -2
- package/package.json +1 -1
- package/src/proto/common.ts +1 -1
- package/src/proto/google/protobuf/descriptor.ts +4 -10
- 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 +1 -1
- package/src/proto/spark.ts +593 -3
- package/src/proto/spark_authn.ts +1 -1
- package/src/proto/spark_token.ts +1 -1
- package/src/proto/validate/validate.ts +27 -79
- package/src/services/deposit.ts +60 -4
- package/src/services/lightning.ts +2 -2
- package/src/services/signing.ts +1 -1
- package/src/services/token-transactions.ts +2 -5
- package/src/services/transfer.ts +2 -2
- package/src/services/xhr-transport.ts +2 -2
- package/src/signer/signer.ts +2 -2
- package/src/spark-wallet/spark-wallet.ts +25 -33
- package/src/spark_bindings/wasm/index.ts +21 -0
- package/src/tests/address.test.ts +10 -10
- package/src/tests/bitcoin.test.ts +2 -2
- package/src/tests/integration/coop-exit.test.ts +1 -1
- package/src/tests/integration/lightning.test.ts +1 -1
- package/src/tests/integration/ssp/coop-exit-validation.test.ts +2 -2
- package/src/tests/integration/ssp/static_deposit.test.ts +122 -33
- package/src/tests/integration/swap.test.ts +1 -1
- package/src/tests/integration/transfer.test.ts +1 -5
- package/src/tests/integration/wallet.test.ts +7 -7
- package/src/tests/integration/watchtower.test.ts +3 -3
- package/src/tests/token-hashing.test.ts +3 -6
- package/src/tests/token-outputs.test.ts +3 -3
- package/src/tests/utils/test-faucet.ts +2 -2
- package/src/types/sdk-types.ts +1 -1
- package/src/utils/adaptor-signature.ts +12 -13
- package/src/utils/address.ts +10 -10
- package/src/utils/bitcoin.ts +7 -11
- package/src/utils/index.ts +1 -0
- package/src/utils/keys.ts +10 -10
- package/src/utils/logging.ts +40 -0
- package/src/utils/secret-sharing.ts +10 -12
- package/src/utils/token-transactions.ts +1 -2
- package/src/utils/transfer_package.ts +1 -1
- package/src/utils/unilateral-exit.ts +1 -1
package/dist/bare/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Query } from '@lightsparkdev/core';
|
|
1
|
+
import { Query, Logger, LoggingLevel } from '@lightsparkdev/core';
|
|
2
2
|
import * as btc from '@scure/btc-signer';
|
|
3
3
|
import { Transaction } from '@scure/btc-signer';
|
|
4
4
|
import { HDKey } from '@scure/bip32';
|
|
@@ -863,6 +863,13 @@ declare enum UtxoSwapRequestType {
|
|
|
863
863
|
Refund = 2,
|
|
864
864
|
UNRECOGNIZED = -1
|
|
865
865
|
}
|
|
866
|
+
declare enum InvoiceStatus {
|
|
867
|
+
NOT_FOUND = 0,
|
|
868
|
+
PENDING = 1,
|
|
869
|
+
FINALIZED = 2,
|
|
870
|
+
EXPIRED = 3,
|
|
871
|
+
UNRECOGNIZED = -1
|
|
872
|
+
}
|
|
866
873
|
declare enum InitiatePreimageSwapRequest_Reason {
|
|
867
874
|
/** REASON_SEND - The associated lightning service is sending the payment. */
|
|
868
875
|
REASON_SEND = 0,
|
|
@@ -953,6 +960,21 @@ interface GenerateDepositAddressResponse {
|
|
|
953
960
|
depositAddress: Address | undefined;
|
|
954
961
|
}
|
|
955
962
|
declare const GenerateDepositAddressResponse: MessageFns$2<GenerateDepositAddressResponse>;
|
|
963
|
+
/** GenerateStaticDepositAddressRequest is the request to generate a static deposit address. */
|
|
964
|
+
interface GenerateStaticDepositAddressRequest {
|
|
965
|
+
/** The signing public key of the user. */
|
|
966
|
+
signingPublicKey: Uint8Array;
|
|
967
|
+
/** The identity public key of the user. */
|
|
968
|
+
identityPublicKey: Uint8Array;
|
|
969
|
+
/** The network of the bitcoin network. */
|
|
970
|
+
network: Network$1;
|
|
971
|
+
}
|
|
972
|
+
declare const GenerateStaticDepositAddressRequest: MessageFns$2<GenerateStaticDepositAddressRequest>;
|
|
973
|
+
/** GenerateStaticDepositAddressResponse is the response to the request to generate a static deposit address. */
|
|
974
|
+
interface GenerateStaticDepositAddressResponse {
|
|
975
|
+
depositAddress: Address | undefined;
|
|
976
|
+
}
|
|
977
|
+
declare const GenerateStaticDepositAddressResponse: MessageFns$2<GenerateStaticDepositAddressResponse>;
|
|
956
978
|
/**
|
|
957
979
|
* UTXO represents a utxo on the bitcoin network.
|
|
958
980
|
* The UTXO is used to create a tree on Spark, it can also be an off-chain utxo so that the user
|
|
@@ -1544,6 +1566,7 @@ interface TransferLeaf {
|
|
|
1544
1566
|
intermediateRefundTx: Uint8Array;
|
|
1545
1567
|
intermediateDirectRefundTx: Uint8Array;
|
|
1546
1568
|
intermediateDirectFromCpfpRefundTx: Uint8Array;
|
|
1569
|
+
pendingKeyTweakPublicKey: Uint8Array;
|
|
1547
1570
|
}
|
|
1548
1571
|
declare const TransferLeaf: MessageFns$2<TransferLeaf>;
|
|
1549
1572
|
interface TransferFilter {
|
|
@@ -1743,6 +1766,7 @@ interface QueryUserSignedRefundsRequest {
|
|
|
1743
1766
|
declare const QueryUserSignedRefundsRequest: MessageFns$2<QueryUserSignedRefundsRequest>;
|
|
1744
1767
|
interface QueryUserSignedRefundsResponse {
|
|
1745
1768
|
userSignedRefunds: UserSignedRefund[];
|
|
1769
|
+
transfer: Transfer | undefined;
|
|
1746
1770
|
}
|
|
1747
1771
|
declare const QueryUserSignedRefundsResponse: MessageFns$2<QueryUserSignedRefundsResponse>;
|
|
1748
1772
|
interface ProvidePreimageRequest {
|
|
@@ -1824,6 +1848,7 @@ interface DepositAddressQueryResult {
|
|
|
1824
1848
|
userSigningPublicKey: Uint8Array;
|
|
1825
1849
|
verifyingPublicKey: Uint8Array;
|
|
1826
1850
|
leafId?: string | undefined;
|
|
1851
|
+
proofOfPossession?: DepositAddressProof | undefined;
|
|
1827
1852
|
}
|
|
1828
1853
|
declare const DepositAddressQueryResult: MessageFns$2<DepositAddressQueryResult>;
|
|
1829
1854
|
interface QueryUnusedDepositAddressesResponse {
|
|
@@ -1986,6 +2011,7 @@ interface GetUtxosForAddressRequest {
|
|
|
1986
2011
|
offset: number;
|
|
1987
2012
|
limit: number;
|
|
1988
2013
|
network: Network$1;
|
|
2014
|
+
excludeClaimed: boolean;
|
|
1989
2015
|
}
|
|
1990
2016
|
declare const GetUtxosForAddressRequest: MessageFns$2<GetUtxosForAddressRequest>;
|
|
1991
2017
|
interface GetUtxosForAddressResponse {
|
|
@@ -1993,8 +2019,27 @@ interface GetUtxosForAddressResponse {
|
|
|
1993
2019
|
offset: number;
|
|
1994
2020
|
}
|
|
1995
2021
|
declare const GetUtxosForAddressResponse: MessageFns$2<GetUtxosForAddressResponse>;
|
|
2022
|
+
interface QuerySparkInvoicesRequest {
|
|
2023
|
+
limit: number;
|
|
2024
|
+
offset: number;
|
|
2025
|
+
/** returns the status for the provided list of spark invoices. */
|
|
2026
|
+
invoice: string[];
|
|
2027
|
+
}
|
|
2028
|
+
declare const QuerySparkInvoicesRequest: MessageFns$2<QuerySparkInvoicesRequest>;
|
|
2029
|
+
interface QuerySparkInvoicesResponse {
|
|
2030
|
+
offset: number;
|
|
2031
|
+
invoiceStatuses: InvoiceResponse[];
|
|
2032
|
+
}
|
|
2033
|
+
declare const QuerySparkInvoicesResponse: MessageFns$2<QuerySparkInvoicesResponse>;
|
|
2034
|
+
interface InvoiceResponse {
|
|
2035
|
+
invoice: string;
|
|
2036
|
+
status: InvoiceStatus;
|
|
2037
|
+
}
|
|
2038
|
+
declare const InvoiceResponse: MessageFns$2<InvoiceResponse>;
|
|
1996
2039
|
interface SparkServiceClient<CallOptionsExt = {}> {
|
|
1997
2040
|
generate_deposit_address(request: DeepPartial$2<GenerateDepositAddressRequest>, options?: CallOptions & CallOptionsExt): Promise<GenerateDepositAddressResponse>;
|
|
2041
|
+
/** Generates a new static deposit address of the user or returns the existing one for the specified network. */
|
|
2042
|
+
generate_static_deposit_address(request: DeepPartial$2<GenerateStaticDepositAddressRequest>, options?: CallOptions & CallOptionsExt): Promise<GenerateStaticDepositAddressResponse>;
|
|
1998
2043
|
start_deposit_tree_creation(request: DeepPartial$2<StartDepositTreeCreationRequest>, options?: CallOptions & CallOptionsExt): Promise<StartDepositTreeCreationResponse>;
|
|
1999
2044
|
/**
|
|
2000
2045
|
* This is deprecated, please use start_deposit_tree_creation instead.
|
|
@@ -2087,6 +2132,7 @@ interface SparkServiceClient<CallOptionsExt = {}> {
|
|
|
2087
2132
|
start_transfer_v2(request: DeepPartial$2<StartTransferRequest>, options?: CallOptions & CallOptionsExt): Promise<StartTransferResponse>;
|
|
2088
2133
|
refresh_timelock_v2(request: DeepPartial$2<RefreshTimelockRequest>, options?: CallOptions & CallOptionsExt): Promise<RefreshTimelockResponse>;
|
|
2089
2134
|
get_utxos_for_address(request: DeepPartial$2<GetUtxosForAddressRequest>, options?: CallOptions & CallOptionsExt): Promise<GetUtxosForAddressResponse>;
|
|
2135
|
+
query_spark_invoices(request: DeepPartial$2<QuerySparkInvoicesRequest>, options?: CallOptions & CallOptionsExt): Promise<QuerySparkInvoicesResponse>;
|
|
2090
2136
|
}
|
|
2091
2137
|
type Builtin$2 = Date | Function | Uint8Array | string | number | boolean | undefined;
|
|
2092
2138
|
type DeepPartial$2<T> = T extends Builtin$2 ? T : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial$2<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial$2<U>> : T extends {
|
|
@@ -3286,8 +3332,6 @@ declare class SparkWallet extends EventEmitter {
|
|
|
3286
3332
|
getStaticDepositAddress(): Promise<string>;
|
|
3287
3333
|
/**
|
|
3288
3334
|
* Generates a deposit address for receiving funds.
|
|
3289
|
-
*
|
|
3290
|
-
* @param {boolean} static - Whether the address is static or single use
|
|
3291
3335
|
* @returns {Promise<string>} A deposit address
|
|
3292
3336
|
* @private
|
|
3293
3337
|
*/
|
|
@@ -3301,7 +3345,7 @@ declare class SparkWallet extends EventEmitter {
|
|
|
3301
3345
|
* @param offset - Pagination offset (default 0).
|
|
3302
3346
|
* @returns {Promise<{ txid: string, vout: number }[]>} List of confirmed UTXOs.
|
|
3303
3347
|
*/
|
|
3304
|
-
getUtxosForDepositAddress(depositAddress: string, limit?: number, offset?: number): Promise<{
|
|
3348
|
+
getUtxosForDepositAddress(depositAddress: string, limit?: number, offset?: number, excludeClaimed?: boolean): Promise<{
|
|
3305
3349
|
txid: string;
|
|
3306
3350
|
vout: number;
|
|
3307
3351
|
}[]>;
|
|
@@ -3876,4 +3920,17 @@ declare function constructFeeBumpTx(txHex: string, utxos: Utxo[], feeRate: FeeRa
|
|
|
3876
3920
|
|
|
3877
3921
|
declare function getSparkAddressFromTaproot(taprootAddress: string): SparkAddressFormat;
|
|
3878
3922
|
|
|
3879
|
-
|
|
3923
|
+
declare const LOGGER_NAMES: {
|
|
3924
|
+
readonly wasm: "wasm";
|
|
3925
|
+
};
|
|
3926
|
+
type LoggerName = (typeof LOGGER_NAMES)[keyof typeof LOGGER_NAMES];
|
|
3927
|
+
declare class SparkSdkLogger {
|
|
3928
|
+
private static loggers;
|
|
3929
|
+
static get(name: LoggerName): Logger;
|
|
3930
|
+
static setLevel(name: LoggerName, level: LoggingLevel): void;
|
|
3931
|
+
static setAllLevels(level: LoggingLevel): void;
|
|
3932
|
+
static setEnabled(name: LoggerName, enabled: boolean): void;
|
|
3933
|
+
static setAllEnabled(enabled: boolean): void;
|
|
3934
|
+
}
|
|
3935
|
+
|
|
3936
|
+
export { type AggregateFrostParams, AuthenticationError, type Bech32mTokenIdentifier, type Bech32mTokenIdentifierData, type BroadcastConfig, type BroadcastResult, ConfigurationError, DEFAULT_FEE_SATS, DIRECT_TIMELOCK_OFFSET, type DecodedSparkAddressData, DefaultSparkSigner, type FeeBumpTxChain, type FeeBumpTxPackage, type FeeRate, type IKeyPackage, INITIAL_DIRECT_SEQUENCE, INITIAL_SEQUENCE, InternalValidationError, LOGGER_NAMES, LRC_WALLET_NETWORK, type LeafInfo, type LoggerName, Network, NetworkError, NetworkToProto, type NetworkType, NotImplementedError, RPCError, type SignFrostParams, type SparkAddressData, type SparkAddressFormat, SparkSDKError, SparkSdkLogger, type SparkSigner, SparkWalletBrowser as SparkWallet, TEST_UNILATERAL_DIRECT_SEQUENCE, TEST_UNILATERAL_SEQUENCE, TaprootOutputKeysGenerator, TaprootSparkSigner, type TxChain, UnsafeStatelessSparkSigner, type Utxo, ValidationError, type VerifiableSecretShare, addPrivateKeys, addPublicKeys, applyAdaptorToSignature, applyAdditiveTweakToPublicKey, bech32mDecode, bigIntToPrivateKey, checkIfSelectedOutputsAreAvailable, checkIfValidSequence, collectResponses, computeTaprootKeyNoScript, computerLagrangeCoefficients, constructFeeBumpTx, constructUnilateralExitFeeBumpPackages, constructUnilateralExitTxs, createConnectorRefundTransactions, createLeafNodeTx, createNodeTx, createNodeTxs, createRefundTx, createRefundTxs, createRootTx, createSigningCommitment, createSigningNonce, createSplitTx, decodeBech32mTokenIdentifier, decodeBytesToSigningCommitment, decodeBytesToSigningNonce, decodeSparkAddress, doesLeafNeedRefresh, encodeBech32mTokenIdentifier, encodeSigningCommitmentToBytes, encodeSigningNonceToBytes, encodeSparkAddress, encodeSparkAddressWithSignature, evaluatePolynomial, fieldDiv, filterTokenBalanceForTokenIdentifier, generateAdaptorFromSignature, generatePolynomialForSecretSharing, generateSignatureFromExistingAdaptor, getCurrentTimelock, getEphemeralAnchorOutput, getLatestDepositTxId, getNetwork, getNetworkFromAddress, getNetworkFromBech32mTokenIdentifier, getNetworkFromSparkAddress, getNetworkFromString, getNextTransactionSequence, getP2TRAddressFromPkScript, getP2TRAddressFromPublicKey, getP2TRScriptFromPublicKey, getP2WPKHAddressFromPublicKey, getRandomBigInt, getRandomSigningNonce, getSigHashFromTx, getSigningCommitmentFromNonce, getSparkAddressFromTaproot, getTransactionSequence, getTransferPackageSigningPayload, getTxEstimatedVbytesSizeByNumberOfInputsOutputs, getTxFromRawTxBytes, getTxFromRawTxHex, getTxId, getTxIdNoReverse, isEphemeralAnchorOutput, isTxBroadcast, isValidPublicKey, isValidSparkAddress, lastKeyWithTarget, maybeApplyFee, modInverse, proofOfPossessionMessageHashForDepositAddress, protoToNetwork, recoverSecret, splitSecret, splitSecretWithProofs, subtractPrivateKeys, subtractPublicKeys, sumAvailableTokens, sumOfPrivateKeys, toProtoTimestamp, validateOutboundAdaptorSignature, validateShare, validateSparkInvoiceFields, validateSparkInvoiceSignature };
|
package/dist/bare/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Query } from '@lightsparkdev/core';
|
|
1
|
+
import { Query, Logger, LoggingLevel } from '@lightsparkdev/core';
|
|
2
2
|
import * as btc from '@scure/btc-signer';
|
|
3
3
|
import { Transaction } from '@scure/btc-signer';
|
|
4
4
|
import { HDKey } from '@scure/bip32';
|
|
@@ -863,6 +863,13 @@ declare enum UtxoSwapRequestType {
|
|
|
863
863
|
Refund = 2,
|
|
864
864
|
UNRECOGNIZED = -1
|
|
865
865
|
}
|
|
866
|
+
declare enum InvoiceStatus {
|
|
867
|
+
NOT_FOUND = 0,
|
|
868
|
+
PENDING = 1,
|
|
869
|
+
FINALIZED = 2,
|
|
870
|
+
EXPIRED = 3,
|
|
871
|
+
UNRECOGNIZED = -1
|
|
872
|
+
}
|
|
866
873
|
declare enum InitiatePreimageSwapRequest_Reason {
|
|
867
874
|
/** REASON_SEND - The associated lightning service is sending the payment. */
|
|
868
875
|
REASON_SEND = 0,
|
|
@@ -953,6 +960,21 @@ interface GenerateDepositAddressResponse {
|
|
|
953
960
|
depositAddress: Address | undefined;
|
|
954
961
|
}
|
|
955
962
|
declare const GenerateDepositAddressResponse: MessageFns$2<GenerateDepositAddressResponse>;
|
|
963
|
+
/** GenerateStaticDepositAddressRequest is the request to generate a static deposit address. */
|
|
964
|
+
interface GenerateStaticDepositAddressRequest {
|
|
965
|
+
/** The signing public key of the user. */
|
|
966
|
+
signingPublicKey: Uint8Array;
|
|
967
|
+
/** The identity public key of the user. */
|
|
968
|
+
identityPublicKey: Uint8Array;
|
|
969
|
+
/** The network of the bitcoin network. */
|
|
970
|
+
network: Network$1;
|
|
971
|
+
}
|
|
972
|
+
declare const GenerateStaticDepositAddressRequest: MessageFns$2<GenerateStaticDepositAddressRequest>;
|
|
973
|
+
/** GenerateStaticDepositAddressResponse is the response to the request to generate a static deposit address. */
|
|
974
|
+
interface GenerateStaticDepositAddressResponse {
|
|
975
|
+
depositAddress: Address | undefined;
|
|
976
|
+
}
|
|
977
|
+
declare const GenerateStaticDepositAddressResponse: MessageFns$2<GenerateStaticDepositAddressResponse>;
|
|
956
978
|
/**
|
|
957
979
|
* UTXO represents a utxo on the bitcoin network.
|
|
958
980
|
* The UTXO is used to create a tree on Spark, it can also be an off-chain utxo so that the user
|
|
@@ -1544,6 +1566,7 @@ interface TransferLeaf {
|
|
|
1544
1566
|
intermediateRefundTx: Uint8Array;
|
|
1545
1567
|
intermediateDirectRefundTx: Uint8Array;
|
|
1546
1568
|
intermediateDirectFromCpfpRefundTx: Uint8Array;
|
|
1569
|
+
pendingKeyTweakPublicKey: Uint8Array;
|
|
1547
1570
|
}
|
|
1548
1571
|
declare const TransferLeaf: MessageFns$2<TransferLeaf>;
|
|
1549
1572
|
interface TransferFilter {
|
|
@@ -1743,6 +1766,7 @@ interface QueryUserSignedRefundsRequest {
|
|
|
1743
1766
|
declare const QueryUserSignedRefundsRequest: MessageFns$2<QueryUserSignedRefundsRequest>;
|
|
1744
1767
|
interface QueryUserSignedRefundsResponse {
|
|
1745
1768
|
userSignedRefunds: UserSignedRefund[];
|
|
1769
|
+
transfer: Transfer | undefined;
|
|
1746
1770
|
}
|
|
1747
1771
|
declare const QueryUserSignedRefundsResponse: MessageFns$2<QueryUserSignedRefundsResponse>;
|
|
1748
1772
|
interface ProvidePreimageRequest {
|
|
@@ -1824,6 +1848,7 @@ interface DepositAddressQueryResult {
|
|
|
1824
1848
|
userSigningPublicKey: Uint8Array;
|
|
1825
1849
|
verifyingPublicKey: Uint8Array;
|
|
1826
1850
|
leafId?: string | undefined;
|
|
1851
|
+
proofOfPossession?: DepositAddressProof | undefined;
|
|
1827
1852
|
}
|
|
1828
1853
|
declare const DepositAddressQueryResult: MessageFns$2<DepositAddressQueryResult>;
|
|
1829
1854
|
interface QueryUnusedDepositAddressesResponse {
|
|
@@ -1986,6 +2011,7 @@ interface GetUtxosForAddressRequest {
|
|
|
1986
2011
|
offset: number;
|
|
1987
2012
|
limit: number;
|
|
1988
2013
|
network: Network$1;
|
|
2014
|
+
excludeClaimed: boolean;
|
|
1989
2015
|
}
|
|
1990
2016
|
declare const GetUtxosForAddressRequest: MessageFns$2<GetUtxosForAddressRequest>;
|
|
1991
2017
|
interface GetUtxosForAddressResponse {
|
|
@@ -1993,8 +2019,27 @@ interface GetUtxosForAddressResponse {
|
|
|
1993
2019
|
offset: number;
|
|
1994
2020
|
}
|
|
1995
2021
|
declare const GetUtxosForAddressResponse: MessageFns$2<GetUtxosForAddressResponse>;
|
|
2022
|
+
interface QuerySparkInvoicesRequest {
|
|
2023
|
+
limit: number;
|
|
2024
|
+
offset: number;
|
|
2025
|
+
/** returns the status for the provided list of spark invoices. */
|
|
2026
|
+
invoice: string[];
|
|
2027
|
+
}
|
|
2028
|
+
declare const QuerySparkInvoicesRequest: MessageFns$2<QuerySparkInvoicesRequest>;
|
|
2029
|
+
interface QuerySparkInvoicesResponse {
|
|
2030
|
+
offset: number;
|
|
2031
|
+
invoiceStatuses: InvoiceResponse[];
|
|
2032
|
+
}
|
|
2033
|
+
declare const QuerySparkInvoicesResponse: MessageFns$2<QuerySparkInvoicesResponse>;
|
|
2034
|
+
interface InvoiceResponse {
|
|
2035
|
+
invoice: string;
|
|
2036
|
+
status: InvoiceStatus;
|
|
2037
|
+
}
|
|
2038
|
+
declare const InvoiceResponse: MessageFns$2<InvoiceResponse>;
|
|
1996
2039
|
interface SparkServiceClient<CallOptionsExt = {}> {
|
|
1997
2040
|
generate_deposit_address(request: DeepPartial$2<GenerateDepositAddressRequest>, options?: CallOptions & CallOptionsExt): Promise<GenerateDepositAddressResponse>;
|
|
2041
|
+
/** Generates a new static deposit address of the user or returns the existing one for the specified network. */
|
|
2042
|
+
generate_static_deposit_address(request: DeepPartial$2<GenerateStaticDepositAddressRequest>, options?: CallOptions & CallOptionsExt): Promise<GenerateStaticDepositAddressResponse>;
|
|
1998
2043
|
start_deposit_tree_creation(request: DeepPartial$2<StartDepositTreeCreationRequest>, options?: CallOptions & CallOptionsExt): Promise<StartDepositTreeCreationResponse>;
|
|
1999
2044
|
/**
|
|
2000
2045
|
* This is deprecated, please use start_deposit_tree_creation instead.
|
|
@@ -2087,6 +2132,7 @@ interface SparkServiceClient<CallOptionsExt = {}> {
|
|
|
2087
2132
|
start_transfer_v2(request: DeepPartial$2<StartTransferRequest>, options?: CallOptions & CallOptionsExt): Promise<StartTransferResponse>;
|
|
2088
2133
|
refresh_timelock_v2(request: DeepPartial$2<RefreshTimelockRequest>, options?: CallOptions & CallOptionsExt): Promise<RefreshTimelockResponse>;
|
|
2089
2134
|
get_utxos_for_address(request: DeepPartial$2<GetUtxosForAddressRequest>, options?: CallOptions & CallOptionsExt): Promise<GetUtxosForAddressResponse>;
|
|
2135
|
+
query_spark_invoices(request: DeepPartial$2<QuerySparkInvoicesRequest>, options?: CallOptions & CallOptionsExt): Promise<QuerySparkInvoicesResponse>;
|
|
2090
2136
|
}
|
|
2091
2137
|
type Builtin$2 = Date | Function | Uint8Array | string | number | boolean | undefined;
|
|
2092
2138
|
type DeepPartial$2<T> = T extends Builtin$2 ? T : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial$2<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial$2<U>> : T extends {
|
|
@@ -3286,8 +3332,6 @@ declare class SparkWallet extends EventEmitter {
|
|
|
3286
3332
|
getStaticDepositAddress(): Promise<string>;
|
|
3287
3333
|
/**
|
|
3288
3334
|
* Generates a deposit address for receiving funds.
|
|
3289
|
-
*
|
|
3290
|
-
* @param {boolean} static - Whether the address is static or single use
|
|
3291
3335
|
* @returns {Promise<string>} A deposit address
|
|
3292
3336
|
* @private
|
|
3293
3337
|
*/
|
|
@@ -3301,7 +3345,7 @@ declare class SparkWallet extends EventEmitter {
|
|
|
3301
3345
|
* @param offset - Pagination offset (default 0).
|
|
3302
3346
|
* @returns {Promise<{ txid: string, vout: number }[]>} List of confirmed UTXOs.
|
|
3303
3347
|
*/
|
|
3304
|
-
getUtxosForDepositAddress(depositAddress: string, limit?: number, offset?: number): Promise<{
|
|
3348
|
+
getUtxosForDepositAddress(depositAddress: string, limit?: number, offset?: number, excludeClaimed?: boolean): Promise<{
|
|
3305
3349
|
txid: string;
|
|
3306
3350
|
vout: number;
|
|
3307
3351
|
}[]>;
|
|
@@ -3876,4 +3920,17 @@ declare function constructFeeBumpTx(txHex: string, utxos: Utxo[], feeRate: FeeRa
|
|
|
3876
3920
|
|
|
3877
3921
|
declare function getSparkAddressFromTaproot(taprootAddress: string): SparkAddressFormat;
|
|
3878
3922
|
|
|
3879
|
-
|
|
3923
|
+
declare const LOGGER_NAMES: {
|
|
3924
|
+
readonly wasm: "wasm";
|
|
3925
|
+
};
|
|
3926
|
+
type LoggerName = (typeof LOGGER_NAMES)[keyof typeof LOGGER_NAMES];
|
|
3927
|
+
declare class SparkSdkLogger {
|
|
3928
|
+
private static loggers;
|
|
3929
|
+
static get(name: LoggerName): Logger;
|
|
3930
|
+
static setLevel(name: LoggerName, level: LoggingLevel): void;
|
|
3931
|
+
static setAllLevels(level: LoggingLevel): void;
|
|
3932
|
+
static setEnabled(name: LoggerName, enabled: boolean): void;
|
|
3933
|
+
static setAllEnabled(enabled: boolean): void;
|
|
3934
|
+
}
|
|
3935
|
+
|
|
3936
|
+
export { type AggregateFrostParams, AuthenticationError, type Bech32mTokenIdentifier, type Bech32mTokenIdentifierData, type BroadcastConfig, type BroadcastResult, ConfigurationError, DEFAULT_FEE_SATS, DIRECT_TIMELOCK_OFFSET, type DecodedSparkAddressData, DefaultSparkSigner, type FeeBumpTxChain, type FeeBumpTxPackage, type FeeRate, type IKeyPackage, INITIAL_DIRECT_SEQUENCE, INITIAL_SEQUENCE, InternalValidationError, LOGGER_NAMES, LRC_WALLET_NETWORK, type LeafInfo, type LoggerName, Network, NetworkError, NetworkToProto, type NetworkType, NotImplementedError, RPCError, type SignFrostParams, type SparkAddressData, type SparkAddressFormat, SparkSDKError, SparkSdkLogger, type SparkSigner, SparkWalletBrowser as SparkWallet, TEST_UNILATERAL_DIRECT_SEQUENCE, TEST_UNILATERAL_SEQUENCE, TaprootOutputKeysGenerator, TaprootSparkSigner, type TxChain, UnsafeStatelessSparkSigner, type Utxo, ValidationError, type VerifiableSecretShare, addPrivateKeys, addPublicKeys, applyAdaptorToSignature, applyAdditiveTweakToPublicKey, bech32mDecode, bigIntToPrivateKey, checkIfSelectedOutputsAreAvailable, checkIfValidSequence, collectResponses, computeTaprootKeyNoScript, computerLagrangeCoefficients, constructFeeBumpTx, constructUnilateralExitFeeBumpPackages, constructUnilateralExitTxs, createConnectorRefundTransactions, createLeafNodeTx, createNodeTx, createNodeTxs, createRefundTx, createRefundTxs, createRootTx, createSigningCommitment, createSigningNonce, createSplitTx, decodeBech32mTokenIdentifier, decodeBytesToSigningCommitment, decodeBytesToSigningNonce, decodeSparkAddress, doesLeafNeedRefresh, encodeBech32mTokenIdentifier, encodeSigningCommitmentToBytes, encodeSigningNonceToBytes, encodeSparkAddress, encodeSparkAddressWithSignature, evaluatePolynomial, fieldDiv, filterTokenBalanceForTokenIdentifier, generateAdaptorFromSignature, generatePolynomialForSecretSharing, generateSignatureFromExistingAdaptor, getCurrentTimelock, getEphemeralAnchorOutput, getLatestDepositTxId, getNetwork, getNetworkFromAddress, getNetworkFromBech32mTokenIdentifier, getNetworkFromSparkAddress, getNetworkFromString, getNextTransactionSequence, getP2TRAddressFromPkScript, getP2TRAddressFromPublicKey, getP2TRScriptFromPublicKey, getP2WPKHAddressFromPublicKey, getRandomBigInt, getRandomSigningNonce, getSigHashFromTx, getSigningCommitmentFromNonce, getSparkAddressFromTaproot, getTransactionSequence, getTransferPackageSigningPayload, getTxEstimatedVbytesSizeByNumberOfInputsOutputs, getTxFromRawTxBytes, getTxFromRawTxHex, getTxId, getTxIdNoReverse, isEphemeralAnchorOutput, isTxBroadcast, isValidPublicKey, isValidSparkAddress, lastKeyWithTarget, maybeApplyFee, modInverse, proofOfPossessionMessageHashForDepositAddress, protoToNetwork, recoverSecret, splitSecret, splitSecretWithProofs, subtractPrivateKeys, subtractPublicKeys, sumAvailableTokens, sumOfPrivateKeys, toProtoTimestamp, validateOutboundAdaptorSignature, validateShare, validateSparkInvoiceFields, validateSparkInvoiceSignature };
|