algosdk 3.7.0-beta.1 → 3.8.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/README.md +4 -4
- package/dist/browser/algosdk.min.js +1 -1
- package/dist/browser/algosdk.min.js.map +1 -1
- package/dist/cjs/appAccess.js +4 -0
- package/dist/cjs/appAccess.js.map +1 -1
- package/dist/cjs/client/v2/algod/getPeers.js +20 -0
- package/dist/cjs/client/v2/algod/getPeers.js.map +1 -0
- package/dist/cjs/client/v2/algod/models/types.js +153 -5
- package/dist/cjs/client/v2/algod/models/types.js.map +1 -1
- package/dist/cjs/client/v2/indexer/models/types.js +163 -12
- package/dist/cjs/client/v2/indexer/models/types.js.map +1 -1
- package/dist/cjs/composer.js +4 -6
- package/dist/cjs/composer.js.map +1 -1
- package/dist/cjs/ed25519-signer.js +18 -0
- package/dist/cjs/ed25519-signer.js.map +1 -1
- package/dist/cjs/encoding/address.js +9 -0
- package/dist/cjs/encoding/address.js.map +1 -1
- package/dist/cjs/falcon-signer.js +16 -0
- package/dist/cjs/falcon-signer.js.map +1 -1
- package/dist/cjs/heartbeat.js +7 -0
- package/dist/cjs/heartbeat.js.map +1 -1
- package/dist/cjs/logicsig.js +86 -6
- package/dist/cjs/logicsig.js.map +1 -1
- package/dist/cjs/makeTxn.js +11 -2
- package/dist/cjs/makeTxn.js.map +1 -1
- package/dist/cjs/mnemonic/mnemonic.js +2 -0
- package/dist/cjs/mnemonic/mnemonic.js.map +1 -1
- package/dist/cjs/pq-signer.js +51 -0
- package/dist/cjs/pq-signer.js.map +1 -1
- package/dist/cjs/signer.js.map +1 -1
- package/dist/cjs/signing.js +22 -0
- package/dist/cjs/signing.js.map +1 -1
- package/dist/cjs/transaction.js +8 -0
- package/dist/cjs/transaction.js.map +1 -1
- package/dist/cjs/types/block.js +28 -0
- package/dist/cjs/types/block.js.map +1 -1
- package/dist/cjs/types/statedelta.js +17 -0
- package/dist/cjs/types/statedelta.js.map +1 -1
- package/dist/cjs/utils/utils.js +14 -1
- package/dist/cjs/utils/utils.js.map +1 -1
- package/dist/esm/appAccess.js +4 -0
- package/dist/esm/appAccess.js.map +1 -1
- package/dist/esm/client/v2/algod/getPeers.js +14 -0
- package/dist/esm/client/v2/algod/getPeers.js.map +1 -0
- package/dist/esm/client/v2/algod/models/types.js +149 -3
- package/dist/esm/client/v2/algod/models/types.js.map +1 -1
- package/dist/esm/client/v2/indexer/models/types.js +161 -11
- package/dist/esm/client/v2/indexer/models/types.js.map +1 -1
- package/dist/esm/composer.js +4 -6
- package/dist/esm/composer.js.map +1 -1
- package/dist/esm/ed25519-signer.js +18 -0
- package/dist/esm/ed25519-signer.js.map +1 -1
- package/dist/esm/encoding/address.js +9 -0
- package/dist/esm/encoding/address.js.map +1 -1
- package/dist/esm/falcon-signer.js +16 -0
- package/dist/esm/falcon-signer.js.map +1 -1
- package/dist/esm/heartbeat.js +8 -1
- package/dist/esm/heartbeat.js.map +1 -1
- package/dist/esm/logicsig.js +86 -6
- package/dist/esm/logicsig.js.map +1 -1
- package/dist/esm/makeTxn.js +11 -2
- package/dist/esm/makeTxn.js.map +1 -1
- package/dist/esm/mnemonic/mnemonic.js +2 -0
- package/dist/esm/mnemonic/mnemonic.js.map +1 -1
- package/dist/esm/pq-signer.js +51 -0
- package/dist/esm/pq-signer.js.map +1 -1
- package/dist/esm/signer.js.map +1 -1
- package/dist/esm/signing.js +22 -0
- package/dist/esm/signing.js.map +1 -1
- package/dist/esm/transaction.js +8 -0
- package/dist/esm/transaction.js.map +1 -1
- package/dist/esm/types/block.js +28 -0
- package/dist/esm/types/block.js.map +1 -1
- package/dist/esm/types/statedelta.js +17 -0
- package/dist/esm/types/statedelta.js.map +1 -1
- package/dist/esm/utils/utils.js +12 -0
- package/dist/esm/utils/utils.js.map +1 -1
- package/dist/types/client/v2/algod/getPeers.d.ts +7 -0
- package/dist/types/client/v2/algod/models/types.d.ts +90 -3
- package/dist/types/client/v2/indexer/models/types.d.ts +114 -7
- package/dist/types/composer.d.ts +3 -3
- package/dist/types/ed25519-signer.d.ts +29 -0
- package/dist/types/encoding/address.d.ts +9 -0
- package/dist/types/falcon-signer.d.ts +29 -2
- package/dist/types/heartbeat.d.ts +2 -0
- package/dist/types/logicsig.d.ts +91 -6
- package/dist/types/makeTxn.d.ts +8 -2
- package/dist/types/mnemonic/mnemonic.d.ts +2 -0
- package/dist/types/pq-signer.d.ts +39 -2
- package/dist/types/signer.d.ts +76 -5
- package/dist/types/signing.d.ts +22 -0
- package/dist/types/transaction.d.ts +1 -0
- package/dist/types/types/block.d.ts +22 -0
- package/dist/types/types/statedelta.d.ts +18 -0
- package/dist/types/types/transactions/base.d.ts +10 -0
- package/dist/types/utils/utils.d.ts +1 -0
- package/package.json +2 -2
- package/src/appAccess.ts +5 -0
- package/src/client/v2/algod/models/types.ts +234 -0
- package/src/client/v2/indexer/models/types.ts +280 -8
- package/src/composer.ts +7 -11
- package/src/ed25519-signer.ts +29 -0
- package/src/encoding/address.ts +9 -0
- package/src/falcon-signer.ts +31 -1
- package/src/heartbeat.ts +11 -0
- package/src/logicsig.ts +93 -6
- package/src/makeTxn.ts +13 -4
- package/src/mnemonic/mnemonic.ts +2 -0
- package/src/pq-signer.ts +71 -1
- package/src/signer.ts +77 -5
- package/src/signing.ts +22 -0
- package/src/transaction.ts +10 -0
- package/src/types/block.ts +54 -0
- package/src/types/statedelta.ts +34 -0
- package/src/types/transactions/base.ts +11 -0
- package/src/utils/utils.ts +13 -0
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.StateProofVerifier = exports.StateProofTracking = exports.StateProofSignature = exports.StateProofSigSlot = exports.StateProofReveal = exports.StateProofParticipant = exports.StateProofFields = exports.ResourceRef = exports.ParticipationUpdates = exports.MiniAssetHolding = exports.MerkleArrayProof = exports.LocalsRef = exports.IndexerStateProofMessage = exports.HoldingRef = exports.HealthCheck = exports.HbProofFields = exports.HashFactory = exports.EvalDeltaKeyValue = exports.EvalDelta = exports.ErrorResponse = exports.BoxesResponse = exports.BoxReference = exports.BoxDescriptor = exports.Box = exports.BlockUpgradeVote = exports.BlockUpgradeState = exports.BlockRewards = exports.BlockHeadersResponse = exports.Block = exports.AssetsResponse = exports.AssetResponse = exports.AssetParams = exports.AssetHoldingsResponse = exports.AssetHolding = exports.AssetBalancesResponse = exports.Asset = exports.ApplicationsResponse = exports.ApplicationStateSchema = exports.ApplicationResponse = exports.ApplicationParams = exports.ApplicationLogsResponse = exports.ApplicationLogData = exports.ApplicationLocalStatesResponse = exports.ApplicationLocalState = exports.Application = exports.AccountsResponse = exports.AccountStateDelta = exports.AccountResponse = exports.AccountParticipation = exports.Account = void 0;
|
|
7
|
-
exports.TransactionsResponse = exports.TransactionStateProof = exports.TransactionSignatureMultisigSubsignature = exports.TransactionSignatureMultisig = exports.TransactionSignatureLogicsig = exports.TransactionSignature = exports.TransactionResponse = exports.TransactionPayment = exports.TransactionKeyreg = exports.TransactionHeartbeat = exports.TransactionAssetTransfer = exports.TransactionAssetFreeze = exports.TransactionAssetConfig = exports.TransactionApplication = exports.Transaction = exports.TealValue = exports.TealKeyValue = exports.StateSchema = void 0;
|
|
7
|
+
exports.TransactionsResponse = exports.TransactionStateProof = exports.TransactionSignaturePQsig = exports.TransactionSignatureMultisigSubsignature = exports.TransactionSignatureMultisig = exports.TransactionSignatureLogicsig = exports.TransactionSignature = exports.TransactionResponse = exports.TransactionPayment = exports.TransactionKeyreg = exports.TransactionHeartbeat = exports.TransactionAssetTransfer = exports.TransactionAssetFreeze = exports.TransactionAssetConfig = exports.TransactionApplication = exports.Transaction = exports.TealValue = exports.TealKeyValue = exports.StateSchema = void 0;
|
|
8
8
|
/* eslint-disable no-use-before-define */
|
|
9
9
|
const utils_js_1 = require("../../../../utils/utils.js");
|
|
10
10
|
const index_js_1 = require("../../../../encoding/schema/index.js");
|
|
@@ -180,6 +180,7 @@ class Account {
|
|
|
180
180
|
* * sig
|
|
181
181
|
* * msig
|
|
182
182
|
* * lsig
|
|
183
|
+
* * pqsig
|
|
183
184
|
* * or null if unknown
|
|
184
185
|
*/
|
|
185
186
|
constructor({ address, amount, amountWithoutPendingRewards, minBalance, pendingRewards, rewards, round, status, totalAppsOptedIn, totalAssetsOptedIn, totalBoxBytes, totalBoxes, totalCreatedApps, totalCreatedAssets, appsLocalState, appsTotalExtraPages, appsTotalSchema, assets, authAddr, closedAtRound, createdApps, createdAssets, createdAtRound, deleted, incentiveEligible, lastHeartbeat, lastProposed, participation, rewardBase, sigType, }) {
|
|
@@ -1818,10 +1819,18 @@ class Block {
|
|
|
1818
1819
|
key: 'bonus',
|
|
1819
1820
|
valueSchema: new index_js_1.OptionalSchema(new index_js_1.Uint64Schema()),
|
|
1820
1821
|
omitEmpty: true,
|
|
1822
|
+
}, {
|
|
1823
|
+
key: 'congestion-tax',
|
|
1824
|
+
valueSchema: new index_js_1.OptionalSchema(new index_js_1.Uint64Schema()),
|
|
1825
|
+
omitEmpty: true,
|
|
1821
1826
|
}, {
|
|
1822
1827
|
key: 'fees-collected',
|
|
1823
1828
|
valueSchema: new index_js_1.OptionalSchema(new index_js_1.Uint64Schema()),
|
|
1824
1829
|
omitEmpty: true,
|
|
1830
|
+
}, {
|
|
1831
|
+
key: 'load',
|
|
1832
|
+
valueSchema: new index_js_1.OptionalSchema(new index_js_1.Uint64Schema()),
|
|
1833
|
+
omitEmpty: true,
|
|
1825
1834
|
}, {
|
|
1826
1835
|
key: 'participation-updates',
|
|
1827
1836
|
valueSchema: new index_js_1.OptionalSchema(ParticipationUpdates.encodingSchema),
|
|
@@ -1889,7 +1898,12 @@ class Block {
|
|
|
1889
1898
|
* the default SHA512_256. This commitment can be used on environments where only
|
|
1890
1899
|
* the SHA256 function exists.
|
|
1891
1900
|
* @param bonus - the potential bonus payout for this block.
|
|
1901
|
+
* @param congestionTax - the fee required, beyond the minimum fee, for "normal" transactions in this
|
|
1902
|
+
* block.
|
|
1892
1903
|
* @param feesCollected - the sum of all fees paid by transactions in this block.
|
|
1904
|
+
* @param load - the degree to which this block is full, based on the number of bytes in the
|
|
1905
|
+
* final block compared to the maximum allowed. Expressed as a fixed-point integer
|
|
1906
|
+
* with 6 digits of precision, so 1,000,000 is a completely full block.
|
|
1893
1907
|
* @param participationUpdates - Participation account data that needs to be checked/acted on by the network.
|
|
1894
1908
|
* @param previousBlockHash512 - (prev512) Previous block hash, using SHA-512.
|
|
1895
1909
|
* @param proposer - the proposer of this block.
|
|
@@ -1908,7 +1922,7 @@ class Block {
|
|
|
1908
1922
|
* @param upgradeState - Fields relating to a protocol upgrade.
|
|
1909
1923
|
* @param upgradeVote - Fields relating to voting for a protocol upgrade.
|
|
1910
1924
|
*/
|
|
1911
|
-
constructor({ genesisHash, genesisId, previousBlockHash, round, seed, timestamp, transactionsRoot, transactionsRootSha256, bonus, feesCollected, participationUpdates, previousBlockHash512, proposer, proposerPayout, rewards, stateProofTracking, transactions, transactionsRootSha512, txnCounter, upgradeState, upgradeVote, }) {
|
|
1925
|
+
constructor({ genesisHash, genesisId, previousBlockHash, round, seed, timestamp, transactionsRoot, transactionsRootSha256, bonus, congestionTax, feesCollected, load, participationUpdates, previousBlockHash512, proposer, proposerPayout, rewards, stateProofTracking, transactions, transactionsRootSha512, txnCounter, upgradeState, upgradeVote, }) {
|
|
1912
1926
|
this.genesisHash =
|
|
1913
1927
|
typeof genesisHash === 'string'
|
|
1914
1928
|
? (0, binarydata_js_1.base64ToBytes)(genesisHash)
|
|
@@ -1931,10 +1945,16 @@ class Block {
|
|
|
1931
1945
|
: transactionsRootSha256;
|
|
1932
1946
|
this.bonus =
|
|
1933
1947
|
typeof bonus === 'undefined' ? undefined : (0, utils_js_1.ensureSafeInteger)(bonus);
|
|
1948
|
+
this.congestionTax =
|
|
1949
|
+
typeof congestionTax === 'undefined'
|
|
1950
|
+
? undefined
|
|
1951
|
+
: (0, utils_js_1.ensureSafeInteger)(congestionTax);
|
|
1934
1952
|
this.feesCollected =
|
|
1935
1953
|
typeof feesCollected === 'undefined'
|
|
1936
1954
|
? undefined
|
|
1937
1955
|
: (0, utils_js_1.ensureSafeInteger)(feesCollected);
|
|
1956
|
+
this.load =
|
|
1957
|
+
typeof load === 'undefined' ? undefined : (0, utils_js_1.ensureSafeInteger)(load);
|
|
1938
1958
|
this.participationUpdates = participationUpdates;
|
|
1939
1959
|
this.previousBlockHash512 =
|
|
1940
1960
|
typeof previousBlockHash512 === 'string'
|
|
@@ -1975,7 +1995,9 @@ class Block {
|
|
|
1975
1995
|
['transactions-root', this.transactionsRoot],
|
|
1976
1996
|
['transactions-root-sha256', this.transactionsRootSha256],
|
|
1977
1997
|
['bonus', this.bonus],
|
|
1998
|
+
['congestion-tax', this.congestionTax],
|
|
1978
1999
|
['fees-collected', this.feesCollected],
|
|
2000
|
+
['load', this.load],
|
|
1979
2001
|
[
|
|
1980
2002
|
'participation-updates',
|
|
1981
2003
|
typeof this.participationUpdates !== 'undefined'
|
|
@@ -2038,7 +2060,9 @@ class Block {
|
|
|
2038
2060
|
transactionsRoot: data.get('transactions-root'),
|
|
2039
2061
|
transactionsRootSha256: data.get('transactions-root-sha256'),
|
|
2040
2062
|
bonus: data.get('bonus'),
|
|
2063
|
+
congestionTax: data.get('congestion-tax'),
|
|
2041
2064
|
feesCollected: data.get('fees-collected'),
|
|
2065
|
+
load: data.get('load'),
|
|
2042
2066
|
participationUpdates: typeof data.get('participation-updates') !== 'undefined'
|
|
2043
2067
|
? ParticipationUpdates.fromEncodingData(data.get('participation-updates'))
|
|
2044
2068
|
: undefined,
|
|
@@ -2399,15 +2423,15 @@ class Box {
|
|
|
2399
2423
|
}
|
|
2400
2424
|
exports.Box = Box;
|
|
2401
2425
|
/**
|
|
2402
|
-
* Box descriptor describes an app box
|
|
2426
|
+
* Box descriptor describes an app box.
|
|
2403
2427
|
*/
|
|
2404
2428
|
class BoxDescriptor {
|
|
2405
2429
|
static get encodingSchema() {
|
|
2406
2430
|
if (!this.encodingSchemaValue) {
|
|
2407
2431
|
this.encodingSchemaValue = new index_js_1.NamedMapSchema([]);
|
|
2408
|
-
this.encodingSchemaValue.pushEntries({
|
|
2409
|
-
key: '
|
|
2410
|
-
valueSchema: new index_js_1.ByteArraySchema(),
|
|
2432
|
+
this.encodingSchemaValue.pushEntries({ key: 'name', valueSchema: new index_js_1.ByteArraySchema(), omitEmpty: true }, {
|
|
2433
|
+
key: 'value',
|
|
2434
|
+
valueSchema: new index_js_1.OptionalSchema(new index_js_1.ByteArraySchema()),
|
|
2411
2435
|
omitEmpty: true,
|
|
2412
2436
|
});
|
|
2413
2437
|
}
|
|
@@ -2416,16 +2440,22 @@ class BoxDescriptor {
|
|
|
2416
2440
|
/**
|
|
2417
2441
|
* Creates a new `BoxDescriptor` object.
|
|
2418
2442
|
* @param name - Base64 encoded box name
|
|
2443
|
+
* @param value - Base64 encoded box value. Present only when the `values` query parameter is set
|
|
2444
|
+
* to true.
|
|
2419
2445
|
*/
|
|
2420
|
-
constructor({ name }) {
|
|
2446
|
+
constructor({ name, value, }) {
|
|
2421
2447
|
this.name = typeof name === 'string' ? (0, binarydata_js_1.base64ToBytes)(name) : name;
|
|
2448
|
+
this.value = typeof value === 'string' ? (0, binarydata_js_1.base64ToBytes)(value) : value;
|
|
2422
2449
|
}
|
|
2423
2450
|
// eslint-disable-next-line class-methods-use-this
|
|
2424
2451
|
getEncodingSchema() {
|
|
2425
2452
|
return BoxDescriptor.encodingSchema;
|
|
2426
2453
|
}
|
|
2427
2454
|
toEncodingData() {
|
|
2428
|
-
return new Map([
|
|
2455
|
+
return new Map([
|
|
2456
|
+
['name', this.name],
|
|
2457
|
+
['value', this.value],
|
|
2458
|
+
]);
|
|
2429
2459
|
}
|
|
2430
2460
|
static fromEncodingData(data) {
|
|
2431
2461
|
if (!(data instanceof Map)) {
|
|
@@ -2433,6 +2463,7 @@ class BoxDescriptor {
|
|
|
2433
2463
|
}
|
|
2434
2464
|
return new BoxDescriptor({
|
|
2435
2465
|
name: data.get('name'),
|
|
2466
|
+
value: data.get('value'),
|
|
2436
2467
|
});
|
|
2437
2468
|
}
|
|
2438
2469
|
}
|
|
@@ -2498,6 +2529,10 @@ class BoxesResponse {
|
|
|
2498
2529
|
key: 'next-token',
|
|
2499
2530
|
valueSchema: new index_js_1.OptionalSchema(new index_js_1.StringSchema()),
|
|
2500
2531
|
omitEmpty: true,
|
|
2532
|
+
}, {
|
|
2533
|
+
key: 'round',
|
|
2534
|
+
valueSchema: new index_js_1.OptionalSchema(new index_js_1.Uint64Schema()),
|
|
2535
|
+
omitEmpty: true,
|
|
2501
2536
|
});
|
|
2502
2537
|
}
|
|
2503
2538
|
return this.encodingSchemaValue;
|
|
@@ -2508,11 +2543,14 @@ class BoxesResponse {
|
|
|
2508
2543
|
* @param boxes -
|
|
2509
2544
|
* @param nextToken - Used for pagination, when making another request provide this token with the
|
|
2510
2545
|
* next parameter.
|
|
2546
|
+
* @param round - The round for which this information is relevant.
|
|
2511
2547
|
*/
|
|
2512
|
-
constructor({ applicationId, boxes, nextToken, }) {
|
|
2548
|
+
constructor({ applicationId, boxes, nextToken, round, }) {
|
|
2513
2549
|
this.applicationId = (0, utils_js_1.ensureBigInt)(applicationId);
|
|
2514
2550
|
this.boxes = boxes;
|
|
2515
2551
|
this.nextToken = nextToken;
|
|
2552
|
+
this.round =
|
|
2553
|
+
typeof round === 'undefined' ? undefined : (0, utils_js_1.ensureSafeInteger)(round);
|
|
2516
2554
|
}
|
|
2517
2555
|
// eslint-disable-next-line class-methods-use-this
|
|
2518
2556
|
getEncodingSchema() {
|
|
@@ -2523,6 +2561,7 @@ class BoxesResponse {
|
|
|
2523
2561
|
['application-id', this.applicationId],
|
|
2524
2562
|
['boxes', this.boxes.map((v) => v.toEncodingData())],
|
|
2525
2563
|
['next-token', this.nextToken],
|
|
2564
|
+
['round', this.round],
|
|
2526
2565
|
]);
|
|
2527
2566
|
}
|
|
2528
2567
|
static fromEncodingData(data) {
|
|
@@ -2533,6 +2572,7 @@ class BoxesResponse {
|
|
|
2533
2572
|
applicationId: data.get('application-id'),
|
|
2534
2573
|
boxes: (data.get('boxes') ?? []).map((v) => BoxDescriptor.fromEncodingData(v)),
|
|
2535
2574
|
nextToken: data.get('next-token'),
|
|
2575
|
+
round: data.get('round'),
|
|
2536
2576
|
});
|
|
2537
2577
|
}
|
|
2538
2578
|
}
|
|
@@ -4921,6 +4961,10 @@ class TransactionHeartbeat {
|
|
|
4921
4961
|
key: 'hb-vote-id',
|
|
4922
4962
|
valueSchema: new index_js_1.ByteArraySchema(),
|
|
4923
4963
|
omitEmpty: true,
|
|
4964
|
+
}, {
|
|
4965
|
+
key: 'hb-challenge-discount',
|
|
4966
|
+
valueSchema: new index_js_1.OptionalSchema(new index_js_1.BooleanSchema()),
|
|
4967
|
+
omitEmpty: true,
|
|
4924
4968
|
});
|
|
4925
4969
|
}
|
|
4926
4970
|
return this.encodingSchemaValue;
|
|
@@ -4934,14 +4978,18 @@ class TransactionHeartbeat {
|
|
|
4934
4978
|
* @param hbSeed - (hbsd) HbSeed must be the block seed for the this transaction's firstValid
|
|
4935
4979
|
* block.
|
|
4936
4980
|
* @param hbVoteId - (hbvid) HbVoteID must match the HbAddress account's current VoteID.
|
|
4981
|
+
* @param hbChallengeDiscount - (hbc) HbChallengeDiscount requests the challenge fee discount, reducing the
|
|
4982
|
+
* required fee by one min fee. It is a request, not an assertion: it is granted
|
|
4983
|
+
* only if HbAddress is actually under challenge.
|
|
4937
4984
|
*/
|
|
4938
|
-
constructor({ hbAddress, hbKeyDilution, hbProof, hbSeed, hbVoteId, }) {
|
|
4985
|
+
constructor({ hbAddress, hbKeyDilution, hbProof, hbSeed, hbVoteId, hbChallengeDiscount, }) {
|
|
4939
4986
|
this.hbAddress = hbAddress;
|
|
4940
4987
|
this.hbKeyDilution = (0, utils_js_1.ensureBigInt)(hbKeyDilution);
|
|
4941
4988
|
this.hbProof = hbProof;
|
|
4942
4989
|
this.hbSeed = typeof hbSeed === 'string' ? (0, binarydata_js_1.base64ToBytes)(hbSeed) : hbSeed;
|
|
4943
4990
|
this.hbVoteId =
|
|
4944
4991
|
typeof hbVoteId === 'string' ? (0, binarydata_js_1.base64ToBytes)(hbVoteId) : hbVoteId;
|
|
4992
|
+
this.hbChallengeDiscount = hbChallengeDiscount;
|
|
4945
4993
|
}
|
|
4946
4994
|
// eslint-disable-next-line class-methods-use-this
|
|
4947
4995
|
getEncodingSchema() {
|
|
@@ -4954,6 +5002,7 @@ class TransactionHeartbeat {
|
|
|
4954
5002
|
['hb-proof', this.hbProof.toEncodingData()],
|
|
4955
5003
|
['hb-seed', this.hbSeed],
|
|
4956
5004
|
['hb-vote-id', this.hbVoteId],
|
|
5005
|
+
['hb-challenge-discount', this.hbChallengeDiscount],
|
|
4957
5006
|
]);
|
|
4958
5007
|
}
|
|
4959
5008
|
static fromEncodingData(data) {
|
|
@@ -4966,6 +5015,7 @@ class TransactionHeartbeat {
|
|
|
4966
5015
|
hbProof: HbProofFields.fromEncodingData(data.get('hb-proof') ?? new Map()),
|
|
4967
5016
|
hbSeed: data.get('hb-seed'),
|
|
4968
5017
|
hbVoteId: data.get('hb-vote-id'),
|
|
5018
|
+
hbChallengeDiscount: data.get('hb-challenge-discount'),
|
|
4969
5019
|
});
|
|
4970
5020
|
}
|
|
4971
5021
|
}
|
|
@@ -5213,6 +5263,10 @@ class TransactionSignature {
|
|
|
5213
5263
|
key: 'multisig',
|
|
5214
5264
|
valueSchema: new index_js_1.OptionalSchema(TransactionSignatureMultisig.encodingSchema),
|
|
5215
5265
|
omitEmpty: true,
|
|
5266
|
+
}, {
|
|
5267
|
+
key: 'pqsig',
|
|
5268
|
+
valueSchema: new index_js_1.OptionalSchema(TransactionSignaturePQsig.encodingSchema),
|
|
5269
|
+
omitEmpty: true,
|
|
5216
5270
|
}, {
|
|
5217
5271
|
key: 'sig',
|
|
5218
5272
|
valueSchema: new index_js_1.OptionalSchema(new index_js_1.ByteArraySchema()),
|
|
@@ -5229,11 +5283,15 @@ class TransactionSignature {
|
|
|
5229
5283
|
* @param multisig - structure holding multiple subsignatures.
|
|
5230
5284
|
* Definition:
|
|
5231
5285
|
* crypto/multisig.go : MultisigSig
|
|
5286
|
+
* @param pqsig - structure holding a post-quantum signature.
|
|
5287
|
+
* Definition:
|
|
5288
|
+
* data/transactions/pqsig.go : PQSig
|
|
5232
5289
|
* @param sig - (sig) Standard ed25519 signature.
|
|
5233
5290
|
*/
|
|
5234
|
-
constructor({ logicsig, multisig, sig, }) {
|
|
5291
|
+
constructor({ logicsig, multisig, pqsig, sig, }) {
|
|
5235
5292
|
this.logicsig = logicsig;
|
|
5236
5293
|
this.multisig = multisig;
|
|
5294
|
+
this.pqsig = pqsig;
|
|
5237
5295
|
this.sig = typeof sig === 'string' ? (0, binarydata_js_1.base64ToBytes)(sig) : sig;
|
|
5238
5296
|
}
|
|
5239
5297
|
// eslint-disable-next-line class-methods-use-this
|
|
@@ -5254,6 +5312,12 @@ class TransactionSignature {
|
|
|
5254
5312
|
? this.multisig.toEncodingData()
|
|
5255
5313
|
: undefined,
|
|
5256
5314
|
],
|
|
5315
|
+
[
|
|
5316
|
+
'pqsig',
|
|
5317
|
+
typeof this.pqsig !== 'undefined'
|
|
5318
|
+
? this.pqsig.toEncodingData()
|
|
5319
|
+
: undefined,
|
|
5320
|
+
],
|
|
5257
5321
|
['sig', this.sig],
|
|
5258
5322
|
]);
|
|
5259
5323
|
}
|
|
@@ -5268,6 +5332,9 @@ class TransactionSignature {
|
|
|
5268
5332
|
multisig: typeof data.get('multisig') !== 'undefined'
|
|
5269
5333
|
? TransactionSignatureMultisig.fromEncodingData(data.get('multisig'))
|
|
5270
5334
|
: undefined,
|
|
5335
|
+
pqsig: typeof data.get('pqsig') !== 'undefined'
|
|
5336
|
+
? TransactionSignaturePQsig.fromEncodingData(data.get('pqsig'))
|
|
5337
|
+
: undefined,
|
|
5271
5338
|
sig: data.get('sig'),
|
|
5272
5339
|
});
|
|
5273
5340
|
}
|
|
@@ -5294,6 +5361,10 @@ class TransactionSignatureLogicsig {
|
|
|
5294
5361
|
key: 'multisig-signature',
|
|
5295
5362
|
valueSchema: new index_js_1.OptionalSchema(TransactionSignatureMultisig.encodingSchema),
|
|
5296
5363
|
omitEmpty: true,
|
|
5364
|
+
}, {
|
|
5365
|
+
key: 'pqsig',
|
|
5366
|
+
valueSchema: new index_js_1.OptionalSchema(TransactionSignaturePQsig.encodingSchema),
|
|
5367
|
+
omitEmpty: true,
|
|
5297
5368
|
}, {
|
|
5298
5369
|
key: 'signature',
|
|
5299
5370
|
valueSchema: new index_js_1.OptionalSchema(new index_js_1.ByteArraySchema()),
|
|
@@ -5313,13 +5384,17 @@ class TransactionSignatureLogicsig {
|
|
|
5313
5384
|
* @param multisigSignature - structure holding multiple subsignatures.
|
|
5314
5385
|
* Definition:
|
|
5315
5386
|
* crypto/multisig.go : MultisigSig
|
|
5387
|
+
* @param pqsig - structure holding a post-quantum signature.
|
|
5388
|
+
* Definition:
|
|
5389
|
+
* data/transactions/pqsig.go : PQSig
|
|
5316
5390
|
* @param signature - (sig) ed25519 signature.
|
|
5317
5391
|
*/
|
|
5318
|
-
constructor({ logic, args, logicMultisigSignature, multisigSignature, signature, }) {
|
|
5392
|
+
constructor({ logic, args, logicMultisigSignature, multisigSignature, pqsig, signature, }) {
|
|
5319
5393
|
this.logic = typeof logic === 'string' ? (0, binarydata_js_1.base64ToBytes)(logic) : logic;
|
|
5320
5394
|
this.args = args;
|
|
5321
5395
|
this.logicMultisigSignature = logicMultisigSignature;
|
|
5322
5396
|
this.multisigSignature = multisigSignature;
|
|
5397
|
+
this.pqsig = pqsig;
|
|
5323
5398
|
this.signature =
|
|
5324
5399
|
typeof signature === 'string' ? (0, binarydata_js_1.base64ToBytes)(signature) : signature;
|
|
5325
5400
|
}
|
|
@@ -5343,6 +5418,12 @@ class TransactionSignatureLogicsig {
|
|
|
5343
5418
|
? this.multisigSignature.toEncodingData()
|
|
5344
5419
|
: undefined,
|
|
5345
5420
|
],
|
|
5421
|
+
[
|
|
5422
|
+
'pqsig',
|
|
5423
|
+
typeof this.pqsig !== 'undefined'
|
|
5424
|
+
? this.pqsig.toEncodingData()
|
|
5425
|
+
: undefined,
|
|
5426
|
+
],
|
|
5346
5427
|
['signature', this.signature],
|
|
5347
5428
|
]);
|
|
5348
5429
|
}
|
|
@@ -5359,6 +5440,9 @@ class TransactionSignatureLogicsig {
|
|
|
5359
5440
|
multisigSignature: typeof data.get('multisig-signature') !== 'undefined'
|
|
5360
5441
|
? TransactionSignatureMultisig.fromEncodingData(data.get('multisig-signature'))
|
|
5361
5442
|
: undefined,
|
|
5443
|
+
pqsig: typeof data.get('pqsig') !== 'undefined'
|
|
5444
|
+
? TransactionSignaturePQsig.fromEncodingData(data.get('pqsig'))
|
|
5445
|
+
: undefined,
|
|
5362
5446
|
signature: data.get('signature'),
|
|
5363
5447
|
});
|
|
5364
5448
|
}
|
|
@@ -5484,6 +5568,73 @@ class TransactionSignatureMultisigSubsignature {
|
|
|
5484
5568
|
}
|
|
5485
5569
|
}
|
|
5486
5570
|
exports.TransactionSignatureMultisigSubsignature = TransactionSignatureMultisigSubsignature;
|
|
5571
|
+
/**
|
|
5572
|
+
* structure holding a post-quantum signature.
|
|
5573
|
+
* Definition:
|
|
5574
|
+
* data/transactions/pqsig.go : PQSig
|
|
5575
|
+
*/
|
|
5576
|
+
class TransactionSignaturePQsig {
|
|
5577
|
+
static get encodingSchema() {
|
|
5578
|
+
if (!this.encodingSchemaValue) {
|
|
5579
|
+
this.encodingSchemaValue = new index_js_1.NamedMapSchema([]);
|
|
5580
|
+
this.encodingSchemaValue.pushEntries({
|
|
5581
|
+
key: 'public-key',
|
|
5582
|
+
valueSchema: new index_js_1.ByteArraySchema(),
|
|
5583
|
+
omitEmpty: true,
|
|
5584
|
+
}, { key: 'scheme', valueSchema: new index_js_1.StringSchema(), omitEmpty: true }, {
|
|
5585
|
+
key: 'signature',
|
|
5586
|
+
valueSchema: new index_js_1.ByteArraySchema(),
|
|
5587
|
+
omitEmpty: true,
|
|
5588
|
+
}, {
|
|
5589
|
+
key: 'salt',
|
|
5590
|
+
valueSchema: new index_js_1.OptionalSchema(new index_js_1.Uint64Schema()),
|
|
5591
|
+
omitEmpty: true,
|
|
5592
|
+
});
|
|
5593
|
+
}
|
|
5594
|
+
return this.encodingSchemaValue;
|
|
5595
|
+
}
|
|
5596
|
+
/**
|
|
5597
|
+
* Creates a new `TransactionSignaturePQsig` object.
|
|
5598
|
+
* @param publicKey - (pk)
|
|
5599
|
+
* @param scheme - (sch) identifies the internal signature scheme.
|
|
5600
|
+
* @param signature - (sig)
|
|
5601
|
+
* @param salt - (slt) a single byte, added to ensure the hashed address is not an Ed25519 curve
|
|
5602
|
+
* point
|
|
5603
|
+
*/
|
|
5604
|
+
constructor({ publicKey, scheme, signature, salt, }) {
|
|
5605
|
+
this.publicKey =
|
|
5606
|
+
typeof publicKey === 'string' ? (0, binarydata_js_1.base64ToBytes)(publicKey) : publicKey;
|
|
5607
|
+
this.scheme = scheme;
|
|
5608
|
+
this.signature =
|
|
5609
|
+
typeof signature === 'string' ? (0, binarydata_js_1.base64ToBytes)(signature) : signature;
|
|
5610
|
+
this.salt =
|
|
5611
|
+
typeof salt === 'undefined' ? undefined : (0, utils_js_1.ensureSafeInteger)(salt);
|
|
5612
|
+
}
|
|
5613
|
+
// eslint-disable-next-line class-methods-use-this
|
|
5614
|
+
getEncodingSchema() {
|
|
5615
|
+
return TransactionSignaturePQsig.encodingSchema;
|
|
5616
|
+
}
|
|
5617
|
+
toEncodingData() {
|
|
5618
|
+
return new Map([
|
|
5619
|
+
['public-key', this.publicKey],
|
|
5620
|
+
['scheme', this.scheme],
|
|
5621
|
+
['signature', this.signature],
|
|
5622
|
+
['salt', this.salt],
|
|
5623
|
+
]);
|
|
5624
|
+
}
|
|
5625
|
+
static fromEncodingData(data) {
|
|
5626
|
+
if (!(data instanceof Map)) {
|
|
5627
|
+
throw new Error(`Invalid decoded TransactionSignaturePQsig: ${data}`);
|
|
5628
|
+
}
|
|
5629
|
+
return new TransactionSignaturePQsig({
|
|
5630
|
+
publicKey: data.get('public-key'),
|
|
5631
|
+
scheme: data.get('scheme'),
|
|
5632
|
+
signature: data.get('signature'),
|
|
5633
|
+
salt: data.get('salt'),
|
|
5634
|
+
});
|
|
5635
|
+
}
|
|
5636
|
+
}
|
|
5637
|
+
exports.TransactionSignaturePQsig = TransactionSignaturePQsig;
|
|
5487
5638
|
/**
|
|
5488
5639
|
* Fields for a state proof transaction.
|
|
5489
5640
|
* Definition:
|