-
Notifications
You must be signed in to change notification settings - Fork 12
Open
Description
The title is pretty self explanatory, I'm not familiar enough with the project to create a pull request, but this is the patch I use to get this functionality:
import orjson
from bitcoinrpc import BitcoinRPC as BaseBitcoinRPC
from bitcoinrpc._exceptions import RPCError
class BitcoinRPC( BaseBitcoinRPC ):
async def abatch( self, mp_pairs, **kwargs ):
response = await self.client.post(
url = self.url,
content = orjson.dumps([
{
"jsonrpc": "2.0",
"id": self._counter(),
"method": mp.pop(0),
"params": mp,
}
for mp in mp_pairs
]
),
**kwargs,
)
response.raise_for_status()
return [
RPCError(content["error"]["code"], content["error"]["message"])
if content['error'] else
content['result']
for content in orjson.loads(response.content)
]
## BitcoinRPC Patch End```
xblitz
Metadata
Metadata
Assignees
Labels
No labels