@ecency/wallets 1.3.7 → 1.3.9

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.
@@ -2,3 +2,4 @@ export * from './enums';
2
2
  export * from './mutations';
3
3
  export * from './queries';
4
4
  export * from './types';
5
+ export * from './utils';
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Decrypt an encrypted memo using the recipient's private key.
3
+ * @param privateKey Private memo key in WIF format.
4
+ * @param memo Encrypted memo string.
5
+ */
6
+ export declare function decryptMemoWithKeys(privateKey: string, memo: string): string;
7
+ /**
8
+ * Decrypt a memo using account information.
9
+ * This is an alias of {@link decryptMemoWithKeys} and provided for
10
+ * API symmetry with {@link encryptMemoWithAccounts}.
11
+ */
12
+ export declare const decryptMemoWithAccounts: typeof decryptMemoWithKeys;
@@ -0,0 +1,16 @@
1
+ import { Client } from '@hiveio/dhive';
2
+ /**
3
+ * Encrypt a memo using explicit keys.
4
+ * @param privateKey Sender's private memo key in WIF format.
5
+ * @param publicKey Recipient's public memo key.
6
+ * @param memo Memo text to encrypt.
7
+ */
8
+ export declare function encryptMemoWithKeys(privateKey: string, publicKey: string, memo: string): string;
9
+ /**
10
+ * Encrypt a memo by looking up the recipient's memo key from the blockchain.
11
+ * @param client Hive client instance used to fetch account information.
12
+ * @param fromPrivateKey Sender's private memo key.
13
+ * @param toAccount Recipient account name.
14
+ * @param memo Memo text to encrypt.
15
+ */
16
+ export declare function encryptMemoWithAccounts(client: Client, fromPrivateKey: string, toAccount: string, memo: string): Promise<string>;
@@ -4,3 +4,8 @@ export * from './mnemonic-to-seed-bip-39';
4
4
  export * from './derive-hive-bip44-keys';
5
5
  export * from './derive-hive-master-password-keys';
6
6
  export * from './detect-hive-key-derivation';
7
+ export * from './sign-digest';
8
+ export * from './sign-transaction';
9
+ export * from './encrypt-memo';
10
+ export * from './decrypt-memo';
11
+ export * from './sign-external-transaction';
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Sign a digest using the provided private key.
3
+ * @param digest Digest as a Buffer or hex string.
4
+ * @param privateKey Private key in WIF format.
5
+ * @returns Hex encoded signature string.
6
+ */
7
+ export declare function signDigest(digest: Buffer | string, privateKey: string): string;
@@ -0,0 +1,18 @@
1
+ import { EcencyWalletCurrency } from '../enums';
2
+ import { SignTxParams } from '@okxweb3/coin-base';
3
+ /**
4
+ * Sign a transaction for an external chain supported by okxweb3 wallets.
5
+ *
6
+ * @param currency Chain identifier.
7
+ * @param params Signing parameters accepted by okxweb3 wallets.
8
+ */
9
+ export declare function signExternalTx(currency: EcencyWalletCurrency, params: SignTxParams): Promise<any>;
10
+ /**
11
+ * Sign and broadcast a transaction for an external chain. The transaction is
12
+ * signed locally and then sent to a public RPC endpoint for broadcasting.
13
+ *
14
+ * @param currency Chain identifier.
15
+ * @param params Signing parameters accepted by okxweb3 wallets.
16
+ * @returns RPC response or broadcasted transaction hash.
17
+ */
18
+ export declare function signExternalTxAndBroadcast(currency: EcencyWalletCurrency, params: SignTxParams): Promise<any>;
@@ -0,0 +1,23 @@
1
+ import { Client } from '@hiveio/dhive';
2
+ import { Transaction, SignedTransaction, TransactionConfirmation } from '@hiveio/dhive/lib/chain/transaction';
3
+ /**
4
+ * Sign a transaction with the given private key.
5
+ * Optionally a custom chain id can be provided.
6
+ *
7
+ * @param tx Transaction to sign.
8
+ * @param privateKey Private key in WIF format.
9
+ * @param chainId Optional chain id as a hex string.
10
+ * @returns Signed transaction including the signature.
11
+ */
12
+ export declare function signTx(tx: Transaction, privateKey: string, chainId?: string): SignedTransaction;
13
+ /**
14
+ * Sign a transaction and broadcast it to the network.
15
+ * Optionally a custom chain id can be provided.
16
+ *
17
+ * @param client Hive client instance used for broadcasting.
18
+ * @param tx Transaction to sign.
19
+ * @param privateKey Private key in WIF format.
20
+ * @param chainId Optional chain id as a hex string.
21
+ * @returns Broadcast confirmation.
22
+ */
23
+ export declare function signTxAndBroadcast(client: Client, tx: Transaction, privateKey: string, chainId?: string): Promise<TransactionConfirmation>;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ecency/wallets",
3
3
  "private": false,
4
- "version": "1.3.7",
4
+ "version": "1.3.9",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "main": "./dist/ecency-sdk.umd.js",