Skip to content

Commit

Permalink
ALL-4358 Update Flare web3 (#1058)
Browse files Browse the repository at this point in the history
  • Loading branch information
Hathoriel authored Feb 7, 2024
1 parent 8989a30 commit 21cc26f
Show file tree
Hide file tree
Showing 7 changed files with 4 additions and 22 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "tatumio",
"version": "2.2.45",
"version": "2.2.46",
"license": "MIT",
"repository": "https://github.com/tatumio/tatum-js",
"scripts": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ const blockchain = Blockchain.<%= blockchain %>
export const Tatum<%= firstLetterUpperCaseName %>SDK = (args: SDKArguments) => {
const web3 = <%= name %>Web3({
blockchain,
apiCalls: {
getFee: BlockchainFeesService.getBlockchainFee,
},
})
const api = <%= firstLetterUpperCaseName %>Service
const txService = <%= name %>Tx({ blockchain, web3 })
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ import { BlockchainFeesService } from '@tatumio/api-client'
export const <%= name %>Web3 = (args: {
blockchain: EvmBasedBlockchain
client?: Web3
apiCalls: {
getFee: typeof BlockchainFeesService.getBlockchainFee
}
}) => {
const evmBasedWeb3Result = evmBasedWeb3(args)

Expand All @@ -24,8 +21,5 @@ export const <%= name %>Web3 = (args: {

return web3
},
async getGasPriceInWei(): Promise<string> {
return (await args.apiCalls.getFee('<%= currency %>')).medium.toString()
},
}
}
2 changes: 1 addition & 1 deletion packages/blockchain/egld/src/lib/__tests__/egld.tx.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ describe('EgldSDK - virtual account tx', () => {
expect(parsedTx.sender).toBe(testData.ADDRESS_0)
expect(parsedTx.receiver).toBe(ESDT_SYSTEM_SMART_CONTRACT_ADDRESS)
expect(parsedTx.signature).toBeDefined()
})
}, 10000)

it('should prepare send ESDT signed transaction', async () => {
const tx = await sdk.transaction.prepare.signedTransaction({
Expand Down
3 changes: 0 additions & 3 deletions packages/blockchain/flare/src/lib/flare.sdk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@ const blockchain = Blockchain.FLR
export const TatumFlareSDK = (args: SDKArguments) => {
const web3 = flareWeb3({
blockchain,
apiCalls: {
getFee: BlockchainFeesService.getBlockchainFee,
},
})
const api = FlareService
const txService = flareTx({ blockchain, web3 })
Expand Down
8 changes: 1 addition & 7 deletions packages/blockchain/flare/src/lib/services/flare.web3.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,7 @@ import Web3 from 'web3'
import { EvmBasedBlockchain } from '@tatumio/shared-core'
import { BlockchainFeesService } from '@tatumio/api-client'

export const flareWeb3 = (args: {
blockchain: EvmBasedBlockchain
client?: Web3
apiCalls: {
getFee: typeof BlockchainFeesService.getBlockchainFee
}
}) => {
export const flareWeb3 = (args: { blockchain: EvmBasedBlockchain; client?: Web3 }) => {
const evmBasedWeb3Result = evmBasedWeb3(args)

return {
Expand Down
2 changes: 1 addition & 1 deletion packages/blockchain/polygon/src/lib/polygon.sdk.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ describe('TatumPolygonSDK', () => {

expect(client.result).toBeDefined()
expect(String(client.result).length).toBeGreaterThan(0)
})
}, 10000)

it('should return valid web3 client with privateKey', async () => {
const web3 = evmBasedWeb3({ blockchain: Blockchain.POLYGON })
Expand Down

0 comments on commit 21cc26f

Please sign in to comment.