stellar / js-stellar-base

The lowest-level stellar helper library. It consists of classes to read, write, hash, and sign Stellar xdr
https://stellar.github.io/js-stellar-base/
Apache License 2.0
108 stars 137 forks source link

Extend `SigningCallback` form to allow returning an object #783

Open Shaptic opened 2 weeks ago

Shaptic commented 2 weeks ago

Closes https://github.com/stellar/js-stellar-base/issues/780 per discussion in https://github.com/stellar/js-stellar-base/pull/772#discussion_r1764307846: authorizeEntry can now take a callback that returns an object specifying the signer of the signature so that it isn't implied that it's the address in the entry. Namely, it can return

interface SigningCallbackResult {
  signature: Buffer | Uint8Array;
  publicKey: string;
}
github-actions[bot] commented 2 weeks ago

Size Change: +2.75 kB (+0.08%)

Total Size: 3.26 MB

Filename Size Change
dist/stellar-base.js 2.39 MB +2.19 kB (+0.09%)
dist/stellar-base.min.js 869 kB +561 B (+0.06%)

compressed-size-action

kalepail commented 6 days ago

I don't feel like I have much to add here. What I'm working on doesn't involve signing with G-addresses much anymore so I wouldn't be using this. If I do sign with a G-address the entire auth flow is custom as per whatever the __check_auth signature arg determines. Which this definitely isn't supporting, but that isn't to say such a method isn't useful, just that I can't really speak to it.