Rename abacus-sdk (#127)

* Rename abacus-sdk

* Github workflow changes

* Update README.md
pull/129/head
Nam Chu Hoai 3 years ago committed by GitHub
parent 79f1f200e8
commit 0f6c1bf635
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 10
      .github/workflows/npm/action.yml
  2. 4
      .github/workflows/typescript.yml
  3. 0
      typescript/abacus-sdk/.eslintignore
  4. 0
      typescript/abacus-sdk/.eslintrc.json
  5. 0
      typescript/abacus-sdk/.gitignore
  6. 0
      typescript/abacus-sdk/.npmignore
  7. 0
      typescript/abacus-sdk/.prettierrc
  8. 14
      typescript/abacus-sdk/README.md
  9. 5893
      typescript/abacus-sdk/package-lock.json
  10. 2
      typescript/abacus-sdk/package.json
  11. 30
      typescript/abacus-sdk/src/abacus/AbacusContext.ts
  12. 2
      typescript/abacus-sdk/src/abacus/contracts/BridgeContracts.ts
  13. 2
      typescript/abacus-sdk/src/abacus/contracts/CoreContracts.ts
  14. 0
      typescript/abacus-sdk/src/abacus/contracts/index.ts
  15. 12
      typescript/abacus-sdk/src/abacus/domains/dev.ts
  16. 2
      typescript/abacus-sdk/src/abacus/domains/domain.ts
  17. 2
      typescript/abacus-sdk/src/abacus/domains/index.ts
  18. 10
      typescript/abacus-sdk/src/abacus/domains/mainnet.ts
  19. 8
      typescript/abacus-sdk/src/abacus/domains/mainnetLegacy.ts
  20. 10
      typescript/abacus-sdk/src/abacus/domains/testnet.ts
  21. 8
      typescript/abacus-sdk/src/abacus/domains/testnetLegacy.ts
  22. 4
      typescript/abacus-sdk/src/abacus/events/abacusEvents.ts
  23. 2
      typescript/abacus-sdk/src/abacus/events/bridgeEvents.ts
  24. 16
      typescript/abacus-sdk/src/abacus/events/fetch.ts
  25. 6
      typescript/abacus-sdk/src/abacus/events/index.ts
  26. 0
      typescript/abacus-sdk/src/abacus/examples/sendCoins.ts
  27. 0
      typescript/abacus-sdk/src/abacus/govern/index.ts
  28. 2
      typescript/abacus-sdk/src/abacus/govern/utils.ts
  29. 14
      typescript/abacus-sdk/src/abacus/index.ts
  30. 60
      typescript/abacus-sdk/src/abacus/messages/AbacusMessage.ts
  31. 66
      typescript/abacus-sdk/src/abacus/messages/BridgeMessage.ts
  32. 2
      typescript/abacus-sdk/src/abacus/messages/index.ts
  33. 2
      typescript/abacus-sdk/src/abacus/tokens/index.ts
  34. 0
      typescript/abacus-sdk/src/abacus/tokens/testnetWellKnown.ts
  35. 0
      typescript/abacus-sdk/src/abacus/tokens/wellKnown.ts
  36. 0
      typescript/abacus-sdk/src/contracts.ts
  37. 0
      typescript/abacus-sdk/src/domains.ts
  38. 10
      typescript/abacus-sdk/src/index.ts
  39. 0
      typescript/abacus-sdk/src/metamask.ts
  40. 2
      typescript/abacus-sdk/src/provider.ts
  41. 2
      typescript/abacus-sdk/src/utils.ts
  42. 18
      typescript/abacus-sdk/tsconfig.json
  43. 2674
      typescript/optics-provider/package-lock.json
  44. 18
      typescript/optics-provider/tsconfig.json

@ -50,12 +50,12 @@ runs:
path: ./typescript/typechain/node_modules path: ./typescript/typechain/node_modules
key: ${{ inputs.runneros }}-typechain-cache-${{ hashFiles('typescript/typechain/package-lock.json') }} key: ${{ inputs.runneros }}-typechain-cache-${{ hashFiles('typescript/typechain/package-lock.json') }}
- name: Multi-Provider Cache - name: Abacus SDK Cache
id: provider-cache id: sdk-cache
uses: actions/cache@v2 uses: actions/cache@v2
with: with:
path: ./typescript/optics-provider/node_modules path: ./typescript/abacus-sdk/node_modules
key: ${{ inputs.runneros }}-provider-cache-${{ hashFiles('typescript/optics-provider/package-lock.json') }} key: ${{ inputs.runneros }}-sdk-cache-${{ hashFiles('typescript/abacus-sdk/package-lock.json') }}
- name: Metrics Cache - name: Metrics Cache
id: metrics-cache id: metrics-cache
@ -93,7 +93,7 @@ runs:
- name: Install Multi-Provider - name: Install Multi-Provider
shell: bash shell: bash
if: steps.provider-cache.outputs.cache-hit != 'true' if: steps.provider-cache.outputs.cache-hit != 'true'
run: cd ./typescript/optics-provider && npm i run: cd ./typescript/abacus-sdk && npm i
- name: Install Metrics - name: Install Metrics
shell: bash shell: bash

@ -36,7 +36,7 @@ jobs:
npm run build npm run build
cd ../optics-deploy cd ../optics-deploy
npm run build npm run build
cd ../optics-provider cd ../abacus-sdk
npm run build npm run build
cd ../typechain cd ../typechain
npm run build npm run build
@ -54,7 +54,7 @@ jobs:
run: | run: |
cd ./typescript/optics-deploy cd ./typescript/optics-deploy
npm run prettier npm run prettier
cd ../optics-provider cd ../abacus-sdk
npm run prettier npm run prettier
cd ../abacus-tests cd ../abacus-tests
npm run prettier-ci npm run prettier-ci

@ -1,13 +1,13 @@
## Optics Provider ## Abacus SDK
Optics Provider is a management system for Abacus SDK is a management system for
[ethers.js](https://docs.ethers.io/v5/) providers and signers that helps [ethers.js](https://docs.ethers.io/v5/) providers and signers that helps
developers connect to multiple networks simultaneously. It is part developers connect to multiple networks simultaneously. It is part
of the [Optics](https://github.com/celo-org/optics-monorepo) project, but may of the [Abacus](https://github.com/celo-org/optics-monorepo) project, but may
be useful to other multi-chain systems. be useful to other multi-chain systems.
This package includes the `MultiProvider`, as well as an `OpticsContext` for This package includes the `MultiProvider`, as well as an `AbacusContext` for
interacting with deployed Optics systems. The dev, staging, and mainnet Optics interacting with deployed Abacus systems. The dev, staging, and mainnet Abacus
systems have pre-built objects for quick development. systems have pre-built objects for quick development.
### Intended Usage ### Intended Usage
@ -15,7 +15,7 @@ systems have pre-built objects for quick development.
```ts ```ts
import * as ethers from 'ethers'; import * as ethers from 'ethers';
import { mainnet } from 'optics-provider'; import { mainnet } from '@abacus-network/sdk';
// Set up providers and signers // Set up providers and signers
const someEthersProvider = ethers.providers.WsProvider('...'); const someEthersProvider = ethers.providers.WsProvider('...');
@ -27,7 +27,7 @@ mainnet.registerSigner('ethereum', someEthersSigner);
mainnet.registerRpcProvider('celo', 'https://forno.celo.org'); mainnet.registerRpcProvider('celo', 'https://forno.celo.org');
mainnet.registerWalletSigner('celo', '0xabcd...'); mainnet.registerWalletSigner('celo', '0xabcd...');
// Interact with the Optics Bridge // Interact with the Abacus Bridge
// Send ETH from ethereum to celo // Send ETH from ethereum to celo
await mainnet.sendNative( await mainnet.sendNative(
'ethereum', // source 'ethereum', // source

File diff suppressed because it is too large Load Diff

@ -30,6 +30,6 @@
"@ethersproject/bytes": "^5.5.0", "@ethersproject/bytes": "^5.5.0",
"celo-ethers-provider": "0.0.0", "celo-ethers-provider": "0.0.0",
"ethers": "^5.4.7", "ethers": "^5.4.7",
"optics-ts-interface": "^1.1.2" "@abacus-network/ts-interface": "^1.1.2"
} }
} }

@ -1,6 +1,6 @@
import { BigNumberish, ethers } from 'ethers'; import { BigNumberish, ethers } from 'ethers';
import { MultiProvider } from '..'; import { MultiProvider } from '..';
import { xapps, core } from 'optics-ts-interface'; import { xapps, core } from '@abacus-network/ts-interface';
import { BridgeContracts } from './contracts/BridgeContracts'; import { BridgeContracts } from './contracts/BridgeContracts';
import { CoreContracts } from './contracts/CoreContracts'; import { CoreContracts } from './contracts/CoreContracts';
import { ResolvedTokenInfo, TokenIdentifier } from './tokens'; import { ResolvedTokenInfo, TokenIdentifier } from './tokens';
@ -9,7 +9,7 @@ import {
devDomains, devDomains,
mainnetDomains, mainnetDomains,
mainnetLegacyDomains, mainnetLegacyDomains,
OpticsDomain, AbacusDomain,
testnetDomains, testnetDomains,
testnetLegacyDomains, testnetLegacyDomains,
} from './domains'; } from './domains';
@ -19,7 +19,7 @@ import { hexlify } from '@ethersproject/bytes';
type Address = string; type Address = string;
/** /**
* The OpticsContext managers connections to Optics core and Bridge contracts. * The AbacusContext managers connections to Abacus core and Bridge contracts.
* It inherits from the {@link MultiProvider}, and ensures that its contracts * It inherits from the {@link MultiProvider}, and ensures that its contracts
* always use the latest registered providers and signers. * always use the latest registered providers and signers.
* *
@ -30,13 +30,13 @@ type Address = string;
* // Set up mainnet and then access contracts as below: * // Set up mainnet and then access contracts as below:
* let router = mainnet.mustGetBridge('celo').bridgeRouter; * let router = mainnet.mustGetBridge('celo').bridgeRouter;
*/ */
export class OpticsContext extends MultiProvider { export class AbacusContext extends MultiProvider {
private cores: Map<number, CoreContracts>; private cores: Map<number, CoreContracts>;
private bridges: Map<number, BridgeContracts>; private bridges: Map<number, BridgeContracts>;
private _governorDomain?: number; private _governorDomain?: number;
constructor( constructor(
domains: OpticsDomain[], domains: AbacusDomain[],
cores: CoreContracts[], cores: CoreContracts[],
bridges: BridgeContracts[], bridges: BridgeContracts[],
) { ) {
@ -54,15 +54,15 @@ export class OpticsContext extends MultiProvider {
} }
/** /**
* Instantiate an OpticsContext from contract info. * Instantiate an AbacusContext from contract info.
* *
* @param domains An array of Domains with attached contract info * @param domains An array of Domains with attached contract info
* @returns A context object * @returns A context object
*/ */
static fromDomains(domains: OpticsDomain[]): OpticsContext { static fromDomains(domains: AbacusDomain[]): AbacusContext {
const cores = domains.map((domain) => CoreContracts.fromObject(domain)); const cores = domains.map((domain) => CoreContracts.fromObject(domain));
const bridges = domains.map((domain) => BridgeContracts.fromObject(domain)); const bridges = domains.map((domain) => BridgeContracts.fromObject(domain));
return new OpticsContext(domains, cores, bridges); return new AbacusContext(domains, cores, bridges);
} }
/** /**
@ -226,7 +226,7 @@ export class OpticsContext extends MultiProvider {
} }
/** /**
* Discovers the governor domain of this optics deployment and caches it. * Discovers the governor domain of this abacus deployment and caches it.
* *
* @returns The identifier of the governing domain * @returns The identifier of the governing domain
*/ */
@ -244,7 +244,7 @@ export class OpticsContext extends MultiProvider {
} }
/** /**
* Discovers the governor domain of this optics deployment and returns the * Discovers the governor domain of this abacus deployment and returns the
* associated Core. * associated Core.
* *
* @returns The identifier of the governing domain * @returns The identifier of the governing domain
@ -499,8 +499,8 @@ export class OpticsContext extends MultiProvider {
} }
} }
export const testnetLegacy = OpticsContext.fromDomains(testnetLegacyDomains); export const testnetLegacy = AbacusContext.fromDomains(testnetLegacyDomains);
export const mainnetLegacy = OpticsContext.fromDomains(mainnetLegacyDomains); export const mainnetLegacy = AbacusContext.fromDomains(mainnetLegacyDomains);
export const dev = OpticsContext.fromDomains(devDomains); export const dev = AbacusContext.fromDomains(devDomains);
export const testnet = OpticsContext.fromDomains(testnetDomains); export const testnet = AbacusContext.fromDomains(testnetDomains);
export const mainnet = OpticsContext.fromDomains(mainnetDomains); export const mainnet = AbacusContext.fromDomains(mainnetDomains);

@ -1,5 +1,5 @@
import { ethers } from 'ethers'; import { ethers } from 'ethers';
import { xapps } from 'optics-ts-interface'; import { xapps } from '@abacus-network/ts-interface';
import { Contracts } from '../../contracts'; import { Contracts } from '../../contracts';
type Address = string; type Address = string;

@ -1,5 +1,5 @@
import { ethers } from 'ethers'; import { ethers } from 'ethers';
import { core } from 'optics-ts-interface'; import { core } from '@abacus-network/ts-interface';
import { Contracts } from '../../contracts'; import { Contracts } from '../../contracts';
import { ReplicaInfo } from '../domains/domain'; import { ReplicaInfo } from '../domains/domain';
import { CallBatch } from '../govern'; import { CallBatch } from '../govern';

@ -1,6 +1,6 @@
import { OpticsDomain } from './domain'; import { AbacusDomain } from './domain';
export const alfajores: OpticsDomain = { export const alfajores: AbacusDomain = {
name: 'alfajores', name: 'alfajores',
id: 1000, id: 1000,
bridgeRouter: '0x684C74fBA4dF7F7A542709C5f9688AB806C7B828', bridgeRouter: '0x684C74fBA4dF7F7A542709C5f9688AB806C7B828',
@ -15,7 +15,7 @@ export const alfajores: OpticsDomain = {
xAppConnectionManager: '0x2d230eB17F3AFe032809EC13A0E516E297b17AA3', xAppConnectionManager: '0x2d230eB17F3AFe032809EC13A0E516E297b17AA3',
}; };
export const kovan: OpticsDomain = { export const kovan: AbacusDomain = {
name: 'kovan', name: 'kovan',
id: 3000, id: 3000,
bridgeRouter: '0x53d09A4B49443F7f7C66321C306601dC9d483D4F', bridgeRouter: '0x53d09A4B49443F7f7C66321C306601dC9d483D4F',
@ -31,7 +31,7 @@ export const kovan: OpticsDomain = {
xAppConnectionManager: '0xf9db87020527A5A5aeFd95099051Fb14058916C9', xAppConnectionManager: '0xf9db87020527A5A5aeFd95099051Fb14058916C9',
}; };
export const gorli: OpticsDomain = { export const gorli: AbacusDomain = {
name: 'gorli', name: 'gorli',
id: 5, id: 5,
bridgeRouter: '0x53d09A4B49443F7f7C66321C306601dC9d483D4F', bridgeRouter: '0x53d09A4B49443F7f7C66321C306601dC9d483D4F',
@ -47,7 +47,7 @@ export const gorli: OpticsDomain = {
xAppConnectionManager: '0xf9db87020527A5A5aeFd95099051Fb14058916C9', xAppConnectionManager: '0xf9db87020527A5A5aeFd95099051Fb14058916C9',
}; };
export const fuji: OpticsDomain = { export const fuji: AbacusDomain = {
name: 'fuji', name: 'fuji',
id: 43113, id: 43113,
bridgeRouter: '0xFE7c9Cc7116429Ae50823a218315C7E01EC7A761', bridgeRouter: '0xFE7c9Cc7116429Ae50823a218315C7E01EC7A761',
@ -63,7 +63,7 @@ export const fuji: OpticsDomain = {
xAppConnectionManager: '0xf9db87020527A5A5aeFd95099051Fb14058916C9', xAppConnectionManager: '0xf9db87020527A5A5aeFd95099051Fb14058916C9',
}; };
export const mumbai: OpticsDomain = { export const mumbai: AbacusDomain = {
name: 'mumbai', name: 'mumbai',
id: 80001, id: 80001,
bridgeRouter: '0xFE7c9Cc7116429Ae50823a218315C7E01EC7A761', bridgeRouter: '0xFE7c9Cc7116429Ae50823a218315C7E01EC7A761',

@ -1,7 +1,7 @@
import { Domain } from '../../domains'; import { Domain } from '../../domains';
import { Address } from '../../utils'; import { Address } from '../../utils';
export interface OpticsDomain extends Domain { export interface AbacusDomain extends Domain {
bridgeRouter: Address; bridgeRouter: Address;
ethHelper?: Address; ethHelper?: Address;
home: Address; home: Address;

@ -1,4 +1,4 @@
export type { OpticsDomain, ReplicaInfo } from './domain'; export type { AbacusDomain, ReplicaInfo } from './domain';
export { mainnetDomains } from './mainnet'; export { mainnetDomains } from './mainnet';
export { mainnetLegacyDomains } from './mainnetLegacy'; export { mainnetLegacyDomains } from './mainnetLegacy';
export { devDomains } from './dev'; export { devDomains } from './dev';

@ -1,6 +1,6 @@
import { OpticsDomain } from './domain'; import { AbacusDomain } from './domain';
export const celo: OpticsDomain = { export const celo: AbacusDomain = {
name: 'celo', name: 'celo',
id: 1667591279, id: 1667591279,
bridgeRouter: '0x1548cf5cf7dBd93f4dA11f45fCce315573d21B60', bridgeRouter: '0x1548cf5cf7dBd93f4dA11f45fCce315573d21B60',
@ -20,7 +20,7 @@ export const celo: OpticsDomain = {
], ],
}; };
export const ethereum: OpticsDomain = { export const ethereum: AbacusDomain = {
name: 'ethereum', name: 'ethereum',
id: 6648936, id: 6648936,
bridgeRouter: '0x4fc16De11deAc71E8b2Db539d82d93BE4b486892', bridgeRouter: '0x4fc16De11deAc71E8b2Db539d82d93BE4b486892',
@ -44,7 +44,7 @@ export const ethereum: OpticsDomain = {
], ],
}; };
export const avalanche: OpticsDomain = { export const avalanche: AbacusDomain = {
name: 'avalanche', name: 'avalanche',
id: 1635148152, id: 1635148152,
paginate: { paginate: {
@ -69,7 +69,7 @@ export const avalanche: OpticsDomain = {
], ],
}; };
export const polygon: OpticsDomain = { export const polygon: AbacusDomain = {
name: 'polygon', name: 'polygon',
id: 1886350457, id: 1886350457,
paginate: { paginate: {

@ -1,6 +1,6 @@
import { OpticsDomain } from './domain'; import { AbacusDomain } from './domain';
export const ethereum: OpticsDomain = { export const ethereum: AbacusDomain = {
name: 'ethereum', name: 'ethereum',
id: 6648936, id: 6648936,
bridgeRouter: '0x6a39909e805A3eaDd2b61fFf61147796ca6aBB47', bridgeRouter: '0x6a39909e805A3eaDd2b61fFf61147796ca6aBB47',
@ -20,7 +20,7 @@ export const ethereum: OpticsDomain = {
], ],
}; };
export const polygon: OpticsDomain = { export const polygon: AbacusDomain = {
name: 'polygon', name: 'polygon',
id: 1886350457, id: 1886350457,
paginate: { paginate: {
@ -42,7 +42,7 @@ export const polygon: OpticsDomain = {
], ],
}; };
export const celo: OpticsDomain = { export const celo: AbacusDomain = {
name: 'celo', name: 'celo',
id: 1667591279, id: 1667591279,
bridgeRouter: '0xf244eA81F715F343040569398A4E7978De656bf6', bridgeRouter: '0xf244eA81F715F343040569398A4E7978De656bf6',

@ -1,6 +1,6 @@
import { OpticsDomain } from './domain'; import { AbacusDomain } from './domain';
export const alfajores: OpticsDomain = { export const alfajores: AbacusDomain = {
name: 'alfajores', name: 'alfajores',
id: 1000, id: 1000,
bridgeRouter: '0xe29Abbc3669064d8aF9F6BE378179a133664a92C', bridgeRouter: '0xe29Abbc3669064d8aF9F6BE378179a133664a92C',
@ -14,7 +14,7 @@ export const alfajores: OpticsDomain = {
], ],
}; };
export const ropsten: OpticsDomain = { export const ropsten: AbacusDomain = {
name: 'ropsten', name: 'ropsten',
id: 3, id: 3,
bridgeRouter: '0xe29Abbc3669064d8aF9F6BE378179a133664a92C', bridgeRouter: '0xe29Abbc3669064d8aF9F6BE378179a133664a92C',
@ -29,7 +29,7 @@ export const ropsten: OpticsDomain = {
], ],
}; };
export const kovan: OpticsDomain = { export const kovan: AbacusDomain = {
name: 'kovan', name: 'kovan',
id: 3000, id: 3000,
bridgeRouter: '0x9A0e88a3D8CF09F3dc5Ba65640299DE3D87f926C', bridgeRouter: '0x9A0e88a3D8CF09F3dc5Ba65640299DE3D87f926C',
@ -44,7 +44,7 @@ export const kovan: OpticsDomain = {
], ],
}; };
export const gorli: OpticsDomain = { export const gorli: AbacusDomain = {
name: 'gorli', name: 'gorli',
id: 5, id: 5,
bridgeRouter: '0xe29Abbc3669064d8aF9F6BE378179a133664a92C', bridgeRouter: '0xe29Abbc3669064d8aF9F6BE378179a133664a92C',

@ -1,6 +1,6 @@
import { OpticsDomain } from './domain'; import { AbacusDomain } from './domain';
export const alfajores: OpticsDomain = { export const alfajores: AbacusDomain = {
name: 'alfajores', name: 'alfajores',
id: 1000, id: 1000,
bridgeRouter: '0xd6930Ee55C141E5Bb4079d5963cF64320956bb3E', bridgeRouter: '0xd6930Ee55C141E5Bb4079d5963cF64320956bb3E',
@ -13,7 +13,7 @@ export const alfajores: OpticsDomain = {
], ],
}; };
export const kovan: OpticsDomain = { export const kovan: AbacusDomain = {
name: 'kovan', name: 'kovan',
id: 3000, id: 3000,
bridgeRouter: '0x359089D34687bDbFD019fCC5093fFC21bE9905f5', bridgeRouter: '0x359089D34687bDbFD019fCC5093fFC21bE9905f5',
@ -27,7 +27,7 @@ export const kovan: OpticsDomain = {
], ],
}; };
export const rinkeby: OpticsDomain = { export const rinkeby: AbacusDomain = {
name: 'rinkeby', name: 'rinkeby',
id: 2000, id: 2000,
bridgeRouter: '0x8FbEA25D0bFDbff68F2B920df180e9498E9c856A', bridgeRouter: '0x8FbEA25D0bFDbff68F2B920df180e9498E9c856A',

@ -2,7 +2,7 @@ import { BigNumber } from '@ethersproject/bignumber';
import { Result } from '@ethersproject/abi'; import { Result } from '@ethersproject/abi';
import { TransactionReceipt } from '@ethersproject/abstract-provider'; import { TransactionReceipt } from '@ethersproject/abstract-provider';
import { TypedEvent } from 'optics-ts-interface/dist/optics-core/commons'; import { TypedEvent } from '@abacus-network/ts-interface/dist/abacus-core/commons';
// copied from the Home.d.ts // copied from the Home.d.ts
export type DispatchTypes = [string, BigNumber, BigNumber, string, string]; export type DispatchTypes = [string, BigNumber, BigNumber, string, string];
@ -34,7 +34,7 @@ export type ProcessArgs = {
}; };
export type ProcessEvent = TypedEvent<ProcessTypes & ProcessArgs>; export type ProcessEvent = TypedEvent<ProcessTypes & ProcessArgs>;
export type OpticsLifecyleEvent = ProcessEvent | UpdateEvent | DispatchEvent; export type AbacusLifecyleEvent = ProcessEvent | UpdateEvent | DispatchEvent;
export class Annotated<U extends Result, T extends TypedEvent<U>> { export class Annotated<U extends Result, T extends TypedEvent<U>> {
readonly domain: number; readonly domain: number;

@ -1,4 +1,4 @@
import { TypedEvent } from 'optics-ts-interface/dist/optics-core/commons'; import { TypedEvent } from '@abacus-network/ts-interface/dist/abacus-core/commons';
import { BigNumber } from 'ethers'; import { BigNumber } from 'ethers';
import { Annotated } from '.'; import { Annotated } from '.';

@ -1,11 +1,11 @@
import { Annotated } from '.'; import { Annotated } from '.';
import { OpticsContext } from '..'; import { AbacusContext } from '..';
import { Domain } from '../../domains'; import { Domain } from '../../domains';
import { Result } from '@ethersproject/abi'; import { Result } from '@ethersproject/abi';
import { import {
TypedEvent, TypedEvent,
TypedEventFilter, TypedEventFilter,
} from 'optics-ts-interface/dist/optics-core/commons'; } from '@abacus-network/ts-interface/dist/abacus-core/commons';
// specifies an interface shared by the TS generated contracts // specifies an interface shared by the TS generated contracts
export interface TSContract<T extends Result, U> { export interface TSContract<T extends Result, U> {
@ -17,7 +17,7 @@ export interface TSContract<T extends Result, U> {
} }
export async function queryAnnotatedEvents<T extends Result, U>( export async function queryAnnotatedEvents<T extends Result, U>(
context: OpticsContext, context: AbacusContext,
nameOrDomain: string | number, nameOrDomain: string | number,
contract: TSContract<T, U>, contract: TSContract<T, U>,
filter: TypedEventFilter<T, U>, filter: TypedEventFilter<T, U>,
@ -36,7 +36,7 @@ export async function queryAnnotatedEvents<T extends Result, U>(
} }
export async function findAnnotatedSingleEvent<T extends Result, U>( export async function findAnnotatedSingleEvent<T extends Result, U>(
context: OpticsContext, context: AbacusContext,
nameOrDomain: string | number, nameOrDomain: string | number,
contract: TSContract<T, U>, contract: TSContract<T, U>,
filter: TypedEventFilter<T, U>, filter: TypedEventFilter<T, U>,
@ -53,7 +53,7 @@ export async function findAnnotatedSingleEvent<T extends Result, U>(
} }
export async function getEvents<T extends Result, U>( export async function getEvents<T extends Result, U>(
context: OpticsContext, context: AbacusContext,
nameOrDomain: string | number, nameOrDomain: string | number,
contract: TSContract<T, U>, contract: TSContract<T, U>,
filter: TypedEventFilter<T, U>, filter: TypedEventFilter<T, U>,
@ -75,7 +75,7 @@ export async function getEvents<T extends Result, U>(
} }
export async function findEvent<T extends Result, U>( export async function findEvent<T extends Result, U>(
context: OpticsContext, context: AbacusContext,
nameOrDomain: string | number, nameOrDomain: string | number,
contract: TSContract<T, U>, contract: TSContract<T, U>,
filter: TypedEventFilter<T, U>, filter: TypedEventFilter<T, U>,
@ -95,7 +95,7 @@ export async function findEvent<T extends Result, U>(
} }
async function getPaginatedEvents<T extends Result, U>( async function getPaginatedEvents<T extends Result, U>(
context: OpticsContext, context: AbacusContext,
domain: Domain, domain: Domain,
contract: TSContract<T, U>, contract: TSContract<T, U>,
filter: TypedEventFilter<T, U>, filter: TypedEventFilter<T, U>,
@ -141,7 +141,7 @@ async function getPaginatedEvents<T extends Result, U>(
} }
async function findFromPaginatedEvents<T extends Result, U>( async function findFromPaginatedEvents<T extends Result, U>(
context: OpticsContext, context: AbacusContext,
domain: Domain, domain: Domain,
contract: TSContract<T, U>, contract: TSContract<T, U>,
filter: TypedEventFilter<T, U>, filter: TypedEventFilter<T, U>,

@ -3,7 +3,7 @@ export type {
AnnotatedUpdate, AnnotatedUpdate,
AnnotatedProcess, AnnotatedProcess,
AnnotatedLifecycleEvent, AnnotatedLifecycleEvent,
OpticsLifecyleEvent, AbacusLifecyleEvent,
DispatchEvent, DispatchEvent,
ProcessEvent, ProcessEvent,
UpdateEvent, UpdateEvent,
@ -13,9 +13,9 @@ export type {
ProcessTypes, ProcessTypes,
DispatchArgs, DispatchArgs,
DispatchTypes, DispatchTypes,
} from './opticsEvents'; } from './abacusEvents';
export { Annotated } from './opticsEvents'; export { Annotated } from './abacusEvents';
export type { export type {
SendTypes, SendTypes,

@ -8,7 +8,7 @@ export function byteLength(bytesLike: ethers.utils.BytesLike): number {
} }
/** /**
* Serialize a call to its packed Optics governance representation * Serialize a call to its packed Abacus governance representation
* @param call The function call to serialize * @param call The function call to serialize
* @returns The serialized function call, as a '0x'-prepended hex string * @returns The serialized function call, as a '0x'-prepended hex string
*/ */

@ -8,15 +8,15 @@ export {
} from './messages/BridgeMessage'; } from './messages/BridgeMessage';
export { export {
OpticsMessage, AbacusMessage,
OpticsStatus, AbacusStatus,
MessageStatus, MessageStatus,
} from './messages/OpticsMessage'; } from './messages/AbacusMessage';
export type { ResolvedTokenInfo, TokenIdentifier } from './tokens'; export type { ResolvedTokenInfo, TokenIdentifier } from './tokens';
export { tokens, testnetTokens } from './tokens'; export { tokens, testnetTokens } from './tokens';
export type { OpticsDomain } from './domains'; export type { AbacusDomain } from './domains';
export { export {
testnetLegacyDomains, testnetLegacyDomains,
mainnetLegacyDomains, mainnetLegacyDomains,
@ -25,7 +25,7 @@ export {
mainnetDomains, mainnetDomains,
} from './domains'; } from './domains';
export type { AnnotatedLifecycleEvent, OpticsLifecyleEvent } from './events'; export type { AnnotatedLifecycleEvent, AbacusLifecyleEvent } from './events';
export { export {
queryAnnotatedEvents, queryAnnotatedEvents,
findAnnotatedSingleEvent, findAnnotatedSingleEvent,
@ -33,10 +33,10 @@ export {
} from './events'; } from './events';
export { export {
OpticsContext, AbacusContext,
testnetLegacy, testnetLegacy,
mainnetLegacy, mainnetLegacy,
dev, dev,
testnet, testnet,
mainnet, mainnet,
} from './OpticsContext'; } from './AbacusContext';

@ -1,8 +1,8 @@
import { BigNumber } from '@ethersproject/bignumber'; import { BigNumber } from '@ethersproject/bignumber';
import { arrayify, hexlify } from '@ethersproject/bytes'; import { arrayify, hexlify } from '@ethersproject/bytes';
import { TransactionReceipt } from '@ethersproject/abstract-provider'; import { TransactionReceipt } from '@ethersproject/abstract-provider';
import { core } from 'optics-ts-interface'; import { core } from '@abacus-network/ts-interface';
import { OpticsContext } from '..'; import { AbacusContext } from '..';
import { delay } from '../../utils'; import { delay } from '../../utils';
import { import {
DispatchEvent, DispatchEvent,
@ -30,7 +30,7 @@ export type ParsedMessage = {
body: string; body: string;
}; };
export type OpticsStatus = { export type AbacusStatus = {
status: MessageStatus; status: MessageStatus;
events: AnnotatedLifecycleEvent[]; events: AnnotatedLifecycleEvent[];
}; };
@ -55,7 +55,7 @@ export type EventCache = {
}; };
/** /**
* Parse a serialized Optics message from raw bytes. * Parse a serialized Abacus message from raw bytes.
* *
* @param message * @param message
* @returns * @returns
@ -72,18 +72,18 @@ export function parseMessage(message: string): ParsedMessage {
} }
/** /**
* A deserialized Optics message. * A deserialized Abacus message.
*/ */
export class OpticsMessage { export class AbacusMessage {
readonly dispatch: AnnotatedDispatch; readonly dispatch: AnnotatedDispatch;
readonly message: ParsedMessage; readonly message: ParsedMessage;
readonly home: core.Home; readonly home: core.Home;
readonly replica: core.Replica; readonly replica: core.Replica;
readonly context: OpticsContext; readonly context: AbacusContext;
protected cache: EventCache; protected cache: EventCache;
constructor(context: OpticsContext, dispatch: AnnotatedDispatch) { constructor(context: AbacusContext, dispatch: AnnotatedDispatch) {
this.context = context; this.context = context;
this.message = parseMessage(dispatch.event.args.message); this.message = parseMessage(dispatch.event.args.message);
this.dispatch = dispatch; this.dispatch = dispatch;
@ -105,17 +105,17 @@ export class OpticsMessage {
/** /**
* Instantiate one or more messages from a receipt. * Instantiate one or more messages from a receipt.
* *
* @param context the {@link OpticsContext} object to use * @param context the {@link AbacusContext} object to use
* @param nameOrDomain the domain on which the receipt was logged * @param nameOrDomain the domain on which the receipt was logged
* @param receipt the receipt * @param receipt the receipt
* @returns an array of {@link OpticsMessage} objects * @returns an array of {@link AbacusMessage} objects
*/ */
static fromReceipt( static fromReceipt(
context: OpticsContext, context: AbacusContext,
nameOrDomain: string | number, nameOrDomain: string | number,
receipt: TransactionReceipt, receipt: TransactionReceipt,
): OpticsMessage[] { ): AbacusMessage[] {
const messages: OpticsMessage[] = []; const messages: AbacusMessage[] = [];
const home = new core.Home__factory().interface; const home = new core.Home__factory().interface;
for (const log of receipt.logs) { for (const log of receipt.logs) {
@ -146,7 +146,7 @@ export class OpticsMessage {
true, true,
); );
annotated.event.blockNumber = annotated.receipt.blockNumber; annotated.event.blockNumber = annotated.receipt.blockNumber;
const message = new OpticsMessage(context, annotated); const message = new AbacusMessage(context, annotated);
messages.push(message); messages.push(message);
} }
} catch (e) { } catch (e) {
@ -159,18 +159,18 @@ export class OpticsMessage {
/** /**
* Instantiate EXACTLY one message from a receipt. * Instantiate EXACTLY one message from a receipt.
* *
* @param context the {@link OpticsContext} object to use * @param context the {@link AbacusContext} object to use
* @param nameOrDomain the domain on which the receipt was logged * @param nameOrDomain the domain on which the receipt was logged
* @param receipt the receipt * @param receipt the receipt
* @returns an array of {@link OpticsMessage} objects * @returns an array of {@link AbacusMessage} objects
* @throws if there is not EXACTLY 1 dispatch in the receipt * @throws if there is not EXACTLY 1 dispatch in the receipt
*/ */
static singleFromReceipt( static singleFromReceipt(
context: OpticsContext, context: AbacusContext,
nameOrDomain: string | number, nameOrDomain: string | number,
receipt: TransactionReceipt, receipt: TransactionReceipt,
): OpticsMessage { ): AbacusMessage {
const messages: OpticsMessage[] = OpticsMessage.fromReceipt( const messages: AbacusMessage[] = AbacusMessage.fromReceipt(
context, context,
nameOrDomain, nameOrDomain,
receipt, receipt,
@ -184,46 +184,46 @@ export class OpticsMessage {
/** /**
* Instantiate one or more messages from a tx hash. * Instantiate one or more messages from a tx hash.
* *
* @param context the {@link OpticsContext} object to use * @param context the {@link AbacusContext} object to use
* @param nameOrDomain the domain on which the receipt was logged * @param nameOrDomain the domain on which the receipt was logged
* @param receipt the receipt * @param receipt the receipt
* @returns an array of {@link OpticsMessage} objects * @returns an array of {@link AbacusMessage} objects
* @throws if there is no receipt for the TX * @throws if there is no receipt for the TX
*/ */
static async fromTransactionHash( static async fromTransactionHash(
context: OpticsContext, context: AbacusContext,
nameOrDomain: string | number, nameOrDomain: string | number,
transactionHash: string, transactionHash: string,
): Promise<OpticsMessage[]> { ): Promise<AbacusMessage[]> {
const provider = context.mustGetProvider(nameOrDomain); const provider = context.mustGetProvider(nameOrDomain);
const receipt = await provider.getTransactionReceipt(transactionHash); const receipt = await provider.getTransactionReceipt(transactionHash);
if (!receipt) { if (!receipt) {
throw new Error(`No receipt for ${transactionHash} on ${nameOrDomain}`); throw new Error(`No receipt for ${transactionHash} on ${nameOrDomain}`);
} }
return OpticsMessage.fromReceipt(context, nameOrDomain, receipt); return AbacusMessage.fromReceipt(context, nameOrDomain, receipt);
} }
/** /**
* Instantiate EXACTLY one message from a transaction has. * Instantiate EXACTLY one message from a transaction has.
* *
* @param context the {@link OpticsContext} object to use * @param context the {@link AbacusContext} object to use
* @param nameOrDomain the domain on which the receipt was logged * @param nameOrDomain the domain on which the receipt was logged
* @param receipt the receipt * @param receipt the receipt
* @returns an array of {@link OpticsMessage} objects * @returns an array of {@link AbacusMessage} objects
* @throws if there is no receipt for the TX, or if not EXACTLY 1 dispatch in * @throws if there is no receipt for the TX, or if not EXACTLY 1 dispatch in
* the receipt * the receipt
*/ */
static async singleFromTransactionHash( static async singleFromTransactionHash(
context: OpticsContext, context: AbacusContext,
nameOrDomain: string | number, nameOrDomain: string | number,
transactionHash: string, transactionHash: string,
): Promise<OpticsMessage> { ): Promise<AbacusMessage> {
const provider = context.mustGetProvider(nameOrDomain); const provider = context.mustGetProvider(nameOrDomain);
const receipt = await provider.getTransactionReceipt(transactionHash); const receipt = await provider.getTransactionReceipt(transactionHash);
if (!receipt) { if (!receipt) {
throw new Error(`No receipt for ${transactionHash} on ${nameOrDomain}`); throw new Error(`No receipt for ${transactionHash} on ${nameOrDomain}`);
} }
return OpticsMessage.singleFromReceipt(context, nameOrDomain, receipt); return AbacusMessage.singleFromReceipt(context, nameOrDomain, receipt);
} }
/** /**
@ -321,7 +321,7 @@ export class OpticsMessage {
* *
* @returns An array of {@link AnnotatedLifecycleEvent} objects * @returns An array of {@link AnnotatedLifecycleEvent} objects
*/ */
async events(): Promise<OpticsStatus> { async events(): Promise<AbacusStatus> {
const events: AnnotatedLifecycleEvent[] = [this.dispatch]; const events: AnnotatedLifecycleEvent[] = [this.dispatch];
// attempt to get Home update // attempt to get Home update
const homeUpdate = await this.getHomeUpdate(); const homeUpdate = await this.getHomeUpdate();

@ -2,11 +2,11 @@ import { BigNumber } from '@ethersproject/bignumber';
import { arrayify, hexlify } from '@ethersproject/bytes'; import { arrayify, hexlify } from '@ethersproject/bytes';
import { TransactionReceipt } from '@ethersproject/abstract-provider'; import { TransactionReceipt } from '@ethersproject/abstract-provider';
import { ethers } from 'ethers'; import { ethers } from 'ethers';
import { xapps } from 'optics-ts-interface'; import { xapps } from '@abacus-network/ts-interface';
import { BridgeContracts, OpticsContext } from '..'; import { BridgeContracts, AbacusContext } from '..';
import { ResolvedTokenInfo, TokenIdentifier } from '../tokens'; import { ResolvedTokenInfo, TokenIdentifier } from '../tokens';
import { OpticsMessage } from './OpticsMessage'; import { AbacusMessage } from './AbacusMessage';
import { AnnotatedDispatch } from '../events/opticsEvents'; import { AnnotatedDispatch } from '../events/abacusEvents';
const ACTION_LEN = { const ACTION_LEN = {
identifier: 1, identifier: 1,
@ -106,10 +106,10 @@ function parseBody(
} }
/** /**
* The BridgeMessage extends {@link OpticsMessage} with Bridge-specific * The BridgeMessage extends {@link AbacusMessage} with Bridge-specific
* functionality. * functionality.
*/ */
class BridgeMessage extends OpticsMessage { class BridgeMessage extends AbacusMessage {
readonly token: TokenIdentifier; readonly token: TokenIdentifier;
readonly fromBridge: BridgeContracts; readonly fromBridge: BridgeContracts;
readonly toBridge: BridgeContracts; readonly toBridge: BridgeContracts;
@ -118,7 +118,7 @@ class BridgeMessage extends OpticsMessage {
* @hideconstructor * @hideconstructor
*/ */
constructor( constructor(
context: OpticsContext, context: AbacusContext,
event: AnnotatedDispatch, event: AnnotatedDispatch,
token: TokenIdentifier, token: TokenIdentifier,
callerKnowsWhatTheyAreDoing: boolean, callerKnowsWhatTheyAreDoing: boolean,
@ -138,36 +138,36 @@ class BridgeMessage extends OpticsMessage {
/** /**
* Attempt to instantiate a BridgeMessage from an existing * Attempt to instantiate a BridgeMessage from an existing
* {@link OpticsMessage} * {@link AbacusMessage}
* *
* @param context The {@link OpticsContext} to use. * @param context The {@link AbacusContext} to use.
* @param opticsMessage The existing OpticsMessage * @param abacusMessage The existing AbacusMessage
* @returns A Bridge message * @returns A Bridge message
* @throws if the message cannot be parsed as a bridge message * @throws if the message cannot be parsed as a bridge message
*/ */
static fromOpticsMessage( static fromAbacusMessage(
context: OpticsContext, context: AbacusContext,
opticsMessage: OpticsMessage, abacusMessage: AbacusMessage,
): AnyBridgeMessage { ): AnyBridgeMessage {
const parsedMessageBody = parseBody(opticsMessage.message.body); const parsedMessageBody = parseBody(abacusMessage.message.body);
switch (parsedMessageBody.action.type) { switch (parsedMessageBody.action.type) {
case 'transfer': case 'transfer':
return new TransferMessage( return new TransferMessage(
context, context,
opticsMessage.dispatch, abacusMessage.dispatch,
parsedMessageBody as ParsedTransferMessage, parsedMessageBody as ParsedTransferMessage,
); );
case 'details': case 'details':
return new DetailsMessage( return new DetailsMessage(
context, context,
opticsMessage.dispatch, abacusMessage.dispatch,
parsedMessageBody as ParsedDetailsMessage, parsedMessageBody as ParsedDetailsMessage,
); );
case 'requestDetails': case 'requestDetails':
return new RequestDetailsMessage( return new RequestDetailsMessage(
context, context,
opticsMessage.dispatch, abacusMessage.dispatch,
parsedMessageBody as ParsedRequestDetailsMesasage, parsedMessageBody as ParsedRequestDetailsMesasage,
); );
} }
@ -176,32 +176,32 @@ class BridgeMessage extends OpticsMessage {
/** /**
* Attempt to instantiate some BridgeMessages from a transaction receipt * Attempt to instantiate some BridgeMessages from a transaction receipt
* *
* @param context The {@link OpticsContext} to use. * @param context The {@link AbacusContext} to use.
* @param nameOrDomain the domain on which the receipt was logged * @param nameOrDomain the domain on which the receipt was logged
* @param receipt The receipt * @param receipt The receipt
* @returns an array of {@link BridgeMessage} objects * @returns an array of {@link BridgeMessage} objects
* @throws if any message cannot be parsed as a bridge message * @throws if any message cannot be parsed as a bridge message
*/ */
static fromReceipt( static fromReceipt(
context: OpticsContext, context: AbacusContext,
nameOrDomain: string | number, nameOrDomain: string | number,
receipt: TransactionReceipt, receipt: TransactionReceipt,
): AnyBridgeMessage[] { ): AnyBridgeMessage[] {
const opticsMessages: OpticsMessage[] = OpticsMessage.fromReceipt( const abacusMessages: AbacusMessage[] = AbacusMessage.fromReceipt(
context, context,
nameOrDomain, nameOrDomain,
receipt, receipt,
); );
const bridgeMessages: AnyBridgeMessage[] = []; const bridgeMessages: AnyBridgeMessage[] = [];
for (const opticsMessage of opticsMessages) { for (const abacusMessage of abacusMessages) {
try { try {
const bridgeMessage = BridgeMessage.fromOpticsMessage( const bridgeMessage = BridgeMessage.fromAbacusMessage(
context, context,
opticsMessage, abacusMessage,
); );
bridgeMessages.push(bridgeMessage); bridgeMessages.push(bridgeMessage);
} catch (e) { } catch (e) {
// catch error if OpticsMessage isn't a BridgeMessage // catch error if AbacusMessage isn't a BridgeMessage
} }
} }
return bridgeMessages; return bridgeMessages;
@ -210,7 +210,7 @@ class BridgeMessage extends OpticsMessage {
/** /**
* Attempt to instantiate EXACTLY one BridgeMessage from a transaction receipt * Attempt to instantiate EXACTLY one BridgeMessage from a transaction receipt
* *
* @param context The {@link OpticsContext} to use. * @param context The {@link AbacusContext} to use.
* @param nameOrDomain the domain on which the receipt was logged * @param nameOrDomain the domain on which the receipt was logged
* @param receipt The receipt * @param receipt The receipt
* @returns an array of {@link BridgeMessage} objects * @returns an array of {@link BridgeMessage} objects
@ -218,7 +218,7 @@ class BridgeMessage extends OpticsMessage {
* is not EXACTLY 1 BridgeMessage in the receipt * is not EXACTLY 1 BridgeMessage in the receipt
*/ */
static singleFromReceipt( static singleFromReceipt(
context: OpticsContext, context: AbacusContext,
nameOrDomain: string | number, nameOrDomain: string | number,
receipt: TransactionReceipt, receipt: TransactionReceipt,
): AnyBridgeMessage { ): AnyBridgeMessage {
@ -237,14 +237,14 @@ class BridgeMessage extends OpticsMessage {
* Attempt to instantiate some BridgeMessages from a transaction hash by * Attempt to instantiate some BridgeMessages from a transaction hash by
* retrieving and parsing the receipt. * retrieving and parsing the receipt.
* *
* @param context The {@link OpticsContext} to use. * @param context The {@link AbacusContext} to use.
* @param nameOrDomain the domain on which the receipt was logged * @param nameOrDomain the domain on which the receipt was logged
* @param transactionHash The transaction hash * @param transactionHash The transaction hash
* @returns an array of {@link BridgeMessage} objects * @returns an array of {@link BridgeMessage} objects
* @throws if any message cannot be parsed as a bridge message * @throws if any message cannot be parsed as a bridge message
*/ */
static async fromTransactionHash( static async fromTransactionHash(
context: OpticsContext, context: AbacusContext,
nameOrDomain: string | number, nameOrDomain: string | number,
transactionHash: string, transactionHash: string,
): Promise<AnyBridgeMessage[]> { ): Promise<AnyBridgeMessage[]> {
@ -260,7 +260,7 @@ class BridgeMessage extends OpticsMessage {
* Attempt to instantiate EXACTLY one BridgeMessages from a transaction hash * Attempt to instantiate EXACTLY one BridgeMessages from a transaction hash
* by retrieving and parsing the receipt. * by retrieving and parsing the receipt.
* *
* @param context The {@link OpticsContext} to use. * @param context The {@link AbacusContext} to use.
* @param nameOrDomain the domain on which the receipt was logged * @param nameOrDomain the domain on which the receipt was logged
* @param transactionHash The transaction hash * @param transactionHash The transaction hash
* @returns an array of {@link BridgeMessage} objects * @returns an array of {@link BridgeMessage} objects
@ -268,7 +268,7 @@ class BridgeMessage extends OpticsMessage {
* not EXACTLY one such message * not EXACTLY one such message
*/ */
static async singleFromTransactionHash( static async singleFromTransactionHash(
context: OpticsContext, context: AbacusContext,
nameOrDomain: string | number, nameOrDomain: string | number,
transactionHash: string, transactionHash: string,
): Promise<AnyBridgeMessage> { ): Promise<AnyBridgeMessage> {
@ -327,7 +327,7 @@ export class TransferMessage extends BridgeMessage {
action: Transfer; action: Transfer;
constructor( constructor(
context: OpticsContext, context: AbacusContext,
event: AnnotatedDispatch, event: AnnotatedDispatch,
parsed: ParsedTransferMessage, parsed: ParsedTransferMessage,
) { ) {
@ -381,7 +381,7 @@ export class DetailsMessage extends BridgeMessage {
action: Details; action: Details;
constructor( constructor(
context: OpticsContext, context: AbacusContext,
event: AnnotatedDispatch, event: AnnotatedDispatch,
parsed: ParsedDetailsMessage, parsed: ParsedDetailsMessage,
) { ) {
@ -419,7 +419,7 @@ export class RequestDetailsMessage extends BridgeMessage {
action: RequestDetails; action: RequestDetails;
constructor( constructor(
context: OpticsContext, context: AbacusContext,
event: AnnotatedDispatch, event: AnnotatedDispatch,
parsed: ParsedRequestDetailsMesasage, parsed: ParsedRequestDetailsMesasage,
) { ) {

@ -1,4 +1,4 @@
export { OpticsMessage } from './OpticsMessage'; export { AbacusMessage } from './AbacusMessage';
export { export {
TransferMessage, TransferMessage,
DetailsMessage, DetailsMessage,

@ -1,5 +1,5 @@
import { BytesLike } from 'ethers'; import { BytesLike } from 'ethers';
import { xapps } from 'optics-ts-interface'; import { xapps } from '@abacus-network/ts-interface';
import wellKnown from './wellKnown'; import wellKnown from './wellKnown';
import testnetWellKnown from './testnetWellKnown'; import testnetWellKnown from './testnetWellKnown';

@ -5,9 +5,9 @@ export {
dev, dev,
testnet, testnet,
mainnet, mainnet,
OpticsContext, AbacusContext,
OpticsStatus, AbacusStatus,
OpticsMessage, AbacusMessage,
OpticsLifecyleEvent, AbacusLifecyleEvent,
Annotated, Annotated,
} from './optics'; } from './abacus';

@ -11,7 +11,7 @@ type Provider = ethers.providers.Provider;
* connections under a single roof. * connections under a single roof.
* *
* @example * @example
* import {mainnet} from 'optics-provider'; * import {mainnet} from '@abacus-network/sdk';
* mainnet.registerRpcProvider('celo', 'https://forno.celo.org'); * mainnet.registerRpcProvider('celo', 'https://forno.celo.org');
* mainnet.registerRpcProvider('polygon', '...'); * mainnet.registerRpcProvider('polygon', '...');
* mainnet.registerRpcProvider('ethereum', '...'); * mainnet.registerRpcProvider('ethereum', '...');

@ -23,7 +23,7 @@ export function canonizeId(data: BytesLike): Uint8Array {
} }
/** /**
* Converts an Optics ID of 20 or 32 bytes to the corresponding EVM Address. * Converts an Abacus ID of 20 or 32 bytes to the corresponding EVM Address.
* *
* For 32-byte IDs this enforces the EVM convention of using the LAST 20 bytes. * For 32-byte IDs this enforces the EVM convention of using the LAST 20 bytes.
* *

@ -0,0 +1,18 @@
{
"extends": "../tsconfig.package.json",
"compilerOptions": {
"outDir": "./dist/",
"rootDir": "./src/"
},
"exclude": ["./node_modules/", "./dist/", "./src/tmp.ts"],
"include": [
"./src/*.ts",
"src/abacus/*.ts",
"src/abacus/contracts/*.ts",
"src/abacus/domains/*.ts",
"src/abacus/events/*.ts",
"src/abacus/govern/*.ts",
"src/abacus/messages/*.ts",
"src/abacus/tokens/*.ts"
]
}

File diff suppressed because it is too large Load Diff

@ -1,18 +0,0 @@
{
"extends": "../tsconfig.package.json",
"compilerOptions": {
"outDir": "./dist/",
"rootDir": "./src/"
},
"exclude": ["./node_modules/", "./dist/", "./src/tmp.ts"],
"include": [
"./src/*.ts",
"./src/optics/*.ts",
"./src/optics/contracts/*.ts",
"./src/optics/domains/*.ts",
"./src/optics/events/*.ts",
"./src/optics/govern/*.ts",
"./src/optics/messages/*.ts",
"./src/optics/tokens/*.ts"
]
}
Loading…
Cancel
Save