import { REPLACE_ME_WITH_TATUM_API_KEY, TEST_DATA } from '@tatumio/shared-testing-common' import { TatumKcsSDK } from '../kcs.sdk' import { Blockchain } from '@tatumio/shared-core' import { kcsTxService } from '../services/kcs.tx' import { erc20TestFactory, erc721TestFactory, ganacheHelper, multiTokenTestFactory, nativeTestFactory, smartContractTestFactory, } from '@tatumio/shared-testing-evm-based' import { Currency } from '@tatumio/api-client' const blockchain = Blockchain.KCS describe('KcsSDK - tx', () => { const sdk = TatumKcsSDK({ apiKey: REPLACE_ME_WITH_TATUM_API_KEY }) const inmemoryBlockchain = ganacheHelper.inmemoryBlockchain(blockchain) const kcsTx = kcsTxService({ blockchain, web3: { getClient: (provider?: string) => inmemoryBlockchain.web3, async getGasPriceInWei(): Promise { return '@TODO' }, }, }) describe('transaction', () => { describe('native', () => { nativeTestFactory.prepare.transferSignedTransaction(kcsTx.native, inmemoryBlockchain.accounts) }) }) describe('erc20', () => { /** * TODO: * Returned values aren't valid, did it run Out of Gas? You might also see this error if you are not using the correct ABI for the contract you are retrieving data from, requesting data from a block number that does not exist, or querying a node which is not fully synced. */ xdescribe('decimals', () => { erc20TestFactory.decimals(sdk.erc20, TEST_DATA.KCS) }) describe('prepare', () => { describe('deploySignedTransaction', () => { erc20TestFactory.prepare.deploySignedTransaction(kcsTx.erc20, inmemoryBlockchain.accounts) }) describe('transferSignedTransaction', () => { erc20TestFactory.prepare.transferSignedTransaction(kcsTx.erc20, inmemoryBlockchain.accounts) }) /** * TODO: * Returned values aren't valid, did it run Out of Gas? You might also see this error if you are not using the correct ABI for the contract you are retrieving data from, requesting data from a block number that does not exist, or querying a node which is not fully synced. */ xdescribe('mintSignedTransaction', () => { erc20TestFactory.prepare.mintSignedTransaction(kcsTx.erc20, TEST_DATA.KCS) }) /** * TODO: * Returned values aren't valid, did it run Out of Gas? You might also see this error if you are not using the correct ABI for the contract you are retrieving data from, requesting data from a block number that does not exist, or querying a node which is not fully synced. */ xdescribe('burnSignedTransaction', () => { erc20TestFactory.prepare.burnSignedTransaction(kcsTx.erc20, TEST_DATA.KCS) }) }) }) describe('erc721', () => { jest.setTimeout(99999) describe('prepare', () => { describe('deploySignedTransaction', () => { erc721TestFactory.prepare.deploySignedTransaction(sdk.nft, TEST_DATA.KCS, Currency.KCS) }) describe('transferSignedTransaction', () => { erc721TestFactory.prepare.transferSignedTransaction(sdk.nft, TEST_DATA.KCS, Currency.KCS) }) describe('mintSignedTransaction', () => { erc721TestFactory.prepare.mintSignedTransaction(sdk.nft, TEST_DATA.KCS, Currency.KCS) }) describe('burnSignedTransaction', () => { erc721TestFactory.prepare.burnSignedTransaction(sdk.nft, TEST_DATA.KCS, Currency.KCS) }) describe('mintCashbackSignedTransaction', () => { erc721TestFactory.prepare.mintCashbackSignedTransaction(sdk.nft, TEST_DATA.KCS, Currency.KCS) }) describe('mintMultipleCashbackSignedTransaction', () => { erc721TestFactory.prepare.mintMultipleCashbackSignedTransaction(sdk.nft, TEST_DATA.KCS, Currency.KCS) }) describe('mintMultipleSignedTransaction', () => { erc721TestFactory.prepare.mintMultipleSignedTransaction(sdk.nft, TEST_DATA.KCS, Currency.KCS) }) describe('updateCashbackForAuthorSignedTransaction', () => { erc721TestFactory.prepare.updateCashbackForAuthorSignedTransaction( sdk.nft, TEST_DATA.KCS, Currency.KCS, ) }) describe('mintProvenanceSignedTransaction', () => { erc721TestFactory.prepare.mintProvenanceSignedTransaction(sdk.nft, TEST_DATA.KCS, Currency.KCS) }) describe('mintMultipleProvenanceSignedTransaction', () => { erc721TestFactory.prepare.mintMultipleProvenanceSignedTransaction( sdk.nft, TEST_DATA.KCS, Currency.KCS, ) }) }) }) describe('multiToken', () => { describe('prepare', () => { describe('deployMultiToken', () => { multiTokenTestFactory.prepare.deployMultiTokenTransaction(sdk.multiToken, TEST_DATA.KCS, 'KCS') }) describe('mintMultiToken', () => { multiTokenTestFactory.prepare.mintMultiTokenTransaction(sdk.multiToken, TEST_DATA.KCS, 'KCS') }) describe('mintMultiTokenBatch', () => { multiTokenTestFactory.prepare.mintMultiTokenBatchTransaction(sdk.multiToken, TEST_DATA.KCS, 'KCS') }) describe('transferMultiToken', () => { multiTokenTestFactory.prepare.transferMultiTokenTransaction(sdk.multiToken, TEST_DATA.KCS, 'KCS') }) describe('transferMultiTokenBatch', () => { multiTokenTestFactory.prepare.transferMultiTokenBatchTransaction(sdk.multiToken, TEST_DATA.KCS, 'KCS') }) describe('burnMultiToken', () => { multiTokenTestFactory.prepare.burnMultiTokenTransaction(sdk.multiToken, TEST_DATA.KCS, 'KCS') }) describe('burnMultiTokenBatch', () => { multiTokenTestFactory.prepare.burnMultiTokenBatchTransaction(sdk.multiToken, TEST_DATA.KCS, 'KCS') }) }) }) describe('smart contract', () => { describe('prepare', () => { describe('smart contract write method invocation', () => { smartContractTestFactory.prepare.smartContractWriteMethodInvocationTransaction( sdk.smartContract, TEST_DATA.KCS, ) }) }) xdescribe('send', () => { describe('smart contract read method invocation', () => { smartContractTestFactory.send.smartContractReadMethodInvocationTransaction( sdk.smartContract, TEST_DATA.KCS, ) }) }) }) })