diff --git a/package.json b/package.json index 1529b6ac..d9301112 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "stellar-plus", - "version": "0.8.3", + "version": "0.8.4", "description": "beta version of stellar-plus, an all-in-one sdk for the Stellar blockchain", "main": "./lib/index.js", "types": "./lib/index.d.ts", diff --git a/src/stellar-plus/core/pipelines/soroban-auth/index.ts b/src/stellar-plus/core/pipelines/soroban-auth/index.ts index 9d7893a1..86b41e45 100644 --- a/src/stellar-plus/core/pipelines/soroban-auth/index.ts +++ b/src/stellar-plus/core/pipelines/soroban-auth/index.ts @@ -83,7 +83,14 @@ export class SorobanAuthPipeline extends ConveyorBelt< let updatedTransaction try { - updatedTransaction = this.updateTransaction(transaction, authEntries, simulation.transactionData) + updatedTransaction = this.updateTransaction( + transaction, + [ + ...this.getSourceCredentialAuth(simulation.result?.auth), // Reinject unsigned source credentials. These are signed in the classic signing pipeline + ...authEntries, + ], + simulation.transactionData + ) } catch (error) { throw PSAError.couldntUpdateTransaction( error as Error, @@ -182,4 +189,13 @@ export class SorobanAuthPipeline extends ConveyorBelt< }) : [] } + + protected getSourceCredentialAuth(authEntries?: xdr.SorobanAuthorizationEntry[]): xdr.SorobanAuthorizationEntry[] { + return authEntries + ? authEntries.filter((entry) => { + const credentials = entry.credentials() + return credentials.switch() === xdr.SorobanCredentialsType.sorobanCredentialsSourceAccount() + }) + : [] + } }