Skip to content

Commit

Permalink
Merge branch 'develop' into fix/capacitor-wallet-plugin
Browse files Browse the repository at this point in the history
* develop:
  New Crowdin translations by Github Action (#3220)
  New Crowdin translations by Github Action (#2964)
  feat: mobile rename profile (#2512)
  chore: sync strings from Desktop 1.5.2 to develop (#3184)
  fix: receive qr responsiveness (#3159)

Signed-off-by: Amadeo Marchioni <[email protected]>
  • Loading branch information
amadeu2 committed May 17, 2022
2 parents 0b4366e + 5ffe868 commit 35e8b9a
Show file tree
Hide file tree
Showing 52 changed files with 774 additions and 671 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,16 @@ public void load() {

@PluginMethod()
public void initialize(final PluginCall call) {
if (isInitialized) return;
if (!call.getData().has("actorId")) {
call.reject("actorId is required");
return;
if (isInitialized) {
call.reject("Wallet is already initialized!");
}
if (!call.getData().has("actorId") || !call.getData().has("storagePath")) {
call.reject("actorId & storagePath are required");
}
String actorId = call.getString("actorId");
String dbPath = getContext().getFilesDir() + "/__storage__";
String storagePath = call.getString("storagePath");
assert actorId != null && storagePath != null;
String dbPath = getContext().getFilesDir() + storagePath;

try {
final ActorCallback callback = response -> {
Expand All @@ -55,7 +58,6 @@ public void sendMessage(final PluginCall call) {
try {
if (!call.getData().has("message")) {
call.reject("message is required");
return;
}

Actor.iotaSendMessage(call.getObject("message").toString());
Expand All @@ -68,15 +70,14 @@ public void sendMessage(final PluginCall call) {
@PluginMethod()
public void destroy(final PluginCall call) {
if (!isInitialized) {
call.resolve();
return;
call.reject("Wallet is not initialized yet");
}
try {
if (!call.getData().has("actorId")) {
call.reject("actorId is required");
return;
}
String actorId = call.getString("actorId");
assert actorId != null;

Actor.iotaDestroy(actorId);
isInitialized = false;
Expand All @@ -90,21 +91,16 @@ public void destroy(final PluginCall call) {
public void listen(final PluginCall call) {
if (!isInitialized) {
call.reject("Wallet is not initialized yet");
return;
}
if (!call.getData().has("actorId")
|| !call.getData().has("id")
|| !call.getData().has("event")) {
call.reject("actorId, id and event are required");
return;
}
String actorId = call.getString("actorId");
String id = call.getString("id");
String event = call.getString("event");
if (event == null) {
call.reject("event is null");
return;
}
assert actorId != null && id != null && event != null;
String snakedEvent = event.replaceAll("([a-z])([A-Z]+)", "$1_$2").toUpperCase();

synchronized (lock) {
Expand Down
7 changes: 4 additions & 3 deletions packages/backend/bindings/capacitor/ios/Plugin/Plugin.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,13 @@ public class WalletPlugin: CAPPlugin {
@objc func initialize(_ call: CAPPluginCall) {
do {
guard !isInitialized else { return }
guard let actorId = call.getString("actorId") else {
return call.reject("actorId is required")
guard let actorId = call.getString("actorId"),
let storagePath = call.getString("storagePath") else {
return call.reject("actorId and storagePath are required")
}
let fm = FileManager.default
let documents = fm.urls(for: .applicationSupportDirectory, in: .userDomainMask).first!
let path = documents.appendingPathComponent("__storage__", isDirectory: true).path
let path = documents.appendingPathComponent(storagePath, isDirectory: true).path
if !fm.fileExists(atPath: path) {
try fm.createDirectory(atPath: path, withIntermediateDirectories: true, attributes: nil)
}
Expand Down
2 changes: 1 addition & 1 deletion packages/backend/bindings/capacitor/src/definitions.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { PluginListenerHandle } from "@capacitor/core";

export interface WalletPluginTypes {
initialize(options: { actorId: string }): Promise<void>
initialize(options: { actorId: string, storagePath: string }): Promise<void>
listen(options: { actorId: string, id: string, event: string }): Promise<string>
destroy(options: { actorId: string }): Promise<void>
sendMessage(message: { [key: string]: any }): Promise<void>
Expand Down
7 changes: 6 additions & 1 deletion packages/mobile/capacitor/capacitorApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,12 @@ export const CapacitorApi: IPlatform = {
activeProfileId = id
},

renameProfileFolder: (oldPath, newPath) => new Promise<void>((resolve, reject) => {}),
renameProfileFolder: async (oldPath, newPath) => {
void (await SecureFilesystemAccess.renameProfileFolder({
oldName: oldPath,
newName: newPath,
}))
},

removeProfileFolder: async (profilePath) => {
void (await SecureFilesystemAccess.removeProfileFolder({
Expand Down
2 changes: 1 addition & 1 deletion packages/mobile/capacitor/walletPluginApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ export function init(
onMessageListeners.forEach((listener) => listener(parsedResponse))
})
void WalletPlugin.initialize({
// storagePath: 'data/data/com.iota.wallet/cache/database',
storagePath,
actorId: id,
})
// for testing purposes, send undefined id to catch all errors responses
Expand Down
104 changes: 53 additions & 51 deletions packages/shared/locales/af.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
"checkbox": "Ek het die privaatheidsbeleid en diensvoorwaardes gelees en aanvaar"
},
"crashReporting": {
"title": "Crash Reporting",
"body": "Help the developers improve Firefly by automatically sending diagnostic data when an error or crash occurs.",
"checkbox": "Send crash reports to the IOTA Foundation"
"title": "Fout verslag",
"body": "Help die ontwikkelaars om Firefly te verbeter deur outomaties diagnostiese data te stuur wanneer 'n fout of ongeluk plaasvind.",
"checkbox": "Stuur fout verslag aan die IOTA Foundation"
},
"appearance": {
"title": "Voorkoms",
Expand Down Expand Up @@ -318,7 +318,7 @@
"theme": {
"title": "Tema",
"description": "",
"advice": "If you change your system theme, you may need to restart Firefly to see the effects"
"advice": "As jy jou stelseltema verander, moet jy dalk Firefly herbegin om die effekte te sien"
},
"language": {
"title": "Taal",
Expand Down Expand Up @@ -417,10 +417,10 @@
"description": "Kyk na foute om 'n probleem op te spoor"
},
"crashReporting": {
"title": "Crash reports",
"body": "Help the developers improve Firefly by automatically sending diagnostic data when an error or crash occurs",
"checkbox": "Send crash reports",
"advice": "Please restart the Firefly application to {sendCrashReports, select, true {start sharing crash reports} false {stop sharing crash reports} other {apply this change}}"
"title": "Fout verslag",
"body": "Help die ontwikkelaars om Firefly te verbeter deur outomaties diagnostiese data te stuur wanneer 'n fout of ongeluk plaasvind",
"checkbox": "Stuur fout verslag",
"advice": "Herbegin asseblief die Firefly-toepassing na {sendCrashReports, select, true {start sharing crash reports} false {stop sharing crash reports} other {apply this change}}"
},
"diagnostics": {
"title": "Diagnostiek",
Expand Down Expand Up @@ -462,9 +462,9 @@
},
"dashboard": {
"network": {
"networkOperational": "Network operational",
"networkDegraded": "Network degraded",
"networkDown": "Network disconnected",
"networkOperational": "Netwerk Operasioneel",
"networkDegraded": "Netwerk is nie optimaal nie",
"networkDown": "Netwerk ontkoppel",
"status": "Status",
"messagesPerSecond": "Boodskappe per sekondes",
"referencedRate": "Verwysde tempo"
Expand All @@ -473,32 +473,32 @@
"allSettings": "Alle instellings",
"logout": "Log out",
"stronghold": {
"title": "Profile lock",
"locked": "Stronghold locked",
"unlocked": "Stronghold unlocked"
"title": "Profiel sluit",
"locked": "Stronghold gesluit",
"unlocked": "Stronghold oopgesluit"
},
"hardware": {
"title": "Hardware Device",
"title": "Hardeware-toestel",
"statuses": {
"appNotOpen": "IOTA app not open",
"connected": "Connected",
"legacyConnected": "Legacy app open",
"locked": "Locked",
"mnemonicMismatch": "Wrong Ledger or mnemonic",
"notDetected": "Not detected",
"otherConnected": "App open"
"appNotOpen": "IOTA app nie oop nie",
"connected": "Gekoppel",
"legacyConnected": "Legacy App oop",
"locked": "Gesluit",
"mnemonicMismatch": "Verkeerde Ledger of Mnemonic",
"notDetected": "Nie opgespoor nie",
"otherConnected": "App oop"
}
},
"backup": {
"title": "Backup your wallets",
"title": "Back-up you beursies",
"lastBackup": "Jy het laas 'n backup op {date} gemaak",
"notBackedUp": "Nie gebackup",
"button": "Backup"
},
"version": {
"title": "New update available",
"title": "Nuwe opgradering is beskikbaar",
"updateVersion": "Firefly v{version}",
"button": "Update"
"button": "Opdateer"
}
}
},
Expand All @@ -517,28 +517,28 @@
},
"info": {
"headers": {
"upcoming": "Check back later",
"commencing": "Pre-staking is open",
"holding": "{duration} of staking left",
"ended": "Staking has now ended",
"inactive": "No staking events detected"
"upcoming": "Kom later terug",
"commencing": "Pre-Staking is oop",
"holding": "{duration} of staking oor",
"ended": "Staking het geëindig",
"inactive": "Geen staking gebeurtenisse bespeur nie"
},
"bodies": {
"upcoming": "Stake your {token} tokens to automatically receive rewards every 10 seconds once staking starts on {date}.",
"commencing": "Stake your {token} tokens to automatically receive rewards every 10 seconds once staking starts on {date}.",
"holdingAndStaking": "You automatically receive rewards every 10 seconds.",
"holdingAndNotStaking": "Stake your {token} tokens to receive rewards every 10 seconds.",
"endedAndDidStake": "{token} rewards will be distributed to your wallet once the network launches.",
"upcoming": "Sit jou {token} tokens in om outomaties elke 10 sekondes belonings te ontvang sodra die inzet op {date} begin.",
"commencing": "Sit jou {token} tokens in om outomaties elke 10 sekondes belonings te ontvang sodra die inzet op {date} begin.",
"holdingAndStaking": "Jy ontvang outomaties belonings elke 10 sekondes.",
"holdingAndNotStaking": "Stake jou {token} tokens in om elke 10 sekondes belonings te ontvang.",
"endedAndDidStake": "{token} belonings sal na jou beursie versprei word sodra die netwerk begin.",
"endedAndDidNotStake": "You did not participate in this airdrop.",
"endedAndDidNotReachMinRewards": "You did not stake enough {token} tokens to reach the minimum airdrop rewards.",
"inactive": "Open network configuration in the advanced settings and make sure the current node has the \"Participation\" feature by clicking \"View info\"."
"endedAndDidNotReachMinRewards": "Jy het nie genoeg {token} tokens om die minimum belonings te bereik nie.",
"inactive": "Maak netwerkkonfigurasie in gevorderde instellings oop en maak seker dat die huidige node die \"Participation\"-funksie het deur op \"Bekyk inligting\" te klik."
}
},
"airdrops": {
"holding": "Oorblywende",
"commencing": "Totdat staking begin",
"currentStakingPeriod": "Current staking period",
"totalWalletRewards": "Total wallet rewards",
"currentStakingPeriod": "Huidige stakingstydperk",
"totalWalletRewards": "Totale beursie-belonings",
"assembly": {
"name": "Assembly",
"description": "Assembly is 'n toestemminglose, hoogs skaalbare multi-chain netwerk om saamstelbare smart-contracts te bou en te ontplooi. Assembly is die toekoms van web3. "
Expand All @@ -549,14 +549,14 @@
}
},
"banners": {
"new": "New Event",
"complete": "Complete"
"new": "Nuwe Geleentheid",
"complete": "Voltooid"
}
},
"picker": {
"color": {
"title": "Color picker",
"hexCode": "Color hex code"
"title": "Kleurkieser",
"hexCode": "Kleur hekskode"
}
}
},
Expand All @@ -576,7 +576,7 @@
"updateAvailable": "Firefly update beskikbaar",
"updateDetails": "Weergawe {version} - {date}",
"noAutoUpdate": "Outo-opdatering is in hierdie Windows-weergawe gedeaktiveer. Gaan na https://firefly.iota.org om die opdatering af te laai.",
"preReleaseDescription": "You are running a pre-release version of Firefly. Updates are disabled."
"preReleaseDescription": "Jy gebruik 'n voorvrystelling weergawe van Firefly. Opdaterings is gedeaktiveer."
},
"backup": {
"title": "Laaste backup: {date}",
Expand Down Expand Up @@ -675,9 +675,9 @@
},
"balanceFinder": {
"title": "Balans-finder",
"body": "Perform a more exhaustive search of addresses to find missing balances and previous airdrop rewards. This may take a while.",
"accountsSearched": "Wallets searched",
"addressesSearched": "Addresses searched per wallet",
"body": "Voer 'n meer omvattende soektog na adresse uit om ontbrekende saldo's en vorige airdrop-belonings te vind. Dit kan 'n rukkie neem.",
"accountsSearched": "Beursies gesoek",
"addressesSearched": "Beursies gesoek",
"accountsFound": "Wallets found",
"totalWalletBalance": "Totale balans",
"searchAgainHint": "Is your balance or number of wallets incorrect? Press search again until your full balance is shown.",
Expand Down Expand Up @@ -792,7 +792,7 @@
"crashReporting": {
"title": "Crash reporting",
"body": "Help the developers improve Firefly by automatically sending diagnostic data when an error or crash occurs. If selected, this will take effect after restarting Firefly.",
"checkbox": "Send crash reports to the IOTA Foundation"
"checkbox": "Stuur fout verslag aan die IOTA Foundation"
},
"legalUpdate": {
"tosTitle": "Terms of Service",
Expand Down Expand Up @@ -990,7 +990,7 @@
"profiles": "Profiel",
"dev": "Dev",
"createAccount": "Skep 'n Beursie",
"createNewWallet": "Create a new wallet",
"addAWallet": "Add a wallet",
"accountName": "Beursie naam",
"latestTransactions": "Nuutste transaksie",
"transactions": "Transaksies",
Expand Down Expand Up @@ -1079,7 +1079,8 @@
"stakedFunds": "Staked fondse",
"unstakedFunds": "Unstaked fondse",
"accountColor": "Wallet color",
"myAssets": "My assets"
"myAssets": "My assets",
"total": "Total: {balance}"
},
"dates": {
"today": "Vandag",
Expand Down Expand Up @@ -1252,7 +1253,8 @@
"cannotUseAccount": "Kan nie die gespesifiseerde rekening gebruik nie.",
"cannotFindStakingEvent": "Kan nie staking event vind nie.",
"cannotVisitAirdropWebsite": "Kan nie die {airdrop} webwerf oopmaak nie.",
"invalidStakingEventId": "Ongeldige staking event ID."
"invalidStakingEventId": "Ongeldige staking event ID.",
"failedToFetchPreviousRewards": "Failed to fetch previous rewards, please check your firewall settings."
},
"invalidDate": "INVALID DATE",
"invalidTime": "INVALID TIME"
Expand Down
8 changes: 5 additions & 3 deletions packages/shared/locales/ar.json
Original file line number Diff line number Diff line change
Expand Up @@ -990,7 +990,7 @@
"profiles": "الملفات الشخصية",
"dev": "المطور",
"createAccount": "إنشاء محفظة",
"createNewWallet": "إنشاء محفظة جديدة",
"addAWallet": "Add a wallet",
"accountName": "اسم المحفظة",
"latestTransactions": "آخر المعاملات",
"transactions": "المعاملات",
Expand Down Expand Up @@ -1079,7 +1079,8 @@
"stakedFunds": "الارصدة المخزنة",
"unstakedFunds": "الارصدة غير المخزنة",
"accountColor": "لون المحفظة",
"myAssets": "My assets"
"myAssets": "My assets",
"total": "Total: {balance}"
},
"dates": {
"today": "اليوم",
Expand Down Expand Up @@ -1252,7 +1253,8 @@
"cannotUseAccount": "غير قادر على استخدام الحساب المحدد.",
"cannotFindStakingEvent": "غير قادر على إيجاد فعالية الربح من التخزين.",
"cannotVisitAirdropWebsite": "غير قادر على فتح الموقع الالكتروني لفعالية الربح {airdrop}.",
"invalidStakingEventId": "رقم التصريح لفعالية الربح من التخزين خاطئ."
"invalidStakingEventId": "رقم التصريح لفعالية الربح من التخزين خاطئ.",
"failedToFetchPreviousRewards": "Failed to fetch previous rewards, please check your firewall settings."
},
"invalidDate": "تاريخ غير صالح",
"invalidTime": "وقت غير صالح"
Expand Down
8 changes: 5 additions & 3 deletions packages/shared/locales/bg.json
Original file line number Diff line number Diff line change
Expand Up @@ -990,7 +990,7 @@
"profiles": "Профили",
"dev": "За разработчици",
"createAccount": "Създаване на портфейл",
"createNewWallet": "Create a new wallet",
"addAWallet": "Add a wallet",
"accountName": "Име на портфейла",
"latestTransactions": "Последни трансакции",
"transactions": "Транзакции",
Expand Down Expand Up @@ -1079,7 +1079,8 @@
"stakedFunds": "Стейкнати средства",
"unstakedFunds": "Unstaked funds",
"accountColor": "Wallet color",
"myAssets": "My assets"
"myAssets": "My assets",
"total": "Total: {balance}"
},
"dates": {
"today": "Днес",
Expand Down Expand Up @@ -1252,7 +1253,8 @@
"cannotUseAccount": "Unable to use the specified account.",
"cannotFindStakingEvent": "Unable to find staking event.",
"cannotVisitAirdropWebsite": "Unable to open the {airdrop} website.",
"invalidStakingEventId": "Invalid staking event ID."
"invalidStakingEventId": "Invalid staking event ID.",
"failedToFetchPreviousRewards": "Failed to fetch previous rewards, please check your firewall settings."
},
"invalidDate": "INVALID DATE",
"invalidTime": "INVALID TIME"
Expand Down
Loading

0 comments on commit 35e8b9a

Please sign in to comment.