Skip to content

Commit 01dd326

Browse files
committed
✨app: add wallet provisioning
1 parent 7a2aa7d commit 01dd326

18 files changed

Lines changed: 4912 additions & 4685 deletions

.changeset/chilly-suns-dress.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@exactly/server": patch
3+
---
4+
5+
✨ add wallet provisioning endpoint

.changeset/gentle-cases-fold.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@exactly/mobile": patch
3+
---
4+
5+
✨ add native wallet provisioning feature

.changeset/rich-months-double.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@exactly/mobile": patch
3+
---
4+
5+
🍱 add meawallet config assets

.npmrc

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# isc license
2+
#
3+
# copyright meawallet
4+
#
5+
# permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby
6+
# granted, provided that the above copyright notice and this permission notice appear in all copies.
7+
#
8+
# the software is provided "as is" and the author disclaims all warranties with regard to this software including
9+
# all implied warranties of merchantability and fitness. in no event shall the author be liable for any special,
10+
# direct, indirect, or consequential damages or any damages whatsoever resulting from loss of use, data or profits,
11+
# whether in an action of contract, negligence or other tortious action, arising out of or in connection with the
12+
# use or performance of this software.
13+
@meawallet:registry=https://nexus.ext.meawallet.com/repository/react-native-mpp/
14+
//nexus.ext.meawallet.com/repository/react-native-mpp/:username=ext-react-native-mpp
15+
//nexus.ext.meawallet.com/repository/react-native-mpp/:_password=OXJDTVo1ZEg2dHVD

app.config.ts

Lines changed: 55 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,17 @@ import type { PluginConfigType as BuildPropertiesConfig } from "expo-build-prope
22
import type withCamera from "expo-camera/plugin/build/withCamera";
33
import type { FontProps } from "expo-font/plugin/build/withFonts";
44

5-
import { AndroidConfig, withAndroidManifest, withAppBuildGradle, type ConfigPlugin } from "expo/config-plugins";
5+
import {
6+
AndroidConfig,
7+
withAndroidManifest,
8+
withAppBuildGradle,
9+
withDangerousMod,
10+
withSettingsGradle,
11+
withXcodeProject,
12+
type ConfigPlugin,
13+
} from "expo/config-plugins";
14+
import { copyFileSync, existsSync, mkdirSync } from "node:fs";
15+
import path from "node:path";
616
import { env } from "node:process";
717

818
import metadata from "./package.json";
@@ -45,6 +55,7 @@ export default {
4555
associatedDomains: [`webcredentials:${env.APP_DOMAIN ?? "sandbox.exactly.app"}`],
4656
supportsTablet: false,
4757
buildNumber: String(versionCode),
58+
entitlements: { "com.apple.developer.payment-pass-provisioning": true },
4859
infoPlist: {
4960
ITSAppUsesNonExemptEncryption: false,
5061
NSCameraUsageDescription: "This app uses the camera to verify your identity.",
@@ -116,6 +127,49 @@ export default {
116127
} satisfies OneSignalPlugin.OneSignalPluginProps,
117128
],
118129
// @ts-expect-error inline plugin
130+
((config) => {
131+
const withAndroid = withDangerousMod(config, [
132+
"android",
133+
(c) => {
134+
const source = path.join(c.modRequest.projectRoot, "src/assets/mea_config");
135+
const destination = path.join(c.modRequest.projectRoot, "android/app/src/main/assets/mea_config");
136+
mkdirSync(path.dirname(destination), { recursive: true });
137+
if (existsSync(source)) copyFileSync(source, destination);
138+
return c;
139+
},
140+
]);
141+
return withXcodeProject(withAndroid, (c) => {
142+
const source = path.join(c.modRequest.projectRoot, "src/assets/mea_config");
143+
const destination = path.join(c.modRequest.projectRoot, "ios", c.modRequest.projectName ?? "", "mea_config");
144+
if (existsSync(source)) copyFileSync(source, destination);
145+
// eslint-disable-next-line @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access
146+
c.modResults.addResourceFile(
147+
"mea_config",
148+
{ target: c.modResults.getFirstTarget().uuid }, // eslint-disable-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access
149+
c.modRequest.projectName ?? "",
150+
);
151+
return c;
152+
});
153+
}) satisfies ConfigPlugin,
154+
// @ts-expect-error inline plugin
155+
((config) =>
156+
withSettingsGradle(config, (c) => {
157+
const meaRepo = `maven {
158+
url "https://nexus.ext.meawallet.com/repository/mpp-android-group/"
159+
credentials {
160+
username = "${env.MEAWALLET_ANDROID_USER}"
161+
password = "${env.MEAWALLET_ANDROID_PASS}"
162+
}
163+
}`;
164+
if (!c.modResults.contents.includes("nexus.ext.meawallet.com")) {
165+
c.modResults.contents = c.modResults.contents.replace(
166+
/dependencyResolutionManagement\s*\{[^}]*repositories\s*\{/,
167+
`$&\n ${meaRepo}`,
168+
);
169+
}
170+
return c;
171+
})) satisfies ConfigPlugin,
172+
// @ts-expect-error inline plugin
119173
((config) =>
120174
withAndroidManifest(
121175
withAppBuildGradle(config, (c) => {

common/eslint/base.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export default defineConfig([
1919
ts.strictTypeChecked,
2020
ts.stylisticTypeChecked,
2121
importPlugin.recommended,
22-
importPlugin.typescript,
22+
{ rules: importPlugin.typescript.rules },
2323
unicorn.configs.recommended,
2424
nx.configs["flat/base"],
2525
// @ts-expect-error bad config types

cspell.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@
100100
"lusd",
101101
"mainqueg",
102102
"mateo-soso",
103+
"meawallet",
103104
"mdpi",
104105
"memester",
105106
"miniapp",

package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@
4444
"@intercom/intercom-react-native": "^9.4.0",
4545
"@intercom/messenger-js-sdk": "^0.0.18",
4646
"@lifi/sdk": "3.7.7",
47-
"@peculiar/asn1-ecc": "^2.6.0",
47+
"@meawallet/react-native-mpp": "^2.2.2",
48+
"@peculiar/asn1-ecc": "^2.6.1",
4849
"@peculiar/asn1-schema": "^2.6.0",
4950
"@peculiar/webcrypto": "^1.5.0",
5051
"@pix.js/qrcode": "^1.1.0",
@@ -167,6 +168,9 @@
167168
"overrides": {
168169
"@isaacs/brace-expansion": "^5.0.1",
169170
"@modelcontextprotocol/sdk": "^1.26.0",
171+
"@typescript-eslint/eslint-plugin": "8.58.0",
172+
"@typescript-eslint/parser": "8.58.0",
173+
"eslint-plugin-n": "17.24.0",
170174
"@wagmi/core": "catalog:",
171175
"abitype>zod": "^4.0.0",
172176
"comlink": "$comlink",

0 commit comments

Comments
 (0)