* RPC GetPaymentsStream
This introduces a new feature to the ArkService API that allows clients to subscribe to payment events. Here's a breakdown of the changes:
1. **OpenAPI Specification (`service.swagger.json`):**
- A new endpoint `/v1/payments` is added to the API, supporting a `GET` operation for streaming payment events.
- New definitions `v1GetPaymentsStreamResponse`, `v1RoundPayment`, and `v1AsyncPayment` are added to describe the structure of the streaming responses.
2. **Protobuf Definition (`service.proto`):**
- Added a new RPC method `GetPaymentsStream` that streams `GetPaymentsStreamResponse` messages.
- Defined new message types: `GetPaymentsStreamRequest`, `GetPaymentsStreamResponse`, `RoundPayment`, and `AsyncPayment`.
3. **Generated Protobuf Code (`service.pb.go`, `service.pb.gw.go`, `service_grpc.pb.go`):**
- The generated code is updated to include the new RPC method and message types.
- The gateway code includes functions to handle HTTP requests and responses for the new streaming endpoint.
4. **Application Logic (`covenant.go`, `covenantless.go`):**
- New payment events channels are introduced (`paymentEventsCh`).
- Payment events are propagated to these channels when a round is finalized or an async payment is completed.
- New event types `RoundPaymentEvent` and `AsyncPaymentEvent` are defined, implementing a `PaymentEvent` interface.
5. **gRPC Handlers (`arkservice.go`):**
- Added logic to handle `GetPaymentsStream` requests and manage payment listeners.
- A new goroutine is started to listen to payment events and forward them to active listeners.
Overall, this patch extends the ArkService to support real-time streaming of payment events, allowing clients to receive updates on both round payments and async payments as they occur.
* Move emit events in updateVtxoSet & Use generics and parsers (#1)
* Move sending event to updateVtxoSet
* Use generics and parsers
* pr review refactor
* pr review refactor
* fix
---------
Co-authored-by: Pietralberto Mazza <18440657+altafan@users.noreply.github.com>
* failing test
* fix duplicate input register
* fix btc-embedded coin selection
* rename test
* add checks in failing test case
* fixes GetEventStream
* add TODO comment in createPoolTx
* update with master changes
* fix server unit test
* increase liquidity of testing ASP
* simplify AliceSeveralPaymentsBob test
* Drop unused ComputeOutputScript & use ParseTaprootScript internally
* Add pending field to vtxo domain
* Add check to handle async change as claimed vtxo & Move check to prevent spending penidng vtxos to app level
* Rename utils.go to parser.go & Fixes
* Ignore sent-and-reversible vtxos in ListVtxos
* Fixes
Co-authored-by: Louis Singer <louisinger@users.noreply.github.com>
* Fix e2e test
Co-authored-by: Louis Singer <louisinger@users.noreply.github.com>
Co-authored-by: João Bordalo <bordalix@users.noreply.github.com>
* Fix
* Add PendingChange field to vtxo
* Add PendingChange field to Transaction
* Fixes
* Remove logs
---------
Co-authored-by: Louis Singer <louisinger@users.noreply.github.com>
Co-authored-by: João Bordalo <bordalix@users.noreply.github.com>
* [proto] add APIs to send and receive musig2 signing data
* [common] add serialization functions for nonces and signatures
* [application] implements tree signing
* fix: remove old debug logs
* [proto] cleaning
* [common] fix musig2.go
* [application] fixes and logs
* [interface] fix: stop forwarding 2 times the events
* [client] add musig2 support + sign the tree when joining a round
* [interface] add new APIs into permissions.go
* [application][proto] rework PingResponse (return all events type)
* [common] split SetKeys into 2 distinct methods
* [client] fixes according to musig2.go changes
* [sdk] support tree signing + new PingResponse
* [sdk] fixes
* [application] revert event channel type
* [application] use domain.RoundEvent as lastEvent type
* [application] remove IsCovenantLess
* comments
* [application] revert roundAborted changes
* [interface] remove bitcointree dependencie
* api-spec: move the api-spec to root and init go.mod
* go mod tidy
* move buf files in the root as well
* gh action for api-spec changes only
* gh action for api-spec on push and pr
* introduce go.work and remove all replaces
* solve dependencies and force btcd/btcec@v2.3.3
* go work sync
* force btcd/btcec@v2.3.3
* go mod tidy
* Add gRPC, REST, and gRPC-Web clients for server access
This commit introduces clients for gRPC, REST, and gRPC-Web to access the server.
- gRPC client: Includes additional argument opts ...grpc.CallOption in the interface for future extensibility.
- REST client: Factory function accepts http.Client as an argument to allow user customization.
- gRPC-Web client: Added a Log method for fast debugging in JavaScript.
The decision to use different interfaces for each client type is to accommodate specific features and extensibility requirements for each protocol.
* remove grpc web
* generate rest
* use grpc sdk in CLI
* temp wasm
* ark sdk
* renaming
* pr review refactor
* pr review refactor
* walletStore & configStore
* ark sdk wasm wrapper
* handle event stream with rest
* wip on supporting rest
* store init
* simulate event stream with rest
* fix rest sdk wip
* Fix returning forfeit txs in round event
* wasm first working e2e example
* pr review refactor
* pr review refactor
* pr review refactor
* Fixes
---------
Co-authored-by: altafan <18440657+altafan@users.noreply.github.com>
* add admin service
* go mod tidy
* fix linter: grpc.Dial
* fix ocean get balance
* fix linter
* add .vscode to gitignore
* rework admin balance API
* fix mockedwallet in covenantless pkg
* make proto
* Renaming
* Add server-side support for onboarding
* add onboard --amount command
* support client side onboarding
* Drop dummy tx builder
* Drop faucet
* Fixes
* fix public key encoding
* fix schnorr pub key check in validation
* fix server/README to accomodate onboarding
---------
Co-authored-by: Louis <louis@vulpem.com>
Co-authored-by: João Bordalo <bordalix@users.noreply.github.com>