Skip to content

Commit

Permalink
intents: add feeOptions intent
Browse files Browse the repository at this point in the history
  • Loading branch information
marino39 committed Feb 27, 2024
1 parent 09784f3 commit 7b9557e
Show file tree
Hide file tree
Showing 5 changed files with 157 additions and 6 deletions.
82 changes: 79 additions & 3 deletions intents/intent.gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

41 changes: 39 additions & 2 deletions intents/intent.gen.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable */
// sequence-waas-intents v0.1.0 e8e022f41dd9c03ff373c616d8f484fbefdfe7d9
// sequence-waas-intents v0.1.0 f671856a3104a7a8f1ab8957e5542b7f08a20fb8
// --
// Code generated by [email protected] with typescript generator. DO NOT EDIT.
//
Expand All @@ -12,13 +12,19 @@ export const WebRPCVersion = "v1"
export const WebRPCSchemaVersion = "v0.1.0"

// Schema hash generated from your RIDL schema
export const WebRPCSchemaHash = "e8e022f41dd9c03ff373c616d8f484fbefdfe7d9"
export const WebRPCSchemaHash = "f671856a3104a7a8f1ab8957e5542b7f08a20fb8"

//
// Types
//


export enum FeeTokenType {
UNKNOWN = 'UNKNOWN',
ERC20_TOKEN = 'ERC20_TOKEN',
ERC1155_TOKEN = 'ERC1155_TOKEN'
}

export interface Intent {
version: string
name: string
Expand Down Expand Up @@ -71,11 +77,19 @@ export interface IntentDataSignMessage {
message: string
}

export interface IntentDataFeeOptions {
network: string
wallet: string
identifier: string
transactions: Array<any>
}

export interface IntentDataSendTransaction {
network: string
wallet: string
identifier: string
transactions: Array<any>
transactionsFeeQuote?: string
}

export interface TransactionRaw {
Expand Down Expand Up @@ -164,6 +178,29 @@ export interface IntentResponseSignedMessage {
message: string
}

export interface FeeOption {
token: FeeToken
to: string
value: string
gasLimit: number
}

export interface FeeToken {
chainId: number
name: string
symbol: string
type: FeeTokenType
decimals?: number
logoURL: string
contractAddress?: string
tokenID?: string
}

export interface IntentResponseFeeOptions {
feeOptions: Array<FeeOption>
feeQuote?: string
}

export interface IntentResponseTransactionReceipt {
request: any
txHash: string
Expand Down
36 changes: 35 additions & 1 deletion intents/intent.ridl
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ struct IntentDataFinishValidateSession
struct IntentDataListSessions
- wallet: string


struct IntentDataGetSession
- sessionId: string
+ go.field.name = SessionID
Expand All @@ -67,12 +66,21 @@ struct IntentDataSignMessage
- wallet: string
- message: string

struct IntentDataFeeOptions
- network: string
- wallet: string
- identifier: string # is used to generate nonce space
- transactions: []any
+ go.field.type = []json.RawMessage

struct IntentDataSendTransaction
- network: string
- wallet: string
- identifier: string # is used to generate nonce space
- transactions: []any
+ go.field.type = []json.RawMessage
- transactionsFeeQuote?: string
+ go.tag.json = transactionsFeeQuote,omitempty

struct TransactionRaw
- type: string
Expand Down Expand Up @@ -168,6 +176,32 @@ struct IntentResponseSignedMessage
- signature: string
- message: string

struct FeeOption
- token: FeeToken
- to: string
- value: string
- gasLimit: uint

struct FeeToken
- chainId: uint64
- name: string
- symbol: string
- type: FeeTokenType
- decimals?: uint32
- logoURL: string
- contractAddress?: string
- tokenID?: string

enum FeeTokenType: uint32
- UNKNOWN
- ERC20_TOKEN
- ERC1155_TOKEN

struct IntentResponseFeeOptions
- feeOptions: []FeeOption
- feeQuote?: string
+ go.tag.json = feeQuote,omitempty

struct IntentResponseTransactionReceipt
- request: any
- txHash: string
Expand Down
2 changes: 2 additions & 0 deletions intents/intent_ext.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ const (
IntentNameListSessions = "listSessions"
IntentNameGetSession = "getSession"
IntentNameSignMessage = "signMessage"
IntentNameFeeOptions = "feeOptions"
IntentNameSendTransaction = "sendTransaction"
)

Expand All @@ -28,6 +29,7 @@ const (
IntentResponseCodeValidationStarted = "validationStarted"
IntentResponseCodeValidationFinished = "validationFinished"
IntentResponseCodeSignedMessage = "signedMessage"
IntentResponseCodeFeeOptions = "feeOptions"
IntentResponseCodeTransactionReceipt = "transactionReceipt"
IntentResponseCodeTransactionFailed = "transactionFailed"
IntentResponseCodeGetSessionResponse = "getSessionResponse"
Expand Down
2 changes: 2 additions & 0 deletions intents/intent_typed.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ func IntentDataTypeToName[T any](t *T) string {
return IntentNameGetSession
case *IntentDataSignMessage:
return IntentNameSignMessage
case *IntentDataFeeOptions:
return IntentNameFeeOptions
case *IntentDataSendTransaction:
return IntentNameSendTransaction
default:
Expand Down

0 comments on commit 7b9557e

Please sign in to comment.