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

Use hosted node by default to interact with Ceramic #12

Merged
merged 1 commit into from
Apr 17, 2024
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
6 changes: 4 additions & 2 deletions libraries/points/src/ceramic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@ import type { DID } from 'dids'

import { getAuthenticatedDID } from './did.js'

export function getCeramic(ceramic?: CeramicAPI | string): CeramicAPI {
return ceramic == null || typeof ceramic === 'string' ? new CeramicClient(ceramic) : ceramic
const DEFAULT_CERAMIC_URL = 'https://experiments.ceramic.dev'

export function getCeramic(ceramic: CeramicAPI | string = DEFAULT_CERAMIC_URL): CeramicAPI {
return typeof ceramic === 'string' ? new CeramicClient(ceramic) : ceramic
}

export async function getAuthenticatedCeramic(
Expand Down
7 changes: 2 additions & 5 deletions libraries/points/test/lib.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,10 @@ import { DocumentLoader } from '@composedb/loader'
import { type CeramicContext, getEphemeralCeramic } from '@ceramic-solutions/ceramic-utils'
import { generatePrivateKey, getAuthenticatedDID } from '@ceramic-solutions/did-utils'
import { deployComposite } from '@ceramic-solutions/composite-utils'
import {
SimplePointsAggregationID,
SimplePointsAllocationID,
} from '@ceramic-solutions/points-composite'
import { SimplePointsAllocationID } from '@ceramic-solutions/points-composite'
import { jest } from '@jest/globals'

import { GenericReader, ListWriter, PointsReader, PointsWriter, SetReader, SetWriter } from '../src'
import { GenericReader, ListWriter, PointsWriter, SetReader, SetWriter } from '../src'

const require = createRequire(import.meta.url)
const compositePath = require.resolve('@ceramic-solutions/points-composite/composite.json')
Expand Down
Loading