Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
cc093e3
feat:developed claim badge home screen
cmcWebCode40 Nov 30, 2022
c57ee49
Merge branch 'new-UI' of https://github.com/verida/vault-mobile into …
cmcWebCode40 Nov 30, 2022
ecdd0d7
feat:translate screen components
cmcWebCode40 Dec 1, 2022
8ba11f7
feat(UI screens):
cmcWebCode40 Dec 4, 2022
7f65e1d
fix:refactored bage list item
cmcWebCode40 Dec 5, 2022
c9273d3
fix:resolve merge conflict in assetscollection screen and wallet sele…
cmcWebCode40 Dec 6, 2022
ad60e0a
feat(claim screen UI):
cmcWebCode40 Dec 7, 2022
4641458
chore:deleted unused assets
cmcWebCode40 Dec 20, 2022
523116f
chore:added new badge icon and gradient bg image
cmcWebCode40 Dec 20, 2022
e17bd8d
feat:updated badge types and data
cmcWebCode40 Dec 20, 2022
0a87c2d
chore: rework the wallet item types
cmcWebCode40 Dec 20, 2022
3a4cf9a
feat:
cmcWebCode40 Dec 20, 2022
b05d3cb
chore:component fixes
cmcWebCode40 Dec 20, 2022
1e0ff0b
fix: resolve wrong module type import
cmcWebCode40 Dec 20, 2022
844f225
Merge branch 'new-UI' into feature/764-claim-badges-flow
cmcWebCode40 Dec 20, 2022
8069e43
fix:updated assets from figma
cmcWebCode40 Dec 28, 2022
8f16e22
fix: Updated badge data and its styles using the theme hooks
cmcWebCode40 Dec 28, 2022
ad2e405
fix: updated component styles using the app themes config
cmcWebCode40 Dec 28, 2022
144eac5
fix: updated folder structer for types and re-imported wallet types
cmcWebCode40 Dec 28, 2022
91108c2
fix:updated theme config
cmcWebCode40 Dec 28, 2022
8a7651d
update constants and types
cmcWebCode40 Dec 28, 2022
879a31f
update constants and types
cmcWebCode40 Dec 28, 2022
d7927e3
fix: added link to redirect to claimable badges
cmcWebCode40 Dec 29, 2022
62fb570
fix: reowork claim badge components header navigation and modal compo…
cmcWebCode40 Jan 3, 2023
2870efb
fix: reowork claim badge components header navigation and modal compo…
cmcWebCode40 Jan 3, 2023
22d19f0
Merge branch 'new-UI' into feature/764-claim-badges-flow
cmcWebCode40 Jan 3, 2023
e9abab2
fix:refactor claim badge screens to handle state locally
cmcWebCode40 Jan 4, 2023
97d3608
updated images
cmcWebCode40 Jan 4, 2023
5a6604f
fix
cmcWebCode40 Jan 4, 2023
9319e91
fix:updated constants and app navigation files
cmcWebCode40 Jan 4, 2023
be6eb86
fix:added types alias
cmcWebCode40 Jan 4, 2023
8567f12
fix:added types alias
cmcWebCode40 Jan 4, 2023
c4c6c6a
remove unused code
aurelticot Jan 5, 2023
59f55b9
refactor claimable badges page
aurelticot Jan 5, 2023
ff3fb5b
refactor ClaimBadgeStatus
aurelticot Jan 5, 2023
f28da78
refactor ClaimBadge
aurelticot Jan 5, 2023
7c19474
rename badge related assets
aurelticot Jan 5, 2023
d5205ca
refactor badge types, data and utils
aurelticot Jan 5, 2023
0416816
fix text and button in Badge list
aurelticot Jan 5, 2023
dceeec4
Merge remote-tracking branch 'origin/new-UI' into feature/764-claim-b…
andy-verida Jan 23, 2023
4b6c792
Merge remote-tracking branch 'origin/new-UI' into feature/764-claim-b…
andy-verida Jan 23, 2023
a1d4955
Merge remote-tracking branch 'origin/new-UI' into feature/764-claim-b…
andy-verida Jan 25, 2023
599c52b
Fix accessing a wrong font name
andy-verida Jan 26, 2023
d5dec64
Update badge interfaces and claim process. Wrap in a badge manager.
Jan 26, 2023
923379a
Merge branch 'feature/764-claim-badges-flow' of https://github.com/ve…
Jan 26, 2023
3e9e47b
Add `claimableNetworks`, `ClaimBadgeQuery` support
Jan 30, 2023
56da696
Update `AvailableBadge` interface to support `claimableAddresses` ins…
Feb 2, 2023
cdd2b64
Merge remote-tracking branch 'origin/new-UI' into feature/764-claim-b…
andy-verida Feb 16, 2023
3bd6111
Merge remote-tracking branch 'origin/develop' into feature/764-claim-…
andy-verida Mar 16, 2023
46d1a82
Enable the new home page again on this branch
andy-verida Mar 16, 2023
48602bd
Add `@verida/vda-sbt-client` dependency
Apr 14, 2023
cbe021a
Start of SBTManager
Apr 14, 2023
aeb9b21
Remove unused vault manager files
Apr 15, 2023
ded2a10
Pull connectors from the server. Trigger SBT credential saving if inc…
Apr 16, 2023
2b4eb7b
Basic SBT Manager working. Issues with SBT client library in the prot…
Apr 16, 2023
01aaef7
Add basic mint / burn buttons on credentials for testing.
Apr 16, 2023
b3f9538
Fix connection display with updated provider details
Apr 16, 2023
80ecea1
Inject connection info when loading from data connection deep link
Apr 16, 2023
6374754
Add `isMinted` with debug output
Apr 16, 2023
b773068
Load collectibles for polygon, not ethereum
Apr 16, 2023
30b77e2
Force `.json` extension on minted SBTs. Update `isMinted()` to refere…
Apr 17, 2023
f93b6c5
Merge remote-tracking branch 'origin/develop' into feature/764-claim-…
andy-verida May 19, 2023
95c36a6
Merge remote-tracking branch 'origin/feautre/868-mint-sbts' into feat…
andy-verida May 23, 2023
ea75155
Merge remote-tracking branch 'origin/develop' into feature/764-claim-…
andy-verida May 25, 2023
a16bfa6
Merge remote-tracking branch 'origin/develop' into feature/764-claim-…
andy-verida May 26, 2023
78c2230
Merge remote-tracking branch 'origin/develop' into feature/764-claim-…
andy-verida May 29, 2023
c6afaef
(WIP) Basic minting Discord badge
andy-verida Jun 1, 2023
62eb09b
Add connections to claim badges page
andy-verida Jun 1, 2023
3f91f74
Bug fixes
andy-verida Jun 2, 2023
75b1957
Refactor the badges feature and clean up unused source code
andy-verida Jun 6, 2023
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
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
"@verida/vda-did-resolver": "^2.3.5",
"@verida/vda-name-client": "^2.3.4",
"@verida/verifiable-credentials": "^2.3.4",
"@verida/vda-sbt-client": "^2.2.1",
"@verida/wallet-utils": "^1.7.4",
"@walletconnect/client": "^1.7.7",
"@walletconnect/sign-client": "2.0.0-rc.3",
Expand Down
70 changes: 0 additions & 70 deletions src/api/AssetManager.ts

This file was deleted.

86 changes: 59 additions & 27 deletions src/api/DataConnectorsManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { Linking } from 'react-native'

import CONFIG from '../config/environment'
import AccountManager from './AccountManager'
import { SBTManager } from './SBTManager'

const DATA_CONNECTION_SCHEMA =
'https://vault.schemas.verida.io/data-connections/connection/v0.1.0/schema.json'
Expand All @@ -20,24 +21,9 @@ const delay = async (ms: number) => {
await new Promise((resolve: any) => setTimeout(() => resolve(), ms))
}

// possible states for status: syncing, disabled, active
let CONNECTION_CACHE: any

// @todo: Pull this from the server
const FacebookIcon = require('assets/social_icons/facebook.png')
const TwitterIcon = require('assets/social_icons/twitter.png')

const CONNECTIONS: any = {
facebook: {
name: 'facebook',
label: 'Facebook',
icon: FacebookIcon,
},
twitter: {
name: 'twitter',
label: 'Twitter',
icon: TwitterIcon,
},
}
// possible states for status: syncing, disabled, active

class DataConnectorsEvents extends EventEmitter {
private static instance: DataConnectorsEvents
Expand Down Expand Up @@ -89,7 +75,19 @@ export default class DataConnectorsManager {
return DataConnectorsManager.datastore
}

static getConnectionInfo(connectorName: string) {
static async getConnections(): Promise<Record<string, any>> {
if (CONNECTION_CACHE) {
return CONNECTION_CACHE
}

// @todo cache
const response = await axios.get(`${CONFIG.DATA_CONNECTOR_URL}/providers`)
CONNECTION_CACHE = response.data
return CONNECTION_CACHE
}

static async getConnectionInfo(connectorName: string) {
const CONNECTIONS = await DataConnectorsManager.getConnections()
return CONNECTIONS[connectorName]
}

Expand All @@ -98,15 +96,25 @@ export default class DataConnectorsManager {
return DataConnectorsManager._connections[connectorName]
}

const connector = new DataConnection(connectorName)
const connectionInfo = await DataConnectorsManager.getConnectionInfo(
connectorName
)

const connector = new DataConnection(
connectorName,
connectionInfo.icon,
connectionInfo.label
)
await connector.init()

DataConnectorsManager._connections[connectorName] = connector
return connector
}

static async getConnectors(): Promise<any> {
const connections: any = Object.values(CONNECTIONS)
const connections: any = Object.values(
await DataConnectorsManager.getConnections()
)
const connectors: any = {}
for (let i = 0; i < connections.length; i++) {
const connection = await DataConnectorsManager.getConnection(
Expand All @@ -119,7 +127,9 @@ export default class DataConnectorsManager {
}

static async resetConnector() {
const connections: any = Object.values(CONNECTIONS)
const connections: any = Object.values(
await DataConnectorsManager.getConnections()
)
for (let i = 0; i < connections.length; i++) {
if (
DataConnectorsManager._connections[connections[i].name].syncStatus !==
Expand Down Expand Up @@ -178,12 +188,12 @@ class DataConnection extends EventEmitter {
public metadata?: any
public icon?: any

constructor(name: string) {
constructor(name: string, icon: string, label: string) {
super()
this.name = this.source = name
this.syncStatus = 'disabled'
this.icon = CONNECTIONS[this.name].icon
this.label = CONNECTIONS[this.name].label
this.icon = icon
this.label = label
this.syncFrequency = 'hour'
}

Expand Down Expand Up @@ -376,9 +386,31 @@ class DataConnection extends EventEmitter {
const syncRequest = await externalDatastore.get(syncRequestId)

if (syncRequest.status === 'complete') {
// Sync has completed on the server, so complete the sync
// by replicating data from the server
this.syncReplication(serverDid, contextName, syncRequest)
// Sync has completed on the server

// Save a SBT credential if it was provided
if (syncRequest.syncInfo.profile.credential) {
const sbtManager = new SBTManager()
const profileCredentialId = `${syncRequest.source}-${syncRequest.syncInfo.profile.id}-profile`
console.log(
'===> SBT credential',
JSON.stringify(
{
profileCredentialId,
cred: syncRequest.syncInfo.profile.credential,
},
null,
2
)
)
await sbtManager.saveCredential(
profileCredentialId,
syncRequest.syncInfo.profile.credential
)
}

// Complete the sync by replicating data from the server
await this.syncReplication(serverDid, contextName, syncRequest)
} else {
if (retryCount === 0) {
// Retry count limit hit
Expand Down
Loading