Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PR #3

Merged
merged 4 commits into from
Nov 12, 2024
Merged

PR #3

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@normalfinance/utils",
"version": "1.6.1",
"version": "1.6.2",
"description": "A Typescript modules for frequently used types, utilities, constants, and more across Normal repositories.",
"homepage": "https://github.com/normalfinance/utils#readme",
"bugs": {
Expand Down
1 change: 0 additions & 1 deletion src/constants/urls.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ export const normalUrls = {
},

// Web Interface Urls
webInterfaceLendingUrl: `${NORMAL_WEB_URL}/lending`,
webInterfaceIndexesUrl: `${NORMAL_WEB_URL}/indexes`,
webInterfaceInvestmentsUrl: `${NORMAL_WEB_URL}/investments`,
webInterfaceOrdersUrl: `${NORMAL_WEB_URL}/orders`,
Expand Down
29 changes: 0 additions & 29 deletions src/database/schema/giftNotifications.ts

This file was deleted.

63 changes: 0 additions & 63 deletions src/database/schema/gifts.ts

This file was deleted.

2 changes: 0 additions & 2 deletions src/database/schema/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ export * from './accountRecovery';
export * from './divestmentOrders';
export * from './divestments';
export * from './exchanges';
export * from './giftNotifications';
export * from './gifts';
export * from './indexCriteria';
export * from './indexPerformances';
export * from './indexWeights';
Expand Down
39 changes: 0 additions & 39 deletions src/types/analytics/email.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,6 @@ export enum TransactionalEmailTemplateId {
BillingChargeFailed = 'billing_charge_failed',
BillingChargeFailedRequires2fa = 'billing_charge_failed_requires_2fa',

// Gift
GiftCreated = 'gift_created',
GiftRedemptionSucceededSender = 'gift_redemption_succeeeded_sender',
GiftRedemptionFailedSender = 'gift_redemption_failed_sender',
GiftRedemptionSucceededRecipient = 'gift_redemption_succeeded_recipient',
GiftRedemptionFailedRecipient = 'gift_redemption_failed_recipient',

// Schedule
ScheduleCreated = 'schedule_created',
ScheduleUpdated = 'schedule_updated',
Expand Down Expand Up @@ -121,38 +114,6 @@ export type TransactionalEmailArgs = {
amount: string;
};

// Gift
[TransactionalEmailTemplateId.GiftCreated]: {
asset: string;
amount: string;
recipient: string;
action: string;
};
[TransactionalEmailTemplateId.GiftRedemptionSucceededSender]: {
asset: string;
amount: string;
recipient: string;
action: string;
};
[TransactionalEmailTemplateId.GiftRedemptionFailedSender]: {
asset: string;
amount: string;
recipient: string;
action: string;
};
[TransactionalEmailTemplateId.GiftRedemptionSucceededRecipient]: {
asset: string;
amount: string;
recipient: string;
action: string;
};
[TransactionalEmailTemplateId.GiftRedemptionFailedRecipient]: {
asset: string;
amount: string;
recipient: string;
action: string;
};

// Schedule
[TransactionalEmailTemplateId.ScheduleCreated]: {
asset: string;
Expand Down
14 changes: 0 additions & 14 deletions src/types/analytics/events/gift.ts

This file was deleted.

6 changes: 0 additions & 6 deletions src/types/analytics/events/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@ import type { AuthEventName } from './auth';
import type { BillingEventName } from './billing';
import type { DivestmentEventName } from './divestment';
import type { ExchangeEventName } from './exchange';
import type { GiftEventName } from './gift';
import type { IndexEventName } from './indexes';
import type { InvestmentEventName } from './investment';
import type { LendingEventName } from './lending';
import type { NotificationEventName } from './notification';
import type { ReferralEventName } from './referral';
import type { ScheduleEventName } from './schedule';
Expand All @@ -14,10 +12,8 @@ export * from './auth';
export * from './billing';
export * from './divestment';
export * from './exchange';
export * from './gift';
export * from './indexes';
export * from './investment';
export * from './lending';
export * from './notification';
export * from './referral';
export * from './schedule';
Expand All @@ -27,10 +23,8 @@ export type AnalyticsEventName =
| BillingEventName
| IndexEventName
| ExchangeEventName
| LendingEventName
| NotificationEventName
| ReferralEventName
| GiftEventName
| InvestmentEventName
| DivestmentEventName
| ScheduleEventName;
11 changes: 0 additions & 11 deletions src/types/analytics/events/lending.ts

This file was deleted.

4 changes: 2 additions & 2 deletions src/types/api/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ export * from './deposits';
export * from './orders';

export enum AmountType {
BASE = 'BASE', // @dev
QUOTE = 'QUOTE', // @dev
BASE = 'BASE',
QUOTE = 'QUOTE',
}
20 changes: 10 additions & 10 deletions src/types/indexes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@ export enum IndexQuoteFiatCurrency {
CHF = 'CHF',
AUD = 'AUD',
JPY = 'JPY',
ART = 'ART',
BRL = 'BRL',
CZK = 'CZK',
IDRT = 'IDRT',
MXN = 'MXN',
PLN = 'PLN',
RON = 'RON',
TRY = 'TRY',
UAH = 'UAH',
ZAR = 'ZAR',
// ART = 'ART',
// BRL = 'BRL',
// CZK = 'CZK',
// IDRT = 'IDRT',
// MXN = 'MXN',
// PLN = 'PLN',
// RON = 'RON',
// TRY = 'TRY',
// UAH = 'UAH',
// ZAR = 'ZAR',
}

export const IndexQuoteCurrency = {
Expand Down
16 changes: 1 addition & 15 deletions src/utils/idempotency.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable import/no-nodejs-modules */
import { createHash } from 'crypto';

import type { NewDivestment, NewGift, NewInvestment } from '../database';
import type { NewDivestment, NewInvestment } from '../database';

export const IdempotencyAlgorithm = 'md5'; // or sha256

Expand Down Expand Up @@ -86,17 +86,3 @@ export const createDivestmentIdempotencyKey = (divestment: NewDivestment) =>
divestment.exchangeId,
divestment.portion,
]);

/**
* Creates an idempotency key for a gift.
* @param gift - The gift.
* @returns The idempotency key.
*/
export const createGiftIdempotencyKey = (gift: NewGift) =>
createIdempotencyKey([
new Date().toJSON().slice(0, 10),
gift.exchangeId,
gift.asset,
gift.amount,
gift.recipient,
]);
Loading