@bench.games/conviction-markets 0.1.0 → 0.1.1
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/utils/keypairs.d.ts
CHANGED
|
@@ -17,4 +17,10 @@ export declare function generateSolanaKeypair(): Keypair;
|
|
|
17
17
|
* @returns A new X25519Keypair with publicKey and secretKey
|
|
18
18
|
*/
|
|
19
19
|
export declare function generateX25519Keypair(): X25519Keypair;
|
|
20
|
+
/**
|
|
21
|
+
* Derives an X25519 keypair deterministically from a signature
|
|
22
|
+
* @param signature - Signature bytes to derive the keypair from
|
|
23
|
+
* @returns A deterministic X25519Keypair derived from the signature
|
|
24
|
+
*/
|
|
25
|
+
export declare function deriveX25519KeypairFromSignature(signature: Uint8Array): X25519Keypair;
|
|
20
26
|
//# sourceMappingURL=keypairs.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keypairs.d.ts","sourceRoot":"","sources":["../../src/utils/keypairs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAE1C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"keypairs.d.ts","sourceRoot":"","sources":["../../src/utils/keypairs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAE1C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAG9C;;;;;;GAMG;AACH,wBAAgB,qBAAqB,IAAI,OAAO,CAE/C;AAED;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,IAAI,aAAa,CAQrD;AAED;;;;GAIG;AACH,wBAAgB,gCAAgC,CAC9C,SAAS,EAAE,UAAU,GACpB,aAAa,CAIf"}
|
package/dist/utils/keypairs.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Keypair } from "@solana/web3.js";
|
|
2
2
|
import { x25519 } from "@arcium-hq/client";
|
|
3
|
+
import { createHash } from "crypto";
|
|
3
4
|
/**
|
|
4
5
|
* Generates a new Solana keypair
|
|
5
6
|
*
|
|
@@ -26,4 +27,14 @@ export function generateX25519Keypair() {
|
|
|
26
27
|
secretKey,
|
|
27
28
|
};
|
|
28
29
|
}
|
|
30
|
+
/**
|
|
31
|
+
* Derives an X25519 keypair deterministically from a signature
|
|
32
|
+
* @param signature - Signature bytes to derive the keypair from
|
|
33
|
+
* @returns A deterministic X25519Keypair derived from the signature
|
|
34
|
+
*/
|
|
35
|
+
export function deriveX25519KeypairFromSignature(signature) {
|
|
36
|
+
const secretKey = new Uint8Array(createHash("sha256").update(signature).digest());
|
|
37
|
+
const publicKey = x25519.getPublicKey(secretKey);
|
|
38
|
+
return { secretKey, publicKey };
|
|
39
|
+
}
|
|
29
40
|
//# sourceMappingURL=keypairs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keypairs.js","sourceRoot":"","sources":["../../src/utils/keypairs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"keypairs.js","sourceRoot":"","sources":["../../src/utils/keypairs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAE3C,OAAO,EAAe,UAAU,EAAE,MAAM,QAAQ,CAAC;AAEjD;;;;;;GAMG;AACH,MAAM,UAAU,qBAAqB;IACnC,OAAO,OAAO,CAAC,QAAQ,EAAE,CAAC;AAC5B,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,qBAAqB;IACnC,MAAM,SAAS,GAAG,MAAM,CAAC,KAAK,CAAC,gBAAgB,EAAE,CAAC;IAClD,MAAM,SAAS,GAAG,MAAM,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC;IAEjD,OAAO;QACL,SAAS;QACT,SAAS;KACV,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,gCAAgC,CAC9C,SAAqB;IAErB,MAAM,SAAS,GAAG,IAAI,UAAU,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC;IAClF,MAAM,SAAS,GAAG,MAAM,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC;IACjD,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,CAAC;AAClC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bench.games/conviction-markets",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"
|
|
5
|
-
"type": "module",
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"author": "Bench",
|
|
6
5
|
"main": "./dist/index.js",
|
|
7
|
-
"
|
|
6
|
+
"devDependencies": {
|
|
7
|
+
"@types/bun": "latest",
|
|
8
|
+
"typescript": "^5.3.0"
|
|
9
|
+
},
|
|
10
|
+
"peerDependencies": {
|
|
11
|
+
"@arcium-hq/client": "^0.6.0",
|
|
12
|
+
"@coral-xyz/anchor": "^0.30.0",
|
|
13
|
+
"@solana/web3.js": "^1.87.0"
|
|
14
|
+
},
|
|
8
15
|
"exports": {
|
|
9
16
|
".": {
|
|
10
17
|
"import": "./dist/index.js",
|
|
11
18
|
"types": "./dist/index.d.ts"
|
|
12
19
|
}
|
|
13
20
|
},
|
|
21
|
+
"description": "TypeScript SDK for Solana Conviction Markets with encrypted votes using Arcium MPC",
|
|
14
22
|
"files": [
|
|
15
23
|
"dist",
|
|
16
24
|
"README.md"
|
|
17
25
|
],
|
|
18
|
-
"publishConfig": {
|
|
19
|
-
"access": "public"
|
|
20
|
-
},
|
|
21
|
-
"scripts": {
|
|
22
|
-
"build": "tsc",
|
|
23
|
-
"prepublishOnly": "bun run build",
|
|
24
|
-
"type-check": "tsc --noEmit"
|
|
25
|
-
},
|
|
26
26
|
"keywords": [
|
|
27
27
|
"solana",
|
|
28
28
|
"conviction-voting",
|
|
@@ -31,15 +31,15 @@
|
|
|
31
31
|
"arcium",
|
|
32
32
|
"encrypted-voting"
|
|
33
33
|
],
|
|
34
|
-
"author": "Bench",
|
|
35
34
|
"license": "MIT",
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
"@coral-xyz/anchor": "^0.30.0",
|
|
39
|
-
"@solana/web3.js": "^1.87.0"
|
|
35
|
+
"publishConfig": {
|
|
36
|
+
"access": "public"
|
|
40
37
|
},
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
|
|
38
|
+
"scripts": {
|
|
39
|
+
"build": "tsc",
|
|
40
|
+
"prepublishOnly": "bun run build",
|
|
41
|
+
"type-check": "tsc --noEmit"
|
|
42
|
+
},
|
|
43
|
+
"type": "module",
|
|
44
|
+
"types": "./dist/index.d.ts"
|
|
45
45
|
}
|