Skip to content

Commit

Permalink
fix analytics typo
Browse files Browse the repository at this point in the history
  • Loading branch information
DaniSomoza committed Dec 11, 2024
1 parent a80d468 commit b204e9e
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 26 deletions.
10 changes: 5 additions & 5 deletions packages/protocol-kit/src/Safe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ class Safe {
#MAGIC_VALUE = '0x1626ba7e'
#MAGIC_VALUE_BYTES = '0x20c13b0b'

// on-chain Analitics
// on-chain Analytics
#onchainIdentifier: string = ''

/**
Expand All @@ -132,10 +132,10 @@ class Safe {
* @throws "MultiSendCallOnly contract is not deployed on the current network"
*/
async #initializeProtocolKit(config: SafeConfig) {
const { provider, signer, isL1SafeSingleton, contractNetworks, onchainAnalitics } = config
const { provider, signer, isL1SafeSingleton, contractNetworks, onchainAnalytics } = config

if (onchainAnalitics?.project) {
const { project, platform } = onchainAnalitics
if (onchainAnalytics?.project) {
const { project, platform } = onchainAnalytics
this.#onchainIdentifier = generateOnChainIdentifier({
project,
platform,
Expand Down Expand Up @@ -1539,7 +1539,7 @@ class Safe {
const safeDeploymentBatch = await this.createTransactionBatch(
transactions,
transactionOptions,
true // include the on chain identifier
!!this.#onchainIdentifier // include the on chain identifier
)

return safeDeploymentBatch
Expand Down
10 changes: 5 additions & 5 deletions packages/protocol-kit/src/types/safeConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ type SafeConfigWithPredictedSafeProps = {
predictedSafe: PredictedSafeProps
}

export type OnchainAnaliticsProps = {
export type OnchainAnalyticsProps = {
/** project - The project that is using the SDK */
project?: string
/** platform - The platform that is using the SDK */
Expand All @@ -55,8 +55,8 @@ export type SafeConfigProps = {
isL1SafeSingleton?: boolean
/** contractNetworks - Contract network configuration */
contractNetworks?: ContractNetworksConfig
// on-chain analitics
onchainAnalitics?: OnchainAnaliticsProps
// on-chain analytics
onchainAnalytics?: OnchainAnalyticsProps
}

export type SafeConfigWithSafeAddress = SafeConfigProps & SafeConfigWithSafeAddressProps
Expand Down Expand Up @@ -84,8 +84,8 @@ type ConnectSafeConfigProps = {
isL1SafeSingleton?: boolean
/** contractNetworks - Contract network configuration */
contractNetworks?: ContractNetworksConfig
// on-chain analitics
onchainAnalitics?: OnchainAnaliticsProps
// on-chain analytics
onchainAnalytics?: OnchainAnalyticsProps
}

export type ConnectSafeConfigWithSafeAddress = ConnectSafeConfigProps &
Expand Down
14 changes: 7 additions & 7 deletions packages/protocol-kit/tests/e2e/onChainIdentifier.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { setupTests, safeVersionDeployed } from '@safe-global/testing-kit'
import Safe, {
generateOnChainIdentifier,
OnchainAnaliticsProps,
OnchainAnalyticsProps,
PredictedSafeProps,
SafeAccountConfig
} from '@safe-global/protocol-kit/index'
Expand Down Expand Up @@ -40,7 +40,7 @@ describe('On-chain analytics', () => {

describe('getOnchainIdentifier method', () => {
it('should return the on-chain identifier when provided', async () => {
const onchainAnalitics: OnchainAnaliticsProps = {
const onchainAnalytics: OnchainAnalyticsProps = {
project: 'Test e2e Project',
platform: 'Web'
}
Expand All @@ -52,7 +52,7 @@ describe('On-chain analytics', () => {
provider,
safeAddress,
contractNetworks,
onchainAnalitics
onchainAnalytics
})

const onChainIdentifier = '5afe003861653435366632366138366164643038373864646561393238653366'
Expand All @@ -76,7 +76,7 @@ describe('On-chain analytics', () => {

describe('Tracking Safe Deployment on-chain via the transaction data field', () => {
it('should append the on-chain identifier to the deployment transaction data field', async () => {
const onchainAnalitics: OnchainAnaliticsProps = {
const onchainAnalytics: OnchainAnalyticsProps = {
project: 'Test e2e Project',
platform: 'Web'
}
Expand All @@ -97,7 +97,7 @@ describe('On-chain analytics', () => {
provider,
predictedSafe,
contractNetworks,
onchainAnalitics
onchainAnalytics
})

const deploymentTransaction = await protocolKit.createSafeDeploymentTransaction()
Expand All @@ -111,7 +111,7 @@ describe('On-chain analytics', () => {

describe('Tracking Safe transactions on-chain via the transaction data field', () => {
it('should append the on-chain identifier to the execTransaction data field', async () => {
const onchainAnalitics: OnchainAnaliticsProps = {
const onchainAnalytics: OnchainAnalyticsProps = {
project: 'Test e2e Project',
platform: 'Web'
}
Expand All @@ -123,7 +123,7 @@ describe('On-chain analytics', () => {
provider,
safeAddress,
contractNetworks,
onchainAnalitics
onchainAnalytics
})

const testTransaction = {
Expand Down
12 changes: 6 additions & 6 deletions packages/relay-kit/src/packs/safe-4337/Safe4337Pack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ export class Safe4337Pack extends RelayKitBasePack<{
entryPointAddress,
safe4337ModuleAddress,
safeWebAuthnSharedSignerAddress,
onchainAnalitics
onchainAnalytics
}: Safe4337Options) {
super(protocolKit)

Expand All @@ -117,8 +117,8 @@ export class Safe4337Pack extends RelayKitBasePack<{
this.#SAFE_4337_MODULE_ADDRESS = safe4337ModuleAddress
this.#SAFE_WEBAUTHN_SHARED_SIGNER_ADDRESS = safeWebAuthnSharedSignerAddress || '0x'

if (onchainAnalitics?.project) {
const { project, platform } = onchainAnalitics
if (onchainAnalytics?.project) {
const { project, platform } = onchainAnalytics
this.#onchainIdentifier = generateOnChainIdentifier({
project,
platform,
Expand Down Expand Up @@ -146,7 +146,7 @@ export class Safe4337Pack extends RelayKitBasePack<{
bundlerUrl,
customContracts,
paymasterOptions,
onchainAnalitics
onchainAnalytics
} = initOptions

let protocolKit: Safe
Expand Down Expand Up @@ -354,7 +354,7 @@ export class Safe4337Pack extends RelayKitBasePack<{
paymentReceiver: zeroAddress
}
},
onchainAnalitics
onchainAnalytics
})
}

Expand Down Expand Up @@ -398,7 +398,7 @@ export class Safe4337Pack extends RelayKitBasePack<{
entryPointAddress: selectedEntryPoint!,
safe4337ModuleAddress,
safeWebAuthnSharedSignerAddress,
onchainAnalitics
onchainAnalytics
})
}

Expand Down
6 changes: 3 additions & 3 deletions packages/relay-kit/src/packs/safe-4337/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Account, Address, Chain, Hash, Hex, PublicClient, PublicRpcSchema, Tran
import Safe, {
DeploymentType,
SafeProviderConfig,
OnchainAnaliticsProps
OnchainAnalyticsProps
} from '@safe-global/protocol-kit'
import {
EstimateGasData,
Expand Down Expand Up @@ -54,7 +54,7 @@ export type Safe4337InitOptions = {
}
options: ExistingSafeOptions | PredictedSafeOptions
paymasterOptions?: PaymasterOptions
onchainAnalitics?: OnchainAnaliticsProps
onchainAnalytics?: OnchainAnalyticsProps
}

export type Safe4337Options = {
Expand All @@ -66,7 +66,7 @@ export type Safe4337Options = {
entryPointAddress: string
safe4337ModuleAddress: string
safeWebAuthnSharedSignerAddress?: string
onchainAnalitics?: OnchainAnaliticsProps
onchainAnalytics?: OnchainAnalyticsProps
}

export type Safe4337CreateTransactionProps = {
Expand Down

0 comments on commit b204e9e

Please sign in to comment.