diff --git a/pages/reference-sdk-protocol-kit/_meta.json b/pages/reference-sdk-protocol-kit/_meta.json index 9f06d949..2641e01b 100644 --- a/pages/reference-sdk-protocol-kit/_meta.json +++ b/pages/reference-sdk-protocol-kit/_meta.json @@ -16,5 +16,6 @@ "messages": "Messages", "safe-modules": "Safe Modules", "safe-guards": "Safe Guards", - "fallback-handler": "Fallback Handler" + "fallback-handler": "Fallback Handler", + "onchain-tracking": "On-chain Tracking" } diff --git a/pages/reference-sdk-protocol-kit/onchain-tracking/_meta.json b/pages/reference-sdk-protocol-kit/onchain-tracking/_meta.json new file mode 100644 index 00000000..2b00d2eb --- /dev/null +++ b/pages/reference-sdk-protocol-kit/onchain-tracking/_meta.json @@ -0,0 +1,3 @@ +{ + "getOnchainIdentifier": "getOnchainIdentifier" +} \ No newline at end of file diff --git a/pages/reference-sdk-protocol-kit/onchain-tracking/getOnchainIdentifier.mdx b/pages/reference-sdk-protocol-kit/onchain-tracking/getOnchainIdentifier.mdx new file mode 100644 index 00000000..3278ac2b --- /dev/null +++ b/pages/reference-sdk-protocol-kit/onchain-tracking/getOnchainIdentifier.mdx @@ -0,0 +1,44 @@ +import { Tabs } from 'nextra/components' + +# `getOnchainIdentifier` + +Returns the on-chain identifier generated internally. This identifier is appended to the `data` field of transactions to enable on-chain tracking. + +## Usage + +{/* */} + + + + ```typescript + import { protocolKit } from './setup.ts' + + const onchainIdentifier = await protocolKit.getOnchainIdentifier() + + console.log(onchainIdentifier) // e.g., '5afe006562303761323539616336346466346135306537646561393238383963' + ``` + + + ```typescript + import Safe from '@safe-global/protocol-kit' + + export const protocolKit = Safe.init({ + // ... + onchainAnalytics: { + project: 'Cow Swap', // Specify your project name + platform: 'Web' // Optional platform + } + }) + ``` + + + +{/* */} + +## Returns + +`string` + +The on-chain identifier in hexadecimal format (e.g., `5afe00...`), which includes hashed metadata such as project name, platform, tool, and tool version. + +For more details about the identifier format, please refer to the [On-chain identifier](../../sdk/onchain-tracking.mdx#on-chain-identifier-format) section.