@@ -17,7 +17,7 @@ import { getRaffleContractId } from './constants';
1717import { ContractFnName } from './bindings' ;
1818import { TikkaSdkError , TikkaSdkErrorCode } from '../utils/errors' ;
1919import { TransactionLifecycle } from './lifecycle' ;
20- import type { TxMemo } from './lifecycle' ;
20+ import type { TxMemo , PollConfig } from './lifecycle' ;
2121export type { TxMemo } from './lifecycle' ;
2222
2323export interface InvokeOptions {
@@ -26,6 +26,8 @@ export interface InvokeOptions {
2626 fee ?: string ;
2727 /** Optional memo attached to the transaction envelope. */
2828 memo ?: TxMemo ;
29+ /** Optional polling configuration override. */
30+ poll ?: PollConfig ;
2931}
3032
3133export interface InvokeResult < T = any > {
@@ -63,7 +65,7 @@ export interface SubmitSignedResult<T = any> {
6365 * Detects if an error message indicates a failure in an external contract
6466 * (e.g., a SEP-41 token contract rejecting a transfer).
6567 */
66- function isExternalContractFailure ( errorMsg : string ) : boolean {
68+ function isExternalSimulationError ( errorMsg : string ) : boolean {
6769 return / e x t e r n a l | t o k e n | s e p - ? 4 1 / i. test ( errorMsg ) ;
6870}
6971
@@ -116,7 +118,7 @@ export class ContractService {
116118
117119 if ( rpc . Api . isSimulationError ( simResponse ) ) {
118120 const errMsg = ( simResponse as any ) . error ?? '' ;
119- const code = isExternalContractFailure ( errMsg )
121+ const code = isExternalSimulationError ( errMsg )
120122 ? TikkaSdkErrorCode . ExternalContractError
121123 : TikkaSdkErrorCode . SimulationFailed ;
122124 throw new TikkaSdkError (
@@ -161,7 +163,7 @@ export class ContractService {
161163
162164 const signedXdr = await this . lifecycle . sign ( sim . assembledXdr , sim . networkPassphrase ) ;
163165 const txHash = await this . lifecycle . submit ( signedXdr ) ;
164- const polled = await this . lifecycle . poll < T > ( txHash ) ;
166+ const polled = await this . lifecycle . poll < T > ( txHash , options . poll ) ;
165167 return { result : polled . returnValue as T , txHash : polled . txHash , ledger : polled . ledger } ;
166168 }
167169
0 commit comments