You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/cjs/ecpair.cjs
+11Lines changed: 11 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -115,6 +115,17 @@ function ECPairFactory(ecc) {
115
115
network: network,
116
116
});
117
117
}
118
+
/**
119
+
* Generates a random ECPairInterface.
120
+
*
121
+
* Uses `crypto.getRandomValues` under the hood for options.rng function, which is still an experimental feature as of Node.js 18.19.0. To work around this you can do one of the following:
122
+
* 1. Use a polyfill for crypto.getRandomValues()
123
+
* 2. Use the `--experimental-global-webcrypto` flag when running node.js.
124
+
* 3. Pass in a custom rng function to generate random values.
125
+
*
126
+
* @param {ECPairOptions} options - Options for the ECPairInterface.
127
+
* @return {ECPairInterface} A random ECPairInterface.
Copy file name to clipboardExpand all lines: src/esm/ecpair.js
+14-3Lines changed: 14 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
-
import*asnetworksfrom'./networks';
2
-
import*astypesfrom'./types';
1
+
import*asnetworksfrom'./networks.js';
2
+
import*astypesfrom'./types.js';
3
3
import*aswiffrom'wif';
4
-
import{testEcc}from'./testecc';
4
+
import{testEcc}from'./testecc.js';
5
5
export{networks};
6
6
import*asvfrom'valibot';
7
7
import*astoolsfrom'uint8array-tools';
@@ -67,6 +67,17 @@ export function ECPairFactory(ecc) {
67
67
network: network,
68
68
});
69
69
}
70
+
/**
71
+
* Generates a random ECPairInterface.
72
+
*
73
+
* Uses `crypto.getRandomValues` under the hood for options.rng function, which is still an experimental feature as of Node.js 18.19.0. To work around this you can do one of the following:
74
+
* 1. Use a polyfill for crypto.getRandomValues()
75
+
* 2. Use the `--experimental-global-webcrypto` flag when running node.js.
76
+
* 3. Pass in a custom rng function to generate random values.
77
+
*
78
+
* @param {ECPairOptions} options - Options for the ECPairInterface.
79
+
* @return {ECPairInterface} A random ECPairInterface.
Copy file name to clipboardExpand all lines: ts_src/ecpair.ts
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -157,7 +157,7 @@ export function ECPairFactory(ecc: TinySecp256k1Interface): ECPairAPI {
157
157
158
158
/**
159
159
* Generates a random ECPairInterface.
160
-
*
160
+
*
161
161
* Uses `crypto.getRandomValues` under the hood for options.rng function, which is still an experimental feature as of Node.js 18.19.0. To work around this you can do one of the following:
162
162
* 1. Use a polyfill for crypto.getRandomValues()
163
163
* 2. Use the `--experimental-global-webcrypto` flag when running node.js.
0 commit comments