Class: Mudbase::WalletApi

Inherits:
Object
  • Object
show all
Defined in:
lib/mudbase/api/wallet_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ WalletApi

Returns a new instance of WalletApi.



19
20
21
# File 'lib/mudbase/api/wallet_api.rb', line 19

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/mudbase/api/wallet_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#broadcast_non_custodial_transaction(broadcast_non_custodial_transaction_request, opts = {}) ⇒ BroadcastNonCustodialTransaction200Response

Broadcast a client-signed transaction Broadcast a transaction that has been signed client-side. The transaction must be fully signed before sending. The fromAddress must be registered and belong to your organization (POST /api/wallet/non-custodial/register-address). Supported chains: EVM (ethereum, polygon, arbitrum, optimism, base, bsc, binance, avalanche, celo), UTXO (bitcoin, litecoin, dogecoin), and chain-specific (tron, solana, ton, cardano). Use binance or bsc for BNB Smart Chain. Testing with custodial: You can create a wallet via POST /api/wallet/create, get its private key via GET /api/wallet/walletId/private-key, register that address with POST /api/wallet/non-custodial/register-address, then build a signed tx (using POST /api/wallet/estimate-network-fee or estimate-gas for fees) and broadcast it here to test the non-custodial flow end-to-end.

Parameters:

Returns:



27
28
29
30
# File 'lib/mudbase/api/wallet_api.rb', line 27

def broadcast_non_custodial_transaction(broadcast_non_custodial_transaction_request, opts = {})
  data, _status_code, _headers = broadcast_non_custodial_transaction_with_http_info(broadcast_non_custodial_transaction_request, opts)
  data
end

#broadcast_non_custodial_transaction_with_http_info(broadcast_non_custodial_transaction_request, opts = {}) ⇒ Array<(BroadcastNonCustodialTransaction200Response, Integer, Hash)>

Broadcast a client-signed transaction Broadcast a transaction that has been signed client-side. The transaction must be fully signed before sending. The fromAddress must be registered and belong to your organization (POST /api/wallet/non-custodial/register-address). Supported chains: EVM (ethereum, polygon, arbitrum, optimism, base, bsc, binance, avalanche, celo), UTXO (bitcoin, litecoin, dogecoin), and chain-specific (tron, solana, ton, cardano). Use `binance` or `bsc` for BNB Smart Chain. Testing with custodial: You can create a wallet via POST /api/wallet/create, get its private key via GET /api/wallet/walletId/private-key, register that address with POST /api/wallet/non-custodial/register-address, then build a signed tx (using POST /api/wallet/estimate-network-fee or estimate-gas for fees) and broadcast it here to test the non-custodial flow end-to-end.

Parameters:

Returns:



37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/mudbase/api/wallet_api.rb', line 37

def broadcast_non_custodial_transaction_with_http_info(broadcast_non_custodial_transaction_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WalletApi.broadcast_non_custodial_transaction ...'
  end
  # verify the required parameter 'broadcast_non_custodial_transaction_request' is set
  if @api_client.config.client_side_validation && broadcast_non_custodial_transaction_request.nil?
    fail ArgumentError, "Missing the required parameter 'broadcast_non_custodial_transaction_request' when calling WalletApi.broadcast_non_custodial_transaction"
  end
  # resource path
  local_var_path = '/api/wallet/non-custodial/broadcast'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(broadcast_non_custodial_transaction_request)

  # return_type
  return_type = opts[:debug_return_type] || 'BroadcastNonCustodialTransaction200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['OrgBearerAuth', 'ProjectBearerAuth']

  new_options = opts.merge(
    :operation => :"WalletApi.broadcast_non_custodial_transaction",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: WalletApi#broadcast_non_custodial_transaction\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#calculate_wallet_fee(estimate_network_fee_request, opts = {}) ⇒ CalculateWalletFee200Response

Get network fee only (alias for POST /api/wallet/estimate-network-fee) Returns network fee only, estimated from the blockchain (RPC / fee APIs). No platform fee or project fee. Same as POST /api/wallet/estimate-network-fee. Prefer estimate-network-fee for clarity. Supported currencies: BTC, ETH, BNB, LTC, SOL, TRX, USDT, MATIC, AVAX, CELO, DOGE, TON, ADA. For USDT, network is required (ETH, BSC, TRX, SOL, POLYGON). Use ?fresh=1 or header X-Fee-Fresh: true for a fresh estimate (bypass cache) right before building the transaction for broadcast.

Parameters:

Options Hash (opts):

  • :fresh (String)

    Bypass cache and fetch current fee (use right before building tx for broadcast)

Returns:



96
97
98
99
# File 'lib/mudbase/api/wallet_api.rb', line 96

def calculate_wallet_fee(estimate_network_fee_request, opts = {})
  data, _status_code, _headers = calculate_wallet_fee_with_http_info(estimate_network_fee_request, opts)
  data
end

#calculate_wallet_fee_with_http_info(estimate_network_fee_request, opts = {}) ⇒ Array<(CalculateWalletFee200Response, Integer, Hash)>

Get network fee only (alias for POST /api/wallet/estimate-network-fee) Returns network fee only, estimated from the blockchain (RPC / fee APIs). No platform fee or project fee. Same as POST /api/wallet/estimate-network-fee. Prefer estimate-network-fee for clarity. Supported currencies: BTC, ETH, BNB, LTC, SOL, TRX, USDT, MATIC, AVAX, CELO, DOGE, TON, ADA. For USDT, `network` is required (ETH, BSC, TRX, SOL, POLYGON). Use `?fresh=1` or header `X-Fee-Fresh: true` for a fresh estimate (bypass cache) right before building the transaction for broadcast.

Parameters:

Options Hash (opts):

  • :fresh (String)

    Bypass cache and fetch current fee (use right before building tx for broadcast)

Returns:



107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
# File 'lib/mudbase/api/wallet_api.rb', line 107

def calculate_wallet_fee_with_http_info(estimate_network_fee_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WalletApi.calculate_wallet_fee ...'
  end
  # verify the required parameter 'estimate_network_fee_request' is set
  if @api_client.config.client_side_validation && estimate_network_fee_request.nil?
    fail ArgumentError, "Missing the required parameter 'estimate_network_fee_request' when calling WalletApi.calculate_wallet_fee"
  end
  allowable_values = ["1"]
  if @api_client.config.client_side_validation && opts[:'fresh'] && !allowable_values.include?(opts[:'fresh'])
    fail ArgumentError, "invalid value for \"fresh\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/api/wallet/calculate-fee'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'fresh'] = opts[:'fresh'] if !opts[:'fresh'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(estimate_network_fee_request)

  # return_type
  return_type = opts[:debug_return_type] || 'CalculateWalletFee200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"WalletApi.calculate_wallet_fee",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: WalletApi#calculate_wallet_fee\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_wallet(create_wallet_request, opts = {}) ⇒ CreateWallet201Response

Create new wallet (for testing non-custodial) Create a custodial wallet. Custodial is not used in production. Use this to test non-custodial flows: create a wallet, get its private key (GET /api/wallet/walletId/private-key), register the same address with POST /api/wallet/non-custodial/register-address, then use estimate-network-fee and POST /api/wallet/non-custodial/broadcast to build and send a signed transaction. Transaction monitoring (pending/confirmed) applies to both custodial and non-custodial WalletTransaction records.

Parameters:

  • create_wallet_request (CreateWalletRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



170
171
172
173
# File 'lib/mudbase/api/wallet_api.rb', line 170

def create_wallet(create_wallet_request, opts = {})
  data, _status_code, _headers = create_wallet_with_http_info(create_wallet_request, opts)
  data
end

#create_wallet_webhook(create_wallet_webhook_request, opts = {}) ⇒ CreateWalletWebhook201Response

Create a wallet webhook

Parameters:

Returns:



237
238
239
240
# File 'lib/mudbase/api/wallet_api.rb', line 237

def create_wallet_webhook(create_wallet_webhook_request, opts = {})
  data, _status_code, _headers = create_wallet_webhook_with_http_info(create_wallet_webhook_request, opts)
  data
end

#create_wallet_webhook_with_http_info(create_wallet_webhook_request, opts = {}) ⇒ Array<(CreateWalletWebhook201Response, Integer, Hash)>

Create a wallet webhook

Parameters:

Returns:



246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
# File 'lib/mudbase/api/wallet_api.rb', line 246

def create_wallet_webhook_with_http_info(create_wallet_webhook_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WalletApi.create_wallet_webhook ...'
  end
  # verify the required parameter 'create_wallet_webhook_request' is set
  if @api_client.config.client_side_validation && create_wallet_webhook_request.nil?
    fail ArgumentError, "Missing the required parameter 'create_wallet_webhook_request' when calling WalletApi.create_wallet_webhook"
  end
  # resource path
  local_var_path = '/api/wallet/non-custodial/webhooks'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(create_wallet_webhook_request)

  # return_type
  return_type = opts[:debug_return_type] || 'CreateWalletWebhook201Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['OrgBearerAuth', 'ProjectBearerAuth']

  new_options = opts.merge(
    :operation => :"WalletApi.create_wallet_webhook",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: WalletApi#create_wallet_webhook\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_wallet_with_http_info(create_wallet_request, opts = {}) ⇒ Array<(CreateWallet201Response, Integer, Hash)>

Create new wallet (for testing non-custodial) Create a custodial wallet. Custodial is not used in production. Use this to test non-custodial flows: create a wallet, get its private key (GET /api/wallet/walletId/private-key), register the same address with POST /api/wallet/non-custodial/register-address, then use estimate-network-fee and POST /api/wallet/non-custodial/broadcast to build and send a signed transaction. Transaction monitoring (pending/confirmed) applies to both custodial and non-custodial WalletTransaction records.

Parameters:

  • create_wallet_request (CreateWalletRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(CreateWallet201Response, Integer, Hash)>)

    CreateWallet201Response data, response status code and response headers



180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
# File 'lib/mudbase/api/wallet_api.rb', line 180

def create_wallet_with_http_info(create_wallet_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WalletApi.create_wallet ...'
  end
  # verify the required parameter 'create_wallet_request' is set
  if @api_client.config.client_side_validation && create_wallet_request.nil?
    fail ArgumentError, "Missing the required parameter 'create_wallet_request' when calling WalletApi.create_wallet"
  end
  # resource path
  local_var_path = '/api/wallet/create'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(create_wallet_request)

  # return_type
  return_type = opts[:debug_return_type] || 'CreateWallet201Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['OrgBearerAuth', 'ProjectBearerAuth']

  new_options = opts.merge(
    :operation => :"WalletApi.create_wallet",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: WalletApi#create_wallet\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_non_custodial_address(address_id, opts = {}) ⇒ DeleteFunction200Response

Delete or deactivate a monitored wallet address Soft delete (default): Omit permanent or set to false. The address is deactivated (isActive = false); it no longer appears in list or receives monitoring but the record remains for audit. Permanent delete: Set query permanent=true to remove the address record from the database. Use when you need to fully remove the monitored address.

Parameters:

  • address_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :permanent (Boolean)

    If true, permanently delete the address from the database; if false or omitted, only deactivate (soft delete) (default to false)

Returns:



305
306
307
308
# File 'lib/mudbase/api/wallet_api.rb', line 305

def delete_non_custodial_address(address_id, opts = {})
  data, _status_code, _headers = delete_non_custodial_address_with_http_info(address_id, opts)
  data
end

#delete_non_custodial_address_with_http_info(address_id, opts = {}) ⇒ Array<(DeleteFunction200Response, Integer, Hash)>

Delete or deactivate a monitored wallet address Soft delete (default): Omit permanent or set to false. The address is deactivated (isActive = false); it no longer appears in list or receives monitoring but the record remains for audit. Permanent delete: Set query permanent=true to remove the address record from the database. Use when you need to fully remove the monitored address.

Parameters:

  • address_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :permanent (Boolean)

    If true, permanently delete the address from the database; if false or omitted, only deactivate (soft delete) (default to false)

Returns:

  • (Array<(DeleteFunction200Response, Integer, Hash)>)

    DeleteFunction200Response data, response status code and response headers



316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
# File 'lib/mudbase/api/wallet_api.rb', line 316

def delete_non_custodial_address_with_http_info(address_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WalletApi.delete_non_custodial_address ...'
  end
  # verify the required parameter 'address_id' is set
  if @api_client.config.client_side_validation && address_id.nil?
    fail ArgumentError, "Missing the required parameter 'address_id' when calling WalletApi.delete_non_custodial_address"
  end
  # resource path
  local_var_path = '/api/wallet/non-custodial/addresses/{addressId}'.sub('{' + 'addressId' + '}', CGI.escape(address_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'permanent'] = opts[:'permanent'] if !opts[:'permanent'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'DeleteFunction200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['OrgBearerAuth', 'ProjectBearerAuth']

  new_options = opts.merge(
    :operation => :"WalletApi.delete_non_custodial_address",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: WalletApi#delete_non_custodial_address\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_wallet_webhook(webhook_id, opts = {}) ⇒ DeleteFunction200Response

Delete a wallet webhook

Parameters:

  • webhook_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



369
370
371
372
# File 'lib/mudbase/api/wallet_api.rb', line 369

def delete_wallet_webhook(webhook_id, opts = {})
  data, _status_code, _headers = delete_wallet_webhook_with_http_info(webhook_id, opts)
  data
end

#delete_wallet_webhook_with_http_info(webhook_id, opts = {}) ⇒ Array<(DeleteFunction200Response, Integer, Hash)>

Delete a wallet webhook

Parameters:

  • webhook_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(DeleteFunction200Response, Integer, Hash)>)

    DeleteFunction200Response data, response status code and response headers



378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
# File 'lib/mudbase/api/wallet_api.rb', line 378

def delete_wallet_webhook_with_http_info(webhook_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WalletApi.delete_wallet_webhook ...'
  end
  # verify the required parameter 'webhook_id' is set
  if @api_client.config.client_side_validation && webhook_id.nil?
    fail ArgumentError, "Missing the required parameter 'webhook_id' when calling WalletApi.delete_wallet_webhook"
  end
  # resource path
  local_var_path = '/api/wallet/non-custodial/webhooks/{webhookId}'.sub('{' + 'webhookId' + '}', CGI.escape(webhook_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'DeleteFunction200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['OrgBearerAuth', 'ProjectBearerAuth']

  new_options = opts.merge(
    :operation => :"WalletApi.delete_wallet_webhook",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: WalletApi#delete_wallet_webhook\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#estimate_network_fee(estimate_network_fee_request, opts = {}) ⇒ EstimateNetworkFee200Response

Estimate network fee (preferred; reads from fee oracle cache) Returns network fee only from the blockchain. Preferred endpoint for network fee. Uses a fee oracle: fees are polled every 15–20s and cached, so responses are fast and RPC load is minimal (same strategy as large wallets). No platform fee. Request/response identical to POST /api/wallet/calculate-fee (which is an alias). See docs/FEE_ARCHITECTURE.md. Supported currencies: BTC, ETH, BNB, LTC, SOL, TRX, USDT, MATIC, AVAX, CELO, DOGE, TON, ADA. For USDT, network is required (ETH, BSC, TRX, SOL, POLYGON). Fresh fee before broadcast: To avoid stuck transactions, get a fresh estimate right before building/signing: use query ?fresh=1 or header X-Fee-Fresh: true to bypass cache.

Parameters:

Options Hash (opts):

  • :fresh (String)

    Bypass cache and fetch current fee from RPC/fee API (use right before building tx for broadcast)

Returns:



432
433
434
435
# File 'lib/mudbase/api/wallet_api.rb', line 432

def estimate_network_fee(estimate_network_fee_request, opts = {})
  data, _status_code, _headers = estimate_network_fee_with_http_info(estimate_network_fee_request, opts)
  data
end

#estimate_network_fee_with_http_info(estimate_network_fee_request, opts = {}) ⇒ Array<(EstimateNetworkFee200Response, Integer, Hash)>

Estimate network fee (preferred; reads from fee oracle cache) Returns network fee only from the blockchain. Preferred endpoint for network fee. Uses a fee oracle: fees are polled every 15–20s and cached, so responses are fast and RPC load is minimal (same strategy as large wallets). No platform fee. Request/response identical to POST /api/wallet/calculate-fee (which is an alias). See docs/FEE_ARCHITECTURE.md. Supported currencies: BTC, ETH, BNB, LTC, SOL, TRX, USDT, MATIC, AVAX, CELO, DOGE, TON, ADA. For USDT, `network` is required (ETH, BSC, TRX, SOL, POLYGON). Fresh fee before broadcast: To avoid stuck transactions, get a fresh estimate right before building/signing: use query `?fresh=1` or header `X-Fee-Fresh: true` to bypass cache.

Parameters:

Options Hash (opts):

  • :fresh (String)

    Bypass cache and fetch current fee from RPC/fee API (use right before building tx for broadcast)

Returns:



443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
# File 'lib/mudbase/api/wallet_api.rb', line 443

def estimate_network_fee_with_http_info(estimate_network_fee_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WalletApi.estimate_network_fee ...'
  end
  # verify the required parameter 'estimate_network_fee_request' is set
  if @api_client.config.client_side_validation && estimate_network_fee_request.nil?
    fail ArgumentError, "Missing the required parameter 'estimate_network_fee_request' when calling WalletApi.estimate_network_fee"
  end
  allowable_values = ["1"]
  if @api_client.config.client_side_validation && opts[:'fresh'] && !allowable_values.include?(opts[:'fresh'])
    fail ArgumentError, "invalid value for \"fresh\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/api/wallet/estimate-network-fee'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'fresh'] = opts[:'fresh'] if !opts[:'fresh'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(estimate_network_fee_request)

  # return_type
  return_type = opts[:debug_return_type] || 'EstimateNetworkFee200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"WalletApi.estimate_network_fee",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: WalletApi#estimate_network_fee\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#estimate_non_custodial_gas(estimate_non_custodial_gas_request, opts = {}) ⇒ EstimateNonCustodialGas200Response

Estimate network fee from blockchain (all supported chains; not controlled by Mudbase) Network fee (from blockchain only). Returns network fee estimated directly from the blockchain via RPC or fee APIs. Not controlled by Mudbase. Both POST /api/wallet/estimate-network-fee (or calculate-fee) and this endpoint return network fee only; use either for gas/fee display. This endpoint is chain-oriented and supports full transaction shape for EVM. EVM chains: ethereum, polygon, arbitrum, optimism, base, bsc, binance, avalanche, celo — require transaction (from, and to/value or tokenAddress/amount). Response includes gasLimit, gasPrice, networkFee, estimatedTime, currency. Non-EVM chains: bitcoin, litecoin, dogecoin, solana, tron, ton, cardano — only chain is required; transaction is optional/ignored. Returns networkFee, estimatedTime, currency (and e.g. satPerVb for UTXO). See docs/FEE_ARCHITECTURE.md. Results cached 15s.

Parameters:

Returns:



506
507
508
509
# File 'lib/mudbase/api/wallet_api.rb', line 506

def estimate_non_custodial_gas(estimate_non_custodial_gas_request, opts = {})
  data, _status_code, _headers = estimate_non_custodial_gas_with_http_info(estimate_non_custodial_gas_request, opts)
  data
end

#estimate_non_custodial_gas_with_http_info(estimate_non_custodial_gas_request, opts = {}) ⇒ Array<(EstimateNonCustodialGas200Response, Integer, Hash)>

Estimate network fee from blockchain (all supported chains; not controlled by Mudbase) Network fee (from blockchain only). Returns network fee estimated directly from the blockchain via RPC or fee APIs. Not controlled by Mudbase. Both POST /api/wallet/estimate-network-fee (or calculate-fee) and this endpoint return network fee only; use either for gas/fee display. This endpoint is chain-oriented and supports full transaction shape for EVM. EVM chains: ethereum, polygon, arbitrum, optimism, base, bsc, binance, avalanche, celo — require `transaction` (from, and to/value or tokenAddress/amount). Response includes gasLimit, gasPrice, networkFee, estimatedTime, currency. Non-EVM chains: bitcoin, litecoin, dogecoin, solana, tron, ton, cardano — only `chain` is required; `transaction` is optional/ignored. Returns networkFee, estimatedTime, currency (and e.g. satPerVb for UTXO). See docs/FEE_ARCHITECTURE.md. Results cached 15s.

Parameters:

Returns:



516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
# File 'lib/mudbase/api/wallet_api.rb', line 516

def estimate_non_custodial_gas_with_http_info(estimate_non_custodial_gas_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WalletApi.estimate_non_custodial_gas ...'
  end
  # verify the required parameter 'estimate_non_custodial_gas_request' is set
  if @api_client.config.client_side_validation && estimate_non_custodial_gas_request.nil?
    fail ArgumentError, "Missing the required parameter 'estimate_non_custodial_gas_request' when calling WalletApi.estimate_non_custodial_gas"
  end
  # resource path
  local_var_path = '/api/wallet/non-custodial/estimate-gas'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(estimate_non_custodial_gas_request)

  # return_type
  return_type = opts[:debug_return_type] || 'EstimateNonCustodialGas200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['OrgBearerAuth', 'ProjectBearerAuth']

  new_options = opts.merge(
    :operation => :"WalletApi.estimate_non_custodial_gas",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: WalletApi#estimate_non_custodial_gas\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#generate_private_key(generate_private_key_request, opts = {}) ⇒ GeneratePrivateKey200Response

Generate private key

Parameters:

Returns:



573
574
575
576
# File 'lib/mudbase/api/wallet_api.rb', line 573

def generate_private_key(generate_private_key_request, opts = {})
  data, _status_code, _headers = generate_private_key_with_http_info(generate_private_key_request, opts)
  data
end

#generate_private_key_with_http_info(generate_private_key_request, opts = {}) ⇒ Array<(GeneratePrivateKey200Response, Integer, Hash)>

Generate private key

Parameters:

Returns:



582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
# File 'lib/mudbase/api/wallet_api.rb', line 582

def generate_private_key_with_http_info(generate_private_key_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WalletApi.generate_private_key ...'
  end
  # verify the required parameter 'generate_private_key_request' is set
  if @api_client.config.client_side_validation && generate_private_key_request.nil?
    fail ArgumentError, "Missing the required parameter 'generate_private_key_request' when calling WalletApi.generate_private_key"
  end
  # resource path
  local_var_path = '/api/wallet/generate-key'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(generate_private_key_request)

  # return_type
  return_type = opts[:debug_return_type] || 'GeneratePrivateKey200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['OrgBearerAuth', 'ProjectBearerAuth']

  new_options = opts.merge(
    :operation => :"WalletApi.generate_private_key",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: WalletApi#generate_private_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_all_fees(opts = {}) ⇒ GetAllFees200Response

Get all chain network fees (fee oracle snapshot) Returns all chain network fees in one call. Reads from the fee oracle cache (no RPC during the request). Each chain returns the full fee object (networkFee, gasPriceGwei, congestion, estimatedTime, feeTiers for EVM, etc.) for frontend/UX. Use for dashboards or "current fees" screens.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



639
640
641
642
# File 'lib/mudbase/api/wallet_api.rb', line 639

def get_all_fees(opts = {})
  data, _status_code, _headers = get_all_fees_with_http_info(opts)
  data
end

#get_all_fees_with_http_info(opts = {}) ⇒ Array<(GetAllFees200Response, Integer, Hash)>

Get all chain network fees (fee oracle snapshot) Returns all chain network fees in one call. Reads from the fee oracle cache (no RPC during the request). Each chain returns the full fee object (networkFee, gasPriceGwei, congestion, estimatedTime, feeTiers for EVM, etc.) for frontend/UX. Use for dashboards or &quot;current fees&quot; screens.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(GetAllFees200Response, Integer, Hash)>)

    GetAllFees200Response data, response status code and response headers



648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
# File 'lib/mudbase/api/wallet_api.rb', line 648

def get_all_fees_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WalletApi.get_all_fees ...'
  end
  # resource path
  local_var_path = '/api/wallet/fees'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'GetAllFees200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"WalletApi.get_all_fees",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: WalletApi#get_all_fees\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_balance(wallet_id, opts = {}) ⇒ GetBalance200Response

Get wallet balance

Parameters:

  • wallet_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



696
697
698
699
# File 'lib/mudbase/api/wallet_api.rb', line 696

def get_balance(wallet_id, opts = {})
  data, _status_code, _headers = get_balance_with_http_info(wallet_id, opts)
  data
end

#get_balance_with_http_info(wallet_id, opts = {}) ⇒ Array<(GetBalance200Response, Integer, Hash)>

Get wallet balance

Parameters:

  • wallet_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(GetBalance200Response, Integer, Hash)>)

    GetBalance200Response data, response status code and response headers



705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
# File 'lib/mudbase/api/wallet_api.rb', line 705

def get_balance_with_http_info(wallet_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WalletApi.get_balance ...'
  end
  # verify the required parameter 'wallet_id' is set
  if @api_client.config.client_side_validation && wallet_id.nil?
    fail ArgumentError, "Missing the required parameter 'wallet_id' when calling WalletApi.get_balance"
  end
  # resource path
  local_var_path = '/api/wallet/{walletId}/balance'.sub('{' + 'walletId' + '}', CGI.escape(wallet_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'GetBalance200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['OrgBearerAuth', 'ProjectBearerAuth']

  new_options = opts.merge(
    :operation => :"WalletApi.get_balance",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: WalletApi#get_balance\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_cancel_params(get_cancel_params_request, opts = {}) ⇒ GetCancelParams200Response

Get replacement tx params for cancel (stuck EVM tx) Returns replacement transaction params to cancel a stuck EVM transaction (same nonce, to=self, value=0, data=0x, higher gas). Client signs and broadcasts via POST /api/wallet/non-custodial/broadcast. Address must be registered for your organization. EVM chains only.

Parameters:

  • get_cancel_params_request (GetCancelParamsRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



758
759
760
761
# File 'lib/mudbase/api/wallet_api.rb', line 758

def get_cancel_params(get_cancel_params_request, opts = {})
  data, _status_code, _headers = get_cancel_params_with_http_info(get_cancel_params_request, opts)
  data
end

#get_cancel_params_with_http_info(get_cancel_params_request, opts = {}) ⇒ Array<(GetCancelParams200Response, Integer, Hash)>

Get replacement tx params for cancel (stuck EVM tx) Returns replacement transaction params to cancel a stuck EVM transaction (same nonce, to=self, value=0, data=0x, higher gas). Client signs and broadcasts via POST /api/wallet/non-custodial/broadcast. Address must be registered for your organization. EVM chains only.

Parameters:

  • get_cancel_params_request (GetCancelParamsRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(GetCancelParams200Response, Integer, Hash)>)

    GetCancelParams200Response data, response status code and response headers



768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
# File 'lib/mudbase/api/wallet_api.rb', line 768

def get_cancel_params_with_http_info(get_cancel_params_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WalletApi.get_cancel_params ...'
  end
  # verify the required parameter 'get_cancel_params_request' is set
  if @api_client.config.client_side_validation && get_cancel_params_request.nil?
    fail ArgumentError, "Missing the required parameter 'get_cancel_params_request' when calling WalletApi.get_cancel_params"
  end
  # resource path
  local_var_path = '/api/wallet/non-custodial/cancel'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(get_cancel_params_request)

  # return_type
  return_type = opts[:debug_return_type] || 'GetCancelParams200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['OrgBearerAuth', 'ProjectBearerAuth']

  new_options = opts.merge(
    :operation => :"WalletApi.get_cancel_params",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: WalletApi#get_cancel_params\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_network_status(opts = {}) ⇒ GetNetworkStatus200Response

Get network status (congestion + fee metric per chain) Returns network status per chain (congestion and main fee metric). Use to show network health before sending transactions. Same data as GET /fees but trimmed to congestion + gasPriceGwei (EVM) or satPerVb (UTXO) and networkFee.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



825
826
827
828
# File 'lib/mudbase/api/wallet_api.rb', line 825

def get_network_status(opts = {})
  data, _status_code, _headers = get_network_status_with_http_info(opts)
  data
end

#get_network_status_with_http_info(opts = {}) ⇒ Array<(GetNetworkStatus200Response, Integer, Hash)>

Get network status (congestion + fee metric per chain) Returns network status per chain (congestion and main fee metric). Use to show network health before sending transactions. Same data as GET /fees but trimmed to congestion + gasPriceGwei (EVM) or satPerVb (UTXO) and networkFee.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(GetNetworkStatus200Response, Integer, Hash)>)

    GetNetworkStatus200Response data, response status code and response headers



834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
# File 'lib/mudbase/api/wallet_api.rb', line 834

def get_network_status_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WalletApi.get_network_status ...'
  end
  # resource path
  local_var_path = '/api/wallet/network-status'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'GetNetworkStatus200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"WalletApi.get_network_status",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: WalletApi#get_network_status\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_non_custodial_address(address_id, opts = {}) ⇒ NonCustodialAddressResponse

Get non-custodial address by ID

Parameters:

  • address_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



882
883
884
885
# File 'lib/mudbase/api/wallet_api.rb', line 882

def get_non_custodial_address(address_id, opts = {})
  data, _status_code, _headers = get_non_custodial_address_with_http_info(address_id, opts)
  data
end

#get_non_custodial_address_with_http_info(address_id, opts = {}) ⇒ Array<(NonCustodialAddressResponse, Integer, Hash)>

Get non-custodial address by ID

Parameters:

  • address_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(NonCustodialAddressResponse, Integer, Hash)>)

    NonCustodialAddressResponse data, response status code and response headers



891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
# File 'lib/mudbase/api/wallet_api.rb', line 891

def get_non_custodial_address_with_http_info(address_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WalletApi.get_non_custodial_address ...'
  end
  # verify the required parameter 'address_id' is set
  if @api_client.config.client_side_validation && address_id.nil?
    fail ArgumentError, "Missing the required parameter 'address_id' when calling WalletApi.get_non_custodial_address"
  end
  # resource path
  local_var_path = '/api/wallet/non-custodial/addresses/{addressId}'.sub('{' + 'addressId' + '}', CGI.escape(address_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'NonCustodialAddressResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['OrgBearerAuth', 'ProjectBearerAuth']

  new_options = opts.merge(
    :operation => :"WalletApi.get_non_custodial_address",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: WalletApi#get_non_custodial_address\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_non_custodial_balance(address_id, opts = {}) ⇒ GetNonCustodialBalance200Response

Get balance for a non-custodial address

Parameters:

  • address_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



943
944
945
946
# File 'lib/mudbase/api/wallet_api.rb', line 943

def get_non_custodial_balance(address_id, opts = {})
  data, _status_code, _headers = get_non_custodial_balance_with_http_info(address_id, opts)
  data
end

#get_non_custodial_balance_with_http_info(address_id, opts = {}) ⇒ Array<(GetNonCustodialBalance200Response, Integer, Hash)>

Get balance for a non-custodial address

Parameters:

  • address_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
# File 'lib/mudbase/api/wallet_api.rb', line 952

def get_non_custodial_balance_with_http_info(address_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WalletApi.get_non_custodial_balance ...'
  end
  # verify the required parameter 'address_id' is set
  if @api_client.config.client_side_validation && address_id.nil?
    fail ArgumentError, "Missing the required parameter 'address_id' when calling WalletApi.get_non_custodial_balance"
  end
  # resource path
  local_var_path = '/api/wallet/non-custodial/addresses/{addressId}/balance'.sub('{' + 'addressId' + '}', CGI.escape(address_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'GetNonCustodialBalance200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['OrgBearerAuth', 'ProjectBearerAuth']

  new_options = opts.merge(
    :operation => :"WalletApi.get_non_custodial_balance",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: WalletApi#get_non_custodial_balance\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_non_custodial_transaction_by_hash(tx_hash, chain, opts = {}) ⇒ GetNonCustodialTransactionByHash200Response

Get transaction by hash Returns a transaction by its hash. The chain query parameter is required because the same hash format can exist on different chains (e.g. 0x-style on EVM chains).

Parameters:

  • tx_hash (String)

    Transaction hash (e.g. 0x... for EVM, or block explorer format for UTXO)

  • chain (String)

    Chain the transaction belongs to (required for lookup)

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



1006
1007
1008
1009
# File 'lib/mudbase/api/wallet_api.rb', line 1006

def get_non_custodial_transaction_by_hash(tx_hash, chain, opts = {})
  data, _status_code, _headers = get_non_custodial_transaction_by_hash_with_http_info(tx_hash, chain, opts)
  data
end

#get_non_custodial_transaction_by_hash_with_http_info(tx_hash, chain, opts = {}) ⇒ Array<(GetNonCustodialTransactionByHash200Response, Integer, Hash)>

Get transaction by hash Returns a transaction by its hash. The chain query parameter is required because the same hash format can exist on different chains (e.g. 0x-style on EVM chains).

Parameters:

  • tx_hash (String)

    Transaction hash (e.g. 0x... for EVM, or block explorer format for UTXO)

  • chain (String)

    Chain the transaction belongs to (required for lookup)

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
# File 'lib/mudbase/api/wallet_api.rb', line 1017

def get_non_custodial_transaction_by_hash_with_http_info(tx_hash, chain, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WalletApi.get_non_custodial_transaction_by_hash ...'
  end
  # verify the required parameter 'tx_hash' is set
  if @api_client.config.client_side_validation && tx_hash.nil?
    fail ArgumentError, "Missing the required parameter 'tx_hash' when calling WalletApi.get_non_custodial_transaction_by_hash"
  end
  # verify the required parameter 'chain' is set
  if @api_client.config.client_side_validation && chain.nil?
    fail ArgumentError, "Missing the required parameter 'chain' when calling WalletApi.get_non_custodial_transaction_by_hash"
  end
  # verify enum value
  allowable_values = ["ethereum", "binance", "polygon", "celo", "bitcoin", "litecoin", "solana", "tron", "ripple", "cardano", "dogecoin", "ton"]
  if @api_client.config.client_side_validation && !allowable_values.include?(chain)
    fail ArgumentError, "invalid value for \"chain\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/api/wallet/non-custodial/transactions/{txHash}'.sub('{' + 'txHash' + '}', CGI.escape(tx_hash.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'chain'] = chain

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'GetNonCustodialTransactionByHash200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['OrgBearerAuth', 'ProjectBearerAuth']

  new_options = opts.merge(
    :operation => :"WalletApi.get_non_custodial_transaction_by_hash",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: WalletApi#get_non_custodial_transaction_by_hash\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_non_custodial_transactions(address_id, opts = {}) ⇒ GetNonCustodialTransactions200Response

Get transaction history for a non-custodial address

Parameters:

  • address_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :limit (Integer) — default: default to 50
  • :page (Integer) — default: default to 1

Returns:



1081
1082
1083
1084
# File 'lib/mudbase/api/wallet_api.rb', line 1081

def get_non_custodial_transactions(address_id, opts = {})
  data, _status_code, _headers = get_non_custodial_transactions_with_http_info(address_id, opts)
  data
end

#get_non_custodial_transactions_with_http_info(address_id, opts = {}) ⇒ Array<(GetNonCustodialTransactions200Response, Integer, Hash)>

Get transaction history for a non-custodial address

Parameters:

  • address_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :limit (Integer) — default: default to 50
  • :page (Integer) — default: default to 1

Returns:



1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
# File 'lib/mudbase/api/wallet_api.rb', line 1092

def get_non_custodial_transactions_with_http_info(address_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WalletApi.get_non_custodial_transactions ...'
  end
  # verify the required parameter 'address_id' is set
  if @api_client.config.client_side_validation && address_id.nil?
    fail ArgumentError, "Missing the required parameter 'address_id' when calling WalletApi.get_non_custodial_transactions"
  end
  # resource path
  local_var_path = '/api/wallet/non-custodial/addresses/{addressId}/transactions'.sub('{' + 'addressId' + '}', CGI.escape(address_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'GetNonCustodialTransactions200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['OrgBearerAuth', 'ProjectBearerAuth']

  new_options = opts.merge(
    :operation => :"WalletApi.get_non_custodial_transactions",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: WalletApi#get_non_custodial_transactions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_speed_up_params(get_speed_up_params_request, opts = {}) ⇒ GetSpeedUpParams200Response

Get replacement tx params for speed-up (stuck EVM tx) Returns replacement transaction params for a stuck EVM transaction (same nonce, same to/value/data, higher gas). Client signs the replacement and broadcasts via POST /api/wallet/non-custodial/broadcast. Address must be registered for your organization. Use when a tx has been pending >5 min (stuck). EVM chains only.

Parameters:

Returns:



1147
1148
1149
1150
# File 'lib/mudbase/api/wallet_api.rb', line 1147

def get_speed_up_params(get_speed_up_params_request, opts = {})
  data, _status_code, _headers = get_speed_up_params_with_http_info(get_speed_up_params_request, opts)
  data
end

#get_speed_up_params_with_http_info(get_speed_up_params_request, opts = {}) ⇒ Array<(GetSpeedUpParams200Response, Integer, Hash)>

Get replacement tx params for speed-up (stuck EVM tx) Returns replacement transaction params for a stuck EVM transaction (same nonce, same to/value/data, higher gas). Client signs the replacement and broadcasts via POST /api/wallet/non-custodial/broadcast. Address must be registered for your organization. Use when a tx has been pending >5 min (stuck). EVM chains only.

Parameters:

Returns:

  • (Array<(GetSpeedUpParams200Response, Integer, Hash)>)

    GetSpeedUpParams200Response data, response status code and response headers



1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
# File 'lib/mudbase/api/wallet_api.rb', line 1157

def get_speed_up_params_with_http_info(get_speed_up_params_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WalletApi.get_speed_up_params ...'
  end
  # verify the required parameter 'get_speed_up_params_request' is set
  if @api_client.config.client_side_validation && get_speed_up_params_request.nil?
    fail ArgumentError, "Missing the required parameter 'get_speed_up_params_request' when calling WalletApi.get_speed_up_params"
  end
  # resource path
  local_var_path = '/api/wallet/non-custodial/speed-up'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(get_speed_up_params_request)

  # return_type
  return_type = opts[:debug_return_type] || 'GetSpeedUpParams200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['OrgBearerAuth', 'ProjectBearerAuth']

  new_options = opts.merge(
    :operation => :"WalletApi.get_speed_up_params",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: WalletApi#get_speed_up_params\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_supported_currencies(opts = {}) ⇒ GetSupportedCurrencies200Response

Get supported currencies and chains Returns the list of platform-supported cryptocurrencies and chains for non-custodial wallets, broadcast, and multi-chain use. Custodial wallet is no longer used in production; this endpoint is the source of truth for supported chains and currencies. Supported: BTC, LTC, DOGE, ETH, ETC, CELO, SOL, TRX, TON, Polygon (MATIC), Arbitrum, Optimism, Base, BSC/BNB, Avalanche (AVAX), Cardano (ADA), USDT. Each item includes code (currency symbol), name (display name), chain (chain id for API calls). USDT includes networks (ETH, BSC, TRX, SOL, POLYGON). Use chain with non-custodial endpoints (register-address, broadcast, estimate-gas). Use code for display and fee/currency selection. This is a public endpoint - no authentication required.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



1214
1215
1216
1217
# File 'lib/mudbase/api/wallet_api.rb', line 1214

def get_supported_currencies(opts = {})
  data, _status_code, _headers = get_supported_currencies_with_http_info(opts)
  data
end

#get_supported_currencies_with_http_info(opts = {}) ⇒ Array<(GetSupportedCurrencies200Response, Integer, Hash)>

Get supported currencies and chains Returns the list of platform-supported cryptocurrencies and chains for non-custodial wallets, broadcast, and multi-chain use. Custodial wallet is no longer used in production; this endpoint is the source of truth for supported chains and currencies. Supported: BTC, LTC, DOGE, ETH, ETC, CELO, SOL, TRX, TON, Polygon (MATIC), Arbitrum, Optimism, Base, BSC/BNB, Avalanche (AVAX), Cardano (ADA), USDT. Each item includes code (currency symbol), name (display name), chain (chain id for API calls). USDT includes networks (ETH, BSC, TRX, SOL, POLYGON). Use chain with non-custodial endpoints (register-address, broadcast, estimate-gas). Use code for display and fee/currency selection. This is a public endpoint - no authentication required.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
# File 'lib/mudbase/api/wallet_api.rb', line 1223

def get_supported_currencies_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WalletApi.get_supported_currencies ...'
  end
  # resource path
  local_var_path = '/api/wallet/currencies'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'GetSupportedCurrencies200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"WalletApi.get_supported_currencies",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: WalletApi#get_supported_currencies\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_transaction(transaction_id, opts = {}) ⇒ GetTransaction200Response

Get transaction details

Parameters:

  • transaction_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



1271
1272
1273
1274
# File 'lib/mudbase/api/wallet_api.rb', line 1271

def get_transaction(transaction_id, opts = {})
  data, _status_code, _headers = get_transaction_with_http_info(transaction_id, opts)
  data
end

#get_transaction_history(opts = {}) ⇒ GetTransactionHistory200Response

Get transaction history (custodial wallets; same monitoring as non-custodial) Returns transaction history for custodial wallets. Transactions are stored and monitored the same way as non-custodial (WalletTransaction); status updates (pending, broadcast, confirmed, failed) and stuck detection apply to both.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :wallet_id (String)
  • :limit (Integer) — default: default to 20
  • :page (Integer) — default: default to 1

Returns:



1335
1336
1337
1338
# File 'lib/mudbase/api/wallet_api.rb', line 1335

def get_transaction_history(opts = {})
  data, _status_code, _headers = get_transaction_history_with_http_info(opts)
  data
end

#get_transaction_history_with_http_info(opts = {}) ⇒ Array<(GetTransactionHistory200Response, Integer, Hash)>

Get transaction history (custodial wallets; same monitoring as non-custodial) Returns transaction history for custodial wallets. Transactions are stored and monitored the same way as non-custodial (WalletTransaction); status updates (pending, broadcast, confirmed, failed) and stuck detection apply to both.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :wallet_id (String)
  • :limit (Integer) — default: default to 20
  • :page (Integer) — default: default to 1

Returns:



1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
# File 'lib/mudbase/api/wallet_api.rb', line 1347

def get_transaction_history_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WalletApi.get_transaction_history ...'
  end
  # resource path
  local_var_path = '/api/wallet/transactions'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'walletId'] = opts[:'wallet_id'] if !opts[:'wallet_id'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'GetTransactionHistory200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['OrgBearerAuth', 'ProjectBearerAuth']

  new_options = opts.merge(
    :operation => :"WalletApi.get_transaction_history",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: WalletApi#get_transaction_history\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_transaction_with_http_info(transaction_id, opts = {}) ⇒ Array<(GetTransaction200Response, Integer, Hash)>

Get transaction details

Parameters:

  • transaction_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(GetTransaction200Response, Integer, Hash)>)

    GetTransaction200Response data, response status code and response headers



1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
# File 'lib/mudbase/api/wallet_api.rb', line 1280

def get_transaction_with_http_info(transaction_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WalletApi.get_transaction ...'
  end
  # verify the required parameter 'transaction_id' is set
  if @api_client.config.client_side_validation && transaction_id.nil?
    fail ArgumentError, "Missing the required parameter 'transaction_id' when calling WalletApi.get_transaction"
  end
  # resource path
  local_var_path = '/api/wallet/transactions/{transactionId}'.sub('{' + 'transactionId' + '}', CGI.escape(transaction_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'GetTransaction200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['OrgBearerAuth', 'ProjectBearerAuth']

  new_options = opts.merge(
    :operation => :"WalletApi.get_transaction",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: WalletApi#get_transaction\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_user_wallets(opts = {}) ⇒ GetUserWallets200Response

Get user wallets

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :project_id (String)
  • :currency (String)

Returns:



1399
1400
1401
1402
# File 'lib/mudbase/api/wallet_api.rb', line 1399

def get_user_wallets(opts = {})
  data, _status_code, _headers = get_user_wallets_with_http_info(opts)
  data
end

#get_user_wallets_with_http_info(opts = {}) ⇒ Array<(GetUserWallets200Response, Integer, Hash)>

Get user wallets

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :project_id (String)
  • :currency (String)

Returns:

  • (Array<(GetUserWallets200Response, Integer, Hash)>)

    GetUserWallets200Response data, response status code and response headers



1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
# File 'lib/mudbase/api/wallet_api.rb', line 1409

def get_user_wallets_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WalletApi.get_user_wallets ...'
  end
  # resource path
  local_var_path = '/api/wallet'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'projectId'] = opts[:'project_id'] if !opts[:'project_id'].nil?
  query_params[:'currency'] = opts[:'currency'] if !opts[:'currency'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'GetUserWallets200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['OrgBearerAuth', 'ProjectBearerAuth']

  new_options = opts.merge(
    :operation => :"WalletApi.get_user_wallets",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: WalletApi#get_user_wallets\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_wallet_fee_config(project_id, opts = {}) ⇒ GetWalletFeeConfig200Response

Get project fee configuration (for non-custodial / external users) Get project-level fee settings (enabled flag and fee percentage). For non-custodial / external users — e.g. when your app charges a fee on payouts or transfers. Custodial wallet is no longer used in production. Applies to all supported chains/currencies for that project.

Parameters:

  • project_id (String)

    Project ID

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



1460
1461
1462
1463
# File 'lib/mudbase/api/wallet_api.rb', line 1460

def get_wallet_fee_config(project_id, opts = {})
  data, _status_code, _headers = get_wallet_fee_config_with_http_info(project_id, opts)
  data
end

#get_wallet_fee_config_with_http_info(project_id, opts = {}) ⇒ Array<(GetWalletFeeConfig200Response, Integer, Hash)>

Get project fee configuration (for non-custodial / external users) Get project-level fee settings (enabled flag and fee percentage). For non-custodial / external users — e.g. when your app charges a fee on payouts or transfers. Custodial wallet is no longer used in production. Applies to all supported chains/currencies for that project.

Parameters:

  • project_id (String)

    Project ID

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
# File 'lib/mudbase/api/wallet_api.rb', line 1470

def get_wallet_fee_config_with_http_info(project_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WalletApi.get_wallet_fee_config ...'
  end
  # verify the required parameter 'project_id' is set
  if @api_client.config.client_side_validation && project_id.nil?
    fail ArgumentError, "Missing the required parameter 'project_id' when calling WalletApi.get_wallet_fee_config"
  end
  # resource path
  local_var_path = '/api/wallet/projects/{projectId}/fee-config'.sub('{' + 'projectId' + '}', CGI.escape(project_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'GetWalletFeeConfig200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['OrgBearerAuth', 'ProjectBearerAuth']

  new_options = opts.merge(
    :operation => :"WalletApi.get_wallet_fee_config",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: WalletApi#get_wallet_fee_config\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_wallet_private_key(wallet_id, opts = {}) ⇒ GetWalletPrivateKey200Response

Get wallet private key (WARNING: Sensitive data; for testing non-custodial) Returns the wallet private key. For testing non-custodial only: use this key to sign a transaction locally, then register the wallet address via POST /api/wallet/non-custodial/register-address and broadcast the signed tx via POST /api/wallet/non-custodial/broadcast.

Parameters:

  • wallet_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



1523
1524
1525
1526
# File 'lib/mudbase/api/wallet_api.rb', line 1523

def get_wallet_private_key(wallet_id, opts = {})
  data, _status_code, _headers = get_wallet_private_key_with_http_info(wallet_id, opts)
  data
end

#get_wallet_private_key_with_http_info(wallet_id, opts = {}) ⇒ Array<(GetWalletPrivateKey200Response, Integer, Hash)>

Get wallet private key (WARNING: Sensitive data; for testing non-custodial) Returns the wallet private key. For testing non-custodial only: use this key to sign a transaction locally, then register the wallet address via POST /api/wallet/non-custodial/register-address and broadcast the signed tx via POST /api/wallet/non-custodial/broadcast.

Parameters:

  • wallet_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
# File 'lib/mudbase/api/wallet_api.rb', line 1533

def get_wallet_private_key_with_http_info(wallet_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WalletApi.get_wallet_private_key ...'
  end
  # verify the required parameter 'wallet_id' is set
  if @api_client.config.client_side_validation && wallet_id.nil?
    fail ArgumentError, "Missing the required parameter 'wallet_id' when calling WalletApi.get_wallet_private_key"
  end
  # resource path
  local_var_path = '/api/wallet/{walletId}/private-key'.sub('{' + 'walletId' + '}', CGI.escape(wallet_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'GetWalletPrivateKey200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['OrgBearerAuth', 'ProjectBearerAuth']

  new_options = opts.merge(
    :operation => :"WalletApi.get_wallet_private_key",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: WalletApi#get_wallet_private_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_wallet_webhook_logs(webhook_id, opts = {}) ⇒ GetWalletWebhookLogs200Response

Get webhook delivery logs

Parameters:

  • webhook_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :limit (Integer) — default: default to 50

Returns:



1586
1587
1588
1589
# File 'lib/mudbase/api/wallet_api.rb', line 1586

def get_wallet_webhook_logs(webhook_id, opts = {})
  data, _status_code, _headers = get_wallet_webhook_logs_with_http_info(webhook_id, opts)
  data
end

#get_wallet_webhook_logs_with_http_info(webhook_id, opts = {}) ⇒ Array<(GetWalletWebhookLogs200Response, Integer, Hash)>

Get webhook delivery logs

Parameters:

  • webhook_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :limit (Integer) — default: default to 50

Returns:



1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
# File 'lib/mudbase/api/wallet_api.rb', line 1596

def get_wallet_webhook_logs_with_http_info(webhook_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WalletApi.get_wallet_webhook_logs ...'
  end
  # verify the required parameter 'webhook_id' is set
  if @api_client.config.client_side_validation && webhook_id.nil?
    fail ArgumentError, "Missing the required parameter 'webhook_id' when calling WalletApi.get_wallet_webhook_logs"
  end
  # resource path
  local_var_path = '/api/wallet/non-custodial/webhooks/{webhookId}/logs'.sub('{' + 'webhookId' + '}', CGI.escape(webhook_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'GetWalletWebhookLogs200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['OrgBearerAuth']

  new_options = opts.merge(
    :operation => :"WalletApi.get_wallet_webhook_logs",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: WalletApi#get_wallet_webhook_logs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_non_custodial_addresses(opts = {}) ⇒ ListNonCustodialAddresses200Response

List registered non-custodial addresses

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :chain (String)

    Filter by chain (optional)

  • :project_id (String)

Returns:



1650
1651
1652
1653
# File 'lib/mudbase/api/wallet_api.rb', line 1650

def list_non_custodial_addresses(opts = {})
  data, _status_code, _headers = list_non_custodial_addresses_with_http_info(opts)
  data
end

#list_non_custodial_addresses_with_http_info(opts = {}) ⇒ Array<(ListNonCustodialAddresses200Response, Integer, Hash)>

List registered non-custodial addresses

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :chain (String)

    Filter by chain (optional)

  • :project_id (String)

Returns:



1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
# File 'lib/mudbase/api/wallet_api.rb', line 1660

def list_non_custodial_addresses_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WalletApi.list_non_custodial_addresses ...'
  end
  allowable_values = ["ethereum", "binance", "bsc", "polygon", "arbitrum", "optimism", "base", "avalanche", "celo", "bitcoin", "litecoin", "dogecoin", "solana", "tron", "ripple", "cardano", "ton"]
  if @api_client.config.client_side_validation && opts[:'chain'] && !allowable_values.include?(opts[:'chain'])
    fail ArgumentError, "invalid value for \"chain\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/api/wallet/non-custodial/addresses'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'chain'] = opts[:'chain'] if !opts[:'chain'].nil?
  query_params[:'projectId'] = opts[:'project_id'] if !opts[:'project_id'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'ListNonCustodialAddresses200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['OrgBearerAuth', 'ProjectBearerAuth']

  new_options = opts.merge(
    :operation => :"WalletApi.list_non_custodial_addresses",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: WalletApi#list_non_custodial_addresses\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_wallet_webhooks(opts = {}) ⇒ ListWalletWebhooks200Response

List wallet webhooks

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :project_id (String)

Returns:



1714
1715
1716
1717
# File 'lib/mudbase/api/wallet_api.rb', line 1714

def list_wallet_webhooks(opts = {})
  data, _status_code, _headers = list_wallet_webhooks_with_http_info(opts)
  data
end

#list_wallet_webhooks_with_http_info(opts = {}) ⇒ Array<(ListWalletWebhooks200Response, Integer, Hash)>

List wallet webhooks

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :project_id (String)

Returns:



1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
# File 'lib/mudbase/api/wallet_api.rb', line 1723

def list_wallet_webhooks_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WalletApi.list_wallet_webhooks ...'
  end
  # resource path
  local_var_path = '/api/wallet/non-custodial/webhooks'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'projectId'] = opts[:'project_id'] if !opts[:'project_id'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'ListWalletWebhooks200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['OrgBearerAuth', 'ProjectBearerAuth']

  new_options = opts.merge(
    :operation => :"WalletApi.list_wallet_webhooks",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: WalletApi#list_wallet_webhooks\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#register_non_custodial_address(register_non_custodial_address_request, opts = {}) ⇒ NonCustodialAddressResponse

Register a non-custodial wallet address Register a public wallet address for monitoring and indexing. All key operations (generation, signing) occur client-side only.

Parameters:

Returns:



1773
1774
1775
1776
# File 'lib/mudbase/api/wallet_api.rb', line 1773

def register_non_custodial_address(register_non_custodial_address_request, opts = {})
  data, _status_code, _headers = register_non_custodial_address_with_http_info(register_non_custodial_address_request, opts)
  data
end

#register_non_custodial_address_with_http_info(register_non_custodial_address_request, opts = {}) ⇒ Array<(NonCustodialAddressResponse, Integer, Hash)>

Register a non-custodial wallet address Register a public wallet address for monitoring and indexing. All key operations (generation, signing) occur client-side only.

Parameters:

Returns:

  • (Array<(NonCustodialAddressResponse, Integer, Hash)>)

    NonCustodialAddressResponse data, response status code and response headers



1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
# File 'lib/mudbase/api/wallet_api.rb', line 1783

def register_non_custodial_address_with_http_info(register_non_custodial_address_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WalletApi.register_non_custodial_address ...'
  end
  # verify the required parameter 'register_non_custodial_address_request' is set
  if @api_client.config.client_side_validation && register_non_custodial_address_request.nil?
    fail ArgumentError, "Missing the required parameter 'register_non_custodial_address_request' when calling WalletApi.register_non_custodial_address"
  end
  # resource path
  local_var_path = '/api/wallet/non-custodial/register-address'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(register_non_custodial_address_request)

  # return_type
  return_type = opts[:debug_return_type] || 'NonCustodialAddressResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['OrgBearerAuth', 'ProjectBearerAuth']

  new_options = opts.merge(
    :operation => :"WalletApi.register_non_custodial_address",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: WalletApi#register_non_custodial_address\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#test_wallet_webhook(test_wallet_webhook_request, opts = {}) ⇒ TestWalletWebhook200Response

Test a webhook delivery (sends a single test payload)

Parameters:

Returns:



1840
1841
1842
1843
# File 'lib/mudbase/api/wallet_api.rb', line 1840

def test_wallet_webhook(test_wallet_webhook_request, opts = {})
  data, _status_code, _headers = test_wallet_webhook_with_http_info(test_wallet_webhook_request, opts)
  data
end

#test_wallet_webhook_with_http_info(test_wallet_webhook_request, opts = {}) ⇒ Array<(TestWalletWebhook200Response, Integer, Hash)>

Test a webhook delivery (sends a single test payload)

Parameters:

Returns:



1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
# File 'lib/mudbase/api/wallet_api.rb', line 1849

def test_wallet_webhook_with_http_info(test_wallet_webhook_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WalletApi.test_wallet_webhook ...'
  end
  # verify the required parameter 'test_wallet_webhook_request' is set
  if @api_client.config.client_side_validation && test_wallet_webhook_request.nil?
    fail ArgumentError, "Missing the required parameter 'test_wallet_webhook_request' when calling WalletApi.test_wallet_webhook"
  end
  # resource path
  local_var_path = '/api/wallet/non-custodial/webhooks/test'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(test_wallet_webhook_request)

  # return_type
  return_type = opts[:debug_return_type] || 'TestWalletWebhook200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['OrgBearerAuth']

  new_options = opts.merge(
    :operation => :"WalletApi.test_wallet_webhook",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: WalletApi#test_wallet_webhook\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_non_custodial_address(address_id, opts = {}) ⇒ UpdateNonCustodialAddress200Response

Update a monitored wallet address Update metadata for a registered non-custodial address. Only label and derivationPath can be updated; address and chain are immutable.

Parameters:

  • address_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

Returns:



1908
1909
1910
1911
# File 'lib/mudbase/api/wallet_api.rb', line 1908

def update_non_custodial_address(address_id, opts = {})
  data, _status_code, _headers = update_non_custodial_address_with_http_info(address_id, opts)
  data
end

#update_non_custodial_address_with_http_info(address_id, opts = {}) ⇒ Array<(UpdateNonCustodialAddress200Response, Integer, Hash)>

Update a monitored wallet address Update metadata for a registered non-custodial address. Only label and derivationPath can be updated; address and chain are immutable.

Parameters:

  • address_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

Returns:



1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
# File 'lib/mudbase/api/wallet_api.rb', line 1919

def update_non_custodial_address_with_http_info(address_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WalletApi.update_non_custodial_address ...'
  end
  # verify the required parameter 'address_id' is set
  if @api_client.config.client_side_validation && address_id.nil?
    fail ArgumentError, "Missing the required parameter 'address_id' when calling WalletApi.update_non_custodial_address"
  end
  # resource path
  local_var_path = '/api/wallet/non-custodial/addresses/{addressId}'.sub('{' + 'addressId' + '}', CGI.escape(address_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'update_non_custodial_address_request'])

  # return_type
  return_type = opts[:debug_return_type] || 'UpdateNonCustodialAddress200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['OrgBearerAuth', 'ProjectBearerAuth']

  new_options = opts.merge(
    :operation => :"WalletApi.update_non_custodial_address",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: WalletApi#update_non_custodial_address\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_wallet_fee_config(project_id, opts = {}) ⇒ UpdateWalletFeeConfig200Response

Update project fee configuration (for non-custodial / external users) Update project-level fee settings. For non-custodial / external users — e.g. fee charged on payouts or transfers. Custodial wallet is no longer used in production. Applies to all supported currencies (BTC, ETH, BNB, LTC, SOL, TRX, USDT). feePercentage is a decimal: use 0.01 for 1%, 0.005 for 0.5%, etc. (min 0, max 1).

Parameters:

  • project_id (String)

    Project ID

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

Returns:



1978
1979
1980
1981
# File 'lib/mudbase/api/wallet_api.rb', line 1978

def update_wallet_fee_config(project_id, opts = {})
  data, _status_code, _headers = update_wallet_fee_config_with_http_info(project_id, opts)
  data
end

#update_wallet_fee_config_with_http_info(project_id, opts = {}) ⇒ Array<(UpdateWalletFeeConfig200Response, Integer, Hash)>

Update project fee configuration (for non-custodial / external users) Update project-level fee settings. For non-custodial / external users — e.g. fee charged on payouts or transfers. Custodial wallet is no longer used in production. Applies to all supported currencies (BTC, ETH, BNB, LTC, SOL, TRX, USDT). feePercentage is a decimal: use `0.01` for 1%, `0.005` for 0.5%, etc. (min 0, max 1).

Parameters:

  • project_id (String)

    Project ID

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

Returns:



1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
# File 'lib/mudbase/api/wallet_api.rb', line 1989

def update_wallet_fee_config_with_http_info(project_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WalletApi.update_wallet_fee_config ...'
  end
  # verify the required parameter 'project_id' is set
  if @api_client.config.client_side_validation && project_id.nil?
    fail ArgumentError, "Missing the required parameter 'project_id' when calling WalletApi.update_wallet_fee_config"
  end
  # resource path
  local_var_path = '/api/wallet/projects/{projectId}/fee-config'.sub('{' + 'projectId' + '}', CGI.escape(project_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'update_wallet_fee_config_request'])

  # return_type
  return_type = opts[:debug_return_type] || 'UpdateWalletFeeConfig200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['OrgBearerAuth', 'ProjectBearerAuth']

  new_options = opts.merge(
    :operation => :"WalletApi.update_wallet_fee_config",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: WalletApi#update_wallet_fee_config\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_wallet_webhook(webhook_id, update_wallet_webhook_request, opts = {}) ⇒ UpdateWalletWebhook200Response

Update a wallet webhook

Parameters:

  • webhook_id (String)
  • update_wallet_webhook_request (UpdateWalletWebhookRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



2047
2048
2049
2050
# File 'lib/mudbase/api/wallet_api.rb', line 2047

def update_wallet_webhook(webhook_id, update_wallet_webhook_request, opts = {})
  data, _status_code, _headers = update_wallet_webhook_with_http_info(webhook_id, update_wallet_webhook_request, opts)
  data
end

#update_wallet_webhook_with_http_info(webhook_id, update_wallet_webhook_request, opts = {}) ⇒ Array<(UpdateWalletWebhook200Response, Integer, Hash)>

Update a wallet webhook

Parameters:

  • webhook_id (String)
  • update_wallet_webhook_request (UpdateWalletWebhookRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
# File 'lib/mudbase/api/wallet_api.rb', line 2057

def update_wallet_webhook_with_http_info(webhook_id, update_wallet_webhook_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WalletApi.update_wallet_webhook ...'
  end
  # verify the required parameter 'webhook_id' is set
  if @api_client.config.client_side_validation && webhook_id.nil?
    fail ArgumentError, "Missing the required parameter 'webhook_id' when calling WalletApi.update_wallet_webhook"
  end
  # verify the required parameter 'update_wallet_webhook_request' is set
  if @api_client.config.client_side_validation && update_wallet_webhook_request.nil?
    fail ArgumentError, "Missing the required parameter 'update_wallet_webhook_request' when calling WalletApi.update_wallet_webhook"
  end
  # resource path
  local_var_path = '/api/wallet/non-custodial/webhooks/{webhookId}'.sub('{' + 'webhookId' + '}', CGI.escape(webhook_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(update_wallet_webhook_request)

  # return_type
  return_type = opts[:debug_return_type] || 'UpdateWalletWebhook200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['OrgBearerAuth']

  new_options = opts.merge(
    :operation => :"WalletApi.update_wallet_webhook",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: WalletApi#update_wallet_webhook\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#validate_address(validate_address_request, opts = {}) ⇒ ValidateAddress200Response

Validate cryptocurrency address

Parameters:

Returns:



2118
2119
2120
2121
# File 'lib/mudbase/api/wallet_api.rb', line 2118

def validate_address(validate_address_request, opts = {})
  data, _status_code, _headers = validate_address_with_http_info(validate_address_request, opts)
  data
end

#validate_address_with_http_info(validate_address_request, opts = {}) ⇒ Array<(ValidateAddress200Response, Integer, Hash)>

Validate cryptocurrency address

Parameters:

Returns:

  • (Array<(ValidateAddress200Response, Integer, Hash)>)

    ValidateAddress200Response data, response status code and response headers



2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
# File 'lib/mudbase/api/wallet_api.rb', line 2127

def validate_address_with_http_info(validate_address_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WalletApi.validate_address ...'
  end
  # verify the required parameter 'validate_address_request' is set
  if @api_client.config.client_side_validation && validate_address_request.nil?
    fail ArgumentError, "Missing the required parameter 'validate_address_request' when calling WalletApi.validate_address"
  end
  # resource path
  local_var_path = '/api/wallet/validate-address'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(validate_address_request)

  # return_type
  return_type = opts[:debug_return_type] || 'ValidateAddress200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['OrgBearerAuth', 'ProjectBearerAuth']

  new_options = opts.merge(
    :operation => :"WalletApi.validate_address",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: WalletApi#validate_address\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#withdraw(wallet_id, withdraw_request, opts = {}) ⇒ Withdraw200Response

Prepare withdrawal (semi-transaction; broadcast via non-custodial) Semi-transaction: Builds and signs the withdrawal but does not broadcast. Returns signedTx, chain, and fromAddress so the client can broadcast via POST /api/wallet/non-custodial/broadcast. The wallet address must be registered for your organization before broadcasting. Supports all platform chains/currencies (EVM, UTXO, Tron, Solana, USDT on ETH/BSC/TRX/SOL/POLYGON). Use for testing the non-custodial flow: create custodial wallet, get private key, register address, then call withdraw to get signed tx and broadcast it manually.

Parameters:

  • wallet_id (String)
  • withdraw_request (WithdrawRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



2186
2187
2188
2189
# File 'lib/mudbase/api/wallet_api.rb', line 2186

def withdraw(wallet_id, withdraw_request, opts = {})
  data, _status_code, _headers = withdraw_with_http_info(wallet_id, withdraw_request, opts)
  data
end

#withdraw_with_http_info(wallet_id, withdraw_request, opts = {}) ⇒ Array<(Withdraw200Response, Integer, Hash)>

Prepare withdrawal (semi-transaction; broadcast via non-custodial) Semi-transaction: Builds and signs the withdrawal but does not broadcast. Returns `signedTx`, `chain`, and `fromAddress` so the client can broadcast via POST /api/wallet/non-custodial/broadcast. The wallet address must be registered for your organization before broadcasting. Supports all platform chains/currencies (EVM, UTXO, Tron, Solana, USDT on ETH/BSC/TRX/SOL/POLYGON). Use for testing the non-custodial flow: create custodial wallet, get private key, register address, then call withdraw to get signed tx and broadcast it manually.

Parameters:

  • wallet_id (String)
  • withdraw_request (WithdrawRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(Withdraw200Response, Integer, Hash)>)

    Withdraw200Response data, response status code and response headers



2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
# File 'lib/mudbase/api/wallet_api.rb', line 2197

def withdraw_with_http_info(wallet_id, withdraw_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WalletApi.withdraw ...'
  end
  # verify the required parameter 'wallet_id' is set
  if @api_client.config.client_side_validation && wallet_id.nil?
    fail ArgumentError, "Missing the required parameter 'wallet_id' when calling WalletApi.withdraw"
  end
  # verify the required parameter 'withdraw_request' is set
  if @api_client.config.client_side_validation && withdraw_request.nil?
    fail ArgumentError, "Missing the required parameter 'withdraw_request' when calling WalletApi.withdraw"
  end
  # resource path
  local_var_path = '/api/wallet/{walletId}/withdraw'.sub('{' + 'walletId' + '}', CGI.escape(wallet_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(withdraw_request)

  # return_type
  return_type = opts[:debug_return_type] || 'Withdraw200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['OrgBearerAuth', 'ProjectBearerAuth']

  new_options = opts.merge(
    :operation => :"WalletApi.withdraw",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: WalletApi#withdraw\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end