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,218 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Token Info Handler Service
|
|
3
|
+
*
|
|
4
|
+
* Centralized token information handling.
|
|
5
|
+
* Routes directly to validator as indexer integration has been removed.
|
|
6
|
+
* Contains all business logic for token information operations.
|
|
7
|
+
*/
|
|
8
|
+
import { getTokenFeeInfo as getValidatorTokenFeeInfo } from '../../validator/fee-info/index.js';
|
|
9
|
+
/**
|
|
10
|
+
* Token Info Handler Service
|
|
11
|
+
* Centralized token information handling
|
|
12
|
+
*/
|
|
13
|
+
export class TokenInfoHandler {
|
|
14
|
+
constructor(options = {}) {
|
|
15
|
+
this.cache = new Map();
|
|
16
|
+
this.cacheTimeout = options.cacheTimeout || 2000; // 2 seconds default
|
|
17
|
+
this.enableCache = options.enableCache !== false; // Default to true
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Get comprehensive token fee information
|
|
21
|
+
*/
|
|
22
|
+
async getTokenFeeInfo(params, options = {}) {
|
|
23
|
+
// Input validation
|
|
24
|
+
if (!params.contractIds || params.contractIds.length === 0) {
|
|
25
|
+
throw new Error('Contract IDs array is required and cannot be empty');
|
|
26
|
+
}
|
|
27
|
+
// Create cache key
|
|
28
|
+
const cacheKey = this.createCacheKey(params);
|
|
29
|
+
// Check cache first
|
|
30
|
+
if (this.enableCache && this.cache.has(cacheKey)) {
|
|
31
|
+
const cached = this.cache.get(cacheKey);
|
|
32
|
+
if (cached && Date.now() - cached.timestamp < this.cacheTimeout) {
|
|
33
|
+
return cached.data;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
try {
|
|
37
|
+
const response = await getValidatorTokenFeeInfo(params, options);
|
|
38
|
+
// Cache the result
|
|
39
|
+
if (this.enableCache) {
|
|
40
|
+
this.cache.set(cacheKey, {
|
|
41
|
+
data: response,
|
|
42
|
+
timestamp: Date.now()
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
return response;
|
|
46
|
+
}
|
|
47
|
+
catch (error) {
|
|
48
|
+
throw new Error(`Failed to get token fee info: ${error.message}`);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Get token information for a single contract ID
|
|
53
|
+
*/
|
|
54
|
+
async getTokenInfoForSingle(contractId, options = {}) {
|
|
55
|
+
// Input validation
|
|
56
|
+
if (!contractId) {
|
|
57
|
+
throw new Error('Contract ID is required');
|
|
58
|
+
}
|
|
59
|
+
try {
|
|
60
|
+
const response = await this.getTokenFeeInfo({
|
|
61
|
+
contractIds: [contractId],
|
|
62
|
+
includeRates: true,
|
|
63
|
+
includeContractFees: true
|
|
64
|
+
}, options);
|
|
65
|
+
const tokenInfo = response.tokens.find((t) => t.contractId === contractId);
|
|
66
|
+
if (!tokenInfo) {
|
|
67
|
+
throw new Error(`Token information not found for contract ID: ${contractId}`);
|
|
68
|
+
}
|
|
69
|
+
return {
|
|
70
|
+
contractId: tokenInfo.contractId,
|
|
71
|
+
denomination: tokenInfo.denomination,
|
|
72
|
+
rate: tokenInfo.rate,
|
|
73
|
+
authorized: tokenInfo.authorized,
|
|
74
|
+
allowedFees: tokenInfo.allowedFees || '0',
|
|
75
|
+
usedFees: tokenInfo.usedFees || '0',
|
|
76
|
+
contractFees: tokenInfo.contractFees || undefined
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
catch (error) {
|
|
80
|
+
throw new Error(`Failed to get token info for ${contractId}: ${error.message}`);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Check if a token is supported/authorized
|
|
85
|
+
*/
|
|
86
|
+
async isTokenSupported(contractId, options = {}) {
|
|
87
|
+
try {
|
|
88
|
+
const tokenInfo = await this.getTokenInfoForSingle(contractId, options);
|
|
89
|
+
return tokenInfo.authorized;
|
|
90
|
+
}
|
|
91
|
+
catch {
|
|
92
|
+
return false;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Get token denomination
|
|
97
|
+
*/
|
|
98
|
+
async getTokenDenomination(contractId, options = {}) {
|
|
99
|
+
try {
|
|
100
|
+
const tokenInfo = await this.getTokenInfoForSingle(contractId, options);
|
|
101
|
+
return tokenInfo.denomination;
|
|
102
|
+
}
|
|
103
|
+
catch (error) {
|
|
104
|
+
throw new Error(`Failed to get denomination for ${contractId}: ${error.message}`);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Get token exchange rate
|
|
109
|
+
*/
|
|
110
|
+
async getTokenRate(contractId, options = {}) {
|
|
111
|
+
try {
|
|
112
|
+
const tokenInfo = await this.getTokenInfoForSingle(contractId, options);
|
|
113
|
+
return tokenInfo.rate;
|
|
114
|
+
}
|
|
115
|
+
catch (error) {
|
|
116
|
+
throw new Error(`Failed to get exchange rate for ${contractId}: ${error.message}`);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Get token information map for multiple contract IDs
|
|
121
|
+
*/
|
|
122
|
+
async getTokenInfoMap(contractId, additionalContractIds = [], options = {}) {
|
|
123
|
+
const contractIdsToFetch = new Set();
|
|
124
|
+
contractIdsToFetch.add(contractId); // Main contract is always needed
|
|
125
|
+
// Add any additional contract IDs
|
|
126
|
+
additionalContractIds.forEach(id => {
|
|
127
|
+
if (id) {
|
|
128
|
+
contractIdsToFetch.add(id);
|
|
129
|
+
}
|
|
130
|
+
});
|
|
131
|
+
// Fetch all required token info in a single call
|
|
132
|
+
const tokensResponse = await this.getTokenFeeInfo({
|
|
133
|
+
contractIds: [...contractIdsToFetch],
|
|
134
|
+
includeRates: true,
|
|
135
|
+
includeContractFees: true
|
|
136
|
+
}, options);
|
|
137
|
+
const tokenInfoMap = new Map();
|
|
138
|
+
tokensResponse.tokens.forEach((token) => {
|
|
139
|
+
tokenInfoMap.set(token.contractId, {
|
|
140
|
+
contractId: token.contractId,
|
|
141
|
+
denomination: token.denomination,
|
|
142
|
+
rate: token.rate,
|
|
143
|
+
authorized: token.authorized,
|
|
144
|
+
allowedFees: token.allowedFees || '0',
|
|
145
|
+
usedFees: token.usedFees || '0',
|
|
146
|
+
contractFees: token.contractFees || undefined
|
|
147
|
+
});
|
|
148
|
+
});
|
|
149
|
+
return tokenInfoMap;
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Create cache key for parameters
|
|
153
|
+
*/
|
|
154
|
+
createCacheKey(params) {
|
|
155
|
+
const sortedIds = [...params.contractIds].sort();
|
|
156
|
+
return `${sortedIds.join(',')}-${params.includeRates || false}-${params.includeContractFees || false}`;
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* Clear cache
|
|
160
|
+
*/
|
|
161
|
+
clearCache() {
|
|
162
|
+
this.cache.clear();
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* Get cache statistics
|
|
166
|
+
*/
|
|
167
|
+
getCacheStats() {
|
|
168
|
+
const now = Date.now();
|
|
169
|
+
return {
|
|
170
|
+
size: this.cache.size,
|
|
171
|
+
entries: Array.from(this.cache.entries()).map(([key, data]) => ({
|
|
172
|
+
key,
|
|
173
|
+
age: now - data.timestamp
|
|
174
|
+
}))
|
|
175
|
+
};
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* Default token info handler instance
|
|
180
|
+
*/
|
|
181
|
+
export const tokenInfoHandler = new TokenInfoHandler();
|
|
182
|
+
/**
|
|
183
|
+
* Convenience function to get token fee info
|
|
184
|
+
*/
|
|
185
|
+
export async function getTokenFeeInfo(params, options = {}) {
|
|
186
|
+
return tokenInfoHandler.getTokenFeeInfo(params, options);
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* Convenience function to get token info for single contract
|
|
190
|
+
*/
|
|
191
|
+
export async function getTokenInfoForSingle(contractId, options = {}) {
|
|
192
|
+
return tokenInfoHandler.getTokenInfoForSingle(contractId, options);
|
|
193
|
+
}
|
|
194
|
+
/**
|
|
195
|
+
* Convenience function to check if token is supported
|
|
196
|
+
*/
|
|
197
|
+
export async function isTokenSupported(contractId, options = {}) {
|
|
198
|
+
return tokenInfoHandler.isTokenSupported(contractId, options);
|
|
199
|
+
}
|
|
200
|
+
/**
|
|
201
|
+
* Convenience function to get token denomination
|
|
202
|
+
*/
|
|
203
|
+
export async function getTokenDenomination(contractId, options = {}) {
|
|
204
|
+
return tokenInfoHandler.getTokenDenomination(contractId, options);
|
|
205
|
+
}
|
|
206
|
+
/**
|
|
207
|
+
* Convenience function to get token rate
|
|
208
|
+
*/
|
|
209
|
+
export async function getTokenRate(contractId, options = {}) {
|
|
210
|
+
return tokenInfoHandler.getTokenRate(contractId, options);
|
|
211
|
+
}
|
|
212
|
+
/**
|
|
213
|
+
* Convenience function to get token info map
|
|
214
|
+
*/
|
|
215
|
+
export async function getTokenInfoMap(contractId, additionalContractIds = [], options = {}) {
|
|
216
|
+
return tokenInfoHandler.getTokenInfoMap(contractId, additionalContractIds, options);
|
|
217
|
+
}
|
|
218
|
+
//# sourceMappingURL=service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"service.js","sourceRoot":"","sources":["../../../../../src/api/handler/token-info/service.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,EAAE,eAAe,IAAI,wBAAwB,EAAE,MAAM,mCAAmC,CAAC;AA6BhG;;;GAGG;AACH,MAAM,OAAO,gBAAgB;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MAAM,CAAC,KAAK,UAAU,YAAY,CAAC,UAAkB,EAAE,UAAsB,EAAE;IAC7E,OAAO,gBAAgB,CAAC,YAAY,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;AAC5D,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,eAAe,CACnC,UAAkB,EAClB,wBAAkC,EAAE,EACpC,UAAsB,EAAE;IAExB,OAAO,gBAAgB,CAAC,eAAe,CAAC,UAAU,EAAE,qBAAqB,EAAE,OAAO,CAAC,CAAC;AACtF,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared utilities for indexer routing logic
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Determine if indexer should be used based on environment
|
|
6
|
+
* @returns true if INDEXER_AUTH is provided, false otherwise
|
|
7
|
+
*/
|
|
8
|
+
export declare function shouldUseIndexer(): boolean;
|
|
9
|
+
/**
|
|
10
|
+
* Get indexer authentication header value
|
|
11
|
+
* @returns the INDEXER_AUTH value or undefined
|
|
12
|
+
*/
|
|
13
|
+
export declare function getIndexerAuth(): string | undefined;
|
|
14
|
+
//# sourceMappingURL=indexer-utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"indexer-utils.d.ts","sourceRoot":"","sources":["../../../../src/api/shared/indexer-utils.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;GAGG;AACH,wBAAgB,gBAAgB,IAAI,OAAO,CAG1C;AAED;;;GAGG;AACH,wBAAgB,cAAc,IAAI,MAAM,GAAG,SAAS,CAEnD"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared utilities for indexer routing logic
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Determine if indexer should be used based on environment
|
|
6
|
+
* @returns true if INDEXER_AUTH is provided, false otherwise
|
|
7
|
+
*/
|
|
8
|
+
export function shouldUseIndexer() {
|
|
9
|
+
// Use indexer if authentication is provided
|
|
10
|
+
return !!process.env.INDEXER_AUTH;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Get indexer authentication header value
|
|
14
|
+
* @returns the INDEXER_AUTH value or undefined
|
|
15
|
+
*/
|
|
16
|
+
export function getIndexerAuth() {
|
|
17
|
+
return process.env.INDEXER_AUTH;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=indexer-utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"indexer-utils.js","sourceRoot":"","sources":["../../../../src/api/shared/indexer-utils.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;GAGG;AACH,MAAM,UAAU,gBAAgB;IAC9B,4CAA4C;IAC5C,OAAO,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC;AACpC,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,cAAc;IAC5B,OAAO,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC;AAClC,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Validator Balance Service - Main Exports
|
|
3
|
+
*
|
|
4
|
+
* This provides convenient access to all balance-related functionality.
|
|
5
|
+
*/
|
|
6
|
+
export { getBalance, getBalances } from './service.js';
|
|
7
|
+
export type { EnhancedBalanceResponse } from './service.js';
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/api/validator/balance/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AACvD,YAAY,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/api/validator/balance/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Validator Balance Service
|
|
3
|
+
*
|
|
4
|
+
* Handles balance retrieval from the Kalvora validator via gRPC.
|
|
5
|
+
* Contains all business logic for balance operations.
|
|
6
|
+
*/
|
|
7
|
+
import type { BalanceResponse } from '../../../../proto/generated/kal_api_pb.js';
|
|
8
|
+
import type { GRPCConfig } from '../../../types/index.js';
|
|
9
|
+
/**
|
|
10
|
+
* Enhanced Balance Response with nice computed fields
|
|
11
|
+
*/
|
|
12
|
+
export interface EnhancedBalanceResponse extends BalanceResponse {
|
|
13
|
+
/**
|
|
14
|
+
* Human-readable balance (balance / denomination)
|
|
15
|
+
*/
|
|
16
|
+
balanceNice: string;
|
|
17
|
+
/**
|
|
18
|
+
* Human-readable rate (rate / 1e18)
|
|
19
|
+
*/
|
|
20
|
+
rateNice: string;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Get the balance for an address and contract ID
|
|
24
|
+
*
|
|
25
|
+
* @param address - The wallet address (base58 encoded)
|
|
26
|
+
* @param contractId - The contract ID to get balance for
|
|
27
|
+
* @param options - gRPC configuration options
|
|
28
|
+
* @returns Promise<EnhancedBalanceResponse> - Enhanced balance information response
|
|
29
|
+
*
|
|
30
|
+
* @note If the wallet doesn't have that token, the validator returns values of `balance: "0"`, `rate: "0"`, and `denomination: "0"` (raw units) to indicate a zero balance. This means that when a wallet doesn't have that balance, the rate and denomination data may be inaccurate. Please process 0 accordingly to avoid division by zero errors.
|
|
31
|
+
*/
|
|
32
|
+
export declare function getBalance(address: string, contractId: string, options?: GRPCConfig): Promise<EnhancedBalanceResponse>;
|
|
33
|
+
/**
|
|
34
|
+
* Get balances for multiple addresses with the same contract ID
|
|
35
|
+
*
|
|
36
|
+
* @param addresses - Array of wallet addresses
|
|
37
|
+
* @param contractId - The contract ID to get balance for
|
|
38
|
+
* @param options - gRPC configuration options
|
|
39
|
+
* @returns Promise<EnhancedBalanceResponse[]> - Array of enhanced balance information responses
|
|
40
|
+
*/
|
|
41
|
+
export declare function getBalances(addresses: string[], contractId: string, options?: GRPCConfig): Promise<EnhancedBalanceResponse[]>;
|
|
42
|
+
//# sourceMappingURL=service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../../../../../src/api/validator/balance/service.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAOH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2CAA2C,CAAC;AAEjF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAE1D;;GAEG;AACH,MAAM,WAAW,uBAAwB,SAAQ,eAAe;IAC9D;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;;;;;;;;GASG;AACH,wBAAsB,UAAU,CAC9B,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,MAAM,EAClB,OAAO,GAAE,UAAe,GACvB,OAAO,CAAC,uBAAuB,CAAC,CA+BlC;AAqBD;;;;;;;GAOG;AACH,wBAAsB,WAAW,CAC/B,SAAS,EAAE,MAAM,EAAE,EACnB,UAAU,EAAE,MAAM,EAClB,OAAO,GAAE,UAAe,GACvB,OAAO,CAAC,uBAAuB,EAAE,CAAC,CAmBpC"}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Validator Balance Service
|
|
3
|
+
*
|
|
4
|
+
* Handles balance retrieval from the Kalvora validator via gRPC.
|
|
5
|
+
* Contains all business logic for balance operations.
|
|
6
|
+
*/
|
|
7
|
+
import { create } from '@bufbuild/protobuf';
|
|
8
|
+
import Decimal from 'decimal.js';
|
|
9
|
+
import { BalanceResponseSchema } from '../../../../proto/generated/kal_api_pb.js';
|
|
10
|
+
import { createValidatorAPIClient } from '../../../grpc/api/validator-api-client.js';
|
|
11
|
+
/**
|
|
12
|
+
* Get the balance for an address and contract ID
|
|
13
|
+
*
|
|
14
|
+
* @param address - The wallet address (base58 encoded)
|
|
15
|
+
* @param contractId - The contract ID to get balance for
|
|
16
|
+
* @param options - gRPC configuration options
|
|
17
|
+
* @returns Promise<EnhancedBalanceResponse> - Enhanced balance information response
|
|
18
|
+
*
|
|
19
|
+
* @note If the wallet doesn't have that token, the validator returns values of `balance: "0"`, `rate: "0"`, and `denomination: "0"` (raw units) to indicate a zero balance. This means that when a wallet doesn't have that balance, the rate and denomination data may be inaccurate. Please process 0 accordingly to avoid division by zero errors.
|
|
20
|
+
*/
|
|
21
|
+
export async function getBalance(address, contractId, options = {}) {
|
|
22
|
+
// Input validation
|
|
23
|
+
if (!address || typeof address !== 'string' || address.trim() === '') {
|
|
24
|
+
throw new Error('Address must be a non-empty string');
|
|
25
|
+
}
|
|
26
|
+
if (!contractId || typeof contractId !== 'string' || contractId.trim() === '') {
|
|
27
|
+
throw new Error('Contract ID must be a non-empty string');
|
|
28
|
+
}
|
|
29
|
+
try {
|
|
30
|
+
// Create validator API client
|
|
31
|
+
const client = createValidatorAPIClient(options);
|
|
32
|
+
// Make gRPC call using the client's getBalance method
|
|
33
|
+
const response = await client.getBalance(address, contractId);
|
|
34
|
+
return enhanceBalanceResponse(response);
|
|
35
|
+
}
|
|
36
|
+
catch (error) {
|
|
37
|
+
// Handle invalid wallet error - return empty balance response
|
|
38
|
+
const err = error;
|
|
39
|
+
if ((err.details && err.details.includes('Invalid Wallet')) || (err.message && err.message.includes('Invalid Wallet')) || err.code === 'INVALID_ARGUMENT') {
|
|
40
|
+
const emptyResponse = create(BalanceResponseSchema, {
|
|
41
|
+
balance: '0',
|
|
42
|
+
denomination: '1',
|
|
43
|
+
rate: '0'
|
|
44
|
+
});
|
|
45
|
+
return enhanceBalanceResponse(emptyResponse);
|
|
46
|
+
}
|
|
47
|
+
throw new Error(`Failed to get balance from validator: ${error.message}`);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Enhance balance response with nice computed fields
|
|
52
|
+
*/
|
|
53
|
+
function enhanceBalanceResponse(response) {
|
|
54
|
+
// Calculate balanceNice = balance / denomination
|
|
55
|
+
const balanceDecimal = new Decimal(response.balance).div(new Decimal(response.denomination || '1'));
|
|
56
|
+
const balanceNice = balanceDecimal.toString();
|
|
57
|
+
// Calculate rateNice = rate / 1e18
|
|
58
|
+
const rateDecimal = new Decimal(response.rate || '0').div(new Decimal(10).pow(18));
|
|
59
|
+
const rateNice = rateDecimal.toString();
|
|
60
|
+
return {
|
|
61
|
+
...response,
|
|
62
|
+
balanceNice,
|
|
63
|
+
rateNice
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Get balances for multiple addresses with the same contract ID
|
|
68
|
+
*
|
|
69
|
+
* @param addresses - Array of wallet addresses
|
|
70
|
+
* @param contractId - The contract ID to get balance for
|
|
71
|
+
* @param options - gRPC configuration options
|
|
72
|
+
* @returns Promise<EnhancedBalanceResponse[]> - Array of enhanced balance information responses
|
|
73
|
+
*/
|
|
74
|
+
export async function getBalances(addresses, contractId, options = {}) {
|
|
75
|
+
if (!Array.isArray(addresses) || addresses.length === 0) {
|
|
76
|
+
throw new Error('Addresses must be a non-empty array');
|
|
77
|
+
}
|
|
78
|
+
if (!contractId || typeof contractId !== 'string' || contractId.trim() === '') {
|
|
79
|
+
throw new Error('Contract ID must be a non-empty string');
|
|
80
|
+
}
|
|
81
|
+
try {
|
|
82
|
+
const balances = [];
|
|
83
|
+
for (const address of addresses) {
|
|
84
|
+
const balance = await getBalance(address, contractId, options);
|
|
85
|
+
balances.push(balance);
|
|
86
|
+
}
|
|
87
|
+
return balances;
|
|
88
|
+
}
|
|
89
|
+
catch (error) {
|
|
90
|
+
throw new Error(`Failed to get balances from validator: ${error.message}`);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
//# sourceMappingURL=service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"service.js","sourceRoot":"","sources":["../../../../../src/api/validator/balance/service.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,OAAO,MAAM,YAAY,CAAC;AAGjC,OAAO,EAAE,qBAAqB,EAAE,MAAM,2CAA2C,CAAC;AAElF,OAAO,EAAE,wBAAwB,EAAE,MAAM,2CAA2C,CAAC;AAkBrF;;;;;;;;;GASG;AACH,MAAM,CAAC,KAAK,UAAU,UAAU,CAC9B,OAAe,EACf,UAAkB,EAClB,UAAsB,EAAE;IAExB,mBAAmB;IACnB,IAAI,CAAC,OAAO,IAAI,OAAO,OAAO,KAAK,QAAQ,IAAI,OAAO,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC;QACrE,MAAM,IAAI,KAAK,CAAC,oCAAoC,CAAC,CAAC;IACxD,CAAC;IAED,IAAI,CAAC,UAAU,IAAI,OAAO,UAAU,KAAK,QAAQ,IAAI,UAAU,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC;QAC9E,MAAM,IAAI,KAAK,CAAC,wCAAwC,CAAC,CAAC;IAC5D,CAAC;IAED,IAAI,CAAC;QACH,8BAA8B;QAC9B,MAAM,MAAM,GAAG,wBAAwB,CAAC,OAAO,CAAC,CAAC;QAEjD,sDAAsD;QACtD,MAAM,QAAQ,GAAoB,MAAM,MAAM,CAAC,UAAU,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;QAE/E,OAAO,sBAAsB,CAAC,QAAQ,CAAC,CAAC;IAC1C,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,8DAA8D;QAC9D,MAAM,GAAG,GAAG,KAA8D,CAAC;QAC3E,IAAI,CAAC,GAAG,CAAC,OAAO,IAAI,GAAG,CAAC,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAC,CA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CAAC;QACxD,MAAM,IAAI,KAAK,CAAC,qCAAqC,CAAC,CAAC;IACzD,CAAC;IAED,IAAI,CAAC,UAAU,IAAI,OAAO,UAAU,KAAK,QAAQ,IAAI,UAAU,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC;QAC9E,MAAM,IAAI,KAAK,CAAC,wCAAwC,CAAC,CAAC;IAC5D,CAAC;IAED,IAAI,CAAC;QACH,MAAM,QAAQ,GAA8B,EAAE,CAAC;QAC/C,KAAK,MAAM,OAAO,IAAI,SAAS,EAAE,CAAC;YAChC,MAAM,OAAO,GAAG,MAAM,UAAU,CAAC,OAAO,EAAE,UAAU,EAAE,OAAO,CAAC,CAAC;YAC/D,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACzB,CAAC;QACD,OAAO,QAAQ,CAAC;IAClB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,IAAI,KAAK,CAAC,0CAA2C,KAAe,CAAC,OAAO,EAAE,CAAC,CAAC;IACxF,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Validator Base Fee Service - Main Exports
|
|
3
|
+
*
|
|
4
|
+
* This provides convenient access to all base-fee-related functionality.
|
|
5
|
+
*/
|
|
6
|
+
export { getBaseFee } from './service.js';
|
|
7
|
+
export type { EnhancedBaseFeeResponse } from './service.js';
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/api/validator/base-fee/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,YAAY,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/api/validator/base-fee/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Validator Base Fee Service
|
|
3
|
+
*
|
|
4
|
+
* Retrieves base fee information (key fee and byte fee) from the Kalvora validator via gRPC.
|
|
5
|
+
* This replaces locally hardcoded fee constants with network-sourced values.
|
|
6
|
+
*/
|
|
7
|
+
import type { BaseFeeResponse } from '../../../../proto/generated/kal_api_pb.js';
|
|
8
|
+
import type { PublicKey } from '../../../../proto/generated/txn_pb.js';
|
|
9
|
+
import { TRANSACTION_TYPE } from '../../../../proto/generated/txn_pb.js';
|
|
10
|
+
import type { GRPCConfig } from '../../../types/index.js';
|
|
11
|
+
/**
|
|
12
|
+
* Enhanced Base Fee Response with human-readable computed fields
|
|
13
|
+
*/
|
|
14
|
+
export interface EnhancedBaseFeeResponse extends BaseFeeResponse {
|
|
15
|
+
/**
|
|
16
|
+
* Human-readable key fee in USD (key_fee / 1e18)
|
|
17
|
+
*/
|
|
18
|
+
keyFeeUsd: string;
|
|
19
|
+
/**
|
|
20
|
+
* Human-readable byte fee in USD (byte_fee / 1e18)
|
|
21
|
+
*/
|
|
22
|
+
byteFeeUsd: string;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Get the base fee rates for a transaction type and public key
|
|
26
|
+
*
|
|
27
|
+
* The validator returns:
|
|
28
|
+
* - `key_fee`: Total fee for the signer's key type (includes key, hash, and restricted multiplier)
|
|
29
|
+
* - `byte_fee`: Per-byte fee for the given transaction type
|
|
30
|
+
*
|
|
31
|
+
* Both values are in 1e18 = $1.00 format.
|
|
32
|
+
*
|
|
33
|
+
* @param txnType - The transaction type (from TRANSACTION_TYPE enum)
|
|
34
|
+
* @param publicKey - Optional public key (determines key type fee, hash fee, restricted multiplier)
|
|
35
|
+
* @param options - gRPC configuration options
|
|
36
|
+
* @returns Promise<EnhancedBaseFeeResponse> - Base fee information
|
|
37
|
+
*/
|
|
38
|
+
export declare function getBaseFee(txnType: TRANSACTION_TYPE, publicKey?: PublicKey, options?: GRPCConfig): Promise<EnhancedBaseFeeResponse>;
|
|
39
|
+
//# sourceMappingURL=service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../../../../../src/api/validator/base-fee/service.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uCAAuC,CAAC;AACvE,OAAO,EAAE,gBAAgB,EAAE,MAAM,uCAAuC,CAAC;AAEzE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAE1D;;GAEG;AACH,MAAM,WAAW,uBAAwB,SAAQ,eAAe;IAC9D;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAsB,UAAU,CAC9B,OAAO,EAAE,gBAAgB,EACzB,SAAS,CAAC,EAAE,SAAS,EACrB,OAAO,GAAE,UAAe,GACvB,OAAO,CAAC,uBAAuB,CAAC,CASlC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Validator Base Fee Service
|
|
3
|
+
*
|
|
4
|
+
* Retrieves base fee information (key fee and byte fee) from the Kalvora validator via gRPC.
|
|
5
|
+
* This replaces locally hardcoded fee constants with network-sourced values.
|
|
6
|
+
*/
|
|
7
|
+
import { createValidatorAPIClient } from '../../../grpc/api/validator-api-client.js';
|
|
8
|
+
/**
|
|
9
|
+
* Get the base fee rates for a transaction type and public key
|
|
10
|
+
*
|
|
11
|
+
* The validator returns:
|
|
12
|
+
* - `key_fee`: Total fee for the signer's key type (includes key, hash, and restricted multiplier)
|
|
13
|
+
* - `byte_fee`: Per-byte fee for the given transaction type
|
|
14
|
+
*
|
|
15
|
+
* Both values are in 1e18 = $1.00 format.
|
|
16
|
+
*
|
|
17
|
+
* @param txnType - The transaction type (from TRANSACTION_TYPE enum)
|
|
18
|
+
* @param publicKey - Optional public key (determines key type fee, hash fee, restricted multiplier)
|
|
19
|
+
* @param options - gRPC configuration options
|
|
20
|
+
* @returns Promise<EnhancedBaseFeeResponse> - Base fee information
|
|
21
|
+
*/
|
|
22
|
+
export async function getBaseFee(txnType, publicKey, options = {}) {
|
|
23
|
+
try {
|
|
24
|
+
const client = createValidatorAPIClient(options);
|
|
25
|
+
const response = await client.getBaseFee(publicKey, txnType);
|
|
26
|
+
return enhanceBaseFeeResponse(response);
|
|
27
|
+
}
|
|
28
|
+
catch (error) {
|
|
29
|
+
throw new Error(`Failed to get base fee from validator: ${error.message}`);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Enhance base fee response with human-readable USD values
|
|
34
|
+
*/
|
|
35
|
+
function enhanceBaseFeeResponse(response) {
|
|
36
|
+
// Convert from 1e18 format to USD
|
|
37
|
+
const keyFeeNum = Number(BigInt(response.keyFee || '0')) / 1e18;
|
|
38
|
+
const byteFeeNum = Number(BigInt(response.byteFee || '0')) / 1e18;
|
|
39
|
+
return {
|
|
40
|
+
...response,
|
|
41
|
+
keyFeeUsd: keyFeeNum.toString(),
|
|
42
|
+
byteFeeUsd: byteFeeNum.toString()
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"service.js","sourceRoot":"","sources":["../../../../../src/api/validator/base-fee/service.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,OAAO,EAAE,wBAAwB,EAAE,MAAM,2CAA2C,CAAC;AAkBrF;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,KAAK,UAAU,UAAU,CAC9B,OAAyB,EACzB,SAAqB,EACrB,UAAsB,EAAE;IAExB,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,wBAAwB,CAAC,OAAO,CAAC,CAAC;QACjD,MAAM,QAAQ,GAAoB,MAAM,MAAM,CAAC,UAAU,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;QAE9E,OAAO,sBAAsB,CAAC,QAAQ,CAAC,CAAC;IAC1C,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,IAAI,KAAK,CAAC,0CAA2C,KAAe,CAAC,OAAO,EAAE,CAAC,CAAC;IACxF,CAAC;AACH,CAAC;AAED;;GAEG;AACH,SAAS,sBAAsB,CAAC,QAAyB;IACvD,kCAAkC;IAClC,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,IAAI,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC;IAChE,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,IAAI,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC;IAElE,OAAO;QACL,GAAG,QAAQ;QACX,SAAS,EAAE,SAAS,CAAC,QAAQ,EAAE;QAC/B,UAAU,EAAE,UAAU,CAAC,QAAQ,EAAE;KACI,CAAC;AAC1C,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/api/validator/fee-info/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,eAAe,EACf,KAAK,qBAAqB,EAC3B,MAAM,cAAc,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/api/validator/fee-info/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,eAAe,EAEhB,MAAM,cAAc,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Validator Fee Info Service
|
|
3
|
+
*
|
|
4
|
+
* Handles fee information retrieval from the Kalvora validator via gRPC.
|
|
5
|
+
* Uses the GetTokenFeeInfo API to get comprehensive token fee information.
|
|
6
|
+
*/
|
|
7
|
+
import type { TokenFeeInfoResponse } from '../../../../proto/generated/kal_api_pb.js';
|
|
8
|
+
import type { GRPCConfig } from '../../../types/index.js';
|
|
9
|
+
/**
|
|
10
|
+
* Parameters for GetTokenFeeInfo API call
|
|
11
|
+
*/
|
|
12
|
+
export interface GetTokenFeeInfoParams {
|
|
13
|
+
contractIds?: string[];
|
|
14
|
+
includeRates?: boolean;
|
|
15
|
+
includeContractFees?: boolean;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Get comprehensive token fee information from the validator
|
|
19
|
+
*
|
|
20
|
+
* @param params - Parameters to customize the fee information retrieval
|
|
21
|
+
* @param options - gRPC configuration options
|
|
22
|
+
* @returns Promise<TokenFeeInfoResponse> - Token fee information response
|
|
23
|
+
*/
|
|
24
|
+
export declare function getTokenFeeInfo(params?: GetTokenFeeInfoParams, options?: GRPCConfig): Promise<TokenFeeInfoResponse>;
|
|
25
|
+
//# sourceMappingURL=request.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"request.d.ts","sourceRoot":"","sources":["../../../../../src/api/validator/fee-info/request.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AAItF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAE1D;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,mBAAmB,CAAC,EAAE,OAAO,CAAC;CAC/B;AAgBD;;;;;;GAMG;AACH,wBAAsB,eAAe,CACnC,MAAM,GAAE,qBAA0B,EAClC,OAAO,GAAE,UAAe,GACvB,OAAO,CAAC,oBAAoB,CAAC,CAoE/B"}
|