Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ALL-6466: polygon amoy (v1) #1095

Merged
merged 1 commit into from
May 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions src/multiToken/multiToken.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ describe('NFT tests', () => {
chain: Currency.MATIC,
fromPrivateKey: '0x1a4344e55c562db08700dd32e52e62e7c40b1ef5e27c6ddd969de9891a899b29',
uri: 'tatum',
}, 'https://rpc-mumbai.matic.today')
}, 'https://rpc-amoy.matic.today')
expect(deployMultiTokenToken).not.toBeNull()
console.log('response::', deployMultiTokenToken)
})
Expand All @@ -251,7 +251,7 @@ describe('NFT tests', () => {
amount: '1000',
fromPrivateKey: '0x1a4344e55c562db08700dd32e52e62e7c40b1ef5e27c6ddd969de9891a899b29',
contractAddress: '0xe2a8d7c5b2b4acad7e5b9aec0998cdbbeed45e49'
}, 'https://rpc-mumbai.matic.today')
}, 'https://rpc-amoy.matic.today')
console.log(tokenId)
expect(mintedToken).not.toBeNull()
})
Expand All @@ -265,7 +265,7 @@ describe('NFT tests', () => {
amounts: [['100', '100'], ['100', '100']],
fromPrivateKey: '0x1a4344e55c562db08700dd32e52e62e7c40b1ef5e27c6ddd969de9891a899b29',
contractAddress: '0xe2a8d7c5b2b4acad7e5b9aec0998cdbbeed45e49'
}, 'https://rpc-mumbai.matic.today')
}, 'https://rpc-amoy.matic.today')
console.log(mintedToken)
expect(mintedToken).not.toBeNull()
})
Expand All @@ -282,7 +282,7 @@ describe('NFT tests', () => {
gasLimit: '7000000',
gasPrice: '100'
},
}, 'https://rpc-mumbai.matic.today')
}, 'https://rpc-amoy.matic.today')
console.log('Result::', sendMultiTokenToken)
expect(sendMultiTokenToken).not.toBeNull()
})
Expand All @@ -294,7 +294,7 @@ describe('NFT tests', () => {
chain: Currency.MATIC,
fromPrivateKey: '0x1a4344e55c562db08700dd32e52e62e7c40b1ef5e27c6ddd969de9891a899b29',
contractAddress: '0xe2a8d7c5b2b4acad7e5b9aec0998cdbbeed45e49'
}, 'https://rpc-mumbai.matic.today')
}, 'https://rpc-amoy.matic.today')
console.log(burnMultiTokenToken)
expect(burnMultiTokenToken).not.toBeNull()
})
Expand All @@ -307,7 +307,7 @@ describe('NFT tests', () => {
fromPrivateKey: '0x1a4344e55c562db08700dd32e52e62e7c40b1ef5e27c6ddd969de9891a899b29',
contractAddress: '0xe2a8d7c5b2b4acad7e5b9aec0998cdbbeed45e49',

}, 'https://rpc-mumbai.matic.today')
}, 'https://rpc-amoy.matic.today')
expect(burnMultiTokenToken).not.toBeNull()
})

Expand All @@ -320,7 +320,7 @@ describe('NFT tests', () => {
contractAddress: '0xe2a8d7c5b2b4acad7e5b9aec0998cdbbeed45e49',
amount: '1',
data: '0x1234',
}, 'https://rpc-mumbai.matic.today')
}, 'https://rpc-amoy.matic.today')
console.log('Result::', sendMultiTokenToken)
expect(sendMultiTokenToken).not.toBeNull()
})
Expand Down
24 changes: 12 additions & 12 deletions src/nft/marketplace/auction.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ describe('Auction tests', () => {
body.feeRecipient = '0x811dfbff13adfbc3cf653dcc373c03616d3471c9';
body.auctionFee = 150;
body.chain = Currency.MATIC;
const test = await deployAuction(true, body, 'https://rpc-mumbai.maticvigil.com');
const test = await deployAuction(true, body, 'https://rpc-amoy.maticvigil.com');
console.log(test);
expect(test).toBeDefined();
});
Expand All @@ -301,14 +301,14 @@ describe('Auction tests', () => {
mint.tokenId = tokenId;
mint.url = 'https://google.com';
mint.chain = Currency.MATIC;
console.log(await mintNFTWithUri(true, mint, 'https://rpc-mumbai.maticvigil.com'));
console.log(await mintNFTWithUri(true, mint, 'https://rpc-amoy.maticvigil.com'));

await sleep();
console.log(await sendAuctionApproveNftTransfer(true, {
fromPrivateKey: '0x1a4344e55c562db08700dd32e52e62e7c40b1ef5e27c6ddd969de9891a899b29',
chain: Currency.MATIC, contractAddress: '0x5d7d868ed584b04b922905a481f274206a42dd8a',
isErc721: true, spender: '0x7a2cc5a4788a15d5705b1d31e0ff5cfc4465d073', tokenId
}, 'https://rpc-mumbai.maticvigil.com'));
}, 'https://rpc-amoy.maticvigil.com'));

await sleep();
const body = new CreateAuction();
Expand All @@ -321,7 +321,7 @@ describe('Auction tests', () => {
body.isErc721 = true;
body.seller = '0x811dfbff13adfbc3cf653dcc373c03616d3471c9';
body.chain = Currency.MATIC;
console.log(await sendAuctionCreate(true, body, 'https://rpc-mumbai.maticvigil.com'));
console.log(await sendAuctionCreate(true, body, 'https://rpc-amoy.maticvigil.com'));

await sleep(2000);
const bid = new InvokeAuctionOperation();
Expand All @@ -330,15 +330,15 @@ describe('Auction tests', () => {
bid.id = tokenId;
bid.bidValue = '0.001015';
bid.chain = Currency.MATIC;
console.log(await sendAuctionBid(true, bid, 'https://rpc-mumbai.maticvigil.com'));
console.log(await sendAuctionBid(true, bid, 'https://rpc-amoy.maticvigil.com'));

await sleep(20000);
const settle = new InvokeAuctionOperation();
settle.fromPrivateKey = '0xa488a82b8b57c3ece4307525741fd8256781906c5fad948b85f1d63000948236';
settle.contractAddress = '0x7a2cc5a4788a15d5705b1d31e0ff5cfc4465d073';
settle.id = tokenId;
settle.chain = Currency.MATIC;
console.log(await sendAuctionSettle(true, settle, 'https://rpc-mumbai.maticvigil.com'));
console.log(await sendAuctionSettle(true, settle, 'https://rpc-amoy.maticvigil.com'));
});

it('should create auction ERC20 asset', async () => {
Expand All @@ -349,7 +349,7 @@ describe('Auction tests', () => {
approve.chain = Currency.MATIC;
approve.amount = '0.001015';
approve.fromPrivateKey = '0x4874827a55d87f2309c55b835af509e3427aa4d52321eeb49a2b93b5c0f8edfb';
console.log(await sendAuctionApproveErc20Transfer(true, approve, 'https://rpc-mumbai.maticvigil.com'));
console.log(await sendAuctionApproveErc20Transfer(true, approve, 'https://rpc-amoy.maticvigil.com'));

const mint = new MintErc721();
mint.fromPrivateKey = '0x1a4344e55c562db08700dd32e52e62e7c40b1ef5e27c6ddd969de9891a899b29';
Expand All @@ -358,14 +358,14 @@ describe('Auction tests', () => {
mint.tokenId = tokenId;
mint.url = 'https://google.com';
mint.chain = Currency.MATIC;
console.log(await mintNFTWithUri(true, mint, 'https://rpc-mumbai.maticvigil.com'));
console.log(await mintNFTWithUri(true, mint, 'https://rpc-amoy.maticvigil.com'));

await sleep();
console.log(await sendAuctionApproveNftTransfer(true, {
fromPrivateKey: '0x1a4344e55c562db08700dd32e52e62e7c40b1ef5e27c6ddd969de9891a899b29',
chain: Currency.MATIC, contractAddress: '0x5d7d868ed584b04b922905a481f274206a42dd8a',
isErc721: true, spender: '0x7a2cc5a4788a15d5705b1d31e0ff5cfc4465d073', tokenId
}, 'https://rpc-mumbai.maticvigil.com'));
}, 'https://rpc-amoy.maticvigil.com'));

await sleep();
const body = new CreateAuction();
Expand All @@ -379,7 +379,7 @@ describe('Auction tests', () => {
body.erc20Address = '0x326c977e6efc84e512bb9c30f76e30c160ed06fb';
body.seller = '0x811dfbff13adfbc3cf653dcc373c03616d3471c9';
body.chain = Currency.MATIC;
console.log(await sendAuctionCreate(true, body, 'https://rpc-mumbai.maticvigil.com'));
console.log(await sendAuctionCreate(true, body, 'https://rpc-amoy.maticvigil.com'));

await sleep(2000);
const bid = new InvokeAuctionOperation();
Expand All @@ -392,15 +392,15 @@ describe('Auction tests', () => {
gasLimit: '300000',
gasPrice: '5'
};
console.log(await sendAuctionBid(true, bid, 'https://rpc-mumbai.maticvigil.com'));
console.log(await sendAuctionBid(true, bid, 'https://rpc-amoy.maticvigil.com'));

await sleep(20000);
const settle = new InvokeAuctionOperation();
settle.fromPrivateKey = '0xa488a82b8b57c3ece4307525741fd8256781906c5fad948b85f1d63000948236';
settle.contractAddress = '0x7a2cc5a4788a15d5705b1d31e0ff5cfc4465d073';
settle.id = tokenId;
settle.chain = Currency.MATIC;
console.log(await sendAuctionSettle(true, settle, 'https://rpc-mumbai.maticvigil.com'));
console.log(await sendAuctionSettle(true, settle, 'https://rpc-amoy.maticvigil.com'));
});
});

Expand Down
12 changes: 6 additions & 6 deletions src/nft/marketplace/listing.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ describe('Marketplace Listing tests', () => {
body.feeRecipient = '0x811dfbff13adfbc3cf653dcc373c03616d3471c9';
body.marketplaceFee = 150;
body.chain = Currency.MATIC;
const test = await deployMarketplaceListing(true, body, 'https://rpc-mumbai.matic.today');
const test = await deployMarketplaceListing(true, body, 'https://rpc-amoy.matic.today');
console.log(test);
expect(test).toBeDefined();
})
Expand All @@ -205,7 +205,7 @@ describe('Marketplace Listing tests', () => {
body.price = '0.001';
body.seller = '0x811dfbff13adfbc3cf653dcc373c03616d3471c9';
body.chain = Currency.MATIC;
console.log(await sendMarketplaceCreateListing(true, body, 'https://rpc-mumbai.matic.today'));
console.log(await sendMarketplaceCreateListing(true, body, 'https://rpc-amoy.matic.today'));

await new Promise(r => setTimeout(r, 5000));
console.log(await transferNFT(true, {
Expand All @@ -223,7 +223,7 @@ describe('Marketplace Listing tests', () => {
r.methodName = 'getListing';
r.methodABI = listing.abi.find(a => a.name === r.methodName);
r.params = ['8'];
console.log(await sendPolygonSmartContractMethodInvocationTransaction(true, r, 'https://rpc-mumbai.matic.today'));
console.log(await sendPolygonSmartContractMethodInvocationTransaction(true, r, 'https://rpc-amoy.matic.today'));
})

it('should get marketplace fee', async () => {
Expand All @@ -232,7 +232,7 @@ describe('Marketplace Listing tests', () => {
r.methodName = 'getMarketplaceFee';
r.methodABI = listing.abi.find(a => a.name === r.methodName);
r.params = [];
console.log(await sendPolygonSmartContractReadMethodInvocationTransaction(true, r, 'https://rpc-mumbai.matic.today'));
console.log(await sendPolygonSmartContractReadMethodInvocationTransaction(true, r, 'https://rpc-amoy.matic.today'));
})

it('should buy listing native', async () => {
Expand All @@ -242,7 +242,7 @@ describe('Marketplace Listing tests', () => {
body.listingId = '111';
body.amount = '0.0015';
body.chain = Currency.MATIC;
console.log(await sendMarketplaceBuyListing(true, body, 'https://rpc-mumbai.matic.today'));
console.log(await sendMarketplaceBuyListing(true, body, 'https://rpc-amoy.matic.today'));
})

it('should approve erc20', async () => {
Expand All @@ -252,7 +252,7 @@ describe('Marketplace Listing tests', () => {
approve.chain = Currency.MATIC;
approve.amount = '0.002';
approve.fromPrivateKey = '0xf09110a0aae3dddba3d722c6c629fb08082963d8ed38afaf25cfce084c22e3d2';
console.log(await sendMarketplaceApproveErc20Spending(true, approve, 'https://rpc-mumbai.matic.today'));
console.log(await sendMarketplaceApproveErc20Spending(true, approve, 'https://rpc-amoy.matic.today'));
});
})
describe.skip('Marketplace Listing TRON transactions', () => {
Expand Down
10 changes: 5 additions & 5 deletions src/nft/nft.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ describe('NFT tests', () => {
fromPrivateKey: '0x1a4344e55c562db08700dd32e52e62e7c40b1ef5e27c6ddd969de9891a899b29',
name: 'TatumToken',
fee: {gasLimit: '6000000', gasPrice: '5'}
}, 'https://rpc-mumbai.matic.today');
}, 'https://rpc-amoy.matic.today');
expect(deployErc721Token).not.toBeNull();
console.log(deployErc721Token);
});
Expand All @@ -325,7 +325,7 @@ describe('NFT tests', () => {
authorAddresses: [['0x6c4A48886b77D1197eCFBDaA3D3f35d81d584342', '0x811dfbff13adfbc3cf653dcc373c03616d3471c9'], ['0x6c4A48886b77D1197eCFBDaA3D3f35d81d584342', '0x811dfbff13adfbc3cf653dcc373c03616d3471c9']],
cashbackValues: [['0.25', '0.25'], ['0.25', '0.25']],
fee: {gasLimit: '6000000', gasPrice: '100'}
}, 'https://rpc-mumbai.matic.today');
}, 'https://rpc-amoy.matic.today');
console.log(mintedTokens);
expect(mintedTokens).not.toBeNull();
});
Expand All @@ -339,7 +339,7 @@ describe('NFT tests', () => {
contractAddress: '0xdb778b39bd7a7c479b3bb1d70df6665fe73e7e1d',
};
console.log(await createNFT(true, body, readFileSync('/Users/ssramko/Downloads/logo_tatum.png'),
'Tatum LOGO', 'description', undefined, 'https://rpc-mumbai.matic.today'));
'Tatum LOGO', 'description', undefined, 'https://rpc-amoy.matic.today'));
});
it('should obtain metadata from NFT on IPFS on MATIC', async () => {
const data = await getNFTImage(Currency.MATIC, '0x6d8eae641416b8b79e0fb3a92b17448cfff02b11', '1629193549967');
Expand All @@ -362,7 +362,7 @@ describe('NFT tests', () => {
contractAddress: '0xdf82c2f74aa7b629bda65b1cfd258248c9c2b7d3',
authorAddresses: ['0x6c4A48886b77D1197eCFBDaA3D3f35d81d584342'],
cashbackValues: ['0.25']
}, 'https://rpc-mumbai.matic.today');
}, 'https://rpc-amoy.matic.today');
console.log('mintedToken', mintedToken);
expect(mintedToken).not.toBeNull();
} catch (e) {
Expand All @@ -377,7 +377,7 @@ describe('NFT tests', () => {
fromPrivateKey: '0x4874827a55d87f2309c55b835af509e3427aa4d52321eeb49a2b93b5c0f8edfb',
contractAddress: '0xdf82c2f74aa7b629bda65b1cfd258248c9c2b7d3',
value: '1'
}, 'https://rpc-mumbai.matic.today');
}, 'https://rpc-amoy.matic.today');
console.log('response: ', sendErc721Token);
expect(sendErc721Token).not.toBeNull();
});
Expand Down
Loading
Loading