@algorandfoundation/algokit-utils 10.0.0-alpha.2 → 10.0.0-alpha.20
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/algo25/index.d.ts +2 -0
- package/algo25/index.js +9 -0
- package/algo25/index.mjs +3 -0
- package/algod-client/index.d.ts +3 -7
- package/algod-client/index.js +2 -5
- package/algod-client/index.mjs +2 -2
- package/index.d.ts +1 -2
- package/index.js +0 -7
- package/index.mjs +1 -2
- 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/kmd-client/index.d.ts +1 -2
- package/kmd-client/index.js +0 -5
- package/kmd-client/index.mjs +1 -2
- package/package.json +1 -1
- 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 -1
- package/packages/abi/src/abi-type.js +4 -2
- package/packages/abi/src/abi-type.js.map +1 -1
- package/packages/abi/src/abi-type.mjs +4 -2
- 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/algo25/src/index.d.ts +40 -0
- package/packages/algo25/src/index.js +44 -0
- package/packages/algo25/src/index.js.map +1 -1
- package/packages/algo25/src/index.mjs +39 -1
- package/packages/algo25/src/index.mjs.map +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/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.js +0 -14
- package/packages/common/src/address.js.map +1 -1
- package/packages/common/src/address.mjs +1 -14
- 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.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/msgpack.js +0 -1
- package/packages/common/src/msgpack.js.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.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/sdk/src/encoding/encoding.js +12 -2
- package/packages/sdk/src/encoding/encoding.js.map +1 -1
- package/packages/sdk/src/encoding/encoding.mjs +12 -1
- package/packages/sdk/src/encoding/encoding.mjs.map +1 -1
- package/packages/sdk/src/encoding/schema/map.js +0 -2
- package/packages/sdk/src/encoding/schema/map.js.map +1 -1
- package/packages/transact/src/logicsig.d.ts +3 -15
- package/packages/transact/src/logicsig.js +16 -36
- package/packages/transact/src/logicsig.js.map +1 -1
- package/packages/transact/src/logicsig.mjs +18 -36
- package/packages/transact/src/logicsig.mjs.map +1 -1
- package/packages/transact/src/multisig.d.ts +7 -115
- package/packages/transact/src/multisig.js +86 -136
- package/packages/transact/src/multisig.js.map +1 -1
- package/packages/transact/src/multisig.mjs +87 -117
- package/packages/transact/src/multisig.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 +2 -3
- package/packages/transact/src/transactions/signed-transaction-meta.js.map +1 -1
- package/packages/transact/src/transactions/signed-transaction-meta.mjs +3 -3
- package/packages/transact/src/transactions/signed-transaction-meta.mjs.map +1 -1
- package/packages/transact/src/transactions/signed-transaction.d.ts +7 -3
- 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/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 -1
- package/packages/transact/src/transactions/transaction.js +1 -1
- package/packages/transact/src/transactions/transaction.js.map +1 -1
- package/packages/transact/src/transactions/transaction.mjs +1 -1
- package/packages/transact/src/transactions/transaction.mjs.map +1 -1
- package/sdk/index.js +1 -1
- package/testing/account.js +2 -5
- package/testing/account.js.map +1 -1
- package/testing/account.mjs +2 -5
- package/testing/account.mjs.map +1 -1
- package/testing/fixtures/algorand-fixture.d.ts +3 -3
- package/testing/fixtures/algorand-fixture.js.map +1 -1
- package/testing/fixtures/algorand-fixture.mjs.map +1 -1
- package/transact/index.d.ts +11 -10
- package/transact/index.js +7 -32
- package/transact/index.mjs +7 -10
- 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/transactions/app-call.d.ts +5 -4
- package/transactions/app-call.js +15 -15
- package/transactions/app-call.js.map +1 -1
- package/transactions/app-call.mjs +15 -15
- 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/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 +1 -1
- package/transactions/method-call.js +69 -77
- package/transactions/method-call.js.map +1 -1
- package/transactions/method-call.mjs +69 -77
- package/transactions/method-call.mjs.map +1 -1
- package/types/account-manager.d.ts +1 -1
- package/types/account-manager.js +3 -3
- package/types/account-manager.js.map +1 -1
- package/types/account-manager.mjs +3 -3
- package/types/account-manager.mjs.map +1 -1
- package/types/algorand-client-transaction-creator.d.ts +57 -43
- package/types/algorand-client-transaction-creator.js +8 -0
- package/types/algorand-client-transaction-creator.js.map +1 -1
- package/types/algorand-client-transaction-creator.mjs +8 -0
- package/types/algorand-client-transaction-creator.mjs.map +1 -1
- package/types/algorand-client-transaction-sender.d.ts +62 -48
- package/types/algorand-client-transaction-sender.js +8 -1
- package/types/algorand-client-transaction-sender.js.map +1 -1
- package/types/algorand-client-transaction-sender.mjs +8 -0
- package/types/algorand-client-transaction-sender.mjs.map +1 -1
- package/types/app-client.d.ts +110 -105
- package/types/app-client.js +0 -1
- package/types/app-client.js.map +1 -1
- package/types/app-client.mjs.map +1 -1
- package/types/app-deployer.d.ts +1 -1
- package/types/app-deployer.js +2 -2
- package/types/app-deployer.js.map +1 -1
- package/types/app-deployer.mjs +2 -2
- package/types/app-deployer.mjs.map +1 -1
- package/types/app-factory.d.ts +44 -41
- package/types/app-factory.js.map +1 -1
- package/types/app-factory.mjs.map +1 -1
- package/types/app-manager.d.ts +3 -1
- package/types/app-manager.js +16 -10
- package/types/app-manager.js.map +1 -1
- package/types/app-manager.mjs +16 -10
- package/types/app-manager.mjs.map +1 -1
- package/types/app-spec.js +12 -5
- package/types/app-spec.js.map +1 -1
- package/types/app-spec.mjs +12 -5
- package/types/app-spec.mjs.map +1 -1
- package/types/app.d.ts +1 -1
- package/types/app.js.map +1 -1
- package/types/app.mjs.map +1 -1
- package/types/asset-manager.js +1 -1
- package/types/asset-manager.js.map +1 -1
- package/types/asset-manager.mjs +1 -1
- package/types/asset-manager.mjs.map +1 -1
- package/types/async-event-emitter.d.ts +3 -6
- package/types/async-event-emitter.js.map +1 -1
- package/types/async-event-emitter.mjs.map +1 -1
- package/types/client-manager.d.ts +1 -1
- package/types/client-manager.js.map +1 -1
- package/types/client-manager.mjs.map +1 -1
- package/types/composer.d.ts +9 -1
- package/types/composer.js +35 -23
- package/types/composer.js.map +1 -1
- package/types/composer.mjs +37 -24
- package/types/composer.mjs.map +1 -1
- package/types/debugging.d.ts +13 -9
- package/types/debugging.js.map +1 -1
- package/types/debugging.mjs.map +1 -1
- package/types/expand.d.ts +2 -9
- package/types/kmd-account-manager.d.ts +1 -0
- package/types/kmd-account-manager.js +21 -10
- package/types/kmd-account-manager.js.map +1 -1
- package/types/kmd-account-manager.mjs +22 -11
- package/types/kmd-account-manager.mjs.map +1 -1
- package/types/lifecycle-events.d.ts +0 -1
- package/types/lifecycle-events.js.map +1 -1
- package/types/lifecycle-events.mjs.map +1 -1
- package/types/testing.d.ts +2 -2
- package/types/transaction.d.ts +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/transact/src/transactions/common.d.ts +0 -37
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["buffer11: number[]","english","hash","buffer8: number[]"],"sources":["../../../../packages/algo25/src/index.ts"],"sourcesContent":["import english from './english.js'\nimport { hash } from '@algorandfoundation/algokit-common'\nexport const FAIL_TO_DECODE_MNEMONIC_ERROR_MSG = 'failed to decode mnemonic'\nexport const NOT_IN_WORDS_LIST_ERROR_MSG = 'the mnemonic contains a word that is not in the wordlist'\n\nconst SEED_BTYES_LENGTH = 32\n\n// https://stackoverflow.com/a/51452614\nfunction toUint11Array(buffer8: Uint8Array | number[]): number[] {\n const buffer11: number[] = []\n let acc = 0\n let accBits = 0\n function add(octet: number) {\n acc |= octet << accBits\n accBits += 8\n if (accBits >= 11) {\n buffer11.push(acc & 0x7ff)\n acc >>= 11\n accBits -= 11\n }\n }\n function flush() {\n if (accBits) {\n buffer11.push(acc)\n }\n }\n\n buffer8.forEach(add)\n flush()\n return buffer11\n}\n\nfunction applyWords(nums: number[]): string[] {\n return nums.map((n) => english[n])\n}\n\nfunction computeChecksum(seed: Uint8Array): string {\n const hashBuffer = hash(seed)\n const uint11Hash = toUint11Array(hashBuffer)\n const words = applyWords(uint11Hash)\n\n return words[0]\n}\n\n/**\n * mnemonicFromSeed converts a 32-byte key into a 25 word mnemonic. The generated mnemonic includes a checksum.\n * Each word in the mnemonic represents 11 bits of data, and the last 11 bits are reserved for the checksum.\n * @param seed - 32 bytes long seed\n * @returns 25 words mnemonic\n */\nexport function mnemonicFromSeed(seed: Uint8Array) {\n // Sanity length check\n if (seed.length !== SEED_BTYES_LENGTH) {\n throw new RangeError(`Seed length must be ${SEED_BTYES_LENGTH}`)\n }\n\n const uint11Array = toUint11Array(seed)\n const words = applyWords(uint11Array)\n const checksumWord = computeChecksum(seed)\n\n return `${words.join(' ')} ${checksumWord}`\n}\n\n// from Uint11Array\n// https://stackoverflow.com/a/51452614\nfunction toUint8Array(buffer11: number[]): Uint8Array {\n const buffer8: number[] = []\n let acc = 0\n let accBits = 0\n function add(ui11: number) {\n acc |= ui11 << accBits\n accBits += 11\n while (accBits >= 8) {\n buffer8.push(acc & 0xff)\n acc >>= 8\n accBits -= 8\n }\n }\n function flush() {\n if (accBits) {\n buffer8.push(acc)\n }\n }\n\n buffer11.forEach(add)\n flush()\n return new Uint8Array(buffer8)\n}\n\n/**\n * seedFromMnemonic converts a mnemonic generated using this library into the source key used to create it.\n * It returns an error if the passed mnemonic has an incorrect checksum, if the number of words is unexpected, or if one\n * of the passed words is not found in the words list.\n * @param mnemonic - 25 words mnemonic\n * @returns 32 bytes long seed\n */\nexport function seedFromMnemonic(mnemonic: string) {\n const words = mnemonic.split(' ')\n const key = words.slice(0, 24)\n\n // Check that all words are in list\n for (const w of key) {\n if (english.indexOf(w) === -1) throw new Error(NOT_IN_WORDS_LIST_ERROR_MSG)\n }\n\n const checksum = words[words.length - 1]\n const uint11Array = key.map((word) => english.indexOf(word))\n\n // Convert the key to uint8Array\n let uint8Array = toUint8Array(uint11Array)\n\n // We need to chop the last byte -\n // the short explanation - Since 256 is not divisible by 11, we have an extra 0x0 byte.\n // The longer explanation - When splitting the 256 bits to chunks of 11, we get 23 words and a left over of 3 bits.\n // This left gets padded with another 8 bits to the create the 24th word.\n // While converting back to byte array, our new 264 bits array is divisible by 8 but the last byte is just the padding.\n\n // check that we have 33 bytes long array as expected\n if (uint8Array.length !== 33) throw new Error(FAIL_TO_DECODE_MNEMONIC_ERROR_MSG)\n\n // check that the last byte is actually 0x0\n if (uint8Array[uint8Array.length - 1] !== 0x0) throw new Error(FAIL_TO_DECODE_MNEMONIC_ERROR_MSG)\n\n // chop it !\n uint8Array = uint8Array.slice(0, uint8Array.length - 1)\n\n // compute checksum\n const cs = computeChecksum(uint8Array)\n\n // success!\n if (cs === checksum) return uint8Array\n\n throw new Error(FAIL_TO_DECODE_MNEMONIC_ERROR_MSG)\n}\n\n/**\n * secretKeyToMnemonic takes an Algorand secret key and returns the corresponding mnemonic.\n * @param sk - Algorand secret key\n * @returns Secret key's associated mnemonic\n */\nexport function secretKeyToMnemonic(sk: Uint8Array) {\n // get the seed from the sk\n const seed = sk.slice(0, SEED_BTYES_LENGTH)\n return mnemonicFromSeed(seed)\n}\n\n/**\n * mnemonicToMasterDerivationKey takes a mnemonic string and returns the corresponding master derivation key.\n * @param mn - 25 words Algorand mnemonic\n * @returns Uint8Array\n * @throws error if fails to decode the mnemonic\n */\nexport function mnemonicToMasterDerivationKey(mn: string) {\n return seedFromMnemonic(mn)\n}\n\n/**\n * masterDerivationKeyToMnemonic takes a master derivation key and returns the corresponding mnemonic.\n * @param mdk - Uint8Array\n * @returns string mnemonic\n */\nexport function masterDerivationKeyToMnemonic(mdk: Uint8Array) {\n return mnemonicFromSeed(mdk)\n}\n"],"mappings":";;;;AAEA,MAAa,oCAAoC;AACjD,MAAa,8BAA8B;
|
|
1
|
+
{"version":3,"file":"index.js","names":["buffer11: number[]","english","hash","buffer8: number[]"],"sources":["../../../../packages/algo25/src/index.ts"],"sourcesContent":["import english from './english.js'\nimport { hash } from '@algorandfoundation/algokit-common'\nexport const FAIL_TO_DECODE_MNEMONIC_ERROR_MSG = 'failed to decode mnemonic'\nexport const NOT_IN_WORDS_LIST_ERROR_MSG = 'the mnemonic contains a word that is not in the wordlist'\n\nconst SEED_BTYES_LENGTH = 32\n\n// https://stackoverflow.com/a/51452614\nfunction toUint11Array(buffer8: Uint8Array | number[]): number[] {\n const buffer11: number[] = []\n let acc = 0\n let accBits = 0\n function add(octet: number) {\n acc |= octet << accBits\n accBits += 8\n if (accBits >= 11) {\n buffer11.push(acc & 0x7ff)\n acc >>= 11\n accBits -= 11\n }\n }\n function flush() {\n if (accBits) {\n buffer11.push(acc)\n }\n }\n\n buffer8.forEach(add)\n flush()\n return buffer11\n}\n\nfunction applyWords(nums: number[]): string[] {\n return nums.map((n) => english[n])\n}\n\nfunction computeChecksum(seed: Uint8Array): string {\n const hashBuffer = hash(seed)\n const uint11Hash = toUint11Array(hashBuffer)\n const words = applyWords(uint11Hash)\n\n return words[0]\n}\n\n/**\n * mnemonicFromSeed converts a 32-byte key into a 25 word mnemonic. The generated mnemonic includes a checksum.\n * Each word in the mnemonic represents 11 bits of data, and the last 11 bits are reserved for the checksum.\n * @param seed - 32 bytes long seed\n * @returns 25 words mnemonic\n */\nexport function mnemonicFromSeed(seed: Uint8Array) {\n // Sanity length check\n if (seed.length !== SEED_BTYES_LENGTH) {\n throw new RangeError(`Seed length must be ${SEED_BTYES_LENGTH}`)\n }\n\n const uint11Array = toUint11Array(seed)\n const words = applyWords(uint11Array)\n const checksumWord = computeChecksum(seed)\n\n return `${words.join(' ')} ${checksumWord}`\n}\n\n// from Uint11Array\n// https://stackoverflow.com/a/51452614\nfunction toUint8Array(buffer11: number[]): Uint8Array {\n const buffer8: number[] = []\n let acc = 0\n let accBits = 0\n function add(ui11: number) {\n acc |= ui11 << accBits\n accBits += 11\n while (accBits >= 8) {\n buffer8.push(acc & 0xff)\n acc >>= 8\n accBits -= 8\n }\n }\n function flush() {\n if (accBits) {\n buffer8.push(acc)\n }\n }\n\n buffer11.forEach(add)\n flush()\n return new Uint8Array(buffer8)\n}\n\n/**\n * seedFromMnemonic converts a mnemonic generated using this library into the source key used to create it.\n * It returns an error if the passed mnemonic has an incorrect checksum, if the number of words is unexpected, or if one\n * of the passed words is not found in the words list.\n * @param mnemonic - 25 words mnemonic\n * @returns 32 bytes long seed\n */\nexport function seedFromMnemonic(mnemonic: string) {\n const words = mnemonic.split(' ')\n const key = words.slice(0, 24)\n\n // Check that all words are in list\n for (const w of key) {\n if (english.indexOf(w) === -1) throw new Error(NOT_IN_WORDS_LIST_ERROR_MSG)\n }\n\n const checksum = words[words.length - 1]\n const uint11Array = key.map((word) => english.indexOf(word))\n\n // Convert the key to uint8Array\n let uint8Array = toUint8Array(uint11Array)\n\n // We need to chop the last byte -\n // the short explanation - Since 256 is not divisible by 11, we have an extra 0x0 byte.\n // The longer explanation - When splitting the 256 bits to chunks of 11, we get 23 words and a left over of 3 bits.\n // This left gets padded with another 8 bits to the create the 24th word.\n // While converting back to byte array, our new 264 bits array is divisible by 8 but the last byte is just the padding.\n\n // check that we have 33 bytes long array as expected\n if (uint8Array.length !== 33) throw new Error(FAIL_TO_DECODE_MNEMONIC_ERROR_MSG)\n\n // check that the last byte is actually 0x0\n if (uint8Array[uint8Array.length - 1] !== 0x0) throw new Error(FAIL_TO_DECODE_MNEMONIC_ERROR_MSG)\n\n // chop it !\n uint8Array = uint8Array.slice(0, uint8Array.length - 1)\n\n // compute checksum\n const cs = computeChecksum(uint8Array)\n\n // success!\n if (cs === checksum) return uint8Array\n\n throw new Error(FAIL_TO_DECODE_MNEMONIC_ERROR_MSG)\n}\n\n/**\n * secretKeyToMnemonic takes an Algorand secret key and returns the corresponding mnemonic.\n * @param sk - Algorand secret key\n * @returns Secret key's associated mnemonic\n */\nexport function secretKeyToMnemonic(sk: Uint8Array) {\n // get the seed from the sk\n const seed = sk.slice(0, SEED_BTYES_LENGTH)\n return mnemonicFromSeed(seed)\n}\n\n/**\n * mnemonicToMasterDerivationKey takes a mnemonic string and returns the corresponding master derivation key.\n * @param mn - 25 words Algorand mnemonic\n * @returns Uint8Array\n * @throws error if fails to decode the mnemonic\n */\nexport function mnemonicToMasterDerivationKey(mn: string) {\n return seedFromMnemonic(mn)\n}\n\n/**\n * masterDerivationKeyToMnemonic takes a master derivation key and returns the corresponding mnemonic.\n * @param mdk - Uint8Array\n * @returns string mnemonic\n */\nexport function masterDerivationKeyToMnemonic(mdk: Uint8Array) {\n return mnemonicFromSeed(mdk)\n}\n"],"mappings":";;;;AAEA,MAAa,oCAAoC;AACjD,MAAa,8BAA8B;AAE3C,MAAM,oBAAoB;AAG1B,SAAS,cAAc,SAA0C;CAC/D,MAAMA,WAAqB,EAAE;CAC7B,IAAI,MAAM;CACV,IAAI,UAAU;CACd,SAAS,IAAI,OAAe;AAC1B,SAAO,SAAS;AAChB,aAAW;AACX,MAAI,WAAW,IAAI;AACjB,YAAS,KAAK,MAAM,KAAM;AAC1B,WAAQ;AACR,cAAW;;;CAGf,SAAS,QAAQ;AACf,MAAI,QACF,UAAS,KAAK,IAAI;;AAItB,SAAQ,QAAQ,IAAI;AACpB,QAAO;AACP,QAAO;;AAGT,SAAS,WAAW,MAA0B;AAC5C,QAAO,KAAK,KAAK,MAAMC,wBAAQ,GAAG;;AAGpC,SAAS,gBAAgB,MAA0B;AAKjD,QAFc,WADK,cADAC,oBAAK,KAAK,CACe,CACR,CAEvB;;;;;;;;AASf,SAAgB,iBAAiB,MAAkB;AAEjD,KAAI,KAAK,WAAW,kBAClB,OAAM,IAAI,WAAW,uBAAuB,oBAAoB;CAIlE,MAAM,QAAQ,WADM,cAAc,KAAK,CACF;CACrC,MAAM,eAAe,gBAAgB,KAAK;AAE1C,QAAO,GAAG,MAAM,KAAK,IAAI,CAAC,GAAG;;AAK/B,SAAS,aAAa,UAAgC;CACpD,MAAMC,UAAoB,EAAE;CAC5B,IAAI,MAAM;CACV,IAAI,UAAU;CACd,SAAS,IAAI,MAAc;AACzB,SAAO,QAAQ;AACf,aAAW;AACX,SAAO,WAAW,GAAG;AACnB,WAAQ,KAAK,MAAM,IAAK;AACxB,WAAQ;AACR,cAAW;;;CAGf,SAAS,QAAQ;AACf,MAAI,QACF,SAAQ,KAAK,IAAI;;AAIrB,UAAS,QAAQ,IAAI;AACrB,QAAO;AACP,QAAO,IAAI,WAAW,QAAQ;;;;;;;;;AAUhC,SAAgB,iBAAiB,UAAkB;CACjD,MAAM,QAAQ,SAAS,MAAM,IAAI;CACjC,MAAM,MAAM,MAAM,MAAM,GAAG,GAAG;AAG9B,MAAK,MAAM,KAAK,IACd,KAAIF,wBAAQ,QAAQ,EAAE,KAAK,GAAI,OAAM,IAAI,MAAM,4BAA4B;CAG7E,MAAM,WAAW,MAAM,MAAM,SAAS;CAItC,IAAI,aAAa,aAHG,IAAI,KAAK,SAASA,wBAAQ,QAAQ,KAAK,CAAC,CAGlB;AAS1C,KAAI,WAAW,WAAW,GAAI,OAAM,IAAI,MAAM,kCAAkC;AAGhF,KAAI,WAAW,WAAW,SAAS,OAAO,EAAK,OAAM,IAAI,MAAM,kCAAkC;AAGjG,cAAa,WAAW,MAAM,GAAG,WAAW,SAAS,EAAE;AAMvD,KAHW,gBAAgB,WAAW,KAG3B,SAAU,QAAO;AAE5B,OAAM,IAAI,MAAM,kCAAkC;;;;;;;AAQpD,SAAgB,oBAAoB,IAAgB;AAGlD,QAAO,iBADM,GAAG,MAAM,GAAG,kBAAkB,CACd;;;;;;;;AAS/B,SAAgB,8BAA8B,IAAY;AACxD,QAAO,iBAAiB,GAAG;;;;;;;AAQ7B,SAAgB,8BAA8B,KAAiB;AAC7D,QAAO,iBAAiB,IAAI"}
|
|
@@ -4,6 +4,7 @@ import english_default from "./english.mjs";
|
|
|
4
4
|
//#region packages/algo25/src/index.ts
|
|
5
5
|
const FAIL_TO_DECODE_MNEMONIC_ERROR_MSG = "failed to decode mnemonic";
|
|
6
6
|
const NOT_IN_WORDS_LIST_ERROR_MSG = "the mnemonic contains a word that is not in the wordlist";
|
|
7
|
+
const SEED_BTYES_LENGTH = 32;
|
|
7
8
|
function toUint11Array(buffer8) {
|
|
8
9
|
const buffer11 = [];
|
|
9
10
|
let acc = 0;
|
|
@@ -30,6 +31,18 @@ function applyWords(nums) {
|
|
|
30
31
|
function computeChecksum(seed) {
|
|
31
32
|
return applyWords(toUint11Array(hash(seed)))[0];
|
|
32
33
|
}
|
|
34
|
+
/**
|
|
35
|
+
* mnemonicFromSeed converts a 32-byte key into a 25 word mnemonic. The generated mnemonic includes a checksum.
|
|
36
|
+
* Each word in the mnemonic represents 11 bits of data, and the last 11 bits are reserved for the checksum.
|
|
37
|
+
* @param seed - 32 bytes long seed
|
|
38
|
+
* @returns 25 words mnemonic
|
|
39
|
+
*/
|
|
40
|
+
function mnemonicFromSeed(seed) {
|
|
41
|
+
if (seed.length !== SEED_BTYES_LENGTH) throw new RangeError(`Seed length must be ${SEED_BTYES_LENGTH}`);
|
|
42
|
+
const words = applyWords(toUint11Array(seed));
|
|
43
|
+
const checksumWord = computeChecksum(seed);
|
|
44
|
+
return `${words.join(" ")} ${checksumWord}`;
|
|
45
|
+
}
|
|
33
46
|
function toUint8Array(buffer11) {
|
|
34
47
|
const buffer8 = [];
|
|
35
48
|
let acc = 0;
|
|
@@ -69,7 +82,32 @@ function seedFromMnemonic(mnemonic) {
|
|
|
69
82
|
if (computeChecksum(uint8Array) === checksum) return uint8Array;
|
|
70
83
|
throw new Error(FAIL_TO_DECODE_MNEMONIC_ERROR_MSG);
|
|
71
84
|
}
|
|
85
|
+
/**
|
|
86
|
+
* secretKeyToMnemonic takes an Algorand secret key and returns the corresponding mnemonic.
|
|
87
|
+
* @param sk - Algorand secret key
|
|
88
|
+
* @returns Secret key's associated mnemonic
|
|
89
|
+
*/
|
|
90
|
+
function secretKeyToMnemonic(sk) {
|
|
91
|
+
return mnemonicFromSeed(sk.slice(0, SEED_BTYES_LENGTH));
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* mnemonicToMasterDerivationKey takes a mnemonic string and returns the corresponding master derivation key.
|
|
95
|
+
* @param mn - 25 words Algorand mnemonic
|
|
96
|
+
* @returns Uint8Array
|
|
97
|
+
* @throws error if fails to decode the mnemonic
|
|
98
|
+
*/
|
|
99
|
+
function mnemonicToMasterDerivationKey(mn) {
|
|
100
|
+
return seedFromMnemonic(mn);
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* masterDerivationKeyToMnemonic takes a master derivation key and returns the corresponding mnemonic.
|
|
104
|
+
* @param mdk - Uint8Array
|
|
105
|
+
* @returns string mnemonic
|
|
106
|
+
*/
|
|
107
|
+
function masterDerivationKeyToMnemonic(mdk) {
|
|
108
|
+
return mnemonicFromSeed(mdk);
|
|
109
|
+
}
|
|
72
110
|
|
|
73
111
|
//#endregion
|
|
74
|
-
export { seedFromMnemonic };
|
|
112
|
+
export { FAIL_TO_DECODE_MNEMONIC_ERROR_MSG, NOT_IN_WORDS_LIST_ERROR_MSG, masterDerivationKeyToMnemonic, mnemonicFromSeed, mnemonicToMasterDerivationKey, secretKeyToMnemonic, seedFromMnemonic };
|
|
75
113
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":["buffer11: number[]","english","buffer8: number[]"],"sources":["../../../../packages/algo25/src/index.ts"],"sourcesContent":["import english from './english.js'\nimport { hash } from '@algorandfoundation/algokit-common'\nexport const FAIL_TO_DECODE_MNEMONIC_ERROR_MSG = 'failed to decode mnemonic'\nexport const NOT_IN_WORDS_LIST_ERROR_MSG = 'the mnemonic contains a word that is not in the wordlist'\n\nconst SEED_BTYES_LENGTH = 32\n\n// https://stackoverflow.com/a/51452614\nfunction toUint11Array(buffer8: Uint8Array | number[]): number[] {\n const buffer11: number[] = []\n let acc = 0\n let accBits = 0\n function add(octet: number) {\n acc |= octet << accBits\n accBits += 8\n if (accBits >= 11) {\n buffer11.push(acc & 0x7ff)\n acc >>= 11\n accBits -= 11\n }\n }\n function flush() {\n if (accBits) {\n buffer11.push(acc)\n }\n }\n\n buffer8.forEach(add)\n flush()\n return buffer11\n}\n\nfunction applyWords(nums: number[]): string[] {\n return nums.map((n) => english[n])\n}\n\nfunction computeChecksum(seed: Uint8Array): string {\n const hashBuffer = hash(seed)\n const uint11Hash = toUint11Array(hashBuffer)\n const words = applyWords(uint11Hash)\n\n return words[0]\n}\n\n/**\n * mnemonicFromSeed converts a 32-byte key into a 25 word mnemonic. The generated mnemonic includes a checksum.\n * Each word in the mnemonic represents 11 bits of data, and the last 11 bits are reserved for the checksum.\n * @param seed - 32 bytes long seed\n * @returns 25 words mnemonic\n */\nexport function mnemonicFromSeed(seed: Uint8Array) {\n // Sanity length check\n if (seed.length !== SEED_BTYES_LENGTH) {\n throw new RangeError(`Seed length must be ${SEED_BTYES_LENGTH}`)\n }\n\n const uint11Array = toUint11Array(seed)\n const words = applyWords(uint11Array)\n const checksumWord = computeChecksum(seed)\n\n return `${words.join(' ')} ${checksumWord}`\n}\n\n// from Uint11Array\n// https://stackoverflow.com/a/51452614\nfunction toUint8Array(buffer11: number[]): Uint8Array {\n const buffer8: number[] = []\n let acc = 0\n let accBits = 0\n function add(ui11: number) {\n acc |= ui11 << accBits\n accBits += 11\n while (accBits >= 8) {\n buffer8.push(acc & 0xff)\n acc >>= 8\n accBits -= 8\n }\n }\n function flush() {\n if (accBits) {\n buffer8.push(acc)\n }\n }\n\n buffer11.forEach(add)\n flush()\n return new Uint8Array(buffer8)\n}\n\n/**\n * seedFromMnemonic converts a mnemonic generated using this library into the source key used to create it.\n * It returns an error if the passed mnemonic has an incorrect checksum, if the number of words is unexpected, or if one\n * of the passed words is not found in the words list.\n * @param mnemonic - 25 words mnemonic\n * @returns 32 bytes long seed\n */\nexport function seedFromMnemonic(mnemonic: string) {\n const words = mnemonic.split(' ')\n const key = words.slice(0, 24)\n\n // Check that all words are in list\n for (const w of key) {\n if (english.indexOf(w) === -1) throw new Error(NOT_IN_WORDS_LIST_ERROR_MSG)\n }\n\n const checksum = words[words.length - 1]\n const uint11Array = key.map((word) => english.indexOf(word))\n\n // Convert the key to uint8Array\n let uint8Array = toUint8Array(uint11Array)\n\n // We need to chop the last byte -\n // the short explanation - Since 256 is not divisible by 11, we have an extra 0x0 byte.\n // The longer explanation - When splitting the 256 bits to chunks of 11, we get 23 words and a left over of 3 bits.\n // This left gets padded with another 8 bits to the create the 24th word.\n // While converting back to byte array, our new 264 bits array is divisible by 8 but the last byte is just the padding.\n\n // check that we have 33 bytes long array as expected\n if (uint8Array.length !== 33) throw new Error(FAIL_TO_DECODE_MNEMONIC_ERROR_MSG)\n\n // check that the last byte is actually 0x0\n if (uint8Array[uint8Array.length - 1] !== 0x0) throw new Error(FAIL_TO_DECODE_MNEMONIC_ERROR_MSG)\n\n // chop it !\n uint8Array = uint8Array.slice(0, uint8Array.length - 1)\n\n // compute checksum\n const cs = computeChecksum(uint8Array)\n\n // success!\n if (cs === checksum) return uint8Array\n\n throw new Error(FAIL_TO_DECODE_MNEMONIC_ERROR_MSG)\n}\n\n/**\n * secretKeyToMnemonic takes an Algorand secret key and returns the corresponding mnemonic.\n * @param sk - Algorand secret key\n * @returns Secret key's associated mnemonic\n */\nexport function secretKeyToMnemonic(sk: Uint8Array) {\n // get the seed from the sk\n const seed = sk.slice(0, SEED_BTYES_LENGTH)\n return mnemonicFromSeed(seed)\n}\n\n/**\n * mnemonicToMasterDerivationKey takes a mnemonic string and returns the corresponding master derivation key.\n * @param mn - 25 words Algorand mnemonic\n * @returns Uint8Array\n * @throws error if fails to decode the mnemonic\n */\nexport function mnemonicToMasterDerivationKey(mn: string) {\n return seedFromMnemonic(mn)\n}\n\n/**\n * masterDerivationKeyToMnemonic takes a master derivation key and returns the corresponding mnemonic.\n * @param mdk - Uint8Array\n * @returns string mnemonic\n */\nexport function masterDerivationKeyToMnemonic(mdk: Uint8Array) {\n return mnemonicFromSeed(mdk)\n}\n"],"mappings":";;;;AAEA,MAAa,oCAAoC;AACjD,MAAa,8BAA8B;
|
|
1
|
+
{"version":3,"file":"index.mjs","names":["buffer11: number[]","english","buffer8: number[]"],"sources":["../../../../packages/algo25/src/index.ts"],"sourcesContent":["import english from './english.js'\nimport { hash } from '@algorandfoundation/algokit-common'\nexport const FAIL_TO_DECODE_MNEMONIC_ERROR_MSG = 'failed to decode mnemonic'\nexport const NOT_IN_WORDS_LIST_ERROR_MSG = 'the mnemonic contains a word that is not in the wordlist'\n\nconst SEED_BTYES_LENGTH = 32\n\n// https://stackoverflow.com/a/51452614\nfunction toUint11Array(buffer8: Uint8Array | number[]): number[] {\n const buffer11: number[] = []\n let acc = 0\n let accBits = 0\n function add(octet: number) {\n acc |= octet << accBits\n accBits += 8\n if (accBits >= 11) {\n buffer11.push(acc & 0x7ff)\n acc >>= 11\n accBits -= 11\n }\n }\n function flush() {\n if (accBits) {\n buffer11.push(acc)\n }\n }\n\n buffer8.forEach(add)\n flush()\n return buffer11\n}\n\nfunction applyWords(nums: number[]): string[] {\n return nums.map((n) => english[n])\n}\n\nfunction computeChecksum(seed: Uint8Array): string {\n const hashBuffer = hash(seed)\n const uint11Hash = toUint11Array(hashBuffer)\n const words = applyWords(uint11Hash)\n\n return words[0]\n}\n\n/**\n * mnemonicFromSeed converts a 32-byte key into a 25 word mnemonic. The generated mnemonic includes a checksum.\n * Each word in the mnemonic represents 11 bits of data, and the last 11 bits are reserved for the checksum.\n * @param seed - 32 bytes long seed\n * @returns 25 words mnemonic\n */\nexport function mnemonicFromSeed(seed: Uint8Array) {\n // Sanity length check\n if (seed.length !== SEED_BTYES_LENGTH) {\n throw new RangeError(`Seed length must be ${SEED_BTYES_LENGTH}`)\n }\n\n const uint11Array = toUint11Array(seed)\n const words = applyWords(uint11Array)\n const checksumWord = computeChecksum(seed)\n\n return `${words.join(' ')} ${checksumWord}`\n}\n\n// from Uint11Array\n// https://stackoverflow.com/a/51452614\nfunction toUint8Array(buffer11: number[]): Uint8Array {\n const buffer8: number[] = []\n let acc = 0\n let accBits = 0\n function add(ui11: number) {\n acc |= ui11 << accBits\n accBits += 11\n while (accBits >= 8) {\n buffer8.push(acc & 0xff)\n acc >>= 8\n accBits -= 8\n }\n }\n function flush() {\n if (accBits) {\n buffer8.push(acc)\n }\n }\n\n buffer11.forEach(add)\n flush()\n return new Uint8Array(buffer8)\n}\n\n/**\n * seedFromMnemonic converts a mnemonic generated using this library into the source key used to create it.\n * It returns an error if the passed mnemonic has an incorrect checksum, if the number of words is unexpected, or if one\n * of the passed words is not found in the words list.\n * @param mnemonic - 25 words mnemonic\n * @returns 32 bytes long seed\n */\nexport function seedFromMnemonic(mnemonic: string) {\n const words = mnemonic.split(' ')\n const key = words.slice(0, 24)\n\n // Check that all words are in list\n for (const w of key) {\n if (english.indexOf(w) === -1) throw new Error(NOT_IN_WORDS_LIST_ERROR_MSG)\n }\n\n const checksum = words[words.length - 1]\n const uint11Array = key.map((word) => english.indexOf(word))\n\n // Convert the key to uint8Array\n let uint8Array = toUint8Array(uint11Array)\n\n // We need to chop the last byte -\n // the short explanation - Since 256 is not divisible by 11, we have an extra 0x0 byte.\n // The longer explanation - When splitting the 256 bits to chunks of 11, we get 23 words and a left over of 3 bits.\n // This left gets padded with another 8 bits to the create the 24th word.\n // While converting back to byte array, our new 264 bits array is divisible by 8 but the last byte is just the padding.\n\n // check that we have 33 bytes long array as expected\n if (uint8Array.length !== 33) throw new Error(FAIL_TO_DECODE_MNEMONIC_ERROR_MSG)\n\n // check that the last byte is actually 0x0\n if (uint8Array[uint8Array.length - 1] !== 0x0) throw new Error(FAIL_TO_DECODE_MNEMONIC_ERROR_MSG)\n\n // chop it !\n uint8Array = uint8Array.slice(0, uint8Array.length - 1)\n\n // compute checksum\n const cs = computeChecksum(uint8Array)\n\n // success!\n if (cs === checksum) return uint8Array\n\n throw new Error(FAIL_TO_DECODE_MNEMONIC_ERROR_MSG)\n}\n\n/**\n * secretKeyToMnemonic takes an Algorand secret key and returns the corresponding mnemonic.\n * @param sk - Algorand secret key\n * @returns Secret key's associated mnemonic\n */\nexport function secretKeyToMnemonic(sk: Uint8Array) {\n // get the seed from the sk\n const seed = sk.slice(0, SEED_BTYES_LENGTH)\n return mnemonicFromSeed(seed)\n}\n\n/**\n * mnemonicToMasterDerivationKey takes a mnemonic string and returns the corresponding master derivation key.\n * @param mn - 25 words Algorand mnemonic\n * @returns Uint8Array\n * @throws error if fails to decode the mnemonic\n */\nexport function mnemonicToMasterDerivationKey(mn: string) {\n return seedFromMnemonic(mn)\n}\n\n/**\n * masterDerivationKeyToMnemonic takes a master derivation key and returns the corresponding mnemonic.\n * @param mdk - Uint8Array\n * @returns string mnemonic\n */\nexport function masterDerivationKeyToMnemonic(mdk: Uint8Array) {\n return mnemonicFromSeed(mdk)\n}\n"],"mappings":";;;;AAEA,MAAa,oCAAoC;AACjD,MAAa,8BAA8B;AAE3C,MAAM,oBAAoB;AAG1B,SAAS,cAAc,SAA0C;CAC/D,MAAMA,WAAqB,EAAE;CAC7B,IAAI,MAAM;CACV,IAAI,UAAU;CACd,SAAS,IAAI,OAAe;AAC1B,SAAO,SAAS;AAChB,aAAW;AACX,MAAI,WAAW,IAAI;AACjB,YAAS,KAAK,MAAM,KAAM;AAC1B,WAAQ;AACR,cAAW;;;CAGf,SAAS,QAAQ;AACf,MAAI,QACF,UAAS,KAAK,IAAI;;AAItB,SAAQ,QAAQ,IAAI;AACpB,QAAO;AACP,QAAO;;AAGT,SAAS,WAAW,MAA0B;AAC5C,QAAO,KAAK,KAAK,MAAMC,gBAAQ,GAAG;;AAGpC,SAAS,gBAAgB,MAA0B;AAKjD,QAFc,WADK,cADA,KAAK,KAAK,CACe,CACR,CAEvB;;;;;;;;AASf,SAAgB,iBAAiB,MAAkB;AAEjD,KAAI,KAAK,WAAW,kBAClB,OAAM,IAAI,WAAW,uBAAuB,oBAAoB;CAIlE,MAAM,QAAQ,WADM,cAAc,KAAK,CACF;CACrC,MAAM,eAAe,gBAAgB,KAAK;AAE1C,QAAO,GAAG,MAAM,KAAK,IAAI,CAAC,GAAG;;AAK/B,SAAS,aAAa,UAAgC;CACpD,MAAMC,UAAoB,EAAE;CAC5B,IAAI,MAAM;CACV,IAAI,UAAU;CACd,SAAS,IAAI,MAAc;AACzB,SAAO,QAAQ;AACf,aAAW;AACX,SAAO,WAAW,GAAG;AACnB,WAAQ,KAAK,MAAM,IAAK;AACxB,WAAQ;AACR,cAAW;;;CAGf,SAAS,QAAQ;AACf,MAAI,QACF,SAAQ,KAAK,IAAI;;AAIrB,UAAS,QAAQ,IAAI;AACrB,QAAO;AACP,QAAO,IAAI,WAAW,QAAQ;;;;;;;;;AAUhC,SAAgB,iBAAiB,UAAkB;CACjD,MAAM,QAAQ,SAAS,MAAM,IAAI;CACjC,MAAM,MAAM,MAAM,MAAM,GAAG,GAAG;AAG9B,MAAK,MAAM,KAAK,IACd,KAAID,gBAAQ,QAAQ,EAAE,KAAK,GAAI,OAAM,IAAI,MAAM,4BAA4B;CAG7E,MAAM,WAAW,MAAM,MAAM,SAAS;CAItC,IAAI,aAAa,aAHG,IAAI,KAAK,SAASA,gBAAQ,QAAQ,KAAK,CAAC,CAGlB;AAS1C,KAAI,WAAW,WAAW,GAAI,OAAM,IAAI,MAAM,kCAAkC;AAGhF,KAAI,WAAW,WAAW,SAAS,OAAO,EAAK,OAAM,IAAI,MAAM,kCAAkC;AAGjG,cAAa,WAAW,MAAM,GAAG,WAAW,SAAS,EAAE;AAMvD,KAHW,gBAAgB,WAAW,KAG3B,SAAU,QAAO;AAE5B,OAAM,IAAI,MAAM,kCAAkC;;;;;;;AAQpD,SAAgB,oBAAoB,IAAgB;AAGlD,QAAO,iBADM,GAAG,MAAM,GAAG,kBAAkB,CACd;;;;;;;;AAS/B,SAAgB,8BAA8B,IAAY;AACxD,QAAO,iBAAiB,GAAG;;;;;;;AAQ7B,SAAgB,8BAA8B,KAAiB;AAC7D,QAAO,iBAAiB,IAAI"}
|
|
@@ -52,84 +52,66 @@ declare class AlgodApi {
|
|
|
52
52
|
/**
|
|
53
53
|
* Given an application ID and box name, it returns the round, box name, and value (each base64 encoded). Box names must be in the goal app call arg encoding form 'encoding:value'. For ints, use the form 'int:1234'. For raw bytes, use the form 'b64:A=='. For printable strings, use the form 'str:hello'. For addresses, use the form 'addr:XYZ...'.
|
|
54
54
|
*/
|
|
55
|
-
private
|
|
55
|
+
private _applicationBoxByName;
|
|
56
56
|
/**
|
|
57
57
|
* Given an application ID, return all Box names. No particular ordering is guaranteed. Request fails when client or server-side configured limits prevent returning all Box names.
|
|
58
58
|
*/
|
|
59
|
-
|
|
59
|
+
applicationBoxes(applicationId: number | bigint, params?: {
|
|
60
60
|
max?: number;
|
|
61
61
|
}): Promise<BoxesResponse>;
|
|
62
62
|
/**
|
|
63
63
|
* Given a application ID, it returns application information including creator, approval and clear programs, global and local schemas, and global state.
|
|
64
64
|
*/
|
|
65
|
-
|
|
65
|
+
applicationById(applicationId: number | bigint): Promise<Application>;
|
|
66
66
|
/**
|
|
67
67
|
* Given a asset ID, it returns asset information including creator, name, total supply and special addresses.
|
|
68
68
|
*/
|
|
69
|
-
|
|
70
|
-
|
|
69
|
+
assetById(assetId: number | bigint): Promise<Asset>;
|
|
70
|
+
block(round: number | bigint, params?: {
|
|
71
71
|
headerOnly?: boolean;
|
|
72
72
|
}): Promise<BlockResponse>;
|
|
73
|
-
|
|
73
|
+
blockHash(round: number | bigint): Promise<BlockHashResponse>;
|
|
74
74
|
/**
|
|
75
75
|
* Gets the current timestamp offset.
|
|
76
76
|
*/
|
|
77
|
-
|
|
78
|
-
|
|
77
|
+
blockTimeStampOffset(): Promise<GetBlockTimeStampOffsetResponse>;
|
|
78
|
+
blockTxIds(round: number | bigint): Promise<BlockTxidsResponse>;
|
|
79
79
|
/**
|
|
80
80
|
* Returns the entire genesis file in json.
|
|
81
81
|
*/
|
|
82
|
-
|
|
82
|
+
genesis(): Promise<Genesis>;
|
|
83
|
+
healthCheck(): Promise<void>;
|
|
83
84
|
/**
|
|
84
85
|
* Get ledger deltas for a round.
|
|
85
86
|
*/
|
|
86
|
-
|
|
87
|
+
ledgerStateDelta(round: number | bigint): Promise<LedgerStateDelta>;
|
|
87
88
|
/**
|
|
88
89
|
* Get a ledger delta for a given transaction group.
|
|
89
90
|
*/
|
|
90
|
-
|
|
91
|
-
|
|
91
|
+
ledgerStateDeltaForTransactionGroup(id: string): Promise<LedgerStateDelta>;
|
|
92
|
+
lightBlockHeaderProof(round: number | bigint): Promise<LightBlockHeaderProof>;
|
|
93
|
+
/**
|
|
94
|
+
* Given a transaction ID of a recently submitted transaction, it returns information about it. There are several cases when this might succeed:
|
|
95
|
+
* - transaction committed (committed round > 0)
|
|
96
|
+
* - transaction still in the pool (committed round = 0, pool error = "")
|
|
97
|
+
* - transaction removed from pool due to error (committed round = 0, pool error != "")
|
|
98
|
+
* Or the transaction may have happened sufficiently long ago that the node no longer remembers it, and this will return an error.
|
|
99
|
+
*/
|
|
100
|
+
pendingTransactionInformation(txId: string): Promise<PendingTransactionResponse>;
|
|
92
101
|
/**
|
|
93
102
|
* Get the list of pending transactions, sorted by priority, in decreasing order, truncated at the end at MAX. If MAX = 0, returns all pending transactions.
|
|
94
103
|
*/
|
|
95
|
-
|
|
104
|
+
pendingTransactions(params?: {
|
|
96
105
|
max?: number;
|
|
97
106
|
}): Promise<PendingTransactionsResponse>;
|
|
98
107
|
/**
|
|
99
108
|
* Get the list of pending transactions by address, sorted by priority, in decreasing order, truncated at the end at MAX. If MAX = 0, returns all pending transactions.
|
|
100
109
|
*/
|
|
101
|
-
|
|
110
|
+
pendingTransactionsByAddress(address: ReadableAddress, params?: {
|
|
102
111
|
max?: number;
|
|
103
112
|
}): Promise<PendingTransactionsResponse>;
|
|
104
|
-
getReady(): Promise<void>;
|
|
105
|
-
getStateProof(round: number | bigint): Promise<StateProof>;
|
|
106
|
-
getStatus(): Promise<NodeStatusResponse>;
|
|
107
|
-
getSupply(): Promise<SupplyResponse>;
|
|
108
|
-
/**
|
|
109
|
-
* Gets the minimum sync round for the ledger.
|
|
110
|
-
*/
|
|
111
|
-
getSyncRound(): Promise<GetSyncRoundResponse>;
|
|
112
|
-
/**
|
|
113
|
-
* Get ledger deltas for transaction groups in a given round.
|
|
114
|
-
*/
|
|
115
|
-
getTransactionGroupLedgerStateDeltasForRound(round: number | bigint): Promise<TransactionGroupLedgerStateDeltasForRoundResponse>;
|
|
116
|
-
getTransactionProof(round: number | bigint, txId: string, params?: {
|
|
117
|
-
hashtype?: 'sha512_256' | 'sha256';
|
|
118
|
-
}): Promise<TransactionProof>;
|
|
119
|
-
/**
|
|
120
|
-
* Retrieves the supported API versions, binary build versions, and genesis information.
|
|
121
|
-
*/
|
|
122
|
-
getVersion(): Promise<Version>;
|
|
123
|
-
healthCheck(): Promise<void>;
|
|
124
|
-
/**
|
|
125
|
-
* Given a transaction ID of a recently submitted transaction, it returns information about it. There are several cases when this might succeed:
|
|
126
|
-
* - transaction committed (committed round > 0)
|
|
127
|
-
* - transaction still in the pool (committed round = 0, pool error = "")
|
|
128
|
-
* - transaction removed from pool due to error (committed round = 0, pool error != "")
|
|
129
|
-
* Or the transaction may have happened sufficiently long ago that the node no longer remembers it, and this will return an error.
|
|
130
|
-
*/
|
|
131
|
-
pendingTransactionInformation(txId: string): Promise<PendingTransactionResponse>;
|
|
132
113
|
private _rawTransaction;
|
|
114
|
+
ready(): Promise<void>;
|
|
133
115
|
/**
|
|
134
116
|
* Sets the timestamp offset (seconds) for blocks in dev mode. Providing an offset of 0 will unset this value and try to use the real clock for the timestamp.
|
|
135
117
|
*/
|
|
@@ -139,10 +121,17 @@ declare class AlgodApi {
|
|
|
139
121
|
*/
|
|
140
122
|
setSyncRound(round: number | bigint): Promise<void>;
|
|
141
123
|
simulateTransactions(body: SimulateRequest): Promise<SimulateResponse>;
|
|
124
|
+
stateProof(round: number | bigint): Promise<StateProof>;
|
|
125
|
+
status(): Promise<NodeStatusResponse>;
|
|
142
126
|
/**
|
|
143
127
|
* Waits for a block to appear after round {round} and returns the node's status at the time. There is a 1 minute timeout, when reached the current status is returned regardless of whether or not it is the round after the given round.
|
|
144
128
|
*/
|
|
145
129
|
statusAfterBlock(round: number | bigint): Promise<NodeStatusResponse>;
|
|
130
|
+
supply(): Promise<SupplyResponse>;
|
|
131
|
+
/**
|
|
132
|
+
* Gets the minimum sync round for the ledger.
|
|
133
|
+
*/
|
|
134
|
+
syncRound(): Promise<GetSyncRoundResponse>;
|
|
146
135
|
/**
|
|
147
136
|
* Given TEAL source code in plain text, return base64 encoded program bytes and base32 SHA512_256 hash of program bytes (Address style). This endpoint is only enabled when a node's configuration file sets EnableDeveloperAPI to true.
|
|
148
137
|
*/
|
|
@@ -153,11 +142,22 @@ declare class AlgodApi {
|
|
|
153
142
|
* Given the program bytes, return the TEAL source code in plain text. This endpoint is only enabled when a node's configuration file sets EnableDeveloperAPI to true.
|
|
154
143
|
*/
|
|
155
144
|
tealDisassemble(body: Uint8Array): Promise<DisassembleResponse>;
|
|
145
|
+
/**
|
|
146
|
+
* Get ledger deltas for transaction groups in a given round.
|
|
147
|
+
*/
|
|
148
|
+
transactionGroupLedgerStateDeltasForRound(round: number | bigint): Promise<TransactionGroupLedgerStateDeltasForRoundResponse>;
|
|
156
149
|
private _transactionParams;
|
|
150
|
+
transactionProof(round: number | bigint, txId: string, params?: {
|
|
151
|
+
hashtype?: 'sha512_256' | 'sha256';
|
|
152
|
+
}): Promise<TransactionProof>;
|
|
157
153
|
/**
|
|
158
154
|
* Unset the ledger sync round.
|
|
159
155
|
*/
|
|
160
156
|
unsetSyncRound(): Promise<void>;
|
|
157
|
+
/**
|
|
158
|
+
* Retrieves the supported API versions, binary build versions, and genesis information.
|
|
159
|
+
*/
|
|
160
|
+
version(): Promise<Version>;
|
|
161
161
|
/**
|
|
162
162
|
* Send a signed transaction or array of signed transactions to the network.
|
|
163
163
|
*/
|
|
@@ -165,7 +165,7 @@ declare class AlgodApi {
|
|
|
165
165
|
/**
|
|
166
166
|
* Given an application ID and box name, it returns the round, box name, and value.
|
|
167
167
|
*/
|
|
168
|
-
|
|
168
|
+
applicationBoxByName(applicationId: number | bigint, boxName: Uint8Array): Promise<Box>;
|
|
169
169
|
/**
|
|
170
170
|
* Returns the common needed parameters for a new transaction.
|
|
171
171
|
*/
|
|
@@ -173,7 +173,7 @@ declare class AlgodApi {
|
|
|
173
173
|
/**
|
|
174
174
|
* Returns the common needed parameters for a new transaction.
|
|
175
175
|
*/
|
|
176
|
-
|
|
176
|
+
transactionParams(): Promise<SuggestedParams>;
|
|
177
177
|
/**
|
|
178
178
|
* Simulate an encoded signed transaction or array of encoded signed transactions.
|
|
179
179
|
*/
|