@steemit/steem-js 1.0.4 → 1.0.6
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 +9 -1
- package/dist/api/index.d.ts +50 -55
- package/dist/api/rpc-auth.d.ts +2 -2
- package/dist/api/signature-verification.d.ts +92 -0
- package/dist/api/transports/base.d.ts +2 -2
- package/dist/api/transports/http.d.ts +16 -2
- package/dist/api/transports/index.d.ts +0 -2
- package/dist/api/transports/types.d.ts +6 -6
- package/dist/api/transports/ws.d.ts +1 -0
- package/dist/auth/ecc/src/ecdsa.d.ts +1 -1
- package/dist/auth/ecc/src/enforce_types.d.ts +2 -2
- package/dist/auth/ecc/src/hash.d.ts +4 -2
- package/dist/auth/ecc/src/key_private.d.ts +3 -1
- package/dist/auth/ecc/src/key_public.d.ts +8 -6
- package/dist/auth/index.d.ts +6 -5
- package/dist/auth/serializer/transaction.d.ts +1 -1
- package/dist/auth/serializer.d.ts +3 -3
- package/dist/broadcast/helpers.d.ts +23 -4
- package/dist/broadcast/index.d.ts +24 -22
- package/dist/browser.esm.js +28921 -0
- package/dist/browser.esm.js.map +1 -0
- package/dist/config.d.ts +4 -5
- package/dist/crypto/browser-crypto.d.ts +43 -0
- package/dist/crypto/random-bytes.d.ts +12 -0
- package/dist/formatter/index.d.ts +1 -1
- package/dist/index.browser.js +56378 -0
- package/dist/index.browser.js.map +1 -0
- package/dist/index.cjs +24067 -35324
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.js +24053 -35302
- package/dist/index.js.map +1 -1
- package/dist/index.umd.js +18077 -48081
- package/dist/index.umd.js.map +1 -1
- package/dist/index.umd.min.js +1 -1
- package/dist/index.umd.min.js.map +1 -1
- package/dist/polyfills/async-hooks-browser.d.ts +6 -0
- package/dist/polyfills/secure-random-browser.d.ts +8 -0
- package/dist/serializer/convert.d.ts +15 -6
- package/dist/serializer/index.d.ts +3 -3
- package/dist/serializer/precision.d.ts +1 -1
- package/dist/serializer/types.d.ts +9 -9
- package/dist/types/index.d.ts +9 -9
- package/dist/types.d.ts +2 -2
- package/dist/umd.d.ts +3 -3
- package/dist/utils/debug.d.ts +5 -5
- package/dist/utils/promisify.d.ts +7 -3
- package/package.json +17 -16
|
@@ -3,10 +3,19 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export declare class Convert {
|
|
5
5
|
private type;
|
|
6
|
-
constructor(type:
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
constructor(type: {
|
|
7
|
+
toHex?: (value: unknown) => string;
|
|
8
|
+
fromHex?: (hex: string) => unknown;
|
|
9
|
+
fromObject?: (obj: unknown) => unknown;
|
|
10
|
+
} | null);
|
|
11
|
+
toHex(value: unknown): string;
|
|
12
|
+
fromHex(hex: string): unknown;
|
|
13
|
+
fromObject(obj: unknown): unknown;
|
|
14
|
+
toObject(obj: unknown): unknown;
|
|
11
15
|
}
|
|
12
|
-
export default function (type:
|
|
16
|
+
export default function (type: {
|
|
17
|
+
toHex?: (value: unknown) => string;
|
|
18
|
+
fromHex?: (hex: string) => unknown;
|
|
19
|
+
fromObject?: (obj: unknown) => unknown;
|
|
20
|
+
toObject?: (value: unknown) => unknown;
|
|
21
|
+
} | null): Convert;
|
|
@@ -3,9 +3,9 @@ export declare const serializeTransaction: (transaction: Transaction) => Buffer;
|
|
|
3
3
|
export declare const serializeOperation: (operation: Operation) => Buffer;
|
|
4
4
|
export declare const getTransactionDigest: (transaction: Transaction) => Buffer;
|
|
5
5
|
export declare const getTransactionId: (transaction: Transaction) => string;
|
|
6
|
-
export declare const serialize: (operation:
|
|
7
|
-
export declare const deserialize: (buffer: Buffer) =>
|
|
8
|
-
export declare const deserializeTransaction: (buffer: Buffer) =>
|
|
6
|
+
export declare const serialize: (operation: unknown) => Buffer;
|
|
7
|
+
export declare const deserialize: (buffer: Buffer) => unknown;
|
|
8
|
+
export declare const deserializeTransaction: (buffer: Buffer) => unknown;
|
|
9
9
|
export { default as convert } from './convert';
|
|
10
10
|
export * as types from './types';
|
|
11
11
|
export * as precision from './precision';
|
|
@@ -2,4 +2,4 @@ export declare const _internal: {
|
|
|
2
2
|
decimal_precision_string: (number: string, precision: number) => string;
|
|
3
3
|
};
|
|
4
4
|
export declare const to_bigint64: (number_or_string: string, precision: number) => bigint;
|
|
5
|
-
export declare const to_string64: (input:
|
|
5
|
+
export declare const to_string64: (input: unknown, precision: number) => string;
|
|
@@ -2,15 +2,15 @@ export declare const vote_id: {
|
|
|
2
2
|
fromObject: (id: string) => string;
|
|
3
3
|
toHex: (id: string) => string;
|
|
4
4
|
};
|
|
5
|
-
export declare const set: (_type:
|
|
6
|
-
fromObject: (arr:
|
|
7
|
-
toObject: (set:
|
|
8
|
-
toHex: (arr:
|
|
9
|
-
};
|
|
10
|
-
export declare const map: (_keyType:
|
|
11
|
-
fromObject: (arr: [
|
|
12
|
-
toObject: (map: [
|
|
13
|
-
toHex: (arr: [
|
|
5
|
+
export declare const set: (_type: unknown) => {
|
|
6
|
+
fromObject: (arr: unknown[]) => unknown[];
|
|
7
|
+
toObject: (set: unknown[]) => unknown[];
|
|
8
|
+
toHex: (arr: unknown[]) => string;
|
|
9
|
+
};
|
|
10
|
+
export declare const map: (_keyType: unknown, _valueType: unknown) => {
|
|
11
|
+
fromObject: (arr: [unknown, unknown][]) => [unknown, unknown][];
|
|
12
|
+
toObject: (map: [unknown, unknown][]) => [unknown, unknown][];
|
|
13
|
+
toHex: (arr: [unknown, unknown][]) => string;
|
|
14
14
|
};
|
|
15
15
|
export declare const bool: {
|
|
16
16
|
toHex: (value: boolean) => string;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -63,15 +63,15 @@ export interface Account {
|
|
|
63
63
|
last_market_bandwidth_update: string;
|
|
64
64
|
vesting_balance: string;
|
|
65
65
|
reputation: string;
|
|
66
|
-
transfer_history:
|
|
67
|
-
market_history:
|
|
68
|
-
post_history:
|
|
69
|
-
vote_history:
|
|
70
|
-
other_history:
|
|
66
|
+
transfer_history: unknown[];
|
|
67
|
+
market_history: unknown[];
|
|
68
|
+
post_history: unknown[];
|
|
69
|
+
vote_history: unknown[];
|
|
70
|
+
other_history: unknown[];
|
|
71
71
|
witness_votes: string[];
|
|
72
|
-
tags_usage:
|
|
73
|
-
guest_bloggers:
|
|
74
|
-
blog_category:
|
|
72
|
+
tags_usage: unknown[];
|
|
73
|
+
guest_bloggers: unknown[];
|
|
74
|
+
blog_category: unknown;
|
|
75
75
|
}
|
|
76
76
|
export interface Authority {
|
|
77
77
|
weight_threshold: number;
|
|
@@ -83,7 +83,7 @@ export interface Transaction {
|
|
|
83
83
|
ref_block_prefix: number;
|
|
84
84
|
expiration: string;
|
|
85
85
|
operations: Operation[];
|
|
86
|
-
extensions:
|
|
86
|
+
extensions: unknown[];
|
|
87
87
|
signatures?: string[];
|
|
88
88
|
}
|
|
89
89
|
export interface SignedTransaction extends Transaction {
|
package/dist/types.d.ts
CHANGED
|
@@ -22,13 +22,13 @@ export interface Authority {
|
|
|
22
22
|
}
|
|
23
23
|
export interface Operation {
|
|
24
24
|
type: string;
|
|
25
|
-
value:
|
|
25
|
+
value: unknown;
|
|
26
26
|
}
|
|
27
27
|
export interface Transaction {
|
|
28
28
|
ref_block_num: number;
|
|
29
29
|
ref_block_prefix: number;
|
|
30
30
|
expiration: string;
|
|
31
31
|
operations: Operation[];
|
|
32
|
-
extensions:
|
|
32
|
+
extensions: unknown[];
|
|
33
33
|
signatures?: string[];
|
|
34
34
|
}
|
package/dist/umd.d.ts
CHANGED
|
@@ -8,13 +8,13 @@ import * as serializer from './serializer';
|
|
|
8
8
|
import * as utils from './utils';
|
|
9
9
|
declare const steem: {
|
|
10
10
|
config: {
|
|
11
|
-
set: (options:
|
|
12
|
-
get: (key: string) =>
|
|
11
|
+
set: (options: Record<string, unknown>) => void;
|
|
12
|
+
get: (key: string) => unknown;
|
|
13
13
|
getBoolean: (key: string) => boolean;
|
|
14
14
|
getNumber: (key: string) => number;
|
|
15
15
|
getString: (key: string) => string;
|
|
16
16
|
all: () => {
|
|
17
|
-
[key: string]:
|
|
17
|
+
[key: string]: unknown;
|
|
18
18
|
};
|
|
19
19
|
};
|
|
20
20
|
sha256: (data: string | Buffer) => Buffer;
|
package/dist/utils/debug.d.ts
CHANGED
|
@@ -11,23 +11,23 @@ export declare const debug: {
|
|
|
11
11
|
* @param flag - Optional debug flag (e.g., 'transaction', 'signature')
|
|
12
12
|
* @param args - Arguments to log
|
|
13
13
|
*/
|
|
14
|
-
log(flag?: string, ...args:
|
|
14
|
+
log(flag?: string, ...args: unknown[]): void;
|
|
15
15
|
/**
|
|
16
16
|
* Log transaction debug info
|
|
17
17
|
*/
|
|
18
|
-
transaction(...args:
|
|
18
|
+
transaction(...args: unknown[]): void;
|
|
19
19
|
/**
|
|
20
20
|
* Log signature debug info
|
|
21
21
|
*/
|
|
22
|
-
signature(...args:
|
|
22
|
+
signature(...args: unknown[]): void;
|
|
23
23
|
/**
|
|
24
24
|
* Log warning (always shown, but can be controlled)
|
|
25
25
|
*/
|
|
26
|
-
warn(...args:
|
|
26
|
+
warn(...args: unknown[]): void;
|
|
27
27
|
/**
|
|
28
28
|
* Log error (always shown)
|
|
29
29
|
*/
|
|
30
|
-
error(...args:
|
|
30
|
+
error(...args: unknown[]): void;
|
|
31
31
|
/**
|
|
32
32
|
* Check if debug is enabled for a specific flag
|
|
33
33
|
*/
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
2
|
+
* Promisify utility function
|
|
3
|
+
* Converts a callback-based function to a Promise-based one
|
|
4
|
+
* Universal implementation that works in both Node.js and browser
|
|
5
|
+
*
|
|
6
|
+
* @param fn - Function that uses callback pattern (err, result) => void
|
|
7
|
+
* @returns Promise-based version of the function
|
|
4
8
|
*/
|
|
5
|
-
export declare function promisify<T extends (...args:
|
|
9
|
+
export declare function promisify<T extends (...args: unknown[]) => unknown>(fn: T): (...args: Parameters<T>) => Promise<unknown>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@steemit/steem-js",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.6",
|
|
4
4
|
"description": "Steem blockchain JavaScript/TypeScript library",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.cjs",
|
|
@@ -10,9 +10,10 @@
|
|
|
10
10
|
"exports": {
|
|
11
11
|
".": {
|
|
12
12
|
"types": "./dist/index.d.ts",
|
|
13
|
+
"browser": "./dist/browser.esm.js",
|
|
13
14
|
"import": "./dist/index.js",
|
|
14
15
|
"require": "./dist/index.cjs",
|
|
15
|
-
"
|
|
16
|
+
"default": "./dist/index.js"
|
|
16
17
|
}
|
|
17
18
|
},
|
|
18
19
|
"files": [
|
|
@@ -27,41 +28,43 @@
|
|
|
27
28
|
],
|
|
28
29
|
"author": "hightouch",
|
|
29
30
|
"license": "MIT",
|
|
31
|
+
"engines": {
|
|
32
|
+
"node": ">=18.0.0"
|
|
33
|
+
},
|
|
30
34
|
"devDependencies": {
|
|
35
|
+
"@eslint/js": "^9.39.1",
|
|
31
36
|
"@rollup/plugin-alias": "^6.0.0",
|
|
32
37
|
"@rollup/plugin-commonjs": "^25.0.7",
|
|
33
38
|
"@rollup/plugin-inject": "^5.0.5",
|
|
34
39
|
"@rollup/plugin-json": "^6.1.0",
|
|
35
40
|
"@rollup/plugin-node-resolve": "^15.2.3",
|
|
41
|
+
"@rollup/plugin-replace": "^6.0.3",
|
|
36
42
|
"@rollup/plugin-terser": "^0.4.4",
|
|
37
43
|
"@rollup/plugin-typescript": "^11.1.6",
|
|
38
|
-
"@types/bluebird": "^3.5.42",
|
|
39
44
|
"@types/bn.js": "^5.2.0",
|
|
40
45
|
"@types/bytebuffer": "^5.0.49",
|
|
41
46
|
"@types/debug": "^4.1.12",
|
|
42
47
|
"@types/elliptic": "^6.4.18",
|
|
43
|
-
"@types/lodash": "^4.17.18",
|
|
44
48
|
"@types/node": "^20.11.24",
|
|
45
|
-
"@
|
|
46
|
-
"@typescript-eslint/
|
|
47
|
-
"@typescript-eslint/parser": "^7.1.0",
|
|
49
|
+
"@typescript-eslint/eslint-plugin": "^8.0.0",
|
|
50
|
+
"@typescript-eslint/parser": "^8.0.0",
|
|
48
51
|
"@vitest/coverage-v8": "^3.1.3",
|
|
49
52
|
"assert": "^2.1.0",
|
|
50
53
|
"buffer": "^6.0.3",
|
|
51
|
-
"
|
|
52
|
-
"eslint": "^8.57.0",
|
|
54
|
+
"eslint": "^9.0.0",
|
|
53
55
|
"events": "^3.3.0",
|
|
54
56
|
"prettier": "^3.2.5",
|
|
57
|
+
"process": "^0.11.10",
|
|
55
58
|
"rollup": "^4.12.0",
|
|
56
|
-
"stream-browserify": "^3.0.0",
|
|
57
59
|
"tslib": "^2.6.2",
|
|
58
60
|
"typescript": "^5.3.3",
|
|
61
|
+
"typescript-eslint": "^8.48.0",
|
|
59
62
|
"util": "^0.12.5",
|
|
60
63
|
"vitest": "^3.1.3"
|
|
61
64
|
},
|
|
62
65
|
"dependencies": {
|
|
63
|
-
"
|
|
64
|
-
"
|
|
66
|
+
"@noble/ciphers": "^2.0.1",
|
|
67
|
+
"@noble/hashes": "^2.0.1",
|
|
65
68
|
"bn.js": "^5.2.2",
|
|
66
69
|
"bs58": "^6.0.0",
|
|
67
70
|
"bytebuffer": "^5.0.1",
|
|
@@ -69,10 +72,8 @@
|
|
|
69
72
|
"create-hmac": "^1.1.7",
|
|
70
73
|
"crypto-js": "^4.2.0",
|
|
71
74
|
"elliptic": "^6.6.1",
|
|
72
|
-
"lodash": "^4.17.21",
|
|
73
75
|
"long": "^5.2.3",
|
|
74
|
-
"retry": "^0.13.1"
|
|
75
|
-
"ws": "^8.18.2"
|
|
76
|
+
"retry": "^0.13.1"
|
|
76
77
|
},
|
|
77
78
|
"scripts": {
|
|
78
79
|
"build": "rollup -c",
|
|
@@ -81,7 +82,7 @@
|
|
|
81
82
|
"test:watch": "vitest watch",
|
|
82
83
|
"test:coverage": "vitest run --coverage",
|
|
83
84
|
"typecheck": "tsc --noEmit",
|
|
84
|
-
"lint": "eslint src
|
|
85
|
+
"lint": "eslint src",
|
|
85
86
|
"format": "prettier --write \"src/**/*.ts\""
|
|
86
87
|
}
|
|
87
88
|
}
|