-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
685 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
#!/usr/bin/env python3 | ||
# -*- coding: utf-8 -*- | ||
''' | ||
Author: Zella Zhong | ||
Date: 2024-10-12 16:24:59 | ||
LastEditors: Zella Zhong | ||
LastEditTime: 2024-10-12 16:25:52 | ||
FilePath: /data_service/src/resolver/aptos.py | ||
Description: | ||
''' | ||
import logging | ||
from datetime import datetime | ||
from sqlalchemy.inspection import inspect | ||
from sqlalchemy import select, update, and_, or_ | ||
from sqlalchemy.orm import load_only | ||
from urllib.parse import unquote | ||
|
||
from session import get_session | ||
from model import EnsnameModel | ||
|
||
from utils import check_evm_address, convert_camel_case | ||
|
||
from scalar.platform import Platform | ||
from scalar.network import Network | ||
from scalar.identity_graph import IdentityRecordSimplified | ||
from scalar.identity_record import IdentityRecord | ||
from scalar.profile import Profile | ||
from scalar.error import EmptyInput, EvmAddressInvalid, ExceedRangeInput | ||
|
||
QUERY_MAX_LIMIT = 200 | ||
|
||
|
||
async def query_profile_by_single_aptos(info, address): | ||
identity_record = IdentityRecord( | ||
id=f"{Platform.aptos.value},{address}", | ||
identity=address, | ||
platform=Platform.aptos.value, | ||
network=Network.aptos.value, | ||
primary_name=None, | ||
is_primary=False, | ||
profile=None | ||
) | ||
return identity_record | ||
|
||
async def query_profile_by_aptos_addresses(info, addresses): | ||
if len(addresses) > QUERY_MAX_LIMIT: | ||
return ExceedRangeInput(QUERY_MAX_LIMIT) | ||
|
||
logging.debug("query_profile_by_aptos_addresses %s", addresses) | ||
result = [] | ||
for addr in addresses: | ||
result.append(IdentityRecordSimplified( | ||
id=f"{Platform.aptos.value},{addr}", | ||
identity=addr, | ||
platform=Platform.aptos.value, | ||
network=Network.aptos.value, | ||
primary_name=None, | ||
is_primary=False, | ||
profile=None | ||
)) | ||
|
||
return result |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
#!/usr/bin/env python3 | ||
# -*- coding: utf-8 -*- | ||
''' | ||
Author: Zella Zhong | ||
Date: 2024-10-12 16:23:07 | ||
LastEditors: Zella Zhong | ||
LastEditTime: 2024-10-12 16:26:22 | ||
FilePath: /data_service/src/resolver/bitcoin.py | ||
Description: | ||
''' | ||
import logging | ||
from datetime import datetime | ||
from sqlalchemy.inspection import inspect | ||
from sqlalchemy import select, update, and_, or_ | ||
from sqlalchemy.orm import load_only | ||
from urllib.parse import unquote | ||
|
||
from session import get_session | ||
from model import EnsnameModel | ||
|
||
from utils import check_evm_address, convert_camel_case | ||
|
||
from scalar.platform import Platform | ||
from scalar.network import Network | ||
from scalar.identity_graph import IdentityRecordSimplified | ||
from scalar.identity_record import IdentityRecord | ||
from scalar.profile import Profile | ||
from scalar.error import EmptyInput, EvmAddressInvalid, ExceedRangeInput | ||
|
||
QUERY_MAX_LIMIT = 200 | ||
|
||
|
||
async def query_profile_by_single_bitcoin(info, address): | ||
identity_record = IdentityRecord( | ||
id=f"{Platform.bitcoin.value},{address}", | ||
identity=address, | ||
platform=Platform.bitcoin.value, | ||
network=Network.bitcoin.value, | ||
primary_name=None, | ||
is_primary=False, | ||
profile=None | ||
) | ||
return identity_record | ||
|
||
async def query_profile_by_bitcoin_addresses(info, addresses): | ||
if len(addresses) > QUERY_MAX_LIMIT: | ||
return ExceedRangeInput(QUERY_MAX_LIMIT) | ||
|
||
logging.debug("query_profile_by_bitcoin_addresses %s", addresses) | ||
result = [] | ||
for addr in addresses: | ||
result.append(IdentityRecordSimplified( | ||
id=f"{Platform.bitcoin.value},{addr}", | ||
identity=addr, | ||
platform=Platform.bitcoin.value, | ||
network=Network.bitcoin.value, | ||
primary_name=None, | ||
is_primary=False, | ||
profile=None | ||
)) | ||
|
||
return result |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
#!/usr/bin/env python3 | ||
# -*- coding: utf-8 -*- | ||
''' | ||
Author: Zella Zhong | ||
Date: 2024-10-12 16:25:36 | ||
LastEditors: Zella Zhong | ||
LastEditTime: 2024-10-12 16:26:52 | ||
FilePath: /data_service/src/resolver/cosmos.py | ||
Description: | ||
''' | ||
import logging | ||
from datetime import datetime | ||
from sqlalchemy.inspection import inspect | ||
from sqlalchemy import select, update, and_, or_ | ||
from sqlalchemy.orm import load_only | ||
from urllib.parse import unquote | ||
|
||
from session import get_session | ||
from model import EnsnameModel | ||
|
||
from utils import check_evm_address, convert_camel_case | ||
|
||
from scalar.platform import Platform | ||
from scalar.network import Network | ||
from scalar.identity_graph import IdentityRecordSimplified | ||
from scalar.identity_record import IdentityRecord | ||
from scalar.profile import Profile | ||
from scalar.error import EmptyInput, EvmAddressInvalid, ExceedRangeInput | ||
|
||
QUERY_MAX_LIMIT = 200 | ||
|
||
|
||
async def query_profile_by_single_cosmos(info, address): | ||
identity_record = IdentityRecord( | ||
id=f"{Platform.cosmos.value},{address}", | ||
identity=address, | ||
platform=Platform.cosmos.value, | ||
network=Network.cosmos.value, | ||
primary_name=None, | ||
is_primary=False, | ||
profile=None | ||
) | ||
return identity_record | ||
|
||
async def query_profile_by_cosmos_addresses(info, addresses): | ||
if len(addresses) > QUERY_MAX_LIMIT: | ||
return ExceedRangeInput(QUERY_MAX_LIMIT) | ||
|
||
logging.debug("query_profile_by_cosmos_addresses %s", addresses) | ||
result = [] | ||
for addr in addresses: | ||
result.append(IdentityRecordSimplified( | ||
id=f"{Platform.cosmos.value},{addr}", | ||
identity=addr, | ||
platform=Platform.cosmos.value, | ||
network=Network.cosmos.value, | ||
primary_name=None, | ||
is_primary=False, | ||
profile=None | ||
)) | ||
|
||
return result |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
#!/usr/bin/env python3 | ||
# -*- coding: utf-8 -*- | ||
''' | ||
Author: Zella Zhong | ||
Date: 2024-10-12 16:24:51 | ||
LastEditors: Zella Zhong | ||
LastEditTime: 2024-10-12 16:26:46 | ||
FilePath: /data_service/src/resolver/dogecoin.py | ||
Description: | ||
''' | ||
import logging | ||
from datetime import datetime | ||
from sqlalchemy.inspection import inspect | ||
from sqlalchemy import select, update, and_, or_ | ||
from sqlalchemy.orm import load_only | ||
from urllib.parse import unquote | ||
|
||
from session import get_session | ||
from model import EnsnameModel | ||
|
||
from utils import check_evm_address, convert_camel_case | ||
|
||
from scalar.platform import Platform | ||
from scalar.network import Network | ||
from scalar.identity_graph import IdentityRecordSimplified | ||
from scalar.identity_record import IdentityRecord | ||
from scalar.profile import Profile | ||
from scalar.error import EmptyInput, EvmAddressInvalid, ExceedRangeInput | ||
|
||
QUERY_MAX_LIMIT = 200 | ||
|
||
|
||
async def query_profile_by_single_dogecoin(info, address): | ||
identity_record = IdentityRecord( | ||
id=f"{Platform.dogecoin.value},{address}", | ||
identity=address, | ||
platform=Platform.dogecoin.value, | ||
network=Network.dogecoin.value, | ||
primary_name=None, | ||
is_primary=False, | ||
profile=None | ||
) | ||
return identity_record | ||
|
||
async def query_profile_by_dogecoin_addresses(info, addresses): | ||
if len(addresses) > QUERY_MAX_LIMIT: | ||
return ExceedRangeInput(QUERY_MAX_LIMIT) | ||
|
||
logging.debug("query_profile_by_dogecoin_addresses %s", addresses) | ||
result = [] | ||
for addr in addresses: | ||
result.append(IdentityRecordSimplified( | ||
id=f"{Platform.dogecoin.value},{addr}", | ||
identity=addr, | ||
platform=Platform.dogecoin.value, | ||
network=Network.dogecoin.value, | ||
primary_name=None, | ||
is_primary=False, | ||
profile=None | ||
)) | ||
|
||
return result |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.