allow third parameter to be an object with various options including agent, timeout, url overrides and nonce generation function, while making sure to still support the third parameter being the nonce generation function