Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Abstracted ConnectedWallet operations to DWN API #1110

Open
Tracked by #1106
prnk28 opened this issue Oct 4, 2024 — with Huly for GitHub · 1 comment
Open
Tracked by #1106

Implement Abstracted ConnectedWallet operations to DWN API #1110

prnk28 opened this issue Oct 4, 2024 — with Huly for GitHub · 1 comment
Assignees
Labels
#TODO Core Team - Project Management
Milestone

Comments

Copy link
Contributor

prnk28 commented Oct 4, 2024

Description

All ConnectedWallet methods are abstracted over API Methods. DWN Service Worker is responsible for sending Server Side Events which are interpreted by HTMX.

New Methods

  • getAuthInfo()
  • estimateFee()
  • broadcastTx()
  • pollTx()
  • broadcastTxSync()
  • signArbitrary()
  • signAndBroadcastTx()

Associated Files

These files will be modified by this task.

References

Related Issues

Tech Documents

Use these documents to help you complete the task.

@prnk28 prnk28 mentioned this issue Oct 4, 2024
7 tasks
@prnk28 prnk28 added the #TODO Core Team - Project Management label Oct 4, 2024
@prnk28 prnk28 added this to the v0.6 milestone Oct 4, 2024
@prnk28 prnk28 self-assigned this Oct 8, 2024
@prnk28
Copy link
Contributor Author

prnk28 commented Oct 11, 2024

Golang SSE Emitter

// NewSSE creates a new sse manager with the specified worker pool size.
func (h *HTMX) NewSSE(workerPoolSize int) error {
	if sseManager != nil {
		return errors.New("sse manager already exists")
	}

	sseManager = sse.NewManager(workerPoolSize)
	return nil
}

// SSEHandler handles the server-sent events. this is a shortcut and is not the preferred way to handle sse.
func (h *HTMX) SSEHandler(w http.ResponseWriter, r *http.Request, cl sse.Listener) {
	if sseManager == nil {
		sseManager = sse.NewManager(DefaultSSEWorkerPoolSize)
	}

	sseManager.Handle(w, r, cl)
}

// SSESend sends a message to all connected clients.
func (h *HTMX) SSESend(message sse.Envelope) {
	if sseManager == nil {
		sseManager = sse.NewManager(DefaultSSEWorkerPoolSize)
	}

	sseManager.Send(message)
}

@prnk28 prnk28 pinned this issue Nov 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
#TODO Core Team - Project Management
Projects
Status: Doing
Development

No branches or pull requests

1 participant