@steemit/steem-js 1.0.0 → 1.0.2
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 +8 -2
- package/dist/auth/ecc/src/ecdsa.d.ts +8 -7
- package/dist/auth/ecc/src/ecsignature.d.ts +4 -4
- package/dist/auth/ecc/src/key_private.d.ts +6 -6
- package/dist/auth/ecc/src/key_public.d.ts +5 -5
- package/dist/auth/ecc/src/signature.d.ts +5 -4
- package/dist/auth/serializer/transaction.d.ts +5 -0
- package/dist/config.d.ts +2 -0
- package/dist/index.cjs +13048 -2036
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +13056 -2044
- package/dist/index.js.map +1 -1
- package/dist/index.umd.js +25830 -27038
- package/dist/index.umd.js.map +1 -1
- package/dist/umd.d.ts +36 -0
- package/dist/utils/buffer-global.d.ts +7 -0
- package/dist/utils/debug.d.ts +36 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/net-polyfill.d.ts +17 -0
- package/dist/utils/polyfill-test.d.ts +19 -0
- package/dist/utils/promisify.d.ts +5 -0
- package/dist/utils/tls-polyfill.d.ts +15 -0
- package/dist/utils/util-polyfill.d.ts +17 -0
- package/package.json +6 -5
package/dist/umd.d.ts
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { Api } from './api';
|
|
2
|
+
import * as auth from './auth';
|
|
3
|
+
import * as broadcast from './broadcast';
|
|
4
|
+
import * as formatter from './formatter';
|
|
5
|
+
import * as memo from './memo';
|
|
6
|
+
import * as operations from './operations';
|
|
7
|
+
import * as serializer from './serializer';
|
|
8
|
+
import * as utils from './utils';
|
|
9
|
+
declare const steem: {
|
|
10
|
+
config: {
|
|
11
|
+
set: (options: any) => void;
|
|
12
|
+
get: (key: string) => any;
|
|
13
|
+
getBoolean: (key: string) => boolean;
|
|
14
|
+
getNumber: (key: string) => number;
|
|
15
|
+
getString: (key: string) => string;
|
|
16
|
+
all: () => {
|
|
17
|
+
[key: string]: any;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
sha256: (data: string | Buffer) => Buffer;
|
|
21
|
+
ripemd160: (data: string | Buffer) => Buffer;
|
|
22
|
+
doubleSha256: (data: string | Buffer) => Buffer;
|
|
23
|
+
hmacSha256: (key: string | Buffer, data: string | Buffer) => Buffer;
|
|
24
|
+
generateKeyPair: () => auth.KeyPair;
|
|
25
|
+
sign: (message: string | Buffer, privateKey: string) => string;
|
|
26
|
+
verify: (message: string | Buffer, signature: string, publicKey: string) => boolean;
|
|
27
|
+
api: Api;
|
|
28
|
+
auth: typeof auth;
|
|
29
|
+
broadcast: typeof broadcast;
|
|
30
|
+
formatter: typeof formatter;
|
|
31
|
+
memo: typeof memo;
|
|
32
|
+
operations: typeof operations;
|
|
33
|
+
serializer: typeof serializer;
|
|
34
|
+
utils: typeof utils;
|
|
35
|
+
};
|
|
36
|
+
export default steem;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Debug utility for controlled debug output
|
|
3
|
+
* Can be enabled via:
|
|
4
|
+
* 1. Config: steem.config.set({ debug: true })
|
|
5
|
+
* 2. Environment variable: DEBUG=steem-js or DEBUG=steem-js:*
|
|
6
|
+
* 3. Specific debug flags: DEBUG=steem-js:transaction,steem-js:signature
|
|
7
|
+
*/
|
|
8
|
+
export declare const debug: {
|
|
9
|
+
/**
|
|
10
|
+
* Log debug information
|
|
11
|
+
* @param flag - Optional debug flag (e.g., 'transaction', 'signature')
|
|
12
|
+
* @param args - Arguments to log
|
|
13
|
+
*/
|
|
14
|
+
log(flag?: string, ...args: any[]): void;
|
|
15
|
+
/**
|
|
16
|
+
* Log transaction debug info
|
|
17
|
+
*/
|
|
18
|
+
transaction(...args: any[]): void;
|
|
19
|
+
/**
|
|
20
|
+
* Log signature debug info
|
|
21
|
+
*/
|
|
22
|
+
signature(...args: any[]): void;
|
|
23
|
+
/**
|
|
24
|
+
* Log warning (always shown, but can be controlled)
|
|
25
|
+
*/
|
|
26
|
+
warn(...args: any[]): void;
|
|
27
|
+
/**
|
|
28
|
+
* Log error (always shown)
|
|
29
|
+
*/
|
|
30
|
+
error(...args: any[]): void;
|
|
31
|
+
/**
|
|
32
|
+
* Check if debug is enabled for a specific flag
|
|
33
|
+
*/
|
|
34
|
+
isEnabled(flag?: string): boolean;
|
|
35
|
+
};
|
|
36
|
+
export default debug;
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -6,3 +6,4 @@ export declare const flatten: <T>(array: T[][]) => T[];
|
|
|
6
6
|
export declare const isValidAddress: (address: string) => boolean;
|
|
7
7
|
export declare const isValidAmount: (amount: string) => boolean;
|
|
8
8
|
export declare const isValidPermlink: (permlink: string) => boolean;
|
|
9
|
+
export { debug } from './debug';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Browser polyfill for the net module
|
|
3
|
+
* In browser environments, net module functionality is not available, provides error messages
|
|
4
|
+
*/
|
|
5
|
+
export declare const createConnection: (..._args: any[]) => never;
|
|
6
|
+
export declare const createServer: (..._args: any[]) => never;
|
|
7
|
+
export declare const isIP: (input: string) => number;
|
|
8
|
+
export declare const isIPv4: (input: string) => boolean;
|
|
9
|
+
export declare const isIPv6: (input: string) => boolean;
|
|
10
|
+
declare const net: {
|
|
11
|
+
createConnection: (..._args: any[]) => never;
|
|
12
|
+
createServer: (..._args: any[]) => never;
|
|
13
|
+
isIP: (input: string) => number;
|
|
14
|
+
isIPv4: (input: string) => boolean;
|
|
15
|
+
isIPv6: (input: string) => boolean;
|
|
16
|
+
};
|
|
17
|
+
export default net;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 测试 polyfill 功能的示例文件
|
|
3
|
+
* 这个文件用于验证 path 和 url polyfill 是否正常工作
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* 测试 path polyfill 功能
|
|
7
|
+
*/
|
|
8
|
+
export declare function testPathPolyfill(): boolean;
|
|
9
|
+
/**
|
|
10
|
+
* 测试 URL polyfill 功能
|
|
11
|
+
*/
|
|
12
|
+
export declare function testUrlPolyfill(): boolean;
|
|
13
|
+
/**
|
|
14
|
+
* 运行所有 polyfill 测试
|
|
15
|
+
*/
|
|
16
|
+
export declare function runPolyfillTests(): {
|
|
17
|
+
path: boolean;
|
|
18
|
+
url: boolean;
|
|
19
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Browser polyfill for the tls module
|
|
3
|
+
* In browser environments, tls module functionality is not available, provides error messages
|
|
4
|
+
*/
|
|
5
|
+
export declare const connect: (..._args: any[]) => never;
|
|
6
|
+
export declare const createServer: (..._args: any[]) => never;
|
|
7
|
+
export declare const createSecureContext: (..._args: any[]) => never;
|
|
8
|
+
export declare const getCiphers: () => string[];
|
|
9
|
+
declare const tls: {
|
|
10
|
+
connect: (..._args: any[]) => never;
|
|
11
|
+
createServer: (..._args: any[]) => never;
|
|
12
|
+
createSecureContext: (..._args: any[]) => never;
|
|
13
|
+
getCiphers: () => string[];
|
|
14
|
+
};
|
|
15
|
+
export default tls;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Browser-compatible util polyfill
|
|
3
|
+
* Provides minimal util functions needed by dependencies
|
|
4
|
+
*/
|
|
5
|
+
export declare const util: {
|
|
6
|
+
inspect: (obj: any) => string;
|
|
7
|
+
format: (...args: any[]) => string;
|
|
8
|
+
types: {
|
|
9
|
+
isDate: (obj: any) => obj is Date;
|
|
10
|
+
isRegExp: (obj: any) => obj is RegExp;
|
|
11
|
+
isError: (obj: any) => obj is Error;
|
|
12
|
+
isArrayBuffer: (obj: any) => obj is ArrayBuffer;
|
|
13
|
+
isTypedArray: (obj: any) => boolean;
|
|
14
|
+
};
|
|
15
|
+
promisify: (fn: any) => (this: any, ...args: any[]) => Promise<any>;
|
|
16
|
+
};
|
|
17
|
+
export default util;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@steemit/steem-js",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "Steem blockchain JavaScript/TypeScript library",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.cjs",
|
|
@@ -30,14 +30,15 @@
|
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@rollup/plugin-alias": "^6.0.0",
|
|
32
32
|
"@rollup/plugin-commonjs": "^25.0.7",
|
|
33
|
+
"@rollup/plugin-inject": "^5.0.5",
|
|
33
34
|
"@rollup/plugin-json": "^6.1.0",
|
|
34
35
|
"@rollup/plugin-node-resolve": "^15.2.3",
|
|
35
36
|
"@rollup/plugin-typescript": "^11.1.6",
|
|
36
|
-
"@types/bigi": "^1.4.5",
|
|
37
37
|
"@types/bluebird": "^3.5.42",
|
|
38
|
+
"@types/bn.js": "^5.2.0",
|
|
38
39
|
"@types/bytebuffer": "^5.0.49",
|
|
39
40
|
"@types/debug": "^4.1.12",
|
|
40
|
-
"@types/
|
|
41
|
+
"@types/elliptic": "^6.4.18",
|
|
41
42
|
"@types/lodash": "^4.17.18",
|
|
42
43
|
"@types/node": "^20.11.24",
|
|
43
44
|
"@types/ws": "^8.18.1",
|
|
@@ -59,14 +60,14 @@
|
|
|
59
60
|
},
|
|
60
61
|
"dependencies": {
|
|
61
62
|
"axios": "^1.6.7",
|
|
62
|
-
"bigi": "^1.4.2",
|
|
63
63
|
"bluebird": "^3.7.2",
|
|
64
|
+
"bn.js": "^5.2.2",
|
|
64
65
|
"bs58": "^6.0.0",
|
|
65
66
|
"bytebuffer": "^5.0.1",
|
|
66
67
|
"create-hash": "^1.2.0",
|
|
67
68
|
"create-hmac": "^1.1.7",
|
|
68
69
|
"crypto-js": "^4.2.0",
|
|
69
|
-
"
|
|
70
|
+
"elliptic": "^6.6.1",
|
|
70
71
|
"lodash": "^4.17.21",
|
|
71
72
|
"long": "^5.2.3",
|
|
72
73
|
"retry": "^0.13.1",
|