@@ -59,7 +59,7 @@ function decodeAddress(val: xdr.ScVal): string {
5959 ) {
6060 return StrKey . encodeEd25519PublicKey ( addr . accountId ( ) . ed25519 ( ) ) ;
6161 }
62- return StrKey . encodeContract ( addr . contractId ( ) ) ;
62+ return StrKey . encodeContract ( Buffer . from ( addr . contractId ( ) ) ) ;
6363}
6464
6565/**
@@ -205,7 +205,12 @@ export class SorobanEventWorker {
205205
206206 await prisma . indexerState . update ( {
207207 where : { id : INDEXER_STATE_ID } ,
208- data : { lastLedger, lastCursor } ,
208+ create : {
209+ id : INDEXER_STATE_ID ,
210+ lastLedger,
211+ lastCursor,
212+ } ,
213+ update : { lastLedger, lastCursor } ,
209214 } ) ;
210215
211216 logger . info (
@@ -281,7 +286,7 @@ export class SorobanEventWorker {
281286 const depositedAmount = decodeI128 ( body [ 'deposited_amount' ] ) ;
282287 const startTime = Number ( decodeU64 ( body [ 'start_time' ] ) ) ;
283288
284- await prisma . $transaction ( async ( tx ) => {
289+ await prisma . $transaction ( async ( tx : any ) => {
285290 // Ensure both wallet accounts exist in the Users table.
286291 await tx . user . upsert ( {
287292 where : { publicKey : sender } ,
@@ -367,7 +372,7 @@ export class SorobanEventWorker {
367372 const newDepositedAmount = decodeI128 ( body [ 'new_deposited_amount' ] ) ;
368373 const timestamp = Math . floor ( Date . now ( ) / 1000 ) ;
369374
370- await prisma . $transaction ( async ( tx ) => {
375+ await prisma . $transaction ( async ( tx : any ) => {
371376 await tx . stream . update ( {
372377 where : { streamId } ,
373378 data : {
@@ -423,7 +428,7 @@ export class SorobanEventWorker {
423428 const amount = decodeI128 ( body [ 'amount' ] ) ;
424429 const timestamp = Number ( decodeU64 ( body [ 'timestamp' ] ) ) ;
425430
426- await prisma . $transaction ( async ( tx ) => {
431+ await prisma . $transaction ( async ( tx : any ) => {
427432 // Accumulate the withdrawn total.
428433 const stream = await tx . stream . findUniqueOrThrow ( {
429434 where : { streamId } ,
@@ -490,7 +495,7 @@ export class SorobanEventWorker {
490495 const refundedAmount = decodeI128 ( body [ 'refunded_amount' ] ) ;
491496 const timestamp = Math . floor ( Date . now ( ) / 1000 ) ;
492497
493- await prisma . $transaction ( async ( tx ) => {
498+ await prisma . $transaction ( async ( tx : any ) => {
494499 await tx . stream . update ( {
495500 where : { streamId } ,
496501 data : {
0 commit comments