@1money/protocol-ts-sdk 1.0.14 → 1.0.15
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/es/api/index.d.ts +0 -3
- package/es/api/index.js +24 -40
- package/es/api/tokens/types.d.ts +0 -7
- package/es/api/transactions/types.d.ts +0 -1
- package/es/index.js +24 -40
- package/lib/api/index.d.ts +0 -3
- package/lib/api/index.js +24 -40
- package/lib/api/tokens/types.d.ts +0 -7
- package/lib/api/transactions/types.d.ts +0 -1
- package/lib/index.js +24 -40
- package/package.json +1 -1
- package/umd/1money-protocol-ts-sdk.min.js +2 -2
- package/es/api/state/index.d.ts +0 -12
- package/es/api/state/types.d.ts +0 -7
- package/lib/api/state/index.d.ts +0 -12
- package/lib/api/state/types.d.ts +0 -7
package/es/api/index.d.ts
CHANGED
|
@@ -3,13 +3,11 @@ import checkpointsApi from './checkpoints';
|
|
|
3
3
|
import tokensApi from './tokens';
|
|
4
4
|
import transactionsApi from './transactions';
|
|
5
5
|
import chainApi from './chain';
|
|
6
|
-
import stateApi from './state';
|
|
7
6
|
export * from './accounts/types';
|
|
8
7
|
export * from './tokens/types';
|
|
9
8
|
export * from './transactions/types';
|
|
10
9
|
export * from './checkpoints/types';
|
|
11
10
|
export * from './chain/types';
|
|
12
|
-
export * from './state/types';
|
|
13
11
|
/**
|
|
14
12
|
* API client for 1money network
|
|
15
13
|
* @param options Configuration options
|
|
@@ -26,6 +24,5 @@ export declare function api(options?: {
|
|
|
26
24
|
tokens: typeof tokensApi;
|
|
27
25
|
transactions: typeof transactionsApi;
|
|
28
26
|
chain: typeof chainApi;
|
|
29
|
-
state: typeof stateApi;
|
|
30
27
|
};
|
|
31
28
|
export default api;
|
package/es/api/index.js
CHANGED
|
@@ -316,7 +316,7 @@ const TESTNET_API_URL = 'https://api.testnet.1money.network';
|
|
|
316
316
|
const MAINNET_API_URL = 'https://api.1money.network';
|
|
317
317
|
const LOCAL_API_URL = 'http://localhost:18555';
|
|
318
318
|
// API version
|
|
319
|
-
const API_VERSION = 'v1';const API_PREFIX$
|
|
319
|
+
const API_VERSION = 'v1';const API_PREFIX$4 = `/${API_VERSION}/accounts`;
|
|
320
320
|
/**
|
|
321
321
|
* Accounts API methods
|
|
322
322
|
*/
|
|
@@ -327,7 +327,7 @@ const accountsApi = {
|
|
|
327
327
|
* @returns Promise with account info response
|
|
328
328
|
*/
|
|
329
329
|
getNonce: (address) => {
|
|
330
|
-
return get(`${API_PREFIX$
|
|
330
|
+
return get(`${API_PREFIX$4}/nonce?address=${address}`, { withCredentials: false });
|
|
331
331
|
},
|
|
332
332
|
/**
|
|
333
333
|
* Get associated token account
|
|
@@ -336,9 +336,9 @@ const accountsApi = {
|
|
|
336
336
|
* @returns Promise with associated token account response
|
|
337
337
|
*/
|
|
338
338
|
getTokenAccount: (address, token) => {
|
|
339
|
-
return get(`${API_PREFIX$
|
|
339
|
+
return get(`${API_PREFIX$4}/token_account?address=${address}&token=${token}`, { withCredentials: false });
|
|
340
340
|
}
|
|
341
|
-
};const API_PREFIX$
|
|
341
|
+
};const API_PREFIX$3 = `/${API_VERSION}/checkpoints`;
|
|
342
342
|
/**
|
|
343
343
|
* Checkpoint API methods
|
|
344
344
|
*/
|
|
@@ -348,7 +348,7 @@ const checkpointsApi = {
|
|
|
348
348
|
* @returns Promise with checkpoint number response
|
|
349
349
|
*/
|
|
350
350
|
getNumber: () => {
|
|
351
|
-
return get(`${API_PREFIX$
|
|
351
|
+
return get(`${API_PREFIX$3}/number`, { withCredentials: false });
|
|
352
352
|
},
|
|
353
353
|
/**
|
|
354
354
|
* Get checkpoint by hash
|
|
@@ -357,7 +357,7 @@ const checkpointsApi = {
|
|
|
357
357
|
* @returns Promise with checkpoint response
|
|
358
358
|
*/
|
|
359
359
|
getByHash: (hash, full = false) => {
|
|
360
|
-
return get(`${API_PREFIX$
|
|
360
|
+
return get(`${API_PREFIX$3}/by_hash?hash=${hash}&full=${full}`, { withCredentials: false });
|
|
361
361
|
},
|
|
362
362
|
/**
|
|
363
363
|
* Get checkpoint by number
|
|
@@ -366,9 +366,9 @@ const checkpointsApi = {
|
|
|
366
366
|
* @returns Promise with checkpoint response
|
|
367
367
|
*/
|
|
368
368
|
getByNumber: (number, full = false) => {
|
|
369
|
-
return get(`${API_PREFIX$
|
|
369
|
+
return get(`${API_PREFIX$3}/by_number?number=${number}&full=${full}`, { withCredentials: false });
|
|
370
370
|
}
|
|
371
|
-
};const API_PREFIX$
|
|
371
|
+
};const API_PREFIX$2 = `/${API_VERSION}/tokens`;
|
|
372
372
|
/**
|
|
373
373
|
* Tokens API methods
|
|
374
374
|
*/
|
|
@@ -379,7 +379,7 @@ const tokensApi = {
|
|
|
379
379
|
* @returns Promise with token metadata response
|
|
380
380
|
*/
|
|
381
381
|
getTokenMetadata: (token) => {
|
|
382
|
-
return get(`${API_PREFIX$
|
|
382
|
+
return get(`${API_PREFIX$2}/token_metadata?token=${token}`, { withCredentials: false });
|
|
383
383
|
},
|
|
384
384
|
/**
|
|
385
385
|
* Manage token blacklist
|
|
@@ -387,7 +387,7 @@ const tokensApi = {
|
|
|
387
387
|
* @returns Promise with transaction hash response
|
|
388
388
|
*/
|
|
389
389
|
manageBlacklist: (payload) => {
|
|
390
|
-
return post(`${API_PREFIX$
|
|
390
|
+
return post(`${API_PREFIX$2}/manage_blacklist`, payload, { withCredentials: false });
|
|
391
391
|
},
|
|
392
392
|
/**
|
|
393
393
|
* Manage token whitelist
|
|
@@ -395,7 +395,7 @@ const tokensApi = {
|
|
|
395
395
|
* @returns Promise with transaction hash response
|
|
396
396
|
*/
|
|
397
397
|
manageWhitelist: (payload) => {
|
|
398
|
-
return post(`${API_PREFIX$
|
|
398
|
+
return post(`${API_PREFIX$2}/manage_whitelist`, payload, { withCredentials: false });
|
|
399
399
|
},
|
|
400
400
|
/**
|
|
401
401
|
* Burn tokens
|
|
@@ -403,7 +403,7 @@ const tokensApi = {
|
|
|
403
403
|
* @returns Promise with transaction hash response
|
|
404
404
|
*/
|
|
405
405
|
burnToken: (payload) => {
|
|
406
|
-
return post(`${API_PREFIX$
|
|
406
|
+
return post(`${API_PREFIX$2}/burn`, payload, { withCredentials: false });
|
|
407
407
|
},
|
|
408
408
|
/**
|
|
409
409
|
* Grant or revoke token authority
|
|
@@ -411,7 +411,7 @@ const tokensApi = {
|
|
|
411
411
|
* @returns Promise with transaction hash response
|
|
412
412
|
*/
|
|
413
413
|
grantAuthority: (payload) => {
|
|
414
|
-
return post(`${API_PREFIX$
|
|
414
|
+
return post(`${API_PREFIX$2}/grant_authority`, payload, { withCredentials: false });
|
|
415
415
|
},
|
|
416
416
|
/**
|
|
417
417
|
* Issue new token
|
|
@@ -419,7 +419,7 @@ const tokensApi = {
|
|
|
419
419
|
* @returns Promise with transaction hash and token address response
|
|
420
420
|
*/
|
|
421
421
|
issueToken: (payload) => {
|
|
422
|
-
return post(`${API_PREFIX$
|
|
422
|
+
return post(`${API_PREFIX$2}/issue`, payload, { withCredentials: false });
|
|
423
423
|
},
|
|
424
424
|
/**
|
|
425
425
|
* Mint tokens
|
|
@@ -427,7 +427,7 @@ const tokensApi = {
|
|
|
427
427
|
* @returns Promise with transaction hash response
|
|
428
428
|
*/
|
|
429
429
|
mintToken: (payload) => {
|
|
430
|
-
return post(`${API_PREFIX$
|
|
430
|
+
return post(`${API_PREFIX$2}/mint`, payload, { withCredentials: false });
|
|
431
431
|
},
|
|
432
432
|
/**
|
|
433
433
|
* Pause or unpause token
|
|
@@ -435,7 +435,7 @@ const tokensApi = {
|
|
|
435
435
|
* @returns Promise with transaction hash response
|
|
436
436
|
*/
|
|
437
437
|
pauseToken: (payload) => {
|
|
438
|
-
return post(`${API_PREFIX$
|
|
438
|
+
return post(`${API_PREFIX$2}/pause`, payload, { withCredentials: false });
|
|
439
439
|
},
|
|
440
440
|
/**
|
|
441
441
|
* Update token metadata
|
|
@@ -443,9 +443,9 @@ const tokensApi = {
|
|
|
443
443
|
* @returns Promise with transaction hash response
|
|
444
444
|
*/
|
|
445
445
|
updateMetadata: (payload) => {
|
|
446
|
-
return post(`${API_PREFIX$
|
|
446
|
+
return post(`${API_PREFIX$2}/update_metadata`, payload, { withCredentials: false });
|
|
447
447
|
}
|
|
448
|
-
};const API_PREFIX$
|
|
448
|
+
};const API_PREFIX$1 = `/${API_VERSION}/transactions`;
|
|
449
449
|
/**
|
|
450
450
|
* Transactions API methods
|
|
451
451
|
*/
|
|
@@ -456,7 +456,7 @@ const transactionsApi = {
|
|
|
456
456
|
* @returns Promise with transaction response
|
|
457
457
|
*/
|
|
458
458
|
getByHash: (hash) => {
|
|
459
|
-
return get(`${API_PREFIX$
|
|
459
|
+
return get(`${API_PREFIX$1}/by_hash?hash=${hash}`, { withCredentials: false });
|
|
460
460
|
},
|
|
461
461
|
/**
|
|
462
462
|
* Get transaction receipt by hash
|
|
@@ -464,7 +464,7 @@ const transactionsApi = {
|
|
|
464
464
|
* @returns Promise with transaction receipt response
|
|
465
465
|
*/
|
|
466
466
|
getReceiptByHash: (hash) => {
|
|
467
|
-
return get(`${API_PREFIX$
|
|
467
|
+
return get(`${API_PREFIX$1}/receipt/by_hash?hash=${hash}`, { withCredentials: false });
|
|
468
468
|
},
|
|
469
469
|
/**
|
|
470
470
|
* Estimate transaction fee
|
|
@@ -474,7 +474,7 @@ const transactionsApi = {
|
|
|
474
474
|
* @returns Promise with fee estimate response
|
|
475
475
|
*/
|
|
476
476
|
estimateFee: (from, value, token) => {
|
|
477
|
-
let url = `${API_PREFIX$
|
|
477
|
+
let url = `${API_PREFIX$1}/estimate_fee?from=${from}&value=${value}`;
|
|
478
478
|
if (token) {
|
|
479
479
|
url += `&token=${token}`;
|
|
480
480
|
}
|
|
@@ -486,9 +486,9 @@ const transactionsApi = {
|
|
|
486
486
|
* @returns Promise with transaction hash response
|
|
487
487
|
*/
|
|
488
488
|
payment: (payload) => {
|
|
489
|
-
return post(`${API_PREFIX$
|
|
489
|
+
return post(`${API_PREFIX$1}/payment`, payload, { withCredentials: false });
|
|
490
490
|
}
|
|
491
|
-
};const API_PREFIX
|
|
491
|
+
};const API_PREFIX = `/${API_VERSION}/chains`;
|
|
492
492
|
/**
|
|
493
493
|
* Checkpoint API methods
|
|
494
494
|
*/
|
|
@@ -498,20 +498,8 @@ const chainApi = {
|
|
|
498
498
|
* @returns Promise with chain id response
|
|
499
499
|
*/
|
|
500
500
|
getChainId: () => {
|
|
501
|
-
return get(`${API_PREFIX
|
|
501
|
+
return get(`${API_PREFIX}/chain_id`, { withCredentials: false });
|
|
502
502
|
},
|
|
503
|
-
};const API_PREFIX = `/${API_VERSION}/states`;
|
|
504
|
-
/**
|
|
505
|
-
* State API methods
|
|
506
|
-
*/
|
|
507
|
-
const stateApi = {
|
|
508
|
-
/**
|
|
509
|
-
* Get latest epoch checkpoint
|
|
510
|
-
* @returns Promise with latest epoch checkpoint response
|
|
511
|
-
*/
|
|
512
|
-
getLatestEpochCheckpoint: () => {
|
|
513
|
-
return get(`${API_PREFIX}/latest_epoch_checkpoint`, { withCredentials: false });
|
|
514
|
-
}
|
|
515
503
|
};// Authority types
|
|
516
504
|
var AuthorityType;
|
|
517
505
|
(function (AuthorityType) {
|
|
@@ -585,9 +573,5 @@ function api(options) {
|
|
|
585
573
|
* Chain API methods
|
|
586
574
|
*/
|
|
587
575
|
chain: chainApi,
|
|
588
|
-
/**
|
|
589
|
-
* State API methods
|
|
590
|
-
*/
|
|
591
|
-
state: stateApi,
|
|
592
576
|
};
|
|
593
577
|
}export{AuthorityAction,AuthorityType,ManageListAction,PauseAction,api,api as default};
|
package/es/api/tokens/types.d.ts
CHANGED
|
@@ -55,7 +55,6 @@ export declare enum PauseAction {
|
|
|
55
55
|
export interface RestSignature extends Signature {
|
|
56
56
|
}
|
|
57
57
|
export interface TokenManageListPayload {
|
|
58
|
-
recent_epoch: number;
|
|
59
58
|
recent_checkpoint: number;
|
|
60
59
|
chain_id: number;
|
|
61
60
|
nonce: number;
|
|
@@ -65,7 +64,6 @@ export interface TokenManageListPayload {
|
|
|
65
64
|
signature: RestSignature;
|
|
66
65
|
}
|
|
67
66
|
export interface TokenBurnPayload {
|
|
68
|
-
recent_epoch: number;
|
|
69
67
|
recent_checkpoint: number;
|
|
70
68
|
chain_id: number;
|
|
71
69
|
nonce: number;
|
|
@@ -75,7 +73,6 @@ export interface TokenBurnPayload {
|
|
|
75
73
|
signature: RestSignature;
|
|
76
74
|
}
|
|
77
75
|
export interface TokenAuthorityPayload {
|
|
78
|
-
recent_epoch: number;
|
|
79
76
|
recent_checkpoint: number;
|
|
80
77
|
chain_id: number;
|
|
81
78
|
nonce: number;
|
|
@@ -87,7 +84,6 @@ export interface TokenAuthorityPayload {
|
|
|
87
84
|
signature: RestSignature;
|
|
88
85
|
}
|
|
89
86
|
export interface TokenIssuePayload {
|
|
90
|
-
recent_epoch: number;
|
|
91
87
|
recent_checkpoint: number;
|
|
92
88
|
chain_id: number;
|
|
93
89
|
nonce: number;
|
|
@@ -99,7 +95,6 @@ export interface TokenIssuePayload {
|
|
|
99
95
|
signature: RestSignature;
|
|
100
96
|
}
|
|
101
97
|
export interface TokenMintPayload {
|
|
102
|
-
recent_epoch: number;
|
|
103
98
|
recent_checkpoint: number;
|
|
104
99
|
chain_id: number;
|
|
105
100
|
nonce: number;
|
|
@@ -109,7 +104,6 @@ export interface TokenMintPayload {
|
|
|
109
104
|
signature: RestSignature;
|
|
110
105
|
}
|
|
111
106
|
export interface TokenPausePayload {
|
|
112
|
-
recent_epoch: number;
|
|
113
107
|
recent_checkpoint: number;
|
|
114
108
|
chain_id: number;
|
|
115
109
|
nonce: number;
|
|
@@ -118,7 +112,6 @@ export interface TokenPausePayload {
|
|
|
118
112
|
signature: RestSignature;
|
|
119
113
|
}
|
|
120
114
|
export interface TokenMetadataPayload {
|
|
121
|
-
recent_epoch: number;
|
|
122
115
|
recent_checkpoint: number;
|
|
123
116
|
chain_id: number;
|
|
124
117
|
nonce: number;
|
package/es/index.js
CHANGED
|
@@ -1210,7 +1210,7 @@ const TESTNET_API_URL = 'https://api.testnet.1money.network';
|
|
|
1210
1210
|
const MAINNET_API_URL = 'https://api.1money.network';
|
|
1211
1211
|
const LOCAL_API_URL = 'http://localhost:18555';
|
|
1212
1212
|
// API version
|
|
1213
|
-
const API_VERSION = 'v1';const API_PREFIX$
|
|
1213
|
+
const API_VERSION = 'v1';const API_PREFIX$4 = `/${API_VERSION}/accounts`;
|
|
1214
1214
|
/**
|
|
1215
1215
|
* Accounts API methods
|
|
1216
1216
|
*/
|
|
@@ -1221,7 +1221,7 @@ const accountsApi = {
|
|
|
1221
1221
|
* @returns Promise with account info response
|
|
1222
1222
|
*/
|
|
1223
1223
|
getNonce: (address) => {
|
|
1224
|
-
return get(`${API_PREFIX$
|
|
1224
|
+
return get(`${API_PREFIX$4}/nonce?address=${address}`, { withCredentials: false });
|
|
1225
1225
|
},
|
|
1226
1226
|
/**
|
|
1227
1227
|
* Get associated token account
|
|
@@ -1230,9 +1230,9 @@ const accountsApi = {
|
|
|
1230
1230
|
* @returns Promise with associated token account response
|
|
1231
1231
|
*/
|
|
1232
1232
|
getTokenAccount: (address, token) => {
|
|
1233
|
-
return get(`${API_PREFIX$
|
|
1233
|
+
return get(`${API_PREFIX$4}/token_account?address=${address}&token=${token}`, { withCredentials: false });
|
|
1234
1234
|
}
|
|
1235
|
-
};const API_PREFIX$
|
|
1235
|
+
};const API_PREFIX$3 = `/${API_VERSION}/checkpoints`;
|
|
1236
1236
|
/**
|
|
1237
1237
|
* Checkpoint API methods
|
|
1238
1238
|
*/
|
|
@@ -1242,7 +1242,7 @@ const checkpointsApi = {
|
|
|
1242
1242
|
* @returns Promise with checkpoint number response
|
|
1243
1243
|
*/
|
|
1244
1244
|
getNumber: () => {
|
|
1245
|
-
return get(`${API_PREFIX$
|
|
1245
|
+
return get(`${API_PREFIX$3}/number`, { withCredentials: false });
|
|
1246
1246
|
},
|
|
1247
1247
|
/**
|
|
1248
1248
|
* Get checkpoint by hash
|
|
@@ -1251,7 +1251,7 @@ const checkpointsApi = {
|
|
|
1251
1251
|
* @returns Promise with checkpoint response
|
|
1252
1252
|
*/
|
|
1253
1253
|
getByHash: (hash, full = false) => {
|
|
1254
|
-
return get(`${API_PREFIX$
|
|
1254
|
+
return get(`${API_PREFIX$3}/by_hash?hash=${hash}&full=${full}`, { withCredentials: false });
|
|
1255
1255
|
},
|
|
1256
1256
|
/**
|
|
1257
1257
|
* Get checkpoint by number
|
|
@@ -1260,9 +1260,9 @@ const checkpointsApi = {
|
|
|
1260
1260
|
* @returns Promise with checkpoint response
|
|
1261
1261
|
*/
|
|
1262
1262
|
getByNumber: (number, full = false) => {
|
|
1263
|
-
return get(`${API_PREFIX$
|
|
1263
|
+
return get(`${API_PREFIX$3}/by_number?number=${number}&full=${full}`, { withCredentials: false });
|
|
1264
1264
|
}
|
|
1265
|
-
};const API_PREFIX$
|
|
1265
|
+
};const API_PREFIX$2 = `/${API_VERSION}/tokens`;
|
|
1266
1266
|
/**
|
|
1267
1267
|
* Tokens API methods
|
|
1268
1268
|
*/
|
|
@@ -1273,7 +1273,7 @@ const tokensApi = {
|
|
|
1273
1273
|
* @returns Promise with token metadata response
|
|
1274
1274
|
*/
|
|
1275
1275
|
getTokenMetadata: (token) => {
|
|
1276
|
-
return get(`${API_PREFIX$
|
|
1276
|
+
return get(`${API_PREFIX$2}/token_metadata?token=${token}`, { withCredentials: false });
|
|
1277
1277
|
},
|
|
1278
1278
|
/**
|
|
1279
1279
|
* Manage token blacklist
|
|
@@ -1281,7 +1281,7 @@ const tokensApi = {
|
|
|
1281
1281
|
* @returns Promise with transaction hash response
|
|
1282
1282
|
*/
|
|
1283
1283
|
manageBlacklist: (payload) => {
|
|
1284
|
-
return post(`${API_PREFIX$
|
|
1284
|
+
return post(`${API_PREFIX$2}/manage_blacklist`, payload, { withCredentials: false });
|
|
1285
1285
|
},
|
|
1286
1286
|
/**
|
|
1287
1287
|
* Manage token whitelist
|
|
@@ -1289,7 +1289,7 @@ const tokensApi = {
|
|
|
1289
1289
|
* @returns Promise with transaction hash response
|
|
1290
1290
|
*/
|
|
1291
1291
|
manageWhitelist: (payload) => {
|
|
1292
|
-
return post(`${API_PREFIX$
|
|
1292
|
+
return post(`${API_PREFIX$2}/manage_whitelist`, payload, { withCredentials: false });
|
|
1293
1293
|
},
|
|
1294
1294
|
/**
|
|
1295
1295
|
* Burn tokens
|
|
@@ -1297,7 +1297,7 @@ const tokensApi = {
|
|
|
1297
1297
|
* @returns Promise with transaction hash response
|
|
1298
1298
|
*/
|
|
1299
1299
|
burnToken: (payload) => {
|
|
1300
|
-
return post(`${API_PREFIX$
|
|
1300
|
+
return post(`${API_PREFIX$2}/burn`, payload, { withCredentials: false });
|
|
1301
1301
|
},
|
|
1302
1302
|
/**
|
|
1303
1303
|
* Grant or revoke token authority
|
|
@@ -1305,7 +1305,7 @@ const tokensApi = {
|
|
|
1305
1305
|
* @returns Promise with transaction hash response
|
|
1306
1306
|
*/
|
|
1307
1307
|
grantAuthority: (payload) => {
|
|
1308
|
-
return post(`${API_PREFIX$
|
|
1308
|
+
return post(`${API_PREFIX$2}/grant_authority`, payload, { withCredentials: false });
|
|
1309
1309
|
},
|
|
1310
1310
|
/**
|
|
1311
1311
|
* Issue new token
|
|
@@ -1313,7 +1313,7 @@ const tokensApi = {
|
|
|
1313
1313
|
* @returns Promise with transaction hash and token address response
|
|
1314
1314
|
*/
|
|
1315
1315
|
issueToken: (payload) => {
|
|
1316
|
-
return post(`${API_PREFIX$
|
|
1316
|
+
return post(`${API_PREFIX$2}/issue`, payload, { withCredentials: false });
|
|
1317
1317
|
},
|
|
1318
1318
|
/**
|
|
1319
1319
|
* Mint tokens
|
|
@@ -1321,7 +1321,7 @@ const tokensApi = {
|
|
|
1321
1321
|
* @returns Promise with transaction hash response
|
|
1322
1322
|
*/
|
|
1323
1323
|
mintToken: (payload) => {
|
|
1324
|
-
return post(`${API_PREFIX$
|
|
1324
|
+
return post(`${API_PREFIX$2}/mint`, payload, { withCredentials: false });
|
|
1325
1325
|
},
|
|
1326
1326
|
/**
|
|
1327
1327
|
* Pause or unpause token
|
|
@@ -1329,7 +1329,7 @@ const tokensApi = {
|
|
|
1329
1329
|
* @returns Promise with transaction hash response
|
|
1330
1330
|
*/
|
|
1331
1331
|
pauseToken: (payload) => {
|
|
1332
|
-
return post(`${API_PREFIX$
|
|
1332
|
+
return post(`${API_PREFIX$2}/pause`, payload, { withCredentials: false });
|
|
1333
1333
|
},
|
|
1334
1334
|
/**
|
|
1335
1335
|
* Update token metadata
|
|
@@ -1337,9 +1337,9 @@ const tokensApi = {
|
|
|
1337
1337
|
* @returns Promise with transaction hash response
|
|
1338
1338
|
*/
|
|
1339
1339
|
updateMetadata: (payload) => {
|
|
1340
|
-
return post(`${API_PREFIX$
|
|
1340
|
+
return post(`${API_PREFIX$2}/update_metadata`, payload, { withCredentials: false });
|
|
1341
1341
|
}
|
|
1342
|
-
};const API_PREFIX$
|
|
1342
|
+
};const API_PREFIX$1 = `/${API_VERSION}/transactions`;
|
|
1343
1343
|
/**
|
|
1344
1344
|
* Transactions API methods
|
|
1345
1345
|
*/
|
|
@@ -1350,7 +1350,7 @@ const transactionsApi = {
|
|
|
1350
1350
|
* @returns Promise with transaction response
|
|
1351
1351
|
*/
|
|
1352
1352
|
getByHash: (hash) => {
|
|
1353
|
-
return get(`${API_PREFIX$
|
|
1353
|
+
return get(`${API_PREFIX$1}/by_hash?hash=${hash}`, { withCredentials: false });
|
|
1354
1354
|
},
|
|
1355
1355
|
/**
|
|
1356
1356
|
* Get transaction receipt by hash
|
|
@@ -1358,7 +1358,7 @@ const transactionsApi = {
|
|
|
1358
1358
|
* @returns Promise with transaction receipt response
|
|
1359
1359
|
*/
|
|
1360
1360
|
getReceiptByHash: (hash) => {
|
|
1361
|
-
return get(`${API_PREFIX$
|
|
1361
|
+
return get(`${API_PREFIX$1}/receipt/by_hash?hash=${hash}`, { withCredentials: false });
|
|
1362
1362
|
},
|
|
1363
1363
|
/**
|
|
1364
1364
|
* Estimate transaction fee
|
|
@@ -1368,7 +1368,7 @@ const transactionsApi = {
|
|
|
1368
1368
|
* @returns Promise with fee estimate response
|
|
1369
1369
|
*/
|
|
1370
1370
|
estimateFee: (from, value, token) => {
|
|
1371
|
-
let url = `${API_PREFIX$
|
|
1371
|
+
let url = `${API_PREFIX$1}/estimate_fee?from=${from}&value=${value}`;
|
|
1372
1372
|
if (token) {
|
|
1373
1373
|
url += `&token=${token}`;
|
|
1374
1374
|
}
|
|
@@ -1380,9 +1380,9 @@ const transactionsApi = {
|
|
|
1380
1380
|
* @returns Promise with transaction hash response
|
|
1381
1381
|
*/
|
|
1382
1382
|
payment: (payload) => {
|
|
1383
|
-
return post(`${API_PREFIX$
|
|
1383
|
+
return post(`${API_PREFIX$1}/payment`, payload, { withCredentials: false });
|
|
1384
1384
|
}
|
|
1385
|
-
};const API_PREFIX
|
|
1385
|
+
};const API_PREFIX = `/${API_VERSION}/chains`;
|
|
1386
1386
|
/**
|
|
1387
1387
|
* Checkpoint API methods
|
|
1388
1388
|
*/
|
|
@@ -1392,20 +1392,8 @@ const chainApi = {
|
|
|
1392
1392
|
* @returns Promise with chain id response
|
|
1393
1393
|
*/
|
|
1394
1394
|
getChainId: () => {
|
|
1395
|
-
return get(`${API_PREFIX
|
|
1395
|
+
return get(`${API_PREFIX}/chain_id`, { withCredentials: false });
|
|
1396
1396
|
},
|
|
1397
|
-
};const API_PREFIX = `/${API_VERSION}/states`;
|
|
1398
|
-
/**
|
|
1399
|
-
* State API methods
|
|
1400
|
-
*/
|
|
1401
|
-
const stateApi = {
|
|
1402
|
-
/**
|
|
1403
|
-
* Get latest epoch checkpoint
|
|
1404
|
-
* @returns Promise with latest epoch checkpoint response
|
|
1405
|
-
*/
|
|
1406
|
-
getLatestEpochCheckpoint: () => {
|
|
1407
|
-
return get(`${API_PREFIX}/latest_epoch_checkpoint`, { withCredentials: false });
|
|
1408
|
-
}
|
|
1409
1397
|
};// Authority types
|
|
1410
1398
|
var AuthorityType;
|
|
1411
1399
|
(function (AuthorityType) {
|
|
@@ -1479,10 +1467,6 @@ function api(options) {
|
|
|
1479
1467
|
* Chain API methods
|
|
1480
1468
|
*/
|
|
1481
1469
|
chain: chainApi,
|
|
1482
|
-
/**
|
|
1483
|
-
* State API methods
|
|
1484
|
-
*/
|
|
1485
|
-
state: stateApi,
|
|
1486
1470
|
};
|
|
1487
1471
|
}var index = {
|
|
1488
1472
|
api,
|
package/lib/api/index.d.ts
CHANGED
|
@@ -3,13 +3,11 @@ import checkpointsApi from './checkpoints';
|
|
|
3
3
|
import tokensApi from './tokens';
|
|
4
4
|
import transactionsApi from './transactions';
|
|
5
5
|
import chainApi from './chain';
|
|
6
|
-
import stateApi from './state';
|
|
7
6
|
export * from './accounts/types';
|
|
8
7
|
export * from './tokens/types';
|
|
9
8
|
export * from './transactions/types';
|
|
10
9
|
export * from './checkpoints/types';
|
|
11
10
|
export * from './chain/types';
|
|
12
|
-
export * from './state/types';
|
|
13
11
|
/**
|
|
14
12
|
* API client for 1money network
|
|
15
13
|
* @param options Configuration options
|
|
@@ -26,6 +24,5 @@ export declare function api(options?: {
|
|
|
26
24
|
tokens: typeof tokensApi;
|
|
27
25
|
transactions: typeof transactionsApi;
|
|
28
26
|
chain: typeof chainApi;
|
|
29
|
-
state: typeof stateApi;
|
|
30
27
|
};
|
|
31
28
|
export default api;
|