@dimcool/wallet 0.1.6 → 0.1.8
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,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
|
|
30
|
+
// src/generate-keypair.ts
|
|
31
|
+
var generate_keypair_exports = {};
|
|
32
|
+
__export(generate_keypair_exports, {
|
|
33
|
+
generateSolanaKeypairBase58: () => generateSolanaKeypairBase58
|
|
34
|
+
});
|
|
35
|
+
module.exports = __toCommonJS(generate_keypair_exports);
|
|
36
|
+
var import_web3 = require("@solana/web3.js");
|
|
37
|
+
var import_bs58 = __toESM(require("bs58"), 1);
|
|
38
|
+
function generateSolanaKeypairBase58() {
|
|
39
|
+
const keypair = import_web3.Keypair.generate();
|
|
40
|
+
return {
|
|
41
|
+
walletAddress: keypair.publicKey.toBase58(),
|
|
42
|
+
walletPrivateKey: import_bs58.default.encode(keypair.secretKey)
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
46
|
+
0 && (module.exports = {
|
|
47
|
+
generateSolanaKeypairBase58
|
|
48
|
+
});
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Standalone keypair generation for CLIs and bootstrap flows.
|
|
3
|
+
* No SDK or Wallet dependency — safe to use from Node ESM scripts.
|
|
4
|
+
*/
|
|
5
|
+
declare function generateSolanaKeypairBase58(): {
|
|
6
|
+
walletAddress: string;
|
|
7
|
+
walletPrivateKey: string;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export { generateSolanaKeypairBase58 };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Standalone keypair generation for CLIs and bootstrap flows.
|
|
3
|
+
* No SDK or Wallet dependency — safe to use from Node ESM scripts.
|
|
4
|
+
*/
|
|
5
|
+
declare function generateSolanaKeypairBase58(): {
|
|
6
|
+
walletAddress: string;
|
|
7
|
+
walletPrivateKey: string;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export { generateSolanaKeypairBase58 };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// src/generate-keypair.ts
|
|
2
|
+
import { Keypair } from "@solana/web3.js";
|
|
3
|
+
import bs58 from "bs58";
|
|
4
|
+
function generateSolanaKeypairBase58() {
|
|
5
|
+
const keypair = Keypair.generate();
|
|
6
|
+
return {
|
|
7
|
+
walletAddress: keypair.publicKey.toBase58(),
|
|
8
|
+
walletPrivateKey: bs58.encode(keypair.secretKey)
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
export {
|
|
12
|
+
generateSolanaKeypairBase58
|
|
13
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dimcool/wallet",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.8",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.cjs",
|
|
6
6
|
"module": "./dist/index.js",
|
|
@@ -10,6 +10,11 @@
|
|
|
10
10
|
"types": "./dist/index.d.ts",
|
|
11
11
|
"import": "./dist/index.js",
|
|
12
12
|
"require": "./dist/index.cjs"
|
|
13
|
+
},
|
|
14
|
+
"./generate-keypair": {
|
|
15
|
+
"types": "./dist/generate-keypair.d.ts",
|
|
16
|
+
"import": "./dist/generate-keypair.js",
|
|
17
|
+
"require": "./dist/generate-keypair.cjs"
|
|
13
18
|
}
|
|
14
19
|
},
|
|
15
20
|
"files": [
|
|
@@ -24,7 +29,7 @@
|
|
|
24
29
|
"dev": "tsc --watch"
|
|
25
30
|
},
|
|
26
31
|
"dependencies": {
|
|
27
|
-
"@dimcool/sdk": "^0.1.
|
|
32
|
+
"@dimcool/sdk": "^0.1.7",
|
|
28
33
|
"@solana/web3.js": "^1.95.4",
|
|
29
34
|
"bip39": "^3.1.0",
|
|
30
35
|
"bs58": "^6.0.0",
|