mirror of
https://github.com/emo2007/block-accounting.git
synced 2025-01-18 07:26:27 +00:00
license interact needs to be done
This commit is contained in:
parent
a2b4823fcf
commit
ebf2edafff
@ -12,6 +12,7 @@ import "@chainlink/contracts/src/v0.8/shared/access/ConfirmedOwner.sol";
|
||||
/**
|
||||
* THIS IS AN EXAMPLE CONTRACT THAT USES UN-AUDITED CODE.
|
||||
*/
|
||||
|
||||
contract LinkWellStringBytesConsumerContractExample is ChainlinkClient, ConfirmedOwner {
|
||||
using Chainlink for Chainlink.Request;
|
||||
|
||||
|
@ -54,4 +54,9 @@ export class SalariesController {
|
||||
async deposit(@Body() dto: DepositContractDto) {
|
||||
return this.salariesService.deposit(dto);
|
||||
}
|
||||
|
||||
@Get('get-license-request')
|
||||
async getLicenseRequest() {
|
||||
return this.salariesService.getLicenseRequest();
|
||||
}
|
||||
}
|
||||
|
@ -35,6 +35,42 @@ export class SalariesService extends BaseContractService {
|
||||
return await myContract.getAddress();
|
||||
}
|
||||
|
||||
async getLicenseRequest() {
|
||||
const { abi } = await hre.artifacts.readArtifact(
|
||||
'LinkWellStringBytesConsumerContractExample',
|
||||
);
|
||||
const signer = await this.providerService.getSigner();
|
||||
|
||||
const contract = new ethers.Contract(
|
||||
'0xbc3c4fed4C3A977b8868b589662270F1aEA6A777',
|
||||
abi,
|
||||
signer,
|
||||
);
|
||||
|
||||
const answer: string = await contract.request();
|
||||
console.log('=>(salaries.service.ts:45) answer', answer);
|
||||
const licenseres = await this.getLicenseResponse();
|
||||
console.log('=>(salaries.service.ts:53) licenseres', licenseres);
|
||||
return answer;
|
||||
}
|
||||
|
||||
async getLicenseResponse() {
|
||||
const { abi } = await hre.artifacts.readArtifact(
|
||||
'LinkWellStringBytesConsumerContractExample',
|
||||
);
|
||||
const signer = await this.providerService.getSigner();
|
||||
|
||||
const contract = new ethers.Contract(
|
||||
'0xbc3c4fed4C3A977b8868b589662270F1aEA6A777',
|
||||
abi,
|
||||
signer,
|
||||
);
|
||||
|
||||
const answer: string = await contract.responseBytes();
|
||||
console.log('=>(salaries.service.ts:45) answer', answer);
|
||||
return answer;
|
||||
}
|
||||
|
||||
async getLatestUSDTPrice(contractAddress: string) {
|
||||
const { abi } = await hre.artifacts.readArtifact('Salaries');
|
||||
const signer = await this.providerService.getSigner();
|
||||
|
Loading…
Reference in New Issue
Block a user