From c7d9cfffb7385f2f6578b007204982b67d7b8fdc Mon Sep 17 00:00:00 2001 From: Marcin Gorzynski Date: Tue, 27 Feb 2024 12:27:00 +0100 Subject: [PATCH] intents: small changes to intents and wallet fee options api --- intents/intent.gen.go | 22 +++++++++++----------- intents/intent.gen.ts | 10 +++++----- intents/intent.ridl | 6 +++--- relayer.go | 2 +- wallet.go | 6 +----- 5 files changed, 21 insertions(+), 25 deletions(-) diff --git a/intents/intent.gen.go b/intents/intent.gen.go index 1a0e3c1..42bba1a 100644 --- a/intents/intent.gen.go +++ b/intents/intent.gen.go @@ -1,4 +1,4 @@ -// sequence-waas-intents v0.1.0 f671856a3104a7a8f1ab8957e5542b7f08a20fb8 +// sequence-waas-intents v0.1.0 80bee7d15d1c82c2791adf35c50c7b9d70dc49bc // -- // Code generated by webrpc-gen@v0.14.0-dev with golang generator. DO NOT EDIT. // @@ -25,7 +25,7 @@ func WebRPCSchemaVersion() string { // Schema hash generated from your RIDL schema func WebRPCSchemaHash() string { - return "f671856a3104a7a8f1ab8957e5542b7f08a20fb8" + return "80bee7d15d1c82c2791adf35c50c7b9d70dc49bc" } // @@ -35,21 +35,21 @@ func WebRPCSchemaHash() string { type FeeTokenType uint32 const ( - FeeTokenType_UNKNOWN FeeTokenType = 0 - FeeTokenType_ERC20_TOKEN FeeTokenType = 1 - FeeTokenType_ERC1155_TOKEN FeeTokenType = 2 + FeeTokenType_unknown FeeTokenType = 0 + FeeTokenType_erc20Token FeeTokenType = 1 + FeeTokenType_erc1155Token FeeTokenType = 2 ) var FeeTokenType_name = map[uint32]string{ - 0: "UNKNOWN", - 1: "ERC20_TOKEN", - 2: "ERC1155_TOKEN", + 0: "unknown", + 1: "erc20Token", + 2: "erc1155Token", } var FeeTokenType_value = map[string]uint32{ - "UNKNOWN": 0, - "ERC20_TOKEN": 1, - "ERC1155_TOKEN": 2, + "unknown": 0, + "erc20Token": 1, + "erc1155Token": 2, } func (x FeeTokenType) String() string { diff --git a/intents/intent.gen.ts b/intents/intent.gen.ts index a297167..b9bc674 100644 --- a/intents/intent.gen.ts +++ b/intents/intent.gen.ts @@ -1,5 +1,5 @@ /* eslint-disable */ -// sequence-waas-intents v0.1.0 f671856a3104a7a8f1ab8957e5542b7f08a20fb8 +// sequence-waas-intents v0.1.0 80bee7d15d1c82c2791adf35c50c7b9d70dc49bc // -- // Code generated by webrpc-gen@v0.14.0-dev with typescript generator. DO NOT EDIT. // @@ -12,7 +12,7 @@ export const WebRPCVersion = "v1" export const WebRPCSchemaVersion = "v0.1.0" // Schema hash generated from your RIDL schema -export const WebRPCSchemaHash = "f671856a3104a7a8f1ab8957e5542b7f08a20fb8" +export const WebRPCSchemaHash = "80bee7d15d1c82c2791adf35c50c7b9d70dc49bc" // // Types @@ -20,9 +20,9 @@ export const WebRPCSchemaHash = "f671856a3104a7a8f1ab8957e5542b7f08a20fb8" export enum FeeTokenType { - UNKNOWN = 'UNKNOWN', - ERC20_TOKEN = 'ERC20_TOKEN', - ERC1155_TOKEN = 'ERC1155_TOKEN' + unknown = 'unknown', + erc20Token = 'erc20Token', + erc1155Token = 'erc1155Token' } export interface Intent { diff --git a/intents/intent.ridl b/intents/intent.ridl index 4a3d712..6638682 100644 --- a/intents/intent.ridl +++ b/intents/intent.ridl @@ -193,9 +193,9 @@ struct FeeToken - tokenID?: string enum FeeTokenType: uint32 - - UNKNOWN - - ERC20_TOKEN - - ERC1155_TOKEN + - unknown + - erc20Token + - erc1155Token struct IntentResponseFeeOptions - feeOptions: []FeeOption diff --git a/relayer.go b/relayer.go index f0869bc..213e051 100644 --- a/relayer.go +++ b/relayer.go @@ -43,7 +43,7 @@ type RelayerFeeToken struct { Decimals *uint32 LogoURL string ContractAddress *common.Address - tokenID *big.Int + TokenID *big.Int } type RelayerFeeOption struct { diff --git a/wallet.go b/wallet.go index 9f559e3..a8eb3b6 100644 --- a/wallet.go +++ b/wallet.go @@ -586,15 +586,11 @@ func (w *Wallet[C]) SendTransactions(ctx context.Context, signedTxns *SignedTran return w.relayer.Relay(ctx, signedTxns, quote) } -func (w *Wallet[C]) FeeOptions(ctx context.Context, txns Transactions) ([]*RelayerFeeOption, *RelayerFeeQuote, error) { +func (w *Wallet[C]) FeeOptions(ctx context.Context, signedTxs *SignedTransactions) ([]*RelayerFeeOption, *RelayerFeeQuote, error) { if w.relayer == nil { return []*RelayerFeeOption{}, nil, ErrRelayerNotSet } - signedTxs, err := w.SignTransactions(ctx, txns) - if err != nil { - return nil, nil, fmt.Errorf("cannot sign transactions: %w", err) - } return w.relayer.FeeOptions(ctx, signedTxs) }