diff --git a/.husky/.gitignore b/.husky/.gitignore deleted file mode 100644 index 31354ec13..000000000 --- a/.husky/.gitignore +++ /dev/null @@ -1 +0,0 @@ -_ diff --git a/.husky/pre-commit b/.husky/pre-commit deleted file mode 100755 index 81fb24ce3..000000000 --- a/.husky/pre-commit +++ /dev/null @@ -1 +0,0 @@ -npx yarn wsrun:all --concurrency 1 --changedSince HEAD -c lint-staged diff --git a/package.json b/package.json index c0b4696f5..f34969d44 100644 --- a/package.json +++ b/package.json @@ -10,8 +10,7 @@ "clean": "$INIT_CWD/scripts/bin/clean.ts", "lint": "$INIT_CWD/scripts/bin/lint.ts", "test": "$INIT_CWD/scripts/bin/test.ts", - "scaffold": "$INIT_CWD/scripts/bin/scaffold/run.tsx", - "postinstall": "husky install" + "scaffold": "$INIT_CWD/scripts/bin/scaffold/run.tsx" }, "devDependencies": { "@babel/core": "^7.26.10", @@ -49,7 +48,6 @@ "fs-extra": "^10.0.0", "globals": "^15.12.0", "gzip-size": "^6.0.0", - "husky": "^7.0.1", "inquirer": "^8.1.2", "is-ci": "^3.0.0", "jest": "^29.7.0", diff --git a/packages/@magic-sdk/provider/src/modules/wallet.ts b/packages/@magic-sdk/provider/src/modules/wallet.ts index 16a44c666..902d282f9 100644 --- a/packages/@magic-sdk/provider/src/modules/wallet.ts +++ b/packages/@magic-sdk/provider/src/modules/wallet.ts @@ -1,7 +1,5 @@ import { - GasApiResponse, MagicPayloadMethod, - GaslessTransactionRequest, ConnectWithUIOptions, ConnectWithUiEvents, ShowUIPromiEvents, @@ -73,12 +71,6 @@ export class WalletModule extends BaseModule { return this.request(createJsonRpcRequestPayload(MagicPayloadMethod.ShowBalances)); } - public sendGaslessTransaction(address: string, transaction: GaslessTransactionRequest) { - return this.request( - createJsonRpcRequestPayload(MagicPayloadMethod.SendGaslessTransaction, [address, transaction]), - ); - } - /** * Sign an EIP-7702 authorization to delegate the EOA to a smart contract implementation. * This enables account abstraction features for externally owned accounts. diff --git a/packages/@magic-sdk/provider/test/spec/modules/wallet/sendGaslessTransaction.spec.ts b/packages/@magic-sdk/provider/test/spec/modules/wallet/sendGaslessTransaction.spec.ts deleted file mode 100644 index 141b3a3fa..000000000 --- a/packages/@magic-sdk/provider/test/spec/modules/wallet/sendGaslessTransaction.spec.ts +++ /dev/null @@ -1,38 +0,0 @@ -import { GaslessTransactionRequest } from '@magic-sdk/types'; -import { createMagicSDK } from '../../../factories'; -import { isPromiEvent } from '../../../../src/util'; - -beforeEach(() => { - jest.resetAllMocks(); -}); - -test('Generate JSON RPC request payload with method `eth_sendGaslessTransaction`', async () => { - const magic = createMagicSDK(); - magic.wallet.request = jest.fn(); - - const address = '0x1234'; - const transaction: GaslessTransactionRequest = { - from: '0x1234', - to: '0x5678', - value: BigInt('12'), - }; - - magic.wallet.sendGaslessTransaction(address, transaction); - - const requestPayload = magic.wallet.request.mock.calls[0][0]; - expect(requestPayload.method).toBe('eth_sendGaslessTransaction'); - expect(requestPayload.params).toEqual([address, transaction]); -}); - -test('method should return a PromiEvent', () => { - const magic = createMagicSDK(); - - const address = '0x1234'; - const transaction: GaslessTransactionRequest = { - from: '0x1234', - to: '0x5678', - value: BigInt('12'), - }; - - expect(isPromiEvent(magic.wallet.sendGaslessTransaction(address, transaction))).toBeTruthy(); -}); diff --git a/packages/@magic-sdk/types/src/core/json-rpc-types.ts b/packages/@magic-sdk/types/src/core/json-rpc-types.ts index 29054c4f3..1b5a9218d 100644 --- a/packages/@magic-sdk/types/src/core/json-rpc-types.ts +++ b/packages/@magic-sdk/types/src/core/json-rpc-types.ts @@ -125,7 +125,6 @@ export enum MagicPayloadMethod { ShowSendTokensUI = 'magic_show_send_tokens_ui', ShowAddress = 'magic_show_address', ShowBalances = 'magic_show_balances', - SendGaslessTransaction = 'eth_sendGaslessTransaction', RevealPK = 'magic_reveal_key', EnableMFA = 'magic_auth_enable_mfa_flow', DisableMFA = 'magic_auth_disable_mfa_flow', diff --git a/packages/@magic-sdk/types/src/modules/wallet-types.ts b/packages/@magic-sdk/types/src/modules/wallet-types.ts index 96ccbbb1f..d2c0c568c 100644 --- a/packages/@magic-sdk/types/src/modules/wallet-types.ts +++ b/packages/@magic-sdk/types/src/modules/wallet-types.ts @@ -1,9 +1,3 @@ -export type GasApiResponse = { - request_id: string; - state: string; - success: boolean; -}; - export type AccessListEntry = { address: string; storageKeys: Array }; /** @@ -11,81 +5,6 @@ export type AccessListEntry = { address: string; storageKeys: Array }; */ export type AccessList = Array; -export interface GaslessTransactionRequest { - /** - * The transaction type. - */ - type?: number; - - /** - * The target of the transaction. - */ - to?: string; - - /** - * The sender of the transaction. - */ - from?: string; - - /** - * The nonce of the transaction, used to prevent replay attacks. - */ - - nonce?: number; - - /** - * The maximum amount of gas to allow this transaction to consume. - */ - gasLimit?: bigint; - - /** - * The gas price to use for legacy transactions or transactions on - * legacy networks. - * - * Most of the time the ``max*FeePerGas`` is preferred. - */ - gasPrice?: bigint; - - /** - * The [[link-eip-1559]] maximum priority fee to pay per gas. - */ - maxPriorityFeePerGas?: bigint; - - /** - * The [[link-eip-1559]] maximum total fee to pay per gas. The actual - * value used is protocol enforced to be the block's base fee. - */ - maxFeePerGas?: bigint; - - /** - * The transaction data. - */ - data?: string; - - /** - * The transaction value (in wei). - */ - value?: bigint; - - /** - * The chain ID for the network this transaction is valid on. - */ - chainId?: bigint; - - /** - * The [[link-eip-2930]] access list. Storage slots included in the access - * list are //warmed// by pre-loading them, so their initial cost to - * fetch is guaranteed, but then each additional access is cheaper. - */ - accessList?: AccessList; - - /** - * A custom object, which can be passed along for network-specific - * values. - */ - customData?: any; -} - export enum WalletEventOnReceived { WalletInfoFetched = 'Wallet/wallet-info-fetched', } diff --git a/yarn.lock b/yarn.lock index f98f18d3c..00b2ad783 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3558,12 +3558,12 @@ __metadata: languageName: unknown linkType: soft -"@magic-sdk/provider@^33.1.1, @magic-sdk/provider@workspace:packages/@magic-sdk/provider": +"@magic-sdk/provider@^33.2.0, @magic-sdk/provider@workspace:packages/@magic-sdk/provider": version: 0.0.0-use.local resolution: "@magic-sdk/provider@workspace:packages/@magic-sdk/provider" dependencies: "@babel/plugin-transform-modules-commonjs": ^7.9.6 - "@magic-sdk/types": ^27.1.0 + "@magic-sdk/types": ^27.2.0 eventemitter3: ^4.0.4 localforage: ^1.7.4 tslib: ^2.3.1 @@ -3736,7 +3736,7 @@ __metadata: languageName: unknown linkType: soft -"@magic-sdk/types@^27.1.0, @magic-sdk/types@workspace:packages/@magic-sdk/types": +"@magic-sdk/types@^27.2.0, @magic-sdk/types@workspace:packages/@magic-sdk/types": version: 0.0.0-use.local resolution: "@magic-sdk/types@workspace:packages/@magic-sdk/types" languageName: unknown @@ -12211,15 +12211,6 @@ __metadata: languageName: node linkType: hard -"husky@npm:^7.0.1": - version: 7.0.4 - resolution: "husky@npm:7.0.4" - bin: - husky: lib/bin.js - checksum: c6ec4af63da2c9522da8674a20ad9b48362cc92704896cc8a58c6a2a39d797feb2b806f93fbd83a6d653fbdceb2c3b6e0b602c6b2e8565206ffc2882ef7db9e9 - languageName: node - linkType: hard - "iconv-lite@npm:0.6.3, iconv-lite@npm:^0.6.2": version: 0.6.3 resolution: "iconv-lite@npm:0.6.3" @@ -14788,7 +14779,6 @@ __metadata: fs-extra: ^10.0.0 globals: ^15.12.0 gzip-size: ^6.0.0 - husky: ^7.0.1 inquirer: ^8.1.2 is-ci: ^3.0.0 jest: ^29.7.0 @@ -14821,8 +14811,8 @@ __metadata: version: 0.0.0-use.local resolution: "magic-sdk@workspace:packages/magic-sdk" dependencies: - "@magic-sdk/provider": ^33.1.1 - "@magic-sdk/types": ^27.1.0 + "@magic-sdk/provider": ^33.2.0 + "@magic-sdk/types": ^27.2.0 localforage: ^1.7.4 languageName: unknown linkType: soft