Skip to content

Commit

Permalink
Feat/aa nostr (#457)
Browse files Browse the repository at this point in the history
* init nostr AA

* continue building

* start fix stuff etc

* fixing stuff3

* fix aa
  • Loading branch information
MSghais authored Feb 3, 2025
1 parent e850f46 commit 2951747
Show file tree
Hide file tree
Showing 7 changed files with 657 additions and 38 deletions.
23 changes: 15 additions & 8 deletions apps/nestjs-indexer/src/indexer/tip-service.indexer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,14 @@ export class TipServiceIndexer {
}

private getAddress(addressFelt: IFieldElement) {
return validateAndParseAddress(
`0x${FieldElement.toBigInt(addressFelt).toString(16)}`,
) as ContractAddress;
try {
return validateAndParseAddress(
`0x${FieldElement.toBigInt(addressFelt).toString(16)}`,
) as ContractAddress;
} catch (error) {
this.logger.error(error);
}

}

private getU256ToHex(lowFelt: IFieldElement, highFelt: IFieldElement) {
Expand Down Expand Up @@ -259,12 +264,12 @@ export class TipServiceIndexer {
amountLow,
amountHigh,
contractAddressFelt,
gasTokenAddressFelt,
gasAmountLow,
gasAmountHigh,
gasTokenAddressFelt,
] = event.data;

const amount = this.uint256ToAmount(amountLow, amountHigh);
// const amount = this.uint256ToAmount(amountLow, amountHigh);
const tokenAddress = this.getAddress(contractAddressFelt);
const gasAmount = this.uint256ToAmount(gasAmountLow, gasAmountHigh);
const gasTokenAddress = this.getAddress(gasTokenAddressFelt);
Expand All @@ -275,7 +280,7 @@ export class TipServiceIndexer {
sender,
nostrRecipient,
starknetRecipient,
amount,
// amount,
tokenAddress,
gasTokenAddress,
gasAmount,
Expand All @@ -294,8 +299,6 @@ export class TipServiceIndexer {
transaction: starknet.ITransaction,
) {
try {

} catch (error) {
this.logger.error(error); const commonTxData = this.getTxData(header, transaction);

/* eslint-disable @typescript-eslint/no-unused-vars */
Expand Down Expand Up @@ -328,6 +331,10 @@ export class TipServiceIndexer {
};

await this.tipService.updateCancel(data);

} catch (error) {
this.logger.error(error);

}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ export interface TipClaim {
blockTimestamp: Date;
transactionHash: string;
depositId: string;
sender: string;
nostrRecipient: string;
starknetRecipient: string;
amount: number;
tokenAddress: string;
gasTokenAddress: string;
gasAmount: number;
sender?: string;
nostrRecipient?: string;
starknetRecipient?: string;
amount?: number;
tokenAddress?: string;
gasTokenAddress?: string;
gasAmount?: number;
}
6 changes: 3 additions & 3 deletions onchain/cairo/afk/.snfoundry_cache/.prev_tests_failed
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
afk::bip340::tests::test_20
afk::social::deposit::tests::claim_incorrect_gas_amount
afk::social::deposit::tests::deposit_claim_gas_fee
afk::social::deposit::tests::deposit_claim
afk::bip340::tests::test_generate_sign_and_verify
afk::social::deposit::tests::deposit_claim
afk::social::deposit::tests::deposit_with_known_starknet_recipient
afk::social::deposit::tests::deposit_claim_gas_fee
afk::social::deposit::tests::claim_incorrect_gas_amount
1 change: 1 addition & 0 deletions onchain/cairo/afk/src/account.cairo
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pub mod afk_id;
Loading

0 comments on commit 2951747

Please sign in to comment.