@buildonspark/spark-sdk 0.3.7 → 0.3.9
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/bare/index.cjs +8088 -7723
- package/dist/bare/index.d.cts +350 -262
- package/dist/bare/index.d.ts +350 -262
- package/dist/bare/index.js +7968 -7608
- package/dist/{chunk-J2P3KTQP.js → chunk-4YFT7DAE.js} +1 -1
- package/dist/{chunk-XWLR6G5C.js → chunk-JLF6WJ7K.js} +1 -1
- package/dist/{chunk-UYTT3C6H.js → chunk-MFCM6GUD.js} +40 -213
- package/dist/{chunk-KDEVNW7C.js → chunk-O4C4HGQL.js} +3391 -3292
- package/dist/{chunk-SRPKOCG4.js → chunk-S55NZT4P.js} +8 -10
- package/dist/{chunk-P4HYYSMU.js → chunk-WRE2T22S.js} +1 -1
- package/dist/{chunk-IC4IUEOS.js → chunk-YEBEN7XD.js} +309 -38
- package/dist/{client-Bcb7TUIp.d.cts → client-BIqiUNy4.d.cts} +2 -2
- package/dist/{client-D9T58OY8.d.ts → client-BaQf-5gD.d.ts} +2 -2
- package/dist/debug.cjs +8068 -7704
- package/dist/debug.d.cts +25 -18
- package/dist/debug.d.ts +25 -18
- package/dist/debug.js +5 -5
- package/dist/graphql/objects/index.d.cts +3 -3
- package/dist/graphql/objects/index.d.ts +3 -3
- package/dist/index.cjs +6871 -6501
- package/dist/index.d.cts +9 -8
- package/dist/index.d.ts +9 -8
- package/dist/index.js +36 -24
- package/dist/index.node.cjs +7102 -6903
- package/dist/index.node.d.cts +9 -8
- package/dist/index.node.d.ts +9 -8
- package/dist/index.node.js +35 -23
- package/dist/{logging-zkr4UlOi.d.cts → logging-CXhvuqJJ.d.cts} +45 -35
- package/dist/{logging-JIaZZIbR.d.ts → logging-DDeMLsVN.d.ts} +45 -35
- package/dist/native/{chunk-X2QXUON7.js → chunk-AFP5QR4O.js} +11 -8
- package/dist/native/index.react-native.cjs +7054 -6677
- package/dist/native/index.react-native.d.cts +180 -92
- package/dist/native/index.react-native.d.ts +180 -92
- package/dist/native/index.react-native.js +6760 -6393
- package/dist/native/{wasm-GKEDPGTM.js → wasm-D4TI35NF.js} +1 -1
- package/dist/proto/spark.cjs +309 -38
- package/dist/proto/spark.d.cts +1 -1
- package/dist/proto/spark.d.ts +1 -1
- package/dist/proto/spark.js +5 -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-WA_4wcBr.d.cts → spark-DOpheE8_.d.cts} +69 -7
- package/dist/{spark-WA_4wcBr.d.ts → spark-DOpheE8_.d.ts} +69 -7
- package/dist/{spark-wallet.browser-DC3jdQPW.d.cts → spark-wallet.browser-CbYo8A_U.d.cts} +8 -8
- package/dist/{spark-wallet.browser-BwYkkOBU.d.ts → spark-wallet.browser-Cz8c4kOW.d.ts} +8 -8
- package/dist/{spark-wallet.node-CR_zNxmy.d.cts → spark-wallet.node-4WQgWwB2.d.cts} +9 -31
- package/dist/{spark-wallet.node-C9d2W-Nb.d.ts → spark-wallet.node-CmIvxtcC.d.ts} +9 -31
- package/dist/tests/test-utils.cjs +7341 -7065
- package/dist/tests/test-utils.d.cts +7 -5
- package/dist/tests/test-utils.d.ts +7 -5
- package/dist/tests/test-utils.js +7 -7
- package/dist/{token-transactions-BZoJuvuE.d.ts → token-transactions-Bu023ztN.d.ts} +2 -2
- package/dist/{token-transactions-I_OFIoNH.d.cts → token-transactions-CV8QD3I7.d.cts} +2 -2
- package/dist/types/index.cjs +307 -38
- 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/{spark-wallet-CE5PYiIb.d.ts → wallet-config-Bmk2eAn8.d.ts} +310 -287
- package/dist/{spark-wallet-BuFrUWeE.d.cts → wallet-config-DQw5llqA.d.cts} +310 -287
- package/package.json +3 -3
- package/src/proto/mock.ts +0 -264
- package/src/proto/spark.ts +433 -46
- package/src/services/config.ts +5 -0
- package/src/services/connection/connection.browser.ts +27 -19
- package/src/services/connection/connection.node.ts +79 -24
- package/src/services/connection/connection.ts +395 -233
- package/src/services/coop-exit.ts +26 -107
- package/src/services/deposit.ts +12 -48
- package/src/services/lightning.ts +30 -4
- package/src/services/signing.ts +187 -37
- package/src/services/transfer.ts +553 -723
- package/src/services/wallet-config.ts +6 -0
- package/src/spark-wallet/proto-descriptors.ts +1 -1
- package/src/spark-wallet/spark-wallet.ts +132 -313
- package/src/spark-wallet/types.ts +2 -2
- package/src/spark_descriptors.pb +0 -0
- package/src/tests/connection.test.ts +537 -0
- package/src/tests/integration/connection.test.ts +39 -0
- package/src/tests/integration/lightning.test.ts +32 -16
- package/src/tests/integration/static_deposit.test.ts +13 -11
- package/src/tests/integration/transfer.test.ts +13 -1
- package/src/tests/isHermeticTest.ts +1 -1
- package/src/tests/utils/test-faucet.ts +53 -20
- package/src/utils/htlc-transactions.ts +224 -0
- package/src/utils/transaction.ts +285 -248
|
@@ -1,30 +1,14 @@
|
|
|
1
|
-
import { C as ConnectionManager, W as WalletConfigService, $ as SparkCallOptions, a0 as SparkAuthnServiceDefinition, a1 as SparkWallet } from './
|
|
1
|
+
import { C as ConnectionManager, W as WalletConfigService, $ as SparkCallOptions, a0 as SparkAuthnServiceDefinition, a1 as RetryOptions, a2 as SparkWallet } from './wallet-config-DQw5llqA.cjs';
|
|
2
|
+
import { E as Empty, b as SparkServiceDefinition, d as SubscribeToEventsResponse } from './spark-DOpheE8_.cjs';
|
|
2
3
|
import { Channel } from 'nice-grpc';
|
|
3
|
-
import { CallOptions, ClientMiddlewareCall } from 'nice-grpc-common';
|
|
4
|
-
import { E as Empty, b as SparkServiceDefinition } from './spark-WA_4wcBr.cjs';
|
|
4
|
+
import { CallOptions, ClientMiddlewareCall, ClientMiddleware } from 'nice-grpc-common';
|
|
5
5
|
import { BinaryWriter, BinaryReader } from '@bufbuild/protobuf/wire';
|
|
6
6
|
import { SparkTokenServiceDefinition } from './proto/spark_token.cjs';
|
|
7
7
|
|
|
8
|
-
declare enum InterruptTransferRequest_InterruptTransferAction {
|
|
9
|
-
NONE = 0,
|
|
10
|
-
INTERRUPT = 1,
|
|
11
|
-
RESUME = 2,
|
|
12
|
-
UNRECOGNIZED = -1
|
|
13
|
-
}
|
|
14
|
-
declare enum InterruptCoopExitRequest_InterruptCoopExitAction {
|
|
15
|
-
NONE = 0,
|
|
16
|
-
INTERRUPT = 1,
|
|
17
|
-
RESUME = 2,
|
|
18
|
-
UNRECOGNIZED = -1
|
|
19
|
-
}
|
|
20
8
|
interface CleanUpPreimageShareRequest {
|
|
21
9
|
paymentHash: Uint8Array;
|
|
22
10
|
}
|
|
23
11
|
declare const CleanUpPreimageShareRequest: MessageFns<CleanUpPreimageShareRequest>;
|
|
24
|
-
interface InterruptTransferRequest {
|
|
25
|
-
action: InterruptTransferRequest_InterruptTransferAction;
|
|
26
|
-
}
|
|
27
|
-
declare const InterruptTransferRequest: MessageFns<InterruptTransferRequest>;
|
|
28
12
|
interface UpdateNodesStatusRequest {
|
|
29
13
|
nodeIds: string[];
|
|
30
14
|
status: string;
|
|
@@ -35,16 +19,8 @@ interface TriggerTaskRequest {
|
|
|
35
19
|
taskName: string;
|
|
36
20
|
}
|
|
37
21
|
declare const TriggerTaskRequest: MessageFns<TriggerTaskRequest>;
|
|
38
|
-
interface InterruptCoopExitRequest {
|
|
39
|
-
action: InterruptCoopExitRequest_InterruptCoopExitAction;
|
|
40
|
-
/** optional, defaults to MockAction.TargetOperatorID */
|
|
41
|
-
targetOperator: string;
|
|
42
|
-
}
|
|
43
|
-
declare const InterruptCoopExitRequest: MessageFns<InterruptCoopExitRequest>;
|
|
44
22
|
interface MockServiceClient<CallOptionsExt = {}> {
|
|
45
23
|
clean_up_preimage_share(request: DeepPartial<CleanUpPreimageShareRequest>, options?: CallOptions & CallOptionsExt): Promise<Empty>;
|
|
46
|
-
interrupt_transfer(request: DeepPartial<InterruptTransferRequest>, options?: CallOptions & CallOptionsExt): Promise<Empty>;
|
|
47
|
-
interrupt_coop_exit(request: DeepPartial<InterruptCoopExitRequest>, options?: CallOptions & CallOptionsExt): Promise<Empty>;
|
|
48
24
|
update_nodes_status(request: DeepPartial<UpdateNodesStatusRequest>, options?: CallOptions & CallOptionsExt): Promise<Empty>;
|
|
49
25
|
/** Triggers the execution of a scheduled task immediately by name. Used by hermetic tests */
|
|
50
26
|
trigger_task(request: DeepPartial<TriggerTaskRequest>, options?: CallOptions & CallOptionsExt): Promise<Empty>;
|
|
@@ -69,16 +45,18 @@ interface MessageFns<T> {
|
|
|
69
45
|
}
|
|
70
46
|
|
|
71
47
|
declare class ConnectionManagerNodeJS extends ConnectionManager {
|
|
48
|
+
private certPath;
|
|
72
49
|
constructor(config: WalletConfigService);
|
|
73
50
|
createMockClient(address: string): Promise<MockServiceClient & {
|
|
74
51
|
close: () => void;
|
|
75
52
|
}>;
|
|
76
|
-
protected createChannelWithTLS(address: string,
|
|
77
|
-
protected createAuthnMiddleware(): (call: ClientMiddlewareCall<
|
|
78
|
-
protected createMiddleware(address: string
|
|
79
|
-
protected createGrpcClient<T>(
|
|
53
|
+
protected createChannelWithTLS(address: string, isStreamClientType?: boolean): Promise<Channel>;
|
|
54
|
+
protected createAuthnMiddleware(): <Req, Res>(call: ClientMiddlewareCall<Req, Res>, options: SparkCallOptions) => AsyncGenerator<Res, Res | void, undefined>;
|
|
55
|
+
protected createMiddleware(address: string): <Req, Res>(call: ClientMiddlewareCall<Req, Res>, options: SparkCallOptions) => AsyncGenerator<Res, Res | void, undefined>;
|
|
56
|
+
protected createGrpcClient<T>(definition: SparkAuthnServiceDefinition | SparkServiceDefinition | SparkTokenServiceDefinition, channel: Channel, withRetries: boolean, middleware?: ClientMiddleware<RetryOptions, {}>, channelKey?: string): Promise<T & {
|
|
80
57
|
close: () => void;
|
|
81
58
|
}>;
|
|
59
|
+
subscribeToEvents(address: string, signal: AbortSignal): Promise<AsyncIterable<SubscribeToEventsResponse>>;
|
|
82
60
|
}
|
|
83
61
|
|
|
84
62
|
declare class SparkWalletNodeJS extends SparkWallet {
|
|
@@ -1,30 +1,14 @@
|
|
|
1
|
-
import { C as ConnectionManager, W as WalletConfigService, $ as SparkCallOptions, a0 as SparkAuthnServiceDefinition, a1 as SparkWallet } from './
|
|
1
|
+
import { C as ConnectionManager, W as WalletConfigService, $ as SparkCallOptions, a0 as SparkAuthnServiceDefinition, a1 as RetryOptions, a2 as SparkWallet } from './wallet-config-Bmk2eAn8.js';
|
|
2
|
+
import { E as Empty, b as SparkServiceDefinition, d as SubscribeToEventsResponse } from './spark-DOpheE8_.js';
|
|
2
3
|
import { Channel } from 'nice-grpc';
|
|
3
|
-
import { CallOptions, ClientMiddlewareCall } from 'nice-grpc-common';
|
|
4
|
-
import { E as Empty, b as SparkServiceDefinition } from './spark-WA_4wcBr.js';
|
|
4
|
+
import { CallOptions, ClientMiddlewareCall, ClientMiddleware } from 'nice-grpc-common';
|
|
5
5
|
import { BinaryWriter, BinaryReader } from '@bufbuild/protobuf/wire';
|
|
6
6
|
import { SparkTokenServiceDefinition } from './proto/spark_token.js';
|
|
7
7
|
|
|
8
|
-
declare enum InterruptTransferRequest_InterruptTransferAction {
|
|
9
|
-
NONE = 0,
|
|
10
|
-
INTERRUPT = 1,
|
|
11
|
-
RESUME = 2,
|
|
12
|
-
UNRECOGNIZED = -1
|
|
13
|
-
}
|
|
14
|
-
declare enum InterruptCoopExitRequest_InterruptCoopExitAction {
|
|
15
|
-
NONE = 0,
|
|
16
|
-
INTERRUPT = 1,
|
|
17
|
-
RESUME = 2,
|
|
18
|
-
UNRECOGNIZED = -1
|
|
19
|
-
}
|
|
20
8
|
interface CleanUpPreimageShareRequest {
|
|
21
9
|
paymentHash: Uint8Array;
|
|
22
10
|
}
|
|
23
11
|
declare const CleanUpPreimageShareRequest: MessageFns<CleanUpPreimageShareRequest>;
|
|
24
|
-
interface InterruptTransferRequest {
|
|
25
|
-
action: InterruptTransferRequest_InterruptTransferAction;
|
|
26
|
-
}
|
|
27
|
-
declare const InterruptTransferRequest: MessageFns<InterruptTransferRequest>;
|
|
28
12
|
interface UpdateNodesStatusRequest {
|
|
29
13
|
nodeIds: string[];
|
|
30
14
|
status: string;
|
|
@@ -35,16 +19,8 @@ interface TriggerTaskRequest {
|
|
|
35
19
|
taskName: string;
|
|
36
20
|
}
|
|
37
21
|
declare const TriggerTaskRequest: MessageFns<TriggerTaskRequest>;
|
|
38
|
-
interface InterruptCoopExitRequest {
|
|
39
|
-
action: InterruptCoopExitRequest_InterruptCoopExitAction;
|
|
40
|
-
/** optional, defaults to MockAction.TargetOperatorID */
|
|
41
|
-
targetOperator: string;
|
|
42
|
-
}
|
|
43
|
-
declare const InterruptCoopExitRequest: MessageFns<InterruptCoopExitRequest>;
|
|
44
22
|
interface MockServiceClient<CallOptionsExt = {}> {
|
|
45
23
|
clean_up_preimage_share(request: DeepPartial<CleanUpPreimageShareRequest>, options?: CallOptions & CallOptionsExt): Promise<Empty>;
|
|
46
|
-
interrupt_transfer(request: DeepPartial<InterruptTransferRequest>, options?: CallOptions & CallOptionsExt): Promise<Empty>;
|
|
47
|
-
interrupt_coop_exit(request: DeepPartial<InterruptCoopExitRequest>, options?: CallOptions & CallOptionsExt): Promise<Empty>;
|
|
48
24
|
update_nodes_status(request: DeepPartial<UpdateNodesStatusRequest>, options?: CallOptions & CallOptionsExt): Promise<Empty>;
|
|
49
25
|
/** Triggers the execution of a scheduled task immediately by name. Used by hermetic tests */
|
|
50
26
|
trigger_task(request: DeepPartial<TriggerTaskRequest>, options?: CallOptions & CallOptionsExt): Promise<Empty>;
|
|
@@ -69,16 +45,18 @@ interface MessageFns<T> {
|
|
|
69
45
|
}
|
|
70
46
|
|
|
71
47
|
declare class ConnectionManagerNodeJS extends ConnectionManager {
|
|
48
|
+
private certPath;
|
|
72
49
|
constructor(config: WalletConfigService);
|
|
73
50
|
createMockClient(address: string): Promise<MockServiceClient & {
|
|
74
51
|
close: () => void;
|
|
75
52
|
}>;
|
|
76
|
-
protected createChannelWithTLS(address: string,
|
|
77
|
-
protected createAuthnMiddleware(): (call: ClientMiddlewareCall<
|
|
78
|
-
protected createMiddleware(address: string
|
|
79
|
-
protected createGrpcClient<T>(
|
|
53
|
+
protected createChannelWithTLS(address: string, isStreamClientType?: boolean): Promise<Channel>;
|
|
54
|
+
protected createAuthnMiddleware(): <Req, Res>(call: ClientMiddlewareCall<Req, Res>, options: SparkCallOptions) => AsyncGenerator<Res, Res | void, undefined>;
|
|
55
|
+
protected createMiddleware(address: string): <Req, Res>(call: ClientMiddlewareCall<Req, Res>, options: SparkCallOptions) => AsyncGenerator<Res, Res | void, undefined>;
|
|
56
|
+
protected createGrpcClient<T>(definition: SparkAuthnServiceDefinition | SparkServiceDefinition | SparkTokenServiceDefinition, channel: Channel, withRetries: boolean, middleware?: ClientMiddleware<RetryOptions, {}>, channelKey?: string): Promise<T & {
|
|
80
57
|
close: () => void;
|
|
81
58
|
}>;
|
|
59
|
+
subscribeToEvents(address: string, signal: AbortSignal): Promise<AsyncIterable<SubscribeToEventsResponse>>;
|
|
82
60
|
}
|
|
83
61
|
|
|
84
62
|
declare class SparkWalletNodeJS extends SparkWallet {
|