Skip to content

Commit

Permalink
Merge pull request #5 from greymass/adding-support-for-other-creation…
Browse files Browse the repository at this point in the history
…-services

Adding support for other account creation services
  • Loading branch information
aaroncox authored Jul 19, 2024
2 parents 4a52356 + 006f013 commit c0d2272
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/account-creator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export class AccountCreator {
private scope?: Name
private supportedChains: ChainId[]
private creationServiceUrl: string
private fullCreationServiceUrl?: string
private returnUrl: string
private popupStatusInterval?: ReturnType<typeof setInterval>

Expand All @@ -18,6 +19,7 @@ export class AccountCreator {
this.scope = Name.from(options.scope)
}
this.creationServiceUrl = options.creationServiceUrl || 'https://create.anchor.link'
this.fullCreationServiceUrl = options.fullCreationServiceUrl
this.returnUrl = options.returnUrl || detectReturnPath()
}

Expand All @@ -30,7 +32,9 @@ export class AccountCreator {
if (this.scope) {
qs.set('scope', String(this.scope))
}
const url = `${this.creationServiceUrl}/create?${qs}`
const url = this.fullCreationServiceUrl
? this.fullCreationServiceUrl
: `${this.creationServiceUrl}/create?${qs}`
this.popupWindow = window.open(
url,
'targetWindow',
Expand Down
1 change: 1 addition & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ export interface AccountCreationOptions {
scope: NameType
supportedChains?: ChainIdType[]
creationServiceUrl?: string
fullCreationServiceUrl?: string
returnUrl?: string
}

Expand Down

0 comments on commit c0d2272

Please sign in to comment.