Skip to content

Commit

Permalink
fix: argent mobile invoke transaction backward compatible
Browse files Browse the repository at this point in the history
  • Loading branch information
bluecco committed Jul 3, 2024
1 parent 43f442b commit e0c3d92
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 27 deletions.
36 changes: 18 additions & 18 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 10 additions & 9 deletions src/connectors/argentMobile/modal/starknet/adapter.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
import {
AddInvokeTransactionParameters,
RequestFn,
TypedData,
} from "@starknet-io/get-starknet-core"
import type { StarknetWindowObject } from "@starknet-io/types-js"
import { JsonRpcProvider } from "@walletconnect/jsonrpc-provider"
import type SignClient from "@walletconnect/sign-client"
import type { SignerConnection } from "@walletconnect/signer-connection"
Expand All @@ -8,13 +14,6 @@ import type {
SignerInterface,
} from "starknet"
import { RpcProvider, constants } from "starknet"

import {
AddInvokeTransactionParameters,
RequestFn,
TypedData,
} from "@starknet-io/get-starknet-core"
import type { StarknetWindowObject } from "@starknet-io/types-js"
import type { NamespaceAdapterOptions } from "../adapter"
import { NamespaceAdapter } from "../adapter"
import { argentModal } from "../argentModal"
Expand Down Expand Up @@ -55,7 +54,7 @@ export class StarknetAdapter
"starknet_requestAddInvokeTransaction",
"wallet_supportedSpecs",
"wallet_signTypedData",
"wallet_requestAddInvokeTransaction",
"wallet_addInvokeTransaction",
]
public events = ["chainChanged", "accountsChanged"]

Expand Down Expand Up @@ -274,9 +273,11 @@ export class StarknetAdapter
params: {
accountAddress: this.account.address,
executionRequest: {
calls: calls?.map(({ contract_address, ...rest }) => ({
// will be removed when argent mobile will support entry_point and contract_address
calls: calls?.map(({ contract_address, entry_point, ...rest }) => ({
...rest,
contractAddress: contract_address,
entrypoint: entry_point,
})),
},
},
Expand Down

0 comments on commit e0c3d92

Please sign in to comment.