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

feat(sdk): experimental sdk #874

Draft
wants to merge 1 commit into
base: dev
Choose a base branch
from
Draft

feat(sdk): experimental sdk #874

wants to merge 1 commit into from

Conversation

kyranjamie
Copy link
Collaborator

@kyranjamie kyranjamie commented Feb 13, 2025

This is some unplanned work, but that builds on the RPC refactor and a conversation with @fbwoolf and @markmhendrickson.

Currently, we offer RPC types to developers only. With a clean object of known methods, it's fairly straightforward to generate a JS client with methods users can call, which is an improvement on having to access the provider directly from the global object. Parameter and result types are inferred from the RPC spec.

How much we want to expand and maintain this it still in question. Perhaps few will use this, in favour of connect or other wallet wrapping libraries. But, at least in its current bare bones state, it'd be minimal effort to maintain, and might be an interesting package to publish, even if only used for internal use, or docs/demos

import { createLeatherClient } from '@leather.io/sdk';

const leather = createLeatherClient();

const addresses = await leather.getAddresses();

image

@kyranjamie kyranjamie force-pushed the experimental/sdk branch 2 times, most recently from 307e4f6 to 645ca82 Compare February 13, 2025 13:31
Copy link

codecov bot commented Feb 13, 2025

Codecov Report

Attention: Patch coverage is 85.71429% with 3 lines in your changes missing coverage. Please review.

Project coverage is 39.94%. Comparing base (9d57ab1) to head (7b61f88).

Files with missing lines Patch % Lines
packages/sdk/src/client.ts 90.00% 2 Missing ⚠️
packages/sdk/src/index.ts 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##              dev     #874      +/-   ##
==========================================
+ Coverage   39.84%   39.94%   +0.09%     
==========================================
  Files         204      206       +2     
  Lines        9750     9771      +21     
  Branches      577      582       +5     
==========================================
+ Hits         3885     3903      +18     
- Misses       5865     5868       +3     
Files with missing lines Coverage Δ
packages/sdk/src/index.ts 0.00% <0.00%> (ø)
packages/sdk/src/client.ts 90.00% <90.00%> (ø)
Components Coverage Δ
bitcoin 64.15% <ø> (ø)
query 12.83% <ø> (ø)
utils 83.27% <ø> (ø)
crypto 68.21% <ø> (ø)
stacks 69.77% <ø> (ø)

@fbwoolf
Copy link
Contributor

fbwoolf commented Feb 13, 2025

Love it 🚀

Copy link
Collaborator

@edgarkhanzadian edgarkhanzadian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice! 🚀

@edgarkhanzadian edgarkhanzadian dismissed their stale review February 13, 2025 14:41

Didn't notice that this is still draft

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants