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

fix: update @web3-storage/access dep to fix email + issue #503

Merged
merged 3 commits into from
Apr 10, 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 packages/keyring-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"dependencies": {
"@ucanto/interface": "^6.2.0",
"@ucanto/principal": "^5.1.0",
"@web3-storage/access": "^11.2.0"
"@web3-storage/access": "^12.0.0"
},
"eslintConfig": {
"extends": [
Expand Down
7 changes: 5 additions & 2 deletions packages/keyring-core/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { Agent } from '@web3-storage/access/agent'
import { StoreIndexedDB } from '@web3-storage/access/stores/store-indexeddb'
import type { Abilities, AgentMeta, Service } from '@web3-storage/access/types'
import type {
Capability,
Expand All @@ -11,8 +9,13 @@ import type {
Delegation,
UCANOptions
} from '@ucanto/interface'
import { Agent, authorizeWaitAndClaim } from '@web3-storage/access/agent'
import { StoreIndexedDB } from '@web3-storage/access/stores/store-indexeddb'
import * as RSASigner from '@ucanto/principal/rsa'

export { Agent, Abilities, AgentMeta, Service }
export const authorize = authorizeWaitAndClaim

const DB_NAME = 'w3ui'
const DB_STORE_NAME = 'keyring'

Expand Down
3 changes: 1 addition & 2 deletions packages/react-keyring/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@
"@testing-library/react": "^13.4.0",
"@testing-library/user-event": "^14.4.3",
"@ucanto/interface": "^6.2.0",
"@ucanto/principal": "^5.1.0",
"@web3-storage/access": "^11.2.0"
"@ucanto/principal": "^5.1.0"
},
"peerDependencies": {
"react": "^16.8.0 || ^17.0.0 || ^18.0.0"
Expand Down
27 changes: 14 additions & 13 deletions packages/react-keyring/src/providers/Keyring.tsx
Original file line number Diff line number Diff line change
@@ -1,21 +1,11 @@
import React, { createContext, useState, useContext } from 'react'
import useLocalStorageState from 'use-local-storage-state'
import {
createAgent,
Space,
getCurrentSpace as getCurrentSpaceInAgent,
getSpaces,
CreateDelegationOptions
} from '@w3ui/keyring-core'
import type {
Agent,
Abilities,
KeyringContextState,
KeyringContextActions,
ServiceConfig,
RegisterSpaceOpts
} from '@w3ui/keyring-core'
import type { Agent } from '@web3-storage/access'
import type { Abilities } from '@web3-storage/access/types'
import { authorizeWaitAndClaim } from '@web3-storage/access/agent'
import type {
Capability,
Delegation,
Expand All @@ -25,6 +15,17 @@ import type {
Signer
} from '@ucanto/interface'

import React, { createContext, useState, useContext } from 'react'
import useLocalStorageState from 'use-local-storage-state'
import {
authorize as accessAuthorize,
createAgent,
Space,
getCurrentSpace as getCurrentSpaceInAgent,
getSpaces,
CreateDelegationOptions
} from '@w3ui/keyring-core'

export { KeyringContextState, KeyringContextActions }

export type KeyringContextValue = [
Expand Down Expand Up @@ -100,7 +101,7 @@ export function KeyringProvider ({
setRegisterAbortController(controller)

try {
await authorizeWaitAndClaim(agent, email, { signal: controller.signal })
await accessAuthorize(agent, email, { signal: controller.signal })
// TODO is there other state that needs to be initialized?
setAccount(email)
const newSpaces = getSpaces(agent)
Expand Down
3 changes: 1 addition & 2 deletions packages/solid-keyring/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@
"dependencies": {
"@ucanto/interface": "^6.2.0",
"@ucanto/principal": "^5.1.0",
"@w3ui/keyring-core": "workspace:^",
"@web3-storage/access": "^11.2.0"
"@w3ui/keyring-core": "workspace:^"
},
"peerDependencies": {
"solid-js": "^1.5.0"
Expand Down
12 changes: 6 additions & 6 deletions packages/solid-keyring/src/providers/Keyring.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@ import type {
KeyringContextState,
KeyringContextActions,
ServiceConfig,
CreateDelegationOptions
CreateDelegationOptions,
Agent,
Abilities
} from '@w3ui/keyring-core'
import type { Agent } from '@web3-storage/access'
import type { Abilities } from '@web3-storage/access/types'
import { authorizeWaitAndClaim } from '@web3-storage/access/agent'

import { authorize as accessAuthorize, createAgent, getCurrentSpace as getCurrentSpaceInAgent, getSpaces } from '@w3ui/keyring-core'

import type { Delegation, Capability, DID, Principal } from '@ucanto/interface'

Expand All @@ -18,7 +19,6 @@ import {
createComponent
} from 'solid-js'
import { createStore } from 'solid-js/store'
import { createAgent, getCurrentSpace as getCurrentSpaceInAgent, getSpaces } from '@w3ui/keyring-core'

export { KeyringContextState, KeyringContextActions }

Expand Down Expand Up @@ -95,7 +95,7 @@ export const KeyringProvider: ParentComponent<KeyringProviderProps> = (
setRegisterAbortController(controller)

try {
await authorizeWaitAndClaim(agent, email, { signal: controller.signal })
await accessAuthorize(agent, email, { signal: controller.signal })
// TODO is there other state that needs to be initialized?
setState('account', email)
const newSpaces = getSpaces(agent)
Expand Down
3 changes: 1 addition & 2 deletions packages/vue-keyring/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@
},
"devDependencies": {
"@ucanto/interface": "^6.2.0",
"@ucanto/principal": "^5.1.0",
"@web3-storage/access": "^11.2.0"
"@ucanto/principal": "^5.1.0"
},
"eslintConfig": {
"extends": [
Expand Down
23 changes: 13 additions & 10 deletions packages/vue-keyring/src/providers/Keyring.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
import type {
Agent,
KeyringContextState,
KeyringContextActions,
ServiceConfig
} from '@w3ui/keyring-core'
import type { Capability, DID, Proof } from '@ucanto/interface'
import {
defineComponent,
provide,
Expand All @@ -6,16 +13,12 @@ import {
Ref,
shallowReactive
} from 'vue'
import { createAgent, getCurrentSpace as getCurrentSpaceInAgent, getSpaces } from '@w3ui/keyring-core'
import type {
KeyringContextState,
KeyringContextActions,
ServiceConfig
import {
authorize as accessAuthorize,
createAgent,
getCurrentSpace as getCurrentSpaceInAgent,
getSpaces
} from '@w3ui/keyring-core'
import { authorizeWithSocket } from '@web3-storage/access/agent'

import type { Agent } from '@web3-storage/access'
import type { Capability, DID, Proof } from '@ucanto/interface'

export { KeyringContextState, KeyringContextActions }

Expand Down Expand Up @@ -104,7 +107,7 @@ export const KeyringProvider = defineComponent<KeyringProviderProps>({
registerAbortController = controller

try {
await authorizeWithSocket(agent, email, { signal: controller.signal })
await accessAuthorize(agent, email, { signal: controller.signal })
// TODO is there other state that needs to be initialized?
state.account = email
const newSpaces = getSpaces(agent)
Expand Down
Loading