Skip to content

Accepting trade offer doesn't work? #446

@JurnonCodes

Description

@JurnonCodes

Hi,

I do not really comprehend this one, so any help is appreciated. Just to give some feedback - I'm using ConfirmationExecutor in my code to confirm listings which I put on Community Market place and it works fine.

Now I have tried to come up with a solution to confirm incoming trade offers, but I've hit a brickwall :( Tried using ConfirmationExecutor, but same logic like for listings doesn't seem to work. I have tried looking into the inside functions of this class and the inside functions seem to get response:200's, but no outstanding confirmations are being found, even though through UI I can see trades waiting to be accepted.

With these print statements added:

def _get_confirmations(self) -> list[Confirmation]:
        confirmations = []
        confirmations_page = self._fetch_confirmations_page()
        print(f'Confirmation_page variable: {confirmations_page}')
        if confirmations_page.status_code == HTTPStatus.OK:
            confirmations_json = json.loads(confirmations_page.text)
            print(f'Confirmations_page confirmations_json is: {confirmations_json}')
            for conf in confirmations_json['conf']:
                data_confid = conf['id']
                nonce = conf['nonce']
                confirmations.append(Confirmation(data_confid, nonce))
            return confirmations
        raise ConfirmationExpected

    def _fetch_confirmations_page(self) -> requests.Response:
        tag = Tag.CONF.value
        params = self._create_confirmation_params(tag)
        headers = {'X-Requested-With': 'com.valvesoftware.android.steam.community'}
        response = self._session.get(f'{self.CONF_URL}/getlist', params=params, headers=headers)
        print(f'response in _fetch_confirmations_page is: {response}')
        if 'Steam Guard Mobile Authenticator is providing incorrect Steam Guard codes.' in response.text:
            raise InvalidCredentials('Invalid Steam Guard file')
        return response

I get
response in _fetch_confirmations_page is: <Response [200]>
Confirmation_page variable: <Response [200]>
Confirmations_page confirmations_json is: {'success': True, 'conf': []}

Maybe I'm trying to use ConfirmationExecutor in a wrong way ? ChatGPT tries to suggest that somehow the acceptance should be done through POST to tradeoffer/trade_id/accept, but tried several approaches to it, with no success...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions