Skip to content
Open
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
17 changes: 0 additions & 17 deletions __tests__/account.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -391,23 +391,6 @@ describe('deploy and test Account', () => {
});

describe('fastExecute()', () => {
test('Only Rpc X', async () => {
const provider08 = new RpcProvider({
nodeUrl: 'dummy',
blockIdentifier: BlockTag.PRE_CONFIRMED,
specVersion: '0.10.0',
});
const testAccount = new Account({
provider: provider08,
address: '0x123',
signer: '0x456',
});
const myCall: Call = { contractAddress: '0x036', entrypoint: 'withdraw', calldata: [] };
await expect(testAccount.fastExecute(myCall)).rejects.toThrow(
'Wrong Rpc version in Provider. At least Rpc v0.9 required.'
);
});

test('Only provider with PRE_CONFIRMED blockIdentifier', async () => {
const providerLatest = new RpcProvider({
nodeUrl: 'dummy',
Expand Down
201 changes: 190 additions & 11 deletions package-lock.json

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

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@
"@noble/hashes": "~1.6.0",
"@scure/base": "~1.2.1",
"@scure/starknet": "1.1.0",
"@starknet-io/get-starknet-wallet-standard": "^5.0.0",
"@starknet-io/starknet-types-010": "npm:@starknet-io/[email protected]",
"@starknet-io/starknet-types-09": "npm:@starknet-io/types-js@~0.9.1",
"abi-wan-kanabi": "2.2.4",
Expand Down
5 changes: 0 additions & 5 deletions src/account/default.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ import { assertPaymasterTransactionSafety } from '../utils/paymaster';
import assert from '../utils/assert';
import { defaultDeployer, Deployer } from '../deployer';
import type { TipType } from '../provider/modules/tip';
import { RPC09 } from '../channel';

export class Account extends Provider implements AccountInterface {
public signer: SignerInterface;
Expand Down Expand Up @@ -365,10 +364,6 @@ export class Account extends Provider implements AccountInterface {
transactionsDetail: UniversalDetails = {},
waitDetail: fastWaitForTransactionOptions = {}
): Promise<fastExecuteResponse> {
assert(
this.channel instanceof RPC09.RpcChannel,
'Wrong Rpc version in Provider. At least Rpc v0.9 required.'
);
assert(
this.channel.blockIdentifier === BlockTag.PRE_CONFIRMED,
'Provider needs to be initialized with `pre_confirmed` blockIdentifier option.'
Expand Down
1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ export * from './utils/contract';
export * from './utils/transactionReceipt/transactionReceipt';
export * from './utils/units';
export * as wallet from './wallet/connect';
export * as walletV5 from './wallet/connectV5';
export * from './global/config';
export * from './global/logger';
export * from './global/logger.type';
17 changes: 7 additions & 10 deletions src/provider/rpc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -344,16 +344,13 @@ export class RpcProvider implements ProviderInterface {
initNonce: BigNumberish,
options?: fastWaitForTransactionOptions
): Promise<boolean> {
if (this.channel instanceof RPC09.RpcChannel) {
const isSuccess = await this.channel.fastWaitForTransaction(
txHash,
address,
initNonce,
options
);
return isSuccess;
}
throw new Error('Unsupported channel type');
const isSuccess = await this.channel.fastWaitForTransaction(
txHash,
address,
initNonce,
options
);
return isSuccess;
}

public async getStorageAt(
Expand Down
4 changes: 2 additions & 2 deletions src/wallet/account.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import {
switchStarknetChain,
watchAsset,
} from './connect';
import type { StarknetWalletProvider, WalletAccountOptions } from './types/index.type';
import type { StarknetWalletProvider, WalletAccountV4Options } from './types/index.type';
import type { PaymasterOptions } from '../paymaster/types/index.type';
import type { PaymasterInterface } from '../paymaster';
import {
Expand All @@ -41,7 +41,7 @@ import {
export class WalletAccount extends Account implements AccountInterface {
public walletProvider: StarknetWalletProvider;

constructor(options: WalletAccountOptions) {
constructor(options: WalletAccountV4Options) {
super({ ...options, signer: '' }); // At this point unknown address
this.walletProvider = options.walletProvider;

Expand Down
Loading
Loading