Skip to content

Commit bc27319

Browse files
committed
fix: replace default exports with named ones
1 parent a97f367 commit bc27319

File tree

11 files changed

+17
-21
lines changed

11 files changed

+17
-21
lines changed

src/LowLevel/ContractWrapperFactory/ContractWrapperFactory.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Context } from '../LowLevel';
22
import { SecurityToken } from '../SecurityToken';
33

4-
export default class ContractWrapperFactory {
4+
export class ContractWrapperFactory {
55
static packVersion(versions: number[]) {
66
return versions.join('.');
77
}
@@ -11,15 +11,15 @@ export default class ContractWrapperFactory {
1111
*/
1212
static wrapContract = async (contractName: string, address: string, context: Context) => {
1313
// First, wrap this address with a 'stub' wrapper in order to get deployed contract's version.
14-
const stubAbi = (await import(`../${contractName}/stub.abi`)).default;
15-
const stubClass = (await import(`../${contractName}/stub`)).default;
14+
const stubAbi = (await import(`../${contractName}/stub.abi`)).StubAbi;
15+
const stubClass = (await import(`../${contractName}/stub`)).Stub;
1616
const stubLowLevelContract = new stubClass({ address, abi: stubAbi, context });
1717

1818
const versionArray = await stubLowLevelContract.getVersion();
1919
const packedVersion = ContractWrapperFactory.packVersion(versionArray);
2020

2121
// Now that we know deployed contract version, we'll wrap it with a version specific contract wrapper.
22-
const ContractWrapper = (await import(`../${contractName}/${packedVersion}`)).default;
22+
const ContractWrapper = (await import(`../${contractName}/${packedVersion}`))[contractName];
2323
const wrappedContract = new ContractWrapper({ address, context });
2424
return wrappedContract;
2525
};
Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1 @@
1-
import ContractWrapperFactory from './ContractWrapperFactory';
2-
3-
export default ContractWrapperFactory;
1+
export { ContractWrapperFactory } from './ContractWrapperFactory';

src/LowLevel/DividendCheckpoint.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import {
2020
DividendModuleTypes,
2121
} from './types';
2222
import { fromUnixTimestamp, fromWei, toWei, fromDivisible, toAscii, getOptions } from './utils';
23-
import ContractWrapperFactory from './ContractWrapperFactory';
23+
import { ContractWrapperFactory } from './ContractWrapperFactory';
2424

2525
interface InternalDividend {
2626
checkpointId: string;

src/LowLevel/SecurityToken/2.0.0.abi.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export default [
1+
export const SecurityTokenAbi = [
22
{
33
constant: true,
44
inputs: [],

src/LowLevel/SecurityToken/2.0.0.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import {
1717
TokenSetControllerArgs,
1818
} from '../types';
1919

20-
import SecurityTokenAbi from './2.0.0.abi';
20+
import { SecurityTokenAbi } from './2.0.0.abi';
2121
import { Context } from '../LowLevel';
2222
import { fromUnixTimestamp, fromWei, getOptions, toWei, toAscii, asciiToHex } from '../utils';
2323
import { Erc20DividendCheckpoint } from '../Erc20DividendCheckpoint';
@@ -89,7 +89,7 @@ interface SecurityTokenContract extends GenericContract {
8989
};
9090
}
9191

92-
export default class SecurityToken extends Contract<SecurityTokenContract> {
92+
export class SecurityToken extends Contract<SecurityTokenContract> {
9393
constructor({ address, context }: { address: string; context: Context }) {
9494
super({ address, abi: SecurityTokenAbi, context });
9595
}

src/LowLevel/SecurityToken/3.0.0.abi.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export default [
1+
export const SecurityTokenAbi = [
22
{
33
constant: true,
44
inputs: [],

src/LowLevel/SecurityToken/3.0.0.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import {
1717
TokenSetControllerArgs,
1818
} from '../types';
1919

20-
import SecurityTokenAbi from './3.0.0.abi';
20+
import { SecurityTokenAbi } from './3.0.0.abi';
2121
import { Context } from '../LowLevel';
2222
import { fromUnixTimestamp, fromWei, getOptions, toWei, toAscii, asciiToHex } from '../utils';
2323
import { Erc20DividendCheckpoint } from '../Erc20DividendCheckpoint';
@@ -89,7 +89,7 @@ interface SecurityTokenContract extends GenericContract {
8989
};
9090
}
9191

92-
export default class SecurityToken extends Contract<SecurityTokenContract> {
92+
export class SecurityToken extends Contract<SecurityTokenContract> {
9393
constructor({ address, context }: { address: string; context: Context }) {
9494
super({ address, abi: SecurityTokenAbi, context });
9595
}

src/LowLevel/SecurityToken/index.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1 @@
1-
import SecurityToken from './3.0.0';
2-
3-
export { SecurityToken };
1+
export { SecurityToken } from './3.0.0';

src/LowLevel/SecurityToken/stub.abi.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export default [
1+
export const StubAbi = [
22
{
33
constant: true,
44
inputs: [],

src/LowLevel/SecurityToken/stub.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@ import { GenericContract } from '../types';
33
import { Context } from '../LowLevel';
44
import { Contract } from '../Contract';
55

6-
interface SecurityTokenContract extends GenericContract {
6+
interface StubContract extends GenericContract {
77
methods: {
88
getVersion(): TransactionObject<number[]>;
99
};
1010
}
1111

12-
export default class SecurityToken extends Contract<SecurityTokenContract> {
12+
export class Stub extends Contract<StubContract> {
1313
constructor({ address, abi, context }: { address: string; abi: any; context: Context }) {
1414
super({ address, abi, context });
1515
}

0 commit comments

Comments
 (0)