Skip to content

Commit

Permalink
Bump wallet pro (#502)
Browse files Browse the repository at this point in the history
* Update wallet provider

* Fix prettier

* Fix code smell in deployer.ts
  • Loading branch information
Ben-Rey authored Nov 22, 2023
1 parent 38d4a88 commit 08affbe
Show file tree
Hide file tree
Showing 8 changed files with 65 additions and 173 deletions.
3 changes: 2 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ node_modules
.github
bundle.*
docs
dist
dist
scripts
25 changes: 17 additions & 8 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,13 +1,22 @@
build
node_modules
.env*
.eslintignore
.eslintrc.cjs
.github
bundle.*
docs
dist
*.json
.gitignore
.husky
.lintstagedrc
README.md
.npmignore
.prettierignore
*.html
*.json
*.md
*.wasm
build
bundle.*
coverage
.eslintrc.cjs
dist
docs
node_modules
scripts
README.md
LICENSE
180 changes: 26 additions & 154 deletions package-lock.json

Large diffs are not rendered by default.

13 changes: 10 additions & 3 deletions packages/massa-web3/examples/smartContracts/deployer.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
/* eslint-disable no-console */
/* eslint-disable @typescript-eslint/no-var-requires */
import { IContractData } from '../../src/interfaces/IContractData';
import { Client } from '../../src/web3/Client';
import { EOperationStatus } from '../../src/interfaces/EOperationStatus';

import { readFileSync } from 'fs';

import { Args, fromMAS, u64ToBytes, u8toByte } from '../../src';
import {
Args,
MAX_GAS_DEPLOYMENT,
fromMAS,
u64ToBytes,
u8toByte,
} from '../../src';
import { IBaseAccount } from '../../src/interfaces/IBaseAccount';
const path = require('path');
const chalk = require('chalk');
Expand Down Expand Up @@ -71,10 +78,10 @@ export async function awaitTxConfirmation(
export const deploySmartContracts = async (
contractsToDeploy: ISCData[],
web3Client: Client,
deployerAccount: IBaseAccount,
fee = 0n,
maxGas = 1_000_000n,
maxGas = MAX_GAS_DEPLOYMENT,
maxCoins = fromMAS(0.1),
deployerAccount: IBaseAccount,
): Promise<string> => {
let deploymentOperationId: string;
try {
Expand Down
3 changes: 2 additions & 1 deletion packages/massa-web3/examples/smartContracts/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* eslint-disable @typescript-eslint/no-var-requires */
/* eslint-disable no-console */
import { IAccount } from '../../src/interfaces/IAccount';
import { IEventFilter } from '../../src/interfaces/IEventFilter';
import { ClientFactory } from '../../src/web3/ClientFactory';
Expand Down Expand Up @@ -225,10 +226,10 @@ const pollAsyncEvents = async (
},
],
web3Client,
baseAccount,
0n,
1_000_000n,
fromMAS(0.2),
baseAccount,
);

spinner.succeed(
Expand Down
1 change: 1 addition & 0 deletions packages/massa-web3/examples/wallet/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* eslint-disable @typescript-eslint/no-var-requires */
/* eslint-disable no-console */
import { IAccount } from '../../src/interfaces/IAccount';
import { IEventFilter } from '../../src/interfaces/IEventFilter';
import { ClientFactory } from '../../src/web3/ClientFactory';
Expand Down
6 changes: 3 additions & 3 deletions packages/massa-web3/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@massalabs/massa-web3",
"version": "2.2.4",
"version": "2.2.5",
"description": "massa's web3 sdk client",
"main": "dist/cmd/index.js",
"module": "dist/esm/index.js",
Expand Down Expand Up @@ -45,7 +45,7 @@
"bundle.min.js"
],
"dependencies": {
"@massalabs/wallet-provider": "^1.4.1",
"@massalabs/wallet-provider": "^1.5.1",
"@massalabs/web3-utils": "^1.4.3",
"@noble/ed25519": "^1.7.3",
"@noble/hashes": "^1.2.0",
Expand Down Expand Up @@ -74,8 +74,8 @@
"@typescript-eslint/parser": "^5.52.0",
"babel-jest": "^29.7.0",
"chalk": "^4.1.0",
"jest-environment-jsdom": "^29.5.0",
"jest": "^29.5.0",
"jest-environment-jsdom": "^29.5.0",
"jsdom": "^21.1.1",
"node-ts": "^5.1.2",
"npm-run-all": "^4.1.5",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { IBaseAccount } from '../../interfaces/IBaseAccount';
import { IAccount } from '@massalabs/wallet-provider';
import { IAccount, ITransactionDetails } from '@massalabs/wallet-provider';
import { ISignature } from '../../interfaces/ISignature';
import { IRollsData } from '../../interfaces/IRollsData';
import { ITransactionData } from '../../interfaces/ITransactionData';
Expand Down Expand Up @@ -60,15 +60,16 @@ export class WalletProviderAccount implements IBaseAccount {
paramToSend = params;
}

let res = await this.account.callSC(
let res = (await this.account.callSC(
callData.targetAddress,
callData.functionName,
paramToSend,
callData.coins,
callData.fee,
callData.maxGas,
false,
);
)) as ITransactionDetails;

return res.operationId;
}

Expand Down

0 comments on commit 08affbe

Please sign in to comment.