Skip to content

Commit 5bad32b

Browse files
committed
add swift quickstart, remove unused examples from js quickstart
1 parent 63ac85e commit 5bad32b

File tree

16 files changed

+735
-243
lines changed

16 files changed

+735
-243
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
},
7373
"doc-snippets": {
7474
"extract": {
75-
"include": "./**/*.{ts,tsx,js,json,yaml,txt,md,graphql,cue,kt,kts,py}",
75+
"include": "./**/*.{ts,tsx,js,json,yaml,txt,md,graphql,cue,kt,kts,py,swift}",
7676
"ignore": [
7777
"./**/node_modules/**",
7878
"./**/.polywrap/**",

snippets/quick-start/js/src/index.js

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -67,45 +67,6 @@ async function main() {
6767

6868
console.log("Pool address:", poolAddressResult.value);
6969
// $end
70-
71-
// $start: quickstart-js-resolve
72-
// We first want to resolve the IPFS WRAP URI of the UniswapV3 Wrap
73-
const resolutionResult = await client.tryResolveUri({
74-
uri: "wrapscan.io/polywrap/wrapscan-uri-resolver@1.0",
75-
});
76-
77-
if (!resolutionResult.ok) {
78-
throw resolutionResult.error;
79-
}
80-
81-
console.log(resolutionResult.value);
82-
// $end
83-
84-
// $start: quickstart-js-get-schema
85-
// Extract the IPFS CID from the resolution result's URI
86-
const cid = resolutionResult.value.uri.uri.replace("wrap://ipfs/", "");
87-
88-
// Since the CID is a directory, we need to add a path to the Wrap's manifest file
89-
const catResult = await client.invoke({
90-
uri: "wrapscan.io/polywrap/ipfs-http-client@1.0",
91-
method: "cat",
92-
args: {
93-
cid: cid + "/wrap.info",
94-
ipfsProvider: "https://ipfs.wrappers.io",
95-
},
96-
});
97-
98-
console.log(catResult);
99-
100-
if (!catResult.ok) {
101-
throw catResult.error;
102-
}
103-
104-
// Turn the returned buffer into a string and log it
105-
const schema = new TextDecoder().decode(catResult.value);
106-
107-
console.log(schema);
108-
// $end
10970
}
11071

11172
main()

snippets/quick-start/js/yarn.lock

Lines changed: 0 additions & 109 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,6 @@
1212
call-me-maybe "^1.0.1"
1313
js-yaml "^4.1.0"
1414

15-
"@cspotcode/source-map-support@^0.8.0":
16-
version "0.8.1"
17-
resolved "https://registry.yarnpkg.com/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz#00629c35a688e05a88b1cda684fb9d5e73f000a1"
18-
integrity sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==
19-
dependencies:
20-
"@jridgewell/trace-mapping" "0.3.9"
21-
2215
"@dorgjelli/graphql-schema-cycles@1.1.4":
2316
version "1.1.4"
2417
resolved "https://registry.yarnpkg.com/@dorgjelli/graphql-schema-cycles/-/graphql-schema-cycles-1.1.4.tgz#31f230c61f624f7c2ceca7e18fad8b2cb07d392f"
@@ -493,24 +486,6 @@
493486
intl-messageformat-parser "6.4.2"
494487
tslib "^2.1.0"
495488

496-
"@jridgewell/resolve-uri@^3.0.3":
497-
version "3.1.1"
498-
resolved "https://registry.yarnpkg.com/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz#c08679063f279615a3326583ba3a90d1d82cc721"
499-
integrity sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA==
500-
501-
"@jridgewell/sourcemap-codec@^1.4.10":
502-
version "1.4.15"
503-
resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz#d7c6e6755c78567a951e04ab52ef0fd26de59f32"
504-
integrity sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==
505-
506-
"@jridgewell/trace-mapping@0.3.9":
507-
version "0.3.9"
508-
resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz#6534fd5933a53ba7cbf3a17615e273a0d1273ff9"
509-
integrity sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==
510-
dependencies:
511-
"@jridgewell/resolve-uri" "^3.0.3"
512-
"@jridgewell/sourcemap-codec" "^1.4.10"
513-
514489
"@jsdevtools/ono@^7.1.3":
515490
version "7.1.3"
516491
resolved "https://registry.yarnpkg.com/@jsdevtools/ono/-/ono-7.1.3.tgz#9df03bbd7c696a5c58885c34aa06da41c8543796"
@@ -889,26 +864,6 @@
889864
ajv "8.12.0"
890865
semver "~7.5.4"
891866

892-
"@tsconfig/node10@^1.0.7":
893-
version "1.0.9"
894-
resolved "https://registry.yarnpkg.com/@tsconfig/node10/-/node10-1.0.9.tgz#df4907fc07a886922637b15e02d4cebc4c0021b2"
895-
integrity sha512-jNsYVVxU8v5g43Erja32laIDHXeoNvFEpX33OK4d6hljo3jDhCBDhx5dhCCTMWUojscpAagGiRkBKxpdl9fxqA==
896-
897-
"@tsconfig/node12@^1.0.7":
898-
version "1.0.11"
899-
resolved "https://registry.yarnpkg.com/@tsconfig/node12/-/node12-1.0.11.tgz#ee3def1f27d9ed66dac6e46a295cffb0152e058d"
900-
integrity sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==
901-
902-
"@tsconfig/node14@^1.0.0":
903-
version "1.0.3"
904-
resolved "https://registry.yarnpkg.com/@tsconfig/node14/-/node14-1.0.3.tgz#e4386316284f00b98435bf40f72f75a09dabf6c1"
905-
integrity sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==
906-
907-
"@tsconfig/node16@^1.0.2":
908-
version "1.0.4"
909-
resolved "https://registry.yarnpkg.com/@tsconfig/node16/-/node16-1.0.4.tgz#0b92dcc0cc1c81f6f306a381f28e31b1a56536e9"
910-
integrity sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==
911-
912867
"@types/json-schema@^7.0.6":
913868
version "7.0.13"
914869
resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.13.tgz#02c24f4363176d2d18fc8b70b9f3c54aba178a85"
@@ -919,28 +874,13 @@
919874
resolved "https://registry.yarnpkg.com/@types/node/-/node-20.7.0.tgz#c03de4572f114a940bc2ca909a33ddb2b925e470"
920875
integrity sha512-zI22/pJW2wUZOVyguFaUL1HABdmSVxpXrzIqkjsHmyUjNhPoWM1CKfvVuXfetHhIok4RY573cqS0mZ1SJEnoTg==
921876

922-
"@types/node@18.15.0":
923-
version "18.15.0"
924-
resolved "https://registry.yarnpkg.com/@types/node/-/node-18.15.0.tgz#286a65e3fdffd691e170541e6ecb0410b16a38be"
925-
integrity sha512-z6nr0TTEOBGkzLGmbypWOGnpSpSIBorEhC4L+4HeQ2iezKCi4f77kyslRwvHeNitymGQ+oFyIWGP96l/DPSV9w==
926-
927877
"@types/yauzl@^2.9.1":
928878
version "2.10.1"
929879
resolved "https://registry.yarnpkg.com/@types/yauzl/-/yauzl-2.10.1.tgz#4e8f299f0934d60f36c74f59cb5a8483fd786691"
930880
integrity sha512-CHzgNU3qYBnp/O4S3yv2tXPlvMTq0YWSTVg2/JYLqWZGHwwgJGAwd00poay/11asPq8wLFwHzubyInqHIFmmiw==
931881
dependencies:
932882
"@types/node" "*"
933883

934-
acorn-walk@^8.1.1:
935-
version "8.2.0"
936-
resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-8.2.0.tgz#741210f2e2426454508853a2f44d0ab83b7f69c1"
937-
integrity sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==
938-
939-
acorn@^8.4.1:
940-
version "8.10.0"
941-
resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.10.0.tgz#8be5b3907a67221a81ab23c7889c4c5526b62ec5"
942-
integrity sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw==
943-
944884
aes-js@3.0.0:
945885
version "3.0.0"
946886
resolved "https://registry.yarnpkg.com/aes-js/-/aes-js-3.0.0.tgz#e21df10ad6c2053295bcbb8dab40b09dbea87e4d"
@@ -976,11 +916,6 @@ anymatch@~3.1.1:
976916
normalize-path "^3.0.0"
977917
picomatch "^2.0.4"
978918

979-
arg@^4.1.0:
980-
version "4.1.3"
981-
resolved "https://registry.yarnpkg.com/arg/-/arg-4.1.3.tgz#269fc7ad5b8e42cb63c896d5666017261c144089"
982-
integrity sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==
983-
984919
argparse@^2.0.1:
985920
version "2.0.1"
986921
resolved "https://registry.yarnpkg.com/argparse/-/argparse-2.0.1.tgz#246f50f3ca78a3240f6c997e8a9bd1eac49e4b38"
@@ -1194,11 +1129,6 @@ core-util-is@~1.0.0:
11941129
resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.3.tgz#a6042d3634c2b27e9328f837b965fac83808db85"
11951130
integrity sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==
11961131

1197-
create-require@^1.1.0:
1198-
version "1.1.1"
1199-
resolved "https://registry.yarnpkg.com/create-require/-/create-require-1.1.1.tgz#c1d7e8f1e5f6cfc9ff65f9cd352d37348756c333"
1200-
integrity sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==
1201-
12021132
cross-spawn@^7.0.0:
12031133
version "7.0.3"
12041134
resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6"
@@ -1220,11 +1150,6 @@ delayed-stream@~1.0.0:
12201150
resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619"
12211151
integrity sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==
12221152

1223-
diff@^4.0.1:
1224-
version "4.0.2"
1225-
resolved "https://registry.yarnpkg.com/diff/-/diff-4.0.2.tgz#60f3aecb89d5fae520c11aa19efc2bb982aade7d"
1226-
integrity sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==
1227-
12281153
docker-compose@0.23.17:
12291154
version "0.23.17"
12301155
resolved "https://registry.yarnpkg.com/docker-compose/-/docker-compose-0.23.17.tgz#8816bef82562d9417dc8c790aa4871350f93a2ba"
@@ -1599,11 +1524,6 @@ lru-cache@^6.0.0:
15991524
dependencies:
16001525
yallist "^4.0.0"
16011526

1602-
make-error@^1.1.1:
1603-
version "1.3.6"
1604-
resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.6.tgz#2eb2e37ea9b67c4891f684a1394799af484cf7a2"
1605-
integrity sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==
1606-
16071527
map-age-cleaner@^0.1.3:
16081528
version "0.1.3"
16091529
resolved "https://registry.yarnpkg.com/map-age-cleaner/-/map-age-cleaner-0.1.3.tgz#7d583a7306434c055fe474b0f45078e6e1b4b92a"
@@ -2011,25 +1931,6 @@ toml@3.0.0:
20111931
resolved "https://registry.yarnpkg.com/toml/-/toml-3.0.0.tgz#342160f1af1904ec9d204d03a5d61222d762c5ee"
20121932
integrity sha512-y/mWCZinnvxjTKYhJ+pYxwD0mRLVvOtdS2Awbgxln6iEnt4rk0yBxeSBHkGJcPucRiG0e55mwWp+g/05rsrd6w==
20131933

2014-
ts-node@10.9.1:
2015-
version "10.9.1"
2016-
resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-10.9.1.tgz#e73de9102958af9e1f0b168a6ff320e25adcff4b"
2017-
integrity sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==
2018-
dependencies:
2019-
"@cspotcode/source-map-support" "^0.8.0"
2020-
"@tsconfig/node10" "^1.0.7"
2021-
"@tsconfig/node12" "^1.0.7"
2022-
"@tsconfig/node14" "^1.0.0"
2023-
"@tsconfig/node16" "^1.0.2"
2024-
acorn "^8.4.1"
2025-
acorn-walk "^8.1.1"
2026-
arg "^4.1.0"
2027-
create-require "^1.1.0"
2028-
diff "^4.0.1"
2029-
make-error "^1.1.1"
2030-
v8-compile-cache-lib "^3.0.1"
2031-
yn "3.1.1"
2032-
20331934
tslib@^2.1.0:
20341935
version "2.6.2"
20351936
resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.6.2.tgz#703ac29425e7b37cd6fd456e92404d46d1f3e4ae"
@@ -2067,11 +1968,6 @@ util-deprecate@~1.0.1:
20671968
resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf"
20681969
integrity sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==
20691970

2070-
v8-compile-cache-lib@^3.0.1:
2071-
version "3.0.1"
2072-
resolved "https://registry.yarnpkg.com/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz#6336e8d71965cb3d35a1bbb7868445a7c05264bf"
2073-
integrity sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==
2074-
20751971
varint@^5.0.0:
20761972
version "5.0.2"
20771973
resolved "https://registry.yarnpkg.com/varint/-/varint-5.0.2.tgz#5b47f8a947eb668b848e034dcfa87d0ff8a7f7a4"
@@ -2158,8 +2054,3 @@ yesno@0.4.0:
21582054
version "0.4.0"
21592055
resolved "https://registry.yarnpkg.com/yesno/-/yesno-0.4.0.tgz#5d674f14d339f0bd4b0edc47f899612c74fcd895"
21602056
integrity sha512-tdBxmHvbXPBKYIg81bMCB7bVeDmHkRzk5rVJyYYXurwKkHq/MCd8rz4HSJUP7hW0H2NlXiq8IFiWvYKEHhlotA==
2161-
2162-
yn@3.1.1:
2163-
version "3.1.1"
2164-
resolved "https://registry.yarnpkg.com/yn/-/yn-3.1.1.tgz#1e87401a09d767c1d5eab26a6e4c185182d2eb50"
2165-
integrity sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
# Xcode
2+
#
3+
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
4+
5+
## User settings
6+
xcuserdata/
7+
8+
## compatibility with Xcode 8 and earlier (ignoring not required starting Xcode 9)
9+
*.xcscmblueprint
10+
*.xccheckout
11+
12+
## compatibility with Xcode 3 and earlier (ignoring not required starting Xcode 4)
13+
build/
14+
DerivedData/
15+
*.moved-aside
16+
*.pbxuser
17+
!default.pbxuser
18+
*.mode1v3
19+
!default.mode1v3
20+
*.mode2v3
21+
!default.mode2v3
22+
*.perspectivev3
23+
!default.perspectivev3
24+
25+
## Obj-C/Swift specific
26+
*.hmap
27+
28+
## App packaging
29+
*.ipa
30+
*.dSYM.zip
31+
*.dSYM
32+
33+
## Playgrounds
34+
timeline.xctimeline
35+
playground.xcworkspace
36+
37+
# Swift Package Manager
38+
#
39+
# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies.
40+
# Packages/
41+
# Package.pins
42+
# Package.resolved
43+
# *.xcodeproj
44+
#
45+
# Xcode automatically generates this directory with a .xcworkspacedata file and xcuserdata
46+
# hence it is not needed unless you have added a package configuration file to your project
47+
# .swiftpm
48+
49+
.build/
50+
51+
# CocoaPods
52+
#
53+
# We recommend against adding the Pods directory to your .gitignore. However
54+
# you should judge for yourself, the pros and cons are mentioned at:
55+
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
56+
#
57+
# Pods/
58+
#
59+
# Add this line if you want to avoid checking in source code from the Xcode workspace
60+
# *.xcworkspace
61+
62+
# Carthage
63+
#
64+
# Add this line if you want to avoid checking in source code from Carthage dependencies.
65+
# Carthage/Checkouts
66+
67+
Carthage/Build/
68+
69+
# Accio dependency management
70+
Dependencies/
71+
.accio/
72+
73+
# fastlane
74+
#
75+
# It is recommended to not store the screenshots in the git repo.
76+
# Instead, use fastlane to re-generate the screenshots whenever they are needed.
77+
# For more information about the recommended setup visit:
78+
# https://docs.fastlane.tools/best-practices/source-control/#source-control
79+
80+
fastlane/report.xml
81+
fastlane/Preview.html
82+
fastlane/screenshots/**/*.png
83+
fastlane/test_output
84+
85+
# Code Injection
86+
#
87+
# After new code Injection tools there's a generated folder /iOSInjectionProject
88+
# https://github.com/johnno1962/injectionforxcode
89+
90+
iOSInjectionProject/

0 commit comments

Comments
 (0)