Skip to content

Commit c9a5de1

Browse files
authored
feat: Support Nostr (#3864)
* feat: Add Nostr provider and service * feat: Nostr GetPublicKey Modal * feat: Generate Nostr pubkey * feat: Nostr SignEvent * feat: Nostr encrypt message * feat: NIP-04 decrypt message * feat: Export Nostr pubkey * feat: Display encrpt plaintext * chore: i18n * chore: i18n * chore: i18n * feat: Add nostr icon * feat: Add unit test case for NIP-06 * feat: Add unittest case for NIP-04 * chore: lint * feat: Add signSchnorr Method * feat: Add getRelays method * chore: upgrade provider sdk
1 parent 992b530 commit c9a5de1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+3095
-226
lines changed

package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,17 +65,17 @@
6565
"@cmdcode/crypto-utils": "1.9.5",
6666
"@cmdcode/tapscript": "1.2.9",
6767
"@legendapp/state": "^1.2.9",
68-
"@onekeyfe/cross-inpage-provider-core": "1.1.43",
69-
"@onekeyfe/cross-inpage-provider-errors": "1.1.43",
70-
"@onekeyfe/cross-inpage-provider-injected": "1.1.43",
71-
"@onekeyfe/cross-inpage-provider-types": "1.1.43",
72-
"@onekeyfe/extension-bridge-hosted": "1.1.43",
68+
"@onekeyfe/cross-inpage-provider-core": "1.1.46",
69+
"@onekeyfe/cross-inpage-provider-errors": "1.1.46",
70+
"@onekeyfe/cross-inpage-provider-injected": "1.1.46",
71+
"@onekeyfe/cross-inpage-provider-types": "1.1.46",
72+
"@onekeyfe/extension-bridge-hosted": "1.1.46",
7373
"@onekeyfe/hd-ble-sdk": "0.3.31",
7474
"@onekeyfe/hd-core": "0.3.31",
7575
"@onekeyfe/hd-shared": "0.3.31",
7676
"@onekeyfe/hd-transport": "0.3.31",
7777
"@onekeyfe/hd-web-sdk": "0.3.31",
78-
"@onekeyfe/onekey-cross-webview": "1.1.43",
78+
"@onekeyfe/onekey-cross-webview": "1.1.46",
7979
"@starcoin/starcoin": "2.1.5",
8080
"@web3-react/core": "8.0.35-beta.0",
8181
"@web3-react/empty": "8.0.20-beta.0",

packages/components/src/Icon/Icons.ext-bg.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1201,6 +1201,7 @@ const icons = {
12011201
WrenchScrewdriverSolid: () => null,
12021202
XCircleSolid: () => null,
12031203
XMarkSolid: () => null,
1204+
NostrMini: () => null,
12041205
};
12051206
export type ICON_NAMES = keyof typeof icons;
12061207
export default icons;

packages/components/src/Icon/Icons.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1256,6 +1256,7 @@ const icons = {
12561256
WrenchScrewdriverSolid: () => import("./react/solid/WrenchScrewdriver"),
12571257
XCircleSolid: () => import("./react/solid/XCircle"),
12581258
XMarkSolid: () => import("./react/solid/XMark"),
1259+
NostrMini: () => import("./react/mini/Nostr"),
12591260
};
12601261
export type ICON_NAMES = keyof typeof icons;
12611262
export default icons;
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import Svg, { SvgProps, Path } from 'react-native-svg';
2+
const Nostr = (props: SvgProps) => (
3+
<Svg
4+
viewBox="0 0 20 20"
5+
fill="currentColor"
6+
accessibilityRole="image"
7+
{...props}
8+
>
9+
<Path
10+
fillRule="evenodd"
11+
d="M19.5856 8.96734V18.6212C19.5856 18.9842 19.291 19.2788 18.928 19.2788H11.036C10.673 19.2788 10.3784 18.9842 10.3784 18.6212V16.8233C10.4143 14.6195 10.6475 12.5085 11.1369 11.5481C11.4304 10.9705 11.9141 10.6562 12.4697 10.488C13.5194 10.1725 15.3613 10.3882 16.143 10.3511C16.143 10.3511 18.5046 10.4451 18.5046 9.10769C18.5046 8.03131 17.4491 8.11598 17.4491 8.11598C16.2857 8.14613 15.3996 8.06726 14.8254 7.84108C13.8638 7.46295 13.8314 6.76934 13.8279 6.53736C13.7803 3.85799 9.82972 3.5367 6.34887 4.20132C2.54324 4.9251 6.39062 10.3801 6.39062 17.6619V18.6339C6.38367 18.9912 6.09485 19.28 5.73528 19.28H1.82758C1.46454 19.28 1.16992 18.9854 1.16992 18.6223V1.9256C1.16992 1.56255 1.46454 1.26794 1.82758 1.26794H5.50098C5.86403 1.26794 6.15864 1.56255 6.15864 1.9256C6.15864 2.46495 6.76527 2.76537 7.20371 2.45103C8.52484 1.50456 10.2206 1 12.1182 1C16.3692 1 19.5833 3.47754 19.5833 8.96734H19.5856ZM12.5288 7.00827C12.5288 6.23114 11.899 5.60132 11.1218 5.60132C10.3447 5.60132 9.71489 6.23114 9.71489 7.00827C9.71489 7.78541 10.3447 8.41523 11.1218 8.41523C11.899 8.41523 12.5288 7.78541 12.5288 7.00827Z"
12+
clipRule="evenodd"
13+
/>
14+
</Svg>
15+
);
16+
export default Nostr;

packages/components/src/locale/ar.json

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@
8383
"action__close": "يغلق",
8484
"action__close_all": "أغلق الكل",
8585
"action__close_all_tabs": "إغلاق كافة علامات التبويب",
86+
"action__close_pin_tab": "إغلاق علامة التبويب دبوس",
8687
"action__coin_control": "التحكم في العملات",
8788
"action__collapse": "ينهار",
8889
"action__collect_to_touch": "اجمع للمس",
@@ -180,6 +181,7 @@
180181
"action__go_tobackup": "انتقل إلى النسخ الاحتياطي",
181182
"action__grid_view": "عرض شبكي",
182183
"action__hide_chart": "إخفاء الرسم البياني",
184+
"action__hide_details": "أخف التفاصيل",
183185
"action__hide_risky_nfts": "إخفاء NFTs المحفوفة بالمخاطر",
184186
"action__hide_risky_tokens_histories": "إخفاء تاريخ الرموز المحفوفة بالمخاطر",
185187
"action__hide_this_collection": "إخفاء هذه المجموعة",
@@ -237,6 +239,7 @@
237239
"action__permanently_delete": "حذف بشكل دائم",
238240
"action__photo": "صورة",
239241
"action__pick_an_emoji": "اختر رمزًا تعبيريًا",
242+
"action__pin": "دبوس",
240243
"action__place_limit_order": "مكان الامر",
241244
"action__preview": "معاينة",
242245
"action__private_view_key": "تصدير مفتاح العرض الخاص",
@@ -324,6 +327,7 @@
324327
"action__str_more_actions": "و {count} إجراءات أخرى",
325328
"action__str_more_transations": "{count} مزيد من المعاملات",
326329
"action__submit": "إرسال",
330+
"action__submit_ticket": "قدم التذكرة",
327331
"action__submit_token": "إرسال الرمز",
328332
"action__submitting_order_str": "إرسال الطلب ... {0}",
329333
"action__subscribe": "الإشتراك",
@@ -346,6 +350,7 @@
346350
"action__unlike": "غير مفضل",
347351
"action__unlist_on_sale_inscription": "إلغاء القائمة",
348352
"action__unlock": "الغاء القفل",
353+
"action__unpin": "إزالة التثبيت",
349354
"action__unstake": "نزع",
350355
"action__unsubscribe": "إلغاء الاشتراك",
351356
"action__unwrap": "بسط",
@@ -396,6 +401,8 @@
396401
"action_copy_hash": "نسخ التجزئة",
397402
"action_retry": "أعد المحاولة",
398403
"action_unstake": "نزع",
404+
"actionn__bookmark": "إشارة مرجعية",
405+
"actionn__remove_bookmark": "إزالة المرجعية",
399406
"alert__some_of_words_you_typed_are_wrong": "بعض الكلمات التي كتبتها خاطئة",
400407
"alert_only_use_a_recovery_seed_from_device": "قم فقط بتدوين عبارات الاسترداد التي عرضها جهازك أثناء الإعداد.",
401408
"app__app_name": "OneKey",
@@ -542,6 +549,12 @@
542549
"content__custom_what_is_max_gas_price_desc": "المعاملة الأعلى سعرًا في mempool (الكتلة المعلقة).",
543550
"content__custom_what_is_pending_tx_desc": "سيتم تضمين عدد العناصر التي نقدرها في الكتلة التالية بناءً على لقطة mempool.",
544551
"content__customise_transfer_amount_by_adding_the_amount_after_the_address": "تخصيص مبلغ التحويل عن طريق إضافة المبلغ بعد العنوان (استخدم الفواصل للتقسيم). على سبيل المثال:",
552+
"content__dapp_potential_risk": "التطبيقات اللامركزية الضارة",
553+
"content__dapp_potential_risk_continue": "إذا كنت تفهم المخاطر وترغب في المتابعة، يمكنك المتابعة إلى الموقع.",
554+
"content__dapp_potential_risk_li_1": "المخاطر المحتملة:",
555+
"content__dapp_potential_risk_li_2": "سرقة عبارة الاسترداد أو كلمة المرور",
556+
"content__dapp_potential_risk_li_3": "هجمات التصيد",
557+
"content__dapp_potential_risk_li_4": "الرموز المزيفة أو عمليات الاحتيال",
545558
"content__data_for_this_token_is_not_included_yet": "لم يتم تضمين البيانات لهذا الرمز المميز حتى الآن.",
546559
"content__data_source": "مصدر البيانات:",
547560
"content__day": "يوم",
@@ -1048,6 +1061,8 @@
10481061
"empty__creating_data": "جارٍ تحضير محفظتك ...",
10491062
"empty__creating_data_desc": "قد يستغرق التحميل الأولي بعض الوقت ، فلا تتردد في العودة إلى هذه الصفحة لاحقًا.",
10501063
"empty__migrated_data_already_exists": "البيانات التي تم ترحيلها موجودة بالفعل.",
1064+
"empty__network_issue_connect": "غير قادر على الاتصال",
1065+
"empty__network_issue_refresh": "تم اكتشاف مشكلة في الشبكة. يرجى التحقق من اتصالك وتحديث الصفحة",
10511066
"empty__no_account_desc": "لا يوجد حساب للشبكة المختارة.",
10521067
"empty__no_account_title": "لا حسابات",
10531068
"empty__no_connected_sites": "لا توجد مواقع متصلة",
@@ -1562,6 +1577,7 @@
15621577
"form__node_id": "معرف العقدة",
15631578
"form__nonce": "نونس",
15641579
"form__normal": "طبيعي",
1580+
"form__nostr_plaintext": "نص عادي",
15651581
"form__not__selected_str_uppercase": "غير محدد ( {0} )",
15661582
"form__not_appear_to_be_a_honeypot": "ليس موضع جذب",
15671583
"form__not_appear_to_be_a_honeypot_desc": "لا يوجد ترميز نعرفه يمنع مبيعات الرمز المميز.",
@@ -2149,6 +2165,8 @@
21492165
"msg__address_deleted": "تم حذف العنوان",
21502166
"msg__address_is_inconsistent_please_check_manually": "العنوان غير متسق. يرجى التحقق يدويًا.",
21512167
"msg__alert_already_exists": "التنبيه موجود بالفعل",
2168+
"msg__allow_sign_event": "السماح لموقع الويب هذا بالتوقيع على {kind} :",
2169+
"msg__allow_website_to": "السماح لهذا الموقع",
21522170
"msg__amount_should_not_be_less_than_int": "يجب ألا يقل المبلغ عن {0}",
21532171
"msg__amount_should_not_exceed_int": "يجب ألا يتجاوز المبلغ {0}",
21542172
"msg__amount_too_small": "مبلغ التحويل صغير جدًا",
@@ -2157,6 +2175,8 @@
21572175
"msg__asset_ratio": "نسبة الأصول",
21582176
"msg__authentication_failed_verify_again": "فشلت المصادقة ، تحقق من اتصال الشبكة وحاول مرة أخرى",
21592177
"msg__backup_imported": "البيانات المستوردة",
2178+
"msg__bookmark_added": "تمت إضافة الإشارة المرجعية",
2179+
"msg__bookmark_removed": "تمت إزالة الإشارة المرجعية",
21602180
"msg__broadcast_dot_tx_Insufficient_fee": "الرصيد غير كاف.",
21612181
"msg__broadcast_dot_tx_outdated": "الصفقة عفا عليها الزمن.",
21622182
"msg__broadcast_tx_Insufficient_fee": "رسوم غير كافية: يرجى التحقق مما إذا كان الرصيد كافياً أو حاول تبديل ترس الرسوم.",
@@ -2343,11 +2363,38 @@
23432363
"msg__network_reset": "إعادة تعيين الشبكة",
23442364
"msg__nfc_reader_usage_description": "استخدم NFC لإجراء نسخ احتياطي باستخدام OneKey Lite.",
23452365
"msg__nft_does_not_exist": "NFT غير موجود",
2366+
"msg__no_content": "لا يوجد محتوى",
23462367
"msg__no_data_available": "لا تتوافر بيانات",
23472368
"msg__no_route_found": "لم يتم العثور على مسار",
23482369
"msg__nonce_has_been_used_and_may_cause_this_transaction_to_fail": "تم استخدام Nonce وقد يتسبب في فشل هذه المعاملة.",
23492370
"msg__nonce_is_higher_means_the_tx_will_queued_until_tx_before_are_confirmed": "Nonce أعلى ، فهذا يعني أنه سيتم وضع المعاملة في قائمة الانتظار حتى يتم تأكيد المعاملات الموجودة أمامها.",
23502371
"msg__nonce_used_this_will_generate_a_rbf_tx": "تم استخدام nonce ، سيؤدي ذلك إلى استبداله بمعاملة الرسوم. ادفع رسومًا أعلى لضمان إمكانية استبدال المعاملة المستهدفة.",
2372+
"msg__nostr_allow_website_to_decrypt_data": "السماح لهذا الموقع بفك تشفير البيانات",
2373+
"msg__nostr_allow_website_to_encrypt_data": "السماح لهذا الموقع بتشفير البيانات",
2374+
"msg__nostr_event_kind_0": "البيانات الوصفية",
2375+
"msg__nostr_event_kind_1": "مذكرة نصية قصيرة",
2376+
"msg__nostr_event_kind_10002": "البيانات الوصفية لقائمة التتابع",
2377+
"msg__nostr_event_kind_1984": "إعداد التقارير",
2378+
"msg__nostr_event_kind_2": "يوصي التتابع",
2379+
"msg__nostr_event_kind_22242": "مصادقة العميل",
2380+
"msg__nostr_event_kind_24133": "اتصالنا",
2381+
"msg__nostr_event_kind_3": "جهات الاتصال",
2382+
"msg__nostr_event_kind_30008": "شارات الملف الشخصي",
2383+
"msg__nostr_event_kind_30009": "تعريف الشارة",
2384+
"msg__nostr_event_kind_30023": "محتوى طويل الشكل",
2385+
"msg__nostr_event_kind_30078": "البيانات الخاصة بالتطبيق",
2386+
"msg__nostr_event_kind_4": "رسائل مباشرة مشفرة",
2387+
"msg__nostr_event_kind_40": "إنشاء القناة",
2388+
"msg__nostr_event_kind_41": "البيانات الوصفية للقناة",
2389+
"msg__nostr_event_kind_42": "رسالة القناة",
2390+
"msg__nostr_event_kind_43": "رسالة إخفاء القناة",
2391+
"msg__nostr_event_kind_44": "قناة المستخدم كتم الصوت",
2392+
"msg__nostr_event_kind_5": "حذف الحدث",
2393+
"msg__nostr_event_kind_7": "رد فعل",
2394+
"msg__nostr_event_kind_8": "جائزة الشارة",
2395+
"msg__nostr_event_kind_9734": "طلب انطلق",
2396+
"msg__nostr_event_kind_9735": "انطلق",
2397+
"msg__nostr_event_kind_unknown": "حدث من نوع {kind}",
23512398
"msg__not_support_passphrase_need_upgrade": "استخدم عبارة المرور ، تحتاج إلى ترقية البرامج الثابتة إلى {0} أو أحدث.",
23522399
"msg__not_the_same_wallet": "ليست نفس المحفظة.",
23532400
"msg__ns_bluetooth_always_usage_description": "استخدم البلوتوث لتوصيل أجهزة OneKey.",
@@ -2371,6 +2418,8 @@
23712418
"msg__password_validation": "يجب أن تكون كلمة المرور بين 8 و 128 حرفًا.",
23722419
"msg__payment_channel_not_found_sending_failed": "قناة الدفع غير موجودة ، فشل الإرسال",
23732420
"msg__payment_received": "تم استلام الدفعة",
2421+
"msg__pin_tutorial": "يمكنك اللمس مع الاستمرار لتثبيت علامة التبويب هذه للوصول السريع.",
2422+
"msg__pinned": "مثبت",
23742423
"msg__please_approve_camera_permission_on_your_browser": "يرجى الموافقة على إذن الكاميرا على متصفحك.",
23752424
"msg__please_limit_the_amount_of_tokens_to_str_decimal_places_or_less": "الرجاء تحديد مقدار الرموز المميزة بـ {0} منازل عشرية أو أقل.",
23762425
"msg__please_limit_the_file_size_to_str_or_less": "الرجاء تحديد حجم الملف بـ {0} أو أقل",
@@ -2384,6 +2433,7 @@
23842433
"msg__price_alert_reached_desc": "وصل {0} إلى القيمة المستهدفة {1}",
23852434
"msg__processing_transactions": "معالجة المعاملات ...",
23862435
"msg__psbt_will_not_broadcast_to_blockchain_now_no_need_to_pay_tx_fee": "لن يتم بث معاملات البيتكوين الموقعة جزئيًا إلى blockchain على الفور، لذلك لا تحتاج إلى دفع رسوم المعاملات",
2436+
"msg__read_your_public_key": "اقرأ مفتاحك العام",
23872437
"msg__received": "🤑 تم استلام {assets}",
23882438
"msg__received_a_nft": "🤑 حصل على NFT",
23892439
"msg__received_desc": "من {address}",
@@ -2477,6 +2527,7 @@
24772527
"msg__transaction_with_the_same_nonce_already_exist_please_pay_a_higher_network_fee_otherwise_the_transaction_may_fail": "توجد معاملات بنفس القيمة الفعلية بالفعل ، يرجى دفع رسوم شبكة أعلى ، وإلا فقد تفشل المعاملة.",
24782528
"msg__unable_to_access_disk_onekey_data": "تعذر الوصول إلى القرص \"ONEKEY DATA\"",
24792529
"msg__unknown_error": "خطأ غير معروف",
2530+
"msg__unpinned": "غير مثبت",
24802531
"msg__unstaking_in_progress_str": "إلغاء التثبيت قيد التقدم: {0}",
24812532
"msg__unstaking_in_progress_str_desc": "قد يستغرق هذا {0}",
24822533
"msg__unsubscription_succeeded": "نجح إلغاء الاشتراك",
@@ -2544,6 +2595,7 @@
25442595
"platform__tablet": "لوح",
25452596
"reward__history_empty_desc": "سيظهر سجل المكافأة هنا.",
25462597
"select__options": "خيارات",
2598+
"tab__browser": "المتصفح",
25472599
"tag__adventurist_uppercase": "# مبتدئ",
25482600
"tag__hodler_uppercase": "# هودلر",
25492601
"tag__stablecoin_player_uppercase": "# لاعب STABLECOIN",
@@ -2731,6 +2783,9 @@
27312783
"title__no_request_history_desc": "أنت لم تقدم أي طلبات.",
27322784
"title__no_result_for_str": "لا توجد نتائج لـ \"{keyword}\"",
27332785
"title__no_used_addresses": "لا توجد عناوين مستخدمة",
2786+
"title__nostr": "Nostr",
2787+
"title__nostr_public_key": "مفتاح Nostr العام",
2788+
"title__nostr_request": "طلب نستر",
27342789
"title__notifications": "إشعارات",
27352790
"title__official_website": "الموقع الرسمي",
27362791
"title__onekey_lite_pin": "OneKey Lite PIN",

0 commit comments

Comments
 (0)