@algorandfoundation/algokit-utils 10.0.0-alpha.3 → 10.0.0-alpha.32
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/_virtual/rolldown_runtime.js +10 -15
- package/abi/index.d.ts +2 -1
- package/abi/index.js +3 -0
- package/abi/index.mjs +2 -1
- package/account-manager.d.ts +448 -0
- package/account-manager.js +623 -0
- package/account-manager.js.map +1 -0
- package/account-manager.mjs +620 -0
- package/account-manager.mjs.map +1 -0
- package/account.d.ts +156 -0
- package/account.js +10 -0
- package/account.js.map +1 -0
- package/account.mjs +9 -0
- package/account.mjs.map +1 -0
- package/algod-client/index.d.ts +3 -7
- package/algod-client/index.js +2 -5
- package/algod-client/index.mjs +2 -2
- package/algorand-client-transaction-creator.d.ts +1103 -0
- package/algorand-client-transaction-creator.js +735 -0
- package/algorand-client-transaction-creator.js.map +1 -0
- package/algorand-client-transaction-creator.mjs +734 -0
- package/algorand-client-transaction-creator.mjs.map +1 -0
- package/algorand-client-transaction-sender.d.ts +1317 -0
- package/algorand-client-transaction-sender.js +933 -0
- package/algorand-client-transaction-sender.js.map +1 -0
- package/algorand-client-transaction-sender.mjs +932 -0
- package/algorand-client-transaction-sender.mjs.map +1 -0
- package/algorand-client.d.ts +246 -0
- package/algorand-client.js +325 -0
- package/algorand-client.js.map +1 -0
- package/algorand-client.mjs +325 -0
- package/algorand-client.mjs.map +1 -0
- package/amount.d.ts +46 -3
- package/amount.js +92 -13
- package/amount.js.map +1 -1
- package/amount.mjs +80 -3
- package/amount.mjs.map +1 -1
- package/app-client.d.ts +2130 -0
- package/app-client.js +909 -0
- package/app-client.js.map +1 -0
- package/app-client.mjs +908 -0
- package/app-client.mjs.map +1 -0
- package/app-deployer.d.ts +166 -0
- package/app-deployer.js +353 -0
- package/app-deployer.js.map +1 -0
- package/app-deployer.mjs +353 -0
- package/app-deployer.mjs.map +1 -0
- package/app-factory.d.ts +965 -0
- package/app-factory.js +448 -0
- package/app-factory.js.map +1 -0
- package/app-factory.mjs +448 -0
- package/app-factory.mjs.map +1 -0
- package/app-manager.d.ts +323 -0
- package/app-manager.js +468 -0
- package/app-manager.js.map +1 -0
- package/app-manager.mjs +468 -0
- package/app-manager.mjs.map +1 -0
- package/app-spec.d.ts +203 -0
- package/app-spec.js +137 -0
- package/app-spec.js.map +1 -0
- package/app-spec.mjs +137 -0
- package/app-spec.mjs.map +1 -0
- package/app.d.ts +257 -0
- package/app.js +49 -0
- package/app.js.map +1 -0
- package/app.mjs +42 -0
- package/app.mjs.map +1 -0
- package/asset-manager.d.ts +212 -0
- package/asset-manager.js +166 -0
- package/asset-manager.js.map +1 -0
- package/asset-manager.mjs +166 -0
- package/asset-manager.mjs.map +1 -0
- package/async-event-emitter.d.ts +16 -0
- package/async-event-emitter.js +38 -0
- package/async-event-emitter.js.map +1 -0
- package/async-event-emitter.mjs +37 -0
- package/async-event-emitter.mjs.map +1 -0
- package/client-manager.d.ts +475 -0
- package/client-manager.js +616 -0
- package/client-manager.js.map +1 -0
- package/client-manager.mjs +616 -0
- package/client-manager.mjs.map +1 -0
- package/composer.d.ts +947 -0
- package/composer.js +1584 -0
- package/composer.js.map +1 -0
- package/composer.mjs +1583 -0
- package/composer.mjs.map +1 -0
- package/config.d.ts +1 -1
- package/config.js +2 -2
- package/config.js.map +1 -1
- package/config.mjs +1 -1
- package/config.mjs.map +1 -1
- package/debugging.d.ts +47 -0
- package/debugging.js +20 -0
- package/debugging.js.map +1 -0
- package/debugging.mjs +15 -0
- package/debugging.mjs.map +1 -0
- package/dispenser-client.d.ts +90 -0
- package/dispenser-client.js +127 -0
- package/dispenser-client.js.map +1 -0
- package/dispenser-client.mjs +127 -0
- package/dispenser-client.mjs.map +1 -0
- package/expand.d.ts +2 -0
- package/expand.js +0 -0
- package/expand.mjs +0 -0
- package/index.d.ts +6 -6
- package/index.js +4 -10
- package/index.mjs +5 -6
- package/indexer-client/index.d.ts +2 -2
- package/indexer-client/index.js +6 -6
- package/indexer-client/index.mjs +2 -2
- package/{indexer-lookup.d.ts → indexer-client/indexer-lookup.d.ts} +8 -11
- package/{indexer-lookup.mjs → indexer-client/indexer-lookup.js} +6 -10
- package/indexer-client/indexer-lookup.js.map +1 -0
- package/{indexer-lookup.js → indexer-client/indexer-lookup.mjs} +3 -18
- package/indexer-client/indexer-lookup.mjs.map +1 -0
- package/indexer.d.ts +40 -0
- package/indexer.js +38 -0
- package/indexer.js.map +1 -0
- package/indexer.mjs +35 -0
- package/indexer.mjs.map +1 -0
- package/instance-of.d.ts +8 -0
- package/kmd-account-manager.d.ts +74 -0
- package/kmd-account-manager.js +167 -0
- package/kmd-account-manager.js.map +1 -0
- package/kmd-account-manager.mjs +165 -0
- package/kmd-account-manager.mjs.map +1 -0
- package/kmd-client/index.d.ts +1 -2
- package/kmd-client/index.js +0 -5
- package/kmd-client/index.mjs +1 -2
- package/lifecycle-events.d.ts +14 -0
- package/lifecycle-events.js +11 -0
- package/lifecycle-events.js.map +1 -0
- package/lifecycle-events.mjs +10 -0
- package/lifecycle-events.mjs.map +1 -0
- package/logging.d.ts +13 -0
- package/logging.js +47 -0
- package/logging.js.map +1 -0
- package/logging.mjs +42 -0
- package/logging.mjs.map +1 -0
- package/logic-error.d.ts +39 -0
- package/logic-error.js +54 -0
- package/logic-error.js.map +1 -0
- package/logic-error.mjs +53 -0
- package/logic-error.mjs.map +1 -0
- package/network-client.d.ts +43 -0
- package/network-client.js +14 -0
- package/network-client.js.map +1 -0
- package/network-client.mjs +13 -0
- package/network-client.mjs.map +1 -0
- package/package.json +14 -5
- package/packages/abi/src/abi-method.d.ts +1 -1
- package/packages/abi/src/abi-method.js +1 -1
- package/packages/abi/src/abi-method.js.map +1 -1
- package/packages/abi/src/abi-method.mjs +1 -1
- package/packages/abi/src/abi-method.mjs.map +1 -1
- package/packages/abi/src/abi-type.d.ts +1 -3
- package/packages/abi/src/abi-type.js +7 -36
- package/packages/abi/src/abi-type.js.map +1 -1
- package/packages/abi/src/abi-type.mjs +7 -36
- package/packages/abi/src/abi-type.mjs.map +1 -1
- package/packages/abi/src/arc56-contract.js +1 -0
- package/packages/abi/src/arc56-contract.js.map +1 -1
- package/packages/abi/src/arc56-contract.mjs +1 -0
- package/packages/abi/src/arc56-contract.mjs.map +1 -1
- package/packages/abi/src/utils.d.ts +22 -0
- package/packages/abi/src/utils.js +57 -0
- package/packages/abi/src/utils.js.map +1 -0
- package/packages/abi/src/utils.mjs +55 -0
- package/packages/abi/src/utils.mjs.map +1 -0
- package/packages/algo25/src/index.js +1 -1
- package/packages/algo25/src/index.mjs +1 -1
- package/packages/algod_client/src/apis/api-service.d.ts +44 -44
- package/packages/algod_client/src/apis/api-service.js +155 -155
- package/packages/algod_client/src/apis/api-service.js.map +1 -1
- package/packages/algod_client/src/apis/api-service.mjs +155 -155
- package/packages/algod_client/src/apis/api-service.mjs.map +1 -1
- package/packages/algod_client/src/core/api-error.js +3 -1
- package/packages/algod_client/src/core/api-error.js.map +1 -1
- package/packages/algod_client/src/core/api-error.mjs +3 -1
- package/packages/algod_client/src/core/api-error.mjs.map +1 -1
- package/packages/algod_client/src/core/model-runtime.js +6 -6
- package/packages/algod_client/src/core/model-runtime.js.map +1 -1
- package/packages/algod_client/src/core/model-runtime.mjs +8 -8
- package/packages/algod_client/src/core/model-runtime.mjs.map +1 -1
- package/packages/algod_client/src/models/account-participation.js +4 -4
- package/packages/algod_client/src/models/account-participation.js.map +1 -1
- package/packages/algod_client/src/models/account-participation.mjs +4 -4
- package/packages/algod_client/src/models/account-participation.mjs.map +1 -1
- package/packages/algod_client/src/models/application-state-schema.d.ts +2 -2
- package/packages/algod_client/src/models/application-state-schema.js +2 -2
- package/packages/algod_client/src/models/application-state-schema.js.map +1 -1
- package/packages/algod_client/src/models/application-state-schema.mjs +2 -2
- package/packages/algod_client/src/models/application-state-schema.mjs.map +1 -1
- package/packages/algod_client/src/models/asset-params.js +2 -1
- package/packages/algod_client/src/models/asset-params.js.map +1 -1
- package/packages/algod_client/src/models/asset-params.mjs +2 -1
- package/packages/algod_client/src/models/asset-params.mjs.map +1 -1
- package/packages/algod_client/src/models/block-response.js +1 -2
- package/packages/algod_client/src/models/block-response.js.map +1 -1
- package/packages/algod_client/src/models/block-response.mjs +2 -3
- package/packages/algod_client/src/models/block-response.mjs.map +1 -1
- package/packages/algod_client/src/models/block.d.ts +60 -40
- package/packages/algod_client/src/models/block.js +184 -108
- package/packages/algod_client/src/models/block.js.map +1 -1
- package/packages/algod_client/src/models/block.mjs +184 -108
- package/packages/algod_client/src/models/block.mjs.map +1 -1
- package/packages/algod_client/src/models/eval-delta-key-value.js +2 -2
- package/packages/algod_client/src/models/eval-delta-key-value.js.map +1 -1
- package/packages/algod_client/src/models/eval-delta-key-value.mjs +2 -2
- package/packages/algod_client/src/models/eval-delta-key-value.mjs.map +1 -1
- package/packages/algod_client/src/models/eval-delta.js +2 -2
- package/packages/algod_client/src/models/eval-delta.js.map +1 -1
- package/packages/algod_client/src/models/eval-delta.mjs +2 -2
- package/packages/algod_client/src/models/eval-delta.mjs.map +1 -1
- package/packages/algod_client/src/models/ledger-state-delta.js +1 -1
- package/packages/algod_client/src/models/ledger-state-delta.js.map +1 -1
- package/packages/algod_client/src/models/ledger-state-delta.mjs +2 -2
- package/packages/algod_client/src/models/ledger-state-delta.mjs.map +1 -1
- package/packages/algod_client/src/models/simulate-request.js +1 -1
- package/packages/algod_client/src/models/simulate-request.mjs +1 -1
- package/packages/algod_client/src/models/simulate-response.d.ts +2 -1
- package/packages/algod_client/src/models/simulate-response.js +6 -1
- package/packages/algod_client/src/models/simulate-response.js.map +1 -1
- package/packages/algod_client/src/models/simulate-response.mjs +6 -2
- package/packages/algod_client/src/models/simulate-response.mjs.map +1 -1
- package/packages/algod_client/src/models/simulate-unnamed-resources-accessed.d.ts +3 -5
- package/packages/algod_client/src/models/simulate-unnamed-resources-accessed.js +4 -6
- package/packages/algod_client/src/models/simulate-unnamed-resources-accessed.js.map +1 -1
- package/packages/algod_client/src/models/simulate-unnamed-resources-accessed.mjs +3 -5
- package/packages/algod_client/src/models/simulate-unnamed-resources-accessed.mjs.map +1 -1
- package/packages/algod_client/src/models/transaction-parameters-response.js +2 -2
- package/packages/algod_client/src/models/transaction-parameters-response.js.map +1 -1
- package/packages/algod_client/src/models/transaction-parameters-response.mjs +2 -2
- package/packages/algod_client/src/models/transaction-parameters-response.mjs.map +1 -1
- package/packages/common/src/address.d.ts +0 -1
- package/packages/common/src/address.js +4 -17
- package/packages/common/src/address.js.map +1 -1
- package/packages/common/src/address.mjs +5 -17
- package/packages/common/src/address.mjs.map +1 -1
- package/packages/common/src/codecs/composite/map.js +7 -4
- package/packages/common/src/codecs/composite/map.js.map +1 -1
- package/packages/common/src/codecs/composite/map.mjs +7 -4
- package/packages/common/src/codecs/composite/map.mjs.map +1 -1
- package/packages/common/src/codecs/composite/record.js +0 -1
- package/packages/common/src/codecs/composite/record.js.map +1 -1
- package/packages/common/src/codecs/primitives/address.js +0 -1
- package/packages/common/src/codecs/primitives/address.js.map +1 -1
- package/packages/common/src/codecs/primitives/bytes-base64.js +26 -0
- package/packages/common/src/codecs/primitives/bytes-base64.js.map +1 -0
- package/packages/common/src/codecs/primitives/bytes-base64.mjs +25 -0
- package/packages/common/src/codecs/primitives/bytes-base64.mjs.map +1 -0
- package/packages/common/src/codecs/primitives/bytes.js +0 -1
- package/packages/common/src/codecs/primitives/bytes.js.map +1 -1
- package/packages/common/src/codecs/primitives/fixed-bytes.js +0 -1
- package/packages/common/src/codecs/primitives/fixed-bytes.js.map +1 -1
- package/packages/common/src/codecs/wire.js +0 -1
- package/packages/common/src/codecs/wire.js.map +1 -1
- package/packages/common/src/json.mjs +2 -2
- package/packages/common/src/json.mjs.map +1 -1
- package/packages/common/src/msgpack.js +0 -1
- package/packages/common/src/msgpack.js.map +1 -1
- package/packages/{sdk/src/logic → common/src}/sourcemap.d.ts +2 -2
- package/packages/{sdk/src/logic → common/src}/sourcemap.js +2 -2
- package/packages/{sdk/src/logic → common/src}/sourcemap.js.map +1 -1
- package/packages/{sdk/src/logic → common/src}/sourcemap.mjs +1 -1
- package/packages/{sdk/src/logic → common/src}/sourcemap.mjs.map +1 -1
- package/packages/indexer_client/src/apis/api-service.d.ts +1 -1
- package/packages/indexer_client/src/apis/api-service.js +12 -12
- package/packages/indexer_client/src/apis/api-service.js.map +1 -1
- package/packages/indexer_client/src/apis/api-service.mjs +12 -12
- package/packages/indexer_client/src/apis/api-service.mjs.map +1 -1
- package/packages/indexer_client/src/core/api-error.js +3 -1
- package/packages/indexer_client/src/core/api-error.js.map +1 -1
- package/packages/indexer_client/src/core/api-error.mjs +3 -1
- package/packages/indexer_client/src/core/api-error.mjs.map +1 -1
- package/packages/indexer_client/src/core/model-runtime.js +0 -15
- package/packages/indexer_client/src/core/model-runtime.js.map +1 -1
- package/packages/indexer_client/src/core/model-runtime.mjs +1 -13
- package/packages/indexer_client/src/core/model-runtime.mjs.map +1 -1
- package/packages/indexer_client/src/models/account-participation.js +4 -4
- package/packages/indexer_client/src/models/account-participation.js.map +1 -1
- package/packages/indexer_client/src/models/account-participation.mjs +4 -4
- package/packages/indexer_client/src/models/account-participation.mjs.map +1 -1
- package/packages/indexer_client/src/models/application-state-schema.d.ts +2 -2
- package/packages/indexer_client/src/models/application-state-schema.js +2 -2
- package/packages/indexer_client/src/models/application-state-schema.js.map +1 -1
- package/packages/indexer_client/src/models/application-state-schema.mjs +2 -2
- package/packages/indexer_client/src/models/application-state-schema.mjs.map +1 -1
- package/packages/indexer_client/src/models/asset-params.js +2 -1
- package/packages/indexer_client/src/models/asset-params.js.map +1 -1
- package/packages/indexer_client/src/models/asset-params.mjs +2 -1
- package/packages/indexer_client/src/models/asset-params.mjs.map +1 -1
- package/packages/indexer_client/src/models/block.d.ts +5 -5
- package/packages/indexer_client/src/models/block.js +13 -13
- package/packages/indexer_client/src/models/block.js.map +1 -1
- package/packages/indexer_client/src/models/block.mjs +13 -13
- package/packages/indexer_client/src/models/block.mjs.map +1 -1
- package/packages/indexer_client/src/models/eval-delta-key-value.d.ts +1 -1
- package/packages/indexer_client/src/models/eval-delta-key-value.js +2 -2
- package/packages/indexer_client/src/models/eval-delta-key-value.js.map +1 -1
- package/packages/indexer_client/src/models/eval-delta-key-value.mjs +2 -2
- package/packages/indexer_client/src/models/eval-delta-key-value.mjs.map +1 -1
- package/packages/indexer_client/src/models/eval-delta.d.ts +1 -1
- package/packages/indexer_client/src/models/eval-delta.js +2 -2
- package/packages/indexer_client/src/models/eval-delta.js.map +1 -1
- package/packages/indexer_client/src/models/eval-delta.mjs +2 -2
- package/packages/indexer_client/src/models/eval-delta.mjs.map +1 -1
- package/packages/indexer_client/src/models/hb-proof-fields.js +6 -6
- package/packages/indexer_client/src/models/hb-proof-fields.js.map +1 -1
- package/packages/indexer_client/src/models/hb-proof-fields.mjs +6 -6
- package/packages/indexer_client/src/models/hb-proof-fields.mjs.map +1 -1
- package/packages/indexer_client/src/models/participation-updates.d.ts +2 -2
- package/packages/indexer_client/src/models/participation-updates.js +2 -2
- package/packages/indexer_client/src/models/participation-updates.js.map +1 -1
- package/packages/indexer_client/src/models/participation-updates.mjs +2 -2
- package/packages/indexer_client/src/models/participation-updates.mjs.map +1 -1
- package/packages/indexer_client/src/models/state-proof-verifier.js +2 -2
- package/packages/indexer_client/src/models/state-proof-verifier.js.map +1 -1
- package/packages/indexer_client/src/models/state-proof-verifier.mjs +2 -2
- package/packages/indexer_client/src/models/state-proof-verifier.mjs.map +1 -1
- package/packages/indexer_client/src/models/state-schema.d.ts +2 -2
- package/packages/indexer_client/src/models/state-schema.js +2 -2
- package/packages/indexer_client/src/models/state-schema.js.map +1 -1
- package/packages/indexer_client/src/models/state-schema.mjs +2 -2
- package/packages/indexer_client/src/models/state-schema.mjs.map +1 -1
- package/packages/indexer_client/src/models/teal-key-value.d.ts +1 -1
- package/packages/indexer_client/src/models/teal-key-value.js +2 -2
- package/packages/indexer_client/src/models/teal-key-value.js.map +1 -1
- package/packages/indexer_client/src/models/teal-key-value.mjs +2 -2
- package/packages/indexer_client/src/models/teal-key-value.mjs.map +1 -1
- package/packages/indexer_client/src/models/transaction-heartbeat.js +2 -1
- package/packages/indexer_client/src/models/transaction-heartbeat.js.map +1 -1
- package/packages/indexer_client/src/models/transaction-heartbeat.mjs +2 -1
- package/packages/indexer_client/src/models/transaction-heartbeat.mjs.map +1 -1
- package/packages/indexer_client/src/models/transaction-keyreg.js +4 -4
- package/packages/indexer_client/src/models/transaction-keyreg.js.map +1 -1
- package/packages/indexer_client/src/models/transaction-keyreg.mjs +4 -4
- package/packages/indexer_client/src/models/transaction-keyreg.mjs.map +1 -1
- package/packages/indexer_client/src/models/transaction-signature-logicsig.js +2 -1
- package/packages/indexer_client/src/models/transaction-signature-logicsig.js.map +1 -1
- package/packages/indexer_client/src/models/transaction-signature-logicsig.mjs +2 -1
- package/packages/indexer_client/src/models/transaction-signature-logicsig.mjs.map +1 -1
- package/packages/indexer_client/src/models/transaction-signature-multisig-subsignature.js +3 -3
- package/packages/indexer_client/src/models/transaction-signature-multisig-subsignature.js.map +1 -1
- package/packages/indexer_client/src/models/transaction-signature-multisig-subsignature.mjs +3 -3
- package/packages/indexer_client/src/models/transaction-signature-multisig-subsignature.mjs.map +1 -1
- package/packages/indexer_client/src/models/transaction-state-proof.d.ts +1 -1
- package/packages/indexer_client/src/models/transaction-state-proof.js +2 -2
- package/packages/indexer_client/src/models/transaction-state-proof.js.map +1 -1
- package/packages/indexer_client/src/models/transaction-state-proof.mjs +2 -2
- package/packages/indexer_client/src/models/transaction-state-proof.mjs.map +1 -1
- package/packages/indexer_client/src/models/transaction.d.ts +2 -2
- package/packages/indexer_client/src/models/transaction.js +6 -5
- package/packages/indexer_client/src/models/transaction.js.map +1 -1
- package/packages/indexer_client/src/models/transaction.mjs +6 -5
- package/packages/indexer_client/src/models/transaction.mjs.map +1 -1
- package/packages/kmd_client/src/apis/api-service.d.ts +5 -5
- package/packages/kmd_client/src/apis/api-service.js +32 -32
- package/packages/kmd_client/src/apis/api-service.js.map +1 -1
- package/packages/kmd_client/src/apis/api-service.mjs +32 -32
- package/packages/kmd_client/src/apis/api-service.mjs.map +1 -1
- package/packages/kmd_client/src/core/api-error.js +3 -1
- package/packages/kmd_client/src/core/api-error.js.map +1 -1
- package/packages/kmd_client/src/core/api-error.mjs +3 -1
- package/packages/kmd_client/src/core/api-error.mjs.map +1 -1
- package/packages/kmd_client/src/core/model-runtime.js +2 -12
- package/packages/kmd_client/src/core/model-runtime.js.map +1 -1
- package/packages/kmd_client/src/core/model-runtime.mjs +3 -11
- package/packages/kmd_client/src/core/model-runtime.mjs.map +1 -1
- package/packages/transact/src/logicsig.d.ts +35 -33
- package/packages/transact/src/logicsig.js +74 -76
- package/packages/transact/src/logicsig.js.map +1 -1
- package/packages/transact/src/logicsig.mjs +77 -78
- package/packages/transact/src/logicsig.mjs.map +1 -1
- package/packages/transact/src/multisig.d.ts +11 -116
- package/packages/transact/src/multisig.js +106 -136
- package/packages/transact/src/multisig.js.map +1 -1
- package/packages/transact/src/multisig.mjs +108 -118
- package/packages/transact/src/multisig.mjs.map +1 -1
- package/packages/transact/src/signer.js +9 -2
- package/packages/transact/src/signer.js.map +1 -1
- package/packages/transact/src/signer.mjs +10 -3
- package/packages/transact/src/signer.mjs.map +1 -1
- package/packages/transact/src/transactions/app-call.d.ts +10 -15
- package/packages/transact/src/transactions/app-call.js.map +1 -1
- package/packages/transact/src/transactions/app-call.mjs.map +1 -1
- package/packages/transact/src/transactions/asset-config.d.ts +1 -6
- package/packages/transact/src/transactions/asset-config.js.map +1 -1
- package/packages/transact/src/transactions/asset-config.mjs.map +1 -1
- package/packages/transact/src/transactions/asset-freeze.d.ts +1 -6
- package/packages/transact/src/transactions/asset-transfer.d.ts +1 -6
- package/packages/transact/src/transactions/key-registration.d.ts +1 -8
- package/packages/transact/src/transactions/reference-types-meta.d.ts +26 -0
- package/packages/transact/src/transactions/reference-types-meta.js +71 -0
- package/packages/transact/src/transactions/reference-types-meta.js.map +1 -0
- package/packages/transact/src/transactions/reference-types-meta.mjs +69 -0
- package/packages/transact/src/transactions/reference-types-meta.mjs.map +1 -0
- package/packages/transact/src/transactions/signed-transaction-meta.js +8 -9
- package/packages/transact/src/transactions/signed-transaction-meta.js.map +1 -1
- package/packages/transact/src/transactions/signed-transaction-meta.mjs +8 -8
- package/packages/transact/src/transactions/signed-transaction-meta.mjs.map +1 -1
- package/packages/transact/src/transactions/signed-transaction.d.ts +10 -6
- package/packages/transact/src/transactions/signed-transaction.js +1 -1
- package/packages/transact/src/transactions/signed-transaction.js.map +1 -1
- package/packages/transact/src/transactions/signed-transaction.mjs +1 -2
- package/packages/transact/src/transactions/signed-transaction.mjs.map +1 -1
- package/packages/transact/src/transactions/state-proof.d.ts +1 -1
- package/packages/transact/src/transactions/transaction-meta.js +29 -23
- package/packages/transact/src/transactions/transaction-meta.js.map +1 -1
- package/packages/transact/src/transactions/transaction-meta.mjs +29 -23
- package/packages/transact/src/transactions/transaction-meta.mjs.map +1 -1
- package/packages/transact/src/transactions/transaction.d.ts +5 -2
- package/packages/transact/src/transactions/transaction.js +5 -4
- package/packages/transact/src/transactions/transaction.js.map +1 -1
- package/packages/transact/src/transactions/transaction.mjs +5 -4
- package/packages/transact/src/transactions/transaction.mjs.map +1 -1
- package/testing/account.d.ts +2 -2
- package/testing/account.js +2 -3
- package/testing/account.js.map +1 -1
- package/testing/account.mjs +2 -3
- package/testing/account.mjs.map +1 -1
- package/testing/fixtures/algokit-log-capture-fixture.d.ts +1 -1
- package/testing/fixtures/algokit-log-capture-fixture.js.map +1 -1
- package/testing/fixtures/algokit-log-capture-fixture.mjs.map +1 -1
- package/testing/fixtures/algorand-fixture.d.ts +5 -5
- package/testing/fixtures/algorand-fixture.js +2 -2
- package/testing/fixtures/algorand-fixture.js.map +1 -1
- package/testing/fixtures/algorand-fixture.mjs +2 -2
- package/testing/fixtures/algorand-fixture.mjs.map +1 -1
- package/testing/index.d.ts +2 -1
- package/testing/test-logger.d.ts +1 -1
- package/testing/test-logger.js.map +1 -1
- package/testing/test-logger.mjs.map +1 -1
- package/testing/transaction-logger.js +1 -1
- package/testing/transaction-logger.mjs +1 -1
- package/testing/types.d.ts +156 -0
- package/transact/index.d.ts +11 -10
- package/transact/index.js +7 -31
- package/transact/index.mjs +7 -10
- package/transaction/index.d.ts +4 -0
- package/transaction/index.js +9 -0
- package/transaction/index.mjs +4 -0
- package/transaction/perform-transaction-composer-simulate.d.ts +1 -1
- package/transaction/perform-transaction-composer-simulate.js.map +1 -1
- package/transaction/perform-transaction-composer-simulate.mjs.map +1 -1
- package/transaction/transaction.d.ts +2 -2
- package/transaction/transaction.js +2 -2
- package/transaction/transaction.js.map +1 -1
- package/transaction/transaction.mjs +2 -2
- package/transaction/transaction.mjs.map +1 -1
- package/transaction/types.d.ts +133 -0
- package/transactions/app-call.d.ts +6 -5
- package/transactions/app-call.js +17 -17
- package/transactions/app-call.js.map +1 -1
- package/transactions/app-call.mjs +17 -17
- package/transactions/app-call.mjs.map +1 -1
- package/transactions/asset-config.d.ts +1 -1
- package/transactions/asset-config.js +1 -1
- package/transactions/asset-config.js.map +1 -1
- package/transactions/asset-config.mjs +1 -1
- package/transactions/asset-config.mjs.map +1 -1
- package/transactions/common.d.ts +1 -1
- package/transactions/common.js.map +1 -1
- package/transactions/common.mjs.map +1 -1
- package/transactions/key-registration.d.ts +1 -1
- package/transactions/key-registration.js.map +1 -1
- package/transactions/key-registration.mjs.map +1 -1
- package/transactions/method-call.d.ts +2 -2
- package/transactions/method-call.js +78 -85
- package/transactions/method-call.js.map +1 -1
- package/transactions/method-call.mjs +78 -85
- package/transactions/method-call.mjs.map +1 -1
- package/transactions/payment.d.ts +1 -1
- package/transactions/payment.js.map +1 -1
- package/transactions/payment.mjs.map +1 -1
- package/types/account-manager.d.ts +11 -444
- package/types/account-manager.js +5 -606
- package/types/account-manager.js.map +1 -1
- package/types/account-manager.mjs +5 -604
- package/types/account-manager.mjs.map +1 -1
- package/types/account.d.ts +8 -150
- package/types/account.js +3 -4
- package/types/account.js.map +1 -1
- package/types/account.mjs +4 -4
- package/types/account.mjs.map +1 -1
- package/types/algorand-client-transaction-creator.d.ts +5 -1084
- package/types/algorand-client-transaction-creator.js +3 -721
- package/types/algorand-client-transaction-creator.js.map +1 -1
- package/types/algorand-client-transaction-creator.mjs +4 -721
- package/types/algorand-client-transaction-creator.mjs.map +1 -1
- package/types/algorand-client-transaction-sender.d.ts +5 -1298
- package/types/algorand-client-transaction-sender.js +3 -920
- package/types/algorand-client-transaction-sender.js.map +1 -1
- package/types/algorand-client-transaction-sender.mjs +3 -918
- package/types/algorand-client-transaction-sender.mjs.map +1 -1
- package/types/algorand-client.d.ts +5 -241
- package/types/algorand-client.js +3 -319
- package/types/algorand-client.js.map +1 -1
- package/types/algorand-client.mjs +3 -319
- package/types/algorand-client.mjs.map +1 -1
- package/types/amount.d.ts +6 -45
- package/types/amount.js +3 -60
- package/types/amount.js.map +1 -1
- package/types/amount.mjs +3 -60
- package/types/amount.mjs.map +1 -1
- package/types/app-client.d.ts +75 -2120
- package/types/app-client.js +3 -904
- package/types/app-client.js.map +1 -1
- package/types/app-client.mjs +3 -902
- package/types/app-client.mjs.map +1 -1
- package/types/app-deployer.d.ts +21 -161
- package/types/app-deployer.js +3 -347
- package/types/app-deployer.js.map +1 -1
- package/types/app-deployer.mjs +3 -347
- package/types/app-deployer.mjs.map +1 -1
- package/types/app-factory.d.ts +21 -957
- package/types/app-factory.js +3 -442
- package/types/app-factory.js.map +1 -1
- package/types/app-factory.mjs +3 -442
- package/types/app-factory.mjs.map +1 -1
- package/types/app-manager.d.ts +15 -316
- package/types/app-manager.js +3 -456
- package/types/app-manager.js.map +1 -1
- package/types/app-manager.mjs +3 -456
- package/types/app-manager.mjs.map +1 -1
- package/types/app-spec.d.ts +39 -198
- package/types/app-spec.js +3 -124
- package/types/app-spec.js.map +1 -1
- package/types/app-spec.mjs +3 -124
- package/types/app-spec.mjs.map +1 -1
- package/types/app.d.ts +62 -247
- package/types/app.js +15 -37
- package/types/app.js.map +1 -1
- package/types/app.mjs +16 -37
- package/types/app.mjs.map +1 -1
- package/types/asset-manager.d.ts +9 -207
- package/types/asset-manager.js +3 -160
- package/types/asset-manager.js.map +1 -1
- package/types/asset-manager.mjs +3 -160
- package/types/asset-manager.mjs.map +1 -1
- package/types/async-event-emitter.d.ts +7 -14
- package/types/async-event-emitter.js +3 -32
- package/types/async-event-emitter.js.map +1 -1
- package/types/async-event-emitter.mjs +4 -32
- package/types/async-event-emitter.mjs.map +1 -1
- package/types/client-manager.d.ts +27 -470
- package/types/client-manager.js +3 -610
- package/types/client-manager.js.map +1 -1
- package/types/client-manager.mjs +3 -610
- package/types/client-manager.mjs.map +1 -1
- package/types/composer.d.ts +79 -935
- package/types/composer.js +3 -1569
- package/types/composer.js.map +1 -1
- package/types/composer.mjs +3 -1567
- package/types/composer.mjs.map +1 -1
- package/types/config.d.ts +7 -52
- package/types/config.js +3 -74
- package/types/config.js.map +1 -1
- package/types/config.mjs +3 -74
- package/types/config.mjs.map +1 -1
- package/types/debugging.d.ts +12 -33
- package/types/debugging.js +11 -10
- package/types/debugging.js.map +1 -1
- package/types/debugging.mjs +12 -10
- package/types/debugging.mjs.map +1 -1
- package/types/dispenser-client.d.ts +11 -85
- package/types/dispenser-client.js +3 -121
- package/types/dispenser-client.js.map +1 -1
- package/types/dispenser-client.mjs +3 -121
- package/types/dispenser-client.mjs.map +1 -1
- package/types/expand.d.ts +4 -5
- package/types/indexer.d.ts +16 -36
- package/types/indexer.js +7 -30
- package/types/indexer.js.map +1 -1
- package/types/indexer.mjs +8 -30
- package/types/indexer.mjs.map +1 -1
- package/types/instance-of.d.ts +4 -4
- package/types/kmd-account-manager.d.ts +5 -68
- package/types/kmd-account-manager.js +3 -150
- package/types/kmd-account-manager.js.map +1 -1
- package/types/kmd-account-manager.mjs +3 -148
- package/types/kmd-account-manager.mjs.map +1 -1
- package/types/lifecycle-events.d.ts +7 -10
- package/types/lifecycle-events.js +3 -5
- package/types/lifecycle-events.js.map +1 -1
- package/types/lifecycle-events.mjs +4 -5
- package/types/lifecycle-events.mjs.map +1 -1
- package/types/logging.d.ts +14 -9
- package/types/logging.js +11 -37
- package/types/logging.js.map +1 -1
- package/types/logging.mjs +12 -37
- package/types/logging.mjs.map +1 -1
- package/types/logic-error.d.ts +8 -35
- package/types/logic-error.js +3 -48
- package/types/logic-error.js.map +1 -1
- package/types/logic-error.mjs +4 -48
- package/types/logic-error.mjs.map +1 -1
- package/types/network-client.d.ts +10 -39
- package/types/network-client.js +3 -8
- package/types/network-client.js.map +1 -1
- package/types/network-client.mjs +4 -8
- package/types/network-client.mjs.map +1 -1
- package/types/testing.d.ts +13 -151
- package/types/transaction.d.ts +33 -128
- package/updatable-config.d.ts +57 -0
- package/updatable-config.js +80 -0
- package/updatable-config.js.map +1 -0
- package/updatable-config.mjs +80 -0
- package/updatable-config.mjs.map +1 -0
- package/util.js +1 -1
- package/util.js.map +1 -1
- package/util.mjs +1 -1
- package/util.mjs.map +1 -1
- package/_virtual/rolldown_runtime.mjs +0 -13
- package/indexer-lookup.js.map +0 -1
- package/indexer-lookup.mjs.map +0 -1
- package/packages/algod_client/src/core/model-runtime.d.ts +0 -10
- package/packages/algod_client/src/models/application-local-reference.d.ts +0 -20
- package/packages/algod_client/src/models/application-local-reference.js +0 -23
- package/packages/algod_client/src/models/application-local-reference.js.map +0 -1
- package/packages/algod_client/src/models/application-local-reference.mjs +0 -23
- package/packages/algod_client/src/models/application-local-reference.mjs.map +0 -1
- package/packages/algod_client/src/models/asset-holding-reference.d.ts +0 -20
- package/packages/algod_client/src/models/asset-holding-reference.js +0 -23
- package/packages/algod_client/src/models/asset-holding-reference.js.map +0 -1
- package/packages/algod_client/src/models/asset-holding-reference.mjs +0 -23
- package/packages/algod_client/src/models/asset-holding-reference.mjs.map +0 -1
- package/packages/algod_client/src/models/box-reference.d.ts +0 -17
- package/packages/algod_client/src/models/box-reference.js +0 -23
- package/packages/algod_client/src/models/box-reference.js.map +0 -1
- package/packages/algod_client/src/models/box-reference.mjs +0 -23
- package/packages/algod_client/src/models/box-reference.mjs.map +0 -1
- package/packages/indexer_client/src/core/model-runtime.d.ts +0 -10
- package/packages/kmd_client/src/core/model-runtime.d.ts +0 -10
- package/packages/sdk/src/convert.d.ts +0 -17
- package/packages/sdk/src/convert.js +0 -28
- package/packages/sdk/src/convert.js.map +0 -1
- package/packages/sdk/src/convert.mjs +0 -25
- package/packages/sdk/src/convert.mjs.map +0 -1
- package/packages/sdk/src/encoding/binarydata.d.ts +0 -34
- package/packages/sdk/src/encoding/binarydata.js +0 -65
- package/packages/sdk/src/encoding/binarydata.js.map +0 -1
- package/packages/sdk/src/encoding/binarydata.mjs +0 -60
- package/packages/sdk/src/encoding/binarydata.mjs.map +0 -1
- package/packages/sdk/src/encoding/encoding.d.ts +0 -237
- package/packages/sdk/src/encoding/encoding.js +0 -302
- package/packages/sdk/src/encoding/encoding.js.map +0 -1
- package/packages/sdk/src/encoding/encoding.mjs +0 -287
- package/packages/sdk/src/encoding/encoding.mjs.map +0 -1
- package/packages/sdk/src/encoding/schema/array.js +0 -35
- package/packages/sdk/src/encoding/schema/array.js.map +0 -1
- package/packages/sdk/src/encoding/schema/array.mjs +0 -35
- package/packages/sdk/src/encoding/schema/array.mjs.map +0 -1
- package/packages/sdk/src/encoding/schema/bytearray.js +0 -49
- package/packages/sdk/src/encoding/schema/bytearray.js.map +0 -1
- package/packages/sdk/src/encoding/schema/bytearray.mjs +0 -49
- package/packages/sdk/src/encoding/schema/bytearray.mjs.map +0 -1
- package/packages/sdk/src/encoding/schema/map.d.ts +0 -58
- package/packages/sdk/src/encoding/schema/map.js +0 -110
- package/packages/sdk/src/encoding/schema/map.js.map +0 -1
- package/packages/sdk/src/encoding/schema/map.mjs +0 -107
- package/packages/sdk/src/encoding/schema/map.mjs.map +0 -1
- package/packages/sdk/src/encoding/schema/optional.js +0 -46
- package/packages/sdk/src/encoding/schema/optional.js.map +0 -1
- package/packages/sdk/src/encoding/schema/optional.mjs +0 -46
- package/packages/sdk/src/encoding/schema/optional.mjs.map +0 -1
- package/packages/sdk/src/encoding/schema/uint64.js +0 -30
- package/packages/sdk/src/encoding/schema/uint64.js.map +0 -1
- package/packages/sdk/src/encoding/schema/uint64.mjs +0 -30
- package/packages/sdk/src/encoding/schema/uint64.mjs.map +0 -1
- package/packages/sdk/src/encoding/uint64.d.ts +0 -34
- package/packages/sdk/src/encoding/uint64.js +0 -34
- package/packages/sdk/src/encoding/uint64.js.map +0 -1
- package/packages/sdk/src/encoding/uint64.mjs +0 -33
- package/packages/sdk/src/encoding/uint64.mjs.map +0 -1
- package/packages/sdk/src/index.d.ts +0 -44
- package/packages/sdk/src/index.js +0 -62
- package/packages/sdk/src/index.js.map +0 -1
- package/packages/sdk/src/index.mjs +0 -58
- package/packages/sdk/src/index.mjs.map +0 -1
- package/packages/sdk/src/nacl/naclWrappers.js +0 -14
- package/packages/sdk/src/nacl/naclWrappers.js.map +0 -1
- package/packages/sdk/src/nacl/naclWrappers.mjs +0 -11
- package/packages/sdk/src/nacl/naclWrappers.mjs.map +0 -1
- package/packages/sdk/src/types/intDecoding.d.ts +0 -28
- package/packages/sdk/src/types/intDecoding.js +0 -32
- package/packages/sdk/src/types/intDecoding.js.map +0 -1
- package/packages/sdk/src/types/intDecoding.mjs +0 -31
- package/packages/sdk/src/types/intDecoding.mjs.map +0 -1
- package/packages/sdk/src/types/transactions/encoded.d.ts +0 -40
- package/packages/sdk/src/types/transactions/encoded.js +0 -64
- package/packages/sdk/src/types/transactions/encoded.js.map +0 -1
- package/packages/sdk/src/types/transactions/encoded.mjs +0 -59
- package/packages/sdk/src/types/transactions/encoded.mjs.map +0 -1
- package/packages/sdk/src/utils/utils.d.ts +0 -64
- package/packages/sdk/src/utils/utils.js +0 -140
- package/packages/sdk/src/utils/utils.js.map +0 -1
- package/packages/sdk/src/utils/utils.mjs +0 -128
- package/packages/sdk/src/utils/utils.mjs.map +0 -1
- package/packages/transact/src/transactions/common.d.ts +0 -37
- package/sdk/index.d.ts +0 -10
- package/sdk/index.js +0 -59
- package/sdk/index.mjs +0 -11
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"uint64.mjs","names":[],"sources":["../../../../../packages/sdk/src/encoding/uint64.ts"],"sourcesContent":["import { concatArrays } from '../utils/utils.js'\n\n// NOTE: at the moment we specifically do not use Buffer.writeBigUInt64BE and\n// Buffer.readBigUInt64BE. This is because projects using webpack v4\n// automatically include an old version of the npm `buffer` package (v4.9.2 at\n// the time of writing), and this old version does not have these methods.\n\n/**\n * encodeUint64 converts an integer to its binary representation.\n * @param num - The number to convert. This must be an unsigned integer less than\n * 2^64.\n * @returns An 8-byte typed array containing the big-endian encoding of the input\n * integer.\n */\nexport function encodeUint64(num: number | bigint) {\n const isInteger = typeof num === 'bigint' || Number.isInteger(num)\n\n if (!isInteger || num < 0 || num > BigInt('0xffffffffffffffff')) {\n throw new Error('Input is not a 64-bit unsigned integer')\n }\n\n const encoding = new Uint8Array(8)\n const view = new DataView(encoding.buffer)\n view.setBigUint64(0, BigInt(num))\n\n return encoding\n}\n\n/**\n * decodeUint64 produces an integer from a binary representation.\n * @param data - An typed array containing the big-endian encoding of an unsigned integer\n * less than 2^64. This array must be at most 8 bytes long.\n * @param decodingMode - Configure how the integer will be\n * decoded.\n *\n * The options are:\n * * \"safe\": The integer will be decoded as a Number, but if it is greater than\n * Number.MAX_SAFE_INTEGER an error will be thrown.\n * * \"mixed\": The integer will be decoded as a Number if it is less than or equal to\n * Number.MAX_SAFE_INTEGER, otherwise it will be decoded as a BigInt.\n * * \"bigint\": The integer will always be decoded as a BigInt.\n *\n * Defaults to \"safe\" if not included.\n * @returns The integer that was encoded in the input data. The return type will\n * be determined by the parameter decodingMode.\n */\nexport function decodeUint64(data: Uint8Array, decodingMode: 'safe'): number\nexport function decodeUint64(data: Uint8Array, decodingMode: 'mixed'): number | bigint\nexport function decodeUint64(data: Uint8Array, decodingMode: 'bigint'): bigint\nexport function decodeUint64(data: Uint8Array): number\nexport function decodeUint64(data: any, decodingMode: any = 'safe') {\n if (decodingMode !== 'safe' && decodingMode !== 'mixed' && decodingMode !== 'bigint') {\n throw new Error(`Unknown decodingMode option: ${decodingMode}`)\n }\n\n if (data.byteLength === 0 || data.byteLength > 8) {\n throw new Error(`Data has unacceptable length. Expected length is between 1 and 8, got ${data.byteLength}`)\n }\n\n // insert 0s at the beginning if data is smaller than 8 bytes\n const padding = new Uint8Array(8 - data.byteLength)\n const encoding = concatArrays(padding, data)\n const view = new DataView(encoding.buffer)\n\n const num = view.getBigUint64(0)\n const isBig = num > BigInt(Number.MAX_SAFE_INTEGER)\n\n if (decodingMode === 'safe') {\n if (isBig) {\n throw new Error(`Integer exceeds maximum safe integer: ${num.toString()}. Try decoding with \"mixed\" or \"safe\" decodingMode.`)\n }\n return Number(num)\n }\n\n if (decodingMode === 'mixed' && !isBig) {\n return Number(num)\n }\n\n return num\n}\n"],"mappings":";;;;;;;;;;AAcA,SAAgB,aAAa,KAAsB;AAGjD,KAAI,EAFc,OAAO,QAAQ,YAAY,OAAO,UAAU,IAAI,KAEhD,MAAM,KAAK,MAAM,OAAO,qBAAqB,CAC7D,OAAM,IAAI,MAAM,yCAAyC;CAG3D,MAAM,WAAW,IAAI,WAAW,EAAE;AAElC,CADa,IAAI,SAAS,SAAS,OAAO,CACrC,aAAa,GAAG,OAAO,IAAI,CAAC;AAEjC,QAAO;;AAyBT,SAAgB,aAAa,MAAW,eAAoB,QAAQ;AAClE,KAAI,iBAAiB,UAAU,iBAAiB,WAAW,iBAAiB,SAC1E,OAAM,IAAI,MAAM,gCAAgC,eAAe;AAGjE,KAAI,KAAK,eAAe,KAAK,KAAK,aAAa,EAC7C,OAAM,IAAI,MAAM,yEAAyE,KAAK,aAAa;CAK7G,MAAM,WAAW,aADD,IAAI,WAAW,IAAI,KAAK,WAAW,EACZ,KAAK;CAG5C,MAAM,MAFO,IAAI,SAAS,SAAS,OAAO,CAEzB,aAAa,EAAE;CAChC,MAAM,QAAQ,MAAM,OAAO,OAAO,iBAAiB;AAEnD,KAAI,iBAAiB,QAAQ;AAC3B,MAAI,MACF,OAAM,IAAI,MAAM,yCAAyC,IAAI,UAAU,CAAC,qDAAqD;AAE/H,SAAO,OAAO,IAAI;;AAGpB,KAAI,iBAAiB,WAAW,CAAC,MAC/B,QAAO,OAAO,IAAI;AAGpB,QAAO"}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { Transaction } from "../../transact/src/transactions/transaction.js";
|
|
2
|
-
import { INVALID_MICROALGOS_ERROR_MSG, algosToMicroalgos, microalgosToAlgos } from "./convert.js";
|
|
3
|
-
import { base64ToBytes, bytesToBase64, bytesToHex, bytesToString, coerceToBytes, hexToBytes } from "./encoding/binarydata.js";
|
|
4
|
-
import { IntDecoding } from "./types/intDecoding.js";
|
|
5
|
-
import { ERROR_CONTAINS_EMPTY_STRING, Encodable, EncodableClass, EncodeJSONOptions, JSONEncodingData, MsgpackEncodingData, MsgpackRawStringProvider, PrepareJSONOptions, Schema, decodeJSON, decodeMsgpack, decodeObj, encodeJSON, encodeMsgpack, encodeObj, jsonEncodingDataToMsgpackEncodingData, msgpackEncodingDataToJSONEncodingData, msgpackRawDecode, msgpackRawDecodeAsMap, msgpackRawEncode } from "./encoding/encoding.js";
|
|
6
|
-
import { decodeUint64, encodeUint64 } from "./encoding/uint64.js";
|
|
7
|
-
import { PcLineLocation, ProgramSourceMap, SourceLocation } from "./logic/sourcemap.js";
|
|
8
|
-
import { ENCODED_MULTISIG_SCHEMA, ENCODED_SUBSIG_SCHEMA, EncodedMultisig, EncodedSubsig, encodedMultiSigFromEncodingData, encodedMultiSigToEncodingData, encodedSubsigFromEncodingData, encodedSubsigToEncodingData } from "./types/transactions/encoded.js";
|
|
9
|
-
import { ParseJSONOptions, arrayEqual, concatArrays, ensureBigInt, ensureSafeInteger, ensureSafeUnsignedInteger, ensureUint64, isNode, isReactNative, parseJSON, removeUndefinedProperties, stringifyJSON } from "./utils/utils.js";
|
|
10
|
-
|
|
11
|
-
//#region packages/sdk/src/index.d.ts
|
|
12
|
-
declare const MULTISIG_BAD_SENDER_ERROR_MSG = "The transaction sender address and multisig preimage do not match.";
|
|
13
|
-
/**
|
|
14
|
-
* signTransaction takes an object with either payment or key registration fields and
|
|
15
|
-
* a secret key and returns a signed blob.
|
|
16
|
-
*
|
|
17
|
-
* Payment transaction fields: from, to, amount, fee, firstValid, lastValid, genesisHash,
|
|
18
|
-
* note(optional), GenesisID(optional), closeRemainderTo(optional)
|
|
19
|
-
*
|
|
20
|
-
* Key registration fields: fee, firstValid, lastValid, voteKey, selectionKey, voteFirst,
|
|
21
|
-
* voteLast, voteKeyDilution, genesisHash, note(optional), GenesisID(optional)
|
|
22
|
-
*
|
|
23
|
-
* If flatFee is not set and the final calculated fee is lower than the protocol minimum fee, the fee will be increased to match the minimum.
|
|
24
|
-
* @param txn - object with either payment or key registration fields
|
|
25
|
-
* @param sk - Algorand Secret Key
|
|
26
|
-
* @returns object contains the binary signed transaction and its txID
|
|
27
|
-
*/
|
|
28
|
-
declare function signTransaction(txn: Transaction, sk: Uint8Array): {
|
|
29
|
-
txID: string;
|
|
30
|
-
blob: Uint8Array;
|
|
31
|
-
};
|
|
32
|
-
/**
|
|
33
|
-
* signBytes takes arbitrary bytes and a secret key, prepends the bytes with "MX" for domain separation, signs the bytes
|
|
34
|
-
* with the private key, and returns the signature.
|
|
35
|
-
* @param bytes - Uint8array
|
|
36
|
-
* @param sk - Algorand secret key
|
|
37
|
-
* @returns binary signature
|
|
38
|
-
*/
|
|
39
|
-
declare function signBytes(bytes: Uint8Array, sk: Uint8Array): Uint8Array;
|
|
40
|
-
declare const ERROR_MULTISIG_BAD_SENDER: Error;
|
|
41
|
-
declare const ERROR_INVALID_MICROALGOS: Error;
|
|
42
|
-
//#endregion
|
|
43
|
-
export { ERROR_INVALID_MICROALGOS, ERROR_MULTISIG_BAD_SENDER, MULTISIG_BAD_SENDER_ERROR_MSG, signBytes, signTransaction };
|
|
44
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
const require_transaction = require('../../transact/src/transactions/transaction.js');
|
|
2
|
-
const require_signed_transaction = require('../../transact/src/transactions/signed-transaction.js');
|
|
3
|
-
const require_convert = require('./convert.js');
|
|
4
|
-
const require_intDecoding = require('./types/intDecoding.js');
|
|
5
|
-
const require_utils = require('./utils/utils.js');
|
|
6
|
-
const require_naclWrappers = require('./nacl/naclWrappers.js');
|
|
7
|
-
const require_binarydata = require('./encoding/binarydata.js');
|
|
8
|
-
const require_encoding = require('./encoding/encoding.js');
|
|
9
|
-
const require_uint64 = require('./encoding/uint64.js');
|
|
10
|
-
const require_sourcemap = require('./logic/sourcemap.js');
|
|
11
|
-
const require_encoded = require('./types/transactions/encoded.js');
|
|
12
|
-
|
|
13
|
-
//#region packages/sdk/src/index.ts
|
|
14
|
-
const SIGN_BYTES_PREFIX = Uint8Array.from([77, 88]);
|
|
15
|
-
const MULTISIG_BAD_SENDER_ERROR_MSG = "The transaction sender address and multisig preimage do not match.";
|
|
16
|
-
/**
|
|
17
|
-
* signTransaction takes an object with either payment or key registration fields and
|
|
18
|
-
* a secret key and returns a signed blob.
|
|
19
|
-
*
|
|
20
|
-
* Payment transaction fields: from, to, amount, fee, firstValid, lastValid, genesisHash,
|
|
21
|
-
* note(optional), GenesisID(optional), closeRemainderTo(optional)
|
|
22
|
-
*
|
|
23
|
-
* Key registration fields: fee, firstValid, lastValid, voteKey, selectionKey, voteFirst,
|
|
24
|
-
* voteLast, voteKeyDilution, genesisHash, note(optional), GenesisID(optional)
|
|
25
|
-
*
|
|
26
|
-
* If flatFee is not set and the final calculated fee is lower than the protocol minimum fee, the fee will be increased to match the minimum.
|
|
27
|
-
* @param txn - object with either payment or key registration fields
|
|
28
|
-
* @param sk - Algorand Secret Key
|
|
29
|
-
* @returns object contains the binary signed transaction and its txID
|
|
30
|
-
*/
|
|
31
|
-
function signTransaction(txn, sk) {
|
|
32
|
-
const bytesToSign = require_transaction.encodeTransaction(txn);
|
|
33
|
-
const signedTxn = {
|
|
34
|
-
txn,
|
|
35
|
-
sig: require_naclWrappers.sign(bytesToSign, sk)
|
|
36
|
-
};
|
|
37
|
-
return {
|
|
38
|
-
txID: txn.txId(),
|
|
39
|
-
blob: require_signed_transaction.encodeSignedTransaction(signedTxn)
|
|
40
|
-
};
|
|
41
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* signBytes takes arbitrary bytes and a secret key, prepends the bytes with "MX" for domain separation, signs the bytes
|
|
44
|
-
* with the private key, and returns the signature.
|
|
45
|
-
* @param bytes - Uint8array
|
|
46
|
-
* @param sk - Algorand secret key
|
|
47
|
-
* @returns binary signature
|
|
48
|
-
*/
|
|
49
|
-
function signBytes(bytes, sk) {
|
|
50
|
-
const toBeSigned = require_utils.concatArrays(SIGN_BYTES_PREFIX, bytes);
|
|
51
|
-
return require_naclWrappers.sign(toBeSigned, sk);
|
|
52
|
-
}
|
|
53
|
-
const ERROR_MULTISIG_BAD_SENDER = new Error(MULTISIG_BAD_SENDER_ERROR_MSG);
|
|
54
|
-
const ERROR_INVALID_MICROALGOS = new Error(require_convert.INVALID_MICROALGOS_ERROR_MSG);
|
|
55
|
-
|
|
56
|
-
//#endregion
|
|
57
|
-
exports.ERROR_INVALID_MICROALGOS = ERROR_INVALID_MICROALGOS;
|
|
58
|
-
exports.ERROR_MULTISIG_BAD_SENDER = ERROR_MULTISIG_BAD_SENDER;
|
|
59
|
-
exports.MULTISIG_BAD_SENDER_ERROR_MSG = MULTISIG_BAD_SENDER_ERROR_MSG;
|
|
60
|
-
exports.signBytes = signBytes;
|
|
61
|
-
exports.signTransaction = signTransaction;
|
|
62
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["encodeTransaction","signedTxn: SignedTransaction","encodeSignedTransaction"],"sources":["../../../../packages/sdk/src/index.ts"],"sourcesContent":["import type { SignedTransaction, Transaction } from '@algorandfoundation/algokit-transact'\nimport { encodeSignedTransaction, encodeTransaction } from '@algorandfoundation/algokit-transact'\nimport * as convert from './convert'\nimport * as nacl from './nacl/naclWrappers'\nimport * as utils from './utils/utils'\n\nconst SIGN_BYTES_PREFIX = Uint8Array.from([77, 88]) // \"MX\"\n\n// Errors\nexport const MULTISIG_BAD_SENDER_ERROR_MSG = 'The transaction sender address and multisig preimage do not match.'\n\n/**\n * signTransaction takes an object with either payment or key registration fields and\n * a secret key and returns a signed blob.\n *\n * Payment transaction fields: from, to, amount, fee, firstValid, lastValid, genesisHash,\n * note(optional), GenesisID(optional), closeRemainderTo(optional)\n *\n * Key registration fields: fee, firstValid, lastValid, voteKey, selectionKey, voteFirst,\n * voteLast, voteKeyDilution, genesisHash, note(optional), GenesisID(optional)\n *\n * If flatFee is not set and the final calculated fee is lower than the protocol minimum fee, the fee will be increased to match the minimum.\n * @param txn - object with either payment or key registration fields\n * @param sk - Algorand Secret Key\n * @returns object contains the binary signed transaction and its txID\n */\nexport function signTransaction(txn: Transaction, sk: Uint8Array) {\n // Sign the transaction using nacl\n const bytesToSign = encodeTransaction(txn)\n const signature = nacl.sign(bytesToSign, sk)\n\n const signedTxn: SignedTransaction = {\n txn: txn,\n sig: signature,\n }\n\n return {\n txID: txn.txId(),\n blob: encodeSignedTransaction(signedTxn),\n }\n}\n\n/**\n * signBytes takes arbitrary bytes and a secret key, prepends the bytes with \"MX\" for domain separation, signs the bytes\n * with the private key, and returns the signature.\n * @param bytes - Uint8array\n * @param sk - Algorand secret key\n * @returns binary signature\n */\nexport function signBytes(bytes: Uint8Array, sk: Uint8Array) {\n const toBeSigned = utils.concatArrays(SIGN_BYTES_PREFIX, bytes)\n const sig = nacl.sign(toBeSigned, sk)\n return sig\n}\n\nexport const ERROR_MULTISIG_BAD_SENDER = new Error(MULTISIG_BAD_SENDER_ERROR_MSG)\nexport const ERROR_INVALID_MICROALGOS = new Error(convert.INVALID_MICROALGOS_ERROR_MSG)\n\n// Export client classes with algosdk-compatible names\nexport * from './convert'\nexport { base64ToBytes, bytesToBase64, bytesToHex, bytesToString, coerceToBytes, hexToBytes } from './encoding/binarydata'\nexport * from './encoding/encoding'\nexport { decodeUint64, encodeUint64 } from './encoding/uint64'\nexport * from './logic/sourcemap'\nexport * from './types/intDecoding'\nexport { default as IntDecoding } from './types/intDecoding'\nexport * from './types/transactions/index'\nexport * from './utils/utils'\n"],"mappings":";;;;;;;;;;;;;AAMA,MAAM,oBAAoB,WAAW,KAAK,CAAC,IAAI,GAAG,CAAC;AAGnD,MAAa,gCAAgC;;;;;;;;;;;;;;;;AAiB7C,SAAgB,gBAAgB,KAAkB,IAAgB;CAEhE,MAAM,cAAcA,sCAAkB,IAAI;CAG1C,MAAMC,YAA+B;EAC9B;EACL,+BAJ0B,aAAa,GAAG;EAK3C;AAED,QAAO;EACL,MAAM,IAAI,MAAM;EAChB,MAAMC,mDAAwB,UAAU;EACzC;;;;;;;;;AAUH,SAAgB,UAAU,OAAmB,IAAgB;CAC3D,MAAM,wCAAgC,mBAAmB,MAAM;AAE/D,kCADsB,YAAY,GAAG;;AAIvC,MAAa,4BAA4B,IAAI,MAAM,8BAA8B;AACjF,MAAa,2BAA2B,IAAI,mDAA2C"}
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import { encodeTransaction } from "../../transact/src/transactions/transaction.mjs";
|
|
2
|
-
import { encodeSignedTransaction } from "../../transact/src/transactions/signed-transaction.mjs";
|
|
3
|
-
import { INVALID_MICROALGOS_ERROR_MSG, algosToMicroalgos, microalgosToAlgos } from "./convert.mjs";
|
|
4
|
-
import intDecoding_default from "./types/intDecoding.mjs";
|
|
5
|
-
import { arrayEqual, concatArrays, ensureBigInt, ensureSafeInteger, ensureSafeUnsignedInteger, ensureUint64, isNode, isReactNative, parseJSON, removeUndefinedProperties, stringifyJSON } from "./utils/utils.mjs";
|
|
6
|
-
import { sign } from "./nacl/naclWrappers.mjs";
|
|
7
|
-
import { base64ToBytes, bytesToBase64, bytesToHex, bytesToString, coerceToBytes, hexToBytes } from "./encoding/binarydata.mjs";
|
|
8
|
-
import { ERROR_CONTAINS_EMPTY_STRING, MsgpackRawStringProvider, Schema, decodeJSON, decodeMsgpack, decodeObj, encodeJSON, encodeMsgpack, encodeObj, jsonEncodingDataToMsgpackEncodingData, msgpackEncodingDataToJSONEncodingData, msgpackRawDecode, msgpackRawDecodeAsMap, msgpackRawEncode } from "./encoding/encoding.mjs";
|
|
9
|
-
import { decodeUint64, encodeUint64 } from "./encoding/uint64.mjs";
|
|
10
|
-
import { ProgramSourceMap } from "./logic/sourcemap.mjs";
|
|
11
|
-
import { ENCODED_MULTISIG_SCHEMA, ENCODED_SUBSIG_SCHEMA, encodedMultiSigFromEncodingData, encodedMultiSigToEncodingData, encodedSubsigFromEncodingData, encodedSubsigToEncodingData } from "./types/transactions/encoded.mjs";
|
|
12
|
-
|
|
13
|
-
//#region packages/sdk/src/index.ts
|
|
14
|
-
const SIGN_BYTES_PREFIX = Uint8Array.from([77, 88]);
|
|
15
|
-
const MULTISIG_BAD_SENDER_ERROR_MSG = "The transaction sender address and multisig preimage do not match.";
|
|
16
|
-
/**
|
|
17
|
-
* signTransaction takes an object with either payment or key registration fields and
|
|
18
|
-
* a secret key and returns a signed blob.
|
|
19
|
-
*
|
|
20
|
-
* Payment transaction fields: from, to, amount, fee, firstValid, lastValid, genesisHash,
|
|
21
|
-
* note(optional), GenesisID(optional), closeRemainderTo(optional)
|
|
22
|
-
*
|
|
23
|
-
* Key registration fields: fee, firstValid, lastValid, voteKey, selectionKey, voteFirst,
|
|
24
|
-
* voteLast, voteKeyDilution, genesisHash, note(optional), GenesisID(optional)
|
|
25
|
-
*
|
|
26
|
-
* If flatFee is not set and the final calculated fee is lower than the protocol minimum fee, the fee will be increased to match the minimum.
|
|
27
|
-
* @param txn - object with either payment or key registration fields
|
|
28
|
-
* @param sk - Algorand Secret Key
|
|
29
|
-
* @returns object contains the binary signed transaction and its txID
|
|
30
|
-
*/
|
|
31
|
-
function signTransaction(txn, sk) {
|
|
32
|
-
const bytesToSign = encodeTransaction(txn);
|
|
33
|
-
const signedTxn = {
|
|
34
|
-
txn,
|
|
35
|
-
sig: sign(bytesToSign, sk)
|
|
36
|
-
};
|
|
37
|
-
return {
|
|
38
|
-
txID: txn.txId(),
|
|
39
|
-
blob: encodeSignedTransaction(signedTxn)
|
|
40
|
-
};
|
|
41
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* signBytes takes arbitrary bytes and a secret key, prepends the bytes with "MX" for domain separation, signs the bytes
|
|
44
|
-
* with the private key, and returns the signature.
|
|
45
|
-
* @param bytes - Uint8array
|
|
46
|
-
* @param sk - Algorand secret key
|
|
47
|
-
* @returns binary signature
|
|
48
|
-
*/
|
|
49
|
-
function signBytes(bytes, sk) {
|
|
50
|
-
const toBeSigned = concatArrays(SIGN_BYTES_PREFIX, bytes);
|
|
51
|
-
return sign(toBeSigned, sk);
|
|
52
|
-
}
|
|
53
|
-
const ERROR_MULTISIG_BAD_SENDER = new Error(MULTISIG_BAD_SENDER_ERROR_MSG);
|
|
54
|
-
const ERROR_INVALID_MICROALGOS = new Error(INVALID_MICROALGOS_ERROR_MSG);
|
|
55
|
-
|
|
56
|
-
//#endregion
|
|
57
|
-
export { ERROR_INVALID_MICROALGOS, ERROR_MULTISIG_BAD_SENDER, MULTISIG_BAD_SENDER_ERROR_MSG, signBytes, signTransaction };
|
|
58
|
-
//# sourceMappingURL=index.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":["signedTxn: SignedTransaction","nacl.sign","utils.concatArrays","convert.INVALID_MICROALGOS_ERROR_MSG"],"sources":["../../../../packages/sdk/src/index.ts"],"sourcesContent":["import type { SignedTransaction, Transaction } from '@algorandfoundation/algokit-transact'\nimport { encodeSignedTransaction, encodeTransaction } from '@algorandfoundation/algokit-transact'\nimport * as convert from './convert'\nimport * as nacl from './nacl/naclWrappers'\nimport * as utils from './utils/utils'\n\nconst SIGN_BYTES_PREFIX = Uint8Array.from([77, 88]) // \"MX\"\n\n// Errors\nexport const MULTISIG_BAD_SENDER_ERROR_MSG = 'The transaction sender address and multisig preimage do not match.'\n\n/**\n * signTransaction takes an object with either payment or key registration fields and\n * a secret key and returns a signed blob.\n *\n * Payment transaction fields: from, to, amount, fee, firstValid, lastValid, genesisHash,\n * note(optional), GenesisID(optional), closeRemainderTo(optional)\n *\n * Key registration fields: fee, firstValid, lastValid, voteKey, selectionKey, voteFirst,\n * voteLast, voteKeyDilution, genesisHash, note(optional), GenesisID(optional)\n *\n * If flatFee is not set and the final calculated fee is lower than the protocol minimum fee, the fee will be increased to match the minimum.\n * @param txn - object with either payment or key registration fields\n * @param sk - Algorand Secret Key\n * @returns object contains the binary signed transaction and its txID\n */\nexport function signTransaction(txn: Transaction, sk: Uint8Array) {\n // Sign the transaction using nacl\n const bytesToSign = encodeTransaction(txn)\n const signature = nacl.sign(bytesToSign, sk)\n\n const signedTxn: SignedTransaction = {\n txn: txn,\n sig: signature,\n }\n\n return {\n txID: txn.txId(),\n blob: encodeSignedTransaction(signedTxn),\n }\n}\n\n/**\n * signBytes takes arbitrary bytes and a secret key, prepends the bytes with \"MX\" for domain separation, signs the bytes\n * with the private key, and returns the signature.\n * @param bytes - Uint8array\n * @param sk - Algorand secret key\n * @returns binary signature\n */\nexport function signBytes(bytes: Uint8Array, sk: Uint8Array) {\n const toBeSigned = utils.concatArrays(SIGN_BYTES_PREFIX, bytes)\n const sig = nacl.sign(toBeSigned, sk)\n return sig\n}\n\nexport const ERROR_MULTISIG_BAD_SENDER = new Error(MULTISIG_BAD_SENDER_ERROR_MSG)\nexport const ERROR_INVALID_MICROALGOS = new Error(convert.INVALID_MICROALGOS_ERROR_MSG)\n\n// Export client classes with algosdk-compatible names\nexport * from './convert'\nexport { base64ToBytes, bytesToBase64, bytesToHex, bytesToString, coerceToBytes, hexToBytes } from './encoding/binarydata'\nexport * from './encoding/encoding'\nexport { decodeUint64, encodeUint64 } from './encoding/uint64'\nexport * from './logic/sourcemap'\nexport * from './types/intDecoding'\nexport { default as IntDecoding } from './types/intDecoding'\nexport * from './types/transactions/index'\nexport * from './utils/utils'\n"],"mappings":";;;;;;;;;;;;;AAMA,MAAM,oBAAoB,WAAW,KAAK,CAAC,IAAI,GAAG,CAAC;AAGnD,MAAa,gCAAgC;;;;;;;;;;;;;;;;AAiB7C,SAAgB,gBAAgB,KAAkB,IAAgB;CAEhE,MAAM,cAAc,kBAAkB,IAAI;CAG1C,MAAMA,YAA+B;EAC9B;EACL,KAJgBC,KAAU,aAAa,GAAG;EAK3C;AAED,QAAO;EACL,MAAM,IAAI,MAAM;EAChB,MAAM,wBAAwB,UAAU;EACzC;;;;;;;;;AAUH,SAAgB,UAAU,OAAmB,IAAgB;CAC3D,MAAM,aAAaC,aAAmB,mBAAmB,MAAM;AAE/D,QADYD,KAAU,YAAY,GAAG;;AAIvC,MAAa,4BAA4B,IAAI,MAAM,8BAA8B;AACjF,MAAa,2BAA2B,IAAI,MAAME,6BAAqC"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
const require_rolldown_runtime = require('../../../../_virtual/rolldown_runtime.js');
|
|
2
|
-
let js_sha512 = require("js-sha512");
|
|
3
|
-
js_sha512 = require_rolldown_runtime.__toESM(js_sha512);
|
|
4
|
-
let tweetnacl = require("tweetnacl");
|
|
5
|
-
tweetnacl = require_rolldown_runtime.__toESM(tweetnacl);
|
|
6
|
-
|
|
7
|
-
//#region packages/sdk/src/nacl/naclWrappers.ts
|
|
8
|
-
function sign(msg, secretKey) {
|
|
9
|
-
return tweetnacl.default.sign.detached(msg, secretKey);
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
//#endregion
|
|
13
|
-
exports.sign = sign;
|
|
14
|
-
//# sourceMappingURL=naclWrappers.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"naclWrappers.js","names":["nacl"],"sources":["../../../../../packages/sdk/src/nacl/naclWrappers.ts"],"sourcesContent":["import nacl from 'tweetnacl'\nimport sha512 from 'js-sha512'\nimport { isReactNative } from '../utils/utils.js'\n\nexport function genericHash(arr: sha512.Message) {\n return sha512.sha512_256.array(arr)\n}\n\nexport function randomBytes(length: number) {\n if (isReactNative()) {\n console.warn(\n `It looks like you're running in react-native. In order to perform common crypto operations you will need to polyfill common operations such as crypto.getRandomValues`,\n )\n }\n return nacl.randomBytes(length)\n}\n\nexport function keyPairFromSeed(seed: Uint8Array) {\n return nacl.sign.keyPair.fromSeed(seed)\n}\n\nexport function keyPair() {\n const seed = randomBytes(nacl.box.secretKeyLength)\n return keyPairFromSeed(seed)\n}\n\nexport function isValidSignatureLength(len: number) {\n return len === nacl.sign.signatureLength\n}\n\nexport function keyPairFromSecretKey(sk: Uint8Array) {\n return nacl.sign.keyPair.fromSecretKey(sk)\n}\n\nexport function sign(msg: Uint8Array, secretKey: Uint8Array) {\n return nacl.sign.detached(msg, secretKey)\n}\n\nexport function bytesEqual(a: Uint8Array, b: Uint8Array) {\n return nacl.verify(a, b)\n}\n\nexport function verify(message: Uint8Array, signature: Uint8Array, verifyKey: Uint8Array) {\n return nacl.sign.detached.verify(message, signature, verifyKey)\n}\n\n// constants\nexport const PUBLIC_KEY_LENGTH = nacl.sign.publicKeyLength\nexport const SECRET_KEY_LENGTH = nacl.sign.secretKeyLength\nexport const HASH_BYTES_LENGTH = 32\nexport const SEED_BTYES_LENGTH = 32\n"],"mappings":";;;;;;;AAkCA,SAAgB,KAAK,KAAiB,WAAuB;AAC3D,QAAOA,kBAAK,KAAK,SAAS,KAAK,UAAU"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import sha512 from "js-sha512";
|
|
2
|
-
import nacl from "tweetnacl";
|
|
3
|
-
|
|
4
|
-
//#region packages/sdk/src/nacl/naclWrappers.ts
|
|
5
|
-
function sign(msg, secretKey) {
|
|
6
|
-
return nacl.sign.detached(msg, secretKey);
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
//#endregion
|
|
10
|
-
export { sign };
|
|
11
|
-
//# sourceMappingURL=naclWrappers.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"naclWrappers.mjs","names":[],"sources":["../../../../../packages/sdk/src/nacl/naclWrappers.ts"],"sourcesContent":["import nacl from 'tweetnacl'\nimport sha512 from 'js-sha512'\nimport { isReactNative } from '../utils/utils.js'\n\nexport function genericHash(arr: sha512.Message) {\n return sha512.sha512_256.array(arr)\n}\n\nexport function randomBytes(length: number) {\n if (isReactNative()) {\n console.warn(\n `It looks like you're running in react-native. In order to perform common crypto operations you will need to polyfill common operations such as crypto.getRandomValues`,\n )\n }\n return nacl.randomBytes(length)\n}\n\nexport function keyPairFromSeed(seed: Uint8Array) {\n return nacl.sign.keyPair.fromSeed(seed)\n}\n\nexport function keyPair() {\n const seed = randomBytes(nacl.box.secretKeyLength)\n return keyPairFromSeed(seed)\n}\n\nexport function isValidSignatureLength(len: number) {\n return len === nacl.sign.signatureLength\n}\n\nexport function keyPairFromSecretKey(sk: Uint8Array) {\n return nacl.sign.keyPair.fromSecretKey(sk)\n}\n\nexport function sign(msg: Uint8Array, secretKey: Uint8Array) {\n return nacl.sign.detached(msg, secretKey)\n}\n\nexport function bytesEqual(a: Uint8Array, b: Uint8Array) {\n return nacl.verify(a, b)\n}\n\nexport function verify(message: Uint8Array, signature: Uint8Array, verifyKey: Uint8Array) {\n return nacl.sign.detached.verify(message, signature, verifyKey)\n}\n\n// constants\nexport const PUBLIC_KEY_LENGTH = nacl.sign.publicKeyLength\nexport const SECRET_KEY_LENGTH = nacl.sign.secretKeyLength\nexport const HASH_BYTES_LENGTH = 32\nexport const SEED_BTYES_LENGTH = 32\n"],"mappings":";;;;AAkCA,SAAgB,KAAK,KAAiB,WAAuB;AAC3D,QAAO,KAAK,KAAK,SAAS,KAAK,UAAU"}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
//#region packages/sdk/src/types/intDecoding.d.ts
|
|
2
|
-
/**
|
|
3
|
-
* Configure how integers in JSON response will be decoded.
|
|
4
|
-
*/
|
|
5
|
-
declare enum IntDecoding {
|
|
6
|
-
/**
|
|
7
|
-
* All integers will be decoded as Numbers, meaning any values greater than
|
|
8
|
-
* Number.MAX_SAFE_INTEGER will lose precision.
|
|
9
|
-
*/
|
|
10
|
-
UNSAFE = "unsafe",
|
|
11
|
-
/**
|
|
12
|
-
* All integers will be decoded as Numbers, but if any values are greater than
|
|
13
|
-
* Number.MAX_SAFE_INTEGER an error will be thrown.
|
|
14
|
-
*/
|
|
15
|
-
SAFE = "safe",
|
|
16
|
-
/**
|
|
17
|
-
* Integers will be decoded as Numbers if they are less than or equal to
|
|
18
|
-
* Number.MAX_SAFE_INTEGER, otherwise they will be decoded as BigInts.
|
|
19
|
-
*/
|
|
20
|
-
MIXED = "mixed",
|
|
21
|
-
/**
|
|
22
|
-
* All integers will be decoded as BigInts.
|
|
23
|
-
*/
|
|
24
|
-
BIGINT = "bigint",
|
|
25
|
-
}
|
|
26
|
-
//#endregion
|
|
27
|
-
export { IntDecoding };
|
|
28
|
-
//# sourceMappingURL=intDecoding.d.ts.map
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
//#region packages/sdk/src/types/intDecoding.ts
|
|
3
|
-
/**
|
|
4
|
-
* Configure how integers in JSON response will be decoded.
|
|
5
|
-
*/
|
|
6
|
-
var IntDecoding = /* @__PURE__ */ function(IntDecoding$1) {
|
|
7
|
-
/**
|
|
8
|
-
* All integers will be decoded as Numbers, meaning any values greater than
|
|
9
|
-
* Number.MAX_SAFE_INTEGER will lose precision.
|
|
10
|
-
*/
|
|
11
|
-
IntDecoding$1["UNSAFE"] = "unsafe";
|
|
12
|
-
/**
|
|
13
|
-
* All integers will be decoded as Numbers, but if any values are greater than
|
|
14
|
-
* Number.MAX_SAFE_INTEGER an error will be thrown.
|
|
15
|
-
*/
|
|
16
|
-
IntDecoding$1["SAFE"] = "safe";
|
|
17
|
-
/**
|
|
18
|
-
* Integers will be decoded as Numbers if they are less than or equal to
|
|
19
|
-
* Number.MAX_SAFE_INTEGER, otherwise they will be decoded as BigInts.
|
|
20
|
-
*/
|
|
21
|
-
IntDecoding$1["MIXED"] = "mixed";
|
|
22
|
-
/**
|
|
23
|
-
* All integers will be decoded as BigInts.
|
|
24
|
-
*/
|
|
25
|
-
IntDecoding$1["BIGINT"] = "bigint";
|
|
26
|
-
return IntDecoding$1;
|
|
27
|
-
}(IntDecoding || {});
|
|
28
|
-
var intDecoding_default = IntDecoding;
|
|
29
|
-
|
|
30
|
-
//#endregion
|
|
31
|
-
exports.default = intDecoding_default;
|
|
32
|
-
//# sourceMappingURL=intDecoding.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"intDecoding.js","names":[],"sources":["../../../../../packages/sdk/src/types/intDecoding.ts"],"sourcesContent":["/**\n * Configure how integers in JSON response will be decoded.\n */\nenum IntDecoding {\n /**\n * All integers will be decoded as Numbers, meaning any values greater than\n * Number.MAX_SAFE_INTEGER will lose precision.\n */\n UNSAFE = 'unsafe',\n\n /**\n * All integers will be decoded as Numbers, but if any values are greater than\n * Number.MAX_SAFE_INTEGER an error will be thrown.\n */\n SAFE = 'safe',\n\n /**\n * Integers will be decoded as Numbers if they are less than or equal to\n * Number.MAX_SAFE_INTEGER, otherwise they will be decoded as BigInts.\n */\n MIXED = 'mixed',\n\n /**\n * All integers will be decoded as BigInts.\n */\n BIGINT = 'bigint',\n}\n\nexport default IntDecoding\n"],"mappings":";;;;;AAGA,IAAK,sDAAL;;;;;AAKE;;;;;AAMA;;;;;AAMA;;;;AAKA;;EAtBG;AAyBL,0BAAe"}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
//#region packages/sdk/src/types/intDecoding.ts
|
|
2
|
-
/**
|
|
3
|
-
* Configure how integers in JSON response will be decoded.
|
|
4
|
-
*/
|
|
5
|
-
var IntDecoding = /* @__PURE__ */ function(IntDecoding$1) {
|
|
6
|
-
/**
|
|
7
|
-
* All integers will be decoded as Numbers, meaning any values greater than
|
|
8
|
-
* Number.MAX_SAFE_INTEGER will lose precision.
|
|
9
|
-
*/
|
|
10
|
-
IntDecoding$1["UNSAFE"] = "unsafe";
|
|
11
|
-
/**
|
|
12
|
-
* All integers will be decoded as Numbers, but if any values are greater than
|
|
13
|
-
* Number.MAX_SAFE_INTEGER an error will be thrown.
|
|
14
|
-
*/
|
|
15
|
-
IntDecoding$1["SAFE"] = "safe";
|
|
16
|
-
/**
|
|
17
|
-
* Integers will be decoded as Numbers if they are less than or equal to
|
|
18
|
-
* Number.MAX_SAFE_INTEGER, otherwise they will be decoded as BigInts.
|
|
19
|
-
*/
|
|
20
|
-
IntDecoding$1["MIXED"] = "mixed";
|
|
21
|
-
/**
|
|
22
|
-
* All integers will be decoded as BigInts.
|
|
23
|
-
*/
|
|
24
|
-
IntDecoding$1["BIGINT"] = "bigint";
|
|
25
|
-
return IntDecoding$1;
|
|
26
|
-
}(IntDecoding || {});
|
|
27
|
-
var intDecoding_default = IntDecoding;
|
|
28
|
-
|
|
29
|
-
//#endregion
|
|
30
|
-
export { intDecoding_default as default };
|
|
31
|
-
//# sourceMappingURL=intDecoding.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"intDecoding.mjs","names":[],"sources":["../../../../../packages/sdk/src/types/intDecoding.ts"],"sourcesContent":["/**\n * Configure how integers in JSON response will be decoded.\n */\nenum IntDecoding {\n /**\n * All integers will be decoded as Numbers, meaning any values greater than\n * Number.MAX_SAFE_INTEGER will lose precision.\n */\n UNSAFE = 'unsafe',\n\n /**\n * All integers will be decoded as Numbers, but if any values are greater than\n * Number.MAX_SAFE_INTEGER an error will be thrown.\n */\n SAFE = 'safe',\n\n /**\n * Integers will be decoded as Numbers if they are less than or equal to\n * Number.MAX_SAFE_INTEGER, otherwise they will be decoded as BigInts.\n */\n MIXED = 'mixed',\n\n /**\n * All integers will be decoded as BigInts.\n */\n BIGINT = 'bigint',\n}\n\nexport default IntDecoding\n"],"mappings":";;;;AAGA,IAAK,sDAAL;;;;;AAKE;;;;;AAMA;;;;;AAMA;;;;AAKA;;EAtBG;AAyBL,0BAAe"}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { NamedMapSchema } from "../../encoding/schema/map.js";
|
|
2
|
-
|
|
3
|
-
//#region packages/sdk/src/types/transactions/encoded.d.ts
|
|
4
|
-
interface EncodedSubsig {
|
|
5
|
-
/**
|
|
6
|
-
* The public key
|
|
7
|
-
*/
|
|
8
|
-
pk: Uint8Array;
|
|
9
|
-
/**
|
|
10
|
-
* The signature provided by the public key, if any
|
|
11
|
-
*/
|
|
12
|
-
s?: Uint8Array;
|
|
13
|
-
}
|
|
14
|
-
declare const ENCODED_SUBSIG_SCHEMA: NamedMapSchema;
|
|
15
|
-
declare function encodedSubsigFromEncodingData(data: unknown): EncodedSubsig;
|
|
16
|
-
declare function encodedSubsigToEncodingData(subsig: EncodedSubsig): Map<string, unknown>;
|
|
17
|
-
/**
|
|
18
|
-
* A rough structure for the encoded multi signature transaction object.
|
|
19
|
-
* Every property is labelled with its associated `MultisigMetadata` type property
|
|
20
|
-
*/
|
|
21
|
-
interface EncodedMultisig {
|
|
22
|
-
/**
|
|
23
|
-
* version
|
|
24
|
-
*/
|
|
25
|
-
v: number;
|
|
26
|
-
/**
|
|
27
|
-
* threshold
|
|
28
|
-
*/
|
|
29
|
-
thr: number;
|
|
30
|
-
/**
|
|
31
|
-
* Subset of signatures. A threshold of `thr` signors is required.
|
|
32
|
-
*/
|
|
33
|
-
subsig: EncodedSubsig[];
|
|
34
|
-
}
|
|
35
|
-
declare const ENCODED_MULTISIG_SCHEMA: NamedMapSchema;
|
|
36
|
-
declare function encodedMultiSigFromEncodingData(data: unknown): EncodedMultisig;
|
|
37
|
-
declare function encodedMultiSigToEncodingData(msig: EncodedMultisig): Map<string, unknown>;
|
|
38
|
-
//#endregion
|
|
39
|
-
export { ENCODED_MULTISIG_SCHEMA, ENCODED_SUBSIG_SCHEMA, EncodedMultisig, EncodedSubsig, encodedMultiSigFromEncodingData, encodedMultiSigToEncodingData, encodedSubsigFromEncodingData, encodedSubsigToEncodingData };
|
|
40
|
-
//# sourceMappingURL=encoded.d.ts.map
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
const require_utils = require('../../utils/utils.js');
|
|
2
|
-
const require_uint64 = require('../../encoding/schema/uint64.js');
|
|
3
|
-
const require_bytearray = require('../../encoding/schema/bytearray.js');
|
|
4
|
-
const require_array = require('../../encoding/schema/array.js');
|
|
5
|
-
const require_map = require('../../encoding/schema/map.js');
|
|
6
|
-
const require_optional = require('../../encoding/schema/optional.js');
|
|
7
|
-
|
|
8
|
-
//#region packages/sdk/src/types/transactions/encoded.ts
|
|
9
|
-
const ENCODED_SUBSIG_SCHEMA = new require_map.NamedMapSchema(require_map.allOmitEmpty([{
|
|
10
|
-
key: "pk",
|
|
11
|
-
valueSchema: new require_bytearray.FixedLengthByteArraySchema(32)
|
|
12
|
-
}, {
|
|
13
|
-
key: "s",
|
|
14
|
-
valueSchema: new require_optional.OptionalSchema(new require_bytearray.FixedLengthByteArraySchema(64))
|
|
15
|
-
}]));
|
|
16
|
-
function encodedSubsigFromEncodingData(data) {
|
|
17
|
-
if (!(data instanceof Map)) throw new Error(`Invalid decoded EncodedSubsig: ${data}`);
|
|
18
|
-
const subsig = { pk: data.get("pk") };
|
|
19
|
-
if (data.get("s")) subsig.s = data.get("s");
|
|
20
|
-
return subsig;
|
|
21
|
-
}
|
|
22
|
-
function encodedSubsigToEncodingData(subsig) {
|
|
23
|
-
const data = new Map([["pk", subsig.pk]]);
|
|
24
|
-
if (subsig.s) data.set("s", subsig.s);
|
|
25
|
-
return data;
|
|
26
|
-
}
|
|
27
|
-
const ENCODED_MULTISIG_SCHEMA = new require_map.NamedMapSchema(require_map.allOmitEmpty([
|
|
28
|
-
{
|
|
29
|
-
key: "v",
|
|
30
|
-
valueSchema: new require_uint64.Uint64Schema()
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
key: "thr",
|
|
34
|
-
valueSchema: new require_uint64.Uint64Schema()
|
|
35
|
-
},
|
|
36
|
-
{
|
|
37
|
-
key: "subsig",
|
|
38
|
-
valueSchema: new require_array.ArraySchema(ENCODED_SUBSIG_SCHEMA)
|
|
39
|
-
}
|
|
40
|
-
]));
|
|
41
|
-
function encodedMultiSigFromEncodingData(data) {
|
|
42
|
-
if (!(data instanceof Map)) throw new Error(`Invalid decoded EncodedMultiSig: ${data}`);
|
|
43
|
-
return {
|
|
44
|
-
v: require_utils.ensureSafeUnsignedInteger(data.get("v")),
|
|
45
|
-
thr: require_utils.ensureSafeUnsignedInteger(data.get("thr")),
|
|
46
|
-
subsig: data.get("subsig").map(encodedSubsigFromEncodingData)
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
|
-
function encodedMultiSigToEncodingData(msig) {
|
|
50
|
-
return new Map([
|
|
51
|
-
["v", msig.v],
|
|
52
|
-
["thr", msig.thr],
|
|
53
|
-
["subsig", msig.subsig.map(encodedSubsigToEncodingData)]
|
|
54
|
-
]);
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
//#endregion
|
|
58
|
-
exports.ENCODED_MULTISIG_SCHEMA = ENCODED_MULTISIG_SCHEMA;
|
|
59
|
-
exports.ENCODED_SUBSIG_SCHEMA = ENCODED_SUBSIG_SCHEMA;
|
|
60
|
-
exports.encodedMultiSigFromEncodingData = encodedMultiSigFromEncodingData;
|
|
61
|
-
exports.encodedMultiSigToEncodingData = encodedMultiSigToEncodingData;
|
|
62
|
-
exports.encodedSubsigFromEncodingData = encodedSubsigFromEncodingData;
|
|
63
|
-
exports.encodedSubsigToEncodingData = encodedSubsigToEncodingData;
|
|
64
|
-
//# sourceMappingURL=encoded.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"encoded.js","names":["NamedMapSchema","allOmitEmpty","FixedLengthByteArraySchema","OptionalSchema","subsig: EncodedSubsig","Uint64Schema","ArraySchema","ensureSafeUnsignedInteger"],"sources":["../../../../../../packages/sdk/src/types/transactions/encoded.ts"],"sourcesContent":["import {\n NamedMapSchema,\n FixedLengthByteArraySchema,\n Uint64Schema,\n ArraySchema,\n OptionalSchema,\n allOmitEmpty,\n} from '../../encoding/schema/index.js'\nimport { ensureSafeUnsignedInteger } from '../../utils/utils.js'\n\nexport interface EncodedSubsig {\n /**\n * The public key\n */\n pk: Uint8Array\n\n /**\n * The signature provided by the public key, if any\n */\n s?: Uint8Array\n}\n\nexport const ENCODED_SUBSIG_SCHEMA = new NamedMapSchema(\n allOmitEmpty([\n {\n key: 'pk',\n valueSchema: new FixedLengthByteArraySchema(32),\n },\n {\n key: 's',\n valueSchema: new OptionalSchema(new FixedLengthByteArraySchema(64)),\n },\n ]),\n)\n\nexport function encodedSubsigFromEncodingData(data: unknown): EncodedSubsig {\n if (!(data instanceof Map)) {\n throw new Error(`Invalid decoded EncodedSubsig: ${data}`)\n }\n const subsig: EncodedSubsig = {\n pk: data.get('pk'),\n }\n if (data.get('s')) {\n subsig.s = data.get('s')\n }\n return subsig\n}\n\nexport function encodedSubsigToEncodingData(subsig: EncodedSubsig): Map<string, unknown> {\n const data = new Map<string, unknown>([['pk', subsig.pk]])\n if (subsig.s) {\n data.set('s', subsig.s)\n }\n return data\n}\n\n/**\n * A rough structure for the encoded multi signature transaction object.\n * Every property is labelled with its associated `MultisigMetadata` type property\n */\nexport interface EncodedMultisig {\n /**\n * version\n */\n v: number\n\n /**\n * threshold\n */\n thr: number\n\n /**\n * Subset of signatures. A threshold of `thr` signors is required.\n */\n subsig: EncodedSubsig[]\n}\n\nexport const ENCODED_MULTISIG_SCHEMA = new NamedMapSchema(\n allOmitEmpty([\n {\n key: 'v',\n valueSchema: new Uint64Schema(),\n },\n {\n key: 'thr',\n valueSchema: new Uint64Schema(),\n },\n {\n key: 'subsig',\n valueSchema: new ArraySchema(ENCODED_SUBSIG_SCHEMA),\n },\n ]),\n)\n\nexport function encodedMultiSigFromEncodingData(data: unknown): EncodedMultisig {\n if (!(data instanceof Map)) {\n throw new Error(`Invalid decoded EncodedMultiSig: ${data}`)\n }\n return {\n v: ensureSafeUnsignedInteger(data.get('v')),\n thr: ensureSafeUnsignedInteger(data.get('thr')),\n subsig: data.get('subsig').map(encodedSubsigFromEncodingData),\n }\n}\n\nexport function encodedMultiSigToEncodingData(msig: EncodedMultisig): Map<string, unknown> {\n return new Map<string, unknown>([\n ['v', msig.v],\n ['thr', msig.thr],\n ['subsig', msig.subsig.map(encodedSubsigToEncodingData)],\n ])\n}\n"],"mappings":";;;;;;;;AAsBA,MAAa,wBAAwB,IAAIA,2BACvCC,yBAAa,CACX;CACE,KAAK;CACL,aAAa,IAAIC,6CAA2B,GAAG;CAChD,EACD;CACE,KAAK;CACL,aAAa,IAAIC,gCAAe,IAAID,6CAA2B,GAAG,CAAC;CACpE,CACF,CAAC,CACH;AAED,SAAgB,8BAA8B,MAA8B;AAC1E,KAAI,EAAE,gBAAgB,KACpB,OAAM,IAAI,MAAM,kCAAkC,OAAO;CAE3D,MAAME,SAAwB,EAC5B,IAAI,KAAK,IAAI,KAAK,EACnB;AACD,KAAI,KAAK,IAAI,IAAI,CACf,QAAO,IAAI,KAAK,IAAI,IAAI;AAE1B,QAAO;;AAGT,SAAgB,4BAA4B,QAA6C;CACvF,MAAM,OAAO,IAAI,IAAqB,CAAC,CAAC,MAAM,OAAO,GAAG,CAAC,CAAC;AAC1D,KAAI,OAAO,EACT,MAAK,IAAI,KAAK,OAAO,EAAE;AAEzB,QAAO;;AAwBT,MAAa,0BAA0B,IAAIJ,2BACzCC,yBAAa;CACX;EACE,KAAK;EACL,aAAa,IAAII,6BAAc;EAChC;CACD;EACE,KAAK;EACL,aAAa,IAAIA,6BAAc;EAChC;CACD;EACE,KAAK;EACL,aAAa,IAAIC,0BAAY,sBAAsB;EACpD;CACF,CAAC,CACH;AAED,SAAgB,gCAAgC,MAAgC;AAC9E,KAAI,EAAE,gBAAgB,KACpB,OAAM,IAAI,MAAM,oCAAoC,OAAO;AAE7D,QAAO;EACL,GAAGC,wCAA0B,KAAK,IAAI,IAAI,CAAC;EAC3C,KAAKA,wCAA0B,KAAK,IAAI,MAAM,CAAC;EAC/C,QAAQ,KAAK,IAAI,SAAS,CAAC,IAAI,8BAA8B;EAC9D;;AAGH,SAAgB,8BAA8B,MAA6C;AACzF,QAAO,IAAI,IAAqB;EAC9B,CAAC,KAAK,KAAK,EAAE;EACb,CAAC,OAAO,KAAK,IAAI;EACjB,CAAC,UAAU,KAAK,OAAO,IAAI,4BAA4B,CAAC;EACzD,CAAC"}
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import { ensureSafeUnsignedInteger } from "../../utils/utils.mjs";
|
|
2
|
-
import { Uint64Schema } from "../../encoding/schema/uint64.mjs";
|
|
3
|
-
import { FixedLengthByteArraySchema } from "../../encoding/schema/bytearray.mjs";
|
|
4
|
-
import { ArraySchema } from "../../encoding/schema/array.mjs";
|
|
5
|
-
import { NamedMapSchema, allOmitEmpty } from "../../encoding/schema/map.mjs";
|
|
6
|
-
import { OptionalSchema } from "../../encoding/schema/optional.mjs";
|
|
7
|
-
|
|
8
|
-
//#region packages/sdk/src/types/transactions/encoded.ts
|
|
9
|
-
const ENCODED_SUBSIG_SCHEMA = new NamedMapSchema(allOmitEmpty([{
|
|
10
|
-
key: "pk",
|
|
11
|
-
valueSchema: new FixedLengthByteArraySchema(32)
|
|
12
|
-
}, {
|
|
13
|
-
key: "s",
|
|
14
|
-
valueSchema: new OptionalSchema(new FixedLengthByteArraySchema(64))
|
|
15
|
-
}]));
|
|
16
|
-
function encodedSubsigFromEncodingData(data) {
|
|
17
|
-
if (!(data instanceof Map)) throw new Error(`Invalid decoded EncodedSubsig: ${data}`);
|
|
18
|
-
const subsig = { pk: data.get("pk") };
|
|
19
|
-
if (data.get("s")) subsig.s = data.get("s");
|
|
20
|
-
return subsig;
|
|
21
|
-
}
|
|
22
|
-
function encodedSubsigToEncodingData(subsig) {
|
|
23
|
-
const data = new Map([["pk", subsig.pk]]);
|
|
24
|
-
if (subsig.s) data.set("s", subsig.s);
|
|
25
|
-
return data;
|
|
26
|
-
}
|
|
27
|
-
const ENCODED_MULTISIG_SCHEMA = new NamedMapSchema(allOmitEmpty([
|
|
28
|
-
{
|
|
29
|
-
key: "v",
|
|
30
|
-
valueSchema: new Uint64Schema()
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
key: "thr",
|
|
34
|
-
valueSchema: new Uint64Schema()
|
|
35
|
-
},
|
|
36
|
-
{
|
|
37
|
-
key: "subsig",
|
|
38
|
-
valueSchema: new ArraySchema(ENCODED_SUBSIG_SCHEMA)
|
|
39
|
-
}
|
|
40
|
-
]));
|
|
41
|
-
function encodedMultiSigFromEncodingData(data) {
|
|
42
|
-
if (!(data instanceof Map)) throw new Error(`Invalid decoded EncodedMultiSig: ${data}`);
|
|
43
|
-
return {
|
|
44
|
-
v: ensureSafeUnsignedInteger(data.get("v")),
|
|
45
|
-
thr: ensureSafeUnsignedInteger(data.get("thr")),
|
|
46
|
-
subsig: data.get("subsig").map(encodedSubsigFromEncodingData)
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
|
-
function encodedMultiSigToEncodingData(msig) {
|
|
50
|
-
return new Map([
|
|
51
|
-
["v", msig.v],
|
|
52
|
-
["thr", msig.thr],
|
|
53
|
-
["subsig", msig.subsig.map(encodedSubsigToEncodingData)]
|
|
54
|
-
]);
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
//#endregion
|
|
58
|
-
export { ENCODED_MULTISIG_SCHEMA, ENCODED_SUBSIG_SCHEMA, encodedMultiSigFromEncodingData, encodedMultiSigToEncodingData, encodedSubsigFromEncodingData, encodedSubsigToEncodingData };
|
|
59
|
-
//# sourceMappingURL=encoded.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"encoded.mjs","names":["subsig: EncodedSubsig"],"sources":["../../../../../../packages/sdk/src/types/transactions/encoded.ts"],"sourcesContent":["import {\n NamedMapSchema,\n FixedLengthByteArraySchema,\n Uint64Schema,\n ArraySchema,\n OptionalSchema,\n allOmitEmpty,\n} from '../../encoding/schema/index.js'\nimport { ensureSafeUnsignedInteger } from '../../utils/utils.js'\n\nexport interface EncodedSubsig {\n /**\n * The public key\n */\n pk: Uint8Array\n\n /**\n * The signature provided by the public key, if any\n */\n s?: Uint8Array\n}\n\nexport const ENCODED_SUBSIG_SCHEMA = new NamedMapSchema(\n allOmitEmpty([\n {\n key: 'pk',\n valueSchema: new FixedLengthByteArraySchema(32),\n },\n {\n key: 's',\n valueSchema: new OptionalSchema(new FixedLengthByteArraySchema(64)),\n },\n ]),\n)\n\nexport function encodedSubsigFromEncodingData(data: unknown): EncodedSubsig {\n if (!(data instanceof Map)) {\n throw new Error(`Invalid decoded EncodedSubsig: ${data}`)\n }\n const subsig: EncodedSubsig = {\n pk: data.get('pk'),\n }\n if (data.get('s')) {\n subsig.s = data.get('s')\n }\n return subsig\n}\n\nexport function encodedSubsigToEncodingData(subsig: EncodedSubsig): Map<string, unknown> {\n const data = new Map<string, unknown>([['pk', subsig.pk]])\n if (subsig.s) {\n data.set('s', subsig.s)\n }\n return data\n}\n\n/**\n * A rough structure for the encoded multi signature transaction object.\n * Every property is labelled with its associated `MultisigMetadata` type property\n */\nexport interface EncodedMultisig {\n /**\n * version\n */\n v: number\n\n /**\n * threshold\n */\n thr: number\n\n /**\n * Subset of signatures. A threshold of `thr` signors is required.\n */\n subsig: EncodedSubsig[]\n}\n\nexport const ENCODED_MULTISIG_SCHEMA = new NamedMapSchema(\n allOmitEmpty([\n {\n key: 'v',\n valueSchema: new Uint64Schema(),\n },\n {\n key: 'thr',\n valueSchema: new Uint64Schema(),\n },\n {\n key: 'subsig',\n valueSchema: new ArraySchema(ENCODED_SUBSIG_SCHEMA),\n },\n ]),\n)\n\nexport function encodedMultiSigFromEncodingData(data: unknown): EncodedMultisig {\n if (!(data instanceof Map)) {\n throw new Error(`Invalid decoded EncodedMultiSig: ${data}`)\n }\n return {\n v: ensureSafeUnsignedInteger(data.get('v')),\n thr: ensureSafeUnsignedInteger(data.get('thr')),\n subsig: data.get('subsig').map(encodedSubsigFromEncodingData),\n }\n}\n\nexport function encodedMultiSigToEncodingData(msig: EncodedMultisig): Map<string, unknown> {\n return new Map<string, unknown>([\n ['v', msig.v],\n ['thr', msig.thr],\n ['subsig', msig.subsig.map(encodedSubsigToEncodingData)],\n ])\n}\n"],"mappings":";;;;;;;;AAsBA,MAAa,wBAAwB,IAAI,eACvC,aAAa,CACX;CACE,KAAK;CACL,aAAa,IAAI,2BAA2B,GAAG;CAChD,EACD;CACE,KAAK;CACL,aAAa,IAAI,eAAe,IAAI,2BAA2B,GAAG,CAAC;CACpE,CACF,CAAC,CACH;AAED,SAAgB,8BAA8B,MAA8B;AAC1E,KAAI,EAAE,gBAAgB,KACpB,OAAM,IAAI,MAAM,kCAAkC,OAAO;CAE3D,MAAMA,SAAwB,EAC5B,IAAI,KAAK,IAAI,KAAK,EACnB;AACD,KAAI,KAAK,IAAI,IAAI,CACf,QAAO,IAAI,KAAK,IAAI,IAAI;AAE1B,QAAO;;AAGT,SAAgB,4BAA4B,QAA6C;CACvF,MAAM,OAAO,IAAI,IAAqB,CAAC,CAAC,MAAM,OAAO,GAAG,CAAC,CAAC;AAC1D,KAAI,OAAO,EACT,MAAK,IAAI,KAAK,OAAO,EAAE;AAEzB,QAAO;;AAwBT,MAAa,0BAA0B,IAAI,eACzC,aAAa;CACX;EACE,KAAK;EACL,aAAa,IAAI,cAAc;EAChC;CACD;EACE,KAAK;EACL,aAAa,IAAI,cAAc;EAChC;CACD;EACE,KAAK;EACL,aAAa,IAAI,YAAY,sBAAsB;EACpD;CACF,CAAC,CACH;AAED,SAAgB,gCAAgC,MAAgC;AAC9E,KAAI,EAAE,gBAAgB,KACpB,OAAM,IAAI,MAAM,oCAAoC,OAAO;AAE7D,QAAO;EACL,GAAG,0BAA0B,KAAK,IAAI,IAAI,CAAC;EAC3C,KAAK,0BAA0B,KAAK,IAAI,MAAM,CAAC;EAC/C,QAAQ,KAAK,IAAI,SAAS,CAAC,IAAI,8BAA8B;EAC9D;;AAGH,SAAgB,8BAA8B,MAA6C;AACzF,QAAO,IAAI,IAAqB;EAC9B,CAAC,KAAK,KAAK,EAAE;EACb,CAAC,OAAO,KAAK,IAAI;EACjB,CAAC,UAAU,KAAK,OAAO,IAAI,4BAA4B,CAAC;EACzD,CAAC"}
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import { IntDecoding } from "../types/intDecoding.js";
|
|
2
|
-
|
|
3
|
-
//#region packages/sdk/src/utils/utils.d.ts
|
|
4
|
-
interface ParseJSONOptions {
|
|
5
|
-
intDecoding: IntDecoding;
|
|
6
|
-
}
|
|
7
|
-
/**
|
|
8
|
-
* Parse JSON with additional options.
|
|
9
|
-
* @param str - The JSON string to parse.
|
|
10
|
-
* @param options - Configures how integers in this JSON string will be decoded. See the
|
|
11
|
-
* `IntDecoding` enum for more details.
|
|
12
|
-
*/
|
|
13
|
-
declare function parseJSON(str: string, {
|
|
14
|
-
intDecoding
|
|
15
|
-
}: ParseJSONOptions): any;
|
|
16
|
-
/**
|
|
17
|
-
* Converts a JavaScript value to a JavaScript Object Notation (JSON) string.
|
|
18
|
-
*
|
|
19
|
-
* This functions differs from the built-in JSON.stringify in that it supports serializing BigInts.
|
|
20
|
-
*
|
|
21
|
-
* This function takes the same arguments as the built-in JSON.stringify function.
|
|
22
|
-
*
|
|
23
|
-
* @param value - A JavaScript value, usually an object or array, to be converted.
|
|
24
|
-
* @param replacer - A function that transforms the results.
|
|
25
|
-
* @param space - Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read.
|
|
26
|
-
*/
|
|
27
|
-
declare function stringifyJSON(value: any, replacer?: (this: any, key: string, value: any) => any, space?: string | number): string;
|
|
28
|
-
/**
|
|
29
|
-
* ArrayEqual takes two arrays and return true if equal, false otherwise
|
|
30
|
-
*/
|
|
31
|
-
declare function arrayEqual<T>(a: ArrayLike<T>, b: ArrayLike<T>): boolean;
|
|
32
|
-
/**
|
|
33
|
-
* ConcatArrays takes n number arrays and returns a joint Uint8Array
|
|
34
|
-
* @param arrs - An arbitrary number of n array-like number list arguments
|
|
35
|
-
* @returns [a,b]
|
|
36
|
-
*/
|
|
37
|
-
declare function concatArrays(...arrs: ArrayLike<number>[]): Uint8Array;
|
|
38
|
-
/**
|
|
39
|
-
* Remove undefined properties from an object
|
|
40
|
-
* @param obj - An object, preferably one with some undefined properties
|
|
41
|
-
* @returns A copy of the object with undefined properties removed
|
|
42
|
-
*/
|
|
43
|
-
declare function removeUndefinedProperties(obj: Record<string | number | symbol, any>): {
|
|
44
|
-
[x: string]: any;
|
|
45
|
-
[x: number]: any;
|
|
46
|
-
[x: symbol]: any;
|
|
47
|
-
};
|
|
48
|
-
/**
|
|
49
|
-
* Check whether the environment is Node.js (as opposed to the browser)
|
|
50
|
-
* @returns True if Node.js environment, false otherwise
|
|
51
|
-
*/
|
|
52
|
-
declare function isNode(): boolean;
|
|
53
|
-
/**
|
|
54
|
-
* Check whether the environment is ReactNative
|
|
55
|
-
* @returns True if ReactNative, false otherwise
|
|
56
|
-
*/
|
|
57
|
-
declare function isReactNative(): boolean;
|
|
58
|
-
declare function ensureSafeInteger(value: unknown): number;
|
|
59
|
-
declare function ensureSafeUnsignedInteger(value: unknown): number;
|
|
60
|
-
declare function ensureBigInt(value: unknown): bigint;
|
|
61
|
-
declare function ensureUint64(value: unknown): bigint;
|
|
62
|
-
//#endregion
|
|
63
|
-
export { ParseJSONOptions, arrayEqual, concatArrays, ensureBigInt, ensureSafeInteger, ensureSafeUnsignedInteger, ensureUint64, isNode, isReactNative, parseJSON, removeUndefinedProperties, stringifyJSON };
|
|
64
|
-
//# sourceMappingURL=utils.d.ts.map
|