mirror of
https://github.com/oceanprotocol-archive/squid-js.git
synced 2024-02-02 15:31:51 +01:00
Merge remote-tracking branch 'origin/master' into update/packages
# Conflicts: # package-lock.json # package.json
This commit is contained in:
commit
a69c128cb6
773
package-lock.json
generated
773
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -66,6 +66,7 @@ export abstract class Instantiable {
|
||||
}
|
||||
|
||||
public static async getInstance(...args: any[]): Promise<any>
|
||||
|
||||
public static async getInstance(config: InstantiableConfig): Promise<any> {
|
||||
LoggerInstance.warn(
|
||||
'getInstance() methods has needs to be added to child class.'
|
||||
@ -83,8 +84,11 @@ export abstract class Instantiable {
|
||||
}
|
||||
|
||||
private _ocean: Ocean
|
||||
|
||||
private _web3: Web3
|
||||
|
||||
private _config: Config
|
||||
|
||||
private _logger: Logger
|
||||
|
||||
protected setInstanceConfig(config: InstantiableConfig) {
|
||||
|
@ -39,10 +39,15 @@ export class DDO {
|
||||
* @type {string}
|
||||
*/
|
||||
public id: string = null
|
||||
|
||||
public created: string
|
||||
|
||||
public publicKey: PublicKey[] = []
|
||||
|
||||
public authentication: Authentication[] = []
|
||||
|
||||
public service: Service[] = []
|
||||
|
||||
public proof: Proof
|
||||
|
||||
public constructor(ddo: Partial<DDO> = {}) {
|
||||
|
@ -9,9 +9,13 @@ export class EventHandler extends Instantiable {
|
||||
}
|
||||
|
||||
private events = new Set<(blockNumber) => void>()
|
||||
|
||||
private lastBlock: number
|
||||
|
||||
private interval = 200
|
||||
|
||||
private polling: boolean = false
|
||||
|
||||
private lastTimeout: NodeJS.Timeout
|
||||
|
||||
constructor(config: InstantiableConfig) {
|
||||
|
@ -6,6 +6,7 @@ import { Instantiable, InstantiableConfig } from '../../Instantiable.abstract'
|
||||
|
||||
export abstract class ContractBase extends Instantiable {
|
||||
protected static instance = null
|
||||
|
||||
public contractName: string
|
||||
|
||||
private contract: Contract = null
|
||||
|
@ -36,6 +36,7 @@ export abstract class Condition extends ContractBase {
|
||||
}
|
||||
|
||||
public fulfill(agreementId: string, ...args: any[])
|
||||
|
||||
public fulfill(agreementId: string, args: any[], from?: string) {
|
||||
return this.sendFrom('fulfill', [zeroX(agreementId), ...args], from)
|
||||
}
|
||||
|
@ -1,4 +1,5 @@
|
||||
export default class Balance {
|
||||
public eth: number
|
||||
|
||||
public ocn: number
|
||||
}
|
||||
|
@ -13,6 +13,7 @@ export class Config {
|
||||
* @type {string}
|
||||
*/
|
||||
public brizoUri: string
|
||||
|
||||
/**
|
||||
* Address of Brizo.
|
||||
* @type {string}
|
||||
@ -24,6 +25,7 @@ export class Config {
|
||||
* @type {string}
|
||||
*/
|
||||
public nodeUri?: string
|
||||
|
||||
/**
|
||||
* Web3 Provider.
|
||||
* @type {any}
|
||||
@ -56,6 +58,7 @@ export class Config {
|
||||
|
||||
// Parity config
|
||||
public parityUri?: string
|
||||
|
||||
public threshold?: number
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
export default class InputType {
|
||||
public name: string
|
||||
|
||||
public type: string
|
||||
}
|
||||
|
@ -2,8 +2,12 @@ import InputType from './InputType'
|
||||
|
||||
export default class MethodReflection {
|
||||
public contractName: string
|
||||
|
||||
public methodName: string
|
||||
|
||||
public address: string
|
||||
|
||||
public signature: string
|
||||
|
||||
public inputs: InputType[]
|
||||
}
|
||||
|
@ -1,4 +1,5 @@
|
||||
export default class ValuePair {
|
||||
public type: string
|
||||
|
||||
public value: any
|
||||
}
|
||||
|
@ -8,6 +8,7 @@ import { Instantiable, InstantiableConfig } from '../Instantiable.abstract'
|
||||
*/
|
||||
export default class Account extends Instantiable {
|
||||
private password?: string
|
||||
|
||||
private token?: string
|
||||
|
||||
constructor(private id: string = '0x0', config?: InstantiableConfig) {
|
||||
|
@ -1,5 +1,6 @@
|
||||
export class SubscribableObserver<T, P> {
|
||||
public completed: boolean = false
|
||||
|
||||
private subscriptions = new Set<{
|
||||
onNext?: (next: T) => void
|
||||
onComplete?: (complete: P) => void
|
||||
|
@ -2,6 +2,7 @@ import { SubscribableObserver } from './SubscribableObserver'
|
||||
|
||||
export class SubscribablePromise<T extends any, P extends any> {
|
||||
private observer = new SubscribableObserver<T, P>()
|
||||
|
||||
private promise = Object.assign(
|
||||
new Promise<P>((resolve, reject) => {
|
||||
setTimeout(() => {
|
||||
|
Loading…
Reference in New Issue
Block a user