@cobo/cobo-waas2 1.34.0 → 1.36.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +28 -4
- package/dist/ApiClient.js +1 -1
- package/dist/api/PaymentApi.js +126 -91
- package/dist/api/TravelRuleApi.js +293 -6
- package/dist/index.js +133 -7
- package/dist/model/AddressVerification.js +172 -0
- package/dist/model/AddressVerificationDetail.js +204 -0
- package/dist/model/AddressVerificationDetailSatoshiTestDetail.js +299 -0
- package/dist/model/AddressVerificationDetailSignatureDetail.js +172 -0
- package/dist/model/AddressVerificationMethod.js +61 -0
- package/dist/model/AddressVerificationStatus.js +66 -0
- package/dist/model/ApprovalUserDetail.js +9 -0
- package/dist/model/{UpdateBankAccountByIdRequest.js → CancelSatoshiTestChallengeRequest.js} +31 -28
- package/dist/model/ChainInfo.js +13 -0
- package/dist/model/CreateBulkSendRequest.js +13 -0
- package/dist/model/CreateSatoshiTestChallengeRequest.js +176 -0
- package/dist/model/GetTransactionLimitation200Response.js +10 -1
- package/dist/model/ListAddressVerifications200Response.js +147 -0
- package/dist/model/ListBulkSends200Response.js +123 -0
- package/dist/model/ListPayerTransactions200Response.js +123 -0
- package/dist/model/ListTopUpPayers200ResponseDataInner.js +14 -1
- package/dist/model/OrderLinkBusinessInfo.js +2 -2
- package/dist/model/OriginalMainGroupHandling.js +61 -0
- package/dist/model/PaymentBulkSend.js +13 -0
- package/dist/model/PaymentBulkSendEvent.js +18 -0
- package/dist/model/SatoshiTestCancelResult.js +144 -0
- package/dist/model/SatoshiTestChallenge.js +239 -0
- package/dist/model/SatoshiTestChallengeAction.js +61 -0
- package/dist/model/SatoshiTestChallengeStatus.js +81 -0
- package/dist/model/SignatureChallenge.js +137 -0
- package/dist/model/SignatureDetail.js +146 -0
- package/dist/model/TransactionCoboCategory.js +20 -0
- package/dist/model/TravelRuleTransactionType.js +61 -0
- package/dist/model/UpdateKeyShareHolderGroupByIdRequest.js +9 -0
- package/dist/model/WebhookEventData.js +1 -1
- package/dist/model/WebhookEventType.js +5 -0
- package/docs/AddressVerification.md +14 -0
- package/docs/AddressVerificationDetail.md +16 -0
- package/docs/AddressVerificationDetailSatoshiTestDetail.md +19 -0
- package/docs/AddressVerificationDetailSignatureDetail.md +12 -0
- package/docs/AddressVerificationMethod.md +12 -0
- package/docs/AddressVerificationStatus.md +14 -0
- package/docs/ApprovalUserDetail.md +1 -0
- package/docs/CancelSatoshiTestChallengeRequest.md +9 -0
- package/docs/ChainInfo.md +1 -0
- package/docs/CreateBulkSendRequest.md +1 -0
- package/docs/CreateSatoshiTestChallengeRequest.md +14 -0
- package/docs/GetTransactionLimitation200Response.md +2 -1
- package/docs/ListAddressVerifications200Response.md +10 -0
- package/docs/ListBulkSends200Response.md +10 -0
- package/docs/ListPayerTransactions200Response.md +10 -0
- package/docs/ListTopUpPayers200ResponseDataInner.md +2 -1
- package/docs/OrderLinkBusinessInfo.md +1 -1
- package/docs/OriginalMainGroupHandling.md +12 -0
- package/docs/PaymentApi.md +107 -83
- package/docs/PaymentBulkSend.md +1 -0
- package/docs/PaymentBulkSendEvent.md +1 -0
- package/docs/SatoshiTestCancelResult.md +21 -0
- package/docs/SatoshiTestChallenge.md +19 -0
- package/docs/SatoshiTestChallengeAction.md +12 -0
- package/docs/SatoshiTestChallengeStatus.md +20 -0
- package/docs/SignatureChallenge.md +11 -0
- package/docs/SignatureDetail.md +12 -0
- package/docs/TransactionCoboCategory.md +8 -0
- package/docs/TravelRuleApi.md +325 -1
- package/docs/TravelRuleTransactionType.md +12 -0
- package/docs/UpdateKeyShareHolderGroupByIdRequest.md +1 -0
- package/docs/WebhookEventData.md +1 -1
- package/docs/WebhookEventType.md +2 -0
- package/package.json +1 -1
- package/docs/UpdateBankAccountByIdRequest.md +0 -9
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = void 0;
|
|
7
|
+
var _ApiClient = _interopRequireDefault(require("../ApiClient"));
|
|
8
|
+
var _SatoshiTestChallengeStatus = _interopRequireDefault(require("./SatoshiTestChallengeStatus"));
|
|
9
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
10
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
11
|
+
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
|
|
12
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
13
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
14
|
+
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
15
|
+
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
|
|
16
|
+
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
17
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
18
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /**
|
|
19
|
+
* Cobo Wallet as a Service 2.0
|
|
20
|
+
*
|
|
21
|
+
* Contact: help@cobo.com
|
|
22
|
+
*
|
|
23
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
24
|
+
* https://openapi-generator.tech
|
|
25
|
+
* Do not edit the class manually.
|
|
26
|
+
*
|
|
27
|
+
*/
|
|
28
|
+
/**
|
|
29
|
+
* The SatoshiTestChallenge model module.
|
|
30
|
+
* @module model/SatoshiTestChallenge
|
|
31
|
+
*/
|
|
32
|
+
var SatoshiTestChallenge = /*#__PURE__*/function () {
|
|
33
|
+
/**
|
|
34
|
+
* Constructs a new <code>SatoshiTestChallenge</code>.
|
|
35
|
+
* Full information about a Satoshi Test challenge, returned by the create and get operations.
|
|
36
|
+
* @alias module:model/SatoshiTestChallenge
|
|
37
|
+
* @param challenge_id {String} The unique identifier of the Satoshi Test challenge.
|
|
38
|
+
* @param from_address {String} The counterparty (self-custody) wallet address that must transfer the micro-deposit.
|
|
39
|
+
* @param to_address {String} The Cobo-generated verification address that will receive the micro-deposit.
|
|
40
|
+
* @param amount {String} The exact amount (in the token's smallest unit) that must be transferred. The amount is unique per challenge and is used together with `to_address` to identify a matching on-chain transfer.
|
|
41
|
+
* @param token_id {String} The ID of the token used for the micro-deposit (typically the chain's native asset).
|
|
42
|
+
* @param chain_id {String} The chain on which the micro-deposit is expected.
|
|
43
|
+
* @param status {module:model/SatoshiTestChallengeStatus}
|
|
44
|
+
* @param remaining_seconds {Number} Remaining time (in seconds) before the challenge expires. `0` when the challenge is not yet submitted or has already completed/expired.
|
|
45
|
+
*/
|
|
46
|
+
function SatoshiTestChallenge(challenge_id, from_address, to_address, amount, token_id, chain_id, status, remaining_seconds) {
|
|
47
|
+
_classCallCheck(this, SatoshiTestChallenge);
|
|
48
|
+
SatoshiTestChallenge.initialize(this, challenge_id, from_address, to_address, amount, token_id, chain_id, status, remaining_seconds);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Initializes the fields of this object.
|
|
53
|
+
* This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
|
|
54
|
+
* Only for internal use.
|
|
55
|
+
*/
|
|
56
|
+
return _createClass(SatoshiTestChallenge, null, [{
|
|
57
|
+
key: "initialize",
|
|
58
|
+
value: function initialize(obj, challenge_id, from_address, to_address, amount, token_id, chain_id, status, remaining_seconds) {
|
|
59
|
+
obj['challenge_id'] = challenge_id;
|
|
60
|
+
obj['from_address'] = from_address;
|
|
61
|
+
obj['to_address'] = to_address;
|
|
62
|
+
obj['amount'] = amount;
|
|
63
|
+
obj['token_id'] = token_id;
|
|
64
|
+
obj['chain_id'] = chain_id;
|
|
65
|
+
obj['status'] = status;
|
|
66
|
+
obj['remaining_seconds'] = remaining_seconds;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Constructs a <code>SatoshiTestChallenge</code> from a plain JavaScript object, optionally creating a new instance.
|
|
71
|
+
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
|
|
72
|
+
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
|
73
|
+
* @param {module:model/SatoshiTestChallenge} obj Optional instance to populate.
|
|
74
|
+
* @return {module:model/SatoshiTestChallenge} The populated <code>SatoshiTestChallenge</code> instance.
|
|
75
|
+
*/
|
|
76
|
+
}, {
|
|
77
|
+
key: "constructFromObject",
|
|
78
|
+
value: function constructFromObject(data, obj) {
|
|
79
|
+
if (data) {
|
|
80
|
+
obj = obj || new SatoshiTestChallenge();
|
|
81
|
+
if (data.hasOwnProperty('challenge_id')) {
|
|
82
|
+
obj['challenge_id'] = _ApiClient["default"].convertToType(data['challenge_id'], 'String');
|
|
83
|
+
}
|
|
84
|
+
if (data.hasOwnProperty('from_address')) {
|
|
85
|
+
obj['from_address'] = _ApiClient["default"].convertToType(data['from_address'], 'String');
|
|
86
|
+
}
|
|
87
|
+
if (data.hasOwnProperty('to_address')) {
|
|
88
|
+
obj['to_address'] = _ApiClient["default"].convertToType(data['to_address'], 'String');
|
|
89
|
+
}
|
|
90
|
+
if (data.hasOwnProperty('amount')) {
|
|
91
|
+
obj['amount'] = _ApiClient["default"].convertToType(data['amount'], 'String');
|
|
92
|
+
}
|
|
93
|
+
if (data.hasOwnProperty('token_id')) {
|
|
94
|
+
obj['token_id'] = _ApiClient["default"].convertToType(data['token_id'], 'String');
|
|
95
|
+
}
|
|
96
|
+
if (data.hasOwnProperty('chain_id')) {
|
|
97
|
+
obj['chain_id'] = _ApiClient["default"].convertToType(data['chain_id'], 'String');
|
|
98
|
+
}
|
|
99
|
+
if (data.hasOwnProperty('status')) {
|
|
100
|
+
obj['status'] = _SatoshiTestChallengeStatus["default"].constructFromObject(data['status']);
|
|
101
|
+
}
|
|
102
|
+
if (data.hasOwnProperty('remaining_seconds')) {
|
|
103
|
+
obj['remaining_seconds'] = _ApiClient["default"].convertToType(data['remaining_seconds'], 'Number');
|
|
104
|
+
}
|
|
105
|
+
if (data.hasOwnProperty('matched_txid')) {
|
|
106
|
+
obj['matched_txid'] = _ApiClient["default"].convertToType(data['matched_txid'], 'String');
|
|
107
|
+
}
|
|
108
|
+
if (data.hasOwnProperty('started_at')) {
|
|
109
|
+
obj['started_at'] = _ApiClient["default"].convertToType(data['started_at'], 'Number');
|
|
110
|
+
}
|
|
111
|
+
if (data.hasOwnProperty('expires_at')) {
|
|
112
|
+
obj['expires_at'] = _ApiClient["default"].convertToType(data['expires_at'], 'Number');
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
return obj;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* Validates the JSON data with respect to <code>SatoshiTestChallenge</code>.
|
|
120
|
+
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
|
121
|
+
* @return {boolean} to indicate whether the JSON data is valid with respect to <code>SatoshiTestChallenge</code>.
|
|
122
|
+
*/
|
|
123
|
+
}, {
|
|
124
|
+
key: "validateJSON",
|
|
125
|
+
value: function validateJSON(data) {
|
|
126
|
+
// check to make sure all required properties are present in the JSON string
|
|
127
|
+
var _iterator = _createForOfIteratorHelper(SatoshiTestChallenge.RequiredProperties),
|
|
128
|
+
_step;
|
|
129
|
+
try {
|
|
130
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
131
|
+
var property = _step.value;
|
|
132
|
+
if (!data.hasOwnProperty(property)) {
|
|
133
|
+
throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
// ensure the json data is a string
|
|
137
|
+
} catch (err) {
|
|
138
|
+
_iterator.e(err);
|
|
139
|
+
} finally {
|
|
140
|
+
_iterator.f();
|
|
141
|
+
}
|
|
142
|
+
if (data['challenge_id'] && !(typeof data['challenge_id'] === 'string' || data['challenge_id'] instanceof String)) {
|
|
143
|
+
throw new Error("Expected the field `challenge_id` to be a primitive type in the JSON string but got " + data['challenge_id']);
|
|
144
|
+
}
|
|
145
|
+
// ensure the json data is a string
|
|
146
|
+
if (data['from_address'] && !(typeof data['from_address'] === 'string' || data['from_address'] instanceof String)) {
|
|
147
|
+
throw new Error("Expected the field `from_address` to be a primitive type in the JSON string but got " + data['from_address']);
|
|
148
|
+
}
|
|
149
|
+
// ensure the json data is a string
|
|
150
|
+
if (data['to_address'] && !(typeof data['to_address'] === 'string' || data['to_address'] instanceof String)) {
|
|
151
|
+
throw new Error("Expected the field `to_address` to be a primitive type in the JSON string but got " + data['to_address']);
|
|
152
|
+
}
|
|
153
|
+
// ensure the json data is a string
|
|
154
|
+
if (data['amount'] && !(typeof data['amount'] === 'string' || data['amount'] instanceof String)) {
|
|
155
|
+
throw new Error("Expected the field `amount` to be a primitive type in the JSON string but got " + data['amount']);
|
|
156
|
+
}
|
|
157
|
+
// ensure the json data is a string
|
|
158
|
+
if (data['token_id'] && !(typeof data['token_id'] === 'string' || data['token_id'] instanceof String)) {
|
|
159
|
+
throw new Error("Expected the field `token_id` to be a primitive type in the JSON string but got " + data['token_id']);
|
|
160
|
+
}
|
|
161
|
+
// ensure the json data is a string
|
|
162
|
+
if (data['chain_id'] && !(typeof data['chain_id'] === 'string' || data['chain_id'] instanceof String)) {
|
|
163
|
+
throw new Error("Expected the field `chain_id` to be a primitive type in the JSON string but got " + data['chain_id']);
|
|
164
|
+
}
|
|
165
|
+
// ensure the json data is a string
|
|
166
|
+
if (data['matched_txid'] && !(typeof data['matched_txid'] === 'string' || data['matched_txid'] instanceof String)) {
|
|
167
|
+
throw new Error("Expected the field `matched_txid` to be a primitive type in the JSON string but got " + data['matched_txid']);
|
|
168
|
+
}
|
|
169
|
+
return true;
|
|
170
|
+
}
|
|
171
|
+
}]);
|
|
172
|
+
}();
|
|
173
|
+
SatoshiTestChallenge.RequiredProperties = ["challenge_id", "from_address", "to_address", "amount", "token_id", "chain_id", "status", "remaining_seconds"];
|
|
174
|
+
|
|
175
|
+
/**
|
|
176
|
+
* The unique identifier of the Satoshi Test challenge.
|
|
177
|
+
* @member {String} challenge_id
|
|
178
|
+
*/
|
|
179
|
+
SatoshiTestChallenge.prototype['challenge_id'] = undefined;
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
* The counterparty (self-custody) wallet address that must transfer the micro-deposit.
|
|
183
|
+
* @member {String} from_address
|
|
184
|
+
*/
|
|
185
|
+
SatoshiTestChallenge.prototype['from_address'] = undefined;
|
|
186
|
+
|
|
187
|
+
/**
|
|
188
|
+
* The Cobo-generated verification address that will receive the micro-deposit.
|
|
189
|
+
* @member {String} to_address
|
|
190
|
+
*/
|
|
191
|
+
SatoshiTestChallenge.prototype['to_address'] = undefined;
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* The exact amount (in the token's smallest unit) that must be transferred. The amount is unique per challenge and is used together with `to_address` to identify a matching on-chain transfer.
|
|
195
|
+
* @member {String} amount
|
|
196
|
+
*/
|
|
197
|
+
SatoshiTestChallenge.prototype['amount'] = undefined;
|
|
198
|
+
|
|
199
|
+
/**
|
|
200
|
+
* The ID of the token used for the micro-deposit (typically the chain's native asset).
|
|
201
|
+
* @member {String} token_id
|
|
202
|
+
*/
|
|
203
|
+
SatoshiTestChallenge.prototype['token_id'] = undefined;
|
|
204
|
+
|
|
205
|
+
/**
|
|
206
|
+
* The chain on which the micro-deposit is expected.
|
|
207
|
+
* @member {String} chain_id
|
|
208
|
+
*/
|
|
209
|
+
SatoshiTestChallenge.prototype['chain_id'] = undefined;
|
|
210
|
+
|
|
211
|
+
/**
|
|
212
|
+
* @member {module:model/SatoshiTestChallengeStatus} status
|
|
213
|
+
*/
|
|
214
|
+
SatoshiTestChallenge.prototype['status'] = undefined;
|
|
215
|
+
|
|
216
|
+
/**
|
|
217
|
+
* Remaining time (in seconds) before the challenge expires. `0` when the challenge is not yet submitted or has already completed/expired.
|
|
218
|
+
* @member {Number} remaining_seconds
|
|
219
|
+
*/
|
|
220
|
+
SatoshiTestChallenge.prototype['remaining_seconds'] = undefined;
|
|
221
|
+
|
|
222
|
+
/**
|
|
223
|
+
* The on-chain transaction hash of the matching transfer, once matched.
|
|
224
|
+
* @member {String} matched_txid
|
|
225
|
+
*/
|
|
226
|
+
SatoshiTestChallenge.prototype['matched_txid'] = undefined;
|
|
227
|
+
|
|
228
|
+
/**
|
|
229
|
+
* Timestamp (milliseconds) when the challenge was submitted and the countdown started.
|
|
230
|
+
* @member {Number} started_at
|
|
231
|
+
*/
|
|
232
|
+
SatoshiTestChallenge.prototype['started_at'] = undefined;
|
|
233
|
+
|
|
234
|
+
/**
|
|
235
|
+
* Timestamp (milliseconds) when the challenge will expire if not matched.
|
|
236
|
+
* @member {Number} expires_at
|
|
237
|
+
*/
|
|
238
|
+
SatoshiTestChallenge.prototype['expires_at'] = undefined;
|
|
239
|
+
var _default = exports["default"] = SatoshiTestChallenge;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = void 0;
|
|
7
|
+
var _ApiClient = _interopRequireDefault(require("../ApiClient"));
|
|
8
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
9
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
10
|
+
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
11
|
+
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
|
|
12
|
+
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
13
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
14
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
15
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /**
|
|
16
|
+
* Cobo Wallet as a Service 2.0
|
|
17
|
+
*
|
|
18
|
+
* Contact: help@cobo.com
|
|
19
|
+
*
|
|
20
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
21
|
+
* https://openapi-generator.tech
|
|
22
|
+
* Do not edit the class manually.
|
|
23
|
+
*
|
|
24
|
+
*/
|
|
25
|
+
/**
|
|
26
|
+
* Enum class SatoshiTestChallengeAction.
|
|
27
|
+
* @enum {}
|
|
28
|
+
* @readonly
|
|
29
|
+
*/
|
|
30
|
+
var SatoshiTestChallengeAction = exports["default"] = /*#__PURE__*/function () {
|
|
31
|
+
function SatoshiTestChallengeAction() {
|
|
32
|
+
_classCallCheck(this, SatoshiTestChallengeAction);
|
|
33
|
+
/**
|
|
34
|
+
* value: "PREPARE"
|
|
35
|
+
* @const
|
|
36
|
+
*/
|
|
37
|
+
_defineProperty(this, "PREPARE", "PREPARE");
|
|
38
|
+
/**
|
|
39
|
+
* value: "SUBMIT"
|
|
40
|
+
* @const
|
|
41
|
+
*/
|
|
42
|
+
_defineProperty(this, "SUBMIT", "SUBMIT");
|
|
43
|
+
/**
|
|
44
|
+
* value: "unknown_default_open_api"
|
|
45
|
+
* @const
|
|
46
|
+
*/
|
|
47
|
+
_defineProperty(this, "unknown_default_open_api", "unknown_default_open_api");
|
|
48
|
+
}
|
|
49
|
+
return _createClass(SatoshiTestChallengeAction, null, [{
|
|
50
|
+
key: "constructFromObject",
|
|
51
|
+
value:
|
|
52
|
+
/**
|
|
53
|
+
* Returns a <code>SatoshiTestChallengeAction</code> enum value from a Javascript object name.
|
|
54
|
+
* @param {Object} data The plain JavaScript object containing the name of the enum value.
|
|
55
|
+
* @return {module:model/SatoshiTestChallengeAction} The enum <code>SatoshiTestChallengeAction</code> value.
|
|
56
|
+
*/
|
|
57
|
+
function constructFromObject(object) {
|
|
58
|
+
return object;
|
|
59
|
+
}
|
|
60
|
+
}]);
|
|
61
|
+
}();
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = void 0;
|
|
7
|
+
var _ApiClient = _interopRequireDefault(require("../ApiClient"));
|
|
8
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
9
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
10
|
+
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
11
|
+
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
|
|
12
|
+
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
13
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
14
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
15
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /**
|
|
16
|
+
* Cobo Wallet as a Service 2.0
|
|
17
|
+
*
|
|
18
|
+
* Contact: help@cobo.com
|
|
19
|
+
*
|
|
20
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
21
|
+
* https://openapi-generator.tech
|
|
22
|
+
* Do not edit the class manually.
|
|
23
|
+
*
|
|
24
|
+
*/
|
|
25
|
+
/**
|
|
26
|
+
* Enum class SatoshiTestChallengeStatus.
|
|
27
|
+
* @enum {}
|
|
28
|
+
* @readonly
|
|
29
|
+
*/
|
|
30
|
+
var SatoshiTestChallengeStatus = exports["default"] = /*#__PURE__*/function () {
|
|
31
|
+
function SatoshiTestChallengeStatus() {
|
|
32
|
+
_classCallCheck(this, SatoshiTestChallengeStatus);
|
|
33
|
+
/**
|
|
34
|
+
* value: "PREPARE"
|
|
35
|
+
* @const
|
|
36
|
+
*/
|
|
37
|
+
_defineProperty(this, "PREPARE", "PREPARE");
|
|
38
|
+
/**
|
|
39
|
+
* value: "PENDING"
|
|
40
|
+
* @const
|
|
41
|
+
*/
|
|
42
|
+
_defineProperty(this, "PENDING", "PENDING");
|
|
43
|
+
/**
|
|
44
|
+
* value: "MATCHED"
|
|
45
|
+
* @const
|
|
46
|
+
*/
|
|
47
|
+
_defineProperty(this, "MATCHED", "MATCHED");
|
|
48
|
+
/**
|
|
49
|
+
* value: "VERIFIED"
|
|
50
|
+
* @const
|
|
51
|
+
*/
|
|
52
|
+
_defineProperty(this, "VERIFIED", "VERIFIED");
|
|
53
|
+
/**
|
|
54
|
+
* value: "EXPIRED"
|
|
55
|
+
* @const
|
|
56
|
+
*/
|
|
57
|
+
_defineProperty(this, "EXPIRED", "EXPIRED");
|
|
58
|
+
/**
|
|
59
|
+
* value: "DELETED"
|
|
60
|
+
* @const
|
|
61
|
+
*/
|
|
62
|
+
_defineProperty(this, "DELETED", "DELETED");
|
|
63
|
+
/**
|
|
64
|
+
* value: "unknown_default_open_api"
|
|
65
|
+
* @const
|
|
66
|
+
*/
|
|
67
|
+
_defineProperty(this, "unknown_default_open_api", "unknown_default_open_api");
|
|
68
|
+
}
|
|
69
|
+
return _createClass(SatoshiTestChallengeStatus, null, [{
|
|
70
|
+
key: "constructFromObject",
|
|
71
|
+
value:
|
|
72
|
+
/**
|
|
73
|
+
* Returns a <code>SatoshiTestChallengeStatus</code> enum value from a Javascript object name.
|
|
74
|
+
* @param {Object} data The plain JavaScript object containing the name of the enum value.
|
|
75
|
+
* @return {module:model/SatoshiTestChallengeStatus} The enum <code>SatoshiTestChallengeStatus</code> value.
|
|
76
|
+
*/
|
|
77
|
+
function constructFromObject(object) {
|
|
78
|
+
return object;
|
|
79
|
+
}
|
|
80
|
+
}]);
|
|
81
|
+
}();
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = void 0;
|
|
7
|
+
var _ApiClient = _interopRequireDefault(require("../ApiClient"));
|
|
8
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
9
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
10
|
+
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
|
|
11
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
12
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
13
|
+
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
14
|
+
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
|
|
15
|
+
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
16
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
17
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /**
|
|
18
|
+
* Cobo Wallet as a Service 2.0
|
|
19
|
+
*
|
|
20
|
+
* Contact: help@cobo.com
|
|
21
|
+
*
|
|
22
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
23
|
+
* https://openapi-generator.tech
|
|
24
|
+
* Do not edit the class manually.
|
|
25
|
+
*
|
|
26
|
+
*/
|
|
27
|
+
/**
|
|
28
|
+
* The SignatureChallenge model module.
|
|
29
|
+
* @module model/SignatureChallenge
|
|
30
|
+
*/
|
|
31
|
+
var SignatureChallenge = /*#__PURE__*/function () {
|
|
32
|
+
/**
|
|
33
|
+
* Constructs a new <code>SignatureChallenge</code>.
|
|
34
|
+
* A signature challenge for self-custody wallet verification. The wallet owner must sign the `challenge` string with the wallet associated with `address` and submit the signature via [Submit Travel Rule information for deposits](#operation/submit_deposit_travel_rule_info) or [withdrawals](#operation/submit_withdraw_travel_rule_info). The challenge is time-bounded — each call rotates the challenge and only the most recently-issued value will verify.
|
|
35
|
+
* @alias module:model/SignatureChallenge
|
|
36
|
+
* @param address {String} The self-custody wallet address that must sign this challenge. This is the counterparty address for the transaction: for deposits it is the sender's wallet, and for withdrawals it is the recipient's wallet.
|
|
37
|
+
* @param challenge {String} The human-readable, time-sensitive message to sign. Contains the wallet address, a unique nonce, and a timestamp.
|
|
38
|
+
* @param expires_in {Number} Number of seconds before the challenge expires. The signature must be submitted within this window.
|
|
39
|
+
*/
|
|
40
|
+
function SignatureChallenge(address, challenge, expires_in) {
|
|
41
|
+
_classCallCheck(this, SignatureChallenge);
|
|
42
|
+
SignatureChallenge.initialize(this, address, challenge, expires_in);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Initializes the fields of this object.
|
|
47
|
+
* This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
|
|
48
|
+
* Only for internal use.
|
|
49
|
+
*/
|
|
50
|
+
return _createClass(SignatureChallenge, null, [{
|
|
51
|
+
key: "initialize",
|
|
52
|
+
value: function initialize(obj, address, challenge, expires_in) {
|
|
53
|
+
obj['address'] = address;
|
|
54
|
+
obj['challenge'] = challenge;
|
|
55
|
+
obj['expires_in'] = expires_in;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Constructs a <code>SignatureChallenge</code> from a plain JavaScript object, optionally creating a new instance.
|
|
60
|
+
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
|
|
61
|
+
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
|
62
|
+
* @param {module:model/SignatureChallenge} obj Optional instance to populate.
|
|
63
|
+
* @return {module:model/SignatureChallenge} The populated <code>SignatureChallenge</code> instance.
|
|
64
|
+
*/
|
|
65
|
+
}, {
|
|
66
|
+
key: "constructFromObject",
|
|
67
|
+
value: function constructFromObject(data, obj) {
|
|
68
|
+
if (data) {
|
|
69
|
+
obj = obj || new SignatureChallenge();
|
|
70
|
+
if (data.hasOwnProperty('address')) {
|
|
71
|
+
obj['address'] = _ApiClient["default"].convertToType(data['address'], 'String');
|
|
72
|
+
}
|
|
73
|
+
if (data.hasOwnProperty('challenge')) {
|
|
74
|
+
obj['challenge'] = _ApiClient["default"].convertToType(data['challenge'], 'String');
|
|
75
|
+
}
|
|
76
|
+
if (data.hasOwnProperty('expires_in')) {
|
|
77
|
+
obj['expires_in'] = _ApiClient["default"].convertToType(data['expires_in'], 'Number');
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
return obj;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Validates the JSON data with respect to <code>SignatureChallenge</code>.
|
|
85
|
+
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
|
86
|
+
* @return {boolean} to indicate whether the JSON data is valid with respect to <code>SignatureChallenge</code>.
|
|
87
|
+
*/
|
|
88
|
+
}, {
|
|
89
|
+
key: "validateJSON",
|
|
90
|
+
value: function validateJSON(data) {
|
|
91
|
+
// check to make sure all required properties are present in the JSON string
|
|
92
|
+
var _iterator = _createForOfIteratorHelper(SignatureChallenge.RequiredProperties),
|
|
93
|
+
_step;
|
|
94
|
+
try {
|
|
95
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
96
|
+
var property = _step.value;
|
|
97
|
+
if (!data.hasOwnProperty(property)) {
|
|
98
|
+
throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
// ensure the json data is a string
|
|
102
|
+
} catch (err) {
|
|
103
|
+
_iterator.e(err);
|
|
104
|
+
} finally {
|
|
105
|
+
_iterator.f();
|
|
106
|
+
}
|
|
107
|
+
if (data['address'] && !(typeof data['address'] === 'string' || data['address'] instanceof String)) {
|
|
108
|
+
throw new Error("Expected the field `address` to be a primitive type in the JSON string but got " + data['address']);
|
|
109
|
+
}
|
|
110
|
+
// ensure the json data is a string
|
|
111
|
+
if (data['challenge'] && !(typeof data['challenge'] === 'string' || data['challenge'] instanceof String)) {
|
|
112
|
+
throw new Error("Expected the field `challenge` to be a primitive type in the JSON string but got " + data['challenge']);
|
|
113
|
+
}
|
|
114
|
+
return true;
|
|
115
|
+
}
|
|
116
|
+
}]);
|
|
117
|
+
}();
|
|
118
|
+
SignatureChallenge.RequiredProperties = ["address", "challenge", "expires_in"];
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* The self-custody wallet address that must sign this challenge. This is the counterparty address for the transaction: for deposits it is the sender's wallet, and for withdrawals it is the recipient's wallet.
|
|
122
|
+
* @member {String} address
|
|
123
|
+
*/
|
|
124
|
+
SignatureChallenge.prototype['address'] = undefined;
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* The human-readable, time-sensitive message to sign. Contains the wallet address, a unique nonce, and a timestamp.
|
|
128
|
+
* @member {String} challenge
|
|
129
|
+
*/
|
|
130
|
+
SignatureChallenge.prototype['challenge'] = undefined;
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* Number of seconds before the challenge expires. The signature must be submitted within this window.
|
|
134
|
+
* @member {Number} expires_in
|
|
135
|
+
*/
|
|
136
|
+
SignatureChallenge.prototype['expires_in'] = undefined;
|
|
137
|
+
var _default = exports["default"] = SignatureChallenge;
|