Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ALL-4358 Update Flare web3 #1058

Merged
merged 1 commit into from
Feb 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading