This file contains 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
let nuts = ['@', '#', '$', '%', '^', '&'] | |
let bolts = ['$', '%', '&', '^', '@', '#'] |
This file contains 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
import requests # pip install requests | |
import json | |
import base64 | |
import hashlib | |
import time #for nonce | |
api_key = '' | |
api_secret = '' | |
#url = 'https://bitfinex.com/api/v1/order/new' |
This file contains 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
from bitfinex import Bitfinex | |
import os | |
with open(os.path.expanduser('~/.bfx_test_account_key.txt'), 'r') as f: | |
KEY, SECRET = f.read().strip().splitlines() | |
print (KEY, SECRET) | |
bfx = Bitfinex() | |
bfx.key = KEY | |
bfx.secret = SECRET |
This file contains 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
var https = require('https'); | |
var crypto = require('crypto'); | |
var url = 'https://bitfinex.com/api/v1/balances'; | |
var subPath = '/balances'; | |
var api_key = ''; | |
var api_secret = ''; | |
var path = '/api/v1' + subPath; |
This file contains 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
// add Bouncy JCE Provider, http://bouncycastle.org/latest_releases.html | |
Security.addProvider(new org.bouncycastle.jce.provider.BouncyCastleProvider()); |
This file contains 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
string signature = generatePGPSignature(message, privKey); |
This file contains 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
string pass = "hongkong"; | |
PGPPrivateKey pgpPrivKey = pgpSec | |
.extractPrivateKey(new JcePBESecretKeyDecryptorBuilder() | |
.setProvider("BC").build(pass.toCharArray())); |
This file contains 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
public static PGPSecretKey readSecretKey(InputStream input) throws IOException, PGPException { | |
PGPSecretKeyRingCollection pgpSec = new PGPSecretKeyRingCollection( | |
PGPUtil.getDecoderStream(input)); | |
Iterator keyRingIter = pgpSec.getKeyRings(); | |
while (keyRingIter.hasNext()) { | |
PGPSecretKeyRing keyRing = (PGPSecretKeyRing) keyRingIter.next(); | |
Iterator keyIter = keyRing.getSecretKeys(); | |
while (keyIter.hasNext()) { |
This file contains 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
public static PGPPublicKey readPublicKey(InputStream input) throws IOException, PGPException { | |
PGPPublicKeyRingCollection pgpPub = new PGPPublicKeyRingCollection( | |
PGPUtil.getDecoderStream(input)); | |
Iterator keyRingIter = pgpPub.getKeyRings(); | |
while (keyRingIter.hasNext()) { | |
PGPPublicKeyRing keyRing = (PGPPublicKeyRing) keyRingIter.next(); | |
Iterator keyIter = keyRing.getPublicKeys(); | |
while (keyIter.hasNext()) { |
This file contains 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
String privateKeyPassword = "hongkong"; | |
PGPPrivateKey pgpPrivKey = pgpSec | |
.extractPrivateKey(new JcePBESecretKeyDecryptorBuilder() | |
.setProvider("BC").build(privateKeyPassword.toCharArray())); |
NewerOlder