def sign(self, path, api='public', method='GET', params={}, headers=None, body=None):
    endpoint = ((('/' + self.version) + '/') + self.implode_params(path, params))
    query = self.omit(params, self.extract_params(path))
    if (method == 'GET'):
        if query:
            endpoint += ('?' + self.urlencode(query))
    url = (self.urls['api'] + endpoint)
    if (api == 'private'):
        self.check_required_credentials()
        nonce = str(self.nonce())
        request = ''.join([nonce, method, endpoint])
        if (method != 'GET'):
            if query:
                body = self.json(query)
                request += body
        signature = self.hmac(self.encode(request), self.encode(self.secret))
        auth = ((((self.apiKey + ':') + nonce) + ':') + signature)
        headers = {'Authorization': ('Bitso ' + auth), 'Content-Type': 'application/json'}
    return {'url': url, 'method': method, 'body': body, 'headers': headers}
def sign(self, path, api='public', method='GET', params={}, headers=None, body=None):
    endpoint = ((('/' + self.version) + '/') + self.implode_params(path, params))
    query = self.omit(params, self.extract_params(path))
    if (method == 'GET'):
        if query:
            endpoint += ('?' + self.urlencode(query))
    url = (self.urls['api'] + endpoint)
    if (api == 'private'):
        self.check_required_credentials()
        nonce = str(self.nonce())
        request = .join([nonce, method, endpoint])
        if (method != 'GET'):
            if query:
                body = self.json(query)
                request += body
        signature = self.hmac(self.encode(request), self.encode(self.secret))
        auth = ((((self.apiKey + ':') + nonce) + ':') + signature)
        headers = {'Authorization': ('Bitso ' + auth), 'Content-Type': 'application/json'}
    return {'url': url, 'method': method, 'body': body, 'headers': headers}