Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 16 additions & 4 deletions src/libs/blockchain/gcr/gcr_routines/identityManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import {
TON,
XRPL,
BTC,
APTOS,
} from "@kynesyslabs/demosdk/xm-localsdk"

// TODO: refactor import to use high level abstraction module
Expand Down Expand Up @@ -47,6 +48,7 @@ const chains: { [key: string]: typeof DefaultChain } = {
near: NEAR,
// @ts-expect-error - BTC module contains more fields than the DefaultChain type
btc: BTC,
aptos: APTOS,
}

export default class IdentityManager {
Expand Down Expand Up @@ -164,6 +166,15 @@ export default class IdentityManager {
// }
// }

// SECTION: APTOS Checks
// INFO: Check if the subchain is mainnet
if (chain === "aptos" && subchain !== "mainnet") {
return {
...response,
message: "Failed: Testnet addresses are not supported",
}
}

return {
...response,
success: true,
Expand Down Expand Up @@ -207,7 +218,8 @@ export default class IdentityManager {
chainId === "xrpl" ||
chainId === "ton" ||
chainId === "ibc" ||
chainId === "near"
chainId === "near" ||
chainId === "aptos"
) {
messageVerified = await sdk.verifyMessage(
signedData,
Expand Down Expand Up @@ -278,9 +290,9 @@ export default class IdentityManager {
success: true,
message: `Signature proof${
payloads.length > 1 ? "s" : ""
} verified. ${JSON.stringify(
payloads.map(p => p.algorithm),
)} identities assigned`,
} verified. ${JSON.stringify(
payloads.map(p => p.algorithm),
)} identities assigned`,
}
}

Expand Down