Attribution.getSchemaId
Determines the schema ID for an Attribution.Attribution.
Imports
Named
import { Attribution } from 'ox/erc8021'Examples
import { Attribution } from 'ox/erc8021'
const schemaId = Attribution.getSchemaId({
codes: ['baseapp']
})
0 const schemaId2 = Attribution.getSchemaId({
codes: ['baseapp'],
codeRegistry: {
address: "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
chainId: 8453,
}
})
1 const schemaId3 = Attribution.getSchemaId({
appCode: 'baseapp',
})
2Definition
function getSchemaId(
attribution: Attribution.Attribution,
): SchemaIdSource: src/erc8021/Attribution.ts
Parameters
attribution
- Type:
Attribution.Attribution
The attribution object.
attribution.appCode
- Type:
string - Optional
Application attribution code.
attribution.codeRegistry
- Type:
AttributionSchemaId1Registry
attribution.codes
- Type:
readonly string[]
Attribution codes identifying entities involved in the transaction.
attribution.id
- Type:
2 - Optional
Schema identifier (2 for CBOR-encoded).
attribution.metadata
- Type:
Record - Optional
Arbitrary metadata key-value pairs.
attribution.registries
- Type:
AttributionSchemaId2Registries - Optional
Custom code registries keyed by entity type.
attribution.walletCode
- Type:
string - Optional
Wallet attribution code.
Return Type
The schema ID (0 for canonical registry, 1 for custom registry, 2 for CBOR-encoded).

