kalvora.js 0.0.1-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +162 -0
- package/LICENSE +202 -0
- package/NOTICE +10 -0
- package/README.md +391 -0
- package/dist/LICENSE +202 -0
- package/dist/README.md +391 -0
- package/dist/index.cjs +78254 -0
- package/dist/index.cjs.map +7 -0
- package/dist/index.d.ts +83 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +125 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +125 -0
- package/dist/proto/generated/google/protobuf/empty_pb.d.ts +63 -0
- package/dist/proto/generated/google/protobuf/empty_pb.js +49 -0
- package/dist/proto/generated/google/protobuf/timestamp_pb.d.ts +163 -0
- package/dist/proto/generated/google/protobuf/timestamp_pb.js +49 -0
- package/dist/proto/generated/guardian_pb.d.ts +1229 -0
- package/dist/proto/generated/guardian_pb.js +255 -0
- package/dist/proto/generated/kal_api_pb.d.ts +1350 -0
- package/dist/proto/generated/kal_api_pb.js +324 -0
- package/dist/proto/generated/txn_pb.d.ts +3653 -0
- package/dist/proto/generated/txn_pb.js +622 -0
- package/dist/proto/generated/validator_pb.d.ts +2385 -0
- package/dist/proto/generated/validator_pb.js +528 -0
- package/dist/proto/guardian.proto +266 -0
- package/dist/proto/kal_api.proto +289 -0
- package/dist/proto/txn.proto +718 -0
- package/dist/proto/validator.proto +469 -0
- package/dist/src/adapter/constants.d.ts +80 -0
- package/dist/src/adapter/constants.d.ts.map +1 -0
- package/dist/src/adapter/constants.js +89 -0
- package/dist/src/adapter/constants.js.map +1 -0
- package/dist/src/adapter/index.d.ts +45 -0
- package/dist/src/adapter/index.d.ts.map +1 -0
- package/dist/src/adapter/index.js +71 -0
- package/dist/src/adapter/index.js.map +1 -0
- package/dist/src/adapter/serialization.d.ts +94 -0
- package/dist/src/adapter/serialization.d.ts.map +1 -0
- package/dist/src/adapter/serialization.js +175 -0
- package/dist/src/adapter/serialization.js.map +1 -0
- package/dist/src/adapter/wallet-adapter.d.ts +230 -0
- package/dist/src/adapter/wallet-adapter.d.ts.map +1 -0
- package/dist/src/adapter/wallet-adapter.js +792 -0
- package/dist/src/adapter/wallet-adapter.js.map +1 -0
- package/dist/src/adapter/wallet-signer.d.ts +115 -0
- package/dist/src/adapter/wallet-signer.d.ts.map +1 -0
- package/dist/src/adapter/wallet-signer.js +357 -0
- package/dist/src/adapter/wallet-signer.js.map +1 -0
- package/dist/src/adapter/walletconnect.d.ts +148 -0
- package/dist/src/adapter/walletconnect.d.ts.map +1 -0
- package/dist/src/adapter/walletconnect.js +188 -0
- package/dist/src/adapter/walletconnect.js.map +1 -0
- package/dist/src/allowance/index.d.ts +2 -0
- package/dist/src/allowance/index.d.ts.map +1 -0
- package/dist/src/allowance/index.js +2 -0
- package/dist/src/allowance/index.js.map +1 -0
- package/dist/src/allowance/transaction.d.ts +227 -0
- package/dist/src/allowance/transaction.d.ts.map +1 -0
- package/dist/src/allowance/transaction.js +296 -0
- package/dist/src/allowance/transaction.js.map +1 -0
- package/dist/src/api/handler/fee-info/service.d.ts +126 -0
- package/dist/src/api/handler/fee-info/service.d.ts.map +1 -0
- package/dist/src/api/handler/fee-info/service.js +255 -0
- package/dist/src/api/handler/fee-info/service.js.map +1 -0
- package/dist/src/api/handler/index.d.ts +10 -0
- package/dist/src/api/handler/index.d.ts.map +1 -0
- package/dist/src/api/handler/index.js +14 -0
- package/dist/src/api/handler/index.js.map +1 -0
- package/dist/src/api/handler/nonce/service.d.ts +37 -0
- package/dist/src/api/handler/nonce/service.d.ts.map +1 -0
- package/dist/src/api/handler/nonce/service.js +64 -0
- package/dist/src/api/handler/nonce/service.js.map +1 -0
- package/dist/src/api/handler/token-info/service.d.ts +123 -0
- package/dist/src/api/handler/token-info/service.d.ts.map +1 -0
- package/dist/src/api/handler/token-info/service.js +218 -0
- package/dist/src/api/handler/token-info/service.js.map +1 -0
- package/dist/src/api/shared/indexer-utils.d.ts +14 -0
- package/dist/src/api/shared/indexer-utils.d.ts.map +1 -0
- package/dist/src/api/shared/indexer-utils.js +19 -0
- package/dist/src/api/shared/indexer-utils.js.map +1 -0
- package/dist/src/api/validator/balance/index.d.ts +8 -0
- package/dist/src/api/validator/balance/index.d.ts.map +1 -0
- package/dist/src/api/validator/balance/index.js +7 -0
- package/dist/src/api/validator/balance/index.js.map +1 -0
- package/dist/src/api/validator/balance/service.d.ts +42 -0
- package/dist/src/api/validator/balance/service.d.ts.map +1 -0
- package/dist/src/api/validator/balance/service.js +93 -0
- package/dist/src/api/validator/balance/service.js.map +1 -0
- package/dist/src/api/validator/base-fee/index.d.ts +8 -0
- package/dist/src/api/validator/base-fee/index.d.ts.map +1 -0
- package/dist/src/api/validator/base-fee/index.js +7 -0
- package/dist/src/api/validator/base-fee/index.js.map +1 -0
- package/dist/src/api/validator/base-fee/service.d.ts +39 -0
- package/dist/src/api/validator/base-fee/service.d.ts.map +1 -0
- package/dist/src/api/validator/base-fee/service.js +45 -0
- package/dist/src/api/validator/base-fee/service.js.map +1 -0
- package/dist/src/api/validator/fee-info/index.d.ts +7 -0
- package/dist/src/api/validator/fee-info/index.d.ts.map +1 -0
- package/dist/src/api/validator/fee-info/index.js +7 -0
- package/dist/src/api/validator/fee-info/index.js.map +1 -0
- package/dist/src/api/validator/fee-info/request.d.ts +25 -0
- package/dist/src/api/validator/fee-info/request.d.ts.map +1 -0
- package/dist/src/api/validator/fee-info/request.js +92 -0
- package/dist/src/api/validator/fee-info/request.js.map +1 -0
- package/dist/src/api/validator/nonce/index.d.ts +7 -0
- package/dist/src/api/validator/nonce/index.d.ts.map +1 -0
- package/dist/src/api/validator/nonce/index.js +7 -0
- package/dist/src/api/validator/nonce/index.js.map +1 -0
- package/dist/src/api/validator/nonce/service.d.ts +18 -0
- package/dist/src/api/validator/nonce/service.d.ts.map +1 -0
- package/dist/src/api/validator/nonce/service.js +51 -0
- package/dist/src/api/validator/nonce/service.js.map +1 -0
- package/dist/src/client/index.d.ts +8 -0
- package/dist/src/client/index.d.ts.map +1 -0
- package/dist/src/client/index.js +8 -0
- package/dist/src/client/index.js.map +1 -0
- package/dist/src/client/kalvora-client.d.ts +117 -0
- package/dist/src/client/kalvora-client.d.ts.map +1 -0
- package/dist/src/client/kalvora-client.js +112 -0
- package/dist/src/client/kalvora-client.js.map +1 -0
- package/dist/src/client/networks.d.ts +48 -0
- package/dist/src/client/networks.d.ts.map +1 -0
- package/dist/src/client/networks.js +41 -0
- package/dist/src/client/networks.js.map +1 -0
- package/dist/src/coin-txn/index.d.ts +9 -0
- package/dist/src/coin-txn/index.d.ts.map +1 -0
- package/dist/src/coin-txn/index.js +9 -0
- package/dist/src/coin-txn/index.js.map +1 -0
- package/dist/src/coin-txn/transaction.d.ts +94 -0
- package/dist/src/coin-txn/transaction.d.ts.map +1 -0
- package/dist/src/coin-txn/transaction.js +341 -0
- package/dist/src/coin-txn/transaction.js.map +1 -0
- package/dist/src/compliance/index.d.ts +2 -0
- package/dist/src/compliance/index.d.ts.map +1 -0
- package/dist/src/compliance/index.js +2 -0
- package/dist/src/compliance/index.js.map +1 -0
- package/dist/src/compliance/transaction.d.ts +150 -0
- package/dist/src/compliance/transaction.d.ts.map +1 -0
- package/dist/src/compliance/transaction.js +183 -0
- package/dist/src/compliance/transaction.js.map +1 -0
- package/dist/src/contract/create/index.d.ts +8 -0
- package/dist/src/contract/create/index.d.ts.map +1 -0
- package/dist/src/contract/create/index.js +7 -0
- package/dist/src/contract/create/index.js.map +1 -0
- package/dist/src/contract/create/transaction.d.ts +47 -0
- package/dist/src/contract/create/transaction.d.ts.map +1 -0
- package/dist/src/contract/create/transaction.js +137 -0
- package/dist/src/contract/create/transaction.js.map +1 -0
- package/dist/src/contract/index.d.ts +34 -0
- package/dist/src/contract/index.d.ts.map +1 -0
- package/dist/src/contract/index.js +34 -0
- package/dist/src/contract/index.js.map +1 -0
- package/dist/src/contract/shared/index.d.ts +6 -0
- package/dist/src/contract/shared/index.d.ts.map +1 -0
- package/dist/src/contract/shared/index.js +6 -0
- package/dist/src/contract/shared/index.js.map +1 -0
- package/dist/src/contract/shared/types.d.ts +114 -0
- package/dist/src/contract/shared/types.d.ts.map +1 -0
- package/dist/src/contract/shared/types.js +5 -0
- package/dist/src/contract/shared/types.js.map +1 -0
- package/dist/src/contract/shared/utils.d.ts +111 -0
- package/dist/src/contract/shared/utils.d.ts.map +1 -0
- package/dist/src/contract/shared/utils.js +182 -0
- package/dist/src/contract/shared/utils.js.map +1 -0
- package/dist/src/contract/update/index.d.ts +8 -0
- package/dist/src/contract/update/index.d.ts.map +1 -0
- package/dist/src/contract/update/index.js +7 -0
- package/dist/src/contract/update/index.js.map +1 -0
- package/dist/src/contract/update/transaction.d.ts +45 -0
- package/dist/src/contract/update/transaction.d.ts.map +1 -0
- package/dist/src/contract/update/transaction.js +123 -0
- package/dist/src/contract/update/transaction.js.map +1 -0
- package/dist/src/delegated-voting/index.d.ts +2 -0
- package/dist/src/delegated-voting/index.d.ts.map +1 -0
- package/dist/src/delegated-voting/index.js +2 -0
- package/dist/src/delegated-voting/index.js.map +1 -0
- package/dist/src/delegated-voting/transaction.d.ts +127 -0
- package/dist/src/delegated-voting/transaction.d.ts.map +1 -0
- package/dist/src/delegated-voting/transaction.js +195 -0
- package/dist/src/delegated-voting/transaction.js.map +1 -0
- package/dist/src/expense-ratio/index.d.ts +2 -0
- package/dist/src/expense-ratio/index.d.ts.map +1 -0
- package/dist/src/expense-ratio/index.js +2 -0
- package/dist/src/expense-ratio/index.js.map +1 -0
- package/dist/src/expense-ratio/transaction.d.ts +94 -0
- package/dist/src/expense-ratio/transaction.d.ts.map +1 -0
- package/dist/src/expense-ratio/transaction.js +122 -0
- package/dist/src/expense-ratio/transaction.js.map +1 -0
- package/dist/src/grpc/api/validator-api-client.d.ts +32 -0
- package/dist/src/grpc/api/validator-api-client.d.ts.map +1 -0
- package/dist/src/grpc/api/validator-api-client.js +61 -0
- package/dist/src/grpc/api/validator-api-client.js.map +1 -0
- package/dist/src/grpc/client-factory.d.ts +12 -0
- package/dist/src/grpc/client-factory.d.ts.map +1 -0
- package/dist/src/grpc/client-factory.js +248 -0
- package/dist/src/grpc/client-factory.js.map +1 -0
- package/dist/src/grpc/errors.d.ts +79 -0
- package/dist/src/grpc/errors.d.ts.map +1 -0
- package/dist/src/grpc/errors.js +108 -0
- package/dist/src/grpc/errors.js.map +1 -0
- package/dist/src/grpc/index.d.ts +21 -0
- package/dist/src/grpc/index.d.ts.map +1 -0
- package/dist/src/grpc/index.js +20 -0
- package/dist/src/grpc/index.js.map +1 -0
- package/dist/src/grpc/transaction/transaction-client.d.ts +97 -0
- package/dist/src/grpc/transaction/transaction-client.d.ts.map +1 -0
- package/dist/src/grpc/transaction/transaction-client.js +142 -0
- package/dist/src/grpc/transaction/transaction-client.js.map +1 -0
- package/dist/src/grpc/utils/grpc-web-fetch-wrapper.d.ts +2 -0
- package/dist/src/grpc/utils/grpc-web-fetch-wrapper.d.ts.map +1 -0
- package/dist/src/grpc/utils/grpc-web-fetch-wrapper.js +213 -0
- package/dist/src/grpc/utils/grpc-web-fetch-wrapper.js.map +1 -0
- package/dist/src/items/index.d.ts +7 -0
- package/dist/src/items/index.d.ts.map +1 -0
- package/dist/src/items/index.js +7 -0
- package/dist/src/items/index.js.map +1 -0
- package/dist/src/items/transaction.d.ts +132 -0
- package/dist/src/items/transaction.d.ts.map +1 -0
- package/dist/src/items/transaction.js +276 -0
- package/dist/src/items/transaction.js.map +1 -0
- package/dist/src/mint/index.d.ts +2 -0
- package/dist/src/mint/index.d.ts.map +1 -0
- package/dist/src/mint/index.js +2 -0
- package/dist/src/mint/index.js.map +1 -0
- package/dist/src/mint/transaction.d.ts +128 -0
- package/dist/src/mint/transaction.d.ts.map +1 -0
- package/dist/src/mint/transaction.js +118 -0
- package/dist/src/mint/transaction.js.map +1 -0
- package/dist/src/proposal/index.d.ts +3 -0
- package/dist/src/proposal/index.d.ts.map +1 -0
- package/dist/src/proposal/index.js +3 -0
- package/dist/src/proposal/index.js.map +1 -0
- package/dist/src/proposal/transaction.d.ts +95 -0
- package/dist/src/proposal/transaction.d.ts.map +1 -0
- package/dist/src/proposal/transaction.js +321 -0
- package/dist/src/proposal/transaction.js.map +1 -0
- package/dist/src/proposal-cancel/index.d.ts +2 -0
- package/dist/src/proposal-cancel/index.d.ts.map +1 -0
- package/dist/src/proposal-cancel/index.js +2 -0
- package/dist/src/proposal-cancel/index.js.map +1 -0
- package/dist/src/proposal-cancel/transaction.d.ts +31 -0
- package/dist/src/proposal-cancel/transaction.d.ts.map +1 -0
- package/dist/src/proposal-cancel/transaction.js +98 -0
- package/dist/src/proposal-cancel/transaction.js.map +1 -0
- package/dist/src/protocol/guardian-names.d.ts +35 -0
- package/dist/src/protocol/guardian-names.d.ts.map +1 -0
- package/dist/src/protocol/guardian-names.js +25 -0
- package/dist/src/protocol/guardian-names.js.map +1 -0
- package/dist/src/protocol/index.d.ts +36 -0
- package/dist/src/protocol/index.d.ts.map +1 -0
- package/dist/src/protocol/index.js +36 -0
- package/dist/src/protocol/index.js.map +1 -0
- package/dist/src/quash/index.d.ts +2 -0
- package/dist/src/quash/index.d.ts.map +1 -0
- package/dist/src/quash/index.js +2 -0
- package/dist/src/quash/index.js.map +1 -0
- package/dist/src/quash/transaction.d.ts +124 -0
- package/dist/src/quash/transaction.d.ts.map +1 -0
- package/dist/src/quash/transaction.js +118 -0
- package/dist/src/quash/transaction.js.map +1 -0
- package/dist/src/query/api-client.d.ts +368 -0
- package/dist/src/query/api-client.d.ts.map +1 -0
- package/dist/src/query/api-client.js +497 -0
- package/dist/src/query/api-client.js.map +1 -0
- package/dist/src/query/decoders.d.ts +184 -0
- package/dist/src/query/decoders.d.ts.map +1 -0
- package/dist/src/query/decoders.js +257 -0
- package/dist/src/query/decoders.js.map +1 -0
- package/dist/src/query/guardian-client.d.ts +73 -0
- package/dist/src/query/guardian-client.d.ts.map +1 -0
- package/dist/src/query/guardian-client.js +90 -0
- package/dist/src/query/guardian-client.js.map +1 -0
- package/dist/src/query/index.d.ts +16 -0
- package/dist/src/query/index.d.ts.map +1 -0
- package/dist/src/query/index.js +16 -0
- package/dist/src/query/index.js.map +1 -0
- package/dist/src/query/validator-client.d.ts +95 -0
- package/dist/src/query/validator-client.d.ts.map +1 -0
- package/dist/src/query/validator-client.js +116 -0
- package/dist/src/query/validator-client.js.map +1 -0
- package/dist/src/revoke/index.d.ts +2 -0
- package/dist/src/revoke/index.d.ts.map +1 -0
- package/dist/src/revoke/index.js +2 -0
- package/dist/src/revoke/index.js.map +1 -0
- package/dist/src/revoke/transaction.d.ts +123 -0
- package/dist/src/revoke/transaction.d.ts.map +1 -0
- package/dist/src/revoke/transaction.js +125 -0
- package/dist/src/revoke/transaction.js.map +1 -0
- package/dist/src/shared/crypto/address-utils.d.ts +71 -0
- package/dist/src/shared/crypto/address-utils.d.ts.map +1 -0
- package/dist/src/shared/crypto/address-utils.js +305 -0
- package/dist/src/shared/crypto/address-utils.js.map +1 -0
- package/dist/src/shared/crypto/constants.d.ts +29 -0
- package/dist/src/shared/crypto/constants.d.ts.map +1 -0
- package/dist/src/shared/crypto/constants.js +53 -0
- package/dist/src/shared/crypto/constants.js.map +1 -0
- package/dist/src/shared/crypto/signature-utils.d.ts +14 -0
- package/dist/src/shared/crypto/signature-utils.d.ts.map +1 -0
- package/dist/src/shared/crypto/signature-utils.js +40 -0
- package/dist/src/shared/crypto/signature-utils.js.map +1 -0
- package/dist/src/shared/fee-calculators/base-fee-constants.d.ts +33 -0
- package/dist/src/shared/fee-calculators/base-fee-constants.d.ts.map +1 -0
- package/dist/src/shared/fee-calculators/base-fee-constants.js +45 -0
- package/dist/src/shared/fee-calculators/base-fee-constants.js.map +1 -0
- package/dist/src/shared/fee-calculators/contract-fee-constants.d.ts +53 -0
- package/dist/src/shared/fee-calculators/contract-fee-constants.d.ts.map +1 -0
- package/dist/src/shared/fee-calculators/contract-fee-constants.js +73 -0
- package/dist/src/shared/fee-calculators/contract-fee-constants.js.map +1 -0
- package/dist/src/shared/fee-calculators/contract-fee-service.d.ts +60 -0
- package/dist/src/shared/fee-calculators/contract-fee-service.d.ts.map +1 -0
- package/dist/src/shared/fee-calculators/contract-fee-service.js +171 -0
- package/dist/src/shared/fee-calculators/contract-fee-service.js.map +1 -0
- package/dist/src/shared/fee-calculators/denomination-fallback.d.ts +41 -0
- package/dist/src/shared/fee-calculators/denomination-fallback.d.ts.map +1 -0
- package/dist/src/shared/fee-calculators/denomination-fallback.js +83 -0
- package/dist/src/shared/fee-calculators/denomination-fallback.js.map +1 -0
- package/dist/src/shared/fee-calculators/exchange-rate-service.d.ts +26 -0
- package/dist/src/shared/fee-calculators/exchange-rate-service.d.ts.map +1 -0
- package/dist/src/shared/fee-calculators/exchange-rate-service.js +62 -0
- package/dist/src/shared/fee-calculators/exchange-rate-service.js.map +1 -0
- package/dist/src/shared/fee-calculators/types.d.ts +81 -0
- package/dist/src/shared/fee-calculators/types.d.ts.map +1 -0
- package/dist/src/shared/fee-calculators/types.js +7 -0
- package/dist/src/shared/fee-calculators/types.js.map +1 -0
- package/dist/src/shared/fee-calculators/universal-fee-calculator.d.ts +144 -0
- package/dist/src/shared/fee-calculators/universal-fee-calculator.d.ts.map +1 -0
- package/dist/src/shared/fee-calculators/universal-fee-calculator.js +900 -0
- package/dist/src/shared/fee-calculators/universal-fee-calculator.js.map +1 -0
- package/dist/src/shared/monitoring/health-check.d.ts +37 -0
- package/dist/src/shared/monitoring/health-check.d.ts.map +1 -0
- package/dist/src/shared/monitoring/health-check.js +152 -0
- package/dist/src/shared/monitoring/health-check.js.map +1 -0
- package/dist/src/shared/monitoring/index.d.ts +9 -0
- package/dist/src/shared/monitoring/index.d.ts.map +1 -0
- package/dist/src/shared/monitoring/index.js +9 -0
- package/dist/src/shared/monitoring/index.js.map +1 -0
- package/dist/src/shared/monitoring/logger.d.ts +42 -0
- package/dist/src/shared/monitoring/logger.d.ts.map +1 -0
- package/dist/src/shared/monitoring/logger.js +185 -0
- package/dist/src/shared/monitoring/logger.js.map +1 -0
- package/dist/src/shared/monitoring/metrics.d.ts +33 -0
- package/dist/src/shared/monitoring/metrics.d.ts.map +1 -0
- package/dist/src/shared/monitoring/metrics.js +105 -0
- package/dist/src/shared/monitoring/metrics.js.map +1 -0
- package/dist/src/shared/network/constants.d.ts +34 -0
- package/dist/src/shared/network/constants.d.ts.map +1 -0
- package/dist/src/shared/network/constants.js +46 -0
- package/dist/src/shared/network/constants.js.map +1 -0
- package/dist/src/shared/protobuf/index.d.ts +18 -0
- package/dist/src/shared/protobuf/index.d.ts.map +1 -0
- package/dist/src/shared/protobuf/index.js +10 -0
- package/dist/src/shared/protobuf/index.js.map +1 -0
- package/dist/src/shared/tx/base.d.ts +24 -0
- package/dist/src/shared/tx/base.d.ts.map +1 -0
- package/dist/src/shared/tx/base.js +57 -0
- package/dist/src/shared/tx/base.js.map +1 -0
- package/dist/src/shared/tx/standard.d.ts +198 -0
- package/dist/src/shared/tx/standard.d.ts.map +1 -0
- package/dist/src/shared/tx/standard.js +283 -0
- package/dist/src/shared/tx/standard.js.map +1 -0
- package/dist/src/shared/utils/amount-utils.d.ts +110 -0
- package/dist/src/shared/utils/amount-utils.d.ts.map +1 -0
- package/dist/src/shared/utils/amount-utils.js +237 -0
- package/dist/src/shared/utils/amount-utils.js.map +1 -0
- package/dist/src/shared/utils/byte-utils.d.ts +127 -0
- package/dist/src/shared/utils/byte-utils.d.ts.map +1 -0
- package/dist/src/shared/utils/byte-utils.js +220 -0
- package/dist/src/shared/utils/byte-utils.js.map +1 -0
- package/dist/src/shared/utils/error-handler.d.ts +65 -0
- package/dist/src/shared/utils/error-handler.d.ts.map +1 -0
- package/dist/src/shared/utils/error-handler.js +157 -0
- package/dist/src/shared/utils/error-handler.js.map +1 -0
- package/dist/src/shared/utils/formatting.d.ts +133 -0
- package/dist/src/shared/utils/formatting.d.ts.map +1 -0
- package/dist/src/shared/utils/formatting.js +190 -0
- package/dist/src/shared/utils/formatting.js.map +1 -0
- package/dist/src/shared/utils/grpc-config-utils.d.ts +8 -0
- package/dist/src/shared/utils/grpc-config-utils.d.ts.map +1 -0
- package/dist/src/shared/utils/grpc-config-utils.js +11 -0
- package/dist/src/shared/utils/grpc-config-utils.js.map +1 -0
- package/dist/src/shared/utils/performance-benchmark.d.ts +136 -0
- package/dist/src/shared/utils/performance-benchmark.d.ts.map +1 -0
- package/dist/src/shared/utils/performance-benchmark.js +274 -0
- package/dist/src/shared/utils/performance-benchmark.js.map +1 -0
- package/dist/src/shared/utils/protobuf-utils.d.ts +39 -0
- package/dist/src/shared/utils/protobuf-utils.d.ts.map +1 -0
- package/dist/src/shared/utils/protobuf-utils.js +103 -0
- package/dist/src/shared/utils/protobuf-utils.js.map +1 -0
- package/dist/src/shared/utils/testing-defaults/grpc-config.d.ts +12 -0
- package/dist/src/shared/utils/testing-defaults/grpc-config.d.ts.map +1 -0
- package/dist/src/shared/utils/testing-defaults/grpc-config.js +16 -0
- package/dist/src/shared/utils/testing-defaults/grpc-config.js.map +1 -0
- package/dist/src/shared/utils/testing-defaults/index.d.ts +8 -0
- package/dist/src/shared/utils/testing-defaults/index.d.ts.map +1 -0
- package/dist/src/shared/utils/testing-defaults/index.js +8 -0
- package/dist/src/shared/utils/testing-defaults/index.js.map +1 -0
- package/dist/src/shared/utils/token-config.d.ts +31 -0
- package/dist/src/shared/utils/token-config.d.ts.map +1 -0
- package/dist/src/shared/utils/token-config.js +56 -0
- package/dist/src/shared/utils/token-config.js.map +1 -0
- package/dist/src/shared/utils/token-info.d.ts +101 -0
- package/dist/src/shared/utils/token-info.d.ts.map +1 -0
- package/dist/src/shared/utils/token-info.js +203 -0
- package/dist/src/shared/utils/token-info.js.map +1 -0
- package/dist/src/shared/utils/transaction-utils.d.ts +200 -0
- package/dist/src/shared/utils/transaction-utils.d.ts.map +1 -0
- package/dist/src/shared/utils/transaction-utils.js +293 -0
- package/dist/src/shared/utils/transaction-utils.js.map +1 -0
- package/dist/src/shared/utils/unified-amount-conversion.d.ts +65 -0
- package/dist/src/shared/utils/unified-amount-conversion.d.ts.map +1 -0
- package/dist/src/shared/utils/unified-amount-conversion.js +146 -0
- package/dist/src/shared/utils/unified-amount-conversion.js.map +1 -0
- package/dist/src/shared/utils/validation.d.ts +119 -0
- package/dist/src/shared/utils/validation.d.ts.map +1 -0
- package/dist/src/shared/utils/validation.js +540 -0
- package/dist/src/shared/utils/validation.js.map +1 -0
- package/dist/src/sign/finalize.d.ts +82 -0
- package/dist/src/sign/finalize.d.ts.map +1 -0
- package/dist/src/sign/finalize.js +216 -0
- package/dist/src/sign/finalize.js.map +1 -0
- package/dist/src/sign/index.d.ts +19 -0
- package/dist/src/sign/index.d.ts.map +1 -0
- package/dist/src/sign/index.js +21 -0
- package/dist/src/sign/index.js.map +1 -0
- package/dist/src/sign/signer.d.ts +71 -0
- package/dist/src/sign/signer.d.ts.map +1 -0
- package/dist/src/sign/signer.js +65 -0
- package/dist/src/sign/signer.js.map +1 -0
- package/dist/src/smart-contracts/deploy/index.d.ts +5 -0
- package/dist/src/smart-contracts/deploy/index.d.ts.map +1 -0
- package/dist/src/smart-contracts/deploy/index.js +5 -0
- package/dist/src/smart-contracts/deploy/index.js.map +1 -0
- package/dist/src/smart-contracts/deploy/transaction.d.ts +54 -0
- package/dist/src/smart-contracts/deploy/transaction.d.ts.map +1 -0
- package/dist/src/smart-contracts/deploy/transaction.js +116 -0
- package/dist/src/smart-contracts/deploy/transaction.js.map +1 -0
- package/dist/src/smart-contracts/execute/index.d.ts +5 -0
- package/dist/src/smart-contracts/execute/index.d.ts.map +1 -0
- package/dist/src/smart-contracts/execute/index.js +5 -0
- package/dist/src/smart-contracts/execute/index.js.map +1 -0
- package/dist/src/smart-contracts/execute/transaction.d.ts +60 -0
- package/dist/src/smart-contracts/execute/transaction.d.ts.map +1 -0
- package/dist/src/smart-contracts/execute/transaction.js +88 -0
- package/dist/src/smart-contracts/execute/transaction.js.map +1 -0
- package/dist/src/smart-contracts/instantiate/index.d.ts +6 -0
- package/dist/src/smart-contracts/instantiate/index.d.ts.map +1 -0
- package/dist/src/smart-contracts/instantiate/index.js +6 -0
- package/dist/src/smart-contracts/instantiate/index.js.map +1 -0
- package/dist/src/smart-contracts/instantiate/transaction.d.ts +43 -0
- package/dist/src/smart-contracts/instantiate/transaction.d.ts.map +1 -0
- package/dist/src/smart-contracts/instantiate/transaction.js +72 -0
- package/dist/src/smart-contracts/instantiate/transaction.js.map +1 -0
- package/dist/src/smart-contracts/shared/base.d.ts +29 -0
- package/dist/src/smart-contracts/shared/base.d.ts.map +1 -0
- package/dist/src/smart-contracts/shared/base.js +70 -0
- package/dist/src/smart-contracts/shared/base.js.map +1 -0
- package/dist/src/smart-contracts/shared/parameters.d.ts +26 -0
- package/dist/src/smart-contracts/shared/parameters.d.ts.map +1 -0
- package/dist/src/smart-contracts/shared/parameters.js +32 -0
- package/dist/src/smart-contracts/shared/parameters.js.map +1 -0
- package/dist/src/smart-contracts/shared/validation.d.ts +6 -0
- package/dist/src/smart-contracts/shared/validation.d.ts.map +1 -0
- package/dist/src/smart-contracts/shared/validation.js +13 -0
- package/dist/src/smart-contracts/shared/validation.js.map +1 -0
- package/dist/src/smart-contracts/use-cases/bootstrapping/index.d.ts +25 -0
- package/dist/src/smart-contracts/use-cases/bootstrapping/index.d.ts.map +1 -0
- package/dist/src/smart-contracts/use-cases/bootstrapping/index.js +30 -0
- package/dist/src/smart-contracts/use-cases/bootstrapping/index.js.map +1 -0
- package/dist/src/smart-contracts/use-cases/bootstrapping/transactions/index.d.ts +7 -0
- package/dist/src/smart-contracts/use-cases/bootstrapping/transactions/index.d.ts.map +1 -0
- package/dist/src/smart-contracts/use-cases/bootstrapping/transactions/index.js +7 -0
- package/dist/src/smart-contracts/use-cases/bootstrapping/transactions/index.js.map +1 -0
- package/dist/src/smart-contracts/use-cases/bootstrapping/transactions/process-rewards.d.ts +23 -0
- package/dist/src/smart-contracts/use-cases/bootstrapping/transactions/process-rewards.d.ts.map +1 -0
- package/dist/src/smart-contracts/use-cases/bootstrapping/transactions/process-rewards.js +39 -0
- package/dist/src/smart-contracts/use-cases/bootstrapping/transactions/process-rewards.js.map +1 -0
- package/dist/src/smart-contracts/use-cases/bootstrapping/transactions/stake.d.ts +27 -0
- package/dist/src/smart-contracts/use-cases/bootstrapping/transactions/stake.d.ts.map +1 -0
- package/dist/src/smart-contracts/use-cases/bootstrapping/transactions/stake.js +51 -0
- package/dist/src/smart-contracts/use-cases/bootstrapping/transactions/stake.js.map +1 -0
- package/dist/src/smart-contracts/use-cases/bootstrapping/transactions/update-wallet.d.ts +22 -0
- package/dist/src/smart-contracts/use-cases/bootstrapping/transactions/update-wallet.d.ts.map +1 -0
- package/dist/src/smart-contracts/use-cases/bootstrapping/transactions/update-wallet.js +43 -0
- package/dist/src/smart-contracts/use-cases/bootstrapping/transactions/update-wallet.js.map +1 -0
- package/dist/src/smart-contracts/use-cases/bootstrapping/types.d.ts +60 -0
- package/dist/src/smart-contracts/use-cases/bootstrapping/types.d.ts.map +1 -0
- package/dist/src/smart-contracts/use-cases/bootstrapping/types.js +8 -0
- package/dist/src/smart-contracts/use-cases/bootstrapping/types.js.map +1 -0
- package/dist/src/smart-contracts/use-cases/bootstrapping/utils.d.ts +131 -0
- package/dist/src/smart-contracts/use-cases/bootstrapping/utils.d.ts.map +1 -0
- package/dist/src/smart-contracts/use-cases/bootstrapping/utils.js +87 -0
- package/dist/src/smart-contracts/use-cases/bootstrapping/utils.js.map +1 -0
- package/dist/src/smart-contracts/use-cases/bridge/guardian/index.d.ts +49 -0
- package/dist/src/smart-contracts/use-cases/bridge/guardian/index.d.ts.map +1 -0
- package/dist/src/smart-contracts/use-cases/bridge/guardian/index.js +59 -0
- package/dist/src/smart-contracts/use-cases/bridge/guardian/index.js.map +1 -0
- package/dist/src/smart-contracts/use-cases/bridge/guardian/vaa.d.ts +150 -0
- package/dist/src/smart-contracts/use-cases/bridge/guardian/vaa.d.ts.map +1 -0
- package/dist/src/smart-contracts/use-cases/bridge/guardian/vaa.js +505 -0
- package/dist/src/smart-contracts/use-cases/bridge/guardian/vaa.js.map +1 -0
- package/dist/src/smart-contracts/use-cases/bridge/index.d.ts +68 -0
- package/dist/src/smart-contracts/use-cases/bridge/index.d.ts.map +1 -0
- package/dist/src/smart-contracts/use-cases/bridge/index.js +83 -0
- package/dist/src/smart-contracts/use-cases/bridge/index.js.map +1 -0
- package/dist/src/smart-contracts/use-cases/bridge/kalvora/index.d.ts +36 -0
- package/dist/src/smart-contracts/use-cases/bridge/kalvora/index.d.ts.map +1 -0
- package/dist/src/smart-contracts/use-cases/bridge/kalvora/index.js +53 -0
- package/dist/src/smart-contracts/use-cases/bridge/kalvora/index.js.map +1 -0
- package/dist/src/smart-contracts/use-cases/bridge/kalvora/transactions/index.d.ts +10 -0
- package/dist/src/smart-contracts/use-cases/bridge/kalvora/transactions/index.d.ts.map +1 -0
- package/dist/src/smart-contracts/use-cases/bridge/kalvora/transactions/index.js +17 -0
- package/dist/src/smart-contracts/use-cases/bridge/kalvora/transactions/index.js.map +1 -0
- package/dist/src/smart-contracts/use-cases/bridge/kalvora/transactions/lock.d.ts +65 -0
- package/dist/src/smart-contracts/use-cases/bridge/kalvora/transactions/lock.d.ts.map +1 -0
- package/dist/src/smart-contracts/use-cases/bridge/kalvora/transactions/lock.js +130 -0
- package/dist/src/smart-contracts/use-cases/bridge/kalvora/transactions/lock.js.map +1 -0
- package/dist/src/smart-contracts/use-cases/bridge/kalvora/transactions/release.d.ts +81 -0
- package/dist/src/smart-contracts/use-cases/bridge/kalvora/transactions/release.d.ts.map +1 -0
- package/dist/src/smart-contracts/use-cases/bridge/kalvora/transactions/release.js +187 -0
- package/dist/src/smart-contracts/use-cases/bridge/kalvora/transactions/release.js.map +1 -0
- package/dist/src/smart-contracts/use-cases/bridge/kalvora/types.d.ts +82 -0
- package/dist/src/smart-contracts/use-cases/bridge/kalvora/types.d.ts.map +1 -0
- package/dist/src/smart-contracts/use-cases/bridge/kalvora/types.js +7 -0
- package/dist/src/smart-contracts/use-cases/bridge/kalvora/types.js.map +1 -0
- package/dist/src/smart-contracts/use-cases/bridge/kalvora/utils.d.ts +49 -0
- package/dist/src/smart-contracts/use-cases/bridge/kalvora/utils.d.ts.map +1 -0
- package/dist/src/smart-contracts/use-cases/bridge/kalvora/utils.js +80 -0
- package/dist/src/smart-contracts/use-cases/bridge/kalvora/utils.js.map +1 -0
- package/dist/src/smart-contracts/use-cases/bridge/solana/constants.d.ts +84 -0
- package/dist/src/smart-contracts/use-cases/bridge/solana/constants.d.ts.map +1 -0
- package/dist/src/smart-contracts/use-cases/bridge/solana/constants.js +82 -0
- package/dist/src/smart-contracts/use-cases/bridge/solana/constants.js.map +1 -0
- package/dist/src/smart-contracts/use-cases/bridge/solana/index.d.ts +58 -0
- package/dist/src/smart-contracts/use-cases/bridge/solana/index.d.ts.map +1 -0
- package/dist/src/smart-contracts/use-cases/bridge/solana/index.js +90 -0
- package/dist/src/smart-contracts/use-cases/bridge/solana/index.js.map +1 -0
- package/dist/src/smart-contracts/use-cases/bridge/solana/transactions/burn.d.ts +26 -0
- package/dist/src/smart-contracts/use-cases/bridge/solana/transactions/burn.d.ts.map +1 -0
- package/dist/src/smart-contracts/use-cases/bridge/solana/transactions/burn.js +59 -0
- package/dist/src/smart-contracts/use-cases/bridge/solana/transactions/burn.js.map +1 -0
- package/dist/src/smart-contracts/use-cases/bridge/solana/transactions/helpers.d.ts +29 -0
- package/dist/src/smart-contracts/use-cases/bridge/solana/transactions/helpers.d.ts.map +1 -0
- package/dist/src/smart-contracts/use-cases/bridge/solana/transactions/helpers.js +50 -0
- package/dist/src/smart-contracts/use-cases/bridge/solana/transactions/helpers.js.map +1 -0
- package/dist/src/smart-contracts/use-cases/bridge/solana/transactions/index.d.ts +14 -0
- package/dist/src/smart-contracts/use-cases/bridge/solana/transactions/index.d.ts.map +1 -0
- package/dist/src/smart-contracts/use-cases/bridge/solana/transactions/index.js +31 -0
- package/dist/src/smart-contracts/use-cases/bridge/solana/transactions/index.js.map +1 -0
- package/dist/src/smart-contracts/use-cases/bridge/solana/transactions/lock.d.ts +70 -0
- package/dist/src/smart-contracts/use-cases/bridge/solana/transactions/lock.d.ts.map +1 -0
- package/dist/src/smart-contracts/use-cases/bridge/solana/transactions/lock.js +212 -0
- package/dist/src/smart-contracts/use-cases/bridge/solana/transactions/lock.js.map +1 -0
- package/dist/src/smart-contracts/use-cases/bridge/solana/transactions/mint.d.ts +60 -0
- package/dist/src/smart-contracts/use-cases/bridge/solana/transactions/mint.d.ts.map +1 -0
- package/dist/src/smart-contracts/use-cases/bridge/solana/transactions/mint.js +288 -0
- package/dist/src/smart-contracts/use-cases/bridge/solana/transactions/mint.js.map +1 -0
- package/dist/src/smart-contracts/use-cases/bridge/solana/transactions/registration.d.ts +54 -0
- package/dist/src/smart-contracts/use-cases/bridge/solana/transactions/registration.d.ts.map +1 -0
- package/dist/src/smart-contracts/use-cases/bridge/solana/transactions/registration.js +186 -0
- package/dist/src/smart-contracts/use-cases/bridge/solana/transactions/registration.js.map +1 -0
- package/dist/src/smart-contracts/use-cases/bridge/solana/transactions/release.d.ts +96 -0
- package/dist/src/smart-contracts/use-cases/bridge/solana/transactions/release.d.ts.map +1 -0
- package/dist/src/smart-contracts/use-cases/bridge/solana/transactions/release.js +406 -0
- package/dist/src/smart-contracts/use-cases/bridge/solana/transactions/release.js.map +1 -0
- package/dist/src/smart-contracts/use-cases/bridge/solana/transactions/token-type.d.ts +34 -0
- package/dist/src/smart-contracts/use-cases/bridge/solana/transactions/token-type.d.ts.map +1 -0
- package/dist/src/smart-contracts/use-cases/bridge/solana/transactions/token-type.js +55 -0
- package/dist/src/smart-contracts/use-cases/bridge/solana/transactions/token-type.js.map +1 -0
- package/dist/src/smart-contracts/use-cases/bridge/solana/types.d.ts +377 -0
- package/dist/src/smart-contracts/use-cases/bridge/solana/types.d.ts.map +1 -0
- package/dist/src/smart-contracts/use-cases/bridge/solana/types.js +9 -0
- package/dist/src/smart-contracts/use-cases/bridge/solana/types.js.map +1 -0
- package/dist/src/smart-contracts/use-cases/bridge/solana/utils.d.ts +121 -0
- package/dist/src/smart-contracts/use-cases/bridge/solana/utils.d.ts.map +1 -0
- package/dist/src/smart-contracts/use-cases/bridge/solana/utils.js +219 -0
- package/dist/src/smart-contracts/use-cases/bridge/solana/utils.js.map +1 -0
- package/dist/src/smart-contracts/use-cases/dex/index.d.ts +58 -0
- package/dist/src/smart-contracts/use-cases/dex/index.d.ts.map +1 -0
- package/dist/src/smart-contracts/use-cases/dex/index.js +73 -0
- package/dist/src/smart-contracts/use-cases/dex/index.js.map +1 -0
- package/dist/src/smart-contracts/use-cases/dex/transactions/add-liquidity.d.ts +34 -0
- package/dist/src/smart-contracts/use-cases/dex/transactions/add-liquidity.d.ts.map +1 -0
- package/dist/src/smart-contracts/use-cases/dex/transactions/add-liquidity.js +68 -0
- package/dist/src/smart-contracts/use-cases/dex/transactions/add-liquidity.js.map +1 -0
- package/dist/src/smart-contracts/use-cases/dex/transactions/create-pool.d.ts +35 -0
- package/dist/src/smart-contracts/use-cases/dex/transactions/create-pool.d.ts.map +1 -0
- package/dist/src/smart-contracts/use-cases/dex/transactions/create-pool.js +69 -0
- package/dist/src/smart-contracts/use-cases/dex/transactions/create-pool.js.map +1 -0
- package/dist/src/smart-contracts/use-cases/dex/transactions/index.d.ts +11 -0
- package/dist/src/smart-contracts/use-cases/dex/transactions/index.d.ts.map +1 -0
- package/dist/src/smart-contracts/use-cases/dex/transactions/index.js +11 -0
- package/dist/src/smart-contracts/use-cases/dex/transactions/index.js.map +1 -0
- package/dist/src/smart-contracts/use-cases/dex/transactions/remove-liquidity.d.ts +40 -0
- package/dist/src/smart-contracts/use-cases/dex/transactions/remove-liquidity.d.ts.map +1 -0
- package/dist/src/smart-contracts/use-cases/dex/transactions/remove-liquidity.js +76 -0
- package/dist/src/smart-contracts/use-cases/dex/transactions/remove-liquidity.js.map +1 -0
- package/dist/src/smart-contracts/use-cases/dex/transactions/swap.d.ts +38 -0
- package/dist/src/smart-contracts/use-cases/dex/transactions/swap.d.ts.map +1 -0
- package/dist/src/smart-contracts/use-cases/dex/transactions/swap.js +70 -0
- package/dist/src/smart-contracts/use-cases/dex/transactions/swap.js.map +1 -0
- package/dist/src/smart-contracts/use-cases/dex/transactions/unlock-liquidity.d.ts +37 -0
- package/dist/src/smart-contracts/use-cases/dex/transactions/unlock-liquidity.d.ts.map +1 -0
- package/dist/src/smart-contracts/use-cases/dex/transactions/unlock-liquidity.js +60 -0
- package/dist/src/smart-contracts/use-cases/dex/transactions/unlock-liquidity.js.map +1 -0
- package/dist/src/smart-contracts/use-cases/dex/types.d.ts +130 -0
- package/dist/src/smart-contracts/use-cases/dex/types.d.ts.map +1 -0
- package/dist/src/smart-contracts/use-cases/dex/types.js +11 -0
- package/dist/src/smart-contracts/use-cases/dex/types.js.map +1 -0
- package/dist/src/smart-contracts/use-cases/dex/utils.d.ts +52 -0
- package/dist/src/smart-contracts/use-cases/dex/utils.d.ts.map +1 -0
- package/dist/src/smart-contracts/use-cases/dex/utils.js +79 -0
- package/dist/src/smart-contracts/use-cases/dex/utils.js.map +1 -0
- package/dist/src/smart-contracts/use-cases/index.d.ts +35 -0
- package/dist/src/smart-contracts/use-cases/index.d.ts.map +1 -0
- package/dist/src/smart-contracts/use-cases/index.js +35 -0
- package/dist/src/smart-contracts/use-cases/index.js.map +1 -0
- package/dist/src/smart-contracts/use-cases/staking/index.d.ts +67 -0
- package/dist/src/smart-contracts/use-cases/staking/index.d.ts.map +1 -0
- package/dist/src/smart-contracts/use-cases/staking/index.js +84 -0
- package/dist/src/smart-contracts/use-cases/staking/index.js.map +1 -0
- package/dist/src/smart-contracts/use-cases/staking/transactions/index.d.ts +12 -0
- package/dist/src/smart-contracts/use-cases/staking/transactions/index.d.ts.map +1 -0
- package/dist/src/smart-contracts/use-cases/staking/transactions/index.js +12 -0
- package/dist/src/smart-contracts/use-cases/staking/transactions/index.js.map +1 -0
- package/dist/src/smart-contracts/use-cases/staking/transactions/instant-stake.d.ts +36 -0
- package/dist/src/smart-contracts/use-cases/staking/transactions/instant-stake.d.ts.map +1 -0
- package/dist/src/smart-contracts/use-cases/staking/transactions/instant-stake.js +57 -0
- package/dist/src/smart-contracts/use-cases/staking/transactions/instant-stake.js.map +1 -0
- package/dist/src/smart-contracts/use-cases/staking/transactions/release-instant.d.ts +33 -0
- package/dist/src/smart-contracts/use-cases/staking/transactions/release-instant.d.ts.map +1 -0
- package/dist/src/smart-contracts/use-cases/staking/transactions/release-instant.js +49 -0
- package/dist/src/smart-contracts/use-cases/staking/transactions/release-instant.js.map +1 -0
- package/dist/src/smart-contracts/use-cases/staking/transactions/release-liquid-stake.d.ts +33 -0
- package/dist/src/smart-contracts/use-cases/staking/transactions/release-liquid-stake.d.ts.map +1 -0
- package/dist/src/smart-contracts/use-cases/staking/transactions/release-liquid-stake.js +49 -0
- package/dist/src/smart-contracts/use-cases/staking/transactions/release-liquid-stake.js.map +1 -0
- package/dist/src/smart-contracts/use-cases/staking/transactions/stake.d.ts +36 -0
- package/dist/src/smart-contracts/use-cases/staking/transactions/stake.d.ts.map +1 -0
- package/dist/src/smart-contracts/use-cases/staking/transactions/stake.js +59 -0
- package/dist/src/smart-contracts/use-cases/staking/transactions/stake.js.map +1 -0
- package/dist/src/smart-contracts/use-cases/staking/transactions/update-instant-wallet.d.ts +36 -0
- package/dist/src/smart-contracts/use-cases/staking/transactions/update-instant-wallet.d.ts.map +1 -0
- package/dist/src/smart-contracts/use-cases/staking/transactions/update-instant-wallet.js +57 -0
- package/dist/src/smart-contracts/use-cases/staking/transactions/update-instant-wallet.js.map +1 -0
- package/dist/src/smart-contracts/use-cases/staking/transactions/update-wallet.d.ts +36 -0
- package/dist/src/smart-contracts/use-cases/staking/transactions/update-wallet.d.ts.map +1 -0
- package/dist/src/smart-contracts/use-cases/staking/transactions/update-wallet.js +57 -0
- package/dist/src/smart-contracts/use-cases/staking/transactions/update-wallet.js.map +1 -0
- package/dist/src/smart-contracts/use-cases/staking/types.d.ts +76 -0
- package/dist/src/smart-contracts/use-cases/staking/types.d.ts.map +1 -0
- package/dist/src/smart-contracts/use-cases/staking/types.js +10 -0
- package/dist/src/smart-contracts/use-cases/staking/types.js.map +1 -0
- package/dist/src/smart-contracts/use-cases/staking/utils.d.ts +27 -0
- package/dist/src/smart-contracts/use-cases/staking/utils.d.ts.map +1 -0
- package/dist/src/smart-contracts/use-cases/staking/utils.js +44 -0
- package/dist/src/smart-contracts/use-cases/staking/utils.js.map +1 -0
- package/dist/src/smart-contracts/use-cases/third-party/vision-dynamics/smart-swap/index.d.ts +26 -0
- package/dist/src/smart-contracts/use-cases/third-party/vision-dynamics/smart-swap/index.d.ts.map +1 -0
- package/dist/src/smart-contracts/use-cases/third-party/vision-dynamics/smart-swap/index.js +107 -0
- package/dist/src/smart-contracts/use-cases/third-party/vision-dynamics/smart-swap/index.js.map +1 -0
- package/dist/src/smart-contracts/use-cases/third-party/vision-dynamics/smart-swap/resolve-indexer.d.ts +18 -0
- package/dist/src/smart-contracts/use-cases/third-party/vision-dynamics/smart-swap/resolve-indexer.d.ts.map +1 -0
- package/dist/src/smart-contracts/use-cases/third-party/vision-dynamics/smart-swap/resolve-indexer.js +37 -0
- package/dist/src/smart-contracts/use-cases/third-party/vision-dynamics/smart-swap/resolve-indexer.js.map +1 -0
- package/dist/src/smart-contracts/use-cases/third-party/vision-dynamics/smart-swap/types.d.ts +126 -0
- package/dist/src/smart-contracts/use-cases/third-party/vision-dynamics/smart-swap/types.d.ts.map +1 -0
- package/dist/src/smart-contracts/use-cases/third-party/vision-dynamics/smart-swap/types.js +10 -0
- package/dist/src/smart-contracts/use-cases/third-party/vision-dynamics/smart-swap/types.js.map +1 -0
- package/dist/src/types/index.d.ts +240 -0
- package/dist/src/types/index.d.ts.map +1 -0
- package/dist/src/types/index.js +110 -0
- package/dist/src/types/index.js.map +1 -0
- package/dist/src/validator-ops/index.d.ts +2 -0
- package/dist/src/validator-ops/index.d.ts.map +1 -0
- package/dist/src/validator-ops/index.js +2 -0
- package/dist/src/validator-ops/index.js.map +1 -0
- package/dist/src/validator-ops/transaction.d.ts +312 -0
- package/dist/src/validator-ops/transaction.d.ts.map +1 -0
- package/dist/src/validator-ops/transaction.js +416 -0
- package/dist/src/validator-ops/transaction.js.map +1 -0
- package/dist/src/vote/index.d.ts +5 -0
- package/dist/src/vote/index.d.ts.map +1 -0
- package/dist/src/vote/index.js +5 -0
- package/dist/src/vote/index.js.map +1 -0
- package/dist/src/vote/transaction.d.ts +70 -0
- package/dist/src/vote/transaction.d.ts.map +1 -0
- package/dist/src/vote/transaction.js +140 -0
- package/dist/src/vote/transaction.js.map +1 -0
- package/dist/src/wallet-creation/constants.d.ts +58 -0
- package/dist/src/wallet-creation/constants.d.ts.map +1 -0
- package/dist/src/wallet-creation/constants.js +113 -0
- package/dist/src/wallet-creation/constants.js.map +1 -0
- package/dist/src/wallet-creation/crypto-core.d.ts +178 -0
- package/dist/src/wallet-creation/crypto-core.d.ts.map +1 -0
- package/dist/src/wallet-creation/crypto-core.js +516 -0
- package/dist/src/wallet-creation/crypto-core.js.map +1 -0
- package/dist/src/wallet-creation/errors.d.ts +58 -0
- package/dist/src/wallet-creation/errors.d.ts.map +1 -0
- package/dist/src/wallet-creation/errors.js +89 -0
- package/dist/src/wallet-creation/errors.js.map +1 -0
- package/dist/src/wallet-creation/hash-utils.d.ts +38 -0
- package/dist/src/wallet-creation/hash-utils.d.ts.map +1 -0
- package/dist/src/wallet-creation/hash-utils.js +147 -0
- package/dist/src/wallet-creation/hash-utils.js.map +1 -0
- package/dist/src/wallet-creation/hd-utils.d.ts +45 -0
- package/dist/src/wallet-creation/hd-utils.d.ts.map +1 -0
- package/dist/src/wallet-creation/hd-utils.js +110 -0
- package/dist/src/wallet-creation/hd-utils.js.map +1 -0
- package/dist/src/wallet-creation/index.d.ts +11 -0
- package/dist/src/wallet-creation/index.d.ts.map +1 -0
- package/dist/src/wallet-creation/index.js +21 -0
- package/dist/src/wallet-creation/index.js.map +1 -0
- package/dist/src/wallet-creation/shared.d.ts +60 -0
- package/dist/src/wallet-creation/shared.d.ts.map +1 -0
- package/dist/src/wallet-creation/shared.js +127 -0
- package/dist/src/wallet-creation/shared.js.map +1 -0
- package/dist/src/wallet-creation/wallet-factory.d.ts +107 -0
- package/dist/src/wallet-creation/wallet-factory.d.ts.map +1 -0
- package/dist/src/wallet-creation/wallet-factory.js +298 -0
- package/dist/src/wallet-creation/wallet-factory.js.map +1 -0
- package/dist/wallet.d.ts +17 -0
- package/dist/wallet.d.ts.map +1 -0
- package/dist/wallet.js +17 -0
- package/dist/wallet.js.map +1 -0
- package/package.json +129 -0
|
@@ -0,0 +1,293 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared Transaction Utilities for Kalvora JS SDK
|
|
3
|
+
* Common utilities for transaction operations (transfer, mint, etc.)
|
|
4
|
+
*/
|
|
5
|
+
// Import protobuf enums directly
|
|
6
|
+
import Decimal from 'decimal.js';
|
|
7
|
+
import { TRANSACTION_TYPE, CONTRACT_FEE_TYPE, TXN_STATUS, GOVERNANCE_TYPE, CONTRACT_TYPE, LANGUAGE, PROPOSAL_PERIOD, VARIABLE_TYPE } from '../../../proto/generated/txn_pb.js';
|
|
8
|
+
import { toDecimal } from './amount-utils.js';
|
|
9
|
+
// Re-export for external use
|
|
10
|
+
export { TRANSACTION_TYPE, CONTRACT_FEE_TYPE, TXN_STATUS, GOVERNANCE_TYPE, CONTRACT_TYPE, LANGUAGE, PROPOSAL_PERIOD, VARIABLE_TYPE };
|
|
11
|
+
/**
|
|
12
|
+
* Transaction validation utilities
|
|
13
|
+
*/
|
|
14
|
+
export class TransactionValidator {
|
|
15
|
+
/**
|
|
16
|
+
* Validate transaction amount
|
|
17
|
+
* @param amount - Transaction amount
|
|
18
|
+
* @param options - Validation options
|
|
19
|
+
* @returns Validation result
|
|
20
|
+
*/
|
|
21
|
+
static validateAmount(amount, options = {}) {
|
|
22
|
+
const { minAmount = 0, maxAmount = Number.MAX_SAFE_INTEGER, decimals = 18 } = options;
|
|
23
|
+
// Convert to Decimal for precise comparison
|
|
24
|
+
const decimalAmount = typeof amount === 'string' ? toDecimal(amount) : new Decimal(amount);
|
|
25
|
+
if (decimalAmount.isNaN()) {
|
|
26
|
+
return { valid: false, error: 'Amount must be a valid number' };
|
|
27
|
+
}
|
|
28
|
+
if (decimalAmount.lte(0)) {
|
|
29
|
+
return { valid: false, error: 'Amount must be greater than zero' };
|
|
30
|
+
}
|
|
31
|
+
if (decimalAmount.lt(minAmount)) {
|
|
32
|
+
return { valid: false, error: `Amount must be at least ${minAmount}` };
|
|
33
|
+
}
|
|
34
|
+
if (decimalAmount.gt(maxAmount)) {
|
|
35
|
+
return { valid: false, error: `Amount must not exceed ${maxAmount}` };
|
|
36
|
+
}
|
|
37
|
+
// Check decimal precision
|
|
38
|
+
const decimalPlaces = decimalAmount.decimalPlaces();
|
|
39
|
+
if (decimalPlaces > decimals) {
|
|
40
|
+
return { valid: false, error: `Amount cannot have more than ${decimals} decimal places` };
|
|
41
|
+
}
|
|
42
|
+
return { valid: true, amount: decimalAmount.toNumber() };
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Validate transaction memo/note
|
|
46
|
+
* @param memo - Transaction memo
|
|
47
|
+
* @param options - Validation options
|
|
48
|
+
* @returns Validation result
|
|
49
|
+
*/
|
|
50
|
+
static validateMemo(memo, options = {}) {
|
|
51
|
+
const { maxLength = 256, allowEmpty = true } = options;
|
|
52
|
+
if (!memo && allowEmpty) {
|
|
53
|
+
return { valid: true };
|
|
54
|
+
}
|
|
55
|
+
if (!memo && !allowEmpty) {
|
|
56
|
+
return { valid: false, error: 'Memo is required' };
|
|
57
|
+
}
|
|
58
|
+
if (typeof memo !== 'string') {
|
|
59
|
+
return { valid: false, error: 'Memo must be a string' };
|
|
60
|
+
}
|
|
61
|
+
if (memo.length > maxLength) {
|
|
62
|
+
return { valid: false, error: `Memo cannot exceed ${maxLength} characters` };
|
|
63
|
+
}
|
|
64
|
+
return { valid: true, memo: memo.trim() };
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Validate transaction fee
|
|
68
|
+
* @param fee - Transaction fee
|
|
69
|
+
* @param options - Validation options
|
|
70
|
+
* @returns Validation result
|
|
71
|
+
*/
|
|
72
|
+
static validateFee(fee, options = {}) {
|
|
73
|
+
const { minFee = 0, maxFee = Number.MAX_SAFE_INTEGER } = options;
|
|
74
|
+
const decimalFee = typeof fee === 'string' ? toDecimal(fee) : new Decimal(fee);
|
|
75
|
+
if (decimalFee.isNaN()) {
|
|
76
|
+
return { valid: false, error: 'Fee must be a valid number' };
|
|
77
|
+
}
|
|
78
|
+
if (decimalFee.lt(minFee)) {
|
|
79
|
+
return { valid: false, error: `Fee must be at least ${minFee}` };
|
|
80
|
+
}
|
|
81
|
+
if (decimalFee.gt(maxFee)) {
|
|
82
|
+
return { valid: false, error: `Fee must not exceed ${maxFee}` };
|
|
83
|
+
}
|
|
84
|
+
return { valid: true, fee: decimalFee.toNumber() };
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Transaction formatting utilities
|
|
89
|
+
*/
|
|
90
|
+
export class TransactionFormatter {
|
|
91
|
+
/**
|
|
92
|
+
* Format amount with proper decimal places
|
|
93
|
+
* @param amount - Amount to format
|
|
94
|
+
* @param options - Formatting options
|
|
95
|
+
* @returns Formatted amount
|
|
96
|
+
*/
|
|
97
|
+
static formatAmount(amount, options = {}) {
|
|
98
|
+
const { decimals = 18, showSymbol = false, symbol = 'KALV' } = options;
|
|
99
|
+
const decimalAmount = typeof amount === 'string' ? toDecimal(amount) : new Decimal(amount);
|
|
100
|
+
if (decimalAmount.isNaN()) {
|
|
101
|
+
return '0';
|
|
102
|
+
}
|
|
103
|
+
const formatted = decimalAmount.toFixed(decimals).replace(/\.?0+$/, '');
|
|
104
|
+
return showSymbol ? `${formatted} ${symbol}` : formatted;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Format transaction ID for display
|
|
108
|
+
* @param txId - Transaction ID
|
|
109
|
+
* @param options - Formatting options
|
|
110
|
+
* @returns Formatted transaction ID
|
|
111
|
+
*/
|
|
112
|
+
static formatTransactionId(txId, options = {}) {
|
|
113
|
+
const { showFull = false, prefixLength = 8, suffixLength = 8 } = options;
|
|
114
|
+
if (!txId || typeof txId !== 'string') {
|
|
115
|
+
return 'Unknown';
|
|
116
|
+
}
|
|
117
|
+
if (showFull || txId.length <= prefixLength + suffixLength) {
|
|
118
|
+
return txId;
|
|
119
|
+
}
|
|
120
|
+
return `${txId.substring(0, prefixLength)}...${txId.substring(txId.length - suffixLength)}`;
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Format timestamp for display
|
|
124
|
+
* @param timestamp - Timestamp to format
|
|
125
|
+
* @param options - Formatting options
|
|
126
|
+
* @returns Formatted timestamp
|
|
127
|
+
*/
|
|
128
|
+
static formatTimestamp(timestamp, options = {}) {
|
|
129
|
+
const { format = 'relative', locale = 'en-US' } = options;
|
|
130
|
+
const date = timestamp instanceof Date ? timestamp : new Date(timestamp);
|
|
131
|
+
if (isNaN(date.getTime())) {
|
|
132
|
+
return 'Invalid date';
|
|
133
|
+
}
|
|
134
|
+
switch (format) {
|
|
135
|
+
case 'relative':
|
|
136
|
+
return this.getRelativeTime(date);
|
|
137
|
+
case 'iso':
|
|
138
|
+
return date.toISOString();
|
|
139
|
+
case 'local':
|
|
140
|
+
return date.toLocaleString(locale);
|
|
141
|
+
default:
|
|
142
|
+
return date.toString();
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* Get relative time string
|
|
147
|
+
* @param date - Date to compare
|
|
148
|
+
* @returns Relative time string
|
|
149
|
+
*/
|
|
150
|
+
static getRelativeTime(date) {
|
|
151
|
+
const now = new Date();
|
|
152
|
+
const diffMs = now.getTime() - date.getTime();
|
|
153
|
+
const diffSeconds = Math.floor(diffMs / 1000);
|
|
154
|
+
const diffMinutes = Math.floor(diffSeconds / 60);
|
|
155
|
+
const diffHours = Math.floor(diffMinutes / 60);
|
|
156
|
+
const diffDays = Math.floor(diffHours / 24);
|
|
157
|
+
if (diffSeconds < 60) {
|
|
158
|
+
return 'just now';
|
|
159
|
+
}
|
|
160
|
+
else if (diffMinutes < 60) {
|
|
161
|
+
return `${diffMinutes} minute${diffMinutes !== 1 ? 's' : ''} ago`;
|
|
162
|
+
}
|
|
163
|
+
else if (diffHours < 24) {
|
|
164
|
+
return `${diffHours} hour${diffHours !== 1 ? 's' : ''} ago`;
|
|
165
|
+
}
|
|
166
|
+
else if (diffDays < 7) {
|
|
167
|
+
return `${diffDays} day${diffDays !== 1 ? 's' : ''} ago`;
|
|
168
|
+
}
|
|
169
|
+
else {
|
|
170
|
+
return date.toLocaleDateString();
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* Transaction builder utilities
|
|
176
|
+
*/
|
|
177
|
+
export class TransactionBuilder {
|
|
178
|
+
/**
|
|
179
|
+
* Build base transaction object
|
|
180
|
+
* @param params - Transaction parameters
|
|
181
|
+
* @returns Base transaction object
|
|
182
|
+
*/
|
|
183
|
+
static buildBaseTransaction(params) {
|
|
184
|
+
const { from, to, amount, memo = '', fee = 0, type = TRANSACTION_TYPE.COIN_TYPE } = params;
|
|
185
|
+
return {
|
|
186
|
+
id: this.generateTransactionId(),
|
|
187
|
+
type: String(type),
|
|
188
|
+
from,
|
|
189
|
+
to,
|
|
190
|
+
amount,
|
|
191
|
+
memo,
|
|
192
|
+
fee,
|
|
193
|
+
status: String(TXN_STATUS.OK),
|
|
194
|
+
timestamp: Date.now(),
|
|
195
|
+
createdAt: new Date().toISOString()
|
|
196
|
+
};
|
|
197
|
+
}
|
|
198
|
+
/**
|
|
199
|
+
* Generate unique transaction ID
|
|
200
|
+
* @returns Transaction ID
|
|
201
|
+
*/
|
|
202
|
+
static generateTransactionId() {
|
|
203
|
+
const timestamp = Date.now().toString(36);
|
|
204
|
+
const random = Math.random().toString(36).substring(2);
|
|
205
|
+
return `tx_${timestamp}_${random}`;
|
|
206
|
+
}
|
|
207
|
+
/**
|
|
208
|
+
* Add signature to transaction
|
|
209
|
+
* @param transaction - Transaction object
|
|
210
|
+
* @param signature - Transaction signature
|
|
211
|
+
* @returns Transaction with signature
|
|
212
|
+
*/
|
|
213
|
+
static addSignature(transaction, signature) {
|
|
214
|
+
return {
|
|
215
|
+
...transaction,
|
|
216
|
+
signature,
|
|
217
|
+
signedAt: new Date().toISOString()
|
|
218
|
+
};
|
|
219
|
+
}
|
|
220
|
+
/**
|
|
221
|
+
* Update transaction status
|
|
222
|
+
* @param transaction - Transaction object
|
|
223
|
+
* @param status - New status
|
|
224
|
+
* @param metadata - Additional metadata
|
|
225
|
+
* @returns Updated transaction
|
|
226
|
+
*/
|
|
227
|
+
static updateStatus(transaction, status, metadata = {}) {
|
|
228
|
+
return {
|
|
229
|
+
...transaction,
|
|
230
|
+
status,
|
|
231
|
+
updatedAt: new Date().toISOString(),
|
|
232
|
+
...metadata
|
|
233
|
+
};
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
/**
|
|
237
|
+
* Transaction serialization utilities
|
|
238
|
+
*/
|
|
239
|
+
export class TransactionSerializer {
|
|
240
|
+
/**
|
|
241
|
+
* Serialize transaction for network transmission
|
|
242
|
+
* @param transaction - Transaction object
|
|
243
|
+
* @param options - Serialization options
|
|
244
|
+
* @returns Serialized transaction
|
|
245
|
+
*/
|
|
246
|
+
static serialize(transaction, options = {}) {
|
|
247
|
+
const { format = 'json', includeSignature = true } = options;
|
|
248
|
+
const serializable = { ...transaction };
|
|
249
|
+
if (!includeSignature) {
|
|
250
|
+
delete serializable.signature;
|
|
251
|
+
}
|
|
252
|
+
switch (format) {
|
|
253
|
+
case 'json':
|
|
254
|
+
return JSON.stringify(serializable);
|
|
255
|
+
case 'base64':
|
|
256
|
+
return Buffer.from(JSON.stringify(serializable)).toString('base64');
|
|
257
|
+
default:
|
|
258
|
+
throw new Error(`Unsupported serialization format: ${format}`);
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
/**
|
|
262
|
+
* Deserialize transaction from network data
|
|
263
|
+
* @param data - Serialized transaction data
|
|
264
|
+
* @param options - Deserialization options
|
|
265
|
+
* @returns Deserialized transaction
|
|
266
|
+
*/
|
|
267
|
+
static deserialize(data, options = {}) {
|
|
268
|
+
const { format = 'json' } = options;
|
|
269
|
+
let parsed;
|
|
270
|
+
switch (format) {
|
|
271
|
+
case 'json':
|
|
272
|
+
parsed = JSON.parse(data);
|
|
273
|
+
break;
|
|
274
|
+
case 'base64':
|
|
275
|
+
parsed = JSON.parse(Buffer.from(data, 'base64').toString());
|
|
276
|
+
break;
|
|
277
|
+
default:
|
|
278
|
+
throw new Error(`Unsupported deserialization format: ${format}`);
|
|
279
|
+
}
|
|
280
|
+
return parsed;
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
// Export all utilities (classes are already exported above)
|
|
284
|
+
export default {
|
|
285
|
+
TXN_STATUS,
|
|
286
|
+
TRANSACTION_TYPE,
|
|
287
|
+
CONTRACT_FEE_TYPE,
|
|
288
|
+
TransactionValidator,
|
|
289
|
+
TransactionFormatter,
|
|
290
|
+
TransactionBuilder,
|
|
291
|
+
TransactionSerializer
|
|
292
|
+
};
|
|
293
|
+
//# sourceMappingURL=transaction-utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transaction-utils.js","sourceRoot":"","sources":["../../../../src/shared/utils/transaction-utils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,iCAAiC;AACjC,OAAO,OAAO,MAAM,YAAY,CAAC;AAEjC,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EACjB,UAAU,EACV,eAAe,EACf,aAAa,EACb,QAAQ,EACR,eAAe,EACf,aAAa,EACd,MAAM,oCAAoC,CAAC;AAE5C,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAE9C,6BAA6B;AAC7B,OAAO,EAC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AAC,CAAC;QACnE,CAAC;QAED,OAAO,MAAyB,CAAC;IACnC,CAAC;CACF;AAED,4DAA4D;AAE5D,eAAe;IACb,UAAU;IACV,gBAAgB;IAChB,iBAAiB;IACjB,oBAAoB;IACpB,oBAAoB;IACpB,kBAAkB;IAClB,qBAAqB;CACtB,CAAC"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Unified Amount Conversion Utilities
|
|
3
|
+
*
|
|
4
|
+
* Single smart function that handles all amount conversion scenarios:
|
|
5
|
+
* 1. Uses cached token info if available (most efficient)
|
|
6
|
+
* 2. Falls back to hardcoded cache if token exists there
|
|
7
|
+
* 3. Defaults to 1:1 conversion with warning for unknown tokens
|
|
8
|
+
*/
|
|
9
|
+
import type { AmountInput } from '../../types/index.js';
|
|
10
|
+
import { type TokenInfo } from './token-info.js';
|
|
11
|
+
/**
|
|
12
|
+
* Unified function to convert user-friendly amount to smallest units
|
|
13
|
+
*
|
|
14
|
+
* This smart function tries multiple approaches in order of preference:
|
|
15
|
+
* 1. Uses provided denomination if available (most efficient for transaction flows)
|
|
16
|
+
* 2. Falls back to hardcoded token cache
|
|
17
|
+
* 3. Defaults to 1:1 conversion with warning for unknown tokens
|
|
18
|
+
*
|
|
19
|
+
* @param amount - Amount to convert
|
|
20
|
+
* @param contractId - Contract ID for the token
|
|
21
|
+
* @param options - Optional configuration
|
|
22
|
+
* @param options.denomination - Pre-fetched denomination: smallest units per whole token, e.g. `'1000000000'`
|
|
23
|
+
* @param options.tokenInfoMap - Pre-fetched token info map (efficient when available)
|
|
24
|
+
* @returns string - Amount in smallest units
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```typescript
|
|
28
|
+
* import { toSmallestUnits, KALVORA_NATIVE_TOKEN } from 'kalvora.js';
|
|
29
|
+
*
|
|
30
|
+
* // With denomination (most efficient for transaction code)
|
|
31
|
+
* const amount = toSmallestUnits('1.5', KALVORA_NATIVE_TOKEN, { denomination: '1000000000' }); // '1500000000'
|
|
32
|
+
*
|
|
33
|
+
* // With token info map
|
|
34
|
+
* const amount = toSmallestUnits('1.5', KALVORA_NATIVE_TOKEN, { tokenInfoMap });
|
|
35
|
+
*
|
|
36
|
+
* // Simple case (falls back to cache or 1:1)
|
|
37
|
+
* const amount = toSmallestUnits('1.5', KALVORA_NATIVE_TOKEN);
|
|
38
|
+
* ```
|
|
39
|
+
*/
|
|
40
|
+
export declare function toSmallestUnits(amount: AmountInput, contractId: string, options?: {
|
|
41
|
+
denomination?: string;
|
|
42
|
+
tokenInfoMap?: Map<string, TokenInfo>;
|
|
43
|
+
}): string;
|
|
44
|
+
/**
|
|
45
|
+
* Convert smallest units to user-friendly amount using the same unified approach
|
|
46
|
+
*
|
|
47
|
+
* @param amount - Amount in smallest units
|
|
48
|
+
* @param contractId - Contract ID for the token
|
|
49
|
+
* @param options - Optional configuration
|
|
50
|
+
* @param options.denomination - Pre-fetched denomination: smallest units per whole token, e.g. `'1000000000'`
|
|
51
|
+
* @param options.tokenInfoMap - Pre-fetched token info map (efficient when available)
|
|
52
|
+
* @returns string - User-friendly amount
|
|
53
|
+
*
|
|
54
|
+
* @example
|
|
55
|
+
* ```typescript
|
|
56
|
+
* import { fromSmallestUnits } from 'kalvora.js';
|
|
57
|
+
*
|
|
58
|
+
* const userAmount = fromSmallestUnits('1500000000', 'KALXvxhUMJERCse4e6b2jeXFkcqqpiUByQQckvPZm4szmF3Ao');
|
|
59
|
+
* ```
|
|
60
|
+
*/
|
|
61
|
+
export declare function fromSmallestUnits(amount: AmountInput, contractId: string, options?: {
|
|
62
|
+
denomination?: string;
|
|
63
|
+
tokenInfoMap?: Map<string, TokenInfo>;
|
|
64
|
+
}): string;
|
|
65
|
+
//# sourceMappingURL=unified-amount-conversion.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unified-amount-conversion.d.ts","sourceRoot":"","sources":["../../../../src/shared/utils/unified-amount-conversion.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAIxD,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,iBAAiB,CAAC;AA0BjD;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAgB,eAAe,CAC7B,MAAM,EAAE,WAAW,EACnB,UAAU,EAAE,MAAM,EAClB,OAAO,GAAE;IACP,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;CAClC,GACL,MAAM,CAoCR;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,WAAW,EACnB,UAAU,EAAE,MAAM,EAClB,OAAO,GAAE;IACP,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;CAClC,GACL,MAAM,CAgCR"}
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Unified Amount Conversion Utilities
|
|
3
|
+
*
|
|
4
|
+
* Single smart function that handles all amount conversion scenarios:
|
|
5
|
+
* 1. Uses cached token info if available (most efficient)
|
|
6
|
+
* 2. Falls back to hardcoded cache if token exists there
|
|
7
|
+
* 3. Defaults to 1:1 conversion with warning for unknown tokens
|
|
8
|
+
*/
|
|
9
|
+
import { Decimal } from 'decimal.js';
|
|
10
|
+
import { getDecimalPlacesFromDenomination } from '../fee-calculators/denomination-fallback.js';
|
|
11
|
+
import { getTokenDecimals } from './token-config.js';
|
|
12
|
+
/**
|
|
13
|
+
* Convert various amount types to Decimal for exact arithmetic
|
|
14
|
+
*/
|
|
15
|
+
function toDecimal(amount) {
|
|
16
|
+
if (amount instanceof Decimal) {
|
|
17
|
+
return amount;
|
|
18
|
+
}
|
|
19
|
+
if (typeof amount === 'bigint') {
|
|
20
|
+
return new Decimal(amount.toString());
|
|
21
|
+
}
|
|
22
|
+
if (typeof amount === 'string') {
|
|
23
|
+
// Validate it's a valid number string
|
|
24
|
+
if (!/^-?\d+(\.\d+)?$/.test(amount)) {
|
|
25
|
+
throw new Error(`Invalid amount string: ${amount}`);
|
|
26
|
+
}
|
|
27
|
+
return new Decimal(amount);
|
|
28
|
+
}
|
|
29
|
+
if (typeof amount === 'number') {
|
|
30
|
+
// Convert number to string first to avoid floating point issues
|
|
31
|
+
return new Decimal(amount.toString());
|
|
32
|
+
}
|
|
33
|
+
throw new Error(`Invalid amount type: ${typeof amount}`);
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Unified function to convert user-friendly amount to smallest units
|
|
37
|
+
*
|
|
38
|
+
* This smart function tries multiple approaches in order of preference:
|
|
39
|
+
* 1. Uses provided denomination if available (most efficient for transaction flows)
|
|
40
|
+
* 2. Falls back to hardcoded token cache
|
|
41
|
+
* 3. Defaults to 1:1 conversion with warning for unknown tokens
|
|
42
|
+
*
|
|
43
|
+
* @param amount - Amount to convert
|
|
44
|
+
* @param contractId - Contract ID for the token
|
|
45
|
+
* @param options - Optional configuration
|
|
46
|
+
* @param options.denomination - Pre-fetched denomination: smallest units per whole token, e.g. `'1000000000'`
|
|
47
|
+
* @param options.tokenInfoMap - Pre-fetched token info map (efficient when available)
|
|
48
|
+
* @returns string - Amount in smallest units
|
|
49
|
+
*
|
|
50
|
+
* @example
|
|
51
|
+
* ```typescript
|
|
52
|
+
* import { toSmallestUnits, KALVORA_NATIVE_TOKEN } from 'kalvora.js';
|
|
53
|
+
*
|
|
54
|
+
* // With denomination (most efficient for transaction code)
|
|
55
|
+
* const amount = toSmallestUnits('1.5', KALVORA_NATIVE_TOKEN, { denomination: '1000000000' }); // '1500000000'
|
|
56
|
+
*
|
|
57
|
+
* // With token info map
|
|
58
|
+
* const amount = toSmallestUnits('1.5', KALVORA_NATIVE_TOKEN, { tokenInfoMap });
|
|
59
|
+
*
|
|
60
|
+
* // Simple case (falls back to cache or 1:1)
|
|
61
|
+
* const amount = toSmallestUnits('1.5', KALVORA_NATIVE_TOKEN);
|
|
62
|
+
* ```
|
|
63
|
+
*/
|
|
64
|
+
export function toSmallestUnits(amount, contractId, options = {}) {
|
|
65
|
+
if (amount === undefined || amount === null || amount === '') {
|
|
66
|
+
return '';
|
|
67
|
+
}
|
|
68
|
+
const { denomination, tokenInfoMap } = options;
|
|
69
|
+
const decimalAmount = toDecimal(amount);
|
|
70
|
+
let decimals;
|
|
71
|
+
// Approach 1: Use provided denomination (most efficient for transaction flows)
|
|
72
|
+
if (denomination) {
|
|
73
|
+
decimals = getDecimalPlacesFromDenomination(denomination);
|
|
74
|
+
}
|
|
75
|
+
// Approach 2: Use token info map if available
|
|
76
|
+
else if (tokenInfoMap && tokenInfoMap.has(contractId)) {
|
|
77
|
+
const tokenInfo = tokenInfoMap.get(contractId);
|
|
78
|
+
if (tokenInfo && tokenInfo.denomination) {
|
|
79
|
+
decimals = getDecimalPlacesFromDenomination(tokenInfo.denomination);
|
|
80
|
+
}
|
|
81
|
+
else {
|
|
82
|
+
throw new Error(`Token info found but missing denomination for ${contractId}`);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
// Approach 3: Fall back to hardcoded cache
|
|
86
|
+
else {
|
|
87
|
+
try {
|
|
88
|
+
decimals = getTokenDecimals(contractId);
|
|
89
|
+
}
|
|
90
|
+
catch {
|
|
91
|
+
throw new Error(`Token decimals not found for ${contractId}. Are you sure you are using a valid contract ID?`);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
const multiplier = new Decimal(10).pow(decimals);
|
|
95
|
+
const result = decimalAmount.mul(multiplier);
|
|
96
|
+
return result.floor().toString();
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Convert smallest units to user-friendly amount using the same unified approach
|
|
100
|
+
*
|
|
101
|
+
* @param amount - Amount in smallest units
|
|
102
|
+
* @param contractId - Contract ID for the token
|
|
103
|
+
* @param options - Optional configuration
|
|
104
|
+
* @param options.denomination - Pre-fetched denomination: smallest units per whole token, e.g. `'1000000000'`
|
|
105
|
+
* @param options.tokenInfoMap - Pre-fetched token info map (efficient when available)
|
|
106
|
+
* @returns string - User-friendly amount
|
|
107
|
+
*
|
|
108
|
+
* @example
|
|
109
|
+
* ```typescript
|
|
110
|
+
* import { fromSmallestUnits } from 'kalvora.js';
|
|
111
|
+
*
|
|
112
|
+
* const userAmount = fromSmallestUnits('1500000000', 'KALXvxhUMJERCse4e6b2jeXFkcqqpiUByQQckvPZm4szmF3Ao');
|
|
113
|
+
* ```
|
|
114
|
+
*/
|
|
115
|
+
export function fromSmallestUnits(amount, contractId, options = {}) {
|
|
116
|
+
if (amount === undefined || amount === null || amount === '') {
|
|
117
|
+
return '0';
|
|
118
|
+
}
|
|
119
|
+
const { denomination, tokenInfoMap } = options;
|
|
120
|
+
const decimalAmount = toDecimal(amount);
|
|
121
|
+
let decimals;
|
|
122
|
+
// Same unified approach as toSmallestUnits
|
|
123
|
+
if (denomination) {
|
|
124
|
+
decimals = getDecimalPlacesFromDenomination(denomination);
|
|
125
|
+
}
|
|
126
|
+
else if (tokenInfoMap && tokenInfoMap.has(contractId)) {
|
|
127
|
+
const tokenInfo = tokenInfoMap.get(contractId);
|
|
128
|
+
if (tokenInfo && tokenInfo.denomination) {
|
|
129
|
+
decimals = getDecimalPlacesFromDenomination(tokenInfo.denomination);
|
|
130
|
+
}
|
|
131
|
+
else {
|
|
132
|
+
throw new Error(`Token info found but missing denomination for ${contractId}`);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
else {
|
|
136
|
+
try {
|
|
137
|
+
decimals = getTokenDecimals(contractId);
|
|
138
|
+
}
|
|
139
|
+
catch {
|
|
140
|
+
decimals = 0;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
const divisor = new Decimal(10).pow(decimals);
|
|
144
|
+
return decimalAmount.div(divisor).toString();
|
|
145
|
+
}
|
|
146
|
+
//# sourceMappingURL=unified-amount-conversion.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unified-amount-conversion.js","sourceRoot":"","sources":["../../../../src/shared/utils/unified-amount-conversion.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAGrC,OAAO,EAAE,gCAAgC,EAAE,MAAM,6CAA6C,CAAC;AAE/F,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAGrD;;GAEG;AACH,SAAS,SAAS,CAAC,MAAmB;IACpC,IAAI,MAAM,YAAY,OAAO,EAAE,CAAC;QAC9B,OAAO,MAAM,CAAC;IAChB,CAAC;IACD,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE,CAAC;QAC/B,OAAO,IAAI,OAAO,CAAE,MAAiB,CAAC,QAAQ,EAAE,CAAC,CAAC;IACpD,CAAC;IACD,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE,CAAC;QAC/B,sCAAsC;QACtC,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC;YACpC,MAAM,IAAI,KAAK,CAAC,0BAA0B,MAAM,EAAE,CAAC,CAAC;QACtD,CAAC;QACD,OAAO,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;IAC7B,CAAC;IACD,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE,CAAC;QAC/B,gEAAgE;QAChE,OAAO,IAAI,OAAO,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAC;IACxC,CAAC;IACD,MAAM,IAAI,KAAK,CAAC,wBAAwB,OAAO,MAAM,EAAE,CAAC,CAAC;AAC3D,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,MAAM,UAAU,eAAe,CAC7B,MAAmB,EACnB,UAAkB,EAClB,UAGI,EAAE;IAEN,IAAI,MAAM,KAAK,SAAS,IAAI,MAAM,KAAK,IAAI,IA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
* with consistent error handling and type safety.
|
|
6
|
+
*/
|
|
7
|
+
import type { AmountInput, KeyType, HashType } from '../../types/index.js';
|
|
8
|
+
/**
|
|
9
|
+
* Validation result interface
|
|
10
|
+
*/
|
|
11
|
+
export interface ValidationResult<T = unknown> {
|
|
12
|
+
/** Whether the validation passed */
|
|
13
|
+
isValid: boolean;
|
|
14
|
+
/** Validated and potentially transformed value */
|
|
15
|
+
value?: T;
|
|
16
|
+
/** Error message if validation failed */
|
|
17
|
+
error?: string;
|
|
18
|
+
/** Additional validation details */
|
|
19
|
+
details?: Record<string, unknown> | undefined;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Validation options
|
|
23
|
+
*/
|
|
24
|
+
export interface ValidationOptions {
|
|
25
|
+
/** Whether to throw on validation failure */
|
|
26
|
+
throwOnError?: boolean;
|
|
27
|
+
/** Custom error context */
|
|
28
|
+
context?: string;
|
|
29
|
+
/** Additional validation details */
|
|
30
|
+
details?: Record<string, unknown>;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Comprehensive input validator
|
|
34
|
+
*/
|
|
35
|
+
export declare class InputValidator {
|
|
36
|
+
/** Validate a Kalvora mint ID. */
|
|
37
|
+
static validateContractId(contractId: unknown, options?: ValidationOptions): ValidationResult<string>;
|
|
38
|
+
/**
|
|
39
|
+
* Validate amount input
|
|
40
|
+
*/
|
|
41
|
+
static validateAmount(amount: unknown, options?: ValidationOptions & {
|
|
42
|
+
minAmount?: AmountInput;
|
|
43
|
+
maxAmount?: AmountInput;
|
|
44
|
+
allowZero?: boolean;
|
|
45
|
+
contractId?: string;
|
|
46
|
+
}): ValidationResult<AmountInput>;
|
|
47
|
+
/**
|
|
48
|
+
* Validate base58 address
|
|
49
|
+
*/
|
|
50
|
+
static validateBase58Address(address: unknown, options?: ValidationOptions): ValidationResult<string>;
|
|
51
|
+
/**
|
|
52
|
+
* Validate base58 key
|
|
53
|
+
*/
|
|
54
|
+
static validateBase58Key(key: unknown, options?: ValidationOptions): ValidationResult<string>;
|
|
55
|
+
/**
|
|
56
|
+
* Validate key type
|
|
57
|
+
*/
|
|
58
|
+
static validateKeyType(keyType: unknown, options?: ValidationOptions): ValidationResult<KeyType>;
|
|
59
|
+
/**
|
|
60
|
+
* Validate hash types array
|
|
61
|
+
*/
|
|
62
|
+
static validateHashTypes(hashTypes: unknown, options?: ValidationOptions): ValidationResult<HashType[]>;
|
|
63
|
+
/**
|
|
64
|
+
* Validate mnemonic phrase
|
|
65
|
+
*/
|
|
66
|
+
static validateMnemonic(mnemonic: unknown, options?: ValidationOptions): ValidationResult<string>;
|
|
67
|
+
/**
|
|
68
|
+
* Validate multiple inputs at once
|
|
69
|
+
*/
|
|
70
|
+
static validateMultiple(validations: Array<() => ValidationResult>, options?: ValidationOptions): ValidationResult<unknown[]>;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Convenience validation functions
|
|
74
|
+
*/
|
|
75
|
+
export declare const validateContractId: (contractId: unknown, options?: ValidationOptions) => ValidationResult<string>;
|
|
76
|
+
/**
|
|
77
|
+
* Simple boolean Kalvora mint-ID validation.
|
|
78
|
+
*
|
|
79
|
+
* @param contractId - The contract ID to validate
|
|
80
|
+
* @returns `true` if the contract ID format is valid, `false` otherwise
|
|
81
|
+
*
|
|
82
|
+
* @example
|
|
83
|
+
* ```typescript
|
|
84
|
+
* isValidContractId('KALXvxhUMJERCse4e6b2jeXFkcqqpiUByQQckvPZm4szmF3Ao'); // true
|
|
85
|
+
* isValidContractId('solana:EPjFWdd5...'); // true
|
|
86
|
+
* isValidContractId(''); // false
|
|
87
|
+
* ```
|
|
88
|
+
*
|
|
89
|
+
* @since 1.0.0
|
|
90
|
+
*/
|
|
91
|
+
export declare const isValidContractId: (contractId: string) => boolean;
|
|
92
|
+
/**
|
|
93
|
+
* Simple boolean address validation for Kalvora addresses
|
|
94
|
+
*
|
|
95
|
+
* Validates that the address is properly base58 encoded and has reasonable length.
|
|
96
|
+
* This is a lightweight validation for quick checks.
|
|
97
|
+
*
|
|
98
|
+
* @param address - Address to validate
|
|
99
|
+
* @returns `true` if valid, `false` otherwise
|
|
100
|
+
*
|
|
101
|
+
* @example
|
|
102
|
+
* ```typescript
|
|
103
|
+
* isValidAddress('5KJvsngHeMby884zrh6A5u6b4SqzZzAb'); // true
|
|
104
|
+
* isValidAddress('invalid'); // false
|
|
105
|
+
* ```
|
|
106
|
+
*/
|
|
107
|
+
export declare const isValidAddress: (address: string) => boolean;
|
|
108
|
+
export declare const validateAmount: (amount: unknown, options?: ValidationOptions & {
|
|
109
|
+
minAmount?: AmountInput;
|
|
110
|
+
maxAmount?: AmountInput;
|
|
111
|
+
allowZero?: boolean;
|
|
112
|
+
contractId?: string;
|
|
113
|
+
}) => ValidationResult<AmountInput>;
|
|
114
|
+
export declare const validateBase58Address: (address: unknown, options?: ValidationOptions) => ValidationResult<string>;
|
|
115
|
+
export declare const validateBase58Key: (key: unknown, options?: ValidationOptions) => ValidationResult<string>;
|
|
116
|
+
export declare const validateKeyType: (keyType: unknown, options?: ValidationOptions) => ValidationResult<KeyType>;
|
|
117
|
+
export declare const validateHashTypes: (hashTypes: unknown, options?: ValidationOptions) => ValidationResult<HashType[]>;
|
|
118
|
+
export declare const validateMnemonic: (mnemonic: unknown, options?: ValidationOptions) => ValidationResult<string>;
|
|
119
|
+
//# sourceMappingURL=validation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../../../../src/shared/utils/validation.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EACV,WAAW,EACX,OAAO,EACP,QAAQ,EACT,MAAM,sBAAsB,CAAC;AAS9B;;GAEG;AACH,MAAM,WAAW,gBAAgB,CAAC,CAAC,GAAG,OAAO;IAC3C,oCAAoC;IACpC,OAAO,EAAE,OAAO,CAAC;IACjB,kDAAkD;IAClD,KAAK,CAAC,EAAE,CAAC,CAAC;IACV,yCAAyC;IACzC,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