Skip to content

Commit

Permalink
rename CORE_CHAINS const
Browse files Browse the repository at this point in the history
  • Loading branch information
lukachi committed Apr 23, 2024
1 parent 3854af9 commit d2b345e
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion packages/connector/src/consts/chains.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ enum CoreChains {
MainnetBeta = 'rarimo_42-1',
}

export const CORE_CHAINS: Record<string, ChainInfo> = {
export const RARIMO_CHAINS: Record<string, ChainInfo> = {
[CoreChains.MainnetBeta]: {
chainId: 'rarimo_42-1',
chainName: 'Rarimo Testnet',
Expand Down
10 changes: 5 additions & 5 deletions packages/connector/src/instances/snap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { providers } from 'ethers';

import versionJson from '../version.json';

import { CORE_CHAINS, defaultSnapOrigin, TARGET_CHAINS } from '@/consts';
import { RARIMO_CHAINS, defaultSnapOrigin, TARGET_CHAINS } from '@/consts';
import type { RPCMethods } from '@/enums';
import {
checkSnapSupport,
Expand All @@ -22,20 +22,20 @@ export class RarimeSnapBase {

public readonly version: string;

public supportedCoreChains: Record<string, ChainInfo> = CORE_CHAINS;
public supportedRarimoChains: Record<string, ChainInfo> = RARIMO_CHAINS;

public supportedTargetZkpChains: Record<number, ChainZkpInfo> = TARGET_CHAINS;

public constructor(
snapId = defaultSnapOrigin,
version = versionJson.version,

supportedCoreChains = CORE_CHAINS,
supportedRarimoChains = RARIMO_CHAINS,
supportedTargetZkpChains = TARGET_CHAINS,
) {
this.snapId = snapId;
this.version = version;
this.supportedCoreChains = supportedCoreChains;
this.supportedRarimoChains = supportedRarimoChains;
this.supportedTargetZkpChains = supportedTargetZkpChains;
}

Expand Down Expand Up @@ -120,7 +120,7 @@ export class RarimeSnapBase {
}

const targetChain = this.supportedTargetZkpChains[targetChainId];
const coreChain = this.supportedCoreChains[targetChain.coreChainId];
const coreChain = this.supportedRarimoChains[targetChain.coreChainId];

return {
coreChain,
Expand Down
8 changes: 4 additions & 4 deletions packages/snap/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ await window.ethereum.request({
To save Verifiable Credentials you need to call this method with params:

```javascript
import { CORE_CHAINS } from '@rarimo/rarime-connector';
import { RARIMO_CHAINS } from '@rarimo/rarime-connector';

const coreChain = CORE_CHAINS['rarimo_42-1'];
const coreChain = RARIMO_CHAINS['rarimo_42-1'];

const claimOffer = {
body: {
Expand Down Expand Up @@ -131,7 +131,7 @@ Returns ZKProof for off-chain and updateStateTx, statesMerkleData, ZKProof for o
To create a proof you need to call this method with params:

```javascript
import { CORE_CHAINS, TARGET_CHAINS } from '@rarimo/rarime-connector';
import { RARIMO_CHAINS, TARGET_CHAINS } from '@rarimo/rarime-connector';

const coreChain = CHAINS['rarimo_42-1'];
const targetChain = SUPPORTED_CHAINS['11155111']; // Sepolia chain
Expand Down Expand Up @@ -184,7 +184,7 @@ where:
Returns `true` if the state contract on current chain need to be synced:

```javascript
import { CORE_CHAINS, TARGET_CHAINS } from '@rarimo/rarime-connector';
import { RARIMO_CHAINS, TARGET_CHAINS } from '@rarimo/rarime-connector';

const coreChain = CHAINS['rarimo_42-1'];
const targetChain = SUPPORTED_CHAINS['11155111']; // Sepolia chain
Expand Down
2 changes: 1 addition & 1 deletion packages/snap/snap.manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"url": "https://github.com/rarimo/rarime.git"
},
"source": {
"shasum": "PixhRsGuxDkn3v6j4EYLWklxuQbRkRxVpfBUdZ8EIMI=",
"shasum": "0D5hkBbXZpAW+u4iinOoBR0JdsTr5hfo7qS7Wgml9rM=",
"location": {
"npm": {
"filePath": "dist/bundle.js",
Expand Down

0 comments on commit d2b345e

Please sign in to comment.