Skip to content

Commit 5e42b41

Browse files
fix: sdk not built for nodejs
1 parent 579e604 commit 5e42b41

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+322
-194
lines changed

package.json

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,12 @@
5050
"uuid": "^3.3.2",
5151
"web3": "1.0.0-beta.30"
5252
},
53+
"browserslist": [
54+
"last 1 version",
55+
"> 1%",
56+
"maintained node versions",
57+
"not dead"
58+
],
5359
"devDependencies": {
5460
"@babel/core": "^7.2.0",
5561
"@babel/plugin-proposal-class-properties": "^7.4.0",
@@ -64,6 +70,7 @@
6470
"@types/semver": "^5.5.0",
6571
"@types/uuid": "^3.4.4",
6672
"@types/web3": "^1.0.18",
73+
"awesome-typescript-loader": "^5.2.1",
6774
"babel-core": "^7.0.0-bridge.0",
6875
"babel-jest": "^23.6.0",
6976
"babel-loader": "^8.0.5",
@@ -74,11 +81,12 @@
7481
"reflect-metadata": "^0.1.12",
7582
"regenerator-runtime": "^0.13.1",
7683
"semantic-release": "^16.0.0-beta.18",
84+
"ts-loader": "^5.3.3",
7785
"tsconfig-paths": "^3.7.0",
7886
"tsconfig-paths-webpack-plugin": "^3.2.0",
7987
"tslint": "^5.15.0",
8088
"tslint-config-prettier": "^1.18.0",
81-
"ttypescript": "1.5.6",
89+
"ttypescript": "^1.5.6",
8290
"typescript": "3.2.4",
8391
"web3-core-promievent": "^1.0.0-beta.37",
8492
"webpack": "^4.29.6",

src/Context.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import { PolyToken } from '~/LowLevel/PolyToken';
2-
import { PolymathRegistry } from '~/LowLevel/PolymathRegistry';
3-
import { SecurityTokenRegistry } from '~/LowLevel/SecurityTokenRegistry';
4-
import { ModuleRegistry } from '~/LowLevel/ModuleRegistry';
5-
import { Erc20 } from '~/LowLevel/Erc20';
6-
import { Wallet } from '~/Wallet';
1+
import { PolyToken } from './LowLevel/PolyToken';
2+
import { PolymathRegistry } from './LowLevel/PolymathRegistry';
3+
import { SecurityTokenRegistry } from './LowLevel/SecurityTokenRegistry';
4+
import { ModuleRegistry } from './LowLevel/ModuleRegistry';
5+
import { Erc20 } from './LowLevel/Erc20';
6+
import { Wallet } from './Wallet';
77

88
interface Params {
99
polyToken: PolyToken;

src/LowLevel/Erc20.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import {
1111
} from './types';
1212
import { fromDivisible, toDivisible, toAscii } from './utils';
1313
import BigNumber from 'bignumber.js';
14-
import { web3 } from '~/LowLevel/web3Client';
14+
import { web3 } from '../LowLevel/web3Client';
1515

1616
interface Erc20Contract extends GenericContract {
1717
methods: {

src/LowLevel/LowLevel.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ a browser, make sure you have MetaMask installed and enabled.`
142142
};
143143

144144
private getBrowserProvider = () => {
145-
if (!window) {
145+
if (typeof window === 'undefined') {
146146
return null;
147147
}
148148

src/Polymath.ts

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
import { HttpProvider } from 'web3/providers';
2-
import { PolyToken } from '~/LowLevel/PolyToken';
3-
import { LowLevel } from '~/LowLevel';
4-
import { PolymathRegistry } from '~/LowLevel/PolymathRegistry';
5-
import { SecurityTokenRegistry } from '~/LowLevel/SecurityTokenRegistry';
6-
import { SecurityToken } from '~/LowLevel/SecurityToken';
7-
import { Context } from '~/Context';
8-
import { ModuleRegistry } from '~/LowLevel/ModuleRegistry';
9-
import { TaxWithholdingEntry } from '~/types';
2+
import { PolyToken } from './LowLevel/PolyToken';
3+
import { LowLevel } from './LowLevel';
4+
import { PolymathRegistry } from './LowLevel/PolymathRegistry';
5+
import { SecurityTokenRegistry } from './LowLevel/SecurityTokenRegistry';
6+
import { SecurityToken } from './LowLevel/SecurityToken';
7+
import { Context } from './Context';
8+
import { ModuleRegistry } from './LowLevel/ModuleRegistry';
9+
import { TaxWithholdingEntry } from './types';
1010
import {
1111
Dividend as LowLevelDividend,
1212
Checkpoint as LowLevelCheckpoint,
1313
DividendModuleTypes,
14-
} from '~/LowLevel/types';
14+
} from './LowLevel/types';
1515
import {
1616
Dividend as DividendEntity,
1717
Checkpoint as CheckpointEntity,
@@ -20,7 +20,7 @@ import {
2020
Erc20DividendsModule as Erc20DividendsModuleEntity,
2121
EthDividendsModule as EthDividendsModuleEntity,
2222
Erc20TokenBalance as Erc20TokenBalanceEntity,
23-
} from '~/entities';
23+
} from './entities';
2424

2525
import {
2626
ReserveSecurityToken,
@@ -32,12 +32,12 @@ import {
3232
PushDividendPayment,
3333
WithdrawTaxes,
3434
} from './procedures';
35-
import { CreateSecurityToken } from '~/procedures/CreateSecurityToken';
36-
import { Entity } from '~/entities/Entity';
37-
import { PolymathNetworkParams } from '~/types';
35+
import { CreateSecurityToken } from './procedures/CreateSecurityToken';
36+
import { Entity } from './entities/Entity';
37+
import { PolymathNetworkParams } from './types';
3838
import BigNumber from 'bignumber.js';
3939
import { includes } from 'lodash';
40-
import { SetDividendsWallet } from '~/procedures/SetDividendsWallet';
40+
import { SetDividendsWallet } from './procedures/SetDividendsWallet';
4141

4242
// TODO @RafaelVidaurre: Type this correctly. It should return a contextualized
4343
// version of T

src/PolymathError.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { ErrorCodes } from '~/types';
1+
import { ErrorCodes } from './types';
22

33
export const ErrorMessagesPerCode: {
44
[errorCode: string]: string;

src/browserUtils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import Web3 from 'web3';
2-
import { PolymathError } from '~/PolymathError';
3-
import { ErrorCodes } from '~/types';
2+
import { PolymathError } from './PolymathError';
3+
import { ErrorCodes } from './types';
44
import { HttpProvider } from 'web3/providers';
55
import { delay } from './utils';
66

src/entities/Checkpoint.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import { Polymath } from '~/Polymath';
1+
import { Polymath } from '../Polymath';
22
import { Entity } from './Entity';
3-
import { serialize } from '~/utils';
3+
import { serialize } from '../utils';
44
import { Dividend } from './Dividend';
5-
import { InvestorBalance } from '~/types';
5+
import { InvestorBalance } from '../types';
66
import BigNumber from 'bignumber.js';
77

88
interface Params {

src/entities/Dividend.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import { Polymath } from '~/Polymath';
1+
import { Polymath } from '../Polymath';
22
import { Entity } from './Entity';
3-
import { serialize } from '~/utils';
3+
import { serialize } from '../utils';
44
import BigNumber from 'bignumber.js';
5-
import { DividendModuleTypes, DividendInvestorStatus } from '~/types';
5+
import { DividendModuleTypes, DividendInvestorStatus } from '../types';
66

77
interface Params {
88
index: number;

src/entities/DividendsModule.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Polymath } from '~/Polymath';
1+
import { Polymath } from '../Polymath';
22
import { Entity } from './Entity';
33

44
export interface Params {

0 commit comments

Comments
 (0)