bitbadgesjs-sdk 0.30.0 → 0.30.2
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/README.md +258 -47
- package/dist/cjs/api-indexer/BitBadgesApi.js +12 -12
- package/dist/cjs/api-indexer/metadata/tokenMetadata.d.ts +4 -4
- package/dist/cjs/api-indexer/metadata/tokenMetadata.d.ts.map +1 -1
- package/dist/cjs/index.d.ts +1 -0
- package/dist/cjs/index.d.ts.map +1 -1
- package/dist/cjs/index.js +1 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/signing/BitBadgesSigningClient.d.ts +33 -0
- package/dist/cjs/signing/BitBadgesSigningClient.d.ts.map +1 -0
- package/dist/cjs/signing/BitBadgesSigningClient.js +292 -0
- package/dist/cjs/signing/BitBadgesSigningClient.js.map +1 -0
- package/dist/cjs/signing/BitBadgesSigningClient.spec.d.ts +2 -0
- package/dist/cjs/signing/BitBadgesSigningClient.spec.d.ts.map +1 -0
- package/dist/cjs/signing/BitBadgesSigningClient.spec.js +187 -0
- package/dist/cjs/signing/BitBadgesSigningClient.spec.js.map +1 -0
- package/dist/cjs/signing/adapters/GenericCosmosAdapter.d.ts +68 -0
- package/dist/cjs/signing/adapters/GenericCosmosAdapter.d.ts.map +1 -0
- package/dist/cjs/signing/adapters/GenericCosmosAdapter.js +183 -0
- package/dist/cjs/signing/adapters/GenericCosmosAdapter.js.map +1 -0
- package/dist/cjs/signing/adapters/GenericEvmAdapter.d.ts +47 -0
- package/dist/cjs/signing/adapters/GenericEvmAdapter.d.ts.map +1 -0
- package/dist/cjs/signing/adapters/GenericEvmAdapter.js +93 -0
- package/dist/cjs/signing/adapters/GenericEvmAdapter.js.map +1 -0
- package/dist/cjs/signing/adapters/WalletAdapter.d.ts +23 -0
- package/dist/cjs/signing/adapters/WalletAdapter.d.ts.map +1 -0
- package/dist/cjs/signing/adapters/WalletAdapter.js +16 -0
- package/dist/cjs/signing/adapters/WalletAdapter.js.map +1 -0
- package/dist/cjs/signing/adapters/index.d.ts +4 -0
- package/dist/cjs/signing/adapters/index.d.ts.map +1 -0
- package/dist/cjs/signing/adapters/index.js +10 -0
- package/dist/cjs/signing/adapters/index.js.map +1 -0
- package/dist/cjs/signing/index.d.ts +5 -0
- package/dist/cjs/signing/index.d.ts.map +1 -0
- package/dist/cjs/signing/index.js +12 -0
- package/dist/cjs/signing/index.js.map +1 -0
- package/dist/cjs/signing/types.d.ts +76 -0
- package/dist/cjs/signing/types.d.ts.map +1 -0
- package/dist/cjs/signing/types.js +24 -0
- package/dist/cjs/signing/types.js.map +1 -0
- package/dist/cjs/tsconfig.build.tsbuildinfo +1 -1
- package/dist/esm/api-indexer/BitBadgesApi.js +12 -12
- package/dist/esm/api-indexer/metadata/tokenMetadata.d.ts +4 -4
- package/dist/esm/api-indexer/metadata/tokenMetadata.d.ts.map +1 -1
- package/dist/esm/index.d.ts +1 -0
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +1 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/signing/BitBadgesSigningClient.d.ts +33 -0
- package/dist/esm/signing/BitBadgesSigningClient.d.ts.map +1 -0
- package/dist/esm/signing/BitBadgesSigningClient.js +294 -0
- package/dist/esm/signing/BitBadgesSigningClient.js.map +1 -0
- package/dist/esm/signing/BitBadgesSigningClient.spec.d.ts +2 -0
- package/dist/esm/signing/BitBadgesSigningClient.spec.d.ts.map +1 -0
- package/dist/esm/signing/BitBadgesSigningClient.spec.js +181 -0
- package/dist/esm/signing/BitBadgesSigningClient.spec.js.map +1 -0
- package/dist/esm/signing/adapters/GenericCosmosAdapter.d.ts +68 -0
- package/dist/esm/signing/adapters/GenericCosmosAdapter.d.ts.map +1 -0
- package/dist/esm/signing/adapters/GenericCosmosAdapter.js +156 -0
- package/dist/esm/signing/adapters/GenericCosmosAdapter.js.map +1 -0
- package/dist/esm/signing/adapters/GenericEvmAdapter.d.ts +47 -0
- package/dist/esm/signing/adapters/GenericEvmAdapter.d.ts.map +1 -0
- package/dist/esm/signing/adapters/GenericEvmAdapter.js +92 -0
- package/dist/esm/signing/adapters/GenericEvmAdapter.js.map +1 -0
- package/dist/esm/signing/adapters/WalletAdapter.d.ts +23 -0
- package/dist/esm/signing/adapters/WalletAdapter.d.ts.map +1 -0
- package/dist/esm/signing/adapters/WalletAdapter.js +12 -0
- package/dist/esm/signing/adapters/WalletAdapter.js.map +1 -0
- package/dist/esm/signing/adapters/index.d.ts +4 -0
- package/dist/esm/signing/adapters/index.d.ts.map +1 -0
- package/dist/esm/signing/adapters/index.js +4 -0
- package/dist/esm/signing/adapters/index.js.map +1 -0
- package/dist/esm/signing/index.d.ts +5 -0
- package/dist/esm/signing/index.d.ts.map +1 -0
- package/dist/esm/signing/index.js +4 -0
- package/dist/esm/signing/index.js.map +1 -0
- package/dist/esm/signing/types.d.ts +76 -0
- package/dist/esm/signing/types.d.ts.map +1 -0
- package/dist/esm/signing/types.js +21 -0
- package/dist/esm/signing/types.js.map +1 -0
- package/dist/esm/tsconfig-esm.build.tsbuildinfo +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,70 +1,281 @@
|
|
|
1
|
-
#
|
|
1
|
+
# BitBadges SDK
|
|
2
2
|
|
|
3
|
-
The
|
|
3
|
+
The official TypeScript SDK for interacting with the BitBadges blockchain, API, and indexer.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
[](https://www.npmjs.com/package/bitbadgesjs-sdk)
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
## Installation
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
```bash
|
|
10
|
+
npm install bitbadgesjs-sdk
|
|
11
|
+
# or
|
|
12
|
+
bun add bitbadgesjs-sdk
|
|
13
|
+
```
|
|
11
14
|
|
|
12
|
-
|
|
15
|
+
## Quick Start
|
|
13
16
|
|
|
14
|
-
|
|
17
|
+
### 1. Initialize the API Client
|
|
18
|
+
|
|
19
|
+
```typescript
|
|
20
|
+
import { BitBadgesAPI, BigIntify } from 'bitbadgesjs-sdk';
|
|
15
21
|
|
|
16
|
-
|
|
22
|
+
const api = new BitBadgesAPI({
|
|
23
|
+
convertFunction: BigIntify,
|
|
24
|
+
apiKey: 'your-api-key', // Get from https://bitbadges.io/developer
|
|
25
|
+
apiUrl: 'https://api.bitbadges.io' // Optional, defaults to production
|
|
26
|
+
});
|
|
27
|
+
```
|
|
17
28
|
|
|
18
|
-
|
|
19
|
-
| ----------------------- | ----------------- | ---------- |
|
|
20
|
-
| v12 | 0.18.x | ✅ Current |
|
|
21
|
-
| v13 | 0.19.x | ✅ Current |
|
|
22
|
-
| v14 | 0.20.x | ✅ Current |
|
|
23
|
-
| v15 | 0.20.x | ✅ Current |
|
|
24
|
-
| v16 | 0.21.x | ✅ Current |
|
|
25
|
-
| v18 | 0.23.x | ✅ Current |
|
|
26
|
-
| v19 | 0.24.x | ✅ Current |
|
|
27
|
-
| v20 | 0.25.x | ✅ Current |
|
|
28
|
-
| v21 | 0.26.x | ✅ Current |
|
|
29
|
-
| v22 | 0.27.x | ✅ Current |
|
|
30
|
-
| v23 | 0.28.x | ✅ Current |
|
|
29
|
+
### 2. Fetch a Collection
|
|
31
30
|
|
|
32
|
-
|
|
31
|
+
```typescript
|
|
32
|
+
const response = await api.getCollections({
|
|
33
|
+
collectionsToFetch: [
|
|
34
|
+
{
|
|
35
|
+
collectionId: '1',
|
|
36
|
+
metadataToFetch: {
|
|
37
|
+
tokenIds: [{ start: 1n, end: 10n }]
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
]
|
|
41
|
+
});
|
|
33
42
|
|
|
34
|
-
|
|
43
|
+
const collection = response.collections[0]?.collection;
|
|
44
|
+
console.log('Name:', collection?.collectionMetadataTimeline?.[0]?.collectionMetadata?.name);
|
|
45
|
+
```
|
|
35
46
|
|
|
36
|
-
###
|
|
47
|
+
### 3. Check a User's Balance
|
|
37
48
|
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
|
|
49
|
+
```typescript
|
|
50
|
+
const balance = await api.getBalanceByAddress(
|
|
51
|
+
'1', // collectionId
|
|
52
|
+
'bb1abc...', // address
|
|
53
|
+
{}
|
|
54
|
+
);
|
|
41
55
|
|
|
42
|
-
|
|
43
|
-
|
|
56
|
+
console.log('Token IDs:', balance.balances.map(b => b.badgeIds));
|
|
57
|
+
console.log('Amounts:', balance.balances.map(b => b.amount));
|
|
44
58
|
```
|
|
45
59
|
|
|
46
|
-
|
|
60
|
+
### 4. Get Token Activity
|
|
47
61
|
|
|
48
|
-
|
|
62
|
+
```typescript
|
|
63
|
+
const activity = await api.getTokenActivity('1', '1', { bookmark: '' });
|
|
64
|
+
|
|
65
|
+
for (const item of activity.activity) {
|
|
66
|
+
console.log(`${item.from} -> ${item.to}: ${item.balances}`);
|
|
67
|
+
}
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
## Browser vs Node.js Usage
|
|
71
|
+
|
|
72
|
+
The SDK works in both browser and Node.js environments. Environment detection is handled automatically.
|
|
73
|
+
|
|
74
|
+
### Node.js
|
|
49
75
|
|
|
50
76
|
```typescript
|
|
51
|
-
//
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
77
|
+
// API key can be set via environment variable
|
|
78
|
+
process.env.BITBADGES_API_KEY = 'your-api-key';
|
|
79
|
+
|
|
80
|
+
const api = new BitBadgesAPI({
|
|
81
|
+
convertFunction: BigIntify
|
|
82
|
+
// apiKey will be read from BITBADGES_API_KEY env var
|
|
83
|
+
});
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
### Browser
|
|
87
|
+
|
|
88
|
+
```typescript
|
|
89
|
+
// In browsers, you MUST pass the apiKey explicitly
|
|
90
|
+
const api = new BitBadgesAPI({
|
|
91
|
+
convertFunction: BigIntify,
|
|
92
|
+
apiKey: 'your-api-key' // Required in browser - no env var access
|
|
93
|
+
});
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
> **Note**: The SDK uses defensive checks (`typeof process !== 'undefined'`) to support both environments. No polyfills needed.
|
|
97
|
+
|
|
98
|
+
## Core Concepts
|
|
99
|
+
|
|
100
|
+
### Number Types
|
|
101
|
+
|
|
102
|
+
The SDK uses a flexible `NumberType` system supporting `bigint`, `number`, and `string` to handle large blockchain values safely.
|
|
103
|
+
|
|
104
|
+
```typescript
|
|
105
|
+
import { BigIntify, Stringify, Numberify } from 'bitbadgesjs-sdk';
|
|
106
|
+
|
|
107
|
+
// Always use BigIntify for large numbers (recommended)
|
|
108
|
+
const collectionId = BigIntify('12345678901234567890');
|
|
109
|
+
|
|
110
|
+
// Stringify for JSON serialization
|
|
111
|
+
const idString = Stringify(12345678901234567890n);
|
|
112
|
+
|
|
113
|
+
// Numberify only for small, safe integers
|
|
114
|
+
const smallNum = Numberify('100');
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
### Type System
|
|
118
|
+
|
|
119
|
+
The SDK has three type layers:
|
|
120
|
+
|
|
121
|
+
| Type | Example | Use Case |
|
|
122
|
+
|------|---------|----------|
|
|
123
|
+
| **Interface** (`iType`) | `iBalance<bigint>` | Type annotations, function parameters |
|
|
124
|
+
| **Class** | `Balance` | Most SDK operations - has utility methods |
|
|
125
|
+
| **Proto** | `proto.Balance` | Blockchain serialization (strings only) |
|
|
126
|
+
|
|
127
|
+
```typescript
|
|
128
|
+
import { Balance, UintRange } from 'bitbadgesjs-sdk';
|
|
129
|
+
|
|
130
|
+
// Create instances with classes
|
|
131
|
+
const balance = new Balance({
|
|
132
|
+
amount: 100n,
|
|
133
|
+
badgeIds: [{ start: 1n, end: 10n }],
|
|
134
|
+
ownershipTimes: [{ start: 1n, end: 1000n }]
|
|
135
|
+
});
|
|
136
|
+
|
|
137
|
+
// Convert between number types
|
|
138
|
+
const stringBalance = balance.convert(Stringify);
|
|
139
|
+
|
|
140
|
+
// Convert to proto for blockchain
|
|
141
|
+
const protoBalance = balance.toProto();
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
## Common Patterns
|
|
145
|
+
|
|
146
|
+
### Pagination
|
|
147
|
+
|
|
148
|
+
```typescript
|
|
149
|
+
let bookmark = '';
|
|
150
|
+
let hasMore = true;
|
|
151
|
+
|
|
152
|
+
while (hasMore) {
|
|
153
|
+
const response = await api.getTokenActivity('1', '1', { bookmark });
|
|
154
|
+
|
|
155
|
+
// Process results
|
|
156
|
+
console.log(response.activity);
|
|
157
|
+
|
|
158
|
+
// Get next page
|
|
159
|
+
hasMore = response.pagination.hasMore;
|
|
160
|
+
bookmark = response.pagination.bookmark;
|
|
161
|
+
}
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
### Error Handling
|
|
165
|
+
|
|
166
|
+
```typescript
|
|
167
|
+
try {
|
|
168
|
+
const response = await api.getCollections({ collectionsToFetch: [{ collectionId: '1' }] });
|
|
169
|
+
} catch (error) {
|
|
170
|
+
if (error.errorMessage) {
|
|
171
|
+
console.error('API Error:', error.errorMessage);
|
|
172
|
+
}
|
|
173
|
+
if (error.unauthorized) {
|
|
174
|
+
console.error('Authentication required');
|
|
175
|
+
}
|
|
59
176
|
}
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
### Address Utilities
|
|
180
|
+
|
|
181
|
+
```typescript
|
|
182
|
+
import { convertToBitBadgesAddress, isAddressValid } from 'bitbadgesjs-sdk';
|
|
183
|
+
|
|
184
|
+
// Validate a BitBadges address
|
|
185
|
+
const isValid = isAddressValid('bb1abc...');
|
|
186
|
+
|
|
187
|
+
// Convert to BitBadges format (bb-prefixed only)
|
|
188
|
+
const bbAddress = convertToBitBadgesAddress('bb1abc...');
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
## Module Structure
|
|
192
|
+
|
|
193
|
+
```
|
|
194
|
+
bitbadgesjs-sdk/
|
|
195
|
+
├── core/ # Balance, UintRange, Approvals, Permissions
|
|
196
|
+
├── api-indexer/ # BitBadgesAPI client and response types
|
|
197
|
+
├── transactions/ # Message builders (MsgTransferTokens, etc.)
|
|
198
|
+
├── address-converter/ # Address utilities
|
|
199
|
+
├── interfaces/ # TypeScript type definitions
|
|
200
|
+
├── proto/ # Protocol buffer types
|
|
201
|
+
├── common/ # Number conversion utilities
|
|
202
|
+
└── gamm/ # AMM pool utilities
|
|
203
|
+
```
|
|
60
204
|
|
|
61
|
-
|
|
62
|
-
const broadcastPost = await fetch(
|
|
63
|
-
broadcastEndpoint,
|
|
64
|
-
postOptions,
|
|
65
|
-
)
|
|
205
|
+
### Key Exports
|
|
66
206
|
|
|
67
|
-
|
|
207
|
+
```typescript
|
|
208
|
+
// API Client
|
|
209
|
+
import { BitBadgesAPI } from 'bitbadgesjs-sdk';
|
|
210
|
+
|
|
211
|
+
// Number Conversion
|
|
212
|
+
import { BigIntify, Stringify, Numberify } from 'bitbadgesjs-sdk';
|
|
213
|
+
|
|
214
|
+
// Core Classes
|
|
215
|
+
import { Balance, UintRange, Transfer, CollectionApproval } from 'bitbadgesjs-sdk';
|
|
216
|
+
|
|
217
|
+
// Address Utilities
|
|
218
|
+
import { convertToBitBadgesAddress, isAddressValid } from 'bitbadgesjs-sdk';
|
|
219
|
+
|
|
220
|
+
// Transaction Messages
|
|
221
|
+
import { MsgTransferTokens, MsgCreateCollection } from 'bitbadgesjs-sdk';
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
## Version Compatibility
|
|
225
|
+
|
|
226
|
+
| BitBadges Chain | SDK Version | Status |
|
|
227
|
+
|-----------------|-------------|--------|
|
|
228
|
+
| v25 | 0.30.x | Current |
|
|
229
|
+
| v24 | 0.29.x | Supported |
|
|
230
|
+
| v23 | 0.28.x | Supported |
|
|
231
|
+
| v22 | 0.27.x | Supported |
|
|
232
|
+
| v21 | 0.26.x | Supported |
|
|
233
|
+
| v20 | 0.25.x | Supported |
|
|
234
|
+
| v19 | 0.24.x | Supported |
|
|
235
|
+
| v18 | 0.23.x | Supported |
|
|
236
|
+
| v16 | 0.21.x | Supported |
|
|
237
|
+
| v14-15 | 0.20.x | Supported |
|
|
238
|
+
| v13 | 0.19.x | Supported |
|
|
239
|
+
| v12 | 0.18.x | Supported |
|
|
240
|
+
|
|
241
|
+
```bash
|
|
242
|
+
# Install specific version for your chain
|
|
243
|
+
npm install bitbadgesjs-sdk@^0.30.0
|
|
68
244
|
```
|
|
69
245
|
|
|
70
|
-
|
|
246
|
+
## Troubleshooting
|
|
247
|
+
|
|
248
|
+
### "BigInt is not defined"
|
|
249
|
+
Ensure you're running Node.js 10.4+ or a modern browser. BigInt is required.
|
|
250
|
+
|
|
251
|
+
### Precision loss with large numbers
|
|
252
|
+
Always use `BigIntify` instead of `Numberify` for collection IDs and token IDs.
|
|
253
|
+
|
|
254
|
+
### Browser: "process is not defined"
|
|
255
|
+
This shouldn't occur - the SDK checks for `process` existence. If it does, ensure you're using the latest SDK version.
|
|
256
|
+
|
|
257
|
+
### API authentication errors
|
|
258
|
+
- Verify your API key at https://bitbadges.io/developer
|
|
259
|
+
- In browsers, pass `apiKey` explicitly (env vars don't work)
|
|
260
|
+
- For authenticated endpoints, use `api.setAccessToken(token)`
|
|
261
|
+
|
|
262
|
+
### Transaction failures
|
|
263
|
+
1. Always simulate first: `await api.simulateTx(payload)`
|
|
264
|
+
2. Verify account has sufficient balance for fees
|
|
265
|
+
3. Check sequence number is correct
|
|
266
|
+
|
|
267
|
+
## Additional Resources
|
|
268
|
+
|
|
269
|
+
- **Detailed Patterns & Examples**: See [AI_AGENT_GUIDE.md](./AI_AGENT_GUIDE.md) for comprehensive patterns
|
|
270
|
+
- **API Documentation**: https://docs.bitbadges.io/for-developers/bitbadges-api/api
|
|
271
|
+
- **GitHub**: https://github.com/bitbadges/bitbadgesjs
|
|
272
|
+
- **Broadcast Helper**: https://bitbadges.io/dev/broadcast
|
|
273
|
+
|
|
274
|
+
### Reference Implementations
|
|
275
|
+
|
|
276
|
+
- [BitBadges Frontend](https://github.com/BitBadges/bitbadges-frontend) - Next.js web app
|
|
277
|
+
- [BitBadges Indexer](https://github.com/BitBadges/bitbadges-indexer) - Express.js API
|
|
278
|
+
|
|
279
|
+
## License
|
|
280
|
+
|
|
281
|
+
See [LICENSE](./LICENSE) for details.
|
|
@@ -6625,8 +6625,8 @@ class BitBadgesAdminAPI extends BitBadgesAPI {
|
|
|
6625
6625
|
if (undefined === value)
|
|
6626
6626
|
return true;
|
|
6627
6627
|
return "string" === typeof value;
|
|
6628
|
-
}); const _io3 = input => "string" === typeof input.type && "string" === typeof input.name && ("string" === typeof input.value || "number" === typeof input.value || "boolean" === typeof input.value); const _io4 = input => "string" === typeof input.name && "string" === typeof input.image && "string" === typeof input.description && (undefined === input.url || "string" === typeof input.url); const _io5 = input => Array.isArray(input.tokenIds) && input.tokenIds.every(elem => "object" === typeof elem && null !== elem && _io6(elem)) && (undefined === input.metadata || "object" === typeof input.metadata && null !== input.metadata && _io1(input.metadata)) && "string" === typeof input.uri && (undefined === input.fetchedUri || "string" === typeof input.fetchedUri) && "string" === typeof input.customData && (undefined === input.toUploadToIpfs || "boolean" === typeof input.toUploadToIpfs); const _io6 = input => ("string" === typeof input.start || "number" === typeof input.start || "bigint" === typeof input.start) && ("string" === typeof input.end || "number" === typeof input.end || "bigint" === typeof input.end); const _io7 = input => (undefined === input.metadata || "object" === typeof input.metadata && null !== input.metadata && _io1(input.metadata)) && "string" === typeof input.uri && (undefined === input.fetchedUri || "string" === typeof input.fetchedUri) && "string" === typeof input.customData && (undefined === input.toUploadToIpfs || "boolean" === typeof input.toUploadToIpfs); const _io8 = input => Array.isArray(input.leaves) && input.leaves.every(elem => "string" === typeof elem) && "boolean" === typeof input.isHashed && (undefined === input.preimages || Array.isArray(input.preimages) && input.preimages.every(elem => "string" === typeof elem)) && (undefined === input.seedCode || "string" === typeof input.seedCode) && (undefined === input.tree || "object" === typeof input.tree && null !== input.tree && false === Array.isArray(input.tree) && _io9(input.tree)) && (undefined === input.treeOptions || "object" === typeof input.treeOptions && null !== input.treeOptions && false === Array.isArray(input.treeOptions) && _io10(input.treeOptions)) && (undefined === input.numLeaves || "string" === typeof input.numLeaves || "number" === typeof input.numLeaves || "bigint" === typeof input.numLeaves) && (undefined === input.currCode || "string" === typeof input.currCode || "number" === typeof input.currCode || "bigint" === typeof input.currCode); const _io9 = input => true; const _io10 = input => (undefined === input.duplicateOdd || "boolean" === typeof input.duplicateOdd) && (undefined === input.hashLeaves || "boolean" === typeof input.hashLeaves) && (undefined === input.isBitcoinTree || "boolean" === typeof input.isBitcoinTree) && (undefined === input.sortLeaves || "boolean" === typeof input.sortLeaves) && (undefined === input.sortPairs || "boolean" === typeof input.sortPairs) && (undefined === input.sort || "boolean" === typeof input.sort) && (null !== input.fillDefaultHash && (undefined === input.fillDefaultHash || "function" === typeof input.fillDefaultHash || "string" === typeof input.fillDefaultHash || "object" === typeof input.fillDefaultHash && null !== input.fillDefaultHash && _io11(input.fillDefaultHash))) && (undefined === input.complete || "boolean" === typeof input.complete) && (undefined === input.concatenator || true); const _io11 = input => "number" === typeof input.BYTES_PER_ELEMENT && (input.buffer instanceof ArrayBuffer || input.buffer instanceof SharedArrayBuffer) && "number" === typeof input.byteLength && "number" === typeof input.byteOffset && "number" === typeof input.length && "Uint8Array" === input["__@toStringTag@
|
|
6629
|
-
if (["BYTES_PER_ELEMENT", "buffer", "byteLength", "byteOffset", "length", "__@toStringTag@
|
|
6628
|
+
}); const _io3 = input => "string" === typeof input.type && "string" === typeof input.name && ("string" === typeof input.value || "number" === typeof input.value || "boolean" === typeof input.value); const _io4 = input => "string" === typeof input.name && "string" === typeof input.image && "string" === typeof input.description && (undefined === input.url || "string" === typeof input.url); const _io5 = input => Array.isArray(input.tokenIds) && input.tokenIds.every(elem => "object" === typeof elem && null !== elem && _io6(elem)) && (undefined === input.metadata || "object" === typeof input.metadata && null !== input.metadata && _io1(input.metadata)) && "string" === typeof input.uri && (undefined === input.fetchedUri || "string" === typeof input.fetchedUri) && "string" === typeof input.customData && (undefined === input.toUploadToIpfs || "boolean" === typeof input.toUploadToIpfs); const _io6 = input => ("string" === typeof input.start || "number" === typeof input.start || "bigint" === typeof input.start) && ("string" === typeof input.end || "number" === typeof input.end || "bigint" === typeof input.end); const _io7 = input => (undefined === input.metadata || "object" === typeof input.metadata && null !== input.metadata && _io1(input.metadata)) && "string" === typeof input.uri && (undefined === input.fetchedUri || "string" === typeof input.fetchedUri) && "string" === typeof input.customData && (undefined === input.toUploadToIpfs || "boolean" === typeof input.toUploadToIpfs); const _io8 = input => Array.isArray(input.leaves) && input.leaves.every(elem => "string" === typeof elem) && "boolean" === typeof input.isHashed && (undefined === input.preimages || Array.isArray(input.preimages) && input.preimages.every(elem => "string" === typeof elem)) && (undefined === input.seedCode || "string" === typeof input.seedCode) && (undefined === input.tree || "object" === typeof input.tree && null !== input.tree && false === Array.isArray(input.tree) && _io9(input.tree)) && (undefined === input.treeOptions || "object" === typeof input.treeOptions && null !== input.treeOptions && false === Array.isArray(input.treeOptions) && _io10(input.treeOptions)) && (undefined === input.numLeaves || "string" === typeof input.numLeaves || "number" === typeof input.numLeaves || "bigint" === typeof input.numLeaves) && (undefined === input.currCode || "string" === typeof input.currCode || "number" === typeof input.currCode || "bigint" === typeof input.currCode); const _io9 = input => true; const _io10 = input => (undefined === input.duplicateOdd || "boolean" === typeof input.duplicateOdd) && (undefined === input.hashLeaves || "boolean" === typeof input.hashLeaves) && (undefined === input.isBitcoinTree || "boolean" === typeof input.isBitcoinTree) && (undefined === input.sortLeaves || "boolean" === typeof input.sortLeaves) && (undefined === input.sortPairs || "boolean" === typeof input.sortPairs) && (undefined === input.sort || "boolean" === typeof input.sort) && (null !== input.fillDefaultHash && (undefined === input.fillDefaultHash || "function" === typeof input.fillDefaultHash || "string" === typeof input.fillDefaultHash || "object" === typeof input.fillDefaultHash && null !== input.fillDefaultHash && _io11(input.fillDefaultHash))) && (undefined === input.complete || "boolean" === typeof input.complete) && (undefined === input.concatenator || true); const _io11 = input => "number" === typeof input.BYTES_PER_ELEMENT && (input.buffer instanceof ArrayBuffer || input.buffer instanceof SharedArrayBuffer) && "number" === typeof input.byteLength && "number" === typeof input.byteOffset && "number" === typeof input.length && "Uint8Array" === input["__@toStringTag@82"] && Object.keys(input).every(key => {
|
|
6629
|
+
if (["BYTES_PER_ELEMENT", "buffer", "byteLength", "byteOffset", "length", "__@toStringTag@82"].some(prop => key === prop))
|
|
6630
6630
|
return true;
|
|
6631
6631
|
const value = input[key];
|
|
6632
6632
|
if (undefined === value)
|
|
@@ -6980,12 +6980,12 @@ class BitBadgesAdminAPI extends BitBadgesAPI {
|
|
|
6980
6980
|
path: _path + ".length",
|
|
6981
6981
|
expected: "number",
|
|
6982
6982
|
value: input.length
|
|
6983
|
-
}), "Uint8Array" === input["__@toStringTag@
|
|
6984
|
-
path: _path + "[\"__@toStringTag@
|
|
6983
|
+
}), "Uint8Array" === input["__@toStringTag@82"] || _report(_exceptionable, {
|
|
6984
|
+
path: _path + "[\"__@toStringTag@82\"]",
|
|
6985
6985
|
expected: "\"Uint8Array\"",
|
|
6986
|
-
value: input["__@toStringTag@
|
|
6986
|
+
value: input["__@toStringTag@82"]
|
|
6987
6987
|
}), false === _exceptionable || Object.keys(input).map(key => {
|
|
6988
|
-
if (["BYTES_PER_ELEMENT", "buffer", "byteLength", "byteOffset", "length", "__@toStringTag@
|
|
6988
|
+
if (["BYTES_PER_ELEMENT", "buffer", "byteLength", "byteOffset", "length", "__@toStringTag@82"].some(prop => key === prop))
|
|
6989
6989
|
return true;
|
|
6990
6990
|
const value = input[key];
|
|
6991
6991
|
if (undefined === value)
|
|
@@ -7047,8 +7047,8 @@ class BitBadgesAdminAPI extends BitBadgesAPI {
|
|
|
7047
7047
|
}
|
|
7048
7048
|
async addApprovalDetailsToOffChainStorage(payload) {
|
|
7049
7049
|
try {
|
|
7050
|
-
const validateRes = (() => { const _io0 = input => Array.isArray(input.approvalDetails) && input.approvalDetails.every(elem => "object" === typeof elem && null !== elem && _io1(elem)); const _io1 = input => "string" === typeof input.name && "string" === typeof input.description && "string" === typeof input.image && (undefined === input.challengeInfoDetails || Array.isArray(input.challengeInfoDetails) && input.challengeInfoDetails.every(elem => "object" === typeof elem && null !== elem && _io2(elem))); const _io2 = input => "object" === typeof input.challengeDetails && null !== input.challengeDetails && _io3(input.challengeDetails) && (undefined === input.claim || "object" === typeof input.claim && null !== input.claim && _io7(input.claim)); const _io3 = input => Array.isArray(input.leaves) && input.leaves.every(elem => "string" === typeof elem) && "boolean" === typeof input.isHashed && (undefined === input.preimages || Array.isArray(input.preimages) && input.preimages.every(elem => "string" === typeof elem)) && (undefined === input.seedCode || "string" === typeof input.seedCode) && (undefined === input.tree || "object" === typeof input.tree && null !== input.tree && false === Array.isArray(input.tree) && _io4(input.tree)) && (undefined === input.treeOptions || "object" === typeof input.treeOptions && null !== input.treeOptions && false === Array.isArray(input.treeOptions) && _io5(input.treeOptions)) && (undefined === input.numLeaves || "string" === typeof input.numLeaves || "number" === typeof input.numLeaves || "bigint" === typeof input.numLeaves) && (undefined === input.currCode || "string" === typeof input.currCode || "number" === typeof input.currCode || "bigint" === typeof input.currCode); const _io4 = input => true; const _io5 = input => (undefined === input.duplicateOdd || "boolean" === typeof input.duplicateOdd) && (undefined === input.hashLeaves || "boolean" === typeof input.hashLeaves) && (undefined === input.isBitcoinTree || "boolean" === typeof input.isBitcoinTree) && (undefined === input.sortLeaves || "boolean" === typeof input.sortLeaves) && (undefined === input.sortPairs || "boolean" === typeof input.sortPairs) && (undefined === input.sort || "boolean" === typeof input.sort) && (null !== input.fillDefaultHash && (undefined === input.fillDefaultHash || "function" === typeof input.fillDefaultHash || "string" === typeof input.fillDefaultHash || "object" === typeof input.fillDefaultHash && null !== input.fillDefaultHash && _io6(input.fillDefaultHash))) && (undefined === input.complete || "boolean" === typeof input.complete) && (undefined === input.concatenator || true); const _io6 = input => "number" === typeof input.BYTES_PER_ELEMENT && (input.buffer instanceof ArrayBuffer || input.buffer instanceof SharedArrayBuffer) && "number" === typeof input.byteLength && "number" === typeof input.byteOffset && "number" === typeof input.length && "Uint8Array" === input["__@toStringTag@
|
|
7051
|
-
if (["BYTES_PER_ELEMENT", "buffer", "byteLength", "byteOffset", "length", "__@toStringTag@
|
|
7050
|
+
const validateRes = (() => { const _io0 = input => Array.isArray(input.approvalDetails) && input.approvalDetails.every(elem => "object" === typeof elem && null !== elem && _io1(elem)); const _io1 = input => "string" === typeof input.name && "string" === typeof input.description && "string" === typeof input.image && (undefined === input.challengeInfoDetails || Array.isArray(input.challengeInfoDetails) && input.challengeInfoDetails.every(elem => "object" === typeof elem && null !== elem && _io2(elem))); const _io2 = input => "object" === typeof input.challengeDetails && null !== input.challengeDetails && _io3(input.challengeDetails) && (undefined === input.claim || "object" === typeof input.claim && null !== input.claim && _io7(input.claim)); const _io3 = input => Array.isArray(input.leaves) && input.leaves.every(elem => "string" === typeof elem) && "boolean" === typeof input.isHashed && (undefined === input.preimages || Array.isArray(input.preimages) && input.preimages.every(elem => "string" === typeof elem)) && (undefined === input.seedCode || "string" === typeof input.seedCode) && (undefined === input.tree || "object" === typeof input.tree && null !== input.tree && false === Array.isArray(input.tree) && _io4(input.tree)) && (undefined === input.treeOptions || "object" === typeof input.treeOptions && null !== input.treeOptions && false === Array.isArray(input.treeOptions) && _io5(input.treeOptions)) && (undefined === input.numLeaves || "string" === typeof input.numLeaves || "number" === typeof input.numLeaves || "bigint" === typeof input.numLeaves) && (undefined === input.currCode || "string" === typeof input.currCode || "number" === typeof input.currCode || "bigint" === typeof input.currCode); const _io4 = input => true; const _io5 = input => (undefined === input.duplicateOdd || "boolean" === typeof input.duplicateOdd) && (undefined === input.hashLeaves || "boolean" === typeof input.hashLeaves) && (undefined === input.isBitcoinTree || "boolean" === typeof input.isBitcoinTree) && (undefined === input.sortLeaves || "boolean" === typeof input.sortLeaves) && (undefined === input.sortPairs || "boolean" === typeof input.sortPairs) && (undefined === input.sort || "boolean" === typeof input.sort) && (null !== input.fillDefaultHash && (undefined === input.fillDefaultHash || "function" === typeof input.fillDefaultHash || "string" === typeof input.fillDefaultHash || "object" === typeof input.fillDefaultHash && null !== input.fillDefaultHash && _io6(input.fillDefaultHash))) && (undefined === input.complete || "boolean" === typeof input.complete) && (undefined === input.concatenator || true); const _io6 = input => "number" === typeof input.BYTES_PER_ELEMENT && (input.buffer instanceof ArrayBuffer || input.buffer instanceof SharedArrayBuffer) && "number" === typeof input.byteLength && "number" === typeof input.byteOffset && "number" === typeof input.length && "Uint8Array" === input["__@toStringTag@82"] && Object.keys(input).every(key => {
|
|
7051
|
+
if (["BYTES_PER_ELEMENT", "buffer", "byteLength", "byteOffset", "length", "__@toStringTag@82"].some(prop => key === prop))
|
|
7052
7052
|
return true;
|
|
7053
7053
|
const value = input[key];
|
|
7054
7054
|
if (undefined === value)
|
|
@@ -7251,12 +7251,12 @@ class BitBadgesAdminAPI extends BitBadgesAPI {
|
|
|
7251
7251
|
path: _path + ".length",
|
|
7252
7252
|
expected: "number",
|
|
7253
7253
|
value: input.length
|
|
7254
|
-
}), "Uint8Array" === input["__@toStringTag@
|
|
7255
|
-
path: _path + "[\"__@toStringTag@
|
|
7254
|
+
}), "Uint8Array" === input["__@toStringTag@82"] || _report(_exceptionable, {
|
|
7255
|
+
path: _path + "[\"__@toStringTag@82\"]",
|
|
7256
7256
|
expected: "\"Uint8Array\"",
|
|
7257
|
-
value: input["__@toStringTag@
|
|
7257
|
+
value: input["__@toStringTag@82"]
|
|
7258
7258
|
}), false === _exceptionable || Object.keys(input).map(key => {
|
|
7259
|
-
if (["BYTES_PER_ELEMENT", "buffer", "byteLength", "byteOffset", "length", "__@toStringTag@
|
|
7259
|
+
if (["BYTES_PER_ELEMENT", "buffer", "byteLength", "byteOffset", "length", "__@toStringTag@82"].some(prop => key === prop))
|
|
7260
7260
|
return true;
|
|
7261
7261
|
const value = input[key];
|
|
7262
7262
|
if (undefined === value)
|
|
@@ -41,12 +41,12 @@ export declare class TokenMetadataDetails<T extends NumberType> extends BaseNumb
|
|
|
41
41
|
constructor(data: iTokenMetadataDetails<T>);
|
|
42
42
|
getNumberFieldNames(): string[];
|
|
43
43
|
convert<U extends NumberType>(convertFunction: (item: NumberType) => U, options?: ConvertOptions): TokenMetadataDetails<U>;
|
|
44
|
-
static removeTokenMetadata: <
|
|
45
|
-
static updateTokenMetadata: <
|
|
46
|
-
static batchUpdateTokenMetadata: <
|
|
44
|
+
static removeTokenMetadata: <T extends NumberType>(currTokenMetadata: TokenMetadataDetails<T_1>[], tokenIds: UintRange<T_1>[]) => TokenMetadataDetails<T_1>[];
|
|
45
|
+
static updateTokenMetadata: <T extends NumberType>(currTokenMetadata: TokenMetadataDetails<T_1>[], newTokenMetadataDetails: TokenMetadataDetails<T_1>) => TokenMetadataDetails<T_1>[];
|
|
46
|
+
static batchUpdateTokenMetadata: <T extends NumberType>(currTokenMetadata: TokenMetadataDetails<T_1>[], newTokenMetadataDetailsArr: TokenMetadataDetails<T_1>[]) => TokenMetadataDetails<T_1>[];
|
|
47
47
|
static getMetadataDetailsForTokenId<T extends NumberType>(tokenId: T, metadataArr: TokenMetadataDetails<T>[]): TokenMetadataDetails<T> | undefined;
|
|
48
48
|
static getMetadataForTokenId<T extends NumberType>(tokenId: T, metadataArr: TokenMetadataDetails<T>[]): Metadata<T> | undefined;
|
|
49
|
-
static setMetadataPropertyForSpecificIds: <
|
|
49
|
+
static setMetadataPropertyForSpecificIds: <T extends NumberType>(metadataArr: TokenMetadataDetails<T_1>[], tokenIds: UintRange<T_1>[], key: string, value: any) => TokenMetadataDetails<T_1>[];
|
|
50
50
|
toProto(): prototokenization.TokenMetadata;
|
|
51
51
|
}
|
|
52
52
|
//# sourceMappingURL=tokenMetadata.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tokenMetadata.d.ts","sourceRoot":"","sources":["../../../../src/api-indexer/metadata/tokenMetadata.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAgD,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAErH,OAAO,EAAa,KAAK,UAAU,EAAE,MAAM,4BAA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AAE,OAAO,EAAE,CAAC,EAAE,WAAW,EAAE,oBAAoB,CAAC,CAAC,CAAC,EAAE,GAAG,oBAAoB,CAAC,CAAC,CAAC,GAAG,SAAS;IAiBlJ,MAAM,CAAC,qBAAqB,CAAC,CAAC,SAAS,UAAU,EAAE,OAAO,EAAE,CAAC,EAAE,WAAW,EAAE,oBAAoB,CAAC,CAAC,CAAC,EAAE;IAcrG,MAAM,CAAC,iCAAiC,GAAI,CAAC,SAAS,UAAU,EAC9D,aAAa,oBAAoB,CAAC,GAAC,CAAC,EAAE,EACtC,UAAU,SAAS,CAAC,GAAC,CAAC,EAAE,EACxB,KAAK,MAAM,EACX,OAAO,GAAG,iCA+CV;IAEF,OAAO,IAAI,iBAAiB,CAAC,aAAa;CAG3C"}
|
package/dist/cjs/index.d.ts
CHANGED
package/dist/cjs/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,MAAM,IAAI,MAAM,CAAC;KAClB;CACF;AAaD,cAAc,iBAAiB,CAAC;AAChC,cAAc,wBAAwB,CAAC;AACvC,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,OAAO,KAAK,KAAK,MAAM,kBAAkB,CAAC;AAC1C,cAAc,kBAAkB,CAAC;AAEjC,cAAc,yBAAyB,CAAC;AACxC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,0BAA0B,CAAC;AACzC,cAAc,iBAAiB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,MAAM,IAAI,MAAM,CAAC;KAClB;CACF;AAaD,cAAc,iBAAiB,CAAC;AAChC,cAAc,wBAAwB,CAAC;AACvC,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,OAAO,KAAK,KAAK,MAAM,kBAAkB,CAAC;AAC1C,cAAc,kBAAkB,CAAC;AAEjC,cAAc,yBAAyB,CAAC;AACxC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,0BAA0B,CAAC;AACzC,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC"}
|
package/dist/cjs/index.js
CHANGED
|
@@ -55,4 +55,5 @@ __exportStar(require("./transactions/index.js"), exports);
|
|
|
55
55
|
__exportStar(require("./address-converter/index.js"), exports);
|
|
56
56
|
__exportStar(require("./node-rest-api/index.js"), exports);
|
|
57
57
|
__exportStar(require("./gamm/index.js"), exports);
|
|
58
|
+
__exportStar(require("./signing/index.js"), exports);
|
|
58
59
|
//# sourceMappingURL=index.js.map
|
package/dist/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA,MAAM,CAAC,SAAS,CAAC,MAAM,GAAG;IACxB,OAAO,IAAI,CAAC,QAAQ,EAAE,CAAC;AACzB,CAAC,CAAC;AAGF,IAAI,OAAO,OAAO,KAAK,WAAW,EAAE,CAAC;AAErC,CAAC;KAAM,CAAC;IACN,OAAO,CAAC,GAAG,CAAC,mBAAmB,GAAG,MAAM,CAAC;AAC3C,CAAC;AAED,kDAAgC;AAChC,yDAAuC;AACvC,oDAAkC;AAClC,wDAAsC;AACtC,0DAA0C;AAC1C,mDAAiC;AAEjC,0DAAwC;AACxC,+DAA6C;AAC7C,2DAAyC;AACzC,kDAAgC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA,MAAM,CAAC,SAAS,CAAC,MAAM,GAAG;IACxB,OAAO,IAAI,CAAC,QAAQ,EAAE,CAAC;AACzB,CAAC,CAAC;AAGF,IAAI,OAAO,OAAO,KAAK,WAAW,EAAE,CAAC;AAErC,CAAC;KAAM,CAAC;IACN,OAAO,CAAC,GAAG,CAAC,mBAAmB,GAAG,MAAM,CAAC;AAC3C,CAAC;AAED,kDAAgC;AAChC,yDAAuC;AACvC,oDAAkC;AAClC,wDAAsC;AACtC,0DAA0C;AAC1C,mDAAiC;AAEjC,0DAAwC;AACxC,+DAA6C;AAC7C,2DAAyC;AACzC,kDAAgC;AAChC,qDAAmC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { type AccountInfo, type BroadcastResult, type NetworkConfig, type SignAndBroadcastOptions, type SigningClientOptions, type SimulateResult, type TransactionMessage } from './types.js';
|
|
2
|
+
export declare class BitBadgesSigningClient {
|
|
3
|
+
private readonly adapter;
|
|
4
|
+
private readonly networkConfig;
|
|
5
|
+
private readonly sequenceRetryEnabled;
|
|
6
|
+
private readonly maxSequenceRetries;
|
|
7
|
+
private readonly gasMultiplier;
|
|
8
|
+
private readonly defaultGasLimit;
|
|
9
|
+
private readonly evmPrecompileGasLimit;
|
|
10
|
+
private readonly apiKey?;
|
|
11
|
+
private readonly axiosInstance;
|
|
12
|
+
private cachedAccountInfo;
|
|
13
|
+
constructor(options: SigningClientOptions);
|
|
14
|
+
get config(): NetworkConfig;
|
|
15
|
+
get address(): string;
|
|
16
|
+
get chainType(): 'cosmos' | 'evm';
|
|
17
|
+
private get chainId();
|
|
18
|
+
get evmChainId(): number;
|
|
19
|
+
private get nodeUrl();
|
|
20
|
+
private get apiUrl();
|
|
21
|
+
getAccountInfo(forceRefresh?: boolean): Promise<AccountInfo>;
|
|
22
|
+
clearCache(): void;
|
|
23
|
+
private calculateFee;
|
|
24
|
+
simulate(messages: TransactionMessage[], options?: {
|
|
25
|
+
memo?: string;
|
|
26
|
+
}): Promise<SimulateResult>;
|
|
27
|
+
private normalizeMessages;
|
|
28
|
+
signAndBroadcast(messages: TransactionMessage[], options?: SignAndBroadcastOptions): Promise<BroadcastResult>;
|
|
29
|
+
private signAndBroadcastCosmos;
|
|
30
|
+
private isSequenceMismatchError;
|
|
31
|
+
private signAndBroadcastEvm;
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=BitBadgesSigningClient.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BitBadgesSigningClient.d.ts","sourceRoot":"","sources":["../../../src/signing/BitBadgesSigningClient.ts"],"names":[],"mappings":"AAOA,OAAO,EAEL,KAAK,WAAW,EAChB,KAAK,eAAe,EACpB,KAAK,aAAa,EAElB,KAAK,uBAAuB,EAC5B,KAAK,oBAAoB,EACzB,KAAK,cAAc,EACnB,KAAK,kBAAkB,EACxB,MAAM,YAAY,CAAC;AA2CpB,qBAAa,sBAAsB;IACjC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAgB;IACxC,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAgB;IAC9C,OAAO,CAAC,QAAQ,CAAC,oBAAoB,CAAU;IAC/C,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAAS;IAC5C,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAS;IACvC,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAS;IACzC,OAAO,CAAC,QAAQ,CAAC,qBAAqB,CAAS;IAC/C,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAS;IACjC,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAgB;IAG9C,OAAO,CAAC,iBAAiB,CAA4B;gBAQzC,OAAO,EAAE,oBAAoB;IAiCzC,IAAI,MAAM,IAAI,aAAa,CAE1B;IAKD,IAAI,OAAO,IAAI,MAAM,CAOpB;IAKD,IAAI,SAAS,IAAI,QAAQ,GAAG,KAAK,CAEhC;IAKD,OAAO,KAAK,OAAO,GAElB;IAKD,IAAI,UAAU,IAAI,MAAM,CAEvB;IAKD,OAAO,KAAK,OAAO,GAElB;IA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