-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Abi - Refactor / Parser #3030
Comments
An initial draft for the proposed ABI public interface. View in TS Playground interface Abi {
specVersion: string;
encodingVersion: string;
programType: string;
functions: AbiFunction[];
loggedTypes: AbiLoggedType[]
messageTypes: AbiMessageType[]
configurables: AbiConfigurable[]
}
interface AbiFunction {
name: string;
inputs: AbiTypeWithName[];
output: AbiType;
attributes?: AbiFunctionAttribute[];
}
interface AbiLoggedType extends AbiType {
logId: string
};
interface AbiMessageType extends AbiType {
messageId: string
};
interface AbiConfigurable extends AbiType {
name: string;
offset: number;
}
interface AbiType {
// Concrete type ID
typeId: string;
// This will reference the metadata type
// Fallback to concrete type when no metadata type is referenced (i.e. for built in types)
type: string;
components?: AbiTypeWithName[];
}
type AbiTypeWithName = AbiType & {
name: string
};
type AbiFunctionAttribute =
| StorageAttr
| PayableAttr
| TestAttr
| InlineAttr
| DocCommentAttr
| DocAttr;
export interface PayableAttr {
readonly name: 'payable';
}
export interface StorageAttr {
readonly name: 'storage';
readonly arguments: readonly ('read' | 'write')[];
}
export interface TestAttr {
readonly name: 'test';
}
export interface InlineAttr {
readonly name: 'inline';
readonly arguments: 'never' | 'always';
}
export interface DocCommentAttr {
readonly name: 'doc-comment';
readonly arguments: string[];
}
export interface DocAttr {
readonly name: 'doc';
} |
I have a gut feeling that we should probably keep I wonder if abstracting this away will result in Something to think about. |
I see your point - that could lead to confusion. We planned for the |
Oh, I see. Maybe I misinterpreted. I assumed it could be a hash or something else. Anyway, I don't want to hold progress here, so take all my considerations with a grain of salt. |
The text was updated successfully, but these errors were encountered: