From 8cbc6a720cab16843229eabb225fe768e7ed5e30 Mon Sep 17 00:00:00 2001 From: Grigoriy Simonov Date: Wed, 19 Oct 2022 10:57:45 +0000 Subject: [PATCH] feat: add typechain types generation to tests --- tests/package.json | 4 +- tests/src/eth/allowlist.test.ts | 14 +- tests/src/eth/collectionProperties.test.ts | 16 +- tests/src/eth/collectionSponsoring.test.ts | 18 +- tests/src/eth/nesting/nest.test.ts | 46 +-- tests/src/eth/nonFungible.test.ts | 2 +- tests/src/eth/reFungible.test.ts | 2 +- tests/src/eth/reFungibleToken.test.ts | 20 +- tests/src/eth/types/CollectionHelpersAbi.ts | 82 ++++++ tests/src/eth/types/FungibleAbi.ts | 179 ++++++++++++ tests/src/eth/types/NonFungibleAbi.ts | 288 ++++++++++++++++++ tests/src/eth/types/ReFungibleAbi.ts | 292 +++++++++++++++++++ tests/src/eth/types/ReFungibleTokenAbi.ts | 112 +++++++ tests/src/eth/types/index.ts | 8 + tests/src/eth/types/types.ts | 73 +++++ tests/src/eth/util/playgrounds/unique.dev.ts | 27 +- tests/yarn.lock | 163 ++++++++++- 17 files changed, 1275 insertions(+), 71 deletions(-) create mode 100644 tests/src/eth/types/CollectionHelpersAbi.ts create mode 100644 tests/src/eth/types/FungibleAbi.ts create mode 100644 tests/src/eth/types/NonFungibleAbi.ts create mode 100644 tests/src/eth/types/ReFungibleAbi.ts create mode 100644 tests/src/eth/types/ReFungibleTokenAbi.ts create mode 100644 tests/src/eth/types/index.ts create mode 100644 tests/src/eth/types/types.ts diff --git a/tests/package.json b/tests/package.json index 271b96e1c8..2ed348279d 100644 --- a/tests/package.json +++ b/tests/package.json @@ -16,7 +16,9 @@ "eslint": "^8.25.0", "mocha": "^10.1.0", "ts-node": "^10.9.1", - "typescript": "^4.8.4" + "typescript": "^4.8.4", + "@typechain/web3-v1": "workspace:^6.0.1", + "typechain": "workspace:^8.1.0" }, "mocha": { "timeout": 9999999, diff --git a/tests/src/eth/allowlist.test.ts b/tests/src/eth/allowlist.test.ts index 76c5cfbde7..64727be9e9 100644 --- a/tests/src/eth/allowlist.test.ts +++ b/tests/src/eth/allowlist.test.ts @@ -79,7 +79,7 @@ describe('EVM collection allowlist', () => { const user = helper.eth.createAccount(); const {collectionAddress} = await helper.eth.createNFTCollection(owner, 'A', 'B', 'C'); - const collectionEvm = helper.ethNativeContract.collection(collectionAddress, 'nft', owner); + const collectionEvm = helper.ethNativeContract.nftCollection(collectionAddress, owner); expect(await collectionEvm.methods.allowed(user).call({from: owner})).to.be.false; await collectionEvm.methods.addToCollectionAllowList(user).send({from: owner}); @@ -98,10 +98,10 @@ describe('EVM collection allowlist', () => { // const collectionEvm = helper.ethNativeContract.collection(collectionAddress, 'nft', owner); // expect(await helper.collection.allowed(collectionId, {Substrate: user.address})).to.be.false; - // await collectionEvm.methods.addToCollectionAllowListSubstrate(user.addressRaw).send({from: owner}); + // await collectionEvm.methods.addToCollectionAllowListSubstrate(new BN(user.addressRaw)).send({from: owner}); // expect(await helper.collection.allowed(collectionId, {Substrate: user.address})).to.be.true; - // await collectionEvm.methods.removeFromCollectionAllowListSubstrate(user.addressRaw).send({from: owner}); + // await collectionEvm.methods.removeFromCollectionAllowListSubstrate(new BN(user.addressRaw)).send({from: owner}); // expect(await helper.collection.allowed(collectionId, {Substrate: user.address})).to.be.false; // }); @@ -111,7 +111,7 @@ describe('EVM collection allowlist', () => { const user = helper.eth.createAccount(); const {collectionAddress} = await helper.eth.createNFTCollection(owner, 'A', 'B', 'C'); - const collectionEvm = helper.ethNativeContract.collection(collectionAddress, 'nft', owner); + const collectionEvm = helper.ethNativeContract.nftCollection(collectionAddress, owner); expect(await collectionEvm.methods.allowed(user).call({from: owner})).to.be.false; await expect(collectionEvm.methods.addToCollectionAllowList(user).call({from: notOwner})).to.be.rejectedWith('NoPermission'); @@ -133,12 +133,12 @@ describe('EVM collection allowlist', () => { // const collectionEvm = helper.ethNativeContract.collection(collectionAddress, 'nft', owner); // expect(await helper.collection.allowed(collectionId, {Substrate: user.address})).to.be.false; - // await expect(collectionEvm.methods.addToCollectionAllowListSubstrate(user.addressRaw).call({from: notOwner})).to.be.rejectedWith('NoPermission'); + // await expect(collectionEvm.methods.addToCollectionAllowListSubstrate(new BN(user.addressRaw)).call({from: notOwner})).to.be.rejectedWith('NoPermission'); // expect(await helper.collection.allowed(collectionId, {Substrate: user.address})).to.be.false; - // await collectionEvm.methods.addToCollectionAllowListSubstrate(user.addressRaw).send({from: owner}); + // await collectionEvm.methods.addToCollectionAllowListSubstrate(new BN(user.addressRaw)).send({from: owner}); // expect(await helper.collection.allowed(collectionId, {Substrate: user.address})).to.be.true; - // await expect(collectionEvm.methods.removeFromCollectionAllowListSubstrate(user.addressRaw).call({from: notOwner})).to.be.rejectedWith('NoPermission'); + // await expect(collectionEvm.methods.removeFromCollectionAllowListSubstrate(new BN(user.addressRaw)).call({from: notOwner})).to.be.rejectedWith('NoPermission'); // expect(await helper.collection.allowed(collectionId, {Substrate: user.address})).to.be.true; // }); }); diff --git a/tests/src/eth/collectionProperties.test.ts b/tests/src/eth/collectionProperties.test.ts index 6829627da2..8c7debc8be 100644 --- a/tests/src/eth/collectionProperties.test.ts +++ b/tests/src/eth/collectionProperties.test.ts @@ -86,20 +86,20 @@ describe('Supports ERC721Metadata', () => { const caller = await helper.eth.createAccountWithBalance(donor); const bruh = await helper.eth.createAccountWithBalance(donor); - const BASE_URI = 'base/'; - const SUFFIX = 'suffix1'; - const URI = 'uri1'; + const BASE_URI = 'base/';; + const SUFFIX = 'suffix1';; + const URI = 'uri1';; const collectionHelpers = helper.ethNativeContract.collectionHelpers(caller); - const creatorMethod = mode === 'rft' ? 'createRFTCollection' : 'createNFTCollection'; + const creatorMethod = mode === 'rft' ? 'createRFTCollection' : 'createNFTCollection';; - const {collectionId, collectionAddress} = await helper.eth[creatorMethod](caller, 'n', 'd', 'p'); + const {collectionId, collectionAddress} = await helper.eth[creatorMethod](caller, 'n', 'd', 'p');; const contract = helper.ethNativeContract.collectionById(collectionId, mode, caller); await contract.methods.addCollectionAdmin(bruh).send(); // to check that admin will work too const collection1 = helper.nft.getCollectionObject(collectionId); - const data1 = await collection1.getData(); + const data1 = await collection1.getData();; expect(data1?.raw.flags.erc721metadata).to.be.false; expect(await contract.methods.supportsInterface('0x5b5e139f').call()).to.be.false; @@ -109,10 +109,10 @@ describe('Supports ERC721Metadata', () => { expect(await contract.methods.supportsInterface('0x5b5e139f').call()).to.be.true; const collection2 = helper.nft.getCollectionObject(collectionId); - const data2 = await collection2.getData(); + const data2 = await collection2.getData();; expect(data2?.raw.flags.erc721metadata).to.be.true; - const propertyPermissions = data2?.raw.tokenPropertyPermissions; + const propertyPermissions = data2?.raw.tokenPropertyPermissions;; expect(propertyPermissions?.length).to.equal(2); expect(propertyPermissions.find((tpp: ITokenPropertyPermission) => { diff --git a/tests/src/eth/collectionSponsoring.test.ts b/tests/src/eth/collectionSponsoring.test.ts index df04d80d8d..cfbeabf1ad 100644 --- a/tests/src/eth/collectionSponsoring.test.ts +++ b/tests/src/eth/collectionSponsoring.test.ts @@ -40,7 +40,7 @@ describe('evm collection sponsoring', () => { expect(await helper.balance.getEthereum(minter)).to.equal(0n); const collectionAddress = helper.ethAddress.fromCollectionId(collection.collectionId); - const contract = helper.ethNativeContract.collection(collectionAddress, 'nft', minter); + const contract = helper.ethNativeContract.nftCollection(collectionAddress, minter); await collection.addToAllowList(alice, {Ethereum: minter}); @@ -86,9 +86,9 @@ describe('evm collection sponsoring', () => { const collectionHelpers = helper.ethNativeContract.collectionHelpers(owner); let result = await collectionHelpers.methods.createNFTCollection('Sponsor collection', '1', '1').send({value: Number(2n * nominal)}); - const collectionIdAddress = helper.ethAddress.normalizeAddress(result.events.CollectionCreated.returnValues.collectionId); + const collectionIdAddress = helper.ethAddress.normalizeAddress(result.events!.CollectionCreated.returnValues.collectionId); const sponsor = await helper.eth.createAccountWithBalance(donor); - const collectionEvm = helper.ethNativeContract.collection(collectionIdAddress, 'nft', owner); + const collectionEvm = helper.ethNativeContract.nftCollection(collectionIdAddress, owner); expect(await collectionEvm.methods.hasCollectionPendingSponsor().call({from: owner})).to.be.false; result = await collectionEvm.methods.setCollectionSponsor(sponsor).send({from: owner}); @@ -100,7 +100,7 @@ describe('evm collection sponsoring', () => { await collectionEvm.methods.removeCollectionSponsor().send({from: owner}); const sponsorTuple = await collectionEvm.methods.collectionSponsor().call({from: owner}); - expect(sponsorTuple.field_0).to.be.eq('0x0000000000000000000000000000000000000000'); + expect(sponsorTuple[0]).to.be.eq('0x0000000000000000000000000000000000000000'); }); itEth('Sponsoring collection from evm address via access list', async ({helper}) => { @@ -110,7 +110,7 @@ describe('evm collection sponsoring', () => { const collection = helper.nft.getCollectionObject(collectionId); const sponsor = await helper.eth.createAccountWithBalance(donor); - const collectionEvm = helper.ethNativeContract.collection(collectionAddress, 'nft', owner); + const collectionEvm = helper.ethNativeContract.nftCollection(collectionAddress, owner); await collectionEvm.methods.setCollectionSponsor(sponsor).send({from: owner}); let collectionData = (await collection.getData())!; @@ -227,14 +227,14 @@ describe('evm collection sponsoring', () => { const {collectionAddress, collectionId} = await helper.eth.createERC721MetadataCompatibleNFTCollection(owner,'Sponsor collection', '1', '1', ''); const collection = helper.nft.getCollectionObject(collectionId); const sponsor = await helper.eth.createAccountWithBalance(donor); - const collectionEvm = helper.ethNativeContract.collection(collectionAddress, 'nft', owner); + const collectionEvm = helper.ethNativeContract.nftCollection(collectionAddress, owner); await collectionEvm.methods.setCollectionSponsor(sponsor).send(); let collectionData = (await collection.getData())!; expect(collectionData.raw.sponsorship.Unconfirmed).to.be.eq(helper.address.ethToSubstrate(sponsor, true)); await expect(collectionEvm.methods.confirmCollectionSponsorship().call()).to.be.rejectedWith('caller is not set as sponsor'); - const sponsorCollection = helper.ethNativeContract.collection(collectionAddress, 'nft', sponsor); + const sponsorCollection = helper.ethNativeContract.nftCollection(collectionAddress, sponsor); await sponsorCollection.methods.confirmCollectionSponsorship().send(); collectionData = (await collection.getData())!; expect(collectionData.raw.sponsorship.Confirmed).to.be.eq(helper.address.ethToSubstrate(sponsor, true)); @@ -245,10 +245,10 @@ describe('evm collection sponsoring', () => { const ownerBalanceBefore = await helper.balance.getSubstrate(helper.address.ethToSubstrate(owner)); const sponsorBalanceBefore = await helper.balance.getSubstrate(helper.address.ethToSubstrate(sponsor)); - const userCollectionEvm = helper.ethNativeContract.collection(collectionAddress, 'nft', user); + const userCollectionEvm = helper.ethNativeContract.nftCollection(collectionAddress, user); const result = await userCollectionEvm.methods.mintWithTokenURI(user, 'Test URI').send(); - const tokenId = result.events.Transfer.returnValues.tokenId; + const tokenId = result.events!.Transfer.returnValues.tokenId; const events = helper.eth.normalizeEvents(result.events); const address = helper.ethAddress.fromCollectionId(collectionId); diff --git a/tests/src/eth/nesting/nest.test.ts b/tests/src/eth/nesting/nest.test.ts index dfa5d9f6b3..2edf3e8134 100644 --- a/tests/src/eth/nesting/nest.test.ts +++ b/tests/src/eth/nesting/nest.test.ts @@ -1,16 +1,16 @@ import {IKeyringPair} from '@polkadot/types/types'; -import {Contract} from 'web3-eth-contract'; +import {NonFungibleAbi} from '../types'; import {itEth, EthUniqueHelper, usingEthPlaygrounds, expect} from '../util'; const createNestingCollection = async ( helper: EthUniqueHelper, owner: string, -): Promise<{ collectionId: number, collectionAddress: string, contract: Contract }> => { +): Promise<{ collectionId: number, collectionAddress: string, contract: NonFungibleAbi }> => { const {collectionAddress, collectionId} = await helper.eth.createNFTCollection(owner, 'A', 'B', 'C'); - const contract = helper.ethNativeContract.collection(collectionAddress, 'nft', owner); - await contract.methods.setCollectionNesting(true).send({from: owner}); + const contract = helper.ethNativeContract.nftCollection(collectionAddress, owner); + await contract.methods['setCollectionNesting(bool)'](true).send({from: owner}); return {collectionId, collectionAddress, contract}; }; @@ -32,17 +32,17 @@ describe('EVM nesting tests group', () => { // Create a token to be nested to const mintingTargetNFTTokenIdResult = await contract.methods.mint(owner).send({from: owner}); - const targetNFTTokenId = mintingTargetNFTTokenIdResult.events.Transfer.returnValues.tokenId; - const targetNftTokenAddress = helper.ethAddress.fromTokenId(collectionId, targetNFTTokenId); + const targetNFTTokenId = mintingTargetNFTTokenIdResult.events!.Transfer.returnValues.tokenId; + const targetNftTokenAddress = helper.ethAddress.fromTokenId(collectionId, Number(targetNFTTokenId)); // Create a nested token const mintingFirstTokenIdResult = await contract.methods.mint(targetNftTokenAddress).send({from: owner}); - const firstTokenId = mintingFirstTokenIdResult.events.Transfer.returnValues.tokenId; + const firstTokenId = mintingFirstTokenIdResult.events!.Transfer.returnValues.tokenId; expect(await contract.methods.ownerOf(firstTokenId).call()).to.be.equal(targetNftTokenAddress); // Create a token to be nested and nest const mintingSecondTokenIdResult = await contract.methods.mint(owner).send({from: owner}); - const secondTokenId = mintingSecondTokenIdResult.events.Transfer.returnValues.tokenId; + const secondTokenId = mintingSecondTokenIdResult.events!.Transfer.returnValues.tokenId; await contract.methods.transfer(targetNftTokenAddress, secondTokenId).send({from: owner}); expect(await contract.methods.ownerOf(secondTokenId).call()).to.be.equal(targetNftTokenAddress); @@ -57,20 +57,20 @@ describe('EVM nesting tests group', () => { const {collectionId: collectionIdA, collectionAddress: collectionAddressA, contract: contractA} = await createNestingCollection(helper, owner); const {collectionAddress: collectionAddressB, contract: contractB} = await createNestingCollection(helper, owner); - await contractA.methods.setCollectionNesting(true, [collectionAddressA, collectionAddressB]).send({from: owner}); + await contractA.methods['setCollectionNesting(bool,address[])'](true, [collectionAddressA, collectionAddressB]).send({from: owner}); // Create a token to nest into const mintingtargetNftTokenIdResult = await contractA.methods.mint(owner).send({from: owner}); - const targetNftTokenId = mintingtargetNftTokenIdResult.events.Transfer.returnValues.tokenId; + const targetNftTokenId = mintingtargetNftTokenIdResult.events!.Transfer.returnValues.tokenId; const nftTokenAddressA1 = helper.ethAddress.fromTokenId(collectionIdA, targetNftTokenId); // Create a token for nesting in the same collection as the target const mintingTokenIdAResult = await contractA.methods.mint(owner).send({from: owner}); - const nftTokenIdA = mintingTokenIdAResult.events.Transfer.returnValues.tokenId; + const nftTokenIdA = mintingTokenIdAResult.events!.Transfer.returnValues.tokenId; // Create a token for nesting in a different collection const mintingTokenIdBResult = await contractB.methods.mint(owner).send({from: owner}); - const nftTokenIdB = mintingTokenIdBResult.events.Transfer.returnValues.tokenId; + const nftTokenIdB = mintingTokenIdBResult.events!.Transfer.returnValues.tokenId; // Nest await contractA.methods.transfer(nftTokenAddressA1, nftTokenIdA).send({from: owner}); @@ -86,16 +86,16 @@ describe('EVM nesting tests group', () => { const owner = await helper.eth.createAccountWithBalance(donor); const {collectionId, contract} = await createNestingCollection(helper, owner); - await contract.methods.setCollectionNesting(false).send({from: owner}); + await contract.methods['setCollectionNesting(bool)'](false).send({from: owner}); // Create a token to nest into const mintingTargetTokenIdResult = await contract.methods.mint(owner).send({from: owner}); - const targetTokenId = mintingTargetTokenIdResult.events.Transfer.returnValues.tokenId; + const targetTokenId = mintingTargetTokenIdResult.events!.Transfer.returnValues.tokenId; const targetNftTokenAddress = helper.ethAddress.fromTokenId(collectionId, targetTokenId); // Create a token to nest const mintingNftTokenIdResult = await contract.methods.mint(owner).send({from: owner}); - const nftTokenId = mintingNftTokenIdResult.events.Transfer.returnValues.tokenId; + const nftTokenId = mintingNftTokenIdResult.events!.Transfer.returnValues.tokenId; // Try to nest await expect(contract.methods @@ -111,12 +111,12 @@ describe('EVM nesting tests group', () => { // Mint a token const mintingTargetTokenIdResult = await contract.methods.mint(owner).send({from: owner}); - const targetTokenId = mintingTargetTokenIdResult.events.Transfer.returnValues.tokenId; + const targetTokenId = mintingTargetTokenIdResult.events!.Transfer.returnValues.tokenId; const targetTokenAddress = helper.ethAddress.fromTokenId(collectionId, targetTokenId); // Mint a token belonging to a different account const mintingTokenIdResult = await contract.methods.mint(malignant).send({from: owner}); - const tokenId = mintingTokenIdResult.events.Transfer.returnValues.tokenId; + const tokenId = mintingTokenIdResult.events!.Transfer.returnValues.tokenId; // Try to nest one token in another as a non-owner account await expect(contract.methods @@ -131,16 +131,16 @@ describe('EVM nesting tests group', () => { const {collectionId: collectionIdA, collectionAddress: collectionAddressA, contract: contractA} = await createNestingCollection(helper, owner); const {collectionAddress: collectionAddressB, contract: contractB} = await createNestingCollection(helper, owner); - await contractA.methods.setCollectionNesting(true, [collectionAddressA, collectionAddressB]).send({from: owner}); + await contractA.methods['setCollectionNesting(bool,address[])'](true, [collectionAddressA, collectionAddressB]).send({from: owner}); // Create a token in one collection const mintingTokenIdAResult = await contractA.methods.mint(owner).send({from: owner}); - const nftTokenIdA = mintingTokenIdAResult.events.Transfer.returnValues.tokenId; + const nftTokenIdA = mintingTokenIdAResult.events!.Transfer.returnValues.tokenId; const nftTokenAddressA = helper.ethAddress.fromTokenId(collectionIdA, nftTokenIdA); // Create a token in another collection const mintingTokenIdBResult = await contractB.methods.mint(malignant).send({from: owner}); - const nftTokenIdB = mintingTokenIdBResult.events.Transfer.returnValues.tokenId; + const nftTokenIdB = mintingTokenIdBResult.events!.Transfer.returnValues.tokenId; // Try to drag someone else's token into the other collection and nest await expect(contractB.methods @@ -154,16 +154,16 @@ describe('EVM nesting tests group', () => { const {collectionId: collectionIdA, collectionAddress: collectionAddressA, contract: contractA} = await createNestingCollection(helper, owner); const {contract: contractB} = await createNestingCollection(helper, owner); - await contractA.methods.setCollectionNesting(true, [collectionAddressA]).send({from: owner}); + await contractA.methods['setCollectionNesting(bool,address[])'](true, [collectionAddressA]).send({from: owner}); // Create a token in one collection const mintingTokenIdAResult = await contractA.methods.mint(owner).send({from: owner}); - const nftTokenIdA = mintingTokenIdAResult.events.Transfer.returnValues.tokenId; + const nftTokenIdA = mintingTokenIdAResult.events!.Transfer.returnValues.tokenId; const nftTokenAddressA = helper.ethAddress.fromTokenId(collectionIdA, nftTokenIdA); // Create a token in another collection const mintingTokenIdBResult = await contractB.methods.mint(owner).send({from: owner}); - const nftTokenIdB = mintingTokenIdBResult.events.Transfer.returnValues.tokenId; + const nftTokenIdB = mintingTokenIdBResult.events!.Transfer.returnValues.tokenId; // Try to nest into a token in the other collection, disallowed in the first diff --git a/tests/src/eth/nonFungible.test.ts b/tests/src/eth/nonFungible.test.ts index 5b74d7b448..78c57e2702 100644 --- a/tests/src/eth/nonFungible.test.ts +++ b/tests/src/eth/nonFungible.test.ts @@ -105,7 +105,7 @@ describe('Check ERC721 token URI for NFT', () => { await contract.methods.setProperty(tokenId, propertyKey, Buffer.from(propertyValue)).send(); } - const event = result.events.Transfer; + const event = result.events!.Transfer; expect(event.address).to.be.equal(collectionAddress); expect(event.returnValues.from).to.be.equal('0x0000000000000000000000000000000000000000'); expect(event.returnValues.to).to.be.equal(receiver); diff --git a/tests/src/eth/reFungible.test.ts b/tests/src/eth/reFungible.test.ts index 0e6ad142e3..8fdbd644cf 100644 --- a/tests/src/eth/reFungible.test.ts +++ b/tests/src/eth/reFungible.test.ts @@ -197,7 +197,7 @@ describe('Refungible: Plain calls', () => { { const tokenEvents: any = []; - tokenContract.events.allEvents((_: any, event: any) => { + tokenContract.events.allEvents(undefined, (_: any, event: any) => { tokenEvents.push(event); }); const result = await contract.methods.transferFrom(caller, receiver, tokenId).send(); diff --git a/tests/src/eth/reFungibleToken.test.ts b/tests/src/eth/reFungibleToken.test.ts index c9f41c95a7..ebbf52c12f 100644 --- a/tests/src/eth/reFungibleToken.test.ts +++ b/tests/src/eth/reFungibleToken.test.ts @@ -85,7 +85,7 @@ describe('Check ERC721 token URI for ReFungible', () => { const result = await contract.methods.mint(receiver).send(); - const event = result.events.Transfer; + const event = result.events!.Transfer; const tokenId = event.returnValues.tokenId; expect(tokenId).to.be.equal('1'); expect(event.address).to.be.equal(collectionAddress); @@ -146,7 +146,7 @@ describe('Refungible: Plain calls', () => { { const result = await contract.methods.approve(spender, 100).send({from: owner}); - const event = result.events.Approval; + const event = result.events!.Approval; expect(event.address).to.be.equal(tokenAddress); expect(event.returnValues.owner).to.be.equal(owner); expect(event.returnValues.spender).to.be.equal(spender); @@ -173,13 +173,13 @@ describe('Refungible: Plain calls', () => { { const result = await contract.methods.transferFrom(owner, receiver, 49).send({from: spender}); - let event = result.events.Transfer; + let event = result.events!.Transfer; expect(event.address).to.be.equal(tokenAddress); expect(event.returnValues.from).to.be.equal(owner); expect(event.returnValues.to).to.be.equal(receiver); expect(event.returnValues.value).to.be.equal('49'); - event = result.events.Approval; + event = result.events!.Approval; expect(event.address).to.be.equal(tokenAddress); expect(event.returnValues.owner).to.be.equal(owner); expect(event.returnValues.spender).to.be.equal(spender); @@ -208,7 +208,7 @@ describe('Refungible: Plain calls', () => { { const result = await contract.methods.transfer(receiver, 50).send({from: owner}); - const event = result.events.Transfer; + const event = result.events!.Transfer; expect(event.address).to.be.equal(tokenAddress); expect(event.returnValues.from).to.be.equal(owner); expect(event.returnValues.to).to.be.equal(receiver); @@ -262,7 +262,7 @@ describe('Refungible: Plain calls', () => { const result = await contract.methods.repartition(200).send(); - const event = result.events.Transfer; + const event = result.events!.Transfer; expect(event.address).to.be.equal(tokenAddress); expect(event.returnValues.from).to.be.equal('0x0000000000000000000000000000000000000000'); expect(event.returnValues.to).to.be.equal(owner); @@ -278,7 +278,7 @@ describe('Refungible: Plain calls', () => { const contract = helper.ethNativeContract.rftToken(tokenAddress, owner); const result = await contract.methods.repartition(50).send(); - const event = result.events.Transfer; + const event = result.events!.Transfer; expect(event.address).to.be.equal(tokenAddress); expect(event.returnValues.from).to.be.equal(owner); expect(event.returnValues.to).to.be.equal('0x0000000000000000000000000000000000000000'); @@ -391,7 +391,7 @@ describe('Refungible: Substrate calls', () => { const contract = helper.ethNativeContract.rftToken(tokenAddress); const events: any = []; - contract.events.allEvents((_: any, event: any) => { + contract.events.allEvents(undefined, (_: any, event: any) => { events.push(event); }); @@ -417,7 +417,7 @@ describe('Refungible: Substrate calls', () => { const contract = helper.ethNativeContract.rftToken(tokenAddress); const events: any = []; - contract.events.allEvents((_: any, event: any) => { + contract.events.allEvents(undefined, (_: any, event: any) => { events.push(event); }); @@ -448,7 +448,7 @@ describe('Refungible: Substrate calls', () => { const contract = helper.ethNativeContract.rftToken(tokenAddress); const events: any = []; - contract.events.allEvents((_: any, event: any) => { + contract.events.allEvents(undefined, (_: any, event: any) => { events.push(event); }); diff --git a/tests/src/eth/types/CollectionHelpersAbi.ts b/tests/src/eth/types/CollectionHelpersAbi.ts new file mode 100644 index 0000000000..08dfbb41cf --- /dev/null +++ b/tests/src/eth/types/CollectionHelpersAbi.ts @@ -0,0 +1,82 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ + +import type BN from "bn.js"; +import type { ContractOptions } from "web3-eth-contract"; +import type { EventLog } from "web3-core"; +import type { EventEmitter } from "events"; +import type { + Callback, + PayableTransactionObject, + NonPayableTransactionObject, + BlockType, + ContractEventLog, + BaseContract, +} from "./types"; + +export interface EventOptions { + filter?: object; + fromBlock?: BlockType; + topics?: string[]; +} + +export type CollectionCreated = ContractEventLog<{ + owner: string; + collectionId: string; + 0: string; + 1: string; +}>; + +export interface CollectionHelpersAbi extends BaseContract { + constructor( + jsonInterface: any[], + address?: string, + options?: ContractOptions + ): CollectionHelpersAbi; + clone(): CollectionHelpersAbi; + methods: { + collectionCreationFee(): NonPayableTransactionObject; + + createNFTCollection( + name: string, + description: string, + tokenPrefix: string + ): PayableTransactionObject; + + createRFTCollection( + name: string, + description: string, + tokenPrefix: string + ): PayableTransactionObject; + + isCollectionExist( + collectionAddress: string + ): NonPayableTransactionObject; + + makeCollectionERC721MetadataCompatible( + collection: string, + baseUri: string + ): NonPayableTransactionObject; + + supportsInterface( + interfaceID: string | number[] + ): NonPayableTransactionObject; + }; + events: { + CollectionCreated(cb?: Callback): EventEmitter; + CollectionCreated( + options?: EventOptions, + cb?: Callback + ): EventEmitter; + + allEvents(options?: EventOptions, cb?: Callback): EventEmitter; + }; + + once(event: "CollectionCreated", cb: Callback): void; + once( + event: "CollectionCreated", + options: EventOptions, + cb: Callback + ): void; +} diff --git a/tests/src/eth/types/FungibleAbi.ts b/tests/src/eth/types/FungibleAbi.ts new file mode 100644 index 0000000000..5233949bab --- /dev/null +++ b/tests/src/eth/types/FungibleAbi.ts @@ -0,0 +1,179 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ + +import type BN from "bn.js"; +import type { ContractOptions } from "web3-eth-contract"; +import type { EventLog } from "web3-core"; +import type { EventEmitter } from "events"; +import type { + Callback, + PayableTransactionObject, + NonPayableTransactionObject, + BlockType, + ContractEventLog, + BaseContract, +} from "./types"; + +export interface EventOptions { + filter?: object; + fromBlock?: BlockType; + topics?: string[]; +} + +export type Approval = ContractEventLog<{ + owner: string; + spender: string; + value: string; + 0: string; + 1: string; + 2: string; +}>; +export type Transfer = ContractEventLog<{ + from: string; + to: string; + value: string; + 0: string; + 1: string; + 2: string; +}>; + +export interface FungibleAbi extends BaseContract { + constructor( + jsonInterface: any[], + address?: string, + options?: ContractOptions + ): FungibleAbi; + clone(): FungibleAbi; + methods: { + addCollectionAdmin(newAdmin: string): NonPayableTransactionObject; + + addToCollectionAllowList(user: string): NonPayableTransactionObject; + + allowance( + owner: string, + spender: string + ): NonPayableTransactionObject; + + allowed(user: string): NonPayableTransactionObject; + + approve( + spender: string, + amount: number | string | BN + ): NonPayableTransactionObject; + + balanceOf(owner: string): NonPayableTransactionObject; + + burnFrom( + from: string, + amount: number | string | BN + ): NonPayableTransactionObject; + + changeCollectionOwner(newOwner: string): NonPayableTransactionObject; + + collectionOwner(): NonPayableTransactionObject<[string, string]>; + + collectionProperty(key: string): NonPayableTransactionObject; + + collectionSponsor(): NonPayableTransactionObject<[string, string]>; + + confirmCollectionSponsorship(): NonPayableTransactionObject; + + contractAddress(): NonPayableTransactionObject; + + decimals(): NonPayableTransactionObject; + + deleteCollectionProperty(key: string): NonPayableTransactionObject; + + hasCollectionPendingSponsor(): NonPayableTransactionObject; + + isOwnerOrAdmin(user: string): NonPayableTransactionObject; + + mint( + to: string, + amount: number | string | BN + ): NonPayableTransactionObject; + + mintBulk( + amounts: [string, number | string | BN][] + ): NonPayableTransactionObject; + + name(): NonPayableTransactionObject; + + removeCollectionAdmin(admin: string): NonPayableTransactionObject; + + removeCollectionSponsor(): NonPayableTransactionObject; + + removeFromCollectionAllowList( + user: string + ): NonPayableTransactionObject; + + setCollectionAccess( + mode: number | string | BN + ): NonPayableTransactionObject; + + "setCollectionLimit(string,uint32)"( + limit: string, + value: number | string | BN + ): NonPayableTransactionObject; + + "setCollectionLimit(string,bool)"( + limit: string, + value: boolean + ): NonPayableTransactionObject; + + setCollectionMintMode(mode: boolean): NonPayableTransactionObject; + + "setCollectionNesting(bool)"( + enable: boolean + ): NonPayableTransactionObject; + + "setCollectionNesting(bool,address[])"( + enable: boolean, + collections: string[] + ): NonPayableTransactionObject; + + setCollectionProperty( + key: string, + value: string | number[] + ): NonPayableTransactionObject; + + setCollectionSponsor(sponsor: string): NonPayableTransactionObject; + + supportsInterface( + interfaceID: string | number[] + ): NonPayableTransactionObject; + + symbol(): NonPayableTransactionObject; + + totalSupply(): NonPayableTransactionObject; + + transfer( + to: string, + amount: number | string | BN + ): NonPayableTransactionObject; + + transferFrom( + from: string, + to: string, + amount: number | string | BN + ): NonPayableTransactionObject; + + uniqueCollectionType(): NonPayableTransactionObject; + }; + events: { + Approval(cb?: Callback): EventEmitter; + Approval(options?: EventOptions, cb?: Callback): EventEmitter; + + Transfer(cb?: Callback): EventEmitter; + Transfer(options?: EventOptions, cb?: Callback): EventEmitter; + + allEvents(options?: EventOptions, cb?: Callback): EventEmitter; + }; + + once(event: "Approval", cb: Callback): void; + once(event: "Approval", options: EventOptions, cb: Callback): void; + + once(event: "Transfer", cb: Callback): void; + once(event: "Transfer", options: EventOptions, cb: Callback): void; +} diff --git a/tests/src/eth/types/NonFungibleAbi.ts b/tests/src/eth/types/NonFungibleAbi.ts new file mode 100644 index 0000000000..15eb659526 --- /dev/null +++ b/tests/src/eth/types/NonFungibleAbi.ts @@ -0,0 +1,288 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ + +import type BN from "bn.js"; +import type { ContractOptions } from "web3-eth-contract"; +import type { EventLog } from "web3-core"; +import type { EventEmitter } from "events"; +import type { + Callback, + PayableTransactionObject, + NonPayableTransactionObject, + BlockType, + ContractEventLog, + BaseContract, +} from "./types"; + +export interface EventOptions { + filter?: object; + fromBlock?: BlockType; + topics?: string[]; +} + +export type Approval = ContractEventLog<{ + owner: string; + approved: string; + tokenId: string; + 0: string; + 1: string; + 2: string; +}>; +export type ApprovalForAll = ContractEventLog<{ + owner: string; + operator: string; + approved: boolean; + 0: string; + 1: string; + 2: boolean; +}>; +export type MintingFinished = ContractEventLog<{}>; +export type Transfer = ContractEventLog<{ + from: string; + to: string; + tokenId: string; + 0: string; + 1: string; + 2: string; +}>; + +export interface NonFungibleAbi extends BaseContract { + constructor( + jsonInterface: any[], + address?: string, + options?: ContractOptions + ): NonFungibleAbi; + clone(): NonFungibleAbi; + methods: { + addCollectionAdmin(newAdmin: string): NonPayableTransactionObject; + + addToCollectionAllowList(user: string): NonPayableTransactionObject; + + allowed(user: string): NonPayableTransactionObject; + + approve( + approved: string, + tokenId: number | string | BN + ): NonPayableTransactionObject; + + balanceOf(owner: string): NonPayableTransactionObject; + + burn(tokenId: number | string | BN): NonPayableTransactionObject; + + burnFrom( + from: string, + tokenId: number | string | BN + ): NonPayableTransactionObject; + + changeCollectionOwner(newOwner: string): NonPayableTransactionObject; + + collectionOwner(): NonPayableTransactionObject<[string, string]>; + + collectionProperty(key: string): NonPayableTransactionObject; + + collectionSponsor(): NonPayableTransactionObject<[string, string]>; + + confirmCollectionSponsorship(): NonPayableTransactionObject; + + contractAddress(): NonPayableTransactionObject; + + deleteCollectionProperty(key: string): NonPayableTransactionObject; + + deleteProperty( + tokenId: number | string | BN, + key: string + ): NonPayableTransactionObject; + + finishMinting(): NonPayableTransactionObject; + + getApproved( + tokenId: number | string | BN + ): NonPayableTransactionObject; + + hasCollectionPendingSponsor(): NonPayableTransactionObject; + + isApprovedForAll( + owner: string, + operator: string + ): NonPayableTransactionObject; + + isOwnerOrAdmin(user: string): NonPayableTransactionObject; + + mint(to: string): NonPayableTransactionObject; + + mintBulk( + to: string, + tokenIds: (number | string | BN)[] + ): NonPayableTransactionObject; + + mintBulkWithTokenURI( + to: string, + tokens: [number | string | BN, string][] + ): NonPayableTransactionObject; + + mintWithTokenURI( + to: string, + tokenUri: string + ): NonPayableTransactionObject; + + mintingFinished(): NonPayableTransactionObject; + + name(): NonPayableTransactionObject; + + nextTokenId(): NonPayableTransactionObject; + + ownerOf(tokenId: number | string | BN): NonPayableTransactionObject; + + property( + tokenId: number | string | BN, + key: string + ): NonPayableTransactionObject; + + removeCollectionAdmin(admin: string): NonPayableTransactionObject; + + removeCollectionSponsor(): NonPayableTransactionObject; + + removeFromCollectionAllowList( + user: string + ): NonPayableTransactionObject; + + "safeTransferFrom(address,address,uint256)"( + from: string, + to: string, + tokenId: number | string | BN + ): NonPayableTransactionObject; + + "safeTransferFrom(address,address,uint256,bytes)"( + from: string, + to: string, + tokenId: number | string | BN, + data: string | number[] + ): NonPayableTransactionObject; + + setApprovalForAll( + operator: string, + approved: boolean + ): NonPayableTransactionObject; + + setCollectionAccess( + mode: number | string | BN + ): NonPayableTransactionObject; + + "setCollectionLimit(string,uint32)"( + limit: string, + value: number | string | BN + ): NonPayableTransactionObject; + + "setCollectionLimit(string,bool)"( + limit: string, + value: boolean + ): NonPayableTransactionObject; + + setCollectionMintMode(mode: boolean): NonPayableTransactionObject; + + "setCollectionNesting(bool)"( + enable: boolean + ): NonPayableTransactionObject; + + "setCollectionNesting(bool,address[])"( + enable: boolean, + collections: string[] + ): NonPayableTransactionObject; + + setCollectionProperty( + key: string, + value: string | number[] + ): NonPayableTransactionObject; + + setCollectionSponsor(sponsor: string): NonPayableTransactionObject; + + setProperty( + tokenId: number | string | BN, + key: string, + value: string | number[] + ): NonPayableTransactionObject; + + setTokenPropertyPermission( + key: string, + isMutable: boolean, + collectionAdmin: boolean, + tokenOwner: boolean + ): NonPayableTransactionObject; + + supportsInterface( + interfaceID: string | number[] + ): NonPayableTransactionObject; + + symbol(): NonPayableTransactionObject; + + tokenByIndex( + index: number | string | BN + ): NonPayableTransactionObject; + + tokenOfOwnerByIndex( + owner: string, + index: number | string | BN + ): NonPayableTransactionObject; + + tokenURI( + tokenId: number | string | BN + ): NonPayableTransactionObject; + + totalSupply(): NonPayableTransactionObject; + + transfer( + to: string, + tokenId: number | string | BN + ): NonPayableTransactionObject; + + transferFrom( + from: string, + to: string, + tokenId: number | string | BN + ): NonPayableTransactionObject; + + uniqueCollectionType(): NonPayableTransactionObject; + }; + events: { + Approval(cb?: Callback): EventEmitter; + Approval(options?: EventOptions, cb?: Callback): EventEmitter; + + ApprovalForAll(cb?: Callback): EventEmitter; + ApprovalForAll( + options?: EventOptions, + cb?: Callback + ): EventEmitter; + + MintingFinished(cb?: Callback): EventEmitter; + MintingFinished( + options?: EventOptions, + cb?: Callback + ): EventEmitter; + + Transfer(cb?: Callback): EventEmitter; + Transfer(options?: EventOptions, cb?: Callback): EventEmitter; + + allEvents(options?: EventOptions, cb?: Callback): EventEmitter; + }; + + once(event: "Approval", cb: Callback): void; + once(event: "Approval", options: EventOptions, cb: Callback): void; + + once(event: "ApprovalForAll", cb: Callback): void; + once( + event: "ApprovalForAll", + options: EventOptions, + cb: Callback + ): void; + + once(event: "MintingFinished", cb: Callback): void; + once( + event: "MintingFinished", + options: EventOptions, + cb: Callback + ): void; + + once(event: "Transfer", cb: Callback): void; + once(event: "Transfer", options: EventOptions, cb: Callback): void; +} diff --git a/tests/src/eth/types/ReFungibleAbi.ts b/tests/src/eth/types/ReFungibleAbi.ts new file mode 100644 index 0000000000..0957c16407 --- /dev/null +++ b/tests/src/eth/types/ReFungibleAbi.ts @@ -0,0 +1,292 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ + +import type BN from "bn.js"; +import type { ContractOptions } from "web3-eth-contract"; +import type { EventLog } from "web3-core"; +import type { EventEmitter } from "events"; +import type { + Callback, + PayableTransactionObject, + NonPayableTransactionObject, + BlockType, + ContractEventLog, + BaseContract, +} from "./types"; + +export interface EventOptions { + filter?: object; + fromBlock?: BlockType; + topics?: string[]; +} + +export type Approval = ContractEventLog<{ + owner: string; + approved: string; + tokenId: string; + 0: string; + 1: string; + 2: string; +}>; +export type ApprovalForAll = ContractEventLog<{ + owner: string; + operator: string; + approved: boolean; + 0: string; + 1: string; + 2: boolean; +}>; +export type MintingFinished = ContractEventLog<{}>; +export type Transfer = ContractEventLog<{ + from: string; + to: string; + tokenId: string; + 0: string; + 1: string; + 2: string; +}>; + +export interface ReFungibleAbi extends BaseContract { + constructor( + jsonInterface: any[], + address?: string, + options?: ContractOptions + ): ReFungibleAbi; + clone(): ReFungibleAbi; + methods: { + addCollectionAdmin(newAdmin: string): NonPayableTransactionObject; + + addToCollectionAllowList(user: string): NonPayableTransactionObject; + + allowed(user: string): NonPayableTransactionObject; + + approve( + approved: string, + tokenId: number | string | BN + ): NonPayableTransactionObject; + + balanceOf(owner: string): NonPayableTransactionObject; + + burn(tokenId: number | string | BN): NonPayableTransactionObject; + + burnFrom( + from: string, + tokenId: number | string | BN + ): NonPayableTransactionObject; + + changeCollectionOwner(newOwner: string): NonPayableTransactionObject; + + collectionOwner(): NonPayableTransactionObject<[string, string]>; + + collectionProperty(key: string): NonPayableTransactionObject; + + collectionSponsor(): NonPayableTransactionObject<[string, string]>; + + confirmCollectionSponsorship(): NonPayableTransactionObject; + + contractAddress(): NonPayableTransactionObject; + + deleteCollectionProperty(key: string): NonPayableTransactionObject; + + deleteProperty( + tokenId: number | string | BN, + key: string + ): NonPayableTransactionObject; + + finishMinting(): NonPayableTransactionObject; + + getApproved( + tokenId: number | string | BN + ): NonPayableTransactionObject; + + hasCollectionPendingSponsor(): NonPayableTransactionObject; + + isApprovedForAll( + owner: string, + operator: string + ): NonPayableTransactionObject; + + isOwnerOrAdmin(user: string): NonPayableTransactionObject; + + mint(to: string): NonPayableTransactionObject; + + mintBulk( + to: string, + tokenIds: (number | string | BN)[] + ): NonPayableTransactionObject; + + mintBulkWithTokenURI( + to: string, + tokens: [number | string | BN, string][] + ): NonPayableTransactionObject; + + mintWithTokenURI( + to: string, + tokenUri: string + ): NonPayableTransactionObject; + + mintingFinished(): NonPayableTransactionObject; + + name(): NonPayableTransactionObject; + + nextTokenId(): NonPayableTransactionObject; + + ownerOf(tokenId: number | string | BN): NonPayableTransactionObject; + + property( + tokenId: number | string | BN, + key: string + ): NonPayableTransactionObject; + + removeCollectionAdmin(admin: string): NonPayableTransactionObject; + + removeCollectionSponsor(): NonPayableTransactionObject; + + removeFromCollectionAllowList( + user: string + ): NonPayableTransactionObject; + + safeTransferFrom( + from: string, + to: string, + tokenId: number | string | BN + ): NonPayableTransactionObject; + + safeTransferFromWithData( + from: string, + to: string, + tokenId: number | string | BN, + data: string | number[] + ): NonPayableTransactionObject; + + setApprovalForAll( + operator: string, + approved: boolean + ): NonPayableTransactionObject; + + setCollectionAccess( + mode: number | string | BN + ): NonPayableTransactionObject; + + "setCollectionLimit(string,uint32)"( + limit: string, + value: number | string | BN + ): NonPayableTransactionObject; + + "setCollectionLimit(string,bool)"( + limit: string, + value: boolean + ): NonPayableTransactionObject; + + setCollectionMintMode(mode: boolean): NonPayableTransactionObject; + + "setCollectionNesting(bool)"( + enable: boolean + ): NonPayableTransactionObject; + + "setCollectionNesting(bool,address[])"( + enable: boolean, + collections: string[] + ): NonPayableTransactionObject; + + setCollectionProperty( + key: string, + value: string | number[] + ): NonPayableTransactionObject; + + setCollectionSponsor(sponsor: string): NonPayableTransactionObject; + + setProperty( + tokenId: number | string | BN, + key: string, + value: string | number[] + ): NonPayableTransactionObject; + + setTokenPropertyPermission( + key: string, + isMutable: boolean, + collectionAdmin: boolean, + tokenOwner: boolean + ): NonPayableTransactionObject; + + supportsInterface( + interfaceID: string | number[] + ): NonPayableTransactionObject; + + symbol(): NonPayableTransactionObject; + + tokenByIndex( + index: number | string | BN + ): NonPayableTransactionObject; + + tokenContractAddress( + token: number | string | BN + ): NonPayableTransactionObject; + + tokenOfOwnerByIndex( + owner: string, + index: number | string | BN + ): NonPayableTransactionObject; + + tokenURI( + tokenId: number | string | BN + ): NonPayableTransactionObject; + + totalSupply(): NonPayableTransactionObject; + + transfer( + to: string, + tokenId: number | string | BN + ): NonPayableTransactionObject; + + transferFrom( + from: string, + to: string, + tokenId: number | string | BN + ): NonPayableTransactionObject; + + uniqueCollectionType(): NonPayableTransactionObject; + }; + events: { + Approval(cb?: Callback): EventEmitter; + Approval(options?: EventOptions, cb?: Callback): EventEmitter; + + ApprovalForAll(cb?: Callback): EventEmitter; + ApprovalForAll( + options?: EventOptions, + cb?: Callback + ): EventEmitter; + + MintingFinished(cb?: Callback): EventEmitter; + MintingFinished( + options?: EventOptions, + cb?: Callback + ): EventEmitter; + + Transfer(cb?: Callback): EventEmitter; + Transfer(options?: EventOptions, cb?: Callback): EventEmitter; + + allEvents(options?: EventOptions, cb?: Callback): EventEmitter; + }; + + once(event: "Approval", cb: Callback): void; + once(event: "Approval", options: EventOptions, cb: Callback): void; + + once(event: "ApprovalForAll", cb: Callback): void; + once( + event: "ApprovalForAll", + options: EventOptions, + cb: Callback + ): void; + + once(event: "MintingFinished", cb: Callback): void; + once( + event: "MintingFinished", + options: EventOptions, + cb: Callback + ): void; + + once(event: "Transfer", cb: Callback): void; + once(event: "Transfer", options: EventOptions, cb: Callback): void; +} diff --git a/tests/src/eth/types/ReFungibleTokenAbi.ts b/tests/src/eth/types/ReFungibleTokenAbi.ts new file mode 100644 index 0000000000..e5798b9bab --- /dev/null +++ b/tests/src/eth/types/ReFungibleTokenAbi.ts @@ -0,0 +1,112 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ + +import type BN from "bn.js"; +import type { ContractOptions } from "web3-eth-contract"; +import type { EventLog } from "web3-core"; +import type { EventEmitter } from "events"; +import type { + Callback, + PayableTransactionObject, + NonPayableTransactionObject, + BlockType, + ContractEventLog, + BaseContract, +} from "./types"; + +export interface EventOptions { + filter?: object; + fromBlock?: BlockType; + topics?: string[]; +} + +export type Approval = ContractEventLog<{ + owner: string; + spender: string; + value: string; + 0: string; + 1: string; + 2: string; +}>; +export type Transfer = ContractEventLog<{ + from: string; + to: string; + value: string; + 0: string; + 1: string; + 2: string; +}>; + +export interface ReFungibleTokenAbi extends BaseContract { + constructor( + jsonInterface: any[], + address?: string, + options?: ContractOptions + ): ReFungibleTokenAbi; + clone(): ReFungibleTokenAbi; + methods: { + allowance( + owner: string, + spender: string + ): NonPayableTransactionObject; + + approve( + spender: string, + amount: number | string | BN + ): NonPayableTransactionObject; + + balanceOf(owner: string): NonPayableTransactionObject; + + burnFrom( + from: string, + amount: number | string | BN + ): NonPayableTransactionObject; + + decimals(): NonPayableTransactionObject; + + name(): NonPayableTransactionObject; + + parentToken(): NonPayableTransactionObject; + + parentTokenId(): NonPayableTransactionObject; + + repartition( + amount: number | string | BN + ): NonPayableTransactionObject; + + supportsInterface( + interfaceID: string | number[] + ): NonPayableTransactionObject; + + symbol(): NonPayableTransactionObject; + + totalSupply(): NonPayableTransactionObject; + + transfer( + to: string, + amount: number | string | BN + ): NonPayableTransactionObject; + + transferFrom( + from: string, + to: string, + amount: number | string | BN + ): NonPayableTransactionObject; + }; + events: { + Approval(cb?: Callback): EventEmitter; + Approval(options?: EventOptions, cb?: Callback): EventEmitter; + + Transfer(cb?: Callback): EventEmitter; + Transfer(options?: EventOptions, cb?: Callback): EventEmitter; + + allEvents(options?: EventOptions, cb?: Callback): EventEmitter; + }; + + once(event: "Approval", cb: Callback): void; + once(event: "Approval", options: EventOptions, cb: Callback): void; + + once(event: "Transfer", cb: Callback): void; + once(event: "Transfer", options: EventOptions, cb: Callback): void; +} diff --git a/tests/src/eth/types/index.ts b/tests/src/eth/types/index.ts new file mode 100644 index 0000000000..0245478ca9 --- /dev/null +++ b/tests/src/eth/types/index.ts @@ -0,0 +1,8 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +export type { CollectionHelpersAbi } from "./CollectionHelpersAbi"; +export type { FungibleAbi } from "./FungibleAbi"; +export type { NonFungibleAbi } from "./NonFungibleAbi"; +export type { ReFungibleAbi } from "./ReFungibleAbi"; +export type { ReFungibleTokenAbi } from "./ReFungibleTokenAbi"; diff --git a/tests/src/eth/types/types.ts b/tests/src/eth/types/types.ts new file mode 100644 index 0000000000..2431788c48 --- /dev/null +++ b/tests/src/eth/types/types.ts @@ -0,0 +1,73 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +import type BN from "bn.js"; +import type { EventEmitter } from "events"; +import type { EventLog, PromiEvent, TransactionReceipt } from "web3-core/types"; +import type { Contract } from "web3-eth-contract"; + +export interface EstimateGasOptions { + from?: string; + gas?: number; + value?: number | string | BN; +} + +export interface EventOptions { + filter?: object; + fromBlock?: BlockType; + topics?: string[]; +} + +export type Callback = (error: Error, result: T) => void; +export interface ContractEventLog extends EventLog { + returnValues: T; +} +export interface ContractEventEmitter extends EventEmitter { + on(event: "connected", listener: (subscriptionId: string) => void): this; + on( + event: "data" | "changed", + listener: (event: ContractEventLog) => void + ): this; + on(event: "error", listener: (error: Error) => void): this; +} + +export interface NonPayableTx { + nonce?: string | number | BN; + chainId?: string | number | BN; + from?: string; + to?: string; + data?: string; + gas?: string | number | BN; + maxPriorityFeePerGas?: string | number | BN; + maxFeePerGas?: string | number | BN; + gasPrice?: string | number | BN; +} + +export interface PayableTx extends NonPayableTx { + value?: string | number | BN; +} + +export interface NonPayableTransactionObject { + arguments: any[]; + call(tx?: NonPayableTx, block?: BlockType): Promise; + send(tx?: NonPayableTx): PromiEvent; + estimateGas(tx?: NonPayableTx): Promise; + encodeABI(): string; +} + +export interface PayableTransactionObject { + arguments: any[]; + call(tx?: PayableTx, block?: BlockType): Promise; + send(tx?: PayableTx): PromiEvent; + estimateGas(tx?: PayableTx): Promise; + encodeABI(): string; +} + +export type BlockType = + | "latest" + | "pending" + | "genesis" + | "earliest" + | number + | BN; +export type BaseContract = Omit; diff --git a/tests/src/eth/util/playgrounds/unique.dev.ts b/tests/src/eth/util/playgrounds/unique.dev.ts index f3c070336f..b763eda9ff 100644 --- a/tests/src/eth/util/playgrounds/unique.dev.ts +++ b/tests/src/eth/util/playgrounds/unique.dev.ts @@ -28,6 +28,7 @@ import refungibleAbi from '../../reFungibleAbi.json'; import refungibleTokenAbi from '../../reFungibleTokenAbi.json'; import contractHelpersAbi from './../contractHelpersAbi.json'; import {ICrossAccountId, TEthereumAccount} from '../../../util/playgrounds/types'; +import {CollectionHelpersAbi, FungibleAbi, NonFungibleAbi, ReFungibleAbi, ReFungibleTokenAbi} from '../../types'; class EthGroupBase { helper: EthUniqueHelper; @@ -102,9 +103,9 @@ class NativeContractGroup extends EthGroupBase { return new web3.eth.Contract(contractHelpersAbi as any, '0x842899ECF380553E8a4de75bF534cdf6fBF64049', {from: caller, gas: this.helper.eth.DEFAULT_GAS}); } - collectionHelpers(caller: string) { + collectionHelpers(caller: string): CollectionHelpersAbi { const web3 = this.helper.getWeb3(); - return new web3.eth.Contract(collectionHelpersAbi as any, '0x6c4e9fe1ae37a41e93cee429e8e1881abdcbb54f', {from: caller, gas: this.helper.eth.DEFAULT_GAS}); + return new web3.eth.Contract(collectionHelpersAbi as any, '0x6c4e9fe1ae37a41e93cee429e8e1881abdcbb54f', {from: caller, gas: this.helper.eth.DEFAULT_GAS}) as any as CollectionHelpersAbi; } collection(address: string, mode: 'nft' | 'rft' | 'ft', caller?: string): Contract { @@ -116,17 +117,29 @@ class NativeContractGroup extends EthGroupBase { const web3 = this.helper.getWeb3(); return new web3.eth.Contract(abi as any, address, {gas: this.helper.eth.DEFAULT_GAS, ...(caller ? {from: caller} : {})}); } + + rftCollection(address: string, caller?: string): ReFungibleAbi { + return this.collection(address, 'rft', caller) as any as ReFungibleAbi; + } + + nftCollection(address: string, caller?: string): NonFungibleAbi { + return this.collection(address, 'nft', caller) as any as NonFungibleAbi; + } + + ftCollection(address: string, caller?: string): FungibleAbi { + return this.collection(address, 'ft', caller) as any as FungibleAbi; + } collectionById(collectionId: number, mode: 'nft' | 'rft' | 'ft', caller?: string): Contract { return this.collection(this.helper.ethAddress.fromCollectionId(collectionId), mode, caller); } - rftToken(address: string, caller?: string): Contract { + rftToken(address: string, caller?: string): ReFungibleTokenAbi { const web3 = this.helper.getWeb3(); - return new web3.eth.Contract(refungibleTokenAbi as any, address, {gas: this.helper.eth.DEFAULT_GAS, ...(caller ? {from: caller} : {})}); + return new web3.eth.Contract(refungibleTokenAbi as any, address, {gas: this.helper.eth.DEFAULT_GAS, ...(caller ? {from: caller} : {})}) as any as ReFungibleTokenAbi; } - rftTokenById(collectionId: number, tokenId: number, caller?: string): Contract { + rftTokenById(collectionId: number, tokenId: number, caller?: string): ReFungibleTokenAbi { return this.rftToken(this.helper.ethAddress.fromTokenId(collectionId, tokenId), caller); } } @@ -180,7 +193,7 @@ class EthGroup extends EthGroupBase { const result = await collectionHelper.methods.createNFTCollection(name, description, tokenPrefix).send({value: Number(collectionCreationPrice)}); - const collectionAddress = this.helper.ethAddress.normalizeAddress(result.events.CollectionCreated.returnValues.collectionId); + const collectionAddress = this.helper.ethAddress.normalizeAddress(result.events!.CollectionCreated.returnValues.collectionId); const collectionId = this.helper.ethAddress.extractCollectionId(collectionAddress); return {collectionId, collectionAddress}; @@ -202,7 +215,7 @@ class EthGroup extends EthGroupBase { const result = await collectionHelper.methods.createRFTCollection(name, description, tokenPrefix).send({value: Number(collectionCreationPrice)}); - const collectionAddress = this.helper.ethAddress.normalizeAddress(result.events.CollectionCreated.returnValues.collectionId); + const collectionAddress = this.helper.ethAddress.normalizeAddress(result.events!.CollectionCreated.returnValues.collectionId); const collectionId = this.helper.ethAddress.extractCollectionId(collectionAddress); return {collectionId, collectionAddress}; diff --git a/tests/yarn.lock b/tests/yarn.lock index a1bafaaf5e..3d06c2ee05 100644 --- a/tests/yarn.lock +++ b/tests/yarn.lock @@ -940,6 +940,14 @@ resolved "https://registry.yarnpkg.com/@tsconfig/node16/-/node16-1.0.3.tgz#472eaab5f15c1ffdd7f8628bd4c4f753995ec79e" integrity sha512-yOlFc+7UtL/89t2ZhjPvvB/DeAr3r+Dq58IgzsFkOAvVC6NMJXmCGjbptdXdR9qsX7pKcTL+s87FtYREi2dEEQ== +"@typechain/web3-v1@workspace:^6.0.1": + version "6.0.1" + resolved "https://registry.yarnpkg.com/@typechain/web3-v1/-/web3-v1-6.0.1.tgz#459d1d6901134310fbc1cf9cd263bf529d979572" + integrity sha512-w3xehVgsKV74fGBx1d6xuySWZJ/DbLaYWJDqaDy93qojOicDPESESfOL0XIWZfEmhxk+1JEDC9Roqb/eBmldaA== + dependencies: + lodash "^4.17.15" + ts-essentials "^7.0.1" + "@types/bn.js@^5.1.0", "@types/bn.js@^5.1.1": version "5.1.1" resolved "https://registry.yarnpkg.com/@types/bn.js/-/bn.js-5.1.1.tgz#b51e1b55920a4ca26e9285ff79936bbdec910682" @@ -1023,6 +1031,11 @@ dependencies: "@types/node" "*" +"@types/prettier@^2.1.1": + version "2.7.1" + resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-2.7.1.tgz#dfd20e2dc35f027cdd6c1908e80a5ddc7499670e" + integrity sha512-ri0UmynRRvZiiUJdiz38MmIblKK+oH30MztdBVR95dv/Ubw6neWSb8u1XpRb72L4qsZOhz+L+z9JD40SJmfWow== + "@types/responselike@*", "@types/responselike@^1.0.0": version "1.0.0" resolved "https://registry.yarnpkg.com/@types/responselike/-/responselike-1.0.0.tgz#251f4fe7d154d2bad125abe1b429b23afd262e29" @@ -1211,6 +1224,16 @@ argparse@^2.0.1: resolved "https://registry.yarnpkg.com/argparse/-/argparse-2.0.1.tgz#246f50f3ca78a3240f6c997e8a9bd1eac49e4b38" integrity sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q== +array-back@^3.0.1, array-back@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/array-back/-/array-back-3.1.0.tgz#b8859d7a508871c9a7b2cf42f99428f65e96bfb0" + integrity sha512-TkuxA4UCOvxuDK6NZYXCalszEzj+TLszyASooky+i742l9TqsOdYCMJJupxRic61hwquNtppB3hgcuq9SVSH1Q== + +array-back@^4.0.1, array-back@^4.0.2: + version "4.0.2" + resolved "https://registry.yarnpkg.com/array-back/-/array-back-4.0.2.tgz#8004e999a6274586beeb27342168652fdb89fa1e" + integrity sha512-NbdMezxqf94cnNfWLL7V/im0Ub+Anbb0IoZhvzie8+4HJ4nMQuzHuy49FkGYCJK2yAloZ3meiB6AVMClbrI1vg== + array-flatten@1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/array-flatten/-/array-flatten-1.1.1.tgz#9a5f699051b1e7073328f2a008968b64ea2955d2" @@ -1573,7 +1596,7 @@ chai@^4.3.6: pathval "^1.1.1" type-detect "^4.0.5" -chalk@^2.0.0: +chalk@^2.0.0, chalk@^2.4.2: version "2.4.2" resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== @@ -1709,6 +1732,26 @@ command-exists@^1.2.8: resolved "https://registry.yarnpkg.com/command-exists/-/command-exists-1.2.9.tgz#c50725af3808c8ab0260fd60b01fbfa25b954f69" integrity sha512-LTQ/SGc+s0Xc0Fu5WaKnR0YiygZkm9eKFvyS+fRsU7/ZWFF8ykFM6Pc9aCVf1+xasOOZpO3BAVgVrKvsqKHV7w== +command-line-args@^5.1.1: + version "5.2.1" + resolved "https://registry.yarnpkg.com/command-line-args/-/command-line-args-5.2.1.tgz#c44c32e437a57d7c51157696893c5909e9cec42e" + integrity sha512-H4UfQhZyakIjC74I9d34fGYDwk3XpSr17QhEd0Q3I9Xq1CETHo4Hcuo87WyWHpAF1aSLjLRf5lD9ZGX2qStUvg== + dependencies: + array-back "^3.1.0" + find-replace "^3.0.0" + lodash.camelcase "^4.3.0" + typical "^4.0.0" + +command-line-usage@^6.1.0: + version "6.1.3" + resolved "https://registry.yarnpkg.com/command-line-usage/-/command-line-usage-6.1.3.tgz#428fa5acde6a838779dfa30e44686f4b6761d957" + integrity sha512-sH5ZSPr+7UStsloltmDh7Ce5fb8XPlHyoPzTpyyMuYCtervL65+ubVZ6Q61cFtFl62UyJlc8/JwERRbAFPUqgw== + dependencies: + array-back "^4.0.2" + chalk "^2.4.2" + table-layout "^1.0.2" + typical "^5.2.0" + commander@^5.1.0: version "5.1.0" resolved "https://registry.yarnpkg.com/commander/-/commander-5.1.0.tgz#46abbd1652f8e059bddaef99bbdcb2ad9cf179ae" @@ -1879,7 +1922,7 @@ debug@2.6.9, debug@^2.2.0: dependencies: ms "2.0.0" -debug@4.3.4, debug@^4.1.0, debug@^4.1.1, debug@^4.3.2, debug@^4.3.4: +debug@4.3.4, debug@^4.1.0, debug@^4.1.1, debug@^4.3.1, debug@^4.3.2, debug@^4.3.4: version "4.3.4" resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865" integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ== @@ -1917,6 +1960,11 @@ deep-eql@^3.0.1: dependencies: type-detect "^4.0.0" +deep-extend@~0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.6.0.tgz#c4fa7c95404a17a9c3e8ca7e1537312b736330ac" + integrity sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA== + deep-is@^0.1.3: version "0.1.4" resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.4.tgz#a6f2dce612fadd2ef1f519b73551f17e85199831" @@ -2500,6 +2548,13 @@ find-process@^1.4.7: commander "^5.1.0" debug "^4.1.1" +find-replace@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/find-replace/-/find-replace-3.0.0.tgz#3e7e23d3b05167a76f770c9fbd5258b0def68c38" + integrity sha512-6Tb2myMioCAgv5kfvP5/PkZZ/ntTpVK39fHY7WkWBgvbeE+VHd/tZuZ4mrC+bxh4cfOZeYKVPaJIZtZXV7GNCQ== + dependencies: + array-back "^3.0.1" + find-up@5.0.0, find-up@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/find-up/-/find-up-5.0.0.tgz#4c92819ecb7083561e4f4a240a86be5198f536fc" @@ -2599,6 +2654,15 @@ fs-extra@^4.0.2: jsonfile "^4.0.0" universalify "^0.1.0" +fs-extra@^7.0.0: + version "7.0.1" + resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-7.0.1.tgz#4f189c44aa123b895f722804f55ea23eadc348e9" + integrity sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw== + dependencies: + graceful-fs "^4.1.2" + jsonfile "^4.0.0" + universalify "^0.1.0" + fs-minipass@^1.2.7: version "1.2.7" resolved "https://registry.yarnpkg.com/fs-minipass/-/fs-minipass-1.2.7.tgz#ccff8570841e7fe4265693da88936c55aed7f7c7" @@ -2701,6 +2765,18 @@ glob-parent@^6.0.1: dependencies: is-glob "^4.0.3" +glob@7.1.7: + version "7.1.7" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.7.tgz#3b193e9233f01d42d0b3f78294bbeeb418f94a90" + integrity sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ== + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.0.4" + once "^1.3.0" + path-is-absolute "^1.0.0" + glob@7.2.0: version "7.2.0" resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.0.tgz#d15535af7732e02e948f4c41628bd910293f6023" @@ -3315,12 +3391,17 @@ locate-path@^6.0.0: dependencies: p-locate "^5.0.0" +lodash.camelcase@^4.3.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz#b28aa6288a2b9fc651035c7711f65ab6190331a6" + integrity sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA== + lodash.merge@^4.6.2: version "4.6.2" resolved "https://registry.yarnpkg.com/lodash.merge/-/lodash.merge-4.6.2.tgz#558aa53b43b661e1925a0afdfa36a9a1085fe57a" integrity sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ== -lodash@^4.17.21: +lodash@^4.17.15, lodash@^4.17.21: version "4.17.21" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== @@ -3505,7 +3586,7 @@ mkdirp-promise@^5.0.1: dependencies: mkdirp "*" -mkdirp@*: +mkdirp@*, mkdirp@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-1.0.4.tgz#3eb5ed62622756d79a5f0e2a221dfebad75c2f7e" integrity sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw== @@ -3930,6 +4011,11 @@ prelude-ls@^1.2.1: resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396" integrity sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g== +prettier@^2.3.1: + version "2.7.1" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.7.1.tgz#e235806850d057f97bb08368a4f7d899f7760c64" + integrity sha512-ujppO+MkdPqoVINuDFDRLClm7D78qbDt0/NR+wp5FqEZOoTNAjPHWj17QRhu7geIHJfcNhRk1XVQmF8Bp3ye+g== + process@^0.11.10: version "0.11.10" resolved "https://registry.yarnpkg.com/process/-/process-0.11.10.tgz#7332300e840161bda3e69a1d1d91a7d4bc16f182" @@ -4060,6 +4146,11 @@ readdirp@~3.6.0: dependencies: picomatch "^2.2.1" +reduce-flatten@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/reduce-flatten/-/reduce-flatten-2.0.0.tgz#734fd84e65f375d7ca4465c69798c25c9d10ae27" + integrity sha512-EJ4UNY/U1t2P/2k6oqotuX2Cc3T6nxJwsM0N0asT7dhrtH1ltUxDn4NalSYmPE2rCkVpcf/X6R0wDwcFpzhd4w== + regenerator-runtime@^0.13.4: version "0.13.10" resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.10.tgz#ed07b19616bcbec5da6274ebc75ae95634bfc2ee" @@ -4386,6 +4477,11 @@ strict-uri-encode@^1.0.0: resolved "https://registry.yarnpkg.com/strict-uri-encode/-/strict-uri-encode-1.1.0.tgz#279b225df1d582b1f54e65addd4352e18faa0713" integrity sha512-R3f198pcvnB+5IpnBlRkphuE9n46WyVl8I39W/ZUTZLz4nqSP/oLYUrcnJrw462Ds8he4YKMov2efsTIw1BDGQ== +string-format@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/string-format/-/string-format-2.0.0.tgz#f2df2e7097440d3b65de31b6d40d54c96eaffb9b" + integrity sha512-bbEs3scLeYNXLecRRuk6uJxdXUSj6le/8rNPHChIJTn2V79aXVTR1EH2OH5zLKKoz0V02fOUKZZcw01pLUShZA== + string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: version "4.2.3" resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" @@ -4477,6 +4573,16 @@ swarm-js@^0.1.40: tar "^4.0.2" xhr-request "^1.0.1" +table-layout@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/table-layout/-/table-layout-1.0.2.tgz#c4038a1853b0136d63365a734b6931cf4fad4a04" + integrity sha512-qd/R7n5rQTRFi+Zf2sk5XVVd9UQl6ZkduPFC3S7WEGJAmetDTjY3qPN50eSKzwuzEyQKy5TN2TiZdkIjos2L6A== + dependencies: + array-back "^4.0.1" + deep-extend "~0.6.0" + typical "^5.2.0" + wordwrapjs "^4.0.0" + tar@^4.0.2: version "4.4.19" resolved "https://registry.yarnpkg.com/tar/-/tar-4.4.19.tgz#2e4d7263df26f2b914dee10c825ab132123742f3" @@ -4537,6 +4643,21 @@ tr46@~0.0.3: resolved "https://registry.yarnpkg.com/tr46/-/tr46-0.0.3.tgz#8184fd347dac9cdc185992f3a6622e14b9d9ab6a" integrity sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw== +ts-command-line-args@^2.2.0: + version "2.3.1" + resolved "https://registry.yarnpkg.com/ts-command-line-args/-/ts-command-line-args-2.3.1.tgz#b6188e42efc6cf7a8898e438a873fbb15505ddd6" + integrity sha512-FR3y7pLl/fuUNSmnPhfLArGqRrpojQgIEEOVzYx9DhTmfIN7C9RWSfpkJEF4J+Gk7aVx5pak8I7vWZsaN4N84g== + dependencies: + chalk "^4.1.0" + command-line-args "^5.1.1" + command-line-usage "^6.1.0" + string-format "^2.0.0" + +ts-essentials@^7.0.1: + version "7.0.3" + resolved "https://registry.yarnpkg.com/ts-essentials/-/ts-essentials-7.0.3.tgz#686fd155a02133eedcc5362dc8b5056cde3e5a38" + integrity sha512-8+gr5+lqO3G84KdiTSMRLtuyJ+nTBVRKuCrK4lidMPdVeEp0uqC875uE5NMcaA7YYMN7XsNiFQuMvasF8HT/xQ== + ts-node@^10.9.1: version "10.9.1" resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-10.9.1.tgz#e73de9102958af9e1f0b168a6ff320e25adcff4b" @@ -4625,6 +4746,22 @@ type@^2.7.2: resolved "https://registry.yarnpkg.com/type/-/type-2.7.2.tgz#2376a15a3a28b1efa0f5350dcf72d24df6ef98d0" integrity sha512-dzlvlNlt6AXU7EBSfpAscydQ7gXB+pPGsPnfJnZpiNJBDj7IaJzQlBZYGdEi4R9HmPdBv2XmWJ6YUtoTa7lmCw== +"typechain@workspace:^8.1.0": + version "8.1.0" + resolved "https://registry.yarnpkg.com/typechain/-/typechain-8.1.0.tgz#fc4902ce596519cb2ccfd012e4ddf92a9945b569" + integrity sha512-5jToLgKTjHdI1VKqs/K8BLYy42Sr3o8bV5ojh4MnR9ExHO83cyyUdw+7+vMJCpKXUiVUvARM4qmHTFuyaCMAZQ== + dependencies: + "@types/prettier" "^2.1.1" + debug "^4.3.1" + fs-extra "^7.0.0" + glob "7.1.7" + js-sha3 "^0.8.0" + lodash "^4.17.15" + mkdirp "^1.0.4" + prettier "^2.3.1" + ts-command-line-args "^2.2.0" + ts-essentials "^7.0.1" + typedarray-to-buffer@^3.1.5: version "3.1.5" resolved "https://registry.yarnpkg.com/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz#a97ee7a9ff42691b9f783ff1bc5112fe3fca9080" @@ -4637,6 +4774,16 @@ typescript@^4.8.4: resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.8.4.tgz#c464abca159669597be5f96b8943500b238e60e6" integrity sha512-QCh+85mCy+h0IGff8r5XWzOVSbBO+KfeYrMQh7NJ58QujwcE22u+NUSmUxqF+un70P9GXKxa2HCNiTTMJknyjQ== +typical@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/typical/-/typical-4.0.0.tgz#cbeaff3b9d7ae1e2bbfaf5a4e6f11eccfde94fc4" + integrity sha512-VAH4IvQ7BDFYglMd7BPRDfLgxZZX4O4TFcRDA6EN5X7erNJJq+McIEp8np9aVtxrCJ6qx4GTYVfOWNjcqwZgRw== + +typical@^5.2.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/typical/-/typical-5.2.0.tgz#4daaac4f2b5315460804f0acf6cb69c52bb93066" + integrity sha512-dvdQgNDNJo+8B2uBQoqdb11eUCE1JQXhvjC/CZtgvZseVd5TYMXnq0+vuUemXbd/Se29cTaUuPX3YIc2xgbvIg== + uglify-js@^3.1.4: version "3.17.3" resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.17.3.tgz#f0feedf019c4510f164099e8d7e72ff2d7304377" @@ -5054,6 +5201,14 @@ wordwrap@^1.0.0: resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb" integrity sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q== +wordwrapjs@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/wordwrapjs/-/wordwrapjs-4.0.1.tgz#d9790bccfb110a0fc7836b5ebce0937b37a8b98f" + integrity sha512-kKlNACbvHrkpIw6oPeYDSmdCTu2hdMHoyXLTcUKala++lx5Y+wjJ/e474Jqv5abnVmwxw08DiTuHmw69lJGksA== + dependencies: + reduce-flatten "^2.0.0" + typical "^5.2.0" + workerpool@6.2.1: version "6.2.1" resolved "https://registry.yarnpkg.com/workerpool/-/workerpool-6.2.1.tgz#46fc150c17d826b86a008e5a4508656777e9c343"