From 2ebaee880749c16898fcaeafaa81c1162f371966 Mon Sep 17 00:00:00 2001 From: "P. Reis" Date: Tue, 23 Jul 2024 20:39:23 -0300 Subject: [PATCH] refactor: change DittoZapSplits data structure to use object fields instead of array --- src/utils/zap-split.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/utils/zap-split.ts b/src/utils/zap-split.ts index 38eecba..33cd9c4 100644 --- a/src/utils/zap-split.ts +++ b/src/utils/zap-split.ts @@ -4,10 +4,10 @@ import { isNumberFrom1To100 } from '@/utils.ts'; type Pubkey = string; type ExtraMessage = string; /** Number from 1 to 100, stringified. */ -type splitPercentages = string; +type splitPercentages = number; export type DittoZapSplits = { - [key: Pubkey]: [splitPercentages, ExtraMessage]; + [key: Pubkey]: { amount: splitPercentages; message: ExtraMessage }; }; /** Gets zap splits from NIP-78 in DittoZapSplits format. */ @@ -27,7 +27,7 @@ export async function getZapSplits(store: NStore, pubkey: string): Promise