Skip to content

Commit 854b8d0

Browse files
authored
Merge pull request #16 from trustwallet/feat/npm-publish
Feat/npm publish
2 parents 032749b + e2d3c59 commit 854b8d0

File tree

14 files changed

+69
-10
lines changed

14 files changed

+69
-10
lines changed

.github/workflows/publish.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Publish Package to npmjs
2+
on:
3+
release:
4+
types: [published]
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v3
10+
# Setup .npmrc file to publish to npm
11+
- uses: actions/setup-node@v3
12+
with:
13+
node-version: "16.x"
14+
registry-url: "https://registry.npmjs.org"
15+
- run: yarn install --frozen-lockfile
16+
- run: yarn build
17+
- run: npm publish --access public
18+
env:
19+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,4 @@ build/Release
2828
# Dependency directory
2929
node_modules
3030

31+
lib

package.json

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,20 @@
11
{
2-
"name": "wizard-sdk",
2+
"name": "@trustwallet/wizard-sdk",
33
"version": "0.0.1",
44
"description": "typescript sdk to visualize EIP-712 various protocols, simulate and decode transactions",
5-
"main": "index.js",
5+
"main": "lib/index.js",
66
"repository": "git@github.com:trustwallet/wizard-sdk.git",
77
"author": "Abdou <118254027+a6-dou@users.noreply.github.com>",
88
"license": "BSD",
9+
"keywords": [
10+
"web3",
11+
"EIP-712",
12+
"Simulation"
13+
],
914
"scripts": {
1015
"test": "jest",
11-
"coverage": "jest --coverage"
16+
"coverage": "jest --coverage",
17+
"build": "tsc --project ./tsconfig.build.json"
1218
},
1319
"devDependencies": {
1420
"@types/jest": "^29.5.0",
@@ -23,5 +29,12 @@
2329
"@typescript-eslint/parser": "^5.55.0",
2430
"eslint": "^8.36.0",
2531
"ethers": "^6.1.0"
26-
}
32+
},
33+
"files": [
34+
"lib/",
35+
"LICENSE",
36+
"README.md",
37+
"node_module",
38+
"package.json"
39+
]
2740
}

src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * as visualizer from "./visualizer";

src/types/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ export type Result = {
4545
liveness?: Liveness;
4646
assetIn: AssetInOut[];
4747
assetOut: AssetInOut[];
48-
approval?: Approval[];
48+
approval: Approval[];
4949
};
5050

5151
export type Protocol<T> = {

src/visualizer/blur-io/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ export const visualize = (message: BlurIoOrder, domain: Domain): Result => {
7878
from: Number(message.listingTime) * 1000,
7979
to: Number(message.expirationTime) * 1000,
8080
},
81+
approval: [],
8182
};
8283
};
8384

src/visualizer/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
import { Domain, PermitMessage, Result } from "../types";
32

43
import { SeaPortPayload } from "../types/seaport";

src/visualizer/looksrare/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ export const visualize = (
7676
from: Number(message.startTime) * 1000,
7777
to: Number(message.endTime) * 1000,
7878
},
79+
approval: [],
7980
};
8081
};
8182

src/visualizer/seaport/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ export const visualize = (message: SeaPortPayload, domain: Domain): Result => {
126126
},
127127
assetIn,
128128
assetOut,
129+
approval: [],
129130
};
130131
};
131132

test/visualizer/blur-io/index.test.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ describe("blur.io", () => {
4242
amounts: ["1"],
4343
},
4444
],
45+
approval: [],
4546
liveness: { from: 1677736151000, to: 1678340951000 },
4647
});
4748
});
@@ -66,6 +67,7 @@ describe("blur.io", () => {
6667
amounts: ["800000000000000000"],
6768
},
6869
],
70+
approval: [],
6971
liveness: { from: 1677736151000, to: 1678340951000 },
7072
});
7173
});
@@ -89,6 +91,7 @@ describe("blur.io", () => {
8991
amounts: ["10000000000000000"],
9092
},
9193
],
94+
approval: [],
9295
liveness: { from: 1678461048000, to: 1709997048000 },
9396
});
9497
});
@@ -116,6 +119,7 @@ describe("blur.io", () => {
116119
amounts: ["800000000000000000"],
117120
},
118121
],
122+
approval: [],
119123
liveness: { from: 1677736151000, to: 1678340951000 },
120124
});
121125
});

0 commit comments

Comments
 (0)