2

我收到 Unhandled Rejection (TypeError): 意外类型,在签署 solana 交易时使用 Uint8Array

未处理的拒绝(TypeError):意外类型,使用 Uint8Array

▶ 3 个堆栈帧被折叠。(匿名函数)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 | }

查看编译好的 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 | /**

查看编译后的(匿名函数)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();

查看编译好的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 = [];

查看编译好的 async Object.rpc [as initializeConfig] /src/program/namespace/rpc.ts:19

16 |                 throw err;
  17 |             }
  18 |             throw translatedErr;
> 19 |         }
     | ^  20 |     };
  21 |     return rpc;
  22 | }
4

0 回答 0