forked from coinbase/coinbase-commerce-node
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathevent.js
More file actions
26 lines (22 loc) · 657 Bytes
/
Copy pathevent.js
File metadata and controls
26 lines (22 loc) · 657 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
'use strict';
var coinbase = require('coinbase-commerce-node');
var Client = coinbase.Client;
var Event = coinbase.resources.Event;
Client.init('YOUR_API_KEY');
// Get list of events. Process result as callback
Event.list({limit: 5}, function (error, list, pagination) {
console.log('list of events(callback)');
console.log(list);
console.log(pagination);
console.log(error);
});
// Get list of events. Process result as promise
Event.list({limit: 5}).then(function (result) {
console.log('list of events(promise)');
// List of Events
console.log(result[0]);
// Pagination
console.log(result[1]);
}, function (error) {
console.log(error);
});