Skip to content

feat(tokens): add Soroban config validation and admin signing flow - #4

Open
Akinyemi04 wants to merge 1 commit into
Stellar-AgentVerse:mainfrom
Akinyemi04:soroban_transaction
Open

feat(tokens): add Soroban config validation and admin signing flow#4
Akinyemi04 wants to merge 1 commit into
Stellar-AgentVerse:mainfrom
Akinyemi04:soroban_transaction

Conversation

@Akinyemi04

Copy link
Copy Markdown

Validate contract IDs and admin secret key formats (fail-fast in production), derive the admin keypair via SorobanSigningService, add a SorobanTxService build/sign/submit primitive, and wire mint/sell to real admin-signed contract invocations.
Closes #3

Validate contract IDs and admin secret key formats (fail-fast in
production), derive the admin keypair via SorobanSigningService, add a
SorobanTxService build/sign/submit primitive, and wire mint/sell to real
admin-signed contract invocations.
@Akinyemi04
Akinyemi04 force-pushed the soroban_transaction branch from 82816d1 to bacf28b Compare June 23, 2026 07:37

@Joaco2603 Joaco2603 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Review — PR #4

Buen trabajo con la separación de SorobanSigningService y SorobanTxService, la validación de config en startup y el testeo. La migración de simulado a real está bien pensada.

Unos pocos detalles para corregir antes de mergear:

1. Type mismatch: signTransaction espera Transaction, prepareTransaction puede devolver FeeBumpTransaction

La firma de SorobanSigningService.signTransaction es:

signTransaction(transaction: Transaction): void

Pero rpc.Server.prepareTransaction puede devolver Transaction | FeeBumpTransaction según la versión del SDK. Aunque en runtime ambas tienen .sign(), el tipo de TypeScript no lo va a aceptar. Cambiá la firma a Transaction | FeeBumpTransaction o usá el tipo común que ambos implementan.

2. xdr import no usado en runtime en soroban-tx.service.ts

import { ..., xdr } from "@stellar/stellar-sdk";

xdr se usa solo en el tipo InvokeContractParams.args. Si el linter está configurado para no-unused-vars, esto va a fallar. Mejor importalo como type:

import type { xdr } from "@stellar/stellar-sdk";

3. TokensService constructor — tipo más acotado que el config real

El sorobanConfig provee el StellarEnv completo, pero el constructor declara solo contracts:

private readonly config: {
  contracts: { tokenMint: string; tokenSale: string };
},

Funciona por structural typing, pero es confuso. Mejor usar Pick<StellarEnv, "contracts"> o declarar un interface local.


Nada bloqueante de runtime, pero son detalles que hacen diferencia en mantenibilidad. Arreglalos y mandate merge.

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.

feat(tokens): implement Soroban transaction signing and contract config

2 participants