koilib 6.0.0 → 7.1.1

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.
Files changed (45) hide show
  1. package/README.md +39 -40
  2. package/dist/koinos.js +1675 -84
  3. package/dist/koinos.min.js +1 -1
  4. package/lib/Contract.d.ts +12 -24
  5. package/lib/Contract.js +11 -23
  6. package/lib/Contract.js.map +1 -1
  7. package/lib/Provider.d.ts +257 -12
  8. package/lib/Provider.js +288 -10
  9. package/lib/Provider.js.map +1 -1
  10. package/lib/Signer.d.ts +75 -6
  11. package/lib/Signer.js +87 -6
  12. package/lib/Signer.js.map +1 -1
  13. package/lib/Transaction.d.ts +4 -3
  14. package/lib/Transaction.js +13 -10
  15. package/lib/Transaction.js.map +1 -1
  16. package/lib/browser/Contract.d.ts +12 -24
  17. package/lib/browser/Contract.js +11 -23
  18. package/lib/browser/Contract.js.map +1 -1
  19. package/lib/browser/Provider.d.ts +257 -12
  20. package/lib/browser/Provider.js +288 -10
  21. package/lib/browser/Provider.js.map +1 -1
  22. package/lib/browser/Signer.d.ts +75 -6
  23. package/lib/browser/Signer.js +87 -6
  24. package/lib/browser/Signer.js.map +1 -1
  25. package/lib/browser/Transaction.d.ts +4 -3
  26. package/lib/browser/Transaction.js +13 -10
  27. package/lib/browser/Transaction.js.map +1 -1
  28. package/lib/browser/interface.d.ts +34 -0
  29. package/lib/browser/utils.d.ts +39 -0
  30. package/lib/browser/utils.js +1276 -27
  31. package/lib/browser/utils.js.map +1 -1
  32. package/lib/interface.d.ts +34 -0
  33. package/lib/utils.d.ts +39 -0
  34. package/lib/utils.js +1276 -27
  35. package/lib/utils.js.map +1 -1
  36. package/package.json +1 -1
  37. package/src/Contract.ts +12 -24
  38. package/src/Provider.ts +303 -24
  39. package/src/Signer.ts +126 -7
  40. package/src/Transaction.ts +17 -16
  41. package/src/interface.ts +39 -0
  42. package/src/utils.ts +1283 -23
  43. package/lib/browser/jsonDescriptors/token-proto.json +0 -234
  44. package/lib/jsonDescriptors/token-proto.json +0 -234
  45. package/src/jsonDescriptors/token-proto.json +0 -234
package/lib/utils.js CHANGED
@@ -22,15 +22,11 @@ var __importStar = (this && this.__importStar) || function (mod) {
22
22
  __setModuleDefault(result, mod);
23
23
  return result;
24
24
  };
25
- var __importDefault = (this && this.__importDefault) || function (mod) {
26
- return (mod && mod.__esModule) ? mod : { "default": mod };
27
- };
28
25
  Object.defineProperty(exports, "__esModule", { value: true });
29
- exports.tokenAbi = exports.btypeEncode = exports.btypeDecode = exports.btypeEncodeValue = exports.btypeDecodeValue = exports.parseUnits = exports.formatUnits = exports.isChecksumWif = exports.isChecksumAddress = exports.isChecksum = exports.bitcoinAddress = exports.bitcoinDecode = exports.bitcoinEncode = exports.calculateMerkleRoot = exports.decodeBase64 = exports.multihash = exports.encodeBase64 = exports.decodeBase64url = exports.encodeBase64url = exports.decodeBase58 = exports.encodeBase58 = exports.toHexString = exports.toUint8Array = void 0;
26
+ exports.nftAbi = exports.tokenAbi = exports.btypeEncode = exports.btypeDecode = exports.btypeEncodeValue = exports.btypeDecodeValue = exports.parseUnits = exports.formatUnits = exports.isChecksumWif = exports.isChecksumAddress = exports.isChecksum = exports.bitcoinAddress = exports.bitcoinDecode = exports.bitcoinEncode = exports.calculateMerkleRoot = exports.decodeBase64 = exports.multihash = exports.encodeBase64 = exports.decodeBase64url = exports.encodeBase64url = exports.decodeBase58 = exports.encodeBase58 = exports.toHexString = exports.toUint8Array = void 0;
30
27
  const multibase = __importStar(require("multibase"));
31
28
  const sha256_1 = require("@noble/hashes/sha256");
32
29
  const ripemd160_1 = require("@noble/hashes/ripemd160");
33
- const token_proto_json_1 = __importDefault(require("./jsonDescriptors/token-proto.json"));
34
30
  /**
35
31
  * Converts an hex string to Uint8Array
36
32
  */
@@ -454,57 +450,1310 @@ function btypeEncode(valueDecoded, fields, verifyChecksum) {
454
450
  exports.btypeEncode = btypeEncode;
455
451
  /**
456
452
  * ABI for tokens
453
+ *
454
+ * @example
455
+ * ```ts
456
+ * import { Contract, Provider, utils } from "koilib";
457
+ *
458
+ * const provider = new Provider("https://api.koinos.io");
459
+ * const koinContract = new Contract({
460
+ * id: "15DJN4a8SgrbGhhGksSBASiSYjGnMU8dGL",
461
+ * provider,
462
+ * abi: utils.tokenAbi,
463
+ * });
464
+ * ```
457
465
  */
458
466
  exports.tokenAbi = {
459
467
  methods: {
460
468
  name: {
461
- entry_point: 0x82a3537f,
462
- argument: "name_arguments",
463
- return: "name_result",
469
+ argument: "",
470
+ return: "token.str",
471
+ description: "Get name of the token",
464
472
  read_only: true,
473
+ entry_point: 0x82a3537f,
465
474
  },
466
475
  symbol: {
467
- entry_point: 0xb76a7ca1,
468
- argument: "symbol_arguments",
469
- return: "symbol_result",
476
+ argument: "",
477
+ return: "token.str",
478
+ description: "Get the symbol of the token",
470
479
  read_only: true,
480
+ entry_point: 0xb76a7ca1,
471
481
  },
472
482
  decimals: {
483
+ argument: "",
484
+ return: "token.uint32",
485
+ description: "Get the decimals of the token",
486
+ read_only: true,
473
487
  entry_point: 0xee80fd2f,
474
- argument: "decimals_arguments",
475
- return: "decimals_result",
488
+ },
489
+ getInfo: {
490
+ argument: "",
491
+ return: "token.info",
492
+ description: "Get name, symbol and decimals",
476
493
  read_only: true,
494
+ entry_point: 0xbd7f6850,
477
495
  },
478
496
  totalSupply: {
479
- entry_point: 0xb0da3934,
480
- argument: "total_supply_arguments",
481
- return: "total_supply_result",
497
+ argument: "",
498
+ return: "token.uint64",
499
+ description: "Get total supply",
482
500
  read_only: true,
501
+ entry_point: 0xb0da3934,
483
502
  },
484
503
  balanceOf: {
504
+ argument: "token.balance_of_args",
505
+ return: "token.uint64",
506
+ description: "Get balance of an account",
507
+ read_only: true,
485
508
  entry_point: 0x5c721497,
486
- argument: "balance_of_arguments",
487
- return: "balance_of_result",
509
+ default_output: { value: "0" },
510
+ },
511
+ allowance: {
512
+ argument: "token.allowance_args",
513
+ return: "token.uint64",
514
+ description: "Get allowance",
515
+ read_only: true,
516
+ entry_point: 0x32f09fa1,
517
+ },
518
+ getAllowances: {
519
+ argument: "token.get_allowances_args",
520
+ return: "token.get_allowances_return",
521
+ description: "Get allowances of an account",
522
+ read_only: true,
523
+ entry_point: 0x8fa16456,
524
+ },
525
+ approve: {
526
+ argument: "token.approve_args",
527
+ return: "",
528
+ description: "Grant permissions to other account to manage the tokens owned by the user. The user must approve only the accounts he trust.",
529
+ read_only: false,
530
+ entry_point: 0x74e21680,
531
+ },
532
+ transfer: {
533
+ argument: "token.transfer_args",
534
+ return: "",
535
+ description: "Transfer tokens",
536
+ read_only: false,
537
+ entry_point: 0x27f576ca,
538
+ },
539
+ mint: {
540
+ argument: "token.mint_args",
541
+ return: "",
542
+ description: "Mint new tokens",
543
+ read_only: false,
544
+ entry_point: 0xdc6f17bb,
545
+ },
546
+ },
547
+ types: "CpoICiJrb2lub3MvY29udHJhY3RzL3Rva2VuL3Rva2VuLnByb3RvEhZrb2lub3MuY29udHJhY3RzLnRva2VuGhRrb2lub3Mvb3B0aW9ucy5wcm90byIQCg5uYW1lX2FyZ3VtZW50cyIjCgtuYW1lX3Jlc3VsdBIUCgV2YWx1ZRgBIAEoCVIFdmFsdWUiEgoQc3ltYm9sX2FyZ3VtZW50cyIlCg1zeW1ib2xfcmVzdWx0EhQKBXZhbHVlGAEgASgJUgV2YWx1ZSIUChJkZWNpbWFsc19hcmd1bWVudHMiJwoPZGVjaW1hbHNfcmVzdWx0EhQKBXZhbHVlGAEgASgNUgV2YWx1ZSIYChZ0b3RhbF9zdXBwbHlfYXJndW1lbnRzIi8KE3RvdGFsX3N1cHBseV9yZXN1bHQSGAoFdmFsdWUYASABKARCAjABUgV2YWx1ZSIyChRiYWxhbmNlX29mX2FyZ3VtZW50cxIaCgVvd25lchgBIAEoDEIEgLUYBlIFb3duZXIiLQoRYmFsYW5jZV9vZl9yZXN1bHQSGAoFdmFsdWUYASABKARCAjABUgV2YWx1ZSJeChJ0cmFuc2Zlcl9hcmd1bWVudHMSG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xsb3dhbmNlcxgCIAMoCzIULnRva2VuLnNwZW5kZXJfdmFsdWVSCmFsbG93YW5jZXMiWgoOdHJhbnNmZXJfZXZlbnQSGAoEZnJvbRgBIAEoDEIEgLUYBlIEZnJvbRIUCgJ0bxgCIAEoDEIEgLUYBlICdG8SGAoFdmFsdWUYAyABKARCAjABUgV2YWx1ZSI8CgptaW50X2V2ZW50EhQKAnRvGAEgASgMQgSAtRgGUgJ0bxIYCgV2YWx1ZRgCIAEoBEICMAFSBXZhbHVlIkAKCmJ1cm5fZXZlbnQSGAoEZnJvbRgBIAEoDEIEgLUYBlIEZnJvbRIYCgV2YWx1ZRgCIAEoBEICMAFSBXZhbHVlImUKDWFwcHJvdmVfZXZlbnQSGgoFb3duZXIYASABKAxCBIC1GAZSBW93bmVyEh4KB3NwZW5kZXIYAiABKAxCBIC1GAZSB3NwZW5kZXISGAoFdmFsdWUYAyABKARCAjABUgV2YWx1ZWIGcHJvdG8z",
548
+ koilib_types: {
549
+ nested: {
550
+ koinos: {
551
+ options: {
552
+ go_package: "github.com/koinos/koinos-proto-golang/koinos",
553
+ },
554
+ nested: {
555
+ contracts: {
556
+ nested: {
557
+ token: {
558
+ options: {
559
+ go_package: "github.com/koinos/koinos-proto-golang/koinos/contracts/token",
560
+ },
561
+ nested: {
562
+ name_arguments: {
563
+ fields: {},
564
+ },
565
+ name_result: {
566
+ fields: {
567
+ value: {
568
+ type: "string",
569
+ id: 1,
570
+ },
571
+ },
572
+ },
573
+ symbol_arguments: {
574
+ fields: {},
575
+ },
576
+ symbol_result: {
577
+ fields: {
578
+ value: {
579
+ type: "string",
580
+ id: 1,
581
+ },
582
+ },
583
+ },
584
+ decimals_arguments: {
585
+ fields: {},
586
+ },
587
+ decimals_result: {
588
+ fields: {
589
+ value: {
590
+ type: "uint32",
591
+ id: 1,
592
+ },
593
+ },
594
+ },
595
+ total_supply_arguments: {
596
+ fields: {},
597
+ },
598
+ total_supply_result: {
599
+ fields: {
600
+ value: {
601
+ type: "uint64",
602
+ id: 1,
603
+ options: {
604
+ jstype: "JS_STRING",
605
+ },
606
+ },
607
+ },
608
+ },
609
+ balance_of_arguments: {
610
+ fields: {
611
+ owner: {
612
+ type: "bytes",
613
+ id: 1,
614
+ options: {
615
+ "(btype)": "ADDRESS",
616
+ },
617
+ },
618
+ },
619
+ },
620
+ balance_of_result: {
621
+ fields: {
622
+ value: {
623
+ type: "uint64",
624
+ id: 1,
625
+ options: {
626
+ jstype: "JS_STRING",
627
+ },
628
+ },
629
+ },
630
+ },
631
+ transfer_arguments: {
632
+ fields: {
633
+ from: {
634
+ type: "bytes",
635
+ id: 1,
636
+ options: {
637
+ "(btype)": "ADDRESS",
638
+ },
639
+ },
640
+ to: {
641
+ type: "bytes",
642
+ id: 2,
643
+ options: {
644
+ "(btype)": "ADDRESS",
645
+ },
646
+ },
647
+ value: {
648
+ type: "uint64",
649
+ id: 3,
650
+ options: {
651
+ jstype: "JS_STRING",
652
+ },
653
+ },
654
+ },
655
+ },
656
+ transfer_result: {
657
+ fields: {},
658
+ },
659
+ mint_arguments: {
660
+ fields: {
661
+ to: {
662
+ type: "bytes",
663
+ id: 1,
664
+ options: {
665
+ "(btype)": "ADDRESS",
666
+ },
667
+ },
668
+ value: {
669
+ type: "uint64",
670
+ id: 2,
671
+ options: {
672
+ jstype: "JS_STRING",
673
+ },
674
+ },
675
+ },
676
+ },
677
+ mint_result: {
678
+ fields: {},
679
+ },
680
+ burn_arguments: {
681
+ fields: {
682
+ from: {
683
+ type: "bytes",
684
+ id: 1,
685
+ options: {
686
+ "(btype)": "ADDRESS",
687
+ },
688
+ },
689
+ value: {
690
+ type: "uint64",
691
+ id: 2,
692
+ options: {
693
+ jstype: "JS_STRING",
694
+ },
695
+ },
696
+ },
697
+ },
698
+ burn_result: {
699
+ fields: {},
700
+ },
701
+ balance_object: {
702
+ fields: {
703
+ value: {
704
+ type: "uint64",
705
+ id: 1,
706
+ options: {
707
+ jstype: "JS_STRING",
708
+ },
709
+ },
710
+ },
711
+ },
712
+ burn_event: {
713
+ fields: {
714
+ from: {
715
+ type: "bytes",
716
+ id: 1,
717
+ options: {
718
+ "(btype)": "ADDRESS",
719
+ },
720
+ },
721
+ value: {
722
+ type: "uint64",
723
+ id: 2,
724
+ options: {
725
+ jstype: "JS_STRING",
726
+ },
727
+ },
728
+ },
729
+ },
730
+ mint_event: {
731
+ fields: {
732
+ to: {
733
+ type: "bytes",
734
+ id: 1,
735
+ options: {
736
+ "(btype)": "ADDRESS",
737
+ },
738
+ },
739
+ value: {
740
+ type: "uint64",
741
+ id: 2,
742
+ options: {
743
+ jstype: "JS_STRING",
744
+ },
745
+ },
746
+ },
747
+ },
748
+ transfer_event: {
749
+ fields: {
750
+ from: {
751
+ type: "bytes",
752
+ id: 1,
753
+ options: {
754
+ "(btype)": "ADDRESS",
755
+ },
756
+ },
757
+ to: {
758
+ type: "bytes",
759
+ id: 2,
760
+ options: {
761
+ "(btype)": "ADDRESS",
762
+ },
763
+ },
764
+ value: {
765
+ type: "uint64",
766
+ id: 3,
767
+ options: {
768
+ jstype: "JS_STRING",
769
+ },
770
+ },
771
+ },
772
+ },
773
+ },
774
+ },
775
+ },
776
+ },
777
+ bytes_type: {
778
+ values: {
779
+ BASE64: 0,
780
+ BASE58: 1,
781
+ HEX: 2,
782
+ BLOCK_ID: 3,
783
+ TRANSACTION_ID: 4,
784
+ CONTRACT_ID: 5,
785
+ ADDRESS: 6,
786
+ },
787
+ },
788
+ btype: {
789
+ type: "bytes_type",
790
+ id: 50000,
791
+ extend: "google.protobuf.FieldOptions",
792
+ options: {
793
+ proto3_optional: true,
794
+ },
795
+ },
796
+ },
797
+ },
798
+ token: {
799
+ nested: {
800
+ str: {
801
+ fields: {
802
+ value: {
803
+ type: "string",
804
+ id: 1,
805
+ },
806
+ },
807
+ },
808
+ uint32: {
809
+ fields: {
810
+ value: {
811
+ type: "uint32",
812
+ id: 1,
813
+ },
814
+ },
815
+ },
816
+ uint64: {
817
+ fields: {
818
+ value: {
819
+ type: "uint64",
820
+ id: 1,
821
+ options: {
822
+ jstype: "JS_STRING",
823
+ },
824
+ },
825
+ },
826
+ },
827
+ boole: {
828
+ fields: {
829
+ value: {
830
+ type: "bool",
831
+ id: 1,
832
+ },
833
+ },
834
+ },
835
+ info: {
836
+ fields: {
837
+ name: {
838
+ type: "string",
839
+ id: 1,
840
+ },
841
+ symbol: {
842
+ type: "string",
843
+ id: 2,
844
+ },
845
+ decimals: {
846
+ type: "uint32",
847
+ id: 3,
848
+ },
849
+ description: {
850
+ type: "string",
851
+ id: 4,
852
+ },
853
+ },
854
+ },
855
+ balance_of_args: {
856
+ fields: {
857
+ owner: {
858
+ type: "bytes",
859
+ id: 1,
860
+ options: {
861
+ "(koinos.btype)": "ADDRESS",
862
+ },
863
+ },
864
+ },
865
+ },
866
+ transfer_args: {
867
+ fields: {
868
+ from: {
869
+ type: "bytes",
870
+ id: 1,
871
+ options: {
872
+ "(koinos.btype)": "ADDRESS",
873
+ },
874
+ },
875
+ to: {
876
+ type: "bytes",
877
+ id: 2,
878
+ options: {
879
+ "(koinos.btype)": "ADDRESS",
880
+ },
881
+ },
882
+ value: {
883
+ type: "uint64",
884
+ id: 3,
885
+ options: {
886
+ jstype: "JS_STRING",
887
+ },
888
+ },
889
+ memo: {
890
+ type: "string",
891
+ id: 4,
892
+ },
893
+ },
894
+ },
895
+ mint_args: {
896
+ fields: {
897
+ to: {
898
+ type: "bytes",
899
+ id: 1,
900
+ options: {
901
+ "(koinos.btype)": "ADDRESS",
902
+ },
903
+ },
904
+ value: {
905
+ type: "uint64",
906
+ id: 2,
907
+ options: {
908
+ jstype: "JS_STRING",
909
+ },
910
+ },
911
+ },
912
+ },
913
+ burn_args: {
914
+ fields: {
915
+ from: {
916
+ type: "bytes",
917
+ id: 1,
918
+ options: {
919
+ "(koinos.btype)": "ADDRESS",
920
+ },
921
+ },
922
+ value: {
923
+ type: "uint64",
924
+ id: 2,
925
+ options: {
926
+ jstype: "JS_STRING",
927
+ },
928
+ },
929
+ },
930
+ },
931
+ approve_args: {
932
+ fields: {
933
+ owner: {
934
+ type: "bytes",
935
+ id: 1,
936
+ options: {
937
+ "(koinos.btype)": "ADDRESS",
938
+ },
939
+ },
940
+ spender: {
941
+ type: "bytes",
942
+ id: 2,
943
+ options: {
944
+ "(koinos.btype)": "ADDRESS",
945
+ },
946
+ },
947
+ value: {
948
+ type: "uint64",
949
+ id: 3,
950
+ options: {
951
+ jstype: "JS_STRING",
952
+ },
953
+ },
954
+ },
955
+ },
956
+ allowance_args: {
957
+ fields: {
958
+ owner: {
959
+ type: "bytes",
960
+ id: 1,
961
+ options: {
962
+ "(koinos.btype)": "ADDRESS",
963
+ },
964
+ },
965
+ spender: {
966
+ type: "bytes",
967
+ id: 2,
968
+ options: {
969
+ "(koinos.btype)": "ADDRESS",
970
+ },
971
+ },
972
+ },
973
+ },
974
+ get_allowances_args: {
975
+ fields: {
976
+ owner: {
977
+ type: "bytes",
978
+ id: 1,
979
+ options: {
980
+ "(koinos.btype)": "ADDRESS",
981
+ },
982
+ },
983
+ start: {
984
+ type: "bytes",
985
+ id: 2,
986
+ options: {
987
+ "(koinos.btype)": "ADDRESS",
988
+ },
989
+ },
990
+ limit: {
991
+ type: "int32",
992
+ id: 3,
993
+ },
994
+ descending: {
995
+ type: "bool",
996
+ id: 4,
997
+ },
998
+ },
999
+ },
1000
+ spender_value: {
1001
+ fields: {
1002
+ spender: {
1003
+ type: "bytes",
1004
+ id: 1,
1005
+ options: {
1006
+ "(koinos.btype)": "ADDRESS",
1007
+ },
1008
+ },
1009
+ value: {
1010
+ type: "uint64",
1011
+ id: 2,
1012
+ options: {
1013
+ jstype: "JS_STRING",
1014
+ },
1015
+ },
1016
+ },
1017
+ },
1018
+ get_allowances_return: {
1019
+ fields: {
1020
+ owner: {
1021
+ type: "bytes",
1022
+ id: 1,
1023
+ options: {
1024
+ "(koinos.btype)": "ADDRESS",
1025
+ },
1026
+ },
1027
+ allowances: {
1028
+ rule: "repeated",
1029
+ type: "spender_value",
1030
+ id: 2,
1031
+ },
1032
+ },
1033
+ },
1034
+ transfer_event: {
1035
+ fields: {
1036
+ from: {
1037
+ type: "bytes",
1038
+ id: 1,
1039
+ options: {
1040
+ "(koinos.btype)": "ADDRESS",
1041
+ },
1042
+ },
1043
+ to: {
1044
+ type: "bytes",
1045
+ id: 2,
1046
+ options: {
1047
+ "(koinos.btype)": "ADDRESS",
1048
+ },
1049
+ },
1050
+ value: {
1051
+ type: "uint64",
1052
+ id: 3,
1053
+ options: {
1054
+ jstype: "JS_STRING",
1055
+ },
1056
+ },
1057
+ },
1058
+ },
1059
+ mint_event: {
1060
+ fields: {
1061
+ to: {
1062
+ type: "bytes",
1063
+ id: 1,
1064
+ options: {
1065
+ "(koinos.btype)": "ADDRESS",
1066
+ },
1067
+ },
1068
+ value: {
1069
+ type: "uint64",
1070
+ id: 2,
1071
+ options: {
1072
+ jstype: "JS_STRING",
1073
+ },
1074
+ },
1075
+ },
1076
+ },
1077
+ burn_event: {
1078
+ fields: {
1079
+ from: {
1080
+ type: "bytes",
1081
+ id: 1,
1082
+ options: {
1083
+ "(koinos.btype)": "ADDRESS",
1084
+ },
1085
+ },
1086
+ value: {
1087
+ type: "uint64",
1088
+ id: 2,
1089
+ options: {
1090
+ jstype: "JS_STRING",
1091
+ },
1092
+ },
1093
+ },
1094
+ },
1095
+ approve_event: {
1096
+ fields: {
1097
+ owner: {
1098
+ type: "bytes",
1099
+ id: 1,
1100
+ options: {
1101
+ "(koinos.btype)": "ADDRESS",
1102
+ },
1103
+ },
1104
+ spender: {
1105
+ type: "bytes",
1106
+ id: 2,
1107
+ options: {
1108
+ "(koinos.btype)": "ADDRESS",
1109
+ },
1110
+ },
1111
+ value: {
1112
+ type: "uint64",
1113
+ id: 3,
1114
+ options: {
1115
+ jstype: "JS_STRING",
1116
+ },
1117
+ },
1118
+ },
1119
+ },
1120
+ },
1121
+ },
1122
+ },
1123
+ },
1124
+ };
1125
+ /**
1126
+ * ABI for NFTs
1127
+ *
1128
+ * @example
1129
+ * ```ts
1130
+ * import { Contract, Provider, utils } from "koilib";
1131
+ *
1132
+ * const provider = new Provider("https://api.koinos.io");
1133
+ * const nicknamesContract = new Contract({
1134
+ * id: "1KD9Es7LBBjA1FY3ViCgQJ7e6WH1ipKbhz",
1135
+ * provider,
1136
+ * abi: utils.nftAbi,
1137
+ * });
1138
+ * const nicknames = nicknamesContract.functions;
1139
+ *
1140
+ * ...
1141
+ *
1142
+ * // get the address linked to the nickname "pob"
1143
+ * const pobId = `0x${utils.toHexString(new TextEncoder().encode("pob"))}`;
1144
+ * const { result } = await nicknames.ownerOf({ token_id: pobId });
1145
+ * console.log(result);
1146
+ *
1147
+ * // { value: '159myq5YUhhoVWu3wsHKHiJYKPKGUrGiyv' }
1148
+ })();
1149
+ * ```
1150
+ */
1151
+ exports.nftAbi = {
1152
+ methods: {
1153
+ name: {
1154
+ argument: "",
1155
+ return: "common.str",
1156
+ description: "Get name of the NFT",
1157
+ read_only: true,
1158
+ entry_point: 0x82a3537f,
1159
+ },
1160
+ symbol: {
1161
+ argument: "",
1162
+ return: "common.str",
1163
+ description: "Get the symbol of the NFT",
488
1164
  read_only: true,
1165
+ entry_point: 0xb76a7ca1,
1166
+ },
1167
+ uri: {
1168
+ argument: "",
1169
+ return: "common.str",
1170
+ description: "Get URI of the NFT",
1171
+ read_only: true,
1172
+ entry_point: 0x70e5d7b6,
1173
+ },
1174
+ getInfo: {
1175
+ argument: "",
1176
+ return: "nft.info",
1177
+ description: "Get name, symbol and decimals",
1178
+ read_only: true,
1179
+ entry_point: 0xbd7f6850,
1180
+ },
1181
+ owner: {
1182
+ argument: "",
1183
+ return: "common.address",
1184
+ description: "Get the owner of the collection",
1185
+ read_only: true,
1186
+ entry_point: 0x4c102969,
1187
+ },
1188
+ totalSupply: {
1189
+ argument: "",
1190
+ return: "common.uint64",
1191
+ description: "Get total supply",
1192
+ read_only: true,
1193
+ entry_point: 0xb0da3934,
1194
+ },
1195
+ royalties: {
1196
+ argument: "",
1197
+ return: "nft.royalties",
1198
+ description: "Get royalties",
1199
+ read_only: true,
1200
+ entry_point: 0x36e90cd0,
1201
+ },
1202
+ balanceOf: {
1203
+ argument: "nft.balance_of_args",
1204
+ return: "common.uint64",
1205
+ description: "Get balance of an account",
1206
+ read_only: true,
1207
+ entry_point: 0x5c721497,
489
1208
  default_output: { value: "0" },
490
1209
  },
1210
+ ownerOf: {
1211
+ argument: "nft.token",
1212
+ return: "common.address",
1213
+ description: "Get the owner of a token",
1214
+ read_only: true,
1215
+ entry_point: 0xed61c847,
1216
+ },
1217
+ metadataOf: {
1218
+ argument: "nft.token",
1219
+ return: "common.str",
1220
+ description: "Get the metadata of a token",
1221
+ read_only: true,
1222
+ entry_point: 0x176c8f7f,
1223
+ },
1224
+ getTokens: {
1225
+ argument: "nft.get_tokens_args",
1226
+ return: "nft.token_ids",
1227
+ description: "Get list of token IDs",
1228
+ read_only: true,
1229
+ entry_point: 0x7d5b5ed7,
1230
+ },
1231
+ getTokensByOwner: {
1232
+ argument: "nft.get_tokens_by_owner_args",
1233
+ return: "nft.token_ids",
1234
+ description: "Get tokens owned by an address",
1235
+ read_only: true,
1236
+ entry_point: 0xfc13eb75,
1237
+ },
1238
+ getApproved: {
1239
+ argument: "nft.token",
1240
+ return: "common.address",
1241
+ description: "Check if an account is approved to operate a token ID",
1242
+ read_only: true,
1243
+ entry_point: 0x4c731020,
1244
+ },
1245
+ isApprovedForAll: {
1246
+ argument: "nft.is_approved_for_all_args",
1247
+ return: "common.boole",
1248
+ description: "Check if an account is approved to operate all tokens owned by other account",
1249
+ read_only: true,
1250
+ entry_point: 0xe7ab8ce5,
1251
+ },
1252
+ getOperatorApprovals: {
1253
+ argument: "nft.get_operators_args",
1254
+ return: "nft.get_operators_return",
1255
+ description: "Get allowances of an account",
1256
+ read_only: true,
1257
+ entry_point: 0xdb1bf60e,
1258
+ },
1259
+ transferOwnership: {
1260
+ argument: "common.address",
1261
+ return: "",
1262
+ description: "Transfer ownership of the collection",
1263
+ read_only: false,
1264
+ entry_point: 0x394be702,
1265
+ },
1266
+ setRoyalties: {
1267
+ argument: "nft.royalties",
1268
+ return: "",
1269
+ description: "Set royalties",
1270
+ read_only: false,
1271
+ entry_point: 0x3b5bb56b,
1272
+ },
1273
+ setMetadata: {
1274
+ argument: "nft.metadata_args",
1275
+ return: "",
1276
+ description: "Set metadata",
1277
+ read_only: false,
1278
+ entry_point: 0x3d59af19,
1279
+ },
1280
+ approve: {
1281
+ argument: "nft.approve_args",
1282
+ return: "",
1283
+ description: "Grant permissions to other account to manage a specific Token owned by the user. The user must approve only the accounts he trust.",
1284
+ read_only: false,
1285
+ entry_point: 0x74e21680,
1286
+ },
1287
+ setApprovalForAll: {
1288
+ argument: "nft.set_approval_for_all_args",
1289
+ return: "",
1290
+ description: "Grant permissions to other account to manage all Tokens owned by the user. The user must approve only the accounts he trust.",
1291
+ read_only: false,
1292
+ entry_point: 0x20442216,
1293
+ },
491
1294
  transfer: {
1295
+ argument: "nft.transfer_args",
1296
+ return: "",
1297
+ description: "Transfer NFT",
1298
+ read_only: false,
492
1299
  entry_point: 0x27f576ca,
493
- argument: "transfer_arguments",
494
- return: "transfer_result",
495
1300
  },
496
1301
  mint: {
1302
+ argument: "nft.mint_args",
1303
+ return: "",
1304
+ description: "Mint NFT",
1305
+ read_only: false,
497
1306
  entry_point: 0xdc6f17bb,
498
- argument: "mint_arguments",
499
- return: "mint_result",
500
1307
  },
501
- burn: {
502
- entry_point: 0x859facc5,
503
- argument: "burn_arguments",
504
- return: "burn_result",
1308
+ },
1309
+ types: "CoQDCidrb2lub3Nib3gtcHJvdG8vbWFuYXNoYXJlci9jb21tb24ucHJvdG8SBmNvbW1vbhoUa29pbm9zL29wdGlvbnMucHJvdG8iGwoDc3RyEhQKBXZhbHVlGAEgASgJUgV2YWx1ZSIeCgZ1aW50MzISFAoFdmFsdWUYASABKA1SBXZhbHVlIiIKBnVpbnQ2NBIYCgV2YWx1ZRgBIAEoBEICMAFSB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KGGdldF90b2tlbnNfYnlfb3duZXJfYXJncxIaCgVvd25lchgBIAEoDEIEgLUYBlIFb3duZXISGgoFc3RhcnQYAiABKAxCBIC1GAJSBXN0YXJ0EhQKBWxpbWl0GAMgASgFUgVsaW1pdBIeCgpkZXNjZW5kaW5nGAQgASgIUgpkZXNjZW5kaW5nIi4KCXRva2VuX2lkcxIhCgl0b2tlbl9pZHMYASADKAxCBIC1GAJSCHRva2VuSWRzYgZwcm90bzM=",
1310
+ koilib_types: {
1311
+ nested: {
1312
+ common: {
1313
+ nested: {
1314
+ str: {
1315
+ fields: {
1316
+ value: {
1317
+ type: "string",
1318
+ id: 1,
1319
+ },
1320
+ },
1321
+ },
1322
+ uint32: {
1323
+ fields: {
1324
+ value: {
1325
+ type: "uint32",
1326
+ id: 1,
1327
+ },
1328
+ },
1329
+ },
1330
+ uint64: {
1331
+ fields: {
1332
+ value: {
1333
+ type: "uint64",
1334
+ id: 1,
1335
+ options: {
1336
+ jstype: "JS_STRING",
1337
+ },
1338
+ },
1339
+ },
1340
+ },
1341
+ boole: {
1342
+ fields: {
1343
+ value: {
1344
+ type: "bool",
1345
+ id: 1,
1346
+ },
1347
+ },
1348
+ },
1349
+ address: {
1350
+ fields: {
1351
+ value: {
1352
+ type: "bytes",
1353
+ id: 1,
1354
+ options: {
1355
+ "(koinos.btype)": "ADDRESS",
1356
+ },
1357
+ },
1358
+ },
1359
+ },
1360
+ list_args: {
1361
+ fields: {
1362
+ start: {
1363
+ type: "bytes",
1364
+ id: 1,
1365
+ options: {
1366
+ "(koinos.btype)": "ADDRESS",
1367
+ },
1368
+ },
1369
+ limit: {
1370
+ type: "int32",
1371
+ id: 2,
1372
+ },
1373
+ descending: {
1374
+ type: "bool",
1375
+ id: 3,
1376
+ },
1377
+ },
1378
+ },
1379
+ addresses: {
1380
+ fields: {
1381
+ accounts: {
1382
+ rule: "repeated",
1383
+ type: "bytes",
1384
+ id: 1,
1385
+ options: {
1386
+ "(koinos.btype)": "ADDRESS",
1387
+ },
1388
+ },
1389
+ },
1390
+ },
1391
+ },
1392
+ },
1393
+ koinos: {
1394
+ options: {
1395
+ go_package: "github.com/koinos/koinos-proto-golang/koinos",
1396
+ },
1397
+ nested: {
1398
+ bytes_type: {
1399
+ values: {
1400
+ BASE64: 0,
1401
+ BASE58: 1,
1402
+ HEX: 2,
1403
+ BLOCK_ID: 3,
1404
+ TRANSACTION_ID: 4,
1405
+ CONTRACT_ID: 5,
1406
+ ADDRESS: 6,
1407
+ },
1408
+ },
1409
+ btype: {
1410
+ type: "bytes_type",
1411
+ id: 50000,
1412
+ extend: "google.protobuf.FieldOptions",
1413
+ options: {
1414
+ proto3_optional: true,
1415
+ },
1416
+ },
1417
+ },
1418
+ },
1419
+ nft: {
1420
+ nested: {
1421
+ royalty: {
1422
+ fields: {
1423
+ percentage: {
1424
+ type: "uint64",
1425
+ id: 1,
1426
+ options: {
1427
+ jstype: "JS_STRING",
1428
+ },
1429
+ },
1430
+ address: {
1431
+ type: "bytes",
1432
+ id: 2,
1433
+ options: {
1434
+ "(koinos.btype)": "ADDRESS",
1435
+ },
1436
+ },
1437
+ },
1438
+ },
1439
+ royalties: {
1440
+ fields: {
1441
+ value: {
1442
+ rule: "repeated",
1443
+ type: "royalty",
1444
+ id: 1,
1445
+ },
1446
+ },
1447
+ },
1448
+ metadata_args: {
1449
+ fields: {
1450
+ token_id: {
1451
+ type: "bytes",
1452
+ id: 1,
1453
+ options: {
1454
+ "(koinos.btype)": "HEX",
1455
+ },
1456
+ },
1457
+ metadata: {
1458
+ type: "string",
1459
+ id: 2,
1460
+ },
1461
+ },
1462
+ },
1463
+ info: {
1464
+ fields: {
1465
+ name: {
1466
+ type: "string",
1467
+ id: 1,
1468
+ },
1469
+ symbol: {
1470
+ type: "string",
1471
+ id: 2,
1472
+ },
1473
+ uri: {
1474
+ type: "string",
1475
+ id: 3,
1476
+ },
1477
+ description: {
1478
+ type: "string",
1479
+ id: 4,
1480
+ },
1481
+ },
1482
+ },
1483
+ balance_of_args: {
1484
+ fields: {
1485
+ owner: {
1486
+ type: "bytes",
1487
+ id: 1,
1488
+ options: {
1489
+ "(koinos.btype)": "ADDRESS",
1490
+ },
1491
+ },
1492
+ },
1493
+ },
1494
+ token: {
1495
+ fields: {
1496
+ token_id: {
1497
+ type: "bytes",
1498
+ id: 1,
1499
+ options: {
1500
+ "(koinos.btype)": "HEX",
1501
+ },
1502
+ },
1503
+ },
1504
+ },
1505
+ is_approved_for_all_args: {
1506
+ fields: {
1507
+ owner: {
1508
+ type: "bytes",
1509
+ id: 1,
1510
+ options: {
1511
+ "(koinos.btype)": "ADDRESS",
1512
+ },
1513
+ },
1514
+ operator: {
1515
+ type: "bytes",
1516
+ id: 2,
1517
+ options: {
1518
+ "(koinos.btype)": "ADDRESS",
1519
+ },
1520
+ },
1521
+ },
1522
+ },
1523
+ mint_args: {
1524
+ fields: {
1525
+ to: {
1526
+ type: "bytes",
1527
+ id: 1,
1528
+ options: {
1529
+ "(koinos.btype)": "ADDRESS",
1530
+ },
1531
+ },
1532
+ token_id: {
1533
+ type: "bytes",
1534
+ id: 2,
1535
+ options: {
1536
+ "(koinos.btype)": "HEX",
1537
+ },
1538
+ },
1539
+ },
1540
+ },
1541
+ burn_args: {
1542
+ fields: {
1543
+ token_id: {
1544
+ type: "bytes",
1545
+ id: 1,
1546
+ options: {
1547
+ "(koinos.btype)": "HEX",
1548
+ },
1549
+ },
1550
+ },
1551
+ },
1552
+ transfer_args: {
1553
+ fields: {
1554
+ from: {
1555
+ type: "bytes",
1556
+ id: 1,
1557
+ options: {
1558
+ "(koinos.btype)": "ADDRESS",
1559
+ },
1560
+ },
1561
+ to: {
1562
+ type: "bytes",
1563
+ id: 2,
1564
+ options: {
1565
+ "(koinos.btype)": "ADDRESS",
1566
+ },
1567
+ },
1568
+ token_id: {
1569
+ type: "bytes",
1570
+ id: 3,
1571
+ options: {
1572
+ "(koinos.btype)": "HEX",
1573
+ },
1574
+ },
1575
+ memo: {
1576
+ type: "string",
1577
+ id: 4,
1578
+ },
1579
+ },
1580
+ },
1581
+ approve_args: {
1582
+ fields: {
1583
+ approver_address: {
1584
+ type: "bytes",
1585
+ id: 1,
1586
+ options: {
1587
+ "(koinos.btype)": "ADDRESS",
1588
+ },
1589
+ },
1590
+ to: {
1591
+ type: "bytes",
1592
+ id: 2,
1593
+ options: {
1594
+ "(koinos.btype)": "ADDRESS",
1595
+ },
1596
+ },
1597
+ token_id: {
1598
+ type: "bytes",
1599
+ id: 3,
1600
+ options: {
1601
+ "(koinos.btype)": "HEX",
1602
+ },
1603
+ },
1604
+ },
1605
+ },
1606
+ set_approval_for_all_args: {
1607
+ fields: {
1608
+ approver_address: {
1609
+ type: "bytes",
1610
+ id: 1,
1611
+ options: {
1612
+ "(koinos.btype)": "ADDRESS",
1613
+ },
1614
+ },
1615
+ operator_address: {
1616
+ type: "bytes",
1617
+ id: 2,
1618
+ options: {
1619
+ "(koinos.btype)": "ADDRESS",
1620
+ },
1621
+ },
1622
+ approved: {
1623
+ type: "bool",
1624
+ id: 3,
1625
+ },
1626
+ },
1627
+ },
1628
+ get_operators_args: {
1629
+ fields: {
1630
+ owner: {
1631
+ type: "bytes",
1632
+ id: 1,
1633
+ options: {
1634
+ "(koinos.btype)": "ADDRESS",
1635
+ },
1636
+ },
1637
+ start: {
1638
+ type: "bytes",
1639
+ id: 2,
1640
+ options: {
1641
+ "(koinos.btype)": "ADDRESS",
1642
+ },
1643
+ },
1644
+ limit: {
1645
+ type: "int32",
1646
+ id: 3,
1647
+ },
1648
+ descending: {
1649
+ type: "bool",
1650
+ id: 4,
1651
+ },
1652
+ },
1653
+ },
1654
+ get_operators_return: {
1655
+ fields: {
1656
+ owner: {
1657
+ type: "bytes",
1658
+ id: 1,
1659
+ options: {
1660
+ "(koinos.btype)": "ADDRESS",
1661
+ },
1662
+ },
1663
+ operators: {
1664
+ rule: "repeated",
1665
+ type: "bytes",
1666
+ id: 2,
1667
+ options: {
1668
+ "(koinos.btype)": "ADDRESS",
1669
+ },
1670
+ },
1671
+ },
1672
+ },
1673
+ get_tokens_args: {
1674
+ fields: {
1675
+ start: {
1676
+ type: "bytes",
1677
+ id: 1,
1678
+ options: {
1679
+ "(koinos.btype)": "HEX",
1680
+ },
1681
+ },
1682
+ limit: {
1683
+ type: "int32",
1684
+ id: 2,
1685
+ },
1686
+ descending: {
1687
+ type: "bool",
1688
+ id: 3,
1689
+ },
1690
+ },
1691
+ },
1692
+ get_tokens_by_owner_args: {
1693
+ fields: {
1694
+ owner: {
1695
+ type: "bytes",
1696
+ id: 1,
1697
+ options: {
1698
+ "(koinos.btype)": "ADDRESS",
1699
+ },
1700
+ },
1701
+ start: {
1702
+ type: "bytes",
1703
+ id: 2,
1704
+ options: {
1705
+ "(koinos.btype)": "HEX",
1706
+ },
1707
+ },
1708
+ limit: {
1709
+ type: "int32",
1710
+ id: 3,
1711
+ },
1712
+ descending: {
1713
+ type: "bool",
1714
+ id: 4,
1715
+ },
1716
+ },
1717
+ },
1718
+ token_ids: {
1719
+ fields: {
1720
+ token_ids: {
1721
+ rule: "repeated",
1722
+ type: "bytes",
1723
+ id: 1,
1724
+ options: {
1725
+ "(koinos.btype)": "HEX",
1726
+ },
1727
+ },
1728
+ },
1729
+ },
1730
+ },
1731
+ },
1732
+ },
1733
+ },
1734
+ events: {
1735
+ "collections.owner_event": {
1736
+ argument: "common.address",
1737
+ },
1738
+ "collections.royalties_event": {
1739
+ argument: "nft.royalties",
1740
+ },
1741
+ "collections.set_metadata_event": {
1742
+ argument: "nft.metadata_args",
1743
+ },
1744
+ "collections.token_approval_event": {
1745
+ argument: "nft.approve_args",
1746
+ },
1747
+ "collections.operator_approval_event": {
1748
+ argument: "nft.set_approval_for_all_args",
1749
+ },
1750
+ "collections.transfer_event": {
1751
+ argument: "nft.transfer_args",
1752
+ },
1753
+ "collections.mint_event": {
1754
+ argument: "nft.mint_args",
505
1755
  },
506
1756
  },
507
- koilib_types: token_proto_json_1.default,
508
1757
  };
509
1758
  //export const ProtocolTypes = protocolJson;
510
1759
  //# sourceMappingURL=utils.js.map