Skip to content

Commit aa9cfa8

Browse files
committed
feat: add TypeScript declaration files for ABI, config, and types; update package version to 1.1.1
1 parent 7ddcf4d commit aa9cfa8

File tree

9 files changed

+79
-44
lines changed

9 files changed

+79
-44
lines changed

dist/index.d.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import { methods, defaultContractAddress, defaultABI } from "./src/ABI";
2+
import type { IEthersError, IExtendedConfig } from "./src/types";
3+
declare const getTimestamp: (_config?: IExtendedConfig) => Promise<number>, encryptMessage: (message: string, timestamp: number, _config?: IExtendedConfig) => Promise<any>, decryptMessage: (encryptedMessage: string, _config?: IExtendedConfig) => Promise<any>, isActive: (encryptedMsg: string, _config?: IExtendedConfig) => Promise<any>, whenActive: (encryptedMsg: string, _config?: IExtendedConfig) => Promise<number>;
4+
export { methods as default, getTimestamp, encryptMessage, decryptMessage, isActive, whenActive, defaultABI, defaultContractAddress, type IEthersError, type IExtendedConfig, };

dist/jest.config.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
export let preset: string;
2+
export let testEnvironment: string;

dist/src/ABI/abi.d.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
export declare const v1_0: ({
2+
inputs: never[];
3+
stateMutability: string;
4+
type: string;
5+
name?: undefined;
6+
outputs?: undefined;
7+
} | {
8+
inputs: {
9+
internalType: string;
10+
name: string;
11+
type: string;
12+
}[];
13+
name: string;
14+
outputs: {
15+
internalType: string;
16+
name: string;
17+
type: string;
18+
}[];
19+
stateMutability: string;
20+
type: string;
21+
})[];

dist/src/ABI/index.d.ts

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import type { IExtendedConfig } from "../types";
2+
export declare const defaultABI: ({
3+
inputs: never[];
4+
stateMutability: string;
5+
type: string;
6+
name?: undefined;
7+
outputs?: undefined;
8+
} | {
9+
inputs: {
10+
internalType: string;
11+
name: string;
12+
type: string;
13+
}[];
14+
name: string;
15+
outputs: {
16+
internalType: string;
17+
name: string;
18+
type: string;
19+
}[];
20+
stateMutability: string;
21+
type: string;
22+
})[];
23+
export declare const defaultContractAddress: string;
24+
export declare const methods: {
25+
getTimestamp: (_config?: IExtendedConfig) => Promise<number>;
26+
encryptMessage: (message: string, timestamp: number, _config?: IExtendedConfig) => Promise<any>;
27+
decryptMessage: (encryptedMessage: string, _config?: IExtendedConfig) => Promise<any>;
28+
isActive: (encryptedMsg: string, _config?: IExtendedConfig) => Promise<any>;
29+
whenActive: (encryptedMsg: string, _config?: IExtendedConfig) => Promise<number>;
30+
};

dist/src/config/index.d.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
declare const config: {
2+
RPC_URL: string;
3+
CHAIN_ID: number;
4+
CONTRACT_ADDRESS: string;
5+
};
6+
export default config;

dist/src/types/index.d.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import type { InterfaceAbi, JsonRpcProvider } from "ethers";
2+
export interface IExtendedConfig {
3+
provider?: JsonRpcProvider;
4+
contractAddress?: string;
5+
rpcUrl?: string;
6+
abi?: InterfaceAbi;
7+
}
8+
export interface IEthersError {
9+
message: string;
10+
revert: {
11+
args: string[];
12+
};
13+
}

dist/test/modules.test.js

Lines changed: 0 additions & 43 deletions
This file was deleted.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "timecipher",
33
"discription": "TimeCipher is a blockchain-based time-locked messaging system that securely encrypts messages with a timestamp, ensuring they can only be decrypted after the specified time. This innovative solution combines privacy and delayed access, perfect for secure future communication.",
4-
"version": "1.1.0",
4+
"version": "1.1.1",
55
"keywords": [
66
"timecipher",
77
"blockchain",

tsconfig.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
"outDir": "./dist",
1010
"moduleDetection": "force",
1111
"allowJs": true,
12+
"declaration": true,
13+
"emitDeclarationOnly": true,
1214

1315
// Best practices
1416
"skipLibCheck": true,

0 commit comments

Comments
 (0)