{"version":3,"sources":["../../src/utils/crc32.ts","../../src/types/index.ts"],"sourcesContent":["export function crc32(str: string): number {\n  const table = new Int32Array(256);\n  for (let i = 0; i < 256; i++) {\n    let c = i;\n    for (let j = 0; j < 8; j++) {\n      c = c & 1 ? 0xedb88320 ^ (c >>> 1) : c >>> 1;\n    }\n    table[i] = c;\n  }\n\n  let crc = -1;\n  for (let i = 0; i < str.length; i++) {\n    crc = (crc >>> 8) ^ table[(crc ^ str.charCodeAt(i)) & 0xff];\n  }\n  return (crc ^ -1) >>> 0;\n}\n","import { crc32 } from \"../utils/crc32\";\n\nexport interface UserResponse {\n  errorCode: number;\n  scores: [\n    {\n      address: string;\n      expirationDate: number | null;\n      isMinted: boolean;\n      network: string;\n      score: number | null;\n    }\n  ];\n}\n\nexport interface TrustResponseData {\n  errorCode: number;\n  wallet: string;\n  score: number;\n  expiration: number;\n  signature: string;\n  validation?: string;\n  attestationId?: string | null;\n  recovery_id?: string;\n  isRemint?: boolean;\n}\n\nexport interface AttestationParams {\n  signature: string;\n  trust: number;\n  expiration: number;\n  ref_id: number;\n}\n\nexport interface CreateAttestationOptions {\n  queryId: number;\n  trustScore: number;\n  expirationDate: number;\n  signature: Buffer;\n  value: bigint;\n  referralId?: bigint;\n}\n\nexport interface UpdateAttestationOptions {\n  queryId: number;\n  trustScore: number;\n  expirationDate: number;\n  signature: Buffer;\n  value: bigint;\n}\n\nexport interface SDKConfig {\n  hapiEndpoint: string;\n  contractAddress: string;\n  nodeUrl: string;\n  referralId: number;\n  network: number;\n  tonApiKey?: string;\n}\n\nexport interface AttestationChangeEvent {\n  userAddress: string;\n  refId: number;\n}\n\nexport const OpCode = {\n  createAttestation: crc32(\"create_attestation\"),\n  updateAttestation: crc32(\"update_attestation\"),\n} as const;\n"],"mappings":";AAAO,SAAS,MAAM,KAAqB;AACzC,QAAM,QAAQ,IAAI,WAAW,GAAG;AAChC,WAAS,IAAI,GAAG,IAAI,KAAK,KAAK;AAC5B,QAAI,IAAI;AACR,aAAS,IAAI,GAAG,IAAI,GAAG,KAAK;AAC1B,UAAI,IAAI,IAAI,aAAc,MAAM,IAAK,MAAM;AAAA,IAC7C;AACA,UAAM,CAAC,IAAI;AAAA,EACb;AAEA,MAAI,MAAM;AACV,WAAS,IAAI,GAAG,IAAI,IAAI,QAAQ,KAAK;AACnC,UAAO,QAAQ,IAAK,OAAO,MAAM,IAAI,WAAW,CAAC,KAAK,GAAI;AAAA,EAC5D;AACA,UAAQ,MAAM,QAAQ;AACxB;;;ACkDO,IAAM,SAAS;AAAA,EACpB,mBAAmB,MAAM,oBAAoB;AAAA,EAC7C,mBAAmB,MAAM,oBAAoB;AAC/C;","names":[]}