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,276 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Item Transaction Module
|
|
3
|
+
*
|
|
4
|
+
* Creates, builds, and submits item-level transactions for NFT and SBT
|
|
5
|
+
* contracts on the Kalvora network.
|
|
6
|
+
*
|
|
7
|
+
* `buildItemizedMintTXN()`, `buildNFTTXN()`, and `buildBurnSBTTXN()` construct
|
|
8
|
+
* unsigned transactions. The matching `create*` functions are convenience
|
|
9
|
+
* wrappers that build and sign with a private key.
|
|
10
|
+
*/
|
|
11
|
+
import { protoInt64, create } from '@bufbuild/protobuf';
|
|
12
|
+
import { BurnSBTTXNSchema, ItemContractFeesSchema, ItemizedMintTXNSchema, KeyValuePairSchema, NFTTXNSchema } from '../../proto/generated/txn_pb.js';
|
|
13
|
+
import { validateKeyPair } from '../contract/shared/utils.js';
|
|
14
|
+
import { submitTransaction } from '../grpc/transaction/transaction-client.js';
|
|
15
|
+
import { generateAddressFromPublicKey, sanitizeAndDecodeAddress } from '../shared/crypto/address-utils.js';
|
|
16
|
+
import { UniversalFeeCalculator } from '../shared/fee-calculators/universal-fee-calculator.js';
|
|
17
|
+
import { logger } from '../shared/monitoring/index.js';
|
|
18
|
+
import { KALVORA_NATIVE_TOKEN } from '../shared/network/constants.js';
|
|
19
|
+
import { buildStandardBaseTXN, getAddressAndNonce } from '../shared/tx/base.js';
|
|
20
|
+
import { PROTONET_GRPC_CONFIG } from '../shared/utils/testing-defaults/index.js';
|
|
21
|
+
import { isValidContractId } from '../shared/utils/validation.js';
|
|
22
|
+
import { signWithKey } from '../sign/finalize.js';
|
|
23
|
+
// ============================================================================
|
|
24
|
+
// INTERNAL HELPERS
|
|
25
|
+
// ============================================================================
|
|
26
|
+
function validateItemIdentifiers(contractId, itemId) {
|
|
27
|
+
if (!contractId || !isValidContractId(contractId)) {
|
|
28
|
+
throw new Error('ContractId must be a valid Kalvora mint ID (e.g., KALXvxhUMJERCse4e6b2jeXFkcqqpiUByQQckvPZm4szmF3Ao)');
|
|
29
|
+
}
|
|
30
|
+
if (!itemId || itemId.trim() === '') {
|
|
31
|
+
throw new Error('itemId is required');
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
function validatePublicKey(publicKeyBase58Identifier) {
|
|
35
|
+
if (!publicKeyBase58Identifier) {
|
|
36
|
+
throw new Error('publicKeyBase58Identifier is required');
|
|
37
|
+
}
|
|
38
|
+
generateAddressFromPublicKey(publicKeyBase58Identifier);
|
|
39
|
+
}
|
|
40
|
+
function parseOptionalUint64(value, fieldName) {
|
|
41
|
+
if (value === undefined)
|
|
42
|
+
return undefined;
|
|
43
|
+
try {
|
|
44
|
+
return protoInt64.uParse(String(value));
|
|
45
|
+
}
|
|
46
|
+
catch (error) {
|
|
47
|
+
throw new Error(`${fieldName} must be a valid uint64 value: ${error.message}`);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
async function buildBaseForItemTXN(operation, publicKeyBase58Identifier, options) {
|
|
51
|
+
const grpcConfig = options.grpcConfig || PROTONET_GRPC_CONFIG;
|
|
52
|
+
let nonce;
|
|
53
|
+
if (options.nonce !== undefined) {
|
|
54
|
+
nonce = protoInt64.uParse(String(options.nonce));
|
|
55
|
+
logger.warn('Manual nonce specified - skipping network nonce fetch.', {
|
|
56
|
+
operation,
|
|
57
|
+
nonce: String(options.nonce)
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
else {
|
|
61
|
+
const result = await getAddressAndNonce(publicKeyBase58Identifier, grpcConfig);
|
|
62
|
+
nonce = result.nonce;
|
|
63
|
+
}
|
|
64
|
+
const baseParams = {
|
|
65
|
+
publicKeyId: publicKeyBase58Identifier,
|
|
66
|
+
nonce
|
|
67
|
+
};
|
|
68
|
+
if (options.memo)
|
|
69
|
+
baseParams.memo = options.memo;
|
|
70
|
+
if (options.feeId !== undefined)
|
|
71
|
+
baseParams.feeId = options.feeId;
|
|
72
|
+
if (options.feeAmountParts !== undefined)
|
|
73
|
+
baseParams.feeAmountParts = options.feeAmountParts;
|
|
74
|
+
return buildStandardBaseTXN(baseParams);
|
|
75
|
+
}
|
|
76
|
+
function buildFeeOptions(txn, options) {
|
|
77
|
+
const effectiveFeeId = options.feeId || KALVORA_NATIVE_TOKEN;
|
|
78
|
+
return {
|
|
79
|
+
protoObject: txn,
|
|
80
|
+
tokenInfoMap: new Map(),
|
|
81
|
+
baseFeeId: effectiveFeeId,
|
|
82
|
+
...(options.grpcConfig ? { grpcConfig: options.grpcConfig } : {}),
|
|
83
|
+
...(options.feeAmountParts !== undefined && { baseFeeParts: options.feeAmountParts }),
|
|
84
|
+
...(options.overestimatePercent !== undefined && { overestimatePercent: options.overestimatePercent })
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
function buildParameters(parameters) {
|
|
88
|
+
if (!parameters?.length)
|
|
89
|
+
return [];
|
|
90
|
+
return parameters.map((parameter, index) => {
|
|
91
|
+
if (!parameter.key || parameter.key.trim() === '') {
|
|
92
|
+
throw new Error(`parameters[${index}].key is required`);
|
|
93
|
+
}
|
|
94
|
+
if (parameter.value === undefined || parameter.value === null) {
|
|
95
|
+
throw new Error(`parameters[${index}].value is required`);
|
|
96
|
+
}
|
|
97
|
+
return create(KeyValuePairSchema, {
|
|
98
|
+
key: parameter.key,
|
|
99
|
+
value: parameter.value
|
|
100
|
+
});
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
function buildItemContractFees(fees) {
|
|
104
|
+
if (!fees)
|
|
105
|
+
return undefined;
|
|
106
|
+
if (!fees.fee || !fees.burn || !fees.validator) {
|
|
107
|
+
throw new Error('contractFees must include fee, burn, and validator');
|
|
108
|
+
}
|
|
109
|
+
const feeData = {
|
|
110
|
+
fee: fees.fee,
|
|
111
|
+
burn: fees.burn,
|
|
112
|
+
validator: fees.validator
|
|
113
|
+
};
|
|
114
|
+
const inputFeeAddress = fees.feeAddress;
|
|
115
|
+
if (typeof inputFeeAddress === 'string') {
|
|
116
|
+
feeData.feeAddress = sanitizeAndDecodeAddress(inputFeeAddress);
|
|
117
|
+
}
|
|
118
|
+
else if (inputFeeAddress instanceof Uint8Array) {
|
|
119
|
+
feeData.feeAddress = inputFeeAddress;
|
|
120
|
+
}
|
|
121
|
+
if (fees.allowedFeeInstrument?.length) {
|
|
122
|
+
feeData.allowedFeeInstrument = fees.allowedFeeInstrument;
|
|
123
|
+
}
|
|
124
|
+
return create(ItemContractFeesSchema, feeData);
|
|
125
|
+
}
|
|
126
|
+
function hashOrFallback(txn, fallback) {
|
|
127
|
+
return txn.base?.hash
|
|
128
|
+
? Array.from(txn.base.hash).map(b => b.toString(16).padStart(2, '0')).join('')
|
|
129
|
+
: fallback;
|
|
130
|
+
}
|
|
131
|
+
// ============================================================================
|
|
132
|
+
// PUBLIC API - ITEMIZED MINT
|
|
133
|
+
// ============================================================================
|
|
134
|
+
/**
|
|
135
|
+
* Build an unsigned ItemizedMintTXN.
|
|
136
|
+
*
|
|
137
|
+
* Use this to mint NFT/SBT collection items while keeping signing external.
|
|
138
|
+
*/
|
|
139
|
+
export async function buildItemizedMintTXN(options) {
|
|
140
|
+
validateItemIdentifiers(options.contractId, options.itemId);
|
|
141
|
+
validatePublicKey(options.publicKeyBase58Identifier);
|
|
142
|
+
if (!options.recipientAddress)
|
|
143
|
+
throw new Error('recipientAddress is required');
|
|
144
|
+
const recipientAddress = sanitizeAndDecodeAddress(options.recipientAddress);
|
|
145
|
+
const base = await buildBaseForItemTXN('buildItemizedMintTXN', options.publicKeyBase58Identifier, options);
|
|
146
|
+
const parameters = buildParameters(options.parameters);
|
|
147
|
+
const expiry = parseOptionalUint64(options.expiry, 'expiry');
|
|
148
|
+
const validFrom = parseOptionalUint64(options.validFrom, 'validFrom');
|
|
149
|
+
const contractFees = buildItemContractFees(options.contractFees);
|
|
150
|
+
const mintData = {
|
|
151
|
+
base,
|
|
152
|
+
contractId: options.contractId,
|
|
153
|
+
itemId: options.itemId,
|
|
154
|
+
recipientAddress
|
|
155
|
+
};
|
|
156
|
+
if (options.votingWeight !== undefined)
|
|
157
|
+
mintData.votingWeight = options.votingWeight;
|
|
158
|
+
if (parameters.length)
|
|
159
|
+
mintData.parameters = parameters;
|
|
160
|
+
if (expiry !== undefined)
|
|
161
|
+
mintData.expiry = expiry;
|
|
162
|
+
if (contractFees)
|
|
163
|
+
mintData.contractFees = contractFees;
|
|
164
|
+
if (validFrom !== undefined)
|
|
165
|
+
mintData.validFrom = validFrom;
|
|
166
|
+
const mintTxn = create(ItemizedMintTXNSchema, mintData);
|
|
167
|
+
await UniversalFeeCalculator.calculateFee(buildFeeOptions(mintTxn, options));
|
|
168
|
+
return mintTxn;
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* Create and sign an ItemizedMintTXN.
|
|
172
|
+
*/
|
|
173
|
+
export async function createItemizedMintTXN(options) {
|
|
174
|
+
validateKeyPair({
|
|
175
|
+
publicKeyBase58Identifier: options.publicKeyBase58Identifier,
|
|
176
|
+
privateKeyBase58: options.privateKeyBase58
|
|
177
|
+
});
|
|
178
|
+
const { privateKeyBase58, ...unsignedOptions } = options;
|
|
179
|
+
const mintTxn = await buildItemizedMintTXN(unsignedOptions);
|
|
180
|
+
signWithKey(mintTxn, privateKeyBase58, options.publicKeyBase58Identifier);
|
|
181
|
+
return mintTxn;
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* Submit an ItemizedMintTXN to the network.
|
|
185
|
+
*/
|
|
186
|
+
export async function sendItemizedMintTXN(txn, grpcConfig = {}) {
|
|
187
|
+
await submitTransaction(txn, grpcConfig);
|
|
188
|
+
return hashOrFallback(txn, 'Itemized mint submitted (no hash available)');
|
|
189
|
+
}
|
|
190
|
+
// Common "item mint" aliases for callers who do not use the protobuf name.
|
|
191
|
+
// ============================================================================
|
|
192
|
+
// PUBLIC API - NFT TRANSFER
|
|
193
|
+
// ============================================================================
|
|
194
|
+
/**
|
|
195
|
+
* Build an unsigned NFTTXN.
|
|
196
|
+
*/
|
|
197
|
+
export async function buildNFTTXN(options) {
|
|
198
|
+
validateItemIdentifiers(options.contractId, options.itemId);
|
|
199
|
+
validatePublicKey(options.publicKeyBase58Identifier);
|
|
200
|
+
if (!options.recipientAddress)
|
|
201
|
+
throw new Error('recipientAddress is required');
|
|
202
|
+
const recipientAddress = sanitizeAndDecodeAddress(options.recipientAddress);
|
|
203
|
+
const base = await buildBaseForItemTXN('buildNFTTXN', options.publicKeyBase58Identifier, options);
|
|
204
|
+
const nftData = {
|
|
205
|
+
base,
|
|
206
|
+
contractId: options.contractId,
|
|
207
|
+
itemId: options.itemId,
|
|
208
|
+
recipientAddress
|
|
209
|
+
};
|
|
210
|
+
if (options.contractFeeId !== undefined)
|
|
211
|
+
nftData.contractFeeId = options.contractFeeId;
|
|
212
|
+
if (options.contractFeeAmountParts !== undefined)
|
|
213
|
+
nftData.contractFeeAmount = options.contractFeeAmountParts;
|
|
214
|
+
const nftTxn = create(NFTTXNSchema, nftData);
|
|
215
|
+
await UniversalFeeCalculator.calculateFee(buildFeeOptions(nftTxn, options));
|
|
216
|
+
return nftTxn;
|
|
217
|
+
}
|
|
218
|
+
/**
|
|
219
|
+
* Create and sign an NFTTXN.
|
|
220
|
+
*/
|
|
221
|
+
export async function createNFTTXN(options) {
|
|
222
|
+
validateKeyPair({
|
|
223
|
+
publicKeyBase58Identifier: options.publicKeyBase58Identifier,
|
|
224
|
+
privateKeyBase58: options.privateKeyBase58
|
|
225
|
+
});
|
|
226
|
+
const { privateKeyBase58, ...unsignedOptions } = options;
|
|
227
|
+
const nftTxn = await buildNFTTXN(unsignedOptions);
|
|
228
|
+
signWithKey(nftTxn, privateKeyBase58, options.publicKeyBase58Identifier);
|
|
229
|
+
return nftTxn;
|
|
230
|
+
}
|
|
231
|
+
/**
|
|
232
|
+
* Submit an NFTTXN to the network.
|
|
233
|
+
*/
|
|
234
|
+
export async function sendNFTTXN(txn, grpcConfig = {}) {
|
|
235
|
+
await submitTransaction(txn, grpcConfig);
|
|
236
|
+
return hashOrFallback(txn, 'NFT transaction submitted (no hash available)');
|
|
237
|
+
}
|
|
238
|
+
// ============================================================================
|
|
239
|
+
// PUBLIC API - SBT BURN
|
|
240
|
+
// ============================================================================
|
|
241
|
+
/**
|
|
242
|
+
* Build an unsigned BurnSBTTXN.
|
|
243
|
+
*/
|
|
244
|
+
export async function buildBurnSBTTXN(options) {
|
|
245
|
+
validateItemIdentifiers(options.contractId, options.itemId);
|
|
246
|
+
validatePublicKey(options.publicKeyBase58Identifier);
|
|
247
|
+
const base = await buildBaseForItemTXN('buildBurnSBTTXN', options.publicKeyBase58Identifier, options);
|
|
248
|
+
const burnTxn = create(BurnSBTTXNSchema, {
|
|
249
|
+
base,
|
|
250
|
+
contractId: options.contractId,
|
|
251
|
+
itemId: options.itemId
|
|
252
|
+
});
|
|
253
|
+
await UniversalFeeCalculator.calculateFee(buildFeeOptions(burnTxn, options));
|
|
254
|
+
return burnTxn;
|
|
255
|
+
}
|
|
256
|
+
/**
|
|
257
|
+
* Create and sign a BurnSBTTXN.
|
|
258
|
+
*/
|
|
259
|
+
export async function createBurnSBTTXN(options) {
|
|
260
|
+
validateKeyPair({
|
|
261
|
+
publicKeyBase58Identifier: options.publicKeyBase58Identifier,
|
|
262
|
+
privateKeyBase58: options.privateKeyBase58
|
|
263
|
+
});
|
|
264
|
+
const { privateKeyBase58, ...unsignedOptions } = options;
|
|
265
|
+
const burnTxn = await buildBurnSBTTXN(unsignedOptions);
|
|
266
|
+
signWithKey(burnTxn, privateKeyBase58, options.publicKeyBase58Identifier);
|
|
267
|
+
return burnTxn;
|
|
268
|
+
}
|
|
269
|
+
/**
|
|
270
|
+
* Submit a BurnSBTTXN to the network.
|
|
271
|
+
*/
|
|
272
|
+
export async function sendBurnSBTTXN(txn, grpcConfig = {}) {
|
|
273
|
+
await submitTransaction(txn, grpcConfig);
|
|
274
|
+
return hashOrFallback(txn, 'SBT burn submitted (no hash available)');
|
|
275
|
+
}
|
|
276
|
+
//# sourceMappingURL=transaction.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transaction.js","sourceRoot":"","sources":["../../../src/items/transaction.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAExD,OAAO,EACL,gBAAgB,EAChB,sBAAsB,EACtB,qBAAqB,EACrB,kBAAkB,EAClB,YAAY,EACb,MAAM,iCAAiC,CAAC;AAQzC,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAE,iBAAiB,EAAE,MAAM,2CAA2C,CAAC;AAC9E,OAAO,EAAE,4BAA4B,EAAE,wBAAwB,EAAE,MAAM,mCAAmC,CAAC;AAC3G,OAAO,EAAE,sBAAsB,EAAwB,MAAM,uDAAuD,CAAC;AACrH,OAAO,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAC;AACvD,OAAO,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AACtE,OAAO,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAChF,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAiGlD,+EAA+E;AAC/E,mBAAmB;AACnB,+EA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,CAAC,MAAM;KACvB,CAAC,CAAC;IACH,MAAM,sBAAsB,CAAC,YAAY,CAAa,eAAe,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC;IAEzF,OAAO,OAAO,CAAC;AACjB,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB,CACpC,OAAgC;IAEhC,eAAe,CAAC;QACd,yBAAyB,EAAE,OAAO,CAAC,yBAAyB;QAC5D,gBAAgB,EAAE,OAAO,CAAC,gBAAgB;KAC3C,CAAC,CAAC;IAEH,MAAM,EAAE,gBAAgB,EAAE,GAAG,eAAe,EAAE,GAAG,OAAO,CAAC;IACzD,MAAM,OAAO,GAAG,MAAM,eAAe,CAAC,eAAe,CAAC,CAAC;IACvD,WAAW,CAAC,OAAO,EAAE,gBAAgB,EAAE,OAAO,CAAC,yBAAyB,CAAC,CAAC;IAE1E,OAAO,OAAO,CAAC;AACjB,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc,CAClC,GAAe,EACf,aAAyB,EAAE;IAE3B,MAAM,iBAAiB,CAAC,GAAG,EAAE,UAAU,CAAC,CAAC;IACzC,OAAO,cAAc,CAAC,GAAG,EAAE,wCAAwC,CAAC,CAAC;AACvE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/mint/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,aAAa,EACb,WAAW,EACX,KAAK,YAAY,EACjB,KAAK,cAAc,EACpB,MAAM,kBAAkB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/mint/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,aAAa,EACb,WAAW,EAGZ,MAAM,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Transaction Module - MintTXN
|
|
3
|
+
*
|
|
4
|
+
* Builds, signs, and submits Kalvora token mint transactions. A `MintTXN`
|
|
5
|
+
* creates new supply of a fungible token contract and credits it to a
|
|
6
|
+
* recipient wallet (rpc `TXNService.Mint`).
|
|
7
|
+
*
|
|
8
|
+
* All envelope handling (nonce, `BaseTXN`, fees) is delegated to the shared
|
|
9
|
+
* standard transaction pipeline in `shared/tx/standard`.
|
|
10
|
+
*
|
|
11
|
+
* @module mint/transaction
|
|
12
|
+
*/
|
|
13
|
+
import { type MintTXN } from '../../proto/generated/txn_pb.js';
|
|
14
|
+
import { type StandardTXNOptions } from '../shared/tx/standard.js';
|
|
15
|
+
import type { GRPCConfig } from '../types/index.js';
|
|
16
|
+
/**
|
|
17
|
+
* Options accepted by {@link buildMintTXN} and {@link createMintTXN}.
|
|
18
|
+
*
|
|
19
|
+
* Identical to the shared {@link StandardTXNOptions}. Pass both `nonce` and
|
|
20
|
+
* `feeAmountParts` to build fully offline and deterministically.
|
|
21
|
+
*/
|
|
22
|
+
export type MintTXNOptions = StandardTXNOptions;
|
|
23
|
+
/**
|
|
24
|
+
* Readable input for a {@link MintTXN}.
|
|
25
|
+
*/
|
|
26
|
+
export interface MintTXNInput {
|
|
27
|
+
/**
|
|
28
|
+
* Token contract to mint from (canonical Kalvora mint ID, e.g. `KALXvxhUMJERCse4e6b2jeXFkcqqpiUByQQckvPZm4szmF3Ao`).
|
|
29
|
+
* The contract must allow minting and must not exceed its max supply.
|
|
30
|
+
*/
|
|
31
|
+
contractId: string;
|
|
32
|
+
/**
|
|
33
|
+
* Amount to mint in the token's **smallest units ("parts")**, as a
|
|
34
|
+
* non-negative integer string, safe-integer number, or bigint. Must be > 0.
|
|
35
|
+
*
|
|
36
|
+
* This builder deliberately does not accept whole-token amounts, to avoid
|
|
37
|
+
* a denomination lookup. Convert first with `toSmallestUnits`, e.g.
|
|
38
|
+
* `toSmallestUnits('1.5', 'KALXvxhUMJERCse4e6b2jeXFkcqqpiUByQQckvPZm4szmF3Ao', { denomination })`.
|
|
39
|
+
*/
|
|
40
|
+
amount: string | number | bigint;
|
|
41
|
+
/** Base58 wallet address that receives the newly minted tokens. */
|
|
42
|
+
recipientAddress: string;
|
|
43
|
+
/**
|
|
44
|
+
* Base58 public key identifier of the signer (e.g. `A_…`). The key must be
|
|
45
|
+
* a restricted key on the contract with the `mint` permission.
|
|
46
|
+
*/
|
|
47
|
+
publicKey: string;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Build an **unsigned** {@link MintTXN}.
|
|
51
|
+
*
|
|
52
|
+
* On-chain, a mint transaction increases the circulating supply of
|
|
53
|
+
* `contractId` by `amount` parts and credits them to `recipientAddress`.
|
|
54
|
+
* Validators accept it only if the signer's public key is a `RestrictedKey`
|
|
55
|
+
* of the contract with `mint = true` (restricted keys with a `time_delay`
|
|
56
|
+
* cause the mint to be held pending and quashable until the delay elapses).
|
|
57
|
+
*
|
|
58
|
+
* Unless both `options.nonce` and `options.feeAmountParts` are set, this
|
|
59
|
+
* function queries the network for the signer's next nonce and the base fee.
|
|
60
|
+
*
|
|
61
|
+
* @param input - Mint parameters (see {@link MintTXNInput})
|
|
62
|
+
* @param options - Shared standard transaction options
|
|
63
|
+
* @returns The unsigned protobuf `MintTXN`
|
|
64
|
+
*
|
|
65
|
+
* @throws Error when `contractId` is not a canonical mint ID, `amount` is not a
|
|
66
|
+
* positive integer, `recipientAddress` is not valid base58, `publicKey` is
|
|
67
|
+
* missing, or any shared option (fee ID, interface fee, …) is invalid.
|
|
68
|
+
*
|
|
69
|
+
* @example
|
|
70
|
+
* ```typescript
|
|
71
|
+
* import { buildMintTXN } from 'kalvora.js';
|
|
72
|
+
*
|
|
73
|
+
* const txn = await buildMintTXN(
|
|
74
|
+
* {
|
|
75
|
+
* contractId: 'KALXvxhUMJERCse4e6b2jeXFkcqqpiUByQQckvPZm4szmF3Ao',
|
|
76
|
+
* amount: '2500000000', // parts
|
|
77
|
+
* recipientAddress: '<recipient base58 address>',
|
|
78
|
+
* publicKey: 'A_<signer base58 public key>'
|
|
79
|
+
* },
|
|
80
|
+
* { nonce: 12, feeAmountParts: '1000' } // offline + deterministic
|
|
81
|
+
* );
|
|
82
|
+
* ```
|
|
83
|
+
*/
|
|
84
|
+
export declare function buildMintTXN(input: MintTXNInput, options?: MintTXNOptions): Promise<MintTXN>;
|
|
85
|
+
/**
|
|
86
|
+
* Build and sign a {@link MintTXN} with a private key.
|
|
87
|
+
*
|
|
88
|
+
* Equivalent to {@link buildMintTXN} followed by `signWithKey`. The returned
|
|
89
|
+
* transaction has `base.signature` and `base.hash` populated and is ready for
|
|
90
|
+
* {@link sendMintTXN}.
|
|
91
|
+
*
|
|
92
|
+
* The signer (`input.publicKey`) needs the `mint` permission on the contract.
|
|
93
|
+
*
|
|
94
|
+
* @param input - Mint parameters
|
|
95
|
+
* @param privateKey - Signer's base58 private key (matching `input.publicKey`)
|
|
96
|
+
* @param options - Shared standard transaction options
|
|
97
|
+
* @returns The signed `MintTXN`
|
|
98
|
+
*
|
|
99
|
+
* @throws Error when `privateKey` is missing, on any validation error from
|
|
100
|
+
* {@link buildMintTXN}, or when signing fails.
|
|
101
|
+
*
|
|
102
|
+
* @example
|
|
103
|
+
* ```typescript
|
|
104
|
+
* const signed = await createMintTXN(
|
|
105
|
+
* { contractId: 'KALXvxhUMJERCse4e6b2jeXFkcqqpiUByQQckvPZm4szmF3Ao', amount: 1_000_000n, recipientAddress, publicKey },
|
|
106
|
+
* privateKey
|
|
107
|
+
* );
|
|
108
|
+
* const hash = await sendMintTXN(signed);
|
|
109
|
+
* ```
|
|
110
|
+
*/
|
|
111
|
+
export declare function createMintTXN(input: MintTXNInput, privateKey: string, options?: MintTXNOptions): Promise<MintTXN>;
|
|
112
|
+
/**
|
|
113
|
+
* Submit a signed {@link MintTXN} to the network (`TXNService.Mint`).
|
|
114
|
+
*
|
|
115
|
+
* @param txn - Signed mint transaction (from {@link createMintTXN})
|
|
116
|
+
* @param grpcConfig - Endpoint configuration (defaults to SDK defaults)
|
|
117
|
+
* @returns Hex transaction hash
|
|
118
|
+
*
|
|
119
|
+
* @throws Error when the transaction is unsigned (missing signature/hash) or
|
|
120
|
+
* the network rejects it.
|
|
121
|
+
*
|
|
122
|
+
* @example
|
|
123
|
+
* ```typescript
|
|
124
|
+
* const hash = await sendMintTXN(signed, { host: 'kal-proto.visiondynamics.ch' });
|
|
125
|
+
* ```
|
|
126
|
+
*/
|
|
127
|
+
export declare function sendMintTXN(txn: MintTXN, grpcConfig?: GRPCConfig): Promise<string>;
|
|
128
|
+
//# sourceMappingURL=transaction.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transaction.d.ts","sourceRoot":"","sources":["../../../src/mint/transaction.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAiB,KAAK,OAAO,EAAE,MAAM,iCAAiC,CAAC;AAC9E,OAAO,EAML,KAAK,kBAAkB,EACxB,MAAM,0BAA0B,CAAC;AAElC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAEpD;;;;;GAKG;AACH,MAAM,MAAM,cAAc,GAAG,kBAAkB,CAAC;AAEhD;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B;;;OAGG;IACH,UAAU,EAAE,MAAM,CAAC;IACnB;;;;;;;OAOG;IACH,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;IACjC,mEAAmE;IACnE,gBAAgB,EAAE,MAAM,CAAC;IACzB;;;OAGG;IACH,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,wBAAsB,YAAY,CAChC,KAAK,EAAE,YAAY,EACnB,OAAO,GAAE,cAAmB,GAC3B,OAAO,CAAC,OAAO,CAAC,CAgBlB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAsB,aAAa,CACjC,KAAK,EAAE,YAAY,EACnB,UAAU,EAAE,MAAM,EAClB,OAAO,GAAE,cAAmB,GAC3B,OAAO,CAAC,OAAO,CAAC,CAMlB;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,WAAW,CAAC,GAAG,EAAE,OAAO,EAAE,UAAU,GAAE,UAAe,GAAG,OAAO,CAAC,MAAM,CAAC,CAE5F"}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Transaction Module - MintTXN
|
|
3
|
+
*
|
|
4
|
+
* Builds, signs, and submits Kalvora token mint transactions. A `MintTXN`
|
|
5
|
+
* creates new supply of a fungible token contract and credits it to a
|
|
6
|
+
* recipient wallet (rpc `TXNService.Mint`).
|
|
7
|
+
*
|
|
8
|
+
* All envelope handling (nonce, `BaseTXN`, fees) is delegated to the shared
|
|
9
|
+
* standard transaction pipeline in `shared/tx/standard`.
|
|
10
|
+
*
|
|
11
|
+
* @module mint/transaction
|
|
12
|
+
*/
|
|
13
|
+
import { MintTXNSchema } from '../../proto/generated/txn_pb.js';
|
|
14
|
+
import { buildStandardTransaction, parseAddress, parsePartsAmount, requireContractId, submitStandardTransaction } from '../shared/tx/standard.js';
|
|
15
|
+
import { signWithKey } from '../sign/finalize.js';
|
|
16
|
+
/**
|
|
17
|
+
* Build an **unsigned** {@link MintTXN}.
|
|
18
|
+
*
|
|
19
|
+
* On-chain, a mint transaction increases the circulating supply of
|
|
20
|
+
* `contractId` by `amount` parts and credits them to `recipientAddress`.
|
|
21
|
+
* Validators accept it only if the signer's public key is a `RestrictedKey`
|
|
22
|
+
* of the contract with `mint = true` (restricted keys with a `time_delay`
|
|
23
|
+
* cause the mint to be held pending and quashable until the delay elapses).
|
|
24
|
+
*
|
|
25
|
+
* Unless both `options.nonce` and `options.feeAmountParts` are set, this
|
|
26
|
+
* function queries the network for the signer's next nonce and the base fee.
|
|
27
|
+
*
|
|
28
|
+
* @param input - Mint parameters (see {@link MintTXNInput})
|
|
29
|
+
* @param options - Shared standard transaction options
|
|
30
|
+
* @returns The unsigned protobuf `MintTXN`
|
|
31
|
+
*
|
|
32
|
+
* @throws Error when `contractId` is not a canonical mint ID, `amount` is not a
|
|
33
|
+
* positive integer, `recipientAddress` is not valid base58, `publicKey` is
|
|
34
|
+
* missing, or any shared option (fee ID, interface fee, …) is invalid.
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* ```typescript
|
|
38
|
+
* import { buildMintTXN } from 'kalvora.js';
|
|
39
|
+
*
|
|
40
|
+
* const txn = await buildMintTXN(
|
|
41
|
+
* {
|
|
42
|
+
* contractId: 'KALXvxhUMJERCse4e6b2jeXFkcqqpiUByQQckvPZm4szmF3Ao',
|
|
43
|
+
* amount: '2500000000', // parts
|
|
44
|
+
* recipientAddress: '<recipient base58 address>',
|
|
45
|
+
* publicKey: 'A_<signer base58 public key>'
|
|
46
|
+
* },
|
|
47
|
+
* { nonce: 12, feeAmountParts: '1000' } // offline + deterministic
|
|
48
|
+
* );
|
|
49
|
+
* ```
|
|
50
|
+
*/
|
|
51
|
+
export async function buildMintTXN(input, options = {}) {
|
|
52
|
+
if (input === null || typeof input !== 'object') {
|
|
53
|
+
throw new Error('buildMintTXN: input object is required');
|
|
54
|
+
}
|
|
55
|
+
const contractId = requireContractId(input.contractId, 'contractId');
|
|
56
|
+
const amount = parsePartsAmount(input.amount, 'amount');
|
|
57
|
+
const recipientAddress = parseAddress(input.recipientAddress, 'recipientAddress');
|
|
58
|
+
return buildStandardTransaction({
|
|
59
|
+
operation: 'buildMintTXN',
|
|
60
|
+
schema: MintTXNSchema,
|
|
61
|
+
publicKeyId: input.publicKey,
|
|
62
|
+
contractId,
|
|
63
|
+
fields: { contractId, amount, recipientAddress },
|
|
64
|
+
options
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Build and sign a {@link MintTXN} with a private key.
|
|
69
|
+
*
|
|
70
|
+
* Equivalent to {@link buildMintTXN} followed by `signWithKey`. The returned
|
|
71
|
+
* transaction has `base.signature` and `base.hash` populated and is ready for
|
|
72
|
+
* {@link sendMintTXN}.
|
|
73
|
+
*
|
|
74
|
+
* The signer (`input.publicKey`) needs the `mint` permission on the contract.
|
|
75
|
+
*
|
|
76
|
+
* @param input - Mint parameters
|
|
77
|
+
* @param privateKey - Signer's base58 private key (matching `input.publicKey`)
|
|
78
|
+
* @param options - Shared standard transaction options
|
|
79
|
+
* @returns The signed `MintTXN`
|
|
80
|
+
*
|
|
81
|
+
* @throws Error when `privateKey` is missing, on any validation error from
|
|
82
|
+
* {@link buildMintTXN}, or when signing fails.
|
|
83
|
+
*
|
|
84
|
+
* @example
|
|
85
|
+
* ```typescript
|
|
86
|
+
* const signed = await createMintTXN(
|
|
87
|
+
* { contractId: 'KALXvxhUMJERCse4e6b2jeXFkcqqpiUByQQckvPZm4szmF3Ao', amount: 1_000_000n, recipientAddress, publicKey },
|
|
88
|
+
* privateKey
|
|
89
|
+
* );
|
|
90
|
+
* const hash = await sendMintTXN(signed);
|
|
91
|
+
* ```
|
|
92
|
+
*/
|
|
93
|
+
export async function createMintTXN(input, privateKey, options = {}) {
|
|
94
|
+
if (typeof privateKey !== 'string' || privateKey.trim() === '') {
|
|
95
|
+
throw new Error('privateKey is required');
|
|
96
|
+
}
|
|
97
|
+
const txn = await buildMintTXN(input, options);
|
|
98
|
+
return signWithKey(txn, privateKey, input.publicKey);
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Submit a signed {@link MintTXN} to the network (`TXNService.Mint`).
|
|
102
|
+
*
|
|
103
|
+
* @param txn - Signed mint transaction (from {@link createMintTXN})
|
|
104
|
+
* @param grpcConfig - Endpoint configuration (defaults to SDK defaults)
|
|
105
|
+
* @returns Hex transaction hash
|
|
106
|
+
*
|
|
107
|
+
* @throws Error when the transaction is unsigned (missing signature/hash) or
|
|
108
|
+
* the network rejects it.
|
|
109
|
+
*
|
|
110
|
+
* @example
|
|
111
|
+
* ```typescript
|
|
112
|
+
* const hash = await sendMintTXN(signed, { host: 'kal-proto.visiondynamics.ch' });
|
|
113
|
+
* ```
|
|
114
|
+
*/
|
|
115
|
+
export async function sendMintTXN(txn, grpcConfig = {}) {
|
|
116
|
+
return submitStandardTransaction(txn, grpcConfig);
|
|
117
|
+
}
|
|
118
|
+
//# sourceMappingURL=transaction.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transaction.js","sourceRoot":"","sources":["../../../src/mint/transaction.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,aAAa,EAAgB,MAAM,iCAAiC,CAAC;AAC9E,OAAO,EACL,wBAAwB,EACxB,YAAY,EACZ,gBAAgB,EAChB,iBAAiB,EACjB,yBAAyB,EAE1B,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAsClD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,MAAM,CAAC,KAAK,UAAU,YAAY,CAChC,KAAmB,EACnB,UAA0B,EAAE;IAE5B,IAAI,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAChD,MAAM,IAAI,KAAK,CAAC,wCAAwC,CAAC,CAAC;IAC5D,CAAC;IACD,MAAM,UAAU,GAAG,iBAAiB,CAAC,KAAK,CAAC,UAAU,EAAE,YAAY,CAAC,CAAC;IACrE,MAAM,MAAM,GAAG,gBAAgB,CAAC,KAAK,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IACxD,MAAM,gBAAgB,GAAG,YAAY,CAAC,KAAK,CAAC,gBAAgB,EAAE,kBAAkB,CAAC,CAAC;IAElF,OAAO,wBAAwB,CAAC;QAC9B,SAAS,EAAE,cAAc;QACzB,MAAM,EAAE,aAAa;QACrB,WAAW,EAAE,KAAK,CAAC,SAAS;QAC5B,UAAU;QACV,MAAM,EAAE,EAAE,UAAU,EAAE,MAAM,EAAE,gBAAgB,EAAE;QAChD,OAAO;KACR,CAAC,CAAC;AACL,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa,CACjC,KAAmB,EACnB,UAAkB,EAClB,UAA0B,EAAE;IAE5B,IAAI,OAAO,UAAU,KAAK,QAAQ,IAAI,UAAU,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC;QAC/D,MAAM,IAAI,KAAK,CAAC,wBAAwB,CAAC,CAAC;IAC5C,CAAC;IACD,MAAM,GAAG,GAAG,MAAM,YAAY,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;IAC/C,OAAO,WAAW,CAAC,GAAG,EAAE,UAAU,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC;AACvD,CAAC;AAED;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,GAAY,EAAE,aAAyB,EAAE;IACzE,OAAO,yBAAyB,CAAC,GAAG,EAAE,UAAU,CAAC,CAAC;AACpD,CAAC"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { buildTextGovernanceProposalTXN, createTextGovernanceProposalTXN, sendGovernanceProposalTXN, TEXT_PROPOSAL_LIMITS, KALVORA_PROPOSAL_CONTEXT_SCHEMA, KALVORA_PROPOSAL_POLICY_VERSION, type BuildTextGovernanceProposalTXNOptions, type ProposalConstructionContext, type ProposalGovernanceType, type TextGovernanceProposalInput } from './transaction.js';
|
|
2
|
+
export { ProposalType } from '../../proto/generated/txn_pb.js';
|
|
3
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/proposal/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,8BAA8B,EAC9B,+BAA+B,EAC/B,yBAAyB,EACzB,oBAAoB,EACpB,+BAA+B,EAC/B,+BAA+B,EAC/B,KAAK,qCAAqC,EAC1C,KAAK,2BAA2B,EAChC,KAAK,sBAAsB,EAC3B,KAAK,2BAA2B,EACjC,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { buildTextGovernanceProposalTXN, createTextGovernanceProposalTXN, sendGovernanceProposalTXN, TEXT_PROPOSAL_LIMITS, KALVORA_PROPOSAL_CONTEXT_SCHEMA, KALVORA_PROPOSAL_POLICY_VERSION } from './transaction.js';
|
|
2
|
+
export { ProposalType } from '../../proto/generated/txn_pb.js';
|
|
3
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/proposal/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,8BAA8B,EAC9B,+BAA+B,EAC/B,yBAAyB,EACzB,oBAAoB,EACpB,+BAA+B,EAC/B,+BAA+B,EAKhC,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC"}
|