@ecency/sdk 1.0.17 → 1.0.19

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.
Files changed (65) hide show
  1. package/dist/config.d.ts +8 -0
  2. package/dist/ecency-sdk.es.js +173 -112
  3. package/dist/index.d.ts +3 -0
  4. package/dist/modules/accounts/index.d.ts +1 -0
  5. package/dist/modules/accounts/mutations/index.d.ts +1 -0
  6. package/dist/modules/accounts/mutations/use-account-update.d.ts +1 -0
  7. package/dist/modules/accounts/queries/get-account-full-query-options.d.ts +353 -0
  8. package/dist/modules/accounts/queries/index.d.ts +1 -0
  9. package/dist/modules/accounts/queries/search-accounts-by-username-query-options.d.ts +8 -0
  10. package/dist/modules/accounts/types/account-follow-stats.d.ts +5 -0
  11. package/dist/modules/accounts/types/account-reputation.d.ts +4 -0
  12. package/dist/modules/accounts/types/index.d.ts +2 -0
  13. package/dist/modules/core/entities/index.d.ts +1 -0
  14. package/dist/modules/core/entities/user.d.ts +8 -0
  15. package/dist/modules/core/index.d.ts +3 -0
  16. package/dist/modules/core/mutations/index.d.ts +1 -0
  17. package/dist/modules/core/mutations/use-broadcast-mutation.d.ts +3 -0
  18. package/dist/modules/core/queries-manager.d.ts +21 -0
  19. package/dist/modules/core/storage.d.ts +5 -0
  20. package/dist/modules/core/utils/decoder-encoder.d.ts +2 -0
  21. package/dist/modules/core/utils/index.d.ts +1 -0
  22. package/dist/modules/hive-engine/index.d.ts +1 -0
  23. package/dist/modules/hive-engine/queries/index.d.ts +1 -0
  24. package/dist/modules/hive-engine/queries/use-get-hive-engine-tokens-list-query-options.d.ts +8 -0
  25. package/dist/modules/hive-engine/types/hive-engine-list-response.d.ts +18 -0
  26. package/dist/modules/hive-engine/types/index.d.ts +1 -0
  27. package/dist/modules/keychain/index.d.ts +2 -0
  28. package/dist/modules/keychain/keychain.d.ts +9 -0
  29. package/dist/modules/operations/index.d.ts +1 -0
  30. package/dist/modules/operations/mutations/index.d.ts +3 -0
  31. package/dist/modules/operations/mutations/sign-operation-by-hivesigner.d.ts +4 -0
  32. package/dist/modules/operations/mutations/sign-operation-by-key.d.ts +5 -0
  33. package/dist/modules/operations/mutations/sign-operation-by-keychain.d.ts +5 -0
  34. package/dist/modules/wallets/enums/ecency-wallet-basic-tokens.d.ts +8 -0
  35. package/dist/modules/wallets/enums/ecency-wallet-currency.d.ts +9 -0
  36. package/dist/modules/wallets/enums/index.d.ts +2 -0
  37. package/dist/modules/wallets/functions/get-keys-from-seed.d.ts +3 -0
  38. package/dist/modules/wallets/functions/index.d.ts +1 -0
  39. package/dist/modules/wallets/index.d.ts +5 -0
  40. package/dist/modules/wallets/mutations/index.d.ts +4 -0
  41. package/dist/modules/wallets/mutations/private-api/check-wallet-existence.d.ts +7 -0
  42. package/dist/modules/wallets/mutations/private-api/create-account-with-wallets.d.ts +7 -0
  43. package/dist/modules/wallets/mutations/private-api/index.d.ts +2 -0
  44. package/dist/modules/wallets/mutations/private-api-namespace.d.ts +2 -0
  45. package/dist/modules/wallets/mutations/save-wallet-information-to-metadata.d.ts +5 -0
  46. package/dist/modules/wallets/mutations/use-import-wallet.d.ts +10 -0
  47. package/dist/modules/wallets/mutations/use-wallet-create.d.ts +6 -0
  48. package/dist/modules/wallets/queries/get-account-points-query-options.d.ts +9 -0
  49. package/dist/modules/wallets/queries/index.d.ts +6 -0
  50. package/dist/modules/wallets/queries/use-coingecko-price-query.d.ts +2 -0
  51. package/dist/modules/wallets/queries/use-get-account-wallet-list-query.d.ts +2 -0
  52. package/dist/modules/wallets/queries/use-get-all-tokens-list-query.d.ts +2 -0
  53. package/dist/modules/wallets/queries/use-get-external-wallet-query.d.ts +10 -0
  54. package/dist/modules/wallets/queries/use-hive-keys-query.d.ts +2 -0
  55. package/dist/modules/wallets/queries/use-seed-phrase.d.ts +1 -0
  56. package/dist/modules/wallets/types/account-points-response.d.ts +4 -0
  57. package/dist/modules/wallets/types/ecency-create-wallet-information.d.ts +9 -0
  58. package/dist/modules/wallets/types/ecency-hive-keys.d.ts +12 -0
  59. package/dist/modules/wallets/types/index.d.ts +3 -0
  60. package/dist/modules/wallets/utils/delay.d.ts +1 -0
  61. package/dist/modules/wallets/utils/get-wallet.d.ts +3 -0
  62. package/dist/modules/wallets/utils/index.d.ts +3 -0
  63. package/dist/modules/wallets/utils/mnemonic-to-seed-bip-39.d.ts +1 -0
  64. package/package.json +5 -5
  65. package/dist/ecency-sdk.es.d.ts +0 -136
@@ -0,0 +1,2 @@
1
+ import * as EcencyWalletsPrivateApi from "./private-api";
2
+ export { EcencyWalletsPrivateApi };
@@ -0,0 +1,5 @@
1
+ import { EcencyWalletCurrency } from '../enums';
2
+ import { EcencyCreateWalletInformation } from '../types';
3
+ export declare function useSaveWalletInformationToMetadata(username: string): import('@tanstack/react-query').UseMutationResult<any, Error, {
4
+ wallets: Map<EcencyWalletCurrency, EcencyCreateWalletInformation>;
5
+ }, unknown>;
@@ -0,0 +1,10 @@
1
+ import { EcencyWalletCurrency } from '../enums';
2
+ interface Payload {
3
+ privateKeyOrSeed: string;
4
+ }
5
+ export declare function useImportWallet(username: string, currency: EcencyWalletCurrency): import('@tanstack/react-query').UseMutationResult<{
6
+ privateKey: string;
7
+ address: any;
8
+ publicKey: string;
9
+ }, Error, Payload, unknown>;
10
+ export {};
@@ -0,0 +1,6 @@
1
+ import { EcencyCreateWalletInformation } from '../types';
2
+ import { EcencyWalletCurrency } from '../enums';
3
+ export declare function useWalletCreate(username: string, currency: EcencyWalletCurrency): {
4
+ createWallet: import('@tanstack/react-query').UseMutationResult<EcencyCreateWalletInformation, Error, void, unknown>;
5
+ importWallet: () => void;
6
+ };
@@ -0,0 +1,9 @@
1
+ import { AccountPointsResponse } from '../types';
2
+ export declare function getAccountPointsQueryOptions(username?: string, filter?: string): import('@tanstack/query-core').OmitKeyof<import('@tanstack/react-query').UseQueryOptions<AccountPointsResponse, Error, AccountPointsResponse, (string | undefined)[]>, "queryFn"> & {
3
+ queryFn?: import('@tanstack/query-core').QueryFunction<AccountPointsResponse, (string | undefined)[], never> | undefined;
4
+ } & {
5
+ queryKey: (string | undefined)[] & {
6
+ [dataTagSymbol]: AccountPointsResponse;
7
+ [dataTagErrorSymbol]: Error;
8
+ };
9
+ };
@@ -0,0 +1,6 @@
1
+ export * from './use-get-external-wallet-query';
2
+ export * from './use-seed-phrase';
3
+ export * from './use-coingecko-price-query';
4
+ export * from './use-hive-keys-query';
5
+ export * from './get-account-points-query-options';
6
+ export * from './use-get-all-tokens-list-query';
@@ -0,0 +1,2 @@
1
+ import { EcencyWalletCurrency } from '../enums';
2
+ export declare function useCoinGeckoPriceQuery(currency?: EcencyWalletCurrency): import('@tanstack/react-query').UseQueryResult<number, Error>;
@@ -0,0 +1,2 @@
1
+ import { EcencyWalletBasicTokens } from '../enums';
2
+ export declare function useGetAccountWalletListQuery(username: string): import('@tanstack/react-query').UseQueryResult<EcencyWalletBasicTokens[], Error>;
@@ -0,0 +1,2 @@
1
+ import { EcencyWalletBasicTokens } from '../enums';
2
+ export declare function useGetAllTokensListQuery(): () => (string | EcencyWalletBasicTokens)[];
@@ -0,0 +1,10 @@
1
+ import { EcencyWalletCurrency } from '../enums';
2
+ /**
3
+ * Returns information about the actual balance of the given currency address
4
+ * using various of public APIs
5
+ * todo extract URLs to configs
6
+ * @param currency
7
+ * @param address
8
+ * @returns
9
+ */
10
+ export declare function useGetExternalWalletBalanceQuery(currency: EcencyWalletCurrency, address: string): import('@tanstack/react-query').UseQueryResult<number, Error>;
@@ -0,0 +1,2 @@
1
+ import { EcencyHiveKeys } from '../types';
2
+ export declare function useHiveKeysQuery(username: string): import('@tanstack/react-query').UseQueryResult<EcencyHiveKeys, Error>;
@@ -0,0 +1 @@
1
+ export declare function useSeedPhrase(username: string): import('@tanstack/react-query').UseQueryResult<string, Error>;
@@ -0,0 +1,4 @@
1
+ export interface AccountPointsResponse {
2
+ points: string;
3
+ unclaimed_points: string;
4
+ }
@@ -0,0 +1,9 @@
1
+ import { EcencyWalletCurrency } from '../enums';
2
+ export interface EcencyCreateWalletInformation {
3
+ address: string;
4
+ privateKey: string;
5
+ publicKey: string;
6
+ username: string;
7
+ currency: EcencyWalletCurrency;
8
+ custom?: boolean;
9
+ }
@@ -0,0 +1,12 @@
1
+ export interface EcencyHiveKeys {
2
+ username: string;
3
+ owner: string;
4
+ active: string;
5
+ posting: string;
6
+ memo: string;
7
+ masterPassword: string;
8
+ ownerPubkey: string;
9
+ activePubkey: string;
10
+ postingPubkey: string;
11
+ memoPubkey: string;
12
+ }
@@ -0,0 +1,3 @@
1
+ export * from './ecency-create-wallet-information';
2
+ export * from './ecency-hive-keys';
3
+ export * from './account-points-response';
@@ -0,0 +1 @@
1
+ export declare function delay(ms: number): Promise<unknown>;
@@ -0,0 +1,3 @@
1
+ import { BaseWallet } from '@okxweb3/coin-base';
2
+ import { EcencyWalletCurrency } from '../enums';
3
+ export declare function getWallet(currency: EcencyWalletCurrency): BaseWallet | undefined;
@@ -0,0 +1,3 @@
1
+ export * from './delay';
2
+ export * from './get-wallet';
3
+ export * from './mnemonic-to-seed-bip-39';
@@ -0,0 +1 @@
1
+ export declare function mnemonicToSeedBip39(value: string): string;
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@ecency/sdk",
3
3
  "private": false,
4
- "version": "1.0.17",
4
+ "version": "1.0.19",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "main": "./dist/ecency-sdk.umd.js",
8
8
  "module": "./dist/ecency-sdk.es.js",
9
- "typings": "./dist/ecency-sdk.es.d.ts",
9
+ "typings": "./dist/index.d.ts",
10
10
  "files": [
11
11
  "dist",
12
12
  "README.md"
@@ -18,7 +18,7 @@
18
18
  },
19
19
  "devDependencies": {
20
20
  "@hiveio/dhive": "^1.3.2",
21
- "@tanstack/react-query": "^5.66.11",
21
+ "@tanstack/react-query": "^5.74.4",
22
22
  "@types/node": "^22.13.8",
23
23
  "@types/react": "^19.0.10",
24
24
  "@vitejs/plugin-react": "^4.3.4",
@@ -26,9 +26,9 @@
26
26
  "lru-cache": "^11.0.2",
27
27
  "prettier": "^3.5.2",
28
28
  "react": "^19.0.0",
29
- "typescript": "~5.7.2",
29
+ "typescript": "5.8.3",
30
30
  "vite": "^6.2.0",
31
- "vite-plugin-dts": "^4.5.1",
31
+ "vite-plugin-dts": "4.5.3",
32
32
  "vite-plugin-node-polyfills": "^0.23.0"
33
33
  },
34
34
  "dependencies": {
@@ -1,136 +0,0 @@
1
- import { BaseWallet } from '@okxweb3/coin-base';
2
- import { Operation } from '@hiveio/dhive';
3
- import { TransactionConfirmation } from '@hiveio/dhive';
4
- import { UseMutationResult } from '@tanstack/react-query';
5
- import { UseQueryResult } from '@tanstack/react-query';
6
-
7
- declare const broadcast: (account: string, operations: Operation[], key: KeychainAuthorityTypes, rpc?: string | null) => Promise<TxResponse>;
8
-
9
- export declare function delay(ms: number): Promise<unknown>;
10
-
11
- export declare interface EcencyCreateWalletInformation {
12
- address: string;
13
- privateKey: string;
14
- publicKey: string;
15
- username: string;
16
- currency: EcencyWalletCurrency;
17
- custom?: boolean;
18
- }
19
-
20
- export declare interface EcencyHiveKeys {
21
- username: string;
22
- owner: string;
23
- active: string;
24
- posting: string;
25
- memo: string;
26
- masterPassword: string;
27
- ownerPubkey: string;
28
- activePubkey: string;
29
- postingPubkey: string;
30
- memoPubkey: string;
31
- }
32
-
33
- export declare enum EcencyWalletCurrency {
34
- BTC = "BTC",
35
- ETH = "ETH",
36
- APT = "APT",
37
- ATOM = "ATOM",
38
- TON = "TON",
39
- TRON = "TRX",
40
- SOL = "SOL"
41
- }
42
-
43
- declare namespace EcencyWalletsPrivateApi {
44
- export {
45
- useCreateAccountWithWallets,
46
- useCheckWalletExistence
47
- }
48
- }
49
- export { EcencyWalletsPrivateApi }
50
-
51
- export declare function getWallet(currency: EcencyWalletCurrency): BaseWallet | undefined;
52
-
53
- declare function handshake(): Promise<void>;
54
-
55
- declare namespace Keychain {
56
- export {
57
- handshake,
58
- KeychainAuthorityTypes,
59
- broadcast
60
- }
61
- }
62
-
63
- declare type KeychainAuthorityTypes = "Owner" | "Active" | "Posting" | "Memo";
64
-
65
- export declare function mnemonicToSeedBip39(value: string): string;
66
-
67
- declare interface Payload {
68
- currency: EcencyWalletCurrency;
69
- address: string;
70
- }
71
-
72
- declare interface Payload_2 {
73
- address: string;
74
- currency: EcencyWalletCurrency;
75
- }
76
-
77
- declare interface Payload_3 {
78
- privateKeyOrSeed: string;
79
- }
80
-
81
- declare interface TxResponse {
82
- success: boolean;
83
- result: string;
84
- }
85
-
86
- export declare function useAccountUpdate(username: string): UseMutationResult<any, Error, any, unknown>;
87
-
88
- declare function useCheckWalletExistence(): UseMutationResult<boolean, Error, Payload_2, unknown>;
89
-
90
- export declare function useCoinGeckoPriceQuery(currency?: EcencyWalletCurrency): UseQueryResult<number, Error>;
91
-
92
- declare function useCreateAccountWithWallets(username: string): UseMutationResult<Response, Error, Payload, unknown>;
93
-
94
- /**
95
- * Returns information about the actual balance of the given currency address
96
- * using various of public APIs
97
- * todo extract URLs to configs
98
- * @param currency
99
- * @param address
100
- * @returns
101
- */
102
- export declare function useGetExternalWalletBalanceQuery(currency: EcencyWalletCurrency, address: string): UseQueryResult<number, Error>;
103
-
104
- export declare function useHiveKeysQuery(username: string): UseQueryResult<EcencyHiveKeys, Error>;
105
-
106
- export declare function useImportWallet(username: string, currency: EcencyWalletCurrency): UseMutationResult< {
107
- privateKey: string;
108
- address: any;
109
- publicKey: string;
110
- }, Error, Payload_3, unknown>;
111
-
112
- export declare function useSaveWalletInformationToMetadata(username: string): UseMutationResult<any, Error, {
113
- wallets: Map<EcencyWalletCurrency, EcencyCreateWalletInformation>;
114
- }, unknown>;
115
-
116
- export declare function useSeedPhrase(username: string): UseQueryResult<string, Error>;
117
-
118
- export declare function useSignOperationByHivesigner(callbackUri?: string): UseMutationResult<string | void, Error, {
119
- operation: Operation;
120
- }, unknown>;
121
-
122
- export declare function useSignOperationByKey(username: string | undefined): UseMutationResult<TransactionConfirmation, Error, {
123
- operation: Operation;
124
- keyOrSeed: string;
125
- }, unknown>;
126
-
127
- export declare function useSignOperationByKeychain(username: string | undefined, keyType?: Keychain.KeychainAuthorityTypes): UseMutationResult<any, Error, {
128
- operation: Operation;
129
- }, unknown>;
130
-
131
- export declare function useWalletCreate(username: string, currency: EcencyWalletCurrency): {
132
- createWallet: UseMutationResult<EcencyCreateWalletInformation, Error, void, unknown>;
133
- importWallet: () => void;
134
- };
135
-
136
- export { }