0.0.12 • Published 3 years ago

@hardapps/lb-connector-web3plus v0.0.12

Weekly downloads
14
License
ISC
Repository
-
Last release
3 years ago

Datasource example

{
  "name": "web3plus",
  "connector": "@hardapps/lb-connector-web3plus",
  "provider": "ws://localhost:9545",
  "providerName": "local ganache",
  "privateKeyFile": "secrets/private_key_file",
  "gas": 400000,
  "contracts": [
    {
      "name": "MyContract",
      "abi": ["..."],
      "address": "0x3cA09957030CF5cbd7905F6f6ed2b54665589786"
    }
  ]
}
import { getService, juggler } from '@loopback/service-proxy';
import { inject, Provider } from '@loopback/core';
import { Web3PlusDataSource } from '../datasources';
import Web3 = require('web3');

export interface Web3PlusService {
  web3: Web3;
  providerName: string;
  contracts: any;
  reconnectWeb3: any; 
}


export class Web3PlusServiceProvider implements Provider<Web3PlusService> {
  constructor(
    @inject('datasources.web3plus')
    protected dataSource: juggler.DataSource = new Web3PlusDataSource(),
  ) { }

  value(): Promise<Web3PlusService> {
    return getService(this.dataSource);
  }
}
0.0.11

3 years ago

0.0.12

3 years ago

0.0.10

3 years ago

0.0.9

4 years ago

0.0.8

4 years ago

0.0.7

4 years ago

0.0.6

4 years ago

0.0.5

5 years ago

0.0.4

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago