import { __decorate, __metadata } from "tslib";
import { GrumpkinAddress } from '@polyaztec/barretenberg/address';
import { Column, Entity, Index, PrimaryColumn } from 'typeorm';
import { SpendingKey } from '../database.js';
import { grumpkinAddressTransformer } from './transformer.js';
let SpendingKeyDao = class SpendingKeyDao {
    constructor(init) {
        Object.assign(this, init);
    }
};
__decorate([
    PrimaryColumn(),
    __metadata("design:type", Buffer)
], SpendingKeyDao.prototype, "key", void 0);
__decorate([
    PrimaryColumn('blob', { transformer: [grumpkinAddressTransformer] }),
    __metadata("design:type", GrumpkinAddress)
], SpendingKeyDao.prototype, "userId", void 0);
__decorate([
    Column(),
    __metadata("design:type", Number)
], SpendingKeyDao.prototype, "treeIndex", void 0);
__decorate([
    Column(),
    __metadata("design:type", Buffer)
], SpendingKeyDao.prototype, "hashPath", void 0);
SpendingKeyDao = __decorate([
    Entity({ name: 'spendingKey' }),
    Index(['key', 'userId'], { unique: true }),
    __metadata("design:paramtypes", [SpendingKey])
], SpendingKeyDao);
export { SpendingKeyDao };
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3BlbmRpbmdfa2V5X2Rhby5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9kYXRhYmFzZS9ub2RlL3NwZW5kaW5nX2tleV9kYW8udHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLE9BQU8sRUFBRSxlQUFlLEVBQUUsTUFBTSxpQ0FBaUMsQ0FBQztBQUNsRSxPQUFPLEVBQUUsTUFBTSxFQUFFLE1BQU0sRUFBRSxLQUFLLEVBQUUsYUFBYSxFQUFFLE1BQU0sU0FBUyxDQUFDO0FBQy9ELE9BQU8sRUFBRSxXQUFXLEVBQUUsTUFBTSxnQkFBZ0IsQ0FBQztBQUM3QyxPQUFPLEVBQUUsMEJBQTBCLEVBQUUsTUFBTSxrQkFBa0IsQ0FBQztBQUk5RCxJQUFhLGNBQWMsR0FB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