@wishknish/knishio-client-ts 0.9.8 → 1.1.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/README.md +13 -0
- package/dist/index.cjs +1500 -163
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +188 -48
- package/dist/index.d.ts +188 -48
- package/dist/index.iife.js +1494 -156
- package/dist/index.iife.js.map +1 -1
- package/dist/index.js +1492 -165
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
- package/src/AuthToken.ts +47 -25
- package/src/KnishIOClient.ts +40 -12
- package/src/core/Molecule.ts +17 -7
- package/src/core/Wallet.ts +161 -32
- package/src/exception/SecretStorageException.ts +9 -0
- package/src/index.ts +17 -3
- package/src/libraries/GraphQLClient.ts +2 -2
- package/src/schemas/index.ts +2 -1
- package/src/storage/FileStorageBackend.ts +176 -0
- package/src/storage/MemorySecretStorageProvider.ts +75 -3
- package/src/storage/NonExtractableKeySecretStorageProvider.ts +547 -0
- package/src/storage/WebAuthnPrfSecretStorageProvider.ts +679 -0
- package/src/storage/WebCryptoSecretStorageProvider.ts +105 -134
- package/src/storage/WebStorageBackend.ts +102 -0
- package/src/storage/index.ts +26 -2
- package/src/storage/secretEnvelope.ts +200 -0
- package/src/types/crypto.ts +9 -4
- package/src/types/storage.ts +22 -2
- package/src/validation/schemas.ts +2 -1
package/dist/index.d.cts
CHANGED
|
@@ -29,7 +29,7 @@ interface TransferRecipientInput {
|
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
type HashAlgorithm = 'SHAKE256' | 'SHA3-256' | 'BLAKE2B';
|
|
32
|
-
type SignatureAlgorithm = 'XMSS' | '
|
|
32
|
+
type SignatureAlgorithm = 'XMSS' | 'SPHINCS+';
|
|
33
33
|
interface SHAKE256Options {
|
|
34
34
|
input: string | Uint8Array;
|
|
35
35
|
outputLength: number;
|
|
@@ -141,14 +141,17 @@ interface EncryptedSecretPayload {
|
|
|
141
141
|
iterations?: number;
|
|
142
142
|
metadata: SecretStorageMetadata;
|
|
143
143
|
}
|
|
144
|
+
interface StorageOptions {
|
|
145
|
+
label?: string;
|
|
146
|
+
passphrase?: string;
|
|
147
|
+
recoveryPassphrase?: string;
|
|
148
|
+
allowUnrecoverable?: boolean;
|
|
149
|
+
}
|
|
144
150
|
interface ISecretStorageProvider {
|
|
145
151
|
readonly providerType: string;
|
|
146
152
|
isHardwareBacked(): boolean;
|
|
147
153
|
isAvailable(): Promise<boolean>;
|
|
148
|
-
storeSecret(bundleHash: string, secret: string, options?:
|
|
149
|
-
label?: string;
|
|
150
|
-
passphrase?: string;
|
|
151
|
-
}): Promise<void>;
|
|
154
|
+
storeSecret(bundleHash: string, secret: string, options?: StorageOptions): Promise<void>;
|
|
152
155
|
retrieveSecret(bundleHash: string, options?: {
|
|
153
156
|
passphrase?: string;
|
|
154
157
|
}): Promise<string | null>;
|
|
@@ -158,6 +161,9 @@ interface ISecretStorageProvider {
|
|
|
158
161
|
withSecret<T>(bundleHash: string, fn: (secret: string) => Promise<T> | T, options?: {
|
|
159
162
|
passphrase?: string;
|
|
160
163
|
}): Promise<T>;
|
|
164
|
+
recoverSecret(bundleHash: string, recoveryPassphrase: string, options?: {
|
|
165
|
+
label?: string;
|
|
166
|
+
}): Promise<void>;
|
|
161
167
|
}
|
|
162
168
|
|
|
163
169
|
type WalletAddress = WalletAddressPattern & {
|
|
@@ -543,12 +549,13 @@ declare class Wallet {
|
|
|
543
549
|
tokenUnits: any[];
|
|
544
550
|
tradeRates: Record<string, any>;
|
|
545
551
|
molecules: Record<string, any>;
|
|
552
|
+
mlKemParameterSet: 1024 | 768;
|
|
546
553
|
tokenName?: string;
|
|
547
554
|
tokenAmount?: string;
|
|
548
555
|
tokenSupply?: string;
|
|
549
556
|
tokenFungibility?: string;
|
|
550
557
|
createdAt?: string;
|
|
551
|
-
constructor({ secret, bundle, token, address, position, batchId, characters }?: {
|
|
558
|
+
constructor({ secret, bundle, token, address, position, batchId, characters, mlKemParameterSet }?: {
|
|
552
559
|
secret?: string | null;
|
|
553
560
|
bundle?: string | null;
|
|
554
561
|
token?: string;
|
|
@@ -556,13 +563,15 @@ declare class Wallet {
|
|
|
556
563
|
position?: string | null;
|
|
557
564
|
batchId?: string | null;
|
|
558
565
|
characters?: string | null;
|
|
566
|
+
mlKemParameterSet?: 1024 | 768;
|
|
559
567
|
});
|
|
560
|
-
static create({ secret, bundle, token, batchId, characters }: {
|
|
568
|
+
static create({ secret, bundle, token, batchId, characters, mlKemParameterSet }: {
|
|
561
569
|
secret?: string | null;
|
|
562
570
|
bundle?: string | null;
|
|
563
571
|
token?: string;
|
|
564
572
|
batchId?: string | null;
|
|
565
573
|
characters?: string | null;
|
|
574
|
+
mlKemParameterSet?: 1024 | 768;
|
|
566
575
|
}): Wallet;
|
|
567
576
|
static generateKey({ secret, token, position }: {
|
|
568
577
|
secret: string;
|
|
@@ -582,6 +591,8 @@ declare class Wallet {
|
|
|
582
591
|
splitUnitsMulti(recipientUnitLists: string[][], recipientWallets: Wallet[], remainderWallet: Wallet): void;
|
|
583
592
|
getTokenUnitsData(): any[];
|
|
584
593
|
isShadow(): boolean;
|
|
594
|
+
private deriveMlKemKeypair;
|
|
595
|
+
static mlKemParameterSetFromPubkey(pubkey: string | null | undefined): 1024 | 768 | null;
|
|
585
596
|
initializeMLKEM(): void;
|
|
586
597
|
encryptMessage(message: any, recipientPubkey: string): Promise<{
|
|
587
598
|
cipherText: string;
|
|
@@ -596,8 +607,8 @@ declare class Wallet {
|
|
|
596
607
|
encryptedMessage: string;
|
|
597
608
|
}): Promise<string | null>;
|
|
598
609
|
hashShare(pubkey: string): string;
|
|
599
|
-
|
|
600
|
-
|
|
610
|
+
encryptStringML(message: any, recipientPubkey: string): Promise<string>;
|
|
611
|
+
decryptMyMessageML(map: Record<string, {
|
|
601
612
|
cipherText: string;
|
|
602
613
|
encryptedMessage: string;
|
|
603
614
|
}>): Promise<string | null>;
|
|
@@ -732,7 +743,8 @@ declare class Molecule {
|
|
|
732
743
|
continuIdPosition: string | null;
|
|
733
744
|
parentHashes: string[];
|
|
734
745
|
local?: number;
|
|
735
|
-
|
|
746
|
+
mlKemParameterSet: 1024 | 768;
|
|
747
|
+
constructor({ secret, bundle, sourceWallet, remainderWallet, cellSlug, version, continuIdPosition, mlKemParameterSet }?: {
|
|
736
748
|
secret?: string | null;
|
|
737
749
|
bundle?: string | null;
|
|
738
750
|
sourceWallet?: Wallet | null;
|
|
@@ -740,6 +752,7 @@ declare class Molecule {
|
|
|
740
752
|
cellSlug?: string | null;
|
|
741
753
|
version?: string | number | null;
|
|
742
754
|
continuIdPosition?: string | null;
|
|
755
|
+
mlKemParameterSet?: 1024 | 768 | null;
|
|
743
756
|
});
|
|
744
757
|
get cellSlugDelimiter(): string;
|
|
745
758
|
getIsotopes(isotopes: AtomIsotope | AtomIsotope[]): Atom[];
|
|
@@ -961,6 +974,17 @@ declare class GraphQLClient implements GraphQLClient$1 {
|
|
|
961
974
|
socketDisconnect(): void;
|
|
962
975
|
}
|
|
963
976
|
|
|
977
|
+
type AuthTokenSnapshot = {
|
|
978
|
+
token: string;
|
|
979
|
+
expiresAt: number;
|
|
980
|
+
pubkey: string;
|
|
981
|
+
encrypt: boolean;
|
|
982
|
+
wallet?: {
|
|
983
|
+
position: string | null;
|
|
984
|
+
characters: string | null;
|
|
985
|
+
mlKemParameterSet?: 1024 | 768;
|
|
986
|
+
};
|
|
987
|
+
};
|
|
964
988
|
declare class AuthToken {
|
|
965
989
|
private $__token;
|
|
966
990
|
private $__expiresAt;
|
|
@@ -979,16 +1003,8 @@ declare class AuthToken {
|
|
|
979
1003
|
encrypt: boolean;
|
|
980
1004
|
pubkey: string;
|
|
981
1005
|
}, wallet: Wallet): AuthToken;
|
|
982
|
-
static
|
|
983
|
-
|
|
984
|
-
expiresAt: number;
|
|
985
|
-
pubkey: string;
|
|
986
|
-
encrypt: boolean;
|
|
987
|
-
wallet: {
|
|
988
|
-
position: string;
|
|
989
|
-
characters: string | null;
|
|
990
|
-
};
|
|
991
|
-
}, secret: string): AuthToken;
|
|
1006
|
+
static resolveMlKemParameterSet(snapshot: AuthTokenSnapshot): 1024 | 768;
|
|
1007
|
+
static restore(snapshot: AuthTokenSnapshot, secret: string): AuthToken;
|
|
992
1008
|
setWallet(wallet: Wallet): void;
|
|
993
1009
|
getWallet(): Wallet | undefined;
|
|
994
1010
|
getToken(): string;
|
|
@@ -1002,16 +1018,7 @@ declare class AuthToken {
|
|
|
1002
1018
|
pubkey: string;
|
|
1003
1019
|
wallet: Wallet | undefined;
|
|
1004
1020
|
};
|
|
1005
|
-
toSnapshot():
|
|
1006
|
-
token: string;
|
|
1007
|
-
expiresAt: number;
|
|
1008
|
-
pubkey: string;
|
|
1009
|
-
encrypt: boolean;
|
|
1010
|
-
wallet?: {
|
|
1011
|
-
position: string | null;
|
|
1012
|
-
characters: string | null;
|
|
1013
|
-
};
|
|
1014
|
-
};
|
|
1021
|
+
toSnapshot(): AuthTokenSnapshot;
|
|
1015
1022
|
}
|
|
1016
1023
|
|
|
1017
1024
|
interface UniversalResponse<T> {
|
|
@@ -1214,6 +1221,7 @@ declare class KnishIOClient {
|
|
|
1214
1221
|
private $__authTokenObjects;
|
|
1215
1222
|
private $__authToken;
|
|
1216
1223
|
private $__authInProcess;
|
|
1224
|
+
private $__mlKemParameterSet;
|
|
1217
1225
|
private $__remainderWallet;
|
|
1218
1226
|
private lastMoleculeQuery;
|
|
1219
1227
|
private abortControllers;
|
|
@@ -1231,8 +1239,9 @@ declare class KnishIOClient {
|
|
|
1231
1239
|
logging?: boolean;
|
|
1232
1240
|
defaultRequestPolicy?: RequestPolicy | null;
|
|
1233
1241
|
secretStorage?: ISecretStorageProvider | null;
|
|
1242
|
+
mlKemParameterSet?: 1024 | 768;
|
|
1234
1243
|
});
|
|
1235
|
-
initialize({ uri, cellSlug, socket, client, serverSdkVersion, logging, defaultRequestPolicy }: {
|
|
1244
|
+
initialize({ uri, cellSlug, socket, client, serverSdkVersion, logging, defaultRequestPolicy, mlKemParameterSet }: {
|
|
1236
1245
|
uri: string | string[];
|
|
1237
1246
|
cellSlug?: string | null;
|
|
1238
1247
|
socket?: {
|
|
@@ -1243,7 +1252,10 @@ declare class KnishIOClient {
|
|
|
1243
1252
|
serverSdkVersion?: number;
|
|
1244
1253
|
logging?: boolean;
|
|
1245
1254
|
defaultRequestPolicy?: RequestPolicy | null;
|
|
1255
|
+
mlKemParameterSet?: 1024 | 768;
|
|
1246
1256
|
}): void;
|
|
1257
|
+
getMlKemParameterSet(): 1024 | 768;
|
|
1258
|
+
setMlKemParameterSet(parameterSet: 1024 | 768): this;
|
|
1247
1259
|
getRandomUri(): string;
|
|
1248
1260
|
switchEncryption(encrypt: boolean): boolean;
|
|
1249
1261
|
deinitialize(): void;
|
|
@@ -2015,6 +2027,7 @@ declare class SecretStorageException extends BaseException {
|
|
|
2015
2027
|
static notFound(bundleHash: string): SecretStorageException;
|
|
2016
2028
|
static decryptionFailed(reason?: string): SecretStorageException;
|
|
2017
2029
|
static unavailable(provider: string, reason?: string): SecretStorageException;
|
|
2030
|
+
static validationError(message: string): SecretStorageException;
|
|
2018
2031
|
}
|
|
2019
2032
|
|
|
2020
2033
|
declare class InvalidResponseException extends BaseException {
|
|
@@ -2131,18 +2144,19 @@ declare const EXCEPTION_CODES: {
|
|
|
2131
2144
|
declare class MemorySecretStorageProvider implements ISecretStorageProvider {
|
|
2132
2145
|
readonly providerType = "memory";
|
|
2133
2146
|
private secrets;
|
|
2147
|
+
private recoverySecrets;
|
|
2134
2148
|
isHardwareBacked(): boolean;
|
|
2135
2149
|
isAvailable(): Promise<boolean>;
|
|
2136
|
-
storeSecret(bundleHash: string, secret: string, options?:
|
|
2137
|
-
label?: string;
|
|
2138
|
-
passphrase?: string;
|
|
2139
|
-
}): Promise<void>;
|
|
2150
|
+
storeSecret(bundleHash: string, secret: string, options?: StorageOptions): Promise<void>;
|
|
2140
2151
|
retrieveSecret(bundleHash: string): Promise<string | null>;
|
|
2141
2152
|
deleteSecret(bundleHash: string): Promise<boolean>;
|
|
2142
2153
|
hasSecret(bundleHash: string): Promise<boolean>;
|
|
2143
2154
|
listSecrets(): Promise<SecretStorageMetadata[]>;
|
|
2144
2155
|
withSecret<T>(bundleHash: string, fn: (secret: string) => Promise<T> | T): Promise<T>;
|
|
2145
2156
|
clear(): void;
|
|
2157
|
+
recoverSecret(bundleHash: string, recoveryPassphrase: string, options?: {
|
|
2158
|
+
label?: string;
|
|
2159
|
+
}): Promise<void>;
|
|
2146
2160
|
}
|
|
2147
2161
|
|
|
2148
2162
|
interface IStorageBackend {
|
|
@@ -2162,35 +2176,161 @@ declare class WebCryptoSecretStorageProvider implements ISecretStorageProvider {
|
|
|
2162
2176
|
readonly providerType = "webcrypto-aes-gcm";
|
|
2163
2177
|
private backend;
|
|
2164
2178
|
private defaultPassphrase?;
|
|
2165
|
-
private hardwareBacked;
|
|
2166
2179
|
constructor(options?: {
|
|
2167
2180
|
backend?: IStorageBackend;
|
|
2168
2181
|
defaultPassphrase?: string;
|
|
2169
|
-
hardwareBacked?: boolean;
|
|
2170
2182
|
});
|
|
2171
2183
|
isHardwareBacked(): boolean;
|
|
2172
2184
|
isAvailable(): Promise<boolean>;
|
|
2173
|
-
|
|
2174
|
-
|
|
2185
|
+
storeSecret(bundleHash: string, secret: string, options?: StorageOptions): Promise<void>;
|
|
2186
|
+
retrieveSecret(bundleHash: string, options?: {
|
|
2187
|
+
passphrase?: string;
|
|
2188
|
+
}): Promise<string | null>;
|
|
2189
|
+
deleteSecret(bundleHash: string): Promise<boolean>;
|
|
2190
|
+
hasSecret(bundleHash: string): Promise<boolean>;
|
|
2191
|
+
listSecrets(): Promise<SecretStorageMetadata[]>;
|
|
2192
|
+
withSecret<T>(bundleHash: string, fn: (secret: string) => Promise<T> | T, options?: {
|
|
2193
|
+
passphrase?: string;
|
|
2194
|
+
}): Promise<T>;
|
|
2195
|
+
recoverSecret(bundleHash: string, recoveryPassphrase: string, options?: {
|
|
2175
2196
|
label?: string;
|
|
2176
2197
|
passphrase?: string;
|
|
2177
2198
|
}): Promise<void>;
|
|
2199
|
+
}
|
|
2200
|
+
|
|
2201
|
+
declare class FileStorageBackend implements IStorageBackend {
|
|
2202
|
+
readonly filePath: string;
|
|
2203
|
+
private store;
|
|
2204
|
+
private loaded;
|
|
2205
|
+
constructor(filePath: string);
|
|
2206
|
+
private getFs;
|
|
2207
|
+
private ensureLoaded;
|
|
2208
|
+
private persist;
|
|
2209
|
+
getItem(key: string): Promise<string | null>;
|
|
2210
|
+
setItem(key: string, value: string): Promise<void>;
|
|
2211
|
+
removeItem(key: string): Promise<boolean>;
|
|
2212
|
+
keys(): Promise<string[]>;
|
|
2213
|
+
}
|
|
2214
|
+
|
|
2215
|
+
declare class WebStorageBackend implements IStorageBackend {
|
|
2216
|
+
private readonly storage;
|
|
2217
|
+
readonly prefix: string;
|
|
2218
|
+
constructor(storage?: Storage, prefix?: string);
|
|
2219
|
+
getItem(key: string): string | null;
|
|
2220
|
+
setItem(key: string, value: string): void;
|
|
2221
|
+
removeItem(key: string): boolean;
|
|
2222
|
+
keys(): string[];
|
|
2223
|
+
}
|
|
2224
|
+
|
|
2225
|
+
interface WebAuthnPrfSecretStorageOptions {
|
|
2226
|
+
backend: IStorageBackend;
|
|
2227
|
+
rp: {
|
|
2228
|
+
id?: string;
|
|
2229
|
+
name: string;
|
|
2230
|
+
};
|
|
2231
|
+
user: {
|
|
2232
|
+
id: Uint8Array;
|
|
2233
|
+
name: string;
|
|
2234
|
+
displayName: string;
|
|
2235
|
+
};
|
|
2236
|
+
credentials?: Pick<CredentialsContainer, 'create' | 'get'>;
|
|
2237
|
+
alias?: string;
|
|
2238
|
+
}
|
|
2239
|
+
declare class WebAuthnPrfSecretStorageProvider implements ISecretStorageProvider {
|
|
2240
|
+
readonly providerType = "webauthn-prf";
|
|
2241
|
+
private backend;
|
|
2242
|
+
private rp;
|
|
2243
|
+
private user;
|
|
2244
|
+
private credentialsContainer?;
|
|
2245
|
+
private alias;
|
|
2246
|
+
private cachedPassphrase?;
|
|
2247
|
+
constructor(options: WebAuthnPrfSecretStorageOptions);
|
|
2248
|
+
private get credentials();
|
|
2249
|
+
private get recordKey();
|
|
2250
|
+
isHardwareBacked(): boolean;
|
|
2251
|
+
isAvailable(): Promise<boolean>;
|
|
2252
|
+
enroll(): Promise<void>;
|
|
2253
|
+
private unlock;
|
|
2254
|
+
lock(): void;
|
|
2255
|
+
unenroll(): Promise<void>;
|
|
2256
|
+
storeSecret(bundleHash: string, secret: string, options?: StorageOptions): Promise<void>;
|
|
2178
2257
|
retrieveSecret(bundleHash: string, options?: {
|
|
2179
2258
|
passphrase?: string;
|
|
2180
2259
|
}): Promise<string | null>;
|
|
2260
|
+
withSecret<T>(bundleHash: string, fn: (secret: string) => Promise<T> | T, options?: {
|
|
2261
|
+
passphrase?: string;
|
|
2262
|
+
}): Promise<T>;
|
|
2181
2263
|
deleteSecret(bundleHash: string): Promise<boolean>;
|
|
2182
2264
|
hasSecret(bundleHash: string): Promise<boolean>;
|
|
2183
2265
|
listSecrets(): Promise<SecretStorageMetadata[]>;
|
|
2266
|
+
recoverSecret(bundleHash: string, recoveryPassphrase: string, options?: {
|
|
2267
|
+
label?: string;
|
|
2268
|
+
}): Promise<void>;
|
|
2269
|
+
}
|
|
2270
|
+
|
|
2271
|
+
interface IKeyStore {
|
|
2272
|
+
get(name: string): Promise<CryptoKey | undefined>;
|
|
2273
|
+
put(name: string, key: CryptoKey): Promise<void>;
|
|
2274
|
+
delete(name: string): Promise<boolean>;
|
|
2275
|
+
}
|
|
2276
|
+
declare class MemoryKeyStore implements IKeyStore {
|
|
2277
|
+
private keys;
|
|
2278
|
+
get(name: string): Promise<CryptoKey | undefined>;
|
|
2279
|
+
put(name: string, key: CryptoKey): Promise<void>;
|
|
2280
|
+
delete(name: string): Promise<boolean>;
|
|
2281
|
+
}
|
|
2282
|
+
declare class IndexedDbKeyStore implements IKeyStore {
|
|
2283
|
+
private dbName;
|
|
2284
|
+
private storeName;
|
|
2285
|
+
constructor(dbName?: string);
|
|
2286
|
+
private getDb;
|
|
2287
|
+
get(name: string): Promise<CryptoKey | undefined>;
|
|
2288
|
+
put(name: string, key: CryptoKey): Promise<void>;
|
|
2289
|
+
delete(name: string): Promise<boolean>;
|
|
2290
|
+
}
|
|
2291
|
+
interface NonExtractableKeyStorageOptions {
|
|
2292
|
+
backend: IStorageBackend;
|
|
2293
|
+
keyStore?: IKeyStore;
|
|
2294
|
+
alias?: string;
|
|
2295
|
+
}
|
|
2296
|
+
declare class NonExtractableKeySecretStorageProvider implements ISecretStorageProvider {
|
|
2297
|
+
readonly providerType = "webcrypto-nonextractable";
|
|
2298
|
+
private backend;
|
|
2299
|
+
private keyStore;
|
|
2300
|
+
private alias;
|
|
2301
|
+
private cachedPassphrase?;
|
|
2302
|
+
constructor(options: NonExtractableKeyStorageOptions);
|
|
2303
|
+
private get recordKey();
|
|
2304
|
+
private get kekStoreKey();
|
|
2305
|
+
isHardwareBacked(): boolean;
|
|
2306
|
+
isAvailable(): Promise<boolean>;
|
|
2307
|
+
private unlock;
|
|
2308
|
+
lock(): void;
|
|
2309
|
+
unenroll(): Promise<void>;
|
|
2310
|
+
storeSecret(bundleHash: string, secret: string, options?: StorageOptions): Promise<void>;
|
|
2311
|
+
retrieveSecret(bundleHash: string, options?: {
|
|
2312
|
+
passphrase?: string;
|
|
2313
|
+
}): Promise<string | null>;
|
|
2184
2314
|
withSecret<T>(bundleHash: string, fn: (secret: string) => Promise<T> | T, options?: {
|
|
2185
2315
|
passphrase?: string;
|
|
2186
2316
|
}): Promise<T>;
|
|
2317
|
+
deleteSecret(bundleHash: string): Promise<boolean>;
|
|
2318
|
+
hasSecret(bundleHash: string): Promise<boolean>;
|
|
2319
|
+
listSecrets(): Promise<SecretStorageMetadata[]>;
|
|
2320
|
+
recoverSecret(bundleHash: string, recoveryPassphrase: string, options?: {
|
|
2321
|
+
label?: string;
|
|
2322
|
+
}): Promise<void>;
|
|
2187
2323
|
}
|
|
2188
2324
|
|
|
2325
|
+
declare const SECRET_KEY_PREFIX = "knishio:secret:";
|
|
2326
|
+
declare const RECOVERY_KEY_PREFIX = "knishio:recovery:";
|
|
2327
|
+
declare function sealEnvelope(secret: string, passphrase: string, metadata: SecretStorageMetadata): Promise<EncryptedSecretPayload>;
|
|
2328
|
+
declare function openEnvelope(payload: EncryptedSecretPayload, passphrase: string): Promise<Uint8Array>;
|
|
2329
|
+
|
|
2189
2330
|
interface CreateSecretStorageOptions {
|
|
2190
2331
|
type?: 'webcrypto' | 'memory';
|
|
2191
2332
|
defaultPassphrase?: string;
|
|
2192
2333
|
backend?: IStorageBackend;
|
|
2193
|
-
hardwareBacked?: boolean;
|
|
2194
2334
|
}
|
|
2195
2335
|
declare function createDefaultSecretStorage(options?: CreateSecretStorageOptions): ISecretStorageProvider;
|
|
2196
2336
|
|
|
@@ -2199,15 +2339,15 @@ declare function withSecureBytes<T>(bytes: Uint8Array, fn: (bytes: Uint8Array) =
|
|
|
2199
2339
|
declare function withSecureString<T>(secret: string, fn: (cleanSecret: string) => Promise<T> | T): Promise<T>;
|
|
2200
2340
|
declare function constantTimeCompare(a: Uint8Array | string, b: Uint8Array | string): boolean;
|
|
2201
2341
|
|
|
2202
|
-
declare const SDK_VERSION = "
|
|
2342
|
+
declare const SDK_VERSION = "1.1.0";
|
|
2203
2343
|
declare const SDK_NAME = "KnishIO-Client-TS";
|
|
2204
2344
|
declare const COMPATIBLE_SERVER_VERSIONS: number[];
|
|
2205
2345
|
declare const SDK_INFO: {
|
|
2206
2346
|
readonly name: "KnishIO-Client-TS";
|
|
2207
|
-
readonly version: "
|
|
2347
|
+
readonly version: "1.1.0";
|
|
2208
2348
|
readonly description: "TypeScript SDK for Knish.IO post-blockchain distributed ledger";
|
|
2209
2349
|
readonly compatibleServerVersions: number[];
|
|
2210
|
-
readonly features: readonly ["Post-quantum cryptography (XMSS, ML-
|
|
2350
|
+
readonly features: readonly ["Post-quantum cryptography (XMSS, ML-KEM-1024)", "Cross-platform compatibility", "Type-safe APIs", "DAG-based transaction processing", "GraphQL integration", "Real-time subscriptions", "Cellular architecture support"];
|
|
2211
2351
|
readonly build: {
|
|
2212
2352
|
readonly target: "ES2022";
|
|
2213
2353
|
readonly formats: readonly ["esm", "cjs", "iife"];
|
|
@@ -2232,10 +2372,10 @@ declare const DevUtils: {
|
|
|
2232
2372
|
nodeVersion: string;
|
|
2233
2373
|
environment: string;
|
|
2234
2374
|
name: "KnishIO-Client-TS";
|
|
2235
|
-
version: "
|
|
2375
|
+
version: "1.1.0";
|
|
2236
2376
|
description: "TypeScript SDK for Knish.IO post-blockchain distributed ledger";
|
|
2237
2377
|
compatibleServerVersions: number[];
|
|
2238
|
-
features: readonly ["Post-quantum cryptography (XMSS, ML-
|
|
2378
|
+
features: readonly ["Post-quantum cryptography (XMSS, ML-KEM-1024)", "Cross-platform compatibility", "Type-safe APIs", "DAG-based transaction processing", "GraphQL integration", "Real-time subscriptions", "Cellular architecture support"];
|
|
2239
2379
|
build: {
|
|
2240
2380
|
readonly target: "ES2022";
|
|
2241
2381
|
readonly formats: readonly ["esm", "cjs", "iife"];
|
|
@@ -2259,10 +2399,10 @@ declare const KnishIO: {
|
|
|
2259
2399
|
SDK_VERSION: string;
|
|
2260
2400
|
SDK_INFO: {
|
|
2261
2401
|
readonly name: "KnishIO-Client-TS";
|
|
2262
|
-
readonly version: "
|
|
2402
|
+
readonly version: "1.1.0";
|
|
2263
2403
|
readonly description: "TypeScript SDK for Knish.IO post-blockchain distributed ledger";
|
|
2264
2404
|
readonly compatibleServerVersions: number[];
|
|
2265
|
-
readonly features: readonly ["Post-quantum cryptography (XMSS, ML-
|
|
2405
|
+
readonly features: readonly ["Post-quantum cryptography (XMSS, ML-KEM-1024)", "Cross-platform compatibility", "Type-safe APIs", "DAG-based transaction processing", "GraphQL integration", "Real-time subscriptions", "Cellular architecture support"];
|
|
2266
2406
|
readonly build: {
|
|
2267
2407
|
readonly target: "ES2022";
|
|
2268
2408
|
readonly formats: readonly ["esm", "cjs", "iife"];
|
|
@@ -2272,4 +2412,4 @@ declare const KnishIO: {
|
|
|
2272
2412
|
};
|
|
2273
2413
|
};
|
|
2274
2414
|
|
|
2275
|
-
export { Atom, AtomIndexException, type AtomIsotope, AtomMeta, type AtomParams, AtomsMissingException, type AuthParams, AuthToken, type BalanceQueryParams, type Base17Hash, BaseException, type BaseResponse, type BundleHash, type BundleHashOptions, COMPATIBLE_SERVER_VERSIONS, CRYPTO_CONSTANTS, type CellSlug, CheckMolecule, type CreateSecretStorageOptions, type CreateTokenParams, DevUtils, Dot, EXCEPTION_CODES, EXCEPTION_TYPES, EXTENDED_COMPATIBILITY_TEST_VECTORS, type EmbeddingStatusItem, type EncryptedSecretPayload, ExceptionFactory, GraphQLClient, type GraphQLError, type GraphQLRequest, type GraphQLResponse, type HexString, type ISecretStorageProvider, type IStorageBackend, InvalidResponseException, type KeyGenerationOptions, KnishIO, KnishIOClient, type KnishIOClientConfig, MemorySecretStorageProvider, MemoryStorageBackend, Meta$1 as Meta, type MetaData, type MetaId, type MetaQueryParams, type MetaType, type MolecularHash, MolecularHashMismatchException, Molecule, type MoleculeParams, Mutation, MutationAppendRequest, MutationCreateMeta, MutationCreateToken, MutationCreateWallet, type MutationOperation, MutationPeering, MutationProposeMolecule, MutationRequestAuthorization, MutationRequestTokens, MutationTransferTokens, PolicyMeta, type Position, type PositionGenerationOptions, Query, QueryAtom, QueryBalance, QueryBatch, QueryContinuId, QueryEmbeddingStatus, QueryMetaType, QueryMetaTypeViaAtom, type QueryOperation, QueryWalletBundle, QueryWalletList, type RequestTokensParams, Response, ResponseAppendRequest, ResponseAtom, ResponseBalance, ResponseContinuId, ResponseCreateMeta, ResponseCreateToken, ResponseCreateWallet, ResponseEmbeddingStatus, ResponseMetaType, ResponseMetaTypeViaAtom, ResponsePeering, ResponseProposeMolecule, ResponseRequestAuthorization, ResponseRequestTokens, ResponseTransferTokens, ResponseWalletBundle, ResponseWalletList, type SDKConfig, SDK_INFO, SDK_NAME, SDK_VERSION, type SHAKE256Options, type SecretGenerationOptions, SecretStorageException, type SecretStorageMetadata, SignatureMismatchException, type SignatureOptions, type TokenSlug, TokenUnit, TransferBalanceException, type TransferParams, type ValidationResult$1 as ValidationResult, type VerificationOptions, Wallet, type WalletAddress, WalletCredentialException, type WalletParams, type WalletQueryParams, WebCryptoSecretStorageProvider, base64ToHex, bufferToHexString, capitalize, charsetBaseConvert, chunkArray, chunkSubstr, configureSDK, constantTimeCompare, convertToBase17, createBundleHash, createDefaultSecretStorage, createMolecularHash, createPosition, createTokenSlug, createWalletAddress, deepCloning, diff, enumerateMolecularHash, generateBatchId, generateBundleHash, generateOTSSignature, generatePosition, generateSecret, generateWalletAddress, generateWalletKey, getSDKConfig, hexStringToBuffer, hexToBase64, intersect, isAtomIsotope, isBundleHash, isHex, isHexString, isMolecularHash, isNumeric, isPosition, isWalletAddress, normalizeMolecularHash, randomString, runCompatibilityTests, runExtendedCompatibilityTests, shake256, toCamelCase, toSnakeCase, truncate, validateBundleHash, validateMolecularHashForSignature, validateOTSSignature, validatePosition, validateSecret, validateWalletAddress, verifyOTSSignature, withSecureBytes, withSecureString, zeroizeBytes };
|
|
2415
|
+
export { Atom, AtomIndexException, type AtomIsotope, AtomMeta, type AtomParams, AtomsMissingException, type AuthParams, AuthToken, type BalanceQueryParams, type Base17Hash, BaseException, type BaseResponse, type BundleHash, type BundleHashOptions, COMPATIBLE_SERVER_VERSIONS, CRYPTO_CONSTANTS, type CellSlug, CheckMolecule, type CreateSecretStorageOptions, type CreateTokenParams, DevUtils, Dot, EXCEPTION_CODES, EXCEPTION_TYPES, EXTENDED_COMPATIBILITY_TEST_VECTORS, type EmbeddingStatusItem, type EncryptedSecretPayload, ExceptionFactory, FileStorageBackend, GraphQLClient, type GraphQLError, type GraphQLRequest, type GraphQLResponse, type HexString, type IKeyStore, type ISecretStorageProvider, type IStorageBackend, IndexedDbKeyStore, InvalidResponseException, type KeyGenerationOptions, KnishIO, KnishIOClient, type KnishIOClientConfig, MemoryKeyStore, MemorySecretStorageProvider, MemoryStorageBackend, Meta$1 as Meta, type MetaData, type MetaId, type MetaQueryParams, type MetaType, type MolecularHash, MolecularHashMismatchException, Molecule, type MoleculeParams, Mutation, MutationAppendRequest, MutationCreateMeta, MutationCreateToken, MutationCreateWallet, type MutationOperation, MutationPeering, MutationProposeMolecule, MutationRequestAuthorization, MutationRequestTokens, MutationTransferTokens, NonExtractableKeySecretStorageProvider, type NonExtractableKeyStorageOptions, PolicyMeta, type Position, type PositionGenerationOptions, Query, QueryAtom, QueryBalance, QueryBatch, QueryContinuId, QueryEmbeddingStatus, QueryMetaType, QueryMetaTypeViaAtom, type QueryOperation, QueryWalletBundle, QueryWalletList, RECOVERY_KEY_PREFIX, type RequestTokensParams, Response, ResponseAppendRequest, ResponseAtom, ResponseBalance, ResponseContinuId, ResponseCreateMeta, ResponseCreateToken, ResponseCreateWallet, ResponseEmbeddingStatus, ResponseMetaType, ResponseMetaTypeViaAtom, ResponsePeering, ResponseProposeMolecule, ResponseRequestAuthorization, ResponseRequestTokens, ResponseTransferTokens, ResponseWalletBundle, ResponseWalletList, type SDKConfig, SDK_INFO, SDK_NAME, SDK_VERSION, SECRET_KEY_PREFIX, type SHAKE256Options, type SecretGenerationOptions, SecretStorageException, type SecretStorageMetadata, SignatureMismatchException, type SignatureOptions, type StorageOptions, type TokenSlug, TokenUnit, TransferBalanceException, type TransferParams, type ValidationResult$1 as ValidationResult, type VerificationOptions, Wallet, type WalletAddress, WalletCredentialException, type WalletParams, type WalletQueryParams, type WebAuthnPrfSecretStorageOptions, WebAuthnPrfSecretStorageProvider, WebCryptoSecretStorageProvider, WebStorageBackend, base64ToHex, bufferToHexString, capitalize, charsetBaseConvert, chunkArray, chunkSubstr, configureSDK, constantTimeCompare, convertToBase17, createBundleHash, createDefaultSecretStorage, createMolecularHash, createPosition, createTokenSlug, createWalletAddress, deepCloning, diff, enumerateMolecularHash, generateBatchId, generateBundleHash, generateOTSSignature, generatePosition, generateSecret, generateWalletAddress, generateWalletKey, getSDKConfig, hexStringToBuffer, hexToBase64, intersect, isAtomIsotope, isBundleHash, isHex, isHexString, isMolecularHash, isNumeric, isPosition, isWalletAddress, normalizeMolecularHash, openEnvelope, randomString, runCompatibilityTests, runExtendedCompatibilityTests, sealEnvelope, shake256, toCamelCase, toSnakeCase, truncate, validateBundleHash, validateMolecularHashForSignature, validateOTSSignature, validatePosition, validateSecret, validateWalletAddress, verifyOTSSignature, withSecureBytes, withSecureString, zeroizeBytes };
|