Skip to content

Commit d58135c

Browse files
committed
chore: add Safe API Kit lib
This patch adds API Kit which unfortunately overrides viem's Address type and thus introduces build errors around code that was and still is fine. Please read this GitHub issue for more details: safe-global/safe-core-sdk#1087 To get the app to build again I needed to assert address to be of type `0x${string}` in a few places. We know it's the correct type, it's just that the TypeScript compiler doesn't, so this is safe to do.
1 parent e64fe74 commit d58135c

File tree

5 files changed

+108
-3
lines changed

5 files changed

+108
-3
lines changed

blueprints/hooks/createBlueprint.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ export const useCreateBlueprint = () => {
102102
: {}),
103103
},
104104
minter_address: minterAddress as `0x${string}`,
105-
admin_address: address,
105+
admin_address: address as `0x${string}`,
106106
signature: signature as `0x${string}`,
107107
chain_id: chainId,
108108
};

components/disconnect-dialog.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export default function DisconnectDialog({
4141
{/* {customConnectors.map((connector) => ( */}
4242
{address && (
4343
<p className="text-sm text-muted-foreground uppercase font-semibold tracking-wide">
44-
{truncateEthereumAddress(address)}
44+
{truncateEthereumAddress(address as `0x${string}`)}
4545
</p>
4646
)}
4747
<Button

components/hypercert/transfer-drawer.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ export function TransferDrawer({ hypercert }: { hypercert: HypercertFull }) {
113113

114114
const hash = await client.transferFraction({
115115
fractionId: BigInt(tokenIdFromFraction),
116-
to: getAddress(recipient),
116+
to: getAddress(recipient) as `0x${string}`,
117117
});
118118

119119
setTxHash(hash);

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
"@radix-ui/react-slot": "^1.0.2",
3939
"@radix-ui/react-toast": "^1.1.5",
4040
"@radix-ui/react-tooltip": "^1.0.7",
41+
"@safe-global/api-kit": "^2.5.6",
4142
"@tanstack/query-core": "^5.32.0",
4243
"@tanstack/react-query": "^5.32.0",
4344
"@tanstack/react-query-devtools": "4",

pnpm-lock.yaml

Lines changed: 104 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)