-
Notifications
You must be signed in to change notification settings - Fork 115
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CT-1160] add relevant protos to dydxprotocol (#2162)
- Loading branch information
Showing
27 changed files
with
6,398 additions
and
321 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
117 changes: 117 additions & 0 deletions
117
indexer/packages/v4-protos/src/codegen/dydxprotocol/accountplus/models.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,117 @@ | ||
import * as _m0 from "protobufjs/minimal"; | ||
import { Long, DeepPartial } from "../../helpers"; | ||
/** | ||
* AccountAuthenticator represents a foundational model for all authenticators. | ||
* It provides extensibility by allowing concrete types to interpret and | ||
* validate transactions based on the encapsulated data. | ||
*/ | ||
|
||
export interface AccountAuthenticator { | ||
/** ID uniquely identifies the authenticator instance. */ | ||
id: Long; | ||
/** | ||
* Type specifies the category of the AccountAuthenticator. | ||
* This type information is essential for differentiating authenticators | ||
* and ensuring precise data retrieval from the storage layer. | ||
*/ | ||
|
||
type: string; | ||
/** | ||
* Config is a versatile field used in conjunction with the specific type of | ||
* account authenticator to facilitate complex authentication processes. | ||
* The interpretation of this field is overloaded, enabling multiple | ||
* authenticators to utilize it for their respective purposes. | ||
*/ | ||
|
||
config: Uint8Array; | ||
} | ||
/** | ||
* AccountAuthenticator represents a foundational model for all authenticators. | ||
* It provides extensibility by allowing concrete types to interpret and | ||
* validate transactions based on the encapsulated data. | ||
*/ | ||
|
||
export interface AccountAuthenticatorSDKType { | ||
/** ID uniquely identifies the authenticator instance. */ | ||
id: Long; | ||
/** | ||
* Type specifies the category of the AccountAuthenticator. | ||
* This type information is essential for differentiating authenticators | ||
* and ensuring precise data retrieval from the storage layer. | ||
*/ | ||
|
||
type: string; | ||
/** | ||
* Config is a versatile field used in conjunction with the specific type of | ||
* account authenticator to facilitate complex authentication processes. | ||
* The interpretation of this field is overloaded, enabling multiple | ||
* authenticators to utilize it for their respective purposes. | ||
*/ | ||
|
||
config: Uint8Array; | ||
} | ||
|
||
function createBaseAccountAuthenticator(): AccountAuthenticator { | ||
return { | ||
id: Long.UZERO, | ||
type: "", | ||
config: new Uint8Array() | ||
}; | ||
} | ||
|
||
export const AccountAuthenticator = { | ||
encode(message: AccountAuthenticator, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { | ||
if (!message.id.isZero()) { | ||
writer.uint32(8).uint64(message.id); | ||
} | ||
|
||
if (message.type !== "") { | ||
writer.uint32(18).string(message.type); | ||
} | ||
|
||
if (message.config.length !== 0) { | ||
writer.uint32(26).bytes(message.config); | ||
} | ||
|
||
return writer; | ||
}, | ||
|
||
decode(input: _m0.Reader | Uint8Array, length?: number): AccountAuthenticator { | ||
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); | ||
let end = length === undefined ? reader.len : reader.pos + length; | ||
const message = createBaseAccountAuthenticator(); | ||
|
||
while (reader.pos < end) { | ||
const tag = reader.uint32(); | ||
|
||
switch (tag >>> 3) { | ||
case 1: | ||
message.id = (reader.uint64() as Long); | ||
break; | ||
|
||
case 2: | ||
message.type = reader.string(); | ||
break; | ||
|
||
case 3: | ||
message.config = reader.bytes(); | ||
break; | ||
|
||
default: | ||
reader.skipType(tag & 7); | ||
break; | ||
} | ||
} | ||
|
||
return message; | ||
}, | ||
|
||
fromPartial(object: DeepPartial<AccountAuthenticator>): AccountAuthenticator { | ||
const message = createBaseAccountAuthenticator(); | ||
message.id = object.id !== undefined && object.id !== null ? Long.fromValue(object.id) : Long.UZERO; | ||
message.type = object.type ?? ""; | ||
message.config = object.config ?? new Uint8Array(); | ||
return message; | ||
} | ||
|
||
}; |
67 changes: 67 additions & 0 deletions
67
indexer/packages/v4-protos/src/codegen/dydxprotocol/accountplus/params.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,67 @@ | ||
import * as _m0 from "protobufjs/minimal"; | ||
import { DeepPartial } from "../../helpers"; | ||
/** Params defines the parameters for the module. */ | ||
|
||
export interface Params { | ||
/** | ||
* IsSmartAccountActive defines the state of the authenticator. | ||
* If set to false, the authenticator module will not be used | ||
* and the classic cosmos sdk authentication will be used instead. | ||
*/ | ||
isSmartAccountActive: boolean; | ||
} | ||
/** Params defines the parameters for the module. */ | ||
|
||
export interface ParamsSDKType { | ||
/** | ||
* IsSmartAccountActive defines the state of the authenticator. | ||
* If set to false, the authenticator module will not be used | ||
* and the classic cosmos sdk authentication will be used instead. | ||
*/ | ||
is_smart_account_active: boolean; | ||
} | ||
|
||
function createBaseParams(): Params { | ||
return { | ||
isSmartAccountActive: false | ||
}; | ||
} | ||
|
||
export const Params = { | ||
encode(message: Params, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { | ||
if (message.isSmartAccountActive === true) { | ||
writer.uint32(8).bool(message.isSmartAccountActive); | ||
} | ||
|
||
return writer; | ||
}, | ||
|
||
decode(input: _m0.Reader | Uint8Array, length?: number): Params { | ||
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); | ||
let end = length === undefined ? reader.len : reader.pos + length; | ||
const message = createBaseParams(); | ||
|
||
while (reader.pos < end) { | ||
const tag = reader.uint32(); | ||
|
||
switch (tag >>> 3) { | ||
case 1: | ||
message.isSmartAccountActive = reader.bool(); | ||
break; | ||
|
||
default: | ||
reader.skipType(tag & 7); | ||
break; | ||
} | ||
} | ||
|
||
return message; | ||
}, | ||
|
||
fromPartial(object: DeepPartial<Params>): Params { | ||
const message = createBaseParams(); | ||
message.isSmartAccountActive = object.isSmartAccountActive ?? false; | ||
return message; | ||
} | ||
|
||
}; |
Oops, something went wrong.