@locuschain/lib 0.1.33 → 0.1.37
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/dist/index.umd.d.mts +15 -0
- package/dist/umd/index.umd.js +26296 -0
- package/dist/utils/index.cjs.cjs +34 -5
- package/dist/utils/index.esm.js +34 -5
- package/dist/utils/tx-validator.d.mts +2 -0
- package/package.json +4 -4
- package/dist/accounts/index.amd.js +0 -306
- package/dist/autogen/index.amd.js +0 -151
- package/dist/chunks/account-BSrvZ7S8.js +0 -77
- package/dist/chunks/address-class-Dp7aNQb2.js +0 -18
- package/dist/chunks/base-B_kRRfsf.js +0 -27
- package/dist/chunks/debugWalletActions-BDz-h2tl.js +0 -993
- package/dist/chunks/keystore-BexHKV9z.js +0 -143
- package/dist/chunks/lclib-BfTIyj-E.js +0 -3838
- package/dist/chunks/rpc-C4n7t9y0.js +0 -25
- package/dist/chunks/transport-BBAz1kmP.js +0 -30
- package/dist/chunks/tslib.es6-D29rxPkW.js +0 -37
- package/dist/chunks/tx-type-CS4wIUJ8.js +0 -68
- package/dist/chunks/wasm-3Ghi_Hxd.js +0 -213
- package/dist/clients/index.amd.js +0 -97
- package/dist/constant/index.amd.js +0 -458
- package/dist/contracts/index.amd.js +0 -19640
- package/dist/errors/index.amd.js +0 -17
- package/dist/index.amd.js +0 -43
- package/dist/transports/index.amd.js +0 -98
- package/dist/utils/index.amd.js +0 -323
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
define(['exports', './base-B_kRRfsf'], (function (exports, base) { 'use strict';
|
|
2
|
-
|
|
3
|
-
/** 요청을 전송하기 전에 로컬에서 검증을 통과하지 못한 경우. */
|
|
4
|
-
class RpcRequestError extends base.BaseError {
|
|
5
|
-
constructor(shortMessage, options = {}) {
|
|
6
|
-
super(shortMessage, options);
|
|
7
|
-
this.name = 'RpcRequestError';
|
|
8
|
-
this.method = options.method;
|
|
9
|
-
this.params = options.params;
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
/** 노드가 JSON-RPC error envelope 를 반환한 경우. */
|
|
13
|
-
class RpcResponseError extends base.BaseError {
|
|
14
|
-
constructor(shortMessage, options) {
|
|
15
|
-
super(shortMessage, options);
|
|
16
|
-
this.name = 'RpcResponseError';
|
|
17
|
-
this.code = options.code;
|
|
18
|
-
this.method = options.method;
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
exports.RpcRequestError = RpcRequestError;
|
|
23
|
-
exports.RpcResponseError = RpcResponseError;
|
|
24
|
-
|
|
25
|
-
}));
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
define(['exports', './base-B_kRRfsf'], (function (exports, base) { 'use strict';
|
|
2
|
-
|
|
3
|
-
class HttpRequestError extends base.BaseError {
|
|
4
|
-
constructor(shortMessage, options = {}) {
|
|
5
|
-
super(shortMessage, options);
|
|
6
|
-
this.name = 'HttpRequestError';
|
|
7
|
-
this.url = options.url;
|
|
8
|
-
this.status = options.status;
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
class TimeoutError extends base.BaseError {
|
|
12
|
-
constructor(shortMessage, options = {}) {
|
|
13
|
-
super(shortMessage, options);
|
|
14
|
-
this.name = 'TimeoutError';
|
|
15
|
-
this.url = options.url;
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
class AbortedError extends base.BaseError {
|
|
19
|
-
constructor(shortMessage, options = {}) {
|
|
20
|
-
super(shortMessage, options);
|
|
21
|
-
this.name = 'AbortedError';
|
|
22
|
-
this.url = options.url;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
exports.AbortedError = AbortedError;
|
|
27
|
-
exports.HttpRequestError = HttpRequestError;
|
|
28
|
-
exports.TimeoutError = TimeoutError;
|
|
29
|
-
|
|
30
|
-
}));
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
define(['exports'], (function (exports) { 'use strict';
|
|
2
|
-
|
|
3
|
-
/******************************************************************************
|
|
4
|
-
Copyright (c) Microsoft Corporation.
|
|
5
|
-
|
|
6
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
7
|
-
purpose with or without fee is hereby granted.
|
|
8
|
-
|
|
9
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
10
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
11
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
12
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
13
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
14
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
15
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
16
|
-
***************************************************************************** */
|
|
17
|
-
/* global Reflect, Promise, SuppressedError, Symbol, Iterator */
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
function __awaiter(thisArg, _arguments, P, generator) {
|
|
21
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
22
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
23
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
24
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
25
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
26
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
31
|
-
var e = new Error(message);
|
|
32
|
-
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
exports.__awaiter = __awaiter;
|
|
36
|
-
|
|
37
|
-
}));
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
define(['exports'], (function (exports) { 'use strict';
|
|
2
|
-
|
|
3
|
-
// Automatically generated file. DO NOT EDIT.
|
|
4
|
-
const TxType = Object.freeze({
|
|
5
|
-
GENESIS_ACCOUNT: 'TX_GENESIS_ACCOUNT',
|
|
6
|
-
OPEN_ACCOUNT: 'TX_OPEN_ACCOUNT',
|
|
7
|
-
BECOME_HOST: 'TX_BECOME_HOST',
|
|
8
|
-
BECOME_GUEST: 'TX_BECOME_GUEST',
|
|
9
|
-
TRANSFER_COIN: 'TX_TRANSFER_COIN',
|
|
10
|
-
TRANSFER_COIN_FEE: 'TX_TRANSFER_COIN_FEE',
|
|
11
|
-
TRANSFER_COIN_EXPRESS: 'TX_TRANSFER_COIN_EXPRESS',
|
|
12
|
-
ACTIVATE_COIN: 'TX_ACTIVATE_COIN',
|
|
13
|
-
ACTIVATE_INCENTIVE: 'TX_ACTIVATE_INCENTIVE',
|
|
14
|
-
ACTIVATE_FOUNDATION_RESERVE: 'TX_ACTIVATE_FOUNDATION_RESERVE',
|
|
15
|
-
CHANGE_KEYPAIR: 'TX_CHANGE_KEYPAIR',
|
|
16
|
-
CHANGE_VKEY: 'TX_CHANGE_VKEY',
|
|
17
|
-
CHANGE_FOUNDATION_ACCOUNT: 'TX_CHANGE_FOUNDATION_ACCOUNT',
|
|
18
|
-
POST_DATA: 'TX_POST_DATA',
|
|
19
|
-
POST_DATA_FEE: 'TX_POST_DATA_FEE',
|
|
20
|
-
CREATE_TOKEN: 'TX_CREATE_TOKEN',
|
|
21
|
-
CREATE_TOKEN_FEE: 'TX_CREATE_TOKEN_FEE',
|
|
22
|
-
BURN_TOKEN: 'TX_BURN_TOKEN',
|
|
23
|
-
TRANSFER_TOKEN: 'TX_TRANSFER_TOKEN',
|
|
24
|
-
TRANSFER_TOKEN_FEE: 'TX_TRANSFER_TOKEN_FEE',
|
|
25
|
-
ACTIVATE_TOKEN: 'TX_ACTIVATE_TOKEN',
|
|
26
|
-
CREATE_ASSETOBJECT: 'TX_CREATE_ASSETOBJECT',
|
|
27
|
-
CREATE_ASSETOBJECT_FEE: 'TX_CREATE_ASSETOBJECT_FEE',
|
|
28
|
-
TRANSFER_ASSETOBJECT: 'TX_TRANSFER_ASSETOBJECT',
|
|
29
|
-
TRANSFER_ASSETOBJECT_FEE: 'TX_TRANSFER_ASSETOBJECT_FEE',
|
|
30
|
-
ACTIVATE_ASSETOBJECT: 'TX_ACTIVATE_ASSETOBJECT',
|
|
31
|
-
BURN_ASSETOBJECT: 'TX_BURN_ASSETOBJECT',
|
|
32
|
-
REVOKE: 'TX_REVOKE',
|
|
33
|
-
CLOSE_ACCOUNT: 'TX_CLOSE_ACCOUNT',
|
|
34
|
-
ACTIVATE_ALL_ASSETS: 'TX_ACTIVATE_ALL_ASSETS',
|
|
35
|
-
PROVIDE_SCRIPT: 'TX_PROVIDE_SCRIPT',
|
|
36
|
-
ACCEPT_SCRIPT: 'TX_ACCEPT_SCRIPT',
|
|
37
|
-
ACCEPT_SCRIPT_AFTER_TIMELOCK: 'TX_ACCEPT_SCRIPT_AFTER_TIMELOCK',
|
|
38
|
-
CREATE_SA: 'TX_CREATE_SA',
|
|
39
|
-
CREATE_SA_FEE: 'TX_CREATE_SA_FEE',
|
|
40
|
-
ACTIVATE_OPEN_SA: 'TX_ACTIVATE_OPEN_SA',
|
|
41
|
-
POST_DATA_SA: 'TX_POST_DATA_SA',
|
|
42
|
-
POST_DATA_SA_FEE: 'TX_POST_DATA_SA_FEE',
|
|
43
|
-
ACTIVATE_DATA_SA: 'TX_ACTIVATE_DATA_SA',
|
|
44
|
-
LOCK_STAKE_FOR_VME: 'TX_LOCK_STAKE_FOR_VME',
|
|
45
|
-
ACTIVATE_LOCK_STAKE_FOR_VME: 'TX_ACTIVATE_LOCK_STAKE_FOR_VME',
|
|
46
|
-
UNLOCK_STAKE: 'TX_UNLOCK_STAKE',
|
|
47
|
-
CREATE_VME: 'TX_CREATE_VME',
|
|
48
|
-
ACTIVATE_OPEN_VME: 'TX_ACTIVATE_OPEN_VME',
|
|
49
|
-
VME_BLOCK: 'TX_VME_BLOCK',
|
|
50
|
-
CREATE_CONTRACT: 'TX_CREATE_CONTRACT',
|
|
51
|
-
CREATE_CONTRACT_FEE: 'TX_CREATE_CONTRACT_FEE',
|
|
52
|
-
CALL_CONTRACT: 'TX_CALL_CONTRACT',
|
|
53
|
-
CALL_CONTRACT_FEE: 'TX_CALL_CONTRACT_FEE',
|
|
54
|
-
ACTIVATE_OPEN_CONTRACT: 'TX_ACTIVATE_OPEN_CONTRACT',
|
|
55
|
-
ACTIVATE_CALL_CONTRACT: 'TX_ACTIVATE_CALL_CONTRACT',
|
|
56
|
-
ACTIVATE_CONTRACT_TRANSFER: 'TX_ACTIVATE_CONTRACT_TRANSFER',
|
|
57
|
-
ACTIVATE_CONTRACT_RESULT: 'TX_ACTIVATE_CONTRACT_RESULT',
|
|
58
|
-
CONTRACT_TRANSFER_REWARD: 'TX_CONTRACT_TRANSFER_REWARD',
|
|
59
|
-
CONTRACT_BLANK_REWARD: 'TX_CONTRACT_BLANK_REWARD',
|
|
60
|
-
ACTIVATE_CONTRACT_REWARD: 'TX_ACTIVATE_CONTRACT_REWARD',
|
|
61
|
-
FREEZE_ACCOUNT: 'TX_FREEZE_ACCOUNT',
|
|
62
|
-
LEAD_VTX: 'TX_LEAD_VTX',
|
|
63
|
-
FINALIZE: 'TX_FINALIZE',
|
|
64
|
-
});
|
|
65
|
-
|
|
66
|
-
exports.TxType = TxType;
|
|
67
|
-
|
|
68
|
-
}));
|
|
@@ -1,213 +0,0 @@
|
|
|
1
|
-
define(['exports', './lclib-BfTIyj-E'], (function (exports, lclib) { 'use strict';
|
|
2
|
-
|
|
3
|
-
// Automatically generated file. DO NOT EDIT.
|
|
4
|
-
const callWasm = (cmd, params) => {
|
|
5
|
-
// @ts-ignore
|
|
6
|
-
let callLclib = globalThis["CallLclib"];
|
|
7
|
-
// @ts-ignore
|
|
8
|
-
if (lclib.namespace && globalThis[lclib.namespace]) {
|
|
9
|
-
// @ts-ignore
|
|
10
|
-
callLclib = globalThis[lclib.namespace]["CallLclib"];
|
|
11
|
-
}
|
|
12
|
-
// @ts-ignore
|
|
13
|
-
if (typeof callLclib !== "function")
|
|
14
|
-
throw new Error("Wasm module is not loaded. Please call loadWasm or loadWasmSync first.");
|
|
15
|
-
// @ts-ignore
|
|
16
|
-
const resultString = callLclib(cmd, JSON.stringify(params));
|
|
17
|
-
const result = JSON.parse(resultString);
|
|
18
|
-
if (result.error && result.error.code != 0) {
|
|
19
|
-
const error = Object.assign(Object.assign({}, result.error), { message: result.error.message });
|
|
20
|
-
delete error.message;
|
|
21
|
-
throw error;
|
|
22
|
-
}
|
|
23
|
-
else {
|
|
24
|
-
return result.result;
|
|
25
|
-
}
|
|
26
|
-
};
|
|
27
|
-
const calculateTxLinkHash = (params) => {
|
|
28
|
-
return callWasm('calculateTxLinkHash', [params]);
|
|
29
|
-
};
|
|
30
|
-
const compileCoreScript = (params) => {
|
|
31
|
-
return callWasm('compileCoreScript', [params]);
|
|
32
|
-
};
|
|
33
|
-
const convertAddressToData = (addrEncoded) => {
|
|
34
|
-
return callWasm('convertAddressToData', [addrEncoded]);
|
|
35
|
-
};
|
|
36
|
-
const convertAddressToHex = (addrEncoded) => {
|
|
37
|
-
return callWasm('convertAddressToHex', [addrEncoded]);
|
|
38
|
-
};
|
|
39
|
-
const convertBase32ToData = (encoded) => {
|
|
40
|
-
return callWasm('convertBase32ToData', [encoded]);
|
|
41
|
-
};
|
|
42
|
-
const convertBase32ToHex = (encoded) => {
|
|
43
|
-
return callWasm('convertBase32ToHex', [encoded]);
|
|
44
|
-
};
|
|
45
|
-
const convertCurrency = (params) => {
|
|
46
|
-
return callWasm('convertCurrency', [params]);
|
|
47
|
-
};
|
|
48
|
-
const convertDataTo = (value, retType) => {
|
|
49
|
-
return callWasm('convertDataTo', [value, retType]);
|
|
50
|
-
};
|
|
51
|
-
const convertDataToAddress = (str) => {
|
|
52
|
-
return callWasm('convertDataToAddress', [str]);
|
|
53
|
-
};
|
|
54
|
-
const convertDataToBase32 = (str) => {
|
|
55
|
-
return callWasm('convertDataToBase32', [str]);
|
|
56
|
-
};
|
|
57
|
-
const convertDataToHex = (str) => {
|
|
58
|
-
return callWasm('convertDataToHex', [str]);
|
|
59
|
-
};
|
|
60
|
-
const convertDataToString = (str) => {
|
|
61
|
-
return callWasm('convertDataToString', [str]);
|
|
62
|
-
};
|
|
63
|
-
const convertHexToAddress = (hexString) => {
|
|
64
|
-
return callWasm('convertHexToAddress', [hexString]);
|
|
65
|
-
};
|
|
66
|
-
const convertHexToBase32 = (hexString) => {
|
|
67
|
-
return callWasm('convertHexToBase32', [hexString]);
|
|
68
|
-
};
|
|
69
|
-
const convertHexToData = (encoded) => {
|
|
70
|
-
return callWasm('convertHexToData', [encoded]);
|
|
71
|
-
};
|
|
72
|
-
const convertStringToData = (raw) => {
|
|
73
|
-
return callWasm('convertStringToData', [raw]);
|
|
74
|
-
};
|
|
75
|
-
const convertToData = (value, valueType) => {
|
|
76
|
-
return callWasm('convertToData', [value, valueType]);
|
|
77
|
-
};
|
|
78
|
-
const createAccountAndKeystore = (params) => {
|
|
79
|
-
return callWasm('createAccountAndKeystore', [params]);
|
|
80
|
-
};
|
|
81
|
-
const createMasterKeystore = (params) => {
|
|
82
|
-
return callWasm('createMasterKeystore', [params]);
|
|
83
|
-
};
|
|
84
|
-
const createNormalKey = (params) => {
|
|
85
|
-
return callWasm('createNormalKey', [params]);
|
|
86
|
-
};
|
|
87
|
-
const createNormalKeystore = (params) => {
|
|
88
|
-
return callWasm('createNormalKeystore', [params]);
|
|
89
|
-
};
|
|
90
|
-
const decodeTxs = (params) => {
|
|
91
|
-
return callWasm('decodeTxs', [params]);
|
|
92
|
-
};
|
|
93
|
-
const deriveKeysFromMnemonic = (params) => {
|
|
94
|
-
return callWasm('deriveKeysFromMnemonic', [params]);
|
|
95
|
-
};
|
|
96
|
-
const deriveKeysFromMnemonicAndPath = (params) => {
|
|
97
|
-
return callWasm('deriveKeysFromMnemonicAndPath', [params]);
|
|
98
|
-
};
|
|
99
|
-
const disCompileCoreScript = (params) => {
|
|
100
|
-
return callWasm('disCompileCoreScript', [params]);
|
|
101
|
-
};
|
|
102
|
-
const encodeTxCurrency = (params) => {
|
|
103
|
-
return callWasm('encodeTxCurrency', [params]);
|
|
104
|
-
};
|
|
105
|
-
const encodeTxNumber = (params) => {
|
|
106
|
-
return callWasm('encodeTxNumber', [params]);
|
|
107
|
-
};
|
|
108
|
-
const generateMnemonic = (params) => {
|
|
109
|
-
return callWasm('generateMnemonic', [params]);
|
|
110
|
-
};
|
|
111
|
-
const generateMnemonicBySeed = (params) => {
|
|
112
|
-
return callWasm('generateMnemonicBySeed', [params]);
|
|
113
|
-
};
|
|
114
|
-
const getDefFromCoreScript = (params) => {
|
|
115
|
-
return callWasm('getDefFromCoreScript', [params]);
|
|
116
|
-
};
|
|
117
|
-
const getHomeShard = (params) => {
|
|
118
|
-
return callWasm('getHomeShard', [params]);
|
|
119
|
-
};
|
|
120
|
-
const getLibraryVersions = () => {
|
|
121
|
-
return callWasm('getLibraryVersions', []);
|
|
122
|
-
};
|
|
123
|
-
const gzipAndEncode = (str) => {
|
|
124
|
-
return callWasm('gzipAndEncode', [str]);
|
|
125
|
-
};
|
|
126
|
-
const hash = (params) => {
|
|
127
|
-
return callWasm('hash', [params]);
|
|
128
|
-
};
|
|
129
|
-
const isGrantConsumingTx = (txTypeStr) => {
|
|
130
|
-
return callWasm('isGrantConsumingTx', [txTypeStr]);
|
|
131
|
-
};
|
|
132
|
-
const loadMasterKeystore = (params) => {
|
|
133
|
-
return callWasm('loadMasterKeystore', [params]);
|
|
134
|
-
};
|
|
135
|
-
const loadNormalKeystore = (params) => {
|
|
136
|
-
return callWasm('loadNormalKeystore', [params]);
|
|
137
|
-
};
|
|
138
|
-
const makeCurrency = (params) => {
|
|
139
|
-
return callWasm('makeCurrency', [params]);
|
|
140
|
-
};
|
|
141
|
-
const sign = (param) => {
|
|
142
|
-
return callWasm('sign', [param]);
|
|
143
|
-
};
|
|
144
|
-
const signByMasterKey = (params) => {
|
|
145
|
-
return callWasm('signByMasterKey', [params]);
|
|
146
|
-
};
|
|
147
|
-
const signKeyBind = (params) => {
|
|
148
|
-
return callWasm('signKeyBind', [params]);
|
|
149
|
-
};
|
|
150
|
-
const testCoreScript = (params) => {
|
|
151
|
-
return callWasm('testCoreScript', [params]);
|
|
152
|
-
};
|
|
153
|
-
const verify = (params) => {
|
|
154
|
-
return callWasm('verify', [params]);
|
|
155
|
-
};
|
|
156
|
-
const verifyByMasterKey = (params) => {
|
|
157
|
-
return callWasm('verifyByMasterKey', [params]);
|
|
158
|
-
};
|
|
159
|
-
const verifyMerkleProof = (params) => {
|
|
160
|
-
return callWasm('verifyMerkleProof', [params]);
|
|
161
|
-
};
|
|
162
|
-
const verifyTx = (jsonTx) => {
|
|
163
|
-
return callWasm('verifyTx', [jsonTx]);
|
|
164
|
-
};
|
|
165
|
-
|
|
166
|
-
exports.calculateTxLinkHash = calculateTxLinkHash;
|
|
167
|
-
exports.compileCoreScript = compileCoreScript;
|
|
168
|
-
exports.convertAddressToData = convertAddressToData;
|
|
169
|
-
exports.convertAddressToHex = convertAddressToHex;
|
|
170
|
-
exports.convertBase32ToData = convertBase32ToData;
|
|
171
|
-
exports.convertBase32ToHex = convertBase32ToHex;
|
|
172
|
-
exports.convertCurrency = convertCurrency;
|
|
173
|
-
exports.convertDataTo = convertDataTo;
|
|
174
|
-
exports.convertDataToAddress = convertDataToAddress;
|
|
175
|
-
exports.convertDataToBase32 = convertDataToBase32;
|
|
176
|
-
exports.convertDataToHex = convertDataToHex;
|
|
177
|
-
exports.convertDataToString = convertDataToString;
|
|
178
|
-
exports.convertHexToAddress = convertHexToAddress;
|
|
179
|
-
exports.convertHexToBase32 = convertHexToBase32;
|
|
180
|
-
exports.convertHexToData = convertHexToData;
|
|
181
|
-
exports.convertStringToData = convertStringToData;
|
|
182
|
-
exports.convertToData = convertToData;
|
|
183
|
-
exports.createAccountAndKeystore = createAccountAndKeystore;
|
|
184
|
-
exports.createMasterKeystore = createMasterKeystore;
|
|
185
|
-
exports.createNormalKey = createNormalKey;
|
|
186
|
-
exports.createNormalKeystore = createNormalKeystore;
|
|
187
|
-
exports.decodeTxs = decodeTxs;
|
|
188
|
-
exports.deriveKeysFromMnemonic = deriveKeysFromMnemonic;
|
|
189
|
-
exports.deriveKeysFromMnemonicAndPath = deriveKeysFromMnemonicAndPath;
|
|
190
|
-
exports.disCompileCoreScript = disCompileCoreScript;
|
|
191
|
-
exports.encodeTxCurrency = encodeTxCurrency;
|
|
192
|
-
exports.encodeTxNumber = encodeTxNumber;
|
|
193
|
-
exports.generateMnemonic = generateMnemonic;
|
|
194
|
-
exports.generateMnemonicBySeed = generateMnemonicBySeed;
|
|
195
|
-
exports.getDefFromCoreScript = getDefFromCoreScript;
|
|
196
|
-
exports.getHomeShard = getHomeShard;
|
|
197
|
-
exports.getLibraryVersions = getLibraryVersions;
|
|
198
|
-
exports.gzipAndEncode = gzipAndEncode;
|
|
199
|
-
exports.hash = hash;
|
|
200
|
-
exports.isGrantConsumingTx = isGrantConsumingTx;
|
|
201
|
-
exports.loadMasterKeystore = loadMasterKeystore;
|
|
202
|
-
exports.loadNormalKeystore = loadNormalKeystore;
|
|
203
|
-
exports.makeCurrency = makeCurrency;
|
|
204
|
-
exports.sign = sign;
|
|
205
|
-
exports.signByMasterKey = signByMasterKey;
|
|
206
|
-
exports.signKeyBind = signKeyBind;
|
|
207
|
-
exports.testCoreScript = testCoreScript;
|
|
208
|
-
exports.verify = verify;
|
|
209
|
-
exports.verifyByMasterKey = verifyByMasterKey;
|
|
210
|
-
exports.verifyMerkleProof = verifyMerkleProof;
|
|
211
|
-
exports.verifyTx = verifyTx;
|
|
212
|
-
|
|
213
|
-
}));
|
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
define(['exports', '../chunks/lclib-BfTIyj-E', '../chunks/debugWalletActions-BDz-h2tl', '../chunks/tslib.es6-D29rxPkW', '../transports/index.amd', '../chunks/rpc-C4n7t9y0', '../chunks/base-B_kRRfsf', '../chunks/account-BSrvZ7S8', '../chunks/transport-BBAz1kmP'], (function (exports, lclib, debugWalletActions, tslib_es6, transports, rpc, base, account, transport) { 'use strict';
|
|
2
|
-
|
|
3
|
-
function createClient(args) {
|
|
4
|
-
var _a;
|
|
5
|
-
let counter = 0;
|
|
6
|
-
const idGen = () => {
|
|
7
|
-
if (counter === Number.MAX_SAFE_INTEGER)
|
|
8
|
-
counter = 0;
|
|
9
|
-
return ++counter;
|
|
10
|
-
};
|
|
11
|
-
const transport = args.transport({ id: idGen });
|
|
12
|
-
const account = ((_a = args.account) !== null && _a !== void 0 ? _a : undefined);
|
|
13
|
-
const request = (rpcArgs, opts) => transport.request(rpcArgs, opts);
|
|
14
|
-
const base = {
|
|
15
|
-
transport,
|
|
16
|
-
account,
|
|
17
|
-
request,
|
|
18
|
-
};
|
|
19
|
-
return attachExtend(base);
|
|
20
|
-
}
|
|
21
|
-
function attachExtend(base) {
|
|
22
|
-
const target = base;
|
|
23
|
-
target.extend = (fn) => {
|
|
24
|
-
const ext = fn(base);
|
|
25
|
-
const merged = Object.assign(Object.assign({}, base), ext);
|
|
26
|
-
return attachExtend(merged);
|
|
27
|
-
};
|
|
28
|
-
return target;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
function createPublicClient(args) {
|
|
32
|
-
return createClient({ transport: args.transport });
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
function createWalletClient(args) {
|
|
36
|
-
return createClient({
|
|
37
|
-
transport: args.transport,
|
|
38
|
-
account: args.account,
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* Locus 읽기 전용 클라이언트의 one-call 생성자.
|
|
44
|
-
*
|
|
45
|
-
* bare {@link createPublicClient} 를 HTTP 트랜스포트와 함께 감싸고, 두 표준
|
|
46
|
-
* read 액션 셋 (`publicActions` + `debugPublicActions`) 을 단일 `.extend()`
|
|
47
|
-
* 호출로 합쳐 부착한다. 반환된 클라이언트는 두 셋 모두 정적 타입이 잡힌
|
|
48
|
-
* 상태로 노출된다.
|
|
49
|
-
*
|
|
50
|
-
* 생성 이후엔 모든 read RPC (`locus_getNodeStatus`, `locus_getAccountDetail`,
|
|
51
|
-
* `calculateSpentByExpress`, `debug_viewContract`, ...) 가 타입이 잡힌
|
|
52
|
-
* 메서드로 호출 가능:
|
|
53
|
-
*
|
|
54
|
-
* ```ts
|
|
55
|
-
* const client = createLocusPublicClient({ rpcUrl });
|
|
56
|
-
* const status = await client.getNodeStatus();
|
|
57
|
-
* const balance = await client.getAccountDetail({ account });
|
|
58
|
-
* ```
|
|
59
|
-
*
|
|
60
|
-
* write TX 용 클라이언트는 {@link createLocusWalletClient} 참고.
|
|
61
|
-
*/
|
|
62
|
-
function createLocusPublicClient(args) {
|
|
63
|
-
return createPublicClient({
|
|
64
|
-
transport: transports.http(args.rpcUrl, args.transport),
|
|
65
|
-
}).extend((c) => (Object.assign(Object.assign({}, debugWalletActions.publicActions(c)), debugWalletActions.debugPublicActions(c))));
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
/**
|
|
69
|
-
* Locus write 클라이언트의 one-call 생성자.
|
|
70
|
-
*
|
|
71
|
-
* bare {@link createWalletClient} 를 HTTP 트랜스포트와 함께 감싸고, 두 표준
|
|
72
|
-
* write 액션 셋 (`walletActions` + `debugWalletActions`) 을 단일 `.extend()`
|
|
73
|
-
* 호출로 합쳐 부착한다. 반환된 클라이언트는 두 셋 모두 정적 타입이 잡힌
|
|
74
|
-
* 상태로 노출된다.
|
|
75
|
-
*
|
|
76
|
-
* 생성 이후엔 모든 write RPC (`transferCoin`, `openAccount`, `changeKey`,
|
|
77
|
-
* `closeAccount`, `callContract`, `debug_createContract`, ...) 가 타입이
|
|
78
|
-
* 잡힌 메서드로 호출 가능. 각 호출은 내부적으로 prepare → sign → submit
|
|
79
|
-
* 파이프라인을 한 번에 돌리며, master/normal 키 라우팅은 `txKeyPolicy` 와
|
|
80
|
-
* 바인드된 `account` 의 `KeySource` 슬롯이 결정한다.
|
|
81
|
-
*
|
|
82
|
-
* 읽기 전용 RPC 는 {@link createLocusPublicClient} 참고.
|
|
83
|
-
*/
|
|
84
|
-
function createLocusWalletClient(args) {
|
|
85
|
-
return createWalletClient({
|
|
86
|
-
transport: transports.http(args.rpcUrl, args.transport),
|
|
87
|
-
account: args.account,
|
|
88
|
-
}).extend((c) => (Object.assign(Object.assign({}, debugWalletActions.walletActions(c)), debugWalletActions.debugWalletActions(c))));
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
exports.createClient = createClient;
|
|
92
|
-
exports.createLocusPublicClient = createLocusPublicClient;
|
|
93
|
-
exports.createLocusWalletClient = createLocusWalletClient;
|
|
94
|
-
exports.createPublicClient = createPublicClient;
|
|
95
|
-
exports.createWalletClient = createWalletClient;
|
|
96
|
-
|
|
97
|
-
}));
|