Skip to content

Commit

Permalink
RPC URL claims
Browse files Browse the repository at this point in the history
  • Loading branch information
shazarre committed Nov 22, 2024
1 parent 0ff8a5a commit e97f274
Show file tree
Hide file tree
Showing 27 changed files with 61 additions and 866 deletions.
26 changes: 26 additions & 0 deletions packages/cli/src/commands/account/claim-rpc-url.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import { createRpcUrlClaim } from '@celo/metadata-claims/lib/claim'
import { Flags } from '@oclif/core'
import { ClaimCommand } from '../../utils/identity'
export default class ClaimRpcUrl extends ClaimCommand {
static description = 'Claim a domain and add the claim to a local metadata file'
static flags = {
...ClaimCommand.flags,
rpcUrl: Flags.string({
required: true,
description: 'The RPC URL you want to claim',
}),
}
static args = ClaimCommand.args
static examples = [
'claim-rpc-url ~/metadata.json --rpc-url example.com --from 0x5409ED021D9299bf6814279A6A1411A7e866A631',
]

async run() {
const res = await this.parse(ClaimRpcUrl)
const metadata = await this.readMetadata()

await this.addClaim(metadata, createRpcUrlClaim(res.flags.rpcUrl))

await this.writeMetadata(metadata)
}
}
3 changes: 3 additions & 0 deletions packages/cli/src/utils/identity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,9 @@ export const displayMetadata = async (
case ClaimTypes.DOMAIN:
extra = `Domain: ${claim.domain}`
break
case ClaimTypes.RPC_URL:
extra = `RPC URL: ${claim.rpcUrl}`
break
case ClaimTypes.KEYBASE:
extra = `Username: ${claim.username}`
break
Expand Down
1 change: 1 addition & 0 deletions packages/sdk/metadata-claims/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
lib/
20 changes: 0 additions & 20 deletions packages/sdk/metadata-claims/lib/account.d.ts

This file was deleted.

66 changes: 0 additions & 66 deletions packages/sdk/metadata-claims/lib/account.js

This file was deleted.

1 change: 0 additions & 1 deletion packages/sdk/metadata-claims/lib/account.js.map

This file was deleted.

89 changes: 0 additions & 89 deletions packages/sdk/metadata-claims/lib/claim.d.ts

This file was deleted.

100 changes: 0 additions & 100 deletions packages/sdk/metadata-claims/lib/claim.js

This file was deleted.

1 change: 0 additions & 1 deletion packages/sdk/metadata-claims/lib/claim.js.map

This file was deleted.

2 changes: 0 additions & 2 deletions packages/sdk/metadata-claims/lib/index.d.ts

This file was deleted.

21 changes: 0 additions & 21 deletions packages/sdk/metadata-claims/lib/index.js

This file was deleted.

1 change: 0 additions & 1 deletion packages/sdk/metadata-claims/lib/index.js.map

This file was deleted.

19 changes: 0 additions & 19 deletions packages/sdk/metadata-claims/lib/keybase.d.ts

This file was deleted.

Loading

0 comments on commit e97f274

Please sign in to comment.