Created
July 10, 2019 00:09
-
-
Save alexytiger/27623a240a8f21795e0d10ee5462cf02 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Injectable } from '@angular/core'; | |
import { Contract } from 'ethers'; | |
import { Provider } from '../../../core/services/tokens'; | |
import { P2pBazaarAnchorModule } from '../../p2p-bazaar.anchor.module'; | |
import { environment } from 'src/environments/environment' | |
const FLEA_MARKET_CONTRACT_ADDRESS = environment.fleaMarketContractAddress; | |
const abi = [ | |
'event logNewPurchaseContract(address contractAddress)', | |
'function createPurchaseContract(bytes32 key, string title, string ipfsHash) payable returns(bool createResult)', | |
'function getContractCount() view returns(uint contractCount)', | |
'function getContractKeyAtIndex(uint index) public view returns(bytes32 key)', | |
'function getContractByKey(bytes32 key) view returns(address contractAddress)' | |
]; | |
@Injectable({ providedIn: P2pBazaarAnchorModule }) | |
export class FleaMarketContractToken extends Contract { | |
constructor(provider: Provider) { | |
super(FLEA_MARKET_CONTRACT_ADDRESS, abi, provider.getSigner()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment