@tatumio/shared-testing-evm-based
Advanced tools
Comparing version 2.2.44 to 2.2.45
{ | ||
"name": "@tatumio/shared-testing-evm-based", | ||
"version": "2.2.44", | ||
"version": "2.2.45", | ||
"license": "MIT", | ||
@@ -8,12 +8,12 @@ "main": "./src/index.js", | ||
"dependencies": { | ||
"@tatumio/shared-testing-common": "2.2.44", | ||
"@tatumio/api-client": "2.2.44", | ||
"@tatumio/shared-testing-common": "2.2.45", | ||
"@tatumio/api-client": "2.2.45", | ||
"axios": "^0.26.0", | ||
"form-data": "^4.0.0", | ||
"@tatumio/shared-blockchain-evm-based": "2.2.44", | ||
"@tatumio/shared-abstract-sdk": "2.2.44", | ||
"@tatumio/shared-blockchain-evm-based": "2.2.45", | ||
"@tatumio/shared-abstract-sdk": "2.2.45", | ||
"bignumber.js": "^9.0.2", | ||
"@tatumio/shared-core": "2.2.44", | ||
"@tatumio/shared-core": "2.2.45", | ||
"lodash": "^4.17.21", | ||
"@tatumio/shared-blockchain-abstract": "2.2.44", | ||
"@tatumio/shared-blockchain-abstract": "2.2.45", | ||
"ethereumjs-wallet": "^1.0.2", | ||
@@ -20,0 +20,0 @@ "bip39": "^3.0.2", |
import { SdkWithErc721Functions } from '@tatumio/shared-blockchain-abstract'; | ||
import { BlockchainTestData } from '@tatumio/shared-testing-common'; | ||
import { GanacheAccount } from './ganacheHelper'; | ||
export declare const erc721TestFactory: { | ||
@@ -10,9 +9,4 @@ prepare: { | ||
mintMultipleSignedTransaction: (sdk: SdkWithErc721Functions, testData: BlockchainTestData) => void; | ||
mintCashbackSignedTransaction: (sdk: SdkWithErc721Functions, testData: BlockchainTestData) => void; | ||
mintProvenanceSignedTransaction: (sdk: SdkWithErc721Functions, testData: BlockchainTestData, accounts?: GanacheAccount[], inMemoryProvider?: string) => void; | ||
mintMultipleCashbackSignedTransaction: (sdk: SdkWithErc721Functions, testData: BlockchainTestData) => void; | ||
mintMultipleProvenanceSignedTransaction: (sdk: SdkWithErc721Functions, testData: BlockchainTestData, accounts?: GanacheAccount[]) => void; | ||
updateCashbackForAuthorSignedTransaction: (sdk: SdkWithErc721Functions, testData: BlockchainTestData) => void; | ||
burnSignedTransaction: (sdk: SdkWithErc721Functions, testData: BlockchainTestData) => void; | ||
}; | ||
}; |
@@ -198,274 +198,2 @@ "use strict"; | ||
}, | ||
mintCashbackSignedTransaction: (sdk, testData) => { | ||
var _a, _b; | ||
const provider = testData === null || testData === void 0 ? void 0 : testData.PROVIDER; | ||
const address = ((_a = testData.TESTNET.ERC_721) === null || _a === void 0 ? void 0 : _a.ADDRESS) | ||
? (_b = testData.TESTNET.ERC_721) === null || _b === void 0 ? void 0 : _b.ADDRESS | ||
: '0x811DfbFF13ADFBC3Cf653dCc373C03616D3471c9'; | ||
it('valid from privateKey', () => tslib_1.__awaiter(void 0, void 0, void 0, function* () { | ||
const result = yield sdk.prepare.mintCashbackSignedTransaction({ | ||
to: address, | ||
contractAddress: testData.TESTNET.ERC_721.CONTRACT_ADDRESS, | ||
fromPrivateKey: testData.TESTNET.ERC_721.PRIVATE_KEY, | ||
tokenId: new Date().getTime().toString(), | ||
url: 'https://my_token_data.com', | ||
cashbackValues: ['0.5'], | ||
authorAddresses: [address], | ||
fee: { | ||
gasLimit: '3264521', | ||
gasPrice: '20', | ||
}, | ||
}, provider); | ||
(0, shared_testing_common_1.expectHexString)(result); | ||
})); | ||
it('valid from SignatureId', () => tslib_1.__awaiter(void 0, void 0, void 0, function* () { | ||
const result = yield sdk.prepare.mintCashbackSignedTransaction({ | ||
to: address, | ||
contractAddress: testData.TESTNET.ERC_721.CONTRACT_ADDRESS, | ||
signatureId: 'cac88687-33ed-4ca1-b1fc-b02986a90975', | ||
tokenId: new Date().getTime().toString(), | ||
url: 'https://my_token_data.com', | ||
cashbackValues: ['0.5'], | ||
authorAddresses: [address], | ||
fee: { | ||
gasLimit: '3264521', | ||
gasPrice: '20', | ||
}, | ||
}, provider); | ||
const json = JSON.parse(result); | ||
(0, shared_testing_common_1.expectHexString)(json.data); | ||
})); | ||
it('invalid address', () => tslib_1.__awaiter(void 0, void 0, void 0, function* () { | ||
try { | ||
yield sdk.prepare.mintCashbackSignedTransaction({ | ||
to: 'someinvalidaddress', | ||
tokenId: new Date().getTime().toString(), | ||
url: 'https://my_token_data.com', | ||
contractAddress: testData.TESTNET.ERC_721.CONTRACT_ADDRESS, | ||
fromPrivateKey: testData.TESTNET.ERC_721.PRIVATE_KEY, | ||
cashbackValues: ['0.5'], | ||
authorAddresses: [address], | ||
fee: { | ||
gasLimit: '3264521', | ||
gasPrice: '20', | ||
}, | ||
}, provider); | ||
fail(); | ||
} | ||
catch (e) { | ||
expect(e.reason).toMatch('invalid address'); | ||
} | ||
})); | ||
}, | ||
mintProvenanceSignedTransaction: (sdk, testData, accounts, inMemoryProvider) => { | ||
var _a, _b; | ||
const provider = inMemoryProvider ? inMemoryProvider : testData === null || testData === void 0 ? void 0 : testData.PROVIDER; | ||
const address = ((_a = testData.TESTNET.ERC_721) === null || _a === void 0 ? void 0 : _a.ADDRESS) | ||
? (_b = testData.TESTNET.ERC_721) === null || _b === void 0 ? void 0 : _b.ADDRESS | ||
: '0x811DfbFF13ADFBC3Cf653dCc373C03616D3471c9'; | ||
it('valid from privateKey', () => tslib_1.__awaiter(void 0, void 0, void 0, function* () { | ||
const result = yield sdk.prepare.mintProvenanceSignedTransaction({ | ||
to: address, | ||
contractAddress: accounts ? accounts[0].address : testData.TESTNET.ERC_721.CONTRACT_ADDRESS, | ||
fromPrivateKey: accounts ? accounts[0].privateKey : testData.TESTNET.ERC_721.PRIVATE_KEY, | ||
tokenId: new Date().getTime().toString(), | ||
url: 'https://my_token_data.com', | ||
authorAddresses: [address], | ||
provenance: true, | ||
fee: { | ||
gasLimit: '3264521', | ||
gasPrice: '20', | ||
}, | ||
}, provider); | ||
(0, shared_testing_common_1.expectHexString)(result); | ||
})); | ||
it('valid from SignatureId', () => tslib_1.__awaiter(void 0, void 0, void 0, function* () { | ||
const result = yield sdk.prepare.mintProvenanceSignedTransaction({ | ||
to: address, | ||
contractAddress: testData.TESTNET.ERC_721.CONTRACT_ADDRESS, | ||
signatureId: 'cac88687-33ed-4ca1-b1fc-b02986a90975', | ||
tokenId: new Date().getTime().toString(), | ||
url: 'https://my_token_data.com', | ||
provenance: true, | ||
authorAddresses: [address], | ||
fee: { | ||
gasLimit: '3264521', | ||
gasPrice: '20', | ||
}, | ||
}, provider); | ||
const json = JSON.parse(result); | ||
(0, shared_testing_common_1.expectHexString)(json.data); | ||
})); | ||
it('invalid address', () => tslib_1.__awaiter(void 0, void 0, void 0, function* () { | ||
try { | ||
yield sdk.prepare.mintProvenanceSignedTransaction({ | ||
to: 'someinvalidaddress', | ||
tokenId: new Date().getTime().toString(), | ||
url: 'https://my_token_data.com', | ||
contractAddress: testData.TESTNET.ERC_721.CONTRACT_ADDRESS, | ||
fromPrivateKey: testData.TESTNET.ERC_721.PRIVATE_KEY, | ||
provenance: true, | ||
authorAddresses: [address], | ||
fee: { | ||
gasLimit: '3264521', | ||
gasPrice: '20', | ||
}, | ||
}, provider); | ||
fail(); | ||
} | ||
catch (e) { | ||
expect(e.reason).toMatch('invalid address'); | ||
} | ||
})); | ||
}, | ||
mintMultipleCashbackSignedTransaction: (sdk, testData) => { | ||
var _a, _b; | ||
const provider = testData === null || testData === void 0 ? void 0 : testData.PROVIDER; | ||
const address = ((_a = testData.TESTNET.ERC_721) === null || _a === void 0 ? void 0 : _a.ADDRESS) | ||
? (_b = testData.TESTNET.ERC_721) === null || _b === void 0 ? void 0 : _b.ADDRESS | ||
: '0x811DfbFF13ADFBC3Cf653dCc373C03616D3471c9'; | ||
it('valid from privateKey', () => tslib_1.__awaiter(void 0, void 0, void 0, function* () { | ||
const result = yield sdk.prepare.mintMultipleCashbackSignedTransaction({ | ||
to: [address, address], | ||
contractAddress: testData.TESTNET.ERC_721.CONTRACT_ADDRESS, | ||
fromPrivateKey: testData.TESTNET.ERC_721.PRIVATE_KEY, | ||
tokenId: [new Date().getTime().toString(), new Date().getTime().toString()], | ||
url: ['https://my_token_data.com', 'https://my_token_data.com'], | ||
cashbackValues: [['0.5'], ['0.5']], | ||
authorAddresses: [[address], [address]], | ||
fee: { | ||
gasLimit: '3264521', | ||
gasPrice: '20', | ||
}, | ||
}, provider); | ||
(0, shared_testing_common_1.expectHexString)(result); | ||
})); | ||
it('valid from SignatureId', () => tslib_1.__awaiter(void 0, void 0, void 0, function* () { | ||
const result = yield sdk.prepare.mintMultipleSignedTransaction({ | ||
to: [address, address], | ||
contractAddress: testData.TESTNET.ERC_721.CONTRACT_ADDRESS, | ||
signatureId: 'cac88687-33ed-4ca1-b1fc-b02986a90975', | ||
tokenId: [new Date().getTime().toString(), new Date().getTime().toString()], | ||
url: ['https://my_token_data.com', 'https://my_token_data.com'], | ||
cashbackValues: [['0.5'], ['0.5']], | ||
authorAddresses: [[address], [address]], | ||
fee: { | ||
gasLimit: '3264521', | ||
gasPrice: '20', | ||
}, | ||
}, provider); | ||
const json = JSON.parse(result); | ||
(0, shared_testing_common_1.expectHexString)(json.data); | ||
})); | ||
it('invalid address', () => tslib_1.__awaiter(void 0, void 0, void 0, function* () { | ||
try { | ||
yield sdk.prepare.mintMultipleSignedTransaction({ | ||
to: ['invalid', 'invalid'], | ||
contractAddress: testData.TESTNET.ERC_721.CONTRACT_ADDRESS, | ||
fromPrivateKey: testData.TESTNET.ERC_721.PRIVATE_KEY, | ||
tokenId: [new Date().getTime().toString(), new Date().getTime().toString()], | ||
url: ['https://my_token_data.com', 'https://my_token_data.com'], | ||
cashbackValues: [['0.5'], ['0.5']], | ||
fee: { | ||
gasLimit: '3264521', | ||
gasPrice: '20', | ||
}, | ||
}, provider); | ||
fail(); | ||
} | ||
catch (e) { | ||
expect(e.reason).toMatch('invalid address'); | ||
} | ||
})); | ||
}, | ||
mintMultipleProvenanceSignedTransaction: (sdk, testData, accounts) => { | ||
var _a, _b; | ||
const provider = testData === null || testData === void 0 ? void 0 : testData.PROVIDER; | ||
const address = ((_a = testData.TESTNET.ERC_721) === null || _a === void 0 ? void 0 : _a.ADDRESS) | ||
? (_b = testData.TESTNET.ERC_721) === null || _b === void 0 ? void 0 : _b.ADDRESS | ||
: '0x811DfbFF13ADFBC3Cf653dCc373C03616D3471c9'; | ||
it('valid from privateKey', () => tslib_1.__awaiter(void 0, void 0, void 0, function* () { | ||
const result = yield sdk.prepare.mintMultipleProvenanceSignedTransaction({ | ||
to: [address, address], | ||
contractAddress: accounts ? accounts[0].address : testData.TESTNET.ERC_721.CONTRACT_ADDRESS, | ||
fromPrivateKey: accounts ? accounts[0].privateKey : testData.TESTNET.ERC_721.PRIVATE_KEY, | ||
tokenId: [new Date().getTime().toString(), new Date().getTime().toString()], | ||
url: ['https://my_token_data.com', 'https://my_token_data.com'], | ||
authorAddresses: [[address], [address]], | ||
fixedValues: [['1'], ['2']], | ||
fee: { | ||
gasLimit: '3264521', | ||
gasPrice: '20', | ||
}, | ||
}, provider); | ||
(0, shared_testing_common_1.expectHexString)(result); | ||
})); | ||
it('valid from SignatureId', () => tslib_1.__awaiter(void 0, void 0, void 0, function* () { | ||
const result = yield sdk.prepare.mintMultipleProvenanceSignedTransaction({ | ||
to: [address, address], | ||
contractAddress: testData.TESTNET.ERC_721.CONTRACT_ADDRESS, | ||
signatureId: 'cac88687-33ed-4ca1-b1fc-b02986a90975', | ||
tokenId: [new Date().getTime().toString(), new Date().getTime().toString()], | ||
url: ['https://my_token_data.com', 'https://my_token_data.com'], | ||
fixedValues: [['1'], ['2']], | ||
authorAddresses: [[address], [address]], | ||
fee: { | ||
gasLimit: '3264521', | ||
gasPrice: '20', | ||
}, | ||
}, provider); | ||
const json = JSON.parse(result); | ||
(0, shared_testing_common_1.expectHexString)(json.data); | ||
})); | ||
it('invalid address', () => tslib_1.__awaiter(void 0, void 0, void 0, function* () { | ||
try { | ||
yield sdk.prepare.mintMultipleProvenanceSignedTransaction({ | ||
to: ['invalid', 'invalid'], | ||
contractAddress: testData.TESTNET.ERC_721.CONTRACT_ADDRESS, | ||
fromPrivateKey: testData.TESTNET.ERC_721.PRIVATE_KEY, | ||
tokenId: [new Date().getTime().toString(), new Date().getTime().toString()], | ||
url: ['https://my_token_data.com', 'https://my_token_data.com'], | ||
fixedValues: [['1'], ['2']], | ||
fee: { | ||
gasLimit: '3264521', | ||
gasPrice: '20', | ||
}, | ||
}, provider); | ||
fail(); | ||
} | ||
catch (e) { | ||
expect(e.reason).toMatch('invalid address'); | ||
} | ||
})); | ||
}, | ||
updateCashbackForAuthorSignedTransaction: (sdk, testData) => { | ||
const provider = testData.PROVIDER; | ||
it('valid from privateKey', () => tslib_1.__awaiter(void 0, void 0, void 0, function* () { | ||
const result = yield sdk.prepare.updateCashbackForAuthorSignedTransaction({ | ||
contractAddress: testData.TESTNET.ERC_721.CONTRACT_ADDRESS, | ||
fromPrivateKey: testData.TESTNET.ERC_721.PRIVATE_KEY, | ||
tokenId: new Date().getTime().toString(), | ||
cashbackValue: '0.8', | ||
fee: { | ||
gasLimit: '3264521', | ||
gasPrice: '20', | ||
}, | ||
}, provider); | ||
(0, shared_testing_common_1.expectHexString)(result); | ||
})); | ||
it('valid from SignatureId', () => tslib_1.__awaiter(void 0, void 0, void 0, function* () { | ||
const result = yield sdk.prepare.updateCashbackForAuthorSignedTransaction({ | ||
contractAddress: testData.TESTNET.ERC_721.CONTRACT_ADDRESS, | ||
signatureId: 'cac88687-33ed-4ca1-b1fc-b02986a90975', | ||
tokenId: new Date().getTime().toString(), | ||
cashbackValue: '0.8', | ||
fee: { | ||
gasLimit: '3264521', | ||
gasPrice: '20', | ||
}, | ||
}, provider); | ||
const json = JSON.parse(result); | ||
(0, shared_testing_common_1.expectHexString)(json.data); | ||
})); | ||
}, | ||
burnSignedTransaction: (sdk, testData) => { | ||
@@ -472,0 +200,0 @@ const provider = testData === null || testData === void 0 ? void 0 : testData.PROVIDER; |
Sorry, the diff of this file is not supported yet
156977
1926
+ Added@tatumio/api-client@2.2.45(transitive)
+ Added@tatumio/shared-abstract-sdk@2.2.45(transitive)
+ Added@tatumio/shared-blockchain-abstract@2.2.45(transitive)
+ Added@tatumio/shared-blockchain-evm-based@2.2.45(transitive)
+ Added@tatumio/shared-core@2.2.45(transitive)
+ Added@tatumio/shared-testing-common@2.2.45(transitive)
- Removed@tatumio/api-client@2.2.44(transitive)
- Removed@tatumio/shared-abstract-sdk@2.2.44(transitive)
- Removed@tatumio/shared-blockchain-abstract@2.2.44(transitive)
- Removed@tatumio/shared-blockchain-evm-based@2.2.44(transitive)
- Removed@tatumio/shared-core@2.2.44(transitive)
- Removed@tatumio/shared-testing-common@2.2.44(transitive)
Updated@tatumio/api-client@2.2.45
Updated@tatumio/shared-core@2.2.45