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,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Remove Liquidity Transaction
|
|
3
|
+
*
|
|
4
|
+
* Removes liquidity from a Kalvora DEX pool by redeeming LP tokens.
|
|
5
|
+
* LP tokens always have 9 decimals — the SDK converts automatically.
|
|
6
|
+
*
|
|
7
|
+
* ## Parameter Format
|
|
8
|
+
* `tokenA,tokenB,lpAmount,feeRate`
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```typescript
|
|
12
|
+
* const txn = await removeLiquidity(
|
|
13
|
+
* { tokenA: 'KALXvxhUMJERCse4e6b2jeXFkcqqpiUByQQckvPZm4szmF3Ao', tokenB: 'solana-SOL000000', lpAmount: '197.642353760', feeRate: 25 },
|
|
14
|
+
* publicKey, privateKey
|
|
15
|
+
* );
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
import type { SmartContractExecuteTXN } from '../../../../../proto/generated/txn_pb.js';
|
|
19
|
+
import type { RemoveLiquidityOptions, DexOptions } from '../types.js';
|
|
20
|
+
/**
|
|
21
|
+
* Remove liquidity from a Kalvora DEX pool
|
|
22
|
+
*
|
|
23
|
+
* Burns LP tokens to receive back the underlying token pair.
|
|
24
|
+
* LP tokens must be unlocked before removal (see `unlockLiquidity`).
|
|
25
|
+
*
|
|
26
|
+
* `lpAmount` is specified in user-friendly units (e.g., '197.64' for ~197.64 LP tokens).
|
|
27
|
+
* LP tokens always have 9 decimals — no network call is needed for conversion.
|
|
28
|
+
*
|
|
29
|
+
* @param removal - Removal parameters (tokens, LP amount, fee rate)
|
|
30
|
+
* @param publicKeyBase58Identifier - Public key of the liquidity provider
|
|
31
|
+
* @param privateKeyBase58 - Private key of the liquidity provider
|
|
32
|
+
* @param options - Optional transaction configuration
|
|
33
|
+
* @returns The created transaction (not yet sent)
|
|
34
|
+
*/
|
|
35
|
+
export declare function removeLiquidity(removal: RemoveLiquidityOptions, publicKeyBase58Identifier: string, privateKeyBase58: string, options?: DexOptions): Promise<SmartContractExecuteTXN>;
|
|
36
|
+
/**
|
|
37
|
+
* Remove liquidity and send in one call
|
|
38
|
+
*/
|
|
39
|
+
export declare function removeLiquidityAndSend(removal: RemoveLiquidityOptions, publicKeyBase58Identifier: string, privateKeyBase58: string, options?: DexOptions): Promise<string>;
|
|
40
|
+
//# sourceMappingURL=remove-liquidity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"remove-liquidity.d.ts","sourceRoot":"","sources":["../../../../../../src/smart-contracts/use-cases/dex/transactions/remove-liquidity.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAIH,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,0CAA0C,CAAC;AAIxF,OAAO,KAAK,EAAE,sBAAsB,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AActE;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,eAAe,CACnC,OAAO,EAAE,sBAAsB,EAC/B,yBAAyB,EAAE,MAAM,EACjC,gBAAgB,EAAE,MAAM,EACxB,OAAO,GAAE,UAAe,GACvB,OAAO,CAAC,uBAAuB,CAAC,CAyBlC;AAED;;GAEG;AACH,wBAAsB,sBAAsB,CAC1C,OAAO,EAAE,sBAAsB,EAC/B,yBAAyB,EAAE,MAAM,EACjC,gBAAgB,EAAE,MAAM,EACxB,OAAO,GAAE,UAAe,GACvB,OAAO,CAAC,MAAM,CAAC,CAIjB"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Remove Liquidity Transaction
|
|
3
|
+
*
|
|
4
|
+
* Removes liquidity from a Kalvora DEX pool by redeeming LP tokens.
|
|
5
|
+
* LP tokens always have 9 decimals — the SDK converts automatically.
|
|
6
|
+
*
|
|
7
|
+
* ## Parameter Format
|
|
8
|
+
* `tokenA,tokenB,lpAmount,feeRate`
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```typescript
|
|
12
|
+
* const txn = await removeLiquidity(
|
|
13
|
+
* { tokenA: 'KALXvxhUMJERCse4e6b2jeXFkcqqpiUByQQckvPZm4szmF3Ao', tokenB: 'solana-SOL000000', lpAmount: '197.642353760', feeRate: 25 },
|
|
14
|
+
* publicKey, privateKey
|
|
15
|
+
* );
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
import { Decimal } from 'decimal.js';
|
|
19
|
+
import { KALVORA_NATIVE_TOKEN } from '../../../../shared/network/constants.js';
|
|
20
|
+
import { PROTONET_GRPC_CONFIG } from '../../../../shared/utils/testing-defaults/index.js';
|
|
21
|
+
import { sendSmartContractExecuteTXN } from '../../../execute/index.js';
|
|
22
|
+
import { createDexTransaction } from '../utils.js';
|
|
23
|
+
// ============================================================================
|
|
24
|
+
// CONSTANTS
|
|
25
|
+
// ============================================================================
|
|
26
|
+
/** LP tokens always have 9 decimal places */
|
|
27
|
+
const LP_TOKEN_DECIMALS = 9;
|
|
28
|
+
// ============================================================================
|
|
29
|
+
// REMOVE LIQUIDITY
|
|
30
|
+
// ============================================================================
|
|
31
|
+
/**
|
|
32
|
+
* Remove liquidity from a Kalvora DEX pool
|
|
33
|
+
*
|
|
34
|
+
* Burns LP tokens to receive back the underlying token pair.
|
|
35
|
+
* LP tokens must be unlocked before removal (see `unlockLiquidity`).
|
|
36
|
+
*
|
|
37
|
+
* `lpAmount` is specified in user-friendly units (e.g., '197.64' for ~197.64 LP tokens).
|
|
38
|
+
* LP tokens always have 9 decimals — no network call is needed for conversion.
|
|
39
|
+
*
|
|
40
|
+
* @param removal - Removal parameters (tokens, LP amount, fee rate)
|
|
41
|
+
* @param publicKeyBase58Identifier - Public key of the liquidity provider
|
|
42
|
+
* @param privateKeyBase58 - Private key of the liquidity provider
|
|
43
|
+
* @param options - Optional transaction configuration
|
|
44
|
+
* @returns The created transaction (not yet sent)
|
|
45
|
+
*/
|
|
46
|
+
export async function removeLiquidity(removal, publicKeyBase58Identifier, privateKeyBase58, options = {}) {
|
|
47
|
+
if (!removal.tokenA)
|
|
48
|
+
throw new Error('tokenA is required');
|
|
49
|
+
if (!removal.tokenB)
|
|
50
|
+
throw new Error('tokenB is required');
|
|
51
|
+
if (!removal.lpAmount && removal.lpAmount !== 0)
|
|
52
|
+
throw new Error('lpAmount is required');
|
|
53
|
+
if (removal.feeRate === undefined)
|
|
54
|
+
throw new Error('feeRate is required');
|
|
55
|
+
if (!publicKeyBase58Identifier)
|
|
56
|
+
throw new Error('publicKeyBase58Identifier is required');
|
|
57
|
+
if (!privateKeyBase58)
|
|
58
|
+
throw new Error('privateKeyBase58 is required');
|
|
59
|
+
// Convert user-friendly LP amount to smallest units (9 decimals, no network call needed)
|
|
60
|
+
const lpAmountParts = new Decimal(String(removal.lpAmount))
|
|
61
|
+
.mul(new Decimal(10).pow(LP_TOKEN_DECIMALS))
|
|
62
|
+
.floor()
|
|
63
|
+
.toString();
|
|
64
|
+
const parameterValue = `${removal.tokenA},${removal.tokenB},${lpAmountParts},${removal.feeRate}`;
|
|
65
|
+
const feeId = options.feeId || KALVORA_NATIVE_TOKEN;
|
|
66
|
+
return createDexTransaction('remove_liquidity', parameterValue, publicKeyBase58Identifier, privateKeyBase58, feeId, options);
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Remove liquidity and send in one call
|
|
70
|
+
*/
|
|
71
|
+
export async function removeLiquidityAndSend(removal, publicKeyBase58Identifier, privateKeyBase58, options = {}) {
|
|
72
|
+
const txn = await removeLiquidity(removal, publicKeyBase58Identifier, privateKeyBase58, options);
|
|
73
|
+
const grpcConfig = options.grpcConfig || PROTONET_GRPC_CONFIG;
|
|
74
|
+
return sendSmartContractExecuteTXN(txn, grpcConfig);
|
|
75
|
+
}
|
|
76
|
+
//# sourceMappingURL=remove-liquidity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"remove-liquidity.js","sourceRoot":"","sources":["../../../../../../src/smart-contracts/use-cases/dex/transactions/remove-liquidity.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAGrC,OAAO,EAAE,oBAAoB,EAAE,MAAM,yCAAyC,CAAC;AAC/E,OAAO,EAAE,oBAAoB,EAAE,MAAM,oDAAoD,CAAC;AAC1F,OAAO,EAAE,2BAA2B,EAAE,MAAM,2BAA2B,CAAC;AAExE,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAEnD,+EAA+E;AAC/E,YAAY;AACZ,+EAA+E;AAE/E,6CAA6C;AAC7C,MAAM,iBAAiB,GAAG,CAAC,CAAC;AAE5B,+EAA+E;AAC/E,mBAAmB;AACnB,+EAA+E;AAE/E;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,KAAK,UAAU,eAAe,CACnC,OAA+B,EAC/B,yBAAiC,EACjC,gBAAwB,EACxB,UAAsB,EAAE;IAExB,IAAI,CAAC,OAAO,CAAC,MAAM;QAAE,MAAM,IAAI,KAAK,CAAC,oBAAoB,CAAC,CAAC;IAC3D,IAAI,CAAC,OAAO,CAAC,MAAM;QAAE,MAAM,IAAI,KAAK,CAAC,oBAAoB,CAAC,CAAC;IAC3D,IAAI,CAAC,OAAO,CAAC,QAAQ,IAAI,OAAO,CAAC,QAAQ,KAAK,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC;IACzF,IAAI,OAAO,CAAC,OAAO,KAAK,SAAS;QAAE,MAAM,IAAI,KAAK,CAAC,qBAAqB,CAAC,CAAC;IAC1E,IAAI,CAAC,yBAAyB;QAAE,MAAM,IAAI,KAAK,CAAC,uCAAuC,CAAC,CAAC;IACzF,IAAI,CAAC,gBAAgB;QAAE,MAAM,IAAI,KAAK,CAAC,8BAA8B,CAAC,CAAC;IAEvE,yFAAyF;IACzF,MAAM,aAAa,GAAG,IAAI,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;SACxD,GAAG,CAAC,IAAI,OAAO,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;SAC3C,KAAK,EAAE;SACP,QAAQ,EAAE,CAAC;IAEd,MAAM,cAAc,GAAG,GAAG,OAAO,CAAC,MAAM,IAAI,OAAO,CAAC,MAAM,IAAI,aAAa,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;IACjG,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,IAAI,oBAAoB,CAAC;IAEpD,OAAO,oBAAoB,CACzB,kBAAkB,EAClB,cAAc,EACd,yBAAyB,EACzB,gBAAgB,EAChB,KAAK,EACL,OAAO,CACR,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAC1C,OAA+B,EAC/B,yBAAiC,EACjC,gBAAwB,EACxB,UAAsB,EAAE;IAExB,MAAM,GAAG,GAAG,MAAM,eAAe,CAAC,OAAO,EAAE,yBAAyB,EAAE,gBAAgB,EAAE,OAAO,CAAC,CAAC;IACjG,MAAM,UAAU,GAAG,OAAO,CAAC,UAAU,IAAI,oBAAoB,CAAC;IAC9D,OAAO,2BAA2B,CAAC,GAAG,EAAE,UAAU,CAAC,CAAC;AACtD,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Swap Transaction
|
|
3
|
+
*
|
|
4
|
+
* Executes a token swap on the Kalvora DEX.
|
|
5
|
+
* `amountIn` is specified in user-friendly units and auto-converted.
|
|
6
|
+
*
|
|
7
|
+
* ## Parameter Format
|
|
8
|
+
* `tokenIn,tokenOut,amountIn,feeRate,platformFeeBps,platformFeeAddress`
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```typescript
|
|
12
|
+
* const txn = await swap(
|
|
13
|
+
* { tokenIn: 'solana-SOL000000', tokenOut: 'KALXvxhUMJERCse4e6b2jeXFkcqqpiUByQQckvPZm4szmF3Ao', amountIn: '5.5', feeRate: 25, platformFeeBps: 100, platformFeeAddress: 'EW9iaR8...' },
|
|
14
|
+
* publicKey, privateKey
|
|
15
|
+
* );
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
import type { SmartContractExecuteTXN } from '../../../../../proto/generated/txn_pb.js';
|
|
19
|
+
import type { SwapOptions, DexOptions } from '../types.js';
|
|
20
|
+
/**
|
|
21
|
+
* Execute a token swap on the Kalvora DEX
|
|
22
|
+
*
|
|
23
|
+
* Swaps `amountIn` of `tokenIn` for `tokenOut` through the specified fee-rate pool.
|
|
24
|
+
* Amount is specified in user-friendly units (e.g., '5.5' for 5.5 tokens).
|
|
25
|
+
* Platform fee is specified in basis points (e.g., 100 = 1%) and sent to the given address.
|
|
26
|
+
*
|
|
27
|
+
* @param swapOpts - Swap parameters (tokens, user-friendly amount, fee rate, platform fee)
|
|
28
|
+
* @param publicKeyBase58Identifier - Public key of the swapper
|
|
29
|
+
* @param privateKeyBase58 - Private key of the swapper
|
|
30
|
+
* @param options - Optional transaction configuration
|
|
31
|
+
* @returns The created transaction (not yet sent)
|
|
32
|
+
*/
|
|
33
|
+
export declare function swap(swapOpts: SwapOptions, publicKeyBase58Identifier: string, privateKeyBase58: string, options?: DexOptions): Promise<SmartContractExecuteTXN>;
|
|
34
|
+
/**
|
|
35
|
+
* Swap tokens and send in one call
|
|
36
|
+
*/
|
|
37
|
+
export declare function swapAndSend(swapOpts: SwapOptions, publicKeyBase58Identifier: string, privateKeyBase58: string, options?: DexOptions): Promise<string>;
|
|
38
|
+
//# sourceMappingURL=swap.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"swap.d.ts","sourceRoot":"","sources":["../../../../../../src/smart-contracts/use-cases/dex/transactions/swap.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,0CAA0C,CAAC;AAIxF,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAO3D;;;;;;;;;;;;GAYG;AACH,wBAAsB,IAAI,CACxB,QAAQ,EAAE,WAAW,EACrB,yBAAyB,EAAE,MAAM,EACjC,gBAAgB,EAAE,MAAM,EACxB,OAAO,GAAE,UAAe,GACvB,OAAO,CAAC,uBAAuB,CAAC,CA2BlC;AAED;;GAEG;AACH,wBAAsB,WAAW,CAC/B,QAAQ,EAAE,WAAW,EACrB,yBAAyB,EAAE,MAAM,EACjC,gBAAgB,EAAE,MAAM,EACxB,OAAO,GAAE,UAAe,GACvB,OAAO,CAAC,MAAM,CAAC,CAIjB"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Swap Transaction
|
|
3
|
+
*
|
|
4
|
+
* Executes a token swap on the Kalvora DEX.
|
|
5
|
+
* `amountIn` is specified in user-friendly units and auto-converted.
|
|
6
|
+
*
|
|
7
|
+
* ## Parameter Format
|
|
8
|
+
* `tokenIn,tokenOut,amountIn,feeRate,platformFeeBps,platformFeeAddress`
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```typescript
|
|
12
|
+
* const txn = await swap(
|
|
13
|
+
* { tokenIn: 'solana-SOL000000', tokenOut: 'KALXvxhUMJERCse4e6b2jeXFkcqqpiUByQQckvPZm4szmF3Ao', amountIn: '5.5', feeRate: 25, platformFeeBps: 100, platformFeeAddress: 'EW9iaR8...' },
|
|
14
|
+
* publicKey, privateKey
|
|
15
|
+
* );
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
import { KALVORA_NATIVE_TOKEN } from '../../../../shared/network/constants.js';
|
|
19
|
+
import { PROTONET_GRPC_CONFIG } from '../../../../shared/utils/testing-defaults/index.js';
|
|
20
|
+
import { sendSmartContractExecuteTXN } from '../../../execute/index.js';
|
|
21
|
+
import { createDexTransaction, resolveAmount } from '../utils.js';
|
|
22
|
+
// ============================================================================
|
|
23
|
+
// SWAP
|
|
24
|
+
// ============================================================================
|
|
25
|
+
/**
|
|
26
|
+
* Execute a token swap on the Kalvora DEX
|
|
27
|
+
*
|
|
28
|
+
* Swaps `amountIn` of `tokenIn` for `tokenOut` through the specified fee-rate pool.
|
|
29
|
+
* Amount is specified in user-friendly units (e.g., '5.5' for 5.5 tokens).
|
|
30
|
+
* Platform fee is specified in basis points (e.g., 100 = 1%) and sent to the given address.
|
|
31
|
+
*
|
|
32
|
+
* @param swapOpts - Swap parameters (tokens, user-friendly amount, fee rate, platform fee)
|
|
33
|
+
* @param publicKeyBase58Identifier - Public key of the swapper
|
|
34
|
+
* @param privateKeyBase58 - Private key of the swapper
|
|
35
|
+
* @param options - Optional transaction configuration
|
|
36
|
+
* @returns The created transaction (not yet sent)
|
|
37
|
+
*/
|
|
38
|
+
export async function swap(swapOpts, publicKeyBase58Identifier, privateKeyBase58, options = {}) {
|
|
39
|
+
if (!swapOpts.tokenIn)
|
|
40
|
+
throw new Error('tokenIn is required');
|
|
41
|
+
if (!swapOpts.tokenOut)
|
|
42
|
+
throw new Error('tokenOut is required');
|
|
43
|
+
if (!swapOpts.amountIn && swapOpts.amountIn !== 0)
|
|
44
|
+
throw new Error('amountIn is required');
|
|
45
|
+
if (swapOpts.feeRate === undefined)
|
|
46
|
+
throw new Error('feeRate is required');
|
|
47
|
+
if (swapOpts.platformFeeBps === undefined)
|
|
48
|
+
throw new Error('platformFeeBps is required');
|
|
49
|
+
if (!publicKeyBase58Identifier)
|
|
50
|
+
throw new Error('publicKeyBase58Identifier is required');
|
|
51
|
+
if (!privateKeyBase58)
|
|
52
|
+
throw new Error('privateKeyBase58 is required');
|
|
53
|
+
const grpcConfig = options.grpcConfig || PROTONET_GRPC_CONFIG;
|
|
54
|
+
// Convert user-friendly amount to smallest units
|
|
55
|
+
const amountInParts = await resolveAmount(swapOpts.amountIn, swapOpts.tokenIn, grpcConfig);
|
|
56
|
+
// platformFeeAddress defaults to empty string if not provided
|
|
57
|
+
const platformFeeAddress = swapOpts.platformFeeAddress ?? '';
|
|
58
|
+
const parameterValue = `${swapOpts.tokenIn},${swapOpts.tokenOut},${amountInParts},${swapOpts.feeRate},${swapOpts.platformFeeBps},${platformFeeAddress}`;
|
|
59
|
+
const feeId = options.feeId || KALVORA_NATIVE_TOKEN;
|
|
60
|
+
return createDexTransaction('swap', parameterValue, publicKeyBase58Identifier, privateKeyBase58, feeId, options);
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Swap tokens and send in one call
|
|
64
|
+
*/
|
|
65
|
+
export async function swapAndSend(swapOpts, publicKeyBase58Identifier, privateKeyBase58, options = {}) {
|
|
66
|
+
const txn = await swap(swapOpts, publicKeyBase58Identifier, privateKeyBase58, options);
|
|
67
|
+
const grpcConfig = options.grpcConfig || PROTONET_GRPC_CONFIG;
|
|
68
|
+
return sendSmartContractExecuteTXN(txn, grpcConfig);
|
|
69
|
+
}
|
|
70
|
+
//# sourceMappingURL=swap.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"swap.js","sourceRoot":"","sources":["../../../../../../src/smart-contracts/use-cases/dex/transactions/swap.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAGH,OAAO,EAAE,oBAAoB,EAAE,MAAM,yCAAyC,CAAC;AAC/E,OAAO,EAAE,oBAAoB,EAAE,MAAM,oDAAoD,CAAC;AAC1F,OAAO,EAAE,2BAA2B,EAAE,MAAM,2BAA2B,CAAC;AAExE,OAAO,EAAE,oBAAoB,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAElE,+EAA+E;AAC/E,OAAO;AACP,+EAA+E;AAE/E;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,KAAK,UAAU,IAAI,CACxB,QAAqB,EACrB,yBAAiC,EACjC,gBAAwB,EACxB,UAAsB,EAAE;IAExB,IAAI,CAAC,QAAQ,CAAC,OAAO;QAAE,MAAM,IAAI,KAAK,CAAC,qBAAqB,CAAC,CAAC;IAC9D,IAAI,CAAC,QAAQ,CAAC,QAAQ;QAAE,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC;IAChE,IAAI,CAAC,QAAQ,CAAC,QAAQ,IAAI,QAAQ,CAAC,QAAQ,KAAK,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC;IAC3F,IAAI,QAAQ,CAAC,OAAO,KAAK,SAAS;QAAE,MAAM,IAAI,KAAK,CAAC,qBAAqB,CAAC,CAAC;IAC3E,IAAI,QAAQ,CAAC,cAAc,KAAK,SAAS;QAAE,MAAM,IAAI,KAAK,CAAC,4BAA4B,CAAC,CAAC;IACzF,IAAI,CAAC,yBAAyB;QAAE,MAAM,IAAI,KAAK,CAAC,uCAAuC,CAAC,CAAC;IACzF,IAAI,CAAC,gBAAgB;QAAE,MAAM,IAAI,KAAK,CAAC,8BAA8B,CAAC,CAAC;IAEvE,MAAM,UAAU,GAAG,OAAO,CAAC,UAAU,IAAI,oBAAoB,CAAC;IAE9D,iDAAiD;IACjD,MAAM,aAAa,GAAG,MAAM,aAAa,CAAC,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;IAE3F,8DAA8D;IAC9D,MAAM,kBAAkB,GAAG,QAAQ,CAAC,kBAAkB,IAAI,EAAE,CAAC;IAC7D,MAAM,cAAc,GAAG,GAAG,QAAQ,CAAC,OAAO,IAAI,QAAQ,CAAC,QAAQ,IAAI,aAAa,IAAI,QAAQ,CAAC,OAAO,IAAI,QAAQ,CAAC,cAAc,IAAI,kBAAkB,EAAE,CAAC;IACxJ,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,IAAI,oBAAoB,CAAC;IAEpD,OAAO,oBAAoB,CACzB,MAAM,EACN,cAAc,EACd,yBAAyB,EACzB,gBAAgB,EAChB,KAAK,EACL,OAAO,CACR,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW,CAC/B,QAAqB,EACrB,yBAAiC,EACjC,gBAAwB,EACxB,UAAsB,EAAE;IAExB,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,QAAQ,EAAE,yBAAyB,EAAE,gBAAgB,EAAE,OAAO,CAAC,CAAC;IACvF,MAAM,UAAU,GAAG,OAAO,CAAC,UAAU,IAAI,oBAAoB,CAAC;IAC9D,OAAO,2BAA2B,CAAC,GAAG,EAAE,UAAU,CAAC,CAAC;AACtD,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Unlock Liquidity Transaction
|
|
3
|
+
*
|
|
4
|
+
* Unlocks LP tokens from a Kalvora DEX pool after the lock period has expired.
|
|
5
|
+
* This must be called before `removeLiquidity`.
|
|
6
|
+
*
|
|
7
|
+
* ## Parameter Format
|
|
8
|
+
* `tokenA,tokenB,feeRate`
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```typescript
|
|
12
|
+
* const txn = await unlockLiquidity(
|
|
13
|
+
* { tokenA: 'solana-SOL000000', tokenB: 'KALXvxhUMJERCse4e6b2jeXFkcqqpiUByQQckvPZm4szmF3Ao', feeRate: 25 },
|
|
14
|
+
* publicKey, privateKey
|
|
15
|
+
* );
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
import type { SmartContractExecuteTXN } from '../../../../../proto/generated/txn_pb.js';
|
|
19
|
+
import type { UnlockLiquidityOptions, DexOptions } from '../types.js';
|
|
20
|
+
/**
|
|
21
|
+
* Unlock LP tokens from a Kalvora DEX pool
|
|
22
|
+
*
|
|
23
|
+
* After the lock timestamp has passed, call this to unlock your LP tokens
|
|
24
|
+
* so they can be removed via `removeLiquidity`.
|
|
25
|
+
*
|
|
26
|
+
* @param unlock - Unlock parameters (tokens, fee rate)
|
|
27
|
+
* @param publicKeyBase58Identifier - Public key of the liquidity provider
|
|
28
|
+
* @param privateKeyBase58 - Private key of the liquidity provider
|
|
29
|
+
* @param options - Optional transaction configuration
|
|
30
|
+
* @returns The created transaction (not yet sent)
|
|
31
|
+
*/
|
|
32
|
+
export declare function unlockLiquidity(unlock: UnlockLiquidityOptions, publicKeyBase58Identifier: string, privateKeyBase58: string, options?: DexOptions): Promise<SmartContractExecuteTXN>;
|
|
33
|
+
/**
|
|
34
|
+
* Unlock liquidity and send in one call
|
|
35
|
+
*/
|
|
36
|
+
export declare function unlockLiquidityAndSend(unlock: UnlockLiquidityOptions, publicKeyBase58Identifier: string, privateKeyBase58: string, options?: DexOptions): Promise<string>;
|
|
37
|
+
//# sourceMappingURL=unlock-liquidity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unlock-liquidity.d.ts","sourceRoot":"","sources":["../../../../../../src/smart-contracts/use-cases/dex/transactions/unlock-liquidity.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,0CAA0C,CAAC;AAIxF,OAAO,KAAK,EAAE,sBAAsB,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAOtE;;;;;;;;;;;GAWG;AACH,wBAAsB,eAAe,CACnC,MAAM,EAAE,sBAAsB,EAC9B,yBAAyB,EAAE,MAAM,EACjC,gBAAgB,EAAE,MAAM,EACxB,OAAO,GAAE,UAAe,GACvB,OAAO,CAAC,uBAAuB,CAAC,CAkBlC;AAED;;GAEG;AACH,wBAAsB,sBAAsB,CAC1C,MAAM,EAAE,sBAAsB,EAC9B,yBAAyB,EAAE,MAAM,EACjC,gBAAgB,EAAE,MAAM,EACxB,OAAO,GAAE,UAAe,GACvB,OAAO,CAAC,MAAM,CAAC,CAIjB"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Unlock Liquidity Transaction
|
|
3
|
+
*
|
|
4
|
+
* Unlocks LP tokens from a Kalvora DEX pool after the lock period has expired.
|
|
5
|
+
* This must be called before `removeLiquidity`.
|
|
6
|
+
*
|
|
7
|
+
* ## Parameter Format
|
|
8
|
+
* `tokenA,tokenB,feeRate`
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```typescript
|
|
12
|
+
* const txn = await unlockLiquidity(
|
|
13
|
+
* { tokenA: 'solana-SOL000000', tokenB: 'KALXvxhUMJERCse4e6b2jeXFkcqqpiUByQQckvPZm4szmF3Ao', feeRate: 25 },
|
|
14
|
+
* publicKey, privateKey
|
|
15
|
+
* );
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
import { KALVORA_NATIVE_TOKEN } from '../../../../shared/network/constants.js';
|
|
19
|
+
import { PROTONET_GRPC_CONFIG } from '../../../../shared/utils/testing-defaults/index.js';
|
|
20
|
+
import { sendSmartContractExecuteTXN } from '../../../execute/index.js';
|
|
21
|
+
import { createDexTransaction } from '../utils.js';
|
|
22
|
+
// ============================================================================
|
|
23
|
+
// UNLOCK LIQUIDITY
|
|
24
|
+
// ============================================================================
|
|
25
|
+
/**
|
|
26
|
+
* Unlock LP tokens from a Kalvora DEX pool
|
|
27
|
+
*
|
|
28
|
+
* After the lock timestamp has passed, call this to unlock your LP tokens
|
|
29
|
+
* so they can be removed via `removeLiquidity`.
|
|
30
|
+
*
|
|
31
|
+
* @param unlock - Unlock parameters (tokens, fee rate)
|
|
32
|
+
* @param publicKeyBase58Identifier - Public key of the liquidity provider
|
|
33
|
+
* @param privateKeyBase58 - Private key of the liquidity provider
|
|
34
|
+
* @param options - Optional transaction configuration
|
|
35
|
+
* @returns The created transaction (not yet sent)
|
|
36
|
+
*/
|
|
37
|
+
export async function unlockLiquidity(unlock, publicKeyBase58Identifier, privateKeyBase58, options = {}) {
|
|
38
|
+
if (!unlock.tokenA)
|
|
39
|
+
throw new Error('tokenA is required');
|
|
40
|
+
if (!unlock.tokenB)
|
|
41
|
+
throw new Error('tokenB is required');
|
|
42
|
+
if (unlock.feeRate === undefined)
|
|
43
|
+
throw new Error('feeRate is required');
|
|
44
|
+
if (!publicKeyBase58Identifier)
|
|
45
|
+
throw new Error('publicKeyBase58Identifier is required');
|
|
46
|
+
if (!privateKeyBase58)
|
|
47
|
+
throw new Error('privateKeyBase58 is required');
|
|
48
|
+
const parameterValue = `${unlock.tokenA},${unlock.tokenB},${unlock.feeRate}`;
|
|
49
|
+
const feeId = options.feeId || KALVORA_NATIVE_TOKEN;
|
|
50
|
+
return createDexTransaction('unlock_liquidity_pool_tokens', parameterValue, publicKeyBase58Identifier, privateKeyBase58, feeId, options);
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Unlock liquidity and send in one call
|
|
54
|
+
*/
|
|
55
|
+
export async function unlockLiquidityAndSend(unlock, publicKeyBase58Identifier, privateKeyBase58, options = {}) {
|
|
56
|
+
const txn = await unlockLiquidity(unlock, publicKeyBase58Identifier, privateKeyBase58, options);
|
|
57
|
+
const grpcConfig = options.grpcConfig || PROTONET_GRPC_CONFIG;
|
|
58
|
+
return sendSmartContractExecuteTXN(txn, grpcConfig);
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=unlock-liquidity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unlock-liquidity.js","sourceRoot":"","sources":["../../../../../../src/smart-contracts/use-cases/dex/transactions/unlock-liquidity.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAGH,OAAO,EAAE,oBAAoB,EAAE,MAAM,yCAAyC,CAAC;AAC/E,OAAO,EAAE,oBAAoB,EAAE,MAAM,oDAAoD,CAAC;AAC1F,OAAO,EAAE,2BAA2B,EAAE,MAAM,2BAA2B,CAAC;AAExE,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAEnD,+EAA+E;AAC/E,mBAAmB;AACnB,+EAA+E;AAE/E;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,KAAK,UAAU,eAAe,CACnC,MAA8B,EAC9B,yBAAiC,EACjC,gBAAwB,EACxB,UAAsB,EAAE;IAExB,IAAI,CAAC,MAAM,CAAC,MAAM;QAAE,MAAM,IAAI,KAAK,CAAC,oBAAoB,CAAC,CAAC;IAC1D,IAAI,CAAC,MAAM,CAAC,MAAM;QAAE,MAAM,IAAI,KAAK,CAAC,oBAAoB,CAAC,CAAC;IAC1D,IAAI,MAAM,CAAC,OAAO,KAAK,SAAS;QAAE,MAAM,IAAI,KAAK,CAAC,qBAAqB,CAAC,CAAC;IACzE,IAAI,CAAC,yBAAyB;QAAE,MAAM,IAAI,KAAK,CAAC,uCAAuC,CAAC,CAAC;IACzF,IAAI,CAAC,gBAAgB;QAAE,MAAM,IAAI,KAAK,CAAC,8BAA8B,CAAC,CAAC;IAEvE,MAAM,cAAc,GAAG,GAAG,MAAM,CAAC,MAAM,IAAI,MAAM,CAAC,MAAM,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;IAC7E,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,IAAI,oBAAoB,CAAC;IAEpD,OAAO,oBAAoB,CACzB,8BAA8B,EAC9B,cAAc,EACd,yBAAyB,EACzB,gBAAgB,EAChB,KAAK,EACL,OAAO,CACR,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAC1C,MAA8B,EAC9B,yBAAiC,EACjC,gBAAwB,EACxB,UAAsB,EAAE;IAExB,MAAM,GAAG,GAAG,MAAM,eAAe,CAAC,MAAM,EAAE,yBAAyB,EAAE,gBAAgB,EAAE,OAAO,CAAC,CAAC;IAChG,MAAM,UAAU,GAAG,OAAO,CAAC,UAAU,IAAI,oBAAoB,CAAC;IAC9D,OAAO,2BAA2B,CAAC,GAAG,EAAE,UAAU,CAAC,CAAC;AACtD,CAAC"}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Kalvora DEX Transaction Types
|
|
3
|
+
*
|
|
4
|
+
* Type definitions for all DEX operations via the DEX proxy smart contract
|
|
5
|
+
* (`DEX_CONTRACT_NAME`).
|
|
6
|
+
*
|
|
7
|
+
* All amount fields accept user-friendly values (e.g., '10', '0.5') and are
|
|
8
|
+
* automatically converted to smallest units via the token info API.
|
|
9
|
+
*/
|
|
10
|
+
import type { SmartContractExecuteTXN } from '../../../../proto/generated/txn_pb.js';
|
|
11
|
+
import type { AmountInput } from '../../../types/index.js';
|
|
12
|
+
import type { GRPCConfig } from '../../../types/index.js';
|
|
13
|
+
import type { CreateSmartContractExecuteOptions } from '../../execute/index.js';
|
|
14
|
+
/**
|
|
15
|
+
* Base options for all Kalvora DEX transactions
|
|
16
|
+
*/
|
|
17
|
+
export interface DexOptions extends Omit<CreateSmartContractExecuteOptions, 'feeId' | 'feeAmountParts'> {
|
|
18
|
+
/** gRPC configuration for network communication */
|
|
19
|
+
grpcConfig?: GRPCConfig;
|
|
20
|
+
/** Optional fee ID (defaults to `KALVORA_NATIVE_TOKEN`) */
|
|
21
|
+
feeId?: string;
|
|
22
|
+
/** Optional fee amount in USD (skips auto-calculation if provided) */
|
|
23
|
+
feeAmountUsd?: string;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Options for creating a new liquidity pool
|
|
27
|
+
*
|
|
28
|
+
* Amounts are user-friendly (e.g., '10' for 10 tokens) and auto-converted
|
|
29
|
+
* to smallest units using the token denomination from the network.
|
|
30
|
+
*/
|
|
31
|
+
export interface CreateLiquidityPoolOptions {
|
|
32
|
+
/** First token contract ID (e.g., 'KALXvxhUMJERCse4e6b2jeXFkcqqpiUByQQckvPZm4szmF3Ao') */
|
|
33
|
+
tokenA: string;
|
|
34
|
+
/** Second token contract ID (e.g., 'solana-USDC000000') */
|
|
35
|
+
tokenB: string;
|
|
36
|
+
/** Amount of token A in user-friendly units (e.g., '100' for 100 KALV) */
|
|
37
|
+
amountA: AmountInput;
|
|
38
|
+
/** Amount of token B in user-friendly units (e.g., '12' for 12 USDC) */
|
|
39
|
+
amountB: AmountInput;
|
|
40
|
+
/** Fee rate for the pool (basis points, e.g., 25 = 0.25%) */
|
|
41
|
+
feeRate: number;
|
|
42
|
+
/**
|
|
43
|
+
* Lock duration in seconds from now.
|
|
44
|
+
* If provided, LP tokens are locked until `now + lockDuration`.
|
|
45
|
+
* Defaults to 60 seconds.
|
|
46
|
+
*/
|
|
47
|
+
lockDuration?: number;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Options for adding liquidity to an existing pool
|
|
51
|
+
*
|
|
52
|
+
* Amounts are user-friendly and auto-converted to smallest units.
|
|
53
|
+
*/
|
|
54
|
+
export interface AddLiquidityOptions {
|
|
55
|
+
/** First token contract ID */
|
|
56
|
+
tokenA: string;
|
|
57
|
+
/** Second token contract ID */
|
|
58
|
+
tokenB: string;
|
|
59
|
+
/** Amount of token A in user-friendly units (e.g., '50' for 50 tokens) */
|
|
60
|
+
amountA: AmountInput;
|
|
61
|
+
/** Amount of token B in user-friendly units (e.g., '100' for 100 tokens) */
|
|
62
|
+
amountB: AmountInput;
|
|
63
|
+
/** Fee rate identifying the pool (basis points) */
|
|
64
|
+
feeRate: number;
|
|
65
|
+
/**
|
|
66
|
+
* Lock duration in seconds from now.
|
|
67
|
+
* If provided, LP tokens are locked until `now + lockDuration`.
|
|
68
|
+
* Defaults to 60 seconds.
|
|
69
|
+
*/
|
|
70
|
+
lockDuration?: number;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Options for removing liquidity from a pool
|
|
74
|
+
*/
|
|
75
|
+
export interface RemoveLiquidityOptions {
|
|
76
|
+
/** First token contract ID */
|
|
77
|
+
tokenA: string;
|
|
78
|
+
/** Second token contract ID */
|
|
79
|
+
tokenB: string;
|
|
80
|
+
/** Amount of LP tokens to redeem in user-friendly units (LP tokens always have 9 decimals) */
|
|
81
|
+
lpAmount: AmountInput;
|
|
82
|
+
/** Fee rate identifying the pool (basis points) */
|
|
83
|
+
feeRate: number;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Options for unlocking LP tokens
|
|
87
|
+
*/
|
|
88
|
+
export interface UnlockLiquidityOptions {
|
|
89
|
+
/** First token contract ID */
|
|
90
|
+
tokenA: string;
|
|
91
|
+
/** Second token contract ID */
|
|
92
|
+
tokenB: string;
|
|
93
|
+
/** Fee rate identifying the pool (basis points) */
|
|
94
|
+
feeRate: number;
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Options for executing a swap
|
|
98
|
+
*
|
|
99
|
+
* `amountIn` is user-friendly and auto-converted to smallest units.
|
|
100
|
+
*/
|
|
101
|
+
export interface SwapOptions {
|
|
102
|
+
/** Token to sell contract ID */
|
|
103
|
+
tokenIn: string;
|
|
104
|
+
/** Token to buy contract ID */
|
|
105
|
+
tokenOut: string;
|
|
106
|
+
/** Amount of tokenIn to swap in user-friendly units (e.g., '5.5' for 5.5 tokens) */
|
|
107
|
+
amountIn: AmountInput;
|
|
108
|
+
/** Fee rate identifying the pool (basis points) */
|
|
109
|
+
feeRate: number;
|
|
110
|
+
/**
|
|
111
|
+
* Platform fee in basis points (e.g., 100 = 1%).
|
|
112
|
+
* This fee is taken from the output and sent to `platformFeeAddress`.
|
|
113
|
+
* Set to 0 for no platform fee.
|
|
114
|
+
*/
|
|
115
|
+
platformFeeBps: number;
|
|
116
|
+
/**
|
|
117
|
+
* Address to receive the platform fee.
|
|
118
|
+
* Required when `platformFeeBps` > 0.
|
|
119
|
+
* If omitted or empty, no platform fee is charged.
|
|
120
|
+
*/
|
|
121
|
+
platformFeeAddress?: string;
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Result from DEX transaction builders
|
|
125
|
+
*/
|
|
126
|
+
export interface DexTransactionResult {
|
|
127
|
+
/** The created transaction (not yet sent) */
|
|
128
|
+
transaction: SmartContractExecuteTXN;
|
|
129
|
+
}
|
|
130
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/smart-contracts/use-cases/dex/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,uCAAuC,CAAC;AACrF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,KAAK,EAAE,iCAAiC,EAAE,MAAM,wBAAwB,CAAC;AAMhF;;GAEG;AACH,MAAM,WAAW,UAAW,SAAQ,IAAI,CAAC,iCAAiC,EAAE,OAAO,GAAG,gBAAgB,CAAC;IACrG,mDAAmD;IACnD,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,2DAA2D;IAC3D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,sEAAsE;IACtE,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAMD;;;;;GAKG;AACH,MAAM,WAAW,0BAA0B;IACzC,0FAA0F;IAC1F,MAAM,EAAE,MAAM,CAAC;IACf,2DAA2D;IAC3D,MAAM,EAAE,MAAM,CAAC;IACf,0EAA0E;IAC1E,OAAO,EAAE,WAAW,CAAC;IACrB,wEAAwE;IACxE,OAAO,EAAE,WAAW,CAAC;IACrB,6DAA6D;IAC7D,OAAO,EAAE,MAAM,CAAC;IAChB;;;;OAIG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;;;GAIG;AACH,MAAM,WAAW,mBAAmB;IAClC,8BAA8B;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,+BAA+B;IAC/B,MAAM,EAAE,MAAM,CAAC;IACf,0EAA0E;IAC1E,OAAO,EAAE,WAAW,CAAC;IACrB,4EAA4E;IAC5E,OAAO,EAAE,WAAW,CAAC;IACrB,mDAAmD;IACnD,OAAO,EAAE,MAAM,CAAC;IAChB;;;;OAIG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC,8BAA8B;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,+BAA+B;IAC/B,MAAM,EAAE,MAAM,CAAC;IACf,8FAA8F;IAC9F,QAAQ,EAAE,WAAW,CAAC;IACtB,mDAAmD;IACnD,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC,8BAA8B;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,+BAA+B;IAC/B,MAAM,EAAE,MAAM,CAAC;IACf,mDAAmD;IACnD,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;;;GAIG;AACH,MAAM,WAAW,WAAW;IAC1B,gCAAgC;IAChC,OAAO,EAAE,MAAM,CAAC;IAChB,+BAA+B;IAC/B,QAAQ,EAAE,MAAM,CAAC;IACjB,oFAAoF;IACpF,QAAQ,EAAE,WAAW,CAAC;IACtB,mDAAmD;IACnD,OAAO,EAAE,MAAM,CAAC;IAChB;;;;OAIG;IACH,cAAc,EAAE,MAAM,CAAC;IACvB;;;;OAIG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAMD;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,6CAA6C;IAC7C,WAAW,EAAE,uBAAuB,CAAC;CACtC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Kalvora DEX Transaction Types
|
|
3
|
+
*
|
|
4
|
+
* Type definitions for all DEX operations via the DEX proxy smart contract
|
|
5
|
+
* (`DEX_CONTRACT_NAME`).
|
|
6
|
+
*
|
|
7
|
+
* All amount fields accept user-friendly values (e.g., '10', '0.5') and are
|
|
8
|
+
* automatically converted to smallest units via the token info API.
|
|
9
|
+
*/
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../src/smart-contracts/use-cases/dex/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Kalvora DEX Utilities
|
|
3
|
+
*
|
|
4
|
+
* Constants and helper functions for DEX operations via the DEX proxy smart
|
|
5
|
+
* contract (`DEX_CONTRACT_NAME`).
|
|
6
|
+
*/
|
|
7
|
+
import type { SmartContractExecuteTXN } from '../../../../proto/generated/txn_pb.js';
|
|
8
|
+
import type { AmountInput, GRPCConfig } from '../../../types/index.js';
|
|
9
|
+
import type { DexOptions } from './types.js';
|
|
10
|
+
/** On-chain name of the DEX proxy smart contract that every DEX operation calls. */
|
|
11
|
+
export declare const DEX_CONTRACT_NAME = "zera_dex_proxy";
|
|
12
|
+
export declare const DEX_INSTANCE = 1;
|
|
13
|
+
/** Default lock duration in seconds (60s = 1 minute) */
|
|
14
|
+
export declare const DEFAULT_LOCK_DURATION = 60;
|
|
15
|
+
/**
|
|
16
|
+
* Compute a lock timestamp from now + duration seconds.
|
|
17
|
+
*
|
|
18
|
+
* @param durationSeconds - Lock duration in seconds from now
|
|
19
|
+
* @returns Unix timestamp string for the lock expiry
|
|
20
|
+
*/
|
|
21
|
+
export declare function computeLockTimestamp(durationSeconds?: number): string;
|
|
22
|
+
/**
|
|
23
|
+
* Resolve a user-friendly amount to smallest units for a given token.
|
|
24
|
+
*
|
|
25
|
+
* Fetches the token's denomination from the network and converts
|
|
26
|
+
* the human-readable amount (e.g., '10') to its smallest-unit
|
|
27
|
+
* representation (e.g., '10000000000' for a token with 9 decimals).
|
|
28
|
+
*
|
|
29
|
+
* @param amount - User-friendly amount (e.g., '10', '0.5', 100)
|
|
30
|
+
* @param contractId - Token contract ID (e.g., 'KALXvxhUMJERCse4e6b2jeXFkcqqpiUByQQckvPZm4szmF3Ao')
|
|
31
|
+
* @param grpcConfig - gRPC config for the network call
|
|
32
|
+
* @returns Amount in smallest units as a string
|
|
33
|
+
*/
|
|
34
|
+
export declare function resolveAmount(amount: AmountInput, contractId: string, grpcConfig?: GRPCConfig): Promise<string>;
|
|
35
|
+
/**
|
|
36
|
+
* Create a DEX transaction with the given action and parameters.
|
|
37
|
+
*
|
|
38
|
+
* This is the core utility for building DEX proxy (`DEX_CONTRACT_NAME`) transactions.
|
|
39
|
+
* All DEX operations use the `execute` function with two string parameters:
|
|
40
|
+
* - Parameter 1: action name (e.g., 'create_liquidity_pool')
|
|
41
|
+
* - Parameter 2: comma-delimited arguments
|
|
42
|
+
*
|
|
43
|
+
* @param actionName - The DEX action to execute
|
|
44
|
+
* @param parameterValue - Comma-delimited parameter string
|
|
45
|
+
* @param publicKeyBase58Identifier - Public key of the sender
|
|
46
|
+
* @param privateKeyBase58 - Private key of the sender
|
|
47
|
+
* @param feeId - Fee token to use
|
|
48
|
+
* @param options - Additional transaction options
|
|
49
|
+
* @returns The created transaction
|
|
50
|
+
*/
|
|
51
|
+
export declare function createDexTransaction(actionName: string, parameterValue: string, publicKeyBase58Identifier: string, privateKeyBase58: string, feeId: string, options: DexOptions): Promise<SmartContractExecuteTXN>;
|
|
52
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../src/smart-contracts/use-cases/dex/utils.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,uCAAuC,CAAC;AAIrF,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAGvE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAM7C,oFAAoF;AACpF,eAAO,MAAM,iBAAiB,mBAAmB,CAAC;AAClD,eAAO,MAAM,YAAY,IAAI,CAAC;AAE9B,wDAAwD;AACxD,eAAO,MAAM,qBAAqB,KAAK,CAAC;AAMxC;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,eAAe,GAAE,MAA8B,GAAG,MAAM,CAG5F;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,aAAa,CACjC,MAAM,EAAE,WAAW,EACnB,UAAU,EAAE,MAAM,EAClB,UAAU,GAAE,UAAe,GAC1B,OAAO,CAAC,MAAM,CAAC,CAKjB;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAsB,oBAAoB,CACxC,UAAU,EAAE,MAAM,EAClB,cAAc,EAAE,MAAM,EACtB,yBAAyB,EAAE,MAAM,EACjC,gBAAgB,EAAE,MAAM,EACxB,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,UAAU,GAClB,OAAO,CAAC,uBAAuB,CAAC,CAsBlC"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Kalvora DEX Utilities
|
|
3
|
+
*
|
|
4
|
+
* Constants and helper functions for DEX operations via the DEX proxy smart
|
|
5
|
+
* contract (`DEX_CONTRACT_NAME`).
|
|
6
|
+
*/
|
|
7
|
+
import { getTokenInfoForSingle } from '../../../api/handler/token-info/service.js';
|
|
8
|
+
import { PROTONET_GRPC_CONFIG } from '../../../shared/utils/testing-defaults/index.js';
|
|
9
|
+
import { toSmallestUnits } from '../../../shared/utils/unified-amount-conversion.js';
|
|
10
|
+
import { createSmartContractExecuteTXN, ParamType } from '../../execute/index.js';
|
|
11
|
+
// ============================================================================
|
|
12
|
+
// CONSTANTS
|
|
13
|
+
// ============================================================================
|
|
14
|
+
/** On-chain name of the DEX proxy smart contract that every DEX operation calls. */
|
|
15
|
+
export const DEX_CONTRACT_NAME = 'zera_dex_proxy'; // wire value; fixed by the deployed contract
|
|
16
|
+
export const DEX_INSTANCE = 1;
|
|
17
|
+
/** Default lock duration in seconds (60s = 1 minute) */
|
|
18
|
+
export const DEFAULT_LOCK_DURATION = 60;
|
|
19
|
+
// ============================================================================
|
|
20
|
+
// HELPER FUNCTIONS
|
|
21
|
+
// ============================================================================
|
|
22
|
+
/**
|
|
23
|
+
* Compute a lock timestamp from now + duration seconds.
|
|
24
|
+
*
|
|
25
|
+
* @param durationSeconds - Lock duration in seconds from now
|
|
26
|
+
* @returns Unix timestamp string for the lock expiry
|
|
27
|
+
*/
|
|
28
|
+
export function computeLockTimestamp(durationSeconds = DEFAULT_LOCK_DURATION) {
|
|
29
|
+
const now = Math.floor(Date.now() / 1000);
|
|
30
|
+
return String(now + durationSeconds);
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Resolve a user-friendly amount to smallest units for a given token.
|
|
34
|
+
*
|
|
35
|
+
* Fetches the token's denomination from the network and converts
|
|
36
|
+
* the human-readable amount (e.g., '10') to its smallest-unit
|
|
37
|
+
* representation (e.g., '10000000000' for a token with 9 decimals).
|
|
38
|
+
*
|
|
39
|
+
* @param amount - User-friendly amount (e.g., '10', '0.5', 100)
|
|
40
|
+
* @param contractId - Token contract ID (e.g., 'KALXvxhUMJERCse4e6b2jeXFkcqqpiUByQQckvPZm4szmF3Ao')
|
|
41
|
+
* @param grpcConfig - gRPC config for the network call
|
|
42
|
+
* @returns Amount in smallest units as a string
|
|
43
|
+
*/
|
|
44
|
+
export async function resolveAmount(amount, contractId, grpcConfig = {}) {
|
|
45
|
+
const tokenInfo = await getTokenInfoForSingle(contractId, grpcConfig);
|
|
46
|
+
return toSmallestUnits(amount, contractId, {
|
|
47
|
+
denomination: tokenInfo.denomination
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Create a DEX transaction with the given action and parameters.
|
|
52
|
+
*
|
|
53
|
+
* This is the core utility for building DEX proxy (`DEX_CONTRACT_NAME`) transactions.
|
|
54
|
+
* All DEX operations use the `execute` function with two string parameters:
|
|
55
|
+
* - Parameter 1: action name (e.g., 'create_liquidity_pool')
|
|
56
|
+
* - Parameter 2: comma-delimited arguments
|
|
57
|
+
*
|
|
58
|
+
* @param actionName - The DEX action to execute
|
|
59
|
+
* @param parameterValue - Comma-delimited parameter string
|
|
60
|
+
* @param publicKeyBase58Identifier - Public key of the sender
|
|
61
|
+
* @param privateKeyBase58 - Private key of the sender
|
|
62
|
+
* @param feeId - Fee token to use
|
|
63
|
+
* @param options - Additional transaction options
|
|
64
|
+
* @returns The created transaction
|
|
65
|
+
*/
|
|
66
|
+
export async function createDexTransaction(actionName, parameterValue, publicKeyBase58Identifier, privateKeyBase58, feeId, options) {
|
|
67
|
+
const grpcConfig = options.grpcConfig || PROTONET_GRPC_CONFIG;
|
|
68
|
+
const parameters = [
|
|
69
|
+
{ type: ParamType.STRING, value: actionName },
|
|
70
|
+
{ type: ParamType.STRING, value: parameterValue }
|
|
71
|
+
];
|
|
72
|
+
return createSmartContractExecuteTXN(DEX_CONTRACT_NAME, DEX_INSTANCE, 'execute', parameters, publicKeyBase58Identifier, privateKeyBase58, {
|
|
73
|
+
...options,
|
|
74
|
+
feeId,
|
|
75
|
+
...(options.feeAmountUsd !== undefined && { feeAmountParts: options.feeAmountUsd }),
|
|
76
|
+
grpcConfig
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../../src/smart-contracts/use-cases/dex/utils.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAE,qBAAqB,EAAE,MAAM,4CAA4C,CAAC;AACnF,OAAO,EAAE,oBAAoB,EAAE,MAAM,iDAAiD,CAAC;AACvF,OAAO,EAAE,eAAe,EAAE,MAAM,oDAAoD,CAAC;AAErF,OAAO,EAAE,6BAA6B,EAAE,SAAS,EAAyB,MAAM,wBAAwB,CAAC;AAIzG,+EAA+E;AAC/E,YAAY;AACZ,+EAA+E;AAE/E,oFAAoF;AACpF,MAAM,CAAC,MAAM,iBAAiB,GAAG,gBAAgB,CAAC,CAAC,6CAA6C;AAChG,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,CAAC;AAE9B,wDAAwD;AACxD,MAAM,CAAC,MAAM,qBAAqB,GAAG,EAAE,CAAC;AAExC,+EAA+E;AAC/E,mBAAmB;AACnB,+EAA+E;AAE/E;;;;;GAKG;AACH,MAAM,UAAU,oBAAoB,CAAC,kBAA0B,qBAAqB;IAClF,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC;IAC1C,OAAO,MAAM,CAAC,GAAG,GAAG,eAAe,CAAC,CAAC;AACvC,CAAC;AAED;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa,CACjC,MAAmB,EACnB,UAAkB,EAClB,aAAyB,EAAE;IAE3B,MAAM,SAAS,GAAG,MAAM,qBAAqB,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC;IACtE,OAAO,eAAe,CAAC,MAAM,EAAE,UAAU,EAAE;QACzC,YAAY,EAAE,SAAS,CAAC,YAAY;KACrC,CAAC,CAAC;AACL,CAAC;AAED;;;;;;;;;;;;;;;GAeG;AACH,MAAM,CAAC,KAAK,UAAU,oBAAoB,CACxC,UAAkB,EAClB,cAAsB,EACtB,yBAAiC,EACjC,gBAAwB,EACxB,KAAa,EACb,OAAmB;IAEnB,MAAM,UAAU,GAAG,OAAO,CAAC,UAAU,IAAI,oBAAoB,CAAC;IAE9D,MAAM,UAAU,GAAuB;QACrC,EAAE,IAAI,EAAE,SAAS,CAAC,MAAM,EAAE,KAAK,EAAE,UAAU,EAAE;QAC7C,EAAE,IAAI,EAAE,SAAS,CAAC,MAAM,EAAE,KAAK,EAAE,cAAc,EAAE;KAClD,CAAC;IAEF,OAAO,6BAA6B,CAClC,iBAAiB,EACjB,YAAY,EACZ,SAAS,EACT,UAAU,EACV,yBAAyB,EACzB,gBAAgB,EAChB;QACE,GAAG,OAAO;QACV,KAAK;QACL,GAAG,CAAC,OAAO,CAAC,YAAY,KAAK,SAAS,IAAI,EAAE,cAAc,EAAE,OAAO,CAAC,YAAY,EAAE,CAAC;QACnF,UAAU;KACX,CACF,CAAC;AACJ,CAAC"}
|