Skip to content

Commit

Permalink
chore: update sdk names (#10)
Browse files Browse the repository at this point in the history
  • Loading branch information
meeh0w authored Aug 1, 2024
1 parent 85dbef4 commit 0e95bdc
Show file tree
Hide file tree
Showing 623 changed files with 1,138 additions and 931 deletions.
2 changes: 1 addition & 1 deletion docs/09-Keystone.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import { CryptoMultiAccounts } from '@keystonehq/bc-ur-registry-eth';
import {
getAddressFromXPub,
getBech32AddressFromXPub,
} from '@avalabs/wallets-sdk';
} from '@avalabs/core-wallets-sdk';

const decoder = new URDecoder();
decoder.receivePart(qrcode2);
Expand Down
28 changes: 16 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"name": "avalanche-extension",
"version": "0.0.0",
"license": "Limited Ecosystem License",
"private": true,
"scripts": {
"start": "yarn dev",
"build:inpage": "webpack --config webpack.inpage.js",
Expand All @@ -22,22 +23,22 @@
"sentry": "node sentryscript.js"
},
"dependencies": {
"@avalabs/vm-module-types": "0.0.15",
"@avalabs/vm-module-types": "0.1.0",
"@avalabs/avalanchejs": "4.0.5",
"@avalabs/bridge-sdk": "2.8.0-alpha.188",
"@avalabs/bridge-unified": "2.1.0",
"@avalabs/chains-sdk": "2.8.0-alpha.188",
"@avalabs/coingecko-sdk": "2.8.0-alpha.188",
"@avalabs/covalent-sdk": "2.8.0-alpha.188",
"@avalabs/etherscan-sdk": "2.8.0-alpha.188",
"@avalabs/core-bridge-sdk": "3.0.0",
"@avalabs/core-chains-sdk": "3.0.0",
"@avalabs/core-coingecko-sdk": "3.0.0",
"@avalabs/core-covalent-sdk": "3.0.0",
"@avalabs/core-etherscan-sdk": "3.0.0",
"@avalabs/core-snowtrace-sdk": "3.0.0",
"@avalabs/core-token-prices-sdk": "3.0.0",
"@avalabs/core-utils-sdk": "3.0.0",
"@avalabs/core-wallets-sdk": "3.0.0",
"@avalabs/glacier-sdk": "2.8.0-alpha.188",
"@avalabs/hw-app-avalanche": "0.14.1",
"@avalabs/k2-components": "4.18.0-alpha.41",
"@avalabs/snowtrace-sdk": "2.8.0-alpha.188",
"@avalabs/token-prices-sdk": "2.8.0-alpha.188",
"@avalabs/core-k2-components": "4.18.0-alpha.44",
"@avalabs/types": "2.8.0-alpha.188",
"@avalabs/utils-sdk": "2.8.0-alpha.188",
"@avalabs/wallets-sdk": "2.8.0-alpha.188",
"@blockaid/client": "0.10.0",
"@coinbase/cbpay-js": "1.6.0",
"@cubist-labs/cubesigner-sdk": "0.3.28",
Expand Down Expand Up @@ -243,7 +244,10 @@
"@avalabs/vm-module-types": false,
"@avalabs/vm-module-types>@avalabs/wallets-sdk>@avalabs/hw-app-avalanche>@ledgerhq/hw-app-eth>@ledgerhq/domain-service>eip55>keccak": false,
"@avalabs/vm-module-types>@avalabs/wallets-sdk>@ledgerhq/hw-app-btc>bitcoinjs-lib>bip32>tiny-secp256k1": false,
"@avalabs/vm-module-types>@avalabs/wallets-sdk>hdkey>secp256k1": false
"@avalabs/vm-module-types>@avalabs/wallets-sdk>hdkey>secp256k1": false,
"@avalabs/core-bridge-sdk>@avalabs/core-wallets-sdk>@avalabs/hw-app-avalanche>@ledgerhq/hw-app-eth>@ledgerhq/domain-service>eip55>keccak": false,
"@avalabs/core-bridge-sdk>@avalabs/core-wallets-sdk>@ledgerhq/hw-app-btc>bitcoinjs-lib>bip32>tiny-secp256k1": false,
"@avalabs/core-bridge-sdk>@avalabs/core-wallets-sdk>hdkey>secp256k1": false
}
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { DEFERRED_RESPONSE } from './../middlewares/models';
import { resolve } from '@avalabs/utils-sdk';
import { resolve } from '@avalabs/core-utils-sdk';
import {
connectionLog,
disconnectLog,
Expand Down
2 changes: 1 addition & 1 deletion src/background/connections/dAppConnection/models.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Maybe } from '@avalabs/utils-sdk';
import { Maybe } from '@avalabs/core-utils-sdk';
import { DomainMetadata } from '@src/background/models';
import { EthereumProviderError } from 'eth-rpc-errors';
import { SerializedEthereumRpcError } from 'eth-rpc-errors/dist/classes';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import {
responseLog,
} from '@src/utils/logging';

import { resolve } from '@avalabs/utils-sdk';
import { resolve } from '@avalabs/core-utils-sdk';
import { isDevelopment } from '@src/utils/environment';
import './registry';
import '../dAppConnection/registry';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Middleware } from './models';
import { NetworkService } from '@src/background/services/network/NetworkService';
import { NetworkVMType } from '@avalabs/chains-sdk';
import { NetworkVMType } from '@avalabs/core-chains-sdk';
import { JsonRpcRequest, JsonRpcResponse } from '../dAppConnection/models';

export function RPCCallsMiddleware(
Expand Down
2 changes: 1 addition & 1 deletion src/background/providers/CoreProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import {
} from '../connections/dAppConnection/models';
import { PartialBy, ProviderInfo } from '../models';
import AbstractConnection from '../utils/messaging/AbstractConnection';
import { ChainId } from '@avalabs/chains-sdk';
import { ChainId } from '@avalabs/core-chains-sdk';

interface ProviderState {
accounts: string[] | null;
Expand Down
2 changes: 1 addition & 1 deletion src/background/providers/MultiWalletProviderProxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
} from '../connections/dAppConnection/models';
import { getWalletExtensionType } from './utils/getWalletExtensionType';
import { CoreProvider } from './CoreProvider';
import { Maybe } from '@avalabs/utils-sdk';
import { Maybe } from '@avalabs/core-utils-sdk';
import EventEmitter from 'events';

export class MultiWalletProviderProxy extends EventEmitter {
Expand Down
2 changes: 1 addition & 1 deletion src/background/services/accounts/AccountsService.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
ImportType,
ImportData,
} from './models';
import { NetworkVMType } from '@avalabs/chains-sdk';
import { NetworkVMType } from '@avalabs/core-chains-sdk';
import { WalletConnectStorage } from '../walletConnect/WalletConnectStorage';
import { WalletConnectService } from '../walletConnect/WalletConnectService';
import { PermissionsService } from '../permissions/PermissionsService';
Expand Down
2 changes: 1 addition & 1 deletion src/background/services/accounts/AccountsService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import {
import { OnLock, OnUnlock } from '@src/background/runtime/lifecycleCallbacks';
import { WalletService } from '../wallet/WalletService';
import { NetworkService } from '../network/NetworkService';
import { NetworkVMType } from '@avalabs/chains-sdk';
import { NetworkVMType } from '@avalabs/core-chains-sdk';
import { PermissionsService } from '../permissions/PermissionsService';
import { isProductionBuild } from '@src/utils/environment';
import { DerivedAddresses, SecretType } from '../secrets/models';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { Avalanche } from '@avalabs/wallets-sdk';
import { Avalanche } from '@avalabs/core-wallets-sdk';
import { DAppProviderRequest } from '@src/background/connections/dAppConnection/models';
import { ethErrors } from 'eth-rpc-errors';
import { AvalancheGetAddressesInRangeHandler } from './avalanche_getAddressesInRange';
import { buildRpcCall } from '@src/tests/test-utils';

jest.mock('@avalabs/wallets-sdk');
jest.mock('@avalabs/core-wallets-sdk');

describe('background/services/accounts/handlers/avalanche_getAddressesInRange.ts', () => {
const getPrimaryAccountSecretsMock = jest.fn();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { ethErrors } from 'eth-rpc-errors';
import { injectable } from 'tsyringe';
import { DAppRequestHandler } from '@src/background/connections/dAppConnection/DAppRequestHandler';
import { DAppProviderRequest } from '@src/background/connections/dAppConnection/models';
import { Avalanche } from '@avalabs/wallets-sdk';
import { Avalanche } from '@avalabs/core-wallets-sdk';
import { SecretsService } from '../../secrets/SecretsService';
import { NetworkService } from '../../network/NetworkService';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ import { GetPrivateKeyHandler } from './getPrivateKey';
import { AccountType, GetPrivateKeyErrorTypes } from '../models';
import { LockService } from '../../lock/LockService';
import { SecretType } from '../../secrets/models';
import { getWalletFromMnemonic } from '@avalabs/wallets-sdk';
import { getWalletFromMnemonic } from '@avalabs/core-wallets-sdk';
import { buildRpcCall } from '@src/tests/test-utils';

jest.mock('@avalabs/wallets-sdk', () => ({
...jest.requireActual('@avalabs/wallets-sdk'),
jest.mock('@avalabs/core-wallets-sdk', () => ({
...jest.requireActual('@avalabs/core-wallets-sdk'),
getWalletFromMnemonic: jest.fn(),
}));

Expand Down
2 changes: 1 addition & 1 deletion src/background/services/accounts/handlers/getPrivateKey.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { ExtensionRequest } from '@src/background/connections/extensionConnectio
import { ExtensionRequestHandler } from '@src/background/connections/models';
import { injectable } from 'tsyringe';
import { SecretsService } from '../../secrets/SecretsService';
import { getWalletFromMnemonic } from '@avalabs/wallets-sdk';
import { getWalletFromMnemonic } from '@avalabs/core-wallets-sdk';
import { AccountType, GetPrivateKeyErrorTypes } from '../models';
import { utils } from '@avalabs/avalanchejs';
import { LockService } from '../../lock/LockService';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { FeatureFlagService } from '../featureFlags/FeatureFlagService';
import { FeatureGates } from '../featureFlags/models';

import { HttpClient } from '@avalabs/utils-sdk';
import { HttpClient } from '@avalabs/core-utils-sdk';
import { AnalyticsServicePosthog } from './AnalyticsServicePosthog';
import { AnalyticsService } from './AnalyticsService';
import { SettingsService } from '../settings/SettingsService';
Expand All @@ -11,10 +11,10 @@ import sentryCaptureException, {
import browser from 'webextension-polyfill';
import { encryptAnalyticsData } from './utils/encryptAnalyticsData';
import { AnalyticsConsent } from '../settings/models';
import { ChainId } from '@avalabs/chains-sdk';
import { ChainId } from '@avalabs/core-chains-sdk';
import { BlockchainId } from './models';

jest.mock('@avalabs/utils-sdk');
jest.mock('@avalabs/core-utils-sdk');
jest.mock('@src/monitoring/sentryCaptureException');
jest.mock('webextension-polyfill');
jest.mock('./utils/encryptAnalyticsData');
Expand Down
4 changes: 2 additions & 2 deletions src/background/services/analytics/AnalyticsServicePosthog.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { HttpClient } from '@avalabs/utils-sdk';
import { HttpClient } from '@avalabs/core-utils-sdk';
import { getUserEnvironment } from '@src/utils/getUserEnvironment';
import { singleton } from 'tsyringe';
import { FeatureFlagService } from '../featureFlags/FeatureFlagService';
Expand All @@ -11,7 +11,7 @@ import { encryptAnalyticsData } from './utils/encryptAnalyticsData';
import sentryCaptureException, {
SentryExceptionTypes,
} from '@src/monitoring/sentryCaptureException';
import { ChainId } from '@avalabs/chains-sdk';
import { ChainId } from '@avalabs/core-chains-sdk';

@singleton()
export class AnalyticsServicePosthog {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import BN from 'bn.js';
import * as Sentry from '@sentry/browser';
import { Network, NetworkToken, NetworkVMType } from '@avalabs/chains-sdk';
import { Network, NetworkToken, NetworkVMType } from '@avalabs/core-chains-sdk';

import { StorageService } from '../storage/StorageService';
import { SettingsService } from '../settings/SettingsService';
Expand Down Expand Up @@ -51,6 +51,7 @@ describe('src/background/services/balances/BalanceAggregatorService.ts', () => {
chainId: 1,
vmName: NetworkVMType.EVM,
rpcUrl: 'test.one.com/rpc',
explorerUrl: 'https://explorer.url',
networkToken: networkToken1,
logoUri: 'test.one.com/logo',
primaryColor: 'purple',
Expand All @@ -69,6 +70,7 @@ describe('src/background/services/balances/BalanceAggregatorService.ts', () => {
chainId: 2,
vmName: NetworkVMType.EVM,
rpcUrl: 'test.two.com/rpc',
explorerUrl: 'https://explorer.url',
networkToken: networkToken2,
logoUri: 'test.two.com/logo',
primaryColor: 'brown',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import {
TokensPriceShortData,
priceChangeRefreshRate,
} from '../tokens/models';
import { resolve } from '@avalabs/utils-sdk';
import { resolve } from '@avalabs/core-utils-sdk';
import { SettingsService } from '../settings/SettingsService';
import { isFulfilled } from '@src/utils/typeUtils';

Expand Down
6 changes: 5 additions & 1 deletion src/background/services/balances/BalancesService.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import { AVALANCHE_XP_TEST_NETWORK, NetworkVMType } from '@avalabs/chains-sdk';
import {
AVALANCHE_XP_TEST_NETWORK,
NetworkVMType,
} from '@avalabs/core-chains-sdk';
import { BalancesService } from './BalancesService';
import { AccountType } from '../accounts/models';
import BN from 'bn.js';
Expand Down Expand Up @@ -47,6 +50,7 @@ describe('src/background/services/balances/BalancesService.ts', () => {
chainId: 123,
vmName: NetworkVMType.EVM,
rpcUrl: 'testChainRpcUrl',
explorerUrl: 'https://explorer.url',
networkToken: {
name: 'testChainName',
symbol: 'TEST',
Expand Down
2 changes: 1 addition & 1 deletion src/background/services/balances/BalancesService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
GlacierUnhealthyError,
TokenWithBalance,
} from '@src/background/services/balances/models';
import { ChainId, NetworkVMType } from '@avalabs/chains-sdk';
import { ChainId, NetworkVMType } from '@avalabs/core-chains-sdk';
import { Account } from '../accounts/models';
import { isEthereumNetwork } from '../network/utils/isEthereumNetwork';
import { BalancesServiceGlacier } from './BalancesServiceGlacier';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {
AVALANCHE_XP_TEST_NETWORK,
ChainId,
NetworkVMType,
} from '@avalabs/chains-sdk';
} from '@avalabs/core-chains-sdk';
import { Account, AccountType } from '../accounts/models';
import BN from 'bn.js';
import {
Expand Down
4 changes: 2 additions & 2 deletions src/background/services/balances/BalancesServiceAVM.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { GlacierService } from '../glacier/GlacierService';
import { TokenPricesService } from './TokenPricesService';
import { SettingsService } from '../settings/SettingsService';
import { Account } from '../accounts/models';
import { Network } from '@avalabs/chains-sdk';
import { Network } from '@avalabs/core-chains-sdk';
import {
NetworkTokenWithBalance,
TokenType,
Expand All @@ -22,7 +22,7 @@ import {
import sentryCaptureException, {
SentryExceptionTypes,
} from '@src/monitoring/sentryCaptureException';
import { balanceToDisplayValue, bnToBig } from '@avalabs/utils-sdk';
import { balanceToDisplayValue, bnToBig } from '@avalabs/core-utils-sdk';
import BN from 'bn.js';
import { getTokenValue } from './utils/getTokenValue';
import { calculateTotalBalance } from './utils/calculateTotalBalance';
Expand Down
8 changes: 4 additions & 4 deletions src/background/services/balances/BalancesServiceBTC.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { satoshiToBtc } from '@avalabs/bridge-sdk';
import { Network, NetworkVMType } from '@avalabs/chains-sdk';
import { balanceToDisplayValue, bigToBN } from '@avalabs/utils-sdk';
import { satoshiToBtc } from '@avalabs/core-bridge-sdk';
import { Network, NetworkVMType } from '@avalabs/core-chains-sdk';
import { balanceToDisplayValue, bigToBN } from '@avalabs/core-utils-sdk';
import { TokenPricesService } from '@src/background/services/balances/TokenPricesService';
import { NetworkService } from '@src/background/services/network/NetworkService';
import { singleton } from 'tsyringe';
Expand All @@ -9,7 +9,7 @@ import { SettingsService } from '../settings/SettingsService';
import { TokenType, TokenWithBalance } from './models';
import * as Sentry from '@sentry/browser';
import { TokensPriceShortData } from '../tokens/models';
import { BitcoinProvider } from '@avalabs/wallets-sdk';
import { BitcoinProvider } from '@avalabs/core-wallets-sdk';
import { getPriceChangeValues } from './utils/getPriceChangeValues';

@singleton()
Expand Down
6 changes: 3 additions & 3 deletions src/background/services/balances/BalancesServiceEVM.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ import {
bigToBN,
numberToBN,
bnToBig,
} from '@avalabs/utils-sdk';
} from '@avalabs/core-utils-sdk';
import { NetworkService } from '@src/background/services/network/NetworkService';
import ERC20 from '@openzeppelin/contracts/build/contracts/ERC20.json';
import { TokenPricesService } from '@src/background/services/balances/TokenPricesService';
import { NetworkTokenWithBalance, TokenWithBalance, TokenType } from './models';
import { NetworkContractToken } from '@avalabs/chains-sdk';
import { NetworkContractToken } from '@avalabs/core-chains-sdk';
import { TokenManagerService } from '../tokens/TokenManagerService';
import { JsonRpcBatchInternal } from '@avalabs/wallets-sdk';
import { JsonRpcBatchInternal } from '@avalabs/core-wallets-sdk';
import { SettingsService } from '../settings/SettingsService';
import BN from 'bn.js';
import { Account } from '../accounts/models';
Expand Down
4 changes: 2 additions & 2 deletions src/background/services/balances/BalancesServiceGlacier.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Network, NetworkContractToken } from '@avalabs/chains-sdk';
import { Network, NetworkContractToken } from '@avalabs/core-chains-sdk';
import {
NativeTokenBalance,
Erc20TokenBalance,
Expand All @@ -8,7 +8,7 @@ import {
ListErc721BalancesResponse,
ListErc1155BalancesResponse,
} from '@avalabs/glacier-sdk';
import { balanceToDisplayValue, bnToBig } from '@avalabs/utils-sdk';
import { balanceToDisplayValue, bnToBig } from '@avalabs/core-utils-sdk';
import { singleton } from 'tsyringe';
import { SettingsService } from '../settings/SettingsService';
import { TokenManagerService } from '../tokens/TokenManagerService';
Expand Down
5 changes: 4 additions & 1 deletion src/background/services/balances/BalancesServicePVM.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import { AVALANCHE_XP_TEST_NETWORK, NetworkVMType } from '@avalabs/chains-sdk';
import {
AVALANCHE_XP_TEST_NETWORK,
NetworkVMType,
} from '@avalabs/core-chains-sdk';
import { Account, AccountType } from '../accounts/models';
import BN from 'bn.js';
import {
Expand Down
4 changes: 2 additions & 2 deletions src/background/services/balances/BalancesServicePVM.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { stripAddressPrefix } from '@src/utils/stripAddressPrefix';
import { Network } from '@avalabs/chains-sdk';
import { Network } from '@avalabs/core-chains-sdk';
import {
BlockchainId,
CChainAtomicBalances,
Expand All @@ -18,7 +18,7 @@ import {
TokenWithBalancePVM,
} from './models';
import BN from 'bn.js';
import { balanceToDisplayValue, bnToBig } from '@avalabs/utils-sdk';
import { balanceToDisplayValue, bnToBig } from '@avalabs/core-utils-sdk';
import * as Sentry from '@sentry/browser';
import sentryCaptureException, {
SentryExceptionTypes,
Expand Down
9 changes: 6 additions & 3 deletions src/background/services/balances/TokenPricesService.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
import { singleton } from 'tsyringe';
import { SimplePriceInCurrency } from '@avalabs/coingecko-sdk';
import { SimplePriceInCurrency } from '@avalabs/core-coingecko-sdk';
import { SettingsService } from '../settings/SettingsService';
import { getTokensPrice } from '@avalabs/token-prices-sdk';
import { simplePrice, getBasicCoingeckoHttp } from '@avalabs/coingecko-sdk';
import { getTokensPrice } from '@avalabs/core-token-prices-sdk';
import {
simplePrice,
getBasicCoingeckoHttp,
} from '@avalabs/core-coingecko-sdk';
import LRUCache from 'lru-cache';

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Avalanche, BitcoinProvider } from '@avalabs/wallets-sdk';
import { Avalanche, BitcoinProvider } from '@avalabs/core-wallets-sdk';
import { ExtensionRequest } from '@src/background/connections/extensionConnection/models';
import { ExtensionRequestHandler } from '@src/background/connections/models';
import { getProviderForNetwork } from '@src/utils/network/getProviderForNetwork';
Expand Down
Loading

0 comments on commit 0e95bdc

Please sign in to comment.