Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ A breaking change will get clearly marked in this log.
## Unreleased

### Added
- `inspectAuthEntry(entry)`: decodes a `xdr.SorobanAuthorizationEntry` into a typed summary — credential type (`sourceAccount`/`address`/`addressV2`/`addressWithDelegates`), authorizing address, nonce, `signatureExpirationLedger`, and a `signers` list covering the top-level credentials plus any CAP-71 delegates (depth-first), each reporting whether it's signed and, when the payload uses the SDK's standard ed25519 format, the parsed `{publicKey, signature}` pairs (custom-account payloads are surfaced raw). Adds the `AuthEntryInfo`, `AuthEntrySigner`, `AuthEntrySignature`, and `AuthEntryCredentialType` types ([#1468](https://github.com/stellar/js-stellar-sdk/issues/1468)).
- `checkAuthEntryReadiness(entry, currentLedgerSeq)`: reports whether an auth entry is ready to submit — `{ ready, expired, unsignedBy }` — comparing the entry's expiration (exclusively) against a caller-supplied current ledger, so it stays a pure decode with no network dependency. Source-account entries are always ready ([#1468](https://github.com/stellar/js-stellar-sdk/issues/1468)).
- `Spec.nativeToScVal` now supports contract parameters typed as `Val`
(`scSpecTypeVal`) by delegating to the generic `nativeToScVal` converter, so
raw JS values (strings, numbers, bigints, booleans, arrays, `Map`s, plain
Expand All @@ -26,6 +28,7 @@ A breaking change will get clearly marked in this log.
- The UMD (`dist/`) build now sets `inlineDynamicImports` so the single-file bundle stays whole despite the SAC spec's lazy `import()` ([#1501](https://github.com/stellar/js-stellar-sdk/pull/1501)).

### Fixed
- `contract.AssembledTransaction.needsNonInvokerSigningBy` now treats an empty `scvVec` signature — the placeholder `authorizeInvocation` writes on unsigned entries — as unsigned, matching the existing `scvVoid` check. Previously such entries were wrongly considered already signed and omitted from the list ([#1468](https://github.com/stellar/js-stellar-sdk/issues/1468)).
- `Spec.nativeToScVal` no longer misclassifies plain objects that have a
`constructor` key, and handles null-prototype objects
(`Object.create(null)`); non-plain class instances now consistently get the
Expand Down
46 changes: 23 additions & 23 deletions docs/reference/contracts-client.md
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ class AssembledTransaction<T> {
}
```

**Source:** [src/contract/assembled_transaction.ts:257](https://github.com/stellar/js-stellar-sdk/blob/main/src/contract/assembled_transaction.ts#L257)
**Source:** [src/contract/assembled_transaction.ts:258](https://github.com/stellar/js-stellar-sdk/blob/main/src/contract/assembled_transaction.ts#L258)

### `AssembledTransaction.Errors`

Expand All @@ -248,7 +248,7 @@ logic.
static Errors: { ExpiredState: typeof ExpiredStateError; ExternalServiceError: typeof ExternalServiceError; FakeAccount: typeof FakeAccountError; InternalWalletError: typeof InternalWalletError; InvalidClientRequest: typeof InvalidClientRequestError; NeedsMoreSignatures: typeof NeedsMoreSignaturesError; NoSignatureNeeded: typeof NoSignatureNeededError; NoSigner: typeof NoSignerError; NotYetSimulated: typeof NotYetSimulatedError; NoUnsignedNonInvokerAuthEntries: typeof NoUnsignedNonInvokerAuthEntriesError; RestorationFailure: typeof RestoreFailureError; SimulationFailed: typeof SimulationFailedError; UserRejected: typeof UserRejectedError };
```

**Source:** [src/contract/assembled_transaction.ts:338](https://github.com/stellar/js-stellar-sdk/blob/main/src/contract/assembled_transaction.ts#L338)
**Source:** [src/contract/assembled_transaction.ts:339](https://github.com/stellar/js-stellar-sdk/blob/main/src/contract/assembled_transaction.ts#L339)

### `AssembledTransaction.build(options)`

Expand Down Expand Up @@ -284,7 +284,7 @@ const tx = await AssembledTransaction.build({
})
```

**Source:** [src/contract/assembled_transaction.ts:572](https://github.com/stellar/js-stellar-sdk/blob/main/src/contract/assembled_transaction.ts#L572)
**Source:** [src/contract/assembled_transaction.ts:573](https://github.com/stellar/js-stellar-sdk/blob/main/src/contract/assembled_transaction.ts#L573)

### `AssembledTransaction.buildWithOp(operation, options)`

Expand Down Expand Up @@ -316,7 +316,7 @@ const tx = await AssembledTransaction.buildWithOp(
)
```

**Source:** [src/contract/assembled_transaction.ts:601](https://github.com/stellar/js-stellar-sdk/blob/main/src/contract/assembled_transaction.ts#L601)
**Source:** [src/contract/assembled_transaction.ts:602](https://github.com/stellar/js-stellar-sdk/blob/main/src/contract/assembled_transaction.ts#L602)

### `AssembledTransaction.fromJSON(options, __namedParameters)`

Expand All @@ -329,7 +329,7 @@ static fromJSON<T>(options: Omit<AssembledTransactionOptions<T>, "args">, __name
- **`options`** — `Omit<AssembledTransactionOptions<T>, "args">` (required)
- **`__namedParameters`** — `{ simulationResult: { auth: string[]; retval: string }; simulationTransactionData: string; tx: string }` (required)

**Source:** [src/contract/assembled_transaction.ts:433](https://github.com/stellar/js-stellar-sdk/blob/main/src/contract/assembled_transaction.ts#L433)
**Source:** [src/contract/assembled_transaction.ts:434](https://github.com/stellar/js-stellar-sdk/blob/main/src/contract/assembled_transaction.ts#L434)

### `AssembledTransaction.fromXDR(options, encodedXDR, spec)`

Expand All @@ -345,7 +345,7 @@ static fromXDR<T>(options: Omit<AssembledTransactionOptions<T>, "args" | "method
- **`encodedXDR`** — `string` (required)
- **`spec`** — `Spec` (required)

**Source:** [src/contract/assembled_transaction.ts:492](https://github.com/stellar/js-stellar-sdk/blob/main/src/contract/assembled_transaction.ts#L492)
**Source:** [src/contract/assembled_transaction.ts:493](https://github.com/stellar/js-stellar-sdk/blob/main/src/contract/assembled_transaction.ts#L493)

### `assembledTransaction.built`

Expand All @@ -357,15 +357,15 @@ you call `tx.simulate()` again.
built?: Transaction;
```

**Source:** [src/contract/assembled_transaction.ts:285](https://github.com/stellar/js-stellar-sdk/blob/main/src/contract/assembled_transaction.ts#L285)
**Source:** [src/contract/assembled_transaction.ts:286](https://github.com/stellar/js-stellar-sdk/blob/main/src/contract/assembled_transaction.ts#L286)

### `assembledTransaction.options`

```ts
options: AssembledTransactionOptions<T>;
```

**Source:** [src/contract/assembled_transaction.ts:542](https://github.com/stellar/js-stellar-sdk/blob/main/src/contract/assembled_transaction.ts#L542)
**Source:** [src/contract/assembled_transaction.ts:543](https://github.com/stellar/js-stellar-sdk/blob/main/src/contract/assembled_transaction.ts#L543)

### `assembledTransaction.raw`

Expand All @@ -386,7 +386,7 @@ await tx.simulate();
raw?: TransactionBuilder;
```

**Source:** [src/contract/assembled_transaction.ts:272](https://github.com/stellar/js-stellar-sdk/blob/main/src/contract/assembled_transaction.ts#L272)
**Source:** [src/contract/assembled_transaction.ts:273](https://github.com/stellar/js-stellar-sdk/blob/main/src/contract/assembled_transaction.ts#L273)

### `assembledTransaction.signed`

Expand All @@ -396,7 +396,7 @@ The signed transaction.
signed?: Transaction;
```

**Source:** [src/contract/assembled_transaction.ts:331](https://github.com/stellar/js-stellar-sdk/blob/main/src/contract/assembled_transaction.ts#L331)
**Source:** [src/contract/assembled_transaction.ts:332](https://github.com/stellar/js-stellar-sdk/blob/main/src/contract/assembled_transaction.ts#L332)

### `assembledTransaction.simulation`

Expand All @@ -410,7 +410,7 @@ logic.
simulation?: SimulateTransactionResponse;
```

**Source:** [src/contract/assembled_transaction.ts:294](https://github.com/stellar/js-stellar-sdk/blob/main/src/contract/assembled_transaction.ts#L294)
**Source:** [src/contract/assembled_transaction.ts:295](https://github.com/stellar/js-stellar-sdk/blob/main/src/contract/assembled_transaction.ts#L295)

### `assembledTransaction.isReadCall`

Expand All @@ -423,23 +423,23 @@ returns `false`, then you need to call `signAndSend` on this transaction.
readonly isReadCall: boolean;
```

**Source:** [src/contract/assembled_transaction.ts:1089](https://github.com/stellar/js-stellar-sdk/blob/main/src/contract/assembled_transaction.ts#L1089)
**Source:** [src/contract/assembled_transaction.ts:1090](https://github.com/stellar/js-stellar-sdk/blob/main/src/contract/assembled_transaction.ts#L1090)

### `assembledTransaction.result`

```ts
readonly result: T;
```

**Source:** [src/contract/assembled_transaction.ts:738](https://github.com/stellar/js-stellar-sdk/blob/main/src/contract/assembled_transaction.ts#L738)
**Source:** [src/contract/assembled_transaction.ts:739](https://github.com/stellar/js-stellar-sdk/blob/main/src/contract/assembled_transaction.ts#L739)

### `assembledTransaction.simulationData`

```ts
readonly simulationData: { result: SimulateHostFunctionResult; transactionData: SorobanTransactionData };
```

**Source:** [src/contract/assembled_transaction.ts:695](https://github.com/stellar/js-stellar-sdk/blob/main/src/contract/assembled_transaction.ts#L695)
**Source:** [src/contract/assembled_transaction.ts:696](https://github.com/stellar/js-stellar-sdk/blob/main/src/contract/assembled_transaction.ts#L696)

### `assembledTransaction.needsNonInvokerSigningBy(__namedParameters)`

Expand Down Expand Up @@ -469,7 +469,7 @@ needsNonInvokerSigningBy(__namedParameters: { includeAlreadySigned?: boolean } =

- **`__namedParameters`** — `{ includeAlreadySigned?: boolean }` (optional) (default: `{}`)

**Source:** [src/contract/assembled_transaction.ts:924](https://github.com/stellar/js-stellar-sdk/blob/main/src/contract/assembled_transaction.ts#L924)
**Source:** [src/contract/assembled_transaction.ts:925](https://github.com/stellar/js-stellar-sdk/blob/main/src/contract/assembled_transaction.ts#L925)

### `assembledTransaction.restoreFootprint(restorePreamble, account)`

Expand Down Expand Up @@ -504,7 +504,7 @@ Client initialization.
- - Throws a custom error if the
restore transaction fails, providing the details of the failure.

**Source:** [src/contract/assembled_transaction.ts:1118](https://github.com/stellar/js-stellar-sdk/blob/main/src/contract/assembled_transaction.ts#L1118)
**Source:** [src/contract/assembled_transaction.ts:1119](https://github.com/stellar/js-stellar-sdk/blob/main/src/contract/assembled_transaction.ts#L1119)

### `assembledTransaction.send(watcher)`

Expand All @@ -521,7 +521,7 @@ send(watcher?: Watcher): Promise<SentTransaction<T>>;

- **`watcher`** — `Watcher` (optional)

**Source:** [src/contract/assembled_transaction.ts:853](https://github.com/stellar/js-stellar-sdk/blob/main/src/contract/assembled_transaction.ts#L853)
**Source:** [src/contract/assembled_transaction.ts:854](https://github.com/stellar/js-stellar-sdk/blob/main/src/contract/assembled_transaction.ts#L854)

### `assembledTransaction.sign(__namedParameters)`

Expand All @@ -536,7 +536,7 @@ sign(__namedParameters: { force?: boolean; signTransaction?: SignTransaction } =

- **`__namedParameters`** — `{ force?: boolean; signTransaction?: SignTransaction }` (optional) (default: `{}`)

**Source:** [src/contract/assembled_transaction.ts:766](https://github.com/stellar/js-stellar-sdk/blob/main/src/contract/assembled_transaction.ts#L766)
**Source:** [src/contract/assembled_transaction.ts:767](https://github.com/stellar/js-stellar-sdk/blob/main/src/contract/assembled_transaction.ts#L767)

### `assembledTransaction.signAndSend(__namedParameters)`

Expand All @@ -555,7 +555,7 @@ signAndSend(__namedParameters: { force?: boolean; signTransaction?: SignTransact

- **`__namedParameters`** — `{ force?: boolean; signTransaction?: SignTransaction; watcher?: Watcher }` (optional) (default: `{}`)

**Source:** [src/contract/assembled_transaction.ts:871](https://github.com/stellar/js-stellar-sdk/blob/main/src/contract/assembled_transaction.ts#L871)
**Source:** [src/contract/assembled_transaction.ts:872](https://github.com/stellar/js-stellar-sdk/blob/main/src/contract/assembled_transaction.ts#L872)

### `assembledTransaction.signAuthEntries(__namedParameters)`

Expand All @@ -582,7 +582,7 @@ signAuthEntries(__namedParameters: { address?: string; authorizeEntry?: (entry:

- **`__namedParameters`** — `{ address?: string; authorizeEntry?: (entry: SorobanAuthorizationEntry, signer: Keypair | SigningCallback, validUntilLedgerSeq: number, networkPassphrase: string, forAddress?: string) => Promise<SorobanAuthorizationEntry>; expiration?: number | Promise<number>; signAuthEntry?: SignAuthEntry }` (optional) (default: `{}`)

**Source:** [src/contract/assembled_transaction.ts:985](https://github.com/stellar/js-stellar-sdk/blob/main/src/contract/assembled_transaction.ts#L985)
**Source:** [src/contract/assembled_transaction.ts:986](https://github.com/stellar/js-stellar-sdk/blob/main/src/contract/assembled_transaction.ts#L986)

### `assembledTransaction.simulate(__namedParameters)`

Expand All @@ -594,7 +594,7 @@ simulate(__namedParameters: { restore?: boolean } = {}): Promise<AssembledTransa

- **`__namedParameters`** — `{ restore?: boolean }` (optional) (default: `{}`)

**Source:** [src/contract/assembled_transaction.ts:642](https://github.com/stellar/js-stellar-sdk/blob/main/src/contract/assembled_transaction.ts#L642)
**Source:** [src/contract/assembled_transaction.ts:643](https://github.com/stellar/js-stellar-sdk/blob/main/src/contract/assembled_transaction.ts#L643)

### `assembledTransaction.toJSON()`

Expand All @@ -607,7 +607,7 @@ transaction. This only works with transactions that have been simulated.
toJSON(): string;
```

**Source:** [src/contract/assembled_transaction.ts:360](https://github.com/stellar/js-stellar-sdk/blob/main/src/contract/assembled_transaction.ts#L360)
**Source:** [src/contract/assembled_transaction.ts:361](https://github.com/stellar/js-stellar-sdk/blob/main/src/contract/assembled_transaction.ts#L361)

### `assembledTransaction.toXDR()`

Expand All @@ -617,7 +617,7 @@ Serialize the AssembledTransaction to a base64-encoded XDR string.
toXDR(): string;
```

**Source:** [src/contract/assembled_transaction.ts:480](https://github.com/stellar/js-stellar-sdk/blob/main/src/contract/assembled_transaction.ts#L480)
**Source:** [src/contract/assembled_transaction.ts:481](https://github.com/stellar/js-stellar-sdk/blob/main/src/contract/assembled_transaction.ts#L481)

## contract.Client

Expand Down
Loading
Loading