-
Notifications
You must be signed in to change notification settings - Fork 257
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
17 changed files
with
389 additions
and
54 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': minor | ||
'@moralisweb3/evm-api': minor | ||
'moralis': minor | ||
--- | ||
|
||
Update SDK to reflect minor changes in the swagger file. |
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
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
63 changes: 63 additions & 0 deletions
63
packages/common/evmUtils/src/generated/types/EvmDecodedEvent.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,63 @@ | ||
import { EvmDecodedEventParamsItem, EvmDecodedEventParamsItemInput, EvmDecodedEventParamsItemJSON } from '../types/EvmDecodedEventParamsItem'; | ||
|
||
// $ref: #/components/schemas/decodedEvent | ||
// type: decodedEvent | ||
// properties: | ||
// - signature ($ref: #/components/schemas/decodedEvent/properties/signature) | ||
// - label ($ref: #/components/schemas/decodedEvent/properties/label) | ||
// - type ($ref: #/components/schemas/decodedEvent/properties/type) | ||
// - params ($ref: #/components/schemas/decodedEvent/properties/params/items) | ||
|
||
export interface EvmDecodedEventJSON { | ||
readonly signature?: string; | ||
readonly label?: string; | ||
readonly type?: string; | ||
readonly params?: EvmDecodedEventParamsItemJSON[]; | ||
} | ||
|
||
export interface EvmDecodedEventInput { | ||
readonly signature?: string; | ||
readonly label?: string; | ||
readonly type?: string; | ||
readonly params?: EvmDecodedEventParamsItemInput[] | EvmDecodedEventParamsItem[]; | ||
} | ||
|
||
export class EvmDecodedEvent { | ||
public static create(input: EvmDecodedEventInput | EvmDecodedEvent): EvmDecodedEvent { | ||
if (input instanceof EvmDecodedEvent) { | ||
return input; | ||
} | ||
return new EvmDecodedEvent(input); | ||
} | ||
|
||
public static fromJSON(json: EvmDecodedEventJSON): EvmDecodedEvent { | ||
const input: EvmDecodedEventInput = { | ||
signature: json.signature, | ||
label: json.label, | ||
type: json.type, | ||
params: json.params ? json.params.map((item) => EvmDecodedEventParamsItem.fromJSON(item)) : undefined, | ||
}; | ||
return EvmDecodedEvent.create(input); | ||
} | ||
|
||
public readonly signature?: string; | ||
public readonly label?: string; | ||
public readonly type?: string; | ||
public readonly params?: EvmDecodedEventParamsItem[]; | ||
|
||
private constructor(input: EvmDecodedEventInput) { | ||
this.signature = input.signature; | ||
this.label = input.label; | ||
this.type = input.type; | ||
this.params = input.params ? input.params.map((item) => EvmDecodedEventParamsItem.create(item)) : undefined; | ||
} | ||
|
||
public toJSON(): EvmDecodedEventJSON { | ||
return { | ||
signature: this.signature, | ||
label: this.label, | ||
type: this.type, | ||
params: this.params ? this.params.map((item) => item.toJSON()) : undefined, | ||
} | ||
} | ||
} |
54 changes: 54 additions & 0 deletions
54
packages/common/evmUtils/src/generated/types/EvmDecodedEventParamsItem.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,54 @@ | ||
// $ref: #/components/schemas/decodedEvent/properties/params/items | ||
// type: decodedEvent_params_Item | ||
// properties: | ||
// - name ($ref: #/components/schemas/decodedEvent/properties/params/items/properties/name) | ||
// - value ($ref: #/components/schemas/decodedEvent/properties/params/items/properties/value) | ||
// - type ($ref: #/components/schemas/decodedEvent/properties/params/items/properties/type) | ||
|
||
export interface EvmDecodedEventParamsItemJSON { | ||
readonly name?: string; | ||
readonly value?: string; | ||
readonly type?: string; | ||
} | ||
|
||
export interface EvmDecodedEventParamsItemInput { | ||
readonly name?: string; | ||
readonly value?: string; | ||
readonly type?: string; | ||
} | ||
|
||
export class EvmDecodedEventParamsItem { | ||
public static create(input: EvmDecodedEventParamsItemInput | EvmDecodedEventParamsItem): EvmDecodedEventParamsItem { | ||
if (input instanceof EvmDecodedEventParamsItem) { | ||
return input; | ||
} | ||
return new EvmDecodedEventParamsItem(input); | ||
} | ||
|
||
public static fromJSON(json: EvmDecodedEventParamsItemJSON): EvmDecodedEventParamsItem { | ||
const input: EvmDecodedEventParamsItemInput = { | ||
name: json.name, | ||
value: json.value, | ||
type: json.type, | ||
}; | ||
return EvmDecodedEventParamsItem.create(input); | ||
} | ||
|
||
public readonly name?: string; | ||
public readonly value?: string; | ||
public readonly type?: string; | ||
|
||
private constructor(input: EvmDecodedEventParamsItemInput) { | ||
this.name = input.name; | ||
this.value = input.value; | ||
this.type = input.type; | ||
} | ||
|
||
public toJSON(): EvmDecodedEventParamsItemJSON { | ||
return { | ||
name: this.name, | ||
value: this.value, | ||
type: this.type, | ||
} | ||
} | ||
} |
Oops, something went wrong.
061df23
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