@sundaeswap/sprinkles 0.4.0 → 0.6.0
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/cjs/Sprinkle/__tests__/encryption.test.js +22 -8
- package/dist/cjs/Sprinkle/__tests__/encryption.test.js.map +1 -1
- package/dist/cjs/Sprinkle/__tests__/enhancements.test.js +37 -46
- package/dist/cjs/Sprinkle/__tests__/enhancements.test.js.map +1 -1
- package/dist/cjs/Sprinkle/__tests__/field-utils.test.js +170 -0
- package/dist/cjs/Sprinkle/__tests__/field-utils.test.js.map +1 -0
- package/dist/cjs/Sprinkle/__tests__/fill-in-struct.test.js +283 -81
- package/dist/cjs/Sprinkle/__tests__/fill-in-struct.test.js.map +1 -1
- package/dist/cjs/Sprinkle/__tests__/formatting.test.js +97 -0
- package/dist/cjs/Sprinkle/__tests__/formatting.test.js.map +1 -0
- package/dist/cjs/Sprinkle/__tests__/show-menu.test.js +97 -7
- package/dist/cjs/Sprinkle/__tests__/show-menu.test.js.map +1 -1
- package/dist/cjs/Sprinkle/__tests__/tx-dialog.test.js +30 -0
- package/dist/cjs/Sprinkle/__tests__/tx-dialog.test.js.map +1 -1
- package/dist/cjs/Sprinkle/encryption.js +131 -0
- package/dist/cjs/Sprinkle/encryption.js.map +1 -0
- package/dist/cjs/Sprinkle/index.js +427 -438
- package/dist/cjs/Sprinkle/index.js.map +1 -1
- package/dist/cjs/Sprinkle/menus/array-menu.js +195 -0
- package/dist/cjs/Sprinkle/menus/array-menu.js.map +1 -0
- package/dist/cjs/Sprinkle/menus/field-menu.js +161 -0
- package/dist/cjs/Sprinkle/menus/field-menu.js.map +1 -0
- package/dist/cjs/Sprinkle/menus/index.js +33 -0
- package/dist/cjs/Sprinkle/menus/index.js.map +1 -0
- package/dist/cjs/Sprinkle/menus/object-menu.js +324 -0
- package/dist/cjs/Sprinkle/menus/object-menu.js.map +1 -0
- package/dist/cjs/Sprinkle/prompts.js +459 -0
- package/dist/cjs/Sprinkle/prompts.js.map +1 -0
- package/dist/cjs/Sprinkle/schemas.js +97 -0
- package/dist/cjs/Sprinkle/schemas.js.map +1 -0
- package/dist/cjs/Sprinkle/tx-dialog.js +101 -0
- package/dist/cjs/Sprinkle/tx-dialog.js.map +1 -0
- package/dist/cjs/Sprinkle/type-guards.js +89 -0
- package/dist/cjs/Sprinkle/type-guards.js.map +1 -0
- package/dist/cjs/Sprinkle/types.js +73 -0
- package/dist/cjs/Sprinkle/types.js.map +1 -0
- package/dist/cjs/Sprinkle/utils/field-utils.js +154 -0
- package/dist/cjs/Sprinkle/utils/field-utils.js.map +1 -0
- package/dist/cjs/Sprinkle/utils/formatting.js +126 -0
- package/dist/cjs/Sprinkle/utils/formatting.js.map +1 -0
- package/dist/cjs/Sprinkle/utils/index.js +56 -0
- package/dist/cjs/Sprinkle/utils/index.js.map +1 -0
- package/dist/cjs/Sprinkle/wallet.js +98 -0
- package/dist/cjs/Sprinkle/wallet.js.map +1 -0
- package/dist/esm/Sprinkle/__tests__/encryption.test.js +22 -8
- package/dist/esm/Sprinkle/__tests__/encryption.test.js.map +1 -1
- package/dist/esm/Sprinkle/__tests__/enhancements.test.js +37 -46
- package/dist/esm/Sprinkle/__tests__/enhancements.test.js.map +1 -1
- package/dist/esm/Sprinkle/__tests__/field-utils.test.js +168 -0
- package/dist/esm/Sprinkle/__tests__/field-utils.test.js.map +1 -0
- package/dist/esm/Sprinkle/__tests__/fill-in-struct.test.js +284 -82
- package/dist/esm/Sprinkle/__tests__/fill-in-struct.test.js.map +1 -1
- package/dist/esm/Sprinkle/__tests__/formatting.test.js +95 -0
- package/dist/esm/Sprinkle/__tests__/formatting.test.js.map +1 -0
- package/dist/esm/Sprinkle/__tests__/show-menu.test.js +98 -8
- package/dist/esm/Sprinkle/__tests__/show-menu.test.js.map +1 -1
- package/dist/esm/Sprinkle/__tests__/tx-dialog.test.js +30 -0
- package/dist/esm/Sprinkle/__tests__/tx-dialog.test.js.map +1 -1
- package/dist/esm/Sprinkle/encryption.js +117 -0
- package/dist/esm/Sprinkle/encryption.js.map +1 -0
- package/dist/esm/Sprinkle/index.js +248 -425
- package/dist/esm/Sprinkle/index.js.map +1 -1
- package/dist/esm/Sprinkle/menus/array-menu.js +190 -0
- package/dist/esm/Sprinkle/menus/array-menu.js.map +1 -0
- package/dist/esm/Sprinkle/menus/field-menu.js +155 -0
- package/dist/esm/Sprinkle/menus/field-menu.js.map +1 -0
- package/dist/esm/Sprinkle/menus/index.js +8 -0
- package/dist/esm/Sprinkle/menus/index.js.map +1 -0
- package/dist/esm/Sprinkle/menus/object-menu.js +318 -0
- package/dist/esm/Sprinkle/menus/object-menu.js.map +1 -0
- package/dist/esm/Sprinkle/prompts.js +443 -0
- package/dist/esm/Sprinkle/prompts.js.map +1 -0
- package/dist/esm/Sprinkle/schemas.js +91 -0
- package/dist/esm/Sprinkle/schemas.js.map +1 -0
- package/dist/esm/Sprinkle/tx-dialog.js +90 -0
- package/dist/esm/Sprinkle/tx-dialog.js.map +1 -0
- package/dist/esm/Sprinkle/type-guards.js +66 -0
- package/dist/esm/Sprinkle/type-guards.js.map +1 -0
- package/dist/esm/Sprinkle/types.js +66 -0
- package/dist/esm/Sprinkle/types.js.map +1 -0
- package/dist/esm/Sprinkle/utils/field-utils.js +145 -0
- package/dist/esm/Sprinkle/utils/field-utils.js.map +1 -0
- package/dist/esm/Sprinkle/utils/formatting.js +118 -0
- package/dist/esm/Sprinkle/utils/formatting.js.map +1 -0
- package/dist/esm/Sprinkle/utils/index.js +7 -0
- package/dist/esm/Sprinkle/utils/index.js.map +1 -0
- package/dist/esm/Sprinkle/wallet.js +90 -0
- package/dist/esm/Sprinkle/wallet.js.map +1 -0
- package/dist/types/Sprinkle/encryption.d.ts +43 -0
- package/dist/types/Sprinkle/encryption.d.ts.map +1 -0
- package/dist/types/Sprinkle/index.d.ts +17 -177
- package/dist/types/Sprinkle/index.d.ts.map +1 -1
- package/dist/types/Sprinkle/menus/array-menu.d.ts +31 -0
- package/dist/types/Sprinkle/menus/array-menu.d.ts.map +1 -0
- package/dist/types/Sprinkle/menus/field-menu.d.ts +34 -0
- package/dist/types/Sprinkle/menus/field-menu.d.ts.map +1 -0
- package/dist/types/Sprinkle/menus/index.d.ts +10 -0
- package/dist/types/Sprinkle/menus/index.d.ts.map +1 -0
- package/dist/types/Sprinkle/menus/object-menu.d.ts +34 -0
- package/dist/types/Sprinkle/menus/object-menu.d.ts.map +1 -0
- package/dist/types/Sprinkle/prompts.d.ts +119 -0
- package/dist/types/Sprinkle/prompts.d.ts.map +1 -0
- package/dist/types/Sprinkle/schemas.d.ts +125 -0
- package/dist/types/Sprinkle/schemas.d.ts.map +1 -0
- package/dist/types/Sprinkle/tx-dialog.d.ts +37 -0
- package/dist/types/Sprinkle/tx-dialog.d.ts.map +1 -0
- package/dist/types/Sprinkle/type-guards.d.ts +45 -0
- package/dist/types/Sprinkle/type-guards.d.ts.map +1 -0
- package/dist/types/Sprinkle/types.d.ts +115 -0
- package/dist/types/Sprinkle/types.d.ts.map +1 -0
- package/dist/types/Sprinkle/utils/field-utils.d.ts +47 -0
- package/dist/types/Sprinkle/utils/field-utils.d.ts.map +1 -0
- package/dist/types/Sprinkle/utils/formatting.d.ts +30 -0
- package/dist/types/Sprinkle/utils/formatting.d.ts.map +1 -0
- package/dist/types/Sprinkle/wallet.d.ts +27 -0
- package/dist/types/Sprinkle/wallet.d.ts.map +1 -0
- package/dist/types/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/Sprinkle/__tests__/encryption.test.ts +23 -8
- package/src/Sprinkle/__tests__/enhancements.test.ts +34 -47
- package/src/Sprinkle/__tests__/field-utils.test.ts +191 -0
- package/src/Sprinkle/__tests__/fill-in-struct.test.ts +301 -86
- package/src/Sprinkle/__tests__/formatting.test.ts +115 -0
- package/src/Sprinkle/__tests__/show-menu.test.ts +102 -8
- package/src/Sprinkle/__tests__/tx-dialog.test.ts +30 -0
- package/src/Sprinkle/encryption.ts +130 -0
- package/src/Sprinkle/index.ts +368 -598
- package/src/Sprinkle/menus/array-menu.ts +191 -0
- package/src/Sprinkle/menus/field-menu.ts +145 -0
- package/src/Sprinkle/menus/index.ts +12 -0
- package/src/Sprinkle/menus/object-menu.ts +336 -0
- package/src/Sprinkle/prompts.ts +551 -0
- package/src/Sprinkle/schemas.ts +111 -0
- package/src/Sprinkle/tx-dialog.ts +100 -0
- package/src/Sprinkle/type-guards.ts +93 -0
- package/src/Sprinkle/types.ts +116 -0
- package/src/Sprinkle/utils/field-utils.ts +158 -0
- package/src/Sprinkle/utils/formatting.ts +127 -0
- package/src/Sprinkle/utils/index.ts +17 -0
- package/src/Sprinkle/wallet.ts +133 -0
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import type { TExact } from "./types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Network selection schema (mainnet, preview, preprod).
|
|
4
|
+
*/
|
|
5
|
+
export declare const NetworkSchema: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"mainnet">, import("@sinclair/typebox").TLiteral<"preview">, import("@sinclair/typebox").TLiteral<"preprod">]>;
|
|
6
|
+
/**
|
|
7
|
+
* Recursive multisig script module for Cardano native scripts.
|
|
8
|
+
*/
|
|
9
|
+
export declare const MultisigScriptModule: import("@sinclair/typebox").TModule<{
|
|
10
|
+
MultisigScript: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
|
|
11
|
+
Signature: import("@sinclair/typebox").TObject<{
|
|
12
|
+
key_hash: import("@sinclair/typebox").TString;
|
|
13
|
+
}>;
|
|
14
|
+
}>, import("@sinclair/typebox").TObject<{
|
|
15
|
+
AllOf: import("@sinclair/typebox").TObject<{
|
|
16
|
+
scripts: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TRef<"MultisigScript">>;
|
|
17
|
+
}>;
|
|
18
|
+
}>, import("@sinclair/typebox").TObject<{
|
|
19
|
+
AnyOf: import("@sinclair/typebox").TObject<{
|
|
20
|
+
scripts: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TRef<"MultisigScript">>;
|
|
21
|
+
}>;
|
|
22
|
+
}>, import("@sinclair/typebox").TObject<{
|
|
23
|
+
AtLeast: import("@sinclair/typebox").TObject<{
|
|
24
|
+
required: import("@sinclair/typebox").TBigInt;
|
|
25
|
+
scripts: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TRef<"MultisigScript">>;
|
|
26
|
+
}>;
|
|
27
|
+
}>, import("@sinclair/typebox").TObject<{
|
|
28
|
+
Before: import("@sinclair/typebox").TObject<{
|
|
29
|
+
time: import("@sinclair/typebox").TBigInt;
|
|
30
|
+
}>;
|
|
31
|
+
}>, import("@sinclair/typebox").TObject<{
|
|
32
|
+
After: import("@sinclair/typebox").TObject<{
|
|
33
|
+
time: import("@sinclair/typebox").TBigInt;
|
|
34
|
+
}>;
|
|
35
|
+
}>, import("@sinclair/typebox").TObject<{
|
|
36
|
+
Script: import("@sinclair/typebox").TObject<{
|
|
37
|
+
script_hash: import("@sinclair/typebox").TString;
|
|
38
|
+
}>;
|
|
39
|
+
}>]>;
|
|
40
|
+
}, {
|
|
41
|
+
MultisigScript: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
|
|
42
|
+
Signature: import("@sinclair/typebox").TObject<{
|
|
43
|
+
key_hash: import("@sinclair/typebox").TString;
|
|
44
|
+
}>;
|
|
45
|
+
}>, import("@sinclair/typebox").TObject<{
|
|
46
|
+
AllOf: import("@sinclair/typebox").TObject<{
|
|
47
|
+
scripts: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TRef<"MultisigScript">>;
|
|
48
|
+
}>;
|
|
49
|
+
}>, import("@sinclair/typebox").TObject<{
|
|
50
|
+
AnyOf: import("@sinclair/typebox").TObject<{
|
|
51
|
+
scripts: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TRef<"MultisigScript">>;
|
|
52
|
+
}>;
|
|
53
|
+
}>, import("@sinclair/typebox").TObject<{
|
|
54
|
+
AtLeast: import("@sinclair/typebox").TObject<{
|
|
55
|
+
required: import("@sinclair/typebox").TBigInt;
|
|
56
|
+
scripts: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TRef<"MultisigScript">>;
|
|
57
|
+
}>;
|
|
58
|
+
}>, import("@sinclair/typebox").TObject<{
|
|
59
|
+
Before: import("@sinclair/typebox").TObject<{
|
|
60
|
+
time: import("@sinclair/typebox").TBigInt;
|
|
61
|
+
}>;
|
|
62
|
+
}>, import("@sinclair/typebox").TObject<{
|
|
63
|
+
After: import("@sinclair/typebox").TObject<{
|
|
64
|
+
time: import("@sinclair/typebox").TBigInt;
|
|
65
|
+
}>;
|
|
66
|
+
}>, import("@sinclair/typebox").TObject<{
|
|
67
|
+
Script: import("@sinclair/typebox").TObject<{
|
|
68
|
+
script_hash: import("@sinclair/typebox").TString;
|
|
69
|
+
}>;
|
|
70
|
+
}>]>;
|
|
71
|
+
}>;
|
|
72
|
+
export declare const MultisigScript: import("@sinclair/typebox").TImport<{
|
|
73
|
+
MultisigScript: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
|
|
74
|
+
Signature: import("@sinclair/typebox").TObject<{
|
|
75
|
+
key_hash: import("@sinclair/typebox").TString;
|
|
76
|
+
}>;
|
|
77
|
+
}>, import("@sinclair/typebox").TObject<{
|
|
78
|
+
AllOf: import("@sinclair/typebox").TObject<{
|
|
79
|
+
scripts: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TRef<"MultisigScript">>;
|
|
80
|
+
}>;
|
|
81
|
+
}>, import("@sinclair/typebox").TObject<{
|
|
82
|
+
AnyOf: import("@sinclair/typebox").TObject<{
|
|
83
|
+
scripts: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TRef<"MultisigScript">>;
|
|
84
|
+
}>;
|
|
85
|
+
}>, import("@sinclair/typebox").TObject<{
|
|
86
|
+
AtLeast: import("@sinclair/typebox").TObject<{
|
|
87
|
+
required: import("@sinclair/typebox").TBigInt;
|
|
88
|
+
scripts: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TRef<"MultisigScript">>;
|
|
89
|
+
}>;
|
|
90
|
+
}>, import("@sinclair/typebox").TObject<{
|
|
91
|
+
Before: import("@sinclair/typebox").TObject<{
|
|
92
|
+
time: import("@sinclair/typebox").TBigInt;
|
|
93
|
+
}>;
|
|
94
|
+
}>, import("@sinclair/typebox").TObject<{
|
|
95
|
+
After: import("@sinclair/typebox").TObject<{
|
|
96
|
+
time: import("@sinclair/typebox").TBigInt;
|
|
97
|
+
}>;
|
|
98
|
+
}>, import("@sinclair/typebox").TObject<{
|
|
99
|
+
Script: import("@sinclair/typebox").TObject<{
|
|
100
|
+
script_hash: import("@sinclair/typebox").TString;
|
|
101
|
+
}>;
|
|
102
|
+
}>]>;
|
|
103
|
+
}, "MultisigScript">;
|
|
104
|
+
export type TMultisigScript = TExact<typeof MultisigScript>;
|
|
105
|
+
/**
|
|
106
|
+
* Provider settings schema for blockchain data providers.
|
|
107
|
+
*/
|
|
108
|
+
export declare const ProviderSettingsSchema: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
|
|
109
|
+
type: import("@sinclair/typebox").TLiteral<"blockfrost">;
|
|
110
|
+
projectId: import("@sinclair/typebox").TString;
|
|
111
|
+
}>, import("@sinclair/typebox").TObject<{
|
|
112
|
+
type: import("@sinclair/typebox").TLiteral<"maestro">;
|
|
113
|
+
apiKey: import("@sinclair/typebox").TString;
|
|
114
|
+
}>]>;
|
|
115
|
+
/**
|
|
116
|
+
* Wallet settings schema for hot and cold wallets.
|
|
117
|
+
*/
|
|
118
|
+
export declare const WalletSettingsSchema: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
|
|
119
|
+
type: import("@sinclair/typebox").TLiteral<"hot">;
|
|
120
|
+
privateKey: import("@sinclair/typebox").TString;
|
|
121
|
+
}>, import("@sinclair/typebox").TObject<{
|
|
122
|
+
type: import("@sinclair/typebox").TLiteral<"cold">;
|
|
123
|
+
address: import("@sinclair/typebox").TString;
|
|
124
|
+
}>]>;
|
|
125
|
+
//# sourceMappingURL=schemas.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../src/Sprinkle/schemas.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAEzC;;GAEG;AACH,eAAO,MAAM,aAAa,yLAIxB,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4D/B,CAAC;AAEH,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oBAAgD,CAAC;AAC5E,MAAM,MAAM,eAAe,GAAG,MAAM,CAAC,OAAO,cAAc,CAAC,CAAC;AAE5D;;GAEG;AACH,eAAO,MAAM,sBAAsB;;;;;;IASjC,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,oBAAoB;;;;;;IAa/B,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Transaction dialog helper utilities.
|
|
3
|
+
* Functions for working with transaction signatures and display.
|
|
4
|
+
*/
|
|
5
|
+
import { Core, HotWallet } from "@blaze-cardano/sdk";
|
|
6
|
+
/**
|
|
7
|
+
* Get the payment key hash from a HotWallet's first address.
|
|
8
|
+
*/
|
|
9
|
+
export declare function getWalletPaymentKeyHash(wallet: HotWallet): Promise<string | null>;
|
|
10
|
+
/**
|
|
11
|
+
* Count the number of vkey signatures in a transaction's witness set.
|
|
12
|
+
*/
|
|
13
|
+
export declare function countSignatures(tx: Core.Transaction): number;
|
|
14
|
+
/**
|
|
15
|
+
* Check if a specific public key has already signed the transaction.
|
|
16
|
+
* Compares by vkey (public key bytes).
|
|
17
|
+
*/
|
|
18
|
+
export declare function hasVkeySigned(tx: Core.Transaction, vkeyHex: string): boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Get the list of required signer key hashes from the transaction body.
|
|
21
|
+
*/
|
|
22
|
+
export declare function getRequiredSigners(tx: Core.Transaction): string[];
|
|
23
|
+
/**
|
|
24
|
+
* Compute the transaction body hash for display.
|
|
25
|
+
*/
|
|
26
|
+
export declare function getTxBodyHash(tx: Core.Transaction): string;
|
|
27
|
+
/**
|
|
28
|
+
* Format a hash for display: first 8 chars + ... + last 8 chars.
|
|
29
|
+
*/
|
|
30
|
+
export declare function formatHash(hash: string): string;
|
|
31
|
+
/**
|
|
32
|
+
* Merge signatures from source transaction into target transaction.
|
|
33
|
+
* Prevents duplicate signatures by comparing vkey (public key).
|
|
34
|
+
* Returns the count of newly added signatures.
|
|
35
|
+
*/
|
|
36
|
+
export declare function mergeSignatures(target: Core.Transaction, source: Core.Transaction): number;
|
|
37
|
+
//# sourceMappingURL=tx-dialog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tx-dialog.d.ts","sourceRoot":"","sources":["../../../src/Sprinkle/tx-dialog.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAGrD;;GAEG;AACH,wBAAsB,uBAAuB,CAC3C,MAAM,EAAE,SAAS,GAChB,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAUxB;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,EAAE,EAAE,IAAI,CAAC,WAAW,GAAG,MAAM,CAG5D;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,EAAE,EAAE,IAAI,CAAC,WAAW,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAK5E;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,EAAE,EAAE,IAAI,CAAC,WAAW,GAAG,MAAM,EAAE,CAIjE;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,EAAE,EAAE,IAAI,CAAC,WAAW,GAAG,MAAM,CAG1D;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAG/C;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAC7B,MAAM,EAAE,IAAI,CAAC,WAAW,EACxB,MAAM,EAAE,IAAI,CAAC,WAAW,GACvB,MAAM,CAsBR"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Type guard utilities for TypeBox schema types.
|
|
3
|
+
* These are internal helpers used by FillInStruct, encryption, and other modules.
|
|
4
|
+
*/
|
|
5
|
+
import { type TBigInt, type TLiteral, type TNull, type TObject, type TSchema, type TString, type TTuple, type TUnion, type TArray, type TThis, type TRef, type TImport, type TOptional, type Static } from "@sinclair/typebox";
|
|
6
|
+
export declare const isOptional: <T extends TSchema>(t: T) => t is TOptional<T>;
|
|
7
|
+
export declare const isImport: (t: TSchema) => t is TImport;
|
|
8
|
+
export declare const isArray: (t: TSchema) => t is TArray;
|
|
9
|
+
export declare const isBigInt: (t: TSchema) => t is TBigInt;
|
|
10
|
+
export declare const isLiteral: (t: TSchema) => t is TLiteral;
|
|
11
|
+
export declare const isObject: (t: TSchema) => t is TObject;
|
|
12
|
+
export declare const isRef: (t: TSchema) => t is TRef;
|
|
13
|
+
export declare const isString: (t: TSchema) => t is TString;
|
|
14
|
+
export declare const isThis: (t: TSchema) => t is TThis;
|
|
15
|
+
export declare const isTuple: (t: TSchema) => t is TTuple;
|
|
16
|
+
export declare const isUnion: (t: TSchema) => t is TUnion;
|
|
17
|
+
/**
|
|
18
|
+
* Check if a schema field is marked as sensitive.
|
|
19
|
+
* Sensitive fields are encrypted when saved and masked when displayed.
|
|
20
|
+
*/
|
|
21
|
+
export declare const isSensitive: (t: TSchema) => boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Check if a schema is a Null type.
|
|
24
|
+
*/
|
|
25
|
+
export declare const isNull: (t: TSchema) => t is TNull;
|
|
26
|
+
/**
|
|
27
|
+
* Check if a schema allows null values.
|
|
28
|
+
* Returns true for TNull or unions containing TNull.
|
|
29
|
+
*/
|
|
30
|
+
export declare const isNullable: (t: TSchema) => boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Unwrap a nullable type to get the non-null inner type.
|
|
33
|
+
* For unions with Null, returns the union without the Null member.
|
|
34
|
+
* For single non-null member unions, returns just that type.
|
|
35
|
+
*/
|
|
36
|
+
export declare const unwrapNullable: (t: TSchema) => TSchema;
|
|
37
|
+
/**
|
|
38
|
+
* Check if a schema has a default value defined.
|
|
39
|
+
*/
|
|
40
|
+
export declare const hasDefault: (t: TSchema) => boolean;
|
|
41
|
+
/**
|
|
42
|
+
* Get the default value from a schema, if defined.
|
|
43
|
+
*/
|
|
44
|
+
export declare const getDefault: <T extends TSchema>(t: T) => Static<T> | undefined;
|
|
45
|
+
//# sourceMappingURL=type-guards.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"type-guards.d.ts","sourceRoot":"","sources":["../../../src/Sprinkle/type-guards.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAEL,KAAK,OAAO,EACZ,KAAK,QAAQ,EACb,KAAK,KAAK,EACV,KAAK,OAAO,EACZ,KAAK,OAAO,EACZ,KAAK,OAAO,EACZ,KAAK,MAAM,EACX,KAAK,MAAM,EACX,KAAK,MAAM,EACX,KAAK,KAAK,EACV,KAAK,IAAI,EACT,KAAK,OAAO,EACZ,KAAK,SAAS,EACd,KAAK,MAAM,EAEZ,MAAM,mBAAmB,CAAC;AAE3B,eAAO,MAAM,UAAU,GAAI,CAAC,SAAS,OAAO,EAAE,GAAG,CAAC,KAAG,CAAC,IAAI,SAAS,CAAC,CAAC,CACrC,CAAC;AAEjC,eAAO,MAAM,QAAQ,GAAI,GAAG,OAAO,KAAG,CAAC,IAAI,OAA+B,CAAC;AAE3E,eAAO,MAAM,OAAO,GAAI,GAAG,OAAO,KAAG,CAAC,IAAI,MAA6B,CAAC;AAExE,eAAO,MAAM,QAAQ,GAAI,GAAG,OAAO,KAAG,CAAC,IAAI,OAA+B,CAAC;AAE3E,eAAO,MAAM,SAAS,GAAI,GAAG,OAAO,KAAG,CAAC,IAAI,QAAiC,CAAC;AAE9E,eAAO,MAAM,QAAQ,GAAI,GAAG,OAAO,KAAG,CAAC,IAAI,OAA+B,CAAC;AAE3E,eAAO,MAAM,KAAK,GAAI,GAAG,OAAO,KAAG,CAAC,IAAI,IAAyB,CAAC;AAElE,eAAO,MAAM,QAAQ,GAAI,GAAG,OAAO,KAAG,CAAC,IAAI,OAA+B,CAAC;AAE3E,eAAO,MAAM,MAAM,GAAI,GAAG,OAAO,KAAG,CAAC,IAAI,KAA2B,CAAC;AAErE,eAAO,MAAM,OAAO,GAAI,GAAG,OAAO,KAAG,CAAC,IAAI,MAA6B,CAAC;AAExE,eAAO,MAAM,OAAO,GAAI,GAAG,OAAO,KAAG,CAAC,IAAI,MAA6B,CAAC;AAExE;;;GAGG;AACH,eAAO,MAAM,WAAW,GAAI,GAAG,OAAO,KAAG,OACJ,CAAC;AAEtC;;GAEG;AACH,eAAO,MAAM,MAAM,GAAI,GAAG,OAAO,KAAG,CAAC,IAAI,KAA2B,CAAC;AAErE;;;GAGG;AACH,eAAO,MAAM,UAAU,GAAI,GAAG,OAAO,KAAG,OAIvC,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,cAAc,GAAI,GAAG,OAAO,KAAG,OAO3C,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,UAAU,GAAI,GAAG,OAAO,KAAG,OAAyB,CAAC;AAElE;;GAEG;AACH,eAAO,MAAM,UAAU,GAAI,CAAC,SAAS,OAAO,EAAE,GAAG,CAAC,KAAG,MAAM,CAAC,CAAC,CAAC,GAAG,SAC7B,CAAC"}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { Core } from "@blaze-cardano/sdk";
|
|
2
|
+
import type { Static, TSchema } from "@sinclair/typebox";
|
|
3
|
+
/**
|
|
4
|
+
* Utility type to extract the static type from a TypeBox schema.
|
|
5
|
+
*/
|
|
6
|
+
export type TExact<T> = T extends TSchema ? Static<T> : T;
|
|
7
|
+
/**
|
|
8
|
+
* Options for encrypting/decrypting sensitive fields in settings.
|
|
9
|
+
*/
|
|
10
|
+
export interface IEncryptionOptions {
|
|
11
|
+
encrypt: (plaintext: string) => string;
|
|
12
|
+
decrypt: (ciphertext: string) => Promise<string>;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Options for configuring a Sprinkle instance.
|
|
16
|
+
*/
|
|
17
|
+
export interface ISprinkleOptions {
|
|
18
|
+
encryption?: IEncryptionOptions;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Metadata for a profile.
|
|
22
|
+
*/
|
|
23
|
+
export interface IProfileMeta {
|
|
24
|
+
name: string;
|
|
25
|
+
description?: string;
|
|
26
|
+
createdAt: string;
|
|
27
|
+
updatedAt: string;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Current profile information including ID.
|
|
31
|
+
*/
|
|
32
|
+
export interface ICurrentProfile extends IProfileMeta {
|
|
33
|
+
id: string;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Profile entry as returned by scanProfiles().
|
|
37
|
+
*/
|
|
38
|
+
export interface IProfileEntry {
|
|
39
|
+
id: string;
|
|
40
|
+
meta: IProfileMeta;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Result of the TxDialog interaction.
|
|
44
|
+
*/
|
|
45
|
+
export interface TxDialogResult {
|
|
46
|
+
action: "submitted" | "signed" | "cancelled";
|
|
47
|
+
txId?: string;
|
|
48
|
+
tx: Core.Transaction;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Options for TxDialog.
|
|
52
|
+
*/
|
|
53
|
+
export interface TxDialogOptions {
|
|
54
|
+
beforeSign?: () => Promise<void>;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Error thrown when user cancels a prompt via Escape key.
|
|
58
|
+
*/
|
|
59
|
+
export declare class UserCancelledError extends Error {
|
|
60
|
+
constructor(message?: string);
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* State tracking for a single field during menu-based editing.
|
|
64
|
+
*/
|
|
65
|
+
export type FieldState<T = unknown> = {
|
|
66
|
+
status: "unset";
|
|
67
|
+
} | {
|
|
68
|
+
status: "set";
|
|
69
|
+
value: T;
|
|
70
|
+
} | {
|
|
71
|
+
status: "null";
|
|
72
|
+
};
|
|
73
|
+
/**
|
|
74
|
+
* Result of counting required fields in a schema.
|
|
75
|
+
*/
|
|
76
|
+
export interface RequiredFieldCount {
|
|
77
|
+
total: number;
|
|
78
|
+
filled: number;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Result from field menu interaction.
|
|
82
|
+
*/
|
|
83
|
+
export type FieldMenuResult<T = unknown> = {
|
|
84
|
+
action: "edit";
|
|
85
|
+
} | {
|
|
86
|
+
action: "view";
|
|
87
|
+
} | {
|
|
88
|
+
action: "clear";
|
|
89
|
+
} | {
|
|
90
|
+
action: "setNull";
|
|
91
|
+
} | {
|
|
92
|
+
action: "reset";
|
|
93
|
+
defaultValue: T;
|
|
94
|
+
} | {
|
|
95
|
+
action: "back";
|
|
96
|
+
};
|
|
97
|
+
/**
|
|
98
|
+
* Result from object menu interaction.
|
|
99
|
+
*/
|
|
100
|
+
export type ObjectMenuResult<T = unknown> = {
|
|
101
|
+
action: "submit";
|
|
102
|
+
value: T;
|
|
103
|
+
} | {
|
|
104
|
+
action: "cancel";
|
|
105
|
+
};
|
|
106
|
+
/**
|
|
107
|
+
* Result from array menu interaction.
|
|
108
|
+
*/
|
|
109
|
+
export type ArrayMenuResult<T = unknown> = {
|
|
110
|
+
action: "done";
|
|
111
|
+
value: T[];
|
|
112
|
+
} | {
|
|
113
|
+
action: "back";
|
|
114
|
+
};
|
|
115
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/Sprinkle/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAC1C,OAAO,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAEzD;;GAEG;AACH,MAAM,MAAM,MAAM,CAAC,CAAC,IAAI,CAAC,SAAS,OAAO,GAAG,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;AAE1D;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,MAAM,CAAC;IACvC,OAAO,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;CAClD;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,UAAU,CAAC,EAAE,kBAAkB,CAAC;CACjC;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,eAAgB,SAAQ,YAAY;IACnD,EAAE,EAAE,MAAM,CAAC;CACZ;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,YAAY,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,WAAW,GAAG,QAAQ,GAAG,WAAW,CAAC;IAC7C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,EAAE,EAAE,IAAI,CAAC,WAAW,CAAC;CACtB;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,UAAU,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAClC;AAED;;GAEG;AACH,qBAAa,kBAAmB,SAAQ,KAAK;gBAC/B,OAAO,GAAE,MAAuC;CAI7D;AAID;;GAEG;AACH,MAAM,MAAM,UAAU,CAAC,CAAC,GAAG,OAAO,IAC9B;IAAE,MAAM,EAAE,OAAO,CAAA;CAAE,GACnB;IAAE,MAAM,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,CAAC,CAAA;CAAE,GAC3B;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAEvB;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,MAAM,eAAe,CAAC,CAAC,GAAG,OAAO,IACnC;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,GAClB;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,GAClB;IAAE,MAAM,EAAE,OAAO,CAAA;CAAE,GACnB;IAAE,MAAM,EAAE,SAAS,CAAA;CAAE,GACrB;IAAE,MAAM,EAAE,OAAO,CAAC;IAAC,YAAY,EAAE,CAAC,CAAA;CAAE,GACpC;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAEvB;;GAEG;AACH,MAAM,MAAM,gBAAgB,CAAC,CAAC,GAAG,OAAO,IACpC;IAAE,MAAM,EAAE,QAAQ,CAAC;IAAC,KAAK,EAAE,CAAC,CAAA;CAAE,GAC9B;IAAE,MAAM,EAAE,QAAQ,CAAA;CAAE,CAAC;AAEzB;;GAEG;AACH,MAAM,MAAM,eAAe,CAAC,CAAC,GAAG,OAAO,IACnC;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,CAAC,EAAE,CAAA;CAAE,GAC9B;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Field utilities for menu-based struct editing.
|
|
3
|
+
* Provides required field counting and label building.
|
|
4
|
+
*/
|
|
5
|
+
import type { TObject, TSchema } from "@sinclair/typebox";
|
|
6
|
+
import type { FieldState, RequiredFieldCount } from "../types.js";
|
|
7
|
+
/**
|
|
8
|
+
* Count required fields in an object schema and how many are filled.
|
|
9
|
+
*
|
|
10
|
+
* @param type - The object schema
|
|
11
|
+
* @param state - Map of field names to their current state
|
|
12
|
+
* @returns Count of total required fields and how many are filled
|
|
13
|
+
*/
|
|
14
|
+
export declare function countRequiredFields(type: TObject, state: Map<string, FieldState>): RequiredFieldCount;
|
|
15
|
+
/**
|
|
16
|
+
* Determine if a field is required (must have a value to submit).
|
|
17
|
+
*
|
|
18
|
+
* @param fieldType - The field's schema
|
|
19
|
+
* @returns true if the field is required
|
|
20
|
+
*/
|
|
21
|
+
export declare function isFieldRequired(fieldType: TSchema): boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Build a display label for a field in the menu.
|
|
24
|
+
*
|
|
25
|
+
* @param fieldName - The field name
|
|
26
|
+
* @param fieldType - The field's schema
|
|
27
|
+
* @param state - The current state of the field
|
|
28
|
+
* @returns Formatted label string
|
|
29
|
+
*/
|
|
30
|
+
export declare function buildFieldLabel(fieldName: string, fieldType: TSchema, state: FieldState): string;
|
|
31
|
+
/**
|
|
32
|
+
* Get the initial FieldState for a field based on its type and any existing value.
|
|
33
|
+
*
|
|
34
|
+
* @param _fieldType - The field's schema (reserved for future logic)
|
|
35
|
+
* @param existingValue - Existing value if editing
|
|
36
|
+
* @returns Initial FieldState
|
|
37
|
+
*/
|
|
38
|
+
export declare function getInitialFieldState<T>(_fieldType: TSchema, existingValue?: T): FieldState<T>;
|
|
39
|
+
/**
|
|
40
|
+
* Check if all required fields are filled in the state map.
|
|
41
|
+
*
|
|
42
|
+
* @param type - The object schema
|
|
43
|
+
* @param state - Map of field names to their current state
|
|
44
|
+
* @returns true if all required fields have values
|
|
45
|
+
*/
|
|
46
|
+
export declare function allRequiredFieldsFilled(type: TObject, state: Map<string, FieldState>): boolean;
|
|
47
|
+
//# sourceMappingURL=field-utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"field-utils.d.ts","sourceRoot":"","sources":["../../../../src/Sprinkle/utils/field-utils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,KAAK,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAUlE;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,OAAO,EACb,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,GAC7B,kBAAkB,CAgCpB;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,SAAS,EAAE,OAAO,GAAG,OAAO,CAiB3D;AAED;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAC7B,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,OAAO,EAClB,KAAK,EAAE,UAAU,GAChB,MAAM,CAuBR;AAED;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,CAAC,EACpC,UAAU,EAAE,OAAO,EACnB,aAAa,CAAC,EAAE,CAAC,GAChB,UAAU,CAAC,CAAC,CAAC,CAUf;AAED;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CACrC,IAAI,EAAE,OAAO,EACb,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,GAC7B,OAAO,CAGT"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Formatting utilities for menu-based struct editing.
|
|
3
|
+
* Provides value preview, path formatting, and breadcrumb generation.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Format a value for display in a menu item.
|
|
7
|
+
* Truncates long values and provides type-appropriate previews.
|
|
8
|
+
*
|
|
9
|
+
* @param value - The value to format
|
|
10
|
+
* @param maxLength - Maximum length before truncation (default 40)
|
|
11
|
+
* @returns Formatted string representation
|
|
12
|
+
*/
|
|
13
|
+
export declare function formatValuePreview(value: unknown, maxLength?: number): string;
|
|
14
|
+
/**
|
|
15
|
+
* Format a path array for display, stripping the "root" prefix.
|
|
16
|
+
*
|
|
17
|
+
* @param path - Array of path segments (e.g., ["root", "settings", "name"])
|
|
18
|
+
* @returns Formatted path string (e.g., "settings.name")
|
|
19
|
+
*/
|
|
20
|
+
export declare function formatPath(path: string[]): string;
|
|
21
|
+
/**
|
|
22
|
+
* Format a path as a breadcrumb trail for nested navigation.
|
|
23
|
+
* Truncates from the left if too long.
|
|
24
|
+
*
|
|
25
|
+
* @param path - Array of path segments
|
|
26
|
+
* @param maxLength - Maximum total length (default 50)
|
|
27
|
+
* @returns Breadcrumb string (e.g., "settings → permissions → mint")
|
|
28
|
+
*/
|
|
29
|
+
export declare function formatBreadcrumb(path: string[], maxLength?: number): string;
|
|
30
|
+
//# sourceMappingURL=formatting.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formatting.d.ts","sourceRoot":"","sources":["../../../../src/Sprinkle/utils/formatting.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,OAAO,EAAE,SAAS,SAAK,GAAG,MAAM,CAuDzE;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,MAAM,CAOjD;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,SAAS,SAAK,GAAG,MAAM,CAiCvE"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Wallet and provider setup utilities.
|
|
3
|
+
* Functions for creating providers, wallets, and Blaze instances.
|
|
4
|
+
*/
|
|
5
|
+
import { type Provider } from "@blaze-cardano/query";
|
|
6
|
+
import { Blaze, type Wallet } from "@blaze-cardano/sdk";
|
|
7
|
+
import { type TExact } from "./types.js";
|
|
8
|
+
import { NetworkSchema, ProviderSettingsSchema, WalletSettingsSchema } from "./schemas.js";
|
|
9
|
+
/**
|
|
10
|
+
* Creates a blockchain data provider based on settings.
|
|
11
|
+
*/
|
|
12
|
+
export declare function GetProvider(network: TExact<typeof NetworkSchema>, settings: TExact<typeof ProviderSettingsSchema>): Promise<Provider>;
|
|
13
|
+
/**
|
|
14
|
+
* Creates a wallet instance based on settings.
|
|
15
|
+
*/
|
|
16
|
+
export declare function GetWallet(settings: TExact<typeof WalletSettingsSchema>, provider: Provider): Promise<Wallet>;
|
|
17
|
+
/**
|
|
18
|
+
* Creates a Blaze instance with provider and wallet.
|
|
19
|
+
*/
|
|
20
|
+
export declare function GetBlaze(network: TExact<typeof NetworkSchema>, providerSettings: TExact<typeof ProviderSettingsSchema>, walletSettings: TExact<typeof WalletSettingsSchema>): Promise<Blaze<Provider, Wallet>>;
|
|
21
|
+
/**
|
|
22
|
+
* Generates a new wallet from a BIP39 mnemonic phrase.
|
|
23
|
+
* Displays the 24-word recovery phrase and requires user confirmation.
|
|
24
|
+
* @returns The Bip32PrivateKey hex string for storage
|
|
25
|
+
*/
|
|
26
|
+
export declare function generateWalletFromMnemonic(): Promise<string>;
|
|
27
|
+
//# sourceMappingURL=wallet.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wallet.d.ts","sourceRoot":"","sources":["../../../src/Sprinkle/wallet.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAc,KAAK,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AACjE,OAAO,EACL,KAAK,EAIL,KAAK,MAAM,EACZ,MAAM,oBAAoB,CAAC;AAG5B,OAAO,EAAsB,KAAK,MAAM,EAAE,MAAM,YAAY,CAAC;AAC7D,OAAO,EACL,aAAa,EACb,sBAAsB,EACtB,oBAAoB,EACrB,MAAM,cAAc,CAAC;AAEtB;;GAEG;AACH,wBAAsB,WAAW,CAC/B,OAAO,EAAE,MAAM,CAAC,OAAO,aAAa,CAAC,EACrC,QAAQ,EAAE,MAAM,CAAC,OAAO,sBAAsB,CAAC,GAC9C,OAAO,CAAC,QAAQ,CAAC,CAsBnB;AAED;;GAEG;AACH,wBAAsB,SAAS,CAC7B,QAAQ,EAAE,MAAM,CAAC,OAAO,oBAAoB,CAAC,EAC7C,QAAQ,EAAE,QAAQ,GACjB,OAAO,CAAC,MAAM,CAAC,CAiBjB;AAED;;GAEG;AACH,wBAAsB,QAAQ,CAC5B,OAAO,EAAE,MAAM,CAAC,OAAO,aAAa,CAAC,EACrC,gBAAgB,EAAE,MAAM,CAAC,OAAO,sBAAsB,CAAC,EACvD,cAAc,EAAE,MAAM,CAAC,OAAO,oBAAoB,CAAC,GAClD,OAAO,CAAC,KAAK,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC,CAIlC;AAED;;;;GAIG;AACH,wBAAsB,0BAA0B,IAAI,OAAO,CAAC,MAAM,CAAC,CAqClE"}
|