@@ -4,9 +4,8 @@ import { Account } from "../accounts";
44import { IAccount } from "../accounts/interfaces" ;
55import { Address } from "../core/address" ;
66import { ErrInvalidNetworkProviderKind } from "../core/errors" ;
7- import { Message , MessageComputer } from "../core/message" ;
7+ import { Message } from "../core/message" ;
88import { Transaction } from "../core/transaction" ;
9- import { TransactionComputer } from "../core/transactionComputer" ;
109import { TransactionOnNetwork } from "../core/transactionOnNetwork" ;
1110import { TransactionsFactoryConfig } from "../core/transactionsFactoryConfig" ;
1211import { TransactionWatcher } from "../core/transactionWatcher" ;
@@ -20,7 +19,7 @@ import { SmartContractController } from "../smartContracts/smartContractControll
2019import { TokenManagementController , TokenManagementTransactionsFactory } from "../tokenManagement" ;
2120import { TransferTransactionsFactory } from "../transfers" ;
2221import { TransfersController } from "../transfers/transfersControllers" ;
23- import { UserSecretKey , UserVerifier } from "../wallet" ;
22+ import { UserSecretKey } from "../wallet" ;
2423import { DevnetEntrypointConfig , MainnetEntrypointConfig , TestnetEntrypointConfig } from "./config" ;
2524
2625class NetworkEntrypoint {
@@ -49,17 +48,14 @@ class NetworkEntrypoint {
4948 }
5049
5150 async signTransaction ( transaction : Transaction , account : IAccount ) : Promise < void > {
52- const txComputer = new TransactionComputer ( ) ;
53- transaction . signature = await account . sign ( txComputer . computeBytesForSigning ( transaction ) ) ;
51+ transaction . signature = await account . signTransaction ( transaction ) ;
5452 }
5553
56- verifyTransactionSignature ( transaction : Transaction ) : boolean {
57- const verifier = UserVerifier . fromAddress ( transaction . sender ) ;
58- const txComputer = new TransactionComputer ( ) ;
59- return verifier . verify ( txComputer . computeBytesForVerifying ( transaction ) , transaction . signature ) ;
54+ async verifyTransactionSignature ( transaction : Transaction , account : IAccount ) : Promise < boolean > {
55+ return await account . verifyTransactionSignature ( transaction , transaction . signature ) ;
6056 }
6157
62- verifyMessageSignature ( message : Message ) : boolean {
58+ async verifyMessageSignature ( message : Message , account : IAccount ) : Promise < boolean > {
6359 if ( ! message . address ) {
6460 throw new Error ( "`address` property of Message is not set" ) ;
6561 }
@@ -68,9 +64,7 @@ class NetworkEntrypoint {
6864 throw new Error ( "`signature` property of Message is not set" ) ;
6965 }
7066
71- const verifier = UserVerifier . fromAddress ( message . address ) ;
72- const messageComputer = new MessageComputer ( ) ;
73- return verifier . verify ( messageComputer . computeBytesForVerifying ( message ) , message . signature ) ;
67+ return await account . verifyMessageSignature ( message , message . signature ) ;
7468 }
7569
7670 async recallAccountNonce ( address : Address ) : Promise < bigint > {
0 commit comments