@kaspacom/kcc20-tx-builder 0.4.0 → 0.5.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/CHANGELOG.md +6 -1
- package/README.md +2 -2
- package/RELEASING.md +3 -3
- package/dist/cjs/snapshot-operation.d.ts +0 -1
- package/dist/cjs/snapshot-operation.js +1 -1126
- package/dist/cjs/snapshot-operation.js.map +1 -1
- package/dist/cjs/snapshot-signerless-transactions.d.ts +1 -1
- package/dist/cjs/snapshot-signerless-transactions.js +1 -1
- package/dist/cjs/snapshot-signerless-transactions.js.map +1 -1
- package/dist/cjs/snapshot-verification.d.ts +1 -1
- package/dist/cjs/snapshot-verification.js +16 -12
- package/dist/cjs/snapshot-verification.js.map +1 -1
- package/dist/snapshot-operation.d.ts +0 -1
- package/dist/snapshot-operation.d.ts.map +1 -1
- package/dist/snapshot-operation.js +0 -1125
- package/dist/snapshot-operation.js.map +1 -1
- package/dist/snapshot-signerless-transactions.d.ts +1 -1
- package/dist/snapshot-signerless-transactions.d.ts.map +1 -1
- package/dist/snapshot-signerless-transactions.js +1 -1
- package/dist/snapshot-signerless-transactions.js.map +1 -1
- package/dist/snapshot-verification.d.ts +1 -1
- package/dist/snapshot-verification.d.ts.map +1 -1
- package/dist/snapshot-verification.js +16 -12
- package/dist/snapshot-verification.js.map +1 -1
- package/docs/API.md +1 -1
- package/docs/COMPATIBILITY.json +2 -2
- package/docs/INTEGRATION.md +2 -2
- package/examples/README.md +2 -2
- package/package.json +1 -1
- package/src/snapshot-operation.ts +59 -1731
- package/src/snapshot-signerless-transactions.ts +1 -1
- package/src/snapshot-verification.ts +17 -13
|
@@ -1,20 +1,23 @@
|
|
|
1
1
|
import { prepareSnapshotDeployment, type SnapshotArtifacts, type SnapshotDeploymentDefinition } from './snapshot-deployment.js';
|
|
2
|
-
import { bytesToHex } from './encoding.js';
|
|
3
2
|
import * as tx from './snapshot-signerless-transactions.js';
|
|
4
3
|
|
|
5
|
-
export function snapshotStartPayload(definition: SnapshotDeploymentDefinition, prepared: ReturnType<typeof prepareSnapshotDeployment>):
|
|
4
|
+
export function snapshotStartPayload(definition: SnapshotDeploymentDefinition, prepared: ReturnType<typeof prepareSnapshotDeployment>): Uint8Array {
|
|
6
5
|
const plan = prepared.plan;
|
|
7
6
|
if (prepared.stage !== 'snapshot-start') throw new Error('snapshot start plan required');
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
7
|
+
return tx.buildSnapshotKcc20DeploymentPayload({
|
|
8
|
+
creator: definition.creator,
|
|
9
|
+
ticker: definition.ticker,
|
|
10
|
+
name: definition.ticker,
|
|
11
|
+
displayScale: definition.displayScale,
|
|
12
|
+
totalSupply: definition.totalSupply,
|
|
13
|
+
holderExtensionCommitment: prepared.holderExtensionCommitment,
|
|
14
|
+
migrationId: definition.migrationId,
|
|
15
|
+
manifestCommitment: definition.manifestCommitment,
|
|
16
|
+
reserves: plan.reserves,
|
|
17
|
+
treasury: definition.creator,
|
|
18
|
+
protocolFeeRecipient: definition.creator,
|
|
19
|
+
protocolFeeBps: 0,
|
|
20
|
+
});
|
|
18
21
|
}
|
|
19
22
|
|
|
20
23
|
/** Reconstruct the whole transaction from approved definition and pinned artifacts. */
|
|
@@ -59,7 +62,8 @@ export function verifySnapshotDeploymentTransaction(kw: any, args: {
|
|
|
59
62
|
throw new Error('snapshot bootstrap input differs from approved genesis');
|
|
60
63
|
}
|
|
61
64
|
expected = tx.buildSnapshotStartUnsignedTransaction(kw, {
|
|
62
|
-
...common,
|
|
65
|
+
...common,
|
|
66
|
+
payload: snapshotStartPayload(args.definition, prepared),
|
|
63
67
|
bootstrapInput,
|
|
64
68
|
controllerInputs: plan.controllers.map((controller: any, index: number) => {
|
|
65
69
|
const actual = input(index + 1, tx.buildSnapshotControllerScriptForState(args.artifacts.controllerArtifact, controller.stateBefore));
|