Skip to content

Commit

Permalink
Feat : contract abis path on dist
Browse files Browse the repository at this point in the history
  • Loading branch information
SonYoungsung committed Jan 16, 2024
1 parent 3b3e2cf commit bd414b4
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions packages/sdk/constants/config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const contractsDataPath = '../../../contracts/data'
3 changes: 2 additions & 1 deletion packages/sdk/utils/contract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import {
TokamakTokenList,
TokamakTokenListT,
} from './getList'
import { contractsDataPath } from '../constants/config'

const TOKEN_LIST = TokamakTokenList
const CONTRACT_ADDRESSES = TokamakContractList
Expand All @@ -25,7 +26,7 @@ const CONTRACT_ADDRESSES = TokamakContractList
* Caching abi files
*/
const cache = new Map()
const dir = path.resolve(__dirname, '../../../contracts/data')
const dir = path.resolve(__dirname, contractsDataPath)
const getContractInterface = (contractName: string) => {
try {
if (cache.has(contractName)) {
Expand Down
4 changes: 2 additions & 2 deletions test/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@

// import { ethers } from 'ethers'

// import { TitanSDK } from '../dist/packages'
import { TitanSDK } from '../dist/packages'
// import { TitanSDK } from '../packages'
// import {TitanSDK} from "@titan/github"
import { TitanSDK } from '../packages'
// import { TitanSDK } from '../packages'

const init = async () => {
const sdk = new TitanSDK({
Expand Down
2 changes: 1 addition & 1 deletion titan.tokenlist.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"layer2",
"infrastructure"
],
"timestamp": "2024-01-16T05:10:38.788Z",
"timestamp": "2024-01-16T05:51:07.762Z",
"tokens": [
{
"chainId": 1,
Expand Down
3 changes: 1 addition & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,8 @@
"titan.tokenlist.json",
"tokamak.contractlist.json",
"package.json",
"tokens/**/*",
"bin/**/*",
"contract/**/*",
"contracts/data/**/abi/*.json",
"packages",
"packages/**/**/*.json"
]
Expand Down

0 comments on commit bd414b4

Please sign in to comment.