whitehat0917 / ConnectSmartContract

This is nodejs source to connect smart contract by web3
0 stars 3 forks source link

code: -32000, message: 'insufficient funds for gas * price + value' #2

Open Sv3nskie opened 2 years ago

Sv3nskie commented 2 years ago

Hi,

Thanks for the code, unfortunately it does not work anymore. keeps getting error "code: -32000, message: 'insufficient funds for gas * price + value'" even getting gas price from latest block does not work.

Any idea how to fix this?

Sv3nskie commented 2 years ago

I found the problem, in order to use make an transaction you need to use this rpc "https://proxy.roninchain.com/free-gas-rpc" and in the tx variable it should be "gasPrice" and not "gasprice" and asign a value 0 or null, then it will work

kickboxer commented 2 years ago

Are these all your fixes? If I don't change rpc url, I have an error:

{ code: -32000, message: 'replacement transaction underpriced' }

But if I change rpc url, I have another error:

Error: PollingBlockTracker - encountered an error while attempting to update latest block: Error: Unknown Error: method is not supported

Sv3nskie commented 2 years ago

Ose the free gas rpc only for tya ladt part to send sign transaction, it will not work to get data from.

On Tue, 19 Oct 2021, 22:09 Maksim Mnatsakanov, @.***> wrote:

Are these all your fixes? If I don't change rpc url, I have an error:

{ code: -32000, message: 'replacement transaction underpriced' }

But if I change rpc url, I have another error:

Error: PollingBlockTracker - encountered an error while attempting to

update latest block: Error: Unknown Error: method is not supported

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/whitehat0917/ConnectSmartContract/issues/2#issuecomment-946822668, or unsubscribe https://github.com/notifications/unsubscribe-auth/AD56KIYD6MMWVQEZEB5PZBDUHWC4DANCNFSM5F2FHCEA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

kickboxer commented 2 years ago

One more question: do you know how to calculate _listingState?

Sv3nskie commented 2 years ago

Web3 is is what i use to getTokenAuctions() hete you get listingIndex

In thist function, auction_contract.method.getCurrentPrices() then listingState = exchange_contract.method.getListingState(listingIndex)

Then I use web3 to signTransaction

The signed trasaction i send with fetch request to the free rpc

On Sun, 24 Oct 2021, 04:44 Maksim Mnatsakanov, @.***> wrote:

One more question: do you know how to calculate _listingState?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/whitehat0917/ConnectSmartContract/issues/2#issuecomment-950219923, or unsubscribe https://github.com/notifications/unsubscribe-auth/AD56KIZECMHZER3OUM2N5XTUIMUB7ANCNFSM5F2FHCEA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

Sv3nskie commented 2 years ago

Btw, be carefull, dont buy to much to fast, they will bann your axies.

On Sun, 24 Oct 2021, 04:44 Maksim Mnatsakanov, @.***> wrote:

One more question: do you know how to calculate _listingState?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/whitehat0917/ConnectSmartContract/issues/2#issuecomment-950219923, or unsubscribe https://github.com/notifications/unsubscribe-auth/AD56KIZECMHZER3OUM2N5XTUIMUB7ANCNFSM5F2FHCEA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

kickboxer commented 2 years ago

Thank! I tried to buy it before, but I got listingState from graphql and I was always late.

Sv3nskie commented 2 years ago

Yeah, i am working now to get all listings directly from contract, will have that ready soon, if you interested I can sell the code for small price, together with autobuy. I also build and scraper for sold items to do research whats best to buy and sell. Comes with gene decoder.

On Sun, 24 Oct 2021, 13:55 Maksim Mnatsakanov, @.***> wrote:

Thank! I tried to buy it before, but I got listingState from graphql and I was always late.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/whitehat0917/ConnectSmartContract/issues/2#issuecomment-950271741, or unsubscribe https://github.com/notifications/unsubscribe-auth/AD56KIYQ5K3ZY4NVB4MCULLUIOUWHANCNFSM5F2FHCEA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

kickboxer commented 2 years ago

What is the best way to get last createdAuction events? Parse explorer.roninchain.com/api or getPastEvents from contract? I see contract events (auction_contract.events.AuctionCreated and auction_contract.events.allEvents) not working here.

Sv3nskie commented 2 years ago

Yeah, so axie website it self uses graphql, but there is a way to get it from the market contract with abi.

I'm almost there I think.

On Sun, 24 Oct 2021, 14:11 Maksim Mnatsakanov, @.***> wrote:

What is the best way to get last createdAuction events? Parse explorer.roninchain.com/api or getPastEvents from contract? I see contract events (auction_contract.events.AuctionCreated and auction_contract.events.allEvents) not working here.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/whitehat0917/ConnectSmartContract/issues/2#issuecomment-950273589, or unsubscribe https://github.com/notifications/unsubscribe-auth/AD56KI3KG5LK6ZPJZEM6IXLUIOWSTANCNFSM5F2FHCEA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

Sv3nskie commented 2 years ago

Wait, i send you full code later. Nodejs

On Mon, 25 Oct 2021, 10:56 Jean Lucas de Carvalho, @.***> wrote:

listingState = exchange_contract.method.getListingState(listingIndex)

Calling exchangeContract.methods.getListingState(listingIndex) gives me the error:

Error: 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.


What is the best way to get last createdAuction events?

Btw, I get the events through getPastEvents, like:

auctionContract.getPastEvents("AuctionCreated", { fromBlock: lastBlock, toBlock: currentBlock, });

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/whitehat0917/ConnectSmartContract/issues/2#issuecomment-950503041, or unsubscribe https://github.com/notifications/unsubscribe-auth/AD56KIYPEUEVA4OAPXCYXPDUITIN3ANCNFSM5F2FHCEA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

jlcarvalho commented 2 years ago

Got it, I was using a wrong exchange address

Sv3nskie commented 2 years ago

Ok, you got it working? Congrats.

On Mon, 25 Oct 2021, 12:04 Jean Lucas de Carvalho, @.***> wrote:

Got it, I was using a wrong exchange address

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/whitehat0917/ConnectSmartContract/issues/2#issuecomment-950529943, or unsubscribe https://github.com/notifications/unsubscribe-auth/AD56KI7NPU4GBYPXSE6R5ITUITQMPANCNFSM5F2FHCEA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

jlcarvalho commented 2 years ago

Yes, thanks.

I think that now I just need to fine tune the buying time (to no get banned, but buy asap) and set up the auto sell.

Sv3nskie commented 2 years ago

You can buy fast, but just wait until the next buy a bot, if you buy to much in a row they will detect.

On Mon, 25 Oct 2021, 12:09 Jean Lucas de Carvalho, @.***> wrote:

Yes, thanks.

I think that now I just need to fine tune the buying time (to no get banned, but buy asap) and set up the auto sell.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/whitehat0917/ConnectSmartContract/issues/2#issuecomment-950532240, or unsubscribe https://github.com/notifications/unsubscribe-auth/AD56KI2YL5PISGEOSVFZNY3UITQ67ANCNFSM5F2FHCEA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

kickboxer commented 2 years ago

Yesterday all was ok, but 'getPastEvents' not working from today:

(node:29217) UnhandledPromiseRejectionWarning: Error: Unknown Error: <html>
<head><title>403 Forbidden</title></head>
<body>
<center><h1>403 Forbidden</h1></center>
<hr><center>openresty</center>
</body>
</html>

listingState = exchange_contract.method.getListingState(listingIndex)

Calling exchangeContract.methods.getListingState(listingIndex) gives me the error:

Error: 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.

What is the best way to get last createdAuction events?

Btw, I get the events through getPastEvents, like:

auctionContract.getPastEvents("AuctionCreated", {
    fromBlock: lastBlock,
    toBlock: currentBlock,
});
Sv3nskie commented 2 years ago

Maybe they found out and blocking now, mayby they have an new rpc? Something must have changed then.

On Mon, 25 Oct 2021, 19:33 Maksim Mnatsakanov, @.***> wrote:

Yesterday all was ok, but 'getPastEvents' not working from today:

`(node:29217) UnhandledPromiseRejectionWarning: Error: Unknown Error:

403 Forbidden 403 Forbidden ------------------------------ openresty ` listingState = exchange_contract.method.getListingState(listingIndex) Calling exchangeContract.methods.getListingState(listingIndex) gives me the error: Error: 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. What is the best way to get last createdAuction events? Btw, I get the events through getPastEvents, like: auctionContract.getPastEvents("AuctionCreated", { fromBlock: lastBlock, toBlock: currentBlock, }); — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub , or unsubscribe . Triage notifications on the go with GitHub Mobile for iOS or Android .
jlcarvalho commented 2 years ago

I think that they blocked requests for that endpoint. I'm getting the auctions from the graphql api for now, but I'm always late :smile:

The marketplace itself gets the data from the blockchain, so maybe they added some kind of validation between them.

jlcarvalho commented 2 years ago

Well, I got banned. And I wasn't buying too fast or too much. Bought 3 axies in 30 minutes.

kickboxer commented 2 years ago

Your account got banned or your axies? Btw I found that some people sell banned axies and be careful you can buy already banned axie. Need to use graphql query getAxieDetail to check is it banned or not.

On Tue, Oct 26, 2021, 8:47 AM Jean Lucas de Carvalho < @.***> wrote:

Well, I was banned. And I wasn't buying too fast or too much. Bought 3 axies in 30 minutes.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/whitehat0917/ConnectSmartContract/issues/2#issuecomment-951581911, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB3UBKCTLE4DJIC4D5I6GMTUIY6GRANCNFSM5F2FHCEA .

jlcarvalho commented 2 years ago

The axies got banned. :disappointed:

Saw some bots buy the axie, then send it to another account to sell it from there. This way if you got banned, just the last bought axie will be banned, since the others will be on a different account.

Sv3nskie commented 2 years ago

Ok, thats sad indeed. So what i found on the axie marketplace, then do some query to an graphql backend if a sell is done, i think we need to do the same after bot buy.

On Tue, 26 Oct 2021, 13:17 Jean Lucas de Carvalho, @.***> wrote:

The axies got banned. 😞

Saw some bots buy the axie, then send it to another account to sell it from there. This way if you got banned, just the last bought axie will be banned, since the others will be on a different account.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/whitehat0917/ConnectSmartContract/issues/2#issuecomment-951597380, or unsubscribe https://github.com/notifications/unsubscribe-auth/AD56KIY3KBKAOKQSRYUYR33UIZBXDANCNFSM5F2FHCEA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

Sv3nskie commented 2 years ago

Yrah, i found that rhey have limited the rpc for overload reasons. So, you woyld need to run your own node if you want to get marketplace data fastest.

On Mon, 25 Oct 2021, 23:02 Jean Lucas de Carvalho, @.***> wrote:

I think that they blocked requests for that endpoint. I'm getting the auctions from the graphql api for now, but I'm always late 😄

The marketplace itself gets the data from the blockchain, so maybe they added some kind of validation between them.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/whitehat0917/ConnectSmartContract/issues/2#issuecomment-951074028, or unsubscribe https://github.com/notifications/unsubscribe-auth/AD56KI7UHKRBBEM4GGIRQTDUIV5SRANCNFSM5F2FHCEA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

Sv3nskie commented 2 years ago

Ok, let me check that. Thanks

On Thu, 28 Oct 2021, 09:16 Jean Lucas de Carvalho, @.***> wrote:

Right now I'm using the getBlock method and it is working fine.

const block = await web3.eth.getBlock("latest", true);console.log(block.transactions);

After get the transaction you'll need to decode the transaction input and filter for transactions with createAuction type. Then everything will work like getPastEvents.

Everything is running ok with the requests, but I'm getting a lot of bans. Even changing accounts for each transaction and buying the axies after 10s results in bans.

Problaby needs to change IP from time to time and/or use different email domains.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/whitehat0917/ConnectSmartContract/issues/2#issuecomment-953444987, or unsubscribe https://github.com/notifications/unsubscribe-auth/AD56KI7UACIAUC3MTF4AH7LUJCW7BANCNFSM5F2FHCEA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

kickboxer commented 2 years ago

Do you know how to prevent ban when buying axies using bot? I created new clean ronin address and bought one axie. But axie got banned immediately. I see other people buy it without ban. And they almost always faster then me.

Sv3nskie commented 2 years ago

I think it has to do with the graphql on axie website, afrer a buy it sends an post request to the backend. I think that has to be done by the bot as well. At the moment I dont have time to spend on this to finish.

On Thu, 11 Nov 2021, 15:52 Maksim Mnatsakanov, @.***> wrote:

Do you know how to prevent ban when buying axies using bot? I created new clean ronin address and bought one axie. But axie got banned immediately. I see other people buy it without ban. And they almost always faster then me.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/whitehat0917/ConnectSmartContract/issues/2#issuecomment-966103463, or unsubscribe https://github.com/notifications/unsubscribe-auth/AD56KI46QOZZHGFYW4XIRFLULN757ANCNFSM5F2FHCEA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

jlcarvalho commented 2 years ago

Do you know how to prevent ban when buying axies using bot? I created new clean ronin address and bought one axie. But axie got banned immediately. I see other people buy it without ban. And they almost always faster then me.

Did you find out?

Sv3nskie commented 2 years ago

Sorry, I have my hands full at the moment. Check the website and track all data from an transaction, also metamask data. That should give all info. The axies I buy with plain script have not been blocked at all.

On Tue, 16 Nov 2021, 12:39 Jean Lucas de Carvalho, @.***> wrote:

Do you know how to prevent ban when buying axies using bot? I created new clean ronin address and bought one axie. But axie got banned immediately. I see other people buy it without ban. And they almost always faster then me.

Did you find out?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/whitehat0917/ConnectSmartContract/issues/2#issuecomment-969880168, or unsubscribe https://github.com/notifications/unsubscribe-auth/AD56KI4A6XT36EQH3D6KMLDUMHVCLANCNFSM5F2FHCEA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

kickboxer commented 2 years ago

I don't know how it works. Yesterday I bought 2 axies for 0.011 and 0.012 weth and all was ok. Today I bought 2 axies for 0.02 and 0.017 weth and these axies got banned.

Sv3nskie commented 2 years ago

Do you have specific data about the buy time? Maybe make a logging about time it takes and time in between etc. There more i fo to analyze the better we might umderstand how they track buys from bot.

On Fri, 19 Nov 2021, 04:54 Maksim Mnatsakanov, @.***> wrote:

I don't know how it works. Yesterday I bought 2 axies for 0.011 and 0.012 weth and all was ok. Today I bought 2 axies for 0.02 and 0.017 weth and these axies got banned.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/whitehat0917/ConnectSmartContract/issues/2#issuecomment-973302823, or unsubscribe https://github.com/notifications/unsubscribe-auth/AD56KI6HIYMXJPO2IXAJQH3UMVYYJANCNFSM5F2FHCEA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

kickboxer commented 2 years ago

All was the same. But! I created first ronin account the day before made any transactions. From second account I bought axies immediately after created account.Time between buy was more than a hour.

Sv3nskie commented 2 years ago

Hi, this is what I found and has to contain the solution. I have not fully tested this, but pretty sure it will make any auto buy not get blocked. Not made any code yet, maybe you guys can figure it out and send me some example code.

So to log an entry into the database after a buy we also need an Auth Token , the process is below:

  1. GetRandomMessage from GraphQL
  2. Sign with private key
  3. GenerateAuthToken from GraphQL

Example

Request {"operationName":"CreateRandomMessage","variables":{},"query":"mutation CreateRandomMessage {\n createRandomMessage\n}\n"} Response {"data":{"createRandomMessage":"Lunacia Kingdom\n\neyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJtZXNzYWdlIjoiNTAwNmM4NTA4ZGIzZjE3NzcyZWNhMzNjNTUyY2Q3OTMxMzFlNjYwOSIsImlhdCI6MTYzNTI4MzM1OSwiZXhwIjoxNjM1Mjg0MjU5LCJpc3MiOiJBeGllSW5maW5pdHkifQ.qBx5L9rrl1Q64YLFsffuBFzGxzMYgwKLWC8-hu1TLyk"}}

Request {"operationName":"CreateAccessTokenWithSignature","variables":{"input":{"mainnet":"ronin","owner":"0x7b93c364645a86867f2f45ee463e9307746f40c1","message":"Lunacia Kingdom\n\neyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJtZXNzYWdlIjoiNTAwNmM4NTA4ZGIzZjE3NzcyZWNhMzNjNTUyY2Q3OTMxMzFlNjYwOSIsImlhdCI6MTYzNTI4MzM1OSwiZXhwIjoxNjM1Mjg0MjU5LCJpc3MiOiJBeGllSW5maW5pdHkifQ.qBx5L9rrl1Q64YLFsffuBFzGxzMYgwKLWC8-hu1TLyk","signature":"0x9b8b902ba5027e3ceb5a344abe4e92a5eff0887865d965c2894992258738f01a2385e8bfe11999e6f7ecf9fe782f5852ef610cc855cdc1b7d5fac9a79b0b101"}},"query":"mutation CreateAccessTokenWithSignature($input: SignatureInput!) {\n createAccessTokenWithSignature(input: $input) {\n newAccount\n result\n accessToken\n typename\n }\n}\n"} Response {"data":{"createAccessTokenWithSignature":{"newAccount":false,"result":true,"accessToken":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhY2NvdW50SWQiOjIwMDQ3MTgsImFjdGl2YXRlZCI6dHJ1ZSwicm9uaW5BZGRyZXNzIjoiMHg3YjkzYzM2NDY0NWE4Njg2N2YyZjQ1ZWU0NjNlOTMwNzc0NmY0MGMxIiwiZXRoQWRkcmVzcyI6IjB4NDNmNzFlYmUzYzk3OWFjZDczM2I5M2JjODc2OTNiYjk4N2YwOWU4ZiIsImlhdCI6MTYzNTI4MzM2MywiZXhwIjoxNjM1ODg4MTYzLCJpc3MiOiJBeGllSW5maW5pdHkifQ.V1USulxZv6a3zxFYqSWHuN3HPYAkapt-EU5h8O_iwkU","typename":"CreateAccessTokenWithSignatureResult"}}}

Request URL: https://graphql-gateway.axieinfinity.com/graphql Request Method: POST

Request Headers :authority: graphql-gateway.axieinfinity.com :method: POST :path: /graphql :scheme: https accept: / accept-encoding: gzip, deflate, br accept-language: en-US,en;q=0.9 authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhY2NvdW50SWQiOjIwMDQ3MTgsImFjdGl2YXRlZCI6dHJ1ZSwicm9uaW5BZGRyZXNzIjoiMHg3YjkzYzM2NDY0NWE4Njg2N2YyZjQ1ZWU0NjNlOTMwNzc0NmY0MGMxIiwiZXRoQWRkcmVzcyI6IjB4NDNmNzFlYmUzYzk3OWFjZDczM2I5M2JjODc2OTNiYjk4N2YwOWU4ZiIsImlhdCI6MTYzNTIyMzc3NywiZXhwIjoxNjM1ODI4NTc3LCJpc3MiOiJBeGllSW5maW5pdHkifQ.PLeQZ3IqlNzw0IlXXS91bVyfwSLKe1vz0tOY0gBIZMY content-length: 417 content-type: application/json cookie: _ga=GA1.2.1711044560.1633312156; amplitude_id_fef1e872c952688acd962d30aa545b9eaxieinfinity.com=eyJkZXZpY2VJZCI6IjFhODg4YTM2LWZjYTItNDdkNy1hNzcwLTVmYzM2OWJiOWI4NVIiLCJ1c2VySWQiOm51bGwsIm9wdE91dCI6ZmFsc2UsInNlc3Npb25JZCI6MTYzMzMxNDU5ODQ0MiwibGFzdEV2ZW50VGltZSI6MTYzMzMxNDU5ODQ0MiwiZXZlbnRJZCI6MiwiaWRlbnRpZnlJZCI6MSwic2VxdWVuY2VOdW1iZXIiOjN9; _gid=GA1.2.434902807.1635221723; cf_clearance=kEuwXY9tVm2VCpP4wPoxYxiHOmo0BdtsKobkT1w4q.c-1635223324-0-150; _gat_gtag_UA_150383258_1=1 origin: https://marketplace.axieinfinity.com/ referer: https://marketplace.axieinfinity.com/ sec-ch-ua: "Google Chrome";v="95", "Chromium";v="95", ";Not A Brand";v="99" sec-ch-ua-mobile: ?0 sec-ch-ua-platform: "Windows" sec-fetch-dest: empty sec-fetch-mode: cors sec-fetch-site: same-site user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.54 Safari/537.36 Request payload {"operationName":"AddActivity","variables":{"action":"BuyAxie","data":{"owner":"0xc4664fff91f4d890fe4382d9dd79884c756c513c","axieId":"1692049","price":"28900000000000000","txHash":"0xc7387b728c6a929e1d79166f9a55546d8e7a1751486735cd4fcc28e96f323ebd"}},"query":"mutation AddActivity($action: Action!, $data: ActivityDataInput!) {\n createActivity(action: $action, data: $data) {\n result\n __typename\n }\n}\n"}

On Fri, 19 Nov 2021 at 17:24, Maksim Mnatsakanov @.***> wrote:

All was the same. But! I created first ronin account the day before made any transactions. From second account I bought axies immediately after created account.Time between buy was more than a hour.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/whitehat0917/ConnectSmartContract/issues/2#issuecomment-973943096, or unsubscribe https://github.com/notifications/unsubscribe-auth/AD56KIYO3TOSXC3VG3OBTDDUMYQVPANCNFSM5F2FHCEA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

-- Met vriendelijke groet,

Sven Esser

Volksbondweg 8c 6214 AR Maastricht Tel: 06-24287834 E-mail: @.***

kickboxer commented 2 years ago

🤔 I know 2 graphql endpoints, which one should we use? https://axieinfinity.com/graphql-server-v2/graphql https://graphql-gateway.axieinfinity.com/graphql

Sv3nskie commented 2 years ago

I did not save that info, you would need to buy a axie om the website and ha e the console open network tab. Thats will contain the right url for the verification of a buy

On Mon, 22 Nov 2021, 13:02 Maksim Mnatsakanov, @.***> wrote:

🤔 I know 2 graphql endpoints, which one should we use? https://axieinfinity.com/graphql-server-v2/graphql https://graphql-gateway.axieinfinity.com/graphql

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/whitehat0917/ConnectSmartContract/issues/2#issuecomment-975156188, or unsubscribe https://github.com/notifications/unsubscribe-auth/AD56KI5P7VW5N3U4RDY4AJTUNHMI3ANCNFSM5F2FHCEA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

d4fuQQ commented 2 years ago

hey guys, super interesting discussion. I didn't try the node script yet, but I've a python script for creating an auth token working and would like to exchange information. just drop me a message on discord: d4fuQQ#3483

Sv3nskie commented 2 years ago

The info is all in a real buy on the market, best thing is to buy and save all data.

I am currently building a block scanner to get latest listings, decode genes, find price that is below the breedcound/genes and then autobuy.

Will have time in 2 weeks to finish this hopefully.

On Tue, 23 Nov 2021, 08:40 Lucky0097, @.***> wrote:

Hello! Great job with the research. I've just implemented your last proposal with my Python script but got an axie banned. Maybe I sent something wrong with the request because I got response from the createActivity but with False result: response: {'data': {'createActivity': {'result': False, '__typename': 'CreateActivityResult'}}} This was the request I sent: url:"https://graphql-gateway.axieinfinity.com/graphql"

{"operationName":"AddActivity","variables":{"action":"BuyAxie","data":{"owner":seller,"axieId":axie_id,"price":bid_amount,"txHash":tx_hash}},"query":"mutation AddActivity($action: Action!, $data: ActivityDataInput!) {\n createActivity(action: $action, data: $data) {\n result\n __typename\n }\n}\n"}

headers_authorization_graph_1={ 'authority': 'graphql-gateway.axieinfinity.com', 'method': 'POST', 'path': '/graphql', 'scheme': 'https', 'accept': '/', 'accept-encoding': 'gzip, deflate, br', 'accept-language': 'es-ES,es;q=0.9,ca;q=0.8,en;q=0.7', 'authorization':'Bearer + token', 'content-length': '1094', 'content-type': 'application/json', 'cookie': '_ga=GA1.2.860292428.1629199363; _gid=GA1.2.1852428103.1637552917; cf_clearance=oY_rfywxITVBs2GS76CWhOclWxO5u4RyRJDc9cilKpA-1637613784-0-150', 'origin': 'https://marketplace.axieinfinity.com', 'referer': 'https://marketplace.axieinfinity.com/', 'sec-ch-ua': 'Google Chrome";v="95", "Chromium";v="95", ";Not A Brand";v="99', 'sec-ch-ua-mobile': '?0', 'sec-fetch-dest': 'empty', 'sec-fetch-mode': 'cors', 'sec-ch-ua-platform':'Windows', 'sec-fetch-site': 'same-site', 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36' }

Maybe the owner param should be our ronin address? Something wrong with headers? (I didn't check console network). tx_hash from the sendRawTransaction. If you are able to share some buy examples I may be able to make some more tests and share results.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/whitehat0917/ConnectSmartContract/issues/2#issuecomment-976092838, or unsubscribe https://github.com/notifications/unsubscribe-auth/AD56KI3LE5HOWSUZVUEKTTDUNLWHLANCNFSM5F2FHCEA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

Sv3nskie commented 2 years ago

There is a list of all nodes, amount of requests are limites but iterating over each for x amount of requests works well. That way you get at least all data fasst. Buying the axie is is not a problem, just the registration to make it look legal buy.

On Tue, 23 Nov 2021, 08:56 Lucky0097, @.***> wrote:

(Just read about your idea of running a full node) It would be a good point but you have to be aprroved by devs to do it. A guy from reedit checked the nodes and found 1 buy bot with a node. But it looks impossible for us.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/whitehat0917/ConnectSmartContract/issues/2#issuecomment-976097959, or unsubscribe https://github.com/notifications/unsubscribe-auth/AD56KI7CKBIXEZW2R7CH3DTUNLYDNANCNFSM5F2FHCEA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

kickboxer commented 2 years ago

BTW 20 minutes ago I bought axie for 0.02. Graphql response { createActivity: { result: true, __typename: 'CreateActivityResult' } }

But the axie got banned.

kickboxer commented 2 years ago

Bad update on marketplace: One specific upgrade we are looking forward to is a warning that will display if you try to sell an Axie for an abnormally low price.

jackynguyen93 commented 2 years ago

anyone knows how to get listing index by abi ?

Sv3nskie commented 2 years ago

Web3 is is what i use to getTokenAuctions() here you get listingIndex

In thist function, auction_contract.method.getCurrentPrices() then listingState = exchange_contract.method.getListingState(listingIndex)

Then I use web3 to signTransaction

On Wed, 24 Nov 2021, 22:38 jackynguyen93, @.***> wrote:

anyone knows how to get listing index by abi ?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/whitehat0917/ConnectSmartContract/issues/2#issuecomment-977992582, or unsubscribe https://github.com/notifications/unsubscribe-auth/AD56KI674AMFYHKYBQEJZGDUNUBIRANCNFSM5F2FHCEA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

jackynguyen93 commented 2 years ago

Web3 is is what i use to getTokenAuctions() here you get listingIndex In thist function, auction_contract.method.getCurrentPrices() then listingState = exchange_contract.method.getListingState(listingIndex) Then I use web3 to signTransaction On Wed, 24 Nov 2021, 22:38 jackynguyen93, @.***> wrote: anyone knows how to get listing index by abi ? — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub <#2 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AD56KI674AMFYHKYBQEJZGDUNUBIRANCNFSM5F2FHCEA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

Thanks, but I looking for a way to get listingIndex, indexState without call these function, something like we can guess these number

Sv3nskie commented 2 years ago

I have no idea, there might be a calculation for that but what factors its calculated from no idea.

On Thu, 25 Nov 2021, 08:11 jackynguyen93, @.***> wrote:

Web3 is is what i use to getTokenAuctions() here you get listingIndex In thist function, auction_contract.method.getCurrentPrices() then listingState = exchange_contract.method.getListingState(listingIndex) Then I use web3 to signTransaction … <#m8521404811043321138> On Wed, 24 Nov 2021, 22:38 jackynguyen93, @.***> wrote: anyone knows how to get listing index by abi ? — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub <#2 (comment) https://github.com/whitehat0917/ConnectSmartContract/issues/2#issuecomment-977992582>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AD56KI674AMFYHKYBQEJZGDUNUBIRANCNFSM5F2FHCEA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub .

Thanks, but I looking for a way to get listingIndex, indexState without call these function, something like we can guess these number

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/whitehat0917/ConnectSmartContract/issues/2#issuecomment-978693325, or unsubscribe https://github.com/notifications/unsubscribe-auth/AD56KIYHDIFUESJO3MKXCUDUNWEL5ANCNFSM5F2FHCEA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

kickboxer commented 2 years ago

Thanks, but I looking for a way to get listingIndex, indexState without call these function, something like we can guess these number We need contract source to know it, but nobody will give it to us:)

Sv3nskie commented 2 years ago

Thats true, but most can be found. In transaction data containing the 4 bytes from a functiin and some data from the contract bytecode.

On Thu, 25 Nov 2021, 16:14 Maksim Mnatsakanov, @.***> wrote:

Thanks, but I looking for a way to get listingIndex, indexState without call these function, something like we can guess these number We need contract source to know it, but nobody will give it to us:)

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/whitehat0917/ConnectSmartContract/issues/2#issuecomment-978997353, or unsubscribe https://github.com/notifications/unsubscribe-auth/AD56KI2BHG4L446KTMXUQILUNX45TANCNFSM5F2FHCEA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

jackynguyen93 commented 2 years ago

Bad update on marketplace: One specific upgrade we are looking forward to is a warning that will display if you try to sell an Axie for an abnormally low price.

Do you have any clue about how to prevent axie getting ban? I check that axie buy after 7 blocks confirmation is sure not banned

Sv3nskie commented 2 years ago

At the moment I have no time at all to work on this. Maybe after 2 weeks I can spend some time. If anyone else has some progress that would be n8ce to share.

On Fri, 26 Nov 2021, 10:49 jackynguyen93, @.***> wrote:

Bad update on marketplace: One specific upgrade we are looking forward to is a warning that will display if you try to sell an Axie for an abnormally low price.

Do you have any clue about how to prevent axie getting ban? I check that axie buy after 7 blocks confirmation is sure not banned

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/whitehat0917/ConnectSmartContract/issues/2#issuecomment-979676284, or unsubscribe https://github.com/notifications/unsubscribe-auth/AD56KIZFISX5C32TX6BOWNTUN37U5ANCNFSM5F2FHCEA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

jackynguyen93 commented 2 years ago

Thanks, btw, I'm researching the way to cancel submitted transactions. Do you know how to do it with zero gas price transaction?

Sv3nskie commented 2 years ago

No idea if they have any function for that, need to check how ronin wallet cancels a transaction if they have that option. Thats will give info on how to do this programatically.

On Sun, 28 Nov 2021, 10:37 jackynguyen93, @.***> wrote:

Thanks, btw, I'm researching the way to cancel submitted transactions. Do you know how to do it with zero gas price transaction?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/whitehat0917/ConnectSmartContract/issues/2#issuecomment-980831315, or unsubscribe https://github.com/notifications/unsubscribe-auth/AD56KI7LFCA3IADPFWEJZ6LUOGPWRANCNFSM5F2FHCEA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

jackynguyen93 commented 2 years ago

I just wonder how this guy can do something like that, same transaction content but the late transaction is success, not the early one image