@buildonspark/issuer-sdk 0.0.21 → 0.0.23
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/dist/chunk-GB7N6I5O.js +48 -0
- package/dist/index.cjs +518 -0
- package/dist/index.d.cts +110 -0
- package/dist/index.d.ts +110 -0
- package/dist/index.js +497 -0
- package/dist/types.cjs +77 -0
- package/dist/types.d.cts +99 -0
- package/dist/{issuer-sdk/src/types.d.ts → types.d.ts} +14 -12
- package/dist/types.js +12 -0
- package/package.json +31 -32
- package/src/examples/example.ts +2 -2
- package/src/index.ts +1 -0
- package/src/interface/wallet-interface.ts +15 -17
- package/src/{issuer-sdk.ts → issuer-spark-wallet.ts} +10 -26
- package/src/tests/integration/spark.test.ts +12 -15
- package/src/types.ts +1 -2
- package/src/utils/constants.ts +2 -2
- package/dist/issuer-sdk/src/interface/wallet-interface.d.ts +0 -68
- package/dist/issuer-sdk/src/interface/wallet-interface.js +0 -2
- package/dist/issuer-sdk/src/interface/wallet-interface.js.map +0 -1
- package/dist/issuer-sdk/src/issuer-sdk.d.ts +0 -45
- package/dist/issuer-sdk/src/issuer-sdk.js +0 -162
- package/dist/issuer-sdk/src/issuer-sdk.js.map +0 -1
- package/dist/issuer-sdk/src/proto/common.d.ts +0 -58
- package/dist/issuer-sdk/src/proto/common.js +0 -350
- package/dist/issuer-sdk/src/proto/common.js.map +0 -1
- package/dist/issuer-sdk/src/proto/google/protobuf/descriptor.d.ts +0 -1228
- package/dist/issuer-sdk/src/proto/google/protobuf/descriptor.js +0 -5070
- package/dist/issuer-sdk/src/proto/google/protobuf/descriptor.js.map +0 -1
- package/dist/issuer-sdk/src/proto/google/protobuf/duration.d.ts +0 -99
- package/dist/issuer-sdk/src/proto/google/protobuf/duration.js +0 -90
- package/dist/issuer-sdk/src/proto/google/protobuf/duration.js.map +0 -1
- package/dist/issuer-sdk/src/proto/google/protobuf/empty.d.ts +0 -33
- package/dist/issuer-sdk/src/proto/google/protobuf/empty.js +0 -46
- package/dist/issuer-sdk/src/proto/google/protobuf/empty.js.map +0 -1
- package/dist/issuer-sdk/src/proto/google/protobuf/timestamp.d.ts +0 -128
- package/dist/issuer-sdk/src/proto/google/protobuf/timestamp.js +0 -90
- package/dist/issuer-sdk/src/proto/google/protobuf/timestamp.js.map +0 -1
- package/dist/issuer-sdk/src/proto/mock.d.ts +0 -48
- package/dist/issuer-sdk/src/proto/mock.js +0 -103
- package/dist/issuer-sdk/src/proto/mock.js.map +0 -1
- package/dist/issuer-sdk/src/proto/spark.d.ts +0 -1101
- package/dist/issuer-sdk/src/proto/spark.js +0 -9565
- package/dist/issuer-sdk/src/proto/spark.js.map +0 -1
- package/dist/issuer-sdk/src/proto/spark_authn.d.ts +0 -111
- package/dist/issuer-sdk/src/proto/spark_authn.js +0 -517
- package/dist/issuer-sdk/src/proto/spark_authn.js.map +0 -1
- package/dist/issuer-sdk/src/proto/validate/validate.d.ts +0 -1087
- package/dist/issuer-sdk/src/proto/validate/validate.js +0 -4437
- package/dist/issuer-sdk/src/proto/validate/validate.js.map +0 -1
- package/dist/issuer-sdk/src/services/freeze.d.ts +0 -11
- package/dist/issuer-sdk/src/services/freeze.js +0 -44
- package/dist/issuer-sdk/src/services/freeze.js.map +0 -1
- package/dist/issuer-sdk/src/services/token-transactions.d.ts +0 -8
- package/dist/issuer-sdk/src/services/token-transactions.js +0 -27
- package/dist/issuer-sdk/src/services/token-transactions.js.map +0 -1
- package/dist/issuer-sdk/src/tests/integration/spark.test.d.ts +0 -1
- package/dist/issuer-sdk/src/tests/integration/spark.test.js +0 -368
- package/dist/issuer-sdk/src/tests/integration/spark.test.js.map +0 -1
- package/dist/issuer-sdk/src/types.js +0 -33
- package/dist/issuer-sdk/src/types.js.map +0 -1
- package/dist/issuer-sdk/src/utils/constants.d.ts +0 -16
- package/dist/issuer-sdk/src/utils/constants.js +0 -18
- package/dist/issuer-sdk/src/utils/constants.js.map +0 -1
- package/dist/issuer-sdk/src/utils/enum-mappers.d.ts +0 -6
- package/dist/issuer-sdk/src/utils/enum-mappers.js +0 -66
- package/dist/issuer-sdk/src/utils/enum-mappers.js.map +0 -1
- package/dist/issuer-sdk/src/utils/token-hashing.d.ts +0 -2
- package/dist/issuer-sdk/src/utils/token-hashing.js +0 -45
- package/dist/issuer-sdk/src/utils/token-hashing.js.map +0 -1
- package/dist/issuer-sdk/src/utils/type-mappers.d.ts +0 -4
- package/dist/issuer-sdk/src/utils/type-mappers.js +0 -106
- package/dist/issuer-sdk/src/utils/type-mappers.js.map +0 -1
- package/dist/spark-sdk/src/graphql/client.d.ts +0 -25
- package/dist/spark-sdk/src/graphql/client.js +0 -189
- package/dist/spark-sdk/src/graphql/client.js.map +0 -1
- package/dist/spark-sdk/src/graphql/mutations/CompleteCoopExit.d.ts +0 -1
- package/dist/spark-sdk/src/graphql/mutations/CompleteCoopExit.js +0 -19
- package/dist/spark-sdk/src/graphql/mutations/CompleteCoopExit.js.map +0 -1
- package/dist/spark-sdk/src/graphql/mutations/CompleteLeavesSwap.d.ts +0 -1
- package/dist/spark-sdk/src/graphql/mutations/CompleteLeavesSwap.js +0 -17
- package/dist/spark-sdk/src/graphql/mutations/CompleteLeavesSwap.js.map +0 -1
- package/dist/spark-sdk/src/graphql/mutations/RequestCoopExit.d.ts +0 -1
- package/dist/spark-sdk/src/graphql/mutations/RequestCoopExit.js +0 -20
- package/dist/spark-sdk/src/graphql/mutations/RequestCoopExit.js.map +0 -1
- package/dist/spark-sdk/src/graphql/mutations/RequestLightningReceive.d.ts +0 -1
- package/dist/spark-sdk/src/graphql/mutations/RequestLightningReceive.js +0 -26
- package/dist/spark-sdk/src/graphql/mutations/RequestLightningReceive.js.map +0 -1
- package/dist/spark-sdk/src/graphql/mutations/RequestLightningSend.d.ts +0 -1
- package/dist/spark-sdk/src/graphql/mutations/RequestLightningSend.js +0 -18
- package/dist/spark-sdk/src/graphql/mutations/RequestLightningSend.js.map +0 -1
- package/dist/spark-sdk/src/graphql/mutations/RequestSwapLeaves.d.ts +0 -1
- package/dist/spark-sdk/src/graphql/mutations/RequestSwapLeaves.js +0 -24
- package/dist/spark-sdk/src/graphql/mutations/RequestSwapLeaves.js.map +0 -1
- package/dist/spark-sdk/src/graphql/objects/BitcoinNetwork.d.ts +0 -17
- package/dist/spark-sdk/src/graphql/objects/BitcoinNetwork.js +0 -20
- package/dist/spark-sdk/src/graphql/objects/BitcoinNetwork.js.map +0 -1
- package/dist/spark-sdk/src/graphql/objects/CompleteCoopExitInput.d.ts +0 -7
- package/dist/spark-sdk/src/graphql/objects/CompleteCoopExitInput.js +0 -14
- package/dist/spark-sdk/src/graphql/objects/CompleteCoopExitInput.js.map +0 -1
- package/dist/spark-sdk/src/graphql/objects/CompleteCoopExitOutput.d.ts +0 -7
- package/dist/spark-sdk/src/graphql/objects/CompleteCoopExitOutput.js +0 -19
- package/dist/spark-sdk/src/graphql/objects/CompleteCoopExitOutput.js.map +0 -1
- package/dist/spark-sdk/src/graphql/objects/CompleteLeavesSwapInput.d.ts +0 -8
- package/dist/spark-sdk/src/graphql/objects/CompleteLeavesSwapInput.js +0 -16
- package/dist/spark-sdk/src/graphql/objects/CompleteLeavesSwapInput.js.map +0 -1
- package/dist/spark-sdk/src/graphql/objects/CompleteLeavesSwapOutput.d.ts +0 -7
- package/dist/spark-sdk/src/graphql/objects/CompleteLeavesSwapOutput.js +0 -19
- package/dist/spark-sdk/src/graphql/objects/CompleteLeavesSwapOutput.js.map +0 -1
- package/dist/spark-sdk/src/graphql/objects/CompleteSeedReleaseInput.d.ts +0 -7
- package/dist/spark-sdk/src/graphql/objects/CompleteSeedReleaseInput.js +0 -14
- package/dist/spark-sdk/src/graphql/objects/CompleteSeedReleaseInput.js.map +0 -1
- package/dist/spark-sdk/src/graphql/objects/CompleteSeedReleaseOutput.d.ts +0 -7
- package/dist/spark-sdk/src/graphql/objects/CompleteSeedReleaseOutput.js +0 -17
- package/dist/spark-sdk/src/graphql/objects/CompleteSeedReleaseOutput.js.map +0 -1
- package/dist/spark-sdk/src/graphql/objects/Connection.d.ts +0 -16
- package/dist/spark-sdk/src/graphql/objects/Connection.js +0 -56
- package/dist/spark-sdk/src/graphql/objects/Connection.js.map +0 -1
- package/dist/spark-sdk/src/graphql/objects/CoopExitFeeEstimateInput.d.ts +0 -7
- package/dist/spark-sdk/src/graphql/objects/CoopExitFeeEstimateInput.js +0 -14
- package/dist/spark-sdk/src/graphql/objects/CoopExitFeeEstimateInput.js.map +0 -1
- package/dist/spark-sdk/src/graphql/objects/CoopExitFeeEstimateOutput.d.ts +0 -8
- package/dist/spark-sdk/src/graphql/objects/CoopExitFeeEstimateOutput.js +0 -26
- package/dist/spark-sdk/src/graphql/objects/CoopExitFeeEstimateOutput.js.map +0 -1
- package/dist/spark-sdk/src/graphql/objects/CoopExitRequest.d.ts +0 -35
- package/dist/spark-sdk/src/graphql/objects/CoopExitRequest.js +0 -68
- package/dist/spark-sdk/src/graphql/objects/CoopExitRequest.js.map +0 -1
- package/dist/spark-sdk/src/graphql/objects/CurrencyAmount.d.ts +0 -24
- package/dist/spark-sdk/src/graphql/objects/CurrencyAmount.js +0 -30
- package/dist/spark-sdk/src/graphql/objects/CurrencyAmount.js.map +0 -1
- package/dist/spark-sdk/src/graphql/objects/CurrencyUnit.d.ts +0 -29
- package/dist/spark-sdk/src/graphql/objects/CurrencyUnit.js +0 -32
- package/dist/spark-sdk/src/graphql/objects/CurrencyUnit.js.map +0 -1
- package/dist/spark-sdk/src/graphql/objects/Entity.d.ts +0 -16
- package/dist/spark-sdk/src/graphql/objects/Entity.js +0 -169
- package/dist/spark-sdk/src/graphql/objects/Entity.js.map +0 -1
- package/dist/spark-sdk/src/graphql/objects/GetChallengeInput.d.ts +0 -6
- package/dist/spark-sdk/src/graphql/objects/GetChallengeInput.js +0 -12
- package/dist/spark-sdk/src/graphql/objects/GetChallengeInput.js.map +0 -1
- package/dist/spark-sdk/src/graphql/objects/GetChallengeOutput.d.ts +0 -7
- package/dist/spark-sdk/src/graphql/objects/GetChallengeOutput.js +0 -17
- package/dist/spark-sdk/src/graphql/objects/GetChallengeOutput.js.map +0 -1
- package/dist/spark-sdk/src/graphql/objects/Invoice.d.ts +0 -15
- package/dist/spark-sdk/src/graphql/objects/Invoice.js +0 -45
- package/dist/spark-sdk/src/graphql/objects/Invoice.js.map +0 -1
- package/dist/spark-sdk/src/graphql/objects/Leaf.d.ts +0 -11
- package/dist/spark-sdk/src/graphql/objects/Leaf.js +0 -29
- package/dist/spark-sdk/src/graphql/objects/Leaf.js.map +0 -1
- package/dist/spark-sdk/src/graphql/objects/LeavesSwapFeeEstimateInput.d.ts +0 -6
- package/dist/spark-sdk/src/graphql/objects/LeavesSwapFeeEstimateInput.js +0 -12
- package/dist/spark-sdk/src/graphql/objects/LeavesSwapFeeEstimateInput.js.map +0 -1
- package/dist/spark-sdk/src/graphql/objects/LeavesSwapFeeEstimateOutput.d.ts +0 -8
- package/dist/spark-sdk/src/graphql/objects/LeavesSwapFeeEstimateOutput.js +0 -26
- package/dist/spark-sdk/src/graphql/objects/LeavesSwapFeeEstimateOutput.js.map +0 -1
- package/dist/spark-sdk/src/graphql/objects/LeavesSwapRequest.d.ts +0 -42
- package/dist/spark-sdk/src/graphql/objects/LeavesSwapRequest.js +0 -123
- package/dist/spark-sdk/src/graphql/objects/LeavesSwapRequest.js.map +0 -1
- package/dist/spark-sdk/src/graphql/objects/LightningReceiveFeeEstimateInput.d.ts +0 -8
- package/dist/spark-sdk/src/graphql/objects/LightningReceiveFeeEstimateInput.js +0 -15
- package/dist/spark-sdk/src/graphql/objects/LightningReceiveFeeEstimateInput.js.map +0 -1
- package/dist/spark-sdk/src/graphql/objects/LightningReceiveFeeEstimateOutput.d.ts +0 -8
- package/dist/spark-sdk/src/graphql/objects/LightningReceiveFeeEstimateOutput.js +0 -26
- package/dist/spark-sdk/src/graphql/objects/LightningReceiveFeeEstimateOutput.js.map +0 -1
- package/dist/spark-sdk/src/graphql/objects/LightningReceiveRequest.d.ts +0 -34
- package/dist/spark-sdk/src/graphql/objects/LightningReceiveRequest.js +0 -97
- package/dist/spark-sdk/src/graphql/objects/LightningReceiveRequest.js.map +0 -1
- package/dist/spark-sdk/src/graphql/objects/LightningReceiveRequestStatus.d.ts +0 -18
- package/dist/spark-sdk/src/graphql/objects/LightningReceiveRequestStatus.js +0 -21
- package/dist/spark-sdk/src/graphql/objects/LightningReceiveRequestStatus.js.map +0 -1
- package/dist/spark-sdk/src/graphql/objects/LightningSendFeeEstimateInput.d.ts +0 -6
- package/dist/spark-sdk/src/graphql/objects/LightningSendFeeEstimateInput.js +0 -12
- package/dist/spark-sdk/src/graphql/objects/LightningSendFeeEstimateInput.js.map +0 -1
- package/dist/spark-sdk/src/graphql/objects/LightningSendFeeEstimateOutput.d.ts +0 -8
- package/dist/spark-sdk/src/graphql/objects/LightningSendFeeEstimateOutput.js +0 -26
- package/dist/spark-sdk/src/graphql/objects/LightningSendFeeEstimateOutput.js.map +0 -1
- package/dist/spark-sdk/src/graphql/objects/LightningSendRequest.d.ts +0 -35
- package/dist/spark-sdk/src/graphql/objects/LightningSendRequest.js +0 -82
- package/dist/spark-sdk/src/graphql/objects/LightningSendRequest.js.map +0 -1
- package/dist/spark-sdk/src/graphql/objects/LightningSendRequestStatus.d.ts +0 -15
- package/dist/spark-sdk/src/graphql/objects/LightningSendRequestStatus.js +0 -18
- package/dist/spark-sdk/src/graphql/objects/LightningSendRequestStatus.js.map +0 -1
- package/dist/spark-sdk/src/graphql/objects/NotifyReceiverTransferInput.d.ts +0 -7
- package/dist/spark-sdk/src/graphql/objects/NotifyReceiverTransferInput.js +0 -14
- package/dist/spark-sdk/src/graphql/objects/NotifyReceiverTransferInput.js.map +0 -1
- package/dist/spark-sdk/src/graphql/objects/PageInfo.d.ts +0 -11
- package/dist/spark-sdk/src/graphql/objects/PageInfo.js +0 -26
- package/dist/spark-sdk/src/graphql/objects/PageInfo.js.map +0 -1
- package/dist/spark-sdk/src/graphql/objects/Provider.d.ts +0 -7
- package/dist/spark-sdk/src/graphql/objects/Provider.js +0 -14
- package/dist/spark-sdk/src/graphql/objects/Provider.js.map +0 -1
- package/dist/spark-sdk/src/graphql/objects/RequestCoopExitInput.d.ts +0 -7
- package/dist/spark-sdk/src/graphql/objects/RequestCoopExitInput.js +0 -14
- package/dist/spark-sdk/src/graphql/objects/RequestCoopExitInput.js.map +0 -1
- package/dist/spark-sdk/src/graphql/objects/RequestCoopExitOutput.d.ts +0 -7
- package/dist/spark-sdk/src/graphql/objects/RequestCoopExitOutput.js +0 -19
- package/dist/spark-sdk/src/graphql/objects/RequestCoopExitOutput.js.map +0 -1
- package/dist/spark-sdk/src/graphql/objects/RequestLeavesSwapInput.d.ts +0 -11
- package/dist/spark-sdk/src/graphql/objects/RequestLeavesSwapInput.js +0 -22
- package/dist/spark-sdk/src/graphql/objects/RequestLeavesSwapInput.js.map +0 -1
- package/dist/spark-sdk/src/graphql/objects/RequestLeavesSwapOutput.d.ts +0 -7
- package/dist/spark-sdk/src/graphql/objects/RequestLeavesSwapOutput.js +0 -19
- package/dist/spark-sdk/src/graphql/objects/RequestLeavesSwapOutput.js.map +0 -1
- package/dist/spark-sdk/src/graphql/objects/RequestLightningReceiveInput.d.ts +0 -16
- package/dist/spark-sdk/src/graphql/objects/RequestLightningReceiveInput.js +0 -21
- package/dist/spark-sdk/src/graphql/objects/RequestLightningReceiveInput.js.map +0 -1
- package/dist/spark-sdk/src/graphql/objects/RequestLightningReceiveOutput.d.ts +0 -7
- package/dist/spark-sdk/src/graphql/objects/RequestLightningReceiveOutput.js +0 -19
- package/dist/spark-sdk/src/graphql/objects/RequestLightningReceiveOutput.js.map +0 -1
- package/dist/spark-sdk/src/graphql/objects/RequestLightningSendInput.d.ts +0 -7
- package/dist/spark-sdk/src/graphql/objects/RequestLightningSendInput.js +0 -14
- package/dist/spark-sdk/src/graphql/objects/RequestLightningSendInput.js.map +0 -1
- package/dist/spark-sdk/src/graphql/objects/RequestLightningSendOutput.d.ts +0 -7
- package/dist/spark-sdk/src/graphql/objects/RequestLightningSendOutput.js +0 -19
- package/dist/spark-sdk/src/graphql/objects/RequestLightningSendOutput.js.map +0 -1
- package/dist/spark-sdk/src/graphql/objects/SparkCoopExitRequestStatus.d.ts +0 -14
- package/dist/spark-sdk/src/graphql/objects/SparkCoopExitRequestStatus.js +0 -17
- package/dist/spark-sdk/src/graphql/objects/SparkCoopExitRequestStatus.js.map +0 -1
- package/dist/spark-sdk/src/graphql/objects/SparkLeavesSwapRequestStatus.d.ts +0 -14
- package/dist/spark-sdk/src/graphql/objects/SparkLeavesSwapRequestStatus.js +0 -17
- package/dist/spark-sdk/src/graphql/objects/SparkLeavesSwapRequestStatus.js.map +0 -1
- package/dist/spark-sdk/src/graphql/objects/SparkTransferToLeavesConnection.d.ts +0 -19
- package/dist/spark-sdk/src/graphql/objects/SparkTransferToLeavesConnection.js +0 -45
- package/dist/spark-sdk/src/graphql/objects/SparkTransferToLeavesConnection.js.map +0 -1
- package/dist/spark-sdk/src/graphql/objects/SparkWalletUser.d.ts +0 -21
- package/dist/spark-sdk/src/graphql/objects/SparkWalletUser.js +0 -45
- package/dist/spark-sdk/src/graphql/objects/SparkWalletUser.js.map +0 -1
- package/dist/spark-sdk/src/graphql/objects/StartSeedReleaseInput.d.ts +0 -6
- package/dist/spark-sdk/src/graphql/objects/StartSeedReleaseInput.js +0 -12
- package/dist/spark-sdk/src/graphql/objects/StartSeedReleaseInput.js.map +0 -1
- package/dist/spark-sdk/src/graphql/objects/SwapLeaf.d.ts +0 -9
- package/dist/spark-sdk/src/graphql/objects/SwapLeaf.js +0 -23
- package/dist/spark-sdk/src/graphql/objects/SwapLeaf.js.map +0 -1
- package/dist/spark-sdk/src/graphql/objects/Transfer.d.ts +0 -24
- package/dist/spark-sdk/src/graphql/objects/Transfer.js +0 -82
- package/dist/spark-sdk/src/graphql/objects/Transfer.js.map +0 -1
- package/dist/spark-sdk/src/graphql/objects/UserLeafInput.d.ts +0 -8
- package/dist/spark-sdk/src/graphql/objects/UserLeafInput.js +0 -16
- package/dist/spark-sdk/src/graphql/objects/UserLeafInput.js.map +0 -1
- package/dist/spark-sdk/src/graphql/objects/UserRequest.d.ts +0 -22
- package/dist/spark-sdk/src/graphql/objects/UserRequest.js +0 -310
- package/dist/spark-sdk/src/graphql/objects/UserRequest.js.map +0 -1
- package/dist/spark-sdk/src/graphql/objects/VerifyChallengeInput.d.ts +0 -10
- package/dist/spark-sdk/src/graphql/objects/VerifyChallengeInput.js +0 -20
- package/dist/spark-sdk/src/graphql/objects/VerifyChallengeInput.js.map +0 -1
- package/dist/spark-sdk/src/graphql/objects/VerifyChallengeOutput.d.ts +0 -7
- package/dist/spark-sdk/src/graphql/objects/VerifyChallengeOutput.js +0 -17
- package/dist/spark-sdk/src/graphql/objects/VerifyChallengeOutput.js.map +0 -1
- package/dist/spark-sdk/src/graphql/objects/WalletUserIdentityPublicKeyInput.d.ts +0 -6
- package/dist/spark-sdk/src/graphql/objects/WalletUserIdentityPublicKeyInput.js +0 -12
- package/dist/spark-sdk/src/graphql/objects/WalletUserIdentityPublicKeyInput.js.map +0 -1
- package/dist/spark-sdk/src/graphql/objects/WalletUserIdentityPublicKeyOutput.d.ts +0 -7
- package/dist/spark-sdk/src/graphql/objects/WalletUserIdentityPublicKeyOutput.js +0 -17
- package/dist/spark-sdk/src/graphql/objects/WalletUserIdentityPublicKeyOutput.js.map +0 -1
- package/dist/spark-sdk/src/graphql/objects/index.d.ts +0 -53
- package/dist/spark-sdk/src/graphql/objects/index.js +0 -14
- package/dist/spark-sdk/src/graphql/objects/index.js.map +0 -1
- package/dist/spark-sdk/src/graphql/queries/CoopExitFeeEstimate.d.ts +0 -1
- package/dist/spark-sdk/src/graphql/queries/CoopExitFeeEstimate.js +0 -18
- package/dist/spark-sdk/src/graphql/queries/CoopExitFeeEstimate.js.map +0 -1
- package/dist/spark-sdk/src/graphql/queries/LeavesSwapFeeEstimate.d.ts +0 -1
- package/dist/spark-sdk/src/graphql/queries/LeavesSwapFeeEstimate.js +0 -16
- package/dist/spark-sdk/src/graphql/queries/LeavesSwapFeeEstimate.js.map +0 -1
- package/dist/spark-sdk/src/graphql/queries/LightningReceiveFeeEstimate.d.ts +0 -1
- package/dist/spark-sdk/src/graphql/queries/LightningReceiveFeeEstimate.js +0 -18
- package/dist/spark-sdk/src/graphql/queries/LightningReceiveFeeEstimate.js.map +0 -1
- package/dist/spark-sdk/src/graphql/queries/LightningSendFeeEstimate.d.ts +0 -1
- package/dist/spark-sdk/src/graphql/queries/LightningSendFeeEstimate.js +0 -16
- package/dist/spark-sdk/src/graphql/queries/LightningSendFeeEstimate.js.map +0 -1
- package/dist/spark-sdk/src/proto/common.d.ts +0 -58
- package/dist/spark-sdk/src/proto/common.js +0 -350
- package/dist/spark-sdk/src/proto/common.js.map +0 -1
- package/dist/spark-sdk/src/proto/google/protobuf/empty.d.ts +0 -33
- package/dist/spark-sdk/src/proto/google/protobuf/empty.js +0 -46
- package/dist/spark-sdk/src/proto/google/protobuf/empty.js.map +0 -1
- package/dist/spark-sdk/src/proto/google/protobuf/timestamp.d.ts +0 -128
- package/dist/spark-sdk/src/proto/google/protobuf/timestamp.js +0 -90
- package/dist/spark-sdk/src/proto/google/protobuf/timestamp.js.map +0 -1
- package/dist/spark-sdk/src/proto/mock.d.ts +0 -48
- package/dist/spark-sdk/src/proto/mock.js +0 -103
- package/dist/spark-sdk/src/proto/mock.js.map +0 -1
- package/dist/spark-sdk/src/proto/spark.d.ts +0 -1209
- package/dist/spark-sdk/src/proto/spark.js +0 -10516
- package/dist/spark-sdk/src/proto/spark.js.map +0 -1
- package/dist/spark-sdk/src/proto/spark_authn.d.ts +0 -111
- package/dist/spark-sdk/src/proto/spark_authn.js +0 -517
- package/dist/spark-sdk/src/proto/spark_authn.js.map +0 -1
- package/dist/spark-sdk/src/services/config.d.ts +0 -17
- package/dist/spark-sdk/src/services/config.js +0 -54
- package/dist/spark-sdk/src/services/config.js.map +0 -1
- package/dist/spark-sdk/src/services/connection.d.ts +0 -22
- package/dist/spark-sdk/src/services/connection.js +0 -180
- package/dist/spark-sdk/src/services/connection.js.map +0 -1
- package/dist/spark-sdk/src/services/coop-exit.d.ts +0 -20
- package/dist/spark-sdk/src/services/coop-exit.js +0 -101
- package/dist/spark-sdk/src/services/coop-exit.js.map +0 -1
- package/dist/spark-sdk/src/services/deposit.d.ts +0 -21
- package/dist/spark-sdk/src/services/deposit.js +0 -214
- package/dist/spark-sdk/src/services/deposit.js.map +0 -1
- package/dist/spark-sdk/src/services/lightning.d.ts +0 -31
- package/dist/spark-sdk/src/services/lightning.js +0 -210
- package/dist/spark-sdk/src/services/lightning.js.map +0 -1
- package/dist/spark-sdk/src/services/lrc20.d.ts +0 -5
- package/dist/spark-sdk/src/services/lrc20.js +0 -27
- package/dist/spark-sdk/src/services/lrc20.js.map +0 -1
- package/dist/spark-sdk/src/services/token-transactions.d.ts +0 -16
- package/dist/spark-sdk/src/services/token-transactions.js +0 -299
- package/dist/spark-sdk/src/services/token-transactions.js.map +0 -1
- package/dist/spark-sdk/src/services/transfer.d.ts +0 -66
- package/dist/spark-sdk/src/services/transfer.js +0 -791
- package/dist/spark-sdk/src/services/transfer.js.map +0 -1
- package/dist/spark-sdk/src/services/tree-creation.d.ts +0 -29
- package/dist/spark-sdk/src/services/tree-creation.js +0 -399
- package/dist/spark-sdk/src/services/tree-creation.js.map +0 -1
- package/dist/spark-sdk/src/services/wallet-config.d.ts +0 -23
- package/dist/spark-sdk/src/services/wallet-config.js +0 -107
- package/dist/spark-sdk/src/services/wallet-config.js.map +0 -1
- package/dist/spark-sdk/src/signer/signer.d.ts +0 -106
- package/dist/spark-sdk/src/signer/signer.js +0 -275
- package/dist/spark-sdk/src/signer/signer.js.map +0 -1
- package/dist/spark-sdk/src/spark-sdk.d.ts +0 -377
- package/dist/spark-sdk/src/spark-sdk.js +0 -1205
- package/dist/spark-sdk/src/spark-sdk.js.map +0 -1
- package/dist/spark-sdk/src/tests/utils/test-faucet.d.ts +0 -24
- package/dist/spark-sdk/src/tests/utils/test-faucet.js +0 -182
- package/dist/spark-sdk/src/tests/utils/test-faucet.js.map +0 -1
- package/dist/spark-sdk/src/types/grpc.d.ts +0 -6
- package/dist/spark-sdk/src/types/grpc.js +0 -2
- package/dist/spark-sdk/src/types/grpc.js.map +0 -1
- package/dist/spark-sdk/src/types/index.d.ts +0 -3
- package/dist/spark-sdk/src/types/index.js +0 -4
- package/dist/spark-sdk/src/types/index.js.map +0 -1
- package/dist/spark-sdk/src/utils/adaptor-signature.d.ts +0 -7
- package/dist/spark-sdk/src/utils/adaptor-signature.js +0 -114
- package/dist/spark-sdk/src/utils/adaptor-signature.js.map +0 -1
- package/dist/spark-sdk/src/utils/bitcoin.d.ts +0 -12
- package/dist/spark-sdk/src/utils/bitcoin.js +0 -87
- package/dist/spark-sdk/src/utils/bitcoin.js.map +0 -1
- package/dist/spark-sdk/src/utils/crypto.d.ts +0 -1
- package/dist/spark-sdk/src/utils/crypto.js +0 -14
- package/dist/spark-sdk/src/utils/crypto.js.map +0 -1
- package/dist/spark-sdk/src/utils/index.d.ts +0 -12
- package/dist/spark-sdk/src/utils/index.js +0 -13
- package/dist/spark-sdk/src/utils/index.js.map +0 -1
- package/dist/spark-sdk/src/utils/keys.d.ts +0 -9
- package/dist/spark-sdk/src/utils/keys.js +0 -73
- package/dist/spark-sdk/src/utils/keys.js.map +0 -1
- package/dist/spark-sdk/src/utils/mempool.d.ts +0 -1
- package/dist/spark-sdk/src/utils/mempool.js +0 -29
- package/dist/spark-sdk/src/utils/mempool.js.map +0 -1
- package/dist/spark-sdk/src/utils/network.d.ts +0 -36
- package/dist/spark-sdk/src/utils/network.js +0 -65
- package/dist/spark-sdk/src/utils/network.js.map +0 -1
- package/dist/spark-sdk/src/utils/proof.d.ts +0 -1
- package/dist/spark-sdk/src/utils/proof.js +0 -12
- package/dist/spark-sdk/src/utils/proof.js.map +0 -1
- package/dist/spark-sdk/src/utils/response-validation.d.ts +0 -1
- package/dist/spark-sdk/src/utils/response-validation.js +0 -16
- package/dist/spark-sdk/src/utils/response-validation.js.map +0 -1
- package/dist/spark-sdk/src/utils/secret-sharing.d.ts +0 -26
- package/dist/spark-sdk/src/utils/secret-sharing.js +0 -174
- package/dist/spark-sdk/src/utils/secret-sharing.js.map +0 -1
- package/dist/spark-sdk/src/utils/signing.d.ts +0 -12
- package/dist/spark-sdk/src/utils/signing.js +0 -67
- package/dist/spark-sdk/src/utils/signing.js.map +0 -1
- package/dist/spark-sdk/src/utils/token-hashing.d.ts +0 -3
- package/dist/spark-sdk/src/utils/token-hashing.js +0 -116
- package/dist/spark-sdk/src/utils/token-hashing.js.map +0 -1
- package/dist/spark-sdk/src/utils/token-keyshares.d.ts +0 -5
- package/dist/spark-sdk/src/utils/token-keyshares.js +0 -17
- package/dist/spark-sdk/src/utils/token-keyshares.js.map +0 -1
- package/dist/spark-sdk/src/utils/token-transactions.d.ts +0 -5
- package/dist/spark-sdk/src/utils/token-transactions.js +0 -40
- package/dist/spark-sdk/src/utils/token-transactions.js.map +0 -1
- package/dist/spark-sdk/src/utils/transaction.d.ts +0 -9
- package/dist/spark-sdk/src/utils/transaction.js +0 -35
- package/dist/spark-sdk/src/utils/transaction.js.map +0 -1
- package/dist/spark-sdk/src/utils/wasm-wrapper.d.ts +0 -2
- package/dist/spark-sdk/src/utils/wasm-wrapper.js +0 -46
- package/dist/spark-sdk/src/utils/wasm-wrapper.js.map +0 -1
- package/dist/spark-sdk/src/utils/wasm.d.ts +0 -54
- package/dist/spark-sdk/src/utils/wasm.js +0 -26
- package/dist/spark-sdk/src/utils/wasm.js.map +0 -1
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
// buffer.js
|
|
2
|
+
import { Buffer } from "buffer";
|
|
3
|
+
if (typeof globalThis.Buffer === "undefined") {
|
|
4
|
+
globalThis.Buffer = Buffer;
|
|
5
|
+
}
|
|
6
|
+
if (typeof global === "undefined") {
|
|
7
|
+
window.global = window.globalThis;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
// src/types.ts
|
|
11
|
+
var LayerType = /* @__PURE__ */ ((LayerType2) => {
|
|
12
|
+
LayerType2["L1"] = "L1";
|
|
13
|
+
LayerType2["SPARK"] = "SPARK";
|
|
14
|
+
return LayerType2;
|
|
15
|
+
})(LayerType || {});
|
|
16
|
+
var OperationType = /* @__PURE__ */ ((OperationType2) => {
|
|
17
|
+
OperationType2["USER_TRANSFER"] = "USER_TRANSFER";
|
|
18
|
+
OperationType2["USER_BURN"] = "USER_BURN";
|
|
19
|
+
OperationType2["ISSUER_ANNOUNCE"] = "ISSUER_ANNOUNCE";
|
|
20
|
+
OperationType2["ISSUER_MINT"] = "ISSUER_MINT";
|
|
21
|
+
OperationType2["ISSUER_TRANSFER"] = "ISSUER_TRANSFER";
|
|
22
|
+
OperationType2["ISSUER_FREEZE"] = "ISSUER_FREEZE";
|
|
23
|
+
OperationType2["ISSUER_UNFREEZE"] = "ISSUER_UNFREEZE";
|
|
24
|
+
OperationType2["ISSUER_BURN"] = "ISSUER_BURN";
|
|
25
|
+
return OperationType2;
|
|
26
|
+
})(OperationType || {});
|
|
27
|
+
var OnChainTransactionStatus = /* @__PURE__ */ ((OnChainTransactionStatus2) => {
|
|
28
|
+
OnChainTransactionStatus2["PENDING"] = "PENDING";
|
|
29
|
+
OnChainTransactionStatus2["CONFIRMED"] = "CONFIRMED";
|
|
30
|
+
OnChainTransactionStatus2["WAITING_MINED"] = "WAITING_MINED";
|
|
31
|
+
OnChainTransactionStatus2["MINED"] = "MINED";
|
|
32
|
+
OnChainTransactionStatus2["ATTACHING"] = "ATTACHING";
|
|
33
|
+
OnChainTransactionStatus2["ATTACHED"] = "ATTACHED";
|
|
34
|
+
return OnChainTransactionStatus2;
|
|
35
|
+
})(OnChainTransactionStatus || {});
|
|
36
|
+
var SparkTransactionStatus = /* @__PURE__ */ ((SparkTransactionStatus2) => {
|
|
37
|
+
SparkTransactionStatus2["STARTED"] = "STARTED";
|
|
38
|
+
SparkTransactionStatus2["SIGNED"] = "SIGNED";
|
|
39
|
+
SparkTransactionStatus2["FINALIZED"] = "FINALIZED";
|
|
40
|
+
return SparkTransactionStatus2;
|
|
41
|
+
})(SparkTransactionStatus || {});
|
|
42
|
+
|
|
43
|
+
export {
|
|
44
|
+
LayerType,
|
|
45
|
+
OperationType,
|
|
46
|
+
OnChainTransactionStatus,
|
|
47
|
+
SparkTransactionStatus
|
|
48
|
+
};
|
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,518 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/index.ts
|
|
21
|
+
var index_exports = {};
|
|
22
|
+
__export(index_exports, {
|
|
23
|
+
IssuerSparkWallet: () => IssuerSparkWallet
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(index_exports);
|
|
26
|
+
|
|
27
|
+
// buffer.js
|
|
28
|
+
var import_buffer = require("buffer");
|
|
29
|
+
if (typeof globalThis.Buffer === "undefined") {
|
|
30
|
+
globalThis.Buffer = import_buffer.Buffer;
|
|
31
|
+
}
|
|
32
|
+
if (typeof global === "undefined") {
|
|
33
|
+
window.global = window.globalThis;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// src/issuer-spark-wallet.ts
|
|
37
|
+
var import_lrc20_sdk2 = require("@buildonspark/lrc20-sdk");
|
|
38
|
+
var import_spark_sdk = require("@buildonspark/spark-sdk");
|
|
39
|
+
var import_utils5 = require("@buildonspark/spark-sdk/utils");
|
|
40
|
+
var import_utils6 = require("@noble/curves/abstract/utils");
|
|
41
|
+
var import_bip39 = require("@scure/bip39");
|
|
42
|
+
var import_english = require("@scure/bip39/wordlists/english");
|
|
43
|
+
|
|
44
|
+
// src/services/freeze.ts
|
|
45
|
+
var import_utils2 = require("@buildonspark/spark-sdk/utils");
|
|
46
|
+
|
|
47
|
+
// src/utils/token-hashing.ts
|
|
48
|
+
var import_utils = require("@scure/btc-signer/utils");
|
|
49
|
+
function hashFreezeTokensPayload(payload) {
|
|
50
|
+
if (!payload) {
|
|
51
|
+
throw new Error("freeze tokens payload cannot be nil");
|
|
52
|
+
}
|
|
53
|
+
let allHashes = [];
|
|
54
|
+
const ownerPubKeyHash = import_utils.sha256.create();
|
|
55
|
+
if (payload.ownerPublicKey) {
|
|
56
|
+
ownerPubKeyHash.update(payload.ownerPublicKey);
|
|
57
|
+
}
|
|
58
|
+
allHashes.push(ownerPubKeyHash.digest());
|
|
59
|
+
const tokenPubKeyHash = import_utils.sha256.create();
|
|
60
|
+
if (payload.tokenPublicKey) {
|
|
61
|
+
tokenPubKeyHash.update(payload.tokenPublicKey);
|
|
62
|
+
}
|
|
63
|
+
allHashes.push(tokenPubKeyHash.digest());
|
|
64
|
+
const shouldUnfreezeHash = import_utils.sha256.create();
|
|
65
|
+
shouldUnfreezeHash.update(new Uint8Array([payload.shouldUnfreeze ? 1 : 0]));
|
|
66
|
+
allHashes.push(shouldUnfreezeHash.digest());
|
|
67
|
+
const timestampHash = import_utils.sha256.create();
|
|
68
|
+
if (payload.issuerProvidedTimestamp) {
|
|
69
|
+
const timestampBytes = new Uint8Array(8);
|
|
70
|
+
new DataView(timestampBytes.buffer).setBigUint64(
|
|
71
|
+
0,
|
|
72
|
+
BigInt(payload.issuerProvidedTimestamp),
|
|
73
|
+
true
|
|
74
|
+
// true for little-endian
|
|
75
|
+
);
|
|
76
|
+
timestampHash.update(timestampBytes);
|
|
77
|
+
}
|
|
78
|
+
allHashes.push(timestampHash.digest());
|
|
79
|
+
const operatorPubKeyHash = import_utils.sha256.create();
|
|
80
|
+
if (payload.operatorIdentityPublicKey) {
|
|
81
|
+
operatorPubKeyHash.update(payload.operatorIdentityPublicKey);
|
|
82
|
+
}
|
|
83
|
+
allHashes.push(operatorPubKeyHash.digest());
|
|
84
|
+
const finalHash = import_utils.sha256.create();
|
|
85
|
+
for (const hash of allHashes) {
|
|
86
|
+
finalHash.update(hash);
|
|
87
|
+
}
|
|
88
|
+
return finalHash.digest();
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
// src/services/freeze.ts
|
|
92
|
+
var TokenFreezeService = class {
|
|
93
|
+
config;
|
|
94
|
+
connectionManager;
|
|
95
|
+
constructor(config, connectionManager) {
|
|
96
|
+
this.config = config;
|
|
97
|
+
this.connectionManager = connectionManager;
|
|
98
|
+
}
|
|
99
|
+
async freezeTokens(ownerPublicKey, tokenPublicKey) {
|
|
100
|
+
return this.freezeOperation(ownerPublicKey, tokenPublicKey, false);
|
|
101
|
+
}
|
|
102
|
+
async unfreezeTokens(ownerPublicKey, tokenPublicKey) {
|
|
103
|
+
return this.freezeOperation(ownerPublicKey, tokenPublicKey, true);
|
|
104
|
+
}
|
|
105
|
+
async freezeOperation(ownerPublicKey, tokenPublicKey, shouldUnfreeze) {
|
|
106
|
+
const signingOperators = this.config.getSigningOperators();
|
|
107
|
+
const issuerProvidedTimestamp = Date.now();
|
|
108
|
+
const freezeResponses = await Promise.allSettled(
|
|
109
|
+
Object.entries(signingOperators).map(async ([identifier, operator]) => {
|
|
110
|
+
const internalSparkClient = await this.connectionManager.createSparkClient(operator.address);
|
|
111
|
+
const freezeTokensPayload = {
|
|
112
|
+
ownerPublicKey,
|
|
113
|
+
tokenPublicKey,
|
|
114
|
+
shouldUnfreeze,
|
|
115
|
+
issuerProvidedTimestamp,
|
|
116
|
+
operatorIdentityPublicKey: operator.identityPublicKey
|
|
117
|
+
};
|
|
118
|
+
const hashedPayload = hashFreezeTokensPayload(freezeTokensPayload);
|
|
119
|
+
const issuerSignature = await this.config.signer.signMessageWithIdentityKey(hashedPayload);
|
|
120
|
+
const response = await internalSparkClient.freeze_tokens({
|
|
121
|
+
freezeTokensPayload,
|
|
122
|
+
issuerSignature
|
|
123
|
+
});
|
|
124
|
+
return {
|
|
125
|
+
identifier,
|
|
126
|
+
response
|
|
127
|
+
};
|
|
128
|
+
})
|
|
129
|
+
);
|
|
130
|
+
const successfulResponses = (0, import_utils2.validateResponses)(freezeResponses);
|
|
131
|
+
return successfulResponses[0].response;
|
|
132
|
+
}
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
// src/services/token-transactions.ts
|
|
136
|
+
var import_token_transactions = require("@buildonspark/spark-sdk/token-transactions");
|
|
137
|
+
var import_utils3 = require("@noble/curves/abstract/utils");
|
|
138
|
+
var IssuerTokenTransactionService = class extends import_token_transactions.TokenTransactionService {
|
|
139
|
+
constructor(config, connectionManager) {
|
|
140
|
+
super(config, connectionManager);
|
|
141
|
+
}
|
|
142
|
+
async constructMintTokenTransaction(tokenPublicKey, tokenAmount) {
|
|
143
|
+
return {
|
|
144
|
+
tokenInput: {
|
|
145
|
+
$case: "mintInput",
|
|
146
|
+
mintInput: {
|
|
147
|
+
issuerPublicKey: tokenPublicKey,
|
|
148
|
+
issuerProvidedTimestamp: Date.now()
|
|
149
|
+
}
|
|
150
|
+
},
|
|
151
|
+
outputLeaves: [
|
|
152
|
+
{
|
|
153
|
+
ownerPublicKey: tokenPublicKey,
|
|
154
|
+
tokenPublicKey,
|
|
155
|
+
tokenAmount: (0, import_utils3.numberToBytesBE)(tokenAmount, 16)
|
|
156
|
+
}
|
|
157
|
+
],
|
|
158
|
+
sparkOperatorIdentityPublicKeys: super.collectOperatorIdentityPublicKeys()
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
};
|
|
162
|
+
|
|
163
|
+
// src/utils/type-mappers.ts
|
|
164
|
+
var import_utils4 = require("@noble/curves/abstract/utils");
|
|
165
|
+
|
|
166
|
+
// src/utils/enum-mappers.ts
|
|
167
|
+
var import_lrc20_sdk = require("@buildonspark/lrc20-sdk");
|
|
168
|
+
function mapOperationType(type) {
|
|
169
|
+
switch (type) {
|
|
170
|
+
case import_lrc20_sdk.Lrc20Protos.OperationType.USER_TRANSFER:
|
|
171
|
+
return "USER_TRANSFER" /* USER_TRANSFER */;
|
|
172
|
+
case import_lrc20_sdk.Lrc20Protos.OperationType.USER_BURN:
|
|
173
|
+
return "USER_BURN" /* USER_BURN */;
|
|
174
|
+
case import_lrc20_sdk.Lrc20Protos.OperationType.ISSUER_ANNOUNCE:
|
|
175
|
+
return "ISSUER_ANNOUNCE" /* ISSUER_ANNOUNCE */;
|
|
176
|
+
case import_lrc20_sdk.Lrc20Protos.OperationType.ISSUER_MINT:
|
|
177
|
+
return "ISSUER_MINT" /* ISSUER_MINT */;
|
|
178
|
+
case import_lrc20_sdk.Lrc20Protos.OperationType.ISSUER_TRANSFER:
|
|
179
|
+
return "ISSUER_TRANSFER" /* ISSUER_TRANSFER */;
|
|
180
|
+
case import_lrc20_sdk.Lrc20Protos.OperationType.ISSUER_FREEZE:
|
|
181
|
+
return "ISSUER_FREEZE" /* ISSUER_FREEZE */;
|
|
182
|
+
case import_lrc20_sdk.Lrc20Protos.OperationType.ISSUER_UNFREEZE:
|
|
183
|
+
return "ISSUER_UNFREEZE" /* ISSUER_UNFREEZE */;
|
|
184
|
+
case import_lrc20_sdk.Lrc20Protos.OperationType.ISSUER_BURN:
|
|
185
|
+
return "ISSUER_BURN" /* ISSUER_BURN */;
|
|
186
|
+
default:
|
|
187
|
+
return "USER_TRANSFER" /* USER_TRANSFER */;
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
function mapOnChainTransactionStatus(status) {
|
|
191
|
+
switch (status) {
|
|
192
|
+
case import_lrc20_sdk.Lrc20Protos.OnChainTransactionStatus.PENDING:
|
|
193
|
+
return "PENDING" /* PENDING */;
|
|
194
|
+
case import_lrc20_sdk.Lrc20Protos.OnChainTransactionStatus.CONFIRMED:
|
|
195
|
+
return "CONFIRMED" /* CONFIRMED */;
|
|
196
|
+
case import_lrc20_sdk.Lrc20Protos.OnChainTransactionStatus.WAITING_MINED:
|
|
197
|
+
return "WAITING_MINED" /* WAITING_MINED */;
|
|
198
|
+
case import_lrc20_sdk.Lrc20Protos.OnChainTransactionStatus.MINED:
|
|
199
|
+
return "MINED" /* MINED */;
|
|
200
|
+
case import_lrc20_sdk.Lrc20Protos.OnChainTransactionStatus.ATTACHING:
|
|
201
|
+
return "ATTACHING" /* ATTACHING */;
|
|
202
|
+
case import_lrc20_sdk.Lrc20Protos.OnChainTransactionStatus.ATTACHED:
|
|
203
|
+
return "ATTACHED" /* ATTACHED */;
|
|
204
|
+
default:
|
|
205
|
+
return "PENDING" /* PENDING */;
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
function mapSparkTransactionStatus(status) {
|
|
209
|
+
switch (status) {
|
|
210
|
+
case import_lrc20_sdk.Lrc20Protos.SparkTransactionStatus.STARTED:
|
|
211
|
+
return "STARTED" /* STARTED */;
|
|
212
|
+
case import_lrc20_sdk.Lrc20Protos.SparkTransactionStatus.SIGNED:
|
|
213
|
+
return "SIGNED" /* SIGNED */;
|
|
214
|
+
case import_lrc20_sdk.Lrc20Protos.SparkTransactionStatus.FINALIZED:
|
|
215
|
+
return "FINALIZED" /* FINALIZED */;
|
|
216
|
+
default:
|
|
217
|
+
return "STARTED" /* STARTED */;
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
function mapLayer(layer) {
|
|
221
|
+
switch (layer) {
|
|
222
|
+
case 0:
|
|
223
|
+
return "L1" /* L1 */;
|
|
224
|
+
case 1:
|
|
225
|
+
return "SPARK" /* SPARK */;
|
|
226
|
+
default:
|
|
227
|
+
return "L1" /* L1 */;
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
// src/utils/type-mappers.ts
|
|
232
|
+
function convertToTokenPubKeyInfoResponse(tokenPubkeyInfo) {
|
|
233
|
+
return {
|
|
234
|
+
announcement: tokenPubkeyInfo?.announcement ? {
|
|
235
|
+
tokenPubkey: {
|
|
236
|
+
pubkey: (0, import_utils4.bytesToHex)(tokenPubkeyInfo.announcement.tokenPubkey.pubkey)
|
|
237
|
+
},
|
|
238
|
+
name: tokenPubkeyInfo.announcement.name,
|
|
239
|
+
symbol: tokenPubkeyInfo.announcement.symbol,
|
|
240
|
+
decimal: tokenPubkeyInfo.announcement.decimal,
|
|
241
|
+
maxSupply: tokenPubkeyInfo.announcement.maxSupply,
|
|
242
|
+
isFreezable: tokenPubkeyInfo.announcement.isFreezable
|
|
243
|
+
} : null,
|
|
244
|
+
totalSupply: tokenPubkeyInfo?.totalSupply ?? "0"
|
|
245
|
+
};
|
|
246
|
+
}
|
|
247
|
+
function convertTokenActivityToHexEncoded(rawTransactions) {
|
|
248
|
+
const response = {
|
|
249
|
+
transactions: rawTransactions.transactions.map((transaction) => {
|
|
250
|
+
if (!transaction.transaction) {
|
|
251
|
+
return { transaction: void 0 };
|
|
252
|
+
}
|
|
253
|
+
if (transaction.transaction.$case === "onChain") {
|
|
254
|
+
const onChain = transaction.transaction.onChain;
|
|
255
|
+
return {
|
|
256
|
+
transaction: {
|
|
257
|
+
$case: "onChain",
|
|
258
|
+
onChain: {
|
|
259
|
+
operationType: mapOperationType(onChain.operationType),
|
|
260
|
+
transactionHash: (0, import_utils4.bytesToHex)(onChain.transactionHash),
|
|
261
|
+
rawtx: (0, import_utils4.bytesToHex)(onChain.rawtx),
|
|
262
|
+
status: mapOnChainTransactionStatus(onChain.status),
|
|
263
|
+
inputs: onChain.inputs.map((input) => ({
|
|
264
|
+
rawTx: (0, import_utils4.bytesToHex)(input.rawTx),
|
|
265
|
+
vout: input.vout,
|
|
266
|
+
amountSats: input.amountSats,
|
|
267
|
+
tokenPublicKey: input.tokenPublicKey,
|
|
268
|
+
tokenAmount: input.tokenAmount ? (0, import_utils4.bytesToNumberBE)(input.tokenAmount).toString() : void 0
|
|
269
|
+
})),
|
|
270
|
+
outputs: onChain.outputs.map((output) => ({
|
|
271
|
+
rawTx: (0, import_utils4.bytesToHex)(output.rawTx),
|
|
272
|
+
vout: output.vout,
|
|
273
|
+
amountSats: output.amountSats,
|
|
274
|
+
tokenPublicKey: output.tokenPublicKey,
|
|
275
|
+
tokenAmount: output.tokenAmount ? (0, import_utils4.bytesToNumberBE)(output.tokenAmount).toString() : void 0
|
|
276
|
+
})),
|
|
277
|
+
broadcastedAt: onChain.broadcastedAt,
|
|
278
|
+
confirmedAt: onChain.confirmedAt
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
};
|
|
282
|
+
} else if (transaction.transaction.$case === "spark") {
|
|
283
|
+
const spark = transaction.transaction.spark;
|
|
284
|
+
return {
|
|
285
|
+
transaction: {
|
|
286
|
+
$case: "spark",
|
|
287
|
+
spark: {
|
|
288
|
+
operationType: mapOperationType(spark.operationType),
|
|
289
|
+
transactionHash: (0, import_utils4.bytesToHex)(spark.transactionHash),
|
|
290
|
+
status: mapSparkTransactionStatus(spark.status),
|
|
291
|
+
confirmedAt: spark.confirmedAt,
|
|
292
|
+
leavesToCreate: spark.leavesToCreate.map((leaf) => ({
|
|
293
|
+
tokenPublicKey: (0, import_utils4.bytesToHex)(leaf.tokenPublicKey),
|
|
294
|
+
id: leaf.id,
|
|
295
|
+
ownerPublicKey: (0, import_utils4.bytesToHex)(leaf.ownerPublicKey),
|
|
296
|
+
revocationPublicKey: (0, import_utils4.bytesToHex)(leaf.revocationPublicKey),
|
|
297
|
+
withdrawalBondSats: leaf.withdrawalBondSats,
|
|
298
|
+
withdrawalLocktime: leaf.withdrawalLocktime,
|
|
299
|
+
tokenAmount: (0, import_utils4.bytesToNumberBE)(leaf.tokenAmount).toString(),
|
|
300
|
+
createTxHash: (0, import_utils4.bytesToHex)(leaf.createTxHash),
|
|
301
|
+
createTxVoutIndex: leaf.createTxVoutIndex,
|
|
302
|
+
spendTxHash: leaf.spendTxHash ? (0, import_utils4.bytesToHex)(leaf.spendTxHash) : void 0,
|
|
303
|
+
spendTxVoutIndex: leaf.spendTxVoutIndex,
|
|
304
|
+
isFrozen: leaf.isFrozen
|
|
305
|
+
})),
|
|
306
|
+
leavesToSpend: spark.leavesToSpend.map((leaf) => ({
|
|
307
|
+
tokenPublicKey: (0, import_utils4.bytesToHex)(leaf.tokenPublicKey),
|
|
308
|
+
id: leaf.id,
|
|
309
|
+
ownerPublicKey: (0, import_utils4.bytesToHex)(leaf.ownerPublicKey),
|
|
310
|
+
revocationPublicKey: (0, import_utils4.bytesToHex)(leaf.revocationPublicKey),
|
|
311
|
+
withdrawalBondSats: leaf.withdrawalBondSats,
|
|
312
|
+
withdrawalLocktime: leaf.withdrawalLocktime,
|
|
313
|
+
tokenAmount: (0, import_utils4.bytesToNumberBE)(leaf.tokenAmount).toString(),
|
|
314
|
+
createTxHash: (0, import_utils4.bytesToHex)(leaf.createTxHash),
|
|
315
|
+
createTxVoutIndex: leaf.createTxVoutIndex,
|
|
316
|
+
spendTxHash: leaf.spendTxHash ? (0, import_utils4.bytesToHex)(leaf.spendTxHash) : void 0,
|
|
317
|
+
spendTxVoutIndex: leaf.spendTxVoutIndex,
|
|
318
|
+
isFrozen: leaf.isFrozen
|
|
319
|
+
})),
|
|
320
|
+
sparkOperatorIdentityPublicKeys: spark.sparkOperatorIdentityPublicKeys.map((key) => (0, import_utils4.bytesToHex)(key))
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
};
|
|
324
|
+
}
|
|
325
|
+
return { transaction: void 0 };
|
|
326
|
+
}),
|
|
327
|
+
nextCursor: rawTransactions.nextCursor ? {
|
|
328
|
+
lastTransactionHash: (0, import_utils4.bytesToHex)(rawTransactions.nextCursor.lastTransactionHash),
|
|
329
|
+
layer: mapLayer(rawTransactions.nextCursor.layer)
|
|
330
|
+
} : void 0
|
|
331
|
+
};
|
|
332
|
+
return response;
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
// src/issuer-spark-wallet.ts
|
|
336
|
+
var BURN_ADDRESS = "02".repeat(33);
|
|
337
|
+
var IssuerSparkWallet = class _IssuerSparkWallet extends import_spark_sdk.SparkWallet {
|
|
338
|
+
issuerTokenTransactionService;
|
|
339
|
+
tokenFreezeService;
|
|
340
|
+
tokenPublicKeyInfo;
|
|
341
|
+
static async initialize(options) {
|
|
342
|
+
const wallet = new _IssuerSparkWallet(options.options);
|
|
343
|
+
const initResponse = await wallet.initIssuerWallet(options.mnemonicOrSeed);
|
|
344
|
+
return {
|
|
345
|
+
wallet,
|
|
346
|
+
...initResponse
|
|
347
|
+
};
|
|
348
|
+
}
|
|
349
|
+
constructor(configOptions) {
|
|
350
|
+
super(configOptions);
|
|
351
|
+
this.issuerTokenTransactionService = new IssuerTokenTransactionService(
|
|
352
|
+
this.config,
|
|
353
|
+
this.connectionManager
|
|
354
|
+
);
|
|
355
|
+
this.tokenFreezeService = new TokenFreezeService(
|
|
356
|
+
this.config,
|
|
357
|
+
this.connectionManager
|
|
358
|
+
);
|
|
359
|
+
}
|
|
360
|
+
async initIssuerWallet(mnemonicOrSeed) {
|
|
361
|
+
const initResponse = await super.initWallet(mnemonicOrSeed);
|
|
362
|
+
mnemonicOrSeed = mnemonicOrSeed || initResponse?.mnemonic;
|
|
363
|
+
if (mnemonicOrSeed) {
|
|
364
|
+
let seed;
|
|
365
|
+
if (typeof mnemonicOrSeed !== "string") {
|
|
366
|
+
seed = mnemonicOrSeed;
|
|
367
|
+
} else {
|
|
368
|
+
if ((0, import_bip39.validateMnemonic)(mnemonicOrSeed, import_english.wordlist)) {
|
|
369
|
+
seed = await this.config.signer.mnemonicToSeed(mnemonicOrSeed);
|
|
370
|
+
} else {
|
|
371
|
+
seed = (0, import_utils6.hexToBytes)(mnemonicOrSeed);
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
const hdkey = (0, import_utils5.getMasterHDKeyFromSeed)(seed);
|
|
375
|
+
const accountType = this.config.getNetwork() === import_utils5.Network.REGTEST ? 0 : 1;
|
|
376
|
+
const identityKey = hdkey.derive(`m/8797555'/${accountType}'/0'`);
|
|
377
|
+
const network = this.config.getNetwork();
|
|
378
|
+
this.lrc20Wallet = new import_lrc20_sdk2.LRCWallet(
|
|
379
|
+
(0, import_utils6.bytesToHex)(identityKey.privateKey),
|
|
380
|
+
import_utils5.LRC_WALLET_NETWORK[network],
|
|
381
|
+
import_utils5.LRC_WALLET_NETWORK_TYPE[network]
|
|
382
|
+
);
|
|
383
|
+
}
|
|
384
|
+
return initResponse;
|
|
385
|
+
}
|
|
386
|
+
async getIssuerTokenBalance() {
|
|
387
|
+
const publicKey = await super.getIdentityPublicKey();
|
|
388
|
+
const balanceObj = await this.getBalance();
|
|
389
|
+
if (!balanceObj.tokenBalances || !balanceObj.tokenBalances.has(publicKey)) {
|
|
390
|
+
return {
|
|
391
|
+
balance: 0n
|
|
392
|
+
};
|
|
393
|
+
}
|
|
394
|
+
return {
|
|
395
|
+
balance: balanceObj.tokenBalances.get(publicKey).balance
|
|
396
|
+
};
|
|
397
|
+
}
|
|
398
|
+
async getIssuerTokenInfo() {
|
|
399
|
+
if (this.tokenPublicKeyInfo) {
|
|
400
|
+
return convertToTokenPubKeyInfoResponse(this.tokenPublicKeyInfo);
|
|
401
|
+
}
|
|
402
|
+
const tokenPublicKey = (0, import_utils6.bytesToHex)(this.lrc20Wallet.pubkey);
|
|
403
|
+
const rawTokenPubkeyInfo = await this.lrc20Wallet.getTokenPubkeyInfo(tokenPublicKey);
|
|
404
|
+
this.tokenPublicKeyInfo = rawTokenPubkeyInfo;
|
|
405
|
+
if (!rawTokenPubkeyInfo) {
|
|
406
|
+
return null;
|
|
407
|
+
}
|
|
408
|
+
return convertToTokenPubKeyInfoResponse(rawTokenPubkeyInfo);
|
|
409
|
+
}
|
|
410
|
+
async getIssuerTokenPublicKey() {
|
|
411
|
+
return await super.getIdentityPublicKey();
|
|
412
|
+
}
|
|
413
|
+
async mintTokens(tokenAmount) {
|
|
414
|
+
var tokenPublicKey = await super.getIdentityPublicKey();
|
|
415
|
+
const tokenTransaction = await this.issuerTokenTransactionService.constructMintTokenTransaction(
|
|
416
|
+
(0, import_utils6.hexToBytes)(tokenPublicKey),
|
|
417
|
+
tokenAmount
|
|
418
|
+
);
|
|
419
|
+
return await this.issuerTokenTransactionService.broadcastTokenTransaction(
|
|
420
|
+
tokenTransaction
|
|
421
|
+
);
|
|
422
|
+
}
|
|
423
|
+
async burnTokens(tokenAmount, selectedLeaves) {
|
|
424
|
+
return await this.transferTokens({
|
|
425
|
+
tokenPublicKey: await super.getIdentityPublicKey(),
|
|
426
|
+
tokenAmount,
|
|
427
|
+
receiverSparkAddress: BURN_ADDRESS,
|
|
428
|
+
selectedLeaves
|
|
429
|
+
});
|
|
430
|
+
}
|
|
431
|
+
async freezeTokens(ownerPublicKey) {
|
|
432
|
+
await this.syncTokenLeaves();
|
|
433
|
+
const tokenPublicKey = await super.getIdentityPublicKey();
|
|
434
|
+
const response = await this.tokenFreezeService.freezeTokens(
|
|
435
|
+
(0, import_utils6.hexToBytes)(ownerPublicKey),
|
|
436
|
+
(0, import_utils6.hexToBytes)(tokenPublicKey)
|
|
437
|
+
);
|
|
438
|
+
const tokenAmount = (0, import_utils6.bytesToNumberBE)(response.impactedTokenAmount);
|
|
439
|
+
return {
|
|
440
|
+
impactedLeafIds: response.impactedLeafIds,
|
|
441
|
+
impactedTokenAmount: tokenAmount
|
|
442
|
+
};
|
|
443
|
+
}
|
|
444
|
+
async unfreezeTokens(ownerPublicKey) {
|
|
445
|
+
await this.syncTokenLeaves();
|
|
446
|
+
const tokenPublicKey = await super.getIdentityPublicKey();
|
|
447
|
+
const response = await this.tokenFreezeService.unfreezeTokens(
|
|
448
|
+
(0, import_utils6.hexToBytes)(ownerPublicKey),
|
|
449
|
+
(0, import_utils6.hexToBytes)(tokenPublicKey)
|
|
450
|
+
);
|
|
451
|
+
const tokenAmount = (0, import_utils6.bytesToNumberBE)(response.impactedTokenAmount);
|
|
452
|
+
return {
|
|
453
|
+
impactedLeafIds: response.impactedLeafIds,
|
|
454
|
+
impactedTokenAmount: tokenAmount
|
|
455
|
+
};
|
|
456
|
+
}
|
|
457
|
+
async getTokenActivity(pageSize = 100, cursor, operationTypes, beforeTimestamp, afterTimestamp) {
|
|
458
|
+
const lrc20Client = await this.lrc20ConnectionManager.createLrc20Client();
|
|
459
|
+
const transactions = await lrc20Client.listTransactions({
|
|
460
|
+
tokenPublicKey: (0, import_utils6.hexToBytes)(await super.getIdentityPublicKey()),
|
|
461
|
+
cursor,
|
|
462
|
+
pageSize,
|
|
463
|
+
beforeTimestamp,
|
|
464
|
+
afterTimestamp,
|
|
465
|
+
operationTypes
|
|
466
|
+
});
|
|
467
|
+
return convertTokenActivityToHexEncoded(transactions);
|
|
468
|
+
}
|
|
469
|
+
async getIssuerTokenActivity(pageSize = 100, cursor, operationTypes, beforeTimestamp, afterTimestamp) {
|
|
470
|
+
const lrc20Client = await this.lrc20ConnectionManager.createLrc20Client();
|
|
471
|
+
const transactions = await lrc20Client.listTransactions({
|
|
472
|
+
tokenPublicKey: (0, import_utils6.hexToBytes)(await super.getIdentityPublicKey()),
|
|
473
|
+
ownerPublicKey: (0, import_utils6.hexToBytes)(await super.getIdentityPublicKey()),
|
|
474
|
+
cursor,
|
|
475
|
+
pageSize,
|
|
476
|
+
beforeTimestamp,
|
|
477
|
+
afterTimestamp,
|
|
478
|
+
operationTypes
|
|
479
|
+
});
|
|
480
|
+
return convertTokenActivityToHexEncoded(transactions);
|
|
481
|
+
}
|
|
482
|
+
async announceTokenL1({
|
|
483
|
+
tokenName,
|
|
484
|
+
tokenTicker,
|
|
485
|
+
decimals,
|
|
486
|
+
maxSupply,
|
|
487
|
+
isFreezable,
|
|
488
|
+
feeRateSatsPerVb = 2
|
|
489
|
+
}) {
|
|
490
|
+
await this.lrc20Wallet.syncWallet();
|
|
491
|
+
const tokenPublicKey = new import_lrc20_sdk2.TokenPubkey(this.lrc20Wallet.pubkey);
|
|
492
|
+
const announcement = new import_lrc20_sdk2.TokenPubkeyAnnouncement(
|
|
493
|
+
tokenPublicKey,
|
|
494
|
+
tokenName,
|
|
495
|
+
tokenTicker,
|
|
496
|
+
decimals,
|
|
497
|
+
maxSupply,
|
|
498
|
+
isFreezable
|
|
499
|
+
);
|
|
500
|
+
const tx = await this.lrc20Wallet.prepareAnnouncement(
|
|
501
|
+
announcement,
|
|
502
|
+
feeRateSatsPerVb
|
|
503
|
+
);
|
|
504
|
+
return await this.lrc20Wallet.broadcastRawBtcTransaction(
|
|
505
|
+
tx.bitcoin_tx.toHex()
|
|
506
|
+
);
|
|
507
|
+
}
|
|
508
|
+
mintTokensL1(tokenAmount) {
|
|
509
|
+
throw new Error("Not implemented");
|
|
510
|
+
}
|
|
511
|
+
transferTokensL1(tokenAmount, p2trAddress) {
|
|
512
|
+
throw new Error("Not implemented");
|
|
513
|
+
}
|
|
514
|
+
};
|
|
515
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
516
|
+
0 && (module.exports = {
|
|
517
|
+
IssuerSparkWallet
|
|
518
|
+
});
|
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { CreateLightningInvoiceParams, PayLightningInvoiceParams, TokenInfo, SparkWallet, SparkWalletProps } from '@buildonspark/spark-sdk';
|
|
2
|
+
import { QueryAllTransfersResponse, Transfer, LeafWithPreviousTransactionData, TokenTransactionWithStatus } from '@buildonspark/spark-sdk/proto/spark';
|
|
3
|
+
import { ListAllTokenTransactionsCursor, OperationType } from '@buildonspark/lrc20-sdk/proto/rpc/v1/types';
|
|
4
|
+
import { LRCWallet } from '@buildonspark/lrc20-sdk';
|
|
5
|
+
import { LightningReceiveRequest } from '@buildonspark/spark-sdk/types';
|
|
6
|
+
import { GetTokenActivityResponse, TokenPubKeyInfoResponse } from './types.cjs';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Interface for the IssuerSparkWallet that includes all functions from both SparkWallet and IssuerSparkWallet
|
|
10
|
+
*/
|
|
11
|
+
interface IssuerWalletInterface {
|
|
12
|
+
getIdentityPublicKey(): Promise<string>;
|
|
13
|
+
getSparkAddress(): Promise<string>;
|
|
14
|
+
getTransfers(limit?: number, offset?: number): Promise<QueryAllTransfersResponse>;
|
|
15
|
+
getBalance(forceRefetch?: boolean): Promise<{
|
|
16
|
+
balance: bigint;
|
|
17
|
+
tokenBalances: Map<string, {
|
|
18
|
+
balance: bigint;
|
|
19
|
+
}>;
|
|
20
|
+
}>;
|
|
21
|
+
getDepositAddress(): Promise<string>;
|
|
22
|
+
transfer(params: {
|
|
23
|
+
receiverSparkAddress: string;
|
|
24
|
+
amountSats: number;
|
|
25
|
+
}): Promise<Transfer | string>;
|
|
26
|
+
createLightningInvoice(params: CreateLightningInvoiceParams): Promise<LightningReceiveRequest>;
|
|
27
|
+
payLightningInvoice(params: PayLightningInvoiceParams): Promise<any>;
|
|
28
|
+
withdraw(params: {
|
|
29
|
+
onchainAddress: string;
|
|
30
|
+
amountSats?: number;
|
|
31
|
+
}): Promise<any>;
|
|
32
|
+
transferTokens(params: {
|
|
33
|
+
tokenPublicKey: string;
|
|
34
|
+
tokenAmount: bigint;
|
|
35
|
+
receiverSparkAddress: string;
|
|
36
|
+
selectedLeaves?: LeafWithPreviousTransactionData[];
|
|
37
|
+
}): Promise<string>;
|
|
38
|
+
getIssuerTokenPublicKey(): Promise<string>;
|
|
39
|
+
getIssuerTokenBalance(): Promise<{
|
|
40
|
+
balance: bigint;
|
|
41
|
+
}>;
|
|
42
|
+
mintTokens(tokenAmount: bigint): Promise<string>;
|
|
43
|
+
getTokenActivity(pageSize: number, cursor?: ListAllTokenTransactionsCursor, operationTypes?: OperationType[], beforeTimestamp?: Date): Promise<GetTokenActivityResponse>;
|
|
44
|
+
getIssuerTokenActivity(pageSize: number, cursor?: ListAllTokenTransactionsCursor, operationTypes?: OperationType[], beforeTimestamp?: Date, afterTimestamp?: Date): Promise<GetTokenActivityResponse>;
|
|
45
|
+
getTokenTransactions(tokenPublicKeys: string[], tokenTransactionHashes?: string[]): Promise<TokenTransactionWithStatus[]>;
|
|
46
|
+
getTokenInfo(): Promise<TokenInfo[]>;
|
|
47
|
+
getIssuerTokenInfo(): Promise<TokenPubKeyInfoResponse | null>;
|
|
48
|
+
burnTokens(tokenAmount: bigint, selectedLeaves?: LeafWithPreviousTransactionData[]): Promise<string>;
|
|
49
|
+
freezeTokens(ownerPublicKey: string): Promise<{
|
|
50
|
+
impactedLeafIds: string[];
|
|
51
|
+
impactedTokenAmount: bigint;
|
|
52
|
+
}>;
|
|
53
|
+
unfreezeTokens(ownerPublicKey: string): Promise<{
|
|
54
|
+
impactedLeafIds: string[];
|
|
55
|
+
impactedTokenAmount: bigint;
|
|
56
|
+
}>;
|
|
57
|
+
getTokenL1Address(): Promise<string>;
|
|
58
|
+
announceTokenL1(params: {
|
|
59
|
+
lrc20Wallet: LRCWallet;
|
|
60
|
+
tokenName: string;
|
|
61
|
+
tokenTicker: string;
|
|
62
|
+
decimals: number;
|
|
63
|
+
maxSupply: bigint;
|
|
64
|
+
isFreezable: boolean;
|
|
65
|
+
feeRateSatsPerVb?: number;
|
|
66
|
+
}): Promise<string>;
|
|
67
|
+
mintTokensL1(tokenAmount: bigint): Promise<string>;
|
|
68
|
+
transferTokensL1(tokenAmount: bigint, p2trAddress: string): Promise<string>;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
declare class IssuerSparkWallet extends SparkWallet implements IssuerWalletInterface {
|
|
72
|
+
private issuerTokenTransactionService;
|
|
73
|
+
private tokenFreezeService;
|
|
74
|
+
private tokenPublicKeyInfo?;
|
|
75
|
+
static initialize(options: SparkWalletProps): Promise<{
|
|
76
|
+
mnemonic?: string | undefined;
|
|
77
|
+
wallet: IssuerSparkWallet;
|
|
78
|
+
}>;
|
|
79
|
+
private constructor();
|
|
80
|
+
private initIssuerWallet;
|
|
81
|
+
getIssuerTokenBalance(): Promise<{
|
|
82
|
+
balance: bigint;
|
|
83
|
+
}>;
|
|
84
|
+
getIssuerTokenInfo(): Promise<TokenPubKeyInfoResponse | null>;
|
|
85
|
+
getIssuerTokenPublicKey(): Promise<string>;
|
|
86
|
+
mintTokens(tokenAmount: bigint): Promise<string>;
|
|
87
|
+
burnTokens(tokenAmount: bigint, selectedLeaves?: LeafWithPreviousTransactionData[]): Promise<string>;
|
|
88
|
+
freezeTokens(ownerPublicKey: string): Promise<{
|
|
89
|
+
impactedLeafIds: string[];
|
|
90
|
+
impactedTokenAmount: bigint;
|
|
91
|
+
}>;
|
|
92
|
+
unfreezeTokens(ownerPublicKey: string): Promise<{
|
|
93
|
+
impactedLeafIds: string[];
|
|
94
|
+
impactedTokenAmount: bigint;
|
|
95
|
+
}>;
|
|
96
|
+
getTokenActivity(pageSize?: number, cursor?: ListAllTokenTransactionsCursor, operationTypes?: OperationType[], beforeTimestamp?: Date, afterTimestamp?: Date): Promise<GetTokenActivityResponse>;
|
|
97
|
+
getIssuerTokenActivity(pageSize?: number, cursor?: ListAllTokenTransactionsCursor, operationTypes?: OperationType[], beforeTimestamp?: Date, afterTimestamp?: Date): Promise<GetTokenActivityResponse>;
|
|
98
|
+
announceTokenL1({ tokenName, tokenTicker, decimals, maxSupply, isFreezable, feeRateSatsPerVb, }: {
|
|
99
|
+
tokenName: any;
|
|
100
|
+
tokenTicker: any;
|
|
101
|
+
decimals: any;
|
|
102
|
+
maxSupply: any;
|
|
103
|
+
isFreezable: any;
|
|
104
|
+
feeRateSatsPerVb?: number | undefined;
|
|
105
|
+
}): Promise<string>;
|
|
106
|
+
mintTokensL1(tokenAmount: bigint): Promise<string>;
|
|
107
|
+
transferTokensL1(tokenAmount: bigint, p2trAddress: string): Promise<string>;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
export { IssuerSparkWallet };
|