Skip to content

Commit b374f14

Browse files
authored
replaced tx receipt subscription + forte lowercase (#517)
* lowercase characters for eth address of the seller and buyer * replaced transaction receipt subscription
1 parent ef3da8c commit b374f14

File tree

2 files changed

+5
-21
lines changed

2 files changed

+5
-21
lines changed

packages/checkout/src/api/data.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -341,9 +341,9 @@ export const createFortePaymentIntent = async (
341341
blockchain: forteBlockchainName,
342342
idempotencyKey: idempotencyKey,
343343
buyer: {
344-
id: recipientAddress,
344+
id: recipientAddress.toLowerCase(),
345345
wallet: {
346-
address: recipientAddress,
346+
address: recipientAddress.toLowerCase(),
347347
blockchain: forteBlockchainName
348348
}
349349
}
@@ -424,7 +424,7 @@ export const createFortePaymentIntent = async (
424424
],
425425
seller: {
426426
wallet: {
427-
address: protocolConfig.sellerAddress || '',
427+
address: protocolConfig.sellerAddress.toLowerCase(),
428428
blockchain: forteBlockchainName
429429
}
430430
}

packages/connect/src/utils/transactions.ts

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -206,26 +206,10 @@ export const waitForTransactionReceipt = async ({
206206
publicClient,
207207
confirmations
208208
}: WaitForTransactionReceiptInput): Promise<TransactionReceipt> => {
209-
const receiptPromise = new Promise<TransactionReceipt>(async (resolve, reject) => {
210-
await indexerClient.subscribeReceipts(
211-
{
212-
filter: {
213-
txnHash
214-
}
215-
},
216-
{
217-
onMessage: ({ receipt }) => {
218-
resolve(receipt)
219-
},
220-
onError: () => {
221-
reject('Transaction receipt not found')
222-
}
223-
}
224-
)
209+
const { receipt } = await indexerClient.fetchTransactionReceipt({
210+
txnHash
225211
})
226212

227-
const receipt = await receiptPromise
228-
229213
if (confirmations) {
230214
const blockConfirmationPromise = new Promise<void>(resolve => {
231215
const unwatch = publicClient.watchBlocks({

0 commit comments

Comments
 (0)