@vleap/warps-adapter-fastset 0.1.0-alpha.6 → 0.1.0-alpha.8

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/dist/index.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { AdapterFactory, CombinedWarpBuilder, WarpClientConfig, Warp, BaseWarpBuilder, WarpAction, AdapterWarpExecutor, WarpExecutable, WarpChainInfo, WarpActionInputType, AdapterWarpExplorer, AdapterWarpResults, WarpExecution, ResolvedInput, WarpExecutionResults, AdapterWarpSerializer, WarpSerializer, WarpNativeValue, BaseWarpActionInputType, WarpAdapterGenericType } from '@vleap/warps';
1
+ import { AdapterFactory, AdapterWarpExecutor, WarpClientConfig, WarpExecutable, WarpChainInfo, WarpActionInputType, AdapterWarpExplorer, AdapterWarpResults, Warp, WarpExecution, ResolvedInput, WarpExecutionResults, AdapterWarpSerializer, WarpSerializer, WarpNativeValue, BaseWarpActionInputType, WarpAdapterGenericType } from '@vleap/warps';
2
2
  import * as _mysten_bcs from '@mysten/bcs';
3
3
 
4
4
  declare const WarpFastsetConstants: {
@@ -38,76 +38,117 @@ declare const getFastsetAdapter: AdapterFactory;
38
38
 
39
39
  declare const Bytes32: _mysten_bcs.BcsType<number[], Iterable<number> & {
40
40
  length: number;
41
- }, string>;
41
+ }>;
42
42
  declare const PublicKey: _mysten_bcs.BcsType<number[], Iterable<number> & {
43
43
  length: number;
44
- }, string>;
45
- declare const Address: _mysten_bcs.BcsEnum<{
46
- External: _mysten_bcs.BcsType<number[], Iterable<number> & {
44
+ }>;
45
+ declare const Address: _mysten_bcs.BcsType<{
46
+ External: number[];
47
+ } | {
48
+ FastSet: number[];
49
+ }, {
50
+ External: Iterable<number> & {
47
51
  length: number;
48
- }, string>;
49
- FastSet: _mysten_bcs.BcsType<number[], Iterable<number> & {
52
+ };
53
+ } | {
54
+ FastSet: Iterable<number> & {
50
55
  length: number;
51
- }, string>;
52
- }, "Address">;
53
- declare const Amount: _mysten_bcs.BcsType<string, unknown, "u256">;
56
+ };
57
+ }>;
58
+ declare const Amount: _mysten_bcs.BcsType<string, unknown>;
54
59
  declare const UserData: _mysten_bcs.BcsType<number[] | null, (Iterable<number> & {
55
60
  length: number;
56
- }) | null | undefined, `Option<${string}>`>;
57
- declare const Nonce: _mysten_bcs.BcsType<string, string | number | bigint, "u64">;
58
- declare const Transfer: _mysten_bcs.BcsStruct<{
59
- recipient: _mysten_bcs.BcsEnum<{
60
- External: _mysten_bcs.BcsType<number[], Iterable<number> & {
61
+ }) | null | undefined>;
62
+ declare const Nonce: _mysten_bcs.BcsType<string, string | number | bigint>;
63
+ declare const Transfer: _mysten_bcs.BcsType<{
64
+ recipient: {
65
+ External: number[];
66
+ } | {
67
+ FastSet: number[];
68
+ };
69
+ amount: string;
70
+ user_data: number[] | null;
71
+ }, {
72
+ recipient: {
73
+ External: Iterable<number> & {
61
74
  length: number;
62
- }, string>;
63
- FastSet: _mysten_bcs.BcsType<number[], Iterable<number> & {
75
+ };
76
+ } | {
77
+ FastSet: Iterable<number> & {
64
78
  length: number;
65
- }, string>;
66
- }, "Address">;
67
- amount: _mysten_bcs.BcsType<string, unknown, "u256">;
68
- user_data: _mysten_bcs.BcsType<number[] | null, (Iterable<number> & {
79
+ };
80
+ };
81
+ amount: unknown;
82
+ user_data: (Iterable<number> & {
69
83
  length: number;
70
- }) | null | undefined, `Option<${string}>`>;
71
- }, string>;
72
- declare const ClaimType: _mysten_bcs.BcsEnum<{
73
- Transfer: _mysten_bcs.BcsStruct<{
74
- recipient: _mysten_bcs.BcsEnum<{
75
- External: _mysten_bcs.BcsType<number[], Iterable<number> & {
84
+ }) | null | undefined;
85
+ }>;
86
+ declare const ClaimType: _mysten_bcs.BcsType<{
87
+ Transfer: {
88
+ recipient: {
89
+ External: number[];
90
+ } | {
91
+ FastSet: number[];
92
+ };
93
+ amount: string;
94
+ user_data: number[] | null;
95
+ };
96
+ }, {
97
+ Transfer: {
98
+ recipient: {
99
+ External: Iterable<number> & {
76
100
  length: number;
77
- }, string>;
78
- FastSet: _mysten_bcs.BcsType<number[], Iterable<number> & {
101
+ };
102
+ } | {
103
+ FastSet: Iterable<number> & {
79
104
  length: number;
80
- }, string>;
81
- }, "Address">;
82
- amount: _mysten_bcs.BcsType<string, unknown, "u256">;
83
- user_data: _mysten_bcs.BcsType<number[] | null, (Iterable<number> & {
105
+ };
106
+ };
107
+ amount: unknown;
108
+ user_data: (Iterable<number> & {
84
109
  length: number;
85
- }) | null | undefined, `Option<${string}>`>;
86
- }, string>;
87
- }, "ClaimType">;
88
- declare const Transaction: _mysten_bcs.BcsStruct<{
89
- sender: _mysten_bcs.BcsType<number[], Iterable<number> & {
110
+ }) | null | undefined;
111
+ };
112
+ }>;
113
+ declare const Transaction: _mysten_bcs.BcsType<{
114
+ sender: number[];
115
+ nonce: string;
116
+ timestamp_nanos: string;
117
+ claim: {
118
+ Transfer: {
119
+ recipient: {
120
+ External: number[];
121
+ } | {
122
+ FastSet: number[];
123
+ };
124
+ amount: string;
125
+ user_data: number[] | null;
126
+ };
127
+ };
128
+ }, {
129
+ sender: Iterable<number> & {
90
130
  length: number;
91
- }, string>;
92
- nonce: _mysten_bcs.BcsType<string, string | number | bigint, "u64">;
93
- timestamp_nanos: _mysten_bcs.BcsType<string, string | number | bigint, "u128">;
94
- claim: _mysten_bcs.BcsEnum<{
95
- Transfer: _mysten_bcs.BcsStruct<{
96
- recipient: _mysten_bcs.BcsEnum<{
97
- External: _mysten_bcs.BcsType<number[], Iterable<number> & {
131
+ };
132
+ nonce: string | number | bigint;
133
+ timestamp_nanos: string | number | bigint;
134
+ claim: {
135
+ Transfer: {
136
+ recipient: {
137
+ External: Iterable<number> & {
98
138
  length: number;
99
- }, string>;
100
- FastSet: _mysten_bcs.BcsType<number[], Iterable<number> & {
139
+ };
140
+ } | {
141
+ FastSet: Iterable<number> & {
101
142
  length: number;
102
- }, string>;
103
- }, "Address">;
104
- amount: _mysten_bcs.BcsType<string, unknown, "u256">;
105
- user_data: _mysten_bcs.BcsType<number[] | null, (Iterable<number> & {
143
+ };
144
+ };
145
+ amount: unknown;
146
+ user_data: (Iterable<number> & {
106
147
  length: number;
107
- }) | null | undefined, `Option<${string}>`>;
108
- }, string>;
109
- }, "ClaimType">;
110
- }, string>;
148
+ }) | null | undefined;
149
+ };
150
+ };
151
+ }>;
111
152
  interface FastsetTransaction {
112
153
  sender: Uint8Array;
113
154
  nonce: number;
@@ -204,27 +245,6 @@ declare function normalizeAmount(amount: string): string;
204
245
  declare function validatePrivateKey(privateKey: string | Uint8Array): boolean;
205
246
  declare function validatePublicKey(publicKey: string | Uint8Array): boolean;
206
247
 
207
- declare class WarpFastsetBuilder implements CombinedWarpBuilder {
208
- private readonly config;
209
- private warp;
210
- private actions;
211
- constructor(config: WarpClientConfig);
212
- createFromRaw(encoded: string): Promise<Warp>;
213
- setTitle(title: string): BaseWarpBuilder;
214
- setDescription(description: string): BaseWarpBuilder;
215
- setPreview(preview: string): BaseWarpBuilder;
216
- setActions(actions: WarpAction[]): BaseWarpBuilder;
217
- addAction(action: WarpAction): BaseWarpBuilder;
218
- build(): Promise<Warp>;
219
- createInscriptionTransaction(warp: Warp): any;
220
- createFromTransaction(tx: any, validate?: boolean): Promise<Warp>;
221
- createFromTransactionHash(hash: string, cache?: any): Promise<Warp | null>;
222
- private generateHash;
223
- private validateWarp;
224
- private fetchTransaction;
225
- private getApiUrl;
226
- }
227
-
228
248
  declare class WarpFastsetExecutor implements AdapterWarpExecutor {
229
249
  private readonly config;
230
250
  private readonly serializer;
@@ -280,4 +300,4 @@ declare class WarpFastsetSerializer implements AdapterWarpSerializer {
280
300
  stringToTyped(value: string): any;
281
301
  }
282
302
 
283
- export { Address, Amount, Bytes32, ClaimType, type FastsetAccountInfo, FastsetClient, type FastsetClientConfig, type FastsetFaucetRequest, type FastsetFaucetResponse, type FastsetJsonRpcRequest, type FastsetJsonRpcResponse, type FastsetSubmitCertificateRequest, type FastsetSubmitTransactionRequest, type FastsetSubmitTransactionResponse, type FastsetTransaction, type FastsetTransferRequest, Nonce, PublicKey, Transaction, Transfer, UserData, WarpFastsetBuilder, WarpFastsetConstants, WarpFastsetExecutor, WarpFastsetExplorer, WarpFastsetResults, WarpFastsetSerializer, decimalToHex, fromBase64, getFastsetAdapter, hexToDecimal, isValidFastsetAddress, normalizeAmount, toBase64String, toHexString, validateAmount, validatePrivateKey, validatePublicKey };
303
+ export { Address, Amount, Bytes32, ClaimType, type FastsetAccountInfo, FastsetClient, type FastsetClientConfig, type FastsetFaucetRequest, type FastsetFaucetResponse, type FastsetJsonRpcRequest, type FastsetJsonRpcResponse, type FastsetSubmitCertificateRequest, type FastsetSubmitTransactionRequest, type FastsetSubmitTransactionResponse, type FastsetTransaction, type FastsetTransferRequest, Nonce, PublicKey, Transaction, Transfer, UserData, WarpFastsetConstants, WarpFastsetExecutor, WarpFastsetExplorer, WarpFastsetResults, WarpFastsetSerializer, decimalToHex, fromBase64, getFastsetAdapter, hexToDecimal, isValidFastsetAddress, normalizeAmount, toBase64String, toHexString, validateAmount, validatePrivateKey, validatePublicKey };
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { AdapterFactory, CombinedWarpBuilder, WarpClientConfig, Warp, BaseWarpBuilder, WarpAction, AdapterWarpExecutor, WarpExecutable, WarpChainInfo, WarpActionInputType, AdapterWarpExplorer, AdapterWarpResults, WarpExecution, ResolvedInput, WarpExecutionResults, AdapterWarpSerializer, WarpSerializer, WarpNativeValue, BaseWarpActionInputType, WarpAdapterGenericType } from '@vleap/warps';
1
+ import { AdapterFactory, AdapterWarpExecutor, WarpClientConfig, WarpExecutable, WarpChainInfo, WarpActionInputType, AdapterWarpExplorer, AdapterWarpResults, Warp, WarpExecution, ResolvedInput, WarpExecutionResults, AdapterWarpSerializer, WarpSerializer, WarpNativeValue, BaseWarpActionInputType, WarpAdapterGenericType } from '@vleap/warps';
2
2
  import * as _mysten_bcs from '@mysten/bcs';
3
3
 
4
4
  declare const WarpFastsetConstants: {
@@ -38,76 +38,117 @@ declare const getFastsetAdapter: AdapterFactory;
38
38
 
39
39
  declare const Bytes32: _mysten_bcs.BcsType<number[], Iterable<number> & {
40
40
  length: number;
41
- }, string>;
41
+ }>;
42
42
  declare const PublicKey: _mysten_bcs.BcsType<number[], Iterable<number> & {
43
43
  length: number;
44
- }, string>;
45
- declare const Address: _mysten_bcs.BcsEnum<{
46
- External: _mysten_bcs.BcsType<number[], Iterable<number> & {
44
+ }>;
45
+ declare const Address: _mysten_bcs.BcsType<{
46
+ External: number[];
47
+ } | {
48
+ FastSet: number[];
49
+ }, {
50
+ External: Iterable<number> & {
47
51
  length: number;
48
- }, string>;
49
- FastSet: _mysten_bcs.BcsType<number[], Iterable<number> & {
52
+ };
53
+ } | {
54
+ FastSet: Iterable<number> & {
50
55
  length: number;
51
- }, string>;
52
- }, "Address">;
53
- declare const Amount: _mysten_bcs.BcsType<string, unknown, "u256">;
56
+ };
57
+ }>;
58
+ declare const Amount: _mysten_bcs.BcsType<string, unknown>;
54
59
  declare const UserData: _mysten_bcs.BcsType<number[] | null, (Iterable<number> & {
55
60
  length: number;
56
- }) | null | undefined, `Option<${string}>`>;
57
- declare const Nonce: _mysten_bcs.BcsType<string, string | number | bigint, "u64">;
58
- declare const Transfer: _mysten_bcs.BcsStruct<{
59
- recipient: _mysten_bcs.BcsEnum<{
60
- External: _mysten_bcs.BcsType<number[], Iterable<number> & {
61
+ }) | null | undefined>;
62
+ declare const Nonce: _mysten_bcs.BcsType<string, string | number | bigint>;
63
+ declare const Transfer: _mysten_bcs.BcsType<{
64
+ recipient: {
65
+ External: number[];
66
+ } | {
67
+ FastSet: number[];
68
+ };
69
+ amount: string;
70
+ user_data: number[] | null;
71
+ }, {
72
+ recipient: {
73
+ External: Iterable<number> & {
61
74
  length: number;
62
- }, string>;
63
- FastSet: _mysten_bcs.BcsType<number[], Iterable<number> & {
75
+ };
76
+ } | {
77
+ FastSet: Iterable<number> & {
64
78
  length: number;
65
- }, string>;
66
- }, "Address">;
67
- amount: _mysten_bcs.BcsType<string, unknown, "u256">;
68
- user_data: _mysten_bcs.BcsType<number[] | null, (Iterable<number> & {
79
+ };
80
+ };
81
+ amount: unknown;
82
+ user_data: (Iterable<number> & {
69
83
  length: number;
70
- }) | null | undefined, `Option<${string}>`>;
71
- }, string>;
72
- declare const ClaimType: _mysten_bcs.BcsEnum<{
73
- Transfer: _mysten_bcs.BcsStruct<{
74
- recipient: _mysten_bcs.BcsEnum<{
75
- External: _mysten_bcs.BcsType<number[], Iterable<number> & {
84
+ }) | null | undefined;
85
+ }>;
86
+ declare const ClaimType: _mysten_bcs.BcsType<{
87
+ Transfer: {
88
+ recipient: {
89
+ External: number[];
90
+ } | {
91
+ FastSet: number[];
92
+ };
93
+ amount: string;
94
+ user_data: number[] | null;
95
+ };
96
+ }, {
97
+ Transfer: {
98
+ recipient: {
99
+ External: Iterable<number> & {
76
100
  length: number;
77
- }, string>;
78
- FastSet: _mysten_bcs.BcsType<number[], Iterable<number> & {
101
+ };
102
+ } | {
103
+ FastSet: Iterable<number> & {
79
104
  length: number;
80
- }, string>;
81
- }, "Address">;
82
- amount: _mysten_bcs.BcsType<string, unknown, "u256">;
83
- user_data: _mysten_bcs.BcsType<number[] | null, (Iterable<number> & {
105
+ };
106
+ };
107
+ amount: unknown;
108
+ user_data: (Iterable<number> & {
84
109
  length: number;
85
- }) | null | undefined, `Option<${string}>`>;
86
- }, string>;
87
- }, "ClaimType">;
88
- declare const Transaction: _mysten_bcs.BcsStruct<{
89
- sender: _mysten_bcs.BcsType<number[], Iterable<number> & {
110
+ }) | null | undefined;
111
+ };
112
+ }>;
113
+ declare const Transaction: _mysten_bcs.BcsType<{
114
+ sender: number[];
115
+ nonce: string;
116
+ timestamp_nanos: string;
117
+ claim: {
118
+ Transfer: {
119
+ recipient: {
120
+ External: number[];
121
+ } | {
122
+ FastSet: number[];
123
+ };
124
+ amount: string;
125
+ user_data: number[] | null;
126
+ };
127
+ };
128
+ }, {
129
+ sender: Iterable<number> & {
90
130
  length: number;
91
- }, string>;
92
- nonce: _mysten_bcs.BcsType<string, string | number | bigint, "u64">;
93
- timestamp_nanos: _mysten_bcs.BcsType<string, string | number | bigint, "u128">;
94
- claim: _mysten_bcs.BcsEnum<{
95
- Transfer: _mysten_bcs.BcsStruct<{
96
- recipient: _mysten_bcs.BcsEnum<{
97
- External: _mysten_bcs.BcsType<number[], Iterable<number> & {
131
+ };
132
+ nonce: string | number | bigint;
133
+ timestamp_nanos: string | number | bigint;
134
+ claim: {
135
+ Transfer: {
136
+ recipient: {
137
+ External: Iterable<number> & {
98
138
  length: number;
99
- }, string>;
100
- FastSet: _mysten_bcs.BcsType<number[], Iterable<number> & {
139
+ };
140
+ } | {
141
+ FastSet: Iterable<number> & {
101
142
  length: number;
102
- }, string>;
103
- }, "Address">;
104
- amount: _mysten_bcs.BcsType<string, unknown, "u256">;
105
- user_data: _mysten_bcs.BcsType<number[] | null, (Iterable<number> & {
143
+ };
144
+ };
145
+ amount: unknown;
146
+ user_data: (Iterable<number> & {
106
147
  length: number;
107
- }) | null | undefined, `Option<${string}>`>;
108
- }, string>;
109
- }, "ClaimType">;
110
- }, string>;
148
+ }) | null | undefined;
149
+ };
150
+ };
151
+ }>;
111
152
  interface FastsetTransaction {
112
153
  sender: Uint8Array;
113
154
  nonce: number;
@@ -204,27 +245,6 @@ declare function normalizeAmount(amount: string): string;
204
245
  declare function validatePrivateKey(privateKey: string | Uint8Array): boolean;
205
246
  declare function validatePublicKey(publicKey: string | Uint8Array): boolean;
206
247
 
207
- declare class WarpFastsetBuilder implements CombinedWarpBuilder {
208
- private readonly config;
209
- private warp;
210
- private actions;
211
- constructor(config: WarpClientConfig);
212
- createFromRaw(encoded: string): Promise<Warp>;
213
- setTitle(title: string): BaseWarpBuilder;
214
- setDescription(description: string): BaseWarpBuilder;
215
- setPreview(preview: string): BaseWarpBuilder;
216
- setActions(actions: WarpAction[]): BaseWarpBuilder;
217
- addAction(action: WarpAction): BaseWarpBuilder;
218
- build(): Promise<Warp>;
219
- createInscriptionTransaction(warp: Warp): any;
220
- createFromTransaction(tx: any, validate?: boolean): Promise<Warp>;
221
- createFromTransactionHash(hash: string, cache?: any): Promise<Warp | null>;
222
- private generateHash;
223
- private validateWarp;
224
- private fetchTransaction;
225
- private getApiUrl;
226
- }
227
-
228
248
  declare class WarpFastsetExecutor implements AdapterWarpExecutor {
229
249
  private readonly config;
230
250
  private readonly serializer;
@@ -280,4 +300,4 @@ declare class WarpFastsetSerializer implements AdapterWarpSerializer {
280
300
  stringToTyped(value: string): any;
281
301
  }
282
302
 
283
- export { Address, Amount, Bytes32, ClaimType, type FastsetAccountInfo, FastsetClient, type FastsetClientConfig, type FastsetFaucetRequest, type FastsetFaucetResponse, type FastsetJsonRpcRequest, type FastsetJsonRpcResponse, type FastsetSubmitCertificateRequest, type FastsetSubmitTransactionRequest, type FastsetSubmitTransactionResponse, type FastsetTransaction, type FastsetTransferRequest, Nonce, PublicKey, Transaction, Transfer, UserData, WarpFastsetBuilder, WarpFastsetConstants, WarpFastsetExecutor, WarpFastsetExplorer, WarpFastsetResults, WarpFastsetSerializer, decimalToHex, fromBase64, getFastsetAdapter, hexToDecimal, isValidFastsetAddress, normalizeAmount, toBase64String, toHexString, validateAmount, validatePrivateKey, validatePublicKey };
303
+ export { Address, Amount, Bytes32, ClaimType, type FastsetAccountInfo, FastsetClient, type FastsetClientConfig, type FastsetFaucetRequest, type FastsetFaucetResponse, type FastsetJsonRpcRequest, type FastsetJsonRpcResponse, type FastsetSubmitCertificateRequest, type FastsetSubmitTransactionRequest, type FastsetSubmitTransactionResponse, type FastsetTransaction, type FastsetTransferRequest, Nonce, PublicKey, Transaction, Transfer, UserData, WarpFastsetConstants, WarpFastsetExecutor, WarpFastsetExplorer, WarpFastsetResults, WarpFastsetSerializer, decimalToHex, fromBase64, getFastsetAdapter, hexToDecimal, isValidFastsetAddress, normalizeAmount, toBase64String, toHexString, validateAmount, validatePrivateKey, validatePublicKey };
package/dist/index.js CHANGED
@@ -30,7 +30,6 @@ __export(index_exports, {
30
30
  Transaction: () => Transaction,
31
31
  Transfer: () => Transfer,
32
32
  UserData: () => UserData,
33
- WarpFastsetBuilder: () => WarpFastsetBuilder,
34
33
  WarpFastsetConstants: () => WarpFastsetConstants,
35
34
  WarpFastsetExecutor: () => WarpFastsetExecutor,
36
35
  WarpFastsetExplorer: () => WarpFastsetExplorer,
@@ -91,122 +90,6 @@ var WarpFastsetConstants = {
91
90
  }
92
91
  };
93
92
 
94
- // src/WarpFastsetBuilder.ts
95
- var WarpFastsetBuilder = class {
96
- constructor(config) {
97
- this.config = config;
98
- this.warp = {};
99
- this.actions = [];
100
- }
101
- async createFromRaw(encoded) {
102
- try {
103
- const parsed = JSON.parse(encoded);
104
- this.warp = parsed;
105
- this.actions = parsed.actions || [];
106
- return this.build();
107
- } catch (error) {
108
- throw new Error(`Failed to parse Fastset warp data: ${error}`);
109
- }
110
- }
111
- setTitle(title) {
112
- this.warp.title = title;
113
- return this;
114
- }
115
- setDescription(description) {
116
- this.warp.description = description;
117
- return this;
118
- }
119
- setPreview(preview) {
120
- this.warp.preview = preview;
121
- return this;
122
- }
123
- setActions(actions) {
124
- this.actions = actions;
125
- return this;
126
- }
127
- addAction(action) {
128
- this.actions.push(action);
129
- return this;
130
- }
131
- async build() {
132
- return {
133
- protocol: "warp",
134
- name: this.warp.name || "fastset-warp",
135
- title: this.warp.title || "",
136
- description: this.warp.description || null,
137
- preview: this.warp.preview || null,
138
- actions: this.actions,
139
- meta: {
140
- chain: "fastset",
141
- hash: this.generateHash(this.warp.title || ""),
142
- creator: this.config.user?.wallets?.fastset || "",
143
- createdAt: (/* @__PURE__ */ new Date()).toISOString()
144
- }
145
- };
146
- }
147
- createInscriptionTransaction(warp) {
148
- return {
149
- type: "fastset-inscription",
150
- data: JSON.stringify(warp)
151
- // TODO: Add Fastset-specific transaction fields
152
- };
153
- }
154
- async createFromTransaction(tx, validate = true) {
155
- try {
156
- const warpData = tx.data || tx.payload || tx.content;
157
- if (!warpData) {
158
- throw new Error("No warp data found in transaction");
159
- }
160
- const parsed = typeof warpData === "string" ? JSON.parse(warpData) : warpData;
161
- if (validate) {
162
- this.validateWarp(parsed);
163
- }
164
- return parsed;
165
- } catch (error) {
166
- throw new Error(`Failed to create warp from Fastset transaction: ${error}`);
167
- }
168
- }
169
- async createFromTransactionHash(hash, cache) {
170
- try {
171
- const tx = await this.fetchTransaction(hash);
172
- if (!tx) {
173
- return null;
174
- }
175
- return this.createFromTransaction(tx);
176
- } catch (error) {
177
- console.error(`Failed to create warp from Fastset transaction hash: ${error}`);
178
- return null;
179
- }
180
- }
181
- generateHash(data) {
182
- let hash = 0;
183
- for (let i = 0; i < data.length; i++) {
184
- const char = data.charCodeAt(i);
185
- hash = (hash << 5) - hash + char;
186
- hash = hash & hash;
187
- }
188
- return hash.toString(16);
189
- }
190
- validateWarp(warp) {
191
- if (!warp.title) {
192
- throw new Error("Warp must have a title");
193
- }
194
- if (!warp.actions || !Array.isArray(warp.actions)) {
195
- throw new Error("Warp must have actions array");
196
- }
197
- }
198
- async fetchTransaction(hash) {
199
- const response = await fetch(`${this.getApiUrl()}/transaction/${hash}`);
200
- if (!response.ok) {
201
- return null;
202
- }
203
- return response.json();
204
- }
205
- getApiUrl() {
206
- return "https://api.fastset.xyz";
207
- }
208
- };
209
-
210
93
  // src/WarpFastsetDataLoader.ts
211
94
  var WarpFastsetDataLoader = class {
212
95
  constructor(config, chain) {
@@ -464,10 +347,10 @@ function fromBase64(base64) {
464
347
  return new Uint8Array(Buffer.from(base64, "base64"));
465
348
  }
466
349
  function toBase64String(bytes) {
467
- return (0, import_bcs2.toBase64)(bytes);
350
+ return (0, import_bcs2.toB64)(bytes);
468
351
  }
469
352
  function toHexString(bytes) {
470
- return (0, import_bcs2.toHex)(bytes);
353
+ return (0, import_bcs2.toHEX)(bytes);
471
354
  }
472
355
  function hexToDecimal2(hex) {
473
356
  return BigInt(`0x${hex}`).toString();
@@ -927,7 +810,7 @@ var getFastsetAdapter = (config, fallback) => {
927
810
  chain: ChainName,
928
811
  chainInfo,
929
812
  prefix: "fastset",
930
- builder: () => new WarpFastsetBuilder(config),
813
+ builder: () => fallback.builder(),
931
814
  executor: new WarpFastsetExecutor(config),
932
815
  results: new WarpFastsetResults(config),
933
816
  serializer: new WarpFastsetSerializer(),
@@ -950,7 +833,6 @@ var getFastsetAdapter = (config, fallback) => {
950
833
  Transaction,
951
834
  Transfer,
952
835
  UserData,
953
- WarpFastsetBuilder,
954
836
  WarpFastsetConstants,
955
837
  WarpFastsetExecutor,
956
838
  WarpFastsetExplorer,