@kynesyslabs/demosdk 2.12.1 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/abstraction/EvmCoinFinder.js +14 -2
- package/build/abstraction/EvmCoinFinder.js.map +1 -1
- package/build/abstraction/Identities.js +3 -1
- package/build/abstraction/Identities.js.map +1 -1
- package/build/bridge/nativeBridgeTypes.d.ts +4 -3
- package/build/bridge/nativeBridgeTypes.js.map +1 -1
- package/build/d402/client/types.d.ts +6 -3
- package/build/d402/server/D402Server.d.ts +25 -0
- package/build/d402/server/D402Server.js +63 -2
- package/build/d402/server/D402Server.js.map +1 -1
- package/build/d402/server/middleware.d.ts +7 -4
- package/build/d402/server/middleware.js.map +1 -1
- package/build/d402/server/types.d.ts +15 -7
- package/build/denomination/conversion.test.js +1 -1
- package/build/denomination/conversion.test.js.map +1 -1
- package/build/denomination/index.d.ts +3 -0
- package/build/denomination/index.js +6 -0
- package/build/denomination/index.js.map +1 -1
- package/build/denomination/networkInfo.d.ts +69 -0
- package/build/denomination/networkInfo.js +38 -0
- package/build/denomination/networkInfo.js.map +1 -0
- package/build/denomination/networkInfo.test.d.ts +1 -0
- package/build/denomination/networkInfo.test.js +28 -0
- package/build/denomination/networkInfo.test.js.map +1 -0
- package/build/denomination/roundTripHash.test.d.ts +1 -0
- package/build/denomination/roundTripHash.test.js +227 -0
- package/build/denomination/roundTripHash.test.js.map +1 -0
- package/build/denomination/serializerGate.d.ts +46 -0
- package/build/denomination/serializerGate.js +283 -0
- package/build/denomination/serializerGate.js.map +1 -0
- package/build/denomination/serializerGate.test.d.ts +1 -0
- package/build/denomination/serializerGate.test.js +245 -0
- package/build/denomination/serializerGate.test.js.map +1 -0
- package/build/encryption/zK/interactive/index.js +5 -1
- package/build/encryption/zK/interactive/index.js.map +1 -1
- package/build/escrow/EscrowTransaction.d.ts +36 -5
- package/build/escrow/EscrowTransaction.js +91 -10
- package/build/escrow/EscrowTransaction.js.map +1 -1
- package/build/instant_messaging/L2PSMessagingPeer.js +4 -1
- package/build/instant_messaging/L2PSMessagingPeer.js.map +1 -1
- package/build/ipfs/IPFSOperations.d.ts +37 -10
- package/build/ipfs/IPFSOperations.js +38 -8
- package/build/ipfs/IPFSOperations.js.map +1 -1
- package/build/storage/StorageProgram.d.ts +16 -8
- package/build/storage/StorageProgram.js +16 -8
- package/build/storage/StorageProgram.js.map +1 -1
- package/build/tlsnotary/TLSNotaryService.d.ts +19 -8
- package/build/tlsnotary/TLSNotaryService.js +22 -7
- package/build/tlsnotary/TLSNotaryService.js.map +1 -1
- package/build/tlsnotary/helpers.d.ts +11 -5
- package/build/tlsnotary/helpers.js +17 -5
- package/build/tlsnotary/helpers.js.map +1 -1
- package/build/types/blockchain/CustomCharges.d.ts +28 -16
- package/build/types/blockchain/CustomCharges.js +15 -5
- package/build/types/blockchain/CustomCharges.js.map +1 -1
- package/build/types/blockchain/GCREdit.d.ts +80 -3
- package/build/types/blockchain/NetworkParameters.d.ts +54 -0
- package/build/types/blockchain/NetworkParameters.js +9 -0
- package/build/types/blockchain/NetworkParameters.js.map +1 -0
- package/build/types/blockchain/Transaction.d.ts +21 -3
- package/build/types/blockchain/Transaction.js.map +1 -1
- package/build/types/blockchain/TransactionSubtypes/D402PaymentTransaction.d.ts +8 -3
- package/build/types/blockchain/TransactionSubtypes/NetworkUpgradeTransaction.d.ts +20 -0
- package/build/types/blockchain/TransactionSubtypes/NetworkUpgradeTransaction.js +2 -0
- package/build/types/blockchain/TransactionSubtypes/NetworkUpgradeTransaction.js.map +1 -0
- package/build/types/blockchain/TransactionSubtypes/NetworkUpgradeVoteTransaction.d.ts +13 -0
- package/build/types/blockchain/TransactionSubtypes/NetworkUpgradeVoteTransaction.js +2 -0
- package/build/types/blockchain/TransactionSubtypes/NetworkUpgradeVoteTransaction.js.map +1 -0
- package/build/types/blockchain/TransactionSubtypes/StorageProgramTransaction.d.ts +6 -5
- package/build/types/blockchain/TransactionSubtypes/StorageProgramTransaction.js +15 -3
- package/build/types/blockchain/TransactionSubtypes/StorageProgramTransaction.js.map +1 -1
- package/build/types/blockchain/TransactionSubtypes/ValidatorExitTransaction.d.ts +10 -0
- package/build/types/blockchain/TransactionSubtypes/ValidatorExitTransaction.js +2 -0
- package/build/types/blockchain/TransactionSubtypes/ValidatorExitTransaction.js.map +1 -0
- package/build/types/blockchain/TransactionSubtypes/ValidatorStakeTransaction.d.ts +15 -0
- package/build/types/blockchain/TransactionSubtypes/ValidatorStakeTransaction.js +2 -0
- package/build/types/blockchain/TransactionSubtypes/ValidatorStakeTransaction.js.map +1 -0
- package/build/types/blockchain/TransactionSubtypes/ValidatorUnstakeTransaction.d.ts +10 -0
- package/build/types/blockchain/TransactionSubtypes/ValidatorUnstakeTransaction.js +2 -0
- package/build/types/blockchain/TransactionSubtypes/ValidatorUnstakeTransaction.js.map +1 -0
- package/build/types/blockchain/TransactionSubtypes/index.d.ts +11 -1
- package/build/types/blockchain/TransactionSubtypes/index.js +7 -0
- package/build/types/blockchain/TransactionSubtypes/index.js.map +1 -1
- package/build/types/blockchain/TxFee.d.ts +16 -3
- package/build/types/blockchain/address.d.ts +23 -0
- package/build/types/blockchain/rawTransaction.d.ts +13 -4
- package/build/types/blockchain/statusNative.d.ts +9 -1
- package/build/types/bridge/bridgeTradePayload.d.ts +1 -1
- package/build/types/gls/StateChange.d.ts +29 -3
- package/build/types/index.d.ts +4 -2
- package/build/types/index.js.map +1 -1
- package/build/types/native/INativePayload.d.ts +6 -1
- package/build/types/validator/ValidatorTypes.d.ts +13 -0
- package/build/types/validator/ValidatorTypes.js +3 -0
- package/build/types/validator/ValidatorTypes.js.map +1 -0
- package/build/wallet/Wallet.d.ts +27 -1
- package/build/wallet/Wallet.js +30 -17
- package/build/wallet/Wallet.js.map +1 -1
- package/build/websdk/DemosTransactions.d.ts +78 -4
- package/build/websdk/DemosTransactions.js +253 -9
- package/build/websdk/DemosTransactions.js.map +1 -1
- package/build/websdk/GCRGeneration.d.ts +11 -2
- package/build/websdk/GCRGeneration.js +143 -14
- package/build/websdk/GCRGeneration.js.map +1 -1
- package/build/websdk/demosclass.d.ts +238 -26
- package/build/websdk/demosclass.js +434 -54
- package/build/websdk/demosclass.js.map +1 -1
- package/package.json +1 -1
|
@@ -5,33 +5,40 @@
|
|
|
5
5
|
* before execution. Used in the confirm/execute two-step transaction flow
|
|
6
6
|
* to provide cost transparency.
|
|
7
7
|
*
|
|
8
|
-
* @fileoverview Custom charges type definitions for cost estimation
|
|
8
|
+
* @fileoverview Custom charges type definitions for cost estimation.
|
|
9
|
+
*
|
|
10
|
+
* P4 denomination migration:
|
|
11
|
+
* All cost fields are bigint-as-decimal-`string` in **OS** (smallest
|
|
12
|
+
* unit, 1 DEM = 10^9 OS). Field names changed from `*_dem` to `*_os` to
|
|
13
|
+
* reflect the new denomination. Pre-fork-compatible bridges should
|
|
14
|
+
* serialise these via the SDK's `serializerGate`, which converts to
|
|
15
|
+
* the legacy DEM-`number` shape for pre-fork nodes.
|
|
9
16
|
*/
|
|
10
17
|
/**
|
|
11
18
|
* Cost breakdown for IPFS operations
|
|
12
19
|
*
|
|
13
20
|
* Provides detailed cost calculation components so users can understand
|
|
14
|
-
* what they're paying for.
|
|
21
|
+
* what they're paying for. All values are decimal-string OS amounts.
|
|
15
22
|
*/
|
|
16
23
|
export interface IPFSCostBreakdown {
|
|
17
|
-
/** Base cost for the operation
|
|
24
|
+
/** Base cost for the operation, decimal-string OS. */
|
|
18
25
|
base_cost: string;
|
|
19
|
-
/** Cost based on file size
|
|
26
|
+
/** Cost based on file size, decimal-string OS. */
|
|
20
27
|
size_cost: string;
|
|
21
|
-
/** Cost based on storage duration
|
|
28
|
+
/** Cost based on storage duration, decimal-string OS (optional for indefinite pins). */
|
|
22
29
|
duration_cost?: string;
|
|
23
|
-
/** Any additional costs (network fees, etc.) */
|
|
30
|
+
/** Any additional costs (network fees, etc.) — decimal-string OS values. */
|
|
24
31
|
additional_costs?: Record<string, string>;
|
|
25
32
|
}
|
|
26
33
|
/**
|
|
27
34
|
* IPFS custom charges configuration
|
|
28
35
|
*
|
|
29
36
|
* Included in transaction content to specify maximum cost user agrees to pay.
|
|
30
|
-
* Node will validate that actual cost does not exceed
|
|
37
|
+
* Node will validate that actual cost does not exceed `max_cost_os`.
|
|
31
38
|
*/
|
|
32
39
|
export interface IPFSCustomCharges {
|
|
33
|
-
/** Maximum cost user is willing to pay
|
|
34
|
-
|
|
40
|
+
/** Maximum cost user is willing to pay, decimal-string OS (BigInt-safe). */
|
|
41
|
+
max_cost_os: string;
|
|
35
42
|
/** File size in bytes - used for cost calculation validation */
|
|
36
43
|
file_size_bytes: number;
|
|
37
44
|
/** IPFS operation type */
|
|
@@ -54,7 +61,7 @@ export interface IPFSCustomCharges {
|
|
|
54
61
|
* // ... other fields
|
|
55
62
|
* custom_charges: {
|
|
56
63
|
* ipfs: {
|
|
57
|
-
*
|
|
64
|
+
* max_cost_os: "1000000000", // 1 DEM in OS
|
|
58
65
|
* file_size_bytes: 1024,
|
|
59
66
|
* operation: "IPFS_ADD"
|
|
60
67
|
* }
|
|
@@ -70,14 +77,16 @@ export interface CustomCharges {
|
|
|
70
77
|
*
|
|
71
78
|
* Returned by confirmTx to show actual costs vs maximum user agreed to pay.
|
|
72
79
|
* Allows user to review and abort if actual cost is higher than expected.
|
|
80
|
+
*
|
|
81
|
+
* All cost fields are decimal-string OS.
|
|
73
82
|
*/
|
|
74
83
|
export interface ValidityDataCustomCharges {
|
|
75
84
|
/** Charge type identifier */
|
|
76
85
|
type: "ipfs_storage" | "ipfs_bandwidth" | "compute" | string;
|
|
77
|
-
/** What user signed as maximum (from TX custom_charges) */
|
|
78
|
-
|
|
79
|
-
/** What node will actually charge (must be
|
|
80
|
-
|
|
86
|
+
/** What user signed as maximum (from TX `custom_charges`), decimal-string OS. */
|
|
87
|
+
max_cost_os: string;
|
|
88
|
+
/** What node will actually charge (must be `<= max_cost_os`), decimal-string OS. */
|
|
89
|
+
actual_cost_os: string;
|
|
81
90
|
/** Detailed breakdown of actual costs */
|
|
82
91
|
breakdown: IPFSCostBreakdown;
|
|
83
92
|
}
|
|
@@ -88,6 +97,9 @@ export declare function hasIPFSCustomCharges(charges: CustomCharges | undefined)
|
|
|
88
97
|
ipfs: IPFSCustomCharges;
|
|
89
98
|
};
|
|
90
99
|
/**
|
|
91
|
-
* Validate that actual cost does not exceed maximum
|
|
100
|
+
* Validate that actual cost does not exceed maximum.
|
|
101
|
+
*
|
|
102
|
+
* Inputs are decimal-string OS amounts; both must parse cleanly as
|
|
103
|
+
* non-negative bigints.
|
|
92
104
|
*/
|
|
93
|
-
export declare function isValidCharge(
|
|
105
|
+
export declare function isValidCharge(maxCostOs: string, actualCostOs: string): boolean;
|
|
@@ -5,7 +5,14 @@
|
|
|
5
5
|
* before execution. Used in the confirm/execute two-step transaction flow
|
|
6
6
|
* to provide cost transparency.
|
|
7
7
|
*
|
|
8
|
-
* @fileoverview Custom charges type definitions for cost estimation
|
|
8
|
+
* @fileoverview Custom charges type definitions for cost estimation.
|
|
9
|
+
*
|
|
10
|
+
* P4 denomination migration:
|
|
11
|
+
* All cost fields are bigint-as-decimal-`string` in **OS** (smallest
|
|
12
|
+
* unit, 1 DEM = 10^9 OS). Field names changed from `*_dem` to `*_os` to
|
|
13
|
+
* reflect the new denomination. Pre-fork-compatible bridges should
|
|
14
|
+
* serialise these via the SDK's `serializerGate`, which converts to
|
|
15
|
+
* the legacy DEM-`number` shape for pre-fork nodes.
|
|
9
16
|
*/
|
|
10
17
|
// ============================================================================
|
|
11
18
|
// Type Guards
|
|
@@ -17,12 +24,15 @@ export function hasIPFSCustomCharges(charges) {
|
|
|
17
24
|
return charges?.ipfs !== undefined;
|
|
18
25
|
}
|
|
19
26
|
/**
|
|
20
|
-
* Validate that actual cost does not exceed maximum
|
|
27
|
+
* Validate that actual cost does not exceed maximum.
|
|
28
|
+
*
|
|
29
|
+
* Inputs are decimal-string OS amounts; both must parse cleanly as
|
|
30
|
+
* non-negative bigints.
|
|
21
31
|
*/
|
|
22
|
-
export function isValidCharge(
|
|
32
|
+
export function isValidCharge(maxCostOs, actualCostOs) {
|
|
23
33
|
try {
|
|
24
|
-
const max = BigInt(
|
|
25
|
-
const actual = BigInt(
|
|
34
|
+
const max = BigInt(maxCostOs);
|
|
35
|
+
const actual = BigInt(actualCostOs);
|
|
26
36
|
return actual <= max;
|
|
27
37
|
}
|
|
28
38
|
catch {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CustomCharges.js","sourceRoot":"","sources":["../../../../src/types/blockchain/CustomCharges.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"CustomCharges.js","sourceRoot":"","sources":["../../../../src/types/blockchain/CustomCharges.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AA6GH,+EAA+E;AAC/E,cAAc;AACd,+EAA+E;AAE/E;;GAEG;AACH,MAAM,UAAU,oBAAoB,CAChC,OAAkC;IAElC,OAAO,OAAO,EAAE,IAAI,KAAK,SAAS,CAAA;AACtC,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,aAAa,CACzB,SAAiB,EACjB,YAAoB;IAEpB,IAAI,CAAC;QACD,MAAM,GAAG,GAAG,MAAM,CAAC,SAAS,CAAC,CAAA;QAC7B,MAAM,MAAM,GAAG,MAAM,CAAC,YAAY,CAAC,CAAA;QACnC,OAAO,MAAM,IAAI,GAAG,CAAA;IACxB,CAAC;IAAC,MAAM,CAAC;QACL,OAAO,KAAK,CAAA;IAChB,CAAC;AACL,CAAC"}
|
|
@@ -1,13 +1,32 @@
|
|
|
1
1
|
import { IdentityAttestationPayload, IdentityCommitmentPayload, PqcIdentityRemovePayload, UDIdentityPayload, XMCoreTargetIdentityPayload, NomisWalletIdentity, HumanPassportIdentityData, EthosWalletIdentity, TLSNIdentityContext, TLSNProofRanges } from "../abstraction";
|
|
2
2
|
import { SigningAlgorithm } from "../cryptography";
|
|
3
|
+
/**
|
|
4
|
+
* Balance-mutation GCR edit — adds to or subtracts from a sender/receiver
|
|
5
|
+
* balance, or burns a fee.
|
|
6
|
+
*
|
|
7
|
+
* Wire-format compatibility (P4): `amount` may be either a JS `number`
|
|
8
|
+
* (pre-fork node, DEM) or a decimal `string` in OS (post-fork node). The
|
|
9
|
+
* SDK's `GCRGeneration` populates the field with whichever shape matches
|
|
10
|
+
* the connected node's fork status.
|
|
11
|
+
*
|
|
12
|
+
* Important: the node's post-fork serializer (`forks/serializerGate.ts`)
|
|
13
|
+
* does **not** re-encode `gcr_edits[].amount`. Whatever the SDK puts here
|
|
14
|
+
* **is** the wire format and contributes directly to the transaction
|
|
15
|
+
* hash. Construction-site correctness is the contract.
|
|
16
|
+
*/
|
|
3
17
|
export interface GCREditBalance {
|
|
4
18
|
type: "balance";
|
|
5
19
|
isRollback: boolean;
|
|
6
20
|
operation: "add" | "remove";
|
|
7
21
|
account: string;
|
|
8
|
-
amount: number;
|
|
22
|
+
amount: number | string;
|
|
9
23
|
txhash: string;
|
|
10
24
|
}
|
|
25
|
+
/**
|
|
26
|
+
* Nonce-increment GCR edit. `amount` is a counter delta, not a token
|
|
27
|
+
* amount — always `1` in current code. Kept as `number` because the fork
|
|
28
|
+
* does not change its encoding. Do **not** confuse with `GCREditBalance.amount`.
|
|
29
|
+
*/
|
|
11
30
|
export interface GCREditNonce {
|
|
12
31
|
type: "nonce";
|
|
13
32
|
isRollback: boolean;
|
|
@@ -137,7 +156,12 @@ export interface GCREditEscrow {
|
|
|
137
156
|
sender?: string;
|
|
138
157
|
platform?: "twitter" | "github" | "telegram";
|
|
139
158
|
username?: string;
|
|
140
|
-
|
|
159
|
+
/**
|
|
160
|
+
* Escrow deposit amount. Wire format follows the same pre-fork /
|
|
161
|
+
* post-fork rule as `GCREditBalance.amount`: `number` DEM
|
|
162
|
+
* pre-fork, decimal `string` OS post-fork.
|
|
163
|
+
*/
|
|
164
|
+
amount?: number | string;
|
|
141
165
|
expiryDays?: number;
|
|
142
166
|
message?: string;
|
|
143
167
|
claimant?: string;
|
|
@@ -166,4 +190,57 @@ export interface GCREditTLSNotary {
|
|
|
166
190
|
txhash: string;
|
|
167
191
|
isRollback: boolean;
|
|
168
192
|
}
|
|
169
|
-
|
|
193
|
+
/**
|
|
194
|
+
* Validator-staking GCR edit. Emitted by validatorStake / validatorUnstake /
|
|
195
|
+
* validatorExit transactions. Applied against the Validators table.
|
|
196
|
+
*/
|
|
197
|
+
export interface GCREditValidatorStake {
|
|
198
|
+
type: "validatorStake";
|
|
199
|
+
isRollback: boolean;
|
|
200
|
+
account: string;
|
|
201
|
+
operation: "stake" | "unstake" | "exit";
|
|
202
|
+
amount: string;
|
|
203
|
+
connectionUrl?: string;
|
|
204
|
+
txhash: string;
|
|
205
|
+
}
|
|
206
|
+
/**
|
|
207
|
+
* Stackable-genesis governance GCR edit — proposal lifecycle.
|
|
208
|
+
* Emitted by `networkUpgrade` transactions. Applied to the
|
|
209
|
+
* `network_upgrades` table at block-confirmation time on every node.
|
|
210
|
+
*
|
|
211
|
+
* Carries only client-derivable fields. Server-derived fields
|
|
212
|
+
* (`version`, `snapshotBlock`, `tallyBlock`) are filled at apply time
|
|
213
|
+
* by `GCRNetworkUpgradeRoutines.applyProposal` so the edit hash is
|
|
214
|
+
* deterministic from tx content alone (matches between SDK
|
|
215
|
+
* `GCRGeneration.generate()` and node-side `handleValidateTransaction`
|
|
216
|
+
* comparison).
|
|
217
|
+
*/
|
|
218
|
+
export interface GCREditNetworkUpgrade {
|
|
219
|
+
type: "networkUpgrade";
|
|
220
|
+
isRollback: boolean;
|
|
221
|
+
account: string;
|
|
222
|
+
proposalId: string;
|
|
223
|
+
proposedParameters: Record<string, unknown>;
|
|
224
|
+
rationale: string;
|
|
225
|
+
effectiveAtBlock: number;
|
|
226
|
+
txhash: string;
|
|
227
|
+
}
|
|
228
|
+
/**
|
|
229
|
+
* Stackable-genesis governance GCR edit — vote.
|
|
230
|
+
* Emitted by `networkUpgradeVote` transactions. Applied to the
|
|
231
|
+
* `network_upgrade_votes` table at block-confirmation time on every node.
|
|
232
|
+
*
|
|
233
|
+
* `weight` and `blockNumber` are server-derived at apply time —
|
|
234
|
+
* voter's snapshotted staked amount + the block number being confirmed.
|
|
235
|
+
* Keeping them out of the signed edit means the edit hash is
|
|
236
|
+
* deterministic from tx content alone and matches across SDK + server.
|
|
237
|
+
*/
|
|
238
|
+
export interface GCREditNetworkUpgradeVote {
|
|
239
|
+
type: "networkUpgradeVote";
|
|
240
|
+
isRollback: boolean;
|
|
241
|
+
account: string;
|
|
242
|
+
proposalId: string;
|
|
243
|
+
approve: boolean;
|
|
244
|
+
txhash: string;
|
|
245
|
+
}
|
|
246
|
+
export type GCREdit = GCREditBalance | GCREditNonce | GCREditAssign | GCREditAssignIdentity | GCREditSubnetsTx | GCREditIdentity | GCREditSmartContract | GCREditStorageProgram | GCREditEscrow | GCREditTLSNotary | GCREditValidatorStake | GCREditNetworkUpgrade | GCREditNetworkUpgradeVote;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/** Tunable network parameters — the actual config values at runtime. */
|
|
2
|
+
export interface NetworkParameters {
|
|
3
|
+
/** Target block time in ms. (Phase 2 — consensus-affecting) */
|
|
4
|
+
blockTimeMs: number;
|
|
5
|
+
/** Default shard size for consensus. (Phase 2 — consensus-affecting) */
|
|
6
|
+
shardSize: number;
|
|
7
|
+
/** Minimum DEMOS to become a validator. bigint-as-string. */
|
|
8
|
+
minValidatorStake: string;
|
|
9
|
+
/** Default network fee, basis points [0, 5000]. */
|
|
10
|
+
networkFee: number;
|
|
11
|
+
/** Default RPC fee, basis points [0, 5000]. */
|
|
12
|
+
rpcFee: number;
|
|
13
|
+
/** Feature flags — string key → boolean. */
|
|
14
|
+
featureFlags: Record<string, boolean>;
|
|
15
|
+
}
|
|
16
|
+
export type NetworkParameterKey = keyof NetworkParameters;
|
|
17
|
+
export type ProposalStatus = "pending" | "approved" | "activating" | "active" | "rejected";
|
|
18
|
+
/** A proposal to change a subset of NetworkParameters. */
|
|
19
|
+
export interface NetworkUpgradeProposal {
|
|
20
|
+
/** Monotonic, human-readable label. Assigned at proposal time as max(existing) + 1. */
|
|
21
|
+
version: number;
|
|
22
|
+
/** UUID. Dedup key AND lexicographic activation-order tiebreaker. */
|
|
23
|
+
proposalId: string;
|
|
24
|
+
/** Proposer's public key (hex). Must be an active validator at snapshotBlock. */
|
|
25
|
+
proposerPublicKey: string;
|
|
26
|
+
/** Only the keys the proposer wants to change. */
|
|
27
|
+
proposedParameters: Partial<NetworkParameters>;
|
|
28
|
+
/** Activation block. Must be >= tallyBlock + gracePeriodBlocks. */
|
|
29
|
+
effectiveAtBlock: number;
|
|
30
|
+
/** Human-readable reason. <= 1024 bytes. */
|
|
31
|
+
rationale: string;
|
|
32
|
+
status: ProposalStatus;
|
|
33
|
+
/** Block at which the proposal tx was confirmed. Freezes validator set + stakes. */
|
|
34
|
+
snapshotBlock: number;
|
|
35
|
+
}
|
|
36
|
+
/** Per-proposal vote-tally summary. */
|
|
37
|
+
export interface ProposalVoteInfo {
|
|
38
|
+
proposalId: string;
|
|
39
|
+
/** Total staked weight of ALL snapshot validators (bigint-as-string). */
|
|
40
|
+
totalStakedWeight: string;
|
|
41
|
+
/** Staked weight of voters who approved (bigint-as-string). */
|
|
42
|
+
approveWeight: string;
|
|
43
|
+
/** Staked weight of voters who rejected (bigint-as-string). */
|
|
44
|
+
rejectWeight: string;
|
|
45
|
+
votes: Array<{
|
|
46
|
+
voter: string;
|
|
47
|
+
approve: boolean;
|
|
48
|
+
weight: string;
|
|
49
|
+
}>;
|
|
50
|
+
/** 2/3 of totalStakedWeight (bigint-as-string). */
|
|
51
|
+
threshold: string;
|
|
52
|
+
/** True iff approveWeight >= threshold. */
|
|
53
|
+
passed: boolean;
|
|
54
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// Stackable-genesis governance types. Canonical spec:
|
|
2
|
+
// planning/adversarial_review/stackable_genesis_system_v2.md in the node repo.
|
|
3
|
+
//
|
|
4
|
+
// These types are the payload shape for governance transactions + the return
|
|
5
|
+
// shape of governance-query RPCs. They intentionally do not include
|
|
6
|
+
// implementation-level DB columns; the node entities may carry additional
|
|
7
|
+
// fields (createdAt, tally_block, etc.).
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=NetworkParameters.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NetworkParameters.js","sourceRoot":"","sources":["../../../../src/types/blockchain/NetworkParameters.ts"],"names":[],"mappings":"AAAA,sDAAsD;AACtD,+EAA+E;AAC/E,EAAE;AACF,6EAA6E;AAC7E,oEAAoE;AACpE,0EAA0E;AAC1E,yCAAyC"}
|
|
@@ -18,14 +18,32 @@ import { D402PaymentPayload } from "./TransactionSubtypes/D402PaymentTransaction
|
|
|
18
18
|
import { EscrowPayload } from "./TransactionSubtypes/EscrowTransaction";
|
|
19
19
|
import { IPFSPayload } from "./TransactionSubtypes/IPFSTransaction";
|
|
20
20
|
import { TokenCreationPayload, TokenExecutionPayload } from "./TransactionSubtypes/TokenTransaction";
|
|
21
|
+
import { ValidatorStakePayload } from "./TransactionSubtypes/ValidatorStakeTransaction";
|
|
22
|
+
import { ValidatorUnstakePayload } from "./TransactionSubtypes/ValidatorUnstakeTransaction";
|
|
23
|
+
import { ValidatorExitPayload } from "./TransactionSubtypes/ValidatorExitTransaction";
|
|
24
|
+
import { NetworkUpgradePayload } from "./TransactionSubtypes/NetworkUpgradeTransaction";
|
|
25
|
+
import { NetworkUpgradeVotePayload } from "./TransactionSubtypes/NetworkUpgradeVoteTransaction";
|
|
21
26
|
import { CustomCharges } from "./CustomCharges";
|
|
22
|
-
export type TransactionContentData = ["web2Request", IWeb2Payload] | ["crosschainOperation", XMScript] | ["native", INativePayload] | ["demoswork", DemoScript] | ["l2psEncryptedTx", L2PSEncryptedPayload] | ["identity", IdentityPayload] | ["instantMessaging", InstantMessagingPayload] | ["l2psInstantMessaging", L2PSInstantMessagingPayload] | ["nativeBridge", NativeBridgeTxPayload] | ["storage", StoragePayload] | ["storageProgram", StorageProgramPayload] | ["l2ps_hash_update", L2PSHashPayload] | ["contractDeploy", ContractDeployPayload] | ["contractCall", ContractCallPayload] | ["d402_payment", D402PaymentPayload] | ["escrow", EscrowPayload] | ["ipfs", IPFSPayload] | ["tokenCreation", TokenCreationPayload] | ["tokenExecution", TokenExecutionPayload];
|
|
27
|
+
export type TransactionContentData = ["web2Request", IWeb2Payload] | ["crosschainOperation", XMScript] | ["native", INativePayload] | ["demoswork", DemoScript] | ["l2psEncryptedTx", L2PSEncryptedPayload] | ["identity", IdentityPayload] | ["instantMessaging", InstantMessagingPayload] | ["l2psInstantMessaging", L2PSInstantMessagingPayload] | ["nativeBridge", NativeBridgeTxPayload] | ["storage", StoragePayload] | ["storageProgram", StorageProgramPayload] | ["l2ps_hash_update", L2PSHashPayload] | ["contractDeploy", ContractDeployPayload] | ["contractCall", ContractCallPayload] | ["d402_payment", D402PaymentPayload] | ["escrow", EscrowPayload] | ["ipfs", IPFSPayload] | ["tokenCreation", TokenCreationPayload] | ["tokenExecution", TokenExecutionPayload] | ["validatorStake", ValidatorStakePayload] | ["validatorUnstake", ValidatorUnstakePayload] | ["validatorExit", ValidatorExitPayload] | ["networkUpgrade", NetworkUpgradePayload] | ["networkUpgradeVote", NetworkUpgradeVotePayload];
|
|
23
28
|
export interface TransactionContent {
|
|
24
|
-
type: "web2Request" | "crosschainOperation" | "subnet" | "native" | "demoswork" | "genesis" | "NODE_ONLINE" | "identity" | "instantMessaging" | "l2psInstantMessaging" | "nativeBridge" | "l2psEncryptedTx" | "storage" | "storageProgram" | "l2ps_hash_update" | "contractDeploy" | "contractCall" | "d402_payment" | "escrow" | "ipfs" | "tokenCreation" | "tokenExecution";
|
|
29
|
+
type: "web2Request" | "crosschainOperation" | "subnet" | "native" | "demoswork" | "genesis" | "NODE_ONLINE" | "identity" | "instantMessaging" | "l2psInstantMessaging" | "nativeBridge" | "l2psEncryptedTx" | "storage" | "storageProgram" | "l2ps_hash_update" | "contractDeploy" | "contractCall" | "d402_payment" | "escrow" | "ipfs" | "tokenCreation" | "tokenExecution" | "validatorStake" | "validatorUnstake" | "validatorExit" | "networkUpgrade" | "networkUpgradeVote";
|
|
25
30
|
from: string;
|
|
26
31
|
from_ed25519_address: string;
|
|
27
32
|
to: string;
|
|
28
|
-
|
|
33
|
+
/**
|
|
34
|
+
* Native DEM amount transferred by this transaction.
|
|
35
|
+
*
|
|
36
|
+
* Wire-format compatibility:
|
|
37
|
+
* - Pre-fork node: encoded as JS `number` in DEM.
|
|
38
|
+
* - Post-fork node: encoded as a decimal `string` in OS (1 DEM = 10^9 OS).
|
|
39
|
+
*
|
|
40
|
+
* Both shapes are accepted on input; the SDK's `serializerGate`
|
|
41
|
+
* (P4 commit 2) normalises to the right wire shape per fork status
|
|
42
|
+
* before signing. SDK-internal arithmetic always uses `bigint` OS via
|
|
43
|
+
* `denomination` utilities — never raw `number`, which loses precision
|
|
44
|
+
* above 2^53 OS (~9 million DEM).
|
|
45
|
+
*/
|
|
46
|
+
amount: number | string;
|
|
29
47
|
data: TransactionContentData;
|
|
30
48
|
gcr_edits: GCREdit[];
|
|
31
49
|
nonce: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Transaction.js","sourceRoot":"","sources":["../../../../src/types/blockchain/Transaction.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Transaction.js","sourceRoot":"","sources":["../../../../src/types/blockchain/Transaction.ts"],"names":[],"mappings":"AAwIA,uCAAuC;AACvC,cAAc,uBAAuB,CAAA"}
|
|
@@ -1,13 +1,18 @@
|
|
|
1
1
|
import { Transaction, TransactionContent } from "../Transaction";
|
|
2
2
|
/**
|
|
3
3
|
* D402 Payment Payload
|
|
4
|
-
* Represents a gasless payment transaction in the D402 protocol
|
|
4
|
+
* Represents a gasless payment transaction in the D402 protocol.
|
|
5
|
+
*
|
|
6
|
+
* Wire-format compatibility (P4): `amount` may be either a JS `number`
|
|
7
|
+
* (pre-fork DEM, legacy) or a decimal `string` in OS (post-fork). The
|
|
8
|
+
* SDK's serializerGate normalises at the wire boundary based on the
|
|
9
|
+
* connected node's fork status.
|
|
5
10
|
*/
|
|
6
11
|
export interface D402PaymentPayload {
|
|
7
12
|
/** Recipient's Demos address */
|
|
8
13
|
to: string;
|
|
9
|
-
/** Payment amount
|
|
10
|
-
amount: number;
|
|
14
|
+
/** Payment amount: pre-fork `number` (DEM) or post-fork `string` (OS). */
|
|
15
|
+
amount: number | string;
|
|
11
16
|
/** Optional memo/description for the payment */
|
|
12
17
|
memo?: string;
|
|
13
18
|
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Transaction, TransactionContent } from "../Transaction";
|
|
2
|
+
import type { NetworkParameters } from "../NetworkParameters";
|
|
3
|
+
/** Payload for a `networkUpgrade` proposal tx. */
|
|
4
|
+
export interface NetworkUpgradePayload {
|
|
5
|
+
/** UUID chosen by the proposer — used as dedup key and activation-order tiebreaker. */
|
|
6
|
+
proposalId: string;
|
|
7
|
+
/** Only the keys the proposer wants to change. */
|
|
8
|
+
proposedParameters: Partial<NetworkParameters>;
|
|
9
|
+
/** Human-readable reason. <= 1024 bytes. */
|
|
10
|
+
rationale: string;
|
|
11
|
+
/** Block at which approved upgrades activate. Must respect the grace period. */
|
|
12
|
+
effectiveAtBlock: number;
|
|
13
|
+
}
|
|
14
|
+
export type NetworkUpgradeTransactionContent = Omit<TransactionContent, 'type' | 'data'> & {
|
|
15
|
+
type: 'networkUpgrade';
|
|
16
|
+
data: ['networkUpgrade', NetworkUpgradePayload];
|
|
17
|
+
};
|
|
18
|
+
export interface NetworkUpgradeTransaction extends Omit<Transaction, 'content'> {
|
|
19
|
+
content: NetworkUpgradeTransactionContent;
|
|
20
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NetworkUpgradeTransaction.js","sourceRoot":"","sources":["../../../../../src/types/blockchain/TransactionSubtypes/NetworkUpgradeTransaction.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Transaction, TransactionContent } from "../Transaction";
|
|
2
|
+
/** Payload for a `networkUpgradeVote` tx. One vote per validator per proposal; final. */
|
|
3
|
+
export interface NetworkUpgradeVotePayload {
|
|
4
|
+
proposalId: string;
|
|
5
|
+
approve: boolean;
|
|
6
|
+
}
|
|
7
|
+
export type NetworkUpgradeVoteTransactionContent = Omit<TransactionContent, 'type' | 'data'> & {
|
|
8
|
+
type: 'networkUpgradeVote';
|
|
9
|
+
data: ['networkUpgradeVote', NetworkUpgradeVotePayload];
|
|
10
|
+
};
|
|
11
|
+
export interface NetworkUpgradeVoteTransaction extends Omit<Transaction, 'content'> {
|
|
12
|
+
content: NetworkUpgradeVoteTransactionContent;
|
|
13
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NetworkUpgradeVoteTransaction.js","sourceRoot":"","sources":["../../../../../src/types/blockchain/TransactionSubtypes/NetworkUpgradeVoteTransaction.ts"],"names":[],"mappings":""}
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import { Transaction, TransactionContent } from "../Transaction";
|
|
2
|
-
/**
|
|
3
|
-
* Storage Program constants for validation and pricing
|
|
4
|
-
*/
|
|
5
2
|
export declare const STORAGE_PROGRAM_CONSTANTS: {
|
|
6
3
|
/** Maximum storage size in bytes (1MB) */
|
|
7
4
|
readonly MAX_SIZE_BYTES: 1048576;
|
|
8
5
|
/** Size chunk for pricing in bytes (10KB) */
|
|
9
6
|
readonly PRICING_CHUNK_BYTES: 10240;
|
|
10
|
-
/**
|
|
11
|
-
|
|
7
|
+
/**
|
|
8
|
+
* Fee per chunk, expressed in OS (= 1 DEM = 10^9 OS).
|
|
9
|
+
* Use bigint arithmetic at every call site; the SDK never widens
|
|
10
|
+
* back to JS `number`, which loses precision above 2^53.
|
|
11
|
+
*/
|
|
12
|
+
readonly FEE_PER_CHUNK: bigint;
|
|
12
13
|
/** Maximum nesting depth for JSON encoding */
|
|
13
14
|
readonly MAX_JSON_NESTING_DEPTH: 64;
|
|
14
15
|
};
|
|
@@ -3,15 +3,27 @@
|
|
|
3
3
|
// Constants
|
|
4
4
|
// ============================================================================
|
|
5
5
|
/**
|
|
6
|
-
* Storage Program constants for validation and pricing
|
|
6
|
+
* Storage Program constants for validation and pricing.
|
|
7
|
+
*
|
|
8
|
+
* P4 fix: prior to this revision `FEE_PER_CHUNK` was hard-coded as `1n`,
|
|
9
|
+
* which represented "1 OS" (the smallest unit) — off by `10^9` from the
|
|
10
|
+
* intended "1 DEM per chunk" pricing. Now expressed as `OS_PER_DEM` to
|
|
11
|
+
* make the unit explicit and the pricing correct on the SDK side. (Note:
|
|
12
|
+
* the node's matching constant must be aligned by P5 to avoid SDK/node
|
|
13
|
+
* fee-schedule drift — flagged for follow-up.)
|
|
7
14
|
*/
|
|
15
|
+
import { OS_PER_DEM } from "../../../denomination/index.js";
|
|
8
16
|
export const STORAGE_PROGRAM_CONSTANTS = {
|
|
9
17
|
/** Maximum storage size in bytes (1MB) */
|
|
10
18
|
MAX_SIZE_BYTES: 1048576,
|
|
11
19
|
/** Size chunk for pricing in bytes (10KB) */
|
|
12
20
|
PRICING_CHUNK_BYTES: 10240,
|
|
13
|
-
/**
|
|
14
|
-
|
|
21
|
+
/**
|
|
22
|
+
* Fee per chunk, expressed in OS (= 1 DEM = 10^9 OS).
|
|
23
|
+
* Use bigint arithmetic at every call site; the SDK never widens
|
|
24
|
+
* back to JS `number`, which loses precision above 2^53.
|
|
25
|
+
*/
|
|
26
|
+
FEE_PER_CHUNK: OS_PER_DEM,
|
|
15
27
|
/** Maximum nesting depth for JSON encoding */
|
|
16
28
|
MAX_JSON_NESTING_DEPTH: 64,
|
|
17
29
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StorageProgramTransaction.js","sourceRoot":"","sources":["../../../../../src/types/blockchain/TransactionSubtypes/StorageProgramTransaction.ts"],"names":[],"mappings":"AAEA,qFAAqF;AAErF,+EAA+E;AAC/E,YAAY;AACZ,+EAA+E;AAE/E
|
|
1
|
+
{"version":3,"file":"StorageProgramTransaction.js","sourceRoot":"","sources":["../../../../../src/types/blockchain/TransactionSubtypes/StorageProgramTransaction.ts"],"names":[],"mappings":"AAEA,qFAAqF;AAErF,+EAA+E;AAC/E,YAAY;AACZ,+EAA+E;AAE/E;;;;;;;;;GASG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;AAElD,MAAM,CAAC,MAAM,yBAAyB,GAAG;IACrC,0CAA0C;IAC1C,cAAc,EAAE,OAAO;IAEvB,6CAA6C;IAC7C,mBAAmB,EAAE,KAAK;IAE1B;;;;OAIG;IACH,aAAa,EAAE,UAAU;IAEzB,8CAA8C;IAC9C,sBAAsB,EAAE,EAAE;CACpB,CAAA;AA0OV,+EAA+E;AAC/E,cAAc;AACd,+EAA+E;AAE/E;;GAEG;AACH,MAAM,UAAU,uBAAuB,CAAC,OAAgB;IACpD,IAAI,CAAC,OAAO,IAAI,OAAO,OAAO,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAA;IACzD,MAAM,CAAC,GAAG,OAAkC,CAAA;IAC5C,MAAM,eAAe,GAAG;QACpB,wBAAwB;QACxB,eAAe;QACf,cAAc;QACd,uBAAuB;QACvB,wBAAwB;QACxB,sBAAsB;QACtB,WAAW;QACX,UAAU;QACV,aAAa;QACb,cAAc;QACd,aAAa;KAChB,CAAA;IACD,OAAO,CACH,OAAO,CAAC,CAAC,SAAS,KAAK,QAAQ;QAC/B,OAAO,CAAC,CAAC,cAAc,KAAK,QAAQ;QACpC,eAAe,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAmB,CAAC,CAClD,CAAA;AACL,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,eAAe,CAAC,QAAiB;IAC7C,OAAO,QAAQ,KAAK,MAAM,IAAI,QAAQ,KAAK,QAAQ,CAAA;AACvD,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,sBAAsB,CAAC,QAAiB;IACpD,OAAO,QAAQ,KAAK,SAAS,IAAI,QAAQ,KAAK,MAAM,CAAA;AACxD,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Transaction, TransactionContent } from "../Transaction";
|
|
2
|
+
/** Payload for a `validatorExit` tx. Sender is implicit in the tx envelope. */
|
|
3
|
+
export type ValidatorExitPayload = Record<string, never>;
|
|
4
|
+
export type ValidatorExitTransactionContent = Omit<TransactionContent, 'type' | 'data'> & {
|
|
5
|
+
type: 'validatorExit';
|
|
6
|
+
data: ['validatorExit', ValidatorExitPayload];
|
|
7
|
+
};
|
|
8
|
+
export interface ValidatorExitTransaction extends Omit<Transaction, 'content'> {
|
|
9
|
+
content: ValidatorExitTransactionContent;
|
|
10
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ValidatorExitTransaction.js","sourceRoot":"","sources":["../../../../../src/types/blockchain/TransactionSubtypes/ValidatorExitTransaction.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Transaction, TransactionContent } from "../Transaction";
|
|
2
|
+
/** Payload for a `validatorStake` tx. */
|
|
3
|
+
export interface ValidatorStakePayload {
|
|
4
|
+
/** Stake amount as bigint-encoded string. */
|
|
5
|
+
amount: string;
|
|
6
|
+
/** Validator's public-facing connection URL (used on first stake only). */
|
|
7
|
+
connectionUrl: string;
|
|
8
|
+
}
|
|
9
|
+
export type ValidatorStakeTransactionContent = Omit<TransactionContent, 'type' | 'data'> & {
|
|
10
|
+
type: 'validatorStake';
|
|
11
|
+
data: ['validatorStake', ValidatorStakePayload];
|
|
12
|
+
};
|
|
13
|
+
export interface ValidatorStakeTransaction extends Omit<Transaction, 'content'> {
|
|
14
|
+
content: ValidatorStakeTransactionContent;
|
|
15
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ValidatorStakeTransaction.js","sourceRoot":"","sources":["../../../../../src/types/blockchain/TransactionSubtypes/ValidatorStakeTransaction.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Transaction, TransactionContent } from "../Transaction";
|
|
2
|
+
/** Payload for a `validatorUnstake` tx. Sender is implicit in the tx envelope. */
|
|
3
|
+
export type ValidatorUnstakePayload = Record<string, never>;
|
|
4
|
+
export type ValidatorUnstakeTransactionContent = Omit<TransactionContent, 'type' | 'data'> & {
|
|
5
|
+
type: 'validatorUnstake';
|
|
6
|
+
data: ['validatorUnstake', ValidatorUnstakePayload];
|
|
7
|
+
};
|
|
8
|
+
export interface ValidatorUnstakeTransaction extends Omit<Transaction, 'content'> {
|
|
9
|
+
content: ValidatorUnstakeTransactionContent;
|
|
10
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ValidatorUnstakeTransaction.js","sourceRoot":"","sources":["../../../../../src/types/blockchain/TransactionSubtypes/ValidatorUnstakeTransaction.ts"],"names":[],"mappings":""}
|
|
@@ -15,6 +15,11 @@ export * from './D402PaymentTransaction';
|
|
|
15
15
|
export * from './EscrowTransaction';
|
|
16
16
|
export * from './IPFSTransaction';
|
|
17
17
|
export * from './TokenTransaction';
|
|
18
|
+
export * from './ValidatorStakeTransaction';
|
|
19
|
+
export * from './ValidatorUnstakeTransaction';
|
|
20
|
+
export * from './ValidatorExitTransaction';
|
|
21
|
+
export * from './NetworkUpgradeTransaction';
|
|
22
|
+
export * from './NetworkUpgradeVoteTransaction';
|
|
18
23
|
import { L2PSTransaction } from './L2PSTransaction';
|
|
19
24
|
import { L2PSHashTransaction } from './L2PSHashTransaction';
|
|
20
25
|
import { Web2Transaction } from './Web2Transaction';
|
|
@@ -33,4 +38,9 @@ import { EscrowTransaction } from './EscrowTransaction';
|
|
|
33
38
|
import { IPFSTransaction } from './IPFSTransaction';
|
|
34
39
|
import { TokenCreationTransaction } from './TokenTransaction';
|
|
35
40
|
import { TokenExecutionTransaction } from './TokenTransaction';
|
|
36
|
-
|
|
41
|
+
import { ValidatorStakeTransaction } from './ValidatorStakeTransaction';
|
|
42
|
+
import { ValidatorUnstakeTransaction } from './ValidatorUnstakeTransaction';
|
|
43
|
+
import { ValidatorExitTransaction } from './ValidatorExitTransaction';
|
|
44
|
+
import { NetworkUpgradeTransaction } from './NetworkUpgradeTransaction';
|
|
45
|
+
import { NetworkUpgradeVoteTransaction } from './NetworkUpgradeVoteTransaction';
|
|
46
|
+
export type SpecificTransaction = L2PSTransaction | L2PSHashTransaction | Web2Transaction | CrosschainTransaction | NativeTransaction | DemosworkTransaction | IdentityTransaction | InstantMessagingTransaction | L2PSInstantMessagingTransaction | NativeBridgeTransaction | StorageTransaction | StorageProgramTransaction | ContractDeployTransaction | ContractCallTransaction | D402PaymentTransaction | EscrowTransaction | IPFSTransaction | TokenCreationTransaction | TokenExecutionTransaction | ValidatorStakeTransaction | ValidatorUnstakeTransaction | ValidatorExitTransaction | NetworkUpgradeTransaction | NetworkUpgradeVoteTransaction;
|
|
@@ -16,4 +16,11 @@ export * from './EscrowTransaction.js';
|
|
|
16
16
|
export * from './IPFSTransaction.js';
|
|
17
17
|
// REVIEW: Token transaction types
|
|
18
18
|
export * from './TokenTransaction.js';
|
|
19
|
+
// Validator staking (Phase 0 / upgradable_network)
|
|
20
|
+
export * from './ValidatorStakeTransaction.js';
|
|
21
|
+
export * from './ValidatorUnstakeTransaction.js';
|
|
22
|
+
export * from './ValidatorExitTransaction.js';
|
|
23
|
+
// Stackable-genesis governance (Phase 1 / upgradable_network)
|
|
24
|
+
export * from './NetworkUpgradeTransaction.js';
|
|
25
|
+
export * from './NetworkUpgradeVoteTransaction.js';
|
|
19
26
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/types/blockchain/TransactionSubtypes/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAA;AACjC,cAAc,uBAAuB,CAAA;AACrC,cAAc,mBAAmB,CAAA;AACjC,cAAc,yBAAyB,CAAA;AACvC,cAAc,qBAAqB,CAAA;AACnC,cAAc,wBAAwB,CAAA;AACtC,cAAc,uBAAuB,CAAA;AACrC,cAAc,+BAA+B,CAAA;AAC7C,cAAc,2BAA2B,CAAA;AACzC,cAAc,sBAAsB,CAAA;AACpC,cAAc,6BAA6B,CAAA;AAC3C,cAAc,6BAA6B,CAAA;AAC3C,cAAc,2BAA2B,CAAA;AACzC,cAAc,0BAA0B,CAAA;AACxC,cAAc,qBAAqB,CAAA;AACnC,cAAc,mBAAmB,CAAA;AACjC,kCAAkC;AAClC,cAAc,oBAAoB,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/types/blockchain/TransactionSubtypes/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAA;AACjC,cAAc,uBAAuB,CAAA;AACrC,cAAc,mBAAmB,CAAA;AACjC,cAAc,yBAAyB,CAAA;AACvC,cAAc,qBAAqB,CAAA;AACnC,cAAc,wBAAwB,CAAA;AACtC,cAAc,uBAAuB,CAAA;AACrC,cAAc,+BAA+B,CAAA;AAC7C,cAAc,2BAA2B,CAAA;AACzC,cAAc,sBAAsB,CAAA;AACpC,cAAc,6BAA6B,CAAA;AAC3C,cAAc,6BAA6B,CAAA;AAC3C,cAAc,2BAA2B,CAAA;AACzC,cAAc,0BAA0B,CAAA;AACxC,cAAc,qBAAqB,CAAA;AACnC,cAAc,mBAAmB,CAAA;AACjC,kCAAkC;AAClC,cAAc,oBAAoB,CAAA;AAClC,mDAAmD;AACnD,cAAc,6BAA6B,CAAA;AAC3C,cAAc,+BAA+B,CAAA;AAC7C,cAAc,4BAA4B,CAAA;AAC1C,8DAA8D;AAC9D,cAAc,6BAA6B,CAAA;AAC3C,cAAc,iCAAiC,CAAA"}
|
|
@@ -1,5 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Transaction fee container.
|
|
3
|
+
*
|
|
4
|
+
* Wire-format compatibility note: pre-fork wire encodes each field as a JS
|
|
5
|
+
* `number` in DEM. Post-fork wire encodes them as decimal strings in OS
|
|
6
|
+
* (smallest unit, 1 DEM = 10^9 OS). Both shapes are accepted on input; the
|
|
7
|
+
* SDK's `serializerGate` (P4 commit 2) is the wire boundary that picks the
|
|
8
|
+
* correct on-the-wire shape per the connected node's fork status.
|
|
9
|
+
*
|
|
10
|
+
* Internally, fee math is performed in `bigint` OS via `denomination`
|
|
11
|
+
* conversion utilities — never as `number` (which loses precision above
|
|
12
|
+
* 2^53 OS, ~9 million DEM).
|
|
13
|
+
*/
|
|
1
14
|
export interface TxFee {
|
|
2
|
-
network_fee: number;
|
|
3
|
-
rpc_fee: number;
|
|
4
|
-
additional_fee: number;
|
|
15
|
+
network_fee: number | string;
|
|
16
|
+
rpc_fee: number | string;
|
|
17
|
+
additional_fee: number | string;
|
|
5
18
|
}
|