Skip to content

Commit

Permalink
Setting Session on Contract when exists
Browse files Browse the repository at this point in the history
  • Loading branch information
aaroncox committed Jul 7, 2023
1 parent 62b0841 commit 7cdecd8
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/contract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export class Contract {
readonly abi: ABI
readonly account: Name
readonly client: APIClient
readonly session?: Session

/**
* Constructs a new `Contract` instance.
Expand All @@ -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 {
Expand Down

0 comments on commit 7cdecd8

Please sign in to comment.