Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/story-protocol-od-dev' into stor…
Browse files Browse the repository at this point in the history
…y-protocol-od-prod

# Conflicts:
#	packages/webapp/public/.well-known/walletconnect.txt
  • Loading branch information
saltict committed Nov 19, 2024
2 parents 000d1d1 + aa8f327 commit 9cf87a6
Show file tree
Hide file tree
Showing 83 changed files with 4,915 additions and 220 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
"@polkadot/types-support": "^11.2.1",
"@polkadot/util": "^12.6.2",
"@polkadot/util-crypto": "^12.6.2",
"@subwallet/chain-list": "0.2.88",
"@subwallet/chain-list": "0.2.93",
"@subwallet/keyring": "^0.1.5",
"@subwallet/react-ui": "5.1.2-b79",
"@subwallet/ui-keyring": "^0.1.5",
Expand Down
2 changes: 1 addition & 1 deletion packages/extension-base/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
"@reduxjs/toolkit": "^1.9.1",
"@sora-substrate/type-definitions": "^1.17.7",
"@substrate/connect": "^0.8.9",
"@subwallet/chain-list": "0.2.88",
"@subwallet/chain-list": "0.2.93",
"@subwallet/extension-base": "^1.2.10-0",
"@subwallet/extension-chains": "^1.2.10-0",
"@subwallet/extension-dapp": "^1.2.10-0",
Expand Down
25 changes: 21 additions & 4 deletions packages/extension-base/src/background/KoniTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { AuthUrls } from '@subwallet/extension-base/services/request-service/typ
import { CrowdloanContributionsResponse } from '@subwallet/extension-base/services/subscan-service/types';
import { SWTransactionResponse, SWTransactionResult } from '@subwallet/extension-base/services/transaction-service/types';
import { WalletConnectNotSupportRequest, WalletConnectSessionRequest } from '@subwallet/extension-base/services/wallet-connect-service/types';
import { BalanceJson, BuyServiceInfo, BuyTokenInfo, EarningRewardHistoryItem, EarningRewardJson, EarningStatus, HandleYieldStepParams, LeavePoolAdditionalData, NominationPoolInfo, OptimalYieldPath, OptimalYieldPathParams, RequestEarlyValidateYield, RequestGetYieldPoolTargets, RequestStakeCancelWithdrawal, RequestStakeClaimReward, RequestUnlockDotCheckCanMint, RequestUnlockDotSubscribeMintedData, RequestYieldLeave, RequestYieldStepSubmit, RequestYieldWithdrawal, ResponseEarlyValidateYield, ResponseGetYieldPoolTargets, StorageDataInterface, SubmitYieldStepData, TokenSpendingApprovalParams, UnlockDotTransactionNft, UnstakingStatus, ValidateYieldProcessParams, YieldPoolInfo, YieldPositionInfo, YieldValidationStatus } from '@subwallet/extension-base/types';
import { BalanceJson, BuyServiceInfo, BuyTokenInfo, EarningRewardHistoryItem, EarningRewardJson, EarningStatus, HandleYieldStepParams, LeavePoolAdditionalData, NominationPoolInfo, OptimalYieldPath, OptimalYieldPathParams, RequestEarlyValidateYield, RequestGetYieldPoolTargets, RequestMintNft, RequestStakeCancelWithdrawal, RequestStakeClaimReward, RequestUnlockDotCheckCanMint, RequestUnlockDotSubscribeMintedData, RequestWalletConnectCancelSessionPromise, RequestWalletConnectCreateSession, RequestWalletConnectGetSessionPromise, RequestWCSendTransactionRequest, RequestWCSignMessageRequest, RequestYieldLeave, RequestYieldStepSubmit, RequestYieldWithdrawal, ResponseEarlyValidateYield, ResponseGetYieldPoolTargets, ResponseWalletConnectCancelSessionPromise, ResponseWalletConnectCreateSession, ResponseWalletConnectGetSessionPromise, ResponseWCSendTransactionRequest, ResponseWCSignMessageRequest, StorageDataInterface, SubmitYieldStepData, TokenSpendingApprovalParams, UnlockDotTransactionNft, UnstakingStatus, ValidateYieldProcessParams, YieldPoolInfo, YieldPositionInfo, YieldValidationStatus } from '@subwallet/extension-base/types';
import { CommonOptimalPath } from '@subwallet/extension-base/types/service-base';
import { SwapErrorType, SwapPair, SwapQuoteResponse, SwapRequest, SwapRequestResult, SwapSubmitParams, SwapTxData, ValidateSwapProcessParams } from '@subwallet/extension-base/types/swap';
import { InjectedAccount, InjectedAccountWithMeta, MetadataDefBase } from '@subwallet/extension-inject/types';
Expand Down Expand Up @@ -523,6 +523,8 @@ export enum ExtrinsicType {

SWAP = 'swap',

MINT_NFT = 'mint_nft',

// SET_FEE_TOKEN = 'set_fee-token',

EVM_EXECUTE = 'evm.execute',
Expand Down Expand Up @@ -577,6 +579,8 @@ export interface ExtrinsicDataTypeMap {

[ExtrinsicType.TOKEN_SPENDING_APPROVAL]: TokenSpendingApprovalParams,

[ExtrinsicType.MINT_NFT]: RequestMintNft,

[ExtrinsicType.EVM_EXECUTE]: TransactionConfig,
[ExtrinsicType.CROWDLOAN]: any,
[ExtrinsicType.SWAP]: SwapTxData
Expand Down Expand Up @@ -2377,14 +2381,24 @@ export interface KoniRequestSignatures {
'pub(token.add)': [RequestAddPspToken, boolean];

/// Wallet connect
'pri(walletConnect.connect)': [RequestConnectWalletConnect, boolean];
'pri(walletConnect.requests.connect.subscribe)': [null, WalletConnectSessionRequest[], WalletConnectSessionRequest[]];
'pri(walletConnect.subscribe.session)': [null, SessionTypes.Struct[], SessionTypes.Struct[]];
'pri(walletConnect.subscribe.projectId)': [null, string, string];

'pri(walletConnect.session.connect)': [RequestConnectWalletConnect, boolean];
'pri(walletConnect.session.approve)': [RequestApproveConnectWalletSession, boolean];
'pri(walletConnect.session.reject)': [RequestRejectConnectWalletSession, boolean];
'pri(walletConnect.session.reconnect)': [RequestReconnectConnectWalletSession, boolean];
'pri(walletConnect.session.subscribe)': [null, SessionTypes.Struct[], SessionTypes.Struct[]];
'pri(walletConnect.session.disconnect)': [RequestDisconnectWalletConnectSession, boolean];
'pri(walletConnect.session.create)': [RequestWalletConnectCreateSession, ResponseWalletConnectCreateSession];
'pri(walletConnect.session.promise)': [RequestWalletConnectGetSessionPromise, ResponseWalletConnectGetSessionPromise];
'pri(walletConnect.session.cancel)': [RequestWalletConnectCancelSessionPromise, ResponseWalletConnectCancelSessionPromise];

'pri(walletConnect.requests.connect.subscribe)': [null, WalletConnectSessionRequest[], WalletConnectSessionRequest[]];
'pri(walletConnect.requests.notSupport.subscribe)': [null, WalletConnectNotSupportRequest[], WalletConnectNotSupportRequest[]];

'pri(walletConnect.requests.evm.sign.message)': [RequestWCSignMessageRequest, ResponseWCSignMessageRequest];
'pri(walletConnect.requests.evm.send.transaction)': [RequestWCSendTransactionRequest, ResponseWCSendTransactionRequest];

'pri(walletConnect.notSupport.approve)': [RequestApproveWalletConnectNotSupport, boolean];
'pri(walletConnect.notSupport.reject)': [RequestRejectWalletConnectNotSupport, boolean];

Expand Down Expand Up @@ -2430,6 +2444,9 @@ export interface KoniRequestSignatures {
'pri(swapService.getLatestQuote)': [SwapRequest, SwapQuoteResponse];
'pri(swapService.validateSwapProcess)': [ValidateSwapProcessParams, TransactionError[]];
/* Swap */

/* Mint NFT */
'pri(odyssey.nft.mint)': [RequestMintNft, SWTransactionResponse];
}

export interface ApplicationMetadataType {
Expand Down
1 change: 1 addition & 0 deletions packages/extension-base/src/background/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ export interface AccountJson extends AbstractAddressJson {
parentAddress?: string;
source?: string;
suri?: string;
wcTopic?: string;
}

export interface AddressJson extends AbstractAddressJson {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

import { COMMON_CHAIN_SLUGS } from '@subwallet/chain-list';
import { _Address } from '@subwallet/extension-base/background/KoniTypes';
import { AbiItem } from 'web3-utils';

// eslint-disable-next-line @typescript-eslint/no-var-requires,@typescript-eslint/no-unsafe-assignment
export const _ERC20_ABI = require('./erc20_abi.json');
Expand All @@ -22,6 +23,8 @@ export const _NEUROGUNS_PSP34_ABI: Record<string, any> = require('./neuroguns_ps
export const _AZERO_DOMAIN_REGISTRY_ABI: Record<string, any> = require('./azero_domain_registry_abi.json');
// eslint-disable-next-line @typescript-eslint/no-var-requires,@typescript-eslint/no-unsafe-assignment
export const _SNOWBRIDGE_GATEWAY_ABI: Record<string, any> = require('./snowbridge_gateway_abi.json');
// eslint-disable-next-line @typescript-eslint/no-var-requires,@typescript-eslint/no-unsafe-assignment
export const _STORY_NFT_ABI: AbiItem[] = require('./story_nft_abi.json');

const SNOWBRIDGE_GATEWAY_ETHEREUM_CONTRACT_ADDRESS = '0x27ca963C279c93801941e1eB8799c23f407d68e7';
const SNOWBRIDGE_GATEWAY_SEPOLIA_CONTRACT_ADDRESS = '0x5B4909cE6Ca82d2CE23BD46738953c7959E710Cd';
Expand Down
Loading

0 comments on commit 9cf87a6

Please sign in to comment.