@kynesyslabs/demosdk 2.12.0 → 2.12.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.
Files changed (59) hide show
  1. package/build/abstraction/EvmCoinFinder.js +14 -2
  2. package/build/abstraction/EvmCoinFinder.js.map +1 -1
  3. package/build/abstraction/Identities.js +3 -1
  4. package/build/abstraction/Identities.js.map +1 -1
  5. package/build/encryption/zK/interactive/index.js +5 -1
  6. package/build/encryption/zK/interactive/index.js.map +1 -1
  7. package/build/instant_messaging/L2PSMessagingPeer.js +4 -1
  8. package/build/instant_messaging/L2PSMessagingPeer.js.map +1 -1
  9. package/build/types/blockchain/GCREdit.d.ts +54 -1
  10. package/build/types/blockchain/NetworkParameters.d.ts +54 -0
  11. package/build/types/blockchain/NetworkParameters.js +9 -0
  12. package/build/types/blockchain/NetworkParameters.js.map +1 -0
  13. package/build/types/blockchain/Transaction.d.ts +7 -2
  14. package/build/types/blockchain/Transaction.js.map +1 -1
  15. package/build/types/blockchain/TransactionSubtypes/NetworkUpgradeTransaction.d.ts +20 -0
  16. package/build/types/blockchain/TransactionSubtypes/NetworkUpgradeTransaction.js +2 -0
  17. package/build/types/blockchain/TransactionSubtypes/NetworkUpgradeTransaction.js.map +1 -0
  18. package/build/types/blockchain/TransactionSubtypes/NetworkUpgradeVoteTransaction.d.ts +13 -0
  19. package/build/types/blockchain/TransactionSubtypes/NetworkUpgradeVoteTransaction.js +2 -0
  20. package/build/types/blockchain/TransactionSubtypes/NetworkUpgradeVoteTransaction.js.map +1 -0
  21. package/build/types/blockchain/TransactionSubtypes/ValidatorExitTransaction.d.ts +10 -0
  22. package/build/types/blockchain/TransactionSubtypes/ValidatorExitTransaction.js +2 -0
  23. package/build/types/blockchain/TransactionSubtypes/ValidatorExitTransaction.js.map +1 -0
  24. package/build/types/blockchain/TransactionSubtypes/ValidatorStakeTransaction.d.ts +15 -0
  25. package/build/types/blockchain/TransactionSubtypes/ValidatorStakeTransaction.js +2 -0
  26. package/build/types/blockchain/TransactionSubtypes/ValidatorStakeTransaction.js.map +1 -0
  27. package/build/types/blockchain/TransactionSubtypes/ValidatorUnstakeTransaction.d.ts +10 -0
  28. package/build/types/blockchain/TransactionSubtypes/ValidatorUnstakeTransaction.js +2 -0
  29. package/build/types/blockchain/TransactionSubtypes/ValidatorUnstakeTransaction.js.map +1 -0
  30. package/build/types/blockchain/TransactionSubtypes/index.d.ts +11 -1
  31. package/build/types/blockchain/TransactionSubtypes/index.js +7 -0
  32. package/build/types/blockchain/TransactionSubtypes/index.js.map +1 -1
  33. package/build/types/index.d.ts +4 -2
  34. package/build/types/index.js.map +1 -1
  35. package/build/types/validator/ValidatorTypes.d.ts +13 -0
  36. package/build/types/validator/ValidatorTypes.js +3 -0
  37. package/build/types/validator/ValidatorTypes.js.map +1 -0
  38. package/build/websdk/BroadcastFailedError.d.ts +22 -0
  39. package/build/websdk/BroadcastFailedError.js +24 -0
  40. package/build/websdk/BroadcastFailedError.js.map +1 -0
  41. package/build/websdk/BroadcastTimeoutError.d.ts +19 -0
  42. package/build/websdk/BroadcastTimeoutError.js +19 -0
  43. package/build/websdk/BroadcastTimeoutError.js.map +1 -0
  44. package/build/websdk/DemosTransactions.d.ts +90 -1
  45. package/build/websdk/DemosTransactions.js +286 -0
  46. package/build/websdk/DemosTransactions.js.map +1 -1
  47. package/build/websdk/GCRGeneration.d.ts +1 -0
  48. package/build/websdk/GCRGeneration.js +113 -0
  49. package/build/websdk/GCRGeneration.js.map +1 -1
  50. package/build/websdk/TransportError.d.ts +17 -0
  51. package/build/websdk/TransportError.js +18 -0
  52. package/build/websdk/TransportError.js.map +1 -0
  53. package/build/websdk/demosclass.d.ts +160 -3
  54. package/build/websdk/demosclass.js +251 -29
  55. package/build/websdk/demosclass.js.map +1 -1
  56. package/build/websdk/index.d.ts +3 -0
  57. package/build/websdk/index.js +3 -0
  58. package/build/websdk/index.js.map +1 -1
  59. package/package.json +1 -1
@@ -4,7 +4,7 @@ export { ISignature } from "./blockchain/ISignature";
4
4
  export { RawTransaction } from "./blockchain/rawTransaction";
5
5
  export { Transaction, TransactionContent, TransactionContentData, } from "./blockchain/Transaction";
6
6
  export { type CustomCharges, type IPFSCustomCharges, type IPFSCostBreakdown, type ValidityDataCustomCharges, hasIPFSCustomCharges, isValidCharge, } from "./blockchain/CustomCharges";
7
- export { L2PSTransaction, Web2Transaction, CrosschainTransaction, NativeTransaction, DemosworkTransaction, IdentityTransaction, InstantMessagingTransaction, NativeBridgeTransaction, SpecificTransaction, IPFSTransaction, type IPFSTransactionContent, type IPFSPayload, type IPFSAddPayload, type IPFSPinPayload, type IPFSUnpinPayload, type IPFSExtendPinPayload, type IPFSOperationType, isIPFSAddPayload, isIPFSPinPayload, isIPFSUnpinPayload, isIPFSExtendPinPayload, isIPFSPayload, } from "./blockchain/TransactionSubtypes";
7
+ export { L2PSTransaction, Web2Transaction, CrosschainTransaction, NativeTransaction, DemosworkTransaction, IdentityTransaction, InstantMessagingTransaction, NativeBridgeTransaction, SpecificTransaction, IPFSTransaction, type IPFSTransactionContent, type IPFSPayload, type IPFSAddPayload, type IPFSPinPayload, type IPFSUnpinPayload, type IPFSExtendPinPayload, type IPFSOperationType, isIPFSAddPayload, isIPFSPinPayload, isIPFSUnpinPayload, isIPFSExtendPinPayload, isIPFSPayload, ValidatorStakeTransaction, ValidatorStakePayload, ValidatorUnstakeTransaction, ValidatorUnstakePayload, ValidatorExitTransaction, ValidatorExitPayload, NetworkUpgradeTransaction, NetworkUpgradePayload, NetworkUpgradeVoteTransaction, NetworkUpgradeVotePayload, } from "./blockchain/TransactionSubtypes";
8
8
  export { INativePayload } from "./native/INativePayload";
9
9
  export { InstantMessagingPayload } from "./instantMessaging";
10
10
  export { TxFee } from "./blockchain/TxFee";
@@ -30,7 +30,9 @@ export { DataTypes, operators } from "./demoswork/datatypes";
30
30
  export { ConditionalOperationScript, DemosWorkOperationScripts, OperationScript, OperationType, } from "./demoswork/operations";
31
31
  export { ICondition, Conditional, StepOutputKey, WorkStepInput, XmStepResult, stepKeys, stepKeysEnum, } from "./demoswork/steps";
32
32
  export { BrowserRequest, ConsensusRequest, RPCRequest, RPCResponse, HelloPeerRequest, NodeCall, VoteRequest, RPCResponseWithValidityData, emptyResponse as RPCResponseSkeleton, } from "./communication/rpc";
33
- export { GCREdit, GCREditAssign, GCREditAssignIdentity, GCREditBalance, GCREditIdentity, GCREditNonce, GCREditSubnetsTx, GCREditStorageProgram, Web2GCRData, XmGCRData, XmGCRIdentityData, } from "./blockchain/GCREdit";
33
+ export { GCREdit, GCREditAssign, GCREditAssignIdentity, GCREditBalance, GCREditIdentity, GCREditNonce, GCREditSubnetsTx, GCREditStorageProgram, GCREditValidatorStake, GCREditNetworkUpgrade, GCREditNetworkUpgradeVote, Web2GCRData, XmGCRData, XmGCRIdentityData, } from "./blockchain/GCREdit";
34
+ export { type ValidatorInfo, type ValidatorStatus, } from "./validator/ValidatorTypes";
35
+ export { type NetworkParameters, type NetworkParameterKey, type NetworkUpgradeProposal, type ProposalStatus, type ProposalVoteInfo, } from "./blockchain/NetworkParameters";
34
36
  export { BridgeTradePayload } from "./bridge/bridgeTradePayload";
35
37
  export { ChainProviders, SupportedChains, SupportedTokens, } from "./bridge/constants";
36
38
  export { type SigningAlgorithm, type EncryptionAlgorithm } from "./cryptography";
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":"AAmBA,gEAAgE;AAChE,OAAO,EAKH,oBAAoB,EACpB,aAAa,GAChB,MAAM,4BAA4B,CAAA;AAEnC,wCAAwC;AACxC,OAAO,EAoBH,gBAAgB,EAChB,gBAAgB,EAChB,kBAAkB;AAClB,6CAA6C;AAC7C,sBAAsB,EACtB,aAAa,GAChB,MAAM,kCAAkC,CAAA;AASzC,OAAO,EAAE,aAAa,EAAgB,MAAM,2BAA2B,CAAA;AA6CvE,OAAO;AACP,OAAO,EAaH,eAAe,GAClB,MAAM,QAAQ,CAAA;AAef,OAAO,EAAE,SAAS,EAAa,MAAM,uBAAuB,CAAA;AAO5D,OAAO,EAKH,YAAY,EAEZ,YAAY,GACf,MAAM,mBAAmB,CAAA;AAE1B,OAAO,EASH,aAAa,IAAI,mBAAmB,GACvC,MAAM,qBAAqB,CAAA;AAgB5B,OAAO,EACH,cAAc,EACd,eAAe,EACf,eAAe,GAClB,MAAM,oBAAoB,CAAA;AAY3B,+BAA+B;AAC/B,OAAO,EACH,iBAAiB,EACjB,qBAAqB,GACxB,MAAM,wCAAwC,CAAA;AAmB/C,sEAAsE;AACtE,OAAO;AAgCH,oBAAoB;AACpB,kBAAkB,EAClB,iBAAiB,EACjB,kBAAkB,EAClB,oBAAoB,EACpB,eAAe,EACf,eAAe,EACf,uBAAuB,EACvB,0BAA0B,EAC1B,mBAAmB,EACnB,qBAAqB,EACrB,aAAa,EACb,gBAAgB,EAChB,eAAe,EACf,cAAc,EACd,2BAA2B,EAC3B,cAAc,EACd,aAAa,GAChB,MAAM,SAAS,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":"AAmBA,gEAAgE;AAChE,OAAO,EAKH,oBAAoB,EACpB,aAAa,GAChB,MAAM,4BAA4B,CAAA;AAEnC,wCAAwC;AACxC,OAAO,EAoBH,gBAAgB,EAChB,gBAAgB,EAChB,kBAAkB;AAClB,6CAA6C;AAC7C,sBAAsB,EACtB,aAAa,GAahB,MAAM,kCAAkC,CAAA;AASzC,OAAO,EAAE,aAAa,EAAgB,MAAM,2BAA2B,CAAA;AA6CvE,OAAO;AACP,OAAO,EAaH,eAAe,GAClB,MAAM,QAAQ,CAAA;AAef,OAAO,EAAE,SAAS,EAAa,MAAM,uBAAuB,CAAA;AAO5D,OAAO,EAKH,YAAY,EAEZ,YAAY,GACf,MAAM,mBAAmB,CAAA;AAE1B,OAAO,EASH,aAAa,IAAI,mBAAmB,GACvC,MAAM,qBAAqB,CAAA;AA8B5B,OAAO,EACH,cAAc,EACd,eAAe,EACf,eAAe,GAClB,MAAM,oBAAoB,CAAA;AAY3B,+BAA+B;AAC/B,OAAO,EACH,iBAAiB,EACjB,qBAAqB,GACxB,MAAM,wCAAwC,CAAA;AAmB/C,sEAAsE;AACtE,OAAO;AAgCH,oBAAoB;AACpB,kBAAkB,EAClB,iBAAiB,EACjB,kBAAkB,EAClB,oBAAoB,EACpB,eAAe,EACf,eAAe,EACf,uBAAuB,EACvB,0BAA0B,EAC1B,mBAAmB,EACnB,qBAAqB,EACrB,aAAa,EACb,gBAAgB,EAChB,eAAe,EACf,cAAc,EACd,2BAA2B,EAC3B,cAAc,EACd,aAAa,GAChB,MAAM,SAAS,CAAA"}
@@ -0,0 +1,13 @@
1
+ /** Status codes written into the Validators table. */
2
+ export type ValidatorStatus = "0" | "2" | "3";
3
+ /** What `getValidatorInfo` / `getValidators` return per row. */
4
+ export interface ValidatorInfo {
5
+ address: string;
6
+ status: ValidatorStatus | string;
7
+ connectionUrl: string | null;
8
+ stakedAmount: string;
9
+ firstSeen: number | null;
10
+ validAt: number | null;
11
+ unstakeRequestedAt: number | null;
12
+ unstakeAvailableAt: number | null;
13
+ }
@@ -0,0 +1,3 @@
1
+ // Validator state as exposed by the node's RPC surface.
2
+ export {};
3
+ //# sourceMappingURL=ValidatorTypes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ValidatorTypes.js","sourceRoot":"","sources":["../../../../src/types/validator/ValidatorTypes.ts"],"names":[],"mappings":"AAAA,wDAAwD"}
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Thrown by `DemosTransactions.broadcastAndWait` when the broadcast itself
3
+ * could not reach the node (no server contact at all). Distinct from
4
+ * `BroadcastTimeoutError`, which means the broadcast was accepted by the
5
+ * transport but the SDK never observed a terminal state within the timeout.
6
+ *
7
+ * Only raised when the caller opts in via `failFastOnBroadcastError: true`.
8
+ * The default behavior (lenient) preserves the previous "keep polling and
9
+ * eventually time out" semantics so existing consumers see no change.
10
+ *
11
+ * `cause` is the underlying transport error (typically an AxiosError) so
12
+ * callers can inspect `.code`, `.response`, etc.
13
+ */
14
+ export declare class BroadcastFailedError extends Error {
15
+ readonly txHash: string;
16
+ readonly cause: unknown;
17
+ constructor(opts: {
18
+ txHash: string;
19
+ cause: unknown;
20
+ message?: string;
21
+ });
22
+ }
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Thrown by `DemosTransactions.broadcastAndWait` when the broadcast itself
3
+ * could not reach the node (no server contact at all). Distinct from
4
+ * `BroadcastTimeoutError`, which means the broadcast was accepted by the
5
+ * transport but the SDK never observed a terminal state within the timeout.
6
+ *
7
+ * Only raised when the caller opts in via `failFastOnBroadcastError: true`.
8
+ * The default behavior (lenient) preserves the previous "keep polling and
9
+ * eventually time out" semantics so existing consumers see no change.
10
+ *
11
+ * `cause` is the underlying transport error (typically an AxiosError) so
12
+ * callers can inspect `.code`, `.response`, etc.
13
+ */
14
+ export class BroadcastFailedError extends Error {
15
+ constructor(opts) {
16
+ const causeMessage = opts.cause?.message ?? String(opts.cause ?? "unknown");
17
+ super(opts.message ??
18
+ `Broadcast failed before inclusion polling could begin (txHash=${opts.txHash}): ${causeMessage}`);
19
+ this.name = "BroadcastFailedError";
20
+ this.txHash = opts.txHash;
21
+ this.cause = opts.cause;
22
+ }
23
+ }
24
+ //# sourceMappingURL=BroadcastFailedError.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BroadcastFailedError.js","sourceRoot":"","sources":["../../../src/websdk/BroadcastFailedError.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,MAAM,OAAO,oBAAqB,SAAQ,KAAK;IAI3C,YAAY,IAA0D;QAClE,MAAM,YAAY,GACb,IAAI,CAAC,KAAa,EAAE,OAAO,IAAI,MAAM,CAAC,IAAI,CAAC,KAAK,IAAI,SAAS,CAAC,CAAA;QACnE,KAAK,CACD,IAAI,CAAC,OAAO;YACR,iEAAiE,IAAI,CAAC,MAAM,MAAM,YAAY,EAAE,CACvG,CAAA;QACD,IAAI,CAAC,IAAI,GAAG,sBAAsB,CAAA;QAClC,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAA;QACzB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAA;IAC3B,CAAC;CACJ"}
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Thrown by `DemosTransactions.broadcastAndWait` when a broadcast tx has not
3
+ * been observed in a terminal state (`included` or `failed`) before the
4
+ * configured timeout elapses.
5
+ *
6
+ * The broadcast itself may have succeeded - this only indicates that the
7
+ * SDK gave up waiting. Callers can resume polling on their own using the
8
+ * preserved `txHash` and `lastSeenState`.
9
+ */
10
+ export declare class BroadcastTimeoutError extends Error {
11
+ readonly txHash: string;
12
+ readonly lastSeenState: string;
13
+ readonly elapsedMs: number;
14
+ constructor(opts: {
15
+ txHash: string;
16
+ lastSeenState: string;
17
+ elapsedMs: number;
18
+ });
19
+ }
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Thrown by `DemosTransactions.broadcastAndWait` when a broadcast tx has not
3
+ * been observed in a terminal state (`included` or `failed`) before the
4
+ * configured timeout elapses.
5
+ *
6
+ * The broadcast itself may have succeeded - this only indicates that the
7
+ * SDK gave up waiting. Callers can resume polling on their own using the
8
+ * preserved `txHash` and `lastSeenState`.
9
+ */
10
+ export class BroadcastTimeoutError extends Error {
11
+ constructor(opts) {
12
+ super(`Broadcast timed out after ${opts.elapsedMs}ms (txHash=${opts.txHash}, lastSeenState=${opts.lastSeenState})`);
13
+ this.name = "BroadcastTimeoutError";
14
+ this.txHash = opts.txHash;
15
+ this.lastSeenState = opts.lastSeenState;
16
+ this.elapsedMs = opts.elapsedMs;
17
+ }
18
+ }
19
+ //# sourceMappingURL=BroadcastTimeoutError.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BroadcastTimeoutError.js","sourceRoot":"","sources":["../../../src/websdk/BroadcastTimeoutError.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,MAAM,OAAO,qBAAsB,SAAQ,KAAK;IAK5C,YAAY,IAIX;QACG,KAAK,CACD,6BAA6B,IAAI,CAAC,SAAS,cAAc,IAAI,CAAC,MAAM,mBAAmB,IAAI,CAAC,aAAa,GAAG,CAC/G,CAAA;QACD,IAAI,CAAC,IAAI,GAAG,uBAAuB,CAAA;QACnC,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAA;QACzB,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,aAAa,CAAA;QACvC,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,CAAA;IACnC,CAAC;CACJ"}
@@ -1,7 +1,8 @@
1
1
  import { Demos } from "./demosclass";
2
2
  import type { SigningAlgorithm, Transaction } from "../types";
3
+ import type { NetworkParameters } from "../types/blockchain/NetworkParameters";
3
4
  import { IKeyPair } from "./types/KeyPair";
4
- import { RPCResponseWithValidityData } from "../types/communication/rpc";
5
+ import { RPCResponse, RPCResponseWithValidityData } from "../types/communication/rpc";
5
6
  export declare const DemosTransactions: {
6
7
  empty: () => Transaction;
7
8
  prepare: (data?: any) => Promise<Transaction>;
@@ -67,6 +68,47 @@ export declare const DemosTransactions: {
67
68
  * @returns The response from the node
68
69
  */
69
70
  broadcast: (validationData: RPCResponseWithValidityData, demos: Demos) => Promise<any>;
71
+ /**
72
+ * Broadcast a confirmed transaction and wait for inclusion.
73
+ *
74
+ * Polls the node's `getTransactionStatus` RPC until the tx is observed
75
+ * `included` or `failed`, or until `opts.timeoutMs` elapses (default 30s).
76
+ *
77
+ * Use this when you want a single call with a deterministic outcome.
78
+ * Use plain `broadcast()` when you want to handle async confirmation
79
+ * yourself.
80
+ *
81
+ * On timeout, throws `BroadcastTimeoutError` carrying the tx hash,
82
+ * the last observed state, and the elapsed time so the caller can
83
+ * resume polling.
84
+ *
85
+ * When `opts.failFastOnBroadcastError` is true, also throws
86
+ * `BroadcastFailedError` synchronously when the broadcast itself can't
87
+ * reach the node (e.g., ECONNREFUSED, ENOTFOUND). HTTP 5xx responses
88
+ * are NOT considered fail-fast cases - the server did answer, so the
89
+ * tx may still have landed and polling should run. Defaults to false
90
+ * for one release to preserve current callers' behavior.
91
+ *
92
+ * @param validationData - The validity data of the transaction (from `confirm`)
93
+ * @param demos - The demos instance
94
+ * @param opts.timeoutMs - Total time to wait for inclusion. Defaults to 30_000.
95
+ * @param opts.pollIntervalMs - Delay between status polls. Defaults to 500.
96
+ * @param opts.failFastOnBroadcastError - If true, throw `BroadcastFailedError`
97
+ * immediately when the broadcast can't contact the node. Defaults to false.
98
+ *
99
+ * @returns The original broadcast response and the terminal status.
100
+ */
101
+ broadcastAndWait: (validationData: RPCResponseWithValidityData, demos: Demos, opts?: {
102
+ timeoutMs?: number;
103
+ pollIntervalMs?: number;
104
+ failFastOnBroadcastError?: boolean;
105
+ }) => Promise<{
106
+ broadcast: RPCResponse;
107
+ status: {
108
+ state: "included" | "failed";
109
+ blockNumber?: number;
110
+ };
111
+ }>;
70
112
  /**
71
113
  * Create a signed DEMOS transaction to store binary data on the blockchain.
72
114
  * Data is stored in the sender's account.
@@ -103,4 +145,51 @@ export declare const DemosTransactions: {
103
145
  * ```
104
146
  */
105
147
  createL2PSHashUpdate(l2psUid: string, consolidatedHash: string, transactionCount: number, demos: Demos): Promise<Transaction>;
148
+ /**
149
+ * Create a signed `validatorStake` transaction. Used both for initial
150
+ * validator registration and to top up an existing stake.
151
+ *
152
+ * @param amount - Stake amount in base-unit DEMOS, encoded as a bigint string.
153
+ * @param connectionUrl - Validator's public endpoint (required on first stake;
154
+ * subsequent top-ups may overwrite it).
155
+ * @param demos - The demos instance (for nonce + signing).
156
+ */
157
+ stake(amount: string, connectionUrl: string, demos: Demos): Promise<Transaction>;
158
+ /**
159
+ * Create a signed `validatorUnstake` transaction. Arms the unstake lock
160
+ * period; after `UNSTAKE_LOCK_BLOCKS` have elapsed the validator may call
161
+ * `validatorExit`.
162
+ */
163
+ unstake(demos: Demos): Promise<Transaction>;
164
+ /**
165
+ * Create a signed `validatorExit` transaction. Only accepted by the
166
+ * network once `unstake_available_at <= currentBlock`.
167
+ */
168
+ validatorExit(demos: Demos): Promise<Transaction>;
169
+ /**
170
+ * Create a signed `networkUpgrade` proposal transaction.
171
+ *
172
+ * Only active validators may propose. The node rejects proposals whose
173
+ * `proposedParameters` violate safety bounds (≤50% change, absolute
174
+ * floor/ceiling) or overlap keys with other pending/activating proposals.
175
+ *
176
+ * @param params.proposalId - UUID. Also used as lexicographic activation-order tiebreaker.
177
+ * @param params.proposedParameters - Subset of NetworkParameters to change.
178
+ * @param params.rationale - Human-readable reason, ≤1024 bytes.
179
+ * @param params.effectiveAtBlock - Activation block. Must be ≥ tallyBlock + grace period.
180
+ */
181
+ proposeNetworkUpgrade(params: {
182
+ proposalId: string;
183
+ proposedParameters: Partial<NetworkParameters>;
184
+ rationale: string;
185
+ effectiveAtBlock: number;
186
+ }, demos: Demos): Promise<Transaction>;
187
+ /**
188
+ * Create a signed `networkUpgradeVote` transaction.
189
+ *
190
+ * The voter must be in the validator snapshot taken at the proposal's
191
+ * confirmation block, and may cast exactly one vote per proposal (final,
192
+ * non-revocable).
193
+ */
194
+ voteOnUpgrade(proposalId: string, approve: boolean, demos: Demos): Promise<Transaction>;
106
195
  };
@@ -5,6 +5,17 @@ import { _required as required } from "./utils/required.js";
5
5
  import { Cryptography } from "../encryption/index.js";
6
6
  import { uint8ArrayToHex } from "../encryption/unifiedCrypto.js";
7
7
  import { Enigma } from "../encryption/PQC/enigma.js";
8
+ import { BroadcastTimeoutError } from "./BroadcastTimeoutError.js";
9
+ import { BroadcastFailedError } from "./BroadcastFailedError.js";
10
+ // Connection-error codes indicating the request never reached the node.
11
+ // HTTP 5xx is intentionally NOT in this set: a 5xx means the server did
12
+ // answer, so the broadcast may have landed even if the response was lost.
13
+ const NO_SERVER_CONTACT_CODES = new Set([
14
+ "ECONNREFUSED",
15
+ "ENOTFOUND",
16
+ "ECONNRESET",
17
+ "ETIMEDOUT",
18
+ ]);
8
19
  export const DemosTransactions = {
9
20
  // REVIEW All this part
10
21
  // NOTE A courtesy to get a skeleton of transactions
@@ -178,6 +189,116 @@ export const DemosTransactions = {
178
189
  return res;
179
190
  }
180
191
  },
192
+ /**
193
+ * Broadcast a confirmed transaction and wait for inclusion.
194
+ *
195
+ * Polls the node's `getTransactionStatus` RPC until the tx is observed
196
+ * `included` or `failed`, or until `opts.timeoutMs` elapses (default 30s).
197
+ *
198
+ * Use this when you want a single call with a deterministic outcome.
199
+ * Use plain `broadcast()` when you want to handle async confirmation
200
+ * yourself.
201
+ *
202
+ * On timeout, throws `BroadcastTimeoutError` carrying the tx hash,
203
+ * the last observed state, and the elapsed time so the caller can
204
+ * resume polling.
205
+ *
206
+ * When `opts.failFastOnBroadcastError` is true, also throws
207
+ * `BroadcastFailedError` synchronously when the broadcast itself can't
208
+ * reach the node (e.g., ECONNREFUSED, ENOTFOUND). HTTP 5xx responses
209
+ * are NOT considered fail-fast cases - the server did answer, so the
210
+ * tx may still have landed and polling should run. Defaults to false
211
+ * for one release to preserve current callers' behavior.
212
+ *
213
+ * @param validationData - The validity data of the transaction (from `confirm`)
214
+ * @param demos - The demos instance
215
+ * @param opts.timeoutMs - Total time to wait for inclusion. Defaults to 30_000.
216
+ * @param opts.pollIntervalMs - Delay between status polls. Defaults to 500.
217
+ * @param opts.failFastOnBroadcastError - If true, throw `BroadcastFailedError`
218
+ * immediately when the broadcast can't contact the node. Defaults to false.
219
+ *
220
+ * @returns The original broadcast response and the terminal status.
221
+ */
222
+ broadcastAndWait: async function (validationData, demos, opts) {
223
+ const timeout = opts?.timeoutMs ?? 30000;
224
+ const pollInterval = opts?.pollIntervalMs ?? 500;
225
+ const failFast = opts?.failFastOnBroadcastError ?? false;
226
+ // Extract the tx hash from the validity data before broadcasting so
227
+ // we can include it in any timeout error.
228
+ const txHash = validationData?.response?.data?.transaction?.hash;
229
+ required(txHash, "Could not find transaction hash on validationData");
230
+ // 1. Broadcast first - reuses existing semantics so any failure here
231
+ // surfaces exactly the same way as a plain broadcast() call.
232
+ const broadcastRes = await DemosTransactions.broadcast(validationData, demos);
233
+ // 1a. (Opt-in) If the broadcast never reached the node, surface that
234
+ // immediately rather than waiting out the full timeout. We detect
235
+ // this via the back-compat envelope produced by `demos.call` on
236
+ // transport failure: { result: 500, response: <error>, require_reply, ... }.
237
+ // Only "no server contact" codes are fail-fast; HTTP 5xx means the
238
+ // server did answer and the tx may still have landed, so polling runs.
239
+ if (failFast) {
240
+ const isTransportFailureEnvelope = broadcastRes &&
241
+ typeof broadcastRes === "object" &&
242
+ broadcastRes.result === 500 &&
243
+ "require_reply" in broadcastRes;
244
+ if (isTransportFailureEnvelope) {
245
+ const cause = broadcastRes.response;
246
+ const code = cause?.code;
247
+ const sawServer = typeof cause?.response?.status === "number";
248
+ const noServerContact = !sawServer &&
249
+ typeof code === "string" &&
250
+ NO_SERVER_CONTACT_CODES.has(code);
251
+ if (noServerContact) {
252
+ throw new BroadcastFailedError({ txHash, cause });
253
+ }
254
+ }
255
+ }
256
+ const start = Date.now();
257
+ let attempt = 0;
258
+ let lastState = "unknown";
259
+ // 2. Poll until terminal state or timeout. Mirrors KeyServerClient's
260
+ // pollOAuth pattern: skip the initial sleep on the first attempt
261
+ // so a tx that lands instantly returns quickly.
262
+ while (Date.now() - start < timeout) {
263
+ attempt++;
264
+ if (attempt > 1) {
265
+ await new Promise(r => setTimeout(r, pollInterval));
266
+ }
267
+ const statusRes = await demos.call("nodeCall", "", { hash: txHash }, "getTransactionStatus");
268
+ // `Demos.call("nodeCall", ...)` normally returns the inner
269
+ // `response` payload directly (e.g. `{ state, blockNumber? }`).
270
+ // On a terminal transport failure it returns the back-compat
271
+ // envelope `{ result: 500, response: <error> }`. Tolerate that
272
+ // as a transient hiccup and keep polling - we don't want a
273
+ // single 5xx blip to break the wait.
274
+ const isTransportFailureEnvelope = statusRes &&
275
+ typeof statusRes === "object" &&
276
+ "result" in statusRes &&
277
+ statusRes.result === 500 &&
278
+ "require_reply" in statusRes;
279
+ if (isTransportFailureEnvelope) {
280
+ continue;
281
+ }
282
+ const state = statusRes && typeof statusRes === "object"
283
+ ? statusRes.state
284
+ : undefined;
285
+ if (typeof state === "string") {
286
+ lastState = state;
287
+ if (state === "included" || state === "failed") {
288
+ const blockNumber = statusRes.blockNumber;
289
+ return {
290
+ broadcast: broadcastRes,
291
+ status: { state, blockNumber },
292
+ };
293
+ }
294
+ }
295
+ }
296
+ throw new BroadcastTimeoutError({
297
+ txHash,
298
+ lastSeenState: lastState,
299
+ elapsedMs: Date.now() - start,
300
+ });
301
+ },
181
302
  /**
182
303
  * Create a signed DEMOS transaction to store binary data on the blockchain.
183
304
  * Data is stored in the sender's account.
@@ -258,5 +379,170 @@ export const DemosTransactions = {
258
379
  return await demos.sign(tx);
259
380
  },
260
381
  // NOTE Subnet transactions methods are imported and exposed in demos.ts from the l2ps.ts file.
382
+ // SECTION Validator staking (Phase 0 — upgradable_network track)
383
+ /**
384
+ * Create a signed `validatorStake` transaction. Used both for initial
385
+ * validator registration and to top up an existing stake.
386
+ *
387
+ * @param amount - Stake amount in base-unit DEMOS, encoded as a bigint string.
388
+ * @param connectionUrl - Validator's public endpoint (required on first stake;
389
+ * subsequent top-ups may overwrite it).
390
+ * @param demos - The demos instance (for nonce + signing).
391
+ */
392
+ async stake(amount, connectionUrl, demos) {
393
+ required(demos.keypair, "Wallet not connected");
394
+ required(amount, "Stake amount is required");
395
+ if (typeof amount !== "string" || !/^\d+$/.test(amount)) {
396
+ throw new Error("Invalid stake amount: expected a non-negative bigint-encoded string");
397
+ }
398
+ if (BigInt(amount) <= 0n) {
399
+ throw new Error("Stake amount must be greater than 0");
400
+ }
401
+ required(connectionUrl, "Connection URL is required");
402
+ try {
403
+ new URL(connectionUrl);
404
+ }
405
+ catch {
406
+ throw new Error("Invalid connectionUrl: expected an absolute URL (e.g. https://node.example)");
407
+ }
408
+ const tx = DemosTransactions.empty();
409
+ const { publicKey } = await demos.crypto.getIdentity("ed25519");
410
+ const publicKeyHex = uint8ArrayToHex(publicKey);
411
+ const nonce = await demos.getAddressNonce(publicKeyHex);
412
+ // Staking txs are reflexive — the sender operates on their own
413
+ // validator record. `to` must still pass sign()'s 0x64-hex check.
414
+ tx.content.to = publicKeyHex;
415
+ tx.content.nonce = nonce + 1;
416
+ tx.content.amount = 0;
417
+ tx.content.type = "validatorStake";
418
+ tx.content.timestamp = Date.now();
419
+ tx.content.data = ["validatorStake", { amount, connectionUrl }];
420
+ return await demos.sign(tx);
421
+ },
422
+ /**
423
+ * Create a signed `validatorUnstake` transaction. Arms the unstake lock
424
+ * period; after `UNSTAKE_LOCK_BLOCKS` have elapsed the validator may call
425
+ * `validatorExit`.
426
+ */
427
+ async unstake(demos) {
428
+ required(demos.keypair, "Wallet not connected");
429
+ const tx = DemosTransactions.empty();
430
+ const { publicKey } = await demos.crypto.getIdentity("ed25519");
431
+ const publicKeyHex = uint8ArrayToHex(publicKey);
432
+ const nonce = await demos.getAddressNonce(publicKeyHex);
433
+ tx.content.to = publicKeyHex;
434
+ tx.content.nonce = nonce + 1;
435
+ tx.content.amount = 0;
436
+ tx.content.type = "validatorUnstake";
437
+ tx.content.timestamp = Date.now();
438
+ tx.content.data = ["validatorUnstake", {}];
439
+ return await demos.sign(tx);
440
+ },
441
+ /**
442
+ * Create a signed `validatorExit` transaction. Only accepted by the
443
+ * network once `unstake_available_at <= currentBlock`.
444
+ */
445
+ async validatorExit(demos) {
446
+ required(demos.keypair, "Wallet not connected");
447
+ const tx = DemosTransactions.empty();
448
+ const { publicKey } = await demos.crypto.getIdentity("ed25519");
449
+ const publicKeyHex = uint8ArrayToHex(publicKey);
450
+ const nonce = await demos.getAddressNonce(publicKeyHex);
451
+ tx.content.to = publicKeyHex;
452
+ tx.content.nonce = nonce + 1;
453
+ tx.content.amount = 0;
454
+ tx.content.type = "validatorExit";
455
+ tx.content.timestamp = Date.now();
456
+ tx.content.data = ["validatorExit", {}];
457
+ return await demos.sign(tx);
458
+ },
459
+ // SECTION Stackable-genesis governance (Phase 1 — upgradable_network track)
460
+ /**
461
+ * Create a signed `networkUpgrade` proposal transaction.
462
+ *
463
+ * Only active validators may propose. The node rejects proposals whose
464
+ * `proposedParameters` violate safety bounds (≤50% change, absolute
465
+ * floor/ceiling) or overlap keys with other pending/activating proposals.
466
+ *
467
+ * @param params.proposalId - UUID. Also used as lexicographic activation-order tiebreaker.
468
+ * @param params.proposedParameters - Subset of NetworkParameters to change.
469
+ * @param params.rationale - Human-readable reason, ≤1024 bytes.
470
+ * @param params.effectiveAtBlock - Activation block. Must be ≥ tallyBlock + grace period.
471
+ */
472
+ async proposeNetworkUpgrade(params, demos) {
473
+ required(demos.keypair, "Wallet not connected");
474
+ const trimmedProposalId = params?.proposalId?.trim();
475
+ required(trimmedProposalId, "proposalId is required");
476
+ required(params?.rationale != null && typeof params.rationale === "string", "rationale is required (use empty string if none)");
477
+ if (typeof params?.effectiveAtBlock !== "number" ||
478
+ !Number.isInteger(params.effectiveAtBlock) ||
479
+ params.effectiveAtBlock < 0) {
480
+ throw new Error("effectiveAtBlock must be a non-negative integer block number");
481
+ }
482
+ if (!params?.proposedParameters ||
483
+ typeof params.proposedParameters !== "object" ||
484
+ Array.isArray(params.proposedParameters)) {
485
+ throw new Error("proposedParameters must be a non-empty plain object");
486
+ }
487
+ // Drop undefined-valued keys before counting + signing — JSON.stringify
488
+ // would silently strip them, so a tx with only-undefined values would
489
+ // sign as `{}` and get rejected at the node.
490
+ // Preserves Partial<NetworkParameters> typing for downstream consumers.
491
+ const cleanedParams = Object.fromEntries(Object.entries(params.proposedParameters)
492
+ .filter(([, v]) => v !== undefined));
493
+ if (Object.keys(cleanedParams).length === 0) {
494
+ throw new Error("proposedParameters must contain at least one defined value");
495
+ }
496
+ const tx = DemosTransactions.empty();
497
+ const { publicKey } = await demos.crypto.getIdentity("ed25519");
498
+ const publicKeyHex = uint8ArrayToHex(publicKey);
499
+ const nonce = await demos.getAddressNonce(publicKeyHex);
500
+ tx.content.to = publicKeyHex;
501
+ tx.content.nonce = nonce + 1;
502
+ tx.content.amount = 0;
503
+ tx.content.type = "networkUpgrade";
504
+ tx.content.timestamp = Date.now();
505
+ // Sign the trimmed/cleaned values — keep the wire format consistent
506
+ // with what the validation guards above accepted.
507
+ tx.content.data = [
508
+ "networkUpgrade",
509
+ {
510
+ proposalId: trimmedProposalId,
511
+ proposedParameters: cleanedParams,
512
+ rationale: params.rationale,
513
+ effectiveAtBlock: params.effectiveAtBlock,
514
+ },
515
+ ];
516
+ return await demos.sign(tx);
517
+ },
518
+ /**
519
+ * Create a signed `networkUpgradeVote` transaction.
520
+ *
521
+ * The voter must be in the validator snapshot taken at the proposal's
522
+ * confirmation block, and may cast exactly one vote per proposal (final,
523
+ * non-revocable).
524
+ */
525
+ async voteOnUpgrade(proposalId, approve, demos) {
526
+ required(demos.keypair, "Wallet not connected");
527
+ const trimmedProposalId = proposalId?.trim();
528
+ required(trimmedProposalId, "proposalId is required");
529
+ if (typeof approve !== "boolean") {
530
+ throw new Error("approve must be a boolean (true=yes, false=no)");
531
+ }
532
+ const tx = DemosTransactions.empty();
533
+ const { publicKey } = await demos.crypto.getIdentity("ed25519");
534
+ const publicKeyHex = uint8ArrayToHex(publicKey);
535
+ const nonce = await demos.getAddressNonce(publicKeyHex);
536
+ tx.content.to = publicKeyHex;
537
+ tx.content.nonce = nonce + 1;
538
+ tx.content.amount = 0;
539
+ tx.content.type = "networkUpgradeVote";
540
+ tx.content.timestamp = Date.now();
541
+ tx.content.data = [
542
+ "networkUpgradeVote",
543
+ { proposalId: trimmedProposalId, approve },
544
+ ];
545
+ return await demos.sign(tx);
546
+ },
261
547
  };
262
548
  //# sourceMappingURL=DemosTransactions.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"DemosTransactions.js","sourceRoot":"","sources":["../../../src/websdk/DemosTransactions.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAA;AACvC,OAAO,KAAK,SAAS,MAAM,mBAAmB,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CAAC,OAAO,CAAC,IAAI,GAAG;YACd,oBAAoB;YACpB,EAAE,UAAU,EAAE,iBAAiB,EAAE,OAAO,EAAE;SAC7C,CAAA;QAED,OAAO,MAAM,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;IAC/B,CAAC;CACJ,CAAA"}
@@ -6,6 +6,7 @@ import { Transaction } from "../types/blockchain/Transaction";
6
6
  * Note that the node will be responsible for checking if the gas can be paid.
7
7
  */
8
8
  export declare class GCRGeneration {
9
+ private static requirePayload;
9
10
  static generate(tx: Transaction, isRollback?: boolean): Promise<GCREdit[]>;
10
11
  static createGasEdit(account: string, txHash: string, isRollback?: boolean, gasAmount?: number): Promise<GCREdit>;
11
12
  /**