koilib 5.7.0 → 7.0.0

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