Skip to content

Commit

Permalink
Release @argent-x/extension@6.9.1
Browse files Browse the repository at this point in the history
  • Loading branch information
gergold committed Oct 17, 2023
1 parent 9809241 commit 0cb22f7
Show file tree
Hide file tree
Showing 10 changed files with 32 additions and 30 deletions.
6 changes: 6 additions & 0 deletions packages/extension/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @argent-x/extension

## 6.9.1

### Patch Changes

- 4f1b2ac88: Release

## 6.9.0

### Minor Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/extension/manifest/v2.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"$schema": "https://json.schemastore.org/chrome-manifest.json",
"name": "Argent X",
"description": "The security of Ethereum with the scale of StarkNet",
"version": "5.9.0",
"version": "5.9.1",
"manifest_version": 2,
"browser_action": {
"default_icon": {
Expand Down
2 changes: 1 addition & 1 deletion packages/extension/manifest/v3.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"$schema": "https://json.schemastore.org/chrome-manifest.json",
"name": "Argent X",
"description": "The security of Ethereum with the scale of StarkNet",
"version": "5.9.0",
"version": "5.9.1",
"manifest_version": 3,
"action": {
"default_icon": {
Expand Down
2 changes: 1 addition & 1 deletion packages/extension/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@argent-x/extension",
"version": "6.9.0",
"version": "6.9.1",
"main": "index.js",
"private": true,
"license": "MIT",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ import {
import { getErrorObject } from "../../shared/utils/error"
import { isAccountDeployed } from "../accountDeploy"
import { HandleMessage, UnhandledMessage } from "../background"
import { isAccountV5 } from "../../shared/utils/accountv4"
import {
isAccountV4__deprecated,
isAccountV5,
} from "../../shared/utils/accountv4"
import { argentMaxFee } from "../utils/argentMaxFee"
import { addEstimatedFees } from "../../shared/transactionSimulation/fees/estimatedFeesRepository"
import { transactionCallsAdapter } from "./transactionAdapter"
Expand Down Expand Up @@ -472,12 +475,16 @@ export const handleTransactionMessage: HandleMessage<
throw new AccountError({ code: "NOT_FOUND" })
}
const starknetAccount = await wallet.getSelectedStarknetAccount()

if (!isAccountV5(starknetAccount)) {
if (isAccountV4__deprecated(starknetAccount)) {
// Old accounts are not supported
// This should no longer happen as we prevent deprecated accounts from being used
return respond({
type: "SIMULATE_TRANSACTION_INVOCATION_RES",
data: null,
type: "SIMULATE_TRANSACTIONS_REJ",
data: {
error: new TransactionError({
code: "DEPRECATED_ACCOUNT",
}),
},
})
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,7 @@ export class WalletAccountStarknetService {
return this.getStarknetAccountOfType(starknetAccount, account.type)
}

const providerV4 = getProviderv4__deprecated(
account.network && account.network.sequencerUrl
? account.network
: await this.networkService.getById(selector.networkId),
)
const providerV4 = getProviderv4__deprecated(account.network)

const oldAccount = new AccountV4__deprecated(
providerV4,
Expand Down
1 change: 1 addition & 0 deletions packages/extension/src/shared/errors/transaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ export enum TRANSACTION_ERROR_MESSAGE {
INVALID_TRANSACTION_HASH_RANGE = "Transaction Hash needs to be > 0",
SIMULATION_DISABLED = "Transaction simulation is disabled",
SIMULATION_ERROR = "Transaction simulation failed",
DEPRECATED_ACCOUNT = "Deprecated account",
}

export type TransactionErrorMessage = keyof typeof TRANSACTION_ERROR_MESSAGE
Expand Down
4 changes: 2 additions & 2 deletions packages/extension/src/shared/multisig/account.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {
import { Account as AccountV4__deprecated } from "starknet4-deprecated"
import { MultisigPendingTransaction } from "./pendingTransactionsStore"
import { MultisigSigner } from "./signer"
import { isAccountV4 } from "../utils/accountv4"
import { isAccountV4__deprecated } from "../utils/accountv4"
import { IMultisigBackendService } from "./service/backend/interface"

export class MultisigAccount extends Account {
Expand All @@ -42,7 +42,7 @@ export class MultisigAccount extends Account {
account: Account | AccountV4__deprecated,
multisigBackendService: IMultisigBackendService,
): MultisigAccount {
if (isAccountV4(account)) {
if (isAccountV4__deprecated(account)) {
throw Error("Multisig is not supported for old accounts")
}

Expand Down
18 changes: 4 additions & 14 deletions packages/extension/src/shared/network/provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,7 @@ import {
SequencerProvider as SequencerProviderV4,
RpcProvider as RpcProviderV4,
} from "starknet4"
import {
SequencerProvider as SequencerProviderv4__deprecated,
RpcProvider as RpcProviderV4__deprecated,
} from "starknet4-deprecated"
import { SequencerProvider as SequencerProviderv4__deprecated } from "starknet4-deprecated"

import { Network } from "./type"

Expand Down Expand Up @@ -74,19 +71,12 @@ export function getProviderV4ForBaseUrl__deprecated(baseUrl: string) {
return new SequencerProviderv4__deprecated({ baseUrl })
}

export function getProviderV4ForRpcUrl__deprecated(
rpcUrl: string,
): RpcProviderV4__deprecated {
return new RpcProviderV4__deprecated({ nodeUrl: rpcUrl })
}

export function getProviderv4__deprecated(network: Network) {
if (network.rpcUrl) {
return getProviderV4ForRpcUrl__deprecated(network.rpcUrl)
} else if (network.sequencerUrl) {
// Don't use RPC provider here as it's broken for v4
if (network.sequencerUrl) {
return getProviderV4ForBaseUrl__deprecated(network.sequencerUrl)
} else {
throw new Error("No v4 (deprecated) provider available")
throw new Error("RPC is not supported for v4 deprecated provider")
}
}

Expand Down
4 changes: 3 additions & 1 deletion packages/extension/src/shared/utils/accountv4.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ export function isAccountV5(account: any): account is Account {
return "simulateTransaction" in account
}

export function isAccountV4(account: any): account is AccountV4__deprecated {
export function isAccountV4__deprecated(
account: any,
): account is AccountV4__deprecated {
// simulateTransaction is a property of Account but not AccountV4
return !("simulateTransaction" in account)
}

0 comments on commit 0cb22f7

Please sign in to comment.