Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/webapp-dev' into koni/dev/issue-…
Browse files Browse the repository at this point in the history
…2086

# Conflicts:
#	packages/extension-koni-ui/src/Popup/Confirmations/variants/AddTokenConfirmation.tsx
#	packages/extension-koni-ui/src/Popup/Settings/Tokens/FungibleTokenImport.tsx
#	packages/extension-koni-ui/src/Popup/Settings/Tokens/TokenDetail.tsx
#	packages/extension-koni-ui/src/components/TokenItem/TokenSelectionItem.tsx
  • Loading branch information
lw-cdm committed Nov 2, 2023
2 parents 4e6c969 + e68ed6a commit 551e069
Show file tree
Hide file tree
Showing 133 changed files with 5,132 additions and 1,902 deletions.
9 changes: 8 additions & 1 deletion .123trigger
Original file line number Diff line number Diff line change
Expand Up @@ -79,4 +79,11 @@
1.1.8
1.1.9
1.1.10
1.1.12
1.1.12
1.1.13
1.1.14
1.1.15
1.1.16
1.1.17
1.1.18
1.1.19
3 changes: 2 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
TRANSAK_API_KEY=4b767e2c-2e01-45c9-978e-d32c6f0c8900
COINBASE_PAY_ID=1dbd2a0b94
NFT_MINTING_HOST=
NFT_MINTING_HOST=http://...
MARKETING_CAMPAIGN_URL=https://static-data.subwallet.app/marketing-campaigns/list.json
1 change: 1 addition & 0 deletions .github/workflows/push-koni-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ jobs:
GH_RELEASE_GITHUB_API_TOKEN: ${{ secrets.GH_PAT }}
TRANSAK_API_KEY: ${{ secrets.TRANSAK_API_KEY }}
COINBASE_PAY_ID: ${{ secrets.COINBASE_PAY_ID }}
MARKETING_CAMPAIGN_URL: https://static-data.subwallet.app/marketing-campaigns/preview.json
GH_RELEASE_FILES: master-build.zip,master-src.zip
COMMIT_MESSAGE: ${{ github.event.head_commit.message }}
REF_NAME: ${{ github.ref_name }}
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/push-master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ jobs:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
TRANSAK_API_KEY: ${{ secrets.TRANSAK_API_KEY }}
COINBASE_PAY_ID: ${{ secrets.COINBASE_PAY_ID }}
MARKETING_CAMPAIGN_URL: https://static-data.subwallet.app/marketing-campaigns/list.json
BRANCH_NAME: ${{ github.ref_name }}
run: |
yarn install --immutable | grep -v 'YN0013'
Expand Down
96 changes: 96 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,101 @@
# CHANGELOG

## 1.1.19
Build date: Oct 26, 2023.

Features & Update:
- Update chainlist (#2033)
- Review and update OnFinality RPC
- Remove Bobabeam network
- Add support ZetaChain EVM
- Add support Xcavate testnet

Bugs fixed:
- Fixed bug estimating fee on calculating max transferable (#2079)
- Fixed bug Get Ledger account addresses on incompatible networks (#2075)
- Fixed bug transfer on Rococo (#2042)

## 1.1.18
Build date: Oct 20, 2023.

Features & Update:
- Support notification in browser and banner in app (#2000)
- Update crowdloan data (#2035)
- Update message on the Create on account screen (#2039)

Bugs fixed:
- Fixed bug IPFS in Firefox browser (#1995)
- Fixed bug Do not show Acala, Karura NFT (#2029)
- Fixed bug Show apply master password when access via URL (2040)


## 1.1.17
Build date: Oct 17, 2023.

Features & Update:
The default Vara network is enabled (#2019)
- Update coinable ID for product environment (#2017)
- Replace the user feedback form when uninstalling extension (#2010)
- Update chain list (#1998)
- Update RPC for Pioneer network
- Add support for Vara NFTs
- Updated list of tokens supported by Transak (#2026)

## 1.1.16
Build date: Oct 07, 2023.

Features & Update:
- Add support for the sub0 2023 Biodiversity NFT Collection (#1982)

Bugs fixed:
- Fixed bug when connect to dApp via WallectConnect (#1981)


## 1.1.15
Build date: Sep 30, 2023.

Features & Update:
- Update token’s logo retrieval mechanism (#1947)
- Support Ledger for more chains (#1942)
- Karura
- xx network
- Polymesh
- Edgeware
- Update chain list (#1941)
- Add XCM support for more tokens:
- KSM: Kusma —> Amplitude
- USDC: Polkadot Asset Hub <—> HydraDX
- Integrated Neuroguns NFT Collection on the Astar network
- Integrated new networks: Bittensor, Dancebox
- Add staking support for Vara network
- Update price for some tokens: PANX, VARA
- Update RPC for Imbue network

Bugs fixed:
- Fixed bug Do not scroll the network list in case of connecting dApp via WalletConnect (#1926)
- Fixed bug Navigate incorrect in case Create one when connect dApp (#1930)

## 1.1.14
Build date: Sep 26, 2023.

Features & Update:
- Improve network and asset subscription (#1939)
- Update transfer function for Pendulum (#1950)

## 1.1.13
Build date: Sep 21, 2023.

Features & Update:
- Update empty list screens (#1857)
- Allow paste Amount to send (#1872)
- Add injected placeholder to avoid extension cannot load in the first time (#1906)

Bugs fixed:
- Fixed bug Do not show status of the crowd loans item (Acala) (#1860)
- Fixed bug Do not auto-lock after imported multiple account (#1910)
- Fixed bug Do not show selected account (#1919)


## 1.1.12
Build date: Sep 15, 2023.

Expand Down
6 changes: 3 additions & 3 deletions CONTRIBUTORS
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
1860 Nam Phạm [Issue 1821] update nft logic for azero domain
1600 AnhMTV Release version 1.1.12
1274 S2kael [Issue-1896] Update transfer for acala evm
1864 Nam Phạm [Issue 2079] remove logs and adjust wording
1650 AnhMTV Release version 1.1.19
1360 S2kael
465 Jaco 0.42.5 (#969)
285 lw-cdm [Issue-1009] Fix issue causes history detail modal sometime displays incorrectly
185 quangdo
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"url": "https://github.com/Koniverse/Subwallet-V2.git"
},
"sideEffects": false,
"version": "1.1.12",
"version": "1.1.19",
"workspaces": [
"packages/*"
],
Expand Down Expand Up @@ -85,7 +85,7 @@
"@polkadot/types": "^10.9.1",
"@polkadot/util": "^12.3.2",
"@polkadot/util-crypto": "^12.3.2",
"@subwallet/chain-list": "0.2.18-beta.2",
"@subwallet/chain-list": "0.2.19",
"@subwallet/keyring": "^0.1.1",
"@subwallet/ui-keyring": "^0.1.1",
"babel-core": "^7.0.0-bridge.0",
Expand Down
17 changes: 9 additions & 8 deletions packages/extension-base/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"./detectPackage.cjs"
],
"type": "module",
"version": "1.1.12-1",
"version": "1.1.19-0",
"main": "index.js",
"dependencies": {
"@acala-network/api": "^5.0.2",
Expand Down Expand Up @@ -47,11 +47,11 @@
"@reduxjs/toolkit": "^1.9.1",
"@sora-substrate/type-definitions": "^1.17.7",
"@substrate/connect": "^0.7.26",
"@subwallet/chain-list": "0.2.18-beta.2",
"@subwallet/extension-base": "^1.1.12-1",
"@subwallet/extension-chains": "^1.1.12-1",
"@subwallet/extension-dapp": "^1.1.12-1",
"@subwallet/extension-inject": "^1.1.12-1",
"@subwallet/chain-list": "0.2.19",
"@subwallet/extension-base": "^1.1.19-0",
"@subwallet/extension-chains": "^1.1.19-0",
"@subwallet/extension-dapp": "^1.1.19-0",
"@subwallet/extension-inject": "^1.1.19-0",
"@subwallet/keyring": "^0.1.1",
"@subwallet/ui-keyring": "^0.1.1",
"@walletconnect/sign-client": "^2.8.4",
Expand All @@ -61,6 +61,7 @@
"axios": "^1.2.1",
"bignumber.js": "^9.1.1",
"bn.js": "^5.2.1",
"bowser": "^2.11.0",
"browser-passworder": "^2.0.3",
"buffer": "^6.0.3",
"cross-fetch": "^3.1.5",
Expand All @@ -70,7 +71,7 @@
"ethereumjs-util": "^7.1.5",
"ethers": "^6.4.2",
"eventemitter3": "^5.0.0",
"graphql": "^16.6.0",
"graphql": "^16.8.1",
"i18next": "^21.9.2",
"is-buffer": "^2.0.5",
"json-rpc-engine": "^6.1.0",
Expand All @@ -88,7 +89,7 @@
"web3-utils": "^1.10.0"
},
"devDependencies": {
"@subwallet/extension-mocks": "^1.1.12-1",
"@subwallet/extension-mocks": "^1.1.19-0",
"@types/uuid": "^9.0.1"
}
}
93 changes: 84 additions & 9 deletions packages/extension-base/src/background/KoniTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1396,15 +1396,15 @@ export interface ResponseParseEvmContractInput {
/// Ledger

export interface LedgerNetwork {
genesisHash: string;
networkName: string;
accountName: string;
appName: string;
genesisHash: string; // GenesisHash for substrate app
networkName: string; // Display in selector
accountName: string; // Name for account(Ledger X Account)
appName: string; // Name in Ledger
network: string; // network is predefined in ledger lib
slug: string; // slug in chain list
icon: 'substrate' | 'ethereum';
isDevMode: boolean;
isEthereum: boolean;
icon: 'substrate' | 'ethereum'; // Deprecated
isDevMode: boolean; // Dev mode on Ledger
isEthereum: boolean; // Use for evm account
}
/// On-ramp

Expand Down Expand Up @@ -1957,6 +1957,11 @@ export enum NotificationType {
WARNING = 'warning',
ERROR = 'error',
}

export interface NotificationButton {
title: string;
}

export interface Notification {
id: number;
type: NotificationType;
Expand All @@ -1965,7 +1970,10 @@ export interface Notification {
notifyViaBrowser?: boolean;
action?: {
url?: string; // Add more action in the future
}
buttonClick?: (btnIndex: number) => void;
click?: () => void;
};
buttons?: NotificationButton[];
}

export type NotificationParams = Omit<Notification, 'id'>;
Expand Down Expand Up @@ -2306,6 +2314,68 @@ export interface SubmitJoinNominationPool {
nominatorMetadata?: NominatorMetadata
}

/* Campaign */

export type CampaignAction = 'open_view' | 'open_url' | null;

export interface CampaignButton {
id: number;
color: string;
icon: string | null;
name: string;
type: CampaignAction;
metadata: Record<string, any> | null;
}

export enum CampaignDataType {
NOTIFICATION = 'notification',
BANNER ='banner'
}

export interface BaseCampaignData {
slug: string;
campaignId: number;
isDone: boolean;
type: CampaignDataType;
data: Record<string, any>;
buttons: CampaignButton[];
startTime: number;
endTime: number;
condition: Record<string, any> | null;
}

export interface CampaignBanner extends BaseCampaignData {
type: CampaignDataType.BANNER;
data: {
media: string;
alt: string;
action: CampaignAction;
metadata: Record<string, any> | null;
environments: string[];
position: string[];
}
}

export interface CampaignNotification extends BaseCampaignData {
type: CampaignDataType.NOTIFICATION;
data: {
title: string;
message: string;
repeat: number;
repeatAfter: number;
action: CampaignAction;
metadata: Record<string, any> | null;
}
}

export type CampaignData = CampaignBanner | CampaignNotification;

export interface RequestCampaignBannerComplete {
slug: string;
}

/* Campaign */

// Use stringify to communicate, pure boolean value will error with case 'false' value
export interface KoniRequestSignatures {
// Bonding functions
Expand Down Expand Up @@ -2385,7 +2455,7 @@ export interface KoniRequestSignatures {

// Auth
'pri(authorize.listV2)': [null, ResponseAuthorizeList];
'pri(authorize.requestsV2)': [RequestAuthorizeSubscribe, boolean, AuthorizeRequest[]];
'pri(authorize.requestsV2)': [RequestAuthorizeSubscribe, AuthorizeRequest[], AuthorizeRequest[]];
'pri(authorize.approveV2)': [RequestAuthorizeApproveV2, boolean];
'pri(authorize.changeSiteAll)': [RequestAuthorizationAll, boolean, AuthUrls];
'pri(authorize.changeSite)': [RequestAuthorization, boolean, AuthUrls];
Expand Down Expand Up @@ -2595,6 +2665,11 @@ export interface KoniRequestSignatures {
'pri(campaign.unlockDot.subscribe)': [RequestUnlockDotSubscribeMintedData, UnlockDotTransactionNft, UnlockDotTransactionNft]

/* Campaign */

/* Campaign */
'pri(campaign.banner.subscribe)': [null, CampaignBanner[], CampaignBanner[]];
'pri(campaign.banner.complete)': [RequestCampaignBannerComplete, boolean];
/* Campaign */
}

export interface ApplicationMetadataType {
Expand Down
8 changes: 4 additions & 4 deletions packages/extension-base/src/background/handlers/Extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ export default class Extension {
return true;
}

private metadataSubscribe (id: string, port: chrome.runtime.Port): boolean {
private metadataSubscribe (id: string, port: chrome.runtime.Port): MetadataRequest[] {
const cb = createSubscription<'pri(metadata.requests)'>(id, port);
const subscription = this.#state.metaSubject.subscribe((requests: MetadataRequest[]): void =>
cb(requests)
Expand All @@ -272,7 +272,7 @@ export default class Extension {
subscription.unsubscribe();
});

return true;
return this.#state.metaSubject.value;
}

private jsonRestore ({ file, password }: RequestJsonRestore): void {
Expand Down Expand Up @@ -437,7 +437,7 @@ export default class Extension {
}

// FIXME This looks very much like what we have in authorization
private signingSubscribe (id: string, port: chrome.runtime.Port): boolean {
private signingSubscribe (id: string, port: chrome.runtime.Port): SigningRequest[] {
const cb = createSubscription<'pri(signing.requests)'>(id, port);
const subscription = this.#state.signSubject.subscribe((requests: SigningRequest[]): void =>
cb(requests)
Expand All @@ -448,7 +448,7 @@ export default class Extension {
subscription.unsubscribe();
});

return true;
return this.#state.signSubject.value;
}

private windowOpen ({ allowedPath: path, params, subPath }: WindowOpenParams): boolean {
Expand Down
Loading

0 comments on commit 551e069

Please sign in to comment.