From 7cdecd8571a4a6f69a442b6d52253c13d9d105aa Mon Sep 17 00:00:00 2001 From: Aaron Cox Date: Fri, 7 Jul 2023 10:02:28 -0700 Subject: [PATCH] Setting Session on Contract when exists --- src/contract.ts | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/contract.ts b/src/contract.ts index affa340..184e25a 100644 --- a/src/contract.ts +++ b/src/contract.ts @@ -21,6 +21,7 @@ export class Contract { readonly abi: ABI readonly account: Name readonly client: APIClient + readonly session?: Session /** * Constructs a new `Contract` instance. @@ -33,13 +34,9 @@ export class Contract { this.account = Name.from(args.account) this.client = args.client - this.abi.tables.forEach((tableDef) => { - this.tables[String(tableDef.name)] = Table.from({ - contract: this, - name: tableDef.name, - rowType: tableDef.type, - }) - }) + if (options.session) { + this.session = options.session + } } static from(args: ContractArgs, options: ContractOptions = {}): Contract {