Creates an instance of the Btc Wallet Service.
@constructor
359423
function WalletService() {
  if (!initialized)
    throw new Error('Server not initialized');

  this.lock = lock;
  this.storage = storage;
  this.blockchainExplorer = blockchainExplorer;
  this.blockchainExplorerOpts = blockchainExplorerOpts;
  this.messageBroker = messageBroker;
  this.fiatRateService = fiatRateService;
  this.notifyTicker = 0;
}
100138
function createWallet(xPrivKey, onDone){
	var devicePrivKey = xPrivKey.derive("m/1'").privateKey.bn.toBuffer({size:32});
	var device = require('../wallet/device.js');
	device.setDevicePrivateKey(devicePrivKey); // we need device address before creating a wallet
	var strXPubKey = Bitcore.HDPublicKey(xPrivKey.derive("m/44'/0'/0'")).toString();
	var walletDefinedByKeys = require('../wallet/wallet_defined_by_keys.js');
	walletDefinedByKeys.createWalletByDevices(strXPubKey, 0, 1, [], 'any walletName', function(wallet_id){
		walletDefinedByKeys.issueNextAddress(wallet_id, 0, function(){
			onDone();
		});
	});
}
386005
function createSinglesigWallet(xPubKey, account, walletName, handleWallet){
	var arrDefinitionTemplate = ["sig", {pubkey: '$pubkey@'+device.getMyDeviceAddress()}];
	createWallet(xPubKey, account, arrDefinitionTemplate, walletName, null, handleWallet);
}
154054
function createBrokers(transporter) {
	let b1 = new ServiceBroker({
		transporter,
		//requestTimeout: 0,
		logger: false,
		//logLevel: "debug",
		nodeID: "node-1"
	});

	let b2 = new ServiceBroker({
		transporter,
		//requestTimeout: 0,
		logger: false,
		//logLevel: "debug",
		nodeID: "node-2"
	});

	b2.createService({
		name: "echo",
		actions: {
			reply(ctx) {
				return ctx.params;
			}
		}
	});

	return Promise.all([
		b1.start(),
		b2.start()
	]).then(() => [b1, b2]);
}
1241881
def create(self,
               institution_id,
               initial_products,
               _options=None,
               webhook=None,
               transactions__start_date=None,
               transactions__end_date=None,
               ):
        '''
        
        '''
        options = _options or {}

        if webhook is not None:
            options['webhook'] = webhook

        transaction_options = {}
        transaction_options.update(options.get('transactions', {}))
        if transactions__start_date is not None:
            transaction_options['start_date'] = transactions__start_date
        if transactions__end_date is not None:
            transaction_options['end_date'] = transactions__end_date
        if transaction_options:
            options['transactions'] = transaction_options

        return self.client.post_public_key('/sandbox/public_token/create', {
            'institution_id': institution_id,
            'initial_products': initial_products,
            'options': options,
        })
64275
function createUser(name, pass, cb) {
  // Check name
  if(!isValidName(name)) return cb(new Error('Invalid name "'+name+'"'))
  // Check pass
  if(!isValidPass(pass)) return cb(new Error('Invalid pass: "'+pass+'"'))
  // gen salt
  var salt = crypto.randomBytes(16).toString('hex')
  // gen sha1
  var hash = crypto.createHash('sha1')
  hash.update(pass)
  hash.update(salt)
  var password_sha = hash.digest('hex')
  
  var new_doc =
      { _id: user_namespace+':'+name
      , name: name
      , roles: []
      , type: 'user'
      , password_sha: password_sha
      , salt: salt
      }
    ;
  
  nano().use(user_dbname).insert(new_doc, function(err, doc, h) {
    if(err) return cb(err)
    
    // Every user gets its own database
    createDatabase(name, function(err) {
      if(err) return cb(err)
      
      // Sets the _security
      setDatabaseSecurity(name, function(err) {
        if(err) return cb(err)
        cb(null, doc.id, doc.rev)
      })
    })
  })
}
473278
function createService (app, Service, Model, options) {
  Model = options.Model || Model;
  if (typeof Model === 'function') {
    assert(options.ModelName, 'createService but options.ModelName not provided');
    options.Model = Model(app, options.ModelName);
  } else {
    options.Model = Model;
  }
  const service = new Service(options);
  return service;
}
375993
public function create()
    {
        $instance = self::createCreditCardPayment($this);
        $this->setId($instance->getId());
        return $instance;
    }
1218558
def create(self,rate, amount, order_type, pair):
        '''  
        '''
        nonce = nounce()
        payload = { 'rate': rate,
                    'amount': amount,
                    'order_type': order_type,
                    'pair': pair
                    }
        url= 'https://coincheck.com/api/exchange/orders'
        body = 'rate={rate}&amount={amount}&order_type={order_type}&pair={pair}'.format(**payload)
        message = nonce + url + body
        signature = hmac.new(self.secret_key.encode('utf-8'), message.encode('utf-8'), hashlib.sha256).hexdigest()
        headers = {
           'ACCESS-KEY'      : self.access_key,
           'ACCESS-NONCE'    : nonce,
           'ACCESS-SIGNATURE': signature
        }
        r = requests.post(url,headers=headers,data=body)
        return json.loads(r.text)
773455
function create(body, cb) {
  var validates = Schema(body);

  if(!validates) {
    return cb(new exceptions.BadRequest());
  }

  db.getClient(function(err, client, done) {
    client.query(INSERT, [body.post_id, body.tag_id], function(err, r) {
      if(err) {
        cb(err);
        done(err);
      } else {
        cb(null, r.rows[0]);
        done();
      }
    });
  });
}
220067
function createPayment(data, callback) {
    var client = new this.clients.Payments();
    client.create(data, callback);
  }
527899
function createChain(descriptor, callback) {
    if (typeof descriptor !== 'object') {
        throw new TypeError('createChain: descriptor is not an object: ' +
                            descriptor);
    }

    //Create the Chain class.
    function CustomChain(callback) {
        if (!(this instanceof CustomChain)) {
            return new CustomChain(callback);
        }
        CustomChain.super_.call(this, callback);
        CustomChain._lists.forEach(function(listName) {
            this._result[listName] = [];
        }, this);
    }
    util.inherits(CustomChain, Chain);
    if (callback) {
        CustomChain.prototype._callback = callback;
    }

    //This will come to contain the names of all lists in the chain.
    CustomChain._lists = [];

    //Add descriptor properties to Chain prototype.
    var keys = Object.keys(descriptor);
    keys.forEach(function(key) {
        var property = descriptor[key];
        //When a chain method is called, a number of actions need to take place.
        var actionList = [
            //1. Decide what item to store from the arguments.
            getArgumentInterpreter(property.elem),
            //2. Decide whether to set or push the item to store to an array.
            getPropertySetter(CustomChain, key, property.plural),
            //3. End the chain or return `this` for further chaining.
            getChainEnder(CustomChain, property.end)
        ].reverse();
        CustomChain.prototype[key] = _.compose.apply(null, actionList);
    });

    return CustomChain;
}
1357949
function createObject(constructor) {
    var mediaObject = new constructor(strict)

    mediaObject.on('_describe', describe);
    mediaObject.on('_rpc', encodeRpc);

    if (mediaObject instanceof register.abstracts['kurento.Hub'] ||
      mediaObject instanceof register
      .classes['kurento.MediaPipeline'])
      mediaObject.on('_create', encodeCreate);

    if (mediaObject instanceof register.classes['kurento.MediaPipeline'])
      mediaObject.on('_transaction', encodeTransaction);

    return mediaObject;
  }
1089307
async function makeRbacAdmin (rbacService, options) {
  const rbacAdmin = new RbacAdmin()
  await rbacAdmin.init(rbacService, options)
  return rbacAdmin
}
983844
public function create()
    {
        $instance = self::createStoreCreditPayment($this);
        $this->setId($instance->getId());
        return $instance;
    }
1202437
function HTTPServer(options) {
  if (!(this instanceof HTTPServer))
    return new HTTPServer(options);

  options = new HTTPOptions(options);

  HTTPBase.call(this, options);

  this.options = options;
  this.network = this.options.network;
  this.logger = this.options.logger.context('http');
  this.walletdb = this.options.walletdb;

  this.server = new HTTPBase(this.options);
  this.rpc = this.walletdb.rpc;

  this.init();
}
1024735
public CouchDbInstance createInstance() {
        val instance = new StdCouchDbInstance(getHttpClient());
        LOGGER.debug("Instance created: [{}]", instance);
        return instance;
    }