@inodra/sui 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +202 -0
- package/README.md +237 -0
- package/bin/inodra-sui.mjs +2 -0
- package/dist/chunk-3CBLVI6J.js +426 -0
- package/dist/chunk-3CBLVI6J.js.map +1 -0
- package/dist/chunk-4HKKW5QN.js +80 -0
- package/dist/chunk-4HKKW5QN.js.map +1 -0
- package/dist/chunk-74XGJJJI.js +33 -0
- package/dist/chunk-74XGJJJI.js.map +1 -0
- package/dist/chunk-D6FZYWG7.js +99 -0
- package/dist/chunk-D6FZYWG7.js.map +1 -0
- package/dist/chunk-LZZMTSLH.js +31 -0
- package/dist/chunk-LZZMTSLH.js.map +1 -0
- package/dist/chunk-M3M2L6BW.js +29 -0
- package/dist/chunk-M3M2L6BW.js.map +1 -0
- package/dist/chunk-NSXRC5XW.js +298 -0
- package/dist/chunk-NSXRC5XW.js.map +1 -0
- package/dist/chunk-OGMBYWTG.js +537 -0
- package/dist/chunk-OGMBYWTG.js.map +1 -0
- package/dist/chunk-U6D5LGNF.js +111 -0
- package/dist/chunk-U6D5LGNF.js.map +1 -0
- package/dist/chunk-ZSW3EWGF.js +539 -0
- package/dist/chunk-ZSW3EWGF.js.map +1 -0
- package/dist/cli.js +665 -0
- package/dist/cli.js.map +1 -0
- package/dist/events.cjs +3273 -0
- package/dist/events.cjs.map +1 -0
- package/dist/events.d.cts +47 -0
- package/dist/events.d.ts +47 -0
- package/dist/events.js +2578 -0
- package/dist/events.js.map +1 -0
- package/dist/graphql.cjs +129 -0
- package/dist/graphql.cjs.map +1 -0
- package/dist/graphql.d.cts +36 -0
- package/dist/graphql.d.ts +36 -0
- package/dist/graphql.js +10 -0
- package/dist/graphql.js.map +1 -0
- package/dist/grpc-web.cjs +129 -0
- package/dist/grpc-web.cjs.map +1 -0
- package/dist/grpc-web.d.cts +31 -0
- package/dist/grpc-web.d.ts +31 -0
- package/dist/grpc-web.js +10 -0
- package/dist/grpc-web.js.map +1 -0
- package/dist/grpc.cjs +131 -0
- package/dist/grpc.cjs.map +1 -0
- package/dist/grpc.d.cts +34 -0
- package/dist/grpc.d.ts +34 -0
- package/dist/grpc.js +10 -0
- package/dist/grpc.js.map +1 -0
- package/dist/index-CGBN_EI5.d.ts +4800 -0
- package/dist/index-CVO2Kj8a.d.cts +4800 -0
- package/dist/index.cjs +4723 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +504 -0
- package/dist/index.d.ts +504 -0
- package/dist/index.js +59 -0
- package/dist/index.js.map +1 -0
- package/dist/manage.cjs +376 -0
- package/dist/manage.cjs.map +1 -0
- package/dist/manage.d.cts +2 -0
- package/dist/manage.d.ts +2 -0
- package/dist/manage.js +8 -0
- package/dist/manage.js.map +1 -0
- package/dist/network-CEg2MJY3.d.cts +60 -0
- package/dist/network-CEg2MJY3.d.ts +60 -0
- package/dist/node.cjs +4759 -0
- package/dist/node.cjs.map +1 -0
- package/dist/node.d.cts +28 -0
- package/dist/node.d.ts +28 -0
- package/dist/node.js +73 -0
- package/dist/node.js.map +1 -0
- package/dist/reflection-Bx44-Fs1.d.ts +4639 -0
- package/dist/reflection-Cf7WFH6H.d.cts +4639 -0
- package/dist/reflection-FEGYA7DU.js +9 -0
- package/dist/reflection-FEGYA7DU.js.map +1 -0
- package/dist/runtime-OWKF3LZ7.js +37 -0
- package/dist/runtime-OWKF3LZ7.js.map +1 -0
- package/dist/warp.cjs +633 -0
- package/dist/warp.cjs.map +1 -0
- package/dist/warp.d.cts +195 -0
- package/dist/warp.d.ts +195 -0
- package/dist/warp.js +12 -0
- package/dist/warp.js.map +1 -0
- package/dist/webhooks.cjs +104 -0
- package/dist/webhooks.cjs.map +1 -0
- package/dist/webhooks.d.cts +35 -0
- package/dist/webhooks.d.ts +35 -0
- package/dist/webhooks.js +7 -0
- package/dist/webhooks.js.map +1 -0
- package/llms.txt +189 -0
- package/package.json +119 -0
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
// src/events/runtime.ts
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
var moveSmallUint = z.number();
|
|
4
|
+
var moveUint = z.union([z.string(), z.number()]).transform((value) => String(value));
|
|
5
|
+
var moveBool = z.boolean();
|
|
6
|
+
var moveAddress = z.string();
|
|
7
|
+
var moveString = z.string();
|
|
8
|
+
var moveTypeName = z.union([z.string(), z.looseObject({ name: z.string() })]).transform((value) => typeof value === "string" ? value : value.name);
|
|
9
|
+
var moveBalance = z.union([
|
|
10
|
+
z.string(),
|
|
11
|
+
z.number(),
|
|
12
|
+
z.looseObject({ value: z.union([z.string(), z.number()]) })
|
|
13
|
+
]).transform(
|
|
14
|
+
(value) => typeof value === "object" ? String(value.value) : String(value)
|
|
15
|
+
);
|
|
16
|
+
var moveBytes = z.union([z.string(), z.array(z.number())]);
|
|
17
|
+
var warpEventPayloadSchema = z.looseObject({
|
|
18
|
+
activityType: z.literal("package_event"),
|
|
19
|
+
txDigest: z.string(),
|
|
20
|
+
eventSequence: z.number(),
|
|
21
|
+
checkpoint: z.number(),
|
|
22
|
+
timestamp: z.number(),
|
|
23
|
+
/** Full concrete Move event type. */
|
|
24
|
+
type: z.string(),
|
|
25
|
+
sender: z.string(),
|
|
26
|
+
/** Decoded Move event payload — type with the generated catalog schemas. */
|
|
27
|
+
data: z.unknown()
|
|
28
|
+
});
|
|
29
|
+
var warpAddressPayloadSchema = z.looseObject({
|
|
30
|
+
address: z.string(),
|
|
31
|
+
activityType: z.string(),
|
|
32
|
+
txDigest: z.string(),
|
|
33
|
+
checkpoint: z.number(),
|
|
34
|
+
timestamp: z.number(),
|
|
35
|
+
objectId: z.string().optional(),
|
|
36
|
+
objectType: z.string().optional()
|
|
37
|
+
});
|
|
38
|
+
var warpCoinPayloadSchema = z.looseObject({
|
|
39
|
+
activityType: z.literal("balance_change"),
|
|
40
|
+
address: z.string(),
|
|
41
|
+
coin_type: z.string(),
|
|
42
|
+
/** Signed amount, string for precision. */
|
|
43
|
+
amount: z.string(),
|
|
44
|
+
txDigest: z.string(),
|
|
45
|
+
checkpoint: z.number(),
|
|
46
|
+
timestamp: z.number()
|
|
47
|
+
});
|
|
48
|
+
var warpObjectPayloadSchema = z.looseObject({
|
|
49
|
+
activityType: z.literal("object_change"),
|
|
50
|
+
object_id: z.string(),
|
|
51
|
+
transactionDirection: z.string(),
|
|
52
|
+
writeKind: z.string(),
|
|
53
|
+
owner: z.string().optional(),
|
|
54
|
+
previousOwner: z.string().optional(),
|
|
55
|
+
txDigest: z.string(),
|
|
56
|
+
checkpoint: z.number(),
|
|
57
|
+
timestamp: z.number()
|
|
58
|
+
});
|
|
59
|
+
var webhookEventBodySchema = z.looseObject({
|
|
60
|
+
payloadVersion: z.number(),
|
|
61
|
+
payload: warpEventPayloadSchema.extend({ webhookId: z.string() })
|
|
62
|
+
});
|
|
63
|
+
function baseEventType(eventType) {
|
|
64
|
+
const idx = eventType.indexOf("<");
|
|
65
|
+
return idx === -1 ? eventType : eventType.slice(0, idx);
|
|
66
|
+
}
|
|
67
|
+
function innerEventType(eventType) {
|
|
68
|
+
const start = eventType.indexOf("<");
|
|
69
|
+
if (start === -1 || !eventType.endsWith(">")) {
|
|
70
|
+
return void 0;
|
|
71
|
+
}
|
|
72
|
+
return eventType.slice(start + 1, -1);
|
|
73
|
+
}
|
|
74
|
+
function eventTypeMatches(rawEventType, deployment, generic) {
|
|
75
|
+
if (generic) {
|
|
76
|
+
return baseEventType(rawEventType) === deployment.eventType;
|
|
77
|
+
}
|
|
78
|
+
return rawEventType === deployment.eventType;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export {
|
|
82
|
+
moveSmallUint,
|
|
83
|
+
moveUint,
|
|
84
|
+
moveBool,
|
|
85
|
+
moveAddress,
|
|
86
|
+
moveString,
|
|
87
|
+
moveTypeName,
|
|
88
|
+
moveBalance,
|
|
89
|
+
moveBytes,
|
|
90
|
+
warpEventPayloadSchema,
|
|
91
|
+
warpAddressPayloadSchema,
|
|
92
|
+
warpCoinPayloadSchema,
|
|
93
|
+
warpObjectPayloadSchema,
|
|
94
|
+
webhookEventBodySchema,
|
|
95
|
+
baseEventType,
|
|
96
|
+
innerEventType,
|
|
97
|
+
eventTypeMatches
|
|
98
|
+
};
|
|
99
|
+
//# sourceMappingURL=chunk-D6FZYWG7.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/events/runtime.ts"],"sourcesContent":["/**\n * Runtime pieces shared by the generated event schemas (`src/generated/events.ts`)\n * and the typed-event helpers: Move-primitive zod schemas and the Warp/webhook\n * delivery envelopes.\n *\n * Encoding notes — decoded Move event JSON as delivered by Inodra:\n * - u8/u16/u32 arrive as JSON numbers; u64/u128/u256 as strings (precision).\n * Some decode paths emit small u64s as numbers, so unsigned ints accept both\n * and normalize to string.\n * - `Option<T>` flattens to `T | null`.\n * - `TypeName` may arrive as `{ name: string }` or a bare string; normalized\n * to string.\n * - `Balance<T>` may arrive as `{ value: string }` or a bare string;\n * normalized to its value string.\n * - `vector<u8>` may arrive as a byte array or a base64/hex string.\n * All object schemas are loose: protocols add fields in package upgrades and\n * unknown keys must never make a consumer pipeline throw.\n */\nimport { z } from \"zod\";\n\n// ---------------------------------------------------------------------------\n// Move primitive schemas\n// ---------------------------------------------------------------------------\n\n/** u8 / u16 / u32 — safe as JSON numbers. */\nexport const moveSmallUint = z.number();\n\n/** u64 / u128 / u256 — normalized to decimal string. */\nexport const moveUint = z\n\t.union([z.string(), z.number()])\n\t.transform((value) => String(value));\n\nexport const moveBool = z.boolean();\n\n/** address / 0x2::object::ID — 0x-prefixed hex string. */\nexport const moveAddress = z.string();\n\n/** 0x1::string::String / 0x1::ascii::String */\nexport const moveString = z.string();\n\n/** 0x1::type_name::TypeName — normalized to the type string. */\nexport const moveTypeName = z\n\t.union([z.string(), z.looseObject({ name: z.string() })])\n\t.transform((value) => (typeof value === \"string\" ? value : value.name));\n\n/** 0x2::balance::Balance<T> — normalized to its u64 value string. */\nexport const moveBalance = z\n\t.union([\n\t\tz.string(),\n\t\tz.number(),\n\t\tz.looseObject({ value: z.union([z.string(), z.number()]) }),\n\t])\n\t.transform((value) =>\n\t\ttypeof value === \"object\" ? String(value.value) : String(value),\n\t);\n\n/** vector<u8> — byte array or base64/hex string, left as received. */\nexport const moveBytes = z.union([z.string(), z.array(z.number())]);\n\n// ---------------------------------------------------------------------------\n// Delivery envelopes (Warp SSE/WS + webhooks)\n// ---------------------------------------------------------------------------\n\n/** Move package event as delivered on Warp streams (`type: \"event\"`). */\nexport const warpEventPayloadSchema = z.looseObject({\n\tactivityType: z.literal(\"package_event\"),\n\ttxDigest: z.string(),\n\teventSequence: z.number(),\n\tcheckpoint: z.number(),\n\ttimestamp: z.number(),\n\t/** Full concrete Move event type. */\n\ttype: z.string(),\n\tsender: z.string(),\n\t/** Decoded Move event payload — type with the generated catalog schemas. */\n\tdata: z.unknown(),\n});\nexport type WarpEventPayload = z.infer<typeof warpEventPayloadSchema>;\n\n/** Address activity as delivered on Warp streams (`type: \"address\"`). */\nexport const warpAddressPayloadSchema = z.looseObject({\n\taddress: z.string(),\n\tactivityType: z.string(),\n\ttxDigest: z.string(),\n\tcheckpoint: z.number(),\n\ttimestamp: z.number(),\n\tobjectId: z.string().optional(),\n\tobjectType: z.string().optional(),\n});\nexport type WarpAddressPayload = z.infer<typeof warpAddressPayloadSchema>;\n\n/** Coin/balance change as delivered on Warp streams (`type: \"coin\"`). */\nexport const warpCoinPayloadSchema = z.looseObject({\n\tactivityType: z.literal(\"balance_change\"),\n\taddress: z.string(),\n\tcoin_type: z.string(),\n\t/** Signed amount, string for precision. */\n\tamount: z.string(),\n\ttxDigest: z.string(),\n\tcheckpoint: z.number(),\n\ttimestamp: z.number(),\n});\nexport type WarpCoinPayload = z.infer<typeof warpCoinPayloadSchema>;\n\n/** Object change as delivered on Warp streams (`type: \"object\"`). */\nexport const warpObjectPayloadSchema = z.looseObject({\n\tactivityType: z.literal(\"object_change\"),\n\tobject_id: z.string(),\n\ttransactionDirection: z.string(),\n\twriteKind: z.string(),\n\towner: z.string().optional(),\n\tpreviousOwner: z.string().optional(),\n\ttxDigest: z.string(),\n\tcheckpoint: z.number(),\n\ttimestamp: z.number(),\n});\nexport type WarpObjectPayload = z.infer<typeof warpObjectPayloadSchema>;\n\n/**\n * Webhook delivery body for event webhooks:\n * `{ payloadVersion: 1, payload: { webhookId, ...warp event payload } }`.\n */\nexport const webhookEventBodySchema = z.looseObject({\n\tpayloadVersion: z.number(),\n\tpayload: warpEventPayloadSchema.extend({ webhookId: z.string() }),\n});\nexport type WebhookEventBody = z.infer<typeof webhookEventBodySchema>;\n\n// ---------------------------------------------------------------------------\n// Event-type matching (mirrors the server's catalog matching)\n// ---------------------------------------------------------------------------\n\n/** Strip generic parameters: `a::b::C<...>` → `a::b::C`. */\nexport function baseEventType(eventType: string): string {\n\tconst idx = eventType.indexOf(\"<\");\n\treturn idx === -1 ? eventType : eventType.slice(0, idx);\n}\n\n/** Extract the inner type of a wrapped event: `Outer<Inner>` → `Inner`. */\nexport function innerEventType(eventType: string): string | undefined {\n\tconst start = eventType.indexOf(\"<\");\n\tif (start === -1 || !eventType.endsWith(\">\")) {\n\t\treturn undefined;\n\t}\n\treturn eventType.slice(start + 1, -1);\n}\n\n/** A concrete on-chain deployment of a catalog event. */\nexport interface CatalogDeployment {\n\tnetwork: string;\n\t/** Canonical event type (base form for generic events). */\n\teventType: string;\n\tprimary?: boolean;\n}\n\n/**\n * Whether a raw on-chain event type string matches a deployment.\n * Generic events are cataloged in base form and matched by base type;\n * everything else (including wrapped `Outer<Inner>` events) matches exactly.\n */\nexport function eventTypeMatches(\n\trawEventType: string,\n\tdeployment: CatalogDeployment,\n\tgeneric: boolean,\n): boolean {\n\tif (generic) {\n\t\treturn baseEventType(rawEventType) === deployment.eventType;\n\t}\n\treturn rawEventType === deployment.eventType;\n}\n"],"mappings":";AAkBA,SAAS,SAAS;AAOX,IAAM,gBAAgB,EAAE,OAAO;AAG/B,IAAM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ACA,SACU;AACV,MAAI,SAAS;AACZ,WAAO,cAAc,YAAY,MAAM,WAAW;AAAA,EACnD;AACA,SAAO,iBAAiB,WAAW;AACpC;","names":[]}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import {
|
|
2
|
+
SDK_HEADER_NAME,
|
|
3
|
+
SDK_HEADER_VALUE,
|
|
4
|
+
grpcHost,
|
|
5
|
+
staticAuthHeaders
|
|
6
|
+
} from "./chunk-U6D5LGNF.js";
|
|
7
|
+
|
|
8
|
+
// src/grpc/index.ts
|
|
9
|
+
import { ChannelCredentials } from "@grpc/grpc-js";
|
|
10
|
+
import { SuiGrpcClient } from "@mysten/sui/grpc";
|
|
11
|
+
import { GrpcTransport } from "@protobuf-ts/grpc-transport";
|
|
12
|
+
import { SuiGrpcClient as SuiGrpcClient2 } from "@mysten/sui/grpc";
|
|
13
|
+
function createInodraGrpcClient(options) {
|
|
14
|
+
const network = options.network ?? "mainnet";
|
|
15
|
+
const transport = new GrpcTransport({
|
|
16
|
+
host: options.host ?? grpcHost(network),
|
|
17
|
+
channelCredentials: options.channelCredentials ?? ChannelCredentials.createSsl(),
|
|
18
|
+
meta: {
|
|
19
|
+
...staticAuthHeaders(options, "createInodraGrpcClient"),
|
|
20
|
+
[SDK_HEADER_NAME]: SDK_HEADER_VALUE,
|
|
21
|
+
...options.metadata
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
return new SuiGrpcClient({ network, transport });
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export {
|
|
28
|
+
createInodraGrpcClient,
|
|
29
|
+
SuiGrpcClient2 as SuiGrpcClient
|
|
30
|
+
};
|
|
31
|
+
//# sourceMappingURL=chunk-LZZMTSLH.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/grpc/index.ts"],"sourcesContent":["import { ChannelCredentials } from \"@grpc/grpc-js\";\nimport { SuiGrpcClient } from \"@mysten/sui/grpc\";\nimport { GrpcTransport } from \"@protobuf-ts/grpc-transport\";\nimport { type InodraAuth, staticAuthHeaders } from \"../core/auth.js\";\nimport { grpcHost, type InodraNetwork } from \"../core/network.js\";\nimport { SDK_HEADER_NAME, SDK_HEADER_VALUE } from \"../core/version.js\";\n\nexport interface InodraGrpcClientOptions {\n\t/** Credentials: an API key string, {apiKey}, or {sessionToken}. */\n\tauth?: InodraAuth;\n\t/** Shorthand for `auth: { apiKey }`. */\n\tapiKey?: string;\n\t/** Defaults to \"mainnet\". */\n\tnetwork?: InodraNetwork;\n\t/** Overrides the network-derived host:port (e.g. localhost:50051). */\n\thost?: string;\n\t/** Defaults to TLS. Pass ChannelCredentials.createInsecure() for local dev. */\n\tchannelCredentials?: ChannelCredentials;\n\t/** Extra metadata sent with every call. */\n\tmetadata?: Record<string, string>;\n}\n\n/**\n * Native gRPC client for Inodra (Node.js only — uses HTTP/2 via @grpc/grpc-js).\n * For browsers, use `@inodra/sui/grpc-web` instead.\n *\n * Returns a fully featured `SuiGrpcClient` from @mysten/sui, authenticated\n * against Inodra's gRPC gateway.\n *\n * ```ts\n * const client = createInodraGrpcClient({ apiKey });\n * const tx = await client.getTransaction({ digest: \"...\" });\n * ```\n */\nexport function createInodraGrpcClient(\n\toptions: InodraGrpcClientOptions,\n): SuiGrpcClient {\n\tconst network = options.network ?? \"mainnet\";\n\tconst transport = new GrpcTransport({\n\t\thost: options.host ?? grpcHost(network),\n\t\tchannelCredentials: options.channelCredentials ?? ChannelCredentials.createSsl(),\n\t\tmeta: {\n\t\t\t...staticAuthHeaders(options, \"createInodraGrpcClient\"),\n\t\t\t[SDK_HEADER_NAME]: SDK_HEADER_VALUE,\n\t\t\t...options.metadata,\n\t\t},\n\t});\n\treturn new SuiGrpcClient({ network, transport });\n}\n\nexport { SuiGrpcClient } from \"@mysten/sui/grpc\";\n"],"mappings":";;;;;;;;AAAA,SAAS,0BAA0B;AACnC,SAAS,qBAAqB;AAC9B,SAAS,qBAAqB;AAgD9B,SAAS,iBAAAA,sBAAqB;AAhBvB,SAAS,uBACf,SACgB;AAChB,QAAM,UAAU,QAAQ,WAAW;AACnC,QAAM,YAAY,IAAI,cAAc;AAAA,IACnC,MAAM,QAAQ,QAAQ,SAAS,OAAO;AAAA,IACtC,oBAAoB,QAAQ,sBAAsB,mBAAmB,UAAU;AAAA,IAC/E,MAAM;AAAA,MACL,GAAG,kBAAkB,SAAS,wBAAwB;AAAA,MACtD,CAAC,eAAe,GAAG;AAAA,MACnB,GAAG,QAAQ;AAAA,IACZ;AAAA,EACD,CAAC;AACD,SAAO,IAAI,cAAc,EAAE,SAAS,UAAU,CAAC;AAChD;","names":["SuiGrpcClient"]}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import {
|
|
2
|
+
SDK_HEADER_NAME,
|
|
3
|
+
SDK_HEADER_VALUE,
|
|
4
|
+
grpcBaseUrl,
|
|
5
|
+
staticAuthHeaders
|
|
6
|
+
} from "./chunk-U6D5LGNF.js";
|
|
7
|
+
|
|
8
|
+
// src/grpc-web/index.ts
|
|
9
|
+
import { SuiGrpcClient } from "@mysten/sui/grpc";
|
|
10
|
+
import { GrpcWebFetchTransport } from "@protobuf-ts/grpcweb-transport";
|
|
11
|
+
import { SuiGrpcClient as SuiGrpcClient2 } from "@mysten/sui/grpc";
|
|
12
|
+
function createInodraGrpcWebClient(options) {
|
|
13
|
+
const network = options.network ?? "mainnet";
|
|
14
|
+
const transport = new GrpcWebFetchTransport({
|
|
15
|
+
baseUrl: options.baseUrl ?? grpcBaseUrl(network),
|
|
16
|
+
meta: {
|
|
17
|
+
...staticAuthHeaders(options, "createInodraGrpcWebClient"),
|
|
18
|
+
[SDK_HEADER_NAME]: SDK_HEADER_VALUE,
|
|
19
|
+
...options.metadata
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
return new SuiGrpcClient({ network, transport });
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export {
|
|
26
|
+
createInodraGrpcWebClient,
|
|
27
|
+
SuiGrpcClient2 as SuiGrpcClient
|
|
28
|
+
};
|
|
29
|
+
//# sourceMappingURL=chunk-M3M2L6BW.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/grpc-web/index.ts"],"sourcesContent":["import { SuiGrpcClient } from \"@mysten/sui/grpc\";\nimport { GrpcWebFetchTransport } from \"@protobuf-ts/grpcweb-transport\";\nimport { type InodraAuth, staticAuthHeaders } from \"../core/auth.js\";\nimport { grpcBaseUrl, type InodraNetwork } from \"../core/network.js\";\nimport { SDK_HEADER_NAME, SDK_HEADER_VALUE } from \"../core/version.js\";\n\nexport interface InodraGrpcWebClientOptions {\n\t/** Credentials: an API key string, {apiKey}, or {sessionToken}. */\n\tauth?: InodraAuth;\n\t/** Shorthand for `auth: { apiKey }`. */\n\tapiKey?: string;\n\t/** Defaults to \"mainnet\". */\n\tnetwork?: InodraNetwork;\n\t/** Overrides the network-derived base URL. */\n\tbaseUrl?: string;\n\t/** Extra metadata sent with every call. */\n\tmetadata?: Record<string, string>;\n}\n\n/**\n * gRPC-Web client for Inodra — works in browsers and any fetch-capable\n * runtime. For Node.js backends, prefer `@inodra/sui/grpc` (native HTTP/2).\n *\n * Returns a fully featured `SuiGrpcClient` from @mysten/sui, authenticated\n * against Inodra's gRPC gateway.\n *\n * ```ts\n * const client = createInodraGrpcWebClient({ apiKey });\n * const checkpoint = await client.core.getCheckpoint({ sequenceNumber });\n * ```\n */\nexport function createInodraGrpcWebClient(\n\toptions: InodraGrpcWebClientOptions,\n): SuiGrpcClient {\n\tconst network = options.network ?? \"mainnet\";\n\t// SuiGrpcClient's built-in gRPC-Web mode drops the `meta` option, so the\n\t// transport (which honors it on every call) is constructed explicitly.\n\tconst transport = new GrpcWebFetchTransport({\n\t\tbaseUrl: options.baseUrl ?? grpcBaseUrl(network),\n\t\tmeta: {\n\t\t\t...staticAuthHeaders(options, \"createInodraGrpcWebClient\"),\n\t\t\t[SDK_HEADER_NAME]: SDK_HEADER_VALUE,\n\t\t\t...options.metadata,\n\t\t},\n\t});\n\treturn new SuiGrpcClient({ network, transport });\n}\n\nexport { SuiGrpcClient } from \"@mysten/sui/grpc\";\n"],"mappings":";;;;;;;;AAAA,SAAS,qBAAqB;AAC9B,SAAS,6BAA6B;AA+CtC,SAAS,iBAAAA,sBAAqB;AAjBvB,SAAS,0BACf,SACgB;AAChB,QAAM,UAAU,QAAQ,WAAW;AAGnC,QAAM,YAAY,IAAI,sBAAsB;AAAA,IAC3C,SAAS,QAAQ,WAAW,YAAY,OAAO;AAAA,IAC/C,MAAM;AAAA,MACL,GAAG,kBAAkB,SAAS,2BAA2B;AAAA,MACzD,CAAC,eAAe,GAAG;AAAA,MACnB,GAAG,QAAQ;AAAA,IACZ;AAAA,EACD,CAAC;AACD,SAAO,IAAI,cAAc,EAAE,SAAS,UAAU,CAAC;AAChD;","names":["SuiGrpcClient"]}
|
|
@@ -0,0 +1,298 @@
|
|
|
1
|
+
import {
|
|
2
|
+
SDK_HEADER_NAME,
|
|
3
|
+
SDK_HEADER_VALUE,
|
|
4
|
+
authFromOptions,
|
|
5
|
+
restBaseUrl
|
|
6
|
+
} from "./chunk-U6D5LGNF.js";
|
|
7
|
+
|
|
8
|
+
// src/core/errors.ts
|
|
9
|
+
var InodraError = class extends Error {
|
|
10
|
+
status;
|
|
11
|
+
requestId;
|
|
12
|
+
body;
|
|
13
|
+
/** Stable machine-readable error code from the API (e.g. "QUOTA_EXCEEDED"). */
|
|
14
|
+
code;
|
|
15
|
+
constructor(message, options) {
|
|
16
|
+
super(message);
|
|
17
|
+
this.name = "InodraError";
|
|
18
|
+
this.status = options.status;
|
|
19
|
+
this.requestId = options.requestId;
|
|
20
|
+
this.body = options.body;
|
|
21
|
+
this.code = options.code;
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
var InodraAuthenticationError = class extends InodraError {
|
|
25
|
+
constructor(options) {
|
|
26
|
+
super(
|
|
27
|
+
options.message ?? (options.status === 403 ? "Forbidden \u2014 the API key is valid but not allowed to do this" : "Invalid or missing API key"),
|
|
28
|
+
options
|
|
29
|
+
);
|
|
30
|
+
this.name = "InodraAuthenticationError";
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
var InodraRateLimitError = class extends InodraError {
|
|
34
|
+
retryAfterSeconds;
|
|
35
|
+
constructor(options) {
|
|
36
|
+
super(options.message ?? "Rate limit exceeded", options);
|
|
37
|
+
this.name = "InodraRateLimitError";
|
|
38
|
+
this.retryAfterSeconds = options.retryAfterSeconds;
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
var InodraTimeoutError = class extends Error {
|
|
42
|
+
constructor(timeoutMs) {
|
|
43
|
+
super(`Request timed out after ${timeoutMs}ms`);
|
|
44
|
+
this.name = "InodraTimeoutError";
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
var InodraWebhookSignatureError = class extends Error {
|
|
48
|
+
constructor() {
|
|
49
|
+
super("Webhook signature verification failed (bad, missing, or expired)");
|
|
50
|
+
this.name = "InodraWebhookSignatureError";
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
// src/core/http.ts
|
|
55
|
+
var InodraHttpClient = class {
|
|
56
|
+
baseUrl;
|
|
57
|
+
/** Rate-limit/credit info from the most recent response, if any. */
|
|
58
|
+
lastResponseMeta;
|
|
59
|
+
auth;
|
|
60
|
+
maxRetries;
|
|
61
|
+
timeoutMs;
|
|
62
|
+
fetchImpl;
|
|
63
|
+
onResponseMeta;
|
|
64
|
+
constructor(options) {
|
|
65
|
+
this.auth = authFromOptions(options, "InodraHttpClient");
|
|
66
|
+
this.baseUrl = (options.baseUrl ?? restBaseUrl(options.network ?? "mainnet")).replace(/\/$/, "");
|
|
67
|
+
this.maxRetries = options.maxRetries ?? 2;
|
|
68
|
+
this.timeoutMs = options.timeoutMs ?? 3e4;
|
|
69
|
+
this.fetchImpl = options.fetch ?? globalThis.fetch;
|
|
70
|
+
this.onResponseMeta = options.onResponseMeta;
|
|
71
|
+
}
|
|
72
|
+
async request(method, path, options = {}) {
|
|
73
|
+
const url = new URL(this.baseUrl + path);
|
|
74
|
+
for (const [key, value] of Object.entries(options.query ?? {})) {
|
|
75
|
+
if (value !== void 0) {
|
|
76
|
+
url.searchParams.set(key, String(value));
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
const retryOn5xx = options.idempotent ?? !(method === "POST" || method === "PATCH");
|
|
80
|
+
let attempt = 0;
|
|
81
|
+
for (; ; ) {
|
|
82
|
+
const response = await this.send(url, method, options);
|
|
83
|
+
this.captureMeta(response);
|
|
84
|
+
if (response.ok) {
|
|
85
|
+
if (response.status === 204) {
|
|
86
|
+
return void 0;
|
|
87
|
+
}
|
|
88
|
+
return await response.json();
|
|
89
|
+
}
|
|
90
|
+
const retryable = response.status === 429 || retryOn5xx && response.status >= 500;
|
|
91
|
+
if (retryable && attempt < this.maxRetries) {
|
|
92
|
+
attempt += 1;
|
|
93
|
+
await sleep(retryDelayMs(response, attempt));
|
|
94
|
+
continue;
|
|
95
|
+
}
|
|
96
|
+
throw await toError(response);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
async send(url, method, options) {
|
|
100
|
+
const timeoutSignal = AbortSignal.timeout(this.timeoutMs);
|
|
101
|
+
const signal = options.signal ? AbortSignal.any([options.signal, timeoutSignal]) : timeoutSignal;
|
|
102
|
+
const { headers: authHeaders } = await this.auth.credentials();
|
|
103
|
+
try {
|
|
104
|
+
return await this.fetchImpl(url, {
|
|
105
|
+
method,
|
|
106
|
+
headers: {
|
|
107
|
+
...authHeaders,
|
|
108
|
+
[SDK_HEADER_NAME]: SDK_HEADER_VALUE,
|
|
109
|
+
"content-type": "application/json",
|
|
110
|
+
accept: "application/json"
|
|
111
|
+
},
|
|
112
|
+
body: options.body === void 0 ? void 0 : JSON.stringify(options.body),
|
|
113
|
+
signal
|
|
114
|
+
});
|
|
115
|
+
} catch (error) {
|
|
116
|
+
if (timeoutSignal.aborted && !options.signal?.aborted) {
|
|
117
|
+
throw new InodraTimeoutError(this.timeoutMs);
|
|
118
|
+
}
|
|
119
|
+
throw error;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
captureMeta(response) {
|
|
123
|
+
const meta = parseResponseMeta(response);
|
|
124
|
+
if (meta) {
|
|
125
|
+
this.lastResponseMeta = meta;
|
|
126
|
+
this.onResponseMeta?.(meta);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
};
|
|
130
|
+
function parseResponseMeta(response) {
|
|
131
|
+
const meta = {};
|
|
132
|
+
const limit = header(response, "x-ratelimit-limit");
|
|
133
|
+
const remaining = header(response, "x-ratelimit-remaining");
|
|
134
|
+
const reset = header(response, "x-ratelimit-reset");
|
|
135
|
+
if (limit !== void 0 && remaining !== void 0) {
|
|
136
|
+
meta.rateLimit = {
|
|
137
|
+
limit,
|
|
138
|
+
remaining,
|
|
139
|
+
reset: reset ?? 0,
|
|
140
|
+
throttled: response.headers.get("x-ratelimit-throttle") !== null
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
const creditRemaining = header(response, "x-inodra-credit-remaining");
|
|
144
|
+
const creditLimit = header(response, "x-inodra-credit-limit");
|
|
145
|
+
if (creditRemaining !== void 0 && creditLimit !== void 0) {
|
|
146
|
+
meta.credits = {
|
|
147
|
+
remaining: creditRemaining,
|
|
148
|
+
limit: creditLimit,
|
|
149
|
+
replenishDate: response.headers.get("x-inodra-credit-replenish-date") ?? void 0,
|
|
150
|
+
degraded: response.headers.get("x-inodra-credit-degraded") === "true"
|
|
151
|
+
};
|
|
152
|
+
}
|
|
153
|
+
const requestId = response.headers.get("x-request-id");
|
|
154
|
+
if (requestId) {
|
|
155
|
+
meta.requestId = requestId;
|
|
156
|
+
}
|
|
157
|
+
if (!meta.rateLimit && !meta.credits && !meta.requestId) {
|
|
158
|
+
return void 0;
|
|
159
|
+
}
|
|
160
|
+
return meta;
|
|
161
|
+
}
|
|
162
|
+
function header(response, name) {
|
|
163
|
+
const raw = response.headers.get(name);
|
|
164
|
+
if (raw === null) {
|
|
165
|
+
return void 0;
|
|
166
|
+
}
|
|
167
|
+
const value = Number(raw);
|
|
168
|
+
return Number.isFinite(value) ? value : void 0;
|
|
169
|
+
}
|
|
170
|
+
async function toError(response) {
|
|
171
|
+
const requestId = response.headers.get("x-request-id") ?? void 0;
|
|
172
|
+
let body;
|
|
173
|
+
try {
|
|
174
|
+
body = await response.json();
|
|
175
|
+
} catch {
|
|
176
|
+
body = void 0;
|
|
177
|
+
}
|
|
178
|
+
const serverMessage = extractField(body, ["message", "error"]);
|
|
179
|
+
const code = extractField(body, ["code"]);
|
|
180
|
+
if (response.status === 401 || response.status === 403) {
|
|
181
|
+
return new InodraAuthenticationError({
|
|
182
|
+
status: response.status,
|
|
183
|
+
requestId,
|
|
184
|
+
body,
|
|
185
|
+
code,
|
|
186
|
+
message: serverMessage
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
if (response.status === 429) {
|
|
190
|
+
const retryAfter = response.headers.get("retry-after");
|
|
191
|
+
return new InodraRateLimitError({
|
|
192
|
+
status: response.status,
|
|
193
|
+
requestId,
|
|
194
|
+
body,
|
|
195
|
+
code,
|
|
196
|
+
retryAfterSeconds: retryAfter ? Number(retryAfter) : void 0,
|
|
197
|
+
message: serverMessage
|
|
198
|
+
});
|
|
199
|
+
}
|
|
200
|
+
return new InodraError(
|
|
201
|
+
serverMessage ?? `Request failed with status ${response.status}`,
|
|
202
|
+
{ status: response.status, requestId, body, code }
|
|
203
|
+
);
|
|
204
|
+
}
|
|
205
|
+
function extractField(body, keys) {
|
|
206
|
+
if (typeof body !== "object" || body === null) {
|
|
207
|
+
return void 0;
|
|
208
|
+
}
|
|
209
|
+
for (const key of keys) {
|
|
210
|
+
const value = body[key];
|
|
211
|
+
if (typeof value === "string" && value.length > 0) {
|
|
212
|
+
return value;
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
return void 0;
|
|
216
|
+
}
|
|
217
|
+
function retryDelayMs(response, attempt) {
|
|
218
|
+
const retryAfter = response.headers.get("retry-after");
|
|
219
|
+
if (retryAfter) {
|
|
220
|
+
const seconds = Number(retryAfter);
|
|
221
|
+
if (Number.isFinite(seconds)) {
|
|
222
|
+
return seconds * 1e3;
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
return 250 * 2 ** (attempt - 1) + Math.random() * 100;
|
|
226
|
+
}
|
|
227
|
+
function sleep(ms) {
|
|
228
|
+
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
// src/manage/index.ts
|
|
232
|
+
var InodraManagementClient = class {
|
|
233
|
+
http;
|
|
234
|
+
constructor(options) {
|
|
235
|
+
this.http = new InodraHttpClient(options);
|
|
236
|
+
}
|
|
237
|
+
webhooks = {
|
|
238
|
+
createEvent: (input) => this.http.request("POST", "/webhooks/events", {
|
|
239
|
+
body: input
|
|
240
|
+
}),
|
|
241
|
+
createAddress: (input) => this.http.request("POST", "/webhooks/addresses", {
|
|
242
|
+
body: input
|
|
243
|
+
}),
|
|
244
|
+
createCoin: (input) => this.http.request("POST", "/webhooks/coins", {
|
|
245
|
+
body: input
|
|
246
|
+
}),
|
|
247
|
+
createObject: (input) => this.http.request("POST", "/webhooks/objects", {
|
|
248
|
+
body: input
|
|
249
|
+
}),
|
|
250
|
+
list: () => this.http.request("GET", "/webhooks"),
|
|
251
|
+
get: (id) => this.http.request("GET", `/webhooks/${encodeURIComponent(id)}`),
|
|
252
|
+
update: (id, input) => this.http.request(
|
|
253
|
+
"PUT",
|
|
254
|
+
`/webhooks/${encodeURIComponent(id)}`,
|
|
255
|
+
{ body: input }
|
|
256
|
+
),
|
|
257
|
+
delete: (id) => this.http.request(
|
|
258
|
+
"DELETE",
|
|
259
|
+
`/webhooks/${encodeURIComponent(id)}`
|
|
260
|
+
)
|
|
261
|
+
};
|
|
262
|
+
warp = {
|
|
263
|
+
createEventStream: (input) => this.http.request("POST", "/warp/events", {
|
|
264
|
+
body: input
|
|
265
|
+
}),
|
|
266
|
+
createAddressStream: (input) => this.http.request("POST", "/warp/addresses", {
|
|
267
|
+
body: input
|
|
268
|
+
}),
|
|
269
|
+
createCoinStream: (input) => this.http.request("POST", "/warp/coins", {
|
|
270
|
+
body: input
|
|
271
|
+
}),
|
|
272
|
+
createObjectStream: (input) => this.http.request("POST", "/warp/objects", {
|
|
273
|
+
body: input
|
|
274
|
+
}),
|
|
275
|
+
list: () => this.http.request("GET", "/warp"),
|
|
276
|
+
get: (id) => this.http.request("GET", `/warp/${encodeURIComponent(id)}`),
|
|
277
|
+
update: (id, input) => this.http.request(
|
|
278
|
+
"PUT",
|
|
279
|
+
`/warp/${encodeURIComponent(id)}`,
|
|
280
|
+
{ body: input }
|
|
281
|
+
),
|
|
282
|
+
delete: (id) => this.http.request(
|
|
283
|
+
"DELETE",
|
|
284
|
+
`/warp/${encodeURIComponent(id)}`
|
|
285
|
+
)
|
|
286
|
+
};
|
|
287
|
+
};
|
|
288
|
+
|
|
289
|
+
export {
|
|
290
|
+
InodraError,
|
|
291
|
+
InodraAuthenticationError,
|
|
292
|
+
InodraRateLimitError,
|
|
293
|
+
InodraTimeoutError,
|
|
294
|
+
InodraWebhookSignatureError,
|
|
295
|
+
InodraHttpClient,
|
|
296
|
+
InodraManagementClient
|
|
297
|
+
};
|
|
298
|
+
//# sourceMappingURL=chunk-NSXRC5XW.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/core/errors.ts","../src/core/http.ts","../src/manage/index.ts"],"sourcesContent":["export class InodraError extends Error {\n\treadonly status: number;\n\treadonly requestId?: string;\n\treadonly body?: unknown;\n\t/** Stable machine-readable error code from the API (e.g. \"QUOTA_EXCEEDED\"). */\n\treadonly code?: string;\n\n\tconstructor(\n\t\tmessage: string,\n\t\toptions: {\n\t\t\tstatus: number;\n\t\t\trequestId?: string;\n\t\t\tbody?: unknown;\n\t\t\tcode?: string;\n\t\t},\n\t) {\n\t\tsuper(message);\n\t\tthis.name = \"InodraError\";\n\t\tthis.status = options.status;\n\t\tthis.requestId = options.requestId;\n\t\tthis.body = options.body;\n\t\tthis.code = options.code;\n\t}\n}\n\nexport class InodraAuthenticationError extends InodraError {\n\tconstructor(options: {\n\t\tstatus: number;\n\t\trequestId?: string;\n\t\tbody?: unknown;\n\t\tcode?: string;\n\t\tmessage?: string;\n\t}) {\n\t\tsuper(\n\t\t\toptions.message ??\n\t\t\t\t(options.status === 403\n\t\t\t\t\t? \"Forbidden — the API key is valid but not allowed to do this\"\n\t\t\t\t\t: \"Invalid or missing API key\"),\n\t\t\toptions,\n\t\t);\n\t\tthis.name = \"InodraAuthenticationError\";\n\t}\n}\n\nexport class InodraRateLimitError extends InodraError {\n\treadonly retryAfterSeconds?: number;\n\n\tconstructor(options: {\n\t\tstatus: number;\n\t\trequestId?: string;\n\t\tbody?: unknown;\n\t\tcode?: string;\n\t\tretryAfterSeconds?: number;\n\t\tmessage?: string;\n\t}) {\n\t\tsuper(options.message ?? \"Rate limit exceeded\", options);\n\t\tthis.name = \"InodraRateLimitError\";\n\t\tthis.retryAfterSeconds = options.retryAfterSeconds;\n\t}\n}\n\nexport class InodraTimeoutError extends Error {\n\tconstructor(timeoutMs: number) {\n\t\tsuper(`Request timed out after ${timeoutMs}ms`);\n\t\tthis.name = \"InodraTimeoutError\";\n\t}\n}\n\nexport class InodraWebhookSignatureError extends Error {\n\tconstructor() {\n\t\tsuper(\"Webhook signature verification failed (bad, missing, or expired)\");\n\t\tthis.name = \"InodraWebhookSignatureError\";\n\t}\n}\n","import {\n\tauthFromOptions,\n\ttype InodraAuth,\n\ttype ResolvedAuth,\n} from \"./auth.js\";\nimport {\n\tInodraAuthenticationError,\n\tInodraError,\n\tInodraRateLimitError,\n\tInodraTimeoutError,\n} from \"./errors.js\";\nimport { type InodraNetwork, restBaseUrl } from \"./network.js\";\nimport { SDK_HEADER_NAME, SDK_HEADER_VALUE } from \"./version.js\";\n\nexport interface InodraHttpClientOptions {\n\t/** Credentials: an API key string, {apiKey}, {sessionToken}, or a provider. */\n\tauth?: InodraAuth;\n\t/** Shorthand for `auth: { apiKey }`. */\n\tapiKey?: string;\n\t/** Defaults to \"mainnet\". Ignored when baseUrl is set. */\n\tnetwork?: InodraNetwork;\n\t/** Overrides the network-derived base URL (e.g. http://localhost:3000/v1). */\n\tbaseUrl?: string;\n\t/** Retries on 429 and 5xx responses. Defaults to 2. */\n\tmaxRetries?: number;\n\t/** Per-request timeout in milliseconds. Defaults to 30000. */\n\ttimeoutMs?: number;\n\t/** Custom fetch implementation (e.g. for testing or proxying). */\n\tfetch?: typeof globalThis.fetch;\n\t/** Called with rate-limit/credit info after every response that carries it. */\n\tonResponseMeta?: (meta: InodraResponseMeta) => void;\n}\n\nexport interface RequestOptions {\n\tquery?: Record<string, string | number | boolean | undefined>;\n\tbody?: unknown;\n\tsignal?: AbortSignal;\n\t/**\n\t * Marks a POST/PATCH as safe to retry on 5xx. Reads (GET) and idempotent\n\t * writes (PUT/DELETE) retry on 429 and 5xx by default; non-idempotent\n\t * writes retry only on 429 (the request was never processed) unless this\n\t * is set — a 5xx may have been applied server-side.\n\t */\n\tidempotent?: boolean;\n}\n\n/** Rate-limit and credit state reported by the API on each response. */\nexport interface InodraResponseMeta {\n\trateLimit?: {\n\t\tlimit: number;\n\t\tremaining: number;\n\t\t/** Unix epoch (ms) when the window resets. */\n\t\treset: number;\n\t\t/** True when CU quota is exceeded and limits are soft-dropped. */\n\t\tthrottled: boolean;\n\t};\n\tcredits?: {\n\t\tremaining: number;\n\t\tlimit: number;\n\t\t/** ISO date when credits replenish. */\n\t\treplenishDate?: string;\n\t\t/** True when credit accounting is degraded (fail-open). */\n\t\tdegraded: boolean;\n\t};\n\trequestId?: string;\n}\n\nexport class InodraHttpClient {\n\treadonly baseUrl: string;\n\t/** Rate-limit/credit info from the most recent response, if any. */\n\tlastResponseMeta: InodraResponseMeta | undefined;\n\n\tprivate readonly auth: ResolvedAuth;\n\tprivate readonly maxRetries: number;\n\tprivate readonly timeoutMs: number;\n\tprivate readonly fetchImpl: typeof globalThis.fetch;\n\tprivate readonly onResponseMeta?: (meta: InodraResponseMeta) => void;\n\n\tconstructor(options: InodraHttpClientOptions) {\n\t\tthis.auth = authFromOptions(options, \"InodraHttpClient\");\n\t\tthis.baseUrl = (\n\t\t\toptions.baseUrl ?? restBaseUrl(options.network ?? \"mainnet\")\n\t\t).replace(/\\/$/, \"\");\n\t\tthis.maxRetries = options.maxRetries ?? 2;\n\t\tthis.timeoutMs = options.timeoutMs ?? 30_000;\n\t\tthis.fetchImpl = options.fetch ?? globalThis.fetch;\n\t\tthis.onResponseMeta = options.onResponseMeta;\n\t}\n\n\tasync request<T>(\n\t\tmethod: \"GET\" | \"POST\" | \"PUT\" | \"PATCH\" | \"DELETE\",\n\t\tpath: string,\n\t\toptions: RequestOptions = {},\n\t): Promise<T> {\n\t\tconst url = new URL(this.baseUrl + path);\n\t\tfor (const [key, value] of Object.entries(options.query ?? {})) {\n\t\t\tif (value !== undefined) {\n\t\t\t\turl.searchParams.set(key, String(value));\n\t\t\t}\n\t\t}\n\n\t\tconst retryOn5xx =\n\t\t\toptions.idempotent ?? !(method === \"POST\" || method === \"PATCH\");\n\n\t\tlet attempt = 0;\n\t\tfor (;;) {\n\t\t\tconst response = await this.send(url, method, options);\n\t\t\tthis.captureMeta(response);\n\n\t\t\tif (response.ok) {\n\t\t\t\tif (response.status === 204) {\n\t\t\t\t\treturn undefined as T;\n\t\t\t\t}\n\t\t\t\treturn (await response.json()) as T;\n\t\t\t}\n\n\t\t\tconst retryable =\n\t\t\t\tresponse.status === 429 || (retryOn5xx && response.status >= 500);\n\t\t\tif (retryable && attempt < this.maxRetries) {\n\t\t\t\tattempt += 1;\n\t\t\t\tawait sleep(retryDelayMs(response, attempt));\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tthrow await toError(response);\n\t\t}\n\t}\n\n\tprivate async send(\n\t\turl: URL,\n\t\tmethod: string,\n\t\toptions: RequestOptions,\n\t): Promise<Response> {\n\t\tconst timeoutSignal = AbortSignal.timeout(this.timeoutMs);\n\t\tconst signal = options.signal\n\t\t\t? AbortSignal.any([options.signal, timeoutSignal])\n\t\t\t: timeoutSignal;\n\n\t\tconst { headers: authHeaders } = await this.auth.credentials();\n\n\t\ttry {\n\t\t\treturn await this.fetchImpl(url, {\n\t\t\t\tmethod,\n\t\t\t\theaders: {\n\t\t\t\t\t...authHeaders,\n\t\t\t\t\t[SDK_HEADER_NAME]: SDK_HEADER_VALUE,\n\t\t\t\t\t\"content-type\": \"application/json\",\n\t\t\t\t\taccept: \"application/json\",\n\t\t\t\t},\n\t\t\t\tbody: options.body === undefined ? undefined : JSON.stringify(options.body),\n\t\t\t\tsignal,\n\t\t\t});\n\t\t} catch (error) {\n\t\t\tif (timeoutSignal.aborted && !options.signal?.aborted) {\n\t\t\t\tthrow new InodraTimeoutError(this.timeoutMs);\n\t\t\t}\n\t\t\tthrow error;\n\t\t}\n\t}\n\n\tprivate captureMeta(response: Response): void {\n\t\tconst meta = parseResponseMeta(response);\n\t\tif (meta) {\n\t\t\tthis.lastResponseMeta = meta;\n\t\t\tthis.onResponseMeta?.(meta);\n\t\t}\n\t}\n}\n\nexport function parseResponseMeta(\n\tresponse: Response,\n): InodraResponseMeta | undefined {\n\tconst meta: InodraResponseMeta = {};\n\n\tconst limit = header(response, \"x-ratelimit-limit\");\n\tconst remaining = header(response, \"x-ratelimit-remaining\");\n\tconst reset = header(response, \"x-ratelimit-reset\");\n\tif (limit !== undefined && remaining !== undefined) {\n\t\tmeta.rateLimit = {\n\t\t\tlimit,\n\t\t\tremaining,\n\t\t\treset: reset ?? 0,\n\t\t\tthrottled: response.headers.get(\"x-ratelimit-throttle\") !== null,\n\t\t};\n\t}\n\n\tconst creditRemaining = header(response, \"x-inodra-credit-remaining\");\n\tconst creditLimit = header(response, \"x-inodra-credit-limit\");\n\tif (creditRemaining !== undefined && creditLimit !== undefined) {\n\t\tmeta.credits = {\n\t\t\tremaining: creditRemaining,\n\t\t\tlimit: creditLimit,\n\t\t\treplenishDate:\n\t\t\t\tresponse.headers.get(\"x-inodra-credit-replenish-date\") ?? undefined,\n\t\t\tdegraded: response.headers.get(\"x-inodra-credit-degraded\") === \"true\",\n\t\t};\n\t}\n\n\tconst requestId = response.headers.get(\"x-request-id\");\n\tif (requestId) {\n\t\tmeta.requestId = requestId;\n\t}\n\n\tif (!meta.rateLimit && !meta.credits && !meta.requestId) {\n\t\treturn undefined;\n\t}\n\treturn meta;\n}\n\nfunction header(response: Response, name: string): number | undefined {\n\tconst raw = response.headers.get(name);\n\tif (raw === null) {\n\t\treturn undefined;\n\t}\n\tconst value = Number(raw);\n\treturn Number.isFinite(value) ? value : undefined;\n}\n\nasync function toError(response: Response): Promise<InodraError> {\n\tconst requestId = response.headers.get(\"x-request-id\") ?? undefined;\n\tlet body: unknown;\n\ttry {\n\t\tbody = await response.json();\n\t} catch {\n\t\tbody = undefined;\n\t}\n\n\tconst serverMessage = extractField(body, [\"message\", \"error\"]);\n\tconst code = extractField(body, [\"code\"]);\n\n\tif (response.status === 401 || response.status === 403) {\n\t\treturn new InodraAuthenticationError({\n\t\t\tstatus: response.status,\n\t\t\trequestId,\n\t\t\tbody,\n\t\t\tcode,\n\t\t\tmessage: serverMessage,\n\t\t});\n\t}\n\tif (response.status === 429) {\n\t\tconst retryAfter = response.headers.get(\"retry-after\");\n\t\treturn new InodraRateLimitError({\n\t\t\tstatus: response.status,\n\t\t\trequestId,\n\t\t\tbody,\n\t\t\tcode,\n\t\t\tretryAfterSeconds: retryAfter ? Number(retryAfter) : undefined,\n\t\t\tmessage: serverMessage,\n\t\t});\n\t}\n\n\treturn new InodraError(\n\t\tserverMessage ?? `Request failed with status ${response.status}`,\n\t\t{ status: response.status, requestId, body, code },\n\t);\n}\n\nfunction extractField(body: unknown, keys: string[]): string | undefined {\n\tif (typeof body !== \"object\" || body === null) {\n\t\treturn undefined;\n\t}\n\tfor (const key of keys) {\n\t\tconst value = (body as Record<string, unknown>)[key];\n\t\tif (typeof value === \"string\" && value.length > 0) {\n\t\t\treturn value;\n\t\t}\n\t}\n\treturn undefined;\n}\n\nfunction retryDelayMs(response: Response, attempt: number): number {\n\tconst retryAfter = response.headers.get(\"retry-after\");\n\tif (retryAfter) {\n\t\tconst seconds = Number(retryAfter);\n\t\tif (Number.isFinite(seconds)) {\n\t\t\treturn seconds * 1000;\n\t\t}\n\t}\n\treturn 250 * 2 ** (attempt - 1) + Math.random() * 100;\n}\n\nfunction sleep(ms: number): Promise<void> {\n\treturn new Promise((resolve) => setTimeout(resolve, ms));\n}\n","import {\n\tInodraHttpClient,\n\ttype InodraHttpClientOptions,\n} from \"../core/http.js\";\nimport type { Body, Operation, Success } from \"../core/openapi.js\";\n\n// Webhooks\nexport type CreateEventWebhookInput = Body<Operation<\"/webhooks/events\", \"post\">>;\nexport type CreateAddressWebhookInput = Body<\n\tOperation<\"/webhooks/addresses\", \"post\">\n>;\nexport type CreateCoinWebhookInput = Body<Operation<\"/webhooks/coins\", \"post\">>;\nexport type CreateObjectWebhookInput = Body<\n\tOperation<\"/webhooks/objects\", \"post\">\n>;\nexport type CreateWebhookResponse = Success<Operation<\"/webhooks/events\", \"post\">>;\nexport type ListWebhooksResponse = Success<Operation<\"/webhooks\", \"get\">>;\nexport type Webhook = Success<Operation<\"/webhooks/{id}\", \"get\">>;\nexport type UpdateWebhookInput = Body<Operation<\"/webhooks/{id}\", \"put\">>;\nexport type UpdateWebhookResponse = Success<Operation<\"/webhooks/{id}\", \"put\">>;\nexport type DeleteWebhookResponse = Success<Operation<\"/webhooks/{id}\", \"delete\">>;\n\n// Warp streams\nexport type CreateEventStreamInput = Body<Operation<\"/warp/events\", \"post\">>;\nexport type CreateAddressStreamInput = Body<Operation<\"/warp/addresses\", \"post\">>;\nexport type CreateCoinStreamInput = Body<Operation<\"/warp/coins\", \"post\">>;\nexport type CreateObjectStreamInput = Body<Operation<\"/warp/objects\", \"post\">>;\nexport type CreateStreamResponse = Success<Operation<\"/warp/events\", \"post\">>;\nexport type ListStreamsResponse = Success<Operation<\"/warp\", \"get\">>;\nexport type WarpStream = Success<Operation<\"/warp/{id}\", \"get\">>;\nexport type UpdateStreamInput = Body<Operation<\"/warp/{id}\", \"put\">>;\nexport type UpdateStreamResponse = Success<Operation<\"/warp/{id}\", \"put\">>;\nexport type DeleteStreamResponse = Success<Operation<\"/warp/{id}\", \"delete\">>;\n\nexport type InodraManagementClientOptions = InodraHttpClientOptions;\n\n/**\n * CRUD client for Inodra webhooks and Warp stream subscriptions.\n *\n * ```ts\n * const inodra = new InodraManagementClient({ apiKey });\n * const stream = await inodra.warp.createEventStream({\n * eventType: \"0xpkg::module::Event\",\n * });\n * ```\n */\nexport class InodraManagementClient {\n\treadonly http: InodraHttpClient;\n\n\tconstructor(options: InodraManagementClientOptions) {\n\t\tthis.http = new InodraHttpClient(options);\n\t}\n\n\treadonly webhooks = {\n\t\tcreateEvent: (input: CreateEventWebhookInput) =>\n\t\t\tthis.http.request<CreateWebhookResponse>(\"POST\", \"/webhooks/events\", {\n\t\t\t\tbody: input,\n\t\t\t}),\n\t\tcreateAddress: (input: CreateAddressWebhookInput) =>\n\t\t\tthis.http.request<CreateWebhookResponse>(\"POST\", \"/webhooks/addresses\", {\n\t\t\t\tbody: input,\n\t\t\t}),\n\t\tcreateCoin: (input: CreateCoinWebhookInput) =>\n\t\t\tthis.http.request<CreateWebhookResponse>(\"POST\", \"/webhooks/coins\", {\n\t\t\t\tbody: input,\n\t\t\t}),\n\t\tcreateObject: (input: CreateObjectWebhookInput) =>\n\t\t\tthis.http.request<CreateWebhookResponse>(\"POST\", \"/webhooks/objects\", {\n\t\t\t\tbody: input,\n\t\t\t}),\n\t\tlist: () => this.http.request<ListWebhooksResponse>(\"GET\", \"/webhooks\"),\n\t\tget: (id: string) =>\n\t\t\tthis.http.request<Webhook>(\"GET\", `/webhooks/${encodeURIComponent(id)}`),\n\t\tupdate: (id: string, input: UpdateWebhookInput) =>\n\t\t\tthis.http.request<UpdateWebhookResponse>(\n\t\t\t\t\"PUT\",\n\t\t\t\t`/webhooks/${encodeURIComponent(id)}`,\n\t\t\t\t{ body: input },\n\t\t\t),\n\t\tdelete: (id: string) =>\n\t\t\tthis.http.request<DeleteWebhookResponse>(\n\t\t\t\t\"DELETE\",\n\t\t\t\t`/webhooks/${encodeURIComponent(id)}`,\n\t\t\t),\n\t};\n\n\treadonly warp = {\n\t\tcreateEventStream: (input: CreateEventStreamInput) =>\n\t\t\tthis.http.request<CreateStreamResponse>(\"POST\", \"/warp/events\", {\n\t\t\t\tbody: input,\n\t\t\t}),\n\t\tcreateAddressStream: (input: CreateAddressStreamInput) =>\n\t\t\tthis.http.request<CreateStreamResponse>(\"POST\", \"/warp/addresses\", {\n\t\t\t\tbody: input,\n\t\t\t}),\n\t\tcreateCoinStream: (input: CreateCoinStreamInput) =>\n\t\t\tthis.http.request<CreateStreamResponse>(\"POST\", \"/warp/coins\", {\n\t\t\t\tbody: input,\n\t\t\t}),\n\t\tcreateObjectStream: (input: CreateObjectStreamInput) =>\n\t\t\tthis.http.request<CreateStreamResponse>(\"POST\", \"/warp/objects\", {\n\t\t\t\tbody: input,\n\t\t\t}),\n\t\tlist: () => this.http.request<ListStreamsResponse>(\"GET\", \"/warp\"),\n\t\tget: (id: string) =>\n\t\t\tthis.http.request<WarpStream>(\"GET\", `/warp/${encodeURIComponent(id)}`),\n\t\tupdate: (id: string, input: UpdateStreamInput) =>\n\t\t\tthis.http.request<UpdateStreamResponse>(\n\t\t\t\t\"PUT\",\n\t\t\t\t`/warp/${encodeURIComponent(id)}`,\n\t\t\t\t{ body: input },\n\t\t\t),\n\t\tdelete: (id: string) =>\n\t\t\tthis.http.request<DeleteStreamResponse>(\n\t\t\t\t\"DELETE\",\n\t\t\t\t`/warp/${encodeURIComponent(id)}`,\n\t\t\t),\n\t};\n}\n"],"mappings":";;;;;;;;AAAO,IAAM,cAAN,cAA0B,MAAM;AAAA,EAC7B;AAAA,EACA;AAAA,EACA;AAAA;AAAA,EAEA;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