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,184 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Decoders and helpers for Kalvora query responses.
|
|
3
|
+
*
|
|
4
|
+
* Pure functions (no network access) that turn raw protobuf responses into
|
|
5
|
+
* convenient, typed values. They are used by {@link KalvoraQueryClient} and
|
|
6
|
+
* are exported for callers that fetch data through other channels (e.g. an
|
|
7
|
+
* indexer that stores raw blocks).
|
|
8
|
+
*
|
|
9
|
+
* @module query/decoders
|
|
10
|
+
*/
|
|
11
|
+
import { TRANSACTION_TYPE, TXN_STATUS, type TXNStatusFees } from '../../proto/generated/txn_pb.js';
|
|
12
|
+
import type { Block } from '../../proto/generated/validator_pb.js';
|
|
13
|
+
/**
|
|
14
|
+
* Fixed-point scale used by the network for USD rates, currency equivalents,
|
|
15
|
+
* and fee percentages: `1_000_000_000_000_000_000` (1e18) represents
|
|
16
|
+
* `$1.00` (or 100 %).
|
|
17
|
+
*/
|
|
18
|
+
export declare const USD_SCALE: bigint;
|
|
19
|
+
/**
|
|
20
|
+
* Parse a non-negative integer string returned by the node into a `bigint`.
|
|
21
|
+
* Empty strings (proto3 defaults) parse as `0n`.
|
|
22
|
+
*
|
|
23
|
+
* @throws Error if the value is not an unsigned integer string
|
|
24
|
+
*/
|
|
25
|
+
export declare function parseUintString(value: string, field?: string): bigint;
|
|
26
|
+
/**
|
|
27
|
+
* Format a 1e18-scaled integer as a decimal string without floating point.
|
|
28
|
+
*
|
|
29
|
+
* @param scaled - Scaled value (e.g. a `rate` or `currencyEquivalent`)
|
|
30
|
+
* @param maxFractionDigits - Digits kept after the decimal point (default 18,
|
|
31
|
+
* truncated); trailing zeros are removed.
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* ```typescript
|
|
35
|
+
* formatScaled(1_500_000_000_000_000_000n); // '1.5'
|
|
36
|
+
* ```
|
|
37
|
+
*/
|
|
38
|
+
export declare function formatScaled(scaled: bigint, maxFractionDigits?: number): string;
|
|
39
|
+
/**
|
|
40
|
+
* Convert a token amount in smallest units into whole units as a decimal
|
|
41
|
+
* string, using the token's `denomination` (parts per whole token).
|
|
42
|
+
*
|
|
43
|
+
* Works for any positive denomination (not only powers of ten); results that
|
|
44
|
+
* do not terminate are truncated to `maxFractionDigits` (default 18).
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* ```typescript
|
|
48
|
+
* partsToWhole(1_500_000_000n, 1_000_000_000n); // '1.5'
|
|
49
|
+
* partsToWhole(1n, 4n); // '0.25'
|
|
50
|
+
* ```
|
|
51
|
+
*/
|
|
52
|
+
export declare function partsToWhole(parts: bigint, denomination: bigint, maxFractionDigits?: number): string;
|
|
53
|
+
/** Decoded `CONTRACT_SUPPLY` database record. */
|
|
54
|
+
export interface ContractSupply {
|
|
55
|
+
/** Maximum supply in smallest units (`0n` when the contract is uncapped). */
|
|
56
|
+
maxSupply: bigint;
|
|
57
|
+
/** Current (minted, not burned) supply in smallest units. */
|
|
58
|
+
currentSupply: bigint;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Decode the `CONTRACT_SUPPLY` database record.
|
|
62
|
+
*
|
|
63
|
+
* The validator stores this record as an internal protobuf message whose
|
|
64
|
+
* schema is not part of the public protos: field 1 is the max supply and
|
|
65
|
+
* field 2 the current supply, both as decimal strings. Field meaning was
|
|
66
|
+
* confirmed against the live network (field 1 equals the contract's
|
|
67
|
+
* `max_supply`).
|
|
68
|
+
*
|
|
69
|
+
* @param value - The raw `DatabaseResponse.value` string (binary protobuf
|
|
70
|
+
* transported as a latin-1 string)
|
|
71
|
+
* @throws Error if the record is malformed
|
|
72
|
+
*/
|
|
73
|
+
export declare function decodeContractSupply(value: string): ContractSupply;
|
|
74
|
+
/**
|
|
75
|
+
* Mapping of every `TXNS` list field to the transaction type it contains.
|
|
76
|
+
* Result-only lists (`txnFeesAndStatus`, `tokenFees`, …) are excluded.
|
|
77
|
+
*/
|
|
78
|
+
declare const TXNS_LIST_TYPES: {
|
|
79
|
+
readonly coinTxns: TRANSACTION_TYPE.COIN_TYPE;
|
|
80
|
+
readonly mintTxns: TRANSACTION_TYPE.MINT_TYPE;
|
|
81
|
+
readonly itemMintTxns: TRANSACTION_TYPE.ITEM_MINT_TYPE;
|
|
82
|
+
readonly contractTxns: TRANSACTION_TYPE.CONTRACT_TXN_TYPE;
|
|
83
|
+
readonly governanceVotes: TRANSACTION_TYPE.VOTE_TYPE;
|
|
84
|
+
readonly governanceProposals: TRANSACTION_TYPE.PROPOSAL_TYPE;
|
|
85
|
+
readonly smartContracts: TRANSACTION_TYPE.SMART_CONTRACT_TYPE;
|
|
86
|
+
readonly smartContractExecutes: TRANSACTION_TYPE.SMART_CONTRACT_EXECUTE_TYPE;
|
|
87
|
+
readonly expenseRatios: TRANSACTION_TYPE.EXPENSE_RATIO_TYPE;
|
|
88
|
+
readonly nftTxns: TRANSACTION_TYPE.NFT_TYPE;
|
|
89
|
+
readonly contractUpdateTxns: TRANSACTION_TYPE.UPDATE_CONTRACT_TYPE;
|
|
90
|
+
readonly validatorRegistrationTxns: TRANSACTION_TYPE.VALIDATOR_REGISTRATION_TYPE;
|
|
91
|
+
readonly validatorHeartbeatTxns: TRANSACTION_TYPE.VALIDATOR_HEARTBEAT_TYPE;
|
|
92
|
+
readonly proposalResultTxns: TRANSACTION_TYPE.PROPOSAL_RESULT_TYPE;
|
|
93
|
+
readonly delegatedVotingTxns: TRANSACTION_TYPE.DELEGATED_VOTING_TYPE;
|
|
94
|
+
readonly quashTxns: TRANSACTION_TYPE.QUASH_TYPE;
|
|
95
|
+
readonly revokeTxns: TRANSACTION_TYPE.REVOKE_TYPE;
|
|
96
|
+
readonly complianceTxns: TRANSACTION_TYPE.COMPLIANCE_TYPE;
|
|
97
|
+
readonly burnSbtTxns: TRANSACTION_TYPE.SBT_BURN_TYPE;
|
|
98
|
+
readonly smartContractInstantiateTxns: TRANSACTION_TYPE.SMART_CONTRACT_INSTANTIATE_TYPE;
|
|
99
|
+
readonly allowanceTxns: TRANSACTION_TYPE.ALLOWANCE_TYPE;
|
|
100
|
+
readonly proposalCancelTxns: TRANSACTION_TYPE.PROPOSAL_CANCEL_TYPE;
|
|
101
|
+
};
|
|
102
|
+
/** A transaction extracted from a block, with its type and (hex) hash. */
|
|
103
|
+
export interface BlockTransaction {
|
|
104
|
+
/** Transaction type. */
|
|
105
|
+
type: TRANSACTION_TYPE;
|
|
106
|
+
/** Name of the `TXNS` field the transaction came from, e.g. `coinTxns`. */
|
|
107
|
+
list: keyof typeof TXNS_LIST_TYPES | 'requiredVersionTxn';
|
|
108
|
+
/** Lower-case hex transaction hash (`''` if the transaction has no base hash). */
|
|
109
|
+
hash: string;
|
|
110
|
+
/** The decoded protobuf transaction message. */
|
|
111
|
+
txn: {
|
|
112
|
+
$typeName: string;
|
|
113
|
+
base?: {
|
|
114
|
+
hash?: Uint8Array;
|
|
115
|
+
};
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Flatten every transaction in a block's `TXNS` container into a single list.
|
|
120
|
+
*
|
|
121
|
+
* Ordering follows the `TXNS` field order, then in-list order.
|
|
122
|
+
*/
|
|
123
|
+
export declare function listBlockTransactions(block: Block): BlockTransaction[];
|
|
124
|
+
/** Processing result for one transaction, from `TXNS.txn_fees_and_status`. */
|
|
125
|
+
export interface TransactionResult {
|
|
126
|
+
/** Lower-case hex transaction hash. */
|
|
127
|
+
hash: string;
|
|
128
|
+
/** Network status code. `TXN_STATUS.OK` means the transaction succeeded. */
|
|
129
|
+
status: TXN_STATUS;
|
|
130
|
+
/** Upper-snake status name, e.g. `OK` or `INSUFFICIENT_AMOUNT`. */
|
|
131
|
+
statusName: string;
|
|
132
|
+
/** `true` when `status === TXN_STATUS.OK`. */
|
|
133
|
+
success: boolean;
|
|
134
|
+
/** Base fee charged, in smallest units of `baseFeeContractId`. */
|
|
135
|
+
baseFees: bigint;
|
|
136
|
+
/** Instrument the base fee was paid in. */
|
|
137
|
+
baseFeeContractId: string;
|
|
138
|
+
/** Contract fee charged (smallest units), when applicable. */
|
|
139
|
+
contractFees?: bigint;
|
|
140
|
+
/** Instrument the contract fee was paid in, when applicable. */
|
|
141
|
+
contractFeeContractId?: string;
|
|
142
|
+
/** Gas consumed by smart contract execution, when applicable. */
|
|
143
|
+
gas?: bigint;
|
|
144
|
+
/**
|
|
145
|
+
* Network-assigned proposal identifier (`TXNStatusFees.proposal_identifier`),
|
|
146
|
+
* set on governance-proposal results by nodes running the kal_* protocol.
|
|
147
|
+
*/
|
|
148
|
+
proposalIdentifier?: bigint;
|
|
149
|
+
/** The raw protobuf record, for fields not surfaced above. */
|
|
150
|
+
raw: TXNStatusFees;
|
|
151
|
+
}
|
|
152
|
+
/** Convert a raw `TXNStatusFees` record into a {@link TransactionResult}. */
|
|
153
|
+
export declare function toTransactionResult(raw: TXNStatusFees): TransactionResult;
|
|
154
|
+
/**
|
|
155
|
+
* Find the processing result of a transaction inside a block.
|
|
156
|
+
*
|
|
157
|
+
* @param block - Block to search
|
|
158
|
+
* @param txnHash - Hex transaction hash (optionally `0x`-prefixed, any case)
|
|
159
|
+
* @returns The result, or `undefined` if the block does not contain it
|
|
160
|
+
*/
|
|
161
|
+
export declare function findTransactionResult(block: Block, txnHash: string): TransactionResult | undefined;
|
|
162
|
+
/** Compact, JSON-friendly summary of a block header and contents. */
|
|
163
|
+
export interface BlockSummary {
|
|
164
|
+
/** Block height. */
|
|
165
|
+
height: bigint;
|
|
166
|
+
/** Lower-case hex block hash. */
|
|
167
|
+
hash: string;
|
|
168
|
+
/** Lower-case hex hash of the previous block (`''` for genesis). */
|
|
169
|
+
previousHash: string;
|
|
170
|
+
/** Block timestamp. */
|
|
171
|
+
timestamp: Date | undefined;
|
|
172
|
+
/** Protocol version the block was produced with. */
|
|
173
|
+
version: bigint | undefined;
|
|
174
|
+
/** Number of user/system transactions (excludes result records). */
|
|
175
|
+
transactionCount: number;
|
|
176
|
+
/** Transaction count per type name, e.g. `{ COIN_TYPE: 3 }`. */
|
|
177
|
+
transactionsByType: Record<string, number>;
|
|
178
|
+
/** Per-transaction processing results. */
|
|
179
|
+
results: TransactionResult[];
|
|
180
|
+
}
|
|
181
|
+
/** Summarise a block into plain values (hex hashes, `Date`, counts). */
|
|
182
|
+
export declare function summarizeBlock(block: Block): BlockSummary;
|
|
183
|
+
export {};
|
|
184
|
+
//# sourceMappingURL=decoders.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"decoders.d.ts","sourceRoot":"","sources":["../../../src/query/decoders.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EACL,gBAAgB,EAChB,UAAU,EAEV,KAAK,aAAa,EACnB,MAAM,iCAAiC,CAAC;AACzC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uCAAuC,CAAC;AAOnE;;;;GAIG;AACH,eAAO,MAAM,SAAS,QAAa,CAAC;AAEpC;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,SAAU,GAAG,MAAM,CAOtE;AA2BD;;;;;;;;;;;GAWG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,iBAAiB,SAAK,GAAG,MAAM,CAE3E;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,iBAA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AG,CAAC,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,8DAA8D;IAC9D,GAAG,EAAE,aAAa,CAAC;CACpB;AAED,6EAA6E;AAC7E,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,aAAa,GAAG,iBAAiB,CAczE;AAED;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,GAAG,iBAAiB,GAAG,SAAS,CAIlG;AAED,qEAAqE;AACrE,MAAM,WAAW,YAAY;IAC3B,oBAAoB;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,iCAAiC;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,oEAAoE;IACpE,YAAY,EAAE,MAAM,CAAC;IACrB,uBAAuB;IACvB,SAAS,EAAE,IAAI,GAAG,SAAS,CAAC;IAC5B,oDAAoD;IACpD,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B,oEAAoE;IACpE,gBAAgB,EAAE,MAAM,CAAC;IACzB,gEAAgE;IAChE,kBAAkB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC3C,0CAA0C;IAC1C,OAAO,EAAE,iBAAiB,EAAE,CAAC;CAC9B;AAED,wEAAwE;AACxE,wBAAgB,cAAc,CAAC,KAAK,EAAE,KAAK,GAAG,YAAY,CAmBzD"}
|
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Decoders and helpers for Kalvora query responses.
|
|
3
|
+
*
|
|
4
|
+
* Pure functions (no network access) that turn raw protobuf responses into
|
|
5
|
+
* convenient, typed values. They are used by {@link KalvoraQueryClient} and
|
|
6
|
+
* are exported for callers that fetch data through other channels (e.g. an
|
|
7
|
+
* indexer that stores raw blocks).
|
|
8
|
+
*
|
|
9
|
+
* @module query/decoders
|
|
10
|
+
*/
|
|
11
|
+
import { TRANSACTION_TYPE, TXN_STATUS } from '../../proto/generated/txn_pb.js';
|
|
12
|
+
import { bytesToHex } from '../shared/utils/byte-utils.js';
|
|
13
|
+
// ============================================================================
|
|
14
|
+
// SCALED VALUES
|
|
15
|
+
// ============================================================================
|
|
16
|
+
/**
|
|
17
|
+
* Fixed-point scale used by the network for USD rates, currency equivalents,
|
|
18
|
+
* and fee percentages: `1_000_000_000_000_000_000` (1e18) represents
|
|
19
|
+
* `$1.00` (or 100 %).
|
|
20
|
+
*/
|
|
21
|
+
export const USD_SCALE = 10n ** 18n;
|
|
22
|
+
/**
|
|
23
|
+
* Parse a non-negative integer string returned by the node into a `bigint`.
|
|
24
|
+
* Empty strings (proto3 defaults) parse as `0n`.
|
|
25
|
+
*
|
|
26
|
+
* @throws Error if the value is not an unsigned integer string
|
|
27
|
+
*/
|
|
28
|
+
export function parseUintString(value, field = 'value') {
|
|
29
|
+
const trimmed = value.trim();
|
|
30
|
+
if (trimmed === '')
|
|
31
|
+
return 0n;
|
|
32
|
+
if (!/^\d+$/u.test(trimmed)) {
|
|
33
|
+
throw new Error(`${field} is not an unsigned integer: ${JSON.stringify(value)}`);
|
|
34
|
+
}
|
|
35
|
+
return BigInt(trimmed);
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Divide `numerator` by a positive `denominator` and render the exact quotient
|
|
39
|
+
* as a decimal string, truncated (not rounded) to `maxFractionDigits`, with
|
|
40
|
+
* trailing zeros removed and no negative zero.
|
|
41
|
+
*/
|
|
42
|
+
function formatQuotient(numerator, denominator, maxFractionDigits) {
|
|
43
|
+
if (denominator <= 0n)
|
|
44
|
+
throw new Error('denominator must be positive');
|
|
45
|
+
if (!Number.isInteger(maxFractionDigits) || maxFractionDigits < 0) {
|
|
46
|
+
throw new Error('maxFractionDigits must be a non-negative integer');
|
|
47
|
+
}
|
|
48
|
+
const negative = numerator < 0n;
|
|
49
|
+
const abs = negative ? -numerator : numerator;
|
|
50
|
+
const whole = abs / denominator;
|
|
51
|
+
let remainder = abs % denominator;
|
|
52
|
+
let fraction = '';
|
|
53
|
+
for (let i = 0; i < maxFractionDigits && remainder !== 0n; i++) {
|
|
54
|
+
remainder *= 10n;
|
|
55
|
+
fraction += (remainder / denominator).toString();
|
|
56
|
+
remainder %= denominator;
|
|
57
|
+
}
|
|
58
|
+
fraction = fraction.replace(/0+$/u, '');
|
|
59
|
+
const isZero = whole === 0n && fraction === '';
|
|
60
|
+
return `${negative && !isZero ? '-' : ''}${whole}${fraction ? `.${fraction}` : ''}`;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Format a 1e18-scaled integer as a decimal string without floating point.
|
|
64
|
+
*
|
|
65
|
+
* @param scaled - Scaled value (e.g. a `rate` or `currencyEquivalent`)
|
|
66
|
+
* @param maxFractionDigits - Digits kept after the decimal point (default 18,
|
|
67
|
+
* truncated); trailing zeros are removed.
|
|
68
|
+
*
|
|
69
|
+
* @example
|
|
70
|
+
* ```typescript
|
|
71
|
+
* formatScaled(1_500_000_000_000_000_000n); // '1.5'
|
|
72
|
+
* ```
|
|
73
|
+
*/
|
|
74
|
+
export function formatScaled(scaled, maxFractionDigits = 18) {
|
|
75
|
+
return formatQuotient(scaled, USD_SCALE, maxFractionDigits);
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Convert a token amount in smallest units into whole units as a decimal
|
|
79
|
+
* string, using the token's `denomination` (parts per whole token).
|
|
80
|
+
*
|
|
81
|
+
* Works for any positive denomination (not only powers of ten); results that
|
|
82
|
+
* do not terminate are truncated to `maxFractionDigits` (default 18).
|
|
83
|
+
*
|
|
84
|
+
* @example
|
|
85
|
+
* ```typescript
|
|
86
|
+
* partsToWhole(1_500_000_000n, 1_000_000_000n); // '1.5'
|
|
87
|
+
* partsToWhole(1n, 4n); // '0.25'
|
|
88
|
+
* ```
|
|
89
|
+
*/
|
|
90
|
+
export function partsToWhole(parts, denomination, maxFractionDigits = 18) {
|
|
91
|
+
if (denomination <= 0n)
|
|
92
|
+
throw new Error('denomination must be positive');
|
|
93
|
+
return formatQuotient(parts, denomination, maxFractionDigits);
|
|
94
|
+
}
|
|
95
|
+
function readVarint(bytes, offset) {
|
|
96
|
+
let value = 0;
|
|
97
|
+
let shift = 0;
|
|
98
|
+
let cursor = offset;
|
|
99
|
+
for (;;) {
|
|
100
|
+
if (cursor >= bytes.length)
|
|
101
|
+
throw new Error('truncated varint');
|
|
102
|
+
const byte = bytes[cursor];
|
|
103
|
+
cursor += 1;
|
|
104
|
+
value += (byte & 0x7f) * 2 ** shift;
|
|
105
|
+
if ((byte & 0x80) === 0)
|
|
106
|
+
return { value, next: cursor };
|
|
107
|
+
shift += 7;
|
|
108
|
+
if (shift > 49)
|
|
109
|
+
throw new Error('varint too long');
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Decode the `CONTRACT_SUPPLY` database record.
|
|
114
|
+
*
|
|
115
|
+
* The validator stores this record as an internal protobuf message whose
|
|
116
|
+
* schema is not part of the public protos: field 1 is the max supply and
|
|
117
|
+
* field 2 the current supply, both as decimal strings. Field meaning was
|
|
118
|
+
* confirmed against the live network (field 1 equals the contract's
|
|
119
|
+
* `max_supply`).
|
|
120
|
+
*
|
|
121
|
+
* @param value - The raw `DatabaseResponse.value` string (binary protobuf
|
|
122
|
+
* transported as a latin-1 string)
|
|
123
|
+
* @throws Error if the record is malformed
|
|
124
|
+
*/
|
|
125
|
+
export function decodeContractSupply(value) {
|
|
126
|
+
const bytes = Uint8Array.from(value, ch => {
|
|
127
|
+
const code = ch.charCodeAt(0);
|
|
128
|
+
if (code > 0xff)
|
|
129
|
+
throw new Error('contract supply record is not binary protobuf');
|
|
130
|
+
return code;
|
|
131
|
+
});
|
|
132
|
+
const decoder = new TextDecoder();
|
|
133
|
+
const fields = new Map();
|
|
134
|
+
let offset = 0;
|
|
135
|
+
while (offset < bytes.length) {
|
|
136
|
+
const tag = readVarint(bytes, offset);
|
|
137
|
+
const fieldNumber = Math.floor(tag.value / 8);
|
|
138
|
+
const wireType = tag.value % 8;
|
|
139
|
+
if (wireType !== 2)
|
|
140
|
+
throw new Error(`unexpected wire type ${wireType} in contract supply record`);
|
|
141
|
+
const length = readVarint(bytes, tag.next);
|
|
142
|
+
const end = length.next + length.value;
|
|
143
|
+
if (end > bytes.length)
|
|
144
|
+
throw new Error('truncated contract supply record');
|
|
145
|
+
fields.set(fieldNumber, decoder.decode(bytes.subarray(length.next, end)));
|
|
146
|
+
offset = end;
|
|
147
|
+
}
|
|
148
|
+
return {
|
|
149
|
+
maxSupply: parseUintString(fields.get(1) ?? '', 'maxSupply'),
|
|
150
|
+
currentSupply: parseUintString(fields.get(2) ?? '', 'currentSupply')
|
|
151
|
+
};
|
|
152
|
+
}
|
|
153
|
+
// ============================================================================
|
|
154
|
+
// BLOCKS
|
|
155
|
+
// ============================================================================
|
|
156
|
+
/**
|
|
157
|
+
* Mapping of every `TXNS` list field to the transaction type it contains.
|
|
158
|
+
* Result-only lists (`txnFeesAndStatus`, `tokenFees`, …) are excluded.
|
|
159
|
+
*/
|
|
160
|
+
const TXNS_LIST_TYPES = {
|
|
161
|
+
coinTxns: TRANSACTION_TYPE.COIN_TYPE,
|
|
162
|
+
mintTxns: TRANSACTION_TYPE.MINT_TYPE,
|
|
163
|
+
itemMintTxns: TRANSACTION_TYPE.ITEM_MINT_TYPE,
|
|
164
|
+
contractTxns: TRANSACTION_TYPE.CONTRACT_TXN_TYPE,
|
|
165
|
+
governanceVotes: TRANSACTION_TYPE.VOTE_TYPE,
|
|
166
|
+
governanceProposals: TRANSACTION_TYPE.PROPOSAL_TYPE,
|
|
167
|
+
smartContracts: TRANSACTION_TYPE.SMART_CONTRACT_TYPE,
|
|
168
|
+
smartContractExecutes: TRANSACTION_TYPE.SMART_CONTRACT_EXECUTE_TYPE,
|
|
169
|
+
expenseRatios: TRANSACTION_TYPE.EXPENSE_RATIO_TYPE,
|
|
170
|
+
nftTxns: TRANSACTION_TYPE.NFT_TYPE,
|
|
171
|
+
contractUpdateTxns: TRANSACTION_TYPE.UPDATE_CONTRACT_TYPE,
|
|
172
|
+
validatorRegistrationTxns: TRANSACTION_TYPE.VALIDATOR_REGISTRATION_TYPE,
|
|
173
|
+
validatorHeartbeatTxns: TRANSACTION_TYPE.VALIDATOR_HEARTBEAT_TYPE,
|
|
174
|
+
proposalResultTxns: TRANSACTION_TYPE.PROPOSAL_RESULT_TYPE,
|
|
175
|
+
delegatedVotingTxns: TRANSACTION_TYPE.DELEGATED_VOTING_TYPE,
|
|
176
|
+
quashTxns: TRANSACTION_TYPE.QUASH_TYPE,
|
|
177
|
+
revokeTxns: TRANSACTION_TYPE.REVOKE_TYPE,
|
|
178
|
+
complianceTxns: TRANSACTION_TYPE.COMPLIANCE_TYPE,
|
|
179
|
+
burnSbtTxns: TRANSACTION_TYPE.SBT_BURN_TYPE,
|
|
180
|
+
smartContractInstantiateTxns: TRANSACTION_TYPE.SMART_CONTRACT_INSTANTIATE_TYPE,
|
|
181
|
+
allowanceTxns: TRANSACTION_TYPE.ALLOWANCE_TYPE,
|
|
182
|
+
proposalCancelTxns: TRANSACTION_TYPE.PROPOSAL_CANCEL_TYPE
|
|
183
|
+
};
|
|
184
|
+
/**
|
|
185
|
+
* Flatten every transaction in a block's `TXNS` container into a single list.
|
|
186
|
+
*
|
|
187
|
+
* Ordering follows the `TXNS` field order, then in-list order.
|
|
188
|
+
*/
|
|
189
|
+
export function listBlockTransactions(block) {
|
|
190
|
+
const txns = block.transactions;
|
|
191
|
+
if (!txns)
|
|
192
|
+
return [];
|
|
193
|
+
const result = [];
|
|
194
|
+
const push = (type, list, txn) => {
|
|
195
|
+
const hashBytes = txn.base?.hash;
|
|
196
|
+
result.push({ type, list, hash: hashBytes ? bytesToHex(hashBytes) : '', txn });
|
|
197
|
+
};
|
|
198
|
+
for (const [list, type] of Object.entries(TXNS_LIST_TYPES)) {
|
|
199
|
+
for (const txn of txns[list])
|
|
200
|
+
push(type, list, txn);
|
|
201
|
+
}
|
|
202
|
+
// The only singular transaction field in TXNS.
|
|
203
|
+
if (txns.requiredVersionTxn) {
|
|
204
|
+
push(TRANSACTION_TYPE.REQUIRED_VERSION, 'requiredVersionTxn', txns.requiredVersionTxn);
|
|
205
|
+
}
|
|
206
|
+
return result;
|
|
207
|
+
}
|
|
208
|
+
/** Convert a raw `TXNStatusFees` record into a {@link TransactionResult}. */
|
|
209
|
+
export function toTransactionResult(raw) {
|
|
210
|
+
return {
|
|
211
|
+
hash: bytesToHex(raw.txnHash),
|
|
212
|
+
status: raw.status,
|
|
213
|
+
statusName: TXN_STATUS[raw.status] ?? `UNKNOWN_${raw.status}`,
|
|
214
|
+
success: raw.status === TXN_STATUS.OK,
|
|
215
|
+
baseFees: parseUintString(raw.baseFees, 'baseFees'),
|
|
216
|
+
baseFeeContractId: raw.baseContractId,
|
|
217
|
+
...(raw.contractFees !== undefined ? { contractFees: parseUintString(raw.contractFees, 'contractFees') } : {}),
|
|
218
|
+
...(raw.contractContractId !== undefined ? { contractFeeContractId: raw.contractContractId } : {}),
|
|
219
|
+
...(raw.gas !== undefined ? { gas: raw.gas } : {}),
|
|
220
|
+
...(raw.proposalIdentifier !== undefined ? { proposalIdentifier: raw.proposalIdentifier } : {}),
|
|
221
|
+
raw
|
|
222
|
+
};
|
|
223
|
+
}
|
|
224
|
+
/**
|
|
225
|
+
* Find the processing result of a transaction inside a block.
|
|
226
|
+
*
|
|
227
|
+
* @param block - Block to search
|
|
228
|
+
* @param txnHash - Hex transaction hash (optionally `0x`-prefixed, any case)
|
|
229
|
+
* @returns The result, or `undefined` if the block does not contain it
|
|
230
|
+
*/
|
|
231
|
+
export function findTransactionResult(block, txnHash) {
|
|
232
|
+
const wanted = txnHash.toLowerCase().replace(/^0x/u, '');
|
|
233
|
+
const raw = block.transactions?.txnFeesAndStatus.find(entry => bytesToHex(entry.txnHash) === wanted);
|
|
234
|
+
return raw ? toTransactionResult(raw) : undefined;
|
|
235
|
+
}
|
|
236
|
+
/** Summarise a block into plain values (hex hashes, `Date`, counts). */
|
|
237
|
+
export function summarizeBlock(block) {
|
|
238
|
+
const header = block.blockHeader;
|
|
239
|
+
const transactions = listBlockTransactions(block);
|
|
240
|
+
const transactionsByType = {};
|
|
241
|
+
for (const { type } of transactions) {
|
|
242
|
+
const name = TRANSACTION_TYPE[type] ?? `TYPE_${type}`;
|
|
243
|
+
transactionsByType[name] = (transactionsByType[name] ?? 0) + 1;
|
|
244
|
+
}
|
|
245
|
+
const ts = header?.timestamp;
|
|
246
|
+
return {
|
|
247
|
+
height: header?.blockHeight ?? 0n,
|
|
248
|
+
hash: header?.hash ? bytesToHex(header.hash) : '',
|
|
249
|
+
previousHash: header?.previousBlockHash ? bytesToHex(header.previousBlockHash) : '',
|
|
250
|
+
timestamp: ts ? new Date(Number(ts.seconds) * 1000 + Math.floor(ts.nanos / 1000000)) : undefined,
|
|
251
|
+
version: header?.version,
|
|
252
|
+
transactionCount: transactions.length,
|
|
253
|
+
transactionsByType,
|
|
254
|
+
results: (block.transactions?.txnFeesAndStatus ?? []).map(toTransactionResult)
|
|
255
|
+
};
|
|
256
|
+
}
|
|
257
|
+
//# sourceMappingURL=decoders.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"decoders.js","sourceRoot":"","sources":["../../../src/query/decoders.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EACL,gBAAgB,EAChB,UAAU,EAGX,MAAM,iCAAiC,CAAC;AAEzC,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAE3D,+EAA+E;AAC/E,gBAAgB;AAChB,+EAA+E;AAE/E;;;;GAIG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,GAAG,IAAI,GAAG,CAAC;AAEpC;;;;;GAKG;AACH,MAAM,UAAU,eAAe,CAAC,KAAa,EAAE,KAAK,GAAG,OAAO;IAC5D,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;IAC7B,IAAI,OAAO,KAAK,EAAE;QAAE,OAAO,EA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E,CAAC,CAAC,GAAG,CAAC,mBAAmB,CAAC;KAC/E,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Guardian Query Client — read RPCs of the bridge guardian's `GuardianService`.
|
|
3
|
+
*
|
|
4
|
+
* Guardians attest cross-chain bridge activity between Kalvora and Solana.
|
|
5
|
+
* This client exposes the public, read-only guardian RPCs:
|
|
6
|
+
*
|
|
7
|
+
* | Method | RPC | Purpose |
|
|
8
|
+
* |-------------------------|-----------------|---------------------------------------------|
|
|
9
|
+
* | {@link getPayload} | `GetPayload` | Signed bridge payload (VAA) for one txn |
|
|
10
|
+
* | {@link searchPayloads} | `SearchPayload` | All payloads since a time |
|
|
11
|
+
* | {@link getPriceData} | `GetPriceData` | Guardian-cached token price / liquidity |
|
|
12
|
+
* | {@link getMintInfo} | `GetMintInfo` | Kalvora contract ID → Solana mint address |
|
|
13
|
+
*
|
|
14
|
+
* `AuthenticateGuardian` is guardian-to-guardian and is not wrapped.
|
|
15
|
+
* Higher-level VAA helpers (retrying fetch, submission to Solana/Kalvora)
|
|
16
|
+
* live in the bridge module (`guardianBridge`).
|
|
17
|
+
*
|
|
18
|
+
* @module query/guardian-client
|
|
19
|
+
*/
|
|
20
|
+
import type { Client } from '@connectrpc/connect';
|
|
21
|
+
import { GuardianService, NETWORK_TYPE, type PayloadResponse, type PriceData, type SearchPayloadResponse } from '../../proto/generated/guardian_pb.js';
|
|
22
|
+
import type { GRPCConfig } from '../types/index.js';
|
|
23
|
+
/** Price data cached by a guardian. USD values use the guardian's `USD_MULTIPLIER` scale. */
|
|
24
|
+
export interface GuardianPriceData {
|
|
25
|
+
/** `true` when the guardian holds a cached price for the mint. */
|
|
26
|
+
hasPrice: boolean;
|
|
27
|
+
/** The cached price record (present when `hasPrice`). */
|
|
28
|
+
priceData: PriceData | undefined;
|
|
29
|
+
/** Responding guardian's Kalvora public key. */
|
|
30
|
+
guardianKey: string;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Typed client for the bridge guardian's `GuardianService`.
|
|
34
|
+
* Construct with {@link createGuardianQueryClient}.
|
|
35
|
+
*/
|
|
36
|
+
export declare class GuardianQueryClient {
|
|
37
|
+
/** Raw generated ConnectRPC client (errors normalised to `KalvoraRpcError`). */
|
|
38
|
+
readonly raw: Client<typeof GuardianService>;
|
|
39
|
+
/** @param config - Guardian endpoint / transport configuration */
|
|
40
|
+
constructor(config?: GRPCConfig);
|
|
41
|
+
/**
|
|
42
|
+
* Fetch the guardian-signed payload for one bridge transaction.
|
|
43
|
+
*
|
|
44
|
+
* @param payloadId - Kalvora transaction hash (hex) or Solana transaction signature
|
|
45
|
+
* @param network - Chain the source transaction happened on
|
|
46
|
+
* (`NETWORK_TYPE_KALVORA` or `NETWORK_TYPE.SOLANA`)
|
|
47
|
+
*/
|
|
48
|
+
getPayload(payloadId: string, network: NETWORK_TYPE): Promise<PayloadResponse>;
|
|
49
|
+
/** All payloads (both directions) produced since `since`. */
|
|
50
|
+
searchPayloads(since: Date): Promise<SearchPayloadResponse>;
|
|
51
|
+
/**
|
|
52
|
+
* Guardian-cached price data for a Solana mint.
|
|
53
|
+
*
|
|
54
|
+
* @param mintAddress - Solana token mint address
|
|
55
|
+
* @param txnHash - Optional bridge transaction signature for context
|
|
56
|
+
*/
|
|
57
|
+
getPriceData(mintAddress: string, txnHash?: string): Promise<GuardianPriceData>;
|
|
58
|
+
/**
|
|
59
|
+
* Resolve Kalvora contract IDs to their Solana mint addresses.
|
|
60
|
+
*
|
|
61
|
+
* @returns Map of contract ID → Solana mint address (unknown IDs are omitted)
|
|
62
|
+
*/
|
|
63
|
+
getMintInfo(contractIds: string[]): Promise<Map<string, string>>;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Create a {@link GuardianQueryClient}.
|
|
67
|
+
*
|
|
68
|
+
* @param config - Guardian endpoint / transport configuration
|
|
69
|
+
*/
|
|
70
|
+
export declare function createGuardianQueryClient(config?: GRPCConfig): GuardianQueryClient;
|
|
71
|
+
export { NETWORK_TYPE };
|
|
72
|
+
export { NETWORK_TYPE_KALVORA } from '../protocol/guardian-names.js';
|
|
73
|
+
//# sourceMappingURL=guardian-client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"guardian-client.d.ts","sourceRoot":"","sources":["../../../src/query/guardian-client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAGH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAGlD,OAAO,EAEL,eAAe,EACf,YAAY,EAIZ,KAAK,eAAe,EACpB,KAAK,SAAS,EACd,KAAK,qBAAqB,EAC3B,MAAM,sCAAsC,CAAC;AAG9C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAEpD,6FAA6F;AAC7F,MAAM,WAAW,iBAAiB;IAChC,kEAAkE;IAClE,QAAQ,EAAE,OAAO,CAAC;IAClB,yDAAyD;IACzD,SAAS,EAAE,SAAS,GAAG,SAAS,CAAC;IACjC,gDAAgD;IAChD,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;;GAGG;AACH,qBAAa,mBAAmB;IAC9B,gFAAgF;IAChF,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC,OAAO,eAAe,CAAC,CAAC;IAE7C,kEAAkE;gBACtD,MAAM,GAAE,UAAe;IAInC;;;;;;OAMG;IACG,UAAU,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,eAAe,CAAC;IAOpF,6DAA6D;IACvD,cAAc,CAAC,KAAK,EAAE,IAAI,GAAG,OAAO,CAAC,qBAAqB,CAAC;IAMjE;;;;;OAKG;IACG,YAAY,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,SAAK,GAAG,OAAO,CAAC,iBAAiB,CAAC;IASjF;;;;OAIG;IACG,WAAW,CAAC,WAAW,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAOvE;AAED;;;;GAIG;AACH,wBAAgB,yBAAyB,CAAC,MAAM,GAAE,UAAe,GAAG,mBAAmB,CAEtF;AAED,OAAO,EAAE,YAAY,EAAE,CAAC;AACxB,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Guardian Query Client — read RPCs of the bridge guardian's `GuardianService`.
|
|
3
|
+
*
|
|
4
|
+
* Guardians attest cross-chain bridge activity between Kalvora and Solana.
|
|
5
|
+
* This client exposes the public, read-only guardian RPCs:
|
|
6
|
+
*
|
|
7
|
+
* | Method | RPC | Purpose |
|
|
8
|
+
* |-------------------------|-----------------|---------------------------------------------|
|
|
9
|
+
* | {@link getPayload} | `GetPayload` | Signed bridge payload (VAA) for one txn |
|
|
10
|
+
* | {@link searchPayloads} | `SearchPayload` | All payloads since a time |
|
|
11
|
+
* | {@link getPriceData} | `GetPriceData` | Guardian-cached token price / liquidity |
|
|
12
|
+
* | {@link getMintInfo} | `GetMintInfo` | Kalvora contract ID → Solana mint address |
|
|
13
|
+
*
|
|
14
|
+
* `AuthenticateGuardian` is guardian-to-guardian and is not wrapped.
|
|
15
|
+
* Higher-level VAA helpers (retrying fetch, submission to Solana/Kalvora)
|
|
16
|
+
* live in the bridge module (`guardianBridge`).
|
|
17
|
+
*
|
|
18
|
+
* @module query/guardian-client
|
|
19
|
+
*/
|
|
20
|
+
import { create } from '@bufbuild/protobuf';
|
|
21
|
+
import { TimestampSchema } from '../../proto/generated/google/protobuf/timestamp_pb.js';
|
|
22
|
+
import { GetMintInfoRequestSchema, GuardianService, NETWORK_TYPE, PayloadRequestSchema, PriceDataRequestSchema, SearchPayloadRequestSchema } from '../../proto/generated/guardian_pb.js';
|
|
23
|
+
import { createClient } from '../grpc/client-factory.js';
|
|
24
|
+
import { toTimestampInit } from '../shared/tx/standard.js';
|
|
25
|
+
/**
|
|
26
|
+
* Typed client for the bridge guardian's `GuardianService`.
|
|
27
|
+
* Construct with {@link createGuardianQueryClient}.
|
|
28
|
+
*/
|
|
29
|
+
export class GuardianQueryClient {
|
|
30
|
+
/** @param config - Guardian endpoint / transport configuration */
|
|
31
|
+
constructor(config = {}) {
|
|
32
|
+
this.raw = createClient(GuardianService, config);
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Fetch the guardian-signed payload for one bridge transaction.
|
|
36
|
+
*
|
|
37
|
+
* @param payloadId - Kalvora transaction hash (hex) or Solana transaction signature
|
|
38
|
+
* @param network - Chain the source transaction happened on
|
|
39
|
+
* (`NETWORK_TYPE_KALVORA` or `NETWORK_TYPE.SOLANA`)
|
|
40
|
+
*/
|
|
41
|
+
async getPayload(payloadId, network) {
|
|
42
|
+
if (typeof payloadId !== 'string' || payloadId.trim() === '') {
|
|
43
|
+
throw new Error('payloadId must be a non-empty string');
|
|
44
|
+
}
|
|
45
|
+
return this.raw.getPayload(create(PayloadRequestSchema, { payloadId, networkType: network }));
|
|
46
|
+
}
|
|
47
|
+
/** All payloads (both directions) produced since `since`. */
|
|
48
|
+
async searchPayloads(since) {
|
|
49
|
+
return this.raw.searchPayload(create(SearchPayloadRequestSchema, {
|
|
50
|
+
searchStartTime: create(TimestampSchema, toTimestampInit(since, 'since'))
|
|
51
|
+
}));
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Guardian-cached price data for a Solana mint.
|
|
55
|
+
*
|
|
56
|
+
* @param mintAddress - Solana token mint address
|
|
57
|
+
* @param txnHash - Optional bridge transaction signature for context
|
|
58
|
+
*/
|
|
59
|
+
async getPriceData(mintAddress, txnHash = '') {
|
|
60
|
+
if (typeof mintAddress !== 'string' || mintAddress.trim() === '') {
|
|
61
|
+
throw new Error('mintAddress must be a non-empty string');
|
|
62
|
+
}
|
|
63
|
+
const response = await this.raw.getPriceData(create(PriceDataRequestSchema, { mintAddress, txnHash }));
|
|
64
|
+
// `zeraKey` is the generated name of the guardian proto's key field.
|
|
65
|
+
return { hasPrice: response.hasPrice, priceData: response.priceData, guardianKey: response.zeraKey };
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Resolve Kalvora contract IDs to their Solana mint addresses.
|
|
69
|
+
*
|
|
70
|
+
* @returns Map of contract ID → Solana mint address (unknown IDs are omitted)
|
|
71
|
+
*/
|
|
72
|
+
async getMintInfo(contractIds) {
|
|
73
|
+
if (!Array.isArray(contractIds) || contractIds.length === 0) {
|
|
74
|
+
throw new Error('contractIds must be a non-empty array');
|
|
75
|
+
}
|
|
76
|
+
const response = await this.raw.getMintInfo(create(GetMintInfoRequestSchema, { contractIds }));
|
|
77
|
+
return new Map(response.mintInfos.map(info => [info.contractId, info.mintAddress]));
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Create a {@link GuardianQueryClient}.
|
|
82
|
+
*
|
|
83
|
+
* @param config - Guardian endpoint / transport configuration
|
|
84
|
+
*/
|
|
85
|
+
export function createGuardianQueryClient(config = {}) {
|
|
86
|
+
return new GuardianQueryClient(config);
|
|
87
|
+
}
|
|
88
|
+
export { NETWORK_TYPE };
|
|
89
|
+
export { NETWORK_TYPE_KALVORA } from '../protocol/guardian-names.js';
|
|
90
|
+
//# sourceMappingURL=guardian-client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"guardian-client.js","sourceRoot":"","sources":["../../../src/query/guardian-client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAG5C,OAAO,EAAE,eAAe,EAAE,MAAM,uDAAuD,CAAC;AACxF,OAAO,EACL,wBAAwB,EACxB,eAAe,EACf,YAAY,EACZ,oBAAoB,EACpB,sBAAsB,EACtB,0BAA0B,EAI3B,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,YAA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;QACvG,qEAAqE;QACrE,OAAO,EAAE,QAAQ,EAAE,QAAQ,CAAC,QAAQ,EAAE,SAAS,EAAE,QAAQ,CAAC,SAAS,EAAE,WAAW,EAAE,QAAQ,CAAC,OAAO,EAAE,CAAC;IACvG,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,WAAW,CAAC,WAAqB;QACrC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAC5D,MAAM,IAAI,KAAK,CAAC,uCAAuC,CAAC,CAAC;QAC3D,CAAC;QACD,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,GAAG,CAAC,WAAW,CAAC,MAAM,CAAC,wBAAwB,EAAE,EAAE,WAAW,EAAE,CAAC,CAAC,CAAC;QAC/F,OAAO,IAAI,GAAG,CAAC,QAAQ,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;IACtF,CAAC;CACF;AAED;;;;GAIG;AACH,MAAM,UAAU,yBAAyB,CAAC,SAAqB,EAAE;IAC/D,OAAO,IAAI,mBAAmB,CAAC,MAAM,CAAC,CAAC;AACzC,CAAC;AAED,OAAO,EAAE,YAAY,EAAE,CAAC;AACxB,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Query Module — typed, read-only access to Kalvora network state.
|
|
3
|
+
*
|
|
4
|
+
* - {@link KalvoraQueryClient}: `APIService` (wallets, contracts, fees,
|
|
5
|
+
* blocks, governance ledger, smart contract events, raw database).
|
|
6
|
+
* - {@link ValidatorQueryClient}: read-only `ValidatorService` subset.
|
|
7
|
+
* - {@link GuardianQueryClient}: bridge guardian payloads, prices, mint info.
|
|
8
|
+
* - Pure decoders for blocks, transaction results, and scaled values.
|
|
9
|
+
*
|
|
10
|
+
* @module query
|
|
11
|
+
*/
|
|
12
|
+
export { KalvoraQueryClient, createQueryClient, CONFIRMATION_LEVEL, DATABASE_TYPE, PROPOSAL_TYPE, PROPOSAL_PHASE, PRE_GOVERNANCE_OUTCOME, type AuthorizedFeeToken, type BaseFeeInfo, type BlockSelector, type ConfirmedTransaction, type ContractFeeInfo, type ContractInfo, type ProposalLedgerView, type ProposalStatusView, type SmartContractEvent, type TokenBalance, type TokenFeeInfo, type WaitForTransactionOptions, type WalletItem } from './api-client.js';
|
|
13
|
+
export { ValidatorQueryClient, createValidatorQueryClient, type CheckpointInfo } from './validator-client.js';
|
|
14
|
+
export { GuardianQueryClient, createGuardianQueryClient, NETWORK_TYPE, NETWORK_TYPE_KALVORA, type GuardianPriceData } from './guardian-client.js';
|
|
15
|
+
export { USD_SCALE, decodeContractSupply, findTransactionResult, formatScaled, listBlockTransactions, parseUintString, partsToWhole, summarizeBlock, toTransactionResult, type BlockSummary, type BlockTransaction, type ContractSupply, type TransactionResult } from './decoders.js';
|
|
16
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/query/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EACL,kBAAkB,EAClB,iBAAiB,EACjB,kBAAkB,EAClB,aAAa,EACb,aAAa,EACb,cAAc,EACd,sBAAsB,EACtB,KAAK,kBAAkB,EACvB,KAAK,WAAW,EAChB,KAAK,aAAa,EAClB,KAAK,oBAAoB,EACzB,KAAK,eAAe,EACpB,KAAK,YAAY,EACjB,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACvB,KAAK,YAAY,EACjB,KAAK,YAAY,EACjB,KAAK,yBAAyB,EAC9B,KAAK,UAAU,EAChB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EACL,oBAAoB,EACpB,0BAA0B,EAC1B,KAAK,cAAc,EACpB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EACL,mBAAmB,EACnB,yBAAyB,EACzB,YAAY,EACZ,oBAAoB,EACpB,KAAK,iBAAiB,EACvB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EACL,SAAS,EACT,oBAAoB,EACpB,qBAAqB,EACrB,YAAY,EACZ,qBAAqB,EACrB,eAAe,EACf,YAAY,EACZ,cAAc,EACd,mBAAmB,EACnB,KAAK,YAAY,EACjB,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACnB,KAAK,iBAAiB,EACvB,MAAM,eAAe,CAAC"}
|