From 1c9e32618e9e441271c1d03286bc44d994543970 Mon Sep 17 00:00:00 2001 From: danielailie Date: Tue, 15 Oct 2024 15:09:30 +0300 Subject: [PATCH 1/2] Mark ITransactionNext as deprecated --- src/networkProviders/interface.ts | 45 +++++++++---------- .../providers.dev.net.spec.ts | 2 + 2 files changed, 23 insertions(+), 24 deletions(-) diff --git a/src/networkProviders/interface.ts b/src/networkProviders/interface.ts index 144f0583..501ab4a5 100644 --- a/src/networkProviders/interface.ts +++ b/src/networkProviders/interface.ts @@ -1,3 +1,4 @@ +import { ITransaction as ITransactionAsInSpecs } from "../interface"; import { AccountOnNetwork } from "./accounts"; import { ContractQueryResponse } from "./contractQueryResponse"; import { NetworkConfig } from "./networkConfig"; @@ -46,7 +47,10 @@ export interface INetworkProvider { /** * Fetches data about the non-fungible tokens held by account. */ - getNonFungibleTokensOfAccount(address: IAddress, pagination?: IPagination): Promise; + getNonFungibleTokensOfAccount( + address: IAddress, + pagination?: IPagination, + ): Promise; /** * Fetches data about a specific fungible token held by an account. @@ -56,7 +60,11 @@ export interface INetworkProvider { /** * Fetches data about a specific non-fungible token (instance) held by an account. */ - getNonFungibleTokenOfAccount(address: IAddress, collection: string, nonce: number): Promise; + getNonFungibleTokenOfAccount( + address: IAddress, + collection: string, + nonce: number, + ): Promise; /** * Fetches the state of a transaction. @@ -80,7 +88,7 @@ export interface INetworkProvider { /** * Simulates the processing of an already-signed transaction. - * + * */ simulateTransaction(tx: ITransaction): Promise; @@ -118,8 +126,8 @@ export interface INetworkProvider { export interface IContractQuery { address: IAddress; caller?: IAddress; - func: { toString(): string; }; - value?: { toString(): string; }; + func: { toString(): string }; + value?: { toString(): string }; getEncodedArguments(): string[]; } @@ -132,22 +140,11 @@ export interface ITransaction { toSendable(): any; } -export interface IAddress { bech32(): string; } - -export interface ITransactionNext { - sender: string; - receiver: string; - gasLimit: bigint; - chainID: string; - nonce: bigint; - value: bigint; - senderUsername: string; - receiverUsername: string; - gasPrice: bigint; - data: Uint8Array; - version: number; - options: number; - guardian: string; - signature: Uint8Array; - guardianSignature: Uint8Array; - } +export interface IAddress { + bech32(): string; +} + +/** + * @deprecated This will be remove with the next release (replaced by the `ITransaction` interface from "src/interface.ts"). + */ +export type ITransactionNext = ITransactionAsInSpecs; diff --git a/src/networkProviders/providers.dev.net.spec.ts b/src/networkProviders/providers.dev.net.spec.ts index d08e5b4f..b95994cb 100644 --- a/src/networkProviders/providers.dev.net.spec.ts +++ b/src/networkProviders/providers.dev.net.spec.ts @@ -452,6 +452,8 @@ describe("test network providers on devnet: Proxy and API", function () { guardian: "", guardianSignature: new Uint8Array(), options: 0, + relayer: "", + innerTransactions: [], }; const apiLegacyTxHash = await apiProvider.sendTransaction(transaction); From 6ceb8be859d06cb3bc296682a7e19df125782f44 Mon Sep 17 00:00:00 2001 From: danielailie Date: Tue, 15 Oct 2024 15:36:44 +0300 Subject: [PATCH 2/2] Fix typo --- src/networkProviders/interface.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/networkProviders/interface.ts b/src/networkProviders/interface.ts index 501ab4a5..eb73db28 100644 --- a/src/networkProviders/interface.ts +++ b/src/networkProviders/interface.ts @@ -145,6 +145,6 @@ export interface IAddress { } /** - * @deprecated This will be remove with the next release (replaced by the `ITransaction` interface from "src/interface.ts"). + * @deprecated This will be removed with the next release (replaced by the `ITransaction` interface from "src/interface.ts"). */ export type ITransactionNext = ITransactionAsInSpecs;