Skip to content
This repository was archived by the owner on May 7, 2022. It is now read-only.

Commit 5dc22a8

Browse files
committed
chore: auto generate types
1 parent cddb9ef commit 5dc22a8

File tree

6 files changed

+23
-87
lines changed

6 files changed

+23
-87
lines changed

package.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
{
2-
"name": "rss3-next",
2+
"name": "rss3",
33
"version": "0.7.0",
44
"description": "",
55
"main": "dist/index.js",
6-
"types": "types/index.d.ts",
76
"files": [
87
"src",
98
"dist",

src/account.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type { AnyObject } from '../types/extend';
22
import Main from './index';
3-
import { IOptionsMnemonic, IOptionsPrivateKey, IOptionsSign } from '../types';
3+
import { IOptionsMnemonic, IOptionsPrivateKey, IOptionsSign } from './index';
44
import { ethers } from 'ethers';
55
import utils from './utils';
66
import nacl from 'tweetnacl';

src/index.ts

+19-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,25 @@ import Items from './items';
55
import Links from './links';
66
import Backlinks from './backlinks';
77
import Assets from './assets';
8-
import { IOptionsMnemonic, IOptionsPrivateKey, IOptionsSign } from '../types';
8+
9+
interface IOptions {
10+
endpoint: string;
11+
agentSign?: boolean;
12+
}
13+
14+
export interface IOptionsMnemonic extends IOptions {
15+
mnemonic?: string;
16+
mnemonicPath?: string;
17+
}
18+
19+
export interface IOptionsPrivateKey extends IOptions {
20+
privateKey: string;
21+
}
22+
23+
export interface IOptionsSign extends IOptions {
24+
address: string;
25+
sign: (data: string) => Promise<string>;
26+
}
927

1028
class RSS3 {
1129
options: IOptionsMnemonic | IOptionsPrivateKey | IOptionsSign;

src/utils/storage.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import Cookies from 'js-cookie';
22
import md5 from 'crypto-js/md5';
33
import config from '../config';
44

5-
interface IStorageData {
5+
export interface IStorageData {
66
privateKey: string;
77
publicKey: string;
88
}

tsconfig.json

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"allowSyntheticDefaultImports": true,
77
"strictPropertyInitialization": false,
88
"target": "esnext",
9+
"declaration": true,
910
"noImplicitAny": true,
1011
"moduleResolution": "node",
1112
"sourceMap": false,

types/index.d.ts

-82
This file was deleted.

0 commit comments

Comments
 (0)