Skip to content

Commit d9f46c3

Browse files
committed
fix: update tss module readme
1 parent b9d8406 commit d9f46c3

File tree

1 file changed

+58
-58
lines changed

1 file changed

+58
-58
lines changed

packages/tss/README.md

Lines changed: 58 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,91 +1,91 @@
11
# tKey Web Storage Module
22

3-
[![npm version](https://img.shields.io/npm/v/@tkey/web-storage?label=%22%22)](https://www.npmjs.com/package/@tkey/web-storage/v/latest) [![minzip](https://img.shields.io/bundlephobia/minzip/@tkey/web-storage?label=%22%22)](https://bundlephobia.com/result?p=@tkey/web-storage@latest)
3+
[![npm version](https://img.shields.io/npm/v/@tkey/tss?label=%22%22)](https://www.npmjs.com/package/@tkey/tss/v/latest)
4+
[![minzip](https://img.shields.io/bundlephobia/minzip/@tkey/tss?label=%22%22)](https://bundlephobia.com/result?p=@tkey/tss@latest)
45

5-
The tKey Web Storage Module helps you store and recall key shares in the from local and file storage. This module is the part of the [tKey SDK](https://github.com/tkey/tkey/).
6+
The tKey TSS Module enable tss- Threshold Signature Scheme (MPC - multi Party Computing) feature. This module is the part of the [tKey SDK](https://github.com/tkey/tkey/).
67

78
## Installation
89

910
```shell
10-
npm install --save @tkey/web-storage
11+
npm install --save @tkey/tss
1112
```
1213

1314
## Initialization
1415

15-
#### Import the `WebStorageModule` class from `@tkey/web-storage`
16+
#### Import the `TSSModule` class from `@tkey/tss`
1617

1718
```javascript
18-
import WebStorageModule from "@tkey/web-storage";
19+
import TSSModule from "@tkey/tss";
1920
```
2021

21-
#### Assign the `WebStorageModule` class to a variable
22+
#### Assign the `TSSModule` class to a variable
2223

2324
```javascript
24-
const webStorageModule = new WebStorageModule(params);
25+
const tssModule = new TSSModule(params);
2526
```
2627

2728
### Parameters
2829

2930
`params`
3031

31-
- `canUseFileStorage?`: `boolean`
32-
32+
- `tkey`: `ThresholdKey`
33+
- `moduleName` = `TSS_MODULE_NAME`,
34+
- `tssTag` = `default`
3335
### Returns
3436

35-
The `WebStorageModule` class returns an object with the following properties:
37+
The `TSSModule` class returns an object with the following properties:
3638

3739
```ts
38-
class WebStorageModule implements IModule {
40+
class TSSModule {
3941
moduleName: string;
40-
tbSDK: ITKeyApi;
41-
canUseFileStorage: boolean;
42-
constructor(canUseFileStorage?: boolean);
43-
setFileStorageAccess(): Promise<void>;
44-
setModuleReferences(tbSDK: ITKeyApi): void;
45-
initialize(): Promise<void>;
46-
storeDeviceShare(deviceShareStore: ShareStore, customDeviceInfo?: StringifiedType): Promise<void>;
47-
storeDeviceShareOnFileStorage(shareIndex: BNString): Promise<void>;
48-
getDeviceShare(): Promise<ShareStore>;
49-
inputShareFromWebStorage(): Promise<void>;
42+
tkey: ThresholdKey;
43+
tssTag: string;
44+
45+
async setModuleReferences(api: ThresholdKey): Promise<void>
46+
async initializeWithTss(
47+
tssOptions: { deviceTSSShare: BN; deviceTSSIndex: number; factorPub: Point },
48+
params?: {
49+
withShare?: ShareStore;
50+
importKey?: BN;
51+
neverInitializeNewKey?: boolean;
52+
transitionMetadata?: IMetadata;
53+
previouslyFetchedCloudMetadata?: IMetadata;
54+
previousLocalMetadataTransitions?: LocalMetadataTransitions;
55+
delete1OutOf1?: boolean;
56+
}
57+
)
58+
59+
getTSSCommits(): Point[]
60+
61+
getTSSPub(): Point
62+
63+
async getTSSShare(factorKey: BN, opts?: { threshold: number }): Promise<{ tssIndex: number; tssShare: BN }>
64+
65+
getFactorEncs(factorPub: Point): FactorEnc
66+
67+
async generateNewShare(tssOptions?: {
68+
inputTSSShare: BN;
69+
inputTSSIndex: number;
70+
newFactorPub: Point;
71+
newTSSIndex: number;
72+
authSignatures?: string[];
73+
selectedServers?: number[];
74+
}): Promise<GenerateNewShareResult>
75+
76+
async deleteShare(
77+
tssOptions: {
78+
inputTSSShare: BN;
79+
inputTSSIndex: number;
80+
factorPub: Point;
81+
authSignatures: string[];
82+
selectedServers?: number[];
83+
},
84+
shareIndex: BNString
85+
) : Promise<void>
5086
}
5187
```
5288

5389
## Usage
5490

55-
With the `WebStorageModule`, you've access to the following functions:
56-
57-
### Store Device Share
58-
59-
#### `storeDeviceShare(deviceShareStore: ShareStore, customDeviceInfo?: StringifiedType)`
60-
61-
- `deviceShareStore`: The `ShareStore` object to store.
62-
- `customDeviceInfo?`: Information about the device to store.
63-
64-
#### `ShareStore`
65-
66-
```ts
67-
class ShareStore implements ISerializable {
68-
share: Share;
69-
polynomialID: PolynomialID;
70-
constructor(share: Share, polynomialID: PolynomialID);
71-
static fromJSON(value: StringifiedType): ShareStore;
72-
toJSON(): StringifiedType;
73-
}
74-
interface ISerializable {
75-
toJSON(): StringifiedType;
76-
}
77-
```
78-
79-
### Storing a Share on File Storage
80-
81-
#### `storeDeviceShareOnFileStorage(shareIndex)`
82-
83-
- `shareIndex`: The index of the share to store.
84-
85-
### Get a ShareStore from Storage
86-
87-
#### `getDeviceShare()`
88-
89-
#### Return
90-
91-
- `Promise<ShareStore>`: The [`ShareStore`](#sharestore) object.
91+
With the `TSSModule`, you've access to the following functions:

0 commit comments

Comments
 (0)