@midnames/sdk 1.0.3 → 1.0.5
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/dist/provider.js +1 -1
- package/node_modules/@midnames/ns/package.json +14 -14
- package/package.json +13 -11
- package/node_modules/@midnames/ns/.env +0 -10
- package/node_modules/@midnames/ns/.env.example +0 -11
- package/node_modules/@midnames/ns/.turbo/turbo-build.log +0 -2
- package/node_modules/@midnames/ns/.turbo/turbo-test.log +0 -13
- package/node_modules/@midnames/ns/midnight-level-db/000005.ldb +0 -0
- package/node_modules/@midnames/ns/midnight-level-db/000008.ldb +0 -0
- package/node_modules/@midnames/ns/midnight-level-db/000011.ldb +0 -0
- package/node_modules/@midnames/ns/midnight-level-db/000014.ldb +0 -0
- package/node_modules/@midnames/ns/midnight-level-db/000019.ldb +0 -0
- package/node_modules/@midnames/ns/midnight-level-db/000024.ldb +0 -0
- package/node_modules/@midnames/ns/midnight-level-db/000031.ldb +0 -0
- package/node_modules/@midnames/ns/midnight-level-db/000034.ldb +0 -0
- package/node_modules/@midnames/ns/midnight-level-db/000037.ldb +0 -0
- package/node_modules/@midnames/ns/midnight-level-db/000040.ldb +0 -0
- package/node_modules/@midnames/ns/midnight-level-db/000045.ldb +0 -0
- package/node_modules/@midnames/ns/midnight-level-db/000050.ldb +0 -0
- package/node_modules/@midnames/ns/midnight-level-db/000059.ldb +0 -0
- package/node_modules/@midnames/ns/midnight-level-db/000064.ldb +0 -0
- package/node_modules/@midnames/ns/midnight-level-db/000069.ldb +0 -0
- package/node_modules/@midnames/ns/midnight-level-db/000074.ldb +0 -0
- package/node_modules/@midnames/ns/midnight-level-db/000083.ldb +0 -0
- package/node_modules/@midnames/ns/midnight-level-db/000088.ldb +0 -0
- package/node_modules/@midnames/ns/midnight-level-db/000093.ldb +0 -0
- package/node_modules/@midnames/ns/midnight-level-db/000098.ldb +0 -0
- package/node_modules/@midnames/ns/midnight-level-db/000107.ldb +0 -0
- package/node_modules/@midnames/ns/midnight-level-db/000112.ldb +0 -0
- package/node_modules/@midnames/ns/midnight-level-db/000121.ldb +0 -0
- package/node_modules/@midnames/ns/midnight-level-db/000126.ldb +0 -0
- package/node_modules/@midnames/ns/midnight-level-db/000135.ldb +0 -0
- package/node_modules/@midnames/ns/midnight-level-db/000140.ldb +0 -0
- package/node_modules/@midnames/ns/midnight-level-db/000149.ldb +0 -0
- package/node_modules/@midnames/ns/midnight-level-db/000154.ldb +0 -0
- package/node_modules/@midnames/ns/midnight-level-db/000163.ldb +0 -0
- package/node_modules/@midnames/ns/midnight-level-db/000168.ldb +0 -0
- package/node_modules/@midnames/ns/midnight-level-db/000177.ldb +0 -0
- package/node_modules/@midnames/ns/midnight-level-db/000182.ldb +0 -0
- package/node_modules/@midnames/ns/midnight-level-db/000187.ldb +0 -0
- package/node_modules/@midnames/ns/midnight-level-db/000192.ldb +0 -0
- package/node_modules/@midnames/ns/midnight-level-db/000201.ldb +0 -0
- package/node_modules/@midnames/ns/midnight-level-db/000206.ldb +0 -0
- package/node_modules/@midnames/ns/midnight-level-db/000215.ldb +0 -0
- package/node_modules/@midnames/ns/midnight-level-db/000220.ldb +0 -0
- package/node_modules/@midnames/ns/midnight-level-db/000229.ldb +0 -0
- package/node_modules/@midnames/ns/midnight-level-db/000234.ldb +0 -0
- package/node_modules/@midnames/ns/midnight-level-db/000243.ldb +0 -0
- package/node_modules/@midnames/ns/midnight-level-db/000248.ldb +0 -0
- package/node_modules/@midnames/ns/midnight-level-db/000257.ldb +0 -0
- package/node_modules/@midnames/ns/midnight-level-db/000262.ldb +0 -0
- package/node_modules/@midnames/ns/midnight-level-db/000271.ldb +0 -0
- package/node_modules/@midnames/ns/midnight-level-db/000276.ldb +0 -0
- package/node_modules/@midnames/ns/midnight-level-db/000281.ldb +0 -0
- package/node_modules/@midnames/ns/midnight-level-db/000286.ldb +0 -0
- package/node_modules/@midnames/ns/midnight-level-db/000295.ldb +0 -0
- package/node_modules/@midnames/ns/midnight-level-db/000300.ldb +0 -0
- package/node_modules/@midnames/ns/midnight-level-db/000305.ldb +0 -0
- package/node_modules/@midnames/ns/midnight-level-db/000310.ldb +0 -0
- package/node_modules/@midnames/ns/midnight-level-db/000313.log +0 -0
- package/node_modules/@midnames/ns/midnight-level-db/000319.ldb +0 -0
- package/node_modules/@midnames/ns/midnight-level-db/000324.ldb +0 -0
- package/node_modules/@midnames/ns/midnight-level-db/000329.ldb +0 -0
- package/node_modules/@midnames/ns/midnight-level-db/000334.ldb +0 -0
- package/node_modules/@midnames/ns/midnight-level-db/000343.ldb +0 -0
- package/node_modules/@midnames/ns/midnight-level-db/000348.ldb +0 -0
- package/node_modules/@midnames/ns/midnight-level-db/000357.ldb +0 -0
- package/node_modules/@midnames/ns/midnight-level-db/000362.ldb +0 -0
- package/node_modules/@midnames/ns/midnight-level-db/000371.ldb +0 -0
- package/node_modules/@midnames/ns/midnight-level-db/000376.ldb +0 -0
- package/node_modules/@midnames/ns/midnight-level-db/000385.ldb +0 -0
- package/node_modules/@midnames/ns/midnight-level-db/000390.ldb +0 -0
- package/node_modules/@midnames/ns/midnight-level-db/000393.log +0 -0
- package/node_modules/@midnames/ns/midnight-level-db/CURRENT +0 -1
- package/node_modules/@midnames/ns/midnight-level-db/LOCK +0 -0
- package/node_modules/@midnames/ns/midnight-level-db/LOG +0 -3
- package/node_modules/@midnames/ns/midnight-level-db/LOG.old +0 -6
- package/node_modules/@midnames/ns/midnight-level-db/MANIFEST-000312 +0 -0
- package/node_modules/@midnames/ns/midnight-level-db/MANIFEST-000392 +0 -0
- package/node_modules/@midnames/ns/node_modules/@midnight-ntwrk/compact-runtime/README.md +0 -32
- package/node_modules/@midnames/ns/node_modules/@midnight-ntwrk/compact-runtime/dist/built-ins.d.ts +0 -133
- package/node_modules/@midnames/ns/node_modules/@midnight-ntwrk/compact-runtime/dist/built-ins.js +0 -216
- package/node_modules/@midnames/ns/node_modules/@midnight-ntwrk/compact-runtime/dist/built-ins.js.map +0 -1
- package/node_modules/@midnames/ns/node_modules/@midnight-ntwrk/compact-runtime/dist/casts.d.ts +0 -15
- package/node_modules/@midnames/ns/node_modules/@midnight-ntwrk/compact-runtime/dist/casts.js +0 -65
- package/node_modules/@midnames/ns/node_modules/@midnight-ntwrk/compact-runtime/dist/casts.js.map +0 -1
- package/node_modules/@midnames/ns/node_modules/@midnight-ntwrk/compact-runtime/dist/circuit-context.d.ts +0 -66
- package/node_modules/@midnames/ns/node_modules/@midnight-ntwrk/compact-runtime/dist/circuit-context.js +0 -150
- package/node_modules/@midnames/ns/node_modules/@midnight-ntwrk/compact-runtime/dist/circuit-context.js.map +0 -1
- package/node_modules/@midnames/ns/node_modules/@midnight-ntwrk/compact-runtime/dist/compact-types.d.ts +0 -209
- package/node_modules/@midnames/ns/node_modules/@midnight-ntwrk/compact-runtime/dist/compact-types.js +0 -374
- package/node_modules/@midnames/ns/node_modules/@midnight-ntwrk/compact-runtime/dist/compact-types.js.map +0 -1
- package/node_modules/@midnames/ns/node_modules/@midnight-ntwrk/compact-runtime/dist/constants.d.ts +0 -13
- package/node_modules/@midnames/ns/node_modules/@midnight-ntwrk/compact-runtime/dist/constants.js +0 -29
- package/node_modules/@midnames/ns/node_modules/@midnight-ntwrk/compact-runtime/dist/constants.js.map +0 -1
- package/node_modules/@midnames/ns/node_modules/@midnight-ntwrk/compact-runtime/dist/constructor-context.d.ts +0 -39
- package/node_modules/@midnames/ns/node_modules/@midnight-ntwrk/compact-runtime/dist/constructor-context.js +0 -26
- package/node_modules/@midnames/ns/node_modules/@midnight-ntwrk/compact-runtime/dist/constructor-context.js.map +0 -1
- package/node_modules/@midnames/ns/node_modules/@midnight-ntwrk/compact-runtime/dist/contract-dependencies.d.ts +0 -175
- package/node_modules/@midnames/ns/node_modules/@midnight-ntwrk/compact-runtime/dist/contract-dependencies.js +0 -288
- package/node_modules/@midnames/ns/node_modules/@midnight-ntwrk/compact-runtime/dist/contract-dependencies.js.map +0 -1
- package/node_modules/@midnames/ns/node_modules/@midnight-ntwrk/compact-runtime/dist/error.d.ts +0 -16
- package/node_modules/@midnames/ns/node_modules/@midnight-ntwrk/compact-runtime/dist/error.js +0 -43
- package/node_modules/@midnames/ns/node_modules/@midnight-ntwrk/compact-runtime/dist/error.js.map +0 -1
- package/node_modules/@midnames/ns/node_modules/@midnight-ntwrk/compact-runtime/dist/index.d.ts +0 -15
- package/node_modules/@midnames/ns/node_modules/@midnight-ntwrk/compact-runtime/dist/index.js +0 -30
- package/node_modules/@midnames/ns/node_modules/@midnight-ntwrk/compact-runtime/dist/index.js.map +0 -1
- package/node_modules/@midnames/ns/node_modules/@midnight-ntwrk/compact-runtime/dist/proof-data.d.ts +0 -27
- package/node_modules/@midnames/ns/node_modules/@midnight-ntwrk/compact-runtime/dist/proof-data.js +0 -16
- package/node_modules/@midnames/ns/node_modules/@midnight-ntwrk/compact-runtime/dist/proof-data.js.map +0 -1
- package/node_modules/@midnames/ns/node_modules/@midnight-ntwrk/compact-runtime/dist/utils.d.ts +0 -19
- package/node_modules/@midnames/ns/node_modules/@midnight-ntwrk/compact-runtime/dist/utils.js +0 -41
- package/node_modules/@midnames/ns/node_modules/@midnight-ntwrk/compact-runtime/dist/utils.js.map +0 -1
- package/node_modules/@midnames/ns/node_modules/@midnight-ntwrk/compact-runtime/dist/version.d.ts +0 -2
- package/node_modules/@midnames/ns/node_modules/@midnight-ntwrk/compact-runtime/dist/version.js +0 -18
- package/node_modules/@midnames/ns/node_modules/@midnight-ntwrk/compact-runtime/dist/version.js.map +0 -1
- package/node_modules/@midnames/ns/node_modules/@midnight-ntwrk/compact-runtime/dist/witness.d.ts +0 -24
- package/node_modules/@midnames/ns/node_modules/@midnight-ntwrk/compact-runtime/dist/witness.js +0 -26
- package/node_modules/@midnames/ns/node_modules/@midnight-ntwrk/compact-runtime/dist/witness.js.map +0 -1
- package/node_modules/@midnames/ns/node_modules/@midnight-ntwrk/compact-runtime/dist/zswap.d.ts +0 -172
- package/node_modules/@midnames/ns/node_modules/@midnight-ntwrk/compact-runtime/dist/zswap.js +0 -141
- package/node_modules/@midnames/ns/node_modules/@midnight-ntwrk/compact-runtime/dist/zswap.js.map +0 -1
- package/node_modules/@midnames/ns/node_modules/@midnight-ntwrk/compact-runtime/package.json +0 -57
- package/node_modules/@midnames/ns/node_modules/@midnight-ntwrk/ledger-v8/ledger-v8.d.ts +0 -3079
- package/node_modules/@midnames/ns/node_modules/@midnight-ntwrk/ledger-v8/midnight_ledger_wasm.js +0 -5
- package/node_modules/@midnames/ns/node_modules/@midnight-ntwrk/ledger-v8/midnight_ledger_wasm_bg.js +0 -10056
- package/node_modules/@midnames/ns/node_modules/@midnight-ntwrk/ledger-v8/midnight_ledger_wasm_bg.wasm +0 -0
- package/node_modules/@midnames/ns/node_modules/@midnight-ntwrk/ledger-v8/midnight_ledger_wasm_fs.js +0 -69
- package/node_modules/@midnames/ns/node_modules/@midnight-ntwrk/ledger-v8/package-lock.json +0 -12
- package/node_modules/@midnames/ns/node_modules/@midnight-ntwrk/ledger-v8/package.json +0 -34
- package/node_modules/@midnames/ns/node_modules/@midnight-ntwrk/ledger-v8/snippets/midnight-ledger-wasm-a0cc58108d931982/inline0.js +0 -1
- package/node_modules/@midnames/ns/node_modules/@midnight-ntwrk/ledger-v8/snippets/midnight-ledger-wasm-a0cc58108d931982/inline1.js +0 -1
- package/node_modules/@midnames/ns/node_modules/@midnight-ntwrk/ledger-v8/snippets/midnight-ledger-wasm-a0cc58108d931982/inline10.js +0 -1
- package/node_modules/@midnames/ns/node_modules/@midnight-ntwrk/ledger-v8/snippets/midnight-ledger-wasm-a0cc58108d931982/inline11.js +0 -1
- package/node_modules/@midnames/ns/node_modules/@midnight-ntwrk/ledger-v8/snippets/midnight-ledger-wasm-a0cc58108d931982/inline12.js +0 -1
- package/node_modules/@midnames/ns/node_modules/@midnight-ntwrk/ledger-v8/snippets/midnight-ledger-wasm-a0cc58108d931982/inline13.js +0 -1
- package/node_modules/@midnames/ns/node_modules/@midnight-ntwrk/ledger-v8/snippets/midnight-ledger-wasm-a0cc58108d931982/inline14.js +0 -1
- package/node_modules/@midnames/ns/node_modules/@midnight-ntwrk/ledger-v8/snippets/midnight-ledger-wasm-a0cc58108d931982/inline15.js +0 -1
- package/node_modules/@midnames/ns/node_modules/@midnight-ntwrk/ledger-v8/snippets/midnight-ledger-wasm-a0cc58108d931982/inline16.js +0 -1
- package/node_modules/@midnames/ns/node_modules/@midnight-ntwrk/ledger-v8/snippets/midnight-ledger-wasm-a0cc58108d931982/inline17.js +0 -1
- package/node_modules/@midnames/ns/node_modules/@midnight-ntwrk/ledger-v8/snippets/midnight-ledger-wasm-a0cc58108d931982/inline18.js +0 -1
- package/node_modules/@midnames/ns/node_modules/@midnight-ntwrk/ledger-v8/snippets/midnight-ledger-wasm-a0cc58108d931982/inline19.js +0 -1
- package/node_modules/@midnames/ns/node_modules/@midnight-ntwrk/ledger-v8/snippets/midnight-ledger-wasm-a0cc58108d931982/inline2.js +0 -1
- package/node_modules/@midnames/ns/node_modules/@midnight-ntwrk/ledger-v8/snippets/midnight-ledger-wasm-a0cc58108d931982/inline20.js +0 -1
- package/node_modules/@midnames/ns/node_modules/@midnight-ntwrk/ledger-v8/snippets/midnight-ledger-wasm-a0cc58108d931982/inline21.js +0 -1
- package/node_modules/@midnames/ns/node_modules/@midnight-ntwrk/ledger-v8/snippets/midnight-ledger-wasm-a0cc58108d931982/inline22.js +0 -1
- package/node_modules/@midnames/ns/node_modules/@midnight-ntwrk/ledger-v8/snippets/midnight-ledger-wasm-a0cc58108d931982/inline23.js +0 -1
- package/node_modules/@midnames/ns/node_modules/@midnight-ntwrk/ledger-v8/snippets/midnight-ledger-wasm-a0cc58108d931982/inline3.js +0 -1
- package/node_modules/@midnames/ns/node_modules/@midnight-ntwrk/ledger-v8/snippets/midnight-ledger-wasm-a0cc58108d931982/inline4.js +0 -1
- package/node_modules/@midnames/ns/node_modules/@midnight-ntwrk/ledger-v8/snippets/midnight-ledger-wasm-a0cc58108d931982/inline5.js +0 -1
- package/node_modules/@midnames/ns/node_modules/@midnight-ntwrk/ledger-v8/snippets/midnight-ledger-wasm-a0cc58108d931982/inline6.js +0 -1
- package/node_modules/@midnames/ns/node_modules/@midnight-ntwrk/ledger-v8/snippets/midnight-ledger-wasm-a0cc58108d931982/inline7.js +0 -1
- package/node_modules/@midnames/ns/node_modules/@midnight-ntwrk/ledger-v8/snippets/midnight-ledger-wasm-a0cc58108d931982/inline8.js +0 -1
- package/node_modules/@midnames/ns/node_modules/@midnight-ntwrk/ledger-v8/snippets/midnight-ledger-wasm-a0cc58108d931982/inline9.js +0 -1
- package/node_modules/@midnames/ns/reports/report.xml +0 -33
- package/node_modules/@midnames/ns/src/index.ts +0 -13
- package/node_modules/@midnames/ns/src/leaf.compact +0 -290
- package/node_modules/@midnames/ns/src/managed/leaf/compiler/contract-info.json +0 -534
- package/node_modules/@midnames/ns/src/managed/leaf/contract/index.d.ts +0 -197
- package/node_modules/@midnames/ns/src/managed/leaf/contract/index.js +0 -3094
- package/node_modules/@midnames/ns/src/managed/leaf/contract/index.js.map +0 -8
- package/node_modules/@midnames/ns/src/managed/leaf/keys/add_multiple_fields.prover +0 -0
- package/node_modules/@midnames/ns/src/managed/leaf/keys/add_multiple_fields.verifier +0 -0
- package/node_modules/@midnames/ns/src/managed/leaf/keys/buy_domain_for.prover +0 -0
- package/node_modules/@midnames/ns/src/managed/leaf/keys/buy_domain_for.verifier +0 -0
- package/node_modules/@midnames/ns/src/managed/leaf/keys/change_owner.prover +0 -0
- package/node_modules/@midnames/ns/src/managed/leaf/keys/change_owner.verifier +0 -0
- package/node_modules/@midnames/ns/src/managed/leaf/keys/clear_all_fields.prover +0 -0
- package/node_modules/@midnames/ns/src/managed/leaf/keys/clear_all_fields.verifier +0 -0
- package/node_modules/@midnames/ns/src/managed/leaf/keys/clear_field.prover +0 -0
- package/node_modules/@midnames/ns/src/managed/leaf/keys/clear_field.verifier +0 -0
- package/node_modules/@midnames/ns/src/managed/leaf/keys/insert_field.prover +0 -0
- package/node_modules/@midnames/ns/src/managed/leaf/keys/insert_field.verifier +0 -0
- package/node_modules/@midnames/ns/src/managed/leaf/keys/register_domain_for.prover +0 -0
- package/node_modules/@midnames/ns/src/managed/leaf/keys/register_domain_for.verifier +0 -0
- package/node_modules/@midnames/ns/src/managed/leaf/keys/set_resolver.prover +0 -0
- package/node_modules/@midnames/ns/src/managed/leaf/keys/set_resolver.verifier +0 -0
- package/node_modules/@midnames/ns/src/managed/leaf/keys/transfer_domain.prover +0 -0
- package/node_modules/@midnames/ns/src/managed/leaf/keys/transfer_domain.verifier +0 -0
- package/node_modules/@midnames/ns/src/managed/leaf/keys/update_color.prover +0 -0
- package/node_modules/@midnames/ns/src/managed/leaf/keys/update_color.verifier +0 -0
- package/node_modules/@midnames/ns/src/managed/leaf/keys/update_costs.prover +0 -0
- package/node_modules/@midnames/ns/src/managed/leaf/keys/update_costs.verifier +0 -0
- package/node_modules/@midnames/ns/src/managed/leaf/keys/update_domain_target.prover +0 -0
- package/node_modules/@midnames/ns/src/managed/leaf/keys/update_domain_target.verifier +0 -0
- package/node_modules/@midnames/ns/src/managed/leaf/keys/update_target_and_fields.prover +0 -0
- package/node_modules/@midnames/ns/src/managed/leaf/keys/update_target_and_fields.verifier +0 -0
- package/node_modules/@midnames/ns/src/managed/leaf/zkir/add_multiple_fields.bzkir +0 -0
- package/node_modules/@midnames/ns/src/managed/leaf/zkir/add_multiple_fields.zkir +0 -424
- package/node_modules/@midnames/ns/src/managed/leaf/zkir/buy_domain_for.bzkir +0 -0
- package/node_modules/@midnames/ns/src/managed/leaf/zkir/buy_domain_for.zkir +0 -1456
- package/node_modules/@midnames/ns/src/managed/leaf/zkir/change_owner.bzkir +0 -0
- package/node_modules/@midnames/ns/src/managed/leaf/zkir/change_owner.zkir +0 -57
- package/node_modules/@midnames/ns/src/managed/leaf/zkir/clear_all_fields.bzkir +0 -0
- package/node_modules/@midnames/ns/src/managed/leaf/zkir/clear_all_fields.zkir +0 -53
- package/node_modules/@midnames/ns/src/managed/leaf/zkir/clear_field.bzkir +0 -0
- package/node_modules/@midnames/ns/src/managed/leaf/zkir/clear_field.zkir +0 -58
- package/node_modules/@midnames/ns/src/managed/leaf/zkir/insert_field.bzkir +0 -0
- package/node_modules/@midnames/ns/src/managed/leaf/zkir/insert_field.zkir +0 -65
- package/node_modules/@midnames/ns/src/managed/leaf/zkir/register_domain_for.bzkir +0 -0
- package/node_modules/@midnames/ns/src/managed/leaf/zkir/register_domain_for.zkir +0 -401
- package/node_modules/@midnames/ns/src/managed/leaf/zkir/set_resolver.bzkir +0 -0
- package/node_modules/@midnames/ns/src/managed/leaf/zkir/set_resolver.zkir +0 -109
- package/node_modules/@midnames/ns/src/managed/leaf/zkir/transfer_domain.bzkir +0 -0
- package/node_modules/@midnames/ns/src/managed/leaf/zkir/transfer_domain.zkir +0 -212
- package/node_modules/@midnames/ns/src/managed/leaf/zkir/update_color.bzkir +0 -0
- package/node_modules/@midnames/ns/src/managed/leaf/zkir/update_color.zkir +0 -58
- package/node_modules/@midnames/ns/src/managed/leaf/zkir/update_costs.bzkir +0 -0
- package/node_modules/@midnames/ns/src/managed/leaf/zkir/update_costs.zkir +0 -88
- package/node_modules/@midnames/ns/src/managed/leaf/zkir/update_domain_target.bzkir +0 -0
- package/node_modules/@midnames/ns/src/managed/leaf/zkir/update_domain_target.zkir +0 -66
- package/node_modules/@midnames/ns/src/managed/leaf/zkir/update_target_and_fields.bzkir +0 -0
- package/node_modules/@midnames/ns/src/managed/leaf/zkir/update_target_and_fields.zkir +0 -450
- package/node_modules/@midnames/ns/src/test/batch-config.ts +0 -13
- package/node_modules/@midnames/ns/src/test/batch-deploy.ts +0 -914
- package/node_modules/@midnames/ns/src/test/contract.ts +0 -1228
- package/node_modules/@midnames/ns/src/test/derive_seed.ts +0 -102
- package/node_modules/@midnames/ns/src/test/example-deploy.config.ts +0 -76
- package/node_modules/@midnames/ns/src/test/midnight-level-db/000005.ldb +0 -0
- package/node_modules/@midnames/ns/src/test/midnight-level-db/000011.ldb +0 -0
- package/node_modules/@midnames/ns/src/test/midnight-level-db/000014.ldb +0 -0
- package/node_modules/@midnames/ns/src/test/midnight-level-db/000025.ldb +0 -0
- package/node_modules/@midnames/ns/src/test/midnight-level-db/000039.ldb +0 -0
- package/node_modules/@midnames/ns/src/test/midnight-level-db/000049.ldb +0 -0
- package/node_modules/@midnames/ns/src/test/midnight-level-db/000064.ldb +0 -0
- package/node_modules/@midnames/ns/src/test/midnight-level-db/000078.ldb +0 -0
- package/node_modules/@midnames/ns/src/test/midnight-level-db/000092.ldb +0 -0
- package/node_modules/@midnames/ns/src/test/midnight-level-db/000106.ldb +0 -0
- package/node_modules/@midnames/ns/src/test/midnight-level-db/000121.ldb +0 -0
- package/node_modules/@midnames/ns/src/test/midnight-level-db/000135.ldb +0 -0
- package/node_modules/@midnames/ns/src/test/midnight-level-db/000146.ldb +0 -0
- package/node_modules/@midnames/ns/src/test/midnight-level-db/000160.ldb +0 -0
- package/node_modules/@midnames/ns/src/test/midnight-level-db/000174.ldb +0 -0
- package/node_modules/@midnames/ns/src/test/midnight-level-db/000188.ldb +0 -0
- package/node_modules/@midnames/ns/src/test/midnight-level-db/000203.ldb +0 -0
- package/node_modules/@midnames/ns/src/test/midnight-level-db/000217.ldb +0 -0
- package/node_modules/@midnames/ns/src/test/midnight-level-db/000232.ldb +0 -0
- package/node_modules/@midnames/ns/src/test/midnight-level-db/000242.ldb +0 -0
- package/node_modules/@midnames/ns/src/test/midnight-level-db/000256.ldb +0 -0
- package/node_modules/@midnames/ns/src/test/midnight-level-db/000263.ldb +0 -0
- package/node_modules/@midnames/ns/src/test/midnight-level-db/000267.ldb +0 -0
- package/node_modules/@midnames/ns/src/test/midnight-level-db/000276.ldb +0 -0
- package/node_modules/@midnames/ns/src/test/midnight-level-db/000281.ldb +0 -0
- package/node_modules/@midnames/ns/src/test/midnight-level-db/000286.ldb +0 -0
- package/node_modules/@midnames/ns/src/test/midnight-level-db/000291.ldb +0 -0
- package/node_modules/@midnames/ns/src/test/midnight-level-db/000300.ldb +0 -0
- package/node_modules/@midnames/ns/src/test/midnight-level-db/000305.ldb +0 -0
- package/node_modules/@midnames/ns/src/test/midnight-level-db/000314.ldb +0 -0
- package/node_modules/@midnames/ns/src/test/midnight-level-db/000319.ldb +0 -0
- package/node_modules/@midnames/ns/src/test/midnight-level-db/000328.ldb +0 -0
- package/node_modules/@midnames/ns/src/test/midnight-level-db/000333.ldb +0 -0
- package/node_modules/@midnames/ns/src/test/midnight-level-db/000342.ldb +0 -0
- package/node_modules/@midnames/ns/src/test/midnight-level-db/000347.ldb +0 -0
- package/node_modules/@midnames/ns/src/test/midnight-level-db/000356.ldb +0 -0
- package/node_modules/@midnames/ns/src/test/midnight-level-db/000361.ldb +0 -0
- package/node_modules/@midnames/ns/src/test/midnight-level-db/000370.ldb +0 -0
- package/node_modules/@midnames/ns/src/test/midnight-level-db/000375.ldb +0 -0
- package/node_modules/@midnames/ns/src/test/midnight-level-db/000380.ldb +0 -0
- package/node_modules/@midnames/ns/src/test/midnight-level-db/000385.ldb +0 -0
- package/node_modules/@midnames/ns/src/test/midnight-level-db/000392.ldb +0 -0
- package/node_modules/@midnames/ns/src/test/midnight-level-db/000397.ldb +0 -0
- package/node_modules/@midnames/ns/src/test/midnight-level-db/000400.ldb +0 -0
- package/node_modules/@midnames/ns/src/test/midnight-level-db/000403.ldb +0 -0
- package/node_modules/@midnames/ns/src/test/midnight-level-db/000408.ldb +0 -0
- package/node_modules/@midnames/ns/src/test/midnight-level-db/000413.ldb +0 -0
- package/node_modules/@midnames/ns/src/test/midnight-level-db/000422.ldb +0 -0
- package/node_modules/@midnames/ns/src/test/midnight-level-db/000427.ldb +0 -0
- package/node_modules/@midnames/ns/src/test/midnight-level-db/000432.ldb +0 -0
- package/node_modules/@midnames/ns/src/test/midnight-level-db/000437.ldb +0 -0
- package/node_modules/@midnames/ns/src/test/midnight-level-db/000446.ldb +0 -0
- package/node_modules/@midnames/ns/src/test/midnight-level-db/000451.ldb +0 -0
- package/node_modules/@midnames/ns/src/test/midnight-level-db/000456.ldb +0 -0
- package/node_modules/@midnames/ns/src/test/midnight-level-db/000461.ldb +0 -0
- package/node_modules/@midnames/ns/src/test/midnight-level-db/000470.ldb +0 -0
- package/node_modules/@midnames/ns/src/test/midnight-level-db/000475.ldb +0 -0
- package/node_modules/@midnames/ns/src/test/midnight-level-db/000480.ldb +0 -0
- package/node_modules/@midnames/ns/src/test/midnight-level-db/000485.ldb +0 -0
- package/node_modules/@midnames/ns/src/test/midnight-level-db/000494.ldb +0 -0
- package/node_modules/@midnames/ns/src/test/midnight-level-db/000499.ldb +0 -0
- package/node_modules/@midnames/ns/src/test/midnight-level-db/000504.ldb +0 -0
- package/node_modules/@midnames/ns/src/test/midnight-level-db/000509.ldb +0 -0
- package/node_modules/@midnames/ns/src/test/midnight-level-db/000518.ldb +0 -0
- package/node_modules/@midnames/ns/src/test/midnight-level-db/000523.ldb +0 -0
- package/node_modules/@midnames/ns/src/test/midnight-level-db/000528.ldb +0 -0
- package/node_modules/@midnames/ns/src/test/midnight-level-db/000533.ldb +0 -0
- package/node_modules/@midnames/ns/src/test/midnight-level-db/000542.ldb +0 -0
- package/node_modules/@midnames/ns/src/test/midnight-level-db/000547.ldb +0 -0
- package/node_modules/@midnames/ns/src/test/midnight-level-db/000552.ldb +0 -0
- package/node_modules/@midnames/ns/src/test/midnight-level-db/000557.ldb +0 -0
- package/node_modules/@midnames/ns/src/test/midnight-level-db/000566.ldb +0 -0
- package/node_modules/@midnames/ns/src/test/midnight-level-db/000571.ldb +0 -0
- package/node_modules/@midnames/ns/src/test/midnight-level-db/000576.ldb +0 -0
- package/node_modules/@midnames/ns/src/test/midnight-level-db/000581.ldb +0 -0
- package/node_modules/@midnames/ns/src/test/midnight-level-db/000590.ldb +0 -0
- package/node_modules/@midnames/ns/src/test/midnight-level-db/000595.ldb +0 -0
- package/node_modules/@midnames/ns/src/test/midnight-level-db/000600.ldb +0 -0
- package/node_modules/@midnames/ns/src/test/midnight-level-db/000605.ldb +0 -0
- package/node_modules/@midnames/ns/src/test/midnight-level-db/000608.log +0 -0
- package/node_modules/@midnames/ns/src/test/midnight-level-db/CURRENT +0 -1
- package/node_modules/@midnames/ns/src/test/midnight-level-db/LOCK +0 -0
- package/node_modules/@midnames/ns/src/test/midnight-level-db/LOG +0 -3
- package/node_modules/@midnames/ns/src/test/midnight-level-db/LOG.old +0 -6
- package/node_modules/@midnames/ns/src/test/midnight-level-db/MANIFEST-000607 +0 -0
- package/node_modules/@midnames/ns/src/test/ns-simulator.ts +0 -115
- package/node_modules/@midnames/ns/src/test/ns.test.ts +0 -132
- package/node_modules/@midnames/ns/src/test/profile-fields.ts +0 -148
- package/node_modules/@midnames/ns/src/test/wallet.ts +0 -289
- package/node_modules/@midnames/ns/src/utils.ts +0 -16
- package/node_modules/@midnames/ns/src/witnesses.ts +0 -6
- package/node_modules/@midnames/ns/tsconfig.build.json +0 -5
- package/node_modules/@midnames/ns/tsconfig.json +0 -12
- package/node_modules/@midnames/ns/vitest.config.ts +0 -30
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
// This file is part of Compact.
|
|
2
|
-
// Copyright (C) 2025 Midnight Foundation
|
|
3
|
-
// SPDX-License-Identifier: Apache-2.0
|
|
4
|
-
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
// you may not use this file except in compliance with the License.
|
|
6
|
-
// You may obtain a copy of the License at
|
|
7
|
-
//
|
|
8
|
-
// http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
//
|
|
10
|
-
// Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
// See the License for the specific language governing permissions and
|
|
14
|
-
// limitations under the License.
|
|
15
|
-
import { emptyZswapLocalState } from './zswap.js';
|
|
16
|
-
/**
|
|
17
|
-
* Creates a new {@link ConstructorContext} with the given initial private state and an empty Zswap local state.
|
|
18
|
-
*
|
|
19
|
-
* @param initialPrivateState The private state to use to execute the contract's constructor.
|
|
20
|
-
* @param coinPublicKey The Zswap coin public key of the user executing the contract.
|
|
21
|
-
*/
|
|
22
|
-
export const createConstructorContext = (initialPrivateState, coinPublicKey) => ({
|
|
23
|
-
initialPrivateState,
|
|
24
|
-
initialZswapLocalState: emptyZswapLocalState(coinPublicKey),
|
|
25
|
-
});
|
|
26
|
-
//# sourceMappingURL=constructor-context.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"constructor-context.js","sourceRoot":"","sources":["../src/constructor-context.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,yCAAyC;AACzC,sCAAsC;AACtC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,8CAA8C;AAC9C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAGjC,OAAO,EAAE,oBAAoB,EAAgD,MAAM,YAAY,CAAC;AAgBhG;;;;;GAKG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,CACtC,mBAAuB,EACvB,aAAwD,EAChC,EAAE,CAAC,CAAC;IAC5B,mBAAmB;IACnB,sBAAsB,EAAE,oBAAoB,CAAC,aAAa,CAAC;CAC5D,CAAC,CAAC"}
|
|
@@ -1,175 +0,0 @@
|
|
|
1
|
-
import * as ocrt from '@midnight-ntwrk/onchain-runtime-v3';
|
|
2
|
-
import { CompactType } from './compact-types.js';
|
|
3
|
-
/**
|
|
4
|
-
* A data structure indicating that the current {@link CompactValue} being explored is a contract reference. When this
|
|
5
|
-
* type is recognized, the current {@link CompactValue} should be a {@link ContractAddress}, and the address is added to
|
|
6
|
-
* the dependency set.
|
|
7
|
-
*/
|
|
8
|
-
export type SparseCompactContractAddress = {
|
|
9
|
-
tag: 'contractAddress';
|
|
10
|
-
};
|
|
11
|
-
/**
|
|
12
|
-
* A data structure indicating the locations of contract references in a Compact struct.
|
|
13
|
-
*/
|
|
14
|
-
export type SparseCompactStruct = {
|
|
15
|
-
tag: 'struct';
|
|
16
|
-
/**
|
|
17
|
-
* A data structure indicating the locations of contract references in the elements of a Compact struct. The keys of
|
|
18
|
-
* the record correspond to fields of the Compact struct that contain contract references. We use the keys of the record
|
|
19
|
-
* to explore the elements of the corresponding {@link CompactStruct}.
|
|
20
|
-
*/
|
|
21
|
-
elements: Record<string, SparseCompactType>;
|
|
22
|
-
};
|
|
23
|
-
/**
|
|
24
|
-
* A data structure indicating the locations of contract references in a Compact vector.
|
|
25
|
-
*/
|
|
26
|
-
export type SparseCompactVector = {
|
|
27
|
-
tag: 'vector';
|
|
28
|
-
/**
|
|
29
|
-
* A data structure indicating the locations of contract references in the elements of a Compact vector.
|
|
30
|
-
*/
|
|
31
|
-
sparseType: SparseCompactType;
|
|
32
|
-
};
|
|
33
|
-
/**
|
|
34
|
-
* A data structure indicating the locations of contract references in a Compact struct, vector, or (the terminating case)
|
|
35
|
-
* a contract address.
|
|
36
|
-
*/
|
|
37
|
-
export type SparseCompactType = SparseCompactVector | SparseCompactStruct | SparseCompactContractAddress;
|
|
38
|
-
/**
|
|
39
|
-
* A data structure indicating the locations of all contract references in a Compact value.
|
|
40
|
-
*/
|
|
41
|
-
export type SparseCompactValue = {
|
|
42
|
-
tag: 'compactValue';
|
|
43
|
-
/**
|
|
44
|
-
* A descriptor that can be used to convert an {@link AlignedValue} into a TypeScript representation of the same value.
|
|
45
|
-
* This descriptor will only ever decode `struct`s or `Vector`s that contain contract addresses.
|
|
46
|
-
*/
|
|
47
|
-
descriptor: CompactType<unknown>;
|
|
48
|
-
/**
|
|
49
|
-
* A data structure indicating how to navigate to the contract addresses present in the output of the above `descriptor`.
|
|
50
|
-
*/
|
|
51
|
-
sparseType: SparseCompactType;
|
|
52
|
-
};
|
|
53
|
-
/**
|
|
54
|
-
* A data structure indicating the locations of all contract references in a Compact `Cell` ADT.
|
|
55
|
-
*/
|
|
56
|
-
export type SparseCompactCellADT = {
|
|
57
|
-
tag: 'cell';
|
|
58
|
-
/**
|
|
59
|
-
* A data structure indicating the locations of all contract references in the Compact value contained in the outer `Cell` ADT.
|
|
60
|
-
*/
|
|
61
|
-
valueType: SparseCompactValue;
|
|
62
|
-
};
|
|
63
|
-
/**
|
|
64
|
-
* A data structure indicating the locations of all contract references in a Compact `Set` ADT.
|
|
65
|
-
*/
|
|
66
|
-
export type SparseCompactSetADT = {
|
|
67
|
-
tag: 'set';
|
|
68
|
-
/**
|
|
69
|
-
* A data structure indicating the locations of all contract references in a Compact value in the outer `Set` ADT.
|
|
70
|
-
*/
|
|
71
|
-
valueType: SparseCompactValue;
|
|
72
|
-
};
|
|
73
|
-
/**
|
|
74
|
-
* A data structure indicating the locations of all contract references in a Compact `List` ADT.
|
|
75
|
-
*/
|
|
76
|
-
export type SparseCompactListADT = {
|
|
77
|
-
tag: 'list';
|
|
78
|
-
/**
|
|
79
|
-
* A data structure indicating the locations of all contract references in a Compact value in the outer `List` ADT.
|
|
80
|
-
*/
|
|
81
|
-
valueType: SparseCompactValue;
|
|
82
|
-
};
|
|
83
|
-
/**
|
|
84
|
-
* A data structure indicating the locations of all contract references in a Compact `Set` or `List` ADT.
|
|
85
|
-
*/
|
|
86
|
-
export type SparseCompactArrayLikeADT = SparseCompactSetADT | SparseCompactListADT;
|
|
87
|
-
/**
|
|
88
|
-
* A data structure indicating the locations of all contract references in a Compact `Map` ADT.
|
|
89
|
-
*/
|
|
90
|
-
export type SparseCompactMapADT = {
|
|
91
|
-
tag: 'map';
|
|
92
|
-
/**
|
|
93
|
-
* A data structure indicating the locations of all contract references in the Compact values that are the keys of the
|
|
94
|
-
* outer `Map` ADT.
|
|
95
|
-
*/
|
|
96
|
-
keyType?: SparseCompactValue;
|
|
97
|
-
/**
|
|
98
|
-
* A data structure indicating the locations of all contract references in the Compact entities that are the values of the
|
|
99
|
-
* outer `Map` ADT. Since the values of a `Map` ADT may be either Compact values or other `Map` ADTs, we take the union
|
|
100
|
-
* of the corresponding data structures.
|
|
101
|
-
*/
|
|
102
|
-
valueType?: SparseCompactADT | SparseCompactValue;
|
|
103
|
-
};
|
|
104
|
-
/**
|
|
105
|
-
* A discriminated union describing the locations of contract references in either a Compact `Cell`, `List`, `Set`, or `Map` ADT.
|
|
106
|
-
*/
|
|
107
|
-
export type SparseCompactADT = SparseCompactCellADT | SparseCompactArrayLikeADT | SparseCompactMapADT;
|
|
108
|
-
/**
|
|
109
|
-
* A data structure indicating the locations of all contract references in a given ledger state.
|
|
110
|
-
*/
|
|
111
|
-
export type PublicLedgerSegments = {
|
|
112
|
-
tag: 'publicLedgerArray';
|
|
113
|
-
/**
|
|
114
|
-
* For reasonably small ledger states, the keys of the record identify locations of ADTs in the ledger state. For example,
|
|
115
|
-
* if a Compact source file contains
|
|
116
|
-
*
|
|
117
|
-
* ```
|
|
118
|
-
* contract C {};
|
|
119
|
-
* struct Struct1 {
|
|
120
|
-
* a: Field;
|
|
121
|
-
* b: C;
|
|
122
|
-
* }
|
|
123
|
-
* ledger ls1: List[Field];
|
|
124
|
-
* ledger ls2: List[C];
|
|
125
|
-
* ledger ls3: Set[Struct1];
|
|
126
|
-
* ```
|
|
127
|
-
*
|
|
128
|
-
* then the indices record will contain keys `1` and `2`, since ledger declarations `1` and `2` contain contract
|
|
129
|
-
* references while ledger declaration `0` (`List[Field]`) does not.
|
|
130
|
-
*
|
|
131
|
-
* However, the ledger implementation has a fixed maximum length on the state arrays produced by {@link StateValue.toArray}.
|
|
132
|
-
* When the number of entries in a given state exceeds the maximum, {@link StateValue.toArray} produces nested state arrays,
|
|
133
|
-
* where each inner state array is within the maximum. For each nested state array, there will be a key in the indices record
|
|
134
|
-
* pointing to a {@link PublicLedgerSegments} object.
|
|
135
|
-
*/
|
|
136
|
-
indices: Record<number, PublicLedgerSegments | SparseCompactADT>;
|
|
137
|
-
};
|
|
138
|
-
/**
|
|
139
|
-
* A type indicating that no contract references are present in a contract's ledger state.
|
|
140
|
-
*/
|
|
141
|
-
export type EmptyPublicLedger = {
|
|
142
|
-
tag: 'publicLedgerArray';
|
|
143
|
-
indices: undefined;
|
|
144
|
-
};
|
|
145
|
-
/**
|
|
146
|
-
* A data structure indicating the locations of all contract references in a given ledger state. If it is a {@link EmptyPublicLedger},
|
|
147
|
-
* then no contract references are present in the ledger state. If it is a {@link PublicLedgerSegments}, then contract references are
|
|
148
|
-
* present and can be extracted using {@link contractDependencies}.
|
|
149
|
-
*/
|
|
150
|
-
export type ContractReferenceLocations = EmptyPublicLedger | PublicLedgerSegments;
|
|
151
|
-
/**
|
|
152
|
-
* Given a {@link StateValue} representing the current ledger state of a contract, uses the {@link ContractReferenceLocations}
|
|
153
|
-
* object produced by the Compact compiler to extract the current contract addresses present in the given ledger state. The produced
|
|
154
|
-
* contract addresses represent the contracts on which the root contract depends. The dependencies are used in a multi-contract
|
|
155
|
-
* setting to fetch the ledger states of all contracts on which the root contract depends prior to execution.
|
|
156
|
-
*
|
|
157
|
-
* NOTE: The given {@link ContractReferenceLocations} must be from the contract executable containing the ledger state constructor
|
|
158
|
-
* that produced the given {@link StateValue}.
|
|
159
|
-
*
|
|
160
|
-
* @param contractReferenceLocations A data structure pointing to contract references in the ledger state of the root contract.
|
|
161
|
-
* @param state The current ledger state of the root contract.
|
|
162
|
-
* @returns A list of all contract addresses (references) present in the given ledger state.
|
|
163
|
-
*
|
|
164
|
-
* @remarks The algorithm has three main stages:
|
|
165
|
-
*
|
|
166
|
-
* 1. It unwraps the {@link PublicLedgerSegments} in the given {@link ContractReferenceLocations} until a {@link SparseCompactADT} is reached.
|
|
167
|
-
* Each time a {@link PublicLedgerSegments} is unwrapped, it casts the current state value to a state value array and proceeds recursively with each
|
|
168
|
-
* of the state values and unwrapped ledger segments.
|
|
169
|
-
* 2. It unwraps each {@link SparseCompactADT} in the current {@link PublicLedgerSegments} until a {@link SparseCompactType} is reached.
|
|
170
|
-
* Each time a {@link SparseCompactADT} is unwrapped, it casts the current state value to a state representation indicated by
|
|
171
|
-
* the {@link SparseCompactADT}.
|
|
172
|
-
* 3. Once the current state can no longer be reduced, it must represent a Compact contract address somewhere inside the state,
|
|
173
|
-
* and that contract address is added to the dependency set.
|
|
174
|
-
*/
|
|
175
|
-
export declare const contractDependencies: (contractReferenceLocations: ContractReferenceLocations, state: ocrt.StateValue) => ocrt.ContractAddress[];
|
|
@@ -1,288 +0,0 @@
|
|
|
1
|
-
// This file is part of Compact.
|
|
2
|
-
// Copyright (C) 2025 Midnight Foundation
|
|
3
|
-
// SPDX-License-Identifier: Apache-2.0
|
|
4
|
-
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
// you may not use this file except in compliance with the License.
|
|
6
|
-
// You may obtain a copy of the License at
|
|
7
|
-
//
|
|
8
|
-
// http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
//
|
|
10
|
-
// Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
// See the License for the specific language governing permissions and
|
|
14
|
-
// limitations under the License.
|
|
15
|
-
import * as ocrt from '@midnight-ntwrk/onchain-runtime-v3';
|
|
16
|
-
import { isEncodedContractAddress } from './utils.js';
|
|
17
|
-
import { CompactError } from './error.js';
|
|
18
|
-
/**
|
|
19
|
-
* Tests whether the input value is a {@link CompactVector}.
|
|
20
|
-
*
|
|
21
|
-
* @param x The value that is tested to be a {@link CompactVector}.
|
|
22
|
-
*/
|
|
23
|
-
function isCompactVector(x) {
|
|
24
|
-
return Array.isArray(x) && x.every((element) => isCompactValue(element));
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* Tests whether the input value is a {@link CompactStruct}.
|
|
28
|
-
*
|
|
29
|
-
* @param x The value that is tested to be a {@link CompactStruct}.
|
|
30
|
-
*/
|
|
31
|
-
function isCompactStruct(x) {
|
|
32
|
-
return (typeof x === 'object' &&
|
|
33
|
-
x !== null &&
|
|
34
|
-
x !== undefined &&
|
|
35
|
-
Object.entries(x).every(([key, value]) => typeof key === 'string' && isCompactValue(value)));
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* Tests whether the input value is a {@link CompactValue}.
|
|
39
|
-
*
|
|
40
|
-
* @param x The value that is tested to be a {@link CompactValue}.
|
|
41
|
-
*/
|
|
42
|
-
function isCompactValue(x) {
|
|
43
|
-
return isEncodedContractAddress(x) || isCompactVector(x) || isCompactStruct(x);
|
|
44
|
-
}
|
|
45
|
-
const expectedValueError = (expected, actual) => {
|
|
46
|
-
throw new CompactError(`Expected ${expected} but received ${JSON.stringify(actual)}`);
|
|
47
|
-
};
|
|
48
|
-
/**
|
|
49
|
-
* Throws an error if the input value is not a {@link ContractAddress}, i.e., string.
|
|
50
|
-
*
|
|
51
|
-
* @param value The value that is asserted to be a {@link ContractAddress}.
|
|
52
|
-
*/
|
|
53
|
-
function assertIsContractAddress(value) {
|
|
54
|
-
if (!isEncodedContractAddress(value)) {
|
|
55
|
-
expectedValueError('contract address', value);
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
/**
|
|
59
|
-
* Throws an error if the input value is not a {@link CompactVector}.
|
|
60
|
-
*
|
|
61
|
-
* @param value The value that is asserted to be a {@link CompactVector}.
|
|
62
|
-
*/
|
|
63
|
-
function assertIsCompactVector(value) {
|
|
64
|
-
if (!isCompactVector(value)) {
|
|
65
|
-
expectedValueError('vector', value);
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
/**
|
|
69
|
-
* Throws an error if the input value is not a {@link CompactStruct}.
|
|
70
|
-
*
|
|
71
|
-
* @param value The value that is asserted to be a {@link CompactStruct}.
|
|
72
|
-
*/
|
|
73
|
-
function assertIsCompactStruct(value) {
|
|
74
|
-
if (!isCompactStruct(value)) {
|
|
75
|
-
expectedValueError('struct', value);
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
/**
|
|
79
|
-
* Throws an error if the input value is not a {@link CompactValue}.
|
|
80
|
-
*
|
|
81
|
-
* @param x The value that is asserted to be a {@link CompactValue}.
|
|
82
|
-
*/
|
|
83
|
-
function assertIsCompactValue(x) {
|
|
84
|
-
if (!isCompactValue(x)) {
|
|
85
|
-
expectedValueError('Compact value', x);
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
/**
|
|
89
|
-
* Converts an unknown TypeScript value into a {@link CompactValue}. This conversion __should__ always succeed.
|
|
90
|
-
*
|
|
91
|
-
* @param x The value to convert.
|
|
92
|
-
*/
|
|
93
|
-
function toCompactValue(x) {
|
|
94
|
-
assertIsCompactValue(x);
|
|
95
|
-
return x;
|
|
96
|
-
}
|
|
97
|
-
/**
|
|
98
|
-
* Extracts the contract addresses present in the given {@link CompactValue}.
|
|
99
|
-
*
|
|
100
|
-
* @param sparseCompactType A data structure indicating the locations of all contract references in the given {@link CompactValue}.
|
|
101
|
-
* @param compactValue The Compact value containing contract references.
|
|
102
|
-
* @param dependencies The current set of contract addresses extracted from the input ledger state.
|
|
103
|
-
*/
|
|
104
|
-
const compactValueDependencies = (sparseCompactType, compactValue, dependencies) => {
|
|
105
|
-
if (sparseCompactType.tag == 'contractAddress') {
|
|
106
|
-
assertIsContractAddress(compactValue);
|
|
107
|
-
dependencies.add(ocrt.decodeContractAddress(compactValue.bytes));
|
|
108
|
-
}
|
|
109
|
-
else if (sparseCompactType.tag == 'struct') {
|
|
110
|
-
assertIsCompactStruct(compactValue);
|
|
111
|
-
Object.keys(compactValue).forEach((structElementId) => compactValueDependencies(sparseCompactType.elements[structElementId], compactValue[structElementId], dependencies));
|
|
112
|
-
}
|
|
113
|
-
else {
|
|
114
|
-
assertIsCompactVector(compactValue);
|
|
115
|
-
compactValue.forEach((vectorElement) => compactValueDependencies(sparseCompactType.sparseType, vectorElement, dependencies));
|
|
116
|
-
}
|
|
117
|
-
};
|
|
118
|
-
/**
|
|
119
|
-
* Converts a Compact value in the on-chain runtime representation ({@link AlignedValue}) into a TypeScript ({@link CompactValue})
|
|
120
|
-
* representation.
|
|
121
|
-
*
|
|
122
|
-
* @param descriptor The descriptor to convert a {@link AlignedValue} into a TypeScript value.
|
|
123
|
-
* @param value The value to convert.
|
|
124
|
-
*/
|
|
125
|
-
const alignedValueToCompactValue = (descriptor, { value }) => toCompactValue(descriptor.fromValue(value));
|
|
126
|
-
/**
|
|
127
|
-
* Converts a {@link StateValue} into a {@link CompactValue} by treating the state as a `Cell` ADT containing a Compact value.
|
|
128
|
-
*
|
|
129
|
-
* @param descriptor The descriptor used to convert the {@link AlignedValue} extracted from the `Cell` ADT into a TypeScript
|
|
130
|
-
* representation of a Compact value containing a contract address.
|
|
131
|
-
* @param stateValue Represents a `Cell` ADT.
|
|
132
|
-
*/
|
|
133
|
-
const stateValueToCompactValue = (descriptor, stateValue) => alignedValueToCompactValue(descriptor, stateValue.asCell());
|
|
134
|
-
/**
|
|
135
|
-
* Extracts the contract references contained in a Compact `Cell` ADT represented by the given {@link StateValue}.
|
|
136
|
-
*
|
|
137
|
-
* @param sparseCompactCellADT A data structure pointing to contract references in the Compact `Cell` ADT corresponding
|
|
138
|
-
* to the given `state` parameter, if any exist.
|
|
139
|
-
* @param state A portion of the input ledger state representing a Compact `Cell` ADT.
|
|
140
|
-
* @param dependencies The current set of contract addresses extracted from the input ledger state.
|
|
141
|
-
*/
|
|
142
|
-
const compactCellDependencies = (sparseCompactCellADT, state, dependencies) => {
|
|
143
|
-
const { sparseType, descriptor } = sparseCompactCellADT.valueType;
|
|
144
|
-
compactValueDependencies(sparseType, stateValueToCompactValue(descriptor, state), dependencies);
|
|
145
|
-
};
|
|
146
|
-
/**
|
|
147
|
-
* Extracts the contract references contained in a Compact `List` or `Set` ADT represented by the given {@link StateValue} array.
|
|
148
|
-
*
|
|
149
|
-
* @param sparseCompactArrayLikeADT A data structure pointing to contract references in the Compact `List` or `Set` ADT corresponding
|
|
150
|
-
* to the given `states` parameter, if any exist.
|
|
151
|
-
* @param states A portion of the input ledger state representing a Compact `List` or `Set` ADT.
|
|
152
|
-
* @param dependencies The current set of contract addresses extracted from the input ledger state.
|
|
153
|
-
*/
|
|
154
|
-
const compactArrayLikeADTDependencies = (sparseCompactArrayLikeADT, states, dependencies) => {
|
|
155
|
-
const { sparseType, descriptor } = sparseCompactArrayLikeADT.valueType;
|
|
156
|
-
states.forEach((state) => compactValueDependencies(sparseType, stateValueToCompactValue(descriptor, state), dependencies));
|
|
157
|
-
};
|
|
158
|
-
/**
|
|
159
|
-
* Extracts the contract references contained in a Compact `Map` ADT represented by the given {@link StateMap} object.
|
|
160
|
-
*
|
|
161
|
-
* @param sparseCompactMapADT A data structure pointing to contract references in the Compact `Map` ADT corresponding
|
|
162
|
-
* to the given `stateMap` parameter, if any exist.
|
|
163
|
-
* @param stateMap A portion of the input ledger state representing a Compact `Map` ADT.
|
|
164
|
-
* @param dependencies The current set of contract addresses extracted from the input ledger state.
|
|
165
|
-
*/
|
|
166
|
-
const compactMapADTDependencies = (sparseCompactMapADT, stateMap, dependencies) => {
|
|
167
|
-
const { keyType, valueType } = sparseCompactMapADT;
|
|
168
|
-
stateMap.keys().forEach((key) => {
|
|
169
|
-
if (keyType) {
|
|
170
|
-
compactValueDependencies(keyType.sparseType, alignedValueToCompactValue(keyType.descriptor, key), dependencies);
|
|
171
|
-
}
|
|
172
|
-
if (valueType) {
|
|
173
|
-
const value = stateMap.get(key);
|
|
174
|
-
if (!value) {
|
|
175
|
-
throw new CompactError(`State map ${stateMap.toString(false)} contains key without corresponding value`);
|
|
176
|
-
}
|
|
177
|
-
// Maps are the only ADT that can contain other ADTs, other maps in particular.
|
|
178
|
-
if (valueType.tag == 'compactValue') {
|
|
179
|
-
compactValueDependencies(valueType.sparseType, stateValueToCompactValue(valueType.descriptor, value), dependencies);
|
|
180
|
-
}
|
|
181
|
-
else {
|
|
182
|
-
compactADTDependencies(valueType, value, dependencies);
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
});
|
|
186
|
-
};
|
|
187
|
-
/**
|
|
188
|
-
* Throw a {@link CompactError} if the input `s` value is undefined. Called when the input {@link StateValue} could not be
|
|
189
|
-
* cast to either a map, array, or boundary Merkle tree representation.
|
|
190
|
-
*
|
|
191
|
-
* @param s The value that is asserted to be defined.
|
|
192
|
-
* @param stateValue The state on which the cast to a map, array, or boundary Merkle tree representation was attempted.
|
|
193
|
-
* @param expectedCastOutput The representation to which the input state __should__ have been cast.
|
|
194
|
-
*/
|
|
195
|
-
function assertCastSucceeded(s, stateValue, expectedCastOutput) {
|
|
196
|
-
if (!s) {
|
|
197
|
-
throw new CompactError(`State ${stateValue.toString(false)} cannot be cast to a ${expectedCastOutput}`);
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
/**
|
|
201
|
-
* Extracts the contract references present in the ADT that the input {@link StateValue} represents. Attempts to cast the
|
|
202
|
-
* input state to a different representation indicated by the input {@link SparseCompactADT}.
|
|
203
|
-
*
|
|
204
|
-
* @param sparseCompactADT A data structure pointing to contract references in the Compact ADT represented by the input state.
|
|
205
|
-
* @param stateValue The state representing a Compact ADT.
|
|
206
|
-
* @param dependencies The current set of contract addresses extracted from the input ledger state.
|
|
207
|
-
*/
|
|
208
|
-
const compactADTDependencies = (sparseCompactADT, stateValue, dependencies) => {
|
|
209
|
-
if (sparseCompactADT.tag == 'cell') {
|
|
210
|
-
compactCellDependencies(sparseCompactADT, stateValue, dependencies);
|
|
211
|
-
}
|
|
212
|
-
else if (sparseCompactADT.tag == 'map') {
|
|
213
|
-
const stateMap = stateValue.asMap();
|
|
214
|
-
assertCastSucceeded(stateMap, stateValue, 'map');
|
|
215
|
-
compactMapADTDependencies(sparseCompactADT, stateMap, dependencies);
|
|
216
|
-
}
|
|
217
|
-
else if (sparseCompactADT.tag == 'list' || sparseCompactADT.tag == 'set') {
|
|
218
|
-
const states = stateValue.asArray();
|
|
219
|
-
assertCastSucceeded(states, stateValue, 'array');
|
|
220
|
-
compactArrayLikeADTDependencies(sparseCompactADT, states, dependencies);
|
|
221
|
-
}
|
|
222
|
-
};
|
|
223
|
-
/**
|
|
224
|
-
* Converts a {@link StateValue} into an array of state values by calling `asArray`. Throws an error if the cast fails.
|
|
225
|
-
*
|
|
226
|
-
* @param state To state to convert.
|
|
227
|
-
*/
|
|
228
|
-
const castToStateArray = (state) => {
|
|
229
|
-
const ledgerState = state.asArray();
|
|
230
|
-
assertCastSucceeded(ledgerState, state, 'array');
|
|
231
|
-
return ledgerState;
|
|
232
|
-
};
|
|
233
|
-
/**
|
|
234
|
-
* Extracts the contract references present in a {@link PublicLedgerSegments} by converting the given state value into
|
|
235
|
-
* a state array, iterating over the entries of {@link PublicLedgerSegments.indices}, and either recurring or calling
|
|
236
|
-
* {@link compactADTDependencies} with a {@link SparseCompactADT} value.
|
|
237
|
-
*
|
|
238
|
-
* @param publicLedgerSegments A data structure pointing to contract references in a segment of the ledger state of
|
|
239
|
-
* the root contract.
|
|
240
|
-
* @param state A segment of the ledger state of the root contract.
|
|
241
|
-
* @param dependencies The current set of contract addresses extracted from the input ledger state.
|
|
242
|
-
*/
|
|
243
|
-
const publicLedgerSegmentsDependencies = (publicLedgerSegments, state, dependencies) => {
|
|
244
|
-
const ledgerState = castToStateArray(state);
|
|
245
|
-
Object.keys(publicLedgerSegments.indices)
|
|
246
|
-
.map(parseInt)
|
|
247
|
-
.forEach((idx) => {
|
|
248
|
-
const referenceLocations = publicLedgerSegments.indices[idx];
|
|
249
|
-
if ('tag' in referenceLocations && referenceLocations['tag'] === 'publicLedgerArray') {
|
|
250
|
-
publicLedgerSegmentsDependencies(referenceLocations, ledgerState[idx], dependencies);
|
|
251
|
-
}
|
|
252
|
-
else {
|
|
253
|
-
compactADTDependencies(referenceLocations, ledgerState[idx], dependencies);
|
|
254
|
-
}
|
|
255
|
-
});
|
|
256
|
-
};
|
|
257
|
-
/**
|
|
258
|
-
* Given a {@link StateValue} representing the current ledger state of a contract, uses the {@link ContractReferenceLocations}
|
|
259
|
-
* object produced by the Compact compiler to extract the current contract addresses present in the given ledger state. The produced
|
|
260
|
-
* contract addresses represent the contracts on which the root contract depends. The dependencies are used in a multi-contract
|
|
261
|
-
* setting to fetch the ledger states of all contracts on which the root contract depends prior to execution.
|
|
262
|
-
*
|
|
263
|
-
* NOTE: The given {@link ContractReferenceLocations} must be from the contract executable containing the ledger state constructor
|
|
264
|
-
* that produced the given {@link StateValue}.
|
|
265
|
-
*
|
|
266
|
-
* @param contractReferenceLocations A data structure pointing to contract references in the ledger state of the root contract.
|
|
267
|
-
* @param state The current ledger state of the root contract.
|
|
268
|
-
* @returns A list of all contract addresses (references) present in the given ledger state.
|
|
269
|
-
*
|
|
270
|
-
* @remarks The algorithm has three main stages:
|
|
271
|
-
*
|
|
272
|
-
* 1. It unwraps the {@link PublicLedgerSegments} in the given {@link ContractReferenceLocations} until a {@link SparseCompactADT} is reached.
|
|
273
|
-
* Each time a {@link PublicLedgerSegments} is unwrapped, it casts the current state value to a state value array and proceeds recursively with each
|
|
274
|
-
* of the state values and unwrapped ledger segments.
|
|
275
|
-
* 2. It unwraps each {@link SparseCompactADT} in the current {@link PublicLedgerSegments} until a {@link SparseCompactType} is reached.
|
|
276
|
-
* Each time a {@link SparseCompactADT} is unwrapped, it casts the current state value to a state representation indicated by
|
|
277
|
-
* the {@link SparseCompactADT}.
|
|
278
|
-
* 3. Once the current state can no longer be reduced, it must represent a Compact contract address somewhere inside the state,
|
|
279
|
-
* and that contract address is added to the dependency set.
|
|
280
|
-
*/
|
|
281
|
-
export const contractDependencies = (contractReferenceLocations, state) => {
|
|
282
|
-
const dependencies = new Set();
|
|
283
|
-
if (contractReferenceLocations.indices) {
|
|
284
|
-
publicLedgerSegmentsDependencies(contractReferenceLocations, state, dependencies);
|
|
285
|
-
}
|
|
286
|
-
return [...dependencies];
|
|
287
|
-
};
|
|
288
|
-
//# sourceMappingURL=contract-dependencies.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"contract-dependencies.js","sourceRoot":"","sources":["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BAA0C,EAC1C,KAAsB,EACtB,YAAuC,EACjC,EAAE;IACR,MAAM,WAAW,GAAG,gBAAgB,CAAC,KAAK,CAAC,CAAC;IAC5C,MAAM,CAAC,IAAI,CAAC,oBAAoB,CAAC,OAAO,CAAC;SACtC,GAAG,CAAC,QAAQ,CAAC;SACb,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;QACf,MAAM,kBAAkB,GAAG,oBAAoB,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QAC7D,IAAI,KAAK,IAAI,kBAAkB,IAAI,kBAAkB,CAAC,KAAK,CAAC,KAAK,mBAAmB,EAAE,CAAC;YACrF,gCAAgC,CAAC,kBAAkB,EAAE,WAAW,CAAC,GAAG,CAAC,EAAE,YAAY,CAAC,CAAC;QACvF,CAAC;aAAM,CAAC;YACN,sBAAsB,CAAC,kBAAkB,EAAE,WAAW,CAAC,GAAG,CAAC,EAAE,YAAY,CAAC,CAAC;QAC7E,CAAC;IACH,CAAC,CAAC,CAAC;AACP,CAAC,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAClC,0BAAsD,EACtD,KAAsB,EACE,EAAE;IAC1B,MAAM,YAAY,GAAG,IAAI,GAAG,EAAwB,CAAC;IACrD,IAAI,0BAA0B,CAAC,OAAO,EAAE,CAAC;QACvC,gCAAgC,CAAC,0BAA0B,EAAE,KAAK,EAAE,YAAY,CAAC,CAAC;IACpF,CAAC;IACD,OAAO,CAAC,GAAG,YAAY,CAAC,CAAC;AAC3B,CAAC,CAAC"}
|
package/node_modules/@midnames/ns/node_modules/@midnight-ntwrk/compact-runtime/dist/error.d.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* An error originating from code generated by the Compact compiler
|
|
3
|
-
*/
|
|
4
|
-
export declare class CompactError extends Error {
|
|
5
|
-
constructor(msg: string);
|
|
6
|
-
}
|
|
7
|
-
/**
|
|
8
|
-
* Compiler internal for assertions
|
|
9
|
-
* @internal
|
|
10
|
-
*/
|
|
11
|
-
export declare function assert(b: boolean, s: string): void;
|
|
12
|
-
/**
|
|
13
|
-
* Compiler internal for type errors
|
|
14
|
-
* @internal
|
|
15
|
-
*/
|
|
16
|
-
export declare function typeError(who: string, what: string, where: string, type: string, x: any): never;
|
package/node_modules/@midnames/ns/node_modules/@midnight-ntwrk/compact-runtime/dist/error.js
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
// This file is part of Compact.
|
|
2
|
-
// Copyright (C) 2025 Midnight Foundation
|
|
3
|
-
// SPDX-License-Identifier: Apache-2.0
|
|
4
|
-
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
// you may not use this file except in compliance with the License.
|
|
6
|
-
// You may obtain a copy of the License at
|
|
7
|
-
//
|
|
8
|
-
// http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
//
|
|
10
|
-
// Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
// See the License for the specific language governing permissions and
|
|
14
|
-
// limitations under the License.
|
|
15
|
-
import inspect from 'object-inspect';
|
|
16
|
-
/**
|
|
17
|
-
* An error originating from code generated by the Compact compiler
|
|
18
|
-
*/
|
|
19
|
-
export class CompactError extends Error {
|
|
20
|
-
constructor(msg) {
|
|
21
|
-
super(msg);
|
|
22
|
-
this.name = 'CompactError';
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* Compiler internal for assertions
|
|
27
|
-
* @internal
|
|
28
|
-
*/
|
|
29
|
-
export function assert(b, s) {
|
|
30
|
-
if (!b) {
|
|
31
|
-
const msg = `failed assert: ${s}`;
|
|
32
|
-
throw new CompactError(msg);
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* Compiler internal for type errors
|
|
37
|
-
* @internal
|
|
38
|
-
*/
|
|
39
|
-
export function typeError(who, what, where, type, x) {
|
|
40
|
-
const msg = `type error: ${who} ${what} at ${where}; expected value of type ${type} but received ${inspect(x)}`;
|
|
41
|
-
throw new CompactError(msg);
|
|
42
|
-
}
|
|
43
|
-
//# sourceMappingURL=error.js.map
|
package/node_modules/@midnames/ns/node_modules/@midnight-ntwrk/compact-runtime/dist/error.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"error.js","sourceRoot":"","sources":["../src/error.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,yCAAyC;AACzC,sCAAsC;AACtC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,8CAA8C;AAC9C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,OAAO,OAAO,MAAM,gBAAgB,CAAC;AAErC;;GAEG;AACH,MAAM,OAAO,YAAa,SAAQ,KAAK;IACrC,YAAY,GAAW;QACrB,KAAK,CAAC,GAAG,CAAC,CAAC;QACX,IAAI,CAAC,IAAI,GAAG,cAAc,CAAC;IAC7B,CAAC;CACF;AAED;;;GAGG;AACH,MAAM,UAAU,MAAM,CAAC,CAAU,EAAE,CAAS;IAC1C,IAAI,CAAC,CAAC,EAAE,CAAC;QACP,MAAM,GAAG,GAAG,kBAAkB,CAAC,EAAE,CAAC;QAClC,MAAM,IAAI,YAAY,CAAC,GAAG,CAAC,CAAC;IAC9B,CAAC;AACH,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,SAAS,CAAC,GAAW,EAAE,IAAY,EAAE,KAAa,EAAE,IAAY,EAAE,CAAM;IACtF,MAAM,GAAG,GAAG,eAAe,GAAG,IAAI,IAAI,OAAO,KAAK,4BAA4B,IAAI,iBAAiB,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC;IAChH,MAAM,IAAI,YAAY,CAAC,GAAG,CAAC,CAAC;AAC9B,CAAC"}
|
package/node_modules/@midnames/ns/node_modules/@midnight-ntwrk/compact-runtime/dist/index.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export * from './version.js';
|
|
2
|
-
export * from './compact-types.js';
|
|
3
|
-
export * from './built-ins.js';
|
|
4
|
-
export * from './casts.js';
|
|
5
|
-
export * from './error.js';
|
|
6
|
-
export * from './constants.js';
|
|
7
|
-
export * from './zswap.js';
|
|
8
|
-
export * from './constructor-context.js';
|
|
9
|
-
export * from './circuit-context.js';
|
|
10
|
-
export * from './proof-data.js';
|
|
11
|
-
export * from './witness.js';
|
|
12
|
-
export * from './contract-dependencies.js';
|
|
13
|
-
export * from './utils.js';
|
|
14
|
-
export { Value, Alignment, AlignmentSegment, AlignmentAtom, AlignedValue, Nullifier, CoinCommitment, ContractAddress, UserAddress, RawTokenType, UnshieldedTokenType, ShieldedTokenType, DustTokenType, TokenType, DomainSeparator, CoinPublicKey, RunningCost, Nonce, SignatureVerifyingKey, SigningKey, Signature, Fr, ShieldedCoinInfo, QualifiedShieldedCoinInfo, Key, Op, GatherResult, EncodedStateValue, Transcript, PublicAddress, CallContext, BlockContext, Effects, CommunicationCommitment, CommunicationCommitmentRand, communicationCommitmentRandomness, communicationCommitment, entryPointHash, sampleSigningKey, signingKeyFromBip340, signData, signatureVerifyingKey, verifySignature, encodeRawTokenType, decodeRawTokenType, encodeContractAddress, decodeContractAddress, encodeUserAddress, decodeUserAddress, encodeCoinPublicKey, decodeCoinPublicKey, encodeShieldedCoinInfo, encodeQualifiedShieldedCoinInfo, decodeShieldedCoinInfo, decodeQualifiedShieldedCoinInfo, rawTokenType, sampleContractAddress, sampleUserAddress, sampleRawTokenType, dummyContractAddress, dummyUserAddress, runtimeCoinCommitment, leafHash, maxAlignedSize, maxField, proofDataIntoSerializedPreimage, bigIntModFr, valueToBigInt, bigIntToValue, runProgram, ContractOperation, ContractMaintenanceAuthority, ContractState, QueryContext, CostModel, QueryResults, StateBoundedMerkleTree, StateMap, ChargedState, StateValue, VmResults, VmStack, } from '@midnight-ntwrk/onchain-runtime-v3';
|
|
15
|
-
export { contractDependencies, ContractReferenceLocations, SparseCompactADT, SparseCompactCellADT, SparseCompactArrayLikeADT, SparseCompactMapADT, SparseCompactSetADT, SparseCompactListADT, SparseCompactValue, SparseCompactType, SparseCompactVector, SparseCompactStruct, SparseCompactContractAddress, } from './contract-dependencies.js';
|
package/node_modules/@midnames/ns/node_modules/@midnight-ntwrk/compact-runtime/dist/index.js
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
// This file is part of Compact.
|
|
2
|
-
// Copyright (C) 2025 Midnight Foundation
|
|
3
|
-
// SPDX-License-Identifier: Apache-2.0
|
|
4
|
-
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
// you may not use this file except in compliance with the License.
|
|
6
|
-
// You may obtain a copy of the License at
|
|
7
|
-
//
|
|
8
|
-
// http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
//
|
|
10
|
-
// Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
// See the License for the specific language governing permissions and
|
|
14
|
-
// limitations under the License.
|
|
15
|
-
export * from './version.js';
|
|
16
|
-
export * from './compact-types.js';
|
|
17
|
-
export * from './built-ins.js';
|
|
18
|
-
export * from './casts.js';
|
|
19
|
-
export * from './error.js';
|
|
20
|
-
export * from './constants.js';
|
|
21
|
-
export * from './zswap.js';
|
|
22
|
-
export * from './constructor-context.js';
|
|
23
|
-
export * from './circuit-context.js';
|
|
24
|
-
export * from './proof-data.js';
|
|
25
|
-
export * from './witness.js';
|
|
26
|
-
export * from './contract-dependencies.js';
|
|
27
|
-
export * from './utils.js';
|
|
28
|
-
export { communicationCommitmentRandomness, communicationCommitment, entryPointHash, sampleSigningKey, signingKeyFromBip340, signData, signatureVerifyingKey, verifySignature, encodeRawTokenType, decodeRawTokenType, encodeContractAddress, decodeContractAddress, encodeUserAddress, decodeUserAddress, encodeCoinPublicKey, decodeCoinPublicKey, encodeShieldedCoinInfo, encodeQualifiedShieldedCoinInfo, decodeShieldedCoinInfo, decodeQualifiedShieldedCoinInfo, rawTokenType, sampleContractAddress, sampleUserAddress, sampleRawTokenType, dummyContractAddress, dummyUserAddress, runtimeCoinCommitment, leafHash, maxAlignedSize, maxField, proofDataIntoSerializedPreimage, bigIntModFr, valueToBigInt, bigIntToValue, runProgram, ContractOperation, ContractMaintenanceAuthority, ContractState, QueryContext, CostModel, QueryResults, StateBoundedMerkleTree, StateMap, ChargedState, StateValue, VmResults, VmStack, } from '@midnight-ntwrk/onchain-runtime-v3';
|
|
29
|
-
export { contractDependencies, } from './contract-dependencies.js';
|
|
30
|
-
//# sourceMappingURL=index.js.map
|
package/node_modules/@midnames/ns/node_modules/@midnight-ntwrk/compact-runtime/dist/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,yCAAyC;AACzC,sCAAsC;AACtC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,8CAA8C;AAC9C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,0BAA0B,CAAC;AACzC,cAAc,sBAAsB,CAAC;AACrC,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,4BAA4B,CAAC;AAC3C,cAAc,YAAY,CAAC;AAE3B,OAAO,EAoCL,iCAAiC,EACjC,uBAAuB,EACvB,cAAc,EACd,gBAAgB,EAChB,oBAAoB,EACpB,QAAQ,EACR,qBAAqB,EACrB,eAAe,EACf,kBAAkB,EAClB,kBAAkB,EAClB,qBAAqB,EACrB,qBAAqB,EACrB,iBAAiB,EACjB,iBAAiB,EACjB,mBAAmB,EACnB,mBAAmB,EACnB,sBAAsB,EACtB,+BAA+B,EAC/B,sBAAsB,EACtB,+BAA+B,EAC/B,YAAY,EACZ,qBAAqB,EACrB,iBAAiB,EACjB,kBAAkB,EAClB,oBAAoB,EACpB,gBAAgB,EAChB,qBAAqB,EACrB,QAAQ,EACR,cAAc,EACd,QAAQ,EACR,+BAA+B,EAC/B,WAAW,EACX,aAAa,EACb,aAAa,EACb,UAAU,EACV,iBAAiB,EACjB,4BAA4B,EAC5B,aAAa,EACb,YAAY,EACZ,SAAS,EACT,YAAY,EACZ,sBAAsB,EACtB,QAAQ,EACR,YAAY,EACZ,UAAU,EACV,SAAS,EACT,OAAO,GACR,MAAM,oCAAoC,CAAC;AAE5C,OAAO,EACL,oBAAoB,GAarB,MAAM,4BAA4B,CAAC"}
|
package/node_modules/@midnames/ns/node_modules/@midnight-ntwrk/compact-runtime/dist/proof-data.d.ts
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import * as ocrt from '@midnight-ntwrk/onchain-runtime-v3';
|
|
2
|
-
/**
|
|
3
|
-
* Encapsulates the data required to produce a zero-knowledge proof except the circuit output
|
|
4
|
-
*/
|
|
5
|
-
export interface PartialProofData {
|
|
6
|
-
/**
|
|
7
|
-
* The inputs to a circuit
|
|
8
|
-
*/
|
|
9
|
-
input: ocrt.AlignedValue;
|
|
10
|
-
/**
|
|
11
|
-
* The public transcript of operations
|
|
12
|
-
*/
|
|
13
|
-
publicTranscript: ocrt.Op<ocrt.AlignedValue>[];
|
|
14
|
-
/**
|
|
15
|
-
* The transcript of the witness call outputs
|
|
16
|
-
*/
|
|
17
|
-
privateTranscriptOutputs: ocrt.AlignedValue[];
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* Encapsulates the data required to produce a zero-knowledge proof
|
|
21
|
-
*/
|
|
22
|
-
export interface ProofData extends PartialProofData {
|
|
23
|
-
/**
|
|
24
|
-
* The outputs from a circuit
|
|
25
|
-
*/
|
|
26
|
-
output: ocrt.AlignedValue;
|
|
27
|
-
}
|