Skip to content

Commit

Permalink
Merge branch 'master' into aarmgdr/celoscan
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronmgdr authored Apr 4, 2024
2 parents 378733c + 61c43e2 commit 1ebb72b
Show file tree
Hide file tree
Showing 7 changed files with 252 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/open-docs-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ jobs:
git fetch --all
git checkout $COMMIT
cd ../..
./scripts/copy-generated-docs.sh
cp -R ./submodules/developer-tooling/packages/docs/command-line-interface/* ./docs/cli/
git status
git add submodules/developer-tooling
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/bin/run.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

// eslint-disable-next-line unicorn/prefer-top-level-await
;(async () => {
const oclif = await import('@oclif/core')
const oclif = require('@oclif/core')
await oclif.execute({ development: false, dir: __dirname })
})()
5 changes: 4 additions & 1 deletion packages/cli/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,8 @@
"esModuleInterop": true,
"target": "es2020"
},
"include": ["src/**/*", "src/commands/dkg/DKG.json"]
"include": ["src/**/*", "src/commands/dkg/DKG.json"],
"ts-node": {
"esm": true
}
}
43 changes: 43 additions & 0 deletions packages/docs/command-line-interface/exchange.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Exchange Celo Dollars and CELO via Mento
* [`celocli exchange:celo`](#celocli-exchangecelo)
* [`celocli exchange:dollars`](#celocli-exchangedollars)
* [`celocli exchange:euros`](#celocli-exchangeeuros)
* [`celocli exchange:gold`](#celocli-exchangegold)
* [`celocli exchange:reals`](#celocli-exchangereals)
* [`celocli exchange:show`](#celocli-exchangeshow)
* [`celocli exchange:stable`](#celocli-exchangestable)
Expand Down Expand Up @@ -126,6 +127,48 @@ EXAMPLES

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

## `celocli exchange:gold`

Exchange CELO for StableTokens via the stability mechanism. *DEPRECATION WARNING* Use the "exchange:celo" command instead

```
USAGE
$ celocli exchange:gold --from <value> --value <value> [--gasCurrency <value>]
[--globalHelp] [--forAtLeast <value>] [--stableToken
cUSD|cusd|cEUR|ceur|cREAL|creal]
FLAGS
--forAtLeast=10000000000000000000000 [default: 0] Optional, the
minimum value of
StableTokens to receive in
return
--from=0xc1912fEE45d61C87Cc5EA59DaE31190FFFFf232d (required) The address with
CELO to exchange
--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
--stableToken=<option> [default: cusd] Name of the
stable to receive
<options: cUSD|cusd|cEUR|ceu
r|cREAL|creal>
--value=10000000000000000000000 (required) The value of CELO
to exchange for a
StableToken
DESCRIPTION
Exchange CELO for StableTokens via the stability mechanism. *DEPRECATION WARNING* Use
the "exchange:celo" command instead
EXAMPLES
gold --value 5000000000000 --from 0xc1912fEE45d61C87Cc5EA59DaE31190FFFFf232d
gold --value 5000000000000 --forAtLeast 100000000000000 --from 0xc1912fEE45d61C87Cc5EA59DaE31190FFFFf232d --stableToken cUSD
```

## `celocli exchange:reals`

Exchange Celo Brazilian Real (cREAL) for CELO via Mento
Expand Down
172 changes: 172 additions & 0 deletions packages/docs/command-line-interface/grandamento.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,172 @@
`celocli grandamento`
=====================

Cancels a Granda Mento exchange proposal

* [`celocli grandamento:cancel`](#celocli-grandamentocancel)
* [`celocli grandamento:execute`](#celocli-grandamentoexecute)
* [`celocli grandamento:get-buy-amount`](#celocli-grandamentoget-buy-amount)
* [`celocli grandamento:list`](#celocli-grandamentolist)
* [`celocli grandamento:propose`](#celocli-grandamentopropose)
* [`celocli grandamento:show`](#celocli-grandamentoshow)

## `celocli grandamento:cancel`

Cancels a Granda Mento exchange proposal

```
USAGE
$ celocli grandamento:cancel --from <value> (--proposalID <value> | | )
[--gasCurrency <value>] [--globalHelp]
FLAGS
--from=0xc1912fEE45d61C87Cc5EA59DaE31190FFFFf232d (required) The address
allowed to cancel the
proposal
--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
--proposalID=<value> (required) UUID of proposal
to view
DESCRIPTION
Cancels a Granda Mento exchange proposal
```

## `celocli grandamento:execute`

Executes a Granda Mento exchange proposal

```
USAGE
$ celocli grandamento:execute --from <value> --proposalID <value> [--gasCurrency
<value>] [--globalHelp]
FLAGS
--from=0xc1912fEE45d61C87Cc5EA59DaE31190FFFFf232d (required) The address to
execute the exchange
proposal
--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
--proposalID=<value> (required) UUID of proposal
to view
DESCRIPTION
Executes a Granda Mento exchange proposal
```

## `celocli grandamento:get-buy-amount`

Gets the buy amount for a prospective Granda Mento exchange

```
USAGE
$ celocli grandamento:get-buy-amount --value <value> --stableToken
cUSD|cusd|cEUR|ceur|cREAL|creal --sellCelo [--gasCurrency <value>] [--globalHelp]
FLAGS
--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
--sellCelo (required) Sell or buy CELO
--stableToken=<option> (required) [default: cusd]
Name of the stable to
receive or send
<options: cUSD|cusd|cEUR|ceu
r|cREAL|creal>
--value=10000000000000000000000 (required) The value of the
tokens to exchange
DESCRIPTION
Gets the buy amount for a prospective Granda Mento exchange
```

## `celocli grandamento:list`

List current active Granda Mento exchange proposals

```
USAGE
$ celocli grandamento:list [--gasCurrency <value>] [--globalHelp]
FLAGS
--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
DESCRIPTION
List current active Granda Mento exchange proposals
```

## `celocli grandamento:propose`

Proposes a Granda Mento exchange

```
USAGE
$ celocli grandamento:propose --from <value> --value <value> --stableToken
cUSD|cusd|cEUR|ceur|cREAL|creal --sellCelo [--gasCurrency <value>] [--globalHelp]
FLAGS
--from=0xc1912fEE45d61C87Cc5EA59DaE31190FFFFf232d (required) The address with
tokens to exchange
--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
--sellCelo (required) Sell or buy CELO
--stableToken=<option> (required) [default: cusd]
Name of the stable to
receive or send
<options: cUSD|cusd|cEUR|ceu
r|cREAL|creal>
--value=10000000000000000000000 (required) The value of the
tokens to exchange
DESCRIPTION
Proposes a Granda Mento exchange
```

## `celocli grandamento:show`

Shows details of a Granda Mento exchange proposal

```
USAGE
$ celocli grandamento:show --proposalID <value> [--gasCurrency <value>]
[--globalHelp]
FLAGS
--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
--proposalID=<value> (required) UUID of proposal
to view
DESCRIPTION
Shows details of a Granda Mento exchange proposal
```
30 changes: 30 additions & 0 deletions packages/docs/command-line-interface/utils.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
`celocli utils`
===============

List the whitelisted fee currencies

* [`celocli utils:whitelist`](#celocli-utilswhitelist)

## `celocli utils:whitelist`

List the whitelisted fee currencies

```
USAGE
$ celocli utils:whitelist [--gasCurrency <value>] [--globalHelp]
FLAGS
--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
DESCRIPTION
List the whitelisted fee currencies
EXAMPLES
whitelist
```
2 changes: 1 addition & 1 deletion packages/sdk/wallets/wallet-base/src/signing-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ import {
inputCeloTxFormatter,
parseAccessList,
} from '@celo/connect/lib/utils/formatter'
import { publicKeyToAddress } from '@celo/utils/lib/address'
import { EIP712TypedData, generateTypedDataHash } from '@celo/utils/lib/sign-typed-data-utils'
import { parseSignatureWithoutPrefix } from '@celo/utils/lib/signatureUtils'
import { publicKeyToAddress } from '@celo/utils/src/address'
import * as RLP from '@ethereumjs/rlp'
import * as ethUtil from '@ethereumjs/util'
import { secp256k1 } from '@noble/curves/secp256k1'
Expand Down

0 comments on commit 1ebb72b

Please sign in to comment.