@cmts-dev/carmentis-sdk-core 1.2.28 → 1.2.30
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/carmentis-sdk-core.cjs +4 -4
- package/dist/carmentis-sdk-core.js +800 -799
- package/dist/type/valibot/account/Account.d.ts +10 -0
- package/dist/type/valibot/account/Account.d.ts.map +1 -1
- package/dist/type/valibot/provider/abci/AbciRequest.d.ts +20 -0
- package/dist/type/valibot/provider/abci/AbciRequest.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1267,7 +1267,7 @@ var pn = /* @__PURE__ */ function(e) {
|
|
|
1267
1267
|
], Gr = /* @__PURE__ */ t({
|
|
1268
1268
|
ACCOUNT_HISTORY: () => ii,
|
|
1269
1269
|
ACCOUNT_STATE: () => ri,
|
|
1270
|
-
ALL_SCHEMAS: () =>
|
|
1270
|
+
ALL_SCHEMAS: () => aa,
|
|
1271
1271
|
BLOCK_CONTENT: () => ui,
|
|
1272
1272
|
BLOCK_INFORMATION: () => li,
|
|
1273
1273
|
CONTRACT_PARAMETER_SCHEMA: () => qr,
|
|
@@ -1309,7 +1309,7 @@ var pn = /* @__PURE__ */ function(e) {
|
|
|
1309
1309
|
MSG_VALIDATOR_NODE_BY_ADDRESS: () => 24,
|
|
1310
1310
|
MSG_VIRTUAL_BLOCKCHAIN_STATE: () => 8,
|
|
1311
1311
|
MSG_VIRTUAL_BLOCKCHAIN_UPDATE: () => 10,
|
|
1312
|
-
NODE_MESSAGES: () =>
|
|
1312
|
+
NODE_MESSAGES: () => qi,
|
|
1313
1313
|
PROTOCOL_VARIABLES: () => oi,
|
|
1314
1314
|
PROTOCOL_VB_STATE: () => si,
|
|
1315
1315
|
RECORD_DESCRIPTION: () => ni,
|
|
@@ -1324,8 +1324,8 @@ var pn = /* @__PURE__ */ function(e) {
|
|
|
1324
1324
|
WIMSG_GET_CONNECTION_INFO: () => 4,
|
|
1325
1325
|
WIMSG_REQUEST: () => 0,
|
|
1326
1326
|
WIMSG_UPDATE_QR: () => 1,
|
|
1327
|
-
WI_MESSAGES: () =>
|
|
1328
|
-
WI_QR_CODE: () =>
|
|
1327
|
+
WI_MESSAGES: () => ia,
|
|
1328
|
+
WI_QR_CODE: () => Ji
|
|
1329
1329
|
}), Kr = {
|
|
1330
1330
|
label: "Error",
|
|
1331
1331
|
definition: [
|
|
@@ -1936,17 +1936,17 @@ var pn = /* @__PURE__ */ function(e) {
|
|
|
1936
1936
|
name: "virtualBlockchainId",
|
|
1937
1937
|
type: 13
|
|
1938
1938
|
}]
|
|
1939
|
-
}, vi = 0, yi = 1, bi = 2, xi = 3, Si = 4, Ci = 5, wi = 6, Ti = 7, Ei = 8, Di = 9, Oi = 10, ki = 11, Ai = 12, ji = 13, Mi = 14, Ni = 15, Pi = 16, Fi = 17, Ii = 18, Li = 19, Ri = 20, zi = 21, Bi = 22, Vi = 23, Hi = 24, Ui = 25, Wi = 26, Gi = 27, Ki = 28,
|
|
1940
|
-
|
|
1939
|
+
}, vi = 0, yi = 1, bi = 2, xi = 3, Si = 4, Ci = 5, wi = 6, Ti = 7, Ei = 8, Di = 9, Oi = 10, ki = 11, Ai = 12, ji = 13, Mi = 14, Ni = 15, Pi = 16, Fi = 17, Ii = 18, Li = 19, Ri = 20, zi = 21, Bi = 22, Vi = 23, Hi = 24, Ui = 25, Wi = 26, Gi = 27, Ki = 28, qi = [];
|
|
1940
|
+
qi[0] = {
|
|
1941
1941
|
label: "MessageError",
|
|
1942
1942
|
definition: [{
|
|
1943
1943
|
name: "error",
|
|
1944
1944
|
type: 3
|
|
1945
1945
|
}]
|
|
1946
|
-
},
|
|
1946
|
+
}, qi[1] = {
|
|
1947
1947
|
label: "MessageGetChainInformation",
|
|
1948
1948
|
definition: []
|
|
1949
|
-
},
|
|
1949
|
+
}, qi[2] = {
|
|
1950
1950
|
label: "MessageChainInformation",
|
|
1951
1951
|
definition: [
|
|
1952
1952
|
{
|
|
@@ -1967,37 +1967,37 @@ D[0] = {
|
|
|
1967
1967
|
size: 6
|
|
1968
1968
|
}
|
|
1969
1969
|
]
|
|
1970
|
-
},
|
|
1970
|
+
}, qi[3] = {
|
|
1971
1971
|
label: "MessageGetBlockInformation",
|
|
1972
1972
|
definition: [{
|
|
1973
1973
|
name: "height",
|
|
1974
1974
|
type: 11
|
|
1975
1975
|
}]
|
|
1976
|
-
},
|
|
1976
|
+
}, qi[4] = {
|
|
1977
1977
|
label: "MessageBlockInformation",
|
|
1978
1978
|
definition: li.definition
|
|
1979
|
-
},
|
|
1979
|
+
}, qi[5] = {
|
|
1980
1980
|
label: "MessageGetBlockContent",
|
|
1981
1981
|
definition: [{
|
|
1982
1982
|
name: "height",
|
|
1983
1983
|
type: 11
|
|
1984
1984
|
}]
|
|
1985
|
-
},
|
|
1985
|
+
}, qi[6] = {
|
|
1986
1986
|
label: "MessageBlockContent",
|
|
1987
1987
|
definition: ui.definition
|
|
1988
|
-
},
|
|
1988
|
+
}, qi[7] = {
|
|
1989
1989
|
label: "MessageGetVirtualBlockchainState",
|
|
1990
1990
|
definition: [{
|
|
1991
1991
|
name: "virtualBlockchainId",
|
|
1992
1992
|
type: 13
|
|
1993
1993
|
}]
|
|
1994
|
-
},
|
|
1994
|
+
}, qi[8] = {
|
|
1995
1995
|
label: "MessageVirtualBlockchainState",
|
|
1996
1996
|
definition: [{
|
|
1997
1997
|
name: "stateData",
|
|
1998
1998
|
type: 12
|
|
1999
1999
|
}]
|
|
2000
|
-
},
|
|
2000
|
+
}, qi[9] = {
|
|
2001
2001
|
label: "MessageGetVirtualBlockchainUpdate",
|
|
2002
2002
|
definition: [{
|
|
2003
2003
|
name: "virtualBlockchainId",
|
|
@@ -2006,7 +2006,7 @@ D[0] = {
|
|
|
2006
2006
|
name: "knownHeight",
|
|
2007
2007
|
type: 11
|
|
2008
2008
|
}]
|
|
2009
|
-
},
|
|
2009
|
+
}, qi[10] = {
|
|
2010
2010
|
label: "MessageVirtualBlockchainUpdate",
|
|
2011
2011
|
definition: [
|
|
2012
2012
|
{
|
|
@@ -2026,13 +2026,13 @@ D[0] = {
|
|
|
2026
2026
|
type: 44
|
|
2027
2027
|
}
|
|
2028
2028
|
]
|
|
2029
|
-
},
|
|
2029
|
+
}, qi[11] = {
|
|
2030
2030
|
label: "MessageGetMicroblockInformation",
|
|
2031
2031
|
definition: [{
|
|
2032
2032
|
name: "hash",
|
|
2033
2033
|
type: 13
|
|
2034
2034
|
}]
|
|
2035
|
-
},
|
|
2035
|
+
}, qi[12] = {
|
|
2036
2036
|
label: "MessageMicroblockInformation",
|
|
2037
2037
|
definition: [
|
|
2038
2038
|
{
|
|
@@ -2048,22 +2048,22 @@ D[0] = {
|
|
|
2048
2048
|
type: 12
|
|
2049
2049
|
}
|
|
2050
2050
|
]
|
|
2051
|
-
},
|
|
2051
|
+
}, qi[13] = {
|
|
2052
2052
|
label: "MessageAwaitMicroblockAnchoring",
|
|
2053
2053
|
definition: [{
|
|
2054
2054
|
name: "hash",
|
|
2055
2055
|
type: 13
|
|
2056
2056
|
}]
|
|
2057
|
-
},
|
|
2057
|
+
}, qi[14] = {
|
|
2058
2058
|
label: "MessageMicroblockAnchoring",
|
|
2059
2059
|
definition: _i.definition
|
|
2060
|
-
},
|
|
2060
|
+
}, qi[15] = {
|
|
2061
2061
|
label: "MessageGetMicroblockBodys",
|
|
2062
2062
|
definition: [{
|
|
2063
2063
|
name: "hashes",
|
|
2064
2064
|
type: 45
|
|
2065
2065
|
}]
|
|
2066
|
-
},
|
|
2066
|
+
}, qi[16] = {
|
|
2067
2067
|
label: "MessageMicroblockBodys",
|
|
2068
2068
|
definition: [{
|
|
2069
2069
|
name: "list",
|
|
@@ -2076,16 +2076,16 @@ D[0] = {
|
|
|
2076
2076
|
type: 12
|
|
2077
2077
|
}]
|
|
2078
2078
|
}]
|
|
2079
|
-
},
|
|
2079
|
+
}, qi[17] = {
|
|
2080
2080
|
label: "MessageGetAccountState",
|
|
2081
2081
|
definition: [{
|
|
2082
2082
|
name: "accountHash",
|
|
2083
2083
|
type: 13
|
|
2084
2084
|
}]
|
|
2085
|
-
},
|
|
2085
|
+
}, qi[18] = {
|
|
2086
2086
|
label: "MessageAccountState",
|
|
2087
2087
|
definition: ri.definition
|
|
2088
|
-
},
|
|
2088
|
+
}, qi[19] = {
|
|
2089
2089
|
label: "MessageGetAccountHistory",
|
|
2090
2090
|
definition: [
|
|
2091
2091
|
{
|
|
@@ -2101,60 +2101,60 @@ D[0] = {
|
|
|
2101
2101
|
type: 8
|
|
2102
2102
|
}
|
|
2103
2103
|
]
|
|
2104
|
-
},
|
|
2104
|
+
}, qi[20] = {
|
|
2105
2105
|
label: "MessageAccountHistory",
|
|
2106
2106
|
definition: [{
|
|
2107
2107
|
name: "list",
|
|
2108
2108
|
type: 34,
|
|
2109
2109
|
schema: ii
|
|
2110
2110
|
}]
|
|
2111
|
-
},
|
|
2111
|
+
}, qi[21] = {
|
|
2112
2112
|
label: "MessageGetAccountByPublicKeyHash",
|
|
2113
2113
|
definition: [{
|
|
2114
2114
|
name: "publicKeyHash",
|
|
2115
2115
|
type: 13
|
|
2116
2116
|
}]
|
|
2117
|
-
},
|
|
2117
|
+
}, qi[22] = {
|
|
2118
2118
|
label: "MessageAccountByPublicKeyHash",
|
|
2119
2119
|
definition: [{
|
|
2120
2120
|
name: "accountHash",
|
|
2121
2121
|
type: 13
|
|
2122
2122
|
}]
|
|
2123
|
-
},
|
|
2123
|
+
}, qi[23] = {
|
|
2124
2124
|
label: "MessageGetValidatorNodeByAddress",
|
|
2125
2125
|
definition: [{
|
|
2126
2126
|
name: "address",
|
|
2127
2127
|
type: 12
|
|
2128
2128
|
}]
|
|
2129
|
-
},
|
|
2129
|
+
}, qi[24] = {
|
|
2130
2130
|
label: "MessageValidatorNodeByAddress",
|
|
2131
2131
|
definition: [{
|
|
2132
2132
|
name: "validatorNodeHash",
|
|
2133
2133
|
type: 13
|
|
2134
2134
|
}]
|
|
2135
|
-
},
|
|
2135
|
+
}, qi[25] = {
|
|
2136
2136
|
label: "MessageGetObjectList",
|
|
2137
2137
|
definition: [{
|
|
2138
2138
|
name: "type",
|
|
2139
2139
|
type: 7
|
|
2140
2140
|
}]
|
|
2141
|
-
},
|
|
2141
|
+
}, qi[26] = {
|
|
2142
2142
|
label: "MessageObjectList",
|
|
2143
2143
|
definition: [{
|
|
2144
2144
|
name: "list",
|
|
2145
2145
|
type: 45
|
|
2146
2146
|
}]
|
|
2147
|
-
},
|
|
2147
|
+
}, qi[27] = {
|
|
2148
2148
|
label: "MessageGetGenesisSnapshot",
|
|
2149
2149
|
definition: []
|
|
2150
|
-
},
|
|
2150
|
+
}, qi[28] = {
|
|
2151
2151
|
label: "MessageGenesisSnapshot",
|
|
2152
2152
|
definition: [{
|
|
2153
2153
|
name: "base64EncodedChunks",
|
|
2154
2154
|
type: 35
|
|
2155
2155
|
}]
|
|
2156
2156
|
};
|
|
2157
|
-
var
|
|
2157
|
+
var Ji = {
|
|
2158
2158
|
label: "WiQrCode",
|
|
2159
2159
|
definition: [
|
|
2160
2160
|
{
|
|
@@ -2171,8 +2171,8 @@ var qi = {
|
|
|
2171
2171
|
size: 100
|
|
2172
2172
|
}
|
|
2173
2173
|
]
|
|
2174
|
-
},
|
|
2175
|
-
|
|
2174
|
+
}, Yi = 0, Xi = 1, Zi = 2, Qi = 3, $i = 4, ea = 5, ta = 6, na = 7, ra = 8, ia = [];
|
|
2175
|
+
ia[0] = {
|
|
2176
2176
|
label: "WiMsgRequest",
|
|
2177
2177
|
definition: [
|
|
2178
2178
|
{
|
|
@@ -2192,7 +2192,7 @@ ra[0] = {
|
|
|
2192
2192
|
type: 7
|
|
2193
2193
|
}
|
|
2194
2194
|
]
|
|
2195
|
-
},
|
|
2195
|
+
}, ia[1] = {
|
|
2196
2196
|
label: "WiMsgUpdateQr",
|
|
2197
2197
|
definition: [{
|
|
2198
2198
|
name: "qrId",
|
|
@@ -2201,13 +2201,13 @@ ra[0] = {
|
|
|
2201
2201
|
name: "timestamp",
|
|
2202
2202
|
type: 11
|
|
2203
2203
|
}]
|
|
2204
|
-
},
|
|
2204
|
+
}, ia[2] = {
|
|
2205
2205
|
label: "WiMsgConnectionToken",
|
|
2206
2206
|
definition: [{
|
|
2207
2207
|
name: "token",
|
|
2208
2208
|
type: 13
|
|
2209
2209
|
}]
|
|
2210
|
-
},
|
|
2210
|
+
}, ia[3] = {
|
|
2211
2211
|
label: "WiMsgForwardedAnswer",
|
|
2212
2212
|
definition: [{
|
|
2213
2213
|
name: "answerType",
|
|
@@ -2216,13 +2216,13 @@ ra[0] = {
|
|
|
2216
2216
|
name: "answer",
|
|
2217
2217
|
type: 12
|
|
2218
2218
|
}]
|
|
2219
|
-
},
|
|
2219
|
+
}, ia[4] = {
|
|
2220
2220
|
label: "WiMsgGetConnectionInfo",
|
|
2221
2221
|
definition: [{
|
|
2222
2222
|
name: "qrId",
|
|
2223
2223
|
type: 13
|
|
2224
2224
|
}]
|
|
2225
|
-
},
|
|
2225
|
+
}, ia[5] = {
|
|
2226
2226
|
label: "WiMsgAnswer",
|
|
2227
2227
|
definition: [{
|
|
2228
2228
|
name: "answerType",
|
|
@@ -2231,16 +2231,16 @@ ra[0] = {
|
|
|
2231
2231
|
name: "answer",
|
|
2232
2232
|
type: 12
|
|
2233
2233
|
}]
|
|
2234
|
-
},
|
|
2234
|
+
}, ia[6] = {
|
|
2235
2235
|
label: "WiMsgConnectionInfo",
|
|
2236
2236
|
definition: []
|
|
2237
|
-
},
|
|
2237
|
+
}, ia[7] = {
|
|
2238
2238
|
label: "WiMsgConnectionAccepted",
|
|
2239
2239
|
definition: [{
|
|
2240
2240
|
name: "qrId",
|
|
2241
2241
|
type: 13
|
|
2242
2242
|
}]
|
|
2243
|
-
},
|
|
2243
|
+
}, ia[8] = {
|
|
2244
2244
|
label: "WiMsgForwardedRequest",
|
|
2245
2245
|
definition: [{
|
|
2246
2246
|
name: "requestType",
|
|
@@ -2250,7 +2250,7 @@ ra[0] = {
|
|
|
2250
2250
|
type: 12
|
|
2251
2251
|
}]
|
|
2252
2252
|
};
|
|
2253
|
-
var
|
|
2253
|
+
var aa = {
|
|
2254
2254
|
singles: [
|
|
2255
2255
|
Yr,
|
|
2256
2256
|
Xr,
|
|
@@ -2264,7 +2264,7 @@ var ia = {
|
|
|
2264
2264
|
hi,
|
|
2265
2265
|
gi,
|
|
2266
2266
|
_i,
|
|
2267
|
-
|
|
2267
|
+
Ji
|
|
2268
2268
|
],
|
|
2269
2269
|
collections: [
|
|
2270
2270
|
{
|
|
@@ -2273,51 +2273,51 @@ var ia = {
|
|
|
2273
2273
|
},
|
|
2274
2274
|
{
|
|
2275
2275
|
label: "NodeMessage",
|
|
2276
|
-
list:
|
|
2276
|
+
list: qi
|
|
2277
2277
|
},
|
|
2278
2278
|
{
|
|
2279
2279
|
label: "WiMessage",
|
|
2280
|
-
list:
|
|
2280
|
+
list: ia
|
|
2281
2281
|
}
|
|
2282
2282
|
]
|
|
2283
|
-
},
|
|
2283
|
+
}, D = /* @__PURE__ */ function(e) {
|
|
2284
2284
|
return e[e.AUXILIARY_SIGNATURE = 126] = "AUXILIARY_SIGNATURE", e[e.SIGNATURE = 127] = "SIGNATURE", e[e.ALLOWED_ADDITIONAL_WRITER = 128] = "ALLOWED_ADDITIONAL_WRITER", e[e.CUSTOM = 129] = "CUSTOM", e[e.PROTOCOL_CREATION = 1] = "PROTOCOL_CREATION", e[e.PROTOCOL_UPDATE = 2] = "PROTOCOL_UPDATE", e[e.PROTOCOL_VARIABLES = 5] = "PROTOCOL_VARIABLES", e[e.ACCOUNT_PUBLIC_KEY = 17] = "ACCOUNT_PUBLIC_KEY", e[e.ACCOUNT_TOKEN_ISSUANCE = 18] = "ACCOUNT_TOKEN_ISSUANCE", e[e.ACCOUNT_CREATION = 19] = "ACCOUNT_CREATION", e[e.ACCOUNT_TRANSFER = 20] = "ACCOUNT_TRANSFER", e[e.ACCOUNT_VESTING_TRANSFER = 21] = "ACCOUNT_VESTING_TRANSFER", e[e.ACCOUNT_ESCROW_TRANSFER = 22] = "ACCOUNT_ESCROW_TRANSFER", e[e.ACCOUNT_ESCROW_SETTLEMENT = 23] = "ACCOUNT_ESCROW_SETTLEMENT", e[e.ACCOUNT_STAKE = 24] = "ACCOUNT_STAKE", e[e.ACCOUNT_UNSTAKE = 25] = "ACCOUNT_UNSTAKE", e[e.VN_CREATION = 33] = "VN_CREATION", e[e.VN_COMETBFT_PUBLIC_KEY_DECLARATION = 34] = "VN_COMETBFT_PUBLIC_KEY_DECLARATION", e[e.VN_RPC_ENDPOINT = 35] = "VN_RPC_ENDPOINT", e[e.VN_APPROVAL = 36] = "VN_APPROVAL", e[e.VN_SLASHING_CANCELLATION = 37] = "VN_SLASHING_CANCELLATION", e[e.ORG_CREATION = 52] = "ORG_CREATION", e[e.ORG_DESCRIPTION = 50] = "ORG_DESCRIPTION", e[e.APP_CREATION = 65] = "APP_CREATION", e[e.APP_DESCRIPTION = 66] = "APP_DESCRIPTION", e[e.APP_LEDGER_ALLOWED_SIG_SCHEMES = 80] = "APP_LEDGER_ALLOWED_SIG_SCHEMES", e[e.APP_LEDGER_ALLOWED_PKE_SCHEMES = 81] = "APP_LEDGER_ALLOWED_PKE_SCHEMES", e[e.APP_LEDGER_CREATION = 82] = "APP_LEDGER_CREATION", e[e.APP_LEDGER_ACTOR_CREATION = 83] = "APP_LEDGER_ACTOR_CREATION", e[e.APP_LEDGER_CHANNEL_CREATION = 84] = "APP_LEDGER_CHANNEL_CREATION", e[e.APP_LEDGER_SHARED_SECRET = 85] = "APP_LEDGER_SHARED_SECRET", e[e.APP_LEDGER_CHANNEL_INVITATION = 86] = "APP_LEDGER_CHANNEL_INVITATION", e[e.APP_LEDGER_ACTOR_SUBSCRIPTION = 87] = "APP_LEDGER_ACTOR_SUBSCRIPTION", e[e.APP_LEDGER_PUBLIC_CHANNEL_DATA = 88] = "APP_LEDGER_PUBLIC_CHANNEL_DATA", e[e.APP_LEDGER_PRIVATE_CHANNEL_DATA = 89] = "APP_LEDGER_PRIVATE_CHANNEL_DATA", e[e.APP_LEDGER_AUTHOR = 90] = "APP_LEDGER_AUTHOR", e[e.APP_LEDGER_ENDORSEMENT_REQUEST = 91] = "APP_LEDGER_ENDORSEMENT_REQUEST", e;
|
|
2285
|
-
}({}),
|
|
2286
|
-
ACCOUNT_CREATION: () =>
|
|
2287
|
-
ACCOUNT_ESCROW_SETTLEMENT: () =>
|
|
2288
|
-
ACCOUNT_ESCROW_TRANSFER: () =>
|
|
2289
|
-
ACCOUNT_PUBLIC_KEY: () =>
|
|
2290
|
-
ACCOUNT_STAKE: () =>
|
|
2291
|
-
ACCOUNT_TOKEN_ISSUANCE: () =>
|
|
2292
|
-
ACCOUNT_TRANSFER: () =>
|
|
2293
|
-
ACCOUNT_VESTING_TRANSFER: () =>
|
|
2294
|
-
ALL_SECTIONS_SCHEMAS: () =>
|
|
2295
|
-
APP_CREATION: () =>
|
|
2296
|
-
APP_DESCRIPTION: () =>
|
|
2297
|
-
APP_LEDGER_ACTOR_CREATION: () =>
|
|
2298
|
-
APP_LEDGER_ACTOR_SUBSCRIPTION: () =>
|
|
2299
|
-
APP_LEDGER_ALLOWED_PKE_SCHEMES: () =>
|
|
2300
|
-
APP_LEDGER_ALLOWED_SIG_SCHEMES: () =>
|
|
2301
|
-
APP_LEDGER_AUTHOR: () =>
|
|
2302
|
-
APP_LEDGER_CHANNEL_CREATION: () =>
|
|
2303
|
-
APP_LEDGER_CHANNEL_INVITATION: () =>
|
|
2304
|
-
APP_LEDGER_CREATION: () =>
|
|
2305
|
-
APP_LEDGER_ENDORSEMENT_REQUEST: () =>
|
|
2306
|
-
APP_LEDGER_PRIVATE_CHANNEL_DATA: () =>
|
|
2307
|
-
APP_LEDGER_PUBLIC_CHANNEL_DATA: () =>
|
|
2308
|
-
APP_LEDGER_SHARED_SECRET: () =>
|
|
2309
|
-
DEF: () =>
|
|
2310
|
-
ORG_CREATION: () =>
|
|
2311
|
-
ORG_DESCRIPTION: () =>
|
|
2312
|
-
PROTOCOL_CREATION: () =>
|
|
2313
|
-
PROTOCOL_UPDATE: () =>
|
|
2314
|
-
SIGNATURE: () =>
|
|
2315
|
-
SIGNATURE_SCHEMA: () =>
|
|
2316
|
-
VN_APPROVAL: () =>
|
|
2317
|
-
VN_COMETBFT_PUBLIC_KEY_DECLARATION: () =>
|
|
2318
|
-
VN_CREATION: () =>
|
|
2319
|
-
VN_RPC_ENDPOINT: () =>
|
|
2320
|
-
}),
|
|
2285
|
+
}({}), oa = /* @__PURE__ */ t({
|
|
2286
|
+
ACCOUNT_CREATION: () => ma,
|
|
2287
|
+
ACCOUNT_ESCROW_SETTLEMENT: () => va,
|
|
2288
|
+
ACCOUNT_ESCROW_TRANSFER: () => _a,
|
|
2289
|
+
ACCOUNT_PUBLIC_KEY: () => fa,
|
|
2290
|
+
ACCOUNT_STAKE: () => ya,
|
|
2291
|
+
ACCOUNT_TOKEN_ISSUANCE: () => pa,
|
|
2292
|
+
ACCOUNT_TRANSFER: () => ha,
|
|
2293
|
+
ACCOUNT_VESTING_TRANSFER: () => ga,
|
|
2294
|
+
ALL_SECTIONS_SCHEMAS: () => Ga,
|
|
2295
|
+
APP_CREATION: () => ka,
|
|
2296
|
+
APP_DESCRIPTION: () => Aa,
|
|
2297
|
+
APP_LEDGER_ACTOR_CREATION: () => Fa,
|
|
2298
|
+
APP_LEDGER_ACTOR_SUBSCRIPTION: () => za,
|
|
2299
|
+
APP_LEDGER_ALLOWED_PKE_SCHEMES: () => Na,
|
|
2300
|
+
APP_LEDGER_ALLOWED_SIG_SCHEMES: () => Ma,
|
|
2301
|
+
APP_LEDGER_AUTHOR: () => Ha,
|
|
2302
|
+
APP_LEDGER_CHANNEL_CREATION: () => Ia,
|
|
2303
|
+
APP_LEDGER_CHANNEL_INVITATION: () => Ra,
|
|
2304
|
+
APP_LEDGER_CREATION: () => Pa,
|
|
2305
|
+
APP_LEDGER_ENDORSEMENT_REQUEST: () => Ua,
|
|
2306
|
+
APP_LEDGER_PRIVATE_CHANNEL_DATA: () => Va,
|
|
2307
|
+
APP_LEDGER_PUBLIC_CHANNEL_DATA: () => Ba,
|
|
2308
|
+
APP_LEDGER_SHARED_SECRET: () => La,
|
|
2309
|
+
DEF: () => Ka,
|
|
2310
|
+
ORG_CREATION: () => Ea,
|
|
2311
|
+
ORG_DESCRIPTION: () => Da,
|
|
2312
|
+
PROTOCOL_CREATION: () => la,
|
|
2313
|
+
PROTOCOL_UPDATE: () => ua,
|
|
2314
|
+
SIGNATURE: () => sa,
|
|
2315
|
+
SIGNATURE_SCHEMA: () => ca,
|
|
2316
|
+
VN_APPROVAL: () => wa,
|
|
2317
|
+
VN_COMETBFT_PUBLIC_KEY_DECLARATION: () => Sa,
|
|
2318
|
+
VN_CREATION: () => xa,
|
|
2319
|
+
VN_RPC_ENDPOINT: () => Ca
|
|
2320
|
+
}), sa = D.SIGNATURE, ca = {
|
|
2321
2321
|
label: "SIGNATURE",
|
|
2322
2322
|
definition: [{
|
|
2323
2323
|
name: "schemeId",
|
|
@@ -2326,14 +2326,14 @@ var ia = {
|
|
|
2326
2326
|
name: "signature",
|
|
2327
2327
|
type: 12
|
|
2328
2328
|
}]
|
|
2329
|
-
},
|
|
2330
|
-
|
|
2329
|
+
}, la = D.PROTOCOL_CREATION, ua = D.PROTOCOL_UPDATE, da = [];
|
|
2330
|
+
da[la] = {
|
|
2331
2331
|
label: "PROTOCOL_CREATION",
|
|
2332
2332
|
definition: [{
|
|
2333
2333
|
name: "organizationId",
|
|
2334
2334
|
type: 13
|
|
2335
2335
|
}]
|
|
2336
|
-
}, ua
|
|
2336
|
+
}, da[ua] = {
|
|
2337
2337
|
label: "PROTOCOL_VARIABLES_UPDATE",
|
|
2338
2338
|
definition: [
|
|
2339
2339
|
{
|
|
@@ -2355,8 +2355,8 @@ ua[ca] = {
|
|
|
2355
2355
|
}
|
|
2356
2356
|
]
|
|
2357
2357
|
};
|
|
2358
|
-
var
|
|
2359
|
-
|
|
2358
|
+
var fa = D.ACCOUNT_PUBLIC_KEY, pa = D.ACCOUNT_TOKEN_ISSUANCE, ma = D.ACCOUNT_CREATION, ha = D.ACCOUNT_TRANSFER, ga = D.ACCOUNT_VESTING_TRANSFER, _a = D.ACCOUNT_ESCROW_TRANSFER, va = D.ACCOUNT_ESCROW_SETTLEMENT, ya = D.ACCOUNT_STAKE, ba = [];
|
|
2359
|
+
ba[fa] = {
|
|
2360
2360
|
label: "ACCOUNT_PUBLIC_KEY",
|
|
2361
2361
|
definition: [{
|
|
2362
2362
|
name: "publicKey",
|
|
@@ -2365,13 +2365,13 @@ ya[da] = {
|
|
|
2365
2365
|
name: "schemeId",
|
|
2366
2366
|
type: 7
|
|
2367
2367
|
}]
|
|
2368
|
-
},
|
|
2368
|
+
}, ba[pa] = {
|
|
2369
2369
|
label: "ACCOUNT_TOKEN_ISSUANCE",
|
|
2370
2370
|
definition: [{
|
|
2371
2371
|
name: "amount",
|
|
2372
2372
|
type: 11
|
|
2373
2373
|
}]
|
|
2374
|
-
},
|
|
2374
|
+
}, ba[ma] = {
|
|
2375
2375
|
label: "ACCOUNT_CREATION",
|
|
2376
2376
|
definition: [{
|
|
2377
2377
|
name: "sellerAccount",
|
|
@@ -2380,7 +2380,7 @@ ya[da] = {
|
|
|
2380
2380
|
name: "amount",
|
|
2381
2381
|
type: 11
|
|
2382
2382
|
}]
|
|
2383
|
-
},
|
|
2383
|
+
}, ba[ha] = {
|
|
2384
2384
|
label: "ACCOUNT_TRANSFER",
|
|
2385
2385
|
definition: [
|
|
2386
2386
|
{
|
|
@@ -2400,7 +2400,7 @@ ya[da] = {
|
|
|
2400
2400
|
type: 3
|
|
2401
2401
|
}
|
|
2402
2402
|
]
|
|
2403
|
-
},
|
|
2403
|
+
}, ba[ga] = {
|
|
2404
2404
|
label: "ACCOUNT_VESTING_TRANSFER",
|
|
2405
2405
|
definition: [
|
|
2406
2406
|
{
|
|
@@ -2428,7 +2428,7 @@ ya[da] = {
|
|
|
2428
2428
|
type: 8
|
|
2429
2429
|
}
|
|
2430
2430
|
]
|
|
2431
|
-
},
|
|
2431
|
+
}, ba[_a] = {
|
|
2432
2432
|
label: "ACCOUNT_ESCROW_TRANSFER",
|
|
2433
2433
|
definition: [
|
|
2434
2434
|
{
|
|
@@ -2460,7 +2460,7 @@ ya[da] = {
|
|
|
2460
2460
|
type: 8
|
|
2461
2461
|
}
|
|
2462
2462
|
]
|
|
2463
|
-
},
|
|
2463
|
+
}, ba[va] = {
|
|
2464
2464
|
label: "ACCOUNT_ESCROW_SETTLEMENT",
|
|
2465
2465
|
definition: [{
|
|
2466
2466
|
name: "confirmed",
|
|
@@ -2469,7 +2469,7 @@ ya[da] = {
|
|
|
2469
2469
|
name: "escrowIdentifier",
|
|
2470
2470
|
type: 13
|
|
2471
2471
|
}]
|
|
2472
|
-
}, ya
|
|
2472
|
+
}, ba[ya] = {
|
|
2473
2473
|
label: "ACCOUNT_STAKE",
|
|
2474
2474
|
definition: [
|
|
2475
2475
|
{
|
|
@@ -2486,14 +2486,14 @@ ya[da] = {
|
|
|
2486
2486
|
}
|
|
2487
2487
|
]
|
|
2488
2488
|
};
|
|
2489
|
-
var
|
|
2490
|
-
|
|
2489
|
+
var xa = D.VN_CREATION, Sa = D.VN_COMETBFT_PUBLIC_KEY_DECLARATION, Ca = D.VN_RPC_ENDPOINT, wa = D.VN_APPROVAL, Ta = [];
|
|
2490
|
+
Ta[xa] = {
|
|
2491
2491
|
label: "VN_CREATION",
|
|
2492
2492
|
definition: [{
|
|
2493
2493
|
name: "organizationId",
|
|
2494
2494
|
type: 13
|
|
2495
2495
|
}]
|
|
2496
|
-
},
|
|
2496
|
+
}, Ta[Sa] = {
|
|
2497
2497
|
label: "VN_COMETBFT_PUBLIC_KEY_DECLARATION",
|
|
2498
2498
|
definition: [{
|
|
2499
2499
|
name: "cometPublicKeyType",
|
|
@@ -2502,27 +2502,27 @@ wa[ba] = {
|
|
|
2502
2502
|
name: "cometPublicKey",
|
|
2503
2503
|
type: 3
|
|
2504
2504
|
}]
|
|
2505
|
-
},
|
|
2505
|
+
}, Ta[Ca] = {
|
|
2506
2506
|
label: "VN_RPC_ENDPOINT",
|
|
2507
2507
|
definition: [{
|
|
2508
2508
|
name: "rpcEndpoint",
|
|
2509
2509
|
type: 3
|
|
2510
2510
|
}]
|
|
2511
|
-
}, wa
|
|
2511
|
+
}, Ta[wa] = {
|
|
2512
2512
|
label: "VN_APPROVAL",
|
|
2513
2513
|
definition: [{
|
|
2514
2514
|
name: "status",
|
|
2515
2515
|
type: 5
|
|
2516
2516
|
}]
|
|
2517
2517
|
};
|
|
2518
|
-
var
|
|
2519
|
-
|
|
2518
|
+
var Ea = D.ORG_CREATION, Da = D.ORG_DESCRIPTION, Oa = [];
|
|
2519
|
+
Oa[Ea] = {
|
|
2520
2520
|
label: "ORG_CREATION",
|
|
2521
2521
|
definition: [{
|
|
2522
2522
|
name: "accountId",
|
|
2523
2523
|
type: 13
|
|
2524
2524
|
}]
|
|
2525
|
-
}, Da
|
|
2525
|
+
}, Oa[Da] = {
|
|
2526
2526
|
label: "ORG_DESCRIPTION",
|
|
2527
2527
|
definition: [
|
|
2528
2528
|
{
|
|
@@ -2544,14 +2544,14 @@ Da[Ta] = {
|
|
|
2544
2544
|
}
|
|
2545
2545
|
]
|
|
2546
2546
|
};
|
|
2547
|
-
var
|
|
2548
|
-
|
|
2547
|
+
var ka = D.APP_CREATION, Aa = D.APP_DESCRIPTION, ja = [];
|
|
2548
|
+
ja[ka] = {
|
|
2549
2549
|
label: "APP_CREATION",
|
|
2550
2550
|
definition: [{
|
|
2551
2551
|
name: "organizationId",
|
|
2552
2552
|
type: 13
|
|
2553
2553
|
}]
|
|
2554
|
-
}, Aa
|
|
2554
|
+
}, ja[Aa] = {
|
|
2555
2555
|
label: "APP_DESCRIPTION",
|
|
2556
2556
|
definition: [
|
|
2557
2557
|
{
|
|
@@ -2572,26 +2572,26 @@ Aa[Oa] = {
|
|
|
2572
2572
|
}
|
|
2573
2573
|
]
|
|
2574
2574
|
};
|
|
2575
|
-
var
|
|
2576
|
-
|
|
2575
|
+
var Ma = D.APP_LEDGER_ALLOWED_SIG_SCHEMES, Na = D.APP_LEDGER_ALLOWED_PKE_SCHEMES, Pa = D.APP_LEDGER_CREATION, Fa = D.APP_LEDGER_ACTOR_CREATION, Ia = D.APP_LEDGER_CHANNEL_CREATION, La = D.APP_LEDGER_SHARED_SECRET, Ra = D.APP_LEDGER_CHANNEL_INVITATION, za = D.APP_LEDGER_ACTOR_SUBSCRIPTION, Ba = D.APP_LEDGER_PUBLIC_CHANNEL_DATA, Va = D.APP_LEDGER_PRIVATE_CHANNEL_DATA, Ha = D.APP_LEDGER_AUTHOR, Ua = D.APP_LEDGER_ENDORSEMENT_REQUEST, Wa = [];
|
|
2576
|
+
Wa[Ma] = {
|
|
2577
2577
|
label: "APP_LEDGER_ALLOWED_SIG_SCHEMES",
|
|
2578
2578
|
definition: [{
|
|
2579
2579
|
name: "schemeIds",
|
|
2580
2580
|
type: 39
|
|
2581
2581
|
}]
|
|
2582
|
-
},
|
|
2582
|
+
}, Wa[Na] = {
|
|
2583
2583
|
label: "APP_LEDGER_ALLOWED_PKE_SCHEMES",
|
|
2584
2584
|
definition: [{
|
|
2585
2585
|
name: "schemeIds",
|
|
2586
2586
|
type: 39
|
|
2587
2587
|
}]
|
|
2588
|
-
},
|
|
2588
|
+
}, Wa[Pa] = {
|
|
2589
2589
|
label: "APP_LEDGER_CREATION",
|
|
2590
2590
|
definition: [{
|
|
2591
2591
|
name: "applicationId",
|
|
2592
2592
|
type: 13
|
|
2593
2593
|
}]
|
|
2594
|
-
},
|
|
2594
|
+
}, Wa[Fa] = {
|
|
2595
2595
|
label: "APP_LEDGER_ACTOR_CREATION",
|
|
2596
2596
|
definition: [
|
|
2597
2597
|
{
|
|
@@ -2607,7 +2607,7 @@ Ua[ja] = {
|
|
|
2607
2607
|
type: 3
|
|
2608
2608
|
}
|
|
2609
2609
|
]
|
|
2610
|
-
},
|
|
2610
|
+
}, Wa[Ia] = {
|
|
2611
2611
|
label: "APP_LEDGER_CHANNEL_CREATION",
|
|
2612
2612
|
definition: [
|
|
2613
2613
|
{
|
|
@@ -2627,7 +2627,7 @@ Ua[ja] = {
|
|
|
2627
2627
|
type: 3
|
|
2628
2628
|
}
|
|
2629
2629
|
]
|
|
2630
|
-
},
|
|
2630
|
+
}, Wa[La] = {
|
|
2631
2631
|
label: "APP_LEDGER_SHARED_SECRET",
|
|
2632
2632
|
definition: [
|
|
2633
2633
|
{
|
|
@@ -2643,7 +2643,7 @@ Ua[ja] = {
|
|
|
2643
2643
|
type: 12
|
|
2644
2644
|
}
|
|
2645
2645
|
]
|
|
2646
|
-
},
|
|
2646
|
+
}, Wa[Ra] = {
|
|
2647
2647
|
label: "APP_LEDGER_CHANNEL_INVITATION",
|
|
2648
2648
|
definition: [
|
|
2649
2649
|
{
|
|
@@ -2663,7 +2663,7 @@ Ua[ja] = {
|
|
|
2663
2663
|
type: 12
|
|
2664
2664
|
}
|
|
2665
2665
|
]
|
|
2666
|
-
},
|
|
2666
|
+
}, Wa[za] = {
|
|
2667
2667
|
label: "APP_LEDGER_ACTOR_SUBSCRIPTION",
|
|
2668
2668
|
definition: [
|
|
2669
2669
|
{
|
|
@@ -2695,7 +2695,7 @@ Ua[ja] = {
|
|
|
2695
2695
|
type: 12
|
|
2696
2696
|
}
|
|
2697
2697
|
]
|
|
2698
|
-
},
|
|
2698
|
+
}, Wa[Ba] = {
|
|
2699
2699
|
label: "APP_LEDGER_PUBLIC_CHANNEL_DATA",
|
|
2700
2700
|
definition: [{
|
|
2701
2701
|
name: "channelId",
|
|
@@ -2704,7 +2704,7 @@ Ua[ja] = {
|
|
|
2704
2704
|
name: "data",
|
|
2705
2705
|
type: 12
|
|
2706
2706
|
}]
|
|
2707
|
-
},
|
|
2707
|
+
}, Wa[Va] = {
|
|
2708
2708
|
label: "APP_LEDGER_PRIVATE_CHANNEL_DATA",
|
|
2709
2709
|
definition: [
|
|
2710
2710
|
{
|
|
@@ -2720,13 +2720,13 @@ Ua[ja] = {
|
|
|
2720
2720
|
type: 12
|
|
2721
2721
|
}
|
|
2722
2722
|
]
|
|
2723
|
-
},
|
|
2723
|
+
}, Wa[Ha] = {
|
|
2724
2724
|
label: "APP_LEDGER_AUTHOR",
|
|
2725
2725
|
definition: [{
|
|
2726
2726
|
name: "authorId",
|
|
2727
2727
|
type: 7
|
|
2728
2728
|
}]
|
|
2729
|
-
}, Ua
|
|
2729
|
+
}, Wa[Ua] = {
|
|
2730
2730
|
label: "APP_LEDGER_ENDORSEMENT_REQUEST",
|
|
2731
2731
|
definition: [{
|
|
2732
2732
|
name: "endorserId",
|
|
@@ -2736,39 +2736,39 @@ Ua[ja] = {
|
|
|
2736
2736
|
type: 3
|
|
2737
2737
|
}]
|
|
2738
2738
|
};
|
|
2739
|
-
var
|
|
2740
|
-
...
|
|
2741
|
-
...
|
|
2742
|
-
...
|
|
2743
|
-
...
|
|
2744
|
-
...
|
|
2745
|
-
...
|
|
2746
|
-
},
|
|
2747
|
-
|
|
2748
|
-
|
|
2749
|
-
|
|
2750
|
-
|
|
2751
|
-
|
|
2752
|
-
|
|
2753
|
-
],
|
|
2739
|
+
var Ga = {
|
|
2740
|
+
...da,
|
|
2741
|
+
...ba,
|
|
2742
|
+
...Ta,
|
|
2743
|
+
...Oa,
|
|
2744
|
+
...ja,
|
|
2745
|
+
...Wa
|
|
2746
|
+
}, Ka = [
|
|
2747
|
+
da,
|
|
2748
|
+
ba,
|
|
2749
|
+
Ta,
|
|
2750
|
+
Oa,
|
|
2751
|
+
ja,
|
|
2752
|
+
Wa
|
|
2753
|
+
], qa = /* @__PURE__ */ t({ WI_INVALID_SIGNATURE: () => 0 }), Ja = 0, Ya = /* @__PURE__ */ function(e) {
|
|
2754
2754
|
return e[e.SECP256K1 = 0] = "SECP256K1", e[e.ML_DSA_65 = 1] = "ML_DSA_65", e[e.PKMS_SECP256K1 = 2] = "PKMS_SECP256K1", e[e.ED25519 = 3] = "ED25519", e;
|
|
2755
|
-
}({}),
|
|
2756
|
-
encode:
|
|
2757
|
-
decode:
|
|
2755
|
+
}({}), Xa = new TextEncoder(), Za = new TextDecoder(), Qa = {
|
|
2756
|
+
encode: $a,
|
|
2757
|
+
decode: eo
|
|
2758
2758
|
};
|
|
2759
|
-
function Qa(e) {
|
|
2760
|
-
return Ya.encode(e);
|
|
2761
|
-
}
|
|
2762
2759
|
function $a(e) {
|
|
2763
|
-
return Xa.
|
|
2760
|
+
return Xa.encode(e);
|
|
2761
|
+
}
|
|
2762
|
+
function eo(e) {
|
|
2763
|
+
return Za.decode(e);
|
|
2764
2764
|
}
|
|
2765
2765
|
//#endregion
|
|
2766
2766
|
//#region src/errors/type-checking-failure-error.ts
|
|
2767
|
-
var
|
|
2767
|
+
var to = class extends m {
|
|
2768
2768
|
constructor(e) {
|
|
2769
2769
|
super(e, n.TYPE_CHECKING_FAILURE_ERROR);
|
|
2770
2770
|
}
|
|
2771
|
-
},
|
|
2771
|
+
}, no = 126, ro = class {
|
|
2772
2772
|
static getType(e) {
|
|
2773
2773
|
switch (typeof e) {
|
|
2774
2774
|
case "string": return 3;
|
|
@@ -2783,14 +2783,14 @@ var eo = class extends m {
|
|
|
2783
2783
|
return 0;
|
|
2784
2784
|
}
|
|
2785
2785
|
static isJsonType(e) {
|
|
2786
|
-
return
|
|
2786
|
+
return no >> e & 1;
|
|
2787
2787
|
}
|
|
2788
|
-
},
|
|
2788
|
+
}, io = class {
|
|
2789
2789
|
basicType;
|
|
2790
2790
|
definition;
|
|
2791
2791
|
value;
|
|
2792
2792
|
constructor(e, t) {
|
|
2793
|
-
this.definition = e, this.value = t, this.basicType =
|
|
2793
|
+
this.definition = e, this.value = t, this.basicType = ro.getType(t);
|
|
2794
2794
|
}
|
|
2795
2795
|
check() {
|
|
2796
2796
|
let e = this.definition.type & 31;
|
|
@@ -2834,7 +2834,7 @@ var eo = class extends m {
|
|
|
2834
2834
|
isString() {
|
|
2835
2835
|
if (this.basicType != 3) throw "string expected";
|
|
2836
2836
|
if (this.definition.size) {
|
|
2837
|
-
let e =
|
|
2837
|
+
let e = Qa.encode(this.value);
|
|
2838
2838
|
this.checkSize(e.length, this.definition.size);
|
|
2839
2839
|
}
|
|
2840
2840
|
}
|
|
@@ -2849,7 +2849,7 @@ var eo = class extends m {
|
|
|
2849
2849
|
if (this.value < -(2 ** 53 - 1) || this.value > 2 ** 53 - 1) throw "value is outside the safe integer range";
|
|
2850
2850
|
}
|
|
2851
2851
|
isUnsignedInteger(e) {
|
|
2852
|
-
if (this.isInteger(), this.value < 0) throw new
|
|
2852
|
+
if (this.isInteger(), this.value < 0) throw new to("non-negative value expected");
|
|
2853
2853
|
if (this.value >= 2 ** e) throw Error(`value is too big (${e}-bit value expected)`);
|
|
2854
2854
|
}
|
|
2855
2855
|
isBinary(e) {
|
|
@@ -2865,10 +2865,10 @@ var eo = class extends m {
|
|
|
2865
2865
|
};
|
|
2866
2866
|
//#endregion
|
|
2867
2867
|
//#region node_modules/.pnpm/@logtape+logtape@1.3.7/node_modules/@logtape/logtape/dist/filter.js
|
|
2868
|
-
function io(e) {
|
|
2869
|
-
return typeof e == "function" ? e : ao(e);
|
|
2870
|
-
}
|
|
2871
2868
|
function ao(e) {
|
|
2869
|
+
return typeof e == "function" ? e : oo(e);
|
|
2870
|
+
}
|
|
2871
|
+
function oo(e) {
|
|
2872
2872
|
if (e == null) return () => !1;
|
|
2873
2873
|
if (e === "fatal") return (e) => e.level === "fatal";
|
|
2874
2874
|
if (e === "error") return (e) => e.level === "fatal" || e.level === "error";
|
|
@@ -2880,7 +2880,7 @@ function ao(e) {
|
|
|
2880
2880
|
}
|
|
2881
2881
|
//#endregion
|
|
2882
2882
|
//#region node_modules/.pnpm/@logtape+logtape@1.3.7/node_modules/@logtape/logtape/dist/level.js
|
|
2883
|
-
var
|
|
2883
|
+
var so = [
|
|
2884
2884
|
"trace",
|
|
2885
2885
|
"debug",
|
|
2886
2886
|
"info",
|
|
@@ -2888,19 +2888,19 @@ var oo = [
|
|
|
2888
2888
|
"error",
|
|
2889
2889
|
"fatal"
|
|
2890
2890
|
];
|
|
2891
|
-
function
|
|
2892
|
-
let n =
|
|
2891
|
+
function co(e, t) {
|
|
2892
|
+
let n = so.indexOf(e);
|
|
2893
2893
|
if (n < 0) throw TypeError(`Invalid log level: ${JSON.stringify(e)}.`);
|
|
2894
|
-
let r =
|
|
2894
|
+
let r = so.indexOf(t);
|
|
2895
2895
|
if (r < 0) throw TypeError(`Invalid log level: ${JSON.stringify(t)}.`);
|
|
2896
2896
|
return n - r;
|
|
2897
2897
|
}
|
|
2898
2898
|
//#endregion
|
|
2899
2899
|
//#region node_modules/.pnpm/@logtape+logtape@1.3.7/node_modules/@logtape/logtape/dist/logger.js
|
|
2900
|
-
function
|
|
2901
|
-
return
|
|
2900
|
+
function lo(e = []) {
|
|
2901
|
+
return fo.getLogger(e);
|
|
2902
2902
|
}
|
|
2903
|
-
var
|
|
2903
|
+
var uo = Symbol.for("logtape.rootLogger"), fo = class e {
|
|
2904
2904
|
parent;
|
|
2905
2905
|
children;
|
|
2906
2906
|
category;
|
|
@@ -2910,8 +2910,8 @@ var lo = Symbol.for("logtape.rootLogger"), uo = class e {
|
|
|
2910
2910
|
lowestLevel = "trace";
|
|
2911
2911
|
contextLocalStorage;
|
|
2912
2912
|
static getLogger(t = []) {
|
|
2913
|
-
let n =
|
|
2914
|
-
return n ?? (n = new e(null, []), globalThis[
|
|
2913
|
+
let n = uo in globalThis ? globalThis[uo] ?? null : null;
|
|
2914
|
+
return n ?? (n = new e(null, []), globalThis[uo] = n), typeof t == "string" ? n.getChild(t) : t.length === 0 ? n : n.getChild(t);
|
|
2915
2915
|
}
|
|
2916
2916
|
constructor(e, t) {
|
|
2917
2917
|
this.parent = e, this.children = {}, this.category = t, this.sinks = [], this.filters = [];
|
|
@@ -2930,32 +2930,32 @@ var lo = Symbol.for("logtape.rootLogger"), uo = class e {
|
|
|
2930
2930
|
this.reset();
|
|
2931
2931
|
}
|
|
2932
2932
|
with(e) {
|
|
2933
|
-
return new
|
|
2933
|
+
return new po(this, { ...e });
|
|
2934
2934
|
}
|
|
2935
2935
|
filter(e) {
|
|
2936
2936
|
for (let t of this.filters) if (!t(e)) return !1;
|
|
2937
2937
|
return this.filters.length < 1 ? this.parent?.filter(e) ?? !0 : !0;
|
|
2938
2938
|
}
|
|
2939
2939
|
*getSinks(e) {
|
|
2940
|
-
if (!(this.lowestLevel === null ||
|
|
2940
|
+
if (!(this.lowestLevel === null || co(e, this.lowestLevel) < 0)) {
|
|
2941
2941
|
if (this.parent != null && this.parentSinks === "inherit") for (let t of this.parent.getSinks(e)) yield t;
|
|
2942
2942
|
for (let e of this.sinks) yield e;
|
|
2943
2943
|
}
|
|
2944
2944
|
}
|
|
2945
2945
|
emit(e, t) {
|
|
2946
|
-
let n =
|
|
2946
|
+
let n = Co(), r = "category" in e ? e.category : this.category, i = n.length > 0 ? [...n, ...r] : r, a = Object.getOwnPropertyDescriptors(e);
|
|
2947
2947
|
a.category = {
|
|
2948
2948
|
value: i,
|
|
2949
2949
|
enumerable: !0,
|
|
2950
2950
|
configurable: !0
|
|
2951
2951
|
};
|
|
2952
2952
|
let o = Object.defineProperties({}, a);
|
|
2953
|
-
if (!(this.lowestLevel === null ||
|
|
2953
|
+
if (!(this.lowestLevel === null || co(o.level, this.lowestLevel) < 0 || !this.filter(o))) {
|
|
2954
2954
|
for (let e of this.getSinks(o.level)) if (!t?.has(e)) try {
|
|
2955
2955
|
e(o);
|
|
2956
2956
|
} catch (n) {
|
|
2957
2957
|
let r = new Set(t);
|
|
2958
|
-
r.add(e),
|
|
2958
|
+
r.add(e), mo.log("fatal", "Failed to emit a log record to sink {sink}: {error}", {
|
|
2959
2959
|
sink: e,
|
|
2960
2960
|
error: n,
|
|
2961
2961
|
record: o
|
|
@@ -2964,12 +2964,12 @@ var lo = Symbol.for("logtape.rootLogger"), uo = class e {
|
|
|
2964
2964
|
}
|
|
2965
2965
|
}
|
|
2966
2966
|
log(e, t, n, r) {
|
|
2967
|
-
let i =
|
|
2967
|
+
let i = wo(), a, o = typeof n == "function" ? {
|
|
2968
2968
|
category: this.category,
|
|
2969
2969
|
level: e,
|
|
2970
2970
|
timestamp: Date.now(),
|
|
2971
2971
|
get message() {
|
|
2972
|
-
return
|
|
2972
|
+
return bo(t, this.properties);
|
|
2973
2973
|
},
|
|
2974
2974
|
rawMessage: t,
|
|
2975
2975
|
get properties() {
|
|
@@ -2982,7 +2982,7 @@ var lo = Symbol.for("logtape.rootLogger"), uo = class e {
|
|
|
2982
2982
|
category: this.category,
|
|
2983
2983
|
level: e,
|
|
2984
2984
|
timestamp: Date.now(),
|
|
2985
|
-
message:
|
|
2985
|
+
message: bo(t, {
|
|
2986
2986
|
...i,
|
|
2987
2987
|
...n
|
|
2988
2988
|
}),
|
|
@@ -2995,9 +2995,9 @@ var lo = Symbol.for("logtape.rootLogger"), uo = class e {
|
|
|
2995
2995
|
this.emit(o, r);
|
|
2996
2996
|
}
|
|
2997
2997
|
logLazily(e, t, n = {}) {
|
|
2998
|
-
let r =
|
|
2998
|
+
let r = wo(), i, a;
|
|
2999
2999
|
function o() {
|
|
3000
|
-
if ((a == null || i == null) && (a = t((e, ...t) => (i = e,
|
|
3000
|
+
if ((a == null || i == null) && (a = t((e, ...t) => (i = e, xo(e, t))), i == null)) throw TypeError("No log record was made.");
|
|
3001
3001
|
return [a, i];
|
|
3002
3002
|
}
|
|
3003
3003
|
this.emit({
|
|
@@ -3017,11 +3017,11 @@ var lo = Symbol.for("logtape.rootLogger"), uo = class e {
|
|
|
3017
3017
|
});
|
|
3018
3018
|
}
|
|
3019
3019
|
logTemplate(e, t, n, r = {}) {
|
|
3020
|
-
let i =
|
|
3020
|
+
let i = wo();
|
|
3021
3021
|
this.emit({
|
|
3022
3022
|
category: this.category,
|
|
3023
3023
|
level: e,
|
|
3024
|
-
message:
|
|
3024
|
+
message: xo(t, n),
|
|
3025
3025
|
rawMessage: t,
|
|
3026
3026
|
timestamp: Date.now(),
|
|
3027
3027
|
properties: {
|
|
@@ -3051,7 +3051,7 @@ var lo = Symbol.for("logtape.rootLogger"), uo = class e {
|
|
|
3051
3051
|
fatal(e, ...t) {
|
|
3052
3052
|
typeof e == "string" ? this.log("fatal", e, t[0] ?? {}) : typeof e == "function" ? this.logLazily("fatal", e) : Array.isArray(e) ? this.logTemplate("fatal", e, t) : this.log("fatal", "{*}", e);
|
|
3053
3053
|
}
|
|
3054
|
-
},
|
|
3054
|
+
}, po = class e {
|
|
3055
3055
|
logger;
|
|
3056
3056
|
properties;
|
|
3057
3057
|
constructor(e, t) {
|
|
@@ -3118,14 +3118,14 @@ var lo = Symbol.for("logtape.rootLogger"), uo = class e {
|
|
|
3118
3118
|
fatal(e, ...t) {
|
|
3119
3119
|
typeof e == "string" ? this.log("fatal", e, t[0] ?? {}) : typeof e == "function" ? this.logLazily("fatal", e) : Array.isArray(e) ? this.logTemplate("fatal", e, t) : this.log("fatal", "{*}", e);
|
|
3120
3120
|
}
|
|
3121
|
-
},
|
|
3122
|
-
function
|
|
3121
|
+
}, mo = fo.getLogger(["logtape", "meta"]);
|
|
3122
|
+
function ho(e) {
|
|
3123
3123
|
return e.includes(".") || e.includes("[") || e.includes("?.");
|
|
3124
3124
|
}
|
|
3125
|
-
function
|
|
3125
|
+
function go(e, t) {
|
|
3126
3126
|
if (!(t === "__proto__" || t === "prototype" || t === "constructor") && (typeof e == "object" || typeof e == "function") && e !== null) return Object.prototype.hasOwnProperty.call(e, t) ? e[t] : void 0;
|
|
3127
3127
|
}
|
|
3128
|
-
function
|
|
3128
|
+
function _o(e, t) {
|
|
3129
3129
|
let n = e.length, r = t;
|
|
3130
3130
|
if (r >= n) return null;
|
|
3131
3131
|
let i;
|
|
@@ -3203,25 +3203,25 @@ function go(e, t) {
|
|
|
3203
3203
|
nextIndex: r
|
|
3204
3204
|
};
|
|
3205
3205
|
}
|
|
3206
|
-
function
|
|
3207
|
-
if (typeof t == "string") return
|
|
3206
|
+
function vo(e, t) {
|
|
3207
|
+
if (typeof t == "string") return go(e, t);
|
|
3208
3208
|
if (Array.isArray(e) && t >= 0 && t < e.length) return e[t];
|
|
3209
3209
|
}
|
|
3210
|
-
function
|
|
3210
|
+
function yo(e, t) {
|
|
3211
3211
|
if (e == null || t.length === 0 || t.endsWith(".")) return;
|
|
3212
3212
|
let n = e, r = 0, i = t.length;
|
|
3213
3213
|
for (; r < i;) {
|
|
3214
3214
|
if (t.slice(r, r + 2) === "?.") {
|
|
3215
3215
|
if (r += 2, n == null) return;
|
|
3216
3216
|
} else if (n == null) return;
|
|
3217
|
-
let e =
|
|
3217
|
+
let e = _o(t, r);
|
|
3218
3218
|
if (e === null) return;
|
|
3219
3219
|
let { segment: i, nextIndex: a } = e;
|
|
3220
|
-
if (r = a, n =
|
|
3220
|
+
if (r = a, n = vo(n, i), n === void 0) return;
|
|
3221
3221
|
}
|
|
3222
3222
|
return n;
|
|
3223
3223
|
}
|
|
3224
|
-
function
|
|
3224
|
+
function bo(e, t) {
|
|
3225
3225
|
let n = e.length;
|
|
3226
3226
|
if (n === 0) return [""];
|
|
3227
3227
|
if (!e.includes("{")) return [e];
|
|
@@ -3238,28 +3238,28 @@ function yo(e, t) {
|
|
|
3238
3238
|
let s = e.slice(i, a);
|
|
3239
3239
|
r.push(s.replace(/{{/g, "{").replace(/}}/g, "}"));
|
|
3240
3240
|
let c = e.slice(a + 1, o), l, u = c.trim();
|
|
3241
|
-
u === "*" ? l = c in t ? t[c] : "*" in t ? t["*"] : t : (l = c === u || c in t ? t[c] : t[u], l === void 0 &&
|
|
3241
|
+
u === "*" ? l = c in t ? t[c] : "*" in t ? t["*"] : t : (l = c === u || c in t ? t[c] : t[u], l === void 0 && ho(u) && (l = yo(t, u))), r.push(l), a = o, i = a + 1;
|
|
3242
3242
|
} else o === "}" && a + 1 < n && e[a + 1] === "}" && a++;
|
|
3243
3243
|
}
|
|
3244
3244
|
let a = e.slice(i);
|
|
3245
3245
|
return r.push(a.replace(/{{/g, "{").replace(/}}/g, "}")), r;
|
|
3246
3246
|
}
|
|
3247
|
-
function
|
|
3247
|
+
function xo(e, t) {
|
|
3248
3248
|
let n = [];
|
|
3249
3249
|
for (let r = 0; r < e.length; r++) n.push(e[r]), r < t.length && n.push(t[r]);
|
|
3250
3250
|
return n;
|
|
3251
3251
|
}
|
|
3252
3252
|
//#endregion
|
|
3253
3253
|
//#region node_modules/.pnpm/@logtape+logtape@1.3.7/node_modules/@logtape/logtape/dist/context.js
|
|
3254
|
-
var
|
|
3255
|
-
function
|
|
3256
|
-
let e =
|
|
3254
|
+
var So = Symbol.for("logtape.categoryPrefix");
|
|
3255
|
+
function Co() {
|
|
3256
|
+
let e = fo.getLogger().contextLocalStorage?.getStore();
|
|
3257
3257
|
if (e == null) return [];
|
|
3258
|
-
let t = e[
|
|
3258
|
+
let t = e[So];
|
|
3259
3259
|
return Array.isArray(t) ? t : [];
|
|
3260
3260
|
}
|
|
3261
|
-
function
|
|
3262
|
-
let e =
|
|
3261
|
+
function wo() {
|
|
3262
|
+
let e = fo.getLogger().contextLocalStorage?.getStore();
|
|
3263
3263
|
if (e == null) return {};
|
|
3264
3264
|
let t = {};
|
|
3265
3265
|
for (let n of Object.keys(e)) t[n] = e[n];
|
|
@@ -3267,68 +3267,68 @@ function Co() {
|
|
|
3267
3267
|
}
|
|
3268
3268
|
//#endregion
|
|
3269
3269
|
//#region node_modules/.pnpm/@logtape+logtape@1.3.7/node_modules/@logtape/logtape/dist/util.js
|
|
3270
|
-
var
|
|
3271
|
-
function
|
|
3270
|
+
var To = /* @__PURE__ */ t({ inspect: () => Eo });
|
|
3271
|
+
function Eo(e, t) {
|
|
3272
3272
|
let n = t?.compact === !0 ? void 0 : 2;
|
|
3273
3273
|
return JSON.stringify(e, null, n);
|
|
3274
3274
|
}
|
|
3275
3275
|
//#endregion
|
|
3276
3276
|
//#region node_modules/.pnpm/@logtape+logtape@1.3.7/node_modules/@logtape/logtape/dist/formatter.js
|
|
3277
|
-
var
|
|
3277
|
+
var Do = {
|
|
3278
3278
|
trace: "TRC",
|
|
3279
3279
|
debug: "DBG",
|
|
3280
3280
|
info: "INF",
|
|
3281
3281
|
warning: "WRN",
|
|
3282
3282
|
error: "ERR",
|
|
3283
3283
|
fatal: "FTL"
|
|
3284
|
-
},
|
|
3284
|
+
}, Oo = typeof document < "u" || typeof navigator < "u" && navigator.product === "ReactNative" ? (e) => JSON.stringify(e) : "Deno" in globalThis && "inspect" in globalThis.Deno && typeof globalThis.Deno.inspect == "function" ? (e, t) => globalThis.Deno.inspect(e, {
|
|
3285
3285
|
strAbbreviateSize: Infinity,
|
|
3286
3286
|
iterableLimit: Infinity,
|
|
3287
3287
|
...t
|
|
3288
|
-
}) :
|
|
3288
|
+
}) : To != null && "inspect" in To && typeof Eo == "function" ? (e, t) => Eo(e, {
|
|
3289
3289
|
maxArrayLength: Infinity,
|
|
3290
3290
|
maxStringLength: Infinity,
|
|
3291
3291
|
...t
|
|
3292
3292
|
}) : (e) => JSON.stringify(e);
|
|
3293
|
-
function
|
|
3293
|
+
function ko(e) {
|
|
3294
3294
|
return e < 10 ? `0${e}` : `${e}`;
|
|
3295
3295
|
}
|
|
3296
|
-
function
|
|
3296
|
+
function Ao(e) {
|
|
3297
3297
|
return e < 10 ? `00${e}` : e < 100 ? `0${e}` : `${e}`;
|
|
3298
3298
|
}
|
|
3299
|
-
var
|
|
3299
|
+
var jo = {
|
|
3300
3300
|
"date-time-timezone": (e) => {
|
|
3301
3301
|
let t = new Date(e);
|
|
3302
|
-
return `${t.getUTCFullYear()}-${
|
|
3302
|
+
return `${t.getUTCFullYear()}-${ko(t.getUTCMonth() + 1)}-${ko(t.getUTCDate())} ${ko(t.getUTCHours())}:${ko(t.getUTCMinutes())}:${ko(t.getUTCSeconds())}.${Ao(t.getUTCMilliseconds())} +00:00`;
|
|
3303
3303
|
},
|
|
3304
3304
|
"date-time-tz": (e) => {
|
|
3305
3305
|
let t = new Date(e);
|
|
3306
|
-
return `${t.getUTCFullYear()}-${
|
|
3306
|
+
return `${t.getUTCFullYear()}-${ko(t.getUTCMonth() + 1)}-${ko(t.getUTCDate())} ${ko(t.getUTCHours())}:${ko(t.getUTCMinutes())}:${ko(t.getUTCSeconds())}.${Ao(t.getUTCMilliseconds())} +00`;
|
|
3307
3307
|
},
|
|
3308
3308
|
"date-time": (e) => {
|
|
3309
3309
|
let t = new Date(e);
|
|
3310
|
-
return `${t.getUTCFullYear()}-${
|
|
3310
|
+
return `${t.getUTCFullYear()}-${ko(t.getUTCMonth() + 1)}-${ko(t.getUTCDate())} ${ko(t.getUTCHours())}:${ko(t.getUTCMinutes())}:${ko(t.getUTCSeconds())}.${Ao(t.getUTCMilliseconds())}`;
|
|
3311
3311
|
},
|
|
3312
3312
|
"time-timezone": (e) => {
|
|
3313
3313
|
let t = new Date(e);
|
|
3314
|
-
return `${
|
|
3314
|
+
return `${ko(t.getUTCHours())}:${ko(t.getUTCMinutes())}:${ko(t.getUTCSeconds())}.${Ao(t.getUTCMilliseconds())} +00:00`;
|
|
3315
3315
|
},
|
|
3316
3316
|
"time-tz": (e) => {
|
|
3317
3317
|
let t = new Date(e);
|
|
3318
|
-
return `${
|
|
3318
|
+
return `${ko(t.getUTCHours())}:${ko(t.getUTCMinutes())}:${ko(t.getUTCSeconds())}.${Ao(t.getUTCMilliseconds())} +00`;
|
|
3319
3319
|
},
|
|
3320
3320
|
time: (e) => {
|
|
3321
3321
|
let t = new Date(e);
|
|
3322
|
-
return `${
|
|
3322
|
+
return `${ko(t.getUTCHours())}:${ko(t.getUTCMinutes())}:${ko(t.getUTCSeconds())}.${Ao(t.getUTCMilliseconds())}`;
|
|
3323
3323
|
},
|
|
3324
3324
|
date: (e) => {
|
|
3325
3325
|
let t = new Date(e);
|
|
3326
|
-
return `${t.getUTCFullYear()}-${
|
|
3326
|
+
return `${t.getUTCFullYear()}-${ko(t.getUTCMonth() + 1)}-${ko(t.getUTCDate())}`;
|
|
3327
3327
|
},
|
|
3328
3328
|
rfc3339: (e) => new Date(e).toISOString(),
|
|
3329
3329
|
none: () => null
|
|
3330
|
-
},
|
|
3331
|
-
ABBR:
|
|
3330
|
+
}, Mo = {
|
|
3331
|
+
ABBR: Do,
|
|
3332
3332
|
abbr: {
|
|
3333
3333
|
trace: "trc",
|
|
3334
3334
|
debug: "dbg",
|
|
@@ -3370,13 +3370,13 @@ var Ao = {
|
|
|
3370
3370
|
fatal: "f"
|
|
3371
3371
|
}
|
|
3372
3372
|
};
|
|
3373
|
-
function
|
|
3373
|
+
function No(e = {}) {
|
|
3374
3374
|
let t = (() => {
|
|
3375
3375
|
let t = e.timestamp;
|
|
3376
|
-
return t == null ?
|
|
3377
|
-
})(), n = e.category ?? "·", r = e.value ? (t) => e.value(t,
|
|
3376
|
+
return t == null ? jo["date-time-timezone"] : t === "disabled" ? jo.none : typeof t == "string" && t in jo ? jo[t] : t;
|
|
3377
|
+
})(), n = e.category ?? "·", r = e.value ? (t) => e.value(t, Oo) : Oo, i = (() => {
|
|
3378
3378
|
let t = e.level;
|
|
3379
|
-
return t == null || t === "ABBR" ? (e) =>
|
|
3379
|
+
return t == null || t === "ABBR" ? (e) => Mo.ABBR[e] : t === "abbr" ? (e) => Mo.abbr[e] : t === "FULL" ? (e) => Mo.FULL[e] : t === "full" ? (e) => Mo.full[e] : t === "L" ? (e) => Mo.L[e] : t === "l" ? (e) => Mo.l[e] : t;
|
|
3380
3380
|
})(), a = e.format ?? (({ timestamp: e, level: t, category: n, message: r }) => `${e ? `${e} ` : ""}[${t}] ${n}: ${r}`);
|
|
3381
3381
|
return (e) => {
|
|
3382
3382
|
let o = e.message, s = o.length, c;
|
|
@@ -3398,8 +3398,8 @@ function Mo(e = {}) {
|
|
|
3398
3398
|
})}\n`;
|
|
3399
3399
|
};
|
|
3400
3400
|
}
|
|
3401
|
-
|
|
3402
|
-
var
|
|
3401
|
+
No();
|
|
3402
|
+
var Po = "\x1B[0m", Fo = {
|
|
3403
3403
|
black: "\x1B[30m",
|
|
3404
3404
|
red: "\x1B[31m",
|
|
3405
3405
|
green: "\x1B[32m",
|
|
@@ -3408,13 +3408,13 @@ var No = "\x1B[0m", Po = {
|
|
|
3408
3408
|
magenta: "\x1B[35m",
|
|
3409
3409
|
cyan: "\x1B[36m",
|
|
3410
3410
|
white: "\x1B[37m"
|
|
3411
|
-
},
|
|
3411
|
+
}, Io = {
|
|
3412
3412
|
bold: "\x1B[1m",
|
|
3413
3413
|
dim: "\x1B[2m",
|
|
3414
3414
|
italic: "\x1B[3m",
|
|
3415
3415
|
underline: "\x1B[4m",
|
|
3416
3416
|
strikethrough: "\x1B[9m"
|
|
3417
|
-
},
|
|
3417
|
+
}, Lo = {
|
|
3418
3418
|
trace: null,
|
|
3419
3419
|
debug: "blue",
|
|
3420
3420
|
info: "green",
|
|
@@ -3422,9 +3422,9 @@ var No = "\x1B[0m", Po = {
|
|
|
3422
3422
|
error: "red",
|
|
3423
3423
|
fatal: "magenta"
|
|
3424
3424
|
};
|
|
3425
|
-
function
|
|
3426
|
-
let t = e.format, n = e.timestampStyle === void 0 ? "dim" : e.timestampStyle, r = e.timestampColor ?? null, i = `${n == null ? "" :
|
|
3427
|
-
return
|
|
3425
|
+
function Ro(e = {}) {
|
|
3426
|
+
let t = e.format, n = e.timestampStyle === void 0 ? "dim" : e.timestampStyle, r = e.timestampColor ?? null, i = `${n == null ? "" : Io[n]}${r == null ? "" : Fo[r]}`, a = n == null && r == null ? "" : Po, o = e.levelStyle === void 0 ? "bold" : e.levelStyle, s = e.levelColors ?? Lo, c = e.categoryStyle === void 0 ? "dim" : e.categoryStyle, l = e.categoryColor ?? null, u = `${c == null ? "" : Io[c]}${l == null ? "" : Fo[l]}`, d = c == null && l == null ? "" : Po;
|
|
3427
|
+
return No({
|
|
3428
3428
|
timestamp: "date-time-tz",
|
|
3429
3429
|
value(e, t) {
|
|
3430
3430
|
return t(e, { colors: !0 });
|
|
@@ -3432,7 +3432,7 @@ function Lo(e = {}) {
|
|
|
3432
3432
|
...e,
|
|
3433
3433
|
format({ timestamp: e, level: n, category: r, message: c, record: l }) {
|
|
3434
3434
|
let f = s[l.level];
|
|
3435
|
-
return e = `${i}${e}${a}`, n = `${o == null ? "" :
|
|
3435
|
+
return e = `${i}${e}${a}`, n = `${o == null ? "" : Io[o]}${f == null ? "" : Fo[f]}${n}${o == null && f == null ? "" : Po}`, t == null ? `${e} ${n} ${u}${r}:${d} ${c}` : t({
|
|
3436
3436
|
timestamp: e,
|
|
3437
3437
|
level: n,
|
|
3438
3438
|
category: `${u}${r}${d}`,
|
|
@@ -3442,8 +3442,8 @@ function Lo(e = {}) {
|
|
|
3442
3442
|
}
|
|
3443
3443
|
});
|
|
3444
3444
|
}
|
|
3445
|
-
|
|
3446
|
-
function
|
|
3445
|
+
Ro();
|
|
3446
|
+
function zo(e = {}) {
|
|
3447
3447
|
if (!e.categorySeparator && !e.message && !e.properties) return (e) => {
|
|
3448
3448
|
if (e.message.length === 3) return JSON.stringify({
|
|
3449
3449
|
"@timestamp": new Date(e.timestamp).toISOString(),
|
|
@@ -3509,8 +3509,8 @@ function Ro(e = {}) {
|
|
|
3509
3509
|
...i(e.properties)
|
|
3510
3510
|
}) + "\n";
|
|
3511
3511
|
}
|
|
3512
|
-
|
|
3513
|
-
var
|
|
3512
|
+
zo();
|
|
3513
|
+
var Bo = {
|
|
3514
3514
|
trace: "background-color: gray; color: white;",
|
|
3515
3515
|
debug: "background-color: gray; color: white;",
|
|
3516
3516
|
info: "background-color: white; color: black;",
|
|
@@ -3518,14 +3518,14 @@ var zo = {
|
|
|
3518
3518
|
error: "background-color: red; color: white;",
|
|
3519
3519
|
fatal: "background-color: maroon; color: white;"
|
|
3520
3520
|
};
|
|
3521
|
-
function
|
|
3521
|
+
function Vo(e) {
|
|
3522
3522
|
let t = "", n = [];
|
|
3523
3523
|
for (let r = 0; r < e.message.length; r++) r % 2 == 0 ? t += e.message[r] : (t += "%o", n.push(e.message[r]));
|
|
3524
3524
|
let r = new Date(e.timestamp);
|
|
3525
3525
|
return [
|
|
3526
|
-
`%c${`${r.getUTCHours().toString().padStart(2, "0")}:${r.getUTCMinutes().toString().padStart(2, "0")}:${r.getUTCSeconds().toString().padStart(2, "0")}.${r.getUTCMilliseconds().toString().padStart(3, "0")}`} %c${
|
|
3526
|
+
`%c${`${r.getUTCHours().toString().padStart(2, "0")}:${r.getUTCMinutes().toString().padStart(2, "0")}:${r.getUTCSeconds().toString().padStart(2, "0")}.${r.getUTCMilliseconds().toString().padStart(3, "0")}`} %c${Do[e.level]}%c %c${e.category.join("·")} %c${t}`,
|
|
3527
3527
|
"color: gray;",
|
|
3528
|
-
|
|
3528
|
+
Bo[e.level],
|
|
3529
3529
|
"background-color: default;",
|
|
3530
3530
|
"color: gray;",
|
|
3531
3531
|
"color: default;",
|
|
@@ -3534,8 +3534,8 @@ function Bo(e) {
|
|
|
3534
3534
|
}
|
|
3535
3535
|
//#endregion
|
|
3536
3536
|
//#region node_modules/.pnpm/@logtape+logtape@1.3.7/node_modules/@logtape/logtape/dist/sink.js
|
|
3537
|
-
function
|
|
3538
|
-
let t = e.formatter ??
|
|
3537
|
+
function Ho(e = {}) {
|
|
3538
|
+
let t = e.formatter ?? Vo, n = {
|
|
3539
3539
|
trace: "debug",
|
|
3540
3540
|
debug: "debug",
|
|
3541
3541
|
info: "info",
|
|
@@ -3579,87 +3579,87 @@ function Vo(e = {}) {
|
|
|
3579
3579
|
}
|
|
3580
3580
|
//#endregion
|
|
3581
3581
|
//#region node_modules/.pnpm/@logtape+logtape@1.3.7/node_modules/@logtape/logtape/dist/config.js
|
|
3582
|
-
var
|
|
3583
|
-
function
|
|
3582
|
+
var Uo = null, Wo = /* @__PURE__ */ new Set(), Go = /* @__PURE__ */ new Set(), Ko = /* @__PURE__ */ new Set();
|
|
3583
|
+
function qo(e) {
|
|
3584
3584
|
return e.category.length === 0 || e.category.length === 1 && e.category[0] === "logtape" || e.category.length === 2 && e.category[0] === "logtape" && e.category[1] === "meta";
|
|
3585
3585
|
}
|
|
3586
|
-
function
|
|
3587
|
-
if (
|
|
3588
|
-
if (
|
|
3589
|
-
|
|
3586
|
+
function Jo(e) {
|
|
3587
|
+
if (Uo != null && !e.reset) throw new es("Already configured; if you want to reset, turn on the reset flag.");
|
|
3588
|
+
if (Ko.size > 0) throw new es("Previously configured async disposables are still active. Use configure() instead or explicitly dispose them using dispose().");
|
|
3589
|
+
Xo();
|
|
3590
3590
|
try {
|
|
3591
|
-
|
|
3591
|
+
Yo(e, !1);
|
|
3592
3592
|
} catch (e) {
|
|
3593
|
-
throw e instanceof
|
|
3593
|
+
throw e instanceof es && Xo(), e;
|
|
3594
3594
|
}
|
|
3595
3595
|
}
|
|
3596
|
-
function
|
|
3597
|
-
|
|
3596
|
+
function Yo(e, t) {
|
|
3597
|
+
Uo = e;
|
|
3598
3598
|
let n = !1, r = /* @__PURE__ */ new Set();
|
|
3599
3599
|
for (let t of e.loggers) {
|
|
3600
|
-
|
|
3600
|
+
qo(t) && (n = !0);
|
|
3601
3601
|
let i = Array.isArray(t.category) ? JSON.stringify(t.category) : JSON.stringify([t.category]);
|
|
3602
|
-
if (r.has(i)) throw new
|
|
3602
|
+
if (r.has(i)) throw new es(`Duplicate logger configuration for category: ${i}. Each category can only be configured once.`);
|
|
3603
3603
|
r.add(i);
|
|
3604
|
-
let a =
|
|
3604
|
+
let a = fo.getLogger(t.category);
|
|
3605
3605
|
for (let n of t.sinks ?? []) {
|
|
3606
3606
|
let t = e.sinks[n];
|
|
3607
|
-
if (!t) throw new
|
|
3607
|
+
if (!t) throw new es(`Sink not found: ${n}.`);
|
|
3608
3608
|
a.sinks.push(t);
|
|
3609
3609
|
}
|
|
3610
3610
|
a.parentSinks = t.parentSinks ?? "inherit", t.lowestLevel !== void 0 && (a.lowestLevel = t.lowestLevel);
|
|
3611
3611
|
for (let n of t.filters ?? []) {
|
|
3612
3612
|
let t = e.filters?.[n];
|
|
3613
|
-
if (t === void 0) throw new
|
|
3614
|
-
a.filters.push(
|
|
3613
|
+
if (t === void 0) throw new es(`Filter not found: ${n}.`);
|
|
3614
|
+
a.filters.push(ao(t));
|
|
3615
3615
|
}
|
|
3616
|
-
|
|
3616
|
+
Wo.add(a);
|
|
3617
3617
|
}
|
|
3618
|
-
|
|
3618
|
+
fo.getLogger().contextLocalStorage = e.contextLocalStorage;
|
|
3619
3619
|
for (let n of Object.values(e.sinks)) {
|
|
3620
|
-
if (Symbol.asyncDispose in n) if (t)
|
|
3621
|
-
else throw new
|
|
3622
|
-
Symbol.dispose in n &&
|
|
3620
|
+
if (Symbol.asyncDispose in n) if (t) Ko.add(n);
|
|
3621
|
+
else throw new es("Async disposables cannot be used with configureSync().");
|
|
3622
|
+
Symbol.dispose in n && Go.add(n);
|
|
3623
3623
|
}
|
|
3624
3624
|
for (let n of Object.values(e.filters ?? {})) if (!(n == null || typeof n == "string")) {
|
|
3625
|
-
if (Symbol.asyncDispose in n) if (t)
|
|
3626
|
-
else throw new
|
|
3627
|
-
Symbol.dispose in n &&
|
|
3625
|
+
if (Symbol.asyncDispose in n) if (t) Ko.add(n);
|
|
3626
|
+
else throw new es("Async disposables cannot be used with configureSync().");
|
|
3627
|
+
Symbol.dispose in n && Go.add(n);
|
|
3628
3628
|
}
|
|
3629
3629
|
if (typeof globalThis.EdgeRuntime != "string" && "process" in globalThis && !("Deno" in globalThis)) {
|
|
3630
3630
|
let e = globalThis.process, n = e?.on;
|
|
3631
|
-
typeof n == "function" && n.call(e, "exit", t ?
|
|
3632
|
-
} else addEventListener("unload", t ?
|
|
3633
|
-
let i =
|
|
3634
|
-
n || i.sinks.push(
|
|
3631
|
+
typeof n == "function" && n.call(e, "exit", t ? Qo : $o);
|
|
3632
|
+
} else addEventListener("unload", t ? Qo : $o);
|
|
3633
|
+
let i = fo.getLogger(["logtape", "meta"]);
|
|
3634
|
+
n || i.sinks.push(Ho()), i.info("LogTape loggers are configured. Note that LogTape itself uses the meta logger, which has category {metaLoggerCategory}. The meta logger purposes to log internal errors such as sink exceptions. If you are seeing this message, the meta logger is automatically configured. It's recommended to configure the meta logger with a separate sink so that you can easily notice if logging itself fails or is misconfigured. To turn off this message, configure the meta logger with higher log levels than {dismissLevel}. See also <https://logtape.org/manual/categories#meta-logger>.", {
|
|
3635
3635
|
metaLoggerCategory: ["logtape", "meta"],
|
|
3636
3636
|
dismissLevel: "info"
|
|
3637
3637
|
});
|
|
3638
3638
|
}
|
|
3639
|
-
function Yo() {
|
|
3640
|
-
Qo(), Xo();
|
|
3641
|
-
}
|
|
3642
3639
|
function Xo() {
|
|
3643
|
-
|
|
3644
|
-
|
|
3640
|
+
$o(), Zo();
|
|
3641
|
+
}
|
|
3642
|
+
function Zo() {
|
|
3643
|
+
let e = fo.getLogger([]);
|
|
3644
|
+
e.resetDescendants(), delete e.contextLocalStorage, Wo.clear(), Uo = null;
|
|
3645
3645
|
}
|
|
3646
|
-
async function
|
|
3647
|
-
|
|
3646
|
+
async function Qo() {
|
|
3647
|
+
$o();
|
|
3648
3648
|
let e = [];
|
|
3649
|
-
for (let t of
|
|
3649
|
+
for (let t of Ko) e.push(t[Symbol.asyncDispose]()), Ko.delete(t);
|
|
3650
3650
|
await Promise.all(e);
|
|
3651
3651
|
}
|
|
3652
|
-
function
|
|
3653
|
-
for (let e of
|
|
3654
|
-
|
|
3652
|
+
function $o() {
|
|
3653
|
+
for (let e of Go) e[Symbol.dispose]();
|
|
3654
|
+
Go.clear();
|
|
3655
3655
|
}
|
|
3656
|
-
var
|
|
3656
|
+
var es = class extends Error {
|
|
3657
3657
|
constructor(e) {
|
|
3658
3658
|
super(e), this.name = "ConfigureError";
|
|
3659
3659
|
}
|
|
3660
|
-
},
|
|
3660
|
+
}, O = class {
|
|
3661
3661
|
static getLogger(e = []) {
|
|
3662
|
-
return
|
|
3662
|
+
return lo(["@cmts-dev/carmentis-sdk-core", ...e]);
|
|
3663
3663
|
}
|
|
3664
3664
|
static getProviderLogger() {
|
|
3665
3665
|
return this.getLogger(["provider"]);
|
|
@@ -3671,8 +3671,8 @@ var $o = class extends Error {
|
|
|
3671
3671
|
this.enableLogsSync();
|
|
3672
3672
|
}
|
|
3673
3673
|
static enableLogsSync() {
|
|
3674
|
-
|
|
3675
|
-
sinks: { console:
|
|
3674
|
+
Jo({
|
|
3675
|
+
sinks: { console: Ho() },
|
|
3676
3676
|
loggers: [{
|
|
3677
3677
|
category: "@cmts-dev/carmentis-sdk-core",
|
|
3678
3678
|
lowestLevel: "debug",
|
|
@@ -3698,51 +3698,51 @@ var $o = class extends Error {
|
|
|
3698
3698
|
static getMicroblockStructureCheckerLogger() {
|
|
3699
3699
|
return this.getLogger(["microblock", "structure-checker"]);
|
|
3700
3700
|
}
|
|
3701
|
-
},
|
|
3702
|
-
numberToHexa:
|
|
3703
|
-
truncateString:
|
|
3704
|
-
truncateStringMiddle:
|
|
3705
|
-
getNullHash:
|
|
3706
|
-
getTimestampInSeconds:
|
|
3707
|
-
encodeDay:
|
|
3708
|
-
decodeDay:
|
|
3709
|
-
dateToDay:
|
|
3710
|
-
dayToDate:
|
|
3711
|
-
addDaysToTimestamp:
|
|
3712
|
-
timestampDifferenceInDays:
|
|
3713
|
-
bufferToUint8Array:
|
|
3714
|
-
binaryToHexa:
|
|
3715
|
-
binaryFromHexa:
|
|
3716
|
-
binaryFrom:
|
|
3717
|
-
binaryIsEqual:
|
|
3718
|
-
binaryCompare:
|
|
3719
|
-
intToByteArray:
|
|
3720
|
-
byteArrayToInt:
|
|
3721
|
-
getGenesisEpochInTimestamp:
|
|
3722
|
-
jsonPrettify:
|
|
3723
|
-
},
|
|
3724
|
-
function
|
|
3701
|
+
}, k = {
|
|
3702
|
+
numberToHexa: ns,
|
|
3703
|
+
truncateString: rs,
|
|
3704
|
+
truncateStringMiddle: is,
|
|
3705
|
+
getNullHash: as,
|
|
3706
|
+
getTimestampInSeconds: os,
|
|
3707
|
+
encodeDay: cs,
|
|
3708
|
+
decodeDay: ls,
|
|
3709
|
+
dateToDay: us,
|
|
3710
|
+
dayToDate: ds,
|
|
3711
|
+
addDaysToTimestamp: fs,
|
|
3712
|
+
timestampDifferenceInDays: ps,
|
|
3713
|
+
bufferToUint8Array: ms,
|
|
3714
|
+
binaryToHexa: hs,
|
|
3715
|
+
binaryFromHexa: gs,
|
|
3716
|
+
binaryFrom: _s,
|
|
3717
|
+
binaryIsEqual: vs,
|
|
3718
|
+
binaryCompare: ys,
|
|
3719
|
+
intToByteArray: bs,
|
|
3720
|
+
byteArrayToInt: xs,
|
|
3721
|
+
getGenesisEpochInTimestamp: ss,
|
|
3722
|
+
jsonPrettify: Ss
|
|
3723
|
+
}, ts = O.getLogger(["utils"]);
|
|
3724
|
+
function ns(e, t) {
|
|
3725
3725
|
return e.toString(16).toUpperCase().padStart(t || 1, "0");
|
|
3726
3726
|
}
|
|
3727
|
-
function
|
|
3727
|
+
function rs(e, t) {
|
|
3728
3728
|
return e.slice(0, t) + (e.length > t ? "(...)" : "");
|
|
3729
3729
|
}
|
|
3730
|
-
function
|
|
3730
|
+
function is(e, t, n) {
|
|
3731
3731
|
return e.length <= t + n ? e : e.slice(0, t) + "(...)" + e.slice(e.length - n);
|
|
3732
3732
|
}
|
|
3733
|
-
function
|
|
3733
|
+
function as() {
|
|
3734
3734
|
return new Uint8Array(32);
|
|
3735
3735
|
}
|
|
3736
|
-
function
|
|
3736
|
+
function os() {
|
|
3737
3737
|
return Math.floor(Date.now() / 1e3);
|
|
3738
3738
|
}
|
|
3739
|
-
function
|
|
3739
|
+
function ss() {
|
|
3740
3740
|
return 0;
|
|
3741
3741
|
}
|
|
3742
|
-
function
|
|
3742
|
+
function cs(e, t, n) {
|
|
3743
3743
|
return e << 9 | t << 5 | n;
|
|
3744
3744
|
}
|
|
3745
|
-
function
|
|
3745
|
+
function ls(e) {
|
|
3746
3746
|
let t = e & 31, n = e >> 5 & 15;
|
|
3747
3747
|
return [
|
|
3748
3748
|
e >>> 9,
|
|
@@ -3750,49 +3750,49 @@ function cs(e) {
|
|
|
3750
3750
|
t
|
|
3751
3751
|
];
|
|
3752
3752
|
}
|
|
3753
|
-
function
|
|
3753
|
+
function us(e) {
|
|
3754
3754
|
let t = e.getDate(), n = e.getMonth() + 1;
|
|
3755
|
-
return
|
|
3755
|
+
return cs(e.getFullYear(), n, t);
|
|
3756
3756
|
}
|
|
3757
|
-
function
|
|
3758
|
-
let [t, n, r] =
|
|
3757
|
+
function ds(e) {
|
|
3758
|
+
let [t, n, r] = ls(e);
|
|
3759
3759
|
return new Date(Date.UTC(t, n - 1, r));
|
|
3760
3760
|
}
|
|
3761
|
-
function
|
|
3761
|
+
function fs(e, t) {
|
|
3762
3762
|
let n = /* @__PURE__ */ new Date(e * 1e3);
|
|
3763
3763
|
return Math.floor(Date.UTC(n.getUTCFullYear(), n.getUTCMonth(), n.getUTCDate() + t) / 1e3);
|
|
3764
3764
|
}
|
|
3765
|
-
function
|
|
3765
|
+
function ps(e, t) {
|
|
3766
3766
|
return Math.round((t - e) / 86400);
|
|
3767
3767
|
}
|
|
3768
|
-
function
|
|
3768
|
+
function ms(e) {
|
|
3769
3769
|
return new Uint8Array(e.buffer, e.byteOffset, e.byteLength / Uint8Array.BYTES_PER_ELEMENT);
|
|
3770
3770
|
}
|
|
3771
|
-
function
|
|
3771
|
+
function hs(e) {
|
|
3772
3772
|
return [...e].map((e) => e.toString(16).toUpperCase().padStart(2, "0")).join("");
|
|
3773
3773
|
}
|
|
3774
|
-
function
|
|
3774
|
+
function gs(e) {
|
|
3775
3775
|
if (typeof e != "string") throw new i(`Expecting hex-string value: received ${typeof e}`);
|
|
3776
3776
|
if (!e.match(/^([\da-f]{2})*$/gi)) throw new i(`Expecting hex-string value: received '${e}'`);
|
|
3777
3777
|
let t = (e.match(/../g) || []).map((e) => parseInt(e, 16));
|
|
3778
3778
|
return new Uint8Array(t);
|
|
3779
3779
|
}
|
|
3780
|
-
function
|
|
3780
|
+
function _s(...e) {
|
|
3781
3781
|
let t = Array(e.length), n = Array(e.length), r = 0;
|
|
3782
3782
|
e.forEach((i, a) => {
|
|
3783
|
-
let o =
|
|
3783
|
+
let o = ro.getType(i);
|
|
3784
3784
|
switch (o) {
|
|
3785
3785
|
case 4:
|
|
3786
|
-
n[a] = new Uint8Array(
|
|
3786
|
+
n[a] = new Uint8Array(bs(i));
|
|
3787
3787
|
break;
|
|
3788
3788
|
case 3:
|
|
3789
|
-
n[a] =
|
|
3789
|
+
n[a] = Qa.encode(i);
|
|
3790
3790
|
break;
|
|
3791
3791
|
case 12:
|
|
3792
3792
|
n[a] = i;
|
|
3793
3793
|
break;
|
|
3794
3794
|
default: {
|
|
3795
|
-
let t = e.length, n = e.map((e) => Pn[
|
|
3795
|
+
let t = e.length, n = e.map((e) => Pn[ro.getType(e)]).join(", ");
|
|
3796
3796
|
throw Error(`unsupported type '${Pn[o]}' for Utils.binaryFrom(): got ${t} arguments of type ${n}`);
|
|
3797
3797
|
}
|
|
3798
3798
|
}
|
|
@@ -3803,32 +3803,32 @@ function gs(...e) {
|
|
|
3803
3803
|
i.set(n[t], e);
|
|
3804
3804
|
}), i;
|
|
3805
3805
|
}
|
|
3806
|
-
function
|
|
3806
|
+
function vs(e, t) {
|
|
3807
3807
|
if (!(e instanceof Uint8Array)) throw Error(`Excepted Uint8array, got ${typeof e}`);
|
|
3808
3808
|
if (!(t instanceof Uint8Array)) throw Error(`Excepted Uint8array, got ${typeof t}`);
|
|
3809
3809
|
let n = new Uint8Array(e.buffer, e.byteOffset, e.byteLength), r = new Uint8Array(t.buffer, t.byteOffset, t.byteLength);
|
|
3810
|
-
if (n.byteLength !== r.byteLength) return
|
|
3811
|
-
for (let e = 0; e < n.byteLength; e++) if (n[e] !== r[e]) return
|
|
3812
|
-
return
|
|
3810
|
+
if (n.byteLength !== r.byteLength) return ts.debug(`Comparison result is false (distinct length): ${n.byteLength} != ${r.byteLength}`), !1;
|
|
3811
|
+
for (let e = 0; e < n.byteLength; e++) if (n[e] !== r[e]) return ts.debug(`Comparison result is false (distinct value): ${n[e]} != ${r[e]}`), !1;
|
|
3812
|
+
return ts.debug("Comparison result is true"), !0;
|
|
3813
3813
|
}
|
|
3814
|
-
function
|
|
3814
|
+
function ys(e, t) {
|
|
3815
3815
|
if (!(e instanceof Uint8Array) || !(t instanceof Uint8Array) || e.length != t.length) throw "cannot compare";
|
|
3816
3816
|
for (let n in e) if (e[n] < t[n]) return -1;
|
|
3817
3817
|
else if (e[n] > t[n]) return 1;
|
|
3818
3818
|
return 0;
|
|
3819
3819
|
}
|
|
3820
|
-
function
|
|
3820
|
+
function bs(e, t = 1) {
|
|
3821
3821
|
let n = [], r = e, i = t;
|
|
3822
3822
|
for (; r > 0 || i > 0;) n.push(r & 255), r = Math.floor(r / 256), i--;
|
|
3823
3823
|
return n.reverse();
|
|
3824
3824
|
}
|
|
3825
|
-
function
|
|
3825
|
+
function xs(e) {
|
|
3826
3826
|
return e.reduce((e, t) => e * 256 + t, 0);
|
|
3827
3827
|
}
|
|
3828
|
-
function
|
|
3828
|
+
function Ss(e, t = 2) {
|
|
3829
3829
|
return JSON.stringify(e, (e, t) => {
|
|
3830
3830
|
if (t instanceof Uint8Array) {
|
|
3831
|
-
let e = t.length > 32, n =
|
|
3831
|
+
let e = t.length > 32, n = hs(t.slice(0, e ? 24 : 32)), r = e ? "(...)" + hs(t.slice(-8)) : "";
|
|
3832
3832
|
return `Uint8Array[${t.length}]:${n}${r}`;
|
|
3833
3833
|
}
|
|
3834
3834
|
return t;
|
|
@@ -3836,45 +3836,45 @@ function xs(e, t = 2) {
|
|
|
3836
3836
|
}
|
|
3837
3837
|
//#endregion
|
|
3838
3838
|
//#region node_modules/.pnpm/@noble+hashes@1.8.0/node_modules/@noble/hashes/esm/crypto.js
|
|
3839
|
-
var
|
|
3839
|
+
var Cs = typeof globalThis == "object" && "crypto" in globalThis ? globalThis.crypto : void 0;
|
|
3840
3840
|
//#endregion
|
|
3841
3841
|
//#region node_modules/.pnpm/@noble+hashes@1.8.0/node_modules/@noble/hashes/esm/utils.js
|
|
3842
|
-
function
|
|
3842
|
+
function ws(e) {
|
|
3843
3843
|
return e instanceof Uint8Array || ArrayBuffer.isView(e) && e.constructor.name === "Uint8Array";
|
|
3844
3844
|
}
|
|
3845
|
-
function
|
|
3845
|
+
function Ts(e) {
|
|
3846
3846
|
if (!Number.isSafeInteger(e) || e < 0) throw Error("positive integer expected, got " + e);
|
|
3847
3847
|
}
|
|
3848
|
-
function
|
|
3849
|
-
if (!
|
|
3848
|
+
function Es(e, ...t) {
|
|
3849
|
+
if (!ws(e)) throw Error("Uint8Array expected");
|
|
3850
3850
|
if (t.length > 0 && !t.includes(e.length)) throw Error("Uint8Array expected of length " + t + ", got length=" + e.length);
|
|
3851
3851
|
}
|
|
3852
|
-
function
|
|
3852
|
+
function Ds(e) {
|
|
3853
3853
|
if (typeof e != "function" || typeof e.create != "function") throw Error("Hash should be wrapped by utils.createHasher");
|
|
3854
|
-
|
|
3854
|
+
Ts(e.outputLen), Ts(e.blockLen);
|
|
3855
3855
|
}
|
|
3856
|
-
function
|
|
3856
|
+
function Os(e, t = !0) {
|
|
3857
3857
|
if (e.destroyed) throw Error("Hash instance has been destroyed");
|
|
3858
3858
|
if (t && e.finished) throw Error("Hash#digest() has already been called");
|
|
3859
3859
|
}
|
|
3860
|
-
function
|
|
3861
|
-
|
|
3860
|
+
function ks(e, t) {
|
|
3861
|
+
Es(e);
|
|
3862
3862
|
let n = t.outputLen;
|
|
3863
3863
|
if (e.length < n) throw Error("digestInto() expects output buffer of length at least " + n);
|
|
3864
3864
|
}
|
|
3865
|
-
function
|
|
3865
|
+
function As(e) {
|
|
3866
3866
|
return new Uint32Array(e.buffer, e.byteOffset, Math.floor(e.byteLength / 4));
|
|
3867
3867
|
}
|
|
3868
|
-
function
|
|
3868
|
+
function js(...e) {
|
|
3869
3869
|
for (let t = 0; t < e.length; t++) e[t].fill(0);
|
|
3870
3870
|
}
|
|
3871
|
-
function
|
|
3871
|
+
function Ms(e) {
|
|
3872
3872
|
return new DataView(e.buffer, e.byteOffset, e.byteLength);
|
|
3873
3873
|
}
|
|
3874
|
-
function
|
|
3874
|
+
function Ns(e, t) {
|
|
3875
3875
|
return e << 32 - t | e >>> t;
|
|
3876
3876
|
}
|
|
3877
|
-
function
|
|
3877
|
+
function A(e, t) {
|
|
3878
3878
|
return e << t | e >>> 32 - t >>> 0;
|
|
3879
3879
|
}
|
|
3880
3880
|
var Ps = new Uint8Array(new Uint32Array([287454020]).buffer)[0] === 68;
|
|
@@ -3919,16 +3919,16 @@ function Hs(e) {
|
|
|
3919
3919
|
return new Uint8Array(new TextEncoder().encode(e));
|
|
3920
3920
|
}
|
|
3921
3921
|
function Us(e) {
|
|
3922
|
-
return typeof e == "string" && (e = Hs(e)),
|
|
3922
|
+
return typeof e == "string" && (e = Hs(e)), Es(e), e;
|
|
3923
3923
|
}
|
|
3924
3924
|
function Ws(e) {
|
|
3925
|
-
return typeof e == "string" && (e = Hs(e)),
|
|
3925
|
+
return typeof e == "string" && (e = Hs(e)), Es(e), e;
|
|
3926
3926
|
}
|
|
3927
3927
|
function Gs(...e) {
|
|
3928
3928
|
let t = 0;
|
|
3929
3929
|
for (let n = 0; n < e.length; n++) {
|
|
3930
3930
|
let r = e[n];
|
|
3931
|
-
|
|
3931
|
+
Es(r), t += r.length;
|
|
3932
3932
|
}
|
|
3933
3933
|
let n = new Uint8Array(t);
|
|
3934
3934
|
for (let t = 0, r = 0; t < e.length; t++) {
|
|
@@ -3951,8 +3951,8 @@ function Ys(e) {
|
|
|
3951
3951
|
return t.outputLen = n.outputLen, t.blockLen = n.blockLen, t.create = (t) => e(t), t;
|
|
3952
3952
|
}
|
|
3953
3953
|
function Xs(e = 32) {
|
|
3954
|
-
if (
|
|
3955
|
-
if (
|
|
3954
|
+
if (Cs && typeof Cs.getRandomValues == "function") return Cs.getRandomValues(new Uint8Array(e));
|
|
3955
|
+
if (Cs && typeof Cs.randomBytes == "function") return Uint8Array.from(Cs.randomBytes(e));
|
|
3956
3956
|
throw Error("crypto.getRandomValues must be defined");
|
|
3957
3957
|
}
|
|
3958
3958
|
//#endregion
|
|
@@ -3972,7 +3972,7 @@ function $s(e) {
|
|
|
3972
3972
|
}
|
|
3973
3973
|
function ec() {
|
|
3974
3974
|
let e = Qs(32);
|
|
3975
|
-
return
|
|
3975
|
+
return k.binaryToHexa(e);
|
|
3976
3976
|
}
|
|
3977
3977
|
//#endregion
|
|
3978
3978
|
//#region node_modules/.pnpm/@noble+hashes@1.8.0/node_modules/@noble/hashes/esm/_md.js
|
|
@@ -3989,15 +3989,15 @@ function rc(e, t, n) {
|
|
|
3989
3989
|
}
|
|
3990
3990
|
var ic = class extends qs {
|
|
3991
3991
|
constructor(e, t, n, r) {
|
|
3992
|
-
super(), this.finished = !1, this.length = 0, this.pos = 0, this.destroyed = !1, this.blockLen = e, this.outputLen = t, this.padOffset = n, this.isLE = r, this.buffer = new Uint8Array(e), this.view =
|
|
3992
|
+
super(), this.finished = !1, this.length = 0, this.pos = 0, this.destroyed = !1, this.blockLen = e, this.outputLen = t, this.padOffset = n, this.isLE = r, this.buffer = new Uint8Array(e), this.view = Ms(this.buffer);
|
|
3993
3993
|
}
|
|
3994
3994
|
update(e) {
|
|
3995
|
-
|
|
3995
|
+
Os(this), e = Us(e), Es(e);
|
|
3996
3996
|
let { view: t, buffer: n, blockLen: r } = this, i = e.length;
|
|
3997
3997
|
for (let a = 0; a < i;) {
|
|
3998
3998
|
let o = Math.min(r - this.pos, i - a);
|
|
3999
3999
|
if (o === r) {
|
|
4000
|
-
let t =
|
|
4000
|
+
let t = Ms(e);
|
|
4001
4001
|
for (; r <= i - a; a += r) this.process(t, a);
|
|
4002
4002
|
continue;
|
|
4003
4003
|
}
|
|
@@ -4006,12 +4006,12 @@ var ic = class extends qs {
|
|
|
4006
4006
|
return this.length += e.length, this.roundClean(), this;
|
|
4007
4007
|
}
|
|
4008
4008
|
digestInto(e) {
|
|
4009
|
-
|
|
4009
|
+
Os(this), ks(e, this), this.finished = !0;
|
|
4010
4010
|
let { buffer: t, view: n, blockLen: r, isLE: i } = this, { pos: a } = this;
|
|
4011
|
-
t[a++] = 128,
|
|
4011
|
+
t[a++] = 128, js(this.buffer.subarray(a)), this.padOffset > r - a && (this.process(n, 0), a = 0);
|
|
4012
4012
|
for (let e = a; e < r; e++) t[e] = 0;
|
|
4013
4013
|
tc(n, r - 8, BigInt(this.length * 8), i), this.process(n, 0);
|
|
4014
|
-
let o =
|
|
4014
|
+
let o = Ms(e), s = this.outputLen;
|
|
4015
4015
|
if (s % 4) throw Error("_sha2: outputLen should be aligned to 32bit");
|
|
4016
4016
|
let c = s / 4, l = this.get();
|
|
4017
4017
|
if (c > l.length) throw Error("_sha2: outputLen bigger than state");
|
|
@@ -4197,21 +4197,21 @@ var wc = (e, t, n) => (e >>> 0) + (t >>> 0) + (n >>> 0), Tc = (e, t, n, r) => t
|
|
|
4197
4197
|
process(e, t) {
|
|
4198
4198
|
for (let n = 0; n < 16; n++, t += 4) jc[n] = e.getUint32(t, !1);
|
|
4199
4199
|
for (let e = 16; e < 64; e++) {
|
|
4200
|
-
let t = jc[e - 15], n = jc[e - 2], r =
|
|
4201
|
-
jc[e] = (
|
|
4200
|
+
let t = jc[e - 15], n = jc[e - 2], r = Ns(t, 7) ^ Ns(t, 18) ^ t >>> 3;
|
|
4201
|
+
jc[e] = (Ns(n, 17) ^ Ns(n, 19) ^ n >>> 10) + jc[e - 7] + r + jc[e - 16] | 0;
|
|
4202
4202
|
}
|
|
4203
4203
|
let { A: n, B: r, C: i, D: a, E: o, F: s, G: c, H: l } = this;
|
|
4204
4204
|
for (let e = 0; e < 64; e++) {
|
|
4205
|
-
let t =
|
|
4205
|
+
let t = Ns(o, 6) ^ Ns(o, 11) ^ Ns(o, 25), u = l + t + nc(o, s, c) + Ac[e] + jc[e] | 0, d = (Ns(n, 2) ^ Ns(n, 13) ^ Ns(n, 22)) + rc(n, r, i) | 0;
|
|
4206
4206
|
l = c, c = s, s = o, o = a + u | 0, a = i, i = r, r = n, n = u + d | 0;
|
|
4207
4207
|
}
|
|
4208
4208
|
n = n + this.A | 0, r = r + this.B | 0, i = i + this.C | 0, a = a + this.D | 0, o = o + this.E | 0, s = s + this.F | 0, c = c + this.G | 0, l = l + this.H | 0, this.set(n, r, i, a, o, s, c, l);
|
|
4209
4209
|
}
|
|
4210
4210
|
roundClean() {
|
|
4211
|
-
|
|
4211
|
+
js(jc);
|
|
4212
4212
|
}
|
|
4213
4213
|
destroy() {
|
|
4214
|
-
this.set(0, 0, 0, 0, 0, 0, 0, 0),
|
|
4214
|
+
this.set(0, 0, 0, 0, 0, 0, 0, 0), js(this.buffer);
|
|
4215
4215
|
}
|
|
4216
4216
|
}, Nc = class extends Mc {
|
|
4217
4217
|
constructor() {
|
|
@@ -4261,10 +4261,10 @@ var wc = (e, t, n) => (e >>> 0) + (t >>> 0) + (n >>> 0), Tc = (e, t, n, r) => t
|
|
|
4261
4261
|
({h: n, l: r} = Cc(this.Ah | 0, this.Al | 0, n | 0, r | 0)), {h: i, l: a} = Cc(this.Bh | 0, this.Bl | 0, i | 0, a | 0), {h: o, l: s} = Cc(this.Ch | 0, this.Cl | 0, o | 0, s | 0), {h: c, l: l} = Cc(this.Dh | 0, this.Dl | 0, c | 0, l | 0), {h: u, l: d} = Cc(this.Eh | 0, this.El | 0, u | 0, d | 0), {h: f, l: p} = Cc(this.Fh | 0, this.Fl | 0, f | 0, p | 0), {h: m, l: h} = Cc(this.Gh | 0, this.Gl | 0, m | 0, h | 0), {h: g, l: _} = Cc(this.Hh | 0, this.Hl | 0, g | 0, _ | 0), this.set(n, r, i, a, o, s, c, l, u, d, f, p, m, h, g, _);
|
|
4262
4262
|
}
|
|
4263
4263
|
roundClean() {
|
|
4264
|
-
|
|
4264
|
+
js(Lc, Rc);
|
|
4265
4265
|
}
|
|
4266
4266
|
destroy() {
|
|
4267
|
-
|
|
4267
|
+
js(this.buffer), this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
|
|
4268
4268
|
}
|
|
4269
4269
|
}, Bc = class extends zc {
|
|
4270
4270
|
constructor() {
|
|
@@ -4318,20 +4318,20 @@ var wc = (e, t, n) => (e >>> 0) + (t >>> 0) + (n >>> 0), Tc = (e, t, n, r) => t
|
|
|
4318
4318
|
sha512AsBinary: tl,
|
|
4319
4319
|
sha512: nl
|
|
4320
4320
|
};
|
|
4321
|
-
|
|
4321
|
+
O.getLogger(["utils", "crypto"]);
|
|
4322
4322
|
function $c(e) {
|
|
4323
4323
|
if (!(e instanceof Uint8Array)) throw new m(`Argument passed to compute sha256 is not an instance of Uint8Array: got ${typeof e}`);
|
|
4324
4324
|
return Gc(e);
|
|
4325
4325
|
}
|
|
4326
4326
|
function el(e) {
|
|
4327
|
-
return
|
|
4327
|
+
return k.binaryToHexa($c(e));
|
|
4328
4328
|
}
|
|
4329
4329
|
function tl(e) {
|
|
4330
4330
|
if (!(e instanceof Uint8Array)) throw "Argument passed to compute sha512 is not an instance of Uint8Array";
|
|
4331
4331
|
return Zc(e);
|
|
4332
4332
|
}
|
|
4333
4333
|
function nl(e) {
|
|
4334
|
-
return
|
|
4334
|
+
return k.binaryToHexa(tl(e));
|
|
4335
4335
|
}
|
|
4336
4336
|
//#endregion
|
|
4337
4337
|
//#region node_modules/.pnpm/@noble+ciphers@1.3.0/node_modules/@noble/ciphers/esm/utils.js
|
|
@@ -4750,7 +4750,7 @@ var au = /* @__PURE__ */ Cl({
|
|
|
4750
4750
|
return ul(...s), d;
|
|
4751
4751
|
}
|
|
4752
4752
|
};
|
|
4753
|
-
}), ou =
|
|
4753
|
+
}), ou = O.getLogger(["crypto", "aes-gcm"]), su = {
|
|
4754
4754
|
encryptGcm: cu,
|
|
4755
4755
|
decryptGcm: lu
|
|
4756
4756
|
};
|
|
@@ -4793,12 +4793,12 @@ function wu(e, t = 24) {
|
|
|
4793
4793
|
}
|
|
4794
4794
|
e[0] ^= bu[r], e[1] ^= xu[r];
|
|
4795
4795
|
}
|
|
4796
|
-
|
|
4796
|
+
js(n);
|
|
4797
4797
|
}
|
|
4798
4798
|
var Tu = class e extends qs {
|
|
4799
4799
|
constructor(e, t, n, r = !1, i = 24) {
|
|
4800
|
-
if (super(), this.pos = 0, this.posOut = 0, this.finished = !1, this.destroyed = !1, this.enableXOF = !1, this.blockLen = e, this.suffix = t, this.outputLen = n, this.enableXOF = r, this.rounds = i,
|
|
4801
|
-
this.state = new Uint8Array(200), this.state32 =
|
|
4800
|
+
if (super(), this.pos = 0, this.posOut = 0, this.finished = !1, this.destroyed = !1, this.enableXOF = !1, this.blockLen = e, this.suffix = t, this.outputLen = n, this.enableXOF = r, this.rounds = i, Ts(n), !(0 < e && e < 200)) throw Error("only keccak-f1600 function is supported");
|
|
4801
|
+
this.state = new Uint8Array(200), this.state32 = As(this.state);
|
|
4802
4802
|
}
|
|
4803
4803
|
clone() {
|
|
4804
4804
|
return this._cloneInto();
|
|
@@ -4807,7 +4807,7 @@ var Tu = class e extends qs {
|
|
|
4807
4807
|
Ls(this.state32), wu(this.state32, this.rounds), Ls(this.state32), this.posOut = 0, this.pos = 0;
|
|
4808
4808
|
}
|
|
4809
4809
|
update(e) {
|
|
4810
|
-
|
|
4810
|
+
Os(this), e = Us(e), Es(e);
|
|
4811
4811
|
let { blockLen: t, state: n } = this, r = e.length;
|
|
4812
4812
|
for (let i = 0; i < r;) {
|
|
4813
4813
|
let a = Math.min(t - this.pos, r - i);
|
|
@@ -4823,7 +4823,7 @@ var Tu = class e extends qs {
|
|
|
4823
4823
|
e[n] ^= t, t & 128 && n === r - 1 && this.keccak(), e[r - 1] ^= 128, this.keccak();
|
|
4824
4824
|
}
|
|
4825
4825
|
writeInto(e) {
|
|
4826
|
-
|
|
4826
|
+
Os(this, !1), Es(e), this.finish();
|
|
4827
4827
|
let t = this.state, { blockLen: n } = this;
|
|
4828
4828
|
for (let r = 0, i = e.length; r < i;) {
|
|
4829
4829
|
this.posOut >= n && this.keccak();
|
|
@@ -4837,17 +4837,17 @@ var Tu = class e extends qs {
|
|
|
4837
4837
|
return this.writeInto(e);
|
|
4838
4838
|
}
|
|
4839
4839
|
xof(e) {
|
|
4840
|
-
return
|
|
4840
|
+
return Ts(e), this.xofInto(new Uint8Array(e));
|
|
4841
4841
|
}
|
|
4842
4842
|
digestInto(e) {
|
|
4843
|
-
if (
|
|
4843
|
+
if (ks(e, this), this.finished) throw Error("digest() was already called");
|
|
4844
4844
|
return this.writeInto(e), this.destroy(), e;
|
|
4845
4845
|
}
|
|
4846
4846
|
digest() {
|
|
4847
4847
|
return this.digestInto(new Uint8Array(this.outputLen));
|
|
4848
4848
|
}
|
|
4849
4849
|
destroy() {
|
|
4850
|
-
this.destroyed = !0,
|
|
4850
|
+
this.destroyed = !0, js(this.state);
|
|
4851
4851
|
}
|
|
4852
4852
|
_cloneInto(t) {
|
|
4853
4853
|
let { blockLen: n, suffix: r, outputLen: i, rounds: a, enableXOF: o } = this;
|
|
@@ -4855,7 +4855,7 @@ var Tu = class e extends qs {
|
|
|
4855
4855
|
}
|
|
4856
4856
|
}, Eu = (e, t, n) => Js(() => new Tu(t, e, n)), Du = Eu(6, 144, 224 / 8), Ou = Eu(6, 136, 256 / 8), ku = Eu(6, 104, 384 / 8), Au = Eu(6, 72, 512 / 8);
|
|
4857
4857
|
Eu(1, 144, 224 / 8), Eu(1, 136, 256 / 8), Eu(1, 104, 384 / 8), Eu(1, 72, 512 / 8);
|
|
4858
|
-
var ju = (e, t, n) => Ys((r = {}) => new Tu(t, e, r.dkLen === void 0 ? n : r.dkLen, !0)), Mu = ju(31, 168, 128 / 8), Nu = ju(31, 136, 256 / 8), Pu =
|
|
4858
|
+
var ju = (e, t, n) => Ys((r = {}) => new Tu(t, e, r.dkLen === void 0 ? n : r.dkLen, !0)), Mu = ju(31, 168, 128 / 8), Nu = ju(31, 136, 256 / 8), Pu = Es, Fu = Xs;
|
|
4859
4859
|
function Iu(e, t) {
|
|
4860
4860
|
if (e.length !== t.length) return !1;
|
|
4861
4861
|
let n = 0;
|
|
@@ -5457,7 +5457,7 @@ function Id(e) {
|
|
|
5457
5457
|
return t;
|
|
5458
5458
|
}
|
|
5459
5459
|
function Ld(e, t, n, r) {
|
|
5460
|
-
let i = e(r * Cd / 4, t, n), a = new Uint16Array(Cd), o =
|
|
5460
|
+
let i = e(r * Cd / 4, t, n), a = new Uint16Array(Cd), o = As(i), s = 0;
|
|
5461
5461
|
for (let e = 0, t = 0, n = 0, i = 0; e < o.length; e++) {
|
|
5462
5462
|
let c = o[e];
|
|
5463
5463
|
for (let e = 0; e < 32; e++) n += c & 1, c >>= 1, s += 1, s === r ? (i = n, n = 0) : s === 2 * r && (a[t++] = Td(i - n), n = 0, s = 0);
|
|
@@ -5591,7 +5591,7 @@ function Kd(e, t) {
|
|
|
5591
5591
|
//#region node_modules/.pnpm/@noble+hashes@1.8.0/node_modules/@noble/hashes/esm/sha256.js
|
|
5592
5592
|
var qd = Gc, Jd = class extends qs {
|
|
5593
5593
|
constructor(e, t) {
|
|
5594
|
-
super(), this.finished = !1, this.destroyed = !1,
|
|
5594
|
+
super(), this.finished = !1, this.destroyed = !1, Ds(e);
|
|
5595
5595
|
let n = Us(t);
|
|
5596
5596
|
if (this.iHash = e.create(), typeof this.iHash.update != "function") throw Error("Expected instance of class which extends utils.Hash");
|
|
5597
5597
|
this.blockLen = this.iHash.blockLen, this.outputLen = this.iHash.outputLen;
|
|
@@ -5600,13 +5600,13 @@ var qd = Gc, Jd = class extends qs {
|
|
|
5600
5600
|
for (let e = 0; e < i.length; e++) i[e] ^= 54;
|
|
5601
5601
|
this.iHash.update(i), this.oHash = e.create();
|
|
5602
5602
|
for (let e = 0; e < i.length; e++) i[e] ^= 106;
|
|
5603
|
-
this.oHash.update(i),
|
|
5603
|
+
this.oHash.update(i), js(i);
|
|
5604
5604
|
}
|
|
5605
5605
|
update(e) {
|
|
5606
|
-
return
|
|
5606
|
+
return Os(this), this.iHash.update(e), this;
|
|
5607
5607
|
}
|
|
5608
5608
|
digestInto(e) {
|
|
5609
|
-
|
|
5609
|
+
Os(this), Es(e, this.outputLen), this.finished = !0, this.iHash.digestInto(e), this.oHash.update(e), this.oHash.digestInto(e), this.destroy();
|
|
5610
5610
|
}
|
|
5611
5611
|
digest() {
|
|
5612
5612
|
let e = new Uint8Array(this.oHash.outputLen);
|
|
@@ -6831,46 +6831,46 @@ var Pm = /* @__PURE__ */ I({
|
|
|
6831
6831
|
protocolVersionName: /* @__PURE__ */ L(),
|
|
6832
6832
|
changeLog: /* @__PURE__ */ L(),
|
|
6833
6833
|
protocolVariables: Rm
|
|
6834
|
-
}), Bm = /* @__PURE__ */ Xp({ type: /* @__PURE__ */ P(
|
|
6835
|
-
type: /* @__PURE__ */ P(
|
|
6834
|
+
}), Bm = /* @__PURE__ */ Xp({ type: /* @__PURE__ */ P(D.CUSTOM) }, /* @__PURE__ */ nm()), Vm = /* @__PURE__ */ I({
|
|
6835
|
+
type: /* @__PURE__ */ P(D.SIGNATURE),
|
|
6836
6836
|
signature: V(),
|
|
6837
6837
|
schemeId: Cm()
|
|
6838
6838
|
}), Hm = /* @__PURE__ */ I({
|
|
6839
|
-
type: /* @__PURE__ */ P(
|
|
6839
|
+
type: /* @__PURE__ */ P(D.AUXILIARY_SIGNATURE),
|
|
6840
6840
|
tag: bm(),
|
|
6841
6841
|
signature: V(),
|
|
6842
6842
|
schemeId: Cm()
|
|
6843
6843
|
}), Um = /* @__PURE__ */ I({
|
|
6844
|
-
type: /* @__PURE__ */ P(
|
|
6844
|
+
type: /* @__PURE__ */ P(D.ALLOWED_ADDITIONAL_WRITER),
|
|
6845
6845
|
allowedWriterAccountId: V()
|
|
6846
6846
|
}), Wm = /* @__PURE__ */ I({
|
|
6847
|
-
type: /* @__PURE__ */ P(
|
|
6847
|
+
type: /* @__PURE__ */ P(D.PROTOCOL_CREATION),
|
|
6848
6848
|
organizationId: Am()
|
|
6849
6849
|
}), Gm = /* @__PURE__ */ I({
|
|
6850
|
-
type: /* @__PURE__ */ P(
|
|
6850
|
+
type: /* @__PURE__ */ P(D.PROTOCOL_UPDATE),
|
|
6851
6851
|
...zm.entries
|
|
6852
6852
|
}), Km = /* @__PURE__ */ I({
|
|
6853
|
-
type: /* @__PURE__ */ P(
|
|
6853
|
+
type: /* @__PURE__ */ P(D.PROTOCOL_VARIABLES),
|
|
6854
6854
|
protocolVariables: /* @__PURE__ */ Wp()
|
|
6855
6855
|
}), qm = /* @__PURE__ */ I({
|
|
6856
|
-
type: /* @__PURE__ */ P(
|
|
6856
|
+
type: /* @__PURE__ */ P(D.ACCOUNT_PUBLIC_KEY),
|
|
6857
6857
|
publicKey: V(),
|
|
6858
6858
|
schemeId: Cm()
|
|
6859
6859
|
}), Jm = /* @__PURE__ */ I({
|
|
6860
|
-
type: /* @__PURE__ */ P(
|
|
6860
|
+
type: /* @__PURE__ */ P(D.ACCOUNT_TOKEN_ISSUANCE),
|
|
6861
6861
|
amount: B()
|
|
6862
6862
|
}), Ym = /* @__PURE__ */ I({
|
|
6863
|
-
type: /* @__PURE__ */ P(
|
|
6863
|
+
type: /* @__PURE__ */ P(D.ACCOUNT_CREATION),
|
|
6864
6864
|
sellerAccount: Am(),
|
|
6865
6865
|
amount: B()
|
|
6866
6866
|
}), Xm = /* @__PURE__ */ I({
|
|
6867
|
-
type: /* @__PURE__ */ P(
|
|
6867
|
+
type: /* @__PURE__ */ P(D.ACCOUNT_TRANSFER),
|
|
6868
6868
|
account: Am(),
|
|
6869
6869
|
amount: B(),
|
|
6870
6870
|
publicReference: bm(),
|
|
6871
6871
|
privateReference: bm()
|
|
6872
6872
|
}), Zm = /* @__PURE__ */ I({
|
|
6873
|
-
type: /* @__PURE__ */ P(
|
|
6873
|
+
type: /* @__PURE__ */ P(D.ACCOUNT_VESTING_TRANSFER),
|
|
6874
6874
|
account: Am(),
|
|
6875
6875
|
amount: B(),
|
|
6876
6876
|
publicReference: bm(),
|
|
@@ -6878,7 +6878,7 @@ var Pm = /* @__PURE__ */ I({
|
|
|
6878
6878
|
cliffDurationDays: B(),
|
|
6879
6879
|
vestingDurationDays: B()
|
|
6880
6880
|
}), Qm = /* @__PURE__ */ I({
|
|
6881
|
-
type: /* @__PURE__ */ P(
|
|
6881
|
+
type: /* @__PURE__ */ P(D.ACCOUNT_ESCROW_TRANSFER),
|
|
6882
6882
|
account: Am(),
|
|
6883
6883
|
amount: B(),
|
|
6884
6884
|
publicReference: bm(),
|
|
@@ -6887,88 +6887,88 @@ var Pm = /* @__PURE__ */ I({
|
|
|
6887
6887
|
agentAccount: Am(),
|
|
6888
6888
|
durationDays: B()
|
|
6889
6889
|
}), $m = /* @__PURE__ */ I({
|
|
6890
|
-
type: /* @__PURE__ */ P(
|
|
6890
|
+
type: /* @__PURE__ */ P(D.ACCOUNT_ESCROW_SETTLEMENT),
|
|
6891
6891
|
escrowIdentifier: Am(),
|
|
6892
6892
|
confirmed: xm()
|
|
6893
6893
|
}), eh = /* @__PURE__ */ I({
|
|
6894
|
-
type: /* @__PURE__ */ P(
|
|
6894
|
+
type: /* @__PURE__ */ P(D.ACCOUNT_STAKE),
|
|
6895
6895
|
amount: B(),
|
|
6896
6896
|
objectType: B(),
|
|
6897
6897
|
objectIdentifier: Am()
|
|
6898
6898
|
}), th = /* @__PURE__ */ I({
|
|
6899
|
-
type: /* @__PURE__ */ P(
|
|
6899
|
+
type: /* @__PURE__ */ P(D.ACCOUNT_UNSTAKE),
|
|
6900
6900
|
amount: B(),
|
|
6901
6901
|
objectType: B(),
|
|
6902
6902
|
objectIdentifier: Am()
|
|
6903
6903
|
}), nh = /* @__PURE__ */ I({
|
|
6904
|
-
type: /* @__PURE__ */ P(
|
|
6904
|
+
type: /* @__PURE__ */ P(D.VN_CREATION),
|
|
6905
6905
|
organizationId: Am()
|
|
6906
6906
|
}), rh = /* @__PURE__ */ I({
|
|
6907
|
-
type: /* @__PURE__ */ P(
|
|
6907
|
+
type: /* @__PURE__ */ P(D.VN_COMETBFT_PUBLIC_KEY_DECLARATION),
|
|
6908
6908
|
cometPublicKeyType: bm(),
|
|
6909
6909
|
cometPublicKey: bm()
|
|
6910
6910
|
}), ih = /* @__PURE__ */ I({
|
|
6911
|
-
type: /* @__PURE__ */ P(
|
|
6911
|
+
type: /* @__PURE__ */ P(D.VN_RPC_ENDPOINT),
|
|
6912
6912
|
rpcEndpoint: bm()
|
|
6913
6913
|
}), ah = /* @__PURE__ */ I({
|
|
6914
|
-
type: /* @__PURE__ */ P(
|
|
6914
|
+
type: /* @__PURE__ */ P(D.VN_APPROVAL),
|
|
6915
6915
|
status: xm()
|
|
6916
6916
|
}), oh = /* @__PURE__ */ I({
|
|
6917
|
-
type: /* @__PURE__ */ P(
|
|
6917
|
+
type: /* @__PURE__ */ P(D.VN_SLASHING_CANCELLATION),
|
|
6918
6918
|
reason: bm()
|
|
6919
6919
|
}), sh = /* @__PURE__ */ I({
|
|
6920
|
-
type: /* @__PURE__ */ P(
|
|
6920
|
+
type: /* @__PURE__ */ P(D.ORG_CREATION),
|
|
6921
6921
|
accountId: Am()
|
|
6922
6922
|
}), ch = /* @__PURE__ */ I({
|
|
6923
|
-
type: /* @__PURE__ */ P(
|
|
6923
|
+
type: /* @__PURE__ */ P(D.ORG_DESCRIPTION),
|
|
6924
6924
|
name: bm(),
|
|
6925
6925
|
city: bm(),
|
|
6926
6926
|
countryCode: bm(),
|
|
6927
6927
|
website: bm(),
|
|
6928
6928
|
misc: /* @__PURE__ */ Zp(/* @__PURE__ */ $p(/* @__PURE__ */ L(), /* @__PURE__ */ L()))
|
|
6929
6929
|
}), lh = /* @__PURE__ */ I({
|
|
6930
|
-
type: /* @__PURE__ */ P(
|
|
6930
|
+
type: /* @__PURE__ */ P(D.APP_CREATION),
|
|
6931
6931
|
organizationId: Am()
|
|
6932
6932
|
}), uh = /* @__PURE__ */ I({
|
|
6933
|
-
type: /* @__PURE__ */ P(
|
|
6933
|
+
type: /* @__PURE__ */ P(D.APP_DESCRIPTION),
|
|
6934
6934
|
name: bm(),
|
|
6935
6935
|
logoUrl: bm(),
|
|
6936
6936
|
homepageUrl: bm(),
|
|
6937
6937
|
description: bm(),
|
|
6938
6938
|
misc: /* @__PURE__ */ Zp(/* @__PURE__ */ $p(/* @__PURE__ */ L(), /* @__PURE__ */ L()))
|
|
6939
6939
|
}), dh = /* @__PURE__ */ I({
|
|
6940
|
-
type: /* @__PURE__ */ P(
|
|
6940
|
+
type: /* @__PURE__ */ P(D.APP_LEDGER_ALLOWED_SIG_SCHEMES),
|
|
6941
6941
|
schemeIds: /* @__PURE__ */ N(Cm())
|
|
6942
6942
|
}), fh = /* @__PURE__ */ I({
|
|
6943
|
-
type: /* @__PURE__ */ P(
|
|
6943
|
+
type: /* @__PURE__ */ P(D.APP_LEDGER_ALLOWED_PKE_SCHEMES),
|
|
6944
6944
|
schemeIds: /* @__PURE__ */ N(Cm())
|
|
6945
6945
|
}), ph = /* @__PURE__ */ I({
|
|
6946
|
-
type: /* @__PURE__ */ P(
|
|
6946
|
+
type: /* @__PURE__ */ P(D.APP_LEDGER_CREATION),
|
|
6947
6947
|
applicationId: Am()
|
|
6948
6948
|
}), mh = /* @__PURE__ */ I({
|
|
6949
|
-
type: /* @__PURE__ */ P(
|
|
6949
|
+
type: /* @__PURE__ */ P(D.APP_LEDGER_ACTOR_CREATION),
|
|
6950
6950
|
id: B(),
|
|
6951
6951
|
actorType: B(),
|
|
6952
6952
|
name: bm()
|
|
6953
6953
|
}), hh = /* @__PURE__ */ I({
|
|
6954
|
-
type: /* @__PURE__ */ P(
|
|
6954
|
+
type: /* @__PURE__ */ P(D.APP_LEDGER_CHANNEL_CREATION),
|
|
6955
6955
|
id: B(),
|
|
6956
6956
|
isPrivate: xm(),
|
|
6957
6957
|
creatorId: B(),
|
|
6958
6958
|
name: bm()
|
|
6959
6959
|
}), gh = /* @__PURE__ */ I({
|
|
6960
|
-
type: /* @__PURE__ */ P(
|
|
6960
|
+
type: /* @__PURE__ */ P(D.APP_LEDGER_SHARED_SECRET),
|
|
6961
6961
|
hostId: B(),
|
|
6962
6962
|
guestId: B(),
|
|
6963
6963
|
encryptedSharedKey: V()
|
|
6964
6964
|
}), _h = /* @__PURE__ */ I({
|
|
6965
|
-
type: /* @__PURE__ */ P(
|
|
6965
|
+
type: /* @__PURE__ */ P(D.APP_LEDGER_CHANNEL_INVITATION),
|
|
6966
6966
|
channelId: B(),
|
|
6967
6967
|
hostId: B(),
|
|
6968
6968
|
guestId: B(),
|
|
6969
6969
|
encryptedChannelKey: V()
|
|
6970
6970
|
}), vh = /* @__PURE__ */ I({
|
|
6971
|
-
type: /* @__PURE__ */ P(
|
|
6971
|
+
type: /* @__PURE__ */ P(D.APP_LEDGER_ACTOR_SUBSCRIPTION),
|
|
6972
6972
|
actorId: B(),
|
|
6973
6973
|
actorType: B(),
|
|
6974
6974
|
organizationId: Am(),
|
|
@@ -6977,19 +6977,19 @@ var Pm = /* @__PURE__ */ I({
|
|
|
6977
6977
|
pkeSchemeId: Cm(),
|
|
6978
6978
|
pkePublicKey: V()
|
|
6979
6979
|
}), yh = /* @__PURE__ */ I({
|
|
6980
|
-
type: /* @__PURE__ */ P(
|
|
6980
|
+
type: /* @__PURE__ */ P(D.APP_LEDGER_PUBLIC_CHANNEL_DATA),
|
|
6981
6981
|
channelId: B(),
|
|
6982
6982
|
data: V()
|
|
6983
6983
|
}), bh = /* @__PURE__ */ I({
|
|
6984
|
-
type: /* @__PURE__ */ P(
|
|
6984
|
+
type: /* @__PURE__ */ P(D.APP_LEDGER_PRIVATE_CHANNEL_DATA),
|
|
6985
6985
|
channelId: B(),
|
|
6986
6986
|
merkleRootHash: Am(),
|
|
6987
6987
|
encryptedData: V()
|
|
6988
6988
|
}), xh = /* @__PURE__ */ I({
|
|
6989
|
-
type: /* @__PURE__ */ P(
|
|
6989
|
+
type: /* @__PURE__ */ P(D.APP_LEDGER_AUTHOR),
|
|
6990
6990
|
authorId: B()
|
|
6991
6991
|
}), Sh = /* @__PURE__ */ I({
|
|
6992
|
-
type: /* @__PURE__ */ P(
|
|
6992
|
+
type: /* @__PURE__ */ P(D.APP_LEDGER_ENDORSEMENT_REQUEST),
|
|
6993
6993
|
endorserId: B(),
|
|
6994
6994
|
message: bm()
|
|
6995
6995
|
}), Ch = /* @__PURE__ */ rm("type", [
|
|
@@ -7199,7 +7199,8 @@ var Pm = /* @__PURE__ */ I({
|
|
|
7199
7199
|
chainReference: Yh
|
|
7200
7200
|
}), lg = /* @__PURE__ */ N(cg), ug = /* @__PURE__ */ I({
|
|
7201
7201
|
accountHash: V(),
|
|
7202
|
-
lastKnownHistoryHash: V()
|
|
7202
|
+
lastKnownHistoryHash: V(),
|
|
7203
|
+
firstHistoryHash: /* @__PURE__ */ Zp(V())
|
|
7203
7204
|
}), dg = /* @__PURE__ */ I({
|
|
7204
7205
|
accountHash: V(),
|
|
7205
7206
|
currentState: og,
|
|
@@ -7213,10 +7214,10 @@ var Pm = /* @__PURE__ */ I({
|
|
|
7213
7214
|
decodeBinary: vg
|
|
7214
7215
|
};
|
|
7215
7216
|
function hg(e, t = pg, n = !1) {
|
|
7216
|
-
return _g(
|
|
7217
|
+
return _g(Qa.encode(e), t, n);
|
|
7217
7218
|
}
|
|
7218
7219
|
function gg(e, t = pg) {
|
|
7219
|
-
return
|
|
7220
|
+
return Qa.decode(vg(e, t));
|
|
7220
7221
|
}
|
|
7221
7222
|
function _g(e, t = pg, n = !1) {
|
|
7222
7223
|
let r = e.length % 3, i = 0, a = "";
|
|
@@ -8202,7 +8203,7 @@ var Vg = /* @__PURE__ */ function(e) {
|
|
|
8202
8203
|
}, Jg = class e {
|
|
8203
8204
|
static SIGNATURE_SIZE = 3311;
|
|
8204
8205
|
getSignatureSchemeId() {
|
|
8205
|
-
return
|
|
8206
|
+
return Ya.ML_DSA_65;
|
|
8206
8207
|
}
|
|
8207
8208
|
getSignatureSize() {
|
|
8208
8209
|
return e.SIGNATURE_SIZE;
|
|
@@ -8526,12 +8527,12 @@ var lv = /* @__PURE__ */ function(e) {
|
|
|
8526
8527
|
//#endregion
|
|
8527
8528
|
//#region node_modules/.pnpm/@noble+hashes@1.8.0/node_modules/@noble/hashes/esm/pbkdf2.js
|
|
8528
8529
|
function dv(e, t, n, r) {
|
|
8529
|
-
|
|
8530
|
+
Ds(e);
|
|
8530
8531
|
let { c: i, dkLen: a, asyncTick: o } = Ks({
|
|
8531
8532
|
dkLen: 32,
|
|
8532
8533
|
asyncTick: 10
|
|
8533
8534
|
}, r);
|
|
8534
|
-
if (
|
|
8535
|
+
if (Ts(i), Ts(a), Ts(o), i < 1) throw Error("iterations (c) should be >= 1");
|
|
8535
8536
|
let s = Ws(t), c = Ws(n), l = new Uint8Array(a), u = Yd.create(e, s);
|
|
8536
8537
|
return {
|
|
8537
8538
|
c: i,
|
|
@@ -8543,10 +8544,10 @@ function dv(e, t, n, r) {
|
|
|
8543
8544
|
};
|
|
8544
8545
|
}
|
|
8545
8546
|
function fv(e, t, n, r, i) {
|
|
8546
|
-
return e.destroy(), t.destroy(), r && r.destroy(),
|
|
8547
|
+
return e.destroy(), t.destroy(), r && r.destroy(), js(i), n;
|
|
8547
8548
|
}
|
|
8548
8549
|
function pv(e, t, n, r) {
|
|
8549
|
-
let { c: i, dkLen: a, DK: o, PRF: s, PRFSalt: c } = dv(e, t, n, r), l, u = new Uint8Array(4), d =
|
|
8550
|
+
let { c: i, dkLen: a, DK: o, PRF: s, PRFSalt: c } = dv(e, t, n, r), l, u = new Uint8Array(4), d = Ms(u), f = new Uint8Array(s.outputLen);
|
|
8550
8551
|
for (let e = 1, t = 0; t < a; e++, t += s.outputLen) {
|
|
8551
8552
|
let n = o.subarray(t, t + s.outputLen);
|
|
8552
8553
|
d.setInt32(0, e, !1), (l = c._cloneInto(l)).update(u).digestInto(f), n.set(f.subarray(0, n.length));
|
|
@@ -8579,18 +8580,18 @@ var mv = /* @__PURE__ */ function(e) {
|
|
|
8579
8580
|
//#endregion
|
|
8580
8581
|
//#region node_modules/.pnpm/@noble+hashes@1.8.0/node_modules/@noble/hashes/esm/hkdf.js
|
|
8581
8582
|
function _v(e, t, n) {
|
|
8582
|
-
return
|
|
8583
|
+
return Ds(e), n === void 0 && (n = new Uint8Array(e.outputLen)), Yd(e, Us(n), Us(t));
|
|
8583
8584
|
}
|
|
8584
8585
|
var vv = /* @__PURE__ */ Uint8Array.from([0]), yv = /* @__PURE__ */ Uint8Array.of();
|
|
8585
8586
|
function bv(e, t, n, r = 32) {
|
|
8586
|
-
|
|
8587
|
+
Ds(e), Ts(r);
|
|
8587
8588
|
let i = e.outputLen;
|
|
8588
8589
|
if (r > 255 * i) throw Error("Length should be <= 255*HashLen");
|
|
8589
8590
|
let a = Math.ceil(r / i);
|
|
8590
8591
|
n === void 0 && (n = yv);
|
|
8591
8592
|
let o = new Uint8Array(a * i), s = Yd.create(e, t), c = s._cloneInto(), l = new Uint8Array(s.outputLen);
|
|
8592
8593
|
for (let e = 0; e < a; e++) vv[0] = e + 1, c.update(e === 0 ? yv : l).update(n).update(vv).digestInto(l), o.set(l, i * e), s._cloneInto(c);
|
|
8593
|
-
return s.destroy(), c.destroy(),
|
|
8594
|
+
return s.destroy(), c.destroy(), js(l, vv), o.slice(0, r);
|
|
8594
8595
|
}
|
|
8595
8596
|
var xv = (e, t, n, r, i) => bv(e, _v(e, t, n), r, i), Sv = class {
|
|
8596
8597
|
deriveKeyNoSalt(e, t, n) {
|
|
@@ -8718,13 +8719,13 @@ var xv = (e, t, n, r, i) => bv(e, _v(e, t, n), r, i), Sv = class {
|
|
|
8718
8719
|
t == -1 && this.writeVarUint(e.length), this.writeByteArray(e);
|
|
8719
8720
|
}
|
|
8720
8721
|
writeHashString(e) {
|
|
8721
|
-
this.writeByteArray(
|
|
8722
|
+
this.writeByteArray(k.binaryFromHexa(e));
|
|
8722
8723
|
}
|
|
8723
8724
|
writeByteArray(e) {
|
|
8724
8725
|
for (let t of e) this.writeByte(t);
|
|
8725
8726
|
}
|
|
8726
8727
|
writeString(e, t = -1) {
|
|
8727
|
-
let n =
|
|
8728
|
+
let n = Qa.encode(e);
|
|
8728
8729
|
t == -1 && this.writeVarUint(n.length), this.writeByteArray(n);
|
|
8729
8730
|
}
|
|
8730
8731
|
writeVarUint(e) {
|
|
@@ -8827,14 +8828,14 @@ var xv = (e, t, n, r, i) => bv(e, _v(e, t, n), r, i), Sv = class {
|
|
|
8827
8828
|
return this.readByteArray(e == -1 ? this.readVarUint() : e);
|
|
8828
8829
|
}
|
|
8829
8830
|
readHashString() {
|
|
8830
|
-
return
|
|
8831
|
+
return k.binaryToHexa(this.readByteArray(32));
|
|
8831
8832
|
}
|
|
8832
8833
|
readByteArray(e) {
|
|
8833
8834
|
return this.byteStream.slice(this.pointer, this.pointer += e);
|
|
8834
8835
|
}
|
|
8835
8836
|
readString(e = -1) {
|
|
8836
8837
|
let t = this.readByteArray(e == -1 ? this.readVarUint() : e);
|
|
8837
|
-
return
|
|
8838
|
+
return Qa.decode(t);
|
|
8838
8839
|
}
|
|
8839
8840
|
readVarUint() {
|
|
8840
8841
|
let e = [], t;
|
|
@@ -8873,7 +8874,7 @@ var xv = (e, t, n, r, i) => bv(e, _v(e, t, n), r, i), Sv = class {
|
|
|
8873
8874
|
let e = n + (n && ".") + r.name, i = t[r.name];
|
|
8874
8875
|
if (i === void 0) throw new Oe(`field '${e}' is missing`);
|
|
8875
8876
|
if (r.type & 32) {
|
|
8876
|
-
if (
|
|
8877
|
+
if (ro.getType(i) != 1) throw new Oe(`'${e}' is not an array`);
|
|
8877
8878
|
if (r.size !== void 0) {
|
|
8878
8879
|
if (i.length != r.size) throw new Oe(`invalid size for '${e}' (expecting ${r.size} entries, got ${i.length})`);
|
|
8879
8880
|
} else this.stream.writeVarUint(i.length);
|
|
@@ -8884,12 +8885,12 @@ var xv = (e, t, n, r, i) => bv(e, _v(e, t, n), r, i), Sv = class {
|
|
|
8884
8885
|
serializeItem(e, t, n) {
|
|
8885
8886
|
let r = e.type & 31;
|
|
8886
8887
|
if (r == 2) {
|
|
8887
|
-
if (
|
|
8888
|
+
if (ro.getType(t) != 2) throw new Oe(`'${n}' is not an object`);
|
|
8888
8889
|
if (e.definition) this.serializeObject(e.definition, t, n);
|
|
8889
8890
|
else if (e.schema) this.serializeObject(e.schema.definition, t, n);
|
|
8890
8891
|
else throw new Oe("missing definition in schema");
|
|
8891
8892
|
} else {
|
|
8892
|
-
let i = new
|
|
8893
|
+
let i = new io(e, t);
|
|
8893
8894
|
try {
|
|
8894
8895
|
i.check();
|
|
8895
8896
|
} catch (e) {
|
|
@@ -8907,7 +8908,7 @@ var xv = (e, t, n, r, i) => bv(e, _v(e, t, n), r, i), Sv = class {
|
|
|
8907
8908
|
unserialize(e) {
|
|
8908
8909
|
this.stream = new Rv(e);
|
|
8909
8910
|
let t = this.unserializeObject(this.schema.definition), n = this.stream.getPointer(), r = e.length;
|
|
8910
|
-
if (n != r) throw console.error(
|
|
8911
|
+
if (n != r) throw console.error(k.binaryToHexa(e)), new o(`Invalid stream length (decoded ${n} bytes, actual length is ${r} bytes)`);
|
|
8911
8912
|
return t;
|
|
8912
8913
|
}
|
|
8913
8914
|
unserializeObject(e) {
|
|
@@ -9006,7 +9007,7 @@ var xv = (e, t, n, r, i) => bv(e, _v(e, t, n), r, i), Sv = class {
|
|
|
9006
9007
|
}, Wv = class e {
|
|
9007
9008
|
static SIGNATURE_SIZE = 65;
|
|
9008
9009
|
getSignatureSchemeId() {
|
|
9009
|
-
return
|
|
9010
|
+
return Ya.SECP256K1;
|
|
9010
9011
|
}
|
|
9011
9012
|
getSignatureSize() {
|
|
9012
9013
|
return e.SIGNATURE_SIZE;
|
|
@@ -9057,7 +9058,7 @@ var xv = (e, t, n, r, i) => bv(e, _v(e, t, n), r, i), Sv = class {
|
|
|
9057
9058
|
}, qv = class e {
|
|
9058
9059
|
static SIGNATURE_SIZE = 65;
|
|
9059
9060
|
getSignatureSchemeId() {
|
|
9060
|
-
return
|
|
9061
|
+
return Ya.ED25519;
|
|
9061
9062
|
}
|
|
9062
9063
|
getSignatureSize() {
|
|
9063
9064
|
return e.SIGNATURE_SIZE;
|
|
@@ -9112,18 +9113,18 @@ var Yv = class e extends Kg {
|
|
|
9112
9113
|
}, Xv = class e {
|
|
9113
9114
|
static createPrivateSignatureKey(e, t) {
|
|
9114
9115
|
switch (e) {
|
|
9115
|
-
case
|
|
9116
|
-
case
|
|
9117
|
-
case
|
|
9116
|
+
case Ya.SECP256K1: return new Kv(t);
|
|
9117
|
+
case Ya.ML_DSA_65: return new Xg(t);
|
|
9118
|
+
case Ya.ED25519: return new Yv(t.slice(0, 32));
|
|
9118
9119
|
default: throw `Not supported signature scheme ID: ${e}`;
|
|
9119
9120
|
}
|
|
9120
9121
|
}
|
|
9121
9122
|
static createVirtualBlockchainPrivateSignature(e, t, n, r) {
|
|
9122
9123
|
let i = new Uint8Array([...n, ...r]), a = new TextEncoder(), o = e.deriveKeyNoSalt(i, a.encode("VB_ACTOR_KEY"), 32);
|
|
9123
9124
|
switch (t) {
|
|
9124
|
-
case
|
|
9125
|
-
case
|
|
9126
|
-
case
|
|
9125
|
+
case Ya.ML_DSA_65: return new Xg(o);
|
|
9126
|
+
case Ya.SECP256K1: return Kv.genFromSeed(o);
|
|
9127
|
+
case Ya.ED25519: return new Yv(o.slice(0, 32));
|
|
9127
9128
|
default: throw `Not supported signature scheme ID: ${t}`;
|
|
9128
9129
|
}
|
|
9129
9130
|
}
|
|
@@ -9146,9 +9147,9 @@ var Yv = class e extends Kg {
|
|
|
9146
9147
|
}
|
|
9147
9148
|
static async createPublicSignatureKey(e, t) {
|
|
9148
9149
|
switch (e) {
|
|
9149
|
-
case
|
|
9150
|
-
case
|
|
9151
|
-
case
|
|
9150
|
+
case Ya.SECP256K1: return new Gv(t);
|
|
9151
|
+
case Ya.ML_DSA_65: return new Yg(t);
|
|
9152
|
+
case Ya.ED25519: return new Jv(t);
|
|
9152
9153
|
default: throw Error(`Not supported signature scheme ID: ${e}`);
|
|
9153
9154
|
}
|
|
9154
9155
|
}
|
|
@@ -9196,9 +9197,9 @@ var Yv = class e extends Kg {
|
|
|
9196
9197
|
}
|
|
9197
9198
|
static createSignatureScheme(e) {
|
|
9198
9199
|
switch (e) {
|
|
9199
|
-
case
|
|
9200
|
-
case
|
|
9201
|
-
case
|
|
9200
|
+
case Ya.SECP256K1: return new Wv();
|
|
9201
|
+
case Ya.ML_DSA_65: return new Jg();
|
|
9202
|
+
case Ya.ED25519: return new qv();
|
|
9202
9203
|
default: throw Error(`Not supported signature scheme ID: ${e}`);
|
|
9203
9204
|
}
|
|
9204
9205
|
}
|
|
@@ -9401,13 +9402,13 @@ var Sy = oy.exports, Cy = /* @__PURE__ */ ay(Sy), wy = class {
|
|
|
9401
9402
|
if (!e.ok) throw Error(`Failed to fetch public key with id ${this.keyId} at ${this.options.host}: ${e.statusText}.`);
|
|
9402
9403
|
let t = (await e.json()).publicKey;
|
|
9403
9404
|
if (t === void 0) throw Error("Failed to fetch public key: no \"publicKey\" field found in response body.");
|
|
9404
|
-
return new
|
|
9405
|
+
return new Gv(new Uint8Array(Bg.from(t, "base64")));
|
|
9405
9406
|
}
|
|
9406
9407
|
getScheme() {
|
|
9407
9408
|
return new Wv();
|
|
9408
9409
|
}
|
|
9409
9410
|
getSignatureSchemeId() {
|
|
9410
|
-
return
|
|
9411
|
+
return Ya.PKMS_SECP256K1;
|
|
9411
9412
|
}
|
|
9412
9413
|
getSignatureSize() {
|
|
9413
9414
|
return this.getScheme().getSignatureSize();
|
|
@@ -9439,7 +9440,7 @@ var Sy = oy.exports, Cy = /* @__PURE__ */ ay(Sy), wy = class {
|
|
|
9439
9440
|
}
|
|
9440
9441
|
}, Dy = class extends Gv {
|
|
9441
9442
|
getSignatureSchemeId() {
|
|
9442
|
-
return
|
|
9443
|
+
return Ya.PKMS_SECP256K1;
|
|
9443
9444
|
}
|
|
9444
9445
|
}, Oy = class extends ty {
|
|
9445
9446
|
constructor() {
|
|
@@ -9457,7 +9458,7 @@ var Sy = oy.exports, Cy = /* @__PURE__ */ ay(Sy), wy = class {
|
|
|
9457
9458
|
return Cg.encode(...this.getHCVPrivateKeyEncodingPrefix(), t);
|
|
9458
9459
|
}
|
|
9459
9460
|
}, ky = "SIG", Ay = "SK", jy = "PK", My = class e {
|
|
9460
|
-
static logger =
|
|
9461
|
+
static logger = O.getLogger(["HCVSignatureDecoder"]);
|
|
9461
9462
|
bytesEncoder = yg.bytesToHexEncoder();
|
|
9462
9463
|
constructor(e) {
|
|
9463
9464
|
this.labels = e;
|
|
@@ -10732,7 +10733,7 @@ var { NEVER: xx, ALWAYS: Sx, DECIMAL_ROUND: Cx, DECIMAL_FIT: wx } = Wb, Tx = 204
|
|
|
10732
10733
|
}
|
|
10733
10734
|
}, X = class e {
|
|
10734
10735
|
static encoder = Dx.getCryptoBinaryEncoder();
|
|
10735
|
-
static logger =
|
|
10736
|
+
static logger = O.getLogger(["utils"]);
|
|
10736
10737
|
static computeMicroblockHashFromHeader(t) {
|
|
10737
10738
|
let n = e.encodeMicroblockHeader(t);
|
|
10738
10739
|
return M.Hashes.sha256AsBinary(n);
|
|
@@ -10747,10 +10748,10 @@ var { NEVER: xx, ALWAYS: Sx, DECIMAL_ROUND: Cx, DECIMAL_FIT: wx } = Wb, Tx = 204
|
|
|
10747
10748
|
valid: !0,
|
|
10748
10749
|
hashes: [M.Hashes.sha256AsBinary(t[0])]
|
|
10749
10750
|
};
|
|
10750
|
-
let r = [], i = null, a =
|
|
10751
|
+
let r = [], i = null, a = O.getProviderLogger();
|
|
10751
10752
|
for (let n of t.reverse()) {
|
|
10752
10753
|
let t = M.Hashes.sha256AsBinary(n);
|
|
10753
|
-
if (i && !
|
|
10754
|
+
if (i && !k.binaryIsEqual(t, i)) return a.error(`Received headers mismatch: Expected ${k.binaryToHexa(i)}, got ${k.binaryToHexa(t)}: aborting verification`), {
|
|
10754
10755
|
valid: !1,
|
|
10755
10756
|
hashes: []
|
|
10756
10757
|
};
|
|
@@ -10799,7 +10800,7 @@ var { NEVER: xx, ALWAYS: Sx, DECIMAL_ROUND: Cx, DECIMAL_FIT: wx } = Wb, Tx = 204
|
|
|
10799
10800
|
}
|
|
10800
10801
|
static decodeMicroblockHeader(t) {
|
|
10801
10802
|
let n = this.decodeObjectFromBinary(t), r = R(Pm, n);
|
|
10802
|
-
if (!
|
|
10803
|
+
if (!k.binaryIsEqual(n.bodyHash, r.bodyHash)) throw e.logger.error(`Modified validated object: ${JSON.stringify(n)} vs ${JSON.stringify(r)}`), Error(`Modified body hash detected during deserialization: ${n.bodyHash} vs ${r.bodyHash}`);
|
|
10803
10804
|
return r;
|
|
10804
10805
|
}
|
|
10805
10806
|
static encodeEscrowParameters(e) {
|
|
@@ -10903,25 +10904,25 @@ var { NEVER: xx, ALWAYS: Sx, DECIMAL_ROUND: Cx, DECIMAL_FIT: wx } = Wb, Tx = 204
|
|
|
10903
10904
|
constructor(e) {
|
|
10904
10905
|
this.provider = e;
|
|
10905
10906
|
}
|
|
10906
|
-
async computeFees(t, n, r, i =
|
|
10907
|
+
async computeFees(t, n, r, i = k.getTimestampInSeconds()) {
|
|
10907
10908
|
if (r < 0) throw Error("Invalid expiration day");
|
|
10908
10909
|
let a = n.getGasPrice(), o = a.isZero() ? e.DEFAULT_GAS_PRICE : a, s = await this.computeGas(t, n, r, i);
|
|
10909
10910
|
return hn.createAtomic(s * o.getAmountAsAtomic());
|
|
10910
10911
|
}
|
|
10911
|
-
async computeGas(e, t, n, r =
|
|
10912
|
+
async computeGas(e, t, n, r = k.getTimestampInSeconds()) {
|
|
10912
10913
|
let i = 1 * this.computeSizeInBytesOfMicroblock(t) * pr, a = await this.provider.getProtocolState(), o = new kx(a.getRetentionPolicy()), s = o.getNumberOfDaysOfStorage(r, n), c = o.getStorageCost(i, s), l = this.getAdditionalCosts(a, e);
|
|
10913
10914
|
return Math.floor(c / pr) + l;
|
|
10914
10915
|
}
|
|
10915
10916
|
getAdditionalCosts(e, t) {
|
|
10916
10917
|
let n = 0;
|
|
10917
10918
|
switch (t) {
|
|
10918
|
-
case
|
|
10919
|
+
case Ya.SECP256K1:
|
|
10919
10920
|
n = e.getSecp256k1SignatureGasCost();
|
|
10920
10921
|
break;
|
|
10921
|
-
case
|
|
10922
|
+
case Ya.ML_DSA_65:
|
|
10922
10923
|
n = e.getMlDsa65SignatureGasCost();
|
|
10923
10924
|
break;
|
|
10924
|
-
case
|
|
10925
|
+
case Ya.PKMS_SECP256K1:
|
|
10925
10926
|
n = e.getPkmsSecp256k1SignatureGasCost();
|
|
10926
10927
|
break;
|
|
10927
10928
|
}
|
|
@@ -10930,7 +10931,7 @@ var { NEVER: xx, ALWAYS: Sx, DECIMAL_ROUND: Cx, DECIMAL_FIT: wx } = Wb, Tx = 204
|
|
|
10930
10931
|
computeSizeInBytesOfMicroblock(e) {
|
|
10931
10932
|
let t = e.getAllSections();
|
|
10932
10933
|
if (t.length === 0) return 0;
|
|
10933
|
-
let n = t[t.length - 1].type ===
|
|
10934
|
+
let n = t[t.length - 1].type === D.SIGNATURE ? t.slice(0, t.length - 1) : t;
|
|
10934
10935
|
return this.getSizeOfListOfSections(n);
|
|
10935
10936
|
}
|
|
10936
10937
|
getSizeOfListOfSections(e) {
|
|
@@ -11005,7 +11006,7 @@ var { NEVER: xx, ALWAYS: Sx, DECIMAL_ROUND: Cx, DECIMAL_FIT: wx } = Wb, Tx = 204
|
|
|
11005
11006
|
}
|
|
11006
11007
|
static createInitialState() {
|
|
11007
11008
|
return new e({
|
|
11008
|
-
organizationId:
|
|
11009
|
+
organizationId: k.getNullHash(),
|
|
11009
11010
|
descriptionHeight: 0
|
|
11010
11011
|
});
|
|
11011
11012
|
}
|
|
@@ -11166,14 +11167,14 @@ var { NEVER: xx, ALWAYS: Sx, DECIMAL_ROUND: Cx, DECIMAL_FIT: wx } = Wb, Tx = 204
|
|
|
11166
11167
|
}
|
|
11167
11168
|
static createInitialState() {
|
|
11168
11169
|
return new e({
|
|
11169
|
-
organizationId:
|
|
11170
|
+
organizationId: k.getNullHash(),
|
|
11170
11171
|
currentProtocolVariables: {
|
|
11171
11172
|
protocolVersionName: Ix.INITIAL_PROTOCOL_VERSION_NAME,
|
|
11172
11173
|
protocolVersion: 1,
|
|
11173
11174
|
feesCalculationVersion: 1,
|
|
11174
|
-
fixedGasCost:
|
|
11175
|
-
secp256k1SignatureGasCost:
|
|
11176
|
-
mlDsa65SignatureGasCost:
|
|
11175
|
+
fixedGasCost: 100,
|
|
11176
|
+
secp256k1SignatureGasCost: 100,
|
|
11177
|
+
mlDsa65SignatureGasCost: 500,
|
|
11177
11178
|
pkmsSecp256k1SignatureGasCost: 0,
|
|
11178
11179
|
globalStateUpdaterVersion: 1,
|
|
11179
11180
|
applicationLedgerInternalStateUpdaterVersion: 1,
|
|
@@ -11292,7 +11293,7 @@ var { NEVER: xx, ALWAYS: Sx, DECIMAL_ROUND: Cx, DECIMAL_FIT: wx } = Wb, Tx = 204
|
|
|
11292
11293
|
}
|
|
11293
11294
|
static createInitialState() {
|
|
11294
11295
|
return new e({
|
|
11295
|
-
accountId:
|
|
11296
|
+
accountId: k.getNullHash(),
|
|
11296
11297
|
descriptionHeight: 0
|
|
11297
11298
|
});
|
|
11298
11299
|
}
|
|
@@ -11325,7 +11326,7 @@ var { NEVER: xx, ALWAYS: Sx, DECIMAL_ROUND: Cx, DECIMAL_FIT: wx } = Wb, Tx = 204
|
|
|
11325
11326
|
return new e({
|
|
11326
11327
|
cometbftPublicKeyDeclarationHeight: 0,
|
|
11327
11328
|
lastKnownApprovalStatus: !1,
|
|
11328
|
-
organizationId:
|
|
11329
|
+
organizationId: k.getNullHash(),
|
|
11329
11330
|
rpcEndpointHeight: 0
|
|
11330
11331
|
});
|
|
11331
11332
|
}
|
|
@@ -11376,28 +11377,28 @@ var { NEVER: xx, ALWAYS: Sx, DECIMAL_ROUND: Cx, DECIMAL_FIT: wx } = Wb, Tx = 204
|
|
|
11376
11377
|
async updateState(e, t, n) {
|
|
11377
11378
|
let r = Mx.createFromObject({ ...t.toObject() }), i = n.getAllSections();
|
|
11378
11379
|
for (let e of i) switch (e.type) {
|
|
11379
|
-
case
|
|
11380
|
+
case D.ACCOUNT_PUBLIC_KEY:
|
|
11380
11381
|
await this.publicKeyCallback(r, n, e);
|
|
11381
11382
|
break;
|
|
11382
|
-
case
|
|
11383
|
+
case D.ACCOUNT_TOKEN_ISSUANCE:
|
|
11383
11384
|
await this.tokenIssuanceCallback(r, n, e);
|
|
11384
11385
|
break;
|
|
11385
|
-
case
|
|
11386
|
+
case D.ACCOUNT_CREATION:
|
|
11386
11387
|
await this.creationCallback(r, n, e);
|
|
11387
11388
|
break;
|
|
11388
|
-
case
|
|
11389
|
+
case D.ACCOUNT_TRANSFER:
|
|
11389
11390
|
await this.transferCallback(r, n, e);
|
|
11390
11391
|
break;
|
|
11391
|
-
case
|
|
11392
|
+
case D.ACCOUNT_VESTING_TRANSFER:
|
|
11392
11393
|
await this.vestingTransferCallback(r, n, e);
|
|
11393
11394
|
break;
|
|
11394
|
-
case
|
|
11395
|
+
case D.ACCOUNT_ESCROW_TRANSFER:
|
|
11395
11396
|
await this.escrowTransferCallback(r, n, e);
|
|
11396
11397
|
break;
|
|
11397
|
-
case
|
|
11398
|
+
case D.ACCOUNT_STAKE:
|
|
11398
11399
|
await this.stakeCallback(r, n, e);
|
|
11399
11400
|
break;
|
|
11400
|
-
case
|
|
11401
|
+
case D.SIGNATURE:
|
|
11401
11402
|
await this.signatureCallback(r, n, e);
|
|
11402
11403
|
break;
|
|
11403
11404
|
}
|
|
@@ -11422,47 +11423,47 @@ var { NEVER: xx, ALWAYS: Sx, DECIMAL_ROUND: Cx, DECIMAL_FIT: wx } = Wb, Tx = 204
|
|
|
11422
11423
|
}, Hx = class {
|
|
11423
11424
|
updateState(e, t, n) {
|
|
11424
11425
|
let r = t.clone();
|
|
11425
|
-
for (let e of n.getAllSections()) e.type ===
|
|
11426
|
+
for (let e of n.getAllSections()) e.type === D.APP_CREATION && r.setOrganizationId(e.organizationId), e.type === D.APP_DESCRIPTION && r.setDescriptionHeight(n.getHeight());
|
|
11426
11427
|
return r;
|
|
11427
11428
|
}
|
|
11428
11429
|
}, Ux = {
|
|
11429
|
-
[
|
|
11430
|
-
[
|
|
11431
|
-
[
|
|
11432
|
-
[
|
|
11433
|
-
[
|
|
11434
|
-
[
|
|
11435
|
-
[
|
|
11436
|
-
[
|
|
11437
|
-
[
|
|
11438
|
-
[
|
|
11439
|
-
[
|
|
11440
|
-
[
|
|
11441
|
-
[
|
|
11442
|
-
[
|
|
11443
|
-
[
|
|
11444
|
-
[
|
|
11445
|
-
[
|
|
11446
|
-
[
|
|
11447
|
-
[
|
|
11448
|
-
[
|
|
11449
|
-
[
|
|
11450
|
-
[
|
|
11451
|
-
[
|
|
11452
|
-
[
|
|
11453
|
-
[
|
|
11454
|
-
[
|
|
11455
|
-
[
|
|
11456
|
-
[
|
|
11457
|
-
[
|
|
11458
|
-
[
|
|
11459
|
-
[
|
|
11460
|
-
[
|
|
11461
|
-
[
|
|
11462
|
-
[
|
|
11463
|
-
[
|
|
11464
|
-
[
|
|
11465
|
-
[
|
|
11430
|
+
[D.AUXILIARY_SIGNATURE]: "AUXILIARY_SIGNATURE",
|
|
11431
|
+
[D.SIGNATURE]: "SIGNATURE",
|
|
11432
|
+
[D.ALLOWED_ADDITIONAL_WRITER]: "ALLOWED_ADDITIONAL_WRITER_CREATION",
|
|
11433
|
+
[D.CUSTOM]: "CUSTOM",
|
|
11434
|
+
[D.PROTOCOL_CREATION]: "PROTOCOL_CREATION",
|
|
11435
|
+
[D.PROTOCOL_UPDATE]: "PROTOCOL_UPDATE",
|
|
11436
|
+
[D.PROTOCOL_VARIABLES]: "PROTOCOL_VARIABLES",
|
|
11437
|
+
[D.ACCOUNT_PUBLIC_KEY]: "ACCOUNT_PUBLIC_KEY",
|
|
11438
|
+
[D.ACCOUNT_TOKEN_ISSUANCE]: "ACCOUNT_TOKEN_ISSUANCE",
|
|
11439
|
+
[D.ACCOUNT_CREATION]: "ACCOUNT_CREATION",
|
|
11440
|
+
[D.ACCOUNT_TRANSFER]: "ACCOUNT_TRANSFER",
|
|
11441
|
+
[D.ACCOUNT_VESTING_TRANSFER]: "ACCOUNT_VESTING_TRANSFER",
|
|
11442
|
+
[D.ACCOUNT_ESCROW_TRANSFER]: "ACCOUNT_ESCROW_TRANSFER",
|
|
11443
|
+
[D.ACCOUNT_ESCROW_SETTLEMENT]: "ACCOUNT_ESCROW_SETTLEMENT",
|
|
11444
|
+
[D.ACCOUNT_STAKE]: "ACCOUNT_STAKE",
|
|
11445
|
+
[D.ACCOUNT_UNSTAKE]: "ACCOUNT_UNSTAKE",
|
|
11446
|
+
[D.VN_CREATION]: "VN_CREATION",
|
|
11447
|
+
[D.VN_COMETBFT_PUBLIC_KEY_DECLARATION]: "VN_COMETBFT_PUBLIC_KEY_DECLARATION",
|
|
11448
|
+
[D.VN_RPC_ENDPOINT]: "VN_RPC_ENDPOINT",
|
|
11449
|
+
[D.VN_APPROVAL]: "VN_APPROVAL",
|
|
11450
|
+
[D.VN_SLASHING_CANCELLATION]: "VN_SLASHING_CANCELLATION",
|
|
11451
|
+
[D.ORG_CREATION]: "ORG_CREATION",
|
|
11452
|
+
[D.ORG_DESCRIPTION]: "ORG_DESCRIPTION",
|
|
11453
|
+
[D.APP_CREATION]: "APP_CREATION",
|
|
11454
|
+
[D.APP_DESCRIPTION]: "APP_DESCRIPTION",
|
|
11455
|
+
[D.APP_LEDGER_ALLOWED_SIG_SCHEMES]: "APP_LEDGER_ALLOWED_SIG_SCHEMES",
|
|
11456
|
+
[D.APP_LEDGER_ALLOWED_PKE_SCHEMES]: "APP_LEDGER_ALLOWED_PKE_SCHEMES",
|
|
11457
|
+
[D.APP_LEDGER_CREATION]: "APP_LEDGER_CREATION",
|
|
11458
|
+
[D.APP_LEDGER_ACTOR_CREATION]: "APP_LEDGER_ACTOR_CREATION",
|
|
11459
|
+
[D.APP_LEDGER_CHANNEL_CREATION]: "APP_LEDGER_CHANNEL_CREATION",
|
|
11460
|
+
[D.APP_LEDGER_SHARED_SECRET]: "APP_LEDGER_SHARED_SECRET",
|
|
11461
|
+
[D.APP_LEDGER_CHANNEL_INVITATION]: "APP_LEDGER_CHANNEL_INVITATION",
|
|
11462
|
+
[D.APP_LEDGER_ACTOR_SUBSCRIPTION]: "APP_LEDGER_ACTOR_SUBSCRIPTION",
|
|
11463
|
+
[D.APP_LEDGER_PUBLIC_CHANNEL_DATA]: "APP_LEDGER_PUBLIC_CHANNEL_DATA",
|
|
11464
|
+
[D.APP_LEDGER_PRIVATE_CHANNEL_DATA]: "APP_LEDGER_PRIVATE_CHANNEL_DATA",
|
|
11465
|
+
[D.APP_LEDGER_AUTHOR]: "APP_LEDGER_AUTHOR",
|
|
11466
|
+
[D.APP_LEDGER_ENDORSEMENT_REQUEST]: "APP_LEDGER_ENDORSEMENT_REQUEST"
|
|
11466
11467
|
}, Wx = class {
|
|
11467
11468
|
static getSectionLabelFromSection(e) {
|
|
11468
11469
|
return this.getSectionLabelFromSectionType(e.type);
|
|
@@ -11471,7 +11472,7 @@ var { NEVER: xx, ALWAYS: Sx, DECIMAL_ROUND: Cx, DECIMAL_FIT: wx } = Wb, Tx = 204
|
|
|
11471
11472
|
return Ux[e];
|
|
11472
11473
|
}
|
|
11473
11474
|
}, Gx = class e {
|
|
11474
|
-
logger =
|
|
11475
|
+
logger = O.getInternalStateUpdaterLogger(e.name);
|
|
11475
11476
|
async updateState(e, t, n) {
|
|
11476
11477
|
let r = t.clone(), i = n.getHeight();
|
|
11477
11478
|
for (let a of n.getAllSections()) r = await this.updateStateFromSection(e, t, a, i);
|
|
@@ -11480,43 +11481,43 @@ var { NEVER: xx, ALWAYS: Sx, DECIMAL_ROUND: Cx, DECIMAL_FIT: wx } = Wb, Tx = 204
|
|
|
11480
11481
|
async updateStateFromSection(e, t, n, r) {
|
|
11481
11482
|
let i = t;
|
|
11482
11483
|
switch (n.type) {
|
|
11483
|
-
case
|
|
11484
|
+
case D.APP_LEDGER_ALLOWED_SIG_SCHEMES:
|
|
11484
11485
|
await this.allowedSignatureSchemesCallback(n, i);
|
|
11485
11486
|
break;
|
|
11486
|
-
case
|
|
11487
|
+
case D.APP_LEDGER_ALLOWED_PKE_SCHEMES:
|
|
11487
11488
|
await this.allowedPkeSchemesCallback(n, i);
|
|
11488
11489
|
break;
|
|
11489
|
-
case
|
|
11490
|
+
case D.APP_LEDGER_CREATION:
|
|
11490
11491
|
await this.declarationCallback(n, i);
|
|
11491
11492
|
break;
|
|
11492
|
-
case
|
|
11493
|
+
case D.APP_LEDGER_ACTOR_CREATION:
|
|
11493
11494
|
await this.actorCreationCallback(n, i);
|
|
11494
11495
|
break;
|
|
11495
|
-
case
|
|
11496
|
+
case D.APP_LEDGER_ACTOR_SUBSCRIPTION:
|
|
11496
11497
|
await this.actorSubscriptionCallback(r, n, i);
|
|
11497
11498
|
break;
|
|
11498
|
-
case
|
|
11499
|
+
case D.APP_LEDGER_CHANNEL_CREATION:
|
|
11499
11500
|
await this.channelCreationCallback(n, i);
|
|
11500
11501
|
break;
|
|
11501
|
-
case
|
|
11502
|
+
case D.APP_LEDGER_SHARED_SECRET:
|
|
11502
11503
|
await this.sharedSecretCallback(r, n, i);
|
|
11503
11504
|
break;
|
|
11504
|
-
case
|
|
11505
|
+
case D.APP_LEDGER_CHANNEL_INVITATION:
|
|
11505
11506
|
await this.invitationCallback(r, n, i);
|
|
11506
11507
|
break;
|
|
11507
|
-
case
|
|
11508
|
+
case D.APP_LEDGER_PUBLIC_CHANNEL_DATA:
|
|
11508
11509
|
await this.publicChannelDataCallback(n, i);
|
|
11509
11510
|
break;
|
|
11510
|
-
case
|
|
11511
|
+
case D.APP_LEDGER_PRIVATE_CHANNEL_DATA:
|
|
11511
11512
|
await this.privateChannelDataCallback(n, i);
|
|
11512
11513
|
break;
|
|
11513
|
-
case
|
|
11514
|
+
case D.ALLOWED_ADDITIONAL_WRITER:
|
|
11514
11515
|
i.addAdditionalWriter(n.allowedWriterAccountId);
|
|
11515
11516
|
break;
|
|
11516
|
-
case
|
|
11517
|
+
case D.SIGNATURE:
|
|
11517
11518
|
await this.endorserSignatureCallback();
|
|
11518
11519
|
break;
|
|
11519
|
-
default:
|
|
11520
|
+
default: O.getLogger().warn(`Unhandled section ${Wx.getSectionLabelFromSection(n)}`);
|
|
11520
11521
|
}
|
|
11521
11522
|
return i;
|
|
11522
11523
|
}
|
|
@@ -11577,7 +11578,7 @@ var { NEVER: xx, ALWAYS: Sx, DECIMAL_ROUND: Cx, DECIMAL_FIT: wx } = Wb, Tx = 204
|
|
|
11577
11578
|
n.getActorById(r).invitations.push({
|
|
11578
11579
|
channelId: i,
|
|
11579
11580
|
height: e
|
|
11580
|
-
}),
|
|
11581
|
+
}), O.getLogger().debug("Updated state after channel invitation callback: {state}", { state: n });
|
|
11581
11582
|
}
|
|
11582
11583
|
async publicChannelDataCallback(e, t) {
|
|
11583
11584
|
if (!t.isChannelDefinedById(e.channelId)) throw new se(`invalid channel ID ${e.channelId}`);
|
|
@@ -11590,16 +11591,16 @@ var { NEVER: xx, ALWAYS: Sx, DECIMAL_ROUND: Cx, DECIMAL_FIT: wx } = Wb, Tx = 204
|
|
|
11590
11591
|
updateState(e, t, n) {
|
|
11591
11592
|
let r = t;
|
|
11592
11593
|
for (let e of n.getAllSections()) switch (e.type) {
|
|
11593
|
-
case
|
|
11594
|
+
case D.VN_CREATION:
|
|
11594
11595
|
r.setOrganizationId(e.organizationId);
|
|
11595
11596
|
break;
|
|
11596
|
-
case
|
|
11597
|
+
case D.VN_APPROVAL:
|
|
11597
11598
|
this.updateApproval(r, e);
|
|
11598
11599
|
break;
|
|
11599
|
-
case
|
|
11600
|
+
case D.VN_COMETBFT_PUBLIC_KEY_DECLARATION:
|
|
11600
11601
|
r.setCometbftPublicKeyDeclarationHeight(n.getHeight());
|
|
11601
11602
|
break;
|
|
11602
|
-
case
|
|
11603
|
+
case D.VN_RPC_ENDPOINT:
|
|
11603
11604
|
r.setRpcEndpointDeclarationHeight(n.getHeight());
|
|
11604
11605
|
break;
|
|
11605
11606
|
}
|
|
@@ -11609,23 +11610,23 @@ var { NEVER: xx, ALWAYS: Sx, DECIMAL_ROUND: Cx, DECIMAL_FIT: wx } = Wb, Tx = 204
|
|
|
11609
11610
|
e.setApprovalStatus(t.status);
|
|
11610
11611
|
}
|
|
11611
11612
|
}, qx = class e {
|
|
11612
|
-
logger =
|
|
11613
|
+
logger = O.getInternalStateUpdaterLogger(e.name);
|
|
11613
11614
|
updateState(e, t, n) {
|
|
11614
11615
|
for (let e of n.getAllSections()) {
|
|
11615
|
-
if (e.type ===
|
|
11616
|
+
if (e.type === D.PROTOCOL_UPDATE) {
|
|
11616
11617
|
let n = e;
|
|
11617
11618
|
this.logger.debug(`Updating protocol variables: ${JSON.stringify(n.protocolVariables)}`), t.setProtocolVariables(n.protocolVariables);
|
|
11618
11619
|
}
|
|
11619
|
-
if (e.type ===
|
|
11620
|
+
if (e.type === D.PROTOCOL_CREATION) {
|
|
11620
11621
|
let n = e.organizationId;
|
|
11621
|
-
this.logger.debug(`Updating organization ID: ${
|
|
11622
|
+
this.logger.debug(`Updating organization ID: ${k.binaryToHexa(n)}`), t.setOrganizationId(n);
|
|
11622
11623
|
}
|
|
11623
11624
|
}
|
|
11624
11625
|
return t;
|
|
11625
11626
|
}
|
|
11626
11627
|
}, Jx = class {
|
|
11627
11628
|
updateState(e, t, n) {
|
|
11628
|
-
for (let e of n.getAllSections()) e.type ===
|
|
11629
|
+
for (let e of n.getAllSections()) e.type === D.ORG_CREATION && t.setAccountId(e.accountId), e.type === D.ORG_DESCRIPTION && t.updateDescriptionHeight(n.getHeight());
|
|
11629
11630
|
return t;
|
|
11630
11631
|
}
|
|
11631
11632
|
}, Yx = class {
|
|
@@ -11705,7 +11706,7 @@ var { NEVER: xx, ALWAYS: Sx, DECIMAL_ROUND: Cx, DECIMAL_FIT: wx } = Wb, Tx = 204
|
|
|
11705
11706
|
let a = t.bodyHash, s = new e(i);
|
|
11706
11707
|
s.header = structuredClone(t), s.addSections(n.sections);
|
|
11707
11708
|
let c = s.computeBodyHash();
|
|
11708
|
-
if (!
|
|
11709
|
+
if (!k.binaryIsEqual(a, c)) {
|
|
11709
11710
|
let e = yg.bytesToHexEncoder();
|
|
11710
11711
|
throw new o(`Body hash in the header is different of the locally computed body hash: header.bodyHash=${e.encode(a)}, computed=${e.encode(c)}`);
|
|
11711
11712
|
}
|
|
@@ -11727,10 +11728,10 @@ var { NEVER: xx, ALWAYS: Sx, DECIMAL_ROUND: Cx, DECIMAL_FIT: wx } = Wb, Tx = 204
|
|
|
11727
11728
|
return M.Hashes.sha256AsBinary(n);
|
|
11728
11729
|
}
|
|
11729
11730
|
static generatePreviousHashForGenesisMicroblock(e, t = 0) {
|
|
11730
|
-
let n = M.Random.getBytes(24), r =
|
|
11731
|
+
let n = M.Random.getBytes(24), r = k.getNullHash();
|
|
11731
11732
|
return r[0] = e, r[1] = t >> 24, r[2] = t >> 16, r[3] = t >> 8, r[4] = t, r.set(n, 8), r;
|
|
11732
11733
|
}
|
|
11733
|
-
static logger =
|
|
11734
|
+
static logger = O.getMicroblockLogger();
|
|
11734
11735
|
hash;
|
|
11735
11736
|
header;
|
|
11736
11737
|
sections;
|
|
@@ -11745,7 +11746,7 @@ var { NEVER: xx, ALWAYS: Sx, DECIMAL_ROUND: Cx, DECIMAL_FIT: wx } = Wb, Tx = 204
|
|
|
11745
11746
|
gas: 0,
|
|
11746
11747
|
gasPrice: r,
|
|
11747
11748
|
bodyHash: e.computeInitialBodyHash(),
|
|
11748
|
-
feesPayerAccount:
|
|
11749
|
+
feesPayerAccount: k.getNullHash()
|
|
11749
11750
|
};
|
|
11750
11751
|
this.type = t, this.sections = [], this.header = i, this.hash = e.computeMicroblockHash(i);
|
|
11751
11752
|
}
|
|
@@ -11757,18 +11758,18 @@ var { NEVER: xx, ALWAYS: Sx, DECIMAL_ROUND: Cx, DECIMAL_FIT: wx } = Wb, Tx = 204
|
|
|
11757
11758
|
microblockType: this.type,
|
|
11758
11759
|
height: t,
|
|
11759
11760
|
previousHash: n,
|
|
11760
|
-
timestamp:
|
|
11761
|
+
timestamp: k.getTimestampInSeconds(),
|
|
11761
11762
|
gas: 0,
|
|
11762
11763
|
gasPrice: 0,
|
|
11763
|
-
bodyHash:
|
|
11764
|
-
feesPayerAccount:
|
|
11764
|
+
bodyHash: k.getNullHash(),
|
|
11765
|
+
feesPayerAccount: k.getNullHash()
|
|
11765
11766
|
}, this.hash = e.computeMicroblockHash(this.header);
|
|
11766
11767
|
}
|
|
11767
11768
|
isSigned() {
|
|
11768
|
-
return this.sections.length == 0 ? !1 : this.sections[this.sections.length - 1].type ===
|
|
11769
|
+
return this.sections.length == 0 ? !1 : this.sections[this.sections.length - 1].type === D.SIGNATURE;
|
|
11769
11770
|
}
|
|
11770
11771
|
updateTimestamp() {
|
|
11771
|
-
this.header.timestamp =
|
|
11772
|
+
this.header.timestamp = k.getTimestampInSeconds(), this.hash = e.computeMicroblockHash(this.header);
|
|
11772
11773
|
}
|
|
11773
11774
|
getHeader() {
|
|
11774
11775
|
return this.header;
|
|
@@ -11810,7 +11811,7 @@ var { NEVER: xx, ALWAYS: Sx, DECIMAL_ROUND: Cx, DECIMAL_FIT: wx } = Wb, Tx = 204
|
|
|
11810
11811
|
return hn.createAtomic(this.header.gasPrice);
|
|
11811
11812
|
}
|
|
11812
11813
|
isFeesPayerAccountDefined() {
|
|
11813
|
-
return
|
|
11814
|
+
return k.binaryIsEqual(this.getFeesPayerAccount(), k.getNullHash()) == 0;
|
|
11814
11815
|
}
|
|
11815
11816
|
getFeesPayerAccount() {
|
|
11816
11817
|
return this.header.feesPayerAccount;
|
|
@@ -11868,7 +11869,7 @@ var { NEVER: xx, ALWAYS: Sx, DECIMAL_ROUND: Cx, DECIMAL_FIT: wx } = Wb, Tx = 204
|
|
|
11868
11869
|
let n = t.feesPayerAccount;
|
|
11869
11870
|
n && this.setFeesPayerAccount(n);
|
|
11870
11871
|
let r = typeof t.includeGas == "boolean" ? t.includeGas : !0, i = await this.sign(e, r), a = {
|
|
11871
|
-
type:
|
|
11872
|
+
type: D.SIGNATURE,
|
|
11872
11873
|
signature: i,
|
|
11873
11874
|
schemeId: e.getSignatureSchemeId()
|
|
11874
11875
|
};
|
|
@@ -11884,22 +11885,22 @@ var { NEVER: xx, ALWAYS: Sx, DECIMAL_ROUND: Cx, DECIMAL_FIT: wx } = Wb, Tx = 204
|
|
|
11884
11885
|
return await t.sign(o);
|
|
11885
11886
|
}
|
|
11886
11887
|
async verifySignature(e) {
|
|
11887
|
-
let t = this.sections.filter((e) => e.type ===
|
|
11888
|
+
let t = this.sections.filter((e) => e.type === D.SIGNATURE);
|
|
11888
11889
|
if (t.length === 0) throw new a("The current microblock has no SIGNATURE section");
|
|
11889
11890
|
if (t.length !== 1) throw new a("There are several SIGNATURE sections");
|
|
11890
|
-
if (this.sections[this.sections.length - 1].type !==
|
|
11891
|
+
if (this.sections[this.sections.length - 1].type !== D.SIGNATURE) throw new a("The SIGNATURE section is not the last one");
|
|
11891
11892
|
return this.verifySignatureOfSections(e, !0, this.sections.length - 1);
|
|
11892
11893
|
}
|
|
11893
11894
|
async verifyAuxiliarySignature(e, t) {
|
|
11894
|
-
let n = this.sections.filter((e) => e.type ===
|
|
11895
|
+
let n = this.sections.filter((e) => e.type === D.AUXILIARY_SIGNATURE && e.tag === t);
|
|
11895
11896
|
if (n.length === 0) throw new a(`The current microblock has no AUXILIARY_SIGNATURE section with tag '${t}'`);
|
|
11896
11897
|
if (n.length !== 1) throw new a(`The current microblock has several AUXILIARY_SIGNATURE section with tag '${t}'`);
|
|
11897
|
-
let r = this.sections.findIndex((e) => e.type ===
|
|
11898
|
+
let r = this.sections.findIndex((e) => e.type === D.AUXILIARY_SIGNATURE && e.tag === t);
|
|
11898
11899
|
return this.verifySignatureOfSections(e, !1, r);
|
|
11899
11900
|
}
|
|
11900
11901
|
async verifySignatureOfSections(t, n, r) {
|
|
11901
11902
|
let i = this.sections[r];
|
|
11902
|
-
if (i.type !==
|
|
11903
|
+
if (i.type !== D.SIGNATURE && i.type !== D.AUXILIARY_SIGNATURE) throw new a("Attempt to verify the signature of a non-signature section");
|
|
11903
11904
|
let o = this.sections.slice(0, r), s = {
|
|
11904
11905
|
...this.header,
|
|
11905
11906
|
gas: n ? this.header.gas : 0,
|
|
@@ -11933,22 +11934,22 @@ var { NEVER: xx, ALWAYS: Sx, DECIMAL_ROUND: Cx, DECIMAL_FIT: wx } = Wb, Tx = 204
|
|
|
11933
11934
|
let t = this.sections.map((e, t) => ({
|
|
11934
11935
|
section: e,
|
|
11935
11936
|
index: t
|
|
11936
|
-
})).filter(({ section: e, index: t }) => e.type ===
|
|
11937
|
+
})).filter(({ section: e, index: t }) => e.type === D.SIGNATURE);
|
|
11937
11938
|
if (t.length < e) throw new i(`Cannot return the ${e}-th signature: only ${t.length} signature (index starting at 1)`);
|
|
11938
11939
|
let n = t[e - 1];
|
|
11939
|
-
if (n.section.type !==
|
|
11940
|
+
if (n.section.type !== D.SIGNATURE) throw Error("Returned section is not a signature section");
|
|
11940
11941
|
return {
|
|
11941
11942
|
signatureSection: n.section,
|
|
11942
11943
|
sectionIndexInMicroblock: n.index
|
|
11943
11944
|
};
|
|
11944
11945
|
}
|
|
11945
11946
|
getNumberOfSignatures() {
|
|
11946
|
-
return this.sections.filter((e) => e.type ===
|
|
11947
|
+
return this.sections.filter((e) => e.type === D.SIGNATURE).length;
|
|
11947
11948
|
}
|
|
11948
11949
|
isLastSectionSignature() {
|
|
11949
|
-
return this.sections.length == 0 ? !1 : this.sections[this.sections.length - 1].type ===
|
|
11950
|
+
return this.sections.length == 0 ? !1 : this.sections[this.sections.length - 1].type === D.SIGNATURE;
|
|
11950
11951
|
}
|
|
11951
|
-
isTemporallyCloseTo(e =
|
|
11952
|
+
isTemporallyCloseTo(e = k.getTimestampInSeconds()) {
|
|
11952
11953
|
return this.header.timestamp < e - 300 ? Xx.TOO_FAR_IN_THE_PAST : this.header.timestamp > e + 120 ? Xx.TOO_FAR_IN_THE_FUTURE : Xx.VALID;
|
|
11953
11954
|
}
|
|
11954
11955
|
hasSection(e) {
|
|
@@ -11969,7 +11970,7 @@ var { NEVER: xx, ALWAYS: Sx, DECIMAL_ROUND: Cx, DECIMAL_FIT: wx } = Wb, Tx = 204
|
|
|
11969
11970
|
let n = this.getType(), r = t.getType();
|
|
11970
11971
|
if (n !== r) throw new i(`Cannot make this microblock the successor: expected microblock of type ${n}, got ${r}`);
|
|
11971
11972
|
let a = t.getHash();
|
|
11972
|
-
this.setPreviousHash(a), this.setHeight(t.getHeight() + 1), this.hash = e.computeMicroblockHash(this.header), e.logger.info(`Microblock ${
|
|
11973
|
+
this.setPreviousHash(a), this.setHeight(t.getHeight() + 1), this.hash = e.computeMicroblockHash(this.header), e.logger.info(`Microblock ${k.binaryToHexa(this.hash)} updated as successor of microblock ${a.encode()}`);
|
|
11973
11974
|
}
|
|
11974
11975
|
countSectionsByType(e) {
|
|
11975
11976
|
return this.sections.filter((t) => t.type === e).length;
|
|
@@ -11993,7 +11994,7 @@ var { NEVER: xx, ALWAYS: Sx, DECIMAL_ROUND: Cx, DECIMAL_FIT: wx } = Wb, Tx = 204
|
|
|
11993
11994
|
toString() {
|
|
11994
11995
|
let e = yg.bytesToHexEncoder(), t = "Microblock:\n";
|
|
11995
11996
|
return t += ` Hash: ${e.encode(this.hash)}\n`, t += ` Recomputed hash: ${e.encode(this.computeHash())}\n`, t += " Header:\n", t += ` Microblock type: ${this.header.microblockType} or ${this.type}\n`, t += ` Magic String: ${this.header.magicString}\n`, t += ` Fees payer account: ${e.encode(this.header.feesPayerAccount)}\n`, t += ` Height: ${this.header.height}\n`, t += ` Previous Hash: ${e.encode(this.header.previousHash)}\n`, t += ` Timestamp: ${this.header.timestamp}\n`, t += ` Gas: ${this.header.gas}\n`, t += ` Gas Price: ${this.header.gasPrice}\n`, t += ` Body Hash: ${e.encode(this.header.bodyHash)}\n`, t += ` Computed body Hash: ${e.encode(this.computeBodyHash())}\n`, t += ` Sections (${this.sections.length}):\n`, this.sections.forEach((e, n) => {
|
|
11996
|
-
t += ` Section ${n}:\n`, t += ` Section Type: ${Wx.getSectionLabelFromSection(e)} (type ${e.type})\n`, t += ` Section Data: ${
|
|
11997
|
+
t += ` Section ${n}:\n`, t += ` Section Type: ${Wx.getSectionLabelFromSection(e)} (type ${e.type})\n`, t += ` Section Data: ${k.binaryToHexa(X.encodeSection(e))}\n`;
|
|
11997
11998
|
}), t;
|
|
11998
11999
|
}
|
|
11999
12000
|
getType() {
|
|
@@ -12013,7 +12014,7 @@ var { NEVER: xx, ALWAYS: Sx, DECIMAL_ROUND: Cx, DECIMAL_FIT: wx } = Wb, Tx = 204
|
|
|
12013
12014
|
}
|
|
12014
12015
|
isDeclaringConsistentBodyHash() {
|
|
12015
12016
|
let e = this.computeBodyHash();
|
|
12016
|
-
return
|
|
12017
|
+
return k.binaryIsEqual(e, this.header.bodyHash);
|
|
12017
12018
|
}
|
|
12018
12019
|
isGenesisMicroblock() {
|
|
12019
12020
|
return this.getHeight() === 1;
|
|
@@ -12030,16 +12031,16 @@ var { NEVER: xx, ALWAYS: Sx, DECIMAL_ROUND: Cx, DECIMAL_FIT: wx } = Wb, Tx = 204
|
|
|
12030
12031
|
}
|
|
12031
12032
|
getLastSignatureSection() {
|
|
12032
12033
|
let e = this.sections[this.sections.length - 1];
|
|
12033
|
-
if (e.type !==
|
|
12034
|
+
if (e.type !== D.SIGNATURE) throw Error("Last section is not a signature section");
|
|
12034
12035
|
return e;
|
|
12035
12036
|
}
|
|
12036
12037
|
}, $x = class {
|
|
12037
12038
|
onMicroblockSearchFailureForExceedingHeight(e, t) {
|
|
12038
|
-
throw e.isEmpty() ? new x(Nx.from(
|
|
12039
|
+
throw e.isEmpty() ? new x(Nx.from(k.getNullHash()), t) : new x(e.getIdentifier(), t);
|
|
12039
12040
|
}
|
|
12040
12041
|
}, eS = class e {
|
|
12041
12042
|
static INITIAL_HEIGHT = 1;
|
|
12042
|
-
static staticLogger =
|
|
12043
|
+
static staticLogger = O.getVirtualBlockchainLogger();
|
|
12043
12044
|
logger = e.staticLogger;
|
|
12044
12045
|
internalState;
|
|
12045
12046
|
height;
|
|
@@ -12053,12 +12054,12 @@ var { NEVER: xx, ALWAYS: Sx, DECIMAL_ROUND: Cx, DECIMAL_FIT: wx } = Wb, Tx = 204
|
|
|
12053
12054
|
microblockSearchFailureFallback;
|
|
12054
12055
|
onMicroblockInsertionEventListeners = [];
|
|
12055
12056
|
constructor(e, t, n) {
|
|
12056
|
-
this.internalState = n, this.provider = e, this.microblockHashByHeight = /* @__PURE__ */ new Map(), this.microblockByHeight = /* @__PURE__ */ new Map(), this.type = t, this.merkleRootHash =
|
|
12057
|
+
this.internalState = n, this.provider = e, this.microblockHashByHeight = /* @__PURE__ */ new Map(), this.microblockByHeight = /* @__PURE__ */ new Map(), this.type = t, this.merkleRootHash = k.getNullHash(), this.expirationDay = 0, this.height = 0, this.microblockSearchFailureFallback = new $x();
|
|
12057
12058
|
}
|
|
12058
12059
|
async isAccountIdAllowedToWrite(e) {
|
|
12059
12060
|
if (this.height === 0) return !0;
|
|
12060
12061
|
let t = await this.getVirtualBlockchainOwnerId();
|
|
12061
|
-
return
|
|
12062
|
+
return k.binaryIsEqual(t.toBytes(), e.toBytes());
|
|
12062
12063
|
}
|
|
12063
12064
|
getProvider() {
|
|
12064
12065
|
return this.provider;
|
|
@@ -12090,7 +12091,7 @@ var { NEVER: xx, ALWAYS: Sx, DECIMAL_ROUND: Cx, DECIMAL_FIT: wx } = Wb, Tx = 204
|
|
|
12090
12091
|
this.height = e;
|
|
12091
12092
|
}
|
|
12092
12093
|
setIdentifier(e) {
|
|
12093
|
-
this.logger.debug(`Updating virtual blockchain identifier to ${
|
|
12094
|
+
this.logger.debug(`Updating virtual blockchain identifier to ${k.binaryToHexa(e)}`), this.identifier = e;
|
|
12094
12095
|
}
|
|
12095
12096
|
setMicroblockHashes(e) {
|
|
12096
12097
|
let t = 1;
|
|
@@ -12151,13 +12152,13 @@ var { NEVER: xx, ALWAYS: Sx, DECIMAL_ROUND: Cx, DECIMAL_FIT: wx } = Wb, Tx = 204
|
|
|
12151
12152
|
if (t !== n) throw Error(`Microblock height mismatch: expected ${t} but got ${n}`);
|
|
12152
12153
|
if (!this.isEmpty()) {
|
|
12153
12154
|
let t = (await this.getLastMicroblock()).getHash().toBytes(), n = e.getPreviousHash().toBytes();
|
|
12154
|
-
if (!
|
|
12155
|
+
if (!k.binaryIsEqual(n, t)) throw Error(`Previous hash mismatch: microblock's previous hash ${k.binaryToHexa(n)} does not match the last microblock's hash ${k.binaryToHexa(t)}`);
|
|
12155
12156
|
}
|
|
12156
12157
|
if (!this.checkMicroblockStructure(e)) throw new i("Provided microblock has an invalid structure");
|
|
12157
12158
|
let r = await this.provider.getProtocolState();
|
|
12158
12159
|
this.internalState = await this.updateInternalState(r, this.internalState, e), this.identifier === void 0 && (this.identifier = e.getHash().toBytes()), this.height += 1;
|
|
12159
12160
|
let a = e.getHash().toBytes();
|
|
12160
|
-
this.microblockHashByHeight.set(this.height, a), this.microblockByHeight.set(this.height, e), this.logger.debug(`Microblock ${
|
|
12161
|
+
this.microblockHashByHeight.set(this.height, a), this.microblockByHeight.set(this.height, e), this.logger.debug(`Microblock ${k.binaryToHexa(a)} added to vb (now at height ${this.height} `);
|
|
12161
12162
|
}
|
|
12162
12163
|
setMicroblockSearchFailureFallback(e) {
|
|
12163
12164
|
this.microblockSearchFailureFallback = e;
|
|
@@ -12231,11 +12232,11 @@ var { NEVER: xx, ALWAYS: Sx, DECIMAL_ROUND: Cx, DECIMAL_FIT: wx } = Wb, Tx = 204
|
|
|
12231
12232
|
return Wx.getSectionLabelFromSectionType(e);
|
|
12232
12233
|
}
|
|
12233
12234
|
}, rS = class {
|
|
12234
|
-
logger =
|
|
12235
|
+
logger = O.getMicroblockStructureCheckerLogger();
|
|
12235
12236
|
checkMicroblockStructure(e) {
|
|
12236
12237
|
try {
|
|
12237
12238
|
let t = new nS(e);
|
|
12238
|
-
return t.expects(t.isFirstBlock() ? Z.ONE : Z.ZERO,
|
|
12239
|
+
return t.expects(t.isFirstBlock() ? Z.ONE : Z.ZERO, D.ORG_CREATION), t.group(Z.AT_LEAST_ONE, [[Z.AT_MOST_ONE, D.ORG_DESCRIPTION], [Z.ANY, D.CUSTOM]]), t.expects(Z.ANY, D.AUXILIARY_SIGNATURE), t.expects(Z.ONE, D.SIGNATURE), t.endsHere(), !0;
|
|
12239
12240
|
} catch (e) {
|
|
12240
12241
|
return typeof e == "string" && this.logger.error(`Microblock structure error details: ${e}`), e instanceof Error && (e instanceof s ? this.logger.error(`Microblock structure error: ${e.message}`) : this.logger.error(`An unexpected error occurred during structure checking: ${e.message} at ${e.stack}`)), !1;
|
|
12241
12242
|
}
|
|
@@ -12252,7 +12253,7 @@ var { NEVER: xx, ALWAYS: Sx, DECIMAL_ROUND: Cx, DECIMAL_FIT: wx } = Wb, Tx = 204
|
|
|
12252
12253
|
return Yx.createOrganizationInternalStateUpdater(r).updateState(this.provider, t, n);
|
|
12253
12254
|
}
|
|
12254
12255
|
async getVirtualBlockchainState() {
|
|
12255
|
-
let e = this.getHeight(), t = e === 0 ?
|
|
12256
|
+
let e = this.getHeight(), t = e === 0 ? k.getNullHash() : (await this.getLastMicroblock()).getHash().toBytes();
|
|
12256
12257
|
return {
|
|
12257
12258
|
expirationDay: this.getExpirationDay(),
|
|
12258
12259
|
height: e,
|
|
@@ -12273,26 +12274,26 @@ var { NEVER: xx, ALWAYS: Sx, DECIMAL_ROUND: Cx, DECIMAL_FIT: wx } = Wb, Tx = 204
|
|
|
12273
12274
|
}
|
|
12274
12275
|
async getDescription() {
|
|
12275
12276
|
let e = this.internalState.getDescriptionHeight(), t = await this.getMicroblock(e);
|
|
12276
|
-
for (let e of t.getAllSections()) if (e.type ===
|
|
12277
|
+
for (let e of t.getAllSections()) if (e.type === D.ORG_DESCRIPTION) return e;
|
|
12277
12278
|
throw new a("No description found for the organization");
|
|
12278
12279
|
}
|
|
12279
12280
|
}, aS = class {
|
|
12280
|
-
logger =
|
|
12281
|
+
logger = O.getMicroblockStructureCheckerLogger();
|
|
12281
12282
|
checkMicroblockStructure(e) {
|
|
12282
12283
|
try {
|
|
12283
12284
|
let t = new nS(e);
|
|
12284
|
-
return !t.isFirstBlock() && t.expects(Z.AT_MOST_ONE,
|
|
12285
|
-
[Z.AT_MOST_ONE,
|
|
12286
|
-
[Z.AT_MOST_ONE,
|
|
12287
|
-
[Z.ANY,
|
|
12285
|
+
return !t.isFirstBlock() && t.expects(Z.AT_MOST_ONE, D.ACCOUNT_ESCROW_SETTLEMENT) === 1 || (t.expects(t.isFirstBlock() ? Z.ONE : Z.AT_MOST_ONE, D.ACCOUNT_PUBLIC_KEY), t.isFirstBlock() ? t.group(Z.ONE, [
|
|
12286
|
+
[Z.AT_MOST_ONE, D.ACCOUNT_TOKEN_ISSUANCE],
|
|
12287
|
+
[Z.AT_MOST_ONE, D.ACCOUNT_CREATION],
|
|
12288
|
+
[Z.ANY, D.CUSTOM]
|
|
12288
12289
|
]) : t.group(Z.AT_LEAST_ONE, [
|
|
12289
|
-
[Z.ANY,
|
|
12290
|
-
[Z.ANY,
|
|
12291
|
-
[Z.ANY,
|
|
12292
|
-
[Z.ANY,
|
|
12293
|
-
[Z.ANY,
|
|
12294
|
-
[Z.ANY,
|
|
12295
|
-
])), t.expects(Z.ANY,
|
|
12290
|
+
[Z.ANY, D.ACCOUNT_TRANSFER],
|
|
12291
|
+
[Z.ANY, D.ACCOUNT_VESTING_TRANSFER],
|
|
12292
|
+
[Z.ANY, D.ACCOUNT_STAKE],
|
|
12293
|
+
[Z.ANY, D.ACCOUNT_UNSTAKE],
|
|
12294
|
+
[Z.ANY, D.ACCOUNT_ESCROW_TRANSFER],
|
|
12295
|
+
[Z.ANY, D.CUSTOM]
|
|
12296
|
+
])), t.expects(Z.ANY, D.AUXILIARY_SIGNATURE), t.expects(Z.ONE, D.SIGNATURE), t.endsHere(), !0;
|
|
12296
12297
|
} catch (e) {
|
|
12297
12298
|
return e instanceof Error && (e instanceof s ? this.logger.error(`Invalid microblock structure: ${e.message}`) : this.logger.error(`Unexpected error occurred during microblock structure checking: ${e.message} at ${e.stack}`)), !1;
|
|
12298
12299
|
}
|
|
@@ -12306,7 +12307,7 @@ var { NEVER: xx, ALWAYS: Sx, DECIMAL_ROUND: Cx, DECIMAL_FIT: wx } = Wb, Tx = 204
|
|
|
12306
12307
|
return Yx.createAccountInternalStateUpdater(r).updateState(this.provider, t, n);
|
|
12307
12308
|
}
|
|
12308
12309
|
async getVirtualBlockchainState() {
|
|
12309
|
-
let e = this.getHeight(), t = e === 0 ?
|
|
12310
|
+
let e = this.getHeight(), t = e === 0 ? k.getNullHash() : (await this.getLastMicroblock()).getHash().toBytes();
|
|
12310
12311
|
return {
|
|
12311
12312
|
expirationDay: this.getExpirationDay(),
|
|
12312
12313
|
height: e,
|
|
@@ -12324,22 +12325,22 @@ var { NEVER: xx, ALWAYS: Sx, DECIMAL_ROUND: Cx, DECIMAL_FIT: wx } = Wb, Tx = 204
|
|
|
12324
12325
|
}
|
|
12325
12326
|
async getPublicKey() {
|
|
12326
12327
|
let e = this.internalState.getPublicKeyHeight(), t = this.internalState.getPublicKeySchemeId(), n = await this.getMicroblock(e);
|
|
12327
|
-
for (let e of n.getAllSections()) if (e.type ===
|
|
12328
|
+
for (let e of n.getAllSections()) if (e.type === D.ACCOUNT_PUBLIC_KEY) return new Xv().createPublicSignatureKey(t, e.publicKey);
|
|
12328
12329
|
throw new a("Account public key not found");
|
|
12329
12330
|
}
|
|
12330
12331
|
async isIssuer() {
|
|
12331
12332
|
let e = await this.getFirstMicroBlock();
|
|
12332
|
-
for (let t of e.getAllSections()) if (t.type ===
|
|
12333
|
+
for (let t of e.getAllSections()) if (t.type === D.ACCOUNT_TOKEN_ISSUANCE) return !0;
|
|
12333
12334
|
return !1;
|
|
12334
12335
|
}
|
|
12335
12336
|
static async createAccountCreationMicroblock(e, t, n, r = "") {
|
|
12336
12337
|
let i = Qx.createGenesisAccountMicroblock();
|
|
12337
12338
|
return i.addSection({
|
|
12338
|
-
type:
|
|
12339
|
+
type: D.ACCOUNT_PUBLIC_KEY,
|
|
12339
12340
|
publicKey: await e.getPublicKeyAsBytes(),
|
|
12340
12341
|
schemeId: e.getSignatureSchemeId()
|
|
12341
12342
|
}), i.addSection({
|
|
12342
|
-
type:
|
|
12343
|
+
type: D.ACCOUNT_CREATION,
|
|
12343
12344
|
amount: t.getAmountAsAtomic(),
|
|
12344
12345
|
sellerAccount: n
|
|
12345
12346
|
}), i;
|
|
@@ -12347,20 +12348,20 @@ var { NEVER: xx, ALWAYS: Sx, DECIMAL_ROUND: Cx, DECIMAL_FIT: wx } = Wb, Tx = 204
|
|
|
12347
12348
|
static async createIssuerAccountCreationMicroblock(e) {
|
|
12348
12349
|
let t = e, n = Qx.createGenesisAccountMicroblock();
|
|
12349
12350
|
return n.addSection({
|
|
12350
|
-
type:
|
|
12351
|
+
type: D.ACCOUNT_PUBLIC_KEY,
|
|
12351
12352
|
publicKey: await t.getPublicKeyAsBytes(),
|
|
12352
12353
|
schemeId: t.getSignatureSchemeId()
|
|
12353
12354
|
}), n.addSection({
|
|
12354
|
-
type:
|
|
12355
|
+
type: D.ACCOUNT_TOKEN_ISSUANCE,
|
|
12355
12356
|
amount: lr
|
|
12356
12357
|
}), n;
|
|
12357
12358
|
}
|
|
12358
12359
|
}, sS = class {
|
|
12359
|
-
logger =
|
|
12360
|
+
logger = O.getMicroblockStructureCheckerLogger();
|
|
12360
12361
|
checkMicroblockStructure(e) {
|
|
12361
12362
|
try {
|
|
12362
12363
|
let t = new nS(e);
|
|
12363
|
-
return t.expects(t.isFirstBlock() ? Z.ONE : Z.ZERO,
|
|
12364
|
+
return t.expects(t.isFirstBlock() ? Z.ONE : Z.ZERO, D.APP_CREATION), t.group(Z.AT_LEAST_ONE, [[Z.AT_MOST_ONE, D.APP_DESCRIPTION], [Z.ANY, D.CUSTOM]]), t.expects(Z.ANY, D.AUXILIARY_SIGNATURE), t.expects(Z.ONE, D.SIGNATURE), t.endsHere(), !0;
|
|
12364
12365
|
} catch (e) {
|
|
12365
12366
|
return e instanceof Error && (e instanceof s ? this.logger.error(`Invalid microblock structure: ${e.message}`) : this.logger.error(`Unexpected error occurred during microblock structure checking: ${e.message} at ${e.stack}`)), !1;
|
|
12366
12367
|
}
|
|
@@ -12374,7 +12375,7 @@ var { NEVER: xx, ALWAYS: Sx, DECIMAL_ROUND: Cx, DECIMAL_FIT: wx } = Wb, Tx = 204
|
|
|
12374
12375
|
return Yx.createApplicationInternalStateUpdater(r).updateState(this.provider, t, n);
|
|
12375
12376
|
}
|
|
12376
12377
|
async getVirtualBlockchainState() {
|
|
12377
|
-
let e = this.getHeight(), t = e === 0 ?
|
|
12378
|
+
let e = this.getHeight(), t = e === 0 ? k.getNullHash() : (await this.getLastMicroblock()).getHash().toBytes();
|
|
12378
12379
|
return {
|
|
12379
12380
|
expirationDay: this.getExpirationDay(),
|
|
12380
12381
|
height: e,
|
|
@@ -12396,19 +12397,19 @@ var { NEVER: xx, ALWAYS: Sx, DECIMAL_ROUND: Cx, DECIMAL_FIT: wx } = Wb, Tx = 204
|
|
|
12396
12397
|
}
|
|
12397
12398
|
async getApplicationDescription() {
|
|
12398
12399
|
let e = this.internalState.getDescriptionHeight(), t = await this.getMicroblock(e);
|
|
12399
|
-
for (let e of t.getAllSections()) if (e.type ==
|
|
12400
|
+
for (let e of t.getAllSections()) if (e.type == D.APP_DESCRIPTION) return e;
|
|
12400
12401
|
throw Error("Application description not found");
|
|
12401
12402
|
}
|
|
12402
12403
|
}, lS = class {
|
|
12403
|
-
logger =
|
|
12404
|
+
logger = O.getMicroblockStructureCheckerLogger();
|
|
12404
12405
|
checkMicroblockStructure(e) {
|
|
12405
12406
|
try {
|
|
12406
|
-
let t = new nS(e), n = !t.isFirstBlock() && t.expects(Z.AT_MOST_ONE,
|
|
12407
|
-
return !n && !r && (t.expects(t.isFirstBlock() ? Z.ONE : Z.ZERO,
|
|
12408
|
-
[Z.AT_MOST_ONE,
|
|
12409
|
-
[Z.AT_MOST_ONE,
|
|
12410
|
-
[Z.ANY,
|
|
12411
|
-
])), t.expects(Z.ANY,
|
|
12407
|
+
let t = new nS(e), n = !t.isFirstBlock() && t.expects(Z.AT_MOST_ONE, D.VN_APPROVAL) === 1, r = !n && !t.isFirstBlock() && t.expects(Z.AT_MOST_ONE, D.VN_SLASHING_CANCELLATION) === 1;
|
|
12408
|
+
return !n && !r && (t.expects(t.isFirstBlock() ? Z.ONE : Z.ZERO, D.VN_CREATION), t.group(Z.AT_LEAST_ONE, [
|
|
12409
|
+
[Z.AT_MOST_ONE, D.VN_COMETBFT_PUBLIC_KEY_DECLARATION],
|
|
12410
|
+
[Z.AT_MOST_ONE, D.VN_RPC_ENDPOINT],
|
|
12411
|
+
[Z.ANY, D.CUSTOM]
|
|
12412
|
+
])), t.expects(Z.ANY, D.AUXILIARY_SIGNATURE), t.expects(Z.ONE, D.SIGNATURE), t.endsHere(), !0;
|
|
12412
12413
|
} catch (e) {
|
|
12413
12414
|
return e instanceof Error && (e instanceof s ? this.logger.error(`Invalid microblock structure: ${e.message}`) : this.logger.error(`Unexpected error occurred during microblock structure checking: ${e.message} at ${e.stack}`)), !1;
|
|
12414
12415
|
}
|
|
@@ -12422,7 +12423,7 @@ var { NEVER: xx, ALWAYS: Sx, DECIMAL_ROUND: Cx, DECIMAL_FIT: wx } = Wb, Tx = 204
|
|
|
12422
12423
|
return Yx.createValidatorNodeInternalStateUpdater(r).updateState(this.provider, t, n);
|
|
12423
12424
|
}
|
|
12424
12425
|
async getVirtualBlockchainState() {
|
|
12425
|
-
let e = this.getHeight(), t = e === 0 ?
|
|
12426
|
+
let e = this.getHeight(), t = e === 0 ? k.getNullHash() : (await this.getLastMicroblock()).getHash().toBytes();
|
|
12426
12427
|
return {
|
|
12427
12428
|
expirationDay: this.getExpirationDay(),
|
|
12428
12429
|
height: e,
|
|
@@ -12447,7 +12448,7 @@ var { NEVER: xx, ALWAYS: Sx, DECIMAL_ROUND: Cx, DECIMAL_FIT: wx } = Wb, Tx = 204
|
|
|
12447
12448
|
if (e === 0) throw new a("Node has not declared its CometBFT public key yet");
|
|
12448
12449
|
let t = await this.getMicroblock(e);
|
|
12449
12450
|
for (let e of t.getAllSections()) {
|
|
12450
|
-
if (e.type !==
|
|
12451
|
+
if (e.type !== D.VN_COMETBFT_PUBLIC_KEY_DECLARATION) continue;
|
|
12451
12452
|
let t = e.cometPublicKey;
|
|
12452
12453
|
return {
|
|
12453
12454
|
cometbftPublicKeyType: e.cometPublicKeyType,
|
|
@@ -12460,7 +12461,7 @@ var { NEVER: xx, ALWAYS: Sx, DECIMAL_ROUND: Cx, DECIMAL_FIT: wx } = Wb, Tx = 204
|
|
|
12460
12461
|
let e = this.internalState.getRpcEndpointHeight();
|
|
12461
12462
|
if (e === 0) throw new a("Node has not declared its RPC endpoint yet");
|
|
12462
12463
|
let t = await this.getMicroblock(e);
|
|
12463
|
-
for (let e of t.getAllSections()) if (e.type ===
|
|
12464
|
+
for (let e of t.getAllSections()) if (e.type === D.VN_RPC_ENDPOINT) return e.rpcEndpoint;
|
|
12464
12465
|
throw new a("Node has not declared its RPC endpoint yet");
|
|
12465
12466
|
}
|
|
12466
12467
|
getNodeDeclarationHeight() {
|
|
@@ -12471,11 +12472,11 @@ var { NEVER: xx, ALWAYS: Sx, DECIMAL_ROUND: Cx, DECIMAL_FIT: wx } = Wb, Tx = 204
|
|
|
12471
12472
|
return await this.provider.loadOrganizationVirtualBlockchain(e);
|
|
12472
12473
|
}
|
|
12473
12474
|
}, dS = class {
|
|
12474
|
-
logger =
|
|
12475
|
+
logger = O.getMicroblockStructureCheckerLogger();
|
|
12475
12476
|
checkMicroblockStructure(e) {
|
|
12476
12477
|
try {
|
|
12477
12478
|
let t = new nS(e);
|
|
12478
|
-
return t.expects(t.isFirstBlock() ? Z.ONE : Z.ZERO,
|
|
12479
|
+
return t.expects(t.isFirstBlock() ? Z.ONE : Z.ZERO, D.PROTOCOL_CREATION), t.isFirstBlock() || t.group(Z.AT_MOST_ONE, [[Z.ONE, D.PROTOCOL_UPDATE], [Z.ANY, D.CUSTOM]]), t.expects(Z.ANY, D.AUXILIARY_SIGNATURE), t.expects(Z.ONE, D.SIGNATURE), t.endsHere(), !0;
|
|
12479
12480
|
} catch (e) {
|
|
12480
12481
|
return typeof e == "string" && this.logger.error(`Microblock structure error details: ${e}`), e instanceof Error && (e instanceof s ? this.logger.error(`Microblock structure error: ${e.message}`) : this.logger.error(`An unexpected error occurred during structure checking: ${e.message} at ${e.stack}`)), !1;
|
|
12481
12482
|
}
|
|
@@ -12492,7 +12493,7 @@ var { NEVER: xx, ALWAYS: Sx, DECIMAL_ROUND: Cx, DECIMAL_FIT: wx } = Wb, Tx = 204
|
|
|
12492
12493
|
return Yx.createProtocolInternalStateUpdater(r).updateState(this.provider, t, n);
|
|
12493
12494
|
}
|
|
12494
12495
|
async getVirtualBlockchainState() {
|
|
12495
|
-
let e = this.getHeight(), t = e === 0 ?
|
|
12496
|
+
let e = this.getHeight(), t = e === 0 ? k.getNullHash() : (await this.getLastMicroblock()).getHash().toBytes();
|
|
12496
12497
|
return {
|
|
12497
12498
|
expirationDay: this.getExpirationDay(),
|
|
12498
12499
|
height: e,
|
|
@@ -12508,7 +12509,7 @@ var { NEVER: xx, ALWAYS: Sx, DECIMAL_ROUND: Cx, DECIMAL_FIT: wx } = Wb, Tx = 204
|
|
|
12508
12509
|
}
|
|
12509
12510
|
async getOrganizationId() {
|
|
12510
12511
|
let e = (await this.getFirstMicroBlock()).getAllSections();
|
|
12511
|
-
for (let t of e) if (t.type ===
|
|
12512
|
+
for (let t of e) if (t.type === D.PROTOCOL_CREATION) return Nx.from(t.organizationId);
|
|
12512
12513
|
throw Error("Organization ID not found in protocol vb");
|
|
12513
12514
|
}
|
|
12514
12515
|
}, pS = class {
|
|
@@ -12516,23 +12517,23 @@ var { NEVER: xx, ALWAYS: Sx, DECIMAL_ROUND: Cx, DECIMAL_FIT: wx } = Wb, Tx = 204
|
|
|
12516
12517
|
if (!e) throw new m(`Assertion failed: ${t}`);
|
|
12517
12518
|
}
|
|
12518
12519
|
}, mS = class {
|
|
12519
|
-
logger =
|
|
12520
|
+
logger = O.getMicroblockStructureCheckerLogger();
|
|
12520
12521
|
checkMicroblockStructure(e) {
|
|
12521
12522
|
try {
|
|
12522
12523
|
let t = new nS(e);
|
|
12523
|
-
return t.expects(t.isFirstBlock() ? Z.ONE : Z.ZERO,
|
|
12524
|
-
[Z.ANY,
|
|
12525
|
-
[Z.ANY,
|
|
12526
|
-
[Z.ANY,
|
|
12527
|
-
[Z.ANY,
|
|
12528
|
-
[Z.ANY,
|
|
12529
|
-
[Z.ANY,
|
|
12530
|
-
[Z.ANY,
|
|
12531
|
-
[Z.ANY,
|
|
12532
|
-
[Z.ANY,
|
|
12533
|
-
[Z.ANY,
|
|
12534
|
-
[Z.ANY,
|
|
12535
|
-
]), t.expects(Z.ANY,
|
|
12524
|
+
return t.expects(t.isFirstBlock() ? Z.ONE : Z.ZERO, D.APP_LEDGER_CREATION), t.group(Z.ANY, [
|
|
12525
|
+
[Z.ANY, D.APP_LEDGER_ACTOR_CREATION],
|
|
12526
|
+
[Z.ANY, D.APP_LEDGER_ACTOR_SUBSCRIPTION],
|
|
12527
|
+
[Z.ANY, D.APP_LEDGER_ENDORSEMENT_REQUEST],
|
|
12528
|
+
[Z.ANY, D.APP_LEDGER_AUTHOR],
|
|
12529
|
+
[Z.ANY, D.APP_LEDGER_PUBLIC_CHANNEL_DATA],
|
|
12530
|
+
[Z.ANY, D.APP_LEDGER_PRIVATE_CHANNEL_DATA],
|
|
12531
|
+
[Z.ANY, D.APP_LEDGER_SHARED_SECRET],
|
|
12532
|
+
[Z.ANY, D.APP_LEDGER_CHANNEL_CREATION],
|
|
12533
|
+
[Z.ANY, D.APP_LEDGER_CHANNEL_INVITATION],
|
|
12534
|
+
[Z.ANY, D.ALLOWED_ADDITIONAL_WRITER],
|
|
12535
|
+
[Z.ANY, D.CUSTOM]
|
|
12536
|
+
]), t.expects(Z.ANY, D.AUXILIARY_SIGNATURE), t.expects(Z.ONE, D.SIGNATURE), t.endsHere(), !0;
|
|
12536
12537
|
} catch (e) {
|
|
12537
12538
|
return typeof e == "string" && this.logger.error(`Microblock structure error details: ${e}`), e instanceof Error && (e instanceof s ? this.logger.error(`Microblock structure error: ${e.message}`) : this.logger.error(`An unexpected error occurred during structure checking: ${e.message} at ${e.stack}`)), !1;
|
|
12538
12539
|
}
|
|
@@ -12789,7 +12790,7 @@ var DS = /* @__PURE__ */ function(e) {
|
|
|
12789
12790
|
issued_at: e.toISOString(),
|
|
12790
12791
|
digest_alg: "sha256",
|
|
12791
12792
|
digest_target: "cbor_proof",
|
|
12792
|
-
digest:
|
|
12793
|
+
digest: k.binaryToHexa(t)
|
|
12793
12794
|
}, r = this.encoder.encode(n);
|
|
12794
12795
|
M.Hashes.sha256AsBinary(r), this.wrapper.signature = {
|
|
12795
12796
|
commitment: n,
|
|
@@ -12864,7 +12865,7 @@ var DS = /* @__PURE__ */ function(e) {
|
|
|
12864
12865
|
let e = this.nLeaves;
|
|
12865
12866
|
for (this.tree = []; e;) {
|
|
12866
12867
|
let t = Array(e).fill(null);
|
|
12867
|
-
e > 1 && e & 1 && (t.push(
|
|
12868
|
+
e > 1 && e & 1 && (t.push(k.getNullHash()), e++), this.tree.push(t), e >>= 1;
|
|
12868
12869
|
}
|
|
12869
12870
|
for (let e = 0; e < this.nLeaves; e++) this.leaves[e] && (this.tree[0][e] = this.leaves[e]);
|
|
12870
12871
|
}
|
|
@@ -12983,19 +12984,19 @@ var DS = /* @__PURE__ */ function(e) {
|
|
|
12983
12984
|
this.setPublicDataFromValue(e.value);
|
|
12984
12985
|
break;
|
|
12985
12986
|
case DS.Plain:
|
|
12986
|
-
this.setPlainDataFromValue(
|
|
12987
|
+
this.setPlainDataFromValue(k.binaryFromHexa(e.salt), e.value);
|
|
12987
12988
|
break;
|
|
12988
12989
|
case DS.HashableAsPlain:
|
|
12989
|
-
this.setHashedDataFromValue(
|
|
12990
|
+
this.setHashedDataFromValue(k.binaryFromHexa(e.salt), e.value);
|
|
12990
12991
|
break;
|
|
12991
12992
|
case DS.HashableAsHash:
|
|
12992
|
-
this.setHashedDataFromHash(
|
|
12993
|
+
this.setHashedDataFromHash(k.binaryFromHexa(e.salt), k.binaryFromHexa(e.hash));
|
|
12993
12994
|
break;
|
|
12994
12995
|
case DS.MaskableAsAllParts:
|
|
12995
|
-
this.setMaskedDataFromAllParts(
|
|
12996
|
+
this.setMaskedDataFromAllParts(k.binaryFromHexa(e.v_salt), e.v_parts, k.binaryFromHexa(e.h_salt), e.h_parts);
|
|
12996
12997
|
break;
|
|
12997
12998
|
case DS.MaskableAsVisibleParts:
|
|
12998
|
-
this.setMaskedDataFromVisibleParts(
|
|
12999
|
+
this.setMaskedDataFromVisibleParts(k.binaryFromHexa(e.v_salt), e.v_parts, k.binaryFromHexa(e.h_hash));
|
|
12999
13000
|
break;
|
|
13000
13001
|
}
|
|
13001
13002
|
}
|
|
@@ -13011,39 +13012,39 @@ var DS = /* @__PURE__ */ function(e) {
|
|
|
13011
13012
|
path: e,
|
|
13012
13013
|
index: t,
|
|
13013
13014
|
type: DS.Plain,
|
|
13014
|
-
salt:
|
|
13015
|
+
salt: k.binaryToHexa(n.salt),
|
|
13015
13016
|
value: n.value
|
|
13016
13017
|
};
|
|
13017
13018
|
case Q.HashableFromValue: return {
|
|
13018
13019
|
path: e,
|
|
13019
13020
|
index: t,
|
|
13020
13021
|
type: DS.HashableAsPlain,
|
|
13021
|
-
salt:
|
|
13022
|
+
salt: k.binaryToHexa(n.salt),
|
|
13022
13023
|
value: n.value
|
|
13023
13024
|
};
|
|
13024
13025
|
case Q.Hashable: return {
|
|
13025
13026
|
path: e,
|
|
13026
13027
|
index: t,
|
|
13027
13028
|
type: DS.HashableAsHash,
|
|
13028
|
-
salt:
|
|
13029
|
-
hash:
|
|
13029
|
+
salt: k.binaryToHexa(n.salt),
|
|
13030
|
+
hash: k.binaryToHexa(n.hash)
|
|
13030
13031
|
};
|
|
13031
13032
|
case Q.MaskableFromAllParts: return {
|
|
13032
13033
|
path: e,
|
|
13033
13034
|
index: t,
|
|
13034
13035
|
type: DS.MaskableAsAllParts,
|
|
13035
|
-
v_salt:
|
|
13036
|
+
v_salt: k.binaryToHexa(n.visible.salt),
|
|
13036
13037
|
v_parts: n.visible.parts,
|
|
13037
|
-
h_salt:
|
|
13038
|
+
h_salt: k.binaryToHexa(n.hidden.salt),
|
|
13038
13039
|
h_parts: n.hidden.parts
|
|
13039
13040
|
};
|
|
13040
13041
|
case Q.MaskableFromVisibleParts: return {
|
|
13041
13042
|
path: e,
|
|
13042
13043
|
index: t,
|
|
13043
13044
|
type: DS.MaskableAsVisibleParts,
|
|
13044
|
-
v_salt:
|
|
13045
|
+
v_salt: k.binaryToHexa(n.visible.salt),
|
|
13045
13046
|
v_parts: n.visible.parts,
|
|
13046
|
-
h_hash:
|
|
13047
|
+
h_hash: k.binaryToHexa(n.hiddenHash)
|
|
13047
13048
|
};
|
|
13048
13049
|
default: throw Error(`invalid internal data type ${n.type}`);
|
|
13049
13050
|
}
|
|
@@ -13091,7 +13092,7 @@ var DS = /* @__PURE__ */ function(e) {
|
|
|
13091
13092
|
case Q.Public:
|
|
13092
13093
|
case Q.Plain:
|
|
13093
13094
|
case Q.HashableFromValue: return e.value;
|
|
13094
|
-
case Q.Hashable: return
|
|
13095
|
+
case Q.Hashable: return k.binaryToHexa(e.hash);
|
|
13095
13096
|
case Q.MaskableFromAllParts: return e.visible.parts.map((t, n) => n & 1 ? e.hidden.parts[n >> 1] : t).join("");
|
|
13096
13097
|
case Q.MaskableFromVisibleParts: return e.visible.parts.join("");
|
|
13097
13098
|
default: throw Error(`invalid internal data type ${e.type}`);
|
|
@@ -13155,7 +13156,7 @@ var DS = /* @__PURE__ */ function(e) {
|
|
|
13155
13156
|
index: r
|
|
13156
13157
|
});
|
|
13157
13158
|
}
|
|
13158
|
-
let n = t.witnesses.map((e) =>
|
|
13159
|
+
let n = t.witnesses.map((e) => k.binaryFromHexa(e));
|
|
13159
13160
|
t.is_public && this.publicChannels.add(t.id), this.channelMap.set(t.id, {
|
|
13160
13161
|
nLeaves: t.n_leaves,
|
|
13161
13162
|
leaves: e,
|
|
@@ -13241,11 +13242,11 @@ var DS = /* @__PURE__ */ function(e) {
|
|
|
13241
13242
|
}
|
|
13242
13243
|
getRootHashAsBinary(e) {
|
|
13243
13244
|
let t = this.getChannel(e);
|
|
13244
|
-
return this.publicChannels.has(e) ?
|
|
13245
|
+
return this.publicChannels.has(e) ? k.getNullHash() : t.tree.getRootHash();
|
|
13245
13246
|
}
|
|
13246
13247
|
getRootHashAsHexString(e) {
|
|
13247
13248
|
let t = this.getRootHashAsBinary(e);
|
|
13248
|
-
return
|
|
13249
|
+
return k.binaryToHexa(t);
|
|
13249
13250
|
}
|
|
13250
13251
|
toProofChannels() {
|
|
13251
13252
|
this.buildWitnesses();
|
|
@@ -13257,7 +13258,7 @@ var DS = /* @__PURE__ */ function(e) {
|
|
|
13257
13258
|
let t = e.leaf.toProofFormat(e.path, e.index);
|
|
13258
13259
|
i.push(t);
|
|
13259
13260
|
}
|
|
13260
|
-
let a = n.witnesses.map((e) =>
|
|
13261
|
+
let a = n.witnesses.map((e) => k.binaryToHexa(e));
|
|
13261
13262
|
e.push({
|
|
13262
13263
|
id: t,
|
|
13263
13264
|
is_public: r,
|
|
@@ -13317,7 +13318,7 @@ var DS = /* @__PURE__ */ function(e) {
|
|
|
13317
13318
|
}
|
|
13318
13319
|
getSalt() {
|
|
13319
13320
|
let e = this.counter & 3, t = this.counter++ >> 2;
|
|
13320
|
-
return !e && !this.hasNullPepper && (this.sha512 = M.Hashes.sha512AsBinary(
|
|
13321
|
+
return !e && !this.hasNullPepper && (this.sha512 = M.Hashes.sha512AsBinary(k.binaryFrom(this.pepper, t))), this.sha512.slice(e << 4, e + 1 << 4);
|
|
13321
13322
|
}
|
|
13322
13323
|
}, zS = class e {
|
|
13323
13324
|
channelMap;
|
|
@@ -13334,7 +13335,7 @@ var DS = /* @__PURE__ */ function(e) {
|
|
|
13334
13335
|
this.publicChannels = e.getPublicChannels(), this.recordByChannels = e;
|
|
13335
13336
|
let n = this.recordByChannels.getChannelIds();
|
|
13336
13337
|
for (let e of n) {
|
|
13337
|
-
let n = this.publicChannels.has(e), r = n ?
|
|
13338
|
+
let n = this.publicChannels.has(e), r = n ? k.getNullHash() : t === void 0 ? RS.generatePepper() : t.get(e);
|
|
13338
13339
|
if (r === void 0) throw Error(`no pepper specified for channel ${e}`);
|
|
13339
13340
|
let i = this.recordByChannels.getFlatItems(e);
|
|
13340
13341
|
this.storeChannel(e, n, i, r);
|
|
@@ -13368,7 +13369,7 @@ var DS = /* @__PURE__ */ function(e) {
|
|
|
13368
13369
|
}
|
|
13369
13370
|
getChannelRootHash(e) {
|
|
13370
13371
|
let t = this.getChannel(e);
|
|
13371
|
-
if (this.publicChannels.has(e)) return
|
|
13372
|
+
if (this.publicChannels.has(e)) return k.getNullHash();
|
|
13372
13373
|
let n = new PS();
|
|
13373
13374
|
for (let e of t.positionedLeaves) {
|
|
13374
13375
|
let t = e.leaf.getHash();
|
|
@@ -13591,7 +13592,7 @@ var DS = /* @__PURE__ */ function(e) {
|
|
|
13591
13592
|
let n = new e();
|
|
13592
13593
|
return n.setChannelsFromMerkleRecord(t), n;
|
|
13593
13594
|
}
|
|
13594
|
-
logger =
|
|
13595
|
+
logger = O.getLogger([e.name]);
|
|
13595
13596
|
setChannelsFromMerkleRecord(e) {
|
|
13596
13597
|
this.publicChannels = e.getPublicChannels();
|
|
13597
13598
|
let t = e.getRecordByChannels(), n = e.getChannelIds();
|
|
@@ -13655,7 +13656,7 @@ var DS = /* @__PURE__ */ function(e) {
|
|
|
13655
13656
|
if (e) {
|
|
13656
13657
|
for (let [e, t] of this.channelMap) if (!this.publicChannels.has(e)) {
|
|
13657
13658
|
let n = r.getChannelRootHash(e);
|
|
13658
|
-
if (!
|
|
13659
|
+
if (!k.binaryIsEqual(n, t.rootHash)) throw Error(`inconsistent Merkle root hash for private channel ${e} (computed ${k.binaryToHexa(n)}, on-chain value is ${k.binaryToHexa(t.rootHash)})`);
|
|
13659
13660
|
}
|
|
13660
13661
|
}
|
|
13661
13662
|
return r;
|
|
@@ -13676,10 +13677,10 @@ var DS = /* @__PURE__ */ function(e) {
|
|
|
13676
13677
|
async isAccountIdAllowedToWrite(e) {
|
|
13677
13678
|
if (this.getHeight() === 0) return !0;
|
|
13678
13679
|
let t = await this.getVirtualBlockchainOwnerId(), n = this.internalState.getAdditionalAllowedWriters();
|
|
13679
|
-
return [t.toBytes(), ...n].some((t) =>
|
|
13680
|
+
return [t.toBytes(), ...n].some((t) => k.binaryIsEqual(t, e.toBytes()));
|
|
13680
13681
|
}
|
|
13681
13682
|
async getVirtualBlockchainState() {
|
|
13682
|
-
let e = this.getHeight(), t = e === 0 ?
|
|
13683
|
+
let e = this.getHeight(), t = e === 0 ? k.getNullHash() : (await this.getLastMicroblock()).getHash().toBytes();
|
|
13683
13684
|
return {
|
|
13684
13685
|
expirationDay: this.getExpirationDay(),
|
|
13685
13686
|
height: e,
|
|
@@ -13719,16 +13720,16 @@ var DS = /* @__PURE__ */ function(e) {
|
|
|
13719
13720
|
return this.internalState;
|
|
13720
13721
|
}
|
|
13721
13722
|
async getActorIdByPublicSignatureKey(t) {
|
|
13722
|
-
let n =
|
|
13723
|
+
let n = O.getLogger([e.name]), r = this.internalState, i = t.getPublicKeyAsBytes();
|
|
13723
13724
|
for (let e = 0; e < r.getNumberOfActors(); e++) {
|
|
13724
13725
|
let t = r.getActorById(e);
|
|
13725
13726
|
if (n.debug(`Search current actor id: loop index ${e}`), t.subscribed) try {
|
|
13726
13727
|
let r = await this.getMicroblock(t.signatureKeyHeight);
|
|
13727
13728
|
for (let a of r.getAllSections()) {
|
|
13728
|
-
if (a.type !==
|
|
13729
|
+
if (a.type !== D.APP_LEDGER_ACTOR_SUBSCRIPTION) continue;
|
|
13729
13730
|
let { actorId: r } = a;
|
|
13730
13731
|
if (r !== e) continue;
|
|
13731
|
-
let { signaturePublicKey: o } = a, s =
|
|
13732
|
+
let { signaturePublicKey: o } = a, s = k.binaryIsEqual(a.signaturePublicKey, await i);
|
|
13732
13733
|
if (n.debug(`Is public key matching for actor ${t.name} (id ${e})? ${o} and ${i}: ${s}`), s) return n.debug(`Matching public signature key: {actor.name} (id ${e})`, { actor: t }), e;
|
|
13733
13734
|
}
|
|
13734
13735
|
} catch (e) {
|
|
@@ -13744,7 +13745,7 @@ var DS = /* @__PURE__ */ function(e) {
|
|
|
13744
13745
|
if (typeof t == "number" && t !== 0) {
|
|
13745
13746
|
let n = await this.getMicroblock(t);
|
|
13746
13747
|
for (let t of n.getAllSections()) {
|
|
13747
|
-
if (t.type !==
|
|
13748
|
+
if (t.type !== D.APP_LEDGER_ACTOR_SUBSCRIPTION || t.actorId != e) continue;
|
|
13748
13749
|
let n = t.pkePublicKey, r = t.pkeSchemeId;
|
|
13749
13750
|
return Xv.createPublicEncryptionKey(r, n);
|
|
13750
13751
|
}
|
|
@@ -13756,7 +13757,7 @@ var DS = /* @__PURE__ */ function(e) {
|
|
|
13756
13757
|
if (typeof t == "number" && t !== 0) {
|
|
13757
13758
|
let n = await this.getMicroblock(t);
|
|
13758
13759
|
for (let t of n.getAllSections()) {
|
|
13759
|
-
if (t.type !==
|
|
13760
|
+
if (t.type !== D.APP_LEDGER_ACTOR_SUBSCRIPTION || t.actorId != e) continue;
|
|
13760
13761
|
let n = t.signaturePublicKey, r = t.signatureSchemeId;
|
|
13761
13762
|
return Xv.createPublicSignatureKey(r, n);
|
|
13762
13763
|
}
|
|
@@ -13767,7 +13768,7 @@ var DS = /* @__PURE__ */ function(e) {
|
|
|
13767
13768
|
let n = this.internalState.getActorById(t).sharedSecrets.find((t) => t.peerActorId == e);
|
|
13768
13769
|
if (n === void 0) return;
|
|
13769
13770
|
let r = await this.getMicroblock(n.height);
|
|
13770
|
-
for (let n of r.getAllSections()) if (n.type ===
|
|
13771
|
+
for (let n of r.getAllSections()) if (n.type === D.APP_LEDGER_SHARED_SECRET && !(n.hostId !== e || n.guestId !== t)) return n.encryptedSharedKey;
|
|
13771
13772
|
throw new De(t, e);
|
|
13772
13773
|
}
|
|
13773
13774
|
getChannelIdByChannelName(e) {
|
|
@@ -13810,26 +13811,26 @@ var DS = /* @__PURE__ */ function(e) {
|
|
|
13810
13811
|
async getMicroblockMerkleRecord(t, n) {
|
|
13811
13812
|
let r = await this.getMicroblock(t), i = [];
|
|
13812
13813
|
for (let e of r.getAllSections()) {
|
|
13813
|
-
if (e.type !==
|
|
13814
|
+
if (e.type !== D.APP_LEDGER_PUBLIC_CHANNEL_DATA) continue;
|
|
13814
13815
|
let { channelId: t, data: n } = e;
|
|
13815
13816
|
i.push({
|
|
13816
13817
|
channelId: t,
|
|
13817
13818
|
isPublic: !0,
|
|
13818
|
-
merkleRootHash:
|
|
13819
|
+
merkleRootHash: k.getNullHash(),
|
|
13819
13820
|
data: n
|
|
13820
13821
|
});
|
|
13821
13822
|
}
|
|
13822
|
-
let a =
|
|
13823
|
+
let a = O.getLogger([e.name]);
|
|
13823
13824
|
if (n !== void 0) {
|
|
13824
|
-
let o = await (await n.getPrivateSignatureKey(
|
|
13825
|
+
let o = await (await n.getPrivateSignatureKey(Ya.SECP256K1)).getPublicKey(), s;
|
|
13825
13826
|
try {
|
|
13826
13827
|
s = await this.getActorIdByPublicSignatureKey(o);
|
|
13827
13828
|
} catch (t) {
|
|
13828
|
-
if (t instanceof pe)
|
|
13829
|
+
if (t instanceof pe) O.getLogger([e.name]).debug("Unabled to recover private channels: {e}", { e: t });
|
|
13829
13830
|
else throw t;
|
|
13830
13831
|
}
|
|
13831
13832
|
if (typeof s == "number") for (let e of r.getAllSections()) {
|
|
13832
|
-
if (e.type !==
|
|
13833
|
+
if (e.type !== D.APP_LEDGER_PRIVATE_CHANNEL_DATA) continue;
|
|
13833
13834
|
let { channelId: r, encryptedData: o, merkleRootHash: c } = e;
|
|
13834
13835
|
try {
|
|
13835
13836
|
let e = await this.getChannelKey(s, r, n), l = this.deriveChannelSectionKey(e, t, r), u = this.deriveChannelSectionIv(e, t, r);
|
|
@@ -13865,7 +13866,7 @@ var DS = /* @__PURE__ */ function(e) {
|
|
|
13865
13866
|
return this.deriveChannelSectionMaterial(e, "CHANNEL_SECTION_IV", t, n, 12);
|
|
13866
13867
|
}
|
|
13867
13868
|
deriveChannelSectionMaterial(e, t, n, r, i) {
|
|
13868
|
-
let a = new Uint8Array(), o = new TextEncoder(), s =
|
|
13869
|
+
let a = new Uint8Array(), o = new TextEncoder(), s = k.binaryFrom(o.encode(t), r, new Uint8Array(k.intToByteArray(n, 6)));
|
|
13869
13870
|
return new wv().deriveKey(e, a, s, i);
|
|
13870
13871
|
}
|
|
13871
13872
|
async getChannelKey(e, t, n) {
|
|
@@ -13878,7 +13879,7 @@ var DS = /* @__PURE__ */ function(e) {
|
|
|
13878
13879
|
return await this.getChannelKeyFromInvitation(e, t, i);
|
|
13879
13880
|
}
|
|
13880
13881
|
async deriveChannelKey(e, t) {
|
|
13881
|
-
let n = await this.getGenesisSeed(), r = new TextEncoder(), i =
|
|
13882
|
+
let n = await this.getGenesisSeed(), r = new TextEncoder(), i = k.binaryFrom(r.encode("CHANNEL_KEY")), a = k.binaryFrom(e, r.encode("GENESIS_SEED"), n.toBytes(), r.encode("CHANNEL_ID"), k.binaryFrom(t));
|
|
13882
13883
|
return new wv().deriveKeyNoSalt(a, i, 32);
|
|
13883
13884
|
}
|
|
13884
13885
|
async getChannelKeyFromInvitation(e, t, n) {
|
|
@@ -13889,14 +13890,14 @@ var DS = /* @__PURE__ */ function(e) {
|
|
|
13889
13890
|
throw new he(n, r);
|
|
13890
13891
|
}
|
|
13891
13892
|
let i = await this.getMicroblock(r.height), a;
|
|
13892
|
-
for (let n of i.getAllSections()) n.type ===
|
|
13893
|
+
for (let n of i.getAllSections()) n.type === D.APP_LEDGER_CHANNEL_INVITATION && (n.guestId !== e || n.channelId !== t || (a = n));
|
|
13893
13894
|
if (a === void 0) throw new he(e, t);
|
|
13894
13895
|
let o = a.encryptedChannelKey;
|
|
13895
13896
|
return await n.decrypt(o);
|
|
13896
13897
|
}
|
|
13897
13898
|
async exportProof(e, t) {
|
|
13898
13899
|
let n = new hS();
|
|
13899
|
-
n.setIdentifier(
|
|
13900
|
+
n.setIdentifier(k.binaryToHexa(this.getIdentifier().toBytes()));
|
|
13900
13901
|
for (let e = 1; e <= this.getHeight(); e++) {
|
|
13901
13902
|
let r = await this.getMicroblockMerkleRecord(e, t);
|
|
13902
13903
|
console.log(`Merkle record at height ${e}:`, r);
|
|
@@ -13912,13 +13913,13 @@ var DS = /* @__PURE__ */ function(e) {
|
|
|
13912
13913
|
let t = [], n = NS.fromObject(e).getSingleVirtualBlockchainOrFail().getMicroblocks();
|
|
13913
13914
|
for (let e of n) {
|
|
13914
13915
|
let n = e.height, r = await this.getMicroblock(n), i = [];
|
|
13915
|
-
for (let e of r.getAllSections()) if (e.type ===
|
|
13916
|
+
for (let e of r.getAllSections()) if (e.type === D.APP_LEDGER_PUBLIC_CHANNEL_DATA) {
|
|
13916
13917
|
let { channelId: t } = e;
|
|
13917
13918
|
i.push({
|
|
13918
13919
|
channelId: t,
|
|
13919
|
-
merkleRootHash:
|
|
13920
|
+
merkleRootHash: k.getNullHash()
|
|
13920
13921
|
});
|
|
13921
|
-
} else if (e.type ===
|
|
13922
|
+
} else if (e.type === D.APP_LEDGER_PRIVATE_CHANNEL_DATA) {
|
|
13922
13923
|
let { channelId: t, merkleRootHash: n } = e;
|
|
13923
13924
|
i.push({
|
|
13924
13925
|
channelId: t,
|
|
@@ -13929,9 +13930,9 @@ var DS = /* @__PURE__ */ function(e) {
|
|
|
13929
13930
|
let a = IS.fromProofChannels(e.channels);
|
|
13930
13931
|
for (let e of i) {
|
|
13931
13932
|
let t = a.getRootHashAsBinary(e.channelId);
|
|
13932
|
-
if (!
|
|
13933
|
+
if (!k.binaryIsEqual(e.merkleRootHash, t)) {
|
|
13933
13934
|
console.log(t, e);
|
|
13934
|
-
let n =
|
|
13935
|
+
let n = k.binaryToHexa(t), r = k.binaryToHexa(e.merkleRootHash);
|
|
13935
13936
|
throw new ce(e.channelId, n, r);
|
|
13936
13937
|
}
|
|
13937
13938
|
}
|
|
@@ -13992,14 +13993,14 @@ var DS = /* @__PURE__ */ function(e) {
|
|
|
13992
13993
|
}
|
|
13993
13994
|
async checkVirtualBlockchainConsistencyOrFail() {
|
|
13994
13995
|
if (this.verificationState.isMicroblockParsingCompleted) throw new a("You have already called parseMicroblock() method. You can only call it once.");
|
|
13995
|
-
if (!this.checkedMicroblock.isDeclaringConsistentBodyHash()) throw Error(`inconsistent body hash detected for microblock hash ${
|
|
13996
|
+
if (!this.checkedMicroblock.isDeclaringConsistentBodyHash()) throw Error(`inconsistent body hash detected for microblock hash ${k.binaryToHexa(this.checkedMicroblock.getHashAsBytes())}`);
|
|
13996
13997
|
let e = this.checkedMicroblock.getType(), t = 0, n, r = this.checkedMicroblock.getPreviousHash().toBytes();
|
|
13997
13998
|
if (this.checkedMicroblock.isGenesisMicroblock()) {
|
|
13998
13999
|
let t = r;
|
|
13999
14000
|
e = Qx.extractTypeFromGenesisPreviousHash(t), n = this.checkedMicroblock.getHash();
|
|
14000
14001
|
} else {
|
|
14001
14002
|
let e = await this.provider.getMicroblockHeader(Nx.from(r));
|
|
14002
|
-
if (!e) throw Error(`previous microblock ${
|
|
14003
|
+
if (!e) throw Error(`previous microblock ${k.binaryToHexa(r)} not found`);
|
|
14003
14004
|
if (this.checkedMicroblock.getHeight() != e.height + 1) throw Error(`inconsistent microblock height (expected ${e.height + 1}, got ${this.checkedMicroblock.getHeight()})`);
|
|
14004
14005
|
let t = X.computeMicroblockHashFromHeader(e);
|
|
14005
14006
|
n = await this.provider.getVirtualBlockchainIdContainingMicroblock(Nx.from(t));
|
|
@@ -14058,12 +14059,12 @@ var DS = /* @__PURE__ */ function(e) {
|
|
|
14058
14059
|
checkTimestampOrFail(e) {
|
|
14059
14060
|
if (this.verificationState.isMicroblockParsingCompleted === !1) throw new a("You have already called reconstructMicroblockAndVirtualBlockchain() method. You can only call it once.");
|
|
14060
14061
|
let t = this.checkedMicroblock;
|
|
14061
|
-
e ||=
|
|
14062
|
+
e ||= k.getTimestampInSeconds();
|
|
14062
14063
|
let n = t.isTemporallyCloseTo(e);
|
|
14063
14064
|
if (n === Xx.TOO_FAR_IN_THE_PAST) throw Error(`timestamp is too far in the past (header:${t.getTimestamp()} / current:${e})`);
|
|
14064
14065
|
if (n === Xx.TOO_FAR_IN_THE_FUTURE) throw Error(`timestamp is too far in the future (header:${t.getTimestamp()} / current:${e})`);
|
|
14065
14066
|
}
|
|
14066
|
-
async checkGasOrFail(e =
|
|
14067
|
+
async checkGasOrFail(e = k.getTimestampInSeconds()) {
|
|
14067
14068
|
if (this.verificationState.isMicroblockParsingCompleted === !1) throw new a("You have already called reconstructMicroblockAndVirtualBlockchain() method. You can only call it once.");
|
|
14068
14069
|
let t = this.checkedMicroblock, n = await this.provider.computeMicroblockGas(t, { referenceTimestampInSeconds: e }), r = t.getGas();
|
|
14069
14070
|
if (r != n) throw Error(`Computed gas ${n} is not equal to declared gas ${r} `);
|
|
@@ -14113,9 +14114,9 @@ function ZS(e, t, n) {
|
|
|
14113
14114
|
return QS(e, t, n, null, 0) ? M.Hashes.sha256AsBinary(n[0]) : null;
|
|
14114
14115
|
}
|
|
14115
14116
|
function QS(e, t, n, r, i) {
|
|
14116
|
-
if (i === qS.HASH_SIZE * 2) return r === null || t === null ? r === null && t === null :
|
|
14117
|
+
if (i === qS.HASH_SIZE * 2) return r === null || t === null ? r === null && t === null : k.binaryIsEqual(r, t);
|
|
14117
14118
|
let a = n[i];
|
|
14118
|
-
if (i && (r === null || !
|
|
14119
|
+
if (i && (r === null || !k.binaryIsEqual(M.Hashes.sha256AsBinary(a), r))) return !1;
|
|
14119
14120
|
let o = a[0] << 8 | a[1];
|
|
14120
14121
|
if (o) {
|
|
14121
14122
|
let r = JS.getHashList(o, a), s = e[i >> 1] >> 4 * (i & 1) & 15;
|
|
@@ -14123,7 +14124,7 @@ function QS(e, t, n, r, i) {
|
|
|
14123
14124
|
}
|
|
14124
14125
|
if (JS.keyDifference(i, e, a)) return t === null;
|
|
14125
14126
|
let s = qS.HASH_SIZE * 2 + 1 - i >> 1;
|
|
14126
|
-
return t !== null &&
|
|
14127
|
+
return t !== null && k.binaryIsEqual(a.slice(2 + s), t);
|
|
14127
14128
|
}
|
|
14128
14129
|
//#endregion
|
|
14129
14130
|
//#region src/blockchain/stateChecker/StateChecker.ts
|
|
@@ -14133,10 +14134,10 @@ var $S = class e {
|
|
|
14133
14134
|
return e.verifyRadixProof(t.account.virtualBlockchainId, i, t.account.radixProof, t.block.tokenRadixHash), e.verifyAppHash(t.block);
|
|
14134
14135
|
}
|
|
14135
14136
|
static verifyAccountProofFromJson(t) {
|
|
14136
|
-
let { block: n, account: r } = t, i = r.radixProof.map((e) =>
|
|
14137
|
+
let { block: n, account: r } = t, i = r.radixProof.map((e) => k.binaryFromHexa(e)), a = mg.decodeBinary(r.serializedState, mg.BASE64), o = X.decodeAccountState(a), s = {
|
|
14137
14138
|
block: e.decodeJsonBlock(n),
|
|
14138
14139
|
account: {
|
|
14139
|
-
virtualBlockchainId:
|
|
14140
|
+
virtualBlockchainId: k.binaryFromHexa(r.virtualBlockchainId),
|
|
14140
14141
|
state: o,
|
|
14141
14142
|
radixProof: i
|
|
14142
14143
|
}
|
|
@@ -14151,17 +14152,17 @@ var $S = class e {
|
|
|
14151
14152
|
a = i >>> t & 1 ? e.mergeHashes(n, a) : e.mergeHashes(a, n);
|
|
14152
14153
|
}
|
|
14153
14154
|
let o = t.virtualBlockchain.state;
|
|
14154
|
-
if (!
|
|
14155
|
+
if (!k.binaryIsEqual(o.merkleRootHash, a)) throw Error("State proof failure: invalid Merkle root hash");
|
|
14155
14156
|
let s = X.encodeVirtualBlockchainState(o), c = M.Hashes.sha256AsBinary(s);
|
|
14156
14157
|
return e.verifyRadixProof(t.microblock.virtualBlockchainId, c, t.virtualBlockchain.radixProof, t.block.vbRadixHash), e.verifyAppHash(t.block);
|
|
14157
14158
|
}
|
|
14158
14159
|
static verifyMicroblockProofFromJson(t) {
|
|
14159
|
-
let { block: n, microblock: r, virtualBlockchain: i } = t, a = i.merkleWitnesses.map((e) =>
|
|
14160
|
+
let { block: n, microblock: r, virtualBlockchain: i } = t, a = i.merkleWitnesses.map((e) => k.binaryFromHexa(e)), o = i.radixProof.map((e) => k.binaryFromHexa(e)), s = mg.decodeBinary(i.serializedState, mg.BASE64), c = X.decodeVirtualBlockchainState(s), l = {
|
|
14160
14161
|
block: e.decodeJsonBlock(n),
|
|
14161
14162
|
microblock: {
|
|
14162
|
-
virtualBlockchainId:
|
|
14163
|
+
virtualBlockchainId: k.binaryFromHexa(r.virtualBlockchainId),
|
|
14163
14164
|
height: r.height,
|
|
14164
|
-
hash:
|
|
14165
|
+
hash: k.binaryFromHexa(r.hash)
|
|
14165
14166
|
},
|
|
14166
14167
|
virtualBlockchain: {
|
|
14167
14168
|
state: c,
|
|
@@ -14174,10 +14175,10 @@ var $S = class e {
|
|
|
14174
14175
|
static decodeJsonBlock(e) {
|
|
14175
14176
|
return {
|
|
14176
14177
|
height: e.height,
|
|
14177
|
-
vbRadixHash:
|
|
14178
|
-
tokenRadixHash:
|
|
14179
|
-
storageHash:
|
|
14180
|
-
appHash:
|
|
14178
|
+
vbRadixHash: k.binaryFromHexa(e.vbRadixHash),
|
|
14179
|
+
tokenRadixHash: k.binaryFromHexa(e.tokenRadixHash),
|
|
14180
|
+
storageHash: k.binaryFromHexa(e.storageHash),
|
|
14181
|
+
appHash: k.binaryFromHexa(e.appHash)
|
|
14181
14182
|
};
|
|
14182
14183
|
}
|
|
14183
14184
|
static mergeHashes(e, t) {
|
|
@@ -14187,11 +14188,11 @@ var $S = class e {
|
|
|
14187
14188
|
static verifyRadixProof(e, t, n, r) {
|
|
14188
14189
|
let i = ZS(e, t, n);
|
|
14189
14190
|
if (i === null) throw Error("State proof failure: inconsistent Radix proof");
|
|
14190
|
-
if (!
|
|
14191
|
+
if (!k.binaryIsEqual(i, r)) throw Error("State proof failure: invalid Radix root hash");
|
|
14191
14192
|
}
|
|
14192
14193
|
static verifyAppHash(e) {
|
|
14193
|
-
let t = M.Hashes.sha256AsBinary(
|
|
14194
|
-
if (!
|
|
14194
|
+
let t = M.Hashes.sha256AsBinary(k.binaryFrom(e.vbRadixHash, e.tokenRadixHash)), n = M.Hashes.sha256AsBinary(k.binaryFrom(t, e.storageHash));
|
|
14195
|
+
if (!k.binaryIsEqual(n, e.appHash)) throw Error("State proof failure: computed app hash does not match the one declared in the block");
|
|
14195
14196
|
return n;
|
|
14196
14197
|
}
|
|
14197
14198
|
}, eC = class {
|
|
@@ -14257,19 +14258,19 @@ var $S = class e {
|
|
|
14257
14258
|
return /* @__PURE__ */ Up(lC, e);
|
|
14258
14259
|
}
|
|
14259
14260
|
}, dC = class e extends eC {
|
|
14260
|
-
logger =
|
|
14261
|
+
logger = O.getLogger([e.name]);
|
|
14261
14262
|
static async createFromVirtualBlockchain(t, n) {
|
|
14262
14263
|
let r = await n.createMicroblock(), i = new e(r, n);
|
|
14263
14264
|
if (n.setMicroblockSearchFailureFallback(i), n.isEmpty()) {
|
|
14264
14265
|
let e = {
|
|
14265
|
-
type:
|
|
14266
|
+
type: D.APP_LEDGER_CREATION,
|
|
14266
14267
|
applicationId: t.toBytes()
|
|
14267
14268
|
};
|
|
14268
14269
|
r.addSection(e), await i.updateStateWithSection(e);
|
|
14269
14270
|
}
|
|
14270
14271
|
return i;
|
|
14271
14272
|
}
|
|
14272
|
-
usedSignatureSchemeId =
|
|
14273
|
+
usedSignatureSchemeId = Ya.SECP256K1;
|
|
14273
14274
|
usedPkeSchemeId = Tv.ML_KEM_768_AES_256_GCM;
|
|
14274
14275
|
constructor(e, t) {
|
|
14275
14276
|
super(e, t, t.getProvider());
|
|
@@ -14298,7 +14299,7 @@ var $S = class e {
|
|
|
14298
14299
|
let l = this.state.getNumberOfChannels();
|
|
14299
14300
|
for (let e of n.channels || []) {
|
|
14300
14301
|
let t = {
|
|
14301
|
-
type:
|
|
14302
|
+
type: D.APP_LEDGER_CHANNEL_CREATION,
|
|
14302
14303
|
id: l,
|
|
14303
14304
|
isPrivate: !e.public,
|
|
14304
14305
|
creatorId: c,
|
|
@@ -14334,16 +14335,16 @@ var $S = class e {
|
|
|
14334
14335
|
let n = m.getOnChainData(t), { isPublic: r, merkleRootHash: i } = n;
|
|
14335
14336
|
if (r) {
|
|
14336
14337
|
let e = {
|
|
14337
|
-
type:
|
|
14338
|
+
type: D.APP_LEDGER_PUBLIC_CHANNEL_DATA,
|
|
14338
14339
|
channelId: t,
|
|
14339
14340
|
data: n.data
|
|
14340
14341
|
};
|
|
14341
14342
|
this.mbUnderConstruction.addSection(e), await this.updateStateWithSection(e);
|
|
14342
14343
|
} else {
|
|
14343
|
-
let r =
|
|
14344
|
+
let r = O.getLogger(["critical"]), a = this.vb.getHeight() + 1, o = await this.vb.getChannelKey(c, t, e), s = this.vb.deriveChannelSectionKey(o, a, t), l = this.vb.deriveChannelSectionIv(o, a, t);
|
|
14344
14345
|
r.debug(`Channel key ${o} at height ${a} and channel id ${t} -> Channel section key: ${s} (iv ${l}) `);
|
|
14345
14346
|
let u = M.Aes.encryptGcm(s, n.data, l), d = {
|
|
14346
|
-
type:
|
|
14347
|
+
type: D.APP_LEDGER_PRIVATE_CHANNEL_DATA,
|
|
14347
14348
|
channelId: t,
|
|
14348
14349
|
merkleRootHash: i,
|
|
14349
14350
|
encryptedData: u
|
|
@@ -14354,7 +14355,7 @@ var $S = class e {
|
|
|
14354
14355
|
if (typeof n.endorser == "string") {
|
|
14355
14356
|
if (n.endorser.trim().length === 0) throw new i("Empty endorser provided: should be a non-empty string or undefined");
|
|
14356
14357
|
let e = this.getActorIdFromActorName(n.endorser), t = n.approvalMessage ?? "", r = {
|
|
14357
|
-
type:
|
|
14358
|
+
type: D.APP_LEDGER_ENDORSEMENT_REQUEST,
|
|
14358
14359
|
message: t,
|
|
14359
14360
|
endorserId: e
|
|
14360
14361
|
};
|
|
@@ -14365,7 +14366,7 @@ var $S = class e {
|
|
|
14365
14366
|
async createActor(e, t) {
|
|
14366
14367
|
console.log(`Creating actor ${t} (id ${e})`);
|
|
14367
14368
|
let n = {
|
|
14368
|
-
type:
|
|
14369
|
+
type: D.APP_LEDGER_ACTOR_CREATION,
|
|
14369
14370
|
id: e,
|
|
14370
14371
|
actorType: tC.UNKNOWN,
|
|
14371
14372
|
name: t
|
|
@@ -14378,10 +14379,10 @@ var $S = class e {
|
|
|
14378
14379
|
pS.assert(typeof r == "number", `Expected channel id of type number: got ${typeof r} for channel ${t}`);
|
|
14379
14380
|
let s = i;
|
|
14380
14381
|
if (await this.vb.isActorInChannel(r, s)) return;
|
|
14381
|
-
let c = await this.vb.getChannelKey(o, r, n), l = await (await this.vb.getPublicEncryptionKeyByActorId(s)).encrypt(c), u =
|
|
14382
|
+
let c = await this.vb.getChannelKey(o, r, n), l = await (await this.vb.getPublicEncryptionKeyByActorId(s)).encrypt(c), u = O.getLogger([HS.name]);
|
|
14382
14383
|
u.info(`Actor {guestName} invited to channel ${t}`, () => ({ guestName: e })), u.debug(`Channel key for channel ${t}: ${c}`);
|
|
14383
14384
|
let d = {
|
|
14384
|
-
type:
|
|
14385
|
+
type: D.APP_LEDGER_CHANNEL_INVITATION,
|
|
14385
14386
|
channelId: r,
|
|
14386
14387
|
hostId: o,
|
|
14387
14388
|
guestId: s,
|
|
@@ -14391,7 +14392,7 @@ var $S = class e {
|
|
|
14391
14392
|
}
|
|
14392
14393
|
async createSharedKey(e, t, n) {
|
|
14393
14394
|
let { encryptedSharedKey: r, hostGuestSharedKey: i } = await this.generateSharedKeyAndEncryptedSharedKey(e, n), a = {
|
|
14394
|
-
type:
|
|
14395
|
+
type: D.APP_LEDGER_SHARED_SECRET,
|
|
14395
14396
|
hostId: t,
|
|
14396
14397
|
guestId: n,
|
|
14397
14398
|
encryptedSharedKey: r
|
|
@@ -14399,7 +14400,7 @@ var $S = class e {
|
|
|
14399
14400
|
return this.mbUnderConstruction.addSection(a), await this.updateStateWithSection(a), i;
|
|
14400
14401
|
}
|
|
14401
14402
|
static deriveHostGuestSharedKey(e, t, n) {
|
|
14402
|
-
let r = e.getRawPrivateKey(), i = new TextEncoder(), a =
|
|
14403
|
+
let r = e.getRawPrivateKey(), i = new TextEncoder(), a = k.binaryFrom(i.encode("SHARED_SECRET"), n), o = new wv(), s = k.binaryFrom(r, t), c = o.deriveKeyNoSalt(s, a, 32);
|
|
14403
14404
|
return Ug.createFromBytes(c);
|
|
14404
14405
|
}
|
|
14405
14406
|
async generateSharedKeyAndEncryptedSharedKey(t, n) {
|
|
@@ -14418,8 +14419,8 @@ var $S = class e {
|
|
|
14418
14419
|
let t = this.vb.getNumberOfActors();
|
|
14419
14420
|
await this.createActor(t, e);
|
|
14420
14421
|
}
|
|
14421
|
-
let r = tC.UNKNOWN, i = this.getActorIdFromActorName(e), a =
|
|
14422
|
-
type:
|
|
14422
|
+
let r = tC.UNKNOWN, i = this.getActorIdFromActorName(e), a = k.getNullHash(), o = {
|
|
14423
|
+
type: D.APP_LEDGER_ACTOR_SUBSCRIPTION,
|
|
14423
14424
|
actorId: i,
|
|
14424
14425
|
actorType: r,
|
|
14425
14426
|
organizationId: a,
|
|
@@ -14718,7 +14719,7 @@ var OC = class {
|
|
|
14718
14719
|
//#region node_modules/.pnpm/@noble+hashes@1.8.0/node_modules/@noble/hashes/esm/scrypt.js
|
|
14719
14720
|
function jC(e, t, n, r, i, a) {
|
|
14720
14721
|
let o = e[t++] ^ n[r++], s = e[t++] ^ n[r++], c = e[t++] ^ n[r++], l = e[t++] ^ n[r++], u = e[t++] ^ n[r++], d = e[t++] ^ n[r++], f = e[t++] ^ n[r++], p = e[t++] ^ n[r++], m = e[t++] ^ n[r++], h = e[t++] ^ n[r++], g = e[t++] ^ n[r++], _ = e[t++] ^ n[r++], v = e[t++] ^ n[r++], y = e[t++] ^ n[r++], b = e[t++] ^ n[r++], ee = e[t++] ^ n[r++], x = o, te = s, ne = c, re = l, ie = u, ae = d, oe = f, se = p, ce = m, le = h, S = g, ue = _, de = v, fe = y, pe = b, me = ee;
|
|
14721
|
-
for (let e = 0; e < 8; e += 2) ie ^=
|
|
14722
|
+
for (let e = 0; e < 8; e += 2) ie ^= A(x + de | 0, 7), ce ^= A(ie + x | 0, 9), de ^= A(ce + ie | 0, 13), x ^= A(de + ce | 0, 18), le ^= A(ae + te | 0, 7), fe ^= A(le + ae | 0, 9), te ^= A(fe + le | 0, 13), ae ^= A(te + fe | 0, 18), pe ^= A(S + oe | 0, 7), ne ^= A(pe + S | 0, 9), oe ^= A(ne + pe | 0, 13), S ^= A(oe + ne | 0, 18), re ^= A(me + ue | 0, 7), se ^= A(re + me | 0, 9), ue ^= A(se + re | 0, 13), me ^= A(ue + se | 0, 18), te ^= A(x + re | 0, 7), ne ^= A(te + x | 0, 9), re ^= A(ne + te | 0, 13), x ^= A(re + ne | 0, 18), oe ^= A(ae + ie | 0, 7), se ^= A(oe + ae | 0, 9), ie ^= A(se + oe | 0, 13), ae ^= A(ie + se | 0, 18), ue ^= A(S + le | 0, 7), ce ^= A(ue + S | 0, 9), le ^= A(ce + ue | 0, 13), S ^= A(le + ce | 0, 18), de ^= A(me + pe | 0, 7), fe ^= A(de + me | 0, 9), pe ^= A(fe + de | 0, 13), me ^= A(pe + fe | 0, 18);
|
|
14722
14723
|
i[a++] = o + x | 0, i[a++] = s + te | 0, i[a++] = c + ne | 0, i[a++] = l + re | 0, i[a++] = u + ie | 0, i[a++] = d + ae | 0, i[a++] = f + oe | 0, i[a++] = p + se | 0, i[a++] = m + ce | 0, i[a++] = h + le | 0, i[a++] = g + S | 0, i[a++] = _ + ue | 0, i[a++] = v + de | 0, i[a++] = y + fe | 0, i[a++] = b + pe | 0, i[a++] = ee + me | 0;
|
|
14723
14724
|
}
|
|
14724
14725
|
function MC(e, t, n, r, i) {
|
|
@@ -14732,7 +14733,7 @@ function NC(e, t, n) {
|
|
|
14732
14733
|
asyncTick: 10,
|
|
14733
14734
|
maxmem: 1024 ** 3 + 1024
|
|
14734
14735
|
}, n);
|
|
14735
|
-
if (
|
|
14736
|
+
if (Ts(r), Ts(i), Ts(a), Ts(o), Ts(s), Ts(c), l !== void 0 && typeof l != "function") throw Error("progressCb should be function");
|
|
14736
14737
|
let u = 128 * i, d = u / 4, f = 2 ** 32;
|
|
14737
14738
|
if (r <= 1 || r & r - 1 || r > f) throw Error("Scrypt: N must be larger than 1, a power of 2, and less than 2^32");
|
|
14738
14739
|
if (a < 0 || a > (f - 1) * 32 / u) throw Error("Scrypt: p must be a positive integer less than or equal to ((2^32 - 1) * 32) / (128 * r)");
|
|
@@ -14741,7 +14742,7 @@ function NC(e, t, n) {
|
|
|
14741
14742
|
let p = pv(Gc, e, t, {
|
|
14742
14743
|
c: 1,
|
|
14743
14744
|
dkLen: u * a
|
|
14744
|
-
}), m =
|
|
14745
|
+
}), m = As(p), h = As(new Uint8Array(u * r)), g = As(new Uint8Array(u)), _ = () => {};
|
|
14745
14746
|
if (l) {
|
|
14746
14747
|
let e = 2 * r * a, t = Math.max(Math.floor(e / 1e4), 1), n = 0;
|
|
14747
14748
|
_ = () => {
|
|
@@ -14767,7 +14768,7 @@ function PC(e, t, n, r, i) {
|
|
|
14767
14768
|
c: 1,
|
|
14768
14769
|
dkLen: t
|
|
14769
14770
|
});
|
|
14770
|
-
return
|
|
14771
|
+
return js(n, r, i), a;
|
|
14771
14772
|
}
|
|
14772
14773
|
function FC(e, t, n) {
|
|
14773
14774
|
let { N: r, r: i, p: a, dkLen: o, blockSize32: s, V: c, B32: l, B: u, tmp: d, blockMixCb: f } = NC(e, t, n);
|
|
@@ -14800,7 +14801,7 @@ var IC = class extends hv {
|
|
|
14800
14801
|
});
|
|
14801
14802
|
}
|
|
14802
14803
|
}, LC = /* @__PURE__ */ function(e) {
|
|
14803
|
-
return e[e.SECP256K1 =
|
|
14804
|
+
return e[e.SECP256K1 = Ya.SECP256K1] = "SECP256K1", e[e.ML_DSA_65 = Ya.ML_DSA_65] = "ML_DSA_65", e;
|
|
14804
14805
|
}({}), RC = class {
|
|
14805
14806
|
constructor(e) {
|
|
14806
14807
|
this.apiKey = e;
|
|
@@ -14918,20 +14919,20 @@ var YC = class {
|
|
|
14918
14919
|
throw Error(`field '${e}' is missing`);
|
|
14919
14920
|
}
|
|
14920
14921
|
if (r.type & 32) {
|
|
14921
|
-
if (
|
|
14922
|
+
if (ro.getType(i) != 1) throw `'${e}' is not an array`;
|
|
14922
14923
|
for (let t in i) this.validateItem(r, i[t], e + `[${t}]`);
|
|
14923
14924
|
} else this.validateItem(r, i, e);
|
|
14924
14925
|
}
|
|
14925
14926
|
}
|
|
14926
14927
|
validateItem(e, t, n) {
|
|
14927
14928
|
if ((e.type & 31) == 2) {
|
|
14928
|
-
if (
|
|
14929
|
+
if (ro.getType(t) != 2) throw `'${n}' is not an object`;
|
|
14929
14930
|
if (!e.unspecifiedSchema) {
|
|
14930
14931
|
if (!e.schema) throw "missing definition in schema";
|
|
14931
14932
|
this.validateObject(e.schema.definition, t, n);
|
|
14932
14933
|
}
|
|
14933
14934
|
} else {
|
|
14934
|
-
let r = new
|
|
14935
|
+
let r = new io(e, t);
|
|
14935
14936
|
try {
|
|
14936
14937
|
r.check();
|
|
14937
14938
|
} catch (e) {
|
|
@@ -15013,7 +15014,7 @@ var nw = class e {
|
|
|
15013
15014
|
}, ow = /* @__PURE__ */ function(e) {
|
|
15014
15015
|
return e[e.PARSE_ERROR = -32700] = "PARSE_ERROR", e[e.INVALID_REQUEST = -32600] = "INVALID_REQUEST", e[e.METHOD_NOT_FOUND = -32601] = "METHOD_NOT_FOUND", e[e.INVALID_PARAMS = -32602] = "INVALID_PARAMS", e[e.INTERNAL_ERROR = -32603] = "INTERNAL_ERROR", e[e.ENDPOINT_CLOSED_WHILE_NODE_IS_CATCHING_UP = -32603] = "ENDPOINT_CLOSED_WHILE_NODE_IS_CATCHING_UP", e[e.TX_ALREADY_EXISTS = -32003] = "TX_ALREADY_EXISTS", e[e.TX_OUT_OF_GAS = -32002] = "TX_OUT_OF_GAS", e[e.TX_CHECK_FAILED = -32001] = "TX_CHECK_FAILED", e[e.TX_DELIVER_FAILED = -32e3] = "TX_DELIVER_FAILED", e;
|
|
15015
15016
|
}({}), sw = class e {
|
|
15016
|
-
log =
|
|
15017
|
+
log = O.getAbstractProviderLogger(e.name);
|
|
15017
15018
|
async loadValidatorNodeVirtualBlockchain(e) {
|
|
15018
15019
|
let t = new uS(this);
|
|
15019
15020
|
return await this.initializeVirtualBlockchain(t, e), t;
|
|
@@ -15064,7 +15065,7 @@ var nw = class e {
|
|
|
15064
15065
|
return jx.getFeesCalculationFormulaByVersion(this, e);
|
|
15065
15066
|
}
|
|
15066
15067
|
async computeMicroblockGas(e, t = {}) {
|
|
15067
|
-
let n = t.referenceTimestampInSeconds ??
|
|
15068
|
+
let n = t.referenceTimestampInSeconds ?? k.getTimestampInSeconds(), r = 0;
|
|
15068
15069
|
if (e.isGenesisMicroblock()) r = Qx.extractExpirationDayFromGenesisPreviousHash(e.getPreviousHash().toBytes());
|
|
15069
15070
|
else {
|
|
15070
15071
|
let t = await this.getVirtualBlockchainIdContainingMicroblock(e.getPreviousHash()), n = await this.getVirtualBlockchainState(t.toBytes());
|
|
@@ -15104,7 +15105,7 @@ var nw = class e {
|
|
|
15104
15105
|
return this.expirationDate.unwrap();
|
|
15105
15106
|
}
|
|
15106
15107
|
}, lw = class e {
|
|
15107
|
-
static logger =
|
|
15108
|
+
static logger = O.getMemoryProviderLogger();
|
|
15108
15109
|
static instance = new e();
|
|
15109
15110
|
static getInstance() {
|
|
15110
15111
|
return this.instance;
|
|
@@ -15121,7 +15122,7 @@ var nw = class e {
|
|
|
15121
15122
|
}
|
|
15122
15123
|
async getSerializedInformationOfVirtualBlockchainContainingMicroblock(t) {
|
|
15123
15124
|
let n = await e.get(this.microblockVbInformationStore, t);
|
|
15124
|
-
return e.logger.info(`getMicroblockVbInformation identifier=${
|
|
15125
|
+
return e.logger.info(`getMicroblockVbInformation identifier=${k.binaryToHexa(t)} -> ${n ? n.length : 0} bytes`), n;
|
|
15125
15126
|
}
|
|
15126
15127
|
async getInformationOfVirtualBlockchainContainingMicroblock(e) {
|
|
15127
15128
|
let t = await this.getSerializedInformationOfVirtualBlockchainContainingMicroblock(e);
|
|
@@ -15135,7 +15136,7 @@ var nw = class e {
|
|
|
15135
15136
|
if (n === null) return e.logger.info("Header not found locally: returning null"), null;
|
|
15136
15137
|
{
|
|
15137
15138
|
let r = X.decodeMicroblockHeader(n);
|
|
15138
|
-
return e.logger.info(`Header of microblock with identifier=${
|
|
15139
|
+
return e.logger.info(`Header of microblock with identifier=${k.binaryToHexa(t)} found: {header}`, { header: r }), r;
|
|
15139
15140
|
}
|
|
15140
15141
|
}
|
|
15141
15142
|
async getSerializedMicroblockHeader(t) {
|
|
@@ -15143,31 +15144,31 @@ var nw = class e {
|
|
|
15143
15144
|
if (n === null) return e.logger.info("Header not found locally: returning null"), null;
|
|
15144
15145
|
{
|
|
15145
15146
|
let r = M.Hashes.sha256(n), i = X.decodeMicroblockHeader(n);
|
|
15146
|
-
return e.logger.info(`Header of microblock with identifier (sha256:${r})=${
|
|
15147
|
+
return e.logger.info(`Header of microblock with identifier (sha256:${r})=${k.binaryToHexa(t)} found: {header}`, { header: JSON.stringify(i) }), n;
|
|
15147
15148
|
}
|
|
15148
15149
|
}
|
|
15149
15150
|
async getMicroblockBody(t) {
|
|
15150
15151
|
let n = await e.get(this.microblockBodyStore, t);
|
|
15151
|
-
return e.logger.info(`getMicroblockBody identifier=${
|
|
15152
|
+
return e.logger.info(`getMicroblockBody identifier=${k.binaryToHexa(t)} -> ${n ? n.length : 0} bytes`), n;
|
|
15152
15153
|
}
|
|
15153
15154
|
async getSerializedVirtualBlockchainState(t) {
|
|
15154
15155
|
let n = await e.get(this.virtualBlockchainStateStore, t);
|
|
15155
|
-
return e.logger.info(`getVirtualBlockchainState identifier=${
|
|
15156
|
+
return e.logger.info(`getVirtualBlockchainState identifier=${k.binaryToHexa(t)} -> ${n ? n.length : 0} bytes`), n;
|
|
15156
15157
|
}
|
|
15157
15158
|
async getAccountByPublicKeyHash(e) {
|
|
15158
15159
|
return null;
|
|
15159
15160
|
}
|
|
15160
15161
|
async setMicroblockVbInformation(t, n) {
|
|
15161
15162
|
let r = X.decodeVirtualBlockchainInfo(n);
|
|
15162
|
-
return e.logger.info(`Store info of vb identifier=${
|
|
15163
|
+
return e.logger.info(`Store info of vb identifier=${k.binaryToHexa(t)}: {info}`, { info: r }), await e.set(this.microblockVbInformationStore, t, n);
|
|
15163
15164
|
}
|
|
15164
15165
|
async setSerializedMicroblockHeader(t, n) {
|
|
15165
15166
|
let r = X.decodeMicroblockHeader(n);
|
|
15166
|
-
return e.logger.info(`Store header of microblock identifier=${
|
|
15167
|
+
return e.logger.info(`Store header of microblock identifier=${k.binaryToHexa(t)} -> {header}`, { header: r }), await e.set(this.microblockHeaderStore, t, n);
|
|
15167
15168
|
}
|
|
15168
15169
|
async setSerializedMicroblockBody(t, n) {
|
|
15169
15170
|
let r = X.decodeMicroblockBody(n);
|
|
15170
|
-
return e.logger.info(`Store body of microblock ${
|
|
15171
|
+
return e.logger.info(`Store body of microblock ${k.binaryToHexa(t)}: {body}`, { body: r }), await e.set(this.microblockBodyStore, t, n);
|
|
15171
15172
|
}
|
|
15172
15173
|
async setMicroblockHeader(e, t) {
|
|
15173
15174
|
let n = X.encodeMicroblockHeader(t);
|
|
@@ -15179,16 +15180,16 @@ var nw = class e {
|
|
|
15179
15180
|
}
|
|
15180
15181
|
async setSerializedVirtualBlockchainState(t, n) {
|
|
15181
15182
|
let r = X.decodeVirtualBlockchainState(n);
|
|
15182
|
-
return e.logger.info(`Store vb state for vb ${
|
|
15183
|
+
return e.logger.info(`Store vb state for vb ${k.binaryToHexa(t)}: {state}`, { state: r }), await e.set(this.virtualBlockchainStateStore, t, n);
|
|
15183
15184
|
}
|
|
15184
15185
|
static async get(e, t) {
|
|
15185
|
-
let n =
|
|
15186
|
+
let n = k.binaryToHexa(t);
|
|
15186
15187
|
if (!e.has(n)) return null;
|
|
15187
15188
|
let r = e.get(n);
|
|
15188
|
-
return r === void 0 ? null :
|
|
15189
|
+
return r === void 0 ? null : k.binaryFromHexa(r);
|
|
15189
15190
|
}
|
|
15190
15191
|
static async set(t, n, r) {
|
|
15191
|
-
let i =
|
|
15192
|
+
let i = k.binaryToHexa(n), a = k.binaryToHexa(r), o = t.get(i);
|
|
15192
15193
|
o === void 0 ? e.logger.info(`Storing new entry for key ${i}`) : o === a ? e.logger.info(`Storing the same data for the same key ${i}`) : e.logger.info(`Storing new data for key ${i}`), t.set(i, a);
|
|
15193
15194
|
}
|
|
15194
15195
|
}, uw = /* @__PURE__ */ I({
|
|
@@ -15469,7 +15470,7 @@ var nw = class e {
|
|
|
15469
15470
|
return R(iT, Ub(e));
|
|
15470
15471
|
}
|
|
15471
15472
|
}, oT = class e {
|
|
15472
|
-
static staticLogger =
|
|
15473
|
+
static staticLogger = O.getNetworkProviderLogger();
|
|
15473
15474
|
logger = e.staticLogger;
|
|
15474
15475
|
requestLogger = e.staticLogger.getChild("request");
|
|
15475
15476
|
responseLogger = e.staticLogger.getChild("response");
|
|
@@ -15490,7 +15491,7 @@ var nw = class e {
|
|
|
15490
15491
|
return this.responseLogger.info("Received response: <- {data}", () => ({ data: t?.data })), t;
|
|
15491
15492
|
}
|
|
15492
15493
|
async awaitMicroblockAnchoring(e) {
|
|
15493
|
-
let t =
|
|
15494
|
+
let t = k.binaryToHexa(e);
|
|
15494
15495
|
return this.requestLogger.info("Awaiting microblock {hash} to be published...", () => ({ hash: t })), R(Wh, await this.abciQuery({
|
|
15495
15496
|
requestType: $.AWAIT_MICROBLOCK_ANCHORING,
|
|
15496
15497
|
hash: e
|
|
@@ -15516,15 +15517,15 @@ var nw = class e {
|
|
|
15516
15517
|
return this.responseLogger.info(`Received block content for height ${e}: ${t.microblocks.length} microblocks received`), t;
|
|
15517
15518
|
}
|
|
15518
15519
|
async getValidatorNodeByAddress(e) {
|
|
15519
|
-
this.requestLogger.info("Requesting validator node id for address {address}", () => ({ address:
|
|
15520
|
+
this.requestLogger.info("Requesting validator node id for address {address}", () => ({ address: k.binaryToHexa(e) }));
|
|
15520
15521
|
let t = await this.abciQuery({
|
|
15521
15522
|
requestType: $.GET_VALIDATOR_NODE_BY_ADDRESS,
|
|
15522
15523
|
address: e
|
|
15523
15524
|
});
|
|
15524
|
-
return this.responseLogger.info("Receiving validator node id {id}", () => ({ id:
|
|
15525
|
+
return this.responseLogger.info("Receiving validator node id {id}", () => ({ id: k.binaryToHexa(e) })), R(Xw, t);
|
|
15525
15526
|
}
|
|
15526
15527
|
async getAccountState(e) {
|
|
15527
|
-
this.requestLogger.info("Requesting account state for account hash {accountHash}", () => ({ accountHash:
|
|
15528
|
+
this.requestLogger.info("Requesting account state for account hash {accountHash}", () => ({ accountHash: k.binaryToHexa(e) }));
|
|
15528
15529
|
let t = R(qw, await this.abciQuery({
|
|
15529
15530
|
requestType: $.GET_ACCOUNT_STATE,
|
|
15530
15531
|
accountHash: e
|
|
@@ -15535,7 +15536,7 @@ var nw = class e {
|
|
|
15535
15536
|
})), t;
|
|
15536
15537
|
}
|
|
15537
15538
|
async getAccountHistory(e, t, n) {
|
|
15538
|
-
this.requestLogger.info(`Requesting account history for account hash: ${
|
|
15539
|
+
this.requestLogger.info(`Requesting account history for account hash: ${k.binaryToHexa(e)}, lastHistoryHash: ${k.binaryToHexa(t)}, maxRecords: ${n}`);
|
|
15539
15540
|
let r = R(Jw, await this.abciQuery({
|
|
15540
15541
|
requestType: $.GET_ACCOUNT_HISTORY,
|
|
15541
15542
|
accountHash: e,
|
|
@@ -15545,26 +15546,26 @@ var nw = class e {
|
|
|
15545
15546
|
return this.responseLogger.info(`Receiving account history with ${r.list.length} entries`), r;
|
|
15546
15547
|
}
|
|
15547
15548
|
async getAccountByPublicKeyHash(e) {
|
|
15548
|
-
this.requestLogger.info(`Requesting account hash by public key hash: ${
|
|
15549
|
+
this.requestLogger.info(`Requesting account hash by public key hash: ${k.binaryToHexa(e)}`);
|
|
15549
15550
|
let t = R(Yw, await this.abciQuery({
|
|
15550
15551
|
requestType: $.GET_ACCOUNT_BY_PUBLIC_KEY_HASH,
|
|
15551
15552
|
publicKeyHash: e
|
|
15552
15553
|
}));
|
|
15553
|
-
return this.responseLogger.info("Received account hash {accountHash}", () => ({ accountHash:
|
|
15554
|
+
return this.responseLogger.info("Received account hash {accountHash}", () => ({ accountHash: k.binaryToHexa(t.accountHash) })), t;
|
|
15554
15555
|
}
|
|
15555
15556
|
async getMicroblockInformation(e) {
|
|
15556
|
-
this.requestLogger.info(`Requesting microblock information for hash ${
|
|
15557
|
+
this.requestLogger.info(`Requesting microblock information for hash ${k.binaryToHexa(e)}`);
|
|
15557
15558
|
let t = R(Uw, await this.abciQuery({
|
|
15558
15559
|
requestType: $.GET_MICROBLOCK_INFORMATION,
|
|
15559
15560
|
hash: e
|
|
15560
15561
|
}));
|
|
15561
15562
|
return this.responseLogger.info("Received microblock information: vbType={vbType}, vbId={vbId}", () => ({
|
|
15562
15563
|
vbType: t.virtualBlockchainType,
|
|
15563
|
-
vbId:
|
|
15564
|
-
})), this.logger.info(`Received microblock information body hash for microblock ${
|
|
15564
|
+
vbId: k.binaryToHexa(t.virtualBlockchainId)
|
|
15565
|
+
})), this.logger.info(`Received microblock information body hash for microblock ${k.binaryToHexa(e)}: ${k.binaryToHexa(t.header.bodyHash)}`), R(Wh, t);
|
|
15565
15566
|
}
|
|
15566
15567
|
async getSerializedMicroblockByHeight(e, t) {
|
|
15567
|
-
this.requestLogger.info(`Requesting microblock for VB ${
|
|
15568
|
+
this.requestLogger.info(`Requesting microblock for VB ${k.binaryToHexa(e)} at height ${t}`);
|
|
15568
15569
|
let n = R(tT, await this.abciQuery({
|
|
15569
15570
|
requestType: $.GET_SERIALIZED_MICROBLOCK_BY_HEIGHT,
|
|
15570
15571
|
virtualBlockchainId: e,
|
|
@@ -15573,7 +15574,7 @@ var nw = class e {
|
|
|
15573
15574
|
return this.responseLogger.info(`Received microblock - size: ${n.serializedContent.length} bytes`), n.serializedContent;
|
|
15574
15575
|
}
|
|
15575
15576
|
async getMicroblockBodys(e) {
|
|
15576
|
-
this.requestLogger.info(`Requesting microblock bodys for microblock hashes ${e.length}`), this.requestLogger.info("Lisf of requested hashes: {hashes}", () => ({ hashes: e.map((e) =>
|
|
15577
|
+
this.requestLogger.info(`Requesting microblock bodys for microblock hashes ${e.length}`), this.requestLogger.info("Lisf of requested hashes: {hashes}", () => ({ hashes: e.map((e) => k.binaryToHexa(e)).join(", ") }));
|
|
15577
15578
|
let t = R(Kw, await this.abciQuery({
|
|
15578
15579
|
requestType: $.GET_MICROBLOCK_BODYS,
|
|
15579
15580
|
hashes: e
|
|
@@ -15581,7 +15582,7 @@ var nw = class e {
|
|
|
15581
15582
|
return this.responseLogger.info(`Returned number of microblock bodys: ${t.list.length}`), t;
|
|
15582
15583
|
}
|
|
15583
15584
|
async getVirtualBlockchainUpdate(e, t) {
|
|
15584
|
-
this.requestLogger.info(`Request virtual blockchain update for virtualBlockchainId: ${
|
|
15585
|
+
this.requestLogger.info(`Request virtual blockchain update for virtualBlockchainId: ${k.binaryToHexa(e)}`);
|
|
15585
15586
|
let n = await this.abciQuery({
|
|
15586
15587
|
requestType: $.GET_VIRTUAL_BLOCKCHAIN_UPDATE,
|
|
15587
15588
|
virtualBlockchainId: e,
|
|
@@ -15590,7 +15591,7 @@ var nw = class e {
|
|
|
15590
15591
|
return this.responseLogger.info("Receiving virtual blockchain update"), R(Hw, n);
|
|
15591
15592
|
}
|
|
15592
15593
|
async getSerializedVirtualBlockchainState(e) {
|
|
15593
|
-
this.requestLogger.info("Requesting virtual blockchain state for vb id {vbId}", () => ({ vbId:
|
|
15594
|
+
this.requestLogger.info("Requesting virtual blockchain state for vb id {vbId}", () => ({ vbId: k.binaryToHexa(e) }));
|
|
15594
15595
|
let t = R(Vw, await this.abciQuery({
|
|
15595
15596
|
requestType: $.GET_VIRTUAL_BLOCKCHAIN_STATE,
|
|
15596
15597
|
virtualBlockchainId: e
|
|
@@ -15638,7 +15639,7 @@ var nw = class e {
|
|
|
15638
15639
|
static async sendABCIQueryToNodeServer(t, n) {
|
|
15639
15640
|
e.staticLogger.debug(`Sending ABCI Query to node server at ${t} (${n.length} bytes) `);
|
|
15640
15641
|
let r = new URL(t);
|
|
15641
|
-
r.pathname = "abci_query", r.searchParams.append("path", "\"/carmentis\""), r.searchParams.append("data", "0x" +
|
|
15642
|
+
r.pathname = "abci_query", r.searchParams.append("path", "\"/carmentis\""), r.searchParams.append("data", "0x" + k.binaryToHexa(n));
|
|
15642
15643
|
let i = await e.query(r), a = i?.result?.response?.value;
|
|
15643
15644
|
if (typeof a != "string") throw this.staticLogger.error("Invalid response type detected:", i), this.staticLogger.error("rawBase64EncodedResponse: ", a), new h("Invalid response detected");
|
|
15644
15645
|
let o = mg.decodeBinary(a), s = aT.decodeAbciResponse(o);
|
|
@@ -15662,7 +15663,7 @@ var nw = class e {
|
|
|
15662
15663
|
return this.responseLogger.info("Received genesis snapshots containing {chunksNumber} chunks", () => ({ chunksNumber: e.base64EncodedChunks.length })), e;
|
|
15663
15664
|
}
|
|
15664
15665
|
}, sT = class e {
|
|
15665
|
-
static logger =
|
|
15666
|
+
static logger = O.getMemoryProviderLogger();
|
|
15666
15667
|
static instance = new e();
|
|
15667
15668
|
static getInstance() {
|
|
15668
15669
|
return this.instance;
|
|
@@ -15759,7 +15760,7 @@ var nw = class e {
|
|
|
15759
15760
|
return Qc.sha256AsBinary(e).slice(0, 20);
|
|
15760
15761
|
}
|
|
15761
15762
|
}, uT = class e extends sw {
|
|
15762
|
-
logger =
|
|
15763
|
+
logger = O.getProviderLogger();
|
|
15763
15764
|
externalProvider;
|
|
15764
15765
|
internalProvider;
|
|
15765
15766
|
constructor(e, t) {
|
|
@@ -15790,15 +15791,15 @@ var nw = class e {
|
|
|
15790
15791
|
let n = await this.internalProvider.getAccountByPublicKeyHash(t);
|
|
15791
15792
|
if (n !== null) return n;
|
|
15792
15793
|
let r = await this.externalProvider.getAccountByPublicKeyHash(t);
|
|
15793
|
-
return
|
|
15794
|
+
return O.getLogger([e.name]).debug(`Account hash ${r} is associated to public key hash ${t}`), r.accountHash;
|
|
15794
15795
|
}
|
|
15795
15796
|
async getVirtualBlockchainState(e) {
|
|
15796
|
-
this.logger.info(`Getting state for virtual blockchain ${
|
|
15797
|
+
this.logger.info(`Getting state for virtual blockchain ${k.binaryToHexa(e)}`);
|
|
15797
15798
|
let t = await this.internalProvider.getSerializedVirtualBlockchainState(e);
|
|
15798
|
-
if (t !== null) return this.logger.info(`State for virtual blockchain ${
|
|
15799
|
+
if (t !== null) return this.logger.info(`State for virtual blockchain ${k.binaryToHexa(e)} found locally`), X.decodeVirtualBlockchainState(t);
|
|
15799
15800
|
{
|
|
15800
15801
|
let t = await this.externalProvider.getSerializedVirtualBlockchainState(e);
|
|
15801
|
-
return t ? (this.logger.info(`State for virtual blockchain ${
|
|
15802
|
+
return t ? (this.logger.info(`State for virtual blockchain ${k.binaryToHexa(e)} found remotely`), await this.internalProvider.setSerializedVirtualBlockchainState(e, t), X.decodeVirtualBlockchainState(t)) : null;
|
|
15802
15803
|
}
|
|
15803
15804
|
}
|
|
15804
15805
|
async getAccountIdByPublicKey(e) {
|
|
@@ -15898,7 +15899,7 @@ var nw = class e {
|
|
|
15898
15899
|
}
|
|
15899
15900
|
}
|
|
15900
15901
|
async getVirtualBlockchainStatus(e) {
|
|
15901
|
-
let t = null, n =
|
|
15902
|
+
let t = null, n = k.getNullHash(), r = await this.internalProvider.getSerializedVirtualBlockchainState(e);
|
|
15902
15903
|
r !== null && (t = X.decodeVirtualBlockchainState(r), n = Xv.createDefaultCryptographicHash().hash(r));
|
|
15903
15904
|
let i = await this.externalProvider.getVirtualBlockchainUpdate(e, n);
|
|
15904
15905
|
return i.exists ? (i.changed && (await this.internalProvider.setSerializedVirtualBlockchainState(e, i.serializedVirtualBlockchainState), t = X.decodeVirtualBlockchainState(i.serializedVirtualBlockchainState)), t) : null;
|
|
@@ -16129,7 +16130,7 @@ var ST = class {
|
|
|
16129
16130
|
e.attributes & 2 ? this.addMaskableItem(e, n) : e.attributes & 1 ? this.addHashableItem(e, n) : this.addRawItem(e, n);
|
|
16130
16131
|
}
|
|
16131
16132
|
getLeafInfo(e, t) {
|
|
16132
|
-
let n = hT.fromParents(t), r =
|
|
16133
|
+
let n = hT.fromParents(t), r = Qa.encode(n);
|
|
16133
16134
|
if (r.length > 65535) throw "path too long";
|
|
16134
16135
|
let i = new Uint8Array(r.length + 3);
|
|
16135
16136
|
return i[0] = e.type, i[1] = r.length >> 8, i[2] = r.length & 255, i.set(r, 3), i;
|
|
@@ -16137,7 +16138,7 @@ var ST = class {
|
|
|
16137
16138
|
getWitnesses(e) {
|
|
16138
16139
|
let t = [];
|
|
16139
16140
|
for (let n = 0; n < this.nLeaves; n++) e.has(n) || t.push(n);
|
|
16140
|
-
return this.tree.getWitnesses(t).map((e) =>
|
|
16141
|
+
return this.tree.getWitnesses(t).map((e) => k.binaryToHexa(e)).join("");
|
|
16141
16142
|
}
|
|
16142
16143
|
}, CT = class extends ST {
|
|
16143
16144
|
leaves;
|
|
@@ -16157,37 +16158,37 @@ var ST = class {
|
|
|
16157
16158
|
});
|
|
16158
16159
|
}
|
|
16159
16160
|
generateTree() {
|
|
16160
|
-
this.nLeaves = this.leaves.length, this.leaves.sort((e, t) =>
|
|
16161
|
+
this.nLeaves = this.leaves.length, this.leaves.sort((e, t) => k.binaryCompare(e.hash, t.hash));
|
|
16161
16162
|
for (let e in this.leaves) this.tree.addLeaf(this.leaves[+e].hash), this.leaves[+e].item.leafIndex = +e;
|
|
16162
16163
|
this.tree.finalize();
|
|
16163
16164
|
let e = this.tree.getRootHash();
|
|
16164
16165
|
return {
|
|
16165
16166
|
nLeaves: this.leaves.length,
|
|
16166
|
-
rootHash:
|
|
16167
|
-
pepper:
|
|
16167
|
+
rootHash: k.binaryToHexa(e),
|
|
16168
|
+
pepper: k.binaryToHexa(this.pepper)
|
|
16168
16169
|
};
|
|
16169
16170
|
}
|
|
16170
16171
|
addRawItem(e, t) {
|
|
16171
16172
|
let n = this.getSalt();
|
|
16172
|
-
e.salt =
|
|
16173
|
+
e.salt = k.binaryToHexa(n), this.addLeaf(e, k.binaryFrom(n, t, e.valueBinary));
|
|
16173
16174
|
}
|
|
16174
16175
|
addHashableItem(e, t) {
|
|
16175
16176
|
let n = this.getSalt(), r = M.Hashes.sha256AsBinary(e.valueBinary);
|
|
16176
|
-
e.hash =
|
|
16177
|
+
e.hash = k.binaryToHexa(r), e.salt = k.binaryToHexa(n), this.addLeaf(e, k.binaryFrom(n, t, r));
|
|
16177
16178
|
}
|
|
16178
16179
|
addMaskableItem(e, t) {
|
|
16179
|
-
let n = this.getSalt(), r = M.Hashes.sha256AsBinary(
|
|
16180
|
-
e.visibleSalt =
|
|
16180
|
+
let n = this.getSalt(), r = M.Hashes.sha256AsBinary(k.binaryFrom(n, t, e.visiblePartsBinary)), i = this.getSalt(), a = M.Hashes.sha256AsBinary(k.binaryFrom(i, e.hiddenPartsBinary));
|
|
16181
|
+
e.visibleSalt = k.binaryToHexa(n), e.hiddenSalt = k.binaryToHexa(i), e.hiddenHash = k.binaryToHexa(a), this.addLeaf(e, k.binaryFrom(r, a));
|
|
16181
16182
|
}
|
|
16182
16183
|
getSalt() {
|
|
16183
16184
|
let e = this.saltCounter & 3, t = this.saltCounter++ >> 2;
|
|
16184
|
-
return e || (this.sha512 = M.Hashes.sha512AsBinary(
|
|
16185
|
+
return e || (this.sha512 = M.Hashes.sha512AsBinary(k.binaryFrom(this.pepper, t))), this.sha512.slice(e << 4, e + 1 << 4);
|
|
16185
16186
|
}
|
|
16186
16187
|
}, wT = class extends ST {
|
|
16187
16188
|
nLeaves;
|
|
16188
16189
|
witnesses;
|
|
16189
16190
|
constructor(e, t) {
|
|
16190
|
-
super(), this.nLeaves = e, this.witnesses = (t.match(/.{64}/g) || []).map((e) =>
|
|
16191
|
+
super(), this.nLeaves = e, this.witnesses = (t.match(/.{64}/g) || []).map((e) => k.binaryFromHexa(e));
|
|
16191
16192
|
}
|
|
16192
16193
|
addLeaf(e, t) {
|
|
16193
16194
|
this.tree.setLeaf(e.leafIndex, M.Hashes.sha256AsBinary(t));
|
|
@@ -16197,25 +16198,25 @@ var ST = class {
|
|
|
16197
16198
|
let e = this.tree.getRootHash();
|
|
16198
16199
|
return {
|
|
16199
16200
|
nLeaves: this.tree.getNumberOfLeaves(),
|
|
16200
|
-
rootHash:
|
|
16201
|
+
rootHash: k.binaryToHexa(e)
|
|
16201
16202
|
};
|
|
16202
16203
|
}
|
|
16203
16204
|
addRawItem(e, t) {
|
|
16204
|
-
let n =
|
|
16205
|
-
this.addLeaf(e,
|
|
16205
|
+
let n = k.binaryFromHexa(e.salt);
|
|
16206
|
+
this.addLeaf(e, k.binaryFrom(n, t, e.valueBinary));
|
|
16206
16207
|
}
|
|
16207
16208
|
addHashableItem(e, t) {
|
|
16208
|
-
let n =
|
|
16209
|
-
e.hash ? r =
|
|
16209
|
+
let n = k.binaryFromHexa(e.salt), r;
|
|
16210
|
+
e.hash ? r = k.binaryFromHexa(e.hash) : (r = M.Hashes.sha256AsBinary(e.valueBinary), e.hash = r), this.addLeaf(e, k.binaryFrom(n, t, e.valueBinary));
|
|
16210
16211
|
}
|
|
16211
16212
|
addMaskableItem(e, t) {
|
|
16212
|
-
let n =
|
|
16213
|
-
if (e.hiddenHash) i =
|
|
16213
|
+
let n = k.binaryFromHexa(e.visibleSalt), r = M.Hashes.sha256AsBinary(k.binaryFrom(n, t, e.visiblePartsBinary)), i;
|
|
16214
|
+
if (e.hiddenHash) i = k.binaryFromHexa(e.hiddenHash);
|
|
16214
16215
|
else {
|
|
16215
|
-
let t =
|
|
16216
|
-
i = M.Hashes.sha256AsBinary(
|
|
16216
|
+
let t = k.binaryFromHexa(e.hiddenSalt);
|
|
16217
|
+
i = M.Hashes.sha256AsBinary(k.binaryFrom(t, e.hiddenPartsBinary)), e.hiddenHash = k.binaryToHexa(i);
|
|
16217
16218
|
}
|
|
16218
|
-
this.addLeaf(e,
|
|
16219
|
+
this.addLeaf(e, k.binaryFrom(r, i));
|
|
16219
16220
|
}
|
|
16220
16221
|
}, TT = {
|
|
16221
16222
|
getListFromRegex: ET,
|
|
@@ -16311,8 +16312,8 @@ var AT = 24, jT = class e {
|
|
|
16311
16312
|
let n = [];
|
|
16312
16313
|
this.importedFromProof = !1, i({ root: t }, n, !1), this.irObject = n;
|
|
16313
16314
|
function r(t, n, r, a) {
|
|
16314
|
-
let o = t[n], s =
|
|
16315
|
-
if (!
|
|
16315
|
+
let o = t[n], s = ro.getType(o);
|
|
16316
|
+
if (!ro.isJsonType(s)) throw Error("Invalid JSON type");
|
|
16316
16317
|
let c = e.getItemInstance(s);
|
|
16317
16318
|
a ? c.index = +n : c.name = n, s == 2 ? (c.properties = [], i(o, c.properties, !1)) : s == 1 ? (c.entries = [], i(o, c.entries, !0)) : (c.value = o, c.attributes = 0, c.channelId = null), r.push(c);
|
|
16318
16319
|
}
|
|
@@ -17025,11 +17026,11 @@ var AT = 24, jT = class e {
|
|
|
17025
17026
|
static createFromAccountStateAbciResponse(t) {
|
|
17026
17027
|
return new e(t.balance, t.locks);
|
|
17027
17028
|
}
|
|
17028
|
-
logger =
|
|
17029
|
+
logger = O.getLogger(["accounts", e.name]);
|
|
17029
17030
|
balanceInAtomics;
|
|
17030
17031
|
locks;
|
|
17031
17032
|
constructor(t = 0, n = []) {
|
|
17032
|
-
this.initialBalance = t, this.initialLocks = n, this.balanceInAtomics = t, this.locks = n, this.logger =
|
|
17033
|
+
this.initialBalance = t, this.initialLocks = n, this.balanceInAtomics = t, this.locks = n, this.logger = lo([
|
|
17033
17034
|
"node",
|
|
17034
17035
|
"accounts",
|
|
17035
17036
|
e.name
|
|
@@ -17057,11 +17058,11 @@ var AT = 24, jT = class e {
|
|
|
17057
17058
|
return this.locks.filter((e) => e.type == Zh.NodeStaking);
|
|
17058
17059
|
}
|
|
17059
17060
|
getNodeStakingLock(e) {
|
|
17060
|
-
return this.getNodeStakingLocks().find((t) =>
|
|
17061
|
+
return this.getNodeStakingLocks().find((t) => k.binaryIsEqual(t.parameters.validatorNodeId, e));
|
|
17061
17062
|
}
|
|
17062
17063
|
getNodeStakingLockOrFail(e) {
|
|
17063
17064
|
let t = this.getNodeStakingLock(e);
|
|
17064
|
-
if (t == null) throw Error(`Staking not found for node ${
|
|
17065
|
+
if (t == null) throw Error(`Staking not found for node ${k.binaryToHexa(e)}`);
|
|
17065
17066
|
return t;
|
|
17066
17067
|
}
|
|
17067
17068
|
getNodeStakingLockAmount(e) {
|
|
@@ -17110,7 +17111,7 @@ var AT = 24, jT = class e {
|
|
|
17110
17111
|
});
|
|
17111
17112
|
}
|
|
17112
17113
|
removeEscrowLock(e) {
|
|
17113
|
-
let t = this.locks.findIndex((t) => t.type == Zh.Escrow &&
|
|
17114
|
+
let t = this.locks.findIndex((t) => t.type == Zh.Escrow && k.binaryIsEqual(t.parameters.escrowIdentifier, e));
|
|
17114
17115
|
if (t == -1) throw Error("Escrow not found");
|
|
17115
17116
|
let n = this.locks[t].lockedAmountInAtomics;
|
|
17116
17117
|
return this.locks.splice(t, 1), n;
|
|
@@ -17120,7 +17121,7 @@ var AT = 24, jT = class e {
|
|
|
17120
17121
|
if (e < 0) throw Error("Stake amount must be greater than 0");
|
|
17121
17122
|
if (e > n.stakeable) throw Error(`Cannot stake more than ${n.stakeable} atomic units`);
|
|
17122
17123
|
let r = this.getNodeStakingLock(t);
|
|
17123
|
-
r === void 0 ? (this.logger.info(`Creating new staking of ${e} atomics for node ${
|
|
17124
|
+
r === void 0 ? (this.logger.info(`Creating new staking of ${e} atomics for node ${k.binaryToHexa(t)}`), this.locks.push({
|
|
17124
17125
|
type: Zh.NodeStaking,
|
|
17125
17126
|
lockedAmountInAtomics: e,
|
|
17126
17127
|
parameters: {
|
|
@@ -17131,13 +17132,13 @@ var AT = 24, jT = class e {
|
|
|
17131
17132
|
plannedSlashingAmountInAtomics: 0,
|
|
17132
17133
|
plannedSlashingTimestamp: 0
|
|
17133
17134
|
}
|
|
17134
|
-
})) : (this.logger.info(`Adding ${e} atomics to existing staking for node ${
|
|
17135
|
+
})) : (this.logger.info(`Adding ${e} atomics to existing staking for node ${k.binaryToHexa(t)}`), r.lockedAmountInAtomics += e);
|
|
17135
17136
|
}
|
|
17136
17137
|
planNodeStakingUnlock(e, t, n) {
|
|
17137
17138
|
let r = this.getNodeStakingLockOrFail(n);
|
|
17138
17139
|
if (r.parameters.plannedUnlockAmountInAtomics != 0) throw Error("There's already a pending staking unlock for this node");
|
|
17139
|
-
let i =
|
|
17140
|
-
this.logger.info(`Planned staking unlock of ${e} atomics on account ${
|
|
17140
|
+
let i = k.addDaysToTimestamp(t, 0);
|
|
17141
|
+
this.logger.info(`Planned staking unlock of ${e} atomics on account ${k.binaryToHexa(n)}`), r.parameters.plannedUnlockAmountInAtomics = e, r.parameters.plannedUnlockTimestamp = i;
|
|
17141
17142
|
}
|
|
17142
17143
|
applyNodeStakingUnlocks(e) {
|
|
17143
17144
|
let t = this.getNodeStakingLocks(), n = 0;
|
|
@@ -17149,17 +17150,17 @@ var AT = 24, jT = class e {
|
|
|
17149
17150
|
}
|
|
17150
17151
|
setSlashing(e, t) {
|
|
17151
17152
|
let n = this.getNodeStakingLockOrFail(e);
|
|
17152
|
-
this.logger.info(`Setting slashing of ${n.lockedAmountInAtomics} atomics for node ${
|
|
17153
|
+
this.logger.info(`Setting slashing of ${n.lockedAmountInAtomics} atomics for node ${k.binaryToHexa(e)}, effective on ${(/* @__PURE__ */ new Date(t * 1e3)).toISOString()}`), n.parameters.slashed = !0, n.parameters.plannedSlashingAmountInAtomics = n.lockedAmountInAtomics, n.parameters.plannedSlashingTimestamp = t;
|
|
17153
17154
|
}
|
|
17154
17155
|
cancelNodeSlashing(e) {
|
|
17155
17156
|
let t = this.getNodeStakingLockOrFail(e);
|
|
17156
|
-
t.parameters.slashed ? (this.logger.info(`Cancelled slashing of node ${
|
|
17157
|
+
t.parameters.slashed ? (this.logger.info(`Cancelled slashing of node ${k.binaryToHexa(e)}`), t.parameters.slashed = !1, t.parameters.plannedSlashingAmountInAtomics = 0, t.parameters.plannedSlashingTimestamp = 0) : this.logger.warn(`No pending slashing for node ${k.binaryToHexa(e)}`);
|
|
17157
17158
|
}
|
|
17158
17159
|
applyNodeSlashing(e) {
|
|
17159
17160
|
let t = this.getNodeStakingLocks(), n = 0;
|
|
17160
17161
|
for (let r of t) if (r.parameters.slashed) {
|
|
17161
17162
|
let t = r.parameters.plannedSlashingAmountInAtomics;
|
|
17162
|
-
t > 0 && r.parameters.plannedSlashingTimestamp != 0 && e >= r.parameters.plannedSlashingTimestamp && (this.logger.info(`Applying slashing of ${t} atomics on node ${
|
|
17163
|
+
t > 0 && r.parameters.plannedSlashingTimestamp != 0 && e >= r.parameters.plannedSlashingTimestamp && (this.logger.info(`Applying slashing of ${t} atomics on node ${k.binaryToHexa(r.parameters.validatorNodeId)}`), r.lockedAmountInAtomics -= t, this.balanceInAtomics -= t, n += t, r.parameters.slashed = !1, r.parameters.plannedSlashingTimestamp = 0, r.parameters.plannedSlashingAmountInAtomics = 0);
|
|
17163
17164
|
}
|
|
17164
17165
|
return this.adjustVesting(), this.removeExpiredStakingLocks(), n;
|
|
17165
17166
|
}
|
|
@@ -17184,7 +17185,7 @@ var AT = 24, jT = class e {
|
|
|
17184
17185
|
applyLinearVesting(e) {
|
|
17185
17186
|
let t = this.getBreakdown().releasable, n = 0, r = this.getVestingLocks();
|
|
17186
17187
|
for (let i of r) {
|
|
17187
|
-
let r = i.parameters.initialVestedAmountInAtomics, a = i.parameters.cliffStartTimestamp, o = i.parameters.cliffDurationDays, s = i.parameters.vestingDurationDays, c =
|
|
17188
|
+
let r = i.parameters.initialVestedAmountInAtomics, a = i.parameters.cliffStartTimestamp, o = i.parameters.cliffDurationDays, s = i.parameters.vestingDurationDays, c = k.addDaysToTimestamp(a, o), l = Math.min(k.timestampDifferenceInDays(c, e), s);
|
|
17188
17189
|
if (this.logger.debug("start date: {cliffStartDate}, initial amount: {initialAmount}, cliff during {cliffDurationDays} day(s), vesting during {vestingDurationDays} day(s)", () => ({
|
|
17189
17190
|
cliffStartDate: (/* @__PURE__ */ new Date(a * 1e3)).toISOString(),
|
|
17190
17191
|
initialAmount: r,
|
|
@@ -17267,7 +17268,7 @@ var AT = 24, jT = class e {
|
|
|
17267
17268
|
this.actorSeed = e;
|
|
17268
17269
|
}
|
|
17269
17270
|
static createFromAccountSeedAndVbSeed(t, n) {
|
|
17270
|
-
return new e(
|
|
17271
|
+
return new e(k.binaryFrom(t, n));
|
|
17271
17272
|
}
|
|
17272
17273
|
static parseFromString(t, n = new CE()) {
|
|
17273
17274
|
return new e(n.decode(t));
|
|
@@ -17297,7 +17298,7 @@ var AT = 24, jT = class e {
|
|
|
17297
17298
|
}
|
|
17298
17299
|
}, NE = class e {
|
|
17299
17300
|
static createFromWalletSeedAndNonce(t, n) {
|
|
17300
|
-
let r =
|
|
17301
|
+
let r = k.binaryFrom(t, n), i = Xv.createDefaultKDF(), a = this.encoderStringAsBytes("ACCOUNT_SEED");
|
|
17301
17302
|
return new e(i.deriveKeyNoSalt(r, a, 32));
|
|
17302
17303
|
}
|
|
17303
17304
|
static parseFromString(t, n = new CE()) {
|
|
@@ -17376,7 +17377,7 @@ var AT = 24, jT = class e {
|
|
|
17376
17377
|
let n = Xv.createDefaultKDF(), r = new Uint8Array([...this.walletSeed, ...t]), i = new TextEncoder(), a = n.deriveKeyNoSalt(r, i.encode("PKE"), 32);
|
|
17377
17378
|
return Xv.createPrivateDecryptionKey(e, a);
|
|
17378
17379
|
}
|
|
17379
|
-
getPrivateSignatureKey(e =
|
|
17380
|
+
getPrivateSignatureKey(e = Ya.SECP256K1) {
|
|
17380
17381
|
let t = Xv.createDefaultKDF(), n = Xv.createSignatureScheme(e).expectedSeedSize(), r = NE.encoderStringAsBytes(`SIG_${e}`), i = t.deriveKeyNoSalt(this.walletSeed, r, n);
|
|
17381
17382
|
return Xv.createPrivateSignatureKey(e, i);
|
|
17382
17383
|
}
|
|
@@ -17403,4 +17404,4 @@ var AT = 24, jT = class e {
|
|
|
17403
17404
|
}
|
|
17404
17405
|
};
|
|
17405
17406
|
//#endregion
|
|
17406
|
-
export { Wr as ACCOUNT_ALLOWED_TRANSFERS, Hr as ACCOUNT_BLOCK_FEES, Br as ACCOUNT_BURNT_TOKENS, pa as ACCOUNT_CREATION, _a as ACCOUNT_ESCROW_SETTLEMENT, ga as ACCOUNT_ESCROW_TRANSFER, ii as ACCOUNT_HISTORY, Ur as ACCOUNT_NAMES, da as ACCOUNT_PUBLIC_KEY, va as ACCOUNT_STAKE, Vr as ACCOUNT_STANDARD, ri as ACCOUNT_STATE, fa as ACCOUNT_TOKEN_ISSUANCE, ma as ACCOUNT_TRANSFER, ha as ACCOUNT_VESTING_TRANSFER, Ug as AES256GCMSymmetricEncryptionKey, Hg as AES256GCMSymmetricEncryptionScheme, ia as ALL_SCHEMAS, Wa as ALL_SECTIONS_SCHEMAS, Oa as APP_CREATION, ka as APP_DESCRIPTION, Pa as APP_LEDGER_ACTOR_CREATION, Ra as APP_LEDGER_ACTOR_SUBSCRIPTION, Ma as APP_LEDGER_ALLOWED_PKE_SCHEMES, ja as APP_LEDGER_ALLOWED_SIG_SCHEMES, Va as APP_LEDGER_AUTHOR, Fa as APP_LEDGER_CHANNEL_CREATION, La as APP_LEDGER_CHANNEL_INVITATION, Na as APP_LEDGER_CREATION, Ha as APP_LEDGER_ENDORSEMENT_REQUEST, Ba as APP_LEDGER_PRIVATE_CHANNEL_DATA, za as APP_LEDGER_PUBLIC_CHANNEL_DATA, Ia as APP_LEDGER_SHARED_SECRET, am as ARRAY, aT as AbciQueryEncoder, jw as AbciRequestSchema, $ as AbciRequestType, iT as AbciResponseSchema, Fw as AbciResponseType, kv as AbstractPrivateDecryptionKey, sw as AbstractProvider, Ov as AbstractPublicEncryptionKey, Dv as AbstractPublicKeyEncryptionScheme, ag as AccountBreakdownSchema, Yw as AccountByPublicKeyHashAbciResponseSchema, Ym as AccountCreationSectionSchema, NE as AccountCrypto, $m as AccountEscrowSettlementSectionSchema, Qm as AccountEscrowTransferSectionSchema, Jw as AccountHistoryAbciResponseSchema, cg as AccountHistoryEntrySchema, lg as AccountHistorySchema, PT as AccountHistoryView, sg as AccountInformationSchema, Mx as AccountInternalState, Vx as AccountInternalStateUpdater, aS as AccountMicroblockStructureChecker, _e as AccountNotFoundForAccountHashError, ge as AccountNotFoundForPublicKeyError, xe as AccountNotFoundForPublicKeyHashError, rT as AccountProofAbciResponseSchema, Pw as AccountProofSchema, qm as AccountPublicKeySectionSchema, wE as AccountSeedEncoder, eh as AccountStakeSectionSchema, qw as AccountStateAbciResponseSchema, og as AccountStateSchema, Jm as AccountTokenIssuanceSectionSchema, EE as AccountTransaction, TE as AccountTransactions, Xm as AccountTransferSectionSchema, th as AccountUnstakeSectionSchema, dg as AccountUpdateSchema, eT as AccountUpdatesAbciResponseSchema, oS as AccountVb, Zm as AccountVestingTransferSectionSchema, Eh as AccountVirtualBlockchainInternalStateSchema, Ih as AccountVirtualBlockchainStateSchema, re as ActorAlreadyDefinedError, ME as ActorCrypto, oe as ActorNotDefinedError, he as ActorNotInvitedError, Te as ActorNotSubscribedError, DE as ActorSeedEncoder, tC as ActorType, su as Aes, Um as AllowedAdditionalWriterSectionSchema, S as AlreadySubscribedError, Gx as AppLedgerLocalStateUpdaterV1, lC as AppLedgerMicroblockBuildRequestSchema, uC as AppLedgerMicroblockBuildRequestValidation, lh as ApplicationCreationSectionSchema, uh as ApplicationDescriptionSectionSchema, Px as ApplicationInternalState, Hx as ApplicationInternalStateUpdater, mh as ApplicationLedgerActorCreationSectionSchema, jh as ApplicationLedgerActorInvitationStateSchema, Nh as ApplicationLedgerActorSchema, vh as ApplicationLedgerActorSubscriptionSectionSchema, fh as ApplicationLedgerAllowedPkeSchemesSectionSchema, dh as ApplicationLedgerAllowedSigSchemesSectionSchema, xh as ApplicationLedgerAuthorSectionSchema, hh as ApplicationLedgerChannelCreationSectionSchema, _h as ApplicationLedgerChannelInvitationSectionSchema, Ah as ApplicationLedgerChannelSchema, ph as ApplicationLedgerCreationSectionSchema, Sh as ApplicationLedgerEndorsementRequestSectionSchema, Fx as ApplicationLedgerInternalState, Ph as ApplicationLedgerInternalStateObjectSchema, eC as ApplicationLedgerMicroblockBuilder, mS as ApplicationLedgerMicroblockStructureChecker, Ce as ApplicationLedgerNotFoundError, bh as ApplicationLedgerPrivateChannelDataSectionSchema, yh as ApplicationLedgerPublicChannelDataSectionSchema, gh as ApplicationLedgerSharedSecretSectionSchema, Mh as ApplicationLedgerSharedSecretStateSchema, HS as ApplicationLedgerVb, Bh as ApplicationLedgerVirtualBlockchainStateSchema, sS as ApplicationMicroblockStructureChecker, ye as ApplicationNotFoundError, kh as ApplicationVBInternalStateObjectSchema, cS as ApplicationVb, zh as ApplicationVirtualBlockchainStateSchema, pS as Assertion, Hm as AuxiliarySignatureSectionSchema, _w as AwaitMicroblockAnchoringAbciRequestSchema, _m as BIN256, gm as BINARY, Er as BK_EARNED_BLOCK_FEES, Tr as BK_EARNED_TX_FEES, zr as BK_NAMES, gr as BK_PAID_BLOCK_FEES, hr as BK_PAID_TX_FEES, mr as BK_PLUS, Or as BK_PURCHASE, jr as BK_RECEIVED_ESCROW, Mr as BK_RECEIVED_ESCROW_REFUND, Nr as BK_RECEIVED_EXPIRED_ESCROW, Dr as BK_RECEIVED_ISSUANCE, kr as BK_RECEIVED_PAYMENT, Pr as BK_RECEIVED_SLASHED_TOKENS, Ar as BK_RECEIVED_VESTING, Rr as BK_REFERENCES, Fr as BK_REF_BLOCK, Ir as BK_REF_MICROBLOCK, Lr as BK_REF_SECTION, vr as BK_SALE, xr as BK_SENT_ESCROW, Sr as BK_SENT_ESCROW_REFUND, Cr as BK_SENT_EXPIRED_ESCROW, _r as BK_SENT_ISSUANCE, yr as BK_SENT_PAYMENT, wr as BK_SENT_SLASHED_TOKENS, br as BK_SENT_VESTING, ui as BLOCK_CONTENT, li as BLOCK_INFORMATION, lm as BOOLEAN, OE as BalanceAvailability, UC as Base32, mg as Base64, My as BaseHCVSignatureDecoder, ty as BaseHCVSignatureEncoder, Kg as BasePrivateSignatureKey, qg as BasePublicSignatureKey, Bw as BlockContentAbciResponseSchema, Rw as BlockInformationAbciResponseSchema, $w as BlockModifiedAccountsAbciResponseSchema, Kh as BlockReferenceSchema, b as BlockchainError, X as BlockchainUtils, pC as BytesSignatureEncoder, bg as BytesToBase64Encoder, xg as BytesToHexEncoder, Ex as CBORCryptoBinaryEncoder, sr as CENTITOKEN, Hn as CHAIN, hn as CMTSToken, qr as CONTRACT_PARAMETER_SCHEMA, Jr as CONTRACT_SCHEMA, le as CannotSubscribeError, o as CarmentisError, n as CarmentisErrorCode, Lw as ChainInformationAbciResponseSchema, Yh as ChainReferenceSchema, Gh as ChainReferenceType, ae as ChannelAlreadyDefinedError, se as ChannelNotDefinedError, aE as ClientBridgeEncoder, iE as ClientBridgeMessageSchema, $T as ClientBridgeMessageSchema_Answer, tE as ClientBridgeMessageSchema_ConnectionAccepted, eE as ClientBridgeMessageSchema_ConnectionInfo, XT as ClientBridgeMessageSchema_ConnectionToken, rE as ClientBridgeMessageSchema_Error, ZT as ClientBridgeMessageSchema_ForwardedAnswer, nE as ClientBridgeMessageSchema_ForwardedRequest, QT as ClientBridgeMessageSchema_GetConnectionInfo, JT as ClientBridgeMessageSchema_Request, YT as ClientBridgeMessageSchema_UpdateQr, KT as ClientBridgeMessageType, oE as ClientBridgeValidation, ow as CometBFTErrorCode, mT as CometBFTNodeWebSocket, fC as CometBFTPublicKey, lT as CometBFTPublicKeyConverter, tS as ConstraintNameByConstraint, M as Crypto, Dx as CryptoEncoderFactory, d as CryptoError, Xv as CryptoSchemeFactory, lv as CryptographicHashSchemeId, rw as CurrencyConverterFactory, pe as CurrentActorNotFoundError, Bm as CustomSectionSchema, gn as DATA, Ga as DEF, f as DecryptionError, ir as ECO, Kr as ERROR, Ka as ERRORS, QC as Economics, v as EconomicsError, Yv as Ed25519PrivateSignatureKey, Jv as Ed25519PublicSignatureKey, qv as Ed25519SignatureScheme, u as EmptyBlockError, yg as EncoderFactory, wy as EnvApiKeyPkmsCredentialProvider, Iw as ErrorAbciResponseSchema, $h as EscrowLockSchema, Qh as EscrowParametersSchema, nw as Euros, iw as EurosToCMTSConverter, cw as ExpirationDate, Wg as ExtendedSymmetricEncryptionKey, Vn as FORMAT, jx as FeesCalculationFormulaFactory, Ax as FirstFeesFormula, pr as GAS_ATOMS_PER_GAS, fr as GAS_PER_BYTE, AC as GenericSymmetricKeyEncoder, Zw as GenesisSnapshotAbciResponseSchema, xw as GetAccountByPublicKeyHashAbciRequestSchema, bw as GetAccountHistoryAbciRequestSchema, Aw as GetAccountProofAbciRequestSchema, yw as GetAccountStateAbciRequestSchema, Ew as GetAccountUpdatesAbciRequestSchema, pw as GetBlockContentAbciRequestSchema, fw as GetBlockInformationAbciRequestSchema, Tw as GetBlockModifiedAccountsAbciRequestSchema, dw as GetChainInformationAbciRequestSchema, Cw as GetGenesisSnapshotAbciRequestSchema, vw as GetMicroblockBodysAbciRequestSchema, gw as GetMicroblockInformationAbciRequestSchema, Dw as GetMicroblockInformationByHeightAbciRequestSchema, kw as GetMicroblockProofAbciRequestSchema, ww as GetRawBlockContentAbciRequestSchema, Ow as GetSerializedMicroblockByHeightAbciRequestSchema, Sw as GetValidatorNodeByAddressAbciRequestSchema, mw as GetVirtualBlockchainStateAbciRequestSchema, hw as GetVirtualBlockchainUpdateAbciRequestSchema, Fn as HASHABLE, zn as HASHED, vm as HASH_STR, Cg as HCVCodec, Sg as HCVDecoded, Zv as HCVPkeEncoder, wv as HKDF, Ly as HandlerBasedSignatureEncoder, Nx as Hash, Qc as Hashes, lr as INITIAL_OFFER, i as IllegalParameterError, a as IllegalStateError, r as IllegalUsageError, jT as IntermediateRepresentation, m as InternalError, Bx as InternalStateFactory, Yx as InternalStateUpdaterFactory, ie as InvalidActorError, fe as InvalidChannelError, y as InvalidTokenUnitError, gS as JsonSchema, OC as JwkSignatureEncoder, Sv as KeyDerivationFunction, Cv as KeyDerivationFunctionSchemeId, Gg as KeyExchangeSchemeId, Xh as LOCK_TYPE_COUNT, ig as LockSchema, Zh as LockType, k as Logger, Un as MAGIC_STRING, In as MASKABLE, Bn as MASKED, dr as MAXIMUM_GAS_PRICE, er as MAX_MICROBLOCK_FUTURE_DELAY, $n as MAX_MICROBLOCK_PAST_DELAY, rr as MB_STATUS_PREVIOUS_HASH_ERROR, nr as MB_STATUS_TIMESTAMP_ERROR, tr as MB_STATUS_UNRECOVERABLE_ERROR, gi as MICROBLOCK_BODY, mi as MICROBLOCK_HEADER, fi as MICROBLOCK_HEADER_BODY_HASH_OFFSET, di as MICROBLOCK_HEADER_PREVIOUS_HASH_OFFSET, pi as MICROBLOCK_HEADER_SIZE, hi as MICROBLOCK_SECTION, _i as MICROBLOCK_VB_INFORMATION, cr as MILLITOKEN, ur as MINIMUM_GAS_PRICE, Fy as MLDSA65HCVSignatureDecoder, iy as MLDSA65HCVSignatureEncoder, Xg as MLDSA65PrivateSignatureKey, Yg as MLDSA65PublicSignatureKey, Jg as MLDSA65SignatureScheme, yd as MLDsa, Ud as MLKem, Bi as MSG_ACCOUNT_BY_PUBLIC_KEY_HASH, Ri as MSG_ACCOUNT_HISTORY, Ii as MSG_ACCOUNT_STATE, ji as MSG_AWAIT_MICROBLOCK_ANCHORING, wi as MSG_BLOCK_CONTENT, Si as MSG_BLOCK_INFORMATION, bi as MSG_CHAIN_INFORMATION, vi as MSG_ERROR, Ki as MSG_GENESIS_SNAPSHOT, zi as MSG_GET_ACCOUNT_BY_PUBLIC_KEY_HASH, Li as MSG_GET_ACCOUNT_HISTORY, Fi as MSG_GET_ACCOUNT_STATE, Ci as MSG_GET_BLOCK_CONTENT, xi as MSG_GET_BLOCK_INFORMATION, yi as MSG_GET_CHAIN_INFORMATION, Gi as MSG_GET_GENESIS_SNAPSHOT, Ni as MSG_GET_MICROBLOCK_BODYS, ki as MSG_GET_MICROBLOCK_INFORMATION, Ui as MSG_GET_OBJECT_LIST, Vi as MSG_GET_VALIDATOR_NODE_BY_ADDRESS, Ti as MSG_GET_VIRTUAL_BLOCKCHAIN_STATE, Di as MSG_GET_VIRTUAL_BLOCKCHAIN_UPDATE, Mi as MSG_MICROBLOCK_ANCHORING, Pi as MSG_MICROBLOCK_BODYS, Ai as MSG_MICROBLOCK_INFORMATION, Wi as MSG_OBJECT_LIST, Hi as MSG_VALIDATOR_NODE_BY_ADDRESS, Ei as MSG_VIRTUAL_BLOCKCHAIN_STATE, Oi as MSG_VIRTUAL_BLOCKCHAIN_UPDATE, TT as MaskManager, lw as MemoryProvider, FS as MerkleLeaf, Q as MerkleLeafTypeEnum, zS as MerkleRecord, PS as MerkleTree, ST as Merklizer, MT as MessageManager, YC as MessageSerializer, XC as MessageUnserializer, te as MicroBlockNotFoundError, ne as MicroBlockNotFoundInBlockError, x as MicroBlockNotFoundInVirtualBlockchainAtHeightError, Qx as Microblock, Ww as MicroblockAnchoringAbciResponseSchema, Gw as MicroblockBodyItemSchema, wh as MicroblockBodySchema, Kw as MicroblockBodysAbciResponseSchema, WS as MicroblockConsistencyChecker, Pm as MicroblockHeaderSchema, Uw as MicroblockInformationAbciResponseSchema, Wh as MicroblockInformationSchema, nT as MicroblockProofAbciResponseSchema, Nw as MicroblockProofSchema, qh as MicroblockReferenceSchema, Zx as MicroblockStructSchema, s as MicroblockStructureCheckingError, Vv as MlKemCiphertextEncoder, Uv as MlKemPrivateDecryptionKey, Hv as MlKemPublicEncryptionKey, Av as MlKemPublicKeyEncryptionScheme, D as NODE_MESSAGES, um as NULL, cm as NUMBER, Zn as N_VIRTUAL_BLOCKCHAINS, Ny as NativeHCVSignatureDecoder, ny as NativeHCVSignatureEncoder, oT as NetworkProvider, cE as NetworksFileSchema, pT as NewBlockEventSchema, De as NoSharedSecretError, g as NodeConnectionRefusedError, _ as NodeEndpointClosedWhileCatchingUpError, h as NodeError, rg as NodeStakingLockSchema, ng as NodeStakingParametersSchema, de as NotAllowedPkeSchemeError, ue as NotAllowedSignatureSchemeError, c as NotAuthenticatedError, ee as NotImplementedError, sT as NullMemoryProvider, cT as NullNetworkProvider, om as OBJECT, Ta as ORG_CREATION, Ea as ORG_DESCRIPTION, wS as OnChainChannelSchema, ES as OnChainItemListSchema, TS as OnChainItemSchema, VS as OnChainRecord, US as Optional, sh as OrganizationCreationSectionSchema, ch as OrganizationDescriptionSectionSchema, Rx as OrganizationInternalState, Jx as OrganizationInternalStateUpdater, rS as OrganizationMicroblockStructureChecker, ve as OrganizationNotFoundError, Dh as OrganizationVBInternalStateObjectSchema, iS as OrganizationVb, Lh as OrganizationVirtualBlockchainStateSchema, gv as PBKDF2, Ln as PROPERTIES, ca as PROTOCOL_CREATION, la as PROTOCOL_UPDATE, oi as PROTOCOL_VARIABLES, si as PROTOCOL_VB_STATE, Wn as PROTOCOL_VERSION, l as ParsingError, hv as PasswordBasedKeyDerivationFunction, mv as PasswordBasedKeyDerivationFunctionSchemeId, hT as PathManager, CT as PepperMerklizer, kC as PkeEncoderFactory, Ey as PkmsSecp256k1PrivateSignatureKey, Dy as PkmsSecp256k1PublicSignatureKey, Iy as PkmsSecp256k1SignatureDecoder, Oy as PkmsSecp256k1SignatureEncoder, Mw as ProofBlockSchema, NS as ProofDocument, hS as ProofDocumentVB, DS as ProofFieldTypeEnum, IS as ProofRecord, ce as ProofVerificationFailedError, aw as ProofVerificationResult, jS as ProofWrapperSchema, Wm as ProtocolCreationSectionSchema, we as ProtocolError, Lx as ProtocolInternalState, qx as ProtocolInternalStateUpdater, dS as ProtocolMicroblockStructureChecker, zm as ProtocolUpdateSchema, Gm as ProtocolUpdateSectionSchema, Th as ProtocolVBInternalStateObjectSchema, Rm as ProtocolVariablesSchema, Km as ProtocolVariablesSectionSchema, fS as ProtocolVb, Vh as ProtocolVirtualBlockchainStateSchema, uT as Provider, dT as ProviderFactory, Ev as PublicKeyEncryptionAlgorithmId, Tv as PublicKeyEncryptionSchemeId, qS as RADIX_CST, ni as RECORD_DESCRIPTION, Rn as REDACTED, uw as RPCNodeStatusResponseSchema, JS as RadixUtils, Zs as Random, Qw as RawBlockContentAbciResponseSchema, Rv as ReadStream, BS as Record, aC as RecordActorAssignationSchema, nC as RecordActorSchema, LS as RecordByChannels, iC as RecordChannelAssignationSchema, rC as RecordChannelSchema, cC as RecordHashableFieldSchema, sC as RecordMaskableFieldSchema, oC as RecordMaskedPartSchema, ug as RequestedAccountUpdateSchema, Lm as RetentionCostBreakdownSchema, kx as RetentionCostCalculator, Im as RetentionPolicySchema, Fm as RetentionTierSchema, Gr as SCHEMAS, aa as SECTIONS, oa as SIGNATURE, sa as SIGNATURE_SCHEMA, sm as STRING, wT as SaltMerklizer, RS as SaltShaker, zv as SchemaSerializer, Bv as SchemaUnserializer, ZC as SchemaValidator, IC as Scrypt, mp as Secp256k1, Py as Secp256k1HCVSignatureDecoder, ry as Secp256k1HCVSignatureEncoder, Kv as Secp256k1PrivateSignatureKey, Gv as Secp256k1PublicSignatureKey, Wv as Secp256k1SignatureScheme, Z as SectionConstraint, me as SectionError, Wx as SectionLabel, Ee as SectionNotFoundError, Jh as SectionReferenceSchema, Ch as SectionSchema, O as SectionType, CE as SeedEncoder, RC as SelfProvidedApiKeyPkmsCredentialProvider, Oe as SerializationError, tT as SerializedMicroblockByHeightAbciResponseSchema, fT as ServerNetworkProvider, uv as Sha256CryptographicHash, p as SharedKeyDecryptionError, LC as SignatureAlgorithmId, zC as SignatureCacheDisabled, BC as SignatureCacheEntry, VC as SignatureCacheMonothread, Ja as SignatureSchemeId, Vm as SignatureSectionSchema, $S as StateChecker, nS as StructureChecker, Vg as SymmetricEncryptionSchemeId, or as TOKEN, ar as TOKEN_NAME, vn as TYPE_ARRAY, Nn as TYPE_ARRAY_OF, An as TYPE_BIN256, kn as TYPE_BINARY, Sn as TYPE_BOOLEAN, jn as TYPE_HASH_STR, Mn as TYPE_MAIN, Pn as TYPE_NAMES, Cn as TYPE_NULL, xn as TYPE_NUMBER, yn as TYPE_OBJECT, bn as TYPE_STRING, Tn as TYPE_UINT16, En as TYPE_UINT24, Dn as TYPE_UINT32, On as TYPE_UINT48, wn as TYPE_UINT8, _n as TYPE_UNKNOWN, $x as ThrownErrorMicroblockSearchFailureFallback, Xx as TimestampValidationResult, pn as TokenUnit, mn as TokenUnitLabel, NT as Transaction, vS as TransformationTypeEnum, ro as TypeChecker, eo as TypeCheckingFailureError, bS as TypeEnum, no as TypeManager, fm as UINT16, pm as UINT24, mm as UINT32, hm as UINT48, dm as UINT8, Za as Utf8Encoder, A as Utils, Kn as VB_ACCOUNT, Yn as VB_APPLICATION, Xn as VB_APP_LEDGER, Qn as VB_NAME, Jn as VB_ORGANIZATION, Gn as VB_PROTOCOL, ci as VB_STATES, qn as VB_VALIDATOR_NODE, ai as VIRTUAL_BLOCKCHAIN_STATE, Ca as VN_APPROVAL, xa as VN_COMETBFT_PUBLIC_KEY_DECLARATION, ba as VN_CREATION, Sa as VN_RPC_ENDPOINT, ah as ValidatorNodeApprovalSectionSchema, Xw as ValidatorNodeByAddressAbciResponseSchema, rh as ValidatorNodeCometbftPublicKeyDeclarationSectionSchema, nh as ValidatorNodeCreationSectionSchema, zx as ValidatorNodeInternalState, Kx as ValidatorNodeInternalStateUpdater, lS as ValidatorNodeMicroblockStructureChecker, be as ValidatorNodeNotFoundError, ih as ValidatorNodeRpcEndpointSectionSchema, oh as ValidatorNodeSlashingCancellationSectionSchema, Oh as ValidatorNodeVBInternalStateObjectSchema, uS as ValidatorNodeVb, Rh as ValidatorNodeVirtualBlockchainStateSchema, tg as VestingLockSchema, eg as VestingParametersSchema, eS as VirtualBlockchain, Uh as VirtualBlockchainInfoSchema, IT as VirtualBlockchainLabel, Se as VirtualBlockchainNotFoundError, Fh as VirtualBlockchainSharedPropertiesSchema, Vw as VirtualBlockchainStateAbciResponseSchema, Hh as VirtualBlockchainStateSchema, lE as VirtualBlockchainStatusSchema, H as VirtualBlockchainType, Hw as VirtualBlockchainUpdateAbciResponseSchema, $i as WIMSG_ANSWER, ta as WIMSG_CONNECTION_ACCEPTED, ea as WIMSG_CONNECTION_INFO, Xi as WIMSG_CONNECTION_TOKEN, Zi as WIMSG_FORWARDED_ANSWER, na as WIMSG_FORWARDED_REQUEST, Qi as WIMSG_GET_CONNECTION_INFO, Ji as WIMSG_REQUEST, Yi as WIMSG_UPDATE_QR, qa as WI_INVALID_SIGNATURE, GT as WI_MAX_SERVER_URL_LENGTH, ra as WI_MESSAGES, qi as WI_QR_CODE, PE as WalletCrypto, kE as WalletInteractiveAnchoringEncoder, pE as WalletInteractiveAnchoringRequestActorKeySchema, fE as WalletInteractiveAnchoringRequestApprovalHandshakeSchema, mE as WalletInteractiveAnchoringRequestApprovalSignatureSchema, hE as WalletInteractiveAnchoringRequestSchema, uE as WalletInteractiveAnchoringRequestType, _E as WalletInteractiveAnchoringResponseActorKeyRequiredSchema, vE as WalletInteractiveAnchoringResponseApprovalDataSchema, yE as WalletInteractiveAnchoringResponseApprovalSignatureSchema, gE as WalletInteractiveAnchoringResponseErrorSchema, bE as WalletInteractiveAnchoringResponseSchema, dE as WalletInteractiveAnchoringResponseType, AE as WalletInteractiveAnchoringValidation, zT as WalletRequestAuthByPublicKeySchema, dC as WalletRequestBasedApplicationLedgerMicroblockBuilder, BT as WalletRequestDataApprovalSchema, xE as WalletRequestEncoder, VT as WalletRequestSchema, LT as WalletRequestType, SE as WalletRequestValidation, HT as WalletResponseAuthByPublicKeySchema, UT as WalletResponseDataApprovalSchema, WT as WalletResponseSchema, RT as WalletResponseType, jE as WalletSeedEncoder, sE as WiQrCodeEncoder, qT as WiQrCodeSchema, Lv as WriteStream, Am as accountId, ym as array, km as bin256, Om as binary, xm as boolean, jm as height, Nm as nonNegativeInt, B as number, Mm as positiveInt, bm as string, wm as uint16, Tm as uint24, Em as uint32, Dm as uint48, Cm as uint8, V as uint8array, ZS as verifyRadixProof };
|
|
17407
|
+
export { Wr as ACCOUNT_ALLOWED_TRANSFERS, Hr as ACCOUNT_BLOCK_FEES, Br as ACCOUNT_BURNT_TOKENS, ma as ACCOUNT_CREATION, va as ACCOUNT_ESCROW_SETTLEMENT, _a as ACCOUNT_ESCROW_TRANSFER, ii as ACCOUNT_HISTORY, Ur as ACCOUNT_NAMES, fa as ACCOUNT_PUBLIC_KEY, ya as ACCOUNT_STAKE, Vr as ACCOUNT_STANDARD, ri as ACCOUNT_STATE, pa as ACCOUNT_TOKEN_ISSUANCE, ha as ACCOUNT_TRANSFER, ga as ACCOUNT_VESTING_TRANSFER, Ug as AES256GCMSymmetricEncryptionKey, Hg as AES256GCMSymmetricEncryptionScheme, aa as ALL_SCHEMAS, Ga as ALL_SECTIONS_SCHEMAS, ka as APP_CREATION, Aa as APP_DESCRIPTION, Fa as APP_LEDGER_ACTOR_CREATION, za as APP_LEDGER_ACTOR_SUBSCRIPTION, Na as APP_LEDGER_ALLOWED_PKE_SCHEMES, Ma as APP_LEDGER_ALLOWED_SIG_SCHEMES, Ha as APP_LEDGER_AUTHOR, Ia as APP_LEDGER_CHANNEL_CREATION, Ra as APP_LEDGER_CHANNEL_INVITATION, Pa as APP_LEDGER_CREATION, Ua as APP_LEDGER_ENDORSEMENT_REQUEST, Va as APP_LEDGER_PRIVATE_CHANNEL_DATA, Ba as APP_LEDGER_PUBLIC_CHANNEL_DATA, La as APP_LEDGER_SHARED_SECRET, am as ARRAY, aT as AbciQueryEncoder, jw as AbciRequestSchema, $ as AbciRequestType, iT as AbciResponseSchema, Fw as AbciResponseType, kv as AbstractPrivateDecryptionKey, sw as AbstractProvider, Ov as AbstractPublicEncryptionKey, Dv as AbstractPublicKeyEncryptionScheme, ag as AccountBreakdownSchema, Yw as AccountByPublicKeyHashAbciResponseSchema, Ym as AccountCreationSectionSchema, NE as AccountCrypto, $m as AccountEscrowSettlementSectionSchema, Qm as AccountEscrowTransferSectionSchema, Jw as AccountHistoryAbciResponseSchema, cg as AccountHistoryEntrySchema, lg as AccountHistorySchema, PT as AccountHistoryView, sg as AccountInformationSchema, Mx as AccountInternalState, Vx as AccountInternalStateUpdater, aS as AccountMicroblockStructureChecker, _e as AccountNotFoundForAccountHashError, ge as AccountNotFoundForPublicKeyError, xe as AccountNotFoundForPublicKeyHashError, rT as AccountProofAbciResponseSchema, Pw as AccountProofSchema, qm as AccountPublicKeySectionSchema, wE as AccountSeedEncoder, eh as AccountStakeSectionSchema, qw as AccountStateAbciResponseSchema, og as AccountStateSchema, Jm as AccountTokenIssuanceSectionSchema, EE as AccountTransaction, TE as AccountTransactions, Xm as AccountTransferSectionSchema, th as AccountUnstakeSectionSchema, dg as AccountUpdateSchema, eT as AccountUpdatesAbciResponseSchema, oS as AccountVb, Zm as AccountVestingTransferSectionSchema, Eh as AccountVirtualBlockchainInternalStateSchema, Ih as AccountVirtualBlockchainStateSchema, re as ActorAlreadyDefinedError, ME as ActorCrypto, oe as ActorNotDefinedError, he as ActorNotInvitedError, Te as ActorNotSubscribedError, DE as ActorSeedEncoder, tC as ActorType, su as Aes, Um as AllowedAdditionalWriterSectionSchema, S as AlreadySubscribedError, Gx as AppLedgerLocalStateUpdaterV1, lC as AppLedgerMicroblockBuildRequestSchema, uC as AppLedgerMicroblockBuildRequestValidation, lh as ApplicationCreationSectionSchema, uh as ApplicationDescriptionSectionSchema, Px as ApplicationInternalState, Hx as ApplicationInternalStateUpdater, mh as ApplicationLedgerActorCreationSectionSchema, jh as ApplicationLedgerActorInvitationStateSchema, Nh as ApplicationLedgerActorSchema, vh as ApplicationLedgerActorSubscriptionSectionSchema, fh as ApplicationLedgerAllowedPkeSchemesSectionSchema, dh as ApplicationLedgerAllowedSigSchemesSectionSchema, xh as ApplicationLedgerAuthorSectionSchema, hh as ApplicationLedgerChannelCreationSectionSchema, _h as ApplicationLedgerChannelInvitationSectionSchema, Ah as ApplicationLedgerChannelSchema, ph as ApplicationLedgerCreationSectionSchema, Sh as ApplicationLedgerEndorsementRequestSectionSchema, Fx as ApplicationLedgerInternalState, Ph as ApplicationLedgerInternalStateObjectSchema, eC as ApplicationLedgerMicroblockBuilder, mS as ApplicationLedgerMicroblockStructureChecker, Ce as ApplicationLedgerNotFoundError, bh as ApplicationLedgerPrivateChannelDataSectionSchema, yh as ApplicationLedgerPublicChannelDataSectionSchema, gh as ApplicationLedgerSharedSecretSectionSchema, Mh as ApplicationLedgerSharedSecretStateSchema, HS as ApplicationLedgerVb, Bh as ApplicationLedgerVirtualBlockchainStateSchema, sS as ApplicationMicroblockStructureChecker, ye as ApplicationNotFoundError, kh as ApplicationVBInternalStateObjectSchema, cS as ApplicationVb, zh as ApplicationVirtualBlockchainStateSchema, pS as Assertion, Hm as AuxiliarySignatureSectionSchema, _w as AwaitMicroblockAnchoringAbciRequestSchema, _m as BIN256, gm as BINARY, Er as BK_EARNED_BLOCK_FEES, Tr as BK_EARNED_TX_FEES, zr as BK_NAMES, gr as BK_PAID_BLOCK_FEES, hr as BK_PAID_TX_FEES, mr as BK_PLUS, Or as BK_PURCHASE, jr as BK_RECEIVED_ESCROW, Mr as BK_RECEIVED_ESCROW_REFUND, Nr as BK_RECEIVED_EXPIRED_ESCROW, Dr as BK_RECEIVED_ISSUANCE, kr as BK_RECEIVED_PAYMENT, Pr as BK_RECEIVED_SLASHED_TOKENS, Ar as BK_RECEIVED_VESTING, Rr as BK_REFERENCES, Fr as BK_REF_BLOCK, Ir as BK_REF_MICROBLOCK, Lr as BK_REF_SECTION, vr as BK_SALE, xr as BK_SENT_ESCROW, Sr as BK_SENT_ESCROW_REFUND, Cr as BK_SENT_EXPIRED_ESCROW, _r as BK_SENT_ISSUANCE, yr as BK_SENT_PAYMENT, wr as BK_SENT_SLASHED_TOKENS, br as BK_SENT_VESTING, ui as BLOCK_CONTENT, li as BLOCK_INFORMATION, lm as BOOLEAN, OE as BalanceAvailability, UC as Base32, mg as Base64, My as BaseHCVSignatureDecoder, ty as BaseHCVSignatureEncoder, Kg as BasePrivateSignatureKey, qg as BasePublicSignatureKey, Bw as BlockContentAbciResponseSchema, Rw as BlockInformationAbciResponseSchema, $w as BlockModifiedAccountsAbciResponseSchema, Kh as BlockReferenceSchema, b as BlockchainError, X as BlockchainUtils, pC as BytesSignatureEncoder, bg as BytesToBase64Encoder, xg as BytesToHexEncoder, Ex as CBORCryptoBinaryEncoder, sr as CENTITOKEN, Hn as CHAIN, hn as CMTSToken, qr as CONTRACT_PARAMETER_SCHEMA, Jr as CONTRACT_SCHEMA, le as CannotSubscribeError, o as CarmentisError, n as CarmentisErrorCode, Lw as ChainInformationAbciResponseSchema, Yh as ChainReferenceSchema, Gh as ChainReferenceType, ae as ChannelAlreadyDefinedError, se as ChannelNotDefinedError, aE as ClientBridgeEncoder, iE as ClientBridgeMessageSchema, $T as ClientBridgeMessageSchema_Answer, tE as ClientBridgeMessageSchema_ConnectionAccepted, eE as ClientBridgeMessageSchema_ConnectionInfo, XT as ClientBridgeMessageSchema_ConnectionToken, rE as ClientBridgeMessageSchema_Error, ZT as ClientBridgeMessageSchema_ForwardedAnswer, nE as ClientBridgeMessageSchema_ForwardedRequest, QT as ClientBridgeMessageSchema_GetConnectionInfo, JT as ClientBridgeMessageSchema_Request, YT as ClientBridgeMessageSchema_UpdateQr, KT as ClientBridgeMessageType, oE as ClientBridgeValidation, ow as CometBFTErrorCode, mT as CometBFTNodeWebSocket, fC as CometBFTPublicKey, lT as CometBFTPublicKeyConverter, tS as ConstraintNameByConstraint, M as Crypto, Dx as CryptoEncoderFactory, d as CryptoError, Xv as CryptoSchemeFactory, lv as CryptographicHashSchemeId, rw as CurrencyConverterFactory, pe as CurrentActorNotFoundError, Bm as CustomSectionSchema, gn as DATA, Ka as DEF, f as DecryptionError, ir as ECO, Kr as ERROR, qa as ERRORS, QC as Economics, v as EconomicsError, Yv as Ed25519PrivateSignatureKey, Jv as Ed25519PublicSignatureKey, qv as Ed25519SignatureScheme, u as EmptyBlockError, yg as EncoderFactory, wy as EnvApiKeyPkmsCredentialProvider, Iw as ErrorAbciResponseSchema, $h as EscrowLockSchema, Qh as EscrowParametersSchema, nw as Euros, iw as EurosToCMTSConverter, cw as ExpirationDate, Wg as ExtendedSymmetricEncryptionKey, Vn as FORMAT, jx as FeesCalculationFormulaFactory, Ax as FirstFeesFormula, pr as GAS_ATOMS_PER_GAS, fr as GAS_PER_BYTE, AC as GenericSymmetricKeyEncoder, Zw as GenesisSnapshotAbciResponseSchema, xw as GetAccountByPublicKeyHashAbciRequestSchema, bw as GetAccountHistoryAbciRequestSchema, Aw as GetAccountProofAbciRequestSchema, yw as GetAccountStateAbciRequestSchema, Ew as GetAccountUpdatesAbciRequestSchema, pw as GetBlockContentAbciRequestSchema, fw as GetBlockInformationAbciRequestSchema, Tw as GetBlockModifiedAccountsAbciRequestSchema, dw as GetChainInformationAbciRequestSchema, Cw as GetGenesisSnapshotAbciRequestSchema, vw as GetMicroblockBodysAbciRequestSchema, gw as GetMicroblockInformationAbciRequestSchema, Dw as GetMicroblockInformationByHeightAbciRequestSchema, kw as GetMicroblockProofAbciRequestSchema, ww as GetRawBlockContentAbciRequestSchema, Ow as GetSerializedMicroblockByHeightAbciRequestSchema, Sw as GetValidatorNodeByAddressAbciRequestSchema, mw as GetVirtualBlockchainStateAbciRequestSchema, hw as GetVirtualBlockchainUpdateAbciRequestSchema, Fn as HASHABLE, zn as HASHED, vm as HASH_STR, Cg as HCVCodec, Sg as HCVDecoded, Zv as HCVPkeEncoder, wv as HKDF, Ly as HandlerBasedSignatureEncoder, Nx as Hash, Qc as Hashes, lr as INITIAL_OFFER, i as IllegalParameterError, a as IllegalStateError, r as IllegalUsageError, jT as IntermediateRepresentation, m as InternalError, Bx as InternalStateFactory, Yx as InternalStateUpdaterFactory, ie as InvalidActorError, fe as InvalidChannelError, y as InvalidTokenUnitError, gS as JsonSchema, OC as JwkSignatureEncoder, Sv as KeyDerivationFunction, Cv as KeyDerivationFunctionSchemeId, Gg as KeyExchangeSchemeId, Xh as LOCK_TYPE_COUNT, ig as LockSchema, Zh as LockType, O as Logger, Un as MAGIC_STRING, In as MASKABLE, Bn as MASKED, dr as MAXIMUM_GAS_PRICE, er as MAX_MICROBLOCK_FUTURE_DELAY, $n as MAX_MICROBLOCK_PAST_DELAY, rr as MB_STATUS_PREVIOUS_HASH_ERROR, nr as MB_STATUS_TIMESTAMP_ERROR, tr as MB_STATUS_UNRECOVERABLE_ERROR, gi as MICROBLOCK_BODY, mi as MICROBLOCK_HEADER, fi as MICROBLOCK_HEADER_BODY_HASH_OFFSET, di as MICROBLOCK_HEADER_PREVIOUS_HASH_OFFSET, pi as MICROBLOCK_HEADER_SIZE, hi as MICROBLOCK_SECTION, _i as MICROBLOCK_VB_INFORMATION, cr as MILLITOKEN, ur as MINIMUM_GAS_PRICE, Fy as MLDSA65HCVSignatureDecoder, iy as MLDSA65HCVSignatureEncoder, Xg as MLDSA65PrivateSignatureKey, Yg as MLDSA65PublicSignatureKey, Jg as MLDSA65SignatureScheme, yd as MLDsa, Ud as MLKem, Bi as MSG_ACCOUNT_BY_PUBLIC_KEY_HASH, Ri as MSG_ACCOUNT_HISTORY, Ii as MSG_ACCOUNT_STATE, ji as MSG_AWAIT_MICROBLOCK_ANCHORING, wi as MSG_BLOCK_CONTENT, Si as MSG_BLOCK_INFORMATION, bi as MSG_CHAIN_INFORMATION, vi as MSG_ERROR, Ki as MSG_GENESIS_SNAPSHOT, zi as MSG_GET_ACCOUNT_BY_PUBLIC_KEY_HASH, Li as MSG_GET_ACCOUNT_HISTORY, Fi as MSG_GET_ACCOUNT_STATE, Ci as MSG_GET_BLOCK_CONTENT, xi as MSG_GET_BLOCK_INFORMATION, yi as MSG_GET_CHAIN_INFORMATION, Gi as MSG_GET_GENESIS_SNAPSHOT, Ni as MSG_GET_MICROBLOCK_BODYS, ki as MSG_GET_MICROBLOCK_INFORMATION, Ui as MSG_GET_OBJECT_LIST, Vi as MSG_GET_VALIDATOR_NODE_BY_ADDRESS, Ti as MSG_GET_VIRTUAL_BLOCKCHAIN_STATE, Di as MSG_GET_VIRTUAL_BLOCKCHAIN_UPDATE, Mi as MSG_MICROBLOCK_ANCHORING, Pi as MSG_MICROBLOCK_BODYS, Ai as MSG_MICROBLOCK_INFORMATION, Wi as MSG_OBJECT_LIST, Hi as MSG_VALIDATOR_NODE_BY_ADDRESS, Ei as MSG_VIRTUAL_BLOCKCHAIN_STATE, Oi as MSG_VIRTUAL_BLOCKCHAIN_UPDATE, TT as MaskManager, lw as MemoryProvider, FS as MerkleLeaf, Q as MerkleLeafTypeEnum, zS as MerkleRecord, PS as MerkleTree, ST as Merklizer, MT as MessageManager, YC as MessageSerializer, XC as MessageUnserializer, te as MicroBlockNotFoundError, ne as MicroBlockNotFoundInBlockError, x as MicroBlockNotFoundInVirtualBlockchainAtHeightError, Qx as Microblock, Ww as MicroblockAnchoringAbciResponseSchema, Gw as MicroblockBodyItemSchema, wh as MicroblockBodySchema, Kw as MicroblockBodysAbciResponseSchema, WS as MicroblockConsistencyChecker, Pm as MicroblockHeaderSchema, Uw as MicroblockInformationAbciResponseSchema, Wh as MicroblockInformationSchema, nT as MicroblockProofAbciResponseSchema, Nw as MicroblockProofSchema, qh as MicroblockReferenceSchema, Zx as MicroblockStructSchema, s as MicroblockStructureCheckingError, Vv as MlKemCiphertextEncoder, Uv as MlKemPrivateDecryptionKey, Hv as MlKemPublicEncryptionKey, Av as MlKemPublicKeyEncryptionScheme, qi as NODE_MESSAGES, um as NULL, cm as NUMBER, Zn as N_VIRTUAL_BLOCKCHAINS, Ny as NativeHCVSignatureDecoder, ny as NativeHCVSignatureEncoder, oT as NetworkProvider, cE as NetworksFileSchema, pT as NewBlockEventSchema, De as NoSharedSecretError, g as NodeConnectionRefusedError, _ as NodeEndpointClosedWhileCatchingUpError, h as NodeError, rg as NodeStakingLockSchema, ng as NodeStakingParametersSchema, de as NotAllowedPkeSchemeError, ue as NotAllowedSignatureSchemeError, c as NotAuthenticatedError, ee as NotImplementedError, sT as NullMemoryProvider, cT as NullNetworkProvider, om as OBJECT, Ea as ORG_CREATION, Da as ORG_DESCRIPTION, wS as OnChainChannelSchema, ES as OnChainItemListSchema, TS as OnChainItemSchema, VS as OnChainRecord, US as Optional, sh as OrganizationCreationSectionSchema, ch as OrganizationDescriptionSectionSchema, Rx as OrganizationInternalState, Jx as OrganizationInternalStateUpdater, rS as OrganizationMicroblockStructureChecker, ve as OrganizationNotFoundError, Dh as OrganizationVBInternalStateObjectSchema, iS as OrganizationVb, Lh as OrganizationVirtualBlockchainStateSchema, gv as PBKDF2, Ln as PROPERTIES, la as PROTOCOL_CREATION, ua as PROTOCOL_UPDATE, oi as PROTOCOL_VARIABLES, si as PROTOCOL_VB_STATE, Wn as PROTOCOL_VERSION, l as ParsingError, hv as PasswordBasedKeyDerivationFunction, mv as PasswordBasedKeyDerivationFunctionSchemeId, hT as PathManager, CT as PepperMerklizer, kC as PkeEncoderFactory, Ey as PkmsSecp256k1PrivateSignatureKey, Dy as PkmsSecp256k1PublicSignatureKey, Iy as PkmsSecp256k1SignatureDecoder, Oy as PkmsSecp256k1SignatureEncoder, Mw as ProofBlockSchema, NS as ProofDocument, hS as ProofDocumentVB, DS as ProofFieldTypeEnum, IS as ProofRecord, ce as ProofVerificationFailedError, aw as ProofVerificationResult, jS as ProofWrapperSchema, Wm as ProtocolCreationSectionSchema, we as ProtocolError, Lx as ProtocolInternalState, qx as ProtocolInternalStateUpdater, dS as ProtocolMicroblockStructureChecker, zm as ProtocolUpdateSchema, Gm as ProtocolUpdateSectionSchema, Th as ProtocolVBInternalStateObjectSchema, Rm as ProtocolVariablesSchema, Km as ProtocolVariablesSectionSchema, fS as ProtocolVb, Vh as ProtocolVirtualBlockchainStateSchema, uT as Provider, dT as ProviderFactory, Ev as PublicKeyEncryptionAlgorithmId, Tv as PublicKeyEncryptionSchemeId, qS as RADIX_CST, ni as RECORD_DESCRIPTION, Rn as REDACTED, uw as RPCNodeStatusResponseSchema, JS as RadixUtils, Zs as Random, Qw as RawBlockContentAbciResponseSchema, Rv as ReadStream, BS as Record, aC as RecordActorAssignationSchema, nC as RecordActorSchema, LS as RecordByChannels, iC as RecordChannelAssignationSchema, rC as RecordChannelSchema, cC as RecordHashableFieldSchema, sC as RecordMaskableFieldSchema, oC as RecordMaskedPartSchema, ug as RequestedAccountUpdateSchema, Lm as RetentionCostBreakdownSchema, kx as RetentionCostCalculator, Im as RetentionPolicySchema, Fm as RetentionTierSchema, Gr as SCHEMAS, oa as SECTIONS, sa as SIGNATURE, ca as SIGNATURE_SCHEMA, sm as STRING, wT as SaltMerklizer, RS as SaltShaker, zv as SchemaSerializer, Bv as SchemaUnserializer, ZC as SchemaValidator, IC as Scrypt, mp as Secp256k1, Py as Secp256k1HCVSignatureDecoder, ry as Secp256k1HCVSignatureEncoder, Kv as Secp256k1PrivateSignatureKey, Gv as Secp256k1PublicSignatureKey, Wv as Secp256k1SignatureScheme, Z as SectionConstraint, me as SectionError, Wx as SectionLabel, Ee as SectionNotFoundError, Jh as SectionReferenceSchema, Ch as SectionSchema, D as SectionType, CE as SeedEncoder, RC as SelfProvidedApiKeyPkmsCredentialProvider, Oe as SerializationError, tT as SerializedMicroblockByHeightAbciResponseSchema, fT as ServerNetworkProvider, uv as Sha256CryptographicHash, p as SharedKeyDecryptionError, LC as SignatureAlgorithmId, zC as SignatureCacheDisabled, BC as SignatureCacheEntry, VC as SignatureCacheMonothread, Ya as SignatureSchemeId, Vm as SignatureSectionSchema, $S as StateChecker, nS as StructureChecker, Vg as SymmetricEncryptionSchemeId, or as TOKEN, ar as TOKEN_NAME, vn as TYPE_ARRAY, Nn as TYPE_ARRAY_OF, An as TYPE_BIN256, kn as TYPE_BINARY, Sn as TYPE_BOOLEAN, jn as TYPE_HASH_STR, Mn as TYPE_MAIN, Pn as TYPE_NAMES, Cn as TYPE_NULL, xn as TYPE_NUMBER, yn as TYPE_OBJECT, bn as TYPE_STRING, Tn as TYPE_UINT16, En as TYPE_UINT24, Dn as TYPE_UINT32, On as TYPE_UINT48, wn as TYPE_UINT8, _n as TYPE_UNKNOWN, $x as ThrownErrorMicroblockSearchFailureFallback, Xx as TimestampValidationResult, pn as TokenUnit, mn as TokenUnitLabel, NT as Transaction, vS as TransformationTypeEnum, io as TypeChecker, to as TypeCheckingFailureError, bS as TypeEnum, ro as TypeManager, fm as UINT16, pm as UINT24, mm as UINT32, hm as UINT48, dm as UINT8, Qa as Utf8Encoder, k as Utils, Kn as VB_ACCOUNT, Yn as VB_APPLICATION, Xn as VB_APP_LEDGER, Qn as VB_NAME, Jn as VB_ORGANIZATION, Gn as VB_PROTOCOL, ci as VB_STATES, qn as VB_VALIDATOR_NODE, ai as VIRTUAL_BLOCKCHAIN_STATE, wa as VN_APPROVAL, Sa as VN_COMETBFT_PUBLIC_KEY_DECLARATION, xa as VN_CREATION, Ca as VN_RPC_ENDPOINT, ah as ValidatorNodeApprovalSectionSchema, Xw as ValidatorNodeByAddressAbciResponseSchema, rh as ValidatorNodeCometbftPublicKeyDeclarationSectionSchema, nh as ValidatorNodeCreationSectionSchema, zx as ValidatorNodeInternalState, Kx as ValidatorNodeInternalStateUpdater, lS as ValidatorNodeMicroblockStructureChecker, be as ValidatorNodeNotFoundError, ih as ValidatorNodeRpcEndpointSectionSchema, oh as ValidatorNodeSlashingCancellationSectionSchema, Oh as ValidatorNodeVBInternalStateObjectSchema, uS as ValidatorNodeVb, Rh as ValidatorNodeVirtualBlockchainStateSchema, tg as VestingLockSchema, eg as VestingParametersSchema, eS as VirtualBlockchain, Uh as VirtualBlockchainInfoSchema, IT as VirtualBlockchainLabel, Se as VirtualBlockchainNotFoundError, Fh as VirtualBlockchainSharedPropertiesSchema, Vw as VirtualBlockchainStateAbciResponseSchema, Hh as VirtualBlockchainStateSchema, lE as VirtualBlockchainStatusSchema, H as VirtualBlockchainType, Hw as VirtualBlockchainUpdateAbciResponseSchema, ea as WIMSG_ANSWER, na as WIMSG_CONNECTION_ACCEPTED, ta as WIMSG_CONNECTION_INFO, Zi as WIMSG_CONNECTION_TOKEN, Qi as WIMSG_FORWARDED_ANSWER, ra as WIMSG_FORWARDED_REQUEST, $i as WIMSG_GET_CONNECTION_INFO, Yi as WIMSG_REQUEST, Xi as WIMSG_UPDATE_QR, Ja as WI_INVALID_SIGNATURE, GT as WI_MAX_SERVER_URL_LENGTH, ia as WI_MESSAGES, Ji as WI_QR_CODE, PE as WalletCrypto, kE as WalletInteractiveAnchoringEncoder, pE as WalletInteractiveAnchoringRequestActorKeySchema, fE as WalletInteractiveAnchoringRequestApprovalHandshakeSchema, mE as WalletInteractiveAnchoringRequestApprovalSignatureSchema, hE as WalletInteractiveAnchoringRequestSchema, uE as WalletInteractiveAnchoringRequestType, _E as WalletInteractiveAnchoringResponseActorKeyRequiredSchema, vE as WalletInteractiveAnchoringResponseApprovalDataSchema, yE as WalletInteractiveAnchoringResponseApprovalSignatureSchema, gE as WalletInteractiveAnchoringResponseErrorSchema, bE as WalletInteractiveAnchoringResponseSchema, dE as WalletInteractiveAnchoringResponseType, AE as WalletInteractiveAnchoringValidation, zT as WalletRequestAuthByPublicKeySchema, dC as WalletRequestBasedApplicationLedgerMicroblockBuilder, BT as WalletRequestDataApprovalSchema, xE as WalletRequestEncoder, VT as WalletRequestSchema, LT as WalletRequestType, SE as WalletRequestValidation, HT as WalletResponseAuthByPublicKeySchema, UT as WalletResponseDataApprovalSchema, WT as WalletResponseSchema, RT as WalletResponseType, jE as WalletSeedEncoder, sE as WiQrCodeEncoder, qT as WiQrCodeSchema, Lv as WriteStream, Am as accountId, ym as array, km as bin256, Om as binary, xm as boolean, jm as height, Nm as nonNegativeInt, B as number, Mm as positiveInt, bm as string, wm as uint16, Tm as uint24, Em as uint32, Dm as uint48, Cm as uint8, V as uint8array, ZS as verifyRadixProof };
|