|
|
@ -14,14 +14,18 @@ import { Debug } from './methods/debug' |
|
|
|
import { generateBlock } from './genesis' |
|
|
|
import { generateBlock } from './genesis' |
|
|
|
|
|
|
|
|
|
|
|
export class Provider { |
|
|
|
export class Provider { |
|
|
|
options |
|
|
|
options: Record<string, unknown> |
|
|
|
executionContext |
|
|
|
executionContext |
|
|
|
Accounts |
|
|
|
Accounts |
|
|
|
Transactions |
|
|
|
Transactions |
|
|
|
methods |
|
|
|
methods |
|
|
|
|
|
|
|
host: string |
|
|
|
|
|
|
|
connected: boolean; |
|
|
|
|
|
|
|
|
|
|
|
constructor (options = {}) { |
|
|
|
constructor (host: string = 'vm', options: Record<string, unknown> = {}) { |
|
|
|
this.options = options |
|
|
|
this.options = options |
|
|
|
|
|
|
|
this.host = host |
|
|
|
|
|
|
|
this.connected = true |
|
|
|
// TODO: init executionContext here
|
|
|
|
// TODO: init executionContext here
|
|
|
|
this.executionContext = executionContext |
|
|
|
this.executionContext = executionContext |
|
|
|
this.Accounts = new Accounts(this.executionContext) |
|
|
|
this.Accounts = new Accounts(this.executionContext) |
|
|
@ -75,6 +79,14 @@ export class Provider { |
|
|
|
isConnected () { |
|
|
|
isConnected () { |
|
|
|
return true |
|
|
|
return true |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
disconnect () { |
|
|
|
|
|
|
|
return false |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
supportsSubscriptions () { |
|
|
|
|
|
|
|
return true; |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
on (type, cb) { |
|
|
|
on (type, cb) { |
|
|
|
this.executionContext.logsManager.addListener(type, cb) |
|
|
|
this.executionContext.logsManager.addListener(type, cb) |
|
|
|