mmn-client-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/dist/index.d.ts +22 -15
- package/dist/index.esm.js +7606 -40
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +7666 -119
- package/dist/index.js.map +1 -1
- package/package.json +3 -1
package/dist/index.d.ts
CHANGED
|
@@ -57,6 +57,19 @@ interface SignedTx {
|
|
|
57
57
|
tx_msg: TxMsg;
|
|
58
58
|
signature: string;
|
|
59
59
|
}
|
|
60
|
+
interface SendTransactionRequest {
|
|
61
|
+
sender: string;
|
|
62
|
+
recipient: string;
|
|
63
|
+
amount: string;
|
|
64
|
+
nonce: number;
|
|
65
|
+
timestamp?: number;
|
|
66
|
+
textData?: string;
|
|
67
|
+
extraInfo?: ExtraInfo;
|
|
68
|
+
publicKey: string;
|
|
69
|
+
privateKey: string;
|
|
70
|
+
zkProof: string;
|
|
71
|
+
zkPub: string;
|
|
72
|
+
}
|
|
60
73
|
interface AddTxResponse {
|
|
61
74
|
ok: boolean;
|
|
62
75
|
tx_hash: string;
|
|
@@ -163,7 +176,7 @@ declare class IndexerClient {
|
|
|
163
176
|
constructor(config: IndexerClientConfig);
|
|
164
177
|
private makeRequest;
|
|
165
178
|
getTransactionByHash(hash: string): Promise<Transaction>;
|
|
166
|
-
getTransactionByWallet(wallet: string, page: number | undefined, limit: number | undefined, filter: number): Promise<ListTransactionResponse>;
|
|
179
|
+
getTransactionByWallet(wallet: string, page: number | undefined, limit: number | undefined, filter: number, sortBy?: string, sortOrder?: 'asc' | 'desc'): Promise<ListTransactionResponse>;
|
|
167
180
|
getWalletDetail(wallet: string): Promise<WalletDetail>;
|
|
168
181
|
}
|
|
169
182
|
|
|
@@ -181,8 +194,14 @@ declare class MmnClient {
|
|
|
181
194
|
*/
|
|
182
195
|
private rawEd25519ToPkcs8Hex;
|
|
183
196
|
private encodeLength;
|
|
197
|
+
/**
|
|
198
|
+
* Generate secure entropy using multiple sources for maximum compatibility
|
|
199
|
+
* @returns Array of 32 random bytes
|
|
200
|
+
*/
|
|
201
|
+
private generateSecureEntropy;
|
|
184
202
|
/**
|
|
185
203
|
* Securely generate ephemeral key pair with proper entropy
|
|
204
|
+
* React Native compatible version with multiple fallbacks
|
|
186
205
|
* @returns Ephemeral key pair with private and public keys
|
|
187
206
|
* @throws Error if key generation fails
|
|
188
207
|
*/
|
|
@@ -211,19 +230,7 @@ declare class MmnClient {
|
|
|
211
230
|
/**
|
|
212
231
|
* Send a transaction (create, sign, and submit)
|
|
213
232
|
*/
|
|
214
|
-
sendTransaction(params:
|
|
215
|
-
sender: string;
|
|
216
|
-
recipient: string;
|
|
217
|
-
amount: string;
|
|
218
|
-
nonce: number;
|
|
219
|
-
timestamp?: number;
|
|
220
|
-
textData?: string;
|
|
221
|
-
extraInfo?: ExtraInfo;
|
|
222
|
-
publicKey: string;
|
|
223
|
-
privateKey: string;
|
|
224
|
-
zkProof: string;
|
|
225
|
-
zkPub: string;
|
|
226
|
-
}): Promise<AddTxResponse>;
|
|
233
|
+
sendTransaction(params: SendTransactionRequest): Promise<AddTxResponse>;
|
|
227
234
|
/**
|
|
228
235
|
* Get current nonce for an account
|
|
229
236
|
*/
|
|
@@ -247,4 +254,4 @@ declare class ZkClient {
|
|
|
247
254
|
}
|
|
248
255
|
|
|
249
256
|
export { ETransferType, IndexerClient, MmnClient, ZkClient, createMmnClient };
|
|
250
|
-
export type { AddTxResponse, ExtraInfo, GetAccountByAddressResponse, GetCurrentNonceResponse, IEphemeralKeyPair, IZkProof, IndexerClientConfig, JsonRpcError, JsonRpcRequest, JsonRpcResponse, ListTransactionResponse, Meta, MmnClientConfig, SignedTx, Transaction, TransactionDetailResponse, TxMsg, WalletDetail, WalletDetailResponse, ZkClientConfig };
|
|
257
|
+
export type { AddTxResponse, ExtraInfo, GetAccountByAddressResponse, GetCurrentNonceResponse, IEphemeralKeyPair, IZkProof, IndexerClientConfig, JsonRpcError, JsonRpcRequest, JsonRpcResponse, ListTransactionResponse, Meta, MmnClientConfig, SendTransactionRequest, SignedTx, Transaction, TransactionDetailResponse, TxMsg, WalletDetail, WalletDetailResponse, ZkClientConfig };
|