Zum Inhalt springen

nadrian

Mitglied
  • Gesamte Inhalte

    9
  • Benutzer seit

  • Letzter Besuch

Reputation in der Community

0 Neutral
  1. Können Sie bitte die TradingApiSdkv2.php löschen und erneut herunterladen? https://www.bitcoin.de/en/api/tapi/v2/sdk?download=1
  2. Hast du die gleiche optionen wie in die folgende foto? https://prnt.sc/hv72l7
  3. Dieses Skript hat keine GUI, es ist nur für die Shell geeignet. Was Sie sehen, wenn Sie das Skript ausführen, ist die Hilfe zum Ausführen des Skripts, alle Optionen ...( es ist nicht alles mit echo, nur die optionen fur das skript ) Testen Sie die folgende: php script.php -m=book -t=sell -tp=btceur
  4. Du musst das Skript und die SDK in c:\xampp stellen (oder wohin hast du XAMPP installiert), danach konnst du die skript laufen von die XAMPP shell.
  5. Ich habe gerade die letzte Version von XAMPP installiert und das Skript funktioniert OK. Hast du das Skript editiert und den api key + secret hinzugefügt? Kannst du ein Shell von XAMPP ofnen und die skript von da starten mit: php script.php
  6. In deiner php.ini musst du die folgende Änderung vornehmen: ;extension=php_curl.dll zu extension=php_curl.dll
  7. Hast du curl in PHP aktiviert?
  8. @Coin_Money Hallo, Was ist die error code? Kannst du mehr info geben, vie die php version un die genaue error? Der skript functioniert bei mir ohne probleme...
  9. Hallo, Ich habe ein PHP scrip gemacht fur trading via API. Um die script zu benutzen brauchen shie die sdk.php von bitcoin.de herunterladen in die selbe mappe mit der script. Sie mussen auch die script editieren und die API KEY + API SECRET spezifizieren. Um alle optionen zu sehn mussen shie einfach die php script starten (php script.php). Ich hofe das diese script hilfreich sein wird. PS: Ich entschulige mich fur mein schlechtes deutch. Fur Spenden oder Trinkgelt bitte nutzen shie die folgende addressen: ETH: 0xaa8a499fbb3cf07371fca3e766e181aaaffcf8d8 BCH: 1FKBCagsZUCp1Nzv862NPbdujWwEHDQThN BTC: 16K8eYUdHQ3ig6N3MMDxW2V9n9wVSGAtwz Viel dank! <?php // Define API key define('API_KEY','key'); // Define API secret define('API_SECRET','secret'); // Using the API SDK require_once(dirname(__FILE__).'/sdk.php'); if (count($argv) == 1) { echo 'Usage:', PHP_EOL; echo '***** Add Order *****', PHP_EOL; echo '***Required options***:', PHP_EOL; echo '-m=<add>: Method to use, in this case add.', PHP_EOL; echo '-t=<type of order>: Type of order, <sell> or <buy>', PHP_EOL; echo '-a=<amount>: Amount of coins to be sold, ex: 0.01', PHP_EOL; echo '-p=<price>: Price per bitcoin in EUR', PHP_EOL; echo '-tp=<trading pair>: Traiding pair to use. Options are: BTCEUR (bitcoun/eur) / BCHEUR (bitcoin cash/eur) /ETHEUR (ethereum/eur)', PHP_EOL; echo '***Optional arguments***:', PHP_EOL; echo '-ma=<amount>: Minimal amount to be sold/bought in order placed. Defauld: amount/2', PHP_EOL; echo '-ed=<datetime>: End date for the offer (minimum 5 days in the future).Use format as specified in RFC 3339 (Example: 2015-01-20T15:00:00+02:00).', PHP_EOL; echo ' Valid values for minutes are: 00, 15 , 30, 45.', PHP_EOL; echo '-no=<0/1>: Enable to add new order with rest amount if not sold all. Default: 0.', PHP_EOL; echo '-mt=<level>: Minimal trust level to allow for order. Options are: Bronze/Silver/Gold/Platin. Default is set in user profile.', PHP_EOL; echo '-ok=<0/1>: Enable sell/buy from/to fully identified users or not. Default: 0.', PHP_EOL; echo '-po=<1/2/3>: Set payment option for sell orders. Options are: 1=Express Only, 2=SEPA Only, 3=Express & SEPA.', PHP_EOL; echo '-sb=<country code>: Allow only this country of bank origin for your order. Use 2 letter country code, *ONLY* Europe Comunity. Default is all.',PHP_EOL; echo '*** Examples ***:', PHP_EOL; echo 'Buy order example: php script.php -m=add -t=buy -ma=0.99 -p=5999 -tp=btceur -ma=0.55 -no=1 -mt=gold -ok=1 -sb=DE', PHP_EOL; echo ' ^^ This will add an order to buy 0.99 BTC with the minimum of 0.55 and option to automatically add new order with rest amount and', PHP_EOL; echo ' will allow only sellers from Gerany with trust level gold and fully identified.', PHP_EOL; echo 'Sell order example: php script.php -m=add -t=sell -ma=0.99 -p=9999 -tp=btceur -ma=0.55 -no=1 -mt=gold -ok=1 -po=1 -sb=DE', PHP_EOL; echo ' ^^ This will add an order to sell 0.99 BTC with the minimum of 0.55 and option to automatically add new order with rest amount and', PHP_EOL; echo ' will allow only sellers from Gerany with trust level gold and fully identified using ONLY express payment.', PHP_EOL; echo '*** Cancel Order ***', PHP_EOL; echo '-m=<cancel>: Method to use, in this case cancel.', PHP_EOL; echo '-id=<Order ID>: The order ID you want to cancel.', PHP_EOL; echo '-tp=<trading pair>: Traiding pair to use. Options are: BTCEUR (bitcoun/eur) / BCHEUR (bitcoin cash/eur) /ETHEUR (ethereum/eur)', PHP_EOL; echo '*** List own ordders ***', PHP_EOL; echo '-m=<list>: Method to use, in this case list.', PHP_EOL; echo '-t=<type of order>: Type of order, <sell> or <buy>', PHP_EOL; echo '-tp=<trading pair>: Traiding pair to use. Options are: BTCEUR (bitcoun/eur) / BCHEUR (bitcoin cash/eur) /ETHEUR (ethereum/eur)', PHP_EOL; echo '-s=<-2/-1/0>: Status of orders you want to list. Options are: -2=Expired orders, -1=Canceled orders, 0=Outstanding orders. Default is 0.', PHP_EOL; echo '-ds=<start date>: Start date for the orders you want to see. Use RFC 3339 format.(Example: 2015-01-20T15:00:00+02:00).', PHP_EOL; echo '-de=<end date>: End date for the orders you want to see. User RFC 3339 format.(Example: 2015-01-20T15:00:00+02:00).', PHP_EOL; echo '-pg=<page number>: Page numbers to see in your lookup from the matching list of orders.', PHP_EOL; echo '-so=<Order ID>: See all orders since this order ID.',PHP_EOL; echo '*** List book with orders ***', PHP_EOL; echo '-m=<book>: Method to use, in this case book.', PHP_EOL; echo '-t=<type of order>: Type of order, <sell> or <buy>', PHP_EOL; echo '-tp=<trading pair>: Traiding pair to use. Options are: BTCEUR (bitcoun/eur) / BCHEUR (bitcoin cash/eur) /ETHEUR (ethereum/eur)', PHP_EOL; echo '-a=<amount>: See if any orders are palced in specified amount', PHP_EOL; echo '-p=<price>: See if any orders are palced in specified price', PHP_EOL; echo '-r=<0/1>: Set 1 for showing only orders that meet your requirements set in the account', PHP_EOL; echo '-ok=<0/1>: Set 1 for showing only orders from fully identified users', PHP_EOL; echo '-oe=<0/1>: Set 1 for showing only express orders', PHP_EOL; echo '-sb=<country code>: Show only orders from specified country', PHP_EOL; echo '-sbc=<0/1>: Set 1 for showing orders having same BIC with your bank', PHP_EOL; echo 'Additional Parameters:', PHP_EOL; echo '-vsp -> to verify SSL, default TRUE', PHP_EOL; echo '-uri -> request URI, default https://api.bitcoin.de', PHP_EOL; echo '-api -> API version to use, default v2', PHP_EOL; return; } $args = array(); foreach($argv as $idx=>$arg) { if ($idx == 0) continue; list($param,$value) = explode('=',$arg); $args[trim(str_replace('-','',$param))] = $value; } $custom_options = array(); if(isset($args['vsp'])) $custom_options['verify_ssl_peer'] = TRUE; if(isset($args['uri'])) $custom_options['uri'] = $args['url']; if(isset($args['api'])) $custom_options['api_version'] = $args['api_version']; $api = new TradingApiSdkV2(API_KEY,API_SECRET,$custom_options); $method = ''; $params = array(); switch($args['m']) { case 'add': $method = 'createOrder'; if (isset($args['t'])) $params['type'] = $args['t']; if (isset($args['a'])) $params['max_amount'] = $args['a']; if (isset($args['p'])) $params['price'] = $args['p']; if (isset($args['tp'])) $params['trading_pair'] = $args['tp']; if (isset($args['ma'])) $params['min_amount'] = $args['ma']; if (isset($args['ed'])) $params['end_datetime'] = $args['edt']; if (isset($args['no'])) $params['new_order_for_remaining_amount'] = $args['no']; if (isset($args['mt'])) $params['min_trust_level'] = $args['mt']; if (isset($args['ok'])) $params['only_kyc_full'] = $args['ok']; if (isset($args['po'])) $params['payment_option'] = $args['po']; if (isset($args['sb'])) $params['seat_of_bank'] = $args['sb']; break; case 'cancel': $method = 'deleteOrder'; if (isset($args['id'])) $params['order_id'] = $args['id']; if (isset($args['tp'])) $params['trading_pair'] = $args['tp']; break; case 'list': $method = 'showMyOrders'; if (isset($args['t'])) $params['type'] = $args['t']; if (isset($args['tp'])) $params['trading_pair'] = $args['tp']; if (isset($args['s'])) $params['state'] = $args['s']; if (isset($args['ds'])) $params['date_start'] = $args['ds']; if (isset($args['de'])) $params['date_end'] = $args['de']; if (isset($args['tp'])) $params['trading_pair'] = $args['tp']; if (isset($args['pg'])) $params['page'] = $args['pg']; if (isset($args['so'])) $params['since_order_id'] = $args['so']; break; case 'book': $method = 'showOrderbook'; if (isset($args['t'])) $params['type'] = $args['t']; if (isset($args['tp'])) $params['trading_pair'] = $args['tp']; if (isset($args['a'])) $params['amount'] = $args['a']; if (isset($args['p'])) $params['price'] = $args['p']; if (isset($args['r'])) $params['order_requirements_fullfilled'] = $args['r']; if (isset($args['ok'])) $params['only_kyc_full'] = $args['ok']; if (isset($args['oe'])) $params['only_express_orders'] = $args['oe']; if (isset($args['sb'])) $params['seat_of_bank'] = $args['sbk']; if (isset($args['sbc'])) $params['only_same_bic'] = $args['sbc']; break; } $data = $api->doRequest($method,$params); if (isset($args['debug'])) { file_put_contents ('api.log',print_r($data,true)); } if (isset($data['successful']) && $data['successful']) { if ($args['m'] == 'add') { echo 'SUCCESS: '; echo 'Order successfully added, '; echo 'Order ID: '.$data['order_id'],PHP_EOL; } else if ($args['m'] == 'cancel') { echo 'SUCCESS: '; echo 'Order successfully cancelled, '; echo 'Order ID: '.$args['id'],PHP_EOL; } else { if ($args['m'] == 'list') { echo 'LIST:',PHP_EOL; foreach($data['orders'] as $order) { echo '[',$order['type'],'] '; echo '[',$order['trading_pair'],'] '; echo '[',$order['max_amount'],'] '; echo '[',$order['order_requirements']['min_trust_level'],'] '; echo '[',$order['order_requirements']['only_kyc_full'],'] '; echo '[',$order['new_order_for_remaining_amount'],'] '; echo '[',$order['order_id'],'] '; echo '[',$order['end_datetime'],'] ',PHP_EOL; } } if ($args['m'] == 'book') { echo 'BOOK:',PHP_EOL; foreach($data['orders'] as $order) { echo '[',$order['order_id'],'] '; echo '[',$order['trading_pair'],'] '; echo '[',$order['type'],'] '; echo '[',$order['price'],'] '; echo '[',$order['max_amount'],'] '; echo '[',$order['max_volume'],'] '; echo '[',$order['order_requirements']['min_trust_level'],'] '; echo '[',$order['order_requirements']['payment_option'],'] '; echo '[',$order['trading_partner_information']['username'],'] '; echo '[',$order['trading_partner_information']['is_kyc_full'],'] '; echo '[',$order['trading_partner_information']['trust_level'],'] '; echo '[',$order['trading_partner_information']['bank_name'],'] '; echo '[',$order['trading_partner_information']['seat_of_bank'],'] '; echo '[',$order['trading_partner_information']['amount_trades'],'] ',PHP_EOL; } } } } else { if (count($data['errors'])) { echo 'ERROR: '; foreach($data['errors'] as $error) { echo $error['field'] , '::'; echo $error['message'] , PHP_EOL; } } else { print_r($data); } }
×
×
  • Neu erstellen...

Wichtige Information

Wir haben Cookies auf Deinem Gerät platziert. Das hilft uns diese Webseite zu verbessern. Du kannst die Cookie-Einstellungen anpassen, andernfalls gehen wir davon aus, dass Du damit einverstanden bist, weiterzumachen.