Skip to content
Draft
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
8 changes: 5 additions & 3 deletions packages/universal-connector/src/UniversalConnector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export type Config = {
'networks' | 'projectId' | 'metadata' | 'universalProvider' | 'manualWCControl'
>
providerConfig?: Omit<UniversalProviderOpts, 'projectId' | 'metadata'>
expiry?: number
}

export class UniversalConnector {
Expand All @@ -49,7 +50,8 @@ export class UniversalConnector {
const provider = await UniversalProvider.init({
...(config.providerConfig || {}),
projectId: config.projectId,
metadata: config.metadata
metadata: config.metadata,
...(config.expiry ? { expiry: config.expiry } : {})
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
...(config.expiry ? { expiry: config.expiry } : {})
expiry: config.expiry

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not do it like this? or set a default?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought you wanted to set the default at a lower level and make it optional here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also to have backwards compatibility ... but we can add a default if you think it's ok.

})

const appKitConfig: CreateAppKit = {
Expand Down Expand Up @@ -111,8 +113,8 @@ export class UniversalConnector {
await this.provider.disconnect()
}

async request(params: RequestArguments, chain: string) {
return await this.provider.request(params, chain)
async request(params: RequestArguments, chain: string, expiry?: number) {
return await this.provider.request(params, chain, expiry)
}
}

Expand Down
Loading