hivesigner 3.3.4 → 4.0.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/.claude/settings.local.json +12 -0
- package/CLAUDE.md +142 -0
- package/README.md +14 -1
- package/lib/client.d.ts +1 -2
- package/lib/hivesigner.min.js +1 -10
- package/lib/index.js +135 -222
- package/lib/methods/send-operation.method.d.ts +1 -2
- package/lib/methods/send-operations.method.d.ts +1 -2
- package/lib/methods/send-transaction.method.d.ts +1 -2
- package/lib/types/callback-function.type.d.ts +1 -1
- package/lib/types/hive.types.d.ts +13 -0
- package/lib/types/index.d.ts +1 -0
- package/lib/types/send-response.type.d.ts +1 -1
- package/package.json +7 -17
- package/rollup.config.js +4 -3
- package/src/client.spec.ts +28 -30
- package/src/client.ts +8 -4
- package/src/methods/send-operation.method.spec.ts +1 -1
- package/src/methods/send-operation.method.ts +1 -2
- package/src/methods/send-operations.method.spec.ts +1 -1
- package/src/methods/send-operations.method.ts +1 -2
- package/src/methods/send-transaction.method.spec.ts +1 -1
- package/src/methods/send-transaction.method.ts +1 -2
- package/src/require-import.spec.js +6 -1
- package/src/types/hive.types.ts +12 -0
- package/src/types/index.ts +1 -0
- package/tsconfig.json +3 -1
- package/webpack.config.js +8 -1
- package/.babelrc +0 -8
package/lib/index.js
CHANGED
|
@@ -2,78 +2,20 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var fetch = require('cross-fetch');
|
|
6
5
|
var hiveUri = require('hive-uri');
|
|
7
6
|
|
|
8
|
-
|
|
7
|
+
const API_URL = 'https://hivesigner.com';
|
|
9
8
|
|
|
10
|
-
|
|
9
|
+
const BASE_URL = 'https://hivesigner.com';
|
|
11
10
|
|
|
12
|
-
|
|
13
|
-
Copyright (c) Microsoft Corporation.
|
|
14
|
-
|
|
15
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
16
|
-
purpose with or without fee is hereby granted.
|
|
17
|
-
|
|
18
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
19
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
20
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
21
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
22
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
23
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
24
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
25
|
-
***************************************************************************** */
|
|
26
|
-
|
|
27
|
-
function __awaiter(thisArg, _arguments, P, generator) {
|
|
28
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
29
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
30
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
31
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
32
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
33
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
function __generator(thisArg, body) {
|
|
38
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
39
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
40
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
41
|
-
function step(op) {
|
|
42
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
43
|
-
while (_) try {
|
|
44
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
45
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
46
|
-
switch (op[0]) {
|
|
47
|
-
case 0: case 1: t = op; break;
|
|
48
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
49
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
50
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
51
|
-
default:
|
|
52
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
53
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
54
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
55
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
56
|
-
if (t[2]) _.ops.pop();
|
|
57
|
-
_.trys.pop(); continue;
|
|
58
|
-
}
|
|
59
|
-
op = body.call(thisArg, _);
|
|
60
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
61
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
var API_URL = 'https://hivesigner.com';
|
|
66
|
-
|
|
67
|
-
var BASE_URL = 'https://hivesigner.com';
|
|
68
|
-
|
|
69
|
-
var BETA_URL = 'https://hivesigner.com';
|
|
11
|
+
const BETA_URL = 'https://hivesigner.com';
|
|
70
12
|
|
|
71
13
|
function isBrowser() {
|
|
72
14
|
return typeof window !== 'undefined' && !!window;
|
|
73
15
|
}
|
|
74
16
|
|
|
75
|
-
|
|
76
|
-
|
|
17
|
+
class Client {
|
|
18
|
+
constructor(config) {
|
|
77
19
|
this.apiURL = config.apiURL || API_URL;
|
|
78
20
|
this.app = config.app;
|
|
79
21
|
this.callbackURL = config.callbackURL;
|
|
@@ -81,203 +23,174 @@ var Client = /** @class */ (function () {
|
|
|
81
23
|
this.scope = config.scope;
|
|
82
24
|
this.responseType = config.responseType;
|
|
83
25
|
}
|
|
84
|
-
|
|
26
|
+
setBaseURL() {
|
|
85
27
|
console.warn('The function "setBaseUrl" is deprecated, the base URL is always "https://hivesigner.com", you can only change the API URL with "setApiURL"');
|
|
86
28
|
return this;
|
|
87
|
-
}
|
|
88
|
-
|
|
29
|
+
}
|
|
30
|
+
setApiURL(url) {
|
|
89
31
|
this.apiURL = url;
|
|
90
32
|
return this;
|
|
91
|
-
}
|
|
92
|
-
|
|
33
|
+
}
|
|
34
|
+
setApp(app) {
|
|
93
35
|
this.app = app;
|
|
94
36
|
return this;
|
|
95
|
-
}
|
|
96
|
-
|
|
37
|
+
}
|
|
38
|
+
setCallbackURL(url) {
|
|
97
39
|
this.callbackURL = url;
|
|
98
40
|
return this;
|
|
99
|
-
}
|
|
100
|
-
|
|
41
|
+
}
|
|
42
|
+
setAccessToken(accessToken) {
|
|
101
43
|
this.accessToken = accessToken;
|
|
102
44
|
return this;
|
|
103
|
-
}
|
|
104
|
-
|
|
45
|
+
}
|
|
46
|
+
removeAccessToken() {
|
|
105
47
|
delete this.accessToken;
|
|
106
48
|
return this;
|
|
107
|
-
}
|
|
108
|
-
|
|
49
|
+
}
|
|
50
|
+
setScope(scope) {
|
|
109
51
|
this.scope = scope;
|
|
110
52
|
return this;
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
53
|
+
}
|
|
54
|
+
getLoginURL(state, account) {
|
|
55
|
+
const redirectUri = encodeURIComponent(this.callbackURL);
|
|
56
|
+
let loginURL = `${BASE_URL}/oauth2/authorize?client_id=${this.app}&redirect_uri=${redirectUri}`;
|
|
115
57
|
if (this.responseType === 'code') {
|
|
116
|
-
loginURL +=
|
|
58
|
+
loginURL += `&response_type=${this.responseType}`;
|
|
117
59
|
}
|
|
118
60
|
if (this.scope) {
|
|
119
|
-
loginURL +=
|
|
61
|
+
loginURL += `&scope=${this.scope.join(',')}`;
|
|
120
62
|
}
|
|
121
63
|
if (state) {
|
|
122
|
-
loginURL +=
|
|
64
|
+
loginURL += `&state=${encodeURIComponent(state)}`;
|
|
123
65
|
}
|
|
124
66
|
if (account) {
|
|
125
|
-
loginURL +=
|
|
67
|
+
loginURL += `&account=${encodeURIComponent(account)}`;
|
|
126
68
|
}
|
|
127
69
|
return loginURL;
|
|
128
|
-
}
|
|
129
|
-
|
|
70
|
+
}
|
|
71
|
+
login(options) {
|
|
130
72
|
if (isBrowser()) {
|
|
131
73
|
// @ts-ignore
|
|
132
74
|
window.location = this.getLoginURL(options.state);
|
|
133
75
|
}
|
|
134
|
-
}
|
|
135
|
-
|
|
76
|
+
}
|
|
77
|
+
me(cb) {
|
|
136
78
|
return this.send('me', 'POST', {}, cb);
|
|
137
|
-
}
|
|
138
|
-
|
|
79
|
+
}
|
|
80
|
+
decode(memo, cb) {
|
|
139
81
|
return this.send('decode', 'POST', { memo: memo }, cb);
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
voter
|
|
144
|
-
author
|
|
145
|
-
permlink
|
|
146
|
-
weight
|
|
82
|
+
}
|
|
83
|
+
vote(voter, author, permlink, weight, cb) {
|
|
84
|
+
const params = {
|
|
85
|
+
voter,
|
|
86
|
+
author,
|
|
87
|
+
permlink,
|
|
88
|
+
weight
|
|
147
89
|
};
|
|
148
90
|
return this.broadcast([['vote', params]], cb);
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
|
|
91
|
+
}
|
|
92
|
+
comment(parentAuthor, parentPermlink, author, permlink, title, body, jsonMetadata, cb) {
|
|
93
|
+
let json = jsonMetadata;
|
|
152
94
|
if (typeof jsonMetadata !== 'string') {
|
|
153
95
|
json = JSON.stringify(jsonMetadata);
|
|
154
96
|
}
|
|
155
|
-
|
|
97
|
+
const params = {
|
|
156
98
|
parent_author: parentAuthor,
|
|
157
99
|
parent_permlink: parentPermlink,
|
|
158
|
-
author
|
|
159
|
-
permlink
|
|
160
|
-
title
|
|
161
|
-
body
|
|
100
|
+
author,
|
|
101
|
+
permlink,
|
|
102
|
+
title,
|
|
103
|
+
body,
|
|
162
104
|
json_metadata: json
|
|
163
105
|
};
|
|
164
106
|
return this.broadcast([['comment', params]], cb);
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
author
|
|
169
|
-
permlink
|
|
107
|
+
}
|
|
108
|
+
deleteComment(author, permlink, cb) {
|
|
109
|
+
const params = {
|
|
110
|
+
author,
|
|
111
|
+
permlink
|
|
170
112
|
};
|
|
171
113
|
return this.broadcast([['delete_comment', params]], cb);
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
|
|
114
|
+
}
|
|
115
|
+
customJson(requiredAuths, requiredPostingAuths, id, json, cb) {
|
|
116
|
+
const params = {
|
|
175
117
|
required_auths: requiredAuths,
|
|
176
118
|
required_posting_auths: requiredPostingAuths,
|
|
177
|
-
id
|
|
178
|
-
json
|
|
119
|
+
id,
|
|
120
|
+
json
|
|
179
121
|
};
|
|
180
122
|
return this.broadcast([['custom_json', params]], cb);
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
|
|
123
|
+
}
|
|
124
|
+
reblog(account, author, permlink, cb) {
|
|
125
|
+
const json = ['reblog', { account, author, permlink }];
|
|
184
126
|
return this.customJson([], [account], 'follow', JSON.stringify(json), cb);
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
|
|
127
|
+
}
|
|
128
|
+
follow(follower, following, cb) {
|
|
129
|
+
const json = ['follow', { follower, following, what: ['blog'] }];
|
|
188
130
|
return this.customJson([], [follower], 'follow', JSON.stringify(json), cb);
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
|
|
131
|
+
}
|
|
132
|
+
unfollow(unfollower, unfollowing, cb) {
|
|
133
|
+
const json = ['follow', { follower: unfollower, following: unfollowing, what: [] }];
|
|
192
134
|
return this.customJson([], [unfollower], 'follow', JSON.stringify(json), cb);
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
|
|
135
|
+
}
|
|
136
|
+
ignore(follower, following, cb) {
|
|
137
|
+
const json = ['follow', { follower, following, what: ['ignore'] }];
|
|
196
138
|
return this.customJson([], [follower], 'follow', JSON.stringify(json), cb);
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
account
|
|
139
|
+
}
|
|
140
|
+
claimRewardBalance(account, rewardHive, rewardHbd, rewardVests, cb) {
|
|
141
|
+
const params = {
|
|
142
|
+
account,
|
|
201
143
|
reward_hive: rewardHive,
|
|
202
144
|
reward_hbd: rewardHbd,
|
|
203
145
|
reward_vests: rewardVests
|
|
204
146
|
};
|
|
205
147
|
return this.broadcast([['claim_reward_balance', params]], cb);
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
case 1:
|
|
213
|
-
_a.sent();
|
|
214
|
-
return [2 /*return*/, this.removeAccessToken()];
|
|
215
|
-
}
|
|
216
|
-
});
|
|
217
|
-
});
|
|
218
|
-
};
|
|
219
|
-
Client.prototype.updateUserMetadata = function (metadata, cb) {
|
|
220
|
-
if (metadata === void 0) { metadata = {}; }
|
|
148
|
+
}
|
|
149
|
+
async revokeToken(cb) {
|
|
150
|
+
await this.send('oauth2/token/revoke', 'POST', { token: this.accessToken }, cb);
|
|
151
|
+
return this.removeAccessToken();
|
|
152
|
+
}
|
|
153
|
+
updateUserMetadata(metadata = {}, cb) {
|
|
221
154
|
console.warn('The function "updateUserMetadata" is deprecated.');
|
|
222
155
|
return this.send('me', 'PUT', { user_metadata: metadata }, cb);
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
return
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
return __awaiter(this, void 0, Promise, function () {
|
|
254
|
-
var response, json;
|
|
255
|
-
return __generator(this, function (_a) {
|
|
256
|
-
switch (_a.label) {
|
|
257
|
-
case 0: return [4 /*yield*/, fetch__default['default'](url, {
|
|
258
|
-
method: method,
|
|
259
|
-
headers: {
|
|
260
|
-
Accept: 'application/json, text/plain, */*',
|
|
261
|
-
'Content-Type': 'application/json',
|
|
262
|
-
Authorization: this.accessToken,
|
|
263
|
-
},
|
|
264
|
-
body: JSON.stringify(body),
|
|
265
|
-
})];
|
|
266
|
-
case 1:
|
|
267
|
-
response = _a.sent();
|
|
268
|
-
return [4 /*yield*/, response.json()];
|
|
269
|
-
case 2:
|
|
270
|
-
json = _a.sent();
|
|
271
|
-
if (response.status !== 200 || json.error) {
|
|
272
|
-
throw json;
|
|
273
|
-
}
|
|
274
|
-
return [2 /*return*/, json];
|
|
275
|
-
}
|
|
276
|
-
});
|
|
156
|
+
}
|
|
157
|
+
async send(route, method, body, cb) {
|
|
158
|
+
const url = `${this.apiURL}/api/${route}`;
|
|
159
|
+
if (!cb) {
|
|
160
|
+
return this.makeRequest(url, method, body);
|
|
161
|
+
}
|
|
162
|
+
try {
|
|
163
|
+
const json = await this.makeRequest(url, method, body);
|
|
164
|
+
return cb(null, json);
|
|
165
|
+
}
|
|
166
|
+
catch (failureResponse) {
|
|
167
|
+
return cb(failureResponse, null);
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
broadcast(operations, cb) {
|
|
171
|
+
return this.send('broadcast', 'POST', { operations }, cb);
|
|
172
|
+
}
|
|
173
|
+
async makeRequest(url, method, body) {
|
|
174
|
+
if (typeof globalThis.fetch !== 'function') {
|
|
175
|
+
throw new Error('hivesigner: fetch is not available. Node.js 18+ or a modern browser is required. ' +
|
|
176
|
+
'If you are in an older environment, provide a global fetch polyfill.');
|
|
177
|
+
}
|
|
178
|
+
const response = await globalThis.fetch(url, {
|
|
179
|
+
method,
|
|
180
|
+
headers: {
|
|
181
|
+
Accept: 'application/json, text/plain, */*',
|
|
182
|
+
'Content-Type': 'application/json',
|
|
183
|
+
Authorization: this.accessToken,
|
|
184
|
+
},
|
|
185
|
+
body: JSON.stringify(body),
|
|
277
186
|
});
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
187
|
+
const json = await response.json();
|
|
188
|
+
if (response.status !== 200 || json.error) {
|
|
189
|
+
throw json;
|
|
190
|
+
}
|
|
191
|
+
return json;
|
|
192
|
+
}
|
|
193
|
+
}
|
|
281
194
|
|
|
282
195
|
function sign(name, params, redirectUri) {
|
|
283
196
|
console.warn('The function "sign" is deprecated.');
|
|
@@ -287,39 +200,39 @@ function sign(name, params, redirectUri) {
|
|
|
287
200
|
error_description: 'Request has an invalid format'
|
|
288
201
|
};
|
|
289
202
|
}
|
|
290
|
-
|
|
203
|
+
let url = `${BASE_URL}/sign/${name}?`;
|
|
291
204
|
url += Object.keys(params)
|
|
292
|
-
.map(
|
|
205
|
+
.map(key => `${key}=${encodeURIComponent(params[key])}`)
|
|
293
206
|
.join('&');
|
|
294
|
-
url += redirectUri ?
|
|
207
|
+
url += redirectUri ? `&redirect_uri=${encodeURIComponent(redirectUri)}` : '';
|
|
295
208
|
return url;
|
|
296
209
|
}
|
|
297
210
|
|
|
298
211
|
function sendOperation(op, params, cb) {
|
|
299
|
-
|
|
300
|
-
|
|
212
|
+
const uri = hiveUri.encodeOp(op, params);
|
|
213
|
+
const webUrl = uri.replace('hive://', `${BETA_URL}/`);
|
|
301
214
|
if (cb && isBrowser()) {
|
|
302
|
-
|
|
215
|
+
const win = window.open(webUrl, '_blank');
|
|
303
216
|
return win.focus();
|
|
304
217
|
}
|
|
305
218
|
return webUrl;
|
|
306
219
|
}
|
|
307
220
|
|
|
308
221
|
function sendOperations(ops, params, cb) {
|
|
309
|
-
|
|
310
|
-
|
|
222
|
+
const uri = hiveUri.encodeOps(ops, params);
|
|
223
|
+
const webUrl = uri.replace('hive://', `${BETA_URL}/`);
|
|
311
224
|
if (cb && isBrowser()) {
|
|
312
|
-
|
|
225
|
+
const win = window.open(webUrl, '_blank');
|
|
313
226
|
return win.focus();
|
|
314
227
|
}
|
|
315
228
|
return webUrl;
|
|
316
229
|
}
|
|
317
230
|
|
|
318
231
|
function sendTransaction(tx, params, cb) {
|
|
319
|
-
|
|
320
|
-
|
|
232
|
+
const uri = hiveUri.encodeTx(tx, params);
|
|
233
|
+
const webUrl = uri.replace('hive://', `${BETA_URL}/`);
|
|
321
234
|
if (cb && isBrowser()) {
|
|
322
|
-
|
|
235
|
+
const win = window.open(webUrl, '_blank');
|
|
323
236
|
return win.focus();
|
|
324
237
|
}
|
|
325
238
|
return webUrl;
|
|
@@ -331,17 +244,17 @@ function Initialize(config) {
|
|
|
331
244
|
}
|
|
332
245
|
|
|
333
246
|
var index = {
|
|
334
|
-
Client
|
|
335
|
-
Initialize
|
|
336
|
-
sendTransaction
|
|
337
|
-
sendOperations
|
|
338
|
-
sendOperation
|
|
339
|
-
sign
|
|
247
|
+
Client,
|
|
248
|
+
Initialize,
|
|
249
|
+
sendTransaction,
|
|
250
|
+
sendOperations,
|
|
251
|
+
sendOperation,
|
|
252
|
+
sign
|
|
340
253
|
};
|
|
341
254
|
|
|
342
255
|
exports.Client = Client;
|
|
343
256
|
exports.Initialize = Initialize;
|
|
344
|
-
exports
|
|
257
|
+
exports["default"] = index;
|
|
345
258
|
exports.sendOperation = sendOperation;
|
|
346
259
|
exports.sendOperations = sendOperations;
|
|
347
260
|
exports.sendTransaction = sendTransaction;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
import { Parameters } from 'hive-uri';
|
|
2
|
-
import { CallbackFunction } from '../types';
|
|
3
|
-
import { Operation } from '@hiveio/dhive';
|
|
2
|
+
import { CallbackFunction, Operation } from '../types';
|
|
4
3
|
export declare function sendOperation(op: Operation, params: Parameters, cb: CallbackFunction): string | void;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
import { Parameters } from 'hive-uri';
|
|
2
|
-
import { CallbackFunction } from '../types';
|
|
3
|
-
import { Operation } from '@hiveio/dhive';
|
|
2
|
+
import { CallbackFunction, Operation } from '../types';
|
|
4
3
|
export declare function sendOperations(ops: Operation[], params: Parameters, cb: CallbackFunction): string | void;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
import { Parameters } from 'hive-uri';
|
|
2
|
-
import { CallbackFunction } from '../types';
|
|
3
|
-
import { Transaction } from '@hiveio/dhive';
|
|
2
|
+
import { CallbackFunction, Transaction } from '../types';
|
|
4
3
|
export declare function sendTransaction(tx: Transaction, params: Parameters, cb: CallbackFunction): string | void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type CallbackFunction = (error: any, response: any) => any;
|
package/lib/types/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type SendResponse = any;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "hivesigner",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.0",
|
|
4
4
|
"description": "Hivesigner SDK",
|
|
5
5
|
"main": "./lib/index",
|
|
6
6
|
"types": "./lib/index",
|
|
@@ -15,41 +15,31 @@
|
|
|
15
15
|
},
|
|
16
16
|
"author": "Ecency <hello@ecency.com>",
|
|
17
17
|
"license": "MIT",
|
|
18
|
+
"engines": {
|
|
19
|
+
"node": ">=18.0.0"
|
|
20
|
+
},
|
|
18
21
|
"bugs": {
|
|
19
22
|
"url": "https://github.com/ecency/hivesigner-sdk/issues"
|
|
20
23
|
},
|
|
21
24
|
"homepage": "https://github.com/ecency/hivesigner-sdk#readme",
|
|
22
25
|
"devDependencies": {
|
|
23
|
-
"@
|
|
24
|
-
"@babel/plugin-proposal-class-properties": "^7.13.0",
|
|
25
|
-
"@babel/plugin-proposal-object-rest-spread": "^7.13.8",
|
|
26
|
-
"@babel/plugin-transform-modules-commonjs": "^7.13.8",
|
|
27
|
-
"@babel/plugin-transform-runtime": "^7.13.9",
|
|
28
|
-
"@babel/preset-env": "^7.13.9",
|
|
29
|
-
"@babel/preset-typescript": "^7.13.0",
|
|
30
|
-
"@hiveio/dhive": "^1.2.6",
|
|
31
|
-
"@types/bytebuffer": "^5.0.42",
|
|
26
|
+
"@rollup/plugin-typescript": "^12.3.0",
|
|
32
27
|
"@types/jest": "^26.0.20",
|
|
33
28
|
"@types/node": "^14.14.28",
|
|
34
29
|
"@typescript-eslint/eslint-plugin": "^4.15.1",
|
|
35
30
|
"@typescript-eslint/parser": "^4.15.1",
|
|
36
|
-
"babel-core": "^6.26.3",
|
|
37
|
-
"babel-loader": "^8.2.2",
|
|
38
31
|
"eslint": "^7.20.0",
|
|
39
32
|
"jest": "^26.6.3",
|
|
40
33
|
"rollup": "^2.40.0",
|
|
41
|
-
"rollup-plugin-typescript": "^1.0.1",
|
|
42
34
|
"ts-jest": "^26.5.1",
|
|
43
35
|
"ts-loader": "^8.0.17",
|
|
44
36
|
"ts-node": "^9.1.1",
|
|
45
37
|
"tslib": "^2.1.0",
|
|
46
38
|
"typescript": "^4.1.5",
|
|
47
|
-
"webpack": "^
|
|
48
|
-
"webpack-cli": "^
|
|
39
|
+
"webpack": "^5.105.4",
|
|
40
|
+
"webpack-cli": "^7.0.2"
|
|
49
41
|
},
|
|
50
42
|
"dependencies": {
|
|
51
|
-
"@babel/runtime": "^7.13.9",
|
|
52
|
-
"cross-fetch": "^3.0.6",
|
|
53
43
|
"hive-uri": "^0.2.4"
|
|
54
44
|
}
|
|
55
45
|
}
|
package/rollup.config.js
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import typescript from 'rollup
|
|
1
|
+
import typescript from '@rollup/plugin-typescript';
|
|
2
2
|
|
|
3
3
|
export default {
|
|
4
4
|
input: './src/index.ts',
|
|
5
5
|
output: {
|
|
6
|
-
|
|
6
|
+
file: 'lib/index.js',
|
|
7
7
|
format: 'cjs',
|
|
8
|
+
exports: 'named',
|
|
8
9
|
},
|
|
9
10
|
plugins: [
|
|
10
|
-
typescript()
|
|
11
|
+
typescript({ declaration: false, sourceMap: false, module: 'esnext' })
|
|
11
12
|
]
|
|
12
13
|
}
|