Coder Social home page Coder Social logo

public's People

Contributors

g-p-g avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

public's Issues

Code 404 creating WebSocket

WebSocket connection to 'wss://stream.coinapult.com/websocket' failed: Error during WebSocket handshake: Unexpected response code: 404

It seems connecting to the websocket stream for Coinapult is throwing an error.

The purpose of the helper

Regarding your comment in

https://github.com/coinapult/public/blob/master/plugin/magento/app/code/local/Coinapult/Bitcoin/Helper/Data.php#L22

class Coinapult_Bitcoin_Helper_Data extends Mage_Core_Helper_Abstract
{
    //not sure why magento requires this... I have no need of a helper.
}

The helper is used for translation of system XML labels.
For example https://github.com/coinapult/public/blob/master/plugin/magento/app/code/local/Coinapult/Bitcoin/etc/system.xml#L26-L27

<bitcoin translate="label" module="bitcoin">
    <label>Coinapult Bitcoin Payment</label>
    ...
</bitcoin>

When "Magento" sees you want to translate the <label> content, it will take the value of the module attribute and use that to construct the helper.
Then it calls the __() method to translate the string as in:

Mage::helper('bitcoin')->__('Coinapult Bitcoin Payment'):

So you could get rid of the helper if you wanted to if you either removed the translate attributes from the system.xml or if you removed the module attribute (then Magento would default to the core/data helper).
But its good practice to keep a helper for each module because in Magento 1 translation is scoped by modules. Should you be interested there is more information on the translation process here:

http://magento.stackexchange.com/questions/6722/how-to-implement-translations-in-design-template-package-csvs-how-does-echo-t/6725#6725

Create example using streaming

Create more examples in JavaScript for using the SockJS and websocket for ticker and transactions. Also include the links for using those examples with the Coinapult playground, there is no documentation for using the Coinapult testnet environment.

Stream API gives the appearance of duplicate transactions, why?

I am seeing each "pending" transaction returned twice in rapid sequence. Example is below output from the SockJS connection. Expected behavior would be to see each unique transaction only once to reduce payload. The actual behavior is to see duplicates in the stream output. For example, here are two different pending transactions. Both are returned twice in rapid sequence (check timestamp on terminal dump).

I20150312-10:25:02.388(-3)? got tx { transaction:
I20150312-10:25:02.388(-3)? { timestamp: 1426166701,
I20150312-10:25:02.388(-3)? address: 'n3iwjj9bQj61zeBSLLDgUhxA5UBERt6pyY',
I20150312-10:25:02.388(-3)? state: 'pending',
I20150312-10:25:02.388(-3)? meta: { note: '', to: '', customid: '' },
I20150312-10:25:02.388(-3)? transaction_id: '54f898d231433d224ac3d407',
I20150312-10:25:02.389(-3)? in: { expected: 0.1, currency: 'BTC', amount: 0 },
I20150312-10:25:02.389(-3)? type: 'invoice',
I20150312-10:25:02.389(-3)? completeTime: null,
I20150312-10:25:02.389(-3)? out: { expected: 0.1, currency: 'BTC', amount: 0 } },
I20150312-10:25:02.389(-3)? type: 'transaction',
I20150312-10:25:02.389(-3)? meta:
I20150312-10:25:02.389(-3)? { to: '[email protected]',
I20150312-10:25:02.389(-3)? blockchain: { a: 'n3iwjj9bQj61zeBSLLDgUhxA5UBERt6pyY', l: 'address' },
I20150312-10:25:02.389(-3)? flow: '+',
I20150312-10:25:02.390(-3)? address: '[email protected]' } }

I20150312-10:25:02.390(-3)? got tx { transaction:
I20150312-10:25:02.390(-3)? { timestamp: 1426166701,
I20150312-10:25:02.390(-3)? address: 'n3iwjj9bQj61zeBSLLDgUhxA5UBERt6pyY',
I20150312-10:25:02.390(-3)? state: 'pending',
I20150312-10:25:02.390(-3)? meta: { note: '', to: '', customid: '' },
I20150312-10:25:02.390(-3)? transaction_id: '54f898d231433d224ac3d407',
I20150312-10:25:02.391(-3)? in: { expected: 0.1, currency: 'BTC', amount: 0 },
I20150312-10:25:02.391(-3)? type: 'invoice',
I20150312-10:25:02.391(-3)? completeTime: null,
I20150312-10:25:02.391(-3)? out: { expected: 0.1, currency: 'BTC', amount: 0 } },
I20150312-10:25:02.391(-3)? type: 'transaction',
I20150312-10:25:02.391(-3)? meta:
I20150312-10:25:02.391(-3)? { to: '[email protected]',
I20150312-10:25:02.391(-3)? blockchain: { a: 'n3iwjj9bQj61zeBSLLDgUhxA5UBERt6pyY', l: 'address' },
I20150312-10:25:02.392(-3)? flow: '+',
I20150312-10:25:02.392(-3)? address: '[email protected]' } }

I20150312-10:25:02.416(-3)? got tx { transaction:
I20150312-10:25:02.416(-3)? { timestamp: 1426166701,
I20150312-10:25:02.416(-3)? address: 'mqxKCNDzehM1sw8rPLc3hpLF9kGj3sUtzP',
I20150312-10:25:02.416(-3)? state: 'pending',
I20150312-10:25:02.416(-3)? meta: { note: '', to: '', customid: '' },
I20150312-10:25:02.416(-3)? transaction_id: '54fde0fc31433d224c009d30',
I20150312-10:25:02.416(-3)? in: { expected: 0.1, currency: 'BTC', amount: 0 },
I20150312-10:25:02.416(-3)? type: 'invoice',
I20150312-10:25:02.416(-3)? completeTime: null,
I20150312-10:25:02.416(-3)? out: { expected: 0.1, currency: 'BTC', amount: 0 } },
I20150312-10:25:02.416(-3)? type: 'transaction',
I20150312-10:25:02.416(-3)? meta:
I20150312-10:25:02.417(-3)? { to: '[email protected]',
I20150312-10:25:02.417(-3)? blockchain: { a: 'mqxKCNDzehM1sw8rPLc3hpLF9kGj3sUtzP', l: 'address' },
I20150312-10:25:02.417(-3)? flow: '+',
I20150312-10:25:02.417(-3)? address: null } }

I20150312-10:25:02.425(-3)? got tx { transaction:
I20150312-10:25:02.425(-3)? { timestamp: 1426166701,
I20150312-10:25:02.425(-3)? address: 'mqxKCNDzehM1sw8rPLc3hpLF9kGj3sUtzP',
I20150312-10:25:02.425(-3)? state: 'pending',
I20150312-10:25:02.425(-3)? meta: { note: '', to: '', customid: '' },
I20150312-10:25:02.425(-3)? transaction_id: '54fde0fc31433d224c009d30',
I20150312-10:25:02.425(-3)? in: { expected: 0.1, currency: 'BTC', amount: 0 },
I20150312-10:25:02.425(-3)? type: 'invoice',
I20150312-10:25:02.425(-3)? completeTime: null,
I20150312-10:25:02.426(-3)? out: { expected: 0.1, currency: 'BTC', amount: 0 } },
I20150312-10:25:02.426(-3)? type: 'transaction',
I20150312-10:25:02.426(-3)? meta:
I20150312-10:25:02.426(-3)? { to: '[email protected]',
I20150312-10:25:02.426(-3)? blockchain: { a: 'mqxKCNDzehM1sw8rPLc3hpLF9kGj3sUtzP', l: 'address' },
I20150312-10:25:02.426(-3)? flow: '+',
I20150312-10:25:02.426(-3)? address: null } }

How to set outAmount in JS api

coinapult.js:207

      receive: function(cb, amount, address, inCurrency, outCurrency, extOID, urlCallback) {
        var params = {'amount': amount};
        if (typeof address != 'undefined') {
          params.address = address;
        }
        if (typeof inCurrency != 'undefined') {
          params.currency = inCurrency;
        } else {
          params.currency = 'BTC';
        }
        if (typeof outCurrency != 'undefined') {
          params.outCurrency = outCurrency;
        }
        if (typeof extOID != 'undefined') {
          params.extOID = extOID;
        }
        if (typeof urlCallback != 'undefined') {
          params.callback = urlCallback;
        }

        return this.call('t/receive', params, true, true, cb);
      },

I want to set outAmount as in cli.receive(outAmount=100, outCurrency="EUR")

how to set this? When I try and force it, it returns an error.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.