@buildonspark/issuer-sdk 0.0.22 → 0.0.24
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 +1 -1
- package/src/index.ts +1 -0
- package/src/interface/wallet-interface.ts +7 -6
- package/src/{issuer-sdk.ts → issuer-spark-wallet.ts} +5 -5
- package/src/tests/integration/spark.test.ts +3 -12
- package/src/types.ts +1 -2
- package/src/utils/constants.ts +2 -2
- package/dist/issuer-sdk/src/interface/wallet-interface.d.ts +0 -67
- 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 -43
- package/dist/issuer-sdk/src/issuer-sdk.js +0 -153
- 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 -373
- 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 -29
- package/dist/spark-sdk/src/graphql/client.js +0 -246
- 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/graphql/queries/UserRequest.d.ts +0 -1
- package/dist/spark-sdk/src/graphql/queries/UserRequest.js +0 -10
- package/dist/spark-sdk/src/graphql/queries/UserRequest.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 -32
- 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 -414
- package/dist/spark-sdk/src/spark-sdk.js +0 -1285
- 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
package/dist/types.d.cts
ADDED
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
declare enum LayerType {
|
|
2
|
+
L1 = "L1",
|
|
3
|
+
SPARK = "SPARK"
|
|
4
|
+
}
|
|
5
|
+
declare enum OperationType {
|
|
6
|
+
USER_TRANSFER = "USER_TRANSFER",
|
|
7
|
+
USER_BURN = "USER_BURN",
|
|
8
|
+
ISSUER_ANNOUNCE = "ISSUER_ANNOUNCE",
|
|
9
|
+
ISSUER_MINT = "ISSUER_MINT",
|
|
10
|
+
ISSUER_TRANSFER = "ISSUER_TRANSFER",
|
|
11
|
+
ISSUER_FREEZE = "ISSUER_FREEZE",
|
|
12
|
+
ISSUER_UNFREEZE = "ISSUER_UNFREEZE",
|
|
13
|
+
ISSUER_BURN = "ISSUER_BURN"
|
|
14
|
+
}
|
|
15
|
+
declare enum OnChainTransactionStatus {
|
|
16
|
+
PENDING = "PENDING",
|
|
17
|
+
CONFIRMED = "CONFIRMED",
|
|
18
|
+
WAITING_MINED = "WAITING_MINED",
|
|
19
|
+
MINED = "MINED",
|
|
20
|
+
ATTACHING = "ATTACHING",
|
|
21
|
+
ATTACHED = "ATTACHED"
|
|
22
|
+
}
|
|
23
|
+
declare enum SparkTransactionStatus {
|
|
24
|
+
STARTED = "STARTED",
|
|
25
|
+
SIGNED = "SIGNED",
|
|
26
|
+
FINALIZED = "FINALIZED"
|
|
27
|
+
}
|
|
28
|
+
type GetTokenActivityResponse = {
|
|
29
|
+
transactions: Transaction[];
|
|
30
|
+
nextCursor?: ListAllTokenTransactionsCursor | undefined;
|
|
31
|
+
};
|
|
32
|
+
interface Transaction {
|
|
33
|
+
transaction?: {
|
|
34
|
+
$case: "onChain";
|
|
35
|
+
onChain: OnChainTransaction;
|
|
36
|
+
} | {
|
|
37
|
+
$case: "spark";
|
|
38
|
+
spark: SparkTransaction;
|
|
39
|
+
} | undefined;
|
|
40
|
+
}
|
|
41
|
+
interface TokenPubKeyInfoResponse {
|
|
42
|
+
announcement: {
|
|
43
|
+
tokenPubkey: {
|
|
44
|
+
pubkey: string;
|
|
45
|
+
};
|
|
46
|
+
name: string;
|
|
47
|
+
symbol: string;
|
|
48
|
+
decimal: number;
|
|
49
|
+
maxSupply: bigint;
|
|
50
|
+
isFreezable: boolean;
|
|
51
|
+
} | null;
|
|
52
|
+
totalSupply: bigint;
|
|
53
|
+
}
|
|
54
|
+
interface OnChainTokenOutput {
|
|
55
|
+
rawTx: string;
|
|
56
|
+
vout: number;
|
|
57
|
+
amountSats: number;
|
|
58
|
+
tokenPublicKey?: string | undefined;
|
|
59
|
+
tokenAmount?: string | undefined;
|
|
60
|
+
}
|
|
61
|
+
interface OnChainTransaction {
|
|
62
|
+
operationType: OperationType;
|
|
63
|
+
transactionHash: string;
|
|
64
|
+
rawtx: string;
|
|
65
|
+
status: OnChainTransactionStatus;
|
|
66
|
+
inputs: OnChainTokenOutput[];
|
|
67
|
+
outputs: OnChainTokenOutput[];
|
|
68
|
+
broadcastedAt: Date | undefined;
|
|
69
|
+
confirmedAt: Date | undefined;
|
|
70
|
+
}
|
|
71
|
+
interface SparkTransaction {
|
|
72
|
+
operationType: OperationType;
|
|
73
|
+
transactionHash: string;
|
|
74
|
+
status: SparkTransactionStatus;
|
|
75
|
+
confirmedAt: Date | undefined;
|
|
76
|
+
leavesToCreate: SparkLeaf[];
|
|
77
|
+
leavesToSpend: SparkLeaf[];
|
|
78
|
+
sparkOperatorIdentityPublicKeys: string[];
|
|
79
|
+
}
|
|
80
|
+
interface SparkLeaf {
|
|
81
|
+
tokenPublicKey: string;
|
|
82
|
+
id: string;
|
|
83
|
+
ownerPublicKey: string;
|
|
84
|
+
revocationPublicKey: string;
|
|
85
|
+
withdrawalBondSats: number;
|
|
86
|
+
withdrawalLocktime: number;
|
|
87
|
+
tokenAmount: string;
|
|
88
|
+
createTxHash: string;
|
|
89
|
+
createTxVoutIndex: number;
|
|
90
|
+
spendTxHash?: string | undefined;
|
|
91
|
+
spendTxVoutIndex?: number | undefined;
|
|
92
|
+
isFrozen?: boolean | undefined;
|
|
93
|
+
}
|
|
94
|
+
interface ListAllTokenTransactionsCursor {
|
|
95
|
+
lastTransactionHash: string;
|
|
96
|
+
layer: LayerType;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
export { type GetTokenActivityResponse, LayerType, type ListAllTokenTransactionsCursor, type OnChainTokenOutput, type OnChainTransaction, OnChainTransactionStatus, OperationType, type SparkLeaf, type SparkTransaction, SparkTransactionStatus, type TokenPubKeyInfoResponse, type Transaction };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
declare enum LayerType {
|
|
2
2
|
L1 = "L1",
|
|
3
3
|
SPARK = "SPARK"
|
|
4
4
|
}
|
|
5
|
-
|
|
5
|
+
declare enum OperationType {
|
|
6
6
|
USER_TRANSFER = "USER_TRANSFER",
|
|
7
7
|
USER_BURN = "USER_BURN",
|
|
8
8
|
ISSUER_ANNOUNCE = "ISSUER_ANNOUNCE",
|
|
@@ -12,7 +12,7 @@ export declare enum OperationType {
|
|
|
12
12
|
ISSUER_UNFREEZE = "ISSUER_UNFREEZE",
|
|
13
13
|
ISSUER_BURN = "ISSUER_BURN"
|
|
14
14
|
}
|
|
15
|
-
|
|
15
|
+
declare enum OnChainTransactionStatus {
|
|
16
16
|
PENDING = "PENDING",
|
|
17
17
|
CONFIRMED = "CONFIRMED",
|
|
18
18
|
WAITING_MINED = "WAITING_MINED",
|
|
@@ -20,16 +20,16 @@ export declare enum OnChainTransactionStatus {
|
|
|
20
20
|
ATTACHING = "ATTACHING",
|
|
21
21
|
ATTACHED = "ATTACHED"
|
|
22
22
|
}
|
|
23
|
-
|
|
23
|
+
declare enum SparkTransactionStatus {
|
|
24
24
|
STARTED = "STARTED",
|
|
25
25
|
SIGNED = "SIGNED",
|
|
26
26
|
FINALIZED = "FINALIZED"
|
|
27
27
|
}
|
|
28
|
-
|
|
28
|
+
type GetTokenActivityResponse = {
|
|
29
29
|
transactions: Transaction[];
|
|
30
30
|
nextCursor?: ListAllTokenTransactionsCursor | undefined;
|
|
31
31
|
};
|
|
32
|
-
|
|
32
|
+
interface Transaction {
|
|
33
33
|
transaction?: {
|
|
34
34
|
$case: "onChain";
|
|
35
35
|
onChain: OnChainTransaction;
|
|
@@ -38,7 +38,7 @@ export interface Transaction {
|
|
|
38
38
|
spark: SparkTransaction;
|
|
39
39
|
} | undefined;
|
|
40
40
|
}
|
|
41
|
-
|
|
41
|
+
interface TokenPubKeyInfoResponse {
|
|
42
42
|
announcement: {
|
|
43
43
|
tokenPubkey: {
|
|
44
44
|
pubkey: string;
|
|
@@ -51,14 +51,14 @@ export interface TokenPubKeyInfoResponse {
|
|
|
51
51
|
} | null;
|
|
52
52
|
totalSupply: bigint;
|
|
53
53
|
}
|
|
54
|
-
|
|
54
|
+
interface OnChainTokenOutput {
|
|
55
55
|
rawTx: string;
|
|
56
56
|
vout: number;
|
|
57
57
|
amountSats: number;
|
|
58
58
|
tokenPublicKey?: string | undefined;
|
|
59
59
|
tokenAmount?: string | undefined;
|
|
60
60
|
}
|
|
61
|
-
|
|
61
|
+
interface OnChainTransaction {
|
|
62
62
|
operationType: OperationType;
|
|
63
63
|
transactionHash: string;
|
|
64
64
|
rawtx: string;
|
|
@@ -68,7 +68,7 @@ export interface OnChainTransaction {
|
|
|
68
68
|
broadcastedAt: Date | undefined;
|
|
69
69
|
confirmedAt: Date | undefined;
|
|
70
70
|
}
|
|
71
|
-
|
|
71
|
+
interface SparkTransaction {
|
|
72
72
|
operationType: OperationType;
|
|
73
73
|
transactionHash: string;
|
|
74
74
|
status: SparkTransactionStatus;
|
|
@@ -77,7 +77,7 @@ export interface SparkTransaction {
|
|
|
77
77
|
leavesToSpend: SparkLeaf[];
|
|
78
78
|
sparkOperatorIdentityPublicKeys: string[];
|
|
79
79
|
}
|
|
80
|
-
|
|
80
|
+
interface SparkLeaf {
|
|
81
81
|
tokenPublicKey: string;
|
|
82
82
|
id: string;
|
|
83
83
|
ownerPublicKey: string;
|
|
@@ -91,7 +91,9 @@ export interface SparkLeaf {
|
|
|
91
91
|
spendTxVoutIndex?: number | undefined;
|
|
92
92
|
isFrozen?: boolean | undefined;
|
|
93
93
|
}
|
|
94
|
-
|
|
94
|
+
interface ListAllTokenTransactionsCursor {
|
|
95
95
|
lastTransactionHash: string;
|
|
96
96
|
layer: LayerType;
|
|
97
97
|
}
|
|
98
|
+
|
|
99
|
+
export { type GetTokenActivityResponse, LayerType, type ListAllTokenTransactionsCursor, type OnChainTokenOutput, type OnChainTransaction, OnChainTransactionStatus, OperationType, type SparkLeaf, type SparkTransaction, SparkTransactionStatus, type TokenPubKeyInfoResponse, type Transaction };
|
package/dist/types.js
ADDED
package/package.json
CHANGED
|
@@ -1,28 +1,40 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@buildonspark/issuer-sdk",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.24",
|
|
4
4
|
"description": "Spark Issuer SDK for token issuance",
|
|
5
|
-
"
|
|
6
|
-
"
|
|
5
|
+
"license": "Apache-2.0",
|
|
6
|
+
"module": "./dist/index.js",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
7
8
|
"type": "module",
|
|
8
9
|
"exports": {
|
|
9
10
|
".": {
|
|
10
|
-
"import": "./dist/
|
|
11
|
+
"import": "./dist/index.js",
|
|
12
|
+
"require": "./dist/index.cjs"
|
|
11
13
|
},
|
|
12
14
|
"./types": {
|
|
13
|
-
"import": "./dist/
|
|
15
|
+
"import": "./dist/types.js",
|
|
16
|
+
"require": "./dist/types.cjs"
|
|
14
17
|
}
|
|
15
18
|
},
|
|
19
|
+
"browser": {
|
|
20
|
+
"assert": false,
|
|
21
|
+
"crypto": false,
|
|
22
|
+
"fs": false,
|
|
23
|
+
"fs/promises": false,
|
|
24
|
+
"path": false,
|
|
25
|
+
"url": false
|
|
26
|
+
},
|
|
16
27
|
"files": [
|
|
17
28
|
"dist",
|
|
18
29
|
"src"
|
|
19
30
|
],
|
|
20
31
|
"scripts": {
|
|
21
|
-
"build": "yarn
|
|
32
|
+
"build": "yarn tsc && tsup",
|
|
22
33
|
"prepare": "yarn run build",
|
|
23
34
|
"build:watch": "yarn build --watch --clean=false",
|
|
24
35
|
"clean": "rm -rf dist",
|
|
25
36
|
"circular-deps": "madge --circular --extensions ts,tsx src",
|
|
37
|
+
"depcheck": "depcheck --ignores=buffer,ts-proto,jest,ts-jest",
|
|
26
38
|
"dev": "yarn build -- --watch",
|
|
27
39
|
"docs": "typedoc src",
|
|
28
40
|
"format:fix": "prettier src --write",
|
|
@@ -31,9 +43,9 @@
|
|
|
31
43
|
"lint:fix:continue": "eslint --fix . || exit 0",
|
|
32
44
|
"lint:watch": "esw ./src -w --ext .ts,.tsx,.js --color",
|
|
33
45
|
"lint": "eslint .",
|
|
34
|
-
"package
|
|
46
|
+
"package:checks": "yarn depcheck && yarn publint && yarn attw --pack . && echo \"\nPackage checks passed successfully!\"",
|
|
35
47
|
"postversion": "yarn build",
|
|
36
|
-
"test-cmd": "node --experimental-vm-modules $(yarn bin jest) --no-cache --runInBand
|
|
48
|
+
"test-cmd": "node --experimental-vm-modules $(yarn bin jest) --no-cache --runInBand",
|
|
37
49
|
"test": "echo \"Error: no tests yet\"",
|
|
38
50
|
"test:integration": "yarn test-cmd src/tests/integration/*.test.ts",
|
|
39
51
|
"types:watch": "tsc-absolute --watch",
|
|
@@ -41,46 +53,33 @@
|
|
|
41
53
|
"generate:proto": "PATH=\"$PATH:./node_modules/.bin\" protoc --ts_proto_out=./src/proto --ts_proto_opt=outputServices=nice-grpc,useExactTypes=false,outputServices=generic-definitions,oneof=unions,importSuffix=.js --proto_path=../../protos spark.proto mock.proto spark_authn.proto"
|
|
42
54
|
},
|
|
43
55
|
"dependencies": {
|
|
44
|
-
"@bufbuild/protobuf": "^2.2.
|
|
45
|
-
"@buildonspark/lrc20-sdk": "0.0.
|
|
46
|
-
"@buildonspark/spark-sdk": "0.0.
|
|
56
|
+
"@bufbuild/protobuf": "^2.2.5",
|
|
57
|
+
"@buildonspark/lrc20-sdk": "0.0.22",
|
|
58
|
+
"@buildonspark/spark-sdk": "0.0.24",
|
|
47
59
|
"@noble/curves": "^1.8.0",
|
|
48
|
-
"@noble/secp256k1": "^2.2.3",
|
|
49
60
|
"@scure/bip39": "^1.5.4",
|
|
50
61
|
"@scure/btc-signer": "^1.5.0",
|
|
51
62
|
"bitcoinjs-lib": "^6.1.5",
|
|
52
|
-
"
|
|
53
|
-
"grpc-tools": "^1.12.4",
|
|
54
|
-
"nice-grpc": "^2.1.10",
|
|
63
|
+
"buffer": "^6.0.3",
|
|
55
64
|
"nice-grpc-common": "^2.0.2",
|
|
56
|
-
"nice-grpc-web": "^3.3.5",
|
|
57
|
-
"protobufjs": "^7.4.0",
|
|
58
65
|
"ts-proto": "^2.6.1"
|
|
59
66
|
},
|
|
60
67
|
"devDependencies": {
|
|
61
68
|
"@arethetypeswrong/cli": "^0.17.4",
|
|
69
|
+
"@jest/globals": "^29.7.0",
|
|
62
70
|
"@types/jest": "^29.5.14",
|
|
63
71
|
"@types/node": "^22.13.2",
|
|
64
|
-
"
|
|
65
|
-
"@types/uuid": "^10.0.0",
|
|
66
|
-
"@types/ws": "^8",
|
|
67
|
-
"copyfiles": "^2.4.1",
|
|
72
|
+
"depcheck": "^1.4.7",
|
|
68
73
|
"jest": "^29.7.0",
|
|
69
74
|
"madge": "^8.0.0",
|
|
70
75
|
"node-fetch": "^3.3.2",
|
|
76
|
+
"publint": "^0.3.9",
|
|
71
77
|
"ts-jest": "^29.2.5",
|
|
72
|
-
"
|
|
73
|
-
"typescript": "^5.7.3"
|
|
74
|
-
"wasm-loader": "^1.3.0"
|
|
78
|
+
"tsup": "^8.4.0",
|
|
79
|
+
"typescript": "^5.7.3"
|
|
75
80
|
},
|
|
76
|
-
"
|
|
77
|
-
"
|
|
78
|
-
"crypto": false,
|
|
79
|
-
"fs": false,
|
|
80
|
-
"fs/promises": false,
|
|
81
|
-
"nice-grpc": "nice-grpc-web",
|
|
82
|
-
"path": false,
|
|
83
|
-
"url": false
|
|
81
|
+
"engines": {
|
|
82
|
+
"node": ">=18.0.0"
|
|
84
83
|
},
|
|
85
84
|
"madge": {
|
|
86
85
|
"detectiveOptions": {
|
package/src/examples/example.ts
CHANGED
package/src/index.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./issuer-spark-wallet.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { LRCWallet
|
|
1
|
+
import { LRCWallet } from "@buildonspark/lrc20-sdk";
|
|
2
2
|
import {
|
|
3
3
|
CreateLightningInvoiceParams,
|
|
4
4
|
PayLightningInvoiceParams,
|
|
@@ -12,6 +12,7 @@ import {
|
|
|
12
12
|
} from "@buildonspark/spark-sdk/proto/spark";
|
|
13
13
|
import { LightningReceiveRequest } from "@buildonspark/spark-sdk/types";
|
|
14
14
|
import { GetTokenActivityResponse, TokenPubKeyInfoResponse } from "../types.js";
|
|
15
|
+
import { ListAllTokenTransactionsCursor, OperationType } from "@buildonspark/lrc20-sdk/proto/rpc/v1/types";
|
|
15
16
|
|
|
16
17
|
/**
|
|
17
18
|
* Interface for the IssuerSparkWallet that includes all functions from both SparkWallet and IssuerSparkWallet
|
|
@@ -55,14 +56,14 @@ export interface IssuerWalletInterface {
|
|
|
55
56
|
mintTokens(tokenAmount: bigint): Promise<string>;
|
|
56
57
|
getTokenActivity(
|
|
57
58
|
pageSize: number,
|
|
58
|
-
cursor?:
|
|
59
|
-
operationTypes?:
|
|
59
|
+
cursor?: ListAllTokenTransactionsCursor,
|
|
60
|
+
operationTypes?: OperationType[],
|
|
60
61
|
beforeTimestamp?: Date,
|
|
61
62
|
): Promise<GetTokenActivityResponse>;
|
|
62
63
|
getIssuerTokenActivity(
|
|
63
64
|
pageSize: number,
|
|
64
|
-
cursor?:
|
|
65
|
-
operationTypes?:
|
|
65
|
+
cursor?: ListAllTokenTransactionsCursor,
|
|
66
|
+
operationTypes?: OperationType[],
|
|
66
67
|
beforeTimestamp?: Date,
|
|
67
68
|
afterTimestamp?: Date,
|
|
68
69
|
): Promise<GetTokenActivityResponse>;
|
|
@@ -83,7 +84,7 @@ export interface IssuerWalletInterface {
|
|
|
83
84
|
unfreezeTokens(
|
|
84
85
|
ownerPublicKey: string,
|
|
85
86
|
): Promise<{ impactedLeafIds: string[]; impactedTokenAmount: bigint }>;
|
|
86
|
-
getTokenL1Address(): string
|
|
87
|
+
getTokenL1Address(): Promise<string>;
|
|
87
88
|
announceTokenL1(params: {
|
|
88
89
|
lrc20Wallet: LRCWallet;
|
|
89
90
|
tokenName: string;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import {
|
|
2
|
-
Lrc20Protos,
|
|
3
2
|
LRCWallet,
|
|
4
3
|
TokenPubkey,
|
|
5
4
|
TokenPubkeyAnnouncement,
|
|
@@ -7,6 +6,7 @@ import {
|
|
|
7
6
|
} from "@buildonspark/lrc20-sdk";
|
|
8
7
|
import { SparkWallet, SparkWalletProps } from "@buildonspark/spark-sdk";
|
|
9
8
|
import { LeafWithPreviousTransactionData } from "@buildonspark/spark-sdk/proto/spark";
|
|
9
|
+
import { ListAllTokenTransactionsCursor, OperationType } from "@buildonspark/lrc20-sdk/proto/rpc/v1/types";
|
|
10
10
|
import { ConfigOptions } from "@buildonspark/spark-sdk/services/wallet-config";
|
|
11
11
|
import {
|
|
12
12
|
getMasterHDKeyFromSeed,
|
|
@@ -196,8 +196,8 @@ export class IssuerSparkWallet
|
|
|
196
196
|
|
|
197
197
|
public async getTokenActivity(
|
|
198
198
|
pageSize: number = 100,
|
|
199
|
-
cursor?:
|
|
200
|
-
operationTypes?:
|
|
199
|
+
cursor?: ListAllTokenTransactionsCursor,
|
|
200
|
+
operationTypes?: OperationType[],
|
|
201
201
|
beforeTimestamp?: Date,
|
|
202
202
|
afterTimestamp?: Date,
|
|
203
203
|
): Promise<GetTokenActivityResponse> {
|
|
@@ -217,8 +217,8 @@ export class IssuerSparkWallet
|
|
|
217
217
|
|
|
218
218
|
public async getIssuerTokenActivity(
|
|
219
219
|
pageSize: number = 100,
|
|
220
|
-
cursor?:
|
|
221
|
-
operationTypes?:
|
|
220
|
+
cursor?: ListAllTokenTransactionsCursor,
|
|
221
|
+
operationTypes?: OperationType[],
|
|
222
222
|
beforeTimestamp?: Date,
|
|
223
223
|
afterTimestamp?: Date,
|
|
224
224
|
): Promise<GetTokenActivityResponse> {
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
LOCAL_WALLET_CONFIG_SCHNORR,
|
|
7
7
|
} from "../../../../spark-sdk/src/services/wallet-config.js";
|
|
8
8
|
import { BitcoinFaucet } from "../../../../spark-sdk/src/tests/utils/test-faucet.js";
|
|
9
|
-
import { IssuerSparkWallet } from "../../issuer-
|
|
9
|
+
import { IssuerSparkWallet } from "../../issuer-spark-wallet.js";
|
|
10
10
|
|
|
11
11
|
describe("token integration test", () => {
|
|
12
12
|
// Skip all tests if running in GitHub Actions
|
|
@@ -47,11 +47,7 @@ describe("token integration test", () => {
|
|
|
47
47
|
|
|
48
48
|
// Faucet funds to the Issuer wallet because announcing a token
|
|
49
49
|
// requires ownership of an L1 UTXO.
|
|
50
|
-
const faucet = new BitcoinFaucet(
|
|
51
|
-
"http://127.0.0.1:8332",
|
|
52
|
-
"testutil",
|
|
53
|
-
"testutilpassword",
|
|
54
|
-
);
|
|
50
|
+
const faucet = new BitcoinFaucet();
|
|
55
51
|
const l1WalletPubKey = await wallet.getIdentityPublicKey();
|
|
56
52
|
await faucet.sendFaucetCoinToP2WPKHAddress(hexToBytes(l1WalletPubKey));
|
|
57
53
|
await faucet.mineBlocks(6);
|
|
@@ -68,7 +64,6 @@ describe("token integration test", () => {
|
|
|
68
64
|
});
|
|
69
65
|
console.warn("Announce token response: " + response);
|
|
70
66
|
} catch (error: any) {
|
|
71
|
-
// Check that the error has the expected name
|
|
72
67
|
fail(
|
|
73
68
|
"Expected announceTokenL1() to succeed with fauceted funds: " + error,
|
|
74
69
|
);
|
|
@@ -112,11 +107,7 @@ describe("token integration test", () => {
|
|
|
112
107
|
|
|
113
108
|
// Faucet funds to the Issuer wallet because announcing a token
|
|
114
109
|
// requires ownership of an L1 UTXO.
|
|
115
|
-
const faucet = new BitcoinFaucet(
|
|
116
|
-
"http://127.0.0.1:8332",
|
|
117
|
-
"testutil",
|
|
118
|
-
"testutilpassword",
|
|
119
|
-
);
|
|
110
|
+
const faucet = new BitcoinFaucet();
|
|
120
111
|
const l1WalletPubKey = await wallet.getIdentityPublicKey();
|
|
121
112
|
await faucet.sendFaucetCoinToP2WPKHAddress(hexToBytes(l1WalletPubKey));
|
|
122
113
|
await faucet.mineBlocks(6);
|
package/src/types.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Lrc20Protos } from "@buildonspark/lrc20-sdk";
|
|
2
|
-
import { Layer } from "../../lrc20-sdk/dist/types/proto/rpc/v1/types.js";
|
|
3
2
|
|
|
4
3
|
// String enums to replace numeric enums
|
|
5
4
|
export enum LayerType {
|
|
@@ -106,4 +105,4 @@ export interface SparkLeaf {
|
|
|
106
105
|
export interface ListAllTokenTransactionsCursor {
|
|
107
106
|
lastTransactionHash: string;
|
|
108
107
|
layer: LayerType;
|
|
109
|
-
}
|
|
108
|
+
}
|
package/src/utils/constants.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {Network} from "@buildonspark/spark-sdk/utils";
|
|
2
|
-
import {networks} from "bitcoinjs-lib";
|
|
1
|
+
import { Network } from "@buildonspark/spark-sdk/utils";
|
|
2
|
+
import { networks } from "bitcoinjs-lib";
|
|
3
3
|
import { NetworkType } from "@buildonspark/lrc20-sdk";
|
|
4
4
|
|
|
5
5
|
export const LRC_WALLET_NETWORK = Object.freeze({
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import { LRCWallet, Lrc20Protos } from "@buildonspark/lrc20-sdk";
|
|
2
|
-
import { CreateLightningInvoiceParams, PayLightningInvoiceParams, TokenInfo } from "@buildonspark/spark-sdk";
|
|
3
|
-
import { LeafWithPreviousTransactionData, QueryAllTransfersResponse, TokenTransactionWithStatus, Transfer } from "@buildonspark/spark-sdk/proto/spark";
|
|
4
|
-
import { LightningReceiveRequest } from "@buildonspark/spark-sdk/types";
|
|
5
|
-
import { GetTokenActivityResponse, TokenPubKeyInfoResponse } from "../types.js";
|
|
6
|
-
/**
|
|
7
|
-
* Interface for the IssuerSparkWallet that includes all functions from both SparkWallet and IssuerSparkWallet
|
|
8
|
-
*/
|
|
9
|
-
export interface IssuerWalletInterface {
|
|
10
|
-
getIdentityPublicKey(): Promise<string>;
|
|
11
|
-
getSparkAddress(): Promise<string>;
|
|
12
|
-
getTransfers(limit?: number, offset?: number): Promise<QueryAllTransfersResponse>;
|
|
13
|
-
getBalance(forceRefetch?: boolean): Promise<{
|
|
14
|
-
balance: bigint;
|
|
15
|
-
tokenBalances: Map<string, {
|
|
16
|
-
balance: bigint;
|
|
17
|
-
}>;
|
|
18
|
-
}>;
|
|
19
|
-
getDepositAddress(): Promise<string>;
|
|
20
|
-
transfer(params: {
|
|
21
|
-
receiverSparkAddress: string;
|
|
22
|
-
amountSats: number;
|
|
23
|
-
}): Promise<Transfer | string>;
|
|
24
|
-
createLightningInvoice(params: CreateLightningInvoiceParams): Promise<LightningReceiveRequest>;
|
|
25
|
-
payLightningInvoice(params: PayLightningInvoiceParams): Promise<any>;
|
|
26
|
-
withdraw(params: {
|
|
27
|
-
onchainAddress: string;
|
|
28
|
-
amountSats?: number;
|
|
29
|
-
}): Promise<any>;
|
|
30
|
-
transferTokens(params: {
|
|
31
|
-
tokenPublicKey: string;
|
|
32
|
-
tokenAmount: bigint;
|
|
33
|
-
receiverSparkAddress: string;
|
|
34
|
-
selectedLeaves?: LeafWithPreviousTransactionData[];
|
|
35
|
-
}): Promise<string>;
|
|
36
|
-
getIssuerTokenPublicKey(): Promise<string>;
|
|
37
|
-
getIssuerTokenBalance(): Promise<{
|
|
38
|
-
balance: bigint;
|
|
39
|
-
}>;
|
|
40
|
-
mintTokens(tokenAmount: bigint): Promise<string>;
|
|
41
|
-
getTokenActivity(pageSize: number, cursor?: Lrc20Protos.ListAllTokenTransactionsCursor, operationTypes?: Lrc20Protos.OperationType[], beforeTimestamp?: Date): Promise<GetTokenActivityResponse>;
|
|
42
|
-
getIssuerTokenActivity(pageSize: number, cursor?: Lrc20Protos.ListAllTokenTransactionsCursor, operationTypes?: Lrc20Protos.OperationType[], beforeTimestamp?: Date, afterTimestamp?: Date): Promise<GetTokenActivityResponse>;
|
|
43
|
-
getTokenTransactions(tokenPublicKeys: string[], tokenTransactionHashes?: string[]): Promise<TokenTransactionWithStatus[]>;
|
|
44
|
-
getTokenInfo(): Promise<TokenInfo[]>;
|
|
45
|
-
getIssuerTokenInfo(): Promise<TokenPubKeyInfoResponse | null>;
|
|
46
|
-
burnTokens(tokenAmount: bigint, selectedLeaves?: LeafWithPreviousTransactionData[]): Promise<string>;
|
|
47
|
-
freezeTokens(ownerPublicKey: string): Promise<{
|
|
48
|
-
impactedLeafIds: string[];
|
|
49
|
-
impactedTokenAmount: bigint;
|
|
50
|
-
}>;
|
|
51
|
-
unfreezeTokens(ownerPublicKey: string): Promise<{
|
|
52
|
-
impactedLeafIds: string[];
|
|
53
|
-
impactedTokenAmount: bigint;
|
|
54
|
-
}>;
|
|
55
|
-
getTokenL1Address(): string;
|
|
56
|
-
announceTokenL1(params: {
|
|
57
|
-
lrc20Wallet: LRCWallet;
|
|
58
|
-
tokenName: string;
|
|
59
|
-
tokenTicker: string;
|
|
60
|
-
decimals: number;
|
|
61
|
-
maxSupply: bigint;
|
|
62
|
-
isFreezable: boolean;
|
|
63
|
-
feeRateSatsPerVb?: number;
|
|
64
|
-
}): Promise<string>;
|
|
65
|
-
mintTokensL1(tokenAmount: bigint): Promise<string>;
|
|
66
|
-
transferTokensL1(tokenAmount: bigint, p2trAddress: string): Promise<string>;
|
|
67
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"wallet-interface.js","sourceRoot":"","sources":["../../../../src/interface/wallet-interface.ts"],"names":[],"mappings":""}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { Lrc20Protos } from "@buildonspark/lrc20-sdk";
|
|
2
|
-
import { SparkWallet, SparkWalletProps } from "@buildonspark/spark-sdk";
|
|
3
|
-
import { LeafWithPreviousTransactionData } from "@buildonspark/spark-sdk/proto/spark";
|
|
4
|
-
import { IssuerWalletInterface } from "./interface/wallet-interface.js";
|
|
5
|
-
import { GetTokenActivityResponse, TokenPubKeyInfoResponse } from "./types.js";
|
|
6
|
-
export declare class IssuerSparkWallet extends SparkWallet implements IssuerWalletInterface {
|
|
7
|
-
private issuerTokenTransactionService;
|
|
8
|
-
private tokenFreezeService;
|
|
9
|
-
private tokenPublicKeyInfo?;
|
|
10
|
-
static initialize(options: SparkWalletProps): Promise<{
|
|
11
|
-
mnemonic?: string | undefined;
|
|
12
|
-
wallet: IssuerSparkWallet;
|
|
13
|
-
}>;
|
|
14
|
-
private constructor();
|
|
15
|
-
private initIssuerWallet;
|
|
16
|
-
getIssuerTokenBalance(): Promise<{
|
|
17
|
-
balance: bigint;
|
|
18
|
-
}>;
|
|
19
|
-
getIssuerTokenInfo(): Promise<TokenPubKeyInfoResponse | null>;
|
|
20
|
-
getIssuerTokenPublicKey(): Promise<string>;
|
|
21
|
-
mintTokens(tokenAmount: bigint): Promise<string>;
|
|
22
|
-
burnTokens(tokenAmount: bigint, selectedLeaves?: LeafWithPreviousTransactionData[]): Promise<string>;
|
|
23
|
-
freezeTokens(ownerPublicKey: string): Promise<{
|
|
24
|
-
impactedLeafIds: string[];
|
|
25
|
-
impactedTokenAmount: bigint;
|
|
26
|
-
}>;
|
|
27
|
-
unfreezeTokens(ownerPublicKey: string): Promise<{
|
|
28
|
-
impactedLeafIds: string[];
|
|
29
|
-
impactedTokenAmount: bigint;
|
|
30
|
-
}>;
|
|
31
|
-
getTokenActivity(pageSize?: number, cursor?: Lrc20Protos.ListAllTokenTransactionsCursor, operationTypes?: Lrc20Protos.OperationType[], beforeTimestamp?: Date, afterTimestamp?: Date): Promise<GetTokenActivityResponse>;
|
|
32
|
-
getIssuerTokenActivity(pageSize?: number, cursor?: Lrc20Protos.ListAllTokenTransactionsCursor, operationTypes?: Lrc20Protos.OperationType[], beforeTimestamp?: Date, afterTimestamp?: Date): Promise<GetTokenActivityResponse>;
|
|
33
|
-
announceTokenL1({ tokenName, tokenTicker, decimals, maxSupply, isFreezable, feeRateSatsPerVb, }: {
|
|
34
|
-
tokenName: any;
|
|
35
|
-
tokenTicker: any;
|
|
36
|
-
decimals: any;
|
|
37
|
-
maxSupply: any;
|
|
38
|
-
isFreezable: any;
|
|
39
|
-
feeRateSatsPerVb?: number | undefined;
|
|
40
|
-
}): Promise<string>;
|
|
41
|
-
mintTokensL1(tokenAmount: bigint): Promise<string>;
|
|
42
|
-
transferTokensL1(tokenAmount: bigint, p2trAddress: string): Promise<string>;
|
|
43
|
-
}
|