-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
206 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
--- | ||
"@celo/phone-number-privacy-monitor": major | ||
--- | ||
|
||
Replace @celo/contractkit with viem | ||
|
||
|
||
### Breaking Changes | ||
|
||
`queryOdisForQuota` and `queryOdisForSalt` for first param instead of a string url now take an object with rpcURL and chainID. | ||
|
||
```diff | ||
- queryOdisForQuota("https://forno.celo.org",...rest) | ||
+ queryOdisForQuota({rpcURL: "https://forno.celo.org", chainID: 42220},...rest) | ||
|
||
|
||
- queryOdisForSalt("https://forno.celo.org",...rest) | ||
+ queryOdisForSalt({rpcURL: "https://forno.celo.org", chainID: 42220},...rest) | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
--- | ||
"@celo/phone-number-privacy-combiner": major | ||
--- | ||
|
||
Replace @celo/contractkit with viem | ||
|
||
|
||
### Breaking Changes | ||
|
||
`startCombiner` now takes an optional WalletClient instance from viem instead of a ContractKit instance | ||
|
||
config passed to `startCombiner` has a sub config `blockchain` which has the following changes. | ||
|
||
```diff | ||
{ | ||
...restOfConfig, | ||
blockchain: { | ||
- provider: "https://forno.celo.org" | ||
+ rpcURL: "https://forno.celo.org" | ||
+ chainID: 42220 | ||
} | ||
} | ||
|
||
``` | ||
--- | ||
|
||
`lib/common/web3` => `lib/common` | ||
|
||
`getDEK` moved from | ||
|
||
it now takes a WalletClient as its first param instead of a ContractKit. | ||
|
||
third param is now typed to require address starts with 0x | ||
|
||
```diff | ||
- export async function getDEK(kit: ContractKit, logger: Logger, account: string): Promise<string> | ||
+ export async function getDEK(client: Client, logger: Logger, account: Address): Promise<string> | ||
``` | ||
|
||
--- | ||
|
||
lib/pnp/services/account-services` | ||
|
||
`ContractKitAccountServiceOptions` => `ViemAccountServiceOptions` | ||
|
||
`ContractKitAccountService` => `ViemAccountService` | ||
|
||
addressed passed to `getAccount` now MUST start with `0x` in type |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
--- | ||
"@celo/identity": major | ||
--- | ||
|
||
Contract kit has been replaced with viem as dependency. | ||
|
||
from `lib/odis/query`; WalletKeySigner instead of a contractKit instance now takes a sign191 function | ||
|
||
- This should use EIP191 to sign the message using the private key assosiated with the account | ||
|
||
Most places that were previously typed as string are now 0x-string typed | ||
|
||
ContractKit is now an optional peer dependency. it is only needed if using the offchain-data-wrapper |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
--- | ||
"@celo/phone-number-privacy-common": major | ||
--- | ||
|
||
Replace @celo/contractkit with viem | ||
|
||
|
||
### BREAKING CHANGES | ||
Config changes | ||
|
||
`BlockchainConfig` gains a new required `chainID` property | ||
|
||
`provider` which is an overloaded term is renamed to `rpcURL` | ||
|
||
```diff | ||
config: BlockchainConfig = { | ||
- provider: FORNO_URL | ||
+ rpcURL: FORNOURL | ||
+ chainID: 42220 | ||
} | ||
``` | ||
|
||
`getContractKit` => `getWalletClient` | ||
|
||
|
||
functions replaced in utils/authentication | ||
|
||
`newContractKitFetcher` => `newDEKFetcher` | ||
|
||
```diff | ||
- newContractKitFetcher(contractKit: ContractKit, ...) | ||
+ newDEKFetcher(viemClient: Client, ...) | ||
``` | ||
|
||
functions with with changed signatures | ||
|
||
`getDataEncryptionKey` | ||
|
||
```diff | ||
export async function getDataEncryptionKey( | ||
- address: string, | ||
- contractKit: ContractKit, | ||
+ address: Address, | ||
+ viemClient: Client, | ||
logger: Logger, | ||
fullNodeTimeoutMs: number, | ||
fullNodeRetryCount: number, | ||
fullNodeRetryDelayMs: number, | ||
- ): Promise<string> | ||
+ ): Promise<Hex> | ||
``` | ||
|
||
functions removed from test/utils | ||
|
||
- `createMockToken` | ||
- `createMockContractKit` | ||
- `createMockConnection` | ||
- `createMockWeb3` | ||
- `replenishQuota` | ||
|
||
|
||
### NEW FUNCTIONS | ||
|
||
`import {getAccountsContract, getOdisPaymentsContract, getCUSDContract } from @celo/phone-number-privacy-common` | ||
|
||
To replace contractKit wrappers for Accounts, OdisPayments, and StableToken, contracts. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
--- | ||
"@celo/phone-number-privacy-signer": major | ||
--- | ||
|
||
Replace @celo/contractKit with viem | ||
|
||
|
||
If you are just running the service no actual changes required except to use with same major version of combiner and monitor | ||
|
||
### Breaking Changes | ||
|
||
|
||
|
||
`ContractKitAccountService` => `ClientAccountService` | ||
|
||
```diff | ||
- new ContractKitAccountService(logger, contractKit) | ||
+ new ClientAccountService(logger, walletClient) | ||
|
||
``` | ||
|
||
`getAccount` now takes strongly typed 0x string |
4 changes: 2 additions & 2 deletions
4
apps/combiner/src/common/web3/contracts.ts → apps/combiner/src/common/contracts.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters