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

Zal 175 long balance check #153

Merged
merged 6 commits into from
Sep 19, 2023
Merged
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 .github/workflows/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
uses: superfly/flyctl-actions/setup-flyctl@master

- name: 🚀 Deploy
run: flyctl deploy . --config api/fly.toml --remote-only
run: flyctl deploy . --config api/fly.toml --remote-only --wait-timeout 120
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}

Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed .yarn/cache/gaze-npm-1.1.3-cd09a2e834-d5fd375a02.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed .yarn/cache/glob-npm-8.0.1-3485e1ee02-7ac782f3ef.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed .yarn/cache/tty-npm-1.0.1-33e017afd4-6fa781841f.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
3 changes: 1 addition & 2 deletions api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
"siwe": "^1.1.6",
"ts-deepmerge": "^6.2.0",
"ts-pattern": "^5.0.5",
"viem": "^1.10.14",
"viem": "^1.6.0",
"zksync-web3": "^0.14.3"
},
"devDependencies": {
Expand All @@ -94,7 +94,6 @@
"@types/uuid": "^9.0.2",
"@typescript-eslint/eslint-plugin": "^6.7.2",
"@typescript-eslint/parser": "^6.7.2",
"apollo": "^2.34.0",
"eslint": "^8.49.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-prettier": "^5.0.0",
Expand Down
18 changes: 4 additions & 14 deletions app/codegen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,7 @@ export default {
'src/gql/api/documents.generated.ts': {
schema,
documents,
plugins: [
'@n1ru4l/graphql-codegen-relay-optimizer-plugin',
'typescript',
'typescript-operations',
'typed-document-node',
],
plugins: ['typescript', 'typescript-operations', 'typed-document-node'],
config: {
// https://the-guild.dev/graphql/codegen/plugins/typescript/typescript
// defaultScalarType: 'unknown',
Expand All @@ -36,25 +31,20 @@ export default {
withHOC: false,
withComponent: false,
// https://the-guild.dev/graphql/codegen/plugins/typescript/relay-operation-optimizer
skipDocumentsValidation: true,
flattenGeneratedTypes: true,
},
},
'src/gql/api/generated/': {
schema,
documents,
preset: 'client', // Enables useFragments - https://the-guild.dev/graphql/codegen/plugins/presets/preset-client
presetConfig: {
gqlTagName: 'gql',
},
presetConfig: { gqlTagName: 'gql' },
config: {
// https://the-guild.dev/graphql/codegen/plugins/typescript/typescript
// Allowed options: https://github.com/dotansimha/graphql-code-generator/issues/8562
// defaultScalarType: 'unknown',
enumsAsTypes: true,
scalars,
// https://the-guild.dev/graphql/codegen/plugins/typescript/relay-operation-optimizer
skipDocumentsValidation: true,
flattenGeneratedTypes: true,
dedupeFragments: true,
},
},
'src/gql/api/schema.ts': {
Expand Down
7 changes: 3 additions & 4 deletions app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@
"@formatjs/intl-numberformat": "^8.7.2",
"@formatjs/intl-pluralrules": "^5.2.6",
"@gorhom/bottom-sheet": "^4.5.1",
"@graphql-codegen/client-preset": "^4.1.0",
"@graphql-typed-document-node/core": "^3.2.0",
"@ledgerhq/hw-app-eth": "^6.34.0",
"@ledgerhq/react-native-hw-transport-ble": "patch:@ledgerhq/react-native-hw-transport-ble@npm:6.29.3#../.yarn/patches/@ledgerhq-react-native-hw-transport-ble-npm-6.29.3-2fa5aa09cc.patch",
"@react-native-async-storage/async-storage": "1.18.2",
Expand Down Expand Up @@ -146,19 +144,20 @@
"urql": "^4.0.5",
"use-async-effect": "^2.2.7",
"use-immer": "^0.9.0",
"viem": "^1.10.14",
"viem": "^1.6.0",
"wonka": "^6.3.4",
"yup": "^1.2.0",
"zksync-web3": "^0.14.3"
},
"devDependencies": {
"@babel/core": "^7.22.5",
"@graphql-codegen/cli": "^5.0.0",
"@graphql-codegen/client-preset": "^4.1.0",
"@graphql-codegen/typed-document-node": "^5.0.1",
"@graphql-codegen/typescript": "^4.0.1",
"@graphql-codegen/typescript-operations": "^4.0.1",
"@graphql-codegen/urql-introspection": "^2.2.1",
"@n1ru4l/graphql-codegen-relay-optimizer-plugin": "^5.0.0",
"@graphql-typed-document-node/core": "^3.2.0",
"@testing-library/jest-native": "^5.4.2",
"@testing-library/react-native": "^11.5.4",
"@total-typescript/ts-reset": "^0.5.1",
Expand Down
5 changes: 4 additions & 1 deletion app/src/components/buttons/LinkAppleButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,10 @@ export function LinkAppleButton({ onLink }: LinkAppleButtonProps) {
style={styles.container}
onPress={async () => {
const r = await getApprover({});
if (r.isErr()) return showError('Failed to link Apple account');
if (r.isErr())
return showError('Something went wrong, failed to link Apple account', {
event: { error: r.error },
});

const {
approver,
Expand Down
6 changes: 5 additions & 1 deletion app/src/components/buttons/LinkGoogleButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { ImageRequireSource, StyleSheet } from 'react-native';
import { Fab } from './Fab';
import { Image } from 'expo-image';
import { useGetGoogleApprover } from '~/util/useGetGoogleApprover';
import { showError } from '~/provider/SnackbarProvider';

const Query = gql(/* GraphQL */ `
query SignInWithGoogleButton {
Expand Down Expand Up @@ -65,7 +66,10 @@ export function LinkGoogleButton({ onLink, signOut }: LinkGoogleButtonProps) {
style={styles.container}
onPress={async () => {
const r = await getApprover({ signOut });
if (r.isErr()) return;
if (r.isErr())
return showError('Something went wrong, failed to link Google account', {
event: { error: r.error },
});

const {
user: { name, photo },
Expand Down
17 changes: 9 additions & 8 deletions app/src/util/useGetGoogleApprover.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,14 +107,15 @@ export function useGetGoogleApprover() {

return async ({ subject, signOut }: GetGoogleApproverParams) =>
new ResultAsync(signIn({ subject, signOut })).andThen((details) =>
ResultAsync.fromSafePromise(GoogleSignin.getTokens()).andThen(({ idToken, accessToken }) =>
new ResultAsync(
getCloudApprover({ idToken, accessToken, create: { name: 'Google account' } }),
).map((approver) => ({
idToken,
user: details.user,
approver,
})),
ResultAsync.fromPromise(GoogleSignin.getTokens(), (e) => (e as Error).message).andThen(
({ idToken, accessToken }) =>
new ResultAsync(
getCloudApprover({ idToken, accessToken, create: { name: 'Google account' } }),
).map((approver) => ({
idToken,
user: details.user,
approver,
})),
),
);
}
2 changes: 1 addition & 1 deletion contracts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,6 @@
"zksync-web3": "^0.14.3"
},
"dependencies": {
"viem": "^1.10.14"
"viem": "^1.6.0"
}
}
2 changes: 1 addition & 1 deletion lib/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"ts-pattern": "^5.0.5",
"ts-toolbelt": "^9.6.0",
"typechain": "^8.3.1",
"viem": "^1.10.14",
"viem": "^1.6.0",
"yarn": "^1.22.19",
"zksync-web3": "^0.14.3"
},
Expand Down
Loading
Loading