Skip to content

Commit

Permalink
RPC URL claims (#459)
Browse files Browse the repository at this point in the history
  • Loading branch information
shazarre authored Nov 28, 2024
1 parent 43e8474 commit 0e559c7
Show file tree
Hide file tree
Showing 41 changed files with 510 additions and 906 deletions.
5 changes: 5 additions & 0 deletions .changeset/funny-sheep-repeat.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@celo/metadata-claims': minor
---

Add support for RPC_URL claim type
5 changes: 5 additions & 0 deletions .changeset/three-spies-wonder.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@celo/celocli': minor
---

Introduces a new command `account:claim-rpc-url` allowing to claim RPC URLs
62 changes: 62 additions & 0 deletions docs/command-line-interface/account.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Manage your account, keys, and metadata
* [`celocli account:claim-domain ARG1`](#celocli-accountclaim-domain-arg1)
* [`celocli account:claim-keybase ARG1`](#celocli-accountclaim-keybase-arg1)
* [`celocli account:claim-name ARG1`](#celocli-accountclaim-name-arg1)
* [`celocli account:claim-rpc-url ARG1`](#celocli-accountclaim-rpc-url-arg1)
* [`celocli account:claim-storage ARG1`](#celocli-accountclaim-storage-arg1)
* [`celocli account:create-metadata ARG1`](#celocli-accountcreate-metadata-arg1)
* [`celocli account:deauthorize`](#celocli-accountdeauthorize)
Expand Down Expand Up @@ -415,6 +416,67 @@ FLAG DESCRIPTIONS

_See code: [src/commands/account/claim-name.ts](https://github.com/celo-org/developer-tooling/tree/master/packages/cli/src/commands/account/claim-name.ts)_

## `celocli account:claim-rpc-url ARG1`

Claim a RPC URL and add the claim to a local metadata file

```
USAGE
$ celocli account:claim-rpc-url ARG1 --from 0xc1912fEE45d61C87Cc5EA59DaE31190FFFFf232d
--rpcUrl https://www.celo.org [-k <value> | --useLedger | ] [-n <value>]
[--gasCurrency 0x1234567890123456789012345678901234567890] [--ledgerAddresses
<value> ] [--globalHelp]
ARGUMENTS
ARG1 Path of the metadata file
FLAGS
-k, --privateKey=<value>
Use a private key to sign local transactions with
-n, --node=<value>
URL of the node to run commands against or an alias
--from=0xc1912fEE45d61C87Cc5EA59DaE31190FFFFf232d
(required) Address of the account to set metadata for. Claiming address must be
registered as validator
--gasCurrency=0x1234567890123456789012345678901234567890
Use a specific gas currency for transaction fees (defaults to CELO if no gas
currency is supplied). It must be a whitelisted token.
--globalHelp
View all available global flags
--ledgerAddresses=<value>
[default: 1] If --useLedger is set, this will get the first N addresses for local
signing
--rpcUrl=https://www.celo.org
(required) The RPC URL to claim
--useLedger
Set it to use a ledger wallet
DESCRIPTION
Claim a RPC URL and add the claim to a local metadata file
EXAMPLES
claim-rpc-url ~/metadata.json --rpc-url example.com --from 0x5409ED021D9299bf6814279A6A1411A7e866A631
FLAG DESCRIPTIONS
-n, --node=<value> URL of the node to run commands against or an alias
Can be a full url like https://forno.celo.org or an alias. default:
http://localhost:8545
Alias options:
local, localhost => 'http://localhost:8545'
alfajores => Celo Alfajores Testnet,
mainnet, celo, forno => Celo Mainnet chain',
```

_See code: [src/commands/account/claim-rpc-url.ts](https://github.com/celo-org/developer-tooling/tree/master/packages/cli/src/commands/account/claim-rpc-url.ts)_

## `celocli account:claim-storage ARG1`

Claim a storage root and add the claim to a local metadata file
Expand Down
6 changes: 3 additions & 3 deletions docs/command-line-interface/governance.md
Original file line number Diff line number Diff line change
Expand Up @@ -535,8 +535,8 @@ Submit a governance proposal
```
USAGE
$ celocli governance:propose --jsonTransactions <value> --deposit <value> --from
0xc1912fEE45d61C87Cc5EA59DaE31190FFFFf232d --descriptionURL <value> [-k <value> |
--useLedger | ] [-n <value>] [--gasCurrency
0xc1912fEE45d61C87Cc5EA59DaE31190FFFFf232d --descriptionURL https://www.celo.org [-k
<value> | --useLedger | ] [-n <value>] [--gasCurrency
0x1234567890123456789012345678901234567890] [--ledgerAddresses <value> ]
[--globalHelp] [--for 0xc1912fEE45d61C87Cc5EA59DaE31190FFFFf232d --useMultiSig]
[--force] [--noInfo] [--afterExecutingProposal <value> | --afterExecutingID <value>]
Expand All @@ -557,7 +557,7 @@ FLAGS
--deposit=<value>
(required) Amount of Celo to attach to proposal
--descriptionURL=<value>
--descriptionURL=https://www.celo.org
(required) A URL where further information about the proposal can be viewed
--for=0xc1912fEE45d61C87Cc5EA59DaE31190FFFFf232d
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
| Name | Type | Default value |
| :------ | :------ | :------ |
| `data` | `Object` | `undefined` |
| `data.claims` | (\{ `address`: `string` = AddressType; `publicKey`: `undefined` \| `string` ; `timestamp`: `number` = TimestampType; `type`: [`ACCOUNT`](../enums/types.ClaimTypes.md#account) } \| \{ `timestamp`: `number` = TimestampType; `type`: [`KEYBASE`](../enums/types.ClaimTypes.md#keybase) ; `username`: `string` = t.string } \| \{ `domain`: `string` = t.string; `timestamp`: `number` = TimestampType; `type`: [`DOMAIN`](../enums/types.ClaimTypes.md#domain) } \| \{ `name`: `string` = t.string; `timestamp`: `number` = TimestampType; `type`: [`NAME`](../enums/types.ClaimTypes.md#name) } \| \{ `address`: `string` = t.string; `filteredDataPaths`: `string` = t.string; `timestamp`: `number` = TimestampType; `type`: [`STORAGE`](../enums/types.ClaimTypes.md#storage) })[] | `undefined` |
| `data.claims` | (\{ `address`: `string` = AddressType; `publicKey`: `undefined` \| `string` ; `timestamp`: `number` = TimestampType; `type`: [`ACCOUNT`](../enums/types.ClaimTypes.md#account) } \| \{ `timestamp`: `number` = TimestampType; `type`: [`KEYBASE`](../enums/types.ClaimTypes.md#keybase) ; `username`: `string` = t.string } \| \{ `domain`: `string` = t.string; `timestamp`: `number` = TimestampType; `type`: [`DOMAIN`](../enums/types.ClaimTypes.md#domain) } \| \{ `rpcUrl`: `string` = t.string; `timestamp`: `number` = TimestampType; `type`: [`RPC_URL`](../enums/types.ClaimTypes.md#rpc_url) } \| \{ `name`: `string` = t.string; `timestamp`: `number` = TimestampType; `type`: [`NAME`](../enums/types.ClaimTypes.md#name) } \| \{ `address`: `string` = t.string; `filteredDataPaths`: `string` = t.string; `timestamp`: `number` = TimestampType; `type`: [`STORAGE`](../enums/types.ClaimTypes.md#storage) })[] | `undefined` |
| `data.meta` | `Object` | `MetaType` |
| `data.meta.address` | `string` | `AddressType` |
| `data.meta.signature` | `string` | `SignatureType` |
Expand All @@ -66,7 +66,7 @@

| Name | Type |
| :------ | :------ |
| `claims` | (\{ `address`: `string` = AddressType; `publicKey`: `undefined` \| `string` ; `timestamp`: `number` = TimestampType; `type`: [`ACCOUNT`](../enums/types.ClaimTypes.md#account) } \| \{ `timestamp`: `number` = TimestampType; `type`: [`KEYBASE`](../enums/types.ClaimTypes.md#keybase) ; `username`: `string` = t.string } \| \{ `domain`: `string` = t.string; `timestamp`: `number` = TimestampType; `type`: [`DOMAIN`](../enums/types.ClaimTypes.md#domain) } \| \{ `name`: `string` = t.string; `timestamp`: `number` = TimestampType; `type`: [`NAME`](../enums/types.ClaimTypes.md#name) } \| \{ `address`: `string` = t.string; `filteredDataPaths`: `string` = t.string; `timestamp`: `number` = TimestampType; `type`: [`STORAGE`](../enums/types.ClaimTypes.md#storage) })[] |
| `claims` | (\{ `address`: `string` = AddressType; `publicKey`: `undefined` \| `string` ; `timestamp`: `number` = TimestampType; `type`: [`ACCOUNT`](../enums/types.ClaimTypes.md#account) } \| \{ `timestamp`: `number` = TimestampType; `type`: [`KEYBASE`](../enums/types.ClaimTypes.md#keybase) ; `username`: `string` = t.string } \| \{ `domain`: `string` = t.string; `timestamp`: `number` = TimestampType; `type`: [`DOMAIN`](../enums/types.ClaimTypes.md#domain) } \| \{ `rpcUrl`: `string` = t.string; `timestamp`: `number` = TimestampType; `type`: [`RPC_URL`](../enums/types.ClaimTypes.md#rpc_url) } \| \{ `name`: `string` = t.string; `timestamp`: `number` = TimestampType; `type`: [`NAME`](../enums/types.ClaimTypes.md#name) } \| \{ `address`: `string` = t.string; `filteredDataPaths`: `string` = t.string; `timestamp`: `number` = TimestampType; `type`: [`STORAGE`](../enums/types.ClaimTypes.md#storage) })[] |
| `meta` | \{ `address`: `string` = AddressType; `signature`: `string` = SignatureType } |
| `meta.address` | `string` |
| `meta.signature` | `string` |
Expand All @@ -79,11 +79,11 @@

### claims

`get` **claims**(): (\{ `address`: `string` = AddressType; `publicKey`: `undefined` \| `string` ; `timestamp`: `number` = TimestampType; `type`: [`ACCOUNT`](../enums/types.ClaimTypes.md#account) } \| \{ `timestamp`: `number` = TimestampType; `type`: [`KEYBASE`](../enums/types.ClaimTypes.md#keybase) ; `username`: `string` = t.string } \| \{ `domain`: `string` = t.string; `timestamp`: `number` = TimestampType; `type`: [`DOMAIN`](../enums/types.ClaimTypes.md#domain) } \| \{ `name`: `string` = t.string; `timestamp`: `number` = TimestampType; `type`: [`NAME`](../enums/types.ClaimTypes.md#name) } \| \{ `address`: `string` = t.string; `filteredDataPaths`: `string` = t.string; `timestamp`: `number` = TimestampType; `type`: [`STORAGE`](../enums/types.ClaimTypes.md#storage) })[]
`get` **claims**(): (\{ `address`: `string` = AddressType; `publicKey`: `undefined` \| `string` ; `timestamp`: `number` = TimestampType; `type`: [`ACCOUNT`](../enums/types.ClaimTypes.md#account) } \| \{ `timestamp`: `number` = TimestampType; `type`: [`KEYBASE`](../enums/types.ClaimTypes.md#keybase) ; `username`: `string` = t.string } \| \{ `domain`: `string` = t.string; `timestamp`: `number` = TimestampType; `type`: [`DOMAIN`](../enums/types.ClaimTypes.md#domain) } \| \{ `rpcUrl`: `string` = t.string; `timestamp`: `number` = TimestampType; `type`: [`RPC_URL`](../enums/types.ClaimTypes.md#rpc_url) } \| \{ `name`: `string` = t.string; `timestamp`: `number` = TimestampType; `type`: [`NAME`](../enums/types.ClaimTypes.md#name) } \| \{ `address`: `string` = t.string; `filteredDataPaths`: `string` = t.string; `timestamp`: `number` = TimestampType; `type`: [`STORAGE`](../enums/types.ClaimTypes.md#storage) })[]

#### Returns

(\{ `address`: `string` = AddressType; `publicKey`: `undefined` \| `string` ; `timestamp`: `number` = TimestampType; `type`: [`ACCOUNT`](../enums/types.ClaimTypes.md#account) } \| \{ `timestamp`: `number` = TimestampType; `type`: [`KEYBASE`](../enums/types.ClaimTypes.md#keybase) ; `username`: `string` = t.string } \| \{ `domain`: `string` = t.string; `timestamp`: `number` = TimestampType; `type`: [`DOMAIN`](../enums/types.ClaimTypes.md#domain) } \| \{ `name`: `string` = t.string; `timestamp`: `number` = TimestampType; `type`: [`NAME`](../enums/types.ClaimTypes.md#name) } \| \{ `address`: `string` = t.string; `filteredDataPaths`: `string` = t.string; `timestamp`: `number` = TimestampType; `type`: [`STORAGE`](../enums/types.ClaimTypes.md#storage) })[]
(\{ `address`: `string` = AddressType; `publicKey`: `undefined` \| `string` ; `timestamp`: `number` = TimestampType; `type`: [`ACCOUNT`](../enums/types.ClaimTypes.md#account) } \| \{ `timestamp`: `number` = TimestampType; `type`: [`KEYBASE`](../enums/types.ClaimTypes.md#keybase) ; `username`: `string` = t.string } \| \{ `domain`: `string` = t.string; `timestamp`: `number` = TimestampType; `type`: [`DOMAIN`](../enums/types.ClaimTypes.md#domain) } \| \{ `rpcUrl`: `string` = t.string; `timestamp`: `number` = TimestampType; `type`: [`RPC_URL`](../enums/types.ClaimTypes.md#rpc_url) } \| \{ `name`: `string` = t.string; `timestamp`: `number` = TimestampType; `type`: [`NAME`](../enums/types.ClaimTypes.md#name) } \| \{ `address`: `string` = t.string; `filteredDataPaths`: `string` = t.string; `timestamp`: `number` = TimestampType; `type`: [`STORAGE`](../enums/types.ClaimTypes.md#storage) })[]

#### Defined in

Expand Down Expand Up @@ -134,7 +134,7 @@ ___

#### Defined in

[packages/sdk/metadata-claims/src/metadata.ts:216](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/metadata-claims/src/metadata.ts#L216)
[packages/sdk/metadata-claims/src/metadata.ts:223](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/metadata-claims/src/metadata.ts#L223)

___

Expand All @@ -160,7 +160,7 @@ ___

#### Defined in

[packages/sdk/metadata-claims/src/metadata.ts:212](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/metadata-claims/src/metadata.ts#L212)
[packages/sdk/metadata-claims/src/metadata.ts:219](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/metadata-claims/src/metadata.ts#L219)

___

Expand Down
21 changes: 16 additions & 5 deletions docs/sdk/metadata-claims/enums/types.ClaimTypes.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
- [KEYBASE](types.ClaimTypes.md#keybase)
- [NAME](types.ClaimTypes.md#name)
- [PROFILE\_PICTURE](types.ClaimTypes.md#profile_picture)
- [RPC\_URL](types.ClaimTypes.md#rpc_url)
- [STORAGE](types.ClaimTypes.md#storage)
- [TWITTER](types.ClaimTypes.md#twitter)

Expand Down Expand Up @@ -44,7 +45,7 @@ ___

#### Defined in

[packages/sdk/metadata-claims/src/types.ts:14](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/metadata-claims/src/types.ts#L14)
[packages/sdk/metadata-claims/src/types.ts:15](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/metadata-claims/src/types.ts#L15)

___

Expand All @@ -54,7 +55,7 @@ ___

#### Defined in

[packages/sdk/metadata-claims/src/types.ts:15](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/metadata-claims/src/types.ts#L15)
[packages/sdk/metadata-claims/src/types.ts:16](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/metadata-claims/src/types.ts#L16)

___

Expand All @@ -64,7 +65,17 @@ ___

#### Defined in

[packages/sdk/metadata-claims/src/types.ts:16](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/metadata-claims/src/types.ts#L16)
[packages/sdk/metadata-claims/src/types.ts:17](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/metadata-claims/src/types.ts#L17)

___

### RPC\_URL

**RPC\_URL** = ``"RPC_URL"``

#### Defined in

[packages/sdk/metadata-claims/src/types.ts:14](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/metadata-claims/src/types.ts#L14)

___

Expand All @@ -74,7 +85,7 @@ ___

#### Defined in

[packages/sdk/metadata-claims/src/types.ts:17](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/metadata-claims/src/types.ts#L17)
[packages/sdk/metadata-claims/src/types.ts:18](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/metadata-claims/src/types.ts#L18)

___

Expand All @@ -84,4 +95,4 @@ ___

#### Defined in

[packages/sdk/metadata-claims/src/types.ts:18](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/metadata-claims/src/types.ts#L18)
[packages/sdk/metadata-claims/src/types.ts:19](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/metadata-claims/src/types.ts#L19)
Loading

0 comments on commit 0e559c7

Please sign in to comment.