@pooflabs/core 0.0.11 → 0.0.13

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/types.d.ts CHANGED
@@ -44,3 +44,23 @@ export interface SubscriptionOptions {
44
44
  export type TransactionOptions = {
45
45
  shouldSubmit?: boolean;
46
46
  };
47
+ export interface OffchainInstruction {
48
+ type: 'set' | 'delete';
49
+ path: string;
50
+ data?: Record<string, any>;
51
+ }
52
+ export interface OffchainTransaction {
53
+ id: string;
54
+ version: 1;
55
+ feePayer: string;
56
+ instructions: OffchainInstruction[];
57
+ message: string;
58
+ createdAt: number;
59
+ expiresAt: number;
60
+ appId: string;
61
+ nonce: string;
62
+ }
63
+ export interface SignedOffchainTransaction {
64
+ transaction: OffchainTransaction;
65
+ signature: string;
66
+ }
@@ -1,6 +1,7 @@
1
1
  declare global {
2
2
  interface Window {
3
3
  CUSTOM_TAROBASE_APP_ID_HEADER?: string;
4
+ TAROBASE_SUPPORTS_OFFCHAIN_SIGNING?: boolean;
4
5
  }
5
6
  }
6
7
  export declare function makeApiRequest(method: string, urlPath: string, data?: any, _overrides?: {
@@ -688,6 +688,74 @@ export type Tarobase = {
688
688
  }
689
689
  ];
690
690
  },
691
+ {
692
+ "name": "executeQueryStandalone";
693
+ "docs": [
694
+ "Executes a standalone query without requiring GenericPathExecutionData account.",
695
+ "",
696
+ "READONLY INSTRUCTION. This instruction executes a query for plugin functions",
697
+ "from offchain collections. It creates a minimal in-memory GenericPathExecutionData",
698
+ "struct with the provided parameters.",
699
+ "",
700
+ "# Arguments",
701
+ "* `ctx` - The context containing all accounts needed for this instruction",
702
+ "* `bytecode` - The bytecode for the query",
703
+ "* `app_id` - The identifier of the Tarobase application",
704
+ "* `document_input` - The input document for the query i.e what @newData points to",
705
+ "* `simulate` - Whether to simulate the query to extract the remaining accounts needed for the query",
706
+ "* `user_address` - The address of the user executing the query",
707
+ "* `string_literal_map` - The string literals used in the bytecode (fieldPoolArray)"
708
+ ];
709
+ "discriminator": [
710
+ 4,
711
+ 142,
712
+ 253,
713
+ 188,
714
+ 216,
715
+ 143,
716
+ 109,
717
+ 19
718
+ ];
719
+ "accounts": [
720
+ {
721
+ "name": "payer";
722
+ "writable": true;
723
+ "signer": true;
724
+ }
725
+ ];
726
+ "args": [
727
+ {
728
+ "name": "bytecode";
729
+ "type": "bytes";
730
+ },
731
+ {
732
+ "name": "appId";
733
+ "type": "string";
734
+ },
735
+ {
736
+ "name": "documentInput";
737
+ "type": {
738
+ "defined": {
739
+ "name": "setDocumentData";
740
+ };
741
+ };
742
+ },
743
+ {
744
+ "name": "simulate";
745
+ "type": "bool";
746
+ },
747
+ {
748
+ "name": "userAddress";
749
+ "type": "pubkey";
750
+ },
751
+ {
752
+ "name": "stringLiteralMap";
753
+ "type": {
754
+ "vec": "string";
755
+ };
756
+ }
757
+ ];
758
+ },
691
759
  {
692
760
  "name": "finishBytecodeStream";
693
761
  "docs": [
@@ -1285,138 +1353,143 @@ export type Tarobase = {
1285
1353
  "errors": [
1286
1354
  {
1287
1355
  "code": 6000;
1288
- "name": "invalidAccountLength";
1289
- "msg": "The number of provided new accounts does not match the number of documents.";
1356
+ "name": "missingTypeTag";
1357
+ "msg": "Missing type tag for literal";
1290
1358
  },
1291
1359
  {
1292
1360
  "code": 6001;
1293
- "name": "invalidPda";
1294
- "msg": "The provided account does not match the expected PDA.";
1361
+ "name": "notEnoughBytes";
1362
+ "msg": "Not enough bytes";
1295
1363
  },
1296
1364
  {
1297
1365
  "code": 6002;
1298
- "name": "simulate2";
1299
- "msg": "Simulate mode.";
1366
+ "name": "invalidFieldId";
1367
+ "msg": "Invalid field ID";
1300
1368
  },
1301
1369
  {
1302
1370
  "code": 6003;
1303
- "name": "accountTooLarge";
1304
- "msg": "The account size would exceed the maximum allowed size of 10240 bytes.";
1371
+ "name": "stackUnderflow";
1372
+ "msg": "Stack underflow";
1305
1373
  },
1306
1374
  {
1307
1375
  "code": 6004;
1308
- "name": "pathInBothDeleteAndUpdate";
1309
- "msg": "The same path cannot appear in both delete_paths and documents";
1376
+ "name": "typeMismatch";
1377
+ "msg": "Type mismatch in operation";
1310
1378
  },
1311
1379
  {
1312
1380
  "code": 6005;
1313
- "name": "invalidOperation";
1314
- "msg": "Invalid operation.";
1381
+ "name": "invalidArgument";
1382
+ "msg": "Invalid argument";
1315
1383
  },
1316
1384
  {
1317
1385
  "code": 6006;
1318
- "name": "missingRequiredFields";
1319
- "msg": "Missing required fields.";
1386
+ "name": "invalidConversion";
1387
+ "msg": "Invalid conversion";
1320
1388
  },
1321
1389
  {
1322
1390
  "code": 6007;
1323
- "name": "fieldAlreadyExists";
1324
- "msg": "The same field cannot appear in more than one operation.";
1391
+ "name": "unknownLiteralType";
1392
+ "msg": "Unknown literal type";
1325
1393
  },
1326
1394
  {
1327
1395
  "code": 6008;
1328
- "name": "fieldReadOnly";
1329
- "msg": "The field is read only.";
1396
+ "name": "invalidOpcode";
1397
+ "msg": "Invalid opcode";
1330
1398
  },
1331
1399
  {
1332
1400
  "code": 6009;
1333
- "name": "invalidFieldType";
1334
- "msg": "The provided field is not of the expected type.";
1401
+ "name": "invalidTimeTag";
1402
+ "msg": "Invalid time tag";
1335
1403
  },
1336
1404
  {
1337
1405
  "code": 6010;
1338
- "name": "unsupportedOperation";
1339
- "msg": "The provided option is not supported.";
1406
+ "name": "functionNotImplemented";
1407
+ "msg": "Function not implemented";
1340
1408
  },
1341
1409
  {
1342
1410
  "code": 6011;
1343
- "name": "invalidIncrementType";
1344
- "msg": "The increment type is invalid.";
1411
+ "name": "invalidFunctionType";
1412
+ "msg": "Invalid function type";
1345
1413
  },
1346
1414
  {
1347
1415
  "code": 6012;
1348
- "name": "invalidType";
1349
- "msg": "The type is invalid.";
1416
+ "name": "invalidFieldType";
1417
+ "msg": "Invalid field type";
1350
1418
  },
1351
1419
  {
1352
1420
  "code": 6013;
1353
- "name": "missingValue";
1354
- "msg": "The value is missing.";
1421
+ "name": "missingSystemProgram";
1422
+ "msg": "Missing or invalid system program in accounts";
1355
1423
  },
1356
1424
  {
1357
1425
  "code": 6014;
1358
- "name": "invalidTypeForTimestamp";
1359
- "msg": "The type is invalid for timestamp.";
1426
+ "name": "missingTokenProgram";
1427
+ "msg": "Missing or invalid token program in accounts";
1360
1428
  },
1361
1429
  {
1362
1430
  "code": 6015;
1363
- "name": "fieldNotFound";
1364
- "msg": "The field was not found.";
1431
+ "name": "missingSourceWallet";
1432
+ "msg": "Missing or invalid source wallet account in accounts (for signing)";
1365
1433
  },
1366
1434
  {
1367
1435
  "code": 6016;
1368
- "name": "documentDataMissingFromMap";
1369
- "msg": "The document data was missing from the map.";
1436
+ "name": "missingDestWallet";
1437
+ "msg": "Missing or invalid destination wallet account in accounts (for signing)";
1370
1438
  },
1371
1439
  {
1372
1440
  "code": 6017;
1373
- "name": "streamAlreadyActive";
1374
- "msg": "A bytecode stream is already active for this account.";
1441
+ "name": "missingSourceAta";
1442
+ "msg": "Missing or invalid derived source ATA in accounts";
1375
1443
  },
1376
1444
  {
1377
1445
  "code": 6018;
1378
- "name": "noActiveStream";
1379
- "msg": "No bytecode stream is currently active.";
1446
+ "name": "missingDestAta";
1447
+ "msg": "Missing or invalid derived destination ATA in accounts";
1380
1448
  },
1381
1449
  {
1382
1450
  "code": 6019;
1383
- "name": "wrongFinalSize";
1384
- "msg": "Chunk upload finished but size does not match expected_len.";
1451
+ "name": "noMatchingTokenAccount";
1452
+ "msg": "Could not find a matching token account for the given address/mint.";
1385
1453
  },
1386
1454
  {
1387
1455
  "code": 6020;
1388
- "name": "invalidBytecodeIndex";
1389
- "msg": "Bytecode index must be 0-5";
1456
+ "name": "missingSysvarRent";
1457
+ "msg": "Missing sysvar rent account in accounts";
1390
1458
  },
1391
1459
  {
1392
1460
  "code": 6021;
1393
- "name": "missingEd25519VerifyIx";
1394
- "msg": "Missing or invalid Ed25519 verify instruction.";
1461
+ "name": "missingProgram";
1462
+ "msg": "Missing program";
1395
1463
  },
1396
1464
  {
1397
1465
  "code": 6022;
1398
- "name": "permitExpired";
1399
- "msg": "Permit has expired.";
1466
+ "name": "missingAccount";
1467
+ "msg": "Missing account in remaining_accounts";
1400
1468
  },
1401
1469
  {
1402
1470
  "code": 6023;
1403
- "name": "invalidSignature";
1404
- "msg": "Invalid signature.";
1471
+ "name": "invalidAccountAddress";
1472
+ "msg": "Invalid account address";
1405
1473
  },
1406
1474
  {
1407
1475
  "code": 6024;
1408
- "name": "invalidSigner";
1409
- "msg": "Invalid signer.";
1476
+ "name": "randomnessRequestPending";
1477
+ "msg": "Randomness request is still pending";
1410
1478
  },
1411
1479
  {
1412
1480
  "code": 6025;
1413
- "name": "invalidMessage";
1414
- "msg": "Invalid message.";
1481
+ "name": "invalidPriceAccount";
1482
+ "msg": "Invalid price account";
1415
1483
  },
1416
1484
  {
1417
1485
  "code": 6026;
1418
- "name": "failedToParse";
1419
- "msg": "Failed to parse.";
1486
+ "name": "stalePrice";
1487
+ "msg": "stale price";
1488
+ },
1489
+ {
1490
+ "code": 6027;
1491
+ "name": "numericalOverflow";
1492
+ "msg": "Numerical overflow";
1420
1493
  }
1421
1494
  ];
1422
1495
  "types": [
@@ -688,6 +688,74 @@ export type Tarobase = {
688
688
  }
689
689
  ];
690
690
  },
691
+ {
692
+ "name": "executeQueryStandalone";
693
+ "docs": [
694
+ "Executes a standalone query without requiring GenericPathExecutionData account.",
695
+ "",
696
+ "READONLY INSTRUCTION. This instruction executes a query for plugin functions",
697
+ "from offchain collections. It creates a minimal in-memory GenericPathExecutionData",
698
+ "struct with the provided parameters.",
699
+ "",
700
+ "# Arguments",
701
+ "* `ctx` - The context containing all accounts needed for this instruction",
702
+ "* `bytecode` - The bytecode for the query",
703
+ "* `app_id` - The identifier of the Tarobase application",
704
+ "* `document_input` - The input document for the query i.e what @newData points to",
705
+ "* `simulate` - Whether to simulate the query to extract the remaining accounts needed for the query",
706
+ "* `user_address` - The address of the user executing the query",
707
+ "* `string_literal_map` - The string literals used in the bytecode (fieldPoolArray)"
708
+ ];
709
+ "discriminator": [
710
+ 4,
711
+ 142,
712
+ 253,
713
+ 188,
714
+ 216,
715
+ 143,
716
+ 109,
717
+ 19
718
+ ];
719
+ "accounts": [
720
+ {
721
+ "name": "payer";
722
+ "writable": true;
723
+ "signer": true;
724
+ }
725
+ ];
726
+ "args": [
727
+ {
728
+ "name": "bytecode";
729
+ "type": "bytes";
730
+ },
731
+ {
732
+ "name": "appId";
733
+ "type": "string";
734
+ },
735
+ {
736
+ "name": "documentInput";
737
+ "type": {
738
+ "defined": {
739
+ "name": "setDocumentData";
740
+ };
741
+ };
742
+ },
743
+ {
744
+ "name": "simulate";
745
+ "type": "bool";
746
+ },
747
+ {
748
+ "name": "userAddress";
749
+ "type": "pubkey";
750
+ },
751
+ {
752
+ "name": "stringLiteralMap";
753
+ "type": {
754
+ "vec": "string";
755
+ };
756
+ }
757
+ ];
758
+ },
691
759
  {
692
760
  "name": "finishBytecodeStream";
693
761
  "docs": [
@@ -1285,138 +1353,143 @@ export type Tarobase = {
1285
1353
  "errors": [
1286
1354
  {
1287
1355
  "code": 6000;
1288
- "name": "invalidAccountLength";
1289
- "msg": "The number of provided new accounts does not match the number of documents.";
1356
+ "name": "missingTypeTag";
1357
+ "msg": "Missing type tag for literal";
1290
1358
  },
1291
1359
  {
1292
1360
  "code": 6001;
1293
- "name": "invalidPda";
1294
- "msg": "The provided account does not match the expected PDA.";
1361
+ "name": "notEnoughBytes";
1362
+ "msg": "Not enough bytes";
1295
1363
  },
1296
1364
  {
1297
1365
  "code": 6002;
1298
- "name": "simulate2";
1299
- "msg": "Simulate mode.";
1366
+ "name": "invalidFieldId";
1367
+ "msg": "Invalid field ID";
1300
1368
  },
1301
1369
  {
1302
1370
  "code": 6003;
1303
- "name": "accountTooLarge";
1304
- "msg": "The account size would exceed the maximum allowed size of 10240 bytes.";
1371
+ "name": "stackUnderflow";
1372
+ "msg": "Stack underflow";
1305
1373
  },
1306
1374
  {
1307
1375
  "code": 6004;
1308
- "name": "pathInBothDeleteAndUpdate";
1309
- "msg": "The same path cannot appear in both delete_paths and documents";
1376
+ "name": "typeMismatch";
1377
+ "msg": "Type mismatch in operation";
1310
1378
  },
1311
1379
  {
1312
1380
  "code": 6005;
1313
- "name": "invalidOperation";
1314
- "msg": "Invalid operation.";
1381
+ "name": "invalidArgument";
1382
+ "msg": "Invalid argument";
1315
1383
  },
1316
1384
  {
1317
1385
  "code": 6006;
1318
- "name": "missingRequiredFields";
1319
- "msg": "Missing required fields.";
1386
+ "name": "invalidConversion";
1387
+ "msg": "Invalid conversion";
1320
1388
  },
1321
1389
  {
1322
1390
  "code": 6007;
1323
- "name": "fieldAlreadyExists";
1324
- "msg": "The same field cannot appear in more than one operation.";
1391
+ "name": "unknownLiteralType";
1392
+ "msg": "Unknown literal type";
1325
1393
  },
1326
1394
  {
1327
1395
  "code": 6008;
1328
- "name": "fieldReadOnly";
1329
- "msg": "The field is read only.";
1396
+ "name": "invalidOpcode";
1397
+ "msg": "Invalid opcode";
1330
1398
  },
1331
1399
  {
1332
1400
  "code": 6009;
1333
- "name": "invalidFieldType";
1334
- "msg": "The provided field is not of the expected type.";
1401
+ "name": "invalidTimeTag";
1402
+ "msg": "Invalid time tag";
1335
1403
  },
1336
1404
  {
1337
1405
  "code": 6010;
1338
- "name": "unsupportedOperation";
1339
- "msg": "The provided option is not supported.";
1406
+ "name": "functionNotImplemented";
1407
+ "msg": "Function not implemented";
1340
1408
  },
1341
1409
  {
1342
1410
  "code": 6011;
1343
- "name": "invalidIncrementType";
1344
- "msg": "The increment type is invalid.";
1411
+ "name": "invalidFunctionType";
1412
+ "msg": "Invalid function type";
1345
1413
  },
1346
1414
  {
1347
1415
  "code": 6012;
1348
- "name": "invalidType";
1349
- "msg": "The type is invalid.";
1416
+ "name": "invalidFieldType";
1417
+ "msg": "Invalid field type";
1350
1418
  },
1351
1419
  {
1352
1420
  "code": 6013;
1353
- "name": "missingValue";
1354
- "msg": "The value is missing.";
1421
+ "name": "missingSystemProgram";
1422
+ "msg": "Missing or invalid system program in accounts";
1355
1423
  },
1356
1424
  {
1357
1425
  "code": 6014;
1358
- "name": "invalidTypeForTimestamp";
1359
- "msg": "The type is invalid for timestamp.";
1426
+ "name": "missingTokenProgram";
1427
+ "msg": "Missing or invalid token program in accounts";
1360
1428
  },
1361
1429
  {
1362
1430
  "code": 6015;
1363
- "name": "fieldNotFound";
1364
- "msg": "The field was not found.";
1431
+ "name": "missingSourceWallet";
1432
+ "msg": "Missing or invalid source wallet account in accounts (for signing)";
1365
1433
  },
1366
1434
  {
1367
1435
  "code": 6016;
1368
- "name": "documentDataMissingFromMap";
1369
- "msg": "The document data was missing from the map.";
1436
+ "name": "missingDestWallet";
1437
+ "msg": "Missing or invalid destination wallet account in accounts (for signing)";
1370
1438
  },
1371
1439
  {
1372
1440
  "code": 6017;
1373
- "name": "streamAlreadyActive";
1374
- "msg": "A bytecode stream is already active for this account.";
1441
+ "name": "missingSourceAta";
1442
+ "msg": "Missing or invalid derived source ATA in accounts";
1375
1443
  },
1376
1444
  {
1377
1445
  "code": 6018;
1378
- "name": "noActiveStream";
1379
- "msg": "No bytecode stream is currently active.";
1446
+ "name": "missingDestAta";
1447
+ "msg": "Missing or invalid derived destination ATA in accounts";
1380
1448
  },
1381
1449
  {
1382
1450
  "code": 6019;
1383
- "name": "wrongFinalSize";
1384
- "msg": "Chunk upload finished but size does not match expected_len.";
1451
+ "name": "noMatchingTokenAccount";
1452
+ "msg": "Could not find a matching token account for the given address/mint.";
1385
1453
  },
1386
1454
  {
1387
1455
  "code": 6020;
1388
- "name": "invalidBytecodeIndex";
1389
- "msg": "Bytecode index must be 0-5";
1456
+ "name": "missingSysvarRent";
1457
+ "msg": "Missing sysvar rent account in accounts";
1390
1458
  },
1391
1459
  {
1392
1460
  "code": 6021;
1393
- "name": "missingEd25519VerifyIx";
1394
- "msg": "Missing or invalid Ed25519 verify instruction.";
1461
+ "name": "missingProgram";
1462
+ "msg": "Missing program";
1395
1463
  },
1396
1464
  {
1397
1465
  "code": 6022;
1398
- "name": "permitExpired";
1399
- "msg": "Permit has expired.";
1466
+ "name": "missingAccount";
1467
+ "msg": "Missing account in remaining_accounts";
1400
1468
  },
1401
1469
  {
1402
1470
  "code": 6023;
1403
- "name": "invalidSignature";
1404
- "msg": "Invalid signature.";
1471
+ "name": "invalidAccountAddress";
1472
+ "msg": "Invalid account address";
1405
1473
  },
1406
1474
  {
1407
1475
  "code": 6024;
1408
- "name": "invalidSigner";
1409
- "msg": "Invalid signer.";
1476
+ "name": "randomnessRequestPending";
1477
+ "msg": "Randomness request is still pending";
1410
1478
  },
1411
1479
  {
1412
1480
  "code": 6025;
1413
- "name": "invalidMessage";
1414
- "msg": "Invalid message.";
1481
+ "name": "invalidPriceAccount";
1482
+ "msg": "Invalid price account";
1415
1483
  },
1416
1484
  {
1417
1485
  "code": 6026;
1418
- "name": "failedToParse";
1419
- "msg": "Failed to parse.";
1486
+ "name": "stalePrice";
1487
+ "msg": "stale price";
1488
+ },
1489
+ {
1490
+ "code": 6027;
1491
+ "name": "numericalOverflow";
1492
+ "msg": "Numerical overflow";
1420
1493
  }
1421
1494
  ];
1422
1495
  "types": [