@fleet-sdk/common 0.2.0 → 0.2.2
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/CHANGELOG.md +12 -0
- package/dist/{index.js → index.cjs.js} +1 -1
- package/dist/index.d.mts +39 -1
- package/dist/index.d.ts +39 -1
- package/dist/{index.mjs → index.esm.js} +1 -1
- package/package.json +6 -6
- package/src/types/block.ts +44 -0
- package/src/types/index.ts +1 -0
- /package/dist/{index.js.map → index.cjs.js.map} +0 -0
- /package/dist/{index.mjs.map → index.esm.js.map} +0 -0
package/CHANGELOG.md
CHANGED
package/dist/index.d.mts
CHANGED
@@ -127,6 +127,44 @@ type Box<T extends AmountType, R extends NonMandatoryRegisters = NonMandatoryReg
|
|
127
127
|
index: number;
|
128
128
|
};
|
129
129
|
|
130
|
+
type PoWSolution = {
|
131
|
+
pk: HexString;
|
132
|
+
w: HexString;
|
133
|
+
n: string;
|
134
|
+
d: number;
|
135
|
+
};
|
136
|
+
type BlockHeaderId = string;
|
137
|
+
type BlockTransactions = {
|
138
|
+
headerId: BlockHeaderId;
|
139
|
+
transactions: SignedTransaction[];
|
140
|
+
};
|
141
|
+
type BlockHeader = {
|
142
|
+
id: BlockHeaderId;
|
143
|
+
timestamp: number;
|
144
|
+
version: number;
|
145
|
+
adProofsRoot: HexString;
|
146
|
+
stateRoot: HexString;
|
147
|
+
transactionsRoot: HexString;
|
148
|
+
nBits: number;
|
149
|
+
extensionHash: HexString;
|
150
|
+
powSolutions: PoWSolution;
|
151
|
+
height: number;
|
152
|
+
difficulty: string;
|
153
|
+
parentId: BlockHeaderId;
|
154
|
+
votes: string;
|
155
|
+
size: number;
|
156
|
+
extensionId: HexString;
|
157
|
+
transactionsId: HexString;
|
158
|
+
adProofsId: HexString;
|
159
|
+
};
|
160
|
+
type Block = {
|
161
|
+
header: BlockHeader;
|
162
|
+
blockTransactions: BlockTransactions;
|
163
|
+
adProofs: unknown;
|
164
|
+
extension: unknown;
|
165
|
+
size: number;
|
166
|
+
};
|
167
|
+
|
130
168
|
type ObjectSelector<T> = (item: T) => T[keyof T];
|
131
169
|
declare function first(array: undefined): undefined;
|
132
170
|
declare function first<T>(array: ArrayLike<T>): T;
|
@@ -265,4 +303,4 @@ declare abstract class Collection<InternalType, ExternalType> implements Iterabl
|
|
265
303
|
reduce<U>(callbackFn: (accumulator: U, currentValue: InternalType, currentIndex: number, array: InternalType[]) => U, initialValue: U): U;
|
266
304
|
}
|
267
305
|
|
268
|
-
export { AddressType, Amount, AmountType, AssertErrorMessageInput, Base58String, Box, BoxCandidate, BoxId, BoxSummary, BuildOutputType, Collection, CollectionAddOptions, ContextExtension, DataInput, EIP12UnsignedDataInput, EIP12UnsignedInput, EIP12UnsignedTransaction, ErgoTreeHeaderFlag, ErgoTreeHex, FilterPredicate, HexString, MinimalBoxAmounts, Network, NewToken, NonMandatoryRegisters, OneOrMore, ProverResult, SignedInput, SignedTransaction, SortingDirection, SortingSelector, TokenAmount, TokenId, TokenTargetAmount, TransactionId, UTxOFilterParams, UnsignedInput, UnsignedTransaction, _0n, _10n, _127n, _128n, _1n, _63n, _7n, areEqual, areEqualBy, areRegistersDenselyPacked, assert, assertInstanceOf, assertTypeOf, at, byteSizeOf, chunk, clearUndefined, concatBytes, decimalize, depthOf, endsWith, ensureBigInt, ensureDefaults, ensureUTxOBigInt, ergoTreeHeaderFlags, first, hasDuplicates, hasDuplicatesBy, hasKey, isDefined, isEmpty, isFalsy, isHex, isTruthy, isUndefined, last, max, min, orderBy, percent, some, startsWith, sumBy, undecimalize, uniq, uniqBy, utxoDiff, utxoFilter, utxoSum };
|
306
|
+
export { AddressType, Amount, AmountType, AssertErrorMessageInput, Base58String, Block, BlockHeader, BlockHeaderId, BlockTransactions, Box, BoxCandidate, BoxId, BoxSummary, BuildOutputType, Collection, CollectionAddOptions, ContextExtension, DataInput, EIP12UnsignedDataInput, EIP12UnsignedInput, EIP12UnsignedTransaction, ErgoTreeHeaderFlag, ErgoTreeHex, FilterPredicate, HexString, MinimalBoxAmounts, Network, NewToken, NonMandatoryRegisters, OneOrMore, PoWSolution, ProverResult, SignedInput, SignedTransaction, SortingDirection, SortingSelector, TokenAmount, TokenId, TokenTargetAmount, TransactionId, UTxOFilterParams, UnsignedInput, UnsignedTransaction, _0n, _10n, _127n, _128n, _1n, _63n, _7n, areEqual, areEqualBy, areRegistersDenselyPacked, assert, assertInstanceOf, assertTypeOf, at, byteSizeOf, chunk, clearUndefined, concatBytes, decimalize, depthOf, endsWith, ensureBigInt, ensureDefaults, ensureUTxOBigInt, ergoTreeHeaderFlags, first, hasDuplicates, hasDuplicatesBy, hasKey, isDefined, isEmpty, isFalsy, isHex, isTruthy, isUndefined, last, max, min, orderBy, percent, some, startsWith, sumBy, undecimalize, uniq, uniqBy, utxoDiff, utxoFilter, utxoSum };
|
package/dist/index.d.ts
CHANGED
@@ -127,6 +127,44 @@ type Box<T extends AmountType, R extends NonMandatoryRegisters = NonMandatoryReg
|
|
127
127
|
index: number;
|
128
128
|
};
|
129
129
|
|
130
|
+
type PoWSolution = {
|
131
|
+
pk: HexString;
|
132
|
+
w: HexString;
|
133
|
+
n: string;
|
134
|
+
d: number;
|
135
|
+
};
|
136
|
+
type BlockHeaderId = string;
|
137
|
+
type BlockTransactions = {
|
138
|
+
headerId: BlockHeaderId;
|
139
|
+
transactions: SignedTransaction[];
|
140
|
+
};
|
141
|
+
type BlockHeader = {
|
142
|
+
id: BlockHeaderId;
|
143
|
+
timestamp: number;
|
144
|
+
version: number;
|
145
|
+
adProofsRoot: HexString;
|
146
|
+
stateRoot: HexString;
|
147
|
+
transactionsRoot: HexString;
|
148
|
+
nBits: number;
|
149
|
+
extensionHash: HexString;
|
150
|
+
powSolutions: PoWSolution;
|
151
|
+
height: number;
|
152
|
+
difficulty: string;
|
153
|
+
parentId: BlockHeaderId;
|
154
|
+
votes: string;
|
155
|
+
size: number;
|
156
|
+
extensionId: HexString;
|
157
|
+
transactionsId: HexString;
|
158
|
+
adProofsId: HexString;
|
159
|
+
};
|
160
|
+
type Block = {
|
161
|
+
header: BlockHeader;
|
162
|
+
blockTransactions: BlockTransactions;
|
163
|
+
adProofs: unknown;
|
164
|
+
extension: unknown;
|
165
|
+
size: number;
|
166
|
+
};
|
167
|
+
|
130
168
|
type ObjectSelector<T> = (item: T) => T[keyof T];
|
131
169
|
declare function first(array: undefined): undefined;
|
132
170
|
declare function first<T>(array: ArrayLike<T>): T;
|
@@ -265,4 +303,4 @@ declare abstract class Collection<InternalType, ExternalType> implements Iterabl
|
|
265
303
|
reduce<U>(callbackFn: (accumulator: U, currentValue: InternalType, currentIndex: number, array: InternalType[]) => U, initialValue: U): U;
|
266
304
|
}
|
267
305
|
|
268
|
-
export { AddressType, Amount, AmountType, AssertErrorMessageInput, Base58String, Box, BoxCandidate, BoxId, BoxSummary, BuildOutputType, Collection, CollectionAddOptions, ContextExtension, DataInput, EIP12UnsignedDataInput, EIP12UnsignedInput, EIP12UnsignedTransaction, ErgoTreeHeaderFlag, ErgoTreeHex, FilterPredicate, HexString, MinimalBoxAmounts, Network, NewToken, NonMandatoryRegisters, OneOrMore, ProverResult, SignedInput, SignedTransaction, SortingDirection, SortingSelector, TokenAmount, TokenId, TokenTargetAmount, TransactionId, UTxOFilterParams, UnsignedInput, UnsignedTransaction, _0n, _10n, _127n, _128n, _1n, _63n, _7n, areEqual, areEqualBy, areRegistersDenselyPacked, assert, assertInstanceOf, assertTypeOf, at, byteSizeOf, chunk, clearUndefined, concatBytes, decimalize, depthOf, endsWith, ensureBigInt, ensureDefaults, ensureUTxOBigInt, ergoTreeHeaderFlags, first, hasDuplicates, hasDuplicatesBy, hasKey, isDefined, isEmpty, isFalsy, isHex, isTruthy, isUndefined, last, max, min, orderBy, percent, some, startsWith, sumBy, undecimalize, uniq, uniqBy, utxoDiff, utxoFilter, utxoSum };
|
306
|
+
export { AddressType, Amount, AmountType, AssertErrorMessageInput, Base58String, Block, BlockHeader, BlockHeaderId, BlockTransactions, Box, BoxCandidate, BoxId, BoxSummary, BuildOutputType, Collection, CollectionAddOptions, ContextExtension, DataInput, EIP12UnsignedDataInput, EIP12UnsignedInput, EIP12UnsignedTransaction, ErgoTreeHeaderFlag, ErgoTreeHex, FilterPredicate, HexString, MinimalBoxAmounts, Network, NewToken, NonMandatoryRegisters, OneOrMore, PoWSolution, ProverResult, SignedInput, SignedTransaction, SortingDirection, SortingSelector, TokenAmount, TokenId, TokenTargetAmount, TransactionId, UTxOFilterParams, UnsignedInput, UnsignedTransaction, _0n, _10n, _127n, _128n, _1n, _63n, _7n, areEqual, areEqualBy, areRegistersDenselyPacked, assert, assertInstanceOf, assertTypeOf, at, byteSizeOf, chunk, clearUndefined, concatBytes, decimalize, depthOf, endsWith, ensureBigInt, ensureDefaults, ensureUTxOBigInt, ergoTreeHeaderFlags, first, hasDuplicates, hasDuplicatesBy, hasKey, isDefined, isEmpty, isFalsy, isHex, isTruthy, isUndefined, last, max, min, orderBy, percent, some, startsWith, sumBy, undecimalize, uniq, uniqBy, utxoDiff, utxoFilter, utxoSum };
|
@@ -548,4 +548,4 @@ var Collection = class {
|
|
548
548
|
|
549
549
|
export { AddressType, Collection, Network, _0n, _10n, _127n, _128n, _1n, _63n, _7n, areEqual, areEqualBy, areRegistersDenselyPacked, assert, assertInstanceOf, assertTypeOf, at, byteSizeOf, chunk, clearUndefined, concatBytes, decimalize, depthOf, endsWith, ensureBigInt, ensureDefaults, ensureUTxOBigInt, ergoTreeHeaderFlags, first, hasDuplicates, hasDuplicatesBy, hasKey, isDefined, isEmpty, isFalsy, isHex, isTruthy, isUndefined, last, max, min, orderBy, percent, some, startsWith, sumBy, undecimalize, uniq, uniqBy, utxoDiff, utxoFilter, utxoSum };
|
550
550
|
//# sourceMappingURL=out.js.map
|
551
|
-
//# sourceMappingURL=index.
|
551
|
+
//# sourceMappingURL=index.esm.js.map
|
package/package.json
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
{
|
2
2
|
"name": "@fleet-sdk/common",
|
3
|
-
"version": "0.2.
|
3
|
+
"version": "0.2.2",
|
4
4
|
"description": "Internal utility functions, constants and types shared across @fleet-sdk packages.",
|
5
|
-
"main": "./dist/index.js",
|
6
|
-
"module": "./dist/index.
|
5
|
+
"main": "./dist/index.cjs.js",
|
6
|
+
"module": "./dist/index.esm.js",
|
7
7
|
"types": "./dist/index.d.ts",
|
8
8
|
"exports": {
|
9
|
-
"require": "./dist/index.js",
|
10
|
-
"import": "./dist/index.
|
9
|
+
"require": "./dist/index.cjs.js",
|
10
|
+
"import": "./dist/index.esm.js"
|
11
11
|
},
|
12
12
|
"sideEffects": true,
|
13
13
|
"repository": "fleet-sdk/fleet",
|
@@ -34,6 +34,6 @@
|
|
34
34
|
"README.md"
|
35
35
|
],
|
36
36
|
"scripts": {
|
37
|
-
"build": "tsup"
|
37
|
+
"build": "tsup --config ../../tsup.config.ts"
|
38
38
|
}
|
39
39
|
}
|
@@ -0,0 +1,44 @@
|
|
1
|
+
import { HexString } from "./common";
|
2
|
+
import { SignedTransaction } from "./transactions";
|
3
|
+
|
4
|
+
export type PoWSolution = {
|
5
|
+
pk: HexString;
|
6
|
+
w: HexString;
|
7
|
+
n: string;
|
8
|
+
d: number;
|
9
|
+
};
|
10
|
+
|
11
|
+
export type BlockHeaderId = string;
|
12
|
+
|
13
|
+
export type BlockTransactions = {
|
14
|
+
headerId: BlockHeaderId;
|
15
|
+
transactions: SignedTransaction[];
|
16
|
+
};
|
17
|
+
|
18
|
+
export type BlockHeader = {
|
19
|
+
id: BlockHeaderId;
|
20
|
+
timestamp: number;
|
21
|
+
version: number;
|
22
|
+
adProofsRoot: HexString;
|
23
|
+
stateRoot: HexString;
|
24
|
+
transactionsRoot: HexString;
|
25
|
+
nBits: number;
|
26
|
+
extensionHash: HexString;
|
27
|
+
powSolutions: PoWSolution;
|
28
|
+
height: number;
|
29
|
+
difficulty: string;
|
30
|
+
parentId: BlockHeaderId;
|
31
|
+
votes: string;
|
32
|
+
size: number;
|
33
|
+
extensionId: HexString;
|
34
|
+
transactionsId: HexString;
|
35
|
+
adProofsId: HexString;
|
36
|
+
};
|
37
|
+
|
38
|
+
export type Block = {
|
39
|
+
header: BlockHeader;
|
40
|
+
blockTransactions: BlockTransactions;
|
41
|
+
adProofs: unknown; // TODO
|
42
|
+
extension: unknown; // TODO
|
43
|
+
size: number;
|
44
|
+
};
|
package/src/types/index.ts
CHANGED
File without changes
|
File without changes
|