near-api-js 7.0.0-rc.2 → 7.0.0-rc.3

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.
@@ -0,0 +1,6 @@
1
+ import { KeyPair } from '../crypto/key_pair.js';
2
+ export declare function parseSeedPhrase(seedPhrase: string): KeyPair;
3
+ export declare function generateSeedPhrase(): {
4
+ seedPhrase: string;
5
+ keyPair: KeyPair;
6
+ };
@@ -0,0 +1,13 @@
1
+ import { generateSeedPhrase as internalGenerateSeedPhrase, parseSeedPhrase as internalParseSeedPhrase, } from 'near-seed-phrase';
2
+ import { KeyPair } from '../crypto/key_pair.js';
3
+ export function parseSeedPhrase(seedPhrase) {
4
+ const { secretKey } = internalParseSeedPhrase(seedPhrase);
5
+ return KeyPair.fromString(secretKey);
6
+ }
7
+ export function generateSeedPhrase() {
8
+ const { seedPhrase, secretKey } = internalGenerateSeedPhrase();
9
+ return {
10
+ seedPhrase,
11
+ keyPair: KeyPair.fromString(secretKey),
12
+ };
13
+ }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "near-api-js",
3
3
  "description": "JavaScript library to interact with NEAR Protocol via RPC API",
4
- "version": "7.0.0-rc.2",
4
+ "version": "7.0.0-rc.3",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "git+https://github.com/near/near-api-js.git"
@@ -32,6 +32,10 @@
32
32
  "./nep413": {
33
33
  "import": "./lib/nep413/index.js",
34
34
  "types": "./lib/nep413/index.d.ts"
35
+ },
36
+ "./seed-phrase": {
37
+ "import": "./lib/seed-phrase/index.js",
38
+ "types": "./lib/seed-phrase/index.d.ts"
35
39
  }
36
40
  },
37
41
  "dependencies": {
@@ -43,6 +47,7 @@
43
47
  "exponential-backoff": "3.1.3",
44
48
  "is-my-json-valid": "2.20.6",
45
49
  "mustache": "4.2.0",
50
+ "near-seed-phrase": "0.2.1",
46
51
  "secp256k1": "5.0.1"
47
52
  },
48
53
  "devDependencies": {