<commit_before>const Lang = imports.lang;

const Local = imports.misc.extensionUtils.getCurrentExtension();
const BaseProvider = Local.imports.BaseProvider;


const Api = new Lang.Class({
  Name: 'Bitso.Api',
  Extends: BaseProvider.Api,

  apiName: "Bitso",

  currencies: ['MXN'],

  coins: ['BTC','mBTC','ETH'],

  /* quote https://bitso.com/api_info#rate-limits
   *
   * > Rate limits are are based on one minute windows. If you do more than 30
   * > requests in a minute, you get locked out for one minute.
   */
  interval: 30,

  attributes: {
    last: function (options) {
      const renderCurrency = BaseProvider.CurrencyRenderer(options);
      const renderChange = BaseProvider.ChangeRenderer();

      return {
        text: (data) => renderCurrency(data.last),
        change: (data) => renderChange(data.last)
      };
    }
  },

  getLabel: function(options) {
    return "Bitso " + options.currency + "/" + options.coin;
  },

  getUrl: function(options) {
    const coin = BaseProvider.baseCoin(options.coin);
    return "https://api.bitso.com/v2/ticker?book=" + coin + "_" + options.currency;
  }
});<commit_msg>Update bitso to newest api and add xrp coin<commit_after>const Lang = imports.lang;

const Local = imports.misc.extensionUtils.getCurrentExtension();
const BaseProvider = Local.imports.BaseProvider;


const Api = new Lang.Class({
  Name: 'Bitso.Api',
  Extends: BaseProvider.Api,

  apiName: "Bitso",

  currencies: ['MXN'],

  coins: ['BTC','mBTC','ETH', 'XRP'],

  /* quote https://bitso.com/api_info#rate-limits
   *
   * > Rate limits are are based on one minute windows. If you do more than 30
   * > requests in a minute, you get locked out for one minute.
   */
  interval: 30,

  attributes: {
    last: function (options) {
      const renderCurrency = BaseProvider.CurrencyRenderer(options);
      const renderChange = BaseProvider.ChangeRenderer();

      return {
        text: (data) => renderCurrency(data.payload.last),
        change: (data) => renderChange(data.payload.last)
      };
    }
  },

  getLabel: function(options) {
    return "Bitso " + options.currency + "/" + options.coin;
  },

  getUrl: function(options) {
    const coin = BaseProvider.baseCoin(options.coin);
    return "https://api.bitso.com/v3/ticker?book=" + coin.toLowerCase() + "_" + options.currency.toLowerCase();
  }
});
{'fraction_non_alphanumeric': 0.1407911527009783, 'fraction_numerical': 0.004253509145044662, 'mean_word_length': 3.3555555555555556, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1508647', 'n_tokens_mistral': 752, 'n_tokens_neox': 735, 'n_words': 179}