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

Add helpers method to build authorization entries. #663

Closed Shaptic closed 1 year ago

Shaptic commented 1 year ago

Replaces #632 in an attempt to tackle #575. This adds three helpers (see the jsdocs for details):

function authorizeInvocation(
  signer: Keypair,
  networkPassphrase: string,
  validUntil: number,
  invocation: xdr.SorobanAuthorizedInvocation
): xdr.SorobanAuthorizationEntry;

function buildAuthEnvelope(
  networkPassphrase: string,
  validUntil: number,
  invocation: xdr.SorobanAuthorizedInvocation
): xdr.HashIdPreimage;

function buildAuthEntry(
  envelope: xdr.HashIdPreimage,
  signature: Buffer | Uint8Array,
  publicKey: string
): xdr.SorobanAuthorizationEntry;
github-actions[bot] commented 1 year ago

Size Change: +46.5 kB (+2%)

Total Size: 3.07 MB

Filename Size Change
dist/stellar-base.js 2.25 MB +33.7 kB (+2%)
dist/stellar-base.min.js 818 kB +12.8 kB (+2%)

compressed-size-action