MCPcopy Create free account
hub / github.com/ccxt/ccxt / sign

Method sign

python/ccxt/derive.py:2558–2571  ·  view source on GitHub ↗
(self, path, api: Any = 'public', method='GET', params={}, headers: dict = None, body: Str = None)

Source from the content-addressed store, hash-verified

2556 return None
2557
2558 def sign(self, path, api: Any = 'public', method='GET', params={}, headers: dict = None, body: Str = None):
2559 url = self.urls['api'][api] + '/' + path
2560 if method == 'POST':
2561 headers = {
2562 'Content-Type': 'application/json',
2563 }
2564 if api == 'private':
2565 now = str(self.milliseconds())
2566 signature = self.sign_message(now, self.privateKey)
2567 headers['X-LyraWallet'] = self.safe_string(self.options, 'deriveWalletAddress')
2568 headers['X-LyraTimestamp'] = now
2569 headers['X-LyraSignature'] = signature
2570 body = self.json(params)
2571 return {'url': url, 'method': method, 'body': body, 'headers': headers}

Callers

nothing calls this directly

Calls 4

sign_messageMethod · 0.95
safe_stringMethod · 0.80
millisecondsMethod · 0.45
jsonMethod · 0.45

Tested by

no test coverage detected