This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #create transaction dictionary using API | |
| #sign transaction using private key and web3.py | |
| tx_json = signed_tx.rawTransaction # extract raw tx from signed tx | |
| tx_json = {"rawTransaction": tx_json.hex()} # convert to hex | |
| payload = requests.post('https://tx-gateway.1inch.io/v1.1/' + self.chain_id + '/broadcast', data=self.w3.toJSON(tx_json), headers={"accept": "application/json, text/plain, */*", "content-type": "application/json"}) |