|
1 |
| -// @ts-ignore |
2 | 1 | import { TSMClient, Configuration, SessionConfig, curves } from "@sepior/tsmsdkv2";
|
3 | 2 | import web3 from '@solana/web3.js';
|
4 | 3 | import bs58 from 'bs58';
|
@@ -64,11 +63,11 @@ async function main() {
|
64 | 63 |
|
65 | 64 | const config0 = await new Configuration("https://tsm-sandbox.prd.wallet.blockdaemon.app:8080");
|
66 | 65 | await config0.withPublicKeyPinning(cert0.publicKey.export({type: "spki",format: "der"}));
|
67 |
| - await config0.withMTLSAuthentication("./client.key", "./client.crt",false, "", "", ""); |
| 66 | + await config0.withMTLSAuthentication("./client.key", "./client.crt",false, "", "", "", ""); |
68 | 67 |
|
69 | 68 | const config1 = await new Configuration("https://tsm-sandbox.prd.wallet.blockdaemon.app:8081")
|
70 | 69 | await config1.withPublicKeyPinning(cert1.publicKey.export({type: "spki",format: "der"}));
|
71 |
| - await config1.withMTLSAuthentication("./client.key", "./client.crt",false, "", "", ""); |
| 70 | + await config1.withMTLSAuthentication("./client.key", "./client.crt",false, "", "", "", ""); |
72 | 71 |
|
73 | 72 | // Create clients for two MPC nodes
|
74 | 73 | const clients: TSMClient[] = [
|
@@ -105,7 +104,7 @@ async function main() {
|
105 | 104 |
|
106 | 105 | // Convert the Ed25519 public key to Base58 Solana address
|
107 | 106 |
|
108 |
| - const compressedPublicKey = await clients[0].Utils().pkixPublicKeyToCompressedPoint(publickeys[0]); |
| 107 | + const compressedPublicKey = await clients[0].Utils().jsonPublicKeyToCompressedPoint(publickeys[0]); |
109 | 108 | const delegatorAddress = new web3.PublicKey(bs58.encode(compressedPublicKey));
|
110 | 109 | console.log(`Solana address of derived key m/44/501: ${delegatorAddress}\n`);
|
111 | 110 |
|
@@ -258,7 +257,7 @@ async function signTx(
|
258 | 257 | partialSignatures
|
259 | 258 | );
|
260 | 259 |
|
261 |
| - return signature.signature; |
| 260 | + return signature; |
262 | 261 | }
|
263 | 262 |
|
264 | 263 | async function getKeyId(
|
|
0 commit comments