Comparing version 0.0.0-canary-20250306045222 to 0.0.0-canary-20250307042408
@@ -11,2 +11,3 @@ "use strict"; | ||
...request, | ||
...(request.authorizationList ? { to: null } : {}), | ||
data: calldata, | ||
@@ -13,0 +14,0 @@ }); |
@@ -31,2 +31,4 @@ "use strict"; | ||
return parameters.to; | ||
if (parameters.to === null) | ||
return undefined; | ||
if (authorizationList && authorizationList.length > 0) | ||
@@ -33,0 +35,0 @@ return await (0, recoverAuthorizationAddress_js_1.recoverAuthorizationAddress)({ |
@@ -15,3 +15,6 @@ "use strict"; | ||
default: { | ||
http: ['https://rpc.gurunetwork.ai/archive/260'], | ||
http: [ | ||
'https://rpc-main.gurunetwork.ai', | ||
'https://rpc.gurunetwork.ai/archive/260', | ||
], | ||
}, | ||
@@ -18,0 +21,0 @@ }, |
@@ -15,3 +15,6 @@ "use strict"; | ||
default: { | ||
http: ['https://rpc.gurunetwork.ai/archive/261'], | ||
http: [ | ||
'https://rpc-test.gurunetwork.ai', | ||
'https://rpc.gurunetwork.ai/archive/261', | ||
], | ||
}, | ||
@@ -18,0 +21,0 @@ }, |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.fallback = fallback; | ||
exports.shouldThrow = shouldThrow; | ||
exports.rankTransports = rankTransports; | ||
@@ -10,3 +11,3 @@ const node_js_1 = require("../../errors/node.js"); | ||
function fallback(transports_, config = {}) { | ||
const { key = 'fallback', name = 'Fallback', rank = false, retryCount, retryDelay, } = config; | ||
const { key = 'fallback', name = 'Fallback', rank = false, shouldThrow: shouldThrow_ = shouldThrow, retryCount, retryDelay, } = config; | ||
return (({ chain, pollingInterval = 4_000, timeout, ...rest }) => { | ||
@@ -49,3 +50,3 @@ let transports = transports_; | ||
}); | ||
if (shouldThrow(err)) | ||
if (shouldThrow_(err)) | ||
throw err; | ||
@@ -52,0 +53,0 @@ if (i === transports.length - 1) |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.version = void 0; | ||
exports.version = '0.0.0-canary-20250306045222'; | ||
exports.version = '0.0.0-canary-20250307042408'; | ||
//# sourceMappingURL=version.js.map |
@@ -1,2 +0,2 @@ | ||
import { TransactionNotFoundError } from '../../errors/transaction.js'; | ||
import { TransactionNotFoundError, } from '../../errors/transaction.js'; | ||
import { numberToHex, } from '../../utils/encoding/toHex.js'; | ||
@@ -3,0 +3,0 @@ import { formatTransaction, } from '../../utils/formatters/transaction.js'; |
@@ -35,2 +35,3 @@ import { encodeDeployData } from '../../utils/abi/encodeDeployData.js'; | ||
...request, | ||
...(request.authorizationList ? { to: null } : {}), | ||
data: calldata, | ||
@@ -37,0 +38,0 @@ }); |
@@ -74,2 +74,5 @@ import { parseAccount, } from '../../accounts/utils/parseAccount.js'; | ||
return parameters.to; | ||
// If `to` is null, we are sending a deployment transaction. | ||
if (parameters.to === null) | ||
return undefined; | ||
// If no `to` exists, and we are sending a EIP-7702 transaction, use the | ||
@@ -76,0 +79,0 @@ // address of the first authorization in the list. |
@@ -12,3 +12,6 @@ import { defineChain } from '../../utils/chain/defineChain.js'; | ||
default: { | ||
http: ['https://rpc.gurunetwork.ai/archive/260'], | ||
http: [ | ||
'https://rpc-main.gurunetwork.ai', | ||
'https://rpc.gurunetwork.ai/archive/260', | ||
], | ||
}, | ||
@@ -15,0 +18,0 @@ }, |
@@ -12,3 +12,6 @@ import { defineChain } from '../../utils/chain/defineChain.js'; | ||
default: { | ||
http: ['https://rpc.gurunetwork.ai/archive/261'], | ||
http: [ | ||
'https://rpc-test.gurunetwork.ai', | ||
'https://rpc.gurunetwork.ai/archive/261', | ||
], | ||
}, | ||
@@ -15,0 +18,0 @@ }, |
@@ -456,3 +456,3 @@ // biome-ignore lint/performance/noBarrelFile: entrypoint module | ||
export { spicy } from './definitions/spicy.js'; | ||
export { statusSepolia } from './definitions/statusSepolia.js'; | ||
export { statusSepolia, statusSepolia as statusNetworkSepolia, } from './definitions/statusNetworkSepolia.js'; | ||
export { step } from './definitions/step.js'; | ||
@@ -459,0 +459,0 @@ export { story } from './definitions/story.js'; |
@@ -6,3 +6,3 @@ import { ExecutionRevertedError } from '../../errors/node.js'; | ||
export function fallback(transports_, config = {}) { | ||
const { key = 'fallback', name = 'Fallback', rank = false, retryCount, retryDelay, } = config; | ||
const { key = 'fallback', name = 'Fallback', rank = false, shouldThrow: shouldThrow_ = shouldThrow, retryCount, retryDelay, } = config; | ||
return (({ chain, pollingInterval = 4_000, timeout, ...rest }) => { | ||
@@ -45,3 +45,3 @@ let transports = transports_; | ||
}); | ||
if (shouldThrow(err)) | ||
if (shouldThrow_(err)) | ||
throw err; | ||
@@ -91,3 +91,3 @@ // If we've reached the end of the fallbacks, throw the error. | ||
} | ||
function shouldThrow(error) { | ||
export function shouldThrow(error) { | ||
if ('code' in error && typeof error.code === 'number') { | ||
@@ -94,0 +94,0 @@ if (error.code === TransactionRejectedRpcError.code || |
@@ -1,2 +0,2 @@ | ||
export const version = '0.0.0-canary-20250306045222'; | ||
export const version = '0.0.0-canary-20250307042408'; | ||
//# sourceMappingURL=version.js.map |
@@ -10,3 +10,3 @@ // biome-ignore lint/performance/noBarrelFile: entrypoint module | ||
export { custom, } from './clients/transports/custom.js'; | ||
export { fallback, } from './clients/transports/fallback.js'; | ||
export { fallback, shouldThrow, } from './clients/transports/fallback.js'; | ||
export { http, } from './clients/transports/http.js'; | ||
@@ -13,0 +13,0 @@ export { createPublicClient, } from './clients/createPublicClient.js'; |
import type { Client } from '../../clients/createClient.js'; | ||
import type { Transport } from '../../clients/transports/createTransport.js'; | ||
import { type TransactionNotFoundErrorType } from '../../errors/transaction.js'; | ||
import type { ErrorType } from '../../errors/utils.js'; | ||
@@ -44,3 +45,3 @@ import type { BlockTag } from '../../types/block.js'; | ||
export type GetTransactionReturnType<chain extends Chain | undefined = undefined, blockTag extends BlockTag = 'latest'> = Prettify<FormattedTransaction<chain, blockTag>>; | ||
export type GetTransactionErrorType = NumberToHexErrorType | RequestErrorType | ErrorType; | ||
export type GetTransactionErrorType = TransactionNotFoundErrorType | NumberToHexErrorType | RequestErrorType | ErrorType; | ||
/** | ||
@@ -47,0 +48,0 @@ * Returns information about a [Transaction](https://viem.sh/docs/glossary/terms#transaction) given a hash or block identifier. |
import type { Client } from '../../clients/createClient.js'; | ||
import type { Transport } from '../../clients/transports/createTransport.js'; | ||
import { type WaitForTransactionReceiptTimeoutErrorType } from '../../errors/transaction.js'; | ||
import type { ErrorType } from '../../errors/utils.js'; | ||
@@ -52,3 +53,3 @@ import type { Chain } from '../../types/chain.js'; | ||
}; | ||
export type WaitForTransactionReceiptErrorType = ObserveErrorType | GetBlockErrorType | GetTransactionErrorType | GetTransactionReceiptErrorType | WatchBlockNumberErrorType | ErrorType; | ||
export type WaitForTransactionReceiptErrorType = ObserveErrorType | GetBlockErrorType | GetTransactionErrorType | GetTransactionReceiptErrorType | WatchBlockNumberErrorType | WaitForTransactionReceiptTimeoutErrorType | ErrorType; | ||
/** | ||
@@ -55,0 +56,0 @@ * Waits for the [Transaction](https://viem.sh/docs/glossary/terms#transaction) to be included on a [Block](https://viem.sh/docs/glossary/terms#block) (one confirmation), and then returns the [Transaction Receipt](https://viem.sh/docs/glossary/terms#transaction-receipt). |
@@ -23,3 +23,3 @@ export declare const guruNetwork: { | ||
readonly default: { | ||
readonly http: readonly ["https://rpc.gurunetwork.ai/archive/260"]; | ||
readonly http: readonly ["https://rpc-main.gurunetwork.ai", "https://rpc.gurunetwork.ai/archive/260"]; | ||
}; | ||
@@ -26,0 +26,0 @@ }; |
@@ -27,3 +27,3 @@ export declare const guruTestnet: { | ||
readonly default: { | ||
readonly http: readonly ["https://rpc.gurunetwork.ai/archive/261"]; | ||
readonly http: readonly ["https://rpc-test.gurunetwork.ai", "https://rpc.gurunetwork.ai/archive/261"]; | ||
}; | ||
@@ -30,0 +30,0 @@ }; |
@@ -456,3 +456,3 @@ export type { Chain } from '../types/chain.js'; | ||
export { spicy } from './definitions/spicy.js'; | ||
export { statusSepolia } from './definitions/statusSepolia.js'; | ||
export { statusSepolia, statusSepolia as statusNetworkSepolia, } from './definitions/statusNetworkSepolia.js'; | ||
export { step } from './definitions/step.js'; | ||
@@ -459,0 +459,0 @@ export { story } from './definitions/story.js'; |
@@ -66,2 +66,4 @@ import type { ErrorType } from '../../errors/utils.js'; | ||
retryDelay?: TransportConfig['retryDelay'] | undefined; | ||
/** Callback on whether an error should throw or try the next transport in the fallback. */ | ||
shouldThrow?: (error: Error) => boolean | undefined; | ||
}; | ||
@@ -76,2 +78,3 @@ export type FallbackTransport<transports extends readonly Transport[] = readonly Transport[]> = Transport<'fallback', { | ||
export declare function fallback<const transports extends readonly Transport[]>(transports_: transports, config?: FallbackTransportConfig): FallbackTransport<transports>; | ||
export declare function shouldThrow(error: Error): boolean; | ||
/** @internal */ | ||
@@ -78,0 +81,0 @@ export declare function rankTransports({ chain, interval, onTransports, ping, sampleCount, timeout, transports, weights, }: { |
@@ -1,2 +0,2 @@ | ||
export declare const version = "0.0.0-canary-20250306045222"; | ||
export declare const version = "0.0.0-canary-20250307042408"; | ||
//# sourceMappingURL=version.d.ts.map |
@@ -106,3 +106,3 @@ export { type Abi, type AbiFunction, type AbiParameter, type AbiEvent, type AbiStateMutability, type AbiParameterKind, type AbiParameterToPrimitiveType, type Address, type Narrow, type ParseAbi, type ParseAbiItem, type ParseAbiParameter, type ParseAbiParameters, type ResolvedRegister, type TypedData, type TypedDataDomain, type TypedDataParameter, CircularReferenceError, InvalidAbiParameterError, InvalidAbiParametersError, InvalidAbiItemError, InvalidAbiTypeParameterError, InvalidFunctionModifierError, InvalidModifierError, InvalidParameterError, InvalidParenthesisError, InvalidSignatureError, InvalidStructSignatureError, SolidityProtectedKeywordError, UnknownTypeError, UnknownSignatureError, parseAbi, parseAbiItem, parseAbiParameter, parseAbiParameters, } from 'abitype'; | ||
export { type CustomTransport, type CustomTransportConfig, type CustomTransportErrorType, custom, } from './clients/transports/custom.js'; | ||
export { type FallbackTransport, type FallbackTransportConfig, type FallbackTransportErrorType, fallback, } from './clients/transports/fallback.js'; | ||
export { type FallbackTransport, type FallbackTransportConfig, type FallbackTransportErrorType, fallback, shouldThrow, } from './clients/transports/fallback.js'; | ||
export { type HttpTransport, type HttpTransportConfig, type HttpTransportErrorType, http, } from './clients/transports/http.js'; | ||
@@ -109,0 +109,0 @@ export { type PublicClient, type PublicClientConfig, type CreatePublicClientErrorType, createPublicClient, } from './clients/createPublicClient.js'; |
import type { Client } from '../../clients/createClient.js' | ||
import type { Transport } from '../../clients/transports/createTransport.js' | ||
import { TransactionNotFoundError } from '../../errors/transaction.js' | ||
import { | ||
TransactionNotFoundError, | ||
type TransactionNotFoundErrorType, | ||
} from '../../errors/transaction.js' | ||
import type { ErrorType } from '../../errors/utils.js' | ||
@@ -63,2 +66,3 @@ import type { BlockTag } from '../../types/block.js' | ||
export type GetTransactionErrorType = | ||
| TransactionNotFoundErrorType | ||
| NumberToHexErrorType | ||
@@ -65,0 +69,0 @@ | RequestErrorType |
@@ -8,2 +8,3 @@ import type { Client } from '../../clients/createClient.js' | ||
WaitForTransactionReceiptTimeoutError, | ||
type WaitForTransactionReceiptTimeoutErrorType, | ||
} from '../../errors/transaction.js' | ||
@@ -93,2 +94,3 @@ import type { ErrorType } from '../../errors/utils.js' | ||
| WatchBlockNumberErrorType | ||
| WaitForTransactionReceiptTimeoutErrorType | ||
| ErrorType | ||
@@ -95,0 +97,0 @@ |
@@ -87,4 +87,5 @@ import type { Abi } from 'abitype' | ||
...request, | ||
...(request.authorizationList ? { to: null } : {}), | ||
data: calldata, | ||
} as unknown as SendTransactionParameters<chain, account, chainOverride>) | ||
} |
@@ -187,2 +187,5 @@ import type { Address } from 'abitype' | ||
// If `to` is null, we are sending a deployment transaction. | ||
if (parameters.to === null) return undefined | ||
// If no `to` exists, and we are sending a EIP-7702 transaction, use the | ||
@@ -189,0 +192,0 @@ // address of the first authorization in the list. |
@@ -13,3 +13,6 @@ import { defineChain } from '../../utils/chain/defineChain.js' | ||
default: { | ||
http: ['https://rpc.gurunetwork.ai/archive/260'], | ||
http: [ | ||
'https://rpc-main.gurunetwork.ai', | ||
'https://rpc.gurunetwork.ai/archive/260', | ||
], | ||
}, | ||
@@ -16,0 +19,0 @@ }, |
@@ -13,3 +13,6 @@ import { defineChain } from '../../utils/chain/defineChain.js' | ||
default: { | ||
http: ['https://rpc.gurunetwork.ai/archive/261'], | ||
http: [ | ||
'https://rpc-test.gurunetwork.ai', | ||
'https://rpc.gurunetwork.ai/archive/261', | ||
], | ||
}, | ||
@@ -16,0 +19,0 @@ }, |
@@ -458,3 +458,6 @@ export type { Chain } from '../types/chain.js' | ||
export { spicy } from './definitions/spicy.js' | ||
export { statusSepolia } from './definitions/statusSepolia.js' | ||
export { | ||
statusSepolia, | ||
statusSepolia as statusNetworkSepolia, | ||
} from './definitions/statusNetworkSepolia.js' | ||
export { step } from './definitions/step.js' | ||
@@ -461,0 +464,0 @@ export { story } from './definitions/story.js' |
@@ -88,2 +88,4 @@ import { ExecutionRevertedError } from '../../errors/node.js' | ||
retryDelay?: TransportConfig['retryDelay'] | undefined | ||
/** Callback on whether an error should throw or try the next transport in the fallback. */ | ||
shouldThrow?: (error: Error) => boolean | undefined | ||
} | ||
@@ -113,2 +115,3 @@ | ||
rank = false, | ||
shouldThrow: shouldThrow_ = shouldThrow, | ||
retryCount, | ||
@@ -160,3 +163,3 @@ retryDelay, | ||
if (shouldThrow(err as Error)) throw err | ||
if (shouldThrow_(err as Error)) throw err | ||
@@ -209,3 +212,3 @@ // If we've reached the end of the fallbacks, throw the error. | ||
function shouldThrow(error: Error) { | ||
export function shouldThrow(error: Error) { | ||
if ('code' in error && typeof error.code === 'number') { | ||
@@ -212,0 +215,0 @@ if ( |
@@ -1,1 +0,1 @@ | ||
export const version = '0.0.0-canary-20250306045222' | ||
export const version = '0.0.0-canary-20250307042408' |
@@ -510,2 +510,3 @@ // biome-ignore lint/performance/noBarrelFile: entrypoint module | ||
fallback, | ||
shouldThrow, | ||
} from './clients/transports/fallback.js' | ||
@@ -512,0 +513,0 @@ export { |
{ | ||
"name": "viem", | ||
"description": "TypeScript Interface for Ethereum", | ||
"version": "0.0.0-canary-20250306045222", | ||
"version": "0.0.0-canary-20250307042408", | ||
"main": "./_cjs/index.js", | ||
@@ -6,0 +6,0 @@ "module": "./_esm/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
15412903
281400