Module: EverSdk::Client
- Defined in:
- lib/ever_sdk_client/client.rb
Defined Under Namespace
Modules: ErrorCode
Classes: AppRequestResult
Constant Summary
collapse
- ResultOfVersion =
KwStruct.new(:version)
- ResultOfGetApiReference =
KwStruct.new(:api)
- BuildInfoDependency =
KwStruct.new(:name, :git_commit) do
def self.from_json(j)
return nil if j.nil?
self.new(name: j["name"], git_commit: j["git_commit"])
end
end
- ResultOfBuildInfo =
KwStruct.new(:build_number, :dependencies)
- ParamsOfAppRequest =
KwStruct.new(:app_request_id, :request_data)
- ParamsOfResolveAppRequest =
KwStruct.new(:app_request_id, :result) do
def to_h
{
app_request_id: app_request_id,
result: result.to_h
}
end
end
Class Method Summary
collapse
Class Method Details
.build_info(ctx) ⇒ Object
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
|
# File 'lib/ever_sdk_client/client.rb', line 152
def self.build_info(ctx)
Interop::request_to_native_lib(ctx, "client.build_info") do |resp|
if resp.success?
dp_s = resp.result["dependencies"].map { |x| BuildInfoDependency.from_json(x) }
yield NativeLibResponseResult.new(
result: ResultOfBuildInfo.new(
build_number: resp.result["build_number"],
dependencies: dp_s
)
)
else
yield resp
end
end
end
|
.config(ctx) ⇒ Object
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
|
# File 'lib/ever_sdk_client/client.rb', line 123
def self.config(ctx)
Interop::request_to_native_lib(ctx, "client.config") do |resp|
if resp.success?
yield NativeLibResponseResult.new(
result: ClientConfig.new(
network: resp.result["network"],
crypto: resp.result["crypto"],
abi: resp.result["abi"],
boc: resp.result["boc"]
)
)
else
yield resp
end
end
end
|
.get_api_reference(ctx) ⇒ Object
.resolve_app_request(ctx, params) ⇒ Object
168
169
170
171
172
173
174
175
176
177
178
|
# File 'lib/ever_sdk_client/client.rb', line 168
def self.resolve_app_request(ctx, params)
Interop::request_to_native_lib(ctx, "client.resolve_app_request", params) do |resp|
if resp.success?
yield NativeLibResponseResult.new(
result: ""
)
else
yield resp
end
end
end
|
.version(ctx) ⇒ Object
params:
ctx
-
ClientContext
object