diff --git a/intents/intent.gen.go b/intents/intent.gen.go index 18fb65d..1a0e3c1 100644 --- a/intents/intent.gen.go +++ b/intents/intent.gen.go @@ -1,4 +1,4 @@ -// sequence-waas-intents v0.1.0 e8e022f41dd9c03ff373c616d8f484fbefdfe7d9 +// sequence-waas-intents v0.1.0 f671856a3104a7a8f1ab8957e5542b7f08a20fb8 // -- // Code generated by webrpc-gen@v0.14.0-dev with golang generator. DO NOT EDIT. // @@ -25,13 +25,58 @@ func WebRPCSchemaVersion() string { // Schema hash generated from your RIDL schema func WebRPCSchemaHash() string { - return "e8e022f41dd9c03ff373c616d8f484fbefdfe7d9" + return "f671856a3104a7a8f1ab8957e5542b7f08a20fb8" } // // Types // +type FeeTokenType uint32 + +const ( + FeeTokenType_UNKNOWN FeeTokenType = 0 + FeeTokenType_ERC20_TOKEN FeeTokenType = 1 + FeeTokenType_ERC1155_TOKEN FeeTokenType = 2 +) + +var FeeTokenType_name = map[uint32]string{ + 0: "UNKNOWN", + 1: "ERC20_TOKEN", + 2: "ERC1155_TOKEN", +} + +var FeeTokenType_value = map[string]uint32{ + "UNKNOWN": 0, + "ERC20_TOKEN": 1, + "ERC1155_TOKEN": 2, +} + +func (x FeeTokenType) String() string { + return FeeTokenType_name[uint32(x)] +} + +func (x FeeTokenType) MarshalText() ([]byte, error) { + return []byte(FeeTokenType_name[uint32(x)]), nil +} + +func (x *FeeTokenType) UnmarshalText(b []byte) error { + *x = FeeTokenType(FeeTokenType_value[string(b)]) + return nil +} + +func (x *FeeTokenType) Is(values ...FeeTokenType) bool { + if x == nil { + return false + } + for _, v := range values { + if *x == v { + return true + } + } + return false +} + type Intent struct { Version string `json:"version"` Name string `json:"name"` @@ -84,13 +129,21 @@ type IntentDataSignMessage struct { Message string `json:"message"` } -type IntentDataSendTransaction struct { +type IntentDataFeeOptions struct { Network string `json:"network"` Wallet string `json:"wallet"` Identifier string `json:"identifier"` Transactions []json.RawMessage `json:"transactions"` } +type IntentDataSendTransaction struct { + Network string `json:"network"` + Wallet string `json:"wallet"` + Identifier string `json:"identifier"` + Transactions []json.RawMessage `json:"transactions"` + TransactionsFeeQuote *string `json:"transactionsFeeQuote,omitempty"` +} + type TransactionRaw struct { Type string `json:"type"` To string `json:"to"` @@ -177,6 +230,29 @@ type IntentResponseSignedMessage struct { Message string `json:"message"` } +type FeeOption struct { + Token *FeeToken `json:"token"` + To string `json:"to"` + Value string `json:"value"` + GasLimit uint `json:"gasLimit"` +} + +type FeeToken struct { + ChainId uint64 `json:"chainId"` + Name string `json:"name"` + Symbol string `json:"symbol"` + Type *FeeTokenType `json:"type"` + Decimals *uint32 `json:"decimals"` + LogoURL string `json:"logoURL"` + ContractAddress *string `json:"contractAddress"` + TokenID *string `json:"tokenID"` +} + +type IntentResponseFeeOptions struct { + FeeOptions []*FeeOption `json:"feeOptions"` + FeeQuote *string `json:"feeQuote,omitempty"` +} + type IntentResponseTransactionReceipt struct { Request interface{} `json:"request"` TxHash string `json:"txHash"` diff --git a/intents/intent.gen.ts b/intents/intent.gen.ts index 67ff992..a297167 100644 --- a/intents/intent.gen.ts +++ b/intents/intent.gen.ts @@ -1,5 +1,5 @@ /* eslint-disable */ -// sequence-waas-intents v0.1.0 e8e022f41dd9c03ff373c616d8f484fbefdfe7d9 +// sequence-waas-intents v0.1.0 f671856a3104a7a8f1ab8957e5542b7f08a20fb8 // -- // Code generated by webrpc-gen@v0.14.0-dev with typescript generator. DO NOT EDIT. // @@ -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 @@ -71,11 +77,19 @@ export interface IntentDataSignMessage { message: string } +export interface IntentDataFeeOptions { + network: string + wallet: string + identifier: string + transactions: Array +} + export interface IntentDataSendTransaction { network: string wallet: string identifier: string transactions: Array + transactionsFeeQuote?: string } export interface TransactionRaw { @@ -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 + feeQuote?: string +} + export interface IntentResponseTransactionReceipt { request: any txHash: string diff --git a/intents/intent.ridl b/intents/intent.ridl index b00796c..4a3d712 100644 --- a/intents/intent.ridl +++ b/intents/intent.ridl @@ -56,7 +56,6 @@ struct IntentDataFinishValidateSession struct IntentDataListSessions - wallet: string - struct IntentDataGetSession - sessionId: string + go.field.name = SessionID @@ -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 @@ -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 diff --git a/intents/intent_ext.go b/intents/intent_ext.go index 6e2fac1..c1222d6 100644 --- a/intents/intent_ext.go +++ b/intents/intent_ext.go @@ -19,6 +19,7 @@ const ( IntentNameListSessions = "listSessions" IntentNameGetSession = "getSession" IntentNameSignMessage = "signMessage" + IntentNameFeeOptions = "feeOptions" IntentNameSendTransaction = "sendTransaction" ) @@ -28,6 +29,7 @@ const ( IntentResponseCodeValidationStarted = "validationStarted" IntentResponseCodeValidationFinished = "validationFinished" IntentResponseCodeSignedMessage = "signedMessage" + IntentResponseCodeFeeOptions = "feeOptions" IntentResponseCodeTransactionReceipt = "transactionReceipt" IntentResponseCodeTransactionFailed = "transactionFailed" IntentResponseCodeGetSessionResponse = "getSessionResponse" diff --git a/intents/intent_typed.go b/intents/intent_typed.go index 2369bb0..29208f7 100644 --- a/intents/intent_typed.go +++ b/intents/intent_typed.go @@ -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: