Reputation: 875
I am getting Unhandled Rejection (TypeError): unexpected type, use Uint8Array while signing solana transaction
Unhandled Rejection (TypeError): unexpected type, use Uint8Array
▶ 3 stack frames were collapsed. (anonymous function) src/transaction.ts:511
508 | _partialSign(message: Message, ...signers: Array<Signer>) {
509 | const signData = message.serialize();
510 | signers.forEach(signer => {
> 511 | const signature = nacl.sign.detached(signData, signer.secretKey);
| ^ 512 | this._addSignature(signer.publicKey, toBuffer(signature));
513 | });
514 | }
View compiled Transaction._partialSign src/transaction.ts:510
507 | */
508 | _partialSign(message: Message, ...signers: Array<Signer>) {
509 | const signData = message.serialize();
> 510 | signers.forEach(signer => {
| ^ 511 | const signature = nacl.sign.detached(signData, signer.secretKey);
512 | this._addSignature(signer.publicKey, toBuffer(signature));
513 | });
View compiled
Transaction.partialSign src/transaction.ts:502
499 | }
500 |
501 | const message = this._compile();
> 502 | this._partialSign(message, ...uniqueSigners);
| ^ 503 | }
504 |
505 | /**
View compiled (anonymous function) src/provider.ts:109
106 | return tx;
107 | });
108 | const signedTxs = await this.wallet.signAllTransactions(txs);
> 109 | const sigs = [];
| ^ 110 | for (let k = 0; k < txs.length; k += 1) {
111 | const tx = signedTxs[k];
112 | const rawTx = tx.serialize();
View compiled Provider.send src/provider.ts:106
103 | .forEach((kp) => {
104 | tx.partialSign(kp);
105 | });
> 106 | return tx;
| ^ 107 | });
108 | const signedTxs = await this.wallet.signAllTransactions(txs);
109 | const sigs = [];
View compiled async Object.rpc [as initializeConfig] /src/program/namespace/rpc.ts:19
16 | throw err;
17 | }
18 | throw translatedErr;
> 19 | }
| ^ 20 | };
21 | return rpc;
22 | }
Upvotes: 3
Views: 670