Skip to content

Commit ab1b7c1

Browse files
adg-flareLukaAvbreht
authored andcommitted
fix: add missing files - this logic should be moved to js-flare-common
1 parent 278f4dc commit ab1b7c1

2 files changed

Lines changed: 22 additions & 0 deletions

File tree

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import {
2+
AttestationDefinitionStore,
3+
decodeAttestationName,
4+
} from '@flarenetwork/js-flare-common';
5+
import { ParamType } from 'ethers';
6+
import { AttestationTypeBase_Response } from '../dtos/attestation-types/AttestationTypeBase.dto';
7+
8+
export class AttestationDefinitionStoreExtended extends AttestationDefinitionStore {
9+
encodeResponse(response: AttestationTypeBase_Response): string {
10+
const attestationType = decodeAttestationName(response.attestationType);
11+
const { responseAbi } =
12+
this.getABIsForDecodedAttestationType(attestationType);
13+
return this.coder.encode([responseAbi as string | ParamType], [response]);
14+
}
15+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
export function serializeBigInts<T>(obj: T): T {
2+
return JSON.parse(
3+
JSON.stringify(obj, (_key, value: unknown) =>
4+
typeof value === 'bigint' ? value.toString() : value,
5+
),
6+
) as T;
7+
}

0 commit comments

Comments
 (0)