From 99b899a11bf48f2fa04884687ea395e0d42d75d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Francisco=20L=C3=B3pez?= Date: Mon, 19 May 2025 15:13:36 +0200 Subject: [PATCH 01/18] Escrow cancellation management to Escrow contract --- packages/core/contracts/Escrow.sol | 67 +++--- .../core/contracts/interfaces/IEscrow.sol | 9 +- packages/core/test/Escrow-USDT.ts | 209 ++++++++++++++-- packages/core/test/Escrow.ts | 227 ++++++++++++++++-- 4 files changed, 435 insertions(+), 77 deletions(-) diff --git a/packages/core/contracts/Escrow.sol b/packages/core/contracts/Escrow.sol index bf8a6550a2..fcac414b8d 100644 --- a/packages/core/contracts/Escrow.sol +++ b/packages/core/contracts/Escrow.sol @@ -74,6 +74,8 @@ contract Escrow is IEscrow, ReentrancyGuard { uint256 public remainingFunds; + uint256 public reservedFunds; + constructor( address _token, address _launcher, @@ -96,10 +98,7 @@ contract Escrow is IEscrow, ReentrancyGuard { } function getBalance() public view returns (uint256) { - (bool success, bytes memory returnData) = token.staticcall( - abi.encodeWithSelector(FUNC_SELECTOR_BALANCE_OF, address(this)) - ); - return success ? abi.decode(returnData, (uint256)) : 0; + return getTokenBalance(token); } function getTokenBalance(address _token) public view returns (uint256) { @@ -192,10 +191,7 @@ contract Escrow is IEscrow, ReentrancyGuard { nonReentrant returns (bool) { - _safeTransfer(token, canceler, remainingFunds); - status = EscrowStatuses.Cancelled; - remainingFunds = 0; - emit Cancelled(); + status = EscrowStatuses.ToCancel; return true; } @@ -229,26 +225,49 @@ contract Escrow is IEscrow, ReentrancyGuard { if (remainingFunds > 0) { _safeTransfer(token, launcher, remainingFunds); remainingFunds = 0; + reservedFunds = 0; + } + if (status == EscrowStatuses.ToCancel) { + status = EscrowStatuses.Cancelled; + emit Cancelled(); + } else { + status = EscrowStatuses.Complete; + emit Completed(); } - status = EscrowStatuses.Complete; - emit Completed(); } function storeResults( string memory _url, - string memory _hash + string memory _hash, + uint256 _amount ) external override trustedOrRecordingOracle notExpired { require( status == EscrowStatuses.Pending || - status == EscrowStatuses.Partial, - 'Escrow not in Pending or Partial status state' + status == EscrowStatuses.Partial || + status == EscrowStatuses.ToCancel, + 'Escrow not in Pending, Partial or ToCancel status state' ); require(bytes(_url).length != 0, "URL can't be empty"); require(bytes(_hash).length != 0, "Hash can't be empty"); + require(_amount > 0, 'Amount must be greater than zero'); + require( + _amount <= remainingFunds - reservedFunds, + 'Not enough unreserved funds' + ); intermediateResultsUrl = _url; + reservedFunds += _amount; emit IntermediateStorage(_url, _hash); + + // If the escrow is ToCancel, transfer unreserved funds to launcher + if (status == EscrowStatuses.ToCancel) { + uint256 unreservedFunds = remainingFunds - reservedFunds; + if (unreservedFunds > 0) { + _safeTransfer(token, launcher, unreservedFunds); + remainingFunds = reservedFunds; + } + } } /** @@ -298,8 +317,6 @@ contract Escrow is IEscrow, ReentrancyGuard { ); uint256 aggregatedBulkAmount = 0; - uint256 cachedRemainingFunds = remainingFunds; - for (uint256 i = 0; i < _amounts.length; i++) { uint256 amount = _amounts[i]; require(amount > 0, 'Amount should be greater than zero'); @@ -307,11 +324,12 @@ contract Escrow is IEscrow, ReentrancyGuard { } require(aggregatedBulkAmount < BULK_MAX_VALUE, 'Bulk value too high'); require( - aggregatedBulkAmount <= cachedRemainingFunds, - 'Not enough balance' + aggregatedBulkAmount <= reservedFunds, + 'Not enough reserved funds' ); - cachedRemainingFunds -= aggregatedBulkAmount; + reservedFunds -= aggregatedBulkAmount; + remainingFunds -= aggregatedBulkAmount; require(bytes(_url).length != 0, "URL can't be empty"); require(bytes(_hash).length != 0, "Hash can't be empty"); @@ -352,9 +370,7 @@ contract Escrow is IEscrow, ReentrancyGuard { ); } - remainingFunds = cachedRemainingFunds; - - if (cachedRemainingFunds == 0 || forceComplete) { + if (remainingFunds == 0 || forceComplete) { emit BulkTransferV2( _txId, _recipients, @@ -364,7 +380,9 @@ contract Escrow is IEscrow, ReentrancyGuard { ); _complete(); } else { - status = EscrowStatuses.Partial; + if (status != EscrowStatuses.ToCancel) { + status = EscrowStatuses.Partial; + } emit BulkTransferV2( _txId, _recipients, @@ -433,11 +451,6 @@ contract Escrow is IEscrow, ReentrancyGuard { _; } - modifier notPaid() { - require(status != EscrowStatuses.Paid, 'Escrow in Paid status state'); - _; - } - modifier notLaunched() { require( status != EscrowStatuses.Launched, diff --git a/packages/core/contracts/interfaces/IEscrow.sol b/packages/core/contracts/interfaces/IEscrow.sol index 3066d9423e..ff34743020 100644 --- a/packages/core/contracts/interfaces/IEscrow.sol +++ b/packages/core/contracts/interfaces/IEscrow.sol @@ -9,7 +9,8 @@ interface IEscrow { Partial, Paid, Complete, - Cancelled + Cancelled, + ToCancel } function status() external view returns (EscrowStatuses); @@ -33,7 +34,11 @@ interface IEscrow { function complete() external; - function storeResults(string memory _url, string memory _hash) external; + function storeResults( + string memory _url, + string memory _hash, + uint256 _amount + ) external; function bulkPayOut( address[] memory _recipients, diff --git a/packages/core/test/Escrow-USDT.ts b/packages/core/test/Escrow-USDT.ts index c8cb771f5d..b70c2793e4 100644 --- a/packages/core/test/Escrow-USDT.ts +++ b/packages/core/test/Escrow-USDT.ts @@ -16,6 +16,7 @@ enum Status { Paid = 3, Complete = 4, Cancelled = 5, + ToCancel = 6, } let owner: Signer, @@ -64,6 +65,12 @@ async function fundEscrow() { await usdt.connect(owner).transfer(escrow.getAddress(), amount); } +async function storeResults(amount = 50) { + await escrow + .connect(restAccounts[0]) + .storeResults(MOCK_URL, MOCK_HASH, amount); +} + describe('Escrow with USDT', function () { this.beforeAll(async () => { [ @@ -177,7 +184,7 @@ describe('Escrow with USDT', function () { const result = await ( await escrow .connect(restAccounts[2]) - .storeResults(MOCK_URL, MOCK_HASH) + .storeResults(MOCK_URL, MOCK_HASH, 50) ).wait(); expect((result?.logs[0] as EventLog).args).to.contain(MOCK_URL); @@ -192,7 +199,7 @@ describe('Escrow with USDT', function () { const result = await ( await escrow .connect(restAccounts[3]) - .storeResults(MOCK_URL, MOCK_HASH) + .storeResults(MOCK_URL, MOCK_HASH, 50) ).wait(); expect((result?.logs[0] as EventLog).args).to.contain(MOCK_URL); @@ -203,28 +210,55 @@ describe('Escrow with USDT', function () { describe('storeResults', async () => { describe('Validations', function () { - before(async () => { + beforeEach(async () => { await deployEscrow(); }); it('Should revert with the right error if address calling not trusted', async function () { await expect( - escrow.connect(externalAddress).storeResults(MOCK_URL, MOCK_HASH) + escrow.connect(externalAddress).storeResults(MOCK_URL, MOCK_HASH, 50) ).to.be.revertedWith('Address calling not trusted'); }); it('Should revert with the right error if address calling is reputation oracle', async function () { await expect( - escrow.connect(reputationOracle).storeResults(MOCK_URL, MOCK_HASH) + escrow.connect(reputationOracle).storeResults(MOCK_URL, MOCK_HASH, 50) ).to.be.revertedWith('Address calling not trusted'); }); - it('Should revert with the right error if escrow not in Pending or Partial status state', async function () { + it('Should revert with the right error if escrow not in Pending, Partial or ToCancel status state', async function () { + await escrow + .connect(owner) + .addTrustedHandlers([await reputationOracle.getAddress()]); + await expect( + escrow.connect(reputationOracle).storeResults(MOCK_URL, MOCK_HASH, 50) + ).to.be.revertedWith( + 'Escrow not in Pending, Partial or ToCancel status state' + ); + }); + + it('Should revert with the right error if amount sent is 0', async function () { + await fundEscrow(); + await setupEscrow(); + await escrow + .connect(owner) + .addTrustedHandlers([await reputationOracle.getAddress()]); + await expect( + escrow.connect(reputationOracle).storeResults(MOCK_URL, MOCK_HASH, 0) + ).to.be.revertedWith('Amount must be greater than zero'); + }); + + it('Should revert with the right error if amount is higher than unreserved funds', async function () { + await fundEscrow(); + await setupEscrow(); + await escrow .connect(owner) .addTrustedHandlers([await reputationOracle.getAddress()]); await expect( - escrow.connect(reputationOracle).storeResults(MOCK_URL, MOCK_HASH) - ).to.be.revertedWith('Escrow not in Pending or Partial status state'); + escrow + .connect(reputationOracle) + .storeResults(MOCK_URL, MOCK_HASH, 150) + ).to.be.revertedWith('Not enough unreserved funds'); }); }); @@ -237,7 +271,7 @@ describe('Escrow with USDT', function () { it('Should emit an event on intermediate storage', async function () { await expect( - await escrow.connect(owner).storeResults(MOCK_URL, MOCK_HASH) + await escrow.connect(owner).storeResults(MOCK_URL, MOCK_HASH, 50) ) .to.emit(escrow, 'IntermediateStorage') .withArgs(MOCK_URL, MOCK_HASH); @@ -245,32 +279,71 @@ describe('Escrow with USDT', function () { }); describe('Store results', async function () { - before(async () => { + beforeEach(async () => { await deployEscrow(); await fundEscrow(); await setupEscrow(); }); it('Should succeed when recording oracle stores results', async () => { + const initialOwnerBalance = await usdt + .connect(owner) + .balanceOf(launcher.getAddress()); const result = await ( await escrow .connect(recordingOracle) - .storeResults(MOCK_URL, MOCK_HASH) + .storeResults(MOCK_URL, MOCK_HASH, 50) ).wait(); + const finalOwnerBalance = await usdt + .connect(owner) + .balanceOf(launcher.getAddress()); expect((result?.logs[0] as EventLog).args).to.contain(MOCK_URL); expect((result?.logs[0] as EventLog).args).to.contain(MOCK_HASH); + expect(finalOwnerBalance - initialOwnerBalance).to.equal(0); + expect(await escrow.remainingFunds()).to.equal(100); + expect(await escrow.reservedFunds()).to.equal(50); }); it('Should succeed when a trusted handler stores results', async () => { + const initialOwnerBalance = await usdt + .connect(owner) + .balanceOf(launcher.getAddress()); const result = await ( await escrow .connect(trustedHandlers[0]) - .storeResults(MOCK_URL, MOCK_HASH) + .storeResults(MOCK_URL, MOCK_HASH, 50) ).wait(); + const finalOwnerBalance = await usdt + .connect(owner) + .balanceOf(launcher.getAddress()); expect((result?.logs[0] as EventLog).args).to.contain(MOCK_URL); expect((result?.logs[0] as EventLog).args).to.contain(MOCK_HASH); + expect(finalOwnerBalance - initialOwnerBalance).to.equal(0); + expect(await escrow.remainingFunds()).to.equal(100); + expect(await escrow.reservedFunds()).to.equal(50); + }); + + it('Should return unreserved funds to escrow launcher when status is ToCancel', async () => { + const initialOwnerBalance = await usdt + .connect(owner) + .balanceOf(launcher.getAddress()); + await (await escrow.connect(launcher).cancel()).wait(); + const result = await ( + await escrow + .connect(recordingOracle) + .storeResults(MOCK_URL, MOCK_HASH, 50) + ).wait(); + + expect((result?.logs[0] as EventLog).args).to.contain(MOCK_URL); + expect((result?.logs[0] as EventLog).args).to.contain(MOCK_HASH); + const finalOwnerBalance = await usdt + .connect(owner) + .balanceOf(launcher.getAddress()); + expect(finalOwnerBalance - initialOwnerBalance).to.equal(50); + expect(await escrow.remainingFunds()).to.equal(50); + expect(await escrow.reservedFunds()).to.equal(50); }); }); }); @@ -471,6 +544,7 @@ describe('Escrow with USDT', function () { await deployEscrow(); await fundEscrow(); await setupEscrow(); + await storeResults(100); await escrow .connect(owner) @@ -508,21 +582,13 @@ describe('Escrow with USDT', function () { it('Should succeed when the contract was canceled', async () => { await escrow.connect(owner).cancel(); const ststus = await escrow.status(); - expect(ststus).to.equal(Status.Cancelled); - - expect( - await usdt.connect(owner).balanceOf(escrow.getAddress()) - ).to.equal('0', 'Escrow has not been properly canceled'); + expect(ststus).to.equal(Status.ToCancel); }); it('Should succeed when the contract was canceled by trusted handler', async () => { await escrow.connect(trustedHandlers[0]).cancel(); const ststus = await escrow.status(); - expect(ststus).to.equal(Status.Cancelled); - - expect( - await usdt.connect(owner).balanceOf(escrow.getAddress()) - ).to.equal('0', 'Escrow has not been properly canceled'); + expect(ststus).to.equal(Status.ToCancel); }); }); }); @@ -533,6 +599,7 @@ describe('Escrow with USDT', function () { await deployEscrow(); await fundEscrow(); await setupEscrow(); + await storeResults(); }); it('Should revert with the right error if address calling is not trusted', async function () { @@ -609,6 +676,23 @@ describe('Escrow with USDT', function () { ](recepients, amounts, MOCK_URL, MOCK_HASH, '000') ).to.be.revertedWith('Too many recipients'); }); + + it('Should revert with the right error if trying to payout more than reservedFunds', async function () { + const recepients = [ + await restAccounts[0].getAddress(), + await restAccounts[1].getAddress(), + await restAccounts[2].getAddress(), + ]; + const amounts = [10, 20, 30]; + + await expect( + escrow + .connect(reputationOracle) + [ + 'bulkPayOut(address[],uint256[],string,string,uint256)' + ](recepients, amounts, MOCK_URL, MOCK_HASH, '000') + ).to.be.revertedWith('Not enough reserved funds'); + }); }); describe('Events', function () { @@ -616,6 +700,7 @@ describe('Escrow with USDT', function () { await deployEscrow(); await fundEscrow(); await setupEscrow(); + await storeResults(100); }); it('Should emit bulkPayOut and Completed events for complete bulkPayOut', async function () { @@ -635,6 +720,25 @@ describe('Escrow with USDT', function () { await expect(tx).to.emit(escrow, 'Completed'); }); + it('Should emit bulkPayOut and Cancelled events for complete bulkPayOut with ToCancel status', async function () { + const recepients = [await restAccounts[0].getAddress()]; + const amounts = [100]; + + await escrow.connect(owner).cancel(); + + const tx = await escrow + .connect(owner) + [ + 'bulkPayOut(address[],uint256[],string,string,uint256)' + ](recepients, amounts, MOCK_URL, MOCK_HASH, '000'); + + await expect(tx) + .to.emit(escrow, 'BulkTransferV2') + .withArgs(anyValue, recepients, [100], false, MOCK_URL); + + await expect(tx).to.emit(escrow, 'Cancelled'); + }); + it('Should emit only bulkPayOut event for partial bulkPayOut', async function () { const recepients = [await restAccounts[0].getAddress()]; const amounts = [10]; @@ -668,6 +772,25 @@ describe('Escrow with USDT', function () { await expect(tx).to.emit(escrow, 'Completed'); }); + + it('Should emit bulkPayOut and Cancelled events for partial bulkPayOut with forceComplete option and ToCancel status', async function () { + const recepients = [await restAccounts[0].getAddress()]; + const amounts = [10]; + + await escrow.connect(owner).cancel(); + + const tx = await escrow + .connect(owner) + [ + 'bulkPayOut(address[],uint256[],string,string,uint256,bool)' + ](recepients, amounts, MOCK_URL, MOCK_HASH, '000', true); + + await expect(tx) + .to.emit(escrow, 'BulkTransferV2') + .withArgs(anyValue, recepients, [10], false, MOCK_URL); + + await expect(tx).to.emit(escrow, 'Cancelled'); + }); }); describe('Bulk payout for recipients', async function () { @@ -675,6 +798,7 @@ describe('Escrow with USDT', function () { await deployEscrow(); await fundEscrow(); await setupEscrow(); + await storeResults(100); }); it('Should pays each recipient their corresponding amount', async () => { @@ -876,6 +1000,26 @@ describe('Escrow with USDT', function () { expect(await escrow.status()).to.equal(Status.Complete); }); + it('Should runs from setup to bulkPayOut to Cancelled correctly with multiple addresses', async () => { + const recepients = [ + await restAccounts[3].getAddress(), + await restAccounts[4].getAddress(), + await restAccounts[5].getAddress(), + ]; + const amounts = [10, 20, 70]; + + await escrow.connect(owner).cancel(); + + expect(await escrow.status()).to.equal(Status.ToCancel); + + await escrow + .connect(reputationOracle) + [ + 'bulkPayOut(address[],uint256[],string,string,uint256)' + ](recepients, amounts, MOCK_URL, MOCK_HASH, '000'); + expect(await escrow.status()).to.equal(Status.Cancelled); + }); + it('Should runs from setup to bulkPayOut to partial correctly', async () => { const recepients = [await restAccounts[3].getAddress()]; const amounts = [80]; @@ -890,6 +1034,22 @@ describe('Escrow with USDT', function () { expect(await escrow.status()).to.equal(Status.Partial); }); + it('Should runs partial bulkPayOut without modifying status if status is ToCancel', async () => { + const recepients = [await restAccounts[3].getAddress()]; + const amounts = [80]; + + await escrow.connect(owner).cancel(); + + expect(await escrow.status()).to.equal(Status.ToCancel); + + await escrow + .connect(reputationOracle) + [ + 'bulkPayOut(address[],uint256[],string,string,uint256)' + ](recepients, amounts, MOCK_URL, MOCK_HASH, '000'); + expect(await escrow.status()).to.equal(Status.ToCancel); + }); + it('Should runs from setup to bulkPayOut to partial correctly with multiple addresses', async () => { const recepients = [ await restAccounts[3].getAddress(), @@ -982,9 +1142,10 @@ describe('Escrow with USDT', function () { await deployEscrow(); await fundEscrow(); await setupEscrow(); + await storeResults(); }); - it('Should revert with the right error if escrow not in Paid or Partial state', async function () { + it('Should revert with the right error if escrow not in Paid, Partial or ToCancel state', async function () { await expect(escrow.connect(owner).complete()).to.be.revertedWith( 'Escrow not in Paid or Partial state' ); @@ -996,6 +1157,7 @@ describe('Escrow with USDT', function () { await deployEscrow(); await fundEscrow(); await setupEscrow(); + await storeResults(); const recipients = [await restAccounts[0].getAddress()]; const amounts = [10]; @@ -1019,6 +1181,7 @@ describe('Escrow with USDT', function () { await deployEscrow(); await fundEscrow(); await setupEscrow(); + await storeResults(); }); it('Should succeed if escrow is in Partial state', async function () { diff --git a/packages/core/test/Escrow.ts b/packages/core/test/Escrow.ts index 85c01fc5a9..a5ae002203 100644 --- a/packages/core/test/Escrow.ts +++ b/packages/core/test/Escrow.ts @@ -16,6 +16,7 @@ enum Status { Paid = 3, Complete = 4, Cancelled = 5, + ToCancel = 6, } let owner: Signer, @@ -63,6 +64,12 @@ async function fundEscrow() { await token.connect(owner).transfer(escrow.getAddress(), amount); } +async function storeResults(amount = 50) { + await escrow + .connect(restAccounts[0]) + .storeResults(MOCK_URL, MOCK_HASH, amount); +} + describe('Escrow', function () { this.beforeAll(async () => { [ @@ -170,7 +177,7 @@ describe('Escrow', function () { const result = await ( await escrow .connect(restAccounts[2]) - .storeResults(MOCK_URL, MOCK_HASH) + .storeResults(MOCK_URL, MOCK_HASH, 50) ).wait(); expect((result?.logs[0] as EventLog).args).to.contain(MOCK_URL); @@ -185,7 +192,7 @@ describe('Escrow', function () { const result = await ( await escrow .connect(restAccounts[3]) - .storeResults(MOCK_URL, MOCK_HASH) + .storeResults(MOCK_URL, MOCK_HASH, 50) ).wait(); expect((result?.logs[0] as EventLog).args).to.contain(MOCK_URL); @@ -196,28 +203,55 @@ describe('Escrow', function () { describe('storeResults', async () => { describe('Validations', function () { - before(async () => { + beforeEach(async () => { await deployEscrow(); }); it('Should revert with the right error if address calling not trusted', async function () { await expect( - escrow.connect(externalAddress).storeResults(MOCK_URL, MOCK_HASH) + escrow.connect(externalAddress).storeResults(MOCK_URL, MOCK_HASH, 50) ).to.be.revertedWith('Address calling not trusted'); }); it('Should revert with the right error if address calling is reputation oracle', async function () { await expect( - escrow.connect(reputationOracle).storeResults(MOCK_URL, MOCK_HASH) + escrow.connect(reputationOracle).storeResults(MOCK_URL, MOCK_HASH, 50) ).to.be.revertedWith('Address calling not trusted'); }); - it('Should revert with the right error if escrow not in Pending or Partial status state', async function () { + it('Should revert with the right error if escrow not in Pending, Partial or ToCancel status state', async function () { + await escrow + .connect(owner) + .addTrustedHandlers([await reputationOracle.getAddress()]); + await expect( + escrow.connect(reputationOracle).storeResults(MOCK_URL, MOCK_HASH, 50) + ).to.be.revertedWith( + 'Escrow not in Pending, Partial or ToCancel status state' + ); + }); + + it('Should revert with the right error if amount sent is 0', async function () { + await fundEscrow(); + await setupEscrow(); + await escrow + .connect(owner) + .addTrustedHandlers([await reputationOracle.getAddress()]); + await expect( + escrow.connect(reputationOracle).storeResults(MOCK_URL, MOCK_HASH, 0) + ).to.be.revertedWith('Amount must be greater than zero'); + }); + + it('Should revert with the right error if amount is higher than unreserved funds', async function () { + await fundEscrow(); + await setupEscrow(); + await escrow .connect(owner) .addTrustedHandlers([await reputationOracle.getAddress()]); await expect( - escrow.connect(reputationOracle).storeResults(MOCK_URL, MOCK_HASH) - ).to.be.revertedWith('Escrow not in Pending or Partial status state'); + escrow + .connect(reputationOracle) + .storeResults(MOCK_URL, MOCK_HASH, 150) + ).to.be.revertedWith('Not enough unreserved funds'); }); }); @@ -230,7 +264,7 @@ describe('Escrow', function () { it('Should emit an event on intermediate storage', async function () { await expect( - await escrow.connect(owner).storeResults(MOCK_URL, MOCK_HASH) + await escrow.connect(owner).storeResults(MOCK_URL, MOCK_HASH, 50) ) .to.emit(escrow, 'IntermediateStorage') .withArgs(MOCK_URL, MOCK_HASH); @@ -238,32 +272,71 @@ describe('Escrow', function () { }); describe('Store results', async function () { - before(async () => { + beforeEach(async () => { await deployEscrow(); await fundEscrow(); await setupEscrow(); }); it('Should succeed when recording oracle stores results', async () => { + const initialOwnerBalance = await token + .connect(owner) + .balanceOf(launcher.getAddress()); const result = await ( await escrow .connect(recordingOracle) - .storeResults(MOCK_URL, MOCK_HASH) + .storeResults(MOCK_URL, MOCK_HASH, 50) ).wait(); + const finalOwnerBalance = await token + .connect(owner) + .balanceOf(launcher.getAddress()); expect((result?.logs[0] as EventLog).args).to.contain(MOCK_URL); expect((result?.logs[0] as EventLog).args).to.contain(MOCK_HASH); + expect(finalOwnerBalance - initialOwnerBalance).to.equal(0); + expect(await escrow.remainingFunds()).to.equal(100); + expect(await escrow.reservedFunds()).to.equal(50); }); it('Should succeed when a trusted handler stores results', async () => { + const initialOwnerBalance = await token + .connect(owner) + .balanceOf(launcher.getAddress()); const result = await ( await escrow .connect(trustedHandlers[0]) - .storeResults(MOCK_URL, MOCK_HASH) + .storeResults(MOCK_URL, MOCK_HASH, 50) ).wait(); + const finalOwnerBalance = await token + .connect(owner) + .balanceOf(launcher.getAddress()); expect((result?.logs[0] as EventLog).args).to.contain(MOCK_URL); expect((result?.logs[0] as EventLog).args).to.contain(MOCK_HASH); + expect(finalOwnerBalance - initialOwnerBalance).to.equal(0); + expect(await escrow.remainingFunds()).to.equal(100); + expect(await escrow.reservedFunds()).to.equal(50); + }); + + it('Should return unreserved funds to escrow launcher when status is ToCancel', async () => { + const initialOwnerBalance = await token + .connect(owner) + .balanceOf(launcher.getAddress()); + await (await escrow.connect(launcher).cancel()).wait(); + const result = await ( + await escrow + .connect(recordingOracle) + .storeResults(MOCK_URL, MOCK_HASH, 50) + ).wait(); + + expect((result?.logs[0] as EventLog).args).to.contain(MOCK_URL); + expect((result?.logs[0] as EventLog).args).to.contain(MOCK_HASH); + const finalOwnerBalance = await token + .connect(owner) + .balanceOf(launcher.getAddress()); + expect(finalOwnerBalance - initialOwnerBalance).to.equal(50); + expect(await escrow.remainingFunds()).to.equal(50); + expect(await escrow.reservedFunds()).to.equal(50); }); }); }); @@ -464,6 +537,7 @@ describe('Escrow', function () { await deployEscrow(); await fundEscrow(); await setupEscrow(); + await storeResults(100); await escrow .connect(owner) @@ -500,22 +574,26 @@ describe('Escrow', function () { it('Should succeed when the contract was canceled', async () => { await escrow.connect(owner).cancel(); - const ststus = await escrow.status(); - expect(ststus).to.equal(Status.Cancelled); - - expect( - await token.connect(owner).balanceOf(escrow.getAddress()) - ).to.equal('0', 'Escrow has not been properly canceled'); + const status = await escrow.status(); + expect(status).to.equal(Status.ToCancel); }); it('Should succeed when the contract was canceled by trusted handler', async () => { await escrow.connect(trustedHandlers[0]).cancel(); - const ststus = await escrow.status(); - expect(ststus).to.equal(Status.Cancelled); + const status = await escrow.status(); + expect(status).to.equal(Status.ToCancel); + }); - expect( - await token.connect(owner).balanceOf(escrow.getAddress()) - ).to.equal('0', 'Escrow has not been properly canceled'); + it('Should succeed when the contract was canceled', async () => { + await escrow.connect(owner).cancel(); + const status = await escrow.status(); + expect(status).to.equal(Status.ToCancel); + }); + + it('Should succeed when the contract was canceled by trusted handler', async () => { + await escrow.connect(trustedHandlers[0]).cancel(); + const status = await escrow.status(); + expect(status).to.equal(Status.ToCancel); }); }); }); @@ -526,6 +604,7 @@ describe('Escrow', function () { await deployEscrow(); await fundEscrow(); await setupEscrow(); + await storeResults(); }); it('Should revert with the right error if address calling is not trusted', async function () { @@ -602,13 +681,31 @@ describe('Escrow', function () { ](recepients, amounts, MOCK_URL, MOCK_HASH, '000') ).to.be.revertedWith('Too many recipients'); }); + + it('Should revert with the right error if trying to payout more than reservedFunds', async function () { + const recepients = [ + await restAccounts[0].getAddress(), + await restAccounts[1].getAddress(), + await restAccounts[2].getAddress(), + ]; + const amounts = [10, 20, 30]; + + await expect( + escrow + .connect(reputationOracle) + [ + 'bulkPayOut(address[],uint256[],string,string,uint256)' + ](recepients, amounts, MOCK_URL, MOCK_HASH, '000') + ).to.be.revertedWith('Not enough reserved funds'); + }); }); describe('Events', function () { - this.beforeEach(async () => { + beforeEach(async () => { await deployEscrow(); await fundEscrow(); await setupEscrow(); + await storeResults(100); }); it('Should emit bulkPayOut and Completed events for complete bulkPayOut', async function () { @@ -628,6 +725,25 @@ describe('Escrow', function () { await expect(tx).to.emit(escrow, 'Completed'); }); + it('Should emit bulkPayOut and Cancelled events for complete bulkPayOut with ToCancel status', async function () { + const recepients = [await restAccounts[0].getAddress()]; + const amounts = [100]; + + await escrow.connect(owner).cancel(); + + const tx = await escrow + .connect(owner) + [ + 'bulkPayOut(address[],uint256[],string,string,uint256)' + ](recepients, amounts, MOCK_URL, MOCK_HASH, '000'); + + await expect(tx) + .to.emit(escrow, 'BulkTransferV2') + .withArgs(anyValue, recepients, [100], false, MOCK_URL); + + await expect(tx).to.emit(escrow, 'Cancelled'); + }); + it('Should emit only bulkPayOut event for partial bulkPayOut', async function () { const recepients = [await restAccounts[0].getAddress()]; const amounts = [10]; @@ -661,12 +777,33 @@ describe('Escrow', function () { await expect(tx).to.emit(escrow, 'Completed'); }); + + it('Should emit bulkPayOut and Cancelled events for partial bulkPayOut with forceComplete option and ToCancel status', async function () { + const recepients = [await restAccounts[0].getAddress()]; + const amounts = [10]; + + await escrow.connect(owner).cancel(); + + const tx = await escrow + .connect(owner) + [ + 'bulkPayOut(address[],uint256[],string,string,uint256,bool)' + ](recepients, amounts, MOCK_URL, MOCK_HASH, '000', true); + + await expect(tx) + .to.emit(escrow, 'BulkTransferV2') + .withArgs(anyValue, recepients, [10], false, MOCK_URL); + + await expect(tx).to.emit(escrow, 'Cancelled'); + }); }); + describe('Bulk payout for recipients', async function () { beforeEach(async () => { await deployEscrow(); await fundEscrow(); await setupEscrow(); + await storeResults(100); }); it('Should pays each recipient their corresponding amount', async () => { @@ -868,6 +1005,26 @@ describe('Escrow', function () { expect(await escrow.status()).to.equal(Status.Complete); }); + it('Should runs from setup to bulkPayOut to Cancelled correctly with multiple addresses', async () => { + const recepients = [ + await restAccounts[3].getAddress(), + await restAccounts[4].getAddress(), + await restAccounts[5].getAddress(), + ]; + const amounts = [10, 20, 70]; + + await escrow.connect(owner).cancel(); + + expect(await escrow.status()).to.equal(Status.ToCancel); + + await escrow + .connect(reputationOracle) + [ + 'bulkPayOut(address[],uint256[],string,string,uint256)' + ](recepients, amounts, MOCK_URL, MOCK_HASH, '000'); + expect(await escrow.status()).to.equal(Status.Cancelled); + }); + it('Should runs from setup to bulkPayOut to partial correctly', async () => { const recepients = [await restAccounts[3].getAddress()]; const amounts = [80]; @@ -882,6 +1039,22 @@ describe('Escrow', function () { expect(await escrow.status()).to.equal(Status.Partial); }); + it('Should runs partial bulkPayOut without modifying status if status is ToCancel', async () => { + const recepients = [await restAccounts[3].getAddress()]; + const amounts = [80]; + + await escrow.connect(owner).cancel(); + + expect(await escrow.status()).to.equal(Status.ToCancel); + + await escrow + .connect(reputationOracle) + [ + 'bulkPayOut(address[],uint256[],string,string,uint256)' + ](recepients, amounts, MOCK_URL, MOCK_HASH, '000'); + expect(await escrow.status()).to.equal(Status.ToCancel); + }); + it('Should runs from setup to bulkPayOut to partial correctly with multiple addresses', async () => { const recepients = [ await restAccounts[3].getAddress(), @@ -901,15 +1074,17 @@ describe('Escrow', function () { }); }); }); + describe('complete', () => { describe('Validations', function () { beforeEach(async () => { await deployEscrow(); await fundEscrow(); await setupEscrow(); + await storeResults(); }); - it('Should revert with the right error if escrow not in Paid or Partial state', async function () { + it('Should revert with the right error if escrow not in Paid, Partial or ToCancel state', async function () { await expect(escrow.connect(owner).complete()).to.be.revertedWith( 'Escrow not in Paid or Partial state' ); @@ -921,6 +1096,7 @@ describe('Escrow', function () { await deployEscrow(); await fundEscrow(); await setupEscrow(); + await storeResults(); }); it('Should emit a Completed event when escrow is completed', async function () { @@ -945,6 +1121,7 @@ describe('Escrow', function () { await deployEscrow(); await fundEscrow(); await setupEscrow(); + await storeResults(); }); it('Should succeed if escrow is in Partial state', async function () { From 3f4dce8add57dd59f0c1f99e1b2b5b9a7c96a91f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Francisco=20L=C3=B3pez?= Date: Mon, 19 May 2025 17:54:22 +0200 Subject: [PATCH 02/18] Implemented sdk changes for new amount reservation in StoreResults --- ...human_protocol_sdk.escrow.escrow_client.md | 6 +- docs/sdk/python/human_protocol_sdk.filter.md | 4 +- .../base/classes/BaseEthersClient.md | 14 +-- .../encryption/classes/Encryption.md | 24 ++--- .../encryption/classes/EncryptionUtils.md | 18 ++-- .../typescript/enums/enumerations/ChainId.md | 18 ++-- .../enums/enumerations/OperatorCategory.md | 6 +- .../enums/enumerations/OrderDirection.md | 6 +- .../typescript/escrow/classes/EscrowClient.md | 101 ++++++++++-------- .../typescript/escrow/classes/EscrowUtils.md | 16 +-- .../types/type-aliases/DailyEscrowData.md | 28 ++++- .../types/type-aliases/DailyHMTData.md | 24 ++++- .../types/type-aliases/DailyPaymentData.md | 20 +++- .../types/type-aliases/DailyTaskData.md | 16 ++- .../types/type-aliases/DailyWorkerData.md | 12 ++- .../graphql/types/type-aliases/EscrowData.md | 80 +++++++++++++- .../types/type-aliases/EscrowStatistics.md | 12 ++- .../type-aliases/EscrowStatisticsData.md | 44 +++++++- .../types/type-aliases/EventDayData.md | 76 ++++++++++++- .../graphql/types/type-aliases/HMTHolder.md | 12 ++- .../types/type-aliases/HMTHolderData.md | 12 ++- .../types/type-aliases/HMTStatistics.md | 16 ++- .../types/type-aliases/HMTStatisticsData.md | 28 ++++- .../graphql/types/type-aliases/IMData.md | 4 +- .../types/type-aliases/IMDataEntity.md | 12 ++- .../graphql/types/type-aliases/KVStoreData.md | 28 ++++- .../types/type-aliases/PaymentStatistics.md | 8 +- .../graphql/types/type-aliases/PayoutData.md | 24 ++++- .../type-aliases/RewardAddedEventData.md | 20 +++- .../graphql/types/type-aliases/StatusEvent.md | 20 +++- .../types/type-aliases/TaskStatistics.md | 8 +- .../types/type-aliases/WorkerStatistics.md | 8 +- .../interfaces/interfaces/IEscrowConfig.md | 18 ++-- .../interfaces/interfaces/IEscrowsFilter.md | 26 ++--- .../interfaces/IHMTHoldersParams.md | 10 +- .../interfaces/interfaces/IKVStore.md | 6 +- .../interfaces/interfaces/IKeyPair.md | 10 +- .../interfaces/interfaces/IOperator.md | 46 ++++---- .../interfaces/IOperatorSubgraph.md | 44 ++++---- .../interfaces/interfaces/IOperatorsFilter.md | 16 +-- .../interfaces/interfaces/IPagination.md | 8 +- .../interfaces/interfaces/IPayoutFilter.md | 18 ++-- .../interfaces/IReputationNetwork.md | 8 +- .../interfaces/IReputationNetworkSubgraph.md | 8 +- .../interfaces/interfaces/IReward.md | 6 +- .../interfaces/IStatisticsFilter.md | 12 +-- .../interfaces/IStatusEventFilter.md | 18 ++-- .../interfaces/interfaces/ITransaction.md | 24 ++--- .../interfaces/ITransactionsFilter.md | 22 ++-- .../interfaces/interfaces/IWorker.md | 10 +- .../interfaces/interfaces/IWorkersFilter.md | 14 +-- .../interfaces/InternalTransaction.md | 16 +-- .../interfaces/interfaces/StakerInfo.md | 10 +- .../kvstore/classes/KVStoreClient.md | 38 +++---- .../kvstore/classes/KVStoreUtils.md | 16 +-- .../operator/classes/OperatorUtils.md | 18 ++-- .../staking/classes/StakingClient.md | 54 +++++----- .../statistics/classes/StatisticsClient.md | 26 ++--- .../storage/classes/StorageClient.md | 20 ++-- .../transaction/classes/TransactionUtils.md | 12 +-- .../types/enumerations/EscrowStatus.md | 14 +-- .../types/type-aliases/EscrowCancel.md | 12 ++- .../types/type-aliases/EscrowWithdraw.md | 16 ++- .../types/type-aliases/NetworkData.md | 48 ++++++++- .../typescript/types/type-aliases/Payout.md | 24 ++++- .../types/type-aliases/StorageCredentials.md | 20 ++-- .../types/type-aliases/StorageParams.md | 28 +++-- .../type-aliases/TransactionLikeWithNonce.md | 4 +- .../types/type-aliases/UploadFile.md | 16 ++- .../src/modules/job/job.service.ts | 13 ++- packages/core/contracts/Escrow.sol | 1 - packages/core/test/Escrow-USDT.ts | 11 -- packages/core/test/Escrow.ts | 11 -- .../escrow/escrow_client.py | 11 +- .../escrow/test_escrow_client.py | 45 ++++++-- .../human-protocol-sdk/src/error.ts | 5 + .../human-protocol-sdk/src/escrow.ts | 16 ++- .../human-protocol-sdk/test/escrow.test.ts | 55 ++++++++-- 78 files changed, 1087 insertions(+), 522 deletions(-) diff --git a/docs/sdk/python/human_protocol_sdk.escrow.escrow_client.md b/docs/sdk/python/human_protocol_sdk.escrow.escrow_client.md index 86d1fd9559..96dedb4d49 100644 --- a/docs/sdk/python/human_protocol_sdk.escrow.escrow_client.md +++ b/docs/sdk/python/human_protocol_sdk.escrow.escrow_client.md @@ -843,7 +843,7 @@ Sets up the parameters of the escrow. * **Return type:** `None` -#### store_results(escrow_address, url, hash, tx_options=None) +#### store_results(escrow_address, url, hash, amount, tx_options=None) Stores the results URL. @@ -851,6 +851,7 @@ Stores the results URL. * **escrow_address** (`str`) – Address of the escrow * **url** (`str`) – Results file URL * **hash** (`str`) – Results file hash + * **amount** (`Decimal`) – Amount to reserve for payouts * **tx_options** (`Optional`[`TxParams`]) – (Optional) Additional transaction parameters * **Return type:** `None` @@ -884,7 +885,8 @@ Stores the results URL. escrow_client.store_results( "0x62dD51230A30401C455c8398d06F85e4EaB6309f", "http://localhost/results.json", - "b5dad76bf6772c0f07fd5e048f6e75a5f86ee079" + "b5dad76bf6772c0f07fd5e048f6e75a5f86ee079", + Web3.to_wei(5, 'ether') ) ``` diff --git a/docs/sdk/python/human_protocol_sdk.filter.md b/docs/sdk/python/human_protocol_sdk.filter.md index ae0d301983..da7dec57ce 100644 --- a/docs/sdk/python/human_protocol_sdk.filter.md +++ b/docs/sdk/python/human_protocol_sdk.filter.md @@ -120,13 +120,13 @@ Initializes a TransactionsFilter instance. * **Raises:** **ValueError** – If start_date is after end_date -### *class* human_protocol_sdk.filter.WorkerFilter(chain_id, worker_address=None, order_by=None, order_direction=OrderDirection.DESC, first=10, skip=0) +### *class* human_protocol_sdk.filter.WorkerFilter(chain_id, worker_address=None, order_by='payoutCount', order_direction=OrderDirection.DESC, first=10, skip=0) Bases: `object` A class used to filter workers. -#### \_\_init_\_(chain_id, worker_address=None, order_by=None, order_direction=OrderDirection.DESC, first=10, skip=0) +#### \_\_init_\_(chain_id, worker_address=None, order_by='payoutCount', order_direction=OrderDirection.DESC, first=10, skip=0) Initializes a WorkerFilter instance. diff --git a/docs/sdk/typescript/base/classes/BaseEthersClient.md b/docs/sdk/typescript/base/classes/BaseEthersClient.md index a0277ae359..6de540eeba 100644 --- a/docs/sdk/typescript/base/classes/BaseEthersClient.md +++ b/docs/sdk/typescript/base/classes/BaseEthersClient.md @@ -6,7 +6,7 @@ # Class: `abstract` BaseEthersClient -Defined in: [base.ts:10](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L10) +Defined in: [base.ts:10](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L10) ## Introduction @@ -20,11 +20,11 @@ This class is used as a base class for other clients making on-chain calls. ## Constructors -### new BaseEthersClient() +### Constructor -> **new BaseEthersClient**(`runner`, `networkData`): [`BaseEthersClient`](BaseEthersClient.md) +> **new BaseEthersClient**(`runner`, `networkData`): `BaseEthersClient` -Defined in: [base.ts:20](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L20) +Defined in: [base.ts:20](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L20) **BaseClient constructor** @@ -44,7 +44,7 @@ The network information required to connect to the contracts #### Returns -[`BaseEthersClient`](BaseEthersClient.md) +`BaseEthersClient` ## Properties @@ -52,7 +52,7 @@ The network information required to connect to the contracts > **networkData**: [`NetworkData`](../../types/type-aliases/NetworkData.md) -Defined in: [base.ts:12](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L12) +Defined in: [base.ts:12](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L12) *** @@ -60,4 +60,4 @@ Defined in: [base.ts:12](https://github.com/humanprotocol/human-protocol/blob/1f > `protected` **runner**: `ContractRunner` -Defined in: [base.ts:11](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L11) +Defined in: [base.ts:11](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L11) diff --git a/docs/sdk/typescript/encryption/classes/Encryption.md b/docs/sdk/typescript/encryption/classes/Encryption.md index 822c353959..38f9ab4994 100644 --- a/docs/sdk/typescript/encryption/classes/Encryption.md +++ b/docs/sdk/typescript/encryption/classes/Encryption.md @@ -6,7 +6,7 @@ # Class: Encryption -Defined in: [encryption.ts:58](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L58) +Defined in: [encryption.ts:58](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L58) ## Introduction @@ -49,11 +49,11 @@ const encryption = await Encryption.build(privateKey, passphrase); ## Constructors -### new Encryption() +### Constructor -> **new Encryption**(`privateKey`): [`Encryption`](Encryption.md) +> **new Encryption**(`privateKey`): `Encryption` -Defined in: [encryption.ts:66](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L66) +Defined in: [encryption.ts:66](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L66) Constructor for the Encryption class. @@ -67,15 +67,15 @@ The private key. #### Returns -[`Encryption`](Encryption.md) +`Encryption` ## Methods ### decrypt() -> **decrypt**(`message`, `publicKey`?): `Promise`\<`Uint8Array`\<`ArrayBufferLike`\>\> +> **decrypt**(`message`, `publicKey?`): `Promise`\<`Uint8Array`\<`ArrayBufferLike`\>\> -Defined in: [encryption.ts:194](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L194) +Defined in: [encryption.ts:194](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L194) This function decrypts messages using the private key. In addition, the public key can be added for signature verification. @@ -129,7 +129,7 @@ const resultMessage = await encryption.decrypt('message'); > **sign**(`message`): `Promise`\<`string`\> -Defined in: [encryption.ts:251](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L251) +Defined in: [encryption.ts:251](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L251) This function signs a message using the private key used to initialize the client. @@ -165,7 +165,7 @@ const resultMessage = await encryption.sign('message'); > **signAndEncrypt**(`message`, `publicKeys`): `Promise`\<`string`\> -Defined in: [encryption.ts:142](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L142) +Defined in: [encryption.ts:142](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L142) This function signs and encrypts a message using the private key used to initialize the client and the specified public keys. @@ -230,9 +230,9 @@ const resultMessage = await encryption.signAndEncrypt('message', publicKeys); ### build() -> `static` **build**(`privateKeyArmored`, `passphrase`?): `Promise`\<[`Encryption`](Encryption.md)\> +> `static` **build**(`privateKeyArmored`, `passphrase?`): `Promise`\<`Encryption`\> -Defined in: [encryption.ts:77](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L77) +Defined in: [encryption.ts:77](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L77) Builds an Encryption instance by decrypting the private key from an encrypted private key and passphrase. @@ -252,6 +252,6 @@ Optional: The passphrase for the private key. #### Returns -`Promise`\<[`Encryption`](Encryption.md)\> +`Promise`\<`Encryption`\> - The Encryption instance. diff --git a/docs/sdk/typescript/encryption/classes/EncryptionUtils.md b/docs/sdk/typescript/encryption/classes/EncryptionUtils.md index 8d1127cea6..1026c02235 100644 --- a/docs/sdk/typescript/encryption/classes/EncryptionUtils.md +++ b/docs/sdk/typescript/encryption/classes/EncryptionUtils.md @@ -6,7 +6,7 @@ # Class: EncryptionUtils -Defined in: [encryption.ts:290](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L290) +Defined in: [encryption.ts:290](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L290) ## Introduction @@ -34,13 +34,13 @@ const keyPair = await EncryptionUtils.generateKeyPair('Human', 'human@hmt.ai'); ## Constructors -### new EncryptionUtils() +### Constructor -> **new EncryptionUtils**(): [`EncryptionUtils`](EncryptionUtils.md) +> **new EncryptionUtils**(): `EncryptionUtils` #### Returns -[`EncryptionUtils`](EncryptionUtils.md) +`EncryptionUtils` ## Methods @@ -48,7 +48,7 @@ const keyPair = await EncryptionUtils.generateKeyPair('Human', 'human@hmt.ai'); > `static` **encrypt**(`message`, `publicKeys`): `Promise`\<`string`\> -Defined in: [encryption.ts:444](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L444) +Defined in: [encryption.ts:444](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L444) This function encrypts a message using the specified public keys. @@ -111,7 +111,7 @@ const result = await EncryptionUtils.encrypt('message', publicKeys); > `static` **generateKeyPair**(`name`, `email`, `passphrase`): `Promise`\<[`IKeyPair`](../../interfaces/interfaces/IKeyPair.md)\> -Defined in: [encryption.ts:382](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L382) +Defined in: [encryption.ts:382](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L382) This function generates a key pair for encryption and decryption. @@ -158,7 +158,7 @@ const result = await EncryptionUtils.generateKeyPair(name, email, passphrase); > `static` **getSignedData**(`message`): `Promise`\<`string`\> -Defined in: [encryption.ts:351](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L351) +Defined in: [encryption.ts:351](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L351) This function gets signed data from a signed message. @@ -190,7 +190,7 @@ const signedData = await EncryptionUtils.getSignedData('message'); > `static` **isEncrypted**(`message`): `boolean` -Defined in: [encryption.ts:494](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L494) +Defined in: [encryption.ts:494](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L494) Verifies if a message appears to be encrypted with OpenPGP. @@ -238,7 +238,7 @@ if (isEncrypted) { > `static` **verify**(`message`, `publicKey`): `Promise`\<`boolean`\> -Defined in: [encryption.ts:318](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L318) +Defined in: [encryption.ts:318](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L318) This function verifies the signature of a signed message using the public key. diff --git a/docs/sdk/typescript/enums/enumerations/ChainId.md b/docs/sdk/typescript/enums/enumerations/ChainId.md index 5627a76ac9..c8a3f014e2 100644 --- a/docs/sdk/typescript/enums/enumerations/ChainId.md +++ b/docs/sdk/typescript/enums/enumerations/ChainId.md @@ -6,7 +6,7 @@ # Enumeration: ChainId -Defined in: [enums.ts:1](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L1) +Defined in: [enums.ts:1](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L1) ## Enumeration Members @@ -14,7 +14,7 @@ Defined in: [enums.ts:1](https://github.com/humanprotocol/human-protocol/blob/1f > **ALL**: `-1` -Defined in: [enums.ts:2](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L2) +Defined in: [enums.ts:2](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L2) *** @@ -22,7 +22,7 @@ Defined in: [enums.ts:2](https://github.com/humanprotocol/human-protocol/blob/1f > **BSC\_MAINNET**: `56` -Defined in: [enums.ts:5](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L5) +Defined in: [enums.ts:5](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L5) *** @@ -30,7 +30,7 @@ Defined in: [enums.ts:5](https://github.com/humanprotocol/human-protocol/blob/1f > **BSC\_TESTNET**: `97` -Defined in: [enums.ts:6](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L6) +Defined in: [enums.ts:6](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L6) *** @@ -38,7 +38,7 @@ Defined in: [enums.ts:6](https://github.com/humanprotocol/human-protocol/blob/1f > **LOCALHOST**: `1338` -Defined in: [enums.ts:9](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L9) +Defined in: [enums.ts:9](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L9) *** @@ -46,7 +46,7 @@ Defined in: [enums.ts:9](https://github.com/humanprotocol/human-protocol/blob/1f > **MAINNET**: `1` -Defined in: [enums.ts:3](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L3) +Defined in: [enums.ts:3](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L3) *** @@ -54,7 +54,7 @@ Defined in: [enums.ts:3](https://github.com/humanprotocol/human-protocol/blob/1f > **POLYGON**: `137` -Defined in: [enums.ts:7](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L7) +Defined in: [enums.ts:7](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L7) *** @@ -62,7 +62,7 @@ Defined in: [enums.ts:7](https://github.com/humanprotocol/human-protocol/blob/1f > **POLYGON\_AMOY**: `80002` -Defined in: [enums.ts:8](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L8) +Defined in: [enums.ts:8](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L8) *** @@ -70,4 +70,4 @@ Defined in: [enums.ts:8](https://github.com/humanprotocol/human-protocol/blob/1f > **SEPOLIA**: `11155111` -Defined in: [enums.ts:4](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L4) +Defined in: [enums.ts:4](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L4) diff --git a/docs/sdk/typescript/enums/enumerations/OperatorCategory.md b/docs/sdk/typescript/enums/enumerations/OperatorCategory.md index 3d5d13af20..ea4c15d6ab 100644 --- a/docs/sdk/typescript/enums/enumerations/OperatorCategory.md +++ b/docs/sdk/typescript/enums/enumerations/OperatorCategory.md @@ -6,7 +6,7 @@ # Enumeration: OperatorCategory -Defined in: [enums.ts:17](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L17) +Defined in: [enums.ts:17](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L17) ## Enumeration Members @@ -14,7 +14,7 @@ Defined in: [enums.ts:17](https://github.com/humanprotocol/human-protocol/blob/1 > **MACHINE\_LEARNING**: `"machine_learning"` -Defined in: [enums.ts:18](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L18) +Defined in: [enums.ts:18](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L18) *** @@ -22,4 +22,4 @@ Defined in: [enums.ts:18](https://github.com/humanprotocol/human-protocol/blob/1 > **MARKET\_MAKING**: `"market_making"` -Defined in: [enums.ts:19](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L19) +Defined in: [enums.ts:19](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L19) diff --git a/docs/sdk/typescript/enums/enumerations/OrderDirection.md b/docs/sdk/typescript/enums/enumerations/OrderDirection.md index e980964850..9f6809c5d4 100644 --- a/docs/sdk/typescript/enums/enumerations/OrderDirection.md +++ b/docs/sdk/typescript/enums/enumerations/OrderDirection.md @@ -6,7 +6,7 @@ # Enumeration: OrderDirection -Defined in: [enums.ts:12](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L12) +Defined in: [enums.ts:12](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L12) ## Enumeration Members @@ -14,7 +14,7 @@ Defined in: [enums.ts:12](https://github.com/humanprotocol/human-protocol/blob/1 > **ASC**: `"asc"` -Defined in: [enums.ts:13](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L13) +Defined in: [enums.ts:13](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L13) *** @@ -22,4 +22,4 @@ Defined in: [enums.ts:13](https://github.com/humanprotocol/human-protocol/blob/1 > **DESC**: `"desc"` -Defined in: [enums.ts:14](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L14) +Defined in: [enums.ts:14](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L14) diff --git a/docs/sdk/typescript/escrow/classes/EscrowClient.md b/docs/sdk/typescript/escrow/classes/EscrowClient.md index 445e354d15..88ed51f62b 100644 --- a/docs/sdk/typescript/escrow/classes/EscrowClient.md +++ b/docs/sdk/typescript/escrow/classes/EscrowClient.md @@ -6,7 +6,7 @@ # Class: EscrowClient -Defined in: [escrow.ts:141](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L141) +Defined in: [escrow.ts:141](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L141) ## Introduction @@ -82,11 +82,11 @@ const escrowClient = await EscrowClient.build(provider); ## Constructors -### new EscrowClient() +### Constructor -> **new EscrowClient**(`runner`, `networkData`): [`EscrowClient`](EscrowClient.md) +> **new EscrowClient**(`runner`, `networkData`): `EscrowClient` -Defined in: [escrow.ts:150](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L150) +Defined in: [escrow.ts:150](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L150) **EscrowClient constructor** @@ -106,11 +106,11 @@ The network information required to connect to the Escrow contract #### Returns -[`EscrowClient`](EscrowClient.md) +`EscrowClient` #### Overrides -[`BaseEthersClient`](../../base/classes/BaseEthersClient.md).[`constructor`](../../base/classes/BaseEthersClient.md#constructors) +[`BaseEthersClient`](../../base/classes/BaseEthersClient.md).[`constructor`](../../base/classes/BaseEthersClient.md#constructor) ## Properties @@ -118,11 +118,11 @@ The network information required to connect to the Escrow contract > **networkData**: [`NetworkData`](../../types/type-aliases/NetworkData.md) -Defined in: [base.ts:12](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L12) +Defined in: [base.ts:12](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L12) #### Inherited from -[`BaseEthersClient`](../../base/classes/BaseEthersClient.md).[`networkData`](../../base/classes/BaseEthersClient.md#networkdata-1) +[`BaseEthersClient`](../../base/classes/BaseEthersClient.md).[`networkData`](../../base/classes/BaseEthersClient.md#networkdata) *** @@ -130,19 +130,19 @@ Defined in: [base.ts:12](https://github.com/humanprotocol/human-protocol/blob/1f > `protected` **runner**: `ContractRunner` -Defined in: [base.ts:11](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L11) +Defined in: [base.ts:11](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L11) #### Inherited from -[`BaseEthersClient`](../../base/classes/BaseEthersClient.md).[`runner`](../../base/classes/BaseEthersClient.md#runner-1) +[`BaseEthersClient`](../../base/classes/BaseEthersClient.md).[`runner`](../../base/classes/BaseEthersClient.md#runner) ## Methods ### addTrustedHandlers() -> **addTrustedHandlers**(`escrowAddress`, `trustedHandlers`, `txOptions`?): `Promise`\<`void`\> +> **addTrustedHandlers**(`escrowAddress`, `trustedHandlers`, `txOptions?`): `Promise`\<`void`\> -Defined in: [escrow.ts:778](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L778) +Defined in: [escrow.ts:786](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L786) This function adds an array of addresses to the trusted handlers list. @@ -195,9 +195,9 @@ await escrowClient.addTrustedHandlers('0x62dD51230A30401C455c8398d06F85e4EaB6309 ### bulkPayOut() -> **bulkPayOut**(`escrowAddress`, `recipients`, `amounts`, `finalResultsUrl`, `finalResultsHash`, `txId`, `forceComplete`, `txOptions`?): `Promise`\<`void`\> +> **bulkPayOut**(`escrowAddress`, `recipients`, `amounts`, `finalResultsUrl`, `finalResultsHash`, `txId`, `forceComplete`, `txOptions?`): `Promise`\<`void`\> -Defined in: [escrow.ts:611](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L611) +Defined in: [escrow.ts:619](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L619) This function pays out the amounts specified to the workers and sets the URL of the final results file. @@ -285,9 +285,9 @@ await escrowClient.bulkPayOut('0x62dD51230A30401C455c8398d06F85e4EaB6309f', reci ### cancel() -> **cancel**(`escrowAddress`, `txOptions`?): `Promise`\<[`EscrowCancel`](../../types/type-aliases/EscrowCancel.md)\> +> **cancel**(`escrowAddress`, `txOptions?`): `Promise`\<[`EscrowCancel`](../../types/type-aliases/EscrowCancel.md)\> -Defined in: [escrow.ts:692](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L692) +Defined in: [escrow.ts:700](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L700) This function cancels the specified escrow and sends the balance to the canceler. @@ -333,9 +333,9 @@ await escrowClient.cancel('0x62dD51230A30401C455c8398d06F85e4EaB6309f'); ### complete() -> **complete**(`escrowAddress`, `txOptions`?): `Promise`\<`void`\> +> **complete**(`escrowAddress`, `txOptions?`): `Promise`\<`void`\> -Defined in: [escrow.ts:550](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L550) +Defined in: [escrow.ts:558](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L558) This function sets the status of an escrow to completed. @@ -381,9 +381,9 @@ await escrowClient.complete('0x62dD51230A30401C455c8398d06F85e4EaB6309f'); ### createBulkPayoutTransaction() -> **createBulkPayoutTransaction**(`escrowAddress`, `recipients`, `amounts`, `finalResultsUrl`, `finalResultsHash`, `txId`, `forceComplete`, `txOptions`?): `Promise`\<[`TransactionLikeWithNonce`](../../types/type-aliases/TransactionLikeWithNonce.md)\> +> **createBulkPayoutTransaction**(`escrowAddress`, `recipients`, `amounts`, `finalResultsUrl`, `finalResultsHash`, `txId`, `forceComplete`, `txOptions?`): `Promise`\<[`TransactionLikeWithNonce`](../../types/type-aliases/TransactionLikeWithNonce.md)\> -Defined in: [escrow.ts:947](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L947) +Defined in: [escrow.ts:956](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L956) Creates a prepared transaction for bulk payout without immediately sending it. @@ -470,14 +470,15 @@ console.log('Raw transaction:', rawTransaction); const signedTransaction = await signer.signTransaction(rawTransaction); console.log('Tx hash:', ethers.keccak256(signedTransaction)); (await signer.sendTransaction(rawTransaction)).wait(); +``` *** ### createEscrow() -> **createEscrow**(`tokenAddress`, `trustedHandlers`, `jobRequesterId`, `txOptions`?): `Promise`\<`string`\> +> **createEscrow**(`tokenAddress`, `trustedHandlers`, `jobRequesterId`, `txOptions?`): `Promise`\<`string`\> -Defined in: [escrow.ts:230](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L230) +Defined in: [escrow.ts:230](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L230) This function creates an escrow contract that uses the token passed to pay oracle fees and reward workers. @@ -538,9 +539,9 @@ const escrowAddress = await escrowClient.createEscrow(tokenAddress, trustedHandl ### fund() -> **fund**(`escrowAddress`, `amount`, `txOptions`?): `Promise`\<`void`\> +> **fund**(`escrowAddress`, `amount`, `txOptions?`): `Promise`\<`void`\> -Defined in: [escrow.ts:421](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L421) +Defined in: [escrow.ts:421](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L421) This function adds funds of the chosen token to the escrow. @@ -593,7 +594,7 @@ await escrowClient.fund('0x62dD51230A30401C455c8398d06F85e4EaB6309f', amount); > **getBalance**(`escrowAddress`): `Promise`\<`bigint`\> -Defined in: [escrow.ts:1092](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1092) +Defined in: [escrow.ts:1101](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1101) This function returns the balance for a specified escrow address. @@ -631,7 +632,7 @@ const balance = await escrowClient.getBalance('0x62dD51230A30401C455c8398d06F85e > **getExchangeOracleAddress**(`escrowAddress`): `Promise`\<`string`\> -Defined in: [escrow.ts:1478](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1478) +Defined in: [escrow.ts:1487](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1487) This function returns the exchange oracle address for a given escrow. @@ -669,7 +670,7 @@ const oracleAddress = await escrowClient.getExchangeOracleAddress('0x62dD51230A3 > **getFactoryAddress**(`escrowAddress`): `Promise`\<`string`\> -Defined in: [escrow.ts:1516](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1516) +Defined in: [escrow.ts:1525](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1525) This function returns the escrow factory address for a given escrow. @@ -707,7 +708,7 @@ const factoryAddress = await escrowClient.getFactoryAddress('0x62dD51230A30401C4 > **getIntermediateResultsUrl**(`escrowAddress`): `Promise`\<`string`\> -Defined in: [escrow.ts:1250](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1250) +Defined in: [escrow.ts:1259](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1259) This function returns the intermediate results file URL. @@ -745,7 +746,7 @@ const intermediateResultsUrl = await escrowClient.getIntermediateResultsUrl('0x6 > **getJobLauncherAddress**(`escrowAddress`): `Promise`\<`string`\> -Defined in: [escrow.ts:1402](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1402) +Defined in: [escrow.ts:1411](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1411) This function returns the job launcher address for a given escrow. @@ -783,7 +784,7 @@ const jobLauncherAddress = await escrowClient.getJobLauncherAddress('0x62dD51230 > **getManifestHash**(`escrowAddress`): `Promise`\<`string`\> -Defined in: [escrow.ts:1136](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1136) +Defined in: [escrow.ts:1145](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1145) This function returns the manifest file hash. @@ -821,7 +822,7 @@ const manifestHash = await escrowClient.getManifestHash('0x62dD51230A30401C455c8 > **getManifestUrl**(`escrowAddress`): `Promise`\<`string`\> -Defined in: [escrow.ts:1174](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1174) +Defined in: [escrow.ts:1183](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1183) This function returns the manifest file URL. @@ -859,7 +860,7 @@ const manifestUrl = await escrowClient.getManifestUrl('0x62dD51230A30401C455c839 > **getRecordingOracleAddress**(`escrowAddress`): `Promise`\<`string`\> -Defined in: [escrow.ts:1364](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1364) +Defined in: [escrow.ts:1373](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1373) This function returns the recording oracle address for a given escrow. @@ -897,7 +898,7 @@ const oracleAddress = await escrowClient.getRecordingOracleAddress('0x62dD51230A > **getReputationOracleAddress**(`escrowAddress`): `Promise`\<`string`\> -Defined in: [escrow.ts:1440](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1440) +Defined in: [escrow.ts:1449](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1449) This function returns the reputation oracle address for a given escrow. @@ -935,7 +936,7 @@ const oracleAddress = await escrowClient.getReputationOracleAddress('0x62dD51230 > **getResultsUrl**(`escrowAddress`): `Promise`\<`string`\> -Defined in: [escrow.ts:1212](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1212) +Defined in: [escrow.ts:1221](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1221) This function returns the results file URL. @@ -973,7 +974,7 @@ const resultsUrl = await escrowClient.getResultsUrl('0x62dD51230A30401C455c8398d > **getStatus**(`escrowAddress`): `Promise`\<[`EscrowStatus`](../../types/enumerations/EscrowStatus.md)\> -Defined in: [escrow.ts:1326](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1326) +Defined in: [escrow.ts:1335](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1335) This function returns the current status of the escrow. @@ -1011,7 +1012,7 @@ const status = await escrowClient.getStatus('0x62dD51230A30401C455c8398d06F85e4E > **getTokenAddress**(`escrowAddress`): `Promise`\<`string`\> -Defined in: [escrow.ts:1288](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1288) +Defined in: [escrow.ts:1297](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1297) This function returns the token address used for funding the escrow. @@ -1047,9 +1048,9 @@ const tokenAddress = await escrowClient.getTokenAddress('0x62dD51230A30401C455c8 ### setup() -> **setup**(`escrowAddress`, `escrowConfig`, `txOptions`?): `Promise`\<`void`\> +> **setup**(`escrowAddress`, `escrowConfig`, `txOptions?`): `Promise`\<`void`\> -Defined in: [escrow.ts:311](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L311) +Defined in: [escrow.ts:311](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L311) This function sets up the parameters of the escrow. @@ -1112,11 +1113,11 @@ await escrowClient.setup(escrowAddress, escrowConfig); ### storeResults() -> **storeResults**(`escrowAddress`, `url`, `hash`, `txOptions`?): `Promise`\<`void`\> +> **storeResults**(`escrowAddress`, `url`, `hash`, `amount`, `txOptions?`): `Promise`\<`void`\> -Defined in: [escrow.ts:486](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L486) +Defined in: [escrow.ts:487](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L487) -This function stores the results URL and hash. +This function stores the results URL and hash, and reserves the specified amount of funds. #### Parameters @@ -1138,6 +1139,12 @@ Results file URL. Results file hash. +##### amount + +`bigint` + +Amount to reserve for payouts. + ##### txOptions? `Overrides` = `{}` @@ -1165,16 +1172,16 @@ const provider = new providers.JsonRpcProvider(rpcUrl); const signer = new Wallet(privateKey, provider); const escrowClient = await EscrowClient.build(signer); -await escrowClient.storeResults('0x62dD51230A30401C455c8398d06F85e4EaB6309f', 'http://localhost/results.json', 'b5dad76bf6772c0f07fd5e048f6e75a5f86ee079'); +await escrowClient.storeResults('0x62dD51230A30401C455c8398d06F85e4EaB6309f', 'http://localhost/results.json', 'b5dad76bf6772c0f07fd5e048f6e75a5f86ee079', 50n); ``` *** ### withdraw() -> **withdraw**(`escrowAddress`, `tokenAddress`, `txOptions`?): `Promise`\<[`EscrowWithdraw`](../../types/type-aliases/EscrowWithdraw.md)\> +> **withdraw**(`escrowAddress`, `tokenAddress`, `txOptions?`): `Promise`\<[`EscrowWithdraw`](../../types/type-aliases/EscrowWithdraw.md)\> -Defined in: [escrow.ts:844](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L844) +Defined in: [escrow.ts:852](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L852) This function withdraws additional tokens in the escrow to the canceler. @@ -1229,9 +1236,9 @@ await escrowClient.withdraw( ### build() -> `static` **build**(`runner`): `Promise`\<[`EscrowClient`](EscrowClient.md)\> +> `static` **build**(`runner`): `Promise`\<`EscrowClient`\> -Defined in: [escrow.ts:168](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L168) +Defined in: [escrow.ts:168](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L168) Creates an instance of EscrowClient from a Runner. @@ -1245,7 +1252,7 @@ The Runner object to interact with the Ethereum network #### Returns -`Promise`\<[`EscrowClient`](EscrowClient.md)\> +`Promise`\<`EscrowClient`\> An instance of EscrowClient diff --git a/docs/sdk/typescript/escrow/classes/EscrowUtils.md b/docs/sdk/typescript/escrow/classes/EscrowUtils.md index 7622cb9120..fb30eb0cce 100644 --- a/docs/sdk/typescript/escrow/classes/EscrowUtils.md +++ b/docs/sdk/typescript/escrow/classes/EscrowUtils.md @@ -6,7 +6,7 @@ # Class: EscrowUtils -Defined in: [escrow.ts:1565](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1565) +Defined in: [escrow.ts:1574](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1574) ## Introduction @@ -40,13 +40,13 @@ const escrowAddresses = new EscrowUtils.getEscrows({ ## Constructors -### new EscrowUtils() +### Constructor -> **new EscrowUtils**(): [`EscrowUtils`](EscrowUtils.md) +> **new EscrowUtils**(): `EscrowUtils` #### Returns -[`EscrowUtils`](EscrowUtils.md) +`EscrowUtils` ## Methods @@ -54,7 +54,7 @@ const escrowAddresses = new EscrowUtils.getEscrows({ > `static` **getEscrow**(`chainId`, `escrowAddress`): `Promise`\<[`EscrowData`](../../graphql/types/type-aliases/EscrowData.md)\> -Defined in: [escrow.ts:1780](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1780) +Defined in: [escrow.ts:1789](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1789) This function returns the escrow data for a given address. @@ -133,7 +133,7 @@ const escrowData = new EscrowUtils.getEscrow(ChainId.POLYGON_AMOY, "0x1234567890 > `static` **getEscrows**(`filter`): `Promise`\<[`EscrowData`](../../graphql/types/type-aliases/EscrowData.md)[]\> -Defined in: [escrow.ts:1662](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1662) +Defined in: [escrow.ts:1671](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1671) This function returns an array of escrows based on the specified filter parameters. @@ -245,7 +245,7 @@ const escrowDatas = await EscrowUtils.getEscrows(filters); > `static` **getPayouts**(`filter`): `Promise`\<[`Payout`](../../types/type-aliases/Payout.md)[]\> -Defined in: [escrow.ts:1950](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1950) +Defined in: [escrow.ts:1959](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1959) This function returns the payouts for a given set of networks. @@ -289,7 +289,7 @@ console.log(payouts); > `static` **getStatusEvents**(`filter`): `Promise`\<[`StatusEvent`](../../graphql/types/type-aliases/StatusEvent.md)[]\> -Defined in: [escrow.ts:1859](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1859) +Defined in: [escrow.ts:1868](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1868) This function returns the status events for a given set of networks within an optional date range. diff --git a/docs/sdk/typescript/graphql/types/type-aliases/DailyEscrowData.md b/docs/sdk/typescript/graphql/types/type-aliases/DailyEscrowData.md index d1338d66b5..099c5b5605 100644 --- a/docs/sdk/typescript/graphql/types/type-aliases/DailyEscrowData.md +++ b/docs/sdk/typescript/graphql/types/type-aliases/DailyEscrowData.md @@ -6,32 +6,54 @@ # Type Alias: DailyEscrowData -> **DailyEscrowData**: `object` +> **DailyEscrowData** = `object` -Defined in: [graphql/types.ts:83](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L83) +Defined in: [graphql/types.ts:83](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L83) -## Type declaration +## Properties ### escrowsCancelled > **escrowsCancelled**: `number` +Defined in: [graphql/types.ts:89](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L89) + +*** + ### escrowsPaid > **escrowsPaid**: `number` +Defined in: [graphql/types.ts:88](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L88) + +*** + ### escrowsPending > **escrowsPending**: `number` +Defined in: [graphql/types.ts:86](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L86) + +*** + ### escrowsSolved > **escrowsSolved**: `number` +Defined in: [graphql/types.ts:87](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L87) + +*** + ### escrowsTotal > **escrowsTotal**: `number` +Defined in: [graphql/types.ts:85](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L85) + +*** + ### timestamp > **timestamp**: `Date` + +Defined in: [graphql/types.ts:84](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L84) diff --git a/docs/sdk/typescript/graphql/types/type-aliases/DailyHMTData.md b/docs/sdk/typescript/graphql/types/type-aliases/DailyHMTData.md index 9244bdd1ec..d462fc66dd 100644 --- a/docs/sdk/typescript/graphql/types/type-aliases/DailyHMTData.md +++ b/docs/sdk/typescript/graphql/types/type-aliases/DailyHMTData.md @@ -6,28 +6,46 @@ # Type Alias: DailyHMTData -> **DailyHMTData**: `object` +> **DailyHMTData** = `object` -Defined in: [graphql/types.ts:127](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L127) +Defined in: [graphql/types.ts:127](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L127) -## Type declaration +## Properties ### dailyUniqueReceivers > **dailyUniqueReceivers**: `number` +Defined in: [graphql/types.ts:132](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L132) + +*** + ### dailyUniqueSenders > **dailyUniqueSenders**: `number` +Defined in: [graphql/types.ts:131](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L131) + +*** + ### timestamp > **timestamp**: `Date` +Defined in: [graphql/types.ts:128](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L128) + +*** + ### totalTransactionAmount > **totalTransactionAmount**: `bigint` +Defined in: [graphql/types.ts:129](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L129) + +*** + ### totalTransactionCount > **totalTransactionCount**: `number` + +Defined in: [graphql/types.ts:130](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L130) diff --git a/docs/sdk/typescript/graphql/types/type-aliases/DailyPaymentData.md b/docs/sdk/typescript/graphql/types/type-aliases/DailyPaymentData.md index 5407a1faf6..2e99abe95c 100644 --- a/docs/sdk/typescript/graphql/types/type-aliases/DailyPaymentData.md +++ b/docs/sdk/typescript/graphql/types/type-aliases/DailyPaymentData.md @@ -6,24 +6,38 @@ # Type Alias: DailyPaymentData -> **DailyPaymentData**: `object` +> **DailyPaymentData** = `object` -Defined in: [graphql/types.ts:106](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L106) +Defined in: [graphql/types.ts:106](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L106) -## Type declaration +## Properties ### averageAmountPerWorker > **averageAmountPerWorker**: `bigint` +Defined in: [graphql/types.ts:110](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L110) + +*** + ### timestamp > **timestamp**: `Date` +Defined in: [graphql/types.ts:107](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L107) + +*** + ### totalAmountPaid > **totalAmountPaid**: `bigint` +Defined in: [graphql/types.ts:108](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L108) + +*** + ### totalCount > **totalCount**: `number` + +Defined in: [graphql/types.ts:109](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L109) diff --git a/docs/sdk/typescript/graphql/types/type-aliases/DailyTaskData.md b/docs/sdk/typescript/graphql/types/type-aliases/DailyTaskData.md index 32d8aac1c6..5eedf9a297 100644 --- a/docs/sdk/typescript/graphql/types/type-aliases/DailyTaskData.md +++ b/docs/sdk/typescript/graphql/types/type-aliases/DailyTaskData.md @@ -6,20 +6,30 @@ # Type Alias: DailyTaskData -> **DailyTaskData**: `object` +> **DailyTaskData** = `object` -Defined in: [graphql/types.ts:148](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L148) +Defined in: [graphql/types.ts:148](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L148) -## Type declaration +## Properties ### tasksSolved > **tasksSolved**: `number` +Defined in: [graphql/types.ts:151](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L151) + +*** + ### tasksTotal > **tasksTotal**: `number` +Defined in: [graphql/types.ts:150](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L150) + +*** + ### timestamp > **timestamp**: `Date` + +Defined in: [graphql/types.ts:149](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L149) diff --git a/docs/sdk/typescript/graphql/types/type-aliases/DailyWorkerData.md b/docs/sdk/typescript/graphql/types/type-aliases/DailyWorkerData.md index decaf5e782..3f0de1eda1 100644 --- a/docs/sdk/typescript/graphql/types/type-aliases/DailyWorkerData.md +++ b/docs/sdk/typescript/graphql/types/type-aliases/DailyWorkerData.md @@ -6,16 +6,22 @@ # Type Alias: DailyWorkerData -> **DailyWorkerData**: `object` +> **DailyWorkerData** = `object` -Defined in: [graphql/types.ts:97](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L97) +Defined in: [graphql/types.ts:97](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L97) -## Type declaration +## Properties ### activeWorkers > **activeWorkers**: `number` +Defined in: [graphql/types.ts:99](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L99) + +*** + ### timestamp > **timestamp**: `Date` + +Defined in: [graphql/types.ts:98](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L98) diff --git a/docs/sdk/typescript/graphql/types/type-aliases/EscrowData.md b/docs/sdk/typescript/graphql/types/type-aliases/EscrowData.md index 1b73e121ee..4358f2f7aa 100644 --- a/docs/sdk/typescript/graphql/types/type-aliases/EscrowData.md +++ b/docs/sdk/typescript/graphql/types/type-aliases/EscrowData.md @@ -6,84 +6,158 @@ # Type Alias: EscrowData -> **EscrowData**: `object` +> **EscrowData** = `object` -Defined in: [graphql/types.ts:3](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L3) +Defined in: [graphql/types.ts:3](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L3) -## Type declaration +## Properties ### address > **address**: `string` +Defined in: [graphql/types.ts:5](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L5) + +*** + ### amountPaid > **amountPaid**: `string` +Defined in: [graphql/types.ts:6](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L6) + +*** + ### balance > **balance**: `string` +Defined in: [graphql/types.ts:7](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L7) + +*** + ### chainId > **chainId**: `number` +Defined in: [graphql/types.ts:22](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L22) + +*** + ### count > **count**: `string` +Defined in: [graphql/types.ts:8](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L8) + +*** + ### createdAt > **createdAt**: `string` +Defined in: [graphql/types.ts:21](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L21) + +*** + ### exchangeOracle? > `optional` **exchangeOracle**: `string` +Defined in: [graphql/types.ts:17](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L17) + +*** + ### factoryAddress > **factoryAddress**: `string` +Defined in: [graphql/types.ts:9](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L9) + +*** + ### finalResultsUrl? > `optional` **finalResultsUrl**: `string` +Defined in: [graphql/types.ts:10](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L10) + +*** + ### id > **id**: `string` +Defined in: [graphql/types.ts:4](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L4) + +*** + ### intermediateResultsUrl? > `optional` **intermediateResultsUrl**: `string` +Defined in: [graphql/types.ts:11](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L11) + +*** + ### launcher > **launcher**: `string` +Defined in: [graphql/types.ts:12](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L12) + +*** + ### manifestHash? > `optional` **manifestHash**: `string` +Defined in: [graphql/types.ts:13](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L13) + +*** + ### manifestUrl? > `optional` **manifestUrl**: `string` +Defined in: [graphql/types.ts:14](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L14) + +*** + ### recordingOracle? > `optional` **recordingOracle**: `string` +Defined in: [graphql/types.ts:15](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L15) + +*** + ### reputationOracle? > `optional` **reputationOracle**: `string` +Defined in: [graphql/types.ts:16](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L16) + +*** + ### status > **status**: `string` +Defined in: [graphql/types.ts:18](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L18) + +*** + ### token > **token**: `string` +Defined in: [graphql/types.ts:19](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L19) + +*** + ### totalFundedAmount > **totalFundedAmount**: `string` + +Defined in: [graphql/types.ts:20](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L20) diff --git a/docs/sdk/typescript/graphql/types/type-aliases/EscrowStatistics.md b/docs/sdk/typescript/graphql/types/type-aliases/EscrowStatistics.md index 6e6c5426c3..3e0f3279a2 100644 --- a/docs/sdk/typescript/graphql/types/type-aliases/EscrowStatistics.md +++ b/docs/sdk/typescript/graphql/types/type-aliases/EscrowStatistics.md @@ -6,16 +6,22 @@ # Type Alias: EscrowStatistics -> **EscrowStatistics**: `object` +> **EscrowStatistics** = `object` -Defined in: [graphql/types.ts:92](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L92) +Defined in: [graphql/types.ts:92](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L92) -## Type declaration +## Properties ### dailyEscrowsData > **dailyEscrowsData**: [`DailyEscrowData`](DailyEscrowData.md)[] +Defined in: [graphql/types.ts:94](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L94) + +*** + ### totalEscrows > **totalEscrows**: `number` + +Defined in: [graphql/types.ts:93](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L93) diff --git a/docs/sdk/typescript/graphql/types/type-aliases/EscrowStatisticsData.md b/docs/sdk/typescript/graphql/types/type-aliases/EscrowStatisticsData.md index d11549fd67..77affd2f7f 100644 --- a/docs/sdk/typescript/graphql/types/type-aliases/EscrowStatisticsData.md +++ b/docs/sdk/typescript/graphql/types/type-aliases/EscrowStatisticsData.md @@ -6,48 +6,86 @@ # Type Alias: EscrowStatisticsData -> **EscrowStatisticsData**: `object` +> **EscrowStatisticsData** = `object` -Defined in: [graphql/types.ts:42](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L42) +Defined in: [graphql/types.ts:42](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L42) -## Type declaration +## Properties ### bulkPayoutEventCount > **bulkPayoutEventCount**: `string` +Defined in: [graphql/types.ts:45](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L45) + +*** + ### cancelledStatusEventCount > **cancelledStatusEventCount**: `string` +Defined in: [graphql/types.ts:47](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L47) + +*** + ### completedStatusEventCount > **completedStatusEventCount**: `string` +Defined in: [graphql/types.ts:50](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L50) + +*** + ### fundEventCount > **fundEventCount**: `string` +Defined in: [graphql/types.ts:43](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L43) + +*** + ### paidStatusEventCount > **paidStatusEventCount**: `string` +Defined in: [graphql/types.ts:49](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L49) + +*** + ### partialStatusEventCount > **partialStatusEventCount**: `string` +Defined in: [graphql/types.ts:48](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L48) + +*** + ### pendingStatusEventCount > **pendingStatusEventCount**: `string` +Defined in: [graphql/types.ts:46](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L46) + +*** + ### storeResultsEventCount > **storeResultsEventCount**: `string` +Defined in: [graphql/types.ts:44](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L44) + +*** + ### totalEscrowCount > **totalEscrowCount**: `string` +Defined in: [graphql/types.ts:52](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L52) + +*** + ### totalEventCount > **totalEventCount**: `string` + +Defined in: [graphql/types.ts:51](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L51) diff --git a/docs/sdk/typescript/graphql/types/type-aliases/EventDayData.md b/docs/sdk/typescript/graphql/types/type-aliases/EventDayData.md index 1bdd057e5f..a0f435a431 100644 --- a/docs/sdk/typescript/graphql/types/type-aliases/EventDayData.md +++ b/docs/sdk/typescript/graphql/types/type-aliases/EventDayData.md @@ -6,80 +6,150 @@ # Type Alias: EventDayData -> **EventDayData**: `object` +> **EventDayData** = `object` -Defined in: [graphql/types.ts:55](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L55) +Defined in: [graphql/types.ts:55](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L55) -## Type declaration +## Properties ### dailyBulkPayoutEventCount > **dailyBulkPayoutEventCount**: `string` +Defined in: [graphql/types.ts:59](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L59) + +*** + ### dailyCancelledStatusEventCount > **dailyCancelledStatusEventCount**: `string` +Defined in: [graphql/types.ts:61](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L61) + +*** + ### dailyCompletedStatusEventCount > **dailyCompletedStatusEventCount**: `string` +Defined in: [graphql/types.ts:64](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L64) + +*** + ### dailyEscrowCount > **dailyEscrowCount**: `string` +Defined in: [graphql/types.ts:66](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L66) + +*** + ### dailyFundEventCount > **dailyFundEventCount**: `string` +Defined in: [graphql/types.ts:57](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L57) + +*** + ### dailyHMTTransferAmount > **dailyHMTTransferAmount**: `string` +Defined in: [graphql/types.ts:71](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L71) + +*** + ### dailyHMTTransferCount > **dailyHMTTransferCount**: `string` +Defined in: [graphql/types.ts:70](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L70) + +*** + ### dailyPaidStatusEventCount > **dailyPaidStatusEventCount**: `string` +Defined in: [graphql/types.ts:63](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L63) + +*** + ### dailyPartialStatusEventCount > **dailyPartialStatusEventCount**: `string` +Defined in: [graphql/types.ts:62](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L62) + +*** + ### dailyPayoutAmount > **dailyPayoutAmount**: `string` +Defined in: [graphql/types.ts:69](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L69) + +*** + ### dailyPayoutCount > **dailyPayoutCount**: `string` +Defined in: [graphql/types.ts:68](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L68) + +*** + ### dailyPendingStatusEventCount > **dailyPendingStatusEventCount**: `string` +Defined in: [graphql/types.ts:60](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L60) + +*** + ### dailyStoreResultsEventCount > **dailyStoreResultsEventCount**: `string` +Defined in: [graphql/types.ts:58](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L58) + +*** + ### dailyTotalEventCount > **dailyTotalEventCount**: `string` +Defined in: [graphql/types.ts:65](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L65) + +*** + ### dailyUniqueReceivers > **dailyUniqueReceivers**: `string` +Defined in: [graphql/types.ts:73](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L73) + +*** + ### dailyUniqueSenders > **dailyUniqueSenders**: `string` +Defined in: [graphql/types.ts:72](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L72) + +*** + ### dailyWorkerCount > **dailyWorkerCount**: `string` +Defined in: [graphql/types.ts:67](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L67) + +*** + ### timestamp > **timestamp**: `string` + +Defined in: [graphql/types.ts:56](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L56) diff --git a/docs/sdk/typescript/graphql/types/type-aliases/HMTHolder.md b/docs/sdk/typescript/graphql/types/type-aliases/HMTHolder.md index 3c2354fba4..37f218e868 100644 --- a/docs/sdk/typescript/graphql/types/type-aliases/HMTHolder.md +++ b/docs/sdk/typescript/graphql/types/type-aliases/HMTHolder.md @@ -6,16 +6,22 @@ # Type Alias: HMTHolder -> **HMTHolder**: `object` +> **HMTHolder** = `object` -Defined in: [graphql/types.ts:122](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L122) +Defined in: [graphql/types.ts:122](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L122) -## Type declaration +## Properties ### address > **address**: `string` +Defined in: [graphql/types.ts:123](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L123) + +*** + ### balance > **balance**: `bigint` + +Defined in: [graphql/types.ts:124](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L124) diff --git a/docs/sdk/typescript/graphql/types/type-aliases/HMTHolderData.md b/docs/sdk/typescript/graphql/types/type-aliases/HMTHolderData.md index 7a2407ca15..67077c7e25 100644 --- a/docs/sdk/typescript/graphql/types/type-aliases/HMTHolderData.md +++ b/docs/sdk/typescript/graphql/types/type-aliases/HMTHolderData.md @@ -6,16 +6,22 @@ # Type Alias: HMTHolderData -> **HMTHolderData**: `object` +> **HMTHolderData** = `object` -Defined in: [graphql/types.ts:117](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L117) +Defined in: [graphql/types.ts:117](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L117) -## Type declaration +## Properties ### address > **address**: `string` +Defined in: [graphql/types.ts:118](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L118) + +*** + ### balance > **balance**: `string` + +Defined in: [graphql/types.ts:119](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L119) diff --git a/docs/sdk/typescript/graphql/types/type-aliases/HMTStatistics.md b/docs/sdk/typescript/graphql/types/type-aliases/HMTStatistics.md index e8e3e7364e..5f3c55eb13 100644 --- a/docs/sdk/typescript/graphql/types/type-aliases/HMTStatistics.md +++ b/docs/sdk/typescript/graphql/types/type-aliases/HMTStatistics.md @@ -6,20 +6,30 @@ # Type Alias: HMTStatistics -> **HMTStatistics**: `object` +> **HMTStatistics** = `object` -Defined in: [graphql/types.ts:135](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L135) +Defined in: [graphql/types.ts:135](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L135) -## Type declaration +## Properties ### totalHolders > **totalHolders**: `number` +Defined in: [graphql/types.ts:138](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L138) + +*** + ### totalTransferAmount > **totalTransferAmount**: `bigint` +Defined in: [graphql/types.ts:136](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L136) + +*** + ### totalTransferCount > **totalTransferCount**: `number` + +Defined in: [graphql/types.ts:137](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L137) diff --git a/docs/sdk/typescript/graphql/types/type-aliases/HMTStatisticsData.md b/docs/sdk/typescript/graphql/types/type-aliases/HMTStatisticsData.md index d1401b9486..fecd65a138 100644 --- a/docs/sdk/typescript/graphql/types/type-aliases/HMTStatisticsData.md +++ b/docs/sdk/typescript/graphql/types/type-aliases/HMTStatisticsData.md @@ -6,32 +6,54 @@ # Type Alias: HMTStatisticsData -> **HMTStatisticsData**: `object` +> **HMTStatisticsData** = `object` -Defined in: [graphql/types.ts:33](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L33) +Defined in: [graphql/types.ts:33](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L33) -## Type declaration +## Properties ### holders > **holders**: `string` +Defined in: [graphql/types.ts:39](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L39) + +*** + ### totalApprovalEventCount > **totalApprovalEventCount**: `string` +Defined in: [graphql/types.ts:36](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L36) + +*** + ### totalBulkApprovalEventCount > **totalBulkApprovalEventCount**: `string` +Defined in: [graphql/types.ts:37](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L37) + +*** + ### totalBulkTransferEventCount > **totalBulkTransferEventCount**: `string` +Defined in: [graphql/types.ts:35](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L35) + +*** + ### totalTransferEventCount > **totalTransferEventCount**: `string` +Defined in: [graphql/types.ts:34](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L34) + +*** + ### totalValueTransfered > **totalValueTransfered**: `string` + +Defined in: [graphql/types.ts:38](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L38) diff --git a/docs/sdk/typescript/graphql/types/type-aliases/IMData.md b/docs/sdk/typescript/graphql/types/type-aliases/IMData.md index 9fe78a572b..f79755e20a 100644 --- a/docs/sdk/typescript/graphql/types/type-aliases/IMData.md +++ b/docs/sdk/typescript/graphql/types/type-aliases/IMData.md @@ -6,6 +6,6 @@ # Type Alias: IMData -> **IMData**: `Record`\<`string`, [`IMDataEntity`](IMDataEntity.md)\> +> **IMData** = `Record`\<`string`, [`IMDataEntity`](IMDataEntity.md)\> -Defined in: [graphql/types.ts:146](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L146) +Defined in: [graphql/types.ts:146](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L146) diff --git a/docs/sdk/typescript/graphql/types/type-aliases/IMDataEntity.md b/docs/sdk/typescript/graphql/types/type-aliases/IMDataEntity.md index 04813d3002..4e93407f15 100644 --- a/docs/sdk/typescript/graphql/types/type-aliases/IMDataEntity.md +++ b/docs/sdk/typescript/graphql/types/type-aliases/IMDataEntity.md @@ -6,16 +6,22 @@ # Type Alias: IMDataEntity -> **IMDataEntity**: `object` +> **IMDataEntity** = `object` -Defined in: [graphql/types.ts:141](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L141) +Defined in: [graphql/types.ts:141](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L141) -## Type declaration +## Properties ### served > **served**: `number` +Defined in: [graphql/types.ts:142](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L142) + +*** + ### solved > **solved**: `number` + +Defined in: [graphql/types.ts:143](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L143) diff --git a/docs/sdk/typescript/graphql/types/type-aliases/KVStoreData.md b/docs/sdk/typescript/graphql/types/type-aliases/KVStoreData.md index bf4a21515f..7f832cefbb 100644 --- a/docs/sdk/typescript/graphql/types/type-aliases/KVStoreData.md +++ b/docs/sdk/typescript/graphql/types/type-aliases/KVStoreData.md @@ -6,32 +6,54 @@ # Type Alias: KVStoreData -> **KVStoreData**: `object` +> **KVStoreData** = `object` -Defined in: [graphql/types.ts:165](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L165) +Defined in: [graphql/types.ts:165](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L165) -## Type declaration +## Properties ### address > **address**: `string` +Defined in: [graphql/types.ts:167](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L167) + +*** + ### block > **block**: `number` +Defined in: [graphql/types.ts:171](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L171) + +*** + ### id > **id**: `string` +Defined in: [graphql/types.ts:166](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L166) + +*** + ### key > **key**: `string` +Defined in: [graphql/types.ts:168](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L168) + +*** + ### timestamp > **timestamp**: `Date` +Defined in: [graphql/types.ts:170](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L170) + +*** + ### value > **value**: `string` + +Defined in: [graphql/types.ts:169](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L169) diff --git a/docs/sdk/typescript/graphql/types/type-aliases/PaymentStatistics.md b/docs/sdk/typescript/graphql/types/type-aliases/PaymentStatistics.md index 183cb8fc7b..5ed4862749 100644 --- a/docs/sdk/typescript/graphql/types/type-aliases/PaymentStatistics.md +++ b/docs/sdk/typescript/graphql/types/type-aliases/PaymentStatistics.md @@ -6,12 +6,14 @@ # Type Alias: PaymentStatistics -> **PaymentStatistics**: `object` +> **PaymentStatistics** = `object` -Defined in: [graphql/types.ts:113](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L113) +Defined in: [graphql/types.ts:113](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L113) -## Type declaration +## Properties ### dailyPaymentsData > **dailyPaymentsData**: [`DailyPaymentData`](DailyPaymentData.md)[] + +Defined in: [graphql/types.ts:114](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L114) diff --git a/docs/sdk/typescript/graphql/types/type-aliases/PayoutData.md b/docs/sdk/typescript/graphql/types/type-aliases/PayoutData.md index 411724cd7c..148fd0a477 100644 --- a/docs/sdk/typescript/graphql/types/type-aliases/PayoutData.md +++ b/docs/sdk/typescript/graphql/types/type-aliases/PayoutData.md @@ -6,28 +6,46 @@ # Type Alias: PayoutData -> **PayoutData**: `object` +> **PayoutData** = `object` -Defined in: [graphql/types.ts:25](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L25) +Defined in: [graphql/types.ts:25](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L25) -## Type declaration +## Properties ### amount > **amount**: `string` +Defined in: [graphql/types.ts:29](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L29) + +*** + ### createdAt > **createdAt**: `string` +Defined in: [graphql/types.ts:30](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L30) + +*** + ### escrowAddress > **escrowAddress**: `string` +Defined in: [graphql/types.ts:27](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L27) + +*** + ### id > **id**: `string` +Defined in: [graphql/types.ts:26](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L26) + +*** + ### recipient > **recipient**: `string` + +Defined in: [graphql/types.ts:28](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L28) diff --git a/docs/sdk/typescript/graphql/types/type-aliases/RewardAddedEventData.md b/docs/sdk/typescript/graphql/types/type-aliases/RewardAddedEventData.md index 1c754efa3c..81df5cdc2e 100644 --- a/docs/sdk/typescript/graphql/types/type-aliases/RewardAddedEventData.md +++ b/docs/sdk/typescript/graphql/types/type-aliases/RewardAddedEventData.md @@ -6,24 +6,38 @@ # Type Alias: RewardAddedEventData -> **RewardAddedEventData**: `object` +> **RewardAddedEventData** = `object` -Defined in: [graphql/types.ts:76](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L76) +Defined in: [graphql/types.ts:76](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L76) -## Type declaration +## Properties ### amount > **amount**: `string` +Defined in: [graphql/types.ts:80](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L80) + +*** + ### escrowAddress > **escrowAddress**: `string` +Defined in: [graphql/types.ts:77](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L77) + +*** + ### slasher > **slasher**: `string` +Defined in: [graphql/types.ts:79](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L79) + +*** + ### staker > **staker**: `string` + +Defined in: [graphql/types.ts:78](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L78) diff --git a/docs/sdk/typescript/graphql/types/type-aliases/StatusEvent.md b/docs/sdk/typescript/graphql/types/type-aliases/StatusEvent.md index 05c2380ae1..13e1fb1373 100644 --- a/docs/sdk/typescript/graphql/types/type-aliases/StatusEvent.md +++ b/docs/sdk/typescript/graphql/types/type-aliases/StatusEvent.md @@ -6,24 +6,38 @@ # Type Alias: StatusEvent -> **StatusEvent**: `object` +> **StatusEvent** = `object` -Defined in: [graphql/types.ts:158](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L158) +Defined in: [graphql/types.ts:158](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L158) -## Type declaration +## Properties ### chainId > **chainId**: [`ChainId`](../../../enums/enumerations/ChainId.md) +Defined in: [graphql/types.ts:162](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L162) + +*** + ### escrowAddress > **escrowAddress**: `string` +Defined in: [graphql/types.ts:160](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L160) + +*** + ### status > **status**: `string` +Defined in: [graphql/types.ts:161](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L161) + +*** + ### timestamp > **timestamp**: `number` + +Defined in: [graphql/types.ts:159](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L159) diff --git a/docs/sdk/typescript/graphql/types/type-aliases/TaskStatistics.md b/docs/sdk/typescript/graphql/types/type-aliases/TaskStatistics.md index 1e57acbfdd..c120294344 100644 --- a/docs/sdk/typescript/graphql/types/type-aliases/TaskStatistics.md +++ b/docs/sdk/typescript/graphql/types/type-aliases/TaskStatistics.md @@ -6,12 +6,14 @@ # Type Alias: TaskStatistics -> **TaskStatistics**: `object` +> **TaskStatistics** = `object` -Defined in: [graphql/types.ts:154](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L154) +Defined in: [graphql/types.ts:154](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L154) -## Type declaration +## Properties ### dailyTasksData > **dailyTasksData**: [`DailyTaskData`](DailyTaskData.md)[] + +Defined in: [graphql/types.ts:155](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L155) diff --git a/docs/sdk/typescript/graphql/types/type-aliases/WorkerStatistics.md b/docs/sdk/typescript/graphql/types/type-aliases/WorkerStatistics.md index 60ffd457ee..821fcbaa45 100644 --- a/docs/sdk/typescript/graphql/types/type-aliases/WorkerStatistics.md +++ b/docs/sdk/typescript/graphql/types/type-aliases/WorkerStatistics.md @@ -6,12 +6,14 @@ # Type Alias: WorkerStatistics -> **WorkerStatistics**: `object` +> **WorkerStatistics** = `object` -Defined in: [graphql/types.ts:102](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L102) +Defined in: [graphql/types.ts:102](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L102) -## Type declaration +## Properties ### dailyWorkersData > **dailyWorkersData**: [`DailyWorkerData`](DailyWorkerData.md)[] + +Defined in: [graphql/types.ts:103](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L103) diff --git a/docs/sdk/typescript/interfaces/interfaces/IEscrowConfig.md b/docs/sdk/typescript/interfaces/interfaces/IEscrowConfig.md index 0683a22619..a5243170eb 100644 --- a/docs/sdk/typescript/interfaces/interfaces/IEscrowConfig.md +++ b/docs/sdk/typescript/interfaces/interfaces/IEscrowConfig.md @@ -6,7 +6,7 @@ # Interface: IEscrowConfig -Defined in: [interfaces.ts:79](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L79) +Defined in: [interfaces.ts:79](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L79) ## Properties @@ -14,7 +14,7 @@ Defined in: [interfaces.ts:79](https://github.com/humanprotocol/human-protocol/b > **exchangeOracle**: `string` -Defined in: [interfaces.ts:82](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L82) +Defined in: [interfaces.ts:82](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L82) *** @@ -22,7 +22,7 @@ Defined in: [interfaces.ts:82](https://github.com/humanprotocol/human-protocol/b > **exchangeOracleFee**: `bigint` -Defined in: [interfaces.ts:85](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L85) +Defined in: [interfaces.ts:85](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L85) *** @@ -30,7 +30,7 @@ Defined in: [interfaces.ts:85](https://github.com/humanprotocol/human-protocol/b > **manifestHash**: `string` -Defined in: [interfaces.ts:87](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L87) +Defined in: [interfaces.ts:87](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L87) *** @@ -38,7 +38,7 @@ Defined in: [interfaces.ts:87](https://github.com/humanprotocol/human-protocol/b > **manifestUrl**: `string` -Defined in: [interfaces.ts:86](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L86) +Defined in: [interfaces.ts:86](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L86) *** @@ -46,7 +46,7 @@ Defined in: [interfaces.ts:86](https://github.com/humanprotocol/human-protocol/b > **recordingOracle**: `string` -Defined in: [interfaces.ts:80](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L80) +Defined in: [interfaces.ts:80](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L80) *** @@ -54,7 +54,7 @@ Defined in: [interfaces.ts:80](https://github.com/humanprotocol/human-protocol/b > **recordingOracleFee**: `bigint` -Defined in: [interfaces.ts:83](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L83) +Defined in: [interfaces.ts:83](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L83) *** @@ -62,7 +62,7 @@ Defined in: [interfaces.ts:83](https://github.com/humanprotocol/human-protocol/b > **reputationOracle**: `string` -Defined in: [interfaces.ts:81](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L81) +Defined in: [interfaces.ts:81](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L81) *** @@ -70,4 +70,4 @@ Defined in: [interfaces.ts:81](https://github.com/humanprotocol/human-protocol/b > **reputationOracleFee**: `bigint` -Defined in: [interfaces.ts:84](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L84) +Defined in: [interfaces.ts:84](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L84) diff --git a/docs/sdk/typescript/interfaces/interfaces/IEscrowsFilter.md b/docs/sdk/typescript/interfaces/interfaces/IEscrowsFilter.md index add8356780..754568e1b8 100644 --- a/docs/sdk/typescript/interfaces/interfaces/IEscrowsFilter.md +++ b/docs/sdk/typescript/interfaces/interfaces/IEscrowsFilter.md @@ -6,7 +6,7 @@ # Interface: IEscrowsFilter -Defined in: [interfaces.ts:67](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L67) +Defined in: [interfaces.ts:67](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L67) ## Extends @@ -18,7 +18,7 @@ Defined in: [interfaces.ts:67](https://github.com/humanprotocol/human-protocol/b > **chainId**: [`ChainId`](../../enums/enumerations/ChainId.md) -Defined in: [interfaces.ts:76](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L76) +Defined in: [interfaces.ts:76](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L76) *** @@ -26,7 +26,7 @@ Defined in: [interfaces.ts:76](https://github.com/humanprotocol/human-protocol/b > `optional` **exchangeOracle**: `string` -Defined in: [interfaces.ts:71](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L71) +Defined in: [interfaces.ts:71](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L71) *** @@ -34,7 +34,7 @@ Defined in: [interfaces.ts:71](https://github.com/humanprotocol/human-protocol/b > `optional` **first**: `number` -Defined in: [interfaces.ts:154](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L154) +Defined in: [interfaces.ts:154](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L154) #### Inherited from @@ -46,7 +46,7 @@ Defined in: [interfaces.ts:154](https://github.com/humanprotocol/human-protocol/ > `optional` **from**: `Date` -Defined in: [interfaces.ts:74](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L74) +Defined in: [interfaces.ts:74](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L74) *** @@ -54,7 +54,7 @@ Defined in: [interfaces.ts:74](https://github.com/humanprotocol/human-protocol/b > `optional` **jobRequesterId**: `string` -Defined in: [interfaces.ts:72](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L72) +Defined in: [interfaces.ts:72](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L72) *** @@ -62,7 +62,7 @@ Defined in: [interfaces.ts:72](https://github.com/humanprotocol/human-protocol/b > `optional` **launcher**: `string` -Defined in: [interfaces.ts:68](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L68) +Defined in: [interfaces.ts:68](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L68) *** @@ -70,7 +70,7 @@ Defined in: [interfaces.ts:68](https://github.com/humanprotocol/human-protocol/b > `optional` **orderDirection**: [`OrderDirection`](../../enums/enumerations/OrderDirection.md) -Defined in: [interfaces.ts:156](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L156) +Defined in: [interfaces.ts:156](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L156) #### Inherited from @@ -82,7 +82,7 @@ Defined in: [interfaces.ts:156](https://github.com/humanprotocol/human-protocol/ > `optional` **recordingOracle**: `string` -Defined in: [interfaces.ts:70](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L70) +Defined in: [interfaces.ts:70](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L70) *** @@ -90,7 +90,7 @@ Defined in: [interfaces.ts:70](https://github.com/humanprotocol/human-protocol/b > `optional` **reputationOracle**: `string` -Defined in: [interfaces.ts:69](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L69) +Defined in: [interfaces.ts:69](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L69) *** @@ -98,7 +98,7 @@ Defined in: [interfaces.ts:69](https://github.com/humanprotocol/human-protocol/b > `optional` **skip**: `number` -Defined in: [interfaces.ts:155](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L155) +Defined in: [interfaces.ts:155](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L155) #### Inherited from @@ -110,7 +110,7 @@ Defined in: [interfaces.ts:155](https://github.com/humanprotocol/human-protocol/ > `optional` **status**: [`EscrowStatus`](../../types/enumerations/EscrowStatus.md) -Defined in: [interfaces.ts:73](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L73) +Defined in: [interfaces.ts:73](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L73) *** @@ -118,4 +118,4 @@ Defined in: [interfaces.ts:73](https://github.com/humanprotocol/human-protocol/b > `optional` **to**: `Date` -Defined in: [interfaces.ts:75](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L75) +Defined in: [interfaces.ts:75](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L75) diff --git a/docs/sdk/typescript/interfaces/interfaces/IHMTHoldersParams.md b/docs/sdk/typescript/interfaces/interfaces/IHMTHoldersParams.md index 20e651e721..4f813323e5 100644 --- a/docs/sdk/typescript/interfaces/interfaces/IHMTHoldersParams.md +++ b/docs/sdk/typescript/interfaces/interfaces/IHMTHoldersParams.md @@ -6,7 +6,7 @@ # Interface: IHMTHoldersParams -Defined in: [interfaces.ts:102](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L102) +Defined in: [interfaces.ts:102](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L102) ## Extends @@ -18,7 +18,7 @@ Defined in: [interfaces.ts:102](https://github.com/humanprotocol/human-protocol/ > `optional` **address**: `string` -Defined in: [interfaces.ts:103](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L103) +Defined in: [interfaces.ts:103](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L103) *** @@ -26,7 +26,7 @@ Defined in: [interfaces.ts:103](https://github.com/humanprotocol/human-protocol/ > `optional` **first**: `number` -Defined in: [interfaces.ts:154](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L154) +Defined in: [interfaces.ts:154](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L154) #### Inherited from @@ -38,7 +38,7 @@ Defined in: [interfaces.ts:154](https://github.com/humanprotocol/human-protocol/ > `optional` **orderDirection**: [`OrderDirection`](../../enums/enumerations/OrderDirection.md) -Defined in: [interfaces.ts:156](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L156) +Defined in: [interfaces.ts:156](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L156) #### Inherited from @@ -50,7 +50,7 @@ Defined in: [interfaces.ts:156](https://github.com/humanprotocol/human-protocol/ > `optional` **skip**: `number` -Defined in: [interfaces.ts:155](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L155) +Defined in: [interfaces.ts:155](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L155) #### Inherited from diff --git a/docs/sdk/typescript/interfaces/interfaces/IKVStore.md b/docs/sdk/typescript/interfaces/interfaces/IKVStore.md index d7afd90199..30b68f3065 100644 --- a/docs/sdk/typescript/interfaces/interfaces/IKVStore.md +++ b/docs/sdk/typescript/interfaces/interfaces/IKVStore.md @@ -6,7 +6,7 @@ # Interface: IKVStore -Defined in: [interfaces.ts:114](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L114) +Defined in: [interfaces.ts:114](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L114) ## Properties @@ -14,7 +14,7 @@ Defined in: [interfaces.ts:114](https://github.com/humanprotocol/human-protocol/ > **key**: `string` -Defined in: [interfaces.ts:115](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L115) +Defined in: [interfaces.ts:115](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L115) *** @@ -22,4 +22,4 @@ Defined in: [interfaces.ts:115](https://github.com/humanprotocol/human-protocol/ > **value**: `string` -Defined in: [interfaces.ts:116](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L116) +Defined in: [interfaces.ts:116](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L116) diff --git a/docs/sdk/typescript/interfaces/interfaces/IKeyPair.md b/docs/sdk/typescript/interfaces/interfaces/IKeyPair.md index 66e2c69336..98af225641 100644 --- a/docs/sdk/typescript/interfaces/interfaces/IKeyPair.md +++ b/docs/sdk/typescript/interfaces/interfaces/IKeyPair.md @@ -6,7 +6,7 @@ # Interface: IKeyPair -Defined in: [interfaces.ts:90](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L90) +Defined in: [interfaces.ts:90](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L90) ## Properties @@ -14,7 +14,7 @@ Defined in: [interfaces.ts:90](https://github.com/humanprotocol/human-protocol/b > **passphrase**: `string` -Defined in: [interfaces.ts:93](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L93) +Defined in: [interfaces.ts:93](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L93) *** @@ -22,7 +22,7 @@ Defined in: [interfaces.ts:93](https://github.com/humanprotocol/human-protocol/b > **privateKey**: `string` -Defined in: [interfaces.ts:91](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L91) +Defined in: [interfaces.ts:91](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L91) *** @@ -30,7 +30,7 @@ Defined in: [interfaces.ts:91](https://github.com/humanprotocol/human-protocol/b > **publicKey**: `string` -Defined in: [interfaces.ts:92](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L92) +Defined in: [interfaces.ts:92](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L92) *** @@ -38,4 +38,4 @@ Defined in: [interfaces.ts:92](https://github.com/humanprotocol/human-protocol/b > `optional` **revocationCertificate**: `string` -Defined in: [interfaces.ts:94](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L94) +Defined in: [interfaces.ts:94](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L94) diff --git a/docs/sdk/typescript/interfaces/interfaces/IOperator.md b/docs/sdk/typescript/interfaces/interfaces/IOperator.md index 79945ef14c..6e67162629 100644 --- a/docs/sdk/typescript/interfaces/interfaces/IOperator.md +++ b/docs/sdk/typescript/interfaces/interfaces/IOperator.md @@ -6,7 +6,7 @@ # Interface: IOperator -Defined in: [interfaces.ts:9](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L9) +Defined in: [interfaces.ts:9](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L9) ## Properties @@ -14,7 +14,7 @@ Defined in: [interfaces.ts:9](https://github.com/humanprotocol/human-protocol/bl > **address**: `string` -Defined in: [interfaces.ts:12](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L12) +Defined in: [interfaces.ts:12](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L12) *** @@ -22,7 +22,7 @@ Defined in: [interfaces.ts:12](https://github.com/humanprotocol/human-protocol/b > **amountJobsProcessed**: `bigint` -Defined in: [interfaces.ts:19](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L19) +Defined in: [interfaces.ts:19](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L19) *** @@ -30,7 +30,7 @@ Defined in: [interfaces.ts:19](https://github.com/humanprotocol/human-protocol/b > **amountLocked**: `bigint` -Defined in: [interfaces.ts:14](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L14) +Defined in: [interfaces.ts:14](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L14) *** @@ -38,7 +38,7 @@ Defined in: [interfaces.ts:14](https://github.com/humanprotocol/human-protocol/b > **amountSlashed**: `bigint` -Defined in: [interfaces.ts:17](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L17) +Defined in: [interfaces.ts:17](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L17) *** @@ -46,7 +46,7 @@ Defined in: [interfaces.ts:17](https://github.com/humanprotocol/human-protocol/b > **amountStaked**: `bigint` -Defined in: [interfaces.ts:13](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L13) +Defined in: [interfaces.ts:13](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L13) *** @@ -54,7 +54,7 @@ Defined in: [interfaces.ts:13](https://github.com/humanprotocol/human-protocol/b > **amountWithdrawn**: `bigint` -Defined in: [interfaces.ts:16](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L16) +Defined in: [interfaces.ts:16](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L16) *** @@ -62,7 +62,7 @@ Defined in: [interfaces.ts:16](https://github.com/humanprotocol/human-protocol/b > `optional` **category**: `string` -Defined in: [interfaces.ts:31](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L31) +Defined in: [interfaces.ts:31](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L31) *** @@ -70,7 +70,7 @@ Defined in: [interfaces.ts:31](https://github.com/humanprotocol/human-protocol/b > **chainId**: [`ChainId`](../../enums/enumerations/ChainId.md) -Defined in: [interfaces.ts:11](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L11) +Defined in: [interfaces.ts:11](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L11) *** @@ -78,7 +78,7 @@ Defined in: [interfaces.ts:11](https://github.com/humanprotocol/human-protocol/b > `optional` **fee**: `bigint` -Defined in: [interfaces.ts:21](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L21) +Defined in: [interfaces.ts:21](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L21) *** @@ -86,7 +86,7 @@ Defined in: [interfaces.ts:21](https://github.com/humanprotocol/human-protocol/b > **id**: `string` -Defined in: [interfaces.ts:10](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L10) +Defined in: [interfaces.ts:10](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L10) *** @@ -94,7 +94,7 @@ Defined in: [interfaces.ts:10](https://github.com/humanprotocol/human-protocol/b > `optional` **jobTypes**: `string`[] -Defined in: [interfaces.ts:26](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L26) +Defined in: [interfaces.ts:26](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L26) *** @@ -102,7 +102,7 @@ Defined in: [interfaces.ts:26](https://github.com/humanprotocol/human-protocol/b > **lockedUntilTimestamp**: `bigint` -Defined in: [interfaces.ts:15](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L15) +Defined in: [interfaces.ts:15](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L15) *** @@ -110,7 +110,7 @@ Defined in: [interfaces.ts:15](https://github.com/humanprotocol/human-protocol/b > `optional` **name**: `string` -Defined in: [interfaces.ts:30](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L30) +Defined in: [interfaces.ts:30](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L30) *** @@ -118,7 +118,7 @@ Defined in: [interfaces.ts:30](https://github.com/humanprotocol/human-protocol/b > `optional` **publicKey**: `string` -Defined in: [interfaces.ts:22](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L22) +Defined in: [interfaces.ts:22](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L22) *** @@ -126,7 +126,7 @@ Defined in: [interfaces.ts:22](https://github.com/humanprotocol/human-protocol/b > `optional` **registrationInstructions**: `string` -Defined in: [interfaces.ts:28](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L28) +Defined in: [interfaces.ts:28](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L28) *** @@ -134,7 +134,7 @@ Defined in: [interfaces.ts:28](https://github.com/humanprotocol/human-protocol/b > `optional` **registrationNeeded**: `boolean` -Defined in: [interfaces.ts:27](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L27) +Defined in: [interfaces.ts:27](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L27) *** @@ -142,7 +142,7 @@ Defined in: [interfaces.ts:27](https://github.com/humanprotocol/human-protocol/b > `optional` **reputationNetworks**: `string`[] -Defined in: [interfaces.ts:29](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L29) +Defined in: [interfaces.ts:29](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L29) *** @@ -150,7 +150,7 @@ Defined in: [interfaces.ts:29](https://github.com/humanprotocol/human-protocol/b > **reward**: `bigint` -Defined in: [interfaces.ts:18](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L18) +Defined in: [interfaces.ts:18](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L18) *** @@ -158,7 +158,7 @@ Defined in: [interfaces.ts:18](https://github.com/humanprotocol/human-protocol/b > `optional` **role**: `string` -Defined in: [interfaces.ts:20](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L20) +Defined in: [interfaces.ts:20](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L20) *** @@ -166,7 +166,7 @@ Defined in: [interfaces.ts:20](https://github.com/humanprotocol/human-protocol/b > `optional` **url**: `string` -Defined in: [interfaces.ts:25](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L25) +Defined in: [interfaces.ts:25](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L25) *** @@ -174,7 +174,7 @@ Defined in: [interfaces.ts:25](https://github.com/humanprotocol/human-protocol/b > `optional` **webhookUrl**: `string` -Defined in: [interfaces.ts:23](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L23) +Defined in: [interfaces.ts:23](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L23) *** @@ -182,4 +182,4 @@ Defined in: [interfaces.ts:23](https://github.com/humanprotocol/human-protocol/b > `optional` **website**: `string` -Defined in: [interfaces.ts:24](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L24) +Defined in: [interfaces.ts:24](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L24) diff --git a/docs/sdk/typescript/interfaces/interfaces/IOperatorSubgraph.md b/docs/sdk/typescript/interfaces/interfaces/IOperatorSubgraph.md index b27a089c01..d180322141 100644 --- a/docs/sdk/typescript/interfaces/interfaces/IOperatorSubgraph.md +++ b/docs/sdk/typescript/interfaces/interfaces/IOperatorSubgraph.md @@ -6,7 +6,7 @@ # Interface: IOperatorSubgraph -Defined in: [interfaces.ts:34](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L34) +Defined in: [interfaces.ts:34](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L34) ## Extends @@ -18,7 +18,7 @@ Defined in: [interfaces.ts:34](https://github.com/humanprotocol/human-protocol/b > **address**: `string` -Defined in: [interfaces.ts:12](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L12) +Defined in: [interfaces.ts:12](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L12) #### Inherited from @@ -30,7 +30,7 @@ Defined in: [interfaces.ts:12](https://github.com/humanprotocol/human-protocol/b > **amountJobsProcessed**: `bigint` -Defined in: [interfaces.ts:19](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L19) +Defined in: [interfaces.ts:19](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L19) #### Inherited from @@ -42,7 +42,7 @@ Defined in: [interfaces.ts:19](https://github.com/humanprotocol/human-protocol/b > **amountLocked**: `bigint` -Defined in: [interfaces.ts:14](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L14) +Defined in: [interfaces.ts:14](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L14) #### Inherited from @@ -54,7 +54,7 @@ Defined in: [interfaces.ts:14](https://github.com/humanprotocol/human-protocol/b > **amountSlashed**: `bigint` -Defined in: [interfaces.ts:17](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L17) +Defined in: [interfaces.ts:17](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L17) #### Inherited from @@ -66,7 +66,7 @@ Defined in: [interfaces.ts:17](https://github.com/humanprotocol/human-protocol/b > **amountStaked**: `bigint` -Defined in: [interfaces.ts:13](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L13) +Defined in: [interfaces.ts:13](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L13) #### Inherited from @@ -78,7 +78,7 @@ Defined in: [interfaces.ts:13](https://github.com/humanprotocol/human-protocol/b > **amountWithdrawn**: `bigint` -Defined in: [interfaces.ts:16](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L16) +Defined in: [interfaces.ts:16](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L16) #### Inherited from @@ -90,7 +90,7 @@ Defined in: [interfaces.ts:16](https://github.com/humanprotocol/human-protocol/b > `optional` **category**: `string` -Defined in: [interfaces.ts:31](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L31) +Defined in: [interfaces.ts:31](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L31) #### Inherited from @@ -102,7 +102,7 @@ Defined in: [interfaces.ts:31](https://github.com/humanprotocol/human-protocol/b > `optional` **fee**: `bigint` -Defined in: [interfaces.ts:21](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L21) +Defined in: [interfaces.ts:21](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L21) #### Inherited from @@ -114,7 +114,7 @@ Defined in: [interfaces.ts:21](https://github.com/humanprotocol/human-protocol/b > **id**: `string` -Defined in: [interfaces.ts:10](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L10) +Defined in: [interfaces.ts:10](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L10) #### Inherited from @@ -126,7 +126,7 @@ Defined in: [interfaces.ts:10](https://github.com/humanprotocol/human-protocol/b > `optional` **jobTypes**: `string` -Defined in: [interfaces.ts:36](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L36) +Defined in: [interfaces.ts:36](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L36) *** @@ -134,7 +134,7 @@ Defined in: [interfaces.ts:36](https://github.com/humanprotocol/human-protocol/b > **lockedUntilTimestamp**: `bigint` -Defined in: [interfaces.ts:15](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L15) +Defined in: [interfaces.ts:15](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L15) #### Inherited from @@ -146,7 +146,7 @@ Defined in: [interfaces.ts:15](https://github.com/humanprotocol/human-protocol/b > `optional` **name**: `string` -Defined in: [interfaces.ts:30](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L30) +Defined in: [interfaces.ts:30](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L30) #### Inherited from @@ -158,7 +158,7 @@ Defined in: [interfaces.ts:30](https://github.com/humanprotocol/human-protocol/b > `optional` **publicKey**: `string` -Defined in: [interfaces.ts:22](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L22) +Defined in: [interfaces.ts:22](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L22) #### Inherited from @@ -170,7 +170,7 @@ Defined in: [interfaces.ts:22](https://github.com/humanprotocol/human-protocol/b > `optional` **registrationInstructions**: `string` -Defined in: [interfaces.ts:28](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L28) +Defined in: [interfaces.ts:28](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L28) #### Inherited from @@ -182,7 +182,7 @@ Defined in: [interfaces.ts:28](https://github.com/humanprotocol/human-protocol/b > `optional` **registrationNeeded**: `boolean` -Defined in: [interfaces.ts:27](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L27) +Defined in: [interfaces.ts:27](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L27) #### Inherited from @@ -194,7 +194,7 @@ Defined in: [interfaces.ts:27](https://github.com/humanprotocol/human-protocol/b > `optional` **reputationNetworks**: `object`[] -Defined in: [interfaces.ts:37](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L37) +Defined in: [interfaces.ts:37](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L37) #### address @@ -206,7 +206,7 @@ Defined in: [interfaces.ts:37](https://github.com/humanprotocol/human-protocol/b > **reward**: `bigint` -Defined in: [interfaces.ts:18](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L18) +Defined in: [interfaces.ts:18](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L18) #### Inherited from @@ -218,7 +218,7 @@ Defined in: [interfaces.ts:18](https://github.com/humanprotocol/human-protocol/b > `optional` **role**: `string` -Defined in: [interfaces.ts:20](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L20) +Defined in: [interfaces.ts:20](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L20) #### Inherited from @@ -230,7 +230,7 @@ Defined in: [interfaces.ts:20](https://github.com/humanprotocol/human-protocol/b > `optional` **url**: `string` -Defined in: [interfaces.ts:25](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L25) +Defined in: [interfaces.ts:25](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L25) #### Inherited from @@ -242,7 +242,7 @@ Defined in: [interfaces.ts:25](https://github.com/humanprotocol/human-protocol/b > `optional` **webhookUrl**: `string` -Defined in: [interfaces.ts:23](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L23) +Defined in: [interfaces.ts:23](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L23) #### Inherited from @@ -254,7 +254,7 @@ Defined in: [interfaces.ts:23](https://github.com/humanprotocol/human-protocol/b > `optional` **website**: `string` -Defined in: [interfaces.ts:24](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L24) +Defined in: [interfaces.ts:24](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L24) #### Inherited from diff --git a/docs/sdk/typescript/interfaces/interfaces/IOperatorsFilter.md b/docs/sdk/typescript/interfaces/interfaces/IOperatorsFilter.md index 90e83d1034..98b9d8427e 100644 --- a/docs/sdk/typescript/interfaces/interfaces/IOperatorsFilter.md +++ b/docs/sdk/typescript/interfaces/interfaces/IOperatorsFilter.md @@ -6,7 +6,7 @@ # Interface: IOperatorsFilter -Defined in: [interfaces.ts:40](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L40) +Defined in: [interfaces.ts:40](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L40) ## Extends @@ -18,7 +18,7 @@ Defined in: [interfaces.ts:40](https://github.com/humanprotocol/human-protocol/b > **chainId**: [`ChainId`](../../enums/enumerations/ChainId.md) -Defined in: [interfaces.ts:41](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L41) +Defined in: [interfaces.ts:41](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L41) *** @@ -26,7 +26,7 @@ Defined in: [interfaces.ts:41](https://github.com/humanprotocol/human-protocol/b > `optional` **first**: `number` -Defined in: [interfaces.ts:154](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L154) +Defined in: [interfaces.ts:154](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L154) #### Inherited from @@ -38,7 +38,7 @@ Defined in: [interfaces.ts:154](https://github.com/humanprotocol/human-protocol/ > `optional` **minAmountStaked**: `number` -Defined in: [interfaces.ts:43](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L43) +Defined in: [interfaces.ts:43](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L43) *** @@ -46,7 +46,7 @@ Defined in: [interfaces.ts:43](https://github.com/humanprotocol/human-protocol/b > `optional` **orderBy**: `string` -Defined in: [interfaces.ts:44](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L44) +Defined in: [interfaces.ts:44](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L44) *** @@ -54,7 +54,7 @@ Defined in: [interfaces.ts:44](https://github.com/humanprotocol/human-protocol/b > `optional` **orderDirection**: [`OrderDirection`](../../enums/enumerations/OrderDirection.md) -Defined in: [interfaces.ts:156](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L156) +Defined in: [interfaces.ts:156](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L156) #### Inherited from @@ -66,7 +66,7 @@ Defined in: [interfaces.ts:156](https://github.com/humanprotocol/human-protocol/ > `optional` **roles**: `string`[] -Defined in: [interfaces.ts:42](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L42) +Defined in: [interfaces.ts:42](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L42) *** @@ -74,7 +74,7 @@ Defined in: [interfaces.ts:42](https://github.com/humanprotocol/human-protocol/b > `optional` **skip**: `number` -Defined in: [interfaces.ts:155](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L155) +Defined in: [interfaces.ts:155](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L155) #### Inherited from diff --git a/docs/sdk/typescript/interfaces/interfaces/IPagination.md b/docs/sdk/typescript/interfaces/interfaces/IPagination.md index 18e9db9eb6..843b82ccf0 100644 --- a/docs/sdk/typescript/interfaces/interfaces/IPagination.md +++ b/docs/sdk/typescript/interfaces/interfaces/IPagination.md @@ -6,7 +6,7 @@ # Interface: IPagination -Defined in: [interfaces.ts:153](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L153) +Defined in: [interfaces.ts:153](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L153) ## Extended by @@ -25,7 +25,7 @@ Defined in: [interfaces.ts:153](https://github.com/humanprotocol/human-protocol/ > `optional` **first**: `number` -Defined in: [interfaces.ts:154](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L154) +Defined in: [interfaces.ts:154](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L154) *** @@ -33,7 +33,7 @@ Defined in: [interfaces.ts:154](https://github.com/humanprotocol/human-protocol/ > `optional` **orderDirection**: [`OrderDirection`](../../enums/enumerations/OrderDirection.md) -Defined in: [interfaces.ts:156](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L156) +Defined in: [interfaces.ts:156](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L156) *** @@ -41,4 +41,4 @@ Defined in: [interfaces.ts:156](https://github.com/humanprotocol/human-protocol/ > `optional` **skip**: `number` -Defined in: [interfaces.ts:155](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L155) +Defined in: [interfaces.ts:155](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L155) diff --git a/docs/sdk/typescript/interfaces/interfaces/IPayoutFilter.md b/docs/sdk/typescript/interfaces/interfaces/IPayoutFilter.md index d324186adb..f26f8ce479 100644 --- a/docs/sdk/typescript/interfaces/interfaces/IPayoutFilter.md +++ b/docs/sdk/typescript/interfaces/interfaces/IPayoutFilter.md @@ -6,7 +6,7 @@ # Interface: IPayoutFilter -Defined in: [interfaces.ts:106](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L106) +Defined in: [interfaces.ts:106](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L106) ## Extends @@ -18,7 +18,7 @@ Defined in: [interfaces.ts:106](https://github.com/humanprotocol/human-protocol/ > **chainId**: [`ChainId`](../../enums/enumerations/ChainId.md) -Defined in: [interfaces.ts:107](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L107) +Defined in: [interfaces.ts:107](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L107) *** @@ -26,7 +26,7 @@ Defined in: [interfaces.ts:107](https://github.com/humanprotocol/human-protocol/ > `optional` **escrowAddress**: `string` -Defined in: [interfaces.ts:108](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L108) +Defined in: [interfaces.ts:108](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L108) *** @@ -34,7 +34,7 @@ Defined in: [interfaces.ts:108](https://github.com/humanprotocol/human-protocol/ > `optional` **first**: `number` -Defined in: [interfaces.ts:154](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L154) +Defined in: [interfaces.ts:154](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L154) #### Inherited from @@ -46,7 +46,7 @@ Defined in: [interfaces.ts:154](https://github.com/humanprotocol/human-protocol/ > `optional` **from**: `Date` -Defined in: [interfaces.ts:110](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L110) +Defined in: [interfaces.ts:110](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L110) *** @@ -54,7 +54,7 @@ Defined in: [interfaces.ts:110](https://github.com/humanprotocol/human-protocol/ > `optional` **orderDirection**: [`OrderDirection`](../../enums/enumerations/OrderDirection.md) -Defined in: [interfaces.ts:156](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L156) +Defined in: [interfaces.ts:156](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L156) #### Inherited from @@ -66,7 +66,7 @@ Defined in: [interfaces.ts:156](https://github.com/humanprotocol/human-protocol/ > `optional` **recipient**: `string` -Defined in: [interfaces.ts:109](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L109) +Defined in: [interfaces.ts:109](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L109) *** @@ -74,7 +74,7 @@ Defined in: [interfaces.ts:109](https://github.com/humanprotocol/human-protocol/ > `optional` **skip**: `number` -Defined in: [interfaces.ts:155](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L155) +Defined in: [interfaces.ts:155](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L155) #### Inherited from @@ -86,4 +86,4 @@ Defined in: [interfaces.ts:155](https://github.com/humanprotocol/human-protocol/ > `optional` **to**: `Date` -Defined in: [interfaces.ts:111](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L111) +Defined in: [interfaces.ts:111](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L111) diff --git a/docs/sdk/typescript/interfaces/interfaces/IReputationNetwork.md b/docs/sdk/typescript/interfaces/interfaces/IReputationNetwork.md index a78f347469..43e0ad39b9 100644 --- a/docs/sdk/typescript/interfaces/interfaces/IReputationNetwork.md +++ b/docs/sdk/typescript/interfaces/interfaces/IReputationNetwork.md @@ -6,7 +6,7 @@ # Interface: IReputationNetwork -Defined in: [interfaces.ts:47](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L47) +Defined in: [interfaces.ts:47](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L47) ## Properties @@ -14,7 +14,7 @@ Defined in: [interfaces.ts:47](https://github.com/humanprotocol/human-protocol/b > **address**: `string` -Defined in: [interfaces.ts:49](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L49) +Defined in: [interfaces.ts:49](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L49) *** @@ -22,7 +22,7 @@ Defined in: [interfaces.ts:49](https://github.com/humanprotocol/human-protocol/b > **id**: `string` -Defined in: [interfaces.ts:48](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L48) +Defined in: [interfaces.ts:48](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L48) *** @@ -30,4 +30,4 @@ Defined in: [interfaces.ts:48](https://github.com/humanprotocol/human-protocol/b > **operators**: [`IOperator`](IOperator.md)[] -Defined in: [interfaces.ts:50](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L50) +Defined in: [interfaces.ts:50](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L50) diff --git a/docs/sdk/typescript/interfaces/interfaces/IReputationNetworkSubgraph.md b/docs/sdk/typescript/interfaces/interfaces/IReputationNetworkSubgraph.md index 79bb41371a..f95d053e34 100644 --- a/docs/sdk/typescript/interfaces/interfaces/IReputationNetworkSubgraph.md +++ b/docs/sdk/typescript/interfaces/interfaces/IReputationNetworkSubgraph.md @@ -6,7 +6,7 @@ # Interface: IReputationNetworkSubgraph -Defined in: [interfaces.ts:53](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L53) +Defined in: [interfaces.ts:53](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L53) ## Extends @@ -18,7 +18,7 @@ Defined in: [interfaces.ts:53](https://github.com/humanprotocol/human-protocol/b > **address**: `string` -Defined in: [interfaces.ts:49](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L49) +Defined in: [interfaces.ts:49](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L49) #### Inherited from @@ -30,7 +30,7 @@ Defined in: [interfaces.ts:49](https://github.com/humanprotocol/human-protocol/b > **id**: `string` -Defined in: [interfaces.ts:48](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L48) +Defined in: [interfaces.ts:48](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L48) #### Inherited from @@ -42,4 +42,4 @@ Defined in: [interfaces.ts:48](https://github.com/humanprotocol/human-protocol/b > **operators**: [`IOperatorSubgraph`](IOperatorSubgraph.md)[] -Defined in: [interfaces.ts:55](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L55) +Defined in: [interfaces.ts:55](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L55) diff --git a/docs/sdk/typescript/interfaces/interfaces/IReward.md b/docs/sdk/typescript/interfaces/interfaces/IReward.md index dbf06c2f1f..c1d7f4c389 100644 --- a/docs/sdk/typescript/interfaces/interfaces/IReward.md +++ b/docs/sdk/typescript/interfaces/interfaces/IReward.md @@ -6,7 +6,7 @@ # Interface: IReward -Defined in: [interfaces.ts:4](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L4) +Defined in: [interfaces.ts:4](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L4) ## Properties @@ -14,7 +14,7 @@ Defined in: [interfaces.ts:4](https://github.com/humanprotocol/human-protocol/bl > **amount**: `bigint` -Defined in: [interfaces.ts:6](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L6) +Defined in: [interfaces.ts:6](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L6) *** @@ -22,4 +22,4 @@ Defined in: [interfaces.ts:6](https://github.com/humanprotocol/human-protocol/bl > **escrowAddress**: `string` -Defined in: [interfaces.ts:5](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L5) +Defined in: [interfaces.ts:5](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L5) diff --git a/docs/sdk/typescript/interfaces/interfaces/IStatisticsFilter.md b/docs/sdk/typescript/interfaces/interfaces/IStatisticsFilter.md index 85c8c655a6..e739d9cf7a 100644 --- a/docs/sdk/typescript/interfaces/interfaces/IStatisticsFilter.md +++ b/docs/sdk/typescript/interfaces/interfaces/IStatisticsFilter.md @@ -6,7 +6,7 @@ # Interface: IStatisticsFilter -Defined in: [interfaces.ts:97](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L97) +Defined in: [interfaces.ts:97](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L97) ## Extends @@ -18,7 +18,7 @@ Defined in: [interfaces.ts:97](https://github.com/humanprotocol/human-protocol/b > `optional` **first**: `number` -Defined in: [interfaces.ts:154](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L154) +Defined in: [interfaces.ts:154](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L154) #### Inherited from @@ -30,7 +30,7 @@ Defined in: [interfaces.ts:154](https://github.com/humanprotocol/human-protocol/ > `optional` **from**: `Date` -Defined in: [interfaces.ts:98](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L98) +Defined in: [interfaces.ts:98](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L98) *** @@ -38,7 +38,7 @@ Defined in: [interfaces.ts:98](https://github.com/humanprotocol/human-protocol/b > `optional` **orderDirection**: [`OrderDirection`](../../enums/enumerations/OrderDirection.md) -Defined in: [interfaces.ts:156](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L156) +Defined in: [interfaces.ts:156](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L156) #### Inherited from @@ -50,7 +50,7 @@ Defined in: [interfaces.ts:156](https://github.com/humanprotocol/human-protocol/ > `optional` **skip**: `number` -Defined in: [interfaces.ts:155](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L155) +Defined in: [interfaces.ts:155](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L155) #### Inherited from @@ -62,4 +62,4 @@ Defined in: [interfaces.ts:155](https://github.com/humanprotocol/human-protocol/ > `optional` **to**: `Date` -Defined in: [interfaces.ts:99](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L99) +Defined in: [interfaces.ts:99](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L99) diff --git a/docs/sdk/typescript/interfaces/interfaces/IStatusEventFilter.md b/docs/sdk/typescript/interfaces/interfaces/IStatusEventFilter.md index d57093ca0d..2587378724 100644 --- a/docs/sdk/typescript/interfaces/interfaces/IStatusEventFilter.md +++ b/docs/sdk/typescript/interfaces/interfaces/IStatusEventFilter.md @@ -6,7 +6,7 @@ # Interface: IStatusEventFilter -Defined in: [interfaces.ts:166](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L166) +Defined in: [interfaces.ts:166](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L166) ## Extends @@ -18,7 +18,7 @@ Defined in: [interfaces.ts:166](https://github.com/humanprotocol/human-protocol/ > **chainId**: [`ChainId`](../../enums/enumerations/ChainId.md) -Defined in: [interfaces.ts:167](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L167) +Defined in: [interfaces.ts:167](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L167) *** @@ -26,7 +26,7 @@ Defined in: [interfaces.ts:167](https://github.com/humanprotocol/human-protocol/ > `optional` **first**: `number` -Defined in: [interfaces.ts:154](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L154) +Defined in: [interfaces.ts:154](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L154) #### Inherited from @@ -38,7 +38,7 @@ Defined in: [interfaces.ts:154](https://github.com/humanprotocol/human-protocol/ > `optional` **from**: `Date` -Defined in: [interfaces.ts:169](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L169) +Defined in: [interfaces.ts:169](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L169) *** @@ -46,7 +46,7 @@ Defined in: [interfaces.ts:169](https://github.com/humanprotocol/human-protocol/ > `optional` **launcher**: `string` -Defined in: [interfaces.ts:171](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L171) +Defined in: [interfaces.ts:171](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L171) *** @@ -54,7 +54,7 @@ Defined in: [interfaces.ts:171](https://github.com/humanprotocol/human-protocol/ > `optional` **orderDirection**: [`OrderDirection`](../../enums/enumerations/OrderDirection.md) -Defined in: [interfaces.ts:156](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L156) +Defined in: [interfaces.ts:156](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L156) #### Inherited from @@ -66,7 +66,7 @@ Defined in: [interfaces.ts:156](https://github.com/humanprotocol/human-protocol/ > `optional` **skip**: `number` -Defined in: [interfaces.ts:155](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L155) +Defined in: [interfaces.ts:155](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L155) #### Inherited from @@ -78,7 +78,7 @@ Defined in: [interfaces.ts:155](https://github.com/humanprotocol/human-protocol/ > `optional` **statuses**: [`EscrowStatus`](../../types/enumerations/EscrowStatus.md)[] -Defined in: [interfaces.ts:168](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L168) +Defined in: [interfaces.ts:168](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L168) *** @@ -86,4 +86,4 @@ Defined in: [interfaces.ts:168](https://github.com/humanprotocol/human-protocol/ > `optional` **to**: `Date` -Defined in: [interfaces.ts:170](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L170) +Defined in: [interfaces.ts:170](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L170) diff --git a/docs/sdk/typescript/interfaces/interfaces/ITransaction.md b/docs/sdk/typescript/interfaces/interfaces/ITransaction.md index b3408ebfb9..9c3b4136e2 100644 --- a/docs/sdk/typescript/interfaces/interfaces/ITransaction.md +++ b/docs/sdk/typescript/interfaces/interfaces/ITransaction.md @@ -6,7 +6,7 @@ # Interface: ITransaction -Defined in: [interfaces.ts:129](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L129) +Defined in: [interfaces.ts:129](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L129) ## Properties @@ -14,7 +14,7 @@ Defined in: [interfaces.ts:129](https://github.com/humanprotocol/human-protocol/ > **block**: `bigint` -Defined in: [interfaces.ts:130](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L130) +Defined in: [interfaces.ts:130](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L130) *** @@ -22,7 +22,7 @@ Defined in: [interfaces.ts:130](https://github.com/humanprotocol/human-protocol/ > `optional` **escrow**: `string` -Defined in: [interfaces.ts:138](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L138) +Defined in: [interfaces.ts:138](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L138) *** @@ -30,7 +30,7 @@ Defined in: [interfaces.ts:138](https://github.com/humanprotocol/human-protocol/ > **from**: `string` -Defined in: [interfaces.ts:132](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L132) +Defined in: [interfaces.ts:132](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L132) *** @@ -38,7 +38,7 @@ Defined in: [interfaces.ts:132](https://github.com/humanprotocol/human-protocol/ > **internalTransactions**: [`InternalTransaction`](InternalTransaction.md)[] -Defined in: [interfaces.ts:140](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L140) +Defined in: [interfaces.ts:140](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L140) *** @@ -46,7 +46,7 @@ Defined in: [interfaces.ts:140](https://github.com/humanprotocol/human-protocol/ > **method**: `string` -Defined in: [interfaces.ts:136](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L136) +Defined in: [interfaces.ts:136](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L136) *** @@ -54,7 +54,7 @@ Defined in: [interfaces.ts:136](https://github.com/humanprotocol/human-protocol/ > `optional` **receiver**: `string` -Defined in: [interfaces.ts:137](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L137) +Defined in: [interfaces.ts:137](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L137) *** @@ -62,7 +62,7 @@ Defined in: [interfaces.ts:137](https://github.com/humanprotocol/human-protocol/ > **timestamp**: `bigint` -Defined in: [interfaces.ts:134](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L134) +Defined in: [interfaces.ts:134](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L134) *** @@ -70,7 +70,7 @@ Defined in: [interfaces.ts:134](https://github.com/humanprotocol/human-protocol/ > **to**: `string` -Defined in: [interfaces.ts:133](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L133) +Defined in: [interfaces.ts:133](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L133) *** @@ -78,7 +78,7 @@ Defined in: [interfaces.ts:133](https://github.com/humanprotocol/human-protocol/ > `optional` **token**: `string` -Defined in: [interfaces.ts:139](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L139) +Defined in: [interfaces.ts:139](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L139) *** @@ -86,7 +86,7 @@ Defined in: [interfaces.ts:139](https://github.com/humanprotocol/human-protocol/ > **txHash**: `string` -Defined in: [interfaces.ts:131](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L131) +Defined in: [interfaces.ts:131](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L131) *** @@ -94,4 +94,4 @@ Defined in: [interfaces.ts:131](https://github.com/humanprotocol/human-protocol/ > **value**: `string` -Defined in: [interfaces.ts:135](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L135) +Defined in: [interfaces.ts:135](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L135) diff --git a/docs/sdk/typescript/interfaces/interfaces/ITransactionsFilter.md b/docs/sdk/typescript/interfaces/interfaces/ITransactionsFilter.md index 3fa146d5b4..1addac5318 100644 --- a/docs/sdk/typescript/interfaces/interfaces/ITransactionsFilter.md +++ b/docs/sdk/typescript/interfaces/interfaces/ITransactionsFilter.md @@ -6,7 +6,7 @@ # Interface: ITransactionsFilter -Defined in: [interfaces.ts:143](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L143) +Defined in: [interfaces.ts:143](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L143) ## Extends @@ -18,7 +18,7 @@ Defined in: [interfaces.ts:143](https://github.com/humanprotocol/human-protocol/ > **chainId**: [`ChainId`](../../enums/enumerations/ChainId.md) -Defined in: [interfaces.ts:144](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L144) +Defined in: [interfaces.ts:144](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L144) *** @@ -26,7 +26,7 @@ Defined in: [interfaces.ts:144](https://github.com/humanprotocol/human-protocol/ > `optional` **endBlock**: `number` -Defined in: [interfaces.ts:146](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L146) +Defined in: [interfaces.ts:146](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L146) *** @@ -34,7 +34,7 @@ Defined in: [interfaces.ts:146](https://github.com/humanprotocol/human-protocol/ > `optional` **endDate**: `Date` -Defined in: [interfaces.ts:148](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L148) +Defined in: [interfaces.ts:148](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L148) *** @@ -42,7 +42,7 @@ Defined in: [interfaces.ts:148](https://github.com/humanprotocol/human-protocol/ > `optional` **first**: `number` -Defined in: [interfaces.ts:154](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L154) +Defined in: [interfaces.ts:154](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L154) #### Inherited from @@ -54,7 +54,7 @@ Defined in: [interfaces.ts:154](https://github.com/humanprotocol/human-protocol/ > `optional` **fromAddress**: `string` -Defined in: [interfaces.ts:149](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L149) +Defined in: [interfaces.ts:149](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L149) *** @@ -62,7 +62,7 @@ Defined in: [interfaces.ts:149](https://github.com/humanprotocol/human-protocol/ > `optional` **orderDirection**: [`OrderDirection`](../../enums/enumerations/OrderDirection.md) -Defined in: [interfaces.ts:156](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L156) +Defined in: [interfaces.ts:156](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L156) #### Inherited from @@ -74,7 +74,7 @@ Defined in: [interfaces.ts:156](https://github.com/humanprotocol/human-protocol/ > `optional` **skip**: `number` -Defined in: [interfaces.ts:155](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L155) +Defined in: [interfaces.ts:155](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L155) #### Inherited from @@ -86,7 +86,7 @@ Defined in: [interfaces.ts:155](https://github.com/humanprotocol/human-protocol/ > `optional` **startBlock**: `number` -Defined in: [interfaces.ts:145](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L145) +Defined in: [interfaces.ts:145](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L145) *** @@ -94,7 +94,7 @@ Defined in: [interfaces.ts:145](https://github.com/humanprotocol/human-protocol/ > `optional` **startDate**: `Date` -Defined in: [interfaces.ts:147](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L147) +Defined in: [interfaces.ts:147](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L147) *** @@ -102,4 +102,4 @@ Defined in: [interfaces.ts:147](https://github.com/humanprotocol/human-protocol/ > `optional` **toAddress**: `string` -Defined in: [interfaces.ts:150](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L150) +Defined in: [interfaces.ts:150](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L150) diff --git a/docs/sdk/typescript/interfaces/interfaces/IWorker.md b/docs/sdk/typescript/interfaces/interfaces/IWorker.md index 11a8fa9ba5..ed50cb944c 100644 --- a/docs/sdk/typescript/interfaces/interfaces/IWorker.md +++ b/docs/sdk/typescript/interfaces/interfaces/IWorker.md @@ -6,7 +6,7 @@ # Interface: IWorker -Defined in: [interfaces.ts:174](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L174) +Defined in: [interfaces.ts:174](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L174) ## Properties @@ -14,7 +14,7 @@ Defined in: [interfaces.ts:174](https://github.com/humanprotocol/human-protocol/ > **address**: `string` -Defined in: [interfaces.ts:176](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L176) +Defined in: [interfaces.ts:176](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L176) *** @@ -22,7 +22,7 @@ Defined in: [interfaces.ts:176](https://github.com/humanprotocol/human-protocol/ > **id**: `string` -Defined in: [interfaces.ts:175](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L175) +Defined in: [interfaces.ts:175](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L175) *** @@ -30,7 +30,7 @@ Defined in: [interfaces.ts:175](https://github.com/humanprotocol/human-protocol/ > **payoutCount**: `number` -Defined in: [interfaces.ts:178](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L178) +Defined in: [interfaces.ts:178](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L178) *** @@ -38,4 +38,4 @@ Defined in: [interfaces.ts:178](https://github.com/humanprotocol/human-protocol/ > **totalAmountReceived**: `number` -Defined in: [interfaces.ts:177](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L177) +Defined in: [interfaces.ts:177](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L177) diff --git a/docs/sdk/typescript/interfaces/interfaces/IWorkersFilter.md b/docs/sdk/typescript/interfaces/interfaces/IWorkersFilter.md index 14a31aaf66..1dac603e1e 100644 --- a/docs/sdk/typescript/interfaces/interfaces/IWorkersFilter.md +++ b/docs/sdk/typescript/interfaces/interfaces/IWorkersFilter.md @@ -6,7 +6,7 @@ # Interface: IWorkersFilter -Defined in: [interfaces.ts:181](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L181) +Defined in: [interfaces.ts:181](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L181) ## Extends @@ -18,7 +18,7 @@ Defined in: [interfaces.ts:181](https://github.com/humanprotocol/human-protocol/ > `optional` **address**: `string` -Defined in: [interfaces.ts:183](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L183) +Defined in: [interfaces.ts:183](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L183) *** @@ -26,7 +26,7 @@ Defined in: [interfaces.ts:183](https://github.com/humanprotocol/human-protocol/ > **chainId**: [`ChainId`](../../enums/enumerations/ChainId.md) -Defined in: [interfaces.ts:182](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L182) +Defined in: [interfaces.ts:182](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L182) *** @@ -34,7 +34,7 @@ Defined in: [interfaces.ts:182](https://github.com/humanprotocol/human-protocol/ > `optional` **first**: `number` -Defined in: [interfaces.ts:154](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L154) +Defined in: [interfaces.ts:154](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L154) #### Inherited from @@ -46,7 +46,7 @@ Defined in: [interfaces.ts:154](https://github.com/humanprotocol/human-protocol/ > `optional` **orderBy**: `string` -Defined in: [interfaces.ts:184](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L184) +Defined in: [interfaces.ts:184](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L184) *** @@ -54,7 +54,7 @@ Defined in: [interfaces.ts:184](https://github.com/humanprotocol/human-protocol/ > `optional` **orderDirection**: [`OrderDirection`](../../enums/enumerations/OrderDirection.md) -Defined in: [interfaces.ts:156](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L156) +Defined in: [interfaces.ts:156](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L156) #### Inherited from @@ -66,7 +66,7 @@ Defined in: [interfaces.ts:156](https://github.com/humanprotocol/human-protocol/ > `optional` **skip**: `number` -Defined in: [interfaces.ts:155](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L155) +Defined in: [interfaces.ts:155](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L155) #### Inherited from diff --git a/docs/sdk/typescript/interfaces/interfaces/InternalTransaction.md b/docs/sdk/typescript/interfaces/interfaces/InternalTransaction.md index 8775833e43..d124889cd6 100644 --- a/docs/sdk/typescript/interfaces/interfaces/InternalTransaction.md +++ b/docs/sdk/typescript/interfaces/interfaces/InternalTransaction.md @@ -6,7 +6,7 @@ # Interface: InternalTransaction -Defined in: [interfaces.ts:119](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L119) +Defined in: [interfaces.ts:119](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L119) ## Properties @@ -14,7 +14,7 @@ Defined in: [interfaces.ts:119](https://github.com/humanprotocol/human-protocol/ > `optional` **escrow**: `string` -Defined in: [interfaces.ts:125](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L125) +Defined in: [interfaces.ts:125](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L125) *** @@ -22,7 +22,7 @@ Defined in: [interfaces.ts:125](https://github.com/humanprotocol/human-protocol/ > **from**: `string` -Defined in: [interfaces.ts:120](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L120) +Defined in: [interfaces.ts:120](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L120) *** @@ -30,7 +30,7 @@ Defined in: [interfaces.ts:120](https://github.com/humanprotocol/human-protocol/ > **method**: `string` -Defined in: [interfaces.ts:123](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L123) +Defined in: [interfaces.ts:123](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L123) *** @@ -38,7 +38,7 @@ Defined in: [interfaces.ts:123](https://github.com/humanprotocol/human-protocol/ > `optional` **receiver**: `string` -Defined in: [interfaces.ts:124](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L124) +Defined in: [interfaces.ts:124](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L124) *** @@ -46,7 +46,7 @@ Defined in: [interfaces.ts:124](https://github.com/humanprotocol/human-protocol/ > **to**: `string` -Defined in: [interfaces.ts:121](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L121) +Defined in: [interfaces.ts:121](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L121) *** @@ -54,7 +54,7 @@ Defined in: [interfaces.ts:121](https://github.com/humanprotocol/human-protocol/ > `optional` **token**: `string` -Defined in: [interfaces.ts:126](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L126) +Defined in: [interfaces.ts:126](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L126) *** @@ -62,4 +62,4 @@ Defined in: [interfaces.ts:126](https://github.com/humanprotocol/human-protocol/ > **value**: `string` -Defined in: [interfaces.ts:122](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L122) +Defined in: [interfaces.ts:122](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L122) diff --git a/docs/sdk/typescript/interfaces/interfaces/StakerInfo.md b/docs/sdk/typescript/interfaces/interfaces/StakerInfo.md index e0fd825cf4..fc9133e109 100644 --- a/docs/sdk/typescript/interfaces/interfaces/StakerInfo.md +++ b/docs/sdk/typescript/interfaces/interfaces/StakerInfo.md @@ -6,7 +6,7 @@ # Interface: StakerInfo -Defined in: [interfaces.ts:159](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L159) +Defined in: [interfaces.ts:159](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L159) ## Properties @@ -14,7 +14,7 @@ Defined in: [interfaces.ts:159](https://github.com/humanprotocol/human-protocol/ > **lockedAmount**: `bigint` -Defined in: [interfaces.ts:161](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L161) +Defined in: [interfaces.ts:161](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L161) *** @@ -22,7 +22,7 @@ Defined in: [interfaces.ts:161](https://github.com/humanprotocol/human-protocol/ > **lockedUntil**: `bigint` -Defined in: [interfaces.ts:162](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L162) +Defined in: [interfaces.ts:162](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L162) *** @@ -30,7 +30,7 @@ Defined in: [interfaces.ts:162](https://github.com/humanprotocol/human-protocol/ > **stakedAmount**: `bigint` -Defined in: [interfaces.ts:160](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L160) +Defined in: [interfaces.ts:160](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L160) *** @@ -38,4 +38,4 @@ Defined in: [interfaces.ts:160](https://github.com/humanprotocol/human-protocol/ > **withdrawableAmount**: `bigint` -Defined in: [interfaces.ts:163](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L163) +Defined in: [interfaces.ts:163](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L163) diff --git a/docs/sdk/typescript/kvstore/classes/KVStoreClient.md b/docs/sdk/typescript/kvstore/classes/KVStoreClient.md index 5e7a7d8eef..d2771766e0 100644 --- a/docs/sdk/typescript/kvstore/classes/KVStoreClient.md +++ b/docs/sdk/typescript/kvstore/classes/KVStoreClient.md @@ -6,7 +6,7 @@ # Class: KVStoreClient -Defined in: [kvstore.ts:99](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/kvstore.ts#L99) +Defined in: [kvstore.ts:99](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/kvstore.ts#L99) ## Introduction @@ -82,11 +82,11 @@ const kvstoreClient = await KVStoreClient.build(provider); ## Constructors -### new KVStoreClient() +### Constructor -> **new KVStoreClient**(`runner`, `networkData`): [`KVStoreClient`](KVStoreClient.md) +> **new KVStoreClient**(`runner`, `networkData`): `KVStoreClient` -Defined in: [kvstore.ts:108](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/kvstore.ts#L108) +Defined in: [kvstore.ts:108](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/kvstore.ts#L108) **KVStoreClient constructor** @@ -106,11 +106,11 @@ The network information required to connect to the KVStore contract #### Returns -[`KVStoreClient`](KVStoreClient.md) +`KVStoreClient` #### Overrides -[`BaseEthersClient`](../../base/classes/BaseEthersClient.md).[`constructor`](../../base/classes/BaseEthersClient.md#constructors) +[`BaseEthersClient`](../../base/classes/BaseEthersClient.md).[`constructor`](../../base/classes/BaseEthersClient.md#constructor) ## Properties @@ -118,11 +118,11 @@ The network information required to connect to the KVStore contract > **networkData**: [`NetworkData`](../../types/type-aliases/NetworkData.md) -Defined in: [base.ts:12](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L12) +Defined in: [base.ts:12](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L12) #### Inherited from -[`BaseEthersClient`](../../base/classes/BaseEthersClient.md).[`networkData`](../../base/classes/BaseEthersClient.md#networkdata-1) +[`BaseEthersClient`](../../base/classes/BaseEthersClient.md).[`networkData`](../../base/classes/BaseEthersClient.md#networkdata) *** @@ -130,19 +130,19 @@ Defined in: [base.ts:12](https://github.com/humanprotocol/human-protocol/blob/1f > `protected` **runner**: `ContractRunner` -Defined in: [base.ts:11](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L11) +Defined in: [base.ts:11](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L11) #### Inherited from -[`BaseEthersClient`](../../base/classes/BaseEthersClient.md).[`runner`](../../base/classes/BaseEthersClient.md#runner-1) +[`BaseEthersClient`](../../base/classes/BaseEthersClient.md).[`runner`](../../base/classes/BaseEthersClient.md#runner) ## Methods ### set() -> **set**(`key`, `value`, `txOptions`?): `Promise`\<`void`\> +> **set**(`key`, `value`, `txOptions?`): `Promise`\<`void`\> -Defined in: [kvstore.ts:171](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/kvstore.ts#L171) +Defined in: [kvstore.ts:171](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/kvstore.ts#L171) This function sets a key-value pair associated with the address that submits the transaction. @@ -194,9 +194,9 @@ await kvstoreClient.set('Role', 'RecordingOracle'); ### setBulk() -> **setBulk**(`keys`, `values`, `txOptions`?): `Promise`\<`void`\> +> **setBulk**(`keys`, `values`, `txOptions?`): `Promise`\<`void`\> -Defined in: [kvstore.ts:214](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/kvstore.ts#L214) +Defined in: [kvstore.ts:214](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/kvstore.ts#L214) This function sets key-value pairs in bulk associated with the address that submits the transaction. @@ -250,9 +250,9 @@ await kvstoreClient.setBulk(keys, values); ### setFileUrlAndHash() -> **setFileUrlAndHash**(`url`, `urlKey`, `txOptions`?): `Promise`\<`void`\> +> **setFileUrlAndHash**(`url`, `urlKey`, `txOptions?`): `Promise`\<`void`\> -Defined in: [kvstore.ts:257](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/kvstore.ts#L257) +Defined in: [kvstore.ts:257](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/kvstore.ts#L257) Sets a URL value for the address that submits the transaction, and its hash. @@ -303,9 +303,9 @@ await kvstoreClient.setFileUrlAndHash('linkedin.com/example', 'linkedin_url'); ### build() -> `static` **build**(`runner`): `Promise`\<[`KVStoreClient`](KVStoreClient.md)\> +> `static` **build**(`runner`): `Promise`\<`KVStoreClient`\> -Defined in: [kvstore.ts:126](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/kvstore.ts#L126) +Defined in: [kvstore.ts:126](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/kvstore.ts#L126) Creates an instance of KVStoreClient from a runner. @@ -319,7 +319,7 @@ The Runner object to interact with the Ethereum network #### Returns -`Promise`\<[`KVStoreClient`](KVStoreClient.md)\> +`Promise`\<`KVStoreClient`\> - An instance of KVStoreClient diff --git a/docs/sdk/typescript/kvstore/classes/KVStoreUtils.md b/docs/sdk/typescript/kvstore/classes/KVStoreUtils.md index b2256eac5b..1fbf8950a3 100644 --- a/docs/sdk/typescript/kvstore/classes/KVStoreUtils.md +++ b/docs/sdk/typescript/kvstore/classes/KVStoreUtils.md @@ -6,7 +6,7 @@ # Class: KVStoreUtils -Defined in: [kvstore.ts:318](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/kvstore.ts#L318) +Defined in: [kvstore.ts:318](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/kvstore.ts#L318) ## Introduction @@ -41,13 +41,13 @@ const KVStoreAddresses = await KVStoreUtils.getKVStoreData( ## Constructors -### new KVStoreUtils() +### Constructor -> **new KVStoreUtils**(): [`KVStoreUtils`](KVStoreUtils.md) +> **new KVStoreUtils**(): `KVStoreUtils` #### Returns -[`KVStoreUtils`](KVStoreUtils.md) +`KVStoreUtils` ## Methods @@ -55,7 +55,7 @@ const KVStoreAddresses = await KVStoreUtils.getKVStoreData( > `static` **get**(`chainId`, `address`, `key`): `Promise`\<`string`\> -Defined in: [kvstore.ts:389](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/kvstore.ts#L389) +Defined in: [kvstore.ts:389](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/kvstore.ts#L389) Gets the value of a key-value pair in the KVStore using the subgraph. @@ -116,7 +116,7 @@ console.log(value); > `static` **getFileUrlAndVerifyHash**(`chainId`, `address`, `urlKey`): `Promise`\<`string`\> -Defined in: [kvstore.ts:436](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/kvstore.ts#L436) +Defined in: [kvstore.ts:436](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/kvstore.ts#L436) Gets the URL value of the given entity, and verifies its hash. @@ -164,7 +164,7 @@ console.log(url); > `static` **getKVStoreData**(`chainId`, `address`): `Promise`\<[`IKVStore`](../../interfaces/interfaces/IKVStore.md)[]\> -Defined in: [kvstore.ts:337](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/kvstore.ts#L337) +Defined in: [kvstore.ts:337](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/kvstore.ts#L337) This function returns the KVStore data for a given address. @@ -211,7 +211,7 @@ console.log(kvStoreData); > `static` **getPublicKey**(`chainId`, `address`): `Promise`\<`string`\> -Defined in: [kvstore.ts:496](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/kvstore.ts#L496) +Defined in: [kvstore.ts:496](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/kvstore.ts#L496) Gets the public key of the given entity, and verifies its hash. diff --git a/docs/sdk/typescript/operator/classes/OperatorUtils.md b/docs/sdk/typescript/operator/classes/OperatorUtils.md index 9e675b0bd4..7842ae3d3b 100644 --- a/docs/sdk/typescript/operator/classes/OperatorUtils.md +++ b/docs/sdk/typescript/operator/classes/OperatorUtils.md @@ -6,17 +6,17 @@ # Class: OperatorUtils -Defined in: [operator.ts:27](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/operator.ts#L27) +Defined in: [operator.ts:27](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/operator.ts#L27) ## Constructors -### new OperatorUtils() +### Constructor -> **new OperatorUtils**(): [`OperatorUtils`](OperatorUtils.md) +> **new OperatorUtils**(): `OperatorUtils` #### Returns -[`OperatorUtils`](OperatorUtils.md) +`OperatorUtils` ## Methods @@ -24,7 +24,7 @@ Defined in: [operator.ts:27](https://github.com/humanprotocol/human-protocol/blo > `static` **getOperator**(`chainId`, `address`): `Promise`\<[`IOperator`](../../interfaces/interfaces/IOperator.md)\> -Defined in: [operator.ts:43](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/operator.ts#L43) +Defined in: [operator.ts:43](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/operator.ts#L43) This function returns the operator data for the given address. @@ -62,7 +62,7 @@ const operator = await OperatorUtils.getOperator(ChainId.POLYGON_AMOY, '0x62dD51 > `static` **getOperators**(`filter`): `Promise`\<[`IOperator`](../../interfaces/interfaces/IOperator.md)[]\> -Defined in: [operator.ts:109](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/operator.ts#L109) +Defined in: [operator.ts:109](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/operator.ts#L109) This function returns all the operator details of the protocol. @@ -95,9 +95,9 @@ const operators = await OperatorUtils.getOperators(filter); ### getReputationNetworkOperators() -> `static` **getReputationNetworkOperators**(`chainId`, `address`, `role`?): `Promise`\<[`IOperator`](../../interfaces/interfaces/IOperator.md)[]\> +> `static` **getReputationNetworkOperators**(`chainId`, `address`, `role?`): `Promise`\<[`IOperator`](../../interfaces/interfaces/IOperator.md)[]\> -Defined in: [operator.ts:190](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/operator.ts#L190) +Defined in: [operator.ts:190](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/operator.ts#L190) Retrieves the reputation network operators of the specified address. @@ -141,7 +141,7 @@ const operators = await OperatorUtils.getReputationNetworkOperators(ChainId.POLY > `static` **getRewards**(`chainId`, `slasherAddress`): `Promise`\<[`IReward`](../../interfaces/interfaces/IReward.md)[]\> -Defined in: [operator.ts:244](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/operator.ts#L244) +Defined in: [operator.ts:244](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/operator.ts#L244) This function returns information about the rewards for a given slasher address. diff --git a/docs/sdk/typescript/staking/classes/StakingClient.md b/docs/sdk/typescript/staking/classes/StakingClient.md index bd9b92b82e..34f6cd2685 100644 --- a/docs/sdk/typescript/staking/classes/StakingClient.md +++ b/docs/sdk/typescript/staking/classes/StakingClient.md @@ -6,7 +6,7 @@ # Class: StakingClient -Defined in: [staking.ts:97](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/staking.ts#L97) +Defined in: [staking.ts:97](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/staking.ts#L97) ## Introduction @@ -82,11 +82,11 @@ const stakingClient = await StakingClient.build(provider); ## Constructors -### new StakingClient() +### Constructor -> **new StakingClient**(`runner`, `networkData`): [`StakingClient`](StakingClient.md) +> **new StakingClient**(`runner`, `networkData`): `StakingClient` -Defined in: [staking.ts:108](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/staking.ts#L108) +Defined in: [staking.ts:108](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/staking.ts#L108) **StakingClient constructor** @@ -106,11 +106,11 @@ The network information required to connect to the Staking contract #### Returns -[`StakingClient`](StakingClient.md) +`StakingClient` #### Overrides -[`BaseEthersClient`](../../base/classes/BaseEthersClient.md).[`constructor`](../../base/classes/BaseEthersClient.md#constructors) +[`BaseEthersClient`](../../base/classes/BaseEthersClient.md).[`constructor`](../../base/classes/BaseEthersClient.md#constructor) ## Properties @@ -118,7 +118,7 @@ The network information required to connect to the Staking contract > **escrowFactoryContract**: `EscrowFactory` -Defined in: [staking.ts:100](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/staking.ts#L100) +Defined in: [staking.ts:100](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/staking.ts#L100) *** @@ -126,11 +126,11 @@ Defined in: [staking.ts:100](https://github.com/humanprotocol/human-protocol/blo > **networkData**: [`NetworkData`](../../types/type-aliases/NetworkData.md) -Defined in: [base.ts:12](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L12) +Defined in: [base.ts:12](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L12) #### Inherited from -[`BaseEthersClient`](../../base/classes/BaseEthersClient.md).[`networkData`](../../base/classes/BaseEthersClient.md#networkdata-1) +[`BaseEthersClient`](../../base/classes/BaseEthersClient.md).[`networkData`](../../base/classes/BaseEthersClient.md#networkdata) *** @@ -138,11 +138,11 @@ Defined in: [base.ts:12](https://github.com/humanprotocol/human-protocol/blob/1f > `protected` **runner**: `ContractRunner` -Defined in: [base.ts:11](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L11) +Defined in: [base.ts:11](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L11) #### Inherited from -[`BaseEthersClient`](../../base/classes/BaseEthersClient.md).[`runner`](../../base/classes/BaseEthersClient.md#runner-1) +[`BaseEthersClient`](../../base/classes/BaseEthersClient.md).[`runner`](../../base/classes/BaseEthersClient.md#runner) *** @@ -150,7 +150,7 @@ Defined in: [base.ts:11](https://github.com/humanprotocol/human-protocol/blob/1f > **stakingContract**: `Staking` -Defined in: [staking.ts:99](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/staking.ts#L99) +Defined in: [staking.ts:99](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/staking.ts#L99) *** @@ -158,15 +158,15 @@ Defined in: [staking.ts:99](https://github.com/humanprotocol/human-protocol/blob > **tokenContract**: `HMToken` -Defined in: [staking.ts:98](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/staking.ts#L98) +Defined in: [staking.ts:98](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/staking.ts#L98) ## Methods ### approveStake() -> **approveStake**(`amount`, `txOptions`?): `Promise`\<`void`\> +> **approveStake**(`amount`, `txOptions?`): `Promise`\<`void`\> -Defined in: [staking.ts:193](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/staking.ts#L193) +Defined in: [staking.ts:193](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/staking.ts#L193) This function approves the staking contract to transfer a specified amount of tokens when the user stakes. It increases the allowance for the staking contract. @@ -213,7 +213,7 @@ await stakingClient.approveStake(amount); > **getStakerInfo**(`stakerAddress`): `Promise`\<[`StakerInfo`](../../interfaces/interfaces/StakerInfo.md)\> -Defined in: [staking.ts:435](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/staking.ts#L435) +Defined in: [staking.ts:435](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/staking.ts#L435) Retrieves comprehensive staking information for a staker. @@ -247,9 +247,9 @@ console.log(stakingInfo.tokensStaked); ### slash() -> **slash**(`slasher`, `staker`, `escrowAddress`, `amount`, `txOptions`?): `Promise`\<`void`\> +> **slash**(`slasher`, `staker`, `escrowAddress`, `amount`, `txOptions?`): `Promise`\<`void`\> -Defined in: [staking.ts:373](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/staking.ts#L373) +Defined in: [staking.ts:373](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/staking.ts#L373) This function reduces the allocated amount by a staker in an escrow and transfers those tokens to the reward pool. This allows the slasher to claim them later. @@ -312,9 +312,9 @@ await stakingClient.slash('0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266', '0xf39Fd ### stake() -> **stake**(`amount`, `txOptions`?): `Promise`\<`void`\> +> **stake**(`amount`, `txOptions?`): `Promise`\<`void`\> -Defined in: [staking.ts:247](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/staking.ts#L247) +Defined in: [staking.ts:247](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/staking.ts#L247) This function stakes a specified amount of tokens on a specific network. @@ -362,9 +362,9 @@ await stakingClient.stake(amount); ### unstake() -> **unstake**(`amount`, `txOptions`?): `Promise`\<`void`\> +> **unstake**(`amount`, `txOptions?`): `Promise`\<`void`\> -Defined in: [staking.ts:291](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/staking.ts#L291) +Defined in: [staking.ts:291](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/staking.ts#L291) This function unstakes tokens from staking contract. The unstaked tokens stay locked for a period of time. @@ -411,9 +411,9 @@ await stakingClient.unstake(amount); ### withdraw() -> **withdraw**(`txOptions`?): `Promise`\<`void`\> +> **withdraw**(`txOptions?`): `Promise`\<`void`\> -Defined in: [staking.ts:336](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/staking.ts#L336) +Defined in: [staking.ts:336](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/staking.ts#L336) This function withdraws unstaked and non-locked tokens from staking contract to the user wallet. @@ -453,9 +453,9 @@ await stakingClient.withdraw(); ### build() -> `static` **build**(`runner`): `Promise`\<[`StakingClient`](StakingClient.md)\> +> `static` **build**(`runner`): `Promise`\<`StakingClient`\> -Defined in: [staking.ts:136](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/staking.ts#L136) +Defined in: [staking.ts:136](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/staking.ts#L136) Creates an instance of StakingClient from a Runner. @@ -469,7 +469,7 @@ The Runner object to interact with the Ethereum network #### Returns -`Promise`\<[`StakingClient`](StakingClient.md)\> +`Promise`\<`StakingClient`\> - An instance of StakingClient diff --git a/docs/sdk/typescript/statistics/classes/StatisticsClient.md b/docs/sdk/typescript/statistics/classes/StatisticsClient.md index 3dd493b5e5..908463c679 100644 --- a/docs/sdk/typescript/statistics/classes/StatisticsClient.md +++ b/docs/sdk/typescript/statistics/classes/StatisticsClient.md @@ -6,7 +6,7 @@ # Class: StatisticsClient -Defined in: [statistics.ts:58](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/statistics.ts#L58) +Defined in: [statistics.ts:58](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/statistics.ts#L58) ## Introduction @@ -41,11 +41,11 @@ const statisticsClient = new StatisticsClient(NETWORKS[ChainId.POLYGON_AMOY]); ## Constructors -### new StatisticsClient() +### Constructor -> **new StatisticsClient**(`networkData`): [`StatisticsClient`](StatisticsClient.md) +> **new StatisticsClient**(`networkData`): `StatisticsClient` -Defined in: [statistics.ts:67](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/statistics.ts#L67) +Defined in: [statistics.ts:67](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/statistics.ts#L67) **StatisticsClient constructor** @@ -59,7 +59,7 @@ The network information required to connect to the Statistics contract #### Returns -[`StatisticsClient`](StatisticsClient.md) +`StatisticsClient` ## Properties @@ -67,7 +67,7 @@ The network information required to connect to the Statistics contract > **networkData**: [`NetworkData`](../../types/type-aliases/NetworkData.md) -Defined in: [statistics.ts:59](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/statistics.ts#L59) +Defined in: [statistics.ts:59](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/statistics.ts#L59) *** @@ -75,7 +75,7 @@ Defined in: [statistics.ts:59](https://github.com/humanprotocol/human-protocol/b > **subgraphUrl**: `string` -Defined in: [statistics.ts:60](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/statistics.ts#L60) +Defined in: [statistics.ts:60](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/statistics.ts#L60) ## Methods @@ -83,7 +83,7 @@ Defined in: [statistics.ts:60](https://github.com/humanprotocol/human-protocol/b > **getEscrowStatistics**(`filter`): `Promise`\<[`EscrowStatistics`](../../graphql/types/type-aliases/EscrowStatistics.md)\> -Defined in: [statistics.ts:120](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/statistics.ts#L120) +Defined in: [statistics.ts:120](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/statistics.ts#L120) This function returns the statistical data of escrows. @@ -149,7 +149,7 @@ const escrowStatisticsApril = await statisticsClient.getEscrowStatistics({ > **getHMTDailyData**(`filter`): `Promise`\<[`DailyHMTData`](../../graphql/types/type-aliases/DailyHMTData.md)[]\> -Defined in: [statistics.ts:478](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/statistics.ts#L478) +Defined in: [statistics.ts:478](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/statistics.ts#L478) This function returns the statistical data of HMToken day by day. @@ -214,7 +214,7 @@ console.log('HMT statistics from 5/8 - 6/8:', hmtStatisticsRange); > **getHMTHolders**(`params`): `Promise`\<[`HMTHolder`](../../graphql/types/type-aliases/HMTHolder.md)[]\> -Defined in: [statistics.ts:407](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/statistics.ts#L407) +Defined in: [statistics.ts:407](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/statistics.ts#L407) This function returns the holders of the HMToken with optional filters and ordering. @@ -257,7 +257,7 @@ console.log('HMT holders:', hmtHolders.map((h) => ({ > **getHMTStatistics**(): `Promise`\<[`HMTStatistics`](../../graphql/types/type-aliases/HMTStatistics.md)\> -Defined in: [statistics.ts:364](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/statistics.ts#L364) +Defined in: [statistics.ts:364](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/statistics.ts#L364) This function returns the statistical data of HMToken. @@ -296,7 +296,7 @@ console.log('HMT statistics:', { > **getPaymentStatistics**(`filter`): `Promise`\<[`PaymentStatistics`](../../graphql/types/type-aliases/PaymentStatistics.md)\> -Defined in: [statistics.ts:300](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/statistics.ts#L300) +Defined in: [statistics.ts:300](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/statistics.ts#L300) This function returns the statistical data of payments. @@ -380,7 +380,7 @@ console.log( > **getWorkerStatistics**(`filter`): `Promise`\<[`WorkerStatistics`](../../graphql/types/type-aliases/WorkerStatistics.md)\> -Defined in: [statistics.ts:204](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/statistics.ts#L204) +Defined in: [statistics.ts:204](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/statistics.ts#L204) This function returns the statistical data of workers. diff --git a/docs/sdk/typescript/storage/classes/StorageClient.md b/docs/sdk/typescript/storage/classes/StorageClient.md index 6204af8592..a3a552a1f5 100644 --- a/docs/sdk/typescript/storage/classes/StorageClient.md +++ b/docs/sdk/typescript/storage/classes/StorageClient.md @@ -6,7 +6,7 @@ # Class: ~~StorageClient~~ -Defined in: [storage.ts:63](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/storage.ts#L63) +Defined in: [storage.ts:63](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/storage.ts#L63) ## Deprecated @@ -57,11 +57,11 @@ const storageClient = new StorageClient(params, credentials); ## Constructors -### new StorageClient() +### Constructor -> **new StorageClient**(`params`, `credentials`?): [`StorageClient`](StorageClient.md) +> **new StorageClient**(`params`, `credentials?`): `StorageClient` -Defined in: [storage.ts:73](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/storage.ts#L73) +Defined in: [storage.ts:73](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/storage.ts#L73) **Storage client constructor** @@ -81,7 +81,7 @@ Optional. Cloud storage access data. If credentials are not provided - use anony #### Returns -[`StorageClient`](StorageClient.md) +`StorageClient` ## Methods @@ -89,7 +89,7 @@ Optional. Cloud storage access data. If credentials are not provided - use anony > **bucketExists**(`bucket`): `Promise`\<`boolean`\> -Defined in: [storage.ts:262](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/storage.ts#L262) +Defined in: [storage.ts:262](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/storage.ts#L262) This function checks if a bucket exists. @@ -133,7 +133,7 @@ const exists = await storageClient.bucketExists('bucket-name'); > **downloadFiles**(`keys`, `bucket`): `Promise`\<`any`[]\> -Defined in: [storage.ts:112](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/storage.ts#L112) +Defined in: [storage.ts:112](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/storage.ts#L112) This function downloads files from a bucket. @@ -181,7 +181,7 @@ const files = await storageClient.downloadFiles(keys, 'bucket-name'); > **listObjects**(`bucket`): `Promise`\<`string`[]\> -Defined in: [storage.ts:292](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/storage.ts#L292) +Defined in: [storage.ts:292](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/storage.ts#L292) This function lists all file names contained in the bucket. @@ -225,7 +225,7 @@ const fileNames = await storageClient.listObjects('bucket-name'); > **uploadFiles**(`files`, `bucket`): `Promise`\<[`UploadFile`](../../types/type-aliases/UploadFile.md)[]\> -Defined in: [storage.ts:198](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/storage.ts#L198) +Defined in: [storage.ts:198](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/storage.ts#L198) This function uploads files to a bucket. @@ -278,7 +278,7 @@ const uploadedFiles = await storageClient.uploadFiles(files, 'bucket-name'); > `static` **downloadFileFromUrl**(`url`): `Promise`\<`any`\> -Defined in: [storage.ts:146](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/storage.ts#L146) +Defined in: [storage.ts:146](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/storage.ts#L146) This function downloads files from a URL. diff --git a/docs/sdk/typescript/transaction/classes/TransactionUtils.md b/docs/sdk/typescript/transaction/classes/TransactionUtils.md index e6031b2f4d..06e203fd38 100644 --- a/docs/sdk/typescript/transaction/classes/TransactionUtils.md +++ b/docs/sdk/typescript/transaction/classes/TransactionUtils.md @@ -6,17 +6,17 @@ # Class: TransactionUtils -Defined in: [transaction.ts:18](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/transaction.ts#L18) +Defined in: [transaction.ts:18](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/transaction.ts#L18) ## Constructors -### new TransactionUtils() +### Constructor -> **new TransactionUtils**(): [`TransactionUtils`](TransactionUtils.md) +> **new TransactionUtils**(): `TransactionUtils` #### Returns -[`TransactionUtils`](TransactionUtils.md) +`TransactionUtils` ## Methods @@ -24,7 +24,7 @@ Defined in: [transaction.ts:18](https://github.com/humanprotocol/human-protocol/ > `static` **getTransaction**(`chainId`, `hash`): `Promise`\<[`ITransaction`](../../interfaces/interfaces/ITransaction.md)\> -Defined in: [transaction.ts:34](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/transaction.ts#L34) +Defined in: [transaction.ts:34](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/transaction.ts#L34) This function returns the transaction data for the given hash. @@ -62,7 +62,7 @@ const transaction = await TransactionUtils.getTransaction(ChainId.POLYGON, '0x62 > `static` **getTransactions**(`filter`): `Promise`\<[`ITransaction`](../../interfaces/interfaces/ITransaction.md)[]\> -Defined in: [transaction.ts:109](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/transaction.ts#L109) +Defined in: [transaction.ts:109](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/transaction.ts#L109) This function returns all transaction details based on the provided filter. diff --git a/docs/sdk/typescript/types/enumerations/EscrowStatus.md b/docs/sdk/typescript/types/enumerations/EscrowStatus.md index d0e0362ce2..bd0eb7b5a4 100644 --- a/docs/sdk/typescript/types/enumerations/EscrowStatus.md +++ b/docs/sdk/typescript/types/enumerations/EscrowStatus.md @@ -6,7 +6,7 @@ # Enumeration: EscrowStatus -Defined in: [types.ts:8](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L8) +Defined in: [types.ts:8](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L8) Enum for escrow statuses. @@ -16,7 +16,7 @@ Enum for escrow statuses. > **Cancelled**: `5` -Defined in: [types.ts:32](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L32) +Defined in: [types.ts:32](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L32) Escrow is cancelled. @@ -26,7 +26,7 @@ Escrow is cancelled. > **Complete**: `4` -Defined in: [types.ts:28](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L28) +Defined in: [types.ts:28](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L28) Escrow is finished. @@ -36,7 +36,7 @@ Escrow is finished. > **Launched**: `0` -Defined in: [types.ts:12](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L12) +Defined in: [types.ts:12](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L12) Escrow is launched. @@ -46,7 +46,7 @@ Escrow is launched. > **Paid**: `3` -Defined in: [types.ts:24](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L24) +Defined in: [types.ts:24](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L24) Escrow is fully paid. @@ -56,7 +56,7 @@ Escrow is fully paid. > **Partial**: `2` -Defined in: [types.ts:20](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L20) +Defined in: [types.ts:20](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L20) Escrow is partially paid out. @@ -66,6 +66,6 @@ Escrow is partially paid out. > **Pending**: `1` -Defined in: [types.ts:16](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L16) +Defined in: [types.ts:16](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L16) Escrow is funded, and waiting for the results to be submitted. diff --git a/docs/sdk/typescript/types/type-aliases/EscrowCancel.md b/docs/sdk/typescript/types/type-aliases/EscrowCancel.md index 8d4fd28d84..f9ba874441 100644 --- a/docs/sdk/typescript/types/type-aliases/EscrowCancel.md +++ b/docs/sdk/typescript/types/type-aliases/EscrowCancel.md @@ -6,22 +6,28 @@ # Type Alias: EscrowCancel -> **EscrowCancel**: `object` +> **EscrowCancel** = `object` -Defined in: [types.ts:145](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L145) +Defined in: [types.ts:145](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L145) Represents the response data for an escrow cancellation. -## Type declaration +## Properties ### amountRefunded > **amountRefunded**: `bigint` +Defined in: [types.ts:153](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L153) + The amount refunded in the escrow cancellation. +*** + ### txHash > **txHash**: `string` +Defined in: [types.ts:149](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L149) + The hash of the transaction associated with the escrow cancellation. diff --git a/docs/sdk/typescript/types/type-aliases/EscrowWithdraw.md b/docs/sdk/typescript/types/type-aliases/EscrowWithdraw.md index cc8658ac8c..dd316282ff 100644 --- a/docs/sdk/typescript/types/type-aliases/EscrowWithdraw.md +++ b/docs/sdk/typescript/types/type-aliases/EscrowWithdraw.md @@ -6,28 +6,38 @@ # Type Alias: EscrowWithdraw -> **EscrowWithdraw**: `object` +> **EscrowWithdraw** = `object` -Defined in: [types.ts:159](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L159) +Defined in: [types.ts:159](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L159) Represents the response data for an escrow withdrawal. -## Type declaration +## Properties ### amountWithdrawn > **amountWithdrawn**: `bigint` +Defined in: [types.ts:171](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L171) + The amount withdrawn from the escrow. +*** + ### tokenAddress > **tokenAddress**: `string` +Defined in: [types.ts:167](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L167) + The address of the token used for the withdrawal. +*** + ### txHash > **txHash**: `string` +Defined in: [types.ts:163](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L163) + The hash of the transaction associated with the escrow withdrawal. diff --git a/docs/sdk/typescript/types/type-aliases/NetworkData.md b/docs/sdk/typescript/types/type-aliases/NetworkData.md index 159e72044f..45b8457817 100644 --- a/docs/sdk/typescript/types/type-aliases/NetworkData.md +++ b/docs/sdk/typescript/types/type-aliases/NetworkData.md @@ -6,76 +6,118 @@ # Type Alias: NetworkData -> **NetworkData**: `object` +> **NetworkData** = `object` -Defined in: [types.ts:95](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L95) +Defined in: [types.ts:95](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L95) Network data -## Type declaration +## Properties ### chainId > **chainId**: `number` +Defined in: [types.ts:99](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L99) + Network chain id +*** + ### factoryAddress > **factoryAddress**: `string` +Defined in: [types.ts:115](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L115) + Escrow Factory contract address +*** + ### hmtAddress > **hmtAddress**: `string` +Defined in: [types.ts:111](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L111) + HMT Token contract address +*** + ### kvstoreAddress > **kvstoreAddress**: `string` +Defined in: [types.ts:123](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L123) + KVStore contract address +*** + ### oldFactoryAddress > **oldFactoryAddress**: `string` +Defined in: [types.ts:139](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L139) + Old Escrow Factory contract address +*** + ### oldSubgraphUrl > **oldSubgraphUrl**: `string` +Defined in: [types.ts:135](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L135) + Old subgraph URL +*** + ### scanUrl > **scanUrl**: `string` +Defined in: [types.ts:107](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L107) + Network scanner URL +*** + ### stakingAddress > **stakingAddress**: `string` +Defined in: [types.ts:119](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L119) + Staking contract address +*** + ### subgraphUrl > **subgraphUrl**: `string` +Defined in: [types.ts:127](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L127) + Subgraph URL +*** + ### subgraphUrlApiKey > **subgraphUrlApiKey**: `string` +Defined in: [types.ts:131](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L131) + Subgraph URL API key +*** + ### title > **title**: `string` +Defined in: [types.ts:103](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L103) + Network title diff --git a/docs/sdk/typescript/types/type-aliases/Payout.md b/docs/sdk/typescript/types/type-aliases/Payout.md index 66df79f1a1..e561bcb54b 100644 --- a/docs/sdk/typescript/types/type-aliases/Payout.md +++ b/docs/sdk/typescript/types/type-aliases/Payout.md @@ -6,40 +6,58 @@ # Type Alias: Payout -> **Payout**: `object` +> **Payout** = `object` -Defined in: [types.ts:177](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L177) +Defined in: [types.ts:177](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L177) Represents a payout from an escrow. -## Type declaration +## Properties ### amount > **amount**: `bigint` +Defined in: [types.ts:193](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L193) + The amount paid to the recipient. +*** + ### createdAt > **createdAt**: `number` +Defined in: [types.ts:197](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L197) + The timestamp when the payout was created (in UNIX format). +*** + ### escrowAddress > **escrowAddress**: `string` +Defined in: [types.ts:185](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L185) + The address of the escrow associated with the payout. +*** + ### id > **id**: `string` +Defined in: [types.ts:181](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L181) + Unique identifier of the payout. +*** + ### recipient > **recipient**: `string` +Defined in: [types.ts:189](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L189) + The address of the recipient who received the payout. diff --git a/docs/sdk/typescript/types/type-aliases/StorageCredentials.md b/docs/sdk/typescript/types/type-aliases/StorageCredentials.md index ad1b794aec..03e684053d 100644 --- a/docs/sdk/typescript/types/type-aliases/StorageCredentials.md +++ b/docs/sdk/typescript/types/type-aliases/StorageCredentials.md @@ -6,26 +6,32 @@ # Type Alias: ~~StorageCredentials~~ -> `readonly` **StorageCredentials**: `object` +> `readonly` **StorageCredentials** = `object` -Defined in: [types.ts:40](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L40) +Defined in: [types.ts:40](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L40) AWS/GCP cloud storage access data -## Type declaration +## Deprecated + +StorageClient is deprecated. Use Minio.Client directly. + +## Properties ### ~~accessKey~~ > **accessKey**: `string` +Defined in: [types.ts:44](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L44) + Access Key +*** + ### ~~secretKey~~ > **secretKey**: `string` -Secret Key - -## Deprecated +Defined in: [types.ts:48](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L48) -StorageClient is deprecated. Use Minio.Client directly. +Secret Key diff --git a/docs/sdk/typescript/types/type-aliases/StorageParams.md b/docs/sdk/typescript/types/type-aliases/StorageParams.md index d86df41951..78db5e7c33 100644 --- a/docs/sdk/typescript/types/type-aliases/StorageParams.md +++ b/docs/sdk/typescript/types/type-aliases/StorageParams.md @@ -6,36 +6,50 @@ # Type Alias: ~~StorageParams~~ -> **StorageParams**: `object` +> **StorageParams** = `object` -Defined in: [types.ts:54](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L54) +Defined in: [types.ts:54](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L54) -## Type declaration +## Deprecated + +StorageClient is deprecated. Use Minio.Client directly. + +## Properties ### ~~endPoint~~ > **endPoint**: `string` +Defined in: [types.ts:58](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L58) + Request endPoint +*** + ### ~~port?~~ > `optional` **port**: `number` +Defined in: [types.ts:70](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L70) + TCP/IP port number. Default value set to 80 for HTTP and 443 for HTTPs +*** + ### ~~region?~~ > `optional` **region**: `string` +Defined in: [types.ts:66](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L66) + Region +*** + ### ~~useSSL~~ > **useSSL**: `boolean` -Enable secure (HTTPS) access. Default value set to false +Defined in: [types.ts:62](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L62) -## Deprecated - -StorageClient is deprecated. Use Minio.Client directly. +Enable secure (HTTPS) access. Default value set to false diff --git a/docs/sdk/typescript/types/type-aliases/TransactionLikeWithNonce.md b/docs/sdk/typescript/types/type-aliases/TransactionLikeWithNonce.md index ed7f7a1bd4..9c7bbca8c5 100644 --- a/docs/sdk/typescript/types/type-aliases/TransactionLikeWithNonce.md +++ b/docs/sdk/typescript/types/type-aliases/TransactionLikeWithNonce.md @@ -6,9 +6,9 @@ # Type Alias: TransactionLikeWithNonce -> **TransactionLikeWithNonce**: `TransactionLike` & `object` +> **TransactionLikeWithNonce** = `TransactionLike` & `object` -Defined in: [types.ts:200](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L200) +Defined in: [types.ts:200](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L200) ## Type declaration diff --git a/docs/sdk/typescript/types/type-aliases/UploadFile.md b/docs/sdk/typescript/types/type-aliases/UploadFile.md index 29759d4af4..76a517188f 100644 --- a/docs/sdk/typescript/types/type-aliases/UploadFile.md +++ b/docs/sdk/typescript/types/type-aliases/UploadFile.md @@ -6,28 +6,38 @@ # Type Alias: UploadFile -> `readonly` **UploadFile**: `object` +> `readonly` **UploadFile** = `object` -Defined in: [types.ts:77](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L77) +Defined in: [types.ts:77](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L77) Upload file data -## Type declaration +## Properties ### hash > **hash**: `string` +Defined in: [types.ts:89](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L89) + Hash of uploaded object key +*** + ### key > **key**: `string` +Defined in: [types.ts:81](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L81) + Uploaded object key +*** + ### url > **url**: `string` +Defined in: [types.ts:85](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L85) + Uploaded object URL diff --git a/packages/apps/fortune/recording-oracle/src/modules/job/job.service.ts b/packages/apps/fortune/recording-oracle/src/modules/job/job.service.ts index 10191d7f2b..48c8ea0ef2 100644 --- a/packages/apps/fortune/recording-oracle/src/modules/job/job.service.ts +++ b/packages/apps/fortune/recording-oracle/src/modules/job/job.service.ts @@ -111,7 +111,7 @@ export class JobService { const manifestUrl = await escrowClient.getManifestUrl( webhook.escrowAddress, ); - const { submissionsRequired, requestType }: IManifest = + const { submissionsRequired, requestType, fundAmount }: IManifest = await this.storageService.download(manifestUrl); if (!submissionsRequired || !requestType) { @@ -163,10 +163,21 @@ export class JobService { recordingOracleSolutions, ); + const lastExchangeSolution = + exchangeJobSolutions[exchangeJobSolutions.length - 1]; + const lastProcessedSolution = recordingOracleSolutions.find( + (s) => + s.workerAddress === lastExchangeSolution.workerAddress && + s.solution === lastExchangeSolution.solution, + ); + + const amountToReserve = BigInt(fundAmount) / BigInt(submissionsRequired); + await escrowClient.storeResults( webhook.escrowAddress, jobSolutionUploaded.url, jobSolutionUploaded.hash, + !lastProcessedSolution?.error ? amountToReserve : 0n, ); if ( diff --git a/packages/core/contracts/Escrow.sol b/packages/core/contracts/Escrow.sol index fcac414b8d..4ef4096557 100644 --- a/packages/core/contracts/Escrow.sol +++ b/packages/core/contracts/Escrow.sol @@ -249,7 +249,6 @@ contract Escrow is IEscrow, ReentrancyGuard { ); require(bytes(_url).length != 0, "URL can't be empty"); require(bytes(_hash).length != 0, "Hash can't be empty"); - require(_amount > 0, 'Amount must be greater than zero'); require( _amount <= remainingFunds - reservedFunds, 'Not enough unreserved funds' diff --git a/packages/core/test/Escrow-USDT.ts b/packages/core/test/Escrow-USDT.ts index b70c2793e4..35a3ecd39a 100644 --- a/packages/core/test/Escrow-USDT.ts +++ b/packages/core/test/Escrow-USDT.ts @@ -236,17 +236,6 @@ describe('Escrow with USDT', function () { ); }); - it('Should revert with the right error if amount sent is 0', async function () { - await fundEscrow(); - await setupEscrow(); - await escrow - .connect(owner) - .addTrustedHandlers([await reputationOracle.getAddress()]); - await expect( - escrow.connect(reputationOracle).storeResults(MOCK_URL, MOCK_HASH, 0) - ).to.be.revertedWith('Amount must be greater than zero'); - }); - it('Should revert with the right error if amount is higher than unreserved funds', async function () { await fundEscrow(); await setupEscrow(); diff --git a/packages/core/test/Escrow.ts b/packages/core/test/Escrow.ts index a5ae002203..4ddbf8ed8e 100644 --- a/packages/core/test/Escrow.ts +++ b/packages/core/test/Escrow.ts @@ -229,17 +229,6 @@ describe('Escrow', function () { ); }); - it('Should revert with the right error if amount sent is 0', async function () { - await fundEscrow(); - await setupEscrow(); - await escrow - .connect(owner) - .addTrustedHandlers([await reputationOracle.getAddress()]); - await expect( - escrow.connect(reputationOracle).storeResults(MOCK_URL, MOCK_HASH, 0) - ).to.be.revertedWith('Amount must be greater than zero'); - }); - it('Should revert with the right error if amount is higher than unreserved funds', async function () { await fundEscrow(); await setupEscrow(); diff --git a/packages/sdk/python/human-protocol-sdk/human_protocol_sdk/escrow/escrow_client.py b/packages/sdk/python/human-protocol-sdk/human_protocol_sdk/escrow/escrow_client.py index e8c9854d27..fa07935797 100644 --- a/packages/sdk/python/human-protocol-sdk/human_protocol_sdk/escrow/escrow_client.py +++ b/packages/sdk/python/human-protocol-sdk/human_protocol_sdk/escrow/escrow_client.py @@ -436,6 +436,7 @@ def store_results( escrow_address: str, url: str, hash: str, + amount: Decimal, tx_options: Optional[TxParams] = None, ) -> None: """ @@ -444,6 +445,7 @@ def store_results( :param escrow_address: Address of the escrow :param url: Results file URL :param hash: Results file hash + :param amount: Amount to reserve for payouts :param tx_options: (Optional) Additional transaction parameters :return: None @@ -477,7 +479,8 @@ def get_w3_with_priv_key(priv_key: str): escrow_client.store_results( "0x62dD51230A30401C455c8398d06F85e4EaB6309f", "http://localhost/results.json", - "b5dad76bf6772c0f07fd5e048f6e75a5f86ee079" + "b5dad76bf6772c0f07fd5e048f6e75a5f86ee079", + Web3.to_wei(5, 'ether') ) """ if not Web3.is_address(escrow_address): @@ -486,13 +489,17 @@ def get_w3_with_priv_key(priv_key: str): raise EscrowClientError("Invalid empty hash") if not validate_url(url): raise EscrowClientError(f"Invalid URL: {url}") + if amount <= 0: + raise EscrowClientError("Amount must be positive") if not self.w3.eth.default_account: raise EscrowClientError("You must add an account to Web3 instance") handle_transaction( self.w3, "Store Results", - self._get_escrow_contract(escrow_address).functions.storeResults(url, hash), + self._get_escrow_contract(escrow_address).functions.storeResults( + url, hash, amount + ), EscrowClientError, tx_options, ) diff --git a/packages/sdk/python/human-protocol-sdk/test/human_protocol_sdk/escrow/test_escrow_client.py b/packages/sdk/python/human-protocol-sdk/test/human_protocol_sdk/escrow/test_escrow_client.py index ac0f38ae57..960c2ac20f 100644 --- a/packages/sdk/python/human-protocol-sdk/test/human_protocol_sdk/escrow/test_escrow_client.py +++ b/packages/sdk/python/human-protocol-sdk/test/human_protocol_sdk/escrow/test_escrow_client.py @@ -699,14 +699,17 @@ def test_store_results(self): escrow_address = "0x1234567890123456789012345678901234567890" url = "https://www.example.com/result" hash = "test" + amount = 100 with patch( "human_protocol_sdk.escrow.escrow_client.handle_transaction" ) as mock_function: - self.escrow.store_results(escrow_address, url, hash) + self.escrow.store_results(escrow_address, url, hash, amount) self.escrow._get_escrow_contract.assert_called_once_with(escrow_address) - mock_contract.functions.storeResults.assert_called_once_with(url, hash) + mock_contract.functions.storeResults.assert_called_once_with( + url, hash, amount + ) mock_function.assert_called_once_with( self.w3, "Store Results", @@ -719,29 +722,42 @@ def test_store_results_invalid_address(self): escrow_address = "invalid_address" url = "https://www.example.com/result" hash = "test" + amount = 100 with self.assertRaises(EscrowClientError) as cm: - self.escrow.store_results(escrow_address, url, hash) + self.escrow.store_results(escrow_address, url, hash, amount) self.assertEqual(f"Invalid escrow address: {escrow_address}", str(cm.exception)) def test_store_results_invalid_url(self): escrow_address = "0x1234567890123456789012345678901234567890" url = "invalid_url" hash = "test" + amount = 100 with self.assertRaises(EscrowClientError) as cm: - self.escrow.store_results(escrow_address, url, hash) + self.escrow.store_results(escrow_address, url, hash, amount) self.assertEqual(f"Invalid URL: {url}", str(cm.exception)) def test_store_results_invalid_hash(self): escrow_address = "0x1234567890123456789012345678901234567890" url = "https://www.example.com/result" hash = "" + amount = 100 with self.assertRaises(EscrowClientError) as cm: - self.escrow.store_results(escrow_address, url, hash) + self.escrow.store_results(escrow_address, url, hash, amount) self.assertEqual("Invalid empty hash", str(cm.exception)) + def test_store_results_invalid_hash(self): + escrow_address = "0x1234567890123456789012345678901234567890" + url = "https://www.example.com/result" + hash = "test" + amount = -10 + + with self.assertRaises(EscrowClientError) as cm: + self.escrow.store_results(escrow_address, url, hash, amount) + self.assertEqual("Amount must be positive", str(cm.exception)) + def test_store_results_without_account(self): mock_provider = MagicMock(spec=HTTPProvider) w3 = Web3(mock_provider) @@ -753,9 +769,10 @@ def test_store_results_without_account(self): escrow_address = "0x1234567890123456789012345678901234567890" url = "https://www.example.com/result" hash = "test" + amount = 100 with self.assertRaises(EscrowClientError) as cm: - escrowClient.store_results(escrow_address, url, hash) + escrowClient.store_results(escrow_address, url, hash, amount) self.assertEqual("You must add an account to Web3 instance", str(cm.exception)) def test_store_results_invalid_status(self): @@ -768,9 +785,10 @@ def test_store_results_invalid_status(self): escrow_address = "0x1234567890123456789012345678901234567890" url = "https://www.example.com/result" hash = "test" + amount = 100 with self.assertRaises(EscrowClientError) as cm: - self.escrow.store_results(escrow_address, url, hash) + self.escrow.store_results(escrow_address, url, hash, amount) self.assertEqual( "Store Results transaction failed: Escrow not in Pending or Partial status state", str(cm.exception), @@ -786,9 +804,10 @@ def test_store_results_invalid_caller(self): escrow_address = "0x1234567890123456789012345678901234567890" url = "https://www.example.com/result" hash = "test" + amount = 100 with self.assertRaises(EscrowClientError) as cm: - self.escrow.store_results(escrow_address, url, hash) + self.escrow.store_results(escrow_address, url, hash, amount) self.assertEqual( "Store Results transaction failed: Address calling not trusted", str(cm.exception), @@ -799,9 +818,10 @@ def test_store_results_invalid_escrow(self): escrow_address = "0x1234567890123456789012345678901234567890" url = "https://www.example.com/result" hash = "test" + amount = 100 with self.assertRaises(EscrowClientError) as cm: - self.escrow.store_results(escrow_address, url, hash) + self.escrow.store_results(escrow_address, url, hash, amount) self.assertEqual( "Escrow address is not provided by the factory", str(cm.exception), @@ -814,15 +834,18 @@ def test_store_results_with_tx_options(self): escrow_address = "0x1234567890123456789012345678901234567890" url = "https://www.example.com/result" hash = "test" + amount = 100 tx_options = {"gas": 50000} with patch( "human_protocol_sdk.escrow.escrow_client.handle_transaction" ) as mock_function: - self.escrow.store_results(escrow_address, url, hash, tx_options) + self.escrow.store_results(escrow_address, url, hash, amount, tx_options) self.escrow._get_escrow_contract.assert_called_once_with(escrow_address) - mock_contract.functions.storeResults.assert_called_once_with(url, hash) + mock_contract.functions.storeResults.assert_called_once_with( + url, hash, amount + ) mock_function.assert_called_once_with( self.w3, "Store Results", diff --git a/packages/sdk/typescript/human-protocol-sdk/src/error.ts b/packages/sdk/typescript/human-protocol-sdk/src/error.ts index c39c75d714..13d8391d11 100644 --- a/packages/sdk/typescript/human-protocol-sdk/src/error.ts +++ b/packages/sdk/typescript/human-protocol-sdk/src/error.ts @@ -251,6 +251,11 @@ export const ErrorAmountMustBeGreaterThanZero = new Error( 'Amount must be greater than zero' ); +/** + * @constant {Error} - Amount must be positive. + */ +export const ErrorAmountMustBePositive = new Error('Amount must be positive'); + /** * @constant {Error} - Escrow does not have enough balance. */ diff --git a/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts b/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts index 46474bdf6b..74b5465471 100644 --- a/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts +++ b/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts @@ -17,6 +17,7 @@ import { requiresSigner } from './decorators'; import { ChainId, OrderDirection } from './enums'; import { ErrorAmountMustBeGreaterThanZero, + ErrorAmountMustBePositive, ErrorAmountsCannotBeEmptyArray, ErrorEscrowAddressIsNotProvidedByFactory, ErrorEscrowDoesNotHaveEnoughBalance, @@ -455,11 +456,12 @@ export class EscrowClient extends BaseEthersClient { } /** - * This function stores the results URL and hash. + * This function stores the results URL and hash, and reserves the specified amount of funds. * * @param {string} escrowAddress Address of the escrow. * @param {string} url Results file URL. * @param {string} hash Results file hash. + * @param {bigint} amount Amount to reserve for payouts. * @param {Overrides} [txOptions] - Additional transaction parameters (optional, defaults to an empty object). * @returns Returns void if successful. Throws error if any. * @@ -479,7 +481,7 @@ export class EscrowClient extends BaseEthersClient { * const signer = new Wallet(privateKey, provider); * const escrowClient = await EscrowClient.build(signer); * - * await escrowClient.storeResults('0x62dD51230A30401C455c8398d06F85e4EaB6309f', 'http://localhost/results.json', 'b5dad76bf6772c0f07fd5e048f6e75a5f86ee079'); + * await escrowClient.storeResults('0x62dD51230A30401C455c8398d06F85e4EaB6309f', 'http://localhost/results.json', 'b5dad76bf6772c0f07fd5e048f6e75a5f86ee079', 50n); * ``` */ @requiresSigner @@ -487,6 +489,7 @@ export class EscrowClient extends BaseEthersClient { escrowAddress: string, url: string, hash: string, + amount: bigint, txOptions: Overrides = {} ): Promise { if (!ethers.isAddress(escrowAddress)) { @@ -505,6 +508,10 @@ export class EscrowClient extends BaseEthersClient { throw ErrorHashIsEmptyString; } + if (amount <= 0n) { + throw ErrorAmountMustBePositive; + } + if (!(await this.escrowFactoryContract.hasEscrow(escrowAddress))) { throw ErrorEscrowAddressIsNotProvidedByFactory; } @@ -512,7 +519,9 @@ export class EscrowClient extends BaseEthersClient { try { const escrowContract = this.getEscrowContract(escrowAddress); - await (await escrowContract.storeResults(url, hash, txOptions)).wait(); + await ( + await escrowContract.storeResults(url, hash, amount, txOptions) + ).wait(); return; } catch (e) { @@ -942,6 +951,7 @@ export class EscrowClient extends BaseEthersClient { * const signedTransaction = await signer.signTransaction(rawTransaction); * console.log('Tx hash:', ethers.keccak256(signedTransaction)); * (await signer.sendTransaction(rawTransaction)).wait(); + * ``` */ @requiresSigner async createBulkPayoutTransaction( diff --git a/packages/sdk/typescript/human-protocol-sdk/test/escrow.test.ts b/packages/sdk/typescript/human-protocol-sdk/test/escrow.test.ts index b9d69c0a01..d1ee83aa18 100644 --- a/packages/sdk/typescript/human-protocol-sdk/test/escrow.test.ts +++ b/packages/sdk/typescript/human-protocol-sdk/test/escrow.test.ts @@ -12,6 +12,7 @@ import { NETWORKS } from '../src/constants'; import { ChainId, OrderDirection } from '../src/enums'; import { ErrorAmountMustBeGreaterThanZero, + ErrorAmountMustBePositive, ErrorAmountsCannotBeEmptyArray, ErrorEscrowAddressIsNotProvidedByFactory, ErrorEscrowDoesNotHaveEnoughBalance, @@ -45,6 +46,7 @@ import { DEFAULT_GAS_PAYER_PRIVKEY, DEFAULT_TX_ID, FAKE_ADDRESS, + FAKE_AMOUNT, FAKE_HASH, FAKE_URL, VALID_URL, @@ -718,9 +720,10 @@ describe('EscrowClient', () => { const invalidAddress = FAKE_ADDRESS; const url = VALID_URL; const hash = FAKE_HASH; + const amount = FAKE_AMOUNT; await expect( - escrowClient.storeResults(invalidAddress, url, hash) + escrowClient.storeResults(invalidAddress, url, hash, amount) ).rejects.toThrow(ErrorInvalidEscrowAddressProvided); }); @@ -728,11 +731,12 @@ describe('EscrowClient', () => { const escrowAddress = ethers.ZeroAddress; const url = VALID_URL; const hash = FAKE_HASH; + const amount = FAKE_AMOUNT; escrowClient.escrowFactoryContract.hasEscrow.mockReturnValue(false); await expect( - escrowClient.storeResults(escrowAddress, url, hash) + escrowClient.storeResults(escrowAddress, url, hash, amount) ).rejects.toThrow(ErrorEscrowAddressIsNotProvidedByFactory); }); @@ -740,11 +744,12 @@ describe('EscrowClient', () => { const escrowAddress = ethers.ZeroAddress; const url = ''; const hash = FAKE_HASH; + const amount = FAKE_AMOUNT; escrowClient.escrowFactoryContract.hasEscrow.mockReturnValue(true); await expect( - escrowClient.storeResults(escrowAddress, url, hash) + escrowClient.storeResults(escrowAddress, url, hash, amount) ).rejects.toThrow(ErrorUrlIsEmptyString); }); @@ -752,11 +757,12 @@ describe('EscrowClient', () => { const escrowAddress = ethers.ZeroAddress; const url = FAKE_URL; const hash = FAKE_HASH; + const amount = FAKE_AMOUNT; escrowClient.escrowFactoryContract.hasEscrow.mockReturnValue(true); await expect( - escrowClient.storeResults(escrowAddress, url, hash) + escrowClient.storeResults(escrowAddress, url, hash, amount) ).rejects.toThrow(ErrorInvalidUrl); }); @@ -764,18 +770,33 @@ describe('EscrowClient', () => { const escrowAddress = ethers.ZeroAddress; const url = VALID_URL; const hash = ''; + const amount = FAKE_AMOUNT; escrowClient.escrowFactoryContract.hasEscrow.mockReturnValue(true); await expect( - escrowClient.storeResults(escrowAddress, url, hash) + escrowClient.storeResults(escrowAddress, url, hash, amount) ).rejects.toThrow(ErrorHashIsEmptyString); }); + test('should throw an error if amount is invalid', async () => { + const escrowAddress = ethers.ZeroAddress; + const url = VALID_URL; + const hash = FAKE_HASH; + const amount = -10; + + escrowClient.escrowFactoryContract.hasEscrow.mockReturnValue(true); + + await expect( + escrowClient.storeResults(escrowAddress, url, hash, amount) + ).rejects.toThrow(ErrorAmountMustBePositive); + }); + test('should successfully store results', async () => { const escrowAddress = ethers.ZeroAddress; const url = VALID_URL; const hash = FAKE_HASH; + const amount = FAKE_AMOUNT; escrowClient.escrowFactoryContract.hasEscrow.mockReturnValue(true); const storeResultsSpy = vi @@ -784,15 +805,16 @@ describe('EscrowClient', () => { wait: vi.fn().mockResolvedValue(true), })); - await escrowClient.storeResults(escrowAddress, url, hash); + await escrowClient.storeResults(escrowAddress, url, hash, amount); - expect(storeResultsSpy).toHaveBeenCalledWith(url, hash, {}); + expect(storeResultsSpy).toHaveBeenCalledWith(url, hash, amount, {}); }); test('should throw an error if the store results fails', async () => { const escrowAddress = ethers.ZeroAddress; const url = VALID_URL; const hash = FAKE_HASH; + const amount = FAKE_AMOUNT; escrowClient.escrowFactoryContract.hasEscrow.mockReturnValue(true); escrowClient.escrowContract.storeResults.mockRejectedValueOnce( @@ -800,12 +822,13 @@ describe('EscrowClient', () => { ); await expect( - escrowClient.storeResults(escrowAddress, url, hash) + escrowClient.storeResults(escrowAddress, url, hash, amount) ).rejects.toThrow(); expect(escrowClient.escrowContract.storeResults).toHaveBeenCalledWith( url, hash, + amount, {} ); }); @@ -814,6 +837,7 @@ describe('EscrowClient', () => { const escrowAddress = ethers.ZeroAddress; const url = VALID_URL; const hash = FAKE_HASH; + const amount = FAKE_AMOUNT; escrowClient.escrowFactoryContract.hasEscrow.mockReturnValue(true); const storeResultsSpy = vi @@ -823,9 +847,20 @@ describe('EscrowClient', () => { })); const txOptions: Overrides = { gasLimit: 45000 }; - await escrowClient.storeResults(escrowAddress, url, hash, txOptions); + await escrowClient.storeResults( + escrowAddress, + url, + hash, + amount, + txOptions + ); - expect(storeResultsSpy).toHaveBeenCalledWith(url, hash, txOptions); + expect(storeResultsSpy).toHaveBeenCalledWith( + url, + hash, + amount, + txOptions + ); }); }); From a2983529df61e07d13092056996e05055f8bbab1 Mon Sep 17 00:00:00 2001 From: Maxim Zhiltsov Date: Mon, 19 May 2025 16:29:05 +0300 Subject: [PATCH 03/18] [CVAT] Update cvat api uses (#3348) * Fix possible no assignments error when there are * Update readme * Update cvat sdk versions * Address api changes * Improve performance of some cvat calls * Improve description --- .../examples/cvat/exchange-oracle/poetry.lock | 8 +++--- .../cvat/exchange-oracle/pyproject.toml | 2 +- .../cvat/exchange-oracle/src/.env.template | 2 ++ .../cvat/exchange-oracle/src/core/config.py | 5 +++- .../exchange-oracle/src/cvat/api_calls.py | 27 +++++++++++++------ .../cvat/recording-oracle/poetry.lock | 8 +++--- .../cvat/recording-oracle/pyproject.toml | 2 +- .../cvat/recording-oracle/src/.env.template | 1 + .../cvat/recording-oracle/src/core/config.py | 2 ++ .../recording-oracle/src/cvat/api_calls.py | 5 +++- 10 files changed, 42 insertions(+), 20 deletions(-) diff --git a/packages/examples/cvat/exchange-oracle/poetry.lock b/packages/examples/cvat/exchange-oracle/poetry.lock index f1970962d5..8af6c9bc2d 100644 --- a/packages/examples/cvat/exchange-oracle/poetry.lock +++ b/packages/examples/cvat/exchange-oracle/poetry.lock @@ -945,13 +945,13 @@ test-randomorder = ["pytest-randomly"] [[package]] name = "cvat-sdk" -version = "2.31.0" +version = "2.37.0" description = "CVAT REST API" optional = false python-versions = ">=3.9" files = [ - {file = "cvat_sdk-2.31.0-py3-none-any.whl", hash = "sha256:b33e8526dad8c481f82e445badfced5d69747eaf7e5660b0d176cf86d394a02e"}, - {file = "cvat_sdk-2.31.0.tar.gz", hash = "sha256:aaeff833c32bfe711f418c62bdab135e0746eff0e89757e8b61cfad14a42ef23"}, + {file = "cvat_sdk-2.37.0-py3-none-any.whl", hash = "sha256:faa94cfd6678089814179a8da828761dfa3daf08eb752490ee85551a1045dac5"}, + {file = "cvat_sdk-2.37.0.tar.gz", hash = "sha256:e990908a473c499eb6d7b84f7f2e640ea729ef027d4c4cc32a5a925752532689"}, ] [package.dependencies] @@ -5047,4 +5047,4 @@ propcache = ">=0.2.0" [metadata] lock-version = "2.0" python-versions = "^3.10,<3.13" -content-hash = "c643f28ae7113ae0b8051952c0adfcb74a0ae182ba5039133f57f52b78608007" +content-hash = "8bf7f09b99af5cd8b02a36fc0a1b5ad4af28d5d17d7c0275afa38edb281c3cfc" diff --git a/packages/examples/cvat/exchange-oracle/pyproject.toml b/packages/examples/cvat/exchange-oracle/pyproject.toml index 187d9c81e3..5dd04c1813 100644 --- a/packages/examples/cvat/exchange-oracle/pyproject.toml +++ b/packages/examples/cvat/exchange-oracle/pyproject.toml @@ -16,7 +16,7 @@ sqlalchemy-utils = "^0.41.1" alembic = "^1.11.1" httpx = "^0.24.1" pytest = "^7.2.2" -cvat-sdk = "2.31.0" +cvat-sdk = "2.37.0" sqlalchemy = "^2.0.16" apscheduler = "^3.10.1" xmltodict = "^0.13.0" diff --git a/packages/examples/cvat/exchange-oracle/src/.env.template b/packages/examples/cvat/exchange-oracle/src/.env.template index b07c93515c..88a546cff2 100644 --- a/packages/examples/cvat/exchange-oracle/src/.env.template +++ b/packages/examples/cvat/exchange-oracle/src/.env.template @@ -77,6 +77,8 @@ CVAT_IOU_THRESHOLD= CVAT_OKS_SIGMA= CVAT_EXPORT_TIMEOUT= CVAT_IMPORT_TIMEOUT= +CVAT_PROJECTS_PAGE_SIZE= +CVAT_JOBS_PAGE_SIZE= # Storage Config (S3/GCS) diff --git a/packages/examples/cvat/exchange-oracle/src/core/config.py b/packages/examples/cvat/exchange-oracle/src/core/config.py index 9e40bb1265..245380cc58 100644 --- a/packages/examples/cvat/exchange-oracle/src/core/config.py +++ b/packages/examples/cvat/exchange-oracle/src/core/config.py @@ -146,7 +146,7 @@ class CronConfig: "Maximum number of downloading attempts per job or project during results downloading" track_completed_escrows_jobs_downloading_batch_size = int( - getenv("TRACK_COMPLETED_ESCROWS_JOBS_DOWNLOADING_BATCH_SIZE", 500) + getenv("TRACK_COMPLETED_ESCROWS_JOBS_DOWNLOADING_BATCH_SIZE", 10) ) "Maximum number of parallel downloading requests during results downloading" @@ -183,6 +183,9 @@ class CvatConfig: incoming_webhooks_url = getenv("CVAT_INCOMING_WEBHOOKS_URL") webhook_secret = getenv("CVAT_WEBHOOK_SECRET", "thisisasamplesecret") + projects_page_size = int(getenv("CVAT_PROJECTS_PAGE_SIZE", 100)) + jobs_page_size = int(getenv("CVAT_JOBS_PAGE_SIZE", 100)) + class StorageConfig: provider: ClassVar[str] = os.environ["STORAGE_PROVIDER"].lower() diff --git a/packages/examples/cvat/exchange-oracle/src/cvat/api_calls.py b/packages/examples/cvat/exchange-oracle/src/cvat/api_calls.py index 27c869c863..06934225b4 100644 --- a/packages/examples/cvat/exchange-oracle/src/cvat/api_calls.py +++ b/packages/examples/cvat/exchange-oracle/src/cvat/api_calls.py @@ -47,15 +47,23 @@ def _request_annotations(endpoint: Endpoint, cvat_id: int, format_name: str) -> _get_annotations(request_id, ...) """ - (_, response) = endpoint.call_with_http_info( - id=cvat_id, - format=format_name, - save_images=False, - _parse_response=False, - ) + try: + (_, response) = endpoint.call_with_http_info( + id=cvat_id, + format=format_name, + save_images=False, + _parse_response=False, + ) + + assert response.status in [HTTPStatus.ACCEPTED, HTTPStatus.CREATED] + rq_id = response.json()["rq_id"] + except exceptions.ApiException as e: + if e.status == HTTPStatus.CONFLICT: + rq_id = json.loads(e.body)["rq_id"] + else: + raise - assert response.status in [HTTPStatus.ACCEPTED, HTTPStatus.CREATED] - return response.json()["rq_id"] + return rq_id def _get_annotations( @@ -462,6 +470,7 @@ def fetch_task_jobs(task_id: int) -> list[models.JobRead]: api_client.jobs_api.list_endpoint, task_id=task_id, type="annotation", + page_size=Config.cvat_config.jobs_page_size, ) except exceptions.ApiException as e: logger.exception(f"Exception when calling JobsApi.list: {e}\n") @@ -535,6 +544,7 @@ def fetch_projects(assignee: str = "") -> list[models.ProjectRead]: return get_paginated_collection( api_client.projects_api.list_endpoint, **({"assignee": assignee} if assignee else {}), + page_size=Config.cvat_config.projects_page_size, ) except exceptions.ApiException as e: logger.exception(f"Exception when calling ProjectsApi.list(): {e}\n") @@ -711,6 +721,7 @@ def update_quality_control_settings( logger = logging.getLogger("app") params = { + "inherit": False, "max_validations_per_job": max_validations_per_job, "target_metric": target_metric, "target_metric_threshold": target_metric_threshold, diff --git a/packages/examples/cvat/recording-oracle/poetry.lock b/packages/examples/cvat/recording-oracle/poetry.lock index 4b99cada57..52dd95468a 100644 --- a/packages/examples/cvat/recording-oracle/poetry.lock +++ b/packages/examples/cvat/recording-oracle/poetry.lock @@ -914,13 +914,13 @@ test-randomorder = ["pytest-randomly"] [[package]] name = "cvat-sdk" -version = "2.31.0" +version = "2.37.0" description = "CVAT REST API" optional = false python-versions = ">=3.9" files = [ - {file = "cvat_sdk-2.31.0-py3-none-any.whl", hash = "sha256:b33e8526dad8c481f82e445badfced5d69747eaf7e5660b0d176cf86d394a02e"}, - {file = "cvat_sdk-2.31.0.tar.gz", hash = "sha256:aaeff833c32bfe711f418c62bdab135e0746eff0e89757e8b61cfad14a42ef23"}, + {file = "cvat_sdk-2.37.0-py3-none-any.whl", hash = "sha256:faa94cfd6678089814179a8da828761dfa3daf08eb752490ee85551a1045dac5"}, + {file = "cvat_sdk-2.37.0.tar.gz", hash = "sha256:e990908a473c499eb6d7b84f7f2e640ea729ef027d4c4cc32a5a925752532689"}, ] [package.dependencies] @@ -4732,4 +4732,4 @@ propcache = ">=0.2.0" [metadata] lock-version = "2.0" python-versions = "^3.10, <3.13" -content-hash = "5f830a339a6f870a60e94be16dc742280e0ec9002fb4a51404fca9e18a6f399f" +content-hash = "3f4ce0cc7668a0c9ffaa02c1306404603d41215e39199c212dabef36ab112a7c" diff --git a/packages/examples/cvat/recording-oracle/pyproject.toml b/packages/examples/cvat/recording-oracle/pyproject.toml index fa03eb2769..194543a267 100644 --- a/packages/examples/cvat/recording-oracle/pyproject.toml +++ b/packages/examples/cvat/recording-oracle/pyproject.toml @@ -24,7 +24,7 @@ google-cloud-storage = "^2.14.0" datumaro = {git = "https://github.com/cvat-ai/datumaro.git", rev = "ff83c00c2c1bc4b8fdfcc55067fcab0a9b5b6b11"} hexbytes = ">=1.2.0" # required for to_0x_hex() function starlette = ">=0.40.0" # avoid the vulnerability with multipart/form-data -cvat-sdk = "2.31.0" +cvat-sdk = "2.37.0" cryptography = "<44.0.0" # human-protocol-sdk -> pgpy dep requires cryptography < 45 human-protocol-sdk = "^4.0.3" diff --git a/packages/examples/cvat/recording-oracle/src/.env.template b/packages/examples/cvat/recording-oracle/src/.env.template index 6abb5d245f..a5851b0fb6 100644 --- a/packages/examples/cvat/recording-oracle/src/.env.template +++ b/packages/examples/cvat/recording-oracle/src/.env.template @@ -61,6 +61,7 @@ CVAT_ADMIN_PASS= CVAT_ORG_SLUG= CVAT_QUALITY_RETRIEVAL_TIMEOUT= CVAT_QUALITY_CHECK_INTERVAL= +CVAT_QUALITY_REPORTS_PAGE_SIZE= # Localhost diff --git a/packages/examples/cvat/recording-oracle/src/core/config.py b/packages/examples/cvat/recording-oracle/src/core/config.py index fa262b8b0b..248f51cc6e 100644 --- a/packages/examples/cvat/recording-oracle/src/core/config.py +++ b/packages/examples/cvat/recording-oracle/src/core/config.py @@ -195,6 +195,7 @@ class ValidationConfig: warmup_iterations = int(getenv("WARMUP_ITERATIONS", "1")) """ The first escrow iterations where the annotation speed is checked to be big enough. + Set to 0 to disable. """ min_warmup_progress = float(getenv("MIN_WARMUP_PROGRESS", "10")) @@ -234,6 +235,7 @@ class CvatConfig: quality_retrieval_timeout = int(getenv("CVAT_QUALITY_RETRIEVAL_TIMEOUT", 60 * 60)) quality_check_interval = int(getenv("CVAT_QUALITY_CHECK_INTERVAL", 5)) + quality_reports_page_size = int(getenv("CVAT_QUALITY_REPORTS_PAGE_SIZE", 100)) class Config: diff --git a/packages/examples/cvat/recording-oracle/src/cvat/api_calls.py b/packages/examples/cvat/recording-oracle/src/cvat/api_calls.py index 0b51e7986c..574e44c918 100644 --- a/packages/examples/cvat/recording-oracle/src/cvat/api_calls.py +++ b/packages/examples/cvat/recording-oracle/src/cvat/api_calls.py @@ -134,7 +134,10 @@ def get_jobs_quality_reports(parent_id: int) -> list[models.QualityReport]: with get_api_client() as api_client: try: return get_paginated_collection( - api_client.quality_api.list_reports_endpoint, parent_id=parent_id, target="job" + api_client.quality_api.list_reports_endpoint, + parent_id=parent_id, + target="job", + page_size=Config.cvat_config.quality_reports_page_size, ) except exceptions.ApiException as e: From 3ac3fbba4de4d2b1d43ee5563526e0836f120c15 Mon Sep 17 00:00:00 2001 From: Maxim Zhiltsov Date: Wed, 21 May 2025 11:43:02 +0300 Subject: [PATCH 04/18] [CVAT] Draw roi point along with bbox in skeleton tasks (#3356) * Draw roi point along with bbox in skeleton tasks * Relax filtering for overlapping gt skeletons (#3358) --- .../src/core/tasks/skeletons_from_boxes.py | 8 +- .../src/handlers/job_creation.py | 175 +++++++++++++++--- .../exchange-oracle/src/utils/annotations.py | 10 +- 3 files changed, 168 insertions(+), 25 deletions(-) diff --git a/packages/examples/cvat/exchange-oracle/src/core/tasks/skeletons_from_boxes.py b/packages/examples/cvat/exchange-oracle/src/core/tasks/skeletons_from_boxes.py index dc70d33a91..d48397e5d1 100644 --- a/packages/examples/cvat/exchange-oracle/src/core/tasks/skeletons_from_boxes.py +++ b/packages/examples/cvat/exchange-oracle/src/core/tasks/skeletons_from_boxes.py @@ -23,6 +23,9 @@ class RoiInfo: bbox_y: int bbox_label: int + point_x: int + point_y: int + # RoI is centered on the bbox center # Coordinates can be out of image boundaries. # In this case RoI includes extra margins to be centered on bbox center @@ -117,7 +120,10 @@ def parse_skeleton_bbox_mapping(self, skeleton_bbox_mapping_data: bytes) -> Skel return {int(k): int(v) for k, v in parse_json(skeleton_bbox_mapping_data).items()} def parse_roi_info(self, rois_info_data: bytes) -> RoiInfos: - return [RoiInfo(**roi_info) for roi_info in parse_json(rois_info_data)] + return [ + RoiInfo(**{"point_x": 0, "point_y": 0, **roi_info}) + for roi_info in parse_json(rois_info_data) + ] def parse_roi_filenames(self, roi_filenames_data: bytes) -> RoiFilenames: return {int(k): v for k, v in parse_json(roi_filenames_data).items()} diff --git a/packages/examples/cvat/exchange-oracle/src/handlers/job_creation.py b/packages/examples/cvat/exchange-oracle/src/handlers/job_creation.py index c9a474fe67..96949a1e23 100644 --- a/packages/examples/cvat/exchange-oracle/src/handlers/job_creation.py +++ b/packages/examples/cvat/exchange-oracle/src/handlers/job_creation.py @@ -20,7 +20,7 @@ import datumaro as dm import numpy as np from datumaro.util import filter_dict, take_by -from datumaro.util.annotation_util import BboxCoords, bbox_iou +from datumaro.util.annotation_util import BboxCoords, bbox_iou, find_instances from datumaro.util.image import IMAGE_EXTENSIONS, decode_image, encode_image import src.core.tasks.boxes_from_points as boxes_from_points_task @@ -1709,13 +1709,18 @@ def __init__(self, manifest: TaskManifest, escrow_address: str, chain_id: int) - ) "Minimum absolute ROI size, (w, h)" - self.boxes_format = "coco_instances" + self.boxes_format = "coco_person_keypoints" self.embed_bbox_in_roi_image = True "Put a bbox into the extracted skeleton RoI images" self.embed_tile_border = True + self.embedded_point_radius = 15 + self.min_embedded_point_radius_percent = 0.005 + self.max_embedded_point_radius_percent = 0.01 + self.embedded_point_color = (0, 255, 255) + self.roi_embedded_bbox_color = (0, 255, 255) # BGR self.roi_background_color = (245, 240, 242) # BGR - CVAT background color @@ -1729,6 +1734,9 @@ def __init__(self, manifest: TaskManifest, escrow_address: str, chain_id: int) - GT annotations or samples for successful job launch """ + self.gt_id_attribute = "object_id" + "An additional way to match GT skeletons with input boxes" + # TODO: probably, need to also add an absolute number of minimum GT RoIs per class def _download_input_data(self): @@ -1948,7 +1956,7 @@ def _validate_boxes_filenames(self): ) ) - def _validate_boxes_annotations(self): + def _validate_boxes_annotations(self): # noqa: PLR0912 # Convert possible polygons and masks into boxes self._boxes_dataset.transform(InstanceSegmentsToBbox) self._boxes_dataset.init_cache() @@ -1962,15 +1970,70 @@ def _validate_boxes_annotations(self): # Could fail on this as well image_h, image_w = sample.media_as(dm.Image).size - sample_boxes = [a for a in sample.annotations if isinstance(a, dm.Bbox)] - valid_boxes = [] - for bbox in sample_boxes: - if not ( - (0 <= int(bbox.x) < int(bbox.x + bbox.w) <= image_w) - and (0 <= int(bbox.y) < int(bbox.y + bbox.h) <= image_h) - ): + valid_instances: list[tuple[dm.Bbox, dm.Points]] = [] + instances = find_instances( + [a for a in sample.annotations if isinstance(a, dm.Bbox | dm.Skeleton)] + ) + for instance_anns in instances: + if len(instance_anns) != 2: + excluded_boxes_info.add_message( + "Sample '{}': object #{} ({}) skipped - unexpected group size ({})".format( + sample.id, + instance_anns[0].id, + label_cat[instance_anns[0].label].name, + len(instance_anns), + ), + sample_id=sample.id, + sample_subset=sample.subset, + ) + continue + + bbox = next((a for a in instance_anns if isinstance(a, dm.Bbox)), None) + if not bbox: + excluded_boxes_info.add_message( + "Sample '{}': object #{} ({}) skipped - no matching bbox".format( + sample.id, instance_anns[0].id, label_cat[instance_anns[0].label].name + ), + sample_id=sample.id, + sample_subset=sample.subset, + ) + continue + + skeleton = next((a for a in instance_anns if isinstance(a, dm.Skeleton)), None) + if not skeleton: + excluded_boxes_info.add_message( + "Sample '{}': object #{} ({}) skipped - no matching skeleton".format( + sample.id, instance_anns[0].id, label_cat[instance_anns[0].label].name + ), + sample_id=sample.id, + sample_subset=sample.subset, + ) + continue + + if len(skeleton.elements) != 1 or len(skeleton.elements[0].points) != 2: + excluded_boxes_info.add_message( + "Sample '{}': object #{} ({}) skipped - invalid skeleton points".format( + sample.id, skeleton.id, label_cat[skeleton.label].name + ), + sample_id=sample.id, + sample_subset=sample.subset, + ) + continue + + point = skeleton.elements[0] + if not is_point_in_bbox(point.points[0], point.points[1], (0, 0, image_w, image_h)): excluded_boxes_info.add_message( - "Sample '{}': bbox #{} ({}) skipped - invalid coordinates".format( + "Sample '{}': object #{} ({}) skipped - invalid point coordinates".format( + sample.id, skeleton.id, label_cat[skeleton.label].name + ), + sample_id=sample.id, + sample_subset=sample.subset, + ) + continue + + if not is_point_in_bbox(int(bbox.x), int(bbox.y), (0, 0, image_w, image_h)): + excluded_boxes_info.add_message( + "Sample '{}': object #{} ({}) skipped - invalid bbox coordinates".format( sample.id, bbox.id, label_cat[bbox.label].name ), sample_id=sample.id, @@ -1978,6 +2041,16 @@ def _validate_boxes_annotations(self): ) continue + if not is_point_in_bbox(point.points[0], point.points[1], bbox): + excluded_boxes_info.add_message( + "Sample '{}': object #{} ({}) skipped - point is outside the bbox".format( + sample.id, skeleton.id, label_cat[skeleton.label].name + ), + sample_id=sample.id, + sample_subset=sample.subset, + ) + continue + if bbox.id in visited_ids: excluded_boxes_info.add_message( "Sample '{}': bbox #{} ({}) skipped - repeated annotation id {}".format( @@ -1988,14 +2061,18 @@ def _validate_boxes_annotations(self): ) continue - valid_boxes.append(bbox) + valid_instances.append( + (bbox, point.wrap(group=bbox.group, id=bbox.id, attributes=bbox.attributes)) + ) visited_ids.add(bbox.id) - excluded_boxes_info.excluded_count += len(sample_boxes) - len(valid_boxes) - excluded_boxes_info.total_count += len(sample_boxes) + excluded_boxes_info.excluded_count += len(instances) - len(valid_instances) + excluded_boxes_info.total_count += len(instances) - if len(valid_boxes) != len(sample.annotations): - self._boxes_dataset.put(sample.wrap(annotations=valid_boxes)) + if len(valid_instances) != len(sample.annotations): + self._boxes_dataset.put( + sample.wrap(annotations=list(chain.from_iterable(valid_instances))) + ) if excluded_boxes_info.excluded_count > ceil( excluded_boxes_info.total_count * self.max_discarded_threshold @@ -2066,8 +2143,14 @@ def _find_unambiguous_matches( input_boxes: list[dm.Bbox], gt_skeletons: list[dm.Skeleton], *, + input_points: list[dm.Points], gt_annotations: list[dm.Annotation], ) -> list[tuple[dm.Bbox, dm.Skeleton]]: + bbox_point_mapping: dict[int, dm.Points] = { + bbox.id: next(p for p in input_points if p.group == bbox.group) + for bbox in input_boxes + } + matches = [ [ (input_bbox.label == gt_skeleton.label) @@ -2077,6 +2160,18 @@ def _find_unambiguous_matches( self._get_skeleton_bbox(gt_skeleton, gt_annotations), ) ) + and (input_point := bbox_point_mapping[input_bbox.id]) + and is_point_in_bbox( + input_point.points[0], + input_point.points[1], + self._get_skeleton_bbox(gt_skeleton, gt_annotations), + ) + and ( + # a way to customize matching if the default method is too rough + not (bbox_id := input_bbox.attributes.get(self.gt_id_attribute)) + or not (skeleton_id := gt_skeleton.attributes.get(self.gt_id_attribute)) + or bbox_id == skeleton_id + ) for gt_skeleton in gt_skeletons ] for input_bbox in input_boxes @@ -2167,10 +2262,11 @@ def _find_good_gt_skeletons( input_boxes: list[dm.Bbox], gt_skeletons: list[dm.Skeleton], *, + input_points: list[dm.Points], gt_annotations: list[dm.Annotation], ) -> list[dm.Skeleton]: matches = _find_unambiguous_matches( - input_boxes, gt_skeletons, gt_annotations=gt_annotations + input_boxes, gt_skeletons, input_points=input_points, gt_annotations=gt_annotations ) matched_skeletons = [] @@ -2221,13 +2317,18 @@ def _find_good_gt_skeletons( gt_skeletons = [a for a in gt_sample.annotations if isinstance(a, dm.Skeleton)] input_boxes = [a for a in boxes_sample.annotations if isinstance(a, dm.Bbox)] + input_points = [a for a in boxes_sample.annotations if isinstance(a, dm.Points)] + assert len(input_boxes) == len(input_points) # Samples without boxes are allowed, so we just skip them without an error if not gt_skeletons: continue matched_skeletons = _find_good_gt_skeletons( - input_boxes, gt_skeletons, gt_annotations=gt_sample.annotations + input_boxes, + gt_skeletons, + input_points=input_points, + gt_annotations=gt_sample.annotations, ) if not matched_skeletons: continue @@ -2294,9 +2395,10 @@ def _prepare_roi_infos(self): rois: list[skeletons_from_boxes_task.RoiInfo] = [] for sample in self._boxes_dataset: - for bbox in sample.annotations: - if not isinstance(bbox, dm.Bbox): - continue + instances = find_instances(sample.annotations) + for instance_anns in instances: + bbox = next(a for a in instance_anns if isinstance(a, dm.Bbox)) + point = next(a for a in instance_anns if isinstance(a, dm.Points)) # RoI is centered on bbox center original_bbox_cx = int(bbox.x + bbox.w / 2) @@ -2320,6 +2422,8 @@ def _prepare_roi_infos(self): bbox_label=bbox.label, bbox_x=new_bbox_x, bbox_y=new_bbox_y, + point_x=point.points[0] - roi_x, + point_y=point.points[1] - roi_y, roi_x=roi_x, roi_y=roi_y, roi_w=roi_w, @@ -2511,6 +2615,32 @@ def _draw_roi_bbox(self, roi_image: np.ndarray, bbox: dm.Bbox) -> np.ndarray: cv2.LINE_4, ) + def _draw_roi_point(self, roi_image: np.ndarray, point: tuple[float, float]) -> np.ndarray: + roi_r = (roi_image.shape[0] ** 2 + roi_image.shape[1] ** 2) ** 0.5 / 2 + radius = int( + min( + self.max_embedded_point_radius_percent * roi_r, + max(self.embedded_point_radius, self.min_embedded_point_radius_percent * roi_r), + ) + ) + + roi_image = cv2.circle( + roi_image, + tuple(map(int, (point[0], point[1]))), + radius + 1, + (255, 255, 255), + -1, + cv2.LINE_4, + ) + return cv2.circle( + roi_image, + tuple(map(int, (point[0], point[1]))), + radius, + self.embedded_point_color, + -1, + cv2.LINE_4, + ) + def _extract_and_upload_rois(self): assert self._roi_filenames is not _unset assert self._roi_infos is not _unset @@ -2564,6 +2694,9 @@ def process_file(filename: str, image_pixels: np.ndarray): if self.embed_bbox_in_roi_image: roi_pixels = self._draw_roi_bbox(roi_pixels, bbox_by_id[roi_info.bbox_id]) + roi_pixels = self._draw_roi_point( + roi_pixels, (roi_info.point_x, roi_info.point_y) + ) filename = self._roi_filenames[roi_info.bbox_id] roi_bytes = encode_image(roi_pixels, os.path.splitext(filename)[-1]) diff --git a/packages/examples/cvat/exchange-oracle/src/utils/annotations.py b/packages/examples/cvat/exchange-oracle/src/utils/annotations.py index 075ce7d035..110ec2b069 100644 --- a/packages/examples/cvat/exchange-oracle/src/utils/annotations.py +++ b/packages/examples/cvat/exchange-oracle/src/utils/annotations.py @@ -8,7 +8,7 @@ import datumaro as dm import numpy as np from datumaro.util import filter_dict, mask_tools -from datumaro.util.annotation_util import find_group_leader, find_instances, max_bbox +from datumaro.util.annotation_util import BboxCoords, find_group_leader, find_instances, max_bbox from defusedxml import ElementTree @@ -343,8 +343,12 @@ def transform_item(self, item): return item.wrap(annotations=annotations) -def is_point_in_bbox(px: float, py: float, bbox: dm.Bbox) -> bool: - return (bbox.x <= px <= bbox.x + bbox.w) and (bbox.y <= py <= bbox.y + bbox.h) +def is_point_in_bbox(px: float, py: float, bbox: dm.Bbox | BboxCoords) -> bool: + if isinstance(bbox, dm.Bbox): + bbox = bbox.get_bbox() + + x, y, w, h = bbox + return (x <= px <= x + w) and (y <= py <= y + h) class InstanceSegmentsToBbox(dm.ItemTransform): From 682132a16fa61b7bd882d717f076c3c32d426943 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Francisco=20L=C3=B3pez?= Date: Mon, 19 May 2025 15:13:36 +0200 Subject: [PATCH 05/18] Escrow cancellation management to Escrow contract --- packages/core/contracts/Escrow.sol | 67 +++--- .../core/contracts/interfaces/IEscrow.sol | 9 +- packages/core/test/Escrow-USDT.ts | 209 ++++++++++++++-- packages/core/test/Escrow.ts | 227 ++++++++++++++++-- 4 files changed, 435 insertions(+), 77 deletions(-) diff --git a/packages/core/contracts/Escrow.sol b/packages/core/contracts/Escrow.sol index bf8a6550a2..fcac414b8d 100644 --- a/packages/core/contracts/Escrow.sol +++ b/packages/core/contracts/Escrow.sol @@ -74,6 +74,8 @@ contract Escrow is IEscrow, ReentrancyGuard { uint256 public remainingFunds; + uint256 public reservedFunds; + constructor( address _token, address _launcher, @@ -96,10 +98,7 @@ contract Escrow is IEscrow, ReentrancyGuard { } function getBalance() public view returns (uint256) { - (bool success, bytes memory returnData) = token.staticcall( - abi.encodeWithSelector(FUNC_SELECTOR_BALANCE_OF, address(this)) - ); - return success ? abi.decode(returnData, (uint256)) : 0; + return getTokenBalance(token); } function getTokenBalance(address _token) public view returns (uint256) { @@ -192,10 +191,7 @@ contract Escrow is IEscrow, ReentrancyGuard { nonReentrant returns (bool) { - _safeTransfer(token, canceler, remainingFunds); - status = EscrowStatuses.Cancelled; - remainingFunds = 0; - emit Cancelled(); + status = EscrowStatuses.ToCancel; return true; } @@ -229,26 +225,49 @@ contract Escrow is IEscrow, ReentrancyGuard { if (remainingFunds > 0) { _safeTransfer(token, launcher, remainingFunds); remainingFunds = 0; + reservedFunds = 0; + } + if (status == EscrowStatuses.ToCancel) { + status = EscrowStatuses.Cancelled; + emit Cancelled(); + } else { + status = EscrowStatuses.Complete; + emit Completed(); } - status = EscrowStatuses.Complete; - emit Completed(); } function storeResults( string memory _url, - string memory _hash + string memory _hash, + uint256 _amount ) external override trustedOrRecordingOracle notExpired { require( status == EscrowStatuses.Pending || - status == EscrowStatuses.Partial, - 'Escrow not in Pending or Partial status state' + status == EscrowStatuses.Partial || + status == EscrowStatuses.ToCancel, + 'Escrow not in Pending, Partial or ToCancel status state' ); require(bytes(_url).length != 0, "URL can't be empty"); require(bytes(_hash).length != 0, "Hash can't be empty"); + require(_amount > 0, 'Amount must be greater than zero'); + require( + _amount <= remainingFunds - reservedFunds, + 'Not enough unreserved funds' + ); intermediateResultsUrl = _url; + reservedFunds += _amount; emit IntermediateStorage(_url, _hash); + + // If the escrow is ToCancel, transfer unreserved funds to launcher + if (status == EscrowStatuses.ToCancel) { + uint256 unreservedFunds = remainingFunds - reservedFunds; + if (unreservedFunds > 0) { + _safeTransfer(token, launcher, unreservedFunds); + remainingFunds = reservedFunds; + } + } } /** @@ -298,8 +317,6 @@ contract Escrow is IEscrow, ReentrancyGuard { ); uint256 aggregatedBulkAmount = 0; - uint256 cachedRemainingFunds = remainingFunds; - for (uint256 i = 0; i < _amounts.length; i++) { uint256 amount = _amounts[i]; require(amount > 0, 'Amount should be greater than zero'); @@ -307,11 +324,12 @@ contract Escrow is IEscrow, ReentrancyGuard { } require(aggregatedBulkAmount < BULK_MAX_VALUE, 'Bulk value too high'); require( - aggregatedBulkAmount <= cachedRemainingFunds, - 'Not enough balance' + aggregatedBulkAmount <= reservedFunds, + 'Not enough reserved funds' ); - cachedRemainingFunds -= aggregatedBulkAmount; + reservedFunds -= aggregatedBulkAmount; + remainingFunds -= aggregatedBulkAmount; require(bytes(_url).length != 0, "URL can't be empty"); require(bytes(_hash).length != 0, "Hash can't be empty"); @@ -352,9 +370,7 @@ contract Escrow is IEscrow, ReentrancyGuard { ); } - remainingFunds = cachedRemainingFunds; - - if (cachedRemainingFunds == 0 || forceComplete) { + if (remainingFunds == 0 || forceComplete) { emit BulkTransferV2( _txId, _recipients, @@ -364,7 +380,9 @@ contract Escrow is IEscrow, ReentrancyGuard { ); _complete(); } else { - status = EscrowStatuses.Partial; + if (status != EscrowStatuses.ToCancel) { + status = EscrowStatuses.Partial; + } emit BulkTransferV2( _txId, _recipients, @@ -433,11 +451,6 @@ contract Escrow is IEscrow, ReentrancyGuard { _; } - modifier notPaid() { - require(status != EscrowStatuses.Paid, 'Escrow in Paid status state'); - _; - } - modifier notLaunched() { require( status != EscrowStatuses.Launched, diff --git a/packages/core/contracts/interfaces/IEscrow.sol b/packages/core/contracts/interfaces/IEscrow.sol index 3066d9423e..ff34743020 100644 --- a/packages/core/contracts/interfaces/IEscrow.sol +++ b/packages/core/contracts/interfaces/IEscrow.sol @@ -9,7 +9,8 @@ interface IEscrow { Partial, Paid, Complete, - Cancelled + Cancelled, + ToCancel } function status() external view returns (EscrowStatuses); @@ -33,7 +34,11 @@ interface IEscrow { function complete() external; - function storeResults(string memory _url, string memory _hash) external; + function storeResults( + string memory _url, + string memory _hash, + uint256 _amount + ) external; function bulkPayOut( address[] memory _recipients, diff --git a/packages/core/test/Escrow-USDT.ts b/packages/core/test/Escrow-USDT.ts index c8cb771f5d..b70c2793e4 100644 --- a/packages/core/test/Escrow-USDT.ts +++ b/packages/core/test/Escrow-USDT.ts @@ -16,6 +16,7 @@ enum Status { Paid = 3, Complete = 4, Cancelled = 5, + ToCancel = 6, } let owner: Signer, @@ -64,6 +65,12 @@ async function fundEscrow() { await usdt.connect(owner).transfer(escrow.getAddress(), amount); } +async function storeResults(amount = 50) { + await escrow + .connect(restAccounts[0]) + .storeResults(MOCK_URL, MOCK_HASH, amount); +} + describe('Escrow with USDT', function () { this.beforeAll(async () => { [ @@ -177,7 +184,7 @@ describe('Escrow with USDT', function () { const result = await ( await escrow .connect(restAccounts[2]) - .storeResults(MOCK_URL, MOCK_HASH) + .storeResults(MOCK_URL, MOCK_HASH, 50) ).wait(); expect((result?.logs[0] as EventLog).args).to.contain(MOCK_URL); @@ -192,7 +199,7 @@ describe('Escrow with USDT', function () { const result = await ( await escrow .connect(restAccounts[3]) - .storeResults(MOCK_URL, MOCK_HASH) + .storeResults(MOCK_URL, MOCK_HASH, 50) ).wait(); expect((result?.logs[0] as EventLog).args).to.contain(MOCK_URL); @@ -203,28 +210,55 @@ describe('Escrow with USDT', function () { describe('storeResults', async () => { describe('Validations', function () { - before(async () => { + beforeEach(async () => { await deployEscrow(); }); it('Should revert with the right error if address calling not trusted', async function () { await expect( - escrow.connect(externalAddress).storeResults(MOCK_URL, MOCK_HASH) + escrow.connect(externalAddress).storeResults(MOCK_URL, MOCK_HASH, 50) ).to.be.revertedWith('Address calling not trusted'); }); it('Should revert with the right error if address calling is reputation oracle', async function () { await expect( - escrow.connect(reputationOracle).storeResults(MOCK_URL, MOCK_HASH) + escrow.connect(reputationOracle).storeResults(MOCK_URL, MOCK_HASH, 50) ).to.be.revertedWith('Address calling not trusted'); }); - it('Should revert with the right error if escrow not in Pending or Partial status state', async function () { + it('Should revert with the right error if escrow not in Pending, Partial or ToCancel status state', async function () { + await escrow + .connect(owner) + .addTrustedHandlers([await reputationOracle.getAddress()]); + await expect( + escrow.connect(reputationOracle).storeResults(MOCK_URL, MOCK_HASH, 50) + ).to.be.revertedWith( + 'Escrow not in Pending, Partial or ToCancel status state' + ); + }); + + it('Should revert with the right error if amount sent is 0', async function () { + await fundEscrow(); + await setupEscrow(); + await escrow + .connect(owner) + .addTrustedHandlers([await reputationOracle.getAddress()]); + await expect( + escrow.connect(reputationOracle).storeResults(MOCK_URL, MOCK_HASH, 0) + ).to.be.revertedWith('Amount must be greater than zero'); + }); + + it('Should revert with the right error if amount is higher than unreserved funds', async function () { + await fundEscrow(); + await setupEscrow(); + await escrow .connect(owner) .addTrustedHandlers([await reputationOracle.getAddress()]); await expect( - escrow.connect(reputationOracle).storeResults(MOCK_URL, MOCK_HASH) - ).to.be.revertedWith('Escrow not in Pending or Partial status state'); + escrow + .connect(reputationOracle) + .storeResults(MOCK_URL, MOCK_HASH, 150) + ).to.be.revertedWith('Not enough unreserved funds'); }); }); @@ -237,7 +271,7 @@ describe('Escrow with USDT', function () { it('Should emit an event on intermediate storage', async function () { await expect( - await escrow.connect(owner).storeResults(MOCK_URL, MOCK_HASH) + await escrow.connect(owner).storeResults(MOCK_URL, MOCK_HASH, 50) ) .to.emit(escrow, 'IntermediateStorage') .withArgs(MOCK_URL, MOCK_HASH); @@ -245,32 +279,71 @@ describe('Escrow with USDT', function () { }); describe('Store results', async function () { - before(async () => { + beforeEach(async () => { await deployEscrow(); await fundEscrow(); await setupEscrow(); }); it('Should succeed when recording oracle stores results', async () => { + const initialOwnerBalance = await usdt + .connect(owner) + .balanceOf(launcher.getAddress()); const result = await ( await escrow .connect(recordingOracle) - .storeResults(MOCK_URL, MOCK_HASH) + .storeResults(MOCK_URL, MOCK_HASH, 50) ).wait(); + const finalOwnerBalance = await usdt + .connect(owner) + .balanceOf(launcher.getAddress()); expect((result?.logs[0] as EventLog).args).to.contain(MOCK_URL); expect((result?.logs[0] as EventLog).args).to.contain(MOCK_HASH); + expect(finalOwnerBalance - initialOwnerBalance).to.equal(0); + expect(await escrow.remainingFunds()).to.equal(100); + expect(await escrow.reservedFunds()).to.equal(50); }); it('Should succeed when a trusted handler stores results', async () => { + const initialOwnerBalance = await usdt + .connect(owner) + .balanceOf(launcher.getAddress()); const result = await ( await escrow .connect(trustedHandlers[0]) - .storeResults(MOCK_URL, MOCK_HASH) + .storeResults(MOCK_URL, MOCK_HASH, 50) ).wait(); + const finalOwnerBalance = await usdt + .connect(owner) + .balanceOf(launcher.getAddress()); expect((result?.logs[0] as EventLog).args).to.contain(MOCK_URL); expect((result?.logs[0] as EventLog).args).to.contain(MOCK_HASH); + expect(finalOwnerBalance - initialOwnerBalance).to.equal(0); + expect(await escrow.remainingFunds()).to.equal(100); + expect(await escrow.reservedFunds()).to.equal(50); + }); + + it('Should return unreserved funds to escrow launcher when status is ToCancel', async () => { + const initialOwnerBalance = await usdt + .connect(owner) + .balanceOf(launcher.getAddress()); + await (await escrow.connect(launcher).cancel()).wait(); + const result = await ( + await escrow + .connect(recordingOracle) + .storeResults(MOCK_URL, MOCK_HASH, 50) + ).wait(); + + expect((result?.logs[0] as EventLog).args).to.contain(MOCK_URL); + expect((result?.logs[0] as EventLog).args).to.contain(MOCK_HASH); + const finalOwnerBalance = await usdt + .connect(owner) + .balanceOf(launcher.getAddress()); + expect(finalOwnerBalance - initialOwnerBalance).to.equal(50); + expect(await escrow.remainingFunds()).to.equal(50); + expect(await escrow.reservedFunds()).to.equal(50); }); }); }); @@ -471,6 +544,7 @@ describe('Escrow with USDT', function () { await deployEscrow(); await fundEscrow(); await setupEscrow(); + await storeResults(100); await escrow .connect(owner) @@ -508,21 +582,13 @@ describe('Escrow with USDT', function () { it('Should succeed when the contract was canceled', async () => { await escrow.connect(owner).cancel(); const ststus = await escrow.status(); - expect(ststus).to.equal(Status.Cancelled); - - expect( - await usdt.connect(owner).balanceOf(escrow.getAddress()) - ).to.equal('0', 'Escrow has not been properly canceled'); + expect(ststus).to.equal(Status.ToCancel); }); it('Should succeed when the contract was canceled by trusted handler', async () => { await escrow.connect(trustedHandlers[0]).cancel(); const ststus = await escrow.status(); - expect(ststus).to.equal(Status.Cancelled); - - expect( - await usdt.connect(owner).balanceOf(escrow.getAddress()) - ).to.equal('0', 'Escrow has not been properly canceled'); + expect(ststus).to.equal(Status.ToCancel); }); }); }); @@ -533,6 +599,7 @@ describe('Escrow with USDT', function () { await deployEscrow(); await fundEscrow(); await setupEscrow(); + await storeResults(); }); it('Should revert with the right error if address calling is not trusted', async function () { @@ -609,6 +676,23 @@ describe('Escrow with USDT', function () { ](recepients, amounts, MOCK_URL, MOCK_HASH, '000') ).to.be.revertedWith('Too many recipients'); }); + + it('Should revert with the right error if trying to payout more than reservedFunds', async function () { + const recepients = [ + await restAccounts[0].getAddress(), + await restAccounts[1].getAddress(), + await restAccounts[2].getAddress(), + ]; + const amounts = [10, 20, 30]; + + await expect( + escrow + .connect(reputationOracle) + [ + 'bulkPayOut(address[],uint256[],string,string,uint256)' + ](recepients, amounts, MOCK_URL, MOCK_HASH, '000') + ).to.be.revertedWith('Not enough reserved funds'); + }); }); describe('Events', function () { @@ -616,6 +700,7 @@ describe('Escrow with USDT', function () { await deployEscrow(); await fundEscrow(); await setupEscrow(); + await storeResults(100); }); it('Should emit bulkPayOut and Completed events for complete bulkPayOut', async function () { @@ -635,6 +720,25 @@ describe('Escrow with USDT', function () { await expect(tx).to.emit(escrow, 'Completed'); }); + it('Should emit bulkPayOut and Cancelled events for complete bulkPayOut with ToCancel status', async function () { + const recepients = [await restAccounts[0].getAddress()]; + const amounts = [100]; + + await escrow.connect(owner).cancel(); + + const tx = await escrow + .connect(owner) + [ + 'bulkPayOut(address[],uint256[],string,string,uint256)' + ](recepients, amounts, MOCK_URL, MOCK_HASH, '000'); + + await expect(tx) + .to.emit(escrow, 'BulkTransferV2') + .withArgs(anyValue, recepients, [100], false, MOCK_URL); + + await expect(tx).to.emit(escrow, 'Cancelled'); + }); + it('Should emit only bulkPayOut event for partial bulkPayOut', async function () { const recepients = [await restAccounts[0].getAddress()]; const amounts = [10]; @@ -668,6 +772,25 @@ describe('Escrow with USDT', function () { await expect(tx).to.emit(escrow, 'Completed'); }); + + it('Should emit bulkPayOut and Cancelled events for partial bulkPayOut with forceComplete option and ToCancel status', async function () { + const recepients = [await restAccounts[0].getAddress()]; + const amounts = [10]; + + await escrow.connect(owner).cancel(); + + const tx = await escrow + .connect(owner) + [ + 'bulkPayOut(address[],uint256[],string,string,uint256,bool)' + ](recepients, amounts, MOCK_URL, MOCK_HASH, '000', true); + + await expect(tx) + .to.emit(escrow, 'BulkTransferV2') + .withArgs(anyValue, recepients, [10], false, MOCK_URL); + + await expect(tx).to.emit(escrow, 'Cancelled'); + }); }); describe('Bulk payout for recipients', async function () { @@ -675,6 +798,7 @@ describe('Escrow with USDT', function () { await deployEscrow(); await fundEscrow(); await setupEscrow(); + await storeResults(100); }); it('Should pays each recipient their corresponding amount', async () => { @@ -876,6 +1000,26 @@ describe('Escrow with USDT', function () { expect(await escrow.status()).to.equal(Status.Complete); }); + it('Should runs from setup to bulkPayOut to Cancelled correctly with multiple addresses', async () => { + const recepients = [ + await restAccounts[3].getAddress(), + await restAccounts[4].getAddress(), + await restAccounts[5].getAddress(), + ]; + const amounts = [10, 20, 70]; + + await escrow.connect(owner).cancel(); + + expect(await escrow.status()).to.equal(Status.ToCancel); + + await escrow + .connect(reputationOracle) + [ + 'bulkPayOut(address[],uint256[],string,string,uint256)' + ](recepients, amounts, MOCK_URL, MOCK_HASH, '000'); + expect(await escrow.status()).to.equal(Status.Cancelled); + }); + it('Should runs from setup to bulkPayOut to partial correctly', async () => { const recepients = [await restAccounts[3].getAddress()]; const amounts = [80]; @@ -890,6 +1034,22 @@ describe('Escrow with USDT', function () { expect(await escrow.status()).to.equal(Status.Partial); }); + it('Should runs partial bulkPayOut without modifying status if status is ToCancel', async () => { + const recepients = [await restAccounts[3].getAddress()]; + const amounts = [80]; + + await escrow.connect(owner).cancel(); + + expect(await escrow.status()).to.equal(Status.ToCancel); + + await escrow + .connect(reputationOracle) + [ + 'bulkPayOut(address[],uint256[],string,string,uint256)' + ](recepients, amounts, MOCK_URL, MOCK_HASH, '000'); + expect(await escrow.status()).to.equal(Status.ToCancel); + }); + it('Should runs from setup to bulkPayOut to partial correctly with multiple addresses', async () => { const recepients = [ await restAccounts[3].getAddress(), @@ -982,9 +1142,10 @@ describe('Escrow with USDT', function () { await deployEscrow(); await fundEscrow(); await setupEscrow(); + await storeResults(); }); - it('Should revert with the right error if escrow not in Paid or Partial state', async function () { + it('Should revert with the right error if escrow not in Paid, Partial or ToCancel state', async function () { await expect(escrow.connect(owner).complete()).to.be.revertedWith( 'Escrow not in Paid or Partial state' ); @@ -996,6 +1157,7 @@ describe('Escrow with USDT', function () { await deployEscrow(); await fundEscrow(); await setupEscrow(); + await storeResults(); const recipients = [await restAccounts[0].getAddress()]; const amounts = [10]; @@ -1019,6 +1181,7 @@ describe('Escrow with USDT', function () { await deployEscrow(); await fundEscrow(); await setupEscrow(); + await storeResults(); }); it('Should succeed if escrow is in Partial state', async function () { diff --git a/packages/core/test/Escrow.ts b/packages/core/test/Escrow.ts index 85c01fc5a9..a5ae002203 100644 --- a/packages/core/test/Escrow.ts +++ b/packages/core/test/Escrow.ts @@ -16,6 +16,7 @@ enum Status { Paid = 3, Complete = 4, Cancelled = 5, + ToCancel = 6, } let owner: Signer, @@ -63,6 +64,12 @@ async function fundEscrow() { await token.connect(owner).transfer(escrow.getAddress(), amount); } +async function storeResults(amount = 50) { + await escrow + .connect(restAccounts[0]) + .storeResults(MOCK_URL, MOCK_HASH, amount); +} + describe('Escrow', function () { this.beforeAll(async () => { [ @@ -170,7 +177,7 @@ describe('Escrow', function () { const result = await ( await escrow .connect(restAccounts[2]) - .storeResults(MOCK_URL, MOCK_HASH) + .storeResults(MOCK_URL, MOCK_HASH, 50) ).wait(); expect((result?.logs[0] as EventLog).args).to.contain(MOCK_URL); @@ -185,7 +192,7 @@ describe('Escrow', function () { const result = await ( await escrow .connect(restAccounts[3]) - .storeResults(MOCK_URL, MOCK_HASH) + .storeResults(MOCK_URL, MOCK_HASH, 50) ).wait(); expect((result?.logs[0] as EventLog).args).to.contain(MOCK_URL); @@ -196,28 +203,55 @@ describe('Escrow', function () { describe('storeResults', async () => { describe('Validations', function () { - before(async () => { + beforeEach(async () => { await deployEscrow(); }); it('Should revert with the right error if address calling not trusted', async function () { await expect( - escrow.connect(externalAddress).storeResults(MOCK_URL, MOCK_HASH) + escrow.connect(externalAddress).storeResults(MOCK_URL, MOCK_HASH, 50) ).to.be.revertedWith('Address calling not trusted'); }); it('Should revert with the right error if address calling is reputation oracle', async function () { await expect( - escrow.connect(reputationOracle).storeResults(MOCK_URL, MOCK_HASH) + escrow.connect(reputationOracle).storeResults(MOCK_URL, MOCK_HASH, 50) ).to.be.revertedWith('Address calling not trusted'); }); - it('Should revert with the right error if escrow not in Pending or Partial status state', async function () { + it('Should revert with the right error if escrow not in Pending, Partial or ToCancel status state', async function () { + await escrow + .connect(owner) + .addTrustedHandlers([await reputationOracle.getAddress()]); + await expect( + escrow.connect(reputationOracle).storeResults(MOCK_URL, MOCK_HASH, 50) + ).to.be.revertedWith( + 'Escrow not in Pending, Partial or ToCancel status state' + ); + }); + + it('Should revert with the right error if amount sent is 0', async function () { + await fundEscrow(); + await setupEscrow(); + await escrow + .connect(owner) + .addTrustedHandlers([await reputationOracle.getAddress()]); + await expect( + escrow.connect(reputationOracle).storeResults(MOCK_URL, MOCK_HASH, 0) + ).to.be.revertedWith('Amount must be greater than zero'); + }); + + it('Should revert with the right error if amount is higher than unreserved funds', async function () { + await fundEscrow(); + await setupEscrow(); + await escrow .connect(owner) .addTrustedHandlers([await reputationOracle.getAddress()]); await expect( - escrow.connect(reputationOracle).storeResults(MOCK_URL, MOCK_HASH) - ).to.be.revertedWith('Escrow not in Pending or Partial status state'); + escrow + .connect(reputationOracle) + .storeResults(MOCK_URL, MOCK_HASH, 150) + ).to.be.revertedWith('Not enough unreserved funds'); }); }); @@ -230,7 +264,7 @@ describe('Escrow', function () { it('Should emit an event on intermediate storage', async function () { await expect( - await escrow.connect(owner).storeResults(MOCK_URL, MOCK_HASH) + await escrow.connect(owner).storeResults(MOCK_URL, MOCK_HASH, 50) ) .to.emit(escrow, 'IntermediateStorage') .withArgs(MOCK_URL, MOCK_HASH); @@ -238,32 +272,71 @@ describe('Escrow', function () { }); describe('Store results', async function () { - before(async () => { + beforeEach(async () => { await deployEscrow(); await fundEscrow(); await setupEscrow(); }); it('Should succeed when recording oracle stores results', async () => { + const initialOwnerBalance = await token + .connect(owner) + .balanceOf(launcher.getAddress()); const result = await ( await escrow .connect(recordingOracle) - .storeResults(MOCK_URL, MOCK_HASH) + .storeResults(MOCK_URL, MOCK_HASH, 50) ).wait(); + const finalOwnerBalance = await token + .connect(owner) + .balanceOf(launcher.getAddress()); expect((result?.logs[0] as EventLog).args).to.contain(MOCK_URL); expect((result?.logs[0] as EventLog).args).to.contain(MOCK_HASH); + expect(finalOwnerBalance - initialOwnerBalance).to.equal(0); + expect(await escrow.remainingFunds()).to.equal(100); + expect(await escrow.reservedFunds()).to.equal(50); }); it('Should succeed when a trusted handler stores results', async () => { + const initialOwnerBalance = await token + .connect(owner) + .balanceOf(launcher.getAddress()); const result = await ( await escrow .connect(trustedHandlers[0]) - .storeResults(MOCK_URL, MOCK_HASH) + .storeResults(MOCK_URL, MOCK_HASH, 50) ).wait(); + const finalOwnerBalance = await token + .connect(owner) + .balanceOf(launcher.getAddress()); expect((result?.logs[0] as EventLog).args).to.contain(MOCK_URL); expect((result?.logs[0] as EventLog).args).to.contain(MOCK_HASH); + expect(finalOwnerBalance - initialOwnerBalance).to.equal(0); + expect(await escrow.remainingFunds()).to.equal(100); + expect(await escrow.reservedFunds()).to.equal(50); + }); + + it('Should return unreserved funds to escrow launcher when status is ToCancel', async () => { + const initialOwnerBalance = await token + .connect(owner) + .balanceOf(launcher.getAddress()); + await (await escrow.connect(launcher).cancel()).wait(); + const result = await ( + await escrow + .connect(recordingOracle) + .storeResults(MOCK_URL, MOCK_HASH, 50) + ).wait(); + + expect((result?.logs[0] as EventLog).args).to.contain(MOCK_URL); + expect((result?.logs[0] as EventLog).args).to.contain(MOCK_HASH); + const finalOwnerBalance = await token + .connect(owner) + .balanceOf(launcher.getAddress()); + expect(finalOwnerBalance - initialOwnerBalance).to.equal(50); + expect(await escrow.remainingFunds()).to.equal(50); + expect(await escrow.reservedFunds()).to.equal(50); }); }); }); @@ -464,6 +537,7 @@ describe('Escrow', function () { await deployEscrow(); await fundEscrow(); await setupEscrow(); + await storeResults(100); await escrow .connect(owner) @@ -500,22 +574,26 @@ describe('Escrow', function () { it('Should succeed when the contract was canceled', async () => { await escrow.connect(owner).cancel(); - const ststus = await escrow.status(); - expect(ststus).to.equal(Status.Cancelled); - - expect( - await token.connect(owner).balanceOf(escrow.getAddress()) - ).to.equal('0', 'Escrow has not been properly canceled'); + const status = await escrow.status(); + expect(status).to.equal(Status.ToCancel); }); it('Should succeed when the contract was canceled by trusted handler', async () => { await escrow.connect(trustedHandlers[0]).cancel(); - const ststus = await escrow.status(); - expect(ststus).to.equal(Status.Cancelled); + const status = await escrow.status(); + expect(status).to.equal(Status.ToCancel); + }); - expect( - await token.connect(owner).balanceOf(escrow.getAddress()) - ).to.equal('0', 'Escrow has not been properly canceled'); + it('Should succeed when the contract was canceled', async () => { + await escrow.connect(owner).cancel(); + const status = await escrow.status(); + expect(status).to.equal(Status.ToCancel); + }); + + it('Should succeed when the contract was canceled by trusted handler', async () => { + await escrow.connect(trustedHandlers[0]).cancel(); + const status = await escrow.status(); + expect(status).to.equal(Status.ToCancel); }); }); }); @@ -526,6 +604,7 @@ describe('Escrow', function () { await deployEscrow(); await fundEscrow(); await setupEscrow(); + await storeResults(); }); it('Should revert with the right error if address calling is not trusted', async function () { @@ -602,13 +681,31 @@ describe('Escrow', function () { ](recepients, amounts, MOCK_URL, MOCK_HASH, '000') ).to.be.revertedWith('Too many recipients'); }); + + it('Should revert with the right error if trying to payout more than reservedFunds', async function () { + const recepients = [ + await restAccounts[0].getAddress(), + await restAccounts[1].getAddress(), + await restAccounts[2].getAddress(), + ]; + const amounts = [10, 20, 30]; + + await expect( + escrow + .connect(reputationOracle) + [ + 'bulkPayOut(address[],uint256[],string,string,uint256)' + ](recepients, amounts, MOCK_URL, MOCK_HASH, '000') + ).to.be.revertedWith('Not enough reserved funds'); + }); }); describe('Events', function () { - this.beforeEach(async () => { + beforeEach(async () => { await deployEscrow(); await fundEscrow(); await setupEscrow(); + await storeResults(100); }); it('Should emit bulkPayOut and Completed events for complete bulkPayOut', async function () { @@ -628,6 +725,25 @@ describe('Escrow', function () { await expect(tx).to.emit(escrow, 'Completed'); }); + it('Should emit bulkPayOut and Cancelled events for complete bulkPayOut with ToCancel status', async function () { + const recepients = [await restAccounts[0].getAddress()]; + const amounts = [100]; + + await escrow.connect(owner).cancel(); + + const tx = await escrow + .connect(owner) + [ + 'bulkPayOut(address[],uint256[],string,string,uint256)' + ](recepients, amounts, MOCK_URL, MOCK_HASH, '000'); + + await expect(tx) + .to.emit(escrow, 'BulkTransferV2') + .withArgs(anyValue, recepients, [100], false, MOCK_URL); + + await expect(tx).to.emit(escrow, 'Cancelled'); + }); + it('Should emit only bulkPayOut event for partial bulkPayOut', async function () { const recepients = [await restAccounts[0].getAddress()]; const amounts = [10]; @@ -661,12 +777,33 @@ describe('Escrow', function () { await expect(tx).to.emit(escrow, 'Completed'); }); + + it('Should emit bulkPayOut and Cancelled events for partial bulkPayOut with forceComplete option and ToCancel status', async function () { + const recepients = [await restAccounts[0].getAddress()]; + const amounts = [10]; + + await escrow.connect(owner).cancel(); + + const tx = await escrow + .connect(owner) + [ + 'bulkPayOut(address[],uint256[],string,string,uint256,bool)' + ](recepients, amounts, MOCK_URL, MOCK_HASH, '000', true); + + await expect(tx) + .to.emit(escrow, 'BulkTransferV2') + .withArgs(anyValue, recepients, [10], false, MOCK_URL); + + await expect(tx).to.emit(escrow, 'Cancelled'); + }); }); + describe('Bulk payout for recipients', async function () { beforeEach(async () => { await deployEscrow(); await fundEscrow(); await setupEscrow(); + await storeResults(100); }); it('Should pays each recipient their corresponding amount', async () => { @@ -868,6 +1005,26 @@ describe('Escrow', function () { expect(await escrow.status()).to.equal(Status.Complete); }); + it('Should runs from setup to bulkPayOut to Cancelled correctly with multiple addresses', async () => { + const recepients = [ + await restAccounts[3].getAddress(), + await restAccounts[4].getAddress(), + await restAccounts[5].getAddress(), + ]; + const amounts = [10, 20, 70]; + + await escrow.connect(owner).cancel(); + + expect(await escrow.status()).to.equal(Status.ToCancel); + + await escrow + .connect(reputationOracle) + [ + 'bulkPayOut(address[],uint256[],string,string,uint256)' + ](recepients, amounts, MOCK_URL, MOCK_HASH, '000'); + expect(await escrow.status()).to.equal(Status.Cancelled); + }); + it('Should runs from setup to bulkPayOut to partial correctly', async () => { const recepients = [await restAccounts[3].getAddress()]; const amounts = [80]; @@ -882,6 +1039,22 @@ describe('Escrow', function () { expect(await escrow.status()).to.equal(Status.Partial); }); + it('Should runs partial bulkPayOut without modifying status if status is ToCancel', async () => { + const recepients = [await restAccounts[3].getAddress()]; + const amounts = [80]; + + await escrow.connect(owner).cancel(); + + expect(await escrow.status()).to.equal(Status.ToCancel); + + await escrow + .connect(reputationOracle) + [ + 'bulkPayOut(address[],uint256[],string,string,uint256)' + ](recepients, amounts, MOCK_URL, MOCK_HASH, '000'); + expect(await escrow.status()).to.equal(Status.ToCancel); + }); + it('Should runs from setup to bulkPayOut to partial correctly with multiple addresses', async () => { const recepients = [ await restAccounts[3].getAddress(), @@ -901,15 +1074,17 @@ describe('Escrow', function () { }); }); }); + describe('complete', () => { describe('Validations', function () { beforeEach(async () => { await deployEscrow(); await fundEscrow(); await setupEscrow(); + await storeResults(); }); - it('Should revert with the right error if escrow not in Paid or Partial state', async function () { + it('Should revert with the right error if escrow not in Paid, Partial or ToCancel state', async function () { await expect(escrow.connect(owner).complete()).to.be.revertedWith( 'Escrow not in Paid or Partial state' ); @@ -921,6 +1096,7 @@ describe('Escrow', function () { await deployEscrow(); await fundEscrow(); await setupEscrow(); + await storeResults(); }); it('Should emit a Completed event when escrow is completed', async function () { @@ -945,6 +1121,7 @@ describe('Escrow', function () { await deployEscrow(); await fundEscrow(); await setupEscrow(); + await storeResults(); }); it('Should succeed if escrow is in Partial state', async function () { From 941d54496b87153302f4c1ab94312fe48203ba27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Francisco=20L=C3=B3pez?= Date: Mon, 19 May 2025 17:54:22 +0200 Subject: [PATCH 06/18] Implemented sdk changes for new amount reservation in StoreResults --- ...human_protocol_sdk.escrow.escrow_client.md | 6 +- docs/sdk/python/human_protocol_sdk.filter.md | 4 +- .../base/classes/BaseEthersClient.md | 14 +-- .../encryption/classes/Encryption.md | 24 ++--- .../encryption/classes/EncryptionUtils.md | 18 ++-- .../typescript/enums/enumerations/ChainId.md | 18 ++-- .../enums/enumerations/OperatorCategory.md | 6 +- .../enums/enumerations/OrderDirection.md | 6 +- .../typescript/escrow/classes/EscrowClient.md | 101 ++++++++++-------- .../typescript/escrow/classes/EscrowUtils.md | 16 +-- .../types/type-aliases/DailyEscrowData.md | 28 ++++- .../types/type-aliases/DailyHMTData.md | 24 ++++- .../types/type-aliases/DailyPaymentData.md | 20 +++- .../types/type-aliases/DailyTaskData.md | 16 ++- .../types/type-aliases/DailyWorkerData.md | 12 ++- .../graphql/types/type-aliases/EscrowData.md | 80 +++++++++++++- .../types/type-aliases/EscrowStatistics.md | 12 ++- .../type-aliases/EscrowStatisticsData.md | 44 +++++++- .../types/type-aliases/EventDayData.md | 76 ++++++++++++- .../graphql/types/type-aliases/HMTHolder.md | 12 ++- .../types/type-aliases/HMTHolderData.md | 12 ++- .../types/type-aliases/HMTStatistics.md | 16 ++- .../types/type-aliases/HMTStatisticsData.md | 28 ++++- .../graphql/types/type-aliases/IMData.md | 4 +- .../types/type-aliases/IMDataEntity.md | 12 ++- .../graphql/types/type-aliases/KVStoreData.md | 28 ++++- .../types/type-aliases/PaymentStatistics.md | 8 +- .../graphql/types/type-aliases/PayoutData.md | 24 ++++- .../type-aliases/RewardAddedEventData.md | 20 +++- .../graphql/types/type-aliases/StatusEvent.md | 20 +++- .../types/type-aliases/TaskStatistics.md | 8 +- .../types/type-aliases/WorkerStatistics.md | 8 +- .../interfaces/interfaces/IEscrowConfig.md | 18 ++-- .../interfaces/interfaces/IEscrowsFilter.md | 26 ++--- .../interfaces/IHMTHoldersParams.md | 10 +- .../interfaces/interfaces/IKVStore.md | 6 +- .../interfaces/interfaces/IKeyPair.md | 10 +- .../interfaces/interfaces/IOperator.md | 46 ++++---- .../interfaces/IOperatorSubgraph.md | 44 ++++---- .../interfaces/interfaces/IOperatorsFilter.md | 16 +-- .../interfaces/interfaces/IPagination.md | 8 +- .../interfaces/interfaces/IPayoutFilter.md | 18 ++-- .../interfaces/IReputationNetwork.md | 8 +- .../interfaces/IReputationNetworkSubgraph.md | 8 +- .../interfaces/interfaces/IReward.md | 6 +- .../interfaces/IStatisticsFilter.md | 12 +-- .../interfaces/IStatusEventFilter.md | 18 ++-- .../interfaces/interfaces/ITransaction.md | 24 ++--- .../interfaces/ITransactionsFilter.md | 22 ++-- .../interfaces/interfaces/IWorker.md | 10 +- .../interfaces/interfaces/IWorkersFilter.md | 14 +-- .../interfaces/InternalTransaction.md | 16 +-- .../interfaces/interfaces/StakerInfo.md | 10 +- .../kvstore/classes/KVStoreClient.md | 38 +++---- .../kvstore/classes/KVStoreUtils.md | 16 +-- .../operator/classes/OperatorUtils.md | 18 ++-- .../staking/classes/StakingClient.md | 54 +++++----- .../statistics/classes/StatisticsClient.md | 26 ++--- .../storage/classes/StorageClient.md | 20 ++-- .../transaction/classes/TransactionUtils.md | 12 +-- .../types/enumerations/EscrowStatus.md | 14 +-- .../types/type-aliases/EscrowCancel.md | 12 ++- .../types/type-aliases/EscrowWithdraw.md | 16 ++- .../types/type-aliases/NetworkData.md | 48 ++++++++- .../typescript/types/type-aliases/Payout.md | 24 ++++- .../types/type-aliases/StorageCredentials.md | 20 ++-- .../types/type-aliases/StorageParams.md | 28 +++-- .../type-aliases/TransactionLikeWithNonce.md | 4 +- .../types/type-aliases/UploadFile.md | 16 ++- .../src/modules/job/job.service.ts | 13 ++- packages/core/contracts/Escrow.sol | 1 - packages/core/test/Escrow-USDT.ts | 11 -- packages/core/test/Escrow.ts | 11 -- .../escrow/escrow_client.py | 11 +- .../escrow/test_escrow_client.py | 45 ++++++-- .../human-protocol-sdk/src/error.ts | 5 + .../human-protocol-sdk/src/escrow.ts | 16 ++- .../human-protocol-sdk/test/escrow.test.ts | 55 ++++++++-- 78 files changed, 1087 insertions(+), 522 deletions(-) diff --git a/docs/sdk/python/human_protocol_sdk.escrow.escrow_client.md b/docs/sdk/python/human_protocol_sdk.escrow.escrow_client.md index 86d1fd9559..96dedb4d49 100644 --- a/docs/sdk/python/human_protocol_sdk.escrow.escrow_client.md +++ b/docs/sdk/python/human_protocol_sdk.escrow.escrow_client.md @@ -843,7 +843,7 @@ Sets up the parameters of the escrow. * **Return type:** `None` -#### store_results(escrow_address, url, hash, tx_options=None) +#### store_results(escrow_address, url, hash, amount, tx_options=None) Stores the results URL. @@ -851,6 +851,7 @@ Stores the results URL. * **escrow_address** (`str`) – Address of the escrow * **url** (`str`) – Results file URL * **hash** (`str`) – Results file hash + * **amount** (`Decimal`) – Amount to reserve for payouts * **tx_options** (`Optional`[`TxParams`]) – (Optional) Additional transaction parameters * **Return type:** `None` @@ -884,7 +885,8 @@ Stores the results URL. escrow_client.store_results( "0x62dD51230A30401C455c8398d06F85e4EaB6309f", "http://localhost/results.json", - "b5dad76bf6772c0f07fd5e048f6e75a5f86ee079" + "b5dad76bf6772c0f07fd5e048f6e75a5f86ee079", + Web3.to_wei(5, 'ether') ) ``` diff --git a/docs/sdk/python/human_protocol_sdk.filter.md b/docs/sdk/python/human_protocol_sdk.filter.md index ae0d301983..da7dec57ce 100644 --- a/docs/sdk/python/human_protocol_sdk.filter.md +++ b/docs/sdk/python/human_protocol_sdk.filter.md @@ -120,13 +120,13 @@ Initializes a TransactionsFilter instance. * **Raises:** **ValueError** – If start_date is after end_date -### *class* human_protocol_sdk.filter.WorkerFilter(chain_id, worker_address=None, order_by=None, order_direction=OrderDirection.DESC, first=10, skip=0) +### *class* human_protocol_sdk.filter.WorkerFilter(chain_id, worker_address=None, order_by='payoutCount', order_direction=OrderDirection.DESC, first=10, skip=0) Bases: `object` A class used to filter workers. -#### \_\_init_\_(chain_id, worker_address=None, order_by=None, order_direction=OrderDirection.DESC, first=10, skip=0) +#### \_\_init_\_(chain_id, worker_address=None, order_by='payoutCount', order_direction=OrderDirection.DESC, first=10, skip=0) Initializes a WorkerFilter instance. diff --git a/docs/sdk/typescript/base/classes/BaseEthersClient.md b/docs/sdk/typescript/base/classes/BaseEthersClient.md index a0277ae359..6de540eeba 100644 --- a/docs/sdk/typescript/base/classes/BaseEthersClient.md +++ b/docs/sdk/typescript/base/classes/BaseEthersClient.md @@ -6,7 +6,7 @@ # Class: `abstract` BaseEthersClient -Defined in: [base.ts:10](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L10) +Defined in: [base.ts:10](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L10) ## Introduction @@ -20,11 +20,11 @@ This class is used as a base class for other clients making on-chain calls. ## Constructors -### new BaseEthersClient() +### Constructor -> **new BaseEthersClient**(`runner`, `networkData`): [`BaseEthersClient`](BaseEthersClient.md) +> **new BaseEthersClient**(`runner`, `networkData`): `BaseEthersClient` -Defined in: [base.ts:20](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L20) +Defined in: [base.ts:20](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L20) **BaseClient constructor** @@ -44,7 +44,7 @@ The network information required to connect to the contracts #### Returns -[`BaseEthersClient`](BaseEthersClient.md) +`BaseEthersClient` ## Properties @@ -52,7 +52,7 @@ The network information required to connect to the contracts > **networkData**: [`NetworkData`](../../types/type-aliases/NetworkData.md) -Defined in: [base.ts:12](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L12) +Defined in: [base.ts:12](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L12) *** @@ -60,4 +60,4 @@ Defined in: [base.ts:12](https://github.com/humanprotocol/human-protocol/blob/1f > `protected` **runner**: `ContractRunner` -Defined in: [base.ts:11](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L11) +Defined in: [base.ts:11](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L11) diff --git a/docs/sdk/typescript/encryption/classes/Encryption.md b/docs/sdk/typescript/encryption/classes/Encryption.md index 822c353959..38f9ab4994 100644 --- a/docs/sdk/typescript/encryption/classes/Encryption.md +++ b/docs/sdk/typescript/encryption/classes/Encryption.md @@ -6,7 +6,7 @@ # Class: Encryption -Defined in: [encryption.ts:58](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L58) +Defined in: [encryption.ts:58](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L58) ## Introduction @@ -49,11 +49,11 @@ const encryption = await Encryption.build(privateKey, passphrase); ## Constructors -### new Encryption() +### Constructor -> **new Encryption**(`privateKey`): [`Encryption`](Encryption.md) +> **new Encryption**(`privateKey`): `Encryption` -Defined in: [encryption.ts:66](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L66) +Defined in: [encryption.ts:66](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L66) Constructor for the Encryption class. @@ -67,15 +67,15 @@ The private key. #### Returns -[`Encryption`](Encryption.md) +`Encryption` ## Methods ### decrypt() -> **decrypt**(`message`, `publicKey`?): `Promise`\<`Uint8Array`\<`ArrayBufferLike`\>\> +> **decrypt**(`message`, `publicKey?`): `Promise`\<`Uint8Array`\<`ArrayBufferLike`\>\> -Defined in: [encryption.ts:194](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L194) +Defined in: [encryption.ts:194](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L194) This function decrypts messages using the private key. In addition, the public key can be added for signature verification. @@ -129,7 +129,7 @@ const resultMessage = await encryption.decrypt('message'); > **sign**(`message`): `Promise`\<`string`\> -Defined in: [encryption.ts:251](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L251) +Defined in: [encryption.ts:251](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L251) This function signs a message using the private key used to initialize the client. @@ -165,7 +165,7 @@ const resultMessage = await encryption.sign('message'); > **signAndEncrypt**(`message`, `publicKeys`): `Promise`\<`string`\> -Defined in: [encryption.ts:142](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L142) +Defined in: [encryption.ts:142](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L142) This function signs and encrypts a message using the private key used to initialize the client and the specified public keys. @@ -230,9 +230,9 @@ const resultMessage = await encryption.signAndEncrypt('message', publicKeys); ### build() -> `static` **build**(`privateKeyArmored`, `passphrase`?): `Promise`\<[`Encryption`](Encryption.md)\> +> `static` **build**(`privateKeyArmored`, `passphrase?`): `Promise`\<`Encryption`\> -Defined in: [encryption.ts:77](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L77) +Defined in: [encryption.ts:77](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L77) Builds an Encryption instance by decrypting the private key from an encrypted private key and passphrase. @@ -252,6 +252,6 @@ Optional: The passphrase for the private key. #### Returns -`Promise`\<[`Encryption`](Encryption.md)\> +`Promise`\<`Encryption`\> - The Encryption instance. diff --git a/docs/sdk/typescript/encryption/classes/EncryptionUtils.md b/docs/sdk/typescript/encryption/classes/EncryptionUtils.md index 8d1127cea6..1026c02235 100644 --- a/docs/sdk/typescript/encryption/classes/EncryptionUtils.md +++ b/docs/sdk/typescript/encryption/classes/EncryptionUtils.md @@ -6,7 +6,7 @@ # Class: EncryptionUtils -Defined in: [encryption.ts:290](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L290) +Defined in: [encryption.ts:290](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L290) ## Introduction @@ -34,13 +34,13 @@ const keyPair = await EncryptionUtils.generateKeyPair('Human', 'human@hmt.ai'); ## Constructors -### new EncryptionUtils() +### Constructor -> **new EncryptionUtils**(): [`EncryptionUtils`](EncryptionUtils.md) +> **new EncryptionUtils**(): `EncryptionUtils` #### Returns -[`EncryptionUtils`](EncryptionUtils.md) +`EncryptionUtils` ## Methods @@ -48,7 +48,7 @@ const keyPair = await EncryptionUtils.generateKeyPair('Human', 'human@hmt.ai'); > `static` **encrypt**(`message`, `publicKeys`): `Promise`\<`string`\> -Defined in: [encryption.ts:444](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L444) +Defined in: [encryption.ts:444](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L444) This function encrypts a message using the specified public keys. @@ -111,7 +111,7 @@ const result = await EncryptionUtils.encrypt('message', publicKeys); > `static` **generateKeyPair**(`name`, `email`, `passphrase`): `Promise`\<[`IKeyPair`](../../interfaces/interfaces/IKeyPair.md)\> -Defined in: [encryption.ts:382](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L382) +Defined in: [encryption.ts:382](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L382) This function generates a key pair for encryption and decryption. @@ -158,7 +158,7 @@ const result = await EncryptionUtils.generateKeyPair(name, email, passphrase); > `static` **getSignedData**(`message`): `Promise`\<`string`\> -Defined in: [encryption.ts:351](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L351) +Defined in: [encryption.ts:351](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L351) This function gets signed data from a signed message. @@ -190,7 +190,7 @@ const signedData = await EncryptionUtils.getSignedData('message'); > `static` **isEncrypted**(`message`): `boolean` -Defined in: [encryption.ts:494](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L494) +Defined in: [encryption.ts:494](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L494) Verifies if a message appears to be encrypted with OpenPGP. @@ -238,7 +238,7 @@ if (isEncrypted) { > `static` **verify**(`message`, `publicKey`): `Promise`\<`boolean`\> -Defined in: [encryption.ts:318](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L318) +Defined in: [encryption.ts:318](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L318) This function verifies the signature of a signed message using the public key. diff --git a/docs/sdk/typescript/enums/enumerations/ChainId.md b/docs/sdk/typescript/enums/enumerations/ChainId.md index 5627a76ac9..c8a3f014e2 100644 --- a/docs/sdk/typescript/enums/enumerations/ChainId.md +++ b/docs/sdk/typescript/enums/enumerations/ChainId.md @@ -6,7 +6,7 @@ # Enumeration: ChainId -Defined in: [enums.ts:1](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L1) +Defined in: [enums.ts:1](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L1) ## Enumeration Members @@ -14,7 +14,7 @@ Defined in: [enums.ts:1](https://github.com/humanprotocol/human-protocol/blob/1f > **ALL**: `-1` -Defined in: [enums.ts:2](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L2) +Defined in: [enums.ts:2](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L2) *** @@ -22,7 +22,7 @@ Defined in: [enums.ts:2](https://github.com/humanprotocol/human-protocol/blob/1f > **BSC\_MAINNET**: `56` -Defined in: [enums.ts:5](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L5) +Defined in: [enums.ts:5](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L5) *** @@ -30,7 +30,7 @@ Defined in: [enums.ts:5](https://github.com/humanprotocol/human-protocol/blob/1f > **BSC\_TESTNET**: `97` -Defined in: [enums.ts:6](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L6) +Defined in: [enums.ts:6](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L6) *** @@ -38,7 +38,7 @@ Defined in: [enums.ts:6](https://github.com/humanprotocol/human-protocol/blob/1f > **LOCALHOST**: `1338` -Defined in: [enums.ts:9](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L9) +Defined in: [enums.ts:9](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L9) *** @@ -46,7 +46,7 @@ Defined in: [enums.ts:9](https://github.com/humanprotocol/human-protocol/blob/1f > **MAINNET**: `1` -Defined in: [enums.ts:3](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L3) +Defined in: [enums.ts:3](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L3) *** @@ -54,7 +54,7 @@ Defined in: [enums.ts:3](https://github.com/humanprotocol/human-protocol/blob/1f > **POLYGON**: `137` -Defined in: [enums.ts:7](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L7) +Defined in: [enums.ts:7](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L7) *** @@ -62,7 +62,7 @@ Defined in: [enums.ts:7](https://github.com/humanprotocol/human-protocol/blob/1f > **POLYGON\_AMOY**: `80002` -Defined in: [enums.ts:8](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L8) +Defined in: [enums.ts:8](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L8) *** @@ -70,4 +70,4 @@ Defined in: [enums.ts:8](https://github.com/humanprotocol/human-protocol/blob/1f > **SEPOLIA**: `11155111` -Defined in: [enums.ts:4](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L4) +Defined in: [enums.ts:4](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L4) diff --git a/docs/sdk/typescript/enums/enumerations/OperatorCategory.md b/docs/sdk/typescript/enums/enumerations/OperatorCategory.md index 3d5d13af20..ea4c15d6ab 100644 --- a/docs/sdk/typescript/enums/enumerations/OperatorCategory.md +++ b/docs/sdk/typescript/enums/enumerations/OperatorCategory.md @@ -6,7 +6,7 @@ # Enumeration: OperatorCategory -Defined in: [enums.ts:17](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L17) +Defined in: [enums.ts:17](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L17) ## Enumeration Members @@ -14,7 +14,7 @@ Defined in: [enums.ts:17](https://github.com/humanprotocol/human-protocol/blob/1 > **MACHINE\_LEARNING**: `"machine_learning"` -Defined in: [enums.ts:18](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L18) +Defined in: [enums.ts:18](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L18) *** @@ -22,4 +22,4 @@ Defined in: [enums.ts:18](https://github.com/humanprotocol/human-protocol/blob/1 > **MARKET\_MAKING**: `"market_making"` -Defined in: [enums.ts:19](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L19) +Defined in: [enums.ts:19](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L19) diff --git a/docs/sdk/typescript/enums/enumerations/OrderDirection.md b/docs/sdk/typescript/enums/enumerations/OrderDirection.md index e980964850..9f6809c5d4 100644 --- a/docs/sdk/typescript/enums/enumerations/OrderDirection.md +++ b/docs/sdk/typescript/enums/enumerations/OrderDirection.md @@ -6,7 +6,7 @@ # Enumeration: OrderDirection -Defined in: [enums.ts:12](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L12) +Defined in: [enums.ts:12](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L12) ## Enumeration Members @@ -14,7 +14,7 @@ Defined in: [enums.ts:12](https://github.com/humanprotocol/human-protocol/blob/1 > **ASC**: `"asc"` -Defined in: [enums.ts:13](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L13) +Defined in: [enums.ts:13](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L13) *** @@ -22,4 +22,4 @@ Defined in: [enums.ts:13](https://github.com/humanprotocol/human-protocol/blob/1 > **DESC**: `"desc"` -Defined in: [enums.ts:14](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L14) +Defined in: [enums.ts:14](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L14) diff --git a/docs/sdk/typescript/escrow/classes/EscrowClient.md b/docs/sdk/typescript/escrow/classes/EscrowClient.md index 445e354d15..88ed51f62b 100644 --- a/docs/sdk/typescript/escrow/classes/EscrowClient.md +++ b/docs/sdk/typescript/escrow/classes/EscrowClient.md @@ -6,7 +6,7 @@ # Class: EscrowClient -Defined in: [escrow.ts:141](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L141) +Defined in: [escrow.ts:141](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L141) ## Introduction @@ -82,11 +82,11 @@ const escrowClient = await EscrowClient.build(provider); ## Constructors -### new EscrowClient() +### Constructor -> **new EscrowClient**(`runner`, `networkData`): [`EscrowClient`](EscrowClient.md) +> **new EscrowClient**(`runner`, `networkData`): `EscrowClient` -Defined in: [escrow.ts:150](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L150) +Defined in: [escrow.ts:150](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L150) **EscrowClient constructor** @@ -106,11 +106,11 @@ The network information required to connect to the Escrow contract #### Returns -[`EscrowClient`](EscrowClient.md) +`EscrowClient` #### Overrides -[`BaseEthersClient`](../../base/classes/BaseEthersClient.md).[`constructor`](../../base/classes/BaseEthersClient.md#constructors) +[`BaseEthersClient`](../../base/classes/BaseEthersClient.md).[`constructor`](../../base/classes/BaseEthersClient.md#constructor) ## Properties @@ -118,11 +118,11 @@ The network information required to connect to the Escrow contract > **networkData**: [`NetworkData`](../../types/type-aliases/NetworkData.md) -Defined in: [base.ts:12](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L12) +Defined in: [base.ts:12](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L12) #### Inherited from -[`BaseEthersClient`](../../base/classes/BaseEthersClient.md).[`networkData`](../../base/classes/BaseEthersClient.md#networkdata-1) +[`BaseEthersClient`](../../base/classes/BaseEthersClient.md).[`networkData`](../../base/classes/BaseEthersClient.md#networkdata) *** @@ -130,19 +130,19 @@ Defined in: [base.ts:12](https://github.com/humanprotocol/human-protocol/blob/1f > `protected` **runner**: `ContractRunner` -Defined in: [base.ts:11](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L11) +Defined in: [base.ts:11](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L11) #### Inherited from -[`BaseEthersClient`](../../base/classes/BaseEthersClient.md).[`runner`](../../base/classes/BaseEthersClient.md#runner-1) +[`BaseEthersClient`](../../base/classes/BaseEthersClient.md).[`runner`](../../base/classes/BaseEthersClient.md#runner) ## Methods ### addTrustedHandlers() -> **addTrustedHandlers**(`escrowAddress`, `trustedHandlers`, `txOptions`?): `Promise`\<`void`\> +> **addTrustedHandlers**(`escrowAddress`, `trustedHandlers`, `txOptions?`): `Promise`\<`void`\> -Defined in: [escrow.ts:778](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L778) +Defined in: [escrow.ts:786](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L786) This function adds an array of addresses to the trusted handlers list. @@ -195,9 +195,9 @@ await escrowClient.addTrustedHandlers('0x62dD51230A30401C455c8398d06F85e4EaB6309 ### bulkPayOut() -> **bulkPayOut**(`escrowAddress`, `recipients`, `amounts`, `finalResultsUrl`, `finalResultsHash`, `txId`, `forceComplete`, `txOptions`?): `Promise`\<`void`\> +> **bulkPayOut**(`escrowAddress`, `recipients`, `amounts`, `finalResultsUrl`, `finalResultsHash`, `txId`, `forceComplete`, `txOptions?`): `Promise`\<`void`\> -Defined in: [escrow.ts:611](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L611) +Defined in: [escrow.ts:619](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L619) This function pays out the amounts specified to the workers and sets the URL of the final results file. @@ -285,9 +285,9 @@ await escrowClient.bulkPayOut('0x62dD51230A30401C455c8398d06F85e4EaB6309f', reci ### cancel() -> **cancel**(`escrowAddress`, `txOptions`?): `Promise`\<[`EscrowCancel`](../../types/type-aliases/EscrowCancel.md)\> +> **cancel**(`escrowAddress`, `txOptions?`): `Promise`\<[`EscrowCancel`](../../types/type-aliases/EscrowCancel.md)\> -Defined in: [escrow.ts:692](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L692) +Defined in: [escrow.ts:700](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L700) This function cancels the specified escrow and sends the balance to the canceler. @@ -333,9 +333,9 @@ await escrowClient.cancel('0x62dD51230A30401C455c8398d06F85e4EaB6309f'); ### complete() -> **complete**(`escrowAddress`, `txOptions`?): `Promise`\<`void`\> +> **complete**(`escrowAddress`, `txOptions?`): `Promise`\<`void`\> -Defined in: [escrow.ts:550](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L550) +Defined in: [escrow.ts:558](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L558) This function sets the status of an escrow to completed. @@ -381,9 +381,9 @@ await escrowClient.complete('0x62dD51230A30401C455c8398d06F85e4EaB6309f'); ### createBulkPayoutTransaction() -> **createBulkPayoutTransaction**(`escrowAddress`, `recipients`, `amounts`, `finalResultsUrl`, `finalResultsHash`, `txId`, `forceComplete`, `txOptions`?): `Promise`\<[`TransactionLikeWithNonce`](../../types/type-aliases/TransactionLikeWithNonce.md)\> +> **createBulkPayoutTransaction**(`escrowAddress`, `recipients`, `amounts`, `finalResultsUrl`, `finalResultsHash`, `txId`, `forceComplete`, `txOptions?`): `Promise`\<[`TransactionLikeWithNonce`](../../types/type-aliases/TransactionLikeWithNonce.md)\> -Defined in: [escrow.ts:947](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L947) +Defined in: [escrow.ts:956](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L956) Creates a prepared transaction for bulk payout without immediately sending it. @@ -470,14 +470,15 @@ console.log('Raw transaction:', rawTransaction); const signedTransaction = await signer.signTransaction(rawTransaction); console.log('Tx hash:', ethers.keccak256(signedTransaction)); (await signer.sendTransaction(rawTransaction)).wait(); +``` *** ### createEscrow() -> **createEscrow**(`tokenAddress`, `trustedHandlers`, `jobRequesterId`, `txOptions`?): `Promise`\<`string`\> +> **createEscrow**(`tokenAddress`, `trustedHandlers`, `jobRequesterId`, `txOptions?`): `Promise`\<`string`\> -Defined in: [escrow.ts:230](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L230) +Defined in: [escrow.ts:230](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L230) This function creates an escrow contract that uses the token passed to pay oracle fees and reward workers. @@ -538,9 +539,9 @@ const escrowAddress = await escrowClient.createEscrow(tokenAddress, trustedHandl ### fund() -> **fund**(`escrowAddress`, `amount`, `txOptions`?): `Promise`\<`void`\> +> **fund**(`escrowAddress`, `amount`, `txOptions?`): `Promise`\<`void`\> -Defined in: [escrow.ts:421](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L421) +Defined in: [escrow.ts:421](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L421) This function adds funds of the chosen token to the escrow. @@ -593,7 +594,7 @@ await escrowClient.fund('0x62dD51230A30401C455c8398d06F85e4EaB6309f', amount); > **getBalance**(`escrowAddress`): `Promise`\<`bigint`\> -Defined in: [escrow.ts:1092](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1092) +Defined in: [escrow.ts:1101](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1101) This function returns the balance for a specified escrow address. @@ -631,7 +632,7 @@ const balance = await escrowClient.getBalance('0x62dD51230A30401C455c8398d06F85e > **getExchangeOracleAddress**(`escrowAddress`): `Promise`\<`string`\> -Defined in: [escrow.ts:1478](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1478) +Defined in: [escrow.ts:1487](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1487) This function returns the exchange oracle address for a given escrow. @@ -669,7 +670,7 @@ const oracleAddress = await escrowClient.getExchangeOracleAddress('0x62dD51230A3 > **getFactoryAddress**(`escrowAddress`): `Promise`\<`string`\> -Defined in: [escrow.ts:1516](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1516) +Defined in: [escrow.ts:1525](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1525) This function returns the escrow factory address for a given escrow. @@ -707,7 +708,7 @@ const factoryAddress = await escrowClient.getFactoryAddress('0x62dD51230A30401C4 > **getIntermediateResultsUrl**(`escrowAddress`): `Promise`\<`string`\> -Defined in: [escrow.ts:1250](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1250) +Defined in: [escrow.ts:1259](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1259) This function returns the intermediate results file URL. @@ -745,7 +746,7 @@ const intermediateResultsUrl = await escrowClient.getIntermediateResultsUrl('0x6 > **getJobLauncherAddress**(`escrowAddress`): `Promise`\<`string`\> -Defined in: [escrow.ts:1402](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1402) +Defined in: [escrow.ts:1411](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1411) This function returns the job launcher address for a given escrow. @@ -783,7 +784,7 @@ const jobLauncherAddress = await escrowClient.getJobLauncherAddress('0x62dD51230 > **getManifestHash**(`escrowAddress`): `Promise`\<`string`\> -Defined in: [escrow.ts:1136](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1136) +Defined in: [escrow.ts:1145](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1145) This function returns the manifest file hash. @@ -821,7 +822,7 @@ const manifestHash = await escrowClient.getManifestHash('0x62dD51230A30401C455c8 > **getManifestUrl**(`escrowAddress`): `Promise`\<`string`\> -Defined in: [escrow.ts:1174](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1174) +Defined in: [escrow.ts:1183](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1183) This function returns the manifest file URL. @@ -859,7 +860,7 @@ const manifestUrl = await escrowClient.getManifestUrl('0x62dD51230A30401C455c839 > **getRecordingOracleAddress**(`escrowAddress`): `Promise`\<`string`\> -Defined in: [escrow.ts:1364](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1364) +Defined in: [escrow.ts:1373](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1373) This function returns the recording oracle address for a given escrow. @@ -897,7 +898,7 @@ const oracleAddress = await escrowClient.getRecordingOracleAddress('0x62dD51230A > **getReputationOracleAddress**(`escrowAddress`): `Promise`\<`string`\> -Defined in: [escrow.ts:1440](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1440) +Defined in: [escrow.ts:1449](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1449) This function returns the reputation oracle address for a given escrow. @@ -935,7 +936,7 @@ const oracleAddress = await escrowClient.getReputationOracleAddress('0x62dD51230 > **getResultsUrl**(`escrowAddress`): `Promise`\<`string`\> -Defined in: [escrow.ts:1212](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1212) +Defined in: [escrow.ts:1221](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1221) This function returns the results file URL. @@ -973,7 +974,7 @@ const resultsUrl = await escrowClient.getResultsUrl('0x62dD51230A30401C455c8398d > **getStatus**(`escrowAddress`): `Promise`\<[`EscrowStatus`](../../types/enumerations/EscrowStatus.md)\> -Defined in: [escrow.ts:1326](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1326) +Defined in: [escrow.ts:1335](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1335) This function returns the current status of the escrow. @@ -1011,7 +1012,7 @@ const status = await escrowClient.getStatus('0x62dD51230A30401C455c8398d06F85e4E > **getTokenAddress**(`escrowAddress`): `Promise`\<`string`\> -Defined in: [escrow.ts:1288](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1288) +Defined in: [escrow.ts:1297](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1297) This function returns the token address used for funding the escrow. @@ -1047,9 +1048,9 @@ const tokenAddress = await escrowClient.getTokenAddress('0x62dD51230A30401C455c8 ### setup() -> **setup**(`escrowAddress`, `escrowConfig`, `txOptions`?): `Promise`\<`void`\> +> **setup**(`escrowAddress`, `escrowConfig`, `txOptions?`): `Promise`\<`void`\> -Defined in: [escrow.ts:311](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L311) +Defined in: [escrow.ts:311](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L311) This function sets up the parameters of the escrow. @@ -1112,11 +1113,11 @@ await escrowClient.setup(escrowAddress, escrowConfig); ### storeResults() -> **storeResults**(`escrowAddress`, `url`, `hash`, `txOptions`?): `Promise`\<`void`\> +> **storeResults**(`escrowAddress`, `url`, `hash`, `amount`, `txOptions?`): `Promise`\<`void`\> -Defined in: [escrow.ts:486](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L486) +Defined in: [escrow.ts:487](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L487) -This function stores the results URL and hash. +This function stores the results URL and hash, and reserves the specified amount of funds. #### Parameters @@ -1138,6 +1139,12 @@ Results file URL. Results file hash. +##### amount + +`bigint` + +Amount to reserve for payouts. + ##### txOptions? `Overrides` = `{}` @@ -1165,16 +1172,16 @@ const provider = new providers.JsonRpcProvider(rpcUrl); const signer = new Wallet(privateKey, provider); const escrowClient = await EscrowClient.build(signer); -await escrowClient.storeResults('0x62dD51230A30401C455c8398d06F85e4EaB6309f', 'http://localhost/results.json', 'b5dad76bf6772c0f07fd5e048f6e75a5f86ee079'); +await escrowClient.storeResults('0x62dD51230A30401C455c8398d06F85e4EaB6309f', 'http://localhost/results.json', 'b5dad76bf6772c0f07fd5e048f6e75a5f86ee079', 50n); ``` *** ### withdraw() -> **withdraw**(`escrowAddress`, `tokenAddress`, `txOptions`?): `Promise`\<[`EscrowWithdraw`](../../types/type-aliases/EscrowWithdraw.md)\> +> **withdraw**(`escrowAddress`, `tokenAddress`, `txOptions?`): `Promise`\<[`EscrowWithdraw`](../../types/type-aliases/EscrowWithdraw.md)\> -Defined in: [escrow.ts:844](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L844) +Defined in: [escrow.ts:852](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L852) This function withdraws additional tokens in the escrow to the canceler. @@ -1229,9 +1236,9 @@ await escrowClient.withdraw( ### build() -> `static` **build**(`runner`): `Promise`\<[`EscrowClient`](EscrowClient.md)\> +> `static` **build**(`runner`): `Promise`\<`EscrowClient`\> -Defined in: [escrow.ts:168](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L168) +Defined in: [escrow.ts:168](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L168) Creates an instance of EscrowClient from a Runner. @@ -1245,7 +1252,7 @@ The Runner object to interact with the Ethereum network #### Returns -`Promise`\<[`EscrowClient`](EscrowClient.md)\> +`Promise`\<`EscrowClient`\> An instance of EscrowClient diff --git a/docs/sdk/typescript/escrow/classes/EscrowUtils.md b/docs/sdk/typescript/escrow/classes/EscrowUtils.md index 7622cb9120..fb30eb0cce 100644 --- a/docs/sdk/typescript/escrow/classes/EscrowUtils.md +++ b/docs/sdk/typescript/escrow/classes/EscrowUtils.md @@ -6,7 +6,7 @@ # Class: EscrowUtils -Defined in: [escrow.ts:1565](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1565) +Defined in: [escrow.ts:1574](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1574) ## Introduction @@ -40,13 +40,13 @@ const escrowAddresses = new EscrowUtils.getEscrows({ ## Constructors -### new EscrowUtils() +### Constructor -> **new EscrowUtils**(): [`EscrowUtils`](EscrowUtils.md) +> **new EscrowUtils**(): `EscrowUtils` #### Returns -[`EscrowUtils`](EscrowUtils.md) +`EscrowUtils` ## Methods @@ -54,7 +54,7 @@ const escrowAddresses = new EscrowUtils.getEscrows({ > `static` **getEscrow**(`chainId`, `escrowAddress`): `Promise`\<[`EscrowData`](../../graphql/types/type-aliases/EscrowData.md)\> -Defined in: [escrow.ts:1780](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1780) +Defined in: [escrow.ts:1789](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1789) This function returns the escrow data for a given address. @@ -133,7 +133,7 @@ const escrowData = new EscrowUtils.getEscrow(ChainId.POLYGON_AMOY, "0x1234567890 > `static` **getEscrows**(`filter`): `Promise`\<[`EscrowData`](../../graphql/types/type-aliases/EscrowData.md)[]\> -Defined in: [escrow.ts:1662](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1662) +Defined in: [escrow.ts:1671](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1671) This function returns an array of escrows based on the specified filter parameters. @@ -245,7 +245,7 @@ const escrowDatas = await EscrowUtils.getEscrows(filters); > `static` **getPayouts**(`filter`): `Promise`\<[`Payout`](../../types/type-aliases/Payout.md)[]\> -Defined in: [escrow.ts:1950](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1950) +Defined in: [escrow.ts:1959](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1959) This function returns the payouts for a given set of networks. @@ -289,7 +289,7 @@ console.log(payouts); > `static` **getStatusEvents**(`filter`): `Promise`\<[`StatusEvent`](../../graphql/types/type-aliases/StatusEvent.md)[]\> -Defined in: [escrow.ts:1859](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1859) +Defined in: [escrow.ts:1868](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1868) This function returns the status events for a given set of networks within an optional date range. diff --git a/docs/sdk/typescript/graphql/types/type-aliases/DailyEscrowData.md b/docs/sdk/typescript/graphql/types/type-aliases/DailyEscrowData.md index d1338d66b5..099c5b5605 100644 --- a/docs/sdk/typescript/graphql/types/type-aliases/DailyEscrowData.md +++ b/docs/sdk/typescript/graphql/types/type-aliases/DailyEscrowData.md @@ -6,32 +6,54 @@ # Type Alias: DailyEscrowData -> **DailyEscrowData**: `object` +> **DailyEscrowData** = `object` -Defined in: [graphql/types.ts:83](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L83) +Defined in: [graphql/types.ts:83](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L83) -## Type declaration +## Properties ### escrowsCancelled > **escrowsCancelled**: `number` +Defined in: [graphql/types.ts:89](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L89) + +*** + ### escrowsPaid > **escrowsPaid**: `number` +Defined in: [graphql/types.ts:88](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L88) + +*** + ### escrowsPending > **escrowsPending**: `number` +Defined in: [graphql/types.ts:86](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L86) + +*** + ### escrowsSolved > **escrowsSolved**: `number` +Defined in: [graphql/types.ts:87](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L87) + +*** + ### escrowsTotal > **escrowsTotal**: `number` +Defined in: [graphql/types.ts:85](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L85) + +*** + ### timestamp > **timestamp**: `Date` + +Defined in: [graphql/types.ts:84](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L84) diff --git a/docs/sdk/typescript/graphql/types/type-aliases/DailyHMTData.md b/docs/sdk/typescript/graphql/types/type-aliases/DailyHMTData.md index 9244bdd1ec..d462fc66dd 100644 --- a/docs/sdk/typescript/graphql/types/type-aliases/DailyHMTData.md +++ b/docs/sdk/typescript/graphql/types/type-aliases/DailyHMTData.md @@ -6,28 +6,46 @@ # Type Alias: DailyHMTData -> **DailyHMTData**: `object` +> **DailyHMTData** = `object` -Defined in: [graphql/types.ts:127](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L127) +Defined in: [graphql/types.ts:127](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L127) -## Type declaration +## Properties ### dailyUniqueReceivers > **dailyUniqueReceivers**: `number` +Defined in: [graphql/types.ts:132](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L132) + +*** + ### dailyUniqueSenders > **dailyUniqueSenders**: `number` +Defined in: [graphql/types.ts:131](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L131) + +*** + ### timestamp > **timestamp**: `Date` +Defined in: [graphql/types.ts:128](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L128) + +*** + ### totalTransactionAmount > **totalTransactionAmount**: `bigint` +Defined in: [graphql/types.ts:129](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L129) + +*** + ### totalTransactionCount > **totalTransactionCount**: `number` + +Defined in: [graphql/types.ts:130](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L130) diff --git a/docs/sdk/typescript/graphql/types/type-aliases/DailyPaymentData.md b/docs/sdk/typescript/graphql/types/type-aliases/DailyPaymentData.md index 5407a1faf6..2e99abe95c 100644 --- a/docs/sdk/typescript/graphql/types/type-aliases/DailyPaymentData.md +++ b/docs/sdk/typescript/graphql/types/type-aliases/DailyPaymentData.md @@ -6,24 +6,38 @@ # Type Alias: DailyPaymentData -> **DailyPaymentData**: `object` +> **DailyPaymentData** = `object` -Defined in: [graphql/types.ts:106](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L106) +Defined in: [graphql/types.ts:106](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L106) -## Type declaration +## Properties ### averageAmountPerWorker > **averageAmountPerWorker**: `bigint` +Defined in: [graphql/types.ts:110](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L110) + +*** + ### timestamp > **timestamp**: `Date` +Defined in: [graphql/types.ts:107](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L107) + +*** + ### totalAmountPaid > **totalAmountPaid**: `bigint` +Defined in: [graphql/types.ts:108](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L108) + +*** + ### totalCount > **totalCount**: `number` + +Defined in: [graphql/types.ts:109](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L109) diff --git a/docs/sdk/typescript/graphql/types/type-aliases/DailyTaskData.md b/docs/sdk/typescript/graphql/types/type-aliases/DailyTaskData.md index 32d8aac1c6..5eedf9a297 100644 --- a/docs/sdk/typescript/graphql/types/type-aliases/DailyTaskData.md +++ b/docs/sdk/typescript/graphql/types/type-aliases/DailyTaskData.md @@ -6,20 +6,30 @@ # Type Alias: DailyTaskData -> **DailyTaskData**: `object` +> **DailyTaskData** = `object` -Defined in: [graphql/types.ts:148](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L148) +Defined in: [graphql/types.ts:148](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L148) -## Type declaration +## Properties ### tasksSolved > **tasksSolved**: `number` +Defined in: [graphql/types.ts:151](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L151) + +*** + ### tasksTotal > **tasksTotal**: `number` +Defined in: [graphql/types.ts:150](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L150) + +*** + ### timestamp > **timestamp**: `Date` + +Defined in: [graphql/types.ts:149](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L149) diff --git a/docs/sdk/typescript/graphql/types/type-aliases/DailyWorkerData.md b/docs/sdk/typescript/graphql/types/type-aliases/DailyWorkerData.md index decaf5e782..3f0de1eda1 100644 --- a/docs/sdk/typescript/graphql/types/type-aliases/DailyWorkerData.md +++ b/docs/sdk/typescript/graphql/types/type-aliases/DailyWorkerData.md @@ -6,16 +6,22 @@ # Type Alias: DailyWorkerData -> **DailyWorkerData**: `object` +> **DailyWorkerData** = `object` -Defined in: [graphql/types.ts:97](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L97) +Defined in: [graphql/types.ts:97](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L97) -## Type declaration +## Properties ### activeWorkers > **activeWorkers**: `number` +Defined in: [graphql/types.ts:99](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L99) + +*** + ### timestamp > **timestamp**: `Date` + +Defined in: [graphql/types.ts:98](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L98) diff --git a/docs/sdk/typescript/graphql/types/type-aliases/EscrowData.md b/docs/sdk/typescript/graphql/types/type-aliases/EscrowData.md index 1b73e121ee..4358f2f7aa 100644 --- a/docs/sdk/typescript/graphql/types/type-aliases/EscrowData.md +++ b/docs/sdk/typescript/graphql/types/type-aliases/EscrowData.md @@ -6,84 +6,158 @@ # Type Alias: EscrowData -> **EscrowData**: `object` +> **EscrowData** = `object` -Defined in: [graphql/types.ts:3](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L3) +Defined in: [graphql/types.ts:3](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L3) -## Type declaration +## Properties ### address > **address**: `string` +Defined in: [graphql/types.ts:5](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L5) + +*** + ### amountPaid > **amountPaid**: `string` +Defined in: [graphql/types.ts:6](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L6) + +*** + ### balance > **balance**: `string` +Defined in: [graphql/types.ts:7](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L7) + +*** + ### chainId > **chainId**: `number` +Defined in: [graphql/types.ts:22](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L22) + +*** + ### count > **count**: `string` +Defined in: [graphql/types.ts:8](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L8) + +*** + ### createdAt > **createdAt**: `string` +Defined in: [graphql/types.ts:21](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L21) + +*** + ### exchangeOracle? > `optional` **exchangeOracle**: `string` +Defined in: [graphql/types.ts:17](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L17) + +*** + ### factoryAddress > **factoryAddress**: `string` +Defined in: [graphql/types.ts:9](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L9) + +*** + ### finalResultsUrl? > `optional` **finalResultsUrl**: `string` +Defined in: [graphql/types.ts:10](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L10) + +*** + ### id > **id**: `string` +Defined in: [graphql/types.ts:4](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L4) + +*** + ### intermediateResultsUrl? > `optional` **intermediateResultsUrl**: `string` +Defined in: [graphql/types.ts:11](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L11) + +*** + ### launcher > **launcher**: `string` +Defined in: [graphql/types.ts:12](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L12) + +*** + ### manifestHash? > `optional` **manifestHash**: `string` +Defined in: [graphql/types.ts:13](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L13) + +*** + ### manifestUrl? > `optional` **manifestUrl**: `string` +Defined in: [graphql/types.ts:14](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L14) + +*** + ### recordingOracle? > `optional` **recordingOracle**: `string` +Defined in: [graphql/types.ts:15](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L15) + +*** + ### reputationOracle? > `optional` **reputationOracle**: `string` +Defined in: [graphql/types.ts:16](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L16) + +*** + ### status > **status**: `string` +Defined in: [graphql/types.ts:18](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L18) + +*** + ### token > **token**: `string` +Defined in: [graphql/types.ts:19](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L19) + +*** + ### totalFundedAmount > **totalFundedAmount**: `string` + +Defined in: [graphql/types.ts:20](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L20) diff --git a/docs/sdk/typescript/graphql/types/type-aliases/EscrowStatistics.md b/docs/sdk/typescript/graphql/types/type-aliases/EscrowStatistics.md index 6e6c5426c3..3e0f3279a2 100644 --- a/docs/sdk/typescript/graphql/types/type-aliases/EscrowStatistics.md +++ b/docs/sdk/typescript/graphql/types/type-aliases/EscrowStatistics.md @@ -6,16 +6,22 @@ # Type Alias: EscrowStatistics -> **EscrowStatistics**: `object` +> **EscrowStatistics** = `object` -Defined in: [graphql/types.ts:92](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L92) +Defined in: [graphql/types.ts:92](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L92) -## Type declaration +## Properties ### dailyEscrowsData > **dailyEscrowsData**: [`DailyEscrowData`](DailyEscrowData.md)[] +Defined in: [graphql/types.ts:94](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L94) + +*** + ### totalEscrows > **totalEscrows**: `number` + +Defined in: [graphql/types.ts:93](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L93) diff --git a/docs/sdk/typescript/graphql/types/type-aliases/EscrowStatisticsData.md b/docs/sdk/typescript/graphql/types/type-aliases/EscrowStatisticsData.md index d11549fd67..77affd2f7f 100644 --- a/docs/sdk/typescript/graphql/types/type-aliases/EscrowStatisticsData.md +++ b/docs/sdk/typescript/graphql/types/type-aliases/EscrowStatisticsData.md @@ -6,48 +6,86 @@ # Type Alias: EscrowStatisticsData -> **EscrowStatisticsData**: `object` +> **EscrowStatisticsData** = `object` -Defined in: [graphql/types.ts:42](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L42) +Defined in: [graphql/types.ts:42](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L42) -## Type declaration +## Properties ### bulkPayoutEventCount > **bulkPayoutEventCount**: `string` +Defined in: [graphql/types.ts:45](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L45) + +*** + ### cancelledStatusEventCount > **cancelledStatusEventCount**: `string` +Defined in: [graphql/types.ts:47](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L47) + +*** + ### completedStatusEventCount > **completedStatusEventCount**: `string` +Defined in: [graphql/types.ts:50](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L50) + +*** + ### fundEventCount > **fundEventCount**: `string` +Defined in: [graphql/types.ts:43](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L43) + +*** + ### paidStatusEventCount > **paidStatusEventCount**: `string` +Defined in: [graphql/types.ts:49](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L49) + +*** + ### partialStatusEventCount > **partialStatusEventCount**: `string` +Defined in: [graphql/types.ts:48](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L48) + +*** + ### pendingStatusEventCount > **pendingStatusEventCount**: `string` +Defined in: [graphql/types.ts:46](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L46) + +*** + ### storeResultsEventCount > **storeResultsEventCount**: `string` +Defined in: [graphql/types.ts:44](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L44) + +*** + ### totalEscrowCount > **totalEscrowCount**: `string` +Defined in: [graphql/types.ts:52](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L52) + +*** + ### totalEventCount > **totalEventCount**: `string` + +Defined in: [graphql/types.ts:51](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L51) diff --git a/docs/sdk/typescript/graphql/types/type-aliases/EventDayData.md b/docs/sdk/typescript/graphql/types/type-aliases/EventDayData.md index 1bdd057e5f..a0f435a431 100644 --- a/docs/sdk/typescript/graphql/types/type-aliases/EventDayData.md +++ b/docs/sdk/typescript/graphql/types/type-aliases/EventDayData.md @@ -6,80 +6,150 @@ # Type Alias: EventDayData -> **EventDayData**: `object` +> **EventDayData** = `object` -Defined in: [graphql/types.ts:55](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L55) +Defined in: [graphql/types.ts:55](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L55) -## Type declaration +## Properties ### dailyBulkPayoutEventCount > **dailyBulkPayoutEventCount**: `string` +Defined in: [graphql/types.ts:59](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L59) + +*** + ### dailyCancelledStatusEventCount > **dailyCancelledStatusEventCount**: `string` +Defined in: [graphql/types.ts:61](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L61) + +*** + ### dailyCompletedStatusEventCount > **dailyCompletedStatusEventCount**: `string` +Defined in: [graphql/types.ts:64](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L64) + +*** + ### dailyEscrowCount > **dailyEscrowCount**: `string` +Defined in: [graphql/types.ts:66](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L66) + +*** + ### dailyFundEventCount > **dailyFundEventCount**: `string` +Defined in: [graphql/types.ts:57](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L57) + +*** + ### dailyHMTTransferAmount > **dailyHMTTransferAmount**: `string` +Defined in: [graphql/types.ts:71](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L71) + +*** + ### dailyHMTTransferCount > **dailyHMTTransferCount**: `string` +Defined in: [graphql/types.ts:70](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L70) + +*** + ### dailyPaidStatusEventCount > **dailyPaidStatusEventCount**: `string` +Defined in: [graphql/types.ts:63](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L63) + +*** + ### dailyPartialStatusEventCount > **dailyPartialStatusEventCount**: `string` +Defined in: [graphql/types.ts:62](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L62) + +*** + ### dailyPayoutAmount > **dailyPayoutAmount**: `string` +Defined in: [graphql/types.ts:69](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L69) + +*** + ### dailyPayoutCount > **dailyPayoutCount**: `string` +Defined in: [graphql/types.ts:68](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L68) + +*** + ### dailyPendingStatusEventCount > **dailyPendingStatusEventCount**: `string` +Defined in: [graphql/types.ts:60](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L60) + +*** + ### dailyStoreResultsEventCount > **dailyStoreResultsEventCount**: `string` +Defined in: [graphql/types.ts:58](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L58) + +*** + ### dailyTotalEventCount > **dailyTotalEventCount**: `string` +Defined in: [graphql/types.ts:65](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L65) + +*** + ### dailyUniqueReceivers > **dailyUniqueReceivers**: `string` +Defined in: [graphql/types.ts:73](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L73) + +*** + ### dailyUniqueSenders > **dailyUniqueSenders**: `string` +Defined in: [graphql/types.ts:72](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L72) + +*** + ### dailyWorkerCount > **dailyWorkerCount**: `string` +Defined in: [graphql/types.ts:67](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L67) + +*** + ### timestamp > **timestamp**: `string` + +Defined in: [graphql/types.ts:56](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L56) diff --git a/docs/sdk/typescript/graphql/types/type-aliases/HMTHolder.md b/docs/sdk/typescript/graphql/types/type-aliases/HMTHolder.md index 3c2354fba4..37f218e868 100644 --- a/docs/sdk/typescript/graphql/types/type-aliases/HMTHolder.md +++ b/docs/sdk/typescript/graphql/types/type-aliases/HMTHolder.md @@ -6,16 +6,22 @@ # Type Alias: HMTHolder -> **HMTHolder**: `object` +> **HMTHolder** = `object` -Defined in: [graphql/types.ts:122](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L122) +Defined in: [graphql/types.ts:122](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L122) -## Type declaration +## Properties ### address > **address**: `string` +Defined in: [graphql/types.ts:123](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L123) + +*** + ### balance > **balance**: `bigint` + +Defined in: [graphql/types.ts:124](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L124) diff --git a/docs/sdk/typescript/graphql/types/type-aliases/HMTHolderData.md b/docs/sdk/typescript/graphql/types/type-aliases/HMTHolderData.md index 7a2407ca15..67077c7e25 100644 --- a/docs/sdk/typescript/graphql/types/type-aliases/HMTHolderData.md +++ b/docs/sdk/typescript/graphql/types/type-aliases/HMTHolderData.md @@ -6,16 +6,22 @@ # Type Alias: HMTHolderData -> **HMTHolderData**: `object` +> **HMTHolderData** = `object` -Defined in: [graphql/types.ts:117](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L117) +Defined in: [graphql/types.ts:117](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L117) -## Type declaration +## Properties ### address > **address**: `string` +Defined in: [graphql/types.ts:118](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L118) + +*** + ### balance > **balance**: `string` + +Defined in: [graphql/types.ts:119](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L119) diff --git a/docs/sdk/typescript/graphql/types/type-aliases/HMTStatistics.md b/docs/sdk/typescript/graphql/types/type-aliases/HMTStatistics.md index e8e3e7364e..5f3c55eb13 100644 --- a/docs/sdk/typescript/graphql/types/type-aliases/HMTStatistics.md +++ b/docs/sdk/typescript/graphql/types/type-aliases/HMTStatistics.md @@ -6,20 +6,30 @@ # Type Alias: HMTStatistics -> **HMTStatistics**: `object` +> **HMTStatistics** = `object` -Defined in: [graphql/types.ts:135](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L135) +Defined in: [graphql/types.ts:135](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L135) -## Type declaration +## Properties ### totalHolders > **totalHolders**: `number` +Defined in: [graphql/types.ts:138](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L138) + +*** + ### totalTransferAmount > **totalTransferAmount**: `bigint` +Defined in: [graphql/types.ts:136](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L136) + +*** + ### totalTransferCount > **totalTransferCount**: `number` + +Defined in: [graphql/types.ts:137](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L137) diff --git a/docs/sdk/typescript/graphql/types/type-aliases/HMTStatisticsData.md b/docs/sdk/typescript/graphql/types/type-aliases/HMTStatisticsData.md index d1401b9486..fecd65a138 100644 --- a/docs/sdk/typescript/graphql/types/type-aliases/HMTStatisticsData.md +++ b/docs/sdk/typescript/graphql/types/type-aliases/HMTStatisticsData.md @@ -6,32 +6,54 @@ # Type Alias: HMTStatisticsData -> **HMTStatisticsData**: `object` +> **HMTStatisticsData** = `object` -Defined in: [graphql/types.ts:33](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L33) +Defined in: [graphql/types.ts:33](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L33) -## Type declaration +## Properties ### holders > **holders**: `string` +Defined in: [graphql/types.ts:39](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L39) + +*** + ### totalApprovalEventCount > **totalApprovalEventCount**: `string` +Defined in: [graphql/types.ts:36](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L36) + +*** + ### totalBulkApprovalEventCount > **totalBulkApprovalEventCount**: `string` +Defined in: [graphql/types.ts:37](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L37) + +*** + ### totalBulkTransferEventCount > **totalBulkTransferEventCount**: `string` +Defined in: [graphql/types.ts:35](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L35) + +*** + ### totalTransferEventCount > **totalTransferEventCount**: `string` +Defined in: [graphql/types.ts:34](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L34) + +*** + ### totalValueTransfered > **totalValueTransfered**: `string` + +Defined in: [graphql/types.ts:38](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L38) diff --git a/docs/sdk/typescript/graphql/types/type-aliases/IMData.md b/docs/sdk/typescript/graphql/types/type-aliases/IMData.md index 9fe78a572b..f79755e20a 100644 --- a/docs/sdk/typescript/graphql/types/type-aliases/IMData.md +++ b/docs/sdk/typescript/graphql/types/type-aliases/IMData.md @@ -6,6 +6,6 @@ # Type Alias: IMData -> **IMData**: `Record`\<`string`, [`IMDataEntity`](IMDataEntity.md)\> +> **IMData** = `Record`\<`string`, [`IMDataEntity`](IMDataEntity.md)\> -Defined in: [graphql/types.ts:146](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L146) +Defined in: [graphql/types.ts:146](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L146) diff --git a/docs/sdk/typescript/graphql/types/type-aliases/IMDataEntity.md b/docs/sdk/typescript/graphql/types/type-aliases/IMDataEntity.md index 04813d3002..4e93407f15 100644 --- a/docs/sdk/typescript/graphql/types/type-aliases/IMDataEntity.md +++ b/docs/sdk/typescript/graphql/types/type-aliases/IMDataEntity.md @@ -6,16 +6,22 @@ # Type Alias: IMDataEntity -> **IMDataEntity**: `object` +> **IMDataEntity** = `object` -Defined in: [graphql/types.ts:141](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L141) +Defined in: [graphql/types.ts:141](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L141) -## Type declaration +## Properties ### served > **served**: `number` +Defined in: [graphql/types.ts:142](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L142) + +*** + ### solved > **solved**: `number` + +Defined in: [graphql/types.ts:143](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L143) diff --git a/docs/sdk/typescript/graphql/types/type-aliases/KVStoreData.md b/docs/sdk/typescript/graphql/types/type-aliases/KVStoreData.md index bf4a21515f..7f832cefbb 100644 --- a/docs/sdk/typescript/graphql/types/type-aliases/KVStoreData.md +++ b/docs/sdk/typescript/graphql/types/type-aliases/KVStoreData.md @@ -6,32 +6,54 @@ # Type Alias: KVStoreData -> **KVStoreData**: `object` +> **KVStoreData** = `object` -Defined in: [graphql/types.ts:165](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L165) +Defined in: [graphql/types.ts:165](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L165) -## Type declaration +## Properties ### address > **address**: `string` +Defined in: [graphql/types.ts:167](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L167) + +*** + ### block > **block**: `number` +Defined in: [graphql/types.ts:171](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L171) + +*** + ### id > **id**: `string` +Defined in: [graphql/types.ts:166](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L166) + +*** + ### key > **key**: `string` +Defined in: [graphql/types.ts:168](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L168) + +*** + ### timestamp > **timestamp**: `Date` +Defined in: [graphql/types.ts:170](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L170) + +*** + ### value > **value**: `string` + +Defined in: [graphql/types.ts:169](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L169) diff --git a/docs/sdk/typescript/graphql/types/type-aliases/PaymentStatistics.md b/docs/sdk/typescript/graphql/types/type-aliases/PaymentStatistics.md index 183cb8fc7b..5ed4862749 100644 --- a/docs/sdk/typescript/graphql/types/type-aliases/PaymentStatistics.md +++ b/docs/sdk/typescript/graphql/types/type-aliases/PaymentStatistics.md @@ -6,12 +6,14 @@ # Type Alias: PaymentStatistics -> **PaymentStatistics**: `object` +> **PaymentStatistics** = `object` -Defined in: [graphql/types.ts:113](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L113) +Defined in: [graphql/types.ts:113](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L113) -## Type declaration +## Properties ### dailyPaymentsData > **dailyPaymentsData**: [`DailyPaymentData`](DailyPaymentData.md)[] + +Defined in: [graphql/types.ts:114](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L114) diff --git a/docs/sdk/typescript/graphql/types/type-aliases/PayoutData.md b/docs/sdk/typescript/graphql/types/type-aliases/PayoutData.md index 411724cd7c..148fd0a477 100644 --- a/docs/sdk/typescript/graphql/types/type-aliases/PayoutData.md +++ b/docs/sdk/typescript/graphql/types/type-aliases/PayoutData.md @@ -6,28 +6,46 @@ # Type Alias: PayoutData -> **PayoutData**: `object` +> **PayoutData** = `object` -Defined in: [graphql/types.ts:25](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L25) +Defined in: [graphql/types.ts:25](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L25) -## Type declaration +## Properties ### amount > **amount**: `string` +Defined in: [graphql/types.ts:29](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L29) + +*** + ### createdAt > **createdAt**: `string` +Defined in: [graphql/types.ts:30](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L30) + +*** + ### escrowAddress > **escrowAddress**: `string` +Defined in: [graphql/types.ts:27](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L27) + +*** + ### id > **id**: `string` +Defined in: [graphql/types.ts:26](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L26) + +*** + ### recipient > **recipient**: `string` + +Defined in: [graphql/types.ts:28](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L28) diff --git a/docs/sdk/typescript/graphql/types/type-aliases/RewardAddedEventData.md b/docs/sdk/typescript/graphql/types/type-aliases/RewardAddedEventData.md index 1c754efa3c..81df5cdc2e 100644 --- a/docs/sdk/typescript/graphql/types/type-aliases/RewardAddedEventData.md +++ b/docs/sdk/typescript/graphql/types/type-aliases/RewardAddedEventData.md @@ -6,24 +6,38 @@ # Type Alias: RewardAddedEventData -> **RewardAddedEventData**: `object` +> **RewardAddedEventData** = `object` -Defined in: [graphql/types.ts:76](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L76) +Defined in: [graphql/types.ts:76](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L76) -## Type declaration +## Properties ### amount > **amount**: `string` +Defined in: [graphql/types.ts:80](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L80) + +*** + ### escrowAddress > **escrowAddress**: `string` +Defined in: [graphql/types.ts:77](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L77) + +*** + ### slasher > **slasher**: `string` +Defined in: [graphql/types.ts:79](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L79) + +*** + ### staker > **staker**: `string` + +Defined in: [graphql/types.ts:78](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L78) diff --git a/docs/sdk/typescript/graphql/types/type-aliases/StatusEvent.md b/docs/sdk/typescript/graphql/types/type-aliases/StatusEvent.md index 05c2380ae1..13e1fb1373 100644 --- a/docs/sdk/typescript/graphql/types/type-aliases/StatusEvent.md +++ b/docs/sdk/typescript/graphql/types/type-aliases/StatusEvent.md @@ -6,24 +6,38 @@ # Type Alias: StatusEvent -> **StatusEvent**: `object` +> **StatusEvent** = `object` -Defined in: [graphql/types.ts:158](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L158) +Defined in: [graphql/types.ts:158](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L158) -## Type declaration +## Properties ### chainId > **chainId**: [`ChainId`](../../../enums/enumerations/ChainId.md) +Defined in: [graphql/types.ts:162](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L162) + +*** + ### escrowAddress > **escrowAddress**: `string` +Defined in: [graphql/types.ts:160](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L160) + +*** + ### status > **status**: `string` +Defined in: [graphql/types.ts:161](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L161) + +*** + ### timestamp > **timestamp**: `number` + +Defined in: [graphql/types.ts:159](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L159) diff --git a/docs/sdk/typescript/graphql/types/type-aliases/TaskStatistics.md b/docs/sdk/typescript/graphql/types/type-aliases/TaskStatistics.md index 1e57acbfdd..c120294344 100644 --- a/docs/sdk/typescript/graphql/types/type-aliases/TaskStatistics.md +++ b/docs/sdk/typescript/graphql/types/type-aliases/TaskStatistics.md @@ -6,12 +6,14 @@ # Type Alias: TaskStatistics -> **TaskStatistics**: `object` +> **TaskStatistics** = `object` -Defined in: [graphql/types.ts:154](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L154) +Defined in: [graphql/types.ts:154](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L154) -## Type declaration +## Properties ### dailyTasksData > **dailyTasksData**: [`DailyTaskData`](DailyTaskData.md)[] + +Defined in: [graphql/types.ts:155](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L155) diff --git a/docs/sdk/typescript/graphql/types/type-aliases/WorkerStatistics.md b/docs/sdk/typescript/graphql/types/type-aliases/WorkerStatistics.md index 60ffd457ee..821fcbaa45 100644 --- a/docs/sdk/typescript/graphql/types/type-aliases/WorkerStatistics.md +++ b/docs/sdk/typescript/graphql/types/type-aliases/WorkerStatistics.md @@ -6,12 +6,14 @@ # Type Alias: WorkerStatistics -> **WorkerStatistics**: `object` +> **WorkerStatistics** = `object` -Defined in: [graphql/types.ts:102](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L102) +Defined in: [graphql/types.ts:102](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L102) -## Type declaration +## Properties ### dailyWorkersData > **dailyWorkersData**: [`DailyWorkerData`](DailyWorkerData.md)[] + +Defined in: [graphql/types.ts:103](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L103) diff --git a/docs/sdk/typescript/interfaces/interfaces/IEscrowConfig.md b/docs/sdk/typescript/interfaces/interfaces/IEscrowConfig.md index 0683a22619..a5243170eb 100644 --- a/docs/sdk/typescript/interfaces/interfaces/IEscrowConfig.md +++ b/docs/sdk/typescript/interfaces/interfaces/IEscrowConfig.md @@ -6,7 +6,7 @@ # Interface: IEscrowConfig -Defined in: [interfaces.ts:79](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L79) +Defined in: [interfaces.ts:79](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L79) ## Properties @@ -14,7 +14,7 @@ Defined in: [interfaces.ts:79](https://github.com/humanprotocol/human-protocol/b > **exchangeOracle**: `string` -Defined in: [interfaces.ts:82](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L82) +Defined in: [interfaces.ts:82](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L82) *** @@ -22,7 +22,7 @@ Defined in: [interfaces.ts:82](https://github.com/humanprotocol/human-protocol/b > **exchangeOracleFee**: `bigint` -Defined in: [interfaces.ts:85](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L85) +Defined in: [interfaces.ts:85](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L85) *** @@ -30,7 +30,7 @@ Defined in: [interfaces.ts:85](https://github.com/humanprotocol/human-protocol/b > **manifestHash**: `string` -Defined in: [interfaces.ts:87](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L87) +Defined in: [interfaces.ts:87](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L87) *** @@ -38,7 +38,7 @@ Defined in: [interfaces.ts:87](https://github.com/humanprotocol/human-protocol/b > **manifestUrl**: `string` -Defined in: [interfaces.ts:86](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L86) +Defined in: [interfaces.ts:86](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L86) *** @@ -46,7 +46,7 @@ Defined in: [interfaces.ts:86](https://github.com/humanprotocol/human-protocol/b > **recordingOracle**: `string` -Defined in: [interfaces.ts:80](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L80) +Defined in: [interfaces.ts:80](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L80) *** @@ -54,7 +54,7 @@ Defined in: [interfaces.ts:80](https://github.com/humanprotocol/human-protocol/b > **recordingOracleFee**: `bigint` -Defined in: [interfaces.ts:83](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L83) +Defined in: [interfaces.ts:83](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L83) *** @@ -62,7 +62,7 @@ Defined in: [interfaces.ts:83](https://github.com/humanprotocol/human-protocol/b > **reputationOracle**: `string` -Defined in: [interfaces.ts:81](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L81) +Defined in: [interfaces.ts:81](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L81) *** @@ -70,4 +70,4 @@ Defined in: [interfaces.ts:81](https://github.com/humanprotocol/human-protocol/b > **reputationOracleFee**: `bigint` -Defined in: [interfaces.ts:84](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L84) +Defined in: [interfaces.ts:84](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L84) diff --git a/docs/sdk/typescript/interfaces/interfaces/IEscrowsFilter.md b/docs/sdk/typescript/interfaces/interfaces/IEscrowsFilter.md index add8356780..754568e1b8 100644 --- a/docs/sdk/typescript/interfaces/interfaces/IEscrowsFilter.md +++ b/docs/sdk/typescript/interfaces/interfaces/IEscrowsFilter.md @@ -6,7 +6,7 @@ # Interface: IEscrowsFilter -Defined in: [interfaces.ts:67](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L67) +Defined in: [interfaces.ts:67](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L67) ## Extends @@ -18,7 +18,7 @@ Defined in: [interfaces.ts:67](https://github.com/humanprotocol/human-protocol/b > **chainId**: [`ChainId`](../../enums/enumerations/ChainId.md) -Defined in: [interfaces.ts:76](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L76) +Defined in: [interfaces.ts:76](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L76) *** @@ -26,7 +26,7 @@ Defined in: [interfaces.ts:76](https://github.com/humanprotocol/human-protocol/b > `optional` **exchangeOracle**: `string` -Defined in: [interfaces.ts:71](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L71) +Defined in: [interfaces.ts:71](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L71) *** @@ -34,7 +34,7 @@ Defined in: [interfaces.ts:71](https://github.com/humanprotocol/human-protocol/b > `optional` **first**: `number` -Defined in: [interfaces.ts:154](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L154) +Defined in: [interfaces.ts:154](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L154) #### Inherited from @@ -46,7 +46,7 @@ Defined in: [interfaces.ts:154](https://github.com/humanprotocol/human-protocol/ > `optional` **from**: `Date` -Defined in: [interfaces.ts:74](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L74) +Defined in: [interfaces.ts:74](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L74) *** @@ -54,7 +54,7 @@ Defined in: [interfaces.ts:74](https://github.com/humanprotocol/human-protocol/b > `optional` **jobRequesterId**: `string` -Defined in: [interfaces.ts:72](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L72) +Defined in: [interfaces.ts:72](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L72) *** @@ -62,7 +62,7 @@ Defined in: [interfaces.ts:72](https://github.com/humanprotocol/human-protocol/b > `optional` **launcher**: `string` -Defined in: [interfaces.ts:68](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L68) +Defined in: [interfaces.ts:68](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L68) *** @@ -70,7 +70,7 @@ Defined in: [interfaces.ts:68](https://github.com/humanprotocol/human-protocol/b > `optional` **orderDirection**: [`OrderDirection`](../../enums/enumerations/OrderDirection.md) -Defined in: [interfaces.ts:156](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L156) +Defined in: [interfaces.ts:156](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L156) #### Inherited from @@ -82,7 +82,7 @@ Defined in: [interfaces.ts:156](https://github.com/humanprotocol/human-protocol/ > `optional` **recordingOracle**: `string` -Defined in: [interfaces.ts:70](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L70) +Defined in: [interfaces.ts:70](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L70) *** @@ -90,7 +90,7 @@ Defined in: [interfaces.ts:70](https://github.com/humanprotocol/human-protocol/b > `optional` **reputationOracle**: `string` -Defined in: [interfaces.ts:69](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L69) +Defined in: [interfaces.ts:69](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L69) *** @@ -98,7 +98,7 @@ Defined in: [interfaces.ts:69](https://github.com/humanprotocol/human-protocol/b > `optional` **skip**: `number` -Defined in: [interfaces.ts:155](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L155) +Defined in: [interfaces.ts:155](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L155) #### Inherited from @@ -110,7 +110,7 @@ Defined in: [interfaces.ts:155](https://github.com/humanprotocol/human-protocol/ > `optional` **status**: [`EscrowStatus`](../../types/enumerations/EscrowStatus.md) -Defined in: [interfaces.ts:73](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L73) +Defined in: [interfaces.ts:73](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L73) *** @@ -118,4 +118,4 @@ Defined in: [interfaces.ts:73](https://github.com/humanprotocol/human-protocol/b > `optional` **to**: `Date` -Defined in: [interfaces.ts:75](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L75) +Defined in: [interfaces.ts:75](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L75) diff --git a/docs/sdk/typescript/interfaces/interfaces/IHMTHoldersParams.md b/docs/sdk/typescript/interfaces/interfaces/IHMTHoldersParams.md index 20e651e721..4f813323e5 100644 --- a/docs/sdk/typescript/interfaces/interfaces/IHMTHoldersParams.md +++ b/docs/sdk/typescript/interfaces/interfaces/IHMTHoldersParams.md @@ -6,7 +6,7 @@ # Interface: IHMTHoldersParams -Defined in: [interfaces.ts:102](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L102) +Defined in: [interfaces.ts:102](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L102) ## Extends @@ -18,7 +18,7 @@ Defined in: [interfaces.ts:102](https://github.com/humanprotocol/human-protocol/ > `optional` **address**: `string` -Defined in: [interfaces.ts:103](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L103) +Defined in: [interfaces.ts:103](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L103) *** @@ -26,7 +26,7 @@ Defined in: [interfaces.ts:103](https://github.com/humanprotocol/human-protocol/ > `optional` **first**: `number` -Defined in: [interfaces.ts:154](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L154) +Defined in: [interfaces.ts:154](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L154) #### Inherited from @@ -38,7 +38,7 @@ Defined in: [interfaces.ts:154](https://github.com/humanprotocol/human-protocol/ > `optional` **orderDirection**: [`OrderDirection`](../../enums/enumerations/OrderDirection.md) -Defined in: [interfaces.ts:156](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L156) +Defined in: [interfaces.ts:156](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L156) #### Inherited from @@ -50,7 +50,7 @@ Defined in: [interfaces.ts:156](https://github.com/humanprotocol/human-protocol/ > `optional` **skip**: `number` -Defined in: [interfaces.ts:155](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L155) +Defined in: [interfaces.ts:155](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L155) #### Inherited from diff --git a/docs/sdk/typescript/interfaces/interfaces/IKVStore.md b/docs/sdk/typescript/interfaces/interfaces/IKVStore.md index d7afd90199..30b68f3065 100644 --- a/docs/sdk/typescript/interfaces/interfaces/IKVStore.md +++ b/docs/sdk/typescript/interfaces/interfaces/IKVStore.md @@ -6,7 +6,7 @@ # Interface: IKVStore -Defined in: [interfaces.ts:114](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L114) +Defined in: [interfaces.ts:114](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L114) ## Properties @@ -14,7 +14,7 @@ Defined in: [interfaces.ts:114](https://github.com/humanprotocol/human-protocol/ > **key**: `string` -Defined in: [interfaces.ts:115](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L115) +Defined in: [interfaces.ts:115](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L115) *** @@ -22,4 +22,4 @@ Defined in: [interfaces.ts:115](https://github.com/humanprotocol/human-protocol/ > **value**: `string` -Defined in: [interfaces.ts:116](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L116) +Defined in: [interfaces.ts:116](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L116) diff --git a/docs/sdk/typescript/interfaces/interfaces/IKeyPair.md b/docs/sdk/typescript/interfaces/interfaces/IKeyPair.md index 66e2c69336..98af225641 100644 --- a/docs/sdk/typescript/interfaces/interfaces/IKeyPair.md +++ b/docs/sdk/typescript/interfaces/interfaces/IKeyPair.md @@ -6,7 +6,7 @@ # Interface: IKeyPair -Defined in: [interfaces.ts:90](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L90) +Defined in: [interfaces.ts:90](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L90) ## Properties @@ -14,7 +14,7 @@ Defined in: [interfaces.ts:90](https://github.com/humanprotocol/human-protocol/b > **passphrase**: `string` -Defined in: [interfaces.ts:93](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L93) +Defined in: [interfaces.ts:93](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L93) *** @@ -22,7 +22,7 @@ Defined in: [interfaces.ts:93](https://github.com/humanprotocol/human-protocol/b > **privateKey**: `string` -Defined in: [interfaces.ts:91](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L91) +Defined in: [interfaces.ts:91](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L91) *** @@ -30,7 +30,7 @@ Defined in: [interfaces.ts:91](https://github.com/humanprotocol/human-protocol/b > **publicKey**: `string` -Defined in: [interfaces.ts:92](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L92) +Defined in: [interfaces.ts:92](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L92) *** @@ -38,4 +38,4 @@ Defined in: [interfaces.ts:92](https://github.com/humanprotocol/human-protocol/b > `optional` **revocationCertificate**: `string` -Defined in: [interfaces.ts:94](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L94) +Defined in: [interfaces.ts:94](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L94) diff --git a/docs/sdk/typescript/interfaces/interfaces/IOperator.md b/docs/sdk/typescript/interfaces/interfaces/IOperator.md index 79945ef14c..6e67162629 100644 --- a/docs/sdk/typescript/interfaces/interfaces/IOperator.md +++ b/docs/sdk/typescript/interfaces/interfaces/IOperator.md @@ -6,7 +6,7 @@ # Interface: IOperator -Defined in: [interfaces.ts:9](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L9) +Defined in: [interfaces.ts:9](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L9) ## Properties @@ -14,7 +14,7 @@ Defined in: [interfaces.ts:9](https://github.com/humanprotocol/human-protocol/bl > **address**: `string` -Defined in: [interfaces.ts:12](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L12) +Defined in: [interfaces.ts:12](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L12) *** @@ -22,7 +22,7 @@ Defined in: [interfaces.ts:12](https://github.com/humanprotocol/human-protocol/b > **amountJobsProcessed**: `bigint` -Defined in: [interfaces.ts:19](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L19) +Defined in: [interfaces.ts:19](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L19) *** @@ -30,7 +30,7 @@ Defined in: [interfaces.ts:19](https://github.com/humanprotocol/human-protocol/b > **amountLocked**: `bigint` -Defined in: [interfaces.ts:14](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L14) +Defined in: [interfaces.ts:14](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L14) *** @@ -38,7 +38,7 @@ Defined in: [interfaces.ts:14](https://github.com/humanprotocol/human-protocol/b > **amountSlashed**: `bigint` -Defined in: [interfaces.ts:17](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L17) +Defined in: [interfaces.ts:17](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L17) *** @@ -46,7 +46,7 @@ Defined in: [interfaces.ts:17](https://github.com/humanprotocol/human-protocol/b > **amountStaked**: `bigint` -Defined in: [interfaces.ts:13](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L13) +Defined in: [interfaces.ts:13](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L13) *** @@ -54,7 +54,7 @@ Defined in: [interfaces.ts:13](https://github.com/humanprotocol/human-protocol/b > **amountWithdrawn**: `bigint` -Defined in: [interfaces.ts:16](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L16) +Defined in: [interfaces.ts:16](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L16) *** @@ -62,7 +62,7 @@ Defined in: [interfaces.ts:16](https://github.com/humanprotocol/human-protocol/b > `optional` **category**: `string` -Defined in: [interfaces.ts:31](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L31) +Defined in: [interfaces.ts:31](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L31) *** @@ -70,7 +70,7 @@ Defined in: [interfaces.ts:31](https://github.com/humanprotocol/human-protocol/b > **chainId**: [`ChainId`](../../enums/enumerations/ChainId.md) -Defined in: [interfaces.ts:11](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L11) +Defined in: [interfaces.ts:11](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L11) *** @@ -78,7 +78,7 @@ Defined in: [interfaces.ts:11](https://github.com/humanprotocol/human-protocol/b > `optional` **fee**: `bigint` -Defined in: [interfaces.ts:21](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L21) +Defined in: [interfaces.ts:21](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L21) *** @@ -86,7 +86,7 @@ Defined in: [interfaces.ts:21](https://github.com/humanprotocol/human-protocol/b > **id**: `string` -Defined in: [interfaces.ts:10](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L10) +Defined in: [interfaces.ts:10](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L10) *** @@ -94,7 +94,7 @@ Defined in: [interfaces.ts:10](https://github.com/humanprotocol/human-protocol/b > `optional` **jobTypes**: `string`[] -Defined in: [interfaces.ts:26](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L26) +Defined in: [interfaces.ts:26](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L26) *** @@ -102,7 +102,7 @@ Defined in: [interfaces.ts:26](https://github.com/humanprotocol/human-protocol/b > **lockedUntilTimestamp**: `bigint` -Defined in: [interfaces.ts:15](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L15) +Defined in: [interfaces.ts:15](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L15) *** @@ -110,7 +110,7 @@ Defined in: [interfaces.ts:15](https://github.com/humanprotocol/human-protocol/b > `optional` **name**: `string` -Defined in: [interfaces.ts:30](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L30) +Defined in: [interfaces.ts:30](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L30) *** @@ -118,7 +118,7 @@ Defined in: [interfaces.ts:30](https://github.com/humanprotocol/human-protocol/b > `optional` **publicKey**: `string` -Defined in: [interfaces.ts:22](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L22) +Defined in: [interfaces.ts:22](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L22) *** @@ -126,7 +126,7 @@ Defined in: [interfaces.ts:22](https://github.com/humanprotocol/human-protocol/b > `optional` **registrationInstructions**: `string` -Defined in: [interfaces.ts:28](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L28) +Defined in: [interfaces.ts:28](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L28) *** @@ -134,7 +134,7 @@ Defined in: [interfaces.ts:28](https://github.com/humanprotocol/human-protocol/b > `optional` **registrationNeeded**: `boolean` -Defined in: [interfaces.ts:27](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L27) +Defined in: [interfaces.ts:27](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L27) *** @@ -142,7 +142,7 @@ Defined in: [interfaces.ts:27](https://github.com/humanprotocol/human-protocol/b > `optional` **reputationNetworks**: `string`[] -Defined in: [interfaces.ts:29](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L29) +Defined in: [interfaces.ts:29](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L29) *** @@ -150,7 +150,7 @@ Defined in: [interfaces.ts:29](https://github.com/humanprotocol/human-protocol/b > **reward**: `bigint` -Defined in: [interfaces.ts:18](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L18) +Defined in: [interfaces.ts:18](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L18) *** @@ -158,7 +158,7 @@ Defined in: [interfaces.ts:18](https://github.com/humanprotocol/human-protocol/b > `optional` **role**: `string` -Defined in: [interfaces.ts:20](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L20) +Defined in: [interfaces.ts:20](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L20) *** @@ -166,7 +166,7 @@ Defined in: [interfaces.ts:20](https://github.com/humanprotocol/human-protocol/b > `optional` **url**: `string` -Defined in: [interfaces.ts:25](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L25) +Defined in: [interfaces.ts:25](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L25) *** @@ -174,7 +174,7 @@ Defined in: [interfaces.ts:25](https://github.com/humanprotocol/human-protocol/b > `optional` **webhookUrl**: `string` -Defined in: [interfaces.ts:23](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L23) +Defined in: [interfaces.ts:23](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L23) *** @@ -182,4 +182,4 @@ Defined in: [interfaces.ts:23](https://github.com/humanprotocol/human-protocol/b > `optional` **website**: `string` -Defined in: [interfaces.ts:24](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L24) +Defined in: [interfaces.ts:24](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L24) diff --git a/docs/sdk/typescript/interfaces/interfaces/IOperatorSubgraph.md b/docs/sdk/typescript/interfaces/interfaces/IOperatorSubgraph.md index b27a089c01..d180322141 100644 --- a/docs/sdk/typescript/interfaces/interfaces/IOperatorSubgraph.md +++ b/docs/sdk/typescript/interfaces/interfaces/IOperatorSubgraph.md @@ -6,7 +6,7 @@ # Interface: IOperatorSubgraph -Defined in: [interfaces.ts:34](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L34) +Defined in: [interfaces.ts:34](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L34) ## Extends @@ -18,7 +18,7 @@ Defined in: [interfaces.ts:34](https://github.com/humanprotocol/human-protocol/b > **address**: `string` -Defined in: [interfaces.ts:12](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L12) +Defined in: [interfaces.ts:12](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L12) #### Inherited from @@ -30,7 +30,7 @@ Defined in: [interfaces.ts:12](https://github.com/humanprotocol/human-protocol/b > **amountJobsProcessed**: `bigint` -Defined in: [interfaces.ts:19](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L19) +Defined in: [interfaces.ts:19](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L19) #### Inherited from @@ -42,7 +42,7 @@ Defined in: [interfaces.ts:19](https://github.com/humanprotocol/human-protocol/b > **amountLocked**: `bigint` -Defined in: [interfaces.ts:14](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L14) +Defined in: [interfaces.ts:14](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L14) #### Inherited from @@ -54,7 +54,7 @@ Defined in: [interfaces.ts:14](https://github.com/humanprotocol/human-protocol/b > **amountSlashed**: `bigint` -Defined in: [interfaces.ts:17](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L17) +Defined in: [interfaces.ts:17](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L17) #### Inherited from @@ -66,7 +66,7 @@ Defined in: [interfaces.ts:17](https://github.com/humanprotocol/human-protocol/b > **amountStaked**: `bigint` -Defined in: [interfaces.ts:13](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L13) +Defined in: [interfaces.ts:13](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L13) #### Inherited from @@ -78,7 +78,7 @@ Defined in: [interfaces.ts:13](https://github.com/humanprotocol/human-protocol/b > **amountWithdrawn**: `bigint` -Defined in: [interfaces.ts:16](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L16) +Defined in: [interfaces.ts:16](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L16) #### Inherited from @@ -90,7 +90,7 @@ Defined in: [interfaces.ts:16](https://github.com/humanprotocol/human-protocol/b > `optional` **category**: `string` -Defined in: [interfaces.ts:31](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L31) +Defined in: [interfaces.ts:31](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L31) #### Inherited from @@ -102,7 +102,7 @@ Defined in: [interfaces.ts:31](https://github.com/humanprotocol/human-protocol/b > `optional` **fee**: `bigint` -Defined in: [interfaces.ts:21](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L21) +Defined in: [interfaces.ts:21](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L21) #### Inherited from @@ -114,7 +114,7 @@ Defined in: [interfaces.ts:21](https://github.com/humanprotocol/human-protocol/b > **id**: `string` -Defined in: [interfaces.ts:10](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L10) +Defined in: [interfaces.ts:10](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L10) #### Inherited from @@ -126,7 +126,7 @@ Defined in: [interfaces.ts:10](https://github.com/humanprotocol/human-protocol/b > `optional` **jobTypes**: `string` -Defined in: [interfaces.ts:36](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L36) +Defined in: [interfaces.ts:36](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L36) *** @@ -134,7 +134,7 @@ Defined in: [interfaces.ts:36](https://github.com/humanprotocol/human-protocol/b > **lockedUntilTimestamp**: `bigint` -Defined in: [interfaces.ts:15](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L15) +Defined in: [interfaces.ts:15](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L15) #### Inherited from @@ -146,7 +146,7 @@ Defined in: [interfaces.ts:15](https://github.com/humanprotocol/human-protocol/b > `optional` **name**: `string` -Defined in: [interfaces.ts:30](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L30) +Defined in: [interfaces.ts:30](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L30) #### Inherited from @@ -158,7 +158,7 @@ Defined in: [interfaces.ts:30](https://github.com/humanprotocol/human-protocol/b > `optional` **publicKey**: `string` -Defined in: [interfaces.ts:22](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L22) +Defined in: [interfaces.ts:22](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L22) #### Inherited from @@ -170,7 +170,7 @@ Defined in: [interfaces.ts:22](https://github.com/humanprotocol/human-protocol/b > `optional` **registrationInstructions**: `string` -Defined in: [interfaces.ts:28](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L28) +Defined in: [interfaces.ts:28](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L28) #### Inherited from @@ -182,7 +182,7 @@ Defined in: [interfaces.ts:28](https://github.com/humanprotocol/human-protocol/b > `optional` **registrationNeeded**: `boolean` -Defined in: [interfaces.ts:27](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L27) +Defined in: [interfaces.ts:27](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L27) #### Inherited from @@ -194,7 +194,7 @@ Defined in: [interfaces.ts:27](https://github.com/humanprotocol/human-protocol/b > `optional` **reputationNetworks**: `object`[] -Defined in: [interfaces.ts:37](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L37) +Defined in: [interfaces.ts:37](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L37) #### address @@ -206,7 +206,7 @@ Defined in: [interfaces.ts:37](https://github.com/humanprotocol/human-protocol/b > **reward**: `bigint` -Defined in: [interfaces.ts:18](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L18) +Defined in: [interfaces.ts:18](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L18) #### Inherited from @@ -218,7 +218,7 @@ Defined in: [interfaces.ts:18](https://github.com/humanprotocol/human-protocol/b > `optional` **role**: `string` -Defined in: [interfaces.ts:20](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L20) +Defined in: [interfaces.ts:20](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L20) #### Inherited from @@ -230,7 +230,7 @@ Defined in: [interfaces.ts:20](https://github.com/humanprotocol/human-protocol/b > `optional` **url**: `string` -Defined in: [interfaces.ts:25](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L25) +Defined in: [interfaces.ts:25](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L25) #### Inherited from @@ -242,7 +242,7 @@ Defined in: [interfaces.ts:25](https://github.com/humanprotocol/human-protocol/b > `optional` **webhookUrl**: `string` -Defined in: [interfaces.ts:23](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L23) +Defined in: [interfaces.ts:23](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L23) #### Inherited from @@ -254,7 +254,7 @@ Defined in: [interfaces.ts:23](https://github.com/humanprotocol/human-protocol/b > `optional` **website**: `string` -Defined in: [interfaces.ts:24](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L24) +Defined in: [interfaces.ts:24](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L24) #### Inherited from diff --git a/docs/sdk/typescript/interfaces/interfaces/IOperatorsFilter.md b/docs/sdk/typescript/interfaces/interfaces/IOperatorsFilter.md index 90e83d1034..98b9d8427e 100644 --- a/docs/sdk/typescript/interfaces/interfaces/IOperatorsFilter.md +++ b/docs/sdk/typescript/interfaces/interfaces/IOperatorsFilter.md @@ -6,7 +6,7 @@ # Interface: IOperatorsFilter -Defined in: [interfaces.ts:40](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L40) +Defined in: [interfaces.ts:40](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L40) ## Extends @@ -18,7 +18,7 @@ Defined in: [interfaces.ts:40](https://github.com/humanprotocol/human-protocol/b > **chainId**: [`ChainId`](../../enums/enumerations/ChainId.md) -Defined in: [interfaces.ts:41](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L41) +Defined in: [interfaces.ts:41](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L41) *** @@ -26,7 +26,7 @@ Defined in: [interfaces.ts:41](https://github.com/humanprotocol/human-protocol/b > `optional` **first**: `number` -Defined in: [interfaces.ts:154](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L154) +Defined in: [interfaces.ts:154](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L154) #### Inherited from @@ -38,7 +38,7 @@ Defined in: [interfaces.ts:154](https://github.com/humanprotocol/human-protocol/ > `optional` **minAmountStaked**: `number` -Defined in: [interfaces.ts:43](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L43) +Defined in: [interfaces.ts:43](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L43) *** @@ -46,7 +46,7 @@ Defined in: [interfaces.ts:43](https://github.com/humanprotocol/human-protocol/b > `optional` **orderBy**: `string` -Defined in: [interfaces.ts:44](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L44) +Defined in: [interfaces.ts:44](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L44) *** @@ -54,7 +54,7 @@ Defined in: [interfaces.ts:44](https://github.com/humanprotocol/human-protocol/b > `optional` **orderDirection**: [`OrderDirection`](../../enums/enumerations/OrderDirection.md) -Defined in: [interfaces.ts:156](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L156) +Defined in: [interfaces.ts:156](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L156) #### Inherited from @@ -66,7 +66,7 @@ Defined in: [interfaces.ts:156](https://github.com/humanprotocol/human-protocol/ > `optional` **roles**: `string`[] -Defined in: [interfaces.ts:42](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L42) +Defined in: [interfaces.ts:42](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L42) *** @@ -74,7 +74,7 @@ Defined in: [interfaces.ts:42](https://github.com/humanprotocol/human-protocol/b > `optional` **skip**: `number` -Defined in: [interfaces.ts:155](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L155) +Defined in: [interfaces.ts:155](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L155) #### Inherited from diff --git a/docs/sdk/typescript/interfaces/interfaces/IPagination.md b/docs/sdk/typescript/interfaces/interfaces/IPagination.md index 18e9db9eb6..843b82ccf0 100644 --- a/docs/sdk/typescript/interfaces/interfaces/IPagination.md +++ b/docs/sdk/typescript/interfaces/interfaces/IPagination.md @@ -6,7 +6,7 @@ # Interface: IPagination -Defined in: [interfaces.ts:153](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L153) +Defined in: [interfaces.ts:153](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L153) ## Extended by @@ -25,7 +25,7 @@ Defined in: [interfaces.ts:153](https://github.com/humanprotocol/human-protocol/ > `optional` **first**: `number` -Defined in: [interfaces.ts:154](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L154) +Defined in: [interfaces.ts:154](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L154) *** @@ -33,7 +33,7 @@ Defined in: [interfaces.ts:154](https://github.com/humanprotocol/human-protocol/ > `optional` **orderDirection**: [`OrderDirection`](../../enums/enumerations/OrderDirection.md) -Defined in: [interfaces.ts:156](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L156) +Defined in: [interfaces.ts:156](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L156) *** @@ -41,4 +41,4 @@ Defined in: [interfaces.ts:156](https://github.com/humanprotocol/human-protocol/ > `optional` **skip**: `number` -Defined in: [interfaces.ts:155](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L155) +Defined in: [interfaces.ts:155](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L155) diff --git a/docs/sdk/typescript/interfaces/interfaces/IPayoutFilter.md b/docs/sdk/typescript/interfaces/interfaces/IPayoutFilter.md index d324186adb..f26f8ce479 100644 --- a/docs/sdk/typescript/interfaces/interfaces/IPayoutFilter.md +++ b/docs/sdk/typescript/interfaces/interfaces/IPayoutFilter.md @@ -6,7 +6,7 @@ # Interface: IPayoutFilter -Defined in: [interfaces.ts:106](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L106) +Defined in: [interfaces.ts:106](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L106) ## Extends @@ -18,7 +18,7 @@ Defined in: [interfaces.ts:106](https://github.com/humanprotocol/human-protocol/ > **chainId**: [`ChainId`](../../enums/enumerations/ChainId.md) -Defined in: [interfaces.ts:107](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L107) +Defined in: [interfaces.ts:107](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L107) *** @@ -26,7 +26,7 @@ Defined in: [interfaces.ts:107](https://github.com/humanprotocol/human-protocol/ > `optional` **escrowAddress**: `string` -Defined in: [interfaces.ts:108](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L108) +Defined in: [interfaces.ts:108](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L108) *** @@ -34,7 +34,7 @@ Defined in: [interfaces.ts:108](https://github.com/humanprotocol/human-protocol/ > `optional` **first**: `number` -Defined in: [interfaces.ts:154](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L154) +Defined in: [interfaces.ts:154](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L154) #### Inherited from @@ -46,7 +46,7 @@ Defined in: [interfaces.ts:154](https://github.com/humanprotocol/human-protocol/ > `optional` **from**: `Date` -Defined in: [interfaces.ts:110](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L110) +Defined in: [interfaces.ts:110](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L110) *** @@ -54,7 +54,7 @@ Defined in: [interfaces.ts:110](https://github.com/humanprotocol/human-protocol/ > `optional` **orderDirection**: [`OrderDirection`](../../enums/enumerations/OrderDirection.md) -Defined in: [interfaces.ts:156](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L156) +Defined in: [interfaces.ts:156](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L156) #### Inherited from @@ -66,7 +66,7 @@ Defined in: [interfaces.ts:156](https://github.com/humanprotocol/human-protocol/ > `optional` **recipient**: `string` -Defined in: [interfaces.ts:109](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L109) +Defined in: [interfaces.ts:109](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L109) *** @@ -74,7 +74,7 @@ Defined in: [interfaces.ts:109](https://github.com/humanprotocol/human-protocol/ > `optional` **skip**: `number` -Defined in: [interfaces.ts:155](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L155) +Defined in: [interfaces.ts:155](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L155) #### Inherited from @@ -86,4 +86,4 @@ Defined in: [interfaces.ts:155](https://github.com/humanprotocol/human-protocol/ > `optional` **to**: `Date` -Defined in: [interfaces.ts:111](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L111) +Defined in: [interfaces.ts:111](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L111) diff --git a/docs/sdk/typescript/interfaces/interfaces/IReputationNetwork.md b/docs/sdk/typescript/interfaces/interfaces/IReputationNetwork.md index a78f347469..43e0ad39b9 100644 --- a/docs/sdk/typescript/interfaces/interfaces/IReputationNetwork.md +++ b/docs/sdk/typescript/interfaces/interfaces/IReputationNetwork.md @@ -6,7 +6,7 @@ # Interface: IReputationNetwork -Defined in: [interfaces.ts:47](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L47) +Defined in: [interfaces.ts:47](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L47) ## Properties @@ -14,7 +14,7 @@ Defined in: [interfaces.ts:47](https://github.com/humanprotocol/human-protocol/b > **address**: `string` -Defined in: [interfaces.ts:49](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L49) +Defined in: [interfaces.ts:49](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L49) *** @@ -22,7 +22,7 @@ Defined in: [interfaces.ts:49](https://github.com/humanprotocol/human-protocol/b > **id**: `string` -Defined in: [interfaces.ts:48](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L48) +Defined in: [interfaces.ts:48](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L48) *** @@ -30,4 +30,4 @@ Defined in: [interfaces.ts:48](https://github.com/humanprotocol/human-protocol/b > **operators**: [`IOperator`](IOperator.md)[] -Defined in: [interfaces.ts:50](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L50) +Defined in: [interfaces.ts:50](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L50) diff --git a/docs/sdk/typescript/interfaces/interfaces/IReputationNetworkSubgraph.md b/docs/sdk/typescript/interfaces/interfaces/IReputationNetworkSubgraph.md index 79bb41371a..f95d053e34 100644 --- a/docs/sdk/typescript/interfaces/interfaces/IReputationNetworkSubgraph.md +++ b/docs/sdk/typescript/interfaces/interfaces/IReputationNetworkSubgraph.md @@ -6,7 +6,7 @@ # Interface: IReputationNetworkSubgraph -Defined in: [interfaces.ts:53](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L53) +Defined in: [interfaces.ts:53](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L53) ## Extends @@ -18,7 +18,7 @@ Defined in: [interfaces.ts:53](https://github.com/humanprotocol/human-protocol/b > **address**: `string` -Defined in: [interfaces.ts:49](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L49) +Defined in: [interfaces.ts:49](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L49) #### Inherited from @@ -30,7 +30,7 @@ Defined in: [interfaces.ts:49](https://github.com/humanprotocol/human-protocol/b > **id**: `string` -Defined in: [interfaces.ts:48](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L48) +Defined in: [interfaces.ts:48](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L48) #### Inherited from @@ -42,4 +42,4 @@ Defined in: [interfaces.ts:48](https://github.com/humanprotocol/human-protocol/b > **operators**: [`IOperatorSubgraph`](IOperatorSubgraph.md)[] -Defined in: [interfaces.ts:55](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L55) +Defined in: [interfaces.ts:55](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L55) diff --git a/docs/sdk/typescript/interfaces/interfaces/IReward.md b/docs/sdk/typescript/interfaces/interfaces/IReward.md index dbf06c2f1f..c1d7f4c389 100644 --- a/docs/sdk/typescript/interfaces/interfaces/IReward.md +++ b/docs/sdk/typescript/interfaces/interfaces/IReward.md @@ -6,7 +6,7 @@ # Interface: IReward -Defined in: [interfaces.ts:4](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L4) +Defined in: [interfaces.ts:4](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L4) ## Properties @@ -14,7 +14,7 @@ Defined in: [interfaces.ts:4](https://github.com/humanprotocol/human-protocol/bl > **amount**: `bigint` -Defined in: [interfaces.ts:6](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L6) +Defined in: [interfaces.ts:6](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L6) *** @@ -22,4 +22,4 @@ Defined in: [interfaces.ts:6](https://github.com/humanprotocol/human-protocol/bl > **escrowAddress**: `string` -Defined in: [interfaces.ts:5](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L5) +Defined in: [interfaces.ts:5](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L5) diff --git a/docs/sdk/typescript/interfaces/interfaces/IStatisticsFilter.md b/docs/sdk/typescript/interfaces/interfaces/IStatisticsFilter.md index 85c8c655a6..e739d9cf7a 100644 --- a/docs/sdk/typescript/interfaces/interfaces/IStatisticsFilter.md +++ b/docs/sdk/typescript/interfaces/interfaces/IStatisticsFilter.md @@ -6,7 +6,7 @@ # Interface: IStatisticsFilter -Defined in: [interfaces.ts:97](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L97) +Defined in: [interfaces.ts:97](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L97) ## Extends @@ -18,7 +18,7 @@ Defined in: [interfaces.ts:97](https://github.com/humanprotocol/human-protocol/b > `optional` **first**: `number` -Defined in: [interfaces.ts:154](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L154) +Defined in: [interfaces.ts:154](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L154) #### Inherited from @@ -30,7 +30,7 @@ Defined in: [interfaces.ts:154](https://github.com/humanprotocol/human-protocol/ > `optional` **from**: `Date` -Defined in: [interfaces.ts:98](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L98) +Defined in: [interfaces.ts:98](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L98) *** @@ -38,7 +38,7 @@ Defined in: [interfaces.ts:98](https://github.com/humanprotocol/human-protocol/b > `optional` **orderDirection**: [`OrderDirection`](../../enums/enumerations/OrderDirection.md) -Defined in: [interfaces.ts:156](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L156) +Defined in: [interfaces.ts:156](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L156) #### Inherited from @@ -50,7 +50,7 @@ Defined in: [interfaces.ts:156](https://github.com/humanprotocol/human-protocol/ > `optional` **skip**: `number` -Defined in: [interfaces.ts:155](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L155) +Defined in: [interfaces.ts:155](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L155) #### Inherited from @@ -62,4 +62,4 @@ Defined in: [interfaces.ts:155](https://github.com/humanprotocol/human-protocol/ > `optional` **to**: `Date` -Defined in: [interfaces.ts:99](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L99) +Defined in: [interfaces.ts:99](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L99) diff --git a/docs/sdk/typescript/interfaces/interfaces/IStatusEventFilter.md b/docs/sdk/typescript/interfaces/interfaces/IStatusEventFilter.md index d57093ca0d..2587378724 100644 --- a/docs/sdk/typescript/interfaces/interfaces/IStatusEventFilter.md +++ b/docs/sdk/typescript/interfaces/interfaces/IStatusEventFilter.md @@ -6,7 +6,7 @@ # Interface: IStatusEventFilter -Defined in: [interfaces.ts:166](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L166) +Defined in: [interfaces.ts:166](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L166) ## Extends @@ -18,7 +18,7 @@ Defined in: [interfaces.ts:166](https://github.com/humanprotocol/human-protocol/ > **chainId**: [`ChainId`](../../enums/enumerations/ChainId.md) -Defined in: [interfaces.ts:167](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L167) +Defined in: [interfaces.ts:167](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L167) *** @@ -26,7 +26,7 @@ Defined in: [interfaces.ts:167](https://github.com/humanprotocol/human-protocol/ > `optional` **first**: `number` -Defined in: [interfaces.ts:154](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L154) +Defined in: [interfaces.ts:154](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L154) #### Inherited from @@ -38,7 +38,7 @@ Defined in: [interfaces.ts:154](https://github.com/humanprotocol/human-protocol/ > `optional` **from**: `Date` -Defined in: [interfaces.ts:169](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L169) +Defined in: [interfaces.ts:169](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L169) *** @@ -46,7 +46,7 @@ Defined in: [interfaces.ts:169](https://github.com/humanprotocol/human-protocol/ > `optional` **launcher**: `string` -Defined in: [interfaces.ts:171](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L171) +Defined in: [interfaces.ts:171](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L171) *** @@ -54,7 +54,7 @@ Defined in: [interfaces.ts:171](https://github.com/humanprotocol/human-protocol/ > `optional` **orderDirection**: [`OrderDirection`](../../enums/enumerations/OrderDirection.md) -Defined in: [interfaces.ts:156](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L156) +Defined in: [interfaces.ts:156](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L156) #### Inherited from @@ -66,7 +66,7 @@ Defined in: [interfaces.ts:156](https://github.com/humanprotocol/human-protocol/ > `optional` **skip**: `number` -Defined in: [interfaces.ts:155](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L155) +Defined in: [interfaces.ts:155](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L155) #### Inherited from @@ -78,7 +78,7 @@ Defined in: [interfaces.ts:155](https://github.com/humanprotocol/human-protocol/ > `optional` **statuses**: [`EscrowStatus`](../../types/enumerations/EscrowStatus.md)[] -Defined in: [interfaces.ts:168](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L168) +Defined in: [interfaces.ts:168](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L168) *** @@ -86,4 +86,4 @@ Defined in: [interfaces.ts:168](https://github.com/humanprotocol/human-protocol/ > `optional` **to**: `Date` -Defined in: [interfaces.ts:170](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L170) +Defined in: [interfaces.ts:170](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L170) diff --git a/docs/sdk/typescript/interfaces/interfaces/ITransaction.md b/docs/sdk/typescript/interfaces/interfaces/ITransaction.md index b3408ebfb9..9c3b4136e2 100644 --- a/docs/sdk/typescript/interfaces/interfaces/ITransaction.md +++ b/docs/sdk/typescript/interfaces/interfaces/ITransaction.md @@ -6,7 +6,7 @@ # Interface: ITransaction -Defined in: [interfaces.ts:129](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L129) +Defined in: [interfaces.ts:129](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L129) ## Properties @@ -14,7 +14,7 @@ Defined in: [interfaces.ts:129](https://github.com/humanprotocol/human-protocol/ > **block**: `bigint` -Defined in: [interfaces.ts:130](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L130) +Defined in: [interfaces.ts:130](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L130) *** @@ -22,7 +22,7 @@ Defined in: [interfaces.ts:130](https://github.com/humanprotocol/human-protocol/ > `optional` **escrow**: `string` -Defined in: [interfaces.ts:138](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L138) +Defined in: [interfaces.ts:138](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L138) *** @@ -30,7 +30,7 @@ Defined in: [interfaces.ts:138](https://github.com/humanprotocol/human-protocol/ > **from**: `string` -Defined in: [interfaces.ts:132](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L132) +Defined in: [interfaces.ts:132](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L132) *** @@ -38,7 +38,7 @@ Defined in: [interfaces.ts:132](https://github.com/humanprotocol/human-protocol/ > **internalTransactions**: [`InternalTransaction`](InternalTransaction.md)[] -Defined in: [interfaces.ts:140](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L140) +Defined in: [interfaces.ts:140](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L140) *** @@ -46,7 +46,7 @@ Defined in: [interfaces.ts:140](https://github.com/humanprotocol/human-protocol/ > **method**: `string` -Defined in: [interfaces.ts:136](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L136) +Defined in: [interfaces.ts:136](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L136) *** @@ -54,7 +54,7 @@ Defined in: [interfaces.ts:136](https://github.com/humanprotocol/human-protocol/ > `optional` **receiver**: `string` -Defined in: [interfaces.ts:137](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L137) +Defined in: [interfaces.ts:137](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L137) *** @@ -62,7 +62,7 @@ Defined in: [interfaces.ts:137](https://github.com/humanprotocol/human-protocol/ > **timestamp**: `bigint` -Defined in: [interfaces.ts:134](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L134) +Defined in: [interfaces.ts:134](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L134) *** @@ -70,7 +70,7 @@ Defined in: [interfaces.ts:134](https://github.com/humanprotocol/human-protocol/ > **to**: `string` -Defined in: [interfaces.ts:133](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L133) +Defined in: [interfaces.ts:133](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L133) *** @@ -78,7 +78,7 @@ Defined in: [interfaces.ts:133](https://github.com/humanprotocol/human-protocol/ > `optional` **token**: `string` -Defined in: [interfaces.ts:139](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L139) +Defined in: [interfaces.ts:139](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L139) *** @@ -86,7 +86,7 @@ Defined in: [interfaces.ts:139](https://github.com/humanprotocol/human-protocol/ > **txHash**: `string` -Defined in: [interfaces.ts:131](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L131) +Defined in: [interfaces.ts:131](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L131) *** @@ -94,4 +94,4 @@ Defined in: [interfaces.ts:131](https://github.com/humanprotocol/human-protocol/ > **value**: `string` -Defined in: [interfaces.ts:135](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L135) +Defined in: [interfaces.ts:135](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L135) diff --git a/docs/sdk/typescript/interfaces/interfaces/ITransactionsFilter.md b/docs/sdk/typescript/interfaces/interfaces/ITransactionsFilter.md index 3fa146d5b4..1addac5318 100644 --- a/docs/sdk/typescript/interfaces/interfaces/ITransactionsFilter.md +++ b/docs/sdk/typescript/interfaces/interfaces/ITransactionsFilter.md @@ -6,7 +6,7 @@ # Interface: ITransactionsFilter -Defined in: [interfaces.ts:143](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L143) +Defined in: [interfaces.ts:143](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L143) ## Extends @@ -18,7 +18,7 @@ Defined in: [interfaces.ts:143](https://github.com/humanprotocol/human-protocol/ > **chainId**: [`ChainId`](../../enums/enumerations/ChainId.md) -Defined in: [interfaces.ts:144](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L144) +Defined in: [interfaces.ts:144](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L144) *** @@ -26,7 +26,7 @@ Defined in: [interfaces.ts:144](https://github.com/humanprotocol/human-protocol/ > `optional` **endBlock**: `number` -Defined in: [interfaces.ts:146](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L146) +Defined in: [interfaces.ts:146](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L146) *** @@ -34,7 +34,7 @@ Defined in: [interfaces.ts:146](https://github.com/humanprotocol/human-protocol/ > `optional` **endDate**: `Date` -Defined in: [interfaces.ts:148](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L148) +Defined in: [interfaces.ts:148](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L148) *** @@ -42,7 +42,7 @@ Defined in: [interfaces.ts:148](https://github.com/humanprotocol/human-protocol/ > `optional` **first**: `number` -Defined in: [interfaces.ts:154](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L154) +Defined in: [interfaces.ts:154](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L154) #### Inherited from @@ -54,7 +54,7 @@ Defined in: [interfaces.ts:154](https://github.com/humanprotocol/human-protocol/ > `optional` **fromAddress**: `string` -Defined in: [interfaces.ts:149](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L149) +Defined in: [interfaces.ts:149](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L149) *** @@ -62,7 +62,7 @@ Defined in: [interfaces.ts:149](https://github.com/humanprotocol/human-protocol/ > `optional` **orderDirection**: [`OrderDirection`](../../enums/enumerations/OrderDirection.md) -Defined in: [interfaces.ts:156](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L156) +Defined in: [interfaces.ts:156](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L156) #### Inherited from @@ -74,7 +74,7 @@ Defined in: [interfaces.ts:156](https://github.com/humanprotocol/human-protocol/ > `optional` **skip**: `number` -Defined in: [interfaces.ts:155](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L155) +Defined in: [interfaces.ts:155](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L155) #### Inherited from @@ -86,7 +86,7 @@ Defined in: [interfaces.ts:155](https://github.com/humanprotocol/human-protocol/ > `optional` **startBlock**: `number` -Defined in: [interfaces.ts:145](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L145) +Defined in: [interfaces.ts:145](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L145) *** @@ -94,7 +94,7 @@ Defined in: [interfaces.ts:145](https://github.com/humanprotocol/human-protocol/ > `optional` **startDate**: `Date` -Defined in: [interfaces.ts:147](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L147) +Defined in: [interfaces.ts:147](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L147) *** @@ -102,4 +102,4 @@ Defined in: [interfaces.ts:147](https://github.com/humanprotocol/human-protocol/ > `optional` **toAddress**: `string` -Defined in: [interfaces.ts:150](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L150) +Defined in: [interfaces.ts:150](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L150) diff --git a/docs/sdk/typescript/interfaces/interfaces/IWorker.md b/docs/sdk/typescript/interfaces/interfaces/IWorker.md index 11a8fa9ba5..ed50cb944c 100644 --- a/docs/sdk/typescript/interfaces/interfaces/IWorker.md +++ b/docs/sdk/typescript/interfaces/interfaces/IWorker.md @@ -6,7 +6,7 @@ # Interface: IWorker -Defined in: [interfaces.ts:174](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L174) +Defined in: [interfaces.ts:174](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L174) ## Properties @@ -14,7 +14,7 @@ Defined in: [interfaces.ts:174](https://github.com/humanprotocol/human-protocol/ > **address**: `string` -Defined in: [interfaces.ts:176](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L176) +Defined in: [interfaces.ts:176](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L176) *** @@ -22,7 +22,7 @@ Defined in: [interfaces.ts:176](https://github.com/humanprotocol/human-protocol/ > **id**: `string` -Defined in: [interfaces.ts:175](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L175) +Defined in: [interfaces.ts:175](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L175) *** @@ -30,7 +30,7 @@ Defined in: [interfaces.ts:175](https://github.com/humanprotocol/human-protocol/ > **payoutCount**: `number` -Defined in: [interfaces.ts:178](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L178) +Defined in: [interfaces.ts:178](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L178) *** @@ -38,4 +38,4 @@ Defined in: [interfaces.ts:178](https://github.com/humanprotocol/human-protocol/ > **totalAmountReceived**: `number` -Defined in: [interfaces.ts:177](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L177) +Defined in: [interfaces.ts:177](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L177) diff --git a/docs/sdk/typescript/interfaces/interfaces/IWorkersFilter.md b/docs/sdk/typescript/interfaces/interfaces/IWorkersFilter.md index 14a31aaf66..1dac603e1e 100644 --- a/docs/sdk/typescript/interfaces/interfaces/IWorkersFilter.md +++ b/docs/sdk/typescript/interfaces/interfaces/IWorkersFilter.md @@ -6,7 +6,7 @@ # Interface: IWorkersFilter -Defined in: [interfaces.ts:181](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L181) +Defined in: [interfaces.ts:181](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L181) ## Extends @@ -18,7 +18,7 @@ Defined in: [interfaces.ts:181](https://github.com/humanprotocol/human-protocol/ > `optional` **address**: `string` -Defined in: [interfaces.ts:183](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L183) +Defined in: [interfaces.ts:183](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L183) *** @@ -26,7 +26,7 @@ Defined in: [interfaces.ts:183](https://github.com/humanprotocol/human-protocol/ > **chainId**: [`ChainId`](../../enums/enumerations/ChainId.md) -Defined in: [interfaces.ts:182](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L182) +Defined in: [interfaces.ts:182](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L182) *** @@ -34,7 +34,7 @@ Defined in: [interfaces.ts:182](https://github.com/humanprotocol/human-protocol/ > `optional` **first**: `number` -Defined in: [interfaces.ts:154](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L154) +Defined in: [interfaces.ts:154](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L154) #### Inherited from @@ -46,7 +46,7 @@ Defined in: [interfaces.ts:154](https://github.com/humanprotocol/human-protocol/ > `optional` **orderBy**: `string` -Defined in: [interfaces.ts:184](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L184) +Defined in: [interfaces.ts:184](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L184) *** @@ -54,7 +54,7 @@ Defined in: [interfaces.ts:184](https://github.com/humanprotocol/human-protocol/ > `optional` **orderDirection**: [`OrderDirection`](../../enums/enumerations/OrderDirection.md) -Defined in: [interfaces.ts:156](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L156) +Defined in: [interfaces.ts:156](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L156) #### Inherited from @@ -66,7 +66,7 @@ Defined in: [interfaces.ts:156](https://github.com/humanprotocol/human-protocol/ > `optional` **skip**: `number` -Defined in: [interfaces.ts:155](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L155) +Defined in: [interfaces.ts:155](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L155) #### Inherited from diff --git a/docs/sdk/typescript/interfaces/interfaces/InternalTransaction.md b/docs/sdk/typescript/interfaces/interfaces/InternalTransaction.md index 8775833e43..d124889cd6 100644 --- a/docs/sdk/typescript/interfaces/interfaces/InternalTransaction.md +++ b/docs/sdk/typescript/interfaces/interfaces/InternalTransaction.md @@ -6,7 +6,7 @@ # Interface: InternalTransaction -Defined in: [interfaces.ts:119](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L119) +Defined in: [interfaces.ts:119](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L119) ## Properties @@ -14,7 +14,7 @@ Defined in: [interfaces.ts:119](https://github.com/humanprotocol/human-protocol/ > `optional` **escrow**: `string` -Defined in: [interfaces.ts:125](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L125) +Defined in: [interfaces.ts:125](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L125) *** @@ -22,7 +22,7 @@ Defined in: [interfaces.ts:125](https://github.com/humanprotocol/human-protocol/ > **from**: `string` -Defined in: [interfaces.ts:120](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L120) +Defined in: [interfaces.ts:120](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L120) *** @@ -30,7 +30,7 @@ Defined in: [interfaces.ts:120](https://github.com/humanprotocol/human-protocol/ > **method**: `string` -Defined in: [interfaces.ts:123](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L123) +Defined in: [interfaces.ts:123](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L123) *** @@ -38,7 +38,7 @@ Defined in: [interfaces.ts:123](https://github.com/humanprotocol/human-protocol/ > `optional` **receiver**: `string` -Defined in: [interfaces.ts:124](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L124) +Defined in: [interfaces.ts:124](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L124) *** @@ -46,7 +46,7 @@ Defined in: [interfaces.ts:124](https://github.com/humanprotocol/human-protocol/ > **to**: `string` -Defined in: [interfaces.ts:121](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L121) +Defined in: [interfaces.ts:121](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L121) *** @@ -54,7 +54,7 @@ Defined in: [interfaces.ts:121](https://github.com/humanprotocol/human-protocol/ > `optional` **token**: `string` -Defined in: [interfaces.ts:126](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L126) +Defined in: [interfaces.ts:126](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L126) *** @@ -62,4 +62,4 @@ Defined in: [interfaces.ts:126](https://github.com/humanprotocol/human-protocol/ > **value**: `string` -Defined in: [interfaces.ts:122](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L122) +Defined in: [interfaces.ts:122](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L122) diff --git a/docs/sdk/typescript/interfaces/interfaces/StakerInfo.md b/docs/sdk/typescript/interfaces/interfaces/StakerInfo.md index e0fd825cf4..fc9133e109 100644 --- a/docs/sdk/typescript/interfaces/interfaces/StakerInfo.md +++ b/docs/sdk/typescript/interfaces/interfaces/StakerInfo.md @@ -6,7 +6,7 @@ # Interface: StakerInfo -Defined in: [interfaces.ts:159](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L159) +Defined in: [interfaces.ts:159](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L159) ## Properties @@ -14,7 +14,7 @@ Defined in: [interfaces.ts:159](https://github.com/humanprotocol/human-protocol/ > **lockedAmount**: `bigint` -Defined in: [interfaces.ts:161](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L161) +Defined in: [interfaces.ts:161](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L161) *** @@ -22,7 +22,7 @@ Defined in: [interfaces.ts:161](https://github.com/humanprotocol/human-protocol/ > **lockedUntil**: `bigint` -Defined in: [interfaces.ts:162](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L162) +Defined in: [interfaces.ts:162](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L162) *** @@ -30,7 +30,7 @@ Defined in: [interfaces.ts:162](https://github.com/humanprotocol/human-protocol/ > **stakedAmount**: `bigint` -Defined in: [interfaces.ts:160](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L160) +Defined in: [interfaces.ts:160](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L160) *** @@ -38,4 +38,4 @@ Defined in: [interfaces.ts:160](https://github.com/humanprotocol/human-protocol/ > **withdrawableAmount**: `bigint` -Defined in: [interfaces.ts:163](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L163) +Defined in: [interfaces.ts:163](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L163) diff --git a/docs/sdk/typescript/kvstore/classes/KVStoreClient.md b/docs/sdk/typescript/kvstore/classes/KVStoreClient.md index 5e7a7d8eef..d2771766e0 100644 --- a/docs/sdk/typescript/kvstore/classes/KVStoreClient.md +++ b/docs/sdk/typescript/kvstore/classes/KVStoreClient.md @@ -6,7 +6,7 @@ # Class: KVStoreClient -Defined in: [kvstore.ts:99](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/kvstore.ts#L99) +Defined in: [kvstore.ts:99](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/kvstore.ts#L99) ## Introduction @@ -82,11 +82,11 @@ const kvstoreClient = await KVStoreClient.build(provider); ## Constructors -### new KVStoreClient() +### Constructor -> **new KVStoreClient**(`runner`, `networkData`): [`KVStoreClient`](KVStoreClient.md) +> **new KVStoreClient**(`runner`, `networkData`): `KVStoreClient` -Defined in: [kvstore.ts:108](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/kvstore.ts#L108) +Defined in: [kvstore.ts:108](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/kvstore.ts#L108) **KVStoreClient constructor** @@ -106,11 +106,11 @@ The network information required to connect to the KVStore contract #### Returns -[`KVStoreClient`](KVStoreClient.md) +`KVStoreClient` #### Overrides -[`BaseEthersClient`](../../base/classes/BaseEthersClient.md).[`constructor`](../../base/classes/BaseEthersClient.md#constructors) +[`BaseEthersClient`](../../base/classes/BaseEthersClient.md).[`constructor`](../../base/classes/BaseEthersClient.md#constructor) ## Properties @@ -118,11 +118,11 @@ The network information required to connect to the KVStore contract > **networkData**: [`NetworkData`](../../types/type-aliases/NetworkData.md) -Defined in: [base.ts:12](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L12) +Defined in: [base.ts:12](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L12) #### Inherited from -[`BaseEthersClient`](../../base/classes/BaseEthersClient.md).[`networkData`](../../base/classes/BaseEthersClient.md#networkdata-1) +[`BaseEthersClient`](../../base/classes/BaseEthersClient.md).[`networkData`](../../base/classes/BaseEthersClient.md#networkdata) *** @@ -130,19 +130,19 @@ Defined in: [base.ts:12](https://github.com/humanprotocol/human-protocol/blob/1f > `protected` **runner**: `ContractRunner` -Defined in: [base.ts:11](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L11) +Defined in: [base.ts:11](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L11) #### Inherited from -[`BaseEthersClient`](../../base/classes/BaseEthersClient.md).[`runner`](../../base/classes/BaseEthersClient.md#runner-1) +[`BaseEthersClient`](../../base/classes/BaseEthersClient.md).[`runner`](../../base/classes/BaseEthersClient.md#runner) ## Methods ### set() -> **set**(`key`, `value`, `txOptions`?): `Promise`\<`void`\> +> **set**(`key`, `value`, `txOptions?`): `Promise`\<`void`\> -Defined in: [kvstore.ts:171](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/kvstore.ts#L171) +Defined in: [kvstore.ts:171](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/kvstore.ts#L171) This function sets a key-value pair associated with the address that submits the transaction. @@ -194,9 +194,9 @@ await kvstoreClient.set('Role', 'RecordingOracle'); ### setBulk() -> **setBulk**(`keys`, `values`, `txOptions`?): `Promise`\<`void`\> +> **setBulk**(`keys`, `values`, `txOptions?`): `Promise`\<`void`\> -Defined in: [kvstore.ts:214](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/kvstore.ts#L214) +Defined in: [kvstore.ts:214](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/kvstore.ts#L214) This function sets key-value pairs in bulk associated with the address that submits the transaction. @@ -250,9 +250,9 @@ await kvstoreClient.setBulk(keys, values); ### setFileUrlAndHash() -> **setFileUrlAndHash**(`url`, `urlKey`, `txOptions`?): `Promise`\<`void`\> +> **setFileUrlAndHash**(`url`, `urlKey`, `txOptions?`): `Promise`\<`void`\> -Defined in: [kvstore.ts:257](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/kvstore.ts#L257) +Defined in: [kvstore.ts:257](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/kvstore.ts#L257) Sets a URL value for the address that submits the transaction, and its hash. @@ -303,9 +303,9 @@ await kvstoreClient.setFileUrlAndHash('linkedin.com/example', 'linkedin_url'); ### build() -> `static` **build**(`runner`): `Promise`\<[`KVStoreClient`](KVStoreClient.md)\> +> `static` **build**(`runner`): `Promise`\<`KVStoreClient`\> -Defined in: [kvstore.ts:126](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/kvstore.ts#L126) +Defined in: [kvstore.ts:126](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/kvstore.ts#L126) Creates an instance of KVStoreClient from a runner. @@ -319,7 +319,7 @@ The Runner object to interact with the Ethereum network #### Returns -`Promise`\<[`KVStoreClient`](KVStoreClient.md)\> +`Promise`\<`KVStoreClient`\> - An instance of KVStoreClient diff --git a/docs/sdk/typescript/kvstore/classes/KVStoreUtils.md b/docs/sdk/typescript/kvstore/classes/KVStoreUtils.md index b2256eac5b..1fbf8950a3 100644 --- a/docs/sdk/typescript/kvstore/classes/KVStoreUtils.md +++ b/docs/sdk/typescript/kvstore/classes/KVStoreUtils.md @@ -6,7 +6,7 @@ # Class: KVStoreUtils -Defined in: [kvstore.ts:318](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/kvstore.ts#L318) +Defined in: [kvstore.ts:318](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/kvstore.ts#L318) ## Introduction @@ -41,13 +41,13 @@ const KVStoreAddresses = await KVStoreUtils.getKVStoreData( ## Constructors -### new KVStoreUtils() +### Constructor -> **new KVStoreUtils**(): [`KVStoreUtils`](KVStoreUtils.md) +> **new KVStoreUtils**(): `KVStoreUtils` #### Returns -[`KVStoreUtils`](KVStoreUtils.md) +`KVStoreUtils` ## Methods @@ -55,7 +55,7 @@ const KVStoreAddresses = await KVStoreUtils.getKVStoreData( > `static` **get**(`chainId`, `address`, `key`): `Promise`\<`string`\> -Defined in: [kvstore.ts:389](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/kvstore.ts#L389) +Defined in: [kvstore.ts:389](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/kvstore.ts#L389) Gets the value of a key-value pair in the KVStore using the subgraph. @@ -116,7 +116,7 @@ console.log(value); > `static` **getFileUrlAndVerifyHash**(`chainId`, `address`, `urlKey`): `Promise`\<`string`\> -Defined in: [kvstore.ts:436](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/kvstore.ts#L436) +Defined in: [kvstore.ts:436](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/kvstore.ts#L436) Gets the URL value of the given entity, and verifies its hash. @@ -164,7 +164,7 @@ console.log(url); > `static` **getKVStoreData**(`chainId`, `address`): `Promise`\<[`IKVStore`](../../interfaces/interfaces/IKVStore.md)[]\> -Defined in: [kvstore.ts:337](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/kvstore.ts#L337) +Defined in: [kvstore.ts:337](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/kvstore.ts#L337) This function returns the KVStore data for a given address. @@ -211,7 +211,7 @@ console.log(kvStoreData); > `static` **getPublicKey**(`chainId`, `address`): `Promise`\<`string`\> -Defined in: [kvstore.ts:496](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/kvstore.ts#L496) +Defined in: [kvstore.ts:496](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/kvstore.ts#L496) Gets the public key of the given entity, and verifies its hash. diff --git a/docs/sdk/typescript/operator/classes/OperatorUtils.md b/docs/sdk/typescript/operator/classes/OperatorUtils.md index 9e675b0bd4..7842ae3d3b 100644 --- a/docs/sdk/typescript/operator/classes/OperatorUtils.md +++ b/docs/sdk/typescript/operator/classes/OperatorUtils.md @@ -6,17 +6,17 @@ # Class: OperatorUtils -Defined in: [operator.ts:27](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/operator.ts#L27) +Defined in: [operator.ts:27](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/operator.ts#L27) ## Constructors -### new OperatorUtils() +### Constructor -> **new OperatorUtils**(): [`OperatorUtils`](OperatorUtils.md) +> **new OperatorUtils**(): `OperatorUtils` #### Returns -[`OperatorUtils`](OperatorUtils.md) +`OperatorUtils` ## Methods @@ -24,7 +24,7 @@ Defined in: [operator.ts:27](https://github.com/humanprotocol/human-protocol/blo > `static` **getOperator**(`chainId`, `address`): `Promise`\<[`IOperator`](../../interfaces/interfaces/IOperator.md)\> -Defined in: [operator.ts:43](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/operator.ts#L43) +Defined in: [operator.ts:43](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/operator.ts#L43) This function returns the operator data for the given address. @@ -62,7 +62,7 @@ const operator = await OperatorUtils.getOperator(ChainId.POLYGON_AMOY, '0x62dD51 > `static` **getOperators**(`filter`): `Promise`\<[`IOperator`](../../interfaces/interfaces/IOperator.md)[]\> -Defined in: [operator.ts:109](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/operator.ts#L109) +Defined in: [operator.ts:109](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/operator.ts#L109) This function returns all the operator details of the protocol. @@ -95,9 +95,9 @@ const operators = await OperatorUtils.getOperators(filter); ### getReputationNetworkOperators() -> `static` **getReputationNetworkOperators**(`chainId`, `address`, `role`?): `Promise`\<[`IOperator`](../../interfaces/interfaces/IOperator.md)[]\> +> `static` **getReputationNetworkOperators**(`chainId`, `address`, `role?`): `Promise`\<[`IOperator`](../../interfaces/interfaces/IOperator.md)[]\> -Defined in: [operator.ts:190](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/operator.ts#L190) +Defined in: [operator.ts:190](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/operator.ts#L190) Retrieves the reputation network operators of the specified address. @@ -141,7 +141,7 @@ const operators = await OperatorUtils.getReputationNetworkOperators(ChainId.POLY > `static` **getRewards**(`chainId`, `slasherAddress`): `Promise`\<[`IReward`](../../interfaces/interfaces/IReward.md)[]\> -Defined in: [operator.ts:244](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/operator.ts#L244) +Defined in: [operator.ts:244](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/operator.ts#L244) This function returns information about the rewards for a given slasher address. diff --git a/docs/sdk/typescript/staking/classes/StakingClient.md b/docs/sdk/typescript/staking/classes/StakingClient.md index bd9b92b82e..34f6cd2685 100644 --- a/docs/sdk/typescript/staking/classes/StakingClient.md +++ b/docs/sdk/typescript/staking/classes/StakingClient.md @@ -6,7 +6,7 @@ # Class: StakingClient -Defined in: [staking.ts:97](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/staking.ts#L97) +Defined in: [staking.ts:97](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/staking.ts#L97) ## Introduction @@ -82,11 +82,11 @@ const stakingClient = await StakingClient.build(provider); ## Constructors -### new StakingClient() +### Constructor -> **new StakingClient**(`runner`, `networkData`): [`StakingClient`](StakingClient.md) +> **new StakingClient**(`runner`, `networkData`): `StakingClient` -Defined in: [staking.ts:108](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/staking.ts#L108) +Defined in: [staking.ts:108](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/staking.ts#L108) **StakingClient constructor** @@ -106,11 +106,11 @@ The network information required to connect to the Staking contract #### Returns -[`StakingClient`](StakingClient.md) +`StakingClient` #### Overrides -[`BaseEthersClient`](../../base/classes/BaseEthersClient.md).[`constructor`](../../base/classes/BaseEthersClient.md#constructors) +[`BaseEthersClient`](../../base/classes/BaseEthersClient.md).[`constructor`](../../base/classes/BaseEthersClient.md#constructor) ## Properties @@ -118,7 +118,7 @@ The network information required to connect to the Staking contract > **escrowFactoryContract**: `EscrowFactory` -Defined in: [staking.ts:100](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/staking.ts#L100) +Defined in: [staking.ts:100](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/staking.ts#L100) *** @@ -126,11 +126,11 @@ Defined in: [staking.ts:100](https://github.com/humanprotocol/human-protocol/blo > **networkData**: [`NetworkData`](../../types/type-aliases/NetworkData.md) -Defined in: [base.ts:12](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L12) +Defined in: [base.ts:12](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L12) #### Inherited from -[`BaseEthersClient`](../../base/classes/BaseEthersClient.md).[`networkData`](../../base/classes/BaseEthersClient.md#networkdata-1) +[`BaseEthersClient`](../../base/classes/BaseEthersClient.md).[`networkData`](../../base/classes/BaseEthersClient.md#networkdata) *** @@ -138,11 +138,11 @@ Defined in: [base.ts:12](https://github.com/humanprotocol/human-protocol/blob/1f > `protected` **runner**: `ContractRunner` -Defined in: [base.ts:11](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L11) +Defined in: [base.ts:11](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L11) #### Inherited from -[`BaseEthersClient`](../../base/classes/BaseEthersClient.md).[`runner`](../../base/classes/BaseEthersClient.md#runner-1) +[`BaseEthersClient`](../../base/classes/BaseEthersClient.md).[`runner`](../../base/classes/BaseEthersClient.md#runner) *** @@ -150,7 +150,7 @@ Defined in: [base.ts:11](https://github.com/humanprotocol/human-protocol/blob/1f > **stakingContract**: `Staking` -Defined in: [staking.ts:99](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/staking.ts#L99) +Defined in: [staking.ts:99](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/staking.ts#L99) *** @@ -158,15 +158,15 @@ Defined in: [staking.ts:99](https://github.com/humanprotocol/human-protocol/blob > **tokenContract**: `HMToken` -Defined in: [staking.ts:98](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/staking.ts#L98) +Defined in: [staking.ts:98](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/staking.ts#L98) ## Methods ### approveStake() -> **approveStake**(`amount`, `txOptions`?): `Promise`\<`void`\> +> **approveStake**(`amount`, `txOptions?`): `Promise`\<`void`\> -Defined in: [staking.ts:193](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/staking.ts#L193) +Defined in: [staking.ts:193](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/staking.ts#L193) This function approves the staking contract to transfer a specified amount of tokens when the user stakes. It increases the allowance for the staking contract. @@ -213,7 +213,7 @@ await stakingClient.approveStake(amount); > **getStakerInfo**(`stakerAddress`): `Promise`\<[`StakerInfo`](../../interfaces/interfaces/StakerInfo.md)\> -Defined in: [staking.ts:435](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/staking.ts#L435) +Defined in: [staking.ts:435](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/staking.ts#L435) Retrieves comprehensive staking information for a staker. @@ -247,9 +247,9 @@ console.log(stakingInfo.tokensStaked); ### slash() -> **slash**(`slasher`, `staker`, `escrowAddress`, `amount`, `txOptions`?): `Promise`\<`void`\> +> **slash**(`slasher`, `staker`, `escrowAddress`, `amount`, `txOptions?`): `Promise`\<`void`\> -Defined in: [staking.ts:373](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/staking.ts#L373) +Defined in: [staking.ts:373](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/staking.ts#L373) This function reduces the allocated amount by a staker in an escrow and transfers those tokens to the reward pool. This allows the slasher to claim them later. @@ -312,9 +312,9 @@ await stakingClient.slash('0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266', '0xf39Fd ### stake() -> **stake**(`amount`, `txOptions`?): `Promise`\<`void`\> +> **stake**(`amount`, `txOptions?`): `Promise`\<`void`\> -Defined in: [staking.ts:247](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/staking.ts#L247) +Defined in: [staking.ts:247](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/staking.ts#L247) This function stakes a specified amount of tokens on a specific network. @@ -362,9 +362,9 @@ await stakingClient.stake(amount); ### unstake() -> **unstake**(`amount`, `txOptions`?): `Promise`\<`void`\> +> **unstake**(`amount`, `txOptions?`): `Promise`\<`void`\> -Defined in: [staking.ts:291](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/staking.ts#L291) +Defined in: [staking.ts:291](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/staking.ts#L291) This function unstakes tokens from staking contract. The unstaked tokens stay locked for a period of time. @@ -411,9 +411,9 @@ await stakingClient.unstake(amount); ### withdraw() -> **withdraw**(`txOptions`?): `Promise`\<`void`\> +> **withdraw**(`txOptions?`): `Promise`\<`void`\> -Defined in: [staking.ts:336](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/staking.ts#L336) +Defined in: [staking.ts:336](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/staking.ts#L336) This function withdraws unstaked and non-locked tokens from staking contract to the user wallet. @@ -453,9 +453,9 @@ await stakingClient.withdraw(); ### build() -> `static` **build**(`runner`): `Promise`\<[`StakingClient`](StakingClient.md)\> +> `static` **build**(`runner`): `Promise`\<`StakingClient`\> -Defined in: [staking.ts:136](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/staking.ts#L136) +Defined in: [staking.ts:136](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/staking.ts#L136) Creates an instance of StakingClient from a Runner. @@ -469,7 +469,7 @@ The Runner object to interact with the Ethereum network #### Returns -`Promise`\<[`StakingClient`](StakingClient.md)\> +`Promise`\<`StakingClient`\> - An instance of StakingClient diff --git a/docs/sdk/typescript/statistics/classes/StatisticsClient.md b/docs/sdk/typescript/statistics/classes/StatisticsClient.md index 3dd493b5e5..908463c679 100644 --- a/docs/sdk/typescript/statistics/classes/StatisticsClient.md +++ b/docs/sdk/typescript/statistics/classes/StatisticsClient.md @@ -6,7 +6,7 @@ # Class: StatisticsClient -Defined in: [statistics.ts:58](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/statistics.ts#L58) +Defined in: [statistics.ts:58](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/statistics.ts#L58) ## Introduction @@ -41,11 +41,11 @@ const statisticsClient = new StatisticsClient(NETWORKS[ChainId.POLYGON_AMOY]); ## Constructors -### new StatisticsClient() +### Constructor -> **new StatisticsClient**(`networkData`): [`StatisticsClient`](StatisticsClient.md) +> **new StatisticsClient**(`networkData`): `StatisticsClient` -Defined in: [statistics.ts:67](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/statistics.ts#L67) +Defined in: [statistics.ts:67](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/statistics.ts#L67) **StatisticsClient constructor** @@ -59,7 +59,7 @@ The network information required to connect to the Statistics contract #### Returns -[`StatisticsClient`](StatisticsClient.md) +`StatisticsClient` ## Properties @@ -67,7 +67,7 @@ The network information required to connect to the Statistics contract > **networkData**: [`NetworkData`](../../types/type-aliases/NetworkData.md) -Defined in: [statistics.ts:59](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/statistics.ts#L59) +Defined in: [statistics.ts:59](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/statistics.ts#L59) *** @@ -75,7 +75,7 @@ Defined in: [statistics.ts:59](https://github.com/humanprotocol/human-protocol/b > **subgraphUrl**: `string` -Defined in: [statistics.ts:60](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/statistics.ts#L60) +Defined in: [statistics.ts:60](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/statistics.ts#L60) ## Methods @@ -83,7 +83,7 @@ Defined in: [statistics.ts:60](https://github.com/humanprotocol/human-protocol/b > **getEscrowStatistics**(`filter`): `Promise`\<[`EscrowStatistics`](../../graphql/types/type-aliases/EscrowStatistics.md)\> -Defined in: [statistics.ts:120](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/statistics.ts#L120) +Defined in: [statistics.ts:120](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/statistics.ts#L120) This function returns the statistical data of escrows. @@ -149,7 +149,7 @@ const escrowStatisticsApril = await statisticsClient.getEscrowStatistics({ > **getHMTDailyData**(`filter`): `Promise`\<[`DailyHMTData`](../../graphql/types/type-aliases/DailyHMTData.md)[]\> -Defined in: [statistics.ts:478](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/statistics.ts#L478) +Defined in: [statistics.ts:478](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/statistics.ts#L478) This function returns the statistical data of HMToken day by day. @@ -214,7 +214,7 @@ console.log('HMT statistics from 5/8 - 6/8:', hmtStatisticsRange); > **getHMTHolders**(`params`): `Promise`\<[`HMTHolder`](../../graphql/types/type-aliases/HMTHolder.md)[]\> -Defined in: [statistics.ts:407](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/statistics.ts#L407) +Defined in: [statistics.ts:407](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/statistics.ts#L407) This function returns the holders of the HMToken with optional filters and ordering. @@ -257,7 +257,7 @@ console.log('HMT holders:', hmtHolders.map((h) => ({ > **getHMTStatistics**(): `Promise`\<[`HMTStatistics`](../../graphql/types/type-aliases/HMTStatistics.md)\> -Defined in: [statistics.ts:364](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/statistics.ts#L364) +Defined in: [statistics.ts:364](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/statistics.ts#L364) This function returns the statistical data of HMToken. @@ -296,7 +296,7 @@ console.log('HMT statistics:', { > **getPaymentStatistics**(`filter`): `Promise`\<[`PaymentStatistics`](../../graphql/types/type-aliases/PaymentStatistics.md)\> -Defined in: [statistics.ts:300](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/statistics.ts#L300) +Defined in: [statistics.ts:300](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/statistics.ts#L300) This function returns the statistical data of payments. @@ -380,7 +380,7 @@ console.log( > **getWorkerStatistics**(`filter`): `Promise`\<[`WorkerStatistics`](../../graphql/types/type-aliases/WorkerStatistics.md)\> -Defined in: [statistics.ts:204](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/statistics.ts#L204) +Defined in: [statistics.ts:204](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/statistics.ts#L204) This function returns the statistical data of workers. diff --git a/docs/sdk/typescript/storage/classes/StorageClient.md b/docs/sdk/typescript/storage/classes/StorageClient.md index 6204af8592..a3a552a1f5 100644 --- a/docs/sdk/typescript/storage/classes/StorageClient.md +++ b/docs/sdk/typescript/storage/classes/StorageClient.md @@ -6,7 +6,7 @@ # Class: ~~StorageClient~~ -Defined in: [storage.ts:63](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/storage.ts#L63) +Defined in: [storage.ts:63](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/storage.ts#L63) ## Deprecated @@ -57,11 +57,11 @@ const storageClient = new StorageClient(params, credentials); ## Constructors -### new StorageClient() +### Constructor -> **new StorageClient**(`params`, `credentials`?): [`StorageClient`](StorageClient.md) +> **new StorageClient**(`params`, `credentials?`): `StorageClient` -Defined in: [storage.ts:73](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/storage.ts#L73) +Defined in: [storage.ts:73](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/storage.ts#L73) **Storage client constructor** @@ -81,7 +81,7 @@ Optional. Cloud storage access data. If credentials are not provided - use anony #### Returns -[`StorageClient`](StorageClient.md) +`StorageClient` ## Methods @@ -89,7 +89,7 @@ Optional. Cloud storage access data. If credentials are not provided - use anony > **bucketExists**(`bucket`): `Promise`\<`boolean`\> -Defined in: [storage.ts:262](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/storage.ts#L262) +Defined in: [storage.ts:262](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/storage.ts#L262) This function checks if a bucket exists. @@ -133,7 +133,7 @@ const exists = await storageClient.bucketExists('bucket-name'); > **downloadFiles**(`keys`, `bucket`): `Promise`\<`any`[]\> -Defined in: [storage.ts:112](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/storage.ts#L112) +Defined in: [storage.ts:112](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/storage.ts#L112) This function downloads files from a bucket. @@ -181,7 +181,7 @@ const files = await storageClient.downloadFiles(keys, 'bucket-name'); > **listObjects**(`bucket`): `Promise`\<`string`[]\> -Defined in: [storage.ts:292](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/storage.ts#L292) +Defined in: [storage.ts:292](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/storage.ts#L292) This function lists all file names contained in the bucket. @@ -225,7 +225,7 @@ const fileNames = await storageClient.listObjects('bucket-name'); > **uploadFiles**(`files`, `bucket`): `Promise`\<[`UploadFile`](../../types/type-aliases/UploadFile.md)[]\> -Defined in: [storage.ts:198](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/storage.ts#L198) +Defined in: [storage.ts:198](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/storage.ts#L198) This function uploads files to a bucket. @@ -278,7 +278,7 @@ const uploadedFiles = await storageClient.uploadFiles(files, 'bucket-name'); > `static` **downloadFileFromUrl**(`url`): `Promise`\<`any`\> -Defined in: [storage.ts:146](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/storage.ts#L146) +Defined in: [storage.ts:146](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/storage.ts#L146) This function downloads files from a URL. diff --git a/docs/sdk/typescript/transaction/classes/TransactionUtils.md b/docs/sdk/typescript/transaction/classes/TransactionUtils.md index e6031b2f4d..06e203fd38 100644 --- a/docs/sdk/typescript/transaction/classes/TransactionUtils.md +++ b/docs/sdk/typescript/transaction/classes/TransactionUtils.md @@ -6,17 +6,17 @@ # Class: TransactionUtils -Defined in: [transaction.ts:18](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/transaction.ts#L18) +Defined in: [transaction.ts:18](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/transaction.ts#L18) ## Constructors -### new TransactionUtils() +### Constructor -> **new TransactionUtils**(): [`TransactionUtils`](TransactionUtils.md) +> **new TransactionUtils**(): `TransactionUtils` #### Returns -[`TransactionUtils`](TransactionUtils.md) +`TransactionUtils` ## Methods @@ -24,7 +24,7 @@ Defined in: [transaction.ts:18](https://github.com/humanprotocol/human-protocol/ > `static` **getTransaction**(`chainId`, `hash`): `Promise`\<[`ITransaction`](../../interfaces/interfaces/ITransaction.md)\> -Defined in: [transaction.ts:34](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/transaction.ts#L34) +Defined in: [transaction.ts:34](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/transaction.ts#L34) This function returns the transaction data for the given hash. @@ -62,7 +62,7 @@ const transaction = await TransactionUtils.getTransaction(ChainId.POLYGON, '0x62 > `static` **getTransactions**(`filter`): `Promise`\<[`ITransaction`](../../interfaces/interfaces/ITransaction.md)[]\> -Defined in: [transaction.ts:109](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/transaction.ts#L109) +Defined in: [transaction.ts:109](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/transaction.ts#L109) This function returns all transaction details based on the provided filter. diff --git a/docs/sdk/typescript/types/enumerations/EscrowStatus.md b/docs/sdk/typescript/types/enumerations/EscrowStatus.md index d0e0362ce2..bd0eb7b5a4 100644 --- a/docs/sdk/typescript/types/enumerations/EscrowStatus.md +++ b/docs/sdk/typescript/types/enumerations/EscrowStatus.md @@ -6,7 +6,7 @@ # Enumeration: EscrowStatus -Defined in: [types.ts:8](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L8) +Defined in: [types.ts:8](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L8) Enum for escrow statuses. @@ -16,7 +16,7 @@ Enum for escrow statuses. > **Cancelled**: `5` -Defined in: [types.ts:32](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L32) +Defined in: [types.ts:32](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L32) Escrow is cancelled. @@ -26,7 +26,7 @@ Escrow is cancelled. > **Complete**: `4` -Defined in: [types.ts:28](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L28) +Defined in: [types.ts:28](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L28) Escrow is finished. @@ -36,7 +36,7 @@ Escrow is finished. > **Launched**: `0` -Defined in: [types.ts:12](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L12) +Defined in: [types.ts:12](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L12) Escrow is launched. @@ -46,7 +46,7 @@ Escrow is launched. > **Paid**: `3` -Defined in: [types.ts:24](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L24) +Defined in: [types.ts:24](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L24) Escrow is fully paid. @@ -56,7 +56,7 @@ Escrow is fully paid. > **Partial**: `2` -Defined in: [types.ts:20](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L20) +Defined in: [types.ts:20](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L20) Escrow is partially paid out. @@ -66,6 +66,6 @@ Escrow is partially paid out. > **Pending**: `1` -Defined in: [types.ts:16](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L16) +Defined in: [types.ts:16](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L16) Escrow is funded, and waiting for the results to be submitted. diff --git a/docs/sdk/typescript/types/type-aliases/EscrowCancel.md b/docs/sdk/typescript/types/type-aliases/EscrowCancel.md index 8d4fd28d84..f9ba874441 100644 --- a/docs/sdk/typescript/types/type-aliases/EscrowCancel.md +++ b/docs/sdk/typescript/types/type-aliases/EscrowCancel.md @@ -6,22 +6,28 @@ # Type Alias: EscrowCancel -> **EscrowCancel**: `object` +> **EscrowCancel** = `object` -Defined in: [types.ts:145](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L145) +Defined in: [types.ts:145](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L145) Represents the response data for an escrow cancellation. -## Type declaration +## Properties ### amountRefunded > **amountRefunded**: `bigint` +Defined in: [types.ts:153](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L153) + The amount refunded in the escrow cancellation. +*** + ### txHash > **txHash**: `string` +Defined in: [types.ts:149](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L149) + The hash of the transaction associated with the escrow cancellation. diff --git a/docs/sdk/typescript/types/type-aliases/EscrowWithdraw.md b/docs/sdk/typescript/types/type-aliases/EscrowWithdraw.md index cc8658ac8c..dd316282ff 100644 --- a/docs/sdk/typescript/types/type-aliases/EscrowWithdraw.md +++ b/docs/sdk/typescript/types/type-aliases/EscrowWithdraw.md @@ -6,28 +6,38 @@ # Type Alias: EscrowWithdraw -> **EscrowWithdraw**: `object` +> **EscrowWithdraw** = `object` -Defined in: [types.ts:159](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L159) +Defined in: [types.ts:159](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L159) Represents the response data for an escrow withdrawal. -## Type declaration +## Properties ### amountWithdrawn > **amountWithdrawn**: `bigint` +Defined in: [types.ts:171](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L171) + The amount withdrawn from the escrow. +*** + ### tokenAddress > **tokenAddress**: `string` +Defined in: [types.ts:167](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L167) + The address of the token used for the withdrawal. +*** + ### txHash > **txHash**: `string` +Defined in: [types.ts:163](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L163) + The hash of the transaction associated with the escrow withdrawal. diff --git a/docs/sdk/typescript/types/type-aliases/NetworkData.md b/docs/sdk/typescript/types/type-aliases/NetworkData.md index 159e72044f..45b8457817 100644 --- a/docs/sdk/typescript/types/type-aliases/NetworkData.md +++ b/docs/sdk/typescript/types/type-aliases/NetworkData.md @@ -6,76 +6,118 @@ # Type Alias: NetworkData -> **NetworkData**: `object` +> **NetworkData** = `object` -Defined in: [types.ts:95](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L95) +Defined in: [types.ts:95](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L95) Network data -## Type declaration +## Properties ### chainId > **chainId**: `number` +Defined in: [types.ts:99](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L99) + Network chain id +*** + ### factoryAddress > **factoryAddress**: `string` +Defined in: [types.ts:115](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L115) + Escrow Factory contract address +*** + ### hmtAddress > **hmtAddress**: `string` +Defined in: [types.ts:111](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L111) + HMT Token contract address +*** + ### kvstoreAddress > **kvstoreAddress**: `string` +Defined in: [types.ts:123](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L123) + KVStore contract address +*** + ### oldFactoryAddress > **oldFactoryAddress**: `string` +Defined in: [types.ts:139](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L139) + Old Escrow Factory contract address +*** + ### oldSubgraphUrl > **oldSubgraphUrl**: `string` +Defined in: [types.ts:135](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L135) + Old subgraph URL +*** + ### scanUrl > **scanUrl**: `string` +Defined in: [types.ts:107](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L107) + Network scanner URL +*** + ### stakingAddress > **stakingAddress**: `string` +Defined in: [types.ts:119](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L119) + Staking contract address +*** + ### subgraphUrl > **subgraphUrl**: `string` +Defined in: [types.ts:127](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L127) + Subgraph URL +*** + ### subgraphUrlApiKey > **subgraphUrlApiKey**: `string` +Defined in: [types.ts:131](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L131) + Subgraph URL API key +*** + ### title > **title**: `string` +Defined in: [types.ts:103](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L103) + Network title diff --git a/docs/sdk/typescript/types/type-aliases/Payout.md b/docs/sdk/typescript/types/type-aliases/Payout.md index 66df79f1a1..e561bcb54b 100644 --- a/docs/sdk/typescript/types/type-aliases/Payout.md +++ b/docs/sdk/typescript/types/type-aliases/Payout.md @@ -6,40 +6,58 @@ # Type Alias: Payout -> **Payout**: `object` +> **Payout** = `object` -Defined in: [types.ts:177](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L177) +Defined in: [types.ts:177](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L177) Represents a payout from an escrow. -## Type declaration +## Properties ### amount > **amount**: `bigint` +Defined in: [types.ts:193](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L193) + The amount paid to the recipient. +*** + ### createdAt > **createdAt**: `number` +Defined in: [types.ts:197](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L197) + The timestamp when the payout was created (in UNIX format). +*** + ### escrowAddress > **escrowAddress**: `string` +Defined in: [types.ts:185](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L185) + The address of the escrow associated with the payout. +*** + ### id > **id**: `string` +Defined in: [types.ts:181](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L181) + Unique identifier of the payout. +*** + ### recipient > **recipient**: `string` +Defined in: [types.ts:189](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L189) + The address of the recipient who received the payout. diff --git a/docs/sdk/typescript/types/type-aliases/StorageCredentials.md b/docs/sdk/typescript/types/type-aliases/StorageCredentials.md index ad1b794aec..03e684053d 100644 --- a/docs/sdk/typescript/types/type-aliases/StorageCredentials.md +++ b/docs/sdk/typescript/types/type-aliases/StorageCredentials.md @@ -6,26 +6,32 @@ # Type Alias: ~~StorageCredentials~~ -> `readonly` **StorageCredentials**: `object` +> `readonly` **StorageCredentials** = `object` -Defined in: [types.ts:40](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L40) +Defined in: [types.ts:40](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L40) AWS/GCP cloud storage access data -## Type declaration +## Deprecated + +StorageClient is deprecated. Use Minio.Client directly. + +## Properties ### ~~accessKey~~ > **accessKey**: `string` +Defined in: [types.ts:44](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L44) + Access Key +*** + ### ~~secretKey~~ > **secretKey**: `string` -Secret Key - -## Deprecated +Defined in: [types.ts:48](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L48) -StorageClient is deprecated. Use Minio.Client directly. +Secret Key diff --git a/docs/sdk/typescript/types/type-aliases/StorageParams.md b/docs/sdk/typescript/types/type-aliases/StorageParams.md index d86df41951..78db5e7c33 100644 --- a/docs/sdk/typescript/types/type-aliases/StorageParams.md +++ b/docs/sdk/typescript/types/type-aliases/StorageParams.md @@ -6,36 +6,50 @@ # Type Alias: ~~StorageParams~~ -> **StorageParams**: `object` +> **StorageParams** = `object` -Defined in: [types.ts:54](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L54) +Defined in: [types.ts:54](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L54) -## Type declaration +## Deprecated + +StorageClient is deprecated. Use Minio.Client directly. + +## Properties ### ~~endPoint~~ > **endPoint**: `string` +Defined in: [types.ts:58](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L58) + Request endPoint +*** + ### ~~port?~~ > `optional` **port**: `number` +Defined in: [types.ts:70](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L70) + TCP/IP port number. Default value set to 80 for HTTP and 443 for HTTPs +*** + ### ~~region?~~ > `optional` **region**: `string` +Defined in: [types.ts:66](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L66) + Region +*** + ### ~~useSSL~~ > **useSSL**: `boolean` -Enable secure (HTTPS) access. Default value set to false +Defined in: [types.ts:62](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L62) -## Deprecated - -StorageClient is deprecated. Use Minio.Client directly. +Enable secure (HTTPS) access. Default value set to false diff --git a/docs/sdk/typescript/types/type-aliases/TransactionLikeWithNonce.md b/docs/sdk/typescript/types/type-aliases/TransactionLikeWithNonce.md index ed7f7a1bd4..9c7bbca8c5 100644 --- a/docs/sdk/typescript/types/type-aliases/TransactionLikeWithNonce.md +++ b/docs/sdk/typescript/types/type-aliases/TransactionLikeWithNonce.md @@ -6,9 +6,9 @@ # Type Alias: TransactionLikeWithNonce -> **TransactionLikeWithNonce**: `TransactionLike` & `object` +> **TransactionLikeWithNonce** = `TransactionLike` & `object` -Defined in: [types.ts:200](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L200) +Defined in: [types.ts:200](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L200) ## Type declaration diff --git a/docs/sdk/typescript/types/type-aliases/UploadFile.md b/docs/sdk/typescript/types/type-aliases/UploadFile.md index 29759d4af4..76a517188f 100644 --- a/docs/sdk/typescript/types/type-aliases/UploadFile.md +++ b/docs/sdk/typescript/types/type-aliases/UploadFile.md @@ -6,28 +6,38 @@ # Type Alias: UploadFile -> `readonly` **UploadFile**: `object` +> `readonly` **UploadFile** = `object` -Defined in: [types.ts:77](https://github.com/humanprotocol/human-protocol/blob/1fed10bebf38e474662f3001345d050ccf6fda2f/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L77) +Defined in: [types.ts:77](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L77) Upload file data -## Type declaration +## Properties ### hash > **hash**: `string` +Defined in: [types.ts:89](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L89) + Hash of uploaded object key +*** + ### key > **key**: `string` +Defined in: [types.ts:81](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L81) + Uploaded object key +*** + ### url > **url**: `string` +Defined in: [types.ts:85](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L85) + Uploaded object URL diff --git a/packages/apps/fortune/recording-oracle/src/modules/job/job.service.ts b/packages/apps/fortune/recording-oracle/src/modules/job/job.service.ts index 10191d7f2b..48c8ea0ef2 100644 --- a/packages/apps/fortune/recording-oracle/src/modules/job/job.service.ts +++ b/packages/apps/fortune/recording-oracle/src/modules/job/job.service.ts @@ -111,7 +111,7 @@ export class JobService { const manifestUrl = await escrowClient.getManifestUrl( webhook.escrowAddress, ); - const { submissionsRequired, requestType }: IManifest = + const { submissionsRequired, requestType, fundAmount }: IManifest = await this.storageService.download(manifestUrl); if (!submissionsRequired || !requestType) { @@ -163,10 +163,21 @@ export class JobService { recordingOracleSolutions, ); + const lastExchangeSolution = + exchangeJobSolutions[exchangeJobSolutions.length - 1]; + const lastProcessedSolution = recordingOracleSolutions.find( + (s) => + s.workerAddress === lastExchangeSolution.workerAddress && + s.solution === lastExchangeSolution.solution, + ); + + const amountToReserve = BigInt(fundAmount) / BigInt(submissionsRequired); + await escrowClient.storeResults( webhook.escrowAddress, jobSolutionUploaded.url, jobSolutionUploaded.hash, + !lastProcessedSolution?.error ? amountToReserve : 0n, ); if ( diff --git a/packages/core/contracts/Escrow.sol b/packages/core/contracts/Escrow.sol index fcac414b8d..4ef4096557 100644 --- a/packages/core/contracts/Escrow.sol +++ b/packages/core/contracts/Escrow.sol @@ -249,7 +249,6 @@ contract Escrow is IEscrow, ReentrancyGuard { ); require(bytes(_url).length != 0, "URL can't be empty"); require(bytes(_hash).length != 0, "Hash can't be empty"); - require(_amount > 0, 'Amount must be greater than zero'); require( _amount <= remainingFunds - reservedFunds, 'Not enough unreserved funds' diff --git a/packages/core/test/Escrow-USDT.ts b/packages/core/test/Escrow-USDT.ts index b70c2793e4..35a3ecd39a 100644 --- a/packages/core/test/Escrow-USDT.ts +++ b/packages/core/test/Escrow-USDT.ts @@ -236,17 +236,6 @@ describe('Escrow with USDT', function () { ); }); - it('Should revert with the right error if amount sent is 0', async function () { - await fundEscrow(); - await setupEscrow(); - await escrow - .connect(owner) - .addTrustedHandlers([await reputationOracle.getAddress()]); - await expect( - escrow.connect(reputationOracle).storeResults(MOCK_URL, MOCK_HASH, 0) - ).to.be.revertedWith('Amount must be greater than zero'); - }); - it('Should revert with the right error if amount is higher than unreserved funds', async function () { await fundEscrow(); await setupEscrow(); diff --git a/packages/core/test/Escrow.ts b/packages/core/test/Escrow.ts index a5ae002203..4ddbf8ed8e 100644 --- a/packages/core/test/Escrow.ts +++ b/packages/core/test/Escrow.ts @@ -229,17 +229,6 @@ describe('Escrow', function () { ); }); - it('Should revert with the right error if amount sent is 0', async function () { - await fundEscrow(); - await setupEscrow(); - await escrow - .connect(owner) - .addTrustedHandlers([await reputationOracle.getAddress()]); - await expect( - escrow.connect(reputationOracle).storeResults(MOCK_URL, MOCK_HASH, 0) - ).to.be.revertedWith('Amount must be greater than zero'); - }); - it('Should revert with the right error if amount is higher than unreserved funds', async function () { await fundEscrow(); await setupEscrow(); diff --git a/packages/sdk/python/human-protocol-sdk/human_protocol_sdk/escrow/escrow_client.py b/packages/sdk/python/human-protocol-sdk/human_protocol_sdk/escrow/escrow_client.py index e8c9854d27..fa07935797 100644 --- a/packages/sdk/python/human-protocol-sdk/human_protocol_sdk/escrow/escrow_client.py +++ b/packages/sdk/python/human-protocol-sdk/human_protocol_sdk/escrow/escrow_client.py @@ -436,6 +436,7 @@ def store_results( escrow_address: str, url: str, hash: str, + amount: Decimal, tx_options: Optional[TxParams] = None, ) -> None: """ @@ -444,6 +445,7 @@ def store_results( :param escrow_address: Address of the escrow :param url: Results file URL :param hash: Results file hash + :param amount: Amount to reserve for payouts :param tx_options: (Optional) Additional transaction parameters :return: None @@ -477,7 +479,8 @@ def get_w3_with_priv_key(priv_key: str): escrow_client.store_results( "0x62dD51230A30401C455c8398d06F85e4EaB6309f", "http://localhost/results.json", - "b5dad76bf6772c0f07fd5e048f6e75a5f86ee079" + "b5dad76bf6772c0f07fd5e048f6e75a5f86ee079", + Web3.to_wei(5, 'ether') ) """ if not Web3.is_address(escrow_address): @@ -486,13 +489,17 @@ def get_w3_with_priv_key(priv_key: str): raise EscrowClientError("Invalid empty hash") if not validate_url(url): raise EscrowClientError(f"Invalid URL: {url}") + if amount <= 0: + raise EscrowClientError("Amount must be positive") if not self.w3.eth.default_account: raise EscrowClientError("You must add an account to Web3 instance") handle_transaction( self.w3, "Store Results", - self._get_escrow_contract(escrow_address).functions.storeResults(url, hash), + self._get_escrow_contract(escrow_address).functions.storeResults( + url, hash, amount + ), EscrowClientError, tx_options, ) diff --git a/packages/sdk/python/human-protocol-sdk/test/human_protocol_sdk/escrow/test_escrow_client.py b/packages/sdk/python/human-protocol-sdk/test/human_protocol_sdk/escrow/test_escrow_client.py index ac0f38ae57..960c2ac20f 100644 --- a/packages/sdk/python/human-protocol-sdk/test/human_protocol_sdk/escrow/test_escrow_client.py +++ b/packages/sdk/python/human-protocol-sdk/test/human_protocol_sdk/escrow/test_escrow_client.py @@ -699,14 +699,17 @@ def test_store_results(self): escrow_address = "0x1234567890123456789012345678901234567890" url = "https://www.example.com/result" hash = "test" + amount = 100 with patch( "human_protocol_sdk.escrow.escrow_client.handle_transaction" ) as mock_function: - self.escrow.store_results(escrow_address, url, hash) + self.escrow.store_results(escrow_address, url, hash, amount) self.escrow._get_escrow_contract.assert_called_once_with(escrow_address) - mock_contract.functions.storeResults.assert_called_once_with(url, hash) + mock_contract.functions.storeResults.assert_called_once_with( + url, hash, amount + ) mock_function.assert_called_once_with( self.w3, "Store Results", @@ -719,29 +722,42 @@ def test_store_results_invalid_address(self): escrow_address = "invalid_address" url = "https://www.example.com/result" hash = "test" + amount = 100 with self.assertRaises(EscrowClientError) as cm: - self.escrow.store_results(escrow_address, url, hash) + self.escrow.store_results(escrow_address, url, hash, amount) self.assertEqual(f"Invalid escrow address: {escrow_address}", str(cm.exception)) def test_store_results_invalid_url(self): escrow_address = "0x1234567890123456789012345678901234567890" url = "invalid_url" hash = "test" + amount = 100 with self.assertRaises(EscrowClientError) as cm: - self.escrow.store_results(escrow_address, url, hash) + self.escrow.store_results(escrow_address, url, hash, amount) self.assertEqual(f"Invalid URL: {url}", str(cm.exception)) def test_store_results_invalid_hash(self): escrow_address = "0x1234567890123456789012345678901234567890" url = "https://www.example.com/result" hash = "" + amount = 100 with self.assertRaises(EscrowClientError) as cm: - self.escrow.store_results(escrow_address, url, hash) + self.escrow.store_results(escrow_address, url, hash, amount) self.assertEqual("Invalid empty hash", str(cm.exception)) + def test_store_results_invalid_hash(self): + escrow_address = "0x1234567890123456789012345678901234567890" + url = "https://www.example.com/result" + hash = "test" + amount = -10 + + with self.assertRaises(EscrowClientError) as cm: + self.escrow.store_results(escrow_address, url, hash, amount) + self.assertEqual("Amount must be positive", str(cm.exception)) + def test_store_results_without_account(self): mock_provider = MagicMock(spec=HTTPProvider) w3 = Web3(mock_provider) @@ -753,9 +769,10 @@ def test_store_results_without_account(self): escrow_address = "0x1234567890123456789012345678901234567890" url = "https://www.example.com/result" hash = "test" + amount = 100 with self.assertRaises(EscrowClientError) as cm: - escrowClient.store_results(escrow_address, url, hash) + escrowClient.store_results(escrow_address, url, hash, amount) self.assertEqual("You must add an account to Web3 instance", str(cm.exception)) def test_store_results_invalid_status(self): @@ -768,9 +785,10 @@ def test_store_results_invalid_status(self): escrow_address = "0x1234567890123456789012345678901234567890" url = "https://www.example.com/result" hash = "test" + amount = 100 with self.assertRaises(EscrowClientError) as cm: - self.escrow.store_results(escrow_address, url, hash) + self.escrow.store_results(escrow_address, url, hash, amount) self.assertEqual( "Store Results transaction failed: Escrow not in Pending or Partial status state", str(cm.exception), @@ -786,9 +804,10 @@ def test_store_results_invalid_caller(self): escrow_address = "0x1234567890123456789012345678901234567890" url = "https://www.example.com/result" hash = "test" + amount = 100 with self.assertRaises(EscrowClientError) as cm: - self.escrow.store_results(escrow_address, url, hash) + self.escrow.store_results(escrow_address, url, hash, amount) self.assertEqual( "Store Results transaction failed: Address calling not trusted", str(cm.exception), @@ -799,9 +818,10 @@ def test_store_results_invalid_escrow(self): escrow_address = "0x1234567890123456789012345678901234567890" url = "https://www.example.com/result" hash = "test" + amount = 100 with self.assertRaises(EscrowClientError) as cm: - self.escrow.store_results(escrow_address, url, hash) + self.escrow.store_results(escrow_address, url, hash, amount) self.assertEqual( "Escrow address is not provided by the factory", str(cm.exception), @@ -814,15 +834,18 @@ def test_store_results_with_tx_options(self): escrow_address = "0x1234567890123456789012345678901234567890" url = "https://www.example.com/result" hash = "test" + amount = 100 tx_options = {"gas": 50000} with patch( "human_protocol_sdk.escrow.escrow_client.handle_transaction" ) as mock_function: - self.escrow.store_results(escrow_address, url, hash, tx_options) + self.escrow.store_results(escrow_address, url, hash, amount, tx_options) self.escrow._get_escrow_contract.assert_called_once_with(escrow_address) - mock_contract.functions.storeResults.assert_called_once_with(url, hash) + mock_contract.functions.storeResults.assert_called_once_with( + url, hash, amount + ) mock_function.assert_called_once_with( self.w3, "Store Results", diff --git a/packages/sdk/typescript/human-protocol-sdk/src/error.ts b/packages/sdk/typescript/human-protocol-sdk/src/error.ts index c39c75d714..13d8391d11 100644 --- a/packages/sdk/typescript/human-protocol-sdk/src/error.ts +++ b/packages/sdk/typescript/human-protocol-sdk/src/error.ts @@ -251,6 +251,11 @@ export const ErrorAmountMustBeGreaterThanZero = new Error( 'Amount must be greater than zero' ); +/** + * @constant {Error} - Amount must be positive. + */ +export const ErrorAmountMustBePositive = new Error('Amount must be positive'); + /** * @constant {Error} - Escrow does not have enough balance. */ diff --git a/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts b/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts index 46474bdf6b..74b5465471 100644 --- a/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts +++ b/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts @@ -17,6 +17,7 @@ import { requiresSigner } from './decorators'; import { ChainId, OrderDirection } from './enums'; import { ErrorAmountMustBeGreaterThanZero, + ErrorAmountMustBePositive, ErrorAmountsCannotBeEmptyArray, ErrorEscrowAddressIsNotProvidedByFactory, ErrorEscrowDoesNotHaveEnoughBalance, @@ -455,11 +456,12 @@ export class EscrowClient extends BaseEthersClient { } /** - * This function stores the results URL and hash. + * This function stores the results URL and hash, and reserves the specified amount of funds. * * @param {string} escrowAddress Address of the escrow. * @param {string} url Results file URL. * @param {string} hash Results file hash. + * @param {bigint} amount Amount to reserve for payouts. * @param {Overrides} [txOptions] - Additional transaction parameters (optional, defaults to an empty object). * @returns Returns void if successful. Throws error if any. * @@ -479,7 +481,7 @@ export class EscrowClient extends BaseEthersClient { * const signer = new Wallet(privateKey, provider); * const escrowClient = await EscrowClient.build(signer); * - * await escrowClient.storeResults('0x62dD51230A30401C455c8398d06F85e4EaB6309f', 'http://localhost/results.json', 'b5dad76bf6772c0f07fd5e048f6e75a5f86ee079'); + * await escrowClient.storeResults('0x62dD51230A30401C455c8398d06F85e4EaB6309f', 'http://localhost/results.json', 'b5dad76bf6772c0f07fd5e048f6e75a5f86ee079', 50n); * ``` */ @requiresSigner @@ -487,6 +489,7 @@ export class EscrowClient extends BaseEthersClient { escrowAddress: string, url: string, hash: string, + amount: bigint, txOptions: Overrides = {} ): Promise { if (!ethers.isAddress(escrowAddress)) { @@ -505,6 +508,10 @@ export class EscrowClient extends BaseEthersClient { throw ErrorHashIsEmptyString; } + if (amount <= 0n) { + throw ErrorAmountMustBePositive; + } + if (!(await this.escrowFactoryContract.hasEscrow(escrowAddress))) { throw ErrorEscrowAddressIsNotProvidedByFactory; } @@ -512,7 +519,9 @@ export class EscrowClient extends BaseEthersClient { try { const escrowContract = this.getEscrowContract(escrowAddress); - await (await escrowContract.storeResults(url, hash, txOptions)).wait(); + await ( + await escrowContract.storeResults(url, hash, amount, txOptions) + ).wait(); return; } catch (e) { @@ -942,6 +951,7 @@ export class EscrowClient extends BaseEthersClient { * const signedTransaction = await signer.signTransaction(rawTransaction); * console.log('Tx hash:', ethers.keccak256(signedTransaction)); * (await signer.sendTransaction(rawTransaction)).wait(); + * ``` */ @requiresSigner async createBulkPayoutTransaction( diff --git a/packages/sdk/typescript/human-protocol-sdk/test/escrow.test.ts b/packages/sdk/typescript/human-protocol-sdk/test/escrow.test.ts index b9d69c0a01..d1ee83aa18 100644 --- a/packages/sdk/typescript/human-protocol-sdk/test/escrow.test.ts +++ b/packages/sdk/typescript/human-protocol-sdk/test/escrow.test.ts @@ -12,6 +12,7 @@ import { NETWORKS } from '../src/constants'; import { ChainId, OrderDirection } from '../src/enums'; import { ErrorAmountMustBeGreaterThanZero, + ErrorAmountMustBePositive, ErrorAmountsCannotBeEmptyArray, ErrorEscrowAddressIsNotProvidedByFactory, ErrorEscrowDoesNotHaveEnoughBalance, @@ -45,6 +46,7 @@ import { DEFAULT_GAS_PAYER_PRIVKEY, DEFAULT_TX_ID, FAKE_ADDRESS, + FAKE_AMOUNT, FAKE_HASH, FAKE_URL, VALID_URL, @@ -718,9 +720,10 @@ describe('EscrowClient', () => { const invalidAddress = FAKE_ADDRESS; const url = VALID_URL; const hash = FAKE_HASH; + const amount = FAKE_AMOUNT; await expect( - escrowClient.storeResults(invalidAddress, url, hash) + escrowClient.storeResults(invalidAddress, url, hash, amount) ).rejects.toThrow(ErrorInvalidEscrowAddressProvided); }); @@ -728,11 +731,12 @@ describe('EscrowClient', () => { const escrowAddress = ethers.ZeroAddress; const url = VALID_URL; const hash = FAKE_HASH; + const amount = FAKE_AMOUNT; escrowClient.escrowFactoryContract.hasEscrow.mockReturnValue(false); await expect( - escrowClient.storeResults(escrowAddress, url, hash) + escrowClient.storeResults(escrowAddress, url, hash, amount) ).rejects.toThrow(ErrorEscrowAddressIsNotProvidedByFactory); }); @@ -740,11 +744,12 @@ describe('EscrowClient', () => { const escrowAddress = ethers.ZeroAddress; const url = ''; const hash = FAKE_HASH; + const amount = FAKE_AMOUNT; escrowClient.escrowFactoryContract.hasEscrow.mockReturnValue(true); await expect( - escrowClient.storeResults(escrowAddress, url, hash) + escrowClient.storeResults(escrowAddress, url, hash, amount) ).rejects.toThrow(ErrorUrlIsEmptyString); }); @@ -752,11 +757,12 @@ describe('EscrowClient', () => { const escrowAddress = ethers.ZeroAddress; const url = FAKE_URL; const hash = FAKE_HASH; + const amount = FAKE_AMOUNT; escrowClient.escrowFactoryContract.hasEscrow.mockReturnValue(true); await expect( - escrowClient.storeResults(escrowAddress, url, hash) + escrowClient.storeResults(escrowAddress, url, hash, amount) ).rejects.toThrow(ErrorInvalidUrl); }); @@ -764,18 +770,33 @@ describe('EscrowClient', () => { const escrowAddress = ethers.ZeroAddress; const url = VALID_URL; const hash = ''; + const amount = FAKE_AMOUNT; escrowClient.escrowFactoryContract.hasEscrow.mockReturnValue(true); await expect( - escrowClient.storeResults(escrowAddress, url, hash) + escrowClient.storeResults(escrowAddress, url, hash, amount) ).rejects.toThrow(ErrorHashIsEmptyString); }); + test('should throw an error if amount is invalid', async () => { + const escrowAddress = ethers.ZeroAddress; + const url = VALID_URL; + const hash = FAKE_HASH; + const amount = -10; + + escrowClient.escrowFactoryContract.hasEscrow.mockReturnValue(true); + + await expect( + escrowClient.storeResults(escrowAddress, url, hash, amount) + ).rejects.toThrow(ErrorAmountMustBePositive); + }); + test('should successfully store results', async () => { const escrowAddress = ethers.ZeroAddress; const url = VALID_URL; const hash = FAKE_HASH; + const amount = FAKE_AMOUNT; escrowClient.escrowFactoryContract.hasEscrow.mockReturnValue(true); const storeResultsSpy = vi @@ -784,15 +805,16 @@ describe('EscrowClient', () => { wait: vi.fn().mockResolvedValue(true), })); - await escrowClient.storeResults(escrowAddress, url, hash); + await escrowClient.storeResults(escrowAddress, url, hash, amount); - expect(storeResultsSpy).toHaveBeenCalledWith(url, hash, {}); + expect(storeResultsSpy).toHaveBeenCalledWith(url, hash, amount, {}); }); test('should throw an error if the store results fails', async () => { const escrowAddress = ethers.ZeroAddress; const url = VALID_URL; const hash = FAKE_HASH; + const amount = FAKE_AMOUNT; escrowClient.escrowFactoryContract.hasEscrow.mockReturnValue(true); escrowClient.escrowContract.storeResults.mockRejectedValueOnce( @@ -800,12 +822,13 @@ describe('EscrowClient', () => { ); await expect( - escrowClient.storeResults(escrowAddress, url, hash) + escrowClient.storeResults(escrowAddress, url, hash, amount) ).rejects.toThrow(); expect(escrowClient.escrowContract.storeResults).toHaveBeenCalledWith( url, hash, + amount, {} ); }); @@ -814,6 +837,7 @@ describe('EscrowClient', () => { const escrowAddress = ethers.ZeroAddress; const url = VALID_URL; const hash = FAKE_HASH; + const amount = FAKE_AMOUNT; escrowClient.escrowFactoryContract.hasEscrow.mockReturnValue(true); const storeResultsSpy = vi @@ -823,9 +847,20 @@ describe('EscrowClient', () => { })); const txOptions: Overrides = { gasLimit: 45000 }; - await escrowClient.storeResults(escrowAddress, url, hash, txOptions); + await escrowClient.storeResults( + escrowAddress, + url, + hash, + amount, + txOptions + ); - expect(storeResultsSpy).toHaveBeenCalledWith(url, hash, txOptions); + expect(storeResultsSpy).toHaveBeenCalledWith( + url, + hash, + amount, + txOptions + ); }); }); From ee21c4d174c6dfa57e32671b8e2c09f80b8787a1 Mon Sep 17 00:00:00 2001 From: portuu3 <61605646+portuu3@users.noreply.github.com> Date: Wed, 21 May 2025 13:57:56 +0200 Subject: [PATCH 07/18] Fix escrow payouts (#3261) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix payouts when fee calculation is truncated * fix tests and use faker in the root of the repository * document escrow contract and improve tests * Delete unnecessary check for BULK_MAX_VALUE * remove unused modifier * Undo faker package changes for updating yarn --------- Co-authored-by: Francisco López --- .../apps/job-launcher/server/package.json | 2 +- .../reputation-oracle/server/package.json | 2 +- packages/core/contracts/Escrow.sol | 199 ++++--- packages/core/package.json | 1 + packages/core/test/Escrow-USDT.ts | 62 +- packages/core/test/Escrow.ts | 531 +++++++++--------- 6 files changed, 440 insertions(+), 357 deletions(-) diff --git a/packages/apps/job-launcher/server/package.json b/packages/apps/job-launcher/server/package.json index 11f11e9a82..d4fb740efc 100644 --- a/packages/apps/job-launcher/server/package.json +++ b/packages/apps/job-launcher/server/package.json @@ -70,7 +70,7 @@ "zxcvbn": "^4.4.2" }, "devDependencies": { - "@faker-js/faker": "^9.5.0", + "@faker-js/faker": "^9.8.0", "@golevelup/ts-jest": "^0.6.1", "@nestjs/cli": "^10.3.2", "@nestjs/schematics": "^11.0.2", diff --git a/packages/apps/reputation-oracle/server/package.json b/packages/apps/reputation-oracle/server/package.json index 2ebd5736bb..e203f501ba 100644 --- a/packages/apps/reputation-oracle/server/package.json +++ b/packages/apps/reputation-oracle/server/package.json @@ -72,7 +72,7 @@ "zxcvbn": "^4.4.2" }, "devDependencies": { - "@faker-js/faker": "^9.4.0", + "@faker-js/faker": "^9.8.0", "@golevelup/ts-jest": "^0.6.1", "@nestjs/cli": "^10.3.2", "@nestjs/schematics": "^11.0.2", diff --git a/packages/core/contracts/Escrow.sol b/packages/core/contracts/Escrow.sol index 4ef4096557..1c3866431d 100644 --- a/packages/core/contracts/Escrow.sol +++ b/packages/core/contracts/Escrow.sol @@ -8,13 +8,18 @@ import '@openzeppelin/contracts/utils/ReentrancyGuard.sol'; import './interfaces/IEscrow.sol'; +/** + * @title Escrow Contract + * @dev This contract manages the lifecycle of an escrow, including funding, + * setup, payouts, and completion. It supports trusted handlers and oracles + * for managing the escrow process. + */ contract Escrow is IEscrow, ReentrancyGuard { bytes4 private constant FUNC_SELECTOR_BALANCE_OF = bytes4(keccak256('balanceOf(address)')); string constant ERROR_ZERO_ADDRESS = 'Escrow: zero address'; - uint256 private constant BULK_MAX_VALUE = 1e9 * (10 ** 18); uint32 private constant BULK_MAX_COUNT = 100; event TrustedHandlerAdded(address _handler); @@ -73,9 +78,16 @@ contract Escrow is IEscrow, ReentrancyGuard { mapping(address => bool) public areTrustedHandlers; uint256 public remainingFunds; - uint256 public reservedFunds; + /** + * @dev Constructor to initialize the escrow contract. + * @param _token Address of the token used in the escrow. + * @param _launcher Address of the launcher (creator) of the escrow. + * @param _canceler Address of the canceler who can cancel the escrow. + * @param _duration Duration of the escrow in seconds. + * @param _handlers Array of trusted handler addresses. + */ constructor( address _token, address _launcher, @@ -97,10 +109,17 @@ contract Escrow is IEscrow, ReentrancyGuard { _addTrustedHandlers(_handlers); } + /** + * @dev Returns the balance of the escrow contract for the main token. + */ function getBalance() public view returns (uint256) { return getTokenBalance(token); } + /** + * @dev Returns the balance of the escrow contract for a specific token. + * @param _token Address of the token to check the balance for. + */ function getTokenBalance(address _token) public view returns (uint256) { (bool success, bytes memory returnData) = _token.staticcall( abi.encodeWithSelector(FUNC_SELECTOR_BALANCE_OF, address(this)) @@ -108,12 +127,20 @@ contract Escrow is IEscrow, ReentrancyGuard { return success ? abi.decode(returnData, (uint256)) : 0; } + /** + * @dev Adds trusted handlers to the contract. + * @param _handlers Array of addresses to be added as trusted handlers. + */ function addTrustedHandlers( address[] memory _handlers ) public override trusted { _addTrustedHandlers(_handlers); } + /** + * @dev Internal function to add trusted handlers. + * @param _handlers Array of addresses to be added as trusted handlers. + */ function _addTrustedHandlers(address[] memory _handlers) internal { for (uint256 i = 0; i < _handlers.length; i++) { require(_handlers[i] != address(0), ERROR_ZERO_ADDRESS); @@ -122,9 +149,17 @@ contract Escrow is IEscrow, ReentrancyGuard { } } - // The escrower puts the Token in the contract without an agentless - // and assigsn a reputation oracle to payout the bounty of size of the - // amount specified + /** + * @dev Sets up the escrow with oracles and manifest details. + * @param _reputationOracle Address of the reputation oracle. + * @param _recordingOracle Address of the recording oracle. + * @param _exchangeOracle Address of the exchange oracle. + * @param _reputationOracleFeePercentage Fee percentage for the reputation oracle. + * @param _recordingOracleFeePercentage Fee percentage for the recording oracle. + * @param _exchangeOracleFeePercentage Fee percentage for the exchange oracle. + * @param _url URL of the manifest. + * @param _hash Hash of the manifest. + */ function setup( address _reputationOracle, address _recordingOracle, @@ -182,6 +217,10 @@ contract Escrow is IEscrow, ReentrancyGuard { emit Fund(remainingFunds); } + /** + * @dev Cancels the escrow and transfers remaining funds to the canceler. + * @return bool indicating success of the cancellation. + */ function cancel() public override @@ -195,6 +234,11 @@ contract Escrow is IEscrow, ReentrancyGuard { return true; } + /** + * @dev Withdraws excess funds from the escrow for a specific token. + * @param _token Address of the token to withdraw. + * @return bool indicating success of the withdrawal. + */ function withdraw( address _token ) public override trusted nonReentrant returns (bool) { @@ -213,15 +257,18 @@ contract Escrow is IEscrow, ReentrancyGuard { return true; } + /** + * @dev Completes the escrow, transferring remaining funds to the launcher. + */ function complete() external override notExpired trustedOrReputationOracle { require( status == EscrowStatuses.Paid || status == EscrowStatuses.Partial, 'Escrow not in Paid or Partial state' ); - _complete(); + _finalize(); } - function _complete() private { + function _finalize() private { if (remainingFunds > 0) { _safeTransfer(token, launcher, remainingFunds); remainingFunds = 0; @@ -236,6 +283,11 @@ contract Escrow is IEscrow, ReentrancyGuard { } } + /** + * @dev Stores intermediate results during the escrow process. + * @param _url URL of the intermediate results. + * @param _hash Hash of the intermediate results. + */ function storeResults( string memory _url, string memory _hash, @@ -270,22 +322,13 @@ contract Escrow is IEscrow, ReentrancyGuard { } /** - * @dev Performs bulk payout to multiple workers - * Escrow needs to be completed / cancelled, so that it can be paid out. - * Every recipient is paid with the amount after reputation and recording oracle fees taken out. - * If the amount is less than the fee, the recipient is not paid. - * If the fee is zero, reputation, and recording oracle are not paid. - * Payout will fail if any of the transaction fails. - * If the escrow is fully paid out, meaning that the balance of the escrow is 0, it'll set as Paid. - * If the escrow is partially paid out, meaning that the escrow still has remaining balance, it'll set as Partial. - * This contract is only callable if the contract is not broke, not launched, not paid, not expired, by trusted parties. - * - * @param _recipients Array of recipients + * @dev Performs bulk payout to multiple recipients with oracle fees deducted. + * @param _recipients Array of recipient addresses. * @param _amounts Array of amounts to be paid to each recipient. - * @param _url URL storing results as transaction details - * @param _hash Hash of the results - * @param _txId Transaction ID - * @param forceComplete Boolean parameter indicating if remaining balance should be transferred to the escrow creator + * @param _url URL storing results as transaction details. + * @param _hash Hash of the results. + * @param _txId Transaction ID. + * @param forceComplete Boolean indicating if remaining balance should be transferred to the launcher. */ function bulkPayOut( address[] memory _recipients, @@ -314,60 +357,80 @@ contract Escrow is IEscrow, ReentrancyGuard { status != EscrowStatuses.Cancelled, 'Invalid status' ); - - uint256 aggregatedBulkAmount = 0; - for (uint256 i = 0; i < _amounts.length; i++) { - uint256 amount = _amounts[i]; - require(amount > 0, 'Amount should be greater than zero'); - aggregatedBulkAmount += amount; - } - require(aggregatedBulkAmount < BULK_MAX_VALUE, 'Bulk value too high'); require( - aggregatedBulkAmount <= reservedFunds, - 'Not enough reserved funds' + bytes(_url).length != 0 && bytes(_hash).length != 0, + 'URL or hash is empty' ); - reservedFunds -= aggregatedBulkAmount; - remainingFunds -= aggregatedBulkAmount; - - require(bytes(_url).length != 0, "URL can't be empty"); - require(bytes(_hash).length != 0, "Hash can't be empty"); + uint256 totalBulkAmount = 0; + uint256 totalReputationOracleFee = 0; + uint256 totalRecordingOracleFee = 0; + uint256 totalExchangeOracleFee = 0; - finalResultsUrl = _url; - finalResultsHash = _hash; + for (uint256 i = 0; i < _recipients.length; i++) { + uint256 amount = _amounts[i]; + require(amount > 0, 'Amount should be greater than zero'); + totalBulkAmount += amount; + totalReputationOracleFee += + (reputationOracleFeePercentage * amount) / + 100; + totalRecordingOracleFee += + (recordingOracleFeePercentage * amount) / + 100; + totalExchangeOracleFee += + (exchangeOracleFeePercentage * amount) / + 100; + } + require(totalBulkAmount <= reservedFunds, 'Not enough reserved funds'); - uint256 totalFeePercentage = reputationOracleFeePercentage + - recordingOracleFeePercentage + - exchangeOracleFeePercentage; + uint256 paidReputation = 0; + uint256 paidRecording = 0; + uint256 paidExchange = 0; for (uint256 i = 0; i < _recipients.length; i++) { uint256 amount = _amounts[i]; - uint256 amountFee = (totalFeePercentage * amount) / 100; - _safeTransfer(token, _recipients[i], amount - amountFee); - } + uint256 reputationOracleFee = (reputationOracleFeePercentage * + amount) / 100; + uint256 recordingOracleFee = (recordingOracleFeePercentage * + amount) / 100; + uint256 exchangeOracleFee = (exchangeOracleFeePercentage * amount) / + 100; + + if (i == _recipients.length - 1) { + reputationOracleFee = totalReputationOracleFee - paidReputation; + recordingOracleFee = totalRecordingOracleFee - paidRecording; + exchangeOracleFee = totalExchangeOracleFee - paidExchange; + } + + paidReputation += reputationOracleFee; + paidRecording += recordingOracleFee; + paidExchange += exchangeOracleFee; - // Transfer oracle fees - if (reputationOracleFeePercentage > 0) { _safeTransfer( token, - reputationOracle, - (reputationOracleFeePercentage * aggregatedBulkAmount) / 100 + _recipients[i], + amount - + reputationOracleFee - + recordingOracleFee - + exchangeOracleFee ); } + + // Transfer oracle fees + if (reputationOracleFeePercentage > 0) { + _safeTransfer(token, reputationOracle, totalReputationOracleFee); + } if (recordingOracleFeePercentage > 0) { - _safeTransfer( - token, - recordingOracle, - (recordingOracleFeePercentage * aggregatedBulkAmount) / 100 - ); + _safeTransfer(token, recordingOracle, totalRecordingOracleFee); } if (exchangeOracleFeePercentage > 0) { - _safeTransfer( - token, - exchangeOracle, - (exchangeOracleFeePercentage * aggregatedBulkAmount) / 100 - ); + _safeTransfer(token, exchangeOracle, totalExchangeOracleFee); } + remainingFunds -= totalBulkAmount; + reservedFunds -= totalBulkAmount; + + finalResultsUrl = _url; + finalResultsHash = _hash; if (remainingFunds == 0 || forceComplete) { emit BulkTransferV2( @@ -377,7 +440,7 @@ contract Escrow is IEscrow, ReentrancyGuard { false, finalResultsUrl ); - _complete(); + _finalize(); } else { if (status != EscrowStatuses.ToCancel) { status = EscrowStatuses.Partial; @@ -394,13 +457,11 @@ contract Escrow is IEscrow, ReentrancyGuard { /** * @dev Overloaded function to perform bulk payout with default forceComplete set to false. - * Calls the main bulkPayout function with forceComplete as false. - * - * @param _recipients Array of recipients + * @param _recipients Array of recipient addresses. * @param _amounts Array of amounts to be paid to each recipient. - * @param _url URL storing results as transaction details - * @param _hash Hash of the results - * @param _txId Transaction ID + * @param _url URL storing results as transaction details. + * @param _hash Hash of the results. + * @param _txId Transaction ID. */ function bulkPayOut( address[] memory _recipients, @@ -412,6 +473,12 @@ contract Escrow is IEscrow, ReentrancyGuard { bulkPayOut(_recipients, _amounts, _url, _hash, _txId, false); } + /** + * @dev Internal function to safely transfer tokens. + * @param _token Address of the token to transfer. + * @param to Address of the recipient. + * @param value Amount to transfer. + */ function _safeTransfer(address _token, address to, uint256 value) internal { SafeERC20.safeTransfer(IERC20(_token), to, value); } diff --git a/packages/core/package.json b/packages/core/package.json index 1d41ca699f..eff69bc410 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -51,6 +51,7 @@ ], "license": "MIT", "devDependencies": { + "@faker-js/faker": "^9.8.0", "@nomicfoundation/hardhat-chai-matchers": "^2.0.7", "@nomicfoundation/hardhat-ethers": "^3.0.5", "@nomicfoundation/hardhat-network-helpers": "^1.0.12", diff --git a/packages/core/test/Escrow-USDT.ts b/packages/core/test/Escrow-USDT.ts index 35a3ecd39a..7c3fefa4f4 100644 --- a/packages/core/test/Escrow-USDT.ts +++ b/packages/core/test/Escrow-USDT.ts @@ -592,7 +592,7 @@ describe('Escrow with USDT', function () { }); it('Should revert with the right error if address calling is not trusted', async function () { - const recepients = [await restAccounts[0].getAddress()]; + const recipients = [await restAccounts[0].getAddress()]; const amounts = [10]; await expect( @@ -600,12 +600,12 @@ describe('Escrow with USDT', function () { .connect(externalAddress) [ 'bulkPayOut(address[],uint256[],string,string,uint256)' - ](recepients, amounts, MOCK_URL, MOCK_HASH, '000') + ](recipients, amounts, MOCK_URL, MOCK_HASH, '000') ).to.be.revertedWith('Address calling not trusted'); }); it('Should revert with the right error if address calling is recording oracle', async function () { - const recepients = [await restAccounts[0].getAddress()]; + const recipients = [await restAccounts[0].getAddress()]; const amounts = [10]; await expect( @@ -613,12 +613,12 @@ describe('Escrow with USDT', function () { .connect(recordingOracle) [ 'bulkPayOut(address[],uint256[],string,string,uint256)' - ](recepients, amounts, MOCK_URL, MOCK_HASH, '000') + ](recipients, amounts, MOCK_URL, MOCK_HASH, '000') ).to.be.revertedWith('Address calling not trusted'); }); it('Should revert with the right error if amount of recipients more then amount of values', async function () { - const recepients = [ + const recipients = [ await restAccounts[0].getAddress(), await restAccounts[1].getAddress(), await restAccounts[2].getAddress(), @@ -630,12 +630,12 @@ describe('Escrow with USDT', function () { .connect(reputationOracle) [ 'bulkPayOut(address[],uint256[],string,string,uint256)' - ](recepients, amounts, MOCK_URL, MOCK_HASH, '000') + ](recipients, amounts, MOCK_URL, MOCK_HASH, '000') ).to.be.revertedWith("Amount of recipients and values don't match"); }); it('Should revert with the right error if amount of recipients less then amount of values', async function () { - const recepients = [ + const recipients = [ await restAccounts[0].getAddress(), await restAccounts[1].getAddress(), ]; @@ -646,12 +646,12 @@ describe('Escrow with USDT', function () { .connect(reputationOracle) [ 'bulkPayOut(address[],uint256[],string,string,uint256)' - ](recepients, amounts, MOCK_URL, MOCK_HASH, '000') + ](recipients, amounts, MOCK_URL, MOCK_HASH, '000') ).to.be.revertedWith("Amount of recipients and values don't match"); }); it('Should revert with the right error if too many recipients', async function () { - const recepients = Array.from( + const recipients = Array.from( new Array(BULK_MAX_COUNT + 1), () => ethers.ZeroAddress ); @@ -662,7 +662,7 @@ describe('Escrow with USDT', function () { .connect(reputationOracle) [ 'bulkPayOut(address[],uint256[],string,string,uint256)' - ](recepients, amounts, MOCK_URL, MOCK_HASH, '000') + ](recipients, amounts, MOCK_URL, MOCK_HASH, '000') ).to.be.revertedWith('Too many recipients'); }); @@ -693,18 +693,18 @@ describe('Escrow with USDT', function () { }); it('Should emit bulkPayOut and Completed events for complete bulkPayOut', async function () { - const recepients = [await restAccounts[0].getAddress()]; + const recipients = [await restAccounts[0].getAddress()]; const amounts = [100]; const tx = await escrow .connect(owner) [ 'bulkPayOut(address[],uint256[],string,string,uint256)' - ](recepients, amounts, MOCK_URL, MOCK_HASH, '000'); + ](recipients, amounts, MOCK_URL, MOCK_HASH, '000'); await expect(tx) .to.emit(escrow, 'BulkTransferV2') - .withArgs(anyValue, recepients, [100], false, MOCK_URL); + .withArgs(anyValue, recipients, [100], false, MOCK_URL); await expect(tx).to.emit(escrow, 'Completed'); }); @@ -729,35 +729,35 @@ describe('Escrow with USDT', function () { }); it('Should emit only bulkPayOut event for partial bulkPayOut', async function () { - const recepients = [await restAccounts[0].getAddress()]; + const recipients = [await restAccounts[0].getAddress()]; const amounts = [10]; const tx = await escrow .connect(owner) [ 'bulkPayOut(address[],uint256[],string,string,uint256)' - ](recepients, amounts, MOCK_URL, MOCK_HASH, '000'); + ](recipients, amounts, MOCK_URL, MOCK_HASH, '000'); await expect(tx) .to.emit(escrow, 'BulkTransferV2') - .withArgs(anyValue, recepients, [10], true, MOCK_URL); + .withArgs(anyValue, recipients, [10], true, MOCK_URL); await expect(tx).not.to.emit(escrow, 'Completed'); }); it('Should emit bulkPayOut and Completed events for partial bulkPayOut with forceComplete option', async function () { - const recepients = [await restAccounts[0].getAddress()]; + const recipients = [await restAccounts[0].getAddress()]; const amounts = [10]; const tx = await escrow .connect(owner) [ 'bulkPayOut(address[],uint256[],string,string,uint256,bool)' - ](recepients, amounts, MOCK_URL, MOCK_HASH, '000', true); + ](recipients, amounts, MOCK_URL, MOCK_HASH, '000', true); await expect(tx) .to.emit(escrow, 'BulkTransferV2') - .withArgs(anyValue, recepients, [10], false, MOCK_URL); + .withArgs(anyValue, recipients, [10], false, MOCK_URL); await expect(tx).to.emit(escrow, 'Completed'); }); @@ -814,14 +814,14 @@ describe('Escrow with USDT', function () { .connect(owner) .balanceOf(await exchangeOracle.getAddress()); - const recepients = [account1, account2, account3]; + const recipients = [account1, account2, account3]; const amounts = [10, 20, 30]; await escrow .connect(reputationOracle) [ 'bulkPayOut(address[],uint256[],string,string,uint256)' - ](recepients, amounts, MOCK_URL, MOCK_HASH, '000'); + ](recipients, amounts, MOCK_URL, MOCK_HASH, '000'); const finalBalanceAccount1 = await usdt .connect(owner) @@ -896,14 +896,14 @@ describe('Escrow with USDT', function () { .connect(owner) .balanceOf(await exchangeOracle.getAddress()); - const recepients = [account1, account2, account3]; + const recipients = [account1, account2, account3]; const amounts = [10, 20, 30]; await escrow .connect(reputationOracle) [ 'bulkPayOut(address[],uint256[],string,string,uint256,bool)' - ](recepients, amounts, MOCK_URL, MOCK_HASH, '000', true); + ](recipients, amounts, MOCK_URL, MOCK_HASH, '000', true); const finalBalanceAccount1 = await usdt .connect(owner) @@ -958,7 +958,7 @@ describe('Escrow with USDT', function () { }); it('Should runs from setup to bulkPayOut to complete correctly', async () => { - const recepients = [await restAccounts[3].getAddress()]; + const recipients = [await restAccounts[3].getAddress()]; const amounts = [100]; expect(await escrow.status()).to.equal(Status.Pending); @@ -967,12 +967,12 @@ describe('Escrow with USDT', function () { .connect(reputationOracle) [ 'bulkPayOut(address[],uint256[],string,string,uint256)' - ](recepients, amounts, MOCK_URL, MOCK_HASH, '000'); + ](recipients, amounts, MOCK_URL, MOCK_HASH, '000'); expect(await escrow.status()).to.equal(Status.Complete); }); it('Should runs from setup to bulkPayOut to complete correctly with multiple addresses', async () => { - const recepients = [ + const recipients = [ await restAccounts[3].getAddress(), await restAccounts[4].getAddress(), await restAccounts[5].getAddress(), @@ -985,7 +985,7 @@ describe('Escrow with USDT', function () { .connect(reputationOracle) [ 'bulkPayOut(address[],uint256[],string,string,uint256)' - ](recepients, amounts, MOCK_URL, MOCK_HASH, '000'); + ](recipients, amounts, MOCK_URL, MOCK_HASH, '000'); expect(await escrow.status()).to.equal(Status.Complete); }); @@ -1010,7 +1010,7 @@ describe('Escrow with USDT', function () { }); it('Should runs from setup to bulkPayOut to partial correctly', async () => { - const recepients = [await restAccounts[3].getAddress()]; + const recipients = [await restAccounts[3].getAddress()]; const amounts = [80]; expect(await escrow.status()).to.equal(Status.Pending); @@ -1019,7 +1019,7 @@ describe('Escrow with USDT', function () { .connect(reputationOracle) [ 'bulkPayOut(address[],uint256[],string,string,uint256)' - ](recepients, amounts, MOCK_URL, MOCK_HASH, '000'); + ](recipients, amounts, MOCK_URL, MOCK_HASH, '000'); expect(await escrow.status()).to.equal(Status.Partial); }); @@ -1040,7 +1040,7 @@ describe('Escrow with USDT', function () { }); it('Should runs from setup to bulkPayOut to partial correctly with multiple addresses', async () => { - const recepients = [ + const recipients = [ await restAccounts[3].getAddress(), await restAccounts[4].getAddress(), await restAccounts[5].getAddress(), @@ -1053,7 +1053,7 @@ describe('Escrow with USDT', function () { .connect(reputationOracle) [ 'bulkPayOut(address[],uint256[],string,string,uint256)' - ](recepients, amounts, MOCK_URL, MOCK_HASH, '000'); + ](recipients, amounts, MOCK_URL, MOCK_HASH, '000'); expect(await escrow.status()).to.equal(Status.Partial); }); }); diff --git a/packages/core/test/Escrow.ts b/packages/core/test/Escrow.ts index 4ddbf8ed8e..1a65033cb1 100644 --- a/packages/core/test/Escrow.ts +++ b/packages/core/test/Escrow.ts @@ -4,9 +4,10 @@ import { expect } from 'chai'; import { ethers } from 'hardhat'; import { EventLog, Signer } from 'ethers'; import { Escrow, HMToken } from '../typechain-types'; +import { faker } from '@faker-js/faker'; -const MOCK_URL = 'http://google.com/fake'; -const MOCK_HASH = 'kGKmnj9BRf'; +const MOCK_URL = faker.internet.url(); +const MOCK_HASH = faker.string.alphanumeric(10); const BULK_MAX_COUNT = 100; enum Status { @@ -51,27 +52,30 @@ async function setupEscrow() { await reputationOracle.getAddress(), await recordingOracle.getAddress(), await exchangeOracle.getAddress(), - 10, - 10, - 10, + 3, + 3, + 3, MOCK_URL, MOCK_HASH ); } -async function fundEscrow() { - const amount = 100; +async function fundEscrow(): Promise { + const amount = ethers.parseEther( + faker.number.int({ min: 50, max: 200 }).toString() + ); await token.connect(owner).transfer(escrow.getAddress(), amount); + return amount; } -async function storeResults(amount = 50) { +async function storeResults(amount: bigint) { await escrow .connect(restAccounts[0]) .storeResults(MOCK_URL, MOCK_HASH, amount); } describe('Escrow', function () { - this.beforeAll(async () => { + before(async () => { [ owner, launcher, @@ -127,7 +131,9 @@ describe('Escrow', function () { }); it('Should topup and return the right escrow balance', async () => { - const amount = 1000; + const amount = ethers.parseEther( + faker.number.int({ min: 500, max: 2000 }).toString() + ); await token.connect(owner).transfer(escrow.getAddress(), amount); const result = await escrow.connect(launcher).getBalance(); @@ -230,7 +236,7 @@ describe('Escrow', function () { }); it('Should revert with the right error if amount is higher than unreserved funds', async function () { - await fundEscrow(); + const fundAmount = await fundEscrow(); await setupEscrow(); await escrow @@ -239,7 +245,7 @@ describe('Escrow', function () { await expect( escrow .connect(reputationOracle) - .storeResults(MOCK_URL, MOCK_HASH, 150) + .storeResults(MOCK_URL, MOCK_HASH, fundAmount * 2n) ).to.be.revertedWith('Not enough unreserved funds'); }); }); @@ -261,9 +267,10 @@ describe('Escrow', function () { }); describe('Store results', async function () { + let fundAmount: bigint; beforeEach(async () => { await deployEscrow(); - await fundEscrow(); + fundAmount = await fundEscrow(); await setupEscrow(); }); @@ -271,10 +278,11 @@ describe('Escrow', function () { const initialOwnerBalance = await token .connect(owner) .balanceOf(launcher.getAddress()); + const result = await ( await escrow .connect(recordingOracle) - .storeResults(MOCK_URL, MOCK_HASH, 50) + .storeResults(MOCK_URL, MOCK_HASH, fundAmount / 2n) ).wait(); const finalOwnerBalance = await token @@ -283,8 +291,8 @@ describe('Escrow', function () { expect((result?.logs[0] as EventLog).args).to.contain(MOCK_URL); expect((result?.logs[0] as EventLog).args).to.contain(MOCK_HASH); expect(finalOwnerBalance - initialOwnerBalance).to.equal(0); - expect(await escrow.remainingFunds()).to.equal(100); - expect(await escrow.reservedFunds()).to.equal(50); + expect(await escrow.remainingFunds()).to.equal(fundAmount); + expect(await escrow.reservedFunds()).to.equal(fundAmount / 2n); }); it('Should succeed when a trusted handler stores results', async () => { @@ -294,7 +302,7 @@ describe('Escrow', function () { const result = await ( await escrow .connect(trustedHandlers[0]) - .storeResults(MOCK_URL, MOCK_HASH, 50) + .storeResults(MOCK_URL, MOCK_HASH, fundAmount / 2n) ).wait(); const finalOwnerBalance = await token @@ -303,8 +311,8 @@ describe('Escrow', function () { expect((result?.logs[0] as EventLog).args).to.contain(MOCK_URL); expect((result?.logs[0] as EventLog).args).to.contain(MOCK_HASH); expect(finalOwnerBalance - initialOwnerBalance).to.equal(0); - expect(await escrow.remainingFunds()).to.equal(100); - expect(await escrow.reservedFunds()).to.equal(50); + expect(await escrow.remainingFunds()).to.equal(fundAmount); + expect(await escrow.reservedFunds()).to.equal(fundAmount / 2n); }); it('Should return unreserved funds to escrow launcher when status is ToCancel', async () => { @@ -315,7 +323,7 @@ describe('Escrow', function () { const result = await ( await escrow .connect(recordingOracle) - .storeResults(MOCK_URL, MOCK_HASH, 50) + .storeResults(MOCK_URL, MOCK_HASH, fundAmount / 2n) ).wait(); expect((result?.logs[0] as EventLog).args).to.contain(MOCK_URL); @@ -323,9 +331,11 @@ describe('Escrow', function () { const finalOwnerBalance = await token .connect(owner) .balanceOf(launcher.getAddress()); - expect(finalOwnerBalance - initialOwnerBalance).to.equal(50); - expect(await escrow.remainingFunds()).to.equal(50); - expect(await escrow.reservedFunds()).to.equal(50); + expect(finalOwnerBalance - initialOwnerBalance).to.equal( + fundAmount / 2n + ); + expect(await escrow.remainingFunds()).to.equal(fundAmount / 2n); + expect(await escrow.reservedFunds()).to.equal(fundAmount / 2n); }); }); }); @@ -423,9 +433,10 @@ describe('Escrow', function () { }); describe('Events', function () { + let fundAmount: bigint; before(async () => { await deployEscrow(); - await fundEscrow(); + fundAmount = await fundEscrow(); }); it('Should emit an event on pending', async function () { @@ -452,7 +463,7 @@ describe('Escrow', function () { await exchangeOracle.getAddress() ) .to.emit(escrow, 'Fund') - .withArgs(100); + .withArgs(fundAmount); }); }); @@ -524,15 +535,15 @@ describe('Escrow', function () { describe('Validations', function () { before(async () => { await deployEscrow(); - await fundEscrow(); + const fundAmount = await fundEscrow(); await setupEscrow(); - await storeResults(100); + await storeResults(fundAmount); await escrow .connect(owner) [ 'bulkPayOut(address[],uint256[],string,string,uint256)' - ]([await restAccounts[0].getAddress()], [100], MOCK_URL, MOCK_HASH, '000'); + ]([await restAccounts[0].getAddress()], [fundAmount], MOCK_URL, MOCK_HASH, '000'); }); it('Should revert with the right error if address calling not trusted', async function () { @@ -589,74 +600,86 @@ describe('Escrow', function () { describe('bulkPayOut', () => { describe('Validations', function () { + let fundAmount: bigint; before(async () => { await deployEscrow(); - await fundEscrow(); + fundAmount = await fundEscrow(); await setupEscrow(); - await storeResults(); + await storeResults(fundAmount); }); it('Should revert with the right error if address calling is not trusted', async function () { - const recepients = [await restAccounts[0].getAddress()]; - const amounts = [10]; + const recipients = [await restAccounts[0].getAddress()]; + const amounts = [ + fundAmount / 4n, //1/4 + ]; await expect( escrow .connect(externalAddress) [ 'bulkPayOut(address[],uint256[],string,string,uint256)' - ](recepients, amounts, MOCK_URL, MOCK_HASH, '000') + ](recipients, amounts, MOCK_URL, MOCK_HASH, '000') ).to.be.revertedWith('Address calling not trusted'); }); it('Should revert with the right error if address calling is recording oracle', async function () { - const recepients = [await restAccounts[0].getAddress()]; - const amounts = [10]; + const recipients = [await restAccounts[0].getAddress()]; + const amounts = [ + fundAmount / 4n, //1/4 + ]; await expect( escrow .connect(recordingOracle) [ 'bulkPayOut(address[],uint256[],string,string,uint256)' - ](recepients, amounts, MOCK_URL, MOCK_HASH, '000') + ](recipients, amounts, MOCK_URL, MOCK_HASH, '000') ).to.be.revertedWith('Address calling not trusted'); }); it('Should revert with the right error if amount of recipients more then amount of values', async function () { - const recepients = [ + const recipients = [ await restAccounts[0].getAddress(), await restAccounts[1].getAddress(), await restAccounts[2].getAddress(), ]; - const amounts = [10, 20]; + const amounts = [ + fundAmount / 4n, //1/4 + fundAmount / 2n, //1/2 + ]; await expect( escrow .connect(reputationOracle) [ 'bulkPayOut(address[],uint256[],string,string,uint256)' - ](recepients, amounts, MOCK_URL, MOCK_HASH, '000') + ](recipients, amounts, MOCK_URL, MOCK_HASH, '000') ).to.be.revertedWith("Amount of recipients and values don't match"); }); it('Should revert with the right error if amount of recipients less then amount of values', async function () { - const recepients = [ + const recipients = [ await restAccounts[0].getAddress(), await restAccounts[1].getAddress(), ]; - const amounts = [10, 20, 30]; + const amounts = [ + fundAmount / 4n, //1/4 + fundAmount / 2n, //1/2 + fundAmount / 4n, //1/4 + ]; await expect( escrow .connect(reputationOracle) [ 'bulkPayOut(address[],uint256[],string,string,uint256)' - ](recepients, amounts, MOCK_URL, MOCK_HASH, '000') + ](recipients, amounts, MOCK_URL, MOCK_HASH, '000') ).to.be.revertedWith("Amount of recipients and values don't match"); }); it('Should revert with the right error if too many recipients', async function () { - const recepients = Array.from( + const recipients = Array.from( new Array(BULK_MAX_COUNT + 1), () => ethers.ZeroAddress ); @@ -667,56 +690,61 @@ describe('Escrow', function () { .connect(reputationOracle) [ 'bulkPayOut(address[],uint256[],string,string,uint256)' - ](recepients, amounts, MOCK_URL, MOCK_HASH, '000') + ](recipients, amounts, MOCK_URL, MOCK_HASH, '000') ).to.be.revertedWith('Too many recipients'); }); it('Should revert with the right error if trying to payout more than reservedFunds', async function () { - const recepients = [ + const recipients = [ await restAccounts[0].getAddress(), await restAccounts[1].getAddress(), await restAccounts[2].getAddress(), ]; - const amounts = [10, 20, 30]; + const amounts = [ + fundAmount / 4n, //1/4 + fundAmount / 2n, //1/2 + fundAmount / 2n, //1/2 + ]; await expect( escrow .connect(reputationOracle) [ 'bulkPayOut(address[],uint256[],string,string,uint256)' - ](recepients, amounts, MOCK_URL, MOCK_HASH, '000') + ](recipients, amounts, MOCK_URL, MOCK_HASH, '000') ).to.be.revertedWith('Not enough reserved funds'); }); }); describe('Events', function () { + let fundAmount: bigint; beforeEach(async () => { await deployEscrow(); - await fundEscrow(); + fundAmount = await fundEscrow(); await setupEscrow(); - await storeResults(100); + await storeResults(fundAmount); }); it('Should emit bulkPayOut and Completed events for complete bulkPayOut', async function () { - const recepients = [await restAccounts[0].getAddress()]; - const amounts = [100]; + const recipients = [await restAccounts[0].getAddress()]; + const amounts = [fundAmount]; const tx = await escrow .connect(owner) [ 'bulkPayOut(address[],uint256[],string,string,uint256)' - ](recepients, amounts, MOCK_URL, MOCK_HASH, '000'); + ](recipients, amounts, MOCK_URL, MOCK_HASH, '000'); await expect(tx) .to.emit(escrow, 'BulkTransferV2') - .withArgs(anyValue, recepients, [100], false, MOCK_URL); + .withArgs(anyValue, recipients, [fundAmount], false, MOCK_URL); await expect(tx).to.emit(escrow, 'Completed'); }); it('Should emit bulkPayOut and Cancelled events for complete bulkPayOut with ToCancel status', async function () { - const recepients = [await restAccounts[0].getAddress()]; - const amounts = [100]; + const recipients = [await restAccounts[0].getAddress()]; + const amounts = [fundAmount]; await escrow.connect(owner).cancel(); @@ -724,52 +752,58 @@ describe('Escrow', function () { .connect(owner) [ 'bulkPayOut(address[],uint256[],string,string,uint256)' - ](recepients, amounts, MOCK_URL, MOCK_HASH, '000'); + ](recipients, amounts, MOCK_URL, MOCK_HASH, '000'); await expect(tx) .to.emit(escrow, 'BulkTransferV2') - .withArgs(anyValue, recepients, [100], false, MOCK_URL); + .withArgs(anyValue, recipients, [fundAmount], false, MOCK_URL); await expect(tx).to.emit(escrow, 'Cancelled'); }); it('Should emit only bulkPayOut event for partial bulkPayOut', async function () { - const recepients = [await restAccounts[0].getAddress()]; - const amounts = [10]; + const recipients = [await restAccounts[0].getAddress()]; + const amounts = [ + fundAmount / 4n, //1/4 + ]; const tx = await escrow .connect(owner) [ 'bulkPayOut(address[],uint256[],string,string,uint256)' - ](recepients, amounts, MOCK_URL, MOCK_HASH, '000'); + ](recipients, amounts, MOCK_URL, MOCK_HASH, '000'); await expect(tx) .to.emit(escrow, 'BulkTransferV2') - .withArgs(anyValue, recepients, [10], true, MOCK_URL); + .withArgs(anyValue, recipients, [fundAmount / 4n], true, MOCK_URL); await expect(tx).not.to.emit(escrow, 'Completed'); }); it('Should emit bulkPayOut and Completed events for partial bulkPayOut with forceComplete option', async function () { - const recepients = [await restAccounts[0].getAddress()]; - const amounts = [10]; + const recipients = [await restAccounts[0].getAddress()]; + const amounts = [ + fundAmount / 4n, //1/4 + ]; const tx = await escrow .connect(owner) [ 'bulkPayOut(address[],uint256[],string,string,uint256,bool)' - ](recepients, amounts, MOCK_URL, MOCK_HASH, '000', true); + ](recipients, amounts, MOCK_URL, MOCK_HASH, '000', true); await expect(tx) .to.emit(escrow, 'BulkTransferV2') - .withArgs(anyValue, recepients, [10], false, MOCK_URL); + .withArgs(anyValue, recipients, [fundAmount / 4n], false, MOCK_URL); await expect(tx).to.emit(escrow, 'Completed'); }); it('Should emit bulkPayOut and Cancelled events for partial bulkPayOut with forceComplete option and ToCancel status', async function () { - const recepients = [await restAccounts[0].getAddress()]; - const amounts = [10]; + const recipients = [await restAccounts[0].getAddress()]; + const amounts = [ + fundAmount / 4n, //1/4 + ]; await escrow.connect(owner).cancel(); @@ -777,212 +811,173 @@ describe('Escrow', function () { .connect(owner) [ 'bulkPayOut(address[],uint256[],string,string,uint256,bool)' - ](recepients, amounts, MOCK_URL, MOCK_HASH, '000', true); + ](recipients, amounts, MOCK_URL, MOCK_HASH, '000', true); await expect(tx) .to.emit(escrow, 'BulkTransferV2') - .withArgs(anyValue, recepients, [10], false, MOCK_URL); + .withArgs(anyValue, recipients, [fundAmount / 4n], false, MOCK_URL); await expect(tx).to.emit(escrow, 'Cancelled'); }); }); describe('Bulk payout for recipients', async function () { + let fundAmount: bigint; beforeEach(async () => { await deployEscrow(); - await fundEscrow(); + fundAmount = await fundEscrow(); await setupEscrow(); - await storeResults(100); + await storeResults(fundAmount); }); - it('Should pays each recipient their corresponding amount', async () => { - const account1 = await restAccounts[0].getAddress(); - const account2 = await restAccounts[1].getAddress(); - const account3 = await restAccounts[2].getAddress(); + it('Should pay each recipient their corresponding amount', async () => { + const recipients = await Promise.all( + restAccounts.slice(0, 3).map(async (account) => account.getAddress()) + ); - const initialBalanceAccount1 = await token - .connect(owner) - .balanceOf(account1); - const initialBalanceAccount2 = await token - .connect(owner) - .balanceOf(account2); - const initialBalanceAccount3 = await token - .connect(owner) - .balanceOf(account3); - const initialBalanceRecordingOracle = await token - .connect(owner) - .balanceOf(await recordingOracle.getAddress()); - const initialBalanceReputationOracle = await token - .connect(owner) - .balanceOf(await reputationOracle.getAddress()); - const initialBalanceExchangeOracle = await token - .connect(owner) - .balanceOf(await exchangeOracle.getAddress()); + const initialBalances = await Promise.all( + recipients.map(async (account) => + token.connect(owner).balanceOf(account) + ) + ); - const recepients = [account1, account2, account3]; - const amounts = [10, 20, 30]; + const initialOracleBalances = await Promise.all( + [recordingOracle, reputationOracle, exchangeOracle].map( + async (oracle) => + token.connect(owner).balanceOf(await oracle.getAddress()) + ) + ); + + const amounts = recipients.map(() => + ethers + .parseEther(faker.number.int({ min: 1, max: 20 }).toString()) + .toString() + ); await escrow .connect(reputationOracle) [ 'bulkPayOut(address[],uint256[],string,string,uint256)' - ](recepients, amounts, MOCK_URL, MOCK_HASH, '000'); + ](recipients, amounts, faker.internet.url(), faker.string.alphanumeric(10), faker.string.numeric(3)); - const finalBalanceAccount1 = await token - .connect(owner) - .balanceOf(account1); - const finalBalanceAccount2 = await token - .connect(owner) - .balanceOf(account2); - const finalBalanceAccount3 = await token - .connect(owner) - .balanceOf(account3); - const finalBalanceRecordingOracle = await token - .connect(owner) - .balanceOf(await recordingOracle.getAddress()); - const finalBalanceReputationOracle = await token - .connect(owner) - .balanceOf(await reputationOracle.getAddress()); - const finalBalanceExchangeOracle = await token - .connect(owner) - .balanceOf(await exchangeOracle.getAddress()); - - expect( - (finalBalanceAccount1 - initialBalanceAccount1).toString() - ).to.equal('7'); - expect( - (finalBalanceAccount2 - initialBalanceAccount2).toString() - ).to.equal('14'); - expect( - (finalBalanceAccount3 - initialBalanceAccount3).toString() - ).to.equal('21'); - expect( - ( - finalBalanceRecordingOracle - initialBalanceRecordingOracle - ).toString() - ).to.equal('6'); - expect( - ( - finalBalanceReputationOracle - initialBalanceReputationOracle - ).toString() - ).to.equal('6'); - - expect( - (finalBalanceExchangeOracle - initialBalanceExchangeOracle).toString() - ).to.equal('6'); - - expect(await escrow.remainingFunds()).to.equal('40'); - }); - - it('Should pays each recipient their corresponding amount and return the remaining to launcher with force option', async () => { - const account1 = await restAccounts[0].getAddress(); - const account2 = await restAccounts[1].getAddress(); - const account3 = await restAccounts[2].getAddress(); - - const initialBalanceAccount1 = await token - .connect(owner) - .balanceOf(account1); - const initialBalanceAccount2 = await token - .connect(owner) - .balanceOf(account2); - const initialBalanceAccount3 = await token - .connect(owner) - .balanceOf(account3); - const initialBalanceLauncher = await token - .connect(owner) - .balanceOf(await launcher.getAddress()); - const initialBalanceRecordingOracle = await token - .connect(owner) - .balanceOf(await recordingOracle.getAddress()); - const initialBalanceReputationOracle = await token - .connect(owner) - .balanceOf(await reputationOracle.getAddress()); - const initialBalanceExchangeOracle = await token - .connect(owner) - .balanceOf(await exchangeOracle.getAddress()); + const finalBalances = await Promise.all( + recipients.map(async (account) => + token.connect(owner).balanceOf(account) + ) + ); - const recepients = [account1, account2, account3]; - const amounts = [10, 20, 30]; + const finalOracleBalances = await Promise.all( + [recordingOracle, reputationOracle, exchangeOracle].map( + async (oracle) => + token.connect(owner).balanceOf(await oracle.getAddress()) + ) + ); - await escrow - .connect(reputationOracle) - [ - 'bulkPayOut(address[],uint256[],string,string,uint256,bool)' - ](recepients, amounts, MOCK_URL, MOCK_HASH, '000', true); + const totalPayout = amounts.reduce( + (acc, amount) => acc + BigInt(amount), + 0n + ); + const oracleExpectedFee = (totalPayout * 3n) / 100n; // 3% fee + + recipients.forEach((_, index) => { + const expectedAmount = (BigInt(amounts[index]) * 91n) / 100n; // 91% after all 3 oracle fees + expect( + (finalBalances[index] - initialBalances[index]).toString() + ).to.equal(expectedAmount.toString()); + }); + + initialOracleBalances.forEach((initialBalance, index) => { + expect( + (finalOracleBalances[index] - initialBalance).toString() + ).to.equal(oracleExpectedFee.toString()); + }); + + expect(await escrow.remainingFunds()).to.equal( + await escrow.getBalance() + ); + expect(await escrow.status()).to.equal(Status.Partial); + }); - const finalBalanceAccount1 = await token - .connect(owner) - .balanceOf(account1); - const finalBalanceAccount2 = await token - .connect(owner) - .balanceOf(account2); - const finalBalanceAccount3 = await token - .connect(owner) - .balanceOf(account3); - const finalBalanceLauncher = await token - .connect(owner) - .balanceOf(await launcher.getAddress()); - const finalBalanceRecordingOracle = await token - .connect(owner) - .balanceOf(await recordingOracle.getAddress()); - const finalBalanceReputationOracle = await token - .connect(owner) - .balanceOf(await reputationOracle.getAddress()); - const finalBalanceExchangeOracle = await token - .connect(owner) - .balanceOf(await exchangeOracle.getAddress()); - - expect( - (finalBalanceAccount1 - initialBalanceAccount1).toString() - ).to.equal('7'); - expect( - (finalBalanceAccount2 - initialBalanceAccount2).toString() - ).to.equal('14'); - expect( - (finalBalanceAccount3 - initialBalanceAccount3).toString() - ).to.equal('21'); - expect( - (finalBalanceLauncher - initialBalanceLauncher).toString() - ).to.equal('40'); - expect( - ( - finalBalanceRecordingOracle - initialBalanceRecordingOracle - ).toString() - ).to.equal('6'); - expect( - ( - finalBalanceReputationOracle - initialBalanceReputationOracle - ).toString() - ).to.equal('6'); - - expect( - (finalBalanceExchangeOracle - initialBalanceExchangeOracle).toString() - ).to.equal('6'); + it('Should pay each recipient their corresponding amount and return the remaining to launcher with force complete option', async () => { + const recipients = await Promise.all( + restAccounts.slice(0, 3).map(async (account) => account.getAddress()) + ); - expect(await escrow.remainingFunds()).to.equal('0'); - }); + const initialBalances = await Promise.all( + recipients.map(async (account) => + token.connect(owner).balanceOf(account) + ) + ); - it('Should runs from setup to bulkPayOut to complete correctly', async () => { - const recepients = [await restAccounts[3].getAddress()]; - const amounts = [100]; + const initialOracleBalances = await Promise.all( + [recordingOracle, reputationOracle, exchangeOracle].map( + async (oracle) => + token.connect(owner).balanceOf(await oracle.getAddress()) + ) + ); - expect(await escrow.status()).to.equal(Status.Pending); + const amounts = recipients.map(() => + ethers + .parseEther(faker.number.int({ min: 1, max: 20 }).toString()) + .toString() + ); await escrow .connect(reputationOracle) [ - 'bulkPayOut(address[],uint256[],string,string,uint256)' - ](recepients, amounts, MOCK_URL, MOCK_HASH, '000'); + 'bulkPayOut(address[],uint256[],string,string,uint256,bool)' + ](recipients, amounts, faker.internet.url(), faker.string.alphanumeric(10), faker.string.numeric(3), true); + + const finalBalances = await Promise.all( + recipients.map(async (account) => + token.connect(owner).balanceOf(account) + ) + ); + + const finalOracleBalances = await Promise.all( + [recordingOracle, reputationOracle, exchangeOracle].map( + async (oracle) => + token.connect(owner).balanceOf(await oracle.getAddress()) + ) + ); + + const totalPayout = amounts.reduce( + (acc, amount) => acc + BigInt(amount), + 0n + ); + const oracleExpectedFee = (totalPayout * 3n) / 100n; // 3% fee + + recipients.forEach((_, index) => { + const expectedAmount = (BigInt(amounts[index]) * 91n) / 100n; // 91% after all 3 oracle fees + expect( + (finalBalances[index] - initialBalances[index]).toString() + ).to.equal(expectedAmount.toString()); + }); + + initialOracleBalances.forEach((initialBalance, index) => { + expect( + (finalOracleBalances[index] - initialBalance).toString() + ).to.equal(oracleExpectedFee.toString()); + }); + expect(await escrow.remainingFunds()).to.equal('0'); + expect(await escrow.remainingFunds()).to.equal( + await escrow.getBalance() + ); + expect(await escrow.status()).to.equal(Status.Complete); }); - it('Should runs from setup to bulkPayOut to complete correctly with multiple addresses', async () => { - const recepients = [ + it('Should be completed when amount of payouts is equal to the balance', async () => { + const recipients = [ await restAccounts[3].getAddress(), await restAccounts[4].getAddress(), await restAccounts[5].getAddress(), ]; - const amounts = [10, 20, 70]; + const amounts = [ + fundAmount / 4n, //1/4 + fundAmount / 2n, //1/2 + fundAmount / 4n, //1/4 + ]; expect(await escrow.status()).to.equal(Status.Pending); @@ -990,17 +985,21 @@ describe('Escrow', function () { .connect(reputationOracle) [ 'bulkPayOut(address[],uint256[],string,string,uint256)' - ](recepients, amounts, MOCK_URL, MOCK_HASH, '000'); + ](recipients, amounts, MOCK_URL, MOCK_HASH, '000'); expect(await escrow.status()).to.equal(Status.Complete); }); it('Should runs from setup to bulkPayOut to Cancelled correctly with multiple addresses', async () => { - const recepients = [ + const recipients = [ await restAccounts[3].getAddress(), await restAccounts[4].getAddress(), await restAccounts[5].getAddress(), ]; - const amounts = [10, 20, 70]; + const amounts = [ + fundAmount / 4n, //1/4 + fundAmount / 2n, //1/2 + fundAmount / 4n, //1/4 + ]; await escrow.connect(owner).cancel(); @@ -1010,13 +1009,15 @@ describe('Escrow', function () { .connect(reputationOracle) [ 'bulkPayOut(address[],uint256[],string,string,uint256)' - ](recepients, amounts, MOCK_URL, MOCK_HASH, '000'); + ](recipients, amounts, MOCK_URL, MOCK_HASH, '000'); expect(await escrow.status()).to.equal(Status.Cancelled); }); it('Should runs from setup to bulkPayOut to partial correctly', async () => { - const recepients = [await restAccounts[3].getAddress()]; - const amounts = [80]; + const recipients = [await restAccounts[3].getAddress()]; + const amounts = [ + fundAmount - fundAmount / 5n, //4/5 + ]; expect(await escrow.status()).to.equal(Status.Pending); @@ -1024,13 +1025,15 @@ describe('Escrow', function () { .connect(reputationOracle) [ 'bulkPayOut(address[],uint256[],string,string,uint256)' - ](recepients, amounts, MOCK_URL, MOCK_HASH, '000'); + ](recipients, amounts, MOCK_URL, MOCK_HASH, '000'); expect(await escrow.status()).to.equal(Status.Partial); }); it('Should runs partial bulkPayOut without modifying status if status is ToCancel', async () => { - const recepients = [await restAccounts[3].getAddress()]; - const amounts = [80]; + const recipients = [await restAccounts[3].getAddress()]; + const amounts = [ + fundAmount - fundAmount / 5n, //4/5 + ]; await escrow.connect(owner).cancel(); @@ -1040,17 +1043,21 @@ describe('Escrow', function () { .connect(reputationOracle) [ 'bulkPayOut(address[],uint256[],string,string,uint256)' - ](recepients, amounts, MOCK_URL, MOCK_HASH, '000'); + ](recipients, amounts, MOCK_URL, MOCK_HASH, '000'); expect(await escrow.status()).to.equal(Status.ToCancel); }); it('Should runs from setup to bulkPayOut to partial correctly with multiple addresses', async () => { - const recepients = [ + const recipients = [ await restAccounts[3].getAddress(), await restAccounts[4].getAddress(), await restAccounts[5].getAddress(), ]; - const amounts = [10, 20, 50]; + const amounts = [ + fundAmount / 4n, //1/4 + fundAmount / 2n, //1/2 + fundAmount / 4n, //1/4 + ]; expect(await escrow.status()).to.equal(Status.Pending); @@ -1058,8 +1065,8 @@ describe('Escrow', function () { .connect(reputationOracle) [ 'bulkPayOut(address[],uint256[],string,string,uint256)' - ](recepients, amounts, MOCK_URL, MOCK_HASH, '000'); - expect(await escrow.status()).to.equal(Status.Partial); + ](recipients, amounts, MOCK_URL, MOCK_HASH, '000'); + expect(await escrow.status()).to.equal(Status.Complete); }); }); }); @@ -1068,9 +1075,9 @@ describe('Escrow', function () { describe('Validations', function () { beforeEach(async () => { await deployEscrow(); - await fundEscrow(); + const fundAmount = await fundEscrow(); await setupEscrow(); - await storeResults(); + await storeResults(fundAmount); }); it('Should revert with the right error if escrow not in Paid, Partial or ToCancel state', async function () { @@ -1081,16 +1088,19 @@ describe('Escrow', function () { }); describe('Events', function () { + let fundAmount: bigint; beforeEach(async () => { await deployEscrow(); - await fundEscrow(); + fundAmount = await fundEscrow(); await setupEscrow(); - await storeResults(); + await storeResults(fundAmount / 4n); }); it('Should emit a Completed event when escrow is completed', async function () { const recipients = [await restAccounts[0].getAddress()]; - const amounts = [10]; + const amounts = [ + fundAmount / 4n, //1/4 + ]; await escrow .connect(owner) @@ -1106,16 +1116,19 @@ describe('Escrow', function () { }); describe('Complete escrow', async function () { + let fundAmount: bigint; beforeEach(async () => { await deployEscrow(); - await fundEscrow(); + fundAmount = await fundEscrow(); await setupEscrow(); - await storeResults(); + await storeResults(fundAmount / 2n); }); it('Should succeed if escrow is in Partial state', async function () { const recipients = [await restAccounts[0].getAddress()]; - const amounts = [10]; + const amounts = [ + fundAmount / 4n, //1/4 + ]; await escrow .connect(owner) [ @@ -1134,7 +1147,7 @@ describe('Escrow', function () { .balanceOf(await launcher.getAddress()); const recipients = [await restAccounts[0].getAddress()]; - const amounts = [10]; + const amounts = [fundAmount / 2n]; await escrow .connect(owner) [ @@ -1146,7 +1159,9 @@ describe('Escrow', function () { .connect(owner) .balanceOf(await launcher.getAddress()); - expect(finalLauncherBalance - initialLauncherBalance).to.equal('90'); + expect(finalLauncherBalance - initialLauncherBalance).to.equal( + fundAmount - amounts[0] + ); }); }); }); From 6323832de6727cf351af8e54291020608a9020b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Francisco=20L=C3=B3pez?= Date: Wed, 21 May 2025 17:22:52 +0200 Subject: [PATCH 08/18] Refactor storeResults function to reserve funds, bulkPayout logic to avoid remaining funds and update tests for dynamic amounts --- packages/core/contracts/Escrow.sol | 38 +-- packages/core/test/Escrow-USDT.ts | 488 +++++++++++++++-------------- yarn.lock | 14 +- 3 files changed, 273 insertions(+), 267 deletions(-) diff --git a/packages/core/contracts/Escrow.sol b/packages/core/contracts/Escrow.sol index 1c3866431d..1ca1a2c97e 100644 --- a/packages/core/contracts/Escrow.sol +++ b/packages/core/contracts/Escrow.sol @@ -287,11 +287,12 @@ contract Escrow is IEscrow, ReentrancyGuard { * @dev Stores intermediate results during the escrow process. * @param _url URL of the intermediate results. * @param _hash Hash of the intermediate results. + * @param _fundsToReserve Amount of funds to reserve for the escrow. */ function storeResults( string memory _url, string memory _hash, - uint256 _amount + uint256 _fundsToReserve ) external override trustedOrRecordingOracle notExpired { require( status == EscrowStatuses.Pending || @@ -302,16 +303,15 @@ contract Escrow is IEscrow, ReentrancyGuard { require(bytes(_url).length != 0, "URL can't be empty"); require(bytes(_hash).length != 0, "Hash can't be empty"); require( - _amount <= remainingFunds - reservedFunds, + _fundsToReserve <= remainingFunds - reservedFunds, 'Not enough unreserved funds' ); intermediateResultsUrl = _url; - reservedFunds += _amount; + reservedFunds += _fundsToReserve; emit IntermediateStorage(_url, _hash); - // If the escrow is ToCancel, transfer unreserved funds to launcher if (status == EscrowStatuses.ToCancel) { uint256 unreservedFunds = remainingFunds - reservedFunds; if (unreservedFunds > 0) { @@ -363,29 +363,17 @@ contract Escrow is IEscrow, ReentrancyGuard { ); uint256 totalBulkAmount = 0; - uint256 totalReputationOracleFee = 0; - uint256 totalRecordingOracleFee = 0; - uint256 totalExchangeOracleFee = 0; for (uint256 i = 0; i < _recipients.length; i++) { uint256 amount = _amounts[i]; require(amount > 0, 'Amount should be greater than zero'); totalBulkAmount += amount; - totalReputationOracleFee += - (reputationOracleFeePercentage * amount) / - 100; - totalRecordingOracleFee += - (recordingOracleFeePercentage * amount) / - 100; - totalExchangeOracleFee += - (exchangeOracleFeePercentage * amount) / - 100; } require(totalBulkAmount <= reservedFunds, 'Not enough reserved funds'); - uint256 paidReputation = 0; - uint256 paidRecording = 0; - uint256 paidExchange = 0; + uint256 totalReputationOracleFee = 0; + uint256 totalRecordingOracleFee = 0; + uint256 totalExchangeOracleFee = 0; for (uint256 i = 0; i < _recipients.length; i++) { uint256 amount = _amounts[i]; @@ -396,15 +384,9 @@ contract Escrow is IEscrow, ReentrancyGuard { uint256 exchangeOracleFee = (exchangeOracleFeePercentage * amount) / 100; - if (i == _recipients.length - 1) { - reputationOracleFee = totalReputationOracleFee - paidReputation; - recordingOracleFee = totalRecordingOracleFee - paidRecording; - exchangeOracleFee = totalExchangeOracleFee - paidExchange; - } - - paidReputation += reputationOracleFee; - paidRecording += recordingOracleFee; - paidExchange += exchangeOracleFee; + totalReputationOracleFee += reputationOracleFee; + totalRecordingOracleFee += recordingOracleFee; + totalExchangeOracleFee += exchangeOracleFee; _safeTransfer( token, diff --git a/packages/core/test/Escrow-USDT.ts b/packages/core/test/Escrow-USDT.ts index 7c3fefa4f4..e2f837fe03 100644 --- a/packages/core/test/Escrow-USDT.ts +++ b/packages/core/test/Escrow-USDT.ts @@ -4,9 +4,10 @@ import { expect } from 'chai'; import { ethers } from 'hardhat'; import { EventLog, Signer } from 'ethers'; import { USDT, Escrow, HMToken } from '../typechain-types'; +import { faker } from '@faker-js/faker'; -const MOCK_URL = 'http://google.com/fake'; -const MOCK_HASH = 'kGKmnj9BRf'; +const MOCK_URL = faker.internet.url(); +const MOCK_HASH = faker.string.alphanumeric(10); const BULK_MAX_COUNT = 100; enum Status { @@ -52,20 +53,23 @@ async function setupEscrow() { await reputationOracle.getAddress(), await recordingOracle.getAddress(), await exchangeOracle.getAddress(), - 10, - 10, - 10, + 3, + 3, + 3, MOCK_URL, MOCK_HASH ); } -async function fundEscrow() { - const amount = 100; +async function fundEscrow(): Promise { + const amount = ethers.parseEther( + faker.number.int({ min: 50, max: 200 }).toString() + ); await usdt.connect(owner).transfer(escrow.getAddress(), amount); + return amount; } -async function storeResults(amount = 50) { +async function storeResults(amount: bigint) { await escrow .connect(restAccounts[0]) .storeResults(MOCK_URL, MOCK_HASH, amount); @@ -134,7 +138,9 @@ describe('Escrow with USDT', function () { }); it('Should topup and return the right escrow balance', async () => { - const amount = 1000; + const amount = ethers.parseEther( + faker.number.int({ min: 500, max: 2000 }).toString() + ); await usdt.connect(owner).transfer(escrow.getAddress(), amount); const result = await escrow.connect(launcher).getBalance(); @@ -237,7 +243,7 @@ describe('Escrow with USDT', function () { }); it('Should revert with the right error if amount is higher than unreserved funds', async function () { - await fundEscrow(); + const fundAmount = await fundEscrow(); await setupEscrow(); await escrow @@ -246,7 +252,7 @@ describe('Escrow with USDT', function () { await expect( escrow .connect(reputationOracle) - .storeResults(MOCK_URL, MOCK_HASH, 150) + .storeResults(MOCK_URL, MOCK_HASH, fundAmount * 2n) ).to.be.revertedWith('Not enough unreserved funds'); }); }); @@ -268,9 +274,10 @@ describe('Escrow with USDT', function () { }); describe('Store results', async function () { + let fundAmount: bigint; beforeEach(async () => { await deployEscrow(); - await fundEscrow(); + fundAmount = await fundEscrow(); await setupEscrow(); }); @@ -281,7 +288,7 @@ describe('Escrow with USDT', function () { const result = await ( await escrow .connect(recordingOracle) - .storeResults(MOCK_URL, MOCK_HASH, 50) + .storeResults(MOCK_URL, MOCK_HASH, fundAmount / 2n) ).wait(); const finalOwnerBalance = await usdt @@ -290,8 +297,8 @@ describe('Escrow with USDT', function () { expect((result?.logs[0] as EventLog).args).to.contain(MOCK_URL); expect((result?.logs[0] as EventLog).args).to.contain(MOCK_HASH); expect(finalOwnerBalance - initialOwnerBalance).to.equal(0); - expect(await escrow.remainingFunds()).to.equal(100); - expect(await escrow.reservedFunds()).to.equal(50); + expect(await escrow.remainingFunds()).to.equal(fundAmount); + expect(await escrow.reservedFunds()).to.equal(fundAmount / 2n); }); it('Should succeed when a trusted handler stores results', async () => { @@ -301,7 +308,7 @@ describe('Escrow with USDT', function () { const result = await ( await escrow .connect(trustedHandlers[0]) - .storeResults(MOCK_URL, MOCK_HASH, 50) + .storeResults(MOCK_URL, MOCK_HASH, fundAmount / 2n) ).wait(); const finalOwnerBalance = await usdt @@ -310,8 +317,8 @@ describe('Escrow with USDT', function () { expect((result?.logs[0] as EventLog).args).to.contain(MOCK_URL); expect((result?.logs[0] as EventLog).args).to.contain(MOCK_HASH); expect(finalOwnerBalance - initialOwnerBalance).to.equal(0); - expect(await escrow.remainingFunds()).to.equal(100); - expect(await escrow.reservedFunds()).to.equal(50); + expect(await escrow.remainingFunds()).to.equal(fundAmount); + expect(await escrow.reservedFunds()).to.equal(fundAmount / 2n); }); it('Should return unreserved funds to escrow launcher when status is ToCancel', async () => { @@ -322,7 +329,7 @@ describe('Escrow with USDT', function () { const result = await ( await escrow .connect(recordingOracle) - .storeResults(MOCK_URL, MOCK_HASH, 50) + .storeResults(MOCK_URL, MOCK_HASH, fundAmount / 2n) ).wait(); expect((result?.logs[0] as EventLog).args).to.contain(MOCK_URL); @@ -330,9 +337,11 @@ describe('Escrow with USDT', function () { const finalOwnerBalance = await usdt .connect(owner) .balanceOf(launcher.getAddress()); - expect(finalOwnerBalance - initialOwnerBalance).to.equal(50); - expect(await escrow.remainingFunds()).to.equal(50); - expect(await escrow.reservedFunds()).to.equal(50); + expect(finalOwnerBalance - initialOwnerBalance).to.equal( + fundAmount / 2n + ); + expect(await escrow.remainingFunds()).to.equal(fundAmount / 2n); + expect(await escrow.reservedFunds()).to.equal(fundAmount / 2n); }); }); }); @@ -430,9 +439,10 @@ describe('Escrow with USDT', function () { }); describe('Events', function () { + let fundAmount: bigint; before(async () => { await deployEscrow(); - await fundEscrow(); + fundAmount = await fundEscrow(); }); it('Should emit an event on pending', async function () { @@ -459,7 +469,7 @@ describe('Escrow with USDT', function () { await exchangeOracle.getAddress() ) .to.emit(escrow, 'Fund') - .withArgs(100); + .withArgs(fundAmount); }); }); @@ -531,9 +541,9 @@ describe('Escrow with USDT', function () { describe('Validations', function () { before(async () => { await deployEscrow(); - await fundEscrow(); + const fundAmount = await fundEscrow(); await setupEscrow(); - await storeResults(100); + await storeResults(fundAmount); await escrow .connect(owner) @@ -584,16 +594,19 @@ describe('Escrow with USDT', function () { describe('bulkPayOut', () => { describe('Validations', function () { + let fundAmount: bigint; before(async () => { await deployEscrow(); - await fundEscrow(); + fundAmount = await fundEscrow(); await setupEscrow(); - await storeResults(); + await storeResults(fundAmount); }); it('Should revert with the right error if address calling is not trusted', async function () { const recipients = [await restAccounts[0].getAddress()]; - const amounts = [10]; + const amounts = [ + fundAmount / 4n, //1/4 + ]; await expect( escrow @@ -606,7 +619,9 @@ describe('Escrow with USDT', function () { it('Should revert with the right error if address calling is recording oracle', async function () { const recipients = [await restAccounts[0].getAddress()]; - const amounts = [10]; + const amounts = [ + fundAmount / 4n, //1/4 + ]; await expect( escrow @@ -623,7 +638,10 @@ describe('Escrow with USDT', function () { await restAccounts[1].getAddress(), await restAccounts[2].getAddress(), ]; - const amounts = [10, 20]; + const amounts = [ + fundAmount / 4n, //1/4 + fundAmount / 2n, //1/2 + ]; await expect( escrow @@ -639,7 +657,11 @@ describe('Escrow with USDT', function () { await restAccounts[0].getAddress(), await restAccounts[1].getAddress(), ]; - const amounts = [10, 20, 30]; + const amounts = [ + fundAmount / 4n, //1/4 + fundAmount / 2n, //1/2 + fundAmount / 4n, //1/4 + ]; await expect( escrow @@ -672,7 +694,11 @@ describe('Escrow with USDT', function () { await restAccounts[1].getAddress(), await restAccounts[2].getAddress(), ]; - const amounts = [10, 20, 30]; + const amounts = [ + fundAmount / 4n, //1/4 + fundAmount / 2n, //1/2 + fundAmount / 2n, //1/2 + ]; await expect( escrow @@ -685,16 +711,17 @@ describe('Escrow with USDT', function () { }); describe('Events', function () { - this.beforeEach(async () => { + let fundAmount: bigint; + beforeEach(async () => { await deployEscrow(); - await fundEscrow(); + fundAmount = await fundEscrow(); await setupEscrow(); - await storeResults(100); + await storeResults(fundAmount); }); it('Should emit bulkPayOut and Completed events for complete bulkPayOut', async function () { const recipients = [await restAccounts[0].getAddress()]; - const amounts = [100]; + const amounts = [fundAmount]; const tx = await escrow .connect(owner) @@ -704,14 +731,14 @@ describe('Escrow with USDT', function () { await expect(tx) .to.emit(escrow, 'BulkTransferV2') - .withArgs(anyValue, recipients, [100], false, MOCK_URL); + .withArgs(anyValue, recipients, [fundAmount], false, MOCK_URL); await expect(tx).to.emit(escrow, 'Completed'); }); it('Should emit bulkPayOut and Cancelled events for complete bulkPayOut with ToCancel status', async function () { const recepients = [await restAccounts[0].getAddress()]; - const amounts = [100]; + const amounts = [fundAmount]; await escrow.connect(owner).cancel(); @@ -723,14 +750,16 @@ describe('Escrow with USDT', function () { await expect(tx) .to.emit(escrow, 'BulkTransferV2') - .withArgs(anyValue, recepients, [100], false, MOCK_URL); + .withArgs(anyValue, recepients, [fundAmount], false, MOCK_URL); await expect(tx).to.emit(escrow, 'Cancelled'); }); it('Should emit only bulkPayOut event for partial bulkPayOut', async function () { const recipients = [await restAccounts[0].getAddress()]; - const amounts = [10]; + const amounts = [ + fundAmount / 4n, //1/4 + ]; const tx = await escrow .connect(owner) @@ -740,14 +769,16 @@ describe('Escrow with USDT', function () { await expect(tx) .to.emit(escrow, 'BulkTransferV2') - .withArgs(anyValue, recipients, [10], true, MOCK_URL); + .withArgs(anyValue, recipients, amounts, true, MOCK_URL); await expect(tx).not.to.emit(escrow, 'Completed'); }); it('Should emit bulkPayOut and Completed events for partial bulkPayOut with forceComplete option', async function () { const recipients = [await restAccounts[0].getAddress()]; - const amounts = [10]; + const amounts = [ + fundAmount / 4n, //1/4 + ]; const tx = await escrow .connect(owner) @@ -757,14 +788,16 @@ describe('Escrow with USDT', function () { await expect(tx) .to.emit(escrow, 'BulkTransferV2') - .withArgs(anyValue, recipients, [10], false, MOCK_URL); + .withArgs(anyValue, recipients, amounts, false, MOCK_URL); await expect(tx).to.emit(escrow, 'Completed'); }); it('Should emit bulkPayOut and Cancelled events for partial bulkPayOut with forceComplete option and ToCancel status', async function () { const recepients = [await restAccounts[0].getAddress()]; - const amounts = [10]; + const amounts = [ + fundAmount / 4n, //1/4 + ]; await escrow.connect(owner).cancel(); @@ -776,208 +809,168 @@ describe('Escrow with USDT', function () { await expect(tx) .to.emit(escrow, 'BulkTransferV2') - .withArgs(anyValue, recepients, [10], false, MOCK_URL); + .withArgs(anyValue, recepients, amounts, false, MOCK_URL); await expect(tx).to.emit(escrow, 'Cancelled'); }); }); describe('Bulk payout for recipients', async function () { + let fundAmount: bigint; beforeEach(async () => { await deployEscrow(); - await fundEscrow(); + fundAmount = await fundEscrow(); await setupEscrow(); - await storeResults(100); + await storeResults(fundAmount); }); - it('Should pays each recipient their corresponding amount', async () => { - const account1 = await restAccounts[0].getAddress(); - const account2 = await restAccounts[1].getAddress(); - const account3 = await restAccounts[2].getAddress(); + it('Should pay each recipient their corresponding amount', async () => { + const recipients = await Promise.all( + restAccounts.slice(0, 3).map(async (account) => account.getAddress()) + ); - const initialBalanceAccount1 = await usdt - .connect(owner) - .balanceOf(account1); - const initialBalanceAccount2 = await usdt - .connect(owner) - .balanceOf(account2); - const initialBalanceAccount3 = await usdt - .connect(owner) - .balanceOf(account3); - const initialBalanceRecordingOracle = await usdt - .connect(owner) - .balanceOf(await recordingOracle.getAddress()); - const initialBalanceReputationOracle = await usdt - .connect(owner) - .balanceOf(await reputationOracle.getAddress()); - const initialBalanceExchangeOracle = await usdt - .connect(owner) - .balanceOf(await exchangeOracle.getAddress()); + const initialBalances = await Promise.all( + recipients.map(async (account) => + usdt.connect(owner).balanceOf(account) + ) + ); - const recipients = [account1, account2, account3]; - const amounts = [10, 20, 30]; + const initialOracleBalances = await Promise.all( + [recordingOracle, reputationOracle, exchangeOracle].map( + async (oracle) => + usdt.connect(owner).balanceOf(await oracle.getAddress()) + ) + ); + const amounts = recipients.map(() => + ethers + .parseEther(faker.number.int({ min: 1, max: 20 }).toString()) + .toString() + ); await escrow .connect(reputationOracle) [ 'bulkPayOut(address[],uint256[],string,string,uint256)' - ](recipients, amounts, MOCK_URL, MOCK_HASH, '000'); + ](recipients, amounts, faker.internet.url(), faker.string.alphanumeric(10), faker.string.numeric(3)); - const finalBalanceAccount1 = await usdt - .connect(owner) - .balanceOf(account1); - const finalBalanceAccount2 = await usdt - .connect(owner) - .balanceOf(account2); - const finalBalanceAccount3 = await usdt - .connect(owner) - .balanceOf(account3); - const finalBalanceRecordingOracle = await usdt - .connect(owner) - .balanceOf(await recordingOracle.getAddress()); - const finalBalanceReputationOracle = await usdt - .connect(owner) - .balanceOf(await reputationOracle.getAddress()); - const finalBalanceExchangeOracle = await usdt - .connect(owner) - .balanceOf(await exchangeOracle.getAddress()); - - expect( - (finalBalanceAccount1 - initialBalanceAccount1).toString() - ).to.equal('7'); - expect( - (finalBalanceAccount2 - initialBalanceAccount2).toString() - ).to.equal('14'); - expect( - (finalBalanceAccount3 - initialBalanceAccount3).toString() - ).to.equal('21'); - expect( - ( - finalBalanceRecordingOracle - initialBalanceRecordingOracle - ).toString() - ).to.equal('6'); - expect( - ( - finalBalanceReputationOracle - initialBalanceReputationOracle - ).toString() - ).to.equal('6'); - - expect( - (finalBalanceExchangeOracle - initialBalanceExchangeOracle).toString() - ).to.equal('6'); - - expect(await escrow.remainingFunds()).to.equal('40'); - }); - - it('Should pays each recipient their corresponding amount and return the remaining to launcher with force option', async () => { - const account1 = await restAccounts[0].getAddress(); - const account2 = await restAccounts[1].getAddress(); - const account3 = await restAccounts[2].getAddress(); - - const initialBalanceAccount1 = await usdt - .connect(owner) - .balanceOf(account1); - const initialBalanceAccount2 = await usdt - .connect(owner) - .balanceOf(account2); - const initialBalanceAccount3 = await usdt - .connect(owner) - .balanceOf(account3); - const initialBalanceLauncher = await usdt - .connect(owner) - .balanceOf(await launcher.getAddress()); - const initialBalanceRecordingOracle = await usdt - .connect(owner) - .balanceOf(await recordingOracle.getAddress()); - const initialBalanceReputationOracle = await usdt - .connect(owner) - .balanceOf(await reputationOracle.getAddress()); - const initialBalanceExchangeOracle = await usdt - .connect(owner) - .balanceOf(await exchangeOracle.getAddress()); + const finalBalances = await Promise.all( + recipients.map(async (account) => + usdt.connect(owner).balanceOf(account) + ) + ); - const recipients = [account1, account2, account3]; - const amounts = [10, 20, 30]; + const finalOracleBalances = await Promise.all( + [recordingOracle, reputationOracle, exchangeOracle].map( + async (oracle) => + usdt.connect(owner).balanceOf(await oracle.getAddress()) + ) + ); - await escrow - .connect(reputationOracle) - [ - 'bulkPayOut(address[],uint256[],string,string,uint256,bool)' - ](recipients, amounts, MOCK_URL, MOCK_HASH, '000', true); + const totalPayout = amounts.reduce( + (acc, amount) => acc + BigInt(amount), + 0n + ); + const oracleExpectedFee = (totalPayout * 3n) / 100n; // 3% fee + + recipients.forEach((_, index) => { + const expectedAmount = (BigInt(amounts[index]) * 91n) / 100n; // 91% after all 3 oracle fees + expect( + (finalBalances[index] - initialBalances[index]).toString() + ).to.equal(expectedAmount.toString()); + }); + + initialOracleBalances.forEach((initialBalance, index) => { + expect( + (finalOracleBalances[index] - initialBalance).toString() + ).to.equal(oracleExpectedFee.toString()); + }); + + expect(await escrow.remainingFunds()).to.equal( + await escrow.getBalance() + ); + expect(await escrow.status()).to.equal(Status.Partial); + }); - const finalBalanceAccount1 = await usdt - .connect(owner) - .balanceOf(account1); - const finalBalanceAccount2 = await usdt - .connect(owner) - .balanceOf(account2); - const finalBalanceAccount3 = await usdt - .connect(owner) - .balanceOf(account3); - const finalBalanceLauncher = await usdt - .connect(owner) - .balanceOf(await launcher.getAddress()); - const finalBalanceRecordingOracle = await usdt - .connect(owner) - .balanceOf(await recordingOracle.getAddress()); - const finalBalanceReputationOracle = await usdt - .connect(owner) - .balanceOf(await reputationOracle.getAddress()); - const finalBalanceExchangeOracle = await usdt - .connect(owner) - .balanceOf(await exchangeOracle.getAddress()); - - expect( - (finalBalanceAccount1 - initialBalanceAccount1).toString() - ).to.equal('7'); - expect( - (finalBalanceAccount2 - initialBalanceAccount2).toString() - ).to.equal('14'); - expect( - (finalBalanceAccount3 - initialBalanceAccount3).toString() - ).to.equal('21'); - expect( - (finalBalanceLauncher - initialBalanceLauncher).toString() - ).to.equal('40'); - expect( - ( - finalBalanceRecordingOracle - initialBalanceRecordingOracle - ).toString() - ).to.equal('6'); - expect( - ( - finalBalanceReputationOracle - initialBalanceReputationOracle - ).toString() - ).to.equal('6'); - - expect( - (finalBalanceExchangeOracle - initialBalanceExchangeOracle).toString() - ).to.equal('6'); + it('Should pay each recipient their corresponding amount and return the remaining to launcher with force complete option', async () => { + const recipients = await Promise.all( + restAccounts.slice(0, 3).map(async (account) => account.getAddress()) + ); - expect(await escrow.remainingFunds()).to.equal('0'); - }); + const initialBalances = await Promise.all( + recipients.map(async (account) => + usdt.connect(owner).balanceOf(account) + ) + ); - it('Should runs from setup to bulkPayOut to complete correctly', async () => { - const recipients = [await restAccounts[3].getAddress()]; - const amounts = [100]; + const initialOracleBalances = await Promise.all( + [recordingOracle, reputationOracle, exchangeOracle].map( + async (oracle) => + usdt.connect(owner).balanceOf(await oracle.getAddress()) + ) + ); - expect(await escrow.status()).to.equal(Status.Pending); + const amounts = recipients.map(() => + ethers + .parseEther(faker.number.int({ min: 1, max: 20 }).toString()) + .toString() + ); await escrow .connect(reputationOracle) [ - 'bulkPayOut(address[],uint256[],string,string,uint256)' - ](recipients, amounts, MOCK_URL, MOCK_HASH, '000'); + 'bulkPayOut(address[],uint256[],string,string,uint256,bool)' + ](recipients, amounts, faker.internet.url(), faker.string.alphanumeric(10), faker.string.numeric(3), true); + + const finalBalances = await Promise.all( + recipients.map(async (account) => + usdt.connect(owner).balanceOf(account) + ) + ); + + const finalOracleBalances = await Promise.all( + [recordingOracle, reputationOracle, exchangeOracle].map( + async (oracle) => + usdt.connect(owner).balanceOf(await oracle.getAddress()) + ) + ); + + const totalPayout = amounts.reduce( + (acc, amount) => acc + BigInt(amount), + 0n + ); + const oracleExpectedFee = (totalPayout * 3n) / 100n; // 3% fee + + recipients.forEach((_, index) => { + const expectedAmount = (BigInt(amounts[index]) * 91n) / 100n; // 91% after all 3 oracle fees + expect( + (finalBalances[index] - initialBalances[index]).toString() + ).to.equal(expectedAmount.toString()); + }); + + initialOracleBalances.forEach((initialBalance, index) => { + expect( + (finalOracleBalances[index] - initialBalance).toString() + ).to.equal(oracleExpectedFee.toString()); + }); + expect(await escrow.remainingFunds()).to.equal('0'); + expect(await escrow.remainingFunds()).to.equal( + await escrow.getBalance() + ); + expect(await escrow.status()).to.equal(Status.Complete); }); - it('Should runs from setup to bulkPayOut to complete correctly with multiple addresses', async () => { + it('Should be completed when amount of payouts is equal to the balance', async () => { const recipients = [ await restAccounts[3].getAddress(), await restAccounts[4].getAddress(), await restAccounts[5].getAddress(), ]; - const amounts = [10, 20, 70]; + const amounts = [ + fundAmount / 4n, //1/4 + fundAmount / 2n, //1/2 + fundAmount / 4n, //1/4 + ]; expect(await escrow.status()).to.equal(Status.Pending); @@ -990,12 +983,16 @@ describe('Escrow with USDT', function () { }); it('Should runs from setup to bulkPayOut to Cancelled correctly with multiple addresses', async () => { - const recepients = [ + const recipients = [ await restAccounts[3].getAddress(), await restAccounts[4].getAddress(), await restAccounts[5].getAddress(), ]; - const amounts = [10, 20, 70]; + const amounts = [ + fundAmount / 4n, //1/4 + fundAmount / 2n, //1/2 + fundAmount / 4n, //1/4 + ]; await escrow.connect(owner).cancel(); @@ -1005,13 +1002,15 @@ describe('Escrow with USDT', function () { .connect(reputationOracle) [ 'bulkPayOut(address[],uint256[],string,string,uint256)' - ](recepients, amounts, MOCK_URL, MOCK_HASH, '000'); + ](recipients, amounts, MOCK_URL, MOCK_HASH, '000'); expect(await escrow.status()).to.equal(Status.Cancelled); }); it('Should runs from setup to bulkPayOut to partial correctly', async () => { const recipients = [await restAccounts[3].getAddress()]; - const amounts = [80]; + const amounts = [ + fundAmount - fundAmount / 5n, //4/5 + ]; expect(await escrow.status()).to.equal(Status.Pending); @@ -1024,8 +1023,10 @@ describe('Escrow with USDT', function () { }); it('Should runs partial bulkPayOut without modifying status if status is ToCancel', async () => { - const recepients = [await restAccounts[3].getAddress()]; - const amounts = [80]; + const recipients = [await restAccounts[3].getAddress()]; + const amounts = [ + fundAmount - fundAmount / 5n, //4/5 + ]; await escrow.connect(owner).cancel(); @@ -1035,7 +1036,7 @@ describe('Escrow with USDT', function () { .connect(reputationOracle) [ 'bulkPayOut(address[],uint256[],string,string,uint256)' - ](recepients, amounts, MOCK_URL, MOCK_HASH, '000'); + ](recipients, amounts, MOCK_URL, MOCK_HASH, '000'); expect(await escrow.status()).to.equal(Status.ToCancel); }); @@ -1045,7 +1046,11 @@ describe('Escrow with USDT', function () { await restAccounts[4].getAddress(), await restAccounts[5].getAddress(), ]; - const amounts = [10, 20, 50]; + const amounts = [ + fundAmount / 4n, //1/4 + fundAmount / 2n, //1/2 + fundAmount / 4n, //1/4 + ]; expect(await escrow.status()).to.equal(Status.Pending); @@ -1054,16 +1059,17 @@ describe('Escrow with USDT', function () { [ 'bulkPayOut(address[],uint256[],string,string,uint256)' ](recipients, amounts, MOCK_URL, MOCK_HASH, '000'); - expect(await escrow.status()).to.equal(Status.Partial); + expect(await escrow.status()).to.equal(Status.Complete); }); }); }); describe('withdraw', () => { + let fundAmount: bigint; describe('can fund hmtoken to escrow, and then withdraw', () => { before(async () => { await deployEscrow(); - await fundEscrow(); + fundAmount = await fundEscrow(); await setupEscrow(); }); @@ -1076,7 +1082,7 @@ describe('Escrow with USDT', function () { .balanceOf(escrow.getAddress()); expect(result.toString()).to.equal(amount.toString()); - expect(await escrow.remainingFunds()).to.equal('100'); + expect(await escrow.remainingFunds()).to.equal(fundAmount); }); it('Should withdraw HMTokens from escrow', async () => { @@ -1087,7 +1093,7 @@ describe('Escrow with USDT', function () { .balanceOf(escrow.getAddress()); expect(result.toString()).to.equal('0'); - expect(await escrow.remainingFunds()).to.equal('100'); + expect(await escrow.remainingFunds()).to.equal(fundAmount); }); it('Should not allow USDT withdrawal from escrow', async () => { @@ -1102,9 +1108,9 @@ describe('Escrow with USDT', function () { await escrow.connect(owner).withdraw(usdt.getAddress()); const result = await usdt.connect(owner).balanceOf(escrow.getAddress()); - expect(result.toString()).to.equal('100'); + expect(result.toString()).to.equal(fundAmount); - expect(await escrow.remainingFunds()).to.equal('100'); + expect(await escrow.remainingFunds()).to.equal(fundAmount); }); }); @@ -1125,13 +1131,14 @@ describe('Escrow with USDT', function () { }); }); }); + describe('complete', () => { describe('Validations', function () { beforeEach(async () => { await deployEscrow(); - await fundEscrow(); + const fundAmount = await fundEscrow(); await setupEscrow(); - await storeResults(); + await storeResults(fundAmount); }); it('Should revert with the right error if escrow not in Paid, Partial or ToCancel state', async function () { @@ -1142,22 +1149,26 @@ describe('Escrow with USDT', function () { }); describe('Events', function () { + let fundAmount: bigint; beforeEach(async () => { await deployEscrow(); - await fundEscrow(); + fundAmount = await fundEscrow(); await setupEscrow(); - await storeResults(); + await storeResults(fundAmount / 4n); + }); + it('Should emit a Completed event when escrow is completed', async function () { const recipients = [await restAccounts[0].getAddress()]; - const amounts = [10]; + const amounts = [ + fundAmount / 4n, //1/4 + ]; + await escrow .connect(owner) [ 'bulkPayOut(address[],uint256[],string,string,uint256,bool)' ](recipients, amounts, MOCK_URL, MOCK_HASH, '000', false); - }); - it('Should emit a Completed event when escrow is completed', async function () { await expect(escrow.connect(owner).complete()).to.emit( escrow, 'Completed' @@ -1166,16 +1177,19 @@ describe('Escrow with USDT', function () { }); describe('Complete escrow', async function () { + let fundAmount: bigint; beforeEach(async () => { await deployEscrow(); - await fundEscrow(); + fundAmount = await fundEscrow(); await setupEscrow(); - await storeResults(); + await storeResults(fundAmount / 2n); }); it('Should succeed if escrow is in Partial state', async function () { const recipients = [await restAccounts[0].getAddress()]; - const amounts = [10]; + const amounts = [ + fundAmount / 4n, //1/4 + ]; await escrow .connect(owner) [ @@ -1194,7 +1208,7 @@ describe('Escrow with USDT', function () { .balanceOf(await launcher.getAddress()); const recipients = [await restAccounts[0].getAddress()]; - const amounts = [10]; + const amounts = [fundAmount / 2n]; await escrow .connect(owner) [ @@ -1206,7 +1220,9 @@ describe('Escrow with USDT', function () { .connect(owner) .balanceOf(await launcher.getAddress()); - expect(finalLauncherBalance - initialLauncherBalance).to.equal('90'); + expect(finalLauncherBalance - initialLauncherBalance).to.equal( + fundAmount - amounts[0] + ); }); }); }); diff --git a/yarn.lock b/yarn.lock index e10b08aa6b..89a43e4c1d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3205,13 +3205,20 @@ __metadata: languageName: node linkType: hard -"@faker-js/faker@npm:^9.4.0, @faker-js/faker@npm:^9.5.0, @faker-js/faker@npm:^9.7.0": +"@faker-js/faker@npm:^9.7.0": version: 9.7.0 resolution: "@faker-js/faker@npm:9.7.0" checksum: 10c0/5a95147cbf0ae52909aea18346edb159efefe5e9800048d906317f1ec872c657256b43140f194d1308cb58074e57c619140ee96d26f57623b2957e5e74bbb3b8 languageName: node linkType: hard +"@faker-js/faker@npm:^9.8.0": + version: 9.8.0 + resolution: "@faker-js/faker@npm:9.8.0" + checksum: 10c0/f5db1125c1ea0115b9142fb4d4cb37cac2da4cd12ed02afb1cabf3b9600bd365bf480386250975a4fb200d77c00e8364dc8f61ac273a9dcdd2f2f42c3b29b0ec + languageName: node + linkType: hard + "@fastify/busboy@npm:^2.0.0": version: 2.1.1 resolution: "@fastify/busboy@npm:2.1.1" @@ -3789,6 +3796,7 @@ __metadata: version: 0.0.0-use.local resolution: "@human-protocol/core@workspace:packages/core" dependencies: + "@faker-js/faker": "npm:^9.8.0" "@nomicfoundation/hardhat-chai-matchers": "npm:^2.0.7" "@nomicfoundation/hardhat-ethers": "npm:^3.0.5" "@nomicfoundation/hardhat-network-helpers": "npm:^1.0.12" @@ -4262,7 +4270,7 @@ __metadata: version: 0.0.0-use.local resolution: "@human-protocol/job-launcher-server@workspace:packages/apps/job-launcher/server" dependencies: - "@faker-js/faker": "npm:^9.5.0" + "@faker-js/faker": "npm:^9.8.0" "@golevelup/ts-jest": "npm:^0.6.1" "@google-cloud/storage": "npm:^7.15.0" "@google-cloud/vision": "npm:^4.3.2" @@ -4333,7 +4341,7 @@ __metadata: version: 0.0.0-use.local resolution: "@human-protocol/reputation-oracle@workspace:packages/apps/reputation-oracle/server" dependencies: - "@faker-js/faker": "npm:^9.4.0" + "@faker-js/faker": "npm:^9.8.0" "@golevelup/ts-jest": "npm:^0.6.1" "@human-protocol/core": "workspace:*" "@human-protocol/sdk": "workspace:*" From 634a664a3bfac48bdadc4fd926fb2f8ffd37fa1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Francisco=20L=C3=B3pez?= <50665615+flopez7@users.noreply.github.com> Date: Thu, 22 May 2025 12:52:15 +0200 Subject: [PATCH 09/18] Refactor token validation to use PaymentCurrency enum and add support for USD decimal checks (#3362) --- .../src/common/validators/token-decimals.ts | 20 +++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/packages/apps/job-launcher/server/src/common/validators/token-decimals.ts b/packages/apps/job-launcher/server/src/common/validators/token-decimals.ts index 44d1340c9f..94ed779493 100644 --- a/packages/apps/job-launcher/server/src/common/validators/token-decimals.ts +++ b/packages/apps/job-launcher/server/src/common/validators/token-decimals.ts @@ -7,7 +7,7 @@ import { } from 'class-validator'; import { TOKEN_ADDRESSES } from '../constants/tokens'; import { ChainId } from '@human-protocol/sdk'; -import { EscrowFundToken } from '../enums/job'; +import { PaymentCurrency } from '../enums/payment'; @ValidatorConstraint({ async: false }) export class IsValidTokenDecimalsConstraint @@ -17,12 +17,19 @@ export class IsValidTokenDecimalsConstraint const [tokenProperty] = args.constraints; const dto = args.object as Record; const chainId = dto.chainId as ChainId; - const token = dto[tokenProperty] as EscrowFundToken; + const token = dto[tokenProperty] as PaymentCurrency; if (!chainId || !token) { return false; } + // Check if the token is a fiat currency + if (token === PaymentCurrency.USD) { + if (typeof value !== 'number') return false; + const [, decimals] = value.toString().split('.'); + return !decimals || decimals.length <= 2; + } + const tokenInfo = TOKEN_ADDRESSES[chainId]?.[token]; if (!tokenInfo) { @@ -35,7 +42,7 @@ export class IsValidTokenDecimalsConstraint return false; } - const [_, decimals] = value.toString().split('.'); + const [, decimals] = value.toString().split('.'); return !decimals || decimals.length <= maxDecimals; } @@ -43,7 +50,12 @@ export class IsValidTokenDecimalsConstraint const [tokenProperty] = args.constraints; const dto = args.object as Record; const chainId = dto.chainId as ChainId; - const token = dto[tokenProperty] as EscrowFundToken; + const token = dto[tokenProperty] as PaymentCurrency; + + if (token === PaymentCurrency.USD) { + return `${args.property} must have at most 2 decimal places for USD payments.`; + } + const tokenInfo = TOKEN_ADDRESSES[chainId]?.[token]; const maxDecimals = tokenInfo?.decimals || 'unknown'; From 36a82d86df8ff0c729bd9c2ab3a0bb0641086da4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Francisco=20L=C3=B3pez?= <50665615+flopez7@users.noreply.github.com> Date: Thu, 22 May 2025 13:52:53 +0200 Subject: [PATCH 10/18] Refactor job creation to move webhook entity creation from fund to setup (#3363) --- .../server/src/modules/job/job.service.ts | 26 +++++++++---------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/packages/apps/job-launcher/server/src/modules/job/job.service.ts b/packages/apps/job-launcher/server/src/modules/job/job.service.ts index 8b3085f130..d34a6a07c5 100644 --- a/packages/apps/job-launcher/server/src/modules/job/job.service.ts +++ b/packages/apps/job-launcher/server/src/modules/job/job.service.ts @@ -376,6 +376,17 @@ export class JobService { jobEntity.status = JobStatus.LAUNCHED; await this.jobRepository.updateOne(jobEntity); + const oracleType = this.getOracleType(jobEntity.requestType); + const webhookEntity = new WebhookEntity(); + Object.assign(webhookEntity, { + escrowAddress: jobEntity.escrowAddress, + chainId: jobEntity.chainId, + eventType: EventType.ESCROW_CREATED, + oracleType: oracleType, + hasSignature: oracleType !== OracleType.HCAPTCHA ? true : false, + }); + await this.webhookRepository.createUnique(webhookEntity); + return jobEntity; } @@ -397,20 +408,7 @@ export class JobService { }); jobEntity.status = JobStatus.FUNDED; - await this.jobRepository.updateOne(jobEntity); - - const oracleType = this.getOracleType(jobEntity.requestType); - const webhookEntity = new WebhookEntity(); - Object.assign(webhookEntity, { - escrowAddress: jobEntity.escrowAddress, - chainId: jobEntity.chainId, - eventType: EventType.ESCROW_CREATED, - oracleType: oracleType, - hasSignature: oracleType !== OracleType.HCAPTCHA ? true : false, - }); - await this.webhookRepository.createUnique(webhookEntity); - - return jobEntity; + return this.jobRepository.updateOne(jobEntity); } public async requestToCancelJobById( From b7ed820e6c4a33d70cd526fa35c97240131d6966 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Francisco=20L=C3=B3pez?= Date: Wed, 28 May 2025 11:36:02 +0200 Subject: [PATCH 11/18] feat: add cancellation refund and requested events handling - Updated subgraph package.json to include network-specific test command. - Enhanced GraphQL schema with CancellationRefundEvent and CancellationRequested types. - Implemented event handlers for CancellationRequested and CancellationRefund in EscrowTemplate. - Modified EscrowStatistics to track toCancelStatusEventCount. - Updated dayUpdates utility to initialize dailyToCancelStatusEventCount. - Adjusted template.yaml to listen for CancellationRequested and CancellationRefund events. - Expanded tests to cover new cancellation events and their effects on statistics. - Created fixture functions for generating mock CancellationRequested and CancellationRefund events. --- ...human_protocol_sdk.escrow.escrow_client.md | 28 ++ .../human_protocol_sdk.escrow.escrow_utils.md | 45 +++ docs/sdk/python/human_protocol_sdk.escrow.md | 5 + docs/sdk/python/human_protocol_sdk.filter.md | 26 ++ docs/sdk/python/human_protocol_sdk.md | 3 + docs/sdk/python/index.md | 1 + .../base/classes/BaseEthersClient.md | 8 +- .../encryption/classes/Encryption.md | 12 +- .../encryption/classes/EncryptionUtils.md | 12 +- .../typescript/enums/enumerations/ChainId.md | 18 +- .../enums/enumerations/OperatorCategory.md | 6 +- .../enums/enumerations/OrderDirection.md | 6 +- .../typescript/escrow/classes/EscrowClient.md | 96 ++++-- .../typescript/escrow/classes/EscrowUtils.md | 172 +++++++++- .../types/type-aliases/DailyEscrowData.md | 14 +- .../types/type-aliases/DailyHMTData.md | 12 +- .../types/type-aliases/DailyPaymentData.md | 10 +- .../types/type-aliases/DailyTaskData.md | 8 +- .../types/type-aliases/DailyWorkerData.md | 6 +- .../graphql/types/type-aliases/EscrowData.md | 40 +-- .../types/type-aliases/EscrowStatistics.md | 6 +- .../type-aliases/EscrowStatisticsData.md | 22 +- .../types/type-aliases/EventDayData.md | 38 +-- .../graphql/types/type-aliases/HMTHolder.md | 6 +- .../types/type-aliases/HMTHolderData.md | 6 +- .../types/type-aliases/HMTStatistics.md | 8 +- .../types/type-aliases/HMTStatisticsData.md | 14 +- .../graphql/types/type-aliases/IMData.md | 2 +- .../types/type-aliases/IMDataEntity.md | 6 +- .../graphql/types/type-aliases/KVStoreData.md | 14 +- .../types/type-aliases/PaymentStatistics.md | 4 +- .../graphql/types/type-aliases/PayoutData.md | 12 +- .../type-aliases/RewardAddedEventData.md | 10 +- .../graphql/types/type-aliases/StatusEvent.md | 10 +- .../types/type-aliases/TaskStatistics.md | 4 +- .../types/type-aliases/WorkerStatistics.md | 4 +- docs/sdk/typescript/interfaces/README.md | 1 + .../interfaces/ICancellationRefundFilter.md | 89 +++++ .../interfaces/interfaces/IEscrowConfig.md | 18 +- .../interfaces/interfaces/IEscrowsFilter.md | 26 +- .../interfaces/IHMTHoldersParams.md | 10 +- .../interfaces/interfaces/IKVStore.md | 6 +- .../interfaces/interfaces/IKeyPair.md | 10 +- .../interfaces/interfaces/IOperator.md | 46 +-- .../interfaces/IOperatorSubgraph.md | 44 +-- .../interfaces/interfaces/IOperatorsFilter.md | 16 +- .../interfaces/interfaces/IPagination.md | 9 +- .../interfaces/interfaces/IPayoutFilter.md | 18 +- .../interfaces/IReputationNetwork.md | 8 +- .../interfaces/IReputationNetworkSubgraph.md | 8 +- .../interfaces/interfaces/IReward.md | 6 +- .../interfaces/IStatisticsFilter.md | 12 +- .../interfaces/IStatusEventFilter.md | 18 +- .../interfaces/interfaces/ITransaction.md | 24 +- .../interfaces/ITransactionsFilter.md | 22 +- .../interfaces/interfaces/IWorker.md | 10 +- .../interfaces/interfaces/IWorkersFilter.md | 14 +- .../interfaces/InternalTransaction.md | 16 +- .../interfaces/interfaces/StakerInfo.md | 10 +- .../kvstore/classes/KVStoreClient.md | 16 +- .../kvstore/classes/KVStoreUtils.md | 10 +- .../operator/classes/OperatorUtils.md | 10 +- .../staking/classes/StakingClient.md | 28 +- .../statistics/classes/StatisticsClient.md | 20 +- .../storage/classes/StorageClient.md | 14 +- .../transaction/classes/TransactionUtils.md | 6 +- docs/sdk/typescript/types/README.md | 2 +- .../types/enumerations/EscrowStatus.md | 24 +- .../types/type-aliases/CancellationRefund.md | 83 +++++ .../types/type-aliases/EscrowCancel.md | 33 -- .../types/type-aliases/EscrowWithdraw.md | 8 +- .../types/type-aliases/NetworkData.md | 24 +- .../typescript/types/type-aliases/Payout.md | 12 +- .../types/type-aliases/StorageCredentials.md | 6 +- .../types/type-aliases/StorageParams.md | 10 +- .../type-aliases/TransactionLikeWithNonce.md | 2 +- .../types/type-aliases/UploadFile.md | 8 +- .../src/common/enums/webhook.ts | 2 + .../src/modules/job/job.service.ts | 74 +++- .../src/modules/webhook/webhook.service.ts | 4 + .../server/src/common/constants/errors.ts | 2 + .../server/src/common/enums/job.ts | 1 + .../server/src/database/base.repository.ts | 13 + .../1748266665103-webhookOracleAddress.ts | 90 +++++ .../modules/cron-job/cron-job.service.spec.ts | 12 +- .../src/modules/cron-job/cron-job.service.ts | 52 +-- .../server/src/modules/job/job.dto.ts | 8 - .../server/src/modules/job/job.repository.ts | 6 +- .../server/src/modules/job/job.service.ts | 76 +++-- .../modules/mutex/mutex-manager.service.ts | 2 + .../src/modules/webhook/webhook.entity.ts | 7 +- .../modules/webhook/webhook.service.spec.ts | 65 +--- .../src/modules/webhook/webhook.service.ts | 46 +-- .../escrow-completion.service.ts | 10 +- .../fortune-payouts-calculator.spec.ts | 32 +- .../fortune-payouts-calculator.ts | 18 +- .../escrow-results-processor.spec.ts | 92 ++++- .../escrow-results-processor.ts | 13 +- .../server/src/modules/webhook/types.ts | 2 + packages/core/contracts/Escrow.sol | 4 + .../docs/human_protocol_sdk.worker.rst | 15 + ...human_protocol_sdk.worker.worker_utils.rst | 7 + .../escrow/escrow_client.py | 34 ++ .../human_protocol_sdk/escrow/escrow_utils.py | 162 ++++++++- .../human_protocol_sdk/filter.py | 47 +++ .../human_protocol_sdk/gql/escrow.py | 76 +++++ .../escrow/test_escrow_client.py | 26 ++ .../escrow/test_escrow_utils.py | 143 +++++++- .../human-protocol-sdk/src/escrow.ts | 237 ++++++++++--- .../src/graphql/queries/escrow.ts | 53 ++- .../human-protocol-sdk/src/interfaces.ts | 8 + .../human-protocol-sdk/src/types.ts | 53 ++- .../human-protocol-sdk/test/escrow.test.ts | 291 ++++++++++------ packages/sdk/typescript/subgraph/package.json | 2 +- .../sdk/typescript/subgraph/schema.graphql | 12 + .../subgraph/src/mapping/EscrowTemplate.ts | 183 ++++++---- .../subgraph/src/mapping/utils/dayUpdates.ts | 1 + .../sdk/typescript/subgraph/template.yaml | 4 + .../subgraph/tests/escrow/escrow.test.ts | 315 ++++++++++++++---- .../subgraph/tests/escrow/fixtures.ts | 82 ++++- 120 files changed, 2881 insertions(+), 952 deletions(-) create mode 100644 docs/sdk/typescript/interfaces/interfaces/ICancellationRefundFilter.md create mode 100644 docs/sdk/typescript/types/type-aliases/CancellationRefund.md delete mode 100644 docs/sdk/typescript/types/type-aliases/EscrowCancel.md create mode 100644 packages/apps/job-launcher/server/src/database/migrations/1748266665103-webhookOracleAddress.ts create mode 100644 packages/sdk/python/human-protocol-sdk/docs/human_protocol_sdk.worker.rst create mode 100644 packages/sdk/python/human-protocol-sdk/docs/human_protocol_sdk.worker.worker_utils.rst diff --git a/docs/sdk/python/human_protocol_sdk.escrow.escrow_client.md b/docs/sdk/python/human_protocol_sdk.escrow.escrow_client.md index 96dedb4d49..75d0ac7e8f 100644 --- a/docs/sdk/python/human_protocol_sdk.escrow.escrow_client.md +++ b/docs/sdk/python/human_protocol_sdk.escrow.escrow_client.md @@ -705,6 +705,34 @@ Gets the reputation oracle address of the escrow. ) ``` +#### get_reserved_funds(escrow_address) + +Gets the reserved funds for a specified escrow address. + +* **Parameters:** + **escrow_address** (`str`) – Address of the escrow +* **Return type:** + `Decimal` +* **Returns:** + Value of the reserved funds +* **Raises:** + [**EscrowClientError**](#human_protocol_sdk.escrow.escrow_client.EscrowClientError) – If an error occurs while checking the parameters +* **Example:** + ```python + from eth_typing import URI + from web3 import Web3 + from web3.providers.auto import load_provider_from_uri + + from human_protocol_sdk.escrow import EscrowClient + + w3 = Web3(load_provider_from_uri(URI("http://localhost:8545"))) + escrow_client = EscrowClient(w3) + + reserved_funds = escrow_client.get_reserved_funds( + "0x62dD51230A30401C455c8398d06F85e4EaB6309f" + ) + ``` + #### get_results_url(escrow_address) Gets the results file URL. diff --git a/docs/sdk/python/human_protocol_sdk.escrow.escrow_utils.md b/docs/sdk/python/human_protocol_sdk.escrow.escrow_utils.md index 7638365935..5d61f62d76 100644 --- a/docs/sdk/python/human_protocol_sdk.escrow.escrow_utils.md +++ b/docs/sdk/python/human_protocol_sdk.escrow.escrow_utils.md @@ -22,6 +22,14 @@ print( ## Module +### *class* human_protocol_sdk.escrow.escrow_utils.CancellationRefund(id, escrow_address, receiver, amount, block, timestamp, tx_hash) + +Bases: `object` + +Represents a cancellation refund event. + +#### \_\_init_\_(id, escrow_address, receiver, amount, block, timestamp, tx_hash) + ### *class* human_protocol_sdk.escrow.escrow_utils.EscrowData(chain_id, id, address, amount_paid, balance, count, factory_address, launcher, status, token, total_funded_amount, created_at, final_results_url=None, intermediate_results_url=None, manifest_hash=None, manifest_url=None, recording_oracle=None, reputation_oracle=None, exchange_oracle=None) Bases: `object` @@ -57,6 +65,43 @@ Bases: `object` A utility class that provides additional escrow-related functionalities. +#### *static* get_cancellation_refund(chain_id, escrow_address) + +Returns the cancellation refund for a given escrow address. + +* **Parameters:** + * **chain_id** ([`ChainId`](human_protocol_sdk.constants.md#human_protocol_sdk.constants.ChainId)) – Network in which the escrow has been deployed + * **escrow_address** (`str`) – Address of the escrow +* **Return type:** + [`CancellationRefund`](#human_protocol_sdk.escrow.escrow_utils.CancellationRefund) +* **Returns:** + CancellationRefund data or None +* **Raises:** + [**EscrowClientError**](human_protocol_sdk.escrow.escrow_client.md#human_protocol_sdk.escrow.escrow_client.EscrowClientError) – If an unsupported chain ID or invalid address is provided. +* **Example:** + ```python + from human_protocol_sdk.constants import ChainId + from human_protocol_sdk.escrow import EscrowUtils + + refund = EscrowUtils.get_cancellation_refund( + ChainId.POLYGON_AMOY, + "0x1234567890123456789012345678901234567890" + ) + ``` + +#### *static* get_cancellation_refunds(filter) + +Fetch cancellation refunds from the subgraph based on the provided filter. + +* **Parameters:** + **filter** ([`CancellationRefundFilter`](human_protocol_sdk.filter.md#human_protocol_sdk.filter.CancellationRefundFilter)) – Object containing all the necessary parameters to filter cancellation refunds. +* **Return List[CancellationRefund]:** + List of cancellation refunds matching the query parameters. +* **Raises:** + [**EscrowClientError**](human_protocol_sdk.escrow.escrow_client.md#human_protocol_sdk.escrow.escrow_client.EscrowClientError) – If an unsupported chain ID or invalid addresses are provided. +* **Return type:** + `List`[[`CancellationRefund`](#human_protocol_sdk.escrow.escrow_utils.CancellationRefund)] + #### *static* get_escrow(chain_id, escrow_address) Returns the escrow for a given address. diff --git a/docs/sdk/python/human_protocol_sdk.escrow.md b/docs/sdk/python/human_protocol_sdk.escrow.md index deed876bfc..a730274b25 100644 --- a/docs/sdk/python/human_protocol_sdk.escrow.md +++ b/docs/sdk/python/human_protocol_sdk.escrow.md @@ -29,6 +29,7 @@ obtain information from both the contracts and subgraph. * [`EscrowClient.get_manifest_url()`](human_protocol_sdk.escrow.escrow_client.md#human_protocol_sdk.escrow.escrow_client.EscrowClient.get_manifest_url) * [`EscrowClient.get_recording_oracle_address()`](human_protocol_sdk.escrow.escrow_client.md#human_protocol_sdk.escrow.escrow_client.EscrowClient.get_recording_oracle_address) * [`EscrowClient.get_reputation_oracle_address()`](human_protocol_sdk.escrow.escrow_client.md#human_protocol_sdk.escrow.escrow_client.EscrowClient.get_reputation_oracle_address) + * [`EscrowClient.get_reserved_funds()`](human_protocol_sdk.escrow.escrow_client.md#human_protocol_sdk.escrow.escrow_client.EscrowClient.get_reserved_funds) * [`EscrowClient.get_results_url()`](human_protocol_sdk.escrow.escrow_client.md#human_protocol_sdk.escrow.escrow_client.EscrowClient.get_results_url) * [`EscrowClient.get_status()`](human_protocol_sdk.escrow.escrow_client.md#human_protocol_sdk.escrow.escrow_client.EscrowClient.get_status) * [`EscrowClient.get_token_address()`](human_protocol_sdk.escrow.escrow_client.md#human_protocol_sdk.escrow.escrow_client.EscrowClient.get_token_address) @@ -43,9 +44,13 @@ obtain information from both the contracts and subgraph. * [human_protocol_sdk.escrow.escrow_utils module](human_protocol_sdk.escrow.escrow_utils.md) * [Code Example](human_protocol_sdk.escrow.escrow_utils.md#code-example) * [Module](human_protocol_sdk.escrow.escrow_utils.md#module) + * [`CancellationRefund`](human_protocol_sdk.escrow.escrow_utils.md#human_protocol_sdk.escrow.escrow_utils.CancellationRefund) + * [`CancellationRefund.__init__()`](human_protocol_sdk.escrow.escrow_utils.md#human_protocol_sdk.escrow.escrow_utils.CancellationRefund.__init__) * [`EscrowData`](human_protocol_sdk.escrow.escrow_utils.md#human_protocol_sdk.escrow.escrow_utils.EscrowData) * [`EscrowData.__init__()`](human_protocol_sdk.escrow.escrow_utils.md#human_protocol_sdk.escrow.escrow_utils.EscrowData.__init__) * [`EscrowUtils`](human_protocol_sdk.escrow.escrow_utils.md#human_protocol_sdk.escrow.escrow_utils.EscrowUtils) + * [`EscrowUtils.get_cancellation_refund()`](human_protocol_sdk.escrow.escrow_utils.md#human_protocol_sdk.escrow.escrow_utils.EscrowUtils.get_cancellation_refund) + * [`EscrowUtils.get_cancellation_refunds()`](human_protocol_sdk.escrow.escrow_utils.md#human_protocol_sdk.escrow.escrow_utils.EscrowUtils.get_cancellation_refunds) * [`EscrowUtils.get_escrow()`](human_protocol_sdk.escrow.escrow_utils.md#human_protocol_sdk.escrow.escrow_utils.EscrowUtils.get_escrow) * [`EscrowUtils.get_escrows()`](human_protocol_sdk.escrow.escrow_utils.md#human_protocol_sdk.escrow.escrow_utils.EscrowUtils.get_escrows) * [`EscrowUtils.get_payouts()`](human_protocol_sdk.escrow.escrow_utils.md#human_protocol_sdk.escrow.escrow_utils.EscrowUtils.get_payouts) diff --git a/docs/sdk/python/human_protocol_sdk.filter.md b/docs/sdk/python/human_protocol_sdk.filter.md index da7dec57ce..c928f2e5c2 100644 --- a/docs/sdk/python/human_protocol_sdk.filter.md +++ b/docs/sdk/python/human_protocol_sdk.filter.md @@ -1,5 +1,31 @@ # human_protocol_sdk.filter module +### *class* human_protocol_sdk.filter.CancellationRefundFilter(chain_id, escrow_address=None, receiver=None, date_from=None, date_to=None, first=10, skip=0, order_direction=OrderDirection.DESC) + +Bases: `object` + +A class used to filter cancellation refunds. + +#### \_\_init_\_(chain_id, escrow_address=None, receiver=None, date_from=None, date_to=None, first=10, skip=0, order_direction=OrderDirection.DESC) + +Initializes a CancellationRefundFilter instance. +:type chain_id: [`ChainId`](human_protocol_sdk.constants.md#human_protocol_sdk.constants.ChainId) +:param chain_id: Chain ID to request data +:type escrow_address: `Optional`[`str`] +:param escrow_address: Address of the escrow to filter by +:type receiver: `Optional`[`str`] +:param receiver: Address of the receiver to filter by +:type date_from: `Optional`[`datetime`] +:param date_from: Start date for filtering +:type date_to: `Optional`[`datetime`] +:param date_to: End date for filtering +:type first: `int` +:param first: Number of items per page +:type skip: `int` +:param skip: Number of items to skip (for pagination) +:type order_direction: [`OrderDirection`](human_protocol_sdk.constants.md#human_protocol_sdk.constants.OrderDirection) +:param order_direction: Order direction of results, “asc” or “desc” + ### *class* human_protocol_sdk.filter.EscrowFilter(chain_id, launcher=None, reputation_oracle=None, recording_oracle=None, exchange_oracle=None, job_requester_id=None, status=None, date_from=None, date_to=None, first=10, skip=0, order_direction=OrderDirection.DESC) Bases: `object` diff --git a/docs/sdk/python/human_protocol_sdk.md b/docs/sdk/python/human_protocol_sdk.md index 7f19d62801..91170cb757 100644 --- a/docs/sdk/python/human_protocol_sdk.md +++ b/docs/sdk/python/human_protocol_sdk.md @@ -44,6 +44,7 @@ * [human_protocol_sdk.escrow.escrow_utils module](human_protocol_sdk.escrow.escrow_utils.md) * [Code Example](human_protocol_sdk.escrow.escrow_utils.md#code-example) * [Module](human_protocol_sdk.escrow.escrow_utils.md#module) + * [`CancellationRefund`](human_protocol_sdk.escrow.escrow_utils.md#human_protocol_sdk.escrow.escrow_utils.CancellationRefund) * [`EscrowData`](human_protocol_sdk.escrow.escrow_utils.md#human_protocol_sdk.escrow.escrow_utils.EscrowData) * [`EscrowUtils`](human_protocol_sdk.escrow.escrow_utils.md#human_protocol_sdk.escrow.escrow_utils.EscrowUtils) * [`Payout`](human_protocol_sdk.escrow.escrow_utils.md#human_protocol_sdk.escrow.escrow_utils.Payout) @@ -158,6 +159,8 @@ * [`Status.Partial`](human_protocol_sdk.constants.md#human_protocol_sdk.constants.Status.Partial) * [`Status.Pending`](human_protocol_sdk.constants.md#human_protocol_sdk.constants.Status.Pending) * [human_protocol_sdk.filter module](human_protocol_sdk.filter.md) + * [`CancellationRefundFilter`](human_protocol_sdk.filter.md#human_protocol_sdk.filter.CancellationRefundFilter) + * [`CancellationRefundFilter.__init__()`](human_protocol_sdk.filter.md#human_protocol_sdk.filter.CancellationRefundFilter.__init__) * [`EscrowFilter`](human_protocol_sdk.filter.md#human_protocol_sdk.filter.EscrowFilter) * [`EscrowFilter.__init__()`](human_protocol_sdk.filter.md#human_protocol_sdk.filter.EscrowFilter.__init__) * [`FilterError`](human_protocol_sdk.filter.md#human_protocol_sdk.filter.FilterError) diff --git a/docs/sdk/python/index.md b/docs/sdk/python/index.md index 75b6eaeb1e..80141c249a 100644 --- a/docs/sdk/python/index.md +++ b/docs/sdk/python/index.md @@ -51,6 +51,7 @@ pip install human-protocol-sdk[agreement] * [`Role`](human_protocol_sdk.constants.md#human_protocol_sdk.constants.Role) * [`Status`](human_protocol_sdk.constants.md#human_protocol_sdk.constants.Status) * [human_protocol_sdk.filter module](human_protocol_sdk.filter.md) + * [`CancellationRefundFilter`](human_protocol_sdk.filter.md#human_protocol_sdk.filter.CancellationRefundFilter) * [`EscrowFilter`](human_protocol_sdk.filter.md#human_protocol_sdk.filter.EscrowFilter) * [`FilterError`](human_protocol_sdk.filter.md#human_protocol_sdk.filter.FilterError) * [`PayoutFilter`](human_protocol_sdk.filter.md#human_protocol_sdk.filter.PayoutFilter) diff --git a/docs/sdk/typescript/base/classes/BaseEthersClient.md b/docs/sdk/typescript/base/classes/BaseEthersClient.md index 6de540eeba..33d4f15e18 100644 --- a/docs/sdk/typescript/base/classes/BaseEthersClient.md +++ b/docs/sdk/typescript/base/classes/BaseEthersClient.md @@ -6,7 +6,7 @@ # Class: `abstract` BaseEthersClient -Defined in: [base.ts:10](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L10) +Defined in: [base.ts:10](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L10) ## Introduction @@ -24,7 +24,7 @@ This class is used as a base class for other clients making on-chain calls. > **new BaseEthersClient**(`runner`, `networkData`): `BaseEthersClient` -Defined in: [base.ts:20](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L20) +Defined in: [base.ts:20](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L20) **BaseClient constructor** @@ -52,7 +52,7 @@ The network information required to connect to the contracts > **networkData**: [`NetworkData`](../../types/type-aliases/NetworkData.md) -Defined in: [base.ts:12](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L12) +Defined in: [base.ts:12](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L12) *** @@ -60,4 +60,4 @@ Defined in: [base.ts:12](https://github.com/humanprotocol/human-protocol/blob/99 > `protected` **runner**: `ContractRunner` -Defined in: [base.ts:11](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L11) +Defined in: [base.ts:11](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L11) diff --git a/docs/sdk/typescript/encryption/classes/Encryption.md b/docs/sdk/typescript/encryption/classes/Encryption.md index 38f9ab4994..1040a08629 100644 --- a/docs/sdk/typescript/encryption/classes/Encryption.md +++ b/docs/sdk/typescript/encryption/classes/Encryption.md @@ -6,7 +6,7 @@ # Class: Encryption -Defined in: [encryption.ts:58](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L58) +Defined in: [encryption.ts:58](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L58) ## Introduction @@ -53,7 +53,7 @@ const encryption = await Encryption.build(privateKey, passphrase); > **new Encryption**(`privateKey`): `Encryption` -Defined in: [encryption.ts:66](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L66) +Defined in: [encryption.ts:66](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L66) Constructor for the Encryption class. @@ -75,7 +75,7 @@ The private key. > **decrypt**(`message`, `publicKey?`): `Promise`\<`Uint8Array`\<`ArrayBufferLike`\>\> -Defined in: [encryption.ts:194](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L194) +Defined in: [encryption.ts:194](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L194) This function decrypts messages using the private key. In addition, the public key can be added for signature verification. @@ -129,7 +129,7 @@ const resultMessage = await encryption.decrypt('message'); > **sign**(`message`): `Promise`\<`string`\> -Defined in: [encryption.ts:251](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L251) +Defined in: [encryption.ts:251](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L251) This function signs a message using the private key used to initialize the client. @@ -165,7 +165,7 @@ const resultMessage = await encryption.sign('message'); > **signAndEncrypt**(`message`, `publicKeys`): `Promise`\<`string`\> -Defined in: [encryption.ts:142](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L142) +Defined in: [encryption.ts:142](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L142) This function signs and encrypts a message using the private key used to initialize the client and the specified public keys. @@ -232,7 +232,7 @@ const resultMessage = await encryption.signAndEncrypt('message', publicKeys); > `static` **build**(`privateKeyArmored`, `passphrase?`): `Promise`\<`Encryption`\> -Defined in: [encryption.ts:77](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L77) +Defined in: [encryption.ts:77](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L77) Builds an Encryption instance by decrypting the private key from an encrypted private key and passphrase. diff --git a/docs/sdk/typescript/encryption/classes/EncryptionUtils.md b/docs/sdk/typescript/encryption/classes/EncryptionUtils.md index 1026c02235..ef06867ba3 100644 --- a/docs/sdk/typescript/encryption/classes/EncryptionUtils.md +++ b/docs/sdk/typescript/encryption/classes/EncryptionUtils.md @@ -6,7 +6,7 @@ # Class: EncryptionUtils -Defined in: [encryption.ts:290](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L290) +Defined in: [encryption.ts:290](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L290) ## Introduction @@ -48,7 +48,7 @@ const keyPair = await EncryptionUtils.generateKeyPair('Human', 'human@hmt.ai'); > `static` **encrypt**(`message`, `publicKeys`): `Promise`\<`string`\> -Defined in: [encryption.ts:444](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L444) +Defined in: [encryption.ts:444](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L444) This function encrypts a message using the specified public keys. @@ -111,7 +111,7 @@ const result = await EncryptionUtils.encrypt('message', publicKeys); > `static` **generateKeyPair**(`name`, `email`, `passphrase`): `Promise`\<[`IKeyPair`](../../interfaces/interfaces/IKeyPair.md)\> -Defined in: [encryption.ts:382](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L382) +Defined in: [encryption.ts:382](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L382) This function generates a key pair for encryption and decryption. @@ -158,7 +158,7 @@ const result = await EncryptionUtils.generateKeyPair(name, email, passphrase); > `static` **getSignedData**(`message`): `Promise`\<`string`\> -Defined in: [encryption.ts:351](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L351) +Defined in: [encryption.ts:351](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L351) This function gets signed data from a signed message. @@ -190,7 +190,7 @@ const signedData = await EncryptionUtils.getSignedData('message'); > `static` **isEncrypted**(`message`): `boolean` -Defined in: [encryption.ts:494](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L494) +Defined in: [encryption.ts:494](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L494) Verifies if a message appears to be encrypted with OpenPGP. @@ -238,7 +238,7 @@ if (isEncrypted) { > `static` **verify**(`message`, `publicKey`): `Promise`\<`boolean`\> -Defined in: [encryption.ts:318](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L318) +Defined in: [encryption.ts:318](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L318) This function verifies the signature of a signed message using the public key. diff --git a/docs/sdk/typescript/enums/enumerations/ChainId.md b/docs/sdk/typescript/enums/enumerations/ChainId.md index c8a3f014e2..8a4be3ce4a 100644 --- a/docs/sdk/typescript/enums/enumerations/ChainId.md +++ b/docs/sdk/typescript/enums/enumerations/ChainId.md @@ -6,7 +6,7 @@ # Enumeration: ChainId -Defined in: [enums.ts:1](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L1) +Defined in: [enums.ts:1](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L1) ## Enumeration Members @@ -14,7 +14,7 @@ Defined in: [enums.ts:1](https://github.com/humanprotocol/human-protocol/blob/99 > **ALL**: `-1` -Defined in: [enums.ts:2](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L2) +Defined in: [enums.ts:2](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L2) *** @@ -22,7 +22,7 @@ Defined in: [enums.ts:2](https://github.com/humanprotocol/human-protocol/blob/99 > **BSC\_MAINNET**: `56` -Defined in: [enums.ts:5](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L5) +Defined in: [enums.ts:5](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L5) *** @@ -30,7 +30,7 @@ Defined in: [enums.ts:5](https://github.com/humanprotocol/human-protocol/blob/99 > **BSC\_TESTNET**: `97` -Defined in: [enums.ts:6](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L6) +Defined in: [enums.ts:6](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L6) *** @@ -38,7 +38,7 @@ Defined in: [enums.ts:6](https://github.com/humanprotocol/human-protocol/blob/99 > **LOCALHOST**: `1338` -Defined in: [enums.ts:9](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L9) +Defined in: [enums.ts:9](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L9) *** @@ -46,7 +46,7 @@ Defined in: [enums.ts:9](https://github.com/humanprotocol/human-protocol/blob/99 > **MAINNET**: `1` -Defined in: [enums.ts:3](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L3) +Defined in: [enums.ts:3](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L3) *** @@ -54,7 +54,7 @@ Defined in: [enums.ts:3](https://github.com/humanprotocol/human-protocol/blob/99 > **POLYGON**: `137` -Defined in: [enums.ts:7](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L7) +Defined in: [enums.ts:7](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L7) *** @@ -62,7 +62,7 @@ Defined in: [enums.ts:7](https://github.com/humanprotocol/human-protocol/blob/99 > **POLYGON\_AMOY**: `80002` -Defined in: [enums.ts:8](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L8) +Defined in: [enums.ts:8](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L8) *** @@ -70,4 +70,4 @@ Defined in: [enums.ts:8](https://github.com/humanprotocol/human-protocol/blob/99 > **SEPOLIA**: `11155111` -Defined in: [enums.ts:4](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L4) +Defined in: [enums.ts:4](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L4) diff --git a/docs/sdk/typescript/enums/enumerations/OperatorCategory.md b/docs/sdk/typescript/enums/enumerations/OperatorCategory.md index ea4c15d6ab..e6cbb06ac8 100644 --- a/docs/sdk/typescript/enums/enumerations/OperatorCategory.md +++ b/docs/sdk/typescript/enums/enumerations/OperatorCategory.md @@ -6,7 +6,7 @@ # Enumeration: OperatorCategory -Defined in: [enums.ts:17](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L17) +Defined in: [enums.ts:17](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L17) ## Enumeration Members @@ -14,7 +14,7 @@ Defined in: [enums.ts:17](https://github.com/humanprotocol/human-protocol/blob/9 > **MACHINE\_LEARNING**: `"machine_learning"` -Defined in: [enums.ts:18](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L18) +Defined in: [enums.ts:18](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L18) *** @@ -22,4 +22,4 @@ Defined in: [enums.ts:18](https://github.com/humanprotocol/human-protocol/blob/9 > **MARKET\_MAKING**: `"market_making"` -Defined in: [enums.ts:19](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L19) +Defined in: [enums.ts:19](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L19) diff --git a/docs/sdk/typescript/enums/enumerations/OrderDirection.md b/docs/sdk/typescript/enums/enumerations/OrderDirection.md index 9f6809c5d4..0523ccff91 100644 --- a/docs/sdk/typescript/enums/enumerations/OrderDirection.md +++ b/docs/sdk/typescript/enums/enumerations/OrderDirection.md @@ -6,7 +6,7 @@ # Enumeration: OrderDirection -Defined in: [enums.ts:12](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L12) +Defined in: [enums.ts:12](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L12) ## Enumeration Members @@ -14,7 +14,7 @@ Defined in: [enums.ts:12](https://github.com/humanprotocol/human-protocol/blob/9 > **ASC**: `"asc"` -Defined in: [enums.ts:13](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L13) +Defined in: [enums.ts:13](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L13) *** @@ -22,4 +22,4 @@ Defined in: [enums.ts:13](https://github.com/humanprotocol/human-protocol/blob/9 > **DESC**: `"desc"` -Defined in: [enums.ts:14](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L14) +Defined in: [enums.ts:14](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L14) diff --git a/docs/sdk/typescript/escrow/classes/EscrowClient.md b/docs/sdk/typescript/escrow/classes/EscrowClient.md index 88ed51f62b..879df6b099 100644 --- a/docs/sdk/typescript/escrow/classes/EscrowClient.md +++ b/docs/sdk/typescript/escrow/classes/EscrowClient.md @@ -6,7 +6,7 @@ # Class: EscrowClient -Defined in: [escrow.ts:141](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L141) +Defined in: [escrow.ts:144](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L144) ## Introduction @@ -86,7 +86,7 @@ const escrowClient = await EscrowClient.build(provider); > **new EscrowClient**(`runner`, `networkData`): `EscrowClient` -Defined in: [escrow.ts:150](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L150) +Defined in: [escrow.ts:153](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L153) **EscrowClient constructor** @@ -118,7 +118,7 @@ The network information required to connect to the Escrow contract > **networkData**: [`NetworkData`](../../types/type-aliases/NetworkData.md) -Defined in: [base.ts:12](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L12) +Defined in: [base.ts:12](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L12) #### Inherited from @@ -130,7 +130,7 @@ Defined in: [base.ts:12](https://github.com/humanprotocol/human-protocol/blob/99 > `protected` **runner**: `ContractRunner` -Defined in: [base.ts:11](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L11) +Defined in: [base.ts:11](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L11) #### Inherited from @@ -142,7 +142,7 @@ Defined in: [base.ts:11](https://github.com/humanprotocol/human-protocol/blob/99 > **addTrustedHandlers**(`escrowAddress`, `trustedHandlers`, `txOptions?`): `Promise`\<`void`\> -Defined in: [escrow.ts:786](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L786) +Defined in: [escrow.ts:755](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L755) This function adds an array of addresses to the trusted handlers list. @@ -197,7 +197,7 @@ await escrowClient.addTrustedHandlers('0x62dD51230A30401C455c8398d06F85e4EaB6309 > **bulkPayOut**(`escrowAddress`, `recipients`, `amounts`, `finalResultsUrl`, `finalResultsHash`, `txId`, `forceComplete`, `txOptions?`): `Promise`\<`void`\> -Defined in: [escrow.ts:619](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L619) +Defined in: [escrow.ts:622](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L622) This function pays out the amounts specified to the workers and sets the URL of the final results file. @@ -285,9 +285,9 @@ await escrowClient.bulkPayOut('0x62dD51230A30401C455c8398d06F85e4EaB6309f', reci ### cancel() -> **cancel**(`escrowAddress`, `txOptions?`): `Promise`\<[`EscrowCancel`](../../types/type-aliases/EscrowCancel.md)\> +> **cancel**(`escrowAddress`, `txOptions?`): `Promise`\<`void`\> -Defined in: [escrow.ts:700](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L700) +Defined in: [escrow.ts:703](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L703) This function cancels the specified escrow and sends the balance to the canceler. @@ -307,7 +307,7 @@ Additional transaction parameters (optional, defaults to an empty object). #### Returns -`Promise`\<[`EscrowCancel`](../../types/type-aliases/EscrowCancel.md)\> +`Promise`\<`void`\> Returns the escrow cancellation data including transaction hash and refunded amount. Throws error if any. @@ -335,7 +335,7 @@ await escrowClient.cancel('0x62dD51230A30401C455c8398d06F85e4EaB6309f'); > **complete**(`escrowAddress`, `txOptions?`): `Promise`\<`void`\> -Defined in: [escrow.ts:558](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L558) +Defined in: [escrow.ts:561](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L561) This function sets the status of an escrow to completed. @@ -383,7 +383,7 @@ await escrowClient.complete('0x62dD51230A30401C455c8398d06F85e4EaB6309f'); > **createBulkPayoutTransaction**(`escrowAddress`, `recipients`, `amounts`, `finalResultsUrl`, `finalResultsHash`, `txId`, `forceComplete`, `txOptions?`): `Promise`\<[`TransactionLikeWithNonce`](../../types/type-aliases/TransactionLikeWithNonce.md)\> -Defined in: [escrow.ts:956](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L956) +Defined in: [escrow.ts:925](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L925) Creates a prepared transaction for bulk payout without immediately sending it. @@ -478,7 +478,7 @@ console.log('Tx hash:', ethers.keccak256(signedTransaction)); > **createEscrow**(`tokenAddress`, `trustedHandlers`, `jobRequesterId`, `txOptions?`): `Promise`\<`string`\> -Defined in: [escrow.ts:230](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L230) +Defined in: [escrow.ts:233](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L233) This function creates an escrow contract that uses the token passed to pay oracle fees and reward workers. @@ -541,7 +541,7 @@ const escrowAddress = await escrowClient.createEscrow(tokenAddress, trustedHandl > **fund**(`escrowAddress`, `amount`, `txOptions?`): `Promise`\<`void`\> -Defined in: [escrow.ts:421](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L421) +Defined in: [escrow.ts:424](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L424) This function adds funds of the chosen token to the escrow. @@ -594,7 +594,7 @@ await escrowClient.fund('0x62dD51230A30401C455c8398d06F85e4EaB6309f', amount); > **getBalance**(`escrowAddress`): `Promise`\<`bigint`\> -Defined in: [escrow.ts:1101](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1101) +Defined in: [escrow.ts:1070](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1070) This function returns the balance for a specified escrow address. @@ -632,7 +632,7 @@ const balance = await escrowClient.getBalance('0x62dD51230A30401C455c8398d06F85e > **getExchangeOracleAddress**(`escrowAddress`): `Promise`\<`string`\> -Defined in: [escrow.ts:1487](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1487) +Defined in: [escrow.ts:1493](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1493) This function returns the exchange oracle address for a given escrow. @@ -670,7 +670,7 @@ const oracleAddress = await escrowClient.getExchangeOracleAddress('0x62dD51230A3 > **getFactoryAddress**(`escrowAddress`): `Promise`\<`string`\> -Defined in: [escrow.ts:1525](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1525) +Defined in: [escrow.ts:1531](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1531) This function returns the escrow factory address for a given escrow. @@ -708,7 +708,7 @@ const factoryAddress = await escrowClient.getFactoryAddress('0x62dD51230A30401C4 > **getIntermediateResultsUrl**(`escrowAddress`): `Promise`\<`string`\> -Defined in: [escrow.ts:1259](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1259) +Defined in: [escrow.ts:1265](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1265) This function returns the intermediate results file URL. @@ -746,7 +746,7 @@ const intermediateResultsUrl = await escrowClient.getIntermediateResultsUrl('0x6 > **getJobLauncherAddress**(`escrowAddress`): `Promise`\<`string`\> -Defined in: [escrow.ts:1411](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1411) +Defined in: [escrow.ts:1417](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1417) This function returns the job launcher address for a given escrow. @@ -784,7 +784,7 @@ const jobLauncherAddress = await escrowClient.getJobLauncherAddress('0x62dD51230 > **getManifestHash**(`escrowAddress`): `Promise`\<`string`\> -Defined in: [escrow.ts:1145](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1145) +Defined in: [escrow.ts:1151](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1151) This function returns the manifest file hash. @@ -822,7 +822,7 @@ const manifestHash = await escrowClient.getManifestHash('0x62dD51230A30401C455c8 > **getManifestUrl**(`escrowAddress`): `Promise`\<`string`\> -Defined in: [escrow.ts:1183](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1183) +Defined in: [escrow.ts:1189](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1189) This function returns the manifest file URL. @@ -860,7 +860,7 @@ const manifestUrl = await escrowClient.getManifestUrl('0x62dD51230A30401C455c839 > **getRecordingOracleAddress**(`escrowAddress`): `Promise`\<`string`\> -Defined in: [escrow.ts:1373](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1373) +Defined in: [escrow.ts:1379](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1379) This function returns the recording oracle address for a given escrow. @@ -898,7 +898,7 @@ const oracleAddress = await escrowClient.getRecordingOracleAddress('0x62dD51230A > **getReputationOracleAddress**(`escrowAddress`): `Promise`\<`string`\> -Defined in: [escrow.ts:1449](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1449) +Defined in: [escrow.ts:1455](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1455) This function returns the reputation oracle address for a given escrow. @@ -932,11 +932,49 @@ const oracleAddress = await escrowClient.getReputationOracleAddress('0x62dD51230 *** +### getReservedFunds() + +> **getReservedFunds**(`escrowAddress`): `Promise`\<`bigint`\> + +Defined in: [escrow.ts:1114](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1114) + +This function returns the reserved funds for a specified escrow address. + +#### Parameters + +##### escrowAddress + +`string` + +Address of the escrow. + +#### Returns + +`Promise`\<`bigint`\> + +Reserved funds of the escrow in the token used to fund it. + +**Code example** + +```ts +import { providers } from 'ethers'; +import { EscrowClient } from '@human-protocol/sdk'; + +const rpcUrl = 'YOUR_RPC_URL'; + +const provider = new providers.JsonRpcProvider(rpcUrl); +const escrowClient = await EscrowClient.build(provider); + +const reservedFunds = await escrowClient.getReservedFunds('0x62dD51230A30401C455c8398d06F85e4EaB6309f'); +``` + +*** + ### getResultsUrl() > **getResultsUrl**(`escrowAddress`): `Promise`\<`string`\> -Defined in: [escrow.ts:1221](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1221) +Defined in: [escrow.ts:1227](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1227) This function returns the results file URL. @@ -974,7 +1012,7 @@ const resultsUrl = await escrowClient.getResultsUrl('0x62dD51230A30401C455c8398d > **getStatus**(`escrowAddress`): `Promise`\<[`EscrowStatus`](../../types/enumerations/EscrowStatus.md)\> -Defined in: [escrow.ts:1335](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1335) +Defined in: [escrow.ts:1341](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1341) This function returns the current status of the escrow. @@ -1012,7 +1050,7 @@ const status = await escrowClient.getStatus('0x62dD51230A30401C455c8398d06F85e4E > **getTokenAddress**(`escrowAddress`): `Promise`\<`string`\> -Defined in: [escrow.ts:1297](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1297) +Defined in: [escrow.ts:1303](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1303) This function returns the token address used for funding the escrow. @@ -1050,7 +1088,7 @@ const tokenAddress = await escrowClient.getTokenAddress('0x62dD51230A30401C455c8 > **setup**(`escrowAddress`, `escrowConfig`, `txOptions?`): `Promise`\<`void`\> -Defined in: [escrow.ts:311](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L311) +Defined in: [escrow.ts:314](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L314) This function sets up the parameters of the escrow. @@ -1115,7 +1153,7 @@ await escrowClient.setup(escrowAddress, escrowConfig); > **storeResults**(`escrowAddress`, `url`, `hash`, `amount`, `txOptions?`): `Promise`\<`void`\> -Defined in: [escrow.ts:487](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L487) +Defined in: [escrow.ts:490](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L490) This function stores the results URL and hash, and reserves the specified amount of funds. @@ -1181,7 +1219,7 @@ await escrowClient.storeResults('0x62dD51230A30401C455c8398d06F85e4EaB6309f', 'h > **withdraw**(`escrowAddress`, `tokenAddress`, `txOptions?`): `Promise`\<[`EscrowWithdraw`](../../types/type-aliases/EscrowWithdraw.md)\> -Defined in: [escrow.ts:852](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L852) +Defined in: [escrow.ts:821](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L821) This function withdraws additional tokens in the escrow to the canceler. @@ -1238,7 +1276,7 @@ await escrowClient.withdraw( > `static` **build**(`runner`): `Promise`\<`EscrowClient`\> -Defined in: [escrow.ts:168](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L168) +Defined in: [escrow.ts:171](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L171) Creates an instance of EscrowClient from a Runner. diff --git a/docs/sdk/typescript/escrow/classes/EscrowUtils.md b/docs/sdk/typescript/escrow/classes/EscrowUtils.md index fb30eb0cce..2e234d51d7 100644 --- a/docs/sdk/typescript/escrow/classes/EscrowUtils.md +++ b/docs/sdk/typescript/escrow/classes/EscrowUtils.md @@ -6,7 +6,7 @@ # Class: EscrowUtils -Defined in: [escrow.ts:1574](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1574) +Defined in: [escrow.ts:1580](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1580) ## Introduction @@ -50,11 +50,173 @@ const escrowAddresses = new EscrowUtils.getEscrows({ ## Methods +### getCancellationRefund() + +> `static` **getCancellationRefund**(`chainId`, `escrowAddress`): `Promise`\<[`CancellationRefund`](../../types/type-aliases/CancellationRefund.md)\> + +Defined in: [escrow.ts:2131](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L2131) + +This function returns the cancellation refund for a given escrow address. + +> This uses Subgraph + +**Input parameters** + +```ts +enum ChainId { + ALL = -1, + MAINNET = 1, + SEPOLIA = 11155111, + BSC_MAINNET = 56, + BSC_TESTNET = 97, + POLYGON = 137, + POLYGON_AMOY = 80002, + LOCALHOST = 1338, +} +``` + +```ts +type CancellationRefund = { + id: string; + escrowAddress: string; + receiver: string; + amount: bigint; + block: number; + timestamp: number; + txHash: string; +}; +``` + +#### Parameters + +##### chainId + +[`ChainId`](../../enums/enumerations/ChainId.md) + +Network in which the escrow has been deployed + +##### escrowAddress + +`string` + +Address of the escrow + +#### Returns + +`Promise`\<[`CancellationRefund`](../../types/type-aliases/CancellationRefund.md)\> + +Cancellation refund data + +**Code example** + +```ts +import { ChainId, EscrowUtils } from '@human-protocol/sdk'; + +const cancellationRefund = await EscrowUtils.getCancellationRefund(ChainId.POLYGON_AMOY, "0x1234567890123456789012345678901234567890"); +``` + +*** + +### getCancellationRefunds() + +> `static` **getCancellationRefunds**(`filter`): `Promise`\<[`CancellationRefund`](../../types/type-aliases/CancellationRefund.md)[]\> + +Defined in: [escrow.ts:2047](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L2047) + +This function returns the cancellation refunds for a given set of networks. + +> This uses Subgraph + +**Input parameters** + +```ts +enum ChainId { + ALL = -1, + MAINNET = 1, + SEPOLIA = 11155111, + BSC_MAINNET = 56, + BSC_TESTNET = 97, + POLYGON = 137, + POLYGON_AMOY = 80002, + LOCALHOST = 1338, +} +``` + +```ts +type CancellationRefund = { + id: string; + escrowAddress: string; + receiver: string; + amount: bigint; + block: number; + timestamp: number; + txHash: string; +}; +``` + +#### Parameters + +##### filter + +Filter parameters. + +###### chainId + +[`ChainId`](../../enums/enumerations/ChainId.md) + +###### escrowAddress? + +`string` + +###### first? + +`number` + +###### from? + +`Date` + +###### orderDirection? + +[`OrderDirection`](../../enums/enumerations/OrderDirection.md) + +###### receiver? + +`string` + +###### skip? + +`number` + +###### to? + +`Date` + +#### Returns + +`Promise`\<[`CancellationRefund`](../../types/type-aliases/CancellationRefund.md)[]\> + +List of cancellation refunds matching the filters. + +**Code example** + +```ts +import { ChainId, EscrowUtils } from '@human-protocol/sdk'; + +const cancellationRefunds = await EscrowUtils.getCancellationRefunds({ + chainId: ChainId.POLYGON_AMOY, + escrowAddress: '0x1234567890123456789012345678901234567890', +}); +console.log(cancellationRefunds); +``` + +*** + ### getEscrow() > `static` **getEscrow**(`chainId`, `escrowAddress`): `Promise`\<[`EscrowData`](../../graphql/types/type-aliases/EscrowData.md)\> -Defined in: [escrow.ts:1789](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1789) +Defined in: [escrow.ts:1795](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1795) This function returns the escrow data for a given address. @@ -133,7 +295,7 @@ const escrowData = new EscrowUtils.getEscrow(ChainId.POLYGON_AMOY, "0x1234567890 > `static` **getEscrows**(`filter`): `Promise`\<[`EscrowData`](../../graphql/types/type-aliases/EscrowData.md)[]\> -Defined in: [escrow.ts:1671](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1671) +Defined in: [escrow.ts:1677](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1677) This function returns an array of escrows based on the specified filter parameters. @@ -245,7 +407,7 @@ const escrowDatas = await EscrowUtils.getEscrows(filters); > `static` **getPayouts**(`filter`): `Promise`\<[`Payout`](../../types/type-aliases/Payout.md)[]\> -Defined in: [escrow.ts:1959](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1959) +Defined in: [escrow.ts:1965](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1965) This function returns the payouts for a given set of networks. @@ -289,7 +451,7 @@ console.log(payouts); > `static` **getStatusEvents**(`filter`): `Promise`\<[`StatusEvent`](../../graphql/types/type-aliases/StatusEvent.md)[]\> -Defined in: [escrow.ts:1868](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1868) +Defined in: [escrow.ts:1874](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1874) This function returns the status events for a given set of networks within an optional date range. diff --git a/docs/sdk/typescript/graphql/types/type-aliases/DailyEscrowData.md b/docs/sdk/typescript/graphql/types/type-aliases/DailyEscrowData.md index 099c5b5605..91e6854c76 100644 --- a/docs/sdk/typescript/graphql/types/type-aliases/DailyEscrowData.md +++ b/docs/sdk/typescript/graphql/types/type-aliases/DailyEscrowData.md @@ -8,7 +8,7 @@ > **DailyEscrowData** = `object` -Defined in: [graphql/types.ts:83](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L83) +Defined in: [graphql/types.ts:83](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L83) ## Properties @@ -16,7 +16,7 @@ Defined in: [graphql/types.ts:83](https://github.com/humanprotocol/human-protoco > **escrowsCancelled**: `number` -Defined in: [graphql/types.ts:89](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L89) +Defined in: [graphql/types.ts:89](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L89) *** @@ -24,7 +24,7 @@ Defined in: [graphql/types.ts:89](https://github.com/humanprotocol/human-protoco > **escrowsPaid**: `number` -Defined in: [graphql/types.ts:88](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L88) +Defined in: [graphql/types.ts:88](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L88) *** @@ -32,7 +32,7 @@ Defined in: [graphql/types.ts:88](https://github.com/humanprotocol/human-protoco > **escrowsPending**: `number` -Defined in: [graphql/types.ts:86](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L86) +Defined in: [graphql/types.ts:86](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L86) *** @@ -40,7 +40,7 @@ Defined in: [graphql/types.ts:86](https://github.com/humanprotocol/human-protoco > **escrowsSolved**: `number` -Defined in: [graphql/types.ts:87](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L87) +Defined in: [graphql/types.ts:87](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L87) *** @@ -48,7 +48,7 @@ Defined in: [graphql/types.ts:87](https://github.com/humanprotocol/human-protoco > **escrowsTotal**: `number` -Defined in: [graphql/types.ts:85](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L85) +Defined in: [graphql/types.ts:85](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L85) *** @@ -56,4 +56,4 @@ Defined in: [graphql/types.ts:85](https://github.com/humanprotocol/human-protoco > **timestamp**: `Date` -Defined in: [graphql/types.ts:84](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L84) +Defined in: [graphql/types.ts:84](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L84) diff --git a/docs/sdk/typescript/graphql/types/type-aliases/DailyHMTData.md b/docs/sdk/typescript/graphql/types/type-aliases/DailyHMTData.md index d462fc66dd..fd8a63c3bb 100644 --- a/docs/sdk/typescript/graphql/types/type-aliases/DailyHMTData.md +++ b/docs/sdk/typescript/graphql/types/type-aliases/DailyHMTData.md @@ -8,7 +8,7 @@ > **DailyHMTData** = `object` -Defined in: [graphql/types.ts:127](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L127) +Defined in: [graphql/types.ts:127](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L127) ## Properties @@ -16,7 +16,7 @@ Defined in: [graphql/types.ts:127](https://github.com/humanprotocol/human-protoc > **dailyUniqueReceivers**: `number` -Defined in: [graphql/types.ts:132](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L132) +Defined in: [graphql/types.ts:132](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L132) *** @@ -24,7 +24,7 @@ Defined in: [graphql/types.ts:132](https://github.com/humanprotocol/human-protoc > **dailyUniqueSenders**: `number` -Defined in: [graphql/types.ts:131](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L131) +Defined in: [graphql/types.ts:131](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L131) *** @@ -32,7 +32,7 @@ Defined in: [graphql/types.ts:131](https://github.com/humanprotocol/human-protoc > **timestamp**: `Date` -Defined in: [graphql/types.ts:128](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L128) +Defined in: [graphql/types.ts:128](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L128) *** @@ -40,7 +40,7 @@ Defined in: [graphql/types.ts:128](https://github.com/humanprotocol/human-protoc > **totalTransactionAmount**: `bigint` -Defined in: [graphql/types.ts:129](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L129) +Defined in: [graphql/types.ts:129](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L129) *** @@ -48,4 +48,4 @@ Defined in: [graphql/types.ts:129](https://github.com/humanprotocol/human-protoc > **totalTransactionCount**: `number` -Defined in: [graphql/types.ts:130](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L130) +Defined in: [graphql/types.ts:130](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L130) diff --git a/docs/sdk/typescript/graphql/types/type-aliases/DailyPaymentData.md b/docs/sdk/typescript/graphql/types/type-aliases/DailyPaymentData.md index 2e99abe95c..1b819048e6 100644 --- a/docs/sdk/typescript/graphql/types/type-aliases/DailyPaymentData.md +++ b/docs/sdk/typescript/graphql/types/type-aliases/DailyPaymentData.md @@ -8,7 +8,7 @@ > **DailyPaymentData** = `object` -Defined in: [graphql/types.ts:106](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L106) +Defined in: [graphql/types.ts:106](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L106) ## Properties @@ -16,7 +16,7 @@ Defined in: [graphql/types.ts:106](https://github.com/humanprotocol/human-protoc > **averageAmountPerWorker**: `bigint` -Defined in: [graphql/types.ts:110](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L110) +Defined in: [graphql/types.ts:110](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L110) *** @@ -24,7 +24,7 @@ Defined in: [graphql/types.ts:110](https://github.com/humanprotocol/human-protoc > **timestamp**: `Date` -Defined in: [graphql/types.ts:107](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L107) +Defined in: [graphql/types.ts:107](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L107) *** @@ -32,7 +32,7 @@ Defined in: [graphql/types.ts:107](https://github.com/humanprotocol/human-protoc > **totalAmountPaid**: `bigint` -Defined in: [graphql/types.ts:108](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L108) +Defined in: [graphql/types.ts:108](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L108) *** @@ -40,4 +40,4 @@ Defined in: [graphql/types.ts:108](https://github.com/humanprotocol/human-protoc > **totalCount**: `number` -Defined in: [graphql/types.ts:109](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L109) +Defined in: [graphql/types.ts:109](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L109) diff --git a/docs/sdk/typescript/graphql/types/type-aliases/DailyTaskData.md b/docs/sdk/typescript/graphql/types/type-aliases/DailyTaskData.md index 5eedf9a297..5402adf32f 100644 --- a/docs/sdk/typescript/graphql/types/type-aliases/DailyTaskData.md +++ b/docs/sdk/typescript/graphql/types/type-aliases/DailyTaskData.md @@ -8,7 +8,7 @@ > **DailyTaskData** = `object` -Defined in: [graphql/types.ts:148](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L148) +Defined in: [graphql/types.ts:148](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L148) ## Properties @@ -16,7 +16,7 @@ Defined in: [graphql/types.ts:148](https://github.com/humanprotocol/human-protoc > **tasksSolved**: `number` -Defined in: [graphql/types.ts:151](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L151) +Defined in: [graphql/types.ts:151](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L151) *** @@ -24,7 +24,7 @@ Defined in: [graphql/types.ts:151](https://github.com/humanprotocol/human-protoc > **tasksTotal**: `number` -Defined in: [graphql/types.ts:150](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L150) +Defined in: [graphql/types.ts:150](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L150) *** @@ -32,4 +32,4 @@ Defined in: [graphql/types.ts:150](https://github.com/humanprotocol/human-protoc > **timestamp**: `Date` -Defined in: [graphql/types.ts:149](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L149) +Defined in: [graphql/types.ts:149](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L149) diff --git a/docs/sdk/typescript/graphql/types/type-aliases/DailyWorkerData.md b/docs/sdk/typescript/graphql/types/type-aliases/DailyWorkerData.md index 3f0de1eda1..b92ad19dd2 100644 --- a/docs/sdk/typescript/graphql/types/type-aliases/DailyWorkerData.md +++ b/docs/sdk/typescript/graphql/types/type-aliases/DailyWorkerData.md @@ -8,7 +8,7 @@ > **DailyWorkerData** = `object` -Defined in: [graphql/types.ts:97](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L97) +Defined in: [graphql/types.ts:97](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L97) ## Properties @@ -16,7 +16,7 @@ Defined in: [graphql/types.ts:97](https://github.com/humanprotocol/human-protoco > **activeWorkers**: `number` -Defined in: [graphql/types.ts:99](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L99) +Defined in: [graphql/types.ts:99](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L99) *** @@ -24,4 +24,4 @@ Defined in: [graphql/types.ts:99](https://github.com/humanprotocol/human-protoco > **timestamp**: `Date` -Defined in: [graphql/types.ts:98](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L98) +Defined in: [graphql/types.ts:98](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L98) diff --git a/docs/sdk/typescript/graphql/types/type-aliases/EscrowData.md b/docs/sdk/typescript/graphql/types/type-aliases/EscrowData.md index 4358f2f7aa..f296047230 100644 --- a/docs/sdk/typescript/graphql/types/type-aliases/EscrowData.md +++ b/docs/sdk/typescript/graphql/types/type-aliases/EscrowData.md @@ -8,7 +8,7 @@ > **EscrowData** = `object` -Defined in: [graphql/types.ts:3](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L3) +Defined in: [graphql/types.ts:3](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L3) ## Properties @@ -16,7 +16,7 @@ Defined in: [graphql/types.ts:3](https://github.com/humanprotocol/human-protocol > **address**: `string` -Defined in: [graphql/types.ts:5](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L5) +Defined in: [graphql/types.ts:5](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L5) *** @@ -24,7 +24,7 @@ Defined in: [graphql/types.ts:5](https://github.com/humanprotocol/human-protocol > **amountPaid**: `string` -Defined in: [graphql/types.ts:6](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L6) +Defined in: [graphql/types.ts:6](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L6) *** @@ -32,7 +32,7 @@ Defined in: [graphql/types.ts:6](https://github.com/humanprotocol/human-protocol > **balance**: `string` -Defined in: [graphql/types.ts:7](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L7) +Defined in: [graphql/types.ts:7](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L7) *** @@ -40,7 +40,7 @@ Defined in: [graphql/types.ts:7](https://github.com/humanprotocol/human-protocol > **chainId**: `number` -Defined in: [graphql/types.ts:22](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L22) +Defined in: [graphql/types.ts:22](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L22) *** @@ -48,7 +48,7 @@ Defined in: [graphql/types.ts:22](https://github.com/humanprotocol/human-protoco > **count**: `string` -Defined in: [graphql/types.ts:8](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L8) +Defined in: [graphql/types.ts:8](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L8) *** @@ -56,7 +56,7 @@ Defined in: [graphql/types.ts:8](https://github.com/humanprotocol/human-protocol > **createdAt**: `string` -Defined in: [graphql/types.ts:21](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L21) +Defined in: [graphql/types.ts:21](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L21) *** @@ -64,7 +64,7 @@ Defined in: [graphql/types.ts:21](https://github.com/humanprotocol/human-protoco > `optional` **exchangeOracle**: `string` -Defined in: [graphql/types.ts:17](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L17) +Defined in: [graphql/types.ts:17](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L17) *** @@ -72,7 +72,7 @@ Defined in: [graphql/types.ts:17](https://github.com/humanprotocol/human-protoco > **factoryAddress**: `string` -Defined in: [graphql/types.ts:9](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L9) +Defined in: [graphql/types.ts:9](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L9) *** @@ -80,7 +80,7 @@ Defined in: [graphql/types.ts:9](https://github.com/humanprotocol/human-protocol > `optional` **finalResultsUrl**: `string` -Defined in: [graphql/types.ts:10](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L10) +Defined in: [graphql/types.ts:10](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L10) *** @@ -88,7 +88,7 @@ Defined in: [graphql/types.ts:10](https://github.com/humanprotocol/human-protoco > **id**: `string` -Defined in: [graphql/types.ts:4](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L4) +Defined in: [graphql/types.ts:4](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L4) *** @@ -96,7 +96,7 @@ Defined in: [graphql/types.ts:4](https://github.com/humanprotocol/human-protocol > `optional` **intermediateResultsUrl**: `string` -Defined in: [graphql/types.ts:11](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L11) +Defined in: [graphql/types.ts:11](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L11) *** @@ -104,7 +104,7 @@ Defined in: [graphql/types.ts:11](https://github.com/humanprotocol/human-protoco > **launcher**: `string` -Defined in: [graphql/types.ts:12](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L12) +Defined in: [graphql/types.ts:12](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L12) *** @@ -112,7 +112,7 @@ Defined in: [graphql/types.ts:12](https://github.com/humanprotocol/human-protoco > `optional` **manifestHash**: `string` -Defined in: [graphql/types.ts:13](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L13) +Defined in: [graphql/types.ts:13](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L13) *** @@ -120,7 +120,7 @@ Defined in: [graphql/types.ts:13](https://github.com/humanprotocol/human-protoco > `optional` **manifestUrl**: `string` -Defined in: [graphql/types.ts:14](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L14) +Defined in: [graphql/types.ts:14](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L14) *** @@ -128,7 +128,7 @@ Defined in: [graphql/types.ts:14](https://github.com/humanprotocol/human-protoco > `optional` **recordingOracle**: `string` -Defined in: [graphql/types.ts:15](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L15) +Defined in: [graphql/types.ts:15](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L15) *** @@ -136,7 +136,7 @@ Defined in: [graphql/types.ts:15](https://github.com/humanprotocol/human-protoco > `optional` **reputationOracle**: `string` -Defined in: [graphql/types.ts:16](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L16) +Defined in: [graphql/types.ts:16](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L16) *** @@ -144,7 +144,7 @@ Defined in: [graphql/types.ts:16](https://github.com/humanprotocol/human-protoco > **status**: `string` -Defined in: [graphql/types.ts:18](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L18) +Defined in: [graphql/types.ts:18](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L18) *** @@ -152,7 +152,7 @@ Defined in: [graphql/types.ts:18](https://github.com/humanprotocol/human-protoco > **token**: `string` -Defined in: [graphql/types.ts:19](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L19) +Defined in: [graphql/types.ts:19](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L19) *** @@ -160,4 +160,4 @@ Defined in: [graphql/types.ts:19](https://github.com/humanprotocol/human-protoco > **totalFundedAmount**: `string` -Defined in: [graphql/types.ts:20](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L20) +Defined in: [graphql/types.ts:20](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L20) diff --git a/docs/sdk/typescript/graphql/types/type-aliases/EscrowStatistics.md b/docs/sdk/typescript/graphql/types/type-aliases/EscrowStatistics.md index 3e0f3279a2..2b5c6215b9 100644 --- a/docs/sdk/typescript/graphql/types/type-aliases/EscrowStatistics.md +++ b/docs/sdk/typescript/graphql/types/type-aliases/EscrowStatistics.md @@ -8,7 +8,7 @@ > **EscrowStatistics** = `object` -Defined in: [graphql/types.ts:92](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L92) +Defined in: [graphql/types.ts:92](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L92) ## Properties @@ -16,7 +16,7 @@ Defined in: [graphql/types.ts:92](https://github.com/humanprotocol/human-protoco > **dailyEscrowsData**: [`DailyEscrowData`](DailyEscrowData.md)[] -Defined in: [graphql/types.ts:94](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L94) +Defined in: [graphql/types.ts:94](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L94) *** @@ -24,4 +24,4 @@ Defined in: [graphql/types.ts:94](https://github.com/humanprotocol/human-protoco > **totalEscrows**: `number` -Defined in: [graphql/types.ts:93](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L93) +Defined in: [graphql/types.ts:93](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L93) diff --git a/docs/sdk/typescript/graphql/types/type-aliases/EscrowStatisticsData.md b/docs/sdk/typescript/graphql/types/type-aliases/EscrowStatisticsData.md index 77affd2f7f..5bfe7d4fbc 100644 --- a/docs/sdk/typescript/graphql/types/type-aliases/EscrowStatisticsData.md +++ b/docs/sdk/typescript/graphql/types/type-aliases/EscrowStatisticsData.md @@ -8,7 +8,7 @@ > **EscrowStatisticsData** = `object` -Defined in: [graphql/types.ts:42](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L42) +Defined in: [graphql/types.ts:42](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L42) ## Properties @@ -16,7 +16,7 @@ Defined in: [graphql/types.ts:42](https://github.com/humanprotocol/human-protoco > **bulkPayoutEventCount**: `string` -Defined in: [graphql/types.ts:45](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L45) +Defined in: [graphql/types.ts:45](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L45) *** @@ -24,7 +24,7 @@ Defined in: [graphql/types.ts:45](https://github.com/humanprotocol/human-protoco > **cancelledStatusEventCount**: `string` -Defined in: [graphql/types.ts:47](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L47) +Defined in: [graphql/types.ts:47](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L47) *** @@ -32,7 +32,7 @@ Defined in: [graphql/types.ts:47](https://github.com/humanprotocol/human-protoco > **completedStatusEventCount**: `string` -Defined in: [graphql/types.ts:50](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L50) +Defined in: [graphql/types.ts:50](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L50) *** @@ -40,7 +40,7 @@ Defined in: [graphql/types.ts:50](https://github.com/humanprotocol/human-protoco > **fundEventCount**: `string` -Defined in: [graphql/types.ts:43](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L43) +Defined in: [graphql/types.ts:43](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L43) *** @@ -48,7 +48,7 @@ Defined in: [graphql/types.ts:43](https://github.com/humanprotocol/human-protoco > **paidStatusEventCount**: `string` -Defined in: [graphql/types.ts:49](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L49) +Defined in: [graphql/types.ts:49](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L49) *** @@ -56,7 +56,7 @@ Defined in: [graphql/types.ts:49](https://github.com/humanprotocol/human-protoco > **partialStatusEventCount**: `string` -Defined in: [graphql/types.ts:48](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L48) +Defined in: [graphql/types.ts:48](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L48) *** @@ -64,7 +64,7 @@ Defined in: [graphql/types.ts:48](https://github.com/humanprotocol/human-protoco > **pendingStatusEventCount**: `string` -Defined in: [graphql/types.ts:46](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L46) +Defined in: [graphql/types.ts:46](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L46) *** @@ -72,7 +72,7 @@ Defined in: [graphql/types.ts:46](https://github.com/humanprotocol/human-protoco > **storeResultsEventCount**: `string` -Defined in: [graphql/types.ts:44](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L44) +Defined in: [graphql/types.ts:44](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L44) *** @@ -80,7 +80,7 @@ Defined in: [graphql/types.ts:44](https://github.com/humanprotocol/human-protoco > **totalEscrowCount**: `string` -Defined in: [graphql/types.ts:52](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L52) +Defined in: [graphql/types.ts:52](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L52) *** @@ -88,4 +88,4 @@ Defined in: [graphql/types.ts:52](https://github.com/humanprotocol/human-protoco > **totalEventCount**: `string` -Defined in: [graphql/types.ts:51](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L51) +Defined in: [graphql/types.ts:51](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L51) diff --git a/docs/sdk/typescript/graphql/types/type-aliases/EventDayData.md b/docs/sdk/typescript/graphql/types/type-aliases/EventDayData.md index a0f435a431..b9c698248d 100644 --- a/docs/sdk/typescript/graphql/types/type-aliases/EventDayData.md +++ b/docs/sdk/typescript/graphql/types/type-aliases/EventDayData.md @@ -8,7 +8,7 @@ > **EventDayData** = `object` -Defined in: [graphql/types.ts:55](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L55) +Defined in: [graphql/types.ts:55](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L55) ## Properties @@ -16,7 +16,7 @@ Defined in: [graphql/types.ts:55](https://github.com/humanprotocol/human-protoco > **dailyBulkPayoutEventCount**: `string` -Defined in: [graphql/types.ts:59](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L59) +Defined in: [graphql/types.ts:59](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L59) *** @@ -24,7 +24,7 @@ Defined in: [graphql/types.ts:59](https://github.com/humanprotocol/human-protoco > **dailyCancelledStatusEventCount**: `string` -Defined in: [graphql/types.ts:61](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L61) +Defined in: [graphql/types.ts:61](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L61) *** @@ -32,7 +32,7 @@ Defined in: [graphql/types.ts:61](https://github.com/humanprotocol/human-protoco > **dailyCompletedStatusEventCount**: `string` -Defined in: [graphql/types.ts:64](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L64) +Defined in: [graphql/types.ts:64](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L64) *** @@ -40,7 +40,7 @@ Defined in: [graphql/types.ts:64](https://github.com/humanprotocol/human-protoco > **dailyEscrowCount**: `string` -Defined in: [graphql/types.ts:66](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L66) +Defined in: [graphql/types.ts:66](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L66) *** @@ -48,7 +48,7 @@ Defined in: [graphql/types.ts:66](https://github.com/humanprotocol/human-protoco > **dailyFundEventCount**: `string` -Defined in: [graphql/types.ts:57](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L57) +Defined in: [graphql/types.ts:57](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L57) *** @@ -56,7 +56,7 @@ Defined in: [graphql/types.ts:57](https://github.com/humanprotocol/human-protoco > **dailyHMTTransferAmount**: `string` -Defined in: [graphql/types.ts:71](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L71) +Defined in: [graphql/types.ts:71](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L71) *** @@ -64,7 +64,7 @@ Defined in: [graphql/types.ts:71](https://github.com/humanprotocol/human-protoco > **dailyHMTTransferCount**: `string` -Defined in: [graphql/types.ts:70](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L70) +Defined in: [graphql/types.ts:70](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L70) *** @@ -72,7 +72,7 @@ Defined in: [graphql/types.ts:70](https://github.com/humanprotocol/human-protoco > **dailyPaidStatusEventCount**: `string` -Defined in: [graphql/types.ts:63](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L63) +Defined in: [graphql/types.ts:63](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L63) *** @@ -80,7 +80,7 @@ Defined in: [graphql/types.ts:63](https://github.com/humanprotocol/human-protoco > **dailyPartialStatusEventCount**: `string` -Defined in: [graphql/types.ts:62](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L62) +Defined in: [graphql/types.ts:62](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L62) *** @@ -88,7 +88,7 @@ Defined in: [graphql/types.ts:62](https://github.com/humanprotocol/human-protoco > **dailyPayoutAmount**: `string` -Defined in: [graphql/types.ts:69](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L69) +Defined in: [graphql/types.ts:69](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L69) *** @@ -96,7 +96,7 @@ Defined in: [graphql/types.ts:69](https://github.com/humanprotocol/human-protoco > **dailyPayoutCount**: `string` -Defined in: [graphql/types.ts:68](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L68) +Defined in: [graphql/types.ts:68](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L68) *** @@ -104,7 +104,7 @@ Defined in: [graphql/types.ts:68](https://github.com/humanprotocol/human-protoco > **dailyPendingStatusEventCount**: `string` -Defined in: [graphql/types.ts:60](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L60) +Defined in: [graphql/types.ts:60](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L60) *** @@ -112,7 +112,7 @@ Defined in: [graphql/types.ts:60](https://github.com/humanprotocol/human-protoco > **dailyStoreResultsEventCount**: `string` -Defined in: [graphql/types.ts:58](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L58) +Defined in: [graphql/types.ts:58](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L58) *** @@ -120,7 +120,7 @@ Defined in: [graphql/types.ts:58](https://github.com/humanprotocol/human-protoco > **dailyTotalEventCount**: `string` -Defined in: [graphql/types.ts:65](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L65) +Defined in: [graphql/types.ts:65](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L65) *** @@ -128,7 +128,7 @@ Defined in: [graphql/types.ts:65](https://github.com/humanprotocol/human-protoco > **dailyUniqueReceivers**: `string` -Defined in: [graphql/types.ts:73](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L73) +Defined in: [graphql/types.ts:73](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L73) *** @@ -136,7 +136,7 @@ Defined in: [graphql/types.ts:73](https://github.com/humanprotocol/human-protoco > **dailyUniqueSenders**: `string` -Defined in: [graphql/types.ts:72](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L72) +Defined in: [graphql/types.ts:72](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L72) *** @@ -144,7 +144,7 @@ Defined in: [graphql/types.ts:72](https://github.com/humanprotocol/human-protoco > **dailyWorkerCount**: `string` -Defined in: [graphql/types.ts:67](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L67) +Defined in: [graphql/types.ts:67](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L67) *** @@ -152,4 +152,4 @@ Defined in: [graphql/types.ts:67](https://github.com/humanprotocol/human-protoco > **timestamp**: `string` -Defined in: [graphql/types.ts:56](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L56) +Defined in: [graphql/types.ts:56](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L56) diff --git a/docs/sdk/typescript/graphql/types/type-aliases/HMTHolder.md b/docs/sdk/typescript/graphql/types/type-aliases/HMTHolder.md index 37f218e868..c41c842e92 100644 --- a/docs/sdk/typescript/graphql/types/type-aliases/HMTHolder.md +++ b/docs/sdk/typescript/graphql/types/type-aliases/HMTHolder.md @@ -8,7 +8,7 @@ > **HMTHolder** = `object` -Defined in: [graphql/types.ts:122](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L122) +Defined in: [graphql/types.ts:122](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L122) ## Properties @@ -16,7 +16,7 @@ Defined in: [graphql/types.ts:122](https://github.com/humanprotocol/human-protoc > **address**: `string` -Defined in: [graphql/types.ts:123](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L123) +Defined in: [graphql/types.ts:123](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L123) *** @@ -24,4 +24,4 @@ Defined in: [graphql/types.ts:123](https://github.com/humanprotocol/human-protoc > **balance**: `bigint` -Defined in: [graphql/types.ts:124](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L124) +Defined in: [graphql/types.ts:124](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L124) diff --git a/docs/sdk/typescript/graphql/types/type-aliases/HMTHolderData.md b/docs/sdk/typescript/graphql/types/type-aliases/HMTHolderData.md index 67077c7e25..4d66129694 100644 --- a/docs/sdk/typescript/graphql/types/type-aliases/HMTHolderData.md +++ b/docs/sdk/typescript/graphql/types/type-aliases/HMTHolderData.md @@ -8,7 +8,7 @@ > **HMTHolderData** = `object` -Defined in: [graphql/types.ts:117](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L117) +Defined in: [graphql/types.ts:117](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L117) ## Properties @@ -16,7 +16,7 @@ Defined in: [graphql/types.ts:117](https://github.com/humanprotocol/human-protoc > **address**: `string` -Defined in: [graphql/types.ts:118](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L118) +Defined in: [graphql/types.ts:118](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L118) *** @@ -24,4 +24,4 @@ Defined in: [graphql/types.ts:118](https://github.com/humanprotocol/human-protoc > **balance**: `string` -Defined in: [graphql/types.ts:119](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L119) +Defined in: [graphql/types.ts:119](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L119) diff --git a/docs/sdk/typescript/graphql/types/type-aliases/HMTStatistics.md b/docs/sdk/typescript/graphql/types/type-aliases/HMTStatistics.md index 5f3c55eb13..dd4b9e3bd9 100644 --- a/docs/sdk/typescript/graphql/types/type-aliases/HMTStatistics.md +++ b/docs/sdk/typescript/graphql/types/type-aliases/HMTStatistics.md @@ -8,7 +8,7 @@ > **HMTStatistics** = `object` -Defined in: [graphql/types.ts:135](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L135) +Defined in: [graphql/types.ts:135](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L135) ## Properties @@ -16,7 +16,7 @@ Defined in: [graphql/types.ts:135](https://github.com/humanprotocol/human-protoc > **totalHolders**: `number` -Defined in: [graphql/types.ts:138](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L138) +Defined in: [graphql/types.ts:138](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L138) *** @@ -24,7 +24,7 @@ Defined in: [graphql/types.ts:138](https://github.com/humanprotocol/human-protoc > **totalTransferAmount**: `bigint` -Defined in: [graphql/types.ts:136](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L136) +Defined in: [graphql/types.ts:136](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L136) *** @@ -32,4 +32,4 @@ Defined in: [graphql/types.ts:136](https://github.com/humanprotocol/human-protoc > **totalTransferCount**: `number` -Defined in: [graphql/types.ts:137](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L137) +Defined in: [graphql/types.ts:137](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L137) diff --git a/docs/sdk/typescript/graphql/types/type-aliases/HMTStatisticsData.md b/docs/sdk/typescript/graphql/types/type-aliases/HMTStatisticsData.md index fecd65a138..d7983a9ce0 100644 --- a/docs/sdk/typescript/graphql/types/type-aliases/HMTStatisticsData.md +++ b/docs/sdk/typescript/graphql/types/type-aliases/HMTStatisticsData.md @@ -8,7 +8,7 @@ > **HMTStatisticsData** = `object` -Defined in: [graphql/types.ts:33](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L33) +Defined in: [graphql/types.ts:33](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L33) ## Properties @@ -16,7 +16,7 @@ Defined in: [graphql/types.ts:33](https://github.com/humanprotocol/human-protoco > **holders**: `string` -Defined in: [graphql/types.ts:39](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L39) +Defined in: [graphql/types.ts:39](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L39) *** @@ -24,7 +24,7 @@ Defined in: [graphql/types.ts:39](https://github.com/humanprotocol/human-protoco > **totalApprovalEventCount**: `string` -Defined in: [graphql/types.ts:36](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L36) +Defined in: [graphql/types.ts:36](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L36) *** @@ -32,7 +32,7 @@ Defined in: [graphql/types.ts:36](https://github.com/humanprotocol/human-protoco > **totalBulkApprovalEventCount**: `string` -Defined in: [graphql/types.ts:37](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L37) +Defined in: [graphql/types.ts:37](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L37) *** @@ -40,7 +40,7 @@ Defined in: [graphql/types.ts:37](https://github.com/humanprotocol/human-protoco > **totalBulkTransferEventCount**: `string` -Defined in: [graphql/types.ts:35](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L35) +Defined in: [graphql/types.ts:35](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L35) *** @@ -48,7 +48,7 @@ Defined in: [graphql/types.ts:35](https://github.com/humanprotocol/human-protoco > **totalTransferEventCount**: `string` -Defined in: [graphql/types.ts:34](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L34) +Defined in: [graphql/types.ts:34](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L34) *** @@ -56,4 +56,4 @@ Defined in: [graphql/types.ts:34](https://github.com/humanprotocol/human-protoco > **totalValueTransfered**: `string` -Defined in: [graphql/types.ts:38](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L38) +Defined in: [graphql/types.ts:38](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L38) diff --git a/docs/sdk/typescript/graphql/types/type-aliases/IMData.md b/docs/sdk/typescript/graphql/types/type-aliases/IMData.md index f79755e20a..e2861dd94b 100644 --- a/docs/sdk/typescript/graphql/types/type-aliases/IMData.md +++ b/docs/sdk/typescript/graphql/types/type-aliases/IMData.md @@ -8,4 +8,4 @@ > **IMData** = `Record`\<`string`, [`IMDataEntity`](IMDataEntity.md)\> -Defined in: [graphql/types.ts:146](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L146) +Defined in: [graphql/types.ts:146](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L146) diff --git a/docs/sdk/typescript/graphql/types/type-aliases/IMDataEntity.md b/docs/sdk/typescript/graphql/types/type-aliases/IMDataEntity.md index 4e93407f15..c4d484ef1f 100644 --- a/docs/sdk/typescript/graphql/types/type-aliases/IMDataEntity.md +++ b/docs/sdk/typescript/graphql/types/type-aliases/IMDataEntity.md @@ -8,7 +8,7 @@ > **IMDataEntity** = `object` -Defined in: [graphql/types.ts:141](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L141) +Defined in: [graphql/types.ts:141](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L141) ## Properties @@ -16,7 +16,7 @@ Defined in: [graphql/types.ts:141](https://github.com/humanprotocol/human-protoc > **served**: `number` -Defined in: [graphql/types.ts:142](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L142) +Defined in: [graphql/types.ts:142](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L142) *** @@ -24,4 +24,4 @@ Defined in: [graphql/types.ts:142](https://github.com/humanprotocol/human-protoc > **solved**: `number` -Defined in: [graphql/types.ts:143](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L143) +Defined in: [graphql/types.ts:143](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L143) diff --git a/docs/sdk/typescript/graphql/types/type-aliases/KVStoreData.md b/docs/sdk/typescript/graphql/types/type-aliases/KVStoreData.md index 7f832cefbb..acf30149bb 100644 --- a/docs/sdk/typescript/graphql/types/type-aliases/KVStoreData.md +++ b/docs/sdk/typescript/graphql/types/type-aliases/KVStoreData.md @@ -8,7 +8,7 @@ > **KVStoreData** = `object` -Defined in: [graphql/types.ts:165](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L165) +Defined in: [graphql/types.ts:165](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L165) ## Properties @@ -16,7 +16,7 @@ Defined in: [graphql/types.ts:165](https://github.com/humanprotocol/human-protoc > **address**: `string` -Defined in: [graphql/types.ts:167](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L167) +Defined in: [graphql/types.ts:167](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L167) *** @@ -24,7 +24,7 @@ Defined in: [graphql/types.ts:167](https://github.com/humanprotocol/human-protoc > **block**: `number` -Defined in: [graphql/types.ts:171](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L171) +Defined in: [graphql/types.ts:171](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L171) *** @@ -32,7 +32,7 @@ Defined in: [graphql/types.ts:171](https://github.com/humanprotocol/human-protoc > **id**: `string` -Defined in: [graphql/types.ts:166](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L166) +Defined in: [graphql/types.ts:166](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L166) *** @@ -40,7 +40,7 @@ Defined in: [graphql/types.ts:166](https://github.com/humanprotocol/human-protoc > **key**: `string` -Defined in: [graphql/types.ts:168](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L168) +Defined in: [graphql/types.ts:168](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L168) *** @@ -48,7 +48,7 @@ Defined in: [graphql/types.ts:168](https://github.com/humanprotocol/human-protoc > **timestamp**: `Date` -Defined in: [graphql/types.ts:170](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L170) +Defined in: [graphql/types.ts:170](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L170) *** @@ -56,4 +56,4 @@ Defined in: [graphql/types.ts:170](https://github.com/humanprotocol/human-protoc > **value**: `string` -Defined in: [graphql/types.ts:169](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L169) +Defined in: [graphql/types.ts:169](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L169) diff --git a/docs/sdk/typescript/graphql/types/type-aliases/PaymentStatistics.md b/docs/sdk/typescript/graphql/types/type-aliases/PaymentStatistics.md index 5ed4862749..43c8832b84 100644 --- a/docs/sdk/typescript/graphql/types/type-aliases/PaymentStatistics.md +++ b/docs/sdk/typescript/graphql/types/type-aliases/PaymentStatistics.md @@ -8,7 +8,7 @@ > **PaymentStatistics** = `object` -Defined in: [graphql/types.ts:113](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L113) +Defined in: [graphql/types.ts:113](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L113) ## Properties @@ -16,4 +16,4 @@ Defined in: [graphql/types.ts:113](https://github.com/humanprotocol/human-protoc > **dailyPaymentsData**: [`DailyPaymentData`](DailyPaymentData.md)[] -Defined in: [graphql/types.ts:114](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L114) +Defined in: [graphql/types.ts:114](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L114) diff --git a/docs/sdk/typescript/graphql/types/type-aliases/PayoutData.md b/docs/sdk/typescript/graphql/types/type-aliases/PayoutData.md index 148fd0a477..5c010d8c87 100644 --- a/docs/sdk/typescript/graphql/types/type-aliases/PayoutData.md +++ b/docs/sdk/typescript/graphql/types/type-aliases/PayoutData.md @@ -8,7 +8,7 @@ > **PayoutData** = `object` -Defined in: [graphql/types.ts:25](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L25) +Defined in: [graphql/types.ts:25](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L25) ## Properties @@ -16,7 +16,7 @@ Defined in: [graphql/types.ts:25](https://github.com/humanprotocol/human-protoco > **amount**: `string` -Defined in: [graphql/types.ts:29](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L29) +Defined in: [graphql/types.ts:29](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L29) *** @@ -24,7 +24,7 @@ Defined in: [graphql/types.ts:29](https://github.com/humanprotocol/human-protoco > **createdAt**: `string` -Defined in: [graphql/types.ts:30](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L30) +Defined in: [graphql/types.ts:30](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L30) *** @@ -32,7 +32,7 @@ Defined in: [graphql/types.ts:30](https://github.com/humanprotocol/human-protoco > **escrowAddress**: `string` -Defined in: [graphql/types.ts:27](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L27) +Defined in: [graphql/types.ts:27](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L27) *** @@ -40,7 +40,7 @@ Defined in: [graphql/types.ts:27](https://github.com/humanprotocol/human-protoco > **id**: `string` -Defined in: [graphql/types.ts:26](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L26) +Defined in: [graphql/types.ts:26](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L26) *** @@ -48,4 +48,4 @@ Defined in: [graphql/types.ts:26](https://github.com/humanprotocol/human-protoco > **recipient**: `string` -Defined in: [graphql/types.ts:28](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L28) +Defined in: [graphql/types.ts:28](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L28) diff --git a/docs/sdk/typescript/graphql/types/type-aliases/RewardAddedEventData.md b/docs/sdk/typescript/graphql/types/type-aliases/RewardAddedEventData.md index 81df5cdc2e..697896aa55 100644 --- a/docs/sdk/typescript/graphql/types/type-aliases/RewardAddedEventData.md +++ b/docs/sdk/typescript/graphql/types/type-aliases/RewardAddedEventData.md @@ -8,7 +8,7 @@ > **RewardAddedEventData** = `object` -Defined in: [graphql/types.ts:76](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L76) +Defined in: [graphql/types.ts:76](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L76) ## Properties @@ -16,7 +16,7 @@ Defined in: [graphql/types.ts:76](https://github.com/humanprotocol/human-protoco > **amount**: `string` -Defined in: [graphql/types.ts:80](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L80) +Defined in: [graphql/types.ts:80](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L80) *** @@ -24,7 +24,7 @@ Defined in: [graphql/types.ts:80](https://github.com/humanprotocol/human-protoco > **escrowAddress**: `string` -Defined in: [graphql/types.ts:77](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L77) +Defined in: [graphql/types.ts:77](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L77) *** @@ -32,7 +32,7 @@ Defined in: [graphql/types.ts:77](https://github.com/humanprotocol/human-protoco > **slasher**: `string` -Defined in: [graphql/types.ts:79](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L79) +Defined in: [graphql/types.ts:79](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L79) *** @@ -40,4 +40,4 @@ Defined in: [graphql/types.ts:79](https://github.com/humanprotocol/human-protoco > **staker**: `string` -Defined in: [graphql/types.ts:78](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L78) +Defined in: [graphql/types.ts:78](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L78) diff --git a/docs/sdk/typescript/graphql/types/type-aliases/StatusEvent.md b/docs/sdk/typescript/graphql/types/type-aliases/StatusEvent.md index 13e1fb1373..7931572254 100644 --- a/docs/sdk/typescript/graphql/types/type-aliases/StatusEvent.md +++ b/docs/sdk/typescript/graphql/types/type-aliases/StatusEvent.md @@ -8,7 +8,7 @@ > **StatusEvent** = `object` -Defined in: [graphql/types.ts:158](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L158) +Defined in: [graphql/types.ts:158](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L158) ## Properties @@ -16,7 +16,7 @@ Defined in: [graphql/types.ts:158](https://github.com/humanprotocol/human-protoc > **chainId**: [`ChainId`](../../../enums/enumerations/ChainId.md) -Defined in: [graphql/types.ts:162](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L162) +Defined in: [graphql/types.ts:162](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L162) *** @@ -24,7 +24,7 @@ Defined in: [graphql/types.ts:162](https://github.com/humanprotocol/human-protoc > **escrowAddress**: `string` -Defined in: [graphql/types.ts:160](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L160) +Defined in: [graphql/types.ts:160](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L160) *** @@ -32,7 +32,7 @@ Defined in: [graphql/types.ts:160](https://github.com/humanprotocol/human-protoc > **status**: `string` -Defined in: [graphql/types.ts:161](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L161) +Defined in: [graphql/types.ts:161](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L161) *** @@ -40,4 +40,4 @@ Defined in: [graphql/types.ts:161](https://github.com/humanprotocol/human-protoc > **timestamp**: `number` -Defined in: [graphql/types.ts:159](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L159) +Defined in: [graphql/types.ts:159](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L159) diff --git a/docs/sdk/typescript/graphql/types/type-aliases/TaskStatistics.md b/docs/sdk/typescript/graphql/types/type-aliases/TaskStatistics.md index c120294344..ffc6f7a994 100644 --- a/docs/sdk/typescript/graphql/types/type-aliases/TaskStatistics.md +++ b/docs/sdk/typescript/graphql/types/type-aliases/TaskStatistics.md @@ -8,7 +8,7 @@ > **TaskStatistics** = `object` -Defined in: [graphql/types.ts:154](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L154) +Defined in: [graphql/types.ts:154](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L154) ## Properties @@ -16,4 +16,4 @@ Defined in: [graphql/types.ts:154](https://github.com/humanprotocol/human-protoc > **dailyTasksData**: [`DailyTaskData`](DailyTaskData.md)[] -Defined in: [graphql/types.ts:155](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L155) +Defined in: [graphql/types.ts:155](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L155) diff --git a/docs/sdk/typescript/graphql/types/type-aliases/WorkerStatistics.md b/docs/sdk/typescript/graphql/types/type-aliases/WorkerStatistics.md index 821fcbaa45..f8fa570ff2 100644 --- a/docs/sdk/typescript/graphql/types/type-aliases/WorkerStatistics.md +++ b/docs/sdk/typescript/graphql/types/type-aliases/WorkerStatistics.md @@ -8,7 +8,7 @@ > **WorkerStatistics** = `object` -Defined in: [graphql/types.ts:102](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L102) +Defined in: [graphql/types.ts:102](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L102) ## Properties @@ -16,4 +16,4 @@ Defined in: [graphql/types.ts:102](https://github.com/humanprotocol/human-protoc > **dailyWorkersData**: [`DailyWorkerData`](DailyWorkerData.md)[] -Defined in: [graphql/types.ts:103](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L103) +Defined in: [graphql/types.ts:103](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L103) diff --git a/docs/sdk/typescript/interfaces/README.md b/docs/sdk/typescript/interfaces/README.md index efff08ad39..e87131c5bb 100644 --- a/docs/sdk/typescript/interfaces/README.md +++ b/docs/sdk/typescript/interfaces/README.md @@ -8,6 +8,7 @@ ## Interfaces +- [ICancellationRefundFilter](interfaces/ICancellationRefundFilter.md) - [IEscrowConfig](interfaces/IEscrowConfig.md) - [IEscrowsFilter](interfaces/IEscrowsFilter.md) - [IHMTHoldersParams](interfaces/IHMTHoldersParams.md) diff --git a/docs/sdk/typescript/interfaces/interfaces/ICancellationRefundFilter.md b/docs/sdk/typescript/interfaces/interfaces/ICancellationRefundFilter.md new file mode 100644 index 0000000000..ac48434185 --- /dev/null +++ b/docs/sdk/typescript/interfaces/interfaces/ICancellationRefundFilter.md @@ -0,0 +1,89 @@ +[**@human-protocol/sdk**](../../README.md) + +*** + +[@human-protocol/sdk](../../modules.md) / [interfaces](../README.md) / ICancellationRefundFilter + +# Interface: ICancellationRefundFilter + +Defined in: [interfaces.ts:187](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L187) + +## Extends + +- [`IPagination`](IPagination.md) + +## Properties + +### chainId + +> **chainId**: [`ChainId`](../../enums/enumerations/ChainId.md) + +Defined in: [interfaces.ts:188](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L188) + +*** + +### escrowAddress? + +> `optional` **escrowAddress**: `string` + +Defined in: [interfaces.ts:189](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L189) + +*** + +### first? + +> `optional` **first**: `number` + +Defined in: [interfaces.ts:154](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L154) + +#### Inherited from + +[`IPagination`](IPagination.md).[`first`](IPagination.md#first) + +*** + +### from? + +> `optional` **from**: `Date` + +Defined in: [interfaces.ts:191](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L191) + +*** + +### orderDirection? + +> `optional` **orderDirection**: [`OrderDirection`](../../enums/enumerations/OrderDirection.md) + +Defined in: [interfaces.ts:156](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L156) + +#### Inherited from + +[`IPagination`](IPagination.md).[`orderDirection`](IPagination.md#orderdirection) + +*** + +### receiver? + +> `optional` **receiver**: `string` + +Defined in: [interfaces.ts:190](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L190) + +*** + +### skip? + +> `optional` **skip**: `number` + +Defined in: [interfaces.ts:155](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L155) + +#### Inherited from + +[`IPagination`](IPagination.md).[`skip`](IPagination.md#skip) + +*** + +### to? + +> `optional` **to**: `Date` + +Defined in: [interfaces.ts:192](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L192) diff --git a/docs/sdk/typescript/interfaces/interfaces/IEscrowConfig.md b/docs/sdk/typescript/interfaces/interfaces/IEscrowConfig.md index a5243170eb..45726786ed 100644 --- a/docs/sdk/typescript/interfaces/interfaces/IEscrowConfig.md +++ b/docs/sdk/typescript/interfaces/interfaces/IEscrowConfig.md @@ -6,7 +6,7 @@ # Interface: IEscrowConfig -Defined in: [interfaces.ts:79](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L79) +Defined in: [interfaces.ts:79](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L79) ## Properties @@ -14,7 +14,7 @@ Defined in: [interfaces.ts:79](https://github.com/humanprotocol/human-protocol/b > **exchangeOracle**: `string` -Defined in: [interfaces.ts:82](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L82) +Defined in: [interfaces.ts:82](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L82) *** @@ -22,7 +22,7 @@ Defined in: [interfaces.ts:82](https://github.com/humanprotocol/human-protocol/b > **exchangeOracleFee**: `bigint` -Defined in: [interfaces.ts:85](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L85) +Defined in: [interfaces.ts:85](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L85) *** @@ -30,7 +30,7 @@ Defined in: [interfaces.ts:85](https://github.com/humanprotocol/human-protocol/b > **manifestHash**: `string` -Defined in: [interfaces.ts:87](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L87) +Defined in: [interfaces.ts:87](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L87) *** @@ -38,7 +38,7 @@ Defined in: [interfaces.ts:87](https://github.com/humanprotocol/human-protocol/b > **manifestUrl**: `string` -Defined in: [interfaces.ts:86](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L86) +Defined in: [interfaces.ts:86](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L86) *** @@ -46,7 +46,7 @@ Defined in: [interfaces.ts:86](https://github.com/humanprotocol/human-protocol/b > **recordingOracle**: `string` -Defined in: [interfaces.ts:80](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L80) +Defined in: [interfaces.ts:80](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L80) *** @@ -54,7 +54,7 @@ Defined in: [interfaces.ts:80](https://github.com/humanprotocol/human-protocol/b > **recordingOracleFee**: `bigint` -Defined in: [interfaces.ts:83](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L83) +Defined in: [interfaces.ts:83](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L83) *** @@ -62,7 +62,7 @@ Defined in: [interfaces.ts:83](https://github.com/humanprotocol/human-protocol/b > **reputationOracle**: `string` -Defined in: [interfaces.ts:81](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L81) +Defined in: [interfaces.ts:81](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L81) *** @@ -70,4 +70,4 @@ Defined in: [interfaces.ts:81](https://github.com/humanprotocol/human-protocol/b > **reputationOracleFee**: `bigint` -Defined in: [interfaces.ts:84](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L84) +Defined in: [interfaces.ts:84](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L84) diff --git a/docs/sdk/typescript/interfaces/interfaces/IEscrowsFilter.md b/docs/sdk/typescript/interfaces/interfaces/IEscrowsFilter.md index 754568e1b8..b1d2976242 100644 --- a/docs/sdk/typescript/interfaces/interfaces/IEscrowsFilter.md +++ b/docs/sdk/typescript/interfaces/interfaces/IEscrowsFilter.md @@ -6,7 +6,7 @@ # Interface: IEscrowsFilter -Defined in: [interfaces.ts:67](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L67) +Defined in: [interfaces.ts:67](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L67) ## Extends @@ -18,7 +18,7 @@ Defined in: [interfaces.ts:67](https://github.com/humanprotocol/human-protocol/b > **chainId**: [`ChainId`](../../enums/enumerations/ChainId.md) -Defined in: [interfaces.ts:76](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L76) +Defined in: [interfaces.ts:76](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L76) *** @@ -26,7 +26,7 @@ Defined in: [interfaces.ts:76](https://github.com/humanprotocol/human-protocol/b > `optional` **exchangeOracle**: `string` -Defined in: [interfaces.ts:71](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L71) +Defined in: [interfaces.ts:71](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L71) *** @@ -34,7 +34,7 @@ Defined in: [interfaces.ts:71](https://github.com/humanprotocol/human-protocol/b > `optional` **first**: `number` -Defined in: [interfaces.ts:154](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L154) +Defined in: [interfaces.ts:154](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L154) #### Inherited from @@ -46,7 +46,7 @@ Defined in: [interfaces.ts:154](https://github.com/humanprotocol/human-protocol/ > `optional` **from**: `Date` -Defined in: [interfaces.ts:74](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L74) +Defined in: [interfaces.ts:74](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L74) *** @@ -54,7 +54,7 @@ Defined in: [interfaces.ts:74](https://github.com/humanprotocol/human-protocol/b > `optional` **jobRequesterId**: `string` -Defined in: [interfaces.ts:72](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L72) +Defined in: [interfaces.ts:72](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L72) *** @@ -62,7 +62,7 @@ Defined in: [interfaces.ts:72](https://github.com/humanprotocol/human-protocol/b > `optional` **launcher**: `string` -Defined in: [interfaces.ts:68](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L68) +Defined in: [interfaces.ts:68](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L68) *** @@ -70,7 +70,7 @@ Defined in: [interfaces.ts:68](https://github.com/humanprotocol/human-protocol/b > `optional` **orderDirection**: [`OrderDirection`](../../enums/enumerations/OrderDirection.md) -Defined in: [interfaces.ts:156](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L156) +Defined in: [interfaces.ts:156](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L156) #### Inherited from @@ -82,7 +82,7 @@ Defined in: [interfaces.ts:156](https://github.com/humanprotocol/human-protocol/ > `optional` **recordingOracle**: `string` -Defined in: [interfaces.ts:70](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L70) +Defined in: [interfaces.ts:70](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L70) *** @@ -90,7 +90,7 @@ Defined in: [interfaces.ts:70](https://github.com/humanprotocol/human-protocol/b > `optional` **reputationOracle**: `string` -Defined in: [interfaces.ts:69](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L69) +Defined in: [interfaces.ts:69](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L69) *** @@ -98,7 +98,7 @@ Defined in: [interfaces.ts:69](https://github.com/humanprotocol/human-protocol/b > `optional` **skip**: `number` -Defined in: [interfaces.ts:155](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L155) +Defined in: [interfaces.ts:155](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L155) #### Inherited from @@ -110,7 +110,7 @@ Defined in: [interfaces.ts:155](https://github.com/humanprotocol/human-protocol/ > `optional` **status**: [`EscrowStatus`](../../types/enumerations/EscrowStatus.md) -Defined in: [interfaces.ts:73](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L73) +Defined in: [interfaces.ts:73](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L73) *** @@ -118,4 +118,4 @@ Defined in: [interfaces.ts:73](https://github.com/humanprotocol/human-protocol/b > `optional` **to**: `Date` -Defined in: [interfaces.ts:75](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L75) +Defined in: [interfaces.ts:75](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L75) diff --git a/docs/sdk/typescript/interfaces/interfaces/IHMTHoldersParams.md b/docs/sdk/typescript/interfaces/interfaces/IHMTHoldersParams.md index 4f813323e5..d42d89017c 100644 --- a/docs/sdk/typescript/interfaces/interfaces/IHMTHoldersParams.md +++ b/docs/sdk/typescript/interfaces/interfaces/IHMTHoldersParams.md @@ -6,7 +6,7 @@ # Interface: IHMTHoldersParams -Defined in: [interfaces.ts:102](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L102) +Defined in: [interfaces.ts:102](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L102) ## Extends @@ -18,7 +18,7 @@ Defined in: [interfaces.ts:102](https://github.com/humanprotocol/human-protocol/ > `optional` **address**: `string` -Defined in: [interfaces.ts:103](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L103) +Defined in: [interfaces.ts:103](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L103) *** @@ -26,7 +26,7 @@ Defined in: [interfaces.ts:103](https://github.com/humanprotocol/human-protocol/ > `optional` **first**: `number` -Defined in: [interfaces.ts:154](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L154) +Defined in: [interfaces.ts:154](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L154) #### Inherited from @@ -38,7 +38,7 @@ Defined in: [interfaces.ts:154](https://github.com/humanprotocol/human-protocol/ > `optional` **orderDirection**: [`OrderDirection`](../../enums/enumerations/OrderDirection.md) -Defined in: [interfaces.ts:156](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L156) +Defined in: [interfaces.ts:156](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L156) #### Inherited from @@ -50,7 +50,7 @@ Defined in: [interfaces.ts:156](https://github.com/humanprotocol/human-protocol/ > `optional` **skip**: `number` -Defined in: [interfaces.ts:155](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L155) +Defined in: [interfaces.ts:155](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L155) #### Inherited from diff --git a/docs/sdk/typescript/interfaces/interfaces/IKVStore.md b/docs/sdk/typescript/interfaces/interfaces/IKVStore.md index 30b68f3065..2c4cc41f95 100644 --- a/docs/sdk/typescript/interfaces/interfaces/IKVStore.md +++ b/docs/sdk/typescript/interfaces/interfaces/IKVStore.md @@ -6,7 +6,7 @@ # Interface: IKVStore -Defined in: [interfaces.ts:114](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L114) +Defined in: [interfaces.ts:114](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L114) ## Properties @@ -14,7 +14,7 @@ Defined in: [interfaces.ts:114](https://github.com/humanprotocol/human-protocol/ > **key**: `string` -Defined in: [interfaces.ts:115](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L115) +Defined in: [interfaces.ts:115](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L115) *** @@ -22,4 +22,4 @@ Defined in: [interfaces.ts:115](https://github.com/humanprotocol/human-protocol/ > **value**: `string` -Defined in: [interfaces.ts:116](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L116) +Defined in: [interfaces.ts:116](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L116) diff --git a/docs/sdk/typescript/interfaces/interfaces/IKeyPair.md b/docs/sdk/typescript/interfaces/interfaces/IKeyPair.md index 98af225641..a2ddcb95d2 100644 --- a/docs/sdk/typescript/interfaces/interfaces/IKeyPair.md +++ b/docs/sdk/typescript/interfaces/interfaces/IKeyPair.md @@ -6,7 +6,7 @@ # Interface: IKeyPair -Defined in: [interfaces.ts:90](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L90) +Defined in: [interfaces.ts:90](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L90) ## Properties @@ -14,7 +14,7 @@ Defined in: [interfaces.ts:90](https://github.com/humanprotocol/human-protocol/b > **passphrase**: `string` -Defined in: [interfaces.ts:93](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L93) +Defined in: [interfaces.ts:93](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L93) *** @@ -22,7 +22,7 @@ Defined in: [interfaces.ts:93](https://github.com/humanprotocol/human-protocol/b > **privateKey**: `string` -Defined in: [interfaces.ts:91](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L91) +Defined in: [interfaces.ts:91](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L91) *** @@ -30,7 +30,7 @@ Defined in: [interfaces.ts:91](https://github.com/humanprotocol/human-protocol/b > **publicKey**: `string` -Defined in: [interfaces.ts:92](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L92) +Defined in: [interfaces.ts:92](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L92) *** @@ -38,4 +38,4 @@ Defined in: [interfaces.ts:92](https://github.com/humanprotocol/human-protocol/b > `optional` **revocationCertificate**: `string` -Defined in: [interfaces.ts:94](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L94) +Defined in: [interfaces.ts:94](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L94) diff --git a/docs/sdk/typescript/interfaces/interfaces/IOperator.md b/docs/sdk/typescript/interfaces/interfaces/IOperator.md index 6e67162629..8ea754db91 100644 --- a/docs/sdk/typescript/interfaces/interfaces/IOperator.md +++ b/docs/sdk/typescript/interfaces/interfaces/IOperator.md @@ -6,7 +6,7 @@ # Interface: IOperator -Defined in: [interfaces.ts:9](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L9) +Defined in: [interfaces.ts:9](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L9) ## Properties @@ -14,7 +14,7 @@ Defined in: [interfaces.ts:9](https://github.com/humanprotocol/human-protocol/bl > **address**: `string` -Defined in: [interfaces.ts:12](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L12) +Defined in: [interfaces.ts:12](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L12) *** @@ -22,7 +22,7 @@ Defined in: [interfaces.ts:12](https://github.com/humanprotocol/human-protocol/b > **amountJobsProcessed**: `bigint` -Defined in: [interfaces.ts:19](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L19) +Defined in: [interfaces.ts:19](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L19) *** @@ -30,7 +30,7 @@ Defined in: [interfaces.ts:19](https://github.com/humanprotocol/human-protocol/b > **amountLocked**: `bigint` -Defined in: [interfaces.ts:14](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L14) +Defined in: [interfaces.ts:14](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L14) *** @@ -38,7 +38,7 @@ Defined in: [interfaces.ts:14](https://github.com/humanprotocol/human-protocol/b > **amountSlashed**: `bigint` -Defined in: [interfaces.ts:17](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L17) +Defined in: [interfaces.ts:17](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L17) *** @@ -46,7 +46,7 @@ Defined in: [interfaces.ts:17](https://github.com/humanprotocol/human-protocol/b > **amountStaked**: `bigint` -Defined in: [interfaces.ts:13](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L13) +Defined in: [interfaces.ts:13](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L13) *** @@ -54,7 +54,7 @@ Defined in: [interfaces.ts:13](https://github.com/humanprotocol/human-protocol/b > **amountWithdrawn**: `bigint` -Defined in: [interfaces.ts:16](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L16) +Defined in: [interfaces.ts:16](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L16) *** @@ -62,7 +62,7 @@ Defined in: [interfaces.ts:16](https://github.com/humanprotocol/human-protocol/b > `optional` **category**: `string` -Defined in: [interfaces.ts:31](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L31) +Defined in: [interfaces.ts:31](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L31) *** @@ -70,7 +70,7 @@ Defined in: [interfaces.ts:31](https://github.com/humanprotocol/human-protocol/b > **chainId**: [`ChainId`](../../enums/enumerations/ChainId.md) -Defined in: [interfaces.ts:11](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L11) +Defined in: [interfaces.ts:11](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L11) *** @@ -78,7 +78,7 @@ Defined in: [interfaces.ts:11](https://github.com/humanprotocol/human-protocol/b > `optional` **fee**: `bigint` -Defined in: [interfaces.ts:21](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L21) +Defined in: [interfaces.ts:21](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L21) *** @@ -86,7 +86,7 @@ Defined in: [interfaces.ts:21](https://github.com/humanprotocol/human-protocol/b > **id**: `string` -Defined in: [interfaces.ts:10](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L10) +Defined in: [interfaces.ts:10](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L10) *** @@ -94,7 +94,7 @@ Defined in: [interfaces.ts:10](https://github.com/humanprotocol/human-protocol/b > `optional` **jobTypes**: `string`[] -Defined in: [interfaces.ts:26](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L26) +Defined in: [interfaces.ts:26](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L26) *** @@ -102,7 +102,7 @@ Defined in: [interfaces.ts:26](https://github.com/humanprotocol/human-protocol/b > **lockedUntilTimestamp**: `bigint` -Defined in: [interfaces.ts:15](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L15) +Defined in: [interfaces.ts:15](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L15) *** @@ -110,7 +110,7 @@ Defined in: [interfaces.ts:15](https://github.com/humanprotocol/human-protocol/b > `optional` **name**: `string` -Defined in: [interfaces.ts:30](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L30) +Defined in: [interfaces.ts:30](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L30) *** @@ -118,7 +118,7 @@ Defined in: [interfaces.ts:30](https://github.com/humanprotocol/human-protocol/b > `optional` **publicKey**: `string` -Defined in: [interfaces.ts:22](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L22) +Defined in: [interfaces.ts:22](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L22) *** @@ -126,7 +126,7 @@ Defined in: [interfaces.ts:22](https://github.com/humanprotocol/human-protocol/b > `optional` **registrationInstructions**: `string` -Defined in: [interfaces.ts:28](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L28) +Defined in: [interfaces.ts:28](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L28) *** @@ -134,7 +134,7 @@ Defined in: [interfaces.ts:28](https://github.com/humanprotocol/human-protocol/b > `optional` **registrationNeeded**: `boolean` -Defined in: [interfaces.ts:27](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L27) +Defined in: [interfaces.ts:27](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L27) *** @@ -142,7 +142,7 @@ Defined in: [interfaces.ts:27](https://github.com/humanprotocol/human-protocol/b > `optional` **reputationNetworks**: `string`[] -Defined in: [interfaces.ts:29](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L29) +Defined in: [interfaces.ts:29](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L29) *** @@ -150,7 +150,7 @@ Defined in: [interfaces.ts:29](https://github.com/humanprotocol/human-protocol/b > **reward**: `bigint` -Defined in: [interfaces.ts:18](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L18) +Defined in: [interfaces.ts:18](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L18) *** @@ -158,7 +158,7 @@ Defined in: [interfaces.ts:18](https://github.com/humanprotocol/human-protocol/b > `optional` **role**: `string` -Defined in: [interfaces.ts:20](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L20) +Defined in: [interfaces.ts:20](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L20) *** @@ -166,7 +166,7 @@ Defined in: [interfaces.ts:20](https://github.com/humanprotocol/human-protocol/b > `optional` **url**: `string` -Defined in: [interfaces.ts:25](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L25) +Defined in: [interfaces.ts:25](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L25) *** @@ -174,7 +174,7 @@ Defined in: [interfaces.ts:25](https://github.com/humanprotocol/human-protocol/b > `optional` **webhookUrl**: `string` -Defined in: [interfaces.ts:23](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L23) +Defined in: [interfaces.ts:23](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L23) *** @@ -182,4 +182,4 @@ Defined in: [interfaces.ts:23](https://github.com/humanprotocol/human-protocol/b > `optional` **website**: `string` -Defined in: [interfaces.ts:24](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L24) +Defined in: [interfaces.ts:24](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L24) diff --git a/docs/sdk/typescript/interfaces/interfaces/IOperatorSubgraph.md b/docs/sdk/typescript/interfaces/interfaces/IOperatorSubgraph.md index d180322141..aac5d2fcd8 100644 --- a/docs/sdk/typescript/interfaces/interfaces/IOperatorSubgraph.md +++ b/docs/sdk/typescript/interfaces/interfaces/IOperatorSubgraph.md @@ -6,7 +6,7 @@ # Interface: IOperatorSubgraph -Defined in: [interfaces.ts:34](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L34) +Defined in: [interfaces.ts:34](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L34) ## Extends @@ -18,7 +18,7 @@ Defined in: [interfaces.ts:34](https://github.com/humanprotocol/human-protocol/b > **address**: `string` -Defined in: [interfaces.ts:12](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L12) +Defined in: [interfaces.ts:12](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L12) #### Inherited from @@ -30,7 +30,7 @@ Defined in: [interfaces.ts:12](https://github.com/humanprotocol/human-protocol/b > **amountJobsProcessed**: `bigint` -Defined in: [interfaces.ts:19](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L19) +Defined in: [interfaces.ts:19](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L19) #### Inherited from @@ -42,7 +42,7 @@ Defined in: [interfaces.ts:19](https://github.com/humanprotocol/human-protocol/b > **amountLocked**: `bigint` -Defined in: [interfaces.ts:14](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L14) +Defined in: [interfaces.ts:14](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L14) #### Inherited from @@ -54,7 +54,7 @@ Defined in: [interfaces.ts:14](https://github.com/humanprotocol/human-protocol/b > **amountSlashed**: `bigint` -Defined in: [interfaces.ts:17](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L17) +Defined in: [interfaces.ts:17](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L17) #### Inherited from @@ -66,7 +66,7 @@ Defined in: [interfaces.ts:17](https://github.com/humanprotocol/human-protocol/b > **amountStaked**: `bigint` -Defined in: [interfaces.ts:13](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L13) +Defined in: [interfaces.ts:13](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L13) #### Inherited from @@ -78,7 +78,7 @@ Defined in: [interfaces.ts:13](https://github.com/humanprotocol/human-protocol/b > **amountWithdrawn**: `bigint` -Defined in: [interfaces.ts:16](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L16) +Defined in: [interfaces.ts:16](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L16) #### Inherited from @@ -90,7 +90,7 @@ Defined in: [interfaces.ts:16](https://github.com/humanprotocol/human-protocol/b > `optional` **category**: `string` -Defined in: [interfaces.ts:31](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L31) +Defined in: [interfaces.ts:31](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L31) #### Inherited from @@ -102,7 +102,7 @@ Defined in: [interfaces.ts:31](https://github.com/humanprotocol/human-protocol/b > `optional` **fee**: `bigint` -Defined in: [interfaces.ts:21](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L21) +Defined in: [interfaces.ts:21](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L21) #### Inherited from @@ -114,7 +114,7 @@ Defined in: [interfaces.ts:21](https://github.com/humanprotocol/human-protocol/b > **id**: `string` -Defined in: [interfaces.ts:10](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L10) +Defined in: [interfaces.ts:10](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L10) #### Inherited from @@ -126,7 +126,7 @@ Defined in: [interfaces.ts:10](https://github.com/humanprotocol/human-protocol/b > `optional` **jobTypes**: `string` -Defined in: [interfaces.ts:36](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L36) +Defined in: [interfaces.ts:36](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L36) *** @@ -134,7 +134,7 @@ Defined in: [interfaces.ts:36](https://github.com/humanprotocol/human-protocol/b > **lockedUntilTimestamp**: `bigint` -Defined in: [interfaces.ts:15](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L15) +Defined in: [interfaces.ts:15](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L15) #### Inherited from @@ -146,7 +146,7 @@ Defined in: [interfaces.ts:15](https://github.com/humanprotocol/human-protocol/b > `optional` **name**: `string` -Defined in: [interfaces.ts:30](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L30) +Defined in: [interfaces.ts:30](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L30) #### Inherited from @@ -158,7 +158,7 @@ Defined in: [interfaces.ts:30](https://github.com/humanprotocol/human-protocol/b > `optional` **publicKey**: `string` -Defined in: [interfaces.ts:22](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L22) +Defined in: [interfaces.ts:22](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L22) #### Inherited from @@ -170,7 +170,7 @@ Defined in: [interfaces.ts:22](https://github.com/humanprotocol/human-protocol/b > `optional` **registrationInstructions**: `string` -Defined in: [interfaces.ts:28](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L28) +Defined in: [interfaces.ts:28](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L28) #### Inherited from @@ -182,7 +182,7 @@ Defined in: [interfaces.ts:28](https://github.com/humanprotocol/human-protocol/b > `optional` **registrationNeeded**: `boolean` -Defined in: [interfaces.ts:27](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L27) +Defined in: [interfaces.ts:27](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L27) #### Inherited from @@ -194,7 +194,7 @@ Defined in: [interfaces.ts:27](https://github.com/humanprotocol/human-protocol/b > `optional` **reputationNetworks**: `object`[] -Defined in: [interfaces.ts:37](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L37) +Defined in: [interfaces.ts:37](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L37) #### address @@ -206,7 +206,7 @@ Defined in: [interfaces.ts:37](https://github.com/humanprotocol/human-protocol/b > **reward**: `bigint` -Defined in: [interfaces.ts:18](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L18) +Defined in: [interfaces.ts:18](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L18) #### Inherited from @@ -218,7 +218,7 @@ Defined in: [interfaces.ts:18](https://github.com/humanprotocol/human-protocol/b > `optional` **role**: `string` -Defined in: [interfaces.ts:20](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L20) +Defined in: [interfaces.ts:20](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L20) #### Inherited from @@ -230,7 +230,7 @@ Defined in: [interfaces.ts:20](https://github.com/humanprotocol/human-protocol/b > `optional` **url**: `string` -Defined in: [interfaces.ts:25](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L25) +Defined in: [interfaces.ts:25](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L25) #### Inherited from @@ -242,7 +242,7 @@ Defined in: [interfaces.ts:25](https://github.com/humanprotocol/human-protocol/b > `optional` **webhookUrl**: `string` -Defined in: [interfaces.ts:23](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L23) +Defined in: [interfaces.ts:23](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L23) #### Inherited from @@ -254,7 +254,7 @@ Defined in: [interfaces.ts:23](https://github.com/humanprotocol/human-protocol/b > `optional` **website**: `string` -Defined in: [interfaces.ts:24](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L24) +Defined in: [interfaces.ts:24](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L24) #### Inherited from diff --git a/docs/sdk/typescript/interfaces/interfaces/IOperatorsFilter.md b/docs/sdk/typescript/interfaces/interfaces/IOperatorsFilter.md index 98b9d8427e..afdd483031 100644 --- a/docs/sdk/typescript/interfaces/interfaces/IOperatorsFilter.md +++ b/docs/sdk/typescript/interfaces/interfaces/IOperatorsFilter.md @@ -6,7 +6,7 @@ # Interface: IOperatorsFilter -Defined in: [interfaces.ts:40](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L40) +Defined in: [interfaces.ts:40](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L40) ## Extends @@ -18,7 +18,7 @@ Defined in: [interfaces.ts:40](https://github.com/humanprotocol/human-protocol/b > **chainId**: [`ChainId`](../../enums/enumerations/ChainId.md) -Defined in: [interfaces.ts:41](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L41) +Defined in: [interfaces.ts:41](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L41) *** @@ -26,7 +26,7 @@ Defined in: [interfaces.ts:41](https://github.com/humanprotocol/human-protocol/b > `optional` **first**: `number` -Defined in: [interfaces.ts:154](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L154) +Defined in: [interfaces.ts:154](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L154) #### Inherited from @@ -38,7 +38,7 @@ Defined in: [interfaces.ts:154](https://github.com/humanprotocol/human-protocol/ > `optional` **minAmountStaked**: `number` -Defined in: [interfaces.ts:43](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L43) +Defined in: [interfaces.ts:43](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L43) *** @@ -46,7 +46,7 @@ Defined in: [interfaces.ts:43](https://github.com/humanprotocol/human-protocol/b > `optional` **orderBy**: `string` -Defined in: [interfaces.ts:44](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L44) +Defined in: [interfaces.ts:44](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L44) *** @@ -54,7 +54,7 @@ Defined in: [interfaces.ts:44](https://github.com/humanprotocol/human-protocol/b > `optional` **orderDirection**: [`OrderDirection`](../../enums/enumerations/OrderDirection.md) -Defined in: [interfaces.ts:156](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L156) +Defined in: [interfaces.ts:156](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L156) #### Inherited from @@ -66,7 +66,7 @@ Defined in: [interfaces.ts:156](https://github.com/humanprotocol/human-protocol/ > `optional` **roles**: `string`[] -Defined in: [interfaces.ts:42](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L42) +Defined in: [interfaces.ts:42](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L42) *** @@ -74,7 +74,7 @@ Defined in: [interfaces.ts:42](https://github.com/humanprotocol/human-protocol/b > `optional` **skip**: `number` -Defined in: [interfaces.ts:155](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L155) +Defined in: [interfaces.ts:155](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L155) #### Inherited from diff --git a/docs/sdk/typescript/interfaces/interfaces/IPagination.md b/docs/sdk/typescript/interfaces/interfaces/IPagination.md index 843b82ccf0..248cdfedff 100644 --- a/docs/sdk/typescript/interfaces/interfaces/IPagination.md +++ b/docs/sdk/typescript/interfaces/interfaces/IPagination.md @@ -6,7 +6,7 @@ # Interface: IPagination -Defined in: [interfaces.ts:153](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L153) +Defined in: [interfaces.ts:153](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L153) ## Extended by @@ -18,6 +18,7 @@ Defined in: [interfaces.ts:153](https://github.com/humanprotocol/human-protocol/ - [`ITransactionsFilter`](ITransactionsFilter.md) - [`IStatusEventFilter`](IStatusEventFilter.md) - [`IWorkersFilter`](IWorkersFilter.md) +- [`ICancellationRefundFilter`](ICancellationRefundFilter.md) ## Properties @@ -25,7 +26,7 @@ Defined in: [interfaces.ts:153](https://github.com/humanprotocol/human-protocol/ > `optional` **first**: `number` -Defined in: [interfaces.ts:154](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L154) +Defined in: [interfaces.ts:154](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L154) *** @@ -33,7 +34,7 @@ Defined in: [interfaces.ts:154](https://github.com/humanprotocol/human-protocol/ > `optional` **orderDirection**: [`OrderDirection`](../../enums/enumerations/OrderDirection.md) -Defined in: [interfaces.ts:156](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L156) +Defined in: [interfaces.ts:156](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L156) *** @@ -41,4 +42,4 @@ Defined in: [interfaces.ts:156](https://github.com/humanprotocol/human-protocol/ > `optional` **skip**: `number` -Defined in: [interfaces.ts:155](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L155) +Defined in: [interfaces.ts:155](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L155) diff --git a/docs/sdk/typescript/interfaces/interfaces/IPayoutFilter.md b/docs/sdk/typescript/interfaces/interfaces/IPayoutFilter.md index f26f8ce479..ef5b6596f0 100644 --- a/docs/sdk/typescript/interfaces/interfaces/IPayoutFilter.md +++ b/docs/sdk/typescript/interfaces/interfaces/IPayoutFilter.md @@ -6,7 +6,7 @@ # Interface: IPayoutFilter -Defined in: [interfaces.ts:106](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L106) +Defined in: [interfaces.ts:106](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L106) ## Extends @@ -18,7 +18,7 @@ Defined in: [interfaces.ts:106](https://github.com/humanprotocol/human-protocol/ > **chainId**: [`ChainId`](../../enums/enumerations/ChainId.md) -Defined in: [interfaces.ts:107](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L107) +Defined in: [interfaces.ts:107](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L107) *** @@ -26,7 +26,7 @@ Defined in: [interfaces.ts:107](https://github.com/humanprotocol/human-protocol/ > `optional` **escrowAddress**: `string` -Defined in: [interfaces.ts:108](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L108) +Defined in: [interfaces.ts:108](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L108) *** @@ -34,7 +34,7 @@ Defined in: [interfaces.ts:108](https://github.com/humanprotocol/human-protocol/ > `optional` **first**: `number` -Defined in: [interfaces.ts:154](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L154) +Defined in: [interfaces.ts:154](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L154) #### Inherited from @@ -46,7 +46,7 @@ Defined in: [interfaces.ts:154](https://github.com/humanprotocol/human-protocol/ > `optional` **from**: `Date` -Defined in: [interfaces.ts:110](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L110) +Defined in: [interfaces.ts:110](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L110) *** @@ -54,7 +54,7 @@ Defined in: [interfaces.ts:110](https://github.com/humanprotocol/human-protocol/ > `optional` **orderDirection**: [`OrderDirection`](../../enums/enumerations/OrderDirection.md) -Defined in: [interfaces.ts:156](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L156) +Defined in: [interfaces.ts:156](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L156) #### Inherited from @@ -66,7 +66,7 @@ Defined in: [interfaces.ts:156](https://github.com/humanprotocol/human-protocol/ > `optional` **recipient**: `string` -Defined in: [interfaces.ts:109](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L109) +Defined in: [interfaces.ts:109](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L109) *** @@ -74,7 +74,7 @@ Defined in: [interfaces.ts:109](https://github.com/humanprotocol/human-protocol/ > `optional` **skip**: `number` -Defined in: [interfaces.ts:155](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L155) +Defined in: [interfaces.ts:155](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L155) #### Inherited from @@ -86,4 +86,4 @@ Defined in: [interfaces.ts:155](https://github.com/humanprotocol/human-protocol/ > `optional` **to**: `Date` -Defined in: [interfaces.ts:111](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L111) +Defined in: [interfaces.ts:111](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L111) diff --git a/docs/sdk/typescript/interfaces/interfaces/IReputationNetwork.md b/docs/sdk/typescript/interfaces/interfaces/IReputationNetwork.md index 43e0ad39b9..aa5b3f9216 100644 --- a/docs/sdk/typescript/interfaces/interfaces/IReputationNetwork.md +++ b/docs/sdk/typescript/interfaces/interfaces/IReputationNetwork.md @@ -6,7 +6,7 @@ # Interface: IReputationNetwork -Defined in: [interfaces.ts:47](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L47) +Defined in: [interfaces.ts:47](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L47) ## Properties @@ -14,7 +14,7 @@ Defined in: [interfaces.ts:47](https://github.com/humanprotocol/human-protocol/b > **address**: `string` -Defined in: [interfaces.ts:49](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L49) +Defined in: [interfaces.ts:49](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L49) *** @@ -22,7 +22,7 @@ Defined in: [interfaces.ts:49](https://github.com/humanprotocol/human-protocol/b > **id**: `string` -Defined in: [interfaces.ts:48](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L48) +Defined in: [interfaces.ts:48](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L48) *** @@ -30,4 +30,4 @@ Defined in: [interfaces.ts:48](https://github.com/humanprotocol/human-protocol/b > **operators**: [`IOperator`](IOperator.md)[] -Defined in: [interfaces.ts:50](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L50) +Defined in: [interfaces.ts:50](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L50) diff --git a/docs/sdk/typescript/interfaces/interfaces/IReputationNetworkSubgraph.md b/docs/sdk/typescript/interfaces/interfaces/IReputationNetworkSubgraph.md index f95d053e34..5439f97d21 100644 --- a/docs/sdk/typescript/interfaces/interfaces/IReputationNetworkSubgraph.md +++ b/docs/sdk/typescript/interfaces/interfaces/IReputationNetworkSubgraph.md @@ -6,7 +6,7 @@ # Interface: IReputationNetworkSubgraph -Defined in: [interfaces.ts:53](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L53) +Defined in: [interfaces.ts:53](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L53) ## Extends @@ -18,7 +18,7 @@ Defined in: [interfaces.ts:53](https://github.com/humanprotocol/human-protocol/b > **address**: `string` -Defined in: [interfaces.ts:49](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L49) +Defined in: [interfaces.ts:49](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L49) #### Inherited from @@ -30,7 +30,7 @@ Defined in: [interfaces.ts:49](https://github.com/humanprotocol/human-protocol/b > **id**: `string` -Defined in: [interfaces.ts:48](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L48) +Defined in: [interfaces.ts:48](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L48) #### Inherited from @@ -42,4 +42,4 @@ Defined in: [interfaces.ts:48](https://github.com/humanprotocol/human-protocol/b > **operators**: [`IOperatorSubgraph`](IOperatorSubgraph.md)[] -Defined in: [interfaces.ts:55](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L55) +Defined in: [interfaces.ts:55](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L55) diff --git a/docs/sdk/typescript/interfaces/interfaces/IReward.md b/docs/sdk/typescript/interfaces/interfaces/IReward.md index c1d7f4c389..5aa9a66710 100644 --- a/docs/sdk/typescript/interfaces/interfaces/IReward.md +++ b/docs/sdk/typescript/interfaces/interfaces/IReward.md @@ -6,7 +6,7 @@ # Interface: IReward -Defined in: [interfaces.ts:4](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L4) +Defined in: [interfaces.ts:4](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L4) ## Properties @@ -14,7 +14,7 @@ Defined in: [interfaces.ts:4](https://github.com/humanprotocol/human-protocol/bl > **amount**: `bigint` -Defined in: [interfaces.ts:6](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L6) +Defined in: [interfaces.ts:6](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L6) *** @@ -22,4 +22,4 @@ Defined in: [interfaces.ts:6](https://github.com/humanprotocol/human-protocol/bl > **escrowAddress**: `string` -Defined in: [interfaces.ts:5](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L5) +Defined in: [interfaces.ts:5](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L5) diff --git a/docs/sdk/typescript/interfaces/interfaces/IStatisticsFilter.md b/docs/sdk/typescript/interfaces/interfaces/IStatisticsFilter.md index e739d9cf7a..7af82bcdf0 100644 --- a/docs/sdk/typescript/interfaces/interfaces/IStatisticsFilter.md +++ b/docs/sdk/typescript/interfaces/interfaces/IStatisticsFilter.md @@ -6,7 +6,7 @@ # Interface: IStatisticsFilter -Defined in: [interfaces.ts:97](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L97) +Defined in: [interfaces.ts:97](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L97) ## Extends @@ -18,7 +18,7 @@ Defined in: [interfaces.ts:97](https://github.com/humanprotocol/human-protocol/b > `optional` **first**: `number` -Defined in: [interfaces.ts:154](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L154) +Defined in: [interfaces.ts:154](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L154) #### Inherited from @@ -30,7 +30,7 @@ Defined in: [interfaces.ts:154](https://github.com/humanprotocol/human-protocol/ > `optional` **from**: `Date` -Defined in: [interfaces.ts:98](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L98) +Defined in: [interfaces.ts:98](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L98) *** @@ -38,7 +38,7 @@ Defined in: [interfaces.ts:98](https://github.com/humanprotocol/human-protocol/b > `optional` **orderDirection**: [`OrderDirection`](../../enums/enumerations/OrderDirection.md) -Defined in: [interfaces.ts:156](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L156) +Defined in: [interfaces.ts:156](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L156) #### Inherited from @@ -50,7 +50,7 @@ Defined in: [interfaces.ts:156](https://github.com/humanprotocol/human-protocol/ > `optional` **skip**: `number` -Defined in: [interfaces.ts:155](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L155) +Defined in: [interfaces.ts:155](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L155) #### Inherited from @@ -62,4 +62,4 @@ Defined in: [interfaces.ts:155](https://github.com/humanprotocol/human-protocol/ > `optional` **to**: `Date` -Defined in: [interfaces.ts:99](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L99) +Defined in: [interfaces.ts:99](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L99) diff --git a/docs/sdk/typescript/interfaces/interfaces/IStatusEventFilter.md b/docs/sdk/typescript/interfaces/interfaces/IStatusEventFilter.md index 2587378724..aebfadfedc 100644 --- a/docs/sdk/typescript/interfaces/interfaces/IStatusEventFilter.md +++ b/docs/sdk/typescript/interfaces/interfaces/IStatusEventFilter.md @@ -6,7 +6,7 @@ # Interface: IStatusEventFilter -Defined in: [interfaces.ts:166](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L166) +Defined in: [interfaces.ts:166](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L166) ## Extends @@ -18,7 +18,7 @@ Defined in: [interfaces.ts:166](https://github.com/humanprotocol/human-protocol/ > **chainId**: [`ChainId`](../../enums/enumerations/ChainId.md) -Defined in: [interfaces.ts:167](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L167) +Defined in: [interfaces.ts:167](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L167) *** @@ -26,7 +26,7 @@ Defined in: [interfaces.ts:167](https://github.com/humanprotocol/human-protocol/ > `optional` **first**: `number` -Defined in: [interfaces.ts:154](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L154) +Defined in: [interfaces.ts:154](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L154) #### Inherited from @@ -38,7 +38,7 @@ Defined in: [interfaces.ts:154](https://github.com/humanprotocol/human-protocol/ > `optional` **from**: `Date` -Defined in: [interfaces.ts:169](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L169) +Defined in: [interfaces.ts:169](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L169) *** @@ -46,7 +46,7 @@ Defined in: [interfaces.ts:169](https://github.com/humanprotocol/human-protocol/ > `optional` **launcher**: `string` -Defined in: [interfaces.ts:171](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L171) +Defined in: [interfaces.ts:171](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L171) *** @@ -54,7 +54,7 @@ Defined in: [interfaces.ts:171](https://github.com/humanprotocol/human-protocol/ > `optional` **orderDirection**: [`OrderDirection`](../../enums/enumerations/OrderDirection.md) -Defined in: [interfaces.ts:156](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L156) +Defined in: [interfaces.ts:156](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L156) #### Inherited from @@ -66,7 +66,7 @@ Defined in: [interfaces.ts:156](https://github.com/humanprotocol/human-protocol/ > `optional` **skip**: `number` -Defined in: [interfaces.ts:155](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L155) +Defined in: [interfaces.ts:155](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L155) #### Inherited from @@ -78,7 +78,7 @@ Defined in: [interfaces.ts:155](https://github.com/humanprotocol/human-protocol/ > `optional` **statuses**: [`EscrowStatus`](../../types/enumerations/EscrowStatus.md)[] -Defined in: [interfaces.ts:168](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L168) +Defined in: [interfaces.ts:168](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L168) *** @@ -86,4 +86,4 @@ Defined in: [interfaces.ts:168](https://github.com/humanprotocol/human-protocol/ > `optional` **to**: `Date` -Defined in: [interfaces.ts:170](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L170) +Defined in: [interfaces.ts:170](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L170) diff --git a/docs/sdk/typescript/interfaces/interfaces/ITransaction.md b/docs/sdk/typescript/interfaces/interfaces/ITransaction.md index 9c3b4136e2..4e98eddf74 100644 --- a/docs/sdk/typescript/interfaces/interfaces/ITransaction.md +++ b/docs/sdk/typescript/interfaces/interfaces/ITransaction.md @@ -6,7 +6,7 @@ # Interface: ITransaction -Defined in: [interfaces.ts:129](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L129) +Defined in: [interfaces.ts:129](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L129) ## Properties @@ -14,7 +14,7 @@ Defined in: [interfaces.ts:129](https://github.com/humanprotocol/human-protocol/ > **block**: `bigint` -Defined in: [interfaces.ts:130](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L130) +Defined in: [interfaces.ts:130](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L130) *** @@ -22,7 +22,7 @@ Defined in: [interfaces.ts:130](https://github.com/humanprotocol/human-protocol/ > `optional` **escrow**: `string` -Defined in: [interfaces.ts:138](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L138) +Defined in: [interfaces.ts:138](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L138) *** @@ -30,7 +30,7 @@ Defined in: [interfaces.ts:138](https://github.com/humanprotocol/human-protocol/ > **from**: `string` -Defined in: [interfaces.ts:132](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L132) +Defined in: [interfaces.ts:132](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L132) *** @@ -38,7 +38,7 @@ Defined in: [interfaces.ts:132](https://github.com/humanprotocol/human-protocol/ > **internalTransactions**: [`InternalTransaction`](InternalTransaction.md)[] -Defined in: [interfaces.ts:140](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L140) +Defined in: [interfaces.ts:140](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L140) *** @@ -46,7 +46,7 @@ Defined in: [interfaces.ts:140](https://github.com/humanprotocol/human-protocol/ > **method**: `string` -Defined in: [interfaces.ts:136](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L136) +Defined in: [interfaces.ts:136](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L136) *** @@ -54,7 +54,7 @@ Defined in: [interfaces.ts:136](https://github.com/humanprotocol/human-protocol/ > `optional` **receiver**: `string` -Defined in: [interfaces.ts:137](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L137) +Defined in: [interfaces.ts:137](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L137) *** @@ -62,7 +62,7 @@ Defined in: [interfaces.ts:137](https://github.com/humanprotocol/human-protocol/ > **timestamp**: `bigint` -Defined in: [interfaces.ts:134](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L134) +Defined in: [interfaces.ts:134](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L134) *** @@ -70,7 +70,7 @@ Defined in: [interfaces.ts:134](https://github.com/humanprotocol/human-protocol/ > **to**: `string` -Defined in: [interfaces.ts:133](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L133) +Defined in: [interfaces.ts:133](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L133) *** @@ -78,7 +78,7 @@ Defined in: [interfaces.ts:133](https://github.com/humanprotocol/human-protocol/ > `optional` **token**: `string` -Defined in: [interfaces.ts:139](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L139) +Defined in: [interfaces.ts:139](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L139) *** @@ -86,7 +86,7 @@ Defined in: [interfaces.ts:139](https://github.com/humanprotocol/human-protocol/ > **txHash**: `string` -Defined in: [interfaces.ts:131](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L131) +Defined in: [interfaces.ts:131](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L131) *** @@ -94,4 +94,4 @@ Defined in: [interfaces.ts:131](https://github.com/humanprotocol/human-protocol/ > **value**: `string` -Defined in: [interfaces.ts:135](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L135) +Defined in: [interfaces.ts:135](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L135) diff --git a/docs/sdk/typescript/interfaces/interfaces/ITransactionsFilter.md b/docs/sdk/typescript/interfaces/interfaces/ITransactionsFilter.md index 1addac5318..a596025b82 100644 --- a/docs/sdk/typescript/interfaces/interfaces/ITransactionsFilter.md +++ b/docs/sdk/typescript/interfaces/interfaces/ITransactionsFilter.md @@ -6,7 +6,7 @@ # Interface: ITransactionsFilter -Defined in: [interfaces.ts:143](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L143) +Defined in: [interfaces.ts:143](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L143) ## Extends @@ -18,7 +18,7 @@ Defined in: [interfaces.ts:143](https://github.com/humanprotocol/human-protocol/ > **chainId**: [`ChainId`](../../enums/enumerations/ChainId.md) -Defined in: [interfaces.ts:144](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L144) +Defined in: [interfaces.ts:144](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L144) *** @@ -26,7 +26,7 @@ Defined in: [interfaces.ts:144](https://github.com/humanprotocol/human-protocol/ > `optional` **endBlock**: `number` -Defined in: [interfaces.ts:146](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L146) +Defined in: [interfaces.ts:146](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L146) *** @@ -34,7 +34,7 @@ Defined in: [interfaces.ts:146](https://github.com/humanprotocol/human-protocol/ > `optional` **endDate**: `Date` -Defined in: [interfaces.ts:148](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L148) +Defined in: [interfaces.ts:148](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L148) *** @@ -42,7 +42,7 @@ Defined in: [interfaces.ts:148](https://github.com/humanprotocol/human-protocol/ > `optional` **first**: `number` -Defined in: [interfaces.ts:154](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L154) +Defined in: [interfaces.ts:154](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L154) #### Inherited from @@ -54,7 +54,7 @@ Defined in: [interfaces.ts:154](https://github.com/humanprotocol/human-protocol/ > `optional` **fromAddress**: `string` -Defined in: [interfaces.ts:149](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L149) +Defined in: [interfaces.ts:149](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L149) *** @@ -62,7 +62,7 @@ Defined in: [interfaces.ts:149](https://github.com/humanprotocol/human-protocol/ > `optional` **orderDirection**: [`OrderDirection`](../../enums/enumerations/OrderDirection.md) -Defined in: [interfaces.ts:156](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L156) +Defined in: [interfaces.ts:156](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L156) #### Inherited from @@ -74,7 +74,7 @@ Defined in: [interfaces.ts:156](https://github.com/humanprotocol/human-protocol/ > `optional` **skip**: `number` -Defined in: [interfaces.ts:155](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L155) +Defined in: [interfaces.ts:155](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L155) #### Inherited from @@ -86,7 +86,7 @@ Defined in: [interfaces.ts:155](https://github.com/humanprotocol/human-protocol/ > `optional` **startBlock**: `number` -Defined in: [interfaces.ts:145](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L145) +Defined in: [interfaces.ts:145](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L145) *** @@ -94,7 +94,7 @@ Defined in: [interfaces.ts:145](https://github.com/humanprotocol/human-protocol/ > `optional` **startDate**: `Date` -Defined in: [interfaces.ts:147](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L147) +Defined in: [interfaces.ts:147](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L147) *** @@ -102,4 +102,4 @@ Defined in: [interfaces.ts:147](https://github.com/humanprotocol/human-protocol/ > `optional` **toAddress**: `string` -Defined in: [interfaces.ts:150](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L150) +Defined in: [interfaces.ts:150](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L150) diff --git a/docs/sdk/typescript/interfaces/interfaces/IWorker.md b/docs/sdk/typescript/interfaces/interfaces/IWorker.md index ed50cb944c..d1044a523e 100644 --- a/docs/sdk/typescript/interfaces/interfaces/IWorker.md +++ b/docs/sdk/typescript/interfaces/interfaces/IWorker.md @@ -6,7 +6,7 @@ # Interface: IWorker -Defined in: [interfaces.ts:174](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L174) +Defined in: [interfaces.ts:174](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L174) ## Properties @@ -14,7 +14,7 @@ Defined in: [interfaces.ts:174](https://github.com/humanprotocol/human-protocol/ > **address**: `string` -Defined in: [interfaces.ts:176](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L176) +Defined in: [interfaces.ts:176](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L176) *** @@ -22,7 +22,7 @@ Defined in: [interfaces.ts:176](https://github.com/humanprotocol/human-protocol/ > **id**: `string` -Defined in: [interfaces.ts:175](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L175) +Defined in: [interfaces.ts:175](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L175) *** @@ -30,7 +30,7 @@ Defined in: [interfaces.ts:175](https://github.com/humanprotocol/human-protocol/ > **payoutCount**: `number` -Defined in: [interfaces.ts:178](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L178) +Defined in: [interfaces.ts:178](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L178) *** @@ -38,4 +38,4 @@ Defined in: [interfaces.ts:178](https://github.com/humanprotocol/human-protocol/ > **totalAmountReceived**: `number` -Defined in: [interfaces.ts:177](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L177) +Defined in: [interfaces.ts:177](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L177) diff --git a/docs/sdk/typescript/interfaces/interfaces/IWorkersFilter.md b/docs/sdk/typescript/interfaces/interfaces/IWorkersFilter.md index 1dac603e1e..ad2f636233 100644 --- a/docs/sdk/typescript/interfaces/interfaces/IWorkersFilter.md +++ b/docs/sdk/typescript/interfaces/interfaces/IWorkersFilter.md @@ -6,7 +6,7 @@ # Interface: IWorkersFilter -Defined in: [interfaces.ts:181](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L181) +Defined in: [interfaces.ts:181](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L181) ## Extends @@ -18,7 +18,7 @@ Defined in: [interfaces.ts:181](https://github.com/humanprotocol/human-protocol/ > `optional` **address**: `string` -Defined in: [interfaces.ts:183](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L183) +Defined in: [interfaces.ts:183](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L183) *** @@ -26,7 +26,7 @@ Defined in: [interfaces.ts:183](https://github.com/humanprotocol/human-protocol/ > **chainId**: [`ChainId`](../../enums/enumerations/ChainId.md) -Defined in: [interfaces.ts:182](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L182) +Defined in: [interfaces.ts:182](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L182) *** @@ -34,7 +34,7 @@ Defined in: [interfaces.ts:182](https://github.com/humanprotocol/human-protocol/ > `optional` **first**: `number` -Defined in: [interfaces.ts:154](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L154) +Defined in: [interfaces.ts:154](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L154) #### Inherited from @@ -46,7 +46,7 @@ Defined in: [interfaces.ts:154](https://github.com/humanprotocol/human-protocol/ > `optional` **orderBy**: `string` -Defined in: [interfaces.ts:184](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L184) +Defined in: [interfaces.ts:184](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L184) *** @@ -54,7 +54,7 @@ Defined in: [interfaces.ts:184](https://github.com/humanprotocol/human-protocol/ > `optional` **orderDirection**: [`OrderDirection`](../../enums/enumerations/OrderDirection.md) -Defined in: [interfaces.ts:156](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L156) +Defined in: [interfaces.ts:156](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L156) #### Inherited from @@ -66,7 +66,7 @@ Defined in: [interfaces.ts:156](https://github.com/humanprotocol/human-protocol/ > `optional` **skip**: `number` -Defined in: [interfaces.ts:155](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L155) +Defined in: [interfaces.ts:155](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L155) #### Inherited from diff --git a/docs/sdk/typescript/interfaces/interfaces/InternalTransaction.md b/docs/sdk/typescript/interfaces/interfaces/InternalTransaction.md index d124889cd6..d5898de4cc 100644 --- a/docs/sdk/typescript/interfaces/interfaces/InternalTransaction.md +++ b/docs/sdk/typescript/interfaces/interfaces/InternalTransaction.md @@ -6,7 +6,7 @@ # Interface: InternalTransaction -Defined in: [interfaces.ts:119](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L119) +Defined in: [interfaces.ts:119](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L119) ## Properties @@ -14,7 +14,7 @@ Defined in: [interfaces.ts:119](https://github.com/humanprotocol/human-protocol/ > `optional` **escrow**: `string` -Defined in: [interfaces.ts:125](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L125) +Defined in: [interfaces.ts:125](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L125) *** @@ -22,7 +22,7 @@ Defined in: [interfaces.ts:125](https://github.com/humanprotocol/human-protocol/ > **from**: `string` -Defined in: [interfaces.ts:120](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L120) +Defined in: [interfaces.ts:120](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L120) *** @@ -30,7 +30,7 @@ Defined in: [interfaces.ts:120](https://github.com/humanprotocol/human-protocol/ > **method**: `string` -Defined in: [interfaces.ts:123](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L123) +Defined in: [interfaces.ts:123](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L123) *** @@ -38,7 +38,7 @@ Defined in: [interfaces.ts:123](https://github.com/humanprotocol/human-protocol/ > `optional` **receiver**: `string` -Defined in: [interfaces.ts:124](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L124) +Defined in: [interfaces.ts:124](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L124) *** @@ -46,7 +46,7 @@ Defined in: [interfaces.ts:124](https://github.com/humanprotocol/human-protocol/ > **to**: `string` -Defined in: [interfaces.ts:121](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L121) +Defined in: [interfaces.ts:121](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L121) *** @@ -54,7 +54,7 @@ Defined in: [interfaces.ts:121](https://github.com/humanprotocol/human-protocol/ > `optional` **token**: `string` -Defined in: [interfaces.ts:126](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L126) +Defined in: [interfaces.ts:126](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L126) *** @@ -62,4 +62,4 @@ Defined in: [interfaces.ts:126](https://github.com/humanprotocol/human-protocol/ > **value**: `string` -Defined in: [interfaces.ts:122](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L122) +Defined in: [interfaces.ts:122](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L122) diff --git a/docs/sdk/typescript/interfaces/interfaces/StakerInfo.md b/docs/sdk/typescript/interfaces/interfaces/StakerInfo.md index fc9133e109..8be320b66a 100644 --- a/docs/sdk/typescript/interfaces/interfaces/StakerInfo.md +++ b/docs/sdk/typescript/interfaces/interfaces/StakerInfo.md @@ -6,7 +6,7 @@ # Interface: StakerInfo -Defined in: [interfaces.ts:159](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L159) +Defined in: [interfaces.ts:159](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L159) ## Properties @@ -14,7 +14,7 @@ Defined in: [interfaces.ts:159](https://github.com/humanprotocol/human-protocol/ > **lockedAmount**: `bigint` -Defined in: [interfaces.ts:161](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L161) +Defined in: [interfaces.ts:161](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L161) *** @@ -22,7 +22,7 @@ Defined in: [interfaces.ts:161](https://github.com/humanprotocol/human-protocol/ > **lockedUntil**: `bigint` -Defined in: [interfaces.ts:162](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L162) +Defined in: [interfaces.ts:162](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L162) *** @@ -30,7 +30,7 @@ Defined in: [interfaces.ts:162](https://github.com/humanprotocol/human-protocol/ > **stakedAmount**: `bigint` -Defined in: [interfaces.ts:160](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L160) +Defined in: [interfaces.ts:160](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L160) *** @@ -38,4 +38,4 @@ Defined in: [interfaces.ts:160](https://github.com/humanprotocol/human-protocol/ > **withdrawableAmount**: `bigint` -Defined in: [interfaces.ts:163](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L163) +Defined in: [interfaces.ts:163](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L163) diff --git a/docs/sdk/typescript/kvstore/classes/KVStoreClient.md b/docs/sdk/typescript/kvstore/classes/KVStoreClient.md index d2771766e0..72eb0980e3 100644 --- a/docs/sdk/typescript/kvstore/classes/KVStoreClient.md +++ b/docs/sdk/typescript/kvstore/classes/KVStoreClient.md @@ -6,7 +6,7 @@ # Class: KVStoreClient -Defined in: [kvstore.ts:99](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/kvstore.ts#L99) +Defined in: [kvstore.ts:99](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/kvstore.ts#L99) ## Introduction @@ -86,7 +86,7 @@ const kvstoreClient = await KVStoreClient.build(provider); > **new KVStoreClient**(`runner`, `networkData`): `KVStoreClient` -Defined in: [kvstore.ts:108](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/kvstore.ts#L108) +Defined in: [kvstore.ts:108](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/kvstore.ts#L108) **KVStoreClient constructor** @@ -118,7 +118,7 @@ The network information required to connect to the KVStore contract > **networkData**: [`NetworkData`](../../types/type-aliases/NetworkData.md) -Defined in: [base.ts:12](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L12) +Defined in: [base.ts:12](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L12) #### Inherited from @@ -130,7 +130,7 @@ Defined in: [base.ts:12](https://github.com/humanprotocol/human-protocol/blob/99 > `protected` **runner**: `ContractRunner` -Defined in: [base.ts:11](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L11) +Defined in: [base.ts:11](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L11) #### Inherited from @@ -142,7 +142,7 @@ Defined in: [base.ts:11](https://github.com/humanprotocol/human-protocol/blob/99 > **set**(`key`, `value`, `txOptions?`): `Promise`\<`void`\> -Defined in: [kvstore.ts:171](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/kvstore.ts#L171) +Defined in: [kvstore.ts:171](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/kvstore.ts#L171) This function sets a key-value pair associated with the address that submits the transaction. @@ -196,7 +196,7 @@ await kvstoreClient.set('Role', 'RecordingOracle'); > **setBulk**(`keys`, `values`, `txOptions?`): `Promise`\<`void`\> -Defined in: [kvstore.ts:214](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/kvstore.ts#L214) +Defined in: [kvstore.ts:214](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/kvstore.ts#L214) This function sets key-value pairs in bulk associated with the address that submits the transaction. @@ -252,7 +252,7 @@ await kvstoreClient.setBulk(keys, values); > **setFileUrlAndHash**(`url`, `urlKey`, `txOptions?`): `Promise`\<`void`\> -Defined in: [kvstore.ts:257](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/kvstore.ts#L257) +Defined in: [kvstore.ts:257](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/kvstore.ts#L257) Sets a URL value for the address that submits the transaction, and its hash. @@ -305,7 +305,7 @@ await kvstoreClient.setFileUrlAndHash('linkedin.com/example', 'linkedin_url'); > `static` **build**(`runner`): `Promise`\<`KVStoreClient`\> -Defined in: [kvstore.ts:126](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/kvstore.ts#L126) +Defined in: [kvstore.ts:126](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/kvstore.ts#L126) Creates an instance of KVStoreClient from a runner. diff --git a/docs/sdk/typescript/kvstore/classes/KVStoreUtils.md b/docs/sdk/typescript/kvstore/classes/KVStoreUtils.md index 1fbf8950a3..a7739a5968 100644 --- a/docs/sdk/typescript/kvstore/classes/KVStoreUtils.md +++ b/docs/sdk/typescript/kvstore/classes/KVStoreUtils.md @@ -6,7 +6,7 @@ # Class: KVStoreUtils -Defined in: [kvstore.ts:318](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/kvstore.ts#L318) +Defined in: [kvstore.ts:318](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/kvstore.ts#L318) ## Introduction @@ -55,7 +55,7 @@ const KVStoreAddresses = await KVStoreUtils.getKVStoreData( > `static` **get**(`chainId`, `address`, `key`): `Promise`\<`string`\> -Defined in: [kvstore.ts:389](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/kvstore.ts#L389) +Defined in: [kvstore.ts:389](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/kvstore.ts#L389) Gets the value of a key-value pair in the KVStore using the subgraph. @@ -116,7 +116,7 @@ console.log(value); > `static` **getFileUrlAndVerifyHash**(`chainId`, `address`, `urlKey`): `Promise`\<`string`\> -Defined in: [kvstore.ts:436](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/kvstore.ts#L436) +Defined in: [kvstore.ts:436](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/kvstore.ts#L436) Gets the URL value of the given entity, and verifies its hash. @@ -164,7 +164,7 @@ console.log(url); > `static` **getKVStoreData**(`chainId`, `address`): `Promise`\<[`IKVStore`](../../interfaces/interfaces/IKVStore.md)[]\> -Defined in: [kvstore.ts:337](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/kvstore.ts#L337) +Defined in: [kvstore.ts:337](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/kvstore.ts#L337) This function returns the KVStore data for a given address. @@ -211,7 +211,7 @@ console.log(kvStoreData); > `static` **getPublicKey**(`chainId`, `address`): `Promise`\<`string`\> -Defined in: [kvstore.ts:496](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/kvstore.ts#L496) +Defined in: [kvstore.ts:496](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/kvstore.ts#L496) Gets the public key of the given entity, and verifies its hash. diff --git a/docs/sdk/typescript/operator/classes/OperatorUtils.md b/docs/sdk/typescript/operator/classes/OperatorUtils.md index 7842ae3d3b..3b7737eb0a 100644 --- a/docs/sdk/typescript/operator/classes/OperatorUtils.md +++ b/docs/sdk/typescript/operator/classes/OperatorUtils.md @@ -6,7 +6,7 @@ # Class: OperatorUtils -Defined in: [operator.ts:27](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/operator.ts#L27) +Defined in: [operator.ts:27](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/operator.ts#L27) ## Constructors @@ -24,7 +24,7 @@ Defined in: [operator.ts:27](https://github.com/humanprotocol/human-protocol/blo > `static` **getOperator**(`chainId`, `address`): `Promise`\<[`IOperator`](../../interfaces/interfaces/IOperator.md)\> -Defined in: [operator.ts:43](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/operator.ts#L43) +Defined in: [operator.ts:43](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/operator.ts#L43) This function returns the operator data for the given address. @@ -62,7 +62,7 @@ const operator = await OperatorUtils.getOperator(ChainId.POLYGON_AMOY, '0x62dD51 > `static` **getOperators**(`filter`): `Promise`\<[`IOperator`](../../interfaces/interfaces/IOperator.md)[]\> -Defined in: [operator.ts:109](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/operator.ts#L109) +Defined in: [operator.ts:109](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/operator.ts#L109) This function returns all the operator details of the protocol. @@ -97,7 +97,7 @@ const operators = await OperatorUtils.getOperators(filter); > `static` **getReputationNetworkOperators**(`chainId`, `address`, `role?`): `Promise`\<[`IOperator`](../../interfaces/interfaces/IOperator.md)[]\> -Defined in: [operator.ts:190](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/operator.ts#L190) +Defined in: [operator.ts:190](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/operator.ts#L190) Retrieves the reputation network operators of the specified address. @@ -141,7 +141,7 @@ const operators = await OperatorUtils.getReputationNetworkOperators(ChainId.POLY > `static` **getRewards**(`chainId`, `slasherAddress`): `Promise`\<[`IReward`](../../interfaces/interfaces/IReward.md)[]\> -Defined in: [operator.ts:244](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/operator.ts#L244) +Defined in: [operator.ts:244](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/operator.ts#L244) This function returns information about the rewards for a given slasher address. diff --git a/docs/sdk/typescript/staking/classes/StakingClient.md b/docs/sdk/typescript/staking/classes/StakingClient.md index 34f6cd2685..267bd265bb 100644 --- a/docs/sdk/typescript/staking/classes/StakingClient.md +++ b/docs/sdk/typescript/staking/classes/StakingClient.md @@ -6,7 +6,7 @@ # Class: StakingClient -Defined in: [staking.ts:97](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/staking.ts#L97) +Defined in: [staking.ts:97](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/staking.ts#L97) ## Introduction @@ -86,7 +86,7 @@ const stakingClient = await StakingClient.build(provider); > **new StakingClient**(`runner`, `networkData`): `StakingClient` -Defined in: [staking.ts:108](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/staking.ts#L108) +Defined in: [staking.ts:108](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/staking.ts#L108) **StakingClient constructor** @@ -118,7 +118,7 @@ The network information required to connect to the Staking contract > **escrowFactoryContract**: `EscrowFactory` -Defined in: [staking.ts:100](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/staking.ts#L100) +Defined in: [staking.ts:100](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/staking.ts#L100) *** @@ -126,7 +126,7 @@ Defined in: [staking.ts:100](https://github.com/humanprotocol/human-protocol/blo > **networkData**: [`NetworkData`](../../types/type-aliases/NetworkData.md) -Defined in: [base.ts:12](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L12) +Defined in: [base.ts:12](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L12) #### Inherited from @@ -138,7 +138,7 @@ Defined in: [base.ts:12](https://github.com/humanprotocol/human-protocol/blob/99 > `protected` **runner**: `ContractRunner` -Defined in: [base.ts:11](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L11) +Defined in: [base.ts:11](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L11) #### Inherited from @@ -150,7 +150,7 @@ Defined in: [base.ts:11](https://github.com/humanprotocol/human-protocol/blob/99 > **stakingContract**: `Staking` -Defined in: [staking.ts:99](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/staking.ts#L99) +Defined in: [staking.ts:99](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/staking.ts#L99) *** @@ -158,7 +158,7 @@ Defined in: [staking.ts:99](https://github.com/humanprotocol/human-protocol/blob > **tokenContract**: `HMToken` -Defined in: [staking.ts:98](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/staking.ts#L98) +Defined in: [staking.ts:98](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/staking.ts#L98) ## Methods @@ -166,7 +166,7 @@ Defined in: [staking.ts:98](https://github.com/humanprotocol/human-protocol/blob > **approveStake**(`amount`, `txOptions?`): `Promise`\<`void`\> -Defined in: [staking.ts:193](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/staking.ts#L193) +Defined in: [staking.ts:193](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/staking.ts#L193) This function approves the staking contract to transfer a specified amount of tokens when the user stakes. It increases the allowance for the staking contract. @@ -213,7 +213,7 @@ await stakingClient.approveStake(amount); > **getStakerInfo**(`stakerAddress`): `Promise`\<[`StakerInfo`](../../interfaces/interfaces/StakerInfo.md)\> -Defined in: [staking.ts:435](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/staking.ts#L435) +Defined in: [staking.ts:435](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/staking.ts#L435) Retrieves comprehensive staking information for a staker. @@ -249,7 +249,7 @@ console.log(stakingInfo.tokensStaked); > **slash**(`slasher`, `staker`, `escrowAddress`, `amount`, `txOptions?`): `Promise`\<`void`\> -Defined in: [staking.ts:373](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/staking.ts#L373) +Defined in: [staking.ts:373](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/staking.ts#L373) This function reduces the allocated amount by a staker in an escrow and transfers those tokens to the reward pool. This allows the slasher to claim them later. @@ -314,7 +314,7 @@ await stakingClient.slash('0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266', '0xf39Fd > **stake**(`amount`, `txOptions?`): `Promise`\<`void`\> -Defined in: [staking.ts:247](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/staking.ts#L247) +Defined in: [staking.ts:247](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/staking.ts#L247) This function stakes a specified amount of tokens on a specific network. @@ -364,7 +364,7 @@ await stakingClient.stake(amount); > **unstake**(`amount`, `txOptions?`): `Promise`\<`void`\> -Defined in: [staking.ts:291](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/staking.ts#L291) +Defined in: [staking.ts:291](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/staking.ts#L291) This function unstakes tokens from staking contract. The unstaked tokens stay locked for a period of time. @@ -413,7 +413,7 @@ await stakingClient.unstake(amount); > **withdraw**(`txOptions?`): `Promise`\<`void`\> -Defined in: [staking.ts:336](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/staking.ts#L336) +Defined in: [staking.ts:336](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/staking.ts#L336) This function withdraws unstaked and non-locked tokens from staking contract to the user wallet. @@ -455,7 +455,7 @@ await stakingClient.withdraw(); > `static` **build**(`runner`): `Promise`\<`StakingClient`\> -Defined in: [staking.ts:136](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/staking.ts#L136) +Defined in: [staking.ts:136](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/staking.ts#L136) Creates an instance of StakingClient from a Runner. diff --git a/docs/sdk/typescript/statistics/classes/StatisticsClient.md b/docs/sdk/typescript/statistics/classes/StatisticsClient.md index 908463c679..9bef6f97fd 100644 --- a/docs/sdk/typescript/statistics/classes/StatisticsClient.md +++ b/docs/sdk/typescript/statistics/classes/StatisticsClient.md @@ -6,7 +6,7 @@ # Class: StatisticsClient -Defined in: [statistics.ts:58](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/statistics.ts#L58) +Defined in: [statistics.ts:58](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/statistics.ts#L58) ## Introduction @@ -45,7 +45,7 @@ const statisticsClient = new StatisticsClient(NETWORKS[ChainId.POLYGON_AMOY]); > **new StatisticsClient**(`networkData`): `StatisticsClient` -Defined in: [statistics.ts:67](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/statistics.ts#L67) +Defined in: [statistics.ts:67](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/statistics.ts#L67) **StatisticsClient constructor** @@ -67,7 +67,7 @@ The network information required to connect to the Statistics contract > **networkData**: [`NetworkData`](../../types/type-aliases/NetworkData.md) -Defined in: [statistics.ts:59](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/statistics.ts#L59) +Defined in: [statistics.ts:59](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/statistics.ts#L59) *** @@ -75,7 +75,7 @@ Defined in: [statistics.ts:59](https://github.com/humanprotocol/human-protocol/b > **subgraphUrl**: `string` -Defined in: [statistics.ts:60](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/statistics.ts#L60) +Defined in: [statistics.ts:60](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/statistics.ts#L60) ## Methods @@ -83,7 +83,7 @@ Defined in: [statistics.ts:60](https://github.com/humanprotocol/human-protocol/b > **getEscrowStatistics**(`filter`): `Promise`\<[`EscrowStatistics`](../../graphql/types/type-aliases/EscrowStatistics.md)\> -Defined in: [statistics.ts:120](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/statistics.ts#L120) +Defined in: [statistics.ts:120](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/statistics.ts#L120) This function returns the statistical data of escrows. @@ -149,7 +149,7 @@ const escrowStatisticsApril = await statisticsClient.getEscrowStatistics({ > **getHMTDailyData**(`filter`): `Promise`\<[`DailyHMTData`](../../graphql/types/type-aliases/DailyHMTData.md)[]\> -Defined in: [statistics.ts:478](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/statistics.ts#L478) +Defined in: [statistics.ts:478](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/statistics.ts#L478) This function returns the statistical data of HMToken day by day. @@ -214,7 +214,7 @@ console.log('HMT statistics from 5/8 - 6/8:', hmtStatisticsRange); > **getHMTHolders**(`params`): `Promise`\<[`HMTHolder`](../../graphql/types/type-aliases/HMTHolder.md)[]\> -Defined in: [statistics.ts:407](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/statistics.ts#L407) +Defined in: [statistics.ts:407](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/statistics.ts#L407) This function returns the holders of the HMToken with optional filters and ordering. @@ -257,7 +257,7 @@ console.log('HMT holders:', hmtHolders.map((h) => ({ > **getHMTStatistics**(): `Promise`\<[`HMTStatistics`](../../graphql/types/type-aliases/HMTStatistics.md)\> -Defined in: [statistics.ts:364](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/statistics.ts#L364) +Defined in: [statistics.ts:364](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/statistics.ts#L364) This function returns the statistical data of HMToken. @@ -296,7 +296,7 @@ console.log('HMT statistics:', { > **getPaymentStatistics**(`filter`): `Promise`\<[`PaymentStatistics`](../../graphql/types/type-aliases/PaymentStatistics.md)\> -Defined in: [statistics.ts:300](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/statistics.ts#L300) +Defined in: [statistics.ts:300](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/statistics.ts#L300) This function returns the statistical data of payments. @@ -380,7 +380,7 @@ console.log( > **getWorkerStatistics**(`filter`): `Promise`\<[`WorkerStatistics`](../../graphql/types/type-aliases/WorkerStatistics.md)\> -Defined in: [statistics.ts:204](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/statistics.ts#L204) +Defined in: [statistics.ts:204](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/statistics.ts#L204) This function returns the statistical data of workers. diff --git a/docs/sdk/typescript/storage/classes/StorageClient.md b/docs/sdk/typescript/storage/classes/StorageClient.md index a3a552a1f5..b59bea6e02 100644 --- a/docs/sdk/typescript/storage/classes/StorageClient.md +++ b/docs/sdk/typescript/storage/classes/StorageClient.md @@ -6,7 +6,7 @@ # Class: ~~StorageClient~~ -Defined in: [storage.ts:63](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/storage.ts#L63) +Defined in: [storage.ts:63](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/storage.ts#L63) ## Deprecated @@ -61,7 +61,7 @@ const storageClient = new StorageClient(params, credentials); > **new StorageClient**(`params`, `credentials?`): `StorageClient` -Defined in: [storage.ts:73](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/storage.ts#L73) +Defined in: [storage.ts:73](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/storage.ts#L73) **Storage client constructor** @@ -89,7 +89,7 @@ Optional. Cloud storage access data. If credentials are not provided - use anony > **bucketExists**(`bucket`): `Promise`\<`boolean`\> -Defined in: [storage.ts:262](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/storage.ts#L262) +Defined in: [storage.ts:262](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/storage.ts#L262) This function checks if a bucket exists. @@ -133,7 +133,7 @@ const exists = await storageClient.bucketExists('bucket-name'); > **downloadFiles**(`keys`, `bucket`): `Promise`\<`any`[]\> -Defined in: [storage.ts:112](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/storage.ts#L112) +Defined in: [storage.ts:112](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/storage.ts#L112) This function downloads files from a bucket. @@ -181,7 +181,7 @@ const files = await storageClient.downloadFiles(keys, 'bucket-name'); > **listObjects**(`bucket`): `Promise`\<`string`[]\> -Defined in: [storage.ts:292](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/storage.ts#L292) +Defined in: [storage.ts:292](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/storage.ts#L292) This function lists all file names contained in the bucket. @@ -225,7 +225,7 @@ const fileNames = await storageClient.listObjects('bucket-name'); > **uploadFiles**(`files`, `bucket`): `Promise`\<[`UploadFile`](../../types/type-aliases/UploadFile.md)[]\> -Defined in: [storage.ts:198](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/storage.ts#L198) +Defined in: [storage.ts:198](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/storage.ts#L198) This function uploads files to a bucket. @@ -278,7 +278,7 @@ const uploadedFiles = await storageClient.uploadFiles(files, 'bucket-name'); > `static` **downloadFileFromUrl**(`url`): `Promise`\<`any`\> -Defined in: [storage.ts:146](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/storage.ts#L146) +Defined in: [storage.ts:146](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/storage.ts#L146) This function downloads files from a URL. diff --git a/docs/sdk/typescript/transaction/classes/TransactionUtils.md b/docs/sdk/typescript/transaction/classes/TransactionUtils.md index 06e203fd38..9f45edaace 100644 --- a/docs/sdk/typescript/transaction/classes/TransactionUtils.md +++ b/docs/sdk/typescript/transaction/classes/TransactionUtils.md @@ -6,7 +6,7 @@ # Class: TransactionUtils -Defined in: [transaction.ts:18](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/transaction.ts#L18) +Defined in: [transaction.ts:18](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/transaction.ts#L18) ## Constructors @@ -24,7 +24,7 @@ Defined in: [transaction.ts:18](https://github.com/humanprotocol/human-protocol/ > `static` **getTransaction**(`chainId`, `hash`): `Promise`\<[`ITransaction`](../../interfaces/interfaces/ITransaction.md)\> -Defined in: [transaction.ts:34](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/transaction.ts#L34) +Defined in: [transaction.ts:34](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/transaction.ts#L34) This function returns the transaction data for the given hash. @@ -62,7 +62,7 @@ const transaction = await TransactionUtils.getTransaction(ChainId.POLYGON, '0x62 > `static` **getTransactions**(`filter`): `Promise`\<[`ITransaction`](../../interfaces/interfaces/ITransaction.md)[]\> -Defined in: [transaction.ts:109](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/transaction.ts#L109) +Defined in: [transaction.ts:109](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/transaction.ts#L109) This function returns all transaction details based on the provided filter. diff --git a/docs/sdk/typescript/types/README.md b/docs/sdk/typescript/types/README.md index 19291e4dc2..6c6391cace 100644 --- a/docs/sdk/typescript/types/README.md +++ b/docs/sdk/typescript/types/README.md @@ -12,7 +12,7 @@ ## Type Aliases -- [EscrowCancel](type-aliases/EscrowCancel.md) +- [CancellationRefund](type-aliases/CancellationRefund.md) - [EscrowWithdraw](type-aliases/EscrowWithdraw.md) - [NetworkData](type-aliases/NetworkData.md) - [Payout](type-aliases/Payout.md) diff --git a/docs/sdk/typescript/types/enumerations/EscrowStatus.md b/docs/sdk/typescript/types/enumerations/EscrowStatus.md index bd0eb7b5a4..0372dc8947 100644 --- a/docs/sdk/typescript/types/enumerations/EscrowStatus.md +++ b/docs/sdk/typescript/types/enumerations/EscrowStatus.md @@ -6,7 +6,7 @@ # Enumeration: EscrowStatus -Defined in: [types.ts:8](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L8) +Defined in: [types.ts:8](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L8) Enum for escrow statuses. @@ -16,7 +16,7 @@ Enum for escrow statuses. > **Cancelled**: `5` -Defined in: [types.ts:32](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L32) +Defined in: [types.ts:32](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L32) Escrow is cancelled. @@ -26,7 +26,7 @@ Escrow is cancelled. > **Complete**: `4` -Defined in: [types.ts:28](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L28) +Defined in: [types.ts:28](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L28) Escrow is finished. @@ -36,7 +36,7 @@ Escrow is finished. > **Launched**: `0` -Defined in: [types.ts:12](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L12) +Defined in: [types.ts:12](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L12) Escrow is launched. @@ -46,7 +46,7 @@ Escrow is launched. > **Paid**: `3` -Defined in: [types.ts:24](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L24) +Defined in: [types.ts:24](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L24) Escrow is fully paid. @@ -56,7 +56,7 @@ Escrow is fully paid. > **Partial**: `2` -Defined in: [types.ts:20](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L20) +Defined in: [types.ts:20](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L20) Escrow is partially paid out. @@ -66,6 +66,16 @@ Escrow is partially paid out. > **Pending**: `1` -Defined in: [types.ts:16](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L16) +Defined in: [types.ts:16](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L16) Escrow is funded, and waiting for the results to be submitted. + +*** + +### ToCancel + +> **ToCancel**: `6` + +Defined in: [types.ts:36](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L36) + +Escrow is cancelled. diff --git a/docs/sdk/typescript/types/type-aliases/CancellationRefund.md b/docs/sdk/typescript/types/type-aliases/CancellationRefund.md new file mode 100644 index 0000000000..c3bc70b54f --- /dev/null +++ b/docs/sdk/typescript/types/type-aliases/CancellationRefund.md @@ -0,0 +1,83 @@ +[**@human-protocol/sdk**](../../README.md) + +*** + +[@human-protocol/sdk](../../modules.md) / [types](../README.md) / CancellationRefund + +# Type Alias: CancellationRefund + +> **CancellationRefund** = `object` + +Defined in: [types.ts:195](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L195) + +Represents a cancellation refund event. + +## Properties + +### amount + +> **amount**: `bigint` + +Defined in: [types.ts:211](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L211) + +The amount refunded to the receiver. + +*** + +### block + +> **block**: `number` + +Defined in: [types.ts:216](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L216) + +The block number in which the cancellation refund event occurred. + +*** + +### escrowAddress + +> **escrowAddress**: `string` + +Defined in: [types.ts:203](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L203) + +The address of the escrow associated with the cancellation refund. + +*** + +### id + +> **id**: `string` + +Defined in: [types.ts:199](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L199) + +Unique identifier of the cancellation refund event. + +*** + +### receiver + +> **receiver**: `string` + +Defined in: [types.ts:207](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L207) + +The address of the receiver who received the refund. + +*** + +### timestamp + +> **timestamp**: `number` + +Defined in: [types.ts:220](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L220) + +The timestamp when the cancellation refund event occurred (in UNIX format). + +*** + +### txHash + +> **txHash**: `string` + +Defined in: [types.ts:224](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L224) + +The transaction hash of the cancellation refund event. diff --git a/docs/sdk/typescript/types/type-aliases/EscrowCancel.md b/docs/sdk/typescript/types/type-aliases/EscrowCancel.md deleted file mode 100644 index f9ba874441..0000000000 --- a/docs/sdk/typescript/types/type-aliases/EscrowCancel.md +++ /dev/null @@ -1,33 +0,0 @@ -[**@human-protocol/sdk**](../../README.md) - -*** - -[@human-protocol/sdk](../../modules.md) / [types](../README.md) / EscrowCancel - -# Type Alias: EscrowCancel - -> **EscrowCancel** = `object` - -Defined in: [types.ts:145](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L145) - -Represents the response data for an escrow cancellation. - -## Properties - -### amountRefunded - -> **amountRefunded**: `bigint` - -Defined in: [types.ts:153](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L153) - -The amount refunded in the escrow cancellation. - -*** - -### txHash - -> **txHash**: `string` - -Defined in: [types.ts:149](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L149) - -The hash of the transaction associated with the escrow cancellation. diff --git a/docs/sdk/typescript/types/type-aliases/EscrowWithdraw.md b/docs/sdk/typescript/types/type-aliases/EscrowWithdraw.md index dd316282ff..df5e652664 100644 --- a/docs/sdk/typescript/types/type-aliases/EscrowWithdraw.md +++ b/docs/sdk/typescript/types/type-aliases/EscrowWithdraw.md @@ -8,7 +8,7 @@ > **EscrowWithdraw** = `object` -Defined in: [types.ts:159](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L159) +Defined in: [types.ts:149](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L149) Represents the response data for an escrow withdrawal. @@ -18,7 +18,7 @@ Represents the response data for an escrow withdrawal. > **amountWithdrawn**: `bigint` -Defined in: [types.ts:171](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L171) +Defined in: [types.ts:161](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L161) The amount withdrawn from the escrow. @@ -28,7 +28,7 @@ The amount withdrawn from the escrow. > **tokenAddress**: `string` -Defined in: [types.ts:167](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L167) +Defined in: [types.ts:157](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L157) The address of the token used for the withdrawal. @@ -38,6 +38,6 @@ The address of the token used for the withdrawal. > **txHash**: `string` -Defined in: [types.ts:163](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L163) +Defined in: [types.ts:153](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L153) The hash of the transaction associated with the escrow withdrawal. diff --git a/docs/sdk/typescript/types/type-aliases/NetworkData.md b/docs/sdk/typescript/types/type-aliases/NetworkData.md index 45b8457817..038810c69d 100644 --- a/docs/sdk/typescript/types/type-aliases/NetworkData.md +++ b/docs/sdk/typescript/types/type-aliases/NetworkData.md @@ -8,7 +8,7 @@ > **NetworkData** = `object` -Defined in: [types.ts:95](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L95) +Defined in: [types.ts:99](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L99) Network data @@ -18,7 +18,7 @@ Network data > **chainId**: `number` -Defined in: [types.ts:99](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L99) +Defined in: [types.ts:103](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L103) Network chain id @@ -28,7 +28,7 @@ Network chain id > **factoryAddress**: `string` -Defined in: [types.ts:115](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L115) +Defined in: [types.ts:119](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L119) Escrow Factory contract address @@ -38,7 +38,7 @@ Escrow Factory contract address > **hmtAddress**: `string` -Defined in: [types.ts:111](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L111) +Defined in: [types.ts:115](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L115) HMT Token contract address @@ -48,7 +48,7 @@ HMT Token contract address > **kvstoreAddress**: `string` -Defined in: [types.ts:123](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L123) +Defined in: [types.ts:127](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L127) KVStore contract address @@ -58,7 +58,7 @@ KVStore contract address > **oldFactoryAddress**: `string` -Defined in: [types.ts:139](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L139) +Defined in: [types.ts:143](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L143) Old Escrow Factory contract address @@ -68,7 +68,7 @@ Old Escrow Factory contract address > **oldSubgraphUrl**: `string` -Defined in: [types.ts:135](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L135) +Defined in: [types.ts:139](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L139) Old subgraph URL @@ -78,7 +78,7 @@ Old subgraph URL > **scanUrl**: `string` -Defined in: [types.ts:107](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L107) +Defined in: [types.ts:111](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L111) Network scanner URL @@ -88,7 +88,7 @@ Network scanner URL > **stakingAddress**: `string` -Defined in: [types.ts:119](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L119) +Defined in: [types.ts:123](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L123) Staking contract address @@ -98,7 +98,7 @@ Staking contract address > **subgraphUrl**: `string` -Defined in: [types.ts:127](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L127) +Defined in: [types.ts:131](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L131) Subgraph URL @@ -108,7 +108,7 @@ Subgraph URL > **subgraphUrlApiKey**: `string` -Defined in: [types.ts:131](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L131) +Defined in: [types.ts:135](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L135) Subgraph URL API key @@ -118,6 +118,6 @@ Subgraph URL API key > **title**: `string` -Defined in: [types.ts:103](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L103) +Defined in: [types.ts:107](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L107) Network title diff --git a/docs/sdk/typescript/types/type-aliases/Payout.md b/docs/sdk/typescript/types/type-aliases/Payout.md index e561bcb54b..7406e7107a 100644 --- a/docs/sdk/typescript/types/type-aliases/Payout.md +++ b/docs/sdk/typescript/types/type-aliases/Payout.md @@ -8,7 +8,7 @@ > **Payout** = `object` -Defined in: [types.ts:177](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L177) +Defined in: [types.ts:167](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L167) Represents a payout from an escrow. @@ -18,7 +18,7 @@ Represents a payout from an escrow. > **amount**: `bigint` -Defined in: [types.ts:193](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L193) +Defined in: [types.ts:183](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L183) The amount paid to the recipient. @@ -28,7 +28,7 @@ The amount paid to the recipient. > **createdAt**: `number` -Defined in: [types.ts:197](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L197) +Defined in: [types.ts:187](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L187) The timestamp when the payout was created (in UNIX format). @@ -38,7 +38,7 @@ The timestamp when the payout was created (in UNIX format). > **escrowAddress**: `string` -Defined in: [types.ts:185](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L185) +Defined in: [types.ts:175](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L175) The address of the escrow associated with the payout. @@ -48,7 +48,7 @@ The address of the escrow associated with the payout. > **id**: `string` -Defined in: [types.ts:181](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L181) +Defined in: [types.ts:171](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L171) Unique identifier of the payout. @@ -58,6 +58,6 @@ Unique identifier of the payout. > **recipient**: `string` -Defined in: [types.ts:189](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L189) +Defined in: [types.ts:179](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L179) The address of the recipient who received the payout. diff --git a/docs/sdk/typescript/types/type-aliases/StorageCredentials.md b/docs/sdk/typescript/types/type-aliases/StorageCredentials.md index 03e684053d..1a425a2ed8 100644 --- a/docs/sdk/typescript/types/type-aliases/StorageCredentials.md +++ b/docs/sdk/typescript/types/type-aliases/StorageCredentials.md @@ -8,7 +8,7 @@ > `readonly` **StorageCredentials** = `object` -Defined in: [types.ts:40](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L40) +Defined in: [types.ts:44](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L44) AWS/GCP cloud storage access data @@ -22,7 +22,7 @@ StorageClient is deprecated. Use Minio.Client directly. > **accessKey**: `string` -Defined in: [types.ts:44](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L44) +Defined in: [types.ts:48](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L48) Access Key @@ -32,6 +32,6 @@ Access Key > **secretKey**: `string` -Defined in: [types.ts:48](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L48) +Defined in: [types.ts:52](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L52) Secret Key diff --git a/docs/sdk/typescript/types/type-aliases/StorageParams.md b/docs/sdk/typescript/types/type-aliases/StorageParams.md index 78db5e7c33..37e34e94a4 100644 --- a/docs/sdk/typescript/types/type-aliases/StorageParams.md +++ b/docs/sdk/typescript/types/type-aliases/StorageParams.md @@ -8,7 +8,7 @@ > **StorageParams** = `object` -Defined in: [types.ts:54](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L54) +Defined in: [types.ts:58](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L58) ## Deprecated @@ -20,7 +20,7 @@ StorageClient is deprecated. Use Minio.Client directly. > **endPoint**: `string` -Defined in: [types.ts:58](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L58) +Defined in: [types.ts:62](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L62) Request endPoint @@ -30,7 +30,7 @@ Request endPoint > `optional` **port**: `number` -Defined in: [types.ts:70](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L70) +Defined in: [types.ts:74](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L74) TCP/IP port number. Default value set to 80 for HTTP and 443 for HTTPs @@ -40,7 +40,7 @@ TCP/IP port number. Default value set to 80 for HTTP and 443 for HTTPs > `optional` **region**: `string` -Defined in: [types.ts:66](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L66) +Defined in: [types.ts:70](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L70) Region @@ -50,6 +50,6 @@ Region > **useSSL**: `boolean` -Defined in: [types.ts:62](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L62) +Defined in: [types.ts:66](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L66) Enable secure (HTTPS) access. Default value set to false diff --git a/docs/sdk/typescript/types/type-aliases/TransactionLikeWithNonce.md b/docs/sdk/typescript/types/type-aliases/TransactionLikeWithNonce.md index 9c7bbca8c5..cf873d64cf 100644 --- a/docs/sdk/typescript/types/type-aliases/TransactionLikeWithNonce.md +++ b/docs/sdk/typescript/types/type-aliases/TransactionLikeWithNonce.md @@ -8,7 +8,7 @@ > **TransactionLikeWithNonce** = `TransactionLike` & `object` -Defined in: [types.ts:200](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L200) +Defined in: [types.ts:190](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L190) ## Type declaration diff --git a/docs/sdk/typescript/types/type-aliases/UploadFile.md b/docs/sdk/typescript/types/type-aliases/UploadFile.md index 76a517188f..7199e645f7 100644 --- a/docs/sdk/typescript/types/type-aliases/UploadFile.md +++ b/docs/sdk/typescript/types/type-aliases/UploadFile.md @@ -8,7 +8,7 @@ > `readonly` **UploadFile** = `object` -Defined in: [types.ts:77](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L77) +Defined in: [types.ts:81](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L81) Upload file data @@ -18,7 +18,7 @@ Upload file data > **hash**: `string` -Defined in: [types.ts:89](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L89) +Defined in: [types.ts:93](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L93) Hash of uploaded object key @@ -28,7 +28,7 @@ Hash of uploaded object key > **key**: `string` -Defined in: [types.ts:81](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L81) +Defined in: [types.ts:85](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L85) Uploaded object key @@ -38,6 +38,6 @@ Uploaded object key > **url**: `string` -Defined in: [types.ts:85](https://github.com/humanprotocol/human-protocol/blob/99b899a11bf48f2fa04884687ea395e0d42d75d1/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L85) +Defined in: [types.ts:89](https://github.com/humanprotocol/human-protocol/blob/36a82d86df8ff0c729bd9c2ab3a0bb0641086da4/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L89) Uploaded object URL diff --git a/packages/apps/fortune/recording-oracle/src/common/enums/webhook.ts b/packages/apps/fortune/recording-oracle/src/common/enums/webhook.ts index b2167213f0..ef86d019fe 100644 --- a/packages/apps/fortune/recording-oracle/src/common/enums/webhook.ts +++ b/packages/apps/fortune/recording-oracle/src/common/enums/webhook.ts @@ -1,6 +1,8 @@ export enum EventType { ESCROW_COMPLETED = 'escrow_completed', + ESCROW_CANCELED = 'escrow_canceled', JOB_COMPLETED = 'job_completed', + JOB_CANCELED = 'job_canceled', SUBMISSION_REJECTED = 'submission_rejected', SUBMISSION_IN_REVIEW = 'submission_in_review', } diff --git a/packages/apps/fortune/recording-oracle/src/modules/job/job.service.ts b/packages/apps/fortune/recording-oracle/src/modules/job/job.service.ts index 48c8ea0ef2..c4db73321f 100644 --- a/packages/apps/fortune/recording-oracle/src/modules/job/job.service.ts +++ b/packages/apps/fortune/recording-oracle/src/modules/job/job.service.ts @@ -23,6 +23,7 @@ import { SolutionEventData, WebhookDto, } from '../webhook/webhook.dto'; +import { HMToken__factory } from '@human-protocol/core/typechain-types'; @Injectable() export class JobService { @@ -171,7 +172,16 @@ export class JobService { s.solution === lastExchangeSolution.solution, ); - const amountToReserve = BigInt(fundAmount) / BigInt(submissionsRequired); + const tokenAddress = await escrowClient.getTokenAddress( + webhook.escrowAddress, + ); + const tokenContract = HMToken__factory.connect( + tokenAddress, + this.web3Service.getSigner(webhook.chainId), + ); + const decimals = await tokenContract.decimals(); + const fundAmountInWei = ethers.parseUnits(fundAmount.toString(), decimals); + const amountToReserve = fundAmountInWei / BigInt(submissionsRequired); await escrowClient.storeResults( webhook.escrowAddress, @@ -253,4 +263,66 @@ export class JobService { return 'Solutions recorded.'; } + + public async cancelJob(webhook: WebhookDto): Promise { + const signer = this.web3Service.getSigner(webhook.chainId); + const escrowClient = await EscrowClient.build(signer); + + const recordingOracleAddress = await escrowClient.getRecordingOracleAddress( + webhook.escrowAddress, + ); + if ( + ethers.getAddress(recordingOracleAddress) !== (await signer.getAddress()) + ) { + this.logger.log(ErrorJob.AddressMismatches, JobService.name); + throw new ValidationError(ErrorJob.AddressMismatches); + } + + const escrowStatus = await escrowClient.getStatus(webhook.escrowAddress); + if (escrowStatus !== EscrowStatus.ToCancel) { + this.logger.log(ErrorJob.InvalidStatus, JobService.name); + throw new ConflictError(ErrorJob.InvalidStatus); + } + + const intermediateResultsURL = await escrowClient.getIntermediateResultsUrl( + webhook.escrowAddress, + ); + const hash = + intermediateResultsURL.split('/').pop()?.replace('.json', '') ?? ''; + + await escrowClient.storeResults( + webhook.escrowAddress, + intermediateResultsURL, + hash, + 0n, + ); + + let reputationOracleWebhook: string | null = null; + try { + const reputationOracleAddress = + await escrowClient.getReputationOracleAddress(webhook.escrowAddress); + reputationOracleWebhook = (await KVStoreUtils.get( + webhook.chainId, + reputationOracleAddress, + KVStoreKeys.webhookUrl, + )) as string; + } catch (e) { + //Ignore the error + } + + if (reputationOracleWebhook) { + await sendWebhook( + this.httpService, + this.logger, + reputationOracleWebhook, + { + chainId: webhook.chainId, + escrowAddress: webhook.escrowAddress, + eventType: EventType.JOB_CANCELED, + }, + this.web3ConfigService.privateKey, + ); + return 'The requested job is canceled.'; + } + } } diff --git a/packages/apps/fortune/recording-oracle/src/modules/webhook/webhook.service.ts b/packages/apps/fortune/recording-oracle/src/modules/webhook/webhook.service.ts index 7c8a72dce2..1be8c3f2b8 100644 --- a/packages/apps/fortune/recording-oracle/src/modules/webhook/webhook.service.ts +++ b/packages/apps/fortune/recording-oracle/src/modules/webhook/webhook.service.ts @@ -18,6 +18,10 @@ export class WebhookService { await this.jobService.processJobSolution(wehbook); break; + case EventType.ESCROW_CANCELED: + await this.jobService.cancelJob(wehbook); + break; + default: throw new ValidationError( `Invalid webhook event type: ${wehbook.eventType}`, diff --git a/packages/apps/job-launcher/server/src/common/constants/errors.ts b/packages/apps/job-launcher/server/src/common/constants/errors.ts index e7b9330205..5cda9ff026 100644 --- a/packages/apps/job-launcher/server/src/common/constants/errors.ts +++ b/packages/apps/job-launcher/server/src/common/constants/errors.ts @@ -23,6 +23,7 @@ export enum ErrorJob { DataNotExist = 'Data does not exist', ImageConsistency = 'Ground Truth images not found in dataset', CancelWhileProcessing = 'Your job is being processed and cannot be canceled at this moment. Please, wait a few seconds and try again.', + NoRefundFound = 'No refund found for this escrow', } /** @@ -51,6 +52,7 @@ export enum ErrorWebhook { UrlNotFound = 'Webhook URL not found', NotCreated = 'Webhook has not been created', InvalidEscrow = 'Invalid escrow data provided', + InvalidOracleAddress = 'Invalid oracle address', } /** diff --git a/packages/apps/job-launcher/server/src/common/enums/job.ts b/packages/apps/job-launcher/server/src/common/enums/job.ts index 10b9138107..feb14387af 100644 --- a/packages/apps/job-launcher/server/src/common/enums/job.ts +++ b/packages/apps/job-launcher/server/src/common/enums/job.ts @@ -10,6 +10,7 @@ export enum JobStatus { COMPLETED = 'completed', FAILED = 'failed', TO_CANCEL = 'to_cancel', + CANCELING = 'canceling', CANCELED = 'canceled', } diff --git a/packages/apps/job-launcher/server/src/database/base.repository.ts b/packages/apps/job-launcher/server/src/database/base.repository.ts index 758525d8b4..3ebe7b805e 100644 --- a/packages/apps/job-launcher/server/src/database/base.repository.ts +++ b/packages/apps/job-launcher/server/src/database/base.repository.ts @@ -63,4 +63,17 @@ export class BaseRepository extends Repository { await queryRunner.release(); } } + + async createMany(items: T[]): Promise { + try { + await this.insert(items); + } catch (error) { + if (error instanceof QueryFailedError) { + throw handleQueryFailedError(error); + } else { + throw error; + } + } + return items; + } } diff --git a/packages/apps/job-launcher/server/src/database/migrations/1748266665103-webhookOracleAddress.ts b/packages/apps/job-launcher/server/src/database/migrations/1748266665103-webhookOracleAddress.ts new file mode 100644 index 0000000000..8ba0834906 --- /dev/null +++ b/packages/apps/job-launcher/server/src/database/migrations/1748266665103-webhookOracleAddress.ts @@ -0,0 +1,90 @@ +import { MigrationInterface, QueryRunner } from 'typeorm'; + +export class WebhookOracleAddress1748266665103 implements MigrationInterface { + name = 'WebhookOracleAddress1748266665103'; + + public async up(queryRunner: QueryRunner): Promise { + await queryRunner.query(` + ALTER TABLE "hmt"."webhook" + ADD "oracle_address" character varying + `); + await queryRunner.query(` + ALTER TYPE "hmt"."jobs_status_enum" + RENAME TO "jobs_status_enum_old" + `); + await queryRunner.query(` + CREATE TYPE "hmt"."jobs_status_enum" AS ENUM( + 'paid', + 'under_moderation', + 'moderation_passed', + 'possible_abuse_in_review', + 'created', + 'funded', + 'launched', + 'partial', + 'completed', + 'failed', + 'to_cancel', + 'canceling', + 'canceled' + ) + `); + await queryRunner.query(` + ALTER TABLE "hmt"."jobs" + ALTER COLUMN "status" TYPE "hmt"."jobs_status_enum" USING "status"::"text"::"hmt"."jobs_status_enum" + `); + await queryRunner.query(` + DROP TYPE "hmt"."jobs_status_enum_old" + `); + await queryRunner.query(` + DROP INDEX "hmt"."IDX_012a8481fc9980fcc49f3f0dc2" + `); + await queryRunner.query(` + CREATE UNIQUE INDEX "IDX_e834f9a1d4dc20775e2cb2319e" ON "hmt"."webhook" ( + "chain_id", + "escrow_address", + "event_type", + "oracle_address" + ) + `); + } + + public async down(queryRunner: QueryRunner): Promise { + await queryRunner.query(` + CREATE TYPE "hmt"."jobs_status_enum_old" AS ENUM( + 'paid', + 'under_moderation', + 'moderation_passed', + 'possible_abuse_in_review', + 'created', + 'funded', + 'launched', + 'partial', + 'completed', + 'failed', + 'to_cancel', + 'canceled' + ) + `); + await queryRunner.query(` + ALTER TABLE "hmt"."jobs" + ALTER COLUMN "status" TYPE "hmt"."jobs_status_enum_old" USING "status"::"text"::"hmt"."jobs_status_enum_old" + `); + await queryRunner.query(` + DROP TYPE "hmt"."jobs_status_enum" + `); + await queryRunner.query(` + ALTER TYPE "hmt"."jobs_status_enum_old" + RENAME TO "jobs_status_enum" + `); + await queryRunner.query(` + ALTER TABLE "hmt"."webhook" DROP COLUMN "oracle_address" + `); + await queryRunner.query(` + DROP INDEX "hmt"."IDX_e834f9a1d4dc20775e2cb2319e" + `); + await queryRunner.query(` + CREATE UNIQUE INDEX "IDX_012a8481fc9980fcc49f3f0dc2" ON "hmt"."webhook" ("chain_id", "escrow_address", "event_type") + `); + } +} diff --git a/packages/apps/job-launcher/server/src/modules/cron-job/cron-job.service.spec.ts b/packages/apps/job-launcher/server/src/modules/cron-job/cron-job.service.spec.ts index dd397c871f..2ab5430409 100644 --- a/packages/apps/job-launcher/server/src/modules/cron-job/cron-job.service.spec.ts +++ b/packages/apps/job-launcher/server/src/modules/cron-job/cron-job.service.spec.ts @@ -39,7 +39,6 @@ import { MOCK_FILE_HASH, MOCK_FILE_URL, MOCK_MAX_RETRY_COUNT, - MOCK_TRANSACTION_HASH, } from '../../../test/constants'; import { NetworkConfigService } from '../../common/config/network-config.service'; import { ServerConfigService } from '../../common/config/server-config.service'; @@ -725,10 +724,7 @@ describe('CronJobService', () => { jest.spyOn(service, 'isCronJobRunning').mockResolvedValue(false); - jest.spyOn(jobService, 'processEscrowCancellation').mockResolvedValue({ - txHash: MOCK_TRANSACTION_HASH, - amountRefunded: 1n, - }); + jest.spyOn(jobService, 'processEscrowCancellation').mockResolvedValue(); (EscrowClient.build as any).mockImplementation(() => ({ getExchangeOracleAddress: jest @@ -778,7 +774,7 @@ describe('CronJobService', () => { }); it('should cancel all of the jobs with status TO_CANCEL', async () => { - jest.spyOn(webhookRepository, 'createUnique'); + jest.spyOn(webhookRepository, 'createMany'); jest.spyOn(jobService, 'isEscrowFunded').mockResolvedValue(true); const result = await service.cancelCronJob(); @@ -791,7 +787,7 @@ describe('CronJobService', () => { expect(jobService.processEscrowCancellation).toHaveBeenCalledWith( jobEntityMock2, ); - expect(webhookRepository.createUnique).toHaveBeenCalledTimes(2); + expect(webhookRepository.createMany).toHaveBeenCalledTimes(2); }); it('should not call process escrow cancellation when escrowAddress is not present', async () => { @@ -840,7 +836,7 @@ describe('CronJobService', () => { expect(jobService.processEscrowCancellation).toHaveBeenCalledTimes(2); expect(jobEntityMock1.status).toBe(JobStatus.FAILED); - expect(jobEntityMock2.status).toBe(JobStatus.CANCELED); + expect(jobEntityMock2.status).toBe(JobStatus.CANCELING); }); it('should complete the cron job entity on database to unlock', async () => { diff --git a/packages/apps/job-launcher/server/src/modules/cron-job/cron-job.service.ts b/packages/apps/job-launcher/server/src/modules/cron-job/cron-job.service.ts index 482d5bc904..2d9c205f15 100644 --- a/packages/apps/job-launcher/server/src/modules/cron-job/cron-job.service.ts +++ b/packages/apps/job-launcher/server/src/modules/cron-job/cron-job.service.ts @@ -270,14 +270,7 @@ export class CronJobService { jobEntity.escrowAddress, ) ) { - const { amountRefunded } = - await this.jobService.processEscrowCancellation(jobEntity); - await this.paymentService.createRefundPayment({ - refundAmount: Number(ethers.formatEther(amountRefunded)), - refundCurrency: jobEntity.token, - userId: jobEntity.userId, - jobId: jobEntity.id, - }); + await this.jobService.processEscrowCancellation(jobEntity); } else { await this.paymentService.createRefundPayment({ refundAmount: jobEntity.fundAmount, @@ -286,22 +279,31 @@ export class CronJobService { jobId: jobEntity.id, }); } - jobEntity.status = JobStatus.CANCELED; + jobEntity.status = JobStatus.CANCELING; await this.jobRepository.updateOne(jobEntity); const oracleType = this.jobService.getOracleType( jobEntity.requestType, ); if (oracleType !== OracleType.HCAPTCHA) { - const webhookEntity = new WebhookEntity(); - Object.assign(webhookEntity, { + const baseWebhook = { escrowAddress: jobEntity.escrowAddress, chainId: jobEntity.chainId, eventType: EventType.ESCROW_CANCELED, oracleType, hasSignature: true, - }); - await this.webhookRepository.createUnique(webhookEntity); + }; + const webhooks = [ + Object.assign(new WebhookEntity(), { + ...baseWebhook, + oracleAddress: jobEntity.exchangeOracle, + }), + Object.assign(new WebhookEntity(), { + ...baseWebhook, + oracleAddress: jobEntity.recordingOracle, + }), + ]; + await this.webhookRepository.createMany(webhooks); } } catch (err) { const errorId = uuidv4(); @@ -446,7 +448,11 @@ export class CronJobService { try { const events = []; - const statuses = [EscrowStatus.Partial, EscrowStatus.Complete]; + const statuses = [ + EscrowStatus.Partial, + EscrowStatus.Complete, + EscrowStatus.Cancelled, + ]; const from = lastCronJob?.lastSubgraphTime || undefined; for (const network of this.networkConfigService.networks) { @@ -496,12 +502,16 @@ export class CronJobService { const key = `${event.chainId}-${ethers.getAddress(event.escrowAddress)}`; const job = jobMap.get(key); - if ( - !job || - job.status === JobStatus.TO_CANCEL || - job.status === JobStatus.CANCELED - ) + const eventTimestamp = new Date(event.timestamp * 1000).getTime(); + if (eventTimestamp > latestEventTimestamp) { + latestEventTimestamp = eventTimestamp; + } + if (!job || job.status === JobStatus.CANCELED) continue; + + if (event.status === EscrowStatus[EscrowStatus.Cancelled]) { + await this.jobService.cancelJob(job); continue; + } let newStatus: JobStatus | null = null; if ( @@ -520,10 +530,6 @@ export class CronJobService { job.status = newStatus; jobsToUpdate.push(job); } - const eventTimestamp = new Date(event.timestamp * 1000).getTime(); - if (eventTimestamp > latestEventTimestamp) { - latestEventTimestamp = eventTimestamp; - } } if (jobsToUpdate.length > 0) { diff --git a/packages/apps/job-launcher/server/src/modules/job/job.dto.ts b/packages/apps/job-launcher/server/src/modules/job/job.dto.ts index d46f9db8ae..0ce27d0086 100644 --- a/packages/apps/job-launcher/server/src/modules/job/job.dto.ts +++ b/packages/apps/job-launcher/server/src/modules/job/job.dto.ts @@ -411,14 +411,6 @@ export class GetJobsDto extends PageOptionsDto { status?: JobStatusFilter; } -export class EscrowCancelDto { - @ApiProperty() - public txHash: string; - - @ApiProperty() - public amountRefunded: bigint; -} - export class JobCaptchaAdvancedDto { @ApiProperty({ enum: WorkerLanguage, diff --git a/packages/apps/job-launcher/server/src/modules/job/job.repository.ts b/packages/apps/job-launcher/server/src/modules/job/job.repository.ts index 9e9500e4a5..8c3828a48b 100644 --- a/packages/apps/job-launcher/server/src/modules/job/job.repository.ts +++ b/packages/apps/job-launcher/server/src/modules/job/job.repository.ts @@ -118,7 +118,11 @@ export class JobRepository extends BaseRepository { ]; break; case JobStatusFilter.CANCELED: - statusFilter = [JobStatus.TO_CANCEL, JobStatus.CANCELED]; + statusFilter = [ + JobStatus.TO_CANCEL, + JobStatus.CANCELING, + JobStatus.CANCELED, + ]; break; default: statusFilter = [data.status as any]; diff --git a/packages/apps/job-launcher/server/src/modules/job/job.service.ts b/packages/apps/job-launcher/server/src/modules/job/job.service.ts index d34a6a07c5..bb4d9f90a0 100644 --- a/packages/apps/job-launcher/server/src/modules/job/job.service.ts +++ b/packages/apps/job-launcher/server/src/modules/job/job.service.ts @@ -66,7 +66,6 @@ import { WebhookRepository } from '../webhook/webhook.repository'; import { WhitelistService } from '../whitelist/whitelist.service'; import { CreateJob, - EscrowCancelDto, FortuneFinalResultDto, GetJobsDto, JobDetailsDto, @@ -384,6 +383,7 @@ export class JobService { eventType: EventType.ESCROW_CREATED, oracleType: oracleType, hasSignature: oracleType !== OracleType.HCAPTCHA ? true : false, + oracleAddress: jobEntity.exchangeOracle, }); await this.webhookRepository.createUnique(webhookEntity); @@ -461,7 +461,7 @@ export class JobService { throw new ConflictError(ErrorJob.InvalidStatusCancellation); } - let status = JobStatus.CANCELED; + let status = JobStatus.TO_CANCEL; switch (jobEntity.status) { case JobStatus.PAID: if (await this.isCronJobRunning(CronJobType.CreateEscrow)) { @@ -478,24 +478,12 @@ export class JobService { status = JobStatus.FAILED; } break; - default: - status = JobStatus.TO_CANCEL; - break; } if (status === JobStatus.FAILED) { throw new ConflictError(ErrorJob.CancelWhileProcessing); } - if (status === JobStatus.CANCELED) { - await this.paymentService.createRefundPayment({ - refundAmount: jobEntity.fundAmount, - refundCurrency: jobEntity.token, - userId: jobEntity.userId, - jobId: jobEntity.id, - }); - } - jobEntity.status = status; jobEntity.retriesCount = 0; @@ -663,9 +651,7 @@ export class JobService { } } - public async processEscrowCancellation( - jobEntity: JobEntity, - ): Promise { + public async processEscrowCancellation(jobEntity: JobEntity): Promise { const { chainId, escrowAddress } = jobEntity; const signer = this.web3Service.getSigner(chainId); @@ -860,7 +846,7 @@ export class JobService { return BigInt(feeValue ? feeValue : 1); } - public async completeJob(dto: WebhookDataDto): Promise { + public async finalizeJob(dto: WebhookDataDto): Promise { const jobEntity = await this.jobRepository.findOneByChainIdAndEscrowAddress( dto.chainId, dto.escrowAddress, @@ -870,19 +856,40 @@ export class JobService { throw new NotFoundError(ErrorJob.NotFound); } - // If job status already completed by getDetails do nothing - if (jobEntity.status === JobStatus.COMPLETED) { + // If job status already completed or cancelled by getDetails do nothing + if ( + jobEntity.status === JobStatus.COMPLETED || + jobEntity.status === JobStatus.CANCELED + ) { return; } + if ( jobEntity.status !== JobStatus.LAUNCHED && - jobEntity.status !== JobStatus.PARTIAL + jobEntity.status !== JobStatus.PARTIAL && + jobEntity.status !== JobStatus.CANCELING ) { throw new ConflictError(ErrorJob.InvalidStatusCompletion); } - jobEntity.status = JobStatus.COMPLETED; - await this.jobRepository.updateOne(jobEntity); + // Finalize job based on event type + if ( + dto.eventType === EventType.ESCROW_COMPLETED && + (jobEntity.status === JobStatus.LAUNCHED || + jobEntity.status === JobStatus.PARTIAL) + ) { + jobEntity.status = JobStatus.COMPLETED; + await this.jobRepository.updateOne(jobEntity); + } else if ( + dto.eventType === EventType.ESCROW_CANCELED && + (jobEntity.status === JobStatus.LAUNCHED || + jobEntity.status === JobStatus.PARTIAL || + jobEntity.status === JobStatus.CANCELING) + ) { + this.cancelJob(jobEntity); + } else { + throw new ConflictError(ErrorJob.InvalidStatusCompletion); + } } public async isEscrowFunded( @@ -899,4 +906,27 @@ export class JobService { return false; } + + public async cancelJob(jobEntity: JobEntity): Promise { + console.log('Cancelling job'); + const refund = await EscrowUtils.getCancellationRefund( + jobEntity.chainId, + jobEntity.escrowAddress, + ); + console.log(refund); + + if (!refund || !refund.amount) { + throw new ConflictError(ErrorJob.NoRefundFound); + } + + await this.paymentService.createRefundPayment({ + refundAmount: Number(ethers.formatEther(refund.amount)), + refundCurrency: jobEntity.token, + userId: jobEntity.userId, + jobId: jobEntity.id, + }); + + jobEntity.status = JobStatus.CANCELED; + await this.jobRepository.updateOne(jobEntity); + } } diff --git a/packages/apps/job-launcher/server/src/modules/mutex/mutex-manager.service.ts b/packages/apps/job-launcher/server/src/modules/mutex/mutex-manager.service.ts index 159face8a5..4ba8df2616 100644 --- a/packages/apps/job-launcher/server/src/modules/mutex/mutex-manager.service.ts +++ b/packages/apps/job-launcher/server/src/modules/mutex/mutex-manager.service.ts @@ -66,6 +66,7 @@ export class MutexManagerService implements OnModuleDestroy { ); throw new Error( `Function execution timed out for ${(key as any).id as string}`, + e.stack, ); } this.logger.error( @@ -74,6 +75,7 @@ export class MutexManagerService implements OnModuleDestroy { ); throw new ServerError( `Function execution failed for ${(key as any).id as string}`, + e.stack, ); } } diff --git a/packages/apps/job-launcher/server/src/modules/webhook/webhook.entity.ts b/packages/apps/job-launcher/server/src/modules/webhook/webhook.entity.ts index d376b0e5bf..a567ffa4b8 100644 --- a/packages/apps/job-launcher/server/src/modules/webhook/webhook.entity.ts +++ b/packages/apps/job-launcher/server/src/modules/webhook/webhook.entity.ts @@ -10,7 +10,9 @@ import { import { ChainId } from '@human-protocol/sdk'; @Entity({ schema: NS, name: 'webhook' }) -@Index(['chainId', 'escrowAddress', 'eventType'], { unique: true }) +@Index(['chainId', 'escrowAddress', 'eventType', 'oracleAddress'], { + unique: true, +}) export class WebhookEntity extends BaseEntity { @Column({ type: 'int' }) public chainId: ChainId; @@ -44,4 +46,7 @@ export class WebhookEntity extends BaseEntity { enum: WebhookStatus, }) public status: WebhookStatus = WebhookStatus.PENDING; + + @Column({ type: 'varchar', nullable: true }) + public oracleAddress?: string; } diff --git a/packages/apps/job-launcher/server/src/modules/webhook/webhook.service.spec.ts b/packages/apps/job-launcher/server/src/modules/webhook/webhook.service.spec.ts index 5456323842..d75e9c7389 100644 --- a/packages/apps/job-launcher/server/src/modules/webhook/webhook.service.spec.ts +++ b/packages/apps/job-launcher/server/src/modules/webhook/webhook.service.spec.ts @@ -7,7 +7,7 @@ jest.mock('@human-protocol/sdk', () => ({ import { faker } from '@faker-js/faker/.'; import { createMock } from '@golevelup/ts-jest'; -import { ChainId, EscrowClient, KVStoreUtils } from '@human-protocol/sdk'; +import { ChainId, KVStoreUtils } from '@human-protocol/sdk'; import { HttpService } from '@nestjs/axios'; import { HttpStatus } from '@nestjs/common'; import { ConfigService } from '@nestjs/config'; @@ -15,7 +15,6 @@ import { Test } from '@nestjs/testing'; import { of, throwError } from 'rxjs'; import { MOCK_ADDRESS, - MOCK_EXCHANGE_ORACLE_ADDRESS, MOCK_EXCHANGE_ORACLE_WEBHOOK_URL, MOCK_MAX_RETRY_COUNT, mockConfig, @@ -42,7 +41,6 @@ import { WebhookService } from './webhook.service'; describe('WebhookService', () => { let webhookService: WebhookService, webhookRepository: WebhookRepository, - web3Service: Web3Service, jobService: JobService, jobRepository: JobRepository, httpService: HttpService; @@ -94,7 +92,6 @@ describe('WebhookService', () => { webhookService = moduleRef.get(WebhookService); webhookRepository = moduleRef.get(WebhookRepository); - web3Service = moduleRef.get(Web3Service); httpService = moduleRef.get(HttpService); jobService = moduleRef.get(JobService); jobRepository = moduleRef.get(JobRepository); @@ -114,20 +111,19 @@ describe('WebhookService', () => { hasSignature: false, oracleType: OracleType.FORTUNE, eventType: EventType.ESCROW_CREATED, + oracleAddress: MOCK_ADDRESS, }; it('should throw an error if webhook url is empty', async () => { - jest - .spyOn(webhookService as any, 'getExchangeOracleWebhookUrl') - .mockResolvedValue(''); + KVStoreUtils.get = jest.fn().mockResolvedValue(''); await expect( (webhookService as any).sendWebhook(webhookEntity), ).rejects.toThrow(new ServerError(ErrorWebhook.UrlNotFound)); }); it('should handle error if any exception is thrown', async () => { - jest - .spyOn(webhookService as any, 'getExchangeOracleWebhookUrl') + KVStoreUtils.get = jest + .fn() .mockResolvedValue(MOCK_EXCHANGE_ORACLE_WEBHOOK_URL); jest.spyOn(httpService as any, 'post').mockImplementation(() => { return throwError(() => new Error('HTTP request failed')); @@ -138,8 +134,8 @@ describe('WebhookService', () => { }); it('should successfully process a fortune webhook', async () => { - jest - .spyOn(webhookService as any, 'getExchangeOracleWebhookUrl') + KVStoreUtils.get = jest + .fn() .mockResolvedValue(MOCK_EXCHANGE_ORACLE_WEBHOOK_URL); jest.spyOn(httpService as any, 'post').mockImplementation(() => { return of({ @@ -163,8 +159,8 @@ describe('WebhookService', () => { it('should successfully process a cvat webhook', async () => { webhookEntity.oracleType = OracleType.CVAT; - jest - .spyOn(webhookService as any, 'getExchangeOracleWebhookUrl') + KVStoreUtils.get = jest + .fn() .mockResolvedValue(MOCK_EXCHANGE_ORACLE_WEBHOOK_URL); jest.spyOn(httpService as any, 'post').mockImplementation(() => { return of({ @@ -189,8 +185,8 @@ describe('WebhookService', () => { it('should successfully process a fortune webhook with signature', async () => { webhookEntity.oracleType = OracleType.FORTUNE; webhookEntity.hasSignature = true; - jest - .spyOn(webhookService as any, 'getExchangeOracleWebhookUrl') + KVStoreUtils.get = jest + .fn() .mockResolvedValue(MOCK_EXCHANGE_ORACLE_WEBHOOK_URL); jest.spyOn(httpService as any, 'post').mockImplementation(() => { return of({ @@ -215,8 +211,8 @@ describe('WebhookService', () => { it('should successfully process a cvat webhook with signature', async () => { webhookEntity.oracleType = OracleType.CVAT; webhookEntity.hasSignature = true; - jest - .spyOn(webhookService as any, 'getExchangeOracleWebhookUrl') + KVStoreUtils.get = jest + .fn() .mockResolvedValue(MOCK_EXCHANGE_ORACLE_WEBHOOK_URL); jest.spyOn(httpService as any, 'post').mockImplementation(() => { return of({ @@ -239,35 +235,6 @@ describe('WebhookService', () => { }); }); - describe('getExchangeOracleWebhookUrl', () => { - it('should get the exchange oracle webhook URL', async () => { - web3Service.getSigner = jest.fn().mockReturnValue({ - ...signerMock, - provider: { - getLogs: jest.fn().mockResolvedValue([{}]), - getBlockNumber: jest.fn().mockResolvedValue(100), - }, - }); - - (EscrowClient.build as any).mockImplementation(() => ({ - getExchangeOracleAddress: jest - .fn() - .mockResolvedValue(MOCK_EXCHANGE_ORACLE_ADDRESS), - })); - - KVStoreUtils.get = jest - .fn() - .mockResolvedValue(MOCK_EXCHANGE_ORACLE_WEBHOOK_URL); - - const result = await (webhookService as any).getExchangeOracleWebhookUrl( - MOCK_EXCHANGE_ORACLE_ADDRESS, - ChainId.LOCALHOST, - ); - - expect(result).toBe(MOCK_EXCHANGE_ORACLE_WEBHOOK_URL); - }); - }); - describe('handleWebhookError', () => { it('should set webhook status to FAILED if retries exceed threshold', async () => { const webhookEntity: Partial = { @@ -315,11 +282,11 @@ describe('WebhookService', () => { eventType: EventType.ESCROW_COMPLETED, }; - jest.spyOn(jobService, 'completeJob'); + jest.spyOn(jobService, 'finalizeJob'); expect(await webhookService.handleWebhook(webhook)).toBe(undefined); - expect(jobService.completeJob).toHaveBeenCalledWith(webhook); + expect(jobService.finalizeJob).toHaveBeenCalledWith(webhook); }); it('should handle an escrow failed webhook', async () => { @@ -372,7 +339,7 @@ describe('WebhookService', () => { const webhook: WebhookDataDto = { chainId, escrowAddress, - eventType: EventType.ESCROW_CANCELED, + eventType: EventType.ESCROW_CREATED, }; await expect(webhookService.handleWebhook(webhook)).rejects.toThrow( diff --git a/packages/apps/job-launcher/server/src/modules/webhook/webhook.service.ts b/packages/apps/job-launcher/server/src/modules/webhook/webhook.service.ts index 4bb967ca39..9de7eab5db 100644 --- a/packages/apps/job-launcher/server/src/modules/webhook/webhook.service.ts +++ b/packages/apps/job-launcher/server/src/modules/webhook/webhook.service.ts @@ -1,10 +1,5 @@ /* eslint-disable @typescript-eslint/no-non-null-assertion */ -import { - ChainId, - EscrowClient, - KVStoreKeys, - KVStoreUtils, -} from '@human-protocol/sdk'; +import { KVStoreKeys, KVStoreUtils } from '@human-protocol/sdk'; import { HttpService } from '@nestjs/axios'; import { Inject, Injectable, Logger } from '@nestjs/common'; import { firstValueFrom } from 'rxjs'; @@ -48,9 +43,14 @@ export class WebhookService { public async sendWebhook(webhook: WebhookEntity): Promise { // Configure the HTTP request object. let config = {}; - const webhookUrl = await this.getExchangeOracleWebhookUrl( - webhook.escrowAddress, + + if (!webhook.oracleAddress) { + throw new ServerError(ErrorWebhook.InvalidOracleAddress); + } + const webhookUrl = await KVStoreUtils.get( webhook.chainId, + webhook.oracleAddress, + KVStoreKeys.webhookUrl, ); // Check if the webhook URL was found. @@ -91,33 +91,6 @@ export class WebhookService { } } - /** - * Get the webhook URL from the exchange oracle. - * @param escrowAddress - Escrow contract address. - * @param chainId - Chain ID. - * @returns {Promise} - Returns the webhook URL. - */ - private async getExchangeOracleWebhookUrl( - escrowAddress: string, - chainId: ChainId, - ): Promise { - // Get the signer for the given chain. - const signer = this.web3Service.getSigner(chainId); - - // Build the escrow client and get the exchange oracle address. - const escrowClient = await EscrowClient.build(signer); - const exchangeAddress = - await escrowClient.getExchangeOracleAddress(escrowAddress); - - const exchangeOracleUrl = await KVStoreUtils.get( - chainId, - exchangeAddress, - KVStoreKeys.webhookUrl, - ); - - return exchangeOracleUrl; - } - /** * Handles errors that occur during webhook processing. * It logs the error and, based on retry count, updates the webhook status accordingly. @@ -138,7 +111,8 @@ export class WebhookService { public async handleWebhook(webhook: WebhookDataDto): Promise { switch (webhook.eventType) { case EventType.ESCROW_COMPLETED: - await this.jobService.completeJob(webhook); + case EventType.ESCROW_CANCELED: + await this.jobService.finalizeJob(webhook); break; case EventType.ESCROW_FAILED: diff --git a/packages/apps/reputation-oracle/server/src/modules/escrow-completion/escrow-completion.service.ts b/packages/apps/reputation-oracle/server/src/modules/escrow-completion/escrow-completion.service.ts index d0a4cdd285..117aa690bc 100644 --- a/packages/apps/reputation-oracle/server/src/modules/escrow-completion/escrow-completion.service.ts +++ b/packages/apps/reputation-oracle/server/src/modules/escrow-completion/escrow-completion.service.ts @@ -121,7 +121,10 @@ export class EscrowCompletionService { const escrowStatus = await escrowClient.getStatus( escrowCompletionEntity.escrowAddress, ); - if (escrowStatus === EscrowStatus.Pending) { + if ( + escrowStatus === EscrowStatus.Pending || + escrowStatus === EscrowStatus.ToCancel + ) { const escrowData = await EscrowUtils.getEscrow( escrowCompletionEntity.chainId, escrowCompletionEntity.escrowAddress, @@ -243,7 +246,10 @@ export class EscrowCompletionService { const webhookPayload = { chainId, escrowAddress, - eventType: OutgoingWebhookEventType.ESCROW_COMPLETED, + eventType: + escrowData.status === EscrowStatus[EscrowStatus.Cancelled] + ? OutgoingWebhookEventType.ESCROW_CANCELED + : OutgoingWebhookEventType.ESCROW_COMPLETED, }; let allWebhooksCreated = true; diff --git a/packages/apps/reputation-oracle/server/src/modules/escrow-completion/payouts-calculation/fortune-payouts-calculator.spec.ts b/packages/apps/reputation-oracle/server/src/modules/escrow-completion/payouts-calculation/fortune-payouts-calculator.spec.ts index 08f8e6fe25..b065ac58f6 100644 --- a/packages/apps/reputation-oracle/server/src/modules/escrow-completion/payouts-calculation/fortune-payouts-calculator.spec.ts +++ b/packages/apps/reputation-oracle/server/src/modules/escrow-completion/payouts-calculation/fortune-payouts-calculator.spec.ts @@ -1,15 +1,22 @@ -import { createMock } from '@golevelup/ts-jest'; +jest.mock('@human-protocol/sdk'); + import { faker } from '@faker-js/faker'; +import { createMock } from '@golevelup/ts-jest'; import { Test } from '@nestjs/testing'; -import { ethers } from 'ethers'; import _ from 'lodash'; import { StorageService } from '../../storage'; +import { EscrowClient } from '@human-protocol/sdk'; +import { Web3Service } from '../../web3'; +import { generateTestnetChainId } from '../../web3/fixtures'; import { generateFortuneManifest, generateFortuneSolution } from '../fixtures'; import { FortunePayoutsCalculator } from './fortune-payouts-calculator'; const mockedStorageService = createMock(); +const mockedWeb3Service = createMock(); + +const mockedEscrowClient = jest.mocked(EscrowClient); describe('FortunePayoutsCalculator', () => { let calculator: FortunePayoutsCalculator; @@ -22,6 +29,10 @@ describe('FortunePayoutsCalculator', () => { provide: StorageService, useValue: mockedStorageService, }, + { + provide: Web3Service, + useValue: mockedWeb3Service, + }, ], }).compile(); @@ -31,6 +42,17 @@ describe('FortunePayoutsCalculator', () => { }); describe('calculate', () => { + const balance = BigInt(faker.number.int({ min: 1000 }).toString()); + const mockedGetReservedFunds = jest + .fn() + .mockImplementation(async () => balance); + + beforeAll(() => { + mockedEscrowClient.build.mockResolvedValue({ + getReservedFunds: mockedGetReservedFunds, + } as unknown as EscrowClient); + }); + it('should properly calculate payouts', async () => { const validSolutions = [ generateFortuneSolution(), @@ -47,7 +69,7 @@ describe('FortunePayoutsCalculator', () => { const manifest = generateFortuneManifest(); const payouts = await calculator.calculate({ - chainId: faker.number.int(), + chainId: generateTestnetChainId(), escrowAddress: faker.finance.ethereumAddress(), finalResultsUrl: resultsUrl, manifest, @@ -55,9 +77,7 @@ describe('FortunePayoutsCalculator', () => { const expectedPayouts = validSolutions.map((s) => ({ address: s.workerAddress, - amount: - BigInt(ethers.parseUnits(manifest.fundAmount.toString(), 'ether')) / - BigInt(validSolutions.length), + amount: balance / BigInt(validSolutions.length), })); expect(_.sortBy(payouts, 'address')).toEqual( diff --git a/packages/apps/reputation-oracle/server/src/modules/escrow-completion/payouts-calculation/fortune-payouts-calculator.ts b/packages/apps/reputation-oracle/server/src/modules/escrow-completion/payouts-calculation/fortune-payouts-calculator.ts index ffeb96261c..c1ca54f23d 100644 --- a/packages/apps/reputation-oracle/server/src/modules/escrow-completion/payouts-calculation/fortune-payouts-calculator.ts +++ b/packages/apps/reputation-oracle/server/src/modules/escrow-completion/payouts-calculation/fortune-payouts-calculator.ts @@ -1,11 +1,12 @@ import { Injectable } from '@nestjs/common'; -import { ethers } from 'ethers'; import type { OverrideProperties } from 'type-fest'; import { FortuneFinalResult, FortuneManifest } from '../../../common/types'; import { StorageService } from '../../storage'; +import { Web3Service } from '../../web3'; +import { EscrowClient } from '@human-protocol/sdk'; import { CalclulatePayoutsInput, CalculatedPayout, @@ -19,12 +20,18 @@ type CalculateFortunePayoutsInput = OverrideProperties< @Injectable() export class FortunePayoutsCalculator implements EscrowPayoutsCalculator { - constructor(private readonly storageService: StorageService) {} + constructor( + private readonly storageService: StorageService, + private readonly web3Service: Web3Service, + ) {} async calculate({ - manifest, + chainId, + escrowAddress, finalResultsUrl, }: CalculateFortunePayoutsInput): Promise { + const signer = this.web3Service.getSigner(chainId); + const escrowClient = await EscrowClient.build(signer); const finalResults = await this.storageService.downloadJsonLikeData( finalResultsUrl, @@ -34,9 +41,8 @@ export class FortunePayoutsCalculator implements EscrowPayoutsCalculator { .filter((result) => !result.error) .map((item) => item.workerAddress); - const payoutAmount = - BigInt(ethers.parseUnits(manifest.fundAmount.toString(), 'ether')) / - BigInt(recipients.length); + const remainingFunds = await escrowClient.getReservedFunds(escrowAddress); + const payoutAmount = remainingFunds / BigInt(recipients.length); return recipients.map((recipient) => ({ address: recipient, diff --git a/packages/apps/reputation-oracle/server/src/modules/escrow-completion/results-processing/escrow-results-processor.spec.ts b/packages/apps/reputation-oracle/server/src/modules/escrow-completion/results-processing/escrow-results-processor.spec.ts index 0895ed9e97..c96c052504 100644 --- a/packages/apps/reputation-oracle/server/src/modules/escrow-completion/results-processing/escrow-results-processor.spec.ts +++ b/packages/apps/reputation-oracle/server/src/modules/escrow-completion/results-processing/escrow-results-processor.spec.ts @@ -2,7 +2,7 @@ jest.mock('@human-protocol/sdk'); import { createMock } from '@golevelup/ts-jest'; import { faker } from '@faker-js/faker'; -import { EscrowClient, EscrowUtils } from '@human-protocol/sdk'; +import { EscrowClient, EscrowStatus, EscrowUtils } from '@human-protocol/sdk'; import { Test } from '@nestjs/testing'; import * as crypto from 'crypto'; @@ -73,6 +73,10 @@ describe('BaseEscrowResultsProcessor', () => { it('should fail if downloaded results not complete', async () => { const testError = new Error(`Error: ${faker.string.ulid()}`); + mockedEscrowUtils.getEscrow.mockResolvedValueOnce({ + status: EscrowStatus[EscrowStatus.Launched], + } as any); + processor.assertResultsComplete.mockRejectedValueOnce(testError); await expect( @@ -114,6 +118,91 @@ describe('BaseEscrowResultsProcessor', () => { const jobLauncherAddress = faker.finance.ethereumAddress(); mockedEscrowUtils.getEscrow.mockResolvedValueOnce({ launcher: jobLauncherAddress, + status: EscrowStatus[EscrowStatus.Launched], + } as any); + + const encryptedResult = faker.string.ulid(); + mockedPgpEncryptionService.encrypt.mockResolvedValueOnce(encryptedResult); + + const encryptedResultHash = crypto + .createHash('sha256') + .update(encryptedResult) + .digest('hex'); + const storedResultsFileName = `${encryptedResultHash}.${faker.system.fileExt()}`; + processor.getFinalResultsFileName.mockReturnValueOnce( + storedResultsFileName, + ); + + const storedResultsUrl = faker.internet.url(); + mockedStorageService.uploadData.mockResolvedValueOnce(storedResultsUrl); + + /** ACT */ + const manifest = { resultToAssert: jobResult }; + const storedResultMeta = await processor.storeResults( + chainId, + escrowAddress, + manifest, + ); + + /** ASSERT */ + expect(storedResultMeta.url).toBe(storedResultsUrl); + expect(storedResultMeta.hash).toBe(encryptedResultHash); + + expect(mockedGetIntermediateResultsUrl).toHaveBeenCalledWith( + escrowAddress, + ); + expect(processor.constructIntermediateResultsUrl).toHaveBeenCalledWith( + baseResultsUrl, + ); + expect(mockedStorageService.downloadFile).toHaveBeenCalledWith( + resultsUrl, + ); + expect(mockedEscrowUtils.getEscrow).toHaveBeenCalledWith( + chainId, + escrowAddress, + ); + + expect(mockedPgpEncryptionService.encrypt).toHaveBeenCalledTimes(1); + expect(mockedPgpEncryptionService.encrypt).toHaveBeenCalledWith( + resultsFileContent, + chainId, + [jobLauncherAddress], + ); + + expect(processor.getFinalResultsFileName).toHaveBeenCalledTimes(1); + expect(processor.getFinalResultsFileName).toHaveBeenCalledWith( + encryptedResultHash, + ); + + expect(mockedStorageService.uploadData).toHaveBeenCalledTimes(1); + expect(mockedStorageService.uploadData).toHaveBeenCalledWith( + encryptedResult, + storedResultsFileName, + 'text/plain', + ); + }); + + it('should NOT call assertResultsComplete if status is ToCancel', async () => { + /** ARRANGE */ + const chainId = generateTestnetChainId(); + const escrowAddress = faker.finance.ethereumAddress(); + + const baseResultsUrl = faker.internet.url(); + mockedGetIntermediateResultsUrl.mockResolvedValueOnce(baseResultsUrl); + + const resultsUrl = `${baseResultsUrl}/${faker.system.fileName()}`; + processor.constructIntermediateResultsUrl.mockReturnValueOnce(resultsUrl); + + const jobResult = faker.number.int(); + const resultsFileContent = Buffer.from(jobResult.toString()); + mockedStorageService.downloadFile.mockResolvedValueOnce( + resultsFileContent, + ); + + const jobLauncherAddress = faker.finance.ethereumAddress(); + mockedEscrowUtils.getEscrow.mockResolvedValueOnce({ + launcher: jobLauncherAddress, + status: EscrowStatus[EscrowStatus.ToCancel], } as any); const encryptedResult = faker.string.ulid(); @@ -146,6 +235,7 @@ describe('BaseEscrowResultsProcessor', () => { expect(mockedGetIntermediateResultsUrl).toHaveBeenCalledWith( escrowAddress, ); + expect(processor.assertResultsComplete).not.toHaveBeenCalled(); expect(processor.constructIntermediateResultsUrl).toHaveBeenCalledWith( baseResultsUrl, ); diff --git a/packages/apps/reputation-oracle/server/src/modules/escrow-completion/results-processing/escrow-results-processor.ts b/packages/apps/reputation-oracle/server/src/modules/escrow-completion/results-processing/escrow-results-processor.ts index fa29f5cd88..c3216c9665 100644 --- a/packages/apps/reputation-oracle/server/src/modules/escrow-completion/results-processing/escrow-results-processor.ts +++ b/packages/apps/reputation-oracle/server/src/modules/escrow-completion/results-processing/escrow-results-processor.ts @@ -1,4 +1,9 @@ -import { ChainId, EscrowClient, EscrowUtils } from '@human-protocol/sdk'; +import { + ChainId, + EscrowClient, + EscrowStatus, + EscrowUtils, +} from '@human-protocol/sdk'; import { Injectable } from '@nestjs/common'; import crypto from 'crypto'; @@ -52,10 +57,12 @@ export abstract class BaseEscrowResultsProcessor intermediateResultsUrl, ); - await this.assertResultsComplete(fileContent, manifest); - const escrowData = await EscrowUtils.getEscrow(chainId, escrowAddress); + if (escrowData.status !== EscrowStatus[EscrowStatus.ToCancel]) { + await this.assertResultsComplete(fileContent, manifest); + } + const encryptedResults = await this.pgpEncryptionService.encrypt( fileContent, chainId, diff --git a/packages/apps/reputation-oracle/server/src/modules/webhook/types.ts b/packages/apps/reputation-oracle/server/src/modules/webhook/types.ts index 25c184514a..373ac3551c 100644 --- a/packages/apps/reputation-oracle/server/src/modules/webhook/types.ts +++ b/packages/apps/reputation-oracle/server/src/modules/webhook/types.ts @@ -9,10 +9,12 @@ export type IncomingWebhookData = { export enum IncomingWebhookEventType { JOB_COMPLETED = 'job_completed', + JOB_CANCELED = 'job_canceled', } export enum OutgoingWebhookEventType { ESCROW_COMPLETED = 'escrow_completed', + ESCROW_CANCELED = 'escrow_canceled', ABUSE_DETECTED = 'abuse_detected', ABUSE_DISMISSED = 'abuse_dismissed', } diff --git a/packages/core/contracts/Escrow.sol b/packages/core/contracts/Escrow.sol index 1ca1a2c97e..111174cd0c 100644 --- a/packages/core/contracts/Escrow.sol +++ b/packages/core/contracts/Escrow.sol @@ -49,6 +49,8 @@ contract Escrow is IEscrow, ReentrancyGuard { event Completed(); event Fund(uint256 _amount); event Withdraw(address _token, uint256 _amount); + event CancellationRequested(); + event CancellationRefund(uint256 amount); EscrowStatuses public override status; @@ -231,6 +233,7 @@ contract Escrow is IEscrow, ReentrancyGuard { returns (bool) { status = EscrowStatuses.ToCancel; + emit CancellationRequested(); return true; } @@ -316,6 +319,7 @@ contract Escrow is IEscrow, ReentrancyGuard { uint256 unreservedFunds = remainingFunds - reservedFunds; if (unreservedFunds > 0) { _safeTransfer(token, launcher, unreservedFunds); + emit CancellationRefund(unreservedFunds); remainingFunds = reservedFunds; } } diff --git a/packages/sdk/python/human-protocol-sdk/docs/human_protocol_sdk.worker.rst b/packages/sdk/python/human-protocol-sdk/docs/human_protocol_sdk.worker.rst new file mode 100644 index 0000000000..64b0149c33 --- /dev/null +++ b/packages/sdk/python/human-protocol-sdk/docs/human_protocol_sdk.worker.rst @@ -0,0 +1,15 @@ +human\_protocol\_sdk.worker package +=================================== + +.. automodule:: human_protocol_sdk.worker + :members: + :undoc-members: + :show-inheritance: + +Submodules +---------- + +.. toctree:: + :maxdepth: 4 + + human_protocol_sdk.worker.worker_utils diff --git a/packages/sdk/python/human-protocol-sdk/docs/human_protocol_sdk.worker.worker_utils.rst b/packages/sdk/python/human-protocol-sdk/docs/human_protocol_sdk.worker.worker_utils.rst new file mode 100644 index 0000000000..c45ab7bdcc --- /dev/null +++ b/packages/sdk/python/human-protocol-sdk/docs/human_protocol_sdk.worker.worker_utils.rst @@ -0,0 +1,7 @@ +human\_protocol\_sdk.worker.worker\_utils module +================================================ + +.. automodule:: human_protocol_sdk.worker.worker_utils + :members: + :undoc-members: + :show-inheritance: diff --git a/packages/sdk/python/human-protocol-sdk/human_protocol_sdk/escrow/escrow_client.py b/packages/sdk/python/human-protocol-sdk/human_protocol_sdk/escrow/escrow_client.py index fa07935797..b180d8bc0a 100644 --- a/packages/sdk/python/human-protocol-sdk/human_protocol_sdk/escrow/escrow_client.py +++ b/packages/sdk/python/human-protocol-sdk/human_protocol_sdk/escrow/escrow_client.py @@ -1108,6 +1108,40 @@ def get_balance(self, escrow_address: str) -> Decimal: return self._get_escrow_contract(escrow_address).functions.getBalance().call() + def get_reserved_funds(self, escrow_address: str) -> Decimal: + """ + Gets the reserved funds for a specified escrow address. + + :param escrow_address: Address of the escrow + + :return: Value of the reserved funds + + :raise EscrowClientError: If an error occurs while checking the parameters + + :example: + .. code-block:: python + + from eth_typing import URI + from web3 import Web3 + from web3.providers.auto import load_provider_from_uri + + from human_protocol_sdk.escrow import EscrowClient + + w3 = Web3(load_provider_from_uri(URI("http://localhost:8545"))) + escrow_client = EscrowClient(w3) + + reserved_funds = escrow_client.get_reserved_funds( + "0x62dD51230A30401C455c8398d06F85e4EaB6309f" + ) + """ + + if not Web3.is_address(escrow_address): + raise EscrowClientError(f"Invalid escrow address: {escrow_address}") + + return ( + self._get_escrow_contract(escrow_address).functions.reservedFunds().call() + ) + def get_manifest_hash(self, escrow_address: str) -> str: """ Gets the manifest file hash. diff --git a/packages/sdk/python/human-protocol-sdk/human_protocol_sdk/escrow/escrow_utils.py b/packages/sdk/python/human-protocol-sdk/human_protocol_sdk/escrow/escrow_utils.py index aafc3132bc..c937723bc1 100644 --- a/packages/sdk/python/human-protocol-sdk/human_protocol_sdk/escrow/escrow_utils.py +++ b/packages/sdk/python/human-protocol-sdk/human_protocol_sdk/escrow/escrow_utils.py @@ -32,7 +32,12 @@ from web3 import Web3 from human_protocol_sdk.constants import NETWORKS, ChainId, Status, OrderDirection -from human_protocol_sdk.filter import EscrowFilter, StatusEventFilter, PayoutFilter +from human_protocol_sdk.filter import ( + CancellationRefundFilter, + EscrowFilter, + StatusEventFilter, + PayoutFilter, +) from human_protocol_sdk.utils import ( get_data_from_subgraph, ) @@ -151,6 +156,30 @@ def __init__( self.created_at = created_at +class CancellationRefund: + """ + Represents a cancellation refund event. + """ + + def __init__( + self, + id: str, + escrow_address: str, + receiver: str, + amount: int, + block: int, + timestamp: int, + tx_hash: str, + ): + self.id = id + self.escrow_address = escrow_address + self.receiver = receiver + self.amount = amount + self.block = block + self.timestamp = timestamp + self.tx_hash = tx_hash + + class EscrowUtils: """ A utility class that provides additional escrow-related functionalities. @@ -453,3 +482,134 @@ def get_payouts(filter: PayoutFilter) -> List[Payout]: ] return payouts + + @staticmethod + def get_cancellation_refunds( + filter: CancellationRefundFilter, + ) -> List[CancellationRefund]: + """ + Fetch cancellation refunds from the subgraph based on the provided filter. + + :param filter: Object containing all the necessary parameters to filter cancellation refunds. + + :return List[CancellationRefund]: List of cancellation refunds matching the query parameters. + + :raise EscrowClientError: If an unsupported chain ID or invalid addresses are provided. + """ + from human_protocol_sdk.gql.escrow import get_cancellation_refunds_query + + if filter.escrow_address and not Web3.is_address(filter.escrow_address): + raise EscrowClientError("Invalid escrow address") + + if filter.receiver and not Web3.is_address(filter.receiver): + raise EscrowClientError("Invalid receiver address") + + network = NETWORKS.get(filter.chain_id) + if not network: + raise EscrowClientError("Unsupported Chain ID") + + data = get_data_from_subgraph( + network, + get_cancellation_refunds_query(filter), + { + "escrowAddress": ( + filter.escrow_address.lower() if filter.escrow_address else None + ), + "receiver": filter.receiver.lower() if filter.receiver else None, + "from": int(filter.date_from.timestamp()) if filter.date_from else None, + "to": int(filter.date_to.timestamp()) if filter.date_to else None, + "first": min(filter.first, 1000), + "skip": filter.skip, + "orderDirection": filter.order_direction.value, + }, + ) + + if ( + not data + or "data" not in data + or "cancellationRefundEvents" not in data["data"] + or not data["data"]["cancellationRefundEvents"] + ): + return [] + + refunds_raw = data["data"]["cancellationRefundEvents"] + + refunds = [ + CancellationRefund( + id=refund["id"], + escrow_address=refund["escrowAddress"], + receiver=refund["receiver"], + amount=int(refund["amount"]), + block=int(refund["block"]), + timestamp=int(refund["timestamp"]), + tx_hash=refund["txHash"], + ) + for refund in refunds_raw + ] + + return refunds + + @staticmethod + def get_cancellation_refund( + chain_id: ChainId, escrow_address: str + ) -> CancellationRefund: + """ + Returns the cancellation refund for a given escrow address. + + :param chain_id: Network in which the escrow has been deployed + :param escrow_address: Address of the escrow + + :return: CancellationRefund data or None + + :raise EscrowClientError: If an unsupported chain ID or invalid address is provided. + + :example: + .. code-block:: python + + from human_protocol_sdk.constants import ChainId + from human_protocol_sdk.escrow import EscrowUtils + + refund = EscrowUtils.get_cancellation_refund( + ChainId.POLYGON_AMOY, + "0x1234567890123456789012345678901234567890" + ) + """ + from human_protocol_sdk.gql.escrow import ( + get_cancellation_refund_by_escrow_query, + ) + + if not Web3.is_address(escrow_address): + raise EscrowClientError("Invalid escrow address") + + network = NETWORKS.get(chain_id) + if not network: + raise EscrowClientError("Unsupported Chain ID") + + data = get_data_from_subgraph( + network, + get_cancellation_refund_by_escrow_query(), + { + "escrowAddress": escrow_address.lower(), + }, + ) + + if ( + not data + or "data" not in data + or "cancellationRefundEvents" not in data["data"] + or not data["data"]["cancellationRefundEvents"] + or len(data["data"]["cancellationRefundEvents"]) == 0 + ): + return None + + refund = data["data"]["cancellationRefundEvents"][0] + + return CancellationRefund( + id=refund["id"], + escrow_address=refund["escrowAddress"], + receiver=refund["receiver"], + amount=int(refund["amount"]), + block=int(refund["block"]), + timestamp=int(refund["timestamp"]), + tx_hash=refund["txHash"], + ) diff --git a/packages/sdk/python/human-protocol-sdk/human_protocol_sdk/filter.py b/packages/sdk/python/human-protocol-sdk/human_protocol_sdk/filter.py index 326c271f02..c1b39c4895 100644 --- a/packages/sdk/python/human-protocol-sdk/human_protocol_sdk/filter.py +++ b/packages/sdk/python/human-protocol-sdk/human_protocol_sdk/filter.py @@ -341,3 +341,50 @@ def __init__( self.order_direction = order_direction self.first = min(max(first, 1), 1000) self.skip = max(skip, 0) + + +class CancellationRefundFilter: + """ + A class used to filter cancellation refunds. + """ + + def __init__( + self, + chain_id: ChainId, + escrow_address: str = None, + receiver: str = None, + date_from: datetime = None, + date_to: datetime = None, + first: int = 10, + skip: int = 0, + order_direction: OrderDirection = OrderDirection.DESC, + ): + """ + Initializes a CancellationRefundFilter instance. + :param chain_id: Chain ID to request data + :param escrow_address: Address of the escrow to filter by + :param receiver: Address of the receiver to filter by + :param date_from: Start date for filtering + :param date_to: End date for filtering + :param first: Number of items per page + :param skip: Number of items to skip (for pagination) + :param order_direction: Order direction of results, "asc" or "desc" + """ + if chain_id.value not in set(chain_id.value for chain_id in ChainId): + raise FilterError(f"Invalid ChainId") + if escrow_address and not Web3.is_address(escrow_address): + raise FilterError(f"Invalid escrow address: {escrow_address}") + if receiver and not Web3.is_address(receiver): + raise FilterError(f"Invalid receiver address: {receiver}") + if date_from and date_to and date_from > date_to: + raise FilterError( + f"Invalid dates: {date_from} must be earlier than {date_to}" + ) + self.chain_id = chain_id + self.escrow_address = escrow_address + self.receiver = receiver + self.date_from = date_from + self.date_to = date_to + self.first = first + self.skip = skip + self.order_direction = order_direction diff --git a/packages/sdk/python/human-protocol-sdk/human_protocol_sdk/gql/escrow.py b/packages/sdk/python/human-protocol-sdk/human_protocol_sdk/gql/escrow.py index b20e2ef397..7bd2421b51 100644 --- a/packages/sdk/python/human-protocol-sdk/human_protocol_sdk/gql/escrow.py +++ b/packages/sdk/python/human-protocol-sdk/human_protocol_sdk/gql/escrow.py @@ -25,6 +25,18 @@ } """ +cancellation_refund_fragment = """ +fragment CancellationRefundFields on CancellationRefundEvent { + id + escrowAddress + receiver + amount + block + timestamp + txHash +} +""" + def get_escrows_query(filter: EscrowFilter): return """ @@ -133,3 +145,67 @@ def get_status_query( to_clause="timestamp_lte: $to" if to_ else "", launcher_clause=f"launcher: $launcher" if launcher else "", ) + + +def get_cancellation_refunds_query(filter): + return """ +query GetCancellationRefundEvents( + $escrowAddress: String + $receiver: String + $from: Int + $to: Int + $orderDirection: String + $first: Int + $skip: Int +) {{ + cancellationRefundEvents( + where: {{ + {escrow_address_clause} + {receiver_clause} + {from_clause} + {to_clause} + }} + orderBy: timestamp + orderDirection: $orderDirection + first: $first + skip: $skip + ) {{ + ...CancellationRefundFields + }} +}} +{cancellation_refund_fragment} +""".format( + cancellation_refund_fragment=cancellation_refund_fragment, + escrow_address_clause=( + "escrowAddress: $escrowAddress" + if getattr(filter, "escrow_address", None) + else "" + ), + receiver_clause=( + "receiver: $receiver" if getattr(filter, "receiver", None) else "" + ), + from_clause=( + "timestamp_gte: $from" if getattr(filter, "date_from", None) else "" + ), + to_clause="timestamp_lte: $to" if getattr(filter, "date_to", None) else "", + ) + + +def get_cancellation_refund_by_escrow_query(): + return """ +query GetCancellationRefundEventByEscrow( + $escrowAddress: String! +) {{ + cancellationRefundEvents( + where: {{ escrowAddress: $escrowAddress }} + orderBy: timestamp + orderDirection: desc + first: 1 + ) {{ + ...CancellationRefundFields + }} +}} +{cancellation_refund_fragment} +""".format( + cancellation_refund_fragment=cancellation_refund_fragment + ) diff --git a/packages/sdk/python/human-protocol-sdk/test/human_protocol_sdk/escrow/test_escrow_client.py b/packages/sdk/python/human-protocol-sdk/test/human_protocol_sdk/escrow/test_escrow_client.py index 960c2ac20f..f1db30ec57 100644 --- a/packages/sdk/python/human-protocol-sdk/test/human_protocol_sdk/escrow/test_escrow_client.py +++ b/packages/sdk/python/human-protocol-sdk/test/human_protocol_sdk/escrow/test_escrow_client.py @@ -2719,6 +2719,32 @@ def test_get_factory_address_invalid_escrow(self): "Escrow address is not provided by the factory", str(cm.exception) ) + def test_get_reserved_funds(self): + mock_contract = MagicMock() + mock_contract.functions.reservedFunds = MagicMock() + mock_contract.functions.reservedFunds.return_value.call.return_value = 42 + self.escrow._get_escrow_contract = MagicMock(return_value=mock_contract) + escrow_address = "0x1234567890123456789012345678901234567890" + + result = self.escrow.get_reserved_funds(escrow_address) + + self.escrow._get_escrow_contract.assert_called_once_with(escrow_address) + mock_contract.functions.reservedFunds.assert_called_once_with() + self.assertEqual(result, 42) + + def test_get_reserved_funds_invalid_address(self): + with self.assertRaises(EscrowClientError) as cm: + self.escrow.get_reserved_funds("invalid_address") + self.assertEqual(f"Invalid escrow address: invalid_address", str(cm.exception)) + + def test_get_reserved_funds_invalid_escrow(self): + self.escrow.factory_contract.functions.hasEscrow = MagicMock(return_value=False) + with self.assertRaises(EscrowClientError) as cm: + self.escrow.get_reserved_funds("0x1234567890123456789012345678901234567890") + self.assertEqual( + "Escrow address is not provided by the factory", str(cm.exception) + ) + if __name__ == "__main__": unittest.main(exit=True) diff --git a/packages/sdk/python/human-protocol-sdk/test/human_protocol_sdk/escrow/test_escrow_utils.py b/packages/sdk/python/human-protocol-sdk/test/human_protocol_sdk/escrow/test_escrow_utils.py index a13681e2a0..09311e75db 100644 --- a/packages/sdk/python/human-protocol-sdk/test/human_protocol_sdk/escrow/test_escrow_utils.py +++ b/packages/sdk/python/human-protocol-sdk/test/human_protocol_sdk/escrow/test_escrow_utils.py @@ -12,6 +12,7 @@ EscrowUtils, ) from human_protocol_sdk.filter import ( + CancellationRefundFilter, EscrowFilter, FilterError, StatusEventFilter, @@ -173,13 +174,6 @@ def test_get_escrow_empty_data(self): ) self.assertEqual(escrow, None) - def test_get_escrow_invalid_chain_id(self): - with self.assertRaises(ValueError) as cm: - EscrowUtils.get_escrow( - ChainId(123), "0x1234567890123456789012345678901234567890" - ) - self.assertEqual("123 is not a valid ChainId", str(cm.exception)) - def test_get_escrow_invalid_address_launcher(self): with self.assertRaises(EscrowClientError) as cm: EscrowUtils.get_escrow(ChainId.POLYGON_AMOY, "invalid_address") @@ -434,6 +428,141 @@ def test_get_payouts_with_pagination(self): self.assertEqual(result[0].amount, 1000000000000000000) self.assertEqual(result[1].amount, 2000000000000000000) + def test_get_cancellation_refunds(self): + from human_protocol_sdk.escrow.escrow_utils import CancellationRefundFilter + + with patch( + "human_protocol_sdk.escrow.escrow_utils.get_data_from_subgraph" + ) as mock_function: + mock_refund = { + "id": "1", + "escrowAddress": "0x1234567890123456789012345678901234567890", + "receiver": "0xabcdefabcdefabcdefabcdefabcdefabcdefabcdef", + "amount": "1000000000000000000", + "block": "123456", + "timestamp": "1672531200", + "txHash": "0xhash1", + } + + def side_effect(subgraph_url, query, params): + if subgraph_url == NETWORKS[ChainId.POLYGON_AMOY]: + return {"data": {"cancellationRefundEvents": [mock_refund]}} + + mock_function.side_effect = side_effect + + filter = CancellationRefundFilter( + chain_id=ChainId.POLYGON_AMOY, + escrow_address="0x1234567890123456789012345678901234567890", + date_from=datetime.fromtimestamp(1672531200), + date_to=datetime.fromtimestamp(1672531300), + first=10, + skip=0, + order_direction=OrderDirection.DESC, + ) + refunds = EscrowUtils.get_cancellation_refunds(filter) + + mock_function.assert_called_once() + self.assertEqual(len(refunds), 1) + self.assertEqual(refunds[0].id, mock_refund["id"]) + self.assertEqual(refunds[0].escrow_address, mock_refund["escrowAddress"]) + self.assertEqual(refunds[0].receiver, mock_refund["receiver"]) + self.assertEqual(refunds[0].amount, int(mock_refund["amount"])) + self.assertEqual(refunds[0].block, int(mock_refund["block"])) + self.assertEqual(refunds[0].timestamp, int(mock_refund["timestamp"])) + self.assertEqual(refunds[0].tx_hash, mock_refund["txHash"]) + + def test_get_cancellation_refunds_invalid_escrow_address(self): + with self.assertRaises(FilterError) as context: + CancellationRefundFilter( + chain_id=ChainId.POLYGON_AMOY, escrow_address="invalid_address" + ) + self.assertEqual( + str(context.exception), "Invalid escrow address: invalid_address" + ) + + def test_get_cancellation_refunds_invalid_receiver(self): + with self.assertRaises(FilterError) as context: + CancellationRefundFilter( + chain_id=ChainId.POLYGON_AMOY, receiver="invalid_address" + ) + self.assertEqual( + str(context.exception), "Invalid receiver address: invalid_address" + ) + + def test_get_cancellation_refunds_invalid_dates(self): + with self.assertRaises(FilterError) as context: + CancellationRefundFilter( + chain_id=ChainId.POLYGON_AMOY, + date_from=datetime(2023, 6, 8), + date_to=datetime(2023, 5, 8), + ) + self.assertTrue("must be earlier than" in str(context.exception)) + + def test_get_cancellation_refunds_no_data(self): + from human_protocol_sdk.escrow.escrow_utils import CancellationRefundFilter + + with patch( + "human_protocol_sdk.escrow.escrow_utils.get_data_from_subgraph" + ) as mock_function: + mock_function.return_value = {"data": {"cancellationRefundEvents": []}} + + filter = CancellationRefundFilter(chain_id=ChainId.POLYGON_AMOY) + refunds = EscrowUtils.get_cancellation_refunds(filter) + + self.assertEqual(len(refunds), 0) + + def test_get_cancellation_refund(self): + with patch( + "human_protocol_sdk.escrow.escrow_utils.get_data_from_subgraph" + ) as mock_function: + mock_refund = { + "id": "1", + "escrowAddress": "0x1234567890123456789012345678901234567890", + "receiver": "0xabcdefabcdefabcdefabcdefabcdefabcdefabcdef", + "amount": "1000000000000000000", + "block": "123456", + "timestamp": "1672531200", + "txHash": "0xhash1", + } + + mock_function.return_value = { + "data": { + "cancellationRefundEvents": [mock_refund], + } + } + + refund = EscrowUtils.get_cancellation_refund( + ChainId.POLYGON_AMOY, + "0x1234567890123456789012345678901234567890", + ) + + mock_function.assert_called_once() + self.assertIsNotNone(refund) + self.assertEqual(refund.id, mock_refund["id"]) + self.assertEqual(refund.escrow_address, mock_refund["escrowAddress"]) + self.assertEqual(refund.receiver, mock_refund["receiver"]) + self.assertEqual(refund.amount, int(mock_refund["amount"])) + self.assertEqual(refund.block, int(mock_refund["block"])) + self.assertEqual(refund.timestamp, int(mock_refund["timestamp"])) + self.assertEqual(refund.tx_hash, mock_refund["txHash"]) + + def test_get_cancellation_refund_no_data(self): + with patch( + "human_protocol_sdk.escrow.escrow_utils.get_data_from_subgraph" + ) as mock_function: + mock_function.return_value = {"data": {"cancellationRefundEvents": []}} + + refund = EscrowUtils.get_cancellation_refund( + ChainId.POLYGON_AMOY, + "0x1234567890123456789012345678901234567890", + ) + self.assertIsNone(refund) + + def test_get_cancellation_refund_invalid_address(self): + with self.assertRaises(EscrowClientError) as cm: + EscrowUtils.get_cancellation_refund(ChainId.POLYGON_AMOY, "invalid_address") + self.assertEqual("Invalid escrow address", str(cm.exception)) + if __name__ == "__main__": unittest.main(exit=True) diff --git a/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts b/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts index 74b5465471..3a1aa2450e 100644 --- a/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts +++ b/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts @@ -43,6 +43,8 @@ import { } from './error'; import { EscrowData, + GET_CANCELLATION_REFUNDS_QUERY, + GET_CANCELLATION_REFUND_BY_ADDRESS_QUERY, GET_ESCROWS_QUERY, GET_ESCROW_BY_ADDRESS_QUERY, GET_PAYOUTS_QUERY, @@ -56,12 +58,12 @@ import { IStatusEventFilter, } from './interfaces'; import { - EscrowCancel, EscrowStatus, EscrowWithdraw, NetworkData, TransactionLikeWithNonce, Payout, + CancellationRefund, } from './types'; import { getSubgraphUrl, @@ -508,7 +510,7 @@ export class EscrowClient extends BaseEthersClient { throw ErrorHashIsEmptyString; } - if (amount <= 0n) { + if (amount < 0n) { throw ErrorAmountMustBePositive; } @@ -701,7 +703,7 @@ export class EscrowClient extends BaseEthersClient { async cancel( escrowAddress: string, txOptions: Overrides = {} - ): Promise { + ): Promise { if (!ethers.isAddress(escrowAddress)) { throw ErrorInvalidEscrowAddressProvided; } @@ -713,43 +715,9 @@ export class EscrowClient extends BaseEthersClient { try { const escrowContract = this.getEscrowContract(escrowAddress); - const transactionReceipt = await ( - await escrowContract.cancel(txOptions) - ).wait(); - - let amountTransferred: bigint | undefined = undefined; - const tokenAddress = await escrowContract.token(); - - const tokenContract: HMToken = HMToken__factory.connect( - tokenAddress, - this.runner - ); - if (transactionReceipt) - for (const log of transactionReceipt.logs) { - if (log.address === tokenAddress) { - const parsedLog = tokenContract.interface.parseLog({ - topics: log.topics as string[], - data: log.data, - }); + await (await escrowContract.cancel(txOptions)).wait(); - const from = parsedLog?.args[0]; - if (parsedLog?.name === 'Transfer' && from === escrowAddress) { - amountTransferred = parsedLog?.args[2]; - break; - } - } - } - - if (amountTransferred === undefined) { - throw ErrorTransferEventNotFoundInTransactionLogs; - } - - const escrowCancelData: EscrowCancel = { - txHash: transactionReceipt?.hash || '', - amountRefunded: amountTransferred, - }; - - return escrowCancelData; + return; } catch (e) { return throwError(e); } @@ -1123,6 +1091,43 @@ export class EscrowClient extends BaseEthersClient { } } + /** + * This function returns the reserved funds for a specified escrow address. + * + * @param {string} escrowAddress Address of the escrow. + * @returns {Promise} Reserved funds of the escrow in the token used to fund it. + * + * **Code example** + * + * ```ts + * import { providers } from 'ethers'; + * import { EscrowClient } from '@human-protocol/sdk'; + * + * const rpcUrl = 'YOUR_RPC_URL'; + * + * const provider = new providers.JsonRpcProvider(rpcUrl); + * const escrowClient = await EscrowClient.build(provider); + * + * const reservedFunds = await escrowClient.getReservedFunds('0x62dD51230A30401C455c8398d06F85e4EaB6309f'); + * ``` + */ + async getReservedFunds(escrowAddress: string): Promise { + if (!ethers.isAddress(escrowAddress)) { + throw ErrorInvalidEscrowAddressProvided; + } + + if (!(await this.escrowFactoryContract.hasEscrow(escrowAddress))) { + throw ErrorEscrowAddressIsNotProvidedByFactory; + } + + try { + const escrowContract = this.getEscrowContract(escrowAddress); + return await escrowContract.reservedFunds(); + } catch (e) { + return throwError(e); + } + } + /** * This function returns the manifest file hash. * @@ -1990,4 +1995,158 @@ export class EscrowUtils { return payouts || []; } + + /** + * This function returns the cancellation refunds for a given set of networks. + * + * > This uses Subgraph + * + * **Input parameters** + * + * ```ts + * enum ChainId { + * ALL = -1, + * MAINNET = 1, + * SEPOLIA = 11155111, + * BSC_MAINNET = 56, + * BSC_TESTNET = 97, + * POLYGON = 137, + * POLYGON_AMOY = 80002, + * LOCALHOST = 1338, + * } + * ``` + * + * ```ts + * type CancellationRefund = { + * id: string; + * escrowAddress: string; + * receiver: string; + * amount: bigint; + * block: number; + * timestamp: number; + * txHash: string; + * }; + * ``` + * + * + * @param {Object} filter Filter parameters. + * @returns {Promise} List of cancellation refunds matching the filters. + * + * **Code example** + * + * ```ts + * import { ChainId, EscrowUtils } from '@human-protocol/sdk'; + * + * const cancellationRefunds = await EscrowUtils.getCancellationRefunds({ + * chainId: ChainId.POLYGON_AMOY, + * escrowAddress: '0x1234567890123456789012345678901234567890', + * }); + * console.log(cancellationRefunds); + * ``` + */ + public static async getCancellationRefunds(filter: { + chainId: ChainId; + escrowAddress?: string; + receiver?: string; + from?: Date; + to?: Date; + first?: number; + skip?: number; + orderDirection?: OrderDirection; + }): Promise { + const networkData = NETWORKS[filter.chainId]; + if (!networkData) throw ErrorUnsupportedChainID; + if (filter.escrowAddress && !ethers.isAddress(filter.escrowAddress)) { + throw ErrorInvalidEscrowAddressProvided; + } + if (filter.receiver && !ethers.isAddress(filter.receiver)) { + throw ErrorInvalidAddress; + } + + const first = + filter.first !== undefined ? Math.min(filter.first, 1000) : 10; + const skip = filter.skip || 0; + const orderDirection = filter.orderDirection || OrderDirection.DESC; + + const { cancellationRefundEvents } = await gqlFetch<{ + cancellationRefundEvents: CancellationRefund[]; + }>(getSubgraphUrl(networkData), GET_CANCELLATION_REFUNDS_QUERY(filter), { + escrowAddress: filter.escrowAddress?.toLowerCase(), + receiver: filter.receiver?.toLowerCase(), + from: filter.from ? getUnixTimestamp(filter.from) : undefined, + to: filter.to ? getUnixTimestamp(filter.to) : undefined, + first, + skip, + orderDirection, + }); + + return cancellationRefundEvents || []; + } + + /** + * This function returns the cancellation refund for a given escrow address. + * + * > This uses Subgraph + * + * **Input parameters** + * + * ```ts + * enum ChainId { + * ALL = -1, + * MAINNET = 1, + * SEPOLIA = 11155111, + * BSC_MAINNET = 56, + * BSC_TESTNET = 97, + * POLYGON = 137, + * POLYGON_AMOY = 80002, + * LOCALHOST = 1338, + * } + * ``` + * + * ```ts + * type CancellationRefund = { + * id: string; + * escrowAddress: string; + * receiver: string; + * amount: bigint; + * block: number; + * timestamp: number; + * txHash: string; + * }; + * ``` + * + * + * @param {ChainId} chainId Network in which the escrow has been deployed + * @param {string} escrowAddress Address of the escrow + * @returns {Promise} Cancellation refund data + * + * **Code example** + * + * ```ts + * import { ChainId, EscrowUtils } from '@human-protocol/sdk'; + * + * const cancellationRefund = await EscrowUtils.getCancellationRefund(ChainId.POLYGON_AMOY, "0x1234567890123456789012345678901234567890"); + * ``` + */ + public static async getCancellationRefund( + chainId: ChainId, + escrowAddress: string + ): Promise { + const networkData = NETWORKS[chainId]; + if (!networkData) throw ErrorUnsupportedChainID; + + if (!ethers.isAddress(escrowAddress)) { + throw ErrorInvalidEscrowAddressProvided; + } + + const { cancellationRefundEvents } = await gqlFetch<{ + cancellationRefundEvents: any; + }>( + getSubgraphUrl(networkData), + GET_CANCELLATION_REFUND_BY_ADDRESS_QUERY(), + { escrowAddress: escrowAddress.toLowerCase() } + ); + + return cancellationRefundEvents?.[0] || null; + } } diff --git a/packages/sdk/typescript/human-protocol-sdk/src/graphql/queries/escrow.ts b/packages/sdk/typescript/human-protocol-sdk/src/graphql/queries/escrow.ts index 92637f37fa..131bddcd85 100644 --- a/packages/sdk/typescript/human-protocol-sdk/src/graphql/queries/escrow.ts +++ b/packages/sdk/typescript/human-protocol-sdk/src/graphql/queries/escrow.ts @@ -1,5 +1,5 @@ import gql from 'graphql-tag'; -import { IEscrowsFilter } from '../../interfaces'; +import { ICancellationRefundFilter, IEscrowsFilter } from '../../interfaces'; const ESCROW_FRAGMENT = gql` fragment EscrowFields on Escrow { @@ -25,6 +25,18 @@ const ESCROW_FRAGMENT = gql` } `; +const CANCELLATION_REFUND_FRAGMENT = gql` + fragment CancellationRefundFields on CancellationRefundEvent { + id + escrowAddress + receiver + amount + block + timestamp + txHash + } +`; + export const GET_ESCROW_BY_ADDRESS_QUERY = () => gql` query getEscrowByAddress($escrowAddress: String!) { escrow(id: $escrowAddress) { @@ -124,3 +136,42 @@ export const GET_STATUS_UPDATES_QUERY = ( } `; }; + +export const GET_CANCELLATION_REFUNDS_QUERY = ( + filter: ICancellationRefundFilter +) => gql` + query CancellationRefundEvents( + $escrowAddress: Bytes + $receiver: Bytes + $from: Int + $to: Int + $first: Int + $skip: Int + $orderDirection: OrderDirection + ) { + cancellationRefundEvents( + where: { + ${filter.escrowAddress ? 'escrowAddress: $escrowAddress' : ''} + ${filter.receiver ? 'receiver: $receiver' : ''} + ${filter.from ? 'timestamp_gte: $from' : ''} + ${filter.to ? 'timestamp_lte: $to' : ''} + } + first: $first + skip: $skip + orderBy: timestamp + orderDirection: $orderDirection + ) { + ...CancellationRefundFields + } + } + ${CANCELLATION_REFUND_FRAGMENT} +`; + +export const GET_CANCELLATION_REFUND_BY_ADDRESS_QUERY = () => gql` + query getCancellationRefundByAddress($escrowAddress: String!) { + cancellationRefundEvents(where: { escrowAddress: $escrowAddress }) { + ...CancellationRefundFields + } + } + ${CANCELLATION_REFUND_FRAGMENT} +`; diff --git a/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts b/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts index aadcb6afb2..3e6c4c22bd 100644 --- a/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts +++ b/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts @@ -183,3 +183,11 @@ export interface IWorkersFilter extends IPagination { address?: string; orderBy?: string; } + +export interface ICancellationRefundFilter extends IPagination { + chainId: ChainId; + escrowAddress?: string; + receiver?: string; + from?: Date; + to?: Date; +} diff --git a/packages/sdk/typescript/human-protocol-sdk/src/types.ts b/packages/sdk/typescript/human-protocol-sdk/src/types.ts index 17ac94cd92..0c12ff3988 100644 --- a/packages/sdk/typescript/human-protocol-sdk/src/types.ts +++ b/packages/sdk/typescript/human-protocol-sdk/src/types.ts @@ -30,6 +30,10 @@ export enum EscrowStatus { * Escrow is cancelled. */ Cancelled, + /** + * Escrow is cancelled. + */ + ToCancel, } /** @@ -139,20 +143,6 @@ export type NetworkData = { oldFactoryAddress: string; }; -/** - * Represents the response data for an escrow cancellation. - */ -export type EscrowCancel = { - /** - * The hash of the transaction associated with the escrow cancellation. - */ - txHash: string; - /** - * The amount refunded in the escrow cancellation. - */ - amountRefunded: bigint; -}; - /** * Represents the response data for an escrow withdrawal. */ @@ -198,3 +188,38 @@ export type Payout = { }; export type TransactionLikeWithNonce = TransactionLike & { nonce: number }; + +/** + * Represents a cancellation refund event. + */ +export type CancellationRefund = { + /** + * Unique identifier of the cancellation refund event. + */ + id: string; + /** + * The address of the escrow associated with the cancellation refund. + */ + escrowAddress: string; + /** + * The address of the receiver who received the refund. + */ + receiver: string; + /** + * The amount refunded to the receiver. + */ + amount: bigint; + /** + * The block number in which the cancellation refund event occurred. + */ + + block: number; + /** + * The timestamp when the cancellation refund event occurred (in UNIX format). + */ + timestamp: number; + /** + * The transaction hash of the cancellation refund event. + */ + txHash: string; +}; diff --git a/packages/sdk/typescript/human-protocol-sdk/test/escrow.test.ts b/packages/sdk/typescript/human-protocol-sdk/test/escrow.test.ts index d1ee83aa18..615f201e5b 100644 --- a/packages/sdk/typescript/human-protocol-sdk/test/escrow.test.ts +++ b/packages/sdk/typescript/human-protocol-sdk/test/escrow.test.ts @@ -41,7 +41,7 @@ import { GET_ESCROW_BY_ADDRESS_QUERY, GET_PAYOUTS_QUERY, } from '../src/graphql'; -import { EscrowStatus } from '../src/types'; +import { CancellationRefund, EscrowStatus } from '../src/types'; import { DEFAULT_GAS_PAYER_PRIVKEY, DEFAULT_TX_ID, @@ -102,6 +102,7 @@ describe('EscrowClient', () => { addTrustedHandlers: vi.fn(), getBalance: vi.fn(), remainingFunds: vi.fn(), + reservedFunds: vi.fn(), manifestHash: vi.fn(), manifestUrl: vi.fn(), finalResultsUrl: vi.fn(), @@ -1603,41 +1604,16 @@ describe('EscrowClient', () => { test('should successfully cancel escrow', async () => { const escrowAddress = ethers.ZeroAddress; - const amountRefunded = 1n; escrowClient.escrowContract.token.mockResolvedValueOnce( ethers.ZeroAddress ); - - const log = { - address: ethers.ZeroAddress, - name: 'Transfer', - args: [ethers.ZeroAddress, ethers.ZeroAddress, amountRefunded], - }; - mockTx.wait.mockResolvedValueOnce({ - hash: FAKE_HASH, - logs: [log], - }); - - const mockHMTokenFactoryContract = { - interface: { - parseLog: vi.fn().mockReturnValueOnce(log), - }, - }; - - vi.spyOn(HMToken__factory, 'connect').mockReturnValue( - mockHMTokenFactoryContract as any - ); - escrowClient.escrowFactoryContract.hasEscrow.mockReturnValue(true); escrowClient.escrowContract.cancel.mockResolvedValueOnce(mockTx); const result = await escrowClient.cancel(escrowAddress); - expect(result).toStrictEqual({ - amountRefunded, - txHash: FAKE_HASH, - }); + expect(result).toBe(undefined); expect(escrowClient.escrowContract.cancel).toHaveBeenCalledWith({}); }); @@ -1652,85 +1628,19 @@ describe('EscrowClient', () => { expect(escrowClient.escrowContract.cancel).toHaveBeenCalledWith({}); }); - test('should throw an error if the wait fails', async () => { - const escrowAddress = ethers.ZeroAddress; - mockTx.wait.mockRejectedValueOnce(new Error()); - escrowClient.escrowFactoryContract.hasEscrow.mockReturnValue(true); - escrowClient.escrowContract.cancel.mockResolvedValueOnce(mockTx); - - await expect(escrowClient.cancel(escrowAddress)).rejects.toThrow(); - - expect(escrowClient.escrowContract.cancel).toHaveBeenCalledWith({}); - }); - - test('should throw an error if transfer event not found in transaction logs', async () => { - const escrowAddress = ethers.ZeroAddress; - mockTx.wait.mockResolvedValueOnce({ - transactionHash: FAKE_HASH, - logs: [ - { - address: ethers.ZeroAddress, - name: 'NotTransfer', - args: [ethers.ZeroAddress, ethers.ZeroAddress, undefined], - }, - ], - }); - escrowClient.escrowFactoryContract.hasEscrow.mockReturnValue(true); - escrowClient.escrowContract.cancel.mockResolvedValueOnce(mockTx); - - const mockHMTokenFactoryContract = { - interface: { - parseLog: vi.fn(), - }, - }; - - vi.spyOn(HMToken__factory, 'connect').mockReturnValue( - mockHMTokenFactoryContract as any - ); - - await expect(escrowClient.cancel(escrowAddress)).rejects.toThrow(); - - expect(escrowClient.escrowContract.cancel).toHaveBeenCalledWith({}); - }); - test('should successfully cancel escrow with transaction options', async () => { const escrowAddress = ethers.ZeroAddress; - const amountRefunded = 1n; escrowClient.escrowContract.token.mockResolvedValueOnce( ethers.ZeroAddress ); - - const log = { - address: ethers.ZeroAddress, - name: 'Transfer', - args: [ethers.ZeroAddress, ethers.ZeroAddress, amountRefunded], - }; - mockTx.wait.mockResolvedValueOnce({ - hash: FAKE_HASH, - logs: [log], - }); - - const mockHMTokenFactoryContract = { - interface: { - parseLog: vi.fn().mockReturnValueOnce(log), - }, - }; - - vi.spyOn(HMToken__factory, 'connect').mockReturnValue( - mockHMTokenFactoryContract as any - ); - escrowClient.escrowFactoryContract.hasEscrow.mockReturnValue(true); escrowClient.escrowContract.cancel.mockResolvedValueOnce(mockTx); const txOptions: Overrides = { gasLimit: 45000 }; const result = await escrowClient.cancel(escrowAddress, txOptions); - expect(result).toStrictEqual({ - amountRefunded, - txHash: FAKE_HASH, - }); + expect(result).toBe(undefined); expect(escrowClient.escrowContract.cancel).toHaveBeenCalledWith( txOptions ); @@ -2619,6 +2529,56 @@ describe('EscrowClient', () => { expect(escrowClient.escrowContract.escrowFactory).toHaveBeenCalledWith(); }); }); + + describe('getReservedFunds', () => { + test('should throw an error if escrowAddress is an invalid address', async () => { + const escrowAddress = FAKE_ADDRESS; + + await expect( + escrowClient.getReservedFunds(escrowAddress) + ).rejects.toThrow(ErrorInvalidEscrowAddressProvided); + }); + + test('should throw an error if hasEscrow returns false', async () => { + const escrowAddress = ethers.ZeroAddress; + + escrowClient.escrowFactoryContract.hasEscrow.mockReturnValue(false); + + await expect( + escrowClient.getReservedFunds(escrowAddress) + ).rejects.toThrow(ErrorEscrowAddressIsNotProvidedByFactory); + }); + + test('should successfully getReservedFunds', async () => { + const escrowAddress = ethers.ZeroAddress; + const reservedAmount = 123n; + + escrowClient.escrowFactoryContract.hasEscrow.mockReturnValue(true); + escrowClient.escrowContract.reservedFunds.mockResolvedValueOnce( + reservedAmount + ); + + const result = await escrowClient.getReservedFunds(escrowAddress); + + expect(result).toEqual(reservedAmount); + expect(escrowClient.escrowContract.reservedFunds).toHaveBeenCalledWith(); + }); + + test('should throw an error if getReservedFunds fails', async () => { + const escrowAddress = ethers.ZeroAddress; + + escrowClient.escrowFactoryContract.hasEscrow.mockReturnValue(true); + escrowClient.escrowContract.reservedFunds.mockRejectedValueOnce( + new Error() + ); + + await expect( + escrowClient.getReservedFunds(escrowAddress) + ).rejects.toThrow(); + + expect(escrowClient.escrowContract.reservedFunds).toHaveBeenCalledWith(); + }); + }); }); describe('EscrowUtils', () => { @@ -3311,4 +3271,147 @@ describe('EscrowUtils', () => { expect(gqlFetchSpy).toHaveBeenCalled(); }); }); + + describe('getCancellationRefunds', () => { + afterEach(() => { + vi.clearAllMocks(); + }); + + test('should throw an error if chainId is invalid', async () => { + await expect( + EscrowUtils.getCancellationRefunds({ chainId: 123 } as any) + ).rejects.toThrow(ErrorUnsupportedChainID); + }); + + test('should throw an error if escrowAddress is invalid', async () => { + const filter = { + chainId: ChainId.POLYGON_AMOY, + escrowAddress: 'invalid_address', + }; + + await expect(EscrowUtils.getCancellationRefunds(filter)).rejects.toThrow( + ErrorInvalidEscrowAddressProvided + ); + }); + + test('should throw an error if receiver is invalid', async () => { + const filter = { + chainId: ChainId.POLYGON_AMOY, + receiver: 'invalid_address', + }; + + await expect(EscrowUtils.getCancellationRefunds(filter)).rejects.toThrow( + ErrorInvalidAddress + ); + }); + + test('should successfully getCancellationRefunds', async () => { + const refunds: CancellationRefund[] = [ + { + id: '1', + escrowAddress: '0x1234567890123456789012345678901234567890', + receiver: '0xabcdefabcdefabcdefabcdefabcdefabcdefabcdef', + amount: 1000n, + block: 123456, + timestamp: 1710000000, + txHash: '0xhash1', + }, + { + id: '2', + escrowAddress: '0x1234567890123456789012345678901234567890', + receiver: '0xabcdefabcdefabcdefabcdefabcdefabcdefabcdef', + amount: 2000n, + block: 123457, + timestamp: 1710000001, + txHash: '0xhash2', + }, + ]; + + const gqlFetchSpy = vi + .spyOn(gqlFetch, 'default') + .mockResolvedValue({ cancellationRefundEvents: refunds }); + + const filter = { + chainId: ChainId.POLYGON_AMOY, + }; + + const result = await EscrowUtils.getCancellationRefunds(filter); + expect(result).toEqual(refunds); + expect(gqlFetchSpy).toHaveBeenCalled(); + }); + + test('should return an empty array if no refunds are found', async () => { + const gqlFetchSpy = vi + .spyOn(gqlFetch, 'default') + .mockResolvedValue({ cancellationRefundEvents: [] }); + + const filter = { + chainId: ChainId.POLYGON_AMOY, + }; + + const result = await EscrowUtils.getCancellationRefunds(filter); + expect(result).toEqual([]); + expect(gqlFetchSpy).toHaveBeenCalled(); + }); + }); + + describe('getCancellationRefund', () => { + afterEach(() => { + vi.clearAllMocks(); + }); + + test('should throw an error if chainId is invalid', async () => { + await expect( + EscrowUtils.getCancellationRefund( + 123 as any, + '0x1234567890123456789012345678901234567890' + ) + ).rejects.toThrow(ErrorUnsupportedChainID); + }); + + test('should throw an error if escrowAddress is invalid', async () => { + await expect( + EscrowUtils.getCancellationRefund( + ChainId.POLYGON_AMOY, + 'invalid_address' + ) + ).rejects.toThrow(ErrorInvalidEscrowAddressProvided); + }); + + test('should successfully getCancellationRefund', async () => { + const refund: CancellationRefund = { + id: '1', + escrowAddress: '0x1234567890123456789012345678901234567890', + receiver: '0xabcdefabcdefabcdefabcdefabcdefabcdefabcdef', + amount: 1000n, + block: 123456, + timestamp: 1710000000, + txHash: '0xhash1', + }; + + const gqlFetchSpy = vi + .spyOn(gqlFetch, 'default') + .mockResolvedValue({ cancellationRefundEvents: [refund] }); + + const result = await EscrowUtils.getCancellationRefund( + ChainId.POLYGON_AMOY, + refund.escrowAddress + ); + expect(result).toEqual(refund); + expect(gqlFetchSpy).toHaveBeenCalled(); + }); + + test('should return null if no refund is found', async () => { + const gqlFetchSpy = vi + .spyOn(gqlFetch, 'default') + .mockResolvedValue({ cancellationRefundEvents: [] }); + + const result = await EscrowUtils.getCancellationRefund( + ChainId.POLYGON_AMOY, + '0x1234567890123456789012345678901234567890' + ); + expect(result).toBeNull(); + expect(gqlFetchSpy).toHaveBeenCalled(); + }); + }); }); diff --git a/packages/sdk/typescript/subgraph/package.json b/packages/sdk/typescript/subgraph/package.json index 422205b212..74cd95278b 100644 --- a/packages/sdk/typescript/subgraph/package.json +++ b/packages/sdk/typescript/subgraph/package.json @@ -14,7 +14,7 @@ "generate-staking": "mustache ./config/$NETWORK.json src/mapping/StakingTemplate.ts > src/mapping/Staking.ts", "codegen": "graph codegen", "build": "graph build", - "test": "graph test", + "test": "NETWORK=polygon yarn generate && graph test", "create-local": "graph create --node http://localhost:8020/ humanprotocol/localhost", "remove-local": "graph remove --node http://localhost:8020/ humanprotocol/localhost", "deploy-local": "graph deploy --node http://localhost:8020/ --ipfs http://localhost:5010 humanprotocol/localhost -l 0", diff --git a/packages/sdk/typescript/subgraph/schema.graphql b/packages/sdk/typescript/subgraph/schema.graphql index 324545b34c..73365d9e50 100644 --- a/packages/sdk/typescript/subgraph/schema.graphql +++ b/packages/sdk/typescript/subgraph/schema.graphql @@ -224,6 +224,16 @@ type WithdrawEvent @entity(immutable: true) { amount: BigInt! } +type CancellationRefundEvent @entity(immutable: true) { + id: Bytes! + block: BigInt! + timestamp: BigInt! + txHash: Bytes! + escrowAddress: Bytes! + receiver: Bytes! + amount: BigInt! +} + # KVStore type KVStoreSetEvent @entity(immutable: true) { id: Bytes! @@ -309,6 +319,7 @@ type EscrowStatistics @entity { storeResultsEventCount: BigInt! bulkPayoutEventCount: BigInt! pendingStatusEventCount: BigInt! + toCancelStatusEventCount: BigInt! cancelledStatusEventCount: BigInt! partialStatusEventCount: BigInt! paidStatusEventCount: BigInt! @@ -324,6 +335,7 @@ type EventDayData @entity { dailyStoreResultsEventCount: BigInt! dailyBulkPayoutEventCount: BigInt! dailyPendingStatusEventCount: BigInt! + dailyToCancelStatusEventCount: BigInt! dailyCancelledStatusEventCount: BigInt! dailyPartialStatusEventCount: BigInt! dailyPaidStatusEventCount: BigInt! diff --git a/packages/sdk/typescript/subgraph/src/mapping/EscrowTemplate.ts b/packages/sdk/typescript/subgraph/src/mapping/EscrowTemplate.ts index 3c0a66f0b7..0c8778e4b9 100644 --- a/packages/sdk/typescript/subgraph/src/mapping/EscrowTemplate.ts +++ b/packages/sdk/typescript/subgraph/src/mapping/EscrowTemplate.ts @@ -9,9 +9,12 @@ import { Fund, PendingV2, Withdraw, + CancellationRequested, + CancellationRefund, } from '../../generated/templates/Escrow/Escrow'; import { BulkPayoutEvent, + CancellationRefundEvent, Escrow, EscrowStatistics, EscrowStatusEvent, @@ -49,6 +52,7 @@ function constructStatsEntity(): EscrowStatistics { entity.storeResultsEventCount = ZERO_BI; entity.bulkPayoutEventCount = ZERO_BI; entity.pendingStatusEventCount = ZERO_BI; + entity.toCancelStatusEventCount = ZERO_BI; entity.cancelledStatusEventCount = ZERO_BI; entity.partialStatusEventCount = ZERO_BI; entity.paidStatusEventCount = ZERO_BI; @@ -562,63 +566,6 @@ export function handleBulkTransferV2(event: BulkTransferV2): void { } } -export function handleCancelled(event: Cancelled): void { - // Create EscrowStatusEvent entity - const eventEntity = new EscrowStatusEvent(toEventId(event)); - eventEntity.block = event.block.number; - eventEntity.timestamp = event.block.timestamp; - eventEntity.txHash = event.transaction.hash; - eventEntity.escrowAddress = event.address; - eventEntity.sender = event.transaction.from; - eventEntity.status = 'Cancelled'; - - // Update statistics - const statsEntity = createOrLoadEscrowStatistics(); - statsEntity.cancelledStatusEventCount = - statsEntity.cancelledStatusEventCount.plus(ONE_BI); - statsEntity.totalEventCount = statsEntity.totalEventCount.plus(ONE_BI); - statsEntity.save(); - - // Update event day data - const eventDayData = getEventDayData(event); - eventDayData.dailyCancelledStatusEventCount = - eventDayData.dailyCancelledStatusEventCount.plus(ONE_BI); - eventDayData.dailyTotalEventCount = - eventDayData.dailyTotalEventCount.plus(ONE_BI); - eventDayData.save(); - - // Update escrow entity - const escrowEntity = Escrow.load(dataSource.address()); - - if (escrowEntity) { - const transaction = createTransaction( - event, - 'cancel', - event.transaction.from, - Address.fromBytes(escrowEntity.address), - null, - Address.fromBytes(escrowEntity.address) - ); - if (Address.fromBytes(escrowEntity.token) != HMT_ADDRESS) { - // If escrow is funded with HMT, balance is already tracked by HMT transfer - const internalTransaction = new InternalTransaction(toEventId(event)); - internalTransaction.from = escrowEntity.address; - internalTransaction.to = Address.fromBytes(escrowEntity.token); - internalTransaction.receiver = escrowEntity.canceler; - internalTransaction.value = escrowEntity.balance; - internalTransaction.transaction = transaction.id; - internalTransaction.method = 'transfer'; - internalTransaction.token = Address.fromBytes(escrowEntity.token); - internalTransaction.save(); - escrowEntity.balance = ZERO_BI; - } - escrowEntity.status = 'Cancelled'; - escrowEntity.save(); - eventEntity.launcher = escrowEntity.launcher; - } - eventEntity.save(); -} - export function handleCompleted(event: Completed): void { // Create EscrowStatusEvent entity const eventEntity = new EscrowStatusEvent(toEventId(event)); @@ -722,7 +669,7 @@ export function handleWithdraw(event: Withdraw): void { event.params._token ); - // Crear entidad WithdrawEvent similar a FundEvent + // Create WithdrawEvent entity const withdrawEventEntity = new WithdrawEvent(toEventId(event)); withdrawEventEntity.block = event.block.number; withdrawEventEntity.timestamp = event.block.timestamp; @@ -734,3 +681,123 @@ export function handleWithdraw(event: Withdraw): void { withdrawEventEntity.token = event.params._token; withdrawEventEntity.save(); } + +export function handleCancellationRequested( + event: CancellationRequested +): void { + // Create EscrowStatus entity + const statusEventEntity = new EscrowStatusEvent(toEventId(event)); + statusEventEntity.block = event.block.number; + statusEventEntity.timestamp = event.block.timestamp; + statusEventEntity.txHash = event.transaction.hash; + statusEventEntity.escrowAddress = event.address; + statusEventEntity.sender = event.transaction.from; + statusEventEntity.status = 'ToCancel'; + statusEventEntity.save(); + + // Update global statistics + const statsEntity = createOrLoadEscrowStatistics(); + statsEntity.toCancelStatusEventCount = + statsEntity.toCancelStatusEventCount.plus(ONE_BI); + statsEntity.totalEventCount = statsEntity.totalEventCount.plus(ONE_BI); + statsEntity.save(); + + // Update event day statistics + const eventDayData = getEventDayData(event); + eventDayData.dailyToCancelStatusEventCount = + eventDayData.dailyToCancelStatusEventCount.plus(ONE_BI); + eventDayData.dailyTotalEventCount = + eventDayData.dailyTotalEventCount.plus(ONE_BI); + eventDayData.save(); + + //Update escrow entity + const escrowEntity = Escrow.load(dataSource.address()); + if (escrowEntity) { + createTransaction( + event, + 'cancel', + event.transaction.from, + Address.fromBytes(escrowEntity.address), + null, + Address.fromBytes(escrowEntity.address) + ); + escrowEntity.status = 'ToCancel'; + escrowEntity.save(); + statusEventEntity.launcher = escrowEntity.launcher; + statusEventEntity.save(); + } +} + +export function handleCancellationRefund(event: CancellationRefund): void { + const escrowEntity = Escrow.load(dataSource.address()); + if (!escrowEntity) return; + + const transaction = createTransaction( + event, + 'cancellationRefund', + event.transaction.from, + Address.fromBytes(escrowEntity.address), + Address.fromBytes(escrowEntity.launcher), + Address.fromBytes(escrowEntity.address), + event.params.amount, + Address.fromBytes(escrowEntity.token) + ); + if (Address.fromBytes(escrowEntity.token) != HMT_ADDRESS) { + // If escrow is funded with HMT, balance is already tracked by HMT transfer + const internalTransaction = new InternalTransaction(toEventId(event)); + internalTransaction.from = escrowEntity.address; + internalTransaction.to = Address.fromBytes(escrowEntity.token); + internalTransaction.receiver = escrowEntity.canceler; + internalTransaction.value = escrowEntity.balance; + internalTransaction.transaction = transaction.id; + internalTransaction.method = 'transfer'; + internalTransaction.token = Address.fromBytes(escrowEntity.token); + internalTransaction.save(); + escrowEntity.balance = ZERO_BI; + } + + const entity = new CancellationRefundEvent(toEventId(event)); + entity.block = event.block.number; + entity.timestamp = event.block.timestamp; + entity.txHash = event.transaction.hash; + entity.escrowAddress = event.address; + entity.receiver = escrowEntity.launcher; + entity.amount = event.params.amount; + entity.save(); +} + +export function handleCancelled(event: Cancelled): void { + // Create EscrowStatusEvent entity + const eventEntity = new EscrowStatusEvent(toEventId(event)); + eventEntity.block = event.block.number; + eventEntity.timestamp = event.block.timestamp; + eventEntity.txHash = event.transaction.hash; + eventEntity.escrowAddress = event.address; + eventEntity.sender = event.transaction.from; + eventEntity.status = 'Cancelled'; + + // Update statistics + const statsEntity = createOrLoadEscrowStatistics(); + statsEntity.cancelledStatusEventCount = + statsEntity.cancelledStatusEventCount.plus(ONE_BI); + statsEntity.totalEventCount = statsEntity.totalEventCount.plus(ONE_BI); + statsEntity.save(); + + // Update event day data + const eventDayData = getEventDayData(event); + eventDayData.dailyCancelledStatusEventCount = + eventDayData.dailyCancelledStatusEventCount.plus(ONE_BI); + eventDayData.dailyTotalEventCount = + eventDayData.dailyTotalEventCount.plus(ONE_BI); + eventDayData.save(); + + // Update escrow entity + const escrowEntity = Escrow.load(dataSource.address()); + + if (escrowEntity) { + escrowEntity.status = 'Cancelled'; + escrowEntity.save(); + eventEntity.launcher = escrowEntity.launcher; + } + eventEntity.save(); +} diff --git a/packages/sdk/typescript/subgraph/src/mapping/utils/dayUpdates.ts b/packages/sdk/typescript/subgraph/src/mapping/utils/dayUpdates.ts index 15be03ae4b..c750141035 100644 --- a/packages/sdk/typescript/subgraph/src/mapping/utils/dayUpdates.ts +++ b/packages/sdk/typescript/subgraph/src/mapping/utils/dayUpdates.ts @@ -17,6 +17,7 @@ export function getEventDayData(event: ethereum.Event): EventDayData { eventDayData.dailyStoreResultsEventCount = ZERO_BI; eventDayData.dailyBulkPayoutEventCount = ZERO_BI; eventDayData.dailyPendingStatusEventCount = ZERO_BI; + eventDayData.dailyToCancelStatusEventCount = ZERO_BI; eventDayData.dailyCancelledStatusEventCount = ZERO_BI; eventDayData.dailyPartialStatusEventCount = ZERO_BI; eventDayData.dailyPaidStatusEventCount = ZERO_BI; diff --git a/packages/sdk/typescript/subgraph/template.yaml b/packages/sdk/typescript/subgraph/template.yaml index 041f01f46b..3b52c3f039 100644 --- a/packages/sdk/typescript/subgraph/template.yaml +++ b/packages/sdk/typescript/subgraph/template.yaml @@ -198,6 +198,10 @@ templates: handler: handleBulkTransfer - event: BulkTransferV2(indexed uint256,address[],uint256[],bool,string) handler: handleBulkTransfer + - event: CancellationRequested() + handler: handleCancellationRequested + - event: CancellationRefund(uint256) + handler: handleCancellationRefund - event: Cancelled() handler: handleCancelled - event: Completed() diff --git a/packages/sdk/typescript/subgraph/tests/escrow/escrow.test.ts b/packages/sdk/typescript/subgraph/tests/escrow/escrow.test.ts index 52ffc384eb..60e2f8829b 100644 --- a/packages/sdk/typescript/subgraph/tests/escrow/escrow.test.ts +++ b/packages/sdk/typescript/subgraph/tests/escrow/escrow.test.ts @@ -6,40 +6,43 @@ import { } from '@graphprotocol/graph-ts'; import { afterAll, - beforeAll, - describe, - test, assert, - clearStore, - dataSourceMock, + beforeAll, beforeEach, + clearStore, createMockedFunction, + dataSourceMock, + describe, + test, } from 'matchstick-as/assembly'; - import { Escrow } from '../../generated/schema'; import { STATISTICS_ENTITY_ID, - handleIntermediateStorage, - handlePending, handleBulkTransfer, + handleBulkTransferV2, + handleCancellationRefund, + handleCancellationRequested, handleCancelled, handleCompleted, handleFund, + handleIntermediateStorage, + handlePending, handlePendingV2, - handleBulkTransferV2, handleWithdraw, } from '../../src/mapping/Escrow'; import { toEventId } from '../../src/mapping/utils/event'; import { ZERO_BI } from '../../src/mapping/utils/number'; import { - createISEvent, - createPendingEvent, createBulkTransferEvent, + createBulkTransferV2Event, + createCancellationRefundEvent, + createCancellationRequestedEvent, createCancelledEvent, createCompletedEvent, createFundEvent, + createISEvent, + createPendingEvent, createPendingV2Event, - createBulkTransferV2Event, createWithdrawEvent, } from './fixtures'; @@ -121,7 +124,12 @@ describe('Escrow', () => { 'exchangeOracle():(address)' ).reverts(); - const newPending1 = createPendingEvent(operatorAddress, URL, HASH); + const newPending1 = createPendingEvent( + operatorAddress, + URL, + HASH, + BigInt.fromI32(1) + ); handlePending(newPending1); @@ -251,7 +259,12 @@ describe('Escrow', () => { 'exchangeOracle():(address)' ).reverts(); - const newPending1 = createPendingEvent(operatorAddress, URL, HASH); + const newPending1 = createPendingEvent( + operatorAddress, + URL, + HASH, + BigInt.fromI32(2) + ); handlePending(newPending1); @@ -398,7 +411,12 @@ describe('Escrow', () => { 'exchangeOracle():(address)' ).returns([ethereum.Value.fromAddress(exchangeOracleAddress)]); - const newPending1 = createPendingEvent(operatorAddress, URL, HASH); + const newPending1 = createPendingEvent( + operatorAddress, + URL, + HASH, + BigInt.fromI32(3) + ); handlePending(newPending1); @@ -547,7 +565,7 @@ describe('Escrow', () => { }); test('Should properly handle Fund event', () => { - const fund = createFundEvent(operatorAddress, 100, BigInt.fromI32(10)); + const fund = createFundEvent(operatorAddress, 100, BigInt.fromI32(4)); handleFund(fund); @@ -606,7 +624,8 @@ describe('Escrow', () => { HASH, reputationOracleAddress, recordingOracleAddress, - exchangeOracleAddress + exchangeOracleAddress, + BigInt.fromI32(5) ); handlePendingV2(newPending1); @@ -753,7 +772,12 @@ describe('Escrow', () => { test('should properly handle IntermediateStorage event', () => { const URL = 'test.com'; - const newIS = createISEvent(workerAddress, URL, 'is_hash_1'); + const newIS = createISEvent( + workerAddress, + URL, + 'is_hash_1', + BigInt.fromI32(6) + ); handleIntermediateStorage(newIS); const id = toEventId(newIS).toHex(); @@ -825,7 +849,7 @@ describe('Escrow', () => { [workerAddress, workerAddress], [1, 1], true, - BigInt.fromI32(10) + BigInt.fromI32(7) ); handleBulkTransfer(bulk1); @@ -910,7 +934,7 @@ describe('Escrow', () => { [workerAddress, workerAddress, workerAddress, worker2Address], [1, 1, 1, 95], false, - BigInt.fromI32(11) + BigInt.fromI32(8) ); handleBulkTransfer(bulk2); @@ -1034,7 +1058,7 @@ describe('Escrow', () => { [1, 1], true, 'test.com', - BigInt.fromI32(10) + BigInt.fromI32(8) ); handleBulkTransferV2(bulk1); @@ -1121,7 +1145,7 @@ describe('Escrow', () => { [1, 1, 1, 95], false, 'test.com', - BigInt.fromI32(11) + BigInt.fromI32(9) ); handleBulkTransferV2(bulk2); @@ -1237,31 +1261,34 @@ describe('Escrow', () => { ); }); - test('Should properly handle Cancelled event', () => { - const newCancelled = createCancelledEvent(operatorAddress); + test('Should properly handle CancellationRequested event', () => { + const cancellationRequested = createCancellationRequestedEvent( + operatorAddress, + BigInt.fromI32(10) + ); - handleCancelled(newCancelled); + handleCancellationRequested(cancellationRequested); - const id = toEventId(newCancelled).toHex(); + const id = toEventId(cancellationRequested).toHex(); // EscrowStatusEvent assert.fieldEquals( 'EscrowStatusEvent', id, 'block', - newCancelled.block.number.toString() + cancellationRequested.block.number.toString() ); assert.fieldEquals( 'EscrowStatusEvent', id, 'timestamp', - newCancelled.block.timestamp.toString() + cancellationRequested.block.timestamp.toString() ); assert.fieldEquals( 'EscrowStatusEvent', id, 'txHash', - newCancelled.transaction.hash.toHex() + cancellationRequested.transaction.hash.toHex() ); assert.fieldEquals( 'EscrowStatusEvent', @@ -1275,50 +1302,156 @@ describe('Escrow', () => { 'sender', operatorAddressString ); - assert.fieldEquals('EscrowStatusEvent', id, 'status', 'Cancelled'); - assert.fieldEquals( - 'EscrowStatusEvent', - id, - 'launcher', - launcherAddressString - ); + assert.fieldEquals('EscrowStatusEvent', id, 'status', 'ToCancel'); // Escrow - assert.fieldEquals('Escrow', escrowAddress.toHex(), 'status', 'Cancelled'); + assert.fieldEquals('Escrow', escrowAddress.toHex(), 'status', 'ToCancel'); assert.fieldEquals( 'Transaction', - newCancelled.transaction.hash.toHex(), + cancellationRequested.transaction.hash.toHex(), 'txHash', - newCancelled.transaction.hash.toHex() + cancellationRequested.transaction.hash.toHex() ); assert.fieldEquals( 'Transaction', - newCancelled.transaction.hash.toHex(), + cancellationRequested.transaction.hash.toHex(), 'method', 'cancel' ); assert.fieldEquals( 'Transaction', - newCancelled.transaction.hash.toHex(), + cancellationRequested.transaction.hash.toHex(), 'block', - newCancelled.block.number.toString() + cancellationRequested.block.number.toString() ); assert.fieldEquals( 'Transaction', - newCancelled.transaction.hash.toHex(), + cancellationRequested.transaction.hash.toHex(), 'from', - newCancelled.transaction.from.toHex() + cancellationRequested.transaction.from.toHex() ); assert.fieldEquals( 'Transaction', - newCancelled.transaction.hash.toHex(), + cancellationRequested.transaction.hash.toHex(), 'to', escrowAddressString ); }); + test('Should properly handle CancellationRefund event', () => { + const amount = 1000; + + const cancellationRefund = createCancellationRefundEvent( + escrowAddress, + operatorAddress, + amount, + BigInt.fromI32(11) + ); + handleCancellationRefund(cancellationRefund); + + // CancellationRefundEvent + const id = toEventId(cancellationRefund).toHex(); + assert.fieldEquals( + 'CancellationRefundEvent', + id, + 'escrowAddress', + escrowAddress.toHex() + ); + assert.fieldEquals( + 'CancellationRefundEvent', + id, + 'receiver', + launcherAddress.toHex() + ); + assert.fieldEquals( + 'CancellationRefundEvent', + id, + 'amount', + amount.toString() + ); + + // Transaction + assert.fieldEquals( + 'Transaction', + cancellationRefund.transaction.hash.toHex(), + 'method', + 'cancellationRefund' + ); + assert.fieldEquals( + 'Transaction', + cancellationRefund.transaction.hash.toHex(), + 'to', + escrowAddress.toHex() + ); + assert.fieldEquals( + 'Transaction', + cancellationRefund.transaction.hash.toHex(), + 'receiver', + launcherAddress.toHex() + ); + assert.fieldEquals( + 'Transaction', + cancellationRefund.transaction.hash.toHex(), + 'value', + amount.toString() + ); + }); + + test('Should properly handle Cancelled event', () => { + const newCancelled = createCancelledEvent(operatorAddress); + + handleCancelled(newCancelled); + + const id = toEventId(newCancelled).toHex(); + + // EscrowStatusEvent + assert.fieldEquals( + 'EscrowStatusEvent', + id, + 'block', + newCancelled.block.number.toString() + ); + assert.fieldEquals( + 'EscrowStatusEvent', + id, + 'timestamp', + newCancelled.block.timestamp.toString() + ); + assert.fieldEquals( + 'EscrowStatusEvent', + id, + 'txHash', + newCancelled.transaction.hash.toHex() + ); + assert.fieldEquals( + 'EscrowStatusEvent', + id, + 'escrowAddress', + escrowAddressString + ); + assert.fieldEquals( + 'EscrowStatusEvent', + id, + 'sender', + operatorAddressString + ); + assert.fieldEquals('EscrowStatusEvent', id, 'status', 'Cancelled'); + assert.fieldEquals( + 'EscrowStatusEvent', + id, + 'launcher', + launcherAddressString + ); + + // Escrow + assert.fieldEquals('Escrow', escrowAddress.toHex(), 'status', 'Cancelled'); + }); + test('Should properly handle Completed event', () => { - const newCompleted = createCompletedEvent(operatorAddress); + const newCompleted = createCompletedEvent( + operatorAddress, + BigInt.fromI32(12) + ); handleCompleted(newCompleted); @@ -1402,7 +1535,7 @@ describe('Escrow', () => { operatorAddress, tokenAddress, 100, - BigInt.fromI32(10) + BigInt.fromI32(13) ); handleWithdraw(withdraw); @@ -1483,7 +1616,8 @@ describe('Escrow', () => { 'is_hash_1', reputationOracleAddress, recordingOracleAddress, - exchangeOracleAddress + exchangeOracleAddress, + BigInt.fromI32(1) ); const newPending2 = createPendingV2Event( operatorAddress, @@ -1491,7 +1625,8 @@ describe('Escrow', () => { 'is_hash_1', reputationOracleAddress, recordingOracleAddress, - exchangeOracleAddress + exchangeOracleAddress, + BigInt.fromI32(2) ); handlePendingV2(newPending1); @@ -1508,6 +1643,7 @@ describe('Escrow', () => { 'fundEventCount', 'storeResultsEventCount', 'bulkPayoutEventCount', + 'toCancelStatusEventCount', 'cancelledStatusEventCount', 'partialStatusEventCount', 'paidStatusEventCount', @@ -1530,8 +1666,18 @@ describe('Escrow', () => { }); test('Should properly calculate StoreResults event in statistics', () => { - const newIS = createISEvent(workerAddress, 'test.com', 'is_hash_1'); - const newIS1 = createISEvent(workerAddress, 'test.com', 'is_hash_1'); + const newIS = createISEvent( + workerAddress, + 'test.com', + 'is_hash_1', + BigInt.fromI32(1) + ); + const newIS1 = createISEvent( + workerAddress, + 'test.com', + 'is_hash_1', + BigInt.fromI32(2) + ); handleIntermediateStorage(newIS); handleIntermediateStorage(newIS1); @@ -1547,6 +1693,7 @@ describe('Escrow', () => { 'fundEventCount', 'bulkPayoutEventCount', 'pendingStatusEventCount', + 'toCancelStatusEventCount', 'cancelledStatusEventCount', 'partialStatusEventCount', 'paidStatusEventCount', @@ -1583,7 +1730,7 @@ describe('Escrow', () => { [1, 1, 1, 1, 1], true, 'test.com', - BigInt.fromI32(11) + BigInt.fromI32(1) ) ); handleBulkTransferV2( @@ -1594,7 +1741,7 @@ describe('Escrow', () => { [1, 1, 1, 1], false, 'test.com', - BigInt.fromI32(11) + BigInt.fromI32(2) ) ); @@ -1621,6 +1768,7 @@ describe('Escrow', () => { 'fundEventCount', 'storeResultsEventCount', 'pendingStatusEventCount', + 'toCancelStatusEventCount', 'cancelledStatusEventCount', 'completedStatusEventCount', ].forEach((field) => { @@ -1658,6 +1806,7 @@ describe('Escrow', () => { 'fundEventCount', 'storeResultsEventCount', 'bulkPayoutEventCount', + 'toCancelStatusEventCount', 'pendingStatusEventCount', 'partialStatusEventCount', 'paidStatusEventCount', @@ -1680,8 +1829,14 @@ describe('Escrow', () => { }); test('Should properly calculate completed event in statstics', () => { - const newCompleted1 = createCompletedEvent(operatorAddress); - const newCompleted2 = createCompletedEvent(operatorAddress); + const newCompleted1 = createCompletedEvent( + operatorAddress, + BigInt.fromI32(1) + ); + const newCompleted2 = createCompletedEvent( + operatorAddress, + BigInt.fromI32(2) + ); handleCompleted(newCompleted1); handleCompleted(newCompleted2); @@ -1698,6 +1853,7 @@ describe('Escrow', () => { 'storeResultsEventCount', 'bulkPayoutEventCount', 'pendingStatusEventCount', + 'toCancelStatusEventCount', 'cancelledStatusEventCount', 'partialStatusEventCount', 'paidStatusEventCount', @@ -1756,7 +1912,7 @@ describe('Escrow', () => { escrow.save(); - const newFund1 = createFundEvent(operatorAddress, 1, BigInt.fromI32(10)); + const newFund1 = createFundEvent(operatorAddress, 1, BigInt.fromI32(1)); handleFund(newFund1); @@ -1771,6 +1927,7 @@ describe('Escrow', () => { 'storeResultsEventCount', 'bulkPayoutEventCount', 'pendingStatusEventCount', + 'toCancelStatusEventCount', 'cancelledStatusEventCount', 'partialStatusEventCount', 'paidStatusEventCount', @@ -1791,5 +1948,51 @@ describe('Escrow', () => { '1' ); }); + + test('Should properly calculate toCancel event in statistics', () => { + const newCancellationRequested1 = createCancellationRequestedEvent( + operatorAddress, + BigInt.fromI32(1) + ); + const newCancellationRequested2 = createCancellationRequestedEvent( + operatorAddress, + BigInt.fromI32(2) + ); + + handleCancellationRequested(newCancellationRequested1); + handleCancellationRequested(newCancellationRequested2); + + assert.fieldEquals( + 'EscrowStatistics', + STATISTICS_ENTITY_ID.toHex(), + 'toCancelStatusEventCount', + '2' + ); + + [ + 'fundEventCount', + 'storeResultsEventCount', + 'bulkPayoutEventCount', + 'pendingStatusEventCount', + 'partialStatusEventCount', + 'paidStatusEventCount', + 'cancelledStatusEventCount', + 'completedStatusEventCount', + ].forEach((field) => { + assert.fieldEquals( + 'EscrowStatistics', + STATISTICS_ENTITY_ID.toHex(), + field, + '0' + ); + }); + + assert.fieldEquals( + 'EscrowStatistics', + STATISTICS_ENTITY_ID.toHex(), + 'totalEventCount', + '2' + ); + }); }); }); diff --git a/packages/sdk/typescript/subgraph/tests/escrow/fixtures.ts b/packages/sdk/typescript/subgraph/tests/escrow/fixtures.ts index 7546898636..683ce319db 100644 --- a/packages/sdk/typescript/subgraph/tests/escrow/fixtures.ts +++ b/packages/sdk/typescript/subgraph/tests/escrow/fixtures.ts @@ -1,15 +1,16 @@ +import { Address, BigInt, ethereum } from '@graphprotocol/graph-ts'; import { newMockEvent } from 'matchstick-as/assembly/index'; -import { ethereum, BigInt, Address } from '@graphprotocol/graph-ts'; - import { - IntermediateStorage, - Pending, BulkTransfer, + BulkTransferV2, + CancellationRefund, + CancellationRequested, Cancelled, Completed, Fund, + IntermediateStorage, + Pending, PendingV2, - BulkTransferV2, Withdraw, } from '../../generated/templates/Escrow/Escrow'; import { generateUniqueHash } from '../../tests/utils'; @@ -17,12 +18,13 @@ import { generateUniqueHash } from '../../tests/utils'; export function createPendingEvent( sender: Address, manifest: string, - hash: string + hash: string, + timestamp: BigInt ): Pending { const newPendingEvent = changetype(newMockEvent()); newPendingEvent.transaction.hash = generateUniqueHash( sender.toString(), - newPendingEvent.transaction.nonce, + timestamp, newPendingEvent.transaction.nonce ); @@ -51,12 +53,13 @@ export function createPendingV2Event( hash: string, reputationOracleAddress: Address, recordingOracleAddress: Address, - exchangeOracleAddress: Address + exchangeOracleAddress: Address, + timestamp: BigInt ): PendingV2 { const newPendingEvent = changetype(newMockEvent()); newPendingEvent.transaction.hash = generateUniqueHash( sender.toString(), - newPendingEvent.transaction.nonce, + timestamp, newPendingEvent.transaction.nonce ); @@ -97,13 +100,14 @@ export function createPendingV2Event( export function createISEvent( sender: Address, url: string, - hash: string + hash: string, + timestamp: BigInt ): IntermediateStorage { const newIntermediateStorageEvent = changetype(newMockEvent()); newIntermediateStorageEvent.transaction.hash = generateUniqueHash( sender.toString(), - newIntermediateStorageEvent.transaction.nonce, + timestamp, newIntermediateStorageEvent.transaction.nonce ); @@ -224,11 +228,6 @@ export function createBulkTransferV2Event( export function createCancelledEvent(sender: Address): Cancelled { const newCancelledEvent = changetype(newMockEvent()); - newCancelledEvent.transaction.hash = generateUniqueHash( - sender.toString(), - newCancelledEvent.transaction.nonce, - newCancelledEvent.transaction.nonce - ); newCancelledEvent.transaction.from = sender; @@ -237,8 +236,16 @@ export function createCancelledEvent(sender: Address): Cancelled { return newCancelledEvent; } -export function createCompletedEvent(sender: Address): Completed { +export function createCompletedEvent( + sender: Address, + timestamp: BigInt +): Completed { const newCompletedEvent = changetype(newMockEvent()); + newCompletedEvent.transaction.hash = generateUniqueHash( + sender.toString(), + timestamp, + newCompletedEvent.transaction.nonce + ); newCompletedEvent.transaction.from = sender; @@ -309,3 +316,44 @@ export function createWithdrawEvent( return newWithdrawEvent; } + +export function createCancellationRequestedEvent( + sender: Address, + timestamp: BigInt +): CancellationRequested { + const event = changetype(newMockEvent()); + event.transaction.hash = generateUniqueHash( + sender.toString(), + timestamp, + event.transaction.nonce + ); + event.transaction.from = sender; + event.parameters = []; + return event; +} + +export function createCancellationRefundEvent( + escrowAddress: Address, + sender: Address, + amount: i32, + timestamp: BigInt +): CancellationRefund { + const event = changetype(newMockEvent()); + event.address = escrowAddress; + event.transaction.from = sender; + event.transaction.hash = generateUniqueHash( + sender.toString(), + timestamp, + event.transaction.nonce + ); + + event.parameters = []; + + const amountParam = new ethereum.EventParam( + '_amount', + ethereum.Value.fromI32(amount) + ); + + event.parameters.push(amountParam); + return event; +} From f668924b9edc342cc2e9627a9bb3877277203080 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Francisco=20L=C3=B3pez?= Date: Wed, 28 May 2025 12:00:23 +0200 Subject: [PATCH 12/18] Add token address retrieval and mock token decimals for fix JobService tests --- .../src/modules/job/job.service.spec.ts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/packages/apps/fortune/recording-oracle/src/modules/job/job.service.spec.ts b/packages/apps/fortune/recording-oracle/src/modules/job/job.service.spec.ts index 8baeb91adb..ddf1f75039 100644 --- a/packages/apps/fortune/recording-oracle/src/modules/job/job.service.spec.ts +++ b/packages/apps/fortune/recording-oracle/src/modules/job/job.service.spec.ts @@ -35,6 +35,7 @@ import { StorageService } from '../storage/storage.service'; import { Web3Service } from '../web3/web3.service'; import { WebhookDto } from '../webhook/webhook.dto'; import { JobService } from './job.service'; +import { HMToken__factory } from '@human-protocol/core/typechain-types'; jest.mock('minio', () => { class Client { @@ -131,6 +132,14 @@ describe('JobService', () => { }); describe('processJobSolution', () => { + beforeAll(() => { + const decimalsMock = jest.fn().mockResolvedValue(18); + const tokenContractMock = { decimals: decimalsMock }; + jest + .spyOn(HMToken__factory, 'connect') + .mockReturnValue(tokenContractMock as any); + }); + afterEach(() => { jest.clearAllMocks(); }); @@ -319,6 +328,7 @@ describe('JobService', () => { .fn() .mockResolvedValue('http://example.com/results'), storeResults: jest.fn().mockResolvedValue(true), + getTokenAddress: jest.fn().mockResolvedValue(MOCK_ADDRESS), }; (EscrowClient.build as jest.Mock).mockResolvedValue(escrowClient); @@ -375,6 +385,7 @@ describe('JobService', () => { .mockResolvedValue('http://example.com/manifest'), getIntermediateResultsUrl: jest.fn().mockResolvedValue(''), storeResults: jest.fn().mockResolvedValue(true), + getTokenAddress: jest.fn().mockResolvedValue(MOCK_ADDRESS), }; (EscrowClient.build as jest.Mock).mockResolvedValue(escrowClient); @@ -433,6 +444,7 @@ describe('JobService', () => { .fn() .mockResolvedValue('http://existing-solutions'), storeResults: jest.fn().mockResolvedValue(true), + getTokenAddress: jest.fn().mockResolvedValue(MOCK_ADDRESS), }; (EscrowClient.build as jest.Mock).mockResolvedValue(escrowClient); @@ -513,6 +525,7 @@ describe('JobService', () => { .fn() .mockResolvedValue('http://existing-solutions'), storeResults: jest.fn().mockResolvedValue(true), + getTokenAddress: jest.fn().mockResolvedValue(MOCK_ADDRESS), }; (EscrowClient.build as jest.Mock).mockResolvedValue(escrowClient); @@ -605,6 +618,7 @@ describe('JobService', () => { .fn() .mockResolvedValue('http://existing-solutions'), storeResults: jest.fn().mockResolvedValue(true), + getTokenAddress: jest.fn().mockResolvedValue(MOCK_ADDRESS), }; (EscrowClient.build as jest.Mock).mockResolvedValue(escrowClient); KVStoreUtils.get = jest @@ -689,6 +703,7 @@ describe('JobService', () => { .fn() .mockResolvedValue('http://existing-solutions'), storeResults: jest.fn().mockResolvedValue(true), + getTokenAddress: jest.fn().mockResolvedValue(MOCK_ADDRESS), }; (EscrowClient.build as jest.Mock).mockResolvedValue(escrowClient); KVStoreUtils.get = jest From ee743edf9da414dab142ba299a20aa9361de1837 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Francisco=20L=C3=B3pez?= Date: Tue, 10 Jun 2025 17:44:25 +0200 Subject: [PATCH 13/18] add direct cancellation when remaining balance is 0 and fixed some bugs --- .../server/src/common/enums/webhook.ts | 1 + .../modules/webhook/webhook.service.spec.ts | 4 +- .../src/modules/webhook/webhook.service.ts | 5 +- .../src/common/enums/webhook.ts | 2 +- .../src/modules/webhook/webhook.service.ts | 2 +- .../server/src/common/enums/webhook.ts | 1 + ...3713555-addCancellationRequestEventType.ts | 76 +++++++++ .../src/modules/cron-job/cron-job.service.ts | 4 +- .../src/modules/job/job.service.spec.ts | 155 ++++++++++++++++-- .../server/src/modules/job/job.service.ts | 4 +- .../escrow-completion.service.ts | 3 + packages/core/contracts/Escrow.sol | 10 +- packages/core/test/Escrow-USDT.ts | 56 +++++++ packages/core/test/Escrow.ts | 56 +++++++ .../escrow/escrow_client.py | 12 +- .../human-protocol-sdk/src/escrow.ts | 24 +-- .../subgraph/src/mapping/EscrowTemplate.ts | 8 + 17 files changed, 382 insertions(+), 41 deletions(-) create mode 100644 packages/apps/job-launcher/server/src/database/migrations/1749483713555-addCancellationRequestEventType.ts diff --git a/packages/apps/fortune/exchange-oracle/server/src/common/enums/webhook.ts b/packages/apps/fortune/exchange-oracle/server/src/common/enums/webhook.ts index b87d0e0475..b14cfef3bb 100644 --- a/packages/apps/fortune/exchange-oracle/server/src/common/enums/webhook.ts +++ b/packages/apps/fortune/exchange-oracle/server/src/common/enums/webhook.ts @@ -7,6 +7,7 @@ export enum EventType { SUBMISSION_IN_REVIEW = 'submission_in_review', ABUSE_DETECTED = 'abuse_detected', ABUSE_DISMISSED = 'abuse_dismissed', + CANCELLATION_REQUESTED = 'cancellation_requested', } export enum WebhookStatus { diff --git a/packages/apps/fortune/exchange-oracle/server/src/modules/webhook/webhook.service.spec.ts b/packages/apps/fortune/exchange-oracle/server/src/modules/webhook/webhook.service.spec.ts index f049f1e76d..7aac1226a0 100644 --- a/packages/apps/fortune/exchange-oracle/server/src/modules/webhook/webhook.service.spec.ts +++ b/packages/apps/fortune/exchange-oracle/server/src/modules/webhook/webhook.service.spec.ts @@ -142,12 +142,12 @@ describe('WebhookService', () => { expect(jobService.createJob).toHaveBeenCalledWith(webhook); }); - it('should handle an incoming escrow canceled webhook', async () => { + it('should handle an incoming cancellation request webhook', async () => { jest.spyOn(jobService, 'cancelJob').mockResolvedValue(); const webhook: WebhookDto = { chainId, escrowAddress, - eventType: EventType.ESCROW_CANCELED, + eventType: EventType.CANCELLATION_REQUESTED, }; expect(await webhookService.handleWebhook(webhook)).toBe(undefined); expect(jobService.cancelJob).toHaveBeenCalledWith(webhook); diff --git a/packages/apps/fortune/exchange-oracle/server/src/modules/webhook/webhook.service.ts b/packages/apps/fortune/exchange-oracle/server/src/modules/webhook/webhook.service.ts index 32fa800d0c..14de2d1e00 100644 --- a/packages/apps/fortune/exchange-oracle/server/src/modules/webhook/webhook.service.ts +++ b/packages/apps/fortune/exchange-oracle/server/src/modules/webhook/webhook.service.ts @@ -43,7 +43,7 @@ export class WebhookService { await this.jobService.completeJob(webhook); break; - case EventType.ESCROW_CANCELED: + case EventType.CANCELLATION_REQUESTED: await this.jobService.cancelJob(webhook); break; @@ -59,6 +59,9 @@ export class WebhookService { await this.jobService.resumeJob(webhook); break; + case EventType.ESCROW_CANCELED: + return; + default: throw new ValidationError( `Invalid webhook event type: ${webhook.eventType}`, diff --git a/packages/apps/fortune/recording-oracle/src/common/enums/webhook.ts b/packages/apps/fortune/recording-oracle/src/common/enums/webhook.ts index ef86d019fe..fe660431da 100644 --- a/packages/apps/fortune/recording-oracle/src/common/enums/webhook.ts +++ b/packages/apps/fortune/recording-oracle/src/common/enums/webhook.ts @@ -1,6 +1,6 @@ export enum EventType { ESCROW_COMPLETED = 'escrow_completed', - ESCROW_CANCELED = 'escrow_canceled', + CANCELLATION_REQUESTED = 'cancellation_requested', JOB_COMPLETED = 'job_completed', JOB_CANCELED = 'job_canceled', SUBMISSION_REJECTED = 'submission_rejected', diff --git a/packages/apps/fortune/recording-oracle/src/modules/webhook/webhook.service.ts b/packages/apps/fortune/recording-oracle/src/modules/webhook/webhook.service.ts index 1be8c3f2b8..488639a806 100644 --- a/packages/apps/fortune/recording-oracle/src/modules/webhook/webhook.service.ts +++ b/packages/apps/fortune/recording-oracle/src/modules/webhook/webhook.service.ts @@ -18,7 +18,7 @@ export class WebhookService { await this.jobService.processJobSolution(wehbook); break; - case EventType.ESCROW_CANCELED: + case EventType.CANCELLATION_REQUESTED: await this.jobService.cancelJob(wehbook); break; diff --git a/packages/apps/job-launcher/server/src/common/enums/webhook.ts b/packages/apps/job-launcher/server/src/common/enums/webhook.ts index df966a7dff..10313b8830 100644 --- a/packages/apps/job-launcher/server/src/common/enums/webhook.ts +++ b/packages/apps/job-launcher/server/src/common/enums/webhook.ts @@ -4,6 +4,7 @@ export enum EventType { ESCROW_COMPLETED = 'escrow_completed', ESCROW_FAILED = 'escrow_failed', ABUSE_DETECTED = 'abuse_detected', + CANCELLATION_REQUESTED = 'cancellation_requested', } export enum OracleType { diff --git a/packages/apps/job-launcher/server/src/database/migrations/1749483713555-addCancellationRequestEventType.ts b/packages/apps/job-launcher/server/src/database/migrations/1749483713555-addCancellationRequestEventType.ts new file mode 100644 index 0000000000..3084a4f68e --- /dev/null +++ b/packages/apps/job-launcher/server/src/database/migrations/1749483713555-addCancellationRequestEventType.ts @@ -0,0 +1,76 @@ +import { MigrationInterface, QueryRunner } from 'typeorm'; + +export class AddCancellationRequestEventType1749483713555 + implements MigrationInterface +{ + name = 'AddCancellationRequestEventType1749483713555'; + + public async up(queryRunner: QueryRunner): Promise { + await queryRunner.query(` + DROP INDEX "hmt"."IDX_e834f9a1d4dc20775e2cb2319e" + `); + await queryRunner.query(` + ALTER TYPE "hmt"."webhook_event_type_enum" + RENAME TO "webhook_event_type_enum_old" + `); + await queryRunner.query(` + CREATE TYPE "hmt"."webhook_event_type_enum" AS ENUM( + 'escrow_created', + 'escrow_canceled', + 'escrow_completed', + 'escrow_failed', + 'abuse_detected', + 'cancellation_requested' + ) + `); + await queryRunner.query(` + ALTER TABLE "hmt"."webhook" + ALTER COLUMN "event_type" TYPE "hmt"."webhook_event_type_enum" USING "event_type"::"text"::"hmt"."webhook_event_type_enum" + `); + await queryRunner.query(` + DROP TYPE "hmt"."webhook_event_type_enum_old" + `); + await queryRunner.query(` + CREATE UNIQUE INDEX "IDX_e834f9a1d4dc20775e2cb2319e" ON "hmt"."webhook" ( + "chain_id", + "escrow_address", + "event_type", + "oracle_address" + ) + `); + } + + public async down(queryRunner: QueryRunner): Promise { + await queryRunner.query(` + DROP INDEX "hmt"."IDX_e834f9a1d4dc20775e2cb2319e" + `); + await queryRunner.query(` + CREATE TYPE "hmt"."webhook_event_type_enum_old" AS ENUM( + 'abuse_detected', + 'escrow_canceled', + 'escrow_completed', + 'escrow_created', + 'escrow_failed' + ) + `); + await queryRunner.query(` + ALTER TABLE "hmt"."webhook" + ALTER COLUMN "event_type" TYPE "hmt"."webhook_event_type_enum_old" USING "event_type"::"text"::"hmt"."webhook_event_type_enum_old" + `); + await queryRunner.query(` + DROP TYPE "hmt"."webhook_event_type_enum" + `); + await queryRunner.query(` + ALTER TYPE "hmt"."webhook_event_type_enum_old" + RENAME TO "webhook_event_type_enum" + `); + await queryRunner.query(` + CREATE UNIQUE INDEX "IDX_e834f9a1d4dc20775e2cb2319e" ON "hmt"."webhook" ( + "chain_id", + "escrow_address", + "event_type", + "oracle_address" + ) + `); + } +} diff --git a/packages/apps/job-launcher/server/src/modules/cron-job/cron-job.service.ts b/packages/apps/job-launcher/server/src/modules/cron-job/cron-job.service.ts index e77900b3bd..ea5d94d47e 100644 --- a/packages/apps/job-launcher/server/src/modules/cron-job/cron-job.service.ts +++ b/packages/apps/job-launcher/server/src/modules/cron-job/cron-job.service.ts @@ -290,7 +290,7 @@ export class CronJobService { const baseWebhook = { escrowAddress: jobEntity.escrowAddress, chainId: jobEntity.chainId, - eventType: EventType.ESCROW_CANCELED, + eventType: EventType.CANCELLATION_REQUESTED, oracleType, hasSignature: true, }; @@ -346,7 +346,7 @@ export class CronJobService { try { const webhookEntities = await this.webhookRepository.findByStatusAndType( WebhookStatus.PENDING, - [EventType.ESCROW_CREATED, EventType.ESCROW_CANCELED], + [EventType.ESCROW_CREATED, EventType.CANCELLATION_REQUESTED], ); for (const webhookEntity of webhookEntities) { diff --git a/packages/apps/job-launcher/server/src/modules/job/job.service.spec.ts b/packages/apps/job-launcher/server/src/modules/job/job.service.spec.ts index e1ad3c4e17..b54d149ef6 100644 --- a/packages/apps/job-launcher/server/src/modules/job/job.service.spec.ts +++ b/packages/apps/job-launcher/server/src/modules/job/job.service.spec.ts @@ -6,6 +6,7 @@ import { createMock } from '@golevelup/ts-jest'; import { ChainId, EscrowClient, + EscrowStatus, EscrowUtils, KVStoreUtils, NETWORKS, @@ -924,6 +925,7 @@ describe('JobService', () => { chainId: jobEntity.chainId, eventType: EventType.ESCROW_CREATED, oracleType: jobEntity.requestType, + oracleAddress: jobEntity.exchangeOracle, hasSignature: true, status: WebhookStatus.PENDING, retriesCount: 0, @@ -1409,6 +1411,52 @@ describe('JobService', () => { const result = await jobService.processEscrowCancellation(jobEntity); expect(result).toHaveProperty('txHash'); }); + + it('should throw if escrow status is not Active', async () => { + const jobEntity = createJobEntity(); + mockWeb3Service.calculateGasPrice.mockResolvedValueOnce(1n); + mockedEscrowClient.build.mockResolvedValue({ + getStatus: jest.fn().mockResolvedValue(EscrowStatus.Complete), + getBalance: jest.fn().mockResolvedValue(100n), + cancel: jest.fn(), + } as unknown as EscrowClient); + + await expect( + jobService.processEscrowCancellation(jobEntity), + ).rejects.toThrow( + new ConflictError(ErrorEscrow.InvalidStatusCancellation), + ); + }); + + it('should throw if escrow balance is zero', async () => { + const jobEntity = createJobEntity(); + mockWeb3Service.calculateGasPrice.mockResolvedValueOnce(1n); + mockedEscrowClient.build.mockResolvedValue({ + getStatus: jest.fn().mockResolvedValue(EscrowStatus.Pending), + getBalance: jest.fn().mockResolvedValue(0n), + cancel: jest.fn(), + } as unknown as EscrowClient); + + await expect( + jobService.processEscrowCancellation(jobEntity), + ).rejects.toThrow( + new ConflictError(ErrorEscrow.InvalidBalanceCancellation), + ); + }); + + it('should throw if cancel throws an error', async () => { + const jobEntity = createJobEntity(); + mockWeb3Service.calculateGasPrice.mockResolvedValueOnce(1n); + mockedEscrowClient.build.mockResolvedValue({ + getStatus: jest.fn().mockResolvedValue(EscrowStatus.Pending), + getBalance: jest.fn().mockResolvedValue(100n), + cancel: jest.fn().mockRejectedValue(new Error('Network error')), + } as unknown as EscrowClient); + + await expect( + jobService.processEscrowCancellation(jobEntity), + ).rejects.toThrow('Network error'); + }); }); describe('escrowFailedWebhook', () => { @@ -1612,7 +1660,7 @@ describe('JobService', () => { }); }); - describe('completeJob', () => { + describe('finalizeJob', () => { it('should complete a job', async () => { const jobEntity = createJobEntity({ status: JobStatus.LAUNCHED, @@ -1621,7 +1669,7 @@ describe('JobService', () => { jobEntity, ); await expect( - jobService.completeJob({ + jobService.finalizeJob({ chainId: ChainId.POLYGON_AMOY, escrowAddress: faker.finance.ethereumAddress(), eventType: EventType.ESCROW_COMPLETED, @@ -1633,33 +1681,64 @@ describe('JobService', () => { }); }); - it('should throw an error if job not found', async () => { + it('should do nothing if job is already COMPLETED', async () => { + const jobEntity = createJobEntity({ status: JobStatus.COMPLETED }); mockJobRepository.findOneByChainIdAndEscrowAddress.mockResolvedValueOnce( - null, + jobEntity, ); await expect( - jobService.completeJob({ + jobService.finalizeJob({ chainId: ChainId.POLYGON_AMOY, escrowAddress: faker.finance.ethereumAddress(), eventType: EventType.ESCROW_COMPLETED, }), - ).rejects.toThrow(new NotFoundError(ErrorJob.NotFound)); + ).resolves.toBeUndefined(); + expect(mockJobRepository.updateOne).not.toHaveBeenCalled(); }); - it('should throw an error if job is not in LAUNCHED or PARTIAL status', async () => { - const jobEntity = createJobEntity({ - status: JobStatus.CANCELED, - }); + it('should do nothing if job is already CANCELED', async () => { + const jobEntity = createJobEntity({ status: JobStatus.CANCELED }); mockJobRepository.findOneByChainIdAndEscrowAddress.mockResolvedValueOnce( jobEntity, ); await expect( - jobService.completeJob({ + jobService.finalizeJob({ chainId: ChainId.POLYGON_AMOY, escrowAddress: faker.finance.ethereumAddress(), eventType: EventType.ESCROW_COMPLETED, }), - ).rejects.toThrow(new ValidationError(ErrorJob.InvalidStatusCompletion)); + ).resolves.toBeUndefined(); + expect(mockJobRepository.updateOne).not.toHaveBeenCalled(); + }); + + it('should call cancelJob if eventType is ESCROW_CANCELED and status is LAUNCHED', async () => { + const jobEntity = createJobEntity({ status: JobStatus.LAUNCHED }); + mockJobRepository.findOneByChainIdAndEscrowAddress.mockResolvedValueOnce( + jobEntity, + ); + const cancelJobSpy = jest + .spyOn(jobService, 'cancelJob') + .mockResolvedValueOnce(); + await jobService.finalizeJob({ + chainId: ChainId.POLYGON_AMOY, + escrowAddress: faker.finance.ethereumAddress(), + eventType: EventType.ESCROW_CANCELED, + }); + expect(cancelJobSpy).toHaveBeenCalledWith(jobEntity); + }); + + it('should throw ConflictError if eventType is not ESCROW_COMPLETED or ESCROW_CANCELED', async () => { + const jobEntity = createJobEntity({ status: JobStatus.LAUNCHED }); + mockJobRepository.findOneByChainIdAndEscrowAddress.mockResolvedValueOnce( + jobEntity, + ); + await expect( + jobService.finalizeJob({ + chainId: ChainId.POLYGON_AMOY, + escrowAddress: faker.finance.ethereumAddress(), + eventType: EventType.ESCROW_FAILED, + }), + ).rejects.toThrow(new ConflictError(ErrorJob.InvalidStatusCompletion)); }); }); @@ -1693,4 +1772,56 @@ describe('JobService', () => { expect(result).toBe(false); }); }); + + describe('cancelJob', () => { + it('should create a refund payment and set status to CANCELED', async () => { + const jobEntity = createJobEntity(); + const refundAmount = faker.number.float({ min: 1, max: 10 }); + + mockedEscrowUtils.getCancellationRefund.mockResolvedValueOnce({ + amount: ethers.parseUnits(refundAmount.toString(), 18), + escrowAddress: jobEntity.escrowAddress!, + } as any); + mockPaymentService.createRefundPayment.mockResolvedValueOnce(undefined); + mockJobRepository.updateOne.mockResolvedValueOnce(jobEntity); + + await jobService.cancelJob(jobEntity); + + expect(EscrowUtils.getCancellationRefund).toHaveBeenCalledWith( + jobEntity.chainId, + jobEntity.escrowAddress, + ); + expect(mockPaymentService.createRefundPayment).toHaveBeenCalledWith({ + refundAmount: refundAmount, + refundCurrency: jobEntity.token, + userId: jobEntity.userId, + jobId: jobEntity.id, + }); + expect(jobEntity.status).toBe(JobStatus.CANCELED); + expect(mockJobRepository.updateOne).toHaveBeenCalledWith(jobEntity); + }); + + it('should throw ConflictError if no refund is found', async () => { + const jobEntity = createJobEntity(); + mockedEscrowUtils.getCancellationRefund.mockResolvedValueOnce( + null as any, + ); + + await expect(jobService.cancelJob(jobEntity)).rejects.toThrow( + new ConflictError(ErrorJob.NoRefundFound), + ); + }); + + it('should throw ConflictError if refund.amount is empty', async () => { + const jobEntity = createJobEntity(); + mockedEscrowUtils.getCancellationRefund.mockResolvedValueOnce({ + amount: 0, + escrowAddress: jobEntity.escrowAddress!, + } as any); + + await expect(jobService.cancelJob(jobEntity)).rejects.toThrow( + new ConflictError(ErrorJob.NoRefundFound), + ); + }); + }); }); diff --git a/packages/apps/job-launcher/server/src/modules/job/job.service.ts b/packages/apps/job-launcher/server/src/modules/job/job.service.ts index aef029b3c3..67efedcd73 100644 --- a/packages/apps/job-launcher/server/src/modules/job/job.service.ts +++ b/packages/apps/job-launcher/server/src/modules/job/job.service.ts @@ -905,12 +905,10 @@ export class JobService { } public async cancelJob(jobEntity: JobEntity): Promise { - console.log('Cancelling job'); const refund = await EscrowUtils.getCancellationRefund( jobEntity.chainId, - jobEntity.escrowAddress, + jobEntity.escrowAddress!, ); - console.log(refund); if (!refund || !refund.amount) { throw new ConflictError(ErrorJob.NoRefundFound); diff --git a/packages/apps/reputation-oracle/server/src/modules/escrow-completion/escrow-completion.service.ts b/packages/apps/reputation-oracle/server/src/modules/escrow-completion/escrow-completion.service.ts index 117aa690bc..fec8bea75b 100644 --- a/packages/apps/reputation-oracle/server/src/modules/escrow-completion/escrow-completion.service.ts +++ b/packages/apps/reputation-oracle/server/src/modules/escrow-completion/escrow-completion.service.ts @@ -192,6 +192,9 @@ export class EscrowCompletionService { } escrowCompletionEntity.status = EscrowCompletionStatus.AWAITING_PAYOUTS; + if (escrowStatus === EscrowStatus.Cancelled) { + escrowCompletionEntity.status = EscrowCompletionStatus.PAID; + } await this.escrowCompletionRepository.updateOne(escrowCompletionEntity); } catch (error) { this.logger.error('Failed to process pending escrow completion', { diff --git a/packages/core/contracts/Escrow.sol b/packages/core/contracts/Escrow.sol index 111174cd0c..016efe79de 100644 --- a/packages/core/contracts/Escrow.sol +++ b/packages/core/contracts/Escrow.sol @@ -303,8 +303,10 @@ contract Escrow is IEscrow, ReentrancyGuard { status == EscrowStatuses.ToCancel, 'Escrow not in Pending, Partial or ToCancel status state' ); - require(bytes(_url).length != 0, "URL can't be empty"); - require(bytes(_hash).length != 0, "Hash can't be empty"); + if (_fundsToReserve != 0) { + require(bytes(_url).length != 0, "URL can't be empty"); + require(bytes(_hash).length != 0, "Hash can't be empty"); + } require( _fundsToReserve <= remainingFunds - reservedFunds, 'Not enough unreserved funds' @@ -322,6 +324,10 @@ contract Escrow is IEscrow, ReentrancyGuard { emit CancellationRefund(unreservedFunds); remainingFunds = reservedFunds; } + if (remainingFunds == 0) { + status = EscrowStatuses.Cancelled; + emit Cancelled(); + } } } diff --git a/packages/core/test/Escrow-USDT.ts b/packages/core/test/Escrow-USDT.ts index e2f837fe03..55c76a098c 100644 --- a/packages/core/test/Escrow-USDT.ts +++ b/packages/core/test/Escrow-USDT.ts @@ -255,6 +255,45 @@ describe('Escrow with USDT', function () { .storeResults(MOCK_URL, MOCK_HASH, fundAmount * 2n) ).to.be.revertedWith('Not enough unreserved funds'); }); + + it('Should succeed if url and hash are empty and amount is 0', async function () { + await deployEscrow(); + await fundEscrow(); + await setupEscrow(); + + await expect(escrow.connect(trustedHandlers[0]).storeResults('', '', 0)) + .not.to.be.reverted; + }); + + it('Should revert if url is empty and amount is not 0', async function () { + await deployEscrow(); + await fundEscrow(); + await setupEscrow(); + + await expect( + escrow.connect(trustedHandlers[0]).storeResults('', MOCK_HASH, 1) + ).to.be.revertedWith("URL can't be empty"); + }); + + it('Should revert if hash is empty and amount is not 0', async function () { + await deployEscrow(); + await fundEscrow(); + await setupEscrow(); + + await expect( + escrow.connect(trustedHandlers[0]).storeResults(MOCK_URL, '', 1) + ).to.be.revertedWith("Hash can't be empty"); + }); + + it('Should revert if both url and hash are empty and amount is not 0', async function () { + await deployEscrow(); + await fundEscrow(); + await setupEscrow(); + + await expect( + escrow.connect(trustedHandlers[0]).storeResults('', '', 1) + ).to.be.revertedWith("URL can't be empty"); + }); }); describe('Events', function () { @@ -343,6 +382,23 @@ describe('Escrow with USDT', function () { expect(await escrow.remainingFunds()).to.equal(fundAmount / 2n); expect(await escrow.reservedFunds()).to.equal(fundAmount / 2n); }); + + it('Should cancel the escrow if status is ToCancel, fundsToReserve is 0 and unreservedFunds is 0', async () => { + await deployEscrow(); + await fundEscrow(); + await setupEscrow(); + + await escrow.connect(owner).cancel(); + expect(await escrow.status()).to.equal(Status.ToCancel); + + const tx = await escrow + .connect(trustedHandlers[0]) + .storeResults(MOCK_URL, MOCK_HASH, 0); + + await expect(tx).to.emit(escrow, 'CancellationRefund'); + await expect(tx).to.emit(escrow, 'Cancelled'); + expect(await escrow.status()).to.equal(Status.Cancelled); + }); }); }); diff --git a/packages/core/test/Escrow.ts b/packages/core/test/Escrow.ts index 1a65033cb1..ae39e1be50 100644 --- a/packages/core/test/Escrow.ts +++ b/packages/core/test/Escrow.ts @@ -248,6 +248,45 @@ describe('Escrow', function () { .storeResults(MOCK_URL, MOCK_HASH, fundAmount * 2n) ).to.be.revertedWith('Not enough unreserved funds'); }); + + it('Should succeed if url and hash are empty and amount is 0', async function () { + await deployEscrow(); + await fundEscrow(); + await setupEscrow(); + + await expect(escrow.connect(trustedHandlers[0]).storeResults('', '', 0)) + .not.to.be.reverted; + }); + + it('Should revert if url is empty and amount is not 0', async function () { + await deployEscrow(); + await fundEscrow(); + await setupEscrow(); + + await expect( + escrow.connect(trustedHandlers[0]).storeResults('', MOCK_HASH, 1) + ).to.be.revertedWith("URL can't be empty"); + }); + + it('Should revert if hash is empty and amount is not 0', async function () { + await deployEscrow(); + await fundEscrow(); + await setupEscrow(); + + await expect( + escrow.connect(trustedHandlers[0]).storeResults(MOCK_URL, '', 1) + ).to.be.revertedWith("Hash can't be empty"); + }); + + it('Should revert if both url and hash are empty and amount is not 0', async function () { + await deployEscrow(); + await fundEscrow(); + await setupEscrow(); + + await expect( + escrow.connect(trustedHandlers[0]).storeResults('', '', 1) + ).to.be.revertedWith("URL can't be empty"); + }); }); describe('Events', function () { @@ -337,6 +376,23 @@ describe('Escrow', function () { expect(await escrow.remainingFunds()).to.equal(fundAmount / 2n); expect(await escrow.reservedFunds()).to.equal(fundAmount / 2n); }); + + it('Should cancel the escrow if status is ToCancel, fundsToReserve is 0 and unreservedFunds is 0', async () => { + await deployEscrow(); + await fundEscrow(); + await setupEscrow(); + + await escrow.connect(owner).cancel(); + expect(await escrow.status()).to.equal(Status.ToCancel); + + const tx = await escrow + .connect(trustedHandlers[0]) + .storeResults(MOCK_URL, MOCK_HASH, 0); + + await expect(tx).to.emit(escrow, 'CancellationRefund'); + await expect(tx).to.emit(escrow, 'Cancelled'); + expect(await escrow.status()).to.equal(Status.Cancelled); + }); }); }); diff --git a/packages/sdk/python/human-protocol-sdk/human_protocol_sdk/escrow/escrow_client.py b/packages/sdk/python/human-protocol-sdk/human_protocol_sdk/escrow/escrow_client.py index b180d8bc0a..6576190524 100644 --- a/packages/sdk/python/human-protocol-sdk/human_protocol_sdk/escrow/escrow_client.py +++ b/packages/sdk/python/human-protocol-sdk/human_protocol_sdk/escrow/escrow_client.py @@ -485,12 +485,14 @@ def get_w3_with_priv_key(priv_key: str): """ if not Web3.is_address(escrow_address): raise EscrowClientError(f"Invalid escrow address: {escrow_address}") - if not hash: - raise EscrowClientError("Invalid empty hash") - if not validate_url(url): - raise EscrowClientError(f"Invalid URL: {url}") - if amount <= 0: + if amount < 0: raise EscrowClientError("Amount must be positive") + if amount != 0: + if not hash: + raise EscrowClientError("Invalid empty hash") + if not validate_url(url): + raise EscrowClientError(f"Invalid URL: {url}") + if not self.w3.eth.default_account: raise EscrowClientError("You must add an account to Web3 instance") diff --git a/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts b/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts index 3a1aa2450e..a1a8e0f97f 100644 --- a/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts +++ b/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts @@ -498,22 +498,22 @@ export class EscrowClient extends BaseEthersClient { throw ErrorInvalidEscrowAddressProvided; } - if (!url) { - throw ErrorUrlIsEmptyString; - } - - if (!isValidUrl(url)) { - throw ErrorInvalidUrl; - } - - if (!hash) { - throw ErrorHashIsEmptyString; - } - if (amount < 0n) { throw ErrorAmountMustBePositive; } + if (amount !== 0n) { + if (!url) { + throw ErrorUrlIsEmptyString; + } + if (!isValidUrl(url)) { + throw ErrorInvalidUrl; + } + if (!hash) { + throw ErrorHashIsEmptyString; + } + } + if (!(await this.escrowFactoryContract.hasEscrow(escrowAddress))) { throw ErrorEscrowAddressIsNotProvidedByFactory; } diff --git a/packages/sdk/typescript/subgraph/src/mapping/EscrowTemplate.ts b/packages/sdk/typescript/subgraph/src/mapping/EscrowTemplate.ts index 0c8778e4b9..0bae1f1348 100644 --- a/packages/sdk/typescript/subgraph/src/mapping/EscrowTemplate.ts +++ b/packages/sdk/typescript/subgraph/src/mapping/EscrowTemplate.ts @@ -795,6 +795,14 @@ export function handleCancelled(event: Cancelled): void { const escrowEntity = Escrow.load(dataSource.address()); if (escrowEntity) { + createTransaction( + event, + 'cancelled', + event.transaction.from, + Address.fromBytes(escrowEntity.address), + null, + Address.fromBytes(escrowEntity.address) + ); escrowEntity.status = 'Cancelled'; escrowEntity.save(); eventEntity.launcher = escrowEntity.launcher; From 47f5da5838a126d0f0ff22cdaa7719befd2657b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Francisco=20L=C3=B3pez?= Date: Mon, 16 Jun 2025 14:32:03 +0200 Subject: [PATCH 14/18] await escrow cancellation and update condition for funds reservation --- .../apps/job-launcher/server/src/modules/job/job.service.ts | 4 ++-- packages/core/contracts/Escrow.sol | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/apps/job-launcher/server/src/modules/job/job.service.ts b/packages/apps/job-launcher/server/src/modules/job/job.service.ts index 67efedcd73..d942283a35 100644 --- a/packages/apps/job-launcher/server/src/modules/job/job.service.ts +++ b/packages/apps/job-launcher/server/src/modules/job/job.service.ts @@ -668,7 +668,7 @@ export class JobService { throw new ConflictError(ErrorEscrow.InvalidBalanceCancellation); } - return escrowClient.cancel(escrowAddress!, { + await escrowClient.cancel(escrowAddress!, { gasPrice: await this.web3Service.calculateGasPrice(chainId), }); } @@ -853,7 +853,7 @@ export class JobService { throw new NotFoundError(ErrorJob.NotFound); } - // If job status already completed or cancelled by getDetails do nothing + // If job status already completed or canceled by getDetails do nothing if ( jobEntity.status === JobStatus.COMPLETED || jobEntity.status === JobStatus.CANCELED diff --git a/packages/core/contracts/Escrow.sol b/packages/core/contracts/Escrow.sol index 016efe79de..13a2b878d5 100644 --- a/packages/core/contracts/Escrow.sol +++ b/packages/core/contracts/Escrow.sol @@ -303,7 +303,7 @@ contract Escrow is IEscrow, ReentrancyGuard { status == EscrowStatuses.ToCancel, 'Escrow not in Pending, Partial or ToCancel status state' ); - if (_fundsToReserve != 0) { + if (_fundsToReserve > 0) { require(bytes(_url).length != 0, "URL can't be empty"); require(bytes(_hash).length != 0, "Hash can't be empty"); } From 511f24bd5561d71e26c3cd56a0824b8f0959e35d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Francisco=20L=C3=B3pez?= Date: Thu, 19 Jun 2025 18:20:33 +0200 Subject: [PATCH 15/18] [JobService] Refactor escrow cancellation test to use mocked functions for status, balance, and cancellation --- .../src/modules/job/job.service.spec.ts | 22 ++++++++++++++----- 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/packages/apps/job-launcher/server/src/modules/job/job.service.spec.ts b/packages/apps/job-launcher/server/src/modules/job/job.service.spec.ts index 83d25b8661..f2b151d760 100644 --- a/packages/apps/job-launcher/server/src/modules/job/job.service.spec.ts +++ b/packages/apps/job-launcher/server/src/modules/job/job.service.spec.ts @@ -1400,16 +1400,26 @@ describe('JobService', () => { it('should process escrow cancellation', async () => { const jobEntity = createJobEntity(); mockWeb3Service.calculateGasPrice.mockResolvedValueOnce(1n); + + const getStatusMock = jest.fn().mockResolvedValue('Active'); + const getBalanceMock = jest.fn().mockResolvedValue(100n); + const cancelMock = jest + .fn() + .mockResolvedValue({ txHash: '0x', amountRefunded: 100n }); + mockedEscrowClient.build.mockResolvedValue({ - getStatus: jest.fn().mockResolvedValue('Active'), - getBalance: jest.fn().mockResolvedValue(100n), - cancel: jest - .fn() - .mockResolvedValue({ txHash: '0x', amountRefunded: 100n }), + getStatus: getStatusMock, + getBalance: getBalanceMock, + cancel: cancelMock, } as unknown as EscrowClient); const result = await jobService.processEscrowCancellation(jobEntity); - expect(result).toHaveProperty('txHash'); + expect(result).toBe(undefined); + expect(mockWeb3Service.getSigner).toHaveBeenCalledWith(jobEntity.chainId); + + expect(getStatusMock).toHaveBeenCalled(); + expect(getBalanceMock).toHaveBeenCalled(); + expect(cancelMock).toHaveBeenCalled(); }); it('should throw if escrow status is not Active', async () => { From f549f96156b4f958f82f79153767a0547e261e69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Francisco=20L=C3=B3pez?= Date: Mon, 23 Jun 2025 12:59:37 +0200 Subject: [PATCH 16/18] Refactor job cancellation process to fix Abuse flow --- .../modules/cron-job/cron-job.service.spec.ts | 2 +- .../src/modules/cron-job/cron-job.service.ts | 57 ++++++++++++------- .../src/modules/job/job.service.spec.ts | 33 ++++++++++- .../server/src/modules/job/job.service.ts | 32 ++++++----- .../src/modules/payment/payment.repository.ts | 9 +++ .../modules/payment/payment.service.spec.ts | 56 ++++++++++++++++++ .../src/modules/payment/payment.service.ts | 7 +++ .../src/modules/webhook/webhook.module.ts | 14 ++--- .../modules/webhook/webhook.service.spec.ts | 12 ---- .../src/modules/webhook/webhook.service.ts | 5 +- 10 files changed, 168 insertions(+), 59 deletions(-) diff --git a/packages/apps/job-launcher/server/src/modules/cron-job/cron-job.service.spec.ts b/packages/apps/job-launcher/server/src/modules/cron-job/cron-job.service.spec.ts index 2ab5430409..23f907cc21 100644 --- a/packages/apps/job-launcher/server/src/modules/cron-job/cron-job.service.spec.ts +++ b/packages/apps/job-launcher/server/src/modules/cron-job/cron-job.service.spec.ts @@ -1273,7 +1273,7 @@ describe('CronJobService', () => { expect(jobRepository.updateOne).toHaveBeenCalledWith({ ...jobEntity, - status: JobStatus.CANCELED, + status: JobStatus.CANCELING, }); expect(webhookRepository.updateOne).toHaveBeenCalledWith({ ...webhookEntity, diff --git a/packages/apps/job-launcher/server/src/modules/cron-job/cron-job.service.ts b/packages/apps/job-launcher/server/src/modules/cron-job/cron-job.service.ts index ea5d94d47e..8facb0e190 100644 --- a/packages/apps/job-launcher/server/src/modules/cron-job/cron-job.service.ts +++ b/packages/apps/job-launcher/server/src/modules/cron-job/cron-job.service.ts @@ -287,24 +287,7 @@ export class CronJobService { jobEntity.requestType, ); if (oracleType !== OracleType.HCAPTCHA) { - const baseWebhook = { - escrowAddress: jobEntity.escrowAddress, - chainId: jobEntity.chainId, - eventType: EventType.CANCELLATION_REQUESTED, - oracleType, - hasSignature: true, - }; - const webhooks = [ - Object.assign(new WebhookEntity(), { - ...baseWebhook, - oracleAddress: jobEntity.exchangeOracle, - }), - Object.assign(new WebhookEntity(), { - ...baseWebhook, - oracleAddress: jobEntity.recordingOracle, - }), - ]; - await this.webhookRepository.createMany(webhooks); + await this.createCancellationWebhooks(jobEntity, oracleType); } } catch (err) { const errorId = uuidv4(); @@ -402,16 +385,26 @@ export class CronJobService { } if ( jobEntity.escrowAddress && + jobEntity.status !== JobStatus.CANCELING && jobEntity.status !== JobStatus.CANCELED ) { await this.jobService.processEscrowCancellation(jobEntity); } - if (jobEntity.status !== JobStatus.CANCELED) { - jobEntity.status = JobStatus.CANCELED; + if ( + jobEntity.status !== JobStatus.CANCELING && + jobEntity.status !== JobStatus.CANCELED + ) { + jobEntity.status = JobStatus.CANCELING; await this.jobRepository.updateOne(jobEntity); } await this.paymentService.createSlash(jobEntity); + const oracleType = this.jobService.getOracleType( + jobEntity.requestType, + ); + if (oracleType !== OracleType.HCAPTCHA) { + await this.createCancellationWebhooks(jobEntity, oracleType); + } } catch (err) { this.logger.error( `Error slashing escrow (address: ${webhookEntity.escrowAddress}, chainId: ${webhookEntity.chainId}: ${err.message}`, @@ -548,4 +541,28 @@ export class CronJobService { this.logger.log('Update jobs STOP'); await this.completeCronJob(cronJob); } + + private async createCancellationWebhooks( + jobEntity: JobEntity, + oracleType: OracleType, + ) { + const baseWebhook = { + escrowAddress: jobEntity.escrowAddress, + chainId: jobEntity.chainId, + eventType: EventType.CANCELLATION_REQUESTED, + oracleType, + hasSignature: true, + }; + const webhooks = [ + Object.assign(new WebhookEntity(), { + ...baseWebhook, + oracleAddress: jobEntity.exchangeOracle, + }), + Object.assign(new WebhookEntity(), { + ...baseWebhook, + oracleAddress: jobEntity.recordingOracle, + }), + ]; + await this.webhookRepository.createMany(webhooks); + } } diff --git a/packages/apps/job-launcher/server/src/modules/job/job.service.spec.ts b/packages/apps/job-launcher/server/src/modules/job/job.service.spec.ts index f2b151d760..9a6d8998e3 100644 --- a/packages/apps/job-launcher/server/src/modules/job/job.service.spec.ts +++ b/packages/apps/job-launcher/server/src/modules/job/job.service.spec.ts @@ -26,7 +26,7 @@ import { JobStatus, JobStatusFilter, } from '../../common/enums/job'; -import { PaymentCurrency } from '../../common/enums/payment'; +import { PaymentCurrency, PaymentType } from '../../common/enums/payment'; import { EventType, OracleType, @@ -1788,6 +1788,7 @@ describe('JobService', () => { const jobEntity = createJobEntity(); const refundAmount = faker.number.float({ min: 1, max: 10 }); + mockPaymentService.getPaymentsByJobId.mockResolvedValueOnce([]); mockedEscrowUtils.getCancellationRefund.mockResolvedValueOnce({ amount: ethers.parseUnits(refundAmount.toString(), 18), escrowAddress: jobEntity.escrowAddress!, @@ -1797,6 +1798,10 @@ describe('JobService', () => { await jobService.cancelJob(jobEntity); + expect(mockPaymentService.getPaymentsByJobId).toHaveBeenCalledWith( + jobEntity.id, + PaymentType.SLASH, + ); expect(EscrowUtils.getCancellationRefund).toHaveBeenCalledWith( jobEntity.chainId, jobEntity.escrowAddress, @@ -1811,8 +1816,33 @@ describe('JobService', () => { expect(mockJobRepository.updateOne).toHaveBeenCalledWith(jobEntity); }); + it('should NOT create a refund if SLASH payment exists, but still set status to CANCELED', async () => { + const jobEntity = createJobEntity(); + mockPaymentService.getPaymentsByJobId.mockResolvedValueOnce([ + { + id: faker.number.int(), + jobId: jobEntity.id, + type: PaymentType.SLASH, + amount: 10, + status: 'SUCCEEDED', + createdAt: new Date(), + } as any, + ]); + await jobService.cancelJob(jobEntity); + + expect(mockPaymentService.getPaymentsByJobId).toHaveBeenCalledWith( + jobEntity.id, + PaymentType.SLASH, + ); + expect(EscrowUtils.getCancellationRefund).not.toHaveBeenCalled(); + expect(mockPaymentService.createRefundPayment).not.toHaveBeenCalled(); + expect(jobEntity.status).toBe(JobStatus.CANCELED); + expect(mockJobRepository.updateOne).toHaveBeenCalledWith(jobEntity); + }); + it('should throw ConflictError if no refund is found', async () => { const jobEntity = createJobEntity(); + mockPaymentService.getPaymentsByJobId.mockResolvedValueOnce([]); mockedEscrowUtils.getCancellationRefund.mockResolvedValueOnce( null as any, ); @@ -1824,6 +1854,7 @@ describe('JobService', () => { it('should throw ConflictError if refund.amount is empty', async () => { const jobEntity = createJobEntity(); + mockPaymentService.getPaymentsByJobId.mockResolvedValueOnce([]); mockedEscrowUtils.getCancellationRefund.mockResolvedValueOnce({ amount: 0, escrowAddress: jobEntity.escrowAddress!, diff --git a/packages/apps/job-launcher/server/src/modules/job/job.service.ts b/packages/apps/job-launcher/server/src/modules/job/job.service.ts index d942283a35..1fdfc4188a 100644 --- a/packages/apps/job-launcher/server/src/modules/job/job.service.ts +++ b/packages/apps/job-launcher/server/src/modules/job/job.service.ts @@ -34,7 +34,7 @@ import { JobRequestType, JobStatus, } from '../../common/enums/job'; -import { FiatCurrency } from '../../common/enums/payment'; +import { FiatCurrency, PaymentType } from '../../common/enums/payment'; import { EventType, OracleType } from '../../common/enums/webhook'; import { ConflictError, @@ -905,21 +905,27 @@ export class JobService { } public async cancelJob(jobEntity: JobEntity): Promise { - const refund = await EscrowUtils.getCancellationRefund( - jobEntity.chainId, - jobEntity.escrowAddress!, + const slash = await this.paymentService.getPaymentsByJobId( + jobEntity.id, + PaymentType.SLASH, ); + if (!slash?.length) { + const refund = await EscrowUtils.getCancellationRefund( + jobEntity.chainId, + jobEntity.escrowAddress!, + ); - if (!refund || !refund.amount) { - throw new ConflictError(ErrorJob.NoRefundFound); - } + if (!refund || !refund.amount) { + throw new ConflictError(ErrorJob.NoRefundFound); + } - await this.paymentService.createRefundPayment({ - refundAmount: Number(ethers.formatEther(refund.amount)), - refundCurrency: jobEntity.token, - userId: jobEntity.userId, - jobId: jobEntity.id, - }); + await this.paymentService.createRefundPayment({ + refundAmount: Number(ethers.formatEther(refund.amount)), + refundCurrency: jobEntity.token, + userId: jobEntity.userId, + jobId: jobEntity.id, + }); + } jobEntity.status = JobStatus.CANCELED; await this.jobRepository.updateOne(jobEntity); diff --git a/packages/apps/job-launcher/server/src/modules/payment/payment.repository.ts b/packages/apps/job-launcher/server/src/modules/payment/payment.repository.ts index a7da7743fb..730bbbc025 100644 --- a/packages/apps/job-launcher/server/src/modules/payment/payment.repository.ts +++ b/packages/apps/job-launcher/server/src/modules/payment/payment.repository.ts @@ -23,6 +23,15 @@ export class PaymentRepository extends BaseRepository { return this.findOne({ where: whereOptions }); } + public async findByJobIdAndType( + jobId: number, + type?: string, + ): Promise { + const where: any = { jobId }; + if (type) where.type = type; + return this.find({ where }); + } + public async getUserBalancePayments( userId: number, currency?: string, diff --git a/packages/apps/job-launcher/server/src/modules/payment/payment.service.spec.ts b/packages/apps/job-launcher/server/src/modules/payment/payment.service.spec.ts index 2a7a83146a..1dbb348d4b 100644 --- a/packages/apps/job-launcher/server/src/modules/payment/payment.service.spec.ts +++ b/packages/apps/job-launcher/server/src/modules/payment/payment.service.spec.ts @@ -1599,4 +1599,60 @@ describe('PaymentService', () => { ).rejects.toThrow(new ServerError(ErrorPayment.NotEnoughFunds)); }); }); + + describe('getPaymentsByJobId', () => { + it('should return payments filtered by jobId and type', async () => { + const jobId = 123; + const type = PaymentType.REFUND; + const mockPayments = [ + { + id: 1, + jobId, + type, + amount: 100, + currency: PaymentCurrency.USD, + status: PaymentStatus.SUCCEEDED, + createdAt: new Date(), + } as PaymentEntity, + { + id: 2, + jobId, + type, + amount: 50, + currency: PaymentCurrency.USD, + status: PaymentStatus.SUCCEEDED, + createdAt: new Date(), + } as PaymentEntity, + ]; + + jest + .spyOn(paymentRepository, 'findByJobIdAndType') + .mockResolvedValueOnce(mockPayments); + + const result = await paymentService.getPaymentsByJobId(jobId, type); + + expect(paymentRepository.findByJobIdAndType).toHaveBeenCalledWith( + jobId, + type, + ); + expect(result).toEqual(mockPayments); + }); + + it('should return an empty array if no payments are found', async () => { + const jobId = 456; + const type = PaymentType.SLASH; + + jest + .spyOn(paymentRepository, 'findByJobIdAndType') + .mockResolvedValueOnce([]); + + const result = await paymentService.getPaymentsByJobId(jobId, type); + + expect(paymentRepository.findByJobIdAndType).toHaveBeenCalledWith( + jobId, + type, + ); + expect(result).toEqual([]); + }); + }); }); diff --git a/packages/apps/job-launcher/server/src/modules/payment/payment.service.ts b/packages/apps/job-launcher/server/src/modules/payment/payment.service.ts index 0809be590b..102eda4c8e 100644 --- a/packages/apps/job-launcher/server/src/modules/payment/payment.service.ts +++ b/packages/apps/job-launcher/server/src/modules/payment/payment.service.ts @@ -755,4 +755,11 @@ export class PaymentService { totalUsdAmount: totalUSDAmount, }; } + + public async getPaymentsByJobId( + jobId: number, + type?: string, + ): Promise { + return this.paymentRepository.findByJobIdAndType(jobId, type); + } } diff --git a/packages/apps/job-launcher/server/src/modules/webhook/webhook.module.ts b/packages/apps/job-launcher/server/src/modules/webhook/webhook.module.ts index dab2beb310..f049d39ecc 100644 --- a/packages/apps/job-launcher/server/src/modules/webhook/webhook.module.ts +++ b/packages/apps/job-launcher/server/src/modules/webhook/webhook.module.ts @@ -1,23 +1,21 @@ import { Logger, Module } from '@nestjs/common'; -import { TypeOrmModule } from '@nestjs/typeorm'; import { ConfigModule } from '@nestjs/config'; +import { TypeOrmModule } from '@nestjs/typeorm'; -import { WebhookService } from './webhook.service'; -import { WebhookEntity } from './webhook.entity'; -import { WebhookRepository } from './webhook.repository'; -import { Web3Module } from '../web3/web3.module'; import { HttpModule } from '@nestjs/axios'; -import { JobModule } from '../job/job.module'; -import { WebhookController } from './webhook.controller'; import { JobEntity } from '../job/job.entity'; +import { JobModule } from '../job/job.module'; import { JobRepository } from '../job/job.repository'; +import { WebhookController } from './webhook.controller'; +import { WebhookEntity } from './webhook.entity'; +import { WebhookRepository } from './webhook.repository'; +import { WebhookService } from './webhook.service'; @Module({ imports: [ TypeOrmModule.forFeature([WebhookEntity, JobEntity]), ConfigModule, JobModule, - Web3Module, HttpModule, ], controllers: [WebhookController], diff --git a/packages/apps/job-launcher/server/src/modules/webhook/webhook.service.spec.ts b/packages/apps/job-launcher/server/src/modules/webhook/webhook.service.spec.ts index d75e9c7389..cde56bf6d3 100644 --- a/packages/apps/job-launcher/server/src/modules/webhook/webhook.service.spec.ts +++ b/packages/apps/job-launcher/server/src/modules/webhook/webhook.service.spec.ts @@ -32,7 +32,6 @@ import { import { ServerError, ValidationError } from '../../common/errors'; import { JobRepository } from '../job/job.repository'; import { JobService } from '../job/job.service'; -import { Web3Service } from '../web3/web3.service'; import { WebhookDataDto } from './webhook.dto'; import { WebhookEntity } from './webhook.entity'; import { WebhookRepository } from './webhook.repository'; @@ -45,11 +44,6 @@ describe('WebhookService', () => { jobRepository: JobRepository, httpService: HttpService; - const signerMock = { - address: MOCK_ADDRESS, - getNetwork: jest.fn().mockResolvedValue({ chainId: 1 }), - }; - beforeEach(async () => { const moduleRef = await Test.createTestingModule({ providers: [ @@ -68,12 +62,6 @@ describe('WebhookService', () => { WebhookService, ServerConfigService, Web3ConfigService, - { - provide: Web3Service, - useValue: { - getSigner: jest.fn().mockReturnValue(signerMock), - }, - }, { provide: WebhookRepository, useValue: createMock(), diff --git a/packages/apps/job-launcher/server/src/modules/webhook/webhook.service.ts b/packages/apps/job-launcher/server/src/modules/webhook/webhook.service.ts index 9de7eab5db..039570aed9 100644 --- a/packages/apps/job-launcher/server/src/modules/webhook/webhook.service.ts +++ b/packages/apps/job-launcher/server/src/modules/webhook/webhook.service.ts @@ -1,7 +1,7 @@ /* eslint-disable @typescript-eslint/no-non-null-assertion */ import { KVStoreKeys, KVStoreUtils } from '@human-protocol/sdk'; import { HttpService } from '@nestjs/axios'; -import { Inject, Injectable, Logger } from '@nestjs/common'; +import { Injectable, Logger } from '@nestjs/common'; import { firstValueFrom } from 'rxjs'; import { ServerConfigService } from '../../common/config/server-config.service'; import { Web3ConfigService } from '../../common/config/web3-config.service'; @@ -14,7 +14,6 @@ import { formatAxiosError } from '../../common/utils/http'; import { signMessage } from '../../common/utils/signature'; import { JobRepository } from '../job/job.repository'; import { JobService } from '../job/job.service'; -import { Web3Service } from '../web3/web3.service'; import { WebhookDataDto } from './webhook.dto'; import { WebhookEntity } from './webhook.entity'; import { WebhookRepository } from './webhook.repository'; @@ -24,8 +23,6 @@ export class WebhookService { private readonly logger = new Logger(WebhookService.name); constructor( - @Inject(Web3Service) - private readonly web3Service: Web3Service, private readonly webhookRepository: WebhookRepository, private readonly jobService: JobService, private readonly jobRepository: JobRepository, From 4d24f3bdec9d42efb1509dc578ef911169673a99 Mon Sep 17 00:00:00 2001 From: portuu3 Date: Tue, 15 Jul 2025 17:15:26 +0200 Subject: [PATCH 17/18] v1 & v2 --- packages/core/contracts/Escrow.sol | 524 ------- packages/core/contracts/Staking.sol | 1 - packages/core/contracts/V1/Escrow.sol | 443 ++++++ .../core/contracts/{ => V1}/EscrowFactory.sol | 27 +- .../contracts/{ => V1}/interfaces/IEscrow.sol | 28 +- .../core/contracts/V2/EscrowFactoryV2.sol | 130 ++ packages/core/contracts/V2/EscrowV2.sol | 456 ++++++ .../contracts/V2/interfaces/IEscrowV2.sol | 48 + .../core/contracts/test/EscrowFactoryV0.sol | 5 +- packages/core/hardhat.config.ts | 10 + packages/core/test/{ => V1}/Escrow.ts | 0 packages/core/test/{ => V1}/EscrowFactory.ts | 2 +- packages/core/test/V2/EscrowFactoryV2.ts | 314 ++++ packages/core/test/V2/EscrowV2.ts | 1334 +++++++++++++++++ .../test/{ => governance}/DAOSpokeContract.ts | 2 +- .../test/{ => governance}/GovernanceTypes.ts | 0 .../test/{ => governance}/GovernanceUtils.ts | 2 +- .../{ => governance}/MetaHumanGovernor.ts | 2 +- .../MetaHumanGovernorHubOnly.ts | 2 +- 19 files changed, 2769 insertions(+), 561 deletions(-) delete mode 100644 packages/core/contracts/Escrow.sol create mode 100644 packages/core/contracts/V1/Escrow.sol rename packages/core/contracts/{ => V1}/EscrowFactory.sol (87%) rename packages/core/contracts/{ => V1}/interfaces/IEscrow.sol (63%) create mode 100644 packages/core/contracts/V2/EscrowFactoryV2.sol create mode 100644 packages/core/contracts/V2/EscrowV2.sol create mode 100644 packages/core/contracts/V2/interfaces/IEscrowV2.sol rename packages/core/test/{ => V1}/Escrow.ts (100%) rename packages/core/test/{ => V1}/EscrowFactory.ts (99%) create mode 100644 packages/core/test/V2/EscrowFactoryV2.ts create mode 100644 packages/core/test/V2/EscrowV2.ts rename packages/core/test/{ => governance}/DAOSpokeContract.ts (99%) rename packages/core/test/{ => governance}/GovernanceTypes.ts (100%) rename packages/core/test/{ => governance}/GovernanceUtils.ts (99%) rename packages/core/test/{ => governance}/MetaHumanGovernor.ts (99%) rename packages/core/test/{ => governance}/MetaHumanGovernorHubOnly.ts (99%) diff --git a/packages/core/contracts/Escrow.sol b/packages/core/contracts/Escrow.sol deleted file mode 100644 index 13a2b878d5..0000000000 --- a/packages/core/contracts/Escrow.sol +++ /dev/null @@ -1,524 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity ^0.8.0; - -import '@openzeppelin/contracts/token/ERC20/IERC20.sol'; -import '@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol'; -import '@openzeppelin/contracts/utils/ReentrancyGuard.sol'; - -import './interfaces/IEscrow.sol'; - -/** - * @title Escrow Contract - * @dev This contract manages the lifecycle of an escrow, including funding, - * setup, payouts, and completion. It supports trusted handlers and oracles - * for managing the escrow process. - */ -contract Escrow is IEscrow, ReentrancyGuard { - bytes4 private constant FUNC_SELECTOR_BALANCE_OF = - bytes4(keccak256('balanceOf(address)')); - - string constant ERROR_ZERO_ADDRESS = 'Escrow: zero address'; - - uint32 private constant BULK_MAX_COUNT = 100; - - event TrustedHandlerAdded(address _handler); - event IntermediateStorage(string _url, string _hash); - event Pending(string manifest, string hash); - event PendingV2( - string manifest, - string hash, - address reputationOracle, - address recordingOracle, - address exchangeOracle - ); - event BulkTransfer( - uint256 indexed _txId, - address[] _recipients, - uint256[] _amounts, - bool _isPartial - ); - event BulkTransferV2( - uint256 indexed _txId, - address[] _recipients, - uint256[] _amounts, - bool _isPartial, - string finalResultsUrl - ); - event Cancelled(); - event Completed(); - event Fund(uint256 _amount); - event Withdraw(address _token, uint256 _amount); - event CancellationRequested(); - event CancellationRefund(uint256 amount); - - EscrowStatuses public override status; - - address public reputationOracle; - address public recordingOracle; - address public exchangeOracle; - address public launcher; - address payable public canceler; - address public escrowFactory; - - uint8 public reputationOracleFeePercentage; - uint8 public recordingOracleFeePercentage; - uint8 public exchangeOracleFeePercentage; - - address public token; - - string public manifestUrl; - string public manifestHash; - - string public intermediateResultsUrl; - - string public finalResultsUrl; - string public finalResultsHash; - - uint256 public duration; - - mapping(address => bool) public areTrustedHandlers; - - uint256 public remainingFunds; - uint256 public reservedFunds; - - /** - * @dev Constructor to initialize the escrow contract. - * @param _token Address of the token used in the escrow. - * @param _launcher Address of the launcher (creator) of the escrow. - * @param _canceler Address of the canceler who can cancel the escrow. - * @param _duration Duration of the escrow in seconds. - * @param _handlers Array of trusted handler addresses. - */ - constructor( - address _token, - address _launcher, - address payable _canceler, - uint256 _duration, - address[] memory _handlers - ) { - require(_token != address(0), ERROR_ZERO_ADDRESS); - require(_canceler != address(0), ERROR_ZERO_ADDRESS); - - token = _token; - status = EscrowStatuses.Launched; - duration = _duration + block.timestamp; - launcher = _launcher; - canceler = _canceler; - escrowFactory = msg.sender; - areTrustedHandlers[_launcher] = true; - areTrustedHandlers[_canceler] = true; - _addTrustedHandlers(_handlers); - } - - /** - * @dev Returns the balance of the escrow contract for the main token. - */ - function getBalance() public view returns (uint256) { - return getTokenBalance(token); - } - - /** - * @dev Returns the balance of the escrow contract for a specific token. - * @param _token Address of the token to check the balance for. - */ - function getTokenBalance(address _token) public view returns (uint256) { - (bool success, bytes memory returnData) = _token.staticcall( - abi.encodeWithSelector(FUNC_SELECTOR_BALANCE_OF, address(this)) - ); - return success ? abi.decode(returnData, (uint256)) : 0; - } - - /** - * @dev Adds trusted handlers to the contract. - * @param _handlers Array of addresses to be added as trusted handlers. - */ - function addTrustedHandlers( - address[] memory _handlers - ) public override trusted { - _addTrustedHandlers(_handlers); - } - - /** - * @dev Internal function to add trusted handlers. - * @param _handlers Array of addresses to be added as trusted handlers. - */ - function _addTrustedHandlers(address[] memory _handlers) internal { - for (uint256 i = 0; i < _handlers.length; i++) { - require(_handlers[i] != address(0), ERROR_ZERO_ADDRESS); - areTrustedHandlers[_handlers[i]] = true; - emit TrustedHandlerAdded(_handlers[i]); - } - } - - /** - * @dev Sets up the escrow with oracles and manifest details. - * @param _reputationOracle Address of the reputation oracle. - * @param _recordingOracle Address of the recording oracle. - * @param _exchangeOracle Address of the exchange oracle. - * @param _reputationOracleFeePercentage Fee percentage for the reputation oracle. - * @param _recordingOracleFeePercentage Fee percentage for the recording oracle. - * @param _exchangeOracleFeePercentage Fee percentage for the exchange oracle. - * @param _url URL of the manifest. - * @param _hash Hash of the manifest. - */ - function setup( - address _reputationOracle, - address _recordingOracle, - address _exchangeOracle, - uint8 _reputationOracleFeePercentage, - uint8 _recordingOracleFeePercentage, - uint8 _exchangeOracleFeePercentage, - string memory _url, - string memory _hash - ) external override trusted notExpired { - require( - _reputationOracle != address(0), - 'Invalid reputation oracle address' - ); - require( - _recordingOracle != address(0), - 'Invalid recording oracle address' - ); - require( - _exchangeOracle != address(0), - 'Invalid exchange oracle address' - ); - uint256 _totalFeePercentage = _reputationOracleFeePercentage + - _recordingOracleFeePercentage + - _exchangeOracleFeePercentage; - require(_totalFeePercentage <= 100, 'Percentage out of bounds'); - - require( - status == EscrowStatuses.Launched, - 'Escrow not in Launched status state' - ); - - reputationOracle = _reputationOracle; - recordingOracle = _recordingOracle; - exchangeOracle = _exchangeOracle; - - reputationOracleFeePercentage = _reputationOracleFeePercentage; - recordingOracleFeePercentage = _recordingOracleFeePercentage; - exchangeOracleFeePercentage = _exchangeOracleFeePercentage; - - manifestUrl = _url; - manifestHash = _hash; - status = EscrowStatuses.Pending; - - remainingFunds = getBalance(); - require(remainingFunds > 0, 'Escrow balance is zero'); - - emit PendingV2( - manifestUrl, - manifestHash, - reputationOracle, - recordingOracle, - exchangeOracle - ); - emit Fund(remainingFunds); - } - - /** - * @dev Cancels the escrow and transfers remaining funds to the canceler. - * @return bool indicating success of the cancellation. - */ - function cancel() - public - override - trusted - notBroke - notComplete - nonReentrant - returns (bool) - { - status = EscrowStatuses.ToCancel; - emit CancellationRequested(); - return true; - } - - /** - * @dev Withdraws excess funds from the escrow for a specific token. - * @param _token Address of the token to withdraw. - * @return bool indicating success of the withdrawal. - */ - function withdraw( - address _token - ) public override trusted nonReentrant returns (bool) { - uint256 _amount; - if (_token == token) { - uint256 _balance = getBalance(); - require(_balance > remainingFunds, 'No funds to withdraw'); - _amount = _balance - remainingFunds; - } else { - _amount = getTokenBalance(_token); - } - - _safeTransfer(_token, canceler, _amount); - - emit Withdraw(_token, _amount); - return true; - } - - /** - * @dev Completes the escrow, transferring remaining funds to the launcher. - */ - function complete() external override notExpired trustedOrReputationOracle { - require( - status == EscrowStatuses.Paid || status == EscrowStatuses.Partial, - 'Escrow not in Paid or Partial state' - ); - _finalize(); - } - - function _finalize() private { - if (remainingFunds > 0) { - _safeTransfer(token, launcher, remainingFunds); - remainingFunds = 0; - reservedFunds = 0; - } - if (status == EscrowStatuses.ToCancel) { - status = EscrowStatuses.Cancelled; - emit Cancelled(); - } else { - status = EscrowStatuses.Complete; - emit Completed(); - } - } - - /** - * @dev Stores intermediate results during the escrow process. - * @param _url URL of the intermediate results. - * @param _hash Hash of the intermediate results. - * @param _fundsToReserve Amount of funds to reserve for the escrow. - */ - function storeResults( - string memory _url, - string memory _hash, - uint256 _fundsToReserve - ) external override trustedOrRecordingOracle notExpired { - require( - status == EscrowStatuses.Pending || - status == EscrowStatuses.Partial || - status == EscrowStatuses.ToCancel, - 'Escrow not in Pending, Partial or ToCancel status state' - ); - if (_fundsToReserve > 0) { - require(bytes(_url).length != 0, "URL can't be empty"); - require(bytes(_hash).length != 0, "Hash can't be empty"); - } - require( - _fundsToReserve <= remainingFunds - reservedFunds, - 'Not enough unreserved funds' - ); - - intermediateResultsUrl = _url; - reservedFunds += _fundsToReserve; - - emit IntermediateStorage(_url, _hash); - - if (status == EscrowStatuses.ToCancel) { - uint256 unreservedFunds = remainingFunds - reservedFunds; - if (unreservedFunds > 0) { - _safeTransfer(token, launcher, unreservedFunds); - emit CancellationRefund(unreservedFunds); - remainingFunds = reservedFunds; - } - if (remainingFunds == 0) { - status = EscrowStatuses.Cancelled; - emit Cancelled(); - } - } - } - - /** - * @dev Performs bulk payout to multiple recipients with oracle fees deducted. - * @param _recipients Array of recipient addresses. - * @param _amounts Array of amounts to be paid to each recipient. - * @param _url URL storing results as transaction details. - * @param _hash Hash of the results. - * @param _txId Transaction ID. - * @param forceComplete Boolean indicating if remaining balance should be transferred to the launcher. - */ - function bulkPayOut( - address[] memory _recipients, - uint256[] memory _amounts, - string memory _url, - string memory _hash, - uint256 _txId, - bool forceComplete - ) - public - override - trustedOrReputationOracle - notBroke - notLaunched - notExpired - nonReentrant - { - require( - _recipients.length == _amounts.length, - "Amount of recipients and values don't match" - ); - require(_amounts.length > 0, 'Amounts should not be empty'); - require(_recipients.length < BULK_MAX_COUNT, 'Too many recipients'); - require( - status != EscrowStatuses.Complete && - status != EscrowStatuses.Cancelled, - 'Invalid status' - ); - require( - bytes(_url).length != 0 && bytes(_hash).length != 0, - 'URL or hash is empty' - ); - - uint256 totalBulkAmount = 0; - - for (uint256 i = 0; i < _recipients.length; i++) { - uint256 amount = _amounts[i]; - require(amount > 0, 'Amount should be greater than zero'); - totalBulkAmount += amount; - } - require(totalBulkAmount <= reservedFunds, 'Not enough reserved funds'); - - uint256 totalReputationOracleFee = 0; - uint256 totalRecordingOracleFee = 0; - uint256 totalExchangeOracleFee = 0; - - for (uint256 i = 0; i < _recipients.length; i++) { - uint256 amount = _amounts[i]; - uint256 reputationOracleFee = (reputationOracleFeePercentage * - amount) / 100; - uint256 recordingOracleFee = (recordingOracleFeePercentage * - amount) / 100; - uint256 exchangeOracleFee = (exchangeOracleFeePercentage * amount) / - 100; - - totalReputationOracleFee += reputationOracleFee; - totalRecordingOracleFee += recordingOracleFee; - totalExchangeOracleFee += exchangeOracleFee; - - _safeTransfer( - token, - _recipients[i], - amount - - reputationOracleFee - - recordingOracleFee - - exchangeOracleFee - ); - } - - // Transfer oracle fees - if (reputationOracleFeePercentage > 0) { - _safeTransfer(token, reputationOracle, totalReputationOracleFee); - } - if (recordingOracleFeePercentage > 0) { - _safeTransfer(token, recordingOracle, totalRecordingOracleFee); - } - if (exchangeOracleFeePercentage > 0) { - _safeTransfer(token, exchangeOracle, totalExchangeOracleFee); - } - remainingFunds -= totalBulkAmount; - reservedFunds -= totalBulkAmount; - - finalResultsUrl = _url; - finalResultsHash = _hash; - - if (remainingFunds == 0 || forceComplete) { - emit BulkTransferV2( - _txId, - _recipients, - _amounts, - false, - finalResultsUrl - ); - _finalize(); - } else { - if (status != EscrowStatuses.ToCancel) { - status = EscrowStatuses.Partial; - } - emit BulkTransferV2( - _txId, - _recipients, - _amounts, - true, - finalResultsUrl - ); - } - } - - /** - * @dev Overloaded function to perform bulk payout with default forceComplete set to false. - * @param _recipients Array of recipient addresses. - * @param _amounts Array of amounts to be paid to each recipient. - * @param _url URL storing results as transaction details. - * @param _hash Hash of the results. - * @param _txId Transaction ID. - */ - function bulkPayOut( - address[] memory _recipients, - uint256[] memory _amounts, - string memory _url, - string memory _hash, - uint256 _txId - ) external { - bulkPayOut(_recipients, _amounts, _url, _hash, _txId, false); - } - - /** - * @dev Internal function to safely transfer tokens. - * @param _token Address of the token to transfer. - * @param to Address of the recipient. - * @param value Amount to transfer. - */ - function _safeTransfer(address _token, address to, uint256 value) internal { - SafeERC20.safeTransfer(IERC20(_token), to, value); - } - - modifier trusted() { - require(areTrustedHandlers[msg.sender], 'Address calling not trusted'); - _; - } - - modifier trustedOrReputationOracle() { - require( - areTrustedHandlers[msg.sender] || msg.sender == reputationOracle, - 'Address calling not trusted' - ); - _; - } - - modifier trustedOrRecordingOracle() { - require( - areTrustedHandlers[msg.sender] || msg.sender == recordingOracle, - 'Address calling not trusted' - ); - _; - } - - modifier notBroke() { - require(remainingFunds != 0, 'Token contract out of funds'); - _; - } - - modifier notComplete() { - require( - status != EscrowStatuses.Complete, - 'Escrow in Complete status state' - ); - _; - } - - modifier notLaunched() { - require( - status != EscrowStatuses.Launched, - 'Escrow in Launched status state' - ); - _; - } - - modifier notExpired() { - require(duration > block.timestamp, 'Contract expired'); - _; - } -} diff --git a/packages/core/contracts/Staking.sol b/packages/core/contracts/Staking.sol index b4499ceddd..d5dd0d7698 100644 --- a/packages/core/contracts/Staking.sol +++ b/packages/core/contracts/Staking.sol @@ -8,7 +8,6 @@ import '@openzeppelin/contracts/access/Ownable.sol'; import '@openzeppelin/contracts/utils/ReentrancyGuard.sol'; import './interfaces/HMTokenInterface.sol'; -import './interfaces/IEscrow.sol'; import './interfaces/IStaking.sol'; import './libs/Stakes.sol'; diff --git a/packages/core/contracts/V1/Escrow.sol b/packages/core/contracts/V1/Escrow.sol new file mode 100644 index 0000000000..90a2cfa3e8 --- /dev/null +++ b/packages/core/contracts/V1/Escrow.sol @@ -0,0 +1,443 @@ +// SPDX-License-Identifier: MIT + +pragma solidity ^0.8.0; + +import '@openzeppelin/contracts/token/ERC20/IERC20.sol'; +import '@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol'; +import '@openzeppelin/contracts/utils/ReentrancyGuard.sol'; + +import './interfaces/IEscrow.sol'; + +/** + * @title Escrow Contract + * @dev This contract manages the lifecycle of an escrow, including funding, + * setup, payouts, and completion. + */ +contract Escrow is IEscrow, ReentrancyGuard { + using SafeERC20 for IERC20; + + string constant ERROR_ZERO_ADDRESS = 'Escrow: zero address'; + uint32 private constant BULK_MAX_COUNT = 100; + + event IntermediateStorage(string url, string hash); + event Pending(string manifest, string hash); + event PendingV2( + string manifest, + string hash, + address reputationOracle, + address recordingOracle, + address exchangeOracle + ); + event BulkTransfer( + uint256 indexed txId, + address[] recipients, + uint256[] amounts, + bool isPartial + ); + event BulkTransferV2( + uint256 indexed txId, + address[] recipients, + uint256[] amounts, + bool isPartial, + string finalResultsUrl + ); + event Cancelled(); + event Completed(); + event Fund(uint256 amount); + event Withdraw(address token, uint256 amount); + + EscrowStatuses public override status; + + address public reputationOracle; + address public recordingOracle; + address public exchangeOracle; + + address public immutable launcher; + address public immutable admin; + address public immutable escrowFactory; + address public immutable token; + + uint8 public reputationOracleFeePercentage; + uint8 public recordingOracleFeePercentage; + uint8 public exchangeOracleFeePercentage; + + string public manifestUrl; + string public manifestHash; + string public intermediateResultsUrl; + string public finalResultsUrl; + string public finalResultsHash; + + uint256 public duration; + uint256 public remainingFunds; + + /** + * @param _token Address of the token used in the escrow. + * @param _launcher Creator of the escrow. + * @param _admin Admin address for the escrow. + * @param _duration Escrow lifetime (seconds). + */ + constructor( + address _token, + address _launcher, + address _admin, + uint256 _duration + ) { + require(_launcher != address(0), ERROR_ZERO_ADDRESS); + require(_admin != address(0), ERROR_ZERO_ADDRESS); + require(_token != address(0), ERROR_ZERO_ADDRESS); + require(_duration > 0, 'Duration must be > 0'); + + token = _token; + status = EscrowStatuses.Launched; + duration = _duration + block.timestamp; + launcher = _launcher; + escrowFactory = msg.sender; + admin = _admin; + } + + /** + * @dev Returns the balance of the escrow contract for the main token. + */ + function getBalance() public view returns (uint256) { + return getTokenBalance(token); + } + + /** + * @dev Returns the balance of the escrow contract for a specific token. + * @param _token Address of the token to check the balance for. + */ + function getTokenBalance(address _token) public view returns (uint256) { + return IERC20(_token).balanceOf(address(this)); + } + + /** + * @dev Sets up the escrow with oracles, manifest and fees. + * @param _reputationOracle Address of the reputation oracle. + * @param _recordingOracle Address of the recording oracle. + * @param _exchangeOracle Address of the exchange oracle. + * @param _reputationOracleFeePercentage Fee percentage for the reputation oracle. + * @param _recordingOracleFeePercentage Fee percentage for the recording oracle. + * @param _exchangeOracleFeePercentage Fee percentage for the exchange oracle. + * @param _url URL for the escrow manifest. + * @param _hash Hash of the escrow manifest. + */ + function setup( + address _reputationOracle, + address _recordingOracle, + address _exchangeOracle, + uint8 _reputationOracleFeePercentage, + uint8 _recordingOracleFeePercentage, + uint8 _exchangeOracleFeePercentage, + string calldata _url, + string calldata _hash + ) external override adminOrLauncher notExpired { + require(_reputationOracle != address(0), 'Invalid reputation oracle'); + require(_recordingOracle != address(0), 'Invalid recording oracle'); + require(_exchangeOracle != address(0), 'Invalid exchange oracle'); + uint256 _totalFeePercentage = _reputationOracleFeePercentage + + _recordingOracleFeePercentage + + _exchangeOracleFeePercentage; + require(_totalFeePercentage <= 100, 'Percentage out of bounds'); + require(status == EscrowStatuses.Launched, 'Wrong status'); + + reputationOracle = _reputationOracle; + recordingOracle = _recordingOracle; + exchangeOracle = _exchangeOracle; + + reputationOracleFeePercentage = _reputationOracleFeePercentage; + recordingOracleFeePercentage = _recordingOracleFeePercentage; + exchangeOracleFeePercentage = _exchangeOracleFeePercentage; + + manifestUrl = _url; + manifestHash = _hash; + status = EscrowStatuses.Pending; + + remainingFunds = getBalance(); + require(remainingFunds > 0, 'Zero balance'); + + emit PendingV2( + _url, + _hash, + _reputationOracle, + _recordingOracle, + _exchangeOracle + ); + emit Fund(remainingFunds); + } + + /** + * @dev Cancels the escrow and transfers remaining funds to the canceler. + * @return bool indicating success of the cancellation. + */ + function cancel() + public + override + adminOrLauncher + notBroke + notComplete + nonReentrant + returns (bool) + { + IERC20(token).safeTransfer(launcher, remainingFunds); + status = EscrowStatuses.Cancelled; + remainingFunds = 0; + emit Cancelled(); + return true; + } + + /** + * @dev Withdraws excess funds from the escrow for a specific token. + * @param _token Address of the token to withdraw. + * @return bool indicating success of the withdrawal. + */ + function withdraw( + address _token + ) public override adminOrLauncher nonReentrant returns (bool) { + uint256 _amount; + if (_token == token) { + uint256 _balance = getBalance(); + require(_balance > remainingFunds, 'No funds'); + _amount = _balance - remainingFunds; + } else { + _amount = getTokenBalance(_token); + } + + IERC20(_token).safeTransfer(msg.sender, _amount); + + emit Withdraw(_token, _amount); + return true; + } + + /** + * @dev Completes the escrow, transferring remaining funds to the launcher. + */ + function complete() external override notExpired adminOrReputationOracle { + require( + status == EscrowStatuses.Paid || status == EscrowStatuses.Partial, + 'Invalid status' + ); + _complete(); + } + + function _complete() private { + if (remainingFunds > 0) { + IERC20(token).safeTransfer(launcher, remainingFunds); + remainingFunds = 0; + } + status = EscrowStatuses.Complete; + emit Completed(); + } + + /** + * @dev Stores intermediate results in the escrow. + * @param _url URL of the intermediate results. + * @param _hash Hash of the intermediate results. + */ + function storeResults( + string calldata _url, + string calldata _hash + ) external override adminOrRecordingOracle notExpired { + require( + status == EscrowStatuses.Pending || + status == EscrowStatuses.Partial, + 'Invalid status' + ); + require(bytes(_url).length != 0, 'Empty URL'); + require(bytes(_hash).length != 0, 'Empty hash'); + + intermediateResultsUrl = _url; + + emit IntermediateStorage(_url, _hash); + } + + /** + * @dev Bulk payout to multiple recipients. + * @param _recipients Array of recipient addresses. + * @param _amounts Array of amounts to be transferred to each recipient. + * @param _url URL of the final results. + * @param _hash Hash of the final results. + * @param _txId Transaction ID for tracking. + * @param forceComplete Whether to force completion of the escrow and transfer remaining funds to the launcher. + */ + function bulkPayOut( + address[] calldata _recipients, + uint256[] calldata _amounts, + string calldata _url, + string calldata _hash, + uint256 _txId, + bool forceComplete + ) external override { + _bulkPayOut(_recipients, _amounts, _url, _hash, _txId, forceComplete); + } + + /** + * @dev Overloaded function to perform bulk payout with default forceComplete set to false. + * @param _recipients Array of recipient addresses. + * @param _amounts Array of amounts to be transferred to each recipient. + * @param _url URL of the final results. + * @param _hash Hash of the final results. + * @param _txId Transaction ID for tracking. + */ + function bulkPayOut( + address[] calldata _recipients, + uint256[] calldata _amounts, + string calldata _url, + string calldata _hash, + uint256 _txId + ) external { + _bulkPayOut(_recipients, _amounts, _url, _hash, _txId, false); + } + + function _bulkPayOut( + address[] memory _recipients, + uint256[] memory _amounts, + string memory _url, + string memory _hash, + uint256 _txId, + bool forceComplete + ) + internal + adminOrReputationOracle + notBroke + notLaunched + notExpired + nonReentrant + { + require(_recipients.length == _amounts.length, 'Length mismatch'); + require(_amounts.length > 0, 'Empty amounts'); + require(_recipients.length < BULK_MAX_COUNT, 'Too many recipients'); + require( + status != EscrowStatuses.Complete && + status != EscrowStatuses.Cancelled, + 'Invalid status' + ); + require( + bytes(_url).length != 0 && bytes(_hash).length != 0, + 'Empty url/hash' + ); + + uint256 totalBulkAmount = 0; + for (uint256 i; i < _recipients.length; ) { + uint256 amount = _amounts[i]; + require(amount > 0, 'Zero amount'); + totalBulkAmount += amount; + unchecked { + ++i; + } + } + require(totalBulkAmount <= remainingFunds, 'Not enough funds'); + + uint256 totalReputationOracleFee = 0; + uint256 totalRecordingOracleFee = 0; + uint256 totalExchangeOracleFee = 0; + uint256[] memory netAmounts = new uint256[](_recipients.length + 3); + address[] memory eventRecipients = new address[]( + _recipients.length + 3 + ); + IERC20 erc20 = IERC20(token); + + for (uint256 i = 0; i < _recipients.length; ) { + uint256 amount = _amounts[i]; + uint256 reputationOracleFee = (reputationOracleFeePercentage * + amount) / 100; + uint256 recordingOracleFee = (recordingOracleFeePercentage * + amount) / 100; + uint256 exchangeOracleFee = (exchangeOracleFeePercentage * amount) / + 100; + + totalReputationOracleFee += reputationOracleFee; + totalRecordingOracleFee += recordingOracleFee; + totalExchangeOracleFee += exchangeOracleFee; + + netAmounts[i] = + amount - + reputationOracleFee - + recordingOracleFee - + exchangeOracleFee; + eventRecipients[i] = _recipients[i]; + + erc20.safeTransfer(_recipients[i], netAmounts[i]); + unchecked { + ++i; + } + } + + if (reputationOracleFeePercentage > 0) { + erc20.safeTransfer(reputationOracle, totalReputationOracleFee); + eventRecipients[_recipients.length] = reputationOracle; + netAmounts[_recipients.length] = totalReputationOracleFee; + } + if (recordingOracleFeePercentage > 0) { + erc20.safeTransfer(recordingOracle, totalRecordingOracleFee); + eventRecipients[_recipients.length + 1] = recordingOracle; + netAmounts[_recipients.length + 1] = totalRecordingOracleFee; + } + if (exchangeOracleFeePercentage > 0) { + erc20.safeTransfer(exchangeOracle, totalExchangeOracleFee); + eventRecipients[_recipients.length + 2] = exchangeOracle; + netAmounts[_recipients.length + 2] = totalExchangeOracleFee; + } + + remainingFunds -= totalBulkAmount; + + finalResultsUrl = _url; + finalResultsHash = _hash; + + bool isPartial = true; + if (remainingFunds == 0 || forceComplete) { + isPartial = false; + _complete(); + } else { + status = EscrowStatuses.Partial; + } + + emit BulkTransferV2( + _txId, + eventRecipients, + netAmounts, + isPartial, + _url + ); + } + + modifier adminOrLauncher() { + require(msg.sender == admin || msg.sender == launcher, 'Unauthorised'); + _; + } + + modifier adminOrReputationOracle() { + require( + msg.sender == admin || msg.sender == reputationOracle, + 'Unauthorised' + ); + _; + } + + modifier adminOrRecordingOracle() { + require( + msg.sender == admin || msg.sender == recordingOracle, + 'Unauthorised' + ); + _; + } + + modifier notBroke() { + require(remainingFunds != 0, 'No funds'); + _; + } + + modifier notComplete() { + require(status != EscrowStatuses.Complete, 'Status Completed'); + _; + } + + modifier notLaunched() { + require(status != EscrowStatuses.Launched, 'Status Launched'); + _; + } + + modifier notExpired() { + require(duration > block.timestamp, 'Expired'); + _; + } +} diff --git a/packages/core/contracts/EscrowFactory.sol b/packages/core/contracts/V1/EscrowFactory.sol similarity index 87% rename from packages/core/contracts/EscrowFactory.sol rename to packages/core/contracts/V1/EscrowFactory.sol index 47c87d82e4..d4004ce5b2 100644 --- a/packages/core/contracts/EscrowFactory.sol +++ b/packages/core/contracts/V1/EscrowFactory.sol @@ -5,7 +5,7 @@ pragma solidity ^0.8.0; import '@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol'; import '@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol'; -import './interfaces/IStaking.sol'; +import '../interfaces/IStaking.sol'; import './Escrow.sol'; contract EscrowFactory is OwnableUpgradeable, UUPSUpgradeable { @@ -18,6 +18,7 @@ contract EscrowFactory is OwnableUpgradeable, UUPSUpgradeable { address public lastEscrow; address public staking; uint256 public minimumStake; + address public admin; event Launched(address token, address escrow); event LaunchedV2(address token, address escrow, string jobRequesterId); @@ -43,34 +44,29 @@ contract EscrowFactory is OwnableUpgradeable, UUPSUpgradeable { * @dev Creates a new Escrow contract. * * @param token Token address to be associated with the Escrow contract. - * @param trustedHandlers Array of addresses that will serve as the trusted handlers for the Escrow. * @param jobRequesterId String identifier for the job requester, used for tracking purposes. * * @return The address of the newly created Escrow contract. */ function createEscrow( address token, - address[] memory trustedHandlers, string memory jobRequesterId ) external returns (address) { uint256 availableStake = IStaking(staking).getAvailableStake( msg.sender ); - require( - availableStake >= minimumStake, - 'Insufficient stake to create an escrow.' - ); + require(availableStake >= minimumStake, 'Insufficient stake'); Escrow escrow = new Escrow( token, msg.sender, - payable(msg.sender), - STANDARD_DURATION, - trustedHandlers + admin != address(0) ? admin : msg.sender, + STANDARD_DURATION ); counter++; escrowCounters[address(escrow)] = counter; lastEscrow = address(escrow); + emit LaunchedV2(token, lastEscrow, jobRequesterId); return lastEscrow; } @@ -107,6 +103,15 @@ contract EscrowFactory is OwnableUpgradeable, UUPSUpgradeable { emit SetMinumumStake(minimumStake); } + /** + * @dev Set the admin address. + * @param _admin Admin address + */ + function setAdmin(address _admin) external onlyOwner { + require(_admin != address(0), ERROR_ZERO_ADDRESS); + admin = _admin; + } + function _authorizeUpgrade(address) internal override onlyOwner {} /** @@ -114,5 +119,5 @@ contract EscrowFactory is OwnableUpgradeable, UUPSUpgradeable { * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ - uint256[45] private __gap; + uint256[44] private __gap; } diff --git a/packages/core/contracts/interfaces/IEscrow.sol b/packages/core/contracts/V1/interfaces/IEscrow.sol similarity index 63% rename from packages/core/contracts/interfaces/IEscrow.sol rename to packages/core/contracts/V1/interfaces/IEscrow.sol index ff34743020..f1935f6a8a 100644 --- a/packages/core/contracts/interfaces/IEscrow.sol +++ b/packages/core/contracts/V1/interfaces/IEscrow.sol @@ -15,8 +15,6 @@ interface IEscrow { function status() external view returns (EscrowStatuses); - function addTrustedHandlers(address[] memory _handlers) external; - function setup( address _reputationOracle, address _recordingOracle, @@ -24,8 +22,8 @@ interface IEscrow { uint8 _reputationOracleFeePercentage, uint8 _recordingOracleFeePercentage, uint8 _exchangeOracleFeePercentage, - string memory _url, - string memory _hash + string calldata _url, + string calldata _hash ) external; function cancel() external returns (bool); @@ -34,26 +32,22 @@ interface IEscrow { function complete() external; - function storeResults( - string memory _url, - string memory _hash, - uint256 _amount - ) external; + function storeResults(string calldata _url, string calldata _hash) external; function bulkPayOut( - address[] memory _recipients, - uint256[] memory _amounts, - string memory _url, - string memory _hash, + address[] calldata _recipients, + uint256[] calldata _amounts, + string calldata _url, + string calldata _hash, uint256 _txId, bool forceComplete ) external; function bulkPayOut( - address[] memory _recipients, - uint256[] memory _amounts, - string memory _url, - string memory _hash, + address[] calldata _recipients, + uint256[] calldata _amounts, + string calldata _url, + string calldata _hash, uint256 _txId ) external; } diff --git a/packages/core/contracts/V2/EscrowFactoryV2.sol b/packages/core/contracts/V2/EscrowFactoryV2.sol new file mode 100644 index 0000000000..861a372ae0 --- /dev/null +++ b/packages/core/contracts/V2/EscrowFactoryV2.sol @@ -0,0 +1,130 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.28; + +import '@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol'; +import '@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol'; + +import '../interfaces/IStaking.sol'; +import './EscrowV2.sol'; + +contract EscrowFactoryV2 is OwnableUpgradeable, UUPSUpgradeable { + /// @dev All escrows default to 100 days (8640000 s). + uint256 public constant STANDARD_DURATION = 8_640_000; + + string private constant ERROR_ZERO_ADDRESS = 'EscrowFactory: zero address'; + + uint256 public counter; + mapping(address => uint256) public escrowCounters; + address public lastEscrow; + address public staking; + uint256 public minimumStake; + address public admin; + + /// @custom:oz-upgrades-gap For future variables + uint256[45] private __gap; + + event Launched( + address indexed token, + address indexed escrow, + string jobRequesterId + ); + event SetStakingAddress(address indexed stakingAddress); + event SetMinimumStake(uint256 minimumStake); + + /// @custom:oz-upgrades-unsafe-allow constructor + constructor() { + _disableInitializers(); + } + + /** + * @notice Initialise the factory (UUPS pattern). + * @param _staking Deployed staking contract. + * @param _minimumStake Minimum stake required to protect an escrow. + * @param _admin Admin address for the factory. + */ + function initialize( + address _staking, + uint256 _minimumStake, + address _admin + ) external payable initializer { + __Ownable_init(); + __UUPSUpgradeable_init(); + + _setStakingAddress(_staking); + _setMinimumStake(_minimumStake); + admin = _admin; + } + + /** + * @notice Deploy a new `EscrowV2` instance. + * @param token Funding token (ERC-20). + * @param jobRequesterId Off-chain tracking identifier. + */ + function createEscrow( + address token, + string memory jobRequesterId + ) external returns (address) { + uint256 availableStake = IStaking(staking).getAvailableStake( + msg.sender + ); + require(availableStake >= minimumStake, 'Insufficient stake'); + + EscrowV2 escrow = new EscrowV2( + token, + msg.sender, + admin, + STANDARD_DURATION + ); + + counter += 1; + escrowCounters[address(escrow)] = counter; + lastEscrow = address(escrow); + + emit Launched(token, lastEscrow, jobRequesterId); + return lastEscrow; + } + + /** @notice Check whether an address is a factory-deployed escrow. */ + function hasEscrow(address _address) external view returns (bool) { + return escrowCounters[_address] != 0; + } + + /** + * @dev Set the Staking address. + * @param _stakingAddress Staking address + */ + function setStakingAddress(address _stakingAddress) external onlyOwner { + _setStakingAddress(_stakingAddress); + } + + function _setStakingAddress(address _stakingAddress) private { + require(_stakingAddress != address(0), ERROR_ZERO_ADDRESS); + staking = _stakingAddress; + emit SetStakingAddress(_stakingAddress); + } + + /** + * @dev Set the minimum stake amount. + * @param _minimumStake Minimum stake + */ + function setMinimumStake(uint256 _minimumStake) external onlyOwner { + _setMinimumStake(_minimumStake); + } + + function _setMinimumStake(uint256 _minimumStake) private { + require(_minimumStake > 0, 'Minimum must be positive'); + minimumStake = _minimumStake; + emit SetMinimumStake(_minimumStake); + } + + /** + * @dev Set the admin address. + * @param _admin Admin address + */ + function setAdmin(address _admin) external onlyOwner { + require(_admin != address(0), ERROR_ZERO_ADDRESS); + admin = _admin; + } + + function _authorizeUpgrade(address) internal override onlyOwner {} +} diff --git a/packages/core/contracts/V2/EscrowV2.sol b/packages/core/contracts/V2/EscrowV2.sol new file mode 100644 index 0000000000..14ee8f2a5f --- /dev/null +++ b/packages/core/contracts/V2/EscrowV2.sol @@ -0,0 +1,456 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.28; + +import '@openzeppelin/contracts/token/ERC20/IERC20.sol'; +import '@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol'; +import '@openzeppelin/contracts/utils/ReentrancyGuard.sol'; + +import './interfaces/IEscrowV2.sol'; + +/** + * @title Escrow Contract + * @dev This contract manages the lifecycle of an escrow, including funding, + * setup, payouts, and completion. + */ +contract EscrowV2 is IEscrowV2, ReentrancyGuard { + using SafeERC20 for IERC20; + + string private constant ERROR_ZERO_ADDRESS = 'Escrow: zero address'; + uint32 private constant BULK_MAX_COUNT = 100; + + event TrustedHandlerAdded(address indexed handler); + event IntermediateStorage(string url, string hash); + event Pending( + string manifest, + string hash, + address reputationOracle, + address recordingOracle, + address exchangeOracle + ); + event BulkTransfer( + bytes32 indexed payoutId, + address[] recipients, + uint256[] amounts, + bool isPartial, + string finalResultsUrl + ); + event Cancelled(); + event Completed(); + event Fund(uint256 amount); + event Withdraw(address token, uint256 amount); + event CancellationRequested(); + event CancellationRefund(uint256 amount); + + EscrowStatuses public override status; + + address public reputationOracle; + address public recordingOracle; + address public exchangeOracle; + + address public immutable launcher; + address public immutable admin; + address public immutable escrowFactory; + address public immutable token; + + uint8 public reputationOracleFeePercentage; + uint8 public recordingOracleFeePercentage; + uint8 public exchangeOracleFeePercentage; + + string public manifestUrl; + string public manifestHash; + + string public intermediateResultsUrl; + + string public finalResultsUrl; + string public finalResultsHash; + + uint256 public duration; + + mapping(bytes32 => bool) private payouts; + + uint256 public remainingFunds; + uint256 public reservedFunds; + + /** + * @param _token Address of the token used in the escrow. + * @param _launcher Creator of the escrow. + * @param _admin Admin address for the escrow. + * @param _duration Escrow lifetime (seconds). + */ + constructor( + address _token, + address _launcher, + address _admin, + uint256 _duration + ) { + require(_launcher != address(0), ERROR_ZERO_ADDRESS); + require(_admin != address(0), ERROR_ZERO_ADDRESS); + require(_token != address(0), ERROR_ZERO_ADDRESS); + require(_duration > 0, 'Duration must be > 0'); + + token = _token; + launcher = _launcher; + admin = _admin; + escrowFactory = msg.sender; + + status = EscrowStatuses.Launched; + duration = _duration + block.timestamp; + } + + /** + * @dev Returns the balance of the escrow contract for the main token. + */ + function getBalance() public view returns (uint256) { + return getTokenBalance(token); + } + + /** + * @dev Returns the balance of the escrow contract for a specific token. + * @param _token Address of the token to check the balance for. + */ + function getTokenBalance(address _token) public view returns (uint256) { + return IERC20(_token).balanceOf(address(this)); + } + + /** + * @dev Sets up the escrow with oracles, manifest and fees. + * @param _reputationOracle Address of the reputation oracle. + * @param _recordingOracle Address of the recording oracle. + * @param _exchangeOracle Address of the exchange oracle. + * @param _reputationOracleFeePercentage Fee percentage for the reputation oracle. + * @param _recordingOracleFeePercentage Fee percentage for the recording oracle. + * @param _exchangeOracleFeePercentage Fee percentage for the exchange oracle. + * @param _url URL for the escrow manifest. + * @param _hash Hash of the escrow manifest. + */ + function setup( + address _reputationOracle, + address _recordingOracle, + address _exchangeOracle, + uint8 _reputationOracleFeePercentage, + uint8 _recordingOracleFeePercentage, + uint8 _exchangeOracleFeePercentage, + string calldata _url, + string calldata _hash + ) external override adminOrLauncher notExpired { + require(_reputationOracle != address(0), 'Invalid reputation oracle'); + require(_recordingOracle != address(0), 'Invalid recording oracle'); + require(_exchangeOracle != address(0), 'Invalid exchange oracle'); + + uint256 totalFeePercentage = _reputationOracleFeePercentage + + _recordingOracleFeePercentage + + _exchangeOracleFeePercentage; + require(totalFeePercentage <= 100, 'Percentage out of bounds'); + require(status == EscrowStatuses.Launched, 'Wrong status'); + + reputationOracle = _reputationOracle; + recordingOracle = _recordingOracle; + exchangeOracle = _exchangeOracle; + + reputationOracleFeePercentage = _reputationOracleFeePercentage; + recordingOracleFeePercentage = _recordingOracleFeePercentage; + exchangeOracleFeePercentage = _exchangeOracleFeePercentage; + + manifestUrl = _url; + manifestHash = _hash; + status = EscrowStatuses.Pending; + + remainingFunds = getBalance(); + require(remainingFunds > 0, 'Zero balance'); + + emit Pending( + _url, + _hash, + _reputationOracle, + _recordingOracle, + _exchangeOracle + ); + emit Fund(remainingFunds); + } + + /** + * @dev Cancels the escrow and transfers remaining funds to the canceler. + * @return bool indicating success of the cancellation. + */ + function cancel() + public + override + adminOrLauncher + notBroke + notComplete + nonReentrant + returns (bool) + { + status = EscrowStatuses.ToCancel; + emit CancellationRequested(); + return true; + } + + /** + * @dev Withdraws excess funds from the escrow for a specific token. + * @param _token Address of the token to withdraw. + * @return bool indicating success of the withdrawal. + */ + function withdraw( + address _token + ) public override adminOrLauncher nonReentrant returns (bool) { + uint256 amount; + if (_token == token) { + uint256 balance = getBalance(); + require(balance > remainingFunds, 'No funds'); + amount = balance - remainingFunds; + } else { + amount = getTokenBalance(_token); + } + IERC20(_token).safeTransfer(msg.sender, amount); + emit Withdraw(_token, amount); + return true; + } + + /** + * @dev Completes the escrow, transferring remaining funds to the launcher. + */ + function complete() external override notExpired adminOrReputationOracle { + require( + status == EscrowStatuses.Paid || status == EscrowStatuses.Partial, + 'Invalid status' + ); + _finalize(); + } + + /** + * @dev Finalizes the escrow, transferring remaining funds to the msg.sender + * and updating the status to Complete or Cancelled. + */ + function _finalize() private { + if (remainingFunds > 0) { + IERC20(token).safeTransfer(launcher, remainingFunds); + remainingFunds = 0; + reservedFunds = 0; + } + if (status == EscrowStatuses.ToCancel) { + status = EscrowStatuses.Cancelled; + emit Cancelled(); + } else { + status = EscrowStatuses.Complete; + emit Completed(); + } + } + + /** + * @dev Stores intermediate results in the escrow. + * @param _url URL of the intermediate results. + * @param _hash Hash of the intermediate results. + * @param _fundsToReserve Amount of funds to reserve for future payouts. + */ + function storeResults( + string calldata _url, + string calldata _hash, + uint256 _fundsToReserve + ) external override adminOrRecordingOracle notExpired { + require( + status == EscrowStatuses.Pending || + status == EscrowStatuses.Partial || + status == EscrowStatuses.ToCancel, + 'Invalid status' + ); + if (_fundsToReserve > 0) { + require(bytes(_url).length != 0, 'Empty URL'); + require(bytes(_hash).length != 0, 'Empty hash'); + } + require( + _fundsToReserve <= remainingFunds - reservedFunds, + 'Insufficient unreserved funds' + ); + + intermediateResultsUrl = _url; + reservedFunds += _fundsToReserve; + + emit IntermediateStorage(_url, _hash); + + if (status == EscrowStatuses.ToCancel) { + uint256 unreservedFunds = remainingFunds - reservedFunds; + if (unreservedFunds > 0) { + IERC20(token).safeTransfer(launcher, unreservedFunds); + emit CancellationRefund(unreservedFunds); + remainingFunds = reservedFunds; + } + if (remainingFunds == 0) { + status = EscrowStatuses.Cancelled; + emit Cancelled(); + } + } + } + + /** + * @dev Bulk payout to multiple recipients. + * @param _recipients Array of recipient addresses. + * @param _amounts Array of amounts to be transferred to each recipient. + * @param _url URL of the final results. + * @param _hash Hash of the final results. + * @param _payoutId Payout ID for tracking. + * @param forceComplete Whether to force completion of the escrow and transfer remaining funds to the launcher. + */ + function bulkPayOut( + address[] calldata _recipients, + uint256[] calldata _amounts, + string calldata _url, + string calldata _hash, + string calldata _payoutId, + bool forceComplete + ) + external + override + adminOrReputationOracle + notBroke + notLaunched + notExpired + nonReentrant + { + bytes32 payoutId = keccak256(bytes(_payoutId)); + require(!payouts[payoutId], 'Payout id already exists'); + require(_recipients.length == _amounts.length, 'Length mismatch'); + require(_amounts.length > 0, 'Empty amounts'); + require(_recipients.length < BULK_MAX_COUNT, 'Too many recipients'); + require( + status != EscrowStatuses.Complete && + status != EscrowStatuses.Cancelled, + 'Invalid status' + ); + require( + bytes(_url).length != 0 && bytes(_hash).length != 0, + 'Empty url/hash' + ); + + uint256 totalBulkAmount; + for (uint256 i; i < _recipients.length; ) { + uint256 amount = _amounts[i]; + require(amount > 0, 'Zero amount'); + totalBulkAmount += amount; + unchecked { + ++i; + } + } + require(totalBulkAmount <= reservedFunds, 'Not enough reserved funds'); + + uint256 totalReputationOracleFee = 0; + uint256 totalRecordingOracleFee = 0; + uint256 totalExchangeOracleFee = 0; + uint256[] memory netAmounts = new uint256[](_recipients.length + 3); + address[] memory eventRecipients = new address[]( + _recipients.length + 3 + ); + + for (uint256 i; i < _recipients.length; ) { + uint256 amount = _amounts[i]; + uint256 reputationOracleFee = (reputationOracleFeePercentage * + amount) / 100; + uint256 recordingOracleFee = (recordingOracleFeePercentage * + amount) / 100; + uint256 exchangeOracleFee = (exchangeOracleFeePercentage * amount) / + 100; + + totalReputationOracleFee += reputationOracleFee; + totalRecordingOracleFee += recordingOracleFee; + totalExchangeOracleFee += exchangeOracleFee; + + netAmounts[i] = + amount - + reputationOracleFee - + recordingOracleFee - + exchangeOracleFee; + eventRecipients[i] = _recipients[i]; + + IERC20(token).safeTransfer(_recipients[i], netAmounts[i]); + unchecked { + ++i; + } + } + + if (reputationOracleFeePercentage > 0) { + IERC20(token).safeTransfer( + reputationOracle, + totalReputationOracleFee + ); + eventRecipients[_recipients.length] = reputationOracle; + netAmounts[_recipients.length] = totalReputationOracleFee; + } + if (recordingOracleFeePercentage > 0) { + IERC20(token).safeTransfer( + recordingOracle, + totalRecordingOracleFee + ); + eventRecipients[_recipients.length + 1] = recordingOracle; + netAmounts[_recipients.length + 1] = totalRecordingOracleFee; + } + if (exchangeOracleFeePercentage > 0) { + IERC20(token).safeTransfer(exchangeOracle, totalExchangeOracleFee); + eventRecipients[_recipients.length + 2] = exchangeOracle; + netAmounts[_recipients.length + 2] = totalExchangeOracleFee; + } + + remainingFunds -= totalBulkAmount; + reservedFunds -= totalBulkAmount; + + finalResultsUrl = _url; + finalResultsHash = _hash; + payouts[payoutId] = true; + + bool isPartial = true; + if (remainingFunds == 0 || forceComplete) { + isPartial = false; + _finalize(); + } else if (status != EscrowStatuses.ToCancel) { + status = EscrowStatuses.Partial; + } + + emit BulkTransfer( + payoutId, + eventRecipients, + netAmounts, + isPartial, + _url + ); + } + + modifier adminOrLauncher() { + require(msg.sender == admin || msg.sender == launcher, 'Unauthorised'); + _; + } + + modifier adminOrReputationOracle() { + require( + msg.sender == admin || msg.sender == reputationOracle, + 'Unauthorised' + ); + _; + } + + modifier adminOrRecordingOracle() { + require( + msg.sender == admin || msg.sender == recordingOracle, + 'Unauthorised' + ); + _; + } + + modifier notBroke() { + require(remainingFunds != 0, 'No funds'); + _; + } + + modifier notComplete() { + require(status != EscrowStatuses.Complete, 'Status Completed'); + _; + } + + modifier notLaunched() { + require(status != EscrowStatuses.Launched, 'Status Launched'); + _; + } + + modifier notExpired() { + require(duration > block.timestamp, 'Expired'); + _; + } +} diff --git a/packages/core/contracts/V2/interfaces/IEscrowV2.sol b/packages/core/contracts/V2/interfaces/IEscrowV2.sol new file mode 100644 index 0000000000..22862de8dc --- /dev/null +++ b/packages/core/contracts/V2/interfaces/IEscrowV2.sol @@ -0,0 +1,48 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.28; + +interface IEscrowV2 { + enum EscrowStatuses { + Launched, + Pending, + Partial, + Paid, + Complete, + Cancelled, + ToCancel + } + + function status() external view returns (EscrowStatuses); + + function setup( + address _reputationOracle, + address _recordingOracle, + address _exchangeOracle, + uint8 _reputationOracleFeePercentage, + uint8 _recordingOracleFeePercentage, + uint8 _exchangeOracleFeePercentage, + string calldata _url, + string calldata _hash + ) external; + + function cancel() external returns (bool); + + function withdraw(address _token) external returns (bool); + + function complete() external; + + function storeResults( + string calldata _url, + string calldata _hash, + uint256 _fundsToReserve + ) external; + + function bulkPayOut( + address[] calldata _recipients, + uint256[] calldata _amounts, + string calldata _url, + string calldata _hash, + string calldata _payoutId, + bool forceComplete + ) external; +} diff --git a/packages/core/contracts/test/EscrowFactoryV0.sol b/packages/core/contracts/test/EscrowFactoryV0.sol index 08f87b486c..7f725d1b9f 100644 --- a/packages/core/contracts/test/EscrowFactoryV0.sol +++ b/packages/core/contracts/test/EscrowFactoryV0.sol @@ -6,7 +6,7 @@ import '@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol'; import '@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol'; import '../interfaces/IStaking.sol'; -import '../Escrow.sol'; +import '../V1/Escrow.sol'; contract EscrowFactoryV0 is OwnableUpgradeable, UUPSUpgradeable { // all Escrows will have this duration. @@ -65,8 +65,7 @@ contract EscrowFactoryV0 is OwnableUpgradeable, UUPSUpgradeable { token, msg.sender, payable(msg.sender), - STANDARD_DURATION, - trustedHandlers + STANDARD_DURATION ); counter++; escrowCounters[address(escrow)] = counter; diff --git a/packages/core/hardhat.config.ts b/packages/core/hardhat.config.ts index 4ed1881cbd..5629e58925 100644 --- a/packages/core/hardhat.config.ts +++ b/packages/core/hardhat.config.ts @@ -56,6 +56,16 @@ const config: HardhatUserConfig = { }, }, }, + { + version: '0.8.28', + settings: { + viaIR: true, + optimizer: { + enabled: true, + runs: 10, + }, + }, + }, ], }, defaultNetwork: 'hardhat', diff --git a/packages/core/test/Escrow.ts b/packages/core/test/V1/Escrow.ts similarity index 100% rename from packages/core/test/Escrow.ts rename to packages/core/test/V1/Escrow.ts diff --git a/packages/core/test/EscrowFactory.ts b/packages/core/test/V1/EscrowFactory.ts similarity index 99% rename from packages/core/test/EscrowFactory.ts rename to packages/core/test/V1/EscrowFactory.ts index c70531b7f6..f18f059d7b 100644 --- a/packages/core/test/EscrowFactory.ts +++ b/packages/core/test/V1/EscrowFactory.ts @@ -2,7 +2,7 @@ import { anyValue } from '@nomicfoundation/hardhat-chai-matchers/withArgs'; import { assert, expect } from 'chai'; import { EventLog, Signer } from 'ethers'; import { ethers, upgrades } from 'hardhat'; -import { EscrowFactory, HMToken, Staking } from '../typechain-types'; +import { EscrowFactory, HMToken, Staking } from '../../typechain-types'; describe('EscrowFactory', function () { let owner: Signer, diff --git a/packages/core/test/V2/EscrowFactoryV2.ts b/packages/core/test/V2/EscrowFactoryV2.ts new file mode 100644 index 0000000000..fcc5534de0 --- /dev/null +++ b/packages/core/test/V2/EscrowFactoryV2.ts @@ -0,0 +1,314 @@ +import { anyValue } from '@nomicfoundation/hardhat-chai-matchers/withArgs'; +import { assert, expect } from 'chai'; +import { EventLog, Signer } from 'ethers'; +import { ethers, upgrades } from 'hardhat'; +import { EscrowFactoryV2, HMToken, Staking } from '../../typechain-types'; + +describe('EscrowFactoryV2', function () { + let owner: Signer, + operator: Signer, + reputationOracle: Signer, + recordingOracle: Signer, + trustedHandlers: string[]; + + let token: HMToken, escrowFactory: EscrowFactoryV2, staking: Staking; + + const jobRequesterId = 'job-requester-id'; + const minimumStake = 5; + const lockPeriod = 2; + const feePercentage = 2; + + const stakeAmount = 10; + + async function createEscrow() { + const result = await ( + await escrowFactory + .connect(operator) + .createEscrow(await token.getAddress(), trustedHandlers, jobRequesterId) + ).wait(); + const event = ( + result?.logs?.find(({ topics }) => + topics.includes(ethers.id('Launched(address,address,string)')) + ) as EventLog + )?.args; + + return event; + } + + async function stakeAndCreateEscrow(staking: Staking) { + await staking.connect(operator).stake(stakeAmount); + + return await createEscrow(); + } + + this.beforeAll(async () => { + [owner, operator, reputationOracle, recordingOracle] = + await ethers.getSigners(); + + trustedHandlers = [ + await reputationOracle.getAddress(), + await recordingOracle.getAddress(), + ]; + + // Deploy HMToken Contract + const HMToken = await ethers.getContractFactory( + 'contracts/HMToken.sol:HMToken' + ); + token = (await HMToken.deploy( + 1000000000, + 'Human Token', + 18, + 'HMT' + )) as HMToken; + + // Send HMT tokens to the operator + await token.connect(owner).transfer(await operator.getAddress(), 1000); + }); + + this.beforeEach(async () => { + // Deploy Staking Contract + const Staking = await ethers.getContractFactory('Staking'); + staking = await Staking.deploy( + await token.getAddress(), + minimumStake, + lockPeriod, + feePercentage + ); + + // Approve spend HMT tokens staking contract + await token.connect(operator).approve(await staking.getAddress(), 1000); + + // Deploy Escrow Factory Contract + const EscrowFactory = await ethers.getContractFactory( + 'contracts/V2/EscrowFactoryV2.sol:EscrowFactoryV2' + ); + + escrowFactory = (await upgrades.deployProxy( + EscrowFactory, + [await staking.getAddress(), minimumStake], + { kind: 'uups', initializer: 'initialize' } + )) as unknown as EscrowFactoryV2; + }); + + describe('deployment', () => { + it('Should set the right counter', async () => { + const initialCounter = await escrowFactory.counter(); + expect(initialCounter.toString()).to.equal('0'); + }); + }); + + it('Operator should not be able to create an escrow without meeting minimum stake', async () => { + await expect( + escrowFactory + .connect(operator) + .createEscrow( + await token.getAddress(), + [await reputationOracle.getAddress()], + jobRequesterId + ) + ).to.be.revertedWith('Insufficient stake'); + }); + + it('Operator should be able to create an escrow after meeting minimum stake', async () => { + const event = await stakeAndCreateEscrow(staking); + + expect(event?.token).to.equal( + await token.getAddress(), + 'token address is correct' + ); + expect(event?.escrow).to.not.be.null; + }); + + it('Should emit an event on launched', async function () { + await staking.connect(operator).stake(stakeAmount); + + await expect( + escrowFactory + .connect(operator) + .createEscrow(await token.getAddress(), trustedHandlers, jobRequesterId) + ) + .to.emit(escrowFactory, 'Launched') + .withArgs(await token.getAddress(), anyValue, jobRequesterId); + }); + + it('Owner should be able to set minimumStake', async () => { + await escrowFactory.connect(owner).setMinimumStake(15); + const minimumStake = await escrowFactory.minimumStake(); + expect(minimumStake).to.equal(15, 'Minimum stake updated correctly'); + }); + + it('Owner should be able to modify staking address', async () => { + const Staking = await ethers.getContractFactory('Staking'); + const newStaking = await Staking.deploy( + await token.getAddress(), + minimumStake, + lockPeriod, + feePercentage + ); + await escrowFactory + .connect(owner) + .setStakingAddress(await newStaking.getAddress()); + const newStakingAddress = await escrowFactory.staking(); + expect(newStakingAddress).to.equal( + await newStaking.getAddress(), + 'Staking address updated correctly' + ); + expect(newStakingAddress).not.to.equal( + await staking.getAddress(), + 'Staking address is different to the previous one' + ); + }); + + it('Operator should not create escrow if new minimumStake is not met', async () => { + await escrowFactory.connect(owner).setMinimumStake(15); + await staking.connect(operator).stake(stakeAmount); + + await expect( + escrowFactory + .connect(operator) + .createEscrow( + await token.getAddress(), + [await reputationOracle.getAddress()], + jobRequesterId + ) + ).to.be.revertedWith('Insufficient stake'); + }); + + it('Operator should be able to create escrow after staking more to meet new minimum', async () => { + await escrowFactory.connect(owner).setMinimumStake(15); + await staking.connect(operator).stake(20); + + const event = await createEscrow(); + + expect(event?.token).to.equal( + await token.getAddress(), + 'token address is correct' + ); + expect(event?.escrow).to.not.be.null; + }); + + it('Should find the newly created escrow from deployed escrow', async () => { + await stakeAndCreateEscrow(staking); + const escrowAddress = await escrowFactory.lastEscrow(); + + const result = await escrowFactory + .connect(operator) + .hasEscrow(escrowAddress); + expect(result).to.equal(true); + }); + + it('Operator should be able to create another escrow after unstaking some of the stakes', async () => { + await stakeAndCreateEscrow(staking); + + staking.connect(operator).unstake(2); + + const event = await createEscrow(); + + expect(event?.token).to.equal( + await token.getAddress(), + 'token address is correct' + ); + expect(event?.escrow).to.not.be.null; + }); + + it('Operator should not be able to create an escrow after unstaking all of the stakes', async () => { + await stakeAndCreateEscrow(staking); + + staking.connect(operator).unstake(stakeAmount); + + await expect( + escrowFactory + .connect(operator) + .createEscrow( + await token.getAddress(), + [await reputationOracle.getAddress()], + jobRequesterId + ) + ).to.be.revertedWith('Insufficient stake'); + }); + + it('Should find the newly created escrow from deployed escrow', async () => { + await stakeAndCreateEscrow(staking); + const escrowAddress = await escrowFactory.lastEscrow(); + + const result = await escrowFactory + .connect(operator) + .hasEscrow(escrowAddress); + expect(result).to.equal(true); + }); + + describe('proxy implementation', function () { + it('Should reject non-owner upgrades', async () => { + const EscrowFactoryV0 = await ethers.getContractFactory( + 'EscrowFactoryV0', + operator + ); + + await expect( + upgrades.upgradeProxy(await escrowFactory.getAddress(), EscrowFactoryV0) + ).to.be.revertedWith('Ownable: caller is not the owner'); + }); + + it('Owner should upgrade correctly', async () => { + const EscrowFactoryV0 = + await ethers.getContractFactory('EscrowFactoryV0'); + const oldImplementationAddress = + await upgrades.erc1967.getImplementationAddress( + await escrowFactory.getAddress() + ); + + await upgrades.upgradeProxy( + await escrowFactory.getAddress(), + EscrowFactoryV0 + ); + + expect( + await upgrades.erc1967.getImplementationAddress( + await escrowFactory.getAddress() + ) + ).to.not.be.equal(oldImplementationAddress); + + const event = await stakeAndCreateEscrow(staking); + + expect(event?.token).to.equal( + await token.getAddress(), + 'token address is correct' + ); + expect(event?.escrow).to.not.be.null; + + try { + escrowFactory.hasEscrow(owner.getAddress()); + // eslint-disable-next-line @typescript-eslint/no-explicit-any + } catch (error: any) { + assert( + error.message === 'newEscrowFactory.hasEscrow is not a function' + ); + } + }); + + it('Should have the same storage', async () => { + await stakeAndCreateEscrow(staking); + + const oldLastEscrow = await escrowFactory.lastEscrow(); + const oldImplementationAddress = + await upgrades.erc1967.getImplementationAddress( + await escrowFactory.getAddress() + ); + + const EscrowFactoryV0 = + await ethers.getContractFactory('EscrowFactoryV0'); + await upgrades.upgradeProxy( + await escrowFactory.getAddress(), + EscrowFactoryV0 + ); + + expect( + await upgrades.erc1967.getImplementationAddress( + await escrowFactory.getAddress() + ) + ).to.not.be.equal(oldImplementationAddress); + + expect(await escrowFactory.lastEscrow()).to.equal(oldLastEscrow); + }); + }); +}); diff --git a/packages/core/test/V2/EscrowV2.ts b/packages/core/test/V2/EscrowV2.ts new file mode 100644 index 0000000000..9d40bef91e --- /dev/null +++ b/packages/core/test/V2/EscrowV2.ts @@ -0,0 +1,1334 @@ +/* eslint-disable @typescript-eslint/no-explicit-any */ +import { anyValue } from '@nomicfoundation/hardhat-chai-matchers/withArgs'; +import { expect } from 'chai'; +import { ethers } from 'hardhat'; +import { EventLog, Signer } from 'ethers'; +import { EscrowV2, HMToken } from '../../typechain-types'; +import { faker } from '@faker-js/faker'; + +const MOCK_URL = faker.internet.url(); +const MOCK_HASH = faker.string.alphanumeric(10); +const BULK_MAX_COUNT = 100; + +enum Status { + Launched = 0, + Pending = 1, + Partial = 2, + Paid = 3, + Complete = 4, + Cancelled = 5, + ToCancel = 6, +} + +let owner: Signer, + launcher: Signer, + reputationOracle: Signer, + recordingOracle: Signer, + exchangeOracle: Signer, + externalAddress: Signer, + restAccounts: Signer[], + trustedHandlers: Signer[]; + +let token: HMToken, escrow: EscrowV2; + +async function deployEscrow() { + // Deploy Escrow Contract + const Escrow = await ethers.getContractFactory( + 'contracts/V2/EscrowV2.sol:EscrowV2' + ); + escrow = (await Escrow.deploy( + await token.getAddress(), + await launcher.getAddress(), + await owner.getAddress(), + 100, + await Promise.all( + trustedHandlers.map(async (handler) => await handler.getAddress()) + ) + )) as EscrowV2; +} + +async function setupEscrow() { + await escrow + .connect(owner) + .setup( + await reputationOracle.getAddress(), + await recordingOracle.getAddress(), + await exchangeOracle.getAddress(), + 3, + 3, + 3, + MOCK_URL, + MOCK_HASH + ); +} + +async function fundEscrow(): Promise { + const amount = ethers.parseEther( + faker.number.int({ min: 50, max: 200 }).toString() + ); + await token.connect(owner).transfer(escrow.getAddress(), amount); + return amount; +} + +async function storeResults(amount: bigint) { + await escrow + .connect(restAccounts[0]) + .storeResults(MOCK_URL, MOCK_HASH, amount); +} + +describe('EscrowV2', function () { + before(async () => { + [ + owner, + launcher, + reputationOracle, + recordingOracle, + exchangeOracle, + externalAddress, + ...restAccounts + ] = await ethers.getSigners(); + + trustedHandlers = [restAccounts[0], restAccounts[1]]; + + // Deploy HMTToken Contract + const HMToken = await ethers.getContractFactory( + 'contracts/HMToken.sol:HMToken' + ); + token = (await HMToken.deploy( + 1000000000, + 'Human Token', + 18, + 'HMT' + )) as HMToken; + }); + + describe('deployment', () => { + before(async () => { + await deployEscrow(); + }); + + it('Should set the right token address', async () => { + const result = await escrow.token(); + expect(result).to.equal(await token.getAddress()); + }); + + it('Should set the right launched status', async () => { + const result = await escrow.status(); + expect(result).to.equal(Status.Launched); + }); + + it('Should set the right escrow balance', async () => { + const result = await escrow.connect(launcher).getBalance(); + expect(result.toString()).to.equal('0'); + }); + + it('Should set the right contract creator', async () => { + const result = await escrow.launcher(); + expect(result).to.equal(await launcher.getAddress()); + }); + + it('Should set the right escrow factory contract', async () => { + const result = await escrow.escrowFactory(); + expect(result).to.equal(await owner.getAddress()); + }); + + it('Should topup and return the right escrow balance', async () => { + const amount = ethers.parseEther( + faker.number.int({ min: 500, max: 2000 }).toString() + ); + await token.connect(owner).transfer(escrow.getAddress(), amount); + + const result = await escrow.connect(launcher).getBalance(); + expect(result).to.equal(amount.toString()); + }); + }); + + describe('addTrustedHandlers', async () => { + before(async () => { + await deployEscrow(); + await fundEscrow(); + await setupEscrow(); + }); + + describe('Validations', function () { + it('Should revert with the right error if caller cannot add trusted handlers', async function () { + await expect( + escrow + .connect(externalAddress) + .addTrustedHandlers([await reputationOracle.getAddress()]) + ).to.be.revertedWith('Untrusted'); + }); + + it('Should revert when adding trusted handlers from reputation oracle', async function () { + await expect( + escrow + .connect(reputationOracle) + .addTrustedHandlers([await externalAddress.getAddress()]) + ).to.be.revertedWith('Untrusted'); + }); + + it('Should revert when adding trusted handlers from recording oracle', async function () { + await expect( + escrow + .connect(recordingOracle) + .addTrustedHandlers([await externalAddress.getAddress()]) + ).to.be.revertedWith('Untrusted'); + }); + }); + + describe('Add trusted handlers', async function () { + it('Should succeed when the contract launcher address trusted handlers and a trusted handler stores results', async () => { + await escrow + .connect(owner) + .addTrustedHandlers([await restAccounts[2].getAddress()]); + + const result = await ( + await escrow + .connect(restAccounts[2]) + .storeResults(MOCK_URL, MOCK_HASH, 50) + ).wait(); + + expect((result?.logs[0] as EventLog).args).to.contain(MOCK_URL); + expect((result?.logs[0] as EventLog).args).to.contain(MOCK_HASH); + }); + + it('Should succeed when add a new trusted handler from trusted handler and a trusted handler stores results', async () => { + await escrow + .connect(trustedHandlers[0]) + .addTrustedHandlers([await restAccounts[3].getAddress()]); + + const result = await ( + await escrow + .connect(restAccounts[3]) + .storeResults(MOCK_URL, MOCK_HASH, 50) + ).wait(); + + expect((result?.logs[0] as EventLog).args).to.contain(MOCK_URL); + expect((result?.logs[0] as EventLog).args).to.contain(MOCK_HASH); + }); + }); + }); + + describe('storeResults', async () => { + describe('Validations', function () { + beforeEach(async () => { + await deployEscrow(); + }); + it('Should revert with the right error if Untrusted', async function () { + await expect( + escrow.connect(externalAddress).storeResults(MOCK_URL, MOCK_HASH, 50) + ).to.be.revertedWith('Unauthorised'); + }); + + it('Should revert with the right error if address calling is reputation oracle', async function () { + await expect( + escrow.connect(reputationOracle).storeResults(MOCK_URL, MOCK_HASH, 50) + ).to.be.revertedWith('Unauthorised'); + }); + + it('Should revert with the right error if escrow not in Pending, Partial or ToCancel status state', async function () { + await escrow + .connect(owner) + .addTrustedHandlers([await reputationOracle.getAddress()]); + await expect( + escrow.connect(reputationOracle).storeResults(MOCK_URL, MOCK_HASH, 50) + ).to.be.revertedWith('Invalid status'); + }); + + it('Should revert with the right error if amount is higher than unreserved funds', async function () { + const fundAmount = await fundEscrow(); + await setupEscrow(); + + await escrow + .connect(owner) + .addTrustedHandlers([await reputationOracle.getAddress()]); + await expect( + escrow + .connect(reputationOracle) + .storeResults(MOCK_URL, MOCK_HASH, fundAmount * 2n) + ).to.be.revertedWith('Insufficient unreserved funds'); + }); + + it('Should succeed if url and hash are empty and amount is 0', async function () { + await deployEscrow(); + await fundEscrow(); + await setupEscrow(); + + await expect(escrow.connect(trustedHandlers[0]).storeResults('', '', 0)) + .not.to.be.reverted; + }); + + it('Should revert if url is empty and amount is not 0', async function () { + await deployEscrow(); + await fundEscrow(); + await setupEscrow(); + + await expect( + escrow.connect(trustedHandlers[0]).storeResults('', MOCK_HASH, 1) + ).to.be.revertedWith('Empty URL'); + }); + + it('Should revert if hash is empty and amount is not 0', async function () { + await deployEscrow(); + await fundEscrow(); + await setupEscrow(); + + await expect( + escrow.connect(trustedHandlers[0]).storeResults(MOCK_URL, '', 1) + ).to.be.revertedWith('Empty hash'); + }); + + it('Should revert if both url and hash are empty and amount is not 0', async function () { + await deployEscrow(); + await fundEscrow(); + await setupEscrow(); + + await expect( + escrow.connect(trustedHandlers[0]).storeResults('', '', 1) + ).to.be.revertedWith('Empty URL'); + }); + }); + + describe('Events', function () { + before(async () => { + await deployEscrow(); + await fundEscrow(); + await setupEscrow(); + }); + + it('Should emit an event on intermediate storage', async function () { + await expect( + await escrow.connect(owner).storeResults(MOCK_URL, MOCK_HASH, 50) + ) + .to.emit(escrow, 'IntermediateStorage') + .withArgs(MOCK_URL, MOCK_HASH); + }); + }); + + describe('Store results', async function () { + let fundAmount: bigint; + beforeEach(async () => { + await deployEscrow(); + fundAmount = await fundEscrow(); + await setupEscrow(); + }); + + it('Should succeed when recording oracle stores results', async () => { + const initialOwnerBalance = await token + .connect(owner) + .balanceOf(launcher.getAddress()); + + const result = await ( + await escrow + .connect(recordingOracle) + .storeResults(MOCK_URL, MOCK_HASH, fundAmount / 2n) + ).wait(); + + const finalOwnerBalance = await token + .connect(owner) + .balanceOf(launcher.getAddress()); + expect((result?.logs[0] as EventLog).args).to.contain(MOCK_URL); + expect((result?.logs[0] as EventLog).args).to.contain(MOCK_HASH); + expect(finalOwnerBalance - initialOwnerBalance).to.equal(0); + expect(await escrow.remainingFunds()).to.equal(fundAmount); + expect(await escrow.reservedFunds()).to.equal(fundAmount / 2n); + }); + + it('Should succeed when a trusted handler stores results', async () => { + const initialOwnerBalance = await token + .connect(owner) + .balanceOf(launcher.getAddress()); + const result = await ( + await escrow + .connect(trustedHandlers[0]) + .storeResults(MOCK_URL, MOCK_HASH, fundAmount / 2n) + ).wait(); + + const finalOwnerBalance = await token + .connect(owner) + .balanceOf(launcher.getAddress()); + expect((result?.logs[0] as EventLog).args).to.contain(MOCK_URL); + expect((result?.logs[0] as EventLog).args).to.contain(MOCK_HASH); + expect(finalOwnerBalance - initialOwnerBalance).to.equal(0); + expect(await escrow.remainingFunds()).to.equal(fundAmount); + expect(await escrow.reservedFunds()).to.equal(fundAmount / 2n); + }); + + it('Should return unreserved funds to escrow launcher when status is ToCancel', async () => { + const initialOwnerBalance = await token + .connect(owner) + .balanceOf(launcher.getAddress()); + await (await escrow.connect(launcher).cancel()).wait(); + const result = await ( + await escrow + .connect(recordingOracle) + .storeResults(MOCK_URL, MOCK_HASH, fundAmount / 2n) + ).wait(); + + expect((result?.logs[0] as EventLog).args).to.contain(MOCK_URL); + expect((result?.logs[0] as EventLog).args).to.contain(MOCK_HASH); + const finalOwnerBalance = await token + .connect(owner) + .balanceOf(launcher.getAddress()); + expect(finalOwnerBalance - initialOwnerBalance).to.equal( + fundAmount / 2n + ); + expect(await escrow.remainingFunds()).to.equal(fundAmount / 2n); + expect(await escrow.reservedFunds()).to.equal(fundAmount / 2n); + }); + + it('Should cancel the escrow if status is ToCancel, fundsToReserve is 0 and unreservedFunds is 0', async () => { + await deployEscrow(); + await fundEscrow(); + await setupEscrow(); + + await escrow.connect(owner).cancel(); + expect(await escrow.status()).to.equal(Status.ToCancel); + + const tx = await escrow + .connect(trustedHandlers[0]) + .storeResults(MOCK_URL, MOCK_HASH, 0); + + await expect(tx).to.emit(escrow, 'CancellationRefund'); + await expect(tx).to.emit(escrow, 'Cancelled'); + expect(await escrow.status()).to.equal(Status.Cancelled); + }); + }); + }); + + describe('setup', () => { + describe('Validations', function () { + before(async () => { + await deployEscrow(); + }); + + it('Should revert with the right error if Untrusted', async function () { + await expect( + escrow + .connect(externalAddress) + .setup( + await reputationOracle.getAddress(), + await recordingOracle.getAddress(), + await exchangeOracle.getAddress(), + 10, + 10, + 10, + MOCK_URL, + MOCK_HASH + ) + ).to.be.revertedWith('Untrusted'); + }); + + it('Should revert with the right error if set invalid or missing reputation oracle address', async function () { + await expect( + escrow + .connect(owner) + .setup( + ethers.ZeroAddress, + await recordingOracle.getAddress(), + await exchangeOracle.getAddress(), + 10, + 10, + 10, + MOCK_URL, + MOCK_HASH + ) + ).to.be.revertedWith('Invalid reputation oracle'); + }); + + it('Should revert with the right error if set invalid or missing recording oracle address', async function () { + await expect( + escrow + .connect(owner) + .setup( + await reputationOracle.getAddress(), + ethers.ZeroAddress, + await exchangeOracle.getAddress(), + 10, + 10, + 10, + MOCK_URL, + MOCK_HASH + ) + ).to.be.revertedWith('Invalid recording oracle'); + }); + + it('Should revert with the right error if set invalid or missing exchange oracle address', async function () { + await expect( + escrow + .connect(owner) + .setup( + await reputationOracle.getAddress(), + await reputationOracle.getAddress(), + ethers.ZeroAddress, + 10, + 10, + 10, + MOCK_URL, + MOCK_HASH + ) + ).to.be.revertedWith('Invalid exchange oracle'); + }); + + it('Should revert with the right error if fee percentage out of bounds and too high', async function () { + await expect( + escrow + .connect(owner) + .setup( + await reputationOracle.getAddress(), + await recordingOracle.getAddress(), + await exchangeOracle.getAddress(), + 40, + 40, + 40, + MOCK_URL, + MOCK_HASH + ) + ).to.be.revertedWith('Percentage out of bounds'); + }); + }); + + describe('Events', function () { + let fundAmount: bigint; + before(async () => { + await deployEscrow(); + fundAmount = await fundEscrow(); + }); + + it('Should emit an event on pending', async function () { + await expect( + escrow + .connect(owner) + .setup( + await reputationOracle.getAddress(), + await recordingOracle.getAddress(), + await exchangeOracle.getAddress(), + 10, + 10, + 10, + MOCK_URL, + MOCK_HASH + ) + ) + .to.emit(escrow, 'Pending') + .withArgs( + MOCK_URL, + MOCK_HASH, + await reputationOracle.getAddress(), + await recordingOracle.getAddress(), + await exchangeOracle.getAddress() + ) + .to.emit(escrow, 'Fund') + .withArgs(fundAmount); + }); + }); + + describe('Setup escrow', async function () { + beforeEach(async () => { + await deployEscrow(); + await fundEscrow(); + }); + + it('Should set correct escrow with params', async () => { + await escrow + .connect(owner) + .setup( + await reputationOracle.getAddress(), + await recordingOracle.getAddress(), + await exchangeOracle.getAddress(), + 10, + 10, + 10, + MOCK_URL, + MOCK_HASH + ); + + expect(await escrow.reputationOracle()).to.equal( + await reputationOracle.getAddress() + ); + expect(await escrow.recordingOracle()).to.equal( + await recordingOracle.getAddress() + ); + expect(await escrow.exchangeOracle()).to.equal( + await exchangeOracle.getAddress() + ); + expect(await escrow.manifestUrl()).to.equal(MOCK_URL); + expect(await escrow.manifestHash()).to.equal(MOCK_HASH); + expect(await escrow.status()).to.equal(Status.Pending); + }); + + it('Should set correct escrow with params by trusted handler', async () => { + await escrow + .connect(trustedHandlers[0]) + .setup( + await reputationOracle.getAddress(), + await recordingOracle.getAddress(), + await exchangeOracle.getAddress(), + 10, + 10, + 10, + MOCK_URL, + MOCK_HASH + ); + + expect(await escrow.reputationOracle()).to.equal( + await reputationOracle.getAddress() + ); + expect(await escrow.recordingOracle()).to.equal( + await recordingOracle.getAddress() + ); + expect(await escrow.exchangeOracle()).to.equal( + await exchangeOracle.getAddress() + ); + expect(await escrow.manifestUrl()).to.equal(MOCK_URL); + expect(await escrow.manifestHash()).to.equal(MOCK_HASH); + expect(await escrow.status()).to.equal(Status.Pending); + }); + }); + }); + + describe('cancel', () => { + describe('Validations', function () { + before(async () => { + await deployEscrow(); + const fundAmount = await fundEscrow(); + await setupEscrow(); + await storeResults(fundAmount); + + await escrow + .connect(owner) + .bulkPayOut( + [await restAccounts[0].getAddress()], + [fundAmount], + MOCK_URL, + MOCK_HASH, + faker.string.uuid(), + false + ); + }); + + it('Should revert with the right error if Untrusted', async function () { + await expect( + escrow.connect(externalAddress).cancel() + ).to.be.revertedWith('Untrusted'); + }); + + it('Should revert with the right error if address calling is reputation oracle', async function () { + await expect( + escrow.connect(reputationOracle).cancel() + ).to.be.revertedWith('Untrusted'); + }); + + it('Should revert with the right error if address calling is recording oracle', async function () { + await expect( + escrow.connect(recordingOracle).cancel() + ).to.be.revertedWith('Untrusted'); + }); + }); + + describe('Cancel escrow', async function () { + beforeEach(async () => { + await deployEscrow(); + await fundEscrow(); + await setupEscrow(); + }); + + it('Should succeed when the contract was canceled', async () => { + await escrow.connect(owner).cancel(); + const status = await escrow.status(); + expect(status).to.equal(Status.ToCancel); + }); + + it('Should succeed when the contract was canceled by trusted handler', async () => { + await escrow.connect(trustedHandlers[0]).cancel(); + const status = await escrow.status(); + expect(status).to.equal(Status.ToCancel); + }); + + it('Should succeed when the contract was canceled', async () => { + await escrow.connect(owner).cancel(); + const status = await escrow.status(); + expect(status).to.equal(Status.ToCancel); + }); + + it('Should succeed when the contract was canceled by trusted handler', async () => { + await escrow.connect(trustedHandlers[0]).cancel(); + const status = await escrow.status(); + expect(status).to.equal(Status.ToCancel); + }); + }); + }); + + describe('bulkPayOut', () => { + describe('Validations', function () { + let fundAmount: bigint; + before(async () => { + await deployEscrow(); + fundAmount = await fundEscrow(); + await setupEscrow(); + await storeResults(fundAmount); + }); + + it('Should revert with the right error if address calling is not trusted', async function () { + const recipients = [await restAccounts[0].getAddress()]; + const amounts = [ + fundAmount / 4n, //1/4 + ]; + + await expect( + escrow + .connect(externalAddress) + .bulkPayOut( + recipients, + amounts, + MOCK_URL, + MOCK_HASH, + faker.string.uuid(), + false + ) + ).to.be.revertedWith('Unauthorised'); + }); + + it('Should revert with the right error if address calling is recording oracle', async function () { + const recipients = [await restAccounts[0].getAddress()]; + const amounts = [ + fundAmount / 4n, //1/4 + ]; + + await expect( + escrow + .connect(recordingOracle) + .bulkPayOut( + recipients, + amounts, + MOCK_URL, + MOCK_HASH, + faker.string.uuid(), + false + ) + ).to.be.revertedWith('Unauthorised'); + }); + + it('Should revert with the right error if amount of recipients more then amount of values', async function () { + const recipients = [ + await restAccounts[0].getAddress(), + await restAccounts[1].getAddress(), + await restAccounts[2].getAddress(), + ]; + const amounts = [ + fundAmount / 4n, //1/4 + fundAmount / 2n, //1/2 + ]; + + await expect( + escrow + .connect(reputationOracle) + .bulkPayOut( + recipients, + amounts, + MOCK_URL, + MOCK_HASH, + faker.string.uuid(), + false + ) + ).to.be.revertedWith('Length mismatch'); + }); + + it('Should revert with the right error if amount of recipients less then amount of values', async function () { + const recipients = [ + await restAccounts[0].getAddress(), + await restAccounts[1].getAddress(), + ]; + const amounts = [ + fundAmount / 4n, //1/4 + fundAmount / 2n, //1/2 + fundAmount / 4n, //1/4 + ]; + + await expect( + escrow + .connect(reputationOracle) + .bulkPayOut( + recipients, + amounts, + MOCK_URL, + MOCK_HASH, + faker.string.uuid(), + false + ) + ).to.be.revertedWith('Length mismatch'); + }); + + it('Should revert with the right error if too many recipients', async function () { + const recipients = Array.from( + new Array(BULK_MAX_COUNT + 1), + () => ethers.ZeroAddress + ); + const amounts = Array.from({ length: BULK_MAX_COUNT + 1 }, () => 1); + + await expect( + escrow + .connect(reputationOracle) + .bulkPayOut( + recipients, + amounts, + MOCK_URL, + MOCK_HASH, + faker.string.uuid(), + false + ) + ).to.be.revertedWith('Too many recipients'); + }); + + it('Should revert with the right error if trying to payout more than reservedFunds', async function () { + const recipients = [ + await restAccounts[0].getAddress(), + await restAccounts[1].getAddress(), + await restAccounts[2].getAddress(), + ]; + const amounts = [ + fundAmount / 4n, //1/4 + fundAmount / 2n, //1/2 + fundAmount / 2n, //1/2 + ]; + + await expect( + escrow + .connect(reputationOracle) + .bulkPayOut( + recipients, + amounts, + MOCK_URL, + MOCK_HASH, + faker.string.uuid(), + false + ) + ).to.be.revertedWith('Not enough reserved funds'); + }); + }); + + describe('Events', function () { + let fundAmount: bigint; + beforeEach(async () => { + await deployEscrow(); + fundAmount = await fundEscrow(); + await setupEscrow(); + await storeResults(fundAmount); + }); + + it('Should emit bulkPayOut and Completed events for complete bulkPayOut', async function () { + const recipients = [await restAccounts[0].getAddress()]; + const amounts = [fundAmount]; + + const tx = await escrow + .connect(owner) + .bulkPayOut( + recipients, + amounts, + MOCK_URL, + MOCK_HASH, + faker.string.uuid(), + false + ); + + await expect(tx) + .to.emit(escrow, 'BulkTransfer') + .withArgs(anyValue, recipients, [fundAmount], false, MOCK_URL); + + await expect(tx).to.emit(escrow, 'Completed'); + }); + + it('Should emit bulkPayOut and Cancelled events for complete bulkPayOut with ToCancel status', async function () { + const recipients = [await restAccounts[0].getAddress()]; + const amounts = [fundAmount]; + + await escrow.connect(owner).cancel(); + + const tx = await escrow + .connect(owner) + .bulkPayOut( + recipients, + amounts, + MOCK_URL, + MOCK_HASH, + faker.string.uuid(), + false + ); + + await expect(tx) + .to.emit(escrow, 'BulkTransfer') + .withArgs(anyValue, recipients, [fundAmount], false, MOCK_URL); + + await expect(tx).to.emit(escrow, 'Cancelled'); + }); + + it('Should emit only bulkPayOut event for partial bulkPayOut', async function () { + const recipients = [await restAccounts[0].getAddress()]; + const amounts = [ + fundAmount / 4n, //1/4 + ]; + + const tx = await escrow + .connect(owner) + .bulkPayOut( + recipients, + amounts, + MOCK_URL, + MOCK_HASH, + faker.string.uuid(), + false + ); + + await expect(tx) + .to.emit(escrow, 'BulkTransfer') + .withArgs(anyValue, recipients, [fundAmount / 4n], true, MOCK_URL); + + await expect(tx).not.to.emit(escrow, 'Completed'); + }); + + it('Should emit bulkPayOut and Completed events for partial bulkPayOut with forceComplete option', async function () { + const recipients = [await restAccounts[0].getAddress()]; + const amounts = [ + fundAmount / 4n, //1/4 + ]; + + const tx = await escrow + .connect(owner) + .bulkPayOut( + recipients, + amounts, + MOCK_URL, + MOCK_HASH, + faker.string.uuid(), + true + ); + + await expect(tx) + .to.emit(escrow, 'BulkTransfer') + .withArgs(anyValue, recipients, [fundAmount / 4n], false, MOCK_URL); + + await expect(tx).to.emit(escrow, 'Completed'); + }); + + it('Should emit bulkPayOut and Cancelled events for partial bulkPayOut with forceComplete option and ToCancel status', async function () { + const recipients = [await restAccounts[0].getAddress()]; + const amounts = [ + fundAmount / 4n, //1/4 + ]; + + await escrow.connect(owner).cancel(); + + const tx = await escrow + .connect(owner) + .bulkPayOut( + recipients, + amounts, + MOCK_URL, + MOCK_HASH, + faker.string.uuid(), + true + ); + + await expect(tx) + .to.emit(escrow, 'BulkTransfer') + .withArgs(anyValue, recipients, [fundAmount / 4n], false, MOCK_URL); + + await expect(tx).to.emit(escrow, 'Cancelled'); + }); + }); + + describe('Bulk payout for recipients', async function () { + let fundAmount: bigint; + beforeEach(async () => { + await deployEscrow(); + fundAmount = await fundEscrow(); + await setupEscrow(); + await storeResults(fundAmount); + }); + + it('Should pay each recipient their corresponding amount', async () => { + const recipients = await Promise.all( + restAccounts.slice(0, 3).map(async (account) => account.getAddress()) + ); + + const initialBalances = await Promise.all( + recipients.map(async (account) => + token.connect(owner).balanceOf(account) + ) + ); + + const initialOracleBalances = await Promise.all( + [recordingOracle, reputationOracle, exchangeOracle].map( + async (oracle) => + token.connect(owner).balanceOf(await oracle.getAddress()) + ) + ); + + const amounts = recipients.map(() => + ethers + .parseEther(faker.number.int({ min: 1, max: 20 }).toString()) + .toString() + ); + + await escrow + .connect(reputationOracle) + .bulkPayOut( + recipients, + amounts, + faker.internet.url(), + faker.string.alphanumeric(10), + faker.string.uuid(), + false + ); + + const finalBalances = await Promise.all( + recipients.map(async (account) => + token.connect(owner).balanceOf(account) + ) + ); + + const finalOracleBalances = await Promise.all( + [recordingOracle, reputationOracle, exchangeOracle].map( + async (oracle) => + token.connect(owner).balanceOf(await oracle.getAddress()) + ) + ); + + const totalPayout = amounts.reduce( + (acc, amount) => acc + BigInt(amount), + 0n + ); + const oracleExpectedFee = (totalPayout * 3n) / 100n; // 3% fee + + recipients.forEach((_, index) => { + const expectedAmount = (BigInt(amounts[index]) * 91n) / 100n; // 91% after all 3 oracle fees + expect( + (finalBalances[index] - initialBalances[index]).toString() + ).to.equal(expectedAmount.toString()); + }); + + initialOracleBalances.forEach((initialBalance, index) => { + expect( + (finalOracleBalances[index] - initialBalance).toString() + ).to.equal(oracleExpectedFee.toString()); + }); + + expect(await escrow.remainingFunds()).to.equal( + await escrow.getBalance() + ); + expect(await escrow.status()).to.equal(Status.Partial); + }); + + it('Should pay each recipient their corresponding amount and return the remaining to launcher with force complete option', async () => { + const recipients = await Promise.all( + restAccounts.slice(0, 3).map(async (account) => account.getAddress()) + ); + + const initialBalances = await Promise.all( + recipients.map(async (account) => + token.connect(owner).balanceOf(account) + ) + ); + + const initialOracleBalances = await Promise.all( + [recordingOracle, reputationOracle, exchangeOracle].map( + async (oracle) => + token.connect(owner).balanceOf(await oracle.getAddress()) + ) + ); + + const amounts = recipients.map(() => + ethers + .parseEther(faker.number.int({ min: 1, max: 20 }).toString()) + .toString() + ); + + await escrow + .connect(reputationOracle) + .bulkPayOut( + recipients, + amounts, + faker.internet.url(), + faker.string.alphanumeric(10), + faker.string.numeric(3), + true + ); + + const finalBalances = await Promise.all( + recipients.map(async (account) => + token.connect(owner).balanceOf(account) + ) + ); + + const finalOracleBalances = await Promise.all( + [recordingOracle, reputationOracle, exchangeOracle].map( + async (oracle) => + token.connect(owner).balanceOf(await oracle.getAddress()) + ) + ); + + const totalPayout = amounts.reduce( + (acc, amount) => acc + BigInt(amount), + 0n + ); + const oracleExpectedFee = (totalPayout * 3n) / 100n; // 3% fee + + recipients.forEach((_, index) => { + const expectedAmount = (BigInt(amounts[index]) * 91n) / 100n; // 91% after all 3 oracle fees + expect( + (finalBalances[index] - initialBalances[index]).toString() + ).to.equal(expectedAmount.toString()); + }); + + initialOracleBalances.forEach((initialBalance, index) => { + expect( + (finalOracleBalances[index] - initialBalance).toString() + ).to.equal(oracleExpectedFee.toString()); + }); + expect(await escrow.remainingFunds()).to.equal('0'); + expect(await escrow.remainingFunds()).to.equal( + await escrow.getBalance() + ); + + expect(await escrow.status()).to.equal(Status.Complete); + }); + + it('Should be completed when amount of payouts is equal to the balance', async () => { + const recipients = [ + await restAccounts[3].getAddress(), + await restAccounts[4].getAddress(), + await restAccounts[5].getAddress(), + ]; + const amounts = [ + fundAmount / 4n, //1/4 + fundAmount / 2n, //1/2 + fundAmount / 4n, //1/4 + ]; + + expect(await escrow.status()).to.equal(Status.Pending); + + await escrow + .connect(reputationOracle) + .bulkPayOut( + recipients, + amounts, + MOCK_URL, + MOCK_HASH, + faker.string.uuid(), + false + ); + expect(await escrow.status()).to.equal(Status.Complete); + }); + + it('Should runs from setup to bulkPayOut to Cancelled correctly with multiple addresses', async () => { + const recipients = [ + await restAccounts[3].getAddress(), + await restAccounts[4].getAddress(), + await restAccounts[5].getAddress(), + ]; + const amounts = [ + fundAmount / 4n, //1/4 + fundAmount / 2n, //1/2 + fundAmount / 4n, //1/4 + ]; + + await escrow.connect(owner).cancel(); + + expect(await escrow.status()).to.equal(Status.ToCancel); + + await escrow + .connect(reputationOracle) + .bulkPayOut( + recipients, + amounts, + MOCK_URL, + MOCK_HASH, + faker.string.uuid(), + false + ); + expect(await escrow.status()).to.equal(Status.Cancelled); + }); + + it('Should runs from setup to bulkPayOut to partial correctly', async () => { + const recipients = [await restAccounts[3].getAddress()]; + const amounts = [ + fundAmount - fundAmount / 5n, //4/5 + ]; + + expect(await escrow.status()).to.equal(Status.Pending); + + await escrow + .connect(reputationOracle) + .bulkPayOut( + recipients, + amounts, + MOCK_URL, + MOCK_HASH, + faker.string.uuid(), + false + ); + expect(await escrow.status()).to.equal(Status.Partial); + }); + + it('Should runs partial bulkPayOut without modifying status if status is ToCancel', async () => { + const recipients = [await restAccounts[3].getAddress()]; + const amounts = [ + fundAmount - fundAmount / 5n, //4/5 + ]; + + await escrow.connect(owner).cancel(); + + expect(await escrow.status()).to.equal(Status.ToCancel); + + await escrow + .connect(reputationOracle) + .bulkPayOut( + recipients, + amounts, + MOCK_URL, + MOCK_HASH, + faker.string.uuid(), + false + ); + expect(await escrow.status()).to.equal(Status.ToCancel); + }); + + it('Should runs from setup to bulkPayOut to partial correctly with multiple addresses', async () => { + const recipients = [ + await restAccounts[3].getAddress(), + await restAccounts[4].getAddress(), + await restAccounts[5].getAddress(), + ]; + const amounts = [ + fundAmount / 4n, //1/4 + fundAmount / 2n, //1/2 + fundAmount / 4n, //1/4 + ]; + + expect(await escrow.status()).to.equal(Status.Pending); + + await escrow + .connect(reputationOracle) + .bulkPayOut( + recipients, + amounts, + MOCK_URL, + MOCK_HASH, + faker.string.uuid(), + false + ); + expect(await escrow.status()).to.equal(Status.Complete); + }); + }); + }); + + describe('complete', () => { + describe('Validations', function () { + beforeEach(async () => { + await deployEscrow(); + const fundAmount = await fundEscrow(); + await setupEscrow(); + await storeResults(fundAmount); + }); + + it('Should revert with the right error if escrow not in Paid, Partial or ToCancel state', async function () { + await expect(escrow.connect(owner).complete()).to.be.revertedWith( + 'Invalid status' + ); + }); + }); + + describe('Events', function () { + let fundAmount: bigint; + beforeEach(async () => { + await deployEscrow(); + fundAmount = await fundEscrow(); + await setupEscrow(); + await storeResults(fundAmount / 4n); + }); + + it('Should emit a Completed event when escrow is completed', async function () { + const recipients = [await restAccounts[0].getAddress()]; + const amounts = [ + fundAmount / 4n, //1/4 + ]; + + await escrow + .connect(owner) + .bulkPayOut( + recipients, + amounts, + MOCK_URL, + MOCK_HASH, + faker.string.uuid(), + false + ); + + await expect(escrow.connect(owner).complete()).to.emit( + escrow, + 'Completed' + ); + }); + }); + + describe('Complete escrow', async function () { + let fundAmount: bigint; + beforeEach(async () => { + await deployEscrow(); + fundAmount = await fundEscrow(); + await setupEscrow(); + await storeResults(fundAmount / 2n); + }); + + it('Should succeed if escrow is in Partial state', async function () { + const recipients = [await restAccounts[0].getAddress()]; + const amounts = [ + fundAmount / 4n, //1/4 + ]; + await escrow + .connect(owner) + .bulkPayOut( + recipients, + amounts, + MOCK_URL, + MOCK_HASH, + faker.string.uuid(), + false + ); + expect(await escrow.status()).to.equal(Status.Partial); + + await escrow.connect(owner).complete(); + expect(await escrow.status()).to.equal(Status.Complete); + expect(await escrow.remainingFunds()).to.equal('0'); + }); + + it('Should transfer remaining funds to launcher on complete', async function () { + const initialLauncherBalance = await token + .connect(owner) + .balanceOf(await launcher.getAddress()); + + const recipients = [await restAccounts[0].getAddress()]; + const amounts = [fundAmount / 2n]; + await escrow + .connect(owner) + .bulkPayOut( + recipients, + amounts, + MOCK_URL, + MOCK_HASH, + faker.string.uuid(), + false + ); + await escrow.connect(owner).complete(); + + const finalLauncherBalance = await token + .connect(owner) + .balanceOf(await launcher.getAddress()); + + expect(finalLauncherBalance - initialLauncherBalance).to.equal( + fundAmount - amounts[0] + ); + }); + }); + }); +}); diff --git a/packages/core/test/DAOSpokeContract.ts b/packages/core/test/governance/DAOSpokeContract.ts similarity index 99% rename from packages/core/test/DAOSpokeContract.ts rename to packages/core/test/governance/DAOSpokeContract.ts index b0ea22a6d3..0e7a8faa65 100644 --- a/packages/core/test/DAOSpokeContract.ts +++ b/packages/core/test/governance/DAOSpokeContract.ts @@ -8,7 +8,7 @@ import { TimelockController, DAOSpokeContract, WormholeMock, -} from '../typechain-types'; +} from '../../typechain-types'; import { createMockUserWithVotingPower, mineNBlocks, diff --git a/packages/core/test/GovernanceTypes.ts b/packages/core/test/governance/GovernanceTypes.ts similarity index 100% rename from packages/core/test/GovernanceTypes.ts rename to packages/core/test/governance/GovernanceTypes.ts diff --git a/packages/core/test/GovernanceUtils.ts b/packages/core/test/governance/GovernanceUtils.ts similarity index 99% rename from packages/core/test/GovernanceUtils.ts rename to packages/core/test/governance/GovernanceUtils.ts index ade3a39739..94cc77ec16 100644 --- a/packages/core/test/GovernanceUtils.ts +++ b/packages/core/test/governance/GovernanceUtils.ts @@ -7,7 +7,7 @@ import { VHMToken, DAOSpokeContract, WormholeMock, -} from '../typechain-types'; +} from '../../typechain-types'; import { IWormholeVM, IWormholeSignature } from './GovernanceTypes'; let owner: Signer; diff --git a/packages/core/test/MetaHumanGovernor.ts b/packages/core/test/governance/MetaHumanGovernor.ts similarity index 99% rename from packages/core/test/MetaHumanGovernor.ts rename to packages/core/test/governance/MetaHumanGovernor.ts index 02c685132f..e546d2079d 100644 --- a/packages/core/test/MetaHumanGovernor.ts +++ b/packages/core/test/governance/MetaHumanGovernor.ts @@ -8,7 +8,7 @@ import { TimelockController, DAOSpokeContract, WormholeMock, -} from '../typechain-types'; +} from '../../typechain-types'; import { createMockUserWithVotingPower, createBasicProposal, diff --git a/packages/core/test/MetaHumanGovernorHubOnly.ts b/packages/core/test/governance/MetaHumanGovernorHubOnly.ts similarity index 99% rename from packages/core/test/MetaHumanGovernorHubOnly.ts rename to packages/core/test/governance/MetaHumanGovernorHubOnly.ts index 189482f6cd..77f22281e0 100644 --- a/packages/core/test/MetaHumanGovernorHubOnly.ts +++ b/packages/core/test/governance/MetaHumanGovernorHubOnly.ts @@ -7,7 +7,7 @@ import { HMToken, TimelockController, WormholeMock, -} from '../typechain-types'; +} from '../../typechain-types'; import { createMockUserWithVotingPower, mineNBlocks, From d5c99b7118f9bdfa66177da44c6d7d79401d1caa Mon Sep 17 00:00:00 2001 From: portuu3 Date: Thu, 17 Jul 2025 08:21:53 +0200 Subject: [PATCH 18/18] escrow v2 tests --- packages/core/test/V2/EscrowV2.ts | 1639 ++++++++++------------------- 1 file changed, 540 insertions(+), 1099 deletions(-) diff --git a/packages/core/test/V2/EscrowV2.ts b/packages/core/test/V2/EscrowV2.ts index 9d40bef91e..089e9fca72 100644 --- a/packages/core/test/V2/EscrowV2.ts +++ b/packages/core/test/V2/EscrowV2.ts @@ -6,9 +6,11 @@ import { EventLog, Signer } from 'ethers'; import { EscrowV2, HMToken } from '../../typechain-types'; import { faker } from '@faker-js/faker'; +const BULK_MAX_COUNT = 100; +const STANDARD_DURATION = 100; + const MOCK_URL = faker.internet.url(); const MOCK_HASH = faker.string.alphanumeric(10); -const BULK_MAX_COUNT = 100; enum Status { Launched = 0, @@ -20,60 +22,72 @@ enum Status { ToCancel = 6, } -let owner: Signer, - launcher: Signer, - reputationOracle: Signer, - recordingOracle: Signer, - exchangeOracle: Signer, - externalAddress: Signer, - restAccounts: Signer[], - trustedHandlers: Signer[]; - -let token: HMToken, escrow: EscrowV2; +let owner: Signer; +let launcher: Signer; +let reputationOracle: Signer; +let recordingOracle: Signer; +let exchangeOracle: Signer; +let external: Signer; +let admin: Signer; +let restAccounts: Signer[]; + +let ownerAddress: string; +let launcherAddress: string; +let reputationOracleAddress: string; +let recordingOracleAddress: string; +let exchangeOracleAddress: string; +let externalAddress: string; +let adminAddress: string; + +let token: HMToken; +let escrow: EscrowV2; +let tokenAddress: string; async function deployEscrow() { - // Deploy Escrow Contract const Escrow = await ethers.getContractFactory( 'contracts/V2/EscrowV2.sol:EscrowV2' ); escrow = (await Escrow.deploy( - await token.getAddress(), - await launcher.getAddress(), - await owner.getAddress(), - 100, - await Promise.all( - trustedHandlers.map(async (handler) => await handler.getAddress()) - ) + tokenAddress, + launcherAddress, + adminAddress, + STANDARD_DURATION )) as EscrowV2; } -async function setupEscrow() { +async function fundEscrow(amount?: bigint): Promise { + const value = amount ?? ethers.parseEther('100'); + await token.connect(owner).transfer(await escrow.getAddress(), value); + return value; +} + +async function setupEscrow( + repFee = 3, + recFee = 3, + excFee = 3, + url: string = MOCK_URL, + hash: string = MOCK_HASH +) { await escrow - .connect(owner) + .connect(launcher) .setup( - await reputationOracle.getAddress(), - await recordingOracle.getAddress(), - await exchangeOracle.getAddress(), - 3, - 3, - 3, - MOCK_URL, - MOCK_HASH + reputationOracleAddress, + recordingOracleAddress, + exchangeOracleAddress, + repFee, + recFee, + excFee, + url, + hash ); } -async function fundEscrow(): Promise { - const amount = ethers.parseEther( - faker.number.int({ min: 50, max: 200 }).toString() - ); - await token.connect(owner).transfer(escrow.getAddress(), amount); - return amount; -} - -async function storeResults(amount: bigint) { - await escrow - .connect(restAccounts[0]) - .storeResults(MOCK_URL, MOCK_HASH, amount); +async function storeResults( + amount: bigint, + url: string = MOCK_URL, + hash: string = MOCK_HASH +) { + await escrow.connect(recordingOracle).storeResults(url, hash, amount); } describe('EscrowV2', function () { @@ -84,13 +98,19 @@ describe('EscrowV2', function () { reputationOracle, recordingOracle, exchangeOracle, - externalAddress, + external, + admin, ...restAccounts ] = await ethers.getSigners(); - trustedHandlers = [restAccounts[0], restAccounts[1]]; + ownerAddress = await owner.getAddress(); + launcherAddress = await launcher.getAddress(); + reputationOracleAddress = await reputationOracle.getAddress(); + recordingOracleAddress = await recordingOracle.getAddress(); + exchangeOracleAddress = await exchangeOracle.getAddress(); + externalAddress = await external.getAddress(); + adminAddress = await admin.getAddress(); - // Deploy HMTToken Contract const HMToken = await ethers.getContractFactory( 'contracts/HMToken.sol:HMToken' ); @@ -100,412 +120,180 @@ describe('EscrowV2', function () { 18, 'HMT' )) as HMToken; + tokenAddress = await token.getAddress(); }); describe('deployment', () => { - before(async () => { + beforeEach(async () => { await deployEscrow(); }); - it('Should set the right token address', async () => { - const result = await escrow.token(); - expect(result).to.equal(await token.getAddress()); - }); - - it('Should set the right launched status', async () => { - const result = await escrow.status(); - expect(result).to.equal(Status.Launched); + it('sets token', async () => { + expect(await escrow.token()).to.equal(tokenAddress); }); - it('Should set the right escrow balance', async () => { - const result = await escrow.connect(launcher).getBalance(); - expect(result.toString()).to.equal('0'); + it('initial status is Launched', async () => { + expect(await escrow.status()).to.equal(Status.Launched); }); - it('Should set the right contract creator', async () => { - const result = await escrow.launcher(); - expect(result).to.equal(await launcher.getAddress()); + it('launcher set correctly', async () => { + expect(await escrow.launcher()).to.equal(launcherAddress); }); - it('Should set the right escrow factory contract', async () => { - const result = await escrow.escrowFactory(); - expect(result).to.equal(await owner.getAddress()); + it('admin set correctly', async () => { + expect(await escrow.admin()).to.equal(adminAddress); }); - it('Should topup and return the right escrow balance', async () => { - const amount = ethers.parseEther( - faker.number.int({ min: 500, max: 2000 }).toString() - ); - await token.connect(owner).transfer(escrow.getAddress(), amount); - - const result = await escrow.connect(launcher).getBalance(); - expect(result).to.equal(amount.toString()); + it('escrowFactory is deployer', async () => { + expect(await escrow.escrowFactory()).to.equal(ownerAddress); }); }); - describe('addTrustedHandlers', async () => { - before(async () => { + describe('setup()', () => { + beforeEach(async () => { await deployEscrow(); - await fundEscrow(); - await setupEscrow(); }); - - describe('Validations', function () { - it('Should revert with the right error if caller cannot add trusted handlers', async function () { + describe('reverts', () => { + it('reverts when called by unauthorized address', async () => { await expect( escrow - .connect(externalAddress) - .addTrustedHandlers([await reputationOracle.getAddress()]) - ).to.be.revertedWith('Untrusted'); - }); - - it('Should revert when adding trusted handlers from reputation oracle', async function () { + .connect(external) + .setup( + reputationOracleAddress, + recordingOracleAddress, + exchangeOracleAddress, + 3, + 3, + 3, + MOCK_URL, + MOCK_HASH + ) + ).to.be.revertedWith('Unauthorised'); await expect( escrow - .connect(reputationOracle) - .addTrustedHandlers([await externalAddress.getAddress()]) - ).to.be.revertedWith('Untrusted'); - }); - - it('Should revert when adding trusted handlers from recording oracle', async function () { + .connect(exchangeOracle) + .setup( + reputationOracleAddress, + recordingOracleAddress, + exchangeOracleAddress, + 3, + 3, + 3, + MOCK_URL, + MOCK_HASH + ) + ).to.be.revertedWith('Unauthorised'); await expect( escrow .connect(recordingOracle) - .addTrustedHandlers([await externalAddress.getAddress()]) - ).to.be.revertedWith('Untrusted'); - }); - }); - - describe('Add trusted handlers', async function () { - it('Should succeed when the contract launcher address trusted handlers and a trusted handler stores results', async () => { - await escrow - .connect(owner) - .addTrustedHandlers([await restAccounts[2].getAddress()]); - - const result = await ( - await escrow - .connect(restAccounts[2]) - .storeResults(MOCK_URL, MOCK_HASH, 50) - ).wait(); - - expect((result?.logs[0] as EventLog).args).to.contain(MOCK_URL); - expect((result?.logs[0] as EventLog).args).to.contain(MOCK_HASH); - }); - - it('Should succeed when add a new trusted handler from trusted handler and a trusted handler stores results', async () => { - await escrow - .connect(trustedHandlers[0]) - .addTrustedHandlers([await restAccounts[3].getAddress()]); - - const result = await ( - await escrow - .connect(restAccounts[3]) - .storeResults(MOCK_URL, MOCK_HASH, 50) - ).wait(); - - expect((result?.logs[0] as EventLog).args).to.contain(MOCK_URL); - expect((result?.logs[0] as EventLog).args).to.contain(MOCK_HASH); - }); - }); - }); - - describe('storeResults', async () => { - describe('Validations', function () { - beforeEach(async () => { - await deployEscrow(); - }); - it('Should revert with the right error if Untrusted', async function () { - await expect( - escrow.connect(externalAddress).storeResults(MOCK_URL, MOCK_HASH, 50) - ).to.be.revertedWith('Unauthorised'); - }); - - it('Should revert with the right error if address calling is reputation oracle', async function () { - await expect( - escrow.connect(reputationOracle).storeResults(MOCK_URL, MOCK_HASH, 50) + .setup( + reputationOracleAddress, + recordingOracleAddress, + exchangeOracleAddress, + 3, + 3, + 3, + MOCK_URL, + MOCK_HASH + ) ).to.be.revertedWith('Unauthorised'); - }); - - it('Should revert with the right error if escrow not in Pending, Partial or ToCancel status state', async function () { - await escrow - .connect(owner) - .addTrustedHandlers([await reputationOracle.getAddress()]); - await expect( - escrow.connect(reputationOracle).storeResults(MOCK_URL, MOCK_HASH, 50) - ).to.be.revertedWith('Invalid status'); - }); - - it('Should revert with the right error if amount is higher than unreserved funds', async function () { - const fundAmount = await fundEscrow(); - await setupEscrow(); - - await escrow - .connect(owner) - .addTrustedHandlers([await reputationOracle.getAddress()]); await expect( escrow .connect(reputationOracle) - .storeResults(MOCK_URL, MOCK_HASH, fundAmount * 2n) - ).to.be.revertedWith('Insufficient unreserved funds'); - }); - - it('Should succeed if url and hash are empty and amount is 0', async function () { - await deployEscrow(); - await fundEscrow(); - await setupEscrow(); - - await expect(escrow.connect(trustedHandlers[0]).storeResults('', '', 0)) - .not.to.be.reverted; - }); - - it('Should revert if url is empty and amount is not 0', async function () { - await deployEscrow(); - await fundEscrow(); - await setupEscrow(); - - await expect( - escrow.connect(trustedHandlers[0]).storeResults('', MOCK_HASH, 1) - ).to.be.revertedWith('Empty URL'); - }); - - it('Should revert if hash is empty and amount is not 0', async function () { - await deployEscrow(); - await fundEscrow(); - await setupEscrow(); - - await expect( - escrow.connect(trustedHandlers[0]).storeResults(MOCK_URL, '', 1) - ).to.be.revertedWith('Empty hash'); - }); - - it('Should revert if both url and hash are empty and amount is not 0', async function () { - await deployEscrow(); - await fundEscrow(); - await setupEscrow(); - - await expect( - escrow.connect(trustedHandlers[0]).storeResults('', '', 1) - ).to.be.revertedWith('Empty URL'); - }); - }); - - describe('Events', function () { - before(async () => { - await deployEscrow(); - await fundEscrow(); - await setupEscrow(); - }); - - it('Should emit an event on intermediate storage', async function () { - await expect( - await escrow.connect(owner).storeResults(MOCK_URL, MOCK_HASH, 50) - ) - .to.emit(escrow, 'IntermediateStorage') - .withArgs(MOCK_URL, MOCK_HASH); - }); - }); - - describe('Store results', async function () { - let fundAmount: bigint; - beforeEach(async () => { - await deployEscrow(); - fundAmount = await fundEscrow(); - await setupEscrow(); - }); - - it('Should succeed when recording oracle stores results', async () => { - const initialOwnerBalance = await token - .connect(owner) - .balanceOf(launcher.getAddress()); - - const result = await ( - await escrow - .connect(recordingOracle) - .storeResults(MOCK_URL, MOCK_HASH, fundAmount / 2n) - ).wait(); - - const finalOwnerBalance = await token - .connect(owner) - .balanceOf(launcher.getAddress()); - expect((result?.logs[0] as EventLog).args).to.contain(MOCK_URL); - expect((result?.logs[0] as EventLog).args).to.contain(MOCK_HASH); - expect(finalOwnerBalance - initialOwnerBalance).to.equal(0); - expect(await escrow.remainingFunds()).to.equal(fundAmount); - expect(await escrow.reservedFunds()).to.equal(fundAmount / 2n); - }); - - it('Should succeed when a trusted handler stores results', async () => { - const initialOwnerBalance = await token - .connect(owner) - .balanceOf(launcher.getAddress()); - const result = await ( - await escrow - .connect(trustedHandlers[0]) - .storeResults(MOCK_URL, MOCK_HASH, fundAmount / 2n) - ).wait(); - - const finalOwnerBalance = await token - .connect(owner) - .balanceOf(launcher.getAddress()); - expect((result?.logs[0] as EventLog).args).to.contain(MOCK_URL); - expect((result?.logs[0] as EventLog).args).to.contain(MOCK_HASH); - expect(finalOwnerBalance - initialOwnerBalance).to.equal(0); - expect(await escrow.remainingFunds()).to.equal(fundAmount); - expect(await escrow.reservedFunds()).to.equal(fundAmount / 2n); - }); - - it('Should return unreserved funds to escrow launcher when status is ToCancel', async () => { - const initialOwnerBalance = await token - .connect(owner) - .balanceOf(launcher.getAddress()); - await (await escrow.connect(launcher).cancel()).wait(); - const result = await ( - await escrow - .connect(recordingOracle) - .storeResults(MOCK_URL, MOCK_HASH, fundAmount / 2n) - ).wait(); - - expect((result?.logs[0] as EventLog).args).to.contain(MOCK_URL); - expect((result?.logs[0] as EventLog).args).to.contain(MOCK_HASH); - const finalOwnerBalance = await token - .connect(owner) - .balanceOf(launcher.getAddress()); - expect(finalOwnerBalance - initialOwnerBalance).to.equal( - fundAmount / 2n - ); - expect(await escrow.remainingFunds()).to.equal(fundAmount / 2n); - expect(await escrow.reservedFunds()).to.equal(fundAmount / 2n); - }); - - it('Should cancel the escrow if status is ToCancel, fundsToReserve is 0 and unreservedFunds is 0', async () => { - await deployEscrow(); - await fundEscrow(); - await setupEscrow(); - - await escrow.connect(owner).cancel(); - expect(await escrow.status()).to.equal(Status.ToCancel); - - const tx = await escrow - .connect(trustedHandlers[0]) - .storeResults(MOCK_URL, MOCK_HASH, 0); - - await expect(tx).to.emit(escrow, 'CancellationRefund'); - await expect(tx).to.emit(escrow, 'Cancelled'); - expect(await escrow.status()).to.equal(Status.Cancelled); - }); - }); - }); - - describe('setup', () => { - describe('Validations', function () { - before(async () => { - await deployEscrow(); - }); - - it('Should revert with the right error if Untrusted', async function () { - await expect( - escrow - .connect(externalAddress) .setup( - await reputationOracle.getAddress(), - await recordingOracle.getAddress(), - await exchangeOracle.getAddress(), - 10, - 10, - 10, + reputationOracleAddress, + recordingOracleAddress, + exchangeOracleAddress, + 3, + 3, + 3, MOCK_URL, MOCK_HASH ) - ).to.be.revertedWith('Untrusted'); + ).to.be.revertedWith('Unauthorised'); }); - it('Should revert with the right error if set invalid or missing reputation oracle address', async function () { + it('reverts on zero reputation oracle', async () => { await expect( escrow - .connect(owner) + .connect(launcher) .setup( ethers.ZeroAddress, - await recordingOracle.getAddress(), - await exchangeOracle.getAddress(), - 10, - 10, - 10, + recordingOracleAddress, + exchangeOracleAddress, + 3, + 3, + 3, MOCK_URL, MOCK_HASH ) ).to.be.revertedWith('Invalid reputation oracle'); }); - it('Should revert with the right error if set invalid or missing recording oracle address', async function () { + it('reverts on zero recording oracle', async () => { await expect( escrow - .connect(owner) + .connect(launcher) .setup( - await reputationOracle.getAddress(), + reputationOracleAddress, ethers.ZeroAddress, - await exchangeOracle.getAddress(), - 10, - 10, - 10, + exchangeOracleAddress, + 3, + 3, + 3, MOCK_URL, MOCK_HASH ) ).to.be.revertedWith('Invalid recording oracle'); }); - it('Should revert with the right error if set invalid or missing exchange oracle address', async function () { + it('reverts on zero exchange oracle', async () => { await expect( escrow - .connect(owner) + .connect(launcher) .setup( - await reputationOracle.getAddress(), - await reputationOracle.getAddress(), + reputationOracleAddress, + recordingOracleAddress, ethers.ZeroAddress, - 10, - 10, - 10, + 3, + 3, + 3, MOCK_URL, MOCK_HASH ) ).to.be.revertedWith('Invalid exchange oracle'); }); - it('Should revert with the right error if fee percentage out of bounds and too high', async function () { + it('reverts if total fee > 100', async () => { await expect( escrow - .connect(owner) + .connect(launcher) .setup( - await reputationOracle.getAddress(), - await recordingOracle.getAddress(), - await exchangeOracle.getAddress(), - 40, - 40, - 40, + reputationOracleAddress, + recordingOracleAddress, + exchangeOracleAddress, + 60, + 30, + 20, MOCK_URL, MOCK_HASH ) ).to.be.revertedWith('Percentage out of bounds'); }); }); - - describe('Events', function () { - let fundAmount: bigint; - before(async () => { - await deployEscrow(); - fundAmount = await fundEscrow(); - }); - - it('Should emit an event on pending', async function () { + describe('succeeds', () => { + it('Launcher: emits Pending + Fund and sets state', async () => { + const amount = await fundEscrow(); await expect( escrow - .connect(owner) + .connect(launcher) .setup( - await reputationOracle.getAddress(), - await recordingOracle.getAddress(), - await exchangeOracle.getAddress(), - 10, - 10, - 10, + reputationOracleAddress, + recordingOracleAddress, + exchangeOracleAddress, + 5, + 5, + 5, MOCK_URL, MOCK_HASH ) @@ -514,650 +302,283 @@ describe('EscrowV2', function () { .withArgs( MOCK_URL, MOCK_HASH, - await reputationOracle.getAddress(), - await recordingOracle.getAddress(), - await exchangeOracle.getAddress() + reputationOracleAddress, + recordingOracleAddress, + exchangeOracleAddress ) .to.emit(escrow, 'Fund') - .withArgs(fundAmount); - }); - }); - - describe('Setup escrow', async function () { - beforeEach(async () => { - await deployEscrow(); - await fundEscrow(); - }); + .withArgs(amount); - it('Should set correct escrow with params', async () => { - await escrow - .connect(owner) - .setup( - await reputationOracle.getAddress(), - await recordingOracle.getAddress(), - await exchangeOracle.getAddress(), - 10, - 10, - 10, - MOCK_URL, - MOCK_HASH - ); - - expect(await escrow.reputationOracle()).to.equal( - await reputationOracle.getAddress() - ); - expect(await escrow.recordingOracle()).to.equal( - await recordingOracle.getAddress() - ); - expect(await escrow.exchangeOracle()).to.equal( - await exchangeOracle.getAddress() - ); + expect(await escrow.status()).to.equal(Status.Pending); expect(await escrow.manifestUrl()).to.equal(MOCK_URL); expect(await escrow.manifestHash()).to.equal(MOCK_HASH); - expect(await escrow.status()).to.equal(Status.Pending); }); + }); - it('Should set correct escrow with params by trusted handler', async () => { - await escrow - .connect(trustedHandlers[0]) + it('Admin: emits Pending + Fund and sets state ', async () => { + const amount = await fundEscrow(); + await expect( + escrow + .connect(admin) .setup( - await reputationOracle.getAddress(), - await recordingOracle.getAddress(), - await exchangeOracle.getAddress(), - 10, - 10, - 10, + reputationOracleAddress, + recordingOracleAddress, + exchangeOracleAddress, + 5, + 5, + 5, MOCK_URL, MOCK_HASH - ); + ) + ) + .to.emit(escrow, 'Pending') + .withArgs( + MOCK_URL, + MOCK_HASH, + reputationOracleAddress, + recordingOracleAddress, + exchangeOracleAddress + ) + .to.emit(escrow, 'Fund') + .withArgs(amount); - expect(await escrow.reputationOracle()).to.equal( - await reputationOracle.getAddress() - ); - expect(await escrow.recordingOracle()).to.equal( - await recordingOracle.getAddress() - ); - expect(await escrow.exchangeOracle()).to.equal( - await exchangeOracle.getAddress() - ); - expect(await escrow.manifestUrl()).to.equal(MOCK_URL); - expect(await escrow.manifestHash()).to.equal(MOCK_HASH); - expect(await escrow.status()).to.equal(Status.Pending); - }); + expect(await escrow.status()).to.equal(Status.Pending); + expect(await escrow.manifestUrl()).to.equal(MOCK_URL); + expect(await escrow.manifestHash()).to.equal(MOCK_HASH); }); }); +}); - describe('cancel', () => { - describe('Validations', function () { - before(async () => { - await deployEscrow(); - const fundAmount = await fundEscrow(); - await setupEscrow(); - await storeResults(fundAmount); - - await escrow - .connect(owner) - .bulkPayOut( - [await restAccounts[0].getAddress()], - [fundAmount], - MOCK_URL, - MOCK_HASH, - faker.string.uuid(), - false - ); - }); - - it('Should revert with the right error if Untrusted', async function () { - await expect( - escrow.connect(externalAddress).cancel() - ).to.be.revertedWith('Untrusted'); - }); - - it('Should revert with the right error if address calling is reputation oracle', async function () { - await expect( - escrow.connect(reputationOracle).cancel() - ).to.be.revertedWith('Untrusted'); - }); - - it('Should revert with the right error if address calling is recording oracle', async function () { - await expect( - escrow.connect(recordingOracle).cancel() - ).to.be.revertedWith('Untrusted'); - }); - }); - - describe('Cancel escrow', async function () { - beforeEach(async () => { - await deployEscrow(); - await fundEscrow(); - await setupEscrow(); - }); - - it('Should succeed when the contract was canceled', async () => { - await escrow.connect(owner).cancel(); - const status = await escrow.status(); - expect(status).to.equal(Status.ToCancel); - }); - - it('Should succeed when the contract was canceled by trusted handler', async () => { - await escrow.connect(trustedHandlers[0]).cancel(); - const status = await escrow.status(); - expect(status).to.equal(Status.ToCancel); - }); - - it('Should succeed when the contract was canceled', async () => { - await escrow.connect(owner).cancel(); - const status = await escrow.status(); - expect(status).to.equal(Status.ToCancel); - }); +describe('storeResults()', () => { + let fundAmt: bigint; + beforeEach(async () => { + await deployEscrow(); + fundAmt = await fundEscrow(); + await setupEscrow(); + }); - it('Should succeed when the contract was canceled by trusted handler', async () => { - await escrow.connect(trustedHandlers[0]).cancel(); - const status = await escrow.status(); - expect(status).to.equal(Status.ToCancel); - }); - }); + it('reverts outside Pending/Partial/ToCancel', async () => { + await escrow.connect(launcher).cancel(); + await escrow.connect(recordingOracle).storeResults(MOCK_URL, MOCK_HASH, 0); + expect(await escrow.status()).to.equal(Status.Cancelled); + await expect( + escrow.connect(recordingOracle).storeResults(MOCK_URL, MOCK_HASH, 0) + ).to.be.revertedWith('Invalid status'); }); - describe('bulkPayOut', () => { - describe('Validations', function () { - let fundAmount: bigint; - before(async () => { - await deployEscrow(); - fundAmount = await fundEscrow(); - await setupEscrow(); - await storeResults(fundAmount); - }); + it('only recording oracle or admin allowed', async () => { + await expect( + escrow.connect(external).storeResults(MOCK_URL, MOCK_HASH, 0) + ).to.be.revertedWith('Unauthorised'); + await expect( + escrow.connect(launcher).storeResults(MOCK_URL, MOCK_HASH, 0) + ).to.be.revertedWith('Unauthorised'); + await expect( + escrow.connect(reputationOracle).storeResults(MOCK_URL, MOCK_HASH, 0) + ).to.be.revertedWith('Unauthorised'); + await expect( + escrow.connect(exchangeOracle).storeResults(MOCK_URL, MOCK_HASH, 0) + ).to.be.revertedWith('Unauthorised'); + }); - it('Should revert with the right error if address calling is not trusted', async function () { - const recipients = [await restAccounts[0].getAddress()]; - const amounts = [ - fundAmount / 4n, //1/4 - ]; + it('reverts if reserving more than unreserved funds', async () => { + await expect( + escrow + .connect(recordingOracle) + .storeResults(MOCK_URL, MOCK_HASH, fundAmt + 1n) + ).to.be.revertedWith('Insufficient unreserved funds'); + }); - await expect( - escrow - .connect(externalAddress) - .bulkPayOut( - recipients, - amounts, - MOCK_URL, - MOCK_HASH, - faker.string.uuid(), - false - ) - ).to.be.revertedWith('Unauthorised'); - }); + it('allows zero reserve with empty url/hash', async () => { + await expect(escrow.connect(recordingOracle).storeResults('', '', 0)).not + .reverted; + }); - it('Should revert with the right error if address calling is recording oracle', async function () { - const recipients = [await restAccounts[0].getAddress()]; - const amounts = [ - fundAmount / 4n, //1/4 - ]; + it('requires url if reserve > 0', async () => { + await expect( + escrow.connect(recordingOracle).storeResults('', MOCK_HASH, 1) + ).to.be.revertedWith('Empty URL'); + }); - await expect( - escrow - .connect(recordingOracle) - .bulkPayOut( - recipients, - amounts, - MOCK_URL, - MOCK_HASH, - faker.string.uuid(), - false - ) - ).to.be.revertedWith('Unauthorised'); - }); + it('requires hash if reserve > 0', async () => { + await expect( + escrow.connect(recordingOracle).storeResults(MOCK_URL, '', 1) + ).to.be.revertedWith('Empty hash'); + }); - it('Should revert with the right error if amount of recipients more then amount of values', async function () { - const recipients = [ - await restAccounts[0].getAddress(), - await restAccounts[1].getAddress(), - await restAccounts[2].getAddress(), - ]; - const amounts = [ - fundAmount / 4n, //1/4 - fundAmount / 2n, //1/2 - ]; + it('updates reservedFunds & emits IntermediateStorage', async () => { + const reserve = fundAmt / 2n; + await expect( + escrow.connect(recordingOracle).storeResults(MOCK_URL, MOCK_HASH, reserve) + ) + .to.emit(escrow, 'IntermediateStorage') + .withArgs(MOCK_URL, MOCK_HASH); + expect(await escrow.reservedFunds()).to.equal(reserve); + expect(await escrow.remainingFunds()).to.equal(fundAmt); + }); - await expect( - escrow - .connect(reputationOracle) - .bulkPayOut( - recipients, - amounts, - MOCK_URL, - MOCK_HASH, - faker.string.uuid(), - false - ) - ).to.be.revertedWith('Length mismatch'); - }); + //TODO: + it('refunds unreserved + cancels if ToCancel & no remaining', async () => { + await escrow.connect(launcher).cancel(); + const reserve = fundAmt / 2n; + const initialBal = await token.balanceOf(launcherAddress); + const tx = await escrow + .connect(recordingOracle) + .storeResults(MOCK_URL, MOCK_HASH, reserve); + await expect(tx).to.emit(escrow, 'CancellationRefund'); + expect(await escrow.remainingFunds()).to.equal(reserve); + expect(await escrow.status()).to.equal(Status.ToCancel); + await escrow + .connect(reputationOracle) + .bulkPayOut( + [await restAccounts[0].getAddress()], + [reserve], + MOCK_URL, + MOCK_HASH, + faker.string.uuid(), + false + ); + const finalBal = await token.balanceOf(launcherAddress); + expect(finalBal - initialBal).to.be.gte(reserve); + }); +}); - it('Should revert with the right error if amount of recipients less then amount of values', async function () { - const recipients = [ - await restAccounts[0].getAddress(), - await restAccounts[1].getAddress(), - ]; - const amounts = [ - fundAmount / 4n, //1/4 - fundAmount / 2n, //1/2 - fundAmount / 4n, //1/4 - ]; +describe('cancel()', () => { + beforeEach(async () => { + await deployEscrow(); + await fundEscrow(); + await setupEscrow(); + }); - await expect( - escrow - .connect(reputationOracle) - .bulkPayOut( - recipients, - amounts, - MOCK_URL, - MOCK_HASH, - faker.string.uuid(), - false - ) - ).to.be.revertedWith('Length mismatch'); - }); + it('only admin or launcher', async () => { + await expect(escrow.connect(external).cancel()).to.be.revertedWith( + 'Unauthorised' + ); + await expect(escrow.connect(reputationOracle).cancel()).to.be.revertedWith( + 'Unauthorised' + ); + await expect(escrow.connect(recordingOracle).cancel()).to.be.revertedWith( + 'Unauthorised' + ); + await expect(escrow.connect(exchangeOracle).cancel()).to.be.revertedWith( + 'Unauthorised' + ); + }); - it('Should revert with the right error if too many recipients', async function () { - const recipients = Array.from( - new Array(BULK_MAX_COUNT + 1), - () => ethers.ZeroAddress - ); - const amounts = Array.from({ length: BULK_MAX_COUNT + 1 }, () => 1); + it('marks status ToCancel & emits request', async () => { + await expect(escrow.connect(launcher).cancel()).to.emit( + escrow, + 'CancellationRequested' + ); + expect(await escrow.status()).to.equal(Status.ToCancel); + }); +}); - await expect( - escrow - .connect(reputationOracle) - .bulkPayOut( - recipients, - amounts, - MOCK_URL, - MOCK_HASH, - faker.string.uuid(), - false - ) - ).to.be.revertedWith('Too many recipients'); - }); +describe('bulkPayOut()', () => { + let fundAmt: bigint; + beforeEach(async () => { + await deployEscrow(); + fundAmt = await fundEscrow(); + await setupEscrow(); + }); - it('Should revert with the right error if trying to payout more than reservedFunds', async function () { - const recipients = [ - await restAccounts[0].getAddress(), - await restAccounts[1].getAddress(), - await restAccounts[2].getAddress(), - ]; - const amounts = [ - fundAmount / 4n, //1/4 - fundAmount / 2n, //1/2 - fundAmount / 2n, //1/2 - ]; + it('reverts if no funds reserved', async () => { + await expect( + escrow + .connect(reputationOracle) + .bulkPayOut( + [await restAccounts[0].getAddress()], + [1], + MOCK_URL, + MOCK_HASH, + faker.string.uuid(), + false + ) + ).to.be.revertedWith('Not enough reserved funds'); + }); - await expect( - escrow - .connect(reputationOracle) - .bulkPayOut( - recipients, - amounts, - MOCK_URL, - MOCK_HASH, - faker.string.uuid(), - false - ) - ).to.be.revertedWith('Not enough reserved funds'); - }); + describe('with reserved funds', () => { + beforeEach(async () => { + await storeResults(fundAmt); }); - describe('Events', function () { - let fundAmount: bigint; - beforeEach(async () => { - await deployEscrow(); - fundAmount = await fundEscrow(); - await setupEscrow(); - await storeResults(fundAmount); - }); - - it('Should emit bulkPayOut and Completed events for complete bulkPayOut', async function () { - const recipients = [await restAccounts[0].getAddress()]; - const amounts = [fundAmount]; - - const tx = await escrow - .connect(owner) - .bulkPayOut( - recipients, - amounts, - MOCK_URL, - MOCK_HASH, - faker.string.uuid(), - false - ); - - await expect(tx) - .to.emit(escrow, 'BulkTransfer') - .withArgs(anyValue, recipients, [fundAmount], false, MOCK_URL); - - await expect(tx).to.emit(escrow, 'Completed'); - }); - - it('Should emit bulkPayOut and Cancelled events for complete bulkPayOut with ToCancel status', async function () { - const recipients = [await restAccounts[0].getAddress()]; - const amounts = [fundAmount]; - - await escrow.connect(owner).cancel(); - - const tx = await escrow - .connect(owner) + it('reverts when caller not admin or reputation oracle', async () => { + await expect( + escrow + .connect(external) .bulkPayOut( - recipients, - amounts, + [await restAccounts[0].getAddress()], + [1], MOCK_URL, MOCK_HASH, faker.string.uuid(), false - ); - - await expect(tx) - .to.emit(escrow, 'BulkTransfer') - .withArgs(anyValue, recipients, [fundAmount], false, MOCK_URL); - - await expect(tx).to.emit(escrow, 'Cancelled'); - }); - - it('Should emit only bulkPayOut event for partial bulkPayOut', async function () { - const recipients = [await restAccounts[0].getAddress()]; - const amounts = [ - fundAmount / 4n, //1/4 - ]; - - const tx = await escrow - .connect(owner) + ) + ).to.be.revertedWith('Unauthorised'); + await expect( + escrow + .connect(recordingOracle) .bulkPayOut( - recipients, - amounts, + [await restAccounts[0].getAddress()], + [1], MOCK_URL, MOCK_HASH, faker.string.uuid(), false - ); - - await expect(tx) - .to.emit(escrow, 'BulkTransfer') - .withArgs(anyValue, recipients, [fundAmount / 4n], true, MOCK_URL); - - await expect(tx).not.to.emit(escrow, 'Completed'); - }); - - it('Should emit bulkPayOut and Completed events for partial bulkPayOut with forceComplete option', async function () { - const recipients = [await restAccounts[0].getAddress()]; - const amounts = [ - fundAmount / 4n, //1/4 - ]; - - const tx = await escrow - .connect(owner) - .bulkPayOut( - recipients, - amounts, - MOCK_URL, - MOCK_HASH, - faker.string.uuid(), - true - ); - - await expect(tx) - .to.emit(escrow, 'BulkTransfer') - .withArgs(anyValue, recipients, [fundAmount / 4n], false, MOCK_URL); - - await expect(tx).to.emit(escrow, 'Completed'); - }); - - it('Should emit bulkPayOut and Cancelled events for partial bulkPayOut with forceComplete option and ToCancel status', async function () { - const recipients = [await restAccounts[0].getAddress()]; - const amounts = [ - fundAmount / 4n, //1/4 - ]; - - await escrow.connect(owner).cancel(); - - const tx = await escrow - .connect(owner) + ) + ).to.be.revertedWith('Unauthorised'); + await expect( + escrow + .connect(launcher) .bulkPayOut( - recipients, - amounts, + [await restAccounts[0].getAddress()], + [1], MOCK_URL, MOCK_HASH, faker.string.uuid(), - true - ); - - await expect(tx) - .to.emit(escrow, 'BulkTransfer') - .withArgs(anyValue, recipients, [fundAmount / 4n], false, MOCK_URL); - - await expect(tx).to.emit(escrow, 'Cancelled'); - }); - }); - - describe('Bulk payout for recipients', async function () { - let fundAmount: bigint; - beforeEach(async () => { - await deployEscrow(); - fundAmount = await fundEscrow(); - await setupEscrow(); - await storeResults(fundAmount); - }); - - it('Should pay each recipient their corresponding amount', async () => { - const recipients = await Promise.all( - restAccounts.slice(0, 3).map(async (account) => account.getAddress()) - ); - - const initialBalances = await Promise.all( - recipients.map(async (account) => - token.connect(owner).balanceOf(account) - ) - ); - - const initialOracleBalances = await Promise.all( - [recordingOracle, reputationOracle, exchangeOracle].map( - async (oracle) => - token.connect(owner).balanceOf(await oracle.getAddress()) - ) - ); - - const amounts = recipients.map(() => - ethers - .parseEther(faker.number.int({ min: 1, max: 20 }).toString()) - .toString() - ); - - await escrow - .connect(reputationOracle) - .bulkPayOut( - recipients, - amounts, - faker.internet.url(), - faker.string.alphanumeric(10), - faker.string.uuid(), false - ); - - const finalBalances = await Promise.all( - recipients.map(async (account) => - token.connect(owner).balanceOf(account) - ) - ); - - const finalOracleBalances = await Promise.all( - [recordingOracle, reputationOracle, exchangeOracle].map( - async (oracle) => - token.connect(owner).balanceOf(await oracle.getAddress()) - ) - ); - - const totalPayout = amounts.reduce( - (acc, amount) => acc + BigInt(amount), - 0n - ); - const oracleExpectedFee = (totalPayout * 3n) / 100n; // 3% fee - - recipients.forEach((_, index) => { - const expectedAmount = (BigInt(amounts[index]) * 91n) / 100n; // 91% after all 3 oracle fees - expect( - (finalBalances[index] - initialBalances[index]).toString() - ).to.equal(expectedAmount.toString()); - }); - - initialOracleBalances.forEach((initialBalance, index) => { - expect( - (finalOracleBalances[index] - initialBalance).toString() - ).to.equal(oracleExpectedFee.toString()); - }); - - expect(await escrow.remainingFunds()).to.equal( - await escrow.getBalance() - ); - expect(await escrow.status()).to.equal(Status.Partial); - }); - - it('Should pay each recipient their corresponding amount and return the remaining to launcher with force complete option', async () => { - const recipients = await Promise.all( - restAccounts.slice(0, 3).map(async (account) => account.getAddress()) - ); - - const initialBalances = await Promise.all( - recipients.map(async (account) => - token.connect(owner).balanceOf(account) ) - ); - - const initialOracleBalances = await Promise.all( - [recordingOracle, reputationOracle, exchangeOracle].map( - async (oracle) => - token.connect(owner).balanceOf(await oracle.getAddress()) - ) - ); - - const amounts = recipients.map(() => - ethers - .parseEther(faker.number.int({ min: 1, max: 20 }).toString()) - .toString() - ); - - await escrow - .connect(reputationOracle) + ).to.be.revertedWith('Unauthorised'); + await expect( + escrow + .connect(exchangeOracle) .bulkPayOut( - recipients, - amounts, - faker.internet.url(), - faker.string.alphanumeric(10), - faker.string.numeric(3), - true - ); - - const finalBalances = await Promise.all( - recipients.map(async (account) => - token.connect(owner).balanceOf(account) - ) - ); - - const finalOracleBalances = await Promise.all( - [recordingOracle, reputationOracle, exchangeOracle].map( - async (oracle) => - token.connect(owner).balanceOf(await oracle.getAddress()) - ) - ); - - const totalPayout = amounts.reduce( - (acc, amount) => acc + BigInt(amount), - 0n - ); - const oracleExpectedFee = (totalPayout * 3n) / 100n; // 3% fee - - recipients.forEach((_, index) => { - const expectedAmount = (BigInt(amounts[index]) * 91n) / 100n; // 91% after all 3 oracle fees - expect( - (finalBalances[index] - initialBalances[index]).toString() - ).to.equal(expectedAmount.toString()); - }); - - initialOracleBalances.forEach((initialBalance, index) => { - expect( - (finalOracleBalances[index] - initialBalance).toString() - ).to.equal(oracleExpectedFee.toString()); - }); - expect(await escrow.remainingFunds()).to.equal('0'); - expect(await escrow.remainingFunds()).to.equal( - await escrow.getBalance() - ); - - expect(await escrow.status()).to.equal(Status.Complete); - }); - - it('Should be completed when amount of payouts is equal to the balance', async () => { - const recipients = [ - await restAccounts[3].getAddress(), - await restAccounts[4].getAddress(), - await restAccounts[5].getAddress(), - ]; - const amounts = [ - fundAmount / 4n, //1/4 - fundAmount / 2n, //1/2 - fundAmount / 4n, //1/4 - ]; - - expect(await escrow.status()).to.equal(Status.Pending); - - await escrow - .connect(reputationOracle) - .bulkPayOut( - recipients, - amounts, + [await restAccounts[0].getAddress()], + [1], MOCK_URL, MOCK_HASH, faker.string.uuid(), false - ); - expect(await escrow.status()).to.equal(Status.Complete); - }); - - it('Should runs from setup to bulkPayOut to Cancelled correctly with multiple addresses', async () => { - const recipients = [ - await restAccounts[3].getAddress(), - await restAccounts[4].getAddress(), - await restAccounts[5].getAddress(), - ]; - const amounts = [ - fundAmount / 4n, //1/4 - fundAmount / 2n, //1/2 - fundAmount / 4n, //1/4 - ]; - - await escrow.connect(owner).cancel(); - - expect(await escrow.status()).to.equal(Status.ToCancel); + ) + ).to.be.revertedWith('Unauthorised'); + }); - await escrow + it('reverts on length mismatch', async () => { + await expect( + escrow .connect(reputationOracle) .bulkPayOut( - recipients, - amounts, + [ + await restAccounts[0].getAddress(), + await restAccounts[1].getAddress(), + ], + [1], MOCK_URL, MOCK_HASH, faker.string.uuid(), false - ); - expect(await escrow.status()).to.equal(Status.Cancelled); - }); - - it('Should runs from setup to bulkPayOut to partial correctly', async () => { - const recipients = [await restAccounts[3].getAddress()]; - const amounts = [ - fundAmount - fundAmount / 5n, //4/5 - ]; - - expect(await escrow.status()).to.equal(Status.Pending); + ) + ).to.be.revertedWith('Length mismatch'); + }); - await escrow + it('reverts on too many recipients', async () => { + const recipients = Array.from( + { length: BULK_MAX_COUNT + 1 }, + () => ethers.ZeroAddress + ); + const amounts = Array.from({ length: BULK_MAX_COUNT + 1 }, () => 1); + await expect( + escrow .connect(reputationOracle) .bulkPayOut( recipients, @@ -1166,169 +587,189 @@ describe('EscrowV2', function () { MOCK_HASH, faker.string.uuid(), false - ); - expect(await escrow.status()).to.equal(Status.Partial); - }); - - it('Should runs partial bulkPayOut without modifying status if status is ToCancel', async () => { - const recipients = [await restAccounts[3].getAddress()]; - const amounts = [ - fundAmount - fundAmount / 5n, //4/5 - ]; - - await escrow.connect(owner).cancel(); - - expect(await escrow.status()).to.equal(Status.ToCancel); + ) + ).to.be.revertedWith('Too many recipients'); + }); - await escrow + it('reverts when payoutId reused', async () => { + const id = faker.string.uuid(); + const r = [await restAccounts[0].getAddress()]; + const a = [1]; + await escrow + .connect(reputationOracle) + .bulkPayOut(r, a, MOCK_URL, MOCK_HASH, id, false); + await expect( + escrow .connect(reputationOracle) - .bulkPayOut( - recipients, - amounts, - MOCK_URL, - MOCK_HASH, - faker.string.uuid(), - false - ); - expect(await escrow.status()).to.equal(Status.ToCancel); - }); + .bulkPayOut(r, a, MOCK_URL, MOCK_HASH, id, false) + ).to.be.revertedWith('Payout id already exists'); + }); - it('Should runs from setup to bulkPayOut to partial correctly with multiple addresses', async () => { - const recipients = [ - await restAccounts[3].getAddress(), - await restAccounts[4].getAddress(), - await restAccounts[5].getAddress(), - ]; - const amounts = [ - fundAmount / 4n, //1/4 - fundAmount / 2n, //1/2 - fundAmount / 4n, //1/4 - ]; + it('partial payout leaves status Partial', async () => { + const r = [await restAccounts[0].getAddress()]; + const a = [fundAmt / 2n]; + await escrow + .connect(reputationOracle) + .bulkPayOut(r, a, MOCK_URL, MOCK_HASH, faker.string.uuid(), false); + expect(await escrow.status()).to.equal(Status.Partial); + }); - expect(await escrow.status()).to.equal(Status.Pending); + it('full payout completes escrow', async () => { + const r = [await restAccounts[0].getAddress()]; + const a = [fundAmt]; + const tx = await escrow + .connect(reputationOracle) + .bulkPayOut(r, a, MOCK_URL, MOCK_HASH, faker.string.uuid(), false); + await expect(tx).to.emit(escrow, 'BulkTransfer'); + await expect(tx).to.emit(escrow, 'Completed'); + expect(await escrow.status()).to.equal(Status.Complete); + }); - await escrow - .connect(reputationOracle) - .bulkPayOut( - recipients, - amounts, - MOCK_URL, - MOCK_HASH, - faker.string.uuid(), - false - ); - expect(await escrow.status()).to.equal(Status.Complete); - }); + it('forceComplete finalizes even if funds remain', async () => { + const r = [await restAccounts[0].getAddress()]; + const a = [fundAmt / 4n]; + const tx = await escrow + .connect(reputationOracle) + .bulkPayOut(r, a, MOCK_URL, MOCK_HASH, faker.string.uuid(), true); + await expect(tx).to.emit(escrow, 'Completed'); + expect(await escrow.status()).to.equal(Status.Complete); }); }); - describe('complete', () => { - describe('Validations', function () { - beforeEach(async () => { - await deployEscrow(); - const fundAmount = await fundEscrow(); - await setupEscrow(); - await storeResults(fundAmount); - }); + describe('with ToCancel status', () => { + beforeEach(async () => { + await storeResults(fundAmt); + await escrow.connect(launcher).cancel(); + }); - it('Should revert with the right error if escrow not in Paid, Partial or ToCancel state', async function () { - await expect(escrow.connect(owner).complete()).to.be.revertedWith( - 'Invalid status' - ); - }); + it('full payout triggers Cancelled', async () => { + const r = [await restAccounts[0]]; + const a = [fundAmt]; + const tx = await escrow + .connect(reputationOracle) + .bulkPayOut(r, a, MOCK_URL, MOCK_HASH, faker.string.uuid(), false); + await expect(tx).to.emit(escrow, 'Cancelled'); + expect(await escrow.status()).to.equal(Status.Cancelled); }); - describe('Events', function () { - let fundAmount: bigint; - beforeEach(async () => { - await deployEscrow(); - fundAmount = await fundEscrow(); - await setupEscrow(); - await storeResults(fundAmount / 4n); - }); + it('partial payout keeps ToCancel unless forceComplete', async () => { + const r = [await restAccounts[0].getAddress()]; + const a = [fundAmt / 2n]; + await escrow + .connect(reputationOracle) + .bulkPayOut(r, a, MOCK_URL, MOCK_HASH, faker.string.uuid(), false); + expect(await escrow.status()).to.equal(Status.ToCancel); + }); - it('Should emit a Completed event when escrow is completed', async function () { - const recipients = [await restAccounts[0].getAddress()]; - const amounts = [ - fundAmount / 4n, //1/4 - ]; + it('partial + forceComplete -> Cancelled', async () => { + const r = [await restAccounts[0].getAddress()]; + const a = [fundAmt / 2n]; + const tx = await escrow + .connect(reputationOracle) + .bulkPayOut(r, a, MOCK_URL, MOCK_HASH, faker.string.uuid(), true); + await expect(tx).to.emit(escrow, 'Cancelled'); + expect(await escrow.status()).to.equal(Status.Cancelled); + }); + }); +}); - await escrow - .connect(owner) - .bulkPayOut( - recipients, - amounts, - MOCK_URL, - MOCK_HASH, - faker.string.uuid(), - false - ); +describe('complete()', () => { + let fundAmt: bigint; + beforeEach(async () => { + await deployEscrow(); + fundAmt = await fundEscrow(); + await setupEscrow(); + await storeResults(fundAmt / 2n); + }); - await expect(escrow.connect(owner).complete()).to.emit( - escrow, - 'Completed' - ); - }); - }); + it('reverts when status not Paid/Partial/ToCancel', async () => { + await expect( + escrow.connect(reputationOracle).complete() + ).to.be.revertedWith('Invalid status'); + }); - describe('Complete escrow', async function () { - let fundAmount: bigint; - beforeEach(async () => { - await deployEscrow(); - fundAmount = await fundEscrow(); - await setupEscrow(); - await storeResults(fundAmount / 2n); - }); + it('completes from Partial', async () => { + const r = [await restAccounts[0].getAddress()]; + const a = [fundAmt / 2n]; + await escrow + .connect(reputationOracle) + .bulkPayOut(r, a, MOCK_URL, MOCK_HASH, faker.string.uuid(), false); + expect(await escrow.status()).to.equal(Status.Partial); + await expect(escrow.connect(reputationOracle).complete()).to.emit( + escrow, + 'Completed' + ); + expect(await escrow.status()).to.equal(Status.Complete); + expect(await escrow.remainingFunds()).to.equal(0n); + }); - it('Should succeed if escrow is in Partial state', async function () { - const recipients = [await restAccounts[0].getAddress()]; - const amounts = [ - fundAmount / 4n, //1/4 - ]; - await escrow - .connect(owner) - .bulkPayOut( - recipients, - amounts, - MOCK_URL, - MOCK_HASH, - faker.string.uuid(), - false - ); - expect(await escrow.status()).to.equal(Status.Partial); + it('transfers remaining funds to launcher on complete', async () => { + const r = [await restAccounts[0].getAddress()]; + const a = [fundAmt / 4n]; + const balBefore = await token.balanceOf(launcherAddress); + await escrow + .connect(reputationOracle) + .bulkPayOut(r, a, MOCK_URL, MOCK_HASH, faker.string.uuid(), false); + await escrow.connect(reputationOracle).complete(); + const balAfter = await token.balanceOf(launcherAddress); + expect(balAfter - balBefore).to.equal(fundAmt - fundAmt / 4n); + }); +}); - await escrow.connect(owner).complete(); - expect(await escrow.status()).to.equal(Status.Complete); - expect(await escrow.remainingFunds()).to.equal('0'); - }); +describe('withdraw()', () => { + beforeEach(async () => { + await deployEscrow(); + await fundEscrow(); + await setupEscrow(); + }); - it('Should transfer remaining funds to launcher on complete', async function () { - const initialLauncherBalance = await token - .connect(owner) - .balanceOf(await launcher.getAddress()); + it('only admin or launcher can withdraw', async () => { + await expect( + escrow.connect(external).withdraw(tokenAddress) + ).to.be.revertedWith('Unauthorised'); + await expect( + escrow.connect(exchangeOracle).withdraw(tokenAddress) + ).to.be.revertedWith('Unauthorised'); + await expect( + escrow.connect(recordingOracle).withdraw(tokenAddress) + ).to.be.revertedWith('Unauthorised'); + await expect( + escrow.connect(reputationOracle).withdraw(tokenAddress) + ).to.be.revertedWith('Unauthorised'); + }); - const recipients = [await restAccounts[0].getAddress()]; - const amounts = [fundAmount / 2n]; - await escrow - .connect(owner) - .bulkPayOut( - recipients, - amounts, - MOCK_URL, - MOCK_HASH, - faker.string.uuid(), - false - ); - await escrow.connect(owner).complete(); + it('withdraws excess tokens above remainingFunds', async () => { + const extra = ethers.parseEther('10'); + await token.connect(owner).transfer(await escrow.getAddress(), extra); + const balBefore = await token.balanceOf(launcherAddress); + await expect(escrow.connect(launcher).withdraw(tokenAddress)).to.emit( + escrow, + 'Withdraw' + ); + const balAfter = await token.balanceOf(launcherAddress); + expect(balAfter - balBefore).to.equal(extra); + }); +}); - const finalLauncherBalance = await token - .connect(owner) - .balanceOf(await launcher.getAddress()); +describe('getters', () => { + beforeEach(async () => { + await deployEscrow(); + await fundEscrow(); + await setupEscrow(); + }); - expect(finalLauncherBalance - initialLauncherBalance).to.equal( - fundAmount - amounts[0] - ); - }); - }); + it('getBalance matches token.balanceOf', async () => { + const bal = await escrow.getBalance(); + const raw = await token.balanceOf(await escrow.getAddress()); + expect(bal).to.equal(raw); + }); + + it('remainingFunds + reservedFunds <= balance', async () => { + const bal = await escrow.getBalance(); + const rem = await escrow.remainingFunds(); + const res = await escrow.reservedFunds?.(); + if (res !== undefined) { + expect(rem + (res as bigint)).to.be.lte(bal); + } }); });