|
8 | 8 | BlockfrostServerError, |
9 | 9 | } from "@blockfrost/blockfrost-js"; |
10 | 10 | import { InvalidIntegration } from "../errors/integrations"; |
11 | | -import { PeerType, TransactionOperation } from "fireblocks-sdk"; |
12 | 11 |
|
13 | 12 | const CARDANO_PARAMS = { |
14 | 13 | COINS_PER_UTXO_WORD: '34482', |
@@ -102,24 +101,17 @@ export class AdaService extends Service { |
102 | 101 | } |
103 | 102 | }; |
104 | 103 |
|
105 | | - const tx = await this.fbSigner.signWithFB(payload, 'ADA_TEST'); |
106 | | - const sigBuffer = Buffer.from(tx.signedMessages![0].signature.fullSig, 'hex'); |
107 | | - console.log(tx.signedMessages); |
108 | | - // // transaction.set_is_valid(true); |
109 | | - // |
110 | | - // const txHash = CardanoWasm.hash_transaction(transaction.body()); |
111 | | - // const witnesses = CardanoWasm.TransactionWitnessSet.new(); |
112 | | - // const vkeyWitnesses = CardanoWasm.Vkeywitnesses.new(); |
113 | | - // const MNEMONIC = 'word 1 word 2'; |
114 | | - // const bip32PrvKey = this.mnemonicToPrivateKey(MNEMONIC); |
115 | | - // const { signKey } = this.deriveAddressPrvKey(bip32PrvKey, this.testnet); |
116 | | - // vkeyWitnesses.add(CardanoWasm.make_vkey_witness(txHash, signKey)); |
117 | | - // witnesses.set_vkeys(vkeyWitnesses); |
118 | | - // console.log(witnesses); |
119 | | - // const tx = CardanoWasm.Transaction.new(transaction.body(), witnesses); |
120 | | - |
121 | | - return transaction; |
122 | | - |
| 104 | + const fbTx = await this.fbSigner.signWithFB(payload, 'ADA_TEST'); |
| 105 | + |
| 106 | + const pubKey = CardanoWasm.PublicKey.from_hex(fbTx.signedMessages![0].publicKey); |
| 107 | + const vKey = CardanoWasm.Vkey.new(pubKey); |
| 108 | + const signature = CardanoWasm.Ed25519Signature.from_hex(fbTx.signedMessages![0].signature.fullSig); |
| 109 | + const witnesses = CardanoWasm.TransactionWitnessSet.new(); |
| 110 | + const vkeyWitnesses = CardanoWasm.Vkeywitnesses.new(); |
| 111 | + const vkeyWitness = CardanoWasm.Vkeywitness.new(vKey, signature); |
| 112 | + vkeyWitnesses.add(vkeyWitness); |
| 113 | + witnesses.set_vkeys(vkeyWitnesses); |
| 114 | + return CardanoWasm.Transaction.new(transaction.body(), witnesses); |
123 | 115 | } |
124 | 116 |
|
125 | 117 | /** |
|
0 commit comments