-
Notifications
You must be signed in to change notification settings - Fork 260
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: added getWalletActiveChains(). (#1155)
- Loading branch information
Showing
19 changed files
with
433 additions
and
15 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,7 @@ | ||
--- | ||
'@moralisweb3/common-evm-utils': patch | ||
'@moralisweb3/evm-api': patch | ||
'moralis': patch | ||
--- | ||
|
||
Added a new endpoint method to the EVM API module: `Moralis.EvmApi.wallets.getWalletActiveChains`. |
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
49 changes: 49 additions & 0 deletions
49
packages/common/evmUtils/src/generated/operations/GetWalletActiveChainsOperation.ts
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,49 @@ | ||
import { EvmAddress, EvmAddressInput, EvmAddressJSON, EvmChain, EvmChainInput, EvmChainJSON } from '../../dataTypes'; | ||
import { EvmWalletActiveChains, EvmWalletActiveChainsJSON } from '../types/EvmWalletActiveChains'; | ||
|
||
// request parameters: | ||
// - address ($ref: #/paths/~1wallets~1{address}~1chains/get/parameters/0/schema) | ||
// - chains ($ref: #/components/schemas/chainList) | ||
|
||
export interface GetWalletActiveChainsOperationRequest { | ||
/** | ||
* @description Wallet address | ||
*/ | ||
readonly address: EvmAddressInput | EvmAddress; | ||
/** | ||
* @description The chains to query | ||
*/ | ||
readonly chains?: EvmChainInput[] | EvmChain[]; | ||
} | ||
|
||
export interface GetWalletActiveChainsOperationRequestJSON { | ||
readonly address: EvmAddressJSON; | ||
readonly chains?: EvmChainJSON[]; | ||
} | ||
|
||
export type GetWalletActiveChainsOperationResponse = EvmWalletActiveChains; | ||
export type GetWalletActiveChainsOperationResponseJSON = EvmWalletActiveChainsJSON; | ||
|
||
export const GetWalletActiveChainsOperation = { | ||
operationId: "getWalletActiveChains", | ||
groupName: "wallets", | ||
httpMethod: "get", | ||
routePattern: "/wallets/{address}/chains", | ||
parameterNames: ["address","chains"], | ||
hasResponse: true, | ||
hasBody: false, | ||
|
||
parseResponse(json: EvmWalletActiveChainsJSON): EvmWalletActiveChains { | ||
return EvmWalletActiveChains.fromJSON(json); | ||
}, | ||
|
||
serializeRequest(request: GetWalletActiveChainsOperationRequest): GetWalletActiveChainsOperationRequestJSON { | ||
const address = EvmAddress.create(request.address); | ||
const chains = request.chains ? request.chains.map((item) => EvmChain.create(item)) : undefined; | ||
return { | ||
address: address.toJSON(), | ||
chains: chains ? chains.map((item) => item.toJSON()) : undefined, | ||
}; | ||
}, | ||
|
||
} |
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
21 changes: 21 additions & 0 deletions
21
packages/common/evmUtils/src/generated/types/EvmErc20TransferFromWalletLabel.ts
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,21 @@ | ||
// $ref: #/components/schemas/erc20Transfer/properties/from_wallet_label | ||
// typeName: erc20Transfer_from_wallet_label | ||
// unionType: oneOf | ||
|
||
export type EvmErc20TransferFromWalletLabelJSON = string | null; | ||
export type EvmErc20TransferFromWalletLabelInput = string | null; | ||
export type EvmErc20TransferFromWalletLabelValue = string | null; | ||
|
||
export abstract class EvmErc20TransferFromWalletLabel { | ||
public static create(input: EvmErc20TransferFromWalletLabelInput): EvmErc20TransferFromWalletLabelValue { | ||
return input; | ||
} | ||
|
||
public static fromJSON(json: EvmErc20TransferFromWalletLabelJSON): EvmErc20TransferFromWalletLabelValue { | ||
return json; | ||
} | ||
|
||
public static toJSON(value: EvmErc20TransferFromWalletLabelValue): EvmErc20TransferFromWalletLabelJSON { | ||
return value; | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
packages/common/evmUtils/src/generated/types/EvmErc20TransferToWalletLabel.ts
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,21 @@ | ||
// $ref: #/components/schemas/erc20Transfer/properties/to_wallet_label | ||
// typeName: erc20Transfer_to_wallet_label | ||
// unionType: oneOf | ||
|
||
export type EvmErc20TransferToWalletLabelJSON = string | null; | ||
export type EvmErc20TransferToWalletLabelInput = string | null; | ||
export type EvmErc20TransferToWalletLabelValue = string | null; | ||
|
||
export abstract class EvmErc20TransferToWalletLabel { | ||
public static create(input: EvmErc20TransferToWalletLabelInput): EvmErc20TransferToWalletLabelValue { | ||
return input; | ||
} | ||
|
||
public static fromJSON(json: EvmErc20TransferToWalletLabelJSON): EvmErc20TransferToWalletLabelValue { | ||
return json; | ||
} | ||
|
||
public static toJSON(value: EvmErc20TransferToWalletLabelValue): EvmErc20TransferToWalletLabelJSON { | ||
return value; | ||
} | ||
} |
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.
7a646d1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test coverage